aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile29
-rw-r--r--README.md2
-rw-r--r--all_test.go233
-rw-r--r--doc.go41
-rw-r--r--generator.go431
-rw-r--r--go.mod8
-rw-r--r--go.sum25
-rw-r--r--internal/libc2/Makefile (renamed from internal/crt2/Makefile)0
-rw-r--r--internal/libc2/all_test.go (renamed from internal/crt2/all_test.go)2
-rw-r--r--internal/libc2/capi_linux_amd64.go (renamed from internal/crt2/capi_linux_amd64.go)4
-rw-r--r--internal/libc2/libc2.go (renamed from internal/crt2/crt2.go)46
-rw-r--r--internal/mptest/main_linux_amd64.go574
-rw-r--r--internal/testfixture/main.go34
-rw-r--r--internal/testfixture/testfixture_linux_amd64.go21635
-rw-r--r--lib/capi_linux_amd64.go70
-rw-r--r--lib/sqlite_linux_amd64.go69189
-rw-r--r--mutex.go50
-rw-r--r--speedtest1/main_linux_amd64.go1544
-rw-r--r--sqlite.go120
-rw-r--r--tcl_test.go118
-rw-r--r--testdata/.gitignore1
-rw-r--r--testdata/tcl/altertab.test18
-rw-r--r--testdata/tcl/altertab3.test14
-rw-r--r--testdata/tcl/busy2.test135
-rw-r--r--testdata/tcl/corrupt3.test2
-rw-r--r--testdata/tcl/corruptL.test73
-rw-r--r--testdata/tcl/cost.test4
-rw-r--r--testdata/tcl/dbfuzz001.test2
-rw-r--r--testdata/tcl/decimal.test186
-rw-r--r--testdata/tcl/e_droptrigger.test4
-rw-r--r--testdata/tcl/e_fkey.test4
-rw-r--r--testdata/tcl/filter1.test18
-rw-r--r--testdata/tcl/fkey5.test65
-rw-r--r--testdata/tcl/fts3corrupt4.test175
-rw-r--r--testdata/tcl/fts3corrupt6.test60
-rw-r--r--testdata/tcl/fts4upfrom.test140
-rw-r--r--testdata/tcl/gencol1.test26
-rw-r--r--testdata/tcl/hook.test5
-rw-r--r--testdata/tcl/ieee754.test4
-rw-r--r--testdata/tcl/index7.test12
-rw-r--r--testdata/tcl/indexedby.test26
-rw-r--r--testdata/tcl/misc7.test3
-rw-r--r--testdata/tcl/mutex1.test10
-rw-r--r--testdata/tcl/pager1.test2
-rw-r--r--testdata/tcl/permutations.test26
-rw-r--r--testdata/tcl/pg_common.tcl2
-rw-r--r--testdata/tcl/pragma.test22
-rw-r--r--testdata/tcl/pragma4.test11
-rw-r--r--testdata/tcl/printf.test8
-rw-r--r--testdata/tcl/shell1.test69
-rw-r--r--testdata/tcl/stat.test30
-rw-r--r--testdata/tcl/tester.tcl2
-rw-r--r--testdata/tcl/triggerupfrom.test174
-rw-r--r--testdata/tcl/upfrom1.tcl115
-rw-r--r--testdata/tcl/upfrom1.test178
-rw-r--r--testdata/tcl/upfrom2.test371
-rw-r--r--testdata/tcl/upfrom3.test262
-rw-r--r--testdata/tcl/upfromfault.test140
-rw-r--r--testdata/tcl/wal2.test28
-rw-r--r--testdata/tcl/walprotocol.test28
-rw-r--r--testdata/tcl/walvfs.test2
-rw-r--r--testdata/tcl/wapptest.tcl3
-rw-r--r--testdata/tcl/where.test8
-rw-r--r--testdata/tcl/where9.test14
-rw-r--r--testdata/tcl/wherelimit2.test16
-rw-r--r--testdata/tcl/window1.test54
-rw-r--r--testdata/tcl/without_rowid3.test18
-rw-r--r--testdata/testfixture_linux_amd64-extraquick.golden12
-rw-r--r--testdata/testfixture_linux_amd64-full.golden12
-rw-r--r--testdata/testfixture_linux_amd64.golden188
70 files changed, 73022 insertions, 23915 deletions
diff --git a/Makefile b/Makefile
index 2abd2e6..e07d08c 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-.PHONY: all clean cover cpu editor internalError later mem nuke todo edit tcl
+.PHONY: all clean cover cpu editor internalError later mem nuke todo edit tcl extraquick full
grep=--include=*.go --include=*.l --include=*.y --include=*.yy
ngrep='TODOOK\|internal\/vfs\|internal\/bin\|internal\/mptest\|.*stringer.*\.go'
@@ -13,24 +13,31 @@ all: editor
./unconvert.sh
gofmt -l -s -w *.go
go test -i
- go test 2>&1 -timeout 1h | tee -a log
- #TODO GOOS=linux GOARCH=arm go build
- #TODO GOOS=linux GOARCH=arm64 go build
- #TODO GOOS=linux GOARCH=386 go build
- GOOS=linux GOARCH=amd64 go build
- #TODO GOOS=windows GOARCH=386 go build
- #TODO GOOS=windows GOARCH=amd64 go build
- go vet 2>&1 | grep -v $(ngrep) || true
+ go test -v 2>&1 -timeout 1h | tee -a log
+ go run speedtest1/main_$(shell go env GOOS)_$(shell go env GOARCH).go
+ #TODO GOOS=linux GOARCH=arm go build -v ./...
+ #TODO GOOS=linux GOARCH=arm64 go build -v ./...
+ #TODO GOOS=linux GOARCH=386 go build -v ./...
+ GOOS=linux GOARCH=amd64 go build -v ./...
+ #TODO GOOS=windows GOARCH=386 go build -v ./...
+ #TODO GOOS=windows GOARCH=amd64 go build -v ./...
golint 2>&1 | grep -v $(ngrep) || true
- make todo
misspell *.go
- staticcheck | grep -v 'lexer\.go\|parser\.go' || true
+ staticcheck || true
maligned || true
git diff --unified=0 testdata *.golden
grep -n 'FAIL\|PASS' log
go version
date 2>&1 | tee -a log
+extraquick:
+ go test -timeout 24h -v -run Tcl -suite extraquick -maxerror 1 2>&1 | tee log-extraquick
+ date
+
+full:
+ go test -timeout 24h -v -run Tcl -suite full 2>&1 | tee log-full
+ date
+
clean:
go clean
rm -f *~ *.test *.out test.db* tt4-test*.db* test_sv.* testdb-*
diff --git a/README.md b/README.md
index 71b9c72..117136c 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# sqlite
-Package sqlite is an in-process implementation of a self-contained, serverless, zero-configuration, transactional SQL database engine. (Work In Progress)
+Package sqlite is an in-process implementation of a self-contained, serverless, zero-configuration, transactional SQL database engine.
Installation
diff --git a/all_test.go b/all_test.go
index 26059c8..4b6b929 100644
--- a/all_test.go
+++ b/all_test.go
@@ -21,13 +21,10 @@ import (
"strconv"
"strings"
"sync"
- "sync/atomic"
"testing"
"time"
"modernc.org/mathutil"
- "modernc.org/sqlite/internal/testfixture"
- "modernc.org/tcl"
)
func caller(s string, va ...interface{}) {
@@ -55,54 +52,63 @@ func dbg(s string, va ...interface{}) {
os.Stderr.Sync()
}
-var traceLevel int32
+func stack() string { return string(debug.Stack()) }
-func trace() func() {
- return func() {}
- n := atomic.AddInt32(&traceLevel, 1)
- pc, file, line, _ := runtime.Caller(1)
- s := strings.Repeat("ยท ", int(n)-1)
- fn := runtime.FuncForPC(pc)
- fmt.Fprintf(os.Stderr, "%s# trace %s:%d:%s: in\n", s, path.Base(file), line, fn.Name())
- os.Stderr.Sync()
- return func() {
- atomic.AddInt32(&traceLevel, -1)
- fmt.Fprintf(os.Stderr, "%s# trace %s:%d:%s: out\n", s, path.Base(file), line, fn.Name())
- os.Stderr.Sync()
- }
-}
+func use(...interface{}) {}
-func TODO(...interface{}) string { //TODOOK
- _, fn, fl, _ := runtime.Caller(1)
- return fmt.Sprintf("# TODO: %s:%d:\n", path.Base(fn), fl) //TODOOK
+func init() {
+ use(caller, dbg, stack, todo, trc) //TODOOK
}
-func stack() string { return string(debug.Stack()) }
+func origin(skip int) string {
+ pc, fn, fl, _ := runtime.Caller(skip)
+ f := runtime.FuncForPC(pc)
+ var fns string
+ if f != nil {
+ fns = f.Name()
+ if x := strings.LastIndex(fns, "."); x > 0 {
+ fns = fns[x+1:]
+ }
+ }
+ return fmt.Sprintf("%s:%d:%s", fn, fl, fns)
+}
-func use(...interface{}) {}
+func todo(s string, args ...interface{}) string { //TODO-
+ switch {
+ case s == "":
+ s = fmt.Sprintf(strings.Repeat("%v ", len(args)), args...)
+ default:
+ s = fmt.Sprintf(s, args...)
+ }
+ r := fmt.Sprintf("%s: TODOTODO %s", origin(2), s) //TODOOK
+ fmt.Fprintf(os.Stdout, "%s\n", r)
+ os.Stdout.Sync()
+ return r
+}
-func init() {
- use(caller, dbg, TODO, trace, stack) //TODOOK
+func trc(s string, args ...interface{}) string { //TODO-
+ switch {
+ case s == "":
+ s = fmt.Sprintf(strings.Repeat("%v ", len(args)), args...)
+ default:
+ s = fmt.Sprintf(s, args...)
+ }
+ r := fmt.Sprintf("\n%s: TRC %s", origin(2), s)
+ fmt.Fprintf(os.Stdout, "%s\n", r)
+ os.Stdout.Sync()
+ return r
}
// ============================================================================
var (
- oMaxError = flag.Uint("maxerror", 0, "argument of -maxerror passed to the Tcl test suite")
- oStart = flag.String("start", "", "argument of -start passed to the Tcl test suite (--start=[$permutation:]$testfile)")
- oTcl = flag.Bool("tcl", true, "enable Tcl tests")
- oVerbose = flag.String("verbose", "0", "argument of -verbose passed to the Tcl test suite, must be set to a boolean (0, 1) or to \"file\"")
oRecsPerSec = flag.Bool("recs_per_sec_as_mbps", false, "Show records per second as MB/s.")
+ oXTags = flag.String("xtags", "", "passed to go build of testfixture in TestTclTest")
)
func TestMain(m *testing.M) {
- oTestFixture := flag.Bool("testfixture", false, "emulate running the testfixture binary produced by sqlite3 '$ make tcltest'")
flag.Parse()
- if !*oTestFixture {
- os.Exit(m.Run())
- }
-
- tclTestMain()
+ os.Exit(m.Run())
}
func tempDB(t testing.TB) (string, *sql.DB) {
@@ -527,7 +533,12 @@ func TestConcurrentProcesses(t *testing.T) {
}
}
- out, err := exec.Command("go", "build", "-o", filepath.Join(dir, "mptest"), "modernc.org/sqlite/internal/mptest").CombinedOutput()
+ args := []string{"build", "-o", filepath.Join(dir, "mptest")}
+ if s := *oXTags; s != "" {
+ args = append(args, "-tags", s)
+ }
+ args = append(args, "modernc.org/sqlite/internal/mptest")
+ out, err := exec.Command("go", args...).CombinedOutput()
if err != nil {
t.Fatalf("%s\n%v", out, err)
}
@@ -786,153 +797,3 @@ func TestNoRows(t *testing.T) {
t.Fatal(err)
}
}
-
-func TestTclTest(t *testing.T) {
- if !*oTcl {
- t.Skip("Not enabled")
- }
-
- blacklist := []string{
- //TODO crashers
- "misc1.test",
- "quota2.test",
- "zipfile.test",
-
- //TODO needs fork
- "exists.test",
- "multiplex2.test",
- "pager1.test",
- "rowallock.test",
- "savepoint.test",
- "schema3.test",
- "shared2.test",
- "superlock.test",
- "syscall.test",
- "tkt-5d863f876e.test",
- "tkt-fc62af4523.test",
- "unixexcl.test",
- "wal.test",
- "wal5.test",
- "walro.test",
- "walro2.test",
- "walsetlk.test",
-
- //TODO exits tests
- "index.test",
-
- //TODO OOM
- "csv01.test",
- }
- if testing.Short() {
- blacklist = append(blacklist, []string{
- "altermalloc.test",
- "altermalloc2.test",
- "attachmalloc.test",
- "backup_ioerr.test",
- "backup_malloc.test",
- "corruptC.test",
- "e_walckpt.test",
- "fkey_malloc.test",
- "fuzz.test",
- "fuzz3.test",
- "incrvacuum_ioerr.test",
- "pagerfault2.test",
- "savepoint6.test",
- "savepointfault.test",
- "securedel2.test",
- "shared_err.test",
- "sort3.test",
- "tempfault.test",
- "vacuum3.test",
- "vtab_err.test",
- "walprotocol.test",
- }...)
- }
-
- m, err := filepath.Glob(filepath.FromSlash("testdata/tcl/*"))
- if err != nil {
- t.Fatal(err)
- }
-
- dir, err := ioutil.TempDir("", "sqlite-test-")
- if err != nil {
- t.Fatal(err)
- }
-
- defer os.RemoveAll(dir)
-
- wd, err := os.Getwd()
- if err != nil {
- t.Fatal(err)
- }
-
- defer os.Chdir(wd)
-
- if err := os.Chdir(dir); err != nil {
- t.Fatal(err)
- }
-
- blacklisted := map[string]struct{}{}
- for _, v := range blacklist {
- blacklisted[v] = struct{}{}
- }
- for _, v := range m {
- if _, ok := blacklisted[filepath.Base(v)]; ok {
- continue
- }
-
- s := filepath.Join(wd, v)
- d := filepath.Join(dir, filepath.Base(v))
- f, err := ioutil.ReadFile(s)
- if err != nil {
- t.Fatal(err)
- }
- if err := ioutil.WriteFile(d, f, 0660); err != nil {
- t.Fatal(err)
- }
- }
-
- library := filepath.Join(dir, "library")
- if err := tcl.Library(library); err != nil {
- t.Fatal(err)
- }
-
- os.Setenv("TCL_LIBRARY", library)
- //TODO f, err := os.Create(filepath.Join(wd, "testdata", filepath.Join("testdata", fmt.Sprintf("testfixture_%s_%s.golden", runtime.GOOS, runtime.GOARCH))))
- //TODO if err != nil {
- //TODO t.Fatal(err)
- //TODO }
-
- //TODO defer f.Close()
-
- //TODO args := []string{"-testfixture", "all.test"}
- args := []string{"-testfixture", "permutations.test", "extraquick"}
- if *oVerbose != "" {
- args = append(args, fmt.Sprintf("-verbose=%s", *oVerbose))
- }
- if *oMaxError != 0 {
- args = append(args, fmt.Sprintf("-maxerror=%d", *oMaxError))
- }
- if *oStart != "" {
- args = append(args, fmt.Sprintf("-start=%s", *oStart))
- }
- cmd := exec.Command(os.Args[0], args...)
- cmd.Stdout = os.Stdout
- cmd.Stderr = os.Stderr
- if err := cmd.Run(); err != nil {
- t.Fatal(err)
- }
-}
-
-func tclTestMain() {
- var argv []string
- for _, v := range os.Args {
- if !strings.HasPrefix(v, "-test.") && v != "-testfixture" {
- argv = append(argv, v)
- }
- }
- os.Args = argv
- fmt.Printf("testfixture %q\n", os.Args)
- testfixture.Main()
- panic("unreachable")
-}
diff --git a/doc.go b/doc.go
index 10c7611..aaceb23 100644
--- a/doc.go
+++ b/doc.go
@@ -3,10 +3,31 @@
// license that can be found in the LICENSE file.
// Package sqlite is an in-process implementation of a self-contained,
-// serverless, zero-configuration, transactional SQL database engine. (Work In Progress)
+// serverless, zero-configuration, transactional SQL database engine.
//
// Changelog
//
+// 2020-08-26 v1.4.0:
+//
+// First stable release for linux/amd64. The database/sql driver and its tests
+// are CGo free. Tests of the translated sqlite3.c library still require CGo.
+//
+// $ make full
+//
+// ...
+//
+// SQLite 2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f
+// 0 errors out of 928271 tests on 3900x Linux 64-bit little-endian
+// WARNING: Multi-threaded tests skipped: Linked against a non-threadsafe Tcl build
+// All memory allocations freed - no leaks
+// Maximum memory usage: 9156360 bytes
+// Current memory usage: 0 bytes
+// Number of malloc() : -1 calls
+// --- PASS: TestTclTest (1785.04s)
+// PASS
+// ok modernc.org/sqlite 1785.041s
+// $
+//
// 2020-07-26 v1.4.0-beta1:
//
// The project has reached beta status while supporting linux/amd64 only at the
@@ -56,9 +77,10 @@
//
// ...
//
-//
// Supported platforms and architectures
//
+// These combinations of GOOS and GOARCH are currently supported
+//
// linux amd64
//
// Planned platforms and architectures
@@ -69,6 +91,21 @@
// windows 386
// windows amd64
//
+// Debug and development versions
+//
+// A comma separated list of options can be passed to `go generate` via the
+// environment variable GO_GENERATE. Some useful options include for example:
+//
+// -DSQLITE_DEBUG
+// -DSQLITE_MEM_DEBUG
+// -ccgo-verify-structs
+//
+// To create a debug/development version, issue for example:
+//
+// $ GO_GENERATE=-DSQLITE_DEBUG,-DSQLITE_MEM_DEBUG go generate
+//
+// Note: To run `go generate` you need to have modernc.org/ccgo/v3 installed.
+//
// Sqlite documentation
//
// See https://sqlite.org/docs.html
diff --git a/generator.go b/generator.go
index 15adfea..505b962 100644
--- a/generator.go
+++ b/generator.go
@@ -20,46 +20,184 @@ import (
"strings"
)
+// gcc
+// -g
+// -O2
+// -DSQLITE_OS_UNIX=1
+// -I.
+// -I/home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src
+// -I/home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/rtree
+// -I/home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/icu
+// -I/home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/fts3
+// -I/home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/async
+// -I/home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/session
+// -I/home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/userauth
+// -D_HAVE_SQLITE_CONFIG_H
+// -DBUILD_sqlite
+// -DNDEBUG
+// -I/usr/include/tcl8.6
+// -DSQLITE_THREADSAFE=1
+// -DSQLITE_HAVE_ZLIB=1
+// -DSQLITE_NO_SYNC=1
+// -DSQLITE_TEMP_STORE=1
+// -DSQLITE_TEST=1
+// -DSQLITE_CRASH_TEST=1
+// -DTCLSH_INIT_PROC=sqlite3TestInit
+// -DSQLITE_SERVER=1
+// -DSQLITE_PRIVATE=
+// -DSQLITE_CORE
+// -DBUILD_sqlite
+// -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
+// -DSQLITE_DEFAULT_PAGE_SIZE=1024
+// -DSQLITE_ENABLE_STMTVTAB
+// -DSQLITE_ENABLE_DBPAGE_VTAB
+// -DSQLITE_ENABLE_BYTECODE_VTAB
+// -DSQLITE_ENABLE_DESERIALIZE
+// -o testfixture
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test1.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test2.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test3.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test4.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test5.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test6.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test7.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test8.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test9.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_autoext.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_async.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_backup.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_bestindex.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_blob.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_btree.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_config.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_delete.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_demovfs.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_devsym.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_fs.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_func.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_hexio.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_init.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_intarray.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_journal.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_malloc.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_md5.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_multiplex.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_mutex.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_onefile.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_osinst.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_pcache.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_quota.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_rtree.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_schema.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_server.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_superlock.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_syscall.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_tclsh.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_tclvar.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_thread.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_vdbecov.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_vfs.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_windirent.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_window.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/test_wsd.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/fts3/fts3_term.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/fts3/fts3_test.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/session/test_session.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/rbu/test_rbu.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/expert/sqlite3expert.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/expert/test_expert.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/amatch.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/carray.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/closure.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/csv.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/decimal.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/eval.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/explain.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/fileio.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/fuzzer.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/fts5/fts5_tcl.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/fts5/fts5_test_mi.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/fts5/fts5_test_tok.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/ieee754.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/mmapwarm.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/nextchar.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/normalize.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/percentile.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/prefixes.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/regexp.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/remember.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/series.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/spellfix.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/totype.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/unionvtab.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/wholenumber.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/misc/zipfile.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/ext/userauth/userauth.c
+// /home/jnml/src/modernc.org/sqlite/testdata/SQLite-3c5e63c2/src/tclsqlite.c
+// sqlite3.c
+// -L/usr/lib/x86_64-linux-gnu
+// -ltcl8.6
+// -ldl
+// -lz
+// -lpthread
+
var (
config = []string{
"-DHAVE_USLEEP",
"-DLONGDOUBLE_TYPE=double",
- "-DNDEBUG",
- "-DSQLITE_CORE", // testfixture
- "-DSQLITE_DEFAULT_MEMSTATUS=0",
+ "-DSQLITE_CORE", // testfixture
+ "-DSQLITE_DEFAULT_MEMSTATUS=0", // bug reported https://sqlite.org/forum/info/d8dfd4771689be35, fixed in https://sqlite.org/src/info/3c5e63c22ffbfeb6
"-DSQLITE_DEFAULT_PAGE_SIZE=1024", // testfixture, hardcoded. See file_pages in autovacuum.test.
- "-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1",
- "-DSQLITE_DQS=0",
- "-DSQLITE_ENABLE_BYTECODE_VTAB", // testfixture
- "-DSQLITE_ENABLE_DBPAGE_VTAB", // testfixture
- "-DSQLITE_ENABLE_DESERIALIZE", // testfixture
+ "-DSQLITE_ENABLE_BYTECODE_VTAB", // testfixture
+ "-DSQLITE_ENABLE_COLUMN_METADATA",
+ "-DSQLITE_ENABLE_DBPAGE_VTAB", // testfixture
+ "-DSQLITE_ENABLE_DBSTAT_VTAB",
+ "-DSQLITE_ENABLE_DESERIALIZE", // testfixture
+ "-DSQLITE_ENABLE_EXPLAIN_COMMENTS",
+ "-DSQLITE_ENABLE_FTS5",
+ "-DSQLITE_ENABLE_GEOPOLY",
+ "-DSQLITE_ENABLE_JSON1",
+ "-DSQLITE_ENABLE_MEMORY_MANAGEMENT",
+ "-DSQLITE_ENABLE_OFFSET_SQL_FUNC",
+ "-DSQLITE_ENABLE_PREUPDATE_HOOK",
+ "-DSQLITE_ENABLE_RBU",
+ "-DSQLITE_ENABLE_RTREE",
+ "-DSQLITE_ENABLE_SNAPSHOT",
+ "-DSQLITE_ENABLE_STAT4",
"-DSQLITE_ENABLE_STMTVTAB", // testfixture
"-DSQLITE_ENABLE_UNLOCK_NOTIFY", // Adds sqlite3_unlock_notify().
"-DSQLITE_HAVE_ZLIB=1", // testfixture
"-DSQLITE_LIKE_DOESNT_MATCH_BLOBS",
- "-DSQLITE_MAX_EXPR_DEPTH=0",
- "-DSQLITE_MAX_MMAP_SIZE=8589934592", // testfixture
"-DSQLITE_MUTEX_APPDEF=1",
"-DSQLITE_MUTEX_NOOP",
- "-DSQLITE_NO_SYNC=1", // testfixture
- "-DSQLITE_OS_UNIX=1", // testfixture //TODO adjust for non unix OS
- "-DSQLITE_SERIES_CONSTRAINT_VERIFY=1", // testfixture
- "-DSQLITE_SERVER=1", // testfixture
- "-DSQLITE_TEMP_STORE=1", // testfixture
+ "-DSQLITE_OS_UNIX=1", // testfixture //TODO adjust for non unix OS
+ "-DSQLITE_SOUNDEX",
+ "-DSQLITE_TEMP_STORE=1", // testfixture
"-DSQLITE_TEST",
"-DSQLITE_THREADSAFE=1",
"-ccgo-long-double-is-double",
- // "-DSQLITE_OMIT_DECLTYPE", // testfixture
- // "-DSQLITE_OMIT_DEPRECATED", // mptest
- // "-DSQLITE_OMIT_LOAD_EXTENSION", // mptest
- // "-DSQLITE_OMIT_SHARED_CACHE",
- // "-DSQLITE_USE_ALLOCA",
+ //DONT "-DNDEBUG", // To enable GO_GENERATE=-DSQLITE_DEBUG
+ //DONT "-DSQLITE_DQS=0", // testfixture
+ //DONT "-DSQLITE_ENABLE_SESSION", // Needs UTF16
+ //DONT "-DSQLITE_NO_SYNC=1",
+ //DONT "-DSQLITE_OMIT_DECLTYPE", // testfixture
+ //DONT "-DSQLITE_OMIT_DEPRECATED", // mptest
+ //DONT "-DSQLITE_OMIT_LOAD_EXTENSION", // mptest
+ //DONT "-DSQLITE_OMIT_SHARED_CACHE",
+ //DONT "-DSQLITE_USE_ALLOCA",
//TODO "-DHAVE_MALLOC_USABLE_SIZE"
+ //TODO "-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1", //TODO report bug
+ //TODO "-DSQLITE_ENABLE_FTS3",
+ //TODO "-DSQLITE_ENABLE_FTS3_PARENTHESIS",
+ //TODO "-DSQLITE_ENABLE_FTS3_TOKENIZER",
+ //TODO "-DSQLITE_ENABLE_FTS4",
+ //TODO "-DSQLITE_ENABLE_ICU",
+ //TODO "-DSQLITE_MAX_EXPR_DEPTH=0", // bug reported https://sqlite.org/forum/forumpost/87b9262f66, fixed in https://sqlite.org/src/info/5f58dd3a19605b6f
+ //TODO "-DSQLITE_MAX_MMAP_SIZE=8589934592", // testfixture, bug reported https://sqlite.org/forum/forumpost/34380589f7, fixed in https://sqlite.org/src/info/d8e47382160e98be
//TODO 386 "-DSQLITE_MAX_MMAP_SIZE=0", // mmap somehow fails on linux/386
- //TODO- "-DSQLITE_DEBUG", //TODO-
- //TODO- "-DSQLITE_ENABLE_API_ARMOR", //TODO-
- //TODO- "-DSQLITE_MEMDEBUG", //TODO-
- //TODO- "-ccgo-verify-structs", //TODO-
+ //TODO- "-DSQLITE_DEBUG",
+ //TODO- "-DSQLITE_ENABLE_API_ARMOR",
+ //TODO- "-DSQLITE_MEMDEBUG",
}
downloads = []struct {
@@ -67,12 +205,12 @@ var (
sz int
dev bool
}{
- {sqliteDir, "https://www.sqlite.org/2020/sqlite-amalgamation-3320300.zip", 2240, false},
- {sqliteSrcDir, "https://www.sqlite.org/2020/sqlite-src-3320300.zip", 12060, false},
+ {sqliteDir, "https://www.sqlite.org/2020/sqlite-amalgamation-3330000.zip", 2420, false},
+ {sqliteSrcDir, "https://www.sqlite.org/2020/sqlite-src-3330000.zip", 12060, false},
}
- sqliteDir = filepath.FromSlash("testdata/sqlite-amalgamation-3320300")
- sqliteSrcDir = filepath.FromSlash("testdata/sqlite-src-3320300")
+ sqliteDir = filepath.FromSlash("testdata/sqlite-amalgamation-3330000")
+ sqliteSrcDir = filepath.FromSlash("testdata/sqlite-src-3330000")
)
func download() {
@@ -187,11 +325,23 @@ func fail(s string, args ...interface{}) {
}
func main() {
+ env := os.Getenv("GO_GENERATE")
+ var more []string
+ if env != "" {
+ more = strings.Split(env, ",")
+ }
+ ndebug := []string{"-DNDEBUG"}
+ for _, v := range more {
+ if v == "-DSQLITE_DEBUG" {
+ ndebug = nil
+ }
+ }
+ more = append(more, ndebug...)
download()
- makeSqlite()
- makeMpTest()
- makeSpeedTest()
- makeTestfixture()
+ makeSqlite(more)
+ makeMpTest(more)
+ makeSpeedTest(more)
+ makeTestfixture(more)
dst := filepath.FromSlash("testdata/tcl")
if err := os.MkdirAll(dst, 0770); err != nil {
@@ -208,7 +358,7 @@ func main() {
fail("cannot glob *.tcl: %v", err)
}
- m = append(m, m2...)
+ m = join(m, m2)
for _, v := range m {
f, err := ioutil.ReadFile(v)
if err != nil {
@@ -256,143 +406,167 @@ func newCmd(bin string, args ...string) *exec.Cmd {
return r
}
-func makeTestfixture() {
+func makeTestfixture(more []string) {
dir := filepath.FromSlash(fmt.Sprintf("internal/testfixture"))
+ files := []string{
+ "ext/expert/sqlite3expert.c",
+ "ext/expert/test_expert.c",
+ "ext/fts3/fts3_term.c",
+ "ext/fts3/fts3_test.c",
+ "ext/fts5/fts5_tcl.c",
+ "ext/fts5/fts5_test_mi.c",
+ "ext/fts5/fts5_test_tok.c",
+ "ext/misc/amatch.c",
+ "ext/misc/carray.c",
+ "ext/misc/closure.c",
+ "ext/misc/csv.c",
+ "ext/misc/decimal.c",
+ "ext/misc/eval.c",
+ "ext/misc/explain.c",
+ "ext/misc/fileio.c",
+ "ext/misc/fuzzer.c",
+ "ext/misc/ieee754.c",
+ "ext/misc/mmapwarm.c",
+ "ext/misc/nextchar.c",
+ "ext/misc/normalize.c",
+ "ext/misc/percentile.c",
+ "ext/misc/prefixes.c",
+ "ext/misc/regexp.c",
+ "ext/misc/remember.c",
+ "ext/misc/series.c",
+ "ext/misc/spellfix.c",
+ "ext/misc/totype.c",
+ "ext/misc/unionvtab.c",
+ "ext/misc/wholenumber.c",
+ "ext/misc/zipfile.c",
+ "ext/rbu/test_rbu.c",
+ // "ext/session/test_session.c", // Needs UTF16
+ "ext/userauth/userauth.c",
+ "src/tclsqlite.c",
+ "src/test1.c",
+ "src/test2.c",
+ "src/test3.c",
+ "src/test4.c",
+ "src/test5.c",
+ "src/test6.c",
+ "src/test7.c",
+ "src/test8.c",
+ "src/test9.c",
+ "src/test_async.c",
+ "src/test_autoext.c",
+ "src/test_backup.c",
+ "src/test_bestindex.c",
+ "src/test_blob.c",
+ "src/test_btree.c",
+ "src/test_config.c",
+ "src/test_delete.c",
+ "src/test_demovfs.c",
+ "src/test_devsym.c",
+ "src/test_fs.c",
+ "src/test_func.c",
+ "src/test_hexio.c",
+ "src/test_init.c",
+ "src/test_intarray.c",
+ "src/test_journal.c",
+ "src/test_malloc.c",
+ "src/test_md5.c",
+ "src/test_multiplex.c",
+ "src/test_mutex.c",
+ "src/test_onefile.c",
+ "src/test_osinst.c",
+ "src/test_pcache.c",
+ "src/test_quota.c",
+ "src/test_rtree.c",
+ "src/test_schema.c",
+ "src/test_server.c",
+ "src/test_superlock.c",
+ "src/test_syscall.c",
+ "src/test_tclsh.c",
+ "src/test_tclvar.c",
+ "src/test_thread.c",
+ "src/test_vdbecov.c",
+ "src/test_vfs.c",
+ "src/test_windirent.c",
+ "src/test_window.c",
+ "src/test_wsd.c",
+ }
+ for i, v := range files {
+ files[i] = filepath.Join(sqliteSrcDir, filepath.FromSlash(v))
+ }
configure()
cmd := newCmd(
"ccgo",
- append(
+ join(
[]string{
"-DSQLITE_OMIT_LOAD_EXTENSION",
+ "-DSQLITE_SERIES_CONSTRAINT_VERIFY=1",
+ "-DSQLITE_SERVER=1",
"-DTCLSH_INIT_PROC=sqlite3TestInit",
- "-I/usr/include/tcl8.6",
+ "-D_HAVE_SQLITE_CONFIG_H",
+ "-I/usr/include/tcl8.6", //TODO should not be hardcoded
"-ccgo-export-defines", "",
"-ccgo-export-fields", "F",
- "-ccgo-pkgname", "testfixture",
- "-l", "modernc.org/tcl/lib,modernc.org/sqlite/internal/crt2,modernc.org/sqlite/lib",
+ "-lmodernc.org/tcl/lib,modernc.org/sqlite/internal/libc2,modernc.org/sqlite/lib",
"-o", filepath.Join(dir, fmt.Sprintf("testfixture_%s_%s.go", runtime.GOOS, runtime.GOARCH)),
- //TODO- "-ccgo-watch-instrumentation", //TODO-
- filepath.Join(sqliteSrcDir, "ext", "expert", "sqlite3expert.c"),
- filepath.Join(sqliteSrcDir, "ext", "expert", "test_expert.c"),
- filepath.Join(sqliteSrcDir, "ext", "fts5", "fts5_tcl.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "amatch.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "carray.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "closure.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "csv.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "eval.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "explain.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "fileio.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "fuzzer.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "ieee754.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "mmapwarm.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "nextchar.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "normalize.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "percentile.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "prefixes.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "regexp.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "remember.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "series.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "spellfix.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "totype.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "unionvtab.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "wholenumber.c"),
- filepath.Join(sqliteSrcDir, "ext", "misc", "zipfile.c"),
- filepath.Join(sqliteSrcDir, "ext", "rbu", "sqlite3rbu.c"),
- filepath.Join(sqliteSrcDir, "ext", "rbu", "test_rbu.c"),
- filepath.Join(sqliteSrcDir, "src", "tclsqlite.c"),
- filepath.Join(sqliteSrcDir, "src", "test1.c"),
- filepath.Join(sqliteSrcDir, "src", "test2.c"),
- filepath.Join(sqliteSrcDir, "src", "test3.c"),
- filepath.Join(sqliteSrcDir, "src", "test4.c"),
- filepath.Join(sqliteSrcDir, "src", "test5.c"),
- filepath.Join(sqliteSrcDir, "src", "test6.c"),
- filepath.Join(sqliteSrcDir, "src", "test7.c"),
- filepath.Join(sqliteSrcDir, "src", "test8.c"),
- filepath.Join(sqliteSrcDir, "src", "test9.c"),
- filepath.Join(sqliteSrcDir, "src", "test_async.c"),
- filepath.Join(sqliteSrcDir, "src", "test_autoext.c"),
- filepath.Join(sqliteSrcDir, "src", "test_backup.c"),
- filepath.Join(sqliteSrcDir, "src", "test_bestindex.c"),
- filepath.Join(sqliteSrcDir, "src", "test_blob.c"),
- filepath.Join(sqliteSrcDir, "src", "test_btree.c"),
- filepath.Join(sqliteSrcDir, "src", "test_config.c"),
- filepath.Join(sqliteSrcDir, "src", "test_delete.c"),
- filepath.Join(sqliteSrcDir, "src", "test_demovfs.c"),
- filepath.Join(sqliteSrcDir, "src", "test_devsym.c"),
- filepath.Join(sqliteSrcDir, "src", "test_fs.c"),
- filepath.Join(sqliteSrcDir, "src", "test_func.c"),
- filepath.Join(sqliteSrcDir, "src", "test_hexio.c"),
- filepath.Join(sqliteSrcDir, "src", "test_init.c"),
- filepath.Join(sqliteSrcDir, "src", "test_intarray.c"),
- filepath.Join(sqliteSrcDir, "src", "test_journal.c"),
- filepath.Join(sqliteSrcDir, "src", "test_malloc.c"),
- filepath.Join(sqliteSrcDir, "src", "test_md5.c"),
- filepath.Join(sqliteSrcDir, "src", "test_multiplex.c"),
- filepath.Join(sqliteSrcDir, "src", "test_mutex.c"),
- filepath.Join(sqliteSrcDir, "src", "test_onefile.c"),
- filepath.Join(sqliteSrcDir, "src", "test_osinst.c"),
- filepath.Join(sqliteSrcDir, "src", "test_pcache.c"),
- filepath.Join(sqliteSrcDir, "src", "test_quota.c"),
- filepath.Join(sqliteSrcDir, "src", "test_rtree.c"),
- filepath.Join(sqliteSrcDir, "src", "test_schema.c"),
- filepath.Join(sqliteSrcDir, "src", "test_server.c"),
- filepath.Join(sqliteSrcDir, "src", "test_superlock.c"),
- filepath.Join(sqliteSrcDir, "src", "test_syscall.c"),
- filepath.Join(sqliteSrcDir, "src", "test_tclsh.c"),
- filepath.Join(sqliteSrcDir, "src", "test_tclvar.c"),
- filepath.Join(sqliteSrcDir, "src", "test_thread.c"),
- filepath.Join(sqliteSrcDir, "src", "test_vdbecov.c"),
- filepath.Join(sqliteSrcDir, "src", "test_vfs.c"),
- filepath.Join(sqliteSrcDir, "src", "test_window.c"),
+ fmt.Sprintf("-I%s", filepath.Join(sqliteSrcDir, filepath.FromSlash("ext/async"))),
+ fmt.Sprintf("-I%s", filepath.Join(sqliteSrcDir, filepath.FromSlash("ext/fts3"))),
+ fmt.Sprintf("-I%s", filepath.Join(sqliteSrcDir, filepath.FromSlash("ext/icu"))),
+ fmt.Sprintf("-I%s", filepath.Join(sqliteSrcDir, filepath.FromSlash("ext/rtree"))),
+ fmt.Sprintf("-I%s", filepath.Join(sqliteSrcDir, filepath.FromSlash("ext/session"))),
+ fmt.Sprintf("-I%s", filepath.Join(sqliteSrcDir, filepath.FromSlash("ext/userauth"))),
+ fmt.Sprintf("-I%s", filepath.Join(sqliteSrcDir, filepath.FromSlash("src"))),
fmt.Sprintf("-I%s", sqliteDir),
fmt.Sprintf("-I%s", sqliteSrcDir),
},
- config...)...,
+ files,
+ more,
+ config)...,
)
if err := cmd.Run(); err != nil {
fail("%s\n", err)
}
- os.Remove(filepath.Join(dir, fmt.Sprintf("capi_%s_%s.go", runtime.GOOS, runtime.GOARCH)))
}
-func makeSpeedTest() {
+func makeSpeedTest(more []string) {
cmd := newCmd(
"ccgo",
- append(
+ join(
[]string{
"-o", filepath.FromSlash(fmt.Sprintf("speedtest1/main_%s_%s.go", runtime.GOOS, runtime.GOARCH)),
filepath.Join(sqliteSrcDir, "test", "speedtest1.c"),
fmt.Sprintf("-I%s", sqliteDir),
"-l", "modernc.org/sqlite/lib",
},
- config...)...,
+ more,
+ config)...,
)
if err := cmd.Run(); err != nil {
fail("%s\n", err)
}
}
-func makeMpTest() {
+func makeMpTest(more []string) {
cmd := newCmd(
"ccgo",
- append(
+ join(
[]string{
"-o", filepath.FromSlash(fmt.Sprintf("internal/mptest/main_%s_%s.go", runtime.GOOS, runtime.GOARCH)),
filepath.Join(sqliteSrcDir, "mptest", "mptest.c"),
fmt.Sprintf("-I%s", sqliteDir),
"-l", "modernc.org/sqlite/lib",
},
- config...)...,
+ more,
+ config)...,
)
if err := cmd.Run(); err != nil {
fail("%s\n", err)
}
}
-func makeSqlite() {
+func makeSqlite(more []string) {
cmd := newCmd(
"ccgo",
- append(
+ join(
[]string{
"-DSQLITE_PRIVATE=",
"-ccgo-export-defines", "",
@@ -405,9 +579,22 @@ func makeSqlite() {
//TODO "-ccgo-volatile", "sqlite3_io_error_pending,sqlite3_open_file_count,sqlite3_pager_readdb_count,sqlite3_search_count,sqlite3_sort_count",
filepath.Join(sqliteDir, "sqlite3.c"),
},
- config...)...,
+ more,
+ config)...,
)
if err := cmd.Run(); err != nil {
fail("%s\n", err)
}
}
+
+func join(a ...[]string) (r []string) {
+ n := 0
+ for _, v := range a {
+ n += len(v)
+ }
+ r = make([]string, 0, n)
+ for _, v := range a {
+ r = append(r, v...)
+ }
+ return r
+}
diff --git a/go.mod b/go.mod
index d709571..62338f1 100644
--- a/go.mod
+++ b/go.mod
@@ -1,9 +1,9 @@
module modernc.org/sqlite
-go 1.14
+go 1.15
require (
- modernc.org/crt/v3 v3.25.0
- modernc.org/mathutil v1.0.0
- modernc.org/tcl v1.0.3-beta1
+ modernc.org/libc v1.0.0
+ modernc.org/mathutil v1.1.1
+ modernc.org/tcl v1.1.0
)
diff --git a/go.sum b/go.sum
index 73b9c4e..bd6103f 100644
--- a/go.sum
+++ b/go.sum
@@ -1,22 +1,17 @@
-github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
-github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
-github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237 h1:HQagqIiBmr8YXawX/le3+O26N+vPPC1PtjaF3mwnook=
-github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
+github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=
+github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4=
-golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-modernc.org/cc/v3 v3.23.0/go.mod h1:NZ//ji5AVKCoutHdl35YtsWflZrIWMQAMgDtmKq2eyA=
-modernc.org/crt/v3 v3.25.0 h1:bWKB9DcoobH2zFENYzyIiRHkGx7aVpan3S/6FHIyUCU=
-modernc.org/crt/v3 v3.25.0/go.mod h1:9MujA+beChvPpq95k1rjNyLndmCbDO6Ei8QTcdUb5gI=
+golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6 h1:DvY3Zkh7KabQE/kfzMvYvKirSiguP9Q/veMtkYyf0o8=
+golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
modernc.org/httpfs v1.0.0 h1:LtuKNg6JMiaBKVQHKd6Phhvk+2GFp+pUcmDQgRjrds0=
modernc.org/httpfs v1.0.0/go.mod h1:BSkfoMUcahSijQD5J/Vu4UMOxzmEf5SNRwyXC4PJBEw=
-modernc.org/mathutil v1.0.0 h1:93vKjrJopTPrtTNpZ8XIovER7iCIH1QU7wNbOQXC60I=
-modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
+modernc.org/libc v1.0.0 h1:MgQgjhJDgugN7makTrP2K503x+vKBy0EIv1o8uSuG0k=
+modernc.org/libc v1.0.0/go.mod h1:iulSAj8W71uuiT8V3cOzJfRvrhNMz2kawtuJy18EEE4=
+modernc.org/mathutil v1.1.1 h1:FeylZSVX8S+58VsyJlkEj2bcpdytmp9MmDKZkKx8OIE=
+modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
modernc.org/memory v1.0.0 h1:Tm1p6vBp/U/SGR9/EeFhMvGzaVpUWeePopZhhIpW2YE=
modernc.org/memory v1.0.0/go.mod h1:TXr4iJDvK3g0hW+sV+Kohu7BoeHfqw7QEFZWkBExdZc=
-modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
-modernc.org/tcl v1.0.3-beta1 h1:SH2ETLWydXIPvEFNcFZGF+Nkf1fHlWkBmrj1AwdjiWY=
-modernc.org/tcl v1.0.3-beta1/go.mod h1:yJlqAkS0OyMvXS7Ro8tZ07QXxyjVm8tGz0FmU1xYxFk=
-modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
+modernc.org/tcl v1.1.0 h1:rOb4Dtcf0aidHBu8Ctz3FkW+PQpgCrChEIQ9+LUPst0=
+modernc.org/tcl v1.1.0/go.mod h1:8qvhdwj80wWqMugFAW2sduRIsdWBKOmxu+VwCXfE1X4=
diff --git a/internal/crt2/Makefile b/internal/libc2/Makefile
index a54e63b..a54e63b 100644
--- a/internal/crt2/Makefile
+++ b/internal/libc2/Makefile
diff --git a/internal/crt2/all_test.go b/internal/libc2/all_test.go
index 8a63443..5842011 100644
--- a/internal/crt2/all_test.go
+++ b/internal/libc2/all_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package crt2 // import "modernc.org/sqlite/internal/crt2"
+package libc2 // import "modernc.org/sqlite/internal/libc2"
import (
"fmt"
diff --git a/internal/crt2/capi_linux_amd64.go b/internal/libc2/capi_linux_amd64.go
index 27b0039..01064c4 100644
--- a/internal/crt2/capi_linux_amd64.go
+++ b/internal/libc2/capi_linux_amd64.go
@@ -2,11 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package crt2 // import "modernc.org/sqlite/internal/crt2"
+package libc2 // import "modernc.org/sqlite/internal/libc2"
var CAPI = map[string]struct{}{
- "ferror": {},
- "fstat": {},
"pthread_cond_broadcast": {},
"pthread_cond_destroy": {},
"pthread_cond_init": {},
diff --git a/internal/crt2/crt2.go b/internal/libc2/libc2.go
index bffe76b..92e529f 100644
--- a/internal/crt2/crt2.go
+++ b/internal/libc2/libc2.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package crt2 // import "modernc.org/sqlite/internal/crt2"
+package libc2 // import "modernc.org/sqlite/internal/libc2"
import (
"fmt"
@@ -10,7 +10,8 @@ import (
"runtime"
"strings"
- "modernc.org/crt/v3"
+ "modernc.org/libc"
+ "modernc.org/libc/sys/types"
)
func todo(s string, args ...interface{}) string { //TODO-
@@ -50,81 +51,66 @@ func trc(s string, args ...interface{}) string { //TODO-
}
// int sched_yield(void);
-func Xsched_yield(tls *crt.TLS) int32 {
+func Xsched_yield(tls *libc.TLS) int32 {
panic(todo(""))
}
// int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg);
-func Xpthread_create(tls *crt.TLS, thread, attr, start_routine, arg uintptr) int32 {
+func Xpthread_create(tls *libc.TLS, thread, attr, start_routine, arg uintptr) int32 {
panic(todo(""))
}
// int pthread_detach(pthread_t thread);
-func Xpthread_detach(tls *crt.TLS, thread crt.Size_t) int32 {
+func Xpthread_detach(tls *libc.TLS, thread types.Size_t) int32 {
panic(todo(""))
}
-// int ferror(FILE *stream);
-func Xferror(tls *crt.TLS, stream uintptr) int32 {
- panic(todo(""))
-}
-
-// int fstat(int fd, struct stat *statbuf);
-func Xfstat(tls *crt.TLS, fd int32, statbuf uintptr) int32 {
- panic(todo(""))
-}
-
-// // int rename(const char *oldpath, const char *newpath);
-// func Xrename(tls *crt.TLS, oldpath, newpath uintptr) int32 {
-// panic(todo(""))
-// }
-
// int pthread_mutex_lock(pthread_mutex_t *mutex);
-func Xpthread_mutex_lock(tls *crt.TLS, mutex uintptr) int32 {
+func Xpthread_mutex_lock(tls *libc.TLS, mutex uintptr) int32 {
panic(todo(""))
}
// int pthread_cond_signal(pthread_cond_t *cond);
-func Xpthread_cond_signal(tls *crt.TLS, cond uintptr) int32 {
+func Xpthread_cond_signal(tls *libc.TLS, cond uintptr) int32 {
panic(todo(""))
}
// int pthread_mutex_unlock(pthread_mutex_t *mutex);
-func Xpthread_mutex_unlock(tls *crt.TLS, mutex uintptr) int32 {
+func Xpthread_mutex_unlock(tls *libc.TLS, mutex uintptr) int32 {
panic(todo(""))
}
// int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr);
-func Xpthread_mutex_init(tls *crt.TLS, mutex, attr uintptr) int32 {
+func Xpthread_mutex_init(tls *libc.TLS, mutex, attr uintptr) int32 {
panic(todo(""))
}
// int pthread_cond_init(pthread_cond_t *restrict cond, const pthread_condattr_t *restrict attr);
-func Xpthread_cond_init(tls *crt.TLS, cond, attr uintptr) int32 {
+func Xpthread_cond_init(tls *libc.TLS, cond, attr uintptr) int32 {
panic(todo(""))
}
// int pthread_cond_wait(pthread_cond_t *restrict cond, pthread_mutex_t *restrict mutex);
-func Xpthread_cond_wait(tls *crt.TLS, cond, mutex uintptr) int32 {
+func Xpthread_cond_wait(tls *libc.TLS, cond, mutex uintptr) int32 {
panic(todo(""))
}
// int pthread_cond_destroy(pthread_cond_t *cond);
-func Xpthread_cond_destroy(tls *crt.TLS, cond uintptr) int32 {
+func Xpthread_cond_destroy(tls *libc.TLS, cond uintptr) int32 {
panic(todo(""))
}
// int pthread_mutex_destroy(pthread_mutex_t *mutex);
-func Xpthread_mutex_destroy(tls *crt.TLS, mutex uintptr) int32 {
+func Xpthread_mutex_destroy(tls *libc.TLS, mutex uintptr) int32 {
panic(todo(""))
}
// int pthread_mutex_trylock(pthread_mutex_t *mutex);
-func Xpthread_mutex_trylock(tls *crt.TLS, mutex uintptr) int32 {
+func Xpthread_mutex_trylock(tls *libc.TLS, mutex uintptr) int32 {
panic(todo(""))
}
// int pthread_cond_broadcast(pthread_cond_t *cond);
-func Xpthread_cond_broadcast(tls *crt.TLS, cond uintptr) int32 {
+func Xpthread_cond_broadcast(tls *libc.TLS, cond uintptr) int32 {
panic(todo(""))
}
diff --git a/internal/mptest/main_linux_amd64.go b/internal/mptest/main_linux_amd64.go
index a4c02ae..64de6ad 100644
--- a/internal/mptest/main_linux_amd64.go
+++ b/internal/mptest/main_linux_amd64.go
@@ -1,4 +1,4 @@
-// Code generated by 'ccgo -o internal/mptest/main_linux_amd64.go testdata/sqlite-src-3320300/mptest/mptest.c -Itestdata/sqlite-amalgamation-3320300 -l modernc.org/sqlite/lib -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_DQS=0 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_MAX_MMAP_SIZE=8589934592 -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_NO_SYNC=1 -DSQLITE_OS_UNIX=1 -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 -DSQLITE_SERVER=1 -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.
+// Code generated by 'ccgo internal/mptest/main_linux_amd64.go testdata/sqlite-src-3330000/mptest/mptest.c -Itestdata/sqlite-amalgamation-3330000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.
package main
@@ -7,7 +7,7 @@ import (
"reflect"
"unsafe"
- "modernc.org/crt/v3"
+ "modernc.org/libc"
"modernc.org/sqlite/lib"
)
@@ -15,7 +15,7 @@ var _ = math.Pi
var _ reflect.Kind
var _ unsafe.Pointer
-func main() { crt.Start(main1) }
+func main() { libc.Start(main1) }
// Copyright (C) 1991-2018 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
@@ -654,6 +654,7 @@ type sqlite3_callback = uintptr /* sqlite3.h:338:13 */
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
// Reserved: 0x00F00000
+// Legacy compatibility:
// CAPI3REF: Device Characteristics
//
@@ -764,6 +765,7 @@ type sqlite3_file1 = struct{ pMethods uintptr }
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
// Reserved: 0x00F00000
+// Legacy compatibility:
// CAPI3REF: Device Characteristics
//
@@ -837,7 +839,7 @@ type sqlite3_file1 = struct{ pMethods uintptr }
// for their own use. The pMethods entry is a pointer to an
// [sqlite3_io_methods] object that defines methods for performing
// I/O operations on the open file.
-type sqlite3_file = sqlite3_file1 /* sqlite3.h:680:29 */
+type sqlite3_file = sqlite3_file1 /* sqlite3.h:683:29 */
type sqlite3_io_methods1 = struct {
iVersion int32
xClose uintptr
@@ -952,7 +954,7 @@ type sqlite3_io_methods1 = struct {
// fails to zero-fill short reads might seem to work. However,
// failure to zero-fill short reads will eventually lead to
// database corruption.
-type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:779:35 */
+type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:782:35 */
// CAPI3REF: OS Interface Object
//
@@ -1028,7 +1030,7 @@ type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:779:35 */
// <li> [SQLITE_OPEN_TEMP_JOURNAL]
// <li> [SQLITE_OPEN_TRANSIENT_DB]
// <li> [SQLITE_OPEN_SUBJOURNAL]
-// <li> [SQLITE_OPEN_MASTER_JOURNAL]
+// <li> [SQLITE_OPEN_SUPER_JOURNAL]
// <li> [SQLITE_OPEN_WAL]
// </ul>)^
//
@@ -1220,7 +1222,7 @@ type sqlite3_vfs1 = struct {
// <li> [SQLITE_OPEN_TEMP_JOURNAL]
// <li> [SQLITE_OPEN_TRANSIENT_DB]
// <li> [SQLITE_OPEN_SUBJOURNAL]
-// <li> [SQLITE_OPEN_MASTER_JOURNAL]
+// <li> [SQLITE_OPEN_SUPER_JOURNAL]
// <li> [SQLITE_OPEN_WAL]
// </ul>)^
//
@@ -1313,8 +1315,8 @@ type sqlite3_vfs1 = struct {
// or all of these interfaces to be NULL or for their behavior to change
// from one release to the next. Applications must not attempt to access
// any of these methods if the iVersion of the VFS is less than 3.
-type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1364:28 */
-type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1365:14 */
+type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1367:28 */
+type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1368:14 */
// CAPI3REF: Memory Allocation Routines
//
@@ -1364,7 +1366,7 @@ type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1365:14 */
// by xInit. The pAppData pointer is used as the only parameter to
// xInit and xShutdown.
//
-// SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
+// SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
// the xInit method, so the xInit method need not be threadsafe. The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either. For all other methods, SQLite
@@ -1436,7 +1438,7 @@ type sqlite3_mem_methods1 = struct {
// by xInit. The pAppData pointer is used as the only parameter to
// xInit and xShutdown.
//
-// SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
+// SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
// the xInit method, so the xInit method need not be threadsafe. The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either. For all other methods, SQLite
@@ -1449,7 +1451,7 @@ type sqlite3_mem_methods1 = struct {
//
// SQLite will never invoke xInit() more than once without an intervening
// call to xShutdown().
-type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1662:36 */
+type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1665:36 */
// CAPI3REF: Constants Defining Special Destructor Behavior
//
@@ -1463,7 +1465,7 @@ type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1662:36 */
//
// The typedef is necessary to work around problems in certain
// C++ compilers.
-type sqlite3_destructor_type = uintptr /* sqlite3.h:5619:14 */
+type sqlite3_destructor_type = uintptr /* sqlite3.h:5621:14 */
// The interface to the virtual-table mechanism is currently considered
// to be experimental. The interface might change in incompatible ways.
@@ -1487,7 +1489,7 @@ type sqlite3_vtab1 = struct {
// interface fixed, support it indefinitely, and remove this comment.
// Structures used by the virtual table interface
-type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6687:29 */
+type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6689:29 */
type sqlite3_index_info1 = struct {
nConstraint int32
aConstraint uintptr
@@ -1504,10 +1506,10 @@ type sqlite3_index_info1 = struct {
colUsed sqlite3_uint64
}
-type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6688:35 */
+type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6690:35 */
type sqlite3_vtab_cursor1 = struct{ pVtab uintptr }
-type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6689:36 */
+type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6691:36 */
type sqlite3_module1 = struct {
iVersion int32
xCreate uintptr
@@ -1535,7 +1537,7 @@ type sqlite3_module1 = struct {
xShadowName uintptr
}
-type sqlite3_module = sqlite3_module1 /* sqlite3.h:6690:31 */
+type sqlite3_module = sqlite3_module1 /* sqlite3.h:6692:31 */
// CAPI3REF: Virtual Table Indexing Information
// KEYWORDS: sqlite3_index_info
@@ -1994,7 +1996,7 @@ type sqlite3_mutex_methods1 = struct {
// called, but only if the prior call to xMutexInit returned SQLITE_OK.
// If xMutexInit fails in any way, it is expected to clean up after itself
// prior to returning.
-type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7522:38 */
+type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7524:38 */
// CAPI3REF: Custom Page Cache Object
//
@@ -2017,7 +2019,7 @@ type sqlite3_pcache_page1 = struct {
// of this object as parameters or as their return value.
//
// See [sqlite3_pcache_methods2] for additional information.
-type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8271:36 */
+type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8277:36 */
// CAPI3REF: Application Defined Page Cache.
// KEYWORDS: {page cache}
@@ -2349,7 +2351,7 @@ type sqlite3_pcache_methods21 = struct {
// free up as much of heap memory as possible. The page cache implementation
// is not obligated to free any memory, but well-behaved implementations should
// do their best.
-type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8436:40 */
+type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8442:40 */
// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -2371,7 +2373,7 @@ type sqlite3_pcache_methods1 = struct {
// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
// retained in the header file for backwards compatibility only.
-type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8459:39 */
+type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8465:39 */
// CAPI3REF: Database Snapshot
// KEYWORDS: {snapshot} {sqlite3_snapshot}
@@ -2411,7 +2413,7 @@ type sqlite3_snapshot1 = struct{ hidden [48]uint8 }
// version of the database file so that it is possible to later open a new read
// transaction that sees that historical version of the database rather than
// the most recent version.
-type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9508:3 */
+type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9514:3 */
// CAPI3REF: Flags for sqlite3_deserialize()
//
@@ -2491,7 +2493,7 @@ type sqlite3_rtree_geometry1 = struct {
//
//
-type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9833:39 */
+type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9839:39 */
type sqlite3_rtree_query_info1 = struct {
pContext uintptr
nParam int32
@@ -2511,11 +2513,11 @@ type sqlite3_rtree_query_info1 = struct {
apSqlParam uintptr
}
-type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9834:41 */
+type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9840:41 */
// The double-precision datatype used by RTree depends on the
// SQLITE_RTREE_INT_ONLY compile-time option.
-type sqlite3_rtree_dbl = float64 /* sqlite3.h:9842:18 */
+type sqlite3_rtree_dbl = float64 /* sqlite3.h:9848:18 */
// Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin.
@@ -2602,22 +2604,22 @@ type Fts5ExtensionApi1 = struct {
// Virtual table implementations may overload SQL functions by implementing
// the sqlite3_module.xFindFunction() method.
-type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11628:33 */
+type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11634:33 */
type Fts5PhraseIter1 = struct {
a uintptr
b uintptr
}
-type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11630:31 */
+type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11636:31 */
-type fts5_extension_function = uintptr /* sqlite3.h:11632:14 */
+type fts5_extension_function = uintptr /* sqlite3.h:11638:14 */
type fts5_tokenizer1 = struct {
xCreate uintptr
xDelete uintptr
xTokenize uintptr
}
-type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12091:31 */
+type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12097:31 */
// Flags that may be passed as the third argument to xTokenize()
@@ -2650,7 +2652,7 @@ type fts5_api1 = struct {
// ************************************************************************
//
// FTS5 EXTENSION REGISTRATION API
-type fts5_api = fts5_api1 /* sqlite3.h:12127:25 */
+type fts5_api = fts5_api1 /* sqlite3.h:12133:25 */
// The tag name of this struct is _G_fpos_t to preserve historic
// C++ mangled names for functions taking fpos_t arguments.
@@ -4018,7 +4020,7 @@ var g Global /* mptest.c:90:3: */
// Default timeout
// Print a message adding zPrefix[] to the beginning of every line.
-func printWithPrefix(tls *crt.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr) { /* mptest.c:98:13: */
+func printWithPrefix(tls *libc.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr) { /* mptest.c:98:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -4026,7 +4028,7 @@ func printWithPrefix(tls *crt.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr)
var i int32
for i = 0; ((*(*int8)(unsafe.Pointer(zMsg + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\n')) && (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(i)))) != '\r'); i++ {
}
- crt.Xfprintf(tls, pOut, ts /* "%s%.*s\n" */, crt.VaList(bp, zPrefix, i, zMsg))
+ libc.Xfprintf(tls, pOut, ts /* "%s%.*s\n" */, libc.VaList(bp, zPrefix, i, zMsg))
zMsg += uintptr(i)
for (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(0)))) == '\n') || (int32(*(*int8)(unsafe.Pointer(zMsg + uintptr(0)))) == '\r') {
zMsg++
@@ -4035,7 +4037,7 @@ func printWithPrefix(tls *crt.TLS, pOut uintptr, zPrefix uintptr, zMsg uintptr)
}
// Compare two pointers to strings, where the pointers might be NULL.
-func safe_strcmp(tls *crt.TLS, a uintptr, b uintptr) int32 { /* mptest.c:111:12: */
+func safe_strcmp(tls *libc.TLS, a uintptr, b uintptr) int32 { /* mptest.c:111:12: */
if a == b {
return 0
}
@@ -4045,7 +4047,7 @@ func safe_strcmp(tls *crt.TLS, a uintptr, b uintptr) int32 { /* mptest.c:111:12:
if b == uintptr(0) {
return 1
}
- return crt.Xstrcmp(tls, a, b)
+ return libc.Xstrcmp(tls, a, b)
}
// Return TRUE if string z[] matches glob pattern zGlob[].
@@ -4064,16 +4066,16 @@ func safe_strcmp(tls *crt.TLS, a uintptr, b uintptr) int32 { /* mptest.c:111:12:
//
// '#' Matches any sequence of one or more digits with an
// optional + or - sign in front
-func strglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5: */
+func strglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5: */
var c int32
var c2 int32
var invert int32
var seen int32
- for (crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1)))))) != 0 {
+ for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) != 0 {
if c == '*' {
- for ((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') {
- if (c == '?') && ((int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) == 0) {
+ for ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') {
+ if (c == '?') && ((int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0) {
return 0
}
}
@@ -4083,11 +4085,11 @@ func strglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
for (*(*int8)(unsafe.Pointer(z)) != 0) && (strglob(tls, (zGlob-uintptr(1)), z) != 0) {
z++
}
- return (crt.Bool32((int32(*(*int8)(unsafe.Pointer(z)))) != 0))
+ return (libc.Bool32((int32(*(*int8)(unsafe.Pointer(z)))) != 0))
}
- for (crt.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1)))))) != 0 {
+ for (libc.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))) != 0 {
for c2 != c {
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
if c2 == 0 {
return 0
}
@@ -4098,31 +4100,31 @@ func strglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
}
return 0
} else if c == '?' {
- if (int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) == 0 {
+ if (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0 {
return 0
}
} else if c == '[' {
var prior_c int32 = 0
seen = 0
invert = 0
- c = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))
+ c = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
if c == 0 {
return 0
}
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
if c2 == '^' {
invert = 1
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
}
if c2 == ']' {
if c == ']' {
seen = 1
}
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
}
for (c2 != 0) && (c2 != ']') {
if (((c2 == '-') && (int32(*(*int8)(unsafe.Pointer(zGlob + uintptr(0)))) != ']')) && (int32(*(*int8)(unsafe.Pointer(zGlob + uintptr(0)))) != 0)) && (prior_c > 0) {
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
if (c >= prior_c) && (c <= c2) {
seen = 1
}
@@ -4133,40 +4135,40 @@ func strglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* mptest.c:136:5:
}
prior_c = c2
}
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
}
if (c2 == 0) || ((seen ^ invert) == 0) {
return 0
}
} else if c == '#' {
- if ((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '-') || (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '+')) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(1))))))*2))) & int32(_ISdigit)) != 0) {
+ if ((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '-') || (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '+')) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(1))))))*2))) & int32(_ISdigit)) != 0) {
z++
}
- if !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISdigit)) != 0) {
+ if !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISdigit)) != 0) {
return 0
}
z++
- for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISdigit)) != 0 {
+ for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISdigit)) != 0 {
z++
}
} else {
- if c != (int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) {
+ if c != (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) {
return 0
}
}
}
- return (crt.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0))
+ return (libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0))
}
// Close output stream pOut if it is not stdout or stderr
-func maybeClose(tls *crt.TLS, pOut uintptr) { /* mptest.c:208:13: */
- if (pOut != crt.Xstdout) && (pOut != crt.Xstderr) {
- crt.Xfclose(tls, pOut)
+func maybeClose(tls *libc.TLS, pOut uintptr) { /* mptest.c:208:13: */
+ if (pOut != libc.Xstdout) && (pOut != libc.Xstderr) {
+ libc.Xfclose(tls, pOut)
}
}
// Print an error message
-func errorMessage(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:13: */
+func errorMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:13: */
bp := tls.Alloc(38)
defer tls.Free(38)
@@ -4178,21 +4180,21 @@ func errorMessage(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:215:1
ap = va
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
_ = ap
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, crt.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+8 /* "%s:ERROR: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
if g.pLog != 0 {
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
- crt.Xfflush(tls, g.pLog)
+ libc.Xfflush(tls, g.pLog)
}
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
- crt.Xfflush(tls, g.pErrLog)
+ libc.Xfflush(tls, g.pErrLog)
}
sqlite3.Xsqlite3_free(tls, zMsg)
g.nError++
}
// Print an error message and then quit.
-func fatalError(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13: */
+func fatalError(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13: */
bp := tls.Alloc(38)
defer tls.Free(38)
@@ -4204,15 +4206,15 @@ func fatalError(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13:
ap = va
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
_ = ap
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, crt.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+19 /* "%s:FATAL: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
if g.pLog != 0 {
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
- crt.Xfflush(tls, g.pLog)
+ libc.Xfflush(tls, g.pLog)
maybeClose(tls, g.pLog)
}
if (g.pErrLog != 0) && (safe_strcmp(tls, g.zErrLog, g.zLog) != 0) {
printWithPrefix(tls, g.pErrLog, bp+8 /* &zPrefix[0] */, zMsg)
- crt.Xfflush(tls, g.pErrLog)
+ libc.Xfflush(tls, g.pErrLog)
maybeClose(tls, g.pErrLog)
}
sqlite3.Xsqlite3_free(tls, zMsg)
@@ -4220,16 +4222,16 @@ func fatalError(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:241:13:
var nTry int32 = 0
g.iTimeout = 0
for (trySql(tls, ts+30 /* "UPDATE client SE..." */, 0) == 5) &&
- ((crt.PostIncInt32(&nTry, 1)) < 100) {
+ ((libc.PostIncInt32(&nTry, 1)) < 100) {
sqlite3.Xsqlite3_sleep(tls, 10)
}
}
sqlite3.Xsqlite3_close(tls, g.db)
- crt.Xexit(tls, 1)
+ libc.Xexit(tls, 1)
}
// Print a log message
-func logMessage(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13: */
+func logMessage(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13: */
bp := tls.Alloc(38)
defer tls.Free(38)
@@ -4241,25 +4243,25 @@ func logMessage(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:276:13:
ap = va
zMsg = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
_ = ap
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, crt.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zPrefix[0] */, ts+60 /* "%s: " */, libc.VaList(bp, uintptr(unsafe.Pointer(&g))+64 /* &.zName */))
if g.pLog != 0 {
printWithPrefix(tls, g.pLog, bp+8 /* &zPrefix[0] */, zMsg)
- crt.Xfflush(tls, g.pLog)
+ libc.Xfflush(tls, g.pLog)
}
sqlite3.Xsqlite3_free(tls, zMsg)
}
// Return the length of a string omitting trailing whitespace
-func clipLength(tls *crt.TLS, z uintptr) int32 { /* mptest.c:294:12: */
- var n int32 = int32(crt.Xstrlen(tls, z))
- for (n > 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0) {
+func clipLength(tls *libc.TLS, z uintptr) int32 { /* mptest.c:294:12: */
+ var n int32 = int32(libc.Xstrlen(tls, z))
+ for (n > 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0) {
n--
}
return n
}
// Auxiliary SQL function to return the name of the VFS
-func vfsNameFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:303:13: */
+func vfsNameFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:303:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -4269,19 +4271,19 @@ func vfsNameFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* m
_ = argv
sqlite3.Xsqlite3_file_control(tls, db, ts+65 /* "main" */, 12, bp /* &zVfs */)
if *(*uintptr)(unsafe.Pointer(bp /* zVfs */)) != 0 {
- sqlite3.Xsqlite3_result_text(tls, context, *(*uintptr)(unsafe.Pointer(bp /* zVfs */)), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ sqlite3.Xsqlite3_result_text(tls, context, *(*uintptr)(unsafe.Pointer(bp /* zVfs */)), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
}
}
// Busy handler with a g.iTimeout-millisecond timeout
-func busyHandler(tls *crt.TLS, pCD uintptr, count int32) int32 { /* mptest.c:321:12: */
+func busyHandler(tls *libc.TLS, pCD uintptr, count int32) int32 { /* mptest.c:321:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
_ = pCD
if (count * 10) > g.iTimeout {
if g.iTimeout > 0 {
- errorMessage(tls, ts+70 /* "timeout after %d..." */, crt.VaList(bp, g.iTimeout))
+ errorMessage(tls, ts+70 /* "timeout after %d..." */, libc.VaList(bp, g.iTimeout))
}
return 0
}
@@ -4290,16 +4292,16 @@ func busyHandler(tls *crt.TLS, pCD uintptr, count int32) int32 { /* mptest.c:321
}
// SQL Trace callback
-func sqlTraceCallback(tls *crt.TLS, NotUsed1 uintptr, zSql uintptr) { /* mptest.c:334:13: */
+func sqlTraceCallback(tls *libc.TLS, NotUsed1 uintptr, zSql uintptr) { /* mptest.c:334:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
_ = NotUsed1
- logMessage(tls, ts+89 /* "[%.*s]" */, crt.VaList(bp, clipLength(tls, zSql), zSql))
+ logMessage(tls, ts+89 /* "[%.*s]" */, libc.VaList(bp, clipLength(tls, zSql), zSql))
}
// SQL error log callback
-func sqlErrorCallback(tls *crt.TLS, pArg uintptr, iErrCode int32, zMsg uintptr) { /* mptest.c:342:13: */
+func sqlErrorCallback(tls *libc.TLS, pArg uintptr, iErrCode int32, zMsg uintptr) { /* mptest.c:342:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -4314,14 +4316,14 @@ func sqlErrorCallback(tls *crt.TLS, pArg uintptr, iErrCode int32, zMsg uintptr)
return
}
if (iErrCode & 0xff) == 27 {
- logMessage(tls, ts+96 /* "(info) %s" */, crt.VaList(bp, zMsg))
+ logMessage(tls, ts+96 /* "(info) %s" */, libc.VaList(bp, zMsg))
} else {
- errorMessage(tls, ts+106 /* "(errcode=%d) %s" */, crt.VaList(bp+8, iErrCode, zMsg))
+ errorMessage(tls, ts+106 /* "(errcode=%d) %s" */, libc.VaList(bp+8, iErrCode, zMsg))
}
}
// Prepare an SQL statement. Issue a fatal error if unable.
-func prepareSql(tls *crt.TLS, zFormat uintptr, va uintptr) uintptr { /* mptest.c:357:21: */
+func prepareSql(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* mptest.c:357:21: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -4336,14 +4338,14 @@ func prepareSql(tls *crt.TLS, zFormat uintptr, va uintptr) uintptr { /* mptest.c
rc = sqlite3.Xsqlite3_prepare_v2(tls, g.db, zSql, -1, bp+16 /* &pStmt */, uintptr(0))
if rc != 0 {
sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)))
- fatalError(tls, ts+122 /* "%s\n%s\n" */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db), zSql))
+ fatalError(tls, ts+122 /* "%s\n%s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db), zSql))
}
sqlite3.Xsqlite3_free(tls, zSql)
return *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))
}
// Run arbitrary SQL. Issue a fatal error on failure.
-func runSql(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:377:13: */
+func runSql(tls *libc.TLS, zFormat uintptr, va uintptr) { /* mptest.c:377:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -4356,13 +4358,13 @@ func runSql(tls *crt.TLS, zFormat uintptr, va uintptr) { /* mptest.c:377:13: */
_ = ap
rc = sqlite3.Xsqlite3_exec(tls, g.db, zSql, uintptr(0), uintptr(0), uintptr(0))
if rc != 0 {
- fatalError(tls, ts+122 /* "%s\n%s\n" */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db), zSql))
+ fatalError(tls, ts+122 /* "%s\n%s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db), zSql))
}
sqlite3.Xsqlite3_free(tls, zSql)
}
// Try to run arbitrary SQL. Return success code.
-func trySql(tls *crt.TLS, zFormat uintptr, va uintptr) int32 { /* mptest.c:394:12: */
+func trySql(tls *libc.TLS, zFormat uintptr, va uintptr) int32 { /* mptest.c:394:12: */
var ap va_list
_ = ap
var zSql uintptr
@@ -4386,17 +4388,17 @@ type String1 = struct {
type String = String1 /* mptest.c:408:23 */
// Free a string
-func stringFree(tls *crt.TLS, p uintptr) { /* mptest.c:416:13: */
+func stringFree(tls *libc.TLS, p uintptr) { /* mptest.c:416:13: */
if (*String)(unsafe.Pointer(p)).z != 0 {
sqlite3.Xsqlite3_free(tls, (*String)(unsafe.Pointer(p)).z)
}
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(String{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(String{})))
}
// Append n bytes of text to a string. If n<0 append the entire string.
-func stringAppend(tls *crt.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:422:13: */
+func stringAppend(tls *libc.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:422:13: */
if n < 0 {
- n = int32(crt.Xstrlen(tls, z))
+ n = int32(libc.Xstrlen(tls, z))
}
if ((*String)(unsafe.Pointer(p)).n + n) >= (*String)(unsafe.Pointer(p)).nAlloc {
var nAlloc int32 = ((((*String)(unsafe.Pointer(p)).nAlloc * 2) + n) + 100)
@@ -4407,13 +4409,13 @@ func stringAppend(tls *crt.TLS, p uintptr, z uintptr, n int32) { /* mptest.c:422
(*String)(unsafe.Pointer(p)).z = zNew
(*String)(unsafe.Pointer(p)).nAlloc = nAlloc
}
- crt.Xmemcpy(tls, ((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n)), z, uint64(n))
+ libc.Xmemcpy(tls, ((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n)), z, uint64(n))
*(*int32)(unsafe.Pointer(p + 8 /* &.n */)) += (n)
*(*int8)(unsafe.Pointer((*String)(unsafe.Pointer(p)).z + uintptr((*String)(unsafe.Pointer(p)).n))) = int8(0)
}
// Reset a string to an empty string
-func stringReset(tls *crt.TLS, p uintptr) { /* mptest.c:437:13: */
+func stringReset(tls *libc.TLS, p uintptr) { /* mptest.c:437:13: */
if (*String)(unsafe.Pointer(p)).z == uintptr(0) {
stringAppend(tls, p, ts+143 /* " " */, 1)
}
@@ -4422,7 +4424,7 @@ func stringReset(tls *crt.TLS, p uintptr) { /* mptest.c:437:13: */
}
// Append a new token onto the end of the string
-func stringAppendTerm(tls *crt.TLS, p uintptr, z uintptr) { /* mptest.c:444:13: */
+func stringAppendTerm(tls *libc.TLS, p uintptr, z uintptr) { /* mptest.c:444:13: */
var i int32
if (*String)(unsafe.Pointer(p)).n != 0 {
stringAppend(tls, p, ts+143 /* " " */, 1)
@@ -4431,7 +4433,7 @@ func stringAppendTerm(tls *crt.TLS, p uintptr, z uintptr) { /* mptest.c:444:13:
stringAppend(tls, p, ts+145 /* "nil" */, 3)
return
}
- for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
+ for i = 0; (*(*int8)(unsafe.Pointer(z + uintptr(i))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
}
if (i > 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == 0) {
stringAppend(tls, p, z, i)
@@ -4454,7 +4456,7 @@ func stringAppendTerm(tls *crt.TLS, p uintptr, z uintptr) { /* mptest.c:444:13:
}
// Callback function for evalSql()
-func evalCallback(tls *crt.TLS, pCData uintptr, argc int32, argv uintptr, azCol uintptr) int32 { /* mptest.c:474:12: */
+func evalCallback(tls *libc.TLS, pCData uintptr, argc int32, argv uintptr, azCol uintptr) int32 { /* mptest.c:474:12: */
var p uintptr = pCData
var i int32
_ = azCol
@@ -4466,7 +4468,7 @@ func evalCallback(tls *crt.TLS, pCData uintptr, argc int32, argv uintptr, azCol
// Run arbitrary SQL and record the results in an output string
// given by the first parameter.
-func evalSql(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mptest.c:486:12: */
+func evalSql(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mptest.c:486:12: */
bp := tls.Alloc(46)
defer tls.Free(46)
@@ -4480,13 +4482,13 @@ func evalSql(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mp
_ = ap
rc = sqlite3.Xsqlite3_exec(tls, g.db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{evalCallback})), p, bp+8 /* &zErrMsg */)
sqlite3.Xsqlite3_free(tls, zSql)
if rc != 0 {
// var zErr [30]int8 at bp+16, 30
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+16 /* &zErr[0] */, ts+151 /* "error(%d)" */, crt.VaList(bp, rc))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+16 /* &zErr[0] */, ts+151 /* "error(%d)" */, libc.VaList(bp, rc))
stringAppendTerm(tls, p, bp+16 /* &zErr[0] */)
if *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)) != 0 {
stringAppendTerm(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrMsg */)))
@@ -4497,7 +4499,7 @@ func evalSql(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) int32 { /* mp
}
// Auxiliary SQL function to recursively evaluate SQL.
-func evalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:512:13: */
+func evalFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* mptest.c:512:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -4508,9 +4510,9 @@ func evalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* mpte
*(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)) = uintptr(0)
var rc int32
_ = argc
- crt.Xmemset(tls, bp /* &res */, 0, uint64(unsafe.Sizeof(String{})))
+ libc.Xmemset(tls, bp /* &res */, 0, uint64(unsafe.Sizeof(String{})))
rc = sqlite3.Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{evalCallback})), bp /* &res */, bp+16 /* &zErrMsg */)
if *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)) != 0 {
sqlite3.Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrMsg */)), -1)
@@ -4518,7 +4520,7 @@ func evalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* mpte
} else if rc != 0 {
sqlite3.Xsqlite3_result_error_code(tls, context, rc)
} else {
- sqlite3.Xsqlite3_result_text(tls, context, (*String)(unsafe.Pointer(bp /* &res */)).z, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, context, (*String)(unsafe.Pointer(bp /* &res */)).z, -1, libc.UintptrFromInt32(-1))
}
stringFree(tls, bp /* &res */)
}
@@ -4526,7 +4528,7 @@ func evalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* mpte
// Look up the next task for client iClient in the database.
// Return the task script and the task number and mark that
// task as being under way.
-func startScript(tls *crt.TLS, iClient int32, pzScript uintptr, pTaskId uintptr, pzTaskName uintptr) int32 { /* mptest.c:541:12: */
+func startScript(tls *libc.TLS, iClient int32, pzScript uintptr, pTaskId uintptr, pzTaskName uintptr) int32 { /* mptest.c:541:12: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -4545,37 +4547,37 @@ func startScript(tls *crt.TLS, iClient int32, pzScript uintptr, pTaskId uintptr,
continue
}
if rc != 0 {
- fatalError(tls, ts+177 /* "in startScript: ..." */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
+ fatalError(tls, ts+177 /* "in startScript: ..." */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
}
if (g.nError != 0) || (g.nTest != 0) {
runSql(tls, ts+196, /* "UPDATE counters ..." */
- crt.VaList(bp+8, g.nError, g.nTest))
+ libc.VaList(bp+8, g.nError, g.nTest))
g.nError = 0
g.nTest = 0
}
- pStmt = prepareSql(tls, ts+249 /* "SELECT 1 FROM cl..." */, crt.VaList(bp+24, iClient))
+ pStmt = prepareSql(tls, ts+249 /* "SELECT 1 FROM cl..." */, libc.VaList(bp+24, iClient))
rc = sqlite3.Xsqlite3_step(tls, pStmt)
sqlite3.Xsqlite3_finalize(tls, pStmt)
if rc == 100 {
- runSql(tls, ts+295 /* "DELETE FROM clie..." */, crt.VaList(bp+32, iClient))
+ runSql(tls, ts+295 /* "DELETE FROM clie..." */, libc.VaList(bp+32, iClient))
g.iTimeout = 10000
runSql(tls, ts+326 /* "COMMIT TRANSACTI..." */, 0)
return 101
}
pStmt = prepareSql(tls,
- ts+346 /* "SELECT script, i..." */, crt.VaList(bp+40, iClient))
+ ts+346 /* "SELECT script, i..." */, libc.VaList(bp+40, iClient))
rc = sqlite3.Xsqlite3_step(tls, pStmt)
if rc == 100 {
var n int32 = sqlite3.Xsqlite3_column_bytes(tls, pStmt, 0)
*(*uintptr)(unsafe.Pointer(pzScript)) = sqlite3.Xsqlite3_malloc(tls, (n + 1))
- crt.Xstrcpy(tls, *(*uintptr)(unsafe.Pointer(pzScript)), sqlite3.Xsqlite3_column_text(tls, pStmt, 0))
- *(*int32)(unsafe.Pointer(pTaskId)) = crt.AssignInt32(&taskId, sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
- *(*uintptr)(unsafe.Pointer(pzTaskName)) = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, crt.VaList(bp+48, sqlite3.Xsqlite3_column_text(tls, pStmt, 2)))
+ libc.Xstrcpy(tls, *(*uintptr)(unsafe.Pointer(pzScript)), sqlite3.Xsqlite3_column_text(tls, pStmt, 0))
+ *(*int32)(unsafe.Pointer(pTaskId)) = libc.AssignInt32(&taskId, sqlite3.Xsqlite3_column_int(tls, pStmt, 1))
+ *(*uintptr)(unsafe.Pointer(pzTaskName)) = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+48, sqlite3.Xsqlite3_column_text(tls, pStmt, 2)))
sqlite3.Xsqlite3_finalize(tls, pStmt)
runSql(tls,
- ts+441 /* "UPDATE task SE..." */, crt.VaList(bp+56, taskId))
+ ts+441 /* "UPDATE task SE..." */, libc.VaList(bp+56, taskId))
g.iTimeout = 10000
runSql(tls, ts+326 /* "COMMIT TRANSACTI..." */, 0)
return 0
@@ -4584,9 +4586,9 @@ func startScript(tls *crt.TLS, iClient int32, pzScript uintptr, pTaskId uintptr,
if rc == 101 {
if totalTime > 30000 {
errorMessage(tls, ts+524 /* "Waited over 30 s..." */, 0)
- runSql(tls, ts+573 /* "DELETE FROM clie..." */, crt.VaList(bp+64, iClient))
+ runSql(tls, ts+573 /* "DELETE FROM clie..." */, libc.VaList(bp+64, iClient))
sqlite3.Xsqlite3_close(tls, g.db)
- crt.Xexit(tls, 1)
+ libc.Xexit(tls, 1)
}
for trySql(tls, ts+613 /* "COMMIT" */, 0) == 5 {
sqlite3.Xsqlite3_sleep(tls, 10)
@@ -4596,7 +4598,7 @@ func startScript(tls *crt.TLS, iClient int32, pzScript uintptr, pTaskId uintptr,
totalTime = totalTime + (100)
continue
}
- fatalError(tls, ts+438 /* "%s" */, crt.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db)))
+ fatalError(tls, ts+438 /* "%s" */, libc.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, g.db)))
}
g.iTimeout = 10000
return int32(0)
@@ -4604,15 +4606,15 @@ func startScript(tls *crt.TLS, iClient int32, pzScript uintptr, pTaskId uintptr,
// Mark a script as having finished. Remove the CLIENT table entry
// if bShutdown is true.
-func finishScript(tls *crt.TLS, iClient int32, taskId int32, bShutdown int32) int32 { /* mptest.c:623:12: */
+func finishScript(tls *libc.TLS, iClient int32, taskId int32, bShutdown int32) int32 { /* mptest.c:623:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
runSql(tls,
- ts+620 /* "UPDATE task SE..." */, crt.VaList(bp, taskId))
+ ts+620 /* "UPDATE task SE..." */, libc.VaList(bp, taskId))
if bShutdown != 0 {
- runSql(tls, ts+295 /* "DELETE FROM clie..." */, crt.VaList(bp+8, iClient))
+ runSql(tls, ts+295 /* "DELETE FROM clie..." */, libc.VaList(bp+8, iClient))
}
return 0
}
@@ -4620,73 +4622,73 @@ func finishScript(tls *crt.TLS, iClient int32, taskId int32, bShutdown int32) in
// Start up a client process for iClient, if it is not already
// running. If the client is already running, then this routine
// is a no-op.
-func startClient(tls *crt.TLS, iClient int32) { /* mptest.c:638:13: */
+func startClient(tls *libc.TLS, iClient int32) { /* mptest.c:638:13: */
bp := tls.Alloc(96)
defer tls.Free(96)
- runSql(tls, ts+701 /* "INSERT OR IGNORE..." */, crt.VaList(bp, iClient))
+ runSql(tls, ts+701 /* "INSERT OR IGNORE..." */, libc.VaList(bp, iClient))
if sqlite3.Xsqlite3_changes(tls, g.db) != 0 {
var zSys uintptr
var rc int32
zSys = sqlite3.Xsqlite3_mprintf(tls, ts+743, /* "%s \"%s\" --client..." */
- crt.VaList(bp+8, g.argv0, g.zDbFile, iClient, g.iTrace))
+ libc.VaList(bp+8, g.argv0, g.zDbFile, iClient, g.iTrace))
if g.bSqlTrace != 0 {
- zSys = sqlite3.Xsqlite3_mprintf(tls, ts+774 /* "%z --sqltrace" */, crt.VaList(bp+40, zSys))
+ zSys = sqlite3.Xsqlite3_mprintf(tls, ts+774 /* "%z --sqltrace" */, libc.VaList(bp+40, zSys))
}
if g.bSync != 0 {
- zSys = sqlite3.Xsqlite3_mprintf(tls, ts+788 /* "%z --sync" */, crt.VaList(bp+48, zSys))
+ zSys = sqlite3.Xsqlite3_mprintf(tls, ts+788 /* "%z --sync" */, libc.VaList(bp+48, zSys))
}
if g.zVfs != 0 {
- zSys = sqlite3.Xsqlite3_mprintf(tls, ts+798 /* "%z --vfs \"%s\"" */, crt.VaList(bp+56, zSys, g.zVfs))
+ zSys = sqlite3.Xsqlite3_mprintf(tls, ts+798 /* "%z --vfs \"%s\"" */, libc.VaList(bp+56, zSys, g.zVfs))
}
if g.iTrace >= 2 {
- logMessage(tls, ts+812 /* "system('%q')" */, crt.VaList(bp+72, zSys))
+ logMessage(tls, ts+812 /* "system('%q')" */, libc.VaList(bp+72, zSys))
}
- zSys = sqlite3.Xsqlite3_mprintf(tls, ts+825 /* "%z &" */, crt.VaList(bp+80, zSys))
- rc = crt.Xsystem(tls, zSys)
+ zSys = sqlite3.Xsqlite3_mprintf(tls, ts+825 /* "%z &" */, libc.VaList(bp+80, zSys))
+ rc = libc.Xsystem(tls, zSys)
if rc != 0 {
- errorMessage(tls, ts+830 /* "system() fails w..." */, crt.VaList(bp+88, rc))
+ errorMessage(tls, ts+830 /* "system() fails w..." */, libc.VaList(bp+88, rc))
}
sqlite3.Xsqlite3_free(tls, zSys)
}
}
// Read the entire content of a file into memory
-func readFile(tls *crt.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
+func readFile(tls *libc.TLS, zFilename uintptr) uintptr { /* mptest.c:684:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
- var in uintptr = crt.Xfopen(tls, zFilename, ts+864 /* "rb" */)
+ var in uintptr = libc.Xfopen(tls, zFilename, ts+864 /* "rb" */)
var sz int64
var z uintptr
if in == uintptr(0) {
- fatalError(tls, ts+867 /* "cannot open \"%s\"..." */, crt.VaList(bp, zFilename))
+ fatalError(tls, ts+867 /* "cannot open \"%s\"..." */, libc.VaList(bp, zFilename))
}
- crt.Xfseek(tls, in, int64(0), 2)
- sz = crt.Xftell(tls, in)
- crt.Xrewind(tls, in)
+ libc.Xfseek(tls, in, int64(0), 2)
+ sz = libc.Xftell(tls, in)
+ libc.Xrewind(tls, in)
z = sqlite3.Xsqlite3_malloc(tls, (int32(sz + int64(1))))
- sz = int64(crt.Xfread(tls, z, uint64(1), uint64(sz), in))
+ sz = int64(libc.Xfread(tls, z, uint64(1), uint64(sz), in))
*(*int8)(unsafe.Pointer(z + uintptr(sz))) = int8(0)
- crt.Xfclose(tls, in)
+ libc.Xfclose(tls, in)
return z
}
// Return the length of the next token.
-func tokenLength(tls *crt.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:704:12: */
+func tokenLength(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:704:12: */
var n int32 = 0
- if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISspace)) != 0) || ((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '/') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) == '*')) {
+ if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISspace)) != 0) || ((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '/') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) == '*')) {
var inC int32 = 0
var c int32
if int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '/' {
inC = 1
n = 2
}
- for (crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&n, 1))))))) != 0 {
+ for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1))))))) != 0 {
if c == '\n' {
(*(*int32)(unsafe.Pointer(pnLine)))++
}
- if (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0 {
+ if (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0 {
continue
}
if ((inC != 0) && (c == '*')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == '/') {
@@ -4722,20 +4724,20 @@ func tokenLength(tls *crt.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:70
}
} else {
var c int32
- for n = 1; (((((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0)) && (c != '"')) && (c != '\'')) && (c != ';'); n++ {
+ for n = 1; (((((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))))) != 0) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0)) && (c != '"')) && (c != '\'')) && (c != ';'); n++ {
}
}
return n
}
// Copy a single token into a string buffer.
-func extractToken(tls *crt.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int32) int32 { /* mptest.c:749:12: */
+func extractToken(tls *libc.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int32) int32 { /* mptest.c:749:12: */
var i int32
if nIn <= 0 {
*(*int8)(unsafe.Pointer(zOut + uintptr(0))) = int8(0)
return 0
}
- for i = 0; ((i < nIn) && (i < (nOut - 1))) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
+ for i = 0; ((i < nIn) && (i < (nOut - 1))) && !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i))))))*2))) & int32(_ISspace)) != 0); i++ {
*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = *(*int8)(unsafe.Pointer(zIn + uintptr(i)))
}
*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = int8(0)
@@ -4743,9 +4745,9 @@ func extractToken(tls *crt.TLS, zIn uintptr, nIn int32, zOut uintptr, nOut int32
}
// Find the number of characters up to the start of the next "--end" token.
-func findEnd(tls *crt.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12: */
+func findEnd(tls *libc.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12: */
var n int32 = 0
- for (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && ((crt.Xstrncmp(tls, (z+uintptr(n)), ts+896 /* "--end" */, uint64(5)) != 0) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 5)))))))*2))) & int32(_ISspace)) != 0)) {
+ for (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+896 /* "--end" */, uint64(5)) != 0) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 5)))))))*2))) & int32(_ISspace)) != 0)) {
n = n + (tokenLength(tls, (z + uintptr(n)), pnLine))
}
return n
@@ -4754,15 +4756,15 @@ func findEnd(tls *crt.TLS, z uintptr, pnLine uintptr) int32 { /* mptest.c:763:12
// Find the number of characters up to the first character past the
// of the next "--endif" or "--else" token. Nested --if commands are
// also skipped.
-func findEndif(tls *crt.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32 { /* mptest.c:776:12: */
+func findEndif(tls *libc.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32 { /* mptest.c:776:12: */
var n int32 = 0
for *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 {
var len int32 = tokenLength(tls, (z + uintptr(n)), pnLine)
- if ((crt.Xstrncmp(tls, (z+uintptr(n)), ts+902 /* "--endif" */, uint64(7)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 7)))))))*2))) & int32(_ISspace)) != 0)) ||
- (((stopAtElse != 0) && (crt.Xstrncmp(tls, (z+uintptr(n)), ts+910 /* "--else" */, uint64(6)) == 0)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 6)))))))*2))) & int32(_ISspace)) != 0)) {
+ if ((libc.Xstrncmp(tls, (z+uintptr(n)), ts+902 /* "--endif" */, uint64(7)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 7)))))))*2))) & int32(_ISspace)) != 0)) ||
+ (((stopAtElse != 0) && (libc.Xstrncmp(tls, (z+uintptr(n)), ts+910 /* "--else" */, uint64(6)) == 0)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 6)))))))*2))) & int32(_ISspace)) != 0)) {
return (n + len)
}
- if (crt.Xstrncmp(tls, (z+uintptr(n)), ts+917 /* "--if" */, uint64(4)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 4)))))))*2))) & int32(_ISspace)) != 0) {
+ if (libc.Xstrncmp(tls, (z+uintptr(n)), ts+917 /* "--if" */, uint64(4)) == 0) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr((n + 4)))))))*2))) & int32(_ISspace)) != 0) {
var skip int32 = findEndif(tls, ((z + uintptr(n)) + uintptr(len)), 0, pnLine)
n = n + (skip + len)
} else {
@@ -4773,7 +4775,7 @@ func findEndif(tls *crt.TLS, z uintptr, stopAtElse int32, pnLine uintptr) int32
}
// Wait for a client process to complete all its tasks
-func waitForClient(tls *crt.TLS, iClient int32, iTimeout int32, zErrPrefix uintptr) { /* mptest.c:798:13: */
+func waitForClient(tls *libc.TLS, iClient int32, iTimeout int32, zErrPrefix uintptr) { /* mptest.c:798:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -4783,14 +4785,14 @@ func waitForClient(tls *crt.TLS, iClient int32, iTimeout int32, zErrPrefix uintp
pStmt = prepareSql(tls,
ts+922, /* "SELECT 1 FROM ta..." */
- crt.VaList(bp, iClient))
+ libc.VaList(bp, iClient))
} else {
pStmt = prepareSql(tls,
ts+1018 /* "SELECT 1 FROM ta..." */, 0)
}
g.iTimeout = 0
- for (((crt.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == 5) || (rc == 100)) &&
+ for (((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == 5) || (rc == 100)) &&
(iTimeout > 0) {
sqlite3.Xsqlite3_reset(tls, pStmt)
sqlite3.Xsqlite3_sleep(tls, 50)
@@ -4803,18 +4805,18 @@ func waitForClient(tls *crt.TLS, iClient int32, iTimeout int32, zErrPrefix uintp
zErrPrefix = ts + 1099 /* "" */
}
if iClient > 0 {
- errorMessage(tls, ts+1100 /* "%stimeout waitin..." */, crt.VaList(bp+8, zErrPrefix, iClient))
+ errorMessage(tls, ts+1100 /* "%stimeout waitin..." */, libc.VaList(bp+8, zErrPrefix, iClient))
} else {
- errorMessage(tls, ts+1132 /* "%stimeout waitin..." */, crt.VaList(bp+24, zErrPrefix))
+ errorMessage(tls, ts+1132 /* "%stimeout waitin..." */, libc.VaList(bp+24, zErrPrefix))
}
}
}
// Return a pointer to the tail of a filename
-func filenameTail(tls *crt.TLS, z uintptr) uintptr { /* mptest.c:836:13: */
+func filenameTail(tls *libc.TLS, z uintptr) uintptr { /* mptest.c:836:13: */
var i int32
var j int32
- for i = crt.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
+ for i = libc.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i))))) == '/' {
j = (i + 1)
}
@@ -4823,7 +4825,7 @@ func filenameTail(tls *crt.TLS, z uintptr) uintptr { /* mptest.c:836:13: */
}
// Interpret zArg as a boolean value. Return either 0 or 1.
-func booleanValue(tls *crt.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
+func booleanValue(tls *libc.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -4834,7 +4836,7 @@ func booleanValue(tls *crt.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
for i = 0; (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) <= '9'); i++ {
}
if (i > 0) && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) == 0) {
- return crt.Xatoi(tls, zArg)
+ return libc.Xatoi(tls, zArg)
}
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1166 /* "on" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1169 /* "yes" */) == 0) {
return 1
@@ -4842,20 +4844,20 @@ func booleanValue(tls *crt.TLS, zArg uintptr) int32 { /* mptest.c:845:12: */
if (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1173 /* "off" */) == 0) || (sqlite3.Xsqlite3_stricmp(tls, zArg, ts+1177 /* "no" */) == 0) {
return 0
}
- errorMessage(tls, ts+1180 /* "unknown boolean:..." */, crt.VaList(bp, zArg))
+ errorMessage(tls, ts+1180 /* "unknown boolean:..." */, libc.VaList(bp, zArg))
return 0
}
// This routine exists as a convenient place to set a debugger
// breakpoint.
-func test_breakpoint(tls *crt.TLS) { /* mptest.c:864:13: */ cnt++ }
+func test_breakpoint(tls *libc.TLS) { /* mptest.c:864:13: */ cnt++ }
var cnt int32 = 0 /* mptest.c:864:56 */
// Maximum number of arguments to a --command
// Run a script.
-func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFilename uintptr) { /* mptest.c:872:13: */
+func runScript(tls *libc.TLS, iClient int32, taskId int32, zScript uintptr, zFilename uintptr) { /* mptest.c:872:13: */
bp := tls.Alloc(1610)
defer tls.Free(1610)
@@ -4876,23 +4878,23 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// var azArg [2][100]int8 at bp+410, 200
- crt.Xmemset(tls, bp+360 /* &sResult */, 0, uint64(unsafe.Sizeof(String{})))
+ libc.Xmemset(tls, bp+360 /* &sResult */, 0, uint64(unsafe.Sizeof(String{})))
stringReset(tls, bp+360 /* &sResult */)
- for (crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii)))))) != 0 {
+ for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zScript + uintptr(ii)))))) != 0 {
prevLine = *(*int32)(unsafe.Pointer(bp + 376 /* lineno */))
len = tokenLength(tls, (zScript + uintptr(ii)), bp+376 /* &lineno */)
- if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0) || ((c == '/') && (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) == '*')) {
+ if ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(c)))*2))) & int32(_ISspace)) != 0) || ((c == '/') && (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) == '*')) {
ii = ii + (len)
continue
}
- if ((c != '-') || (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) != '-')) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 2))))))*2))) & int32(_ISalpha)) != 0) {
+ if ((c != '-') || (int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 1))))) != '-')) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + 2))))))*2))) & int32(_ISalpha)) != 0) {
ii = ii + (len)
continue
}
// Run any prior SQL before processing the new --command
if ii > iBegin {
- var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, crt.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin))))
+ var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp, (ii-iBegin), (zScript+uintptr(iBegin))))
evalSql(tls, bp+360 /* &sResult */, zSql, 0)
sqlite3.Xsqlite3_free(tls, zSql)
iBegin = (ii + len)
@@ -4900,11 +4902,11 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// Parse the --command
if g.iTrace >= 2 {
- logMessage(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+16, len, (zScript+uintptr(ii))))
+ logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+16, len, (zScript+uintptr(ii))))
}
n = extractToken(tls, ((zScript + uintptr(ii)) + uintptr(2)), (len - 2), bp+380 /* &zCmd[0] */, int32(unsafe.Sizeof([30]int8{})))
for nArg = 0; (n < (len - 2)) && (nArg < 2); nArg++ {
- for (n < (len - 2)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(((ii + 2) + n)))))))*2))) & int32(_ISspace)) != 0) {
+ for (n < (len - 2)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr(((ii + 2) + n)))))))*2))) & int32(_ISspace)) != 0) {
n++
}
if n >= (len - 2) {
@@ -4914,36 +4916,36 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
(bp + 410 /* &azArg[0] */ + uintptr(nArg)*100), int32(unsafe.Sizeof([100]int8{}))))
}
for j = nArg; j < 2; j++ {
- *(*int8)(unsafe.Pointer((bp + 410 /* &azArg[0] */ + uintptr(crt.PostIncInt32(&j, 1))*100) + uintptr(0))) = int8(0)
+ *(*int8)(unsafe.Pointer((bp + 410 /* &azArg[0] */ + uintptr(libc.PostIncInt32(&j, 1))*100) + uintptr(0))) = int8(0)
}
// --sleep N
//
// Pause for N milliseconds
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1207 /* "sleep" */) == 0 {
- sqlite3.Xsqlite3_sleep(tls, crt.Xatoi(tls, (bp+410 /* &azArg[0] */ +uintptr(0)*100)))
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1207 /* "sleep" */) == 0 {
+ sqlite3.Xsqlite3_sleep(tls, libc.Xatoi(tls, (bp+410 /* &azArg[0] */ +uintptr(0)*100)))
} else
// --exit N
//
// Exit this process. If N>0 then exit without shutting down
// SQLite. (In other words, simulate a crash.)
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1213 /* "exit" */) == 0 {
- var rc int32 = crt.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(0)*100))
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1213 /* "exit" */) == 0 {
+ var rc int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(0)*100))
finishScript(tls, iClient, taskId, 1)
if rc == 0 {
sqlite3.Xsqlite3_close(tls, g.db)
}
- crt.Xexit(tls, rc)
+ libc.Xexit(tls, rc)
} else
// --testcase NAME
//
// Begin a new test case. Announce in the log that the test case
// has begun.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1218 /* "testcase" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1218 /* "testcase" */) == 0 {
if g.iTrace == 1 {
- logMessage(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+32, (len-1), (zScript+uintptr(ii))))
+ logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+32, (len-1), (zScript+uintptr(ii))))
}
stringReset(tls, bp+360 /* &sResult */)
} else
@@ -4952,29 +4954,29 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// Mark the current task as having finished, even if it is not.
// This can be used in conjunction with --exit to simulate a crash.
- if (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1227 /* "finish" */) == 0) && (iClient > 0) {
+ if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1227 /* "finish" */) == 0) && (iClient > 0) {
finishScript(tls, iClient, taskId, 1)
} else
// --reset
//
// Reset accumulated results back to an empty string
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1234 /* "reset" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1234 /* "reset" */) == 0 {
stringReset(tls, bp+360 /* &sResult */)
} else
// --match ANSWER...
//
// Check to see if output matches ANSWER. Report an error if not.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1240 /* "match" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1240 /* "match" */) == 0 {
var jj int32
var zAns uintptr = (zScript + uintptr(ii))
- for jj = 7; (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
+ for jj = 7; (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
}
zAns += uintptr(jj)
- if (((len - jj) - 1) != (*String)(unsafe.Pointer(bp+360 /* &sResult */)).n) || (crt.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z, zAns, (uint64((len-jj)-1))) != 0) {
+ if (((len - jj) - 1) != (*String)(unsafe.Pointer(bp+360 /* &sResult */)).n) || (libc.Xstrncmp(tls, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z, zAns, (uint64((len-jj)-1))) != 0) {
errorMessage(tls, ts+1246, /* "line %d of %s:\nE..." */
- crt.VaList(bp+48, prevLine, zFilename, ((len-jj)-1), zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
+ libc.VaList(bp+48, prevLine, zFilename, ((len-jj)-1), zAns, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
}
g.nTest++
stringReset(tls, bp+360 /* &sResult */)
@@ -4985,18 +4987,18 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// Check to see if output does or does not match the glob pattern
// ANSWER.
- if (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1291 /* "glob" */) == 0) || (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1296 /* "notglob" */) == 0) {
+ if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1291 /* "glob" */) == 0) || (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1296 /* "notglob" */) == 0) {
var jj int32
var zAns uintptr = (zScript + uintptr(ii))
var zCopy uintptr
- var isGlob int32 = (crt.Bool32(int32(*(*int8)(unsafe.Pointer(bp + 380 /* &zCmd[0] */ + uintptr(0)))) == 'g'))
- for jj = (9 - (3 * isGlob)); (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
+ var isGlob int32 = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(bp + 380 /* &zCmd[0] */ + uintptr(0)))) == 'g'))
+ for jj = (9 - (3 * isGlob)); (jj < (len - 1)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zAns + uintptr(jj))))))*2))) & int32(_ISspace)) != 0); jj++ {
}
zAns += uintptr(jj)
- zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+88, ((len-jj)-1), zAns))
- if ((crt.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z) == 0)) ^ isGlob) != 0 {
+ zCopy = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+88, ((len-jj)-1), zAns))
+ if ((libc.Bool32(sqlite3.Xsqlite3_strglob(tls, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z) == 0)) ^ isGlob) != 0 {
errorMessage(tls, ts+1304, /* "line %d of %s:\nE..." */
- crt.VaList(bp+104, prevLine, zFilename, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
+ libc.VaList(bp+104, prevLine, zFilename, zCopy, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
}
sqlite3.Xsqlite3_free(tls, zCopy)
g.nTest++
@@ -5006,34 +5008,34 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// --output
//
// Output the result of the previous SQL.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1347 /* "output" */) == 0 {
- logMessage(tls, ts+438 /* "%s" */, crt.VaList(bp+136, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1347 /* "output" */) == 0 {
+ logMessage(tls, ts+438 /* "%s" */, libc.VaList(bp+136, (*String)(unsafe.Pointer(bp+360 /* &sResult */)).z))
} else
// --source FILENAME
//
// Run a subscript from a separate file.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1354 /* "source" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1354 /* "source" */) == 0 {
var zNewFile uintptr
var zNewScript uintptr
var zToDel uintptr = uintptr(0)
zNewFile = (bp + 410 /* &azArg[0] */ + uintptr(0)*100)
if !((int32(*(*int8)(unsafe.Pointer(zNewFile + uintptr(0))))) == '/') {
var k int32
- for k = (int32(crt.Xstrlen(tls, zFilename)) - 1); (k >= 0) && !((int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(k))))) == '/'); k-- {
+ for k = (int32(libc.Xstrlen(tls, zFilename)) - 1); (k >= 0) && !((int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(k))))) == '/'); k-- {
}
if k > 0 {
- zNewFile = crt.AssignUintptr(&zToDel, sqlite3.Xsqlite3_mprintf(tls, ts+1361 /* "%.*s/%s" */, crt.VaList(bp+144, k, zFilename, zNewFile)))
+ zNewFile = libc.AssignUintptr(&zToDel, sqlite3.Xsqlite3_mprintf(tls, ts+1361 /* "%.*s/%s" */, libc.VaList(bp+144, k, zFilename, zNewFile)))
}
}
zNewScript = readFile(tls, zNewFile)
if g.iTrace != 0 {
- logMessage(tls, ts+1369 /* "begin script [%s..." */, crt.VaList(bp+168, zNewFile))
+ logMessage(tls, ts+1369 /* "begin script [%s..." */, libc.VaList(bp+168, zNewFile))
}
runScript(tls, 0, 0, zNewScript, zNewFile)
sqlite3.Xsqlite3_free(tls, zNewScript)
if g.iTrace != 0 {
- logMessage(tls, ts+1388 /* "end script [%s]\n" */, crt.VaList(bp+176, zNewFile))
+ logMessage(tls, ts+1388 /* "end script [%s]\n" */, libc.VaList(bp+176, zNewFile))
}
sqlite3.Xsqlite3_free(tls, zToDel)
} else
@@ -5041,23 +5043,23 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// --print MESSAGE....
//
// Output the remainder of the line to the log file
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1405 /* "print" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1405 /* "print" */) == 0 {
var jj int32
- for jj = 7; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
+ for jj = 7; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
}
- logMessage(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+184, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
+ logMessage(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+184, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
} else
// --if EXPR
//
// Skip forward to the next matching --endif or --else if EXPR is false.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1411 /* "if" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1411 /* "if" */) == 0 {
var jj int32
var rc int32
var pStmt uintptr
- for jj = 4; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
+ for jj = 4; (jj < len) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zScript + uintptr((ii + jj)))))))*2))) & int32(_ISspace)) != 0); jj++ {
}
- pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, crt.VaList(bp+200, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
+ pStmt = prepareSql(tls, ts+1414 /* "SELECT %.*s" */, libc.VaList(bp+200, (len-jj), ((zScript+uintptr(ii))+uintptr(jj))))
rc = sqlite3.Xsqlite3_step(tls, pStmt)
if (rc != 100) || (sqlite3.Xsqlite3_column_int(tls, pStmt, 0) == 0) {
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 1, bp+376 /* &lineno */))
@@ -5069,7 +5071,7 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// This command can only be encountered if currently inside an --if that
// is true. Skip forward to the next matching --endif.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1426 /* "else" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1426 /* "else" */) == 0 {
ii = ii + (findEndif(tls, ((zScript + uintptr(ii)) + uintptr(len)), 0, bp+376 /* &lineno */))
} else
@@ -5077,14 +5079,14 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// This command can only be encountered if currently inside an --if that
// is true or an --else of a false if. This is a no-op.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1431 /* "endif" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1431 /* "endif" */) == 0 {
} else
// --start CLIENT
//
// Start up the given client.
- if (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1437 /* "start" */) == 0) && (iClient == 0) {
- var iNewClient int32 = crt.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(0)*100))
+ if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1437 /* "start" */) == 0) && (iClient == 0) {
+ var iNewClient int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(0)*100))
if iNewClient > 0 {
startClient(tls, iNewClient)
}
@@ -5095,16 +5097,16 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// Wait until all tasks complete for the given client. If CLIENT is
// "all" then wait for all clients to complete. Wait no longer than
// TIMEOUT milliseconds (default 10,000)
- if (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1443 /* "wait" */) == 0) && (iClient == 0) {
+ if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1443 /* "wait" */) == 0) && (iClient == 0) {
var iTimeout int32
if nArg >= 2 {
- iTimeout = crt.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(1)*100))
+ iTimeout = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(1)*100))
} else {
iTimeout = 10000
}
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1000]int8{})), bp+610 /* &zError[0] */, ts+1448, /* "line %d of %s\n" */
- crt.VaList(bp+216, prevLine, zFilename))
- waitForClient(tls, crt.Xatoi(tls, (bp+410 /* &azArg[0] */ +uintptr(0)*100)), iTimeout, bp+610 /* &zError[0] */)
+ libc.VaList(bp+216, prevLine, zFilename))
+ waitForClient(tls, libc.Xatoi(tls, (bp+410 /* &azArg[0] */ +uintptr(0)*100)), iTimeout, bp+610 /* &zError[0] */)
} else
// --task CLIENT
@@ -5113,25 +5115,25 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// Assign work to a client. Start the client if it is not running
// already.
- if (crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1463 /* "task" */) == 0) && (iClient == 0) {
- var iTarget int32 = crt.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(0)*100))
+ if (libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1463 /* "task" */) == 0) && (iClient == 0) {
+ var iTarget int32 = libc.Xatoi(tls, (bp + 410 /* &azArg[0] */ + uintptr(0)*100))
var iEnd int32
var zTask uintptr
var zTName uintptr
iEnd = findEnd(tls, ((zScript + uintptr(ii)) + uintptr(len)), bp+376 /* &lineno */)
if iTarget < 0 {
errorMessage(tls, ts+1468, /* "line %d of %s: b..." */
- crt.VaList(bp+232, prevLine, zFilename, iTarget))
+ libc.VaList(bp+232, prevLine, zFilename, iTarget))
} else {
- zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len))))
+ zTask = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+256, iEnd, ((zScript+uintptr(ii))+uintptr(len))))
if nArg > 1 {
- zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, crt.VaList(bp+272, (bp+410 /* &azArg[0] */ +uintptr(1)*100)))
+ zTName = sqlite3.Xsqlite3_mprintf(tls, ts+438 /* "%s" */, libc.VaList(bp+272, (bp+410 /* &azArg[0] */ +uintptr(1)*100)))
} else {
- zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1505 /* "%s:%d" */, crt.VaList(bp+280, filenameTail(tls, zFilename), prevLine))
+ zTName = sqlite3.Xsqlite3_mprintf(tls, ts+1505 /* "%s:%d" */, libc.VaList(bp+280, filenameTail(tls, zFilename), prevLine))
}
startClient(tls, iTarget)
runSql(tls,
- ts+1511 /* "INSERT INTO task..." */, crt.VaList(bp+296, iTarget, zTask, zTName))
+ ts+1511 /* "INSERT INTO task..." */, libc.VaList(bp+296, iTarget, zTask, zTName))
sqlite3.Xsqlite3_free(tls, zTask)
sqlite3.Xsqlite3_free(tls, zTName)
}
@@ -5144,28 +5146,28 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
//
// This command calls "test_breakpoint()" which is a routine provided
// as a convenient place to set a debugger breakpoint.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1567 /* "breakpoint" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1567 /* "breakpoint" */) == 0 {
test_breakpoint(tls)
} else
// --show-sql-errors BOOLEAN
//
// Turn display of SQL errors on and off.
- if crt.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1578 /* "show-sql-errors" */) == 0 {
+ if libc.Xstrcmp(tls, bp+380 /* &zCmd[0] */, ts+1578 /* "show-sql-errors" */) == 0 {
g.bIgnoreSqlErrors = func() int32 {
if nArg >= 1 {
- return crt.BoolInt32(!(booleanValue(tls, (bp+410 /* &azArg[0] */ +uintptr(0)*100)) != 0))
+ return libc.BoolInt32(!(booleanValue(tls, (bp+410 /* &azArg[0] */ +uintptr(0)*100)) != 0))
}
return 1
}()
} else {
errorMessage(tls, ts+1594, /* "line %d of %s: u..." */
- crt.VaList(bp+320, prevLine, zFilename, bp+380 /* &zCmd[0] */))
+ libc.VaList(bp+320, prevLine, zFilename, bp+380 /* &zCmd[0] */))
}
ii = ii + (len)
}
if iBegin < ii {
- var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, crt.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin))))
+ var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+1202 /* "%.*s" */, libc.VaList(bp+344, (ii-iBegin), (zScript+uintptr(iBegin))))
runSql(tls, zSql, 0)
sqlite3.Xsqlite3_free(tls, zSql)
}
@@ -5178,7 +5180,7 @@ func runScript(tls *crt.TLS, iClient int32, taskId int32, zScript uintptr, zFile
// hasArg==0 means the option is a flag. It is either present or not.
// hasArg==1 means the option has an argument. Return a pointer to the
// argument.
-func findOption(tls *crt.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, hasArg int32) uintptr { /* mptest.c:1201:13: */
+func findOption(tls *libc.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, hasArg int32) uintptr { /* mptest.c:1201:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -5203,18 +5205,18 @@ func findOption(tls *crt.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, has
}
z++
}
- if crt.Xstrcmp(tls, z, zOption) == 0 {
+ if libc.Xstrcmp(tls, z, zOption) == 0 {
if (hasArg != 0) && (i == (nArg - 1)) {
- fatalError(tls, ts+1630 /* "command-line opt..." */, crt.VaList(bp, z))
+ fatalError(tls, ts+1630 /* "command-line opt..." */, libc.VaList(bp, z))
}
if hasArg != 0 {
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8))
} else {
zReturn = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))
}
- j = ((i + 1) + (crt.Bool32(hasArg != 0)))
+ j = ((i + 1) + (libc.Bool32(hasArg != 0)))
for j < nArg {
- *(*uintptr)(unsafe.Pointer(azArg + uintptr(crt.PostIncInt32(&i, 1))*8)) = *(*uintptr)(unsafe.Pointer(azArg + uintptr(crt.PostIncInt32(&j, 1))*8))
+ *(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&i, 1))*8)) = *(*uintptr)(unsafe.Pointer(azArg + uintptr(libc.PostIncInt32(&j, 1))*8))
}
*(*int32)(unsafe.Pointer(pnArg)) = i
return zReturn
@@ -5224,7 +5226,7 @@ func findOption(tls *crt.TLS, azArg uintptr, pnArg uintptr, zOption uintptr, has
}
// Print a usage message for the program and exit
-func usage(tls *crt.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
+func usage(tls *libc.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -5235,28 +5237,28 @@ func usage(tls *crt.TLS, argv0 uintptr) { /* mptest.c:1241:13: */
zTail = ((argv0 + uintptr(i)) + uintptr(1))
}
}
- crt.Xfprintf(tls, crt.Xstderr, ts+1678 /* "Usage: %s DATABA..." */, crt.VaList(bp, zTail))
- crt.Xfprintf(tls, crt.Xstderr,
+ libc.Xfprintf(tls, libc.Xstderr, ts+1678 /* "Usage: %s DATABA..." */, libc.VaList(bp, zTail))
+ libc.Xfprintf(tls, libc.Xstderr,
ts+1717 /* "Options:\n --er..." */, 0)
- crt.Xexit(tls, 1)
+ libc.Xexit(tls, 1)
}
// Report on unrecognized arguments
-func unrecognizedArguments(tls *crt.TLS, argv0 uintptr, nArg int32, azArg uintptr) { /* mptest.c:1265:13: */
+func unrecognizedArguments(tls *libc.TLS, argv0 uintptr, nArg int32, azArg uintptr) { /* mptest.c:1265:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
var i int32
- crt.Xfprintf(tls, crt.Xstderr, ts+2289 /* "%s: unrecognized..." */, crt.VaList(bp, argv0))
+ libc.Xfprintf(tls, libc.Xstderr, ts+2289 /* "%s: unrecognized..." */, libc.VaList(bp, argv0))
for i = 0; i < nArg; i++ {
- crt.Xfprintf(tls, crt.Xstderr, ts+2317 /* " %s" */, crt.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))))
+ libc.Xfprintf(tls, libc.Xstderr, ts+2317 /* " %s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))))
}
- crt.Xfprintf(tls, crt.Xstderr, ts+2321 /* "\n" */, 0)
- crt.Xexit(tls, 1)
+ libc.Xfprintf(tls, libc.Xstderr, ts+2321 /* "\n" */, 0)
+ libc.Xexit(tls, 1)
}
-func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18: */
+func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18: */
bp := tls.Alloc(264)
defer tls.Free(264)
@@ -5289,19 +5291,19 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
if strglob(tls, ts+2323 /* "*.test" */, g.zDbFile) != 0 {
usage(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
}
- if crt.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2020-06-18 14:00..." */) != 0 {
- crt.Xfprintf(tls, crt.Xstderr,
+ if libc.Xstrcmp(tls, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2020-08-14 13:23..." */) != 0 {
+ libc.Xfprintf(tls, libc.Xstderr,
ts+2415, /* "SQLite library a..." */
- crt.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2020-06-18 14:00..." */))
- crt.Xexit(tls, 1)
+ libc.VaList(bp, sqlite3.Xsqlite3_sourceid(tls), ts+2330 /* "2020-08-14 13:23..." */))
+ libc.Xexit(tls, 1)
}
*(*int32)(unsafe.Pointer(bp + 232 /* n */)) = (argc - 2)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2475 /* "%05d.mptest" */, crt.VaList(bp+16, crt.Xgetpid(tls)))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2475 /* "%05d.mptest" */, libc.VaList(bp+16, libc.Xgetpid(tls)))
zJMode = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2487 /* "journalmode" */, 1)
zNRep = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2499 /* "repeat" */, 1)
if zNRep != 0 {
- nRep = crt.Xatoi(tls, zNRep)
+ nRep = libc.Xatoi(tls, zNRep)
}
if nRep < 1 {
nRep = 1
@@ -5312,104 +5314,104 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
g.zLog = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2524 /* "log" */, 1)
zTrace = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2528 /* "trace" */, 1)
if zTrace != 0 {
- g.iTrace = crt.Xatoi(tls, zTrace)
+ g.iTrace = libc.Xatoi(tls, zTrace)
}
if findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2534 /* "quiet" */, 0) != uintptr(0) {
g.iTrace = 0
}
zTmout = findOption(tls, (argv + uintptr(2)*8), bp+232 /* &n */, ts+2540 /* "timeout" */, 1)
if zTmout != 0 {
- iTmout = crt.Xatoi(tls, zTmout)
+ iTmout = libc.Xatoi(tls, zTmout)
}
- g.bSqlTrace = (crt.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2548 /* "sqltrace" */, 0) != uintptr(0)))
- g.bSync = (crt.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2557 /* "sync" */, 0) != uintptr(0)))
+ g.bSqlTrace = (libc.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2548 /* "sqltrace" */, 0) != uintptr(0)))
+ g.bSync = (libc.Bool32(findOption(tls, (argv+uintptr(2)*8), bp+232 /* &n */, ts+2557 /* "sync" */, 0) != uintptr(0)))
if g.zErrLog != 0 {
- g.pErrLog = crt.Xfopen(tls, g.zErrLog, ts+2562 /* "a" */)
+ g.pErrLog = libc.Xfopen(tls, g.zErrLog, ts+2562 /* "a" */)
} else {
- g.pErrLog = crt.Xstderr
+ g.pErrLog = libc.Xstderr
}
if g.zLog != 0 {
- g.pLog = crt.Xfopen(tls, g.zLog, ts+2562 /* "a" */)
+ g.pLog = libc.Xfopen(tls, g.zLog, ts+2562 /* "a" */)
} else {
- g.pLog = crt.Xstdout
+ g.pLog = libc.Xstdout
}
- sqlite3.Xsqlite3_config(tls, 16, crt.VaList(bp+24, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ sqlite3.Xsqlite3_config(tls, 16, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{sqlErrorCallback})), 0))
if zClient != 0 {
- iClient = crt.Xatoi(tls, zClient)
+ iClient = libc.Xatoi(tls, zClient)
if iClient < 1 {
- fatalError(tls, ts+2564 /* "illegal client n..." */, crt.VaList(bp+40, iClient))
+ fatalError(tls, ts+2564 /* "illegal client n..." */, libc.VaList(bp+40, iClient))
}
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), uintptr(unsafe.Pointer(&g))+64 /* &.zName */, ts+2591, /* "%05d.client%02d" */
- crt.VaList(bp+48, crt.Xgetpid(tls), iClient))
+ libc.VaList(bp+48, libc.Xgetpid(tls), iClient))
} else {
var nTry int32 = 0
if g.iTrace > 0 {
- crt.Xprintf(tls, ts+2607 /* "BEGIN: %s" */, crt.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
+ libc.Xprintf(tls, ts+2607 /* "BEGIN: %s" */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
for i = 1; i < argc; i++ {
- crt.Xprintf(tls, ts+2317 /* " %s" */, crt.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ libc.Xprintf(tls, ts+2317 /* " %s" */, libc.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
- crt.Xprintf(tls, ts+2321 /* "\n" */, 0)
- crt.Xprintf(tls, ts+2617 /* "With SQLite 3.32..." */, 0)
- for i = 0; (crt.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ {
- crt.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, crt.VaList(bp+80, zCOption))
+ libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
+ libc.Xprintf(tls, ts+2617 /* "With SQLite 3.33..." */, 0)
+ for i = 0; (libc.AssignUintptr(&zCOption, sqlite3.Xsqlite3_compileoption_get(tls, i))) != uintptr(0); i++ {
+ libc.Xprintf(tls, ts+2722 /* "-DSQLITE_%s\n" */, libc.VaList(bp+80, zCOption))
}
- crt.Xfflush(tls, crt.Xstdout)
+ libc.Xfflush(tls, libc.Xstdout)
}
iClient = 0
- for ok := true; ok; ok = (((rc != 0) && ((crt.PreIncInt32(&nTry, 1)) < 60)) && (sqlite3.Xsqlite3_sleep(tls, 1000) > 0)) {
+ for ok := true; ok; ok = (((rc != 0) && ((libc.PreIncInt32(&nTry, 1)) < 60)) && (sqlite3.Xsqlite3_sleep(tls, 1000) > 0)) {
if (nTry % 5) == 4 {
- crt.Xprintf(tls, ts+2735, /* "... %strying to ..." */
- crt.VaList(bp+88, func() uintptr {
+ libc.Xprintf(tls, ts+2735, /* "... %strying to ..." */
+ libc.VaList(bp+88, func() uintptr {
if nTry > 5 {
return ts + 2764 /* "still " */
}
return ts + 1099 /* "" */
}(), g.zDbFile))
}
- rc = crt.Xunlink(tls, g.zDbFile)
- if (rc != 0) && ((*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) == 2) {
+ rc = libc.Xunlink(tls, g.zDbFile)
+ if (rc != 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == 2) {
rc = 0
}
}
if rc != 0 {
fatalError(tls, ts+2771, /* "unable to unlink..." */
- crt.VaList(bp+104, g.zDbFile, nTry))
+ libc.VaList(bp+104, g.zDbFile, nTry))
}
openFlags = openFlags | (0x00000004)
}
rc = sqlite3.Xsqlite3_open_v2(tls, g.zDbFile, (uintptr(unsafe.Pointer(&g)) + 24 /* &.db */), openFlags, g.zVfs)
if rc != 0 {
- fatalError(tls, ts+2812 /* "cannot open [%s]" */, crt.VaList(bp+120, g.zDbFile))
+ fatalError(tls, ts+2812 /* "cannot open [%s]" */, libc.VaList(bp+120, g.zDbFile))
}
if iTmout > 0 {
sqlite3.Xsqlite3_busy_timeout(tls, g.db, iTmout)
}
if zJMode != 0 {
- runSql(tls, ts+2829 /* "PRAGMA journal_m..." */, crt.VaList(bp+128, zJMode))
+ runSql(tls, ts+2829 /* "PRAGMA journal_m..." */, libc.VaList(bp+128, zJMode))
}
if !(g.bSync != 0) {
trySql(tls, ts+2853 /* "PRAGMA synchrono..." */, 0)
}
sqlite3.Xsqlite3_enable_load_extension(tls, g.db, 1)
sqlite3.Xsqlite3_busy_handler(tls, g.db, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{busyHandler})), uintptr(0))
sqlite3.Xsqlite3_create_function(tls, g.db, ts+2876 /* "vfsname" */, 0, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{vfsNameFunc})), uintptr(0), uintptr(0))
sqlite3.Xsqlite3_create_function(tls, g.db, ts+2884 /* "eval" */, 1, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{evalFunc})), uintptr(0), uintptr(0))
g.iTimeout = 10000
if g.bSqlTrace != 0 {
sqlite3.Xsqlite3_trace(tls, g.db, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{sqlTraceCallback})), uintptr(0))
}
if iClient > 0 {
@@ -5426,11 +5428,11 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
break
}
if g.iTrace != 0 {
- logMessage(tls, ts+2902 /* "begin %s (%d)" */, crt.VaList(bp+136, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)), *(*int32)(unsafe.Pointer(bp + 248 /* taskId */))))
+ logMessage(tls, ts+2902 /* "begin %s (%d)" */, libc.VaList(bp+136, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)), *(*int32)(unsafe.Pointer(bp + 248 /* taskId */))))
}
runScript(tls, iClient, *(*int32)(unsafe.Pointer(bp + 248 /* taskId */)), *(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)), *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)))
if g.iTrace != 0 {
- logMessage(tls, ts+2916 /* "end %s (%d)" */, crt.VaList(bp+152, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)), *(*int32)(unsafe.Pointer(bp + 248 /* taskId */))))
+ logMessage(tls, ts+2916 /* "end %s (%d)" */, libc.VaList(bp+152, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)), *(*int32)(unsafe.Pointer(bp + 248 /* taskId */))))
}
finishScript(tls, iClient, *(*int32)(unsafe.Pointer(bp + 248 /* taskId */)), 0)
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 256 /* zTaskName */)))
@@ -5454,11 +5456,11 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
*(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)) = readFile(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)))
for iRep = 1; iRep <= nRep; iRep++ {
if g.iTrace != 0 {
- logMessage(tls, ts+3399 /* "begin script [%s..." */, crt.VaList(bp+168, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), iRep))
+ logMessage(tls, ts+3399 /* "begin script [%s..." */, libc.VaList(bp+168, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), iRep))
}
runScript(tls, 0, 0, *(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)), *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)))
if g.iTrace != 0 {
- logMessage(tls, ts+3427 /* "end script [%s] ..." */, crt.VaList(bp+184, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), iRep))
+ logMessage(tls, ts+3427 /* "end script [%s] ..." */, libc.VaList(bp+184, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), iRep))
}
}
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 240 /* zScript */)))
@@ -5467,7 +5469,7 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
sqlite3.Xsqlite3_sleep(tls, 10)
g.iTimeout = 0
iTimeout = 1000
- for (((crt.AssignInt32(&rc, trySql(tls, ts+3502 /* "SELECT 1 FROM cl..." */, 0))) == 5) ||
+ for (((libc.AssignInt32(&rc, trySql(tls, ts+3502 /* "SELECT 1 FROM cl..." */, 0))) == 5) ||
(rc == 100)) && (iTimeout > 0) {
sqlite3.Xsqlite3_sleep(tls, 10)
iTimeout = iTimeout - (10)
@@ -5475,7 +5477,7 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
sqlite3.Xsqlite3_sleep(tls, 100)
pStmt = prepareSql(tls, ts+3523 /* "SELECT nError, n..." */, 0)
iTimeout = 1000
- for ((crt.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == 5) && (iTimeout > 0) {
+ for ((libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) == 5) && (iTimeout > 0) {
sqlite3.Xsqlite3_sleep(tls, 10)
iTimeout = iTimeout - (10)
}
@@ -5489,15 +5491,15 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* mptest.c:1279:18:
maybeClose(tls, g.pLog)
maybeClose(tls, g.pErrLog)
if iClient == 0 {
- crt.Xprintf(tls, ts+3558 /* "Summary: %d erro..." */, crt.VaList(bp+200, g.nError, g.nTest))
- crt.Xprintf(tls, ts+3594 /* "END: %s" */, crt.VaList(bp+216, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
+ libc.Xprintf(tls, ts+3558 /* "Summary: %d erro..." */, libc.VaList(bp+200, g.nError, g.nTest))
+ libc.Xprintf(tls, ts+3594 /* "END: %s" */, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
for i = 1; i < argc; i++ {
- crt.Xprintf(tls, ts+2317 /* " %s" */, crt.VaList(bp+224, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ libc.Xprintf(tls, ts+2317 /* " %s" */, libc.VaList(bp+224, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
- crt.Xprintf(tls, ts+2321 /* "\n" */, 0)
+ libc.Xprintf(tls, ts+2321 /* "\n" */, 0)
}
- return (crt.Bool32(g.nError > 0))
+ return (libc.Bool32(g.nError > 0))
}
-var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\x00BEGIN IMMEDIATE\x00in startScript: %s\x00UPDATE counters SET nError=nError+%d, nTest=nTest+%d\x00SELECT 1 FROM client WHERE id=%d AND wantHalt\x00DELETE FROM client WHERE id=%d\x00COMMIT TRANSACTION;\x00SELECT script, id, name FROM task WHERE client=%d AND starttime IS NULL ORDER BY id LIMIT 1\x00%s\x00UPDATE task SET starttime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00Waited over 30 seconds with no work. Giving up.\x00DELETE FROM client WHERE id=%d; COMMIT;\x00COMMIT\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00INSERT OR IGNORE INTO client VALUES(%d,0)\x00%s \"%s\" --client %d --trace %d\x00%z --sqltrace\x00%z --sync\x00%z --vfs \"%s\"\x00system('%q')\x00%z &\x00system() fails with error code %d\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\x00SELECT 1 FROM task WHERE client=%d AND client IN (SELECT id FROM client) AND endtime IS NULL\x00SELECT 1 FROM task WHERE client IN (SELECT id FROM client) AND endtime IS NULL\x00\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\x00task\x00line %d of %s: bad client number: %d\x00%s:%d\x00INSERT INTO task(client,script,name) VALUES(%d,'%q',%Q)\x00breakpoint\x00show-sql-errors\x00line %d of %s: unknown command --%s\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.32.3 2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\x00cannot open [%s]\x00PRAGMA journal_mode=%Q;\x00PRAGMA synchronous=OFF\x00vfsname\x00eval\x00start-client\x00begin %s (%d)\x00end %s (%d)\x00end-client\x00missing script filename\x00DROP TABLE IF EXISTS task;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00"
+var ts1 = "%s%.*s\n\x00%s:ERROR: \x00%s:FATAL: \x00UPDATE client SET wantHalt=1;\x00%s: \x00main\x00timeout after %dms\x00[%.*s]\x00(info) %s\x00(errcode=%d) %s\x00%s\n%s\n\x00out of memory\x00 \x00nil\x00'\x00error(%d)\x00BEGIN IMMEDIATE\x00in startScript: %s\x00UPDATE counters SET nError=nError+%d, nTest=nTest+%d\x00SELECT 1 FROM client WHERE id=%d AND wantHalt\x00DELETE FROM client WHERE id=%d\x00COMMIT TRANSACTION;\x00SELECT script, id, name FROM task WHERE client=%d AND starttime IS NULL ORDER BY id LIMIT 1\x00%s\x00UPDATE task SET starttime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00Waited over 30 seconds with no work. Giving up.\x00DELETE FROM client WHERE id=%d; COMMIT;\x00COMMIT\x00UPDATE task SET endtime=strftime('%%Y-%%m-%%d %%H:%%M:%%f','now') WHERE id=%d;\x00INSERT OR IGNORE INTO client VALUES(%d,0)\x00%s \"%s\" --client %d --trace %d\x00%z --sqltrace\x00%z --sync\x00%z --vfs \"%s\"\x00system('%q')\x00%z &\x00system() fails with error code %d\x00rb\x00cannot open \"%s\" for reading\x00--end\x00--endif\x00--else\x00--if\x00SELECT 1 FROM task WHERE client=%d AND client IN (SELECT id FROM client) AND endtime IS NULL\x00SELECT 1 FROM task WHERE client IN (SELECT id FROM client) AND endtime IS NULL\x00\x00%stimeout waiting for client %d\x00%stimeout waiting for all clients\x00on\x00yes\x00off\x00no\x00unknown boolean: [%s]\x00%.*s\x00sleep\x00exit\x00testcase\x00finish\x00reset\x00match\x00line %d of %s:\nExpected [%.*s]\n Got [%s]\x00glob\x00notglob\x00line %d of %s:\nExpected [%s]\n Got [%s]\x00output\x00source\x00%.*s/%s\x00begin script [%s]\n\x00end script [%s]\n\x00print\x00if\x00SELECT %.*s\x00else\x00endif\x00start\x00wait\x00line %d of %s\n\x00task\x00line %d of %s: bad client number: %d\x00%s:%d\x00INSERT INTO task(client,script,name) VALUES(%d,'%q',%Q)\x00breakpoint\x00show-sql-errors\x00line %d of %s: unknown command --%s\x00command-line option \"--%s\" requires an argument\x00Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n\x00Options:\n --errlog FILENAME Write errors to FILENAME\n --journalmode MODE Use MODE as the journal_mode\n --log FILENAME Log messages to FILENAME\n --quiet Suppress unnecessary output\n --vfs NAME Use NAME as the VFS\n --repeat N Repeat the test N times\n --sqltrace Enable SQL tracing\n --sync Enable synchronous disk writes\n --timeout MILLISEC Busy timeout is MILLISEC\n --trace BOOLEAN Enable or disable tracing\n\x00%s: unrecognized arguments:\x00 %s\x00\n\x00*.test\x002020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f\x00SQLite library and header mismatch\nLibrary: %s\nHeader: %s\n\x00%05d.mptest\x00journalmode\x00repeat\x00vfs\x00client\x00errlog\x00log\x00trace\x00quiet\x00timeout\x00sqltrace\x00sync\x00a\x00illegal client number: %d\n\x00%05d.client%02d\x00BEGIN: %s\x00With SQLite 3.33.0 2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f\n\x00-DSQLITE_%s\n\x00... %strying to unlink '%s'\n\x00still \x00unable to unlink '%s' after %d attempts\n\x00cannot open [%s]\x00PRAGMA journal_mode=%Q;\x00PRAGMA synchronous=OFF\x00vfsname\x00eval\x00start-client\x00begin %s (%d)\x00end %s (%d)\x00end-client\x00missing script filename\x00DROP TABLE IF EXISTS task;\nDROP TABLE IF EXISTS counters;\nDROP TABLE IF EXISTS client;\nCREATE TABLE task(\n id INTEGER PRIMARY KEY,\n name TEXT,\n client INTEGER,\n starttime DATE,\n endtime DATE,\n script TEXT\n);CREATE INDEX task_i1 ON task(client, starttime);\nCREATE INDEX task_i2 ON task(client, endtime);\nCREATE TABLE counters(nError,nTest);\nINSERT INTO counters VALUES(0,0);\nCREATE TABLE client(id INTEGER PRIMARY KEY, wantHalt);\n\x00begin script [%s] cycle %d\n\x00end script [%s] cycle %d\n\x00during shutdown...\n\x00UPDATE client SET wantHalt=1\x00SELECT 1 FROM client\x00SELECT nError, nTest FROM counters\x00Summary: %d errors out of %d tests\n\x00END: %s\x00"
var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data
diff --git a/internal/testfixture/main.go b/internal/testfixture/main.go
deleted file mode 100644
index 02acb67..0000000
--- a/internal/testfixture/main.go
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2020 The Sqlite Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package testfixture
-
-import (
- "fmt"
- "os"
- "unsafe"
-
- "modernc.org/crt/v3"
-)
-
-func Main() {
- crt.Watch(fmt.Sprint(os.Args))
- tls := crt.NewTLS()
- argv := crt.Xcalloc(tls, crt.Size_t(len(os.Args)+1), crt.Size_t(unsafe.Sizeof(uintptr(0))))
- a := []uintptr{argv}
- p := argv
- for _, v := range os.Args {
- s := crt.Xcalloc(tls, crt.Size_t(len(v)+1), 1)
- a = append(a, s)
- copy((*(*[1 << 20]byte)(unsafe.Pointer(s)))[:], v)
- *(*uintptr)(unsafe.Pointer(p)) = s
- p += unsafe.Sizeof(uintptr(0))
- }
- crt.SetEnviron(os.Environ())
- rc := main(tls, int32(len(os.Args)), argv)
- for _, p := range a {
- crt.Xfree(tls, p)
- }
- crt.Xexit(tls, rc)
-}
diff --git a/internal/testfixture/testfixture_linux_amd64.go b/internal/testfixture/testfixture_linux_amd64.go
index 51bac67..f27e64b 100644
--- a/internal/testfixture/testfixture_linux_amd64.go
+++ b/internal/testfixture/testfixture_linux_amd64.go
@@ -1,14 +1,14 @@
-// Code generated by 'ccgo -DSQLITE_OMIT_LOAD_EXTENSION -DTCLSH_INIT_PROC=sqlite3TestInit -I/usr/include/tcl8.6 -ccgo-export-defines -ccgo-export-fields F -ccgo-pkgname testfixture -l modernc.org/tcl/lib,modernc.org/sqlite/internal/crt2,modernc.org/sqlite/lib -o internal/testfixture/testfixture_linux_amd64.go testdata/sqlite-src-3320300/ext/expert/sqlite3expert.c testdata/sqlite-src-3320300/ext/expert/test_expert.c testdata/sqlite-src-3320300/ext/fts5/fts5_tcl.c testdata/sqlite-src-3320300/ext/misc/amatch.c testdata/sqlite-src-3320300/ext/misc/carray.c testdata/sqlite-src-3320300/ext/misc/closure.c testdata/sqlite-src-3320300/ext/misc/csv.c testdata/sqlite-src-3320300/ext/misc/eval.c testdata/sqlite-src-3320300/ext/misc/explain.c testdata/sqlite-src-3320300/ext/misc/fileio.c testdata/sqlite-src-3320300/ext/misc/fuzzer.c testdata/sqlite-src-3320300/ext/misc/ieee754.c testdata/sqlite-src-3320300/ext/misc/mmapwarm.c testdata/sqlite-src-3320300/ext/misc/nextchar.c testdata/sqlite-src-3320300/ext/misc/normalize.c testdata/sqlite-src-3320300/ext/misc/percentile.c testdata/sqlite-src-3320300/ext/misc/prefixes.c testdata/sqlite-src-3320300/ext/misc/regexp.c testdata/sqlite-src-3320300/ext/misc/remember.c testdata/sqlite-src-3320300/ext/misc/series.c testdata/sqlite-src-3320300/ext/misc/spellfix.c testdata/sqlite-src-3320300/ext/misc/totype.c testdata/sqlite-src-3320300/ext/misc/unionvtab.c testdata/sqlite-src-3320300/ext/misc/wholenumber.c testdata/sqlite-src-3320300/ext/misc/zipfile.c testdata/sqlite-src-3320300/ext/rbu/sqlite3rbu.c testdata/sqlite-src-3320300/ext/rbu/test_rbu.c testdata/sqlite-src-3320300/src/tclsqlite.c testdata/sqlite-src-3320300/src/test1.c testdata/sqlite-src-3320300/src/test2.c testdata/sqlite-src-3320300/src/test3.c testdata/sqlite-src-3320300/src/test4.c testdata/sqlite-src-3320300/src/test5.c testdata/sqlite-src-3320300/src/test6.c testdata/sqlite-src-3320300/src/test7.c testdata/sqlite-src-3320300/src/test8.c testdata/sqlite-src-3320300/src/test9.c testdata/sqlite-src-3320300/src/test_async.c testdata/sqlite-src-3320300/src/test_autoext.c testdata/sqlite-src-3320300/src/test_backup.c testdata/sqlite-src-3320300/src/test_bestindex.c testdata/sqlite-src-3320300/src/test_blob.c testdata/sqlite-src-3320300/src/test_btree.c testdata/sqlite-src-3320300/src/test_config.c testdata/sqlite-src-3320300/src/test_delete.c testdata/sqlite-src-3320300/src/test_demovfs.c testdata/sqlite-src-3320300/src/test_devsym.c testdata/sqlite-src-3320300/src/test_fs.c testdata/sqlite-src-3320300/src/test_func.c testdata/sqlite-src-3320300/src/test_hexio.c testdata/sqlite-src-3320300/src/test_init.c testdata/sqlite-src-3320300/src/test_intarray.c testdata/sqlite-src-3320300/src/test_journal.c testdata/sqlite-src-3320300/src/test_malloc.c testdata/sqlite-src-3320300/src/test_md5.c testdata/sqlite-src-3320300/src/test_multiplex.c testdata/sqlite-src-3320300/src/test_mutex.c testdata/sqlite-src-3320300/src/test_onefile.c testdata/sqlite-src-3320300/src/test_osinst.c testdata/sqlite-src-3320300/src/test_pcache.c testdata/sqlite-src-3320300/src/test_quota.c testdata/sqlite-src-3320300/src/test_rtree.c testdata/sqlite-src-3320300/src/test_schema.c testdata/sqlite-src-3320300/src/test_server.c testdata/sqlite-src-3320300/src/test_superlock.c testdata/sqlite-src-3320300/src/test_syscall.c testdata/sqlite-src-3320300/src/test_tclsh.c testdata/sqlite-src-3320300/src/test_tclvar.c testdata/sqlite-src-3320300/src/test_thread.c testdata/sqlite-src-3320300/src/test_vdbecov.c testdata/sqlite-src-3320300/src/test_vfs.c testdata/sqlite-src-3320300/src/test_window.c -Itestdata/sqlite-amalgamation-3320300 -Itestdata/sqlite-src-3320300 -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_DQS=0 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_MAX_MMAP_SIZE=8589934592 -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_NO_SYNC=1 -DSQLITE_OS_UNIX=1 -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 -DSQLITE_SERVER=1 -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.
+// Code generated by 'ccgo -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 -DSQLITE_SERVER=1 -DTCLSH_INIT_PROC=sqlite3TestInit -D_HAVE_SQLITE_CONFIG_H -I/usr/include/tcl8.6 -ccgo-export-defines "" -ccgo-export-fields F -lmodernc.org/tcl/lib,modernc.org/sqlite/internal/libc2,modernc.org/sqlite/lib -o internal/testfixture/testfixture_linux_amd64.go -Itestdata/sqlite-src-3330000/ext/async -Itestdata/sqlite-src-3330000/ext/fts3 -Itestdata/sqlite-src-3330000/ext/icu -Itestdata/sqlite-src-3330000/ext/rtree -Itestdata/sqlite-src-3330000/ext/session -Itestdata/sqlite-src-3330000/ext/userauth -Itestdata/sqlite-src-3330000/src -Itestdata/sqlite-amalgamation-3330000 -Itestdata/sqlite-src-3330000 testdata/sqlite-src-3330000/ext/expert/sqlite3expert.c testdata/sqlite-src-3330000/ext/expert/test_expert.c testdata/sqlite-src-3330000/ext/fts3/fts3_term.c testdata/sqlite-src-3330000/ext/fts3/fts3_test.c testdata/sqlite-src-3330000/ext/fts5/fts5_tcl.c testdata/sqlite-src-3330000/ext/fts5/fts5_test_mi.c testdata/sqlite-src-3330000/ext/fts5/fts5_test_tok.c testdata/sqlite-src-3330000/ext/misc/amatch.c testdata/sqlite-src-3330000/ext/misc/carray.c testdata/sqlite-src-3330000/ext/misc/closure.c testdata/sqlite-src-3330000/ext/misc/csv.c testdata/sqlite-src-3330000/ext/misc/decimal.c testdata/sqlite-src-3330000/ext/misc/eval.c testdata/sqlite-src-3330000/ext/misc/explain.c testdata/sqlite-src-3330000/ext/misc/fileio.c testdata/sqlite-src-3330000/ext/misc/fuzzer.c testdata/sqlite-src-3330000/ext/misc/ieee754.c testdata/sqlite-src-3330000/ext/misc/mmapwarm.c testdata/sqlite-src-3330000/ext/misc/nextchar.c testdata/sqlite-src-3330000/ext/misc/normalize.c testdata/sqlite-src-3330000/ext/misc/percentile.c testdata/sqlite-src-3330000/ext/misc/prefixes.c testdata/sqlite-src-3330000/ext/misc/regexp.c testdata/sqlite-src-3330000/ext/misc/remember.c testdata/sqlite-src-3330000/ext/misc/series.c testdata/sqlite-src-3330000/ext/misc/spellfix.c testdata/sqlite-src-3330000/ext/misc/totype.c testdata/sqlite-src-3330000/ext/misc/unionvtab.c testdata/sqlite-src-3330000/ext/misc/wholenumber.c testdata/sqlite-src-3330000/ext/misc/zipfile.c testdata/sqlite-src-3330000/ext/rbu/test_rbu.c testdata/sqlite-src-3330000/ext/userauth/userauth.c testdata/sqlite-src-3330000/src/tclsqlite.c testdata/sqlite-src-3330000/src/test1.c testdata/sqlite-src-3330000/src/test2.c testdata/sqlite-src-3330000/src/test3.c testdata/sqlite-src-3330000/src/test4.c testdata/sqlite-src-3330000/src/test5.c testdata/sqlite-src-3330000/src/test6.c testdata/sqlite-src-3330000/src/test7.c testdata/sqlite-src-3330000/src/test8.c testdata/sqlite-src-3330000/src/test9.c testdata/sqlite-src-3330000/src/test_async.c testdata/sqlite-src-3330000/src/test_autoext.c testdata/sqlite-src-3330000/src/test_backup.c testdata/sqlite-src-3330000/src/test_bestindex.c testdata/sqlite-src-3330000/src/test_blob.c testdata/sqlite-src-3330000/src/test_btree.c testdata/sqlite-src-3330000/src/test_config.c testdata/sqlite-src-3330000/src/test_delete.c testdata/sqlite-src-3330000/src/test_demovfs.c testdata/sqlite-src-3330000/src/test_devsym.c testdata/sqlite-src-3330000/src/test_fs.c testdata/sqlite-src-3330000/src/test_func.c testdata/sqlite-src-3330000/src/test_hexio.c testdata/sqlite-src-3330000/src/test_init.c testdata/sqlite-src-3330000/src/test_intarray.c testdata/sqlite-src-3330000/src/test_journal.c testdata/sqlite-src-3330000/src/test_malloc.c testdata/sqlite-src-3330000/src/test_md5.c testdata/sqlite-src-3330000/src/test_multiplex.c testdata/sqlite-src-3330000/src/test_mutex.c testdata/sqlite-src-3330000/src/test_onefile.c testdata/sqlite-src-3330000/src/test_osinst.c testdata/sqlite-src-3330000/src/test_pcache.c testdata/sqlite-src-3330000/src/test_quota.c testdata/sqlite-src-3330000/src/test_rtree.c testdata/sqlite-src-3330000/src/test_schema.c testdata/sqlite-src-3330000/src/test_server.c testdata/sqlite-src-3330000/src/test_superlock.c testdata/sqlite-src-3330000/src/test_syscall.c testdata/sqlite-src-3330000/src/test_tclsh.c testdata/sqlite-src-3330000/src/test_tclvar.c testdata/sqlite-src-3330000/src/test_thread.c testdata/sqlite-src-3330000/src/test_vdbecov.c testdata/sqlite-src-3330000/src/test_vfs.c testdata/sqlite-src-3330000/src/test_windirent.c testdata/sqlite-src-3330000/src/test_window.c testdata/sqlite-src-3330000/src/test_wsd.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.
-package testfixture
+package main
import (
"math"
"reflect"
"unsafe"
- "modernc.org/crt/v3"
- "modernc.org/sqlite/internal/crt2"
+ "modernc.org/libc"
+ "modernc.org/sqlite/internal/libc2"
"modernc.org/sqlite/lib"
"modernc.org/tcl/lib"
)
@@ -17,6 +17,8 @@ var _ = math.Pi
var _ reflect.Kind
var _ unsafe.Pointer
+func main() { libc.Start(main1) }
+
const (
BUFSIZ = 8192
EOF = -1
@@ -168,7 +170,6 @@ const (
SQLITE_DBSTATUS_STMT_USED = 3
SQLITE_DEFAULT_MEMSTATUS = 0
SQLITE_DEFAULT_PAGE_SIZE = 1024
- SQLITE_DEFAULT_WAL_SYNCHRONOUS = 1
SQLITE_DELETE = 9
SQLITE_DENY = 1
SQLITE_DEPRECATED = 0
@@ -179,7 +180,6 @@ const (
SQLITE_DETERMINISTIC = 0x000000800
SQLITE_DIRECTONLY = 0x000080000
SQLITE_DONE = 101
- SQLITE_DQS = 0
SQLITE_DROP_INDEX = 10
SQLITE_DROP_TABLE = 11
SQLITE_DROP_TEMP_INDEX = 12
@@ -191,8 +191,21 @@ const (
SQLITE_DROP_VTABLE = 30
SQLITE_EMPTY = 16
SQLITE_ENABLE_BYTECODE_VTAB = 1
+ SQLITE_ENABLE_COLUMN_METADATA = 1
SQLITE_ENABLE_DBPAGE_VTAB = 1
+ SQLITE_ENABLE_DBSTAT_VTAB = 1
SQLITE_ENABLE_DESERIALIZE = 1
+ SQLITE_ENABLE_EXPLAIN_COMMENTS = 1
+ SQLITE_ENABLE_FTS5 = 1
+ SQLITE_ENABLE_GEOPOLY = 1
+ SQLITE_ENABLE_JSON1 = 1
+ SQLITE_ENABLE_MEMORY_MANAGEMENT = 1
+ SQLITE_ENABLE_OFFSET_SQL_FUNC = 1
+ SQLITE_ENABLE_PREUPDATE_HOOK = 1
+ SQLITE_ENABLE_RBU = 1
+ SQLITE_ENABLE_RTREE = 1
+ SQLITE_ENABLE_SNAPSHOT = 1
+ SQLITE_ENABLE_STAT4 = 1
SQLITE_ENABLE_STMTVTAB = 1
SQLITE_ENABLE_UNLOCK_NOTIFY = 1
SQLITE_ERROR = 1
@@ -337,8 +350,6 @@ const (
SQLITE_LOCK_PENDING = 3
SQLITE_LOCK_RESERVED = 2
SQLITE_LOCK_SHARED = 1
- SQLITE_MAX_EXPR_DEPTH = 0
- SQLITE_MAX_MMAP_SIZE = 8589934592
SQLITE_MISMATCH = 20
SQLITE_MISUSE = 21
SQLITE_MUTEX_APPDEF = 1
@@ -350,6 +361,7 @@ const (
SQLITE_MUTEX_STATIC_APP3 = 10
SQLITE_MUTEX_STATIC_LRU = 6
SQLITE_MUTEX_STATIC_LRU2 = 7
+ SQLITE_MUTEX_STATIC_MAIN = 2
SQLITE_MUTEX_STATIC_MASTER = 2
SQLITE_MUTEX_STATIC_MEM = 3
SQLITE_MUTEX_STATIC_MEM2 = 4
@@ -366,7 +378,6 @@ const (
SQLITE_NOTICE = 27
SQLITE_NOTICE_RECOVER_ROLLBACK = 539
SQLITE_NOTICE_RECOVER_WAL = 283
- SQLITE_NO_SYNC = 1
SQLITE_NULL = 5
SQLITE_OK = 0
SQLITE_OK_LOAD_PERMANENTLY = 256
@@ -388,6 +399,7 @@ const (
SQLITE_OPEN_READWRITE = 0x00000002
SQLITE_OPEN_SHAREDCACHE = 0x00020000
SQLITE_OPEN_SUBJOURNAL = 0x00002000
+ SQLITE_OPEN_SUPER_JOURNAL = 0x00004000
SQLITE_OPEN_TEMP_DB = 0x00000200
SQLITE_OPEN_TEMP_JOURNAL = 0x00001000
SQLITE_OPEN_TRANSIENT_DB = 0x00000400
@@ -432,7 +444,8 @@ const (
SQLITE_SHM_NLOCK = 8
SQLITE_SHM_SHARED = 4
SQLITE_SHM_UNLOCK = 1
- SQLITE_SOURCE_ID = "2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd"
+ SQLITE_SOUNDEX = 1
+ SQLITE_SOURCE_ID = "2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f"
SQLITE_STATUS_MALLOC_COUNT = 9
SQLITE_STATUS_MALLOC_SIZE = 5
SQLITE_STATUS_MEMORY_USED = 0
@@ -501,8 +514,8 @@ const (
SQLITE_UTF16LE = 2
SQLITE_UTF16_ALIGNED = 8
SQLITE_UTF8 = 1
- SQLITE_VERSION = "3.32.3"
- SQLITE_VERSION_NUMBER = 3032003
+ SQLITE_VERSION = "3.33.0"
+ SQLITE_VERSION_NUMBER = 3033000
SQLITE_VTAB_CONSTRAINT_SUPPORT = 1
SQLITE_VTAB_DIRECTONLY = 3
SQLITE_VTAB_INNOCUOUS = 2
@@ -526,6 +539,7 @@ const (
X_FEATURES_H = 1
X_FTS5_H = 0
X_GCC_SIZE_T = 0
+ X_HAVE_SQLITE_CONFIG_H = 1
X_IOFBF = 0
X_IOLBF = 1
X_IONBF = 2
@@ -801,8 +815,8 @@ const (
TTY_NAME_MAX = 32
UCHAR_MAX = 255
UINT_MAX = 4294967295
- ULLONG_MAX = -1
- ULONG_MAX = -1
+ ULLONG_MAX = 18446744073709551615
+ ULONG_MAX = 18446744073709551615
USHRT_MAX = 65535
XATTR_LIST_MAX = 65536
XATTR_NAME_MAX = 255
@@ -860,6 +874,8 @@ const (
X_TCL = 0
X_TCLDECLS = 0
X_TCLPLATDECLS = 0
+ X_FTSINT_H = 0
+ FTS3_TOK_SCHEMA = "CREATE TABLE x(input HIDDEN, token, start, end, position)"
AMATCH_COL_COMMAND = 3
AMATCH_COL_DISTANCE = 1
AMATCH_COL_LANGUAGE = 2
@@ -1374,6 +1390,7 @@ const (
TK_STAR = 3
TK_STRING = 2
TK_VARIABLE = 2
+ Deliberate_fall_through = 0
RE_EOF = 0
RE_OP_ACCEPT = 6
RE_OP_ANY = 2
@@ -1516,6 +1533,12 @@ const (
X_T_PTRDIFF = 0
X_T_PTRDIFF_ = 0
Z_const = 0
+ SQLITE_RBU_STATE_CHECKPOINT = 3
+ SQLITE_RBU_STATE_DONE = 4
+ SQLITE_RBU_STATE_ERROR = 5
+ SQLITE_RBU_STATE_MOVE = 2
+ SQLITE_RBU_STATE_OAL = 1
+ X_SQLITE3RBU_H = 0
FP_XSTATE_MAGIC1 = 0x46505853
FP_XSTATE_MAGIC2 = 0x46505845
MAX_PREPARED_STMTS = 100
@@ -1588,7 +1611,8 @@ const (
X_NSIG = 65
X_SIGNAL_H = 0
X_SYS_UCONTEXT_H = 1
- AggInfoMagic = 0x2059e99e
+ ALT_SCHEMA_TABLE = "sqlite_schema"
+ ALT_TEMP_SCHEMA_TABLE = "sqlite_temp_schema"
BTREE_APPEND = 0x08
BTREE_APPLICATION_ID = 8
BTREE_AUTOVACUUM_FULL = 1
@@ -1631,7 +1655,7 @@ const (
COLNAME_COLUMN = 4
COLNAME_DATABASE = 2
COLNAME_DECLTYPE = 1
- COLNAME_N = 2
+ COLNAME_N = 5
COLNAME_NAME = 0
COLNAME_TABLE = 3
CURTYPE_BTREE = 0
@@ -1648,6 +1672,8 @@ const (
DB_ResetWanted = 0x0008
DB_SchemaLoaded = 0x0001
DB_UnresetViews = 0x0002
+ DFLT_SCHEMA_TABLE = "sqlite_master"
+ DFLT_TEMP_SCHEMA_TABLE = "sqlite_temp_master"
ENAME_NAME = 0
ENAME_SPAN = 1
ENAME_TAB = 2
@@ -1687,9 +1713,41 @@ const (
EXCLUSIVE_LOCK = 4
EXPRDUP_REDUCE = 0x0001
GCC_VERSION = 0
+ HAVE_DLFCN_H = 1
HAVE_FCHOWN = 1
+ HAVE_FDATASYNC = 1
+ HAVE_GMTIME_R = 1
+ HAVE_INT16_T = 1
+ HAVE_INT32_T = 1
+ HAVE_INT64_T = 1
+ HAVE_INT8_T = 1
+ HAVE_INTPTR_T = 1
+ HAVE_INTTYPES_H = 1
+ HAVE_ISNAN = 1
+ HAVE_LOCALTIME_R = 1
HAVE_LSTAT = 1
+ HAVE_MALLOC_H = 1
+ HAVE_MALLOC_USABLE_SIZE = 1
+ HAVE_MEMORY_H = 1
+ HAVE_PREAD = 1
+ HAVE_PREAD64 = 1
+ HAVE_PWRITE = 1
+ HAVE_PWRITE64 = 1
HAVE_READLINK = 1
+ HAVE_STDINT_H = 1
+ HAVE_STDLIB_H = 1
+ HAVE_STRCHRNUL = 1
+ HAVE_STRINGS_H = 1
+ HAVE_STRING_H = 1
+ HAVE_SYS_STAT_H = 1
+ HAVE_SYS_TYPES_H = 1
+ HAVE_UINT16_T = 1
+ HAVE_UINT32_T = 1
+ HAVE_UINT64_T = 1
+ HAVE_UINT8_T = 1
+ HAVE_UINTPTR_T = 1
+ HAVE_UNISTD_H = 1
+ HAVE_UTIME = 1
INITFLAG_AlterTable = 0x0001
INLINEFUNC_affinity = 4
INLINEFUNC_coalesce = 0
@@ -1698,6 +1756,34 @@ const (
INLINEFUNC_iif = 5
INLINEFUNC_implies_nonnull_row = 1
INLINEFUNC_unlikely = 99
+ INT16_MAX = 32767
+ INT16_MIN = -32768
+ INT32_MAX = 2147483647
+ INT32_MIN = -2147483648
+ INT64_MAX = 9223372036854775807
+ INT64_MIN = -9223372036854775808
+ INT8_MAX = 127
+ INT8_MIN = -128
+ INTMAX_MAX = 9223372036854775807
+ INTMAX_MIN = -9223372036854775808
+ INTPTR_MAX = 9223372036854775807
+ INTPTR_MIN = -9223372036854775808
+ INT_FAST16_MAX = 9223372036854775807
+ INT_FAST16_MIN = -9223372036854775808
+ INT_FAST32_MAX = 9223372036854775807
+ INT_FAST32_MIN = -9223372036854775808
+ INT_FAST64_MAX = 9223372036854775807
+ INT_FAST64_MIN = -9223372036854775808
+ INT_FAST8_MAX = 127
+ INT_FAST8_MIN = -128
+ INT_LEAST16_MAX = 32767
+ INT_LEAST16_MIN = -32768
+ INT_LEAST32_MAX = 2147483647
+ INT_LEAST32_MIN = -2147483648
+ INT_LEAST64_MAX = 9223372036854775807
+ INT_LEAST64_MIN = -9223372036854775808
+ INT_LEAST8_MAX = 127
+ INT_LEAST8_MIN = -128
IN_INDEX_EPH = 2
IN_INDEX_INDEX_ASC = 3
IN_INDEX_INDEX_DESC = 4
@@ -1706,7 +1792,6 @@ const (
IN_INDEX_NOOP = 5
IN_INDEX_NOOP_OK = 0x0001
IN_INDEX_ROWID = 1
- IOV_MAX = 1024
JT_CROSS = 0x0002
JT_ERROR = 0x0040
JT_INNER = 0x0001
@@ -1718,14 +1803,12 @@ const (
KEYINFO_ORDER_DESC = 0x01
LOCATE_NOERR = 0x02
LOCATE_VIEW = 0x01
- LONG_BIT = 64
LOOKASIDE_SMALL = 128
- MASTER_NAME = "sqlite_master"
- MASTER_ROOT = 1
+ LT_OBJDIR = ".libs/"
MEMTYPE_HEAP = 0x01
MEMTYPE_LOOKASIDE = 0x02
MEMTYPE_PCACHE = 0x04
- MEM_AffMask = 0x003
+ MEM_AffMask = 0x003f
MEM_Agg = 0x2000
MEM_Blob = 0x0010
MEM_Cleared = 0x0100
@@ -1740,7 +1823,7 @@ const (
MEM_Str = 0x0002
MEM_Subtype = 0x8000
MEM_Term = 0x0200
- MEM_TypeMask = 0xc1b
+ MEM_TypeMask = 0xc1bf
MEM_Undefined = 0x0080
MEM_Zero = 0x4000
MSVC_VERSION = 0
@@ -1762,14 +1845,7 @@ const (
NC_UEList = 0x00080
NC_UUpsert = 0x00200
NC_VarSelect = 0x00040
- NL_ARGMAX = 4096
- NL_LANGMAX = 2048
- NL_MSGMAX = 2147483647
- NL_NMAX = 2147483647
- NL_SETMAX = 2147483647
- NL_TEXTMAX = 2147483647
NO_LOCK = 0
- NZERO = 20
OE_Abort = 2
OE_Cascade = 10
OE_Default = 11
@@ -2011,6 +2087,10 @@ const (
P5_ConstraintFK = 4
P5_ConstraintNotNull = 1
P5_ConstraintUnique = 2
+ PACKAGE_BUGREPORT = ""
+ PACKAGE_NAME = "sqlite"
+ PACKAGE_STRING = "sqlite 3.33.0"
+ PACKAGE_TARNAME = "sqlite"
PAGER_CACHESPILL = 0x20
PAGER_CKPT_FULLFSYNC = 0x10
PAGER_FLAGS_MASK = 0x38
@@ -2048,14 +2128,94 @@ const (
PGHDR_WRITEABLE = 0x004
PRIO_MAX = 20
PRIO_MIN = -20
+ PRIX16 = "X"
+ PRIX32 = "X"
+ PRIX8 = "X"
+ PRIXFAST8 = "X"
+ PRIXLEAST16 = "X"
+ PRIXLEAST32 = "X"
+ PRIXLEAST8 = "X"
+ PRId16 = "d"
+ PRId32 = "d"
+ PRId8 = "d"
+ PRIdFAST8 = "d"
+ PRIdLEAST16 = "d"
+ PRIdLEAST32 = "d"
+ PRIdLEAST8 = "d"
+ PRIi16 = "i"
+ PRIi32 = "i"
+ PRIi8 = "i"
+ PRIiFAST8 = "i"
+ PRIiLEAST16 = "i"
+ PRIiLEAST32 = "i"
+ PRIiLEAST8 = "i"
+ PRIo16 = "o"
+ PRIo32 = "o"
+ PRIo8 = "o"
+ PRIoFAST8 = "o"
+ PRIoLEAST16 = "o"
+ PRIoLEAST32 = "o"
+ PRIoLEAST8 = "o"
+ PRIu16 = "u"
+ PRIu32 = "u"
+ PRIu8 = "u"
+ PRIuFAST8 = "u"
+ PRIuLEAST16 = "u"
+ PRIuLEAST32 = "u"
+ PRIuLEAST8 = "u"
+ PRIx16 = "x"
+ PRIx32 = "x"
+ PRIx8 = "x"
+ PRIxFAST8 = "x"
+ PRIxLEAST16 = "x"
+ PRIxLEAST32 = "x"
+ PRIxLEAST8 = "x"
+ PTRDIFF_MAX = 9223372036854775807
+ PTRDIFF_MIN = -9223372036854775808
RESERVED_LOCK = 2
- RLIM64_INFINITY = -1
- RLIM_INFINITY = -1
- RLIM_SAVED_CUR = -1
- RLIM_SAVED_MAX = -1
+ RLIM64_INFINITY = 0xffffffffffffffff
+ RLIM_INFINITY = 0xffffffffffffffff
+ RLIM_SAVED_CUR = 18446744073709551615
+ RLIM_SAVED_MAX = 18446744073709551615
SAVEPOINT_BEGIN = 0
SAVEPOINT_RELEASE = 1
SAVEPOINT_ROLLBACK = 2
+ SCHEMA_ROOT = 1
+ SCNd16 = "hd"
+ SCNd32 = "d"
+ SCNd8 = "hhd"
+ SCNdFAST8 = "hhd"
+ SCNdLEAST16 = "hd"
+ SCNdLEAST32 = "d"
+ SCNdLEAST8 = "hhd"
+ SCNi16 = "hi"
+ SCNi32 = "i"
+ SCNi8 = "hhi"
+ SCNiFAST8 = "hhi"
+ SCNiLEAST16 = "hi"
+ SCNiLEAST32 = "i"
+ SCNiLEAST8 = "hhi"
+ SCNo16 = "ho"
+ SCNo32 = "o"
+ SCNo8 = "hho"
+ SCNoFAST8 = "hho"
+ SCNoLEAST16 = "ho"
+ SCNoLEAST32 = "o"
+ SCNoLEAST8 = "hho"
+ SCNu16 = "hu"
+ SCNu32 = "u"
+ SCNu8 = "hhu"
+ SCNuFAST8 = "hhu"
+ SCNuLEAST16 = "hu"
+ SCNuLEAST32 = "u"
+ SCNuLEAST8 = "hhu"
+ SCNx16 = "hx"
+ SCNx32 = "x"
+ SCNx8 = "hhx"
+ SCNxFAST8 = "hhx"
+ SCNxLEAST16 = "hx"
+ SCNxLEAST32 = "x"
+ SCNxLEAST8 = "hhx"
SELECTTRACE_ENABLED = 0
SF_Aggregate = 0x0000008
SF_All = 0x0000002
@@ -2075,6 +2235,7 @@ const (
SF_NoopOrderBy = 0x0400000
SF_Recursive = 0x0002000
SF_Resolved = 0x0000004
+ SF_UpdateFrom = 0x0800000
SF_UsesEphemeral = 0x0000020
SF_Values = 0x0000200
SF_View = 0x0200000
@@ -2082,6 +2243,10 @@ const (
SF_WinRewrite = 0x0100000
SHARED_LOCK = 1
SHARED_SIZE = 510
+ SIG_ATOMIC_MAX = 2147483647
+ SIG_ATOMIC_MIN = -2147483648
+ SIZE_MAX = 18446744073709551615
+ SQLITECONFIG_H = 1
SQLITEINT_H = 0
SQLITE_AFF_BLOB = 0x41
SQLITE_AFF_INTEGER = 0x44
@@ -2091,7 +2256,7 @@ const (
SQLITE_AFF_REAL = 0x45
SQLITE_AFF_TEXT = 0x42
SQLITE_ASCII = 1
- SQLITE_AllOpts = 65535
+ SQLITE_AllOpts = 0xffff
SQLITE_AutoIndex = 0x00008000
SQLITE_BIGENDIAN = 0
SQLITE_BIG_DBL = 0
@@ -2111,9 +2276,10 @@ const (
SQLITE_DEFAULT_PCACHE_INITSZ = 20
SQLITE_DEFAULT_RECURSIVE_TRIGGERS = 0
SQLITE_DEFAULT_SECTOR_SIZE = 4096
- SQLITE_DEFAULT_SORTERREF_SIZE = 0x7
+ SQLITE_DEFAULT_SORTERREF_SIZE = 0x7fffffff
SQLITE_DEFAULT_SYNCHRONOUS = 2
SQLITE_DEFAULT_WAL_AUTOCHECKPOINT = 1000
+ SQLITE_DEFAULT_WAL_SYNCHRONOUS = 2
SQLITE_DEFAULT_WORKER_THREADS = 0
SQLITE_Defensive = 0x10000000
SQLITE_DeferFKs = 0x00080000
@@ -2179,16 +2345,18 @@ const (
SQLITE_MAGIC_ERROR = 0xb5357930
SQLITE_MAGIC_OPEN = 0xa029a697
SQLITE_MAGIC_SICK = 0x4b771290
- SQLITE_MAGIC_ZOMBIE = 0x64cffc7
+ SQLITE_MAGIC_ZOMBIE = 0x64cffc7f
SQLITE_MALLOC_SOFT_LIMIT = 1024
SQLITE_MAX_ATTACHED = 10
SQLITE_MAX_COLUMN = 2000
SQLITE_MAX_COMPOUND_SELECT = 500
SQLITE_MAX_DEFAULT_PAGE_SIZE = 8192
+ SQLITE_MAX_EXPR_DEPTH = 1000
SQLITE_MAX_FILE_FORMAT = 4
SQLITE_MAX_FUNCTION_ARG = 127
SQLITE_MAX_LENGTH = 1000000000
SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000
+ SQLITE_MAX_MMAP_SIZE = 0x7fff0000
SQLITE_MAX_PAGE_COUNT = 1073741823
SQLITE_MAX_PAGE_SIZE = 65536
SQLITE_MAX_SCHEMA_RETRY = 50
@@ -2215,7 +2383,7 @@ const (
SQLITE_OrderByIdxJoin = 0x0040
SQLITE_PAGER_H = 0
SQLITE_POWERSAFE_OVERWRITE = 1
- SQLITE_PREPARE_MASK = 0x0
+ SQLITE_PREPARE_MASK = 0x0f
SQLITE_PREPARE_SAVESQL = 0x80
SQLITE_PRINTF_INTERNAL = 0x01
SQLITE_PRINTF_MALLOCED = 0x04
@@ -2242,7 +2410,7 @@ const (
SQLITE_TOKEN_KEYWORD = 0x2
SQLITE_TOKEN_QUOTED = 0x1
SQLITE_TRACE_LEGACY = 0x40
- SQLITE_TRACE_NONLEGACY_MASK = 0x0
+ SQLITE_TRACE_NONLEGACY_MASK = 0x0f
SQLITE_TRACE_XPROFILE = 0x80
SQLITE_Transitive = 0x0080
SQLITE_TriggerEQP = 0x01000000
@@ -2270,7 +2438,8 @@ const (
SRT_Set = 11
SRT_Table = 14
SRT_Union = 1
- TEMP_MASTER_NAME = "sqlite_temp_master"
+ SRT_Upfrom = 15
+ STDC_HEADERS = 1
TF_Autoincrement = 0x0008
TF_Ephemeral = 0x0002
TF_HasGenerated = 0x0060
@@ -2437,12 +2606,28 @@ const (
TK_WITHOUT = 25
TRIGGER_AFTER = 2
TRIGGER_BEFORE = 1
+ UINT16_MAX = 65535
+ UINT32_MAX = 4294967295
+ UINT64_MAX = 18446744073709551615
+ UINT8_MAX = 255
+ UINTMAX_MAX = 18446744073709551615
+ UINTPTR_MAX = 18446744073709551615
+ UINT_FAST16_MAX = 18446744073709551615
+ UINT_FAST32_MAX = 18446744073709551615
+ UINT_FAST64_MAX = 18446744073709551615
+ UINT_FAST8_MAX = 255
+ UINT_LEAST16_MAX = 65535
+ UINT_LEAST32_MAX = 4294967295
+ UINT_LEAST64_MAX = 18446744073709551615
+ UINT_LEAST8_MAX = 255
VDBE_DISPLAY_P4 = 1
VDBE_MAGIC_DEAD = 0x5606c3c8
VDBE_MAGIC_HALT = 0x319c2973
VDBE_MAGIC_INIT = 0x16bceaa5
VDBE_MAGIC_RESET = 0x48fa9f76
VDBE_MAGIC_RUN = 0x2df20da3
+ WCHAR_MAX = 2147483647
+ WCHAR_MIN = -2147483648
WHERE_DISTINCTBY = 0x0080
WHERE_DISTINCT_NOOP = 0
WHERE_DISTINCT_ORDERED = 2
@@ -2462,19 +2647,23 @@ const (
WHERE_SORTBYGROUP = 0x0200
WHERE_USE_LIMIT = 0x4000
WHERE_WANT_DISTINCT = 0x0100
- WORD_BIT = 32
+ WINT_MAX = 4294967295
+ WINT_MIN = 0
WRC_Abort = 2
WRC_Continue = 0
WRC_Prune = 1
XN_EXPR = -2
XN_ROWID = -1
- X_BITS_UIO_LIM_H = 1
+ X_BITS_STDINT_UINTN_H = 1
+ X_BITS_WCHAR_H = 1
X_FILE_OFFSET_BITS = 64
+ X_GCC_WRAP_STDINT_H = 0
+ X_INTTYPES_H = 1
X_LARGEFILE_SOURCE = 1
X_LARGE_FILE = 1
X_SQLITE_OS_H_ = 0
+ X_STDINT_H = 1
X_SYS_RESOURCE_H = 1
- X_XOPEN_LIM_H = 1
X_XOPEN_SOURCE = 600
BTCF_AtLast = 0x08
BTCF_Incrblob = 0x10
@@ -2608,9 +2797,46 @@ const (
MSG_Prepare = 2
MSG_Reset = 4
MSG_Step = 3
+ MADV_DODUMP = 17
+ MADV_DOFORK = 11
+ MADV_DONTDUMP = 16
+ MADV_DONTFORK = 10
+ MADV_DONTNEED = 4
+ MADV_FREE = 8
+ MADV_HUGEPAGE = 14
+ MADV_HWPOISON = 100
+ MADV_KEEPONFORK = 19
+ MADV_MERGEABLE = 12
+ MADV_NOHUGEPAGE = 15
+ MADV_NORMAL = 0
+ MADV_RANDOM = 1
+ MADV_REMOVE = 9
+ MADV_SEQUENTIAL = 2
+ MADV_UNMERGEABLE = 13
+ MADV_WILLNEED = 3
+ MADV_WIPEONFORK = 18
+ MAP_32BIT = 0x40
+ MAP_ANON = 32
+ MAP_ANONYMOUS = 0x20
+ MAP_DENYWRITE = 0x00800
+ MAP_EXECUTABLE = 0x01000
+ MAP_FILE = 0
MAP_FIXED = 0x10
+ MAP_FIXED_NOREPLACE = 0x100000
+ MAP_GROWSDOWN = 0x00100
+ MAP_HUGETLB = 0x40000
+ MAP_HUGE_MASK = 0x3f
+ MAP_HUGE_SHIFT = 26
+ MAP_LOCKED = 0x02000
+ MAP_NONBLOCK = 0x10000
+ MAP_NORESERVE = 0x04000
+ MAP_POPULATE = 0x08000
MAP_PRIVATE = 0x02
MAP_SHARED = 0x01
+ MAP_SHARED_VALIDATE = 0x03
+ MAP_STACK = 0x20000
+ MAP_SYNC = 0x80000
+ MAP_TYPE = 0x0f
MCL_CURRENT = 1
MCL_FUTURE = 2
MCL_ONFAULT = 4
@@ -2638,7 +2864,7 @@ const (
FAULT_INJECT_PERSISTENT = 2
FAULT_INJECT_TRANSIENT = 1
TESTVFS_ACCESS_MASK = 0x00004000
- TESTVFS_ALL_MASK = 0x001
+ TESTVFS_ALL_MASK = 0x001FFFFF
TESTVFS_CKLOCK_MASK = 0x00080000
TESTVFS_CLOSE_MASK = 0x00000800
TESTVFS_DELETE_MASK = 0x00000400
@@ -2660,6 +2886,24 @@ const (
TESTVFS_WRITE_MASK = 0x00001000
)
+// Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface.
+// Copyright (C) 1996-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
// Copyright (C) 1991-2018 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
@@ -3304,6 +3548,9 @@ const ( /* resource.h:187:1: */
PRIO_USER = 2
)
+// Convenience macros for operations on timevals.
+// NOTE: `timercmp' does not work for >= or <=.
+
// Copyright (C) 1992-2018 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
@@ -3716,11 +3963,11 @@ type sqlite32 = struct {
Fmutex uintptr
FaDb uintptr
FnDb int32
- FmDbFlags u321
+ FmDbFlags u322
Fflags u64
FlastRowid i64
FszMmap i64
- FnSchemaLock u321
+ FnSchemaLock u322
FopenFlags uint32
FerrCode int32
FerrMask int32
@@ -3740,44 +3987,47 @@ type sqlite32 = struct {
FnoSharedCache u8
FnSqlExec u8
FnextPagesize int32
- Fmagic u321
+ Fmagic u322
FnChange int32
FnTotalChange int32
FaLimit [12]int32
FnMaxSorterMmap int32
Finit struct {
- FnewTnum int32
+ FnewTnum Pgno
FiDb u8
Fbusy u8
_ [2]byte
ForphanTrigger uint8 /* unsigned orphanTrigger: 1, unsigned imposterTable: 1, unsigned reopenMemdb: 1 */
FazInit uintptr
}
- FnVdbeActive int32
- FnVdbeRead int32
- FnVdbeWrite int32
- FnVdbeExec int32
- FnVDestroy int32
- FnExtension int32
- FaExtension uintptr
- FxTrace uintptr
- FpTraceArg uintptr
- FxProfile uintptr
- FpProfileArg uintptr
- FpCommitArg uintptr
- FxCommitCallback uintptr
- FpRollbackArg uintptr
- FxRollbackCallback uintptr
- FpUpdateArg uintptr
- FxUpdateCallback uintptr
- FpParse uintptr
- FxWalCallback uintptr
- FpWalArg uintptr
- FxCollNeeded uintptr
- FxCollNeeded16 uintptr
- FpCollNeededArg uintptr
- FpErr uintptr
- Fu1 struct {
+ FnVdbeActive int32
+ FnVdbeRead int32
+ FnVdbeWrite int32
+ FnVdbeExec int32
+ FnVDestroy int32
+ FnExtension int32
+ FaExtension uintptr
+ Ftrace struct{ FxLegacy uintptr }
+ FpTraceArg uintptr
+ FxProfile uintptr
+ FpProfileArg uintptr
+ FpCommitArg uintptr
+ FxCommitCallback uintptr
+ FpRollbackArg uintptr
+ FxRollbackCallback uintptr
+ FpUpdateArg uintptr
+ FxUpdateCallback uintptr
+ FpParse uintptr
+ FpPreUpdateArg uintptr
+ FxPreUpdateCallback uintptr
+ FpPreUpdate uintptr
+ FxWalCallback uintptr
+ FpWalArg uintptr
+ FxCollNeeded uintptr
+ FxCollNeeded16 uintptr
+ FpCollNeededArg uintptr
+ FpErr uintptr
+ Fu1 struct {
_ [0]uint64
FisInterrupted int32
_ [4]byte
@@ -3871,6 +4121,7 @@ type sqlite3_callback = uintptr /* sqlite3.h:338:13 */
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
// Reserved: 0x00F00000
+// Legacy compatibility:
// CAPI3REF: Device Characteristics
//
@@ -3981,6 +4232,7 @@ type sqlite3_file1 = struct{ FpMethods uintptr }
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
// Reserved: 0x00F00000
+// Legacy compatibility:
// CAPI3REF: Device Characteristics
//
@@ -4054,7 +4306,7 @@ type sqlite3_file1 = struct{ FpMethods uintptr }
// for their own use. The pMethods entry is a pointer to an
// [sqlite3_io_methods] object that defines methods for performing
// I/O operations on the open file.
-type sqlite3_file = sqlite3_file1 /* sqlite3.h:680:29 */
+type sqlite3_file = sqlite3_file1 /* sqlite3.h:683:29 */
type sqlite3_io_methods1 = struct {
FiVersion int32
FxClose uintptr
@@ -4169,7 +4421,7 @@ type sqlite3_io_methods1 = struct {
// fails to zero-fill short reads might seem to work. However,
// failure to zero-fill short reads will eventually lead to
// database corruption.
-type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:779:35 */
+type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:782:35 */
// CAPI3REF: Standard File Control Opcodes
// KEYWORDS: {file control opcodes} {file control opcode}
@@ -4237,7 +4489,7 @@ type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:779:35 */
// of the xSync method. In most cases, the pointer argument passed with
// this file-control is NULL. However, if the database file is being synced
// as part of a multi-database commit, the argument points to a nul-terminated
-// string containing the transactions master-journal file name. VFSes that
+// string containing the transactions super-journal file name. VFSes that
// do not need this signal should silently ignore this opcode. Applications
// should not call [sqlite3_file_control()] with this opcode as doing so may
// disrupt the operation of the specialized VFSes that do require it.
@@ -4843,7 +5095,7 @@ type sqlite3_api_routines1 = struct {
// <li> [SQLITE_OPEN_TEMP_JOURNAL]
// <li> [SQLITE_OPEN_TRANSIENT_DB]
// <li> [SQLITE_OPEN_SUBJOURNAL]
-// <li> [SQLITE_OPEN_MASTER_JOURNAL]
+// <li> [SQLITE_OPEN_SUPER_JOURNAL]
// <li> [SQLITE_OPEN_WAL]
// </ul>)^
//
@@ -5035,7 +5287,7 @@ type sqlite3_vfs1 = struct {
// <li> [SQLITE_OPEN_TEMP_JOURNAL]
// <li> [SQLITE_OPEN_TRANSIENT_DB]
// <li> [SQLITE_OPEN_SUBJOURNAL]
-// <li> [SQLITE_OPEN_MASTER_JOURNAL]
+// <li> [SQLITE_OPEN_SUPER_JOURNAL]
// <li> [SQLITE_OPEN_WAL]
// </ul>)^
//
@@ -5128,8 +5380,8 @@ type sqlite3_vfs1 = struct {
// or all of these interfaces to be NULL or for their behavior to change
// from one release to the next. Applications must not attempt to access
// any of these methods if the iVersion of the VFS is less than 3.
-type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1364:28 */
-type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1365:14 */
+type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1367:28 */
+type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1368:14 */
// CAPI3REF: Memory Allocation Routines
//
@@ -5179,7 +5431,7 @@ type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1365:14 */
// by xInit. The pAppData pointer is used as the only parameter to
// xInit and xShutdown.
//
-// SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
+// SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
// the xInit method, so the xInit method need not be threadsafe. The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either. For all other methods, SQLite
@@ -5251,7 +5503,7 @@ type sqlite3_mem_methods1 = struct {
// by xInit. The pAppData pointer is used as the only parameter to
// xInit and xShutdown.
//
-// SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
+// SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
// the xInit method, so the xInit method need not be threadsafe. The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either. For all other methods, SQLite
@@ -5264,7 +5516,7 @@ type sqlite3_mem_methods1 = struct {
//
// SQLite will never invoke xInit() more than once without an intervening
// call to xShutdown().
-type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1662:36 */
+type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1665:36 */
// CAPI3REF: Dynamically Typed Value Object
// KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
@@ -5313,7 +5565,7 @@ type sqlite3_value1 = struct {
Fz uintptr
FzMalloc uintptr
FszMalloc int32
- FuTemp u321
+ FuTemp u322
Fdb uintptr
FxDel uintptr
}
@@ -5352,7 +5604,7 @@ type sqlite3_context1 = struct {
//
// The typedef is necessary to work around problems in certain
// C++ compilers.
-type sqlite3_destructor_type = uintptr /* sqlite3.h:5619:14 */
+type sqlite3_destructor_type = uintptr /* sqlite3.h:5621:14 */
// The interface to the virtual-table mechanism is currently considered
// to be experimental. The interface might change in incompatible ways.
@@ -5376,7 +5628,7 @@ type sqlite3_vtab1 = struct {
// interface fixed, support it indefinitely, and remove this comment.
// Structures used by the virtual table interface
-type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6687:29 */
+type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6689:29 */
type sqlite3_index_info1 = struct {
FnConstraint int32
FaConstraint uintptr
@@ -5393,10 +5645,10 @@ type sqlite3_index_info1 = struct {
FcolUsed sqlite3_uint64
}
-type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6688:35 */
+type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6690:35 */
type sqlite3_vtab_cursor1 = struct{ FpVtab uintptr }
-type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6689:36 */
+type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6691:36 */
type sqlite3_module1 = struct {
FiVersion int32
FxCreate uintptr
@@ -5424,7 +5676,7 @@ type sqlite3_module1 = struct {
FxShadowName uintptr
}
-type sqlite3_module = sqlite3_module1 /* sqlite3.h:6690:31 */
+type sqlite3_module = sqlite3_module1 /* sqlite3.h:6692:31 */
// CAPI3REF: Virtual Table Indexing Information
// KEYWORDS: sqlite3_index_info
@@ -5883,7 +6135,7 @@ type sqlite3_mutex_methods1 = struct {
// called, but only if the prior call to xMutexInit returned SQLITE_OK.
// If xMutexInit fails in any way, it is expected to clean up after itself
// prior to returning.
-type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7522:38 */
+type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7524:38 */
// CAPI3REF: Dynamic String Object
// KEYWORDS: {dynamic string}
@@ -5902,9 +6154,9 @@ type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7522:38 */
type sqlite3_str1 = struct {
Fdb uintptr
FzText uintptr
- FnAlloc u321
- FmxAlloc u321
- FnChar u321
+ FnAlloc u322
+ FmxAlloc u322
+ FnChar u322
FaccError u8
FprintfFlags u8
_ [2]byte
@@ -5931,7 +6183,7 @@ type sqlite3_pcache_page1 = struct {
// of this object as parameters or as their return value.
//
// See [sqlite3_pcache_methods2] for additional information.
-type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8271:36 */
+type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8277:36 */
// CAPI3REF: Application Defined Page Cache.
// KEYWORDS: {page cache}
@@ -6263,7 +6515,7 @@ type sqlite3_pcache_methods21 = struct {
// free up as much of heap memory as possible. The page cache implementation
// is not obligated to free any memory, but well-behaved implementations should
// do their best.
-type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8436:40 */
+type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8442:40 */
// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -6285,7 +6537,7 @@ type sqlite3_pcache_methods1 = struct {
// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
// retained in the header file for backwards compatibility only.
-type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8459:39 */
+type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8465:39 */
// CAPI3REF: Database Snapshot
// KEYWORDS: {snapshot} {sqlite3_snapshot}
@@ -6325,7 +6577,7 @@ type sqlite3_snapshot1 = struct{ Fhidden [48]uint8 }
// version of the database file so that it is possible to later open a new read
// transaction that sees that historical version of the database rather than
// the most recent version.
-type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9508:3 */
+type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9514:3 */
// CAPI3REF: Flags for sqlite3_deserialize()
//
@@ -6405,7 +6657,7 @@ type sqlite3_rtree_geometry1 = struct {
//
//
-type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9833:39 */
+type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9839:39 */
type sqlite3_rtree_query_info1 = struct {
FpContext uintptr
FnParam int32
@@ -6425,11 +6677,11 @@ type sqlite3_rtree_query_info1 = struct {
FapSqlParam uintptr
}
-type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9834:41 */
+type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9840:41 */
// The double-precision datatype used by RTree depends on the
// SQLITE_RTREE_INT_ONLY compile-time option.
-type sqlite3_rtree_dbl = float64 /* sqlite3.h:9842:18 */
+type sqlite3_rtree_dbl = float64 /* sqlite3.h:9848:18 */
// Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin.
@@ -6516,22 +6768,22 @@ type Fts5ExtensionApi1 = struct {
// Virtual table implementations may overload SQL functions by implementing
// the sqlite3_module.xFindFunction() method.
-type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11628:33 */
+type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11634:33 */
type Fts5PhraseIter1 = struct {
Fa uintptr
Fb uintptr
}
-type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11630:31 */
+type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11636:31 */
-type fts5_extension_function = uintptr /* sqlite3.h:11632:14 */
+type fts5_extension_function = uintptr /* sqlite3.h:11638:14 */
type fts5_tokenizer1 = struct {
FxCreate uintptr
FxDelete uintptr
FxTokenize uintptr
}
-type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12091:31 */
+type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12097:31 */
// Flags that may be passed as the third argument to xTokenize()
@@ -6564,7 +6816,7 @@ type fts5_api1 = struct {
// ************************************************************************
//
// FTS5 EXTENSION REGISTRATION API
-type fts5_api = fts5_api1 /* sqlite3.h:12127:25 */
+type fts5_api = fts5_api1 /* sqlite3.h:12133:25 */
//
// END OF REGISTRATION API
@@ -6855,12 +7107,12 @@ type IdxHash = IdxHash1 /* sqlite3expert.c:121:24 */
// Allocate and return nByte bytes of zeroed memory using sqlite3_malloc().
// If the allocation fails, set *pRc to SQLITE_NOMEM and return NULL.
-func idxMalloc(tls *crt.TLS, pRc uintptr, nByte int32) uintptr { /* sqlite3expert.c:158:13: */
+func idxMalloc(tls *libc.TLS, pRc uintptr, nByte int32) uintptr { /* sqlite3expert.c:158:13: */
var pRet uintptr
pRet = sqlite3.Xsqlite3_malloc(tls, nByte)
if pRet != 0 {
- crt.Xmemset(tls, pRet, 0, uint64(nByte))
+ libc.Xmemset(tls, pRet, 0, uint64(nByte))
} else {
*(*int32)(unsafe.Pointer(pRc)) = 7
}
@@ -6868,12 +7120,12 @@ func idxMalloc(tls *crt.TLS, pRc uintptr, nByte int32) uintptr { /* sqlite3exper
}
// Initialize an IdxHash hash table.
-func idxHashInit(tls *crt.TLS, pHash uintptr) { /* sqlite3expert.c:174:13: */
- crt.Xmemset(tls, pHash, 0, uint64(unsafe.Sizeof(IdxHash{})))
+func idxHashInit(tls *libc.TLS, pHash uintptr) { /* sqlite3expert.c:174:13: */
+ libc.Xmemset(tls, pHash, 0, uint64(unsafe.Sizeof(IdxHash{})))
}
// Reset an IdxHash hash table.
-func idxHashClear(tls *crt.TLS, pHash uintptr) { /* sqlite3expert.c:181:13: */
+func idxHashClear(tls *libc.TLS, pHash uintptr) { /* sqlite3expert.c:181:13: */
var i int32
for i = 0; i < 1023; i++ {
var pEntry uintptr
@@ -6884,12 +7136,12 @@ func idxHashClear(tls *crt.TLS, pHash uintptr) { /* sqlite3expert.c:181:13: */
sqlite3.Xsqlite3_free(tls, pEntry)
}
}
- crt.Xmemset(tls, pHash, 0, uint64(unsafe.Sizeof(IdxHash{})))
+ libc.Xmemset(tls, pHash, 0, uint64(unsafe.Sizeof(IdxHash{})))
}
// Return the index of the hash bucket that the string specified by the
// arguments to this function belongs.
-func idxHashString(tls *crt.TLS, z uintptr, n int32) int32 { /* sqlite3expert.c:199:12: */
+func idxHashString(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3expert.c:199:12: */
var ret uint32 = uint32(0)
var i int32
for i = 0; i < n; i++ {
@@ -6901,29 +7153,29 @@ func idxHashString(tls *crt.TLS, z uintptr, n int32) int32 { /* sqlite3expert.c:
// If zKey is already present in the hash table, return non-zero and do
// nothing. Otherwise, add an entry with key zKey and payload string zVal to
// the hash table passed as the second argument.
-func idxHashAdd(tls *crt.TLS, pRc uintptr, pHash uintptr, zKey uintptr, zVal uintptr) int32 { /* sqlite3expert.c:213:12: */
- var nKey int32 = int32(crt.Xstrlen(tls, zKey))
+func idxHashAdd(tls *libc.TLS, pRc uintptr, pHash uintptr, zKey uintptr, zVal uintptr) int32 { /* sqlite3expert.c:213:12: */
+ var nKey int32 = int32(libc.Xstrlen(tls, zKey))
var iHash int32 = idxHashString(tls, zKey, nKey)
var nVal int32 = func() int32 {
if zVal != 0 {
- return int32(crt.Xstrlen(tls, zVal))
+ return int32(libc.Xstrlen(tls, zVal))
}
return 0
}()
var pEntry uintptr
for pEntry = *(*uintptr)(unsafe.Pointer((pHash + 8 /* &.aHash */) + uintptr(iHash)*8)); pEntry != 0; pEntry = (*IdxHashEntry)(unsafe.Pointer(pEntry)).FpHashNext {
- if (int32(crt.Xstrlen(tls, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey)) == nKey) && (0 == crt.Xmemcmp(tls, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey, zKey, uint64(nKey))) {
+ if (int32(libc.Xstrlen(tls, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey)) == nKey) && (0 == libc.Xmemcmp(tls, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey, zKey, uint64(nKey))) {
return 1
}
}
pEntry = idxMalloc(tls, pRc, (int32((((uint64(unsafe.Sizeof(IdxHashEntry{})) + uint64(nKey)) + uint64(1)) + uint64(nVal)) + uint64(1))))
if pEntry != 0 {
(*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey = (pEntry + uintptr(1)*40)
- crt.Xmemcpy(tls, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey, zKey, uint64(nKey))
+ libc.Xmemcpy(tls, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey, zKey, uint64(nKey))
if zVal != 0 {
(*IdxHashEntry)(unsafe.Pointer(pEntry)).FzVal = ((*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey + uintptr((nKey + 1)))
- crt.Xmemcpy(tls, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzVal, zVal, uint64(nVal))
+ libc.Xmemcpy(tls, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzVal, zVal, uint64(nVal))
}
(*IdxHashEntry)(unsafe.Pointer(pEntry)).FpHashNext = *(*uintptr)(unsafe.Pointer((pHash + 8 /* &.aHash */) + uintptr(iHash)*8))
*(*uintptr)(unsafe.Pointer((pHash + 8 /* &.aHash */) + uintptr(iHash)*8)) = pEntry
@@ -6936,16 +7188,16 @@ func idxHashAdd(tls *crt.TLS, pRc uintptr, pHash uintptr, zKey uintptr, zVal uin
// If zKey/nKey is present in the hash table, return a pointer to the
// hash-entry object.
-func idxHashFind(tls *crt.TLS, pHash uintptr, zKey uintptr, nKey int32) uintptr { /* sqlite3expert.c:250:21: */
+func idxHashFind(tls *libc.TLS, pHash uintptr, zKey uintptr, nKey int32) uintptr { /* sqlite3expert.c:250:21: */
var iHash int32
var pEntry uintptr
if nKey < 0 {
- nKey = int32(crt.Xstrlen(tls, zKey))
+ nKey = int32(libc.Xstrlen(tls, zKey))
}
iHash = idxHashString(tls, zKey, nKey)
for pEntry = *(*uintptr)(unsafe.Pointer((pHash + 8 /* &.aHash */) + uintptr(iHash)*8)); pEntry != 0; pEntry = (*IdxHashEntry)(unsafe.Pointer(pEntry)).FpHashNext {
- if (int32(crt.Xstrlen(tls, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey)) == nKey) && (0 == crt.Xmemcmp(tls, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey, zKey, uint64(nKey))) {
+ if (int32(libc.Xstrlen(tls, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey)) == nKey) && (0 == libc.Xmemcmp(tls, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey, zKey, uint64(nKey))) {
return pEntry
}
}
@@ -6956,7 +7208,7 @@ func idxHashFind(tls *crt.TLS, pHash uintptr, zKey uintptr, nKey int32) uintptr
// passed as the final two arguments to this function, return a pointer
// to the payload string. Otherwise, if zKey/nKey is not present in the
// hash table, return NULL.
-func idxHashSearch(tls *crt.TLS, pHash uintptr, zKey uintptr, nKey int32) uintptr { /* sqlite3expert.c:270:19: */
+func idxHashSearch(tls *libc.TLS, pHash uintptr, zKey uintptr, nKey int32) uintptr { /* sqlite3expert.c:270:19: */
var pEntry uintptr = idxHashFind(tls, pHash, zKey, nKey)
if pEntry != 0 {
return (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzVal
@@ -6966,29 +7218,29 @@ func idxHashSearch(tls *crt.TLS, pHash uintptr, zKey uintptr, nKey int32) uintpt
// Allocate and return a new IdxConstraint object. Set the IdxConstraint.zColl
// variable to point to a copy of nul-terminated string zColl.
-func idxNewConstraint(tls *crt.TLS, pRc uintptr, zColl uintptr) uintptr { /* sqlite3expert.c:280:22: */
+func idxNewConstraint(tls *libc.TLS, pRc uintptr, zColl uintptr) uintptr { /* sqlite3expert.c:280:22: */
var pNew uintptr
- var nColl int32 = int32(crt.Xstrlen(tls, zColl))
+ var nColl int32 = int32(libc.Xstrlen(tls, zColl))
pNew = idxMalloc(tls, pRc, (int32((uint64(unsafe.Sizeof(IdxConstraint{})) * uint64(nColl)) + uint64(1))))
if pNew != 0 {
(*IdxConstraint)(unsafe.Pointer(pNew)).FzColl = (pNew + uintptr(1)*40)
- crt.Xmemcpy(tls, (*IdxConstraint)(unsafe.Pointer(pNew)).FzColl, zColl, (uint64(nColl + 1)))
+ libc.Xmemcpy(tls, (*IdxConstraint)(unsafe.Pointer(pNew)).FzColl, zColl, (uint64(nColl + 1)))
}
return pNew
}
// An error associated with database handle db has just occurred. Pass
// the error message to callback function xOut.
-func idxDatabaseError(tls *crt.TLS, db uintptr, pzErrmsg uintptr) { /* sqlite3expert.c:297:13: */
+func idxDatabaseError(tls *libc.TLS, db uintptr, pzErrmsg uintptr) { /* sqlite3expert.c:297:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
- *(*uintptr)(unsafe.Pointer(pzErrmsg)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErrmsg)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, db)))
}
// Prepare an SQL statement.
-func idxPrepareStmt(tls *crt.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3expert.c:307:12: */
+func idxPrepareStmt(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3expert.c:307:12: */
var rc int32 = sqlite3.Xsqlite3_prepare_v2(tls, db, zSql, -1, ppStmt, uintptr(0))
if rc != 0 {
*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
@@ -6998,7 +7250,7 @@ func idxPrepareStmt(tls *crt.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr,
}
// Prepare an SQL statement using the results of a printf() formatting.
-func idxPrintfPrepareStmt(tls *crt.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3expert.c:324:12: */
+func idxPrintfPrepareStmt(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3expert.c:324:12: */
var ap va_list
_ = ap
var rc int32
@@ -7036,8 +7288,8 @@ type ExpertCsr1 = struct {
type ExpertCsr = ExpertCsr1 /* sqlite3expert.c:357:26 */
-func expertDequote(tls *crt.TLS, zIn uintptr) uintptr { /* sqlite3expert.c:363:13: */
- var n int32 = int32(crt.Xstrlen(tls, zIn))
+func expertDequote(tls *libc.TLS, zIn uintptr) uintptr { /* sqlite3expert.c:363:13: */
+ var n int32 = int32(libc.Xstrlen(tls, zIn))
var zRet uintptr = sqlite3.Xsqlite3_malloc(tls, n)
if zRet != 0 {
@@ -7048,7 +7300,7 @@ func expertDequote(tls *crt.TLS, zIn uintptr) uintptr { /* sqlite3expert.c:363:1
iIn++
}
- *(*int8)(unsafe.Pointer(zRet + uintptr(crt.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(zIn + uintptr(iIn)))
+ *(*int8)(unsafe.Pointer(zRet + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(zIn + uintptr(iIn)))
}
*(*int8)(unsafe.Pointer(zRet + uintptr(iOut))) = int8(0)
}
@@ -7063,7 +7315,7 @@ func expertDequote(tls *crt.TLS, zIn uintptr) uintptr { /* sqlite3expert.c:363:1
// argv[1] -> database name
// argv[2] -> table name
// argv[...] -> column names...
-func expertConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:395:12: */
+func expertConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:395:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -7095,13 +7347,13 @@ func expertConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uint
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
-func expertDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* sqlite3expert.c:431:12: */
+func expertDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3expert.c:431:12: */
var p uintptr = pVtab
sqlite3.Xsqlite3_free(tls, p)
return 0
}
-func expertBestIndex(tls *crt.TLS, pVtab uintptr, pIdxInfo uintptr) int32 { /* sqlite3expert.c:437:12: */
+func expertBestIndex(tls *libc.TLS, pVtab uintptr, pIdxInfo uintptr) int32 { /* sqlite3expert.c:437:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -7167,7 +7419,7 @@ func expertBestIndex(tls *crt.TLS, pVtab uintptr, pIdxInfo uintptr) int32 { /* s
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
-func expertUpdate(tls *crt.TLS, pVtab uintptr, nData int32, azData uintptr, pRowid uintptr) int32 { /* sqlite3expert.c:504:12: */
+func expertUpdate(tls *libc.TLS, pVtab uintptr, nData int32, azData uintptr, pRowid uintptr) int32 { /* sqlite3expert.c:504:12: */
_ = pVtab
_ = nData
_ = azData
@@ -7176,7 +7428,7 @@ func expertUpdate(tls *crt.TLS, pVtab uintptr, nData int32, azData uintptr, pRow
}
// Virtual table module xOpen method.
-func expertOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3expert.c:520:12: */
+func expertOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3expert.c:520:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -7189,7 +7441,7 @@ func expertOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite
}
// Virtual table module xClose method.
-func expertClose(tls *crt.TLS, cur uintptr) int32 { /* sqlite3expert.c:532:12: */
+func expertClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3expert.c:532:12: */
var pCsr uintptr = cur
sqlite3.Xsqlite3_finalize(tls, (*ExpertCsr)(unsafe.Pointer(pCsr)).FpData)
sqlite3.Xsqlite3_free(tls, pCsr)
@@ -7200,13 +7452,13 @@ func expertClose(tls *crt.TLS, cur uintptr) int32 { /* sqlite3expert.c:532:12: *
//
// Return non-zero if the cursor does not currently point to a valid
// record (i.e if the scan has finished), or zero otherwise.
-func expertEof(tls *crt.TLS, cur uintptr) int32 { /* sqlite3expert.c:545:12: */
+func expertEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3expert.c:545:12: */
var pCsr uintptr = cur
- return (crt.Bool32((*ExpertCsr)(unsafe.Pointer(pCsr)).FpData == uintptr(0)))
+ return (libc.Bool32((*ExpertCsr)(unsafe.Pointer(pCsr)).FpData == uintptr(0)))
}
// Virtual table module xNext method.
-func expertNext(tls *crt.TLS, cur uintptr) int32 { /* sqlite3expert.c:553:12: */
+func expertNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3expert.c:553:12: */
var pCsr uintptr = cur
var rc int32 = 0
@@ -7222,14 +7474,14 @@ func expertNext(tls *crt.TLS, cur uintptr) int32 { /* sqlite3expert.c:553:12: */
}
// Virtual table module xRowid method.
-func expertRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3expert.c:572:12: */
+func expertRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3expert.c:572:12: */
_ = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = int64(0)
return 0
}
// Virtual table module xColumn method.
-func expertColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3expert.c:581:12: */
+func expertColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3expert.c:581:12: */
var pCsr uintptr = cur
var pVal uintptr
pVal = sqlite3.Xsqlite3_column_value(tls, (*ExpertCsr)(unsafe.Pointer(pCsr)).FpData, i)
@@ -7240,7 +7492,7 @@ func expertColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sq
}
// Virtual table module xFilter method.
-func expertFilter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3expert.c:594:12: */
+func expertFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3expert.c:594:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -7257,7 +7509,7 @@ func expertFilter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc
(*ExpertCsr)(unsafe.Pointer(pCsr)).FpData = uintptr(0)
if rc == 0 {
rc = idxPrintfPrepareStmt(tls, (*sqlite3expert)(unsafe.Pointer(pExpert)).Fdb, (pCsr + 8 /* &.pData */), (pVtab /* &.base */ + 16 /* &.zErrMsg */),
- ts+19 /* "SELECT * FROM ma..." */, crt.VaList(bp, (*IdxTable)(unsafe.Pointer((*ExpertVtab)(unsafe.Pointer(pVtab)).FpTab)).FzName))
+ ts+19 /* "SELECT * FROM ma..." */, libc.VaList(bp, (*IdxTable)(unsafe.Pointer((*ExpertVtab)(unsafe.Pointer(pVtab)).FpTab)).FzName))
}
if rc == 0 {
@@ -7266,7 +7518,7 @@ func expertFilter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc
return rc
}
-func idxRegisterVtab(tls *crt.TLS, p uintptr) int32 { /* sqlite3expert.c:622:12: */
+func idxRegisterVtab(tls *libc.TLS, p uintptr) int32 { /* sqlite3expert.c:622:12: */
return sqlite3.Xsqlite3_create_module(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbv, ts+56 /* "expert" */, uintptr(unsafe.Pointer(&expertModule)), p)
}
@@ -7302,7 +7554,7 @@ uintptr(0), // xShadowName
// Finalize SQL statement pStmt. If (*pRc) is SQLITE_OK when this function
// is called, set it to the return value of sqlite3_finalize() before
// returning. Otherwise, discard the sqlite3_finalize() return value.
-func idxFinalize(tls *crt.TLS, pRc uintptr, pStmt uintptr) { /* sqlite3expert.c:660:13: */
+func idxFinalize(tls *libc.TLS, pRc uintptr, pStmt uintptr) { /* sqlite3expert.c:660:13: */
var rc int32 = sqlite3.Xsqlite3_finalize(tls, pStmt)
if *(*int32)(unsafe.Pointer(pRc)) == 0 {
*(*int32)(unsafe.Pointer(pRc)) = rc
@@ -7317,13 +7569,13 @@ func idxFinalize(tls *crt.TLS, pRc uintptr, pStmt uintptr) { /* sqlite3expert.c:
//
// It is the responsibility of the caller to eventually free either the
// IdxTable object or error message using sqlite3_free().
-func idxGetTableInfo(tls *crt.TLS, db uintptr, zTab uintptr, ppOut uintptr, pzErrmsg uintptr) int32 { /* sqlite3expert.c:675:12: */
+func idxGetTableInfo(tls *libc.TLS, db uintptr, zTab uintptr, ppOut uintptr, pzErrmsg uintptr) int32 { /* sqlite3expert.c:675:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
*(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)) = uintptr(0)
var nCol int32 = 0
- var nTab int32 = int32(crt.Xstrlen(tls, zTab))
+ var nTab int32 = int32(libc.Xstrlen(tls, zTab))
var nByte int32 = (int32((uint64(unsafe.Sizeof(IdxTable{})) + uint64(nTab)) + uint64(1)))
var pNew uintptr = uintptr(0)
// var rc int32 at bp+24, 4
@@ -7331,13 +7583,13 @@ func idxGetTableInfo(tls *crt.TLS, db uintptr, zTab uintptr, ppOut uintptr, pzEr
var rc2 int32
var pCsr uintptr = uintptr(0)
- *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = idxPrintfPrepareStmt(tls, db, bp+8 /* &p1 */, pzErrmsg, ts+63 /* "PRAGMA table_inf..." */, crt.VaList(bp, zTab))
+ *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = idxPrintfPrepareStmt(tls, db, bp+8 /* &p1 */, pzErrmsg, ts+63 /* "PRAGMA table_inf..." */, libc.VaList(bp, zTab))
for (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == 0) && (100 == sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)))) {
*(*uintptr)(unsafe.Pointer(bp + 16 /* zCol */)) = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)), 1)
- nByte = nByte + (1 + int32(crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zCol */)))))
+ nByte = nByte + (1 + int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zCol */)))))
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sqlite3.Xsqlite3_table_column_metadata(tls,
db, ts+84 /* "main" */, zTab, *(*uintptr)(unsafe.Pointer(bp + 16 /* zCol */)), uintptr(0), bp+16 /* &zCol */, uintptr(0), uintptr(0), uintptr(0))
- nByte = nByte + (1 + int32(crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zCol */)))))
+ nByte = nByte + (1 + int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zCol */)))))
nCol++
}
rc2 = sqlite3.Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)))
@@ -7358,18 +7610,18 @@ func idxGetTableInfo(tls *crt.TLS, db uintptr, zTab uintptr, ppOut uintptr, pzEr
nCol = 0
for (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == 0) && (100 == sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)))) {
*(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)) = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)), 1)
- var nCopy int32 = (int32(crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)))) + 1)
+ var nCopy int32 = (int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)))) + 1)
(*IdxColumn)(unsafe.Pointer((*IdxTable)(unsafe.Pointer(pNew)).FaCol + uintptr(nCol)*24)).FzName = pCsr
(*IdxColumn)(unsafe.Pointer((*IdxTable)(unsafe.Pointer(pNew)).FaCol + uintptr(nCol)*24)).FiPk = sqlite3.Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p1 */)), 5)
- crt.Xmemcpy(tls, pCsr, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)), uint64(nCopy))
+ libc.Xmemcpy(tls, pCsr, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)), uint64(nCopy))
pCsr += uintptr(nCopy)
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sqlite3.Xsqlite3_table_column_metadata(tls,
db, ts+84 /* "main" */, zTab, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)), uintptr(0), bp+32 /* &zCol */, uintptr(0), uintptr(0), uintptr(0))
if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == 0 {
- nCopy = (int32(crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)))) + 1)
+ nCopy = (int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)))) + 1)
(*IdxColumn)(unsafe.Pointer((*IdxTable)(unsafe.Pointer(pNew)).FaCol + uintptr(nCol)*24)).FzColl = pCsr
- crt.Xmemcpy(tls, pCsr, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)), uint64(nCopy))
+ libc.Xmemcpy(tls, pCsr, *(*uintptr)(unsafe.Pointer(bp + 32 /* zCol */)), uint64(nCopy))
pCsr += uintptr(nCopy)
}
@@ -7382,7 +7634,7 @@ func idxGetTableInfo(tls *crt.TLS, db uintptr, zTab uintptr, ppOut uintptr, pzEr
pNew = uintptr(0)
} else {
(*IdxTable)(unsafe.Pointer(pNew)).FzName = pCsr
- crt.Xmemcpy(tls, (*IdxTable)(unsafe.Pointer(pNew)).FzName, zTab, (uint64(nTab + 1)))
+ libc.Xmemcpy(tls, (*IdxTable)(unsafe.Pointer(pNew)).FzName, zTab, (uint64(nTab + 1)))
}
*(*uintptr)(unsafe.Pointer(ppOut)) = pNew
@@ -7396,14 +7648,14 @@ func idxGetTableInfo(tls *crt.TLS, db uintptr, zTab uintptr, ppOut uintptr, pzEr
// the printf() style arguments is appended to zIn and the result returned
// in a buffer allocated by sqlite3_malloc(). sqlite3_free() is called on
// zIn before returning.
-func idxAppendText(tls *crt.TLS, pRc uintptr, zIn uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3expert.c:756:13: */
+func idxAppendText(tls *libc.TLS, pRc uintptr, zIn uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3expert.c:756:13: */
var ap va_list
_ = ap
var zAppend uintptr = uintptr(0)
var zRet uintptr = uintptr(0)
var nIn int32
if zIn != 0 {
- nIn = int32(crt.Xstrlen(tls, zIn))
+ nIn = int32(libc.Xstrlen(tls, zIn))
} else {
nIn = 0
}
@@ -7412,14 +7664,14 @@ func idxAppendText(tls *crt.TLS, pRc uintptr, zIn uintptr, zFmt uintptr, va uint
if *(*int32)(unsafe.Pointer(pRc)) == 0 {
zAppend = sqlite3.Xsqlite3_vmprintf(tls, zFmt, ap)
if zAppend != 0 {
- nAppend = int32(crt.Xstrlen(tls, zAppend))
+ nAppend = int32(libc.Xstrlen(tls, zAppend))
zRet = sqlite3.Xsqlite3_malloc(tls, ((nIn + nAppend) + 1))
}
if (zAppend != 0) && (zRet != 0) {
if nIn != 0 {
- crt.Xmemcpy(tls, zRet, zIn, uint64(nIn))
+ libc.Xmemcpy(tls, zRet, zIn, uint64(nIn))
}
- crt.Xmemcpy(tls, (zRet + uintptr(nIn)), zAppend, (uint64(nAppend + 1)))
+ libc.Xmemcpy(tls, (zRet + uintptr(nIn)), zAppend, (uint64(nAppend + 1)))
} else {
sqlite3.Xsqlite3_free(tls, zRet)
zRet = uintptr(0)
@@ -7434,7 +7686,7 @@ func idxAppendText(tls *crt.TLS, pRc uintptr, zIn uintptr, zFmt uintptr, va uint
// Return true if zId must be quoted in order to use it as an SQL
// identifier, or false otherwise.
-func idxIdentifierRequiresQuotes(tls *crt.TLS, zId uintptr) int32 { /* sqlite3expert.c:788:12: */
+func idxIdentifierRequiresQuotes(tls *libc.TLS, zId uintptr) int32 { /* sqlite3expert.c:788:12: */
var i int32
for i = 0; *(*int8)(unsafe.Pointer(zId + uintptr(i))) != 0; i++ {
if ((!(int32(*(*int8)(unsafe.Pointer(zId + uintptr(i)))) == '_') &&
@@ -7449,7 +7701,7 @@ func idxIdentifierRequiresQuotes(tls *crt.TLS, zId uintptr) int32 { /* sqlite3ex
// This function appends an index column definition suitable for constraint
// pCons to the string passed as zIn and returns the result.
-func idxAppendColDefn(tls *crt.TLS, pRc uintptr, zIn uintptr, pTab uintptr, pCons uintptr) uintptr { /* sqlite3expert.c:806:13: */
+func idxAppendColDefn(tls *libc.TLS, pRc uintptr, zIn uintptr, pTab uintptr, pCons uintptr) uintptr { /* sqlite3expert.c:806:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -7460,16 +7712,16 @@ func idxAppendColDefn(tls *crt.TLS, pRc uintptr, zIn uintptr, pTab uintptr, pCon
}
if idxIdentifierRequiresQuotes(tls, (*IdxColumn)(unsafe.Pointer(p)).FzName) != 0 {
- zRet = idxAppendText(tls, pRc, zRet, ts+92 /* "%Q" */, crt.VaList(bp, (*IdxColumn)(unsafe.Pointer(p)).FzName))
+ zRet = idxAppendText(tls, pRc, zRet, ts+92 /* "%Q" */, libc.VaList(bp, (*IdxColumn)(unsafe.Pointer(p)).FzName))
} else {
- zRet = idxAppendText(tls, pRc, zRet, ts /* "%s" */, crt.VaList(bp+8, (*IdxColumn)(unsafe.Pointer(p)).FzName))
+ zRet = idxAppendText(tls, pRc, zRet, ts /* "%s" */, libc.VaList(bp+8, (*IdxColumn)(unsafe.Pointer(p)).FzName))
}
if sqlite3.Xsqlite3_stricmp(tls, (*IdxColumn)(unsafe.Pointer(p)).FzColl, (*IdxConstraint)(unsafe.Pointer(pCons)).FzColl) != 0 {
if idxIdentifierRequiresQuotes(tls, (*IdxConstraint)(unsafe.Pointer(pCons)).FzColl) != 0 {
- zRet = idxAppendText(tls, pRc, zRet, ts+95 /* " COLLATE %Q" */, crt.VaList(bp+16, (*IdxConstraint)(unsafe.Pointer(pCons)).FzColl))
+ zRet = idxAppendText(tls, pRc, zRet, ts+95 /* " COLLATE %Q" */, libc.VaList(bp+16, (*IdxConstraint)(unsafe.Pointer(pCons)).FzColl))
} else {
- zRet = idxAppendText(tls, pRc, zRet, ts+107 /* " COLLATE %s" */, crt.VaList(bp+24, (*IdxConstraint)(unsafe.Pointer(pCons)).FzColl))
+ zRet = idxAppendText(tls, pRc, zRet, ts+107 /* " COLLATE %s" */, libc.VaList(bp+24, (*IdxConstraint)(unsafe.Pointer(pCons)).FzColl))
}
}
@@ -7485,7 +7737,7 @@ func idxAppendColDefn(tls *crt.TLS, pRc uintptr, zIn uintptr, pTab uintptr, pCon
// return zero.
//
// If an error occurs, set *pRc to an SQLite error code and return zero.
-func idxFindCompatible(tls *crt.TLS, pRc uintptr, dbm uintptr, pScan uintptr, pEq uintptr, pTail uintptr) int32 { /* sqlite3expert.c:844:12: */
+func idxFindCompatible(tls *libc.TLS, pRc uintptr, dbm uintptr, pScan uintptr, pEq uintptr, pTail uintptr) int32 { /* sqlite3expert.c:844:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -7500,7 +7752,7 @@ func idxFindCompatible(tls *crt.TLS, pRc uintptr, dbm uintptr, pScan uintptr, pE
nEq++
}
- *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = idxPrintfPrepareStmt(tls, dbm, bp+16 /* &pIdxList */, uintptr(0), ts+125 /* "PRAGMA index_lis..." */, crt.VaList(bp, zTbl))
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = idxPrintfPrepareStmt(tls, dbm, bp+16 /* &pIdxList */, uintptr(0), ts+125 /* "PRAGMA index_lis..." */, libc.VaList(bp, zTbl))
for (*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == 0) && (sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pIdxList */))) == 100) {
var bMatch int32 = 1
var pT uintptr = pTail
@@ -7512,7 +7764,7 @@ func idxFindCompatible(tls *crt.TLS, pRc uintptr, dbm uintptr, pScan uintptr, pE
(*IdxConstraint)(unsafe.Pointer(pIter)).FbFlag = 0
}
- *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = idxPrintfPrepareStmt(tls, dbm, bp+24 /* &pInfo */, uintptr(0), ts+146 /* "PRAGMA index_xIn..." */, crt.VaList(bp+8, zIdx))
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = idxPrintfPrepareStmt(tls, dbm, bp+24 /* &pInfo */, uintptr(0), ts+146 /* "PRAGMA index_xIn..." */, libc.VaList(bp+8, zIdx))
for (*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == 0) && (sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pInfo */))) == 100) {
var iIdx int32 = sqlite3.Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pInfo */)), 0)
var iCol int32 = sqlite3.Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pInfo */)), 1)
@@ -7559,7 +7811,7 @@ func idxFindCompatible(tls *crt.TLS, pRc uintptr, dbm uintptr, pScan uintptr, pE
return 0
}
-func idxCreateFromCons(tls *crt.TLS, p uintptr, pScan uintptr, pEq uintptr, pTail uintptr) int32 { /* sqlite3expert.c:911:12: */
+func idxCreateFromCons(tls *libc.TLS, p uintptr, pScan uintptr, pEq uintptr, pTail uintptr) int32 { /* sqlite3expert.c:911:12: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -7588,7 +7840,7 @@ func idxCreateFromCons(tls *crt.TLS, p uintptr, pScan uintptr, pEq uintptr, pTai
for i = 0; *(*int8)(unsafe.Pointer(zCols + uintptr(i))) != 0; i++ {
h = h + ((h << 3) + uint32(*(*int8)(unsafe.Pointer(zCols + uintptr(i)))))
}
- zName = sqlite3.Xsqlite3_mprintf(tls, ts+168 /* "%s_idx_%08x" */, crt.VaList(bp, zTable, h))
+ zName = sqlite3.Xsqlite3_mprintf(tls, ts+168 /* "%s_idx_%08x" */, libc.VaList(bp, zTable, h))
if zName == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 7
} else {
@@ -7597,7 +7849,7 @@ func idxCreateFromCons(tls *crt.TLS, p uintptr, pScan uintptr, pEq uintptr, pTai
} else {
zFmt = ts + 208 /* "CREATE INDEX %s ..." */
}
- zIdx = sqlite3.Xsqlite3_mprintf(tls, zFmt, crt.VaList(bp+16, zName, zTable, zCols))
+ zIdx = sqlite3.Xsqlite3_mprintf(tls, zFmt, libc.VaList(bp+16, zName, zTable, zCols))
if !(zIdx != 0) {
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 7
} else {
@@ -7616,7 +7868,7 @@ func idxCreateFromCons(tls *crt.TLS, p uintptr, pScan uintptr, pEq uintptr, pTai
// Return true if list pList (linked by IdxConstraint.pLink) contains
// a constraint compatible with *p. Otherwise return false.
-func idxFindConstraint(tls *crt.TLS, pList uintptr, p uintptr) int32 { /* sqlite3expert.c:972:12: */
+func idxFindConstraint(tls *libc.TLS, pList uintptr, p uintptr) int32 { /* sqlite3expert.c:972:12: */
var pCmp uintptr
for pCmp = pList; pCmp != 0; pCmp = (*IdxConstraint)(unsafe.Pointer(pCmp)).FpLink {
if (*IdxConstraint)(unsafe.Pointer(p)).FiCol == (*IdxConstraint)(unsafe.Pointer(pCmp)).FiCol {
@@ -7626,7 +7878,7 @@ func idxFindConstraint(tls *crt.TLS, pList uintptr, p uintptr) int32 { /* sqlite
return 0
}
-func idxCreateFromWhere(tls *crt.TLS, p uintptr, pScan uintptr, pTail uintptr) int32 { /* sqlite3expert.c:980:12: */
+func idxCreateFromWhere(tls *libc.TLS, p uintptr, pScan uintptr, pTail uintptr) int32 { /* sqlite3expert.c:980:12: */
var p1 uintptr = uintptr(0)
var pCon uintptr
var rc int32
@@ -7659,7 +7911,7 @@ func idxCreateFromWhere(tls *crt.TLS, p uintptr, pScan uintptr, pTail uintptr) i
// Create candidate indexes in database [dbm] based on the data in
// linked-list pScan.
-func idxCreateCandidates(tls *crt.TLS, p uintptr) int32 { /* sqlite3expert.c:1019:12: */
+func idxCreateCandidates(tls *libc.TLS, p uintptr) int32 { /* sqlite3expert.c:1019:12: */
var rc int32 = 0
var pIter uintptr
@@ -7674,7 +7926,7 @@ func idxCreateCandidates(tls *crt.TLS, p uintptr) int32 { /* sqlite3expert.c:101
}
// Free all elements of the linked list starting at pConstraint.
-func idxConstraintFree(tls *crt.TLS, pConstraint uintptr) { /* sqlite3expert.c:1036:13: */
+func idxConstraintFree(tls *libc.TLS, pConstraint uintptr) { /* sqlite3expert.c:1036:13: */
var pNext uintptr
var p uintptr
@@ -7686,7 +7938,7 @@ func idxConstraintFree(tls *crt.TLS, pConstraint uintptr) { /* sqlite3expert.c:1
// Free all elements of the linked list starting from pScan up until pLast
// (pLast is not freed).
-func idxScanFree(tls *crt.TLS, pScan uintptr, pLast uintptr) { /* sqlite3expert.c:1050:13: */
+func idxScanFree(tls *libc.TLS, pScan uintptr, pLast uintptr) { /* sqlite3expert.c:1050:13: */
var p uintptr
var pNext uintptr
for p = pScan; p != pLast; p = pNext {
@@ -7700,7 +7952,7 @@ func idxScanFree(tls *crt.TLS, pScan uintptr, pLast uintptr) { /* sqlite3expert.
// Free all elements of the linked list starting from pStatement up
// until pLast (pLast is not freed).
-func idxStatementFree(tls *crt.TLS, pStatement uintptr, pLast uintptr) { /* sqlite3expert.c:1066:13: */
+func idxStatementFree(tls *libc.TLS, pStatement uintptr, pLast uintptr) { /* sqlite3expert.c:1066:13: */
var p uintptr
var pNext uintptr
for p = pStatement; p != pLast; p = pNext {
@@ -7712,7 +7964,7 @@ func idxStatementFree(tls *crt.TLS, pStatement uintptr, pLast uintptr) { /* sqli
}
// Free the linked list of IdxTable objects starting at pTab.
-func idxTableFree(tls *crt.TLS, pTab uintptr) { /* sqlite3expert.c:1080:13: */
+func idxTableFree(tls *libc.TLS, pTab uintptr) { /* sqlite3expert.c:1080:13: */
var pIter uintptr
var pNext uintptr
for pIter = pTab; pIter != 0; pIter = pNext {
@@ -7722,7 +7974,7 @@ func idxTableFree(tls *crt.TLS, pTab uintptr) { /* sqlite3expert.c:1080:13: */
}
// Free the linked list of IdxWrite objects starting at pTab.
-func idxWriteFree(tls *crt.TLS, pTab uintptr) { /* sqlite3expert.c:1092:13: */
+func idxWriteFree(tls *libc.TLS, pTab uintptr) { /* sqlite3expert.c:1092:13: */
var pIter uintptr
var pNext uintptr
for pIter = pTab; pIter != 0; pIter = pNext {
@@ -7734,7 +7986,7 @@ func idxWriteFree(tls *crt.TLS, pTab uintptr) { /* sqlite3expert.c:1092:13: */
// This function is called after candidate indexes have been created. It
// runs all the queries to see which indexes they prefer, and populates
// IdxStatement.zIdx and IdxStatement.zEQP with the results.
-func idxFindIndexes(tls *crt.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1108:5: */
+func idxFindIndexes(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1108:5: */
bp := tls.Alloc(8228)
defer tls.Free(8228)
@@ -7767,7 +8019,7 @@ __1:
*(*uintptr)(unsafe.Pointer(bp + 8216 /* pExplain */)) = uintptr(0)
idxHashClear(tls, bp+24 /* &hIdx */)
*(*int32)(unsafe.Pointer(bp + 8224 /* rc */)) = idxPrintfPrepareStmt(tls, dbm, bp+8216 /* &pExplain */, pzErr,
- ts+234 /* "EXPLAIN QUERY PL..." */, crt.VaList(bp, (*IdxStatement)(unsafe.Pointer(pStmt)).FzSql))
+ ts+234 /* "EXPLAIN QUERY PL..." */, libc.VaList(bp, (*IdxStatement)(unsafe.Pointer(pStmt)).FzSql))
__4:
if !((*(*int32)(unsafe.Pointer(bp + 8224 /* rc */)) == 0) && (sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8216 /* pExplain */))) == 100)) {
goto __5
@@ -7783,7 +8035,7 @@ __4:
goto __4
__6:
;
- nDetail = int32(crt.Xstrlen(tls, zDetail))
+ nDetail = int32(libc.Xstrlen(tls, zDetail))
i = 0
__7:
@@ -7791,14 +8043,14 @@ __7:
goto __9
}
zIdx = uintptr(0)
- if !(((i + 13) < nDetail) && (crt.Xmemcmp(tls, (zDetail+uintptr(i)), ts+256 /* " USING INDEX " */, uint64(13)) == 0)) {
+ if !(((i + 13) < nDetail) && (libc.Xmemcmp(tls, (zDetail+uintptr(i)), ts+256 /* " USING INDEX " */, uint64(13)) == 0)) {
goto __10
}
zIdx = (zDetail + uintptr((i + 13)))
goto __11
__10:
if !(((i + 22) < nDetail) &&
- (crt.Xmemcmp(tls, (zDetail+uintptr(i)), ts+270 /* " USING COVERING ..." */, uint64(22)) == 0)) {
+ (libc.Xmemcmp(tls, (zDetail+uintptr(i)), ts+270 /* " USING COVERING ..." */, uint64(22)) == 0)) {
goto __12
}
zIdx = (zDetail + uintptr((i + 22)))
@@ -7845,7 +8097,7 @@ __9:
if !(int32(*(*int8)(unsafe.Pointer(zDetail + uintptr(0)))) != '-') {
goto __18
}
- (*IdxStatement)(unsafe.Pointer(pStmt)).FzEQP = idxAppendText(tls, bp+8224 /* &rc */, (*IdxStatement)(unsafe.Pointer(pStmt)).FzEQP, ts+293 /* "%s\n" */, crt.VaList(bp+8, zDetail))
+ (*IdxStatement)(unsafe.Pointer(pStmt)).FzEQP = idxAppendText(tls, bp+8224 /* &rc */, (*IdxStatement)(unsafe.Pointer(pStmt)).FzEQP, ts+293 /* "%s\n" */, libc.VaList(bp+8, zDetail))
__18:
;
goto __4
@@ -7857,7 +8109,7 @@ __19:
if !(pEntry != 0) {
goto __21
}
- (*IdxStatement)(unsafe.Pointer(pStmt)).FzIdx = idxAppendText(tls, bp+8224 /* &rc */, (*IdxStatement)(unsafe.Pointer(pStmt)).FzIdx, ts+297 /* "%s;\n" */, crt.VaList(bp+16, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey))
+ (*IdxStatement)(unsafe.Pointer(pStmt)).FzIdx = idxAppendText(tls, bp+8224 /* &rc */, (*IdxStatement)(unsafe.Pointer(pStmt)).FzIdx, ts+297 /* "%s;\n" */, libc.VaList(bp+16, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzKey))
goto __20
__20:
pEntry = (*IdxHashEntry)(unsafe.Pointer(pEntry)).FpNext
@@ -7880,7 +8132,7 @@ find_indexes_out:
return *(*int32)(unsafe.Pointer(bp + 8224 /* rc */))
}
-func idxAuthCallback(tls *crt.TLS, pCtx uintptr, eOp int32, z3 uintptr, z4 uintptr, zDb uintptr, zTrigger uintptr) int32 { /* sqlite3expert.c:1178:12: */
+func idxAuthCallback(tls *libc.TLS, pCtx uintptr, eOp int32, z3 uintptr, z4 uintptr, zDb uintptr, zTrigger uintptr) int32 { /* sqlite3expert.c:1178:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -7918,7 +8170,7 @@ func idxAuthCallback(tls *crt.TLS, pCtx uintptr, eOp int32, z3 uintptr, z4 uintp
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
-func idxProcessOneTrigger(tls *crt.TLS, p uintptr, pWrite uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1216:12: */
+func idxProcessOneTrigger(tls *libc.TLS, p uintptr, pWrite uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1216:12: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -7930,7 +8182,7 @@ func idxProcessOneTrigger(tls *crt.TLS, p uintptr, pWrite uintptr, pzErr uintptr
var zWrite uintptr = uintptr(0)
// Create the table and its triggers in the temp schema
- *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = idxPrintfPrepareStmt(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdb, bp+80 /* &pSelect */, pzErr, zSql, crt.VaList(bp, zTab, zTab))
+ *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = idxPrintfPrepareStmt(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdb, bp+80 /* &pSelect */, pzErr, zSql, libc.VaList(bp, zTab, zTab))
for (*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) == 0) && (100 == sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pSelect */)))) {
var zCreate uintptr = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pSelect */)), 0)
*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbv, zCreate, uintptr(0), uintptr(0), pzErr)
@@ -7939,7 +8191,7 @@ func idxProcessOneTrigger(tls *crt.TLS, p uintptr, pWrite uintptr, pzErr uintptr
// Rename the table in the temp schema to zInt
if *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) == 0 {
- var z uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+428 /* "ALTER TABLE temp..." */, crt.VaList(bp+16, zTab, zInt))
+ var z uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+428 /* "ALTER TABLE temp..." */, libc.VaList(bp+16, zTab, zInt))
if z == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = 7
} else {
@@ -7952,9 +8204,9 @@ func idxProcessOneTrigger(tls *crt.TLS, p uintptr, pWrite uintptr, pzErr uintptr
case 18:
{
var i int32
- zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+461 /* "INSERT INTO %Q V..." */, crt.VaList(bp+32, zInt))
+ zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+461 /* "INSERT INTO %Q V..." */, libc.VaList(bp+32, zInt))
for i = 0; i < (*IdxTable)(unsafe.Pointer(pTab)).FnCol; i++ {
- zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+484 /* "%s?" */, crt.VaList(bp+40, func() uintptr {
+ zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+484 /* "%s?" */, libc.VaList(bp+40, func() uintptr {
if i == 0 {
return ts + 488 /* "" */
}
@@ -7967,9 +8219,9 @@ func idxProcessOneTrigger(tls *crt.TLS, p uintptr, pWrite uintptr, pzErr uintptr
case 23:
{
var i int32
- zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+491 /* "UPDATE %Q SET " */, crt.VaList(bp+48, zInt))
+ zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+491 /* "UPDATE %Q SET " */, libc.VaList(bp+48, zInt))
for i = 0; i < (*IdxTable)(unsafe.Pointer(pTab)).FnCol; i++ {
- zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+506 /* "%s%Q=?" */, crt.VaList(bp+56, func() uintptr {
+ zWrite = idxAppendText(tls, bp+88 /* &rc */, zWrite, ts+506 /* "%s%Q=?" */, libc.VaList(bp+56, func() uintptr {
if i == 0 {
return ts + 488 /* "" */
}
@@ -7983,7 +8235,7 @@ func idxProcessOneTrigger(tls *crt.TLS, p uintptr, pWrite uintptr, pzErr uintptr
{
if *(*int32)(unsafe.Pointer(bp + 88 /* rc */)) == 0 {
- zWrite = sqlite3.Xsqlite3_mprintf(tls, ts+513 /* "DELETE FROM %Q" */, crt.VaList(bp+72, zInt))
+ zWrite = sqlite3.Xsqlite3_mprintf(tls, ts+513 /* "DELETE FROM %Q" */, libc.VaList(bp+72, zInt))
if zWrite == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 88 /* rc */)) = 7
}
@@ -8011,7 +8263,7 @@ func idxProcessOneTrigger(tls *crt.TLS, p uintptr, pWrite uintptr, pzErr uintptr
var zInt uintptr = ts + 528 /* "t592690916721053..." */ /* sqlite3expert.c:1221:21 */
var zDrop uintptr = ts + 566 /* "DROP TABLE t5926..." */ /* sqlite3expert.c:1222:21 */
-func idxProcessTriggers(tls *crt.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1298:12: */
+func idxProcessTriggers(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1298:12: */
var rc int32 = 0
var pEnd uintptr = uintptr(0)
var pFirst uintptr = (*sqlite3expert)(unsafe.Pointer(p)).FpWrite
@@ -8028,7 +8280,7 @@ func idxProcessTriggers(tls *crt.TLS, p uintptr, pzErr uintptr) int32 { /* sqlit
return rc
}
-func idxCreateVtabSchema(tls *crt.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sqlite3expert.c:1316:12: */
+func idxCreateVtabSchema(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sqlite3expert.c:1316:12: */
bp := tls.Alloc(60)
defer tls.Free(60)
@@ -8064,7 +8316,7 @@ func idxCreateVtabSchema(tls *crt.TLS, p uintptr, pzErrmsg uintptr) int32 { /* s
zInner = idxAppendText(tls, bp+56 /* &rc */, uintptr(0), ts+883 /* "CREATE TABLE x(" */, 0)
for i = 0; i < (*IdxTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* pTab */)))).FnCol; i++ {
zInner = idxAppendText(tls, bp+56 /* &rc */, zInner, ts+899, /* "%s%Q COLLATE %s" */
- crt.VaList(bp, func() uintptr {
+ libc.VaList(bp, func() uintptr {
if i == 0 {
return ts + 488 /* "" */
}
@@ -8075,7 +8327,7 @@ func idxCreateVtabSchema(tls *crt.TLS, p uintptr, pzErrmsg uintptr) int32 { /* s
// The CVT statement to create the vtab
zOuter = idxAppendText(tls, bp+56 /* &rc */, uintptr(0),
- ts+915 /* "CREATE VIRTUAL T..." */, crt.VaList(bp+24, zName, zInner))
+ ts+915 /* "CREATE VIRTUAL T..." */, libc.VaList(bp+24, zName, zInner))
if *(*int32)(unsafe.Pointer(bp + 56 /* rc */)) == 0 {
*(*int32)(unsafe.Pointer(bp + 56 /* rc */)) = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbv, zOuter, uintptr(0), uintptr(0), pzErrmsg)
}
@@ -8095,7 +8347,7 @@ type IdxSampleCtx = struct {
FnRet float64
}
-func idxSampleFunc(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3expert.c:1383:13: */
+func idxSampleFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3expert.c:1383:13: */
bp := tls.Alloc(2)
defer tls.Free(2)
@@ -8107,12 +8359,12 @@ func idxSampleFunc(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sq
if (*IdxSampleCtx)(unsafe.Pointer(p)).FnRow == 0.0 {
bRet = 1
} else {
- bRet = (crt.Bool32(((*IdxSampleCtx)(unsafe.Pointer(p)).FnRet / (*IdxSampleCtx)(unsafe.Pointer(p)).FnRow) <= (*IdxSampleCtx)(unsafe.Pointer(p)).Ftarget))
+ bRet = (libc.Bool32(((*IdxSampleCtx)(unsafe.Pointer(p)).FnRet / (*IdxSampleCtx)(unsafe.Pointer(p)).FnRow) <= (*IdxSampleCtx)(unsafe.Pointer(p)).Ftarget))
if bRet == 0 {
// var rnd uint16 at bp, 2
sqlite3.Xsqlite3_randomness(tls, 2, bp /* &rnd */)
- bRet = (crt.Bool32((int32(*(*uint16)(unsafe.Pointer(bp /* rnd */))) % 100) <= (*IdxSampleCtx)(unsafe.Pointer(p)).FiTarget))
+ bRet = (libc.Bool32((int32(*(*uint16)(unsafe.Pointer(bp /* rnd */))) % 100) <= (*IdxSampleCtx)(unsafe.Pointer(p)).FiTarget))
}
}
@@ -8143,7 +8395,7 @@ type IdxRemSlot = struct {
}
// Implementation of scalar function rem().
-func idxRemFunc(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3expert.c:1424:13: */
+func idxRemFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3expert.c:1424:13: */
var p uintptr = sqlite3.Xsqlite3_user_data(tls, pCtx)
var pSlot uintptr
var iSlot int32
@@ -8166,11 +8418,11 @@ func idxRemFunc(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlit
break
case 4:
- sqlite3.Xsqlite3_result_blob(tls, pCtx, (*IdxRemSlot)(unsafe.Pointer(pSlot)).Fz, (*IdxRemSlot)(unsafe.Pointer(pSlot)).Fn, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_blob(tls, pCtx, (*IdxRemSlot)(unsafe.Pointer(pSlot)).Fz, (*IdxRemSlot)(unsafe.Pointer(pSlot)).Fn, libc.UintptrFromInt32(-1))
break
case 3:
- sqlite3.Xsqlite3_result_text(tls, pCtx, (*IdxRemSlot)(unsafe.Pointer(pSlot)).Fz, (*IdxRemSlot)(unsafe.Pointer(pSlot)).Fn, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, pCtx, (*IdxRemSlot)(unsafe.Pointer(pSlot)).Fz, (*IdxRemSlot)(unsafe.Pointer(pSlot)).Fn, libc.UintptrFromInt32(-1))
break
}
@@ -8204,16 +8456,16 @@ func idxRemFunc(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlit
}
(*IdxRemSlot)(unsafe.Pointer(pSlot)).Fn = nByte
if (*IdxRemSlot)(unsafe.Pointer(pSlot)).FeType == 4 {
- crt.Xmemcpy(tls, (*IdxRemSlot)(unsafe.Pointer(pSlot)).Fz, sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))), uint64(nByte))
+ libc.Xmemcpy(tls, (*IdxRemSlot)(unsafe.Pointer(pSlot)).Fz, sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))), uint64(nByte))
} else {
- crt.Xmemcpy(tls, (*IdxRemSlot)(unsafe.Pointer(pSlot)).Fz, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))), uint64(nByte))
+ libc.Xmemcpy(tls, (*IdxRemSlot)(unsafe.Pointer(pSlot)).Fz, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))), uint64(nByte))
}
break
}
}
}
-func idxLargestIndex(tls *crt.TLS, db uintptr, pnMax uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1497:12: */
+func idxLargestIndex(tls *libc.TLS, db uintptr, pnMax uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1497:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -8231,7 +8483,7 @@ func idxLargestIndex(tls *crt.TLS, db uintptr, pnMax uintptr, pzErr uintptr) int
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
-func idxPopulateOneStat1(tls *crt.TLS, p uintptr, pIndexXInfo uintptr, pWriteStat uintptr, zTab uintptr, zIdx uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1517:12: */
+func idxPopulateOneStat1(tls *libc.TLS, p uintptr, pIndexXInfo uintptr, pWriteStat uintptr, zTab uintptr, zIdx uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1517:12: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -8256,17 +8508,17 @@ func idxPopulateOneStat1(tls *crt.TLS, p uintptr, pIndexXInfo uintptr, pWriteSta
var zName uintptr = sqlite3.Xsqlite3_column_text(tls, pIndexXInfo, 0)
var zColl uintptr = sqlite3.Xsqlite3_column_text(tls, pIndexXInfo, 1)
zCols = idxAppendText(tls, bp+112 /* &rc */, zCols,
- ts+1093 /* "%sx.%Q IS rem(%d..." */, crt.VaList(bp, zComma, zName, nCol, zName, zColl))
- zOrder = idxAppendText(tls, bp+112 /* &rc */, zOrder, ts+1128 /* "%s%d" */, crt.VaList(bp+40, zComma, crt.PreIncInt32(&nCol, 1)))
+ ts+1093 /* "%sx.%Q IS rem(%d..." */, libc.VaList(bp, zComma, zName, nCol, zName, zColl))
+ zOrder = idxAppendText(tls, bp+112 /* &rc */, zOrder, ts+1128 /* "%s%d" */, libc.VaList(bp+40, zComma, libc.PreIncInt32(&nCol, 1)))
}
sqlite3.Xsqlite3_reset(tls, pIndexXInfo)
if *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) == 0 {
if (*sqlite3expert)(unsafe.Pointer(p)).FiSample == 100 {
zQuery = sqlite3.Xsqlite3_mprintf(tls,
- ts+1133 /* "SELECT %s FROM %..." */, crt.VaList(bp+56, zCols, zTab, zOrder))
+ ts+1133 /* "SELECT %s FROM %..." */, libc.VaList(bp+56, zCols, zTab, zOrder))
} else {
zQuery = sqlite3.Xsqlite3_mprintf(tls,
- ts+1165 /* "SELECT %s FROM t..." */, crt.VaList(bp+80, zCols, zOrder))
+ ts+1165 /* "SELECT %s FROM t..." */, libc.VaList(bp+80, zCols, zOrder))
}
}
sqlite3.Xsqlite3_free(tls, zCols)
@@ -8307,12 +8559,12 @@ func idxPopulateOneStat1(tls *crt.TLS, p uintptr, pIndexXInfo uintptr, pWriteSta
if *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) == 0 {
var s0 int32 = *(*int32)(unsafe.Pointer(aStat + uintptr(0)*4))
- zStat = sqlite3.Xsqlite3_mprintf(tls, ts+1237 /* "%d" */, crt.VaList(bp+96, s0))
+ zStat = sqlite3.Xsqlite3_mprintf(tls, ts+1237 /* "%d" */, libc.VaList(bp+96, s0))
if zStat == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = 7
}
for i = 1; (*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) == 0) && (i <= nCol); i++ {
- zStat = idxAppendText(tls, bp+112 /* &rc */, zStat, ts+1240 /* " %d" */, crt.VaList(bp+104, ((s0+(*(*int32)(unsafe.Pointer(aStat + uintptr(i)*4))/2)) / *(*int32)(unsafe.Pointer(aStat + uintptr(i)*4)))))
+ zStat = idxAppendText(tls, bp+112 /* &rc */, zStat, ts+1240 /* " %d" */, libc.VaList(bp+104, ((s0+(*(*int32)(unsafe.Pointer(aStat + uintptr(i)*4))/2)) / *(*int32)(unsafe.Pointer(aStat + uintptr(i)*4)))))
}
}
@@ -8324,7 +8576,7 @@ func idxPopulateOneStat1(tls *crt.TLS, p uintptr, pIndexXInfo uintptr, pWriteSta
*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = sqlite3.Xsqlite3_reset(tls, pWriteStat)
}
- pEntry = idxHashFind(tls, (p + 88 /* &.hIdx */), zIdx, int32(crt.Xstrlen(tls, zIdx)))
+ pEntry = idxHashFind(tls, (p + 88 /* &.hIdx */), zIdx, int32(libc.Xstrlen(tls, zIdx)))
if pEntry != 0 {
(*IdxHashEntry)(unsafe.Pointer(pEntry)).FzVal2 = zStat
@@ -8338,7 +8590,7 @@ func idxPopulateOneStat1(tls *crt.TLS, p uintptr, pIndexXInfo uintptr, pWriteSta
return *(*int32)(unsafe.Pointer(bp + 112 /* rc */))
}
-func idxBuildSampleTable(tls *crt.TLS, p uintptr, zTab uintptr) int32 { /* sqlite3expert.c:1617:12: */
+func idxBuildSampleTable(tls *libc.TLS, p uintptr, zTab uintptr) int32 { /* sqlite3expert.c:1617:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -8351,7 +8603,7 @@ func idxBuildSampleTable(tls *crt.TLS, p uintptr, zTab uintptr) int32 { /* sqlit
}
zSql = sqlite3.Xsqlite3_mprintf(tls,
- ts+1308 /* "CREATE TABLE tem..." */, crt.VaList(bp, zTab))
+ ts+1308 /* "CREATE TABLE tem..." */, libc.VaList(bp, zTab))
if zSql == uintptr(0) {
return 7
}
@@ -8366,7 +8618,7 @@ func idxBuildSampleTable(tls *crt.TLS, p uintptr, zTab uintptr) int32 { /* sqlit
// function populates sqlite_stat1 table in the same database.
//
// The stat1 data is generated by querying the
-func idxPopulateStat1(tls *crt.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1641:12: */
+func idxPopulateStat1(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1641:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -8411,13 +8663,13 @@ func idxPopulateStat1(tls *crt.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3
}()
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3.Xsqlite3_create_function(tls,
dbrem, ts+1628 /* "rem" */, 2, 1, pCtx, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{idxRemFunc})), uintptr(0), uintptr(0))
}
if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == 0 {
*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3.Xsqlite3_create_function(tls,
(*sqlite3expert)(unsafe.Pointer(p)).Fdb, ts+1632 /* "sample" */, 0, 1, bp+8 /* &samplectx */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{idxSampleFunc})), uintptr(0), uintptr(0))
}
@@ -8464,7 +8716,7 @@ func idxPopulateStat1(tls *crt.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3
sqlite3.Xsqlite3_free(tls, pCtx)
if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == 0 {
- *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbm, ts+1639 /* "ANALYZE sqlite_m..." */, uintptr(0), uintptr(0), uintptr(0))
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbm, ts+1639 /* "ANALYZE sqlite_s..." */, uintptr(0), uintptr(0), uintptr(0))
}
sqlite3.Xsqlite3_exec(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdb, ts+1244 /* "DROP TABLE IF EX..." */, uintptr(0), uintptr(0), uintptr(0))
@@ -8472,7 +8724,7 @@ func idxPopulateStat1(tls *crt.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3
}
// Allocate a new sqlite3expert object.
-func sqlite3_expert_new(tls *crt.TLS, db uintptr, pzErrmsg uintptr) uintptr { /* sqlite3expert.c:1738:15: */
+func sqlite3_expert_new(tls *libc.TLS, db uintptr, pzErrmsg uintptr) uintptr { /* sqlite3expert.c:1738:15: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -8494,7 +8746,7 @@ func sqlite3_expert_new(tls *crt.TLS, db uintptr, pzErrmsg uintptr) uintptr { /*
if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3.Xsqlite3_open(tls, ts+1661 /* ":memory:" */, (pNew + 16 /* &.dbm */))
if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
- sqlite3.Xsqlite3_db_config(tls, (*sqlite3expert)(unsafe.Pointer(pNew)).Fdbm, 1008, crt.VaList(bp, 1, uintptr(0)))
+ sqlite3.Xsqlite3_db_config(tls, (*sqlite3expert)(unsafe.Pointer(pNew)).Fdbm, 1008, libc.VaList(bp, 1, uintptr(0)))
}
}
@@ -8520,7 +8772,7 @@ func sqlite3_expert_new(tls *crt.TLS, db uintptr, pzErrmsg uintptr) uintptr { /*
// Register the auth callback with dbv
if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
sqlite3.Xsqlite3_set_authorizer(tls, (*sqlite3expert)(unsafe.Pointer(pNew)).Fdbv, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32
}{idxAuthCallback})), pNew)
}
@@ -8534,7 +8786,7 @@ func sqlite3_expert_new(tls *crt.TLS, db uintptr, pzErrmsg uintptr) uintptr { /*
}
// Configure an sqlite3expert object.
-func sqlite3_expert_config(tls *crt.TLS, p uintptr, op int32, va uintptr) int32 { /* sqlite3expert.c:1799:5: */
+func sqlite3_expert_config(tls *libc.TLS, p uintptr, op int32, va uintptr) int32 { /* sqlite3expert.c:1799:5: */
var rc int32 = 0
var ap va_list
_ = ap
@@ -8542,7 +8794,7 @@ func sqlite3_expert_config(tls *crt.TLS, p uintptr, op int32, va uintptr) int32
switch op {
case 1:
{
- var iVal int32 = int32(crt.VaInt32(&ap))
+ var iVal int32 = int32(libc.VaInt32(&ap))
if iVal < 0 {
iVal = 0
}
@@ -8562,7 +8814,7 @@ func sqlite3_expert_config(tls *crt.TLS, p uintptr, op int32, va uintptr) int32
}
// Add an SQL statement to the analysis.
-func sqlite3_expert_sql(tls *crt.TLS, p uintptr, zSql uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1823:5: */
+func sqlite3_expert_sql(tls *libc.TLS, p uintptr, zSql uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1823:5: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -8582,11 +8834,11 @@ func sqlite3_expert_sql(tls *crt.TLS, p uintptr, zSql uintptr, pzErr uintptr) in
if *(*uintptr)(unsafe.Pointer(bp /* pStmt */)) != 0 {
var pNew uintptr
var z uintptr = sqlite3.Xsqlite3_sql(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
- var n int32 = int32(crt.Xstrlen(tls, z))
+ var n int32 = int32(libc.Xstrlen(tls, z))
pNew = idxMalloc(tls, bp+16 /* &rc */, (int32((uint64(unsafe.Sizeof(IdxStatement{})) + uint64(n)) + uint64(1))))
if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
(*IdxStatement)(unsafe.Pointer(pNew)).FzSql = (pNew + uintptr(1)*40)
- crt.Xmemcpy(tls, (*IdxStatement)(unsafe.Pointer(pNew)).FzSql, z, (uint64(n + 1)))
+ libc.Xmemcpy(tls, (*IdxStatement)(unsafe.Pointer(pNew)).FzSql, z, (uint64(n + 1)))
(*IdxStatement)(unsafe.Pointer(pNew)).FpNext = (*sqlite3expert)(unsafe.Pointer(p)).FpStatement
if (*sqlite3expert)(unsafe.Pointer(p)).FpStatement != 0 {
(*IdxStatement)(unsafe.Pointer(pNew)).FiId = ((*IdxStatement)(unsafe.Pointer((*sqlite3expert)(unsafe.Pointer(p)).FpStatement)).FiId + 1)
@@ -8610,7 +8862,7 @@ func sqlite3_expert_sql(tls *crt.TLS, p uintptr, zSql uintptr, pzErr uintptr) in
return *(*int32)(unsafe.Pointer(bp + 16 /* rc */))
}
-func sqlite3_expert_analyze(tls *crt.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1868:5: */
+func sqlite3_expert_analyze(tls *libc.TLS, p uintptr, pzErr uintptr) int32 { /* sqlite3expert.c:1868:5: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -8634,7 +8886,7 @@ func sqlite3_expert_analyze(tls *crt.TLS, p uintptr, pzErr uintptr) int32 { /* s
// Formulate the EXPERT_REPORT_CANDIDATES text
for pEntry = (*sqlite3expert)(unsafe.Pointer(p)).FhIdx.FpFirst; pEntry != 0; pEntry = (*IdxHashEntry)(unsafe.Pointer(pEntry)).FpNext {
(*sqlite3expert)(unsafe.Pointer(p)).FzCandidates = idxAppendText(tls, bp+24 /* &rc */, (*sqlite3expert)(unsafe.Pointer(p)).FzCandidates,
- ts+1769 /* "%s;%s%s\n" */, crt.VaList(bp, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzVal,
+ ts+1769 /* "%s;%s%s\n" */, libc.VaList(bp, (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzVal,
func() uintptr {
if (*IdxHashEntry)(unsafe.Pointer(pEntry)).FzVal2 != 0 {
return ts + 1778 /* " -- stat1: " */
@@ -8657,7 +8909,7 @@ func sqlite3_expert_analyze(tls *crt.TLS, p uintptr, pzErr uintptr) int32 { /* s
// Return the total number of statements that have been added to this
// sqlite3expert using sqlite3_expert_sql().
-func sqlite3_expert_count(tls *crt.TLS, p uintptr) int32 { /* sqlite3expert.c:1909:5: */
+func sqlite3_expert_count(tls *libc.TLS, p uintptr) int32 { /* sqlite3expert.c:1909:5: */
var nRet int32 = 0
if (*sqlite3expert)(unsafe.Pointer(p)).FpStatement != 0 {
nRet = ((*IdxStatement)(unsafe.Pointer((*sqlite3expert)(unsafe.Pointer(p)).FpStatement)).FiId + 1)
@@ -8666,7 +8918,7 @@ func sqlite3_expert_count(tls *crt.TLS, p uintptr) int32 { /* sqlite3expert.c:19
}
// Return a component of the report.
-func sqlite3_expert_report(tls *crt.TLS, p uintptr, iStmt int32, eReport int32) uintptr { /* sqlite3expert.c:1918:12: */
+func sqlite3_expert_report(tls *libc.TLS, p uintptr, iStmt int32, eReport int32) uintptr { /* sqlite3expert.c:1918:12: */
var zRet uintptr = uintptr(0)
var pStmt uintptr
@@ -8699,7 +8951,7 @@ func sqlite3_expert_report(tls *crt.TLS, p uintptr, iStmt int32, eReport int32)
}
// Free an sqlite3expert object.
-func sqlite3_expert_destroy(tls *crt.TLS, p uintptr) { /* sqlite3expert.c:1944:6: */
+func sqlite3_expert_destroy(tls *libc.TLS, p uintptr) { /* sqlite3expert.c:1944:6: */
if p != 0 {
sqlite3.Xsqlite3_close(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbm)
sqlite3.Xsqlite3_close(tls, (*sqlite3expert)(unsafe.Pointer(p)).Fdbv)
@@ -9257,6 +9509,33 @@ type ClientData = uintptr /* tcl.h:340:15 */
type Tcl_WideInt = int64 /* tcl.h:415:28 */
type Tcl_WideUInt = uint64 /* tcl.h:416:36 */
+type stat = struct {
+ Fst_dev uint64
+ Fst_ino uint64
+ Fst_nlink uint64
+ Fst_mode uint32
+ Fst_uid uint32
+ Fst_gid uint32
+ F__pad0 int32
+ Fst_rdev uint64
+ Fst_size int64
+ Fst_blksize int64
+ Fst_blocks int64
+ Fst_atim struct {
+ Ftv_sec int64
+ Ftv_nsec int64
+ }
+ Fst_mtim struct {
+ Ftv_sec int64
+ Ftv_nsec int64
+ }
+ Fst_ctim struct {
+ Ftv_sec int64
+ Ftv_nsec int64
+ }
+ F__glibc_reserved [3]int64
+}
+
//----------------------------------------------------------------------------
// Data structures defined opaquely in this module. The definitions below just
// provide dummy types. A few fields are made visible in Tcl_Interp
@@ -11039,14 +11318,14 @@ type TclPlatStubs = TclPlatStubs1 /* tclPlatDecls.h:86:3 */
// Extract an sqlite3* db handle from the object passed as the second
// argument. If successful, set *pDb to point to the db handle and return
// TCL_OK. Otherwise, return TCL_ERROR.
-func dbHandleFromObj(tls *crt.TLS, interp uintptr, pObj uintptr, pDb uintptr) int32 { /* test_expert.c:36:12: */
+func dbHandleFromObj(tls *libc.TLS, interp uintptr, pObj uintptr, pDb uintptr) int32 { /* test_expert.c:36:12: */
bp := tls.Alloc(88)
defer tls.Free(88)
// var info Tcl_CmdInfo at bp+24, 64
if 0 == tcl.XTcl_GetCommandInfo(tls, interp, tcl.XTcl_GetString(tls, pObj), bp+24 /* &info */) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+1790 /* "no such handle: " */, tcl.XTcl_GetString(tls, pObj), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+1790 /* "no such handle: " */, tcl.XTcl_GetString(tls, pObj), 0))
return 1
}
@@ -11059,7 +11338,7 @@ func dbHandleFromObj(tls *crt.TLS, interp uintptr, pObj uintptr, pDb uintptr) in
// $expert count
// $expert report STMT EREPORT
// $expert destroy
-func testExpertCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_expert.c:55:26: */
+func testExpertCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_expert.c:55:26: */
bp := tls.Alloc(212)
defer tls.Free(212)
@@ -11156,13 +11435,13 @@ type Subcmd = struct {
FzMsg uintptr
}
-func testExpertDel(tls *crt.TLS, clientData uintptr) { /* test_expert.c:150:27: */
+func testExpertDel(tls *libc.TLS, clientData uintptr) { /* test_expert.c:150:27: */
var pExpert uintptr = clientData
sqlite3_expert_destroy(tls, pExpert)
}
// sqlite3_expert_new DB
-func test_sqlite3_expert_new(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_expert.c:158:26: */
+func test_sqlite3_expert_new(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_expert.c:158:26: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -11181,21 +11460,21 @@ func test_sqlite3_expert_new(tls *crt.TLS, clientData uintptr, interp uintptr, o
return 1
}
- zCmd = sqlite3.Xsqlite3_mprintf(tls, ts+1913 /* "sqlite3expert%d" */, crt.VaList(bp, crt.PreIncInt32(&iCmd, 1)))
+ zCmd = sqlite3.Xsqlite3_mprintf(tls, ts+1913 /* "sqlite3expert%d" */, libc.VaList(bp, libc.PreIncInt32(&iCmd, 1)))
if zCmd == uintptr(0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+8, ts+1929 /* "out of memory" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+8, ts+1929 /* "out of memory" */, uintptr(0)))
return 1
}
pExpert = sqlite3_expert_new(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* db */)), bp+48 /* &zErr */)
if pExpert == uintptr(0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+24, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErr */)), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErr */)), uintptr(0)))
rc = 1
} else {
var p uintptr = pExpert
tcl.XTcl_CreateObjCommand(tls, interp, zCmd, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{testExpertCmd})), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{testExpertDel})))
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{testExpertCmd})), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testExpertDel})))
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, zCmd, -1))
}
@@ -11206,48 +11485,2284 @@ func test_sqlite3_expert_new(tls *crt.TLS, clientData uintptr, interp uintptr, o
var iCmd int32 = 0 /* test_expert.c:164:14 */
-func TestExpert_Init(tls *crt.TLS, interp uintptr) int32 { /* test_expert.c:202:5: */
+func TestExpert_Init(tls *libc.TLS, interp uintptr) int32 { /* test_expert.c:202:5: */
bp := tls.Alloc(16)
defer tls.Free(16)
- *(*[1]Cmd)(unsafe.Pointer(bp /* aCmd */)) = [1]Cmd{
+ *(*[1]struct {
+ FzCmd uintptr
+ FxProc uintptr
+ })(unsafe.Pointer(bp /* aCmd */)) = [1]struct {
+ FzCmd uintptr
+ FxProc uintptr
+ }{
{FzCmd: ts + 1943 /* "sqlite3_expert_n..." */, FxProc: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_sqlite3_expert_new}))},
}
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof([1]Cmd{})) / uint64(unsafe.Sizeof(Cmd{}))); i++ {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof([1]struct {
+ FzCmd uintptr
+ FxProc uintptr
+ }{})) / uint64(unsafe.Sizeof(struct {
+ FzCmd uintptr
+ FxProc uintptr
+ }{}))); i++ {
var p uintptr = (bp /* &aCmd */ + uintptr(i)*16)
- tcl.XTcl_CreateObjCommand(tls, interp, (*Cmd)(unsafe.Pointer(p)).FzCmd, (*Cmd)(unsafe.Pointer(p)).FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, (*struct {
+ FzCmd uintptr
+ FxProc uintptr
+ })(unsafe.Pointer(p)).FzCmd, (*struct {
+ FzCmd uintptr
+ FxProc uintptr
+ })(unsafe.Pointer(p)).FxProc, uintptr(0), uintptr(0))
}
return 0
}
-type Cmd = struct {
- FzCmd uintptr
- FxProc uintptr
+// 2011 Jan 27
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// This file is not part of the production FTS code. It is only used for
+// testing. It contains a virtual table implementation that provides direct
+// access to the full-text index of an FTS table.
+
+// 2009 Nov 12
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+
+// FTS3/FTS4 require virtual tables
+
+// FTS4 is really an extension for FTS3. It is enabled using the
+// SQLITE_ENABLE_FTS3 macro. But to avoid confusion we also all
+// the SQLITE_ENABLE_FTS4 macro to serve as an alisse for SQLITE_ENABLE_FTS3.
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// ISO C99 Standard: 7.2 Diagnostics <assert.h>
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// void assert (int expression);
+//
+// If NDEBUG is defined, do nothing.
+// If not, and EXPRESSION is zero, print an error message and abort.
+
+// void assert_perror (int errnum);
+//
+// If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an
+// error message with the error text for ERRNUM and abort.
+// (This is a GNU extension.)
+
+// Decode a pointer to an sqlite3 object.
+func f5tDbPointer(tls *libc.TLS, interp uintptr, pObj uintptr, ppDb uintptr) int32 { /* fts5_tcl.c:52:12: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ var p uintptr
+ // var cmdInfo Tcl_CmdInfo at bp, 64
+
+ var z uintptr = tcl.XTcl_GetString(tls, pObj)
+ if tcl.XTcl_GetCommandInfo(tls, interp, z, bp /* &cmdInfo */) != 0 {
+ p = (*Tcl_CmdInfo)(unsafe.Pointer(bp /* &cmdInfo */)).FobjClientData
+ *(*uintptr)(unsafe.Pointer(ppDb)) = (*struct{ Fdb uintptr })(unsafe.Pointer(p)).Fdb
+ return 0
+ }
+ return 1
}
-// end block for C++
+// End of code that accesses the SqliteDb struct.
+//
-// Local Variables:
-// mode: c
-// c-basic-offset: 4
-// fill-column: 78
-// End:
+func f5tResultToErrorCode(tls *libc.TLS, zRes uintptr) int32 { /* fts5_tcl.c:67:12: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ *(*[4]ErrorCode)(unsafe.Pointer(bp /* aErr */)) = [4]ErrorCode{
+ {Frc: 101, FzError: ts + 1962 /* "SQLITE_DONE" */},
+ {Frc: 1, FzError: ts + 1974 /* "SQLITE_ERROR" */},
+ {Frc: 0, FzError: ts + 1987 /* "SQLITE_OK" */},
+ {Frc: 0, FzError: ts + 488 /* "" */},
+ }
+ var i int32
+
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof([4]ErrorCode{})) / uint64(unsafe.Sizeof(ErrorCode{}))); i++ {
+ if 0 == sqlite3.Xsqlite3_stricmp(tls, zRes, (*ErrorCode)(unsafe.Pointer(bp /* &aErr */ +uintptr(i)*16)).FzError) {
+ return (*ErrorCode)(unsafe.Pointer(bp /* &aErr */ + uintptr(i)*16)).Frc
+ }
+ }
+
+ return 1
+}
+
+type ErrorCode = struct {
+ Frc int32
+ FzError uintptr
+}
+
+func f5tDbAndApi(tls *libc.TLS, interp uintptr, pObj uintptr, ppDb uintptr, ppApi uintptr) int32 { /* fts5_tcl.c:88:26: */
+ bp := tls.Alloc(72)
+ defer tls.Free(72)
+
+ *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)) = uintptr(0)
+ var rc int32 = f5tDbPointer(tls, interp, pObj, bp+48 /* &db */)
+ if rc != 0 {
+ return 1
+ } else {
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 64 /* pApi */)) = uintptr(0)
+
+ rc = sqlite3.Xsqlite3_prepare_v2(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+1997 /* "SELECT fts5(?1)" */, -1, bp+56 /* &pStmt */, uintptr(0))
+ if rc != 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+2013 /* "error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */))), 0))
+ return 1
+ }
+ sqlite3.Xsqlite3_bind_pointer(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), 1, bp+64 /* &pApi */, ts+2021 /* "fts5_api_ptr" */, uintptr(0))
+ sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)))
+
+ if sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */))) != 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+2013 /* "error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */))), 0))
+ return 1
+ }
+
+ *(*uintptr)(unsafe.Pointer(ppDb)) = *(*uintptr)(unsafe.Pointer(bp + 48 /* db */))
+ *(*uintptr)(unsafe.Pointer(ppApi)) = *(*uintptr)(unsafe.Pointer(bp + 64 /* pApi */))
+ }
+
+ return 0
+}
+
+type F5tFunction1 = struct {
+ Finterp uintptr
+ FpScript uintptr
+}
+
+type F5tFunction = F5tFunction1 /* fts5_tcl.c:122:28 */
+
+type F5tApi1 = struct {
+ FpApi uintptr
+ FpFts uintptr
+}
+
+type F5tApi = F5tApi1 /* fts5_tcl.c:128:23 */
+
+// An object of this type is used with the xSetAuxdata() and xGetAuxdata()
+// API test wrappers. The tcl interface allows a single tcl value to be
+// saved using xSetAuxdata(). Instead of simply storing a pointer to the
+// tcl object, the code in this file wraps it in an sqlite3_malloc'd
+// instance of the following struct so that if the destructor is not
+// correctly invoked it will be reported as an SQLite memory leak.
+type F5tAuxData1 = struct{ FpObj uintptr }
+
+// An object of this type is used with the xSetAuxdata() and xGetAuxdata()
+// API test wrappers. The tcl interface allows a single tcl value to be
+// saved using xSetAuxdata(). Instead of simply storing a pointer to the
+// tcl object, the code in this file wraps it in an sqlite3_malloc'd
+// instance of the following struct so that if the destructor is not
+// correctly invoked it will be reported as an SQLite memory leak.
+type F5tAuxData = F5tAuxData1 /* fts5_tcl.c:142:27 */
+
+func xTokenizeCb(tls *libc.TLS, pCtx uintptr, tflags int32, zToken uintptr, nToken int32, iStart int32, iEnd int32) int32 { /* fts5_tcl.c:147:12: */
+ var p uintptr = pCtx
+ var pEval uintptr = tcl.XTcl_DuplicateObj(tls, (*F5tFunction)(unsafe.Pointer(p)).FpScript)
+ var rc int32
+
+ (*Tcl_Obj)(unsafe.Pointer(pEval)).FrefCount++
+ tcl.XTcl_ListObjAppendElement(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, pEval, tcl.XTcl_NewStringObj(tls, zToken, nToken))
+ tcl.XTcl_ListObjAppendElement(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, pEval, tcl.XTcl_NewIntObj(tls, iStart))
+ tcl.XTcl_ListObjAppendElement(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, pEval, tcl.XTcl_NewIntObj(tls, iEnd))
+
+ rc = tcl.XTcl_EvalObjEx(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, pEval, 0)
+ for ok := true; ok; ok = 0 != 0 {
+ var _objPtr uintptr = pEval
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+ if rc == 0 {
+ rc = f5tResultToErrorCode(tls, tcl.XTcl_GetStringResult(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp))
+ }
+
+ return rc
+}
+
+func xQueryPhraseCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr) int32 { /* fts5_tcl.c:173:12: */
+ bp := tls.Alloc(88)
+ defer tls.Free(88)
+
+ var p uintptr = pCtx
+ var pEval uintptr
+ var rc int32
+ // var zCmd [64]int8 at bp+8, 64
+
+ // var sApi F5tApi at bp+72, 16
+
+ (*F5tApi)(unsafe.Pointer(bp + 72 /* &sApi */)).FpApi = pApi
+ (*F5tApi)(unsafe.Pointer(bp + 72 /* &sApi */)).FpFts = pFts
+ libc.Xsprintf(tls, bp+8 /* &zCmd[0] */, ts+2034 /* "f5t_2_%lld" */, libc.VaList(bp, libc.PostIncInt64(&iCmd1, 1)))
+ tcl.XTcl_CreateObjCommand(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, bp+8 /* &zCmd[0] */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{xF5tApi})), bp+72 /* &sApi */, uintptr(0))
+
+ pEval = tcl.XTcl_DuplicateObj(tls, (*F5tFunction)(unsafe.Pointer(p)).FpScript)
+ (*Tcl_Obj)(unsafe.Pointer(pEval)).FrefCount++
+ tcl.XTcl_ListObjAppendElement(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, pEval, tcl.XTcl_NewStringObj(tls, bp+8 /* &zCmd[0] */, -1))
+ rc = tcl.XTcl_EvalObjEx(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, pEval, 0)
+ for ok := true; ok; ok = 0 != 0 {
+ var _objPtr uintptr = pEval
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+ tcl.XTcl_DeleteCommand(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, bp+8 /* &zCmd[0] */)
+
+ if rc == 0 {
+ rc = f5tResultToErrorCode(tls, tcl.XTcl_GetStringResult(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp))
+ }
+
+ return rc
+}
+
+var iCmd1 sqlite3_int64 = int64(0) /* fts5_tcl.c:179:24 */
+
+func xSetAuxdataDestructor(tls *libc.TLS, p uintptr) { /* fts5_tcl.c:205:13: */
+ var pData uintptr = p
+ for ok := true; ok; ok = 0 != 0 {
+ var _objPtr uintptr = (*F5tAuxData)(unsafe.Pointer(pData)).FpObj
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+ sqlite3.Xsqlite3_free(tls, pData)
+}
+
+// api sub-command...
+//
+// Description...
+func xF5tApi(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* fts5_tcl.c:216:26: */
+ bp := tls.Alloc(684)
+ defer tls.Free(684)
+
+ *(*[19]Sub)(unsafe.Pointer(bp + 32 /* aSub */)) = [19]Sub{
+ {FzName: ts + 2045 /* "xColumnCount" */, FnArg: 0, FzMsg: ts + 488 /* "" */}, // 0
+ {FzName: ts + 2058 /* "xRowCount" */, FnArg: 0, FzMsg: ts + 488 /* "" */}, // 1
+ {FzName: ts + 2068 /* "xColumnTotalSize" */, FnArg: 1, FzMsg: ts + 2085 /* "COL" */}, // 2
+ {FzName: ts + 2089 /* "xTokenize" */, FnArg: 2, FzMsg: ts + 2099 /* "TEXT SCRIPT" */}, // 3
+ {FzName: ts + 2111 /* "xPhraseCount" */, FnArg: 0, FzMsg: ts + 488 /* "" */}, // 4
+ {FzName: ts + 2124 /* "xPhraseSize" */, FnArg: 1, FzMsg: ts + 2136 /* "PHRASE" */}, // 5
+ {FzName: ts + 2143 /* "xInstCount" */, FnArg: 0, FzMsg: ts + 488 /* "" */}, // 6
+ {FzName: ts + 2154 /* "xInst" */, FnArg: 1, FzMsg: ts + 2160 /* "IDX" */}, // 7
+ {FzName: ts + 2164 /* "xRowid" */, FnArg: 0, FzMsg: ts + 488 /* "" */}, // 8
+ {FzName: ts + 2171 /* "xColumnText" */, FnArg: 1, FzMsg: ts + 2085 /* "COL" */}, // 9
+ {FzName: ts + 2183 /* "xColumnSize" */, FnArg: 1, FzMsg: ts + 2085 /* "COL" */}, // 10
+ {FzName: ts + 2195 /* "xQueryPhrase" */, FnArg: 2, FzMsg: ts + 2208 /* "PHRASE SCRIPT" */}, // 11
+ {FzName: ts + 2222 /* "xSetAuxdata" */, FnArg: 1, FzMsg: ts + 2234 /* "VALUE" */}, // 12
+ {FzName: ts + 2240 /* "xGetAuxdata" */, FnArg: 1, FzMsg: ts + 2252 /* "CLEAR" */}, // 13
+ {FzName: ts + 2258 /* "xSetAuxdataInt" */, FnArg: 1, FzMsg: ts + 2273 /* "INTEGER" */}, // 14
+ {FzName: ts + 2281 /* "xGetAuxdataInt" */, FnArg: 1, FzMsg: ts + 2252 /* "CLEAR" */}, // 15
+ {FzName: ts + 2296 /* "xPhraseForeach" */, FnArg: 4, FzMsg: ts + 2311 /* "IPHRASE COLVAR O..." */}, // 16
+ {FzName: ts + 2340 /* "xPhraseColumnFor..." */, FnArg: 3, FzMsg: ts + 2361 /* "IPHRASE COLVAR S..." */}, // 17
+ {FzName: uintptr(0), FnArg: 0, FzMsg: uintptr(0)},
+ }
+ var rc int32
+ *(*int32)(unsafe.Pointer(bp + 488 /* iSub */)) = 0
+ var p uintptr = clientData
+
+ if objc < 2 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2383 /* "SUB-COMMAND" */)
+ return 1
+ }
+
+ rc = tcl.XTcl_GetIndexFromObjStruct(tls,
+ interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+32 /* &aSub[0] */, int32(unsafe.Sizeof(Sub{})), ts+2383 /* "SUB-COMMAND" */, 0, bp+488 /* &iSub */)
+ if rc != 0 {
+ return rc
+ }
+ if (*Sub)(unsafe.Pointer(bp+32 /* &aSub */ +uintptr(*(*int32)(unsafe.Pointer(bp + 488 /* iSub */)))*24)).FnArg != (objc - 2) {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, (*Sub)(unsafe.Pointer(bp+32 /* &aSub */ +uintptr(*(*int32)(unsafe.Pointer(bp + 488 /* iSub */)))*24)).FzMsg)
+ return 1
+ }
+
+ switch *(*int32)(unsafe.Pointer(bp + 488 /* iSub */)) {
+ case 0:
+ {
+ var nCol int32
+ nCol = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 16 /* &.xColumnCount */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts)
+ if rc == 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, nCol))
+ }
+ break
+ }
+ case 1:
+ {
+ // var nRow sqlite3_int64 at bp+496, 8
+
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 24 /* &.xRowCount */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, bp+496 /* &nRow */)
+ if rc == 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewWideIntObj(tls, int64(*(*sqlite3_int64)(unsafe.Pointer(bp + 496 /* nRow */)))))
+ }
+ break
+ }
+ case 2:
+ {
+ // var iCol int32 at bp+504, 4
+
+ // var nSize sqlite3_int64 at bp+512, 8
+
+ if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+504 /* &iCol */) != 0 {
+ return 1
+ }
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 32 /* &.xColumnTotalSize */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, *(*int32)(unsafe.Pointer(bp + 504 /* iCol */)), bp+512 /* &nSize */)
+ if rc == 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewWideIntObj(tls, int64(*(*sqlite3_int64)(unsafe.Pointer(bp + 512 /* nSize */)))))
+ }
+ break
+ }
+ case 3:
+ {
+ // var nText int32 at bp+520, 4
+
+ var zText uintptr = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+520 /* &nText */)
+ // var ctx F5tFunction at bp+528, 16
+
+ (*F5tFunction)(unsafe.Pointer(bp + 528 /* &ctx */)).Finterp = interp
+ (*F5tFunction)(unsafe.Pointer(bp + 528 /* &ctx */)).FpScript = *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 40 /* &.xTokenize */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, zText, *(*int32)(unsafe.Pointer(bp + 520 /* nText */)), bp+528 /* &ctx */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{xTokenizeCb})))
+ if rc == 0 {
+ tcl.XTcl_ResetResult(tls, interp)
+ }
+ return rc
+ }
+ case 4:
+ {
+ var nPhrase int32
+ nPhrase = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 48 /* &.xPhraseCount */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts)
+ if rc == 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, nPhrase))
+ }
+ break
+ }
+ case 5:
+ {
+ // var iPhrase int32 at bp+544, 4
+
+ var sz int32
+ if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+544 /* &iPhrase */) != 0 {
+ return 1
+ }
+ sz = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 56 /* &.xPhraseSize */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, *(*int32)(unsafe.Pointer(bp + 544 /* iPhrase */)))
+ if rc == 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, sz))
+ }
+ break
+ }
+ case 6:
+ {
+ // var nInst int32 at bp+548, 4
+
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 64 /* &.xInstCount */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, bp+548 /* &nInst */)
+ if rc == 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 548 /* nInst */))))
+ }
+ break
+ }
+ case 7:
+ {
+ // var iIdx int32 at bp+552, 4
+
+ // var ip int32 at bp+556, 4
+
+ // var ic int32 at bp+560, 4
+
+ // var io int32 at bp+564, 4
+
+ if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+552 /* &iIdx */) != 0 {
+ return 1
+ }
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 72 /* &.xInst */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, *(*int32)(unsafe.Pointer(bp + 552 /* iIdx */)), bp+556 /* &ip */, bp+560 /* &ic */, bp+564 /* &io */)
+ if rc == 0 {
+ var pList uintptr = tcl.XTcl_NewObj(tls)
+ tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 556 /* ip */))))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 560 /* ic */))))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 564 /* io */))))
+ tcl.XTcl_SetObjResult(tls, interp, pList)
+ }
+ break
+ }
+ case 8:
+ {
+ var iRowid sqlite3_int64 = (*(*func(*libc.TLS, uintptr) sqlite3_int64)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 80 /* &.xRowid */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts)
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewWideIntObj(tls, int64(iRowid)))
+ break
+ }
+ case 9:
+ {
+ *(*uintptr)(unsafe.Pointer(bp + 576 /* z */)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 584 /* n */)) = 0
+ // var iCol int32 at bp+568, 4
+
+ if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+568 /* &iCol */) != 0 {
+ return 1
+ }
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 88 /* &.xColumnText */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, *(*int32)(unsafe.Pointer(bp + 568 /* iCol */)), bp+576 /* &z */, bp+584 /* &n */)
+ if rc == 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(bp + 576 /* z */)), *(*int32)(unsafe.Pointer(bp + 584 /* n */))))
+ }
+ break
+ }
+ case 10:
+ {
+ *(*int32)(unsafe.Pointer(bp + 592 /* n */)) = 0
+ // var iCol int32 at bp+588, 4
+
+ if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+588 /* &iCol */) != 0 {
+ return 1
+ }
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 96 /* &.xColumnSize */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, *(*int32)(unsafe.Pointer(bp + 588 /* iCol */)), bp+592 /* &n */)
+ if rc == 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 592 /* n */))))
+ }
+ break
+ }
+ case 11:
+ {
+ // var iPhrase int32 at bp+596, 4
+
+ // var ctx F5tFunction at bp+600, 16
+
+ if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+596 /* &iPhrase */) != 0 {
+ return 1
+ }
+ (*F5tFunction)(unsafe.Pointer(bp + 600 /* &ctx */)).Finterp = interp
+ (*F5tFunction)(unsafe.Pointer(bp + 600 /* &ctx */)).FpScript = *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8))
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 104 /* &.xQueryPhrase */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, *(*int32)(unsafe.Pointer(bp + 596 /* iPhrase */)), bp+600 /* &ctx */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr) int32
+ }{xQueryPhraseCb})))
+ if rc == 0 {
+ tcl.XTcl_ResetResult(tls, interp)
+ }
+ break
+ }
+ case 12:
+ {
+ var pData uintptr = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(F5tAuxData{})))
+ if pData == uintptr(0) {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+1929 /* "out of memory" */, 0))
+ return 1
+ }
+ (*F5tAuxData)(unsafe.Pointer(pData)).FpObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))
+ (*Tcl_Obj)(unsafe.Pointer((*F5tAuxData)(unsafe.Pointer(pData)).FpObj)).FrefCount++
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 112 /* &.xSetAuxdata */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, pData, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{xSetAuxdataDestructor})))
+ break
+ }
+ case 13:
+ {
+ var pData uintptr
+ // var bClear int32 at bp+616, 4
+
+ if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+616 /* &bClear */) != 0 {
+ return 1
+ }
+ pData = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 120 /* &.xGetAuxdata */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, *(*int32)(unsafe.Pointer(bp + 616 /* bClear */)))
+ if pData == uintptr(0) {
+ tcl.XTcl_ResetResult(tls, interp)
+ } else {
+ tcl.XTcl_SetObjResult(tls, interp, (*F5tAuxData)(unsafe.Pointer(pData)).FpObj)
+ if *(*int32)(unsafe.Pointer(bp + 616 /* bClear */)) != 0 {
+ xSetAuxdataDestructor(tls, pData)
+ }
+ }
+ break
+ }
+
+ // These two - xSetAuxdataInt and xGetAuxdataInt - are similar to the
+ // xSetAuxdata and xGetAuxdata methods implemented above. The difference
+ // is that they may only save an integer value as auxiliary data, and
+ // do not specify a destructor function.
+ case 14:
+ {
+ // var iVal int32 at bp+620, 4
+
+ if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+620 /* &iVal */) != 0 {
+ return 1
+ }
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 112 /* &.xSetAuxdata */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, (uintptr(0) + uintptr(*(*int32)(unsafe.Pointer(bp + 620 /* iVal */)))), uintptr(0))
+ break
+ }
+ case 15:
+ {
+ var iVal int32
+ // var bClear int32 at bp+624, 4
+
+ if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+624 /* &bClear */) != 0 {
+ return 1
+ }
+ iVal = (int32((int64((*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 120 /* &.xGetAuxdata */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, *(*int32)(unsafe.Pointer(bp + 624 /* bClear */)))) - int64(uintptr(0))) / 1))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, iVal))
+ break
+ }
+
+ case 16:
+ {
+ // var iPhrase int32 at bp+628, 4
+
+ // var iCol int32 at bp+648, 4
+
+ // var iOff int32 at bp+652, 4
+
+ var zColvar uintptr
+ var zOffvar uintptr
+ var pScript uintptr = *(*uintptr)(unsafe.Pointer(objv + uintptr(5)*8))
+ // var iter Fts5PhraseIter at bp+632, 16
+
+ if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+628 /* &iPhrase */) != 0 {
+ return 1
+ }
+ zColvar = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)))
+ zOffvar = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(4)*8)))
+
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 128 /* &.xPhraseFirst */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, *(*int32)(unsafe.Pointer(bp + 628 /* iPhrase */)), bp+632 /* &iter */, bp+648 /* &iCol */, bp+652 /* &iOff */)
+ if rc != 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ return 1
+ }
+ for ; *(*int32)(unsafe.Pointer(bp + 648 /* iCol */)) >= 0; (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 136 /* &.xPhraseNext */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, bp+632 /* &iter */, bp+648 /* &iCol */, bp+652 /* &iOff */) {
+ tcl.XTcl_SetVar2Ex(tls, interp, zColvar, uintptr(0), tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 648 /* iCol */))), 0)
+ tcl.XTcl_SetVar2Ex(tls, interp, zOffvar, uintptr(0), tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 652 /* iOff */))), 0)
+ rc = tcl.XTcl_EvalObjEx(tls, interp, pScript, 0)
+ if rc == 4 {
+ rc = 0
+ }
+ if rc != 0 {
+ if rc == 3 {
+ rc = 0
+ }
+ break
+ }
+ }
+
+ break
+ }
+
+ case 17:
+ {
+ // var iPhrase int32 at bp+656, 4
+
+ // var iCol int32 at bp+680, 4
+
+ var zColvar uintptr
+ var pScript uintptr = *(*uintptr)(unsafe.Pointer(objv + uintptr(4)*8))
+ // var iter Fts5PhraseIter at bp+664, 16
+
+ if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+656 /* &iPhrase */) != 0 {
+ return 1
+ }
+ zColvar = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)))
+
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 144 /* &.xPhraseFirstColumn */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, *(*int32)(unsafe.Pointer(bp + 656 /* iPhrase */)), bp+664 /* &iter */, bp+680 /* &iCol */)
+ if rc != 0 {
+ tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1))
+ return 1
+ }
+ for ; *(*int32)(unsafe.Pointer(bp + 680 /* iCol */)) >= 0; (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(((*F5tApi)(unsafe.Pointer(p)).FpApi + 152 /* &.xPhraseNextColumn */))))(tls, (*F5tApi)(unsafe.Pointer(p)).FpFts, bp+664 /* &iter */, bp+680 /* &iCol */) {
+ tcl.XTcl_SetVar2Ex(tls, interp, zColvar, uintptr(0), tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 680 /* iCol */))), 0)
+ rc = tcl.XTcl_EvalObjEx(tls, interp, pScript, 0)
+ if rc == 4 {
+ rc = 0
+ }
+ if rc != 0 {
+ if rc == 3 {
+ rc = 0
+ }
+ break
+ }
+ }
+
+ break
+ }
+
+ default:
+
+ break
+ }
+
+ if rc != 0 {
+ tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1))
+ return 1
+ }
+
+ return 0
+}
+
+type Sub = struct {
+ FzName uintptr
+ FnArg int32
+ FzMsg uintptr
+}
+
+func xF5tFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* fts5_tcl.c:515:13: */
+ bp := tls.Alloc(112)
+ defer tls.Free(112)
+
+ var p uintptr = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer((pApi + 8 /* &.xUserData */))))(tls, pFts)
+ var pEval uintptr // Script to evaluate
+ var i int32
+ var rc int32
+ // var zCmd [64]int8 at bp+8, 64
+
+ // var sApi F5tApi at bp+72, 16
+
+ (*F5tApi)(unsafe.Pointer(bp + 72 /* &sApi */)).FpApi = pApi
+ (*F5tApi)(unsafe.Pointer(bp + 72 /* &sApi */)).FpFts = pFts
+
+ libc.Xsprintf(tls, bp+8 /* &zCmd[0] */, ts+2395 /* "f5t_%lld" */, libc.VaList(bp, libc.PostIncInt64(&iCmd2, 1)))
+ tcl.XTcl_CreateObjCommand(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, bp+8 /* &zCmd[0] */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{xF5tApi})), bp+72 /* &sApi */, uintptr(0))
+ pEval = tcl.XTcl_DuplicateObj(tls, (*F5tFunction)(unsafe.Pointer(p)).FpScript)
+ (*Tcl_Obj)(unsafe.Pointer(pEval)).FrefCount++
+ tcl.XTcl_ListObjAppendElement(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, pEval, tcl.XTcl_NewStringObj(tls, bp+8 /* &zCmd[0] */, -1))
+
+ for i = 0; i < nVal; i++ {
+ var pObj uintptr = uintptr(0)
+ switch sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) {
+ case 3:
+ pObj = tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))), -1)
+ break
+ case 4:
+ pObj = tcl.XTcl_NewByteArrayObj(tls,
+ sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))), sqlite3.Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))))
+ break
+ case 1:
+ pObj = tcl.XTcl_NewWideIntObj(tls, int64(sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)))))
+ break
+ case 2:
+ pObj = tcl.XTcl_NewDoubleObj(tls, sqlite3.Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))))
+ break
+ default:
+ pObj = tcl.XTcl_NewObj(tls)
+ break
+ }
+ tcl.XTcl_ListObjAppendElement(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, pEval, pObj)
+ }
+
+ rc = tcl.XTcl_EvalObjEx(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, pEval, 1)
+ for ok := true; ok; ok = 0 != 0 {
+ var _objPtr uintptr = pEval
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+ tcl.XTcl_DeleteCommand(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp, bp+8 /* &zCmd[0] */)
+
+ if rc != 0 {
+ sqlite3.Xsqlite3_result_error(tls, pCtx, tcl.XTcl_GetStringResult(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp), -1)
+ } else {
+ var pVar uintptr = tcl.XTcl_GetObjResult(tls, (*F5tFunction)(unsafe.Pointer(p)).Finterp)
+ // var n int32 at bp+88, 4
+
+ var zType uintptr = func() uintptr {
+ if (*Tcl_Obj)(unsafe.Pointer(pVar)).FtypePtr != 0 {
+ return (*Tcl_ObjType)(unsafe.Pointer((*Tcl_Obj)(unsafe.Pointer(pVar)).FtypePtr)).Fname
+ }
+ return ts + 488 /* "" */
+ }()
+ var c int8 = *(*int8)(unsafe.Pointer(zType + uintptr(0)))
+ if ((int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2404 /* "bytearray" */) == 0)) && ((*Tcl_Obj)(unsafe.Pointer(pVar)).Fbytes == uintptr(0)) {
+ // Only return a BLOB type if the Tcl variable is a bytearray and
+ // has no string representation.
+ var data uintptr = tcl.XTcl_GetByteArrayFromObj(tls, pVar, bp+88 /* &n */)
+ sqlite3.Xsqlite3_result_blob(tls, pCtx, data, *(*int32)(unsafe.Pointer(bp + 88 /* n */)), libc.UintptrFromInt32(-1))
+ } else if (int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2414 /* "boolean" */) == 0) {
+ tcl.XTcl_GetIntFromObj(tls, uintptr(0), pVar, bp+88 /* &n */)
+ sqlite3.Xsqlite3_result_int(tls, pCtx, *(*int32)(unsafe.Pointer(bp + 88 /* n */)))
+ } else if (int32(c) == 'd') && (libc.Xstrcmp(tls, zType, ts+2422 /* "double" */) == 0) {
+ // var r float64 at bp+96, 8
+
+ tcl.XTcl_GetDoubleFromObj(tls, uintptr(0), pVar, bp+96 /* &r */)
+ sqlite3.Xsqlite3_result_double(tls, pCtx, *(*float64)(unsafe.Pointer(bp + 96 /* r */)))
+ } else if ((int32(c) == 'w') && (libc.Xstrcmp(tls, zType, ts+2429 /* "wideInt" */) == 0)) || ((int32(c) == 'i') && (libc.Xstrcmp(tls, zType, ts+2437 /* "int" */) == 0)) {
+ // var v Tcl_WideInt at bp+104, 8
+
+ tcl.XTcl_GetWideIntFromObj(tls, uintptr(0), pVar, bp+104 /* &v */)
+ sqlite3.Xsqlite3_result_int64(tls, pCtx, int64(*(*Tcl_WideInt)(unsafe.Pointer(bp + 104 /* v */))))
+ } else {
+ var data uintptr = tcl.XTcl_GetStringFromObj(tls, pVar, bp+88 /* &n */)
+ sqlite3.Xsqlite3_result_text(tls, pCtx, data, *(*int32)(unsafe.Pointer(bp + 88 /* n */)), libc.UintptrFromInt32(-1))
+ }
+ }
+}
+
+var iCmd2 sqlite3_int64 = int64(0) /* fts5_tcl.c:527:24 */
+
+func xF5tDestroy(tls *libc.TLS, pCtx uintptr) { /* fts5_tcl.c:598:13: */
+ var p uintptr = pCtx
+ for ok := true; ok; ok = 0 != 0 {
+ var _objPtr uintptr = (*F5tFunction)(unsafe.Pointer(p)).FpScript
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+ tcl.XTcl_Free(tls, p)
+}
+
+// sqlite3_fts5_create_function DB NAME SCRIPT
+//
+// Description...
+func f5tCreateFunction(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* fts5_tcl.c:609:26: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
+
+ var zName uintptr
+ var pScript uintptr
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* db */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 32 /* pApi */)) = uintptr(0)
+ var pCtx uintptr = uintptr(0)
+ var rc int32
+
+ if objc != 4 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2441 /* "DB NAME SCRIPT" */)
+ return 1
+ }
+ if f5tDbAndApi(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+24 /* &db */, bp+32 /* &pApi */) != 0 {
+ return 1
+ }
+
+ zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
+ pScript = *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8))
+ pCtx = tcl.XTcl_Alloc(tls, uint32(unsafe.Sizeof(F5tFunction{})))
+ (*F5tFunction)(unsafe.Pointer(pCtx)).Finterp = interp
+ (*F5tFunction)(unsafe.Pointer(pCtx)).FpScript = pScript
+ (*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++
+
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, fts5_extension_function, uintptr) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 32 /* pApi */)) + 24 /* &.xCreateFunction */))))(tls,
+ *(*uintptr)(unsafe.Pointer(bp + 32 /* pApi */)), zName, pCtx, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr)
+ }{xF5tFunction})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{xF5tDestroy})))
+ if rc != 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+2013 /* "error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* db */))), 0))
+ return 1
+ }
+
+ return 0
+}
+
+type F5tTokenizeCtx1 = struct {
+ FpRet uintptr
+ FbSubst int32
+ FzInput uintptr
+}
+
+type F5tTokenizeCtx = F5tTokenizeCtx1 /* fts5_tcl.c:646:31 */
+
+func xTokenizeCb2(tls *libc.TLS, pCtx uintptr, tflags int32, zToken uintptr, nToken int32, iStart int32, iEnd int32) int32 { /* fts5_tcl.c:653:12: */
+ var p uintptr = pCtx
+ if (*F5tTokenizeCtx)(unsafe.Pointer(p)).FbSubst != 0 {
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), (*F5tTokenizeCtx)(unsafe.Pointer(p)).FpRet, tcl.XTcl_NewStringObj(tls, zToken, nToken))
+ tcl.XTcl_ListObjAppendElement(tls,
+ uintptr(0), (*F5tTokenizeCtx)(unsafe.Pointer(p)).FpRet, tcl.XTcl_NewStringObj(tls, ((*F5tTokenizeCtx)(unsafe.Pointer(p)).FzInput+uintptr(iStart)), (iEnd-iStart)))
+ } else {
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), (*F5tTokenizeCtx)(unsafe.Pointer(p)).FpRet, tcl.XTcl_NewStringObj(tls, zToken, nToken))
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), (*F5tTokenizeCtx)(unsafe.Pointer(p)).FpRet, tcl.XTcl_NewIntObj(tls, iStart))
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), (*F5tTokenizeCtx)(unsafe.Pointer(p)).FpRet, tcl.XTcl_NewIntObj(tls, iEnd))
+ }
+ return 0
+}
+
+// sqlite3_fts5_tokenize DB TOKENIZER TEXT
+//
+// Description...
+func f5tTokenize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* fts5_tcl.c:679:26: */
+ bp := tls.Alloc(200)
+ defer tls.Free(200)
+
+ var zText uintptr
+ // var nText int32 at bp+128, 4
+
+ *(*uintptr)(unsafe.Pointer(bp + 96 /* db */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 104 /* pApi */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* pTok */)) = uintptr(0)
+ // var tokenizer fts5_tokenizer at bp+144, 24
+
+ var pRet uintptr = uintptr(0)
+ // var pUserdata uintptr at bp+136, 8
+
+ var rc int32
+ // var nArg int32 at bp+112, 4
+
+ // var azArg uintptr at bp+120, 8
+
+ // var ctx F5tTokenizeCtx at bp+176, 24
+
+ if (objc != 4) && (objc != 5) {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2456 /* "?-subst? DB NAME..." */)
+ return 1
+ }
+ if objc == 5 {
+ var zOpt uintptr = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
+ if libc.Xstrcmp(tls, ts+2478 /* "-subst" */, zOpt) != 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+2485 /* "unrecognized opt..." */, zOpt, 0))
+ return 1
+ }
+ }
+ if f5tDbAndApi(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((objc-3))*8)), bp+96 /* &db */, bp+104 /* &pApi */) != 0 {
+ return 1
+ }
+ if tcl.XTcl_SplitList(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr((objc-2))*8))), bp+112 /* &nArg */, bp+120 /* &azArg */) != 0 {
+ return 1
+ }
+ if *(*int32)(unsafe.Pointer(bp + 112 /* nArg */)) == 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+2507 /* "no such tokenize..." */, 0))
+ tcl.XTcl_Free(tls, *(*uintptr)(unsafe.Pointer(bp + 120 /* azArg */)))
+ return 1
+ }
+ zText = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr((objc-1))*8)), bp+128 /* &nText */)
+
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 104 /* pApi */)) + 16 /* &.xFindTokenizer */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 104 /* pApi */)), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 120 /* azArg */)) + uintptr(0)*8)), bp+136 /* &pUserdata */, bp+144 /* &tokenizer */)
+ if rc != 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+2507 /* "no such tokenize..." */, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 120 /* azArg */)) + uintptr(0)*8)), 0))
+ return 1
+ }
+
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((bp + 144 /* &tokenizer */ /* &.xCreate */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 136 /* pUserdata */)), (*(*uintptr)(unsafe.Pointer(bp + 120 /* azArg */)) + uintptr(1)*8), (*(*int32)(unsafe.Pointer(bp + 112 /* nArg */)) - 1), bp+168 /* &pTok */)
+ if rc != 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, ts+2527 /* "error in tokeniz..." */, 0))
+ return 1
+ }
+
+ pRet = tcl.XTcl_NewObj(tls)
+ (*Tcl_Obj)(unsafe.Pointer(pRet)).FrefCount++
+ (*F5tTokenizeCtx)(unsafe.Pointer(bp + 176 /* &ctx */)).FbSubst = (libc.Bool32(objc == 5))
+ (*F5tTokenizeCtx)(unsafe.Pointer(bp + 176 /* &ctx */)).FpRet = pRet
+ (*F5tTokenizeCtx)(unsafe.Pointer(bp + 176 /* &ctx */)).FzInput = zText
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer((bp + 144 /* &tokenizer */ + 16 /* &.xTokenize */))))(tls,
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* pTok */)), bp+176 /* &ctx */, 0x0004, zText, *(*int32)(unsafe.Pointer(bp + 128 /* nText */)), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{xTokenizeCb2})))
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((bp + 144 /* &tokenizer */ + 8 /* &.xDelete */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pTok */)))
+ if rc != 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+80, ts+2556 /* "error in tokeniz..." */, 0))
+ for ok := true; ok; ok = 0 != 0 {
+ var _objPtr uintptr = pRet
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+ return 1
+ }
+
+ tcl.XTcl_Free(tls, *(*uintptr)(unsafe.Pointer(bp + 120 /* azArg */)))
+ tcl.XTcl_SetObjResult(tls, interp, pRet)
+ for ok1 := true; ok1; ok1 = 0 != 0 {
+ var _objPtr uintptr = pRet
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+ return 0
+}
+
+// ************************************************************************
+//
+// Start of tokenizer wrapper.
+
+type F5tTokenizerContext1 = struct {
+ FpCtx uintptr
+ FxToken uintptr
+}
+
+// ************************************************************************
+//
+// Start of tokenizer wrapper.
+
+type F5tTokenizerContext = F5tTokenizerContext1 /* fts5_tcl.c:759:36 */
+type F5tTokenizerModule1 = struct {
+ Finterp uintptr
+ FpScript uintptr
+ FpContext uintptr
+}
+
+type F5tTokenizerModule = F5tTokenizerModule1 /* fts5_tcl.c:761:35 */
+type F5tTokenizerInstance1 = struct {
+ Finterp uintptr
+ FpScript uintptr
+ FpContext uintptr
+}
+
+type F5tTokenizerInstance = F5tTokenizerInstance1 /* fts5_tcl.c:762:37 */
+
+func f5tTokenizerCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* fts5_tcl.c:781:12: */
+ var pMod uintptr = pCtx
+ var pEval uintptr
+ var rc int32 = 0
+ var i int32
+
+ pEval = tcl.XTcl_DuplicateObj(tls, (*F5tTokenizerModule)(unsafe.Pointer(pMod)).FpScript)
+ (*Tcl_Obj)(unsafe.Pointer(pEval)).FrefCount++
+ for i = 0; (rc == 0) && (i < nArg); i++ {
+ var pObj uintptr = tcl.XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), -1)
+ rc = tcl.XTcl_ListObjAppendElement(tls, (*F5tTokenizerModule)(unsafe.Pointer(pMod)).Finterp, pEval, pObj)
+ }
+
+ if rc == 0 {
+ rc = tcl.XTcl_EvalObjEx(tls, (*F5tTokenizerModule)(unsafe.Pointer(pMod)).Finterp, pEval, 1)
+ }
+ for ok := true; ok; ok = 0 != 0 {
+ var _objPtr uintptr = pEval
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+
+ if rc == 0 {
+ var pInst uintptr
+ pInst = tcl.XTcl_Alloc(tls, uint32(unsafe.Sizeof(F5tTokenizerInstance{})))
+ libc.Xmemset(tls, pInst, 0, uint64(unsafe.Sizeof(F5tTokenizerInstance{})))
+ (*F5tTokenizerInstance)(unsafe.Pointer(pInst)).Finterp = (*F5tTokenizerModule)(unsafe.Pointer(pMod)).Finterp
+ (*F5tTokenizerInstance)(unsafe.Pointer(pInst)).FpScript = tcl.XTcl_GetObjResult(tls, (*F5tTokenizerModule)(unsafe.Pointer(pMod)).Finterp)
+ (*F5tTokenizerInstance)(unsafe.Pointer(pInst)).FpContext = (*F5tTokenizerModule)(unsafe.Pointer(pMod)).FpContext
+ (*Tcl_Obj)(unsafe.Pointer((*F5tTokenizerInstance)(unsafe.Pointer(pInst)).FpScript)).FrefCount++
+ *(*uintptr)(unsafe.Pointer(ppOut)) = pInst
+ }
+
+ return rc
+}
+
+func f5tTokenizerDelete(tls *libc.TLS, p uintptr) { /* fts5_tcl.c:819:13: */
+ var pInst uintptr = p
+ for ok := true; ok; ok = 0 != 0 {
+ var _objPtr uintptr = (*F5tTokenizerInstance)(unsafe.Pointer(pInst)).FpScript
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+ tcl.XTcl_Free(tls, pInst)
+}
+
+func f5tTokenizerTokenize(tls *libc.TLS, p uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, xToken uintptr) int32 { /* fts5_tcl.c:825:12: */
+ var pInst uintptr = p
+ var pOldCtx uintptr
+ var xOldToken uintptr
+ var pEval uintptr
+ var rc int32
+ var zFlags uintptr
+
+ pOldCtx = (*F5tTokenizerContext)(unsafe.Pointer((*F5tTokenizerInstance)(unsafe.Pointer(pInst)).FpContext)).FpCtx
+ xOldToken = (*F5tTokenizerContext)(unsafe.Pointer((*F5tTokenizerInstance)(unsafe.Pointer(pInst)).FpContext)).FxToken
+
+ (*F5tTokenizerContext)(unsafe.Pointer((*F5tTokenizerInstance)(unsafe.Pointer(pInst)).FpContext)).FpCtx = pCtx
+ (*F5tTokenizerContext)(unsafe.Pointer((*F5tTokenizerInstance)(unsafe.Pointer(pInst)).FpContext)).FxToken = xToken
+
+ pEval = tcl.XTcl_DuplicateObj(tls, (*F5tTokenizerInstance)(unsafe.Pointer(pInst)).FpScript)
+ (*Tcl_Obj)(unsafe.Pointer(pEval)).FrefCount++
+ switch flags {
+ case 0x0004:
+ zFlags = ts + 2587 /* "document" */
+ break
+ case 0x0008:
+ zFlags = ts + 2596 /* "aux" */
+ break
+ case 0x0001:
+ zFlags = ts + 2600 /* "query" */
+ break
+ case (0x0002 | 0x0001):
+ zFlags = ts + 2606 /* "prefixquery" */
+ break
+ default:
+
+ zFlags = ts + 2618 /* "invalid" */
+ break
+ }
+
+ tcl.XTcl_ListObjAppendElement(tls, (*F5tTokenizerInstance)(unsafe.Pointer(pInst)).Finterp, pEval, tcl.XTcl_NewStringObj(tls, zFlags, -1))
+ tcl.XTcl_ListObjAppendElement(tls, (*F5tTokenizerInstance)(unsafe.Pointer(pInst)).Finterp, pEval, tcl.XTcl_NewStringObj(tls, pText, nText))
+ rc = tcl.XTcl_EvalObjEx(tls, (*F5tTokenizerInstance)(unsafe.Pointer(pInst)).Finterp, pEval, 1)
+ for ok := true; ok; ok = 0 != 0 {
+ var _objPtr uintptr = pEval
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+
+ (*F5tTokenizerContext)(unsafe.Pointer((*F5tTokenizerInstance)(unsafe.Pointer(pInst)).FpContext)).FpCtx = pOldCtx
+ (*F5tTokenizerContext)(unsafe.Pointer((*F5tTokenizerInstance)(unsafe.Pointer(pInst)).FpContext)).FxToken = xOldToken
+ return rc
+}
+
+// sqlite3_fts5_token ?-colocated? TEXT START END
+func f5tTokenizerReturn(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* fts5_tcl.c:885:26: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ var p uintptr
+ // var iStart int32 at bp+24, 4
+
+ // var iEnd int32 at bp+28, 4
+
+ // var nToken int32 at bp+20, 4
+
+ var tflags int32
+ var zToken uintptr
+ var rc int32
+ // var nArg int32 at bp+16, 4
+
+ var zArg uintptr
+ p = clientData
+ tflags = 0
+
+ if !(objc == 5) {
+ goto __1
+ }
+ zArg = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+16 /* &nArg */)
+ if !(((*(*int32)(unsafe.Pointer(bp + 16 /* nArg */)) <= 10) && (*(*int32)(unsafe.Pointer(bp + 16 /* nArg */)) >= 2)) && (libc.Xmemcmp(tls, ts+2626 /* "-colocated" */, zArg, uint64(*(*int32)(unsafe.Pointer(bp + 16 /* nArg */)))) == 0)) {
+ goto __3
+ }
+ tflags = tflags | (0x0001)
+ goto __4
+__3:
+ goto usage
+__4:
+ ;
+ goto __2
+__1:
+ if !(objc != 4) {
+ goto __5
+ }
+ goto usage
+__5:
+ ;
+__2:
+ ;
+
+ zToken = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr((objc-3))*8)), bp+20 /* &nToken */)
+ if !((tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((objc-2))*8)), bp+24 /* &iStart */) != 0) ||
+ (tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((objc-1))*8)), bp+28 /* &iEnd */) != 0)) {
+ goto __6
+ }
+ return 1
+__6:
+ ;
+
+ if !((*F5tTokenizerContext)(unsafe.Pointer(p)).FxToken == uintptr(0)) {
+ goto __7
+ }
+ tcl.XTcl_AppendResult(tls, interp,
+ libc.VaList(bp, ts+2637 /* "sqlite3_fts5_tok..." */, 0))
+ return 1
+__7:
+ ;
+
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer((p + 8 /* &.xToken */))))(tls, (*F5tTokenizerContext)(unsafe.Pointer(p)).FpCtx, tflags, zToken, *(*int32)(unsafe.Pointer(bp + 20 /* nToken */)), *(*int32)(unsafe.Pointer(bp + 24 /* iStart */)), *(*int32)(unsafe.Pointer(bp + 28 /* iEnd */)))
+ tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1))
+ if rc == 0 {
+ return 0
+ }
+ return 1
+
+usage:
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2695 /* "?-colocated? TEX..." */)
+ return 1
+}
+
+func f5tDelTokenizer(tls *libc.TLS, pCtx uintptr) { /* fts5_tcl.c:934:13: */
+ var pMod uintptr = pCtx
+ for ok := true; ok; ok = 0 != 0 {
+ var _objPtr uintptr = (*F5tTokenizerModule)(unsafe.Pointer(pMod)).FpScript
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+ tcl.XTcl_Free(tls, pMod)
+}
+
+// sqlite3_fts5_create_tokenizer DB NAME SCRIPT
+//
+// Register a tokenizer named NAME implemented by script SCRIPT. When
+// a tokenizer instance is created (fts5_tokenizer.xCreate), any tokenizer
+// arguments are appended to SCRIPT and the result executed.
+//
+// The value returned by (SCRIPT + args) is itself a tcl script. This
+// script - call it SCRIPT2 - is executed to tokenize text using the
+// tokenizer instance "returned" by SCRIPT. Specifically, to tokenize
+// text SCRIPT2 is invoked with a single argument appended to it - the
+// text to tokenize.
+//
+// SCRIPT2 should invoke the [sqlite3_fts5_token] command once for each
+// token within the tokenized text.
+func f5tCreateTokenizer(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* fts5_tcl.c:956:26: */
+ bp := tls.Alloc(56)
+ defer tls.Free(56)
+
+ var pContext uintptr = clientData
+ // var db uintptr at bp+16, 8
+
+ // var pApi uintptr at bp+24, 8
+
+ var zName uintptr
+ var pScript uintptr
+ // var t fts5_tokenizer at bp+32, 24
+
+ var pMod uintptr
+ var rc int32
+
+ if objc != 4 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2441 /* "DB NAME SCRIPT" */)
+ return 1
+ }
+ if f5tDbAndApi(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+16 /* &db */, bp+24 /* &pApi */) != 0 {
+ return 1
+ }
+ zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
+ pScript = *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8))
+
+ (*fts5_tokenizer)(unsafe.Pointer(bp + 32 /* &t */)).FxCreate = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{f5tTokenizerCreate}))
+ (*fts5_tokenizer)(unsafe.Pointer(bp + 32 /* &t */)).FxTokenize = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
+ }{f5tTokenizerTokenize}))
+ (*fts5_tokenizer)(unsafe.Pointer(bp + 32 /* &t */)).FxDelete = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{f5tTokenizerDelete}))
+
+ pMod = tcl.XTcl_Alloc(tls, uint32(unsafe.Sizeof(F5tTokenizerModule{})))
+ (*F5tTokenizerModule)(unsafe.Pointer(pMod)).Finterp = interp
+ (*F5tTokenizerModule)(unsafe.Pointer(pMod)).FpScript = pScript
+ (*F5tTokenizerModule)(unsafe.Pointer(pMod)).FpContext = pContext
+ (*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 24 /* pApi */)) + 8 /* &.xCreateTokenizer */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pApi */)), zName, pMod, bp+32 /* &t */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{f5tDelTokenizer})))
+ if rc != 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+2723 /* "error in fts5_ap..." */, 0))
+ return 1
+ }
+
+ return 0
+}
+
+func xF5tFree(tls *libc.TLS, clientData ClientData) { /* fts5_tcl.c:999:27: */
+ tcl.XTcl_Free(tls, clientData)
+}
+
+// sqlite3_fts5_may_be_corrupt BOOLEAN
+//
+// Set or clear the global "may-be-corrupt" flag. Return the old value.
+func f5tMayBeCorrupt(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* fts5_tcl.c:1008:26: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var bOld int32 = sqlite3.Xsqlite3_fts5_may_be_corrupt
+
+ if (objc != 2) && (objc != 1) {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2760 /* "?BOOLEAN?" */)
+ return 1
+ }
+ if objc == 2 {
+ // var bNew int32 at bp, 4
+
+ if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &bNew */) != 0 {
+ return 1
+ }
+ sqlite3.Xsqlite3_fts5_may_be_corrupt = *(*int32)(unsafe.Pointer(bp /* bNew */))
+ }
+
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, bOld))
+ return 0
+}
+
+func f5t_fts5HashKey(tls *libc.TLS, nSlot int32, p uintptr, n int32) uint32 { /* fts5_tcl.c:1031:21: */
+ var i int32
+ var h uint32 = uint32(13)
+ for i = (n - 1); i >= 0; i-- {
+ h = (((h << 3) ^ h) ^ uint32(*(*int8)(unsafe.Pointer(p + uintptr(i)))))
+ }
+ return (h % uint32(nSlot))
+}
+
+func f5tTokenHash(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* fts5_tcl.c:1040:26: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var z uintptr
+ // var n int32 at bp+4, 4
+
+ var iVal uint32
+ // var nSlot int32 at bp, 4
+
+ if objc != 3 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2770 /* "NSLOT TOKEN" */)
+ return 1
+ }
+ if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &nSlot */) != 0 {
+ return 1
+ }
+ z = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+4 /* &n */)
+
+ iVal = f5t_fts5HashKey(tls, *(*int32)(unsafe.Pointer(bp /* nSlot */)), z, *(*int32)(unsafe.Pointer(bp + 4 /* n */)))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, int32(iVal)))
+ return 0
+}
+
+func f5tRegisterMatchinfo(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* fts5_tcl.c:1065:26: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32
+ *(*uintptr)(unsafe.Pointer(bp /* db */)) = uintptr(0)
+
+ if objc != 2 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */)
+ return 1
+ }
+ if f5tDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &db */) != 0 {
+ return 1
+ }
+
+ rc = sqlite3Fts5TestRegisterMatchinfo(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)))
+ if rc != 0 {
+ tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1))
+ return 1
+ }
+ return 0
+}
+
+func f5tRegisterTok(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* fts5_tcl.c:1090:26: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var rc int32
+ *(*uintptr)(unsafe.Pointer(bp /* db */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pApi */)) = uintptr(0)
+
+ if objc != 2 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */)
+ return 1
+ }
+ if f5tDbAndApi(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &db */, bp+8 /* &pApi */) != 0 {
+ return 1
+ }
+
+ rc = sqlite3Fts5TestRegisterTok(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), *(*uintptr)(unsafe.Pointer(bp + 8 /* pApi */)))
+ if rc != 0 {
+ tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1))
+ return 1
+ }
+ return 0
+}
+
+// Entry point.
+func Fts5tcl_Init(tls *libc.TLS, interp uintptr) int32 { /* fts5_tcl.c:1119:5: */
+ var i int32
+ var pContext uintptr
+
+ pContext = tcl.XTcl_Alloc(tls, uint32(unsafe.Sizeof(F5tTokenizerContext{})))
+ libc.Xmemset(tls, pContext, 0, uint64(unsafe.Sizeof(F5tTokenizerContext{})))
+
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd)) / uint64(unsafe.Sizeof(struct {
+ FzName uintptr
+ FxProc uintptr
+ FbTokenizeCtx int32
+ _ [4]byte
+ }{}))); i++ {
+ var p uintptr = (uintptr(unsafe.Pointer(&aCmd)) + uintptr(i)*24)
+ var pCtx uintptr = uintptr(0)
+ if (*struct {
+ FzName uintptr
+ FxProc uintptr
+ FbTokenizeCtx int32
+ _ [4]byte
+ })(unsafe.Pointer(p)).FbTokenizeCtx != 0 {
+ pCtx = pContext
+ }
+ tcl.XTcl_CreateObjCommand(tls, interp, (*struct {
+ FzName uintptr
+ FxProc uintptr
+ FbTokenizeCtx int32
+ _ [4]byte
+ })(unsafe.Pointer(p)).FzName, (*struct {
+ FzName uintptr
+ FxProc uintptr
+ FbTokenizeCtx int32
+ _ [4]byte
+ })(unsafe.Pointer(p)).FxProc, pCtx, func() uintptr {
+ if i != 0 {
+ return uintptr(0)
+ }
+ return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{xF5tFree}))
+ }())
+ }
+
+ return 0
+}
+
+var aCmd = [8]struct {
+ FzName uintptr
+ FxProc uintptr
+ FbTokenizeCtx int32
+ _ [4]byte
+}{
+ {FzName: ts + 2782 /* "sqlite3_fts5_cre..." */, FxProc: 0, FbTokenizeCtx: 1},
+ {FzName: ts + 2812 /* "sqlite3_fts5_tok..." */, FxProc: 0, FbTokenizeCtx: 1},
+ {FzName: ts + 2831 /* "sqlite3_fts5_tok..." */, FxProc: 0, FbTokenizeCtx: 0},
+ {FzName: ts + 2853 /* "sqlite3_fts5_cre..." */, FxProc: 0, FbTokenizeCtx: 0},
+ {FzName: ts + 2882 /* "sqlite3_fts5_may..." */, FxProc: 0, FbTokenizeCtx: 0},
+ {FzName: ts + 2910 /* "sqlite3_fts5_tok..." */, FxProc: 0, FbTokenizeCtx: 0},
+ {FzName: ts + 2934 /* "sqlite3_fts5_reg..." */, FxProc: 0, FbTokenizeCtx: 0},
+ {FzName: ts + 2966 /* "sqlite3_fts5_reg..." */, FxProc: 0, FbTokenizeCtx: 0},
+} /* fts5_tcl.c:1124:5 */
+
+type Fts5MatchinfoCtx1 = struct {
+ FnCol int32
+ FnPhrase int32
+ FzArg uintptr
+ FnRet int32
+ FaRet uintptr
+}
+
+type Fts5MatchinfoCtx = Fts5MatchinfoCtx1 /* fts5_test_mi.c:50:33 */
+
+type u32 = uint32 /* fts5_test_mi.c:53:22 */
+
+// Return a pointer to the fts5_api pointer for database connection db.
+// If an error occurs, return NULL and leave an error in the database
+// handle (accessible using sqlite3_errcode()/errmsg()).
+func fts5_api_from_db(tls *libc.TLS, db uintptr, ppApi uintptr) int32 { /* fts5_test_mi.c:71:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ *(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0)
+ var rc int32
+
+ *(*uintptr)(unsafe.Pointer(ppApi)) = uintptr(0)
+ rc = sqlite3.Xsqlite3_prepare(tls, db, ts+1997 /* "SELECT fts5(?1)" */, -1, bp /* &pStmt */, uintptr(0))
+ if rc == 0 {
+ sqlite3.Xsqlite3_bind_pointer(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 1, ppApi, ts+2021 /* "fts5_api_ptr" */, uintptr(0))
+ sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
+ rc = sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
+ }
+
+ return rc
+}
+
+// Argument f should be a flag accepted by matchinfo() (a valid character
+// in the string passed as the second argument). If it is not, -1 is
+// returned. Otherwise, if f is a valid matchinfo flag, the value returned
+// is the number of 32-bit integers added to the output array if the
+// table has nCol columns and the query nPhrase phrases.
+func fts5MatchinfoFlagsize(tls *libc.TLS, nCol int32, nPhrase int32, f int8) int32 { /* fts5_test_mi.c:94:12: */
+ var ret int32 = -1
+ switch int32(f) {
+ case 'p':
+ ret = 1
+ break
+ case 'c':
+ ret = 1
+ break
+ case 'x':
+ ret = ((3 * nCol) * nPhrase)
+ break
+ case 'y':
+ ret = (nCol * nPhrase)
+ break
+ case 'b':
+ ret = (((nCol + 31) / 32) * nPhrase)
+ break
+ case 'n':
+ ret = 1
+ break
+ case 'a':
+ ret = nCol
+ break
+ case 'l':
+ ret = nCol
+ break
+ case 's':
+ ret = nCol
+ break
+ }
+ return ret
+}
+
+func fts5MatchinfoIter(tls *libc.TLS, pApi uintptr, pFts uintptr, p uintptr, x uintptr) int32 { /* fts5_test_mi.c:110:12: */
+ var i int32
+ var n int32 = 0
+ var rc int32 = 0
+ var f int8
+ for i = 0; libc.AssignInt8(&f, *(*int8)(unsafe.Pointer((*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FzArg + uintptr(i)))) != 0; i++ {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int8, uintptr) int32)(unsafe.Pointer(&x)))(tls, pApi, pFts, p, f, ((*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FaRet + uintptr(n)*4))
+ if rc != 0 {
+ break
+ }
+ n = n + (fts5MatchinfoFlagsize(tls, (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnCol, (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnPhrase, f))
+ }
+ return rc
+}
+
+func fts5MatchinfoXCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pUserData uintptr) int32 { /* fts5_test_mi.c:128:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ // var iter Fts5PhraseIter at bp, 16
+
+ // var iCol int32 at bp+16, 4
+
+ // var iOff int32 at bp+20, 4
+
+ var aOut uintptr = pUserData
+ var iPrev int32 = -1
+
+ for (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 128 /* &.xPhraseFirst */))))(tls, pFts, 0, bp /* &iter */, bp+16 /* &iCol */, bp+20 /* &iOff */); *(*int32)(unsafe.Pointer(bp + 16 /* iCol */)) >= 0; (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer((pApi + 136 /* &.xPhraseNext */))))(tls, pFts, bp /* &iter */, bp+16 /* &iCol */, bp+20 /* &iOff */) {
+ *(*u32)(unsafe.Pointer(aOut + uintptr(((*(*int32)(unsafe.Pointer(bp + 16 /* iCol */))*3)+1))*4))++
+ if *(*int32)(unsafe.Pointer(bp + 16 /* iCol */)) != iPrev {
+ *(*u32)(unsafe.Pointer(aOut + uintptr(((*(*int32)(unsafe.Pointer(bp + 16 /* iCol */))*3)+2))*4))++
+ }
+ iPrev = *(*int32)(unsafe.Pointer(bp + 16 /* iCol */))
+ }
+
+ return 0
+}
+
+func fts5MatchinfoGlobalCb(tls *libc.TLS, pApi uintptr, pFts uintptr, p uintptr, f int8, aOut uintptr) int32 { /* fts5_test_mi.c:150:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var rc int32 = 0
+ switch int32(f) {
+ case 'p':
+ *(*u32)(unsafe.Pointer(aOut + uintptr(0)*4)) = u32((*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnPhrase)
+ break
+
+ case 'c':
+ *(*u32)(unsafe.Pointer(aOut + uintptr(0)*4)) = u32((*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnCol)
+ break
+
+ case 'x':
+ {
+ var i int32
+ for i = 0; (i < (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnPhrase) && (rc == 0); i++ {
+ var pPtr uintptr = (aOut + uintptr(((i*(*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnCol)*3))*4)
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 104 /* &.xQueryPhrase */))))(tls, pFts, i, pPtr, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr) int32
+ }{fts5MatchinfoXCb})))
+ }
+ break
+ }
+
+ case 'n':
+ {
+ // var nRow sqlite3_int64 at bp, 8
+
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 24 /* &.xRowCount */))))(tls, pFts, bp /* &nRow */)
+ *(*u32)(unsafe.Pointer(aOut + uintptr(0)*4)) = u32(*(*sqlite3_int64)(unsafe.Pointer(bp /* nRow */)))
+ break
+ }
+
+ case 'a':
+ {
+ *(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* nRow */)) = int64(0)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 24 /* &.xRowCount */))))(tls, pFts, bp+8 /* &nRow */)
+ if *(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* nRow */)) == int64(0) {
+ libc.Xmemset(tls, aOut, 0, (uint64(unsafe.Sizeof(u32(0))) * uint64((*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnCol)))
+ } else {
+ var i int32
+ for i = 0; (rc == 0) && (i < (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnCol); i++ {
+ // var nToken sqlite3_int64 at bp+16, 8
+
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pApi + 32 /* &.xColumnTotalSize */))))(tls, pFts, i, bp+16 /* &nToken */)
+ if rc == 0 {
+ *(*u32)(unsafe.Pointer(aOut + uintptr(i)*4)) = (u32(((int64(2) * *(*sqlite3_int64)(unsafe.Pointer(bp + 16 /* nToken */))) + *(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* nRow */))) / (int64(2) * *(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* nRow */)))))
+ }
+ }
+ }
+ break
+ }
+ }
+ return rc
+}
+
+func fts5MatchinfoLocalCb(tls *libc.TLS, pApi uintptr, pFts uintptr, p uintptr, f int8, aOut uintptr) int32 { /* fts5_test_mi.c:205:12: */
+ bp := tls.Alloc(80)
+ defer tls.Free(80)
+
+ var i int32
+ var rc int32 = 0
+
+ switch int32(f) {
+ case 'b':
+ {
+ var iPhrase int32
+ var nInt int32 = ((((*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnCol + 31) / 32) * (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnPhrase)
+ for i = 0; i < nInt; i++ {
+ *(*u32)(unsafe.Pointer(aOut + uintptr(i)*4)) = u32(0)
+ }
+
+ for iPhrase = 0; iPhrase < (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnPhrase; iPhrase++ {
+ // var iter Fts5PhraseIter at bp, 16
+
+ // var iCol int32 at bp+16, 4
+
+ for (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 144 /* &.xPhraseFirstColumn */))))(tls, pFts, iPhrase, bp /* &iter */, bp+16 /* &iCol */); *(*int32)(unsafe.Pointer(bp + 16 /* iCol */)) >= 0; (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pApi + 152 /* &.xPhraseNextColumn */))))(tls, pFts, bp /* &iter */, bp+16 /* &iCol */) {
+ *(*u32)(unsafe.Pointer(aOut + uintptr(((iPhrase*(((*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnCol+31)/32))+(*(*int32)(unsafe.Pointer(bp + 16 /* iCol */))/32)))*4)) |= (u32(u32(1)) << (*(*int32)(unsafe.Pointer(bp + 16 /* iCol */)) % 32))
+ }
+ }
+
+ break
+ }
+
+ case 'x':
+ fallthrough
+ case 'y':
+ {
+ var nMul int32 = func() int32 {
+ if int32(f) == 'x' {
+ return 3
+ }
+ return 1
+ }()
+ var iPhrase int32
+
+ for i = 0; i < ((*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnCol * (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnPhrase); i++ {
+ *(*u32)(unsafe.Pointer(aOut + uintptr((i*nMul))*4)) = u32(0)
+ }
+
+ for iPhrase = 0; iPhrase < (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnPhrase; iPhrase++ {
+ // var iter Fts5PhraseIter at bp+24, 16
+
+ // var iOff int32 at bp+44, 4
+
+ // var iCol int32 at bp+40, 4
+
+ for (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 128 /* &.xPhraseFirst */))))(tls, pFts, iPhrase, bp+24 /* &iter */, bp+40 /* &iCol */, bp+44 /* &iOff */); *(*int32)(unsafe.Pointer(bp + 44 /* iOff */)) >= 0; (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer((pApi + 136 /* &.xPhraseNext */))))(tls, pFts, bp+24 /* &iter */, bp+40 /* &iCol */, bp+44 /* &iOff */) {
+ *(*u32)(unsafe.Pointer(aOut + uintptr((nMul*(*(*int32)(unsafe.Pointer(bp + 40 /* iCol */))+(iPhrase*(*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnCol))))*4))++
+ }
+ }
+
+ break
+ }
+
+ case 'l':
+ {
+ for i = 0; (rc == 0) && (i < (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnCol); i++ {
+ // var nToken int32 at bp+48, 4
+
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pApi + 96 /* &.xColumnSize */))))(tls, pFts, i, bp+48 /* &nToken */)
+ *(*u32)(unsafe.Pointer(aOut + uintptr(i)*4)) = u32(*(*int32)(unsafe.Pointer(bp + 48 /* nToken */)))
+ }
+ break
+ }
+
+ case 's':
+ {
+ // var nInst int32 at bp+52, 4
+
+ libc.Xmemset(tls, aOut, 0, (uint64(unsafe.Sizeof(u32(0))) * uint64((*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnCol)))
+
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 64 /* &.xInstCount */))))(tls, pFts, bp+52 /* &nInst */)
+ for i = 0; (rc == 0) && (i < *(*int32)(unsafe.Pointer(bp + 52 /* nInst */))); i++ {
+ // var iPhrase int32 at bp+56, 4
+
+ // var iOff int32 at bp+64, 4
+
+ *(*int32)(unsafe.Pointer(bp + 60 /* iCol */)) = 0
+ var iNextPhrase int32
+ var iNextOff int32
+ var nSeq u32 = u32(1)
+ var j int32
+
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 72 /* &.xInst */))))(tls, pFts, i, bp+56 /* &iPhrase */, bp+60 /* &iCol */, bp+64 /* &iOff */)
+ iNextPhrase = (*(*int32)(unsafe.Pointer(bp + 56 /* iPhrase */)) + 1)
+ iNextOff = (*(*int32)(unsafe.Pointer(bp + 64 /* iOff */)) + (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pApi + 56 /* &.xPhraseSize */))))(tls, pFts, 0))
+ for j = (i + 1); (rc == 0) && (j < *(*int32)(unsafe.Pointer(bp + 52 /* nInst */))); j++ {
+ // var ip int32 at bp+68, 4
+
+ // var ic int32 at bp+72, 4
+
+ // var io int32 at bp+76, 4
+
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 72 /* &.xInst */))))(tls, pFts, j, bp+68 /* &ip */, bp+72 /* &ic */, bp+76 /* &io */)
+ if (*(*int32)(unsafe.Pointer(bp + 72 /* ic */)) != *(*int32)(unsafe.Pointer(bp + 60 /* iCol */))) || (*(*int32)(unsafe.Pointer(bp + 76 /* io */)) > iNextOff) {
+ break
+ }
+ if (*(*int32)(unsafe.Pointer(bp + 68 /* ip */)) == iNextPhrase) && (*(*int32)(unsafe.Pointer(bp + 76 /* io */)) == iNextOff) {
+ nSeq++
+ iNextPhrase = (*(*int32)(unsafe.Pointer(bp + 68 /* ip */)) + 1)
+ iNextOff = (*(*int32)(unsafe.Pointer(bp + 76 /* io */)) + (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pApi + 56 /* &.xPhraseSize */))))(tls, pFts, *(*int32)(unsafe.Pointer(bp + 68 /* ip */))))
+ }
+ }
+
+ if nSeq > *(*u32)(unsafe.Pointer(aOut + uintptr(*(*int32)(unsafe.Pointer(bp + 60 /* iCol */)))*4)) {
+ *(*u32)(unsafe.Pointer(aOut + uintptr(*(*int32)(unsafe.Pointer(bp + 60 /* iCol */)))*4)) = nSeq
+ }
+ }
+
+ break
+ }
+ }
+ return rc
+}
+
+func fts5MatchinfoNew(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, zArg uintptr) uintptr { /* fts5_test_mi.c:301:25: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var p uintptr
+ var nCol int32
+ var nPhrase int32
+ var i int32
+ var nInt int32
+ var nByte sqlite3_int64
+ var rc int32
+
+ nCol = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pApi + 16 /* &.xColumnCount */))))(tls, pFts)
+ nPhrase = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pApi + 48 /* &.xPhraseCount */))))(tls, pFts)
+
+ nInt = 0
+ for i = 0; *(*int8)(unsafe.Pointer(zArg + uintptr(i))) != 0; i++ {
+ var n int32 = fts5MatchinfoFlagsize(tls, nCol, nPhrase, *(*int8)(unsafe.Pointer(zArg + uintptr(i))))
+ if n < 0 {
+ var zErr uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+3001 /* "unrecognized mat..." */, libc.VaList(bp, int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i))))))
+ sqlite3.Xsqlite3_result_error(tls, pCtx, zErr, -1)
+ sqlite3.Xsqlite3_free(tls, zErr)
+ return uintptr(0)
+ }
+ nInt = nInt + (n)
+ }
+
+ nByte = (sqlite3_int64((uint64(unsafe.Sizeof(Fts5MatchinfoCtx{})) + // The struct itself
+ (uint64(unsafe.Sizeof(u32(0))) * uint64(nInt))) + // The p->aRet[] array
+ (uint64(i + 1)))) // The p->zArg string
+ p = sqlite3.Xsqlite3_malloc64(tls, uint64(nByte))
+ if p == uintptr(0) {
+ sqlite3.Xsqlite3_result_error_nomem(tls, pCtx)
+ return uintptr(0)
+ }
+ libc.Xmemset(tls, p, 0, uint64(nByte))
+
+ (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnCol = nCol
+ (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnPhrase = nPhrase
+ (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FaRet = (p + uintptr(1)*32)
+ (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnRet = nInt
+ (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FzArg = ((*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FaRet + uintptr(nInt)*4)
+ libc.Xmemcpy(tls, (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FzArg, zArg, uint64(i))
+
+ rc = fts5MatchinfoIter(tls, pApi, pFts, p, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int8, uintptr) int32
+ }{fts5MatchinfoGlobalCb})))
+ if rc != 0 {
+ sqlite3.Xsqlite3_result_error_code(tls, pCtx, rc)
+ sqlite3.Xsqlite3_free(tls, p)
+ p = uintptr(0)
+ }
+
+ return p
+}
+
+func fts5MatchinfoFunc(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* fts5_test_mi.c:357:13: */
+ var zArg uintptr
+ var p uintptr
+ var rc int32 = 0
+
+ if nVal > 0 {
+ zArg = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
+ } else {
+ zArg = ts + 3033 /* "pcx" */
+ }
-func Fts5tcl_Init(tls *crt.TLS, interp uintptr) int32 { /* fts5_tcl.c:1150:5: */
+ p = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer((pApi + 120 /* &.xGetAuxdata */))))(tls, pFts, 0)
+ if (p == uintptr(0)) || (sqlite3.Xsqlite3_stricmp(tls, zArg, (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FzArg) != 0) {
+ p = fts5MatchinfoNew(tls, pApi, pFts, pCtx, zArg)
+ if p == uintptr(0) {
+ rc = 7
+ } else {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 112 /* &.xSetAuxdata */))))(tls, pFts, p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ }
+ }
+
+ if rc == 0 {
+ rc = fts5MatchinfoIter(tls, pApi, pFts, p, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int8, uintptr) int32
+ }{fts5MatchinfoLocalCb})))
+ }
+ if rc != 0 {
+ sqlite3.Xsqlite3_result_error_code(tls, pCtx, rc)
+ } else {
+ // No errors has occured, so return a copy of the array of integers.
+ var nByte int32 = (int32(uint64((*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FnRet) * uint64(unsafe.Sizeof(u32(0)))))
+ sqlite3.Xsqlite3_result_blob(tls, pCtx, (*Fts5MatchinfoCtx)(unsafe.Pointer(p)).FaRet, nByte, libc.UintptrFromInt32(-1))
+ }
+}
+
+func sqlite3Fts5TestRegisterMatchinfo(tls *libc.TLS, db uintptr) int32 { /* fts5_test_mi.c:396:5: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 // Return code
+ // var pApi uintptr at bp, 8
+ // FTS5 API functions
+
+ // Extract the FTS5 API pointer from the database handle. The
+ // fts5_api_from_db() function above is copied verbatim from the
+ // FTS5 documentation. Refer there for details.
+ rc = fts5_api_from_db(tls, db, bp /* &pApi */)
+ if rc != 0 {
+ return rc
+ }
+
+ /* If fts5_api_from_db() returns NULL, then either FTS5 is not registered
+ ** with this database handle, or an error (OOM perhaps?) has occurred.
+ **
+ ** Also check that the fts5_api object is version 2 or newer.
+ */
+ if (*(*uintptr)(unsafe.Pointer(bp /* pApi */)) == uintptr(0)) || ((*fts5_api)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pApi */)))).FiVersion < 2) {
+ return 1
+ }
+
+ // Register the implementation of matchinfo()
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, fts5_extension_function, uintptr) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pApi */)) + 24 /* &.xCreateFunction */))))(tls, *(*uintptr)(unsafe.Pointer(bp /* pApi */)), ts+3037 /* "matchinfo" */, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr)
+ }{fts5MatchinfoFunc})), uintptr(0))
+
+ return rc
+}
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// ISO C99 Standard: 7.2 Diagnostics <assert.h>
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// void assert (int expression);
+//
+// If NDEBUG is defined, do nothing.
+// If not, and EXPRESSION is zero, print an error message and abort.
+
+// void assert_perror (int errnum);
+//
+// If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an
+// error message with the error text for ERRNUM and abort.
+// (This is a GNU extension.)
+
+type Fts5tokTable1 = struct {
+ Fbase sqlite3_vtab
+ Ftok fts5_tokenizer
+ FpTok uintptr
+}
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// ISO C99 Standard: 7.2 Diagnostics <assert.h>
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// void assert (int expression);
+//
+// If NDEBUG is defined, do nothing.
+// If not, and EXPRESSION is zero, print an error message and abort.
+
+// void assert_perror (int errnum);
+//
+// If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an
+// error message with the error text for ERRNUM and abort.
+// (This is a GNU extension.)
+
+type Fts5tokTable = Fts5tokTable1 /* fts5_test_tok.c:47:29 */
+type Fts5tokCursor1 = struct {
+ Fbase sqlite3_vtab_cursor
+ FiRowid int32
+ FzInput uintptr
+ FnRow int32
+ FaRow uintptr
+}
+
+type Fts5tokCursor = Fts5tokCursor1 /* fts5_test_tok.c:48:30 */
+type Fts5tokRow1 = struct {
+ FzToken uintptr
+ FiStart int32
+ FiEnd int32
+ FiPos int32
+ _ [4]byte
+}
+
+type Fts5tokRow = Fts5tokRow1 /* fts5_test_tok.c:49:27 */
+
+func fts5tokDequote(tls *libc.TLS, z uintptr) { /* fts5_test_tok.c:81:13: */
+ var q int8 = *(*int8)(unsafe.Pointer(z + uintptr(0)))
+
+ if (((int32(q) == '[') || (int32(q) == '\'')) || (int32(q) == '"')) || (int32(q) == '`') {
+ var iIn int32 = 1
+ var iOut int32 = 0
+ if int32(q) == '[' {
+ 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 + 1))))) != int32(q) {
+ // Character iIn was the close quote.
+ iIn++
+ break
+ } else {
+ // Character iIn and iIn+1 form an escaped quote character. Skip
+ // the input cursor past both and copy a single quote character
+ // to the output buffer.
+ iIn = iIn + (2)
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = q
+ }
+ } else {
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iIn, 1))))
+ }
+ }
+
+ *(*int8)(unsafe.Pointer(z + uintptr(iOut))) = int8(0)
+ }
+}
+
+// The second argument, argv[], is an array of pointers to nul-terminated
+// strings. This function makes a copy of the array and strings into a
+// single block of memory. It then dequotes any of the strings that appear
+// to be quoted.
+//
+// If successful, output parameter *pazDequote is set to point at the
+// array of dequoted strings and SQLITE_OK is returned. The caller is
+// responsible for eventually calling sqlite3_free() to free the array
+// in this case. Or, if an error occurs, an SQLite error code is returned.
+// The final value of *pazDequote is undefined in this case.
+func fts5tokDequoteArray(tls *libc.TLS, argc int32, argv uintptr, pazDequote uintptr) int32 { /* fts5_test_tok.c:123:12: */
+ var rc int32 = 0 // Return code
+ if argc == 0 {
+ *(*uintptr)(unsafe.Pointer(pazDequote)) = uintptr(0)
+ } else {
+ var i int32
+ var nByte int32 = 0
+ var azDequote uintptr
+
+ for i = 0; i < argc; i++ {
+ nByte = nByte + (int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) + uint64(1)))
+ }
+
+ *(*uintptr)(unsafe.Pointer(pazDequote)) = libc.AssignUintptr(&azDequote, sqlite3.Xsqlite3_malloc64(tls, (uint64((uint64(unsafe.Sizeof(uintptr(0)))*uint64(argc))+uint64(nByte)))))
+ if azDequote == uintptr(0) {
+ rc = 7
+ } else {
+ var pSpace uintptr = (azDequote + uintptr(argc)*8)
+ for i = 0; i < argc; i++ {
+ var n int32 = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ *(*uintptr)(unsafe.Pointer(azDequote + uintptr(i)*8)) = pSpace
+ libc.Xmemcpy(tls, pSpace, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), (uint64(n + 1)))
+ fts5tokDequote(tls, pSpace)
+ pSpace += (uintptr(n + 1))
+ }
+ }
+ }
+
+ return rc
+}
+
+// Schema of the tokenizer table.
+
+// This function does all the work for both the xConnect and xCreate methods.
+// These tables have no persistent representation of their own, so xConnect
+// and xCreate are identical operations.
+//
+// argv[0]: module name
+// argv[1]: database name
+// argv[2]: table name
+// argv[3]: first argument (tokenizer name)
+func fts5tokConnectMethod(tls *libc.TLS, db uintptr, pCtx uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* fts5_test_tok.c:173:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var pApi uintptr = pCtx
+ var pTab uintptr = uintptr(0)
+ var rc int32
+ *(*uintptr)(unsafe.Pointer(bp /* azDequote */)) = uintptr(0)
+ var nDequote int32 = 0
+
+ rc = sqlite3.Xsqlite3_declare_vtab(tls, db,
+ ts+3047 /* "CREATE TABLE x(i..." */)
+
+ if rc == 0 {
+ nDequote = (argc - 3)
+ rc = fts5tokDequoteArray(tls, nDequote, (argv + uintptr(3)*8), bp /* &azDequote */)
+ }
+
+ if rc == 0 {
+ pTab = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Fts5tokTable{})))
+ if pTab == uintptr(0) {
+ rc = 7
+ } else {
+ libc.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(Fts5tokTable{})))
+ }
+ }
+
+ if rc == 0 {
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pTokCtx */)) = uintptr(0)
+ var zModule uintptr = uintptr(0)
+ if nDequote > 0 {
+ zModule = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* azDequote */)) + uintptr(0)*8))
+ }
+
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 16 /* &.xFindTokenizer */))))(tls, pApi, zModule, bp+8 /* &pTokCtx */, (pTab + 24 /* &.tok */))
+ if rc == 0 {
+ var azArg uintptr = (*(*uintptr)(unsafe.Pointer(bp /* azDequote */)) + uintptr(1)*8)
+ var nArg int32
+ if nDequote > 0 {
+ nArg = (nDequote - 1)
+ } else {
+ nArg = 0
+ }
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pTab + 24 /* &.tok */ /* &.xCreate */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pTokCtx */)), azArg, nArg, (pTab + 48 /* &.pTok */))
+ }
+ }
+
+ if rc != 0 {
+ sqlite3.Xsqlite3_free(tls, pTab)
+ pTab = uintptr(0)
+ }
+
+ *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab
+ sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp /* azDequote */)))
+ return rc
+}
+
+// This function does the work for both the xDisconnect and xDestroy methods.
+// These tables have no persistent representation of their own, so xDisconnect
+// and xDestroy are identical operations.
+func fts5tokDisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* fts5_test_tok.c:235:12: */
+ var pTab uintptr = pVtab
+ if (*Fts5tokTable)(unsafe.Pointer(pTab)).FpTok != 0 {
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pTab + 24 /* &.tok */ + 8 /* &.xDelete */))))(tls, (*Fts5tokTable)(unsafe.Pointer(pTab)).FpTok)
+ }
+ sqlite3.Xsqlite3_free(tls, pTab)
+ return 0
+}
+
+// xBestIndex - Analyze a WHERE and ORDER BY clause.
+func fts5tokBestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* fts5_test_tok.c:247:12: */
+ var i int32
+
+ for i = 0; i < (*sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint; i++ {
+ if (((*sqlite3_index_constraint)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint+uintptr(i)*12)).Fusable != 0) &&
+ ((*sqlite3_index_constraint)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint+uintptr(i)*12)).FiColumn == 0)) &&
+ (int32((*sqlite3_index_constraint)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint+uintptr(i)*12)).Fop) == 2) {
+ (*sqlite3_index_info)(unsafe.Pointer(pInfo)).FidxNum = 1
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = 1
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1)
+ (*sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = float64(1)
+ return 0
+ }
+ }
+
+ (*sqlite3_index_info)(unsafe.Pointer(pInfo)).FidxNum = 0
+
+ return 0
+}
+
+// xOpen - Open a cursor.
+func fts5tokOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* fts5_test_tok.c:275:12: */
+ var pCsr uintptr
+
+ pCsr = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Fts5tokCursor{})))
+ if pCsr == uintptr(0) {
+ return 7
+ }
+ libc.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(Fts5tokCursor{})))
+
+ *(*uintptr)(unsafe.Pointer(ppCsr)) = pCsr
+ return 0
+}
+
+// Reset the tokenizer cursor passed as the only argument. As if it had
+// just been returned by fts5tokOpenMethod().
+func fts5tokResetCursor(tls *libc.TLS, pCsr uintptr) { /* fts5_test_tok.c:292:13: */
+ var i int32
+ for i = 0; i < (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FnRow; i++ {
+ sqlite3.Xsqlite3_free(tls, (*Fts5tokRow)(unsafe.Pointer((*Fts5tokCursor)(unsafe.Pointer(pCsr)).FaRow+uintptr(i)*24)).FzToken)
+ }
+ sqlite3.Xsqlite3_free(tls, (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FzInput)
+ sqlite3.Xsqlite3_free(tls, (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FaRow)
+ (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FzInput = uintptr(0)
+ (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FaRow = uintptr(0)
+ (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FnRow = 0
+ (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FiRowid = 0
+}
+
+// xClose - Close a cursor.
+func fts5tokCloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* fts5_test_tok.c:308:12: */
+ var pCsr uintptr = pCursor
+ fts5tokResetCursor(tls, pCsr)
+ sqlite3.Xsqlite3_free(tls, pCsr)
+ return 0
+}
+
+// xNext - Advance the cursor to the next row, if any.
+func fts5tokNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* fts5_test_tok.c:318:12: */
+ var pCsr uintptr = pCursor
+ (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FiRowid++
return 0
}
+func fts5tokCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iStart int32, iEnd int32) int32 { /* fts5_test_tok.c:324:12: */
+ var pCsr uintptr = pCtx
+ var pRow uintptr
+
+ if ((*Fts5tokCursor)(unsafe.Pointer(pCsr)).FnRow & ((*Fts5tokCursor)(unsafe.Pointer(pCsr)).FnRow - 1)) == 0 {
+ var nNew int32
+ if (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FnRow != 0 {
+ nNew = ((*Fts5tokCursor)(unsafe.Pointer(pCsr)).FnRow * 2)
+ } else {
+ nNew = 32
+ }
+ var aNew uintptr
+ aNew = sqlite3.Xsqlite3_realloc64(tls, (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FaRow, (uint64(uint64(nNew) * uint64(unsafe.Sizeof(Fts5tokRow{})))))
+ if aNew == uintptr(0) {
+ return 7
+ }
+ libc.Xmemset(tls, (aNew + uintptr((*Fts5tokCursor)(unsafe.Pointer(pCsr)).FnRow)*24), 0, (uint64(unsafe.Sizeof(Fts5tokRow{})) * (uint64(nNew - (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FnRow))))
+ (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FaRow = aNew
+ }
+
+ pRow = ((*Fts5tokCursor)(unsafe.Pointer(pCsr)).FaRow + uintptr((*Fts5tokCursor)(unsafe.Pointer(pCsr)).FnRow)*24)
+ (*Fts5tokRow)(unsafe.Pointer(pRow)).FiStart = iStart
+ (*Fts5tokRow)(unsafe.Pointer(pRow)).FiEnd = iEnd
+ if (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FnRow != 0 {
+ (*Fts5tokRow)(unsafe.Pointer(pRow)).FiPos = ((*Fts5tokRow)(unsafe.Pointer(pRow+libc.UintptrFromInt32(-1)*24)).FiPos + (func() int32 {
+ if (tflags & 0x0001) != 0 {
+ return 0
+ }
+ return 1
+ }()))
+ }
+ (*Fts5tokRow)(unsafe.Pointer(pRow)).FzToken = sqlite3.Xsqlite3_malloc(tls, (nToken + 1))
+ if (*Fts5tokRow)(unsafe.Pointer(pRow)).FzToken == uintptr(0) {
+ return 7
+ }
+ libc.Xmemcpy(tls, (*Fts5tokRow)(unsafe.Pointer(pRow)).FzToken, pToken, uint64(nToken))
+ *(*int8)(unsafe.Pointer((*Fts5tokRow)(unsafe.Pointer(pRow)).FzToken + uintptr(nToken))) = int8(0)
+ (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FnRow++
+
+ return 0
+}
+
+// xFilter - Initialize a cursor to point at the start of its data.
+func fts5tokFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, nVal int32, apVal uintptr) int32 { /* fts5_test_tok.c:362:12: */
+ var rc int32 = 1
+ var pCsr uintptr = pCursor
+ var pTab uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
+
+ fts5tokResetCursor(tls, pCsr)
+ if idxNum == 1 {
+ var zByte uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
+ var nByte int32 = sqlite3.Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
+ (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FzInput = sqlite3.Xsqlite3_malloc(tls, (nByte + 1))
+ if (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FzInput == uintptr(0) {
+ rc = 7
+ } else {
+ if nByte > 0 {
+ libc.Xmemcpy(tls, (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FzInput, zByte, uint64(nByte))
+ }
+ *(*int8)(unsafe.Pointer((*Fts5tokCursor)(unsafe.Pointer(pCsr)).FzInput + uintptr(nByte))) = int8(0)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer((pTab + 24 /* &.tok */ + 16 /* &.xTokenize */))))(tls,
+ (*Fts5tokTable)(unsafe.Pointer(pTab)).FpTok, pCsr, 0, zByte, nByte, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{fts5tokCb})))
+ }
+ }
+
+ if rc != 0 {
+ return rc
+ }
+ return fts5tokNextMethod(tls, pCursor)
+}
+
+// xEof - Return true if the cursor is at EOF, or false otherwise.
+func fts5tokEofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* fts5_test_tok.c:396:12: */
+ var pCsr uintptr = pCursor
+ return (libc.Bool32((*Fts5tokCursor)(unsafe.Pointer(pCsr)).FiRowid > (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FnRow))
+}
+
+// xColumn - Return a column value.
+func fts5tokColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* fts5_test_tok.c:404:12: */
+ var pCsr uintptr = pCursor
+ var pRow uintptr = ((*Fts5tokCursor)(unsafe.Pointer(pCsr)).FaRow + uintptr(((*Fts5tokCursor)(unsafe.Pointer(pCsr)).FiRowid-1))*24)
+
+ // CREATE TABLE x(input, token, start, end, position)
+ switch iCol {
+ case 0:
+ sqlite3.Xsqlite3_result_text(tls, pCtx, (*Fts5tokCursor)(unsafe.Pointer(pCsr)).FzInput, -1, libc.UintptrFromInt32(-1))
+ break
+ case 1:
+ sqlite3.Xsqlite3_result_text(tls, pCtx, (*Fts5tokRow)(unsafe.Pointer(pRow)).FzToken, -1, libc.UintptrFromInt32(-1))
+ break
+ case 2:
+ sqlite3.Xsqlite3_result_int(tls, pCtx, (*Fts5tokRow)(unsafe.Pointer(pRow)).FiStart)
+ break
+ case 3:
+ sqlite3.Xsqlite3_result_int(tls, pCtx, (*Fts5tokRow)(unsafe.Pointer(pRow)).FiEnd)
+ break
+ default:
+
+ sqlite3.Xsqlite3_result_int(tls, pCtx, (*Fts5tokRow)(unsafe.Pointer(pRow)).FiPos)
+ break
+ }
+ return 0
+}
+
+// xRowid - Return the current rowid for the cursor.
+func fts5tokRowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* fts5_test_tok.c:437:12: */
+ var pCsr uintptr = pCursor
+ *(*sqlite_int64)(unsafe.Pointer(pRowid)) = sqlite3_int64((*Fts5tokCursor)(unsafe.Pointer(pCsr)).FiRowid)
+ return 0
+}
+
+// Register the fts5tok module with database connection db. Return SQLITE_OK
+// if successful or an error code if sqlite3_create_module() fails.
+func sqlite3Fts5TestRegisterTok(tls *libc.TLS, db uintptr, pApi uintptr) int32 { /* fts5_test_tok.c:450:5: */
+ var rc int32 // Return code
+
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3105 /* "fts5tokenize" */, uintptr(unsafe.Pointer(&fts5tok_module)), pApi)
+ return rc
+}
+
+var fts5tok_module = sqlite3_module{FiVersion: 0, FxCreate: // iVersion
+0, FxConnect:// xCreate
+0, FxBestIndex:// xConnect
+0, FxDisconnect:// xBestIndex
+0, FxDestroy:// xDisconnect
+0, FxOpen:// xDestroy
+0, FxClose:// xOpen
+0, FxFilter:// xClose
+0, FxNext:// xFilter
+0, FxEof:// xNext
+0, FxColumn:// xEof
+0, FxRowid:// xColumn
+0, FxUpdate:// xRowid
+uintptr(0), FxBegin:// xUpdate
+uintptr(0), FxSync:// xBegin
+uintptr(0), FxCommit:// xSync
+uintptr(0), FxRollback:// xCommit
+uintptr(0), FxFindFunction:// xRollback
+uintptr(0), FxRename:// xFindFunction
+uintptr(0), FxSavepoint:// xRename
+uintptr(0), FxRelease:// xSavepoint
+uintptr(0), FxRollbackTo:// xRelease
+uintptr(0), FxShadowName:// xRollbackTo
+uintptr(0), // xShadowName
+} /* fts5_test_tok.c:451:31 */
+
// CAPI3REF: Loadable Extension Thunk
//
// A pointer to the opaque sqlite3_api_routines structure is passed as
// the third parameter to entry points of [loadable extensions]. This
// structure must be typedefed in order to work around compiler warnings
// on some platforms.
-type sqlite3_api_routines = sqlite3_api_routines1 /* sqlite3.h:1193:37 */
+type sqlite3_api_routines = sqlite3_api_routines1 /* sqlite3.h:1196:37 */
// This is the function signature used for all extension entry points. It
// is also defined in the file "loadext.c".
@@ -11983,7 +14498,7 @@ type amatch_avl = amatch_avl1 /* amatch.c:176:27 */
// Recompute the amatch_avl.height and amatch_avl.imbalance fields for p.
// Assume that the children of p have correct heights.
-func amatchAvlRecomputeHeight(tls *crt.TLS, p uintptr) { /* amatch.c:199:13: */
+func amatchAvlRecomputeHeight(tls *libc.TLS, p uintptr) { /* amatch.c:199:13: */
var hBefore int16
if (*amatch_avl)(unsafe.Pointer(p)).FpBefore != 0 {
hBefore = (*amatch_avl)(unsafe.Pointer((*amatch_avl)(unsafe.Pointer(p)).FpBefore)).Fheight
@@ -12009,7 +14524,7 @@ func amatchAvlRecomputeHeight(tls *crt.TLS, p uintptr) { /* amatch.c:199:13: */
// / \ / ** B Z ==> X P
// / \ / ** X Y Y Z
//
-func amatchAvlRotateBefore(tls *crt.TLS, pP uintptr) uintptr { /* amatch.c:214:19: */
+func amatchAvlRotateBefore(tls *libc.TLS, pP uintptr) uintptr { /* amatch.c:214:19: */
var pB uintptr = (*amatch_avl)(unsafe.Pointer(pP)).FpBefore
var pY uintptr = (*amatch_avl)(unsafe.Pointer(pB)).FpAfter
(*amatch_avl)(unsafe.Pointer(pB)).FpUp = (*amatch_avl)(unsafe.Pointer(pP)).FpUp
@@ -12028,7 +14543,7 @@ func amatchAvlRotateBefore(tls *crt.TLS, pP uintptr) uintptr { /* amatch.c:214:1
// / \ / ** X A ==> P Z
// / \ / ** Y Z X Y
//
-func amatchAvlRotateAfter(tls *crt.TLS, pP uintptr) uintptr { /* amatch.c:235:19: */
+func amatchAvlRotateAfter(tls *libc.TLS, pP uintptr) uintptr { /* amatch.c:235:19: */
var pA uintptr = (*amatch_avl)(unsafe.Pointer(pP)).FpAfter
var pY uintptr = (*amatch_avl)(unsafe.Pointer(pA)).FpBefore
(*amatch_avl)(unsafe.Pointer(pA)).FpUp = (*amatch_avl)(unsafe.Pointer(pP)).FpUp
@@ -12045,7 +14560,7 @@ func amatchAvlRotateAfter(tls *crt.TLS, pP uintptr) uintptr { /* amatch.c:235:19
// Return a pointer to the pBefore or pAfter pointer in the parent
// of p that points to p. Or if p is the root node, return pp.
-func amatchAvlFromPtr(tls *crt.TLS, p uintptr, pp uintptr) uintptr { /* amatch.c:252:19: */
+func amatchAvlFromPtr(tls *libc.TLS, p uintptr, pp uintptr) uintptr { /* amatch.c:252:19: */
var pUp uintptr = (*amatch_avl)(unsafe.Pointer(p)).FpUp
if pUp == uintptr(0) {
return pp
@@ -12058,7 +14573,7 @@ func amatchAvlFromPtr(tls *crt.TLS, p uintptr, pp uintptr) uintptr { /* amatch.c
// Rebalance all nodes starting with p and working up to the root.
// Return the new root.
-func amatchAvlBalance(tls *crt.TLS, p uintptr) uintptr { /* amatch.c:263:19: */
+func amatchAvlBalance(tls *libc.TLS, p uintptr) uintptr { /* amatch.c:263:19: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = p
@@ -12073,14 +14588,14 @@ func amatchAvlBalance(tls *crt.TLS, p uintptr) uintptr { /* amatch.c:263:19: */
(*amatch_avl)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).FpBefore = amatchAvlRotateAfter(tls, pB)
}
pp = amatchAvlFromPtr(tls, *(*uintptr)(unsafe.Pointer(bp /* p */)), bp /* &p */)
- *(*uintptr)(unsafe.Pointer(bp /* p */)) = crt.AssignPtrUintptr(pp, amatchAvlRotateBefore(tls, *(*uintptr)(unsafe.Pointer(bp /* p */))))
+ *(*uintptr)(unsafe.Pointer(bp /* p */)) = libc.AssignPtrUintptr(pp, amatchAvlRotateBefore(tls, *(*uintptr)(unsafe.Pointer(bp /* p */))))
} else if int32((*amatch_avl)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).Fimbalance) <= (-2) {
var pA uintptr = (*amatch_avl)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).FpAfter
if int32((*amatch_avl)(unsafe.Pointer(pA)).Fimbalance) > 0 {
(*amatch_avl)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).FpAfter = amatchAvlRotateBefore(tls, pA)
}
pp = amatchAvlFromPtr(tls, *(*uintptr)(unsafe.Pointer(bp /* p */)), bp /* &p */)
- *(*uintptr)(unsafe.Pointer(bp /* p */)) = crt.AssignPtrUintptr(pp, amatchAvlRotateAfter(tls, *(*uintptr)(unsafe.Pointer(bp /* p */))))
+ *(*uintptr)(unsafe.Pointer(bp /* p */)) = libc.AssignPtrUintptr(pp, amatchAvlRotateAfter(tls, *(*uintptr)(unsafe.Pointer(bp /* p */))))
}
pTop = *(*uintptr)(unsafe.Pointer(bp /* p */))
*(*uintptr)(unsafe.Pointer(bp /* p */)) = (*amatch_avl)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).FpUp
@@ -12090,9 +14605,9 @@ func amatchAvlBalance(tls *crt.TLS, p uintptr) uintptr { /* amatch.c:263:19: */
// Search the tree rooted at p for an entry with zKey. Return a pointer
// to the entry or return NULL.
-func amatchAvlSearch(tls *crt.TLS, p uintptr, zKey uintptr) uintptr { /* amatch.c:288:19: */
+func amatchAvlSearch(tls *libc.TLS, p uintptr, zKey uintptr) uintptr { /* amatch.c:288:19: */
var c int32
- for (p != 0) && ((crt.AssignInt32(&c, crt.Xstrcmp(tls, zKey, (*amatch_avl)(unsafe.Pointer(p)).FzKey))) != 0) {
+ for (p != 0) && ((libc.AssignInt32(&c, libc.Xstrcmp(tls, zKey, (*amatch_avl)(unsafe.Pointer(p)).FzKey))) != 0) {
if c < 0 {
p = (*amatch_avl)(unsafe.Pointer(p)).FpBefore
} else {
@@ -12103,7 +14618,7 @@ func amatchAvlSearch(tls *crt.TLS, p uintptr, zKey uintptr) uintptr { /* amatch.
}
// Find the first node (the one with the smallest key).
-func amatchAvlFirst(tls *crt.TLS, p uintptr) uintptr { /* amatch.c:298:19: */
+func amatchAvlFirst(tls *libc.TLS, p uintptr) uintptr { /* amatch.c:298:19: */
if p != 0 {
for (*amatch_avl)(unsafe.Pointer(p)).FpBefore != 0 {
p = (*amatch_avl)(unsafe.Pointer(p)).FpBefore
@@ -12115,7 +14630,7 @@ func amatchAvlFirst(tls *crt.TLS, p uintptr) uintptr { /* amatch.c:298:19: */
// Insert a new node pNew. Return NULL on success. If the key is not
// unique, then do not perform the insert but instead leave pNew unchanged
// and return a pointer to an existing node with the same key.
-func amatchAvlInsert(tls *crt.TLS, ppHead uintptr, pNew uintptr) uintptr { /* amatch.c:356:19: */
+func amatchAvlInsert(tls *libc.TLS, ppHead uintptr, pNew uintptr) uintptr { /* amatch.c:356:19: */
var c int32
var p uintptr = *(*uintptr)(unsafe.Pointer(ppHead))
if p == uintptr(0) {
@@ -12123,7 +14638,7 @@ func amatchAvlInsert(tls *crt.TLS, ppHead uintptr, pNew uintptr) uintptr { /* am
(*amatch_avl)(unsafe.Pointer(pNew)).FpUp = uintptr(0)
} else {
for p != 0 {
- c = crt.Xstrcmp(tls, (*amatch_avl)(unsafe.Pointer(pNew)).FzKey, (*amatch_avl)(unsafe.Pointer(p)).FzKey)
+ c = libc.Xstrcmp(tls, (*amatch_avl)(unsafe.Pointer(pNew)).FzKey, (*amatch_avl)(unsafe.Pointer(p)).FzKey)
if c < 0 {
if (*amatch_avl)(unsafe.Pointer(p)).FpBefore != 0 {
p = (*amatch_avl)(unsafe.Pointer(p)).FpBefore
@@ -12157,7 +14672,7 @@ func amatchAvlInsert(tls *crt.TLS, ppHead uintptr, pNew uintptr) uintptr { /* am
// Remove node pOld from the tree. pOld must be an element of the tree or
// the AVL tree will become corrupt.
-func amatchAvlRemove(tls *crt.TLS, ppHead uintptr, pOld uintptr) { /* amatch.c:399:13: */
+func amatchAvlRemove(tls *libc.TLS, ppHead uintptr, pOld uintptr) { /* amatch.c:399:13: */
var ppParent uintptr
var pBalance uintptr = uintptr(0)
// assert( amatchAvlSearch(*ppHead, pOld->zKey)==pOld );
@@ -12181,17 +14696,17 @@ func amatchAvlRemove(tls *crt.TLS, ppHead uintptr, pOld uintptr) { /* amatch.c:3
pBalance = pX
}
- (*amatch_avl)(unsafe.Pointer(pX)).FpBefore = crt.AssignUintptr(&pY, (*amatch_avl)(unsafe.Pointer(pOld)).FpBefore)
+ (*amatch_avl)(unsafe.Pointer(pX)).FpBefore = libc.AssignUintptr(&pY, (*amatch_avl)(unsafe.Pointer(pOld)).FpBefore)
if pY != 0 {
(*amatch_avl)(unsafe.Pointer(pY)).FpUp = pX
}
(*amatch_avl)(unsafe.Pointer(pX)).FpUp = (*amatch_avl)(unsafe.Pointer(pOld)).FpUp
*(*uintptr)(unsafe.Pointer(ppParent)) = pX
} else if (*amatch_avl)(unsafe.Pointer(pOld)).FpBefore == uintptr(0) {
- *(*uintptr)(unsafe.Pointer(ppParent)) = crt.AssignUintptr(&pBalance, (*amatch_avl)(unsafe.Pointer(pOld)).FpAfter)
+ *(*uintptr)(unsafe.Pointer(ppParent)) = libc.AssignUintptr(&pBalance, (*amatch_avl)(unsafe.Pointer(pOld)).FpAfter)
(*amatch_avl)(unsafe.Pointer(pBalance)).FpUp = (*amatch_avl)(unsafe.Pointer(pOld)).FpUp
} else if (*amatch_avl)(unsafe.Pointer(pOld)).FpAfter == uintptr(0) {
- *(*uintptr)(unsafe.Pointer(ppParent)) = crt.AssignUintptr(&pBalance, (*amatch_avl)(unsafe.Pointer(pOld)).FpBefore)
+ *(*uintptr)(unsafe.Pointer(ppParent)) = libc.AssignUintptr(&pBalance, (*amatch_avl)(unsafe.Pointer(pOld)).FpBefore)
(*amatch_avl)(unsafe.Pointer(pBalance)).FpUp = (*amatch_avl)(unsafe.Pointer(pOld)).FpUp
}
*(*uintptr)(unsafe.Pointer(ppHead)) = amatchAvlBalance(tls, pBalance)
@@ -12220,7 +14735,7 @@ type amatch_langid = int32 /* amatch.c:454:13 */
// The two input rule lists are both sorted in order of increasing
// cost. Merge them together into a single list, sorted by cost, and
// return a pointer to the head of that list.
-func amatchMergeRules(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* amatch.c:534:20: */
+func amatchMergeRules(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* amatch.c:534:20: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -12255,7 +14770,7 @@ func amatchMergeRules(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* amatch.
// If successful, *ppRule is set to point to the new object and SQLITE_OK
// is returned. Otherwise, *ppRule is zeroed, *pzErr may be set to point
// to an error message and an SQLite error code returned.
-func amatchLoadOneRule(tls *crt.TLS, p uintptr, pStmt uintptr, ppRule uintptr, pzErr uintptr) int32 { /* amatch.c:567:12: */
+func amatchLoadOneRule(tls *libc.TLS, p uintptr, pStmt uintptr, ppRule uintptr, pzErr uintptr) int32 { /* amatch.c:567:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -12275,11 +14790,11 @@ func amatchLoadOneRule(tls *crt.TLS, p uintptr, pStmt uintptr, ppRule uintptr, p
if zTo == uintptr(0) {
zTo = ts + 488 /* "" */
}
- nFrom = int32(crt.Xstrlen(tls, zFrom))
- nTo = int32(crt.Xstrlen(tls, zTo))
+ nFrom = int32(libc.Xstrlen(tls, zFrom))
+ nTo = int32(libc.Xstrlen(tls, zTo))
// Silently ignore null transformations
- if crt.Xstrcmp(tls, zFrom, zTo) == 0 {
+ if libc.Xstrcmp(tls, zFrom, zTo) == 0 {
if (int32(*(*int8)(unsafe.Pointer(zFrom + uintptr(0)))) == '?') && (int32(*(*int8)(unsafe.Pointer(zFrom + uintptr(1)))) == 0) {
if ((*amatch_vtab)(unsafe.Pointer(p)).FrSub == 0) || ((*amatch_vtab)(unsafe.Pointer(p)).FrSub > rCost) {
(*amatch_vtab)(unsafe.Pointer(p)).FrSub = rCost
@@ -12290,22 +14805,22 @@ func amatchLoadOneRule(tls *crt.TLS, p uintptr, pStmt uintptr, ppRule uintptr, p
}
if (rCost <= 0) || (rCost > 1000) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+1962, /* "%s: cost must be..." */
- crt.VaList(bp, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, 1000))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3118, /* "%s: cost must be..." */
+ libc.VaList(bp, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, 1000))
rc = 1
} else if (nFrom > 50) || (nTo > 50) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+1996, /* "%s: maximum stri..." */
- crt.VaList(bp+16, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, 50))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3152, /* "%s: maximum stri..." */
+ libc.VaList(bp+16, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, 50))
rc = 1
} else if (iLang < int64(0)) || (iLang > int64(2147483647)) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+2028, /* "%s: iLang must b..." */
- crt.VaList(bp+32, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, 2147483647))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3184, /* "%s: iLang must b..." */
+ libc.VaList(bp+32, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, 2147483647))
rc = 1
- } else if (crt.Xstrcmp(tls, zFrom, ts+488 /* "" */) == 0) && (crt.Xstrcmp(tls, zTo, ts+2063 /* "?" */) == 0) {
+ } else if (libc.Xstrcmp(tls, zFrom, ts+488 /* "" */) == 0) && (libc.Xstrcmp(tls, zTo, ts+3219 /* "?" */) == 0) {
if ((*amatch_vtab)(unsafe.Pointer(p)).FrIns == 0) || ((*amatch_vtab)(unsafe.Pointer(p)).FrIns > rCost) {
(*amatch_vtab)(unsafe.Pointer(p)).FrIns = rCost
}
- } else if (crt.Xstrcmp(tls, zFrom, ts+2063 /* "?" */) == 0) && (crt.Xstrcmp(tls, zTo, ts+488 /* "" */) == 0) {
+ } else if (libc.Xstrcmp(tls, zFrom, ts+3219 /* "?" */) == 0) && (libc.Xstrcmp(tls, zTo, ts+488 /* "" */) == 0) {
if ((*amatch_vtab)(unsafe.Pointer(p)).FrDel == 0) || ((*amatch_vtab)(unsafe.Pointer(p)).FrDel > rCost) {
(*amatch_vtab)(unsafe.Pointer(p)).FrDel = rCost
}
@@ -12314,11 +14829,11 @@ func amatchLoadOneRule(tls *crt.TLS, p uintptr, pStmt uintptr, ppRule uintptr, p
if pRule == uintptr(0) {
rc = 7
} else {
- crt.Xmemset(tls, pRule, 0, uint64(unsafe.Sizeof(amatch_rule{})))
+ libc.Xmemset(tls, pRule, 0, uint64(unsafe.Sizeof(amatch_rule{})))
(*amatch_rule)(unsafe.Pointer(pRule)).FzFrom = ((pRule + 26 /* &.zTo */) + uintptr((nTo + 1)))
(*amatch_rule)(unsafe.Pointer(pRule)).FnFrom = amatch_len(nFrom)
- crt.Xmemcpy(tls, (*amatch_rule)(unsafe.Pointer(pRule)).FzFrom, zFrom, (uint64(nFrom + 1)))
- crt.Xmemcpy(tls, pRule+26 /* &.zTo */, zTo, (uint64(nTo + 1)))
+ libc.Xmemcpy(tls, (*amatch_rule)(unsafe.Pointer(pRule)).FzFrom, zFrom, (uint64(nFrom + 1)))
+ libc.Xmemcpy(tls, pRule+26 /* &.zTo */, zTo, (uint64(nTo + 1)))
(*amatch_rule)(unsafe.Pointer(pRule)).FnTo = amatch_len(nTo)
(*amatch_rule)(unsafe.Pointer(pRule)).FrCost = rCost
(*amatch_rule)(unsafe.Pointer(pRule)).FiLang = int32(iLang)
@@ -12330,7 +14845,7 @@ func amatchLoadOneRule(tls *crt.TLS, p uintptr, pStmt uintptr, ppRule uintptr, p
}
// Free all the content in the edit-cost-table
-func amatchFreeRules(tls *crt.TLS, p uintptr) { /* amatch.c:644:13: */
+func amatchFreeRules(tls *libc.TLS, p uintptr) { /* amatch.c:644:13: */
for (*amatch_vtab)(unsafe.Pointer(p)).FpRule != 0 {
var pRule uintptr = (*amatch_vtab)(unsafe.Pointer(p)).FpRule
(*amatch_vtab)(unsafe.Pointer(p)).FpRule = (*amatch_rule)(unsafe.Pointer(pRule)).FpNext
@@ -12340,7 +14855,7 @@ func amatchFreeRules(tls *crt.TLS, p uintptr) { /* amatch.c:644:13: */
}
// Load the content of the amatch data table into memory.
-func amatchLoadRules(tls *crt.TLS, db uintptr, p uintptr, pzErr uintptr) int32 { /* amatch.c:656:12: */
+func amatchLoadRules(tls *libc.TLS, db uintptr, p uintptr, pzErr uintptr) int32 { /* amatch.c:656:12: */
bp := tls.Alloc(192)
defer tls.Free(192)
@@ -12348,7 +14863,7 @@ func amatchLoadRules(tls *crt.TLS, db uintptr, p uintptr, pzErr uintptr) int32 {
var zSql uintptr // SELECT used to read from rules table
var pHead uintptr = uintptr(0)
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+2065 /* "SELECT * FROM %Q..." */, crt.VaList(bp, (*amatch_vtab)(unsafe.Pointer(p)).FzDb, (*amatch_vtab)(unsafe.Pointer(p)).FzCostTab))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+3221 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*amatch_vtab)(unsafe.Pointer(p)).FzDb, (*amatch_vtab)(unsafe.Pointer(p)).FzCostTab))
if zSql == uintptr(0) {
rc = 7
} else {
@@ -12356,10 +14871,10 @@ func amatchLoadRules(tls *crt.TLS, db uintptr, p uintptr, pzErr uintptr) int32 {
*(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)) = uintptr(0)
rc = sqlite3.Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+56 /* &pStmt */, uintptr(0))
if rc != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+2085 /* "%s: %s" */, crt.VaList(bp+16, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, sqlite3.Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3241 /* "%s: %s" */, libc.VaList(bp+16, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, sqlite3.Xsqlite3_errmsg(tls, db)))
} else if sqlite3.Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */))) != 4 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+2092, /* "%s: %s has %d co..." */
- crt.VaList(bp+32, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, (*amatch_vtab)(unsafe.Pointer(p)).FzCostTab, sqlite3.Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3248, /* "%s: %s has %d co..." */
+ libc.VaList(bp+32, (*amatch_vtab)(unsafe.Pointer(p)).FzClassName, (*amatch_vtab)(unsafe.Pointer(p)).FzCostTab, sqlite3.Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)))))
rc = 1
} else {
for (rc == 0) && (100 == sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)))) {
@@ -12389,7 +14904,7 @@ func amatchLoadRules(tls *crt.TLS, db uintptr, p uintptr, pzErr uintptr) int32 {
for i = uint32(0); uint64(i) < (uint64(unsafe.Sizeof([15]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0)))); i++ {
*(*uintptr)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(i)*8)) = uintptr(0)
}
- for (crt.AssignUintptr(&pX, pHead)) != uintptr(0) {
+ for (libc.AssignUintptr(&pX, pHead)) != uintptr(0) {
pHead = (*amatch_rule)(unsafe.Pointer(pX)).FpNext
(*amatch_rule)(unsafe.Pointer(pX)).FpNext = uintptr(0)
for i = uint32(0); (*(*uintptr)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(i)*8)) != 0) && (uint64(i) < ((uint64(unsafe.Sizeof([15]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0)))) - uint64(1))); i++ {
@@ -12425,17 +14940,17 @@ func amatchLoadRules(tls *crt.TLS, db uintptr, p uintptr, pzErr uintptr) int32 {
// 'xyz' becomes xyz
// [pqr] becomes pqr
// `mno` becomes mno
-func amatchDequote(tls *crt.TLS, zIn uintptr) uintptr { /* amatch.c:740:13: */
+func amatchDequote(tls *libc.TLS, zIn uintptr) uintptr { /* amatch.c:740:13: */
var nIn sqlite3_int64 // Size of input string, in bytes
var zOut uintptr // Output (dequoted) string
- nIn = sqlite3_int64(crt.Xstrlen(tls, zIn))
+ nIn = sqlite3_int64(libc.Xstrlen(tls, zIn))
zOut = sqlite3.Xsqlite3_malloc64(tls, (uint64(nIn + int64(1))))
if zOut != 0 {
var q int8 = *(*int8)(unsafe.Pointer(zIn + uintptr(0))) // Quote character (if any )
if (((int32(q) != '[') && (int32(q) != '\'')) && (int32(q) != '"')) && (int32(q) != '`') {
- crt.Xmemcpy(tls, zOut, zIn, (size_t(nIn + int64(1))))
+ libc.Xmemcpy(tls, zOut, zIn, (size_t(nIn + int64(1))))
} else {
var iOut int32 = 0 // Index of next byte to write to output
var iIn int32 // Index of next byte to read from input
@@ -12447,7 +14962,7 @@ func amatchDequote(tls *crt.TLS, zIn uintptr) uintptr { /* amatch.c:740:13: */
if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(iIn)))) == int32(q) {
iIn++
}
- *(*int8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(zIn + uintptr(iIn)))
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(zIn + uintptr(iIn)))
}
}
}
@@ -12455,7 +14970,7 @@ func amatchDequote(tls *crt.TLS, zIn uintptr) uintptr { /* amatch.c:740:13: */
}
// Deallocate the pVCheck prepared statement.
-func amatchVCheckClear(tls *crt.TLS, p uintptr) { /* amatch.c:769:13: */
+func amatchVCheckClear(tls *libc.TLS, p uintptr) { /* amatch.c:769:13: */
if (*amatch_vtab)(unsafe.Pointer(p)).FpVCheck != 0 {
sqlite3.Xsqlite3_finalize(tls, (*amatch_vtab)(unsafe.Pointer(p)).FpVCheck)
(*amatch_vtab)(unsafe.Pointer(p)).FpVCheck = uintptr(0)
@@ -12463,7 +14978,7 @@ func amatchVCheckClear(tls *crt.TLS, p uintptr) { /* amatch.c:769:13: */
}
// Deallocate an amatch_vtab object
-func amatchFree(tls *crt.TLS, p uintptr) { /* amatch.c:779:13: */
+func amatchFree(tls *libc.TLS, p uintptr) { /* amatch.c:779:13: */
if p != 0 {
amatchFreeRules(tls, p)
amatchVCheckClear(tls, p)
@@ -12474,13 +14989,13 @@ func amatchFree(tls *crt.TLS, p uintptr) { /* amatch.c:779:13: */
sqlite3.Xsqlite3_free(tls, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabWord)
sqlite3.Xsqlite3_free(tls, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabLang)
sqlite3.Xsqlite3_free(tls, (*amatch_vtab)(unsafe.Pointer(p)).FzSelf)
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(amatch_vtab{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(amatch_vtab{})))
sqlite3.Xsqlite3_free(tls, p)
}
}
// xDisconnect/xDestroy method for the amatch module.
-func amatchDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* amatch.c:798:12: */
+func amatchDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* amatch.c:798:12: */
var p uintptr = pVtab
amatchFree(tls, p)
@@ -12493,23 +15008,23 @@ func amatchDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* amatch.c:798:12: *
//
// If it is, return a pointer to the first character of VALUE.
// If not, return NULL. Spaces around the = are ignored.
-func amatchValueOfKey(tls *crt.TLS, zKey uintptr, zStr uintptr) uintptr { /* amatch.c:813:19: */
- var nKey int32 = int32(crt.Xstrlen(tls, zKey))
- var nStr int32 = int32(crt.Xstrlen(tls, zStr))
+func amatchValueOfKey(tls *libc.TLS, zKey uintptr, zStr uintptr) uintptr { /* amatch.c:813:19: */
+ var nKey int32 = int32(libc.Xstrlen(tls, zKey))
+ var nStr int32 = int32(libc.Xstrlen(tls, zStr))
var i int32
if nStr < (nKey + 1) {
return uintptr(0)
}
- if crt.Xmemcmp(tls, zStr, zKey, uint64(nKey)) != 0 {
+ if libc.Xmemcmp(tls, zStr, zKey, uint64(nKey)) != 0 {
return uintptr(0)
}
- for i = nKey; (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zStr + uintptr(i))))))*2))) & int32(_ISspace)) != 0; i++ {
+ for i = nKey; (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zStr + uintptr(i))))))*2))) & int32(_ISspace)) != 0; i++ {
}
if int32(*(*int8)(unsafe.Pointer(zStr + uintptr(i)))) != '=' {
return uintptr(0)
}
i++
- for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zStr + uintptr(i))))))*2))) & int32(_ISspace)) != 0 {
+ for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zStr + uintptr(i))))))*2))) & int32(_ISspace)) != 0 {
i++
}
return (zStr + uintptr(i))
@@ -12521,7 +15036,7 @@ func amatchValueOfKey(tls *crt.TLS, zKey uintptr, zStr uintptr) uintptr { /* ama
// argv[1] -> database name
// argv[2] -> table name
// argv[3...] -> arguments
-func amatchConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* amatch.c:834:12: */
+func amatchConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* amatch.c:834:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -12546,23 +15061,23 @@ func amatchConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uint
__1:
;
rc = 7
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(amatch_vtab{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(amatch_vtab{})))
(*amatch_vtab)(unsafe.Pointer(pNew)).Fdb = db
- (*amatch_vtab)(unsafe.Pointer(pNew)).FzClassName = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, zModule))
+ (*amatch_vtab)(unsafe.Pointer(pNew)).FzClassName = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, zModule))
if !((*amatch_vtab)(unsafe.Pointer(pNew)).FzClassName == uintptr(0)) {
goto __2
}
goto amatchConnectError
__2:
;
- (*amatch_vtab)(unsafe.Pointer(pNew)).FzDb = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+8, zDb))
+ (*amatch_vtab)(unsafe.Pointer(pNew)).FzDb = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+8, zDb))
if !((*amatch_vtab)(unsafe.Pointer(pNew)).FzDb == uintptr(0)) {
goto __3
}
goto amatchConnectError
__3:
;
- (*amatch_vtab)(unsafe.Pointer(pNew)).FzSelf = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ (*amatch_vtab)(unsafe.Pointer(pNew)).FzSelf = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
if !((*amatch_vtab)(unsafe.Pointer(pNew)).FzSelf == uintptr(0)) {
goto __4
}
@@ -12574,7 +15089,7 @@ __5:
if !(i < argc) {
goto __7
}
- zVal = amatchValueOfKey(tls, ts+2126 /* "vocabulary_table" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ zVal = amatchValueOfKey(tls, ts+3282 /* "vocabulary_table" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
if !(zVal != 0) {
goto __8
}
@@ -12589,7 +15104,7 @@ __9:
goto __6
__8:
;
- zVal = amatchValueOfKey(tls, ts+2143 /* "vocabulary_word" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ zVal = amatchValueOfKey(tls, ts+3299 /* "vocabulary_word" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
if !(zVal != 0) {
goto __10
}
@@ -12604,7 +15119,7 @@ __11:
goto __6
__10:
;
- zVal = amatchValueOfKey(tls, ts+2159 /* "vocabulary_langu..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ zVal = amatchValueOfKey(tls, ts+3315 /* "vocabulary_langu..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
if !(zVal != 0) {
goto __12
}
@@ -12619,7 +15134,7 @@ __13:
goto __6
__12:
;
- zVal = amatchValueOfKey(tls, ts+2179 /* "edit_distances" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ zVal = amatchValueOfKey(tls, ts+3335 /* "edit_distances" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
if !(zVal != 0) {
goto __14
}
@@ -12634,7 +15149,7 @@ __15:
goto __6
__14:
;
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+2194 /* "unrecognized arg..." */, crt.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3350 /* "unrecognized arg..." */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
amatchFree(tls, pNew)
*(*uintptr)(unsafe.Pointer(ppVtab)) = uintptr(0)
return 1
@@ -12649,7 +15164,7 @@ __7:
if !((*amatch_vtab)(unsafe.Pointer(pNew)).FzCostTab == uintptr(0)) {
goto __16
}
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+2223 /* "no edit_distance..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3379 /* "no edit_distance..." */, 0)
rc = 1
goto __17
__16:
@@ -12662,7 +15177,7 @@ __17:
sqlite3.Xsqlite3_vtab_config(tls, db, 2, 0)
rc = sqlite3.Xsqlite3_declare_vtab(tls, db,
- ts+2257 /* "CREATE TABLE x(w..." */)
+ ts+3413 /* "CREATE TABLE x(w..." */)
__18:
;
if !(rc != 0) {
@@ -12680,14 +15195,14 @@ amatchConnectError:
}
// Open a new amatch cursor.
-func amatchOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* amatch.c:928:12: */
+func amatchOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* amatch.c:928:12: */
var p uintptr = pVTab
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(amatch_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(amatch_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(amatch_cursor{})))
(*amatch_cursor)(unsafe.Pointer(pCur)).FpVtab = p
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
(*amatch_vtab)(unsafe.Pointer(p)).FnCursor++
@@ -12696,7 +15211,7 @@ func amatchOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* amatch
// Free up all the memory allocated by a cursor. Set it rLimit to 0
// to indicate that it is at EOF.
-func amatchClearCursor(tls *crt.TLS, pCur uintptr) { /* amatch.c:944:13: */
+func amatchClearCursor(tls *libc.TLS, pCur uintptr) { /* amatch.c:944:13: */
var pWord uintptr
var pNextWord uintptr
for pWord = (*amatch_cursor)(unsafe.Pointer(pCur)).FpAllWords; pWord != 0; pWord = pNextWord {
@@ -12718,7 +15233,7 @@ func amatchClearCursor(tls *crt.TLS, pCur uintptr) { /* amatch.c:944:13: */
}
// Close a amatch cursor.
-func amatchClose(tls *crt.TLS, cur uintptr) int32 { /* amatch.c:967:12: */
+func amatchClose(tls *libc.TLS, cur uintptr) int32 { /* amatch.c:967:12: */
var pCur uintptr = cur
amatchClearCursor(tls, pCur)
(*amatch_vtab)(unsafe.Pointer((*amatch_cursor)(unsafe.Pointer(pCur)).FpVtab)).FnCursor--
@@ -12727,17 +15242,17 @@ func amatchClose(tls *crt.TLS, cur uintptr) int32 { /* amatch.c:967:12: */
}
// Render a 24-bit unsigned integer as a 4-byte base-64 number.
-func amatchEncodeInt(tls *crt.TLS, x int32, z uintptr) { /* amatch.c:978:13: */
+func amatchEncodeInt(tls *libc.TLS, x int32, z uintptr) { /* amatch.c:978:13: */
*(*int8)(unsafe.Pointer(z + uintptr(0))) = a[((x >> 18) & 0x3f)]
*(*int8)(unsafe.Pointer(z + uintptr(1))) = a[((x >> 12) & 0x3f)]
*(*int8)(unsafe.Pointer(z + uintptr(2))) = a[((x >> 6) & 0x3f)]
*(*int8)(unsafe.Pointer(z + uintptr(3))) = a[(x & 0x3f)]
}
-var a = *(*[65]int8)(unsafe.Pointer(ts + 2324 /* "0123456789ABCDEF..." */)) /* amatch.c:979:21 */
+var a = *(*[65]int8)(unsafe.Pointer(ts + 3480 /* "0123456789ABCDEF..." */)) /* amatch.c:979:21 */
// Write the zCost[] field for a amatch_word object
-func amatchWriteCost(tls *crt.TLS, pWord uintptr) { /* amatch.c:996:13: */
+func amatchWriteCost(tls *libc.TLS, pWord uintptr) { /* amatch.c:996:13: */
amatchEncodeInt(tls, (*amatch_word)(unsafe.Pointer(pWord)).FrCost, pWord+112 /* &.zCost */)
amatchEncodeInt(tls, (*amatch_word)(unsafe.Pointer(pWord)).FiSeq, ((pWord + 112 /* &.zCost */) + uintptr(4)))
*(*int8)(unsafe.Pointer((pWord + 112 /* &.zCost */) + uintptr(8))) = int8(0)
@@ -12745,11 +15260,11 @@ func amatchWriteCost(tls *crt.TLS, pWord uintptr) { /* amatch.c:996:13: */
// Circumvent compiler warnings about the use of strcpy() by supplying
// our own implementation.
-func amatchStrcpy(tls *crt.TLS, dest uintptr, src uintptr) { /* amatch.c:1005:13: */
- for (int32(crt.AssignPtrInt8(crt.PostIncUintptr(&dest, 1), *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&src, 1)))))) != 0 {
+func amatchStrcpy(tls *libc.TLS, dest uintptr, src uintptr) { /* amatch.c:1005:13: */
+ for (int32(libc.AssignPtrInt8(libc.PostIncUintptr(&dest, 1), *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&src, 1)))))) != 0 {
}
}
-func amatchStrcat(tls *crt.TLS, dest uintptr, src uintptr) { /* amatch.c:1008:13: */
+func amatchStrcat(tls *libc.TLS, dest uintptr, src uintptr) { /* amatch.c:1008:13: */
for *(*int8)(unsafe.Pointer(dest)) != 0 {
dest++
}
@@ -12763,7 +15278,7 @@ func amatchStrcat(tls *crt.TLS, dest uintptr, src uintptr) { /* amatch.c:1008:13
// otherwise leave it unchanged. Do not add a duplicate.
//
// Do nothing if the cost exceeds threshold.
-func amatchAddWord(tls *crt.TLS, pCur uintptr, rCost amatch_cost, nMatch int32, zWordBase uintptr, zWordTail uintptr) { /* amatch.c:1022:13: */
+func amatchAddWord(tls *libc.TLS, pCur uintptr, rCost amatch_cost, nMatch int32, zWordBase uintptr, zWordTail uintptr) { /* amatch.c:1022:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -12778,8 +15293,8 @@ func amatchAddWord(tls *crt.TLS, pCur uintptr, rCost amatch_cost, nMatch int32,
if rCost > (*amatch_cursor)(unsafe.Pointer(pCur)).FrLimit {
return
}
- nBase = int32(crt.Xstrlen(tls, zWordBase))
- nTail = int32(crt.Xstrlen(tls, zWordTail))
+ nBase = int32(libc.Xstrlen(tls, zWordBase))
+ nTail = int32(libc.Xstrlen(tls, zWordTail))
if ((nBase + nTail) + 3) > (*amatch_cursor)(unsafe.Pointer(pCur)).FnBuf {
(*amatch_cursor)(unsafe.Pointer(pCur)).FnBuf = ((nBase + nTail) + 100)
(*amatch_cursor)(unsafe.Pointer(pCur)).FzBuf = sqlite3.Xsqlite3_realloc(tls, (*amatch_cursor)(unsafe.Pointer(pCur)).FzBuf, (*amatch_cursor)(unsafe.Pointer(pCur)).FnBuf)
@@ -12789,9 +15304,9 @@ func amatchAddWord(tls *crt.TLS, pCur uintptr, rCost amatch_cost, nMatch int32,
}
}
amatchEncodeInt(tls, nMatch, bp /* &zBuf[0] */)
- crt.Xmemcpy(tls, (*amatch_cursor)(unsafe.Pointer(pCur)).FzBuf, (bp /* &zBuf[0] */ + uintptr(2)), uint64(2))
- crt.Xmemcpy(tls, ((*amatch_cursor)(unsafe.Pointer(pCur)).FzBuf + uintptr(2)), zWordBase, uint64(nBase))
- crt.Xmemcpy(tls, (((*amatch_cursor)(unsafe.Pointer(pCur)).FzBuf + uintptr(2)) + uintptr(nBase)), zWordTail, (uint64(nTail + 1)))
+ libc.Xmemcpy(tls, (*amatch_cursor)(unsafe.Pointer(pCur)).FzBuf, (bp /* &zBuf[0] */ + uintptr(2)), uint64(2))
+ libc.Xmemcpy(tls, ((*amatch_cursor)(unsafe.Pointer(pCur)).FzBuf + uintptr(2)), zWordBase, uint64(nBase))
+ libc.Xmemcpy(tls, (((*amatch_cursor)(unsafe.Pointer(pCur)).FzBuf + uintptr(2)) + uintptr(nBase)), zWordTail, (uint64(nTail + 1)))
pNode = amatchAvlSearch(tls, (*amatch_cursor)(unsafe.Pointer(pCur)).FpWord, (*amatch_cursor)(unsafe.Pointer(pCur)).FzBuf)
if pNode != 0 {
pWord = (*amatch_avl)(unsafe.Pointer(pNode)).FpWord
@@ -12808,9 +15323,9 @@ func amatchAddWord(tls *crt.TLS, pCur uintptr, rCost amatch_cost, nMatch int32,
if pWord == uintptr(0) {
return
}
- crt.Xmemset(tls, pWord, 0, uint64(unsafe.Sizeof(amatch_word{})))
+ libc.Xmemset(tls, pWord, 0, uint64(unsafe.Sizeof(amatch_word{})))
(*amatch_word)(unsafe.Pointer(pWord)).FrCost = rCost
- (*amatch_word)(unsafe.Pointer(pWord)).FiSeq = crt.PostIncInt32(&(*amatch_cursor)(unsafe.Pointer(pCur)).FnWord, 1)
+ (*amatch_word)(unsafe.Pointer(pWord)).FiSeq = libc.PostIncInt32(&(*amatch_cursor)(unsafe.Pointer(pCur)).FnWord, 1)
amatchWriteCost(tls, pWord)
(*amatch_word)(unsafe.Pointer(pWord)).FnMatch = int16(nMatch)
(*amatch_word)(unsafe.Pointer(pWord)).FpNext = (*amatch_cursor)(unsafe.Pointer(pCur)).FpAllWords
@@ -12827,7 +15342,7 @@ func amatchAddWord(tls *crt.TLS, pCur uintptr, rCost amatch_cost, nMatch int32,
}
// Advance a cursor to its next row of output
-func amatchNext(tls *crt.TLS, cur uintptr) int32 { /* amatch.c:1102:12: */
+func amatchNext(tls *libc.TLS, cur uintptr) int32 { /* amatch.c:1102:12: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -12853,16 +15368,16 @@ func amatchNext(tls *crt.TLS, cur uintptr) int32 { /* amatch.c:1102:12: */
var zSql uintptr
if ((*amatch_vtab)(unsafe.Pointer(p)).FzVocabLang != 0) && (*(*int8)(unsafe.Pointer((*amatch_vtab)(unsafe.Pointer(p)).FzVocabLang + uintptr(0))) != 0) {
zSql = sqlite3.Xsqlite3_mprintf(tls,
- ts+2389, /* "SELECT \"%w\" FROM..." */
+ ts+3545, /* "SELECT \"%w\" FROM..." */
- crt.VaList(bp, ts+2411, /* " WHERE \"%w\">=?1 ..." */
+ libc.VaList(bp, ts+3567, /* " WHERE \"%w\">=?1 ..." */
(*amatch_vtab)(unsafe.Pointer(p)).FzVocabWord, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabTab,
(*amatch_vtab)(unsafe.Pointer(p)).FzVocabWord, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabLang))
} else {
zSql = sqlite3.Xsqlite3_mprintf(tls,
- ts+2450, /* "SELECT \"%w\" FROM..." */
- crt.VaList(bp+40, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabWord, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabTab,
+ ts+3606, /* "SELECT \"%w\" FROM..." */
+ libc.VaList(bp+40, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabWord, (*amatch_vtab)(unsafe.Pointer(p)).FzVocabTab,
(*amatch_vtab)(unsafe.Pointer(p)).FzVocabWord))
}
rc = sqlite3.Xsqlite3_prepare_v2(tls, (*amatch_vtab)(unsafe.Pointer(p)).Fdb, zSql, -1, (p + 112 /* &.pVCheck */), uintptr(0))
@@ -12882,7 +15397,7 @@ func amatchNext(tls *crt.TLS, cur uintptr) int32 { /* amatch.c:1102:12: */
pWord = (*amatch_avl)(unsafe.Pointer(pNode)).FpWord
amatchAvlRemove(tls, (pCur + 80 /* &.pCost */), (pWord + 8 /* &.sCost */))
- nWord = int32(crt.Xstrlen(tls, ((pWord + 124 /* &.zWord */) + uintptr(2))))
+ nWord = int32(libc.Xstrlen(tls, ((pWord + 124 /* &.zWord */) + uintptr(2))))
if (nWord + 20) > int32(nBuf) {
nBuf = (int8(nWord + 100))
zBuf = sqlite3.Xsqlite3_realloc(tls, zBuf, int32(nBuf))
@@ -12910,7 +15425,7 @@ func amatchNext(tls *crt.TLS, cur uintptr) int32 { /* amatch.c:1102:12: */
rc = sqlite3.Xsqlite3_step(tls, (*amatch_vtab)(unsafe.Pointer(p)).FpVCheck)
if rc == 100 {
zW = sqlite3.Xsqlite3_column_text(tls, (*amatch_vtab)(unsafe.Pointer(p)).FpVCheck, 0)
- if crt.Xstrncmp(tls, zBuf, zW, (uint64(nWord+nNextIn))) == 0 {
+ if libc.Xstrncmp(tls, zBuf, zW, (uint64(nWord+nNextIn))) == 0 {
amatchAddWord(tls, pCur, (*amatch_word)(unsafe.Pointer(pWord)).FrCost, (int32((*amatch_word)(unsafe.Pointer(pWord)).FnMatch) + nNextIn), zBuf, ts+488 /* "" */)
}
}
@@ -12920,14 +15435,14 @@ func amatchNext(tls *crt.TLS, cur uintptr) int32 { /* amatch.c:1102:12: */
for 1 != 0 {
amatchStrcpy(tls, (zBuf + uintptr(nWord)), bp+64 /* &zNext[0] */)
sqlite3.Xsqlite3_reset(tls, (*amatch_vtab)(unsafe.Pointer(p)).FpVCheck)
- sqlite3.Xsqlite3_bind_text(tls, (*amatch_vtab)(unsafe.Pointer(p)).FpVCheck, 1, zBuf, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_bind_text(tls, (*amatch_vtab)(unsafe.Pointer(p)).FpVCheck, 1, zBuf, -1, libc.UintptrFromInt32(-1))
rc = sqlite3.Xsqlite3_step(tls, (*amatch_vtab)(unsafe.Pointer(p)).FpVCheck)
if rc != 100 {
break
}
zW = sqlite3.Xsqlite3_column_text(tls, (*amatch_vtab)(unsafe.Pointer(p)).FpVCheck, 0)
amatchStrcpy(tls, (zBuf + uintptr(nWord)), bp+64 /* &zNext[0] */)
- if crt.Xstrncmp(tls, zW, zBuf, uint64(nWord)) != 0 {
+ if libc.Xstrncmp(tls, zW, zBuf, uint64(nWord)) != 0 {
break
}
if ((int32(*(*int8)(unsafe.Pointer(bp + 72 /* &zNextIn[0] */ + uintptr(0)))) == '*') && (int32(*(*int8)(unsafe.Pointer(bp + 72 /* &zNextIn[0] */ + uintptr(1)))) == 0)) ||
@@ -12968,7 +15483,7 @@ func amatchNext(tls *crt.TLS, cur uintptr) int32 { /* amatch.c:1102:12: */
if (*amatch_rule)(unsafe.Pointer(pRule)).FiLang != (*amatch_cursor)(unsafe.Pointer(pCur)).FiLang {
continue
}
- if crt.Xstrncmp(tls, (*amatch_rule)(unsafe.Pointer(pRule)).FzFrom, ((*amatch_cursor)(unsafe.Pointer(pCur)).FzInput+uintptr((*amatch_word)(unsafe.Pointer(pWord)).FnMatch)), uint64((*amatch_rule)(unsafe.Pointer(pRule)).FnFrom)) == 0 {
+ if libc.Xstrncmp(tls, (*amatch_rule)(unsafe.Pointer(pRule)).FzFrom, ((*amatch_cursor)(unsafe.Pointer(pCur)).FzInput+uintptr((*amatch_word)(unsafe.Pointer(pWord)).FnMatch)), uint64((*amatch_rule)(unsafe.Pointer(pRule)).FnFrom)) == 0 {
amatchAddWord(tls, pCur, ((*amatch_word)(unsafe.Pointer(pWord)).FrCost + (*amatch_rule)(unsafe.Pointer(pRule)).FrCost),
(int32((*amatch_word)(unsafe.Pointer(pWord)).FnMatch) + int32((*amatch_rule)(unsafe.Pointer(pRule)).FnFrom)), ((pWord + 124 /* &.zWord */) + uintptr(2)), pRule+26 /* &.zTo */)
}
@@ -12982,12 +15497,12 @@ func amatchNext(tls *crt.TLS, cur uintptr) int32 { /* amatch.c:1102:12: */
// Called to "rewind" a cursor back to the beginning so that
// it starts its output over again. Always called at least once
// prior to any amatchColumn, amatchRowid, or amatchEof call.
-func amatchFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* amatch.c:1251:12: */
+func amatchFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* amatch.c:1251:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var pCur uintptr = pVtabCursor
- var zWord uintptr = ts + 2498 /* "*" */
+ var zWord uintptr = ts + 3654 /* "*" */
var idx int32
amatchClearCursor(tls, pCur)
@@ -13004,7 +15519,7 @@ func amatchFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
(*amatch_cursor)(unsafe.Pointer(pCur)).FiLang = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(idx)*8)))
idx++
}
- (*amatch_cursor)(unsafe.Pointer(pCur)).FzInput = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, zWord))
+ (*amatch_cursor)(unsafe.Pointer(pCur)).FzInput = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, zWord))
if (*amatch_cursor)(unsafe.Pointer(pCur)).FzInput == uintptr(0) {
return 7
}
@@ -13016,7 +15531,7 @@ func amatchFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
// Only the word and distance columns have values. All other columns
// return NULL
-func amatchColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* amatch.c:1286:12: */
+func amatchColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* amatch.c:1286:12: */
var pCur uintptr = cur
switch i {
case 0:
@@ -13049,16 +15564,16 @@ func amatchColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* am
}
// The rowid.
-func amatchRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* amatch.c:1316:12: */
+func amatchRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* amatch.c:1316:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*amatch_cursor)(unsafe.Pointer(pCur)).FiRowid
return 0
}
// EOF indicator
-func amatchEof(tls *crt.TLS, cur uintptr) int32 { /* amatch.c:1325:12: */
+func amatchEof(tls *libc.TLS, cur uintptr) int32 { /* amatch.c:1325:12: */
var pCur uintptr = cur
- return (crt.Bool32((*amatch_cursor)(unsafe.Pointer(pCur)).FpCurrent == uintptr(0)))
+ return (libc.Bool32((*amatch_cursor)(unsafe.Pointer(pCur)).FpCurrent == uintptr(0)))
}
// Search for terms of these forms:
@@ -13081,7 +15596,7 @@ func amatchEof(tls *crt.TLS, cur uintptr) int32 { /* amatch.c:1325:12: */
// in filter.argv[0] if bit-1 and bit-2 are both zero, is in
// filter.argv[1] if exactly one of bit-1 and bit-2 are set, and is in
// filter.argv[2] if both bit-1 and bit-2 are set.
-func amatchBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* amatch.c:1352:12: */
+func amatchBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* amatch.c:1352:12: */
var iPlan int32 = 0
var iDistTerm int32 = -1
var iLangTerm int32 = -1
@@ -13130,7 +15645,7 @@ __2:
__3:
;
if (iPlan & 2) != 0 {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iDistTerm)*8)).FargvIndex = (1 + (crt.Bool32((iPlan & 1) != 0)))
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iDistTerm)*8)).FargvIndex = (1 + (libc.Bool32((iPlan & 1) != 0)))
}
if (iPlan & 4) != 0 {
var idx int32 = 1
@@ -13157,7 +15672,7 @@ __3:
//
// This implementation disallows DELETE and UPDATE. The only thing
// allowed is INSERT into the "command" column.
-func amatchUpdate(tls *crt.TLS, pVTab uintptr, argc int32, argv uintptr, pRowid uintptr) int32 { /* amatch.c:1418:12: */
+func amatchUpdate(tls *libc.TLS, pVTab uintptr, argc int32, argv uintptr, pRowid uintptr) int32 { /* amatch.c:1418:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -13165,20 +15680,20 @@ func amatchUpdate(tls *crt.TLS, pVTab uintptr, argc int32, argv uintptr, pRowid
var zCmd uintptr
_ = pRowid
if argc == 1 {
- (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+2500, /* "DELETE from %s i..." */
- crt.VaList(bp, (*amatch_vtab)(unsafe.Pointer(p)).FzSelf))
+ (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+3656, /* "DELETE from %s i..." */
+ libc.VaList(bp, (*amatch_vtab)(unsafe.Pointer(p)).FzSelf))
return 1
}
if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) != 5 {
- (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+2530, /* "UPDATE of %s is ..." */
- crt.VaList(bp+8, (*amatch_vtab)(unsafe.Pointer(p)).FzSelf))
+ (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+3686, /* "UPDATE of %s is ..." */
+ libc.VaList(bp+8, (*amatch_vtab)(unsafe.Pointer(p)).FzSelf))
return 1
}
if ((sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((2+0))*8))) != 5) ||
(sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((2+1))*8))) != 5)) ||
(sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((2+2))*8))) != 5) {
(*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls,
- ts+2558 /* "INSERT INTO %s a..." */, crt.VaList(bp+16, (*amatch_vtab)(unsafe.Pointer(p)).FzSelf))
+ ts+3714 /* "INSERT INTO %s a..." */, libc.VaList(bp+16, (*amatch_vtab)(unsafe.Pointer(p)).FzSelf))
return 1
}
zCmd = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((2+3))*8)))
@@ -13217,19 +15732,19 @@ uintptr(0), // xShadowName
} /* amatch.c:1454:23 */
// Register the amatch virtual table
-func sqlite3_amatch_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* amatch.c:1489:5: */
+func sqlite3_amatch_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* amatch.c:1489:5: */
var rc int32 = 0
_ = pApi
_ = pzErrMsg // Not used
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+2607 /* "approximate_matc..." */, uintptr(unsafe.Pointer(&amatchModule)), uintptr(0))
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3763 /* "approximate_matc..." */, uintptr(unsafe.Pointer(&amatchModule)), uintptr(0))
return rc
}
// Allowed datatypes
// Names of types
-var azType = [4]uintptr{ts + 2625 /* "int32" */, ts + 2631 /* "int64" */, ts + 2637 /* "double" */, ts + 2644 /* "char*" */} /* carray.c:73:19 */
+var azType = [4]uintptr{ts + 3781 /* "int32" */, ts + 3787 /* "int64" */, ts + 2422 /* "double" */, ts + 3793 /* "char*" */} /* carray.c:73:19 */
// carray_cursor is a subclass of sqlite3_vtab_cursor which will
// serve as the underlying representation of a cursor that scans
@@ -13259,50 +15774,50 @@ type carray_cursor = carray_cursor1 /* carray.c:80:30 */
//
// (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the
// result set of queries against carray will look like.
-func carrayConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* carray.c:102:12: */
+func carrayConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* carray.c:102:12: */
var pNew uintptr
var rc int32
// Column numbers
rc = sqlite3.Xsqlite3_declare_vtab(tls, db,
- ts+2650 /* "CREATE TABLE x(v..." */)
+ ts+3799 /* "CREATE TABLE x(v..." */)
if rc == 0 {
- pNew = crt.AssignPtrUintptr(ppVtab, sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(sqlite3_vtab{}))))
+ pNew = libc.AssignPtrUintptr(ppVtab, sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(sqlite3_vtab{}))))
if pNew == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(sqlite3_vtab{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(sqlite3_vtab{})))
}
return rc
}
// This method is the destructor for carray_cursor objects.
-func carrayDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* carray.c:131:12: */
+func carrayDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* carray.c:131:12: */
sqlite3.Xsqlite3_free(tls, pVtab)
return 0
}
// Constructor for a new carray_cursor object.
-func carrayOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* carray.c:139:12: */
+func carrayOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* carray.c:139:12: */
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(carray_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(carray_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(carray_cursor{})))
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
return 0
}
// Destructor for a carray_cursor.
-func carrayClose(tls *crt.TLS, cur uintptr) int32 { /* carray.c:151:12: */
+func carrayClose(tls *libc.TLS, cur uintptr) int32 { /* carray.c:151:12: */
sqlite3.Xsqlite3_free(tls, cur)
return 0
}
// Advance a carray_cursor to its next row of output.
-func carrayNext(tls *crt.TLS, cur uintptr) int32 { /* carray.c:160:12: */
+func carrayNext(tls *libc.TLS, cur uintptr) int32 { /* carray.c:160:12: */
var pCur uintptr = cur
(*carray_cursor)(unsafe.Pointer(pCur)).FiRowid++
return 0
@@ -13310,7 +15825,7 @@ func carrayNext(tls *crt.TLS, cur uintptr) int32 { /* carray.c:160:12: */
// Return values of columns for the row at which the carray_cursor
// is currently pointing.
-func carrayColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* carray.c:170:12: */
+func carrayColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* carray.c:170:12: */
var pCur uintptr = cur
var x sqlite3_int64 = int64(0)
switch i {
@@ -13348,7 +15863,7 @@ func carrayColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* ca
case 3:
{
var p uintptr = (*carray_cursor)(unsafe.Pointer(pCur)).FpPtr
- sqlite3.Xsqlite3_result_text(tls, ctx, *(*uintptr)(unsafe.Pointer(p + uintptr(((*carray_cursor)(unsafe.Pointer(pCur)).FiRowid-int64(1)))*8)), -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, *(*uintptr)(unsafe.Pointer(p + uintptr(((*carray_cursor)(unsafe.Pointer(pCur)).FiRowid-int64(1)))*8)), -1, libc.UintptrFromInt32(-1))
return 0
}
}
@@ -13360,7 +15875,7 @@ func carrayColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* ca
// Return the rowid for the current row. In this implementation, the
// rowid is the same as the output value.
-func carrayRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* carray.c:217:12: */
+func carrayRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* carray.c:217:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*carray_cursor)(unsafe.Pointer(pCur)).FiRowid
return 0
@@ -13368,20 +15883,20 @@ func carrayRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* carray.c:
// Return TRUE if the cursor has been moved off of the last
// row of output.
-func carrayEof(tls *crt.TLS, cur uintptr) int32 { /* carray.c:227:12: */
+func carrayEof(tls *libc.TLS, cur uintptr) int32 { /* carray.c:227:12: */
var pCur uintptr = cur
- return (crt.Bool32((*carray_cursor)(unsafe.Pointer(pCur)).FiRowid > (*carray_cursor)(unsafe.Pointer(pCur)).FiCnt))
+ return (libc.Bool32((*carray_cursor)(unsafe.Pointer(pCur)).FiRowid > (*carray_cursor)(unsafe.Pointer(pCur)).FiCnt))
}
// This method is called to "rewind" the carray_cursor object back
// to the first row of output.
-func carrayFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* carray.c:236:12: */
+func carrayFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* carray.c:236:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var pCur uintptr = pVtabCursor
if idxNum != 0 {
- (*carray_cursor)(unsafe.Pointer(pCur)).FpPtr = sqlite3.Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), ts+2713 /* "carray" */)
+ (*carray_cursor)(unsafe.Pointer(pCur)).FpPtr = sqlite3.Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), ts+3862 /* "carray" */)
(*carray_cursor)(unsafe.Pointer(pCur)).FiCnt = func() int64 {
if (*carray_cursor)(unsafe.Pointer(pCur)).FpPtr != 0 {
return sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -13400,7 +15915,7 @@ func carrayFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
}
if uint64(i) >= (uint64(unsafe.Sizeof(azType)) / uint64(unsafe.Sizeof(uintptr(0)))) {
(*sqlite3_vtab)(unsafe.Pointer((*sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls,
- ts+2720 /* "unknown datatype..." */, crt.VaList(bp, zType))
+ ts+3869 /* "unknown datatype..." */, libc.VaList(bp, zType))
return 1
} else {
(*carray_cursor)(unsafe.Pointer(pCur)).FeType = i
@@ -13425,7 +15940,7 @@ func carrayFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
// idxNum is 2 if the pointer= and count= constraints exist,
// 3 if the ctype= constraint also exists, and is 0 otherwise.
// If idxNum is 0, then carray becomes an empty table.
-func carrayBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* carray.c:282:12: */
+func carrayBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* carray.c:282:12: */
var i int32 // Loop over constraints
var ptrIdx int32 = -1 // Index of the pointer= constraint, or -1 if none
var cntIdx int32 = -1 // Index of the count= constraint, or -1 if none
@@ -13517,7 +16032,7 @@ uintptr(0), // xRename
// a pointer.
//
// This is for testing on TCL only.
-func inttoptrFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* carray.c:366:13: */
+func inttoptrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* carray.c:366:13: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -13527,23 +16042,23 @@ func inttoptrFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
*(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* i64 */)) = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
if uint64(unsafe.Sizeof(sqlite3_int64(0))) == uint64(unsafe.Sizeof(uintptr(0))) {
- crt.Xmemcpy(tls, bp /* &p */, bp+8 /* &i64 */, uint64(unsafe.Sizeof(uintptr(0))))
+ libc.Xmemcpy(tls, bp /* &p */, bp+8 /* &i64 */, uint64(unsafe.Sizeof(uintptr(0))))
} else {
*(*int32)(unsafe.Pointer(bp + 16 /* i32 */)) = (int32(*(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* i64 */)) & int64(0xffffffff)))
- crt.Xmemcpy(tls, bp /* &p */, bp+16 /* &i32 */, uint64(unsafe.Sizeof(uintptr(0))))
+ libc.Xmemcpy(tls, bp /* &p */, bp+16 /* &i32 */, uint64(unsafe.Sizeof(uintptr(0))))
}
- sqlite3.Xsqlite3_result_pointer(tls, context, *(*uintptr)(unsafe.Pointer(bp /* p */)), ts+2713 /* "carray" */, uintptr(0))
+ sqlite3.Xsqlite3_result_pointer(tls, context, *(*uintptr)(unsafe.Pointer(bp /* p */)), ts+3862 /* "carray" */, uintptr(0))
}
-func sqlite3_carray_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* carray.c:389:5: */
+func sqlite3_carray_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* carray.c:389:5: */
var rc int32 = 0
_ = pApi
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+2713 /* "carray" */, uintptr(unsafe.Pointer(&carrayModule)), uintptr(0))
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3862 /* "carray" */, uintptr(unsafe.Pointer(&carrayModule)), uintptr(0))
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+2741 /* "inttoptr" */, 1, 1, uintptr(0),
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+3890 /* "inttoptr" */, 1, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{inttoptrFunc})), uintptr(0), uintptr(0))
}
return rc
@@ -13597,7 +16112,7 @@ type closure_avl = closure_avl1 /* closure.c:159:28 */
// Recompute the closure_avl.height and closure_avl.imbalance fields for p.
// Assume that the children of p have correct heights.
-func closureAvlRecomputeHeight(tls *crt.TLS, p uintptr) { /* closure.c:182:13: */
+func closureAvlRecomputeHeight(tls *libc.TLS, p uintptr) { /* closure.c:182:13: */
var hBefore int16
if (*closure_avl)(unsafe.Pointer(p)).FpBefore != 0 {
hBefore = (*closure_avl)(unsafe.Pointer((*closure_avl)(unsafe.Pointer(p)).FpBefore)).Fheight
@@ -13623,7 +16138,7 @@ func closureAvlRecomputeHeight(tls *crt.TLS, p uintptr) { /* closure.c:182:13: *
// / \ / ** B Z ==> X P
// / \ / ** X Y Y Z
//
-func closureAvlRotateBefore(tls *crt.TLS, pP uintptr) uintptr { /* closure.c:197:20: */
+func closureAvlRotateBefore(tls *libc.TLS, pP uintptr) uintptr { /* closure.c:197:20: */
var pB uintptr = (*closure_avl)(unsafe.Pointer(pP)).FpBefore
var pY uintptr = (*closure_avl)(unsafe.Pointer(pB)).FpAfter
(*closure_avl)(unsafe.Pointer(pB)).FpUp = (*closure_avl)(unsafe.Pointer(pP)).FpUp
@@ -13642,7 +16157,7 @@ func closureAvlRotateBefore(tls *crt.TLS, pP uintptr) uintptr { /* closure.c:197
// / \ / ** X A ==> P Z
// / \ / ** Y Z X Y
//
-func closureAvlRotateAfter(tls *crt.TLS, pP uintptr) uintptr { /* closure.c:218:20: */
+func closureAvlRotateAfter(tls *libc.TLS, pP uintptr) uintptr { /* closure.c:218:20: */
var pA uintptr = (*closure_avl)(unsafe.Pointer(pP)).FpAfter
var pY uintptr = (*closure_avl)(unsafe.Pointer(pA)).FpBefore
(*closure_avl)(unsafe.Pointer(pA)).FpUp = (*closure_avl)(unsafe.Pointer(pP)).FpUp
@@ -13659,7 +16174,7 @@ func closureAvlRotateAfter(tls *crt.TLS, pP uintptr) uintptr { /* closure.c:218:
// Return a pointer to the pBefore or pAfter pointer in the parent
// of p that points to p. Or if p is the root node, return pp.
-func closureAvlFromPtr(tls *crt.TLS, p uintptr, pp uintptr) uintptr { /* closure.c:235:20: */
+func closureAvlFromPtr(tls *libc.TLS, p uintptr, pp uintptr) uintptr { /* closure.c:235:20: */
var pUp uintptr = (*closure_avl)(unsafe.Pointer(p)).FpUp
if pUp == uintptr(0) {
return pp
@@ -13672,7 +16187,7 @@ func closureAvlFromPtr(tls *crt.TLS, p uintptr, pp uintptr) uintptr { /* closure
// Rebalance all nodes starting with p and working up to the root.
// Return the new root.
-func closureAvlBalance(tls *crt.TLS, p uintptr) uintptr { /* closure.c:246:20: */
+func closureAvlBalance(tls *libc.TLS, p uintptr) uintptr { /* closure.c:246:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = p
@@ -13687,14 +16202,14 @@ func closureAvlBalance(tls *crt.TLS, p uintptr) uintptr { /* closure.c:246:20: *
(*closure_avl)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).FpBefore = closureAvlRotateAfter(tls, pB)
}
pp = closureAvlFromPtr(tls, *(*uintptr)(unsafe.Pointer(bp /* p */)), bp /* &p */)
- *(*uintptr)(unsafe.Pointer(bp /* p */)) = crt.AssignPtrUintptr(pp, closureAvlRotateBefore(tls, *(*uintptr)(unsafe.Pointer(bp /* p */))))
+ *(*uintptr)(unsafe.Pointer(bp /* p */)) = libc.AssignPtrUintptr(pp, closureAvlRotateBefore(tls, *(*uintptr)(unsafe.Pointer(bp /* p */))))
} else if int32((*closure_avl)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).Fimbalance) <= (-2) {
var pA uintptr = (*closure_avl)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).FpAfter
if int32((*closure_avl)(unsafe.Pointer(pA)).Fimbalance) > 0 {
(*closure_avl)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).FpAfter = closureAvlRotateBefore(tls, pA)
}
pp = closureAvlFromPtr(tls, *(*uintptr)(unsafe.Pointer(bp /* p */)), bp /* &p */)
- *(*uintptr)(unsafe.Pointer(bp /* p */)) = crt.AssignPtrUintptr(pp, closureAvlRotateAfter(tls, *(*uintptr)(unsafe.Pointer(bp /* p */))))
+ *(*uintptr)(unsafe.Pointer(bp /* p */)) = libc.AssignPtrUintptr(pp, closureAvlRotateAfter(tls, *(*uintptr)(unsafe.Pointer(bp /* p */))))
}
pTop = *(*uintptr)(unsafe.Pointer(bp /* p */))
*(*uintptr)(unsafe.Pointer(bp /* p */)) = (*closure_avl)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* p */)))).FpUp
@@ -13704,7 +16219,7 @@ func closureAvlBalance(tls *crt.TLS, p uintptr) uintptr { /* closure.c:246:20: *
// Search the tree rooted at p for an entry with id. Return a pointer
// to the entry or return NULL.
-func closureAvlSearch(tls *crt.TLS, p uintptr, id sqlite3_int64) uintptr { /* closure.c:271:20: */
+func closureAvlSearch(tls *libc.TLS, p uintptr, id sqlite3_int64) uintptr { /* closure.c:271:20: */
for (p != 0) && (id != (*closure_avl)(unsafe.Pointer(p)).Fid) {
if id < (*closure_avl)(unsafe.Pointer(p)).Fid {
p = (*closure_avl)(unsafe.Pointer(p)).FpBefore
@@ -13716,7 +16231,7 @@ func closureAvlSearch(tls *crt.TLS, p uintptr, id sqlite3_int64) uintptr { /* cl
}
// Find the first node (the one with the smallest key).
-func closureAvlFirst(tls *crt.TLS, p uintptr) uintptr { /* closure.c:280:20: */
+func closureAvlFirst(tls *libc.TLS, p uintptr) uintptr { /* closure.c:280:20: */
if p != 0 {
for (*closure_avl)(unsafe.Pointer(p)).FpBefore != 0 {
p = (*closure_avl)(unsafe.Pointer(p)).FpBefore
@@ -13726,7 +16241,7 @@ func closureAvlFirst(tls *crt.TLS, p uintptr) uintptr { /* closure.c:280:20: */
}
// Return the node with the next larger key after p.
-func closureAvlNext(tls *crt.TLS, p uintptr) uintptr { /* closure.c:287:13: */
+func closureAvlNext(tls *libc.TLS, p uintptr) uintptr { /* closure.c:287:13: */
var pPrev uintptr = uintptr(0)
for (p != 0) && ((*closure_avl)(unsafe.Pointer(p)).FpAfter == pPrev) {
pPrev = p
@@ -13741,7 +16256,7 @@ func closureAvlNext(tls *crt.TLS, p uintptr) uintptr { /* closure.c:287:13: */
// Insert a new node pNew. Return NULL on success. If the key is not
// unique, then do not perform the insert but instead leave pNew unchanged
// and return a pointer to an existing node with the same key.
-func closureAvlInsert(tls *crt.TLS, ppHead uintptr, pNew uintptr) uintptr { /* closure.c:303:20: */
+func closureAvlInsert(tls *libc.TLS, ppHead uintptr, pNew uintptr) uintptr { /* closure.c:303:20: */
var p uintptr = *(*uintptr)(unsafe.Pointer(ppHead))
if p == uintptr(0) {
p = pNew
@@ -13778,16 +16293,16 @@ func closureAvlInsert(tls *crt.TLS, ppHead uintptr, pNew uintptr) uintptr { /* c
}
// Walk the tree can call xDestroy on each node
-func closureAvlDestroy(tls *crt.TLS, p uintptr, xDestroy uintptr) { /* closure.c:344:13: */
+func closureAvlDestroy(tls *libc.TLS, p uintptr, xDestroy uintptr) { /* closure.c:344:13: */
if p != 0 {
closureAvlDestroy(tls, (*closure_avl)(unsafe.Pointer(p)).FpBefore, xDestroy)
closureAvlDestroy(tls, (*closure_avl)(unsafe.Pointer(p)).FpAfter, xDestroy)
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer(&xDestroy)))(tls, p)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&xDestroy)))(tls, p)
}
}
// Add a node to the end of the queue
-func queuePush(tls *crt.TLS, pQueue uintptr, pNode uintptr) { /* closure.c:389:13: */
+func queuePush(tls *libc.TLS, pQueue uintptr, pNode uintptr) { /* closure.c:389:13: */
(*closure_avl)(unsafe.Pointer(pNode)).FpList = uintptr(0)
if (*closure_queue)(unsafe.Pointer(pQueue)).FpLast != 0 {
(*closure_avl)(unsafe.Pointer((*closure_queue)(unsafe.Pointer(pQueue)).FpLast)).FpList = pNode
@@ -13798,7 +16313,7 @@ func queuePush(tls *crt.TLS, pQueue uintptr, pNode uintptr) { /* closure.c:389:1
}
// Extract the oldest element (the front element) from the queue.
-func queuePull(tls *crt.TLS, pQueue uintptr) uintptr { /* closure.c:402:20: */
+func queuePull(tls *libc.TLS, pQueue uintptr) uintptr { /* closure.c:402:20: */
var p uintptr = (*closure_queue)(unsafe.Pointer(pQueue)).FpFirst
if p != 0 {
(*closure_queue)(unsafe.Pointer(pQueue)).FpFirst = (*closure_avl)(unsafe.Pointer(p)).FpList
@@ -13820,17 +16335,17 @@ func queuePull(tls *crt.TLS, pQueue uintptr) uintptr { /* closure.c:402:20: */
// 'xyz' becomes xyz
// [pqr] becomes pqr
// `mno` becomes mno
-func closureDequote(tls *crt.TLS, zIn uintptr) uintptr { /* closure.c:424:13: */
+func closureDequote(tls *libc.TLS, zIn uintptr) uintptr { /* closure.c:424:13: */
var nIn sqlite3_int64 // Size of input string, in bytes
var zOut uintptr // Output (dequoted) string
- nIn = sqlite3_int64(crt.Xstrlen(tls, zIn))
+ nIn = sqlite3_int64(libc.Xstrlen(tls, zIn))
zOut = sqlite3.Xsqlite3_malloc64(tls, (uint64(nIn + int64(1))))
if zOut != 0 {
var q int8 = *(*int8)(unsafe.Pointer(zIn + uintptr(0))) // Quote character (if any )
if (((int32(q) != '[') && (int32(q) != '\'')) && (int32(q) != '"')) && (int32(q) != '`') {
- crt.Xmemcpy(tls, zOut, zIn, (size_t(nIn + int64(1))))
+ libc.Xmemcpy(tls, zOut, zIn, (size_t(nIn + int64(1))))
} else {
var iOut int32 = 0 // Index of next byte to write to output
var iIn int32 // Index of next byte to read from input
@@ -13842,7 +16357,7 @@ func closureDequote(tls *crt.TLS, zIn uintptr) uintptr { /* closure.c:424:13: */
if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(iIn)))) == int32(q) {
iIn++
}
- *(*int8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(zIn + uintptr(iIn)))
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(zIn + uintptr(iIn)))
}
}
}
@@ -13850,20 +16365,20 @@ func closureDequote(tls *crt.TLS, zIn uintptr) uintptr { /* closure.c:424:13: */
}
// Deallocate an closure_vtab object
-func closureFree(tls *crt.TLS, p uintptr) { /* closure.c:453:13: */
+func closureFree(tls *libc.TLS, p uintptr) { /* closure.c:453:13: */
if p != 0 {
sqlite3.Xsqlite3_free(tls, (*closure_vtab)(unsafe.Pointer(p)).FzDb)
sqlite3.Xsqlite3_free(tls, (*closure_vtab)(unsafe.Pointer(p)).FzSelf)
sqlite3.Xsqlite3_free(tls, (*closure_vtab)(unsafe.Pointer(p)).FzTableName)
sqlite3.Xsqlite3_free(tls, (*closure_vtab)(unsafe.Pointer(p)).FzIdColumn)
sqlite3.Xsqlite3_free(tls, (*closure_vtab)(unsafe.Pointer(p)).FzParentColumn)
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(closure_vtab{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(closure_vtab{})))
sqlite3.Xsqlite3_free(tls, p)
}
}
// xDisconnect/xDestroy method for the closure module.
-func closureDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* closure.c:468:12: */
+func closureDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* closure.c:468:12: */
var p uintptr = pVtab
closureFree(tls, p)
@@ -13876,23 +16391,23 @@ func closureDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* closure.c:468:12:
//
// If it is, return a pointer to the first character of VALUE.
// If not, return NULL. Spaces around the = are ignored.
-func closureValueOfKey(tls *crt.TLS, zKey uintptr, zStr uintptr) uintptr { /* closure.c:483:19: */
- var nKey int32 = int32(crt.Xstrlen(tls, zKey))
- var nStr int32 = int32(crt.Xstrlen(tls, zStr))
+func closureValueOfKey(tls *libc.TLS, zKey uintptr, zStr uintptr) uintptr { /* closure.c:483:19: */
+ var nKey int32 = int32(libc.Xstrlen(tls, zKey))
+ var nStr int32 = int32(libc.Xstrlen(tls, zStr))
var i int32
if nStr < (nKey + 1) {
return uintptr(0)
}
- if crt.Xmemcmp(tls, zStr, zKey, uint64(nKey)) != 0 {
+ if libc.Xmemcmp(tls, zStr, zKey, uint64(nKey)) != 0 {
return uintptr(0)
}
- for i = nKey; (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zStr + uintptr(i))))))*2))) & int32(_ISspace)) != 0; i++ {
+ for i = nKey; (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zStr + uintptr(i))))))*2))) & int32(_ISspace)) != 0; i++ {
}
if int32(*(*int8)(unsafe.Pointer(zStr + uintptr(i)))) != '=' {
return uintptr(0)
}
i++
- for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zStr + uintptr(i))))))*2))) & int32(_ISspace)) != 0 {
+ for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zStr + uintptr(i))))))*2))) & int32(_ISspace)) != 0 {
i++
}
return (zStr + uintptr(i))
@@ -13904,7 +16419,7 @@ func closureValueOfKey(tls *crt.TLS, zKey uintptr, zStr uintptr) uintptr { /* cl
// argv[1] -> database name
// argv[2] -> table name
// argv[3...] -> arguments
-func closureConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* closure.c:504:12: */
+func closureConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* closure.c:504:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -13927,16 +16442,16 @@ func closureConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uin
__1:
;
rc = 7
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(closure_vtab{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(closure_vtab{})))
(*closure_vtab)(unsafe.Pointer(pNew)).Fdb = db
- (*closure_vtab)(unsafe.Pointer(pNew)).FzDb = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, zDb))
+ (*closure_vtab)(unsafe.Pointer(pNew)).FzDb = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, zDb))
if !((*closure_vtab)(unsafe.Pointer(pNew)).FzDb == uintptr(0)) {
goto __2
}
goto closureConnectError
__2:
;
- (*closure_vtab)(unsafe.Pointer(pNew)).FzSelf = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ (*closure_vtab)(unsafe.Pointer(pNew)).FzSelf = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
if !((*closure_vtab)(unsafe.Pointer(pNew)).FzSelf == uintptr(0)) {
goto __3
}
@@ -13948,7 +16463,7 @@ __4:
if !(i < argc) {
goto __6
}
- zVal = closureValueOfKey(tls, ts+2750 /* "tablename" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ zVal = closureValueOfKey(tls, ts+3899 /* "tablename" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
if !(zVal != 0) {
goto __7
}
@@ -13963,7 +16478,7 @@ __8:
goto __5
__7:
;
- zVal = closureValueOfKey(tls, ts+2760 /* "idcolumn" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ zVal = closureValueOfKey(tls, ts+3909 /* "idcolumn" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
if !(zVal != 0) {
goto __9
}
@@ -13978,7 +16493,7 @@ __10:
goto __5
__9:
;
- zVal = closureValueOfKey(tls, ts+2769 /* "parentcolumn" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ zVal = closureValueOfKey(tls, ts+3918 /* "parentcolumn" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
if !(zVal != 0) {
goto __11
}
@@ -13993,7 +16508,7 @@ __12:
goto __5
__11:
;
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+2194 /* "unrecognized arg..." */, crt.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3350 /* "unrecognized arg..." */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
closureFree(tls, pNew)
*(*uintptr)(unsafe.Pointer(ppVtab)) = uintptr(0)
return 1
@@ -14006,7 +16521,7 @@ __6:
;
rc = sqlite3.Xsqlite3_declare_vtab(tls, db,
- ts+2782 /* "CREATE TABLE x(i..." */)
+ ts+3931 /* "CREATE TABLE x(i..." */)
if !(rc != 0) {
goto __13
}
@@ -14022,14 +16537,14 @@ closureConnectError:
}
// Open a new closure cursor.
-func closureOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* closure.c:579:12: */
+func closureOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* closure.c:579:12: */
var p uintptr = pVTab
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(closure_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(closure_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(closure_cursor{})))
(*closure_cursor)(unsafe.Pointer(pCur)).FpVtab = p
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
(*closure_vtab)(unsafe.Pointer(p)).FnCursor++
@@ -14038,8 +16553,8 @@ func closureOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* closu
// Free up all the memory allocated by a cursor. Set it rLimit to 0
// to indicate that it is at EOF.
-func closureClearCursor(tls *crt.TLS, pCur uintptr) { /* closure.c:595:13: */
- closureAvlDestroy(tls, (*closure_cursor)(unsafe.Pointer(pCur)).FpClosure, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+func closureClearCursor(tls *libc.TLS, pCur uintptr) { /* closure.c:595:13: */
+ closureAvlDestroy(tls, (*closure_cursor)(unsafe.Pointer(pCur)).FpClosure, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
sqlite3.Xsqlite3_free(tls, (*closure_cursor)(unsafe.Pointer(pCur)).FzTableName)
sqlite3.Xsqlite3_free(tls, (*closure_cursor)(unsafe.Pointer(pCur)).FzIdColumn)
sqlite3.Xsqlite3_free(tls, (*closure_cursor)(unsafe.Pointer(pCur)).FzParentColumn)
@@ -14051,7 +16566,7 @@ func closureClearCursor(tls *crt.TLS, pCur uintptr) { /* closure.c:595:13: */
}
// Close a closure cursor.
-func closureClose(tls *crt.TLS, cur uintptr) int32 { /* closure.c:610:12: */
+func closureClose(tls *libc.TLS, cur uintptr) int32 { /* closure.c:610:12: */
var pCur uintptr = cur
closureClearCursor(tls, pCur)
(*closure_vtab)(unsafe.Pointer((*closure_cursor)(unsafe.Pointer(pCur)).FpVtab)).FnCursor--
@@ -14060,19 +16575,19 @@ func closureClose(tls *crt.TLS, cur uintptr) int32 { /* closure.c:610:12: */
}
// Advance a cursor to its next row of output
-func closureNext(tls *crt.TLS, cur uintptr) int32 { /* closure.c:621:12: */
+func closureNext(tls *libc.TLS, cur uintptr) int32 { /* closure.c:621:12: */
var pCur uintptr = cur
(*closure_cursor)(unsafe.Pointer(pCur)).FpCurrent = closureAvlNext(tls, (*closure_cursor)(unsafe.Pointer(pCur)).FpCurrent)
return 0
}
// Allocate and insert a node
-func closureInsertNode(tls *crt.TLS, pQueue uintptr, pCur uintptr, id sqlite3_int64, iGeneration int32) int32 { /* closure.c:630:12: */
+func closureInsertNode(tls *libc.TLS, pQueue uintptr, pCur uintptr, id sqlite3_int64, iGeneration int32) int32 { /* closure.c:630:12: */
var pNew uintptr = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(closure_avl{})))
if pNew == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(closure_avl{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(closure_avl{})))
(*closure_avl)(unsafe.Pointer(pNew)).Fid = id
(*closure_avl)(unsafe.Pointer(pNew)).FiGeneration = iGeneration
closureAvlInsert(tls, (pCur + 48 /* &.pClosure */), pNew)
@@ -14089,7 +16604,7 @@ func closureInsertNode(tls *crt.TLS, pQueue uintptr, pCur uintptr, id sqlite3_in
// See the comment at the beginning of closureBestIndex() for a
// description of the meaning of idxNum. The idxStr parameter is
// not used.
-func closureFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* closure.c:657:12: */
+func closureFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* closure.c:657:12: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -14110,7 +16625,7 @@ func closureFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp
_ = idxStr // Unused parameter
_ = argc // Unused parameter
closureClearCursor(tls, pCur)
- crt.Xmemset(tls, bp+72 /* &sQueue */, 0, uint64(unsafe.Sizeof(closure_queue{})))
+ libc.Xmemset(tls, bp+72 /* &sQueue */, 0, uint64(unsafe.Sizeof(closure_queue{})))
if (idxNum & 1) == 0 {
// No root=$root in the WHERE clause. Return an empty set
return 0
@@ -14124,20 +16639,20 @@ func closureFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp
}
if (idxNum & 0x00f00) != 0 {
zTableName = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(((idxNum>>8)&0x0f))*8)))
- (*closure_cursor)(unsafe.Pointer(pCur)).FzTableName = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, zTableName))
+ (*closure_cursor)(unsafe.Pointer(pCur)).FzTableName = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, zTableName))
}
if (idxNum & 0x0f000) != 0 {
zIdColumn = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(((idxNum>>12)&0x0f))*8)))
- (*closure_cursor)(unsafe.Pointer(pCur)).FzIdColumn = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+8, zIdColumn))
+ (*closure_cursor)(unsafe.Pointer(pCur)).FzIdColumn = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+8, zIdColumn))
}
if (idxNum & 0x0f0000) != 0 {
zParentColumn = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(((idxNum>>16)&0x0f))*8)))
- (*closure_cursor)(unsafe.Pointer(pCur)).FzParentColumn = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+16, zParentColumn))
+ (*closure_cursor)(unsafe.Pointer(pCur)).FzParentColumn = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+16, zParentColumn))
}
zSql = sqlite3.Xsqlite3_mprintf(tls,
- ts+2872, /* "SELECT \"%w\".\"%w\"..." */
- crt.VaList(bp+24, zTableName, zIdColumn, zTableName, zTableName, zParentColumn))
+ ts+4021, /* "SELECT \"%w\".\"%w\"..." */
+ libc.VaList(bp+24, zTableName, zIdColumn, zTableName, zTableName, zParentColumn))
if zSql == uintptr(0) {
return 7
} else {
@@ -14145,14 +16660,14 @@ func closureFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp
sqlite3.Xsqlite3_free(tls, zSql)
if rc != 0 {
sqlite3.Xsqlite3_free(tls, (*closure_vtab)(unsafe.Pointer(pVtab)).Fbase.FzErrMsg)
- (*closure_vtab)(unsafe.Pointer(pVtab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+64, sqlite3.Xsqlite3_errmsg(tls, (*closure_vtab)(unsafe.Pointer(pVtab)).Fdb)))
+ (*closure_vtab)(unsafe.Pointer(pVtab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+64, sqlite3.Xsqlite3_errmsg(tls, (*closure_vtab)(unsafe.Pointer(pVtab)).Fdb)))
return rc
}
}
if rc == 0 {
rc = closureInsertNode(tls, bp+72 /* &sQueue */, pCur, iRoot, 0)
}
- for (crt.AssignUintptr(&pAvl, queuePull(tls, bp+72 /* &sQueue */))) != uintptr(0) {
+ for (libc.AssignUintptr(&pAvl, queuePull(tls, bp+72 /* &sQueue */))) != uintptr(0) {
if (*closure_avl)(unsafe.Pointer(pAvl)).FiGeneration >= mxGen {
continue
}
@@ -14177,7 +16692,7 @@ func closureFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp
// Only the word and distance columns have values. All other columns
// return NULL
-func closureColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* closure.c:743:12: */
+func closureColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* closure.c:743:12: */
var pCur uintptr = cur
switch i {
case 0:
@@ -14204,7 +16719,7 @@ func closureColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* c
}
return (*closure_vtab)(unsafe.Pointer((*closure_cursor)(unsafe.Pointer(pCur)).FpVtab)).FzTableName
}(),
- -1, crt.UintptrFromInt32(-1))
+ -1, libc.UintptrFromInt32(-1))
break
}
case 4:
@@ -14216,7 +16731,7 @@ func closureColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* c
}
return (*closure_vtab)(unsafe.Pointer((*closure_cursor)(unsafe.Pointer(pCur)).FpVtab)).FzIdColumn
}(),
- -1, crt.UintptrFromInt32(-1))
+ -1, libc.UintptrFromInt32(-1))
break
}
case 5:
@@ -14228,7 +16743,7 @@ func closureColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* c
}
return (*closure_vtab)(unsafe.Pointer((*closure_cursor)(unsafe.Pointer(pCur)).FpVtab)).FzParentColumn
}(),
- -1, crt.UintptrFromInt32(-1))
+ -1, libc.UintptrFromInt32(-1))
break
}
}
@@ -14236,16 +16751,16 @@ func closureColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* c
}
// The rowid. For the closure table, this is the same as the "id" column.
-func closureRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* closure.c:783:12: */
+func closureRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* closure.c:783:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*closure_avl)(unsafe.Pointer((*closure_cursor)(unsafe.Pointer(pCur)).FpCurrent)).Fid
return 0
}
// EOF indicator
-func closureEof(tls *crt.TLS, cur uintptr) int32 { /* closure.c:792:12: */
+func closureEof(tls *libc.TLS, cur uintptr) int32 { /* closure.c:792:12: */
var pCur uintptr = cur
- return (crt.Bool32((*closure_cursor)(unsafe.Pointer(pCur)).FpCurrent == uintptr(0)))
+ return (libc.Bool32((*closure_cursor)(unsafe.Pointer(pCur)).FpCurrent == uintptr(0)))
}
// Search for terms of these forms:
@@ -14271,7 +16786,7 @@ func closureEof(tls *crt.TLS, cur uintptr) int32 { /* closure.c:792:12: */
//
// There must be a term of type (A). If there is not, then the index type
// is 0 and the query will return an empty set.
-func closureBestIndex(tls *crt.TLS, pTab uintptr, pIdxInfo uintptr) int32 { /* closure.c:822:12: */
+func closureBestIndex(tls *libc.TLS, pTab uintptr, pIdxInfo uintptr) int32 { /* closure.c:822:12: */
var iPlan int32 = 0
var i int32
var idx int32 = 1
@@ -14303,7 +16818,7 @@ __1:
(int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) == 8)) ||
(int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) == 2)) {
iPlan = iPlan | (idx << 4)
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = crt.PreIncInt32(&idx, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&idx, 1)
if int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) == 16 {
iPlan = iPlan | (0x000002)
}
@@ -14313,7 +16828,7 @@ __1:
((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn == 3)) &&
(int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) == 2) {
iPlan = iPlan | (idx << 8)
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = crt.PreIncInt32(&idx, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&idx, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1)
rCost = rCost / (5.0)
}
@@ -14321,14 +16836,14 @@ __1:
((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn == 4)) &&
(int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) == 2) {
iPlan = iPlan | (idx << 12)
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = crt.PreIncInt32(&idx, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&idx, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1)
}
if (((iPlan & 0x0f0000) == 0) &&
((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn == 5)) &&
(int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) == 2) {
iPlan = iPlan | (idx << 16)
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = crt.PreIncInt32(&idx, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&idx, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1)
}
}
@@ -14412,12 +16927,12 @@ uintptr(0), // xShadowName
} /* closure.c:918:23 */
// Register the closure virtual table
-func sqlite3_closure_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* closure.c:953:5: */
+func sqlite3_closure_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* closure.c:953:5: */
var rc int32 = 0
_ = pApi
_ = pzErrMsg
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+2918 /* "transitive_closu..." */, uintptr(unsafe.Pointer(&closureModule)), uintptr(0))
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4067 /* "transitive_closu..." */, uintptr(unsafe.Pointer(&closureModule)), uintptr(0))
return rc
}
@@ -14460,7 +16975,7 @@ type CsvReader1 = struct {
type CsvReader = CsvReader1 /* csv.c:73:26 */
// Initialize a CsvReader object
-func csv_reader_init(tls *crt.TLS, p uintptr) { /* csv.c:89:13: */
+func csv_reader_init(tls *libc.TLS, p uintptr) { /* csv.c:89:13: */
(*CsvReader)(unsafe.Pointer(p)).Fin = uintptr(0)
(*CsvReader)(unsafe.Pointer(p)).Fz = uintptr(0)
(*CsvReader)(unsafe.Pointer(p)).Fn = 0
@@ -14473,9 +16988,9 @@ func csv_reader_init(tls *crt.TLS, p uintptr) { /* csv.c:89:13: */
}
// Close and reset a CsvReader object
-func csv_reader_reset(tls *crt.TLS, p uintptr) { /* csv.c:102:13: */
+func csv_reader_reset(tls *libc.TLS, p uintptr) { /* csv.c:102:13: */
if (*CsvReader)(unsafe.Pointer(p)).Fin != 0 {
- crt.Xfclose(tls, (*CsvReader)(unsafe.Pointer(p)).Fin)
+ libc.Xfclose(tls, (*CsvReader)(unsafe.Pointer(p)).Fin)
sqlite3.Xsqlite3_free(tls, (*CsvReader)(unsafe.Pointer(p)).FzIn)
}
sqlite3.Xsqlite3_free(tls, (*CsvReader)(unsafe.Pointer(p)).Fz)
@@ -14483,7 +16998,7 @@ func csv_reader_reset(tls *crt.TLS, p uintptr) { /* csv.c:102:13: */
}
// Report an error on a CsvReader
-func csv_errmsg(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) { /* csv.c:112:13: */
+func csv_errmsg(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* csv.c:112:13: */
var ap va_list
_ = ap
ap = va
@@ -14493,7 +17008,7 @@ func csv_errmsg(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) { /* csv.c
// Open the file associated with a CsvReader
// Return the number of errors.
-func csv_reader_open(tls *crt.TLS, p uintptr, zFilename uintptr, zData uintptr) int32 { /* csv.c:122:12: */
+func csv_reader_open(tls *libc.TLS, p uintptr, zFilename uintptr, zData uintptr) int32 { /* csv.c:122:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -14503,30 +17018,30 @@ func csv_reader_open(tls *crt.TLS, p uintptr, zFilename uintptr, zData uintptr)
csv_errmsg(tls, p, ts+1929 /* "out of memory" */, 0)
return 1
}
- (*CsvReader)(unsafe.Pointer(p)).Fin = crt.Xfopen(tls, zFilename, ts+2937 /* "rb" */)
+ (*CsvReader)(unsafe.Pointer(p)).Fin = libc.Xfopen(tls, zFilename, ts+4086 /* "rb" */)
if (*CsvReader)(unsafe.Pointer(p)).Fin == uintptr(0) {
sqlite3.Xsqlite3_free(tls, (*CsvReader)(unsafe.Pointer(p)).FzIn)
csv_reader_reset(tls, p)
- csv_errmsg(tls, p, ts+2940 /* "cannot open '%s'..." */, crt.VaList(bp, zFilename))
+ csv_errmsg(tls, p, ts+4089 /* "cannot open '%s'..." */, libc.VaList(bp, zFilename))
return 1
}
} else {
(*CsvReader)(unsafe.Pointer(p)).FzIn = zData
- (*CsvReader)(unsafe.Pointer(p)).FnIn = crt.Xstrlen(tls, zData)
+ (*CsvReader)(unsafe.Pointer(p)).FnIn = libc.Xstrlen(tls, zData)
}
return 0
}
// The input buffer has overflowed. Refill the input buffer, then
// return the next character
-func csv_getc_refill(tls *crt.TLS, p uintptr) int32 { /* csv.c:151:25: */
+func csv_getc_refill(tls *libc.TLS, p uintptr) int32 { /* csv.c:151:25: */
var got size_t
// Only called on an empty input buffer
// Only called if reading froma file
- got = crt.Xfread(tls, (*CsvReader)(unsafe.Pointer(p)).FzIn, uint64(1), uint64(1024), (*CsvReader)(unsafe.Pointer(p)).Fin)
+ got = libc.Xfread(tls, (*CsvReader)(unsafe.Pointer(p)).FzIn, uint64(1), uint64(1024), (*CsvReader)(unsafe.Pointer(p)).Fin)
if got == uint64(0) {
return -1
}
@@ -14536,26 +17051,26 @@ func csv_getc_refill(tls *crt.TLS, p uintptr) int32 { /* csv.c:151:25: */
}
// Return the next character of input. Return EOF at end of input.
-func csv_getc(tls *crt.TLS, p uintptr) int32 { /* csv.c:165:12: */
+func csv_getc(tls *libc.TLS, p uintptr) int32 { /* csv.c:165:12: */
if (*CsvReader)(unsafe.Pointer(p)).FiIn >= (*CsvReader)(unsafe.Pointer(p)).FnIn {
if (*CsvReader)(unsafe.Pointer(p)).Fin != uintptr(0) {
return csv_getc_refill(tls, p)
}
return -1
}
- return int32(*(*uint8)(unsafe.Pointer(((*CsvReader)(unsafe.Pointer(p)).FzIn) + uintptr(crt.PostIncUint64(&(*CsvReader)(unsafe.Pointer(p)).FiIn, 1)))))
+ return int32(*(*uint8)(unsafe.Pointer(((*CsvReader)(unsafe.Pointer(p)).FzIn) + uintptr(libc.PostIncUint64(&(*CsvReader)(unsafe.Pointer(p)).FiIn, 1)))))
}
// Increase the size of p->z and append character c to the end.
// Return 0 on success and non-zero if there is an OOM error
-func csv_resize_and_append(tls *crt.TLS, p uintptr, c int8) int32 { /* csv.c:175:25: */
+func csv_resize_and_append(tls *libc.TLS, p uintptr, c int8) int32 { /* csv.c:175:25: */
var zNew uintptr
var nNew int32 = (((*CsvReader)(unsafe.Pointer(p)).FnAlloc * 2) + 100)
zNew = sqlite3.Xsqlite3_realloc64(tls, (*CsvReader)(unsafe.Pointer(p)).Fz, uint64(nNew))
if zNew != 0 {
(*CsvReader)(unsafe.Pointer(p)).Fz = zNew
(*CsvReader)(unsafe.Pointer(p)).FnAlloc = nNew
- *(*int8)(unsafe.Pointer((*CsvReader)(unsafe.Pointer(p)).Fz + uintptr(crt.PostIncInt32(&(*CsvReader)(unsafe.Pointer(p)).Fn, 1)))) = c
+ *(*int8)(unsafe.Pointer((*CsvReader)(unsafe.Pointer(p)).Fz + uintptr(libc.PostIncInt32(&(*CsvReader)(unsafe.Pointer(p)).Fn, 1)))) = c
return 0
} else {
csv_errmsg(tls, p, ts+1929 /* "out of memory" */, 0)
@@ -14566,11 +17081,11 @@ func csv_resize_and_append(tls *crt.TLS, p uintptr, c int8) int32 { /* csv.c:175
// Append a single character to the CsvReader.z[] array.
// Return 0 on success and non-zero if there is an OOM error
-func csv_append(tls *crt.TLS, p uintptr, c int8) int32 { /* csv.c:192:12: */
+func csv_append(tls *libc.TLS, p uintptr, c int8) int32 { /* csv.c:192:12: */
if (*CsvReader)(unsafe.Pointer(p)).Fn >= ((*CsvReader)(unsafe.Pointer(p)).FnAlloc - 1) {
return csv_resize_and_append(tls, p, c)
}
- *(*int8)(unsafe.Pointer((*CsvReader)(unsafe.Pointer(p)).Fz + uintptr(crt.PostIncInt32(&(*CsvReader)(unsafe.Pointer(p)).Fn, 1)))) = c
+ *(*int8)(unsafe.Pointer((*CsvReader)(unsafe.Pointer(p)).Fz + uintptr(libc.PostIncInt32(&(*CsvReader)(unsafe.Pointer(p)).Fn, 1)))) = c
return 0
}
@@ -14586,7 +17101,7 @@ func csv_append(tls *crt.TLS, p uintptr, c int8) int32 { /* csv.c:192:12: */
//
// Return 0 at EOF or on OOM. On EOF, the p->cTerm character will have
// been set to EOF.
-func csv_read_one_field(tls *crt.TLS, p uintptr) uintptr { /* csv.c:211:13: */
+func csv_read_one_field(tls *libc.TLS, p uintptr) uintptr { /* csv.c:211:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -14601,7 +17116,7 @@ func csv_read_one_field(tls *crt.TLS, p uintptr) uintptr { /* csv.c:211:13: */
var pc int32
var ppc int32
var startLine int32 = (*CsvReader)(unsafe.Pointer(p)).FnLine
- pc = crt.AssignInt32(&ppc, 0)
+ pc = libc.AssignInt32(&ppc, 0)
for 1 != 0 {
c = csv_getc(tls, p)
if (c <= '"') || (pc == '"') {
@@ -14625,12 +17140,12 @@ func csv_read_one_field(tls *crt.TLS, p uintptr) uintptr { /* csv.c:211:13: */
break
}
if (pc == '"') && (c != '\r') {
- csv_errmsg(tls, p, ts+2969 /* "line %d: unescap..." */, crt.VaList(bp, (*CsvReader)(unsafe.Pointer(p)).FnLine, '"'))
+ csv_errmsg(tls, p, ts+4118 /* "line %d: unescap..." */, libc.VaList(bp, (*CsvReader)(unsafe.Pointer(p)).FnLine, '"'))
break
}
if c == (-1) {
- csv_errmsg(tls, p, ts+3001, /* "line %d: untermi..." */
- crt.VaList(bp+16, startLine, '"'))
+ csv_errmsg(tls, p, ts+4150, /* "line %d: untermi..." */
+ libc.VaList(bp+16, startLine, '"'))
(*CsvReader)(unsafe.Pointer(p)).FcTerm = int32(int8(c))
break
}
@@ -14708,16 +17223,16 @@ type CsvCursor1 = struct {
type CsvCursor = CsvCursor1 /* csv.c:326:3 */
// Transfer error message text from a reader into a CsvTable
-func csv_xfer_error(tls *crt.TLS, pTab uintptr, pRdr uintptr) { /* csv.c:329:13: */
+func csv_xfer_error(tls *libc.TLS, pTab uintptr, pRdr uintptr) { /* csv.c:329:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
sqlite3.Xsqlite3_free(tls, (*CsvTable)(unsafe.Pointer(pTab)).Fbase.FzErrMsg)
- (*CsvTable)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, pRdr+64 /* &.zErr */))
+ (*CsvTable)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, pRdr+64 /* &.zErr */))
}
// This method is the destructor fo a CsvTable object.
-func csvtabDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* csv.c:337:12: */
+func csvtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* csv.c:337:12: */
var p uintptr = pVtab
sqlite3.Xsqlite3_free(tls, (*CsvTable)(unsafe.Pointer(p)).FzFilename)
sqlite3.Xsqlite3_free(tls, (*CsvTable)(unsafe.Pointer(p)).FzData)
@@ -14727,24 +17242,24 @@ func csvtabDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* csv.c:337:12: */
// Skip leading whitespace. Return a pointer to the first non-whitespace
// character, or to the zero terminator if the string has only whitespace
-func csv_skip_whitespace(tls *crt.TLS, z uintptr) uintptr { /* csv.c:347:19: */
- for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISspace)) != 0 {
+func csv_skip_whitespace(tls *libc.TLS, z uintptr) uintptr { /* csv.c:347:19: */
+ for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))))*2))) & int32(_ISspace)) != 0 {
z++
}
return z
}
// Remove trailing whitespace from the end of string z[]
-func csv_trim_whitespace(tls *crt.TLS, z uintptr) { /* csv.c:353:13: */
- var n size_t = crt.Xstrlen(tls, z)
- for (n > uint64(0)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n))))))*2))) & int32(_ISspace)) != 0) {
+func csv_trim_whitespace(tls *libc.TLS, z uintptr) { /* csv.c:353:13: */
+ var n size_t = libc.Xstrlen(tls, z)
+ for (n > uint64(0)) && ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(n))))))*2))) & int32(_ISspace)) != 0) {
n--
}
*(*int8)(unsafe.Pointer(z + uintptr(n))) = int8(0)
}
// Dequote the string
-func csv_dequote(tls *crt.TLS, z uintptr) { /* csv.c:360:13: */
+func csv_dequote(tls *libc.TLS, z uintptr) { /* csv.c:360:13: */
var j int32
var cQuote int8 = *(*int8)(unsafe.Pointer(z + uintptr(0)))
var i size_t
@@ -14753,7 +17268,7 @@ func csv_dequote(tls *crt.TLS, z uintptr) { /* csv.c:360:13: */
if (int32(cQuote) != '\'') && (int32(cQuote) != '"') {
return
}
- n = crt.Xstrlen(tls, z)
+ n = libc.Xstrlen(tls, z)
if (n < uint64(2)) || (int32(*(*int8)(unsafe.Pointer(z + uintptr((n - uint64(1)))))) != int32(*(*int8)(unsafe.Pointer(z + uintptr(0))))) {
return
}
@@ -14763,7 +17278,7 @@ func csv_dequote(tls *crt.TLS, z uintptr) { /* csv.c:360:13: */
if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32(cQuote)) && (int32(*(*int8)(unsafe.Pointer(z + uintptr((i + uint64(1)))))) == int32(cQuote)) {
i++
}
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(i)))
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(i)))
}
*(*int8)(unsafe.Pointer(z + uintptr(j))) = int8(0)
}
@@ -14771,9 +17286,9 @@ func csv_dequote(tls *crt.TLS, z uintptr) { /* csv.c:360:13: */
// Check to see if the string is of the form: "TAG = VALUE" with optional
// whitespace before and around tokens. If it is, return a pointer to the
// first character of VALUE. If it is not, return NULL.
-func csv_parameter(tls *crt.TLS, zTag uintptr, nTag int32, z uintptr) uintptr { /* csv.c:379:19: */
+func csv_parameter(tls *libc.TLS, zTag uintptr, nTag int32, z uintptr) uintptr { /* csv.c:379:19: */
z = csv_skip_whitespace(tls, z)
- if crt.Xstrncmp(tls, zTag, z, uint64(nTag)) != 0 {
+ if libc.Xstrncmp(tls, zTag, z, uint64(nTag)) != 0 {
return uintptr(0)
}
z = csv_skip_whitespace(tls, (z + uintptr(nTag)))
@@ -14788,21 +17303,21 @@ func csv_parameter(tls *crt.TLS, zTag uintptr, nTag int32, z uintptr) uintptr {
// Return 1 if the parameter is seen, or 0 if not. 1 is returned
// even if there is an error. If an error occurs, then an error message
// is left in p->zErr. If there are no errors, p->zErr[0]==0.
-func csv_string_parameter(tls *crt.TLS, p uintptr, zParam uintptr, zArg uintptr, pzVal uintptr) int32 { /* csv.c:393:12: */
+func csv_string_parameter(tls *libc.TLS, p uintptr, zParam uintptr, zArg uintptr, pzVal uintptr) int32 { /* csv.c:393:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
var zValue uintptr
- zValue = csv_parameter(tls, zParam, int32(crt.Xstrlen(tls, zParam)), zArg)
+ zValue = csv_parameter(tls, zParam, int32(libc.Xstrlen(tls, zParam)), zArg)
if zValue == uintptr(0) {
return 0
}
*(*int8)(unsafe.Pointer((p + 64 /* &.zErr */) + uintptr(0))) = int8(0)
if *(*uintptr)(unsafe.Pointer(pzVal)) != 0 {
- csv_errmsg(tls, p, ts+3040 /* "more than one '%..." */, crt.VaList(bp, zParam))
+ csv_errmsg(tls, p, ts+4189 /* "more than one '%..." */, libc.VaList(bp, zParam))
return 1
}
- *(*uintptr)(unsafe.Pointer(pzVal)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+8, zValue))
+ *(*uintptr)(unsafe.Pointer(pzVal)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+8, zValue))
if *(*uintptr)(unsafe.Pointer(pzVal)) == uintptr(0) {
csv_errmsg(tls, p, ts+1929 /* "out of memory" */, 0)
return 1
@@ -14814,16 +17329,16 @@ func csv_string_parameter(tls *crt.TLS, p uintptr, zParam uintptr, zArg uintptr,
// Return 0 if the argument is false and 1 if it is true. Return -1 if
// we cannot really tell.
-func csv_boolean(tls *crt.TLS, z uintptr) int32 { /* csv.c:421:12: */
- if (((sqlite3.Xsqlite3_stricmp(tls, ts+3069 /* "yes" */, z) == 0) ||
- (sqlite3.Xsqlite3_stricmp(tls, ts+3073 /* "on" */, z) == 0)) ||
- (sqlite3.Xsqlite3_stricmp(tls, ts+3076 /* "true" */, z) == 0)) ||
+func csv_boolean(tls *libc.TLS, z uintptr) int32 { /* csv.c:421:12: */
+ if (((sqlite3.Xsqlite3_stricmp(tls, ts+4218 /* "yes" */, z) == 0) ||
+ (sqlite3.Xsqlite3_stricmp(tls, ts+4222 /* "on" */, z) == 0)) ||
+ (sqlite3.Xsqlite3_stricmp(tls, ts+4225 /* "true" */, z) == 0)) ||
((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '1') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) == 0)) {
return 1
}
- if (((sqlite3.Xsqlite3_stricmp(tls, ts+3081 /* "no" */, z) == 0) ||
- (sqlite3.Xsqlite3_stricmp(tls, ts+3084 /* "off" */, z) == 0)) ||
- (sqlite3.Xsqlite3_stricmp(tls, ts+3088 /* "false" */, z) == 0)) ||
+ if (((sqlite3.Xsqlite3_stricmp(tls, ts+4230 /* "no" */, z) == 0) ||
+ (sqlite3.Xsqlite3_stricmp(tls, ts+4233 /* "off" */, z) == 0)) ||
+ (sqlite3.Xsqlite3_stricmp(tls, ts+4237 /* "false" */, z) == 0)) ||
((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '0') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) == 0)) {
return 0
}
@@ -14834,10 +17349,10 @@ func csv_boolean(tls *crt.TLS, z uintptr) int32 { /* csv.c:421:12: */
// If it is, set *pValue to be the value of the boolean ("true" if there is
// not "= BOOLEAN" component) and return non-zero. If the input string
// does not begin with TAG, return zero.
-func csv_boolean_parameter(tls *crt.TLS, zTag uintptr, nTag int32, z uintptr, pValue uintptr) int32 { /* csv.c:444:12: */
+func csv_boolean_parameter(tls *libc.TLS, zTag uintptr, nTag int32, z uintptr, pValue uintptr) int32 { /* csv.c:444:12: */
var b int32
z = csv_skip_whitespace(tls, z)
- if crt.Xstrncmp(tls, zTag, z, uint64(nTag)) != 0 {
+ if libc.Xstrncmp(tls, zTag, z, uint64(nTag)) != 0 {
return 0
}
z = csv_skip_whitespace(tls, (z + uintptr(nTag)))
@@ -14873,7 +17388,7 @@ func csv_boolean_parameter(tls *crt.TLS, zTag uintptr, nTag int32, z uintptr, pV
// and so forth. If columns=N is omitted, then the file is opened and
// the number of columns in the first row is counted to determine the
// column count. If header=YES, then the first row is skipped.
-func csvtabConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* csv.c:486:12: */
+func csvtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* csv.c:486:12: */
bp := tls.Alloc(372)
defer tls.Free(372)
@@ -14902,8 +17417,8 @@ func csvtabConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uint
tstFlags = 0
nCol = -99 // Parameter values
- crt.Xmemset(tls, bp+80 /* &sRdr */, 0, uint64(unsafe.Sizeof(CsvReader{})))
- crt.Xmemset(tls, bp+344 /* &azPValue[0] */, 0, uint64(unsafe.Sizeof([3]uintptr{})))
+ libc.Xmemset(tls, bp+80 /* &sRdr */, 0, uint64(unsafe.Sizeof(CsvReader{})))
+ libc.Xmemset(tls, bp+344 /* &azPValue[0] */, 0, uint64(unsafe.Sizeof([3]uintptr{})))
i = 3
__1:
if !(i < argc) {
@@ -14939,47 +17454,47 @@ __10:
;
goto __9
__8:
- if !(csv_boolean_parameter(tls, ts+3094 /* "header" */, 6, z, bp+368 /* &b */) != 0) {
+ if !(csv_boolean_parameter(tls, ts+4243 /* "header" */, 6, z, bp+368 /* &b */) != 0) {
goto __11
}
if !(bHeader >= 0) {
goto __13
}
- csv_errmsg(tls, bp+80 /* &sRdr */, ts+3101 /* "more than one 'h..." */, 0)
+ csv_errmsg(tls, bp+80 /* &sRdr */, ts+4250 /* "more than one 'h..." */, 0)
goto csvtab_connect_error
__13:
;
bHeader = *(*int32)(unsafe.Pointer(bp + 368 /* b */))
goto __12
__11:
- if !((crt.AssignUintptr(&zValue, csv_parameter(tls, ts+3134 /* "testflags" */, 9, z))) != uintptr(0)) {
+ if !((libc.AssignUintptr(&zValue, csv_parameter(tls, ts+4283 /* "testflags" */, 9, z))) != uintptr(0)) {
goto __14
}
- tstFlags = int32(uint32(crt.Xatoi(tls, zValue)))
+ tstFlags = int32(uint32(libc.Xatoi(tls, zValue)))
goto __15
__14:
- if !((crt.AssignUintptr(&zValue, csv_parameter(tls, ts+3144 /* "columns" */, 7, z))) != uintptr(0)) {
+ if !((libc.AssignUintptr(&zValue, csv_parameter(tls, ts+4293 /* "columns" */, 7, z))) != uintptr(0)) {
goto __16
}
if !(nCol > 0) {
goto __18
}
- csv_errmsg(tls, bp+80 /* &sRdr */, ts+3152 /* "more than one 'c..." */, 0)
+ csv_errmsg(tls, bp+80 /* &sRdr */, ts+4301 /* "more than one 'c..." */, 0)
goto csvtab_connect_error
__18:
;
- nCol = crt.Xatoi(tls, zValue)
+ nCol = libc.Xatoi(tls, zValue)
if !(nCol <= 0) {
goto __19
}
- csv_errmsg(tls, bp+80 /* &sRdr */, ts+3186 /* "column= value mu..." */, 0)
+ csv_errmsg(tls, bp+80 /* &sRdr */, ts+4335 /* "column= value mu..." */, 0)
goto csvtab_connect_error
__19:
;
goto __17
__16:
- csv_errmsg(tls, bp+80 /* &sRdr */, ts+3217 /* "bad parameter: '..." */, crt.VaList(bp, z))
+ csv_errmsg(tls, bp+80 /* &sRdr */, ts+4366 /* "bad parameter: '..." */, libc.VaList(bp, z))
goto csvtab_connect_error
__17:
;
@@ -14996,10 +17511,10 @@ __2:
goto __3
__3:
;
- if !((crt.Bool32((*(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */ + uintptr(0)*8))) == uintptr(0))) == (crt.Bool32((*(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */ + uintptr(1)*8))) == uintptr(0)))) {
+ if !((libc.Bool32((*(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */ + uintptr(0)*8))) == uintptr(0))) == (libc.Bool32((*(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */ + uintptr(1)*8))) == uintptr(0)))) {
goto __20
}
- csv_errmsg(tls, bp+80 /* &sRdr */, ts+3237 /* "must specify eit..." */, 0)
+ csv_errmsg(tls, bp+80 /* &sRdr */, ts+4386 /* "must specify eit..." */, 0)
goto csvtab_connect_error
__20:
;
@@ -15019,7 +17534,7 @@ __21:
goto csvtab_connect_oom
__22:
;
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(CsvTable{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(CsvTable{})))
if !((*(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */ + uintptr(2)*8))) == uintptr(0)) {
goto __23
}
@@ -15052,8 +17567,8 @@ __31:
if !(iCol < nCol) {
goto __33
}
- sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+3289 /* "%sc%d TEXT" */, crt.VaList(bp+8, zSep, iCol))
- zSep = ts + 3300 /* "," */
+ sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+4438 /* "%sc%d TEXT" */, libc.VaList(bp+8, zSep, iCol))
+ zSep = ts + 4449 /* "," */
goto __32
__32:
iCol++
@@ -15068,8 +17583,8 @@ __34:
if !(((nCol > 0) && (iCol < nCol)) || ((nCol < 0) && (bHeader != 0))) {
goto __37
}
- sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+3302 /* "%s\"%w\" TEXT" */, crt.VaList(bp+24, zSep, z1))
- zSep = ts + 3300 /* "," */
+ sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+4451 /* "%s\"%w\" TEXT" */, libc.VaList(bp+24, zSep, z1))
+ zSep = ts + 4449 /* "," */
iCol++
__37:
;
@@ -15091,8 +17606,8 @@ __40:
if !(iCol < nCol) {
goto __41
}
- sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+3289 /* "%sc%d TEXT" */, crt.VaList(bp+40, zSep, crt.PreIncInt32(&iCol, 1)))
- zSep = ts + 3300 /* "," */
+ sqlite3.Xsqlite3_str_appendf(tls, pStr, ts+4438 /* "%sc%d TEXT" */, libc.VaList(bp+40, zSep, libc.PreIncInt32(&iCol, 1)))
+ zSep = ts + 4449 /* "," */
goto __40
__41:
;
@@ -15149,7 +17664,7 @@ __48:
(*CsvTable)(unsafe.Pointer(pNew)).FiStart = int64(int32((*CsvReader)(unsafe.Pointer(bp + 80 /* &sRdr */)).FiIn))
goto __51
__50:
- (*CsvTable)(unsafe.Pointer(pNew)).FiStart = int64((int32((size_t(crt.Xftell(tls, (*CsvReader)(unsafe.Pointer(bp+80 /* &sRdr */)).Fin)) - (*CsvReader)(unsafe.Pointer(bp+80 /* &sRdr */)).FnIn) + (*CsvReader)(unsafe.Pointer(bp+80 /* &sRdr */)).FiIn)))
+ (*CsvTable)(unsafe.Pointer(pNew)).FiStart = int64((int32((size_t(libc.Xftell(tls, (*CsvReader)(unsafe.Pointer(bp+80 /* &sRdr */)).Fin)) - (*CsvReader)(unsafe.Pointer(bp+80 /* &sRdr */)).FnIn) + (*CsvReader)(unsafe.Pointer(bp+80 /* &sRdr */)).FiIn)))
__51:
;
__49:
@@ -15159,7 +17674,7 @@ __49:
if !(rc != 0) {
goto __52
}
- csv_errmsg(tls, bp+80 /* &sRdr */, ts+3314 /* "bad schema: '%s'..." */, crt.VaList(bp+56, *(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */ + uintptr(2)*8)), sqlite3.Xsqlite3_errmsg(tls, db)))
+ csv_errmsg(tls, bp+80 /* &sRdr */, ts+4463 /* "bad schema: '%s'..." */, libc.VaList(bp+56, *(*uintptr)(unsafe.Pointer(bp + 344 /* &azPValue[0] */ + uintptr(2)*8)), sqlite3.Xsqlite3_errmsg(tls, db)))
goto csvtab_connect_error
__52:
;
@@ -15214,7 +17729,7 @@ __59:
goto __60
}
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErr)))
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+72, bp+80 /* &sRdr */ +64 /* &.zErr */))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+72, bp+80 /* &sRdr */ +64 /* &.zErr */))
__60:
;
csv_reader_reset(tls, bp+80 /* &sRdr */)
@@ -15228,11 +17743,11 @@ __61:
}
var azParam = [3]uintptr{
- ts + 3336 /* "filename" */, ts + 3345 /* "data" */, ts + 3350, /* "schema" */
+ ts + 4485 /* "filename" */, ts + 4494 /* "data" */, ts + 4499, /* "schema" */
} /* csv.c:504:21 */
// Reset the current row content held by a CsvCursor.
-func csvtabCursorRowReset(tls *crt.TLS, pCur uintptr) { /* csv.c:667:13: */
+func csvtabCursorRowReset(tls *libc.TLS, pCur uintptr) { /* csv.c:667:13: */
var pTab uintptr = (*CsvCursor)(unsafe.Pointer(pCur)).Fbase.FpVtab
var i int32
for i = 0; i < (*CsvTable)(unsafe.Pointer(pTab)).FnCol; i++ {
@@ -15244,12 +17759,12 @@ func csvtabCursorRowReset(tls *crt.TLS, pCur uintptr) { /* csv.c:667:13: */
// The xConnect and xCreate methods do the same thing, but they must be
// different so that the virtual table is not an eponymous virtual table.
-func csvtabCreate(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* csv.c:681:12: */
+func csvtabCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* csv.c:681:12: */
return csvtabConnect(tls, db, pAux, argc, argv, ppVtab, pzErr)
}
// Destructor for a CsvCursor.
-func csvtabClose(tls *crt.TLS, cur uintptr) int32 { /* csv.c:694:12: */
+func csvtabClose(tls *libc.TLS, cur uintptr) int32 { /* csv.c:694:12: */
var pCur uintptr = cur
csvtabCursorRowReset(tls, pCur)
csv_reader_reset(tls, (pCur + 8 /* &.rdr */))
@@ -15258,7 +17773,7 @@ func csvtabClose(tls *crt.TLS, cur uintptr) int32 { /* csv.c:694:12: */
}
// Constructor for a new CsvTable cursor object.
-func csvtabOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* csv.c:705:12: */
+func csvtabOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* csv.c:705:12: */
var pTab uintptr = p
var pCur uintptr
var nByte size_t
@@ -15267,7 +17782,7 @@ func csvtabOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* csv.c:705:
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, nByte)
+ libc.Xmemset(tls, pCur, 0, nByte)
(*CsvCursor)(unsafe.Pointer(pCur)).FazVal = (pCur + uintptr(1)*296)
(*CsvCursor)(unsafe.Pointer(pCur)).FaLen = ((*CsvCursor)(unsafe.Pointer(pCur)).FazVal + uintptr((*CsvTable)(unsafe.Pointer(pTab)).FnCol)*8)
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
@@ -15280,7 +17795,7 @@ func csvtabOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* csv.c:705:
// Advance a CsvCursor to its next row of input.
// Set the EOF marker if we reach the end of input.
-func csvtabNext(tls *crt.TLS, cur uintptr) int32 { /* csv.c:728:12: */
+func csvtabNext(tls *libc.TLS, cur uintptr) int32 { /* csv.c:728:12: */
var pCur uintptr = cur
var pTab uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
var i int32 = 0
@@ -15301,7 +17816,7 @@ func csvtabNext(tls *crt.TLS, cur uintptr) int32 { /* csv.c:728:12: */
*(*uintptr)(unsafe.Pointer((*CsvCursor)(unsafe.Pointer(pCur)).FazVal + uintptr(i)*8)) = zNew
*(*int32)(unsafe.Pointer((*CsvCursor)(unsafe.Pointer(pCur)).FaLen + uintptr(i)*4)) = ((*CsvCursor)(unsafe.Pointer(pCur)).Frdr.Fn + 1)
}
- crt.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*CsvCursor)(unsafe.Pointer(pCur)).FazVal + uintptr(i)*8)), z, (uint64((*CsvCursor)(unsafe.Pointer(pCur)).Frdr.Fn + 1)))
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*CsvCursor)(unsafe.Pointer(pCur)).FazVal + uintptr(i)*8)), z, (uint64((*CsvCursor)(unsafe.Pointer(pCur)).Frdr.Fn + 1)))
i++
}
}
@@ -15321,7 +17836,7 @@ func csvtabNext(tls *crt.TLS, cur uintptr) int32 { /* csv.c:728:12: */
// Return values of columns for the row at which the CsvCursor
// is currently pointing.
-func csvtabColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* csv.c:771:12: */
+func csvtabColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* csv.c:771:12: */
var pCur uintptr = cur
var pTab uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
if ((i >= 0) && (i < (*CsvTable)(unsafe.Pointer(pTab)).FnCol)) && (*(*uintptr)(unsafe.Pointer((*CsvCursor)(unsafe.Pointer(pCur)).FazVal + uintptr(i)*8)) != uintptr(0)) {
@@ -15331,7 +17846,7 @@ func csvtabColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* cs
}
// Return the rowid for the current row.
-func csvtabRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* csv.c:787:12: */
+func csvtabRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* csv.c:787:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*CsvCursor)(unsafe.Pointer(pCur)).FiRowid
return 0
@@ -15339,14 +17854,14 @@ func csvtabRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* csv.c:787
// Return TRUE if the cursor has been moved off of the last
// row of output.
-func csvtabEof(tls *crt.TLS, cur uintptr) int32 { /* csv.c:797:12: */
+func csvtabEof(tls *libc.TLS, cur uintptr) int32 { /* csv.c:797:12: */
var pCur uintptr = cur
- return (crt.Bool32((*CsvCursor)(unsafe.Pointer(pCur)).FiRowid < int64(0)))
+ return (libc.Bool32((*CsvCursor)(unsafe.Pointer(pCur)).FiRowid < int64(0)))
}
// Only a full table scan is supported. So xFilter simply rewinds to
// the beginning.
-func csvtabFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* csv.c:806:12: */
+func csvtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* csv.c:806:12: */
var pCur uintptr = pVtabCursor
var pTab uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab
(*CsvCursor)(unsafe.Pointer(pCur)).FiRowid = int64(0)
@@ -15354,7 +17869,7 @@ func csvtabFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
(*CsvCursor)(unsafe.Pointer(pCur)).Frdr.FiIn = size_t((*CsvTable)(unsafe.Pointer(pTab)).FiStart)
} else {
- crt.Xfseek(tls, (*CsvCursor)(unsafe.Pointer(pCur)).Frdr.Fin, (*CsvTable)(unsafe.Pointer(pTab)).FiStart, 0)
+ libc.Xfseek(tls, (*CsvCursor)(unsafe.Pointer(pCur)).Frdr.Fin, (*CsvTable)(unsafe.Pointer(pTab)).FiStart, 0)
(*CsvCursor)(unsafe.Pointer(pCur)).Frdr.FiIn = uint64(0)
(*CsvCursor)(unsafe.Pointer(pCur)).Frdr.FnIn = uint64(0)
}
@@ -15365,7 +17880,7 @@ func csvtabFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
// a no-op. If CSVTEST_FIDX is set, then the presence of equality
// constraints lowers the estimated cost, which is fiction, but is useful
// for testing certain kinds of virtual table behavior.
-func csvtabBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* csv.c:833:12: */
+func csvtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* csv.c:833:12: */
(*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(1000000)
if ((*CsvTable)(unsafe.Pointer((tab))).FtstFlags & uint32(0x0001)) != uint32(0) {
// The usual (and sensible) case is to always do a full table scan.
@@ -15423,7 +17938,7 @@ uintptr(0), // xRename
// For virtual table testing, make a version of the CSV virtual table
// available that has an xUpdate function. But the xUpdate always returns
// SQLITE_READONLY since the CSV file is not really writable.
-func csvtabUpdate(tls *crt.TLS, p uintptr, n int32, v uintptr, x uintptr) int32 { /* csv.c:901:12: */
+func csvtabUpdate(tls *libc.TLS, p uintptr, n int32, v uintptr, x uintptr) int32 { /* csv.c:901:12: */
return 8
}
@@ -15452,17 +17967,861 @@ uintptr(0), // xRename
// This routine is called when the extension is loaded. The new
// CSV virtual table module is registered with the calling database
// connection.
-func sqlite3_csv_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* csv.c:939:5: */
+func sqlite3_csv_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* csv.c:939:5: */
+ var rc int32
+ _ = pApi
+
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4506 /* "csv" */, uintptr(unsafe.Pointer(&CsvModule)), uintptr(0))
+ if rc == 0 {
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4510 /* "csv_wr" */, uintptr(unsafe.Pointer(&CsvModuleFauxWrite)), uintptr(0))
+ }
+ return rc
+}
+
+// Floating-point inline functions for stdlib.h.
+// Copyright (C) 2012-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Define some macros helping to catch buffer overflows.
+
+// Mark a function parameter as unused, to suppress nuisance compiler
+// warnings.
+
+// A decimal object
+type Decimal1 = struct {
+ Fsign int8
+ Foom int8
+ FisNull int8
+ FisInit int8
+ FnDigit int32
+ FnFrac int32
+ Fa uintptr
+}
+
+// Floating-point inline functions for stdlib.h.
+// Copyright (C) 2012-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Define some macros helping to catch buffer overflows.
+
+// Mark a function parameter as unused, to suppress nuisance compiler
+// warnings.
+
+// A decimal object
+type Decimal = Decimal1 /* decimal.c:32:24 */
+
+// Release memory held by a Decimal, but do not free the object itself.
+func decimal_clear(tls *libc.TLS, p uintptr) { /* decimal.c:46:13: */
+ sqlite3.Xsqlite3_free(tls, (*Decimal)(unsafe.Pointer(p)).Fa)
+}
+
+// Destroy a Decimal object
+func decimal_free(tls *libc.TLS, p uintptr) { /* decimal.c:53:13: */
+ if p != 0 {
+ decimal_clear(tls, p)
+ sqlite3.Xsqlite3_free(tls, p)
+ }
+}
+
+// Allocate a new Decimal object. Initialize it to the number given
+// by the input string.
+func decimal_new(tls *libc.TLS, pCtx uintptr, pIn uintptr, nAlt int32, zAlt uintptr) uintptr { /* decimal.c:64:16: */
+ var p uintptr
+ var n int32
+ var i int32
+ var zIn uintptr
+ var iExp int32
+ var j int32
+ var neg int32
+ var c int8
+ var nExtra int32
+ iExp = 0
+ p = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Decimal{})))
+ if !(p == uintptr(0)) {
+ goto __1
+ }
+ goto new_no_mem
+__1:
+ ;
+ (*Decimal)(unsafe.Pointer(p)).Fsign = int8(0)
+ (*Decimal)(unsafe.Pointer(p)).Foom = int8(0)
+ (*Decimal)(unsafe.Pointer(p)).FisInit = int8(1)
+ (*Decimal)(unsafe.Pointer(p)).FisNull = int8(0)
+ (*Decimal)(unsafe.Pointer(p)).FnDigit = 0
+ (*Decimal)(unsafe.Pointer(p)).FnFrac = 0
+ if !(zAlt != 0) {
+ goto __2
+ }
+ n = nAlt
+ zIn = zAlt
+ goto __3
+__2:
+ if !(sqlite3.Xsqlite3_value_type(tls, pIn) == 5) {
+ goto __4
+ }
+ (*Decimal)(unsafe.Pointer(p)).Fa = uintptr(0)
+ (*Decimal)(unsafe.Pointer(p)).FisNull = int8(1)
+ return p
+__4:
+ ;
+ n = sqlite3.Xsqlite3_value_bytes(tls, pIn)
+ zIn = sqlite3.Xsqlite3_value_text(tls, pIn)
+__3:
+ ;
+ (*Decimal)(unsafe.Pointer(p)).Fa = sqlite3.Xsqlite3_malloc64(tls, (uint64(n + 1)))
+ if !((*Decimal)(unsafe.Pointer(p)).Fa == uintptr(0)) {
+ goto __5
+ }
+ goto new_no_mem
+__5:
+ ;
+ i = 0
+__6:
+ if !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))))*2))) & int32(_ISspace)) != 0) {
+ goto __8
+ }
+ goto __7
+__7:
+ i++
+ goto __6
+ goto __8
+__8:
+ ;
+ if !(int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) == '-') {
+ goto __9
+ }
+ (*Decimal)(unsafe.Pointer(p)).Fsign = int8(1)
+ i++
+ goto __10
+__9:
+ if !(int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) == '+') {
+ goto __11
+ }
+ i++
+__11:
+ ;
+__10:
+ ;
+__12:
+ if !((i < n) && (int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) == '0')) {
+ goto __13
+ }
+ i++
+ goto __12
+__13:
+ ;
+__14:
+ if !(i < n) {
+ goto __15
+ }
+ c = int8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i))))
+ if !((int32(c) >= '0') && (int32(c) <= '9')) {
+ goto __16
+ }
+ *(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(p)).Fa + uintptr(libc.PostIncInt32(&(*Decimal)(unsafe.Pointer(p)).FnDigit, 1)))) = (int8(int32(c) - '0'))
+ goto __17
+__16:
+ if !(int32(c) == '.') {
+ goto __18
+ }
+ (*Decimal)(unsafe.Pointer(p)).FnFrac = ((*Decimal)(unsafe.Pointer(p)).FnDigit + 1)
+ goto __19
+__18:
+ if !((int32(c) == 'e') || (int32(c) == 'E')) {
+ goto __20
+ }
+ j = (i + 1)
+ neg = 0
+ if !(j >= n) {
+ goto __21
+ }
+ goto __15
+__21:
+ ;
+ if !(int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(j)))) == '-') {
+ goto __22
+ }
+ neg = 1
+ j++
+ goto __23
+__22:
+ if !(int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(j)))) == '+') {
+ goto __24
+ }
+ j++
+__24:
+ ;
+__23:
+ ;
+__25:
+ if !((j < n) && (iExp < 1000000)) {
+ goto __26
+ }
+ if !((int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(j)))) >= '0') && (int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(j)))) <= '9')) {
+ goto __27
+ }
+ iExp = (((iExp * 10) + int32(*(*uint8)(unsafe.Pointer(zIn + uintptr(j))))) - '0')
+__27:
+ ;
+ j++
+ goto __25
+__26:
+ ;
+ if !(neg != 0) {
+ goto __28
+ }
+ iExp = -iExp
+__28:
+ ;
+ goto __15
+__20:
+ ;
+__19:
+ ;
+__17:
+ ;
+ i++
+ goto __14
+__15:
+ ;
+ if !((*Decimal)(unsafe.Pointer(p)).FnFrac != 0) {
+ goto __29
+ }
+ (*Decimal)(unsafe.Pointer(p)).FnFrac = ((*Decimal)(unsafe.Pointer(p)).FnDigit - ((*Decimal)(unsafe.Pointer(p)).FnFrac - 1))
+__29:
+ ;
+ if !(iExp > 0) {
+ goto __30
+ }
+ if !((*Decimal)(unsafe.Pointer(p)).FnFrac > 0) {
+ goto __32
+ }
+ if !(iExp <= (*Decimal)(unsafe.Pointer(p)).FnFrac) {
+ goto __33
+ }
+ *(*int32)(unsafe.Pointer(p + 8 /* &.nFrac */)) -= (iExp)
+ iExp = 0
+ goto __34
+__33:
+ iExp = iExp - ((*Decimal)(unsafe.Pointer(p)).FnFrac)
+ (*Decimal)(unsafe.Pointer(p)).FnFrac = 0
+__34:
+ ;
+__32:
+ ;
+ if !(iExp > 0) {
+ goto __35
+ }
+ (*Decimal)(unsafe.Pointer(p)).Fa = sqlite3.Xsqlite3_realloc64(tls, (*Decimal)(unsafe.Pointer(p)).Fa, (uint64(((*Decimal)(unsafe.Pointer(p)).FnDigit + iExp) + 1)))
+ if !((*Decimal)(unsafe.Pointer(p)).Fa == uintptr(0)) {
+ goto __36
+ }
+ goto new_no_mem
+__36:
+ ;
+ libc.Xmemset(tls, ((*Decimal)(unsafe.Pointer(p)).Fa + uintptr((*Decimal)(unsafe.Pointer(p)).FnDigit)), 0, uint64(iExp))
+ *(*int32)(unsafe.Pointer(p + 4 /* &.nDigit */)) += (iExp)
+__35:
+ ;
+ goto __31
+__30:
+ if !(iExp < 0) {
+ goto __37
+ }
+ iExp = -iExp
+ nExtra = (((*Decimal)(unsafe.Pointer(p)).FnDigit - (*Decimal)(unsafe.Pointer(p)).FnFrac) - 1)
+ if !(nExtra != 0) {
+ goto __38
+ }
+ if !(nExtra >= iExp) {
+ goto __39
+ }
+ *(*int32)(unsafe.Pointer(p + 8 /* &.nFrac */)) += (iExp)
+ iExp = 0
+ goto __40
+__39:
+ iExp = iExp - (nExtra)
+ (*Decimal)(unsafe.Pointer(p)).FnFrac = ((*Decimal)(unsafe.Pointer(p)).FnDigit - 1)
+__40:
+ ;
+__38:
+ ;
+ if !(iExp > 0) {
+ goto __41
+ }
+ (*Decimal)(unsafe.Pointer(p)).Fa = sqlite3.Xsqlite3_realloc64(tls, (*Decimal)(unsafe.Pointer(p)).Fa, (uint64(((*Decimal)(unsafe.Pointer(p)).FnDigit + iExp) + 1)))
+ if !((*Decimal)(unsafe.Pointer(p)).Fa == uintptr(0)) {
+ goto __42
+ }
+ goto new_no_mem
+__42:
+ ;
+ libc.Xmemmove(tls, ((*Decimal)(unsafe.Pointer(p)).Fa + uintptr(iExp)), (*Decimal)(unsafe.Pointer(p)).Fa, uint64((*Decimal)(unsafe.Pointer(p)).FnDigit))
+ libc.Xmemset(tls, (*Decimal)(unsafe.Pointer(p)).Fa, 0, uint64(iExp))
+ *(*int32)(unsafe.Pointer(p + 4 /* &.nDigit */)) += (iExp)
+ *(*int32)(unsafe.Pointer(p + 8 /* &.nFrac */)) += (iExp)
+__41:
+ ;
+__37:
+ ;
+__31:
+ ;
+ return p
+
+new_no_mem:
+ if !(pCtx != 0) {
+ goto __43
+ }
+ sqlite3.Xsqlite3_result_error_nomem(tls, pCtx)
+__43:
+ ;
+ sqlite3.Xsqlite3_free(tls, p)
+ return uintptr(0)
+}
+
+// Make the given Decimal the result.
+func decimal_result(tls *libc.TLS, pCtx uintptr, p uintptr) { /* decimal.c:183:13: */
+ var z uintptr
+ var i int32
+ var j int32
+ var n int32
+ if (p == uintptr(0)) || ((*Decimal)(unsafe.Pointer(p)).Foom != 0) {
+ sqlite3.Xsqlite3_result_error_nomem(tls, pCtx)
+ return
+ }
+ if (*Decimal)(unsafe.Pointer(p)).FisNull != 0 {
+ sqlite3.Xsqlite3_result_null(tls, pCtx)
+ return
+ }
+ z = sqlite3.Xsqlite3_malloc(tls, ((*Decimal)(unsafe.Pointer(p)).FnDigit + 4))
+ if z == uintptr(0) {
+ sqlite3.Xsqlite3_result_error_nomem(tls, pCtx)
+ return
+ }
+ i = 0
+ if ((*Decimal)(unsafe.Pointer(p)).FnDigit == 0) || (((*Decimal)(unsafe.Pointer(p)).FnDigit == 1) && (int32(*(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(p)).Fa + uintptr(0)))) == 0)) {
+ (*Decimal)(unsafe.Pointer(p)).Fsign = int8(0)
+ }
+ if (*Decimal)(unsafe.Pointer(p)).Fsign != 0 {
+ *(*int8)(unsafe.Pointer(z + uintptr(0))) = int8('-')
+ i = 1
+ }
+ n = ((*Decimal)(unsafe.Pointer(p)).FnDigit - (*Decimal)(unsafe.Pointer(p)).FnFrac)
+ if n <= 0 {
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = int8('0')
+ }
+ j = 0
+ for (n > 1) && (int32(*(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(p)).Fa + uintptr(j)))) == 0) {
+ j++
+ n--
+ }
+ for n > 0 {
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = (int8(int32(*(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(p)).Fa + uintptr(j)))) + '0'))
+ j++
+ n--
+ }
+ if (*Decimal)(unsafe.Pointer(p)).FnFrac != 0 {
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = int8('.')
+ for ok := true; ok; ok = (j < (*Decimal)(unsafe.Pointer(p)).FnDigit) {
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = (int8(int32(*(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(p)).Fa + uintptr(j)))) + '0'))
+ j++
+ }
+ }
+ *(*int8)(unsafe.Pointer(z + uintptr(i))) = int8(0)
+ sqlite3.Xsqlite3_result_text(tls, pCtx, z, i, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+}
+
+// SQL Function: decimal(X)
+//
+// Convert input X into decimal and then back into text
+func decimalFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* decimal.c:238:13: */
+ var p uintptr = decimal_new(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), 0, uintptr(0))
+ _ = argc
+ decimal_result(tls, context, p)
+ decimal_free(tls, p)
+}
+
+// Compare to Decimal objects. Return negative, 0, or positive if the
+// first object is less than, equal to, or greater than the second.
+//
+// Preconditions for this routine:
+//
+// pA!=0
+// pA->isNull==0
+// pB!=0
+// pB->isNull==0
+func decimal_cmp(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* decimal.c:260:12: */
+ var nASig int32
+ var nBSig int32
+ var rc int32
+ var n int32
+ if int32((*Decimal)(unsafe.Pointer(pA)).Fsign) != int32((*Decimal)(unsafe.Pointer(pB)).Fsign) {
+ if (*Decimal)(unsafe.Pointer(pA)).Fsign != 0 {
+ return -1
+ }
+ return +1
+ }
+ if (*Decimal)(unsafe.Pointer(pA)).Fsign != 0 {
+ var pTemp uintptr = pA
+ pA = pB
+ pB = pTemp
+ }
+ nASig = ((*Decimal)(unsafe.Pointer(pA)).FnDigit - (*Decimal)(unsafe.Pointer(pA)).FnFrac)
+ nBSig = ((*Decimal)(unsafe.Pointer(pB)).FnDigit - (*Decimal)(unsafe.Pointer(pB)).FnFrac)
+ if nASig != nBSig {
+ return (nASig - nBSig)
+ }
+ n = (*Decimal)(unsafe.Pointer(pA)).FnDigit
+ if n > (*Decimal)(unsafe.Pointer(pB)).FnDigit {
+ n = (*Decimal)(unsafe.Pointer(pB)).FnDigit
+ }
+ rc = libc.Xmemcmp(tls, (*Decimal)(unsafe.Pointer(pA)).Fa, (*Decimal)(unsafe.Pointer(pB)).Fa, uint64(n))
+ if rc == 0 {
+ rc = ((*Decimal)(unsafe.Pointer(pA)).FnDigit - (*Decimal)(unsafe.Pointer(pB)).FnDigit)
+ }
+ return rc
+}
+
+// SQL Function: decimal_cmp(X, Y)
+//
+// Return negative, zero, or positive if X is less then, equal to, or
+// greater than Y.
+func decimalCmpFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* decimal.c:290:13: */
+ var pA uintptr
+ var pB uintptr
var rc int32
+ pA = uintptr(0)
+ pB = uintptr(0)
+
+ _ = argc
+ pA = decimal_new(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), 0, uintptr(0))
+ if !((pA == uintptr(0)) || ((*Decimal)(unsafe.Pointer(pA)).FisNull != 0)) {
+ goto __1
+ }
+ goto cmp_done
+__1:
+ ;
+ pB = decimal_new(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), 0, uintptr(0))
+ if !((pB == uintptr(0)) || ((*Decimal)(unsafe.Pointer(pB)).FisNull != 0)) {
+ goto __2
+ }
+ goto cmp_done
+__2:
+ ;
+ rc = decimal_cmp(tls, pA, pB)
+ if !(rc < 0) {
+ goto __3
+ }
+ rc = -1
+ goto __4
+__3:
+ if !(rc > 0) {
+ goto __5
+ }
+ rc = +1
+__5:
+ ;
+__4:
+ ;
+ sqlite3.Xsqlite3_result_int(tls, context, rc)
+cmp_done:
+ decimal_free(tls, pA)
+ decimal_free(tls, pB)
+}
+
+// Expand the Decimal so that it has a least nDigit digits and nFrac
+// digits to the right of the decimal point.
+func decimal_expand(tls *libc.TLS, p uintptr, nDigit int32, nFrac int32) { /* decimal.c:316:13: */
+ var nAddSig int32
+ var nAddFrac int32
+ if p == uintptr(0) {
+ return
+ }
+ nAddFrac = (nFrac - (*Decimal)(unsafe.Pointer(p)).FnFrac)
+ nAddSig = ((nDigit - (*Decimal)(unsafe.Pointer(p)).FnDigit) - nAddFrac)
+ if (nAddFrac == 0) && (nAddSig == 0) {
+ return
+ }
+ (*Decimal)(unsafe.Pointer(p)).Fa = sqlite3.Xsqlite3_realloc64(tls, (*Decimal)(unsafe.Pointer(p)).Fa, (uint64(nDigit + 1)))
+ if (*Decimal)(unsafe.Pointer(p)).Fa == uintptr(0) {
+ (*Decimal)(unsafe.Pointer(p)).Foom = int8(1)
+ return
+ }
+ if nAddSig != 0 {
+ libc.Xmemmove(tls, ((*Decimal)(unsafe.Pointer(p)).Fa + uintptr(nAddSig)), (*Decimal)(unsafe.Pointer(p)).Fa, uint64((*Decimal)(unsafe.Pointer(p)).FnDigit))
+ libc.Xmemset(tls, (*Decimal)(unsafe.Pointer(p)).Fa, 0, uint64(nAddSig))
+ *(*int32)(unsafe.Pointer(p + 4 /* &.nDigit */)) += (nAddSig)
+ }
+ if nAddFrac != 0 {
+ libc.Xmemset(tls, ((*Decimal)(unsafe.Pointer(p)).Fa + uintptr((*Decimal)(unsafe.Pointer(p)).FnDigit)), 0, uint64(nAddFrac))
+ *(*int32)(unsafe.Pointer(p + 4 /* &.nDigit */)) += (nAddFrac)
+ *(*int32)(unsafe.Pointer(p + 8 /* &.nFrac */)) += (nAddFrac)
+ }
+}
+
+// Add the value pB into pA.
+//
+// Both pA and pB might become denormalized by this routine.
+func decimal_add(tls *libc.TLS, pA uintptr, pB uintptr) { /* decimal.c:345:13: */
+ var nSig int32
+ var nFrac int32
+ var nDigit int32
+ var i int32
+ var rc int32
+ if pA == uintptr(0) {
+ return
+ }
+ if (((*Decimal)(unsafe.Pointer(pA)).Foom != 0) || (pB == uintptr(0))) || ((*Decimal)(unsafe.Pointer(pB)).Foom != 0) {
+ (*Decimal)(unsafe.Pointer(pA)).Foom = int8(1)
+ return
+ }
+ if ((*Decimal)(unsafe.Pointer(pA)).FisNull != 0) || ((*Decimal)(unsafe.Pointer(pB)).FisNull != 0) {
+ (*Decimal)(unsafe.Pointer(pA)).FisNull = int8(1)
+ return
+ }
+ nSig = ((*Decimal)(unsafe.Pointer(pA)).FnDigit - (*Decimal)(unsafe.Pointer(pA)).FnFrac)
+ if (nSig != 0) && (int32(*(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(pA)).Fa + uintptr(0)))) == 0) {
+ nSig--
+ }
+ if nSig < ((*Decimal)(unsafe.Pointer(pB)).FnDigit - (*Decimal)(unsafe.Pointer(pB)).FnFrac) {
+ nSig = ((*Decimal)(unsafe.Pointer(pB)).FnDigit - (*Decimal)(unsafe.Pointer(pB)).FnFrac)
+ }
+ nFrac = (*Decimal)(unsafe.Pointer(pA)).FnFrac
+ if nFrac < (*Decimal)(unsafe.Pointer(pB)).FnFrac {
+ nFrac = (*Decimal)(unsafe.Pointer(pB)).FnFrac
+ }
+ nDigit = ((nSig + nFrac) + 1)
+ decimal_expand(tls, pA, nDigit, nFrac)
+ decimal_expand(tls, pB, nDigit, nFrac)
+ if ((*Decimal)(unsafe.Pointer(pA)).Foom != 0) || ((*Decimal)(unsafe.Pointer(pB)).Foom != 0) {
+ (*Decimal)(unsafe.Pointer(pA)).Foom = int8(1)
+ } else {
+ if int32((*Decimal)(unsafe.Pointer(pA)).Fsign) == int32((*Decimal)(unsafe.Pointer(pB)).Fsign) {
+ var carry int32 = 0
+ for i = (nDigit - 1); i >= 0; i-- {
+ var x int32 = ((int32(*(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(pA)).Fa + uintptr(i)))) + int32(*(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(pB)).Fa + uintptr(i))))) + carry)
+ if x >= 10 {
+ carry = 1
+ *(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(pA)).Fa + uintptr(i))) = (int8(x - 10))
+ } else {
+ carry = 0
+ *(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(pA)).Fa + uintptr(i))) = int8(x)
+ }
+ }
+ } else {
+ var aA uintptr
+ var aB uintptr
+ var borrow int32 = 0
+ rc = libc.Xmemcmp(tls, (*Decimal)(unsafe.Pointer(pA)).Fa, (*Decimal)(unsafe.Pointer(pB)).Fa, uint64(nDigit))
+ if rc < 0 {
+ aA = (*Decimal)(unsafe.Pointer(pB)).Fa
+ aB = (*Decimal)(unsafe.Pointer(pA)).Fa
+ (*Decimal)(unsafe.Pointer(pA)).Fsign = libc.BoolInt8(!((*Decimal)(unsafe.Pointer(pA)).Fsign != 0))
+ } else {
+ aA = (*Decimal)(unsafe.Pointer(pA)).Fa
+ aB = (*Decimal)(unsafe.Pointer(pB)).Fa
+ }
+ for i = (nDigit - 1); i >= 0; i-- {
+ var x int32 = ((int32(*(*int8)(unsafe.Pointer(aA + uintptr(i)))) - int32(*(*int8)(unsafe.Pointer(aB + uintptr(i))))) - borrow)
+ if x < 0 {
+ *(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(pA)).Fa + uintptr(i))) = (int8(x + 10))
+ borrow = 1
+ } else {
+ *(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(pA)).Fa + uintptr(i))) = int8(x)
+ borrow = 0
+ }
+ }
+ }
+ }
+}
+
+// Compare text in decimal order.
+func decimalCollFunc(tls *libc.TLS, notUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* decimal.c:413:12: */
+ var zA uintptr = pKey1
+ var zB uintptr = pKey2
+ var pA uintptr = decimal_new(tls, uintptr(0), uintptr(0), nKey1, zA)
+ var pB uintptr = decimal_new(tls, uintptr(0), uintptr(0), nKey2, zB)
+ var rc int32
+ _ = notUsed
+ if (pA == uintptr(0)) || (pB == uintptr(0)) {
+ rc = 0
+ } else {
+ rc = decimal_cmp(tls, pA, pB)
+ }
+ decimal_free(tls, pA)
+ decimal_free(tls, pB)
+ return rc
+}
+
+// SQL Function: decimal_add(X, Y)
+// decimal_sub(X, Y)
+//
+// Return the sum or difference of X and Y.
+func decimalAddFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* decimal.c:441:13: */
+ var pA uintptr = decimal_new(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), 0, uintptr(0))
+ var pB uintptr = decimal_new(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), 0, uintptr(0))
+ _ = argc
+ decimal_add(tls, pA, pB)
+ decimal_result(tls, context, pA)
+ decimal_free(tls, pA)
+ decimal_free(tls, pB)
+}
+func decimalSubFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* decimal.c:454:13: */
+ var pA uintptr = decimal_new(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), 0, uintptr(0))
+ var pB uintptr = decimal_new(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), 0, uintptr(0))
+ _ = argc
+ if pB == uintptr(0) {
+ return
+ }
+ (*Decimal)(unsafe.Pointer(pB)).Fsign = libc.BoolInt8(!((*Decimal)(unsafe.Pointer(pB)).Fsign != 0))
+ decimal_add(tls, pA, pB)
+ decimal_result(tls, context, pA)
+ decimal_free(tls, pA)
+ decimal_free(tls, pB)
+}
+
+// Aggregate funcion: decimal_sum(X)
+//
+// Works like sum() except that it uses decimal arithmetic for unlimited
+// precision.
+func decimalSumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* decimal.c:475:13: */
+ var p uintptr
+ var pArg uintptr
+ _ = argc
+ p = sqlite3.Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(Decimal{})))
+ if p == uintptr(0) {
+ return
+ }
+ if !(int32((*Decimal)(unsafe.Pointer(p)).FisInit) != 0) {
+ (*Decimal)(unsafe.Pointer(p)).FisInit = int8(1)
+ (*Decimal)(unsafe.Pointer(p)).Fa = sqlite3.Xsqlite3_malloc(tls, 2)
+ if (*Decimal)(unsafe.Pointer(p)).Fa == uintptr(0) {
+ (*Decimal)(unsafe.Pointer(p)).Foom = int8(1)
+ } else {
+ *(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(p)).Fa + uintptr(0))) = int8(0)
+ }
+ (*Decimal)(unsafe.Pointer(p)).FnDigit = 1
+ (*Decimal)(unsafe.Pointer(p)).FnFrac = 0
+ }
+ if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) == 5 {
+ return
+ }
+ pArg = decimal_new(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), 0, uintptr(0))
+ decimal_add(tls, p, pArg)
+ decimal_free(tls, pArg)
+}
+func decimalSumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* decimal.c:501:13: */
+ var p uintptr
+ var pArg uintptr
+ _ = argc
+ p = sqlite3.Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(Decimal{})))
+ if p == uintptr(0) {
+ return
+ }
+ if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) == 5 {
+ return
+ }
+ pArg = decimal_new(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), 0, uintptr(0))
+ if pArg != 0 {
+ (*Decimal)(unsafe.Pointer(pArg)).Fsign = libc.BoolInt8(!((*Decimal)(unsafe.Pointer(pArg)).Fsign != 0))
+ }
+ decimal_add(tls, p, pArg)
+ decimal_free(tls, pArg)
+}
+func decimalSumValue(tls *libc.TLS, context uintptr) { /* decimal.c:517:13: */
+ var p uintptr = sqlite3.Xsqlite3_aggregate_context(tls, context, 0)
+ if p == uintptr(0) {
+ return
+ }
+ decimal_result(tls, context, p)
+}
+func decimalSumFinalize(tls *libc.TLS, context uintptr) { /* decimal.c:522:13: */
+ var p uintptr = sqlite3.Xsqlite3_aggregate_context(tls, context, 0)
+ if p == uintptr(0) {
+ return
+ }
+ decimal_result(tls, context, p)
+ decimal_clear(tls, p)
+}
+
+// SQL Function: decimal_mul(X, Y)
+//
+// Return the product of X and Y.
+//
+// All significant digits after the decimal point are retained.
+// Trailing zeros after the decimal point are omitted as long as
+// the number of digits after the decimal point is no less than
+// either the number of digits in either input.
+func decimalMulFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* decimal.c:539:13: */
+ var pA uintptr
+ var pB uintptr
+ var acc uintptr
+ var i int32
+ var j int32
+ var k int32
+ var minFrac int32
+ var f int8
+ var carry int32
+ var x int32
+ pA = decimal_new(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), 0, uintptr(0))
+ pB = decimal_new(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), 0, uintptr(0))
+ acc = uintptr(0)
+ _ = argc
+ if !((((((pA == uintptr(0)) || ((*Decimal)(unsafe.Pointer(pA)).Foom != 0)) || ((*Decimal)(unsafe.Pointer(pA)).FisNull != 0)) ||
+ (pB == uintptr(0))) || ((*Decimal)(unsafe.Pointer(pB)).Foom != 0)) || ((*Decimal)(unsafe.Pointer(pB)).FisNull != 0)) {
+ goto __1
+ }
+ goto mul_end
+__1:
+ ;
+ acc = sqlite3.Xsqlite3_malloc64(tls, (uint64(((*Decimal)(unsafe.Pointer(pA)).FnDigit + (*Decimal)(unsafe.Pointer(pB)).FnDigit) + 2)))
+ if !(acc == uintptr(0)) {
+ goto __2
+ }
+ sqlite3.Xsqlite3_result_error_nomem(tls, context)
+ goto mul_end
+__2:
+ ;
+ libc.Xmemset(tls, acc, 0, (uint64(((*Decimal)(unsafe.Pointer(pA)).FnDigit + (*Decimal)(unsafe.Pointer(pB)).FnDigit) + 2)))
+ minFrac = (*Decimal)(unsafe.Pointer(pA)).FnFrac
+ if !((*Decimal)(unsafe.Pointer(pB)).FnFrac < minFrac) {
+ goto __3
+ }
+ minFrac = (*Decimal)(unsafe.Pointer(pB)).FnFrac
+__3:
+ ;
+ i = ((*Decimal)(unsafe.Pointer(pA)).FnDigit - 1)
+__4:
+ if !(i >= 0) {
+ goto __6
+ }
+ f = *(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(pA)).Fa + uintptr(i)))
+ carry = 0
+ j = ((*Decimal)(unsafe.Pointer(pB)).FnDigit - 1)
+ k = ((i + j) + 3)
+__7:
+ if !(j >= 0) {
+ goto __9
+ }
+ x = ((int32(*(*int8)(unsafe.Pointer(acc + uintptr(k)))) + (int32(f) * int32(*(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(pB)).Fa + uintptr(j)))))) + carry)
+ *(*int8)(unsafe.Pointer(acc + uintptr(k))) = (int8(x % 10))
+ carry = (x / 10)
+ goto __8
+__8:
+ j--
+ k--
+ goto __7
+ goto __9
+__9:
+ ;
+ x = (int32(*(*int8)(unsafe.Pointer(acc + uintptr(k)))) + carry)
+ *(*int8)(unsafe.Pointer(acc + uintptr(k))) = (int8(x % 10))
+ *(*int8)(unsafe.Pointer(acc + uintptr((k - 1)))) += int8((x / 10))
+ goto __5
+__5:
+ i--
+ goto __4
+ goto __6
+__6:
+ ;
+ sqlite3.Xsqlite3_free(tls, (*Decimal)(unsafe.Pointer(pA)).Fa)
+ (*Decimal)(unsafe.Pointer(pA)).Fa = acc
+ acc = uintptr(0)
+ *(*int32)(unsafe.Pointer(pA + 4 /* &.nDigit */)) += ((*Decimal)(unsafe.Pointer(pB)).FnDigit + 2)
+ *(*int32)(unsafe.Pointer(pA + 8 /* &.nFrac */)) += ((*Decimal)(unsafe.Pointer(pB)).FnFrac)
+ *(*int8)(unsafe.Pointer(pA /* &.sign */)) ^= int8((int32((*Decimal)(unsafe.Pointer(pB)).Fsign)))
+__10:
+ if !(((*Decimal)(unsafe.Pointer(pA)).FnFrac > minFrac) && (int32(*(*int8)(unsafe.Pointer((*Decimal)(unsafe.Pointer(pA)).Fa + uintptr(((*Decimal)(unsafe.Pointer(pA)).FnDigit - 1))))) == 0)) {
+ goto __11
+ }
+ (*Decimal)(unsafe.Pointer(pA)).FnFrac--
+ (*Decimal)(unsafe.Pointer(pA)).FnDigit--
+ goto __10
+__11:
+ ;
+ decimal_result(tls, context, pA)
+
+mul_end:
+ sqlite3.Xsqlite3_free(tls, acc)
+ decimal_free(tls, pA)
+ decimal_free(tls, pB)
+}
+
+func sqlite3_decimal_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* decimal.c:596:5: */
+ var rc int32 = 0
+ var i uint32
+ _ = pzErrMsg // Unused parameter
+
_ = pApi
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3357 /* "csv" */, uintptr(unsafe.Pointer(&CsvModule)), uintptr(0))
+ for i = uint32(0); (uint64(i) < (uint64(unsafe.Sizeof(aFunc)) / uint64(unsafe.Sizeof(struct {
+ FzFuncName uintptr
+ FnArg int32
+ FxFunc uintptr
+ }{})))) && (rc == 0); i++ {
+ rc = sqlite3.Xsqlite3_create_function(tls, db, aFunc[i].FzFuncName, aFunc[i].FnArg,
+ ((1 | 0x000200000) | 0x000000800),
+ uintptr(0), aFunc[i].FxFunc, uintptr(0), uintptr(0))
+ }
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3361 /* "csv_wr" */, uintptr(unsafe.Pointer(&CsvModuleFauxWrite)), uintptr(0))
+ rc = sqlite3.Xsqlite3_create_window_function(tls, db, ts+4517 /* "decimal_sum" */, 1,
+ ((1 | 0x000200000) | 0x000000800), uintptr(0),
+ *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{decimalSumStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{decimalSumFinalize})),
+ *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{decimalSumValue})), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{decimalSumInverse})), uintptr(0))
+ }
+ if rc == 0 {
+ rc = sqlite3.Xsqlite3_create_collation(tls, db, ts+4529 /* "decimal" */, 1,
+ uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ }{decimalCollFunc})))
}
return rc
}
+var aFunc = [5]struct {
+ FzFuncName uintptr
+ FnArg int32
+ FxFunc uintptr
+}{
+ {FzFuncName: ts + 4529 /* "decimal" */, FnArg: 1, FxFunc: 0},
+ {FzFuncName: ts + 4537 /* "decimal_cmp" */, FnArg: 2, FxFunc: 0},
+ {FzFuncName: ts + 4549 /* "decimal_add" */, FnArg: 2, FxFunc: 0},
+ {FzFuncName: ts + 4561 /* "decimal_sub" */, FnArg: 2, FxFunc: 0},
+ {FzFuncName: ts + 4573 /* "decimal_mul" */, FnArg: 2, FxFunc: 0},
+} /* decimal.c:606:5 */
+
// Structure used to accumulate the output
type EvalResult = struct {
Fz uintptr
@@ -15473,7 +18832,7 @@ type EvalResult = struct {
}
// Callback from sqlite_exec() for the eval() function.
-func callback(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr, colnames uintptr) int32 { /* eval.c:34:12: */
+func callback(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr, colnames uintptr) int32 { /* eval.c:34:12: */
var p uintptr = pCtx
var i int32
if argv == uintptr(0) {
@@ -15486,7 +18845,7 @@ func callback(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr, colnames uin
} else {
z = ts + 488 /* "" */
}
- var sz size_t = crt.Xstrlen(tls, z)
+ var sz size_t = libc.Xstrlen(tls, z)
if (((sqlite3_int64(sz) + (*EvalResult)(unsafe.Pointer(p)).FnUsed) + sqlite3_int64((*EvalResult)(unsafe.Pointer(p)).FszSep)) + int64(1)) > (*EvalResult)(unsafe.Pointer(p)).FnAlloc {
var zNew uintptr
(*EvalResult)(unsafe.Pointer(p)).FnAlloc = (sqlite3_int64((((uint64((*EvalResult)(unsafe.Pointer(p)).FnAlloc * int64(2))) + uint64(sz)) + uint64((*EvalResult)(unsafe.Pointer(p)).FszSep)) + uint64(1)))
@@ -15500,16 +18859,16 @@ func callback(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr, colnames uin
}
if zNew == uintptr(0) {
sqlite3.Xsqlite3_free(tls, (*EvalResult)(unsafe.Pointer(p)).Fz)
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(EvalResult{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(EvalResult{})))
return 1
}
(*EvalResult)(unsafe.Pointer(p)).Fz = zNew
}
if (*EvalResult)(unsafe.Pointer(p)).FnUsed > int64(0) {
- crt.Xmemcpy(tls, ((*EvalResult)(unsafe.Pointer(p)).Fz + uintptr((*EvalResult)(unsafe.Pointer(p)).FnUsed)), (*EvalResult)(unsafe.Pointer(p)).FzSep, uint64((*EvalResult)(unsafe.Pointer(p)).FszSep))
+ libc.Xmemcpy(tls, ((*EvalResult)(unsafe.Pointer(p)).Fz + uintptr((*EvalResult)(unsafe.Pointer(p)).FnUsed)), (*EvalResult)(unsafe.Pointer(p)).FzSep, uint64((*EvalResult)(unsafe.Pointer(p)).FszSep))
*(*sqlite3_int64)(unsafe.Pointer(p + 32 /* &.nUsed */)) += (sqlite3_int64((*EvalResult)(unsafe.Pointer(p)).FszSep))
}
- crt.Xmemcpy(tls, ((*EvalResult)(unsafe.Pointer(p)).Fz + uintptr((*EvalResult)(unsafe.Pointer(p)).FnUsed)), z, sz)
+ libc.Xmemcpy(tls, ((*EvalResult)(unsafe.Pointer(p)).Fz + uintptr((*EvalResult)(unsafe.Pointer(p)).FnUsed)), z, sz)
*(*sqlite3_int64)(unsafe.Pointer(p + 32 /* &.nUsed */)) += sqlite3_int64((uint64(sz)))
}
return 0
@@ -15519,7 +18878,7 @@ func callback(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr, colnames uin
//
// Evaluate the SQL text in X. Return the results, using string
// Y as the separator. If Y is omitted, use a single space character.
-func sqlEvalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* eval.c:71:13: */
+func sqlEvalFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* eval.c:71:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -15529,8 +18888,8 @@ func sqlEvalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* e
var rc int32
// var x EvalResult at bp, 40
- crt.Xmemset(tls, bp /* &x */, 0, uint64(unsafe.Sizeof(EvalResult{})))
- (*EvalResult)(unsafe.Pointer(bp /* &x */)).FzSep = ts + 3368 /* " " */
+ libc.Xmemset(tls, bp /* &x */, 0, uint64(unsafe.Sizeof(EvalResult{})))
+ (*EvalResult)(unsafe.Pointer(bp /* &x */)).FzSep = ts + 4585 /* " " */
zSql = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
if zSql == uintptr(0) {
return
@@ -15541,10 +18900,10 @@ func sqlEvalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* e
return
}
}
- (*EvalResult)(unsafe.Pointer(bp /* &x */)).FszSep = int32(crt.Xstrlen(tls, (*EvalResult)(unsafe.Pointer(bp /* &x */)).FzSep))
+ (*EvalResult)(unsafe.Pointer(bp /* &x */)).FszSep = int32(libc.Xstrlen(tls, (*EvalResult)(unsafe.Pointer(bp /* &x */)).FzSep))
db = sqlite3.Xsqlite3_context_db_handle(tls, context)
rc = sqlite3.Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{callback})), bp /* &x */, bp+40 /* &zErr */)
if rc != 0 {
sqlite3.Xsqlite3_result_error(tls, context, *(*uintptr)(unsafe.Pointer(bp + 40 /* zErr */)), -1)
@@ -15553,25 +18912,25 @@ func sqlEvalFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* e
sqlite3.Xsqlite3_result_error_nomem(tls, context)
sqlite3.Xsqlite3_free(tls, (*EvalResult)(unsafe.Pointer(bp /* &x */)).Fz)
} else {
- sqlite3.Xsqlite3_result_text(tls, context, (*EvalResult)(unsafe.Pointer(bp /* &x */)).Fz, int32((*EvalResult)(unsafe.Pointer(bp /* &x */)).FnUsed), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ sqlite3.Xsqlite3_result_text(tls, context, (*EvalResult)(unsafe.Pointer(bp /* &x */)).Fz, int32((*EvalResult)(unsafe.Pointer(bp /* &x */)).FnUsed), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
}
}
-func sqlite3_eval_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* eval.c:108:5: */
+func sqlite3_eval_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* eval.c:108:5: */
var rc int32 = 0
_ = pApi
_ = pzErrMsg // Unused parameter
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+3370 /* "eval" */, 1,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4587 /* "eval" */, 1,
(1 | 0x000080000), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{sqlEvalFunc})), uintptr(0), uintptr(0))
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+3370 /* "eval" */, 2,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4587 /* "eval" */, 2,
(1 | 0x000080000), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{sqlEvalFunc})), uintptr(0), uintptr(0))
}
return rc
@@ -15616,47 +18975,47 @@ type explain_cursor = explain_cursor1 /* explain.c:48:31 */
//
// (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the
// result set of queries against explain will look like.
-func explainConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* explain.c:70:12: */
+func explainConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* explain.c:70:12: */
var pNew uintptr
var rc int32
// Column numbers
rc = sqlite3.Xsqlite3_declare_vtab(tls, db,
- ts+3375 /* "CREATE TABLE x(a..." */)
+ ts+4592 /* "CREATE TABLE x(a..." */)
if rc == 0 {
pNew = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(explain_vtab{})))
*(*uintptr)(unsafe.Pointer(ppVtab)) = pNew
if pNew == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(explain_vtab{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(explain_vtab{})))
(*explain_vtab)(unsafe.Pointer(pNew)).Fdb = db
}
return rc
}
// This method is the destructor for explain_cursor objects.
-func explainDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* explain.c:107:12: */
+func explainDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* explain.c:107:12: */
sqlite3.Xsqlite3_free(tls, pVtab)
return 0
}
// Constructor for a new explain_cursor object.
-func explainOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* explain.c:115:12: */
+func explainOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* explain.c:115:12: */
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(explain_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(explain_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(explain_cursor{})))
(*explain_cursor)(unsafe.Pointer(pCur)).Fdb = (*explain_vtab)(unsafe.Pointer(p)).Fdb
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
return 0
}
// Destructor for a explain_cursor.
-func explainClose(tls *crt.TLS, cur uintptr) int32 { /* explain.c:128:12: */
+func explainClose(tls *libc.TLS, cur uintptr) int32 { /* explain.c:128:12: */
var pCur uintptr = cur
sqlite3.Xsqlite3_finalize(tls, (*explain_cursor)(unsafe.Pointer(pCur)).FpExplain)
sqlite3.Xsqlite3_free(tls, (*explain_cursor)(unsafe.Pointer(pCur)).FzSql)
@@ -15665,7 +19024,7 @@ func explainClose(tls *crt.TLS, cur uintptr) int32 { /* explain.c:128:12: */
}
// Advance a explain_cursor to its next row of output.
-func explainNext(tls *crt.TLS, cur uintptr) int32 { /* explain.c:140:12: */
+func explainNext(tls *libc.TLS, cur uintptr) int32 { /* explain.c:140:12: */
var pCur uintptr = cur
(*explain_cursor)(unsafe.Pointer(pCur)).Frc = sqlite3.Xsqlite3_step(tls, (*explain_cursor)(unsafe.Pointer(pCur)).FpExplain)
if ((*explain_cursor)(unsafe.Pointer(pCur)).Frc != 101) && ((*explain_cursor)(unsafe.Pointer(pCur)).Frc != 100) {
@@ -15676,10 +19035,10 @@ func explainNext(tls *crt.TLS, cur uintptr) int32 { /* explain.c:140:12: */
// Return values of columns for the row at which the explain_cursor
// is currently pointing.
-func explainColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* explain.c:151:12: */
+func explainColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* explain.c:151:12: */
var pCur uintptr = cur
if i == 8 {
- sqlite3.Xsqlite3_result_text(tls, ctx, (*explain_cursor)(unsafe.Pointer(pCur)).FzSql, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, (*explain_cursor)(unsafe.Pointer(pCur)).FzSql, -1, libc.UintptrFromInt32(-1))
} else {
sqlite3.Xsqlite3_result_value(tls, ctx, sqlite3.Xsqlite3_column_value(tls, (*explain_cursor)(unsafe.Pointer(pCur)).FpExplain, i))
}
@@ -15688,7 +19047,7 @@ func explainColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* e
// Return the rowid for the current row. In this implementation, the
// rowid is the same as the output value.
-func explainRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* explain.c:169:12: */
+func explainRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* explain.c:169:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = sqlite3.Xsqlite3_column_int64(tls, (*explain_cursor)(unsafe.Pointer(pCur)).FpExplain, 0)
return 0
@@ -15696,9 +19055,9 @@ func explainRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* explain.
// Return TRUE if the cursor has been moved off of the last
// row of output.
-func explainEof(tls *crt.TLS, cur uintptr) int32 { /* explain.c:179:12: */
+func explainEof(tls *libc.TLS, cur uintptr) int32 { /* explain.c:179:12: */
var pCur uintptr = cur
- return (crt.Bool32((*explain_cursor)(unsafe.Pointer(pCur)).Frc != 100))
+ return (libc.Bool32((*explain_cursor)(unsafe.Pointer(pCur)).Frc != 100))
}
// This method is called to "rewind" the explain_cursor object back
@@ -15707,7 +19066,7 @@ func explainEof(tls *crt.TLS, cur uintptr) int32 { /* explain.c:179:12: */
// explainEof().
//
// The argv[0] is the SQL statement that is to be explained.
-func explainFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* explain.c:192:12: */
+func explainFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* explain.c:192:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -15721,9 +19080,9 @@ func explainFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp
return 0
}
sqlite3.Xsqlite3_free(tls, (*explain_cursor)(unsafe.Pointer(pCur)).FzSql)
- (*explain_cursor)(unsafe.Pointer(pCur)).FzSql = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))))
+ (*explain_cursor)(unsafe.Pointer(pCur)).FzSql = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))))
if (*explain_cursor)(unsafe.Pointer(pCur)).FzSql != 0 {
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+3437 /* "EXPLAIN %s" */, crt.VaList(bp+8, (*explain_cursor)(unsafe.Pointer(pCur)).FzSql))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+4654 /* "EXPLAIN %s" */, libc.VaList(bp+8, (*explain_cursor)(unsafe.Pointer(pCur)).FzSql))
}
if zSql == uintptr(0) {
rc = 7
@@ -15751,7 +19110,7 @@ func explainFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp
// that uses the explain virtual table. This routine needs to create
// a query plan for each invocation and compute an estimated cost for that
// plan.
-func explainBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* explain.c:235:12: */
+func explainBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* explain.c:235:12: */
var i int32 // Loop counter
var idx int32 = -1 // Index of a usable == constraint against SQL
var unusable int32 = 0 // True if there are unusable constraints on SQL
@@ -15810,13 +19169,13 @@ uintptr(0), FxShadowName:// xRollbackTo
uintptr(0), // xShadowName
} /* explain.c:271:23 */
-func sqlite3ExplainVtabInit(tls *crt.TLS, db uintptr) int32 { /* explain.c:300:5: */
+func sqlite3ExplainVtabInit(tls *libc.TLS, db uintptr) int32 { /* explain.c:300:5: */
var rc int32 = 0
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3448 /* "explain" */, uintptr(unsafe.Pointer(&explainModule)), uintptr(0))
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4665 /* "explain" */, uintptr(unsafe.Pointer(&explainModule)), uintptr(0))
return rc
}
-func sqlite3_explain_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* explain.c:311:5: */
+func sqlite3_explain_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* explain.c:311:5: */
var rc int32 = 0
_ = pApi
@@ -16561,6 +19920,228 @@ type itimerval = struct {
}
}
+// Convenience macros for operations on timevals.
+// NOTE: `timercmp' does not work for >= or <=.
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// ISO C99 Standard: 7.23 Date and time <time.h>
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 1989-2018 Free Software Foundation, Inc.
+//
+//This file is part of GCC.
+//
+//GCC is free software; you can redistribute it and/or modify
+//it under the terms of the GNU General Public License as published by
+//the Free Software Foundation; either version 3, or (at your option)
+//any later version.
+//
+//GCC is distributed in the hope that it will be useful,
+//but WITHOUT ANY WARRANTY; without even the implied warranty of
+//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//GNU General Public License for more details.
+//
+//Under Section 7 of GPL version 3, you are granted additional
+//permissions described in the GCC Runtime Library Exception, version
+//3.1, as published by the Free Software Foundation.
+//
+//You should have received a copy of the GNU General Public License and
+//a copy of the GCC Runtime Library Exception along with this program;
+//see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+//<http://www.gnu.org/licenses/>.
+
+// ISO C Standard: 7.17 Common definitions <stddef.h>
+
+// Any one of these symbols __need_* means that GNU libc
+// wants us just to define one data type. So don't define
+// the symbols that indicate this file's entire job has been done.
+
+// This avoids lossage on SunOS but only if stdtypes.h comes first.
+// There's no way to win with the other order! Sun lossage.
+
+// On 4.3bsd-net2, make sure ansi.h is included, so we have
+// one less case to deal with in the following.
+// On FreeBSD 5, machine/ansi.h does not exist anymore...
+
+// In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
+// defined if the corresponding type is *not* defined.
+// FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
+// NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_
+
+// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
+// Just ignore it.
+
+// On VxWorks, <type/vxTypesBase.h> may have defined macros like
+// _TYPE_size_t which will typedef size_t. fixincludes patched the
+// vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
+// not defined, and so that defining this macro defines _GCC_SIZE_T.
+// If we find that the macros are still defined at this point, we must
+// invoke them so that the type is defined as expected.
+
+// In case nobody has defined these types, but we aren't running under
+// GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
+// __WCHAR_TYPE__ have reasonable values. This can happen if the
+// parts of GCC is compiled by an older compiler, that actually
+// include gstddef.h, such as collect2.
+
+// Signed type of difference of two pointers.
+
+// Define this type if we are doing the whole job,
+// or if we want this type in particular.
+
+// Unsigned type of `sizeof' something.
+
+// Define this type if we are doing the whole job,
+// or if we want this type in particular.
+
+// Wide character type.
+// Locale-writers should change this as necessary to
+// be big enough to hold unique values not between 0 and 127,
+// and not (wchar_t) -1, for each defined multibyte character.
+
+// Define this type if we are doing the whole job,
+// or if we want this type in particular.
+
+// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
+// are already defined.
+// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
+// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
+
+// A null pointer constant.
+
+// This defines CLOCKS_PER_SEC, which is the number of processor clock
+// ticks per second, and possibly a number of other constants.
+// System-dependent timing definitions. Linux version.
+// Copyright (C) 1996-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Never include this file directly; use <time.h> instead.
+
+// bits/types.h -- definitions of __*_t types underlying *_t types.
+// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Never include this file directly; use <sys/types.h> instead.
+
+// ISO/IEC 9899:1999 7.23.1: Components of time
+// The macro `CLOCKS_PER_SEC' is an expression with type `clock_t' that is
+// the number per second of the value returned by the `clock' function.
+// CAE XSH, Issue 4, Version 2: <time.h>
+// The value of CLOCKS_PER_SEC is required to be 1 million on all
+// XSI-conformant systems.
+
+// Identifier for system-wide realtime clock.
+// Monotonic system-wide clock.
+// High-resolution timer from the CPU.
+// Thread-specific CPU-time clock.
+// Monotonic system-wide clock, not adjusted for frequency scaling.
+// Identifier for system-wide realtime clock, updated only on ticks.
+// Monotonic system-wide clock, updated only on ticks.
+// Monotonic system-wide clock that includes time spent in suspension.
+// Like CLOCK_REALTIME but also wakes suspended system.
+// Like CLOCK_BOOTTIME but also wakes suspended system.
+// Like CLOCK_REALTIME but in International Atomic Time.
+
+// Flag to indicate time is absolute.
+
+// Many of the typedefs and structs whose official home is this header
+// may also need to be defined by other headers.
+
+// bits/types.h -- definitions of __*_t types underlying *_t types.
+// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Never include this file directly; use <sys/types.h> instead.
+
+// ISO C `broken-down time' structure.
+type tm = struct {
+ Ftm_sec int32
+ Ftm_min int32
+ Ftm_hour int32
+ Ftm_mday int32
+ Ftm_mon int32
+ Ftm_year int32
+ Ftm_wday int32
+ Ftm_yday int32
+ Ftm_isdst int32
+ Ftm_gmtoff int64
+ Ftm_zone uintptr
+}
+
// NB: Include guard matches what <linux/time.h> uses.
// bits/types.h -- definitions of __*_t types underlying *_t types.
@@ -16623,26 +20204,26 @@ type sigevent = struct {
//
// Throw an SQLITE_IOERR if there are difficulties pulling the file
// off of disk.
-func readFileContents(tls *crt.TLS, ctx uintptr, zName uintptr) { /* fileio.c:133:13: */
+func readFileContents(tls *libc.TLS, ctx uintptr, zName uintptr) { /* fileio.c:133:13: */
var in uintptr
var nIn sqlite3_int64
var pBuf uintptr
var db uintptr
var mxBlob int32
- in = crt.Xfopen(tls, zName, ts+2937 /* "rb" */)
+ in = libc.Xfopen(tls, zName, ts+4086 /* "rb" */)
if in == uintptr(0) {
// File does not exist or is unreadable. Leave the result set to NULL.
return
}
- crt.Xfseek(tls, in, int64(0), 2)
- nIn = sqlite3_int64(crt.Xftell(tls, in))
- crt.Xrewind(tls, in)
+ libc.Xfseek(tls, in, int64(0), 2)
+ nIn = sqlite3_int64(libc.Xftell(tls, in))
+ libc.Xrewind(tls, in)
db = sqlite3.Xsqlite3_context_db_handle(tls, ctx)
mxBlob = sqlite3.Xsqlite3_limit(tls, db, 0, -1)
if nIn > sqlite3_int64(mxBlob) {
sqlite3.Xsqlite3_result_error_code(tls, ctx, 18)
- crt.Xfclose(tls, in)
+ libc.Xfclose(tls, in)
return
}
pBuf = sqlite3.Xsqlite3_malloc64(tls, func() uint64 {
@@ -16653,22 +20234,22 @@ func readFileContents(tls *crt.TLS, ctx uintptr, zName uintptr) { /* fileio.c:13
}())
if pBuf == uintptr(0) {
sqlite3.Xsqlite3_result_error_nomem(tls, ctx)
- crt.Xfclose(tls, in)
+ libc.Xfclose(tls, in)
return
}
- if nIn == sqlite3_int64(crt.Xfread(tls, pBuf, uint64(1), size_t(nIn), in)) {
- sqlite3.Xsqlite3_result_blob64(tls, ctx, pBuf, uint64(nIn), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ if nIn == sqlite3_int64(libc.Xfread(tls, pBuf, uint64(1), size_t(nIn), in)) {
+ sqlite3.Xsqlite3_result_blob64(tls, ctx, pBuf, uint64(nIn), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
} else {
sqlite3.Xsqlite3_result_error_code(tls, ctx, 10)
sqlite3.Xsqlite3_free(tls, pBuf)
}
- crt.Xfclose(tls, in)
+ libc.Xfclose(tls, in)
}
// Implementation of the "readfile(X)" SQL function. The entire content
// of the file named X is read and returned as a BLOB. NULL is returned
// if the file does not exist or is unreadable.
-func readfileFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* fileio.c:175:13: */
+func readfileFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* fileio.c:175:13: */
var zName uintptr
_ = argc // Unused parameter
zName = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
@@ -16680,7 +20261,7 @@ func readfileFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
// Set the error message contained in context ctx to the results of
// vprintf(zFmt, ...).
-func ctxErrorMsg(tls *crt.TLS, ctx uintptr, zFmt uintptr, va uintptr) { /* fileio.c:191:13: */
+func ctxErrorMsg(tls *libc.TLS, ctx uintptr, zFmt uintptr, va uintptr) { /* fileio.c:191:13: */
var zMsg uintptr = uintptr(0)
var ap va_list
_ = ap
@@ -16694,15 +20275,15 @@ func ctxErrorMsg(tls *crt.TLS, ctx uintptr, zFmt uintptr, va uintptr) { /* filei
// This function is used in place of stat(). On Windows, special handling
// is required in order for the included time to be returned as UTC. On all
// other systems, this function simply calls stat().
-func fileStat(tls *crt.TLS, zPath uintptr, pStatBuf uintptr) int32 { /* fileio.c:261:12: */
- return crt.Xstat(tls, zPath, pStatBuf)
+func fileStat(tls *libc.TLS, zPath uintptr, pStatBuf uintptr) int32 { /* fileio.c:261:12: */
+ return libc.Xstat(tls, zPath, pStatBuf)
}
// This function is used in place of lstat(). On Windows, special handling
// is required in order for the included time to be returned as UTC. On all
// other systems, this function simply calls lstat().
-func fileLinkStat(tls *crt.TLS, zPath uintptr, pStatBuf uintptr) int32 { /* fileio.c:279:12: */
- return crt.Xlstat(tls, zPath, pStatBuf)
+func fileLinkStat(tls *libc.TLS, zPath uintptr, pStatBuf uintptr) int32 { /* fileio.c:279:12: */
+ return libc.Xlstat(tls, zPath, pStatBuf)
}
// Argument zFile is the name of a file that will be created and/or written
@@ -16714,21 +20295,21 @@ func fileLinkStat(tls *crt.TLS, zPath uintptr, pStatBuf uintptr) int32 { /* file
// If an OOM condition is encountered, SQLITE_NOMEM is returned. Otherwise,
// SQLITE_OK is returned if the directory is successfully created, or
// SQLITE_ERROR otherwise.
-func makeDirectory(tls *crt.TLS, zFile uintptr) int32 { /* fileio.c:303:12: */
+func makeDirectory(tls *libc.TLS, zFile uintptr) int32 { /* fileio.c:303:12: */
bp := tls.Alloc(152)
defer tls.Free(152)
- var zCopy uintptr = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, zFile))
+ var zCopy uintptr = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, zFile))
var rc int32 = 0
if zCopy == uintptr(0) {
rc = 7
} else {
- var nCopy int32 = int32(crt.Xstrlen(tls, zCopy))
+ var nCopy int32 = int32(libc.Xstrlen(tls, zCopy))
var i int32 = 1
for rc == 0 {
- // var sStat struct {Fst_dev uint64;Fst_ino uint64;Fst_nlink uint64;Fst_mode uint32;Fst_uid uint32;Fst_gid uint32;F__pad0 int32;Fst_rdev uint64;Fst_size int64;Fst_blksize int64;Fst_blocks int64;Fst_atim timespec;Fst_mtim timespec;Fst_ctim timespec;F__glibc_reserved [3]int64;} at bp+8, 144
+ // var sStat stat at bp+8, 144
var rc2 int32
@@ -16741,27 +20322,11 @@ func makeDirectory(tls *crt.TLS, zFile uintptr) int32 { /* fileio.c:303:12: */
rc2 = fileStat(tls, zCopy, bp+8 /* &sStat */)
if rc2 != 0 {
- if crt.Xmkdir(tls, zCopy, uint32(0777)) != 0 {
+ if libc.Xmkdir(tls, zCopy, uint32(0777)) != 0 {
rc = 1
}
} else {
- if !((((*struct {
- Fst_dev uint64
- Fst_ino uint64
- Fst_nlink uint64
- Fst_mode uint32
- Fst_uid uint32
- Fst_gid uint32
- F__pad0 int32
- Fst_rdev uint64
- Fst_size int64
- Fst_blksize int64
- Fst_blocks int64
- Fst_atim timespec
- Fst_mtim timespec
- Fst_ctim timespec
- F__glibc_reserved [3]int64
- })(unsafe.Pointer(bp + 8 /* &sStat */)).Fst_mode) & uint32(0170000)) == (uint32(0040000))) {
+ if !((((*stat)(unsafe.Pointer(bp + 8 /* &sStat */)).Fst_mode) & uint32(0170000)) == (uint32(0040000))) {
rc = 1
}
}
@@ -16777,60 +20342,28 @@ func makeDirectory(tls *crt.TLS, zFile uintptr) int32 { /* fileio.c:303:12: */
// This function does the work for the writefile() UDF. Refer to
// header comments at the top of this file for details.
-func writeFile(tls *crt.TLS, pCtx uintptr, zFile uintptr, pData uintptr, mode mode_t, mtime sqlite3_int64) int32 { /* fileio.c:343:12: */
+func writeFile(tls *libc.TLS, pCtx uintptr, zFile uintptr, pData uintptr, mode mode_t, mtime sqlite3_int64) int32 { /* fileio.c:343:12: */
bp := tls.Alloc(176)
defer tls.Free(176)
if ((mode) & mode_t(0170000)) == (mode_t(0120000)) {
var zTo uintptr = sqlite3.Xsqlite3_value_text(tls, pData)
- if crt.Xsymlink(tls, zTo, zFile) < 0 {
+ if libc.Xsymlink(tls, zTo, zFile) < 0 {
return 1
}
} else {
if ((mode) & mode_t(0170000)) == (mode_t(0040000)) {
- if crt.Xmkdir(tls, zFile, mode) != 0 {
+ if libc.Xmkdir(tls, zFile, mode) != 0 {
// The mkdir() call to create the directory failed. This might not
// be an error though - if there is already a directory at the same
// path and either the permissions already match or can be changed
// to do so using chmod(), it is not an error.
- // var sStat struct {Fst_dev uint64;Fst_ino uint64;Fst_nlink uint64;Fst_mode uint32;Fst_uid uint32;Fst_gid uint32;F__pad0 int32;Fst_rdev uint64;Fst_size int64;Fst_blksize int64;Fst_blocks int64;Fst_atim timespec;Fst_mtim timespec;Fst_ctim timespec;F__glibc_reserved [3]int64;} at bp, 144
+ // var sStat stat at bp, 144
- if ((((*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) != 17) ||
+ if ((((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) != 17) ||
(0 != fileStat(tls, zFile, bp /* &sStat */))) ||
- !((((*struct {
- Fst_dev uint64
- Fst_ino uint64
- Fst_nlink uint64
- Fst_mode uint32
- Fst_uid uint32
- Fst_gid uint32
- F__pad0 int32
- Fst_rdev uint64
- Fst_size int64
- Fst_blksize int64
- Fst_blocks int64
- Fst_atim timespec
- Fst_mtim timespec
- Fst_ctim timespec
- F__glibc_reserved [3]int64
- })(unsafe.Pointer(bp /* &sStat */)).Fst_mode) & uint32(0170000)) == (uint32(0040000)))) ||
- ((((*struct {
- Fst_dev uint64
- Fst_ino uint64
- Fst_nlink uint64
- Fst_mode uint32
- Fst_uid uint32
- Fst_gid uint32
- F__pad0 int32
- Fst_rdev uint64
- Fst_size int64
- Fst_blksize int64
- Fst_blocks int64
- Fst_atim timespec
- Fst_mtim timespec
- Fst_ctim timespec
- F__glibc_reserved [3]int64
- })(unsafe.Pointer(bp /* &sStat */)).Fst_mode & uint32(0777)) != (mode & mode_t(0777))) && (0 != crt.Xchmod(tls, zFile, (mode&mode_t(0777))))) {
+ !((((*stat)(unsafe.Pointer(bp /* &sStat */)).Fst_mode) & uint32(0170000)) == (uint32(0040000)))) ||
+ ((((*stat)(unsafe.Pointer(bp /* &sStat */)).Fst_mode & uint32(0777)) != (mode & mode_t(0777))) && (0 != libc.Xchmod(tls, zFile, (mode&mode_t(0777))))) {
return 1
}
}
@@ -16838,20 +20371,20 @@ func writeFile(tls *crt.TLS, pCtx uintptr, zFile uintptr, pData uintptr, mode mo
var nWrite sqlite3_int64 = int64(0)
var z uintptr
var rc int32 = 0
- var out uintptr = crt.Xfopen(tls, zFile, ts+3456 /* "wb" */)
+ var out uintptr = libc.Xfopen(tls, zFile, ts+4673 /* "wb" */)
if out == uintptr(0) {
return 1
}
z = sqlite3.Xsqlite3_value_blob(tls, pData)
if z != 0 {
- var n sqlite3_int64 = sqlite3_int64(crt.Xfwrite(tls, z, uint64(1), uint64(sqlite3.Xsqlite3_value_bytes(tls, pData)), out))
+ var n sqlite3_int64 = sqlite3_int64(libc.Xfwrite(tls, z, uint64(1), uint64(sqlite3.Xsqlite3_value_bytes(tls, pData)), out))
nWrite = sqlite3_int64(sqlite3.Xsqlite3_value_bytes(tls, pData))
if nWrite != n {
rc = 1
}
}
- crt.Xfclose(tls, out)
- if ((rc == 0) && (mode != 0)) && (crt.Xchmod(tls, zFile, (mode&mode_t(0777))) != 0) {
+ libc.Xfclose(tls, out)
+ if ((rc == 0) && (mode != 0)) && (libc.Xchmod(tls, zFile, (mode&mode_t(0777))) != 0) {
rc = 1
}
if rc != 0 {
@@ -16865,10 +20398,10 @@ func writeFile(tls *crt.TLS, pCtx uintptr, zFile uintptr, pData uintptr, mode mo
// Legacy unix
// var times [2]timeval at bp+144, 32
- (*timeval)(unsafe.Pointer(bp + 144 /* &times */ + uintptr(0)*16)).Ftv_usec = crt.AssignPtrInt64(bp+144 /* &times */ +uintptr(1)*16+8 /* &.tv_usec */, int64(0))
- (*timeval)(unsafe.Pointer(bp + 144 /* &times */ + uintptr(0)*16)).Ftv_sec = crt.Xtime(tls, uintptr(0))
+ (*timeval)(unsafe.Pointer(bp + 144 /* &times */ + uintptr(0)*16)).Ftv_usec = libc.AssignPtrInt64(bp+144 /* &times */ +uintptr(1)*16+8 /* &.tv_usec */, int64(0))
+ (*timeval)(unsafe.Pointer(bp + 144 /* &times */ + uintptr(0)*16)).Ftv_sec = libc.Xtime(tls, uintptr(0))
(*timeval)(unsafe.Pointer(bp + 144 /* &times */ + uintptr(1)*16)).Ftv_sec = int64(mtime)
- if crt.Xutimes(tls, zFile, bp+144 /* &times[0] */) != 0 {
+ if libc.Xutimes(tls, zFile, bp+144 /* &times[0] */) != 0 {
return 1
}
}
@@ -16878,7 +20411,7 @@ func writeFile(tls *crt.TLS, pCtx uintptr, zFile uintptr, pData uintptr, mode mo
// Implementation of the "writefile(W,X[,Y[,Z]]])" SQL function.
// Refer to header comments at the top of this file for details.
-func writefileFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* fileio.c:457:13: */
+func writefileFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* fileio.c:457:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -16889,7 +20422,7 @@ func writefileFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
if (argc < 2) || (argc > 4) {
sqlite3.Xsqlite3_result_error(tls, context,
- ts+3459 /* "wrong number of ..." */, -1)
+ ts+4676 /* "wrong number of ..." */, -1)
return
}
@@ -16905,7 +20438,7 @@ func writefileFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
}
res = writeFile(tls, context, zFile, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), mode, mtime)
- if (res == 1) && ((*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) == 2) {
+ if (res == 1) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == 2) {
if makeDirectory(tls, zFile) == 0 {
res = writeFile(tls, context, zFile, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), mode, mtime)
}
@@ -16913,11 +20446,11 @@ func writefileFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
if (argc > 2) && (res != 0) {
if ((mode) & mode_t(0170000)) == (mode_t(0120000)) {
- ctxErrorMsg(tls, context, ts+3509 /* "failed to create..." */, crt.VaList(bp, zFile))
+ ctxErrorMsg(tls, context, ts+4726 /* "failed to create..." */, libc.VaList(bp, zFile))
} else if ((mode) & mode_t(0170000)) == (mode_t(0040000)) {
- ctxErrorMsg(tls, context, ts+3538 /* "failed to create..." */, crt.VaList(bp+8, zFile))
+ ctxErrorMsg(tls, context, ts+4755 /* "failed to create..." */, libc.VaList(bp+8, zFile))
} else {
- ctxErrorMsg(tls, context, ts+3569 /* "failed to write ..." */, crt.VaList(bp+16, zFile))
+ ctxErrorMsg(tls, context, ts+4786 /* "failed to write ..." */, libc.VaList(bp+16, zFile))
}
}
}
@@ -16926,7 +20459,7 @@ func writefileFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
//
// Given a numberic st_mode from stat(), convert it into a human-readable
// text string in the style of "ls -l".
-func lsModeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* fileio.c:507:13: */
+func lsModeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* fileio.c:507:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -16967,7 +20500,7 @@ func lsModeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* fi
}()
}
*(*int8)(unsafe.Pointer(bp /* &z[0] */ + uintptr(10))) = int8(0)
- sqlite3.Xsqlite3_result_text(tls, context, bp /* &z[0] */, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, context, bp /* &z[0] */, -1, libc.UintptrFromInt32(-1))
}
// Cursor type for recursively iterating through a directory structure.
@@ -17022,20 +20555,20 @@ type fsdir_tab1 = struct{ Fbase sqlite3_vtab }
type fsdir_tab = fsdir_tab1 /* fileio.c:564:26 */
// Construct a new fsdir virtual table object.
-func fsdirConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* fileio.c:572:12: */
+func fsdirConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* fileio.c:572:12: */
var pNew uintptr = uintptr(0)
var rc int32
_ = pAux
_ = argc
_ = argv
_ = pzErr
- rc = sqlite3.Xsqlite3_declare_vtab(tls, db, ts+3594 /* "CREATE TABLE x(n..." */)
+ rc = sqlite3.Xsqlite3_declare_vtab(tls, db, ts+4811 /* "CREATE TABLE x(n..." */)
if rc == 0 {
pNew = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(fsdir_tab{})))
if pNew == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(fsdir_tab{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(fsdir_tab{})))
sqlite3.Xsqlite3_vtab_config(tls, db, 3, 0)
}
*(*uintptr)(unsafe.Pointer(ppVtab)) = pNew
@@ -17043,20 +20576,20 @@ func fsdirConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintp
}
// This method is the destructor for fsdir vtab objects.
-func fsdirDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* fileio.c:599:12: */
+func fsdirDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* fileio.c:599:12: */
sqlite3.Xsqlite3_free(tls, pVtab)
return 0
}
// Constructor for a new fsdir_cursor object.
-func fsdirOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* fileio.c:607:12: */
+func fsdirOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* fileio.c:607:12: */
var pCur uintptr
_ = p
pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(fsdir_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(fsdir_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(fsdir_cursor{})))
(*fsdir_cursor)(unsafe.Pointer(pCur)).FiLvl = -1
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
return 0
@@ -17064,12 +20597,12 @@ func fsdirOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* fileio.c:60
// Reset a cursor back to the state it was in when first returned
// by fsdirOpen().
-func fsdirResetCursor(tls *crt.TLS, pCur uintptr) { /* fileio.c:622:13: */
+func fsdirResetCursor(tls *libc.TLS, pCur uintptr) { /* fileio.c:622:13: */
var i int32
for i = 0; i <= (*fsdir_cursor)(unsafe.Pointer(pCur)).FiLvl; i++ {
var pLvl uintptr = ((*fsdir_cursor)(unsafe.Pointer(pCur)).FaLvl + uintptr(i)*16)
if (*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir != 0 {
- crt.Xclosedir(tls, (*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir)
+ libc.Xclosedir(tls, (*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir)
}
sqlite3.Xsqlite3_free(tls, (*FsdirLevel)(unsafe.Pointer(pLvl)).FzDir)
}
@@ -17085,7 +20618,7 @@ func fsdirResetCursor(tls *crt.TLS, pCur uintptr) { /* fileio.c:622:13: */
}
// Destructor for an fsdir_cursor.
-func fsdirClose(tls *crt.TLS, cur uintptr) int32 { /* fileio.c:643:12: */
+func fsdirClose(tls *libc.TLS, cur uintptr) int32 { /* fileio.c:643:12: */
var pCur uintptr = cur
fsdirResetCursor(tls, pCur)
@@ -17095,7 +20628,7 @@ func fsdirClose(tls *crt.TLS, cur uintptr) int32 { /* fileio.c:643:12: */
// Set the error message for the virtual table associated with cursor
// pCur to the results of vprintf(zFmt, ...).
-func fsdirSetErrmsg(tls *crt.TLS, pCur uintptr, zFmt uintptr, va uintptr) { /* fileio.c:655:13: */
+func fsdirSetErrmsg(tls *libc.TLS, pCur uintptr, zFmt uintptr, va uintptr) { /* fileio.c:655:13: */
var ap va_list
_ = ap
ap = va
@@ -17104,7 +20637,7 @@ func fsdirSetErrmsg(tls *crt.TLS, pCur uintptr, zFmt uintptr, va uintptr) { /* f
}
// Advance an fsdir_cursor to its next row of output.
-func fsdirNext(tls *crt.TLS, cur uintptr) int32 { /* fileio.c:666:12: */
+func fsdirNext(tls *libc.TLS, cur uintptr) int32 { /* fileio.c:666:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -17123,7 +20656,7 @@ func fsdirNext(tls *crt.TLS, cur uintptr) int32 { /* fileio.c:666:12: */
if aNew == uintptr(0) {
return 7
}
- crt.Xmemset(tls, (aNew + uintptr((*fsdir_cursor)(unsafe.Pointer(pCur)).FnLvl)*16), 0, (uint64(unsafe.Sizeof(FsdirLevel{})) * (uint64(nNew - (*fsdir_cursor)(unsafe.Pointer(pCur)).FnLvl))))
+ libc.Xmemset(tls, (aNew + uintptr((*fsdir_cursor)(unsafe.Pointer(pCur)).FnLvl)*16), 0, (uint64(unsafe.Sizeof(FsdirLevel{})) * (uint64(nNew - (*fsdir_cursor)(unsafe.Pointer(pCur)).FnLvl))))
(*fsdir_cursor)(unsafe.Pointer(pCur)).FaLvl = aNew
(*fsdir_cursor)(unsafe.Pointer(pCur)).FnLvl = nNew
}
@@ -17132,16 +20665,16 @@ func fsdirNext(tls *crt.TLS, cur uintptr) int32 { /* fileio.c:666:12: */
(*FsdirLevel)(unsafe.Pointer(pLvl)).FzDir = (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath
(*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = uintptr(0)
- (*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir = crt.Xopendir(tls, (*FsdirLevel)(unsafe.Pointer(pLvl)).FzDir)
+ (*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir = libc.Xopendir(tls, (*FsdirLevel)(unsafe.Pointer(pLvl)).FzDir)
if (*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir == uintptr(0) {
- fsdirSetErrmsg(tls, pCur, ts+3654 /* "cannot read dire..." */, crt.VaList(bp, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath))
+ fsdirSetErrmsg(tls, pCur, ts+4871 /* "cannot read dire..." */, libc.VaList(bp, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath))
return 1
}
}
for (*fsdir_cursor)(unsafe.Pointer(pCur)).FiLvl >= 0 {
var pLvl uintptr = ((*fsdir_cursor)(unsafe.Pointer(pCur)).FaLvl + uintptr((*fsdir_cursor)(unsafe.Pointer(pCur)).FiLvl)*16)
- var pEntry uintptr = crt.Xreaddir(tls, (*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir)
+ var pEntry uintptr = libc.Xreaddir(tls, (*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir)
if pEntry != 0 {
if int32(*(*int8)(unsafe.Pointer((pEntry + 19 /* &.d_name */) + uintptr(0)))) == '.' {
if (int32(*(*int8)(unsafe.Pointer((pEntry + 19 /* &.d_name */) + uintptr(1)))) == '.') && (int32(*(*int8)(unsafe.Pointer((pEntry + 19 /* &.d_name */) + uintptr(2)))) == 0) {
@@ -17152,17 +20685,17 @@ func fsdirNext(tls *crt.TLS, cur uintptr) int32 { /* fileio.c:666:12: */
}
}
sqlite3.Xsqlite3_free(tls, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath)
- (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = sqlite3.Xsqlite3_mprintf(tls, ts+3680 /* "%s/%s" */, crt.VaList(bp+8, (*FsdirLevel)(unsafe.Pointer(pLvl)).FzDir, pEntry+19 /* &.d_name */))
+ (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = sqlite3.Xsqlite3_mprintf(tls, ts+4897 /* "%s/%s" */, libc.VaList(bp+8, (*FsdirLevel)(unsafe.Pointer(pLvl)).FzDir, pEntry+19 /* &.d_name */))
if (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath == uintptr(0) {
return 7
}
if fileLinkStat(tls, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath, (pCur+40 /* &.sStat */)) != 0 {
- fsdirSetErrmsg(tls, pCur, ts+3686 /* "cannot stat file..." */, crt.VaList(bp+24, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath))
+ fsdirSetErrmsg(tls, pCur, ts+4903 /* "cannot stat file..." */, libc.VaList(bp+24, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath))
return 1
}
return 0
}
- crt.Xclosedir(tls, (*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir)
+ libc.Xclosedir(tls, (*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir)
sqlite3.Xsqlite3_free(tls, (*FsdirLevel)(unsafe.Pointer(pLvl)).FzDir)
(*FsdirLevel)(unsafe.Pointer(pLvl)).FpDir = uintptr(0)
(*FsdirLevel)(unsafe.Pointer(pLvl)).FzDir = uintptr(0)
@@ -17177,7 +20710,7 @@ func fsdirNext(tls *crt.TLS, cur uintptr) int32 { /* fileio.c:666:12: */
// Return values of columns for the row at which the series_cursor
// is currently pointing.
-func fsdirColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* fileio.c:730:12: */
+func fsdirColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* fileio.c:730:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -17185,7 +20718,7 @@ func fsdirColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* fil
switch i {
case 0:
{
- sqlite3.Xsqlite3_result_text(tls, ctx, ((*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath + uintptr((*fsdir_cursor)(unsafe.Pointer(pCur)).FnBase)), -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, ((*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath + uintptr((*fsdir_cursor)(unsafe.Pointer(pCur)).FnBase)), -1, libc.UintptrFromInt32(-1))
break
}
@@ -17210,7 +20743,7 @@ func fsdirColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* fil
var n int32
for 1 != 0 {
- n = int32(crt.Xreadlink(tls, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath, aBuf, uint64(nBuf)))
+ n = int32(libc.Xreadlink(tls, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath, aBuf, uint64(nBuf)))
if sqlite3_int64(n) < nBuf {
break
}
@@ -17225,7 +20758,7 @@ func fsdirColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* fil
}
}
- sqlite3.Xsqlite3_result_text(tls, ctx, aBuf, n, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, aBuf, n, libc.UintptrFromInt32(-1))
if aBuf != bp /* aStatic */ {
sqlite3.Xsqlite3_free(tls, aBuf)
}
@@ -17249,7 +20782,7 @@ func fsdirColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* fil
// Return the rowid for the current row. In this implementation, the
// first row returned is assigned rowid value 1, and each subsequent
// row a value 1 more than that of the previous.
-func fsdirRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* fileio.c:795:12: */
+func fsdirRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* fileio.c:795:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*fsdir_cursor)(unsafe.Pointer(pCur)).FiRowid
return 0
@@ -17257,16 +20790,16 @@ func fsdirRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* fileio.c:7
// Return TRUE if the cursor has been moved off of the last
// row of output.
-func fsdirEof(tls *crt.TLS, cur uintptr) int32 { /* fileio.c:805:12: */
+func fsdirEof(tls *libc.TLS, cur uintptr) int32 { /* fileio.c:805:12: */
var pCur uintptr = cur
- return (crt.Bool32((*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath == uintptr(0)))
+ return (libc.Bool32((*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath == uintptr(0)))
}
// xFilter callback.
//
// idxNum==1 PATH parameter only
// idxNum==2 Both PATH and DIR supplied
-func fsdirFilter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* fileio.c:816:12: */
+func fsdirFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* fileio.c:816:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -17276,30 +20809,30 @@ func fsdirFilter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc i
fsdirResetCursor(tls, pCur)
if idxNum == 0 {
- fsdirSetErrmsg(tls, pCur, ts+3707 /* "table function f..." */, 0)
+ fsdirSetErrmsg(tls, pCur, ts+4924 /* "table function f..." */, 0)
return 1
}
zDir = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
if zDir == uintptr(0) {
- fsdirSetErrmsg(tls, pCur, ts+3749 /* "table function f..." */, 0)
+ fsdirSetErrmsg(tls, pCur, ts+4966 /* "table function f..." */, 0)
return 1
}
if argc == 2 {
(*fsdir_cursor)(unsafe.Pointer(pCur)).FzBase = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
}
if (*fsdir_cursor)(unsafe.Pointer(pCur)).FzBase != 0 {
- (*fsdir_cursor)(unsafe.Pointer(pCur)).FnBase = (int32(crt.Xstrlen(tls, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzBase)) + 1)
- (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = sqlite3.Xsqlite3_mprintf(tls, ts+3680 /* "%s/%s" */, crt.VaList(bp, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzBase, zDir))
+ (*fsdir_cursor)(unsafe.Pointer(pCur)).FnBase = (int32(libc.Xstrlen(tls, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzBase)) + 1)
+ (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = sqlite3.Xsqlite3_mprintf(tls, ts+4897 /* "%s/%s" */, libc.VaList(bp, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzBase, zDir))
} else {
- (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+16, zDir))
+ (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+16, zDir))
}
if (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath == uintptr(0) {
return 7
}
if fileLinkStat(tls, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath, (pCur+40 /* &.sStat */)) != 0 {
- fsdirSetErrmsg(tls, pCur, ts+3686 /* "cannot stat file..." */, crt.VaList(bp+24, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath))
+ fsdirSetErrmsg(tls, pCur, ts+4903 /* "cannot stat file..." */, libc.VaList(bp+24, (*fsdir_cursor)(unsafe.Pointer(pCur)).FzPath))
return 1
}
@@ -17318,7 +20851,7 @@ func fsdirFilter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc i
//
// (1) The path value is supplied by argv[0]
// (2) Path is in argv[0] and dir is in argv[1]
-func fsdirBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* fileio.c:872:12: */
+func fsdirBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* fileio.c:872:12: */
var i int32 // Loop over constraints
var idxPath int32 = -1 // Index in pIdxInfo->aConstraint of PATH=
var idxDir int32 = -1 // Index in pIdxInfo->aConstraint of DIR=
@@ -17396,9 +20929,9 @@ __3:
}
// Register the "fsdir" virtual table.
-func fsdirRegister(tls *crt.TLS, db uintptr) int32 { /* fileio.c:938:12: */
+func fsdirRegister(tls *libc.TLS, db uintptr) int32 { /* fileio.c:938:12: */
- var rc int32 = sqlite3.Xsqlite3_create_module(tls, db, ts+3799 /* "fsdir" */, uintptr(unsafe.Pointer(&fsdirModule1)), uintptr(0))
+ var rc int32 = sqlite3.Xsqlite3_create_module(tls, db, ts+5016 /* "fsdir" */, uintptr(unsafe.Pointer(&fsdirModule1)), uintptr(0))
return rc
}
@@ -17428,27 +20961,27 @@ uintptr(0), FxShadowName:// xRollbackTo
uintptr(0), // xShadowName
} /* fileio.c:939:25 */
-func sqlite3_fileio_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* fileio.c:976:5: */
+func sqlite3_fileio_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* fileio.c:976:5: */
var rc int32 = 0
_ = pApi
_ = pzErrMsg // Unused parameter
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+3805 /* "readfile" */, 1,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5022 /* "readfile" */, 1,
(1 | 0x000080000), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{readfileFunc})), uintptr(0), uintptr(0))
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+3814 /* "writefile" */, -1,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5031 /* "writefile" */, -1,
(1 | 0x000080000), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{writefileFunc})), uintptr(0), uintptr(0))
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+3824 /* "lsmode" */, 1, 1, uintptr(0),
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5041 /* "lsmode" */, 1, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{lsModeFunc})), uintptr(0), uintptr(0))
}
if rc == 0 {
@@ -17531,7 +21064,7 @@ type fuzzer_ruleid = int32 /* fuzzer.c:179:13 */
// The two input rule lists are both sorted in order of increasing
// cost. Merge them together into a single list, sorted by cost, and
// return a pointer to the head of that list.
-func fuzzerMergeRules(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* fuzzer.c:261:20: */
+func fuzzerMergeRules(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* fuzzer.c:261:20: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -17566,7 +21099,7 @@ func fuzzerMergeRules(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* fuzzer.
// If successful, *ppRule is set to point to the new object and SQLITE_OK
// is returned. Otherwise, *ppRule is zeroed, *pzErr may be set to point
// to an error message and an SQLite error code returned.
-func fuzzerLoadOneRule(tls *crt.TLS, p uintptr, pStmt uintptr, ppRule uintptr, pzErr uintptr) int32 { /* fuzzer.c:294:12: */
+func fuzzerLoadOneRule(tls *libc.TLS, p uintptr, pStmt uintptr, ppRule uintptr, pzErr uintptr) int32 { /* fuzzer.c:294:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -17586,26 +21119,26 @@ func fuzzerLoadOneRule(tls *crt.TLS, p uintptr, pStmt uintptr, ppRule uintptr, p
if zTo == uintptr(0) {
zTo = ts + 488 /* "" */
}
- nFrom = int32(crt.Xstrlen(tls, zFrom))
- nTo = int32(crt.Xstrlen(tls, zTo))
+ nFrom = int32(libc.Xstrlen(tls, zFrom))
+ nTo = int32(libc.Xstrlen(tls, zTo))
// Silently ignore null transformations
- if crt.Xstrcmp(tls, zFrom, zTo) == 0 {
+ if libc.Xstrcmp(tls, zFrom, zTo) == 0 {
*(*uintptr)(unsafe.Pointer(ppRule)) = uintptr(0)
return 0
}
if (nCost <= 0) || (nCost > 1000) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+1962, /* "%s: cost must be..." */
- crt.VaList(bp, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, 1000))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3118, /* "%s: cost must be..." */
+ libc.VaList(bp, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, 1000))
rc = 1
} else if (nFrom > 50) || (nTo > 50) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+1996, /* "%s: maximum stri..." */
- crt.VaList(bp+16, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, 50))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3152, /* "%s: maximum stri..." */
+ libc.VaList(bp+16, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, 50))
rc = 1
} else if (iRuleset < int64(0)) || (iRuleset > int64(2147483647)) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3831, /* "%s: ruleset must..." */
- crt.VaList(bp+32, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, 2147483647))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+5048, /* "%s: ruleset must..." */
+ libc.VaList(bp+32, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, 2147483647))
rc = 1
} else {
@@ -17613,12 +21146,12 @@ func fuzzerLoadOneRule(tls *crt.TLS, p uintptr, pStmt uintptr, ppRule uintptr, p
if pRule == uintptr(0) {
rc = 7
} else {
- crt.Xmemset(tls, pRule, 0, uint64(unsafe.Sizeof(fuzzer_rule{})))
+ libc.Xmemset(tls, pRule, 0, uint64(unsafe.Sizeof(fuzzer_rule{})))
(*fuzzer_rule)(unsafe.Pointer(pRule)).FzFrom = pRule + 28 /* &.zTo */
*(*uintptr)(unsafe.Pointer(pRule + 8 /* &.zFrom */)) += (uintptr(nTo + 1))
(*fuzzer_rule)(unsafe.Pointer(pRule)).FnFrom = fuzzer_len(nFrom)
- crt.Xmemcpy(tls, (*fuzzer_rule)(unsafe.Pointer(pRule)).FzFrom, zFrom, (uint64(nFrom + 1)))
- crt.Xmemcpy(tls, pRule+28 /* &.zTo */, zTo, (uint64(nTo + 1)))
+ libc.Xmemcpy(tls, (*fuzzer_rule)(unsafe.Pointer(pRule)).FzFrom, zFrom, (uint64(nFrom + 1)))
+ libc.Xmemcpy(tls, pRule+28 /* &.zTo */, zTo, (uint64(nTo + 1)))
(*fuzzer_rule)(unsafe.Pointer(pRule)).FnTo = fuzzer_len(nTo)
(*fuzzer_rule)(unsafe.Pointer(pRule)).FrCost = nCost
(*fuzzer_rule)(unsafe.Pointer(pRule)).FiRuleset = int32(iRuleset)
@@ -17630,7 +21163,7 @@ func fuzzerLoadOneRule(tls *crt.TLS, p uintptr, pStmt uintptr, ppRule uintptr, p
}
// Load the content of the fuzzer data table into memory.
-func fuzzerLoadRules(tls *crt.TLS, db uintptr, p uintptr, zDb uintptr, zData uintptr, pzErr uintptr) int32 { /* fuzzer.c:363:12: */
+func fuzzerLoadRules(tls *libc.TLS, db uintptr, p uintptr, zDb uintptr, zData uintptr, pzErr uintptr) int32 { /* fuzzer.c:363:12: */
bp := tls.Alloc(192)
defer tls.Free(192)
@@ -17638,7 +21171,7 @@ func fuzzerLoadRules(tls *crt.TLS, db uintptr, p uintptr, zDb uintptr, zData uin
var zSql uintptr // SELECT used to read from rules table
var pHead uintptr = uintptr(0)
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+2065 /* "SELECT * FROM %Q..." */, crt.VaList(bp, zDb, zData))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+3221 /* "SELECT * FROM %Q..." */, libc.VaList(bp, zDb, zData))
if zSql == uintptr(0) {
rc = 7
} else {
@@ -17646,10 +21179,10 @@ func fuzzerLoadRules(tls *crt.TLS, db uintptr, p uintptr, zDb uintptr, zData uin
*(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)) = uintptr(0)
rc = sqlite3.Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+56 /* &pStmt */, uintptr(0))
if rc != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+2085 /* "%s: %s" */, crt.VaList(bp+16, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, sqlite3.Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3241 /* "%s: %s" */, libc.VaList(bp+16, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, sqlite3.Xsqlite3_errmsg(tls, db)))
} else if sqlite3.Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */))) != 4 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+2092, /* "%s: %s has %d co..." */
- crt.VaList(bp+32, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, zData, sqlite3.Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+3248, /* "%s: %s has %d co..." */
+ libc.VaList(bp+32, (*fuzzer_vtab)(unsafe.Pointer(p)).FzClassName, zData, sqlite3.Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)))))
rc = 1
} else {
for (rc == 0) && (100 == sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)))) {
@@ -17679,7 +21212,7 @@ func fuzzerLoadRules(tls *crt.TLS, db uintptr, p uintptr, zDb uintptr, zData uin
for i = uint32(0); uint64(i) < (uint64(unsafe.Sizeof([15]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0)))); i++ {
*(*uintptr)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(i)*8)) = uintptr(0)
}
- for (crt.AssignUintptr(&pX, pHead)) != uintptr(0) {
+ for (libc.AssignUintptr(&pX, pHead)) != uintptr(0) {
pHead = (*fuzzer_rule)(unsafe.Pointer(pX)).FpNext
(*fuzzer_rule)(unsafe.Pointer(pX)).FpNext = uintptr(0)
for i = uint32(0); (*(*uintptr)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(i)*8)) != 0) && (uint64(i) < ((uint64(unsafe.Sizeof([15]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0)))) - uint64(1))); i++ {
@@ -17715,17 +21248,17 @@ func fuzzerLoadRules(tls *crt.TLS, db uintptr, p uintptr, zDb uintptr, zData uin
// 'xyz' becomes xyz
// [pqr] becomes pqr
// `mno` becomes mno
-func fuzzerDequote(tls *crt.TLS, zIn uintptr) uintptr { /* fuzzer.c:449:13: */
+func fuzzerDequote(tls *libc.TLS, zIn uintptr) uintptr { /* fuzzer.c:449:13: */
var nIn sqlite3_int64 // Size of input string, in bytes
var zOut uintptr // Output (dequoted) string
- nIn = sqlite3_int64(crt.Xstrlen(tls, zIn))
+ nIn = sqlite3_int64(libc.Xstrlen(tls, zIn))
zOut = sqlite3.Xsqlite3_malloc64(tls, (uint64(nIn + int64(1))))
if zOut != 0 {
var q int8 = *(*int8)(unsafe.Pointer(zIn + uintptr(0))) // Quote character (if any )
if (((int32(q) != '[') && (int32(q) != '\'')) && (int32(q) != '"')) && (int32(q) != '`') {
- crt.Xmemcpy(tls, zOut, zIn, (size_t(nIn + int64(1))))
+ libc.Xmemcpy(tls, zOut, zIn, (size_t(nIn + int64(1))))
} else {
var iOut int32 = 0 // Index of next byte to write to output
var iIn int32 // Index of next byte to read from input
@@ -17737,7 +21270,7 @@ func fuzzerDequote(tls *crt.TLS, zIn uintptr) uintptr { /* fuzzer.c:449:13: */
if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(iIn)))) == int32(q) {
iIn++
}
- *(*int8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(zIn + uintptr(iIn)))
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(zIn + uintptr(iIn)))
}
}
}
@@ -17745,7 +21278,7 @@ func fuzzerDequote(tls *crt.TLS, zIn uintptr) uintptr { /* fuzzer.c:449:13: */
}
// xDisconnect/xDestroy method for the fuzzer module.
-func fuzzerDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* fuzzer.c:478:12: */
+func fuzzerDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* fuzzer.c:478:12: */
var p uintptr = pVtab
for (*fuzzer_vtab)(unsafe.Pointer(p)).FpRule != 0 {
@@ -17763,7 +21296,7 @@ func fuzzerDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* fuzzer.c:478:12: *
// argv[1] -> database name
// argv[2] -> table name
// argv[3] -> fuzzer rule table name
-func fuzzerConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* fuzzer.c:498:12: */
+func fuzzerConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* fuzzer.c:498:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -17774,21 +21307,21 @@ func fuzzerConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uint
if argc != 4 {
*(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls,
- ts+3868 /* "%s: wrong number..." */, crt.VaList(bp, zModule))
+ ts+5085 /* "%s: wrong number..." */, libc.VaList(bp, zModule))
rc = 1
} else {
var nModule sqlite3_int64 // Length of zModule, in bytes
- nModule = sqlite3_int64(crt.Xstrlen(tls, zModule))
+ nModule = sqlite3_int64(libc.Xstrlen(tls, zModule))
pNew = sqlite3.Xsqlite3_malloc64(tls, ((uint64(unsafe.Sizeof(fuzzer_vtab{})) + uint64(nModule)) + uint64(1)))
if pNew == uintptr(0) {
rc = 7
} else {
var zTab uintptr // Dequoted name of fuzzer data table
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(fuzzer_vtab{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(fuzzer_vtab{})))
(*fuzzer_vtab)(unsafe.Pointer(pNew)).FzClassName = (pNew + uintptr(1)*48)
- crt.Xmemcpy(tls, (*fuzzer_vtab)(unsafe.Pointer(pNew)).FzClassName, zModule, (size_t(nModule + int64(1))))
+ libc.Xmemcpy(tls, (*fuzzer_vtab)(unsafe.Pointer(pNew)).FzClassName, zModule, (size_t(nModule + int64(1))))
zTab = fuzzerDequote(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)))
if zTab == uintptr(0) {
@@ -17799,7 +21332,7 @@ func fuzzerConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uint
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_declare_vtab(tls, db, ts+3919 /* "CREATE TABLE x(w..." */)
+ rc = sqlite3.Xsqlite3_declare_vtab(tls, db, ts+5136 /* "CREATE TABLE x(w..." */)
}
if rc != 0 {
fuzzerDisconnect(tls, pNew)
@@ -17815,14 +21348,14 @@ func fuzzerConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uint
}
// Open a new fuzzer cursor.
-func fuzzerOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* fuzzer.c:556:12: */
+func fuzzerOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* fuzzer.c:556:12: */
var p uintptr = pVTab
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(fuzzer_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(fuzzer_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(fuzzer_cursor{})))
(*fuzzer_cursor)(unsafe.Pointer(pCur)).FpVtab = p
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
(*fuzzer_vtab)(unsafe.Pointer(p)).FnCursor++
@@ -17830,7 +21363,7 @@ func fuzzerOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* fuzzer
}
// Free all stems in a list.
-func fuzzerClearStemList(tls *crt.TLS, pStem uintptr) { /* fuzzer.c:571:13: */
+func fuzzerClearStemList(tls *libc.TLS, pStem uintptr) { /* fuzzer.c:571:13: */
for pStem != 0 {
var pNext uintptr = (*fuzzer_stem)(unsafe.Pointer(pStem)).FpNext
sqlite3.Xsqlite3_free(tls, pStem)
@@ -17840,7 +21373,7 @@ func fuzzerClearStemList(tls *crt.TLS, pStem uintptr) { /* fuzzer.c:571:13: */
// Free up all the memory allocated by a cursor. Set it rLimit to 0
// to indicate that it is at EOF.
-func fuzzerClearCursor(tls *crt.TLS, pCur uintptr, clearHash int32) { /* fuzzer.c:583:13: */
+func fuzzerClearCursor(tls *libc.TLS, pCur uintptr, clearHash int32) { /* fuzzer.c:583:13: */
var i int32
fuzzerClearStemList(tls, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FpStem)
fuzzerClearStemList(tls, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FpDone)
@@ -17852,14 +21385,14 @@ func fuzzerClearCursor(tls *crt.TLS, pCur uintptr, clearHash int32) { /* fuzzer.
(*fuzzer_cursor)(unsafe.Pointer(pCur)).FmxQueue = 0
(*fuzzer_cursor)(unsafe.Pointer(pCur)).FpStem = uintptr(0)
(*fuzzer_cursor)(unsafe.Pointer(pCur)).FpDone = uintptr(0)
- crt.Xmemset(tls, pCur+48 /* &.aQueue */, 0, uint64(unsafe.Sizeof([20]uintptr{})))
- crt.Xmemset(tls, pCur+272 /* &.apHash */, 0, uint64(unsafe.Sizeof([4001]uintptr{})))
+ libc.Xmemset(tls, pCur+48 /* &.aQueue */, 0, uint64(unsafe.Sizeof([20]uintptr{})))
+ libc.Xmemset(tls, pCur+272 /* &.apHash */, 0, uint64(unsafe.Sizeof([4001]uintptr{})))
}
(*fuzzer_cursor)(unsafe.Pointer(pCur)).FnStem = 0
}
// Close a fuzzer cursor.
-func fuzzerClose(tls *crt.TLS, cur uintptr) int32 { /* fuzzer.c:602:12: */
+func fuzzerClose(tls *libc.TLS, cur uintptr) int32 { /* fuzzer.c:602:12: */
var pCur uintptr = cur
fuzzerClearCursor(tls, pCur, 0)
sqlite3.Xsqlite3_free(tls, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FzBuf)
@@ -17869,7 +21402,7 @@ func fuzzerClose(tls *crt.TLS, cur uintptr) int32 { /* fuzzer.c:602:12: */
}
// Compute the current output term for a fuzzer_stem.
-func fuzzerRender(tls *crt.TLS, pStem uintptr, pzBuf uintptr, pnBuf uintptr) int32 { /* fuzzer.c:614:12: */
+func fuzzerRender(tls *libc.TLS, pStem uintptr, pzBuf uintptr, pnBuf uintptr) int32 { /* fuzzer.c:614:12: */
var pRule uintptr = (*fuzzer_stem)(unsafe.Pointer(pStem)).FpRule
var n int32 // Size of output term without nul-term
var z uintptr // Buffer to assemble output term in
@@ -17885,11 +21418,11 @@ func fuzzerRender(tls *crt.TLS, pStem uintptr, pzBuf uintptr, pnBuf uintptr) int
n = int32((*fuzzer_stem)(unsafe.Pointer(pStem)).Fn)
z = *(*uintptr)(unsafe.Pointer(pzBuf))
if n < 0 {
- crt.Xmemcpy(tls, z, (*fuzzer_stem)(unsafe.Pointer(pStem)).FzBasis, (uint64(int32((*fuzzer_stem)(unsafe.Pointer(pStem)).FnBasis) + 1)))
+ libc.Xmemcpy(tls, z, (*fuzzer_stem)(unsafe.Pointer(pStem)).FzBasis, (uint64(int32((*fuzzer_stem)(unsafe.Pointer(pStem)).FnBasis) + 1)))
} else {
- crt.Xmemcpy(tls, z, (*fuzzer_stem)(unsafe.Pointer(pStem)).FzBasis, uint64(n))
- crt.Xmemcpy(tls, (z + uintptr(n)), pRule+28 /* &.zTo */, uint64((*fuzzer_rule)(unsafe.Pointer(pRule)).FnTo))
- crt.Xmemcpy(tls, (z + uintptr((n + int32((*fuzzer_rule)(unsafe.Pointer(pRule)).FnTo)))), ((*fuzzer_stem)(unsafe.Pointer(pStem)).FzBasis + uintptr((n + int32((*fuzzer_rule)(unsafe.Pointer(pRule)).FnFrom)))),
+ libc.Xmemcpy(tls, z, (*fuzzer_stem)(unsafe.Pointer(pStem)).FzBasis, uint64(n))
+ libc.Xmemcpy(tls, (z + uintptr(n)), pRule+28 /* &.zTo */, uint64((*fuzzer_rule)(unsafe.Pointer(pRule)).FnTo))
+ libc.Xmemcpy(tls, (z + uintptr((n + int32((*fuzzer_rule)(unsafe.Pointer(pRule)).FnTo)))), ((*fuzzer_stem)(unsafe.Pointer(pStem)).FzBasis + uintptr((n + int32((*fuzzer_rule)(unsafe.Pointer(pRule)).FnFrom)))),
(uint64(((int32((*fuzzer_stem)(unsafe.Pointer(pStem)).FnBasis) - n) - int32((*fuzzer_rule)(unsafe.Pointer(pRule)).FnFrom)) + 1)))
}
@@ -17897,23 +21430,23 @@ func fuzzerRender(tls *crt.TLS, pStem uintptr, pzBuf uintptr, pnBuf uintptr) int
}
// Compute a hash on zBasis.
-func fuzzerHash(tls *crt.TLS, z uintptr) uint32 { /* fuzzer.c:647:21: */
+func fuzzerHash(tls *libc.TLS, z uintptr) uint32 { /* fuzzer.c:647:21: */
var h uint32 = uint32(0)
for *(*int8)(unsafe.Pointer(z)) != 0 {
- h = (((h << 3) ^ (h >> 29)) ^ uint32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1)))))
+ h = (((h << 3) ^ (h >> 29)) ^ uint32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))
}
return (h % uint32(4001))
}
// Current cost of a stem
-func fuzzerCost(tls *crt.TLS, pStem uintptr) fuzzer_cost { /* fuzzer.c:656:20: */
- return crt.AssignPtrInt32(pStem+36 /* &.rCostX */, ((*fuzzer_stem)(unsafe.Pointer(pStem)).FrBaseCost + (*fuzzer_rule)(unsafe.Pointer((*fuzzer_stem)(unsafe.Pointer(pStem)).FpRule)).FrCost))
+func fuzzerCost(tls *libc.TLS, pStem uintptr) fuzzer_cost { /* fuzzer.c:656:20: */
+ return libc.AssignPtrInt32(pStem+36 /* &.rCostX */, ((*fuzzer_stem)(unsafe.Pointer(pStem)).FrBaseCost + (*fuzzer_rule)(unsafe.Pointer((*fuzzer_stem)(unsafe.Pointer(pStem)).FpRule)).FrCost))
}
// Return 1 if the string to which the cursor is point has already
// been emitted. Return 0 if not. Return -1 on a memory allocation
// failures.
-func fuzzerSeen(tls *crt.TLS, pCur uintptr, pStem uintptr) int32 { /* fuzzer.c:694:12: */
+func fuzzerSeen(tls *libc.TLS, pCur uintptr, pStem uintptr) int32 { /* fuzzer.c:694:12: */
var h uint32
var pLookup uintptr
@@ -17922,10 +21455,10 @@ func fuzzerSeen(tls *crt.TLS, pCur uintptr, pStem uintptr) int32 { /* fuzzer.c:6
}
h = fuzzerHash(tls, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FzBuf)
pLookup = *(*uintptr)(unsafe.Pointer((pCur + 272 /* &.apHash */) + uintptr(h)*8))
- for (pLookup != 0) && (crt.Xstrcmp(tls, (*fuzzer_stem)(unsafe.Pointer(pLookup)).FzBasis, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FzBuf) != 0) {
+ for (pLookup != 0) && (libc.Xstrcmp(tls, (*fuzzer_stem)(unsafe.Pointer(pLookup)).FzBasis, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FzBuf) != 0) {
pLookup = (*fuzzer_stem)(unsafe.Pointer(pLookup)).FpHash
}
- return (crt.Bool32(pLookup != uintptr(0)))
+ return (libc.Bool32(pLookup != uintptr(0)))
}
// If argument pRule is NULL, this function returns false.
@@ -17934,22 +21467,22 @@ func fuzzerSeen(tls *crt.TLS, pCur uintptr, pStem uintptr) int32 { /* fuzzer.c:6
// should be skipped if it does not belong to rule-set iRuleset, or if
// applying it to stem pStem would create a string longer than
// FUZZER_MX_OUTPUT_LENGTH bytes.
-func fuzzerSkipRule(tls *crt.TLS, pRule uintptr, pStem uintptr, iRuleset int32) int32 { /* fuzzer.c:717:12: */
- return (crt.Bool32((pRule != 0) && (((*fuzzer_rule)(unsafe.Pointer(pRule)).FiRuleset != iRuleset) ||
+func fuzzerSkipRule(tls *libc.TLS, pRule uintptr, pStem uintptr, iRuleset int32) int32 { /* fuzzer.c:717:12: */
+ return (libc.Bool32((pRule != 0) && (((*fuzzer_rule)(unsafe.Pointer(pRule)).FiRuleset != iRuleset) ||
(((int32((*fuzzer_stem)(unsafe.Pointer(pStem)).FnBasis) + int32((*fuzzer_rule)(unsafe.Pointer(pRule)).FnTo)) - int32((*fuzzer_rule)(unsafe.Pointer(pRule)).FnFrom)) > 100))))
}
// Advance a fuzzer_stem to its next value. Return 0 if there are
// no more values that can be generated by this fuzzer_stem. Return
// -1 on a memory allocation failure.
-func fuzzerAdvance(tls *crt.TLS, pCur uintptr, pStem uintptr) int32 { /* fuzzer.c:733:12: */
+func fuzzerAdvance(tls *libc.TLS, pCur uintptr, pStem uintptr) int32 { /* fuzzer.c:733:12: */
var pRule uintptr
- for (crt.AssignUintptr(&pRule, (*fuzzer_stem)(unsafe.Pointer(pStem)).FpRule)) != uintptr(0) {
+ for (libc.AssignUintptr(&pRule, (*fuzzer_stem)(unsafe.Pointer(pStem)).FpRule)) != uintptr(0) {
for int32((*fuzzer_stem)(unsafe.Pointer(pStem)).Fn) < (int32((*fuzzer_stem)(unsafe.Pointer(pStem)).FnBasis) - int32((*fuzzer_rule)(unsafe.Pointer(pRule)).FnFrom)) {
(*fuzzer_stem)(unsafe.Pointer(pStem)).Fn++
if (int32((*fuzzer_rule)(unsafe.Pointer(pRule)).FnFrom) == 0) ||
- (crt.Xmemcmp(tls, ((*fuzzer_stem)(unsafe.Pointer(pStem)).FzBasis+uintptr((*fuzzer_stem)(unsafe.Pointer(pStem)).Fn)), (*fuzzer_rule)(unsafe.Pointer(pRule)).FzFrom, uint64((*fuzzer_rule)(unsafe.Pointer(pRule)).FnFrom)) == 0) {
+ (libc.Xmemcmp(tls, ((*fuzzer_stem)(unsafe.Pointer(pStem)).FzBasis+uintptr((*fuzzer_stem)(unsafe.Pointer(pStem)).Fn)), (*fuzzer_rule)(unsafe.Pointer(pRule)).FzFrom, uint64((*fuzzer_rule)(unsafe.Pointer(pRule)).FnFrom)) == 0) {
// Found a rewrite case. Make sure it is not a duplicate
var rc int32 = fuzzerSeen(tls, pCur, pStem)
if rc < 0 {
@@ -17976,7 +21509,7 @@ func fuzzerAdvance(tls *crt.TLS, pCur uintptr, pStem uintptr) int32 { /* fuzzer.
// The two input stem lists are both sorted in order of increasing
// rCostX. Merge them together into a single list, sorted by rCostX, and
// return a pointer to the head of that new list.
-func fuzzerMergeStems(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* fuzzer.c:766:20: */
+func fuzzerMergeStems(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* fuzzer.c:766:20: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -18006,7 +21539,7 @@ func fuzzerMergeStems(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* fuzzer.
// Load pCur->pStem with the lowest-cost stem. Return a pointer
// to the lowest-cost stem.
-func fuzzerLowestCostStem(tls *crt.TLS, pCur uintptr) uintptr { /* fuzzer.c:794:20: */
+func fuzzerLowestCostStem(tls *libc.TLS, pCur uintptr) uintptr { /* fuzzer.c:794:20: */
var pBest uintptr
var pX uintptr
var iBest int32
@@ -18038,13 +21571,13 @@ func fuzzerLowestCostStem(tls *crt.TLS, pCur uintptr) uintptr { /* fuzzer.c:794:
// with the lowest rCostX and move it into pCur->pStem.
// list. The insert is done such the pNew is in the correct order
// according to fuzzer_stem.zBaseCost+fuzzer_stem.pRule->rCost.
-func fuzzerInsert(tls *crt.TLS, pCur uintptr, pNew uintptr) uintptr { /* fuzzer.c:825:20: */
+func fuzzerInsert(tls *libc.TLS, pCur uintptr, pNew uintptr) uintptr { /* fuzzer.c:825:20: */
var pX uintptr
var i int32
// If pCur->pStem exists and is greater than pNew, then make pNew
// the new pCur->pStem and insert the old pCur->pStem instead.
- if ((crt.AssignUintptr(&pX, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FpStem)) != uintptr(0)) && ((*fuzzer_stem)(unsafe.Pointer(pX)).FrCostX > (*fuzzer_stem)(unsafe.Pointer(pNew)).FrCostX) {
+ if ((libc.AssignUintptr(&pX, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FpStem)) != uintptr(0)) && ((*fuzzer_stem)(unsafe.Pointer(pX)).FrCostX > (*fuzzer_stem)(unsafe.Pointer(pNew)).FrCostX) {
(*fuzzer_stem)(unsafe.Pointer(pNew)).FpNext = uintptr(0)
(*fuzzer_cursor)(unsafe.Pointer(pCur)).FpStem = pNew
pNew = pX
@@ -18078,26 +21611,26 @@ func fuzzerInsert(tls *crt.TLS, pCur uintptr, pNew uintptr) uintptr { /* fuzzer.
// Allocate a new fuzzer_stem. Add it to the hash table but do not
// link it into either the pCur->pStem or pCur->pDone lists.
-func fuzzerNewStem(tls *crt.TLS, pCur uintptr, zWord uintptr, rBaseCost fuzzer_cost) uintptr { /* fuzzer.c:868:20: */
+func fuzzerNewStem(tls *libc.TLS, pCur uintptr, zWord uintptr, rBaseCost fuzzer_cost) uintptr { /* fuzzer.c:868:20: */
var pNew uintptr
var pRule uintptr
var h uint32
- pNew = sqlite3.Xsqlite3_malloc64(tls, (uint64((uint64(unsafe.Sizeof(fuzzer_stem{})) + crt.Xstrlen(tls, zWord)) + uint64(1))))
+ pNew = sqlite3.Xsqlite3_malloc64(tls, (uint64((uint64(unsafe.Sizeof(fuzzer_stem{})) + libc.Xstrlen(tls, zWord)) + uint64(1))))
if pNew == uintptr(0) {
return uintptr(0)
}
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(fuzzer_stem{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(fuzzer_stem{})))
(*fuzzer_stem)(unsafe.Pointer(pNew)).FzBasis = (pNew + uintptr(1)*48)
- (*fuzzer_stem)(unsafe.Pointer(pNew)).FnBasis = fuzzer_len(crt.Xstrlen(tls, zWord))
- crt.Xmemcpy(tls, (*fuzzer_stem)(unsafe.Pointer(pNew)).FzBasis, zWord, (uint64(int32((*fuzzer_stem)(unsafe.Pointer(pNew)).FnBasis) + 1)))
+ (*fuzzer_stem)(unsafe.Pointer(pNew)).FnBasis = fuzzer_len(libc.Xstrlen(tls, zWord))
+ libc.Xmemcpy(tls, (*fuzzer_stem)(unsafe.Pointer(pNew)).FzBasis, zWord, (uint64(int32((*fuzzer_stem)(unsafe.Pointer(pNew)).FnBasis) + 1)))
pRule = (*fuzzer_vtab)(unsafe.Pointer((*fuzzer_cursor)(unsafe.Pointer(pCur)).FpVtab)).FpRule
for fuzzerSkipRule(tls, pRule, pNew, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FiRuleset) != 0 {
pRule = (*fuzzer_rule)(unsafe.Pointer(pRule)).FpNext
}
(*fuzzer_stem)(unsafe.Pointer(pNew)).FpRule = pRule
(*fuzzer_stem)(unsafe.Pointer(pNew)).Fn = int8(-1)
- (*fuzzer_stem)(unsafe.Pointer(pNew)).FrBaseCost = crt.AssignPtrInt32(pNew+36 /* &.rCostX */, rBaseCost)
+ (*fuzzer_stem)(unsafe.Pointer(pNew)).FrBaseCost = libc.AssignPtrInt32(pNew+36 /* &.rCostX */, rBaseCost)
h = fuzzerHash(tls, (*fuzzer_stem)(unsafe.Pointer(pNew)).FzBasis)
(*fuzzer_stem)(unsafe.Pointer(pNew)).FpHash = *(*uintptr)(unsafe.Pointer((pCur + 272 /* &.apHash */) + uintptr(h)*8))
*(*uintptr)(unsafe.Pointer((pCur + 272 /* &.apHash */) + uintptr(h)*8)) = pNew
@@ -18106,7 +21639,7 @@ func fuzzerNewStem(tls *crt.TLS, pCur uintptr, zWord uintptr, rBaseCost fuzzer_c
}
// Advance a cursor to its next row of output
-func fuzzerNext(tls *crt.TLS, cur uintptr) int32 { /* fuzzer.c:901:12: */
+func fuzzerNext(tls *libc.TLS, cur uintptr) int32 { /* fuzzer.c:901:12: */
var pCur uintptr = cur
var rc int32
var pStem uintptr
@@ -18139,14 +21672,14 @@ func fuzzerNext(tls *crt.TLS, cur uintptr) int32 { /* fuzzer.c:901:12: */
// Adjust the priority queue so that the first element of the
// stem list is the next lowest cost word.
- for (crt.AssignUintptr(&pStem, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FpStem)) != uintptr(0) {
+ for (libc.AssignUintptr(&pStem, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FpStem)) != uintptr(0) {
var res int32 = fuzzerAdvance(tls, pCur, pStem)
if res < 0 {
return 7
} else if res > 0 {
(*fuzzer_cursor)(unsafe.Pointer(pCur)).FpStem = uintptr(0)
pStem = fuzzerInsert(tls, pCur, pStem)
- if (crt.AssignInt32(&rc, fuzzerSeen(tls, pCur, pStem))) != 0 {
+ if (libc.AssignInt32(&rc, fuzzerSeen(tls, pCur, pStem))) != 0 {
if rc < 0 {
return 7
}
@@ -18177,7 +21710,7 @@ func fuzzerNext(tls *crt.TLS, cur uintptr) int32 { /* fuzzer.c:901:12: */
// Called to "rewind" a cursor back to the beginning so that
// it starts its output over again. Always called at least once
// prior to any fuzzerColumn, fuzzerRowid, or fuzzerEof call.
-func fuzzerFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* fuzzer.c:969:12: */
+func fuzzerFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* fuzzer.c:969:12: */
var pCur uintptr = pVtabCursor
var zWord uintptr = ts + 488 /* "" */
var pStem uintptr
@@ -18207,8 +21740,8 @@ func fuzzerFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
// If the query term is longer than FUZZER_MX_OUTPUT_LENGTH bytes, this
// query will return zero rows.
- if int32(crt.Xstrlen(tls, zWord)) < 100 {
- (*fuzzer_cursor)(unsafe.Pointer(pCur)).FpStem = crt.AssignUintptr(&pStem, fuzzerNewStem(tls, pCur, zWord, 0))
+ if int32(libc.Xstrlen(tls, zWord)) < 100 {
+ (*fuzzer_cursor)(unsafe.Pointer(pCur)).FpStem = libc.AssignUintptr(&pStem, fuzzerNewStem(tls, pCur, zWord, 0))
if pStem == uintptr(0) {
return 7
}
@@ -18223,14 +21756,14 @@ func fuzzerFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
// Only the word and distance columns have values. All other columns
// return NULL
-func fuzzerColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* fuzzer.c:1020:12: */
+func fuzzerColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* fuzzer.c:1020:12: */
var pCur uintptr = cur
if i == 0 {
// the "word" column
if fuzzerRender(tls, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FpStem, (pCur+216 /* &.zBuf */), (pCur+224 /* &.nBuf */)) == 7 {
return 7
}
- sqlite3.Xsqlite3_result_text(tls, ctx, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FzBuf, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, (*fuzzer_cursor)(unsafe.Pointer(pCur)).FzBuf, -1, libc.UintptrFromInt32(-1))
} else if i == 1 {
// the "distance" column
sqlite3.Xsqlite3_result_int(tls, ctx, (*fuzzer_stem)(unsafe.Pointer((*fuzzer_cursor)(unsafe.Pointer(pCur)).FpStem)).FrCostX)
@@ -18242,7 +21775,7 @@ func fuzzerColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* fu
}
// The rowid.
-func fuzzerRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* fuzzer.c:1041:12: */
+func fuzzerRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* fuzzer.c:1041:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*fuzzer_cursor)(unsafe.Pointer(pCur)).FiRowid
return 0
@@ -18250,9 +21783,9 @@ func fuzzerRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* fuzzer.c:
// When the fuzzer_cursor.rLimit value is 0 or less, that is a signal
// that the cursor has nothing more to output.
-func fuzzerEof(tls *crt.TLS, cur uintptr) int32 { /* fuzzer.c:1051:12: */
+func fuzzerEof(tls *libc.TLS, cur uintptr) int32 { /* fuzzer.c:1051:12: */
var pCur uintptr = cur
- return (crt.Bool32((*fuzzer_cursor)(unsafe.Pointer(pCur)).FrLimit <= 0))
+ return (libc.Bool32((*fuzzer_cursor)(unsafe.Pointer(pCur)).FrLimit <= 0))
}
// Search for terms of these forms:
@@ -18275,7 +21808,7 @@ func fuzzerEof(tls *crt.TLS, cur uintptr) int32 { /* fuzzer.c:1051:12: */
// in filter.argv[0] if bit-1 and bit-2 are both zero, is in
// filter.argv[1] if exactly one of bit-1 and bit-2 are set, and is in
// filter.argv[2] if both bit-1 and bit-2 are set.
-func fuzzerBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* fuzzer.c:1078:12: */
+func fuzzerBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* fuzzer.c:1078:12: */
var iPlan int32 = 0
var iDistTerm int32 = -1
var iRulesetTerm int32 = -1
@@ -18332,7 +21865,7 @@ __2:
__3:
;
if (iPlan & 2) != 0 {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iDistTerm)*8)).FargvIndex = (1 + (crt.Bool32((iPlan & 1) != 0)))
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iDistTerm)*8)).FargvIndex = (1 + (libc.Bool32((iPlan & 1) != 0)))
}
if (iPlan & 4) != 0 {
var idx int32 = 1
@@ -18376,47 +21909,62 @@ uintptr(0), FxRename:// xFindMethod
uintptr(0), // xRename
} /* fuzzer.c:1147:23 */
-func sqlite3_fuzzer_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* fuzzer.c:1176:5: */
+func sqlite3_fuzzer_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* fuzzer.c:1176:5: */
var rc int32 = 0
_ = pApi
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+3957 /* "fuzzer" */, uintptr(unsafe.Pointer(&fuzzerModule)), uintptr(0))
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+5174 /* "fuzzer" */, uintptr(unsafe.Pointer(&fuzzerModule)), uintptr(0))
return rc
}
+// Mark a function parameter as unused, to suppress nuisance compiler
+// warnings.
+
// Implementation of the ieee754() function
-func ieee754func(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* ieee754.c:42:13: */
- bp := tls.Alloc(152)
- defer tls.Free(152)
+func ieee754func(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* ieee754.c:102:13: */
+ bp := tls.Alloc(160)
+ defer tls.Free(160)
if argc == 1 {
var m sqlite3_int64
- // var a sqlite3_int64 at bp+16, 8
+ // var a sqlite3_int64 at bp+32, 8
- // var r float64 at bp+24, 8
+ // var r float64 at bp+16, 8
var e int32
var isNeg int32
- // var zResult [100]int8 at bp+32, 100
+ // var zResult [100]int8 at bp+40, 100
- if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) != 2 {
- return
+ if (sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) == 4) &&
+ (uint64(sqlite3.Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))) == uint64(unsafe.Sizeof(float64(0)))) {
+ var x uintptr = sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ var i uint32
+ *(*sqlite3_uint64)(unsafe.Pointer(bp + 24 /* v */)) = uint64(0)
+ for i = uint32(0); uint64(i) < uint64(unsafe.Sizeof(float64(0))); i++ {
+ *(*sqlite3_uint64)(unsafe.Pointer(bp + 24 /* v */)) = ((*(*sqlite3_uint64)(unsafe.Pointer(bp + 24 /* v */)) << 8) | sqlite3_uint64(*(*uint8)(unsafe.Pointer(x + uintptr(i)))))
+ }
+ libc.Xmemcpy(tls, bp+16 /* &r */, bp+24 /* &v */, uint64(unsafe.Sizeof(float64(0))))
+ } else {
+ *(*float64)(unsafe.Pointer(bp + 16 /* r */)) = sqlite3.Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
}
- *(*float64)(unsafe.Pointer(bp + 24 /* r */)) = sqlite3.Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- if *(*float64)(unsafe.Pointer(bp + 24 /* r */)) < 0.0 {
+ if *(*float64)(unsafe.Pointer(bp + 16 /* r */)) < 0.0 {
isNeg = 1
- *(*float64)(unsafe.Pointer(bp + 24 /* r */)) = -*(*float64)(unsafe.Pointer(bp + 24 /* r */))
+ *(*float64)(unsafe.Pointer(bp + 16 /* r */)) = -*(*float64)(unsafe.Pointer(bp + 16 /* r */))
} else {
isNeg = 0
}
- crt.Xmemcpy(tls, bp+16 /* &a */, bp+24 /* &r */, uint64(unsafe.Sizeof(sqlite3_int64(0))))
- if *(*sqlite3_int64)(unsafe.Pointer(bp + 16 /* a */)) == int64(0) {
+ libc.Xmemcpy(tls, bp+32 /* &a */, bp+16 /* &r */, uint64(unsafe.Sizeof(sqlite3_int64(0))))
+ if *(*sqlite3_int64)(unsafe.Pointer(bp + 32 /* a */)) == int64(0) {
e = 0
m = int64(0)
} else {
- e = (int32(*(*sqlite3_int64)(unsafe.Pointer(bp + 16 /* a */)) >> 52))
- m = (*(*sqlite3_int64)(unsafe.Pointer(bp + 16 /* a */)) & ((sqlite3_int64((int64(1))) << 52) - int64(1)))
- m = m | (sqlite3_int64((int64(1))) << 52)
+ e = (int32(*(*sqlite3_int64)(unsafe.Pointer(bp + 32 /* a */)) >> 52))
+ m = (*(*sqlite3_int64)(unsafe.Pointer(bp + 32 /* a */)) & ((sqlite3_int64((int64(1))) << 52) - int64(1)))
+ if e == 0 {
+ m <<= 1
+ } else {
+ m = m | (sqlite3_int64((int64(1))) << 52)
+ }
for ((e < 1075) && (m > int64(0))) && ((m & int64(1)) == int64(0)) {
m >>= 1
e++
@@ -18425,15 +21973,27 @@ func ieee754func(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* i
m = -m
}
}
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+32 /* &zResult[0] */, ts+3964, /* "ieee754(%lld,%d)" */
- crt.VaList(bp, m, (e-1075)))
- sqlite3.Xsqlite3_result_text(tls, context, bp+32 /* &zResult[0] */, -1, crt.UintptrFromInt32(-1))
- } else if argc == 2 {
+ switch *(*int32)(unsafe.Pointer(sqlite3.Xsqlite3_user_data(tls, context))) {
+ case 0:
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+40 /* &zResult[0] */, ts+5181, /* "ieee754(%lld,%d)" */
+ libc.VaList(bp, m, (e-1075)))
+ sqlite3.Xsqlite3_result_text(tls, context, bp+40 /* &zResult[0] */, -1, libc.UintptrFromInt32(-1))
+ break
+ fallthrough
+ case 1:
+ sqlite3.Xsqlite3_result_int64(tls, context, m)
+ break
+ fallthrough
+ case 2:
+ sqlite3.Xsqlite3_result_int(tls, context, (e - 1075))
+ break
+ }
+ } else {
var m sqlite3_int64
var e sqlite3_int64
- // var a sqlite3_int64 at bp+144, 8
+ // var a sqlite3_int64 at bp+152, 8
- // var r float64 at bp+136, 8
+ // var r float64 at bp+144, 8
var isNeg int32 = 0
m = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
@@ -18444,7 +22004,7 @@ func ieee754func(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* i
if m < int64(0) {
return
}
- } else if ((m == int64(0)) && (e > int64(1000))) && (e < int64(1000)) {
+ } else if ((m == int64(0)) && (e > int64(-1000))) && (e < int64(1000)) {
sqlite3.Xsqlite3_result_double(tls, context, 0.0)
return
}
@@ -18457,42 +22017,99 @@ func ieee754func(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* i
e--
}
e = e + (int64(1075))
- if e < int64(0) {
- e = crt.AssignInt64(&m, int64(0))
- }
- if e > int64(0x7ff) {
+ if e <= int64(0) {
+ // Subnormal
+ m >>= (int64(1) - e)
+ e = int64(0)
+ } else if e > int64(0x7ff) {
e = int64(0x7ff)
}
- *(*sqlite3_int64)(unsafe.Pointer(bp + 144 /* a */)) = (m & ((sqlite3_int64((int64(1))) << 52) - int64(1)))
- *(*sqlite3_int64)(unsafe.Pointer(bp + 144 /* a */)) |= (e << 52)
+ *(*sqlite3_int64)(unsafe.Pointer(bp + 152 /* a */)) = (m & ((sqlite3_int64((int64(1))) << 52) - int64(1)))
+ *(*sqlite3_int64)(unsafe.Pointer(bp + 152 /* a */)) |= (e << 52)
if isNeg != 0 {
- *(*sqlite3_int64)(unsafe.Pointer(bp + 144 /* a */)) |= crt.Int64FromUint64((sqlite3_uint64((uint64(1))) << 63))
+ *(*sqlite3_int64)(unsafe.Pointer(bp + 152 /* a */)) |= libc.Int64FromUint64((sqlite3_uint64((uint64(1))) << 63))
}
- crt.Xmemcpy(tls, bp+136 /* &r */, bp+144 /* &a */, uint64(unsafe.Sizeof(float64(0))))
- sqlite3.Xsqlite3_result_double(tls, context, *(*float64)(unsafe.Pointer(bp + 136 /* r */)))
+ libc.Xmemcpy(tls, bp+144 /* &r */, bp+152 /* &a */, uint64(unsafe.Sizeof(float64(0))))
+ sqlite3.Xsqlite3_result_double(tls, context, *(*float64)(unsafe.Pointer(bp + 144 /* r */)))
}
}
-func sqlite3_ieee_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* ieee754.c:116:5: */
+// Functions to convert between blobs and floats.
+func ieee754func_from_blob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* ieee754.c:205:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ _ = argc
+ if (sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) == 4) &&
+ (uint64(sqlite3.Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))) == uint64(unsafe.Sizeof(float64(0)))) {
+ // var r float64 at bp, 8
+
+ var x uintptr = sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ var i uint32
+ *(*sqlite3_uint64)(unsafe.Pointer(bp + 8 /* v */)) = uint64(0)
+ for i = uint32(0); uint64(i) < uint64(unsafe.Sizeof(float64(0))); i++ {
+ *(*sqlite3_uint64)(unsafe.Pointer(bp + 8 /* v */)) = ((*(*sqlite3_uint64)(unsafe.Pointer(bp + 8 /* v */)) << 8) | sqlite3_uint64(*(*uint8)(unsafe.Pointer(x + uintptr(i)))))
+ }
+ libc.Xmemcpy(tls, bp /* &r */, bp+8 /* &v */, uint64(unsafe.Sizeof(float64(0))))
+ sqlite3.Xsqlite3_result_double(tls, context, *(*float64)(unsafe.Pointer(bp /* r */)))
+ }
+}
+func ieee754func_to_blob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* ieee754.c:225:13: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ _ = argc
+ if (sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) == 2) ||
+ (sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) == 1) {
+ *(*float64)(unsafe.Pointer(bp + 8 /* r */)) = sqlite3.Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ // var v sqlite3_uint64 at bp, 8
+
+ // var a [8]uint8 at bp+16, 8
+
+ var i uint32
+ libc.Xmemcpy(tls, bp /* &v */, bp+8 /* &r */, uint64(unsafe.Sizeof(float64(0))))
+ for i = uint32(1); uint64(i) <= uint64(unsafe.Sizeof(float64(0))); i++ {
+ *(*uint8)(unsafe.Pointer(bp + 16 /* &a[0] */ + uintptr((uint64(unsafe.Sizeof(float64(0))) - uint64(i))))) = (uint8(*(*sqlite3_uint64)(unsafe.Pointer(bp /* v */)) & uint64(0xff)))
+ *(*sqlite3_uint64)(unsafe.Pointer(bp /* v */)) >>= 8
+ }
+ sqlite3.Xsqlite3_result_blob(tls, context, bp+16 /* &a[0] */, int32(unsafe.Sizeof(float64(0))), libc.UintptrFromInt32(-1))
+ }
+}
+
+func sqlite3_ieee_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* ieee754.c:251:5: */
+ var i uint32
var rc int32 = 0
_ = pApi
_ = pzErrMsg // Unused parameter
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+3981 /* "ieee754" */, 1,
- (1 | 0x000200000), uintptr(0),
- *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{ieee754func})), uintptr(0), uintptr(0))
- if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+3981 /* "ieee754" */, 2,
- (1 | 0x000200000), uintptr(0),
- *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{ieee754func})), uintptr(0), uintptr(0))
+ for i = uint32(0); (uint64(i) < (uint64(unsafe.Sizeof(aFunc1)) / uint64(unsafe.Sizeof(struct {
+ FzFName uintptr
+ FnArg int32
+ FiAux int32
+ FxFunc uintptr
+ }{})))) && (rc == 0); i++ {
+ rc = sqlite3.Xsqlite3_create_function(tls, db, aFunc1[i].FzFName, aFunc1[i].FnArg,
+ (1 | 0x000200000),
+ (uintptr(unsafe.Pointer(&aFunc1)) + uintptr(i)*24 + 12 /* &.iAux */),
+ aFunc1[i].FxFunc, uintptr(0), uintptr(0))
}
return rc
}
+var aFunc1 = [6]struct {
+ FzFName uintptr
+ FnArg int32
+ FiAux int32
+ FxFunc uintptr
+}{
+ {FzFName: ts + 5198 /* "ieee754" */, FnArg: 1, FiAux: 0, FxFunc: 0},
+ {FzFName: ts + 5198 /* "ieee754" */, FnArg: 2, FiAux: 0, FxFunc: 0},
+ {FzFName: ts + 5206 /* "ieee754_mantissa" */, FnArg: 1, FiAux: 1, FxFunc: 0},
+ {FzFName: ts + 5223 /* "ieee754_exponent" */, FnArg: 1, FiAux: 2, FxFunc: 0},
+ {FzFName: ts + 5240 /* "ieee754_to_blob" */, FnArg: 1, FiAux: 0, FxFunc: 0},
+ {FzFName: ts + 5256 /* "ieee754_from_blo..." */, FnArg: 1, FiAux: 0, FxFunc: 0},
+} /* ieee754.c:261:5 */
+
//
// END OF REGISTRATION API
//
@@ -18516,7 +22133,7 @@ func sqlite3_ieee_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr)
//
// It is illegal to call this function when the database handle has an
// open transaction. SQLITE_MISUSE is returned in this case.
-func sqlite3_mmap_warm(tls *crt.TLS, db uintptr, zDb uintptr) int32 { /* mmapwarm.c:37:5: */
+func sqlite3_mmap_warm(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* mmapwarm.c:37:5: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -18530,10 +22147,10 @@ func sqlite3_mmap_warm(tls *crt.TLS, db uintptr, zDb uintptr) int32 { /* mmapwar
}
// Open a read-only transaction on the file in question
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+3989, /* "BEGIN; SELECT * ..." */
- crt.VaList(bp, func() uintptr {
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+5274, /* "BEGIN; SELECT * ..." */
+ libc.VaList(bp, func() uintptr {
if zDb != 0 {
- return ts + 4030 /* "'" */
+ return ts + 5315 /* "'" */
}
return ts + 488 /* "" */
}(), func() uintptr {
@@ -18543,7 +22160,7 @@ func sqlite3_mmap_warm(tls *crt.TLS, db uintptr, zDb uintptr) int32 { /* mmapwar
return ts + 488 /* "" */
}(), func() uintptr {
if zDb != 0 {
- return ts + 4032 /* "'." */
+ return ts + 5317 /* "'." */
}
return ts + 488 /* "" */
}()))
@@ -18555,10 +22172,10 @@ func sqlite3_mmap_warm(tls *crt.TLS, db uintptr, zDb uintptr) int32 { /* mmapwar
// Find the SQLite page size of the file
if rc == 0 {
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+4035, /* "PRAGMA %s%q%spag..." */
- crt.VaList(bp+24, func() uintptr {
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+5320, /* "PRAGMA %s%q%spag..." */
+ libc.VaList(bp+24, func() uintptr {
if zDb != 0 {
- return ts + 4030 /* "'" */
+ return ts + 5315 /* "'" */
}
return ts + 488 /* "" */
}(), func() uintptr {
@@ -18568,7 +22185,7 @@ func sqlite3_mmap_warm(tls *crt.TLS, db uintptr, zDb uintptr) int32 { /* mmapwar
return ts + 488 /* "" */
}(), func() uintptr {
if zDb != 0 {
- return ts + 4032 /* "'." */
+ return ts + 5317 /* "'." */
}
return ts + 488 /* "" */
}()))
@@ -18601,7 +22218,7 @@ func sqlite3_mmap_warm(tls *crt.TLS, db uintptr, zDb uintptr) int32 { /* mmapwar
for 1 != 0 {
// var pMap uintptr at bp+80, 8
- rc = (*(*func(*crt.TLS, uintptr, sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer((p + 136 /* &.xFetch */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pFd */)), (sqlite3_int64(pgsz) * iPg), pgsz, bp+80 /* &pMap */)
+ rc = (*(*func(*libc.TLS, uintptr, sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer((p + 136 /* &.xFetch */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pFd */)), (sqlite3_int64(pgsz) * iPg), pgsz, bp+80 /* &pMap */)
if (rc != 0) || (*(*uintptr)(unsafe.Pointer(bp + 80 /* pMap */)) == uintptr(0)) {
break
}
@@ -18609,14 +22226,14 @@ func sqlite3_mmap_warm(tls *crt.TLS, db uintptr, zDb uintptr) int32 { /* mmapwar
nTotal = nTotal + (int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* pMap */)) + uintptr(0)))))
nTotal = nTotal + (int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* pMap */)) + uintptr((pgsz - 1))))))
- rc = (*(*func(*crt.TLS, uintptr, sqlite3_int64, uintptr) int32)(unsafe.Pointer((p + 144 /* &.xUnfetch */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pFd */)), (sqlite3_int64(pgsz) * iPg), *(*uintptr)(unsafe.Pointer(bp + 80 /* pMap */)))
+ rc = (*(*func(*libc.TLS, uintptr, sqlite3_int64, uintptr) int32)(unsafe.Pointer((p + 144 /* &.xUnfetch */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pFd */)), (sqlite3_int64(pgsz) * iPg), *(*uintptr)(unsafe.Pointer(bp + 80 /* pMap */)))
if rc != 0 {
break
}
iPg++
}
sqlite3.Xsqlite3_log(tls, 0,
- ts+4058 /* "sqlite3_mmap_war..." */, crt.VaList(bp+48, func() int64 {
+ ts+5343 /* "sqlite3_mmap_war..." */, libc.VaList(bp+48, func() int64 {
if iPg == int64(1) {
return int64(0)
}
@@ -18625,7 +22242,7 @@ func sqlite3_mmap_warm(tls *crt.TLS, db uintptr, zDb uintptr) int32 { /* mmapwar
sqlite3.Xsqlite3_db_filename(tls, db, zDb)))
}
- rc2 = sqlite3.Xsqlite3_exec(tls, db, ts+4108 /* "END" */, uintptr(0), uintptr(0), uintptr(0))
+ rc2 = sqlite3.Xsqlite3_exec(tls, db, ts+5393 /* "END" */, uintptr(0), uintptr(0), uintptr(0))
if rc == 0 {
rc = rc2
}
@@ -18654,7 +22271,7 @@ type nextCharContext = nextCharContext1 /* nextchar.c:63:32 */
// Append a result character if the character is not already in the
// result.
-func nextCharAppend(tls *crt.TLS, p uintptr, c uint32) { /* nextchar.c:80:13: */
+func nextCharAppend(tls *libc.TLS, p uintptr, c uint32) { /* nextchar.c:80:13: */
var i int32
for i = 0; i < (*nextCharContext)(unsafe.Pointer(p)).FnUsed; i++ {
if *(*uint32)(unsafe.Pointer((*nextCharContext)(unsafe.Pointer(p)).FaResult + uintptr(i)*4)) == c {
@@ -18673,12 +22290,12 @@ func nextCharAppend(tls *crt.TLS, p uintptr, c uint32) { /* nextchar.c:80:13: */
(*nextCharContext)(unsafe.Pointer(p)).FnAlloc = n
}
}
- *(*uint32)(unsafe.Pointer((*nextCharContext)(unsafe.Pointer(p)).FaResult + uintptr(crt.PostIncInt32(&(*nextCharContext)(unsafe.Pointer(p)).FnUsed, 1))*4)) = c
+ *(*uint32)(unsafe.Pointer((*nextCharContext)(unsafe.Pointer(p)).FaResult + uintptr(libc.PostIncInt32(&(*nextCharContext)(unsafe.Pointer(p)).FnUsed, 1))*4)) = c
}
// Write a character into z[] as UTF8. Return the number of bytes needed
// to hold the character
-func writeUtf8(tls *crt.TLS, z uintptr, c uint32) int32 { /* nextchar.c:104:12: */
+func writeUtf8(tls *libc.TLS, z uintptr, c uint32) int32 { /* nextchar.c:104:12: */
if c < uint32(0x00080) {
*(*uint8)(unsafe.Pointer(z + uintptr(0))) = (uint8(c & uint32(0xff)))
return 1
@@ -18703,7 +22320,7 @@ func writeUtf8(tls *crt.TLS, z uintptr, c uint32) int32 { /* nextchar.c:104:12:
// Read a UTF8 character out of z[] and write it into *pOut. Return
// the number of bytes in z[] that were used to construct the character.
-func readUtf8(tls *crt.TLS, z uintptr, pOut uintptr) int32 { /* nextchar.c:131:12: */
+func readUtf8(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* nextchar.c:131:12: */
var c uint32 = uint32(*(*uint8)(unsafe.Pointer(z + uintptr(0))))
if c < uint32(0xc0) {
*(*uint32)(unsafe.Pointer(pOut)) = c
@@ -18712,7 +22329,7 @@ func readUtf8(tls *crt.TLS, z uintptr, pOut uintptr) int32 { /* nextchar.c:131:1
var n int32 = 1
c = uint32(validBits[(c - uint32(0xc0))])
for (int32(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) & 0xc0) == 0x80 {
- c = ((c << 6) + (uint32(0x3f & int32(*(*uint8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&n, 1))))))))
+ c = ((c << 6) + (uint32(0x3f & int32(*(*uint8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&n, 1))))))))
}
if ((c < uint32(0x80)) || ((c & 0xFFFFF800) == uint32(0xD800))) || ((c & 0xFFFFFFFE) == uint32(0xFFFE)) {
c = uint32(0xFFFD)
@@ -18736,7 +22353,7 @@ var validBits = [64]uint8{
// The nextCharContext structure has been set up. Add all "next" characters
// to the result set.
-func findNextChars(tls *crt.TLS, p uintptr) { /* nextchar.c:164:13: */
+func findNextChars(tls *libc.TLS, p uintptr) { /* nextchar.c:164:13: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -18778,7 +22395,7 @@ func findNextChars(tls *crt.TLS, p uintptr) { /* nextchar.c:164:13: */
// Return a string composted of all next possible characters after
// A for elements of T.F. If W is supplied, then it is an SQL expression
// that limits the elements in T.F that are considered.
-func nextCharFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* nextchar.c:201:13: */
+func nextCharFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* nextchar.c:201:13: */
bp := tls.Alloc(136)
defer tls.Free(136)
@@ -18793,7 +22410,7 @@ func nextCharFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
var zSql uintptr
var rc int32
- crt.Xmemset(tls, bp+80 /* &c */, 0, uint64(unsafe.Sizeof(nextCharContext{})))
+ libc.Xmemset(tls, bp+80 /* &c */, 0, uint64(unsafe.Sizeof(nextCharContext{})))
(*nextCharContext)(unsafe.Pointer(bp + 80 /* &c */)).Fdb = sqlite3.Xsqlite3_context_db_handle(tls, context)
(*nextCharContext)(unsafe.Pointer(bp + 80 /* &c */)).FzPrefix = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
(*nextCharContext)(unsafe.Pointer(bp + 80 /* &c */)).FnPrefix = sqlite3.Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
@@ -18801,9 +22418,9 @@ func nextCharFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
return
}
if ((argc >= 4) &&
- ((crt.AssignUintptr(&zWhere, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))) != uintptr(0))) &&
+ ((libc.AssignUintptr(&zWhere, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))) != uintptr(0))) &&
(int32(*(*uint8)(unsafe.Pointer(zWhere + uintptr(0)))) != 0) {
- zWhereClause = sqlite3.Xsqlite3_mprintf(tls, ts+4112 /* "AND (%s)" */, crt.VaList(bp, zWhere))
+ zWhereClause = sqlite3.Xsqlite3_mprintf(tls, ts+5397 /* "AND (%s)" */, libc.VaList(bp, zWhere))
if zWhereClause == uintptr(0) {
sqlite3.Xsqlite3_result_error_nomem(tls, context)
return
@@ -18812,9 +22429,9 @@ func nextCharFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
zWhereClause = ts + 488 /* "" */
}
if ((argc >= 5) &&
- ((crt.AssignUintptr(&zCollName, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8))))) != uintptr(0))) &&
+ ((libc.AssignUintptr(&zCollName, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8))))) != uintptr(0))) &&
(int32(*(*uint8)(unsafe.Pointer(zCollName + uintptr(0)))) != 0) {
- zColl = sqlite3.Xsqlite3_mprintf(tls, ts+4121 /* "collate \"%w\"" */, crt.VaList(bp+8, zCollName))
+ zColl = sqlite3.Xsqlite3_mprintf(tls, ts+5406 /* "collate \"%w\"" */, libc.VaList(bp+8, zCollName))
if zColl == uintptr(0) {
sqlite3.Xsqlite3_result_error_nomem(tls, context)
if *(*int8)(unsafe.Pointer(zWhereClause + uintptr(0))) != 0 {
@@ -18829,8 +22446,8 @@ func nextCharFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
// 1114111 == 0x10ffff
- ts+4134, /* "SELECT %s FROM %..." */
- crt.VaList(bp+16, zField, zTable, zField, zColl, zField, zColl, zWhereClause, zColl))
+ ts+5419, /* "SELECT %s FROM %..." */
+ libc.VaList(bp+16, zField, zTable, zField, zColl, zField, zColl, zWhereClause, zColl))
if *(*int8)(unsafe.Pointer(zWhereClause + uintptr(0))) != 0 {
sqlite3.Xsqlite3_free(tls, zWhereClause)
}
@@ -18863,35 +22480,35 @@ func nextCharFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
n = n + (writeUtf8(tls, (pRes + uintptr(n)), *(*uint32)(unsafe.Pointer((*nextCharContext)(unsafe.Pointer(bp+80 /* &c */)).FaResult + uintptr(i)*4))))
}
*(*uint8)(unsafe.Pointer(pRes + uintptr(n))) = uint8(0)
- sqlite3.Xsqlite3_result_text(tls, context, pRes, n, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ sqlite3.Xsqlite3_result_text(tls, context, pRes, n, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
}
}
sqlite3.Xsqlite3_finalize(tls, (*nextCharContext)(unsafe.Pointer(bp+80 /* &c */)).FpStmt)
sqlite3.Xsqlite3_free(tls, (*nextCharContext)(unsafe.Pointer(bp+80 /* &c */)).FaResult)
}
-func sqlite3_nextchar_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* nextchar.c:292:5: */
+func sqlite3_nextchar_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* nextchar.c:292:5: */
var rc int32 = 0
_ = pApi
_ = pzErrMsg // Unused parameter
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4242 /* "next_char" */, 3,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5527 /* "next_char" */, 3,
(1 | 0x000200000), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{nextCharFunc})), uintptr(0), uintptr(0))
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4242 /* "next_char" */, 4,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5527 /* "next_char" */, 4,
(1 | 0x000200000), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{nextCharFunc})), uintptr(0), uintptr(0))
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4242 /* "next_char" */, 5,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5527 /* "next_char" */, 5,
(1 | 0x000200000), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{nextCharFunc})), uintptr(0), uintptr(0))
}
return rc
@@ -19043,9 +22660,11 @@ var sqlite3CtypeMap = [256]uint8{
// Token values
+// Disable nuisence warnings about case fall-through
+
// Return the length (in bytes) of the token that begins at z[0].
// Store the token type in *tokenType before returning.
-func sqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* normalize.c:293:12: */
+func sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* normalize.c:300:12: */
var i int32
var c int32
switch int32(aiClass[*(*uint8)(unsafe.Pointer(z))]) { // Switch on the character-class of the first byte
@@ -19061,7 +22680,7 @@ func sqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* norm
case 11:
{
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))) == '-' {
- for i = 2; ((crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0) && (c != '\n'); i++ {
+ for i = 2; ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0) && (c != '\n'); i++ {
}
*(*int32)(unsafe.Pointer(tokenType)) = 0
return i
@@ -19102,7 +22721,7 @@ func sqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* norm
}
i = 3
c = int32(*(*uint8)(unsafe.Pointer(z + uintptr(2))))
- for ; ((c != '*') || (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '/')) && ((crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0); i++ {
+ for ; ((c != '*') || (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '/')) && ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0); i++ {
}
if c != 0 {
i++
@@ -19118,11 +22737,11 @@ func sqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* norm
case 14:
{
*(*int32)(unsafe.Pointer(tokenType)) = 3
- return (1 + (crt.Bool32(int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))) == '=')))
+ return (1 + (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))) == '=')))
}
case 12:
{
- if (crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))))) == '=' {
+ if (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))))) == '=' {
*(*int32)(unsafe.Pointer(tokenType)) = 3
return 2
} else if c == '>' {
@@ -19139,7 +22758,7 @@ func sqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* norm
fallthrough
case 13:
{
- if (crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))))) == '=' {
+ if (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))))) == '=' {
*(*int32)(unsafe.Pointer(tokenType)) = 3
return 2
} else if c == '>' {
@@ -19192,7 +22811,7 @@ func sqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* norm
{
var delim int32 = int32(*(*uint8)(unsafe.Pointer(z + uintptr(0))))
- for i = 1; (crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0; i++ {
+ for i = 1; (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0; i++ {
if c == delim {
if int32(*(*uint8)(unsafe.Pointer(z + uintptr((i + 1))))) == delim {
i++
@@ -19221,6 +22840,7 @@ func sqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* norm
}
// If the next character is a digit, this is a floating point
// number that begins with ".". Fall thru into the next case
+ /* no break */
}
fallthrough
case 3:
@@ -19258,7 +22878,7 @@ func sqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* norm
{
i = 1
c = int32(*(*uint8)(unsafe.Pointer(z + uintptr(0))))
- for ; (c != ']') && ((crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0); i++ {
+ for ; (c != ']') && ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0); i++ {
}
*(*int32)(unsafe.Pointer(tokenType)) = func() int32 {
if c == ']' {
@@ -19282,11 +22902,11 @@ func sqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* norm
var n int32 = 0
*(*int32)(unsafe.Pointer(tokenType)) = 2
- for i = 1; (crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0; i++ {
+ for i = 1; (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0; i++ {
if (int32(sqlite3CtypeMap[uint8(c)]) & 0x46) != 0 {
n++
} else if (c == '(') && (n > 0) {
- for ok := true; ok; ok = ((((crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0) && !((int32(sqlite3CtypeMap[uint8(c)]) & 0x01) != 0)) && (c != ')')) {
+ for ok := true; ok; ok = ((((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0) && !((int32(sqlite3CtypeMap[uint8(c)]) & 0x01) != 0)) && (c != ')')) {
i++
}
if c == ')' {
@@ -19340,6 +22960,7 @@ func sqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* norm
}
// If it is not a BLOB literal, then it must be an ID, since no
// SQL keywords start with the letter 'x'. Fall through
+ /* no break */
}
fallthrough
case 2:
@@ -19360,7 +22981,7 @@ func sqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* norm
return i
}
-func sqlite3_normalize(tls *crt.TLS, zSql uintptr) uintptr { /* normalize.c:546:6: */
+func sqlite3_normalize(tls *libc.TLS, zSql uintptr) uintptr { /* normalize.c:555:6: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -19374,13 +22995,13 @@ func sqlite3_normalize(tls *crt.TLS, zSql uintptr) uintptr { /* normalize.c:546:
var n int32 // Size of the next token
var k int32 // Loop counter
- nSql = sqlite3_int64(crt.Xstrlen(tls, zSql))
+ nSql = sqlite3_int64(libc.Xstrlen(tls, zSql))
nZ = nSql
z = sqlite3.Xsqlite3_malloc64(tls, (uint64(nZ + int64(2))))
if z == uintptr(0) {
return uintptr(0)
}
- for i = crt.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0; i = i + (n) {
+ for i = libc.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0; i = i + (n) {
n = sqlite3GetToken(tls, (zSql + uintptr(i)), bp /* &tokenType */)
switch *(*int32)(unsafe.Pointer(bp /* tokenType */)) {
case 0:
@@ -19394,27 +23015,27 @@ func sqlite3_normalize(tls *crt.TLS, zSql uintptr) uintptr { /* normalize.c:546:
}
case 2:
{
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = int8('?')
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = int8('?')
break
}
case 3:
fallthrough
case 1:
{
- if (n == 4) && (sqlite3.Xsqlite3_strnicmp(tls, (zSql+uintptr(i)), ts+4252 /* "NULL" */, 4) == 0) {
- if (((j >= 3) && (crt.Xstrncmp(tls, ((z+uintptr(j))-uintptr(2)), ts+4257 /* "is" */, uint64(2)) == 0)) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((j - 3)))))]) & 0x46) != 0)) ||
- (((j >= 4) && (crt.Xstrncmp(tls, ((z+uintptr(j))-uintptr(3)), ts+4260 /* "not" */, uint64(3)) == 0)) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((j - 4)))))]) & 0x46) != 0)) {
+ if (n == 4) && (sqlite3.Xsqlite3_strnicmp(tls, (zSql+uintptr(i)), ts+5537 /* "NULL" */, 4) == 0) {
+ if (((j >= 3) && (libc.Xstrncmp(tls, ((z+uintptr(j))-uintptr(2)), ts+5542 /* "is" */, uint64(2)) == 0)) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((j - 3)))))]) & 0x46) != 0)) ||
+ (((j >= 4) && (libc.Xstrncmp(tls, ((z+uintptr(j))-uintptr(3)), ts+5545 /* "not" */, uint64(3)) == 0)) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((j - 4)))))]) & 0x46) != 0)) {
} else {
// Here the NULL is a literal value
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = int8('?')
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = int8('?')
break
}
}
if ((j > 0) && ((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((j - 1)))))]) & 0x46) != 0)) && ((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zSql + uintptr(i))))]) & 0x46) != 0) {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = int8(' ')
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = int8(' ')
}
for k = 0; k < n; k++ {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = int8(sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(zSql + uintptr((i + k)))))])
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = int8(sqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(zSql + uintptr((i + k)))))])
}
break
}
@@ -19424,26 +23045,26 @@ func sqlite3_normalize(tls *crt.TLS, zSql uintptr) uintptr { /* normalize.c:546:
j--
}
if (j > 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr((j - 1))))) != ';') {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = int8(';')
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = int8(';')
}
*(*int8)(unsafe.Pointer(z + uintptr(j))) = int8(0)
// Make a second pass converting "in(...)" where the "..." is not a
// SELECT statement into "in(?,?,?)"
for i = 0; i < j; i = n {
- var zIn uintptr = crt.Xstrstr(tls, (z + uintptr(i)), ts+4264 /* "in(" */)
+ var zIn uintptr = libc.Xstrstr(tls, (z + uintptr(i)), ts+5549 /* "in(" */)
var nParen int32
if zIn == uintptr(0) {
break
}
n = ((int32((int64(zIn) - int64(z)) / 1)) + 3) // Index of first char past "in("
- if (n != 0) && ((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + crt.UintptrFromInt32(-1))))]) & 0x46) != 0) {
+ if (n != 0) && ((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + libc.UintptrFromInt32(-1))))]) & 0x46) != 0) {
continue
}
- if (crt.Xstrncmp(tls, zIn, ts+4268 /* "in(select" */, uint64(9)) == 0) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(9))))]) & 0x46) != 0) {
+ if (libc.Xstrncmp(tls, zIn, ts+5553 /* "in(select" */, uint64(9)) == 0) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(9))))]) & 0x46) != 0) {
continue
}
- if (crt.Xstrncmp(tls, zIn, ts+4278 /* "in(with" */, uint64(7)) == 0) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(7))))]) & 0x46) != 0) {
+ if (libc.Xstrncmp(tls, zIn, ts+5563 /* "in(with" */, uint64(7)) == 0) && !((int32(sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(7))))]) & 0x46) != 0) {
continue
}
nParen = 1
@@ -19465,13 +23086,13 @@ func sqlite3_normalize(tls *crt.TLS, zSql uintptr) uintptr { /* normalize.c:546:
if z == uintptr(0) {
return uintptr(0)
}
- crt.Xmemmove(tls, ((z + uintptr(n)) + uintptr(5)), ((z + uintptr(n)) + uintptr(k)), (uint64(j - (n + k))))
+ libc.Xmemmove(tls, ((z + uintptr(n)) + uintptr(5)), ((z + uintptr(n)) + uintptr(k)), (uint64(j - (n + k))))
} else if k > 5 {
- crt.Xmemmove(tls, ((z + uintptr(n)) + uintptr(5)), ((z + uintptr(n)) + uintptr(k)), (uint64(j - (n + k))))
+ libc.Xmemmove(tls, ((z + uintptr(n)) + uintptr(5)), ((z + uintptr(n)) + uintptr(k)), (uint64(j - (n + k))))
}
j = ((j - k) + 5)
*(*int8)(unsafe.Pointer(z + uintptr(j))) = int8(0)
- crt.Xmemcpy(tls, (z + uintptr(n)), ts+4286 /* "?,?,?" */, uint64(5))
+ libc.Xmemcpy(tls, (z + uintptr(n)), ts+5571 /* "?,?,?" */, uint64(5))
}
return z
}
@@ -19538,26 +23159,26 @@ type Percentile1 = struct {
type Percentile = Percentile1 /* percentile.c:71:27 */
// Return TRUE if the input floating-point number is an infinity.
-func isInfinity(tls *crt.TLS, r float64) int32 { /* percentile.c:82:12: */
+func isInfinity(tls *libc.TLS, r float64) int32 { /* percentile.c:82:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
*(*float64)(unsafe.Pointer(bp + 8)) = r
// var u sqlite3_uint64 at bp, 8
- crt.Xmemcpy(tls, bp /* &u */, bp+8 /* &r */, uint64(unsafe.Sizeof(sqlite3_uint64(0))))
- return (crt.Bool32(((*(*sqlite3_uint64)(unsafe.Pointer(bp /* u */)) >> 52) & uint64(0x7ff)) == uint64(0x7ff)))
+ libc.Xmemcpy(tls, bp /* &u */, bp+8 /* &r */, uint64(unsafe.Sizeof(sqlite3_uint64(0))))
+ return (libc.Bool32(((*(*sqlite3_uint64)(unsafe.Pointer(bp /* u */)) >> 52) & uint64(0x7ff)) == uint64(0x7ff)))
}
// Return TRUE if two doubles differ by 0.001 or less
-func sameValue(tls *crt.TLS, a float64, b float64) int32 { /* percentile.c:92:12: */
+func sameValue(tls *libc.TLS, a float64, b float64) int32 { /* percentile.c:92:12: */
a = a - (b)
- return (crt.Bool32((a >= -0.001) && (a <= 0.001)))
+ return (libc.Bool32((a >= -0.001) && (a <= 0.001)))
}
// The "step" function for percentile(Y,P) is called once for each
// input row.
-func percentStep(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr) { /* percentile.c:101:13: */
+func percentStep(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* percentile.c:101:13: */
var p uintptr
var rPct float64
var eType int32
@@ -19569,7 +23190,7 @@ func percentStep(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr) { /* perc
if (((eType != 1) && (eType != 2)) ||
(rPct < 0.0)) || (rPct > 100.0) {
sqlite3.Xsqlite3_result_error(tls, pCtx,
- ts+4292 /* "2nd argument to ..." */, -1)
+ ts+5577 /* "2nd argument to ..." */, -1)
return
}
@@ -19585,7 +23206,7 @@ func percentStep(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr) { /* perc
(*Percentile)(unsafe.Pointer(p)).FrPct = (rPct + 1.0)
} else if !(sameValue(tls, (*Percentile)(unsafe.Pointer(p)).FrPct, (rPct+1.0)) != 0) {
sqlite3.Xsqlite3_result_error(tls, pCtx,
- ts+4359 /* "2nd argument to ..." */, -1)
+ ts+5644 /* "2nd argument to ..." */, -1)
return
}
@@ -19599,14 +23220,14 @@ func percentStep(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr) { /* perc
// Requirement 4
if (eType != 1) && (eType != 2) {
sqlite3.Xsqlite3_result_error(tls, pCtx,
- ts+4423 /* "1st argument to ..." */, -1)
+ ts+5708 /* "1st argument to ..." */, -1)
return
}
// Throw an error if the Y value is infinity or NaN
y = sqlite3.Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
if isInfinity(tls, y) != 0 {
- sqlite3.Xsqlite3_result_error(tls, pCtx, ts+4467 /* "Inf input to per..." */, -1)
+ sqlite3.Xsqlite3_result_error(tls, pCtx, ts+5752 /* "Inf input to per..." */, -1)
return
}
@@ -19616,18 +23237,18 @@ func percentStep(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr) { /* perc
var a uintptr = sqlite3.Xsqlite3_realloc64(tls, (*Percentile)(unsafe.Pointer(p)).Fa, (uint64(uint64(unsafe.Sizeof(float64(0))) * uint64(n))))
if a == uintptr(0) {
sqlite3.Xsqlite3_free(tls, (*Percentile)(unsafe.Pointer(p)).Fa)
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Percentile{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Percentile{})))
sqlite3.Xsqlite3_result_error_nomem(tls, pCtx)
return
}
(*Percentile)(unsafe.Pointer(p)).FnAlloc = n
(*Percentile)(unsafe.Pointer(p)).Fa = a
}
- *(*float64)(unsafe.Pointer((*Percentile)(unsafe.Pointer(p)).Fa + uintptr(crt.PostIncUint32(&(*Percentile)(unsafe.Pointer(p)).FnUsed, 1))*8)) = y
+ *(*float64)(unsafe.Pointer((*Percentile)(unsafe.Pointer(p)).Fa + uintptr(libc.PostIncUint32(&(*Percentile)(unsafe.Pointer(p)).FnUsed, 1))*8)) = y
}
// Compare to doubles for sorting using qsort()
-func doubleCmp(tls *crt.TLS, pA uintptr, pB uintptr) int32 { /* percentile.c:170:25: */
+func doubleCmp(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* percentile.c:170:25: */
var a float64 = *(*float64)(unsafe.Pointer(pA))
var b float64 = *(*float64)(unsafe.Pointer(pB))
if a == b {
@@ -19641,7 +23262,7 @@ func doubleCmp(tls *crt.TLS, pA uintptr, pB uintptr) int32 { /* percentile.c:170
// Called to compute the final output of percentile() and to clean
// up all allocated memory.
-func percentFinal(tls *crt.TLS, pCtx uintptr) { /* percentile.c:182:13: */
+func percentFinal(tls *libc.TLS, pCtx uintptr) { /* percentile.c:182:13: */
var p uintptr
var i1 uint32
var i2 uint32
@@ -19657,8 +23278,8 @@ func percentFinal(tls *crt.TLS, pCtx uintptr) { /* percentile.c:182:13: */
return
}
if (*Percentile)(unsafe.Pointer(p)).FnUsed != 0 {
- crt.Xqsort(tls, (*Percentile)(unsafe.Pointer(p)).Fa, uint64((*Percentile)(unsafe.Pointer(p)).FnUsed), uint64(unsafe.Sizeof(float64(0))), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ libc.Xqsort(tls, (*Percentile)(unsafe.Pointer(p)).Fa, uint64((*Percentile)(unsafe.Pointer(p)).FnUsed), uint64(unsafe.Sizeof(float64(0))), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr) int32
}{doubleCmp})))
ix = ((((*Percentile)(unsafe.Pointer(p)).FrPct - 1.0) * (float64((*Percentile)(unsafe.Pointer(p)).FnUsed - uint32(1)))) * 0.01)
i1 = uint32(ix)
@@ -19673,19 +23294,19 @@ func percentFinal(tls *crt.TLS, pCtx uintptr) { /* percentile.c:182:13: */
sqlite3.Xsqlite3_result_double(tls, pCtx, vx)
}
sqlite3.Xsqlite3_free(tls, (*Percentile)(unsafe.Pointer(p)).Fa)
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Percentile{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Percentile{})))
}
-func sqlite3_percentile_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* percentile.c:208:5: */
+func sqlite3_percentile_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* percentile.c:208:5: */
var rc int32 = 0
_ = pApi
_ = pzErrMsg // Unused parameter
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4493 /* "percentile" */, 2,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+5778 /* "percentile" */, 2,
(1 | 0x000200000), uintptr(0),
uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{percentStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{percentFinal})))
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{percentStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{percentFinal})))
return rc
}
@@ -19818,45 +23439,45 @@ type prefixes_cursor = prefixes_cursor1 /* prefixes.c:43:32 */
//
// (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the
// result set of queries against the virtual table will look like.
-func prefixesConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* prefixes.c:64:12: */
+func prefixesConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* prefixes.c:64:12: */
var pNew uintptr
var rc int32
rc = sqlite3.Xsqlite3_declare_vtab(tls, db,
- ts+4504 /* "CREATE TABLE pre..." */)
+ ts+5789 /* "CREATE TABLE pre..." */)
if rc == 0 {
pNew = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(prefixes_vtab{})))
*(*uintptr)(unsafe.Pointer(ppVtab)) = pNew
if pNew == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(prefixes_vtab{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(prefixes_vtab{})))
sqlite3.Xsqlite3_vtab_config(tls, db, 2, 0)
}
return rc
}
// This method is the destructor for prefixes_vtab objects.
-func prefixesDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* prefixes.c:90:12: */
+func prefixesDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* prefixes.c:90:12: */
var p uintptr = pVtab
sqlite3.Xsqlite3_free(tls, p)
return 0
}
// Constructor for a new prefixes_cursor object.
-func prefixesOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* prefixes.c:99:12: */
+func prefixesOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* prefixes.c:99:12: */
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(prefixes_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(prefixes_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(prefixes_cursor{})))
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
return 0
}
// Destructor for a prefixes_cursor.
-func prefixesClose(tls *crt.TLS, cur uintptr) int32 { /* prefixes.c:111:12: */
+func prefixesClose(tls *libc.TLS, cur uintptr) int32 { /* prefixes.c:111:12: */
var pCur uintptr = cur
sqlite3.Xsqlite3_free(tls, (*prefixes_cursor)(unsafe.Pointer(pCur)).FzStr)
sqlite3.Xsqlite3_free(tls, pCur)
@@ -19864,7 +23485,7 @@ func prefixesClose(tls *crt.TLS, cur uintptr) int32 { /* prefixes.c:111:12: */
}
// Advance a prefixes_cursor to its next row of output.
-func prefixesNext(tls *crt.TLS, cur uintptr) int32 { /* prefixes.c:122:12: */
+func prefixesNext(tls *libc.TLS, cur uintptr) int32 { /* prefixes.c:122:12: */
var pCur uintptr = cur
(*prefixes_cursor)(unsafe.Pointer(pCur)).FiRowid++
return 0
@@ -19872,7 +23493,7 @@ func prefixesNext(tls *crt.TLS, cur uintptr) int32 { /* prefixes.c:122:12: */
// Return values of columns for the row at which the prefixes_cursor
// is currently pointing.
-func prefixesColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* prefixes.c:132:12: */
+func prefixesColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* prefixes.c:132:12: */
var pCur uintptr = cur
switch i {
case 0:
@@ -19888,7 +23509,7 @@ func prefixesColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
// Return the rowid for the current row. In this implementation, the
// rowid is the same as the output value.
-func prefixesRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* prefixes.c:154:12: */
+func prefixesRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* prefixes.c:154:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*prefixes_cursor)(unsafe.Pointer(pCur)).FiRowid
return 0
@@ -19896,26 +23517,26 @@ func prefixesRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* prefixe
// Return TRUE if the cursor has been moved off of the last
// row of output.
-func prefixesEof(tls *crt.TLS, cur uintptr) int32 { /* prefixes.c:164:12: */
+func prefixesEof(tls *libc.TLS, cur uintptr) int32 { /* prefixes.c:164:12: */
var pCur uintptr = cur
- return (crt.Bool32((*prefixes_cursor)(unsafe.Pointer(pCur)).FiRowid > sqlite3_int64((*prefixes_cursor)(unsafe.Pointer(pCur)).FnStr)))
+ return (libc.Bool32((*prefixes_cursor)(unsafe.Pointer(pCur)).FiRowid > sqlite3_int64((*prefixes_cursor)(unsafe.Pointer(pCur)).FnStr)))
}
// This method is called to "rewind" the prefixes_cursor object back
// to the first row of output. This method is always called at least
// once prior to any call to prefixesColumn() or prefixesRowid() or
// prefixesEof().
-func prefixesFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* prefixes.c:175:12: */
+func prefixesFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* prefixes.c:175:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var pCur uintptr = pVtabCursor
sqlite3.Xsqlite3_free(tls, (*prefixes_cursor)(unsafe.Pointer(pCur)).FzStr)
if argc > 0 {
- (*prefixes_cursor)(unsafe.Pointer(pCur)).FzStr = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))))
+ (*prefixes_cursor)(unsafe.Pointer(pCur)).FzStr = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))))
(*prefixes_cursor)(unsafe.Pointer(pCur)).FnStr = func() int32 {
if (*prefixes_cursor)(unsafe.Pointer(pCur)).FzStr != 0 {
- return int32(crt.Xstrlen(tls, (*prefixes_cursor)(unsafe.Pointer(pCur)).FzStr))
+ return int32(libc.Xstrlen(tls, (*prefixes_cursor)(unsafe.Pointer(pCur)).FzStr))
}
return 0
}()
@@ -19931,7 +23552,7 @@ func prefixesFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uint
// that uses the virtual table. This routine needs to create
// a query plan for each invocation and compute an estimated cost for that
// plan.
-func prefixesBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* prefixes.c:199:12: */
+func prefixesBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* prefixes.c:199:12: */
// Search for a usable equality constraint against column 1
// (original_string) and use it if at all possible
var i int32
@@ -20017,7 +23638,7 @@ var prefixesModule = sqlite3_module{FiVersion:
//
// This function assumes the input is well-formed utf-8. If it is not,
// it is possible for this function to return -1.
-func prefixLengthFunc(tls *crt.TLS, ctx uintptr, nVal int32, apVal uintptr) { /* prefixes.c:279:13: */
+func prefixLengthFunc(tls *libc.TLS, ctx uintptr, nVal int32, apVal uintptr) { /* prefixes.c:279:13: */
var nByte int32 // Number of bytes to compare
var nRet int32 = 0 // Return value
var zL uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
@@ -20047,15 +23668,15 @@ func prefixLengthFunc(tls *crt.TLS, ctx uintptr, nVal int32, apVal uintptr) { /*
sqlite3.Xsqlite3_result_int(tls, ctx, nRet)
}
-func sqlite3_prefixes_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* prefixes.c:305:5: */
+func sqlite3_prefixes_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* prefixes.c:305:5: */
var rc int32 = 0
_ = pApi
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+4568 /* "prefixes" */, uintptr(unsafe.Pointer(&prefixesModule)), uintptr(0))
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+5853 /* "prefixes" */, uintptr(unsafe.Pointer(&prefixesModule)), uintptr(0))
if rc == 0 {
rc = sqlite3.Xsqlite3_create_function(tls,
- db, ts+4577 /* "prefix_length" */, 2, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ db, ts+5862 /* "prefix_length" */, 2, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{prefixLengthFunc})), uintptr(0), uintptr(0))
}
return rc
@@ -20130,29 +23751,29 @@ type ReCompiled1 = struct {
type ReCompiled = ReCompiled1 /* regexp.c:122:27 */
// Add a state to the given state set if it is not already there
-func re_add_state(tls *crt.TLS, pSet uintptr, newState int32) { /* regexp.c:136:13: */
+func re_add_state(tls *libc.TLS, pSet uintptr, newState int32) { /* regexp.c:136:13: */
var i uint32
for i = uint32(0); i < (*ReStateSet)(unsafe.Pointer(pSet)).FnState; i++ {
if int32(*(*ReStateNumber)(unsafe.Pointer((*ReStateSet)(unsafe.Pointer(pSet)).FaState + uintptr(i)*2))) == newState {
return
}
}
- *(*ReStateNumber)(unsafe.Pointer((*ReStateSet)(unsafe.Pointer(pSet)).FaState + uintptr(crt.PostIncUint32(&(*ReStateSet)(unsafe.Pointer(pSet)).FnState, 1))*2)) = ReStateNumber(newState)
+ *(*ReStateNumber)(unsafe.Pointer((*ReStateSet)(unsafe.Pointer(pSet)).FaState + uintptr(libc.PostIncUint32(&(*ReStateSet)(unsafe.Pointer(pSet)).FnState, 1))*2)) = ReStateNumber(newState)
}
// Extract the next unicode character from *pzIn and return it. Advance
// *pzIn to the first byte past the end of the character returned. To
// be clear: this routine converts utf8 to unicode. This routine is
// optimized for the common case where the next character is a single byte.
-func re_next_char(tls *crt.TLS, p uintptr) uint32 { /* regexp.c:147:17: */
+func re_next_char(tls *libc.TLS, p uintptr) uint32 { /* regexp.c:147:17: */
var c uint32
if (*ReInput)(unsafe.Pointer(p)).Fi >= (*ReInput)(unsafe.Pointer(p)).Fmx {
return uint32(0)
}
- c = uint32(*(*uint8)(unsafe.Pointer((*ReInput)(unsafe.Pointer(p)).Fz + uintptr(crt.PostIncInt32(&(*ReInput)(unsafe.Pointer(p)).Fi, 1)))))
+ c = uint32(*(*uint8)(unsafe.Pointer((*ReInput)(unsafe.Pointer(p)).Fz + uintptr(libc.PostIncInt32(&(*ReInput)(unsafe.Pointer(p)).Fi, 1)))))
if c >= uint32(0x80) {
if (((c & uint32(0xe0)) == uint32(0xc0)) && ((*ReInput)(unsafe.Pointer(p)).Fi < (*ReInput)(unsafe.Pointer(p)).Fmx)) && ((int32(*(*uint8)(unsafe.Pointer((*ReInput)(unsafe.Pointer(p)).Fz + uintptr((*ReInput)(unsafe.Pointer(p)).Fi)))) & 0xc0) == 0x80) {
- c = (((c & uint32(0x1f)) << 6) | (uint32(int32(*(*uint8)(unsafe.Pointer((*ReInput)(unsafe.Pointer(p)).Fz + uintptr(crt.PostIncInt32(&(*ReInput)(unsafe.Pointer(p)).Fi, 1))))) & 0x3f)))
+ c = (((c & uint32(0x1f)) << 6) | (uint32(int32(*(*uint8)(unsafe.Pointer((*ReInput)(unsafe.Pointer(p)).Fz + uintptr(libc.PostIncInt32(&(*ReInput)(unsafe.Pointer(p)).Fi, 1))))) & 0x3f)))
if c < uint32(0x80) {
c = uint32(0xfffd)
}
@@ -20177,7 +23798,7 @@ func re_next_char(tls *crt.TLS, p uintptr) uint32 { /* regexp.c:147:17: */
}
return c
}
-func re_next_char_nocase(tls *crt.TLS, p uintptr) uint32 { /* regexp.c:172:17: */
+func re_next_char_nocase(tls *libc.TLS, p uintptr) uint32 { /* regexp.c:172:17: */
var c uint32 = re_next_char(tls, p)
if (c >= uint32('A')) && (c <= uint32('Z')) {
c = c + (uint32('a' - 'A'))
@@ -20186,24 +23807,24 @@ func re_next_char_nocase(tls *crt.TLS, p uintptr) uint32 { /* regexp.c:172:17: *
}
// Return true if c is a perl "word" character: [A-Za-z0-9_]
-func re_word_char(tls *crt.TLS, c int32) int32 { /* regexp.c:179:12: */
- return (crt.Bool32(((((c >= '0') && (c <= '9')) || ((c >= 'a') && (c <= 'z'))) ||
+func re_word_char(tls *libc.TLS, c int32) int32 { /* regexp.c:179:12: */
+ return (libc.Bool32(((((c >= '0') && (c <= '9')) || ((c >= 'a') && (c <= 'z'))) ||
((c >= 'A') && (c <= 'Z'))) || (c == '_')))
}
// Return true if c is a "digit" character: [0-9]
-func re_digit_char(tls *crt.TLS, c int32) int32 { /* regexp.c:185:12: */
- return (crt.Bool32((c >= '0') && (c <= '9')))
+func re_digit_char(tls *libc.TLS, c int32) int32 { /* regexp.c:185:12: */
+ return (libc.Bool32((c >= '0') && (c <= '9')))
}
// Return true if c is a perl "space" character: [ \t\r\n\v\f]
-func re_space_char(tls *crt.TLS, c int32) int32 { /* regexp.c:190:12: */
- return (crt.Bool32((((((c == ' ') || (c == '\t')) || (c == '\n')) || (c == '\r')) || (c == '\v')) || (c == '\f')))
+func re_space_char(tls *libc.TLS, c int32) int32 { /* regexp.c:190:12: */
+ return (libc.Bool32((((((c == ' ') || (c == '\t')) || (c == '\n')) || (c == '\r')) || (c == '\v')) || (c == '\f')))
}
// Run a compiled regular expression on the zero-terminated input
// string zIn[]. Return true on a match and false if there is no match.
-func sqlite3re_match(tls *crt.TLS, pRe uintptr, zIn uintptr, nIn int32) int32 { /* regexp.c:197:12: */
+func sqlite3re_match(tls *libc.TLS, pRe uintptr, zIn uintptr, nIn int32) int32 { /* regexp.c:197:12: */
bp := tls.Alloc(248)
defer tls.Free(248)
@@ -20238,7 +23859,7 @@ func sqlite3re_match(tls *crt.TLS, pRe uintptr, zIn uintptr, nIn int32) int32 {
if nIn >= 0 {
return nIn
}
- return int32(crt.Xstrlen(tls, zIn))
+ return int32(libc.Xstrlen(tls, zIn))
}()
// Look for the initial prefix match, if there is one.
@@ -20248,7 +23869,7 @@ func sqlite3re_match(tls *crt.TLS, pRe uintptr, zIn uintptr, nIn int32) int32 {
x = *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(0)))
__2:
if !((((*ReInput)(unsafe.Pointer(bp+232 /* &in */)).Fi + (*ReCompiled)(unsafe.Pointer(pRe)).FnInit) <= (*ReInput)(unsafe.Pointer(bp+232 /* &in */)).Fmx) &&
- ((int32(*(*uint8)(unsafe.Pointer(zIn + uintptr((*ReInput)(unsafe.Pointer(bp+232 /* &in */)).Fi)))) != int32(x)) || (crt.Xstrncmp(tls, (zIn+uintptr((*ReInput)(unsafe.Pointer(bp+232 /* &in */)).Fi)), pRe+48 /* &.zInit */, uint64((*ReCompiled)(unsafe.Pointer(pRe)).FnInit)) != 0))) {
+ ((int32(*(*uint8)(unsafe.Pointer(zIn + uintptr((*ReInput)(unsafe.Pointer(bp+232 /* &in */)).Fi)))) != int32(x)) || (libc.Xstrncmp(tls, (zIn+uintptr((*ReInput)(unsafe.Pointer(bp+232 /* &in */)).Fi)), pRe+48 /* &.zInit */, uint64((*ReCompiled)(unsafe.Pointer(pRe)).FnInit)) != 0))) {
goto __3
}
(*ReInput)(unsafe.Pointer(bp+232 /* &in */)).Fi++
@@ -20290,7 +23911,7 @@ __8:
goto __9
}
cPrev = c
- c = int32((*(*func(*crt.TLS, uintptr) uint32)(unsafe.Pointer((pRe + 40 /* &.xNextChar */))))(tls, bp+232 /* &in */))
+ c = int32((*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer((pRe + 40 /* &.xNextChar */))))(tls, bp+232 /* &in */))
pThis = pNext
pNext = (bp /* &aStateSet */ + uintptr(iSwap)*16)
iSwap = (uint32(1) - iSwap)
@@ -20459,7 +24080,7 @@ __39:
if !(int32(*(*int8)(unsafe.Pointer((*ReCompiled)(unsafe.Pointer(pRe)).FaOp + uintptr(x1)))) == 8) {
goto __45
}
- hit = crt.BoolInt32(!(hit != 0))
+ hit = libc.BoolInt32(!(hit != 0))
__45:
;
if !(hit != 0) {
@@ -20506,7 +24127,7 @@ re_match_end:
}
// Resize the opcode and argument arrays for an RE under construction.
-func re_resize(tls *crt.TLS, p uintptr, N int32) int32 { /* regexp.c:337:12: */
+func re_resize(tls *libc.TLS, p uintptr, N int32) int32 { /* regexp.c:337:12: */
var aOp uintptr
var aArg uintptr
aOp = sqlite3.Xsqlite3_realloc64(tls, (*ReCompiled)(unsafe.Pointer(p)).FaOp, (uint64(uint64(N) * uint64(unsafe.Sizeof(int8(0))))))
@@ -20525,7 +24146,7 @@ func re_resize(tls *crt.TLS, p uintptr, N int32) int32 { /* regexp.c:337:12: */
// Insert a new opcode and argument into an RE under construction. The
// insertion point is just prior to existing opcode iBefore.
-func re_insert(tls *crt.TLS, p uintptr, iBefore int32, op int32, arg int32) int32 { /* regexp.c:353:12: */
+func re_insert(tls *libc.TLS, p uintptr, iBefore int32, op int32, arg int32) int32 { /* regexp.c:353:12: */
var i int32
if ((*ReCompiled)(unsafe.Pointer(p)).FnAlloc <= (*ReCompiled)(unsafe.Pointer(p)).FnState) && (re_resize(tls, p, (int32((*ReCompiled)(unsafe.Pointer(p)).FnAlloc*uint32(2)))) != 0) {
return 0
@@ -20541,25 +24162,25 @@ func re_insert(tls *crt.TLS, p uintptr, iBefore int32, op int32, arg int32) int3
}
// Append a new opcode and argument to the end of the RE under construction.
-func re_append(tls *crt.TLS, p uintptr, op int32, arg int32) int32 { /* regexp.c:368:12: */
+func re_append(tls *libc.TLS, p uintptr, op int32, arg int32) int32 { /* regexp.c:368:12: */
return re_insert(tls, p, int32((*ReCompiled)(unsafe.Pointer(p)).FnState), op, arg)
}
// Make a copy of N opcodes starting at iStart onto the end of the RE
// under construction.
-func re_copy(tls *crt.TLS, p uintptr, iStart int32, N int32) { /* regexp.c:375:13: */
+func re_copy(tls *libc.TLS, p uintptr, iStart int32, N int32) { /* regexp.c:375:13: */
if (((*ReCompiled)(unsafe.Pointer(p)).FnState + uint32(N)) >= (*ReCompiled)(unsafe.Pointer(p)).FnAlloc) && (re_resize(tls, p, (int32(((*ReCompiled)(unsafe.Pointer(p)).FnAlloc*uint32(2))+uint32(N)))) != 0) {
return
}
- crt.Xmemcpy(tls, ((*ReCompiled)(unsafe.Pointer(p)).FaOp + uintptr((*ReCompiled)(unsafe.Pointer(p)).FnState)), ((*ReCompiled)(unsafe.Pointer(p)).FaOp + uintptr(iStart)), (uint64(N) * uint64(unsafe.Sizeof(int8(0)))))
- crt.Xmemcpy(tls, ((*ReCompiled)(unsafe.Pointer(p)).FaArg + uintptr((*ReCompiled)(unsafe.Pointer(p)).FnState)*4), ((*ReCompiled)(unsafe.Pointer(p)).FaArg + uintptr(iStart)*4), (uint64(N) * uint64(unsafe.Sizeof(int32(0)))))
+ libc.Xmemcpy(tls, ((*ReCompiled)(unsafe.Pointer(p)).FaOp + uintptr((*ReCompiled)(unsafe.Pointer(p)).FnState)), ((*ReCompiled)(unsafe.Pointer(p)).FaOp + uintptr(iStart)), (uint64(N) * uint64(unsafe.Sizeof(int8(0)))))
+ libc.Xmemcpy(tls, ((*ReCompiled)(unsafe.Pointer(p)).FaArg + uintptr((*ReCompiled)(unsafe.Pointer(p)).FnState)*4), ((*ReCompiled)(unsafe.Pointer(p)).FaArg + uintptr(iStart)*4), (uint64(N) * uint64(unsafe.Sizeof(int32(0)))))
*(*uint32)(unsafe.Pointer(p + 64 /* &.nState */)) += (uint32(N))
}
// Return true if c is a hexadecimal digit character: [0-9a-fA-F]
// If c is a hex digit, also set *pV = (*pV)*16 + valueof(c). If
// c is not a hex digit *pV is unchanged.
-func re_hex(tls *crt.TLS, c int32, pV uintptr) int32 { /* regexp.c:386:12: */
+func re_hex(tls *libc.TLS, c int32, pV uintptr) int32 { /* regexp.c:386:12: */
if (c >= '0') && (c <= '9') {
c = c - ('0')
} else if (c >= 'a') && (c <= 'f') {
@@ -20575,7 +24196,7 @@ func re_hex(tls *crt.TLS, c int32, pV uintptr) int32 { /* regexp.c:386:12: */
// A backslash character has been seen, read the next character and
// return its interpretation.
-func re_esc_char(tls *crt.TLS, p uintptr) uint32 { /* regexp.c:403:17: */
+func re_esc_char(tls *libc.TLS, p uintptr) uint32 { /* regexp.c:403:17: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -20612,16 +24233,16 @@ func re_esc_char(tls *crt.TLS, p uintptr) uint32 { /* regexp.c:403:17: */
}
(*ReCompiled)(unsafe.Pointer(p)).FsIn.Fi++
} else {
- (*ReCompiled)(unsafe.Pointer(p)).FzErr = ts + 4591 /* "unknown \\ escape" */
+ (*ReCompiled)(unsafe.Pointer(p)).FzErr = ts + 5876 /* "unknown \\ escape" */
}
return uint32(c)
}
-var zEsc = *(*[21]int8)(unsafe.Pointer(ts + 4608 /* "afnrtv\\()*.+?[$^..." */)) /* regexp.c:404:21 */
-var zTrans = *(*[7]int8)(unsafe.Pointer(ts + 4629 /* "\a\f\n\r\t\v" */)) /* regexp.c:405:21 */
+var zEsc = *(*[21]int8)(unsafe.Pointer(ts + 5893 /* "afnrtv\\()*.+?[$^..." */)) /* regexp.c:404:21 */
+var zTrans = *(*[7]int8)(unsafe.Pointer(ts + 5914 /* "\a\f\n\r\t\v" */)) /* regexp.c:405:21 */
// Peek at the next byte of input
-func rePeek(tls *crt.TLS, p uintptr) uint8 { /* regexp.c:444:22: */
+func rePeek(tls *libc.TLS, p uintptr) uint8 { /* regexp.c:444:22: */
if (*ReCompiled)(unsafe.Pointer(p)).FsIn.Fi < (*ReCompiled)(unsafe.Pointer(p)).FsIn.Fmx {
return *(*uint8)(unsafe.Pointer((*ReCompiled)(unsafe.Pointer(p)).FsIn.Fz + uintptr((*ReCompiled)(unsafe.Pointer(p)).FsIn.Fi)))
}
@@ -20631,7 +24252,7 @@ func rePeek(tls *crt.TLS, p uintptr) uint8 { /* regexp.c:444:22: */
// Compile RE text into a sequence of opcodes. Continue up to the
// first unmatched ")" character, then return. If an error is found,
// return a pointer to the error message string.
-func re_subcompile_re(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:452:19: */
+func re_subcompile_re(tls *libc.TLS, p uintptr) uintptr { /* regexp.c:452:19: */
var zErr uintptr
var iStart int32
var iEnd int32
@@ -20658,12 +24279,12 @@ func re_subcompile_re(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:452:19: */
// Compile an element of regular expression text (anything that can be
// an operand to the "|" operator). Return NULL on success or a pointer
// to the error message if there is a problem.
-func re_subcompile_string(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:474:19: */
+func re_subcompile_string(tls *libc.TLS, p uintptr) uintptr { /* regexp.c:474:19: */
var iPrev int32 = -1
var iStart int32
var c uint32
var zErr uintptr
- for (crt.AssignUint32(&c, (*(*func(*crt.TLS, uintptr) uint32)(unsafe.Pointer((p + 40 /* &.xNextChar */))))(tls, (p /* &.sIn */)))) != uint32(0) {
+ for (libc.AssignUint32(&c, (*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer((p + 40 /* &.xNextChar */))))(tls, (p /* &.sIn */)))) != uint32(0) {
iStart = int32((*ReCompiled)(unsafe.Pointer(p)).FnState)
switch c {
case uint32('|'):
@@ -20682,7 +24303,7 @@ func re_subcompile_string(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:474:19:
return zErr
}
if int32(rePeek(tls, p)) != ')' {
- return ts + 4636 /* "unmatched '('" */
+ return ts + 5921 /* "unmatched '('" */
}
(*ReCompiled)(unsafe.Pointer(p)).FsIn.Fi++
break
@@ -20700,7 +24321,7 @@ func re_subcompile_string(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:474:19:
case uint32('*'):
{
if iPrev < 0 {
- return ts + 4650 /* "'*' without oper..." */
+ return ts + 5935 /* "'*' without oper..." */
}
re_insert(tls, p, iPrev, 5, (int32(((*ReCompiled)(unsafe.Pointer(p)).FnState - uint32(iPrev)) + uint32(1))))
re_append(tls, p, 4, (int32((uint32(iPrev) - (*ReCompiled)(unsafe.Pointer(p)).FnState) + uint32(1))))
@@ -20709,7 +24330,7 @@ func re_subcompile_string(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:474:19:
case uint32('+'):
{
if iPrev < 0 {
- return ts + 4670 /* "'+' without oper..." */
+ return ts + 5955 /* "'+' without oper..." */
}
re_append(tls, p, 4, (int32(uint32(iPrev) - (*ReCompiled)(unsafe.Pointer(p)).FnState)))
break
@@ -20717,7 +24338,7 @@ func re_subcompile_string(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:474:19:
case uint32('?'):
{
if iPrev < 0 {
- return ts + 4690 /* "'?' without oper..." */
+ return ts + 5975 /* "'?' without oper..." */
}
re_insert(tls, p, iPrev, 4, (int32(((*ReCompiled)(unsafe.Pointer(p)).FnState - uint32(iPrev)) + uint32(1))))
break
@@ -20729,9 +24350,9 @@ func re_subcompile_string(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:474:19:
var sz int32
var j int32
if iPrev < 0 {
- return ts + 4710 /* "'{m,n}' without ..." */
+ return ts + 5995 /* "'{m,n}' without ..." */
}
- for ((crt.AssignUint32(&c, uint32(rePeek(tls, p)))) >= uint32('0')) && (c <= uint32('9')) {
+ for ((libc.AssignUint32(&c, uint32(rePeek(tls, p)))) >= uint32('0')) && (c <= uint32('9')) {
m = (int32(((uint32(m * 10)) + c) - uint32('0')))
(*ReCompiled)(unsafe.Pointer(p)).FsIn.Fi++
}
@@ -20739,22 +24360,22 @@ func re_subcompile_string(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:474:19:
if c == uint32(',') {
(*ReCompiled)(unsafe.Pointer(p)).FsIn.Fi++
n = 0
- for ((crt.AssignUint32(&c, uint32(rePeek(tls, p)))) >= uint32('0')) && (c <= uint32('9')) {
+ for ((libc.AssignUint32(&c, uint32(rePeek(tls, p)))) >= uint32('0')) && (c <= uint32('9')) {
n = (int32(((uint32(n * 10)) + c) - uint32('0')))
(*ReCompiled)(unsafe.Pointer(p)).FsIn.Fi++
}
}
if c != uint32('}') {
- return ts + 4734 /* "unmatched '{'" */
+ return ts + 6019 /* "unmatched '{'" */
}
if (n > 0) && (n < m) {
- return ts + 4748 /* "n less than m in..." */
+ return ts + 6033 /* "n less than m in..." */
}
(*ReCompiled)(unsafe.Pointer(p)).FsIn.Fi++
sz = (int32((*ReCompiled)(unsafe.Pointer(p)).FnState - uint32(iPrev)))
if m == 0 {
if n == 0 {
- return ts + 4773 /* "both m and n are..." */
+ return ts + 6058 /* "both m and n are..." */
}
re_insert(tls, p, iPrev, 4, (sz + 1))
n--
@@ -20781,9 +24402,9 @@ func re_subcompile_string(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:474:19:
} else {
re_append(tls, p, 7, 0)
}
- for (crt.AssignUint32(&c, (*(*func(*crt.TLS, uintptr) uint32)(unsafe.Pointer((p + 40 /* &.xNextChar */))))(tls, (p /* &.sIn */)))) != uint32(0) {
+ for (libc.AssignUint32(&c, (*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer((p + 40 /* &.xNextChar */))))(tls, (p /* &.sIn */)))) != uint32(0) {
if (c == uint32('[')) && (int32(rePeek(tls, p)) == ':') {
- return ts + 4806 /* "POSIX character ..." */
+ return ts + 6091 /* "POSIX character ..." */
}
if c == uint32('\\') {
c = re_esc_char(tls, p)
@@ -20791,7 +24412,7 @@ func re_subcompile_string(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:474:19:
if int32(rePeek(tls, p)) == '-' {
re_append(tls, p, 10, int32(c))
(*ReCompiled)(unsafe.Pointer(p)).FsIn.Fi++
- c = (*(*func(*crt.TLS, uintptr) uint32)(unsafe.Pointer((p + 40 /* &.xNextChar */))))(tls, (p /* &.sIn */))
+ c = (*(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer((p + 40 /* &.xNextChar */))))(tls, (p /* &.sIn */))
if c == uint32('\\') {
c = re_esc_char(tls, p)
}
@@ -20805,7 +24426,7 @@ func re_subcompile_string(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:474:19:
}
}
if c == uint32(0) {
- return ts + 4844 /* "unclosed '['" */
+ return ts + 6129 /* "unclosed '['" */
}
*(*int32)(unsafe.Pointer((*ReCompiled)(unsafe.Pointer(p)).FaArg + uintptr(iFirst)*4)) = (int32((*ReCompiled)(unsafe.Pointer(p)).FnState - uint32(iFirst)))
break
@@ -20859,7 +24480,7 @@ func re_subcompile_string(tls *crt.TLS, p uintptr) uintptr { /* regexp.c:474:19:
// Free and reclaim all the memory used by a previously compiled
// regular expression. Applications should invoke this routine once
// for every call to re_compile() to avoid memory leaks.
-func sqlite3re_free(tls *crt.TLS, pRe uintptr) { /* regexp.c:613:13: */
+func sqlite3re_free(tls *libc.TLS, pRe uintptr) { /* regexp.c:613:13: */
if pRe != 0 {
sqlite3.Xsqlite3_free(tls, (*ReCompiled)(unsafe.Pointer(pRe)).FaOp)
sqlite3.Xsqlite3_free(tls, (*ReCompiled)(unsafe.Pointer(pRe)).FaArg)
@@ -20871,7 +24492,7 @@ func sqlite3re_free(tls *crt.TLS, pRe uintptr) { /* regexp.c:613:13: */
// expression suitable for us by re_match() and return a pointer to the
// compiled regular expression in *ppRe. Return NULL on success or an
// error message if something goes wrong.
-func sqlite3re_compile(tls *crt.TLS, ppRe uintptr, zIn uintptr, noCase int32) uintptr { /* regexp.c:627:19: */
+func sqlite3re_compile(tls *libc.TLS, ppRe uintptr, zIn uintptr, noCase int32) uintptr { /* regexp.c:627:19: */
var pRe uintptr
var zErr uintptr
var i int32
@@ -20882,15 +24503,15 @@ func sqlite3re_compile(tls *crt.TLS, ppRe uintptr, zIn uintptr, noCase int32) ui
if pRe == uintptr(0) {
return ts + 1929 /* "out of memory" */
}
- crt.Xmemset(tls, pRe, 0, uint64(unsafe.Sizeof(ReCompiled{})))
+ libc.Xmemset(tls, pRe, 0, uint64(unsafe.Sizeof(ReCompiled{})))
(*ReCompiled)(unsafe.Pointer(pRe)).FxNextChar = func() uintptr {
if noCase != 0 {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) uint32
+ f func(*libc.TLS, uintptr) uint32
}{re_next_char_nocase}))
}
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) uint32
+ f func(*libc.TLS, uintptr) uint32
}{re_next_char}))
}()
if re_resize(tls, pRe, 30) != 0 {
@@ -20904,7 +24525,7 @@ func sqlite3re_compile(tls *crt.TLS, ppRe uintptr, zIn uintptr, noCase int32) ui
}
(*ReCompiled)(unsafe.Pointer(pRe)).FsIn.Fz = zIn
(*ReCompiled)(unsafe.Pointer(pRe)).FsIn.Fi = 0
- (*ReCompiled)(unsafe.Pointer(pRe)).FsIn.Fmx = int32(crt.Xstrlen(tls, zIn))
+ (*ReCompiled)(unsafe.Pointer(pRe)).FsIn.Fmx = int32(libc.Xstrlen(tls, zIn))
zErr = re_subcompile_re(tls, pRe)
if zErr != 0 {
sqlite3re_free(tls, pRe)
@@ -20919,7 +24540,7 @@ func sqlite3re_compile(tls *crt.TLS, ppRe uintptr, zIn uintptr, noCase int32) ui
*(*uintptr)(unsafe.Pointer(ppRe)) = pRe
} else {
sqlite3re_free(tls, pRe)
- return ts + 4857 /* "unrecognized cha..." */
+ return ts + 6142 /* "unrecognized cha..." */
}
// The following is a performance optimization. If the regex begins with
@@ -20936,14 +24557,14 @@ func sqlite3re_compile(tls *crt.TLS, ppRe uintptr, zIn uintptr, noCase int32) ui
for ; (uint64(j) < (uint64(unsafe.Sizeof([12]uint8{})) - uint64(2))) && (int32(*(*int8)(unsafe.Pointer((*ReCompiled)(unsafe.Pointer(pRe)).FaOp + uintptr(i)))) == 1); i++ {
var x uint32 = uint32(*(*int32)(unsafe.Pointer((*ReCompiled)(unsafe.Pointer(pRe)).FaArg + uintptr(i)*4)))
if x <= uint32(127) {
- *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(crt.PostIncInt32(&j, 1)))) = uint8(x)
+ *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(libc.PostIncInt32(&j, 1)))) = uint8(x)
} else if x <= uint32(0xfff) {
- *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(crt.PostIncInt32(&j, 1)))) = (uint8(uint32(0xc0) | (x >> 6)))
- *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(crt.PostIncInt32(&j, 1)))) = (uint8(uint32(0x80) | (x & uint32(0x3f))))
+ *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(libc.PostIncInt32(&j, 1)))) = (uint8(uint32(0xc0) | (x >> 6)))
+ *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(libc.PostIncInt32(&j, 1)))) = (uint8(uint32(0x80) | (x & uint32(0x3f))))
} else if x <= uint32(0xffff) {
- *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(crt.PostIncInt32(&j, 1)))) = (uint8(uint32(0xd0) | (x >> 12)))
- *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(crt.PostIncInt32(&j, 1)))) = (uint8(uint32(0x80) | ((x >> 6) & uint32(0x3f))))
- *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(crt.PostIncInt32(&j, 1)))) = (uint8(uint32(0x80) | (x & uint32(0x3f))))
+ *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(libc.PostIncInt32(&j, 1)))) = (uint8(uint32(0xd0) | (x >> 12)))
+ *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(libc.PostIncInt32(&j, 1)))) = (uint8(uint32(0x80) | ((x >> 6) & uint32(0x3f))))
+ *(*uint8)(unsafe.Pointer((pRe + 48 /* &.zInit */) + uintptr(libc.PostIncInt32(&j, 1)))) = (uint8(uint32(0x80) | (x & uint32(0x3f))))
} else {
break
}
@@ -20963,7 +24584,7 @@ func sqlite3re_compile(tls *crt.TLS, ppRe uintptr, zIn uintptr, noCase int32) ui
// A REGEXP B
//
// is implemented as regexp(B,A).
-func re_sql_func(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* regexp.c:707:13: */
+func re_sql_func(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* regexp.c:707:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -20997,19 +24618,19 @@ func re_sql_func(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* r
sqlite3.Xsqlite3_result_int(tls, context, sqlite3re_match(tls, *(*uintptr)(unsafe.Pointer(bp /* pRe */)), zStr, -1))
}
if setAux != 0 {
- sqlite3.Xsqlite3_set_auxdata(tls, context, 0, *(*uintptr)(unsafe.Pointer(bp /* pRe */)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3re_free})))
+ sqlite3.Xsqlite3_set_auxdata(tls, context, 0, *(*uintptr)(unsafe.Pointer(bp /* pRe */)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3re_free})))
}
}
// Invoke this routine to register the regexp() function with the
// SQLite database connection.
-func sqlite3_regexp_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* regexp.c:750:5: */
+func sqlite3_regexp_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* regexp.c:750:5: */
var rc int32 = 0
_ = pApi
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4880 /* "regexp" */, 2, (1 | 0x000200000),
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+6165 /* "regexp" */, 2, (1 | 0x000200000),
uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{re_sql_func})), uintptr(0), uintptr(0))
return rc
}
@@ -21442,25 +25063,25 @@ func sqlite3_regexp_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintpt
//
// Return the integer value V. Also save the value of V in a
// C-language variable whose address is PTR.
-func rememberFunc(tls *crt.TLS, pCtx uintptr, argc int32, argv uintptr) { /* remember.c:45:13: */
+func rememberFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* remember.c:45:13: */
var v sqlite3_int64
var ptr uintptr
v = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- ptr = sqlite3.Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+2713 /* "carray" */)
+ ptr = sqlite3.Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+3862 /* "carray" */)
if ptr != 0 {
*(*sqlite3_int64)(unsafe.Pointer(ptr)) = v
}
sqlite3.Xsqlite3_result_int64(tls, pCtx, v)
}
-func sqlite3_remember_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* remember.c:62:5: */
+func sqlite3_remember_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* remember.c:62:5: */
var rc int32 = 0
_ = pApi
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+4887 /* "remember" */, 2, 1, uintptr(0),
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+6172 /* "remember" */, 2, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{rememberFunc})), uintptr(0), uintptr(0))
return rc
}
@@ -21494,51 +25115,51 @@ type series_cursor = series_cursor1 /* series.c:83:30 */
//
// (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the
// result set of queries against generate_series will look like.
-func seriesConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* series.c:107:12: */
+func seriesConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* series.c:107:12: */
var pNew uintptr
var rc int32
// Column numbers
rc = sqlite3.Xsqlite3_declare_vtab(tls, db,
- ts+4896 /* "CREATE TABLE x(v..." */)
+ ts+6181 /* "CREATE TABLE x(v..." */)
if rc == 0 {
- pNew = crt.AssignPtrUintptr(ppVtab, sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(sqlite3_vtab{}))))
+ pNew = libc.AssignPtrUintptr(ppVtab, sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(sqlite3_vtab{}))))
if pNew == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(sqlite3_vtab{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(sqlite3_vtab{})))
sqlite3.Xsqlite3_vtab_config(tls, db, 2, 0)
}
return rc
}
// This method is the destructor for series_cursor objects.
-func seriesDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* series.c:137:12: */
+func seriesDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* series.c:137:12: */
sqlite3.Xsqlite3_free(tls, pVtab)
return 0
}
// Constructor for a new series_cursor object.
-func seriesOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* series.c:145:12: */
+func seriesOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* series.c:145:12: */
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(series_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(series_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(series_cursor{})))
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
return 0
}
// Destructor for a series_cursor.
-func seriesClose(tls *crt.TLS, cur uintptr) int32 { /* series.c:157:12: */
+func seriesClose(tls *libc.TLS, cur uintptr) int32 { /* series.c:157:12: */
sqlite3.Xsqlite3_free(tls, cur)
return 0
}
// Advance a series_cursor to its next row of output.
-func seriesNext(tls *crt.TLS, cur uintptr) int32 { /* series.c:166:12: */
+func seriesNext(tls *libc.TLS, cur uintptr) int32 { /* series.c:166:12: */
var pCur uintptr = cur
if (*series_cursor)(unsafe.Pointer(pCur)).FisDesc != 0 {
*(*sqlite3_int64)(unsafe.Pointer(pCur + 24 /* &.iValue */)) -= ((*series_cursor)(unsafe.Pointer(pCur)).FiStep)
@@ -21551,7 +25172,7 @@ func seriesNext(tls *crt.TLS, cur uintptr) int32 { /* series.c:166:12: */
// Return values of columns for the row at which the series_cursor
// is currently pointing.
-func seriesColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* series.c:181:12: */
+func seriesColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* series.c:181:12: */
var pCur uintptr = cur
var x sqlite3_int64 = int64(0)
switch i {
@@ -21575,7 +25196,7 @@ func seriesColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* se
// Return the rowid for the current row. In this implementation, the
// first row returned is assigned rowid value 1, and each subsequent
// row a value 1 more than that of the previous.
-func seriesRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* series.c:203:12: */
+func seriesRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* series.c:203:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*series_cursor)(unsafe.Pointer(pCur)).FiRowid
return 0
@@ -21583,12 +25204,12 @@ func seriesRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* series.c:
// Return TRUE if the cursor has been moved off of the last
// row of output.
-func seriesEof(tls *crt.TLS, cur uintptr) int32 { /* series.c:213:12: */
+func seriesEof(tls *libc.TLS, cur uintptr) int32 { /* series.c:213:12: */
var pCur uintptr = cur
if (*series_cursor)(unsafe.Pointer(pCur)).FisDesc != 0 {
- return (crt.Bool32((*series_cursor)(unsafe.Pointer(pCur)).FiValue < (*series_cursor)(unsafe.Pointer(pCur)).FmnValue))
+ return (libc.Bool32((*series_cursor)(unsafe.Pointer(pCur)).FiValue < (*series_cursor)(unsafe.Pointer(pCur)).FmnValue))
} else {
- return (crt.Bool32((*series_cursor)(unsafe.Pointer(pCur)).FiValue > (*series_cursor)(unsafe.Pointer(pCur)).FmxValue))
+ return (libc.Bool32((*series_cursor)(unsafe.Pointer(pCur)).FiValue > (*series_cursor)(unsafe.Pointer(pCur)).FmxValue))
}
return int32(0)
}
@@ -21616,21 +25237,21 @@ func seriesEof(tls *crt.TLS, cur uintptr) int32 { /* series.c:213:12: */
// This routine should initialize the cursor and position it so that it
// is pointing at the first row, or pointing off the end of the table
// (so that seriesEof() will return true) if the table is empty.
-func seriesFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* series.c:251:12: */
+func seriesFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* series.c:251:12: */
var pCur uintptr = pVtabCursor
var i int32 = 0
if (idxNum & 1) != 0 {
- (*series_cursor)(unsafe.Pointer(pCur)).FmnValue = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PostIncInt32(&i, 1))*8)))
+ (*series_cursor)(unsafe.Pointer(pCur)).FmnValue = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PostIncInt32(&i, 1))*8)))
} else {
(*series_cursor)(unsafe.Pointer(pCur)).FmnValue = int64(0)
}
if (idxNum & 2) != 0 {
- (*series_cursor)(unsafe.Pointer(pCur)).FmxValue = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PostIncInt32(&i, 1))*8)))
+ (*series_cursor)(unsafe.Pointer(pCur)).FmxValue = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PostIncInt32(&i, 1))*8)))
} else {
(*series_cursor)(unsafe.Pointer(pCur)).FmxValue = int64(0xffffffff)
}
if (idxNum & 4) != 0 {
- (*series_cursor)(unsafe.Pointer(pCur)).FiStep = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PostIncInt32(&i, 1))*8)))
+ (*series_cursor)(unsafe.Pointer(pCur)).FiStep = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PostIncInt32(&i, 1))*8)))
if (*series_cursor)(unsafe.Pointer(pCur)).FiStep < int64(1) {
(*series_cursor)(unsafe.Pointer(pCur)).FiStep = int64(1)
}
@@ -21674,7 +25295,7 @@ func seriesFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
// (2) stop = $value -- constraint exists
// (4) step = $value -- constraint exists
// (8) output in descending order
-func seriesBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* series.c:313:12: */
+func seriesBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* series.c:313:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -21690,7 +25311,7 @@ func seriesBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* ser
// This implementation assumes that the start, stop, and step columns
// are the last three columns in the virtual table.
- *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + uintptr(0)*4)) = crt.AssignPtrInt32(bp /* &aIdx */ +uintptr(1)*4, crt.AssignPtrInt32(bp /* &aIdx */ +uintptr(2)*4, -1))
+ *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + uintptr(0)*4)) = libc.AssignPtrInt32(bp /* &aIdx */ +uintptr(1)*4, libc.AssignPtrInt32(bp /* &aIdx */ +uintptr(2)*4, -1))
pConstraint = (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint
i = 0
__1:
@@ -21723,9 +25344,9 @@ __2:
__3:
;
for i = 0; i < 3; i++ {
- if (crt.AssignInt32(&j, *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + uintptr(i)*4)))) >= 0 {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(j)*8)).FargvIndex = crt.PreIncInt32(&nArg, 1)
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(j)*8)).Fomit = crt.BoolUint8(!(1 != 0))
+ if (libc.AssignInt32(&j, *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + uintptr(i)*4)))) >= 0 {
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(j)*8)).FargvIndex = libc.PreIncInt32(&nArg, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(j)*8)).Fomit = libc.BoolUint8(!(1 != 0))
}
}
if (unusableMask & ^idxNum) != 0 {
@@ -21737,7 +25358,7 @@ __3:
if (idxNum & 3) == 3 {
// Both start= and stop= boundaries are available. This is the
// the preferred case
- (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = (float64(2 - (crt.Bool32((idxNum & 4) != 0))))
+ (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = (float64(2 - (libc.Bool32((idxNum & 4) != 0))))
(*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(1000)
if (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy == 1 {
if (*sqlite3_index_orderby)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy+uintptr(0)*8)).Fdesc != 0 {
@@ -21779,16 +25400,16 @@ uintptr(0), FxRename:// xFindMethod
uintptr(0), // xRename
} /* series.c:380:23 */
-func sqlite3_series_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* series.c:408:5: */
+func sqlite3_series_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* series.c:408:5: */
var rc int32 = 0
_ = pApi
if sqlite3.Xsqlite3_libversion_number(tls) < 3008012 {
*(*uintptr)(unsafe.Pointer(pzErrMsg)) = sqlite3.Xsqlite3_mprintf(tls,
- ts+4955 /* "generate_series(..." */, 0)
+ ts+6240 /* "generate_series(..." */, 0)
return 1
}
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+5005 /* "generate_series" */, uintptr(unsafe.Pointer(&seriesModule)), uintptr(0))
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+6290 /* "generate_series" */, uintptr(unsafe.Pointer(&seriesModule)), uintptr(0))
return rc
}
@@ -21977,7 +25598,7 @@ var initClass = [128]uint8{
// Mapping from the character class number (0-13) to a symbol for each
// character class. Note that initClass[] can be used to map the class
// symbol back into the class number.
-var className = *(*[14]uint8)(unsafe.Pointer(ts + 5021 /* ".ABCDHLRMY9 ?" */)) /* spellfix.c:176:28 */
+var className = *(*[14]uint8)(unsafe.Pointer(ts + 6306 /* ".ABCDHLRMY9 ?" */)) /* spellfix.c:176:28 */
// Generate a "phonetic hash" from a string of ASCII characters
// in zIn[0..nIn-1].
@@ -21993,7 +25614,7 @@ var className = *(*[14]uint8)(unsafe.Pointer(ts + 5021 /* ".ABCDHLRMY9 ?" */)) /
// Space to hold the result is obtained from sqlite3_malloc()
//
// Return NULL if memory allocation fails.
-func phoneticHash(tls *crt.TLS, zIn uintptr, nIn int32) uintptr { /* spellfix.c:194:22: */
+func phoneticHash(tls *libc.TLS, zIn uintptr, nIn int32) uintptr { /* spellfix.c:194:22: */
var zOut uintptr = sqlite3.Xsqlite3_malloc64(tls, (uint64(nIn + 1)))
var i int32
var nOut int32 = 0
@@ -22055,7 +25676,7 @@ func phoneticHash(tls *crt.TLS, zIn uintptr, nIn int32) uintptr { /* spellfix.c:
c = className[c]
if (nOut == 0) || (int32(c) != int32(*(*uint8)(unsafe.Pointer(zOut + uintptr((nOut - 1)))))) {
- *(*uint8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&nOut, 1)))) = c
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&nOut, 1)))) = c
}
}
*(*uint8)(unsafe.Pointer(zOut + uintptr(nOut))) = uint8(0)
@@ -22064,7 +25685,7 @@ func phoneticHash(tls *crt.TLS, zIn uintptr, nIn int32) uintptr { /* spellfix.c:
// This is an SQL function wrapper around phoneticHash(). See
// the description of phoneticHash() for additional information.
-func phoneticHashSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* spellfix.c:246:13: */
+func phoneticHashSqlFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* spellfix.c:246:13: */
var zIn uintptr
var zOut uintptr
@@ -22076,13 +25697,13 @@ func phoneticHashSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr
if zOut == uintptr(0) {
sqlite3.Xsqlite3_result_error_nomem(tls, context)
} else {
- sqlite3.Xsqlite3_result_text(tls, context, zOut, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ sqlite3.Xsqlite3_result_text(tls, context, zOut, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
}
}
// Return the character class number for a character given its
// context.
-func characterClass(tls *crt.TLS, cPrev int8, c int8) int8 { /* spellfix.c:268:13: */
+func characterClass(tls *libc.TLS, cPrev int8, c int8) int8 { /* spellfix.c:268:13: */
if int32(cPrev) == 0 {
return int8(initClass[(int32(c) & 0x7f)])
}
@@ -22092,7 +25713,7 @@ func characterClass(tls *crt.TLS, cPrev int8, c int8) int8 { /* spellfix.c:268:1
// Return the cost of inserting or deleting character c immediately
// following character cPrev. If cPrev==0, that means c is the first
// character of the word.
-func insertOrDeleteCost(tls *crt.TLS, cPrev int8, c int8, cNext int8) int32 { /* spellfix.c:277:12: */
+func insertOrDeleteCost(tls *libc.TLS, cPrev int8, c int8, cNext int8) int32 { /* spellfix.c:277:12: */
var classC int8 = characterClass(tls, cPrev, c)
var classCprev int8
@@ -22128,7 +25749,7 @@ func insertOrDeleteCost(tls *crt.TLS, cPrev int8, c int8, cNext int8) int32 { /*
// Return the cost of substituting cTo in place of cFrom assuming
// the previous character is cPrev. If cPrev==0 then cTo is the first
// character of the word.
-func substituteCost(tls *crt.TLS, cPrev int8, cFrom int8, cTo int8) int32 { /* spellfix.c:318:12: */
+func substituteCost(tls *libc.TLS, cPrev int8, cFrom int8, cTo int8) int32 { /* spellfix.c:318:12: */
var classFrom int8
var classTo int8
if int32(cFrom) == int32(cTo) {
@@ -22171,7 +25792,7 @@ func substituteCost(tls *crt.TLS, cPrev int8, cFrom int8, cTo int8) int32 { /* s
// then this value is always the number of bytes in zB (i.e. strlen(zB)).
// If zA does end in a '*', then it is the number of bytes in the prefix
// of zB that was deemed to match zA.
-func editdist1(tls *crt.TLS, zA uintptr, zB uintptr, pnMatch uintptr) int32 { /* spellfix.c:362:12: */
+func editdist1(tls *libc.TLS, zA uintptr, zB uintptr, pnMatch uintptr) int32 { /* spellfix.c:362:12: */
bp := tls.Alloc(300)
defer tls.Free(300)
@@ -22229,7 +25850,7 @@ func editdist1(tls *crt.TLS, zA uintptr, zB uintptr, pnMatch uintptr) int32 { /*
// Special processing if either string is empty
if nA == 0 {
cBprev = int8(dc)
- for xB = crt.AssignInt32(&res, 0); (int32(crt.AssignInt8(&cB, *(*int8)(unsafe.Pointer(zB + uintptr(xB)))))) != 0; xB++ {
+ for xB = libc.AssignInt32(&res, 0); (int32(libc.AssignInt8(&cB, *(*int8)(unsafe.Pointer(zB + uintptr(xB)))))) != 0; xB++ {
res = res + (insertOrDeleteCost(tls, cBprev, cB, *(*int8)(unsafe.Pointer(zB + uintptr((xB + 1))))) / 4)
cBprev = cB
}
@@ -22237,7 +25858,7 @@ func editdist1(tls *crt.TLS, zA uintptr, zB uintptr, pnMatch uintptr) int32 { /*
}
if nB == 0 {
cAprev = int8(dc)
- for xA = crt.AssignInt32(&res, 0); (int32(crt.AssignInt8(&cA, *(*int8)(unsafe.Pointer(zA + uintptr(xA)))))) != 0; xA++ {
+ for xA = libc.AssignInt32(&res, 0); (int32(libc.AssignInt8(&cA, *(*int8)(unsafe.Pointer(zA + uintptr(xA)))))) != 0; xA++ {
res = res + (insertOrDeleteCost(tls, cAprev, cA, *(*int8)(unsafe.Pointer(zA + uintptr((xA + 1))))))
cAprev = cA
}
@@ -22253,7 +25874,7 @@ func editdist1(tls *crt.TLS, zA uintptr, zB uintptr, pnMatch uintptr) int32 { /*
if uint64(nB) < ((uint64(unsafe.Sizeof([75]int32{})) * uint64(4)) / (uint64(unsafe.Sizeof(int32(0))) * uint64(5))) {
m = bp /* &mStack[0] */
} else {
- m = crt.AssignUintptr(&toFree, sqlite3.Xsqlite3_malloc64(tls, (uint64(((uint64((nB+1)*5))*uint64(unsafe.Sizeof(int32(0))))/uint64(4)))))
+ m = libc.AssignUintptr(&toFree, sqlite3.Xsqlite3_malloc64(tls, (uint64(((uint64((nB+1)*5))*uint64(unsafe.Sizeof(int32(0))))/uint64(4)))))
if m == uintptr(0) {
return -3
}
@@ -22273,7 +25894,7 @@ func editdist1(tls *crt.TLS, zA uintptr, zB uintptr, pnMatch uintptr) int32 { /*
}
cAprev = int8(dc)
for xA = 1; xA <= nA; xA++ {
- var lastA int32 = (crt.Bool32(xA == nA))
+ var lastA int32 = (libc.Bool32(xA == nA))
cA = *(*int8)(unsafe.Pointer(zA + uintptr((xA - 1))))
cAnext = *(*int8)(unsafe.Pointer(zA + uintptr(xA)))
if (int32(cA) == '*') && (lastA != 0) {
@@ -22351,7 +25972,7 @@ func editdist1(tls *crt.TLS, zA uintptr, zB uintptr, pnMatch uintptr) int32 { /*
// must be pure ASCII text. If A ends with '*' then it is assumed to be
// a prefix of B and extra characters on the end of B have minimal additional
// cost.
-func editdistSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* spellfix.c:518:13: */
+func editdistSqlFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* spellfix.c:518:13: */
var res int32 = editdist1(tls,
sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))),
sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))),
@@ -22360,9 +25981,9 @@ func editdistSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) {
if res == (-3) {
sqlite3.Xsqlite3_result_error_nomem(tls, context)
} else if res == (-2) {
- sqlite3.Xsqlite3_result_error(tls, context, ts+5035 /* "non-ASCII input ..." */, -1)
+ sqlite3.Xsqlite3_result_error(tls, context, ts+6320 /* "non-ASCII input ..." */, -1)
} else {
- sqlite3.Xsqlite3_result_error(tls, context, ts+5065 /* "NULL input to ed..." */, -1)
+ sqlite3.Xsqlite3_result_error(tls, context, ts+6350 /* "NULL input to ed..." */, -1)
}
} else {
sqlite3.Xsqlite3_result_int(tls, context, res)
@@ -22440,7 +26061,7 @@ var editDist3Lang = EditDist3Lang{FiLang: 0, FiInsCost: 100, FiDelCost: 100, FiS
// Clear or delete an instance of the object that records all edit-distance
// weights.
-func editDist3ConfigClear(tls *crt.TLS, p uintptr) { /* spellfix.c:640:13: */
+func editDist3ConfigClear(tls *libc.TLS, p uintptr) { /* spellfix.c:640:13: */
var i int32
if p == uintptr(0) {
return
@@ -22456,9 +26077,9 @@ func editDist3ConfigClear(tls *crt.TLS, p uintptr) { /* spellfix.c:640:13: */
}
}
sqlite3.Xsqlite3_free(tls, (*EditDist3Config)(unsafe.Pointer(p)).Fa)
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(EditDist3Config{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(EditDist3Config{})))
}
-func editDist3ConfigDelete(tls *crt.TLS, pIn uintptr) { /* spellfix.c:655:13: */
+func editDist3ConfigDelete(tls *libc.TLS, pIn uintptr) { /* spellfix.c:655:13: */
var p uintptr = pIn
editDist3ConfigClear(tls, p)
sqlite3.Xsqlite3_free(tls, p)
@@ -22467,13 +26088,13 @@ func editDist3ConfigDelete(tls *crt.TLS, pIn uintptr) { /* spellfix.c:655:13: */
// Compare the FROM values of two EditDist3Cost objects, for sorting.
// Return negative, zero, or positive if the A is less than, equal to,
// or greater than B.
-func editDist3CostCompare(tls *crt.TLS, pA uintptr, pB uintptr) int32 { /* spellfix.c:665:12: */
+func editDist3CostCompare(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* spellfix.c:665:12: */
var n int32 = int32((*EditDist3Cost)(unsafe.Pointer(pA)).FnFrom)
var rc int32
if n > int32((*EditDist3Cost)(unsafe.Pointer(pB)).FnFrom) {
n = int32((*EditDist3Cost)(unsafe.Pointer(pB)).FnFrom)
}
- rc = crt.Xstrncmp(tls, pA+12 /* &.a */, pB+12 /* &.a */, uint64(n))
+ rc = libc.Xstrncmp(tls, pA+12 /* &.a */, pB+12 /* &.a */, uint64(n))
if rc == 0 {
rc = (int32((*EditDist3Cost)(unsafe.Pointer(pA)).FnFrom) - int32((*EditDist3Cost)(unsafe.Pointer(pB)).FnFrom))
}
@@ -22482,7 +26103,7 @@ func editDist3CostCompare(tls *crt.TLS, pA uintptr, pB uintptr) int32 { /* spell
// Merge together two sorted lists of EditDist3Cost objects, in order
// of increasing FROM.
-func editDist3CostMerge(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* spellfix.c:678:22: */
+func editDist3CostMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* spellfix.c:678:22: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -22509,7 +26130,7 @@ func editDist3CostMerge(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* spell
}
// Sort a list of EditDist3Cost objects into order of increasing FROM
-func editDist3CostSort(tls *crt.TLS, pList uintptr) uintptr { /* spellfix.c:707:22: */
+func editDist3CostSort(tls *libc.TLS, pList uintptr) uintptr { /* spellfix.c:707:22: */
bp := tls.Alloc(480)
defer tls.Free(480)
@@ -22544,7 +26165,7 @@ func editDist3CostSort(tls *crt.TLS, pList uintptr) uintptr { /* spellfix.c:707:
}
// Load all edit-distance weights from a table.
-func editDist3ConfigLoad(tls *crt.TLS, p uintptr, db uintptr, zTable uintptr) int32 { /* spellfix.c:737:12: */
+func editDist3ConfigLoad(tls *libc.TLS, p uintptr, db uintptr, zTable uintptr) int32 { /* spellfix.c:737:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -22557,7 +26178,7 @@ func editDist3ConfigLoad(tls *crt.TLS, p uintptr, db uintptr, zTable uintptr) in
var pLang uintptr = uintptr(0)
zSql = sqlite3.Xsqlite3_mprintf(tls,
- ts+5090 /* "SELECT iLang, cF..." */, crt.VaList(bp, zTable))
+ ts+6375 /* "SELECT iLang, cF..." */, libc.VaList(bp, zTable))
if zSql == uintptr(0) {
return 7
}
@@ -22631,8 +26252,8 @@ func editDist3ConfigLoad(tls *crt.TLS, p uintptr, db uintptr, zTable uintptr) in
(*EditDist3Cost)(unsafe.Pointer(pCost)).FnFrom = u8(nFrom)
(*EditDist3Cost)(unsafe.Pointer(pCost)).FnTo = u8(nTo)
(*EditDist3Cost)(unsafe.Pointer(pCost)).FiCost = u16(iCost)
- crt.Xmemcpy(tls, pCost+12 /* &.a */, zFrom, uint64(nFrom))
- crt.Xmemcpy(tls, ((pCost + 12 /* &.a */) + uintptr(nFrom)), zTo, uint64(nTo))
+ libc.Xmemcpy(tls, pCost+12 /* &.a */, zFrom, uint64(nFrom))
+ libc.Xmemcpy(tls, ((pCost + 12 /* &.a */) + uintptr(nFrom)), zTo, uint64(nTo))
(*EditDist3Cost)(unsafe.Pointer(pCost)).FpNext = (*EditDist3Lang)(unsafe.Pointer(pLang)).FpCost
(*EditDist3Lang)(unsafe.Pointer(pLang)).FpCost = pCost
}
@@ -22652,7 +26273,7 @@ func editDist3ConfigLoad(tls *crt.TLS, p uintptr, db uintptr, zTable uintptr) in
// Return the length (in bytes) of a utf-8 character. Or return a maximum
// of N.
-func utf8Len(tls *crt.TLS, c uint8, N int32) int32 { /* spellfix.c:818:12: */
+func utf8Len(tls *libc.TLS, c uint8, N int32) int32 { /* spellfix.c:818:12: */
var len int32 = 1
if int32(c) > 0x7f {
if (int32(c) & 0xe0) == 0xc0 {
@@ -22671,7 +26292,7 @@ func utf8Len(tls *crt.TLS, c uint8, N int32) int32 { /* spellfix.c:818:12: */
// Return TRUE (non-zero) if the To side of the given cost matches
// the given string.
-func matchTo(tls *crt.TLS, p uintptr, z uintptr, n int32) int32 { /* spellfix.c:837:12: */
+func matchTo(tls *libc.TLS, p uintptr, z uintptr, n int32) int32 { /* spellfix.c:837:12: */
if int32(*(*int8)(unsafe.Pointer((p + 12 /* &.a */) + uintptr((*EditDist3Cost)(unsafe.Pointer(p)).FnFrom)))) != int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) {
return 0
@@ -22679,7 +26300,7 @@ func matchTo(tls *crt.TLS, p uintptr, z uintptr, n int32) int32 { /* spellfix.c:
if int32((*EditDist3Cost)(unsafe.Pointer(p)).FnTo) > n {
return 0
}
- if crt.Xstrncmp(tls, ((p+12 /* &.a */)+uintptr((*EditDist3Cost)(unsafe.Pointer(p)).FnFrom)), z, uint64((*EditDist3Cost)(unsafe.Pointer(p)).FnTo)) != 0 {
+ if libc.Xstrncmp(tls, ((p+12 /* &.a */)+uintptr((*EditDist3Cost)(unsafe.Pointer(p)).FnFrom)), z, uint64((*EditDist3Cost)(unsafe.Pointer(p)).FnTo)) != 0 {
return 0
}
return 1
@@ -22687,13 +26308,13 @@ func matchTo(tls *crt.TLS, p uintptr, z uintptr, n int32) int32 { /* spellfix.c:
// Return TRUE (non-zero) if the From side of the given cost matches
// the given string.
-func matchFrom(tls *crt.TLS, p uintptr, z uintptr, n int32) int32 { /* spellfix.c:849:12: */
+func matchFrom(tls *libc.TLS, p uintptr, z uintptr, n int32) int32 { /* spellfix.c:849:12: */
if (*EditDist3Cost)(unsafe.Pointer(p)).FnFrom != 0 {
if int32(*(*int8)(unsafe.Pointer((p + 12 /* &.a */) + uintptr(0)))) != int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) {
return 0
}
- if crt.Xstrncmp(tls, p+12 /* &.a */, z, uint64((*EditDist3Cost)(unsafe.Pointer(p)).FnFrom)) != 0 {
+ if libc.Xstrncmp(tls, p+12 /* &.a */, z, uint64((*EditDist3Cost)(unsafe.Pointer(p)).FnFrom)) != 0 {
return 0
}
}
@@ -22702,7 +26323,7 @@ func matchFrom(tls *crt.TLS, p uintptr, z uintptr, n int32) int32 { /* spellfix.
// Return TRUE (non-zero) of the next FROM character and the next TO
// character are the same.
-func matchFromTo(tls *crt.TLS, pStr uintptr, n1 int32, z2 uintptr, n2 int32) int32 { /* spellfix.c:862:12: */
+func matchFromTo(tls *libc.TLS, pStr uintptr, n1 int32, z2 uintptr, n2 int32) int32 { /* spellfix.c:862:12: */
var b1 int32 = (*EditDist3From)(unsafe.Pointer((*EditDist3FromString)(unsafe.Pointer(pStr)).Fa + uintptr(n1)*32)).FnByte
if b1 > n2 {
return 0
@@ -22711,14 +26332,14 @@ func matchFromTo(tls *crt.TLS, pStr uintptr, n1 int32, z2 uintptr, n2 int32) int
if int32(*(*int8)(unsafe.Pointer((*EditDist3FromString)(unsafe.Pointer(pStr)).Fz + uintptr(n1)))) != int32(*(*int8)(unsafe.Pointer(z2 + uintptr(0)))) {
return 0
}
- if crt.Xstrncmp(tls, ((*EditDist3FromString)(unsafe.Pointer(pStr)).Fz+uintptr(n1)), z2, uint64(b1)) != 0 {
+ if libc.Xstrncmp(tls, ((*EditDist3FromString)(unsafe.Pointer(pStr)).Fz+uintptr(n1)), z2, uint64(b1)) != 0 {
return 0
}
return 1
}
// Delete an EditDist3FromString objecct
-func editDist3FromStringDelete(tls *crt.TLS, p uintptr) { /* spellfix.c:879:13: */
+func editDist3FromStringDelete(tls *libc.TLS, p uintptr) { /* spellfix.c:879:13: */
var i int32
if p != 0 {
for i = 0; i < (*EditDist3FromString)(unsafe.Pointer(p)).Fn; i++ {
@@ -22730,7 +26351,7 @@ func editDist3FromStringDelete(tls *crt.TLS, p uintptr) { /* spellfix.c:879:13:
}
// Create a EditDist3FromString object.
-func editDist3FromStringNew(tls *crt.TLS, pLang uintptr, z uintptr, n int32) uintptr { /* spellfix.c:893:28: */
+func editDist3FromStringNew(tls *libc.TLS, pLang uintptr, z uintptr, n int32) uintptr { /* spellfix.c:893:28: */
var pStr uintptr
var p uintptr
var i int32
@@ -22739,17 +26360,17 @@ func editDist3FromStringNew(tls *crt.TLS, pLang uintptr, z uintptr, n int32) uin
return uintptr(0)
}
if n < 0 {
- n = int32(crt.Xstrlen(tls, z))
+ n = int32(libc.Xstrlen(tls, z))
}
pStr = sqlite3.Xsqlite3_malloc64(tls, (uint64(((uint64(unsafe.Sizeof(EditDist3FromString{})) + (uint64(unsafe.Sizeof(EditDist3From{})) * uint64(n))) + uint64(n)) + uint64(1))))
if pStr == uintptr(0) {
return uintptr(0)
}
(*EditDist3FromString)(unsafe.Pointer(pStr)).Fa = (pStr + uintptr(1)*24)
- crt.Xmemset(tls, (*EditDist3FromString)(unsafe.Pointer(pStr)).Fa, 0, (uint64(unsafe.Sizeof(EditDist3From{})) * uint64(n)))
+ libc.Xmemset(tls, (*EditDist3FromString)(unsafe.Pointer(pStr)).Fa, 0, (uint64(unsafe.Sizeof(EditDist3From{})) * uint64(n)))
(*EditDist3FromString)(unsafe.Pointer(pStr)).Fn = n
(*EditDist3FromString)(unsafe.Pointer(pStr)).Fz = ((*EditDist3FromString)(unsafe.Pointer(pStr)).Fa + uintptr(n)*32)
- crt.Xmemcpy(tls, (*EditDist3FromString)(unsafe.Pointer(pStr)).Fz, z, (uint64(n + 1)))
+ libc.Xmemcpy(tls, (*EditDist3FromString)(unsafe.Pointer(pStr)).Fz, z, (uint64(n + 1)))
if (n != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr((n - 1))))) == '*') {
(*EditDist3FromString)(unsafe.Pointer(pStr)).FisPrefix = 1
n--
@@ -22761,7 +26382,7 @@ func editDist3FromStringNew(tls *crt.TLS, pLang uintptr, z uintptr, n int32) uin
for i = 0; i < n; i++ {
var pFrom uintptr = ((*EditDist3FromString)(unsafe.Pointer(pStr)).Fa + uintptr(i)*32)
- crt.Xmemset(tls, pFrom, 0, uint64(unsafe.Sizeof(EditDist3From{})))
+ libc.Xmemset(tls, pFrom, 0, uint64(unsafe.Sizeof(EditDist3From{})))
(*EditDist3From)(unsafe.Pointer(pFrom)).FnByte = utf8Len(tls, uint8(*(*int8)(unsafe.Pointer(z + uintptr(i)))), (n - i))
for p = (*EditDist3Lang)(unsafe.Pointer(pLang)).FpCost; p != 0; p = (*EditDist3Cost)(unsafe.Pointer(p)).FpNext {
var apNew uintptr
@@ -22778,7 +26399,7 @@ func editDist3FromStringNew(tls *crt.TLS, pLang uintptr, z uintptr, n int32) uin
break
}
(*EditDist3From)(unsafe.Pointer(pFrom)).FapDel = apNew
- *(*uintptr)(unsafe.Pointer(apNew + uintptr(crt.PostIncInt32(&(*EditDist3From)(unsafe.Pointer(pFrom)).FnDel, 1))*8)) = p
+ *(*uintptr)(unsafe.Pointer(apNew + uintptr(libc.PostIncInt32(&(*EditDist3From)(unsafe.Pointer(pFrom)).FnDel, 1))*8)) = p
} else {
apNew = sqlite3.Xsqlite3_realloc64(tls, (*EditDist3From)(unsafe.Pointer(pFrom)).FapSubst,
(uint64(uint64(unsafe.Sizeof(uintptr(0))) * (uint64((*EditDist3From)(unsafe.Pointer(pFrom)).FnSubst + 1)))))
@@ -22786,7 +26407,7 @@ func editDist3FromStringNew(tls *crt.TLS, pLang uintptr, z uintptr, n int32) uin
break
}
(*EditDist3From)(unsafe.Pointer(pFrom)).FapSubst = apNew
- *(*uintptr)(unsafe.Pointer(apNew + uintptr(crt.PostIncInt32(&(*EditDist3From)(unsafe.Pointer(pFrom)).FnSubst, 1))*8)) = p
+ *(*uintptr)(unsafe.Pointer(apNew + uintptr(libc.PostIncInt32(&(*EditDist3From)(unsafe.Pointer(pFrom)).FnSubst, 1))*8)) = p
}
}
if p != 0 {
@@ -22800,7 +26421,7 @@ func editDist3FromStringNew(tls *crt.TLS, pLang uintptr, z uintptr, n int32) uin
// Update entry m[i] such that it is the minimum of its current value
// and m[j]+iCost.
-func updateCost(tls *crt.TLS, m uintptr, i int32, j int32, iCost int32) { /* spellfix.c:955:13: */
+func updateCost(tls *libc.TLS, m uintptr, i int32, j int32, iCost int32) { /* spellfix.c:955:13: */
var b uint32
b = (*(*uint32)(unsafe.Pointer(m + uintptr(j)*4)) + uint32(iCost))
@@ -22825,7 +26446,7 @@ func updateCost(tls *crt.TLS, m uintptr, i int32, j int32, iCost int32) { /* spe
// of characters in z2. If pFrom does contain a prefix search pattern, then
// it is the number of characters in the prefix of z2 that was deemed to
// match pFrom.
-func editDist3Core(tls *crt.TLS, pFrom uintptr, z2 uintptr, n2 int32, pLang uintptr, pnMatch uintptr) int32 { /* spellfix.c:990:12: */
+func editDist3Core(tls *libc.TLS, pFrom uintptr, z2 uintptr, n2 int32, pLang uintptr, pnMatch uintptr) int32 { /* spellfix.c:990:12: */
bp := tls.Alloc(1048)
defer tls.Free(1048)
@@ -22859,7 +26480,7 @@ func editDist3Core(tls *crt.TLS, pFrom uintptr, z2 uintptr, n2 int32, pLang uint
// allocate the Wagner matrix and the aTo[] array for the TO string
n = (((*EditDist3FromString)(unsafe.Pointer(bp+1024 /* &f */)).Fn + 1) * (n2 + 1))
- n = ((n + 1) & ^int32(crt.Int32FromInt32(1)))
+ n = ((n + 1) & ^int32(libc.Int32FromInt32(1)))
nByte = (sqlite3_uint64((uint64(n) * uint64(unsafe.Sizeof(uint32(0)))) + (uint64(unsafe.Sizeof(EditDist3To{})) * uint64(n2))))
if !(nByte <= sqlite3_uint64(unsafe.Sizeof([256]uint32{}))) {
goto __1
@@ -22868,7 +26489,7 @@ func editDist3Core(tls *crt.TLS, pFrom uintptr, z2 uintptr, n2 int32, pLang uint
pToFree = uintptr(0)
goto __2
__1:
- m = crt.AssignUintptr(&pToFree, sqlite3.Xsqlite3_malloc64(tls, nByte))
+ m = libc.AssignUintptr(&pToFree, sqlite3.Xsqlite3_malloc64(tls, nByte))
if !(m == uintptr(0)) {
goto __3
}
@@ -22878,7 +26499,7 @@ __3:
__2:
;
a2 = (m + uintptr(n)*4)
- crt.Xmemset(tls, a2, 0, (uint64(unsafe.Sizeof(EditDist3To{})) * uint64(n2)))
+ libc.Xmemset(tls, a2, 0, (uint64(unsafe.Sizeof(EditDist3To{})) * uint64(n2)))
// Fill in the a1[] matrix for all characters of the TO string
i2 = 0
@@ -22944,7 +26565,7 @@ __6:
// Prepare to compute the minimum edit distance
szRow = ((*EditDist3FromString)(unsafe.Pointer(bp+1024 /* &f */)).Fn + 1)
- crt.Xmemset(tls, m, 0x01, ((uint64((n2 + 1) * szRow)) * uint64(unsafe.Sizeof(uint32(0)))))
+ libc.Xmemset(tls, m, 0x01, ((uint64((n2 + 1) * szRow)) * uint64(unsafe.Sizeof(uint32(0)))))
*(*uint32)(unsafe.Pointer(m + uintptr(0)*4)) = uint32(0)
// First fill in the top-row of the matrix with FROM deletion costs
@@ -23141,7 +26762,7 @@ __50:
}
// Get an appropriate EditDist3Lang object.
-func editDist3FindLang(tls *crt.TLS, pConfig uintptr, iLang int32) uintptr { /* spellfix.c:1150:28: */
+func editDist3FindLang(tls *libc.TLS, pConfig uintptr, iLang int32) uintptr { /* spellfix.c:1150:28: */
var i int32
for i = 0; i < (*EditDist3Config)(unsafe.Pointer(pConfig)).FnLang; i++ {
if (*EditDist3Lang)(unsafe.Pointer((*EditDist3Config)(unsafe.Pointer(pConfig)).Fa+uintptr(i)*24)).FiLang == iLang {
@@ -23158,7 +26779,7 @@ func editDist3FindLang(tls *crt.TLS, pConfig uintptr, iLang int32) uintptr { /*
// weights for iLang.
//
// The second form loads edit weights into memory from a table.
-func editDist3SqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* spellfix.c:1170:13: */
+func editDist3SqlFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* spellfix.c:1170:13: */
var pConfig uintptr = sqlite3.Xsqlite3_user_data(tls, context)
var db uintptr = sqlite3.Xsqlite3_context_db_handle(tls, context)
var rc int32
@@ -23199,31 +26820,31 @@ func editDist3SqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) {
}
// Register the editDist3 function with SQLite
-func editDist3Install(tls *crt.TLS, db uintptr) int32 { /* spellfix.c:1210:12: */
+func editDist3Install(tls *libc.TLS, db uintptr) int32 { /* spellfix.c:1210:12: */
var rc int32
var pConfig uintptr = sqlite3.Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(EditDist3Config{})))
if pConfig == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pConfig, 0, uint64(unsafe.Sizeof(EditDist3Config{})))
- rc = sqlite3.Xsqlite3_create_function_v2(tls, db, ts+5162, /* "editdist3" */
+ libc.Xmemset(tls, pConfig, 0, uint64(unsafe.Sizeof(EditDist3Config{})))
+ rc = sqlite3.Xsqlite3_create_function_v2(tls, db, ts+6447, /* "editdist3" */
2, (1 | 0x000000800), pConfig,
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{editDist3SqlFunc})), uintptr(0), uintptr(0), uintptr(0))
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function_v2(tls, db, ts+5162, /* "editdist3" */
+ rc = sqlite3.Xsqlite3_create_function_v2(tls, db, ts+6447, /* "editdist3" */
3, (1 | 0x000000800), pConfig,
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{editDist3SqlFunc})), uintptr(0), uintptr(0), uintptr(0))
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function_v2(tls, db, ts+5162, /* "editdist3" */
+ rc = sqlite3.Xsqlite3_create_function_v2(tls, db, ts+6447, /* "editdist3" */
1, (1 | 0x000000800), pConfig,
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{editDist3SqlFunc})), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{editDist3ConfigDelete})))
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{editDist3SqlFunc})), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{editDist3ConfigDelete})))
} else {
sqlite3.Xsqlite3_free(tls, pConfig)
}
@@ -23249,21 +26870,21 @@ var sqlite3Utf8Trans1 = [64]uint8{
} /* spellfix.c:1243:28 */
// Return the value of the first UTF-8 character in the string.
-func utf8Read(tls *crt.TLS, z uintptr, n int32, pSize uintptr) int32 { /* spellfix.c:1258:12: */
+func utf8Read(tls *libc.TLS, z uintptr, n int32, pSize uintptr) int32 { /* spellfix.c:1258:12: */
var c int32
var i int32
// All callers to this routine (in the current implementation)
// always have n>0.
if 0 != 0 {
- c = crt.AssignInt32(&i, 0)
+ c = libc.AssignInt32(&i, 0)
} else {
c = int32(*(*uint8)(unsafe.Pointer(z + uintptr(0))))
i = 1
if c >= 0xc0 {
c = int32(sqlite3Utf8Trans1[(c - 0xc0)])
for (i < n) && ((int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) & 0xc0) == 0x80) {
- c = ((c << 6) + (0x3f & int32(*(*uint8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&i, 1)))))))
+ c = ((c << 6) + (0x3f & int32(*(*uint8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))))))
}
}
}
@@ -23273,7 +26894,7 @@ func utf8Read(tls *crt.TLS, z uintptr, n int32, pSize uintptr) int32 { /* spellf
// Return the number of characters in the utf-8 string in the nIn byte
// buffer pointed to by zIn.
-func utf8Charlen(tls *crt.TLS, zIn uintptr, nIn int32) int32 { /* spellfix.c:1283:12: */
+func utf8Charlen(tls *libc.TLS, zIn uintptr, nIn int32) int32 { /* spellfix.c:1283:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -23691,7 +27312,7 @@ var translit = [389]Transliteration{
{FcFrom: uint16(0xFB06), FcTo0: uint8(0x73), FcTo1: uint8(0x74), FcTo2: uint8(0x00), FcTo3: uint8(0x00)}, // ๏ฌ† to st
} /* spellfix.c:1306:30 */
-func spellfixFindTranslit(tls *crt.TLS, c int32, pxTop uintptr) uintptr { /* spellfix.c:1698:30: */
+func spellfixFindTranslit(tls *libc.TLS, c int32, pxTop uintptr) uintptr { /* spellfix.c:1698:30: */
*(*int32)(unsafe.Pointer(pxTop)) = (int32((uint64(unsafe.Sizeof(translit)) / uint64(unsafe.Sizeof(Transliteration{}))) - uint64(1)))
return uintptr(unsafe.Pointer(&translit))
}
@@ -23704,7 +27325,7 @@ func spellfixFindTranslit(tls *crt.TLS, c int32, pxTop uintptr) uintptr { /* spe
//
// Space to hold the returned string comes from sqlite3_malloc() and
// should be freed by the caller.
-func transliterate(tls *crt.TLS, zIn uintptr, nIn int32) uintptr { /* spellfix.c:1713:22: */
+func transliterate(tls *libc.TLS, zIn uintptr, nIn int32) uintptr { /* spellfix.c:1713:22: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -23722,7 +27343,7 @@ func transliterate(tls *crt.TLS, zIn uintptr, nIn int32) uintptr { /* spellfix.c
zIn += uintptr(*(*int32)(unsafe.Pointer(bp /* sz */)))
nIn = nIn - (*(*int32)(unsafe.Pointer(bp /* sz */)))
if c <= 127 {
- *(*uint8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&nOut, 1)))) = uint8(c)
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&nOut, 1)))) = uint8(c)
} else {
// var xTop int32 at bp+4, 4
@@ -23733,13 +27354,13 @@ func transliterate(tls *crt.TLS, zIn uintptr, nIn int32) uintptr { /* spellfix.c
for *(*int32)(unsafe.Pointer(bp + 4 /* xTop */)) >= xBtm {
x = ((*(*int32)(unsafe.Pointer(bp + 4 /* xTop */)) + xBtm) / 2)
if int32((*Transliteration)(unsafe.Pointer(tbl+uintptr(x)*6)).FcFrom) == c {
- *(*uint8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&nOut, 1)))) = (*Transliteration)(unsafe.Pointer(tbl + uintptr(x)*6)).FcTo0
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&nOut, 1)))) = (*Transliteration)(unsafe.Pointer(tbl + uintptr(x)*6)).FcTo0
if (*Transliteration)(unsafe.Pointer(tbl+uintptr(x)*6)).FcTo1 != 0 {
- *(*uint8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&nOut, 1)))) = (*Transliteration)(unsafe.Pointer(tbl + uintptr(x)*6)).FcTo1
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&nOut, 1)))) = (*Transliteration)(unsafe.Pointer(tbl + uintptr(x)*6)).FcTo1
if (*Transliteration)(unsafe.Pointer(tbl+uintptr(x)*6)).FcTo2 != 0 {
- *(*uint8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&nOut, 1)))) = (*Transliteration)(unsafe.Pointer(tbl + uintptr(x)*6)).FcTo2
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&nOut, 1)))) = (*Transliteration)(unsafe.Pointer(tbl + uintptr(x)*6)).FcTo2
if (*Transliteration)(unsafe.Pointer(tbl+uintptr(x)*6)).FcTo3 != 0 {
- *(*uint8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&nOut, 1)))) = (*Transliteration)(unsafe.Pointer(tbl + uintptr(x)*6)).FcTo3
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&nOut, 1)))) = (*Transliteration)(unsafe.Pointer(tbl + uintptr(x)*6)).FcTo3
}
}
}
@@ -23752,7 +27373,7 @@ func transliterate(tls *crt.TLS, zIn uintptr, nIn int32) uintptr { /* spellfix.c
}
}
if c != 0 {
- *(*uint8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&nOut, 1)))) = uint8('?')
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&nOut, 1)))) = uint8('?')
}
}
}
@@ -23764,7 +27385,7 @@ func transliterate(tls *crt.TLS, zIn uintptr, nIn int32) uintptr { /* spellfix.c
// string that transliterates to an ASCII string nTrans bytes or longer.
// Or, if the transliteration of the input string is less than nTrans
// bytes in size, return the number of characters in the input string.
-func translen_to_charlen(tls *crt.TLS, zIn uintptr, nIn int32, nTrans int32) int32 { /* spellfix.c:1771:12: */
+func translen_to_charlen(tls *libc.TLS, zIn uintptr, nIn int32, nTrans int32) int32 { /* spellfix.c:1771:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -23775,7 +27396,7 @@ func translen_to_charlen(tls *crt.TLS, zIn uintptr, nIn int32, nTrans int32) int
var nOut int32
var nChar int32
- i = crt.AssignInt32(&nOut, 0)
+ i = libc.AssignInt32(&nOut, 0)
for nChar = 0; (i < nIn) && (nOut < nTrans); nChar++ {
c = utf8Read(tls, (zIn + uintptr(i)), (nIn - i), bp /* &sz */)
i = i + (*(*int32)(unsafe.Pointer(bp /* sz */)))
@@ -23817,14 +27438,14 @@ func translen_to_charlen(tls *crt.TLS, zIn uintptr, nIn int32, nTrans int32) int
//
// Convert a string that contains non-ASCII Roman characters into
// pure ASCII.
-func transliterateSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* spellfix.c:1817:13: */
+func transliterateSqlFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* spellfix.c:1817:13: */
var zIn uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
var nIn int32 = sqlite3.Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
var zOut uintptr = transliterate(tls, zIn, nIn)
if zOut == uintptr(0) {
sqlite3.Xsqlite3_result_error_nomem(tls, context)
} else {
- sqlite3.Xsqlite3_result_text(tls, context, zOut, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ sqlite3.Xsqlite3_result_text(tls, context, zOut, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
}
}
@@ -23842,7 +27463,7 @@ func transliterateSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintpt
// This routine will return 998 if the input X contains characters from
// two or more of the above scripts or 999 if X contains no characters
// from any of the above scripts.
-func scriptCodeSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* spellfix.c:1848:13: */
+func scriptCodeSqlFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* spellfix.c:1848:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -23966,7 +27587,7 @@ type spellfix1_row = struct {
// into *pRc.
//
// If *pRc is initially non-zero then this routine is a no-op.
-func spellfix1DbExec(tls *crt.TLS, pRc uintptr, db uintptr, zFormat uintptr, va uintptr) { /* spellfix.c:1955:13: */
+func spellfix1DbExec(tls *libc.TLS, pRc uintptr, db uintptr, zFormat uintptr, va uintptr) { /* spellfix.c:1955:13: */
var ap va_list
_ = ap
var zSql uintptr
@@ -23985,7 +27606,7 @@ func spellfix1DbExec(tls *crt.TLS, pRc uintptr, db uintptr, zFormat uintptr, va
}
// xDisconnect/xDestroy method for the fuzzy-search module.
-func spellfix1Uninit(tls *crt.TLS, isDestroy int32, pVTab uintptr) int32 { /* spellfix.c:1978:12: */
+func spellfix1Uninit(tls *libc.TLS, isDestroy int32, pVTab uintptr) int32 { /* spellfix.c:1978:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -23993,8 +27614,8 @@ func spellfix1Uninit(tls *crt.TLS, isDestroy int32, pVTab uintptr) int32 { /* sp
*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = 0
if isDestroy != 0 {
var db uintptr = (*spellfix1_vtab)(unsafe.Pointer(p)).Fdb
- spellfix1DbExec(tls, bp+16 /* &rc */, db, ts+5172, /* "DROP TABLE IF EX..." */
- crt.VaList(bp, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName))
+ spellfix1DbExec(tls, bp+16 /* &rc */, db, ts+6457, /* "DROP TABLE IF EX..." */
+ libc.VaList(bp, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName))
}
if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
sqlite3.Xsqlite3_free(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName)
@@ -24004,16 +27625,16 @@ func spellfix1Uninit(tls *crt.TLS, isDestroy int32, pVTab uintptr) int32 { /* sp
}
return *(*int32)(unsafe.Pointer(bp + 16 /* rc */))
}
-func spellfix1Disconnect(tls *crt.TLS, pVTab uintptr) int32 { /* spellfix.c:1994:12: */
+func spellfix1Disconnect(tls *libc.TLS, pVTab uintptr) int32 { /* spellfix.c:1994:12: */
return spellfix1Uninit(tls, 0, pVTab)
}
-func spellfix1Destroy(tls *crt.TLS, pVTab uintptr) int32 { /* spellfix.c:1997:12: */
+func spellfix1Destroy(tls *libc.TLS, pVTab uintptr) int32 { /* spellfix.c:1997:12: */
return spellfix1Uninit(tls, 1, pVTab)
}
// Make a copy of a string. Remove leading and trailing whitespace
// and dequote it.
-func spellfix1Dequote(tls *crt.TLS, zIn uintptr) uintptr { /* spellfix.c:2005:13: */
+func spellfix1Dequote(tls *libc.TLS, zIn uintptr) uintptr { /* spellfix.c:2005:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -24021,21 +27642,21 @@ func spellfix1Dequote(tls *crt.TLS, zIn uintptr) uintptr { /* spellfix.c:2005:13
var i int32
var j int32
var c int8
- for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(0))))))*2))) & int32(_ISspace)) != 0 {
+ for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(0))))))*2))) & int32(_ISspace)) != 0 {
zIn++
}
- zOut = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, zIn))
+ zOut = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, zIn))
if zOut == uintptr(0) {
return uintptr(0)
}
- i = int32(crt.Xstrlen(tls, zOut))
+ i = int32(libc.Xstrlen(tls, zOut))
*(*int8)(unsafe.Pointer(zOut + uintptr(i))) = int8(0)
c = *(*int8)(unsafe.Pointer(zOut + uintptr(0)))
if (int32(c) == '\'') || (int32(c) == '"') {
i = 1
j = 0
for ; 1 != 0; i++ {
- *(*int8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&j, 1)))) = *(*int8)(unsafe.Pointer(zOut + uintptr(i)))
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&j, 1)))) = *(*int8)(unsafe.Pointer(zOut + uintptr(i)))
if int32(*(*int8)(unsafe.Pointer(zOut + uintptr(i)))) == int32(c) {
if int32(*(*int8)(unsafe.Pointer(zOut + uintptr((i + 1))))) == int32(c) {
i++
@@ -24055,7 +27676,7 @@ func spellfix1Dequote(tls *crt.TLS, zIn uintptr) uintptr { /* spellfix.c:2005:13
// argv[1] -> database name
// argv[2] -> table name
// argv[3].. -> optional arguments (i.e. "edit_cost_table" parameter)
-func spellfix1Init(tls *crt.TLS, isCreate int32, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* spellfix.c:2043:12: */
+func spellfix1Init(tls *libc.TLS, isCreate int32, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* spellfix.c:2043:12: */
bp := tls.Alloc(60)
defer tls.Free(60)
@@ -24067,15 +27688,15 @@ func spellfix1Init(tls *crt.TLS, isCreate int32, db uintptr, pAux uintptr, argc
*(*int32)(unsafe.Pointer(bp + 56 /* rc */)) = 0
var i int32
- nDbName = int32(crt.Xstrlen(tls, zDbName))
+ nDbName = int32(libc.Xstrlen(tls, zDbName))
pNew = sqlite3.Xsqlite3_malloc64(tls, (uint64((uint64(unsafe.Sizeof(spellfix1_vtab{})) + uint64(nDbName)) + uint64(1))))
if pNew == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 56 /* rc */)) = 7
} else {
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(spellfix1_vtab{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(spellfix1_vtab{})))
(*spellfix1_vtab)(unsafe.Pointer(pNew)).FzDbName = (pNew + uintptr(1)*64)
- crt.Xmemcpy(tls, (*spellfix1_vtab)(unsafe.Pointer(pNew)).FzDbName, zDbName, (uint64(nDbName + 1)))
- (*spellfix1_vtab)(unsafe.Pointer(pNew)).FzTableName = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, zTableName))
+ libc.Xmemcpy(tls, (*spellfix1_vtab)(unsafe.Pointer(pNew)).FzDbName, zDbName, (uint64(nDbName + 1)))
+ (*spellfix1_vtab)(unsafe.Pointer(pNew)).FzTableName = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, zTableName))
(*spellfix1_vtab)(unsafe.Pointer(pNew)).Fdb = db
if (*spellfix1_vtab)(unsafe.Pointer(pNew)).FzTableName == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 56 /* rc */)) = 7
@@ -24083,27 +27704,27 @@ func spellfix1Init(tls *crt.TLS, isCreate int32, db uintptr, pAux uintptr, argc
sqlite3.Xsqlite3_vtab_config(tls, db, 2, 0)
*(*int32)(unsafe.Pointer(bp + 56 /* rc */)) = sqlite3.Xsqlite3_declare_vtab(tls, db,
- ts+5209 /* "CREATE TABLE x(w..." */)
+ ts+6494 /* "CREATE TABLE x(w..." */)
}
if (*(*int32)(unsafe.Pointer(bp + 56 /* rc */)) == 0) && (isCreate != 0) {
spellfix1DbExec(tls, bp+56 /* &rc */, db,
- ts+5363, /* "CREATE TABLE IF ..." */
- crt.VaList(bp+8, zDbName, zTableName))
+ ts+6648, /* "CREATE TABLE IF ..." */
+ libc.VaList(bp+8, zDbName, zTableName))
spellfix1DbExec(tls, bp+56 /* &rc */, db,
- ts+5497, /* "CREATE INDEX IF ..." */
- crt.VaList(bp+24, zDbName, zTableName, zTableName))
+ ts+6782, /* "CREATE INDEX IF ..." */
+ libc.VaList(bp+24, zDbName, zTableName, zTableName))
}
for i = 3; (*(*int32)(unsafe.Pointer(bp + 56 /* rc */)) == 0) && (i < argc); i++ {
- if (crt.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ts+5582 /* "edit_cost_table=" */, uint64(16)) == 0) && ((*spellfix1_vtab)(unsafe.Pointer(pNew)).FzCostTable == uintptr(0)) {
+ if (libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ts+6867 /* "edit_cost_table=" */, uint64(16)) == 0) && ((*spellfix1_vtab)(unsafe.Pointer(pNew)).FzCostTable == uintptr(0)) {
(*spellfix1_vtab)(unsafe.Pointer(pNew)).FzCostTable = spellfix1Dequote(tls, (*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) + uintptr(16)))
if (*spellfix1_vtab)(unsafe.Pointer(pNew)).FzCostTable == uintptr(0) {
*(*int32)(unsafe.Pointer(bp + 56 /* rc */)) = 7
}
continue
}
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+5599 /* "bad argument to ..." */, crt.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+6884 /* "bad argument to ..." */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
*(*int32)(unsafe.Pointer(bp + 56 /* rc */)) = 1
}
}
@@ -24118,15 +27739,15 @@ func spellfix1Init(tls *crt.TLS, isCreate int32, db uintptr, pAux uintptr, argc
}
// The xConnect and xCreate methods
-func spellfix1Connect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* spellfix.c:2133:12: */
+func spellfix1Connect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* spellfix.c:2133:12: */
return spellfix1Init(tls, 0, db, pAux, argc, argv, ppVTab, pzErr)
}
-func spellfix1Create(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* spellfix.c:2142:12: */
+func spellfix1Create(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* spellfix.c:2142:12: */
return spellfix1Init(tls, 1, db, pAux, argc, argv, ppVTab, pzErr)
}
// Clear all of the content from a cursor.
-func spellfix1ResetCursor(tls *crt.TLS, pCur uintptr) { /* spellfix.c:2155:13: */
+func spellfix1ResetCursor(tls *libc.TLS, pCur uintptr) { /* spellfix.c:2155:13: */
var i int32
for i = 0; i < (*spellfix1_cursor)(unsafe.Pointer(pCur)).FnRow; i++ {
sqlite3.Xsqlite3_free(tls, (*spellfix1_row)(unsafe.Pointer((*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa+uintptr(i)*64)).FzWord)
@@ -24141,7 +27762,7 @@ func spellfix1ResetCursor(tls *crt.TLS, pCur uintptr) { /* spellfix.c:2155:13: *
}
// Resize the cursor to hold up to N rows of content
-func spellfix1ResizeCursor(tls *crt.TLS, pCur uintptr, N int32) { /* spellfix.c:2172:13: */
+func spellfix1ResizeCursor(tls *libc.TLS, pCur uintptr, N int32) { /* spellfix.c:2172:13: */
var aNew uintptr
aNew = sqlite3.Xsqlite3_realloc64(tls, (*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa, (uint64(uint64(unsafe.Sizeof(spellfix1_row{})) * uint64(N))))
@@ -24157,7 +27778,7 @@ func spellfix1ResizeCursor(tls *crt.TLS, pCur uintptr, N int32) { /* spellfix.c:
}
// Close a fuzzy-search cursor.
-func spellfix1Close(tls *crt.TLS, cur uintptr) int32 { /* spellfix.c:2191:12: */
+func spellfix1Close(tls *libc.TLS, cur uintptr) int32 { /* spellfix.c:2191:12: */
var pCur uintptr = cur
spellfix1ResetCursor(tls, pCur)
spellfix1ResizeCursor(tls, pCur, 0)
@@ -24172,7 +27793,7 @@ func spellfix1Close(tls *crt.TLS, cur uintptr) int32 { /* spellfix.c:2191:12: */
//
// filter.argv[*] values contains $str, $langid, $top, $scope and $rowid
// if specified and in that order.
-func spellfix1BestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* spellfix.c:2217:12: */
+func spellfix1BestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* spellfix.c:2217:12: */
var iPlan int32 = 0
var iLangTerm int32 = -1
var iTopTerm int32 = -1
@@ -24263,19 +27884,19 @@ __3:
(*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 1
}
if (iPlan & 0x02) != 0 {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iLangTerm)*8)).FargvIndex = crt.PostIncInt32(&idx, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iLangTerm)*8)).FargvIndex = libc.PostIncInt32(&idx, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iLangTerm)*8)).Fomit = uint8(1)
}
if (iPlan & 0x04) != 0 {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iTopTerm)*8)).FargvIndex = crt.PostIncInt32(&idx, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iTopTerm)*8)).FargvIndex = libc.PostIncInt32(&idx, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iTopTerm)*8)).Fomit = uint8(1)
}
if (iPlan & 0x08) != 0 {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iScopeTerm)*8)).FargvIndex = crt.PostIncInt32(&idx, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iScopeTerm)*8)).FargvIndex = libc.PostIncInt32(&idx, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iScopeTerm)*8)).Fomit = uint8(1)
}
if (iPlan & (0x10 | 0x20)) != 0 {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iDistTerm)*8)).FargvIndex = crt.PostIncInt32(&idx, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iDistTerm)*8)).FargvIndex = libc.PostIncInt32(&idx, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iDistTerm)*8)).Fomit = uint8(1)
}
(*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 1e5
@@ -24292,14 +27913,14 @@ __3:
}
// Open a new fuzzy-search cursor.
-func spellfix1Open(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* spellfix.c:2331:12: */
+func spellfix1Open(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* spellfix.c:2331:12: */
var p uintptr = pVTab
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(spellfix1_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(spellfix1_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(spellfix1_cursor{})))
(*spellfix1_cursor)(unsafe.Pointer(pCur)).FpVTab = p
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
return 0
@@ -24307,7 +27928,7 @@ func spellfix1Open(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* spe
// Adjust a distance measurement by the words rank in order to show
// preference to common words.
-func spellfix1Score(tls *crt.TLS, iDistance int32, iRank int32) int32 { /* spellfix.c:2346:12: */
+func spellfix1Score(tls *libc.TLS, iDistance int32, iRank int32) int32 { /* spellfix.c:2346:12: */
var iLog2 int32
iLog2 = 0
__1:
@@ -24329,7 +27950,7 @@ __3:
// Compare two spellfix1_row objects for sorting purposes in qsort() such
// that they sort in order of increasing distance.
-func spellfix1RowCompare(tls *crt.TLS, A uintptr, B uintptr) int32 { /* spellfix.c:2356:25: */
+func spellfix1RowCompare(tls *libc.TLS, A uintptr, B uintptr) int32 { /* spellfix.c:2356:25: */
var a uintptr = A
var b uintptr = B
return ((*spellfix1_row)(unsafe.Pointer(a)).FiScore - (*spellfix1_row)(unsafe.Pointer(b)).FiScore)
@@ -24361,7 +27982,7 @@ type MatchQuery = MatchQuery1 /* spellfix.c:2381:3 */
// Run a query looking for the best matches against zPattern using
// zHash as the character class seed hash.
-func spellfix1RunQuery(tls *crt.TLS, p uintptr, zQuery uintptr, nQuery int32) { /* spellfix.c:2387:13: */
+func spellfix1RunQuery(tls *libc.TLS, p uintptr, zQuery uintptr, nQuery int32) { /* spellfix.c:2387:13: */
bp := tls.Alloc(76)
defer tls.Free(76)
@@ -24393,7 +28014,7 @@ func spellfix1RunQuery(tls *crt.TLS, p uintptr, zQuery uintptr, nQuery int32) {
(*MatchQuery)(unsafe.Pointer(p)).Frc = 7
return
}
- nClass = int32(crt.Xstrlen(tls, zClass))
+ nClass = int32(libc.Xstrlen(tls, zClass))
if nClass > (32 - 2) {
nClass = (32 - 2)
*(*int8)(unsafe.Pointer(zClass + uintptr(nClass))) = int8(0)
@@ -24405,14 +28026,14 @@ func spellfix1RunQuery(tls *crt.TLS, p uintptr, zQuery uintptr, nQuery int32) {
iScope = nClass
}
}
- crt.Xmemcpy(tls, bp+8 /* &zHash1[0] */, zClass, uint64(iScope))
+ libc.Xmemcpy(tls, bp+8 /* &zHash1[0] */, zClass, uint64(iScope))
sqlite3.Xsqlite3_free(tls, zClass)
*(*int8)(unsafe.Pointer(bp + 8 /* &zHash1[0] */ + uintptr(iScope))) = int8(0)
- crt.Xmemcpy(tls, bp+40 /* &zHash2[0] */, bp+8 /* &zHash1[0] */, uint64(iScope))
+ libc.Xmemcpy(tls, bp+40 /* &zHash2[0] */, bp+8 /* &zHash1[0] */, uint64(iScope))
*(*int8)(unsafe.Pointer(bp + 40 /* &zHash2[0] */ + uintptr(iScope))) = int8('Z')
*(*int8)(unsafe.Pointer(bp + 40 /* &zHash2[0] */ + uintptr((iScope + 1)))) = int8(0)
- crt.Xmemcpy(tls, ((p + 108 /* &.azPrior */) + uintptr(crt.PostIncInt32(&(*MatchQuery)(unsafe.Pointer(p)).FnRun, 1))*32), bp+8 /* &zHash1[0] */, (uint64(iScope + 1)))
+ libc.Xmemcpy(tls, ((p + 108 /* &.azPrior */) + uintptr(libc.PostIncInt32(&(*MatchQuery)(unsafe.Pointer(p)).FnRun, 1))*32), bp+8 /* &zHash1[0] */, (uint64(iScope + 1)))
if (sqlite3.Xsqlite3_bind_text(tls, pStmt, 1, bp+8 /* &zHash1[0] */, -1, uintptr(0)) == 7) ||
(sqlite3.Xsqlite3_bind_text(tls, pStmt, 2, bp+40 /* &zHash2[0] */, -1, uintptr(0)) == 7) {
(*MatchQuery)(unsafe.Pointer(p)).Frc = 7
@@ -24467,7 +28088,7 @@ func spellfix1RunQuery(tls *crt.TLS, p uintptr, zQuery uintptr, nQuery int32) {
continue
}
- (*spellfix1_row)(unsafe.Pointer((*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa + uintptr(idx)*64)).FzWord = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, sqlite3.Xsqlite3_column_text(tls, pStmt, 1)))
+ (*spellfix1_row)(unsafe.Pointer((*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa + uintptr(idx)*64)).FzWord = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, sqlite3.Xsqlite3_column_text(tls, pStmt, 1)))
if (*spellfix1_row)(unsafe.Pointer((*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa+uintptr(idx)*64)).FzWord == uintptr(0) {
(*MatchQuery)(unsafe.Pointer(p)).Frc = 7
break
@@ -24477,7 +28098,7 @@ func spellfix1RunQuery(tls *crt.TLS, p uintptr, zQuery uintptr, nQuery int32) {
(*spellfix1_row)(unsafe.Pointer((*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa + uintptr(idx)*64)).FiDistance = iDist
(*spellfix1_row)(unsafe.Pointer((*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa + uintptr(idx)*64)).FiScore = iScore
(*spellfix1_row)(unsafe.Pointer((*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa + uintptr(idx)*64)).FiMatchlen = *(*int32)(unsafe.Pointer(bp + 72 /* iMatchlen */))
- crt.Xmemcpy(tls, (*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa+uintptr(idx)*64+32 /* &.zHash */, bp+8 /* &zHash1[0] */, (uint64(iScope + 1)))
+ libc.Xmemcpy(tls, (*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa+uintptr(idx)*64+32 /* &.zHash */, bp+8 /* &zHash1[0] */, (uint64(iScope + 1)))
if (*spellfix1_cursor)(unsafe.Pointer(pCur)).FnRow < (*spellfix1_cursor)(unsafe.Pointer(pCur)).FnAlloc {
(*spellfix1_cursor)(unsafe.Pointer(pCur)).FnRow++
}
@@ -24501,7 +28122,7 @@ func spellfix1RunQuery(tls *crt.TLS, p uintptr, zQuery uintptr, nQuery int32) {
// This version of the xFilter method work if the MATCH term is present
// and we are doing a scan.
-func spellfix1FilterForMatch(tls *crt.TLS, pCur uintptr, argc int32, argv uintptr) int32 { /* spellfix.c:2526:12: */
+func spellfix1FilterForMatch(tls *libc.TLS, pCur uintptr, argc int32, argv uintptr) int32 { /* spellfix.c:2526:12: */
bp := tls.Alloc(176)
defer tls.Free(176)
@@ -24540,7 +28161,7 @@ func spellfix1FilterForMatch(tls *crt.TLS, pCur uintptr, argc int32, argv uintpt
return 7
__2:
;
- crt.Xmemset(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FpConfig3, 0, uint64(unsafe.Sizeof(EditDist3Config{})))
+ libc.Xmemset(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FpConfig3, 0, uint64(unsafe.Sizeof(EditDist3Config{})))
rc = editDist3ConfigLoad(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FpConfig3, (*spellfix1_vtab)(unsafe.Pointer(p)).Fdb, (*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable)
if !(rc != 0) {
goto __3
@@ -24550,20 +28171,20 @@ __3:
;
__1:
;
- crt.Xmemset(tls, bp+24 /* &x */, 0, uint64(unsafe.Sizeof(MatchQuery{})))
+ libc.Xmemset(tls, bp+24 /* &x */, 0, uint64(unsafe.Sizeof(MatchQuery{})))
(*MatchQuery)(unsafe.Pointer(bp + 24 /* &x */)).FiScope = 3 // Default scope if none specified by "WHERE scope=N"
(*MatchQuery)(unsafe.Pointer(bp + 24 /* &x */)).FiMaxDist = -1 // Maximum allowed edit distance
if !((idxNum & 2) != 0) {
goto __4
}
- iLang = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PostIncInt32(&idx, 1))*8)))
+ iLang = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PostIncInt32(&idx, 1))*8)))
__4:
;
if !((idxNum & 4) != 0) {
goto __5
}
- iLimit = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PostIncInt32(&idx, 1))*8)))
+ iLimit = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PostIncInt32(&idx, 1))*8)))
if !(iLimit < 1) {
goto __6
}
@@ -24575,7 +28196,7 @@ __5:
if !((idxNum & 8) != 0) {
goto __7
}
- (*MatchQuery)(unsafe.Pointer(bp + 24 /* &x */)).FiScope = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PostIncInt32(&idx, 1))*8)))
+ (*MatchQuery)(unsafe.Pointer(bp + 24 /* &x */)).FiScope = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PostIncInt32(&idx, 1))*8)))
if !((*MatchQuery)(unsafe.Pointer(bp+24 /* &x */)).FiScope < 1) {
goto __8
}
@@ -24593,7 +28214,7 @@ __7:
if !((idxNum & (16 | 32)) != 0) {
goto __10
}
- (*MatchQuery)(unsafe.Pointer(bp + 24 /* &x */)).FiMaxDist = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PostIncInt32(&idx, 1))*8)))
+ (*MatchQuery)(unsafe.Pointer(bp + 24 /* &x */)).FiMaxDist = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PostIncInt32(&idx, 1))*8)))
if !((idxNum & 16) != 0) {
goto __11
}
@@ -24644,7 +28265,7 @@ __15:
goto filter_exit
__17:
;
- nPattern = int32(crt.Xstrlen(tls, zPattern))
+ nPattern = int32(libc.Xstrlen(tls, zPattern))
if !(int32(*(*int8)(unsafe.Pointer(zPattern + uintptr((nPattern - 1))))) == '*') {
goto __18
}
@@ -24653,8 +28274,8 @@ __18:
;
zSql = sqlite3.Xsqlite3_mprintf(tls,
- ts+5633, /* "SELECT id, word,..." */
- crt.VaList(bp, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, iLang))
+ ts+6918, /* "SELECT id, word,..." */
+ libc.VaList(bp, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, iLang))
if !(zSql == uintptr(0)) {
goto __19
}
@@ -24684,8 +28305,8 @@ __20:
if !((*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa != 0) {
goto __21
}
- crt.Xqsort(tls, (*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa, uint64((*spellfix1_cursor)(unsafe.Pointer(pCur)).FnRow), uint64(unsafe.Sizeof(spellfix1_row{})), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ libc.Xqsort(tls, (*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa, uint64((*spellfix1_cursor)(unsafe.Pointer(pCur)).FnRow), uint64(unsafe.Sizeof(spellfix1_row{})), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr) int32
}{spellfix1RowCompare})))
(*spellfix1_cursor)(unsafe.Pointer(pCur)).FiTop = iLimit
(*spellfix1_cursor)(unsafe.Pointer(pCur)).FiScope = iScope
@@ -24702,7 +28323,7 @@ filter_exit:
}
// This version of xFilter handles a full-table scan case
-func spellfix1FilterForFullScan(tls *crt.TLS, pCur uintptr, argc int32, argv uintptr) int32 { /* spellfix.c:2641:12: */
+func spellfix1FilterForFullScan(tls *libc.TLS, pCur uintptr, argc int32, argv uintptr) int32 { /* spellfix.c:2641:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -24713,11 +28334,11 @@ func spellfix1FilterForFullScan(tls *crt.TLS, pCur uintptr, argc int32, argv uin
spellfix1ResetCursor(tls, pCur)
zSql = sqlite3.Xsqlite3_mprintf(tls,
- ts+5733, /* "SELECT word, ran..." */
- crt.VaList(bp, (*spellfix1_vtab)(unsafe.Pointer(pVTab)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(pVTab)).FzTableName,
+ ts+7018, /* "SELECT word, ran..." */
+ libc.VaList(bp, (*spellfix1_vtab)(unsafe.Pointer(pVTab)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(pVTab)).FzTableName,
func() uintptr {
if (idxNum & 64) != 0 {
- return ts + 5792 /* " WHERE rowid=?" */
+ return ts + 7077 /* " WHERE rowid=?" */
}
return ts + 488 /* "" */
}()))
@@ -24730,7 +28351,7 @@ func spellfix1FilterForFullScan(tls *crt.TLS, pCur uintptr, argc int32, argv uin
rc = sqlite3.Xsqlite3_bind_value(tls, (*spellfix1_cursor)(unsafe.Pointer(pCur)).FpFullScan, 1, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
}
- (*spellfix1_cursor)(unsafe.Pointer(pCur)).FnRow = crt.AssignPtrInt32(pCur+36 /* &.iRow */, 0)
+ (*spellfix1_cursor)(unsafe.Pointer(pCur)).FnRow = libc.AssignPtrInt32(pCur+36 /* &.iRow */, 0)
if rc == 0 {
rc = sqlite3.Xsqlite3_step(tls, (*spellfix1_cursor)(unsafe.Pointer(pCur)).FpFullScan)
if rc == 100 {
@@ -24749,7 +28370,7 @@ func spellfix1FilterForFullScan(tls *crt.TLS, pCur uintptr, argc int32, argv uin
// Called to "rewind" a cursor back to the beginning so that
// it starts its output over again. Always called at least once
// prior to any spellfix1Column, spellfix1Rowid, or spellfix1Eof call.
-func spellfix1Filter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* spellfix.c:2681:12: */
+func spellfix1Filter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* spellfix.c:2681:12: */
var pCur uintptr = cur
var rc int32
(*spellfix1_cursor)(unsafe.Pointer(pCur)).FidxNum = idxNum
@@ -24762,7 +28383,7 @@ func spellfix1Filter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, ar
}
// Advance a cursor to its next row of output
-func spellfix1Next(tls *crt.TLS, cur uintptr) int32 { /* spellfix.c:2701:12: */
+func spellfix1Next(tls *libc.TLS, cur uintptr) int32 { /* spellfix.c:2701:12: */
var pCur uintptr = cur
var rc int32 = 0
if (*spellfix1_cursor)(unsafe.Pointer(pCur)).FiRow < (*spellfix1_cursor)(unsafe.Pointer(pCur)).FnRow {
@@ -24782,13 +28403,13 @@ func spellfix1Next(tls *crt.TLS, cur uintptr) int32 { /* spellfix.c:2701:12: */
}
// Return TRUE if we are at the end-of-file
-func spellfix1Eof(tls *crt.TLS, cur uintptr) int32 { /* spellfix.c:2719:12: */
+func spellfix1Eof(tls *libc.TLS, cur uintptr) int32 { /* spellfix.c:2719:12: */
var pCur uintptr = cur
- return (crt.Bool32((*spellfix1_cursor)(unsafe.Pointer(pCur)).FiRow >= (*spellfix1_cursor)(unsafe.Pointer(pCur)).FnRow))
+ return (libc.Bool32((*spellfix1_cursor)(unsafe.Pointer(pCur)).FiRow >= (*spellfix1_cursor)(unsafe.Pointer(pCur)).FnRow))
}
// Return columns from the current row.
-func spellfix1Column(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* spellfix.c:2727:12: */
+func spellfix1Column(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* spellfix.c:2727:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -24831,9 +28452,9 @@ func spellfix1Column(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
{
*(*int32)(unsafe.Pointer(bp /* iMatchlen */)) = (*spellfix1_row)(unsafe.Pointer((*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa + uintptr((*spellfix1_cursor)(unsafe.Pointer(pCur)).FiRow)*64)).FiMatchlen
if *(*int32)(unsafe.Pointer(bp /* iMatchlen */)) < 0 {
- var nPattern int32 = int32(crt.Xstrlen(tls, (*spellfix1_cursor)(unsafe.Pointer(pCur)).FzPattern))
+ var nPattern int32 = int32(libc.Xstrlen(tls, (*spellfix1_cursor)(unsafe.Pointer(pCur)).FzPattern))
var zWord uintptr = (*spellfix1_row)(unsafe.Pointer((*spellfix1_cursor)(unsafe.Pointer(pCur)).Fa + uintptr((*spellfix1_cursor)(unsafe.Pointer(pCur)).FiRow)*64)).FzWord
- var nWord int32 = int32(crt.Xstrlen(tls, zWord))
+ var nWord int32 = int32(libc.Xstrlen(tls, zWord))
if (nPattern > 0) && (int32(*(*int8)(unsafe.Pointer((*spellfix1_cursor)(unsafe.Pointer(pCur)).FzPattern + uintptr((nPattern - 1))))) == '*') {
var zTranslit uintptr
@@ -24886,7 +28507,7 @@ func spellfix1Column(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
}
// The rowid.
-func spellfix1Rowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* spellfix.c:2813:12: */
+func spellfix1Rowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* spellfix.c:2813:12: */
var pCur uintptr = cur
if (*spellfix1_cursor)(unsafe.Pointer(pCur)).FpFullScan != 0 {
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = sqlite3.Xsqlite3_column_int64(tls, (*spellfix1_cursor)(unsafe.Pointer(pCur)).FpFullScan, 4)
@@ -24899,7 +28520,7 @@ func spellfix1Rowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* spellf
// This function is called by the xUpdate() method. It returns a string
// containing the conflict mode that xUpdate() should use for the current
// operation. One of: "ROLLBACK", "IGNORE", "ABORT" or "REPLACE".
-func spellfix1GetConflict(tls *crt.TLS, db uintptr) uintptr { /* spellfix.c:2828:19: */
+func spellfix1GetConflict(tls *libc.TLS, db uintptr) uintptr { /* spellfix.c:2828:19: */
var eConflict int32 = sqlite3.Xsqlite3_vtab_on_conflict(tls, db)
return azConflict[(eConflict - 1)]
@@ -24907,11 +28528,11 @@ func spellfix1GetConflict(tls *crt.TLS, db uintptr) uintptr { /* spellfix.c:2828
var azConflict = [5]uintptr{
// Note: Instead of "FAIL" - "ABORT".
- ts + 5807 /* "ROLLBACK" */, ts + 5816 /* "IGNORE" */, ts + 5823 /* "ABORT" */, ts + 5823 /* "ABORT" */, ts + 5829, /* "REPLACE" */
+ ts + 7092 /* "ROLLBACK" */, ts + 7101 /* "IGNORE" */, ts + 7108 /* "ABORT" */, ts + 7108 /* "ABORT" */, ts + 7114, /* "REPLACE" */
} /* spellfix.c:2829:21 */
// The xUpdate() method.
-func spellfix1Update(tls *crt.TLS, pVTab uintptr, argc int32, argv uintptr, pRowid uintptr) int32 { /* spellfix.c:2851:12: */
+func spellfix1Update(tls *libc.TLS, pVTab uintptr, argc int32, argv uintptr, pRowid uintptr) int32 { /* spellfix.c:2851:12: */
bp := tls.Alloc(284)
defer tls.Free(284)
@@ -24923,10 +28544,10 @@ func spellfix1Update(tls *crt.TLS, pVTab uintptr, argc int32, argv uintptr, pRow
if argc == 1 {
// A delete operation on the rowid given by argv[0]
- rowid = crt.AssignPtrInt64(pRowid, sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
+ rowid = libc.AssignPtrInt64(pRowid, sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
spellfix1DbExec(tls, bp+280 /* &rc */, db,
- ts+5837, /* "DELETE FROM \"%w\"..." */
- crt.VaList(bp, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, rowid))
+ ts+7122, /* "DELETE FROM \"%w\"..." */
+ libc.VaList(bp, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, rowid))
} else {
var zWord uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((0+2))*8)))
var nWord int32 = sqlite3.Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((0+2))*8)))
@@ -24946,17 +28567,17 @@ func spellfix1Update(tls *crt.TLS, pVTab uintptr, argc int32, argv uintptr, pRow
// what special actions to take
var zCmd uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((11+2))*8)))
if zCmd == uintptr(0) {
- (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+5880, /* "NOT NULL constra..." */
- crt.VaList(bp+24, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName))
+ (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+7165, /* "NOT NULL constra..." */
+ libc.VaList(bp+24, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName))
return (19 | (int32(5) << 8))
}
- if crt.Xstrcmp(tls, zCmd, ts+5916 /* "reset" */) == 0 {
+ if libc.Xstrcmp(tls, zCmd, ts+7201 /* "reset" */) == 0 {
// Reset the edit cost table (if there is one).
editDist3ConfigDelete(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FpConfig3)
(*spellfix1_vtab)(unsafe.Pointer(p)).FpConfig3 = uintptr(0)
return 0
}
- if crt.Xstrncmp(tls, zCmd, ts+5582 /* "edit_cost_table=" */, uint64(16)) == 0 {
+ if libc.Xstrncmp(tls, zCmd, ts+6867 /* "edit_cost_table=" */, uint64(16)) == 0 {
editDist3ConfigDelete(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FpConfig3)
(*spellfix1_vtab)(unsafe.Pointer(p)).FpConfig3 = uintptr(0)
sqlite3.Xsqlite3_free(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable)
@@ -24964,14 +28585,14 @@ func spellfix1Update(tls *crt.TLS, pVTab uintptr, argc int32, argv uintptr, pRow
if (*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable == uintptr(0) {
return 7
}
- if (int32(*(*int8)(unsafe.Pointer((*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable + uintptr(0)))) == 0) || (sqlite3.Xsqlite3_stricmp(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable, ts+5922 /* "null" */) == 0) {
+ if (int32(*(*int8)(unsafe.Pointer((*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable + uintptr(0)))) == 0) || (sqlite3.Xsqlite3_stricmp(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable, ts+7207 /* "null" */) == 0) {
sqlite3.Xsqlite3_free(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable)
(*spellfix1_vtab)(unsafe.Pointer(p)).FzCostTable = uintptr(0)
}
return 0
}
- (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+5927, /* "unknown value fo..." */
- crt.VaList(bp+32, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, zCmd))
+ (*sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+7212, /* "unknown value fo..." */
+ libc.VaList(bp+32, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, zCmd))
return 1
}
if iRank < 1 {
@@ -24985,7 +28606,7 @@ func spellfix1Update(tls *crt.TLS, pVTab uintptr, argc int32, argv uintptr, pRow
if zK1 == uintptr(0) {
return 7
}
- for i = 0; (int32(crt.AssignInt8(&c, *(*int8)(unsafe.Pointer(zK1 + uintptr(i)))))) != 0; i++ {
+ for i = 0; (int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(zK1 + uintptr(i)))))) != 0; i++ {
if (int32(c) >= 'A') && (int32(c) <= 'Z') {
*(*int8)(unsafe.Pointer(zK1 + uintptr(i))) += int8(('a' - 'A'))
}
@@ -24999,25 +28620,25 @@ func spellfix1Update(tls *crt.TLS, pVTab uintptr, argc int32, argv uintptr, pRow
if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))) == 5 {
spellfix1DbExec(tls, bp+280 /* &rc */, db,
- ts+5962, /* "INSERT INTO \"%w\"..." */
- crt.VaList(bp+48, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName,
+ ts+7247, /* "INSERT INTO \"%w\"..." */
+ libc.VaList(bp+48, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName,
iRank, iLang, zWord, zK1, zWord, zK2))
} else {
newRowid = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
spellfix1DbExec(tls, bp+280 /* &rc */, db,
- ts+6048, /* "INSERT OR %s INT..." */
- crt.VaList(bp+112, zConflict, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName,
+ ts+7333, /* "INSERT OR %s INT..." */
+ libc.VaList(bp+112, zConflict, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName,
newRowid, iRank, iLang, zWord, zK1, zWord, zK2))
}
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = sqlite3.Xsqlite3_last_insert_rowid(tls, db)
} else {
rowid = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- newRowid = crt.AssignPtrInt64(pRowid, sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
+ newRowid = libc.AssignPtrInt64(pRowid, sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
spellfix1DbExec(tls, bp+280 /* &rc */, db,
- ts+6148, /* "UPDATE OR %s \"%w..." */
- crt.VaList(bp+192, zConflict, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, newRowid, iRank, iLang,
+ ts+7433, /* "UPDATE OR %s \"%w..." */
+ libc.VaList(bp+192, zConflict, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, newRowid, iRank, iLang,
zWord, zK1, zWord, zK2, rowid))
}
sqlite3.Xsqlite3_free(tls, zK1)
@@ -25027,20 +28648,20 @@ func spellfix1Update(tls *crt.TLS, pVTab uintptr, argc int32, argv uintptr, pRow
}
// Rename the spellfix1 table.
-func spellfix1Rename(tls *crt.TLS, pVTab uintptr, zNew uintptr) int32 { /* spellfix.c:2966:12: */
+func spellfix1Rename(tls *libc.TLS, pVTab uintptr, zNew uintptr) int32 { /* spellfix.c:2966:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
var p uintptr = pVTab
var db uintptr = (*spellfix1_vtab)(unsafe.Pointer(p)).Fdb
*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = 0
- var zNewName uintptr = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, zNew))
+ var zNewName uintptr = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, zNew))
if zNewName == uintptr(0) {
return 7
}
spellfix1DbExec(tls, bp+32 /* &rc */, db,
- ts+6257, /* "ALTER TABLE \"%w\"..." */
- crt.VaList(bp+8, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, zNewName))
+ ts+7542, /* "ALTER TABLE \"%w\"..." */
+ libc.VaList(bp+8, (*spellfix1_vtab)(unsafe.Pointer(p)).FzDbName, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName, zNewName))
if *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == 0 {
sqlite3.Xsqlite3_free(tls, (*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName)
(*spellfix1_vtab)(unsafe.Pointer(p)).FzTableName = zNewName
@@ -25074,37 +28695,37 @@ uintptr(0), FxRename:// xFindMethod
} /* spellfix.c:2991:23 */
// Register the various functions and the virtual table.
-func spellfix1Register(tls *crt.TLS, db uintptr) int32 { /* spellfix.c:3017:12: */
+func spellfix1Register(tls *libc.TLS, db uintptr) int32 { /* spellfix.c:3017:12: */
var rc int32 = 0
var i int32
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+6306 /* "spellfix1_transl..." */, 1,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7591 /* "spellfix1_transl..." */, 1,
(1 | 0x000000800), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{transliterateSqlFunc})), uintptr(0), uintptr(0))
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+6325 /* "spellfix1_editdi..." */, 2,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7610 /* "spellfix1_editdi..." */, 2,
(1 | 0x000000800), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{editdistSqlFunc})), uintptr(0), uintptr(0))
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+6344 /* "spellfix1_phoneh..." */, 1,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7629 /* "spellfix1_phoneh..." */, 1,
(1 | 0x000000800), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{phoneticHashSqlFunc})), uintptr(0), uintptr(0))
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+6364 /* "spellfix1_script..." */, 1,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7649 /* "spellfix1_script..." */, 1,
(1 | 0x000000800), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{scriptCodeSqlFunc})), uintptr(0), uintptr(0))
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+6385 /* "spellfix1" */, uintptr(unsafe.Pointer(&spellfix1Module)), uintptr(0))
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+7670 /* "spellfix1" */, uintptr(unsafe.Pointer(&spellfix1Module)), uintptr(0))
}
if rc == 0 {
rc = editDist3Install(tls, db)
@@ -25118,7 +28739,7 @@ func spellfix1Register(tls *crt.TLS, db uintptr) int32 { /* spellfix.c:3017:12:
}
// Extension load function.
-func sqlite3_spellfix_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* spellfix.c:3061:5: */
+func sqlite3_spellfix_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* spellfix.c:3061:5: */
_ = pApi
return spellfix1Register(tls, db)
@@ -25133,13 +28754,13 @@ func sqlite3_spellfix_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uint
// compilers.
// Return TRUE if character c is a whitespace character
-func totypeIsspace(tls *crt.TLS, c uint8) int32 { /* totype.c:70:12: */
- return (crt.Bool32((((((int32(c) == ' ') || (int32(c) == '\t')) || (int32(c) == '\n')) || (int32(c) == '\v')) || (int32(c) == '\f')) || (int32(c) == '\r')))
+func totypeIsspace(tls *libc.TLS, c uint8) int32 { /* totype.c:70:12: */
+ return (libc.Bool32((((((int32(c) == ' ') || (int32(c) == '\t')) || (int32(c) == '\n')) || (int32(c) == '\v')) || (int32(c) == '\f')) || (int32(c) == '\r')))
}
// Return TRUE if character c is a digit
-func totypeIsdigit(tls *crt.TLS, c uint8) int32 { /* totype.c:77:12: */
- return (crt.Bool32((int32(c) >= '0') && (int32(c) <= '9')))
+func totypeIsdigit(tls *libc.TLS, c uint8) int32 { /* totype.c:77:12: */
+ return (libc.Bool32((int32(c) >= '0') && (int32(c) <= '9')))
}
// Compare the 19-character string zNum against the text representation
@@ -25154,11 +28775,11 @@ func totypeIsdigit(tls *crt.TLS, c uint8) int32 { /* totype.c:77:12: */
// totypeCompare2pow63("9223372036854775800")
//
// will return -8.
-func totypeCompare2pow63(tls *crt.TLS, zNum uintptr) int32 { /* totype.c:95:12: */
+func totypeCompare2pow63(tls *libc.TLS, zNum uintptr) int32 { /* totype.c:95:12: */
var c int32 = 0
var i int32
// 012345678901234567
- var pow63 uintptr = ts + 6395 /* "9223372036854775..." */
+ var pow63 uintptr = ts + 7680 /* "9223372036854775..." */
for i = 0; (c == 0) && (i < 18); i++ {
c = ((int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))) - int32(*(*int8)(unsafe.Pointer(pow63 + uintptr(i))))) * 10)
}
@@ -25182,7 +28803,7 @@ func totypeCompare2pow63(tls *crt.TLS, zNum uintptr) int32 { /* totype.c:95:12:
// then return 1.
//
// The string is not necessarily zero-terminated.
-func totypeAtoi64(tls *crt.TLS, zNum uintptr, pNum uintptr, length int32) int32 { /* totype.c:125:12: */
+func totypeAtoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32) int32 { /* totype.c:125:12: */
var u sqlite3_uint64 = uint64(0)
var neg int32 = 0 // assume positive
var i int32
@@ -25206,7 +28827,7 @@ func totypeAtoi64(tls *crt.TLS, zNum uintptr, pNum uintptr, length int32) int32
for (zNum < zEnd) && (int32(*(*int8)(unsafe.Pointer(zNum + uintptr(0)))) == '0') {
zNum++
} // Skip leading zeros.
- for i = 0; (((zNum + uintptr(i)) < zEnd) && ((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))))) >= '0')) && (c <= '9'); i++ {
+ for i = 0; (((zNum + uintptr(i)) < zEnd) && ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))))) >= '0')) && (c <= '9'); i++ {
u = (((u * uint64(10)) + sqlite3_uint64(c)) - uint64('0'))
}
if u > (uint64(int64(0xffffffff) | (sqlite3_int64((int64(0x7fffffff))) << 32))) {
@@ -25266,7 +28887,7 @@ func totypeAtoi64(tls *crt.TLS, zNum uintptr, pNum uintptr, length int32) int32
// If some prefix of the input string is a valid number, this routine
// returns FALSE but it still converts the prefix and writes the result
// into *pResult.
-func totypeAtoF(tls *crt.TLS, z uintptr, pResult uintptr, length int32) int32 { /* totype.c:204:12: */
+func totypeAtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32) int32 { /* totype.c:204:12: */
var zEnd uintptr
// sign * significand * (10 ^ (esign * exponent))
var sign int32 // sign of significand
@@ -25485,7 +29106,7 @@ __31:
// In the IEEE 754 standard, zero is signed.
// Add the sign if we've seen at least one digit
if (sign < 0) && (nDigits != 0) {
- result = -crt.Float64FromFloat64(float64(0))
+ result = -libc.Float64FromFloat64(float64(0))
} else {
result = float64(0)
}
@@ -25566,7 +29187,7 @@ __42:
result = (0.0 * float64(s))
goto __51
__50:
- result = ((crt.Float64(1e308) * crt.Float64(1e308)) * float64(s))
+ result = ((libc.Float64(1e308) * libc.Float64(1e308)) * float64(s))
__51:
;
goto __49
@@ -25616,13 +29237,13 @@ __33:
*(*float64)(unsafe.Pointer(pResult)) = result
// return true if number and no extra non-whitespace chracters after
- return (crt.Bool32((((z >= zEnd) && (nDigits > 0)) && (eValid != 0)) && (nonNum == 0)))
+ return (libc.Bool32((((z >= zEnd) && (nDigits > 0)) && (eValid != 0)) && (nonNum == 0)))
}
// tointeger(X): If X is any value (integer, double, blob, or string) that
// can be losslessly converted into an integer, then make the conversion and
// return the result. Otherwise, return NULL.
-func tointegerFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* totype.c:358:13: */
+func tointegerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* totype.c:358:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -25657,9 +29278,9 @@ func tointegerFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
for i = 0; uint64(i) < uint64(unsafe.Sizeof(sqlite3_int64(0))); i++ {
*(*uint8)(unsafe.Pointer(bp /* &zBlobRev[0] */ + uintptr(i))) = *(*uint8)(unsafe.Pointer(zBlob + uintptr(((uint64(unsafe.Sizeof(sqlite3_int64(0))) - uint64(1)) - uint64(i)))))
}
- crt.Xmemcpy(tls, bp+8 /* &iVal */, bp /* &zBlobRev[0] */, uint64(unsafe.Sizeof(sqlite3_int64(0))))
+ libc.Xmemcpy(tls, bp+8 /* &iVal */, bp /* &zBlobRev[0] */, uint64(unsafe.Sizeof(sqlite3_int64(0))))
} else {
- crt.Xmemcpy(tls, bp+8 /* &iVal */, zBlob, uint64(unsafe.Sizeof(sqlite3_int64(0))))
+ libc.Xmemcpy(tls, bp+8 /* &iVal */, zBlob, uint64(unsafe.Sizeof(sqlite3_int64(0))))
}
sqlite3.Xsqlite3_result_int64(tls, context, *(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* iVal */)))
}
@@ -25692,7 +29313,7 @@ func tointegerFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
// toreal(X): If X is any value (integer, double, blob, or string) that can
// be losslessly converted into a real number, then do so and return that
// real number. Otherwise return NULL.
-func torealFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* totype.c:428:13: */
+func torealFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* totype.c:428:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -25727,9 +29348,9 @@ func torealFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* to
for i = 0; uint64(i) < uint64(unsafe.Sizeof(float64(0))); i++ {
*(*uint8)(unsafe.Pointer(bp /* &zBlobRev[0] */ + uintptr(i))) = *(*uint8)(unsafe.Pointer(zBlob + uintptr(((uint64(unsafe.Sizeof(float64(0))) - uint64(1)) - uint64(i)))))
}
- crt.Xmemcpy(tls, bp+8 /* &rVal */, bp /* &zBlobRev[0] */, uint64(unsafe.Sizeof(float64(0))))
+ libc.Xmemcpy(tls, bp+8 /* &rVal */, bp /* &zBlobRev[0] */, uint64(unsafe.Sizeof(float64(0))))
} else {
- crt.Xmemcpy(tls, bp+8 /* &rVal */, zBlob, uint64(unsafe.Sizeof(float64(0))))
+ libc.Xmemcpy(tls, bp+8 /* &rVal */, zBlob, uint64(unsafe.Sizeof(float64(0))))
}
sqlite3.Xsqlite3_result_double(tls, context, *(*float64)(unsafe.Pointer(bp + 8 /* rVal */)))
}
@@ -25760,21 +29381,21 @@ func torealFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* to
}
}
-func sqlite3_totype_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* totype.c:497:5: */
+func sqlite3_totype_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* totype.c:497:5: */
var rc int32 = 0
_ = pApi
_ = pzErrMsg // Unused parameter
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+6414 /* "tointeger" */, 1,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7699 /* "tointeger" */, 1,
((1 | 0x000000800) | 0x000200000), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{tointegerFunc})), uintptr(0), uintptr(0))
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+6424 /* "toreal" */, 1,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7709 /* "toreal" */, 1,
((1 | 0x000000800) | 0x000200000), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{torealFunc})), uintptr(0), uintptr(0))
}
return rc
@@ -25890,13 +29511,13 @@ type UnionSrc = UnionSrc1 /* unionvtab.c:183:25 */
// a pointer to nByte bytes of zeroed memory. If the memory allocation
// is attempted but fails, NULL is returned and *pRc is set to
// SQLITE_NOMEM.
-func unionMalloc(tls *crt.TLS, pRc uintptr, nByte sqlite3_int64) uintptr { /* unionvtab.c:253:13: */
+func unionMalloc(tls *libc.TLS, pRc uintptr, nByte sqlite3_int64) uintptr { /* unionvtab.c:253:13: */
var pRet uintptr
if *(*int32)(unsafe.Pointer(pRc)) == 0 {
pRet = sqlite3.Xsqlite3_malloc64(tls, uint64(nByte))
if pRet != 0 {
- crt.Xmemset(tls, pRet, 0, size_t(nByte))
+ libc.Xmemset(tls, pRet, 0, size_t(nByte))
} else {
*(*int32)(unsafe.Pointer(pRc)) = 7
}
@@ -25911,13 +29532,13 @@ func unionMalloc(tls *crt.TLS, pRc uintptr, nByte sqlite3_int64) uintptr { /* un
// a copy of the nul-terminated string passed as the second argument.
// If the allocation is attempted but fails, NULL is returned and *pRc is
// set to SQLITE_NOMEM.
-func unionStrdup(tls *crt.TLS, pRc uintptr, zIn uintptr) uintptr { /* unionvtab.c:276:13: */
+func unionStrdup(tls *libc.TLS, pRc uintptr, zIn uintptr) uintptr { /* unionvtab.c:276:13: */
var zRet uintptr = uintptr(0)
if zIn != 0 {
- var nByte sqlite3_int64 = (sqlite3_int64(crt.Xstrlen(tls, zIn) + uint64(1)))
+ var nByte sqlite3_int64 = (sqlite3_int64(libc.Xstrlen(tls, zIn) + uint64(1)))
zRet = unionMalloc(tls, pRc, nByte)
if zRet != 0 {
- crt.Xmemcpy(tls, zRet, zIn, size_t(nByte))
+ libc.Xmemcpy(tls, zRet, zIn, size_t(nByte))
}
}
return zRet
@@ -25930,7 +29551,7 @@ func unionStrdup(tls *crt.TLS, pRc uintptr, zIn uintptr) uintptr { /* unionvtab.
//
// If the first character of the input is not an open quote, then this
// function is a no-op.
-func unionDequote(tls *crt.TLS, z uintptr) { /* unionvtab.c:297:13: */
+func unionDequote(tls *libc.TLS, z uintptr) { /* unionvtab.c:297:13: */
if z != 0 {
var q int8 = *(*int8)(unsafe.Pointer(z + uintptr(0)))
@@ -25952,10 +29573,10 @@ func unionDequote(tls *crt.TLS, z uintptr) { /* unionvtab.c:297:13: */
// the input cursor past both and copy a single quote character
// to the output buffer.
iIn = iIn + (2)
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&iOut, 1)))) = q
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = q
}
} else {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&iIn, 1))))
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iIn, 1))))
}
}
*(*int8)(unsafe.Pointer(z + uintptr(iOut))) = int8(0)
@@ -25974,7 +29595,7 @@ func unionDequote(tls *crt.TLS, z uintptr) { /* unionvtab.c:297:13: */
// compilation fails, NULL is returned, *pRc is set to an SQLite error
// code and *pzErr may be set to an error message buffer allocated by
// sqlite3_malloc().
-func unionPrepare(tls *crt.TLS, pRc uintptr, db uintptr, zSql uintptr, pzErr uintptr) uintptr { /* unionvtab.c:341:21: */
+func unionPrepare(tls *libc.TLS, pRc uintptr, db uintptr, zSql uintptr, pzErr uintptr) uintptr { /* unionvtab.c:341:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -25983,7 +29604,7 @@ func unionPrepare(tls *crt.TLS, pRc uintptr, db uintptr, zSql uintptr, pzErr uin
if *(*int32)(unsafe.Pointer(pRc)) == 0 {
var rc int32 = sqlite3.Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+8 /* &pRet */, uintptr(0))
if rc != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+6431 /* "sql error: %s" */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7716 /* "sql error: %s" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, db)))
*(*int32)(unsafe.Pointer(pRc)) = rc
}
}
@@ -25992,7 +29613,7 @@ func unionPrepare(tls *crt.TLS, pRc uintptr, db uintptr, zSql uintptr, pzErr uin
// Like unionPrepare(), except prepare the results of vprintf(zFmt, ...)
// instead of a constant SQL string.
-func unionPreparePrintf(tls *crt.TLS, pRc uintptr, pzErr uintptr, db uintptr, zFmt uintptr, va uintptr) uintptr { /* unionvtab.c:363:21: */
+func unionPreparePrintf(tls *libc.TLS, pRc uintptr, pzErr uintptr, db uintptr, zFmt uintptr, va uintptr) uintptr { /* unionvtab.c:363:21: */
var pRet uintptr = uintptr(0)
var zSql uintptr
var ap va_list
@@ -26022,7 +29643,7 @@ func unionPreparePrintf(tls *crt.TLS, pRc uintptr, pzErr uintptr, db uintptr, zF
// Call sqlite3_finalize() on SQL statement pStmt. If *pRc is set to
// SQLITE_OK when this function is called, then it is set to the
// value returned by sqlite3_finalize() before this function exits.
-func unionFinalize(tls *crt.TLS, pRc uintptr, pStmt uintptr, pzErr uintptr) { /* unionvtab.c:414:13: */
+func unionFinalize(tls *libc.TLS, pRc uintptr, pStmt uintptr, pzErr uintptr) { /* unionvtab.c:414:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -26031,7 +29652,7 @@ func unionFinalize(tls *crt.TLS, pRc uintptr, pStmt uintptr, pzErr uintptr) { /*
if *(*int32)(unsafe.Pointer(pRc)) == 0 {
*(*int32)(unsafe.Pointer(pRc)) = rc
if rc != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, db)))
}
}
}
@@ -26044,7 +29665,7 @@ func unionFinalize(tls *crt.TLS, pRc uintptr, pStmt uintptr, pzErr uintptr) { /*
// case if argument pzErr is not NULL, also set (*pzErr) to an English
// language error message. The caller is responsible for eventually freeing
// any error message using sqlite3_free().
-func unionInvokeOpenClose(tls *crt.TLS, pTab uintptr, pSrc uintptr, bClose int32, pzErr uintptr) int32 { /* unionvtab.c:435:12: */
+func unionInvokeOpenClose(tls *libc.TLS, pTab uintptr, pSrc uintptr, bClose int32, pzErr uintptr) int32 { /* unionvtab.c:435:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -26056,9 +29677,9 @@ func unionInvokeOpenClose(tls *crt.TLS, pTab uintptr, pSrc uintptr, bClose int32
}
sqlite3.Xsqlite3_bind_int(tls, (*UnionTab)(unsafe.Pointer(pTab)).FpOpenClose, (2 + (*UnionTab)(unsafe.Pointer(pTab)).FbHasContext), bClose)
sqlite3.Xsqlite3_step(tls, (*UnionTab)(unsafe.Pointer(pTab)).FpOpenClose)
- if 0 != (crt.AssignInt32(&rc, sqlite3.Xsqlite3_reset(tls, (*UnionTab)(unsafe.Pointer(pTab)).FpOpenClose))) {
+ if 0 != (libc.AssignInt32(&rc, sqlite3.Xsqlite3_reset(tls, (*UnionTab)(unsafe.Pointer(pTab)).FpOpenClose))) {
if pzErr != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, (*UnionTab)(unsafe.Pointer(pTab)).Fdb)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, (*UnionTab)(unsafe.Pointer(pTab)).Fdb)))
}
}
}
@@ -26068,7 +29689,7 @@ func unionInvokeOpenClose(tls *crt.TLS, pTab uintptr, pSrc uintptr, bClose int32
// This function is a no-op for unionvtab. For swarmvtab, it attempts to
// close open database files until at most nMax are open. An SQLite error
// code is returned if an error occurs, or SQLITE_OK otherwise.
-func unionCloseSources(tls *crt.TLS, pTab uintptr, nMax int32) { /* unionvtab.c:463:13: */
+func unionCloseSources(tls *libc.TLS, pTab uintptr, nMax int32) { /* unionvtab.c:463:13: */
for ((*UnionTab)(unsafe.Pointer(pTab)).FpClosable != 0) && ((*UnionTab)(unsafe.Pointer(pTab)).FnOpen > nMax) {
var p uintptr
var pp uintptr
@@ -26085,13 +29706,13 @@ func unionCloseSources(tls *crt.TLS, pTab uintptr, nMax int32) { /* unionvtab.c:
}
// xDisconnect method.
-func unionDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* unionvtab.c:481:12: */
+func unionDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* unionvtab.c:481:12: */
if pVtab != 0 {
var pTab uintptr = pVtab
var i int32
for i = 0; i < (*UnionTab)(unsafe.Pointer(pTab)).FnSrc; i++ {
var pSrc uintptr = ((*UnionTab)(unsafe.Pointer(pTab)).FaSrc + uintptr(i)*72)
- var bHaveSrcDb int32 = (crt.Bool32((*UnionSrc)(unsafe.Pointer(pSrc)).Fdb != uintptr(0)))
+ var bHaveSrcDb int32 = (libc.Bool32((*UnionSrc)(unsafe.Pointer(pSrc)).Fdb != uintptr(0)))
sqlite3.Xsqlite3_close(tls, (*UnionSrc)(unsafe.Pointer(pSrc)).Fdb)
if bHaveSrcDb != 0 {
unionInvokeOpenClose(tls, pTab, pSrc, 1, uintptr(0))
@@ -26114,7 +29735,7 @@ func unionDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* unionvtab.c:481:12:
// return SQLITE_ERROR and set (*pzErr) to point to an English language
// error message. If the table is a rowid table and no error occurs,
// return SQLITE_OK and leave (*pzErr) unmodified.
-func unionIsIntkeyTable(tls *crt.TLS, db uintptr, pSrc uintptr, pzErr uintptr) int32 { /* unionvtab.c:512:12: */
+func unionIsIntkeyTable(tls *libc.TLS, db uintptr, pSrc uintptr, pzErr uintptr) int32 { /* unionvtab.c:512:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -26123,13 +29744,13 @@ func unionIsIntkeyTable(tls *crt.TLS, db uintptr, pSrc uintptr, pzErr uintptr) i
var rc int32
sqlite3.Xsqlite3_table_column_metadata(tls,
- db, (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb, (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab, ts+6445 /* "_rowid_" */, bp+24 /* &zType */, uintptr(0), uintptr(0), bp+32 /* &bPk */, uintptr(0))
+ db, (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb, (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab, ts+7730 /* "_rowid_" */, bp+24 /* &zType */, uintptr(0), uintptr(0), bp+32 /* &bPk */, uintptr(0))
rc = sqlite3.Xsqlite3_errcode(tls, db)
if (rc == 1) ||
- ((rc == 0) && (!(*(*int32)(unsafe.Pointer(bp + 32 /* bPk */)) != 0) || (sqlite3.Xsqlite3_stricmp(tls, ts+6453 /* "integer" */, *(*uintptr)(unsafe.Pointer(bp + 24 /* zType */))) != 0))) {
+ ((rc == 0) && (!(*(*int32)(unsafe.Pointer(bp + 32 /* bPk */)) != 0) || (sqlite3.Xsqlite3_stricmp(tls, ts+7738 /* "integer" */, *(*uintptr)(unsafe.Pointer(bp + 24 /* zType */))) != 0))) {
rc = 1
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+6461, /* "no such rowid ta..." */
- crt.VaList(bp, func() uintptr {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7746, /* "no such rowid ta..." */
+ libc.VaList(bp, func() uintptr {
if (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb != 0 {
return (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb
}
@@ -26137,7 +29758,7 @@ func unionIsIntkeyTable(tls *crt.TLS, db uintptr, pSrc uintptr, pzErr uintptr) i
}(),
func() uintptr {
if (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb != 0 {
- return ts + 6489 /* "." */
+ return ts + 7774 /* "." */
}
return ts + 488 /* "" */
}(),
@@ -26161,7 +29782,7 @@ func unionIsIntkeyTable(tls *crt.TLS, db uintptr, pSrc uintptr, pzErr uintptr) i
// cause this function to return identical strings. Is is the responsibility
// of the caller to free the returned string using sqlite3_free() when
// it is no longer required.
-func unionSourceToStr(tls *crt.TLS, pRc uintptr, pTab uintptr, pSrc uintptr, pzErr uintptr) uintptr { /* unionvtab.c:555:13: */
+func unionSourceToStr(tls *libc.TLS, pRc uintptr, pTab uintptr, pSrc uintptr, pzErr uintptr) uintptr { /* unionvtab.c:555:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -26176,7 +29797,7 @@ func unionSourceToStr(tls *crt.TLS, pRc uintptr, pTab uintptr, pSrc uintptr, pzE
*(*int32)(unsafe.Pointer(bp /* rc */)) = unionIsIntkeyTable(tls, db, pSrc, pzErr)
var pStmt uintptr = unionPrepare(tls, bp /* &rc */, db,
- ts+6491 /* "SELECT group_con..." */, pzErr)
+ ts+7776 /* "SELECT group_con..." */, pzErr)
if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
sqlite3.Xsqlite3_bind_text(tls, pStmt, 1, (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab, -1, uintptr(0))
sqlite3.Xsqlite3_bind_text(tls, pStmt, 2, (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb, -1, uintptr(0))
@@ -26198,7 +29819,7 @@ func unionSourceToStr(tls *crt.TLS, pRc uintptr, pTab uintptr, pSrc uintptr, pzE
// to point to an error message buffer allocated by sqlite3_mprintf().
// Or, if no problems regarding the source tables are detected and no
// other error occurs, SQLITE_OK is returned.
-func unionSourceCheck(tls *crt.TLS, pTab uintptr, pzErr uintptr) int32 { /* unionvtab.c:592:12: */
+func unionSourceCheck(tls *libc.TLS, pTab uintptr, pzErr uintptr) int32 { /* unionvtab.c:592:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -26210,7 +29831,7 @@ func unionSourceCheck(tls *crt.TLS, pTab uintptr, pzErr uintptr) int32 { /* unio
for i = 1; i < (*UnionTab)(unsafe.Pointer(pTab)).FnSrc; i++ {
var z uintptr = unionSourceToStr(tls, bp /* &rc */, pTab, ((*UnionTab)(unsafe.Pointer(pTab)).FaSrc + uintptr(i)*72), pzErr)
if (*(*int32)(unsafe.Pointer(bp /* rc */)) == 0) && (sqlite3.Xsqlite3_stricmp(tls, z, z0) != 0) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+6575 /* "source table sch..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7860 /* "source table sch..." */, 0)
*(*int32)(unsafe.Pointer(bp /* rc */)) = 1
}
sqlite3.Xsqlite3_free(tls, z)
@@ -26222,7 +29843,7 @@ func unionSourceCheck(tls *crt.TLS, pTab uintptr, pzErr uintptr) int32 { /* unio
// Try to open the swarmvtab database. If initially unable, invoke the
// not-found callback UDF and then try again.
-func unionOpenDatabaseInner(tls *crt.TLS, pTab uintptr, pSrc uintptr, pzErr uintptr) int32 { /* unionvtab.c:616:12: */
+func unionOpenDatabaseInner(tls *libc.TLS, pTab uintptr, pSrc uintptr, pzErr uintptr) int32 { /* unionvtab.c:616:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -26245,14 +29866,14 @@ func unionOpenDatabaseInner(tls *crt.TLS, pTab uintptr, pSrc uintptr, pzErr uint
sqlite3.Xsqlite3_bind_text(tls, (*UnionTab)(unsafe.Pointer(pTab)).FpNotFound, 2, (*UnionSrc)(unsafe.Pointer(pSrc)).FzContext, -1, uintptr(0))
}
sqlite3.Xsqlite3_step(tls, (*UnionTab)(unsafe.Pointer(pTab)).FpNotFound)
- if 0 != (crt.AssignInt32(&rc, sqlite3.Xsqlite3_reset(tls, (*UnionTab)(unsafe.Pointer(pTab)).FpNotFound))) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, (*UnionTab)(unsafe.Pointer(pTab)).Fdb)))
+ if 0 != (libc.AssignInt32(&rc, sqlite3.Xsqlite3_reset(tls, (*UnionTab)(unsafe.Pointer(pTab)).FpNotFound))) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, (*UnionTab)(unsafe.Pointer(pTab)).Fdb)))
return rc
}
rc = sqlite3.Xsqlite3_open_v2(tls, (*UnionSrc)(unsafe.Pointer(pSrc)).FzFile, (pSrc + 56 /* &.db */), openFlags, uintptr(0))
}
if rc != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+8, sqlite3.Xsqlite3_errmsg(tls, (*UnionSrc)(unsafe.Pointer(pSrc)).Fdb)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+8, sqlite3.Xsqlite3_errmsg(tls, (*UnionSrc)(unsafe.Pointer(pSrc)).Fdb)))
}
return rc
}
@@ -26272,7 +29893,7 @@ var openFlags int32 = (0x00000001 | 0x00000040) /* unionvtab.c:617:20 */
// may be set to point to an English language error message. In this case it is
// the responsibility of the caller to eventually free the error message buffer
// using sqlite3_free().
-func unionOpenDatabase(tls *crt.TLS, pTab uintptr, iSrc int32, pzErr uintptr) int32 { /* unionvtab.c:660:12: */
+func unionOpenDatabase(tls *libc.TLS, pTab uintptr, iSrc int32, pzErr uintptr) int32 { /* unionvtab.c:660:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -26289,7 +29910,7 @@ func unionOpenDatabase(tls *crt.TLS, pTab uintptr, iSrc int32, pzErr uintptr) in
(*UnionTab)(unsafe.Pointer(pTab)).FzSourceStr = z
} else {
if sqlite3.Xsqlite3_stricmp(tls, z, (*UnionTab)(unsafe.Pointer(pTab)).FzSourceStr) != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+6575 /* "source table sch..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7860 /* "source table sch..." */, 0)
*(*int32)(unsafe.Pointer(bp /* rc */)) = 1
}
sqlite3.Xsqlite3_free(tls, z)
@@ -26315,7 +29936,7 @@ func unionOpenDatabase(tls *crt.TLS, pTab uintptr, iSrc int32, pzErr uintptr) in
// the reference count for source table iTab. If the reference count was
// zero before it was incremented, also remove the source from the closable
// list.
-func unionIncrRefcount(tls *crt.TLS, pTab uintptr, iTab int32) { /* unionvtab.c:704:13: */
+func unionIncrRefcount(tls *libc.TLS, pTab uintptr, iTab int32) { /* unionvtab.c:704:13: */
if (*UnionTab)(unsafe.Pointer(pTab)).FbSwarm != 0 {
var pSrc uintptr = ((*UnionTab)(unsafe.Pointer(pTab)).FaSrc + uintptr(iTab)*72)
@@ -26336,7 +29957,7 @@ func unionIncrRefcount(tls *crt.TLS, pTab uintptr, iTab int32) { /* unionvtab.c:
// NULL when this function was called, also decrement the reference
// count on the associated source table. If this means the source tables
// refcount is now zero, add it to the closable list.
-func unionFinalizeCsrStmt(tls *crt.TLS, pCsr uintptr) int32 { /* unionvtab.c:726:12: */
+func unionFinalizeCsrStmt(tls *libc.TLS, pCsr uintptr) int32 { /* unionvtab.c:726:12: */
var rc int32 = 0
if (*UnionCsr)(unsafe.Pointer(pCsr)).FpStmt != 0 {
var pTab uintptr = (*UnionCsr)(unsafe.Pointer(pCsr)).Fbase.FpVtab
@@ -26357,14 +29978,14 @@ func unionFinalizeCsrStmt(tls *crt.TLS, pCsr uintptr) int32 { /* unionvtab.c:726
}
// Return true if the argument is a space, tab, CR or LF character.
-func union_isspace(tls *crt.TLS, c int8) int32 { /* unionvtab.c:749:12: */
- return (crt.Bool32((((int32(c) == ' ') || (int32(c) == '\n')) || (int32(c) == '\r')) || (int32(c) == '\t')))
+func union_isspace(tls *libc.TLS, c int8) int32 { /* unionvtab.c:749:12: */
+ return (libc.Bool32((((int32(c) == ' ') || (int32(c) == '\n')) || (int32(c) == '\r')) || (int32(c) == '\t')))
}
// Return true if the argument is an alphanumeric character in the
// ASCII range.
-func union_isidchar(tls *crt.TLS, c int8) int32 { /* unionvtab.c:757:12: */
- return (crt.Bool32((((int32(c) >= 'a') && (int32(c) <= 'z')) || ((int32(c) >= 'A') && (int32(c) < 'Z'))) || ((int32(c) >= '0') && (int32(c) <= '9'))))
+func union_isidchar(tls *libc.TLS, c int8) int32 { /* unionvtab.c:757:12: */
+ return (libc.Bool32((((int32(c) >= 'a') && (int32(c) <= 'z')) || ((int32(c) >= 'A') && (int32(c) < 'Z'))) || ((int32(c) >= '0') && (int32(c) <= '9'))))
}
// This function is called to handle all arguments following the first
@@ -26381,14 +30002,14 @@ func union_isidchar(tls *crt.TLS, c int8) int32 { /* unionvtab.c:757:12: */
// code. In this case *pzErr may be set to point to a buffer containing
// an English language error message. It is the responsibility of the
// caller to eventually free the buffer using sqlite3_free().
-func unionConfigureVtab(tls *crt.TLS, pRc uintptr, pTab uintptr, pStmt uintptr, nArg int32, azArg uintptr, pzErr uintptr) { /* unionvtab.c:777:13: */
+func unionConfigureVtab(tls *libc.TLS, pRc uintptr, pTab uintptr, pStmt uintptr, nArg int32, azArg uintptr, pzErr uintptr) { /* unionvtab.c:777:13: */
bp := tls.Alloc(68)
defer tls.Free(68)
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = *(*int32)(unsafe.Pointer(pRc))
var i int32
if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == 0 {
- (*UnionTab)(unsafe.Pointer(pTab)).FbHasContext = (crt.Bool32(sqlite3.Xsqlite3_column_count(tls, pStmt) > 4))
+ (*UnionTab)(unsafe.Pointer(pTab)).FbHasContext = (libc.Bool32(sqlite3.Xsqlite3_column_count(tls, pStmt) > 4))
}
for i = 0; (*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == 0) && (i < nArg); i++ {
var zArg uintptr = unionStrdup(tls, bp+64 /* &rc */, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)))
@@ -26428,47 +30049,47 @@ func unionConfigureVtab(tls *crt.TLS, pRc uintptr, pTab uintptr, pStmt uintptr,
var iParam int32 = sqlite3.Xsqlite3_bind_parameter_index(tls, pStmt, zOpt)
if iParam == 0 {
*(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls,
- ts+6604 /* "swarmvtab: no su..." */, crt.VaList(bp, zOpt))
+ ts+7889 /* "swarmvtab: no su..." */, libc.VaList(bp, zOpt))
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = 1
} else {
- *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = sqlite3.Xsqlite3_bind_text(tls, pStmt, iParam, zVal, -1, crt.UintptrFromInt32(-1))
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = sqlite3.Xsqlite3_bind_text(tls, pStmt, iParam, zVal, -1, libc.UintptrFromInt32(-1))
}
- } else if (nOpt == 7) && (0 == sqlite3.Xsqlite3_strnicmp(tls, zOpt, ts+6641 /* "maxopen" */, 7)) {
- (*UnionTab)(unsafe.Pointer(pTab)).FnMaxOpen = crt.Xatoi(tls, zVal)
+ } else if (nOpt == 7) && (0 == sqlite3.Xsqlite3_strnicmp(tls, zOpt, ts+7926 /* "maxopen" */, 7)) {
+ (*UnionTab)(unsafe.Pointer(pTab)).FnMaxOpen = libc.Xatoi(tls, zVal)
if (*UnionTab)(unsafe.Pointer(pTab)).FnMaxOpen <= 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+6649 /* "swarmvtab: illeg..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7934 /* "swarmvtab: illeg..." */, 0)
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = 1
}
- } else if (nOpt == 7) && (0 == sqlite3.Xsqlite3_strnicmp(tls, zOpt, ts+6682 /* "missing" */, 7)) {
+ } else if (nOpt == 7) && (0 == sqlite3.Xsqlite3_strnicmp(tls, zOpt, ts+7967 /* "missing" */, 7)) {
if (*UnionTab)(unsafe.Pointer(pTab)).FpNotFound != 0 {
*(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls,
- ts+6690 /* "swarmvtab: dupli..." */, 0)
+ ts+7975 /* "swarmvtab: dupli..." */, 0)
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = 1
} else {
(*UnionTab)(unsafe.Pointer(pTab)).FpNotFound = unionPreparePrintf(tls, bp+64 /* &rc */, pzErr, (*UnionTab)(unsafe.Pointer(pTab)).Fdb,
- ts+6728 /* "SELECT \"%w\"(?%s)" */, crt.VaList(bp+8, zVal, func() uintptr {
+ ts+8013 /* "SELECT \"%w\"(?%s)" */, libc.VaList(bp+8, zVal, func() uintptr {
if (*UnionTab)(unsafe.Pointer(pTab)).FbHasContext != 0 {
- return ts + 6745 /* ",?" */
+ return ts + 8030 /* ",?" */
}
return ts + 488 /* "" */
}()))
}
- } else if (nOpt == 9) && (0 == sqlite3.Xsqlite3_strnicmp(tls, zOpt, ts+6748 /* "openclose" */, 9)) {
+ } else if (nOpt == 9) && (0 == sqlite3.Xsqlite3_strnicmp(tls, zOpt, ts+8033 /* "openclose" */, 9)) {
if (*UnionTab)(unsafe.Pointer(pTab)).FpOpenClose != 0 {
*(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls,
- ts+6758 /* "swarmvtab: dupli..." */, 0)
+ ts+8043 /* "swarmvtab: dupli..." */, 0)
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = 1
} else {
(*UnionTab)(unsafe.Pointer(pTab)).FpOpenClose = unionPreparePrintf(tls, bp+64 /* &rc */, pzErr, (*UnionTab)(unsafe.Pointer(pTab)).Fdb,
- ts+6798 /* "SELECT \"%w\"(?,?%..." */, crt.VaList(bp+24, zVal, func() uintptr {
+ ts+8083 /* "SELECT \"%w\"(?,?%..." */, libc.VaList(bp+24, zVal, func() uintptr {
if (*UnionTab)(unsafe.Pointer(pTab)).FbHasContext != 0 {
- return ts + 6745 /* ",?" */
+ return ts + 8030 /* ",?" */
}
return ts + 488 /* "" */
}()))
}
} else {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+6817 /* "swarmvtab: unrec..." */, crt.VaList(bp+40, zOpt))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8102 /* "swarmvtab: unrec..." */, libc.VaList(bp+40, zOpt))
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = 1
}
sqlite3.Xsqlite3_free(tls, zVal)
@@ -26476,9 +30097,9 @@ func unionConfigureVtab(tls *crt.TLS, pRc uintptr, pTab uintptr, pStmt uintptr,
} else {
if (i == 0) && (nArg == 1) {
(*UnionTab)(unsafe.Pointer(pTab)).FpNotFound = unionPreparePrintf(tls, bp+64 /* &rc */, pzErr, (*UnionTab)(unsafe.Pointer(pTab)).Fdb,
- ts+6852 /* "SELECT \"%w\"(?)" */, crt.VaList(bp+48, zArg))
+ ts+8137 /* "SELECT \"%w\"(?)" */, libc.VaList(bp+48, zArg))
} else {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+6867 /* "swarmvtab: parse..." */, crt.VaList(bp+56, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8152 /* "swarmvtab: parse..." */, libc.VaList(bp+56, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))))
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = 1
}
}
@@ -26497,7 +30118,7 @@ func unionConfigureVtab(tls *crt.TLS, pRc uintptr, pTab uintptr, pStmt uintptr,
// argv[2] -> table name
// argv[3] -> SQL statement
// argv[4] -> not-found callback UDF name
-func unionConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* unionvtab.c:883:12: */
+func unionConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* unionvtab.c:883:12: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -26511,17 +30132,17 @@ func unionConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintp
}()
var zVtab uintptr = func() uintptr {
if bSwarm != 0 {
- return ts + 6894 /* "swarmvtab" */
+ return ts + 8179 /* "swarmvtab" */
}
- return ts + 6904 /* "unionvtab" */
+ return ts + 8189 /* "unionvtab" */
}()
- if sqlite3.Xsqlite3_stricmp(tls, ts+6914 /* "temp" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))) != 0 {
+ if sqlite3.Xsqlite3_stricmp(tls, ts+8199 /* "temp" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))) != 0 {
// unionvtab tables may only be created in the temp schema
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+6919 /* "%s tables must b..." */, crt.VaList(bp, zVtab))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8204 /* "%s tables must b..." */, libc.VaList(bp, zVtab))
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
} else if (argc < 4) || ((argc > 4) && (bSwarm == 0)) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+6960 /* "wrong number of ..." */, crt.VaList(bp+8, zVtab))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8245 /* "wrong number of ..." */, libc.VaList(bp+8, zVtab))
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
} else {
var nAlloc int32 = 0 // Allocated size of pTab->aSrc[]
@@ -26534,7 +30155,7 @@ func unionConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintp
// and that the UnionTab.aSrc[] array is always sorted by rowid.
unionDequote(tls, zArg)
pStmt = unionPreparePrintf(tls, bp+40 /* &rc */, pzErr, db,
- ts+6993 /* "SELECT * FROM (%..." */, crt.VaList(bp+16, zArg))
+ ts+8278 /* "SELECT * FROM (%..." */, libc.VaList(bp+16, zArg))
// Allocate the UnionTab structure
pTab = unionMalloc(tls, bp+40 /* &rc */, int64(unsafe.Sizeof(UnionTab{})))
@@ -26573,7 +30194,7 @@ func unionConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintp
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 7
break
} else {
- crt.Xmemset(tls, (aNew + uintptr((*UnionTab)(unsafe.Pointer(pTab)).FnSrc)*72), 0, ((uint64(nNew - (*UnionTab)(unsafe.Pointer(pTab)).FnSrc)) * uint64(unsafe.Sizeof(UnionSrc{}))))
+ libc.Xmemset(tls, (aNew + uintptr((*UnionTab)(unsafe.Pointer(pTab)).FnSrc)*72), 0, ((uint64(nNew - (*UnionTab)(unsafe.Pointer(pTab)).FnSrc)) * uint64(unsafe.Sizeof(UnionSrc{}))))
(*UnionTab)(unsafe.Pointer(pTab)).FaSrc = aNew
nAlloc = nNew
}
@@ -26581,12 +30202,12 @@ func unionConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintp
// Check for problems with the specified range of rowids
if (iMax < iMin) || (((*UnionTab)(unsafe.Pointer(pTab)).FnSrc > 0) && (iMin <= (*UnionSrc)(unsafe.Pointer((*UnionTab)(unsafe.Pointer(pTab)).FaSrc+uintptr(((*UnionTab)(unsafe.Pointer(pTab)).FnSrc-1))*72)).FiMax)) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7023 /* "rowid range mism..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8308 /* "rowid range mism..." */, 0)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
}
if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0 {
- pSrc = ((*UnionTab)(unsafe.Pointer(pTab)).FaSrc + uintptr(crt.PostIncInt32(&(*UnionTab)(unsafe.Pointer(pTab)).FnSrc, 1))*72)
+ pSrc = ((*UnionTab)(unsafe.Pointer(pTab)).FaSrc + uintptr(libc.PostIncInt32(&(*UnionTab)(unsafe.Pointer(pTab)).FnSrc, 1))*72)
(*UnionSrc)(unsafe.Pointer(pSrc)).FzTab = unionStrdup(tls, bp+40 /* &rc */, zTab)
(*UnionSrc)(unsafe.Pointer(pSrc)).FiMin = iMin
(*UnionSrc)(unsafe.Pointer(pSrc)).FiMax = iMax
@@ -26608,7 +30229,7 @@ func unionConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintp
// because there is no way to determine the schema of the virtual
// table in this case.
if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0) && ((*UnionTab)(unsafe.Pointer(pTab)).FnSrc == 0) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7050 /* "no source tables..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8335 /* "no source tables..." */, 0)
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
}
@@ -26634,8 +30255,8 @@ func unionConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintp
}()
pStmt = unionPreparePrintf(tls, bp+40 /* &rc */, pzErr, tdb,
- ts+7078, /* "SELECT 'CREATE T..." */
- crt.VaList(bp+24, (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab, (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb))
+ ts+8363, /* "SELECT 'CREATE T..." */
+ libc.VaList(bp+24, (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab, (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb))
}
if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0) && (100 == sqlite3.Xsqlite3_step(tls, pStmt)) {
var zDecl uintptr = sqlite3.Xsqlite3_column_text(tls, pStmt, 0)
@@ -26656,7 +30277,7 @@ func unionConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintp
}
// xOpen
-func unionOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* unionvtab.c:1033:12: */
+func unionOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* unionvtab.c:1033:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -26669,7 +30290,7 @@ func unionOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* unionvtab.c
}
// xClose
-func unionClose(tls *crt.TLS, cur uintptr) int32 { /* unionvtab.c:1045:12: */
+func unionClose(tls *libc.TLS, cur uintptr) int32 { /* unionvtab.c:1045:12: */
var pCsr uintptr = cur
unionFinalizeCsrStmt(tls, pCsr)
sqlite3.Xsqlite3_free(tls, pCsr)
@@ -26679,7 +30300,7 @@ func unionClose(tls *crt.TLS, cur uintptr) int32 { /* unionvtab.c:1045:12: */
// This function does the work of the xNext() method. Except that, if it
// returns SQLITE_ROW, it should be called again within the same xNext()
// method call. See unionNext() for details.
-func doUnionNext(tls *crt.TLS, pCsr uintptr) int32 { /* unionvtab.c:1057:12: */
+func doUnionNext(tls *libc.TLS, pCsr uintptr) int32 { /* unionvtab.c:1057:12: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -26696,13 +30317,13 @@ func doUnionNext(tls *crt.TLS, pCsr uintptr) int32 { /* unionvtab.c:1057:12: */
// It is necessary to scan the next table.
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = unionOpenDatabase(tls, pTab, (*UnionCsr)(unsafe.Pointer(pCsr)).FiTab, (pTab /* &.base */ + 16 /* &.zErrMsg */))
(*UnionCsr)(unsafe.Pointer(pCsr)).FpStmt = unionPreparePrintf(tls, bp+24 /* &rc */, (pTab /* &.base */ + 16 /* &.zErrMsg */), (*UnionSrc)(unsafe.Pointer(pSrc)).Fdb,
- ts+7256, /* "SELECT rowid, * ..." */
- crt.VaList(bp, (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab,
+ ts+8541, /* "SELECT rowid, * ..." */
+ libc.VaList(bp, (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab,
func() uintptr {
if (*UnionSrc)(unsafe.Pointer(pSrc)).FiMax > (*UnionCsr)(unsafe.Pointer(pCsr)).FiMaxRowid {
- return ts + 7288 /* "WHERE _rowid_ <=" */
+ return ts + 8573 /* "WHERE _rowid_ <=" */
}
- return ts + 7305 /* "-- " */
+ return ts + 8590 /* "-- " */
}(),
(*UnionCsr)(unsafe.Pointer(pCsr)).FiMaxRowid))
if *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == 0 {
@@ -26719,7 +30340,7 @@ func doUnionNext(tls *crt.TLS, pCsr uintptr) int32 { /* unionvtab.c:1057:12: */
}
// xNext
-func unionNext(tls *crt.TLS, cur uintptr) int32 { /* unionvtab.c:1092:12: */
+func unionNext(tls *libc.TLS, cur uintptr) int32 { /* unionvtab.c:1092:12: */
var rc int32
for ok := true; ok; ok = (rc == 100) {
rc = doUnionNext(tls, cur)
@@ -26728,27 +30349,27 @@ func unionNext(tls *crt.TLS, cur uintptr) int32 { /* unionvtab.c:1092:12: */
}
// xColumn
-func unionColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* unionvtab.c:1103:12: */
+func unionColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* unionvtab.c:1103:12: */
var pCsr uintptr = cur
sqlite3.Xsqlite3_result_value(tls, ctx, sqlite3.Xsqlite3_column_value(tls, (*UnionCsr)(unsafe.Pointer(pCsr)).FpStmt, (i+1)))
return 0
}
// xRowid
-func unionRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* unionvtab.c:1116:12: */
+func unionRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* unionvtab.c:1116:12: */
var pCsr uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = sqlite3.Xsqlite3_column_int64(tls, (*UnionCsr)(unsafe.Pointer(pCsr)).FpStmt, 0)
return 0
}
// xEof
-func unionEof(tls *crt.TLS, cur uintptr) int32 { /* unionvtab.c:1125:12: */
+func unionEof(tls *libc.TLS, cur uintptr) int32 { /* unionvtab.c:1125:12: */
var pCsr uintptr = cur
- return (crt.Bool32((*UnionCsr)(unsafe.Pointer(pCsr)).FpStmt == uintptr(0)))
+ return (libc.Bool32((*UnionCsr)(unsafe.Pointer(pCsr)).FpStmt == uintptr(0)))
}
// xFilter
-func unionFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* unionvtab.c:1133:12: */
+func unionFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* unionvtab.c:1133:12: */
bp := tls.Alloc(108)
defer tls.Free(108)
@@ -26766,7 +30387,7 @@ func unionFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr
if idxNum == 2 {
- iMin = crt.AssignInt64(&iMax, sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
+ iMin = libc.AssignInt64(&iMax, sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
} else {
if (idxNum & (8 | 16)) != 0 {
@@ -26805,14 +30426,14 @@ func unionFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr
continue
}
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+7309 /* "%z%sSELECT rowid..." */, crt.VaList(bp, zSql, func() uintptr {
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+8594 /* "%z%sSELECT rowid..." */, libc.VaList(bp, zSql, func() uintptr {
if zSql != 0 {
- return ts + 7343 /* " UNION ALL " */
+ return ts + 8628 /* " UNION ALL " */
}
return ts + 488 /* "" */
}(), func() uintptr {
if (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb != 0 {
- return ts + 4030 /* "'" */
+ return ts + 5315 /* "'" */
}
return ts + 488 /* "" */
}(), func() uintptr {
@@ -26822,7 +30443,7 @@ func unionFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr
return ts + 488 /* "" */
}(), func() uintptr {
if (*UnionSrc)(unsafe.Pointer(pSrc)).FzDb != 0 {
- return ts + 4032 /* "'." */
+ return ts + 5317 /* "'." */
}
return ts + 488 /* "" */
}(), (*UnionSrc)(unsafe.Pointer(pSrc)).FzTab))
@@ -26832,15 +30453,15 @@ func unionFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr
}
if iMin == iMax {
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+7355 /* "%z WHERE rowid=%..." */, crt.VaList(bp+48, zSql, iMin))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+8640 /* "%z WHERE rowid=%..." */, libc.VaList(bp+48, zSql, iMin))
} else {
- var zWhere uintptr = ts + 7375 /* "WHERE" */
+ var zWhere uintptr = ts + 8660 /* "WHERE" */
if (iMin != ((int64(-1)) - (int64(0xffffffff) | (sqlite3_int64((int64(0x7fffffff))) << 32)))) && (iMin > (*UnionSrc)(unsafe.Pointer(pSrc)).FiMin) {
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+7381 /* "%z WHERE rowid>=..." */, crt.VaList(bp+64, zSql, iMin))
- zWhere = ts + 7402 /* "AND" */
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+8666 /* "%z WHERE rowid>=..." */, libc.VaList(bp+64, zSql, iMin))
+ zWhere = ts + 8687 /* "AND" */
}
if (iMax != (int64(0xffffffff) | (sqlite3_int64((int64(0x7fffffff))) << 32))) && (iMax < (*UnionSrc)(unsafe.Pointer(pSrc)).FiMax) {
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+7406 /* "%z %s rowid<=%ll..." */, crt.VaList(bp+80, zSql, zWhere, iMax))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+8691 /* "%z %s rowid<=%ll..." */, libc.VaList(bp+80, zSql, zWhere, iMax))
}
}
@@ -26889,7 +30510,7 @@ func unionFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr
// INDEX_CONSTRAINT_GT bit is set in idxNum. The rhs of the >= or > operator
// is passed as either the first or second argument to xFilter, depending
// on whether or not there is also a LT|LE constraint.
-func unionBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* unionvtab.c:1266:12: */
+func unionBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* unionvtab.c:1266:12: */
var pTab uintptr = tab
var iEq int32 = -1
var iLt int32 = -1
@@ -26932,13 +30553,13 @@ func unionBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* unio
var nRow sqlite3_int64 = int64(1000000)
if iLt >= 0 {
nRow = (nRow / int64(2))
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iLt)*8)).FargvIndex = crt.PostIncInt32(&iCons, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iLt)*8)).FargvIndex = libc.PostIncInt32(&iCons, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iLt)*8)).Fomit = uint8(1)
idxNum = idxNum | (int32((*sqlite3_index_constraint)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iLt)*12)).Fop))
}
if iGt >= 0 {
nRow = (nRow / int64(2))
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iGt)*8)).FargvIndex = crt.PostIncInt32(&iCons, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iGt)*8)).FargvIndex = libc.PostIncInt32(&iCons, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iGt)*8)).Fomit = uint8(1)
idxNum = idxNum | (int32((*sqlite3_index_constraint)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iGt)*12)).Fop))
}
@@ -26951,12 +30572,12 @@ func unionBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* unio
}
// Register the unionvtab virtual table module with database handle db.
-func createUnionVtab(tls *crt.TLS, db uintptr) int32 { /* unionvtab.c:1329:12: */
+func createUnionVtab(tls *libc.TLS, db uintptr) int32 { /* unionvtab.c:1329:12: */
var rc int32
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+6904 /* "unionvtab" */, uintptr(unsafe.Pointer(&unionModule)), uintptr(0))
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+8189 /* "unionvtab" */, uintptr(unsafe.Pointer(&unionModule)), uintptr(0))
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+6894 /* "swarmvtab" */, uintptr(unsafe.Pointer(&unionModule)), db)
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+8179 /* "swarmvtab" */, uintptr(unsafe.Pointer(&unionModule)), db)
}
return rc
}
@@ -26983,7 +30604,7 @@ uintptr(0), FxShadowName:// xRollbackTo
uintptr(0), // xShadowName
} /* unionvtab.c:1330:25 */
-func sqlite3_unionvtab_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* unionvtab.c:1370:5: */
+func sqlite3_unionvtab_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* unionvtab.c:1370:5: */
var rc int32 = 0
_ = pApi
@@ -27003,22 +30624,22 @@ type wholenumber_cursor1 = struct {
type wholenumber_cursor = wholenumber_cursor1 /* wholenumber.c:34:35 */
// Methods for the wholenumber module
-func wholenumberConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* wholenumber.c:42:12: */
+func wholenumberConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* wholenumber.c:42:12: */
var pNew uintptr
- pNew = crt.AssignPtrUintptr(ppVtab, sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(sqlite3_vtab{}))))
+ pNew = libc.AssignPtrUintptr(ppVtab, sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(sqlite3_vtab{}))))
if pNew == uintptr(0) {
return 7
}
- sqlite3.Xsqlite3_declare_vtab(tls, db, ts+7424 /* "CREATE TABLE x(v..." */)
+ sqlite3.Xsqlite3_declare_vtab(tls, db, ts+8709 /* "CREATE TABLE x(v..." */)
sqlite3.Xsqlite3_vtab_config(tls, db, 2, 0)
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(sqlite3_vtab{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(sqlite3_vtab{})))
return 0
}
// Note that for this virtual table, the xCreate and xConnect
// methods are identical.
-func wholenumberDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* wholenumber.c:60:12: */
+func wholenumberDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* wholenumber.c:60:12: */
sqlite3.Xsqlite3_free(tls, pVtab)
return 0
}
@@ -27026,39 +30647,39 @@ func wholenumberDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* wholenumber.c
// The xDisconnect and xDestroy methods are also the same
// Open a new wholenumber cursor.
-func wholenumberOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* wholenumber.c:70:12: */
+func wholenumberOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* wholenumber.c:70:12: */
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(wholenumber_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(wholenumber_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(wholenumber_cursor{})))
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
return 0
}
// Close a wholenumber cursor.
-func wholenumberClose(tls *crt.TLS, cur uintptr) int32 { /* wholenumber.c:82:12: */
+func wholenumberClose(tls *libc.TLS, cur uintptr) int32 { /* wholenumber.c:82:12: */
sqlite3.Xsqlite3_free(tls, cur)
return 0
}
// Advance a cursor to its next row of output
-func wholenumberNext(tls *crt.TLS, cur uintptr) int32 { /* wholenumber.c:91:12: */
+func wholenumberNext(tls *libc.TLS, cur uintptr) int32 { /* wholenumber.c:91:12: */
var pCur uintptr = cur
(*wholenumber_cursor)(unsafe.Pointer(pCur)).FiValue++
return 0
}
// Return the value associated with a wholenumber.
-func wholenumberColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* wholenumber.c:100:12: */
+func wholenumberColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* wholenumber.c:100:12: */
var pCur uintptr = cur
sqlite3.Xsqlite3_result_int64(tls, ctx, (*wholenumber_cursor)(unsafe.Pointer(pCur)).FiValue)
return 0
}
// The rowid.
-func wholenumberRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* wholenumber.c:113:12: */
+func wholenumberRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* wholenumber.c:113:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*wholenumber_cursor)(unsafe.Pointer(pCur)).FiValue
return 0
@@ -27066,9 +30687,9 @@ func wholenumberRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* whol
// When the wholenumber_cursor.rLimit value is 0 or less, that is a signal
// that the cursor has nothing more to output.
-func wholenumberEof(tls *crt.TLS, cur uintptr) int32 { /* wholenumber.c:123:12: */
+func wholenumberEof(tls *libc.TLS, cur uintptr) int32 { /* wholenumber.c:123:12: */
var pCur uintptr = cur
- return (crt.Bool32(((*wholenumber_cursor)(unsafe.Pointer(pCur)).FiValue > (*wholenumber_cursor)(unsafe.Pointer(pCur)).FmxValue) || ((*wholenumber_cursor)(unsafe.Pointer(pCur)).FiValue == int64(0))))
+ return (libc.Bool32(((*wholenumber_cursor)(unsafe.Pointer(pCur)).FiValue > (*wholenumber_cursor)(unsafe.Pointer(pCur)).FmxValue) || ((*wholenumber_cursor)(unsafe.Pointer(pCur)).FiValue == int64(0))))
}
// Called to "rewind" a cursor back to the beginning so that
@@ -27087,7 +30708,7 @@ func wholenumberEof(tls *crt.TLS, cur uintptr) int32 { /* wholenumber.c:123:12:
// 6 value >= $argv0 AND value < $argv1
// 9 value > $argv0 AND value <= $argv1
// 10 value >= $argv0 AND value <= $argv1
-func wholenumberFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* wholenumber.c:146:12: */
+func wholenumberFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* wholenumber.c:146:12: */
var pCur uintptr = pVtabCursor
var v sqlite3_int64
var i int32 = 0
@@ -27117,7 +30738,7 @@ func wholenumberFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr u
// (8) value <= $value
//
// idxNum is an ORed combination of 1 or 2 with 4 or 8.
-func wholenumberBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* wholenumber.c:178:12: */
+func wholenumberBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* wholenumber.c:178:12: */
var i int32
var idxNum int32 = 0
var argvIdx int32 = 1
@@ -27161,7 +30782,7 @@ __3:
;
(*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum
if ltIdx >= 0 {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ltIdx)*8)).FargvIndex = crt.PostIncInt32(&argvIdx, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ltIdx)*8)).FargvIndex = libc.PostIncInt32(&argvIdx, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ltIdx)*8)).Fomit = uint8(1)
}
if gtIdx >= 0 {
@@ -27201,11 +30822,11 @@ uintptr(0), FxRename:// xFindMethod
uintptr(0), // xRename
} /* wholenumber.c:236:23 */
-func sqlite3_wholenumber_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* wholenumber.c:264:5: */
+func sqlite3_wholenumber_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* wholenumber.c:264:5: */
var rc int32 = 0
_ = pApi
- rc = sqlite3.Xsqlite3_create_module(tls, db, ts+7446 /* "wholenumber" */, uintptr(unsafe.Pointer(&wholenumberModule)), uintptr(0))
+ rc = sqlite3.Xsqlite3_create_module(tls, db, ts+8731 /* "wholenumber" */, uintptr(unsafe.Pointer(&wholenumberModule)), uintptr(0))
return rc
}
@@ -27877,7 +31498,7 @@ type gzFile_s = struct {
// wrapper, documented in RFC 1952, wrapped around a deflate stream.
type gzFile = uintptr /* zlib.h:1300:25 */
-type u32 = uint64 /* zipfile.c:42:23 */
+type u321 = uint64 /* zipfile.c:42:23 */
// Definitions for mode bitmasks S_IFDIR, S_IFREG and S_IFLNK.
//
@@ -27887,7 +31508,7 @@ type u32 = uint64 /* zipfile.c:42:23 */
// are also made explicit in [man stat], and (c) are part of the
// file format for zip archives.
-var ZIPFILE_SCHEMA = *(*[91]int8)(unsafe.Pointer(ts + 7458 /* "CREATE TABLE y(n..." */)) /* zipfile.c:77:19 */
+var ZIPFILE_SCHEMA = *(*[91]int8)(unsafe.Pointer(ts + 8743 /* "CREATE TABLE y(n..." */)) /* zipfile.c:77:19 */
// Magic numbers used to read and write zip files.
//
@@ -27938,8 +31559,8 @@ type ZipfileEOCD1 = struct {
FiFirstDisk u16
FnEntry u16
FnEntryTotal u16
- FnSize u32
- FiOffset u32
+ FnSize u321
+ FiOffset u321
}
// Magic numbers used to read and write zip files.
@@ -28016,16 +31637,16 @@ type ZipfileCDS1 = struct {
FiCompression u16
FmTime u16
FmDate u16
- Fcrc32 u32
- FszCompressed u32
- FszUncompressed u32
+ Fcrc32 u321
+ FszCompressed u321
+ FszUncompressed u321
FnFile u16
FnExtra u16
FnComment u16
FiDiskStart u16
FiInternalAttr u16
- FiExternalAttr u32
- FiOffset u32
+ FiExternalAttr u321
+ FiOffset u321
FzFile uintptr
}
@@ -28072,9 +31693,9 @@ type ZipfileLFH1 = struct {
FiCompression u16
FmTime u16
FmDate u16
- Fcrc32 u32
- FszCompressed u32
- FszUncompressed u32
+ Fcrc32 u321
+ FszCompressed u321
+ FszUncompressed u321
FnFile u16
FnExtra u16
_ [4]byte
@@ -28098,7 +31719,7 @@ type ZipfileLFH = ZipfileLFH1 /* zipfile.c:223:27 */
type ZipfileEntry1 = struct {
Fcds ZipfileCDS
- FmUnixTime u32
+ FmUnixTime u321
FaExtra uintptr
FiDataOff i64
FaData uintptr
@@ -28142,7 +31763,7 @@ type ZipfileTab = ZipfileTab1 /* zipfile.c:267:27 */
// Set the error message contained in context ctx to the results of
// vprintf(zFmt, ...).
-func zipfileCtxErrorMsg(tls *crt.TLS, ctx uintptr, zFmt uintptr, va uintptr) { /* zipfile.c:289:13: */
+func zipfileCtxErrorMsg(tls *libc.TLS, ctx uintptr, zFmt uintptr, va uintptr) { /* zipfile.c:289:13: */
var zMsg uintptr = uintptr(0)
var ap va_list
_ = ap
@@ -28155,7 +31776,7 @@ func zipfileCtxErrorMsg(tls *crt.TLS, ctx uintptr, zFmt uintptr, va uintptr) { /
// If string zIn is quoted, dequote it in place. Otherwise, if the string
// is not quoted, do nothing.
-func zipfileDequote(tls *crt.TLS, zIn uintptr) { /* zipfile.c:303:13: */
+func zipfileDequote(tls *libc.TLS, zIn uintptr) { /* zipfile.c:303:13: */
var q int8 = *(*int8)(unsafe.Pointer(zIn + uintptr(0)))
if (((int32(q) == '"') || (int32(q) == '\'')) || (int32(q) == '`')) || (int32(q) == '[') {
var iIn int32 = 1
@@ -28164,11 +31785,11 @@ func zipfileDequote(tls *crt.TLS, zIn uintptr) { /* zipfile.c:303:13: */
q = int8(']')
}
for *(*int8)(unsafe.Pointer(zIn + uintptr(iIn))) != 0 {
- var c int8 = *(*int8)(unsafe.Pointer(zIn + uintptr(crt.PostIncInt32(&iIn, 1))))
- if (int32(c) == int32(q)) && (int32(*(*int8)(unsafe.Pointer(zIn + uintptr(crt.PostIncInt32(&iIn, 1))))) != int32(q)) {
+ var c int8 = *(*int8)(unsafe.Pointer(zIn + uintptr(libc.PostIncInt32(&iIn, 1))))
+ if (int32(c) == int32(q)) && (int32(*(*int8)(unsafe.Pointer(zIn + uintptr(libc.PostIncInt32(&iIn, 1))))) != int32(q)) {
break
}
- *(*int8)(unsafe.Pointer(zIn + uintptr(crt.PostIncInt32(&iOut, 1)))) = c
+ *(*int8)(unsafe.Pointer(zIn + uintptr(libc.PostIncInt32(&iOut, 1)))) = c
}
*(*int8)(unsafe.Pointer(zIn + uintptr(iOut))) = int8(0)
}
@@ -28180,7 +31801,7 @@ func zipfileDequote(tls *crt.TLS, zIn uintptr) { /* zipfile.c:303:13: */
// argv[1] -> database name
// argv[2] -> table name
// argv[...] -> "column name" and other module argument fields.
-func zipfileConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* zipfile.c:326:12: */
+func zipfileConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* zipfile.c:326:12: */
var nByte int32 = (int32(uint64(unsafe.Sizeof(ZipfileTab{})) + (uint64(64 * 1024))))
var nFile int32 = 0
var zFile uintptr = uintptr(0)
@@ -28196,14 +31817,14 @@ func zipfileConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uin
//
// CREATE VIRTUAL TABLE zipfile USING zipfile();
- if ((0 != sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ts+7549 /* "zipfile" */)) && (argc < 4)) || (argc > 4) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7557 /* "zipfile construc..." */, 0)
+ if ((0 != sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ts+8834 /* "zipfile" */)) && (argc < 4)) || (argc > 4) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8842 /* "zipfile construc..." */, 0)
return 1
}
if argc > 3 {
zFile = *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))
- nFile = (int32(crt.Xstrlen(tls, zFile)) + 1)
+ nFile = (int32(libc.Xstrlen(tls, zFile)) + 1)
}
rc = sqlite3.Xsqlite3_declare_vtab(tls, db, uintptr(unsafe.Pointer(&ZIPFILE_SCHEMA)))
@@ -28212,12 +31833,12 @@ func zipfileConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uin
if pNew == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pNew, 0, (uint64(nByte + nFile)))
+ libc.Xmemset(tls, pNew, 0, (uint64(nByte + nFile)))
(*ZipfileTab)(unsafe.Pointer(pNew)).Fdb = db
(*ZipfileTab)(unsafe.Pointer(pNew)).FaBuffer = (pNew + uintptr(1)*104)
if zFile != 0 {
(*ZipfileTab)(unsafe.Pointer(pNew)).FzFile = ((*ZipfileTab)(unsafe.Pointer(pNew)).FaBuffer + uintptr((64 * 1024)))
- crt.Xmemcpy(tls, (*ZipfileTab)(unsafe.Pointer(pNew)).FzFile, zFile, uint64(nFile))
+ libc.Xmemcpy(tls, (*ZipfileTab)(unsafe.Pointer(pNew)).FzFile, zFile, uint64(nFile))
zipfileDequote(tls, (*ZipfileTab)(unsafe.Pointer(pNew)).FzFile)
}
}
@@ -28227,7 +31848,7 @@ func zipfileConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uin
}
// Free the ZipfileEntry structure indicated by the only argument.
-func zipfileEntryFree(tls *crt.TLS, p uintptr) { /* zipfile.c:380:13: */
+func zipfileEntryFree(tls *libc.TLS, p uintptr) { /* zipfile.c:380:13: */
if p != 0 {
sqlite3.Xsqlite3_free(tls, (*ZipfileEntry)(unsafe.Pointer(p)).Fcds.FzFile)
sqlite3.Xsqlite3_free(tls, p)
@@ -28236,12 +31857,12 @@ func zipfileEntryFree(tls *crt.TLS, p uintptr) { /* zipfile.c:380:13: */
// Release resources that should be freed at the end of a write
// transaction.
-func zipfileCleanupTransaction(tls *crt.TLS, pTab uintptr) { /* zipfile.c:391:13: */
+func zipfileCleanupTransaction(tls *libc.TLS, pTab uintptr) { /* zipfile.c:391:13: */
var pEntry uintptr
var pNext uintptr
if (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd != 0 {
- crt.Xfclose(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd)
+ libc.Xfclose(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd)
(*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd = uintptr(0)
}
for pEntry = (*ZipfileTab)(unsafe.Pointer(pTab)).FpFirstEntry; pEntry != 0; pEntry = pNext {
@@ -28255,14 +31876,14 @@ func zipfileCleanupTransaction(tls *crt.TLS, pTab uintptr) { /* zipfile.c:391:13
}
// This method is the destructor for zipfile vtab objects.
-func zipfileDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* zipfile.c:412:12: */
+func zipfileDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:412:12: */
zipfileCleanupTransaction(tls, pVtab)
sqlite3.Xsqlite3_free(tls, pVtab)
return 0
}
// Constructor for a new ZipfileCsr object.
-func zipfileOpen(tls *crt.TLS, p uintptr, ppCsr uintptr) int32 { /* zipfile.c:421:12: */
+func zipfileOpen(tls *libc.TLS, p uintptr, ppCsr uintptr) int32 { /* zipfile.c:421:12: */
var pTab uintptr = p
var pCsr uintptr
pCsr = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(ZipfileCsr{})))
@@ -28270,8 +31891,8 @@ func zipfileOpen(tls *crt.TLS, p uintptr, ppCsr uintptr) int32 { /* zipfile.c:42
if pCsr == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(ZipfileCsr{})))
- (*ZipfileCsr)(unsafe.Pointer(pCsr)).FiId = crt.PreIncInt64(&(*ZipfileTab)(unsafe.Pointer(pTab)).FiNextCsrid, 1)
+ libc.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(ZipfileCsr{})))
+ (*ZipfileCsr)(unsafe.Pointer(pCsr)).FiId = libc.PreIncInt64(&(*ZipfileTab)(unsafe.Pointer(pTab)).FiNextCsrid, 1)
(*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCsrNext = (*ZipfileTab)(unsafe.Pointer(pTab)).FpCsrList
(*ZipfileTab)(unsafe.Pointer(pTab)).FpCsrList = pCsr
return 0
@@ -28279,13 +31900,13 @@ func zipfileOpen(tls *crt.TLS, p uintptr, ppCsr uintptr) int32 { /* zipfile.c:42
// Reset a cursor back to the state it was in when first returned
// by zipfileOpen().
-func zipfileResetCursor(tls *crt.TLS, pCsr uintptr) { /* zipfile.c:440:13: */
+func zipfileResetCursor(tls *libc.TLS, pCsr uintptr) { /* zipfile.c:440:13: */
var p uintptr
var pNext uintptr
(*ZipfileCsr)(unsafe.Pointer(pCsr)).FbEof = u8(0)
if (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile != 0 {
- crt.Xfclose(tls, (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile)
+ libc.Xfclose(tls, (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile)
(*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile = uintptr(0)
zipfileEntryFree(tls, (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCurrent)
(*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCurrent = uintptr(0)
@@ -28298,7 +31919,7 @@ func zipfileResetCursor(tls *crt.TLS, pCsr uintptr) { /* zipfile.c:440:13: */
}
// Destructor for an ZipfileCsr.
-func zipfileClose(tls *crt.TLS, cur uintptr) int32 { /* zipfile.c:461:12: */
+func zipfileClose(tls *libc.TLS, cur uintptr) int32 { /* zipfile.c:461:12: */
var pCsr uintptr = cur
var pTab uintptr = (*ZipfileCsr)(unsafe.Pointer(pCsr)).Fbase.FpVtab
var pp uintptr
@@ -28315,7 +31936,7 @@ func zipfileClose(tls *crt.TLS, cur uintptr) int32 { /* zipfile.c:461:12: */
// Set the error message for the virtual table associated with cursor
// pCsr to the results of vprintf(zFmt, ...).
-func zipfileTableErr(tls *crt.TLS, pTab uintptr, zFmt uintptr, va uintptr) { /* zipfile.c:479:13: */
+func zipfileTableErr(tls *libc.TLS, pTab uintptr, zFmt uintptr, va uintptr) { /* zipfile.c:479:13: */
var ap va_list
_ = ap
ap = va
@@ -28323,7 +31944,7 @@ func zipfileTableErr(tls *crt.TLS, pTab uintptr, zFmt uintptr, va uintptr) { /*
(*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_vmprintf(tls, zFmt, ap)
_ = ap
}
-func zipfileCursorErr(tls *crt.TLS, pCsr uintptr, zFmt uintptr, va uintptr) { /* zipfile.c:486:13: */
+func zipfileCursorErr(tls *libc.TLS, pCsr uintptr, zFmt uintptr, va uintptr) { /* zipfile.c:486:13: */
var ap va_list
_ = ap
ap = va
@@ -28340,23 +31961,23 @@ func zipfileCursorErr(tls *crt.TLS, pCsr uintptr, zFmt uintptr, va uintptr) { /*
// to an English language error message. It is the responsibility of the
// caller to eventually free this buffer using
// sqlite3_free().
-func zipfileReadData(tls *crt.TLS, pFile uintptr, aRead uintptr, nRead int32, iOff i64, pzErrmsg uintptr) int32 { /* zipfile.c:504:12: */
+func zipfileReadData(tls *libc.TLS, pFile uintptr, aRead uintptr, nRead int32, iOff i64, pzErrmsg uintptr) int32 { /* zipfile.c:504:12: */
var n size_t
- crt.Xfseek(tls, pFile, int64(iOff), 0)
- n = crt.Xfread(tls, aRead, uint64(1), uint64(nRead), pFile)
+ libc.Xfseek(tls, pFile, int64(iOff), 0)
+ n = libc.Xfread(tls, aRead, uint64(1), uint64(nRead), pFile)
if int32(n) != nRead {
- *(*uintptr)(unsafe.Pointer(pzErrmsg)) = sqlite3.Xsqlite3_mprintf(tls, ts+7599 /* "error in fread()" */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErrmsg)) = sqlite3.Xsqlite3_mprintf(tls, ts+8884 /* "error in fread()" */, 0)
return 1
}
return 0
}
-func zipfileAppendData(tls *crt.TLS, pTab uintptr, aWrite uintptr, nWrite int32) int32 { /* zipfile.c:521:12: */
+func zipfileAppendData(tls *libc.TLS, pTab uintptr, aWrite uintptr, nWrite int32) int32 { /* zipfile.c:521:12: */
var n size_t
- crt.Xfseek(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd, int64((*ZipfileTab)(unsafe.Pointer(pTab)).FszCurrent), 0)
- n = crt.Xfwrite(tls, aWrite, uint64(1), uint64(nWrite), (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd)
+ libc.Xfseek(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd, int64((*ZipfileTab)(unsafe.Pointer(pTab)).FszCurrent), 0)
+ n = libc.Xfwrite(tls, aWrite, uint64(1), uint64(nWrite), (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd)
if int32(n) != nWrite {
- (*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+7616 /* "error in fwrite(..." */, 0)
+ (*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+8901 /* "error in fwrite(..." */, 0)
return 1
}
*(*i64)(unsafe.Pointer(pTab + 88 /* &.szCurrent */)) += (i64(nWrite))
@@ -28364,26 +31985,26 @@ func zipfileAppendData(tls *crt.TLS, pTab uintptr, aWrite uintptr, nWrite int32)
}
// Read and return a 16-bit little-endian unsigned integer from buffer aBuf.
-func zipfileGetU16(tls *crt.TLS, aBuf uintptr) u16 { /* zipfile.c:540:12: */
+func zipfileGetU16(tls *libc.TLS, aBuf uintptr) u16 { /* zipfile.c:540:12: */
return (u16((int32(*(*u8)(unsafe.Pointer(aBuf + uintptr(1)))) << 8) + int32(*(*u8)(unsafe.Pointer(aBuf + uintptr(0))))))
}
// Read and return a 32-bit little-endian unsigned integer from buffer aBuf.
-func zipfileGetU32(tls *crt.TLS, aBuf uintptr) u32 { /* zipfile.c:547:12: */
- return (((((u32(*(*u8)(unsafe.Pointer(aBuf + uintptr(3))))) << 24) +
- ((u32(*(*u8)(unsafe.Pointer(aBuf + uintptr(2))))) << 16)) +
- ((u32(*(*u8)(unsafe.Pointer(aBuf + uintptr(1))))) << 8)) +
- ((u32(*(*u8)(unsafe.Pointer(aBuf + uintptr(0))))) << 0))
+func zipfileGetU32(tls *libc.TLS, aBuf uintptr) u321 { /* zipfile.c:547:12: */
+ return (((((u321(*(*u8)(unsafe.Pointer(aBuf + uintptr(3))))) << 24) +
+ ((u321(*(*u8)(unsafe.Pointer(aBuf + uintptr(2))))) << 16)) +
+ ((u321(*(*u8)(unsafe.Pointer(aBuf + uintptr(1))))) << 8)) +
+ ((u321(*(*u8)(unsafe.Pointer(aBuf + uintptr(0))))) << 0))
}
// Write a 16-bit little endiate integer into buffer aBuf.
-func zipfilePutU16(tls *crt.TLS, aBuf uintptr, val u16) { /* zipfile.c:557:13: */
+func zipfilePutU16(tls *libc.TLS, aBuf uintptr, val u16) { /* zipfile.c:557:13: */
*(*u8)(unsafe.Pointer(aBuf + uintptr(0))) = (u8(int32(val) & 0xFF))
*(*u8)(unsafe.Pointer(aBuf + uintptr(1))) = (u8((int32(val) >> 8) & 0xFF))
}
// Write a 32-bit little endiate integer into buffer aBuf.
-func zipfilePutU32(tls *crt.TLS, aBuf uintptr, val u32) { /* zipfile.c:565:13: */
+func zipfilePutU32(tls *libc.TLS, aBuf uintptr, val u321) { /* zipfile.c:565:13: */
*(*u8)(unsafe.Pointer(aBuf + uintptr(0))) = (u8(val & uint64(0xFF)))
*(*u8)(unsafe.Pointer(aBuf + uintptr(1))) = (u8((val >> 8) & uint64(0xFF)))
*(*u8)(unsafe.Pointer(aBuf + uintptr(2))) = (u8((val >> 16) & uint64(0xFF)))
@@ -28394,9 +32015,9 @@ func zipfilePutU32(tls *crt.TLS, aBuf uintptr, val u32) { /* zipfile.c:565:13: *
// Decode the CDS record in buffer aBuf into (*pCDS). Return SQLITE_ERROR
// if the record is not well-formed, or SQLITE_OK otherwise.
-func zipfileReadCDS(tls *crt.TLS, aBuf uintptr, pCDS uintptr) int32 { /* zipfile.c:588:12: */
+func zipfileReadCDS(tls *libc.TLS, aBuf uintptr, pCDS uintptr) int32 { /* zipfile.c:588:12: */
var aRead uintptr = aBuf
- var sig u32 = func() u32 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
+ var sig u321 = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
var rc int32 = 0
if sig != uint64(0x02014b50) {
rc = 1
@@ -28407,17 +32028,17 @@ func zipfileReadCDS(tls *crt.TLS, aBuf uintptr, pCDS uintptr) int32 { /* zipfile
(*ZipfileCDS)(unsafe.Pointer(pCDS)).FiCompression = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
(*ZipfileCDS)(unsafe.Pointer(pCDS)).FmTime = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
(*ZipfileCDS)(unsafe.Pointer(pCDS)).FmDate = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
- (*ZipfileCDS)(unsafe.Pointer(pCDS)).Fcrc32 = func() u32 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
- (*ZipfileCDS)(unsafe.Pointer(pCDS)).FszCompressed = func() u32 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
- (*ZipfileCDS)(unsafe.Pointer(pCDS)).FszUncompressed = func() u32 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
+ (*ZipfileCDS)(unsafe.Pointer(pCDS)).Fcrc32 = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
+ (*ZipfileCDS)(unsafe.Pointer(pCDS)).FszCompressed = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
+ (*ZipfileCDS)(unsafe.Pointer(pCDS)).FszUncompressed = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
(*ZipfileCDS)(unsafe.Pointer(pCDS)).FnFile = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
(*ZipfileCDS)(unsafe.Pointer(pCDS)).FnExtra = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
(*ZipfileCDS)(unsafe.Pointer(pCDS)).FnComment = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
(*ZipfileCDS)(unsafe.Pointer(pCDS)).FiDiskStart = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
(*ZipfileCDS)(unsafe.Pointer(pCDS)).FiInternalAttr = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
- (*ZipfileCDS)(unsafe.Pointer(pCDS)).FiExternalAttr = func() u32 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
- (*ZipfileCDS)(unsafe.Pointer(pCDS)).FiOffset = func() u32 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
+ (*ZipfileCDS)(unsafe.Pointer(pCDS)).FiExternalAttr = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
+ (*ZipfileCDS)(unsafe.Pointer(pCDS)).FiOffset = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
}
return rc
@@ -28425,11 +32046,11 @@ func zipfileReadCDS(tls *crt.TLS, aBuf uintptr, pCDS uintptr) int32 { /* zipfile
// Decode the LFH record in buffer aBuf into (*pLFH). Return SQLITE_ERROR
// if the record is not well-formed, or SQLITE_OK otherwise.
-func zipfileReadLFH(tls *crt.TLS, aBuffer uintptr, pLFH uintptr) int32 { /* zipfile.c:622:12: */
+func zipfileReadLFH(tls *libc.TLS, aBuffer uintptr, pLFH uintptr) int32 { /* zipfile.c:622:12: */
var aRead uintptr = aBuffer
var rc int32 = 0
- var sig u32 = func() u32 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
+ var sig u321 = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
if sig != uint64(0x04034b50) {
rc = 1
} else {
@@ -28438,9 +32059,9 @@ func zipfileReadLFH(tls *crt.TLS, aBuffer uintptr, pLFH uintptr) int32 { /* zipf
(*ZipfileLFH)(unsafe.Pointer(pLFH)).FiCompression = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
(*ZipfileLFH)(unsafe.Pointer(pLFH)).FmTime = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
(*ZipfileLFH)(unsafe.Pointer(pLFH)).FmDate = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
- (*ZipfileLFH)(unsafe.Pointer(pLFH)).Fcrc32 = func() u32 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
- (*ZipfileLFH)(unsafe.Pointer(pLFH)).FszCompressed = func() u32 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
- (*ZipfileLFH)(unsafe.Pointer(pLFH)).FszUncompressed = func() u32 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
+ (*ZipfileLFH)(unsafe.Pointer(pLFH)).Fcrc32 = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
+ (*ZipfileLFH)(unsafe.Pointer(pLFH)).FszCompressed = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
+ (*ZipfileLFH)(unsafe.Pointer(pLFH)).FszUncompressed = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
(*ZipfileLFH)(unsafe.Pointer(pLFH)).FnFile = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
(*ZipfileLFH)(unsafe.Pointer(pLFH)).FnExtra = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
}
@@ -28460,7 +32081,7 @@ func zipfileReadLFH(tls *crt.TLS, aBuffer uintptr, pLFH uintptr) int32 { /* zipf
// Header ID 2 bytes
// Data Size 2 bytes
// Data N bytes
-func zipfileScanExtra(tls *crt.TLS, aExtra uintptr, nExtra int32, pmTime uintptr) int32 { /* zipfile.c:663:12: */
+func zipfileScanExtra(tls *libc.TLS, aExtra uintptr, nExtra int32, pmTime uintptr) int32 { /* zipfile.c:663:12: */
var ret int32 = 0
var p uintptr = aExtra
var pEnd uintptr = (aExtra + uintptr(nExtra))
@@ -28474,7 +32095,7 @@ func zipfileScanExtra(tls *crt.TLS, aExtra uintptr, nExtra int32, pmTime uintptr
{
var b u8 = *(*u8)(unsafe.Pointer(p + uintptr(0)))
if (int32(b) & 0x01) != 0 { // 0x01 -> modtime is present
- *(*u32)(unsafe.Pointer(pmTime)) = zipfileGetU32(tls, (p + uintptr(1)))
+ *(*u321)(unsafe.Pointer(pmTime)) = zipfileGetU32(tls, (p + uintptr(1)))
ret = 1
}
break
@@ -28502,7 +32123,7 @@ func zipfileScanExtra(tls *crt.TLS, aExtra uintptr, nExtra int32, pmTime uintptr
// Bits 09-15: years from 1980
//
// https://msdn.microsoft.com/en-us/library/9kkf9tah.aspx
-func zipfileMtime(tls *crt.TLS, pCDS uintptr) u32 { /* zipfile.c:706:12: */
+func zipfileMtime(tls *libc.TLS, pCDS uintptr) u321 { /* zipfile.c:706:12: */
var Y int32 = (1980 + ((int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FmDate) >> 9) & 0x7F))
var M int32 = ((int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FmDate) >> 5) & 0x0F)
var D int32 = (int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FmDate) & 0x1F)
@@ -28528,13 +32149,13 @@ func zipfileMtime(tls *crt.TLS, pCDS uintptr) u32 { /* zipfile.c:706:12: */
JD = JD + (i64((((hr - 12) * 3600) + (min * 60)) + sec))
// Convert JD to unix timestamp (the JD epoch is 2440587.5)
- return (u32(JD - ((((int64(24405875)) * int64(24)) * int64(60)) * int64(6))))
+ return (u321(JD - ((((int64(24405875)) * int64(24)) * int64(60)) * int64(6))))
}
// The opposite of zipfileMtime(). This function populates the mTime and
// mDate fields of the CDS structure passed as the first argument according
// to the UNIX timestamp value passed as the second.
-func zipfileMtimeToDos(tls *crt.TLS, pCds uintptr, mUnixTime u32) { /* zipfile.c:742:13: */
+func zipfileMtimeToDos(tls *libc.TLS, pCds uintptr, mUnixTime u321) { /* zipfile.c:742:13: */
// Convert unix timestamp to JD (2440588 is noon on 1/1/1970)
var JD i64 = (i64(uint64(int64(2440588)) + (uint64(mUnixTime / (uint64((24 * 60) * 60))))))
var A int32
@@ -28577,7 +32198,7 @@ func zipfileMtimeToDos(tls *crt.TLS, pCds uintptr, mUnixTime u32) { /* zipfile.c
(*ZipfileCDS)(unsafe.Pointer(pCds)).FmDate = (u16((day + (mon << 5)) + ((yr - 1980) << 9)))
(*ZipfileCDS)(unsafe.Pointer(pCds)).FmTime = (u16(((sec / 2) + (min << 5)) + (hr << 11)))
} else {
- (*ZipfileCDS)(unsafe.Pointer(pCds)).FmDate = crt.AssignPtrUint16(pCds+8 /* &.mTime */, u16(0))
+ (*ZipfileCDS)(unsafe.Pointer(pCds)).FmDate = libc.AssignPtrUint16(pCds+8 /* &.mTime */, u16(0))
}
}
@@ -28591,7 +32212,7 @@ func zipfileMtimeToDos(tls *crt.TLS, pCds uintptr, mUnixTime u32) { /* zipfile.c
// If successful, SQLITE_OK is returned and (*ppEntry) set to point to
// the new object. Otherwise, an SQLite error code is returned and the
// final value of (*ppEntry) undefined.
-func zipfileGetEntry(tls *crt.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFile uintptr, iOff i64, ppEntry uintptr) int32 { /* zipfile.c:790:12: */
+func zipfileGetEntry(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFile uintptr, iOff i64, ppEntry uintptr) int32 { /* zipfile.c:790:12: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -28623,10 +32244,10 @@ func zipfileGetEntry(tls *crt.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFi
if pNew == uintptr(0) {
rc = 7
} else {
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(ZipfileEntry{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(ZipfileEntry{})))
rc = zipfileReadCDS(tls, aRead, (pNew /* &.cds */))
if rc != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7634 /* "failed to read C..." */, crt.VaList(bp, iOff))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8919 /* "failed to read C..." */, libc.VaList(bp, iOff))
} else if aBlob == uintptr(0) {
rc = zipfileReadData(tls,
pFile, aRead, (nExtra + nFile), (iOff + int64(46)), pzErr)
@@ -28637,9 +32258,9 @@ func zipfileGetEntry(tls *crt.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFi
if rc == 0 {
var pt uintptr = (pNew + 80 /* &.mUnixTime */)
- (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FzFile = sqlite3.Xsqlite3_mprintf(tls, ts+7668 /* "%.*s" */, crt.VaList(bp+8, nFile, aRead))
+ (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FzFile = sqlite3.Xsqlite3_mprintf(tls, ts+8953 /* "%.*s" */, libc.VaList(bp+8, nFile, aRead))
(*ZipfileEntry)(unsafe.Pointer(pNew)).FaExtra = (pNew + uintptr(1)*120)
- crt.Xmemcpy(tls, (*ZipfileEntry)(unsafe.Pointer(pNew)).FaExtra, (aRead + uintptr(nFile)), uint64(nExtra))
+ libc.Xmemcpy(tls, (*ZipfileEntry)(unsafe.Pointer(pNew)).FaExtra, (aRead + uintptr(nFile)), uint64(nExtra))
if (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FzFile == uintptr(0) {
rc = 7
} else if 0 == zipfileScanExtra(tls, (aRead+uintptr(nFile)), int32((*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FnExtra), pt) {
@@ -28662,11 +32283,11 @@ func zipfileGetEntry(tls *crt.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFi
*(*i64)(unsafe.Pointer(pNew + 96 /* &.iDataOff */)) += (i64(int32((*ZipfileLFH)(unsafe.Pointer(bp+32 /* &lfh */)).FnFile) + int32((*ZipfileLFH)(unsafe.Pointer(bp+32 /* &lfh */)).FnExtra)))
if (aBlob != 0) && ((*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FszCompressed != 0) {
(*ZipfileEntry)(unsafe.Pointer(pNew)).FaData = ((*ZipfileEntry)(unsafe.Pointer(pNew)).FaExtra + uintptr(nExtra))
- crt.Xmemcpy(tls, (*ZipfileEntry)(unsafe.Pointer(pNew)).FaData, (aBlob + uintptr((*ZipfileEntry)(unsafe.Pointer(pNew)).FiDataOff)), (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FszCompressed)
+ libc.Xmemcpy(tls, (*ZipfileEntry)(unsafe.Pointer(pNew)).FaData, (aBlob + uintptr((*ZipfileEntry)(unsafe.Pointer(pNew)).FiDataOff)), (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FszCompressed)
}
} else {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7673, /* "failed to read L..." */
- crt.VaList(bp+24, int32((*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiOffset)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+8958, /* "failed to read L..." */
+ libc.VaList(bp+24, int32((*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiOffset)))
}
}
@@ -28683,7 +32304,7 @@ func zipfileGetEntry(tls *crt.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFi
var szFix int32 = 30 /* zipfile.c:852:24 */
// Advance an ZipfileCsr to its next row of output.
-func zipfileNext(tls *crt.TLS, cur uintptr) int32 { /* zipfile.c:888:12: */
+func zipfileNext(tls *libc.TLS, cur uintptr) int32 { /* zipfile.c:888:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -28719,7 +32340,7 @@ func zipfileNext(tls *crt.TLS, cur uintptr) int32 { /* zipfile.c:888:12: */
return rc
}
-func zipfileFree(tls *crt.TLS, p uintptr) { /* zipfile.c:921:13: */
+func zipfileFree(tls *libc.TLS, p uintptr) { /* zipfile.c:921:13: */
sqlite3.Xsqlite3_free(tls, p)
}
@@ -28728,7 +32349,7 @@ func zipfileFree(tls *crt.TLS, p uintptr) { /* zipfile.c:921:13: */
// return value in context pCtx to the result (a blob).
//
// If an error occurs, an error code is left in pCtx instead.
-func zipfileInflate(tls *crt.TLS, pCtx uintptr, aIn uintptr, nIn int32, nOut int32) { /* zipfile.c:932:13: */
+func zipfileInflate(tls *libc.TLS, pCtx uintptr, aIn uintptr, nIn int32, nOut int32) { /* zipfile.c:932:13: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -28739,22 +32360,22 @@ func zipfileInflate(tls *crt.TLS, pCtx uintptr, aIn uintptr, nIn int32, nOut int
var err int32
// var str z_stream at bp+16, 112
- crt.Xmemset(tls, bp+16 /* &str */, 0, uint64(unsafe.Sizeof(z_stream{})))
+ libc.Xmemset(tls, bp+16 /* &str */, 0, uint64(unsafe.Sizeof(z_stream{})))
(*z_stream)(unsafe.Pointer(bp + 16 /* &str */)).Fnext_in = aIn
(*z_stream)(unsafe.Pointer(bp + 16 /* &str */)).Favail_in = uInt(nIn)
(*z_stream)(unsafe.Pointer(bp + 16 /* &str */)).Fnext_out = aRes
(*z_stream)(unsafe.Pointer(bp + 16 /* &str */)).Favail_out = uInt(nOut)
- err = tcl.XinflateInit2_(tls, bp+16 /* &str */, -15, ts+7705 /* "1.2.11" */, int32(unsafe.Sizeof(z_stream{})))
+ err = tcl.XinflateInit2_(tls, bp+16 /* &str */, -15, ts+8990 /* "1.2.11" */, int32(unsafe.Sizeof(z_stream{})))
if err != 0 {
- zipfileCtxErrorMsg(tls, pCtx, ts+7712 /* "inflateInit2() f..." */, crt.VaList(bp, err))
+ zipfileCtxErrorMsg(tls, pCtx, ts+8997 /* "inflateInit2() f..." */, libc.VaList(bp, err))
} else {
err = tcl.Xinflate(tls, bp+16 /* &str */, 0)
if err != 1 {
- zipfileCtxErrorMsg(tls, pCtx, ts+7739 /* "inflate() failed..." */, crt.VaList(bp+8, err))
+ zipfileCtxErrorMsg(tls, pCtx, ts+9024 /* "inflate() failed..." */, libc.VaList(bp+8, err))
} else {
- sqlite3.Xsqlite3_result_blob(tls, pCtx, aRes, nOut, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{zipfileFree})))
+ sqlite3.Xsqlite3_result_blob(tls, pCtx, aRes, nOut, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{zipfileFree})))
aRes = uintptr(0)
}
}
@@ -28773,7 +32394,7 @@ func zipfileInflate(tls *crt.TLS, pCtx uintptr, aIn uintptr, nIn int32, nOut int
// code is returned and an error message left in virtual-table handle
// pTab. The values of (*ppOut) and (*pnOut) are left unchanged in this
// case.
-func zipfileDeflate(tls *crt.TLS, aIn uintptr, nIn int32, ppOut uintptr, pnOut uintptr, pzErr uintptr) int32 { /* zipfile.c:980:12: */
+func zipfileDeflate(tls *libc.TLS, aIn uintptr, nIn int32, ppOut uintptr, pnOut uintptr, pzErr uintptr) int32 { /* zipfile.c:980:12: */
bp := tls.Alloc(112)
defer tls.Free(112)
@@ -28783,10 +32404,10 @@ func zipfileDeflate(tls *crt.TLS, aIn uintptr, nIn int32, ppOut uintptr, pnOut u
var aOut uintptr
- crt.Xmemset(tls, bp /* &str */, 0, uint64(unsafe.Sizeof(z_stream{})))
+ libc.Xmemset(tls, bp /* &str */, 0, uint64(unsafe.Sizeof(z_stream{})))
(*z_stream)(unsafe.Pointer(bp /* &str */)).Fnext_in = aIn
(*z_stream)(unsafe.Pointer(bp /* &str */)).Favail_in = uInt(nIn)
- tcl.XdeflateInit2_(tls, bp /* &str */, 9, 8, -15, 8, 0, ts+7705 /* "1.2.11" */, int32(unsafe.Sizeof(z_stream{})))
+ tcl.XdeflateInit2_(tls, bp /* &str */, 9, 8, -15, 8, 0, ts+8990 /* "1.2.11" */, int32(unsafe.Sizeof(z_stream{})))
nAlloc = sqlite3_int64(tcl.XdeflateBound(tls, bp /* &str */, uint64(nIn)))
aOut = sqlite3.Xsqlite3_malloc64(tls, uint64(nAlloc))
@@ -28802,7 +32423,7 @@ func zipfileDeflate(tls *crt.TLS, aIn uintptr, nIn int32, ppOut uintptr, pnOut u
*(*int32)(unsafe.Pointer(pnOut)) = int32((*z_stream)(unsafe.Pointer(bp /* &str */)).Ftotal_out)
} else {
sqlite3.Xsqlite3_free(tls, aOut)
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7761 /* "zipfile: deflate..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+9046 /* "zipfile: deflate..." */, 0)
rc = 1
}
tcl.XdeflateEnd(tls, bp /* &str */)
@@ -28813,13 +32434,13 @@ func zipfileDeflate(tls *crt.TLS, aIn uintptr, nIn int32, ppOut uintptr, pnOut u
// Return values of columns for the row at which the series_cursor
// is currently pointing.
-func zipfileColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* zipfile.c:1023:12: */
+func zipfileColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* zipfile.c:1023:12: */
var pCsr uintptr = cur
var pCDS uintptr = ((*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCurrent /* &.cds */)
var rc int32 = 0
switch i {
case 0: // name
- sqlite3.Xsqlite3_result_text(tls, ctx, (*ZipfileCDS)(unsafe.Pointer(pCDS)).FzFile, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, (*ZipfileCDS)(unsafe.Pointer(pCDS)).FzFile, -1, libc.UintptrFromInt32(-1))
break
case 1: // mode
// TODO: Whether or not the following is correct surely depends on
@@ -28854,7 +32475,7 @@ func zipfileColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* z
if (*ZipfileEntry)(unsafe.Pointer((*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCurrent)).FaData != 0 {
aBuf = (*ZipfileEntry)(unsafe.Pointer((*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCurrent)).FaData
} else {
- aBuf = crt.AssignUintptr(&aFree, sqlite3.Xsqlite3_malloc64(tls, uint64(sz)))
+ aBuf = libc.AssignUintptr(&aFree, sqlite3.Xsqlite3_malloc64(tls, uint64(sz)))
if aBuf == uintptr(0) {
rc = 7
} else {
@@ -28870,7 +32491,7 @@ func zipfileColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* z
if (i == 5) && ((*ZipfileCDS)(unsafe.Pointer(pCDS)).FiCompression != 0) {
zipfileInflate(tls, ctx, aBuf, sz, szFinal)
} else {
- sqlite3.Xsqlite3_result_blob(tls, ctx, aBuf, sz, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_blob(tls, ctx, aBuf, sz, libc.UintptrFromInt32(-1))
}
}
sqlite3.Xsqlite3_free(tls, aFree)
@@ -28878,7 +32499,7 @@ func zipfileColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* z
// Figure out if this is a directory or a zero-sized file. Consider
// it to be a directory either if the mode suggests so, or if
// the final character in the name is '/'.
- var mode u32 = ((*ZipfileCDS)(unsafe.Pointer(pCDS)).FiExternalAttr >> 16)
+ var mode u321 = ((*ZipfileCDS)(unsafe.Pointer(pCDS)).FiExternalAttr >> 16)
if !((mode & uint64(0040000)) != 0) && (int32(*(*int8)(unsafe.Pointer((*ZipfileCDS)(unsafe.Pointer(pCDS)).FzFile + uintptr((int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FnFile) - 1))))) != '/') {
sqlite3.Xsqlite3_result_blob(tls, ctx, ts+488 /* "" */, 0, uintptr(0))
}
@@ -28899,7 +32520,7 @@ func zipfileColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* z
}
// Return TRUE if the cursor is at EOF.
-func zipfileEof(tls *crt.TLS, cur uintptr) int32 { /* zipfile.c:1110:12: */
+func zipfileEof(tls *libc.TLS, cur uintptr) int32 { /* zipfile.c:1110:12: */
var pCsr uintptr = cur
return int32((*ZipfileCsr)(unsafe.Pointer(pCsr)).FbEof)
}
@@ -28912,7 +32533,7 @@ func zipfileEof(tls *crt.TLS, cur uintptr) int32 { /* zipfile.c:1110:12: */
// and populate *pEOCD with the results of decoding it. SQLITE_OK is
// returned if successful. Otherwise, an SQLite error code is returned and
// an English language error message may be left in virtual-table pTab.
-func zipfileReadEOCD(tls *crt.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFile uintptr, pEOCD uintptr) int32 { /* zipfile.c:1125:12: */
+func zipfileReadEOCD(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFile uintptr, pEOCD uintptr) int32 { /* zipfile.c:1125:12: */
var aRead uintptr = (*ZipfileTab)(unsafe.Pointer(pTab)).FaBuffer // Temporary buffer
var nRead int32 // Bytes to read from file
var rc int32 = 0
@@ -28920,10 +32541,10 @@ func zipfileReadEOCD(tls *crt.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFi
if aBlob == uintptr(0) {
var iOff i64 // Offset to read from
var szFile i64 // Total size of file in bytes
- crt.Xfseek(tls, pFile, int64(0), 2)
- szFile = i64(crt.Xftell(tls, pFile))
+ libc.Xfseek(tls, pFile, int64(0), 2)
+ szFile = i64(libc.Xftell(tls, pFile))
if szFile == int64(0) {
- crt.Xmemset(tls, pEOCD, 0, uint64(unsafe.Sizeof(ZipfileEOCD{})))
+ libc.Xmemset(tls, pEOCD, 0, uint64(unsafe.Sizeof(ZipfileEOCD{})))
return 0
}
nRead = func() int32 {
@@ -28956,7 +32577,7 @@ func zipfileReadEOCD(tls *crt.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFi
}
if i < 0 {
(*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls,
- ts+7786 /* "cannot find end ..." */, 0)
+ ts+9071 /* "cannot find end ..." */, 0)
return 1
}
@@ -28965,8 +32586,8 @@ func zipfileReadEOCD(tls *crt.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFi
(*ZipfileEOCD)(unsafe.Pointer(pEOCD)).FiFirstDisk = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
(*ZipfileEOCD)(unsafe.Pointer(pEOCD)).FnEntry = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
(*ZipfileEOCD)(unsafe.Pointer(pEOCD)).FnEntryTotal = func() u16 { aRead += uintptr(2); return zipfileGetU16(tls, (aRead - uintptr(2))) }()
- (*ZipfileEOCD)(unsafe.Pointer(pEOCD)).FnSize = func() u32 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
- (*ZipfileEOCD)(unsafe.Pointer(pEOCD)).FiOffset = func() u32 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
+ (*ZipfileEOCD)(unsafe.Pointer(pEOCD)).FnSize = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
+ (*ZipfileEOCD)(unsafe.Pointer(pEOCD)).FiOffset = func() u321 { aRead += uintptr(4); return zipfileGetU32(tls, (aRead - uintptr(4))) }()
}
return rc
@@ -28976,11 +32597,11 @@ func zipfileReadEOCD(tls *crt.TLS, pTab uintptr, aBlob uintptr, nBlob int32, pFi
// and ends with pLastEntry. If argument pBefore is NULL, then pNew is added
// to the end of the list. Otherwise, it is added to the list immediately
// before pBefore (which is guaranteed to be a part of said list).
-func zipfileAddEntry(tls *crt.TLS, pTab uintptr, pBefore uintptr, pNew uintptr) { /* zipfile.c:1189:13: */
+func zipfileAddEntry(tls *libc.TLS, pTab uintptr, pBefore uintptr, pNew uintptr) { /* zipfile.c:1189:13: */
if pBefore == uintptr(0) {
if (*ZipfileTab)(unsafe.Pointer(pTab)).FpFirstEntry == uintptr(0) {
- (*ZipfileTab)(unsafe.Pointer(pTab)).FpFirstEntry = crt.AssignPtrUintptr(pTab+72 /* &.pLastEntry */, pNew)
+ (*ZipfileTab)(unsafe.Pointer(pTab)).FpFirstEntry = libc.AssignPtrUintptr(pTab+72 /* &.pLastEntry */, pNew)
} else {
(*ZipfileEntry)(unsafe.Pointer((*ZipfileTab)(unsafe.Pointer(pTab)).FpLastEntry)).FpNext = pNew
@@ -28995,7 +32616,7 @@ func zipfileAddEntry(tls *crt.TLS, pTab uintptr, pBefore uintptr, pNew uintptr)
}
}
-func zipfileLoadDirectory(tls *crt.TLS, pTab uintptr, aBlob uintptr, nBlob int32) int32 { /* zipfile.c:1212:12: */
+func zipfileLoadDirectory(tls *libc.TLS, pTab uintptr, aBlob uintptr, nBlob int32) int32 { /* zipfile.c:1212:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -29021,7 +32642,7 @@ func zipfileLoadDirectory(tls *crt.TLS, pTab uintptr, aBlob uintptr, nBlob int32
}
// xFilter callback.
-func zipfileFilter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* zipfile.c:1236:12: */
+func zipfileFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* zipfile.c:1236:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -29036,7 +32657,7 @@ func zipfileFilter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc
if (*ZipfileTab)(unsafe.Pointer(pTab)).FzFile != 0 {
zFile = (*ZipfileTab)(unsafe.Pointer(pTab)).FzFile
} else if idxNum == 0 {
- zipfileCursorErr(tls, pCsr, ts+7830 /* "zipfile() functi..." */, 0)
+ zipfileCursorErr(tls, pCsr, ts+9115 /* "zipfile() functi..." */, 0)
return 1
} else if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) == 4 {
var aBlob uintptr = sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
@@ -29044,7 +32665,7 @@ func zipfileFilter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc
rc = zipfileLoadDirectory(tls, pTab, aBlob, nBlob)
(*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFreeEntry = (*ZipfileTab)(unsafe.Pointer(pTab)).FpFirstEntry
- (*ZipfileTab)(unsafe.Pointer(pTab)).FpFirstEntry = crt.AssignPtrUintptr(pTab+72 /* &.pLastEntry */, uintptr(0))
+ (*ZipfileTab)(unsafe.Pointer(pTab)).FpFirstEntry = libc.AssignPtrUintptr(pTab+72 /* &.pLastEntry */, uintptr(0))
if rc != 0 {
return rc
}
@@ -29054,9 +32675,9 @@ func zipfileFilter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc
}
if (uintptr(0) == (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd) && (0 == bInMemory) {
- (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile = crt.Xfopen(tls, zFile, ts+2937 /* "rb" */)
+ (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile = libc.Xfopen(tls, zFile, ts+4086 /* "rb" */)
if (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile == uintptr(0) {
- zipfileCursorErr(tls, pCsr, ts+7870 /* "cannot open file..." */, crt.VaList(bp, zFile))
+ zipfileCursorErr(tls, pCsr, ts+9155 /* "cannot open file..." */, libc.VaList(bp, zFile))
rc = 1
} else {
rc = zipfileReadEOCD(tls, pTab, uintptr(0), 0, (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpFile, (pCsr + 40 /* &.eocd */))
@@ -29084,7 +32705,7 @@ func zipfileFilter(tls *crt.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc
}
// xBestIndex callback.
-func zipfileBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* zipfile.c:1295:12: */
+func zipfileBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* zipfile.c:1295:12: */
var i int32
var idx int32 = -1
var unusable int32 = 0
@@ -29111,15 +32732,15 @@ func zipfileBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* zi
return 0
}
-func zipfileNewEntry(tls *crt.TLS, zPath uintptr) uintptr { /* zipfile.c:1323:21: */
+func zipfileNewEntry(tls *libc.TLS, zPath uintptr) uintptr { /* zipfile.c:1323:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
var pNew uintptr
pNew = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(ZipfileEntry{})))
if pNew != 0 {
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(ZipfileEntry{})))
- (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FzFile = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, zPath))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(ZipfileEntry{})))
+ (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FzFile = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, zPath))
if (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FzFile == uintptr(0) {
sqlite3.Xsqlite3_free(tls, pNew)
pNew = uintptr(0)
@@ -29128,7 +32749,7 @@ func zipfileNewEntry(tls *crt.TLS, zPath uintptr) uintptr { /* zipfile.c:1323:21
return pNew
}
-func zipfileSerializeLFH(tls *crt.TLS, pEntry uintptr, aBuf uintptr) int32 { /* zipfile.c:1337:12: */
+func zipfileSerializeLFH(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* zipfile.c:1337:12: */
var pCds uintptr = (pEntry /* &.cds */)
var a uintptr = aBuf
@@ -29191,7 +32812,7 @@ func zipfileSerializeLFH(tls *crt.TLS, pEntry uintptr, aBuf uintptr) int32 { /*
}
// Add the file name
- crt.Xmemcpy(tls, a, (*ZipfileCDS)(unsafe.Pointer(pCds)).FzFile, uint64(int32((*ZipfileCDS)(unsafe.Pointer(pCds)).FnFile)))
+ libc.Xmemcpy(tls, a, (*ZipfileCDS)(unsafe.Pointer(pCds)).FzFile, uint64(int32((*ZipfileCDS)(unsafe.Pointer(pCds)).FnFile)))
a += uintptr(int32((*ZipfileCDS)(unsafe.Pointer(pCds)).FnFile))
/* The "extra" data */
@@ -29205,7 +32826,7 @@ func zipfileSerializeLFH(tls *crt.TLS, pEntry uintptr, aBuf uintptr) int32 { /*
a += uintptr(2)
}
- *(*u8)(unsafe.Pointer(crt.PostIncUintptr(&a, 1))) = u8(0x01)
+ *(*u8)(unsafe.Pointer(libc.PostIncUintptr(&a, 1))) = u8(0x01)
{
zipfilePutU32(tls, a, (*ZipfileEntry)(unsafe.Pointer(pEntry)).FmUnixTime)
a += uintptr(4)
@@ -29214,7 +32835,7 @@ func zipfileSerializeLFH(tls *crt.TLS, pEntry uintptr, aBuf uintptr) int32 { /*
return (int32((int64(a) - int64(aBuf)) / 1))
}
-func zipfileAppendEntry(tls *crt.TLS, pTab uintptr, pEntry uintptr, pData uintptr, nData int32) int32 { /* zipfile.c:1370:12: */
+func zipfileAppendEntry(tls *libc.TLS, pTab uintptr, pEntry uintptr, pData uintptr, nData int32) int32 { /* zipfile.c:1370:12: */
var aBuf uintptr = (*ZipfileTab)(unsafe.Pointer(pTab)).FaBuffer
var nBuf int32
var rc int32
@@ -29229,12 +32850,12 @@ func zipfileAppendEntry(tls *crt.TLS, pTab uintptr, pEntry uintptr, pData uintpt
return rc
}
-func zipfileGetMode(tls *crt.TLS, pVal uintptr, bIsDir int32, pMode uintptr, pzErr uintptr) int32 { /* zipfile.c:1390:12: */
+func zipfileGetMode(tls *libc.TLS, pVal uintptr, bIsDir int32, pMode uintptr, pzErr uintptr) int32 { /* zipfile.c:1390:12: */
bp := tls.Alloc(19)
defer tls.Free(19)
var z uintptr
- var mode u32
+ var mode u321
// var zTemplate [11]int8 at bp+8, 11
var i int32
@@ -29254,11 +32875,11 @@ __1:
if !((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) <= '9')) {
goto __3
}
- mode = u32(uint32(sqlite3.Xsqlite3_value_int(tls, pVal)))
+ mode = u321(uint32(sqlite3.Xsqlite3_value_int(tls, pVal)))
goto __4
__3:
- *(*[11]int8)(unsafe.Pointer(bp + 8 /* zTemplate */)) = *(*[11]int8)(unsafe.Pointer(ts + 7891 /* "-rwxrwxrwx" */))
- if !(crt.Xstrlen(tls, z) != uint64(10)) {
+ *(*[11]int8)(unsafe.Pointer(bp + 8 /* zTemplate */)) = *(*[11]int8)(unsafe.Pointer(ts + 9176 /* "-rwxrwxrwx" */))
+ if !(libc.Xstrlen(tls, z) != uint64(10)) {
goto __5
}
goto parse_error
@@ -29296,7 +32917,7 @@ __11:
if !(int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(bp + 8 /* &zTemplate[0] */ + uintptr(i))))) {
goto __14
}
- mode = mode | (u32(int32(1) << (9 - i)))
+ mode = mode | (u321(int32(1) << (9 - i)))
goto __15
__14:
if !(int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != '-') {
@@ -29318,20 +32939,20 @@ __4:
;
__2:
;
- if !((crt.Bool32((mode & uint64(0040000)) == uint64(0))) == bIsDir) {
+ if !((libc.Bool32((mode & uint64(0040000)) == uint64(0))) == bIsDir) {
goto __17
}
// The "mode" attribute is a directory, but data has been specified.
// Or vice-versa - no data but "mode" is a file or symlink.
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7902 /* "zipfile: mode do..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+9187 /* "zipfile: mode do..." */, 0)
return 19
__17:
;
- *(*u32)(unsafe.Pointer(pMode)) = mode
+ *(*u321)(unsafe.Pointer(pMode)) = mode
return 0
parse_error:
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+7936 /* "zipfile: parse e..." */, crt.VaList(bp, z))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+9221 /* "zipfile: parse e..." */, libc.VaList(bp, z))
return 1
}
@@ -29339,21 +32960,21 @@ parse_error:
// Both (const char*) arguments point to nul-terminated strings. Argument
// nB is the value of strlen(zB). This function returns 0 if the strings are
// identical, ignoring any trailing '/' character in either path.
-func zipfileComparePath(tls *crt.TLS, zA uintptr, zB uintptr, nB int32) int32 { /* zipfile.c:1435:12: */
- var nA int32 = int32(crt.Xstrlen(tls, zA))
+func zipfileComparePath(tls *libc.TLS, zA uintptr, zB uintptr, nB int32) int32 { /* zipfile.c:1435:12: */
+ var nA int32 = int32(libc.Xstrlen(tls, zA))
if (nA > 0) && (int32(*(*int8)(unsafe.Pointer(zA + uintptr((nA - 1))))) == '/') {
nA--
}
if (nB > 0) && (int32(*(*int8)(unsafe.Pointer(zB + uintptr((nB - 1))))) == '/') {
nB--
}
- if (nA == nB) && (crt.Xmemcmp(tls, zA, zB, uint64(nA)) == 0) {
+ if (nA == nB) && (libc.Xmemcmp(tls, zA, zB, uint64(nA)) == 0) {
return 0
}
return 1
}
-func zipfileBegin(tls *crt.TLS, pVtab uintptr) int32 { /* zipfile.c:1443:12: */
+func zipfileBegin(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1443:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -29361,7 +32982,7 @@ func zipfileBegin(tls *crt.TLS, pVtab uintptr) int32 { /* zipfile.c:1443:12: */
var rc int32 = 0
if ((*ZipfileTab)(unsafe.Pointer(pTab)).FzFile == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer((*ZipfileTab)(unsafe.Pointer(pTab)).FzFile + uintptr(0)))) == 0) {
- (*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+7969 /* "zipfile: missing..." */, 0)
+ (*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+9254 /* "zipfile: missing..." */, 0)
return 1
}
@@ -29369,14 +32990,14 @@ func zipfileBegin(tls *crt.TLS, pVtab uintptr) int32 { /* zipfile.c:1443:12: */
// structure into memory. During the transaction any new file data is
// appended to the archive file, but the central directory is accumulated
// in main-memory until the transaction is committed.
- (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd = crt.Xfopen(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FzFile, ts+7995 /* "ab+" */)
+ (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd = libc.Xfopen(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FzFile, ts+9280 /* "ab+" */)
if (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd == uintptr(0) {
(*ZipfileTab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls,
- ts+7999 /* "zipfile: failed ..." */, crt.VaList(bp, (*ZipfileTab)(unsafe.Pointer(pTab)).FzFile))
+ ts+9284 /* "zipfile: failed ..." */, libc.VaList(bp, (*ZipfileTab)(unsafe.Pointer(pTab)).FzFile))
rc = 1
} else {
- crt.Xfseek(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd, int64(0), 2)
- (*ZipfileTab)(unsafe.Pointer(pTab)).FszCurrent = crt.AssignPtrInt64(pTab+96 /* &.szOrig */, i64(crt.Xftell(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd)))
+ libc.Xfseek(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd, int64(0), 2)
+ (*ZipfileTab)(unsafe.Pointer(pTab)).FszCurrent = libc.AssignPtrInt64(pTab+96 /* &.szOrig */, i64(libc.Xftell(tls, (*ZipfileTab)(unsafe.Pointer(pTab)).FpWriteFd)))
rc = zipfileLoadDirectory(tls, pTab, uintptr(0), 0)
}
@@ -29389,22 +33010,22 @@ func zipfileBegin(tls *crt.TLS, pVtab uintptr) int32 { /* zipfile.c:1443:12: */
// Return the current time as a 32-bit timestamp in UNIX epoch format (like
// time(2)).
-func zipfileTime(tls *crt.TLS) u32 { /* zipfile.c:1480:12: */
+func zipfileTime(tls *libc.TLS) u321 { /* zipfile.c:1480:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
var pVfs uintptr = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
- var ret u32
+ var ret u321
if ((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FiVersion >= 2) && ((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64 != 0) {
// var ms i64 at bp, 8
- (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, pVfs, bp /* &ms */)
- ret = (u32((*(*i64)(unsafe.Pointer(bp /* ms */)) / int64(1000)) - (int64(24405875) * int64(8640))))
+ (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, pVfs, bp /* &ms */)
+ ret = (u321((*(*i64)(unsafe.Pointer(bp /* ms */)) / int64(1000)) - (int64(24405875) * int64(8640))))
} else {
// var day float64 at bp+8, 8
- (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 120 /* &.xCurrentTime */))))(tls, pVfs, bp+8 /* &day */)
- ret = (u32((*(*float64)(unsafe.Pointer(bp + 8 /* day */)) - 2440587.5) * float64(86400)))
+ (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 120 /* &.xCurrentTime */))))(tls, pVfs, bp+8 /* &day */)
+ ret = (u321((*(*float64)(unsafe.Pointer(bp + 8 /* day */)) - 2440587.5) * float64(86400)))
}
return ret
}
@@ -29414,16 +33035,16 @@ func zipfileTime(tls *crt.TLS) u32 { /* zipfile.c:1480:12: */
// If the value passed as the only argument is either NULL or an SQL NULL,
// return the current time. Otherwise, return the value stored in (*pVal)
// cast to a 32-bit unsigned integer.
-func zipfileGetTime(tls *crt.TLS, pVal uintptr) u32 { /* zipfile.c:1502:12: */
+func zipfileGetTime(tls *libc.TLS, pVal uintptr) u321 { /* zipfile.c:1502:12: */
if (pVal == uintptr(0)) || (sqlite3.Xsqlite3_value_type(tls, pVal) == 5) {
return zipfileTime(tls)
}
- return u32(sqlite3.Xsqlite3_value_int64(tls, pVal))
+ return u321(sqlite3.Xsqlite3_value_int64(tls, pVal))
}
// Unless it is NULL, entry pOld is currently part of the pTab->pFirstEntry
// linked list. Remove it from the list and free the object.
-func zipfileRemoveEntryFromList(tls *crt.TLS, pTab uintptr, pOld uintptr) { /* zipfile.c:1513:13: */
+func zipfileRemoveEntryFromList(tls *libc.TLS, pTab uintptr, pOld uintptr) { /* zipfile.c:1513:13: */
if pOld != 0 {
var pp uintptr
for pp = (pTab + 64 /* &.pFirstEntry */); (*(*uintptr)(unsafe.Pointer(pp))) != pOld; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 112 /* &.pNext */) {
@@ -29434,7 +33055,7 @@ func zipfileRemoveEntryFromList(tls *crt.TLS, pTab uintptr, pOld uintptr) { /* z
}
// xUpdate method.
-func zipfileUpdate(tls *crt.TLS, pVtab uintptr, nVal int32, apVal uintptr, pRowid uintptr) int32 { /* zipfile.c:1525:12: */
+func zipfileUpdate(tls *libc.TLS, pVtab uintptr, nVal int32, apVal uintptr, pRowid uintptr) int32 { /* zipfile.c:1525:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -29442,9 +33063,9 @@ func zipfileUpdate(tls *crt.TLS, pVtab uintptr, nVal int32, apVal uintptr, pRowi
var rc int32 // Return Code
var pNew uintptr // New in-memory CDS entry
- // var mode u32 at bp+40, 8
+ // var mode u321 at bp+40, 8
// Mode for new entry
- var mTime u32 // Modification time for new entry
+ var mTime u321 // Modification time for new entry
var sz i64 // Uncompressed size
var zPath uintptr // Path for new entry
var nPath int32 // strlen(zPath)
@@ -29458,7 +33079,7 @@ func zipfileUpdate(tls *crt.TLS, pVtab uintptr, nVal int32, apVal uintptr, pRowi
var pOld2 uintptr
var bUpdate int32 // True for an update that modifies "name"
var bIsDir int32
- var iCrc32 u32
+ var iCrc32 u321
var zUpdate uintptr
var zDelete uintptr
var nDelete int32
@@ -29474,7 +33095,7 @@ func zipfileUpdate(tls *crt.TLS, pVtab uintptr, nVal int32, apVal uintptr, pRowi
pTab = pVtab
rc = 0
pNew = uintptr(0)
- *(*u32)(unsafe.Pointer(bp + 40 /* mode */)) = uint64(0)
+ *(*u321)(unsafe.Pointer(bp + 40 /* mode */)) = uint64(0)
mTime = uint64(0)
sz = int64(0)
zPath = uintptr(0)
@@ -29508,7 +33129,7 @@ __1:
goto __3
}
zDelete = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
- nDelete = int32(crt.Xstrlen(tls, zDelete))
+ nDelete = int32(libc.Xstrlen(tls, zDelete))
if !(nVal > 1) {
goto __4
}
@@ -29549,14 +33170,14 @@ __3:
if !(sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(5)*8))) != 5) {
goto __11
}
- zipfileTableErr(tls, pTab, ts+8043 /* "sz must be NULL" */, 0)
+ zipfileTableErr(tls, pTab, ts+9328 /* "sz must be NULL" */, 0)
rc = 19
__11:
;
if !(sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(6)*8))) != 5) {
goto __12
}
- zipfileTableErr(tls, pTab, ts+8059 /* "rawdata must be ..." */, 0)
+ zipfileTableErr(tls, pTab, ts+9344 /* "rawdata must be ..." */, 0)
rc = 19
__12:
;
@@ -29575,7 +33196,7 @@ __14:
// a regular file or a symlink.
aIn = sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(7)*8)))
nIn = sqlite3.Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(7)*8)))
- bAuto = (crt.Bool32(sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(8)*8))) == 5))
+ bAuto = (libc.Bool32(sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(8)*8))) == 5))
iMethod = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(8)*8)))
sz = i64(nIn)
@@ -29584,7 +33205,7 @@ __14:
if !((iMethod != 0) && (iMethod != 8)) {
goto __16
}
- zipfileTableErr(tls, pTab, ts+8080 /* "unknown compress..." */, crt.VaList(bp, iMethod))
+ zipfileTableErr(tls, pTab, ts+9365 /* "unknown compress..." */, libc.VaList(bp, iMethod))
rc = 19
goto __17
__16:
@@ -29632,7 +33253,7 @@ __21:
zPath = ts + 488 /* "" */
__23:
;
- nPath = int32(crt.Xstrlen(tls, zPath))
+ nPath = int32(libc.Xstrlen(tls, zPath))
mTime = zipfileGetTime(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(4)*8)))
__22:
;
@@ -29647,7 +33268,7 @@ __22:
if !((nPath <= 0) || (int32(*(*int8)(unsafe.Pointer(zPath + uintptr((nPath - 1))))) != '/')) {
goto __25
}
- zFree = sqlite3.Xsqlite3_mprintf(tls, ts+8111 /* "%s/" */, crt.VaList(bp+8, zPath))
+ zFree = sqlite3.Xsqlite3_mprintf(tls, ts+9396 /* "%s/" */, libc.VaList(bp+8, zPath))
zPath = zFree
if !(zFree == uintptr(0)) {
goto __26
@@ -29656,7 +33277,7 @@ __22:
nPath = 0
goto __27
__26:
- nPath = int32(crt.Xstrlen(tls, zPath))
+ nPath = int32(libc.Xstrlen(tls, zPath))
__27:
;
__25:
@@ -29692,7 +33313,7 @@ __35:
pOld2 = p
goto __33
__36:
- zipfileTableErr(tls, pTab, ts+8115 /* "duplicate name: ..." */, crt.VaList(bp+16, zPath))
+ zipfileTableErr(tls, pTab, ts+9400 /* "duplicate name: ..." */, libc.VaList(bp+16, zPath))
rc = 19
goto __33
__33:
@@ -29727,10 +33348,10 @@ __38:
(*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiCompression = u16(iMethod)
zipfileMtimeToDos(tls, (pNew /* &.cds */), mTime)
(*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.Fcrc32 = iCrc32
- (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FszCompressed = u32(nData)
- (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FszUncompressed = u32(sz)
- (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiExternalAttr = (*(*u32)(unsafe.Pointer(bp + 40 /* mode */)) << 16)
- (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiOffset = u32((*ZipfileTab)(unsafe.Pointer(pTab)).FszCurrent)
+ (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FszCompressed = u321(nData)
+ (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FszUncompressed = u321(sz)
+ (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiExternalAttr = (*(*u321)(unsafe.Pointer(bp + 40 /* mode */)) << 16)
+ (*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FiOffset = u321((*ZipfileTab)(unsafe.Pointer(pTab)).FszCurrent)
(*ZipfileEntry)(unsafe.Pointer(pNew)).Fcds.FnFile = u16(nPath)
(*ZipfileEntry)(unsafe.Pointer(pNew)).FmUnixTime = mTime
rc = zipfileAppendEntry(tls, pTab, pNew, pData, nData)
@@ -29776,7 +33397,7 @@ zipfile_update_done:
return rc
}
-func zipfileSerializeEOCD(tls *crt.TLS, p uintptr, aBuf uintptr) int32 { /* zipfile.c:1716:12: */
+func zipfileSerializeEOCD(tls *libc.TLS, p uintptr, aBuf uintptr) int32 { /* zipfile.c:1716:12: */
var a uintptr = aBuf
{
zipfilePutU32(tls, a, uint64(0x06054b50))
@@ -29822,7 +33443,7 @@ func zipfileSerializeEOCD(tls *crt.TLS, p uintptr, aBuf uintptr) int32 { /* zipf
return (int32((int64(a) - int64(aBuf)) / 1))
}
-func zipfileAppendEOCD(tls *crt.TLS, pTab uintptr, p uintptr) int32 { /* zipfile.c:1730:12: */
+func zipfileAppendEOCD(tls *libc.TLS, pTab uintptr, p uintptr) int32 { /* zipfile.c:1730:12: */
var nBuf int32 = zipfileSerializeEOCD(tls, p, (*ZipfileTab)(unsafe.Pointer(pTab)).FaBuffer)
return zipfileAppendData(tls, pTab, (*ZipfileTab)(unsafe.Pointer(pTab)).FaBuffer, nBuf)
@@ -29830,7 +33451,7 @@ func zipfileAppendEOCD(tls *crt.TLS, pTab uintptr, p uintptr) int32 { /* zipfile
// Serialize the CDS structure into buffer aBuf[]. Return the number
// of bytes written.
-func zipfileSerializeCDS(tls *crt.TLS, pEntry uintptr, aBuf uintptr) int32 { /* zipfile.c:1740:12: */
+func zipfileSerializeCDS(tls *libc.TLS, pEntry uintptr, aBuf uintptr) int32 { /* zipfile.c:1740:12: */
var a uintptr = aBuf
var pCDS uintptr = (pEntry /* &.cds */)
@@ -29923,12 +33544,12 @@ func zipfileSerializeCDS(tls *crt.TLS, pEntry uintptr, aBuf uintptr) int32 { /*
a += uintptr(4)
}
- crt.Xmemcpy(tls, a, (*ZipfileCDS)(unsafe.Pointer(pCDS)).FzFile, uint64((*ZipfileCDS)(unsafe.Pointer(pCDS)).FnFile))
+ libc.Xmemcpy(tls, a, (*ZipfileCDS)(unsafe.Pointer(pCDS)).FzFile, uint64((*ZipfileCDS)(unsafe.Pointer(pCDS)).FnFile))
a += uintptr((*ZipfileCDS)(unsafe.Pointer(pCDS)).FnFile)
if (*ZipfileEntry)(unsafe.Pointer(pEntry)).FaExtra != 0 {
var n int32 = (int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FnExtra) + int32((*ZipfileCDS)(unsafe.Pointer(pCDS)).FnComment))
- crt.Xmemcpy(tls, a, (*ZipfileEntry)(unsafe.Pointer(pEntry)).FaExtra, uint64(n))
+ libc.Xmemcpy(tls, a, (*ZipfileEntry)(unsafe.Pointer(pEntry)).FaExtra, uint64(n))
a += uintptr(n)
} else {
@@ -29942,7 +33563,7 @@ func zipfileSerializeCDS(tls *crt.TLS, pEntry uintptr, aBuf uintptr) int32 { /*
a += uintptr(2)
}
- *(*u8)(unsafe.Pointer(crt.PostIncUintptr(&a, 1))) = u8(0x01)
+ *(*u8)(unsafe.Pointer(libc.PostIncUintptr(&a, 1))) = u8(0x01)
{
zipfilePutU32(tls, a, (*ZipfileEntry)(unsafe.Pointer(pEntry)).FmUnixTime)
a += uintptr(4)
@@ -29952,7 +33573,7 @@ func zipfileSerializeCDS(tls *crt.TLS, pEntry uintptr, aBuf uintptr) int32 { /*
return (int32((int64(a) - int64(aBuf)) / 1))
}
-func zipfileCommit(tls *crt.TLS, pVtab uintptr) int32 { /* zipfile.c:1785:12: */
+func zipfileCommit(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1785:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -29977,8 +33598,8 @@ func zipfileCommit(tls *crt.TLS, pVtab uintptr) int32 { /* zipfile.c:1785:12: */
(*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FiFirstDisk = u16(0)
(*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FnEntry = u16(nEntry)
(*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FnEntryTotal = u16(nEntry)
- (*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FnSize = (u32((*ZipfileTab)(unsafe.Pointer(pTab)).FszCurrent - iOffset))
- (*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FiOffset = u32(iOffset)
+ (*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FnSize = (u321((*ZipfileTab)(unsafe.Pointer(pTab)).FszCurrent - iOffset))
+ (*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FiOffset = u321(iOffset)
rc = zipfileAppendEOCD(tls, pTab, bp /* &eocd */)
zipfileCleanupTransaction(tls, pTab)
@@ -29986,11 +33607,11 @@ func zipfileCommit(tls *crt.TLS, pVtab uintptr) int32 { /* zipfile.c:1785:12: */
return rc
}
-func zipfileRollback(tls *crt.TLS, pVtab uintptr) int32 { /* zipfile.c:1815:12: */
+func zipfileRollback(tls *libc.TLS, pVtab uintptr) int32 { /* zipfile.c:1815:12: */
return zipfileCommit(tls, pVtab)
}
-func zipfileFindCursor(tls *crt.TLS, pTab uintptr, iId i64) uintptr { /* zipfile.c:1819:19: */
+func zipfileFindCursor(tls *libc.TLS, pTab uintptr, iId i64) uintptr { /* zipfile.c:1819:19: */
var pCsr uintptr
for pCsr = (*ZipfileTab)(unsafe.Pointer(pTab)).FpCsrList; pCsr != 0; pCsr = (*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCsrNext {
if iId == (*ZipfileCsr)(unsafe.Pointer(pCsr)).FiId {
@@ -30000,7 +33621,7 @@ func zipfileFindCursor(tls *crt.TLS, pTab uintptr, iId i64) uintptr { /* zipfile
return pCsr
}
-func zipfileFunctionCds(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* zipfile.c:1827:13: */
+func zipfileFunctionCds(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* zipfile.c:1827:13: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -30012,30 +33633,30 @@ func zipfileFunctionCds(tls *crt.TLS, context uintptr, argc int32, argv uintptr)
var p uintptr = ((*ZipfileCsr)(unsafe.Pointer(pCsr)).FpCurrent /* &.cds */)
var zRes uintptr = sqlite3.Xsqlite3_mprintf(tls,
- ts+8136, /* "{\"version-made-b..." */
- crt.VaList(bp, u32((*ZipfileCDS)(unsafe.Pointer(p)).FiVersionMadeBy), u32((*ZipfileCDS)(unsafe.Pointer(p)).FiVersionExtract),
- u32((*ZipfileCDS)(unsafe.Pointer(p)).Fflags), u32((*ZipfileCDS)(unsafe.Pointer(p)).FiCompression),
- u32((*ZipfileCDS)(unsafe.Pointer(p)).FmTime), u32((*ZipfileCDS)(unsafe.Pointer(p)).FmDate),
+ ts+9421, /* "{\"version-made-b..." */
+ libc.VaList(bp, u321((*ZipfileCDS)(unsafe.Pointer(p)).FiVersionMadeBy), u321((*ZipfileCDS)(unsafe.Pointer(p)).FiVersionExtract),
+ u321((*ZipfileCDS)(unsafe.Pointer(p)).Fflags), u321((*ZipfileCDS)(unsafe.Pointer(p)).FiCompression),
+ u321((*ZipfileCDS)(unsafe.Pointer(p)).FmTime), u321((*ZipfileCDS)(unsafe.Pointer(p)).FmDate),
(*ZipfileCDS)(unsafe.Pointer(p)).Fcrc32, (*ZipfileCDS)(unsafe.Pointer(p)).FszCompressed,
- (*ZipfileCDS)(unsafe.Pointer(p)).FszUncompressed, u32((*ZipfileCDS)(unsafe.Pointer(p)).FnFile),
- u32((*ZipfileCDS)(unsafe.Pointer(p)).FnExtra), u32((*ZipfileCDS)(unsafe.Pointer(p)).FnComment),
- u32((*ZipfileCDS)(unsafe.Pointer(p)).FiDiskStart), u32((*ZipfileCDS)(unsafe.Pointer(p)).FiInternalAttr),
+ (*ZipfileCDS)(unsafe.Pointer(p)).FszUncompressed, u321((*ZipfileCDS)(unsafe.Pointer(p)).FnFile),
+ u321((*ZipfileCDS)(unsafe.Pointer(p)).FnExtra), u321((*ZipfileCDS)(unsafe.Pointer(p)).FnComment),
+ u321((*ZipfileCDS)(unsafe.Pointer(p)).FiDiskStart), u321((*ZipfileCDS)(unsafe.Pointer(p)).FiInternalAttr),
(*ZipfileCDS)(unsafe.Pointer(p)).FiExternalAttr, (*ZipfileCDS)(unsafe.Pointer(p)).FiOffset))
if zRes == uintptr(0) {
sqlite3.Xsqlite3_result_error_nomem(tls, context)
} else {
- sqlite3.Xsqlite3_result_text(tls, context, zRes, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, context, zRes, -1, libc.UintptrFromInt32(-1))
sqlite3.Xsqlite3_free(tls, zRes)
}
}
}
// xFindFunction method.
-func zipfileFindFunction(tls *crt.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* zipfile.c:1878:12: */
- if sqlite3.Xsqlite3_stricmp(tls, ts+8478 /* "zipfile_cds" */, zName) == 0 {
+func zipfileFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* zipfile.c:1878:12: */
+ if sqlite3.Xsqlite3_stricmp(tls, ts+9763 /* "zipfile_cds" */, zName) == 0 {
*(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{zipfileFunctionCds}))
*(*uintptr)(unsafe.Pointer(ppArg)) = pVtab
return 1
@@ -30059,7 +33680,7 @@ type ZipfileCtx1 = struct {
type ZipfileCtx = ZipfileCtx1 /* zipfile.c:1900:27 */
-func zipfileBufferGrow(tls *crt.TLS, pBuf uintptr, nByte int32) int32 { /* zipfile.c:1907:12: */
+func zipfileBufferGrow(tls *libc.TLS, pBuf uintptr, nByte int32) int32 { /* zipfile.c:1907:12: */
if ((*ZipfileBuffer)(unsafe.Pointer(pBuf)).Fn + nByte) > (*ZipfileBuffer)(unsafe.Pointer(pBuf)).FnAlloc {
var aNew uintptr
var nNew sqlite3_int64
@@ -30089,7 +33710,7 @@ func zipfileBufferGrow(tls *crt.TLS, pBuf uintptr, nByte int32) int32 { /* zipfi
// SELECT zipfile(name,data) ...
// SELECT zipfile(name,mode,mtime,data) ...
// SELECT zipfile(name,mode,mtime,data,method) ...
-func zipfileStep(tls *crt.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* zipfile.c:1930:6: */
+func zipfileStep(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* zipfile.c:1930:6: */
bp := tls.Alloc(168)
defer tls.Free(168)
@@ -30103,7 +33724,7 @@ func zipfileStep(tls *crt.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* zip
var pData uintptr
var pMethod uintptr
var bIsDir int32
- // var mode u32 at bp+160, 8
+ // var mode u321 at bp+160, 8
var rc int32
// var zErr uintptr at bp+152, 8
@@ -30115,7 +33736,7 @@ func zipfileStep(tls *crt.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* zip
var szUncompressed int32 // Size of data before compression
// var aFree uintptr at bp+136, 8
// Free this before returning
- var iCrc32 u32 // crc32 of uncompressed data
+ var iCrc32 u321 // crc32 of uncompressed data
var zName uintptr // Path (name) of new entry
var nName int32 // Size of zName in bytes
@@ -30140,7 +33761,7 @@ func zipfileStep(tls *crt.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* zip
nName = 0
zFree = uintptr(0)
- crt.Xmemset(tls, bp+16 /* &e */, 0, uint64(unsafe.Sizeof(ZipfileEntry{})))
+ libc.Xmemset(tls, bp+16 /* &e */, 0, uint64(unsafe.Sizeof(ZipfileEntry{})))
p = sqlite3.Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(ZipfileCtx{})))
if !(p == uintptr(0)) {
goto __1
@@ -30153,7 +33774,7 @@ __1:
if !(((nVal != 2) && (nVal != 4)) && (nVal != 5)) {
goto __2
}
- *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+8490 /* "wrong number of ..." */, 0)
+ *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+9775 /* "wrong number of ..." */, 0)
rc = 1
goto zipfile_step_out
__2:
@@ -30183,7 +33804,7 @@ __4:
if !(zName == uintptr(0)) {
goto __6
}
- *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+8538 /* "first argument t..." */, 0)
+ *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+9823 /* "first argument t..." */, 0)
rc = 1
goto zipfile_step_out
__6:
@@ -30198,7 +33819,7 @@ __6:
if !((iMethod != 0) && (iMethod != 8)) {
goto __8
}
- *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+8583 /* "illegal method v..." */, crt.VaList(bp, iMethod))
+ *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+9868 /* "illegal method v..." */, libc.VaList(bp, iMethod))
rc = 1
goto zipfile_step_out
__8:
@@ -30217,7 +33838,7 @@ __7:
goto __10
__9:
aData = sqlite3.Xsqlite3_value_blob(tls, pData)
- szUncompressed = crt.AssignInt32(&nData, sqlite3.Xsqlite3_value_bytes(tls, pData))
+ szUncompressed = libc.AssignInt32(&nData, sqlite3.Xsqlite3_value_bytes(tls, pData))
iCrc32 = tcl.Xcrc32(tls, uint64(0), aData, uint32(nData))
if !((iMethod < 0) || (iMethod == 8)) {
goto __11
@@ -30267,7 +33888,7 @@ __15:
if !((nName > 0) && (int32(*(*int8)(unsafe.Pointer(zName + uintptr((nName - 1))))) == '/')) {
goto __18
}
- *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+8608 /* "non-directory na..." */, 0)
+ *(*uintptr)(unsafe.Pointer(bp + 152 /* zErr */)) = sqlite3.Xsqlite3_mprintf(tls, ts+9893 /* "non-directory na..." */, 0)
rc = 1
goto zipfile_step_out
__18:
@@ -30277,7 +33898,7 @@ __16:
if !((nName == 0) || (int32(*(*int8)(unsafe.Pointer(zName + uintptr((nName - 1))))) != '/')) {
goto __19
}
- zName = crt.AssignUintptr(&zFree, sqlite3.Xsqlite3_mprintf(tls, ts+8111 /* "%s/" */, crt.VaList(bp+8, zName)))
+ zName = libc.AssignUintptr(&zFree, sqlite3.Xsqlite3_mprintf(tls, ts+9396 /* "%s/" */, libc.VaList(bp+8, zName)))
if !(zName == uintptr(0)) {
goto __21
}
@@ -30285,7 +33906,7 @@ __16:
goto zipfile_step_out
__21:
;
- nName = int32(crt.Xstrlen(tls, zName))
+ nName = int32(libc.Xstrlen(tls, zName))
goto __20
__19:
__22:
@@ -30308,16 +33929,16 @@ __17:
(*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiCompression = u16(iMethod)
zipfileMtimeToDos(tls, (bp + 16 /* &e */ /* &.cds */), (*ZipfileEntry)(unsafe.Pointer(bp+16 /* &e */)).FmUnixTime)
(*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.Fcrc32 = iCrc32
- (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FszCompressed = u32(nData)
- (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FszUncompressed = u32(szUncompressed)
- (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiExternalAttr = (*(*u32)(unsafe.Pointer(bp + 160 /* mode */)) << 16)
- (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiOffset = u32((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fn)
+ (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FszCompressed = u321(nData)
+ (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FszUncompressed = u321(szUncompressed)
+ (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiExternalAttr = (*(*u321)(unsafe.Pointer(bp + 160 /* mode */)) << 16)
+ (*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FiOffset = u321((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fn)
(*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FnFile = u16(nName)
(*ZipfileEntry)(unsafe.Pointer(bp + 16 /* &e */)).Fcds.FzFile = zName
// Append the LFH to the body of the new archive
nByte = ((30 + int32((*ZipfileEntry)(unsafe.Pointer(bp+16 /* &e */)).Fcds.FnFile)) + 9)
- if !(crt.AssignInt32(&rc, zipfileBufferGrow(tls, (p+8 /* &.body */), nByte)) != 0) {
+ if !(libc.AssignInt32(&rc, zipfileBufferGrow(tls, (p+8 /* &.body */), nByte)) != 0) {
goto __24
}
goto zipfile_step_out
@@ -30329,20 +33950,20 @@ __24:
if !(nData > 0) {
goto __25
}
- if !(crt.AssignInt32(&rc, zipfileBufferGrow(tls, (p+8 /* &.body */), nData)) != 0) {
+ if !(libc.AssignInt32(&rc, zipfileBufferGrow(tls, (p+8 /* &.body */), nData)) != 0) {
goto __26
}
goto zipfile_step_out
__26:
;
- crt.Xmemcpy(tls, ((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fa + uintptr((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fn)), aData, uint64(nData))
+ libc.Xmemcpy(tls, ((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fa + uintptr((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fn)), aData, uint64(nData))
*(*int32)(unsafe.Pointer(p + 8 /* &.body */ + 8 /* &.n */)) += (nData)
__25:
;
// Append the CDS record to the directory of the new archive
nByte = ((46 + int32((*ZipfileEntry)(unsafe.Pointer(bp+16 /* &e */)).Fcds.FnFile)) + 9)
- if !(crt.AssignInt32(&rc, zipfileBufferGrow(tls, (p+24 /* &.cds */), nByte)) != 0) {
+ if !(libc.AssignInt32(&rc, zipfileBufferGrow(tls, (p+24 /* &.cds */), nByte)) != 0) {
goto __27
}
goto zipfile_step_out
@@ -30374,7 +33995,7 @@ __28:
}
// xFinalize() callback for zipfile aggregate function.
-func zipfileFinal(tls *crt.TLS, pCtx uintptr) { /* zipfile.c:2105:6: */
+func zipfileFinal(tls *libc.TLS, pCtx uintptr) { /* zipfile.c:2105:6: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -30389,21 +34010,21 @@ func zipfileFinal(tls *crt.TLS, pCtx uintptr) { /* zipfile.c:2105:6: */
return
}
if (*ZipfileCtx)(unsafe.Pointer(p)).FnEntry > 0 {
- crt.Xmemset(tls, bp /* &eocd */, 0, uint64(unsafe.Sizeof(ZipfileEOCD{})))
+ libc.Xmemset(tls, bp /* &eocd */, 0, uint64(unsafe.Sizeof(ZipfileEOCD{})))
(*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FnEntry = u16((*ZipfileCtx)(unsafe.Pointer(p)).FnEntry)
(*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FnEntryTotal = u16((*ZipfileCtx)(unsafe.Pointer(p)).FnEntry)
- (*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FnSize = u32((*ZipfileCtx)(unsafe.Pointer(p)).Fcds.Fn)
- (*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FiOffset = u32((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fn)
+ (*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FnSize = u321((*ZipfileCtx)(unsafe.Pointer(p)).Fcds.Fn)
+ (*ZipfileEOCD)(unsafe.Pointer(bp /* &eocd */)).FiOffset = u321((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fn)
nZip = (sqlite3_int64(((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fn + (*ZipfileCtx)(unsafe.Pointer(p)).Fcds.Fn) + 22))
aZip = sqlite3.Xsqlite3_malloc64(tls, uint64(nZip))
if aZip == uintptr(0) {
sqlite3.Xsqlite3_result_error_nomem(tls, pCtx)
} else {
- crt.Xmemcpy(tls, aZip, (*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fa, uint64((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fn))
- crt.Xmemcpy(tls, (aZip + uintptr((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fn)), (*ZipfileCtx)(unsafe.Pointer(p)).Fcds.Fa, uint64((*ZipfileCtx)(unsafe.Pointer(p)).Fcds.Fn))
+ libc.Xmemcpy(tls, aZip, (*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fa, uint64((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fn))
+ libc.Xmemcpy(tls, (aZip + uintptr((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fn)), (*ZipfileCtx)(unsafe.Pointer(p)).Fcds.Fa, uint64((*ZipfileCtx)(unsafe.Pointer(p)).Fcds.Fn))
zipfileSerializeEOCD(tls, bp /* &eocd */, (aZip + uintptr(((*ZipfileCtx)(unsafe.Pointer(p)).Fbody.Fn + (*ZipfileCtx)(unsafe.Pointer(p)).Fcds.Fn))))
- sqlite3.Xsqlite3_result_blob(tls, pCtx, aZip, int32(nZip), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{zipfileFree})))
+ sqlite3.Xsqlite3_result_blob(tls, pCtx, aZip, int32(nZip), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{zipfileFree})))
}
}
@@ -30412,17 +34033,17 @@ func zipfileFinal(tls *crt.TLS, pCtx uintptr) { /* zipfile.c:2105:6: */
}
// Register the "zipfile" virtual table.
-func zipfileRegister(tls *crt.TLS, db uintptr) int32 { /* zipfile.c:2140:12: */
+func zipfileRegister(tls *libc.TLS, db uintptr) int32 { /* zipfile.c:2140:12: */
- var rc int32 = sqlite3.Xsqlite3_create_module(tls, db, ts+7549 /* "zipfile" */, uintptr(unsafe.Pointer(&zipfileModule)), uintptr(0))
+ var rc int32 = sqlite3.Xsqlite3_create_module(tls, db, ts+8834 /* "zipfile" */, uintptr(unsafe.Pointer(&zipfileModule)), uintptr(0))
if rc == 0 {
- rc = sqlite3.Xsqlite3_overload_function(tls, db, ts+8478 /* "zipfile_cds" */, -1)
+ rc = sqlite3.Xsqlite3_overload_function(tls, db, ts+9763 /* "zipfile_cds" */, -1)
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+7549 /* "zipfile" */, -1, 1, uintptr(0), uintptr(0),
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+8834 /* "zipfile" */, -1, 1, uintptr(0), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{zipfileStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{zipfileFinal})))
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{zipfileStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{zipfileFinal})))
}
return rc
}
@@ -30449,27 +34070,401 @@ uintptr(0), FxCommit:// xSync
uintptr(0), // xRename
} /* zipfile.c:2141:25 */
-func sqlite3_zipfile_init(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* zipfile.c:2180:5: */
+func sqlite3_zipfile_init(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* zipfile.c:2180:5: */
_ = pApi
_ = pzErrMsg // Unused parameter
return zipfileRegister(tls, db)
}
-//
-// END OF REGISTRATION API
-//
+func test_rbu_delta(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* test_rbu.c:34:6: */
+ var interp uintptr = sqlite3.Xsqlite3_user_data(tls, pCtx)
+ var pScript uintptr
+ var i int32
-//******* End of fts5.h ********
+ pScript = tcl.XTcl_NewObj(tls)
+ (*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pScript, tcl.XTcl_NewStringObj(tls, ts+9932 /* "rbu_delta" */, -1))
+ for i = 0; i < nArg; i++ {
+ var pIn uintptr = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))
+ var z uintptr = sqlite3.Xsqlite3_value_text(tls, pIn)
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pScript, tcl.XTcl_NewStringObj(tls, z, -1))
+ }
-// end block for C++
+ if 0 == tcl.XTcl_EvalObjEx(tls, interp, pScript, 1) {
+ var z uintptr = tcl.XTcl_GetStringResult(tls, interp)
+ sqlite3.Xsqlite3_result_text(tls, pCtx, z, -1, libc.UintptrFromInt32(-1))
+ } else {
+ tcl.XTcl_BackgroundError(tls, interp)
+ }
-// Local Variables:
-// mode: c
-// c-basic-offset: 4
-// fill-column: 78
-// End:
-func SqliteRbu_Init(tls *crt.TLS, interp uintptr) int32 { /* test_rbu.c:389:5: */ return 0 }
+ for ok := true; ok; ok = 0 != 0 {
+ var _objPtr uintptr = pScript
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+}
+
+func test_sqlite3rbu_cmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_rbu.c:59:26: */
+ bp := tls.Alloc(496)
+ defer tls.Free(496)
+
+ var ret int32 = 0
+ var pRbu uintptr = clientData
+ *(*[14]RbuCmd)(unsafe.Pointer(bp + 24 /* aCmd */)) = [14]RbuCmd{
+ {FzName: ts + 9942 /* "step" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 0
+ {FzName: ts + 9947 /* "close" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 1
+ {FzName: ts + 9953 /* "create_rbu_delta" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 2
+ {FzName: ts + 9970 /* "savestate" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 3
+ {FzName: ts + 9980 /* "dbMain_eval" */, FnArg: 3, FzUsage: ts + 9992 /* "SQL" */}, // 4
+ {FzName: ts + 9996 /* "bp_progress" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 5
+ {FzName: ts + 10008 /* "db" */, FnArg: 3, FzUsage: ts + 10011 /* "RBU" */}, // 6
+ {FzName: ts + 10015 /* "state" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 7
+ {FzName: ts + 10021 /* "progress" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 8
+ {FzName: ts + 10030 /* "close_no_error" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 9
+ {FzName: ts + 10045 /* "temp_size_limit" */, FnArg: 3, FzUsage: ts + 10061 /* "LIMIT" */}, // 10
+ {FzName: ts + 10067 /* "temp_size" */, FnArg: 2, FzUsage: ts + 488 /* "" */}, // 11
+ {FzName: ts + 10077 /* "dbRbu_eval" */, FnArg: 3, FzUsage: ts + 9992 /* "SQL" */}, // 12
+ {FzName: uintptr(0), FnArg: 0, FzUsage: uintptr(0)},
+ }
+ // var iCmd int32 at bp+360, 4
+
+ if objc < 2 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10088 /* "METHOD" */)
+ return 1
+ }
+ ret = tcl.XTcl_GetIndexFromObjStruct(tls,
+ interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+24 /* &aCmd[0] */, int32(unsafe.Sizeof(RbuCmd{})), ts+10095 /* "method" */, 0, bp+360 /* &iCmd */)
+ if ret != 0 {
+ return 1
+ }
+ if objc != (*RbuCmd)(unsafe.Pointer(bp+24 /* &aCmd */ +uintptr(*(*int32)(unsafe.Pointer(bp + 360 /* iCmd */)))*24)).FnArg {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, (*RbuCmd)(unsafe.Pointer(bp+24 /* &aCmd */ +uintptr(*(*int32)(unsafe.Pointer(bp + 360 /* iCmd */)))*24)).FzUsage)
+ return 1
+ }
+
+ switch *(*int32)(unsafe.Pointer(bp + 360 /* iCmd */)) {
+ case 0: /* step */
+ {
+ var rc int32 = sqlite3.Xsqlite3rbu_step(tls, pRbu)
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
+ break
+ }
+
+ case 9:
+ fallthrough /* close_no_error */
+ case 1: /* close */
+ {
+ *(*uintptr)(unsafe.Pointer(bp + 368 /* zErrmsg */)) = uintptr(0)
+ var rc int32
+ tcl.XTcl_DeleteCommand(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))))
+ if *(*int32)(unsafe.Pointer(bp + 360 /* iCmd */)) == 1 {
+ rc = sqlite3.Xsqlite3rbu_close(tls, pRbu, bp+368 /* &zErrmsg */)
+ } else {
+ rc = sqlite3.Xsqlite3rbu_close(tls, pRbu, uintptr(0))
+ }
+ if (rc == 0) || (rc == 101) {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
+ } else {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
+ if *(*uintptr)(unsafe.Pointer(bp + 368 /* zErrmsg */)) != 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+10102 /* " - " */, *(*uintptr)(unsafe.Pointer(bp + 368 /* zErrmsg */)), 0))
+ sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 368 /* zErrmsg */)))
+ }
+ ret = 1
+ }
+ break
+ }
+
+ case 2: /* create_rbu_delta */
+ {
+ var db uintptr = sqlite3.Xsqlite3rbu_db(tls, pRbu, 0)
+ var rc int32 = sqlite3.Xsqlite3_create_function(tls,
+ db, ts+9932 /* "rbu_delta" */, -1, 1, interp, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{test_rbu_delta})), uintptr(0), uintptr(0))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
+ ret = func() int32 {
+ if rc == 0 {
+ return 0
+ }
+ return 1
+ }()
+ break
+ }
+
+ case 3: /* savestate */
+ {
+ var rc int32 = sqlite3.Xsqlite3rbu_savestate(tls, pRbu)
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
+ ret = func() int32 {
+ if rc == 0 {
+ return 0
+ }
+ return 1
+ }()
+ break
+ }
+
+ case 12:
+ fallthrough /* dbRbu_eval */
+ case 4: /* dbMain_eval */
+ {
+ var db uintptr = sqlite3.Xsqlite3rbu_db(tls, pRbu, (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 360 /* iCmd */)) == 12)))
+ var rc int32 = sqlite3.Xsqlite3_exec(tls, db, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), uintptr(0), uintptr(0), uintptr(0))
+ if rc != 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3_errmsg(tls, db), -1))
+ ret = 1
+ }
+ break
+ }
+
+ case 5: /* bp_progress */
+ {
+ // var one int32 at bp+376, 4
+
+ // var two int32 at bp+380, 4
+
+ var pObj uintptr
+ sqlite3.Xsqlite3rbu_bp_progress(tls, pRbu, bp+376 /* &one */, bp+380 /* &two */)
+
+ pObj = tcl.XTcl_NewObj(tls)
+ tcl.XTcl_ListObjAppendElement(tls, interp, pObj, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 376 /* one */))))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pObj, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 380 /* two */))))
+ tcl.XTcl_SetObjResult(tls, interp, pObj)
+ break
+ }
+
+ case 6: /* db */
+ {
+ // var bArg int32 at bp+384, 4
+
+ if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+384 /* &bArg */) != 0 {
+ ret = 1
+ } else {
+ // var zBuf [50]int8 at bp+388, 50
+
+ var db uintptr = sqlite3.Xsqlite3rbu_db(tls, pRbu, *(*int32)(unsafe.Pointer(bp + 384 /* bArg */)))
+ if sqlite3TestMakePointerStr(tls, interp, bp+388 /* &zBuf[0] */, db) != 0 {
+ ret = 1
+ } else {
+ tcl.XTcl_SetResult(tls, interp, bp+388 /* &zBuf[0] */, uintptr(1))
+ }
+ }
+ break
+ }
+ case 7: /* state */
+ {
+ *(*[6]uintptr)(unsafe.Pointer(bp + 440 /* aRes */)) = [6]uintptr{uintptr(0), ts + 10106 /* "oal" */, ts + 10110 /* "move" */, ts + 10115 /* "checkpoint" */, ts + 10126 /* "done" */, ts + 10131 /* "error" */}
+ var eState int32 = sqlite3.Xsqlite3rbu_state(tls, pRbu)
+
+ tcl.XTcl_SetResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 440 /* &aRes[0] */ + uintptr(eState)*8)), uintptr(0))
+ break
+ }
+ case 8: /* progress */
+ {
+ var nStep sqlite3_int64 = sqlite3.Xsqlite3rbu_progress(tls, pRbu)
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewWideIntObj(tls, int64(nStep)))
+ break
+ }
+
+ case 10: /* temp_size_limit */
+ {
+ // var nLimit sqlite3_int64 at bp+488, 8
+
+ if tcl.XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+488 /* &nLimit */) != 0 {
+ ret = 1
+ } else {
+ *(*sqlite3_int64)(unsafe.Pointer(bp + 488 /* nLimit */)) = sqlite3.Xsqlite3rbu_temp_size_limit(tls, pRbu, *(*sqlite3_int64)(unsafe.Pointer(bp + 488 /* nLimit */)))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewWideIntObj(tls, int64(*(*sqlite3_int64)(unsafe.Pointer(bp + 488 /* nLimit */)))))
+ }
+ break
+ }
+ case 11: /* temp_size */
+ {
+ var sz sqlite3_int64 = sqlite3.Xsqlite3rbu_temp_size(tls, pRbu)
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewWideIntObj(tls, int64(sz)))
+ break
+ }
+
+ default: // seems unlikely
+
+ break
+ }
+
+ return ret
+}
+
+type RbuCmd = struct {
+ FzName uintptr
+ FnArg int32
+ FzUsage uintptr
+}
+
+// Tclcmd: sqlite3rbu CMD <target-db> <rbu-db> ?<state-db>?
+func test_sqlite3rbu(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_rbu.c:228:26: */
+ var pRbu uintptr = uintptr(0)
+ var zCmd uintptr
+ var zTarget uintptr
+ var zRbu uintptr
+ var zStateDb uintptr = uintptr(0)
+
+ if (objc != 4) && (objc != 5) {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10137 /* "NAME TARGET-DB R..." */)
+ return 1
+ }
+ zCmd = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
+ zTarget = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
+ zRbu = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)))
+ if objc == 5 {
+ zStateDb = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(4)*8)))
+ }
+
+ pRbu = sqlite3.Xsqlite3rbu_open(tls, zTarget, zRbu, zStateDb)
+ tcl.XTcl_CreateObjCommand(tls, interp, zCmd, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
+ }{test_sqlite3rbu_cmd})), pRbu, uintptr(0))
+ tcl.XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
+ return 0
+}
+
+// Tclcmd: sqlite3rbu_vacuum CMD <target-db> <state-db>
+func test_sqlite3rbu_vacuum(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_rbu.c:258:26: */
+ var pRbu uintptr = uintptr(0)
+ var zCmd uintptr
+ var zTarget uintptr
+ var zStateDb uintptr = uintptr(0)
+
+ if (objc != 3) && (objc != 4) {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10170 /* "NAME TARGET-DB ?..." */)
+ return 1
+ }
+ zCmd = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
+ zTarget = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
+ if objc == 4 {
+ zStateDb = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)))
+ }
+ if (zStateDb != 0) && (int32(*(*int8)(unsafe.Pointer(zStateDb + uintptr(0)))) == 0) {
+ zStateDb = uintptr(0)
+ }
+
+ pRbu = sqlite3.Xsqlite3rbu_vacuum(tls, zTarget, zStateDb)
+ tcl.XTcl_CreateObjCommand(tls, interp, zCmd, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
+ }{test_sqlite3rbu_cmd})), pRbu, uintptr(0))
+ tcl.XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
+ return 0
+}
+
+// Tclcmd: sqlite3rbu_create_vfs ?-default? NAME PARENT
+func test_sqlite3rbu_create_vfs(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_rbu.c:287:26: */
+ var zName uintptr
+ var zParent uintptr
+ var rc int32
+
+ if (objc != 3) && (objc != 4) {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10196 /* "?-default? NAME ..." */)
+ return 1
+ }
+
+ zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr((objc-2))*8)))
+ zParent = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr((objc-1))*8)))
+ if int32(*(*int8)(unsafe.Pointer(zParent + uintptr(0)))) == 0 {
+ zParent = uintptr(0)
+ }
+
+ rc = sqlite3.Xsqlite3rbu_create_vfs(tls, zName, zParent)
+ if rc != 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
+ return 1
+ } else if objc == 4 {
+ var pVfs uintptr = sqlite3.Xsqlite3_vfs_find(tls, zName)
+ sqlite3.Xsqlite3_vfs_register(tls, pVfs, 1)
+ }
+
+ tcl.XTcl_ResetResult(tls, interp)
+ return 0
+}
+
+// Tclcmd: sqlite3rbu_destroy_vfs NAME
+func test_sqlite3rbu_destroy_vfs(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_rbu.c:322:26: */
+ var zName uintptr
+
+ if objc != 2 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10219 /* "NAME" */)
+ return 1
+ }
+
+ zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
+ sqlite3.Xsqlite3rbu_destroy_vfs(tls, zName)
+ return 0
+}
+
+// Tclcmd: sqlite3rbu_internal_test
+func test_sqlite3rbu_internal_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_rbu.c:343:26: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var db uintptr
+
+ if objc != 1 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */)
+ return 1
+ }
+
+ db = sqlite3.Xsqlite3rbu_db(tls, uintptr(0), 0)
+ if db != uintptr(0) {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+10224 /* "sqlite3rbu_db(0,..." */, 0))
+ return 1
+ }
+
+ return 0
+}
+
+func SqliteRbu_Init(tls *libc.TLS, interp uintptr) int32 { /* test_rbu.c:365:5: */
+ var i int32
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd)) / uint64(unsafe.Sizeof(struct {
+ FzName uintptr
+ FxProc uintptr
+ }{}))); i++ {
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd[i].FzName, aObjCmd[i].FxProc, uintptr(0), uintptr(0))
+ }
+ return 0
+}
+
+var aObjCmd = [5]struct {
+ FzName uintptr
+ FxProc uintptr
+}{
+ {FzName: ts + 10247 /* "sqlite3rbu" */, FxProc: 0},
+ {FzName: ts + 10258 /* "sqlite3rbu_vacuu..." */, FxProc: 0},
+ {FzName: ts + 10276 /* "sqlite3rbu_creat..." */, FxProc: 0},
+ {FzName: ts + 10298 /* "sqlite3rbu_destr..." */, FxProc: 0},
+ {FzName: ts + 10321 /* "sqlite3rbu_inter..." */, FxProc: 0},
+} /* test_rbu.c:369:5 */
+
+// 2014-09-08
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// This file contains the bulk of the implementation of the
+// user-authentication extension feature. Some parts of the user-
+// authentication code are contained within the SQLite core (in the
+// src/ subdirectory of the main source code tree) but those parts
+// that could reasonable be separated out are moved into this file.
+//
+// To compile with the user-authentication feature, append this file to
+// end of an SQLite amalgamation, then add the SQLITE_USER_AUTHENTICATION
+// compile-time option. See the user-auth.txt file in the same source
+// directory as this file for additional information.
// Used to get the current process ID
// Copyright (C) 1991-2018 Free Software Foundation, Inc.
@@ -31415,7 +35410,7 @@ type IncrblobChannel = IncrblobChannel1 /* tclsqlite.c:142:32 */
// Compute a string length that is limited to what can be stored in
// lower 30 bits of a 32-bit signed integer.
-func strlen30(tls *crt.TLS, z uintptr) int32 { /* tclsqlite.c:202:12: */
+func strlen30(tls *libc.TLS, z uintptr) int32 { /* tclsqlite.c:202:12: */
var z2 uintptr = z
for *(*int8)(unsafe.Pointer(z2)) != 0 {
z2++
@@ -31425,7 +35420,7 @@ func strlen30(tls *crt.TLS, z uintptr) int32 { /* tclsqlite.c:202:12: */
// Close all incrblob channels opened using database connection pDb.
// This is called when shutting down the database connection.
-func closeIncrblobChannels(tls *crt.TLS, pDb uintptr) { /* tclsqlite.c:214:13: */
+func closeIncrblobChannels(tls *libc.TLS, pDb uintptr) { /* tclsqlite.c:214:13: */
var p uintptr
var pNext uintptr
@@ -31440,7 +35435,7 @@ func closeIncrblobChannels(tls *crt.TLS, pDb uintptr) { /* tclsqlite.c:214:13: *
}
// Close an incremental blob channel.
-func incrblobClose(tls *crt.TLS, instanceData ClientData, interp uintptr) int32 { /* tclsqlite.c:232:26: */
+func incrblobClose(tls *libc.TLS, instanceData ClientData, interp uintptr) int32 { /* tclsqlite.c:232:26: */
var p uintptr = instanceData
var rc int32 = sqlite3.Xsqlite3_blob_close(tls, (*IncrblobChannel)(unsafe.Pointer(p)).FpBlob)
var db uintptr = (*SqliteDb)(unsafe.Pointer((*IncrblobChannel)(unsafe.Pointer(p)).FpDb)).Fdb
@@ -31467,7 +35462,7 @@ func incrblobClose(tls *crt.TLS, instanceData ClientData, interp uintptr) int32
}
// Read data from an incremental blob channel.
-func incrblobInput(tls *crt.TLS, instanceData ClientData, buf uintptr, bufSize int32, errorCodePtr uintptr) int32 { /* tclsqlite.c:264:26: */
+func incrblobInput(tls *libc.TLS, instanceData ClientData, buf uintptr, bufSize int32, errorCodePtr uintptr) int32 { /* tclsqlite.c:264:26: */
var p uintptr = instanceData
var nRead int32 = bufSize // Number of bytes to read
var nBlob int32 // Total size of the blob
@@ -31492,7 +35487,7 @@ func incrblobInput(tls *crt.TLS, instanceData ClientData, buf uintptr, bufSize i
}
// Write data to an incremental blob channel.
-func incrblobOutput(tls *crt.TLS, instanceData ClientData, buf uintptr, toWrite int32, errorCodePtr uintptr) int32 { /* tclsqlite.c:296:26: */
+func incrblobOutput(tls *libc.TLS, instanceData ClientData, buf uintptr, toWrite int32, errorCodePtr uintptr) int32 { /* tclsqlite.c:296:26: */
var p uintptr = instanceData
var nWrite int32 = toWrite // Number of bytes to write
var nBlob int32 // Total size of the blob
@@ -31518,7 +35513,7 @@ func incrblobOutput(tls *crt.TLS, instanceData ClientData, buf uintptr, toWrite
}
// Seek an incremental blob channel.
-func incrblobSeek(tls *crt.TLS, instanceData ClientData, offset int64, seekMode int32, errorCodePtr uintptr) int32 { /* tclsqlite.c:329:26: */
+func incrblobSeek(tls *libc.TLS, instanceData ClientData, offset int64, seekMode int32, errorCodePtr uintptr) int32 { /* tclsqlite.c:329:26: */
var p uintptr = instanceData
switch seekMode {
@@ -31538,14 +35533,14 @@ func incrblobSeek(tls *crt.TLS, instanceData ClientData, offset int64, seekMode
return (*IncrblobChannel)(unsafe.Pointer(p)).FiSeek
}
-func incrblobWatch(tls *crt.TLS, instanceData ClientData, mode int32) { /* tclsqlite.c:355:27: */
+func incrblobWatch(tls *libc.TLS, instanceData ClientData, mode int32) { /* tclsqlite.c:355:27: */
// NO-OP
}
-func incrblobHandle(tls *crt.TLS, instanceData ClientData, dir int32, hPtr uintptr) int32 { /* tclsqlite.c:361:26: */
+func incrblobHandle(tls *libc.TLS, instanceData ClientData, dir int32, hPtr uintptr) int32 { /* tclsqlite.c:361:26: */
return 1
}
-var IncrblobChannelType = Tcl_ChannelType{FtypeName: ts + 8647 /* "incrblob" */, Fversion: // typeName
+var IncrblobChannelType = Tcl_ChannelType{FtypeName: ts + 10346 /* "incrblob" */, Fversion: // typeName
uintptr(0x2), FcloseProc:// version
0, FinputProc:// closeProc
0, FoutputProc:// inputProc
@@ -31563,7 +35558,7 @@ uintptr(0), // wideSeekProc
} /* tclsqlite.c:369:24 */
// Create a new incrblob channel.
-func createIncrblobChannel(tls *crt.TLS, interp uintptr, pDb uintptr, zDb uintptr, zTable uintptr, zColumn uintptr, iRow sqlite_int64, isReadonly int32) int32 { /* tclsqlite.c:390:12: */
+func createIncrblobChannel(tls *libc.TLS, interp uintptr, pDb uintptr, zDb uintptr, zTable uintptr, zColumn uintptr, iRow sqlite_int64, isReadonly int32) int32 { /* tclsqlite.c:390:12: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -31580,7 +35575,7 @@ func createIncrblobChannel(tls *crt.TLS, interp uintptr, pDb uintptr, zDb uintpt
}()))
// var zChannel [64]int8 at bp+16, 64
- rc = sqlite3.Xsqlite3_blob_open(tls, db, zDb, zTable, zColumn, iRow, crt.BoolInt32(!(isReadonly != 0)), bp+8 /* &pBlob */)
+ rc = sqlite3.Xsqlite3_blob_open(tls, db, zDb, zTable, zColumn, iRow, libc.BoolInt32(!(isReadonly != 0)), bp+8 /* &pBlob */)
if rc != 0 {
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(1))
return 1
@@ -31590,7 +35585,7 @@ func createIncrblobChannel(tls *crt.TLS, interp uintptr, pDb uintptr, zDb uintpt
(*IncrblobChannel)(unsafe.Pointer(p)).FiSeek = 0
(*IncrblobChannel)(unsafe.Pointer(p)).FpBlob = *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */))
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+16 /* &zChannel[0] */, ts+8656 /* "incrblob_%d" */, crt.VaList(bp, crt.PreIncInt32(&count, 1)))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+16 /* &zChannel[0] */, ts+10355 /* "incrblob_%d" */, libc.VaList(bp, libc.PreIncInt32(&count, 1)))
(*IncrblobChannel)(unsafe.Pointer(p)).Fchannel = tcl.XTcl_CreateChannel(tls, uintptr(unsafe.Pointer(&IncrblobChannelType)), bp+16 /* &zChannel[0] */, p, flags)
tcl.XTcl_RegisterChannel(tls, interp, (*IncrblobChannel)(unsafe.Pointer(p)).Fchannel)
@@ -31619,7 +35614,7 @@ var count int32 = 0 /* tclsqlite.c:406:14 */
// command name followed by zero or more arguments with no [...] or $
// or {...} or ; to be seen anywhere. Most callback scripts consist
// of just a single procedure name and they meet this requirement.
-func safeToUseEvalObjv(tls *crt.TLS, interp uintptr, pCmd uintptr) int32 { /* tclsqlite.c:451:12: */
+func safeToUseEvalObjv(tls *libc.TLS, interp uintptr, pCmd uintptr) int32 { /* tclsqlite.c:451:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -31630,8 +35625,8 @@ func safeToUseEvalObjv(tls *crt.TLS, interp uintptr, pCmd uintptr) int32 { /* tc
// var n int32 at bp, 4
z = tcl.XTcl_GetStringFromObj(tls, pCmd, bp /* &n */)
- for crt.PostDecInt32(&*(*int32)(unsafe.Pointer(bp /* n */)), 1) > 0 {
- var c int32 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))
+ for libc.PostDecInt32(&*(*int32)(unsafe.Pointer(bp /* n */)), 1) > 0 {
+ var c int32 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
if ((c == '$') || (c == '[')) || (c == ';') {
return 0
}
@@ -31642,13 +35637,13 @@ func safeToUseEvalObjv(tls *crt.TLS, interp uintptr, pCmd uintptr) int32 { /* tc
// Find an SqlFunc structure with the given name. Or create a new
// one if an existing one cannot be found. Return a pointer to the
// structure.
-func findSqlFunc(tls *crt.TLS, pDb uintptr, zName uintptr) uintptr { /* tclsqlite.c:471:16: */
+func findSqlFunc(tls *libc.TLS, pDb uintptr, zName uintptr) uintptr { /* tclsqlite.c:471:16: */
var p uintptr
var pNew uintptr
var nName int32 = strlen30(tls, zName)
pNew = tcl.XTcl_Alloc(tls, (uint32((uint64(unsafe.Sizeof(SqlFunc{})) + uint64(nName)) + uint64(1))))
(*SqlFunc)(unsafe.Pointer(pNew)).FzName = (pNew + uintptr(1)*48)
- crt.Xmemcpy(tls, (*SqlFunc)(unsafe.Pointer(pNew)).FzName, zName, (uint64(nName + 1)))
+ libc.Xmemcpy(tls, (*SqlFunc)(unsafe.Pointer(pNew)).FzName, zName, (uint64(nName + 1)))
for p = (*SqliteDb)(unsafe.Pointer(pDb)).FpFunc; p != 0; p = (*SqlFunc)(unsafe.Pointer(p)).FpNext {
if sqlite3.Xsqlite3_stricmp(tls, (*SqlFunc)(unsafe.Pointer(p)).FzName, (*SqlFunc)(unsafe.Pointer(pNew)).FzName) == 0 {
tcl.XTcl_Free(tls, pNew)
@@ -31664,7 +35659,7 @@ func findSqlFunc(tls *crt.TLS, pDb uintptr, zName uintptr) uintptr { /* tclsqlit
}
// Free a single SqlPreparedStmt object.
-func dbFreeStmt(tls *crt.TLS, pStmt uintptr) { /* tclsqlite.c:494:13: */
+func dbFreeStmt(tls *libc.TLS, pStmt uintptr) { /* tclsqlite.c:494:13: */
if sqlite3.Xsqlite3_sql(tls, (*SqlPreparedStmt)(unsafe.Pointer(pStmt)).FpStmt) == uintptr(0) {
tcl.XTcl_Free(tls, (*SqlPreparedStmt)(unsafe.Pointer(pStmt)).FzSql)
}
@@ -31673,7 +35668,7 @@ func dbFreeStmt(tls *crt.TLS, pStmt uintptr) { /* tclsqlite.c:494:13: */
}
// Finalize and free a list of prepared statements
-func flushStmtCache(tls *crt.TLS, pDb uintptr) { /* tclsqlite.c:507:13: */
+func flushStmtCache(tls *libc.TLS, pDb uintptr) { /* tclsqlite.c:507:13: */
var pPreStmt uintptr
var pNext uintptr
@@ -31688,7 +35683,7 @@ func flushStmtCache(tls *crt.TLS, pDb uintptr) { /* tclsqlite.c:507:13: */
// TCL calls this procedure when an sqlite3 database command is
// deleted.
-func DbDeleteCmd(tls *crt.TLS, db uintptr) { /* tclsqlite.c:524:27: */
+func DbDeleteCmd(tls *libc.TLS, db uintptr) { /* tclsqlite.c:524:27: */
var pDb uintptr = db
flushStmtCache(tls, pDb)
closeIncrblobChannels(tls, pDb)
@@ -31699,7 +35694,7 @@ func DbDeleteCmd(tls *crt.TLS, db uintptr) { /* tclsqlite.c:524:27: */
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*SqlFunc)(unsafe.Pointer(pFunc)).FpScript
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -31734,7 +35729,7 @@ func DbDeleteCmd(tls *crt.TLS, db uintptr) { /* tclsqlite.c:524:27: */
if (*SqliteDb)(unsafe.Pointer(pDb)).FpUpdateHook != 0 {
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = (*SqliteDb)(unsafe.Pointer(pDb)).FpUpdateHook
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -31742,7 +35737,7 @@ func DbDeleteCmd(tls *crt.TLS, db uintptr) { /* tclsqlite.c:524:27: */
if (*SqliteDb)(unsafe.Pointer(pDb)).FpPreUpdateHook != 0 {
for ok2 := true; ok2; ok2 = 0 != 0 {
var _objPtr uintptr = (*SqliteDb)(unsafe.Pointer(pDb)).FpPreUpdateHook
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -31750,7 +35745,7 @@ func DbDeleteCmd(tls *crt.TLS, db uintptr) { /* tclsqlite.c:524:27: */
if (*SqliteDb)(unsafe.Pointer(pDb)).FpRollbackHook != 0 {
for ok3 := true; ok3; ok3 = 0 != 0 {
var _objPtr uintptr = (*SqliteDb)(unsafe.Pointer(pDb)).FpRollbackHook
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -31758,7 +35753,7 @@ func DbDeleteCmd(tls *crt.TLS, db uintptr) { /* tclsqlite.c:524:27: */
if (*SqliteDb)(unsafe.Pointer(pDb)).FpWalHook != 0 {
for ok4 := true; ok4; ok4 = 0 != 0 {
var _objPtr uintptr = (*SqliteDb)(unsafe.Pointer(pDb)).FpWalHook
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -31766,7 +35761,7 @@ func DbDeleteCmd(tls *crt.TLS, db uintptr) { /* tclsqlite.c:524:27: */
if (*SqliteDb)(unsafe.Pointer(pDb)).FpCollateNeeded != 0 {
for ok5 := true; ok5; ok5 = 0 != 0 {
var _objPtr uintptr = (*SqliteDb)(unsafe.Pointer(pDb)).FpCollateNeeded
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -31776,7 +35771,7 @@ func DbDeleteCmd(tls *crt.TLS, db uintptr) { /* tclsqlite.c:524:27: */
// This routine is called when a database file is locked while trying
// to execute SQL.
-func DbBusyHandler(tls *crt.TLS, cd uintptr, nTries int32) int32 { /* tclsqlite.c:584:12: */
+func DbBusyHandler(tls *libc.TLS, cd uintptr, nTries int32) int32 { /* tclsqlite.c:584:12: */
bp := tls.Alloc(70)
defer tls.Free(70)
@@ -31784,21 +35779,21 @@ func DbBusyHandler(tls *crt.TLS, cd uintptr, nTries int32) int32 { /* tclsqlite.
var rc int32
// var zVal [30]int8 at bp+40, 30
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+40 /* &zVal[0] */, ts+1237 /* "%d" */, crt.VaList(bp, nTries))
- rc = tcl.XTcl_VarEval(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, crt.VaList(bp+8, (*SqliteDb)(unsafe.Pointer(pDb)).FzBusy, ts+3368 /* " " */, bp+40 /* &zVal[0] */, uintptr(0)))
- if (rc != 0) || (crt.Xatoi(tls, tcl.XTcl_GetStringResult(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp)) != 0) {
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+40 /* &zVal[0] */, ts+1237 /* "%d" */, libc.VaList(bp, nTries))
+ rc = tcl.XTcl_VarEval(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, libc.VaList(bp+8, (*SqliteDb)(unsafe.Pointer(pDb)).FzBusy, ts+4585 /* " " */, bp+40 /* &zVal[0] */, uintptr(0)))
+ if (rc != 0) || (libc.Xatoi(tls, tcl.XTcl_GetStringResult(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp)) != 0) {
return 0
}
return 1
}
// This routine is invoked as the 'progress callback' for the database.
-func DbProgressHandler(tls *crt.TLS, cd uintptr) int32 { /* tclsqlite.c:601:12: */
+func DbProgressHandler(tls *libc.TLS, cd uintptr) int32 { /* tclsqlite.c:601:12: */
var pDb uintptr = cd
var rc int32
rc = tcl.XTcl_Eval(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, (*SqliteDb)(unsafe.Pointer(pDb)).FzProgress)
- if (rc != 0) || (crt.Xatoi(tls, tcl.XTcl_GetStringResult(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp)) != 0) {
+ if (rc != 0) || (libc.Xatoi(tls, tcl.XTcl_GetStringResult(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp)) != 0) {
return 1
}
return 0
@@ -31806,7 +35801,7 @@ func DbProgressHandler(tls *crt.TLS, cd uintptr) int32 { /* tclsqlite.c:601:12:
// This routine is called by the SQLite trace handler whenever a new
// block of SQL is executed. The TCL script in pDb->zTrace is executed.
-func DbTraceHandler(tls *crt.TLS, cd uintptr, zSql uintptr) { /* tclsqlite.c:620:13: */
+func DbTraceHandler(tls *libc.TLS, cd uintptr, zSql uintptr) { /* tclsqlite.c:620:13: */
bp := tls.Alloc(216)
defer tls.Free(216)
@@ -31825,7 +35820,7 @@ func DbTraceHandler(tls *crt.TLS, cd uintptr, zSql uintptr) { /* tclsqlite.c:620
// supported event is generated. Unsupported event types are ignored.
// The TCL script in pDb->zTraceV2 is executed, with the arguments for
// the event appended to it (as list elements).
-func DbTraceV2Handler(tls *crt.TLS, type1 uint32, cd uintptr, pd uintptr, xd uintptr) int32 { /* tclsqlite.c:640:12: */
+func DbTraceV2Handler(tls *libc.TLS, type1 uint32, cd uintptr, pd uintptr, xd uintptr) int32 { /* tclsqlite.c:640:12: */
var pDb uintptr = cd
var pCmd uintptr
@@ -31844,7 +35839,7 @@ func DbTraceV2Handler(tls *crt.TLS, type1 uint32, cd uintptr, pd uintptr, xd uin
tcl.XTcl_EvalObjEx(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, pCmd, 0x040000)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pCmd
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -31865,7 +35860,7 @@ func DbTraceV2Handler(tls *crt.TLS, type1 uint32, cd uintptr, pd uintptr, xd uin
tcl.XTcl_EvalObjEx(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, pCmd, 0x040000)
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = pCmd
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -31883,7 +35878,7 @@ func DbTraceV2Handler(tls *crt.TLS, type1 uint32, cd uintptr, pd uintptr, xd uin
tcl.XTcl_EvalObjEx(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, pCmd, 0x040000)
for ok2 := true; ok2; ok2 = 0 != 0 {
var _objPtr uintptr = pCmd
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -31901,7 +35896,7 @@ func DbTraceV2Handler(tls *crt.TLS, type1 uint32, cd uintptr, pd uintptr, xd uin
tcl.XTcl_EvalObjEx(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, pCmd, 0x040000)
for ok3 := true; ok3; ok3 = 0 != 0 {
var _objPtr uintptr = pCmd
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -31914,7 +35909,7 @@ func DbTraceV2Handler(tls *crt.TLS, type1 uint32, cd uintptr, pd uintptr, xd uin
// This routine is called by the SQLite profile handler after a statement
// SQL has executed. The TCL script in pDb->zProfile is evaluated.
-func DbProfileHandler(tls *crt.TLS, cd uintptr, zSql uintptr, tm sqlite_uint64) { /* tclsqlite.c:715:13: */
+func DbProfileHandler(tls *libc.TLS, cd uintptr, zSql uintptr, tm1 sqlite_uint64) { /* tclsqlite.c:715:13: */
bp := tls.Alloc(328)
defer tls.Free(328)
@@ -31923,7 +35918,7 @@ func DbProfileHandler(tls *crt.TLS, cd uintptr, zSql uintptr, tm sqlite_uint64)
// var zTm [100]int8 at bp+8, 100
- sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof([100]int8{})) - uint64(1))), bp+8 /* &zTm[0] */, ts+8668 /* "%lld" */, crt.VaList(bp, tm))
+ sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof([100]int8{})) - uint64(1))), bp+8 /* &zTm[0] */, ts+10367 /* "%lld" */, libc.VaList(bp, tm1))
tcl.XTcl_DStringInit(tls, bp+112 /* &str */)
tcl.XTcl_DStringAppend(tls, bp+112 /* &str */, (*SqliteDb)(unsafe.Pointer(pDb)).FzProfile, -1)
tcl.XTcl_DStringAppendElement(tls, bp+112 /* &str */, zSql)
@@ -31937,18 +35932,18 @@ func DbProfileHandler(tls *crt.TLS, cd uintptr, zSql uintptr, tm sqlite_uint64)
// TCL script in pDb->zCommit is executed. If it returns non-zero or
// if it throws an exception, the transaction is rolled back instead
// of being committed.
-func DbCommitHandler(tls *crt.TLS, cd uintptr) int32 { /* tclsqlite.c:737:12: */
+func DbCommitHandler(tls *libc.TLS, cd uintptr) int32 { /* tclsqlite.c:737:12: */
var pDb uintptr = cd
var rc int32
rc = tcl.XTcl_Eval(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, (*SqliteDb)(unsafe.Pointer(pDb)).FzCommit)
- if (rc != 0) || (crt.Xatoi(tls, tcl.XTcl_GetStringResult(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp)) != 0) {
+ if (rc != 0) || (libc.Xatoi(tls, tcl.XTcl_GetStringResult(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp)) != 0) {
return 1
}
return 0
}
-func DbRollbackHandler(tls *crt.TLS, clientData uintptr) { /* tclsqlite.c:748:13: */
+func DbRollbackHandler(tls *libc.TLS, clientData uintptr) { /* tclsqlite.c:748:13: */
var pDb uintptr = clientData
if 0 != tcl.XTcl_EvalObjEx(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, (*SqliteDb)(unsafe.Pointer(pDb)).FpRollbackHook, 0) {
@@ -31957,7 +35952,7 @@ func DbRollbackHandler(tls *crt.TLS, clientData uintptr) { /* tclsqlite.c:748:13
}
// This procedure handles wal_hook callbacks.
-func DbWalHandler(tls *crt.TLS, clientData uintptr, db uintptr, zDb uintptr, nEntry int32) int32 { /* tclsqlite.c:759:12: */
+func DbWalHandler(tls *libc.TLS, clientData uintptr, db uintptr, zDb uintptr, nEntry int32) int32 { /* tclsqlite.c:759:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -31976,7 +35971,7 @@ func DbWalHandler(tls *crt.TLS, clientData uintptr, db uintptr, zDb uintptr, nEn
}
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = p
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -31984,19 +35979,19 @@ func DbWalHandler(tls *crt.TLS, clientData uintptr, db uintptr, zDb uintptr, nEn
return *(*int32)(unsafe.Pointer(bp /* ret */))
}
-func setTestUnlockNotifyVars(tls *crt.TLS, interp uintptr, iArg int32, nArg int32) { /* tclsqlite.c:787:13: */
+func setTestUnlockNotifyVars(tls *libc.TLS, interp uintptr, iArg int32, nArg int32) { /* tclsqlite.c:787:13: */
bp := tls.Alloc(80)
defer tls.Free(80)
// var zBuf [64]int8 at bp+16, 64
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+16 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp, iArg))
- tcl.XTcl_SetVar2(tls, interp, ts+8673 /* "sqlite_unlock_no..." */, uintptr(0), bp+16 /* &zBuf[0] */, 1)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+16 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+8, nArg))
- tcl.XTcl_SetVar2(tls, interp, ts+8698 /* "sqlite_unlock_no..." */, uintptr(0), bp+16 /* &zBuf[0] */, 1)
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+16 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp, iArg))
+ tcl.XTcl_SetVar2(tls, interp, ts+10372 /* "sqlite_unlock_no..." */, uintptr(0), bp+16 /* &zBuf[0] */, 1)
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+16 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+8, nArg))
+ tcl.XTcl_SetVar2(tls, interp, ts+10397 /* "sqlite_unlock_no..." */, uintptr(0), bp+16 /* &zBuf[0] */, 1)
}
-func DbUnlockNotify(tls *crt.TLS, apArg uintptr, nArg int32) { /* tclsqlite.c:799:13: */
+func DbUnlockNotify(tls *libc.TLS, apArg uintptr, nArg int32) { /* tclsqlite.c:799:13: */
var i int32
for i = 0; i < nArg; i++ {
var flags int32 = (0x020000 | 0x040000)
@@ -32006,7 +36001,7 @@ func DbUnlockNotify(tls *crt.TLS, apArg uintptr, nArg int32) { /* tclsqlite.c:79
tcl.XTcl_EvalObjEx(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, (*SqliteDb)(unsafe.Pointer(pDb)).FpUnlockNotify, flags)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*SqliteDb)(unsafe.Pointer(pDb)).FpUnlockNotify
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -32014,28 +36009,51 @@ func DbUnlockNotify(tls *crt.TLS, apArg uintptr, nArg int32) { /* tclsqlite.c:79
}
}
-func DbUpdateHandler(tls *crt.TLS, p uintptr, op int32, zDb uintptr, zTbl uintptr, rowid sqlite_int64) { /* tclsqlite.c:849:13: */
+// Pre-update hook callback.
+func DbPreUpdateHandler(tls *libc.TLS, p uintptr, db uintptr, op int32, zDb uintptr, zTbl uintptr, iKey1 sqlite_int64, iKey2 sqlite_int64) { /* tclsqlite.c:817:13: */
var pDb uintptr = p
var pCmd uintptr
- pCmd = tcl.XTcl_DuplicateObj(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FpUpdateHook)
+ pCmd = tcl.XTcl_DuplicateObj(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FpPreUpdateHook)
(*Tcl_Obj)(unsafe.Pointer(pCmd)).FrefCount++
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pCmd, tcl.XTcl_NewStringObj(tls, azStr[((op-1)/9)], -1))
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pCmd, tcl.XTcl_NewStringObj(tls, zDb, -1))
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pCmd, tcl.XTcl_NewStringObj(tls, zTbl, -1))
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pCmd, tcl.XTcl_NewWideIntObj(tls, int64(iKey1)))
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pCmd, tcl.XTcl_NewWideIntObj(tls, int64(iKey2)))
+ tcl.XTcl_EvalObjEx(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, pCmd, 0x040000)
+ for ok := true; ok; ok = 0 != 0 {
+ var _objPtr uintptr = pCmd
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ tcl.XTclFreeObj(tls, _objPtr)
+ }
+ }
+}
+
+var azStr = [3]uintptr{ts + 10427 /* "DELETE" */, ts + 10434 /* "INSERT" */, ts + 10441 /* "UPDATE" */} /* tclsqlite.c:828:21 */
+
+func DbUpdateHandler(tls *libc.TLS, p uintptr, op int32, zDb uintptr, zTbl uintptr, rowid sqlite_int64) { /* tclsqlite.c:849:13: */
+ var pDb uintptr = p
+ var pCmd uintptr
+
+ pCmd = tcl.XTcl_DuplicateObj(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FpUpdateHook)
+ (*Tcl_Obj)(unsafe.Pointer(pCmd)).FrefCount++
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pCmd, tcl.XTcl_NewStringObj(tls, azStr1[((op-1)/9)], -1))
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pCmd, tcl.XTcl_NewStringObj(tls, zDb, -1))
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pCmd, tcl.XTcl_NewStringObj(tls, zTbl, -1))
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pCmd, tcl.XTcl_NewWideIntObj(tls, int64(rowid)))
tcl.XTcl_EvalObjEx(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, pCmd, 0x040000)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pCmd
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
}
-var azStr = [3]uintptr{ts + 8728 /* "DELETE" */, ts + 8735 /* "INSERT" */, ts + 8742 /* "UPDATE" */} /* tclsqlite.c:858:21 */
+var azStr1 = [3]uintptr{ts + 10427 /* "DELETE" */, ts + 10434 /* "INSERT" */, ts + 10441 /* "UPDATE" */} /* tclsqlite.c:858:21 */
-func tclCollateNeeded(tls *crt.TLS, pCtx uintptr, db uintptr, enc int32, zName uintptr) { /* tclsqlite.c:877:13: */
+func tclCollateNeeded(tls *libc.TLS, pCtx uintptr, db uintptr, enc int32, zName uintptr) { /* tclsqlite.c:877:13: */
var pDb uintptr = pCtx
var pScript uintptr = tcl.XTcl_DuplicateObj(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FpCollateNeeded)
(*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++
@@ -32043,7 +36061,7 @@ func tclCollateNeeded(tls *crt.TLS, pCtx uintptr, db uintptr, enc int32, zName u
tcl.XTcl_EvalObjEx(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp, pScript, 0)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pScript
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -32051,7 +36069,7 @@ func tclCollateNeeded(tls *crt.TLS, pCtx uintptr, db uintptr, enc int32, zName u
// This routine is called to evaluate an SQL collation function implemented
// using TCL script.
-func tclSqlCollate(tls *crt.TLS, pCtx uintptr, nA int32, zA uintptr, nB int32, zB uintptr) int32 { /* tclsqlite.c:895:12: */
+func tclSqlCollate(tls *libc.TLS, pCtx uintptr, nA int32, zA uintptr, nB int32, zB uintptr) int32 { /* tclsqlite.c:895:12: */
var p uintptr = pCtx
var pCmd uintptr
@@ -32062,16 +36080,16 @@ func tclSqlCollate(tls *crt.TLS, pCtx uintptr, nA int32, zA uintptr, nB int32, z
tcl.XTcl_EvalObjEx(tls, (*SqlCollate)(unsafe.Pointer(p)).Finterp, pCmd, 0x040000)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pCmd
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
- return crt.Xatoi(tls, tcl.XTcl_GetStringResult(tls, (*SqlCollate)(unsafe.Pointer(p)).Finterp))
+ return libc.Xatoi(tls, tcl.XTcl_GetStringResult(tls, (*SqlCollate)(unsafe.Pointer(p)).Finterp))
}
// This routine is called to evaluate an SQL function implemented
// using TCL script.
-func tclSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* tclsqlite.c:918:13: */
+func tclSqlFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* tclsqlite.c:918:13: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -32090,7 +36108,7 @@ func tclSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* tc
rc = tcl.XTcl_EvalObjEx(tls, (*SqlFunc)(unsafe.Pointer(p)).Finterp, pCmd, 0)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pCmd
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -32161,7 +36179,7 @@ func tclSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* tc
if rc != 0 {
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = pCmd
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -32178,7 +36196,7 @@ func tclSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* tc
rc = tcl.XTcl_EvalObjEx(tls, (*SqlFunc)(unsafe.Pointer(p)).Finterp, pCmd, 0x040000)
for ok2 := true; ok2; ok2 = 0 != 0 {
var _objPtr uintptr = pCmd
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -32201,15 +36219,15 @@ func tclSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* tc
var eType int32 = (*SqlFunc)(unsafe.Pointer(p)).FeType
if eType == 5 {
- if ((int32(c) == 'b') && (crt.Xstrcmp(tls, zType, ts+8749 /* "bytearray" */) == 0)) && ((*Tcl_Obj)(unsafe.Pointer(pVar)).Fbytes == uintptr(0)) {
+ if ((int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2404 /* "bytearray" */) == 0)) && ((*Tcl_Obj)(unsafe.Pointer(pVar)).Fbytes == uintptr(0)) {
// Only return a BLOB type if the Tcl variable is a bytearray and
// has no string representation.
eType = 4
- } else if (((int32(c) == 'b') && (crt.Xstrcmp(tls, zType, ts+8759 /* "boolean" */) == 0)) ||
- ((int32(c) == 'w') && (crt.Xstrcmp(tls, zType, ts+8767 /* "wideInt" */) == 0))) ||
- ((int32(c) == 'i') && (crt.Xstrcmp(tls, zType, ts+8775 /* "int" */) == 0)) {
+ } else if (((int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2414 /* "boolean" */) == 0)) ||
+ ((int32(c) == 'w') && (libc.Xstrcmp(tls, zType, ts+2429 /* "wideInt" */) == 0))) ||
+ ((int32(c) == 'i') && (libc.Xstrcmp(tls, zType, ts+2437 /* "int" */) == 0)) {
eType = 1
- } else if (int32(c) == 'd') && (crt.Xstrcmp(tls, zType, ts+2637 /* "double" */) == 0) {
+ } else if (int32(c) == 'd') && (libc.Xstrcmp(tls, zType, ts+2422 /* "double" */) == 0) {
eType = 2
} else {
eType = 3
@@ -32220,7 +36238,7 @@ func tclSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* tc
case 4:
{
data = tcl.XTcl_GetByteArrayFromObj(tls, pVar, bp+16 /* &n */)
- sqlite3.Xsqlite3_result_blob(tls, context, data, *(*int32)(unsafe.Pointer(bp + 16 /* n */)), crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_blob(tls, context, data, *(*int32)(unsafe.Pointer(bp + 16 /* n */)), libc.UintptrFromInt32(-1))
break
}
fallthrough
@@ -32249,7 +36267,7 @@ func tclSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* tc
default:
{
data = tcl.XTcl_GetStringFromObj(tls, pVar, bp+16 /* &n */)
- sqlite3.Xsqlite3_result_text(tls, context, data, *(*int32)(unsafe.Pointer(bp + 16 /* n */)), crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, context, data, *(*int32)(unsafe.Pointer(bp + 16 /* n */)), libc.UintptrFromInt32(-1))
break
}
}
@@ -32260,7 +36278,7 @@ func tclSqlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* tc
// type code and the two arguments to zCmd[] then invokes the result
// on the interpreter. The reply is examined to determine if the
// authentication fails or succeeds.
-func auth_callback(tls *crt.TLS, pArg uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr, zArg4 uintptr) int32 { /* tclsqlite.c:1069:12: */
+func auth_callback(tls *libc.TLS, pArg uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr, zArg4 uintptr) int32 { /* tclsqlite.c:1069:12: */
bp := tls.Alloc(216)
defer tls.Free(216)
@@ -32282,109 +36300,109 @@ func auth_callback(tls *crt.TLS, pArg uintptr, code int32, zArg1 uintptr, zArg2
// authorized.
switch code {
case 0:
- zCode = ts + 8779 /* "SQLITE_COPY" */
+ zCode = ts + 10448 /* "SQLITE_COPY" */
break
case 1:
- zCode = ts + 8791 /* "SQLITE_CREATE_IN..." */
+ zCode = ts + 10460 /* "SQLITE_CREATE_IN..." */
break
case 2:
- zCode = ts + 8811 /* "SQLITE_CREATE_TA..." */
+ zCode = ts + 10480 /* "SQLITE_CREATE_TA..." */
break
case 3:
- zCode = ts + 8831 /* "SQLITE_CREATE_TE..." */
+ zCode = ts + 10500 /* "SQLITE_CREATE_TE..." */
break
case 4:
- zCode = ts + 8856 /* "SQLITE_CREATE_TE..." */
+ zCode = ts + 10525 /* "SQLITE_CREATE_TE..." */
break
case 5:
- zCode = ts + 8881 /* "SQLITE_CREATE_TE..." */
+ zCode = ts + 10550 /* "SQLITE_CREATE_TE..." */
break
case 6:
- zCode = ts + 8908 /* "SQLITE_CREATE_TE..." */
+ zCode = ts + 10577 /* "SQLITE_CREATE_TE..." */
break
case 7:
- zCode = ts + 8932 /* "SQLITE_CREATE_TR..." */
+ zCode = ts + 10601 /* "SQLITE_CREATE_TR..." */
break
case 8:
- zCode = ts + 8954 /* "SQLITE_CREATE_VI..." */
+ zCode = ts + 10623 /* "SQLITE_CREATE_VI..." */
break
case 9:
- zCode = ts + 8973 /* "SQLITE_DELETE" */
+ zCode = ts + 10642 /* "SQLITE_DELETE" */
break
case 10:
- zCode = ts + 8987 /* "SQLITE_DROP_INDE..." */
+ zCode = ts + 10656 /* "SQLITE_DROP_INDE..." */
break
case 11:
- zCode = ts + 9005 /* "SQLITE_DROP_TABL..." */
+ zCode = ts + 10674 /* "SQLITE_DROP_TABL..." */
break
case 12:
- zCode = ts + 9023 /* "SQLITE_DROP_TEMP..." */
+ zCode = ts + 10692 /* "SQLITE_DROP_TEMP..." */
break
case 13:
- zCode = ts + 9046 /* "SQLITE_DROP_TEMP..." */
+ zCode = ts + 10715 /* "SQLITE_DROP_TEMP..." */
break
case 14:
- zCode = ts + 9069 /* "SQLITE_DROP_TEMP..." */
+ zCode = ts + 10738 /* "SQLITE_DROP_TEMP..." */
break
case 15:
- zCode = ts + 9094 /* "SQLITE_DROP_TEMP..." */
+ zCode = ts + 10763 /* "SQLITE_DROP_TEMP..." */
break
case 16:
- zCode = ts + 9116 /* "SQLITE_DROP_TRIG..." */
+ zCode = ts + 10785 /* "SQLITE_DROP_TRIG..." */
break
case 17:
- zCode = ts + 9136 /* "SQLITE_DROP_VIEW" */
+ zCode = ts + 10805 /* "SQLITE_DROP_VIEW" */
break
case 18:
- zCode = ts + 9153 /* "SQLITE_INSERT" */
+ zCode = ts + 10822 /* "SQLITE_INSERT" */
break
case 19:
- zCode = ts + 9167 /* "SQLITE_PRAGMA" */
+ zCode = ts + 10836 /* "SQLITE_PRAGMA" */
break
case 20:
- zCode = ts + 9181 /* "SQLITE_READ" */
+ zCode = ts + 10850 /* "SQLITE_READ" */
break
case 21:
- zCode = ts + 9193 /* "SQLITE_SELECT" */
+ zCode = ts + 10862 /* "SQLITE_SELECT" */
break
case 22:
- zCode = ts + 9207 /* "SQLITE_TRANSACTI..." */
+ zCode = ts + 10876 /* "SQLITE_TRANSACTI..." */
break
case 23:
- zCode = ts + 9226 /* "SQLITE_UPDATE" */
+ zCode = ts + 10895 /* "SQLITE_UPDATE" */
break
case 24:
- zCode = ts + 9240 /* "SQLITE_ATTACH" */
+ zCode = ts + 10909 /* "SQLITE_ATTACH" */
break
case 25:
- zCode = ts + 9254 /* "SQLITE_DETACH" */
+ zCode = ts + 10923 /* "SQLITE_DETACH" */
break
case 26:
- zCode = ts + 9268 /* "SQLITE_ALTER_TAB..." */
+ zCode = ts + 10937 /* "SQLITE_ALTER_TAB..." */
break
case 27:
- zCode = ts + 9287 /* "SQLITE_REINDEX" */
+ zCode = ts + 10956 /* "SQLITE_REINDEX" */
break
case 28:
- zCode = ts + 9302 /* "SQLITE_ANALYZE" */
+ zCode = ts + 10971 /* "SQLITE_ANALYZE" */
break
case 29:
- zCode = ts + 9317 /* "SQLITE_CREATE_VT..." */
+ zCode = ts + 10986 /* "SQLITE_CREATE_VT..." */
break
case 30:
- zCode = ts + 9338 /* "SQLITE_DROP_VTAB..." */
+ zCode = ts + 11007 /* "SQLITE_DROP_VTAB..." */
break
case 31:
- zCode = ts + 9357 /* "SQLITE_FUNCTION" */
+ zCode = ts + 11026 /* "SQLITE_FUNCTION" */
break
case 32:
- zCode = ts + 9373 /* "SQLITE_SAVEPOINT" */
+ zCode = ts + 11042 /* "SQLITE_SAVEPOINT" */
break
case 33:
- zCode = ts + 9390 /* "SQLITE_RECURSIVE" */
+ zCode = ts + 11059 /* "SQLITE_RECURSIVE" */
break
default:
- zCode = ts + 9407 /* "????" */
+ zCode = ts + 11076 /* "????" */
break
}
tcl.XTcl_DStringInit(tls, bp /* &str */)
@@ -32419,13 +36437,13 @@ func auth_callback(tls *crt.TLS, pArg uintptr, code int32, zArg1 uintptr, zArg2
if rc == 0 {
zReply = tcl.XTcl_GetStringResult(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Finterp)
} else {
- zReply = ts + 9412 /* "SQLITE_DENY" */
+ zReply = ts + 11081 /* "SQLITE_DENY" */
}
- if crt.Xstrcmp(tls, zReply, ts+9424 /* "SQLITE_OK" */) == 0 {
+ if libc.Xstrcmp(tls, zReply, ts+1987 /* "SQLITE_OK" */) == 0 {
rc = 0
- } else if crt.Xstrcmp(tls, zReply, ts+9412 /* "SQLITE_DENY" */) == 0 {
+ } else if libc.Xstrcmp(tls, zReply, ts+11081 /* "SQLITE_DENY" */) == 0 {
rc = 1
- } else if crt.Xstrcmp(tls, zReply, ts+9434 /* "SQLITE_IGNORE" */) == 0 {
+ } else if libc.Xstrcmp(tls, zReply, ts+11093 /* "SQLITE_IGNORE" */) == 0 {
rc = 2
} else {
rc = 999
@@ -32442,13 +36460,13 @@ func auth_callback(tls *crt.TLS, pArg uintptr, code int32, zArg1 uintptr, zArg2
// is done.
//
// copied from shell.c from '.import' command
-func local_getline(tls *crt.TLS, zPrompt uintptr, in uintptr) uintptr { /* tclsqlite.c:1168:13: */
+func local_getline(tls *libc.TLS, zPrompt uintptr, in uintptr) uintptr { /* tclsqlite.c:1168:13: */
var zLine uintptr
var nLine int32
var n int32
nLine = 100
- zLine = crt.Xmalloc(tls, uint64(nLine))
+ zLine = libc.Xmalloc(tls, uint64(nLine))
if zLine == uintptr(0) {
return uintptr(0)
}
@@ -32456,14 +36474,14 @@ func local_getline(tls *crt.TLS, zPrompt uintptr, in uintptr) uintptr { /* tclsq
for 1 != 0 {
if (n + 100) > nLine {
nLine = ((nLine * 2) + 100)
- zLine = crt.Xrealloc(tls, zLine, uint64(nLine))
+ zLine = libc.Xrealloc(tls, zLine, uint64(nLine))
if zLine == uintptr(0) {
return uintptr(0)
}
}
- if crt.Xfgets(tls, (zLine+uintptr(n)), (nLine-n), in) == uintptr(0) {
+ if libc.Xfgets(tls, (zLine+uintptr(n)), (nLine-n), in) == uintptr(0) {
if n == 0 {
- crt.Xfree(tls, zLine)
+ libc.Xfree(tls, zLine)
return uintptr(0)
}
*(*int8)(unsafe.Pointer(zLine + uintptr(n))) = int8(0)
@@ -32478,7 +36496,7 @@ func local_getline(tls *crt.TLS, zPrompt uintptr, in uintptr) uintptr { /* tclsq
break
}
}
- zLine = crt.Xrealloc(tls, zLine, (uint64(n + 1)))
+ zLine = libc.Xrealloc(tls, zLine, (uint64(n + 1)))
return zLine
}
@@ -32488,7 +36506,7 @@ func local_getline(tls *crt.TLS, zPrompt uintptr, in uintptr) uintptr { /* tclsq
//
// It is invoked after evaluating the script SCRIPT to commit or rollback
// the transaction or savepoint opened by the [transaction] command.
-func DbTransPostCmd(tls *crt.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclsqlite.c:1211:26: */
+func DbTransPostCmd(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclsqlite.c:1211:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -32497,7 +36515,7 @@ func DbTransPostCmd(tls *crt.TLS, data uintptr, interp uintptr, result int32) in
var zEnd uintptr
(*SqliteDb)(unsafe.Pointer(pDb)).FnTransaction--
- zEnd = azEnd[(((crt.Bool32(rc == 1)) * 2) + (crt.Bool32((*SqliteDb)(unsafe.Pointer(pDb)).FnTransaction == 0)))]
+ zEnd = azEnd[(((libc.Bool32(rc == 1)) * 2) + (libc.Bool32((*SqliteDb)(unsafe.Pointer(pDb)).FnTransaction == 0)))]
(*SqliteDb)(unsafe.Pointer(pDb)).FdisableAuth++
if sqlite3.Xsqlite3_exec(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zEnd, uintptr(0), uintptr(0), uintptr(0)) != 0 {
@@ -32511,10 +36529,10 @@ func DbTransPostCmd(tls *crt.TLS, data uintptr, interp uintptr, result int32) in
// COMMIT, SAVEPOINT, RELEASE or ROLLBACK commands that are confusing
// this method's logic. Not clear how this would be best handled.
if rc != 1 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
rc = 1
}
- sqlite3.Xsqlite3_exec(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, ts+5807 /* "ROLLBACK" */, uintptr(0), uintptr(0), uintptr(0))
+ sqlite3.Xsqlite3_exec(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, ts+7092 /* "ROLLBACK" */, uintptr(0), uintptr(0), uintptr(0))
}
(*SqliteDb)(unsafe.Pointer(pDb)).FdisableAuth--
@@ -32522,10 +36540,10 @@ func DbTransPostCmd(tls *crt.TLS, data uintptr, interp uintptr, result int32) in
}
var azEnd = [4]uintptr{
- ts + 9448, /* "RELEASE _tcl_tra..." */ // rc==TCL_ERROR, nTransaction!=0
- ts + 9473, /* "COMMIT" */ // rc!=TCL_ERROR, nTransaction==0
- ts + 9480, /* "ROLLBACK TO _tcl..." */
- ts + 5807, /* "ROLLBACK" */ // rc==TCL_ERROR, nTransaction==0
+ ts + 11107, /* "RELEASE _tcl_tra..." */ // rc==TCL_ERROR, nTransaction!=0
+ ts + 11132, /* "COMMIT" */ // rc!=TCL_ERROR, nTransaction==0
+ ts + 11139, /* "ROLLBACK TO _tcl..." */
+ ts + 7092, /* "ROLLBACK" */ // rc==TCL_ERROR, nTransaction==0
} /* tclsqlite.c:1216:21 */
// Unless SQLITE_TEST is defined, this function is a simple wrapper around
@@ -32533,7 +36551,7 @@ var azEnd = [4]uintptr{
// sqlite3_prepare_v2() or legacy interface sqlite3_prepare(), depending
// on whether or not the [db_use_legacy_prepare] command has been used to
// configure the connection.
-func dbPrepare(tls *crt.TLS, pDb uintptr, zSql uintptr, ppStmt uintptr, pzOut uintptr) int32 { /* tclsqlite.c:1259:12: */
+func dbPrepare(tls *libc.TLS, pDb uintptr, zSql uintptr, ppStmt uintptr, pzOut uintptr) int32 { /* tclsqlite.c:1259:12: */
var prepFlags uint32 = uint32(0)
if (*SqliteDb)(unsafe.Pointer(pDb)).FbLegacyPrepare != 0 {
return sqlite3.Xsqlite3_prepare(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zSql, -1, ppStmt, pzOut)
@@ -32561,7 +36579,7 @@ func dbPrepare(tls *crt.TLS, pDb uintptr, zSql uintptr, ppStmt uintptr, pzOut ui
//
// If successful, TCL_OK is returned. Otherwise, TCL_ERROR is returned
// and an error message loaded into interpreter pDb->interp.
-func dbPrepareAndBind(tls *crt.TLS, pDb uintptr, zIn uintptr, pzOut uintptr, ppPreStmt uintptr) int32 { /* tclsqlite.c:1294:12: */
+func dbPrepareAndBind(tls *libc.TLS, pDb uintptr, zIn uintptr, pzOut uintptr, ppPreStmt uintptr) int32 { /* tclsqlite.c:1294:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -32580,7 +36598,7 @@ func dbPrepareAndBind(tls *crt.TLS, pDb uintptr, zIn uintptr, pzOut uintptr, ppP
*(*uintptr)(unsafe.Pointer(ppPreStmt)) = uintptr(0)
// Trim spaces from the start of zSql and calculate the remaining length.
- for ((((int32(crt.AssignInt8(&c, *(*int8)(unsafe.Pointer(zSql + uintptr(0)))))) == ' ') || (int32(c) == '\t')) || (int32(c) == '\r')) || (int32(c) == '\n') {
+ for ((((int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(zSql + uintptr(0)))))) == ' ') || (int32(c) == '\t')) || (int32(c) == '\r')) || (int32(c) == '\n') {
zSql++
}
nSql = strlen30(tls, zSql)
@@ -32588,7 +36606,7 @@ func dbPrepareAndBind(tls *crt.TLS, pDb uintptr, zIn uintptr, pzOut uintptr, ppP
for pPreStmt = (*SqliteDb)(unsafe.Pointer(pDb)).FstmtList; pPreStmt != 0; pPreStmt = (*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FpNext {
var n int32 = (*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FnSql
if ((nSql >= n) &&
- (crt.Xmemcmp(tls, (*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FzSql, zSql, uint64(n)) == 0)) &&
+ (libc.Xmemcmp(tls, (*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FzSql, zSql, uint64(n)) == 0)) &&
((int32(*(*int8)(unsafe.Pointer(zSql + uintptr(n)))) == 0) || (int32(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1))))) == ';')) {
*(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = (*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FpStmt
*(*uintptr)(unsafe.Pointer(pzOut)) = (zSql + uintptr((*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FnSql))
@@ -32636,7 +36654,7 @@ func dbPrepareAndBind(tls *crt.TLS, pDb uintptr, zIn uintptr, pzOut uintptr, ppP
nVar = sqlite3.Xsqlite3_bind_parameter_count(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
nByte = (int32(uint64(unsafe.Sizeof(SqlPreparedStmt{})) + (uint64(nVar) * uint64(unsafe.Sizeof(uintptr(0))))))
pPreStmt = tcl.XTcl_Alloc(tls, uint32(nByte))
- crt.Xmemset(tls, pPreStmt, 0, uint64(nByte))
+ libc.Xmemset(tls, pPreStmt, 0, uint64(nByte))
(*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FpStmt = *(*uintptr)(unsafe.Pointer(bp /* pStmt */))
(*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FnSql = (int32((int64(*(*uintptr)(unsafe.Pointer(pzOut))) - int64(zSql)) / 1))
@@ -32644,7 +36662,7 @@ func dbPrepareAndBind(tls *crt.TLS, pDb uintptr, zIn uintptr, pzOut uintptr, ppP
(*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FapParm = (pPreStmt + uintptr(1)*56)
if (*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FzSql == uintptr(0) {
var zCopy uintptr = tcl.XTcl_Alloc(tls, (uint32((*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FnSql + 1)))
- crt.Xmemcpy(tls, zCopy, zSql, uint64((*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FnSql))
+ libc.Xmemcpy(tls, zCopy, zSql, uint64((*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FnSql))
*(*int8)(unsafe.Pointer(zCopy + uintptr((*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FnSql))) = int8(0)
(*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FzSql = zCopy
}
@@ -32668,7 +36686,7 @@ func dbPrepareAndBind(tls *crt.TLS, pDb uintptr, zIn uintptr, pzOut uintptr, ppP
rx = tcl.XTcl_EvalObjEx(tls, interp, pCmd, 0x040000)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pCmd
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -32692,23 +36710,23 @@ func dbPrepareAndBind(tls *crt.TLS, pDb uintptr, zIn uintptr, pzOut uintptr, ppP
return ts + 488 /* "" */
}()
c = *(*int8)(unsafe.Pointer(zType + uintptr(0)))
- if (int32(*(*int8)(unsafe.Pointer(zVar + uintptr(0)))) == '@') || (((int32(c) == 'b') && (crt.Xstrcmp(tls, zType, ts+8749 /* "bytearray" */) == 0)) && ((*Tcl_Obj)(unsafe.Pointer(pVar)).Fbytes == uintptr(0))) {
+ if (int32(*(*int8)(unsafe.Pointer(zVar + uintptr(0)))) == '@') || (((int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2404 /* "bytearray" */) == 0)) && ((*Tcl_Obj)(unsafe.Pointer(pVar)).Fbytes == uintptr(0))) {
// Load a BLOB type if the Tcl variable is a bytearray and
// it has no string representation or the host
// parameter name begins with "@".
data = tcl.XTcl_GetByteArrayFromObj(tls, pVar, bp+8 /* &n */)
sqlite3.Xsqlite3_bind_blob(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), i, data, *(*int32)(unsafe.Pointer(bp + 8 /* n */)), uintptr(0))
(*Tcl_Obj)(unsafe.Pointer(pVar)).FrefCount++
- *(*uintptr)(unsafe.Pointer((*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FapParm + uintptr(crt.PostIncInt32(&iParm, 1))*8)) = pVar
- } else if (int32(c) == 'b') && (crt.Xstrcmp(tls, zType, ts+8759 /* "boolean" */) == 0) {
+ *(*uintptr)(unsafe.Pointer((*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FapParm + uintptr(libc.PostIncInt32(&iParm, 1))*8)) = pVar
+ } else if (int32(c) == 'b') && (libc.Xstrcmp(tls, zType, ts+2414 /* "boolean" */) == 0) {
tcl.XTcl_GetIntFromObj(tls, interp, pVar, bp+8 /* &n */)
sqlite3.Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), i, *(*int32)(unsafe.Pointer(bp + 8 /* n */)))
- } else if (int32(c) == 'd') && (crt.Xstrcmp(tls, zType, ts+2637 /* "double" */) == 0) {
+ } else if (int32(c) == 'd') && (libc.Xstrcmp(tls, zType, ts+2422 /* "double" */) == 0) {
// var r float64 at bp+16, 8
tcl.XTcl_GetDoubleFromObj(tls, interp, pVar, bp+16 /* &r */)
sqlite3.Xsqlite3_bind_double(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), i, *(*float64)(unsafe.Pointer(bp + 16 /* r */)))
- } else if ((int32(c) == 'w') && (crt.Xstrcmp(tls, zType, ts+8767 /* "wideInt" */) == 0)) || ((int32(c) == 'i') && (crt.Xstrcmp(tls, zType, ts+8775 /* "int" */) == 0)) {
+ } else if ((int32(c) == 'w') && (libc.Xstrcmp(tls, zType, ts+2429 /* "wideInt" */) == 0)) || ((int32(c) == 'i') && (libc.Xstrcmp(tls, zType, ts+2437 /* "int" */) == 0)) {
// var v Tcl_WideInt at bp+24, 8
tcl.XTcl_GetWideIntFromObj(tls, interp, pVar, bp+24 /* &v */)
@@ -32717,7 +36735,7 @@ func dbPrepareAndBind(tls *crt.TLS, pDb uintptr, zIn uintptr, pzOut uintptr, ppP
data = tcl.XTcl_GetStringFromObj(tls, pVar, bp+8 /* &n */)
sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), i, data, *(*int32)(unsafe.Pointer(bp + 8 /* n */)), uintptr(0))
(*Tcl_Obj)(unsafe.Pointer(pVar)).FrefCount++
- *(*uintptr)(unsafe.Pointer((*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FapParm + uintptr(crt.PostIncInt32(&iParm, 1))*8)) = pVar
+ *(*uintptr)(unsafe.Pointer((*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FapParm + uintptr(libc.PostIncInt32(&iParm, 1))*8)) = pVar
}
} else {
sqlite3.Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), i)
@@ -32743,14 +36761,14 @@ func dbPrepareAndBind(tls *crt.TLS, pDb uintptr, zIn uintptr, pzOut uintptr, ppP
// If the discard parameter is non-zero, then the statement is deleted
// immediately. Otherwise it is added to the LRU list and may be returned
// by a subsequent call to dbPrepareAndBind().
-func dbReleaseStmt(tls *crt.TLS, pDb uintptr, pPreStmt uintptr, discard int32) { /* tclsqlite.c:1470:13: */
+func dbReleaseStmt(tls *libc.TLS, pDb uintptr, pPreStmt uintptr, discard int32) { /* tclsqlite.c:1470:13: */
var i int32
// Free the bound string and blob parameters
for i = 0; i < (*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FnParm; i++ {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = *(*uintptr)(unsafe.Pointer((*SqlPreparedStmt)(unsafe.Pointer(pPreStmt)).FapParm + uintptr(i)*8))
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -32816,13 +36834,13 @@ type DbEvalContext = DbEvalContext1 /* tclsqlite.c:1523:30 */
// Release any cache of column names currently held as part of
// the DbEvalContext structure passed as the first argument.
-func dbReleaseColumnNames(tls *crt.TLS, p uintptr) { /* tclsqlite.c:1541:13: */
+func dbReleaseColumnNames(tls *libc.TLS, p uintptr) { /* tclsqlite.c:1541:13: */
if (*DbEvalContext)(unsafe.Pointer(p)).FapColName != 0 {
var i int32
for i = 0; i < (*DbEvalContext)(unsafe.Pointer(p)).FnCol; i++ {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = *(*uintptr)(unsafe.Pointer((*DbEvalContext)(unsafe.Pointer(p)).FapColName + uintptr(i)*8))
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -32843,8 +36861,8 @@ func dbReleaseColumnNames(tls *crt.TLS, p uintptr) { /* tclsqlite.c:1541:13: */
// tcl command:
//
// set ${pArray}(*) {a b c}
-func dbEvalInit(tls *crt.TLS, p uintptr, pDb uintptr, pSql uintptr, pArray uintptr, evalFlags int32) { /* tclsqlite.c:1565:13: */
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DbEvalContext{})))
+func dbEvalInit(tls *libc.TLS, p uintptr, pDb uintptr, pSql uintptr, pArray uintptr, evalFlags int32) { /* tclsqlite.c:1565:13: */
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DbEvalContext{})))
(*DbEvalContext)(unsafe.Pointer(p)).FpDb = pDb
(*DbEvalContext)(unsafe.Pointer(p)).FzSql = tcl.XTcl_GetString(tls, pSql)
(*DbEvalContext)(unsafe.Pointer(p)).FpSql = pSql
@@ -32858,7 +36876,7 @@ func dbEvalInit(tls *crt.TLS, p uintptr, pDb uintptr, pSql uintptr, pArray uintp
// Obtain information about the row that the DbEvalContext passed as the
// first argument currently points to.
-func dbEvalRowInfo(tls *crt.TLS, p uintptr, pnCol uintptr, papColName uintptr) { /* tclsqlite.c:1588:13: */
+func dbEvalRowInfo(tls *libc.TLS, p uintptr, pnCol uintptr, papColName uintptr) { /* tclsqlite.c:1588:13: */
// Compute column names
if uintptr(0) == (*DbEvalContext)(unsafe.Pointer(p)).FapColName {
var pStmt uintptr = (*SqlPreparedStmt)(unsafe.Pointer((*DbEvalContext)(unsafe.Pointer(p)).FpPreStmt)).FpStmt
@@ -32866,7 +36884,7 @@ func dbEvalRowInfo(tls *crt.TLS, p uintptr, pnCol uintptr, papColName uintptr) {
var nCol int32 // Number of columns returned by pStmt
var apColName uintptr = uintptr(0) // Array of column names
- (*DbEvalContext)(unsafe.Pointer(p)).FnCol = crt.AssignInt32(&nCol, sqlite3.Xsqlite3_column_count(tls, pStmt))
+ (*DbEvalContext)(unsafe.Pointer(p)).FnCol = libc.AssignInt32(&nCol, sqlite3.Xsqlite3_column_count(tls, pStmt))
if (nCol > 0) && ((papColName != 0) || ((*DbEvalContext)(unsafe.Pointer(p)).FpArray != 0)) {
apColName = tcl.XTcl_Alloc(tls, (uint32(uint64(unsafe.Sizeof(uintptr(0))) * uint64(nCol))))
for i = 0; i < nCol; i++ {
@@ -32881,7 +36899,7 @@ func dbEvalRowInfo(tls *crt.TLS, p uintptr, pnCol uintptr, papColName uintptr) {
if (*DbEvalContext)(unsafe.Pointer(p)).FpArray != 0 {
var interp uintptr = (*SqliteDb)(unsafe.Pointer((*DbEvalContext)(unsafe.Pointer(p)).FpDb)).Finterp
var pColList uintptr = tcl.XTcl_NewObj(tls)
- var pStar uintptr = tcl.XTcl_NewStringObj(tls, ts+2498 /* "*" */, -1)
+ var pStar uintptr = tcl.XTcl_NewStringObj(tls, ts+3654 /* "*" */, -1)
for i = 0; i < nCol; i++ {
tcl.XTcl_ListObjAppendElement(tls, interp, pColList, *(*uintptr)(unsafe.Pointer(apColName + uintptr(i)*8)))
@@ -32890,7 +36908,7 @@ func dbEvalRowInfo(tls *crt.TLS, p uintptr, pnCol uintptr, papColName uintptr) {
tcl.XTcl_ObjSetVar2(tls, interp, (*DbEvalContext)(unsafe.Pointer(p)).FpArray, pStar, pColList, 0)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pStar
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -32914,7 +36932,7 @@ func dbEvalRowInfo(tls *crt.TLS, p uintptr, pnCol uintptr, papColName uintptr) {
// is analogous to a return of SQLITE_ROW from sqlite3_step(). If TCL_BREAK
// is returned, then the SQL script has finished executing and there are
// no further rows available. This is similar to SQLITE_DONE.
-func dbEvalStep(tls *crt.TLS, p uintptr) int32 { /* tclsqlite.c:1646:12: */
+func dbEvalStep(tls *libc.TLS, p uintptr) int32 { /* tclsqlite.c:1646:12: */
var zPrevSql uintptr = uintptr(0) // Previous value of p->zSql
for (*(*int8)(unsafe.Pointer((*DbEvalContext)(unsafe.Pointer(p)).FzSql + uintptr(0))) != 0) || ((*DbEvalContext)(unsafe.Pointer(p)).FpPreStmt != 0) {
@@ -32981,7 +36999,7 @@ func dbEvalStep(tls *crt.TLS, p uintptr) int32 { /* tclsqlite.c:1646:12: */
// Free all resources currently held by the DbEvalContext structure passed
// as the first argument. There should be exactly one call to this function
// for each call to dbEvalInit().
-func dbEvalFinalize(tls *crt.TLS, p uintptr) { /* tclsqlite.c:1710:13: */
+func dbEvalFinalize(tls *libc.TLS, p uintptr) { /* tclsqlite.c:1710:13: */
if (*DbEvalContext)(unsafe.Pointer(p)).FpPreStmt != 0 {
sqlite3.Xsqlite3_reset(tls, (*SqlPreparedStmt)(unsafe.Pointer((*DbEvalContext)(unsafe.Pointer(p)).FpPreStmt)).FpStmt)
dbReleaseStmt(tls, (*DbEvalContext)(unsafe.Pointer(p)).FpDb, (*DbEvalContext)(unsafe.Pointer(p)).FpPreStmt, 0)
@@ -32990,7 +37008,7 @@ func dbEvalFinalize(tls *crt.TLS, p uintptr) { /* tclsqlite.c:1710:13: */
if (*DbEvalContext)(unsafe.Pointer(p)).FpArray != 0 {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*DbEvalContext)(unsafe.Pointer(p)).FpArray
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -32998,7 +37016,7 @@ func dbEvalFinalize(tls *crt.TLS, p uintptr) { /* tclsqlite.c:1710:13: */
}
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = (*DbEvalContext)(unsafe.Pointer(p)).FpSql
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -33008,7 +37026,7 @@ func dbEvalFinalize(tls *crt.TLS, p uintptr) { /* tclsqlite.c:1710:13: */
// Return a pointer to a Tcl_Obj structure with ref-count 0 that contains
// the value for the iCol'th column of the row currently pointed to by
// the DbEvalContext structure passed as the first argument.
-func dbEvalColumnValue(tls *crt.TLS, p uintptr, iCol int32) uintptr { /* tclsqlite.c:1729:16: */
+func dbEvalColumnValue(tls *libc.TLS, p uintptr, iCol int32) uintptr { /* tclsqlite.c:1729:16: */
var pStmt uintptr = (*SqlPreparedStmt)(unsafe.Pointer((*DbEvalContext)(unsafe.Pointer(p)).FpPreStmt)).FpStmt
switch sqlite3.Xsqlite3_column_type(tls, pStmt, iCol) {
case 4:
@@ -33048,7 +37066,7 @@ func dbEvalColumnValue(tls *crt.TLS, p uintptr, iCol int32) uintptr { /* tclsqli
// commands. Even if the headers used while compiling the extension
// are 8.6 or newer, the code still tests the Tcl version at runtime.
// This allows stubs-enabled builds to be used with older Tcl libraries.
-func DbUseNre(tls *crt.TLS) int32 { /* tclsqlite.c:1766:12: */
+func DbUseNre(tls *libc.TLS) int32 { /* tclsqlite.c:1766:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -33057,13 +37075,13 @@ func DbUseNre(tls *crt.TLS) int32 { /* tclsqlite.c:1766:12: */
// var minor int32 at bp+4, 4
tcl.XTcl_GetVersion(tls, bp /* &major */, bp+4 /* &minor */, uintptr(0), uintptr(0))
- return (crt.Bool32(((*(*int32)(unsafe.Pointer(bp /* major */)) == 8) && (*(*int32)(unsafe.Pointer(bp + 4 /* minor */)) >= 6)) || (*(*int32)(unsafe.Pointer(bp /* major */)) > 8)))
+ return (libc.Bool32(((*(*int32)(unsafe.Pointer(bp /* major */)) == 8) && (*(*int32)(unsafe.Pointer(bp + 4 /* minor */)) >= 6)) || (*(*int32)(unsafe.Pointer(bp /* major */)) > 8)))
}
// This function is part of the implementation of the command:
//
// $db eval SQL ?ARRAYNAME? SCRIPT
-func DbEvalNextCmd(tls *crt.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclsqlite.c:1793:26: */
+func DbEvalNextCmd(tls *libc.TLS, data uintptr, interp uintptr, result int32) int32 { /* tclsqlite.c:1793:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -33077,7 +37095,7 @@ func DbEvalNextCmd(tls *crt.TLS, data uintptr, interp uintptr, result int32) int
var pScript uintptr = *(*ClientData)(unsafe.Pointer(data + uintptr(1)*8))
var pArray uintptr = (*DbEvalContext)(unsafe.Pointer(p)).FpArray
- for ((rc == 0) || (rc == 4)) && (0 == (crt.AssignInt32(&rc, dbEvalStep(tls, p)))) {
+ for ((rc == 0) || (rc == 4)) && (0 == (libc.AssignInt32(&rc, dbEvalStep(tls, p)))) {
var i int32
// var nCol int32 at bp, 4
@@ -33107,7 +37125,7 @@ func DbEvalNextCmd(tls *crt.TLS, data uintptr, interp uintptr, result int32) int
// next iteration of this while(...) loop.
if DbUseNre(tls) != 0 {
tcl.XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, uintptr, int32) int32
}{DbEvalNextCmd})), p, pScript, uintptr(0), uintptr(0))
return tcl.XTcl_NREvalObj(tls, interp, pScript, 0)
} else {
@@ -33117,7 +37135,7 @@ func DbEvalNextCmd(tls *crt.TLS, data uintptr, interp uintptr, result int32) int
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pScript
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -33138,7 +37156,7 @@ func DbEvalNextCmd(tls *crt.TLS, data uintptr, interp uintptr, result int32) int
// $db wal_hook ?SCRIPT?
// $db commit_hook ?SCRIPT?
// $db preupdate hook ?SCRIPT?
-func DbHookCmd(tls *crt.TLS, interp uintptr, pDb uintptr, pArg uintptr, ppHook uintptr) { /* tclsqlite.c:1863:13: */
+func DbHookCmd(tls *libc.TLS, interp uintptr, pDb uintptr, pArg uintptr, ppHook uintptr) { /* tclsqlite.c:1863:13: */
var db uintptr = (*SqliteDb)(unsafe.Pointer(pDb)).Fdb
if *(*uintptr)(unsafe.Pointer(ppHook)) != 0 {
@@ -33146,7 +37164,7 @@ func DbHookCmd(tls *crt.TLS, interp uintptr, pDb uintptr, pArg uintptr, ppHook u
if pArg != 0 {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = *(*uintptr)(unsafe.Pointer(ppHook))
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -33161,24 +37179,32 @@ func DbHookCmd(tls *crt.TLS, interp uintptr, pDb uintptr, pArg uintptr, ppHook u
}
}
+ sqlite3.Xsqlite3_preupdate_hook(tls, db, func() uintptr {
+ if (*SqliteDb)(unsafe.Pointer(pDb)).FpPreUpdateHook != 0 {
+ return *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, sqlite_int64, sqlite_int64)
+ }{DbPreUpdateHandler}))
+ }
+ return uintptr(0)
+ }(), pDb)
sqlite3.Xsqlite3_update_hook(tls, db, func() uintptr {
if (*SqliteDb)(unsafe.Pointer(pDb)).FpUpdateHook != 0 {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr, sqlite_int64)
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr, sqlite_int64)
}{DbUpdateHandler}))
}
return uintptr(0)
}(), pDb)
sqlite3.Xsqlite3_rollback_hook(tls, db, func() uintptr {
if (*SqliteDb)(unsafe.Pointer(pDb)).FpRollbackHook != 0 {
- return *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{DbRollbackHandler}))
+ return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{DbRollbackHandler}))
}
return uintptr(0)
}(), pDb)
sqlite3.Xsqlite3_wal_hook(tls, db, func() uintptr {
if (*SqliteDb)(unsafe.Pointer(pDb)).FpWalHook != 0 {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32
}{DbWalHandler}))
}
return uintptr(0)
@@ -33196,9 +37222,9 @@ func DbHookCmd(tls *crt.TLS, interp uintptr, pDb uintptr, pArg uintptr, ppHook u
// The first command opens a connection to the "my_database" database
// and calls that connection "db1". The second command causes this
// subroutine to be invoked.
-func DbObjCmd(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* tclsqlite.c:1907:26: */
- bp := tls.Alloc(1564)
- defer tls.Free(1564)
+func DbObjCmd(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* tclsqlite.c:1907:26: */
+ bp := tls.Alloc(1580)
+ defer tls.Free(1580)
*(*uintptr)(unsafe.Pointer(bp + 1456)) = cd
var pDb uintptr
@@ -33373,10 +37399,19 @@ func DbObjCmd(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr
var _objPtr5 uintptr
var xNotify uintptr
var pNotifyArg uintptr
+ var nCol2 int32
+ var pRet1 uintptr
+ var pObj1 uintptr
+ // var iIdx int32 at bp+1468, 4
+
+ // var pValue1 uintptr at bp+1472, 8
+
+ // var iSub int32 at bp+1464, 4
+
// set ppHook to point at pUpdateHook or pRollbackHook, depending on
// whether [$db update_hook] or [$db rollback_hook] was invoked.
var ppHook uintptr
- // var zBuf [100]int8 at bp+1464, 100
+ // var zBuf [100]int8 at bp+1480, 100
var zArg uintptr
var i5 int32
@@ -33391,7 +37426,7 @@ func DbObjCmd(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr
return 1
__1:
;
- if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), uintptr(unsafe.Pointer(&DB_strs)), int32(unsafe.Sizeof(uintptr(0))), ts+9536 /* "option" */, 0, bp+1016 /* &choice */) != 0) {
+ if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), uintptr(unsafe.Pointer(&DB_strs)), int32(unsafe.Sizeof(uintptr(0))), ts+11195 /* "option" */, 0, bp+1016 /* &choice */) != 0) {
goto __2
}
return 1
@@ -33749,7 +37784,7 @@ __4:
if !(objc > 3) {
goto __45
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9543 /* "?CALLBACK?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11202 /* "?CALLBACK?" */)
return 1
goto __46
__45:
@@ -33759,7 +37794,7 @@ __45:
if !((*SqliteDb)(unsafe.Pointer(pDb)).FzAuth != 0) {
goto __49
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, (*SqliteDb)(unsafe.Pointer(pDb)).FzAuth, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, (*SqliteDb)(unsafe.Pointer(pDb)).FzAuth, uintptr(0)))
__49:
;
goto __48
@@ -33775,7 +37810,7 @@ __50:
goto __51
}
(*SqliteDb)(unsafe.Pointer(pDb)).FzAuth = tcl.XTcl_Alloc(tls, (uint32(*(*int32)(unsafe.Pointer(bp + 1020 /* len */)) + 1)))
- crt.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzAuth, zAuth, (uint64(*(*int32)(unsafe.Pointer(bp + 1020 /* len */)) + 1)))
+ libc.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzAuth, zAuth, (uint64(*(*int32)(unsafe.Pointer(bp + 1020 /* len */)) + 1)))
goto __52
__51:
(*SqliteDb)(unsafe.Pointer(pDb)).FzAuth = uintptr(0)
@@ -33786,7 +37821,7 @@ __52:
}
(*SqliteDb)(unsafe.Pointer(pDb)).Finterp = interp
sqlite3.Xsqlite3_set_authorizer(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32
}{auth_callback})), pDb)
goto __54
__53:
@@ -33820,7 +37855,7 @@ __55:
zDestFile = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)))
goto __58
__57:
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9554 /* "?DATABASE? FILEN..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11213 /* "?DATABASE? FILEN..." */)
return 1
__58:
;
@@ -33831,7 +37866,7 @@ __56:
if !(rc != 0) {
goto __59
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+16, ts+9574, /* "cannot open targ..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+11233, /* "cannot open targ..." */
sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 1024 /* pDest */))), uintptr(0)))
sqlite3.Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 1024 /* pDest */)))
return 1
@@ -33841,14 +37876,14 @@ __59:
if !(pBackup == uintptr(0)) {
goto __60
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, ts+9604, /* "backup failed: " */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+11263, /* "backup failed: " */
sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 1024 /* pDest */))), uintptr(0)))
sqlite3.Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 1024 /* pDest */)))
return 1
__60:
;
__61:
- if !((crt.AssignInt32(&rc, sqlite3.Xsqlite3_backup_step(tls, pBackup, 100))) == 0) {
+ if !((libc.AssignInt32(&rc, sqlite3.Xsqlite3_backup_step(tls, pBackup, 100))) == 0) {
goto __62
}
goto __61
@@ -33861,7 +37896,7 @@ __62:
rc = 0
goto __64
__63:
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+64, ts+9604, /* "backup failed: " */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, ts+11263, /* "backup failed: " */
sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 1024 /* pDest */))), uintptr(0)))
rc = 1
__64:
@@ -33890,7 +37925,7 @@ __6:
if !(objc > 3) {
goto __65
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9543 /* "?CALLBACK?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11202 /* "?CALLBACK?" */)
return 1
goto __66
__65:
@@ -33900,7 +37935,7 @@ __65:
if !((*SqliteDb)(unsafe.Pointer(pDb)).FzBindFallback != 0) {
goto __69
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+88, (*SqliteDb)(unsafe.Pointer(pDb)).FzBindFallback, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+88, (*SqliteDb)(unsafe.Pointer(pDb)).FzBindFallback, uintptr(0)))
__69:
;
goto __68
@@ -33916,7 +37951,7 @@ __70:
goto __71
}
(*SqliteDb)(unsafe.Pointer(pDb)).FzBindFallback = tcl.XTcl_Alloc(tls, (uint32(*(*int32)(unsafe.Pointer(bp + 1032 /* len1 */)) + 1)))
- crt.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzBindFallback, zCallback, (uint64(*(*int32)(unsafe.Pointer(bp + 1032 /* len1 */)) + 1)))
+ libc.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzBindFallback, zCallback, (uint64(*(*int32)(unsafe.Pointer(bp + 1032 /* len1 */)) + 1)))
goto __72
__71:
(*SqliteDb)(unsafe.Pointer(pDb)).FzBindFallback = uintptr(0)
@@ -33936,7 +37971,7 @@ __7:
if !(objc > 3) {
goto __73
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9620 /* "CALLBACK" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11279 /* "CALLBACK" */)
return 1
goto __74
__73:
@@ -33946,7 +37981,7 @@ __73:
if !((*SqliteDb)(unsafe.Pointer(pDb)).FzBusy != 0) {
goto __77
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+104, (*SqliteDb)(unsafe.Pointer(pDb)).FzBusy, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+104, (*SqliteDb)(unsafe.Pointer(pDb)).FzBusy, uintptr(0)))
__77:
;
goto __76
@@ -33962,7 +37997,7 @@ __78:
goto __79
}
(*SqliteDb)(unsafe.Pointer(pDb)).FzBusy = tcl.XTcl_Alloc(tls, (uint32(*(*int32)(unsafe.Pointer(bp + 1036 /* len2 */)) + 1)))
- crt.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzBusy, zBusy, (uint64(*(*int32)(unsafe.Pointer(bp + 1036 /* len2 */)) + 1)))
+ libc.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzBusy, zBusy, (uint64(*(*int32)(unsafe.Pointer(bp + 1036 /* len2 */)) + 1)))
goto __80
__79:
(*SqliteDb)(unsafe.Pointer(pDb)).FzBusy = uintptr(0)
@@ -33973,7 +38008,7 @@ __80:
}
(*SqliteDb)(unsafe.Pointer(pDb)).Finterp = interp
sqlite3.Xsqlite3_busy_handler(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{DbBusyHandler})), pDb)
goto __82
__81:
@@ -33996,18 +38031,18 @@ __8:
if !(objc <= 2) {
goto __83
}
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9629 /* "cache option ?ar..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11288 /* "cache option ?ar..." */)
return 1
__83:
;
subCmd = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), uintptr(0))
- if !((int32(*(*int8)(unsafe.Pointer(subCmd))) == 'f') && (crt.Xstrcmp(tls, subCmd, ts+9648 /* "flush" */) == 0)) {
+ if !((int32(*(*int8)(unsafe.Pointer(subCmd))) == 'f') && (libc.Xstrcmp(tls, subCmd, ts+11307 /* "flush" */) == 0)) {
goto __84
}
if !(objc != 3) {
goto __86
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9648 /* "flush" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11307 /* "flush" */)
return 1
goto __87
__86:
@@ -34016,21 +38051,21 @@ __87:
;
goto __85
__84:
- if !((int32(*(*int8)(unsafe.Pointer(subCmd))) == 's') && (crt.Xstrcmp(tls, subCmd, ts+9654 /* "size" */) == 0)) {
+ if !((int32(*(*int8)(unsafe.Pointer(subCmd))) == 's') && (libc.Xstrcmp(tls, subCmd, ts+11313 /* "size" */) == 0)) {
goto __88
}
if !(objc != 4) {
goto __90
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9659 /* "size n" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11318 /* "size n" */)
return 1
goto __91
__90:
if !(1 == tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), bp+1040 /* &n */)) {
goto __92
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+120, ts+9666, /* "cannot convert \"" */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), uintptr(0)), ts+9683 /* "\" to integer" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+120, ts+11325, /* "cannot convert \"" */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), uintptr(0)), ts+11342 /* "\" to integer" */, uintptr(0)))
return 1
goto __93
__92:
@@ -34056,8 +38091,8 @@ __91:
;
goto __89
__88:
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+152, ts+9696, /* "bad option \"" */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), uintptr(0)), ts+9709, /* "\": must be flush..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+152, ts+11355, /* "bad option \"" */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), uintptr(0)), ts+11368, /* "\": must be flush..." */
uintptr(0)))
return 1
__89:
@@ -34098,7 +38133,7 @@ __11:
if !(objc != 4) {
goto __98
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9734 /* "NAME SCRIPT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11393 /* "NAME SCRIPT" */)
return 1
__98:
;
@@ -34115,10 +38150,10 @@ __99:
(*SqlCollate)(unsafe.Pointer(pCollate)).FpNext = (*SqliteDb)(unsafe.Pointer(pDb)).FpCollate
(*SqlCollate)(unsafe.Pointer(pCollate)).FzScript = (pCollate + uintptr(1)*24)
(*SqliteDb)(unsafe.Pointer(pDb)).FpCollate = pCollate
- crt.Xmemcpy(tls, (*SqlCollate)(unsafe.Pointer(pCollate)).FzScript, zScript, (uint64(*(*int32)(unsafe.Pointer(bp + 1044 /* nScript */)) + 1)))
+ libc.Xmemcpy(tls, (*SqlCollate)(unsafe.Pointer(pCollate)).FzScript, zScript, (uint64(*(*int32)(unsafe.Pointer(bp + 1044 /* nScript */)) + 1)))
if !(sqlite3.Xsqlite3_create_collation(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zName, 1,
pCollate, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{tclSqlCollate}))) != 0) {
goto __100
}
@@ -34136,7 +38171,7 @@ __12:
if !(objc != 3) {
goto __101
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9746 /* "SCRIPT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11405 /* "SCRIPT" */)
return 1
__101:
;
@@ -34145,7 +38180,7 @@ __101:
}
__103:
_objPtr = (*SqliteDb)(unsafe.Pointer(pDb)).FpCollateNeeded
- if !(crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1) {
+ if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1) {
goto __106
}
tcl.XTclFreeObj(tls, _objPtr)
@@ -34164,7 +38199,7 @@ __102:
(*SqliteDb)(unsafe.Pointer(pDb)).FpCollateNeeded = tcl.XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
(*Tcl_Obj)(unsafe.Pointer((*SqliteDb)(unsafe.Pointer(pDb)).FpCollateNeeded)).FrefCount++
sqlite3.Xsqlite3_collation_needed(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, pDb, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr)
}{tclCollateNeeded})))
goto __3
@@ -34178,7 +38213,7 @@ __13:
if !(objc > 3) {
goto __107
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9543 /* "?CALLBACK?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11202 /* "?CALLBACK?" */)
return 1
goto __108
__107:
@@ -34188,7 +38223,7 @@ __107:
if !((*SqliteDb)(unsafe.Pointer(pDb)).FzCommit != 0) {
goto __111
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+184, (*SqliteDb)(unsafe.Pointer(pDb)).FzCommit, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+184, (*SqliteDb)(unsafe.Pointer(pDb)).FzCommit, uintptr(0)))
__111:
;
goto __110
@@ -34204,7 +38239,7 @@ __112:
goto __113
}
(*SqliteDb)(unsafe.Pointer(pDb)).FzCommit = tcl.XTcl_Alloc(tls, (uint32(*(*int32)(unsafe.Pointer(bp + 1048 /* len3 */)) + 1)))
- crt.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzCommit, zCommit, (uint64(*(*int32)(unsafe.Pointer(bp + 1048 /* len3 */)) + 1)))
+ libc.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzCommit, zCommit, (uint64(*(*int32)(unsafe.Pointer(bp + 1048 /* len3 */)) + 1)))
goto __114
__113:
(*SqliteDb)(unsafe.Pointer(pDb)).FzCommit = uintptr(0)
@@ -34214,7 +38249,9 @@ __114:
goto __115
}
(*SqliteDb)(unsafe.Pointer(pDb)).Finterp = interp
- sqlite3.Xsqlite3_commit_hook(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{DbCommitHandler})), pDb)
+ sqlite3.Xsqlite3_commit_hook(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{DbCommitHandler})), pDb)
goto __116
__115:
sqlite3.Xsqlite3_commit_hook(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, uintptr(0), uintptr(0))
@@ -34235,13 +38272,13 @@ __14:
if !(objc != 3) {
goto __117
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9753 /* "SQL" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9992 /* "SQL" */)
return 1
__117:
;
isComplete = sqlite3.Xsqlite3_complete(tls, tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), uintptr(0)))
pResult1 = tcl.XTcl_GetObjResult(tls, interp)
- tcl.XTcl_SetIntObj(tls, pResult1, (crt.Bool32((isComplete) != 0)))
+ tcl.XTcl_SetIntObj(tls, pResult1, (libc.Bool32((isComplete) != 0)))
goto __3
// $db config ?OPTION? ?BOOLEAN?
@@ -34252,7 +38289,7 @@ __15:
if !(objc > 4) {
goto __118
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9757 /* "?OPTION? ?BOOLEA..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11412 /* "?OPTION? ?BOOLEA..." */)
return 1
__118:
;
@@ -34268,7 +38305,7 @@ __121:
goto __123
}
*(*int32)(unsafe.Pointer(bp + 1052 /* v */)) = 0
- sqlite3.Xsqlite3_db_config(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, aDbConfig[ii].Fop, crt.VaList(bp+200, -1, bp+1052 /* &v */))
+ sqlite3.Xsqlite3_db_config(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, aDbConfig[ii].Fop, libc.VaList(bp+200, -1, bp+1052 /* &v */))
tcl.XTcl_ListObjAppendElement(tls, interp, pResult2,
tcl.XTcl_NewStringObj(tls, aDbConfig[ii].FzName, -1))
tcl.XTcl_ListObjAppendElement(tls, interp, pResult2,
@@ -34296,7 +38333,7 @@ __125:
if !(uint64(ii) < (uint64(unsafe.Sizeof(aDbConfig)) / uint64(unsafe.Sizeof(DbConfigChoices{})))) {
goto __127
}
- if !(crt.Xstrcmp(tls, aDbConfig[ii].FzName, zOpt) == 0) {
+ if !(libc.Xstrcmp(tls, aDbConfig[ii].FzName, zOpt) == 0) {
goto __128
}
goto __127
@@ -34312,8 +38349,8 @@ __127:
if !(uint64(ii) >= (uint64(unsafe.Sizeof(aDbConfig)) / uint64(unsafe.Sizeof(DbConfigChoices{})))) {
goto __129
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+216, ts+9776 /* "unknown config o..." */, zOpt,
- ts+9801 /* "\"" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+216, ts+11431 /* "unknown config o..." */, zOpt,
+ ts+11456 /* "\"" */, uintptr(0)))
return 1
__129:
;
@@ -34328,7 +38365,7 @@ __131:
;
__130:
;
- sqlite3.Xsqlite3_db_config(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, aDbConfig[ii].Fop, crt.VaList(bp+248, *(*int32)(unsafe.Pointer(bp + 1056 /* onoff */)), bp+1060 /* &v1 */))
+ sqlite3.Xsqlite3_db_config(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, aDbConfig[ii].Fop, libc.VaList(bp+248, *(*int32)(unsafe.Pointer(bp + 1056 /* onoff */)), bp+1060 /* &v1 */))
pResult2 = tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 1060 /* v1 */)))
__120:
;
@@ -34357,7 +38394,7 @@ __16: // The input file
goto __132
}
tcl.XTcl_WrongNumArgs(tls, interp, 2, objv,
- ts+9803 /* "CONFLICT-ALGORIT..." */)
+ ts+11458 /* "CONFLICT-ALGORIT..." */)
return 1
__132:
;
@@ -34367,7 +38404,7 @@ __132:
zSep = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(5)*8)), uintptr(0))
goto __134
__133:
- zSep = ts + 9865 /* "\t" */
+ zSep = ts + 11520 /* "\t" */
__134:
;
if !(objc >= 7) {
@@ -34387,25 +38424,25 @@ __136:
if !(nSep == 0) {
goto __137
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+264, ts+9867, /* "Error: non-null ..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+264, ts+11522, /* "Error: non-null ..." */
uintptr(0)))
return 1
__137:
;
- if !(((((crt.Xstrcmp(tls, zConflict, ts+9911 /* "rollback" */) != 0) && (crt.Xstrcmp(tls, zConflict, ts+9920 /* "abort" */) != 0)) && (crt.Xstrcmp(tls, zConflict, ts+9926 /* "fail" */) != 0)) && (crt.Xstrcmp(tls, zConflict, ts+9931 /* "ignore" */) != 0)) && (crt.Xstrcmp(tls, zConflict, ts+9938 /* "replace" */) != 0)) {
+ if !(((((libc.Xstrcmp(tls, zConflict, ts+11566 /* "rollback" */) != 0) && (libc.Xstrcmp(tls, zConflict, ts+11575 /* "abort" */) != 0)) && (libc.Xstrcmp(tls, zConflict, ts+11581 /* "fail" */) != 0)) && (libc.Xstrcmp(tls, zConflict, ts+11586 /* "ignore" */) != 0)) && (libc.Xstrcmp(tls, zConflict, ts+11593 /* "replace" */) != 0)) {
goto __138
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+280, ts+9946 /* "Error: \"" */, zConflict,
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+280, ts+11601 /* "Error: \"" */, zConflict,
- ts+9955 /* "\", conflict-algo..." */, uintptr(0)))
+ ts+11610 /* "\", conflict-algo..." */, uintptr(0)))
return 1
__138:
;
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+10035 /* "SELECT * FROM '%..." */, crt.VaList(bp+312, zTable))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+11690 /* "SELECT * FROM '%..." */, libc.VaList(bp+312, zTable))
if !(zSql == uintptr(0)) {
goto __139
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+320, ts+10054 /* "Error: no such t..." */, zTable, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+320, ts+11709 /* "Error: no such t..." */, zTable, uintptr(0)))
return 1
__139:
;
@@ -34415,7 +38452,7 @@ __139:
if !(rc != 0) {
goto __140
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+344, ts+10077 /* "Error: " */, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+344, ts+11732 /* "Error: " */, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
nCol = 0
goto __141
__140:
@@ -34429,24 +38466,24 @@ __141:
return 1
__142:
;
- zSql = crt.Xmalloc(tls, (uint64((nByte + 50) + (nCol * 2))))
+ zSql = libc.Xmalloc(tls, (uint64((nByte + 50) + (nCol * 2))))
if !(zSql == uintptr(0)) {
goto __143
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+368, ts+10085 /* "Error: can't mal..." */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+368, ts+11740 /* "Error: can't mal..." */, uintptr(0)))
return 1
__143:
;
- sqlite3.Xsqlite3_snprintf(tls, (nByte + 50), zSql, ts+10107, /* "INSERT OR %q INT..." */
- crt.VaList(bp+384, zConflict, zTable))
+ sqlite3.Xsqlite3_snprintf(tls, (nByte + 50), zSql, ts+11762, /* "INSERT OR %q INT..." */
+ libc.VaList(bp+384, zConflict, zTable))
j = strlen30(tls, zSql)
i = 1
__144:
if !(i < nCol) {
goto __146
}
- *(*int8)(unsafe.Pointer(zSql + uintptr(crt.PostIncInt32(&j, 1)))) = int8(',')
- *(*int8)(unsafe.Pointer(zSql + uintptr(crt.PostIncInt32(&j, 1)))) = int8('?')
+ *(*int8)(unsafe.Pointer(zSql + uintptr(libc.PostIncInt32(&j, 1)))) = int8(',')
+ *(*int8)(unsafe.Pointer(zSql + uintptr(libc.PostIncInt32(&j, 1)))) = int8('?')
goto __145
__145:
i++
@@ -34454,40 +38491,40 @@ __145:
goto __146
__146:
;
- *(*int8)(unsafe.Pointer(zSql + uintptr(crt.PostIncInt32(&j, 1)))) = int8(')')
+ *(*int8)(unsafe.Pointer(zSql + uintptr(libc.PostIncInt32(&j, 1)))) = int8(')')
*(*int8)(unsafe.Pointer(zSql + uintptr(j))) = int8(0)
rc = sqlite3.Xsqlite3_prepare(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zSql, -1, bp+1064 /* &pStmt */, uintptr(0))
- crt.Xfree(tls, zSql)
+ libc.Xfree(tls, zSql)
if !(rc != 0) {
goto __147
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+400, ts+10077 /* "Error: " */, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+400, ts+11732 /* "Error: " */, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 1064 /* pStmt */)))
return 1
__147:
;
- in = crt.Xfopen(tls, zFile, ts+2937 /* "rb" */)
+ in = libc.Xfopen(tls, zFile, ts+4086 /* "rb" */)
if !(in == uintptr(0)) {
goto __148
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+424, ts+10139 /* "Error: cannot op..." */, zFile, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+424, ts+11794 /* "Error: cannot op..." */, zFile, uintptr(0)))
sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 1064 /* pStmt */)))
return 1
__148:
;
- azCol = crt.Xmalloc(tls, (uint64(unsafe.Sizeof(uintptr(0))) * (uint64(nCol + 1))))
+ azCol = libc.Xmalloc(tls, (uint64(unsafe.Sizeof(uintptr(0))) * (uint64(nCol + 1))))
if !(azCol == uintptr(0)) {
goto __149
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+448, ts+10085 /* "Error: can't mal..." */, uintptr(0)))
- crt.Xfclose(tls, in)
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+448, ts+11740 /* "Error: can't mal..." */, uintptr(0)))
+ libc.Xfclose(tls, in)
return 1
__149:
;
- sqlite3.Xsqlite3_exec(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, ts+10165 /* "BEGIN" */, uintptr(0), uintptr(0), uintptr(0))
- zCommit1 = ts + 9473 /* "COMMIT" */
+ sqlite3.Xsqlite3_exec(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, ts+11820 /* "BEGIN" */, uintptr(0), uintptr(0), uintptr(0))
+ zCommit1 = ts + 11132 /* "COMMIT" */
__150:
- if !((crt.AssignUintptr(&zLine, local_getline(tls, uintptr(0), in))) != uintptr(0)) {
+ if !((libc.AssignUintptr(&zLine, local_getline(tls, uintptr(0), in))) != uintptr(0)) {
goto __151
}
lineno++
@@ -34498,7 +38535,7 @@ __152:
if !(*(*int8)(unsafe.Pointer(z)) != 0) {
goto __154
}
- if !((int32(*(*int8)(unsafe.Pointer(z))) == int32(*(*int8)(unsafe.Pointer(zSep + uintptr(0))))) && (crt.Xstrncmp(tls, z, zSep, uint64(nSep)) == 0)) {
+ if !((int32(*(*int8)(unsafe.Pointer(z))) == int32(*(*int8)(unsafe.Pointer(zSep + uintptr(0))))) && (libc.Xstrncmp(tls, z, zSep, uint64(nSep)) == 0)) {
goto __155
}
*(*int8)(unsafe.Pointer(z)) = int8(0)
@@ -34523,18 +38560,18 @@ __154:
goto __157
}
nErr = (strlen30(tls, zFile) + 200)
- zErr = crt.Xmalloc(tls, uint64(nErr))
+ zErr = libc.Xmalloc(tls, uint64(nErr))
if !(zErr != 0) {
goto __158
}
sqlite3.Xsqlite3_snprintf(tls, nErr, zErr,
- ts+10171, /* "Error: %s line %..." */
- crt.VaList(bp+464, zFile, lineno, nCol, (i+1)))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+496, zErr, uintptr(0)))
- crt.Xfree(tls, zErr)
+ ts+11826, /* "Error: %s line %..." */
+ libc.VaList(bp+464, zFile, lineno, nCol, (i+1)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+496, zErr, uintptr(0)))
+ libc.Xfree(tls, zErr)
__158:
;
- zCommit1 = ts + 5807 /* "ROLLBACK" */
+ zCommit1 = ts + 7092 /* "ROLLBACK" */
goto __151
__157:
;
@@ -34544,7 +38581,7 @@ __159:
goto __161
}
// check for null data, if so, bind as null
- if !(((nNull > 0) && (crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zNull) == 0)) ||
+ if !(((nNull > 0) && (libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zNull) == 0)) ||
(strlen30(tls, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8))) == 0)) {
goto __162
}
@@ -34563,20 +38600,20 @@ __161:
;
sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 1064 /* pStmt */)))
rc = sqlite3.Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 1064 /* pStmt */)))
- crt.Xfree(tls, zLine)
+ libc.Xfree(tls, zLine)
if !(rc != 0) {
goto __164
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+512, ts+10077 /* "Error: " */, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
- zCommit1 = ts + 5807 /* "ROLLBACK" */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+512, ts+11732 /* "Error: " */, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
+ zCommit1 = ts + 7092 /* "ROLLBACK" */
goto __151
__164:
;
goto __150
__151:
;
- crt.Xfree(tls, azCol)
- crt.Xfclose(tls, in)
+ libc.Xfree(tls, azCol)
+ libc.Xfclose(tls, in)
sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 1064 /* pStmt */)))
sqlite3.Xsqlite3_exec(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zCommit1, uintptr(0), uintptr(0), uintptr(0))
@@ -34590,8 +38627,8 @@ __151:
goto __166
__165:
// failure, append lineno where failed
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([80]int8{})), bp+1072 /* &zLineNum[0] */, ts+1237 /* "%d" */, crt.VaList(bp+536, lineno))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+544, ts+10231 /* ", failed while p..." */, bp+1072, /* &zLineNum[0] */
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([80]int8{})), bp+1072 /* &zLineNum[0] */, ts+1237 /* "%d" */, libc.VaList(bp+536, lineno))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+544, ts+11886 /* ", failed while p..." */, bp+1072, /* &zLineNum[0] */
uintptr(0)))
rc = 1
__166:
@@ -34610,7 +38647,7 @@ __17:
if !(objc < 3) {
goto __167
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+10264 /* "?DATABASE? VALUE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11919 /* "?DATABASE? VALUE" */)
rc = 1
goto __3
__167:
@@ -34621,10 +38658,10 @@ __168:
goto __170
}
z1 = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)))
- if !((crt.Xstrcmp(tls, z1, ts+10281 /* "-maxsize" */) == 0) && (i1 < (objc - 2))) {
+ if !((libc.Xstrcmp(tls, z1, ts+11936 /* "-maxsize" */) == 0) && (i1 < (objc - 2))) {
goto __171
}
- rc = tcl.XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(crt.PreIncInt32(&i1, 1))*8)), bp+1152 /* &mxSize */)
+ rc = tcl.XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PreIncInt32(&i1, 1))*8)), bp+1152 /* &mxSize */)
if !(rc != 0) {
goto __172
}
@@ -34634,10 +38671,10 @@ __172:
goto __169
__171:
;
- if !((crt.Xstrcmp(tls, z1, ts+10290 /* "-readonly" */) == 0) && (i1 < (objc - 2))) {
+ if !((libc.Xstrcmp(tls, z1, ts+11945 /* "-readonly" */) == 0) && (i1 < (objc - 2))) {
goto __173
}
- rc = tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(crt.PreIncInt32(&i1, 1))*8)), bp+1160 /* &isReadonly */)
+ rc = tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(libc.PreIncInt32(&i1, 1))*8)), bp+1160 /* &isReadonly */)
if !(rc != 0) {
goto __174
}
@@ -34654,7 +38691,7 @@ __173:
goto __169
__175:
;
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+568, ts+10300 /* "unknown option: " */, z1, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+568, ts+11955 /* "unknown option: " */, z1, uintptr(0)))
rc = 1
goto deserialize_error
goto __169
@@ -34670,14 +38707,14 @@ __170:
if !((pData == uintptr(0)) && (*(*int32)(unsafe.Pointer(bp + 1164 /* len4 */)) > 0)) {
goto __176
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+592, ts+1929 /* "out of memory" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+592, ts+1929 /* "out of memory" */, uintptr(0)))
rc = 1
goto __177
__176:
if !(*(*int32)(unsafe.Pointer(bp + 1164 /* len4 */)) > 0) {
goto __178
}
- crt.Xmemcpy(tls, pData, pBA, uint64(*(*int32)(unsafe.Pointer(bp + 1164 /* len4 */))))
+ libc.Xmemcpy(tls, pData, pBA, uint64(*(*int32)(unsafe.Pointer(bp + 1164 /* len4 */))))
__178:
;
if !(*(*int32)(unsafe.Pointer(bp + 1160 /* isReadonly */)) != 0) {
@@ -34693,7 +38730,7 @@ __180:
if !(xrc != 0) {
goto __181
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+608, ts+10317 /* "unable to set ME..." */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+608, ts+11972 /* "unable to set ME..." */, uintptr(0)))
rc = 1
__181:
;
@@ -34713,7 +38750,7 @@ deserialize_error:
// Turn the extension loading feature on or off. It if off by
// default.
__18:
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+624, ts+10345, /* "extension loadin..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+624, ts+12000, /* "extension loadin..." */
uintptr(0)))
return 1
@@ -34736,7 +38773,7 @@ __21:
if !(objc != 3) {
goto __183
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9753 /* "SQL" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9992 /* "SQL" */)
return 1
__183:
;
@@ -34765,7 +38802,7 @@ __184:
if !((rc == 3) || (rc == 0)) {
goto __189
}
- pResult4 = tcl.XTcl_NewIntObj(tls, (crt.Bool32((crt.Bool32(rc == 0)) != 0)))
+ pResult4 = tcl.XTcl_NewIntObj(tls, (libc.Bool32((libc.Bool32(rc == 0)) != 0)))
__189:
;
__185:
@@ -34796,16 +38833,16 @@ __191:
__22:
evalFlags = 0
__192:
- if !(((objc > 3) && ((crt.AssignUintptr(&zOpt1, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))))) != uintptr(0))) && (int32(*(*int8)(unsafe.Pointer(zOpt1 + uintptr(0)))) == '-')) {
+ if !(((objc > 3) && ((libc.AssignUintptr(&zOpt1, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))))) != uintptr(0))) && (int32(*(*int8)(unsafe.Pointer(zOpt1 + uintptr(0)))) == '-')) {
goto __193
}
- if !(crt.Xstrcmp(tls, zOpt1, ts+10393 /* "-withoutnulls" */) == 0) {
+ if !(libc.Xstrcmp(tls, zOpt1, ts+12048 /* "-withoutnulls" */) == 0) {
goto __194
}
evalFlags = evalFlags | (0x00001)
goto __195
__194:
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+640, ts+10407 /* "unknown option: ..." */, zOpt1, ts+9801 /* "\"" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+640, ts+12062 /* "unknown option: ..." */, zOpt1, ts+11456 /* "\"" */, uintptr(0)))
return 1
__195:
;
@@ -34818,7 +38855,7 @@ __193:
goto __196
}
tcl.XTcl_WrongNumArgs(tls, interp, 2, objv,
- ts+10425 /* "?OPTIONS? SQL ?A..." */)
+ ts+12080 /* "?OPTIONS? SQL ?A..." */)
return 1
__196:
;
@@ -34830,7 +38867,7 @@ __196:
(*Tcl_Obj)(unsafe.Pointer(pRet)).FrefCount++
dbEvalInit(tls, bp+1224 /* &sEval1 */, pDb, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), uintptr(0), 0)
__199:
- if !(0 == (crt.AssignInt32(&rc, dbEvalStep(tls, bp+1224 /* &sEval1 */)))) {
+ if !(0 == (libc.AssignInt32(&rc, dbEvalStep(tls, bp+1224 /* &sEval1 */)))) {
goto __200
}
dbEvalRowInfo(tls, bp+1224 /* &sEval1 */, bp+1280 /* &nCol1 */, uintptr(0))
@@ -34860,7 +38897,7 @@ __204:
;
__205:
_objPtr1 = pRet
- if !(crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr1))).FrefCount, 1) <= 1) {
+ if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr1))).FrefCount, 1) <= 1) {
goto __208
}
tcl.XTclFreeObj(tls, _objPtr1)
@@ -34915,7 +38952,7 @@ __23:
if !(objc < 4) {
goto __210
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+10461 /* "NAME ?SWITCHES? ..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12116 /* "NAME ?SWITCHES? ..." */)
return 1
__210:
;
@@ -34926,13 +38963,13 @@ __211:
}
z2 = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8)))
n1 = strlen30(tls, z2)
- if !((n1 > 1) && (crt.Xstrncmp(tls, z2, ts+10484 /* "-argcount" */, uint64(n1)) == 0)) {
+ if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12139 /* "-argcount" */, uint64(n1)) == 0)) {
goto __214
}
if !(i3 == (objc - 2)) {
goto __216
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+672, ts+10494 /* "option requires ..." */, z2, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+672, ts+12149 /* "option requires ..." */, z2, uintptr(0)))
return 1
__216:
;
@@ -34945,7 +38982,7 @@ __217:
if !(*(*int32)(unsafe.Pointer(bp + 1304 /* nArg */)) < 0) {
goto __218
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+696, ts+10524, /* "number of argume..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+696, ts+12179, /* "number of argume..." */
uintptr(0)))
return 1
__218:
@@ -34953,38 +38990,38 @@ __218:
i3++
goto __215
__214:
- if !((n1 > 1) && (crt.Xstrncmp(tls, z2, ts+10565 /* "-deterministic" */, uint64(n1)) == 0)) {
+ if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12220 /* "-deterministic" */, uint64(n1)) == 0)) {
goto __219
}
flags1 = flags1 | (0x000000800)
goto __220
__219:
- if !((n1 > 1) && (crt.Xstrncmp(tls, z2, ts+10580 /* "-directonly" */, uint64(n1)) == 0)) {
+ if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12235 /* "-directonly" */, uint64(n1)) == 0)) {
goto __221
}
flags1 = flags1 | (0x000080000)
goto __222
__221:
- if !((n1 > 1) && (crt.Xstrncmp(tls, z2, ts+10592 /* "-innocuous" */, uint64(n1)) == 0)) {
+ if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12247 /* "-innocuous" */, uint64(n1)) == 0)) {
goto __223
}
flags1 = flags1 | (0x000200000)
goto __224
__223:
- if !((n1 > 1) && (crt.Xstrncmp(tls, z2, ts+10603 /* "-returntype" */, uint64(n1)) == 0)) {
+ if !((n1 > 1) && (libc.Xstrncmp(tls, z2, ts+12258 /* "-returntype" */, uint64(n1)) == 0)) {
goto __225
}
- *(*[6]uintptr)(unsafe.Pointer(bp + 1312 /* azType */)) = [6]uintptr{ts + 6453 /* "integer" */, ts + 10615 /* "real" */, ts + 10620 /* "text" */, ts + 10625 /* "blob" */, ts + 10630 /* "any" */, uintptr(0)}
+ *(*[6]uintptr)(unsafe.Pointer(bp + 1312 /* azType */)) = [6]uintptr{ts + 7738 /* "integer" */, ts + 12270 /* "real" */, ts + 12275 /* "text" */, ts + 12280 /* "blob" */, ts + 12285 /* "any" */, uintptr(0)}
if !(i3 == (objc - 2)) {
goto __227
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+712, ts+10494 /* "option requires ..." */, z2, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+712, ts+12149 /* "option requires ..." */, z2, uintptr(0)))
return 1
__227:
;
i3++
- if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8)), bp+1312 /* &azType[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+10634 /* "type" */, 0, bp+1360 /* &eType */) != 0) {
+ if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i3)*8)), bp+1312 /* &azType[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+12289 /* "type" */, 0, bp+1360 /* &eType */) != 0) {
goto __228
}
return 1
@@ -34993,9 +39030,9 @@ __228:
*(*int32)(unsafe.Pointer(bp + 1360 /* eType */))++
goto __226
__225:
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+736, ts+9696 /* "bad option \"" */, z2,
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+736, ts+11355 /* "bad option \"" */, z2,
- ts+10639 /* "\": must be -argc..." */, uintptr(0)))
+ ts+12294 /* "\": must be -argc..." */, uintptr(0)))
return 1
__226:
;
@@ -35029,7 +39066,7 @@ __229:
}
__231:
_objPtr2 = (*SqlFunc)(unsafe.Pointer(pFunc)).FpScript
- if !(crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr2))).FrefCount, 1) <= 1) {
+ if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr2))).FrefCount, 1) <= 1) {
goto __234
}
tcl.XTclFreeObj(tls, _objPtr2)
@@ -35051,7 +39088,7 @@ __230:
(*SqlFunc)(unsafe.Pointer(pFunc)).FeType = *(*int32)(unsafe.Pointer(bp + 1360 /* eType */))
rc = sqlite3.Xsqlite3_create_function(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, zName1, *(*int32)(unsafe.Pointer(bp + 1304 /* nArg */)), flags1,
pFunc, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{tclSqlFunc})), uintptr(0), uintptr(0))
if !(rc != 0) {
goto __235
@@ -35068,7 +39105,7 @@ __24:
zDb = ts + 84 /* "main" */
// Check for the -readonly option
- if !((objc > 3) && (crt.Xstrcmp(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), ts+10290 /* "-readonly" */) == 0)) {
+ if !((objc > 3) && (libc.Xstrcmp(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), ts+11945 /* "-readonly" */) == 0)) {
goto __236
}
isReadonly1 = 1
@@ -35078,7 +39115,7 @@ __236:
if !((objc != (5 + isReadonly1)) && (objc != (6 + isReadonly1))) {
goto __237
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+10717 /* "?-readonly? ?DB?..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12372 /* "?-readonly? ?DB?..." */)
return 1
__237:
;
@@ -35120,7 +39157,7 @@ __26:
if !((objc != 2) && (objc != 3)) {
goto __240
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+10753 /* "NULLVALUE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12408 /* "NULLVALUE" */)
return 1
__240:
;
@@ -35138,7 +39175,7 @@ __242:
goto __243
}
(*SqliteDb)(unsafe.Pointer(pDb)).FzNull = tcl.XTcl_Alloc(tls, (uint32(*(*int32)(unsafe.Pointer(bp + 1376 /* len5 */)) + 1)))
- crt.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzNull, zNull1, uint64(*(*int32)(unsafe.Pointer(bp + 1376 /* len5 */))))
+ libc.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzNull, zNull1, uint64(*(*int32)(unsafe.Pointer(bp + 1376 /* len5 */))))
*(*int8)(unsafe.Pointer((*SqliteDb)(unsafe.Pointer(pDb)).FzNull + uintptr(*(*int32)(unsafe.Pointer(bp + 1376 /* len5 */))))) = int8(0)
goto __244
__243:
@@ -35179,7 +39216,7 @@ __28:
if !((*SqliteDb)(unsafe.Pointer(pDb)).FzProgress != 0) {
goto __248
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+768, (*SqliteDb)(unsafe.Pointer(pDb)).FzProgress, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+768, (*SqliteDb)(unsafe.Pointer(pDb)).FzProgress, uintptr(0)))
__248:
;
goto __247
@@ -35205,7 +39242,7 @@ __252:
goto __253
}
(*SqliteDb)(unsafe.Pointer(pDb)).FzProgress = tcl.XTcl_Alloc(tls, (uint32(*(*int32)(unsafe.Pointer(bp + 1384 /* len6 */)) + 1)))
- crt.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzProgress, zProgress, (uint64(*(*int32)(unsafe.Pointer(bp + 1384 /* len6 */)) + 1)))
+ libc.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzProgress, zProgress, (uint64(*(*int32)(unsafe.Pointer(bp + 1384 /* len6 */)) + 1)))
goto __254
__253:
(*SqliteDb)(unsafe.Pointer(pDb)).FzProgress = uintptr(0)
@@ -35215,7 +39252,9 @@ __254:
goto __255
}
(*SqliteDb)(unsafe.Pointer(pDb)).Finterp = interp
- sqlite3.Xsqlite3_progress_handler(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, *(*int32)(unsafe.Pointer(bp + 1380 /* N */)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{DbProgressHandler})), pDb)
+ sqlite3.Xsqlite3_progress_handler(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, *(*int32)(unsafe.Pointer(bp + 1380 /* N */)), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{DbProgressHandler})), pDb)
goto __256
__255:
sqlite3.Xsqlite3_progress_handler(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, 0, uintptr(0), uintptr(0))
@@ -35223,7 +39262,7 @@ __256:
;
goto __250
__249:
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+10763 /* "N CALLBACK" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12418 /* "N CALLBACK" */)
return 1
__250:
;
@@ -35240,7 +39279,7 @@ __29:
if !(objc > 3) {
goto __257
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9543 /* "?CALLBACK?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11202 /* "?CALLBACK?" */)
return 1
goto __258
__257:
@@ -35250,7 +39289,7 @@ __257:
if !((*SqliteDb)(unsafe.Pointer(pDb)).FzProfile != 0) {
goto __261
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+784, (*SqliteDb)(unsafe.Pointer(pDb)).FzProfile, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+784, (*SqliteDb)(unsafe.Pointer(pDb)).FzProfile, uintptr(0)))
__261:
;
goto __260
@@ -35266,7 +39305,7 @@ __262:
goto __263
}
(*SqliteDb)(unsafe.Pointer(pDb)).FzProfile = tcl.XTcl_Alloc(tls, (uint32(*(*int32)(unsafe.Pointer(bp + 1388 /* len7 */)) + 1)))
- crt.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzProfile, zProfile, (uint64(*(*int32)(unsafe.Pointer(bp + 1388 /* len7 */)) + 1)))
+ libc.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzProfile, zProfile, (uint64(*(*int32)(unsafe.Pointer(bp + 1388 /* len7 */)) + 1)))
goto __264
__263:
(*SqliteDb)(unsafe.Pointer(pDb)).FzProfile = uintptr(0)
@@ -35277,7 +39316,7 @@ __264:
}
(*SqliteDb)(unsafe.Pointer(pDb)).Finterp = interp
sqlite3.Xsqlite3_profile(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, sqlite_uint64)
+ f func(*libc.TLS, uintptr, uintptr, sqlite_uint64)
}{DbProfileHandler})), pDb)
goto __266
__265:
@@ -35297,7 +39336,7 @@ __30:
if !(objc != 3) {
goto __267
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+10774 /* "KEY" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12429 /* "KEY" */)
return 1
__267:
;
@@ -35324,7 +39363,7 @@ __268:
zSrcFile = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)))
goto __271
__270:
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9554 /* "?DATABASE? FILEN..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11213 /* "?DATABASE? FILEN..." */)
return 1
__271:
;
@@ -35335,7 +39374,7 @@ __269:
if !(rc != 0) {
goto __272
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+800, ts+10778, /* "cannot open sour..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+800, ts+12433, /* "cannot open sour..." */
sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 1392 /* pSrc */))), uintptr(0)))
sqlite3.Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 1392 /* pSrc */)))
return 1
@@ -35345,21 +39384,21 @@ __272:
if !(pBackup1 == uintptr(0)) {
goto __273
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+824, ts+10808, /* "restore failed: " */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+824, ts+12463, /* "restore failed: " */
sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
sqlite3.Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 1392 /* pSrc */)))
return 1
__273:
;
__274:
- if !(((crt.AssignInt32(&rc, sqlite3.Xsqlite3_backup_step(tls, pBackup1, 100))) == 0) ||
+ if !(((libc.AssignInt32(&rc, sqlite3.Xsqlite3_backup_step(tls, pBackup1, 100))) == 0) ||
(rc == 5)) {
goto __275
}
if !(rc == 5) {
goto __276
}
- if !(crt.PostIncInt32(&nTimeout, 1) >= 3) {
+ if !(libc.PostIncInt32(&nTimeout, 1) >= 3) {
goto __277
}
goto __275
@@ -35381,12 +39420,12 @@ __278:
if !((rc == 5) || (rc == 6)) {
goto __280
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+848, ts+10825, /* "restore failed: ..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+848, ts+12480, /* "restore failed: ..." */
uintptr(0)))
rc = 1
goto __281
__280:
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+864, ts+10808, /* "restore failed: " */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+864, ts+12463, /* "restore failed: " */
sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
rc = 1
__281:
@@ -35409,7 +39448,7 @@ __32:
if !((objc != 2) && (objc != 3)) {
goto __282
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+10862 /* "?DATABASE?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12517 /* "?DATABASE?" */)
rc = 1
goto __283
__282:
@@ -35443,37 +39482,37 @@ __33:
if !(objc != 3) {
goto __287
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+10873 /* "(step|sort|autoi..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12528 /* "(step|sort|autoi..." */)
return 1
__287:
;
zOp = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
- if !(crt.Xstrcmp(tls, zOp, ts+10895 /* "step" */) == 0) {
+ if !(libc.Xstrcmp(tls, zOp, ts+9942 /* "step" */) == 0) {
goto __288
}
v2 = (*SqliteDb)(unsafe.Pointer(pDb)).FnStep
goto __289
__288:
- if !(crt.Xstrcmp(tls, zOp, ts+10900 /* "sort" */) == 0) {
+ if !(libc.Xstrcmp(tls, zOp, ts+12550 /* "sort" */) == 0) {
goto __290
}
v2 = (*SqliteDb)(unsafe.Pointer(pDb)).FnSort
goto __291
__290:
- if !(crt.Xstrcmp(tls, zOp, ts+10905 /* "autoindex" */) == 0) {
+ if !(libc.Xstrcmp(tls, zOp, ts+12555 /* "autoindex" */) == 0) {
goto __292
}
v2 = (*SqliteDb)(unsafe.Pointer(pDb)).FnIndex
goto __293
__292:
- if !(crt.Xstrcmp(tls, zOp, ts+10915 /* "vmstep" */) == 0) {
+ if !(libc.Xstrcmp(tls, zOp, ts+12565 /* "vmstep" */) == 0) {
goto __294
}
v2 = (*SqliteDb)(unsafe.Pointer(pDb)).FnVMStep
goto __295
__294:
tcl.XTcl_AppendResult(tls, interp,
- crt.VaList(bp+888, ts+10922, /* "bad argument: sh..." */
+ libc.VaList(bp+888, ts+12572, /* "bad argument: sh..." */
uintptr(0)))
return 1
__295:
@@ -35494,7 +39533,7 @@ __34:
if !(objc != 3) {
goto __296
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+10978 /* "MILLISECONDS" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12628 /* "MILLISECONDS" */)
return 1
__296:
;
@@ -35532,7 +39571,7 @@ __36:
if !(objc > 3) {
goto __299
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+9543 /* "?CALLBACK?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11202 /* "?CALLBACK?" */)
return 1
goto __300
__299:
@@ -35542,7 +39581,7 @@ __299:
if !((*SqliteDb)(unsafe.Pointer(pDb)).FzTrace != 0) {
goto __303
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+904, (*SqliteDb)(unsafe.Pointer(pDb)).FzTrace, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+904, (*SqliteDb)(unsafe.Pointer(pDb)).FzTrace, uintptr(0)))
__303:
;
goto __302
@@ -35558,7 +39597,7 @@ __304:
goto __305
}
(*SqliteDb)(unsafe.Pointer(pDb)).FzTrace = tcl.XTcl_Alloc(tls, (uint32(*(*int32)(unsafe.Pointer(bp + 1412 /* len8 */)) + 1)))
- crt.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzTrace, zTrace, (uint64(*(*int32)(unsafe.Pointer(bp + 1412 /* len8 */)) + 1)))
+ libc.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzTrace, zTrace, (uint64(*(*int32)(unsafe.Pointer(bp + 1412 /* len8 */)) + 1)))
goto __306
__305:
(*SqliteDb)(unsafe.Pointer(pDb)).FzTrace = uintptr(0)
@@ -35569,7 +39608,7 @@ __306:
}
(*SqliteDb)(unsafe.Pointer(pDb)).Finterp = interp
sqlite3.Xsqlite3_trace(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{DbTraceHandler})), pDb)
goto __308
__307:
@@ -35591,7 +39630,7 @@ __37:
if !(objc > 4) {
goto __309
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+10991 /* "?CALLBACK? ?MASK..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12641 /* "?CALLBACK? ?MASK..." */)
return 1
goto __310
__309:
@@ -35601,7 +39640,7 @@ __309:
if !((*SqliteDb)(unsafe.Pointer(pDb)).FzTraceV2 != 0) {
goto __313
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+920, (*SqliteDb)(unsafe.Pointer(pDb)).FzTraceV2, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+920, (*SqliteDb)(unsafe.Pointer(pDb)).FzTraceV2, uintptr(0)))
__313:
;
goto __312
@@ -35627,7 +39666,7 @@ __317:
return 1
__320:
;
- if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 1424 /* pObj */)), uintptr(unsafe.Pointer(&TTYPE_strs)), int32(unsafe.Sizeof(uintptr(0))), ts+11009 /* "trace type" */, 0, bp+1432 /* &ttype */) != 0) {
+ if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 1424 /* pObj */)), uintptr(unsafe.Pointer(&TTYPE_strs)), int32(unsafe.Sizeof(uintptr(0))), ts+12659 /* "trace type" */, 0, bp+1432 /* &ttype */) != 0) {
goto __321
}
pError = tcl.XTcl_DuplicateObj(tls, tcl.XTcl_GetObjResult(tls, interp))
@@ -35637,7 +39676,7 @@ __320:
}
__325:
_objPtr3 = pError
- if !(crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr3))).FrefCount, 1) <= 1) {
+ if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr3))).FrefCount, 1) <= 1) {
goto __328
}
tcl.XTclFreeObj(tls, _objPtr3)
@@ -35657,7 +39696,7 @@ __323:
tcl.XTcl_SetObjResult(tls, interp, pError)
__329:
_objPtr4 = pError
- if !(crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr4))).FrefCount, 1) <= 1) {
+ if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr4))).FrefCount, 1) <= 1) {
goto __332
}
tcl.XTclFreeObj(tls, _objPtr4)
@@ -35726,7 +39765,7 @@ __338:
goto __339
}
(*SqliteDb)(unsafe.Pointer(pDb)).FzTraceV2 = tcl.XTcl_Alloc(tls, (uint32(*(*int32)(unsafe.Pointer(bp + 1416 /* len9 */)) + 1)))
- crt.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzTraceV2, zTraceV2, (uint64(*(*int32)(unsafe.Pointer(bp + 1416 /* len9 */)) + 1)))
+ libc.Xmemcpy(tls, (*SqliteDb)(unsafe.Pointer(pDb)).FzTraceV2, zTraceV2, (uint64(*(*int32)(unsafe.Pointer(bp + 1416 /* len9 */)) + 1)))
goto __340
__339:
(*SqliteDb)(unsafe.Pointer(pDb)).FzTraceV2 = uintptr(0)
@@ -35737,7 +39776,7 @@ __340:
}
(*SqliteDb)(unsafe.Pointer(pDb)).Finterp = interp
sqlite3.Xsqlite3_trace_v2(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, uint32(wMask), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uint32, uintptr, uintptr, uintptr) int32
+ f func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32
}{DbTraceV2Handler})), pDb)
goto __342
__341:
@@ -35761,11 +39800,11 @@ __310:
// This command was inspired by Dave Thomas's talk on Ruby at the
// 2005 O'Reilly Open Source Convention (OSCON).
__38:
- zBegin = ts + 11020 /* "SAVEPOINT _tcl_t..." */
+ zBegin = ts + 12670 /* "SAVEPOINT _tcl_t..." */
if !((objc != 3) && (objc != 4)) {
goto __343
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11047 /* "[TYPE] SCRIPT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12697 /* "[TYPE] SCRIPT" */)
return 1
__343:
;
@@ -35773,7 +39812,7 @@ __343:
if !(((*SqliteDb)(unsafe.Pointer(pDb)).FnTransaction == 0) && (objc == 4)) {
goto __344
}
- if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), uintptr(unsafe.Pointer(&TTYPE_strs1)), int32(unsafe.Sizeof(uintptr(0))), ts+11061 /* "transaction type" */, 0, bp+1448 /* &ttype1 */) != 0) {
+ if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), uintptr(unsafe.Pointer(&TTYPE_strs1)), int32(unsafe.Sizeof(uintptr(0))), ts+12711 /* "transaction type" */, 0, bp+1448 /* &ttype1 */) != 0) {
goto __345
}
return 1
@@ -35792,10 +39831,10 @@ __347: /* no-op */
;
goto __346
__348:
- zBegin = ts + 11078 /* "BEGIN EXCLUSIVE" */
+ zBegin = ts + 12728 /* "BEGIN EXCLUSIVE" */
goto __346
__349:
- zBegin = ts + 11094 /* "BEGIN IMMEDIATE" */
+ zBegin = ts + 12744 /* "BEGIN IMMEDIATE" */
goto __346
__346:
;
@@ -35810,7 +39849,7 @@ __344:
if !(rc != 0) {
goto __350
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+936, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+936, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
return 1
__350:
;
@@ -35825,7 +39864,7 @@ __350:
goto __351
}
tcl.XTcl_NRAddCallback(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, uintptr, int32) int32
}{DbTransPostCmd})), *(*uintptr)(unsafe.Pointer(bp + 1456 /* cd */)), uintptr(0), uintptr(0), uintptr(0))
tcl.XTcl_NREvalObj(tls, interp, pScript2, 0)
goto __352
@@ -35840,7 +39879,7 @@ __39:
if !((objc != 2) && (objc != 3)) {
goto __353
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11110 /* "?SCRIPT?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12760 /* "?SCRIPT?" */)
rc = 1
goto __354
__353:
@@ -35852,7 +39891,7 @@ __353:
}
__356:
_objPtr5 = (*SqliteDb)(unsafe.Pointer(pDb)).FpUnlockNotify
- if !(crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr5))).FrefCount, 1) <= 1) {
+ if !(libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr5))).FrefCount, 1) <= 1) {
goto __359
}
tcl.XTclFreeObj(tls, _objPtr5)
@@ -35874,7 +39913,7 @@ __355:
goto __360
}
xNotify = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32)
+ f func(*libc.TLS, uintptr, int32)
}{DbUnlockNotify}))
pNotifyArg = pDb
(*SqliteDb)(unsafe.Pointer(pDb)).FpUnlockNotify = *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))
@@ -35885,7 +39924,7 @@ __360:
if !(sqlite3.Xsqlite3_unlock_notify(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, xNotify, pNotifyArg) != 0) {
goto __361
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+952, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+952, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
rc = 1
__361:
;
@@ -35898,9 +39937,109 @@ __354:
// $db preupdate_hook new INDEX
// $db preupdate_hook old INDEX
__40:
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+968, ts+11119, /* "preupdate_hook w..." */
- uintptr(0)))
- rc = 1
+
+ if !(objc < 3) {
+ goto __362
+ }
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12769 /* "SUB-COMMAND ?ARG..." */)
+__362:
+ ;
+ if !(tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), uintptr(unsafe.Pointer(&azSub)), int32(unsafe.Sizeof(uintptr(0))), ts+1874 /* "sub-command" */, 0, bp+1464 /* &iSub */) != 0) {
+ goto __363
+ }
+ return 1
+__363:
+ ;
+
+ switch uint32(*(*int32)(unsafe.Pointer(bp + 1464 /* iSub */))) {
+ case uint32(0) /* PRE_COUNT */ :
+ goto __365
+
+ case uint32(2) /* PRE_HOOK */ :
+ goto __366
+
+ case uint32(1) /* PRE_DEPTH */ :
+ goto __367
+
+ case uint32(3) /* PRE_NEW */ :
+ goto __368
+ case uint32(4) /* PRE_OLD */ :
+ goto __369
+ }
+ goto __364
+__365:
+ nCol2 = sqlite3.Xsqlite3_preupdate_count(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb)
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, nCol2))
+ goto __364
+
+__366:
+ if !(objc > 4) {
+ goto __370
+ }
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12788 /* "hook ?SCRIPT?" */)
+ return 1
+__370:
+ ;
+ DbHookCmd(tls, interp, pDb, func() uintptr {
+ if objc == 4 {
+ return *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8))
+ }
+ return uintptr(0)
+ }(), (pDb + 112 /* &.pPreUpdateHook */))
+ goto __364
+
+__367:
+ if !(objc != 3) {
+ goto __371
+ }
+ tcl.XTcl_WrongNumArgs(tls, interp, 3, objv, ts+488 /* "" */)
+ return 1
+__371:
+ ;
+ pRet1 = tcl.XTcl_NewIntObj(tls, sqlite3.Xsqlite3_preupdate_depth(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb))
+ tcl.XTcl_SetObjResult(tls, interp, pRet1)
+ goto __364
+
+__368:
+__369:
+ if !(objc != 4) {
+ goto __372
+ }
+ tcl.XTcl_WrongNumArgs(tls, interp, 3, objv, ts+12802 /* "INDEX" */)
+ return 1
+__372:
+ ;
+ if !(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), bp+1468 /* &iIdx */) != 0) {
+ goto __373
+ }
+ return 1
+__373:
+ ;
+
+ if !(*(*int32)(unsafe.Pointer(bp + 1464 /* iSub */)) == 4 /* PRE_OLD */) {
+ goto __374
+ }
+ rc = sqlite3.Xsqlite3_preupdate_old(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, *(*int32)(unsafe.Pointer(bp + 1468 /* iIdx */)), bp+1472 /* &pValue1 */)
+ goto __375
+__374:
+ ;
+ rc = sqlite3.Xsqlite3_preupdate_new(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb, *(*int32)(unsafe.Pointer(bp + 1468 /* iIdx */)), bp+1472 /* &pValue1 */)
+__375:
+ ;
+
+ if !(rc == 0) {
+ goto __376
+ }
+ pObj1 = tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(bp + 1472 /* pValue1 */))), -1)
+ tcl.XTcl_SetObjResult(tls, interp, pObj1)
+ goto __377
+__376:
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+968, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(pDb)).Fdb), uintptr(0)))
+ return 1
+__377:
+ ;
+__364:
+ ;
goto __3
// $db wal_hook ?script?
@@ -35913,29 +40052,29 @@ __43:
// whether [$db update_hook] or [$db rollback_hook] was invoked.
ppHook = uintptr(0)
if !(*(*int32)(unsafe.Pointer(bp + 1016 /* choice */)) == 40 /* DB_WAL_HOOK */) {
- goto __362
+ goto __378
}
ppHook = (pDb + 128 /* &.pWalHook */)
-__362:
+__378:
;
if !(*(*int32)(unsafe.Pointer(bp + 1016 /* choice */)) == 38 /* DB_UPDATE_HOOK */) {
- goto __363
+ goto __379
}
ppHook = (pDb + 104 /* &.pUpdateHook */)
-__363:
+__379:
;
if !(*(*int32)(unsafe.Pointer(bp + 1016 /* choice */)) == 29 /* DB_ROLLBACK_HOOK */) {
- goto __364
+ goto __380
}
ppHook = (pDb + 120 /* &.pRollbackHook */)
-__364:
+__380:
;
if !(objc > 3) {
- goto __365
+ goto __381
}
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11110 /* "?SCRIPT?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12760 /* "?SCRIPT?" */)
return 1
-__365:
+__381:
;
DbHookCmd(tls, interp, pDb, func() uintptr {
@@ -35951,64 +40090,64 @@ __365:
// Return the version string for this database.
__44:
i5 = 2
-__366:
+__382:
if !(i5 < objc) {
- goto __368
+ goto __384
}
zArg = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i5)*8)))
// Optional arguments to $db version are used for testing purpose
// $db version -use-legacy-prepare BOOLEAN
//
// Turn the use of legacy sqlite3_prepare() on or off.
- if !((crt.Xstrcmp(tls, zArg, ts+11162 /* "-use-legacy-prep..." */) == 0) && ((i5 + 1) < objc)) {
- goto __369
+ if !((libc.Xstrcmp(tls, zArg, ts+12808 /* "-use-legacy-prep..." */) == 0) && ((i5 + 1) < objc)) {
+ goto __385
}
i5++
if !(tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i5)*8)), (pDb+224 /* &.bLegacyPrepare */)) != 0) {
- goto __371
+ goto __387
}
return 1
-__371:
+__387:
;
- goto __370
-__369:
+ goto __386
+__385:
// $db version -last-stmt-ptr
//
// Return a string which is a hex encoding of the pointer to the
// most recent sqlite3_stmt in the statement cache.
- if !(crt.Xstrcmp(tls, zArg, ts+11182 /* "-last-stmt-ptr" */) == 0) {
- goto __372
+ if !(libc.Xstrcmp(tls, zArg, ts+12828 /* "-last-stmt-ptr" */) == 0) {
+ goto __388
}
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+1464 /* &zBuf[0] */, ts+11197, /* "%p" */
- crt.VaList(bp+984, func() uintptr {
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+1480 /* &zBuf[0] */, ts+12843, /* "%p" */
+ libc.VaList(bp+984, func() uintptr {
if (*SqliteDb)(unsafe.Pointer(pDb)).FstmtList != 0 {
return (*SqlPreparedStmt)(unsafe.Pointer((*SqliteDb)(unsafe.Pointer(pDb)).FstmtList)).FpStmt
}
return uintptr(0)
}()))
- tcl.XTcl_SetResult(tls, interp, bp+1464 /* &zBuf[0] */, uintptr(1))
- goto __373
-__372:
+ tcl.XTcl_SetResult(tls, interp, bp+1480 /* &zBuf[0] */, uintptr(1))
+ goto __389
+__388:
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+992, ts+11200 /* "unknown argument..." */, zArg, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+992, ts+12846 /* "unknown argument..." */, zArg, uintptr(0)))
return 1
-__373:
+__389:
;
-__370:
+__386:
;
- goto __367
-__367:
+ goto __383
+__383:
i5++
- goto __366
- goto __368
-__368:
+ goto __382
+ goto __384
+__384:
;
if !(i5 == 2) {
- goto __374
+ goto __390
}
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3_libversion(tls), uintptr(0))
-__374:
+__390:
;
goto __3
__3:
@@ -36023,60 +40162,61 @@ type DbConfigChoices = struct {
}
var DB_strs = [42]uintptr{
- ts + 11219 /* "authorizer" */, ts + 11230 /* "backup" */, ts + 11237, /* "bind_fallback" */
- ts + 11251 /* "busy" */, ts + 11256 /* "cache" */, ts + 11262, /* "changes" */
- ts + 11270 /* "close" */, ts + 11276 /* "collate" */, ts + 11284, /* "collation_needed" */
- ts + 11301 /* "commit_hook" */, ts + 11313 /* "complete" */, ts + 11322, /* "config" */
- ts + 11329 /* "copy" */, ts + 11334 /* "deserialize" */, ts + 11346, /* "enable_load_exte..." */
- ts + 11368 /* "errorcode" */, ts + 3370 /* "eval" */, ts + 11378, /* "exists" */
- ts + 11385 /* "function" */, ts + 8647 /* "incrblob" */, ts + 11394, /* "interrupt" */
- ts + 11404 /* "last_insert_rowi..." */, ts + 11422 /* "nullvalue" */, ts + 11432, /* "onecolumn" */
- ts + 11442 /* "preupdate" */, ts + 11452 /* "profile" */, ts + 11460, /* "progress" */
- ts + 11469 /* "rekey" */, ts + 11475 /* "restore" */, ts + 11483, /* "rollback_hook" */
- ts + 11497 /* "serialize" */, ts + 11507 /* "status" */, ts + 11514, /* "timeout" */
- ts + 11522 /* "total_changes" */, ts + 11536 /* "trace" */, ts + 11542, /* "trace_v2" */
- ts + 11551 /* "transaction" */, ts + 11563 /* "unlock_notify" */, ts + 11577, /* "update_hook" */
- ts + 11589 /* "version" */, ts + 11597 /* "wal_hook" */, uintptr(0),
+ ts + 12865 /* "authorizer" */, ts + 12876 /* "backup" */, ts + 12883, /* "bind_fallback" */
+ ts + 12897 /* "busy" */, ts + 12902 /* "cache" */, ts + 12908, /* "changes" */
+ ts + 9947 /* "close" */, ts + 12916 /* "collate" */, ts + 12924, /* "collation_needed" */
+ ts + 12941 /* "commit_hook" */, ts + 12953 /* "complete" */, ts + 12962, /* "config" */
+ ts + 12969 /* "copy" */, ts + 12974 /* "deserialize" */, ts + 12986, /* "enable_load_exte..." */
+ ts + 13008 /* "errorcode" */, ts + 4587 /* "eval" */, ts + 13018, /* "exists" */
+ ts + 13025 /* "function" */, ts + 10346 /* "incrblob" */, ts + 13034, /* "interrupt" */
+ ts + 13044 /* "last_insert_rowi..." */, ts + 13062 /* "nullvalue" */, ts + 13072, /* "onecolumn" */
+ ts + 13082 /* "preupdate" */, ts + 13092 /* "profile" */, ts + 10021, /* "progress" */
+ ts + 13100 /* "rekey" */, ts + 13106 /* "restore" */, ts + 13114, /* "rollback_hook" */
+ ts + 13128 /* "serialize" */, ts + 13138 /* "status" */, ts + 13145, /* "timeout" */
+ ts + 13153 /* "total_changes" */, ts + 13167 /* "trace" */, ts + 13173, /* "trace_v2" */
+ ts + 13182 /* "transaction" */, ts + 13194 /* "unlock_notify" */, ts + 13208, /* "update_hook" */
+ ts + 13220 /* "version" */, ts + 13228 /* "wal_hook" */, uintptr(0),
} /* tclsqlite.c:1916:21 */
var aDbConfig = [16]DbConfigChoices{
- {FzName: ts + 11606 /* "defensive" */, Fop: 1010},
- {FzName: ts + 11616 /* "dqs_ddl" */, Fop: 1014},
- {FzName: ts + 11624 /* "dqs_dml" */, Fop: 1013},
- {FzName: ts + 11632 /* "enable_fkey" */, Fop: 1002},
- {FzName: ts + 11644 /* "enable_qpsg" */, Fop: 1007},
- {FzName: ts + 11656 /* "enable_trigger" */, Fop: 1003},
- {FzName: ts + 11671 /* "enable_view" */, Fop: 1015},
- {FzName: ts + 11683 /* "fts3_tokenizer" */, Fop: 1004},
- {FzName: ts + 11698 /* "legacy_alter_tab..." */, Fop: 1012},
- {FzName: ts + 11717 /* "legacy_file_form..." */, Fop: 1016},
- {FzName: ts + 11736 /* "load_extension" */, Fop: 1005},
- {FzName: ts + 11751 /* "no_ckpt_on_close" */, Fop: 1006},
- {FzName: ts + 11768 /* "reset_database" */, Fop: 1009},
- {FzName: ts + 11783 /* "trigger_eqp" */, Fop: 1008},
- {FzName: ts + 11795 /* "trusted_schema" */, Fop: 1017},
- {FzName: ts + 11810 /* "writable_schema" */, Fop: 1011},
+ {FzName: ts + 13237 /* "defensive" */, Fop: 1010},
+ {FzName: ts + 13247 /* "dqs_ddl" */, Fop: 1014},
+ {FzName: ts + 13255 /* "dqs_dml" */, Fop: 1013},
+ {FzName: ts + 13263 /* "enable_fkey" */, Fop: 1002},
+ {FzName: ts + 13275 /* "enable_qpsg" */, Fop: 1007},
+ {FzName: ts + 13287 /* "enable_trigger" */, Fop: 1003},
+ {FzName: ts + 13302 /* "enable_view" */, Fop: 1015},
+ {FzName: ts + 13314 /* "fts3_tokenizer" */, Fop: 1004},
+ {FzName: ts + 13329 /* "legacy_alter_tab..." */, Fop: 1012},
+ {FzName: ts + 13348 /* "legacy_file_form..." */, Fop: 1016},
+ {FzName: ts + 13367 /* "load_extension" */, Fop: 1005},
+ {FzName: ts + 13382 /* "no_ckpt_on_close" */, Fop: 1006},
+ {FzName: ts + 13399 /* "reset_database" */, Fop: 1009},
+ {FzName: ts + 13414 /* "trigger_eqp" */, Fop: 1008},
+ {FzName: ts + 13426 /* "trusted_schema" */, Fop: 1017},
+ {FzName: ts + 13441 /* "writable_schema" */, Fop: 1011},
} /* tclsqlite.c:2343:7 */
var TTYPE_strs = [5]uintptr{
- ts + 11826 /* "statement" */, ts + 11452 /* "profile" */, ts + 11836 /* "row" */, ts + 11270 /* "close" */, uintptr(0),
+ ts + 13457 /* "statement" */, ts + 13092 /* "profile" */, ts + 13467 /* "row" */, ts + 9947 /* "close" */, uintptr(0),
} /* tclsqlite.c:3321:27 */
var TTYPE_strs1 = [4]uintptr{
- ts + 11840 /* "deferred" */, ts + 11849 /* "exclusive" */, ts + 11859 /* "immediate" */, uintptr(0),
-} /* tclsqlite.c:3404:25 */
+ ts + 13471 /* "deferred" */, ts + 13480 /* "exclusive" */, ts + 13490 /* "immediate" */, uintptr(0),
+} /* tclsqlite.c:3404:25 */
+var azSub = [6]uintptr{ts + 1825 /* "count" */, ts + 13500 /* "depth" */, ts + 13506 /* "hook" */, ts + 13511 /* "new" */, ts + 13515 /* "old" */, uintptr(0)} /* tclsqlite.c:3496:23 */
// Adaptor that provides an objCmd interface to the NRE-enabled
// interface implementation.
-func DbObjCmdAdaptor(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* tclsqlite.c:3647:26: */
+func DbObjCmdAdaptor(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* tclsqlite.c:3647:26: */
return tcl.XTcl_NRCallObjProc(tls, interp, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{DbObjCmd})), cd, objc, objv)
}
// Issue the usage message when the "sqlite3" command arguments are
// incorrect.
-func sqliteCmdUsage(tls *crt.TLS, interp uintptr, objv uintptr) int32 { /* tclsqlite.c:3661:12: */
+func sqliteCmdUsage(tls *libc.TLS, interp uintptr, objv uintptr) int32 { /* tclsqlite.c:3661:12: */
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv,
- ts+11869 /* "HANDLE ?FILENAME..." */)
+ ts+13519 /* "HANDLE ?FILENAME..." */)
return 1
}
@@ -36094,7 +40234,7 @@ func sqliteCmdUsage(tls *crt.TLS, interp uintptr, objv uintptr) int32 { /* tclsq
//
// The second argument is the name of the database file.
//
-func DbMain(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* tclsqlite.c:3689:26: */
+func DbMain(tls *libc.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* tclsqlite.c:3689:26: */
bp := tls.Alloc(336)
defer tls.Free(336)
@@ -36122,16 +40262,16 @@ func DbMain(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr)
}
if objc == 2 {
zArg = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), uintptr(0))
- if crt.Xstrcmp(tls, zArg, ts+12015 /* "-version" */) == 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, sqlite3.Xsqlite3_libversion(tls), uintptr(0)))
+ if libc.Xstrcmp(tls, zArg, ts+13665 /* "-version" */) == 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3_libversion(tls), uintptr(0)))
return 0
}
- if crt.Xstrcmp(tls, zArg, ts+12024 /* "-sourceid" */) == 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+16, sqlite3.Xsqlite3_sourceid(tls), uintptr(0)))
+ if libc.Xstrcmp(tls, zArg, ts+13674 /* "-sourceid" */) == 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, sqlite3.Xsqlite3_sourceid(tls), uintptr(0)))
return 0
}
- if crt.Xstrcmp(tls, zArg, ts+12034 /* "-has-codec" */) == 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+12045 /* "0" */, uintptr(0)))
+ if libc.Xstrcmp(tls, zArg, ts+13684 /* "-has-codec" */) == 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+13695 /* "0" */, uintptr(0)))
return 0
}
if int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) == '-' {
@@ -36151,23 +40291,23 @@ func DbMain(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr)
return sqliteCmdUsage(tls, interp, objv)
}
i++
- if crt.Xstrcmp(tls, zArg, ts+12047 /* "-key" */) == 0 {
- } else if crt.Xstrcmp(tls, zArg, ts+12052 /* "-vfs" */) == 0 {
+ if libc.Xstrcmp(tls, zArg, ts+13697 /* "-key" */) == 0 {
+ } else if libc.Xstrcmp(tls, zArg, ts+13702 /* "-vfs" */) == 0 {
zVfs = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
- } else if crt.Xstrcmp(tls, zArg, ts+10290 /* "-readonly" */) == 0 {
+ } else if libc.Xstrcmp(tls, zArg, ts+11945 /* "-readonly" */) == 0 {
// var b int32 at bp+88, 4
if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+88 /* &b */) != 0 {
return 1
}
if *(*int32)(unsafe.Pointer(bp + 88 /* b */)) != 0 {
- flags = flags & (^int32(crt.Int32FromInt32((0x00000002 | 0x00000004))))
+ flags = flags & (^int32(libc.Int32FromInt32((0x00000002 | 0x00000004))))
flags = flags | (0x00000001)
} else {
- flags = flags & (^int32(crt.Int32FromInt32(0x00000001)))
+ flags = flags & (^int32(libc.Int32FromInt32(0x00000001)))
flags = flags | (0x00000002)
}
- } else if crt.Xstrcmp(tls, zArg, ts+12057 /* "-create" */) == 0 {
+ } else if libc.Xstrcmp(tls, zArg, ts+13707 /* "-create" */) == 0 {
// var b int32 at bp+92, 4
if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+92 /* &b */) != 0 {
@@ -36176,9 +40316,9 @@ func DbMain(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr)
if (*(*int32)(unsafe.Pointer(bp + 92 /* b */)) != 0) && ((flags & 0x00000001) == 0) {
flags = flags | (0x00000004)
} else {
- flags = flags & (^int32(crt.Int32FromInt32(0x00000004)))
+ flags = flags & (^int32(libc.Int32FromInt32(0x00000004)))
}
- } else if crt.Xstrcmp(tls, zArg, ts+12065 /* "-nofollow" */) == 0 {
+ } else if libc.Xstrcmp(tls, zArg, ts+13715 /* "-nofollow" */) == 0 {
// var b int32 at bp+96, 4
if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+96 /* &b */) != 0 {
@@ -36187,9 +40327,9 @@ func DbMain(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr)
if *(*int32)(unsafe.Pointer(bp + 96 /* b */)) != 0 {
flags = flags | (0x01000000)
} else {
- flags = flags & (^int32(crt.Int32FromInt32(0x01000000)))
+ flags = flags & (^int32(libc.Int32FromInt32(0x01000000)))
}
- } else if crt.Xstrcmp(tls, zArg, ts+12075 /* "-nomutex" */) == 0 {
+ } else if libc.Xstrcmp(tls, zArg, ts+13725 /* "-nomutex" */) == 0 {
// var b int32 at bp+100, 4
if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+100 /* &b */) != 0 {
@@ -36197,11 +40337,11 @@ func DbMain(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr)
}
if *(*int32)(unsafe.Pointer(bp + 100 /* b */)) != 0 {
flags = flags | (0x00008000)
- flags = flags & (^int32(crt.Int32FromInt32(0x00010000)))
+ flags = flags & (^int32(libc.Int32FromInt32(0x00010000)))
} else {
- flags = flags & (^int32(crt.Int32FromInt32(0x00008000)))
+ flags = flags & (^int32(libc.Int32FromInt32(0x00008000)))
}
- } else if crt.Xstrcmp(tls, zArg, ts+12084 /* "-fullmutex" */) == 0 {
+ } else if libc.Xstrcmp(tls, zArg, ts+13734 /* "-fullmutex" */) == 0 {
// var b int32 at bp+104, 4
if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+104 /* &b */) != 0 {
@@ -36209,11 +40349,11 @@ func DbMain(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr)
}
if *(*int32)(unsafe.Pointer(bp + 104 /* b */)) != 0 {
flags = flags | (0x00010000)
- flags = flags & (^int32(crt.Int32FromInt32(0x00008000)))
+ flags = flags & (^int32(libc.Int32FromInt32(0x00008000)))
} else {
- flags = flags & (^int32(crt.Int32FromInt32(0x00010000)))
+ flags = flags & (^int32(libc.Int32FromInt32(0x00010000)))
}
- } else if crt.Xstrcmp(tls, zArg, ts+12095 /* "-uri" */) == 0 {
+ } else if libc.Xstrcmp(tls, zArg, ts+13745 /* "-uri" */) == 0 {
// var b int32 at bp+108, 4
if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+108 /* &b */) != 0 {
@@ -36222,20 +40362,20 @@ func DbMain(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr)
if *(*int32)(unsafe.Pointer(bp + 108 /* b */)) != 0 {
flags = flags | (0x00000040)
} else {
- flags = flags & (^int32(crt.Int32FromInt32(0x00000040)))
+ flags = flags & (^int32(libc.Int32FromInt32(0x00000040)))
}
- } else if crt.Xstrcmp(tls, zArg, ts+12100 /* "-translatefilena..." */) == 0 {
+ } else if libc.Xstrcmp(tls, zArg, ts+13750 /* "-translatefilena..." */) == 0 {
if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+112 /* &bTranslateFileName */) != 0 {
return 1
}
} else {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, ts+10300 /* "unknown option: " */, zArg, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+11955 /* "unknown option: " */, zArg, uintptr(0)))
return 1
}
}
zErrMsg = uintptr(0)
p = tcl.XTcl_Alloc(tls, uint32(unsafe.Sizeof(SqliteDb{})))
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(SqliteDb{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(SqliteDb{})))
if zFile == uintptr(0) {
zFile = ts + 488 /* "" */
}
@@ -36248,12 +40388,12 @@ func DbMain(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr)
}
if (*SqliteDb)(unsafe.Pointer(p)).Fdb != 0 {
if 0 != sqlite3.Xsqlite3_errcode(tls, (*SqliteDb)(unsafe.Pointer(p)).Fdb) {
- zErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(p)).Fdb)))
+ zErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+72, sqlite3.Xsqlite3_errmsg(tls, (*SqliteDb)(unsafe.Pointer(p)).Fdb)))
sqlite3.Xsqlite3_close(tls, (*SqliteDb)(unsafe.Pointer(p)).Fdb)
(*SqliteDb)(unsafe.Pointer(p)).Fdb = uintptr(0)
}
} else {
- zErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+80, sqlite3.Xsqlite3_errstr(tls, rc)))
+ zErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+80, sqlite3.Xsqlite3_errstr(tls, rc)))
}
if (*SqliteDb)(unsafe.Pointer(p)).Fdb == uintptr(0) {
tcl.XTcl_SetResult(tls, interp, zErrMsg, uintptr(1))
@@ -36267,15 +40407,15 @@ func DbMain(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr)
zArg = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), uintptr(0))
if DbUseNre(tls) != 0 {
tcl.XTcl_NRCreateCommand(tls, interp, zArg, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{DbObjCmdAdaptor})), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{DbObjCmd})),
- p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{DbDeleteCmd})))
+ p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{DbDeleteCmd})))
} else {
tcl.XTcl_CreateObjCommand(tls, interp, zArg, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{DbObjCmd})), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{DbDeleteCmd})))
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{DbObjCmd})), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{DbDeleteCmd})))
}
return 0
}
@@ -36296,7 +40436,7 @@ func DbMain(tls *crt.TLS, cd uintptr, interp uintptr, objc int32, objv uintptr)
// for additional information.
//
// The EXTERN macros are required by TCL in order to work on windows.
-func Sqlite3_Init(tls *crt.TLS, interp uintptr) int32 { /* tclsqlite.c:3877:12: */
+func Sqlite3_Init(tls *libc.TLS, interp uintptr) int32 { /* tclsqlite.c:3877:12: */
var rc int32
if 1 != 0 {
rc = 0
@@ -36304,47 +40444,47 @@ func Sqlite3_Init(tls *crt.TLS, interp uintptr) int32 { /* tclsqlite.c:3877:12:
rc = 1
}
if rc == 0 {
- tcl.XTcl_CreateObjCommand(tls, interp, ts+12119 /* "sqlite3" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+13769 /* "sqlite3" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{DbMain})), uintptr(0), uintptr(0))
// The "sqlite" alias is undocumented. It is here only to support
// legacy scripts. All new scripts should use only the "sqlite3"
// command.
- tcl.XTcl_CreateObjCommand(tls, interp, ts+12127 /* "sqlite" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+13777 /* "sqlite" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{DbMain})), uintptr(0), uintptr(0))
- rc = tcl.XTcl_PkgProvideEx(tls, interp, ts+12119 /* "sqlite3" */, ts+12134 /* "3.32.3" */, uintptr(0))
+ rc = tcl.XTcl_PkgProvideEx(tls, interp, ts+13769 /* "sqlite3" */, ts+13784 /* "3.33.0" */, uintptr(0))
}
return rc
}
-func Tclsqlite3_Init(tls *crt.TLS, interp uintptr) int32 { /* tclsqlite.c:3891:12: */
+func Tclsqlite3_Init(tls *libc.TLS, interp uintptr) int32 { /* tclsqlite.c:3891:12: */
return Sqlite3_Init(tls, interp)
}
-func Sqlite3_Unload(tls *crt.TLS, interp uintptr, flags int32) int32 { /* tclsqlite.c:3892:12: */
+func Sqlite3_Unload(tls *libc.TLS, interp uintptr, flags int32) int32 { /* tclsqlite.c:3892:12: */
return 0
}
-func Tclsqlite3_Unload(tls *crt.TLS, interp uintptr, flags int32) int32 { /* tclsqlite.c:3893:12: */
+func Tclsqlite3_Unload(tls *libc.TLS, interp uintptr, flags int32) int32 { /* tclsqlite.c:3893:12: */
return 0
}
// Because it accesses the file-system and uses persistent state, SQLite
// is not considered appropriate for safe interpreters. Hence, we cause
// the _SafeInit() interfaces return TCL_ERROR.
-func Sqlite3_SafeInit(tls *crt.TLS, interp uintptr) int32 { /* tclsqlite.c:3899:12: */ return 1 }
-func Sqlite3_SafeUnload(tls *crt.TLS, interp uintptr, flags int32) int32 { /* tclsqlite.c:3900:12: */
+func Sqlite3_SafeInit(tls *libc.TLS, interp uintptr) int32 { /* tclsqlite.c:3899:12: */ return 1 }
+func Sqlite3_SafeUnload(tls *libc.TLS, interp uintptr, flags int32) int32 { /* tclsqlite.c:3900:12: */
return 1
}
-func Sqlite_Init(tls *crt.TLS, interp uintptr) int32 { /* tclsqlite.c:3905:5: */
+func Sqlite_Init(tls *libc.TLS, interp uintptr) int32 { /* tclsqlite.c:3905:5: */
return Sqlite3_Init(tls, interp)
}
-func Tclsqlite_Init(tls *crt.TLS, interp uintptr) int32 { /* tclsqlite.c:3906:5: */
+func Tclsqlite_Init(tls *libc.TLS, interp uintptr) int32 { /* tclsqlite.c:3906:5: */
return Sqlite3_Init(tls, interp)
}
-func Sqlite_Unload(tls *crt.TLS, interp uintptr, flags int32) int32 { /* tclsqlite.c:3907:5: */
+func Sqlite_Unload(tls *libc.TLS, interp uintptr, flags int32) int32 { /* tclsqlite.c:3907:5: */
return 0
}
-func Tclsqlite_Unload(tls *crt.TLS, interp uintptr, flags int32) int32 { /* tclsqlite.c:3908:5: */
+func Tclsqlite_Unload(tls *libc.TLS, interp uintptr, flags int32) int32 { /* tclsqlite.c:3908:5: */
return 0
}
@@ -36353,13 +40493,13 @@ func Tclsqlite_Unload(tls *crt.TLS, interp uintptr, flags int32) int32 { /* tcls
// This is the main routine for an ordinary TCL shell. If there are
// are arguments, run the first argument as a script. Otherwise,
// read TCL commands from standard input
-func tclsh_main_loop(tls *crt.TLS) uintptr { /* tclsqlite.c:3920:19: */
+func tclsh_main_loop(tls *libc.TLS) uintptr { /* tclsqlite.c:3920:19: */
return uintptr(unsafe.Pointer(&zMainloop))
}
-var zMainloop = *(*[431]int8)(unsafe.Pointer(ts + 12141 /* "if {[llength $ar..." */)) /* tclsqlite.c:3921:21 */
+var zMainloop = *(*[431]int8)(unsafe.Pointer(ts + 13791 /* "if {[llength $ar..." */)) /* tclsqlite.c:3921:21 */
-func main(tls *crt.TLS, argc int32, argv uintptr) int32 { /* tclsqlite.c:3953:18: */
+func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* tclsqlite.c:3953:18: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -36368,14 +40508,14 @@ func main(tls *crt.TLS, argc int32, argv uintptr) int32 { /* tclsqlite.c:3953:18
var zScript uintptr = uintptr(0)
// var zArgc [32]int8 at bp+32, 32
- if crt.Xgetenv(tls, ts+12572 /* "SQLITE_DEBUG_BRE..." */) != 0 {
- if (crt.Xisatty(tls, 0) != 0) && (crt.Xisatty(tls, 2) != 0) {
- crt.Xfprintf(tls, crt.Xstderr,
- ts+12591, /* "attach debugger ..." */
- crt.VaList(bp, crt.Xgetpid(tls)))
- crt.Xfgetc(tls, crt.Xstdin)
+ if libc.Xgetenv(tls, ts+14222 /* "SQLITE_DEBUG_BRE..." */) != 0 {
+ if (libc.Xisatty(tls, 0) != 0) && (libc.Xisatty(tls, 2) != 0) {
+ libc.Xfprintf(tls, libc.Xstderr,
+ ts+14241, /* "attach debugger ..." */
+ libc.VaList(bp, libc.Xgetpid(tls)))
+ libc.Xfgetc(tls, libc.Xstdin)
} else {
- crt.Xraise(tls, 5)
+ libc.Xraise(tls, 5)
}
}
@@ -36385,27 +40525,27 @@ func main(tls *crt.TLS, argc int32, argv uintptr) int32 { /* tclsqlite.c:3953:18
sqlite3.Xsqlite3_shutdown(tls)
tcl.XTcl_FindExecutable(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- tcl.XTcl_SetSystemEncoding(tls, uintptr(0), ts+12653 /* "utf-8" */)
+ tcl.XTcl_SetSystemEncoding(tls, uintptr(0), ts+14303 /* "utf-8" */)
interp = tcl.XTcl_CreateInterp(tls)
Sqlite3_Init(tls, interp)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), bp+32 /* &zArgc[0] */, ts+1237 /* "%d" */, crt.VaList(bp+8, (argc-1)))
- tcl.XTcl_SetVar2(tls, interp, ts+12659 /* "argc" */, uintptr(0), bp+32 /* &zArgc[0] */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+12664 /* "argv0" */, uintptr(0), *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), 1)
- tcl.XTcl_SetVar2(tls, interp, ts+12670 /* "argv" */, uintptr(0), ts+488 /* "" */, 1)
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([32]int8{})), bp+32 /* &zArgc[0] */, ts+1237 /* "%d" */, libc.VaList(bp+8, (argc-1)))
+ tcl.XTcl_SetVar2(tls, interp, ts+14309 /* "argc" */, uintptr(0), bp+32 /* &zArgc[0] */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+14314 /* "argv0" */, uintptr(0), *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+14320 /* "argv" */, uintptr(0), ts+488 /* "" */, 1)
for i = 1; i < argc; i++ {
- tcl.XTcl_SetVar2(tls, interp, ts+12670 /* "argv" */, uintptr(0), *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ((1 | 8) | 4))
+ tcl.XTcl_SetVar2(tls, interp, ts+14320 /* "argv" */, uintptr(0), *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ((1 | 8) | 4))
}
zScript = sqlite3TestInit(tls, interp)
if zScript == uintptr(0) {
zScript = tclsh_main_loop(tls)
}
if tcl.XTcl_GlobalEval(tls, interp, zScript) != 0 {
- var zInfo uintptr = tcl.XTcl_GetVar2(tls, interp, ts+12675 /* "errorInfo" */, uintptr(0), 1)
+ var zInfo uintptr = tcl.XTcl_GetVar2(tls, interp, ts+14325 /* "errorInfo" */, uintptr(0), 1)
if zInfo == uintptr(0) {
zInfo = tcl.XTcl_GetStringResult(tls, interp)
}
- crt.Xfprintf(tls, crt.Xstderr, ts+12685 /* "%s: %s\n" */, crt.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv)), zInfo))
+ libc.Xfprintf(tls, libc.Xstderr, ts+14335 /* "%s: %s\n" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv)), zInfo))
return 1
}
return 0
@@ -36463,7 +40603,7 @@ type sqlite31 = sqlite32 /* sqlite3.h:249:24 */
// [sqlite3_value_dup()].
// The [sqlite3_value_blob | sqlite3_value_type()] family of
// interfaces require protected sqlite3_value objects.
-type sqlite3_value = sqlite3_value1 /* sqlite3.h:4242:30 */
+type sqlite3_value = sqlite3_value1 /* sqlite3.h:4244:30 */
// CAPI3REF: SQL Function Context Object
//
@@ -36475,7 +40615,7 @@ type sqlite3_value = sqlite3_value1 /* sqlite3.h:4242:30 */
// [sqlite3_aggregate_context()], [sqlite3_user_data()],
// [sqlite3_context_db_handle()], [sqlite3_get_auxdata()],
// and/or [sqlite3_set_auxdata()].
-type sqlite3_context = sqlite3_context1 /* sqlite3.h:4256:32 */
+type sqlite3_context = sqlite3_context1 /* sqlite3.h:4258:32 */
// CAPI3REF: Dynamic String Object
// KEYWORDS: {dynamic string}
@@ -36491,7 +40631,122 @@ type sqlite3_context = sqlite3_context1 /* sqlite3.h:4256:32 */
// <li> ^The sqlite3_str object is destroyed and the string it created
// is returned using the [sqlite3_str_finish()] interface.
// </ol>
-type sqlite3_str = sqlite3_str1 /* sqlite3.h:7778:28 */
+type sqlite3_str = sqlite3_str1 /* sqlite3.h:7784:28 */
+
+// Unsigned.
+// Define uintN_t types.
+// Copyright (C) 2017-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// bits/types.h -- definitions of __*_t types underlying *_t types.
+// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Never include this file directly; use <sys/types.h> instead.
+
+type uint8_t = uint8 /* stdint-uintn.h:24:19 */
+type uint16_t = uint16 /* stdint-uintn.h:25:20 */
+type uint32_t = uint32 /* stdint-uintn.h:26:20 */
+type uint64_t = uint64 /* stdint-uintn.h:27:20 */
+
+// Small types.
+
+// Signed.
+type int_least8_t = int8 /* stdint.h:43:24 */
+type int_least16_t = int16 /* stdint.h:44:25 */
+type int_least32_t = int32 /* stdint.h:45:25 */
+type int_least64_t = int64 /* stdint.h:46:25 */
+
+// Unsigned.
+type uint_least8_t = uint8 /* stdint.h:49:25 */
+type uint_least16_t = uint16 /* stdint.h:50:26 */
+type uint_least32_t = uint32 /* stdint.h:51:26 */
+type uint_least64_t = uint64 /* stdint.h:52:26 */
+
+// Fast types.
+
+// Signed.
+type int_fast8_t = int8 /* stdint.h:58:22 */
+type int_fast16_t = int64 /* stdint.h:60:19 */
+type int_fast32_t = int64 /* stdint.h:61:19 */
+type int_fast64_t = int64 /* stdint.h:62:19 */
+
+// Unsigned.
+type uint_fast8_t = uint8 /* stdint.h:71:24 */
+type uint_fast16_t = uint64 /* stdint.h:73:27 */
+type uint_fast32_t = uint64 /* stdint.h:74:27 */
+type uint_fast64_t = uint64 /* stdint.h:75:27 */
+type uintptr_t = uint64 /* stdint.h:90:27 */
+
+// Largest integral types.
+type intmax_t = int64 /* stdint.h:101:21 */
+type uintmax_t = uint64 /* stdint.h:102:22 */
+
+// Macros for printing format specifiers.
+
+// Decimal notation.
+
+// Octal notation.
+
+// Unsigned integers.
+
+// lowercase hexadecimal notation.
+
+// UPPERCASE hexadecimal notation.
+
+// Macros for printing `intmax_t' and `uintmax_t'.
+
+// Macros for printing `intptr_t' and `uintptr_t'.
+
+// Macros for scanning format specifiers.
+
+// Signed decimal notation.
+
+// Signed decimal notation.
+
+// Unsigned decimal notation.
+
+// Octal notation.
+
+// Hexadecimal notation.
+
+// Macros for scanning `intmax_t' and `uintmax_t'.
+
+// Macros for scaning `intptr_t' and `uintptr_t'.
+
+// We have to define the `uintmax_t' type using `ldiv_t'.
+type imaxdiv_t = struct {
+ Fquot int64
+ Frem int64
+} /* inttypes.h:275:5 */
// Is the sqlite3ErrName() function needed in the build? Currently,
// it is needed by "mutex_w32.c" (when debugging), "os_win.c" (when
@@ -36604,9 +40859,9 @@ type ino64_t = uint64 /* types.h:54:19 */ // Type to count file system ino
type blkcnt64_t = int64 /* types.h:236:22 */ // Type to count number of disk blocks.
type fsblkcnt64_t = uint64 /* types.h:237:24 */ // Type to count file system blocks.
type fsfilcnt64_t = uint64 /* types.h:238:24 */ // 8-byte unsigned integer
-type u321 = uint32 /* sqliteInt.h:771:21 */ // 2-byte unsigned integer
-type i16 = int16 /* sqliteInt.h:773:20 */ // 1-byte unsigned integer
-type i8 = int8 /* sqliteInt.h:775:19 */ // 1-byte signed integer
+type u322 = uint32_t /* sqliteInt.h:780:21 */ // 2-byte unsigned integer
+type i16 = int16_t /* sqliteInt.h:782:20 */ // 1-byte unsigned integer
+type i8 = int8_t /* sqliteInt.h:784:19 */ // 1-byte signed integer
// SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value
// that can be stored in a u32 without loss of data. The value
@@ -36617,7 +40872,7 @@ type i8 = int8 /* sqliteInt.h:775:19 */ // 1-byte signed integer
// table or index. This is an unsigned integer type. For 99.9% of
// the world, a 32-bit integer is sufficient. But a 64-bit integer
// can be used at compile-time if desired.
-type tRowcnt = u321 /* sqliteInt.h:794:14 */ // 32-bit is the default
+type tRowcnt = u322 /* sqliteInt.h:803:14 */ // 32-bit is the default
// Estimated quantities used for query planning are stored as 16-bit
// logarithms. For quantity X, the value stored is 10*log2(X). This
@@ -36640,12 +40895,12 @@ type tRowcnt = u321 /* sqliteInt.h:794:14 */ // 32-bit is the default
// Examples:
//
// 0.5 -> -10 0.1 -> -33 0.0625 -> -40
-type LogEst = int16 /* sqliteInt.h:820:20 */
+type LogEst = int16_t /* sqliteInt.h:829:20 */
// Set the SQLITE_PTRSIZE macro to the number of bytes in a pointer
// The uptr type is an unsigned integer large enough to hold a pointer
-type uptr = u64 /* sqliteInt.h:844:15 */
+type uptr = uintptr_t /* sqliteInt.h:849:21 */
// The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to
// something between S (inclusive) and E (exclusive).
@@ -36754,15 +41009,13 @@ type BusyHandler1 = struct {
// callback for the database handle. Each pager opened via the sqlite
// handle is passed a pointer to sqlite.busyHandler. The busy-handler
// callback is currently invoked only from within pager.c.
-type BusyHandler = BusyHandler1 /* sqliteInt.h:992:28 */
+type BusyHandler = BusyHandler1 /* sqliteInt.h:1012:28 */
-// Name of the master database table. The master database table
-// is a special table that holds the names and attributes of all
-// user tables and indices.
+// Name of table that holds the database schema.
-// The root-page of the master database table.
+// The root-page of the schema table.
-// The name of the schema table.
+// The name of the schema table. The name is different for TEMP.
// A convenience macro that returns the number of elements in
// an array.
@@ -36819,16 +41072,15 @@ type AggInfo1 = struct {
FnAccumulator int32
FaFunc uintptr
FnFunc int32
+ FselId u322
FpNext uintptr
}
-// Name of the master database table. The master database table
-// is a special table that holds the names and attributes of all
-// user tables and indices.
+// Name of table that holds the database schema.
-// The root-page of the master database table.
+// The root-page of the schema table.
-// The name of the schema table.
+// The name of the schema table. The name is different for TEMP.
// A convenience macro that returns the number of elements in
// an array.
@@ -36871,13 +41123,13 @@ type AggInfo1 = struct {
// cases the parameters are named as per the usual conventions.
// Forward references to structures
-type AggInfo = AggInfo1 /* sqliteInt.h:1086:24 */
+type AggInfo = AggInfo1 /* sqliteInt.h:1108:24 */
type AuthContext1 = struct {
FzAuthContext uintptr
FpParse uintptr
}
-type AuthContext = AuthContext1 /* sqliteInt.h:1087:28 */
+type AuthContext = AuthContext1 /* sqliteInt.h:1109:28 */
type AutoincInfo1 = struct {
FpNext uintptr
FpTab uintptr
@@ -36885,7 +41137,7 @@ type AutoincInfo1 = struct {
FregCtr int32
}
-type AutoincInfo = AutoincInfo1 /* sqliteInt.h:1088:28 */
+type AutoincInfo = AutoincInfo1 /* sqliteInt.h:1110:28 */
type CollSeq1 = struct {
FzName uintptr
Fenc u8
@@ -36894,7 +41146,7 @@ type CollSeq1 = struct {
FxDel uintptr
}
-type CollSeq = CollSeq1 /* sqliteInt.h:1090:24 */
+type CollSeq = CollSeq1 /* sqliteInt.h:1112:24 */
type Column1 = struct {
FzName uintptr
FpDflt uintptr
@@ -36907,7 +41159,7 @@ type Column1 = struct {
_ [2]byte
}
-type Column = Column1 /* sqliteInt.h:1091:23 */
+type Column = Column1 /* sqliteInt.h:1113:23 */
type Db1 = struct {
FzDbSName uintptr
FpBt uintptr
@@ -36916,7 +41168,7 @@ type Db1 = struct {
FpSchema uintptr
}
-type Db = Db1 /* sqliteInt.h:1092:19 */
+type Db = Db1 /* sqliteInt.h:1114:19 */
type Schema1 = struct {
Fschema_cookie int32
FiGeneration int32
@@ -36931,16 +41183,17 @@ type Schema1 = struct {
Fcache_size int32
}
-type Schema = Schema1 /* sqliteInt.h:1093:23 */
+type Schema = Schema1 /* sqliteInt.h:1115:23 */
type Expr1 = struct {
Fop u8
FaffExpr int8
Fop2 u8
- Fflags u321
+ Fflags u322
Fu struct{ FzToken uintptr }
FpLeft uintptr
FpRight uintptr
Fx struct{ FpList uintptr }
+ FnHeight int32
FiTable int32
FiColumn ynVar
FiAgg i16
@@ -36949,7 +41202,7 @@ type Expr1 = struct {
Fy struct{ FpTab uintptr }
}
-type Expr = Expr1 /* sqliteInt.h:1094:21 */
+type Expr = Expr1 /* sqliteInt.h:1116:21 */
type ExprList1 = struct {
FnExpr int32
Fa [1]struct {
@@ -36969,7 +41222,7 @@ type ExprList1 = struct {
}
}
-type ExprList = ExprList1 /* sqliteInt.h:1095:25 */
+type ExprList = ExprList1 /* sqliteInt.h:1117:25 */
type FKey1 = struct {
FpFrom uintptr
FpNextFrom uintptr
@@ -36986,17 +41239,17 @@ type FKey1 = struct {
}
}
-type FKey = FKey1 /* sqliteInt.h:1096:21 */
+type FKey = FKey1 /* sqliteInt.h:1118:21 */
type FuncDestructor1 = struct {
FnRef int32
FxDestroy uintptr
FpUserData uintptr
}
-type FuncDestructor = FuncDestructor1 /* sqliteInt.h:1097:31 */
+type FuncDestructor = FuncDestructor1 /* sqliteInt.h:1119:31 */
type FuncDef1 = struct {
FnArg i8
- FfuncFlags u321
+ FfuncFlags u322
FpUserData uintptr
FpNext uintptr
FxSFunc uintptr
@@ -37007,17 +41260,17 @@ type FuncDef1 = struct {
Fu struct{ FpHash uintptr }
}
-type FuncDef = FuncDef1 /* sqliteInt.h:1098:24 */
+type FuncDef = FuncDef1 /* sqliteInt.h:1120:24 */
type FuncDefHash1 = struct{ Fa [23]uintptr }
-type FuncDefHash = FuncDefHash1 /* sqliteInt.h:1099:28 */
+type FuncDefHash = FuncDefHash1 /* sqliteInt.h:1121:28 */
type IdList1 = struct {
Fa uintptr
FnId int32
_ [4]byte
}
-type IdList = IdList1 /* sqliteInt.h:1100:23 */
+type IdList = IdList1 /* sqliteInt.h:1122:23 */
type Index1 = struct {
FzName uintptr
FaiColumn uintptr
@@ -37030,16 +41283,22 @@ type Index1 = struct {
FazColl uintptr
FpPartIdxWhere uintptr
FaColExpr uintptr
- Ftnum int32
+ Ftnum Pgno
FszIdxRow LogEst
FnKeyCol u16
FnColumn u16
FonError u8
FidxType uint16 /* unsigned idxType: 2, unsigned bUnordered: 1, unsigned uniqNotNull: 1, unsigned isResized: 1, unsigned isCovering: 1, unsigned noSkipScan: 1, unsigned hasStat1: 1, unsigned bNoQuery: 1, unsigned bAscKeyBug: 1, unsigned bHasVCol: 1 */
+ FnSample int32
+ FnSampleCol int32
+ FaAvgEq uintptr
+ FaSample uintptr
+ FaiRowEst uintptr
+ FnRowEst0 tRowcnt
FcolNotIdxed Bitmask
}
-type Index = Index1 /* sqliteInt.h:1101:22 */
+type Index = Index1 /* sqliteInt.h:1123:22 */
type IndexSample1 = struct {
Fp uintptr
Fn int32
@@ -37048,9 +41307,9 @@ type IndexSample1 = struct {
FanDLt uintptr
}
-type IndexSample = IndexSample1 /* sqliteInt.h:1102:28 */
+type IndexSample = IndexSample1 /* sqliteInt.h:1124:28 */
type KeyInfo1 = struct {
- FnRef u321
+ FnRef u322
Fenc u8
FnKeyField u16
FnAllField u16
@@ -37059,14 +41318,14 @@ type KeyInfo1 = struct {
FaColl [1]uintptr
}
-type KeyInfo = KeyInfo1 /* sqliteInt.h:1104:24 */
+type KeyInfo = KeyInfo1 /* sqliteInt.h:1126:24 */
type Lookaside1 = struct {
- FbDisable u321
+ FbDisable u322
Fsz u16
FszTrue u16
FbMalloced u8
- FnSlot u321
- FanStat [3]u321
+ FnSlot u322
+ FanStat [3]u322
FpInit uintptr
FpFree uintptr
FpSmallInit uintptr
@@ -37076,10 +41335,10 @@ type Lookaside1 = struct {
FpEnd uintptr
}
-type Lookaside = Lookaside1 /* sqliteInt.h:1105:26 */
+type Lookaside = Lookaside1 /* sqliteInt.h:1127:26 */
type LookasideSlot1 = struct{ FpNext uintptr }
-type LookasideSlot = LookasideSlot1 /* sqliteInt.h:1106:30 */
+type LookasideSlot = LookasideSlot1 /* sqliteInt.h:1128:30 */
type Module1 = struct {
FpModule uintptr
FzName uintptr
@@ -37089,7 +41348,7 @@ type Module1 = struct {
FpEpoTab uintptr
}
-type Module = Module1 /* sqliteInt.h:1107:23 */
+type Module = Module1 /* sqliteInt.h:1129:23 */
type NameContext1 = struct {
FpParse uintptr
FpSrcList uintptr
@@ -37101,7 +41360,7 @@ type NameContext1 = struct {
FpWinSelect uintptr
}
-type NameContext = NameContext1 /* sqliteInt.h:1108:28 */
+type NameContext = NameContext1 /* sqliteInt.h:1130:28 */
type Parse1 = struct {
Fdb uintptr
FzErrMsg uintptr
@@ -37143,9 +41402,9 @@ type Parse1 = struct {
FpParentParse uintptr
FpAggList uintptr
FaddrCrTab int32
- FnQueryLoop u321
- Foldmask u321
- Fnewmask u321
+ FnQueryLoop u322
+ Foldmask u322
+ Fnewmask u322
FeTriggerOp u8
FeOrconf u8
FdisableTriggers u8
@@ -37175,7 +41434,7 @@ type Parse1 = struct {
FpRename uintptr
}
-type Parse = Parse1 /* sqliteInt.h:1109:22 */
+type Parse = Parse1 /* sqliteInt.h:1131:22 */
type PreUpdate1 = struct {
Fv uintptr
FpCsr uintptr
@@ -37192,14 +41451,14 @@ type PreUpdate1 = struct {
FpPk uintptr
}
-type PreUpdate = PreUpdate1 /* sqliteInt.h:1110:26 */
+type PreUpdate = PreUpdate1 /* sqliteInt.h:1132:26 */
type PrintfArguments1 = struct {
FnArg int32
FnUsed int32
FapArg uintptr
}
-type PrintfArguments = PrintfArguments1 /* sqliteInt.h:1111:32 */
+type PrintfArguments = PrintfArguments1 /* sqliteInt.h:1133:32 */
type Savepoint1 = struct {
FzName uintptr
FnDeferredCons i64
@@ -37207,14 +41466,14 @@ type Savepoint1 = struct {
FpNext uintptr
}
-type Savepoint = Savepoint1 /* sqliteInt.h:1114:26 */
+type Savepoint = Savepoint1 /* sqliteInt.h:1136:26 */
type Select1 = struct {
Fop u8
FnSelectRow LogEst
- FselFlags u321
+ FselFlags u322
FiLimit int32
FiOffset int32
- FselId u321
+ FselId u322
FaddrOpenEphm [2]int32
FpEList uintptr
FpSrc uintptr
@@ -37230,20 +41489,21 @@ type Select1 = struct {
FpWinDefn uintptr
}
-type Select = Select1 /* sqliteInt.h:1115:23 */
+type Select = Select1 /* sqliteInt.h:1137:23 */
type SelectDest1 = struct {
FeDest u8
FiSDParm int32
+ FiSDParm2 int32
FiSdst int32
FnSdst int32
FzAffSdst uintptr
FpOrderBy uintptr
}
-type SelectDest = SelectDest1 /* sqliteInt.h:1117:27 */
+type SelectDest = SelectDest1 /* sqliteInt.h:1139:27 */
type SrcList1 = struct {
FnSrc int32
- FnAlloc u321
+ FnAlloc u322
Fa [1]struct {
FpSchema uintptr
FzDatabase uintptr
@@ -37270,8 +41530,8 @@ type SrcList1 = struct {
}
}
-type SrcList = SrcList1 /* sqliteInt.h:1118:24 */
-type StrAccum = sqlite3_str1 /* sqliteInt.h:1119:28 */ // Internal alias for sqlite3_str
+type SrcList = SrcList1 /* sqliteInt.h:1140:24 */
+type StrAccum = sqlite3_str1 /* sqliteInt.h:1141:28 */ // Internal alias for sqlite3_str
type Table1 = struct {
FzName uintptr
FaCol uintptr
@@ -37280,9 +41540,9 @@ type Table1 = struct {
FpFKey uintptr
FzColAff uintptr
FpCheck uintptr
- Ftnum int32
- FnTabRef u321
- FtabFlags u321
+ Ftnum Pgno
+ FnTabRef u322
+ FtabFlags u322
FiPKey i16
FnCol i16
FnNVCol i16
@@ -37299,14 +41559,14 @@ type Table1 = struct {
}
// Internal alias for sqlite3_str
-type Table = Table1 /* sqliteInt.h:1120:22 */
+type Table = Table1 /* sqliteInt.h:1142:22 */
type Token1 = struct {
Fz uintptr
Fn uint32
_ [4]byte
}
-type Token = Token1 /* sqliteInt.h:1122:22 */
+type Token = Token1 /* sqliteInt.h:1144:22 */
type Trigger1 = struct {
FzName uintptr
Ftable uintptr
@@ -37320,23 +41580,24 @@ type Trigger1 = struct {
FpNext uintptr
}
-type Trigger = Trigger1 /* sqliteInt.h:1124:24 */
+type Trigger = Trigger1 /* sqliteInt.h:1146:24 */
type TriggerPrg1 = struct {
FpTrigger uintptr
FpNext uintptr
FpProgram uintptr
Forconf int32
- FaColmask [2]u321
+ FaColmask [2]u322
_ [4]byte
}
-type TriggerPrg = TriggerPrg1 /* sqliteInt.h:1125:27 */
+type TriggerPrg = TriggerPrg1 /* sqliteInt.h:1147:27 */
type TriggerStep1 = struct {
Fop u8
Forconf u8
FpTrig uintptr
FpSelect uintptr
FzTarget uintptr
+ FpFrom uintptr
FpWhere uintptr
FpExprList uintptr
FpIdList uintptr
@@ -37346,7 +41607,7 @@ type TriggerStep1 = struct {
FpLast uintptr
}
-type TriggerStep = TriggerStep1 /* sqliteInt.h:1126:28 */
+type TriggerStep = TriggerStep1 /* sqliteInt.h:1148:28 */
type UnpackedRecord1 = struct {
FpKeyInfo uintptr
FaMem uintptr
@@ -37359,7 +41620,7 @@ type UnpackedRecord1 = struct {
_ [1]byte
}
-type UnpackedRecord = UnpackedRecord1 /* sqliteInt.h:1127:31 */
+type UnpackedRecord = UnpackedRecord1 /* sqliteInt.h:1149:31 */
type Upsert1 = struct {
FpUpsertTarget uintptr
FpUpsertTargetWhere uintptr
@@ -37373,7 +41634,7 @@ type Upsert1 = struct {
_ [4]byte
}
-type Upsert = Upsert1 /* sqliteInt.h:1128:23 */
+type Upsert = Upsert1 /* sqliteInt.h:1150:23 */
type VTable1 = struct {
Fdb uintptr
FpMod uintptr
@@ -37385,7 +41646,7 @@ type VTable1 = struct {
FpNext uintptr
}
-type VTable = VTable1 /* sqliteInt.h:1129:23 */
+type VTable = VTable1 /* sqliteInt.h:1151:23 */
type Walker1 = struct {
FpParse uintptr
FxExprCallback uintptr
@@ -37396,7 +41657,7 @@ type Walker1 = struct {
Fu struct{ FpNC uintptr }
}
-type Walker = Walker1 /* sqliteInt.h:1131:23 */
+type Walker = Walker1 /* sqliteInt.h:1153:23 */
type Window1 = struct {
FzName uintptr
FzBase uintptr
@@ -37429,7 +41690,7 @@ type Window1 = struct {
_ [3]byte
}
-type Window = Window1 /* sqliteInt.h:1133:23 */
+type Window = Window1 /* sqliteInt.h:1155:23 */
type With1 = struct {
FnCte int32
FpOuter uintptr
@@ -37441,14 +41702,14 @@ type With1 = struct {
}
}
-type With = With1 /* sqliteInt.h:1134:21 */
+type With = With1 /* sqliteInt.h:1156:21 */
// The bitmask datatype defined below is used for various optimizations.
//
// Changing this from a 64-bit to a 32-bit type limits the number of
// tables in a join to 32 instead of 64. But it also reduces the size
// of the library by 738 bytes on ix86.
-type Bitmask = u64 /* sqliteInt.h:1147:15 */
+type Bitmask = u64 /* sqliteInt.h:1169:15 */
// The number of bits in a Bitmask. "BMS" means "BitMask Size".
@@ -37459,7 +41720,7 @@ type Bitmask = u64 /* sqliteInt.h:1147:15 */
// variable number associated with that parameter. See the format description
// on the sqlite3VListAdd() routine for more information. A VList is really
// just an array of integers.
-type VList = int32 /* sqliteInt.h:1169:13 */
+type VList = int32 /* sqliteInt.h:1191:13 */
// Defer sourcing vdbe.h and btree.h until after the "u8" and
// "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
@@ -37474,6 +41735,46 @@ type VList = int32 /* sqliteInt.h:1169:13 */
// May you share freely, never taking more than you give.
//
//
+// This header file defines the interface that the sqlite page cache
+// subsystem. The page cache subsystem reads and writes a file a page
+// at a time and provides a journal for rollback.
+
+// Default maximum size for persistent journal files. A negative
+// value means no limit. This value may be overridden using the
+// sqlite3PagerJournalSizeLimit() API. See also "PRAGMA journal_size_limit".
+
+// The type used to represent a page number. The first page in a file
+// is called page 1. 0 is used to represent "not a page".
+type Pgno = u322 /* pager.h:33:13 */
+
+// Handle type for pages.
+type PgHdr1 = struct {
+ FpPage uintptr
+ FpData uintptr
+ FpExtra uintptr
+ FpCache uintptr
+ FpDirty uintptr
+ FpPager uintptr
+ Fpgno Pgno
+ Fflags u16
+ FnRef i16
+ FpDirtyNext uintptr
+ FpDirtyPrev uintptr
+}
+
+// Handle type for pages.
+type DbPage = PgHdr1 /* pager.h:43:22 */
+
+// 2001 September 15
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
// This header file defines the interface that the sqlite B-Tree file
// subsystem. See comments in the source code for a detailed description
// of what each interface routine does.
@@ -37494,7 +41795,7 @@ type Btree1 = struct {
FhasIncrblobCur u8
FwantToLock int32
FnBackup int32
- FiDataVersion u321
+ FiDataVersion u322
FpNext uintptr
FpPrev uintptr
Flock BtLock
@@ -37540,10 +41841,10 @@ type BtShared1 = struct {
FminLocal u16
FmaxLeaf u16
FminLeaf u16
- FpageSize u321
- FusableSize u321
+ FpageSize u322
+ FusableSize u322
FnTransaction int32
- FnPage u321
+ FnPage u322
FpSchema uintptr
FxFreeSchema uintptr
Fmutex uintptr
@@ -37612,10 +41913,10 @@ type Vdbe1 = struct {
FpNext uintptr
FpParse uintptr
FnVar ynVar
- Fmagic u321
+ Fmagic u322
FnMem int32
FnCursor int32
- FcacheCtr u321
+ FcacheCtr u322
Fpc int32
Frc int32
FnChange int32
@@ -37645,13 +41946,13 @@ type Vdbe1 = struct {
Fexpired uint16 /* bft expired: 2, bft explain: 2, bft changeCntOn: 1, bft runOnlyOnce: 1, bft usesStmtJournal: 1, bft readOnly: 1, bft bIsReader: 1 */
FbtreeMask yDbMask
FlockMask yDbMask
- FaCounter [7]u321
+ FaCounter [7]u322
FzSql uintptr
FpFree uintptr
FpFrame uintptr
FpDelFrame uintptr
FnFrame int32
- Fexpmask u321
+ Fexpmask u322
FpProgram uintptr
FpAuxData uintptr
}
@@ -37726,6 +42027,7 @@ type VdbeOp1 = struct {
Fi int32
_ [4]byte
}
+ FzComment uintptr
}
// A single instruction of the virtual machine has an opcode
@@ -37752,13 +42054,6 @@ type VdbeOpList = VdbeOpList1 /* vdbe.h:106:27 */
type RecordCompare = uintptr /* vdbe.h:286:13 */
-// Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on
-// each VDBE opcode.
-//
-// Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op
-// comments in VDBE programs that show key decision points in the code
-// generator.
-
// The VdbeCoverage macros are used to set a coverage testing point
// for VDBE branch instructions. The coverage testing points are line
// numbers in the sqlite3.c source file. VDBE branch coverage testing
@@ -37798,46 +42093,6 @@ type RecordCompare = uintptr /* vdbe.h:286:13 */
// See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the
// vdbe.c source file for additional information.
-// 2001 September 15
-//
-// The author disclaims copyright to this source code. In place of
-// a legal notice, here is a blessing:
-//
-// May you do good and not evil.
-// May you find forgiveness for yourself and forgive others.
-// May you share freely, never taking more than you give.
-//
-//
-// This header file defines the interface that the sqlite page cache
-// subsystem. The page cache subsystem reads and writes a file a page
-// at a time and provides a journal for rollback.
-
-// Default maximum size for persistent journal files. A negative
-// value means no limit. This value may be overridden using the
-// sqlite3PagerJournalSizeLimit() API. See also "PRAGMA journal_size_limit".
-
-// The type used to represent a page number. The first page in a file
-// is called page 1. 0 is used to represent "not a page".
-type Pgno = u321 /* pager.h:33:13 */
-
-// Handle type for pages.
-type PgHdr1 = struct {
- FpPage uintptr
- FpData uintptr
- FpExtra uintptr
- FpCache uintptr
- FpDirty uintptr
- FpPager uintptr
- Fpgno Pgno
- Fflags u16
- FnRef i16
- FpDirtyNext uintptr
- FpDirtyPrev uintptr
-}
-
-// Handle type for pages.
-type DbPage = PgHdr1 /* pager.h:43:22 */
-
// 2008 August 05
//
// The author disclaims copyright to this source code. In place of
@@ -37854,14 +42109,14 @@ type DbPage = PgHdr1 /* pager.h:43:22 */
type PgHdr = PgHdr1 /* pcache.h:18:22 */
// typedef for the authorization callback function.
-type sqlite3_xauth = uintptr /* sqliteInt.h:1415:15 */
+type sqlite3_xauth = uintptr /* sqliteInt.h:1437:15 */
// This is an extra SQLITE_TRACE macro that indicates "legacy" tracing
// in the style of sqlite3_trace()
// Each database connection is an instance of the following structure.
type sqlite3InitInfo = struct {
- FnewTnum int32
+ FnewTnum Pgno
FiDb u8
Fbusy u8
_ [2]byte
@@ -37937,7 +42192,7 @@ type sColMap = struct {
// fields do not need to be freed when deallocating the AggInfo structure.
type AggInfo_col = struct {
FpTab uintptr
- FpExpr uintptr
+ FpCExpr uintptr
FiTable int32
FiMem int32
FiColumn i16
@@ -37957,14 +42212,12 @@ type AggInfo_col = struct {
// original Select structure that describes the SELECT statement. These
// fields do not need to be freed when deallocating the AggInfo structure.
type AggInfo_func = struct {
- FpExpr uintptr
+ FpFExpr uintptr
FpFunc uintptr
FiMem int32
FiDistinct int32
}
-// Value for AggInfo.iAggMagic when the structure is valid
-
// The datatype ynVar is a signed integer, either 16-bit or 32-bit.
// Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater
// than 32767 we have to make it 32-bit. 16-bit is preferred because
@@ -37973,7 +42226,7 @@ type AggInfo_func = struct {
// need more than about 10 or 20 variables. But some extreme users want
// to have prepared statements with over 32766 variables, and for them
// the option is available (at compile-time).
-type ynVar = i16 /* sqliteInt.h:2548:13 */
+type ynVar = i16 /* sqliteInt.h:2566:13 */
// The following are the meanings of bits in the Expr.flags field.
// Value restrictions:
@@ -38105,7 +42358,7 @@ type SrcList_item = struct {
}
// The yDbMask datatype for the bitmask of all attached databases.
-type yDbMask = uint32 /* sqliteInt.h:3268:24 */
+type yDbMask = uint32 /* sqliteInt.h:3297:24 */
// The following structure contains information used by the sqliteFix...
// routines as they walk the parse tree to make database references
@@ -38122,7 +42375,7 @@ type DbFixer1 = struct {
// The following structure contains information used by the sqliteFix...
// routines as they walk the parse tree to make database references
// explicit.
-type DbFixer = DbFixer1 /* sqliteInt.h:3568:24 */
+type DbFixer = DbFixer1 /* sqliteInt.h:3596:24 */
// A pointer to this structure is used to communicate information
// from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback.
@@ -38131,9 +42384,11 @@ type InitData = struct {
FpzErrMsg uintptr
FiDb int32
Frc int32
- FmInitFlags u321
- FnInitRow u321
-} /* sqliteInt.h:3609:3 */
+ FmInitFlags u322
+ FnInitRow u322
+ FmxPage Pgno
+ _ [4]byte
+} /* sqliteInt.h:3638:3 */
// Allowed values for mInitFlags
@@ -38167,7 +42422,7 @@ type Sqlite3Config = struct {
FnPage int32
FmxParserStack int32
FsharedCacheEnabled int32
- FszPma u321
+ FszPma u322
FisInit int32
FinProgress int32
FisMutexInit int32
@@ -38181,7 +42436,7 @@ type Sqlite3Config = struct {
FxTestCallback uintptr
FbLocaltimeFault int32
FiOnceResetThreshold int32
- FszSorterRef u321
+ FszSorterRef u322
FiPrngSeed uint32
}
@@ -38260,21 +42515,21 @@ type VdbeCursor1 = struct {
FpBtx uintptr
FseqCount i64
FaAltMap uintptr
- FcacheStatus u321
+ FcacheStatus u322
FseekResult int32
FpAltCursor uintptr
Fuc struct{ FpCursor uintptr }
FpKeyInfo uintptr
- FiHdrOffset u321
+ FiHdrOffset u322
FpgnoRoot Pgno
FnField i16
FnHdrParsed u16
FmovetoTarget i64
FaOffset uintptr
FaRow uintptr
- FpayloadSize u321
- FszRow u321
- FaType [1]u321
+ FpayloadSize u322
+ FszRow u322
+ FaType [1]u322
_ [4]byte
}
@@ -38407,7 +42662,7 @@ type DblquoteStr = DblquoteStr1 /* vdbeInt.h:366:28 */
// Convert text generated by the "%p" conversion format back into
// a pointer.
-func testHexToInt(tls *crt.TLS, h int32) int32 { /* test1.c:44:12: */
+func testHexToInt(tls *libc.TLS, h int32) int32 { /* test1.c:44:12: */
if (h >= '0') && (h <= '9') {
return (h - '0')
} else if (h >= 'a') && (h <= 'f') {
@@ -38418,7 +42673,7 @@ func testHexToInt(tls *crt.TLS, h int32) int32 { /* test1.c:44:12: */
}
return int32(0)
}
-func sqlite3TestTextToPtr(tls *crt.TLS, z uintptr) uintptr { /* test1.c:54:6: */
+func sqlite3TestTextToPtr(tls *libc.TLS, z uintptr) uintptr { /* test1.c:54:6: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -38426,7 +42681,7 @@ func sqlite3TestTextToPtr(tls *crt.TLS, z uintptr) uintptr { /* test1.c:54:6: */
// var v u64 at bp+8, 8
- // var v2 u321 at bp+16, 4
+ // var v2 u322 at bp+16, 4
if (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '0') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) == 'x') {
z += uintptr(2)
@@ -38437,11 +42692,11 @@ func sqlite3TestTextToPtr(tls *crt.TLS, z uintptr) uintptr { /* test1.c:54:6: */
z++
}
if uint64(unsafe.Sizeof(uintptr(0))) == uint64(unsafe.Sizeof(u64(0))) {
- crt.Xmemcpy(tls, bp /* &p */, bp+8 /* &v */, uint64(unsafe.Sizeof(uintptr(0))))
+ libc.Xmemcpy(tls, bp /* &p */, bp+8 /* &v */, uint64(unsafe.Sizeof(uintptr(0))))
} else {
- *(*u321)(unsafe.Pointer(bp + 16 /* v2 */)) = u321(*(*u64)(unsafe.Pointer(bp + 8 /* v */)))
- crt.Xmemcpy(tls, bp /* &p */, bp+16 /* &v2 */, uint64(unsafe.Sizeof(uintptr(0))))
+ *(*u322)(unsafe.Pointer(bp + 16 /* v2 */)) = u322(*(*u64)(unsafe.Pointer(bp + 8 /* v */)))
+ libc.Xmemcpy(tls, bp /* &p */, bp+16 /* &v2 */, uint64(unsafe.Sizeof(uintptr(0))))
}
return *(*uintptr)(unsafe.Pointer(bp /* p */))
}
@@ -38449,7 +42704,7 @@ func sqlite3TestTextToPtr(tls *crt.TLS, z uintptr) uintptr { /* test1.c:54:6: */
// A TCL command that returns the address of the sqlite* pointer
// for an sqlite connection instance. Bad things happen if the
// input is not an sqlite connection.
-func get_sqlite_pointer(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:82:26: */
+func get_sqlite_pointer(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:82:26: */
bp := tls.Alloc(212)
defer tls.Free(212)
@@ -38459,22 +42714,22 @@ func get_sqlite_pointer(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// var zBuf [100]int8 at bp+112, 100
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12693 /* "SQLITE-CONNECTIO..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14343 /* "SQLITE-CONNECTIO..." */)
return 1
}
if !(tcl.XTcl_GetCommandInfo(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+48 /* &cmdInfo */) != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12711, /* "command not foun..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14361, /* "command not foun..." */
tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), uintptr(0)))
return 1
}
p = (*Tcl_CmdInfo)(unsafe.Pointer(bp + 48 /* &cmdInfo */)).FobjClientData
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+112 /* &zBuf[0] */, ts+11197 /* "%p" */, crt.VaList(bp+24, (*struct{ Fdb uintptr })(unsafe.Pointer(p)).Fdb))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, bp+112 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+112 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+24, (*struct{ Fdb uintptr })(unsafe.Pointer(p)).Fdb))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, bp+112 /* &zBuf[0] */, 0))
return 0
}
// Decode a pointer to an sqlite3 object.
-func getDbPointer(tls *crt.TLS, interp uintptr, zA uintptr, ppDb uintptr) int32 { /* test1.c:109:5: */
+func getDbPointer(tls *libc.TLS, interp uintptr, zA uintptr, ppDb uintptr) int32 { /* test1.c:109:5: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -38495,7 +42750,7 @@ func getDbPointer(tls *crt.TLS, interp uintptr, zA uintptr, ppDb uintptr) int32
// Check a return value to make sure it agrees with the results
// from sqlite3_errcode.
-func sqlite3TestErrCode(tls *crt.TLS, interp uintptr, db uintptr, rc int32) int32 { /* test1.c:144:5: */
+func sqlite3TestErrCode(tls *libc.TLS, interp uintptr, db uintptr, rc int32) int32 { /* test1.c:144:5: */
bp := tls.Alloc(248)
defer tls.Free(248)
@@ -38505,17 +42760,17 @@ func sqlite3TestErrCode(tls *crt.TLS, interp uintptr, db uintptr, rc int32) int3
var r2 int32 = sqlite3.Xsqlite3_errcode(tls, db)
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+48, /* &zBuf[0] */
- ts+12731, /* "error code %s (%..." */
- crt.VaList(bp, sqlite3.Xsqlite3ErrName(tls, rc), rc, sqlite3.Xsqlite3ErrName(tls, r2), r2))
+ ts+14381, /* "error code %s (%..." */
+ libc.VaList(bp, sqlite3.Xsqlite3ErrName(tls, rc), rc, sqlite3.Xsqlite3ErrName(tls, r2), r2))
tcl.XTcl_ResetResult(tls, interp)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, bp+48 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, bp+48 /* &zBuf[0] */, 0))
return 1
}
return 0
}
// Decode a pointer to an sqlite3_stmt object.
-func getStmtPointer(tls *crt.TLS, interp uintptr, zArg uintptr, ppStmt uintptr) int32 { /* test1.c:162:12: */
+func getStmtPointer(tls *libc.TLS, interp uintptr, zArg uintptr, ppStmt uintptr) int32 { /* test1.c:162:12: */
*(*uintptr)(unsafe.Pointer(ppStmt)) = sqlite3TestTextToPtr(tls, zArg)
return 0
}
@@ -38531,16 +42786,16 @@ func getStmtPointer(tls *crt.TLS, interp uintptr, zArg uintptr, ppStmt uintptr)
// to test the string right after it is generated to see if it can be
// understood by scanf, and if not, try prepending an "0x" to see if
// that helps. If nothing works, a fatal error is generated.
-func sqlite3TestMakePointerStr(tls *crt.TLS, interp uintptr, zPtr uintptr, p uintptr) int32 { /* test1.c:184:5: */
+func sqlite3TestMakePointerStr(tls *libc.TLS, interp uintptr, zPtr uintptr, p uintptr) int32 { /* test1.c:184:5: */
bp := tls.Alloc(8)
defer tls.Free(8)
- sqlite3.Xsqlite3_snprintf(tls, 100, zPtr, ts+11197 /* "%p" */, crt.VaList(bp, p))
+ sqlite3.Xsqlite3_snprintf(tls, 100, zPtr, ts+12843 /* "%p" */, libc.VaList(bp, p))
return 0
}
// The callback routine for sqlite3_exec_printf().
-func exec_printf_cb(tls *crt.TLS, pArg uintptr, argc int32, argv uintptr, name uintptr) int32 { /* test1.c:192:12: */
+func exec_printf_cb(tls *libc.TLS, pArg uintptr, argc int32, argv uintptr, name uintptr) int32 { /* test1.c:192:12: */
var str uintptr = pArg
var i int32
@@ -38550,7 +42805,7 @@ func exec_printf_cb(tls *crt.TLS, pArg uintptr, argc int32, argv uintptr, name u
if *(*uintptr)(unsafe.Pointer(name + uintptr(i)*8)) != 0 {
return *(*uintptr)(unsafe.Pointer(name + uintptr(i)*8))
}
- return ts + 4252 /* "NULL" */
+ return ts + 5537 /* "NULL" */
}())
}
}
@@ -38559,7 +42814,7 @@ func exec_printf_cb(tls *crt.TLS, pArg uintptr, argc int32, argv uintptr, name u
if *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) != 0 {
return *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))
}
- return ts + 4252 /* "NULL" */
+ return ts + 5537 /* "NULL" */
}())
}
return 0
@@ -38572,7 +42827,7 @@ func exec_printf_cb(tls *crt.TLS, pArg uintptr, argc int32, argv uintptr, name u
// Turn I/O tracing on or off. If FILENAME is not an empty string,
// I/O tracing begins going into FILENAME. If FILENAME is an empty
// string, I/O tracing is turned off.
-func test_io_trace(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:228:26: */
+func test_io_trace(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:228:26: */
return 0
}
@@ -38582,9 +42837,9 @@ func test_io_trace(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, ar
// -fsanitize=address switch on the command line. False otherwise.
//
// Also return true if the OMIT_MISUSE environment variable exists.
-func clang_sanitize_address(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:269:26: */
+func clang_sanitize_address(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:269:26: */
var res int32 = 0
- if (res == 0) && (crt.Xgetenv(tls, ts+12789 /* "OMIT_MISUSE" */) != uintptr(0)) {
+ if (res == 0) && (libc.Xgetenv(tls, ts+14439 /* "OMIT_MISUSE" */) != uintptr(0)) {
res = 1
}
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, res))
@@ -38596,7 +42851,7 @@ func clang_sanitize_address(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc
// Invoke the sqlite3_exec_printf() interface using the open database
// DB. The SQL is the string FORMAT. The format string should contain
// one %s or %q. STRING is the value inserted into %s or %q.
-func test_exec_printf(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:296:26: */
+func test_exec_printf(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:296:26: */
bp := tls.Alloc(310)
defer tls.Free(310)
@@ -38610,20 +42865,20 @@ func test_exec_printf(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
// var zBuf [30]int8 at bp+280, 30
if argc != 4 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12827 /* " DB FORMAT STRIN..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14477 /* " DB FORMAT STRIN..." */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+48 /* &db */) != 0 {
return 1
}
tcl.XTcl_DStringInit(tls, bp+56 /* &str */)
- zSql = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), crt.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))
rc = sqlite3.Xsqlite3_exec(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), zSql, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{exec_printf_cb})), bp+56 /* &str */, bp+272 /* &zErr */)
sqlite3.Xsqlite3_free(tls, zSql)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+280 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+40, rc))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+280 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+40, rc))
tcl.XTcl_AppendElement(tls, interp, bp+280 /* &zBuf[0] */)
tcl.XTcl_AppendElement(tls, interp, func() uintptr {
if rc == 0 {
@@ -38646,7 +42901,7 @@ func test_exec_printf(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
// Invoke the sqlite3_exec() on a string that is obtained by translating
// HEX into ASCII. Most characters are translated as is. %HH becomes
// a hex character.
-func test_exec_hex(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:334:26: */
+func test_exec_hex(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:334:26: */
bp := tls.Alloc(806)
defer tls.Free(806)
@@ -38664,15 +42919,15 @@ func test_exec_hex(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, ar
// var zBuf [30]int8 at bp+776, 30
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12845 /* " DB HEX" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14495 /* " DB HEX" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+40 /* &db */) != 0 {
return 1
}
zHex = *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))
- i = crt.AssignInt32(&j, 0)
+ i = libc.AssignInt32(&j, 0)
__1:
if !((uint64(i) < (uint64(unsafe.Sizeof([501]int8{})) - uint64(1))) && (*(*int8)(unsafe.Pointer(zHex + uintptr(j))) != 0)) {
goto __3
@@ -38696,9 +42951,9 @@ __3:
*(*int8)(unsafe.Pointer(bp + 48 /* &zSql[0] */ + uintptr(i))) = int8(0)
tcl.XTcl_DStringInit(tls, bp+552 /* &str */)
rc = sqlite3.Xsqlite3_exec(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* db */)), bp+48 /* &zSql[0] */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{exec_printf_cb})), bp+552 /* &str */, bp+768 /* &zErr */)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+776 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+32, rc))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+776 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, rc))
tcl.XTcl_AppendElement(tls, interp, bp+776 /* &zBuf[0] */)
tcl.XTcl_AppendElement(tls, interp, func() uintptr {
if rc == 0 {
@@ -38720,15 +42975,15 @@ __3:
// db_leave DB
//
// Enter or leave the mutex on a database connection.
-func db_enter(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:380:26: */
+func db_enter(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:380:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var db uintptr at bp+32, 8
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+32 /* &db */) != 0 {
@@ -38737,15 +42992,15 @@ func db_enter(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv ui
sqlite3.Xsqlite3_mutex_enter(tls, (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).Fmutex)
return 0
}
-func db_leave(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:396:26: */
+func db_leave(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:396:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var db uintptr at bp+32, 8
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+32 /* &db */) != 0 {
@@ -38758,7 +43013,7 @@ func db_leave(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv ui
// Usage: sqlite3_exec DB SQL
//
// Invoke the sqlite3_exec interface using the open database DB
-func test_exec(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:418:26: */
+func test_exec(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:418:26: */
bp := tls.Alloc(310)
defer tls.Free(310)
@@ -38774,29 +43029,29 @@ func test_exec(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv u
// var zBuf [30]int8 at bp+280, 30
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12857 /* " DB SQL" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14507 /* " DB SQL" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+48 /* &db */) != 0 {
return 1
}
tcl.XTcl_DStringInit(tls, bp+56 /* &str */)
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
- for i = crt.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0; {
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ for i = libc.AssignInt32(&j, 0); *(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0; {
if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) == '%' {
- *(*int8)(unsafe.Pointer(zSql + uintptr(crt.PostIncInt32(&j, 1)))) = (int8((testHexToInt(tls, int32(*(*int8)(unsafe.Pointer(zSql + uintptr((i + 1)))))) << 4) + testHexToInt(tls, int32(*(*int8)(unsafe.Pointer(zSql + uintptr((i + 2))))))))
+ *(*int8)(unsafe.Pointer(zSql + uintptr(libc.PostIncInt32(&j, 1)))) = (int8((testHexToInt(tls, int32(*(*int8)(unsafe.Pointer(zSql + uintptr((i + 1)))))) << 4) + testHexToInt(tls, int32(*(*int8)(unsafe.Pointer(zSql + uintptr((i + 2))))))))
i = i + (3)
} else {
- *(*int8)(unsafe.Pointer(zSql + uintptr(crt.PostIncInt32(&j, 1)))) = *(*int8)(unsafe.Pointer(zSql + uintptr(crt.PostIncInt32(&i, 1))))
+ *(*int8)(unsafe.Pointer(zSql + uintptr(libc.PostIncInt32(&j, 1)))) = *(*int8)(unsafe.Pointer(zSql + uintptr(libc.PostIncInt32(&i, 1))))
}
}
*(*int8)(unsafe.Pointer(zSql + uintptr(j))) = int8(0)
rc = sqlite3.Xsqlite3_exec(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), zSql, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{exec_printf_cb})), bp+56 /* &str */, bp+272 /* &zErr */)
sqlite3.Xsqlite3_free(tls, zSql)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+280 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+40, rc))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+280 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+40, rc))
tcl.XTcl_AppendElement(tls, interp, bp+280 /* &zBuf[0] */)
tcl.XTcl_AppendElement(tls, interp, func() uintptr {
if rc == 0 {
@@ -38818,7 +43073,7 @@ func test_exec(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv u
//
// Invoke the sqlite3_exec interface using the open database DB. Discard
// all results
-func test_exec_nr(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:465:26: */
+func test_exec_nr(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:465:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -38827,8 +43082,8 @@ func test_exec_nr(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, arg
var rc int32
*(*uintptr)(unsafe.Pointer(bp + 40 /* zErr */)) = uintptr(0)
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12857 /* " DB SQL" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14507 /* " DB SQL" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+32 /* &db */) != 0 {
@@ -38846,7 +43101,7 @@ func test_exec_nr(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, arg
// Test the %z format of sqlite_mprintf(). Use multiple mprintf() calls to
// concatenate arg0 through argn using separator as the separator.
// Return the result.
-func test_mprintf_z(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:492:26: */
+func test_mprintf_z(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:492:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -38854,9 +43109,9 @@ func test_mprintf_z(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, a
var i int32
for i = 2; (i < argc) && ((i == 2) || (zResult != 0)); i++ {
- zResult = sqlite3.Xsqlite3_mprintf(tls, ts+12865 /* "%z%s%s" */, crt.VaList(bp, zResult, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ zResult = sqlite3.Xsqlite3_mprintf(tls, ts+14515 /* "%z%s%s" */, libc.VaList(bp, zResult, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+24, zResult, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, zResult, 0))
sqlite3.Xsqlite3_free(tls, zResult)
return 0
}
@@ -38865,13 +43120,13 @@ func test_mprintf_z(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, a
//
// Test the %n format of sqlite_mprintf(). Return the length of the
// input string.
-func test_mprintf_n(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:515:26: */
+func test_mprintf_n(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:515:26: */
bp := tls.Alloc(20)
defer tls.Free(20)
var zStr uintptr
*(*int32)(unsafe.Pointer(bp + 16 /* n */)) = 0
- zStr = sqlite3.Xsqlite3_mprintf(tls, ts+12872 /* "%s%n" */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+16 /* &n */))
+ zStr = sqlite3.Xsqlite3_mprintf(tls, ts+14522 /* "%s%n" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+16 /* &n */))
sqlite3.Xsqlite3_free(tls, zStr)
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 16 /* n */))))
return 0
@@ -38885,21 +43140,21 @@ func test_mprintf_n(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, a
// string must require no more than this one integer argument. If
// You pass in a format string that requires more than one argument,
// bad things will happen.
-func test_snprintf_int(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:539:26: */
+func test_snprintf_int(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:539:26: */
bp := tls.Alloc(124)
defer tls.Free(124)
// var zStr [100]int8 at bp+24, 100
- var n int32 = crt.Xatoi(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
+ var n int32 = libc.Xatoi(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
var zFormat uintptr = *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))
- var a1 int32 = crt.Xatoi(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)))
+ var a1 int32 = libc.Xatoi(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)))
if uint64(n) > uint64(unsafe.Sizeof([100]int8{})) {
n = int32(unsafe.Sizeof([100]int8{}))
}
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+24 /* &zStr[0] */, ts+12877 /* "abcdefghijklmnop..." */, 0)
- sqlite3.Xsqlite3_snprintf(tls, n, bp+24 /* &zStr[0] */, zFormat, crt.VaList(bp, a1))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+8, bp+24 /* &zStr[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+24 /* &zStr[0] */, ts+14527 /* "abcdefghijklmnop..." */, 0)
+ sqlite3.Xsqlite3_snprintf(tls, n, bp+24 /* &zStr[0] */, zFormat, libc.VaList(bp, a1))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+8, bp+24 /* &zStr[0] */, 0))
return 0
}
@@ -38908,7 +43163,7 @@ func test_snprintf_int(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
// Invoke the sqlite3_get_table_printf() interface using the open database
// DB. The SQL is the string FORMAT. The format string should contain
// one %s or %q. STRING is the value inserted into %s or %q.
-func test_get_table_printf(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:565:26: */
+func test_get_table_printf(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:565:26: */
bp := tls.Alloc(350)
defer tls.Free(350)
@@ -38933,15 +43188,15 @@ func test_get_table_printf(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc i
}
}
if (argc != 4) && (argc != 5) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12904 /* " DB FORMAT STRIN..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14554 /* " DB FORMAT STRIN..." */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+72 /* &db */) != 0 {
return 1
}
tcl.XTcl_DStringInit(tls, bp+80 /* &str */)
- zSql = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), crt.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))
if argc == 5 {
rc = sqlite3.Xsqlite3_get_table(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* db */)), zSql, bp+296 /* &aResult */, uintptr(0), uintptr(0), bp+304 /* &zErr */)
} else {
@@ -38949,13 +43204,13 @@ func test_get_table_printf(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc i
*(*int32)(unsafe.Pointer(bp + 64 /* resCount */)) = ((*(*int32)(unsafe.Pointer(bp + 312 /* nRow */)) + 1) * *(*int32)(unsafe.Pointer(bp + 316 /* nCol */)))
}
sqlite3.Xsqlite3_free(tls, zSql)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+320 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+40, rc))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+320 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+40, rc))
tcl.XTcl_AppendElement(tls, interp, bp+320 /* &zBuf[0] */)
if rc == 0 {
if argc == 4 {
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+320 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 312 /* nRow */))))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+320 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 312 /* nRow */))))
tcl.XTcl_AppendElement(tls, interp, bp+320 /* &zBuf[0] */)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+320 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+56, *(*int32)(unsafe.Pointer(bp + 316 /* nCol */))))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+320 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(bp + 316 /* nCol */))))
tcl.XTcl_AppendElement(tls, interp, bp+320 /* &zBuf[0] */)
}
for i = 0; i < *(*int32)(unsafe.Pointer(bp + 64 /* resCount */)); i++ {
@@ -38963,7 +43218,7 @@ func test_get_table_printf(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc i
if *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 /* aResult */)) + uintptr(i)*8)) != 0 {
return *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 /* aResult */)) + uintptr(i)*8))
}
- return ts + 4252 /* "NULL" */
+ return ts + 5537 /* "NULL" */
}())
}
} else {
@@ -38982,7 +43237,7 @@ func test_get_table_printf(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc i
// Usage: sqlite3_last_insert_rowid DB
//
// Returns the integer ROWID of the most recent insert.
-func test_last_rowid(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:628:26: */
+func test_last_rowid(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:628:26: */
bp := tls.Alloc(94)
defer tls.Free(94)
@@ -38991,35 +43246,35 @@ func test_last_rowid(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
// var zBuf [30]int8 at bp+64, 30
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), ts+12930 /* " DB\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), ts+14580 /* " DB\"" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+56 /* &db */) != 0 {
return 1
}
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+64 /* &zBuf[0] */, ts+8668 /* "%lld" */, crt.VaList(bp+32, sqlite3.Xsqlite3_last_insert_rowid(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */)))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+64 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+64 /* &zBuf[0] */, ts+10367 /* "%lld" */, libc.VaList(bp+32, sqlite3.Xsqlite3_last_insert_rowid(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */)))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+64 /* &zBuf[0] */, 0))
return 0
}
// Usage: sqlite3_key DB KEY
//
// Set the codec key.
-func test_key(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:652:26: */
+func test_key(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:652:26: */
return 0
}
// Usage: sqlite3_rekey DB KEY
//
// Change the codec key.
-func test_rekey(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:666:26: */
+func test_rekey(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:666:26: */
return 0
}
// Usage: sqlite3_close DB
//
// Closes the database opened by sqlite3_open.
-func sqlite_test_close(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:680:26: */
+func sqlite_test_close(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:680:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -39027,8 +43282,8 @@ func sqlite_test_close(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12935 /* " FILENAME\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14585 /* " FILENAME\"" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+32 /* &db */) != 0 {
@@ -39042,7 +43297,7 @@ func sqlite_test_close(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
// Usage: sqlite3_close_v2 DB
//
// Closes the database opened by sqlite3_open.
-func sqlite_test_close_v2(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:704:26: */
+func sqlite_test_close_v2(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:704:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -39050,8 +43305,8 @@ func sqlite_test_close_v2(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12935 /* " FILENAME\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14585 /* " FILENAME\"" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+32 /* &db */) != 0 {
@@ -39064,13 +43319,13 @@ func sqlite_test_close_v2(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
// Implementation of the x_coalesce() function.
// Return the first argument non-NULL argument.
-func t1_ifnullFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:727:13: */
+func t1_ifnullFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:727:13: */
var i int32
for i = 0; i < argc; i++ {
if 5 != sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) {
var n int32 = sqlite3.Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
sqlite3.Xsqlite3_result_text(tls, context, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))),
- n, crt.UintptrFromInt32(-1))
+ n, libc.UintptrFromInt32(-1))
break
}
}
@@ -39079,7 +43334,7 @@ func t1_ifnullFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
// These are test functions. hex8() interprets its argument as
// UTF8 and returns a hex encoding. hex16le() interprets its argument
// as UTF16le and returns a hex encoding.
-func hex8Func(tls *crt.TLS, p uintptr, argc int32, argv uintptr) { /* test1.c:748:13: */
+func hex8Func(tls *libc.TLS, p uintptr, argc int32, argv uintptr) { /* test1.c:748:13: */
bp := tls.Alloc(208)
defer tls.Free(208)
@@ -39089,12 +43344,12 @@ func hex8Func(tls *crt.TLS, p uintptr, argc int32, argv uintptr) { /* test1.c:74
z = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
for i = 0; (uint64(i) < ((uint64(unsafe.Sizeof([200]int8{})) / uint64(2)) - uint64(2))) && (*(*uint8)(unsafe.Pointer(z + uintptr(i))) != 0); i++ {
- sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof([200]int8{})) - (uint64(i * 2)))), (bp + 8 /* &zBuf */ + uintptr((i * 2))), ts+12946 /* "%02x" */, crt.VaList(bp, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))))
+ sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof([200]int8{})) - (uint64(i * 2)))), (bp + 8 /* &zBuf */ + uintptr((i * 2))), ts+14596 /* "%02x" */, libc.VaList(bp, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i))))))
}
*(*int8)(unsafe.Pointer(bp + 8 /* &zBuf[0] */ + uintptr((i * 2)))) = int8(0)
- sqlite3.Xsqlite3_result_text(tls, p, bp+8 /* zBuf */, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, p, bp+8 /* zBuf */, -1, libc.UintptrFromInt32(-1))
}
-func hex16Func(tls *crt.TLS, p uintptr, argc int32, argv uintptr) { /* test1.c:760:13: */
+func hex16Func(tls *libc.TLS, p uintptr, argc int32, argv uintptr) { /* test1.c:760:13: */
bp := tls.Alloc(408)
defer tls.Free(408)
@@ -39104,10 +43359,10 @@ func hex16Func(tls *crt.TLS, p uintptr, argc int32, argv uintptr) { /* test1.c:7
z = sqlite3.Xsqlite3_value_text16(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
for i = 0; (uint64(i) < ((uint64(unsafe.Sizeof([400]int8{})) / uint64(4)) - uint64(4))) && (*(*uint16)(unsafe.Pointer(z + uintptr(i)*2)) != 0); i++ {
- sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof([400]int8{})) - (uint64(i * 4)))), (bp + 8 /* &zBuf */ + uintptr((i * 4))), ts+12951 /* "%04x" */, crt.VaList(bp, (int32(*(*uint16)(unsafe.Pointer(z + uintptr(i)*2)))&0xff)))
+ sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof([400]int8{})) - (uint64(i * 4)))), (bp + 8 /* &zBuf */ + uintptr((i * 4))), ts+14601 /* "%04x" */, libc.VaList(bp, (int32(*(*uint16)(unsafe.Pointer(z + uintptr(i)*2)))&0xff)))
}
*(*int8)(unsafe.Pointer(bp + 8 /* &zBuf[0] */ + uintptr((i * 4)))) = int8(0)
- sqlite3.Xsqlite3_result_text(tls, p, bp+8 /* zBuf */, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, p, bp+8 /* zBuf */, -1, libc.UintptrFromInt32(-1))
}
// A structure into which to accumulate text.
@@ -39118,33 +43373,33 @@ type dstr = struct {
}
// Append text to a dstr
-func dstrAppend(tls *crt.TLS, p uintptr, z uintptr, divider int32) { /* test1.c:785:13: */
- var n int32 = int32(crt.Xstrlen(tls, z))
+func dstrAppend(tls *libc.TLS, p uintptr, z uintptr, divider int32) { /* test1.c:785:13: */
+ var n int32 = int32(libc.Xstrlen(tls, z))
if (((*dstr)(unsafe.Pointer(p)).FnUsed + n) + 2) > (*dstr)(unsafe.Pointer(p)).FnAlloc {
var zNew uintptr
(*dstr)(unsafe.Pointer(p)).FnAlloc = ((((*dstr)(unsafe.Pointer(p)).FnAlloc * 2) + n) + 200)
zNew = sqlite3.Xsqlite3_realloc(tls, (*dstr)(unsafe.Pointer(p)).Fz, (*dstr)(unsafe.Pointer(p)).FnAlloc)
if zNew == uintptr(0) {
sqlite3.Xsqlite3_free(tls, (*dstr)(unsafe.Pointer(p)).Fz)
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(dstr{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(dstr{})))
return
}
(*dstr)(unsafe.Pointer(p)).Fz = zNew
}
if (divider != 0) && ((*dstr)(unsafe.Pointer(p)).FnUsed > 0) {
- *(*int8)(unsafe.Pointer((*dstr)(unsafe.Pointer(p)).Fz + uintptr(crt.PostIncInt32(&(*dstr)(unsafe.Pointer(p)).FnUsed, 1)))) = int8(divider)
+ *(*int8)(unsafe.Pointer((*dstr)(unsafe.Pointer(p)).Fz + uintptr(libc.PostIncInt32(&(*dstr)(unsafe.Pointer(p)).FnUsed, 1)))) = int8(divider)
}
- crt.Xmemcpy(tls, ((*dstr)(unsafe.Pointer(p)).Fz + uintptr((*dstr)(unsafe.Pointer(p)).FnUsed)), z, (uint64(n + 1)))
+ libc.Xmemcpy(tls, ((*dstr)(unsafe.Pointer(p)).Fz + uintptr((*dstr)(unsafe.Pointer(p)).FnUsed)), z, (uint64(n + 1)))
*(*int32)(unsafe.Pointer(p + 4 /* &.nUsed */)) += (n)
}
// Invoked for each callback from sqlite3ExecFunc
-func execFuncCallback(tls *crt.TLS, pData uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* test1.c:808:12: */
+func execFuncCallback(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* test1.c:808:12: */
var p uintptr = pData
var i int32
for i = 0; i < argc; i++ {
if *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) == uintptr(0) {
- dstrAppend(tls, p, ts+4252 /* "NULL" */, ' ')
+ dstrAppend(tls, p, ts+5537 /* "NULL" */, ' ')
} else {
dstrAppend(tls, p, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ' ')
}
@@ -39161,19 +43416,19 @@ func execFuncCallback(tls *crt.TLS, pData uintptr, argc int32, argv uintptr, Not
//
// This routine simulates the effect of having two threads attempt to
// use the same database at the same time.
-func sqlite3ExecFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:832:13: */
+func sqlite3ExecFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:832:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
// var x dstr at bp, 16
- crt.Xmemset(tls, bp /* &x */, 0, uint64(unsafe.Sizeof(dstr{})))
+ libc.Xmemset(tls, bp /* &x */, 0, uint64(unsafe.Sizeof(dstr{})))
sqlite3.Xsqlite3_exec(tls, sqlite3.Xsqlite3_user_data(tls, context),
sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{execFuncCallback})), bp /* &x */, uintptr(0))
- sqlite3.Xsqlite3_result_text(tls, context, (*dstr)(unsafe.Pointer(bp /* &x */)).Fz, (*dstr)(unsafe.Pointer(bp /* &x */)).FnUsed, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, context, (*dstr)(unsafe.Pointer(bp /* &x */)).Fz, (*dstr)(unsafe.Pointer(bp /* &x */)).FnUsed, libc.UintptrFromInt32(-1))
sqlite3.Xsqlite3_free(tls, (*dstr)(unsafe.Pointer(bp /* &x */)).Fz)
}
@@ -39191,7 +43446,7 @@ func sqlite3ExecFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) {
// SQL expression:
//
// tkt2213func(tkt2213func('a string'));
-func tkt2213Function(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:862:13: */
+func tkt2213Function(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:862:13: */
var nText int32
var zText1 uintptr
var zText2 uintptr
@@ -39203,11 +43458,11 @@ func tkt2213Function(tls *crt.TLS, context uintptr, argc int32, argv uintptr) {
zText3 = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
if (zText1 != zText2) || (zText2 != zText3) {
- sqlite3.Xsqlite3_result_error(tls, context, ts+12956 /* "tkt2213 is not f..." */, -1)
+ sqlite3.Xsqlite3_result_error(tls, context, ts+14606 /* "tkt2213 is not f..." */, -1)
} else {
var zCopy uintptr = sqlite3.Xsqlite3_malloc(tls, nText)
- crt.Xmemcpy(tls, zCopy, zText1, uint64(nText))
- sqlite3.Xsqlite3_result_text(tls, context, zCopy, nText, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ libc.Xmemcpy(tls, zCopy, zText1, uint64(nText))
+ sqlite3.Xsqlite3_result_text(tls, context, zCopy, nText, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
}
}
@@ -39233,7 +43488,7 @@ func tkt2213Function(tls *crt.TLS, context uintptr, argc int32, argv uintptr) {
//
// This function is used to test to see when returned pointers from
// the _text(), _text16() and _blob() APIs become invalidated.
-func ptrChngFunction(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:910:13: */
+func ptrChngFunction(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:910:13: */
var p1 uintptr
var p2 uintptr
var zCmd uintptr
@@ -39244,11 +43499,11 @@ func ptrChngFunction(tls *crt.TLS, context uintptr, argc int32, argv uintptr) {
if zCmd == uintptr(0) {
return
}
- if crt.Xstrcmp(tls, zCmd, ts+10620 /* "text" */) == 0 {
+ if libc.Xstrcmp(tls, zCmd, ts+12275 /* "text" */) == 0 {
p1 = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- } else if crt.Xstrcmp(tls, zCmd, ts+12977 /* "text16" */) == 0 {
+ } else if libc.Xstrcmp(tls, zCmd, ts+14627 /* "text16" */) == 0 {
p1 = sqlite3.Xsqlite3_value_text16(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- } else if crt.Xstrcmp(tls, zCmd, ts+10625 /* "blob" */) == 0 {
+ } else if libc.Xstrcmp(tls, zCmd, ts+12280 /* "blob" */) == 0 {
p1 = sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
} else {
return
@@ -39257,11 +43512,11 @@ func ptrChngFunction(tls *crt.TLS, context uintptr, argc int32, argv uintptr) {
if zCmd == uintptr(0) {
return
}
- if crt.Xstrcmp(tls, zCmd, ts+12984 /* "bytes" */) == 0 {
+ if libc.Xstrcmp(tls, zCmd, ts+14634 /* "bytes" */) == 0 {
sqlite3.Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- } else if crt.Xstrcmp(tls, zCmd, ts+12990 /* "bytes16" */) == 0 {
+ } else if libc.Xstrcmp(tls, zCmd, ts+14640 /* "bytes16" */) == 0 {
sqlite3.Xsqlite3_value_bytes16(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- } else if crt.Xstrcmp(tls, zCmd, ts+12998 /* "noop" */) == 0 {
+ } else if libc.Xstrcmp(tls, zCmd, ts+14648 /* "noop" */) == 0 {
} else {
return
}
@@ -39269,35 +43524,35 @@ func ptrChngFunction(tls *crt.TLS, context uintptr, argc int32, argv uintptr) {
if zCmd == uintptr(0) {
return
}
- if crt.Xstrcmp(tls, zCmd, ts+10620 /* "text" */) == 0 {
+ if libc.Xstrcmp(tls, zCmd, ts+12275 /* "text" */) == 0 {
p2 = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- } else if crt.Xstrcmp(tls, zCmd, ts+12977 /* "text16" */) == 0 {
+ } else if libc.Xstrcmp(tls, zCmd, ts+14627 /* "text16" */) == 0 {
p2 = sqlite3.Xsqlite3_value_text16(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- } else if crt.Xstrcmp(tls, zCmd, ts+10625 /* "blob" */) == 0 {
+ } else if libc.Xstrcmp(tls, zCmd, ts+12280 /* "blob" */) == 0 {
p2 = sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
} else {
return
}
- sqlite3.Xsqlite3_result_int(tls, context, (crt.Bool32(p1 != p2)))
+ sqlite3.Xsqlite3_result_int(tls, context, (libc.Bool32(p1 != p2)))
}
// This SQL function returns a different answer each time it is called, even if
// the arguments are the same.
-func nondeterministicFunction(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:964:13: */
- sqlite3.Xsqlite3_result_int(tls, context, crt.PostIncInt32(&cnt, 1))
+func nondeterministicFunction(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:964:13: */
+ sqlite3.Xsqlite3_result_int(tls, context, libc.PostIncInt32(&cnt, 1))
}
var cnt int32 = 0 /* test1.c:969:14 */
// This SQL function returns the integer value of its argument as a MEM_IntReal
// value.
-func intrealFunction(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:977:13: */
+func intrealFunction(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:977:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
var v sqlite3_int64 = sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
sqlite3.Xsqlite3_result_int64(tls, context, v)
- sqlite3.Xsqlite3_test_control(tls, 27, crt.VaList(bp, context))
+ sqlite3.Xsqlite3_test_control(tls, 27, libc.VaList(bp, context))
}
// Usage: sqlite3_create_function DB
@@ -39313,7 +43568,7 @@ func intrealFunction(tls *crt.TLS, context uintptr, argc int32, argv uintptr) {
// The original motivation for this routine was to be able to call the
// sqlite3_create_function function while a query is in progress in order
// to test the SQLITE_MISUSE detection logic.
-func test_create_function(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1002:26: */
+func test_create_function(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1002:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -39321,39 +43576,39 @@ func test_create_function(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
// var db uintptr at bp+32, 8
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12930 /* " DB\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14580 /* " DB\"" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+32 /* &db */) != 0 {
return 1
}
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+13003 /* "x_coalesce" */, -1, 1, uintptr(0),
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14653 /* "x_coalesce" */, -1, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{t1_ifnullFunc})), uintptr(0), uintptr(0))
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+13014 /* "hex8" */, 1, (1 | 0x000000800),
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14664 /* "hex8" */, 1, (1 | 0x000000800),
uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{hex8Func})), uintptr(0), uintptr(0))
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+13019 /* "hex16" */, 1, (4 | 0x000000800),
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14669 /* "hex16" */, 1, (4 | 0x000000800),
uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{hex16Func})), uintptr(0), uintptr(0))
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+13025 /* "tkt2213func" */, 1, 5, uintptr(0),
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14675 /* "tkt2213func" */, 1, 5, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{tkt2213Function})), uintptr(0), uintptr(0))
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+13037 /* "pointer_change" */, 4, 5, uintptr(0),
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14687 /* "pointer_change" */, 4, 5, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{ptrChngFunction})), uintptr(0), uintptr(0))
}
@@ -39361,24 +43616,24 @@ func test_create_function(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
// both return an ascending integer with each call. But counter1() is marked
// as non-deterministic and counter2() is marked as deterministic.
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+13052 /* "counter1" */, -1, 1,
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14702 /* "counter1" */, -1, 1,
uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{nondeterministicFunction})), uintptr(0), uintptr(0))
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+13061 /* "counter2" */, -1, (1 | 0x000000800),
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14711 /* "counter2" */, -1, (1 | 0x000000800),
uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{nondeterministicFunction})), uintptr(0), uintptr(0))
}
// The intreal() function converts its argument to an integer and returns
// it as a MEM_IntReal.
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+13070 /* "intreal" */, 1, 1,
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14720 /* "intreal" */, 1, 1,
uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{intrealFunction})), uintptr(0), uintptr(0))
}
@@ -39389,14 +43644,14 @@ func test_create_function(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
var pVal uintptr
sqlite3.Xsqlite3_mutex_enter(tls, (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).Fmutex)
pVal = sqlite3.Xsqlite3ValueNew(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))
- sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, ts+13078 /* "x_sqlite_exec" */, uint8(1), uintptr(0))
+ sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, ts+14728 /* "x_sqlite_exec" */, uint8(1), uintptr(0))
zUtf16 = sqlite3.Xsqlite3ValueText(tls, pVal, uint8(2))
if (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).FmallocFailed != 0 {
rc = 7
} else {
rc = sqlite3.Xsqlite3_create_function16(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), zUtf16,
1, 4, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{sqlite3ExecFunc})), uintptr(0), uintptr(0))
}
sqlite3.Xsqlite3ValueFree(tls, pVal)
@@ -39415,15 +43670,15 @@ func test_create_function(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
// Invoke the sqlite3_drop_modules(D,L) interface on database
// connection DB, in order to drop all modules except those named in
// the argument.
-func test_drop_modules(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1092:26: */
+func test_drop_modules(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1092:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var db uintptr at bp+32, 8
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12930 /* " DB\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14580 /* " DB\"" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+32 /* &db */) != 0 {
@@ -39459,7 +43714,7 @@ type t1CountCtx1 = struct{ Fn int32 }
// is reported on the step function. If the total count is 42, then
// a UTF-8 error is reported on the finalize function.
type t1CountCtx = t1CountCtx1 /* test1.c:1123:27 */
-func t1CountStep(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:1127:13: */
+func t1CountStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:1127:13: */
bp := tls.Alloc(9)
defer tls.Free(9)
@@ -39471,19 +43726,19 @@ func t1CountStep(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* t
if argc > 0 {
var v int32 = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
if v == 40 {
- sqlite3.Xsqlite3_result_error(tls, context, ts+13092 /* "value of 40 hand..." */, -1)
+ sqlite3.Xsqlite3_result_error(tls, context, ts+14742 /* "value of 40 hand..." */, -1)
} else if v == 41 {
*(*[9]int8)(unsafe.Pointer(bp /* zUtf16ErrMsg */)) = [9]int8{int8(0), int8(0x61), int8(0), int8(0x62), int8(0), int8(0x63), int8(0), int8(0), int8(0)}
sqlite3.Xsqlite3_result_error16(tls, context, (bp /* &zUtf16ErrMsg */ + uintptr((1 - 0))), -1)
}
}
}
-func t1CountFinalize(tls *crt.TLS, context uintptr) { /* test1.c:1149:13: */
+func t1CountFinalize(tls *libc.TLS, context uintptr) { /* test1.c:1149:13: */
var p uintptr
p = sqlite3.Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(t1CountCtx{})))
if p != 0 {
if (*t1CountCtx)(unsafe.Pointer(p)).Fn == 42 {
- sqlite3.Xsqlite3_result_error(tls, context, ts+13122 /* "x_count totals t..." */, -1)
+ sqlite3.Xsqlite3_result_error(tls, context, ts+14772 /* "x_count totals t..." */, -1)
} else {
sqlite3.Xsqlite3_result_int(tls, context, func() int32 {
if p != 0 {
@@ -39495,11 +43750,11 @@ func t1CountFinalize(tls *crt.TLS, context uintptr) { /* test1.c:1149:13: */
}
}
-func legacyCountStep(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:1162:13: */
+func legacyCountStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:1162:13: */
// no-op
}
-func legacyCountFinalize(tls *crt.TLS, context uintptr) { /* test1.c:1170:13: */
+func legacyCountFinalize(tls *libc.TLS, context uintptr) { /* test1.c:1170:13: */
sqlite3.Xsqlite3_result_int(tls, context, sqlite3.Xsqlite3_aggregate_count(tls, context))
}
@@ -39520,7 +43775,7 @@ func legacyCountFinalize(tls *crt.TLS, context uintptr) { /* test1.c:1170:13: */
// Later: It is now also extended to register the aggregate function
// "legacy_count()" with the supplied database handle. This is used
// to test the deprecated sqlite3_aggregate_count() API.
-func test_create_aggregate(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1194:26: */
+func test_create_aggregate(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1194:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -39528,28 +43783,28 @@ func test_create_aggregate(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc i
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12935 /* " FILENAME\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14585 /* " FILENAME\"" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+32 /* &db */) != 0 {
return 1
}
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+13143 /* "x_count" */, 0, 1, uintptr(0), uintptr(0),
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14793 /* "x_count" */, 0, 1, uintptr(0), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{t1CountStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{t1CountFinalize})))
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{t1CountStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{t1CountFinalize})))
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+13143 /* "x_count" */, 1, 1, uintptr(0), uintptr(0),
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14793 /* "x_count" */, 1, 1, uintptr(0), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{t1CountStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{t1CountFinalize})))
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{t1CountStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{t1CountFinalize})))
}
if rc == 0 {
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+13151 /* "legacy_count" */, 0, 5, uintptr(0), uintptr(0),
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14801 /* "legacy_count" */, 0, 5, uintptr(0), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{legacyCountStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{legacyCountFinalize})))
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{legacyCountStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{legacyCountFinalize})))
}
if sqlite3TestErrCode(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), rc) != 0 {
return 1
@@ -39564,23 +43819,23 @@ func test_create_aggregate(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc i
// in the correct sequence with debugging printfs inserted into C code.
// Puts uses a separate buffer and debugging statements will be out of
// sequence if it is used.
-func test_printf(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1235:26: */
+func test_printf(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1235:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+13164 /* " TEXT\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14814 /* " TEXT\"" */, 0))
return 1
}
- crt.Xprintf(tls, ts+293 /* "%s\n" */, crt.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
+ libc.Xprintf(tls, ts+293 /* "%s\n" */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
return 0
}
// Usage: sqlite3_mprintf_int FORMAT INTEGER INTEGER INTEGER
//
// Call mprintf with three integer arguments
-func sqlite3_mprintf_int(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1257:26: */
+func sqlite3_mprintf_int(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1257:26: */
bp := tls.Alloc(84)
defer tls.Free(84)
@@ -39589,8 +43844,8 @@ func sqlite3_mprintf_int(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
var i int32
var z uintptr
if argc != 5 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+13171 /* " FORMAT INT INT ..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14821 /* " FORMAT INT INT ..." */, 0))
return 1
}
for i = 2; i < 5; i++ {
@@ -39598,8 +43853,8 @@ func sqlite3_mprintf_int(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
return 1
}
}
- z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), crt.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(0)*4)), *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(1)*4)), *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(2)*4))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, z, 0))
+ z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(0)*4)), *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(1)*4)), *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(2)*4))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, z, 0))
sqlite3.Xsqlite3_free(tls, z)
return 0
}
@@ -39607,7 +43862,7 @@ func sqlite3_mprintf_int(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
// Usage: sqlite3_mprintf_int64 FORMAT INTEGER INTEGER INTEGER
//
// Call mprintf with three 64-bit integer arguments
-func sqlite3_mprintf_int64(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1284:26: */
+func sqlite3_mprintf_int64(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1284:26: */
bp := tls.Alloc(112)
defer tls.Free(112)
@@ -39616,18 +43871,18 @@ func sqlite3_mprintf_int64(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc i
var z uintptr
if argc != 5 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+13171 /* " FORMAT INT INT ..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14821 /* " FORMAT INT INT ..." */, 0))
return 1
}
for i = 2; i < 5; i++ {
if sqlite3.Xsqlite3Atoi64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), (bp+88 /* &a */ +uintptr((i-2))*8), sqlite3.Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))), uint8(1)) != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+13192 /* "argument is not ..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+14842 /* "argument is not ..." */, 0))
return 1
}
}
- z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), crt.VaList(bp+48, *(*sqlite_int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr(0)*8)), *(*sqlite_int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr(1)*8)), *(*sqlite_int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr(2)*8))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+72, z, 0))
+ z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), libc.VaList(bp+48, *(*sqlite_int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr(0)*8)), *(*sqlite_int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr(1)*8)), *(*sqlite_int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr(2)*8))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, z, 0))
sqlite3.Xsqlite3_free(tls, z)
return 0
}
@@ -39637,7 +43892,7 @@ func sqlite3_mprintf_int64(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc i
// Call mprintf with three long integer arguments. This might be the
// same as sqlite3_mprintf_int or sqlite3_mprintf_int64, depending on
// platform.
-func sqlite3_mprintf_long(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1317:26: */
+func sqlite3_mprintf_long(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1317:26: */
bp := tls.Alloc(112)
defer tls.Free(112)
@@ -39648,8 +43903,8 @@ func sqlite3_mprintf_long(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
var z uintptr
if argc != 5 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+13171 /* " FORMAT INT INT ..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14821 /* " FORMAT INT INT ..." */, 0))
return 1
}
for i = 2; i < 5; i++ {
@@ -39659,8 +43914,8 @@ func sqlite3_mprintf_long(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
*(*int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr((i-2))*8)) = int64(*(*int32)(unsafe.Pointer(bp + 72 /* &b[0] */ + uintptr((i-2))*4)))
*(*int64)(unsafe.Pointer(bp + 88 /* &a */ + uintptr((i-2))*8)) &= int64(((u64((uint64(1))) << (uint64(unsafe.Sizeof(int32(0))) * uint64(8))) - uint64(1)))
}
- z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), crt.VaList(bp+32, *(*int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr(0)*8)), *(*int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr(1)*8)), *(*int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr(2)*8))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, z, 0))
+ z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), libc.VaList(bp+32, *(*int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr(0)*8)), *(*int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr(1)*8)), *(*int64)(unsafe.Pointer(bp + 88 /* &a[0] */ + uintptr(2)*8))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, z, 0))
sqlite3.Xsqlite3_free(tls, z)
return 0
}
@@ -39668,7 +43923,7 @@ func sqlite3_mprintf_long(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
// Usage: sqlite3_mprintf_str FORMAT INTEGER INTEGER STRING
//
// Call mprintf with two integer arguments and one string argument
-func sqlite3_mprintf_str(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1348:26: */
+func sqlite3_mprintf_str(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1348:26: */
bp := tls.Alloc(84)
defer tls.Free(84)
@@ -39677,8 +43932,8 @@ func sqlite3_mprintf_str(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
var i int32
var z uintptr
if (argc < 4) || (argc > 5) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+13231 /* " FORMAT INT INT ..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14881 /* " FORMAT INT INT ..." */, 0))
return 1
}
for i = 2; i < 4; i++ {
@@ -39686,13 +43941,13 @@ func sqlite3_mprintf_str(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
return 1
}
}
- z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), crt.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(0)*4)), *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(1)*4)), func() uintptr {
+ z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(0)*4)), *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(1)*4)), func() uintptr {
if argc > 4 {
return *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8))
}
return uintptr(0)
}()))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, z, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, z, 0))
sqlite3.Xsqlite3_free(tls, z)
return 0
}
@@ -39700,7 +43955,7 @@ func sqlite3_mprintf_str(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
// Usage: sqlite3_snprintf_str INTEGER FORMAT INTEGER INTEGER STRING
//
// Call mprintf with two integer arguments and one string argument
-func sqlite3_snprintf_str(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1375:26: */
+func sqlite3_snprintf_str(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1375:26: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -39711,15 +43966,15 @@ func sqlite3_snprintf_str(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
var z uintptr
if (argc < 5) || (argc > 6) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+13257 /* " INT FORMAT INT ..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14907 /* " INT FORMAT INT ..." */, 0))
return 1
}
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+88 /* &n */) != 0 {
return 1
}
if *(*int32)(unsafe.Pointer(bp + 88 /* n */)) < 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+13287 /* "N must be non-ne..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+14937 /* "N must be non-ne..." */, 0))
return 1
}
for i = 3; i < 5; i++ {
@@ -39728,13 +43983,13 @@ func sqlite3_snprintf_str(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
}
}
z = sqlite3.Xsqlite3_malloc(tls, (*(*int32)(unsafe.Pointer(bp + 88 /* n */)) + 1))
- sqlite3.Xsqlite3_snprintf(tls, *(*int32)(unsafe.Pointer(bp + 88 /* n */)), z, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), crt.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 92 /* &a[0] */ + uintptr(0)*4)), *(*int32)(unsafe.Pointer(bp + 92 /* &a[0] */ + uintptr(1)*4)), func() uintptr {
+ sqlite3.Xsqlite3_snprintf(tls, *(*int32)(unsafe.Pointer(bp + 88 /* n */)), z, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 92 /* &a[0] */ + uintptr(0)*4)), *(*int32)(unsafe.Pointer(bp + 92 /* &a[0] */ + uintptr(1)*4)), func() uintptr {
if argc > 4 {
return *(*uintptr)(unsafe.Pointer(argv + uintptr(5)*8))
}
return uintptr(0)
}()))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+72, z, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, z, 0))
sqlite3.Xsqlite3_free(tls, z)
return 0
}
@@ -39742,7 +43997,7 @@ func sqlite3_snprintf_str(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
// Usage: sqlite3_mprintf_double FORMAT INTEGER INTEGER DOUBLE
//
// Call mprintf with two integer arguments and one double argument
-func sqlite3_mprintf_double(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1409:26: */
+func sqlite3_mprintf_double(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1409:26: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -39753,8 +44008,8 @@ func sqlite3_mprintf_double(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc
var z uintptr
if argc != 5 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+13310 /* " FORMAT INT INT ..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14960 /* " FORMAT INT INT ..." */, 0))
return 1
}
for i = 2; i < 4; i++ {
@@ -39765,8 +44020,8 @@ func sqlite3_mprintf_double(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc
if tcl.XTcl_GetDouble(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), bp+88 /* &r */) != 0 {
return 1
}
- z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), crt.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(0)*4)), *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(1)*4)), *(*float64)(unsafe.Pointer(bp + 88 /* r */))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, z, 0))
+ z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(0)*4)), *(*int32)(unsafe.Pointer(bp + 72 /* &a[0] */ + uintptr(1)*4)), *(*float64)(unsafe.Pointer(bp + 88 /* r */))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, z, 0))
sqlite3.Xsqlite3_free(tls, z)
return 0
}
@@ -39776,7 +44031,7 @@ func sqlite3_mprintf_double(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc
// Call mprintf with a single double argument which is the product of the
// two arguments given above. This is used to generate overflow and underflow
// doubles to test that they are converted properly.
-func sqlite3_mprintf_scaled(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1440:26: */
+func sqlite3_mprintf_scaled(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1440:26: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -39785,8 +44040,8 @@ func sqlite3_mprintf_scaled(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc
var z uintptr
if argc != 4 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+13334 /* " FORMAT DOUBLE D..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14984 /* " FORMAT DOUBLE D..." */, 0))
return 1
}
for i = 2; i < 4; i++ {
@@ -39794,8 +44049,8 @@ func sqlite3_mprintf_scaled(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc
return 1
}
}
- z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), crt.VaList(bp+32, (*(*float64)(unsafe.Pointer(bp + 56 /* &r[0] */ + uintptr(0)*8))**(*float64)(unsafe.Pointer(bp + 56 /* &r[0] */ + uintptr(1)*8)))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, z, 0))
+ z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), libc.VaList(bp+32, (*(*float64)(unsafe.Pointer(bp + 56 /* &r[0] */ + uintptr(0)*8))**(*float64)(unsafe.Pointer(bp + 56 /* &r[0] */ + uintptr(1)*8)))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, z, 0))
sqlite3.Xsqlite3_free(tls, z)
return 0
}
@@ -39805,18 +44060,18 @@ func sqlite3_mprintf_scaled(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc
// Call mprintf with a single double argument which is the product of the
// two arguments given above. This is used to generate overflow and underflow
// doubles to test that they are converted properly.
-func sqlite3_mprintf_stronly(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1470:26: */
+func sqlite3_mprintf_stronly(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1470:26: */
bp := tls.Alloc(56)
defer tls.Free(56)
var z uintptr
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+13357 /* " FORMAT STRING\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+15007 /* " FORMAT STRING\"" */, 0))
return 1
}
- z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), crt.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, z, 0))
+ z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, z, 0))
sqlite3.Xsqlite3_free(tls, z)
return 0
}
@@ -39825,7 +44080,7 @@ func sqlite3_mprintf_stronly(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc
//
// Call mprintf with a single double argument which is derived from the
// hexadecimal encoding of an IEEE double.
-func sqlite3_mprintf_hexdouble(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1494:26: */
+func sqlite3_mprintf_hexdouble(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:1494:26: */
bp := tls.Alloc(112)
defer tls.Free(112)
@@ -39839,26 +44094,26 @@ func sqlite3_mprintf_hexdouble(tls *crt.TLS, NotUsed uintptr, interp uintptr, ar
// var d sqlite_uint64 at bp+104, 8
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+13357 /* " FORMAT STRING\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+15007 /* " FORMAT STRING\"" */, 0))
return 1
}
- if crt.X__isoc99_sscanf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ts+13373 /* "%08x%08x" */, crt.VaList(bp+32, bp+88 /* &x2 */, bp+92 /* &x1 */)) != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, ts+13382 /* "2nd argument sho..." */, 0))
+ if libc.X__isoc99_sscanf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ts+15023 /* "%08x%08x" */, libc.VaList(bp+32, bp+88 /* &x2 */, bp+92 /* &x1 */)) != 2 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+15032 /* "2nd argument sho..." */, 0))
return 1
}
*(*sqlite_uint64)(unsafe.Pointer(bp + 104 /* d */)) = sqlite_uint64(*(*uint32)(unsafe.Pointer(bp + 88 /* x2 */)))
*(*sqlite_uint64)(unsafe.Pointer(bp + 104 /* d */)) = ((*(*sqlite_uint64)(unsafe.Pointer(bp + 104 /* d */)) << 32) + sqlite_uint64(*(*uint32)(unsafe.Pointer(bp + 92 /* x1 */))))
- crt.Xmemcpy(tls, bp+96 /* &r */, bp+104 /* &d */, uint64(unsafe.Sizeof(float64(0))))
- z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), crt.VaList(bp+64, *(*float64)(unsafe.Pointer(bp + 96 /* r */))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+72, z, 0))
+ libc.Xmemcpy(tls, bp+96 /* &r */, bp+104 /* &d */, uint64(unsafe.Sizeof(float64(0))))
+ z = sqlite3.Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), libc.VaList(bp+64, *(*float64)(unsafe.Pointer(bp + 96 /* r */))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, z, 0))
sqlite3.Xsqlite3_free(tls, z)
return 0
}
// Usage: sqlite3_enable_shared_cache ?BOOLEAN?
//
-func test_enable_shared(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1527:26: */
+func test_enable_shared(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1527:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -39868,7 +44123,7 @@ func test_enable_shared(tls *crt.TLS, clientData ClientData, interp uintptr, obj
var ret int32 = 0
if (objc != 2) && (objc != 1) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13426 /* "?BOOLEAN?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2760 /* "?BOOLEAN?" */)
return 1
}
ret = sqlite3.Xsqlite3Config.FsharedCacheEnabled
@@ -39883,13 +44138,13 @@ func test_enable_shared(tls *crt.TLS, clientData ClientData, interp uintptr, obj
return 1
}
}
- tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (crt.Bool32((ret) != 0))))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (libc.Bool32((ret) != 0))))
return 0
}
// Usage: sqlite3_extended_result_codes DB BOOLEAN
//
-func test_extended_result_codes(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1564:26: */
+func test_extended_result_codes(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1564:26: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -39898,7 +44153,7 @@ func test_extended_result_codes(tls *crt.TLS, clientData ClientData, interp uint
// var db uintptr at bp, 8
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13436 /* "DB BOOLEAN" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15076 /* "DB BOOLEAN" */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
@@ -39913,14 +44168,14 @@ func test_extended_result_codes(tls *crt.TLS, clientData ClientData, interp uint
// Usage: sqlite3_libversion_number
//
-func test_libversion_number(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1587:26: */
+func test_libversion_number(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1587:26: */
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, sqlite3.Xsqlite3_libversion_number(tls)))
return 0
}
// Usage: sqlite3_table_column_metadata DB dbname tblname colname
//
-func test_table_column_metadata(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1601:26: */
+func test_table_column_metadata(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1601:26: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -39942,7 +44197,7 @@ func test_table_column_metadata(tls *crt.TLS, clientData ClientData, interp uint
// var autoincrement int32 at bp+48, 4
if (objc != 5) && (objc != 4) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13447 /* "DB dbname tblnam..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15087 /* "DB dbname tblnam..." */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+16 /* &db */) != 0 {
@@ -39956,7 +44211,7 @@ func test_table_column_metadata(tls *crt.TLS, clientData ClientData, interp uint
zCol = uintptr(0)
}
- if crt.Xstrlen(tls, zDb) == uint64(0) {
+ if libc.Xstrlen(tls, zDb) == uint64(0) {
zDb = uintptr(0)
}
@@ -39964,7 +44219,7 @@ func test_table_column_metadata(tls *crt.TLS, clientData ClientData, interp uint
bp+24 /* &zDatatype */, bp+32 /* &zCollseq */, bp+40 /* &notnull */, bp+44 /* &primarykey */, bp+48 /* &autoincrement */)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */))), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */))), 0))
return 1
}
@@ -39979,7 +44234,7 @@ func test_table_column_metadata(tls *crt.TLS, clientData ClientData, interp uint
return 0
}
-func blobHandleFromObj(tls *crt.TLS, interp uintptr, pObj uintptr, ppBlob uintptr) int32 { /* test1.c:1652:26: */
+func blobHandleFromObj(tls *libc.TLS, interp uintptr, pObj uintptr, ppBlob uintptr) int32 { /* test1.c:1652:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -40010,7 +44265,7 @@ func blobHandleFromObj(tls *crt.TLS, interp uintptr, pObj uintptr, ppBlob uintpt
return 0
}
-func test_blob_reopen(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1681:26: */
+func test_blob_reopen(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1681:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -40021,7 +44276,7 @@ func test_blob_reopen(tls *crt.TLS, clientData ClientData, interp uintptr, objc
var rc int32
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13473 /* "CHANNEL ROWID" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15113 /* "CHANNEL ROWID" */)
return 1
}
@@ -40056,7 +44311,7 @@ type TestCollationX1 = struct {
}
type TestCollationX = TestCollationX1 /* test1.c:1720:31 */
-func testCreateCollationDel(tls *crt.TLS, pCtx uintptr) { /* test1.c:1721:13: */
+func testCreateCollationDel(tls *libc.TLS, pCtx uintptr) { /* test1.c:1721:13: */
var p uintptr = pCtx
var rc int32 = tcl.XTcl_EvalObjEx(tls, (*TestCollationX)(unsafe.Pointer(p)).Finterp, (*TestCollationX)(unsafe.Pointer(p)).FpDel, (0x040000 | 0x020000))
@@ -40066,19 +44321,19 @@ func testCreateCollationDel(tls *crt.TLS, pCtx uintptr) { /* test1.c:1721:13: */
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*TestCollationX)(unsafe.Pointer(p)).FpCmp
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = (*TestCollationX)(unsafe.Pointer(p)).FpDel
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
sqlite3.Xsqlite3_free(tls, p)
}
-func testCreateCollationCmp(tls *crt.TLS, pCtx uintptr, nLeft int32, zLeft uintptr, nRight int32, zRight uintptr) int32 { /* test1.c:1733:12: */
+func testCreateCollationCmp(tls *libc.TLS, pCtx uintptr, nLeft int32, zLeft uintptr, nRight int32, zRight uintptr) int32 { /* test1.c:1733:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -40096,14 +44351,14 @@ func testCreateCollationCmp(tls *crt.TLS, pCtx uintptr, nLeft int32, zLeft uintp
}
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pScript
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
return *(*int32)(unsafe.Pointer(bp /* iRes */))
}
-func test_create_collation_v2(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1757:26: */
+func test_create_collation_v2(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1757:26: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -40113,7 +44368,7 @@ func test_create_collation_v2(tls *crt.TLS, clientData ClientData, interp uintpt
var rc int32
if objc != 5 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13487 /* "DB-HANDLE NAME C..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15127 /* "DB-HANDLE NAME C..." */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+16 /* &db */) != 0 {
@@ -40129,17 +44384,17 @@ func test_create_collation_v2(tls *crt.TLS, clientData ClientData, interp uintpt
rc = sqlite3.Xsqlite3_create_collation_v2(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), 16,
p, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
- }{testCreateCollationCmp})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{testCreateCollationDel})))
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ }{testCreateCollationCmp})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testCreateCollationDel})))
if rc != 21 {
tcl.XTcl_AppendResult(tls, interp,
- crt.VaList(bp, ts+13520 /* "sqlite3_create_c..." */, uintptr(0)))
+ libc.VaList(bp, ts+15160 /* "sqlite3_create_c..." */, uintptr(0)))
return 1
}
rc = sqlite3.Xsqlite3_create_collation_v2(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), 1,
p, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
- }{testCreateCollationCmp})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{testCreateCollationDel})))
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ }{testCreateCollationCmp})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testCreateCollationDel})))
return 0
}
@@ -40168,13 +44423,13 @@ type CreateFunctionV21 = struct {
// -final SCRIPT
// -destroy SCRIPT
type CreateFunctionV2 = CreateFunctionV21 /* test1.c:1804:33 */
-func cf2Func(tls *crt.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* test1.c:1812:13: */
+func cf2Func(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* test1.c:1812:13: */
}
-func cf2Step(tls *crt.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* test1.c:1814:13: */
+func cf2Step(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* test1.c:1814:13: */
}
-func cf2Final(tls *crt.TLS, ctx uintptr) { /* test1.c:1816:13: */
+func cf2Final(tls *libc.TLS, ctx uintptr) { /* test1.c:1816:13: */
}
-func cf2Destroy(tls *crt.TLS, pUser uintptr) { /* test1.c:1818:13: */
+func cf2Destroy(tls *libc.TLS, pUser uintptr) { /* test1.c:1818:13: */
var p uintptr = pUser
if ((*CreateFunctionV2)(unsafe.Pointer(p)).Finterp != 0) && ((*CreateFunctionV2)(unsafe.Pointer(p)).FpDestroy != 0) {
@@ -40187,7 +44442,7 @@ func cf2Destroy(tls *crt.TLS, pUser uintptr) { /* test1.c:1818:13: */
if (*CreateFunctionV2)(unsafe.Pointer(p)).FpFunc != 0 {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*CreateFunctionV2)(unsafe.Pointer(p)).FpFunc
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -40195,7 +44450,7 @@ func cf2Destroy(tls *crt.TLS, pUser uintptr) { /* test1.c:1818:13: */
if (*CreateFunctionV2)(unsafe.Pointer(p)).FpStep != 0 {
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = (*CreateFunctionV2)(unsafe.Pointer(p)).FpStep
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -40203,7 +44458,7 @@ func cf2Destroy(tls *crt.TLS, pUser uintptr) { /* test1.c:1818:13: */
if (*CreateFunctionV2)(unsafe.Pointer(p)).FpFinal != 0 {
for ok2 := true; ok2; ok2 = 0 != 0 {
var _objPtr uintptr = (*CreateFunctionV2)(unsafe.Pointer(p)).FpFinal
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -40211,14 +44466,14 @@ func cf2Destroy(tls *crt.TLS, pUser uintptr) { /* test1.c:1818:13: */
if (*CreateFunctionV2)(unsafe.Pointer(p)).FpDestroy != 0 {
for ok3 := true; ok3; ok3 = 0 != 0 {
var _objPtr uintptr = (*CreateFunctionV2)(unsafe.Pointer(p)).FpDestroy
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
}
sqlite3.Xsqlite3_free(tls, p)
}
-func test_create_function_v2(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1832:26: */
+func test_create_function_v2(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1832:26: */
bp := tls.Alloc(180)
defer tls.Free(180)
@@ -40234,16 +44489,16 @@ func test_create_function_v2(tls *crt.TLS, clientData ClientData, interp uintptr
var rc int32
*(*[6]EncTable)(unsafe.Pointer(bp + 32 /* aEnc */)) = [6]EncTable{
- {FzEnc: ts + 13585 /* "utf8" */, Fenc: 1},
- {FzEnc: ts + 13590 /* "utf16" */, Fenc: 4},
- {FzEnc: ts + 13596 /* "utf16le" */, Fenc: 2},
- {FzEnc: ts + 13604 /* "utf16be" */, Fenc: 3},
- {FzEnc: ts + 10630 /* "any" */, Fenc: 5},
- {FzEnc: ts + 12045 /* "0" */, Fenc: 0},
+ {FzEnc: ts + 15225 /* "utf8" */, Fenc: 1},
+ {FzEnc: ts + 15230 /* "utf16" */, Fenc: 4},
+ {FzEnc: ts + 15236 /* "utf16le" */, Fenc: 2},
+ {FzEnc: ts + 15244 /* "utf16be" */, Fenc: 3},
+ {FzEnc: ts + 12285 /* "any" */, Fenc: 5},
+ {FzEnc: ts + 13695 /* "0" */, Fenc: 0},
}
if (objc < 5) || ((objc % 2) == 0) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13612 /* "DB NAME NARG ENC..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15252 /* "DB NAME NARG ENC..." */)
return 1
}
@@ -40255,21 +44510,21 @@ func test_create_function_v2(tls *crt.TLS, clientData ClientData, interp uintptr
return 1
}
if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(4)*8)), bp+32 /* &aEnc[0] */, int32(unsafe.Sizeof(EncTable{})),
- ts+13641 /* "encoding" */, 0, bp+128 /* &enc */) != 0 {
+ ts+15281 /* "encoding" */, 0, bp+128 /* &enc */) != 0 {
return 1
}
*(*int32)(unsafe.Pointer(bp + 128 /* enc */)) = (*EncTable)(unsafe.Pointer(bp + 32 /* &aEnc */ + uintptr(*(*int32)(unsafe.Pointer(bp + 128 /* enc */)))*16)).Fenc
p = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(CreateFunctionV2{})))
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(CreateFunctionV2{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(CreateFunctionV2{})))
(*CreateFunctionV2)(unsafe.Pointer(p)).Finterp = interp
for i = 5; i < objc; i = i + (2) {
// var iSwitch int32 at bp+176, 4
- *(*[5]uintptr)(unsafe.Pointer(bp + 136 /* azSwitch */)) = [5]uintptr{ts + 13650 /* "-func" */, ts + 13656 /* "-step" */, ts + 13662 /* "-final" */, ts + 13669 /* "-destroy" */, uintptr(0)}
- if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+136 /* &azSwitch[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+13678 /* "switch" */, 0, bp+176 /* &iSwitch */) != 0 {
+ *(*[5]uintptr)(unsafe.Pointer(bp + 136 /* azSwitch */)) = [5]uintptr{ts + 15290 /* "-func" */, ts + 15296 /* "-step" */, ts + 15302 /* "-final" */, ts + 15309 /* "-destroy" */, uintptr(0)}
+ if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+136 /* &azSwitch[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+15318 /* "switch" */, 0, bp+176 /* &iSwitch */) != 0 {
sqlite3.Xsqlite3_free(tls, p)
return 1
}
@@ -40319,7 +44574,7 @@ func test_create_function_v2(tls *crt.TLS, clientData ClientData, interp uintptr
func() uintptr {
if (*CreateFunctionV2)(unsafe.Pointer(p)).FpFunc != 0 {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{cf2Func}))
}
return uintptr(0)
@@ -40327,21 +44582,21 @@ func test_create_function_v2(tls *crt.TLS, clientData ClientData, interp uintptr
func() uintptr {
if (*CreateFunctionV2)(unsafe.Pointer(p)).FpStep != 0 {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{cf2Step}))
}
return uintptr(0)
}(),
func() uintptr {
if (*CreateFunctionV2)(unsafe.Pointer(p)).FpFinal != 0 {
- return *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{cf2Final}))
+ return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{cf2Final}))
}
return uintptr(0)
}(),
- *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{cf2Destroy})))
+ *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{cf2Destroy})))
if rc != 0 {
tcl.XTcl_ResetResult(tls, interp)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
return 0
@@ -40354,7 +44609,7 @@ type EncTable = struct {
}
// Usage: sqlite3_load_extension DB-HANDLE FILE ?PROC?
-func test_load_extension(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1920:26: */
+func test_load_extension(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1920:26: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -40371,7 +44626,7 @@ func test_load_extension(tls *crt.TLS, clientData ClientData, interp uintptr, ob
var zErr uintptr = uintptr(0)
if (objc != 4) && (objc != 3) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13685 /* "DB-HANDLE FILE ?..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15325 /* "DB-HANDLE FILE ?..." */)
return 1
}
zDb = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -40382,7 +44637,7 @@ func test_load_extension(tls *crt.TLS, clientData ClientData, interp uintptr, ob
// Extract the C database handle from the Tcl command name
if !(tcl.XTcl_GetCommandInfo(tls, interp, zDb, bp+24 /* &cmdInfo */) != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12711 /* "command not foun..." */, zDb, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14361 /* "command not foun..." */, zDb, uintptr(0)))
return 1
}
db = (*struct{ Fdb uintptr })(unsafe.Pointer((*Tcl_CmdInfo)(unsafe.Pointer(bp + 24 /* &cmdInfo */)).FobjClientData)).Fdb
@@ -40391,7 +44646,7 @@ func test_load_extension(tls *crt.TLS, clientData ClientData, interp uintptr, ob
// TCL_ERROR and load any error string into the interpreter. If no
// error occurs, set rc to TCL_OK.
rc = 1
- zErr = sqlite3.Xsqlite3_mprintf(tls, ts+13707 /* "this build omits..." */, 0)
+ zErr = sqlite3.Xsqlite3_mprintf(tls, ts+15347 /* "this build omits..." */, 0)
_ = zProc
_ = zFile
if rc != 0 {
@@ -40411,7 +44666,7 @@ func test_load_extension(tls *crt.TLS, clientData ClientData, interp uintptr, ob
}
// Usage: sqlite3_enable_load_extension DB-HANDLE ONOFF
-func test_enable_load(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1978:26: */
+func test_enable_load(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:1978:26: */
bp := tls.Alloc(100)
defer tls.Free(100)
@@ -40423,14 +44678,14 @@ func test_enable_load(tls *crt.TLS, clientData ClientData, interp uintptr, objc
// var onoff int32 at bp+96, 4
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13749 /* "DB-HANDLE ONOFF" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15389 /* "DB-HANDLE ONOFF" */)
return 1
}
zDb = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
// Extract the C database handle from the Tcl command name
if !(tcl.XTcl_GetCommandInfo(tls, interp, zDb, bp+32 /* &cmdInfo */) != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12711 /* "command not foun..." */, zDb, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14361 /* "command not foun..." */, zDb, uintptr(0)))
return 1
}
db = (*struct{ Fdb uintptr })(unsafe.Pointer((*Tcl_CmdInfo)(unsafe.Pointer(bp + 32 /* &cmdInfo */)).FobjClientData)).Fdb
@@ -40440,7 +44695,7 @@ func test_enable_load(tls *crt.TLS, clientData ClientData, interp uintptr, objc
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+24, ts+13707 /* "this build omits..." */))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+15347 /* "this build omits..." */))
return 1
}
@@ -40449,15 +44704,15 @@ func test_enable_load(tls *crt.TLS, clientData ClientData, interp uintptr, objc
// Shutdown the process immediately. This is not a clean shutdown.
// This command is used to test the recoverability of a database in
// the event of a program crash.
-func sqlite_abort(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:2024:26: */
- crt.Xexit(tls, 255)
+func sqlite_abort(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:2024:26: */
+ libc.Xexit(tls, 255)
// This will always fail
return 0
}
// The following routine is a user-defined SQL function whose purpose
// is to test the sqlite_set_result() API.
-func testFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:2045:13: */
+func testFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test1.c:2045:13: */
var zArg0 uintptr
__1:
if !(argc >= 2) {
@@ -40467,38 +44722,38 @@ __1:
if !(zArg0 != 0) {
goto __3
}
- if !(0 == sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+8775 /* "int" */)) {
+ if !(0 == sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+2437 /* "int" */)) {
goto __5
}
sqlite3.Xsqlite3_result_int(tls, context, sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
goto __6
__5:
- if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+2631 /* "int64" */) == 0) {
+ if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+3787 /* "int64" */) == 0) {
goto __7
}
sqlite3.Xsqlite3_result_int64(tls, context, sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
goto __8
__7:
- if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+13765 /* "string" */) == 0) {
+ if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+15405 /* "string" */) == 0) {
goto __9
}
sqlite3.Xsqlite3_result_text(tls, context, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))), -1,
- crt.UintptrFromInt32(-1))
+ libc.UintptrFromInt32(-1))
goto __10
__9:
- if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+2637 /* "double" */) == 0) {
+ if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+2422 /* "double" */) == 0) {
goto __11
}
sqlite3.Xsqlite3_result_double(tls, context, sqlite3.Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
goto __12
__11:
- if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+5922 /* "null" */) == 0) {
+ if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+7207 /* "null" */) == 0) {
goto __13
}
sqlite3.Xsqlite3_result_null(tls, context)
goto __14
__13:
- if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+13772 /* "value" */) == 0) {
+ if !(sqlite3.Xsqlite3StrICmp(tls, zArg0, ts+15412 /* "value" */) == 0) {
goto __15
}
sqlite3.Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))*8)))
@@ -40531,13 +44786,13 @@ __2:
error_out:
sqlite3.Xsqlite3_result_error(tls, context,
- ts+13778 /* "first argument s..." */, -1)
+ ts+15418 /* "first argument s..." */, -1)
}
// Usage: sqlite_register_test_function DB NAME
//
// Register the test SQL function on the database DB under the name NAME.
-func test_register_func(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:2083:26: */
+func test_register_func(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:2083:26: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -40545,8 +44800,8 @@ func test_register_func(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
var rc int32
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+13846 /* " DB FUNCTION-NAM..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+15486 /* " DB FUNCTION-NAM..." */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+48 /* &db */) != 0 {
@@ -40554,10 +44809,10 @@ func test_register_func(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
}
rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), -1, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{testFunc})), uintptr(0), uintptr(0))
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrStr(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrStr(tls, rc), 0))
return 1
}
if sqlite3TestErrCode(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), rc) != 0 {
@@ -40569,7 +44824,7 @@ func test_register_func(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
// Usage: sqlite3_finalize STMT
//
// Finalize a statement handle.
-func test_finalize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2112:26: */
+func test_finalize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2112:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -40579,8 +44834,8 @@ func test_finalize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
var db uintptr = uintptr(0)
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+13864 /* " <STMT>" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15504 /* " <STMT>" */, 0))
return 1
}
@@ -40602,7 +44857,7 @@ func test_finalize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
// Usage: sqlite3_stmt_status STMT CODE RESETFLAG
//
// Get the value of a status counter from a statement.
-func test_stmt_status(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2144:26: */
+func test_stmt_status(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2144:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -40615,7 +44870,7 @@ func test_stmt_status(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
// var pStmt uintptr at bp, 8
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+13872 /* "STMT PARAMETER R..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15512 /* "STMT PARAMETER R..." */)
return 1
}
if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &pStmt */) != 0 {
@@ -40627,7 +44882,7 @@ func test_stmt_status(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
Fop int32
_ [4]byte
}{})))); i++ {
- if crt.Xstrcmp(tls, aOp[i].FzName, zOpName) == 0 {
+ if libc.Xstrcmp(tls, aOp[i].FzName, zOpName) == 0 {
*(*int32)(unsafe.Pointer(bp + 8 /* op */)) = aOp[i].Fop
break
}
@@ -40654,39 +44909,39 @@ var aOp = [7]struct {
Fop int32
_ [4]byte
}{
- {FzName: ts + 13897 /* "SQLITE_STMTSTATU..." */, Fop: 1},
- {FzName: ts + 13929 /* "SQLITE_STMTSTATU..." */, Fop: 2},
- {FzName: ts + 13952 /* "SQLITE_STMTSTATU..." */, Fop: 3},
- {FzName: ts + 13980 /* "SQLITE_STMTSTATU..." */, Fop: 4},
- {FzName: ts + 14006 /* "SQLITE_STMTSTATU..." */, Fop: 5},
- {FzName: ts + 14034 /* "SQLITE_STMTSTATU..." */, Fop: 6},
- {FzName: ts + 14056 /* "SQLITE_STMTSTATU..." */, Fop: 99},
+ {FzName: ts + 15537 /* "SQLITE_STMTSTATU..." */, Fop: 1},
+ {FzName: ts + 15569 /* "SQLITE_STMTSTATU..." */, Fop: 2},
+ {FzName: ts + 15592 /* "SQLITE_STMTSTATU..." */, Fop: 3},
+ {FzName: ts + 15620 /* "SQLITE_STMTSTATU..." */, Fop: 4},
+ {FzName: ts + 15646 /* "SQLITE_STMTSTATU..." */, Fop: 5},
+ {FzName: ts + 15674 /* "SQLITE_STMTSTATU..." */, Fop: 6},
+ {FzName: ts + 15696 /* "SQLITE_STMTSTATU..." */, Fop: 99},
} /* test1.c:2158:5 */
// Usage: sqlite3_config_sorterref
//
// Set the SQLITE_CONFIG_SORTERREF_SIZE configuration option
-func test_config_sorterref(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2285:26: */
+func test_config_sorterref(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2285:26: */
bp := tls.Alloc(12)
defer tls.Free(12)
// var iVal int32 at bp+8, 4
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14082 /* "NBYTE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15722 /* "NBYTE" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+8 /* &iVal */) != 0 {
return 1
}
- sqlite3.Xsqlite3_config(tls, 28, crt.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* iVal */))))
+ sqlite3.Xsqlite3_config(tls, 28, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* iVal */))))
return 0
}
// Usage: vfs_current_time_int64
//
// Return the value returned by the default VFS's xCurrentTimeInt64 method.
-func vfsCurrentTimeInt64(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2306:26: */
+func vfsCurrentTimeInt64(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2306:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -40697,15 +44952,233 @@ func vfsCurrentTimeInt64(tls *crt.TLS, clientData uintptr, interp uintptr, objc
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */)
return 1
}
- (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, pVfs, bp /* &t */)
+ (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, pVfs, bp /* &t */)
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewWideIntObj(tls, int64(*(*i64)(unsafe.Pointer(bp /* t */)))))
return 0
+}
+
+// Usage: sqlite3_snapshot_get DB DBNAME
+func test_snapshot_get(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2327:26: */
+ bp := tls.Alloc(116)
+ defer tls.Free(116)
+
+ var rc int32
+ // var db uintptr at bp, 8
+
+ var zName uintptr
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pSnapshot */)) = uintptr(0)
+
+ if objc != 3 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15728 /* "DB DBNAME" */)
+ return 1
+ }
+ if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
+ return 1
+ }
+ zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
+
+ rc = sqlite3.Xsqlite3_snapshot_get(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), zName, bp+8 /* &pSnapshot */)
+ if rc != 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
+ return 1
+ } else {
+ // var zBuf [100]int8 at bp+16, 100
+
+ if sqlite3TestMakePointerStr(tls, interp, bp+16 /* &zBuf[0] */, *(*uintptr)(unsafe.Pointer(bp + 8 /* pSnapshot */))) != 0 {
+ return 1
+ }
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, bp+16 /* &zBuf[0] */, -1))
+ }
+ return 0
+}
+
+// Usage: sqlite3_snapshot_recover DB DBNAME
+func test_snapshot_recover(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2362:26: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32
+ // var db uintptr at bp, 8
+
+ var zName uintptr
+
+ if objc != 3 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15728 /* "DB DBNAME" */)
+ return 1
+ }
+ if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
+ return 1
+ }
+ zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
+
+ rc = sqlite3.Xsqlite3_snapshot_recover(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), zName)
+ if rc != 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
+ return 1
+ } else {
+ tcl.XTcl_ResetResult(tls, interp)
+ }
+ return 0
+}
+
+// Usage: sqlite3_snapshot_open DB DBNAME SNAPSHOT
+func test_snapshot_open(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2394:26: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32
+ // var db uintptr at bp, 8
+
+ var zName uintptr
+ var pSnapshot uintptr
+
+ if objc != 4 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15738 /* "DB DBNAME SNAPSH..." */)
+ return 1
+ }
+ if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
+ return 1
+ }
+ zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
+ pSnapshot = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8))))
+
+ rc = sqlite3.Xsqlite3_snapshot_open(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), zName, pSnapshot)
+ if rc != 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
+ return 1
+ } else {
+ tcl.XTcl_ResetResult(tls, interp)
+ }
+ return 0
+}
+
+// Usage: sqlite3_snapshot_free SNAPSHOT
+func test_snapshot_free(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2428:26: */
+ var pSnapshot uintptr
+ if objc != 2 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15757 /* "SNAPSHOT" */)
+ return 1
+ }
+ pSnapshot = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
+ sqlite3.Xsqlite3_snapshot_free(tls, pSnapshot)
+ return 0
+}
+
+// Usage: sqlite3_snapshot_cmp SNAPSHOT1 SNAPSHOT2
+func test_snapshot_cmp(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2449:26: */
+ var res int32
+ var p1 uintptr
+ var p2 uintptr
+ if objc != 3 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15766 /* "SNAPSHOT1 SNAPSH..." */)
+ return 1
+ }
+ p1 = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
+ p2 = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))))
+ res = sqlite3.Xsqlite3_snapshot_cmp(tls, p1, p2)
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, res))
+ return 0
+}
+
+// Usage: sqlite3_snapshot_get_blob DB DBNAME
+func test_snapshot_get_blob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2474:26: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var rc int32
+ // var db uintptr at bp, 8
+
+ var zName uintptr
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pSnapshot */)) = uintptr(0)
+
+ if objc != 3 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15728 /* "DB DBNAME" */)
+ return 1
+ }
+ if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
+ return 1
+ }
+ zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
+
+ rc = sqlite3.Xsqlite3_snapshot_get(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), zName, bp+8 /* &pSnapshot */)
+ if rc != 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
+ return 1
+ } else {
+ tcl.XTcl_SetObjResult(tls, interp,
+ tcl.XTcl_NewByteArrayObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pSnapshot */)), int32(unsafe.Sizeof(sqlite3_snapshot{}))))
+ sqlite3.Xsqlite3_snapshot_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pSnapshot */)))
+ }
+ return 0
+}
+
+// Usage: sqlite3_snapshot_open_blob DB DBNAME SNAPSHOT
+func test_snapshot_open_blob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2510:26: */
+ bp := tls.Alloc(28)
+ defer tls.Free(28)
+
+ var rc int32
+ // var db uintptr at bp+16, 8
+
+ var zName uintptr
+ var pBlob uintptr
+ // var nBlob int32 at bp+24, 4
+
+ if objc != 4 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15738 /* "DB DBNAME SNAPSH..." */)
+ return 1
+ }
+ if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+16 /* &db */) != 0 {
+ return 1
+ }
+ zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
+ pBlob = tcl.XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), bp+24 /* &nBlob */)
+ if (uint64(*(*int32)(unsafe.Pointer(bp + 24 /* nBlob */))) != uint64(unsafe.Sizeof(sqlite3_snapshot{}))) {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+15786 /* "bad SNAPSHOT" */, 0))
+ return 1
+ }
+ rc = sqlite3.Xsqlite3_snapshot_open(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), zName, pBlob)
+ if rc != 0 {
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
+ return 1
+ }
+ return 0
+}
+
+// Usage: sqlite3_snapshot_cmp_blob SNAPSHOT1 SNAPSHOT2
+func test_snapshot_cmp_blob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2546:26: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var res int32
+ var p1 uintptr
+ var p2 uintptr
+ // var n1 int32 at bp+16, 4
+
+ // var n2 int32 at bp+20, 4
+
+ if objc != 3 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15766 /* "SNAPSHOT1 SNAPSH..." */)
+ return 1
+ }
+
+ p1 = tcl.XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+16 /* &n1 */)
+ p2 = tcl.XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+20 /* &n2 */)
+
+ if (uint64(*(*int32)(unsafe.Pointer(bp + 16 /* n1 */))) != uint64(unsafe.Sizeof(sqlite3_snapshot{}))) || (*(*int32)(unsafe.Pointer(bp + 16 /* n1 */)) != *(*int32)(unsafe.Pointer(bp + 20 /* n2 */))) {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+15786 /* "bad SNAPSHOT" */, 0))
+ return 1
+ }
+
+ res = sqlite3.Xsqlite3_snapshot_cmp(tls, p1, p2)
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, res))
+ return 0
} // in test_delete.c
-func test_delete_database(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2581:26: */
+func test_delete_database(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2581:26: */
var rc int32
var zFile uintptr
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14088 /* "FILE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15799 /* "FILE" */)
return 1
}
zFile = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -40716,7 +45189,7 @@ func test_delete_database(tls *crt.TLS, clientData uintptr, interp uintptr, objc
}
// Usage: atomic_batch_write PATH
-func test_atomic_batch_write(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2603:26: */
+func test_atomic_batch_write(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2603:26: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -40728,20 +45201,20 @@ func test_atomic_batch_write(tls *crt.TLS, clientData uintptr, interp uintptr, o
var rc int32 // sqlite3_open() return code
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14093 /* "PATH" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15804 /* "PATH" */)
return 1
}
zFile = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
rc = sqlite3.Xsqlite3_open(tls, zFile, bp+16 /* &db */)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */))), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */))), 0))
sqlite3.Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)))
return 1
}
rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+84 /* "main" */, 7, bp+24 /* &pFd */)
- dc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pFd */)))).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pFd */)))
+ dc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pFd */)))).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pFd */)))
if (dc & 0x00004000) != 0 {
bRes = 1
}
@@ -40754,7 +45227,7 @@ func test_atomic_batch_write(tls *crt.TLS, clientData uintptr, interp uintptr, o
// Usage: sqlite3_next_stmt DB STMT
//
// Return the next statment in sequence after STMT.
-func test_next_stmt(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2645:26: */
+func test_next_stmt(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2645:26: */
bp := tls.Alloc(114)
defer tls.Free(114)
@@ -40764,8 +45237,8 @@ func test_next_stmt(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// var zBuf [50]int8 at bp+64, 50
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14098 /* " DB STMT" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15809 /* " DB STMT" */, 0))
return 1
}
@@ -40780,7 +45253,7 @@ func test_next_stmt(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
if sqlite3TestMakePointerStr(tls, interp, bp+64 /* &zBuf[0] */, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */))) != 0 {
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, bp+64 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, bp+64 /* &zBuf[0] */, 0))
}
return 0
}
@@ -40789,7 +45262,7 @@ func test_next_stmt(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
//
// Return true if STMT is a NULL pointer or a pointer to a statement
// that is guaranteed to leave the database unmodified.
-func test_stmt_readonly(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2677:26: */
+func test_stmt_readonly(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2677:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -40798,8 +45271,8 @@ func test_stmt_readonly(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
var rc int32
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14107 /* " STMT" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15818 /* " STMT" */, 0))
return 1
}
@@ -40807,7 +45280,7 @@ func test_stmt_readonly(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
return 1
}
rc = sqlite3.Xsqlite3_stmt_readonly(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)))
- tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (crt.Bool32((rc) != 0))))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (libc.Bool32((rc) != 0))))
return 0
}
@@ -40815,7 +45288,7 @@ func test_stmt_readonly(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
//
// Return 1, 2, or 0 respectively if STMT is an EXPLAIN statement, an
// EXPLAIN QUERY PLAN statement or an ordinary statement or NULL pointer.
-func test_stmt_isexplain(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2704:26: */
+func test_stmt_isexplain(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2704:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -40824,8 +45297,8 @@ func test_stmt_isexplain(tls *crt.TLS, clientData uintptr, interp uintptr, objc
var rc int32
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14107 /* " STMT" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15818 /* " STMT" */, 0))
return 1
}
@@ -40841,7 +45314,7 @@ func test_stmt_isexplain(tls *crt.TLS, clientData uintptr, interp uintptr, objc
//
// Return true if STMT is a non-NULL pointer to a statement
// that has been stepped but not to completion.
-func test_stmt_busy(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2731:26: */
+func test_stmt_busy(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2731:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -40850,8 +45323,8 @@ func test_stmt_busy(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
var rc int32
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14107 /* " STMT" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15818 /* " STMT" */, 0))
return 1
}
@@ -40859,22 +45332,22 @@ func test_stmt_busy(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
return 1
}
rc = sqlite3.Xsqlite3_stmt_busy(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)))
- tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (crt.Bool32((rc) != 0))))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (libc.Bool32((rc) != 0))))
return 0
}
// Usage: uses_stmt_journal STMT
//
// Return true if STMT uses a statement journal.
-func uses_stmt_journal(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2757:26: */
+func uses_stmt_journal(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2757:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var pStmt uintptr at bp+32, 8
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14107 /* " STMT" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15818 /* " STMT" */, 0))
return 1
}
@@ -40882,14 +45355,14 @@ func uses_stmt_journal(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
return 1
}
sqlite3.Xsqlite3_stmt_readonly(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)))
- tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (crt.Bool32((int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)) + 200 /* &.usesStmtJournal */))&0x40>>6)) != 0))))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (libc.Bool32((int32(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)) + 200 /* &.usesStmtJournal */))&0x40>>6)) != 0))))
return 0
}
// Usage: sqlite3_reset STMT
//
// Reset a statement handle.
-func test_reset(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2783:26: */
+func test_reset(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2783:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -40898,8 +45371,8 @@ func test_reset(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, ob
var rc int32
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+13864 /* " <STMT>" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15504 /* " <STMT>" */, 0))
return 1
}
@@ -40922,28 +45395,28 @@ func test_reset(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, ob
// Usage: sqlite3_expired STMT
//
// Return TRUE if a recompilation of the statement is recommended.
-func test_expired(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2818:26: */
+func test_expired(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2818:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var pStmt uintptr at bp+32, 8
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+13864 /* " <STMT>" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15504 /* " <STMT>" */, 0))
return 1
}
if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+32 /* &pStmt */) != 0 {
return 1
}
- tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (crt.Bool32((sqlite3.Xsqlite3_expired(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)))) != 0))))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (libc.Bool32((sqlite3.Xsqlite3_expired(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)))) != 0))))
return 0
}
// Usage: sqlite3_transfer_bindings FROMSTMT TOSTMT
//
// Transfer all bindings from FROMSTMT over to TOSTMT
-func test_transfer_bind(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2842:26: */
+func test_transfer_bind(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2842:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -40952,8 +45425,8 @@ func test_transfer_bind(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// var pStmt2 uintptr at bp+40, 8
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14113 /* " FROM-STMT TO-ST..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15824 /* " FROM-STMT TO-ST..." */, 0))
return 1
}
if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+32 /* &pStmt1 */) != 0 {
@@ -40971,15 +45444,15 @@ func test_transfer_bind(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
//
// Return the number of changes made to the database by the last SQL
// execution.
-func test_changes(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2869:26: */
+func test_changes(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:2869:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var db uintptr at bp+32, 8
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+32 /* &db */) != 0 {
@@ -41003,7 +45476,7 @@ var sqlite_static_bind_nbyte int32 = 0 /* test1.c:2891:12 */
// "sqlite_static_bind_value". If FLAGS=="normal" then a copy
// of the VALUE is made. If FLAGS=="blob10" then a VALUE is ignored
// an a 10-byte blob "abc\000xyz\000pq" is inserted.
-func test_bind(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:2904:26: */
+func test_bind(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:2904:26: */
bp := tls.Alloc(142)
defer tls.Free(142)
@@ -41013,8 +45486,8 @@ func test_bind(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv u
// var idx int32 at bp+88, 4
if argc != 5 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+14132 /* " VM IDX VALUE (n..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+15843 /* " VM IDX VALUE (n..." */, 0))
return 1
}
if getStmtPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+80 /* &pStmt */) != 0 {
@@ -41023,20 +45496,20 @@ func test_bind(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv u
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), bp+88 /* &idx */) != 0 {
return 1
}
- if crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), ts+5922 /* "null" */) == 0 {
+ if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), ts+7207 /* "null" */) == 0 {
rc = sqlite3.Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)))
- } else if crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), ts+14168 /* "static" */) == 0 {
+ } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), ts+15879 /* "static" */) == 0 {
rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)), sqlite_static_bind_value, -1, uintptr(0))
- } else if crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), ts+14175 /* "static-nbytes" */) == 0 {
+ } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), ts+15886 /* "static-nbytes" */) == 0 {
rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)), sqlite_static_bind_value,
sqlite_static_bind_nbyte, uintptr(0))
- } else if crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), ts+14189 /* "normal" */) == 0 {
- rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)), *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)), -1, crt.UintptrFromInt32(-1))
- } else if crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), ts+14196 /* "blob10" */) == 0 {
- rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)), ts+14203 /* "abc\x00xyz\x00pq" */, 10, uintptr(0))
+ } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), ts+15900 /* "normal" */) == 0 {
+ rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)), *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)), -1, libc.UintptrFromInt32(-1))
+ } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), ts+15907 /* "blob10" */) == 0 {
+ rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 88 /* idx */)), ts+15914 /* "abc\x00xyz\x00pq" */, 10, uintptr(0))
} else {
tcl.XTcl_AppendResult(tls, interp,
- crt.VaList(bp+32, ts+14214 /* "4th argument sho..." */, 0))
+ libc.VaList(bp+32, ts+15925 /* "4th argument sho..." */, 0))
return 1
}
if sqlite3TestErrCode(tls, interp, sqlite3.Xsqlite3_db_handle(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */))), rc) != 0 {
@@ -41045,8 +45518,8 @@ func test_bind(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv u
if rc != 0 {
// var zBuf [50]int8 at bp+92, 50
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+92 /* &zBuf[0] */, ts+14268 /* "(%d) " */, crt.VaList(bp+48, rc))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, bp+92 /* &zBuf[0] */, sqlite3.Xsqlite3ErrStr(tls, rc), 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+92 /* &zBuf[0] */, ts+15979 /* "(%d) " */, libc.VaList(bp+48, rc))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+92 /* &zBuf[0] */, sqlite3.Xsqlite3ErrStr(tls, rc), 0))
return 1
}
return 0
@@ -41079,7 +45552,7 @@ func test_bind(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv u
// interp pointer to use when evaluating the TCL script is stored in
// pTestCollateInterp.
var pTestCollateInterp uintptr /* test1.c:2975:18: */
-func test_collate_func(tls *crt.TLS, pCtx uintptr, nA int32, zA uintptr, nB int32, zB uintptr) int32 { /* test1.c:2976:12: */
+func test_collate_func(tls *libc.TLS, pCtx uintptr, nA int32, zA uintptr, nB int32, zB uintptr) int32 { /* test1.c:2976:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -41091,18 +45564,18 @@ func test_collate_func(tls *crt.TLS, pCtx uintptr, nA int32, zA uintptr, nB int3
var pVal uintptr
var pX uintptr
- pX = tcl.XTcl_NewStringObj(tls, ts+14274 /* "test_collate" */, -1)
+ pX = tcl.XTcl_NewStringObj(tls, ts+15985 /* "test_collate" */, -1)
(*Tcl_Obj)(unsafe.Pointer(pX)).FrefCount++
switch encin {
case 1:
- tcl.XTcl_ListObjAppendElement(tls, i, pX, tcl.XTcl_NewStringObj(tls, ts+14287 /* "UTF-8" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, i, pX, tcl.XTcl_NewStringObj(tls, ts+15998 /* "UTF-8" */, -1))
break
case 2:
- tcl.XTcl_ListObjAppendElement(tls, i, pX, tcl.XTcl_NewStringObj(tls, ts+14293 /* "UTF-16LE" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, i, pX, tcl.XTcl_NewStringObj(tls, ts+16004 /* "UTF-16LE" */, -1))
break
case 3:
- tcl.XTcl_ListObjAppendElement(tls, i, pX, tcl.XTcl_NewStringObj(tls, ts+14302 /* "UTF-16BE" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, i, pX, tcl.XTcl_NewStringObj(tls, ts+16013 /* "UTF-16BE" */, -1))
break
default:
}
@@ -41125,14 +45598,14 @@ func test_collate_func(tls *crt.TLS, pCtx uintptr, nA int32, zA uintptr, nB int3
tcl.XTcl_EvalObjEx(tls, i, pX, 0)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pX
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
tcl.XTcl_GetIntFromObj(tls, i, tcl.XTcl_GetObjResult(tls, i), bp /* &res */)
return *(*int32)(unsafe.Pointer(bp /* res */))
}
-func test_collate(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3026:26: */
+func test_collate(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3026:26: */
bp := tls.Alloc(60)
defer tls.Free(60)
@@ -41164,11 +45637,11 @@ __2:
return 1
__3:
;
- rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+14274 /* "test_collate" */, 1,
+ rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+15985 /* "test_collate" */, 1,
uintptr(1), func() uintptr {
if *(*int32)(unsafe.Pointer(bp + 56 /* val */)) != 0 {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{test_collate_func}))
}
return uintptr(0)
@@ -41182,11 +45655,11 @@ __3:
return 1
__5:
;
- rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+14274 /* "test_collate" */, 2,
+ rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), ts+15985 /* "test_collate" */, 2,
uintptr(2), func() uintptr {
if *(*int32)(unsafe.Pointer(bp + 56 /* val */)) != 0 {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{test_collate_func}))
}
return uintptr(0)
@@ -41200,7 +45673,7 @@ __6:
sqlite3.Xsqlite3_mutex_enter(tls, (*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* db */)))).Fmutex)
pVal = sqlite3.Xsqlite3ValueNew(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)))
- sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, ts+14274 /* "test_collate" */, uint8(1), uintptr(0))
+ sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, ts+15985 /* "test_collate" */, uint8(1), uintptr(0))
zUtf16 = sqlite3.Xsqlite3ValueText(tls, pVal, uint8(2))
if !((*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48 /* db */)))).FmallocFailed != 0) {
goto __7
@@ -41212,7 +45685,7 @@ __7:
uintptr(3), func() uintptr {
if *(*int32)(unsafe.Pointer(bp + 56 /* val */)) != 0 {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{test_collate_func}))
}
return uintptr(0)
@@ -41233,15 +45706,15 @@ __9:
if !(rc != 0) {
goto __10
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
__10:
;
return 0
bad_args:
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+16, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14311 /* " <DB> <utf8> <ut..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+16022 /* " <DB> <utf8> <ut..." */, 0))
return 1
}
@@ -41250,20 +45723,20 @@ bad_args:
// Add a utf-16 collation sequence named "utf16bin" to the database
// handle. This collation sequence compares arguments in the same way as the
// built-in collation "binary".
-func test_utf16bin_collate_func(tls *crt.TLS, pCtx uintptr, nA int32, zA uintptr, nB int32, zB uintptr) int32 { /* test1.c:3090:12: */
+func test_utf16bin_collate_func(tls *libc.TLS, pCtx uintptr, nA int32, zA uintptr, nB int32, zB uintptr) int32 { /* test1.c:3090:12: */
var nCmp int32 = func() int32 {
if nA > nB {
return nB
}
return nA
}()
- var res int32 = crt.Xmemcmp(tls, zA, zB, uint64(nCmp))
+ var res int32 = libc.Xmemcmp(tls, zA, zB, uint64(nCmp))
if res == 0 {
res = (nA - nB)
}
return res
}
-func test_utf16bin_collate(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3100:26: */
+func test_utf16bin_collate(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3100:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -41284,9 +45757,9 @@ __1:
__2:
;
- rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+14344 /* "utf16bin" */, 4, uintptr(0),
+ rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+16055 /* "utf16bin" */, 4, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{test_utf16bin_collate_func})))
if !(sqlite3TestErrCode(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* db */)), rc) != 0) {
goto __3
@@ -41310,7 +45783,7 @@ var pzNeededCollation uintptr = 0 /* test1.c:3130:13 */
// Called when a collating sequence is needed. Registered using
// sqlite3_collation_needed16().
-func test_collate_needed_cb(tls *crt.TLS, pCtx uintptr, db uintptr, eTextRep int32, pName uintptr) { /* test1.c:3137:13: */
+func test_collate_needed_cb(tls *libc.TLS, pCtx uintptr, db uintptr, eTextRep int32, pName uintptr) { /* test1.c:3137:13: */
var enc int32 = int32((*sqlite31)(unsafe.Pointer(db)).Fenc)
var i int32
var z uintptr
@@ -41318,18 +45791,18 @@ func test_collate_needed_cb(tls *crt.TLS, pCtx uintptr, db uintptr, eTextRep int
i = 0
for ; (*(*int8)(unsafe.Pointer(z)) != 0) || (*(*int8)(unsafe.Pointer(z + uintptr(1))) != 0); z++ {
if *(*int8)(unsafe.Pointer(z)) != 0 {
- zNeededCollation[crt.PostIncInt32(&i, 1)] = *(*int8)(unsafe.Pointer(z))
+ zNeededCollation[libc.PostIncInt32(&i, 1)] = *(*int8)(unsafe.Pointer(z))
}
}
zNeededCollation[i] = int8(0)
sqlite3.Xsqlite3_create_collation(tls,
- db, ts+14274 /* "test_collate" */, int32((*sqlite31)(unsafe.Pointer(db)).Fenc), uintptr(int64(enc)), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ db, ts+15985 /* "test_collate" */, int32((*sqlite31)(unsafe.Pointer(db)).Fenc), uintptr(intptr_t(enc)), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{test_collate_func})))
}
// Usage: add_test_collate_needed DB
-func test_collate_needed(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3157:26: */
+func test_collate_needed(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3157:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -41350,7 +45823,7 @@ __1:
__2:
;
rc = sqlite3.Xsqlite3_collation_needed16(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr)
}{test_collate_needed_cb})))
zNeededCollation[0] = int8(0)
if !(sqlite3TestErrCode(tls, interp, *(*uintptr)(unsafe.Pointer(bp /* db */)), rc) != 0) {
@@ -41379,7 +45852,7 @@ bad_args:
// Both collating functions increment the unaligned utf16 counter
// whenever they see a string that begins on an odd byte boundary.
var unaligned_string_counter int32 = 0 /* test1.c:3192:12 */
-func alignmentCollFunc(tls *crt.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* test1.c:3193:12: */
+func alignmentCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* test1.c:3193:12: */
var rc int32
var n int32
if nKey1 < nKey2 {
@@ -41393,13 +45866,13 @@ func alignmentCollFunc(tls *crt.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr
if (nKey2 > 0) && (1 == (1 & (int32(pKey2)))) {
unaligned_string_counter++
}
- rc = crt.Xmemcmp(tls, pKey1, pKey2, uint64(n))
+ rc = libc.Xmemcmp(tls, pKey1, pKey2, uint64(n))
if rc == 0 {
rc = (nKey1 - nKey2)
}
return rc
}
-func add_alignment_test_collations(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3208:26: */
+func add_alignment_test_collations(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3208:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -41409,13 +45882,13 @@ func add_alignment_test_collations(tls *crt.TLS, clientData uintptr, interp uint
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
return 1
}
- sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+14353 /* "utf16_unaligned" */, 4,
+ sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+16064 /* "utf16_unaligned" */, 4,
uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{alignmentCollFunc})))
- sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+14369 /* "utf16_aligned" */, 8,
+ sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+16080 /* "utf16_aligned" */, 8,
uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{alignmentCollFunc})))
}
return 0
@@ -41444,68 +45917,68 @@ func add_alignment_test_collations(tls *crt.TLS, clientData uintptr, interp uint
// is passed to SQLite using UTF-16BE for a UTF-8 test_function(), UTF-8
// for a UTF-16LE test_function(), and UTF-16LE for an implementation that
// prefers UTF-16BE.
-func test_function_utf8(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test1.c:3252:13: */
+func test_function_utf8(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test1.c:3252:13: */
var interp uintptr
var pX uintptr
var pVal uintptr
interp = sqlite3.Xsqlite3_user_data(tls, pCtx)
- pX = tcl.XTcl_NewStringObj(tls, ts+14383 /* "test_function" */, -1)
+ pX = tcl.XTcl_NewStringObj(tls, ts+16094 /* "test_function" */, -1)
(*Tcl_Obj)(unsafe.Pointer(pX)).FrefCount++
- tcl.XTcl_ListObjAppendElement(tls, interp, pX, tcl.XTcl_NewStringObj(tls, ts+14287 /* "UTF-8" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pX, tcl.XTcl_NewStringObj(tls, ts+15998 /* "UTF-8" */, -1))
tcl.XTcl_ListObjAppendElement(tls, interp, pX,
tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))), -1))
tcl.XTcl_EvalObjEx(tls, interp, pX, 0)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pX
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
- sqlite3.Xsqlite3_result_text(tls, pCtx, tcl.XTcl_GetStringResult(tls, interp), -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, pCtx, tcl.XTcl_GetStringResult(tls, interp), -1, libc.UintptrFromInt32(-1))
pVal = sqlite3.Xsqlite3ValueNew(tls, uintptr(0))
sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, tcl.XTcl_GetStringResult(tls, interp),
uint8(1), uintptr(0))
sqlite3.Xsqlite3_result_text16be(tls, pCtx, sqlite3.Xsqlite3_value_text16be(tls, pVal),
- -1, crt.UintptrFromInt32(-1))
+ -1, libc.UintptrFromInt32(-1))
sqlite3.Xsqlite3ValueFree(tls, pVal)
}
-func test_function_utf16le(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test1.c:3276:13: */
+func test_function_utf16le(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test1.c:3276:13: */
var interp uintptr
var pX uintptr
var pVal uintptr
interp = sqlite3.Xsqlite3_user_data(tls, pCtx)
- pX = tcl.XTcl_NewStringObj(tls, ts+14383 /* "test_function" */, -1)
+ pX = tcl.XTcl_NewStringObj(tls, ts+16094 /* "test_function" */, -1)
(*Tcl_Obj)(unsafe.Pointer(pX)).FrefCount++
- tcl.XTcl_ListObjAppendElement(tls, interp, pX, tcl.XTcl_NewStringObj(tls, ts+14293 /* "UTF-16LE" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pX, tcl.XTcl_NewStringObj(tls, ts+16004 /* "UTF-16LE" */, -1))
tcl.XTcl_ListObjAppendElement(tls, interp, pX,
tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))), -1))
tcl.XTcl_EvalObjEx(tls, interp, pX, 0)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pX
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
pVal = sqlite3.Xsqlite3ValueNew(tls, uintptr(0))
sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, tcl.XTcl_GetStringResult(tls, interp),
uint8(1), uintptr(0))
- sqlite3.Xsqlite3_result_text(tls, pCtx, sqlite3.Xsqlite3_value_text(tls, pVal), -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, pCtx, sqlite3.Xsqlite3_value_text(tls, pVal), -1, libc.UintptrFromInt32(-1))
sqlite3.Xsqlite3ValueFree(tls, pVal)
}
-func test_function_utf16be(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test1.c:3298:13: */
+func test_function_utf16be(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test1.c:3298:13: */
var interp uintptr
var pX uintptr
var pVal uintptr
interp = sqlite3.Xsqlite3_user_data(tls, pCtx)
- pX = tcl.XTcl_NewStringObj(tls, ts+14383 /* "test_function" */, -1)
+ pX = tcl.XTcl_NewStringObj(tls, ts+16094 /* "test_function" */, -1)
(*Tcl_Obj)(unsafe.Pointer(pX)).FrefCount++
- tcl.XTcl_ListObjAppendElement(tls, interp, pX, tcl.XTcl_NewStringObj(tls, ts+14302 /* "UTF-16BE" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pX, tcl.XTcl_NewStringObj(tls, ts+16013 /* "UTF-16BE" */, -1))
tcl.XTcl_ListObjAppendElement(tls, interp, pX,
tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))), -1))
tcl.XTcl_EvalObjEx(tls, interp, pX, 0)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pX
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -41513,14 +45986,14 @@ func test_function_utf16be(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr)
sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, tcl.XTcl_GetStringResult(tls, interp),
uint8(1), uintptr(0))
sqlite3.Xsqlite3_result_text16(tls, pCtx, sqlite3.Xsqlite3_value_text16le(tls, pVal),
- -1, crt.UintptrFromInt32(-1))
+ -1, libc.UintptrFromInt32(-1))
sqlite3.Xsqlite3_result_text16be(tls, pCtx, sqlite3.Xsqlite3_value_text16le(tls, pVal),
- -1, crt.UintptrFromInt32(-1))
+ -1, libc.UintptrFromInt32(-1))
sqlite3.Xsqlite3_result_text16le(tls, pCtx, sqlite3.Xsqlite3_value_text16le(tls, pVal),
- -1, crt.UintptrFromInt32(-1))
+ -1, libc.UintptrFromInt32(-1))
sqlite3.Xsqlite3ValueFree(tls, pVal)
}
-func test_function(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3326:26: */
+func test_function(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3326:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -41550,9 +46023,9 @@ __3:
if !(*(*int32)(unsafe.Pointer(bp + 40 /* val */)) != 0) {
goto __4
}
- sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14383 /* "test_function" */, 1, 1,
+ sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+16094 /* "test_function" */, 1, 1,
interp, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{test_function_utf8})), uintptr(0), uintptr(0))
__4:
;
@@ -41565,9 +46038,9 @@ __5:
if !(*(*int32)(unsafe.Pointer(bp + 40 /* val */)) != 0) {
goto __6
}
- sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14383 /* "test_function" */, 1, 2,
+ sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+16094 /* "test_function" */, 1, 2,
interp, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{test_function_utf16le})), uintptr(0), uintptr(0))
__6:
;
@@ -41580,17 +46053,17 @@ __7:
if !(*(*int32)(unsafe.Pointer(bp + 40 /* val */)) != 0) {
goto __8
}
- sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+14383 /* "test_function" */, 1, 3,
+ sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+16094 /* "test_function" */, 1, 3,
interp, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{test_function_utf16be})), uintptr(0), uintptr(0))
__8:
;
return 0
bad_args:
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14311 /* " <DB> <utf8> <ut..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+16022 /* " <DB> <utf8> <ut..." */, 0))
return 1
}
@@ -41600,16 +46073,16 @@ bad_args:
// are sane. The parameter is an integer representing an sqlite error code.
// The result is a list of two elements, the string representation of the
// error code and the english language explanation.
-func test_errstr(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3371:26: */
+func test_errstr(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3371:26: */
var zCode uintptr
var i int32
if objc != 1 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14397 /* "<error code>" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16108 /* "<error code>" */)
}
zCode = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
for i = 0; i < 200; i++ {
- if 0 == crt.Xstrcmp(tls, sqlite3.Xsqlite3ErrName(tls, i), zCode) {
+ if 0 == libc.Xstrcmp(tls, sqlite3.Xsqlite3ErrName(tls, i), zCode) {
break
}
}
@@ -41628,7 +46101,7 @@ func test_errstr(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
//
// Then run testfixture in the debugger and wait for the breakpoint to
// fire. Then additional breakpoints can be set to trace down the bug.
-func test_breakpoint(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:3404:26: */
+func test_breakpoint(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:3404:26: */
return 0 // Do nothing
}
@@ -41637,7 +46110,7 @@ func test_breakpoint(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
// Test the sqlite3_bind_zeroblob interface. STMT is a prepared statement.
// IDX is the index of a wildcard in the prepared statement. This command
// binds a N-byte zero-filled BLOB to the wildcard.
-func test_bind_zeroblob(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3420:26: */
+func test_bind_zeroblob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3420:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -41650,7 +46123,7 @@ func test_bind_zeroblob(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
var rc int32
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14410 /* "STMT IDX N" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16121 /* "STMT IDX N" */)
return 1
}
@@ -41680,7 +46153,7 @@ func test_bind_zeroblob(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// Test the sqlite3_bind_zeroblob64 interface. STMT is a prepared statement.
// IDX is the index of a wildcard in the prepared statement. This command
// binds a N-byte zero-filled BLOB to the wildcard.
-func test_bind_zeroblob64(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3456:26: */
+func test_bind_zeroblob64(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3456:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -41693,7 +46166,7 @@ func test_bind_zeroblob64(tls *crt.TLS, clientData uintptr, interp uintptr, objc
var rc int32
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14410 /* "STMT IDX N" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16121 /* "STMT IDX N" */)
return 1
}
@@ -41712,7 +46185,7 @@ func test_bind_zeroblob64(tls *crt.TLS, clientData uintptr, interp uintptr, objc
return 1
}
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
@@ -41724,7 +46197,7 @@ func test_bind_zeroblob64(tls *crt.TLS, clientData uintptr, interp uintptr, objc
// Test the sqlite3_bind_int interface. STMT is a prepared statement.
// N is the index of a wildcard in the prepared statement. This command
// binds a 32-bit integer VALUE to that wildcard.
-func test_bind_int(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3493:26: */
+func test_bind_int(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3493:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -41737,8 +46210,8 @@ func test_bind_int(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
var rc int32
if objc != 4 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14421 /* " STMT N VALUE" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+16132 /* " STMT N VALUE" */, 0))
return 1
}
@@ -41770,7 +46243,7 @@ func test_bind_int(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
// Space to hold the array is obtained from malloc(). Call this procedure once
// with no arguments in order to release memory. Each call to this procedure
// overwrites the previous array.
-func test_intarray_addr(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3533:26: */
+func test_intarray_addr(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3533:26: */
var i int32
sqlite3.Xsqlite3_free(tls, p)
@@ -41800,7 +46273,7 @@ var p uintptr = uintptr(0) /* test1.c:3540:14 */
// Space to hold the array is obtained from malloc(). Call this procedure once
// with no arguments in order to release memory. Each call to this procedure
// overwrites the previous array.
-func test_int64array_addr(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3567:26: */
+func test_int64array_addr(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3567:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -41836,7 +46309,7 @@ var p1 uintptr = uintptr(0) /* test1.c:3574:24 */
// Space to hold the array is obtained from malloc(). Call this procedure once
// with no arguments in order to release memory. Each call to this procedure
// overwrites the previous array.
-func test_doublearray_addr(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3603:26: */
+func test_doublearray_addr(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3603:26: */
var i int32
sqlite3.Xsqlite3_free(tls, p2)
@@ -41866,7 +46339,7 @@ var p2 uintptr = uintptr(0) /* test1.c:3610:17 */
// Space to hold the array is obtained from malloc(). Call this procedure once
// with no arguments in order to release memory. Each call to this procedure
// overwrites the previous array.
-func test_textarray_addr(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3637:26: */
+func test_textarray_addr(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3637:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -41883,7 +46356,7 @@ func test_textarray_addr(tls *crt.TLS, clientData uintptr, interp uintptr, objc
return 1
}
for i = 0; i < (objc - 1); i++ {
- *(*uintptr)(unsafe.Pointer(p3 + uintptr(i)*8)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr((1+i))*8)))))
+ *(*uintptr)(unsafe.Pointer(p3 + uintptr(i)*8)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr((1+i))*8)))))
}
}
n = (objc - 1)
@@ -41899,7 +46372,7 @@ var p3 uintptr = uintptr(0) /* test1.c:3645:15 */
// Test the sqlite3_bind_int64 interface. STMT is a prepared statement.
// N is the index of a wildcard in the prepared statement. This command
// binds a 64-bit integer VALUE to that wildcard.
-func test_bind_int64(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3670:26: */
+func test_bind_int64(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3670:26: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -41912,8 +46385,8 @@ func test_bind_int64(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
var rc int32
if objc != 4 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14421 /* " STMT N VALUE" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+16132 /* " STMT N VALUE" */, 0))
return 1
}
@@ -41943,7 +46416,7 @@ func test_bind_int64(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
// Test the sqlite3_bind_double interface. STMT is a prepared statement.
// N is the index of a wildcard in the prepared statement. This command
// binds a 64-bit integer VALUE to that wildcard.
-func test_bind_double(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3708:26: */
+func test_bind_double(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3708:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -41957,8 +46430,8 @@ func test_bind_double(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
var i int32
if objc != 4 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14421 /* " STMT N VALUE" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+16132 /* " STMT N VALUE" */, 0))
return 1
}
@@ -41979,14 +46452,14 @@ func test_bind_double(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
FiUpper uint32
FiLower uint32
}{}))); i++ {
- if crt.Xstrcmp(tls, aSpecialFp[i].FzName, zVal) == 0 {
+ if libc.Xstrcmp(tls, aSpecialFp[i].FzName, zVal) == 0 {
// var x sqlite3_uint64 at bp+56, 8
*(*sqlite3_uint64)(unsafe.Pointer(bp + 56 /* x */)) = sqlite3_uint64(aSpecialFp[i].FiUpper)
*(*sqlite3_uint64)(unsafe.Pointer(bp + 56 /* x */)) <<= 32
*(*sqlite3_uint64)(unsafe.Pointer(bp + 56 /* x */)) |= sqlite3_uint64(aSpecialFp[i].FiLower)
- crt.Xmemcpy(tls, bp+48 /* &value */, bp+56 /* &x */, uint64(8))
+ libc.Xmemcpy(tls, bp+48 /* &value */, bp+56 /* &x */, uint64(8))
break
}
}
@@ -42013,16 +46486,16 @@ var aSpecialFp = [10]struct {
FiUpper uint32
FiLower uint32
}{
- {FzName: ts + 14435 /* "NaN" */, FiUpper: uint32(0x7fffffff), FiLower: 0xffffffff},
- {FzName: ts + 14439 /* "SNaN" */, FiUpper: uint32(0x7ff7ffff), FiLower: 0xffffffff},
- {FzName: ts + 14444 /* "-NaN" */, FiUpper: 0xffffffff, FiLower: 0xffffffff},
- {FzName: ts + 14449 /* "-SNaN" */, FiUpper: 0xfff7ffff, FiLower: 0xffffffff},
- {FzName: ts + 14455 /* "+Inf" */, FiUpper: uint32(0x7ff00000), FiLower: uint32(0x00000000)},
- {FzName: ts + 14460 /* "-Inf" */, FiUpper: 0xfff00000, FiLower: uint32(0x00000000)},
- {FzName: ts + 14465 /* "Epsilon" */, FiUpper: uint32(0x00000000), FiLower: uint32(0x00000001)},
- {FzName: ts + 14473 /* "-Epsilon" */, FiUpper: 0x80000000, FiLower: uint32(0x00000001)},
- {FzName: ts + 14482 /* "NaN0" */, FiUpper: uint32(0x7ff80000), FiLower: uint32(0x00000000)},
- {FzName: ts + 14487 /* "-NaN0" */, FiUpper: 0xfff80000, FiLower: uint32(0x00000000)},
+ {FzName: ts + 16146 /* "NaN" */, FiUpper: uint32(0x7fffffff), FiLower: 0xffffffff},
+ {FzName: ts + 16150 /* "SNaN" */, FiUpper: uint32(0x7ff7ffff), FiLower: 0xffffffff},
+ {FzName: ts + 16155 /* "-NaN" */, FiUpper: 0xffffffff, FiLower: 0xffffffff},
+ {FzName: ts + 16160 /* "-SNaN" */, FiUpper: 0xfff7ffff, FiLower: 0xffffffff},
+ {FzName: ts + 16166 /* "+Inf" */, FiUpper: uint32(0x7ff00000), FiLower: uint32(0x00000000)},
+ {FzName: ts + 16171 /* "-Inf" */, FiUpper: 0xfff00000, FiLower: uint32(0x00000000)},
+ {FzName: ts + 16176 /* "Epsilon" */, FiUpper: uint32(0x00000000), FiLower: uint32(0x00000001)},
+ {FzName: ts + 16184 /* "-Epsilon" */, FiUpper: 0x80000000, FiLower: uint32(0x00000001)},
+ {FzName: ts + 16193 /* "NaN0" */, FiUpper: uint32(0x7ff80000), FiLower: uint32(0x00000000)},
+ {FzName: ts + 16198 /* "-NaN0" */, FiUpper: 0xfff80000, FiLower: uint32(0x00000000)},
} /* test1.c:3724:5 */
// Usage: sqlite3_bind_null STMT N
@@ -42030,7 +46503,7 @@ var aSpecialFp = [10]struct {
// Test the sqlite3_bind_null interface. STMT is a prepared statement.
// N is the index of a wildcard in the prepared statement. This command
// binds a NULL to the wildcard.
-func test_bind_null(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3784:26: */
+func test_bind_null(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3784:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -42041,8 +46514,8 @@ func test_bind_null(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
var rc int32
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14493 /* " STMT N" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+16204 /* " STMT N" */, 0))
return 1
}
@@ -42070,7 +46543,7 @@ func test_bind_null(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// N is the index of a wildcard in the prepared statement. This command
// binds a UTF-8 string STRING to the wildcard. The string is BYTES bytes
// long.
-func test_bind_text(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3820:26: */
+func test_bind_text(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3820:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -42084,8 +46557,8 @@ func test_bind_text(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
var rc int32
if objc != 5 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14501 /* " STMT N VALUE BY..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+16212 /* " STMT N VALUE BY..." */, 0))
return 1
}
@@ -42100,12 +46573,12 @@ func test_bind_text(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
return 1
}
- rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 56 /* idx */)), value, *(*int32)(unsafe.Pointer(bp + 60 /* bytes */)), crt.UintptrFromInt32(-1))
+ rc = sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 56 /* idx */)), value, *(*int32)(unsafe.Pointer(bp + 60 /* bytes */)), libc.UintptrFromInt32(-1))
if sqlite3TestErrCode(tls, interp, sqlite3.Xsqlite3_db_handle(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* pStmt */))), rc) != 0 {
return 1
}
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
@@ -42118,7 +46591,7 @@ func test_bind_text(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// N is the index of a wildcard in the prepared statement. This command
// binds a UTF-16 string STRING to the wildcard. The string is BYTES bytes
// long.
-func test_bind_text16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3861:26: */
+func test_bind_text16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3861:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -42135,7 +46608,7 @@ func test_bind_text16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
if objc == 6 {
return uintptr(0)
}
- return crt.UintptrFromInt32(-1)
+ return libc.UintptrFromInt32(-1)
}()
var oStmt uintptr = *(*uintptr)(unsafe.Pointer(objv + uintptr((objc-4))*8))
var oN uintptr = *(*uintptr)(unsafe.Pointer(objv + uintptr((objc-3))*8))
@@ -42143,8 +46616,8 @@ func test_bind_text16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
var oBytes uintptr = *(*uintptr)(unsafe.Pointer(objv + uintptr((objc-1))*8))
if (objc != 5) && (objc != 6) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14501 /* " STMT N VALUE BY..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+16212 /* " STMT N VALUE BY..." */, 0))
return 1
}
@@ -42164,7 +46637,7 @@ func test_bind_text16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
return 1
}
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
@@ -42176,7 +46649,7 @@ func test_bind_text16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
// Test the sqlite3_bind_blob interface. STMT is a prepared statement.
// N is the index of a wildcard in the prepared statement. This command
// binds a BLOB to the wildcard. The BLOB is BYTES bytes in size.
-func test_bind_blob(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3909:26: */
+func test_bind_blob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3909:26: */
bp := tls.Alloc(284)
defer tls.Free(284)
@@ -42190,11 +46663,11 @@ func test_bind_blob(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
var value uintptr
var rc int32
- var xDestructor sqlite3_destructor_type = crt.UintptrFromInt32(-1)
+ var xDestructor sqlite3_destructor_type = libc.UintptrFromInt32(-1)
if (objc != 5) && (objc != 6) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14521 /* " STMT N DATA BYT..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+16232 /* " STMT N DATA BYT..." */, 0))
return 1
}
@@ -42219,8 +46692,8 @@ func test_bind_blob(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// var zBuf [200]int8 at bp+84, 200
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+84, /* &zBuf[0] */
- ts+14540 /* "cannot use %d bl..." */, crt.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 80 /* bytes */)), *(*int32)(unsafe.Pointer(bp + 76 /* len */))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, bp+84 /* &zBuf[0] */, -1))
+ ts+16251 /* "cannot use %d bl..." */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 80 /* bytes */)), *(*int32)(unsafe.Pointer(bp + 76 /* len */))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, bp+84 /* &zBuf[0] */, -1))
return 1
}
@@ -42238,14 +46711,14 @@ func test_bind_blob(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// Usage: sqlite3_bind_parameter_count STMT
//
// Return the number of wildcards in the given statement.
-func test_bind_parameter_count(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3961:26: */
+func test_bind_parameter_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3961:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
// var pStmt uintptr at bp, 8
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14574 /* "STMT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16285 /* "STMT" */)
return 1
}
if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &pStmt */) != 0 {
@@ -42260,7 +46733,7 @@ func test_bind_parameter_count(tls *crt.TLS, clientData uintptr, interp uintptr,
// Return the name of the Nth wildcard. The first wildcard is 1.
// An empty string is returned if N is out of range or if the wildcard
// is nameless.
-func test_bind_parameter_name(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3985:26: */
+func test_bind_parameter_name(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:3985:26: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -42269,7 +46742,7 @@ func test_bind_parameter_name(tls *crt.TLS, clientData uintptr, interp uintptr,
// var i int32 at bp+8, 4
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14579 /* "STMT N" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16290 /* "STMT N" */)
return 1
}
if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &pStmt */) != 0 {
@@ -42287,14 +46760,14 @@ func test_bind_parameter_name(tls *crt.TLS, clientData uintptr, interp uintptr,
//
// Return the index of the wildcard called NAME. Return 0 if there is
// no such wildcard.
-func test_bind_parameter_index(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4012:26: */
+func test_bind_parameter_index(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4012:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
// var pStmt uintptr at bp, 8
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14586 /* "STMT NAME" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16297 /* "STMT NAME" */)
return 1
}
if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &pStmt */) != 0 {
@@ -42308,14 +46781,14 @@ func test_bind_parameter_index(tls *crt.TLS, clientData uintptr, interp uintptr,
// Usage: sqlite3_clear_bindings STMT
//
-func test_clear_bindings(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4037:26: */
+func test_clear_bindings(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4037:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
// var pStmt uintptr at bp, 8
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14574 /* "STMT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16285 /* "STMT" */)
return 1
}
if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &pStmt */) != 0 {
@@ -42326,14 +46799,14 @@ func test_clear_bindings(tls *crt.TLS, clientData uintptr, interp uintptr, objc
}
// Usage: sqlite3_sleep MILLISECONDS
-func test_sleep(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4057:26: */
+func test_sleep(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4057:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
// var ms int32 at bp, 4
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10978 /* "MILLISECONDS" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+12628 /* "MILLISECONDS" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &ms */) != 0 {
@@ -42347,7 +46820,7 @@ func test_sleep(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, ob
//
// Return the string representation of the most recent sqlite3_* API
// error code. e.g. "SQLITE_ERROR".
-func test_ex_errcode(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4082:26: */
+func test_ex_errcode(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4082:26: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -42356,15 +46829,15 @@ func test_ex_errcode(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
var rc int32
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+48 /* &db */) != 0 {
return 1
}
rc = sqlite3.Xsqlite3_extended_errcode(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 0
}
@@ -42372,7 +46845,7 @@ func test_ex_errcode(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
//
// Return the string representation of the most recent sqlite3_* API
// error code. e.g. "SQLITE_ERROR".
-func test_errcode(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4109:26: */
+func test_errcode(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4109:26: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -42381,15 +46854,15 @@ func test_errcode(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
var rc int32
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+48 /* &db */) != 0 {
return 1
}
rc = sqlite3.Xsqlite3_errcode(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 0
}
@@ -42397,7 +46870,7 @@ func test_errcode(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
//
// Returns the UTF-8 representation of the error message string for the
// most recent sqlite3_* API call.
-func test_errmsg(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4135:26: */
+func test_errmsg(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4135:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -42406,8 +46879,8 @@ func test_errmsg(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
var zErr uintptr
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+32 /* &db */) != 0 {
@@ -42425,7 +46898,7 @@ func test_errmsg(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
// most recent sqlite3_* API call. This is a byte array object at the TCL
// level, and it includes the 0x00 0x00 terminator bytes at the end of the
// UTF-16 string.
-func test_errmsg16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4164:26: */
+func test_errmsg16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4164:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -42436,8 +46909,8 @@ func test_errmsg16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
var bytes int32 = 0
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+32 /* &db */) != 0 {
@@ -42460,7 +46933,7 @@ func test_errmsg16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
// database handle <DB>. The parameter <tailval> is the name of a global
// variable that is set to the unused portion of <sql> (if any). A
// STMT handle is returned.
-func test_prepare(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4201:26: */
+func test_prepare(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4201:26: */
bp := tls.Alloc(162)
defer tls.Free(162)
@@ -42476,8 +46949,8 @@ func test_prepare(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
var rc int32
if (objc != 5) && (objc != 4) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14596 /* " DB sql bytes ?t..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16307 /* " DB sql bytes ?t..." */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+80 /* &db */) != 0 {
@@ -42502,15 +46975,15 @@ func test_prepare(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
if *(*int32)(unsafe.Pointer(bp + 88 /* bytes */)) >= 0 {
*(*int32)(unsafe.Pointer(bp + 88 /* bytes */)) = (*(*int32)(unsafe.Pointer(bp + 88 /* bytes */)) - (int32((int64(*(*uintptr)(unsafe.Pointer(bp + 104 /* zTail */))) - int64(zSql)) / 1)))
}
- if int32(crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 104 /* zTail */)))) < *(*int32)(unsafe.Pointer(bp + 88 /* bytes */)) {
- *(*int32)(unsafe.Pointer(bp + 88 /* bytes */)) = int32(crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 104 /* zTail */))))
+ if int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 104 /* zTail */)))) < *(*int32)(unsafe.Pointer(bp + 88 /* bytes */)) {
+ *(*int32)(unsafe.Pointer(bp + 88 /* bytes */)) = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 104 /* zTail */))))
}
tcl.XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(4)*8)), uintptr(0), tcl.XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(bp + 104 /* zTail */)), *(*int32)(unsafe.Pointer(bp + 88 /* bytes */))), 0)
}
if rc != 0 {
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+14268 /* "(%d) " */, crt.VaList(bp+32, rc))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+112 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+15979 /* "(%d) " */, libc.VaList(bp+32, rc))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+112 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0))
return 1
}
@@ -42518,7 +46991,7 @@ func test_prepare(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
if sqlite3TestMakePointerStr(tls, interp, bp+112 /* &zBuf[0] */, *(*uintptr)(unsafe.Pointer(bp + 96 /* pStmt */))) != 0 {
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+64, bp+112 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, bp+112 /* &zBuf[0] */, 0))
}
return 0
}
@@ -42529,7 +47002,7 @@ func test_prepare(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
// database handle <DB>. The parameter <tailval> is the name of a global
// variable that is set to the unused portion of <sql> (if any). A
// STMT handle is returned.
-func test_prepare_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4258:26: */
+func test_prepare_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4258:26: */
bp := tls.Alloc(162)
defer tls.Free(162)
@@ -42547,8 +47020,8 @@ func test_prepare_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
var rc int32
if (objc != 5) && (objc != 4) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14620 /* " DB sql bytes ta..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16331 /* " DB sql bytes ta..." */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+80 /* &db */) != 0 {
@@ -42563,12 +47036,12 @@ func test_prepare_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
// directly from malloc(). The idea is to make it easier for valgrind
// to spot buffer overreads.
if *(*int32)(unsafe.Pointer(bp + 88 /* bytes */)) >= 0 {
- zCopy = crt.Xmalloc(tls, uint64(*(*int32)(unsafe.Pointer(bp + 88 /* bytes */))))
- crt.Xmemcpy(tls, zCopy, zSql, uint64(*(*int32)(unsafe.Pointer(bp + 88 /* bytes */))))
+ zCopy = libc.Xmalloc(tls, uint64(*(*int32)(unsafe.Pointer(bp + 88 /* bytes */))))
+ libc.Xmemcpy(tls, zCopy, zSql, uint64(*(*int32)(unsafe.Pointer(bp + 88 /* bytes */))))
} else {
- var n int32 = (int32(crt.Xstrlen(tls, zSql)) + 1)
- zCopy = crt.Xmalloc(tls, uint64(n))
- crt.Xmemcpy(tls, zCopy, zSql, uint64(n))
+ var n int32 = (int32(libc.Xstrlen(tls, zSql)) + 1)
+ zCopy = libc.Xmalloc(tls, uint64(n))
+ libc.Xmemcpy(tls, zCopy, zSql, uint64(n))
}
if objc >= 5 {
pzTail = bp + 96 /* &zTail */
@@ -42579,7 +47052,7 @@ func test_prepare_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
if objc >= 5 {
*(*uintptr)(unsafe.Pointer(bp + 96 /* zTail */)) = (zSql + uintptr(((int64(*(*uintptr)(unsafe.Pointer(bp + 96 /* zTail */))) - int64(zCopy)) / 1)))
}
- crt.Xfree(tls, zCopy)
+ libc.Xfree(tls, zCopy)
tcl.XTcl_ResetResult(tls, interp)
if sqlite3TestErrCode(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */)), rc) != 0 {
@@ -42593,8 +47066,8 @@ func test_prepare_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
}
if rc != 0 {
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+14268 /* "(%d) " */, crt.VaList(bp+32, rc))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+112 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+15979 /* "(%d) " */, libc.VaList(bp+32, rc))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+112 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0))
return 1
}
@@ -42602,7 +47075,7 @@ func test_prepare_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
if sqlite3TestMakePointerStr(tls, interp, bp+112 /* &zBuf[0] */, *(*uintptr)(unsafe.Pointer(bp + 104 /* pStmt */))) != 0 {
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+64, bp+112 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, bp+112 /* &zBuf[0] */, 0))
}
return 0
}
@@ -42613,7 +47086,7 @@ func test_prepare_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
// database handle <DB> and flags <flags>. The parameter <tailval> is
// the name of a global variable that is set to the unused portion of
// <sql> (if any). A STMT handle is returned.
-func test_prepare_v3(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4332:26: */
+func test_prepare_v3(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4332:26: */
bp := tls.Alloc(162)
defer tls.Free(162)
@@ -42633,8 +47106,8 @@ func test_prepare_v3(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
var rc int32
if (objc != 6) && (objc != 5) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14642 /* " DB sql bytes fl..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16353 /* " DB sql bytes fl..." */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+80 /* &db */) != 0 {
@@ -42652,12 +47125,12 @@ func test_prepare_v3(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
// directly from malloc(). The idea is to make it easier for valgrind
// to spot buffer overreads.
if *(*int32)(unsafe.Pointer(bp + 88 /* bytes */)) >= 0 {
- zCopy = crt.Xmalloc(tls, uint64(*(*int32)(unsafe.Pointer(bp + 88 /* bytes */))))
- crt.Xmemcpy(tls, zCopy, zSql, uint64(*(*int32)(unsafe.Pointer(bp + 88 /* bytes */))))
+ zCopy = libc.Xmalloc(tls, uint64(*(*int32)(unsafe.Pointer(bp + 88 /* bytes */))))
+ libc.Xmemcpy(tls, zCopy, zSql, uint64(*(*int32)(unsafe.Pointer(bp + 88 /* bytes */))))
} else {
- var n int32 = (int32(crt.Xstrlen(tls, zSql)) + 1)
- zCopy = crt.Xmalloc(tls, uint64(n))
- crt.Xmemcpy(tls, zCopy, zSql, uint64(n))
+ var n int32 = (int32(libc.Xstrlen(tls, zSql)) + 1)
+ zCopy = libc.Xmalloc(tls, uint64(n))
+ libc.Xmemcpy(tls, zCopy, zSql, uint64(n))
}
if objc >= 6 {
pzTail = bp + 96 /* &zTail */
@@ -42665,7 +47138,7 @@ func test_prepare_v3(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
pzTail = uintptr(0)
}
rc = sqlite3.Xsqlite3_prepare_v3(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */)), zCopy, *(*int32)(unsafe.Pointer(bp + 88 /* bytes */)), uint32(*(*int32)(unsafe.Pointer(bp + 92 /* flags */))), bp+104 /* &pStmt */, pzTail)
- crt.Xfree(tls, zCopy)
+ libc.Xfree(tls, zCopy)
*(*uintptr)(unsafe.Pointer(bp + 96 /* zTail */)) = (zSql + uintptr(((int64(*(*uintptr)(unsafe.Pointer(bp + 96 /* zTail */))) - int64(zCopy)) / 1)))
tcl.XTcl_ResetResult(tls, interp)
@@ -42680,8 +47153,8 @@ func test_prepare_v3(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
}
if rc != 0 {
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+14268 /* "(%d) " */, crt.VaList(bp+32, rc))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+112 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+15979 /* "(%d) " */, libc.VaList(bp+32, rc))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+112 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0))
return 1
}
@@ -42689,7 +47162,7 @@ func test_prepare_v3(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
if sqlite3TestMakePointerStr(tls, interp, bp+112 /* &zBuf[0] */, *(*uintptr)(unsafe.Pointer(bp + 104 /* pStmt */))) != 0 {
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+64, bp+112 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, bp+112 /* &zBuf[0] */, 0))
}
return 0
}
@@ -42698,7 +47171,7 @@ func test_prepare_v3(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
//
// Generate a prepared statement for a zero-byte string as a test
// for ticket #3134. The string should be preceded by a zero byte.
-func test_prepare_tkt3134(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4403:26: */
+func test_prepare_tkt3134(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4403:26: */
bp := tls.Alloc(146)
defer tls.Free(146)
@@ -42710,8 +47183,8 @@ func test_prepare_tkt3134(tls *crt.TLS, clientData uintptr, interp uintptr, objc
var rc int32
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14620 /* " DB sql bytes ta..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16331 /* " DB sql bytes ta..." */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+80 /* &db */) != 0 {
@@ -42724,8 +47197,8 @@ func test_prepare_tkt3134(tls *crt.TLS, clientData uintptr, interp uintptr, objc
}
if rc != 0 {
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+96 /* &zBuf[0] */, ts+14268 /* "(%d) " */, crt.VaList(bp+32, rc))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+96 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+96 /* &zBuf[0] */, ts+15979 /* "(%d) " */, libc.VaList(bp+32, rc))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+96 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0))
return 1
}
@@ -42733,12 +47206,12 @@ func test_prepare_tkt3134(tls *crt.TLS, clientData uintptr, interp uintptr, objc
if sqlite3TestMakePointerStr(tls, interp, bp+96 /* &zBuf[0] */, *(*uintptr)(unsafe.Pointer(bp + 88 /* pStmt */))) != 0 {
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+64, bp+96 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, bp+96 /* &zBuf[0] */, 0))
}
return 0
}
-var zSql = *(*[10]int8)(unsafe.Pointer(ts + 14670 /* "\x00SELECT 1" */)) /* test1.c:4410:21 */
+var zSql = *(*[10]int8)(unsafe.Pointer(ts + 16381 /* "\x00SELECT 1" */)) /* test1.c:4410:21 */
// Usage: sqlite3_prepare16 DB sql bytes tailvar
//
@@ -42746,7 +47219,7 @@ var zSql = *(*[10]int8)(unsafe.Pointer(ts + 14670 /* "\x00SELECT 1" */)) /* test
// database handle <DB>. The parameter <tailval> is the name of a global
// variable that is set to the unused portion of <sql> (if any). A
// STMT handle is returned.
-func test_prepare16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4446:26: */
+func test_prepare16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4446:26: */
bp := tls.Alloc(130)
defer tls.Free(130)
@@ -42765,8 +47238,8 @@ func test_prepare16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// The byte-array length of arg 2
if (objc != 5) && (objc != 4) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14596 /* " DB sql bytes ?t..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16307 /* " DB sql bytes ?t..." */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+48 /* &db */) != 0 {
@@ -42801,7 +47274,7 @@ func test_prepare16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
tcl.XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(4)*8)), uintptr(0), pTail, 0)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pTail
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -42812,7 +47285,7 @@ func test_prepare16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
return 1
}
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, bp+80 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, bp+80 /* &zBuf[0] */, 0))
return 0
}
@@ -42822,7 +47295,7 @@ func test_prepare16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// database handle <DB>. The parameter <tailval> is the name of a global
// variable that is set to the unused portion of <sql> (if any). A
// STMT handle is returned.
-func test_prepare16_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4506:26: */
+func test_prepare16_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4506:26: */
bp := tls.Alloc(130)
defer tls.Free(130)
@@ -42841,8 +47314,8 @@ func test_prepare16_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
// The byte-array length of arg 2
if (objc != 5) && (objc != 4) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14596 /* " DB sql bytes ?t..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16307 /* " DB sql bytes ?t..." */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+48 /* &db */) != 0 {
@@ -42877,7 +47350,7 @@ func test_prepare16_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
tcl.XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(4)*8)), uintptr(0), pTail, 0)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pTail
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -42888,12 +47361,12 @@ func test_prepare16_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
return 1
}
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, bp+80 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, bp+80 /* &zBuf[0] */, 0))
return 0
}
// Usage: sqlite3_open filename ?options-list?
-func test_open(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4561:26: */
+func test_open(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4561:26: */
bp := tls.Alloc(156)
defer tls.Free(156)
@@ -42903,8 +47376,8 @@ func test_open(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, obj
// var zBuf [100]int8 at bp+56, 100
if ((objc != 3) && (objc != 2)) && (objc != 1) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14680 /* " filename option..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16391 /* " filename option..." */, 0))
return 1
}
@@ -42918,12 +47391,12 @@ func test_open(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, obj
if sqlite3TestMakePointerStr(tls, interp, bp+56 /* &zBuf[0] */, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */))) != 0 {
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, bp+56 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, bp+56 /* &zBuf[0] */, 0))
return 0
}
// Usage: sqlite3_open_v2 FILENAME FLAGS VFS
-func test_open_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4588:26: */
+func test_open_v2(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4588:26: */
bp := tls.Alloc(468)
defer tls.Free(468)
@@ -42942,7 +47415,7 @@ func test_open_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
var i int32
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14703 /* "FILENAME FLAGS V..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16414 /* "FILENAME FLAGS V..." */)
return 1
}
zFilename = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -42959,29 +47432,29 @@ func test_open_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
// var iFlag int32 at bp+352, 4
*(*[20]OpenFlag)(unsafe.Pointer(bp + 32 /* aFlag */)) = [20]OpenFlag{
- {FzFlag: ts + 14722 /* "SQLITE_OPEN_READ..." */, Fflag: 0x00000001},
- {FzFlag: ts + 14743 /* "SQLITE_OPEN_READ..." */, Fflag: 0x00000002},
- {FzFlag: ts + 14765 /* "SQLITE_OPEN_CREA..." */, Fflag: 0x00000004},
- {FzFlag: ts + 14784 /* "SQLITE_OPEN_DELE..." */, Fflag: 0x00000008},
- {FzFlag: ts + 14810 /* "SQLITE_OPEN_EXCL..." */, Fflag: 0x00000010},
- {FzFlag: ts + 14832 /* "SQLITE_OPEN_AUTO..." */, Fflag: 0x00000020},
- {FzFlag: ts + 14854 /* "SQLITE_OPEN_MAIN..." */, Fflag: 0x00000100},
- {FzFlag: ts + 14874 /* "SQLITE_OPEN_TEMP..." */, Fflag: 0x00000200},
- {FzFlag: ts + 14894 /* "SQLITE_OPEN_TRAN..." */, Fflag: 0x00000400},
- {FzFlag: ts + 14919 /* "SQLITE_OPEN_MAIN..." */, Fflag: 0x00000800},
- {FzFlag: ts + 14944 /* "SQLITE_OPEN_TEMP..." */, Fflag: 0x00001000},
- {FzFlag: ts + 14969 /* "SQLITE_OPEN_SUBJ..." */, Fflag: 0x00002000},
- {FzFlag: ts + 14992 /* "SQLITE_OPEN_MAST..." */, Fflag: 0x00004000},
- {FzFlag: ts + 15019 /* "SQLITE_OPEN_NOMU..." */, Fflag: 0x00008000},
- {FzFlag: ts + 15039 /* "SQLITE_OPEN_FULL..." */, Fflag: 0x00010000},
- {FzFlag: ts + 15061 /* "SQLITE_OPEN_SHAR..." */, Fflag: 0x00020000},
- {FzFlag: ts + 15085 /* "SQLITE_OPEN_PRIV..." */, Fflag: 0x00040000},
- {FzFlag: ts + 15110 /* "SQLITE_OPEN_WAL" */, Fflag: 0x00080000},
- {FzFlag: ts + 15126 /* "SQLITE_OPEN_URI" */, Fflag: 0x00000040},
+ {FzFlag: ts + 16433 /* "SQLITE_OPEN_READ..." */, Fflag: 0x00000001},
+ {FzFlag: ts + 16454 /* "SQLITE_OPEN_READ..." */, Fflag: 0x00000002},
+ {FzFlag: ts + 16476 /* "SQLITE_OPEN_CREA..." */, Fflag: 0x00000004},
+ {FzFlag: ts + 16495 /* "SQLITE_OPEN_DELE..." */, Fflag: 0x00000008},
+ {FzFlag: ts + 16521 /* "SQLITE_OPEN_EXCL..." */, Fflag: 0x00000010},
+ {FzFlag: ts + 16543 /* "SQLITE_OPEN_AUTO..." */, Fflag: 0x00000020},
+ {FzFlag: ts + 16565 /* "SQLITE_OPEN_MAIN..." */, Fflag: 0x00000100},
+ {FzFlag: ts + 16585 /* "SQLITE_OPEN_TEMP..." */, Fflag: 0x00000200},
+ {FzFlag: ts + 16605 /* "SQLITE_OPEN_TRAN..." */, Fflag: 0x00000400},
+ {FzFlag: ts + 16630 /* "SQLITE_OPEN_MAIN..." */, Fflag: 0x00000800},
+ {FzFlag: ts + 16655 /* "SQLITE_OPEN_TEMP..." */, Fflag: 0x00001000},
+ {FzFlag: ts + 16680 /* "SQLITE_OPEN_SUBJ..." */, Fflag: 0x00002000},
+ {FzFlag: ts + 16703 /* "SQLITE_OPEN_SUPE..." */, Fflag: 0x00004000},
+ {FzFlag: ts + 16729 /* "SQLITE_OPEN_NOMU..." */, Fflag: 0x00008000},
+ {FzFlag: ts + 16749 /* "SQLITE_OPEN_FULL..." */, Fflag: 0x00010000},
+ {FzFlag: ts + 16771 /* "SQLITE_OPEN_SHAR..." */, Fflag: 0x00020000},
+ {FzFlag: ts + 16795 /* "SQLITE_OPEN_PRIV..." */, Fflag: 0x00040000},
+ {FzFlag: ts + 16820 /* "SQLITE_OPEN_WAL" */, Fflag: 0x00080000},
+ {FzFlag: ts + 16836 /* "SQLITE_OPEN_URI" */, Fflag: 0x00000040},
{FzFlag: uintptr(0), Fflag: 0},
}
rc = tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* apFlag */)) + uintptr(i)*8)), bp+32 /* &aFlag[0] */, int32(unsafe.Sizeof(OpenFlag{})),
- ts+15142 /* "flag" */, 0, bp+352 /* &iFlag */)
+ ts+16852 /* "flag" */, 0, bp+352 /* &iFlag */)
if rc != 0 {
return rc
}
@@ -42992,7 +47465,7 @@ func test_open_v2(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
if sqlite3TestMakePointerStr(tls, interp, bp+368 /* &zBuf[0] */, *(*uintptr)(unsafe.Pointer(bp + 360 /* db */))) != 0 {
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, bp+368 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, bp+368 /* &zBuf[0] */, 0))
return 0
}
@@ -43003,7 +47476,7 @@ type OpenFlag = struct {
}
// Usage: sqlite3_open16 filename options
-func test_open16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4658:26: */
+func test_open16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4658:26: */
bp := tls.Alloc(156)
defer tls.Free(156)
@@ -43013,8 +47486,8 @@ func test_open16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
// var zBuf [100]int8 at bp+56, 100
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14680 /* " filename option..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16391 /* " filename option..." */, 0))
return 1
}
@@ -43024,7 +47497,7 @@ func test_open16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
if sqlite3TestMakePointerStr(tls, interp, bp+56 /* &zBuf[0] */, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */))) != 0 {
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, bp+56 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, bp+56 /* &zBuf[0] */, 0))
return 0
}
@@ -43032,11 +47505,11 @@ func test_open16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
//
// Return 1 if the supplied argument is a complete SQL statement, or zero
// otherwise.
-func test_complete16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4690:26: */
+func test_complete16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4690:26: */
var zBuf uintptr
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15147 /* "<utf-16 sql>" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16857 /* "<utf-16 sql>" */)
return 1
}
@@ -43048,12 +47521,12 @@ func test_complete16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
// Usage: sqlite3_normalize SQL
//
// Return the normalized value for an SQL statement.
-func test_normalize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4715:26: */
+func test_normalize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4715:26: */
var zSql uintptr
var zNorm uintptr
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9753 /* "SQL" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9992 /* "SQL" */)
return 1
}
@@ -43069,7 +47542,7 @@ func test_normalize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// Usage: sqlite3_step STMT
//
// Advance the statement to the next row.
-func test_step(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4744:26: */
+func test_step(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4744:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -43078,8 +47551,8 @@ func test_step(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, obj
var rc int32
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14107 /* " STMT" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+15818 /* " STMT" */, 0))
return 1
}
@@ -43093,14 +47566,14 @@ func test_step(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, obj
return 0
}
-func test_sql(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4767:26: */
+func test_sql(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4767:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
// var pStmt uintptr at bp, 8
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14574 /* "STMT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16285 /* "STMT" */)
return 1
}
@@ -43110,7 +47583,7 @@ func test_sql(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3_sql(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))), uintptr(1))
return 0
}
-func test_ex_sql(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4784:26: */
+func test_ex_sql(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4784:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -43119,7 +47592,7 @@ func test_ex_sql(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
var z uintptr
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14574 /* "STMT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16285 /* "STMT" */)
return 1
}
@@ -43135,15 +47608,15 @@ func test_ex_sql(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
// Usage: sqlite3_column_count STMT
//
// Return the number of columns returned by the sql statement STMT.
-func test_column_count(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4829:26: */
+func test_column_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4829:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var pStmt uintptr at bp+32, 8
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+15160 /* " STMT column" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16870 /* " STMT column" */, 0))
return 1
}
@@ -43158,7 +47631,7 @@ func test_column_count(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
// Usage: sqlite3_column_type STMT column
//
// Return the type of the data in column 'column' of the current row.
-func test_column_type(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4854:26: */
+func test_column_type(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4854:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -43169,8 +47642,8 @@ func test_column_type(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
var tp int32
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+15160 /* " STMT column" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16870 /* " STMT column" */, 0))
return 1
}
@@ -43184,19 +47657,19 @@ func test_column_type(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
tp = sqlite3.Xsqlite3_column_type(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 40 /* col */)))
switch tp {
case 1:
- tcl.XTcl_SetResult(tls, interp, ts+15173 /* "INTEGER" */, uintptr(0))
+ tcl.XTcl_SetResult(tls, interp, ts+2273 /* "INTEGER" */, uintptr(0))
break
case 5:
- tcl.XTcl_SetResult(tls, interp, ts+4252 /* "NULL" */, uintptr(0))
+ tcl.XTcl_SetResult(tls, interp, ts+5537 /* "NULL" */, uintptr(0))
break
case 2:
- tcl.XTcl_SetResult(tls, interp, ts+15181 /* "FLOAT" */, uintptr(0))
+ tcl.XTcl_SetResult(tls, interp, ts+16883 /* "FLOAT" */, uintptr(0))
break
case 3:
- tcl.XTcl_SetResult(tls, interp, ts+15187 /* "TEXT" */, uintptr(0))
+ tcl.XTcl_SetResult(tls, interp, ts+16889 /* "TEXT" */, uintptr(0))
break
case 4:
- tcl.XTcl_SetResult(tls, interp, ts+15192 /* "BLOB" */, uintptr(0))
+ tcl.XTcl_SetResult(tls, interp, ts+16894 /* "BLOB" */, uintptr(0))
break
default:
}
@@ -43208,7 +47681,7 @@ func test_column_type(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
//
// Return the data in column 'column' of the current row cast as an
// wide (64-bit) integer.
-func test_column_int64(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4903:26: */
+func test_column_int64(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4903:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -43219,8 +47692,8 @@ func test_column_int64(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
var iVal i64
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+15160 /* " STMT column" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16870 /* " STMT column" */, 0))
return 1
}
@@ -43237,7 +47710,7 @@ func test_column_int64(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
}
// Usage: sqlite3_column_blob STMT column
-func test_column_blob(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4930:26: */
+func test_column_blob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4930:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -43249,8 +47722,8 @@ func test_column_blob(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
var pBlob uintptr
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+15160 /* " STMT column" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16870 /* " STMT column" */, 0))
return 1
}
@@ -43270,7 +47743,7 @@ func test_column_blob(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
// Usage: sqlite3_column_double STMT column
//
// Return the data in column 'column' of the current row cast as a double.
-func test_column_double(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4962:26: */
+func test_column_double(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4962:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -43281,8 +47754,8 @@ func test_column_double(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
var rVal float64
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+15160 /* " STMT column" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16870 /* " STMT column" */, 0))
return 1
}
@@ -43301,15 +47774,15 @@ func test_column_double(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// Usage: sqlite3_data_count STMT
//
// Return the number of columns returned by the sql statement STMT.
-func test_data_count(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4991:26: */
+func test_data_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:4991:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var pStmt uintptr at bp+32, 8
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+15160 /* " STMT column" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16870 /* " STMT column" */, 0))
return 1
}
@@ -43326,7 +47799,7 @@ func test_data_count(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
// Usage: sqlite3_column_decltype STMT column
//
// Usage: sqlite3_column_name STMT column
-func test_stmt_utf8(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5018:26: */
+func test_stmt_utf8(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5018:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -43339,8 +47812,8 @@ func test_stmt_utf8(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
xFunc = clientData
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+15160 /* " STMT column" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16870 /* " STMT column" */, 0))
return 1
}
@@ -43350,14 +47823,14 @@ func test_stmt_utf8(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+40 /* &col */) != 0 {
return 1
}
- zRet = (*(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(&xFunc)))(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 40 /* col */)))
+ zRet = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(&xFunc)))(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 40 /* col */)))
if zRet != 0 {
tcl.XTcl_SetResult(tls, interp, zRet, uintptr(0))
}
return 0
}
-func test_global_recover(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5045:26: */
+func test_global_recover(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5045:26: */
var rc int32
if objc != 1 {
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */)
@@ -43373,7 +47846,7 @@ func test_global_recover(tls *crt.TLS, clientData uintptr, interp uintptr, objc
// Usage: sqlite3_column_decltype STMT column
//
// Usage: sqlite3_column_name STMT column
-func test_stmt_utf16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5070:26: */
+func test_stmt_utf16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5070:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -43387,8 +47860,8 @@ func test_stmt_utf16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
xFunc = clientData
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+15160 /* " STMT column" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16870 /* " STMT column" */, 0))
return 1
}
@@ -43399,7 +47872,7 @@ func test_stmt_utf16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
return 1
}
- zName16 = (*(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(&xFunc)))(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 40 /* col */)))
+ zName16 = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(&xFunc)))(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 40 /* col */)))
if zName16 != 0 {
var n int32
var z uintptr = zName16
@@ -43418,7 +47891,7 @@ func test_stmt_utf16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
//
// Usage: sqlite3_column_bytes16 STMT column
//
-func test_stmt_int(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5114:26: */
+func test_stmt_int(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5114:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -43430,8 +47903,8 @@ func test_stmt_int(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
xFunc = clientData
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+15160 /* " STMT column" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16870 /* " STMT column" */, 0))
return 1
}
@@ -43442,34 +47915,34 @@ func test_stmt_int(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
return 1
}
- tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(&xFunc)))(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 40 /* col */)))))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&xFunc)))(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pStmt */)), *(*int32)(unsafe.Pointer(bp + 40 /* col */)))))
return 0
}
// Usage: sqlite_set_magic DB MAGIC-NUMBER
//
// Set the db->magic value. This is used to test error recovery logic.
-func sqlite_set_magic(tls *crt.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5143:26: */
+func sqlite_set_magic(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5143:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var db uintptr at bp+32, 8
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+15197 /* " DB MAGIC" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+16899 /* " DB MAGIC" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+32 /* &db */) != 0 {
return 1
}
- if crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ts+15207 /* "SQLITE_MAGIC_OPE..." */) == 0 {
+ if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ts+16909 /* "SQLITE_MAGIC_OPE..." */) == 0 {
(*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).Fmagic = 0xa029a697
- } else if crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ts+15225 /* "SQLITE_MAGIC_CLO..." */) == 0 {
+ } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ts+16927 /* "SQLITE_MAGIC_CLO..." */) == 0 {
(*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).Fmagic = 0x9f3c2d33
- } else if crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ts+15245 /* "SQLITE_MAGIC_BUS..." */) == 0 {
+ } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ts+16947 /* "SQLITE_MAGIC_BUS..." */) == 0 {
(*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).Fmagic = 0xf03b7906
- } else if crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ts+15263 /* "SQLITE_MAGIC_ERR..." */) == 0 {
+ } else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ts+16965 /* "SQLITE_MAGIC_ERR..." */) == 0 {
(*sqlite31)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* db */)))).Fmagic = 0xb5357930
} else if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), (*(*uintptr)(unsafe.Pointer(bp + 32 /* db */))+112 /* &.magic */)) != 0 {
return 1
@@ -43480,14 +47953,14 @@ func sqlite_set_magic(tls *crt.TLS, clientData uintptr, interp uintptr, argc int
// Usage: sqlite3_interrupt DB
//
// Trigger an interrupt on DB
-func test_interrupt(tls *crt.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5175:26: */
+func test_interrupt(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5175:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var db uintptr at bp+32, 8
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+32 /* &db */) != 0 {
@@ -43502,7 +47975,7 @@ func test_interrupt(tls *crt.TLS, clientData uintptr, interp uintptr, argc int32
// Delete the user function 'function-name' from database handle DB. It
// is assumed that the user function was created as UTF8, any number of
// arguments (the way the TCL interface does it).
-func delete_function(tls *crt.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5198:26: */
+func delete_function(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5198:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -43510,8 +47983,8 @@ func delete_function(tls *crt.TLS, clientData uintptr, interp uintptr, argc int3
// var db uintptr at bp+32, 8
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+15282 /* " DB function-nam..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+16984 /* " DB function-nam..." */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+32 /* &db */) != 0 {
@@ -43527,7 +48000,7 @@ func delete_function(tls *crt.TLS, clientData uintptr, interp uintptr, argc int3
// Delete the collation sequence 'collation-name' from database handle
// DB. It is assumed that the collation sequence was created as UTF8 (the
// way the TCL interface does it).
-func delete_collation(tls *crt.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5224:26: */
+func delete_collation(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5224:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -43535,8 +48008,8 @@ func delete_collation(tls *crt.TLS, clientData uintptr, interp uintptr, argc int
// var db uintptr at bp+32, 8
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+15282 /* " DB function-nam..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+16984 /* " DB function-nam..." */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+32 /* &db */) != 0 {
@@ -43551,7 +48024,7 @@ func delete_collation(tls *crt.TLS, clientData uintptr, interp uintptr, argc int
//
// Return true if the database DB is currently in auto-commit mode.
// Return false if not.
-func get_autocommit(tls *crt.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5249:26: */
+func get_autocommit(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5249:26: */
bp := tls.Alloc(94)
defer tls.Free(94)
@@ -43560,15 +48033,15 @@ func get_autocommit(tls *crt.TLS, clientData uintptr, interp uintptr, argc int32
// var db uintptr at bp+56, 8
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+56 /* &db */) != 0 {
return 1
}
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+64 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+32, sqlite3.Xsqlite3_get_autocommit(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */)))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+64 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+64 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, sqlite3.Xsqlite3_get_autocommit(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */)))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+64 /* &zBuf[0] */, 0))
return 0
}
@@ -43577,7 +48050,7 @@ func get_autocommit(tls *crt.TLS, clientData uintptr, interp uintptr, argc int32
// Set the busy timeout. This is more easily done using the timeout
// method of the TCL interface. But we need a way to test the case
// where it returns SQLITE_MISUSE.
-func test_busy_timeout(tls *crt.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5275:26: */
+func test_busy_timeout(tls *libc.TLS, clientData uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test1.c:5275:26: */
bp := tls.Alloc(60)
defer tls.Free(60)
@@ -43587,8 +48060,8 @@ func test_busy_timeout(tls *crt.TLS, clientData uintptr, interp uintptr, argc in
// var db uintptr at bp+48, 8
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+48 /* &db */) != 0 {
@@ -43598,7 +48071,7 @@ func test_busy_timeout(tls *crt.TLS, clientData uintptr, interp uintptr, argc in
return 1
}
rc = sqlite3.Xsqlite3_busy_timeout(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), *(*int32)(unsafe.Pointer(bp + 56 /* ms */)))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 0
}
@@ -43606,10 +48079,10 @@ func test_busy_timeout(tls *crt.TLS, clientData uintptr, interp uintptr, argc in
//
// Return the name of the internal representation for the
// value of the given variable.
-func tcl_variable_type(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5301:26: */
+func tcl_variable_type(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5301:26: */
var pVar uintptr
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15300 /* "VARIABLE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17002 /* "VARIABLE" */)
return 1
}
pVar = tcl.XTcl_GetVar2Ex(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), uintptr(0), 0x200)
@@ -43627,7 +48100,26 @@ func tcl_variable_type(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
// Attempt to release memory currently held but not actually required.
// The integer N is the number of bytes we are trying to release. The
// return value is the amount of memory actually released.
-func test_release_memory(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5327:26: */
+func test_release_memory(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5327:26: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ // var N int32 at bp, 4
+
+ var amt int32
+ if (objc != 1) && (objc != 2) {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17011 /* "?N?" */)
+ return 1
+ }
+ if objc == 2 {
+ if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &N */) != 0 {
+ return 1
+ }
+ } else {
+ *(*int32)(unsafe.Pointer(bp /* N */)) = -1
+ }
+ amt = sqlite3.Xsqlite3_release_memory(tls, *(*int32)(unsafe.Pointer(bp /* N */)))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, amt))
return 0
}
@@ -43635,7 +48127,7 @@ func test_release_memory(tls *crt.TLS, clientData uintptr, interp uintptr, objc
//
// Attempt to release memory currently held by database DB. Return the
// result code (which in the current implementation is always zero).
-func test_db_release_memory(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5358:26: */
+func test_db_release_memory(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5358:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -43657,7 +48149,7 @@ func test_db_release_memory(tls *crt.TLS, clientData uintptr, interp uintptr, ob
// Usage: sqlite3_db_cacheflush DB
//
// Attempt to flush any dirty pages to disk.
-func test_db_cacheflush(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5381:26: */
+func test_db_cacheflush(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5381:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -43684,7 +48176,7 @@ func test_db_cacheflush(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// Usage: sqlite3_system_errno DB
//
// Return the low-level system errno value.
-func test_system_errno(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5409:26: */
+func test_system_errno(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5409:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -43706,7 +48198,7 @@ func test_system_errno(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
// Usage: sqlite3_db_filename DB DBNAME
//
// Return the name of a file associated with a database.
-func test_db_filename(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5432:26: */
+func test_db_filename(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5432:26: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -43714,14 +48206,14 @@ func test_db_filename(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
var zDbName uintptr
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15309 /* "DB DBNAME" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15728 /* "DB DBNAME" */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+16 /* &db */) != 0 {
return 1
}
zDbName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, sqlite3.Xsqlite3_db_filename(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), zDbName), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3_db_filename(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), zDbName), uintptr(0)))
return 0
}
@@ -43729,7 +48221,7 @@ func test_db_filename(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
//
// Return 1 or 0 if DBNAME is readonly or not. Return -1 if DBNAME does
// not exist.
-func test_db_readonly(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5456:26: */
+func test_db_readonly(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5456:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -43737,7 +48229,7 @@ func test_db_readonly(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
var zDbName uintptr
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15309 /* "DB DBNAME" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15728 /* "DB DBNAME" */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
@@ -43753,14 +48245,14 @@ func test_db_readonly(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
// Query or set the soft heap limit for the current thread. The
// limit is only changed if the N is present. The previous limit
// is returned.
-func test_soft_heap_limit(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5481:26: */
+func test_soft_heap_limit(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5481:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
var amt sqlite3_int64
*(*Tcl_WideInt)(unsafe.Pointer(bp /* N */)) = int64(-1)
if (objc != 1) && (objc != 2) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15319 /* "?N?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17011 /* "?N?" */)
return 1
}
if objc == 2 {
@@ -43778,14 +48270,14 @@ func test_soft_heap_limit(tls *crt.TLS, clientData uintptr, interp uintptr, objc
// Query or set the hard heap limit for the current thread. The
// limit is only changed if the N is present. The previous limit
// is returned.
-func test_hard_heap_limit(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5508:26: */
+func test_hard_heap_limit(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5508:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
var amt sqlite3_int64
*(*Tcl_WideInt)(unsafe.Pointer(bp /* N */)) = int64(-1)
if (objc != 1) && (objc != 2) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15319 /* "?N?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17011 /* "?N?" */)
return 1
}
if objc == 2 {
@@ -43801,7 +48293,7 @@ func test_hard_heap_limit(tls *crt.TLS, clientData uintptr, interp uintptr, objc
// Usage: sqlite3_thread_cleanup
//
// Call the sqlite3_thread_cleanup API.
-func test_thread_cleanup(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5533:26: */
+func test_thread_cleanup(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5533:26: */
sqlite3.Xsqlite3_thread_cleanup(tls)
return 0
}
@@ -43810,7 +48302,7 @@ func test_thread_cleanup(tls *crt.TLS, clientData uintptr, interp uintptr, objc
//
// Return a list of numbers which are the PagerRefcount for all
// pagers on each database connection.
-func test_pager_refcounts(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5551:26: */
+func test_pager_refcounts(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5551:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -43822,8 +48314,8 @@ func test_pager_refcounts(tls *crt.TLS, clientData uintptr, interp uintptr, objc
var pResult uintptr
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+32 /* &db */) != 0 {
@@ -43855,19 +48347,19 @@ func test_pager_refcounts(tls *crt.TLS, clientData uintptr, interp uintptr, objc
// This command is used to warn users that their TCL build is defective
// and that the errors they are seeing in the test scripts might be
// a result of their defective TCL rather than problems in SQLite.
-func working_64bit_int(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5597:26: */
+func working_64bit_int(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5597:26: */
var pTestObj uintptr
var working int32 = 0
pTestObj = tcl.XTcl_NewWideIntObj(tls, (int64(1000000) * int64(1234567890)))
- working = (crt.Bool32(crt.Xstrcmp(tls, tcl.XTcl_GetString(tls, pTestObj), ts+15323 /* "1234567890000000" */) == 0))
+ working = (libc.Bool32(libc.Xstrcmp(tls, tcl.XTcl_GetString(tls, pTestObj), ts+17015 /* "1234567890000000" */) == 0))
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pTestObj
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
- tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (crt.Bool32((working) != 0))))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (libc.Bool32((working) != 0))))
return 0
}
@@ -43877,7 +48369,7 @@ func working_64bit_int(tls *crt.TLS, clientData ClientData, interp uintptr, objc
// it back again. This is used to test the ability to register a
// VFS when none are previously registered, and the ability to
// unregister the only available VFS. Ticket #2738
-func vfs_unlink_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5622:26: */
+func vfs_unlink_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5622:26: */
bp := tls.Alloc(496)
defer tls.Free(496)
@@ -43890,8 +48382,8 @@ func vfs_unlink_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc i
// var two sqlite3_vfs at bp+168, 168
sqlite3.Xsqlite3_vfs_unregister(tls, uintptr(0)) // Unregister of NULL is harmless
- (*sqlite3_vfs)(unsafe.Pointer(bp /* &one */)).FzName = ts + 15340 /* "__one" */
- (*sqlite3_vfs)(unsafe.Pointer(bp + 168 /* &two */)).FzName = ts + 15346 /* "__two" */
+ (*sqlite3_vfs)(unsafe.Pointer(bp /* &one */)).FzName = ts + 17032 /* "__one" */
+ (*sqlite3_vfs)(unsafe.Pointer(bp + 168 /* &two */)).FzName = ts + 17038 /* "__two" */
// Calling sqlite3_vfs_register with 2nd argument of 0 does not
// change the default VFS
@@ -43957,13 +48449,13 @@ func vfs_unlink_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc i
//
// This TCL command attempts to vfs_find and vfs_register when the
// sqlite3_initialize() interface is failing. All calls should fail.
-func vfs_initfail_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5724:26: */
+func vfs_initfail_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5724:26: */
bp := tls.Alloc(168)
defer tls.Free(168)
// var one sqlite3_vfs at bp, 168
- (*sqlite3_vfs)(unsafe.Pointer(bp /* &one */)).FzName = ts + 15340 /* "__one" */
+ (*sqlite3_vfs)(unsafe.Pointer(bp /* &one */)).FzName = ts + 17032 /* "__one" */
if sqlite3.Xsqlite3_vfs_find(tls, uintptr(0)) != 0 {
return 1
@@ -43986,7 +48478,7 @@ var nVfs int32 = 0 /* test1.c:5745:12 */
// tclcmd: vfs_unregister_all
//
// Unregister all VFSes.
-func vfs_unregister_all(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5752:26: */
+func vfs_unregister_all(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5752:26: */
var i int32
for i = 0; i < (int32(uint64(unsafe.Sizeof(apVfs)) / uint64(unsafe.Sizeof(uintptr(0))))); i++ {
apVfs[i] = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
@@ -44004,7 +48496,7 @@ func vfs_unregister_all(tls *crt.TLS, clientData ClientData, interp uintptr, obj
// Restore all VFSes that were removed using vfs_unregister_all. Taking
// care to put the linked list back together in the same order as it was
// in before vfs_unregister_all was invoked.
-func vfs_reregister_all(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5774:26: */
+func vfs_reregister_all(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5774:26: */
var i int32
for i = (nVfs - 1); i >= 0; i-- {
sqlite3.Xsqlite3_vfs_register(tls, apVfs[i], 1)
@@ -44016,7 +48508,7 @@ func vfs_reregister_all(tls *crt.TLS, clientData ClientData, interp uintptr, obj
//
// This TCL command runs the sqlite3_file_control interface and
// verifies correct operation of the same.
-func file_control_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5794:26: */
+func file_control_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5794:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -44027,8 +48519,8 @@ func file_control_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc
_ = rc
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+32 /* &db */) != 0 {
@@ -44036,11 +48528,11 @@ func file_control_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc
}
rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), uintptr(0), 0, bp+40 /* &iArg */)
- rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+15352 /* "notadatabase" */, 1, bp+40 /* &iArg */)
+ rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+17044 /* "notadatabase" */, 1, bp+40 /* &iArg */)
rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+84 /* "main" */, -1, bp+40 /* &iArg */)
- rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+6914 /* "temp" */, -1, bp+40 /* &iArg */)
+ rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), ts+8199 /* "temp" */, -1, bp+40 /* &iArg */)
return 0
}
@@ -44049,7 +48541,7 @@ func file_control_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc
//
// This TCL command runs the sqlite3_file_control interface and
// verifies correct operation of the SQLITE_LAST_ERRNO verb.
-func file_control_lasterrno_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5829:26: */
+func file_control_lasterrno_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5829:26: */
bp := tls.Alloc(76)
defer tls.Free(76)
@@ -44059,8 +48551,8 @@ func file_control_lasterrno_test(tls *crt.TLS, clientData ClientData, interp uin
var rc int32
if objc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+12853 /* " DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+14503 /* " DB" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+64 /* &db */) != 0 {
@@ -44072,8 +48564,8 @@ func file_control_lasterrno_test(tls *crt.TLS, clientData ClientData, interp uin
return 1
}
if *(*int32)(unsafe.Pointer(bp + 72 /* iArg */)) != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+15365, /* "Unexpected non-z..." */
- tcl.XTcl_GetStringFromObj(tls, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 72 /* iArg */))), uintptr(0)), ts+3368 /* " " */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+17057, /* "Unexpected non-z..." */
+ tcl.XTcl_GetStringFromObj(tls, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 72 /* iArg */))), uintptr(0)), ts+4585 /* " " */, 0))
return 1
}
return 0
@@ -44083,7 +48575,7 @@ func file_control_lasterrno_test(tls *crt.TLS, clientData ClientData, interp uin
//
// This TCL command runs the sqlite3_file_control with the
// SQLITE_FCNTL_DATA_VERSION opcode, returning the result.
-func file_control_data_version(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5866:26: */
+func file_control_data_version(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5866:26: */
bp := tls.Alloc(120)
defer tls.Free(120)
@@ -44096,7 +48588,7 @@ func file_control_data_version(tls *crt.TLS, clientData ClientData, interp uintp
// var zBuf [100]int8 at bp+20, 100
if (objc != 3) && (objc != 2) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15393 /* "DB [DBNAME]" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17085 /* "DB [DBNAME]" */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+8 /* &db */) != 0 {
@@ -44113,7 +48605,7 @@ func file_control_data_version(tls *crt.TLS, clientData ClientData, interp uintp
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0))
return 1
} else {
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+20 /* &zBuf[0] */, ts+15405 /* "%u" */, crt.VaList(bp, *(*uint32)(unsafe.Pointer(bp + 16 /* iVers */))))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+20 /* &zBuf[0] */, ts+17097 /* "%u" */, libc.VaList(bp, *(*uint32)(unsafe.Pointer(bp + 16 /* iVers */))))
tcl.XTcl_SetResult(tls, interp, bp+20 /* zBuf */, uintptr(1))
return 0
}
@@ -44125,7 +48617,7 @@ func file_control_data_version(tls *crt.TLS, clientData ClientData, interp uintp
// This TCL command runs the sqlite3_file_control interface and
// verifies correct operation of the SQLITE_GET_LOCKPROXYFILE and
// SQLITE_SET_LOCKPROXYFILE verbs.
-func file_control_chunksize_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5905:26: */
+func file_control_chunksize_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5905:26: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -44137,7 +48629,7 @@ func file_control_chunksize_test(tls *crt.TLS, clientData ClientData, interp uin
var rc int32 // file_control() return code
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15408 /* "DB DBNAME SIZE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17100 /* "DB DBNAME SIZE" */)
return 1
}
if (getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0) ||
@@ -44161,7 +48653,7 @@ func file_control_chunksize_test(tls *crt.TLS, clientData ClientData, interp uin
//
// This TCL command runs the sqlite3_file_control interface
// with SQLITE_FCNTL_SIZE_HINT
-func file_control_sizehint_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5942:26: */
+func file_control_sizehint_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5942:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -44173,7 +48665,7 @@ func file_control_sizehint_test(tls *crt.TLS, clientData ClientData, interp uint
var rc int32 // file_control() return code
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15408 /* "DB DBNAME SIZE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17100 /* "DB DBNAME SIZE" */)
return 1
}
if (getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0) ||
@@ -44198,15 +48690,15 @@ func file_control_sizehint_test(tls *crt.TLS, clientData ClientData, interp uint
// This TCL command runs the sqlite3_file_control interface and
// verifies correct operation of the SQLITE_GET_LOCKPROXYFILE and
// SQLITE_SET_LOCKPROXYFILE verbs.
-func file_control_lockproxy_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5980:26: */
+func file_control_lockproxy_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:5980:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var db uintptr at bp+32, 8
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15423 /* " DB PWD" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+17115 /* " DB PWD" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+32 /* &db */) != 0 {
@@ -44220,7 +48712,7 @@ func file_control_lockproxy_test(tls *crt.TLS, clientData ClientData, interp uin
//
// This TCL command runs the sqlite3_file_control interface with
// the SQLITE_FCNTL_PERSIST_WAL opcode.
-func file_control_persist_wal(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6151:26: */
+func file_control_persist_wal(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6151:26: */
bp := tls.Alloc(176)
defer tls.Free(176)
@@ -44232,8 +48724,8 @@ func file_control_persist_wal(tls *crt.TLS, clientData ClientData, interp uintpt
// var z [100]int8 at bp+76, 100
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15431 /* " DB FLAG" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+17123 /* " DB FLAG" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+64 /* &db */) != 0 {
@@ -44243,8 +48735,8 @@ func file_control_persist_wal(tls *crt.TLS, clientData ClientData, interp uintpt
return 1
}
rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* db */)), uintptr(0), 10, bp+72 /* &bPersist */)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+76 /* &z[0] */, ts+15440 /* "%d %d" */, crt.VaList(bp+32, rc, *(*int32)(unsafe.Pointer(bp + 72 /* bPersist */))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, bp+76 /* &z[0] */, uintptr(0)))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+76 /* &z[0] */, ts+17132 /* "%d %d" */, libc.VaList(bp+32, rc, *(*int32)(unsafe.Pointer(bp + 72 /* bPersist */))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, bp+76 /* &z[0] */, uintptr(0)))
return 0
}
@@ -44252,7 +48744,7 @@ func file_control_persist_wal(tls *crt.TLS, clientData ClientData, interp uintpt
//
// This TCL command runs the sqlite3_file_control interface with
// the SQLITE_FCNTL_POWERSAFE_OVERWRITE opcode.
-func file_control_powersafe_overwrite(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6183:26: */
+func file_control_powersafe_overwrite(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6183:26: */
bp := tls.Alloc(176)
defer tls.Free(176)
@@ -44264,8 +48756,8 @@ func file_control_powersafe_overwrite(tls *crt.TLS, clientData ClientData, inter
// var z [100]int8 at bp+76, 100
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15431 /* " DB FLAG" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+17123 /* " DB FLAG" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+64 /* &db */) != 0 {
@@ -44275,15 +48767,15 @@ func file_control_powersafe_overwrite(tls *crt.TLS, clientData ClientData, inter
return 1
}
rc = sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* db */)), uintptr(0), 13, bp+72 /* &b */)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+76 /* &z[0] */, ts+15440 /* "%d %d" */, crt.VaList(bp+32, rc, *(*int32)(unsafe.Pointer(bp + 72 /* b */))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, bp+76 /* &z[0] */, uintptr(0)))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+76 /* &z[0] */, ts+17132 /* "%d %d" */, libc.VaList(bp+32, rc, *(*int32)(unsafe.Pointer(bp + 72 /* b */))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, bp+76 /* &z[0] */, uintptr(0)))
return 0
}
// tclcmd: file_control_vfsname DB ?AUXDB?
//
// Return a string that describes the stack of VFSes.
-func file_control_vfsname(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6215:26: */
+func file_control_vfsname(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6215:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -44293,8 +48785,8 @@ func file_control_vfsname(tls *crt.TLS, clientData ClientData, interp uintptr, o
*(*uintptr)(unsafe.Pointer(bp + 56 /* zVfsName */)) = uintptr(0)
if (objc != 2) && (objc != 3) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15446 /* " DB ?AUXDB?" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+17138 /* " DB ?AUXDB?" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+48 /* &db */) != 0 {
@@ -44304,7 +48796,7 @@ func file_control_vfsname(tls *crt.TLS, clientData ClientData, interp uintptr, o
zDbName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
}
sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), zDbName, 12, bp+56 /* &zVfsName */)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 56 /* zVfsName */)), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 56 /* zVfsName */)), uintptr(0)))
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* zVfsName */)))
return 0
}
@@ -44312,7 +48804,7 @@ func file_control_vfsname(tls *crt.TLS, clientData ClientData, interp uintptr, o
// tclcmd: file_control_tempfilename DB ?AUXDB?
//
// Return a string that is a temporary filename
-func file_control_tempfilename(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6247:26: */
+func file_control_tempfilename(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6247:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -44322,8 +48814,8 @@ func file_control_tempfilename(tls *crt.TLS, clientData ClientData, interp uintp
*(*uintptr)(unsafe.Pointer(bp + 56 /* zTName */)) = uintptr(0)
if (objc != 2) && (objc != 3) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15446 /* " DB ?AUXDB?" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+17138 /* " DB ?AUXDB?" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+48 /* &db */) != 0 {
@@ -44333,7 +48825,7 @@ func file_control_tempfilename(tls *crt.TLS, clientData ClientData, interp uintp
zDbName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
}
sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* db */)), zDbName, 16, bp+56 /* &zTName */)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 56 /* zTName */)), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 56 /* zTName */)), uintptr(0)))
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* zTName */)))
return 0
}
@@ -44341,7 +48833,7 @@ func file_control_tempfilename(tls *crt.TLS, clientData ClientData, interp uintp
// tclcmd: sqlite3_vfs_list
//
// Return a tcl list containing the names of all registered vfs's.
-func vfs_list(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6280:26: */
+func vfs_list(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6280:26: */
var pVfs uintptr
var pRet uintptr = tcl.XTcl_NewObj(tls)
if objc != 1 {
@@ -44359,7 +48851,7 @@ func vfs_list(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, o
//
// This TCL command runs the sqlite3_limit interface and
// verifies correct operation of the same.
-func test_limit(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6305:26: */
+func test_limit(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6305:26: */
bp := tls.Alloc(68)
defer tls.Free(68)
@@ -44373,8 +48865,8 @@ func test_limit(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32,
var zId uintptr
if objc != 4 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+15458 /* " DB ID VALUE" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+17150 /* " DB ID VALUE" */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+56 /* &db */) != 0 {
@@ -44386,7 +48878,7 @@ func test_limit(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32,
Fid int32
_ [4]byte
}{}))); i++ {
- if crt.Xstrcmp(tls, zId, aId[i].FzName) == 0 {
+ if libc.Xstrcmp(tls, zId, aId[i].FzName) == 0 {
id = aId[i].Fid
break
}
@@ -44396,7 +48888,7 @@ func test_limit(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32,
Fid int32
_ [4]byte
}{}))) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+15471 /* "unknown limit ty..." */, zId, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+17163 /* "unknown limit ty..." */, zId, uintptr(0)))
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), bp+64 /* &val */) != 0 {
@@ -44412,22 +48904,22 @@ var aId = [14]struct {
Fid int32
_ [4]byte
}{
- {FzName: ts + 15492 /* "SQLITE_LIMIT_LEN..." */, Fid: 0},
- {FzName: ts + 15512 /* "SQLITE_LIMIT_SQL..." */, Fid: 1},
- {FzName: ts + 15536 /* "SQLITE_LIMIT_COL..." */, Fid: 2},
- {FzName: ts + 15556 /* "SQLITE_LIMIT_EXP..." */, Fid: 3},
- {FzName: ts + 15580 /* "SQLITE_LIMIT_COM..." */, Fid: 4},
- {FzName: ts + 15609 /* "SQLITE_LIMIT_VDB..." */, Fid: 5},
- {FzName: ts + 15630 /* "SQLITE_LIMIT_FUN..." */, Fid: 6},
- {FzName: ts + 15656 /* "SQLITE_LIMIT_ATT..." */, Fid: 7},
- {FzName: ts + 15678 /* "SQLITE_LIMIT_LIK..." */, Fid: 8},
- {FzName: ts + 15711 /* "SQLITE_LIMIT_VAR..." */, Fid: 9},
- {FzName: ts + 15740 /* "SQLITE_LIMIT_TRI..." */, Fid: 10},
- {FzName: ts + 15767 /* "SQLITE_LIMIT_WOR..." */, Fid: 11},
+ {FzName: ts + 17184 /* "SQLITE_LIMIT_LEN..." */, Fid: 0},
+ {FzName: ts + 17204 /* "SQLITE_LIMIT_SQL..." */, Fid: 1},
+ {FzName: ts + 17228 /* "SQLITE_LIMIT_COL..." */, Fid: 2},
+ {FzName: ts + 17248 /* "SQLITE_LIMIT_EXP..." */, Fid: 3},
+ {FzName: ts + 17272 /* "SQLITE_LIMIT_COM..." */, Fid: 4},
+ {FzName: ts + 17301 /* "SQLITE_LIMIT_VDB..." */, Fid: 5},
+ {FzName: ts + 17322 /* "SQLITE_LIMIT_FUN..." */, Fid: 6},
+ {FzName: ts + 17348 /* "SQLITE_LIMIT_ATT..." */, Fid: 7},
+ {FzName: ts + 17370 /* "SQLITE_LIMIT_LIK..." */, Fid: 8},
+ {FzName: ts + 17403 /* "SQLITE_LIMIT_VAR..." */, Fid: 9},
+ {FzName: ts + 17432 /* "SQLITE_LIMIT_TRI..." */, Fid: 10},
+ {FzName: ts + 17459 /* "SQLITE_LIMIT_WOR..." */, Fid: 11},
// Out of range test cases
- {FzName: ts + 15795 /* "SQLITE_LIMIT_TOO..." */, Fid: -1},
- {FzName: ts + 15817 /* "SQLITE_LIMIT_TOO..." */, Fid: (11 + 1)},
+ {FzName: ts + 17487 /* "SQLITE_LIMIT_TOO..." */, Fid: -1},
+ {FzName: ts + 17509 /* "SQLITE_LIMIT_TOO..." */, Fid: (11 + 1)},
} /* test1.c:6316:5 */
// tclcmd: save_prng_state
@@ -44435,7 +48927,7 @@ var aId = [14]struct {
// Save the state of the pseudo-random number generator.
// At the same time, verify that sqlite3_test_control works even when
// called with an out-of-range opcode.
-func save_prng_state(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6368:26: */
+func save_prng_state(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6368:26: */
var rc int32 = sqlite3.Xsqlite3_test_control(tls, 9999, 0)
_ = rc
@@ -44446,13 +48938,13 @@ func save_prng_state(tls *crt.TLS, clientData ClientData, interp uintptr, objc i
}
// tclcmd: restore_prng_state
-func restore_prng_state(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6384:26: */
+func restore_prng_state(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6384:26: */
sqlite3.Xsqlite3_test_control(tls, 6, 0)
return 0
}
// tclcmd: reset_prng_state
-func reset_prng_state(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6396:26: */
+func reset_prng_state(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6396:26: */
sqlite3.Xsqlite3_randomness(tls, 0, uintptr(0))
return 0
}
@@ -44470,14 +48962,14 @@ func reset_prng_state(tls *crt.TLS, clientData ClientData, interp uintptr, objc
//
// If INT==0 and DB==0 then use the default procedure of calling the
// xRandomness method on the default VFS to get the PRNG seed.
-func prng_seed(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6420:26: */
+func prng_seed(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6420:26: */
bp := tls.Alloc(32)
defer tls.Free(32)
*(*int32)(unsafe.Pointer(bp + 16 /* i */)) = 0
*(*uintptr)(unsafe.Pointer(bp + 24 /* db */)) = uintptr(0)
if (objc != 2) && (objc != 3) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15837 /* "SEED ?DB?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17529 /* "SEED ?DB?" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), bp+16 /* &i */) != 0 {
@@ -44486,7 +48978,29 @@ func prng_seed(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32,
if (objc == 3) && (getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), bp+24 /* &db */) != 0) {
return 1
}
- sqlite3.Xsqlite3_test_control(tls, 28, crt.VaList(bp, *(*int32)(unsafe.Pointer(bp + 16 /* i */)), *(*uintptr)(unsafe.Pointer(bp + 24 /* db */))))
+ sqlite3.Xsqlite3_test_control(tls, 28, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 16 /* i */)), *(*uintptr)(unsafe.Pointer(bp + 24 /* db */))))
+ return 0
+}
+
+// tclcmd: extra_schema_checks BOOLEAN
+//
+// Enable or disable schema checks when parsing the sqlite_schema file.
+// This is always enabled in production, but it is sometimes useful to
+// disable the checks in order to make some internal error states reachable
+// for testing.
+func extra_schema_checks(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6448:26: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ *(*int32)(unsafe.Pointer(bp + 8 /* i */)) = 0
+ if objc != 2 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17539 /* "BOOLEAN" */)
+ return 1
+ }
+ if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+8 /* &i */) != 0 {
+ return 1
+ }
+ sqlite3.Xsqlite3_test_control(tls, 29, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* i */))))
return 0
}
@@ -44494,11 +49008,11 @@ func prng_seed(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32,
//
// Indicate that database files might be corrupt. In other words, set the normal
// state of operation.
-func database_may_be_corrupt(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6446:26: */
+func database_may_be_corrupt(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6470:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
- sqlite3.Xsqlite3_test_control(tls, 20, crt.VaList(bp, 0))
+ sqlite3.Xsqlite3_test_control(tls, 20, libc.VaList(bp, 0))
return 0
}
@@ -44507,16 +49021,16 @@ func database_may_be_corrupt(tls *crt.TLS, clientData ClientData, interp uintptr
// Indicate that database files are always well-formed. This enables
// extra assert() statements that test conditions that are always true
// for well-formed databases.
-func database_never_corrupt(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6462:26: */
+func database_never_corrupt(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6486:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
- sqlite3.Xsqlite3_test_control(tls, 20, crt.VaList(bp, 1))
+ sqlite3.Xsqlite3_test_control(tls, 20, libc.VaList(bp, 1))
return 0
}
// tclcmd: pcache_stats
-func test_pcache_stats(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6475:26: */
+func test_pcache_stats(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6499:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -44533,13 +49047,13 @@ func test_pcache_stats(tls *crt.TLS, clientData ClientData, interp uintptr, objc
sqlite3.Xsqlite3PcacheStats(tls, bp /* &nCurrent */, bp+4 /* &nMax */, bp+8 /* &nMin */, bp+12 /* &nRecyclable */)
pRet = tcl.XTcl_NewObj(tls)
- tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+15847 /* "current" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+17547 /* "current" */, -1))
tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp /* nCurrent */))))
- tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+15855 /* "max" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+17555 /* "max" */, -1))
tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 4 /* nMax */))))
- tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+15859 /* "min" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+17559 /* "min" */, -1))
tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 8 /* nMin */))))
- tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+15863 /* "recyclable" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+17563 /* "recyclable" */, -1))
tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 12 /* nRecyclable */))))
tcl.XTcl_SetObjResult(tls, interp, pRet)
@@ -44547,15 +49061,15 @@ func test_pcache_stats(tls *crt.TLS, clientData ClientData, interp uintptr, objc
return 0
}
-func test_unlock_notify_cb(tls *crt.TLS, aArg uintptr, nArg int32) { /* test1.c:6505:13: */
+func test_unlock_notify_cb(tls *libc.TLS, aArg uintptr, nArg int32) { /* test1.c:6529:13: */
var ii int32
for ii = 0; ii < nArg; ii++ {
- tcl.XTcl_EvalEx(tls, *(*uintptr)(unsafe.Pointer(aArg + uintptr(ii)*8)), ts+11563 /* "unlock_notify" */, -1, 0x020000)
+ tcl.XTcl_EvalEx(tls, *(*uintptr)(unsafe.Pointer(aArg + uintptr(ii)*8)), ts+13194 /* "unlock_notify" */, -1, 0x020000)
}
}
// tclcmd: sqlite3_unlock_notify db
-func test_unlock_notify(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6517:26: */
+func test_unlock_notify(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6541:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -44572,14 +49086,14 @@ func test_unlock_notify(tls *crt.TLS, clientData ClientData, interp uintptr, obj
return 1
}
rc = sqlite3.Xsqlite3_unlock_notify(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32)
+ f func(*libc.TLS, uintptr, int32)
}{test_unlock_notify_cb})), interp)
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0))
return 0
}
// tclcmd: sqlite3_wal_checkpoint db ?NAME?
-func test_wal_checkpoint(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6543:26: */
+func test_wal_checkpoint(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6567:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -44589,7 +49103,7 @@ func test_wal_checkpoint(tls *crt.TLS, clientData ClientData, interp uintptr, ob
var rc int32
if (objc != 3) && (objc != 2) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15874 /* "DB ?NAME?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17574 /* "DB ?NAME?" */)
return 1
}
@@ -44620,7 +49134,7 @@ func test_wal_checkpoint(tls *crt.TLS, clientData ClientData, interp uintptr, ob
// are the values returned via the output parameters by wal_checkpoint_v2() -
// the number of frames in the log and the number of frames in the log
// that have been checkpointed.
-func test_wal_checkpoint_v2(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6587:26: */
+func test_wal_checkpoint_v2(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6611:26: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -44634,10 +49148,10 @@ func test_wal_checkpoint_v2(tls *crt.TLS, clientData ClientData, interp uintptr,
*(*int32)(unsafe.Pointer(bp + 92 /* nCkpt */)) = -555
var pRet uintptr
- *(*[5]uintptr)(unsafe.Pointer(bp + 48 /* aMode */)) = [5]uintptr{ts + 15884 /* "passive" */, ts + 15892 /* "full" */, ts + 15897 /* "restart" */, ts + 15905 /* "truncate" */, uintptr(0)}
+ *(*[5]uintptr)(unsafe.Pointer(bp + 48 /* aMode */)) = [5]uintptr{ts + 17584 /* "passive" */, ts + 17592 /* "full" */, ts + 17597 /* "restart" */, ts + 17605 /* "truncate" */, uintptr(0)}
if (objc != 3) && (objc != 4) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15914 /* "DB MODE ?NAME?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17614 /* "DB MODE ?NAME?" */)
return 1
}
@@ -44645,7 +49159,7 @@ func test_wal_checkpoint_v2(tls *crt.TLS, clientData ClientData, interp uintptr,
zDb = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)))
}
if (getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+32 /* &db */) != 0) || ((0 != tcl.XTcl_GetIntFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+40 /* &eMode */)) &&
- (0 != tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+48 /* &aMode[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+15929 /* "mode" */, 0, bp+40 /* &eMode */))) {
+ (0 != tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+48 /* &aMode[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+17629 /* "mode" */, 0, bp+40 /* &eMode */))) {
return 1
}
@@ -44653,7 +49167,7 @@ func test_wal_checkpoint_v2(tls *crt.TLS, clientData ClientData, interp uintptr,
if (rc != 0) && (rc != 5) {
var zErrCode uintptr = sqlite3.Xsqlite3ErrName(tls, rc)
tcl.XTcl_ResetResult(tls, interp)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, zErrCode, ts+15934 /* " - " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */))), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, zErrCode, ts+10102 /* " - " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */))), 0))
return 1
}
@@ -44672,7 +49186,7 @@ func test_wal_checkpoint_v2(tls *crt.TLS, clientData ClientData, interp uintptr,
}
// tclcmd: sqlite3_wal_autocheckpoint db VALUE
-func test_wal_autocheckpoint(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6643:26: */
+func test_wal_autocheckpoint(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6667:26: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -44682,7 +49196,7 @@ func test_wal_autocheckpoint(tls *crt.TLS, clientData ClientData, interp uintptr
// var iVal int32 at bp+8, 4
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15938 /* "DB VALUE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17634 /* "DB VALUE" */)
return 1
}
@@ -44709,8 +49223,8 @@ type LogCallback = struct {
}
// tclcmd: test_sqlite3_log ?SCRIPT?
-var logcallback = LogCallback{FpInterp: uintptr(0), FpObj: uintptr(0)} /* test1.c:6683:3 */
-func xLogcallback(tls *crt.TLS, unused uintptr, err int32, zMsg uintptr) { /* test1.c:6684:13: */
+var logcallback = LogCallback{FpInterp: uintptr(0), FpObj: uintptr(0)} /* test1.c:6707:3 */
+func xLogcallback(tls *libc.TLS, unused uintptr, err int32, zMsg uintptr) { /* test1.c:6708:13: */
var pNew uintptr = tcl.XTcl_DuplicateObj(tls, logcallback.FpObj)
(*Tcl_Obj)(unsafe.Pointer(pNew)).FrefCount++
tcl.XTcl_ListObjAppendElement(tls,
@@ -44719,36 +49233,36 @@ func xLogcallback(tls *crt.TLS, unused uintptr, err int32, zMsg uintptr) { /* te
tcl.XTcl_EvalObjEx(tls, logcallback.FpInterp, pNew, (0x020000 | 0x040000))
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pNew
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
}
-func test_sqlite3_log(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6694:26: */
+func test_sqlite3_log(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6718:26: */
bp := tls.Alloc(32)
defer tls.Free(32)
if objc > 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+9746 /* "SCRIPT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+11405 /* "SCRIPT" */)
return 1
}
if logcallback.FpObj != 0 {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = logcallback.FpObj
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
logcallback.FpObj = uintptr(0)
logcallback.FpInterp = uintptr(0)
- sqlite3.Xsqlite3_config(tls, 16, crt.VaList(bp, uintptr(0), uintptr(0)))
+ sqlite3.Xsqlite3_config(tls, 16, libc.VaList(bp, uintptr(0), uintptr(0)))
}
if objc > 1 {
logcallback.FpObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))
(*Tcl_Obj)(unsafe.Pointer(logcallback.FpObj)).FrefCount++
logcallback.FpInterp = interp
- sqlite3.Xsqlite3_config(tls, 16, crt.VaList(bp+16, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ sqlite3.Xsqlite3_config(tls, 16, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{xLogcallback})), uintptr(0)))
}
return 0
@@ -44758,27 +49272,27 @@ func test_sqlite3_log(tls *crt.TLS, clientData ClientData, interp uintptr, objc
//
// Run a TCL command using its objProc interface. Throw an error if
// the command has no objProc interface.
-func runAsObjProc(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6725:26: */
+func runAsObjProc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6749:26: */
bp := tls.Alloc(112)
defer tls.Free(112)
// var cmdInfo Tcl_CmdInfo at bp+48, 64
if objc < 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15947 /* "COMMAND ..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17643 /* "COMMAND ..." */)
return 1
}
if !(tcl.XTcl_GetCommandInfo(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+48 /* &cmdInfo */) != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12711, /* "command not foun..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14361, /* "command not foun..." */
tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), uintptr(0)))
return 1
}
if (*Tcl_CmdInfo)(unsafe.Pointer(bp+48 /* &cmdInfo */)).FobjProc == uintptr(0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+24, ts+15959, /* "command has no o..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+17655, /* "command has no o..." */
tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), uintptr(0)))
return 1
}
- return (*(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer((bp + 48 /* &cmdInfo */ + 8 /* &.objProc */))))(tls, (*Tcl_CmdInfo)(unsafe.Pointer(bp+48 /* &cmdInfo */)).FobjClientData, interp, (objc - 1), (objv + uintptr(1)*8))
+ return (*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer((bp + 48 /* &cmdInfo */ + 8 /* &.objProc */))))(tls, (*Tcl_CmdInfo)(unsafe.Pointer(bp+48 /* &cmdInfo */)).FobjClientData, interp, (objc - 1), (objv + uintptr(1)*8))
}
// WARNING: The following function, printExplainQueryPlan() is an exact
@@ -44787,7 +49301,7 @@ func runAsObjProc(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
// Argument pStmt is a prepared SQL statement. This function compiles
// an EXPLAIN QUERY PLAN command to report on the prepared statement,
// and prints the report to stdout using printf().
-func printExplainQueryPlan(tls *crt.TLS, pStmt uintptr) int32 { /* test1.c:6760:5: */
+func printExplainQueryPlan(tls *libc.TLS, pStmt uintptr) int32 { /* test1.c:6784:5: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -44802,7 +49316,7 @@ func printExplainQueryPlan(tls *crt.TLS, pStmt uintptr) int32 { /* test1.c:6760:
return 1
}
- zExplain = sqlite3.Xsqlite3_mprintf(tls, ts+234 /* "EXPLAIN QUERY PL..." */, crt.VaList(bp, zSql))
+ zExplain = sqlite3.Xsqlite3_mprintf(tls, ts+234 /* "EXPLAIN QUERY PL..." */, libc.VaList(bp, zSql))
if zExplain == uintptr(0) {
return 7
}
@@ -44819,13 +49333,13 @@ func printExplainQueryPlan(tls *crt.TLS, pStmt uintptr) int32 { /* test1.c:6760:
var iFrom int32 = sqlite3.Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pExplain */)), 2)
var zDetail uintptr = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pExplain */)), 3)
- crt.Xprintf(tls, ts+15984 /* "%d %d %d %s\n" */, crt.VaList(bp+8, iSelectid, iOrder, iFrom, zDetail))
+ libc.Xprintf(tls, ts+17680 /* "%d %d %d %s\n" */, libc.VaList(bp+8, iSelectid, iOrder, iFrom, zDetail))
}
return sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pExplain */)))
}
-func test_print_eqp(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6788:26: */
+func test_print_eqp(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6812:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -44833,7 +49347,7 @@ func test_print_eqp(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// var pStmt uintptr at bp, 8
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14574 /* "STMT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16285 /* "STMT" */)
return 1
}
if getStmtPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &pStmt */) != 0 {
@@ -44843,21 +49357,21 @@ func test_print_eqp(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// This is needed on Windows so that a test case using this
// function can open a read pipe and get the output of
// printExplainQueryPlan() immediately.
- crt.Xfflush(tls, crt.Xstdout)
+ libc.Xfflush(tls, libc.Xstdout)
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0))
return 0
}
// sqlite3_test_control VERB ARGS...
-func test_test_control(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6816:26: */
+func test_test_control(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6840:26: */
bp := tls.Alloc(184)
defer tls.Free(184)
*(*[4]Verb)(unsafe.Pointer(bp + 64 /* aVerb */)) = [4]Verb{
- {FzName: ts + 15997 /* "SQLITE_TESTCTRL_..." */, Fi: 18},
- {FzName: ts + 16029 /* "SQLITE_TESTCTRL_..." */, Fi: 24},
- {FzName: ts + 16057 /* "SQLITE_TESTCTRL_..." */, Fi: 25},
- {FzName: ts + 16082 /* "SQLITE_TESTCTRL_..." */, Fi: 17},
+ {FzName: ts + 17693 /* "SQLITE_TESTCTRL_..." */, Fi: 18},
+ {FzName: ts + 17725 /* "SQLITE_TESTCTRL_..." */, Fi: 24},
+ {FzName: ts + 17753 /* "SQLITE_TESTCTRL_..." */, Fi: 25},
+ {FzName: ts + 17778 /* "SQLITE_TESTCTRL_..." */, Fi: 17},
}
// var iVerb int32 at bp+128, 4
@@ -44865,12 +49379,12 @@ func test_test_control(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
var rc int32
if objc < 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16117 /* "VERB ARGS..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17813 /* "VERB ARGS..." */)
return 1
}
rc = tcl.XTcl_GetIndexFromObjStruct(tls,
- interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+64 /* &aVerb[0] */, int32(unsafe.Sizeof(Verb{})), ts+16130 /* "VERB" */, 0, bp+128 /* &iVerb */)
+ interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+64 /* &aVerb[0] */, int32(unsafe.Sizeof(Verb{})), ts+17826 /* "VERB" */, 0, bp+128 /* &iVerb */)
if rc != 0 {
return rc
}
@@ -44887,7 +49401,7 @@ func test_test_control(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), bp+136 /* &db */) != 0 {
return 1
}
- sqlite3.Xsqlite3_test_control(tls, 17, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 136 /* db */))))
+ sqlite3.Xsqlite3_test_control(tls, 17, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 136 /* db */))))
break
}
case 18:
@@ -44895,13 +49409,13 @@ func test_test_control(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
// var val int32 at bp+144, 4
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+16135 /* "ONOFF" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+17831 /* "ONOFF" */)
return 1
}
if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+144 /* &val */) != 0 {
return 1
}
- sqlite3.Xsqlite3_test_control(tls, iFlag, crt.VaList(bp+8, *(*int32)(unsafe.Pointer(bp + 144 /* val */))))
+ sqlite3.Xsqlite3_test_control(tls, iFlag, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(bp + 144 /* val */))))
break
}
@@ -44912,7 +49426,7 @@ func test_test_control(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
// var db uintptr at bp+152, 8
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+16141 /* "DB LIMIT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+17837 /* "DB LIMIT" */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), bp+152 /* &db */) != 0 {
@@ -44921,7 +49435,7 @@ func test_test_control(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), bp+160 /* &val */) != 0 {
return 1
}
- sqlite3.Xsqlite3_test_control(tls, 24, crt.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 152 /* db */)), *(*int32)(unsafe.Pointer(bp + 160 /* val */))))
+ sqlite3.Xsqlite3_test_control(tls, 24, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 152 /* db */)), *(*int32)(unsafe.Pointer(bp + 160 /* val */))))
break
}
@@ -44935,7 +49449,7 @@ func test_test_control(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
// var db uintptr at bp+168, 8
if objc != 6 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+16150 /* "DB dbName onOff ..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+17846 /* "DB dbName onOff ..." */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), bp+168 /* &db */) != 0 {
@@ -44948,7 +49462,7 @@ func test_test_control(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(5)*8)), bp+180 /* &tnum */) != 0 {
return 1
}
- sqlite3.Xsqlite3_test_control(tls, 25, crt.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 168 /* db */)), zDbName, *(*int32)(unsafe.Pointer(bp + 176 /* onOff */)), *(*int32)(unsafe.Pointer(bp + 180 /* tnum */))))
+ sqlite3.Xsqlite3_test_control(tls, 25, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 168 /* db */)), zDbName, *(*int32)(unsafe.Pointer(bp + 176 /* onOff */)), *(*int32)(unsafe.Pointer(bp + 180 /* tnum */))))
break
}
}
@@ -44963,12 +49477,6 @@ type Verb = struct {
_ [4]byte
}
-// Some versions of <linux/posix_types.h> define this macros.
-// It's easier to assume 8-bit bytes than to get CHAR_BIT.
-
-// fd_set for select and pselect.
-type fd_set1 = struct{ Ffds_bits [16]int64 } /* select.h:70:5 */
-
// Value to indicate that there is no limit.
// We can represent all limits.
@@ -45056,7 +49564,7 @@ type rusage = struct {
F__136 struct{ Fru_nivcsw int64 }
}
-func test_getrusage(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6906:26: */
+func test_getrusage(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:6930:26: */
bp := tls.Alloc(1216)
defer tls.Free(1216)
@@ -45064,12 +49572,12 @@ func test_getrusage(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// var r rusage at bp+48, 144
- crt.Xmemset(tls, bp+48 /* &r */, 0, uint64(unsafe.Sizeof(rusage{})))
- crt.Xgetrusage(tls, RUSAGE_SELF, bp+48 /* &r */)
+ libc.Xmemset(tls, bp+48 /* &r */, 0, uint64(unsafe.Sizeof(rusage{})))
+ libc.Xgetrusage(tls, RUSAGE_SELF, bp+48 /* &r */)
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1024]int8{})), bp+192, /* &buf[0] */
- ts+16171, /* "ru_utime=%d.%06d..." */
- crt.VaList(bp, int32((*rusage)(unsafe.Pointer(bp+48 /* &r */)).Fru_utime.Ftv_sec), int32((*rusage)(unsafe.Pointer(bp+48 /* &r */)).Fru_utime.Ftv_usec),
+ ts+17867, /* "ru_utime=%d.%06d..." */
+ libc.VaList(bp, int32((*rusage)(unsafe.Pointer(bp+48 /* &r */)).Fru_utime.Ftv_sec), int32((*rusage)(unsafe.Pointer(bp+48 /* &r */)).Fru_utime.Ftv_usec),
int32((*rusage)(unsafe.Pointer(bp+48 /* &r */)).Fru_stime.Ftv_sec), int32((*rusage)(unsafe.Pointer(bp+48 /* &r */)).Fru_stime.Ftv_usec),
int32(*(*int64)(unsafe.Pointer(bp + 48 /* &r */ + 64 /* &.ru_minflt */))), int32(*(*int64)(unsafe.Pointer(bp + 48 /* &r */ + 72 /* &.ru_majflt */)))))
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, bp+192 /* &buf[0] */, -1))
@@ -45081,7 +49589,7 @@ func test_getrusage(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// Enable or disable query optimizations using the sqlite3_test_control()
// interface. Disable if BOOLEAN is false and enable if BOOLEAN is true.
// OPT is the name of the optimization to be disabled.
-func optimization_control(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7186:26: */
+func optimization_control(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7210:26: */
bp := tls.Alloc(68)
defer tls.Free(68)
@@ -45094,7 +49602,7 @@ func optimization_control(tls *crt.TLS, clientData uintptr, interp uintptr, objc
var mask int32 = 0
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16231 /* "DB OPT BOOLEAN" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17927 /* "DB OPT BOOLEAN" */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+56 /* &db */) != 0 {
@@ -45109,7 +49617,7 @@ func optimization_control(tls *crt.TLS, clientData uintptr, interp uintptr, objc
Fmask int32
_ [4]byte
}{}))); i++ {
- if crt.Xstrcmp(tls, zOpt, aOpt[i].FzOptName) == 0 {
+ if libc.Xstrcmp(tls, zOpt, aOpt[i].FzOptName) == 0 {
mask = aOpt[i].Fmask
break
}
@@ -45122,18 +49630,18 @@ func optimization_control(tls *crt.TLS, clientData uintptr, interp uintptr, objc
Fmask int32
_ [4]byte
}{}))) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+16246, /* "unknown optimiza..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+17942, /* "unknown optimiza..." */
uintptr(0)))
for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aOpt)) / uint64(unsafe.Sizeof(struct {
FzOptName uintptr
Fmask int32
_ [4]byte
}{}))); i++ {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+16, ts+3368 /* " " */, aOpt[i].FzOptName, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+4585 /* " " */, aOpt[i].FzOptName, uintptr(0)))
}
return 1
}
- sqlite3.Xsqlite3_test_control(tls, 15, crt.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */)), mask))
+ sqlite3.Xsqlite3_test_control(tls, 15, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */)), mask))
return 0
}
@@ -45142,25 +49650,25 @@ var aOpt = [13]struct {
Fmask int32
_ [4]byte
}{
- {FzOptName: ts + 16287 /* "all" */, Fmask: 0xffff},
- {FzOptName: ts + 16291 /* "none" */, Fmask: 0},
- {FzOptName: ts + 16296 /* "query-flattener" */, Fmask: 0x0001},
- {FzOptName: ts + 16312 /* "groupby-order" */, Fmask: 0x0004},
- {FzOptName: ts + 16326 /* "factor-constants" */, Fmask: 0x0008},
- {FzOptName: ts + 16343 /* "distinct-opt" */, Fmask: 0x0010},
- {FzOptName: ts + 16356 /* "cover-idx-scan" */, Fmask: 0x0020},
- {FzOptName: ts + 16371 /* "order-by-idx-joi..." */, Fmask: 0x0040},
- {FzOptName: ts + 16389 /* "transitive" */, Fmask: 0x0080},
- {FzOptName: ts + 16400 /* "omit-noop-join" */, Fmask: 0x0100},
- {FzOptName: ts + 16415 /* "stat4" */, Fmask: 0x0800},
- {FzOptName: ts + 16421 /* "skip-scan" */, Fmask: 0x4000},
- {FzOptName: ts + 16431 /* "push-down" */, Fmask: 0x1000},
-} /* test1.c:7200:5 */
+ {FzOptName: ts + 17983 /* "all" */, Fmask: 0xffff},
+ {FzOptName: ts + 17987 /* "none" */, Fmask: 0},
+ {FzOptName: ts + 17992 /* "query-flattener" */, Fmask: 0x0001},
+ {FzOptName: ts + 18008 /* "groupby-order" */, Fmask: 0x0004},
+ {FzOptName: ts + 18022 /* "factor-constants" */, Fmask: 0x0008},
+ {FzOptName: ts + 18039 /* "distinct-opt" */, Fmask: 0x0010},
+ {FzOptName: ts + 18052 /* "cover-idx-scan" */, Fmask: 0x0020},
+ {FzOptName: ts + 18067 /* "order-by-idx-joi..." */, Fmask: 0x0040},
+ {FzOptName: ts + 18085 /* "transitive" */, Fmask: 0x0080},
+ {FzOptName: ts + 18096 /* "omit-noop-join" */, Fmask: 0x0100},
+ {FzOptName: ts + 18111 /* "stat4" */, Fmask: 0x0800},
+ {FzOptName: ts + 18117 /* "skip-scan" */, Fmask: 0x4000},
+ {FzOptName: ts + 18127 /* "push-down" */, Fmask: 0x1000},
+} /* test1.c:7224:5 */
// load_static_extension DB NAME ...
//
// Load one or more statically linked extensions.
-func tclLoadStaticExtensionCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7247:26: */
+func tclLoadStaticExtensionCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7271:26: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -45172,7 +49680,7 @@ func tclLoadStaticExtensionCmd(tls *crt.TLS, clientData uintptr, interp uintptr,
var rc int32
*(*uintptr)(unsafe.Pointer(bp + 72 /* zErrMsg */)) = uintptr(0)
if objc < 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16441 /* "DB NAME ..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18137 /* "DB NAME ..." */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+64 /* &db */) != 0 {
@@ -45184,7 +49692,7 @@ func tclLoadStaticExtensionCmd(tls *crt.TLS, clientData uintptr, interp uintptr,
FzExtName uintptr
FpInit uintptr
}{})))); i++ {
- if crt.Xstrcmp(tls, zName, aExtension[i].FzExtName) == 0 {
+ if libc.Xstrcmp(tls, zName, aExtension[i].FzExtName) == 0 {
break
}
}
@@ -45192,16 +49700,16 @@ func tclLoadStaticExtensionCmd(tls *crt.TLS, clientData uintptr, interp uintptr,
FzExtName uintptr
FpInit uintptr
}{})))) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+16453 /* "no such extensio..." */, zName, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+18149 /* "no such extensio..." */, zName, uintptr(0)))
return 1
}
if aExtension[i].FpInit != 0 {
- rc = (*(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aExtension)) + uintptr(i)*16 + 8 /* &.pInit */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* db */)), bp+72 /* &zErrMsg */, uintptr(0))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aExtension)) + uintptr(i)*16 + 8 /* &.pInit */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* db */)), bp+72 /* &zErrMsg */, uintptr(0))
} else {
rc = 0
}
if (rc != 0) || (*(*uintptr)(unsafe.Pointer(bp + 72 /* zErrMsg */)) != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+24, ts+16473 /* "initialization o..." */, zName, ts+16492 /* " failed: " */, *(*uintptr)(unsafe.Pointer(bp + 72 /* zErrMsg */)),
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+18169 /* "initialization o..." */, zName, ts+18188 /* " failed: " */, *(*uintptr)(unsafe.Pointer(bp + 72 /* zErrMsg */)),
uintptr(0)))
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* zErrMsg */)))
return 1
@@ -45210,42 +49718,43 @@ func tclLoadStaticExtensionCmd(tls *crt.TLS, clientData uintptr, interp uintptr,
return 0
}
-var aExtension = [20]struct {
+var aExtension = [21]struct {
FzExtName uintptr
FpInit uintptr
}{
- {FzExtName: ts + 16502 /* "amatch" */, FpInit: 0},
- {FzExtName: ts + 2713 /* "carray" */, FpInit: 0},
- {FzExtName: ts + 16509 /* "closure" */, FpInit: 0},
- {FzExtName: ts + 3357 /* "csv" */, FpInit: 0},
- {FzExtName: ts + 3370 /* "eval" */, FpInit: 0},
- {FzExtName: ts + 3448 /* "explain" */, FpInit: 0},
- {FzExtName: ts + 16517 /* "fileio" */, FpInit: 0},
- {FzExtName: ts + 3957 /* "fuzzer" */, FpInit: 0},
- {FzExtName: ts + 3981 /* "ieee754" */, FpInit: 0},
- {FzExtName: ts + 16524 /* "nextchar" */, FpInit: 0},
- {FzExtName: ts + 4493 /* "percentile" */, FpInit: 0},
- {FzExtName: ts + 4568 /* "prefixes" */, FpInit: 0},
- {FzExtName: ts + 4880 /* "regexp" */, FpInit: 0},
- {FzExtName: ts + 4887 /* "remember" */, FpInit: 0},
- {FzExtName: ts + 16533 /* "series" */, FpInit: 0},
- {FzExtName: ts + 16540 /* "spellfix" */, FpInit: 0},
- {FzExtName: ts + 16549 /* "totype" */, FpInit: 0},
- {FzExtName: ts + 6904 /* "unionvtab" */, FpInit: 0},
- {FzExtName: ts + 7446 /* "wholenumber" */, FpInit: 0},
- {FzExtName: ts + 7549 /* "zipfile" */, FpInit: 0},
-} /* test1.c:7280:5 */
+ {FzExtName: ts + 18198 /* "amatch" */, FpInit: 0},
+ {FzExtName: ts + 3862 /* "carray" */, FpInit: 0},
+ {FzExtName: ts + 18205 /* "closure" */, FpInit: 0},
+ {FzExtName: ts + 4506 /* "csv" */, FpInit: 0},
+ {FzExtName: ts + 4529 /* "decimal" */, FpInit: 0},
+ {FzExtName: ts + 4587 /* "eval" */, FpInit: 0},
+ {FzExtName: ts + 4665 /* "explain" */, FpInit: 0},
+ {FzExtName: ts + 18213 /* "fileio" */, FpInit: 0},
+ {FzExtName: ts + 5174 /* "fuzzer" */, FpInit: 0},
+ {FzExtName: ts + 5198 /* "ieee754" */, FpInit: 0},
+ {FzExtName: ts + 18220 /* "nextchar" */, FpInit: 0},
+ {FzExtName: ts + 5778 /* "percentile" */, FpInit: 0},
+ {FzExtName: ts + 5853 /* "prefixes" */, FpInit: 0},
+ {FzExtName: ts + 6165 /* "regexp" */, FpInit: 0},
+ {FzExtName: ts + 6172 /* "remember" */, FpInit: 0},
+ {FzExtName: ts + 18229 /* "series" */, FpInit: 0},
+ {FzExtName: ts + 18236 /* "spellfix" */, FpInit: 0},
+ {FzExtName: ts + 18245 /* "totype" */, FpInit: 0},
+ {FzExtName: ts + 8189 /* "unionvtab" */, FpInit: 0},
+ {FzExtName: ts + 8731 /* "wholenumber" */, FpInit: 0},
+ {FzExtName: ts + 8834 /* "zipfile" */, FpInit: 0},
+} /* test1.c:7305:5 */
// sorter_test_fakeheap BOOL
//
-func sorter_test_fakeheap(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7343:26: */
+func sorter_test_fakeheap(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7369:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
// var bArg int32 at bp, 4
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16556 /* "BOOL" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18252 /* "BOOL" */)
return 1
}
@@ -45255,10 +49764,10 @@ func sorter_test_fakeheap(tls *crt.TLS, clientData uintptr, interp uintptr, objc
if *(*int32)(unsafe.Pointer(bp /* bArg */)) != 0 {
if sqlite3.Xsqlite3Config.FpHeap == uintptr(0) {
- sqlite3.Xsqlite3Config.FpHeap = crt.UintptrFromInt64(int64(-1))
+ sqlite3.Xsqlite3Config.FpHeap = libc.UintptrFromInt64(int64(-1))
}
} else {
- if sqlite3.Xsqlite3Config.FpHeap == (crt.UintptrFromInt64(int64(-1))) {
+ if sqlite3.Xsqlite3Config.FpHeap == (libc.UintptrFromInt64(int64(-1))) {
sqlite3.Xsqlite3Config.FpHeap = uintptr(0)
}
}
@@ -45275,7 +49784,7 @@ func sorter_test_fakeheap(tls *crt.TLS, clientData uintptr, interp uintptr, objc
//
// Then execute statement $SQL2. Check that the statement returns the same
// set of integers in the same order as in the previous step (using $SQL1).
-func sorter_test_sort4_helper(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7383:26: */
+func sorter_test_sort4_helper(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7409:26: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -45300,7 +49809,7 @@ func sorter_test_sort4_helper(tls *crt.TLS, clientData uintptr, interp uintptr,
if !(objc != 5) {
goto __1
}
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16561 /* "DB SQL1 NSTEP SQ..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18257 /* "DB SQL1 NSTEP SQ..." */)
return 1
__1:
;
@@ -45338,7 +49847,7 @@ __5:
if !(a != sqlite3.Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pStmt */)), iB)) {
goto __8
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+16580 /* "data error: (a!=..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+18276 /* "data error: (a!=..." */, 0))
return 1
__8:
;
@@ -45391,14 +49900,14 @@ __14:
if !(iCksum1 != iCksum2) {
goto __15
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+16, ts+16599 /* "checksum mismatc..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+18295 /* "checksum mismatc..." */, 0))
return 1
__15:
;
return 0
sql_error:
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+16617 /* "sql error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */))), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+18313 /* "sql error: " */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* db */))), 0))
return 1
}
@@ -45413,7 +49922,7 @@ sql_error:
// 2 Jump based on an uninitialized variable
// 3 Read after free
// 4 Panic
-func test_bad_behavior(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7586:26: */
+func test_bad_behavior(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7612:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -45426,7 +49935,7 @@ func test_bad_behavior(tls *crt.TLS, clientData ClientData, interp uintptr, objc
var a uintptr
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16629 /* "TYPE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18325 /* "TYPE" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &iType */) != 0 {
@@ -45451,17 +49960,17 @@ func test_bad_behavior(tls *crt.TLS, clientData ClientData, interp uintptr, objc
}
case 3:
{
- a = crt.Xmalloc(tls, (uint64(unsafe.Sizeof(int32(0))) * uint64(10)))
+ a = libc.Xmalloc(tls, (uint64(unsafe.Sizeof(int32(0))) * uint64(10)))
for j = 0; j < 10; j++ {
*(*int32)(unsafe.Pointer(a + uintptr(j)*4)) = j
}
- crt.Xfree(tls, a)
+ libc.Xfree(tls, a)
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(a + uintptr(i)*4))))
break
}
case 4:
{
- tcl.XTcl_Panic(tls, ts+16634 /* "Deliberate panic" */, 0)
+ tcl.XTcl_Panic(tls, ts+18330 /* "Deliberate panic" */, 0)
break
}
}
@@ -45471,7 +49980,7 @@ func test_bad_behavior(tls *crt.TLS, clientData ClientData, interp uintptr, objc
// tclcmd: register_dbstat_vtab DB
//
// Cause the dbstat virtual table to be available on the connection DB
-func test_register_dbstat_vtab(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7636:26: */
+func test_register_dbstat_vtab(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7662:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -45494,7 +50003,7 @@ func test_register_dbstat_vtab(tls *crt.TLS, clientData uintptr, interp uintptr,
// tclcmd: sqlite3_db_config DB SETTING VALUE
//
// Invoke sqlite3_db_config() for one of the setting values.
-func test_sqlite3_db_config(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7670:26: */
+func test_sqlite3_db_config(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7696:26: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -45504,20 +50013,20 @@ func test_sqlite3_db_config(tls *crt.TLS, clientData uintptr, interp uintptr, ob
// var db uintptr at bp+16, 8
if (objc != 4) && (objc != 3) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16651 /* "DB SETTING [VALU..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18347 /* "DB SETTING [VALU..." */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+16 /* &db */) != 0 {
return 1
}
zSetting = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
- if sqlite3.Xsqlite3_strglob(tls, ts+16670 /* "SQLITE_*" */, zSetting) == 0 {
+ if sqlite3.Xsqlite3_strglob(tls, ts+18366 /* "SQLITE_*" */, zSetting) == 0 {
zSetting += uintptr(7)
}
- if sqlite3.Xsqlite3_strglob(tls, ts+16679 /* "DBCONFIG_*" */, zSetting) == 0 {
+ if sqlite3.Xsqlite3_strglob(tls, ts+18375 /* "DBCONFIG_*" */, zSetting) == 0 {
zSetting += uintptr(9)
}
- if sqlite3.Xsqlite3_strglob(tls, ts+16690 /* "ENABLE_*" */, zSetting) == 0 {
+ if sqlite3.Xsqlite3_strglob(tls, ts+18386 /* "ENABLE_*" */, zSetting) == 0 {
zSetting += uintptr(7)
}
for i = 0; i < (int32(uint64(unsafe.Sizeof(aSetting)) / uint64(unsafe.Sizeof(struct {
@@ -45525,7 +50034,7 @@ func test_sqlite3_db_config(tls *crt.TLS, clientData uintptr, interp uintptr, ob
FeVal int32
_ [4]byte
}{})))); i++ {
- if crt.Xstrcmp(tls, zSetting, aSetting[i].FzName) == 0 {
+ if libc.Xstrcmp(tls, zSetting, aSetting[i].FzName) == 0 {
break
}
}
@@ -45535,7 +50044,7 @@ func test_sqlite3_db_config(tls *crt.TLS, clientData uintptr, interp uintptr, ob
_ [4]byte
}{})))) {
tcl.XTcl_SetObjResult(tls, interp,
- tcl.XTcl_NewStringObj(tls, ts+16699 /* "unknown sqlite3_..." */, -1))
+ tcl.XTcl_NewStringObj(tls, ts+18395 /* "unknown sqlite3_..." */, -1))
return 1
}
if objc == 4 {
@@ -45545,7 +50054,7 @@ func test_sqlite3_db_config(tls *crt.TLS, clientData uintptr, interp uintptr, ob
} else {
*(*int32)(unsafe.Pointer(bp + 24 /* v */)) = -1
}
- sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), aSetting[i].FeVal, crt.VaList(bp, *(*int32)(unsafe.Pointer(bp + 24 /* v */)), bp+24 /* &v */))
+ sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), aSetting[i].FeVal, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 24 /* v */)), bp+24 /* &v */))
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, *(*int32)(unsafe.Pointer(bp + 24 /* v */))))
return 0
}
@@ -45555,24 +50064,24 @@ var aSetting = [14]struct {
FeVal int32
_ [4]byte
}{
- {FzName: ts + 16733 /* "FKEY" */, FeVal: 1002},
- {FzName: ts + 16738 /* "TRIGGER" */, FeVal: 1003},
- {FzName: ts + 16746 /* "FTS3_TOKENIZER" */, FeVal: 1004},
- {FzName: ts + 16761 /* "LOAD_EXTENSION" */, FeVal: 1005},
- {FzName: ts + 16776 /* "NO_CKPT_ON_CLOSE" */, FeVal: 1006},
- {FzName: ts + 16793 /* "QPSG" */, FeVal: 1007},
- {FzName: ts + 16798 /* "TRIGGER_EQP" */, FeVal: 1008},
- {FzName: ts + 16810 /* "RESET_DB" */, FeVal: 1009},
- {FzName: ts + 16819 /* "DEFENSIVE" */, FeVal: 1010},
- {FzName: ts + 16829 /* "WRITABLE_SCHEMA" */, FeVal: 1011},
- {FzName: ts + 16845 /* "LEGACY_ALTER_TAB..." */, FeVal: 1012},
- {FzName: ts + 16864 /* "DQS_DML" */, FeVal: 1013},
- {FzName: ts + 16872 /* "DQS_DDL" */, FeVal: 1014},
- {FzName: ts + 16880 /* "LEGACY_FILE_FORM..." */, FeVal: 1016},
-} /* test1.c:7679:5 */
+ {FzName: ts + 18429 /* "FKEY" */, FeVal: 1002},
+ {FzName: ts + 18434 /* "TRIGGER" */, FeVal: 1003},
+ {FzName: ts + 18442 /* "FTS3_TOKENIZER" */, FeVal: 1004},
+ {FzName: ts + 18457 /* "LOAD_EXTENSION" */, FeVal: 1005},
+ {FzName: ts + 18472 /* "NO_CKPT_ON_CLOSE" */, FeVal: 1006},
+ {FzName: ts + 18489 /* "QPSG" */, FeVal: 1007},
+ {FzName: ts + 18494 /* "TRIGGER_EQP" */, FeVal: 1008},
+ {FzName: ts + 18506 /* "RESET_DB" */, FeVal: 1009},
+ {FzName: ts + 18515 /* "DEFENSIVE" */, FeVal: 1010},
+ {FzName: ts + 18525 /* "WRITABLE_SCHEMA" */, FeVal: 1011},
+ {FzName: ts + 18541 /* "LEGACY_ALTER_TAB..." */, FeVal: 1012},
+ {FzName: ts + 18560 /* "DQS_DML" */, FeVal: 1013},
+ {FzName: ts + 18568 /* "DQS_DDL" */, FeVal: 1014},
+ {FzName: ts + 18576 /* "LEGACY_FILE_FORM..." */, FeVal: 1016},
+} /* test1.c:7705:5 */
// Change the name of the main database schema from "main" to "icecube".
-func test_dbconfig_maindbname_icecube(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7730:26: */
+func test_dbconfig_maindbname_icecube(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7756:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -45586,7 +50095,7 @@ func test_dbconfig_maindbname_icecube(tls *crt.TLS, clientData uintptr, interp u
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+8 /* &db */) != 0 {
return 1
}
- rc = sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* db */)), 1000, crt.VaList(bp, ts+16899 /* "icecube" */))
+ rc = sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* db */)), 1000, libc.VaList(bp, ts+18595 /* "icecube" */))
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, rc))
return 0
}
@@ -45594,12 +50103,12 @@ func test_dbconfig_maindbname_icecube(tls *crt.TLS, clientData uintptr, interp u
}
// Usage: sqlite3_mmap_warm DB DBNAME
-func test_mmap_warm(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7753:26: */
+func test_mmap_warm(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7779:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
if (objc != 2) && (objc != 3) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16907 /* "DB ?DBNAME?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18603 /* "DB ?DBNAME?" */)
return 1
} else {
var rc int32
@@ -45619,6 +50128,41 @@ func test_mmap_warm(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
return int32(0)
}
+// Usage: test_write_db DB OFFSET DATA
+//
+// Obtain the sqlite3_file* object for the database file for the "main" db
+// of handle DB. Then invoke its xWrite method to write data DATA to offset
+// OFFSET.
+func test_write_db(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7812:26: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ *(*uintptr)(unsafe.Pointer(bp /* db */)) = uintptr(0)
+ *(*Tcl_WideInt)(unsafe.Pointer(bp + 8 /* iOff */)) = int64(0)
+ var aData uintptr = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 16 /* nData */)) = 0
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pFile */)) = uintptr(0)
+ var rc int32
+
+ if objc != 4 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18615 /* "DB OFFSET DATA" */)
+ return 1
+ }
+ if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
+ return 1
+ }
+ if tcl.XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+8 /* &iOff */) != 0 {
+ return 1
+ }
+ aData = tcl.XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), bp+16 /* &nData */)
+
+ sqlite3.Xsqlite3_file_control(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+84 /* "main" */, 7, bp+24 /* &pFile */)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pFile */)))).FpMethods + 24 /* &.xWrite */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pFile */)), aData, *(*int32)(unsafe.Pointer(bp + 16 /* nData */)), int64(*(*Tcl_WideInt)(unsafe.Pointer(bp + 8 /* iOff */))))
+
+ tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1))
+ return 0
+}
+
// Usage: decode_hexdb TEXT
//
// Example: db deserialize [decode_hexdb $output_of_dbtotxt]
@@ -45626,7 +50170,7 @@ func test_mmap_warm(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// This routine returns a byte-array for an SQLite database file that
// is constructed from a text input which is the output of the "dbtotxt"
// utility.
-func test_decode_hexdb(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7788:26: */
+func test_decode_hexdb(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test1.c:7849:26: */
bp := tls.Alloc(296)
defer tls.Free(296)
@@ -45645,7 +50189,7 @@ func test_decode_hexdb(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
// var x [16]uint32 at bp+232, 64
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16919 /* "HEXDB" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18630 /* "HEXDB" */)
return 1
}
zIn = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -45662,34 +50206,34 @@ func test_decode_hexdb(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
if a == uintptr(0) {
// var pgsz int32 at bp+220, 4
- rc = crt.X__isoc99_sscanf(tls, (zIn + uintptr(i)), ts+16925 /* "| size %d pagesi..." */, crt.VaList(bp, bp+216 /* &n */, bp+220 /* &pgsz */))
+ rc = libc.X__isoc99_sscanf(tls, (zIn + uintptr(i)), ts+18636 /* "| size %d pagesi..." */, libc.VaList(bp, bp+216 /* &n */, bp+220 /* &pgsz */))
if rc != 2 {
continue
}
if ((*(*int32)(unsafe.Pointer(bp + 220 /* pgsz */)) < 512) || (*(*int32)(unsafe.Pointer(bp + 220 /* pgsz */)) > 65536)) || ((*(*int32)(unsafe.Pointer(bp + 220 /* pgsz */)) & (*(*int32)(unsafe.Pointer(bp + 220 /* pgsz */)) - 1)) != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+16, ts+16947 /* "bad 'pagesize' f..." */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+18658 /* "bad 'pagesize' f..." */, uintptr(0)))
return 1
}
*(*int32)(unsafe.Pointer(bp + 216 /* n */)) = (((*(*int32)(unsafe.Pointer(bp + 216 /* n */)) + *(*int32)(unsafe.Pointer(bp + 220 /* pgsz */))) - 1) & ^(*(*int32)(unsafe.Pointer(bp + 220 /* pgsz */)) - 1)) // Round n up to the next multiple of pgsz
if *(*int32)(unsafe.Pointer(bp + 216 /* n */)) < 512 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+16968 /* "bad 'size' field" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+18679 /* "bad 'size' field" */, uintptr(0)))
return 1
}
- a = crt.Xmalloc(tls, uint64(*(*int32)(unsafe.Pointer(bp + 216 /* n */))))
+ a = libc.Xmalloc(tls, uint64(*(*int32)(unsafe.Pointer(bp + 216 /* n */))))
if a == uintptr(0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, ts+1929 /* "out of memory" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+1929 /* "out of memory" */, uintptr(0)))
return 1
}
- crt.Xmemset(tls, a, 0, uint64(*(*int32)(unsafe.Pointer(bp + 216 /* n */))))
+ libc.Xmemset(tls, a, 0, uint64(*(*int32)(unsafe.Pointer(bp + 216 /* n */))))
continue
}
- rc = crt.X__isoc99_sscanf(tls, (zIn + uintptr(i)), ts+16985 /* "| page %d offset..." */, crt.VaList(bp+64, bp+224 /* &j */, bp+228 /* &k */))
+ rc = libc.X__isoc99_sscanf(tls, (zIn + uintptr(i)), ts+18696 /* "| page %d offset..." */, libc.VaList(bp+64, bp+224 /* &j */, bp+228 /* &k */))
if rc == 2 {
iOffset = *(*int32)(unsafe.Pointer(bp + 228 /* k */))
continue
}
- rc = crt.X__isoc99_sscanf(tls, (zIn + uintptr(i)), ts+17005, /* "| %d: %x %x %x %..." */
- crt.VaList(bp+80, bp+224 /* &j */, (bp+232 /* &x */ +uintptr(0)*4), (bp+232 /* &x */ +uintptr(1)*4), (bp+232 /* &x */ +uintptr(2)*4), (bp+232 /* &x */ +uintptr(3)*4), (bp+232 /* &x */ +uintptr(4)*4), (bp+232 /* &x */ +uintptr(5)*4), (bp+232 /* &x */ +uintptr(6)*4), (bp+232 /* &x */ +uintptr(7)*4),
+ rc = libc.X__isoc99_sscanf(tls, (zIn + uintptr(i)), ts+18716, /* "| %d: %x %x %x %..." */
+ libc.VaList(bp+80, bp+224 /* &j */, (bp+232 /* &x */ +uintptr(0)*4), (bp+232 /* &x */ +uintptr(1)*4), (bp+232 /* &x */ +uintptr(2)*4), (bp+232 /* &x */ +uintptr(3)*4), (bp+232 /* &x */ +uintptr(4)*4), (bp+232 /* &x */ +uintptr(5)*4), (bp+232 /* &x */ +uintptr(6)*4), (bp+232 /* &x */ +uintptr(7)*4),
(bp+232 /* &x */ +uintptr(8)*4), (bp+232 /* &x */ +uintptr(9)*4), (bp+232 /* &x */ +uintptr(10)*4), (bp+232 /* &x */ +uintptr(11)*4), (bp+232 /* &x */ +uintptr(12)*4), (bp+232 /* &x */ +uintptr(13)*4), (bp+232 /* &x */ +uintptr(14)*4), (bp+232 /* &x */ +uintptr(15)*4)))
if rc == 17 {
*(*int32)(unsafe.Pointer(bp + 228 /* k */)) = (iOffset + *(*int32)(unsafe.Pointer(bp + 224 /* j */)))
@@ -45703,301 +50247,317 @@ func test_decode_hexdb(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
}
}
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewByteArrayObj(tls, a, *(*int32)(unsafe.Pointer(bp + 216 /* n */))))
- crt.Xfree(tls, a)
+ libc.Xfree(tls, a)
return 0
}
// Register commands with the TCL interpreter.
-func Sqlitetest1_Init(tls *crt.TLS, interp uintptr) int32 { /* test1.c:7860:5: */
+func Sqlitetest1_Init(tls *libc.TLS, interp uintptr) int32 { /* test1.c:7921:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd1)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateCommand(tls, interp, aCmd[i].FzName, aCmd[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateCommand(tls, interp, aCmd1[i].FzName, aCmd1[i].FxProc, uintptr(0), uintptr(0))
}
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd1)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd[i].FzName,
- aObjCmd[i].FxProc, aObjCmd[i].FclientData, uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd1[i].FzName,
+ aObjCmd1[i].FxProc, aObjCmd1[i].FclientData, uintptr(0))
}
- tcl.XTcl_LinkVar(tls, interp, ts+17059, /* "sqlite_search_co..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+18770, /* "sqlite_search_co..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_search_count)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17079, /* "sqlite_found_cou..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+18790, /* "sqlite_found_cou..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_found_count)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17098, /* "sqlite_sort_coun..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+18809, /* "sqlite_sort_coun..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_sort_count)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17116, /* "sqlite3_max_blob..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+18827, /* "sqlite3_max_blob..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_max_blobsize)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17137, /* "sqlite_like_coun..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+18848, /* "sqlite_like_coun..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_like_count)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17155, /* "sqlite_interrupt..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+18866, /* "sqlite_interrupt..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_interrupt_count)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17178, /* "sqlite_open_file..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+18889, /* "sqlite_open_file..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_open_file_count)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17201, /* "sqlite_current_t..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+18912, /* "sqlite_current_t..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_current_time)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17221, /* "sqlite3_xferopt_..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+18932, /* "sqlite3_xferopt_..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_xferopt_count)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17243, /* "sqlite3_pager_re..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+18954, /* "sqlite3_pager_re..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_pager_readdb_count)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17270, /* "sqlite3_pager_wr..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+18981, /* "sqlite3_pager_wr..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_pager_writedb_count)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17298, /* "sqlite3_pager_wr..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+19009, /* "sqlite3_pager_wr..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_pager_writej_count)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17325, /* "unaligned_string..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+19036, /* "unaligned_string..." */
uintptr(unsafe.Pointer(&unaligned_string_counter)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17350, /* "sqlite_last_need..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+19061, /* "sqlite_last_need..." */
uintptr(unsafe.Pointer(&pzNeededCollation)), (4 | 0x80))
{
- tcl.XTcl_LinkVar(tls, interp, ts+17379, /* "sqlite_query_pla..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+19090, /* "sqlite_query_pla..." */
uintptr(unsafe.Pointer(&query_plan)), (4 | 0x80))
}
- tcl.XTcl_LinkVar(tls, interp, ts+17397, /* "sqlite_opentemp_..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+19108, /* "sqlite_opentemp_..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_opentemp_count)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17419, /* "sqlite_static_bi..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+19130, /* "sqlite_static_bi..." */
uintptr(unsafe.Pointer(&sqlite_static_bind_value)), 4)
- tcl.XTcl_LinkVar(tls, interp, ts+17444, /* "sqlite_static_bi..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+19155, /* "sqlite_static_bi..." */
uintptr(unsafe.Pointer(&sqlite_static_bind_nbyte)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17469, /* "sqlite_temp_dire..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+19180, /* "sqlite_temp_dire..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_temp_directory)), 4)
- tcl.XTcl_LinkVar(tls, interp, ts+17491, /* "sqlite_data_dire..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+19202, /* "sqlite_data_dire..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_data_directory)), 4)
- tcl.XTcl_LinkVar(tls, interp, ts+17513, /* "bitmask_size" */
+ tcl.XTcl_LinkVar(tls, interp, ts+19224, /* "bitmask_size" */
uintptr(unsafe.Pointer(&bitmask_size)), (1 | 0x80))
- tcl.XTcl_LinkVar(tls, interp, ts+17526, /* "longdouble_size" */
+ tcl.XTcl_LinkVar(tls, interp, ts+19237, /* "longdouble_size" */
uintptr(unsafe.Pointer(&longdouble_size)), (1 | 0x80))
- tcl.XTcl_LinkVar(tls, interp, ts+17542, /* "sqlite_sync_coun..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+19253, /* "sqlite_sync_coun..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_sync_count)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+17560, /* "sqlite_fullsync_..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+19271, /* "sqlite_fullsync_..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_fullsync_count)), 1)
return 0
}
-var iZero int32 = 0 /* test1.c:7873:14 */
-var aCmd = [40]struct {
+var iZero int32 = 0 /* test1.c:7934:14 */
+var aCmd1 = [40]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 17582 /* "db_enter" */, FxProc: 0},
- {FzName: ts + 17591 /* "db_leave" */, FxProc: 0},
- {FzName: ts + 17600 /* "sqlite3_mprintf_..." */, FxProc: 0},
- {FzName: ts + 17620 /* "sqlite3_mprintf_..." */, FxProc: 0},
- {FzName: ts + 17642 /* "sqlite3_mprintf_..." */, FxProc: 0},
- {FzName: ts + 17663 /* "sqlite3_mprintf_..." */, FxProc: 0},
- {FzName: ts + 17683 /* "sqlite3_snprintf..." */, FxProc: 0},
- {FzName: ts + 17704 /* "sqlite3_mprintf_..." */, FxProc: 0},
- {FzName: ts + 17728 /* "sqlite3_mprintf_..." */, FxProc: 0},
- {FzName: ts + 17751 /* "sqlite3_mprintf_..." */, FxProc: 0},
- {FzName: ts + 17774 /* "sqlite3_mprintf_..." */, FxProc: 0},
- {FzName: ts + 17800 /* "sqlite3_mprintf_..." */, FxProc: 0},
- {FzName: ts + 17823 /* "sqlite3_mprintf_..." */, FxProc: 0},
- {FzName: ts + 17846 /* "sqlite3_snprintf..." */, FxProc: 0},
- {FzName: ts + 17867 /* "sqlite3_last_ins..." */, FxProc: 0},
- {FzName: ts + 17893 /* "sqlite3_exec_pri..." */, FxProc: 0},
- {FzName: ts + 17913 /* "sqlite3_exec_hex" */, FxProc: 0},
- {FzName: ts + 17930 /* "sqlite3_exec" */, FxProc: 0},
- {FzName: ts + 17943 /* "sqlite3_exec_nr" */, FxProc: 0},
- {FzName: ts + 17959 /* "sqlite3_get_tabl..." */, FxProc: 0},
- {FzName: ts + 17984 /* "sqlite3_close" */, FxProc: 0},
- {FzName: ts + 17998 /* "sqlite3_close_v2" */, FxProc: 0},
- {FzName: ts + 18015 /* "sqlite3_create_f..." */, FxProc: 0},
- {FzName: ts + 18039 /* "sqlite3_create_a..." */, FxProc: 0},
- {FzName: ts + 18064 /* "sqlite3_drop_mod..." */, FxProc: 0},
- {FzName: ts + 18085 /* "sqlite_register_..." */, FxProc: 0},
- {FzName: ts + 18115 /* "sqlite_abort" */, FxProc: 0},
- {FzName: ts + 18128 /* "sqlite_bind" */, FxProc: 0},
- {FzName: ts + 18140 /* "breakpoint" */, FxProc: 0},
- {FzName: ts + 18151 /* "sqlite3_key" */, FxProc: 0},
- {FzName: ts + 18163 /* "sqlite3_rekey" */, FxProc: 0},
- {FzName: ts + 18177 /* "sqlite_set_magic" */, FxProc: 0},
- {FzName: ts + 18194 /* "sqlite3_interrup..." */, FxProc: 0},
- {FzName: ts + 18212 /* "sqlite_delete_fu..." */, FxProc: 0},
- {FzName: ts + 18235 /* "sqlite_delete_co..." */, FxProc: 0},
- {FzName: ts + 18259 /* "sqlite3_get_auto..." */, FxProc: 0},
- {FzName: ts + 18282 /* "sqlite3_busy_tim..." */, FxProc: 0},
- {FzName: ts + 18303 /* "printf" */, FxProc: 0},
- {FzName: ts + 18310 /* "sqlite3IoTrace" */, FxProc: 0},
- {FzName: ts + 18325 /* "clang_sanitize_a..." */, FxProc: 0},
-} /* test1.c:7877:5 */
-var aObjCmd = [139]struct {
+ {FzName: ts + 19293 /* "db_enter" */, FxProc: 0},
+ {FzName: ts + 19302 /* "db_leave" */, FxProc: 0},
+ {FzName: ts + 19311 /* "sqlite3_mprintf_..." */, FxProc: 0},
+ {FzName: ts + 19331 /* "sqlite3_mprintf_..." */, FxProc: 0},
+ {FzName: ts + 19353 /* "sqlite3_mprintf_..." */, FxProc: 0},
+ {FzName: ts + 19374 /* "sqlite3_mprintf_..." */, FxProc: 0},
+ {FzName: ts + 19394 /* "sqlite3_snprintf..." */, FxProc: 0},
+ {FzName: ts + 19415 /* "sqlite3_mprintf_..." */, FxProc: 0},
+ {FzName: ts + 19439 /* "sqlite3_mprintf_..." */, FxProc: 0},
+ {FzName: ts + 19462 /* "sqlite3_mprintf_..." */, FxProc: 0},
+ {FzName: ts + 19485 /* "sqlite3_mprintf_..." */, FxProc: 0},
+ {FzName: ts + 19511 /* "sqlite3_mprintf_..." */, FxProc: 0},
+ {FzName: ts + 19534 /* "sqlite3_mprintf_..." */, FxProc: 0},
+ {FzName: ts + 19557 /* "sqlite3_snprintf..." */, FxProc: 0},
+ {FzName: ts + 19578 /* "sqlite3_last_ins..." */, FxProc: 0},
+ {FzName: ts + 19604 /* "sqlite3_exec_pri..." */, FxProc: 0},
+ {FzName: ts + 19624 /* "sqlite3_exec_hex" */, FxProc: 0},
+ {FzName: ts + 19641 /* "sqlite3_exec" */, FxProc: 0},
+ {FzName: ts + 19654 /* "sqlite3_exec_nr" */, FxProc: 0},
+ {FzName: ts + 19670 /* "sqlite3_get_tabl..." */, FxProc: 0},
+ {FzName: ts + 19695 /* "sqlite3_close" */, FxProc: 0},
+ {FzName: ts + 19709 /* "sqlite3_close_v2" */, FxProc: 0},
+ {FzName: ts + 19726 /* "sqlite3_create_f..." */, FxProc: 0},
+ {FzName: ts + 19750 /* "sqlite3_create_a..." */, FxProc: 0},
+ {FzName: ts + 19775 /* "sqlite3_drop_mod..." */, FxProc: 0},
+ {FzName: ts + 19796 /* "sqlite_register_..." */, FxProc: 0},
+ {FzName: ts + 19826 /* "sqlite_abort" */, FxProc: 0},
+ {FzName: ts + 19839 /* "sqlite_bind" */, FxProc: 0},
+ {FzName: ts + 19851 /* "breakpoint" */, FxProc: 0},
+ {FzName: ts + 19862 /* "sqlite3_key" */, FxProc: 0},
+ {FzName: ts + 19874 /* "sqlite3_rekey" */, FxProc: 0},
+ {FzName: ts + 19888 /* "sqlite_set_magic" */, FxProc: 0},
+ {FzName: ts + 19905 /* "sqlite3_interrup..." */, FxProc: 0},
+ {FzName: ts + 19923 /* "sqlite_delete_fu..." */, FxProc: 0},
+ {FzName: ts + 19946 /* "sqlite_delete_co..." */, FxProc: 0},
+ {FzName: ts + 19970 /* "sqlite3_get_auto..." */, FxProc: 0},
+ {FzName: ts + 19993 /* "sqlite3_busy_tim..." */, FxProc: 0},
+ {FzName: ts + 20014 /* "printf" */, FxProc: 0},
+ {FzName: ts + 20021 /* "sqlite3IoTrace" */, FxProc: 0},
+ {FzName: ts + 20036 /* "clang_sanitize_a..." */, FxProc: 0},
+} /* test1.c:7938:5 */
+var aObjCmd1 = [155]struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{
- {FzName: ts + 18348 /* "sqlite3_db_confi..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18366 /* "bad_behavior" */, FxProc: 0, FclientData: 0},
- {FzName: ts + 18379 /* "register_dbstat_..." */, FxProc: 0},
- {FzName: ts + 18400 /* "sqlite3_connecti..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18427 /* "intarray_addr" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18441 /* "int64array_addr" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18457 /* "doublearray_addr" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18474 /* "textarray_addr" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18489 /* "sqlite3_bind_int" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18506 /* "sqlite3_bind_zer..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18528 /* "sqlite3_bind_zer..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18552 /* "sqlite3_bind_int..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18571 /* "sqlite3_bind_dou..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18591 /* "sqlite3_bind_nul..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18609 /* "sqlite3_bind_tex..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18627 /* "sqlite3_bind_tex..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18647 /* "sqlite3_bind_blo..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18665 /* "sqlite3_bind_par..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18694 /* "sqlite3_bind_par..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18722 /* "sqlite3_bind_par..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18751 /* "sqlite3_clear_bi..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18774 /* "sqlite3_sleep" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18788 /* "sqlite3_errcode" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18804 /* "sqlite3_extended..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18829 /* "sqlite3_errmsg" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18844 /* "sqlite3_errmsg16" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18861 /* "sqlite3_open" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18874 /* "sqlite3_open16" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18889 /* "sqlite3_open_v2" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18905 /* "sqlite3_complete..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18924 /* "sqlite3_normaliz..." */, FxProc: 0, FclientData: uintptr(0)},
-
- {FzName: ts + 18942 /* "sqlite3_prepare" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18958 /* "sqlite3_prepare1..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18976 /* "sqlite3_prepare_..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 18995 /* "sqlite3_prepare_..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19014 /* "sqlite3_prepare_..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19038 /* "sqlite3_prepare1..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19059 /* "sqlite3_finalize" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19076 /* "sqlite3_stmt_sta..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19096 /* "sqlite3_reset" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19110 /* "sqlite3_expired" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19126 /* "sqlite3_transfer..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19152 /* "sqlite3_changes" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19168 /* "sqlite3_step" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19181 /* "sqlite3_sql" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19193 /* "sqlite3_expanded..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19214 /* "sqlite3_next_stm..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19232 /* "sqlite3_stmt_rea..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19254 /* "sqlite3_stmt_ise..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19277 /* "sqlite3_stmt_bus..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19295 /* "uses_stmt_journa..." */, FxProc: 0, FclientData: uintptr(0)},
-
- {FzName: ts + 19313 /* "sqlite3_release_..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19336 /* "sqlite3_db_relea..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19362 /* "sqlite3_db_cache..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19384 /* "sqlite3_system_e..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19405 /* "sqlite3_db_filen..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19425 /* "sqlite3_db_reado..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19445 /* "sqlite3_soft_hea..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19469 /* "sqlite3_soft_hea..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19495 /* "sqlite3_hard_hea..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19521 /* "sqlite3_thread_c..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19544 /* "sqlite3_pager_re..." */, FxProc: 0, FclientData: uintptr(0)},
-
- {FzName: ts + 19568 /* "sqlite3_load_ext..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19591 /* "sqlite3_enable_l..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19621 /* "sqlite3_extended..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19651 /* "sqlite3_limit" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19665 /* "dbconfig_maindbn..." */, FxProc: 0},
-
- {FzName: ts + 19693 /* "save_prng_state" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19709 /* "restore_prng_sta..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19728 /* "reset_prng_state" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19745 /* "prng_seed" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19755 /* "database_never_c..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19778 /* "database_may_be_..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19802 /* "optimization_con..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19823 /* "tcl_objproc" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20059 /* "sqlite3_db_confi..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20077 /* "bad_behavior" */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 20090 /* "register_dbstat_..." */, FxProc: 0},
+ {FzName: ts + 20111 /* "sqlite3_connecti..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20138 /* "intarray_addr" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20152 /* "int64array_addr" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20168 /* "doublearray_addr" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20185 /* "textarray_addr" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20200 /* "sqlite3_bind_int" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20217 /* "sqlite3_bind_zer..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20239 /* "sqlite3_bind_zer..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20263 /* "sqlite3_bind_int..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20282 /* "sqlite3_bind_dou..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20302 /* "sqlite3_bind_nul..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20320 /* "sqlite3_bind_tex..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20338 /* "sqlite3_bind_tex..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20358 /* "sqlite3_bind_blo..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20376 /* "sqlite3_bind_par..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20405 /* "sqlite3_bind_par..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20433 /* "sqlite3_bind_par..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20462 /* "sqlite3_clear_bi..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20485 /* "sqlite3_sleep" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20499 /* "sqlite3_errcode" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20515 /* "sqlite3_extended..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20540 /* "sqlite3_errmsg" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20555 /* "sqlite3_errmsg16" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20572 /* "sqlite3_open" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20585 /* "sqlite3_open16" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20600 /* "sqlite3_open_v2" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20616 /* "sqlite3_complete..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20635 /* "sqlite3_normaliz..." */, FxProc: 0, FclientData: uintptr(0)},
+
+ {FzName: ts + 20653 /* "sqlite3_prepare" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20669 /* "sqlite3_prepare1..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20687 /* "sqlite3_prepare_..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20706 /* "sqlite3_prepare_..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20725 /* "sqlite3_prepare_..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20749 /* "sqlite3_prepare1..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20770 /* "sqlite3_finalize" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20787 /* "sqlite3_stmt_sta..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20807 /* "sqlite3_reset" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20821 /* "sqlite3_expired" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20837 /* "sqlite3_transfer..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20863 /* "sqlite3_changes" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20879 /* "sqlite3_step" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20892 /* "sqlite3_sql" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20904 /* "sqlite3_expanded..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20925 /* "sqlite3_next_stm..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20943 /* "sqlite3_stmt_rea..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20965 /* "sqlite3_stmt_ise..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 20988 /* "sqlite3_stmt_bus..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21006 /* "uses_stmt_journa..." */, FxProc: 0, FclientData: uintptr(0)},
+
+ {FzName: ts + 21024 /* "sqlite3_release_..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21047 /* "sqlite3_db_relea..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21073 /* "sqlite3_db_cache..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21095 /* "sqlite3_system_e..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21116 /* "sqlite3_db_filen..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21136 /* "sqlite3_db_reado..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21156 /* "sqlite3_soft_hea..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21180 /* "sqlite3_soft_hea..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21206 /* "sqlite3_hard_hea..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21232 /* "sqlite3_thread_c..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21255 /* "sqlite3_pager_re..." */, FxProc: 0, FclientData: uintptr(0)},
+
+ {FzName: ts + 21279 /* "sqlite3_load_ext..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21302 /* "sqlite3_enable_l..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21332 /* "sqlite3_extended..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21362 /* "sqlite3_limit" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21376 /* "dbconfig_maindbn..." */, FxProc: 0},
+
+ {FzName: ts + 21404 /* "save_prng_state" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21420 /* "restore_prng_sta..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21439 /* "reset_prng_state" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21456 /* "prng_seed" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21466 /* "extra_schema_che..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21486 /* "database_never_c..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21509 /* "database_may_be_..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21533 /* "optimization_con..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21554 /* "tcl_objproc" */, FxProc: 0, FclientData: uintptr(0)},
// sqlite3_column_*() API
- {FzName: ts + 19835 /* "sqlite3_column_c..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19856 /* "sqlite3_data_cou..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19875 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19895 /* "sqlite3_column_b..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19915 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19937 /* "sqlite3_column_i..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 19958 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 19978 /* "sqlite3_column_n..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 19998 /* "sqlite3_column_i..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 20017 /* "sqlite3_column_b..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 20038 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: 0},
-
- {FzName: ts + 20062 /* "sqlite3_column_b..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 20085 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 20107 /* "sqlite3_column_n..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 20129 /* "add_alignment_te..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20159 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 20185 /* "sqlite3_create_c..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20213 /* "sqlite3_global_r..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20236 /* "working_64bit_in..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20254 /* "vfs_unlink_test" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20270 /* "vfs_initfail_tes..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20288 /* "vfs_unregister_a..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20307 /* "vfs_reregister_a..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20326 /* "file_control_tes..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20344 /* "file_control_las..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20372 /* "file_control_loc..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20400 /* "file_control_chu..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20428 /* "file_control_siz..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20455 /* "file_control_dat..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20481 /* "file_control_per..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20506 /* "file_control_pow..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20539 /* "file_control_vfs..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20560 /* "file_control_tem..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20586 /* "sqlite3_vfs_list" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20603 /* "sqlite3_create_f..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21566 /* "sqlite3_column_c..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21587 /* "sqlite3_data_cou..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21606 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21626 /* "sqlite3_column_b..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21646 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21668 /* "sqlite3_column_i..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21689 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 21709 /* "sqlite3_column_n..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 21729 /* "sqlite3_column_i..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 21748 /* "sqlite3_column_b..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 21769 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 21793 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 21822 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 21848 /* "sqlite3_column_o..." */, FxProc: 0, FclientData: 0},
+
+ {FzName: ts + 21875 /* "sqlite3_column_b..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 21898 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 21920 /* "sqlite3_column_n..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 21942 /* "add_alignment_te..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 21972 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 21998 /* "sqlite3_column_d..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 22029 /* "sqlite3_column_t..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 22057 /* "sqlite3_column_o..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 22086 /* "sqlite3_create_c..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22114 /* "sqlite3_global_r..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22137 /* "working_64bit_in..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22155 /* "vfs_unlink_test" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22171 /* "vfs_initfail_tes..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22189 /* "vfs_unregister_a..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22208 /* "vfs_reregister_a..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22227 /* "file_control_tes..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22245 /* "file_control_las..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22273 /* "file_control_loc..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22301 /* "file_control_chu..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22329 /* "file_control_siz..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22356 /* "file_control_dat..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22382 /* "file_control_per..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22407 /* "file_control_pow..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22440 /* "file_control_vfs..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22461 /* "file_control_tem..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22487 /* "sqlite3_vfs_list" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22504 /* "sqlite3_create_f..." */, FxProc: 0, FclientData: uintptr(0)},
// Functions from os.h
- {FzName: ts + 20630 /* "add_test_collate" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20647 /* "add_test_collate..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20671 /* "add_test_functio..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20689 /* "add_test_utf16bi..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20715 /* "sqlite3_test_err..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20735 /* "tcl_variable_typ..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20753 /* "sqlite3_enable_s..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20781 /* "sqlite3_shared_c..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20809 /* "sqlite3_libversi..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20835 /* "sqlite3_table_co..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20865 /* "sqlite3_blob_reo..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20885 /* "pcache_stats" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20898 /* "sqlite3_unlock_n..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20920 /* "sqlite3_wal_chec..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20943 /* "sqlite3_wal_chec..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20969 /* "sqlite3_wal_auto..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 20996 /* "test_sqlite3_log" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 21013 /* "print_explain_qu..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 21038 /* "sqlite3_test_con..." */, FxProc: 0},
- {FzName: ts + 21059 /* "getrusage" */, FxProc: 0},
- {FzName: ts + 21069 /* "load_static_exte..." */, FxProc: 0},
- {FzName: ts + 21091 /* "sorter_test_fake..." */, FxProc: 0},
- {FzName: ts + 21112 /* "sorter_test_sort..." */, FxProc: 0},
- {FzName: ts + 21137 /* "vfs_current_time..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 21160 /* "sqlite3_delete_d..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 21184 /* "atomic_batch_wri..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 21203 /* "sqlite3_mmap_war..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 21221 /* "sqlite3_config_s..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 21246 /* "decode_hexdb" */, FxProc: 0, FclientData: uintptr(0)},
-} /* test1.c:7925:5 */
-var bitmask_size int32 = (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) /* test1.c:8143:14 */
-var longdouble_size int32 = int32(unsafe.Sizeof(float64(0))) /* test1.c:8144:14 */
-var query_plan uintptr = ts + 21259 /* "*** OBSOLETE VAR..." */ /* test1.c:8219:23 */
+ {FzName: ts + 22531 /* "add_test_collate" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22548 /* "add_test_collate..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22572 /* "add_test_functio..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22590 /* "add_test_utf16bi..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22616 /* "sqlite3_test_err..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22636 /* "tcl_variable_typ..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22654 /* "sqlite3_enable_s..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22682 /* "sqlite3_shared_c..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22710 /* "sqlite3_libversi..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22736 /* "sqlite3_table_co..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22766 /* "sqlite3_blob_reo..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22786 /* "pcache_stats" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22799 /* "sqlite3_unlock_n..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22821 /* "sqlite3_wal_chec..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22844 /* "sqlite3_wal_chec..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22870 /* "sqlite3_wal_auto..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22897 /* "test_sqlite3_log" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22914 /* "print_explain_qu..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 22939 /* "sqlite3_test_con..." */, FxProc: 0},
+ {FzName: ts + 22960 /* "getrusage" */, FxProc: 0},
+ {FzName: ts + 22970 /* "load_static_exte..." */, FxProc: 0},
+ {FzName: ts + 22992 /* "sorter_test_fake..." */, FxProc: 0},
+ {FzName: ts + 23013 /* "sorter_test_sort..." */, FxProc: 0},
+ {FzName: ts + 23038 /* "vfs_current_time..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23061 /* "sqlite3_snapshot..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23082 /* "sqlite3_snapshot..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23104 /* "sqlite3_snapshot..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23126 /* "sqlite3_snapshot..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23147 /* "sqlite3_snapshot..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23172 /* "sqlite3_snapshot..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23198 /* "sqlite3_snapshot..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23225 /* "sqlite3_snapshot..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23251 /* "sqlite3_delete_d..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23275 /* "atomic_batch_wri..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23294 /* "sqlite3_mmap_war..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23312 /* "sqlite3_config_s..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23337 /* "decode_hexdb" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 23350 /* "test_write_db" */, FxProc: 0, FclientData: uintptr(0)},
+} /* test1.c:7986:5 */
+var bitmask_size int32 = (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) /* test1.c:8206:14 */
+var longdouble_size int32 = int32(unsafe.Sizeof(float64(0))) /* test1.c:8207:14 */
+var query_plan uintptr = ts + 23364 /* "*** OBSOLETE VAR..." */ /* test1.c:8282:23 */
// Page size and reserved size used for testing.
var test_pagesize int32 = 1024 /* test2.c:31:12 */
// Dummy page reinitializer
-func pager_test_reiniter(tls *crt.TLS, pNotUsed uintptr) { /* test2.c:36:13: */
+func pager_test_reiniter(tls *libc.TLS, pNotUsed uintptr) { /* test2.c:36:13: */
return
}
// Usage: pager_open FILENAME N-PAGE
//
// Open a new pager
-func pager_open(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:45:26: */
+func pager_open(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:45:26: */
bp := tls.Alloc(192)
defer tls.Free(192)
- // var pageSize u321 at bp+88, 4
+ // var pageSize u322 at bp+88, 4
// var pPager uintptr at bp+80, 8
@@ -46007,8 +50567,8 @@ func pager_open(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
// var zBuf [100]int8 at bp+92, 100
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21285 /* " FILENAME N-PAGE..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23390 /* " FILENAME N-PAGE..." */, 0))
return 1
}
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), bp+72 /* &nPage */) != 0 {
@@ -46016,37 +50576,37 @@ func pager_open(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
}
rc = sqlite3.Xsqlite3PagerOpen(tls, sqlite3.Xsqlite3_vfs_find(tls, uintptr(0)), bp+80 /* &pPager */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), 0, 0,
((0x00000002 | 0x00000004) | 0x00000100),
- *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{pager_test_reiniter})))
+ *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{pager_test_reiniter})))
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
sqlite3.Xsqlite3PagerSetCachesize(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pPager */)), *(*int32)(unsafe.Pointer(bp + 72 /* nPage */)))
- *(*u321)(unsafe.Pointer(bp + 88 /* pageSize */)) = u321(test_pagesize)
+ *(*u322)(unsafe.Pointer(bp + 88 /* pageSize */)) = u322(test_pagesize)
sqlite3.Xsqlite3PagerSetPagesize(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pPager */)), bp+88 /* &pageSize */, -1)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+92 /* &zBuf[0] */, ts+11197 /* "%p" */, crt.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 80 /* pPager */))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, bp+92 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+92 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 80 /* pPager */))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+92 /* &zBuf[0] */, 0))
return 0
}
// Usage: pager_close ID
//
// Close the given pager.
-func pager_close(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:82:26: */
+func pager_close(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:82:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var pPager uintptr
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
rc = sqlite3.Xsqlite3PagerClose(tls, pPager, uintptr(0))
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
return 0
@@ -46055,21 +50615,21 @@ func pager_close(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
// Usage: pager_rollback ID
//
// Rollback changes
-func pager_rollback(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:109:26: */
+func pager_rollback(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:109:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var pPager uintptr
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
rc = sqlite3.Xsqlite3PagerRollback(tls, pPager)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
return 0
@@ -46078,26 +50638,26 @@ func pager_rollback(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, a
// Usage: pager_commit ID
//
// Commit all changes
-func pager_commit(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:136:26: */
+func pager_commit(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:136:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
var pPager uintptr
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
rc = sqlite3.Xsqlite3PagerCommitPhaseOne(tls, pPager, uintptr(0), 0)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
rc = sqlite3.Xsqlite3PagerCommitPhaseTwo(tls, pPager)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
return 0
@@ -46106,21 +50666,21 @@ func pager_commit(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, arg
// Usage: pager_stmt_begin ID
//
// Start a new checkpoint.
-func pager_stmt_begin(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:168:26: */
+func pager_stmt_begin(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:168:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var pPager uintptr
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
rc = sqlite3.Xsqlite3PagerOpenSavepoint(tls, pPager, 1)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
return 0
@@ -46129,22 +50689,22 @@ func pager_stmt_begin(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
// Usage: pager_stmt_rollback ID
//
// Rollback changes to a checkpoint
-func pager_stmt_rollback(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:195:26: */
+func pager_stmt_rollback(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:195:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var pPager uintptr
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
rc = sqlite3.Xsqlite3PagerSavepoint(tls, pPager, 2, 0)
sqlite3.Xsqlite3PagerSavepoint(tls, pPager, 1, 0)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
return 0
@@ -46153,21 +50713,21 @@ func pager_stmt_rollback(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
// Usage: pager_stmt_commit ID
//
// Commit changes to a checkpoint
-func pager_stmt_commit(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:223:26: */
+func pager_stmt_commit(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:223:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var pPager uintptr
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
rc = sqlite3.Xsqlite3PagerSavepoint(tls, pPager, 1, 0)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
return 0
@@ -46176,7 +50736,7 @@ func pager_stmt_commit(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
// Usage: pager_stats ID
//
// Return pager statistics.
-func pager_stats(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:250:26: */
+func pager_stats(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:250:26: */
bp := tls.Alloc(140)
defer tls.Free(140)
@@ -46184,8 +50744,8 @@ func pager_stats(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
var i int32
var a uintptr
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -46194,21 +50754,21 @@ func pager_stats(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
// var zBuf [100]int8 at bp+40, 100
tcl.XTcl_AppendElement(tls, interp, zName[i])
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+40 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+32, *(*int32)(unsafe.Pointer(a + uintptr(i)*4))))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+40 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(a + uintptr(i)*4))))
tcl.XTcl_AppendElement(tls, interp, bp+40 /* &zBuf[0] */)
}
return 0
}
var zName = [9]uintptr{
- ts + 21308 /* "ref" */, ts + 21312 /* "page" */, ts + 15855 /* "max" */, ts + 9654 /* "size" */, ts + 21317 /* "state" */, ts + 21323, /* "err" */
- ts + 21327 /* "hit" */, ts + 21331 /* "miss" */, ts + 21336, /* "ovfl" */
+ ts + 23413 /* "ref" */, ts + 23417 /* "page" */, ts + 17555 /* "max" */, ts + 11313 /* "size" */, ts + 10015 /* "state" */, ts + 23422, /* "err" */
+ ts + 23426 /* "hit" */, ts + 23430 /* "miss" */, ts + 23435, /* "ovfl" */
} /* test2.c:266:17 */
// Usage: pager_pagecount ID
//
// Return the size of the database file.
-func pager_pagecount(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:283:26: */
+func pager_pagecount(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:283:26: */
bp := tls.Alloc(160)
defer tls.Free(160)
@@ -46218,21 +50778,21 @@ func pager_pagecount(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
// var nPage int32 at bp+56, 4
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
sqlite3.Xsqlite3PagerPagecount(tls, pPager, bp+56 /* &nPage */)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+60 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 56 /* nPage */))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+60 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+60 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 56 /* nPage */))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+60 /* &zBuf[0] */, 0))
return 0
}
// Usage: page_get ID PGNO
//
// Return a pointer to a page from the database.
-func page_get(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:309:26: */
+func page_get(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:309:26: */
bp := tls.Alloc(188)
defer tls.Free(188)
@@ -46244,8 +50804,8 @@ func page_get(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv ui
var rc int32
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21341 /* " ID PGNO\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23440 /* " ID PGNO\"" */, 0))
return 1
}
pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -46257,11 +50817,11 @@ func page_get(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv ui
rc = sqlite3.Xsqlite3PagerGet(tls, pPager, uint32(*(*int32)(unsafe.Pointer(bp + 72 /* pgno */))), bp+80 /* &pPage */, 0)
}
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+88 /* &zBuf[0] */, ts+11197 /* "%p" */, crt.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 80 /* pPage */))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, bp+88 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+88 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 80 /* pPage */))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+88 /* &zBuf[0] */, 0))
return 0
}
@@ -46269,7 +50829,7 @@ func page_get(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv ui
//
// Return a pointer to a page if the page is already in cache.
// If not in cache, return an empty string.
-func page_lookup(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:346:26: */
+func page_lookup(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:346:26: */
bp := tls.Alloc(160)
defer tls.Free(160)
@@ -46280,8 +50840,8 @@ func page_lookup(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
// var pgno int32 at bp+56, 4
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21341 /* " ID PGNO\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23440 /* " ID PGNO\"" */, 0))
return 1
}
pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -46290,14 +50850,14 @@ func page_lookup(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
}
pPage = sqlite3.Xsqlite3PagerLookup(tls, pPager, uint32(*(*int32)(unsafe.Pointer(bp + 56 /* pgno */))))
if pPage != 0 {
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+60 /* &zBuf[0] */, ts+11197 /* "%p" */, crt.VaList(bp+32, pPage))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+60 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+60 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+32, pPage))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+60 /* &zBuf[0] */, 0))
}
return 0
}
// Usage: pager_truncate ID PGNO
-func pager_truncate(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:374:26: */
+func pager_truncate(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:374:26: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -46305,8 +50865,8 @@ func pager_truncate(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, a
// var pgno int32 at bp+32, 4
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21341 /* " ID PGNO\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23440 /* " ID PGNO\"" */, 0))
return 1
}
pPager = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -46320,14 +50880,14 @@ func pager_truncate(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, a
// Usage: page_unref PAGE
//
// Drop a pointer to a page.
-func page_unref(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:399:26: */
+func page_unref(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:399:26: */
bp := tls.Alloc(32)
defer tls.Free(32)
var pPage uintptr
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21351 /* " PAGE\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23450 /* " PAGE\"" */, 0))
return 1
}
pPage = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -46338,7 +50898,7 @@ func page_unref(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
// Usage: page_read PAGE
//
// Return the content of a page
-func page_read(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:421:26: */
+func page_read(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:421:26: */
bp := tls.Alloc(148)
defer tls.Free(148)
@@ -46346,20 +50906,20 @@ func page_read(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv u
var pPage uintptr
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21351 /* " PAGE\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23450 /* " PAGE\"" */, 0))
return 1
}
pPage = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
- crt.Xmemcpy(tls, bp+48 /* &zBuf[0] */, sqlite3.Xsqlite3PagerGetData(tls, pPage), uint64(unsafe.Sizeof([100]int8{})))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, bp+48 /* &zBuf[0] */, 0))
+ libc.Xmemcpy(tls, bp+48 /* &zBuf[0] */, sqlite3.Xsqlite3PagerGetData(tls, pPage), uint64(unsafe.Sizeof([100]int8{})))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, bp+48 /* &zBuf[0] */, 0))
return 0
}
// Usage: page_number PAGE
//
// Return the page number for a page.
-func page_number(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:445:26: */
+func page_number(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:445:26: */
bp := tls.Alloc(156)
defer tls.Free(156)
@@ -46367,20 +50927,20 @@ func page_number(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
var pPage uintptr
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21351 /* " PAGE\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23450 /* " PAGE\"" */, 0))
return 1
}
pPage = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+56 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+32, sqlite3.Xsqlite3PagerPagenumber(tls, pPage)))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+56 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+56 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, sqlite3.Xsqlite3PagerPagenumber(tls, pPage)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+56 /* &zBuf[0] */, 0))
return 0
}
// Usage: page_write PAGE DATA
//
// Write something into a page.
-func page_write(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:469:26: */
+func page_write(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:469:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -46388,18 +50948,18 @@ func page_write(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
var pData uintptr
var rc int32
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21358 /* " PAGE DATA\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23457 /* " PAGE DATA\"" */, 0))
return 1
}
pPage = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
rc = sqlite3.Xsqlite3PagerWrite(tls, pPage)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
pData = sqlite3.Xsqlite3PagerGetData(tls, pPage)
- crt.Xstrncpy(tls, pData, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), (uint64(test_pagesize - 1)))
+ libc.Xstrncpy(tls, pData, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), (uint64(test_pagesize - 1)))
*(*int8)(unsafe.Pointer(pData + uintptr((test_pagesize - 1)))) = int8(0)
return 0
}
@@ -46411,7 +50971,7 @@ func page_write(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
// the next time the database is opened, SQLite will begin allocating
// new pages after N. If N is 2096 or bigger, this will test the
// ability of SQLite to write to large files.
-func fake_big_file(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:505:26: */
+func fake_big_file(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:505:26: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -46424,8 +50984,8 @@ func fake_big_file(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, ar
var zFile uintptr
var nFile int32
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21370 /* " N-MEGABYTES FIL..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23469 /* " N-MEGABYTES FIL..." */, 0))
return 1
}
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+80 /* &n */) != 0 {
@@ -46433,27 +50993,27 @@ func fake_big_file(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, ar
}
pVfs = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
- nFile = int32(crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ nFile = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
zFile = sqlite3.Xsqlite3_malloc(tls, (nFile + 2))
if zFile == uintptr(0) {
return 1
}
- crt.Xmemcpy(tls, zFile, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), (uint64(nFile + 1)))
+ libc.Xmemcpy(tls, zFile, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), (uint64(nFile + 1)))
*(*int8)(unsafe.Pointer(zFile + uintptr((nFile + 1)))) = int8(0)
rc = sqlite3.Xsqlite3OsOpenMalloc(tls, pVfs, zFile, bp+88, /* &fd */
((0x00000004 | 0x00000002) | 0x00000100), uintptr(0))
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+21389 /* "open failed: " */, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+23488 /* "open failed: " */, sqlite3.Xsqlite3ErrName(tls, rc), 0))
sqlite3.Xsqlite3_free(tls, zFile)
return 1
}
offset = i64(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))
offset = offset * (int64(1024 * 1024))
- rc = sqlite3.Xsqlite3OsWrite(tls, *(*uintptr)(unsafe.Pointer(bp + 88 /* fd */)), ts+21403 /* "Hello, World!" */, 14, offset)
+ rc = sqlite3.Xsqlite3OsWrite(tls, *(*uintptr)(unsafe.Pointer(bp + 88 /* fd */)), ts+23502 /* "Hello, World!" */, 14, offset)
sqlite3.Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 88 /* fd */)))
sqlite3.Xsqlite3_free(tls, zFile)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, ts+21417 /* "write failed: " */, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, ts+23516 /* "write failed: " */, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
return 0
@@ -46462,7 +51022,7 @@ func fake_big_file(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, ar
// test_control_pending_byte PENDING_BYTE
//
// Set the PENDING_BYTE using the sqlite3_test_control() interface.
-func testPendingByte(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:558:26: */
+func testPendingByte(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:558:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -46470,14 +51030,14 @@ func testPendingByte(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21432 /* " PENDING-BYTE\"" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23531 /* " PENDING-BYTE\"" */, uintptr(0)))
return 1
}
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+40 /* &pbyte */) != 0 {
return 1
}
- rc = sqlite3.Xsqlite3_test_control(tls, 11, crt.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 40 /* pbyte */))))
+ rc = sqlite3.Xsqlite3_test_control(tls, 11, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 40 /* pbyte */))))
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, rc))
return 0
}
@@ -46486,7 +51046,7 @@ func testPendingByte(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
var faultSimInterp uintptr = uintptr(0) /* test2.c:580:19 */
var faultSimScriptSize int32 = 0 /* test2.c:581:12 */
var faultSimScript uintptr /* test2.c:582:13: */
-func faultSimCallback(tls *crt.TLS, x int32) int32 { /* test2.c:583:12: */
+func faultSimCallback(tls *libc.TLS, x int32) int32 { /* test2.c:583:12: */
bp := tls.Alloc(38)
defer tls.Free(38)
@@ -46496,7 +51056,7 @@ func faultSimCallback(tls *crt.TLS, x int32) int32 { /* test2.c:583:12: */
var isNeg int32
var rc int32
if x == 0 {
- crt.Xmemcpy(tls, (faultSimScript + uintptr(faultSimScriptSize)), ts+12045 /* "0" */, uint64(2))
+ libc.Xmemcpy(tls, (faultSimScript + uintptr(faultSimScriptSize)), ts+13695 /* "0" */, uint64(2))
} else {
// Convert x to text without using any sqlite3 routines
if x < 0 {
@@ -46523,16 +51083,16 @@ func faultSimCallback(tls *crt.TLS, x int32) int32 { /* test2.c:583:12: */
__3:
;
if isNeg != 0 {
- *(*int8)(unsafe.Pointer(bp + 8 /* &zInt[0] */ + uintptr(crt.PostDecInt32(&i, 1)))) = int8('-')
+ *(*int8)(unsafe.Pointer(bp + 8 /* &zInt[0] */ + uintptr(libc.PostDecInt32(&i, 1)))) = int8('-')
}
- crt.Xmemcpy(tls, (faultSimScript + uintptr(faultSimScriptSize)), ((bp + 8 /* &zInt[0] */ + uintptr(i)) + uintptr(1)), (uint64(unsafe.Sizeof([30]int8{})) - uint64(i)))
+ libc.Xmemcpy(tls, (faultSimScript + uintptr(faultSimScriptSize)), ((bp + 8 /* &zInt[0] */ + uintptr(i)) + uintptr(1)), (uint64(unsafe.Sizeof([30]int8{})) - uint64(i)))
}
rc = tcl.XTcl_Eval(tls, faultSimInterp, faultSimScript)
if rc != 0 {
- crt.Xfprintf(tls, crt.Xstderr, ts+21447 /* "fault simulator ..." */, crt.VaList(bp, faultSimScript))
+ libc.Xfprintf(tls, libc.Xstderr, ts+23546 /* "fault simulator ..." */, libc.VaList(bp, faultSimScript))
rc = 1
} else {
- rc = crt.Xatoi(tls, tcl.XTcl_GetStringResult(tls, faultSimInterp))
+ rc = libc.Xatoi(tls, tcl.XTcl_GetStringResult(tls, faultSimInterp))
}
tcl.XTcl_ResetResult(tls, faultSimInterp)
return rc
@@ -46543,7 +51103,7 @@ func faultSimCallback(tls *crt.TLS, x int32) int32 { /* test2.c:583:12: */
// Arrange to invoke SCRIPT with the integer argument to sqlite3FaultSim()
// appended, whenever sqlite3FaultSim() is called. Or, if SCRIPT is the
// empty string, cancel the sqlite3FaultSim() callback.
-func faultInstallCmd(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:623:26: */
+func faultInstallCmd(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:623:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -46551,32 +51111,32 @@ func faultInstallCmd(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
var nScript int32
var rc int32
if (argc != 1) && (argc != 2) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21483 /* " SCRIPT\"" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23582 /* " SCRIPT\"" */, uintptr(0)))
}
if argc == 2 {
zScript = *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))
} else {
zScript = ts + 488 /* "" */
}
- nScript = int32(crt.Xstrlen(tls, zScript))
+ nScript = int32(libc.Xstrlen(tls, zScript))
if faultSimScript != 0 {
- crt.Xfree(tls, faultSimScript)
+ libc.Xfree(tls, faultSimScript)
faultSimScript = uintptr(0)
}
if nScript == 0 {
- rc = sqlite3.Xsqlite3_test_control(tls, 9, crt.VaList(bp+32, 0))
+ rc = sqlite3.Xsqlite3_test_control(tls, 9, libc.VaList(bp+32, 0))
} else {
- faultSimScript = crt.Xmalloc(tls, (uint64(nScript + 100)))
+ faultSimScript = libc.Xmalloc(tls, (uint64(nScript + 100)))
if faultSimScript == uintptr(0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, ts+1929 /* "out of memory" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+1929 /* "out of memory" */, uintptr(0)))
return 1
}
- crt.Xmemcpy(tls, faultSimScript, zScript, uint64(nScript))
+ libc.Xmemcpy(tls, faultSimScript, zScript, uint64(nScript))
*(*int8)(unsafe.Pointer(faultSimScript + uintptr(nScript))) = int8(' ')
faultSimScriptSize = (nScript + 1)
faultSimInterp = interp
- rc = sqlite3.Xsqlite3_test_control(tls, 9, crt.VaList(bp+56, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, int32) int32 }{faultSimCallback}))))
+ rc = sqlite3.Xsqlite3_test_control(tls, 9, libc.VaList(bp+56, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{faultSimCallback}))))
}
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, rc))
return 0
@@ -46586,7 +51146,7 @@ func faultInstallCmd(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
//
// Invoke the SQLITE_TESTCTRL_BITVEC_TEST operator on test_control.
// See comments on sqlite3BitvecBuiltinTest() for additional information.
-func testBitvecBuiltinTest(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:666:26: */
+func testBitvecBuiltinTest(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test2.c:666:26: */
bp := tls.Alloc(452)
defer tls.Free(452)
@@ -46598,8 +51158,8 @@ func testBitvecBuiltinTest(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc i
var z uintptr
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21492 /* " SIZE PROGRAM\"" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23591 /* " SIZE PROGRAM\"" */, uintptr(0)))
}
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+48 /* &sz */) != 0 {
return 1
@@ -46612,72 +51172,69 @@ func testBitvecBuiltinTest(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc i
if int32(*(*int8)(unsafe.Pointer(z))) == 0 {
break
}
- *(*int32)(unsafe.Pointer(bp + 52 /* &aProg[0] */ + uintptr(crt.PostIncInt32(&nProg, 1))*4)) = crt.Xatoi(tls, z)
+ *(*int32)(unsafe.Pointer(bp + 52 /* &aProg[0] */ + uintptr(libc.PostIncInt32(&nProg, 1))*4)) = libc.Xatoi(tls, z)
for (int32(sqlite3.Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z)))]) & 0x04) != 0 {
z++
}
}
*(*int32)(unsafe.Pointer(bp + 52 /* &aProg[0] */ + uintptr(nProg)*4)) = 0
- rc = sqlite3.Xsqlite3_test_control(tls, 8, crt.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 48 /* sz */)), bp+52 /* &aProg[0] */))
+ rc = sqlite3.Xsqlite3_test_control(tls, 8, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 48 /* sz */)), bp+52 /* &aProg[0] */))
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, rc))
return 0
}
// Register commands with the TCL interpreter.
-func Sqlitetest2_Init(tls *crt.TLS, interp uintptr) int32 { /* test2.c:697:5: */
+func Sqlitetest2_Init(tls *libc.TLS, interp uintptr) int32 { /* test2.c:697:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd1)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd2)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateCommand(tls, interp, aCmd1[i].FzName, aCmd1[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateCommand(tls, interp, aCmd2[i].FzName, aCmd2[i].FxProc, uintptr(0), uintptr(0))
}
- tcl.XTcl_LinkVar(tls, interp, ts+21507, /* "sqlite_io_error_..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+23606, /* "sqlite_io_error_..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_io_error_pending)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+21531, /* "sqlite_io_error_..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+23630, /* "sqlite_io_error_..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_io_error_persist)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+21555, /* "sqlite_io_error_..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+23654, /* "sqlite_io_error_..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_io_error_hit)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+21575, /* "sqlite_io_error_..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+23674, /* "sqlite_io_error_..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_io_error_hardhit)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+21599, /* "sqlite_diskfull_..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+23698, /* "sqlite_diskfull_..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_diskfull_pending)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+21623, /* "sqlite_diskfull" */
+ tcl.XTcl_LinkVar(tls, interp, ts+23722, /* "sqlite_diskfull" */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3_diskfull)), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+21639, /* "sqlite_pending_b..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+23738, /* "sqlite_pending_b..." */
uintptr(unsafe.Pointer(&sqlite3.Xsqlite3PendingByte)), (1 | 0x80))
return 0
}
-var aCmd1 = [20]struct {
+var aCmd2 = [20]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 21659 /* "pager_open" */, FxProc: 0},
- {FzName: ts + 21670 /* "pager_close" */, FxProc: 0},
- {FzName: ts + 21682 /* "pager_commit" */, FxProc: 0},
- {FzName: ts + 21695 /* "pager_rollback" */, FxProc: 0},
- {FzName: ts + 21710 /* "pager_stmt_begin" */, FxProc: 0},
- {FzName: ts + 21727 /* "pager_stmt_commi..." */, FxProc: 0},
- {FzName: ts + 21745 /* "pager_stmt_rollb..." */, FxProc: 0},
- {FzName: ts + 21765 /* "pager_stats" */, FxProc: 0},
- {FzName: ts + 21777 /* "pager_pagecount" */, FxProc: 0},
- {FzName: ts + 21793 /* "page_get" */, FxProc: 0},
- {FzName: ts + 21802 /* "page_lookup" */, FxProc: 0},
- {FzName: ts + 21814 /* "page_unref" */, FxProc: 0},
- {FzName: ts + 21825 /* "page_read" */, FxProc: 0},
- {FzName: ts + 21835 /* "page_write" */, FxProc: 0},
- {FzName: ts + 21846 /* "page_number" */, FxProc: 0},
- {FzName: ts + 21858 /* "pager_truncate" */, FxProc: 0},
- {FzName: ts + 21873 /* "fake_big_file" */, FxProc: 0},
- {FzName: ts + 21887 /* "sqlite3BitvecBui..." */, FxProc: 0},
- {FzName: ts + 21912 /* "sqlite3_test_con..." */, FxProc: 0},
- {FzName: ts + 21946 /* "sqlite3_test_con..." */, FxProc: 0},
+ {FzName: ts + 23758 /* "pager_open" */, FxProc: 0},
+ {FzName: ts + 23769 /* "pager_close" */, FxProc: 0},
+ {FzName: ts + 23781 /* "pager_commit" */, FxProc: 0},
+ {FzName: ts + 23794 /* "pager_rollback" */, FxProc: 0},
+ {FzName: ts + 23809 /* "pager_stmt_begin" */, FxProc: 0},
+ {FzName: ts + 23826 /* "pager_stmt_commi..." */, FxProc: 0},
+ {FzName: ts + 23844 /* "pager_stmt_rollb..." */, FxProc: 0},
+ {FzName: ts + 23864 /* "pager_stats" */, FxProc: 0},
+ {FzName: ts + 23876 /* "pager_pagecount" */, FxProc: 0},
+ {FzName: ts + 23892 /* "page_get" */, FxProc: 0},
+ {FzName: ts + 23901 /* "page_lookup" */, FxProc: 0},
+ {FzName: ts + 23913 /* "page_unref" */, FxProc: 0},
+ {FzName: ts + 23924 /* "page_read" */, FxProc: 0},
+ {FzName: ts + 23934 /* "page_write" */, FxProc: 0},
+ {FzName: ts + 23945 /* "page_number" */, FxProc: 0},
+ {FzName: ts + 23957 /* "pager_truncate" */, FxProc: 0},
+ {FzName: ts + 23972 /* "fake_big_file" */, FxProc: 0},
+ {FzName: ts + 23986 /* "sqlite3BitvecBui..." */, FxProc: 0},
+ {FzName: ts + 24011 /* "sqlite3_test_con..." */, FxProc: 0},
+ {FzName: ts + 24045 /* "sqlite3_test_con..." */, FxProc: 0},
} /* test2.c:707:5 */
-// Defer sourcing vdbe.h and btree.h until after the "u8" and
-// "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
-// pointer types (i.e. FuncDef) defined above.
// 2001 September 15
//
// The author disclaims copyright to this source code. In place of
@@ -47214,7 +51771,7 @@ type BtLock = BtLock1 /* btreeInt.h:233:23 */
type CellInfo1 = struct {
FnKey i64
FpPayload uintptr
- FnPayload u321
+ FnPayload u322
FnLocal u16
FnSize u16
}
@@ -47316,19 +51873,19 @@ type CellInfo = CellInfo1 /* btreeInt.h:234:25 */
// detect pages that are used twice and orphaned pages (both of which
// indicate corruption).
type IntegrityCk1 = struct {
- FpBt uintptr
- FpPager uintptr
- FaPgRef uintptr
- FnPage Pgno
- FmxErr int32
- FnErr int32
- FmallocFailed int32
- FzPfx uintptr
- Fv1 int32
- Fv2 int32
- FerrMsg StrAccum
- Fheap uintptr
- Fdb uintptr
+ FpBt uintptr
+ FpPager uintptr
+ FaPgRef uintptr
+ FnPage Pgno
+ FmxErr int32
+ FnErr int32
+ FbOomFault int32
+ FzPfx uintptr
+ Fv1 Pgno
+ Fv2 int32
+ FerrMsg StrAccum
+ Fheap uintptr
+ Fdb uintptr
}
// Legal values for BtCursor.curFlags
@@ -47435,7 +51992,7 @@ var nRefSqlite3 int32 = 0 /* test3.c:33:12 */
// Usage: btree_open FILENAME NCACHE
//
// Open a new database
-func btree_open(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:40:26: */
+func btree_open(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:40:26: */
bp := tls.Alloc(188)
defer tls.Free(188)
@@ -47449,8 +52006,8 @@ func btree_open(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
var n int32
var zFilename uintptr
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21981 /* " FILENAME NCACHE..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24080 /* " FILENAME NCACHE..." */, 0))
return 1
}
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), bp+72 /* &nCache */) != 0 {
@@ -47462,44 +52019,44 @@ func btree_open(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
sDb.Fmutex = sqlite3.Xsqlite3MutexAlloc(tls, 1)
sqlite3.Xsqlite3_mutex_enter(tls, sDb.Fmutex)
}
- n = int32(crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
+ n = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
zFilename = sqlite3.Xsqlite3_malloc(tls, (n + 2))
if zFilename == uintptr(0) {
return 1
}
- crt.Xmemcpy(tls, zFilename, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), (uint64(n + 1)))
+ libc.Xmemcpy(tls, zFilename, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), (uint64(n + 1)))
*(*int8)(unsafe.Pointer(zFilename + uintptr((n + 1)))) = int8(0)
rc = sqlite3.Xsqlite3BtreeOpen(tls, sDb.FpVfs, zFilename, uintptr(unsafe.Pointer(&sDb)), bp+80 /* &pBt */, 0,
((0x00000002 | 0x00000004) | 0x00000100))
sqlite3.Xsqlite3_free(tls, zFilename)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
sqlite3.Xsqlite3BtreeSetCacheSize(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pBt */)), *(*int32)(unsafe.Pointer(bp + 72 /* nCache */)))
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+88 /* &zBuf[0] */, ts+11197 /* "%p" */, crt.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 80 /* pBt */))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, bp+88 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+88 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 80 /* pBt */))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+88 /* &zBuf[0] */, 0))
return 0
}
// Usage: btree_close ID
//
// Close the given database.
-func btree_close(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:86:26: */
+func btree_close(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:86:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var pBt uintptr
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pBt = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
rc = sqlite3.Xsqlite3BtreeClose(tls, pBt)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
nRefSqlite3--
@@ -47515,15 +52072,15 @@ func btree_close(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
// Usage: btree_begin_transaction ID
//
// Start a new transaction
-func btree_begin_transaction(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:121:26: */
+func btree_begin_transaction(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:121:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var pBt uintptr
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pBt = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -47531,7 +52088,7 @@ func btree_begin_transaction(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc
rc = sqlite3.Xsqlite3BtreeBeginTrans(tls, pBt, 1, uintptr(0))
sqlite3.Xsqlite3BtreeLeave(tls, pBt)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
return 0
@@ -47540,7 +52097,7 @@ func btree_begin_transaction(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc
// Usage: btree_pager_stats ID
//
// Returns pager statistics
-func btree_pager_stats(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:150:26: */
+func btree_pager_stats(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:150:26: */
bp := tls.Alloc(140)
defer tls.Free(140)
@@ -47549,8 +52106,8 @@ func btree_pager_stats(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
var a uintptr
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pBt = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -47569,7 +52126,7 @@ func btree_pager_stats(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
// var zBuf [100]int8 at bp+40, 100
tcl.XTcl_AppendElement(tls, interp, zName1[i])
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+40 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+32, *(*int32)(unsafe.Pointer(a + uintptr(i)*4))))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+40 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(a + uintptr(i)*4))))
tcl.XTcl_AppendElement(tls, interp, bp+40 /* &zBuf[0] */)
}
sqlite3.Xsqlite3BtreeLeave(tls, pBt)
@@ -47580,14 +52137,14 @@ func btree_pager_stats(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
}
var zName1 = [11]uintptr{
- ts + 21308 /* "ref" */, ts + 21312 /* "page" */, ts + 15855 /* "max" */, ts + 9654 /* "size" */, ts + 21317 /* "state" */, ts + 21323, /* "err" */
- ts + 21327 /* "hit" */, ts + 21331 /* "miss" */, ts + 21336 /* "ovfl" */, ts + 22005 /* "read" */, ts + 22010, /* "write" */
+ ts + 23413 /* "ref" */, ts + 23417 /* "page" */, ts + 17555 /* "max" */, ts + 11313 /* "size" */, ts + 10015 /* "state" */, ts + 23422, /* "err" */
+ ts + 23426 /* "hit" */, ts + 23430 /* "miss" */, ts + 23435 /* "ovfl" */, ts + 24104 /* "read" */, ts + 24109, /* "write" */
} /* test3.c:179:17 */
// Usage: btree_cursor ID TABLENUM WRITEABLE
//
// Create a new cursor. Return the ID for the cursor.
-func btree_cursor(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:200:26: */
+func btree_cursor(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:200:26: */
bp := tls.Alloc(110)
defer tls.Free(110)
@@ -47601,8 +52158,8 @@ func btree_cursor(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, arg
// var zBuf [30]int8 at bp+80, 30
if argc != 4 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22016 /* " ID TABLENUM WRI..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24115 /* " ID TABLENUM WRI..." */, 0))
return 1
}
pBt = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -47616,29 +52173,29 @@ func btree_cursor(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, arg
*(*int32)(unsafe.Pointer(bp + 76 /* wrFlag */)) = 0x00000004
}
pCur = tcl.XTcl_Alloc(tls, uint32(sqlite3.Xsqlite3BtreeCursorSize(tls)))
- crt.Xmemset(tls, pCur, 0, uint64(sqlite3.Xsqlite3BtreeCursorSize(tls)))
+ libc.Xmemset(tls, pCur, 0, uint64(sqlite3.Xsqlite3BtreeCursorSize(tls)))
sqlite3.Xsqlite3_mutex_enter(tls, (*sqlite31)(unsafe.Pointer((*Btree)(unsafe.Pointer(pBt)).Fdb)).Fmutex)
sqlite3.Xsqlite3BtreeEnter(tls, pBt)
- rc = sqlite3.Xsqlite3BtreeLockTable(tls, pBt, *(*int32)(unsafe.Pointer(bp + 72 /* iTable */)), crt.BoolUint8(!(!(*(*int32)(unsafe.Pointer(bp + 76 /* wrFlag */)) != 0))))
+ rc = sqlite3.Xsqlite3BtreeLockTable(tls, pBt, *(*int32)(unsafe.Pointer(bp + 72 /* iTable */)), libc.BoolUint8(!(!(*(*int32)(unsafe.Pointer(bp + 76 /* wrFlag */)) != 0))))
if rc == 0 {
- rc = sqlite3.Xsqlite3BtreeCursor(tls, pBt, *(*int32)(unsafe.Pointer(bp + 72 /* iTable */)), *(*int32)(unsafe.Pointer(bp + 76 /* wrFlag */)), uintptr(0), pCur)
+ rc = sqlite3.Xsqlite3BtreeCursor(tls, pBt, uint32(*(*int32)(unsafe.Pointer(bp + 72 /* iTable */))), *(*int32)(unsafe.Pointer(bp + 76 /* wrFlag */)), uintptr(0), pCur)
}
sqlite3.Xsqlite3BtreeLeave(tls, pBt)
sqlite3.Xsqlite3_mutex_leave(tls, (*sqlite31)(unsafe.Pointer((*Btree)(unsafe.Pointer(pBt)).Fdb)).Fmutex)
if rc != 0 {
tcl.XTcl_Free(tls, pCur)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+80 /* &zBuf[0] */, ts+11197 /* "%p" */, crt.VaList(bp+48, pCur))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, bp+80 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+80 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+48, pCur))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+80 /* &zBuf[0] */, 0))
return 0
}
// Usage: btree_close_cursor ID
//
// Close a cursor opened using btree_cursor.
-func btree_close_cursor(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:249:26: */
+func btree_close_cursor(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:249:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -47646,8 +52203,8 @@ func btree_close_cursor(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
var rc int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pCur = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -47661,7 +52218,7 @@ func btree_close_cursor(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
}
tcl.XTcl_Free(tls, pCur)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
return 0
@@ -47672,7 +52229,7 @@ func btree_close_cursor(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
// Move the cursor to the next entry in the table. Return 0 on success
// or 1 if the cursor was already on the last entry in the table or if
// the table is empty.
-func btree_next(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:291:26: */
+func btree_next(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:291:26: */
bp := tls.Alloc(172)
defer tls.Free(172)
@@ -47682,8 +52239,8 @@ func btree_next(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
// var zBuf [100]int8 at bp+72, 100
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pCur = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -47695,11 +52252,11 @@ func btree_next(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
}
sqlite3.Xsqlite3BtreeLeave(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+48, res))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, bp+72 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+48, res))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+72 /* &zBuf[0] */, 0))
return 0
}
@@ -47707,7 +52264,7 @@ func btree_next(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
//
// Move the cursor to the first entry in the table. Return 0 if the
// cursor was left point to something and 1 if the table is empty.
-func btree_first(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:330:26: */
+func btree_first(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:330:26: */
bp := tls.Alloc(176)
defer tls.Free(176)
@@ -47717,8 +52274,8 @@ func btree_first(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
// var zBuf [100]int8 at bp+76, 100
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pCur = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -47726,11 +52283,11 @@ func btree_first(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
rc = sqlite3.Xsqlite3BtreeFirst(tls, pCur, bp+72 /* &res */)
sqlite3.Xsqlite3BtreeLeave(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc), 0))
return 1
}
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+76 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 72 /* res */))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, bp+76 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+76 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 72 /* res */))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+76 /* &zBuf[0] */, 0))
return 0
}
@@ -47738,7 +52295,7 @@ func btree_first(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv
//
// Return TRUE if the given cursor is not pointing at a valid entry.
// Return FALSE if the cursor does point to a valid entry.
-func btree_eof(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:365:26: */
+func btree_eof(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:365:26: */
bp := tls.Alloc(106)
defer tls.Free(106)
@@ -47747,41 +52304,41 @@ func btree_eof(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv u
// var zBuf [50]int8 at bp+56, 50
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pCur = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
sqlite3.Xsqlite3BtreeEnter(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree)
rc = sqlite3.Xsqlite3BtreeEof(tls, pCur)
sqlite3.Xsqlite3BtreeLeave(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+56 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+32, rc))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+56 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+56 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+32, rc))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+56 /* &zBuf[0] */, 0))
return 0
}
// Usage: btree_payload_size ID
//
// Return the number of bytes of payload
-func btree_payload_size(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:394:26: */
+func btree_payload_size(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:394:26: */
bp := tls.Alloc(106)
defer tls.Free(106)
var pCur uintptr
- var n u321
+ var n u322
// var zBuf [50]int8 at bp+56, 50
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pCur = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
sqlite3.Xsqlite3BtreeEnter(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree)
n = sqlite3.Xsqlite3BtreePayloadSize(tls, pCur)
sqlite3.Xsqlite3BtreeLeave(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+56 /* &zBuf[0] */, ts+15405 /* "%u" */, crt.VaList(bp+32, n))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+56 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+56 /* &zBuf[0] */, ts+17097 /* "%u" */, libc.VaList(bp+32, n))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+56 /* &zBuf[0] */, 0))
return 0
}
@@ -47797,17 +52354,17 @@ func btree_payload_size(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
//
// This command returns nothing if it works. It returns an error message
// if something goes wrong.
-func btree_varint_test(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:432:26: */
+func btree_varint_test(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:432:26: */
bp := tls.Alloc(516)
defer tls.Free(516)
- // var start u321 at bp+184, 4
+ // var start u322 at bp+184, 4
- // var mult u321 at bp+188, 4
+ // var mult u322 at bp+188, 4
- // var count u321 at bp+192, 4
+ // var count u322 at bp+192, 4
- // var incr u321 at bp+196, 4
+ // var incr u322 at bp+196, 4
var in u64
// var out u64 at bp+504, 8
@@ -47819,8 +52376,8 @@ func btree_varint_test(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
// var zBuf [100]uint8 at bp+200, 100
if argc != 5 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22040 /* " START MULTIPLIE..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24139 /* " START MULTIPLIE..." */, 0))
return 1
}
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+184 /* &start */) != 0 {
@@ -47835,56 +52392,56 @@ func btree_varint_test(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), bp+196 /* &incr */) != 0 {
return 1
}
- in = u64(*(*u321)(unsafe.Pointer(bp + 184 /* start */)))
- in = in * (u64(*(*u321)(unsafe.Pointer(bp + 188 /* mult */))))
- for i = 0; i < int32(*(*u321)(unsafe.Pointer(bp + 192 /* count */))); i++ {
+ in = u64(*(*u322)(unsafe.Pointer(bp + 184 /* start */)))
+ in = in * (u64(*(*u322)(unsafe.Pointer(bp + 188 /* mult */))))
+ for i = 0; i < int32(*(*u322)(unsafe.Pointer(bp + 192 /* count */))); i++ {
// var zErr [200]int8 at bp+300, 200
n1 = sqlite3.Xsqlite3PutVarint(tls, bp+200 /* &zBuf[0] */, in)
if (n1 > 9) || (n1 < 1) {
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+300, /* &zErr[0] */
- ts+22075 /* "putVarint return..." */, crt.VaList(bp+32, n1))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+300 /* &zErr[0] */, 0))
+ ts+24174 /* "putVarint return..." */, libc.VaList(bp+32, n1))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+300 /* &zErr[0] */, 0))
return 1
}
n2 = int32(sqlite3.Xsqlite3GetVarint(tls, bp+200 /* &zBuf[0] */, bp+504 /* &out */))
if n1 != n2 {
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+300, /* &zErr[0] */
- ts+22125 /* "putVarint return..." */, crt.VaList(bp+56, n1, n2))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+72, bp+300 /* &zErr[0] */, 0))
+ ts+24224 /* "putVarint return..." */, libc.VaList(bp+56, n1, n2))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, bp+300 /* &zErr[0] */, 0))
return 1
}
if in != *(*u64)(unsafe.Pointer(bp + 504 /* out */)) {
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+300, /* &zErr[0] */
- ts+22173 /* "Wrote 0x%016llx ..." */, crt.VaList(bp+88, in, *(*u64)(unsafe.Pointer(bp + 504 /* out */))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+104, bp+300 /* &zErr[0] */, 0))
+ ts+24272 /* "Wrote 0x%016llx ..." */, libc.VaList(bp+88, in, *(*u64)(unsafe.Pointer(bp + 504 /* out */))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+104, bp+300 /* &zErr[0] */, 0))
return 1
}
if (in & uint64(0xffffffff)) == in {
- // var out32 u321 at bp+512, 4
+ // var out32 u322 at bp+512, 4
n2 = int32(func() uint8 {
if int32(*(*uint8)(unsafe.Pointer(bp + 200 /* zBuf */))) < int32(u8(0x80)) {
return uint8(func() int32 {
- (*(*u321)(unsafe.Pointer(bp + 512 /* out32 */))) = u321(*(*uint8)(unsafe.Pointer(bp + 200 /* zBuf */)))
+ (*(*u322)(unsafe.Pointer(bp + 512 /* out32 */))) = u322(*(*uint8)(unsafe.Pointer(bp + 200 /* zBuf */)))
return 1
}())
}
return sqlite3.Xsqlite3GetVarint32(tls, bp+200 /* &zBuf[0] */, bp+512 /* &out32 */)
}())
- *(*u64)(unsafe.Pointer(bp + 504 /* out */)) = u64(*(*u321)(unsafe.Pointer(bp + 512 /* out32 */)))
+ *(*u64)(unsafe.Pointer(bp + 504 /* out */)) = u64(*(*u322)(unsafe.Pointer(bp + 512 /* out32 */)))
if n1 != n2 {
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+300, /* &zErr[0] */
- ts+22212, /* "putVarint return..." */
- crt.VaList(bp+120, n1, n2))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+136, bp+300 /* &zErr[0] */, 0))
+ ts+24311, /* "putVarint return..." */
+ libc.VaList(bp+120, n1, n2))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+136, bp+300 /* &zErr[0] */, 0))
return 1
}
if in != *(*u64)(unsafe.Pointer(bp + 504 /* out */)) {
sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+300, /* &zErr[0] */
- ts+22262, /* "Wrote 0x%016llx ..." */
- crt.VaList(bp+152, in, *(*u64)(unsafe.Pointer(bp + 504 /* out */))))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+168, bp+300 /* &zErr[0] */, 0))
+ ts+24361, /* "Wrote 0x%016llx ..." */
+ libc.VaList(bp+152, in, *(*u64)(unsafe.Pointer(bp + 504 /* out */))))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+168, bp+300 /* &zErr[0] */, 0))
return 1
}
}
@@ -47895,7 +52452,7 @@ func btree_varint_test(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
for j = 0; j < 19; j++ {
sqlite3.Xsqlite3GetVarint(tls, bp+200 /* &zBuf[0] */, bp+504 /* &out */)
}
- in = in + (u64(*(*u321)(unsafe.Pointer(bp + 196 /* incr */))))
+ in = in + (u64(*(*u322)(unsafe.Pointer(bp + 196 /* incr */))))
}
return 0
}
@@ -47907,7 +52464,7 @@ func btree_varint_test(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
//
// sqlite3 db test.db
// set bt [btree_from_db db]
-func btree_from_db(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:516:26: */
+func btree_from_db(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:516:26: */
bp := tls.Alloc(236)
defer tls.Free(236)
@@ -47920,23 +52477,23 @@ func btree_from_db(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, ar
var iDb int32 = 0
if (argc != 2) && (argc != 3) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22318 /* " DB-HANDLE ?N?\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24417 /* " DB-HANDLE ?N?\"" */, 0))
return 1
}
if 1 != tcl.XTcl_GetCommandInfo(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), bp+72 /* &info */) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22334 /* "No such db-handl..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+9801 /* "\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24433 /* "No such db-handl..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+11456 /* "\"" */, 0))
return 1
}
if argc == 3 {
- iDb = crt.Xatoi(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)))
+ iDb = libc.Xatoi(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)))
}
db = *(*uintptr)(unsafe.Pointer((*Tcl_CmdInfo)(unsafe.Pointer(bp + 72 /* &info */)).FobjClientData))
pBt = (*Db)(unsafe.Pointer((*sqlite31)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+136 /* &zBuf[0] */, ts+11197 /* "%p" */, crt.VaList(bp+64, pBt))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+136 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp+64, pBt))
tcl.XTcl_SetResult(tls, interp, bp+136 /* &zBuf[0] */, uintptr(1))
return 0
}
@@ -47944,7 +52501,7 @@ func btree_from_db(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, ar
// Usage: btree_ismemdb ID
//
// Return true if the B-Tree is currently stored entirely in memory.
-func btree_ismemdb(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:556:26: */
+func btree_ismemdb(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:556:26: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -47953,25 +52510,25 @@ func btree_ismemdb(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, ar
var pFile uintptr
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+21303 /* " ID\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+23408 /* " ID\"" */, 0))
return 1
}
pBt = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
sqlite3.Xsqlite3_mutex_enter(tls, (*sqlite31)(unsafe.Pointer((*Btree)(unsafe.Pointer(pBt)).Fdb)).Fmutex)
sqlite3.Xsqlite3BtreeEnter(tls, pBt)
pFile = sqlite3.Xsqlite3PagerFile(tls, sqlite3.Xsqlite3BtreePager(tls, pBt))
- res = (crt.Bool32((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods == uintptr(0)))
+ res = (libc.Bool32((*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods == uintptr(0)))
sqlite3.Xsqlite3BtreeLeave(tls, pBt)
sqlite3.Xsqlite3_mutex_leave(tls, (*sqlite31)(unsafe.Pointer((*Btree)(unsafe.Pointer(pBt)).Fdb)).Fmutex)
- tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (crt.Bool32((res) != 0))))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (libc.Bool32((res) != 0))))
return 0
}
// usage: btree_set_cache_size ID NCACHE
//
// Set the size of the cache used by btree $ID.
-func btree_set_cache_size(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:587:26: */
+func btree_set_cache_size(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test3.c:587:26: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -47981,7 +52538,7 @@ func btree_set_cache_size(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
if argc != 3 {
tcl.XTcl_AppendResult(tls,
- interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), ts+22355 /* " BT NCACHE\"" */, 0))
+ interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), ts+24454 /* " BT NCACHE\"" */, 0))
return 1
}
pBt = sqlite3TestTextToPtr(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48000,7 +52557,7 @@ func btree_set_cache_size(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc in
// usage: btree_insert CSR ?KEY? VALUE
//
// Set the size of the cache used by btree $ID.
-func btree_insert(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test3.c:617:26: */
+func btree_insert(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test3.c:617:26: */
bp := tls.Alloc(68)
defer tls.Free(68)
@@ -48010,11 +52567,11 @@ func btree_insert(tls *crt.TLS, clientData ClientData, interp uintptr, objc int3
// var x BtreePayload at bp+16, 48
if (objc != 4) && (objc != 3) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+22367 /* "?-intkey? CSR KE..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+24466 /* "?-intkey? CSR KE..." */)
return 1
}
- crt.Xmemset(tls, bp+16 /* &x */, 0, uint64(unsafe.Sizeof(BtreePayload{})))
+ libc.Xmemset(tls, bp+16 /* &x */, 0, uint64(unsafe.Sizeof(BtreePayload{})))
if objc == 4 {
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+64 /* &rc */) != 0 {
return 1
@@ -48035,50 +52592,290 @@ func btree_insert(tls *crt.TLS, clientData ClientData, interp uintptr, objc int3
tcl.XTcl_ResetResult(tls, interp)
if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, sqlite3.Xsqlite3ErrName(tls, *(*int32)(unsafe.Pointer(bp + 64 /* rc */))), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3ErrName(tls, *(*int32)(unsafe.Pointer(bp + 64 /* rc */))), 0))
return 1
}
return 0
}
// Register commands with the TCL interpreter.
-func Sqlitetest3_Init(tls *crt.TLS, interp uintptr) int32 { /* test3.c:661:5: */
+func Sqlitetest3_Init(tls *libc.TLS, interp uintptr) int32 { /* test3.c:661:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd2)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd3)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateCommand(tls, interp, aCmd2[i].FzName, aCmd2[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateCommand(tls, interp, aCmd3[i].FzName, aCmd3[i].FxProc, uintptr(0), uintptr(0))
}
- tcl.XTcl_CreateObjCommand(tls, interp, ts+22391 /* "btree_insert" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+24490 /* "btree_insert" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
}{btree_insert})), uintptr(0), uintptr(0))
return 0
}
-var aCmd2 = [14]struct {
+var aCmd3 = [14]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 22404 /* "btree_open" */, FxProc: 0},
- {FzName: ts + 22415 /* "btree_close" */, FxProc: 0},
- {FzName: ts + 22427 /* "btree_begin_tran..." */, FxProc: 0},
- {FzName: ts + 22451 /* "btree_pager_stat..." */, FxProc: 0},
- {FzName: ts + 22469 /* "btree_cursor" */, FxProc: 0},
- {FzName: ts + 22482 /* "btree_close_curs..." */, FxProc: 0},
- {FzName: ts + 22501 /* "btree_next" */, FxProc: 0},
- {FzName: ts + 22512 /* "btree_eof" */, FxProc: 0},
- {FzName: ts + 22522 /* "btree_payload_si..." */, FxProc: 0},
- {FzName: ts + 22541 /* "btree_first" */, FxProc: 0},
- {FzName: ts + 22553 /* "btree_varint_tes..." */, FxProc: 0},
- {FzName: ts + 22571 /* "btree_from_db" */, FxProc: 0},
- {FzName: ts + 22585 /* "btree_ismemdb" */, FxProc: 0},
- {FzName: ts + 22599 /* "btree_set_cache_..." */, FxProc: 0},
+ {FzName: ts + 24503 /* "btree_open" */, FxProc: 0},
+ {FzName: ts + 24514 /* "btree_close" */, FxProc: 0},
+ {FzName: ts + 24526 /* "btree_begin_tran..." */, FxProc: 0},
+ {FzName: ts + 24550 /* "btree_pager_stat..." */, FxProc: 0},
+ {FzName: ts + 24568 /* "btree_cursor" */, FxProc: 0},
+ {FzName: ts + 24581 /* "btree_close_curs..." */, FxProc: 0},
+ {FzName: ts + 24600 /* "btree_next" */, FxProc: 0},
+ {FzName: ts + 24611 /* "btree_eof" */, FxProc: 0},
+ {FzName: ts + 24621 /* "btree_payload_si..." */, FxProc: 0},
+ {FzName: ts + 24640 /* "btree_first" */, FxProc: 0},
+ {FzName: ts + 24652 /* "btree_varint_tes..." */, FxProc: 0},
+ {FzName: ts + 24670 /* "btree_from_db" */, FxProc: 0},
+ {FzName: ts + 24684 /* "btree_ismemdb" */, FxProc: 0},
+ {FzName: ts + 24698 /* "btree_set_cache_..." */, FxProc: 0},
} /* test3.c:665:5 */
+// end block for C++
+
+// Local Variables:
+// mode: c
+// c-basic-offset: 4
+// fill-column: 78
+// End:
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// ISO C99 Standard: 7.20 General utilities <stdlib.h>
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// ISO C99 Standard: 7.21 String handling <string.h>
+
+// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 1992-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface.
+// Copyright (C) 1996-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Get type definitions.
+// bits/types.h -- definitions of __*_t types underlying *_t types.
+// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Never include this file directly; use <sys/types.h> instead.
+
+// Copyright (C) 1989-2018 Free Software Foundation, Inc.
+//
+//This file is part of GCC.
+//
+//GCC is free software; you can redistribute it and/or modify
+//it under the terms of the GNU General Public License as published by
+//the Free Software Foundation; either version 3, or (at your option)
+//any later version.
+//
+//GCC is distributed in the hope that it will be useful,
+//but WITHOUT ANY WARRANTY; without even the implied warranty of
+//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//GNU General Public License for more details.
+//
+//Under Section 7 of GPL version 3, you are granted additional
+//permissions described in the GCC Runtime Library Exception, version
+//3.1, as published by the Free Software Foundation.
+//
+//You should have received a copy of the GNU General Public License and
+//a copy of the GCC Runtime Library Exception along with this program;
+//see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+//<http://www.gnu.org/licenses/>.
+
+// ISO C Standard: 7.17 Common definitions <stddef.h>
+
+// Any one of these symbols __need_* means that GNU libc
+// wants us just to define one data type. So don't define
+// the symbols that indicate this file's entire job has been done.
+
+// This avoids lossage on SunOS but only if stdtypes.h comes first.
+// There's no way to win with the other order! Sun lossage.
+
+// On 4.3bsd-net2, make sure ansi.h is included, so we have
+// one less case to deal with in the following.
+// On FreeBSD 5, machine/ansi.h does not exist anymore...
+
+// In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
+// defined if the corresponding type is *not* defined.
+// FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
+// NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_
+
+// Sequent's header files use _PTRDIFF_T_ in some conflicting way.
+// Just ignore it.
+
+// On VxWorks, <type/vxTypesBase.h> may have defined macros like
+// _TYPE_size_t which will typedef size_t. fixincludes patched the
+// vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
+// not defined, and so that defining this macro defines _GCC_SIZE_T.
+// If we find that the macros are still defined at this point, we must
+// invoke them so that the type is defined as expected.
+
+// In case nobody has defined these types, but we aren't running under
+// GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
+// __WCHAR_TYPE__ have reasonable values. This can happen if the
+// parts of GCC is compiled by an older compiler, that actually
+// include gstddef.h, such as collect2.
+
+// Signed type of difference of two pointers.
+
+// Define this type if we are doing the whole job,
+// or if we want this type in particular.
+
+// If this symbol has done its job, get rid of it.
+
+// Unsigned type of `sizeof' something.
+
+// Define this type if we are doing the whole job,
+// or if we want this type in particular.
+
+// Wide character type.
+// Locale-writers should change this as necessary to
+// be big enough to hold unique values not between 0 and 127,
+// and not (wchar_t) -1, for each defined multibyte character.
+
+// Define this type if we are doing the whole job,
+// or if we want this type in particular.
+
+// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
+// are already defined.
+// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
+// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
+
+// A null pointer constant.
+
+// Offset of member MEMBER in a struct of type TYPE.
+
+// NB: Include guard matches what <linux/time.h> uses.
+
// Get system specific constant and data structure definitions.
// Definitions of constants and data structure for POSIX 1003.1b-1993
// scheduling interface.
@@ -48171,31 +52968,31 @@ type Thread = struct {
var threadset [26]Thread /* test4.c:61:15: */
// The main loop for a thread. Threads use busy waiting.
-func test_thread_main(tls *crt.TLS, pArg uintptr) uintptr { /* test4.c:67:13: */
+func test_thread_main(tls *libc.TLS, pArg uintptr) uintptr { /* test4.c:67:13: */
var p uintptr = pArg
if (*Thread)(unsafe.Pointer(p)).Fdb != 0 {
sqlite3.Xsqlite3_close(tls, (*Thread)(unsafe.Pointer(p)).Fdb)
}
sqlite3.Xsqlite3_open(tls, (*Thread)(unsafe.Pointer(p)).FzFilename, (p + 40 /* &.db */))
if 0 != sqlite3.Xsqlite3_errcode(tls, (*Thread)(unsafe.Pointer(p)).Fdb) {
- (*Thread)(unsafe.Pointer(p)).FzErr = crt.Xstrdup(tls, sqlite3.Xsqlite3_errmsg(tls, (*Thread)(unsafe.Pointer(p)).Fdb))
+ (*Thread)(unsafe.Pointer(p)).FzErr = libc.Xstrdup(tls, sqlite3.Xsqlite3_errmsg(tls, (*Thread)(unsafe.Pointer(p)).Fdb))
sqlite3.Xsqlite3_close(tls, (*Thread)(unsafe.Pointer(p)).Fdb)
(*Thread)(unsafe.Pointer(p)).Fdb = uintptr(0)
}
(*Thread)(unsafe.Pointer(p)).FpStmt = uintptr(0)
(*Thread)(unsafe.Pointer(p)).Fcompleted = 1
for (*Thread)(unsafe.Pointer(p)).Fopnum <= (*Thread)(unsafe.Pointer(p)).Fcompleted {
- crt2.Xsched_yield(tls)
+ libc2.Xsched_yield(tls)
}
for (*Thread)(unsafe.Pointer(p)).FxOp != 0 {
if ((*Thread)(unsafe.Pointer(p)).FzErr != 0) && ((*Thread)(unsafe.Pointer(p)).FzErr != (*Thread)(unsafe.Pointer(p)).FzStaticErr) {
sqlite3.Xsqlite3_free(tls, (*Thread)(unsafe.Pointer(p)).FzErr)
(*Thread)(unsafe.Pointer(p)).FzErr = uintptr(0)
}
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((p + 8 /* &.xOp */))))(tls, p)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((p + 8 /* &.xOp */))))(tls, p)
(*Thread)(unsafe.Pointer(p)).Fcompleted++
for (*Thread)(unsafe.Pointer(p)).Fopnum <= (*Thread)(unsafe.Pointer(p)).Fcompleted {
- crt2.Xsched_yield(tls)
+ libc2.Xsched_yield(tls)
}
}
if (*Thread)(unsafe.Pointer(p)).FpStmt != 0 {
@@ -48218,12 +53015,12 @@ func test_thread_main(tls *crt.TLS, pArg uintptr) uintptr { /* test4.c:67:13: */
// Get a thread ID which is an upper case letter. Return the index.
// If the argument is not a valid thread ID put an error message in
// the interpreter and return -1.
-func parse_thread_id(tls *crt.TLS, interp uintptr, zArg uintptr) int32 { /* test4.c:114:12: */
+func parse_thread_id(tls *libc.TLS, interp uintptr, zArg uintptr) int32 { /* test4.c:114:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
- if (((zArg == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) == 0)) || (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(1)))) != 0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zArg + uintptr(0))))))*2))) & int32(_ISupper)) != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+22620 /* "thread ID must b..." */, 0))
+ if (((zArg == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) == 0)) || (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(1)))) != 0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zArg + uintptr(0))))))*2))) & int32(_ISupper)) != 0) {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+24719 /* "thread ID must b..." */, 0))
return -1
}
return (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) - 'A')
@@ -48233,7 +53030,7 @@ func parse_thread_id(tls *crt.TLS, interp uintptr, zArg uintptr) int32 { /* test
//
// NAME should be an upper case letter. Start the thread running with
// an open connection to the given database.
-func tcl_thread_create(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:128:26: */
+func tcl_thread_create(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:128:26: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -48243,8 +53040,8 @@ func tcl_thread_create(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
var rc int32
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22659 /* " ID FILENAME" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24758 /* " ID FILENAME" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48252,46 +53049,46 @@ func tcl_thread_create(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
return 1
}
if threadset[i].Fbusy != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22672 /* "thread " */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+22680 /* " is already runn..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24771 /* "thread " */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+24779 /* " is already runn..." */, 0))
return 1
}
threadset[i].Fbusy = 1
sqlite3.Xsqlite3_free(tls, threadset[i].FzFilename)
- threadset[i].FzFilename = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ threadset[i].FzFilename = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
threadset[i].Fopnum = 1
threadset[i].Fcompleted = 0
- rc = crt2.Xpthread_create(tls, bp+88 /* &x */, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) uintptr
+ rc = libc2.Xpthread_create(tls, bp+88 /* &x */, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) uintptr
}{test_thread_main})), (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+72, ts+22700 /* "failed to create..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, ts+24799 /* "failed to create..." */, 0))
sqlite3.Xsqlite3_free(tls, threadset[i].FzFilename)
threadset[i].Fbusy = 0
return 1
}
- crt2.Xpthread_detach(tls, *(*pthread_t)(unsafe.Pointer(bp + 88 /* x */)))
+ libc2.Xpthread_detach(tls, *(*pthread_t)(unsafe.Pointer(bp + 88 /* x */)))
return 0
}
// Wait for a thread to reach its idle state.
-func test_thread_wait(tls *crt.TLS, p uintptr) { /* test4.c:168:13: */
+func test_thread_wait(tls *libc.TLS, p uintptr) { /* test4.c:168:13: */
for (*Thread)(unsafe.Pointer(p)).Fopnum > (*Thread)(unsafe.Pointer(p)).Fcompleted {
- crt2.Xsched_yield(tls)
+ libc2.Xsched_yield(tls)
}
}
// Usage: thread_wait ID
//
// Wait on thread ID to reach its idle state.
-func tcl_thread_wait(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:177:26: */
+func tcl_thread_wait(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:177:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var i int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22728 /* " ID" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24827 /* " ID" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48299,7 +53096,7 @@ func tcl_thread_wait(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
@@ -48307,7 +53104,7 @@ func tcl_thread_wait(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
}
// Stop a thread.
-func test_stop_thread(tls *crt.TLS, p uintptr) { /* test4.c:203:13: */
+func test_stop_thread(tls *libc.TLS, p uintptr) { /* test4.c:203:13: */
test_thread_wait(tls, p)
(*Thread)(unsafe.Pointer(p)).FxOp = uintptr(0)
(*Thread)(unsafe.Pointer(p)).Fopnum++
@@ -48323,15 +53120,15 @@ func test_stop_thread(tls *crt.TLS, p uintptr) { /* test4.c:203:13: */
//
// Cause a thread to shut itself down. Wait for the shutdown to be
// completed. If ID is "*" then stop all threads.
-func tcl_thread_halt(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:221:26: */
+func tcl_thread_halt(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:221:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var i int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22728 /* " ID" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24827 /* " ID" */, 0))
return 1
}
if (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)) + uintptr(0)))) == '*') && (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)) + uintptr(1)))) == 0) {
@@ -48346,7 +53143,7 @@ func tcl_thread_halt(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
test_stop_thread(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
@@ -48358,7 +53155,7 @@ func tcl_thread_halt(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
//
// Wait on the most recent thread_step to complete, then return the
// number of columns in the result set.
-func tcl_thread_argc(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:256:26: */
+func tcl_thread_argc(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:256:26: */
bp := tls.Alloc(172)
defer tls.Free(172)
@@ -48366,8 +53163,8 @@ func tcl_thread_argc(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
// var zBuf [100]int8 at bp+72, 100
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22728 /* " ID" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24827 /* " ID" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48375,12 +53172,12 @@ func tcl_thread_argc(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+48, threadset[i].Fargc))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, bp+72 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+48, threadset[i].Fargc))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+72 /* &zBuf[0] */, 0))
return 0
}
@@ -48388,7 +53185,7 @@ func tcl_thread_argc(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
//
// Wait on the most recent thread_step to complete, then return the
// value of the N-th columns in the result set.
-func tcl_thread_argv(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:288:26: */
+func tcl_thread_argv(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:288:26: */
bp := tls.Alloc(84)
defer tls.Free(84)
@@ -48396,8 +53193,8 @@ func tcl_thread_argv(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
// var n int32 at bp+80, 4
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22747 /* " ID N" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24846 /* " ID N" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48405,7 +53202,7 @@ func tcl_thread_argv(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), bp+80 /* &n */) != 0 {
@@ -48413,10 +53210,10 @@ func tcl_thread_argv(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
if (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) < 0) || (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) >= threadset[i].Fargc) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, ts+22753 /* "column number ou..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+24852 /* "column number ou..." */, 0))
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+64, *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680 + 80 /* &.argv */) + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))*8)), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680 + 80 /* &.argv */) + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))*8)), 0))
return 0
}
@@ -48424,7 +53221,7 @@ func tcl_thread_argv(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
//
// Wait on the most recent thread_step to complete, then return the
// name of the N-th columns in the result set.
-func tcl_thread_colname(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:324:26: */
+func tcl_thread_colname(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:324:26: */
bp := tls.Alloc(84)
defer tls.Free(84)
@@ -48432,8 +53229,8 @@ func tcl_thread_colname(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
// var n int32 at bp+80, 4
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22747 /* " ID N" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24846 /* " ID N" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48441,7 +53238,7 @@ func tcl_thread_colname(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), bp+80 /* &n */) != 0 {
@@ -48449,10 +53246,10 @@ func tcl_thread_colname(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
if (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) < 0) || (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) >= threadset[i].Fargc) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, ts+22753 /* "column number ou..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+24852 /* "column number ou..." */, 0))
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+64, *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680 + 880 /* &.colv */) + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))*8)), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680 + 880 /* &.colv */) + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))*8)), 0))
return 0
}
@@ -48460,7 +53257,7 @@ func tcl_thread_colname(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
//
// Wait on the most recent operation to complete, then return the
// result code from that operation.
-func tcl_thread_result(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:360:26: */
+func tcl_thread_result(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:360:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -48468,8 +53265,8 @@ func tcl_thread_result(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
var zName uintptr
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22728 /* " ID" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24827 /* " ID" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48477,12 +53274,12 @@ func tcl_thread_result(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
zName = sqlite3.Xsqlite3ErrName(tls, threadset[i].Frc)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, zName, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, zName, 0))
return 0
}
@@ -48490,15 +53287,15 @@ func tcl_thread_result(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
//
// Wait on the most recent operation to complete, then return the
// error string.
-func tcl_thread_error(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:392:26: */
+func tcl_thread_error(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:392:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
var i int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22728 /* " ID" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24827 /* " ID" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48506,18 +53303,18 @@ func tcl_thread_error(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, threadset[i].FzErr, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, threadset[i].FzErr, 0))
return 0
}
// This procedure runs in the thread to compile an SQL statement.
-func do_compile(tls *crt.TLS, p uintptr) { /* test4.c:419:13: */
+func do_compile(tls *libc.TLS, p uintptr) { /* test4.c:419:13: */
if (*Thread)(unsafe.Pointer(p)).Fdb == uintptr(0) {
- (*Thread)(unsafe.Pointer(p)).FzErr = crt.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+22780 /* "no database is o..." */)
+ (*Thread)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24879 /* "no database is o..." */)
(*Thread)(unsafe.Pointer(p)).Frc = 1
return
}
@@ -48531,14 +53328,14 @@ func do_compile(tls *crt.TLS, p uintptr) { /* test4.c:419:13: */
// Usage: thread_compile ID SQL
//
// Compile a new virtual machine.
-func tcl_thread_compile(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:437:26: */
+func tcl_thread_compile(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:437:26: */
bp := tls.Alloc(56)
defer tls.Free(56)
var i int32
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22800 /* " ID SQL" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24899 /* " ID SQL" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48546,22 +53343,22 @@ func tcl_thread_compile(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
- threadset[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{do_compile}))
+ threadset[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{do_compile}))
sqlite3.Xsqlite3_free(tls, threadset[i].FzArg)
- threadset[i].FzArg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ threadset[i].FzArg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
threadset[i].Fopnum++
return 0
}
// This procedure runs in the thread to step the virtual machine.
-func do_step(tls *crt.TLS, p uintptr) { /* test4.c:466:13: */
+func do_step(tls *libc.TLS, p uintptr) { /* test4.c:466:13: */
var i int32
if (*Thread)(unsafe.Pointer(p)).FpStmt == uintptr(0) {
- (*Thread)(unsafe.Pointer(p)).FzErr = crt.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+22808 /* "no virtual machi..." */)
+ (*Thread)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24907 /* "no virtual machi..." */)
(*Thread)(unsafe.Pointer(p)).Frc = 1
return
}
@@ -48580,14 +53377,14 @@ func do_step(tls *crt.TLS, p uintptr) { /* test4.c:466:13: */
// Usage: thread_step ID
//
// Advance the virtual machine by one step
-func tcl_thread_step(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:490:26: */
+func tcl_thread_step(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:490:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var i int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22837 /* " IDL" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24936 /* " IDL" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48595,19 +53392,19 @@ func tcl_thread_step(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
- threadset[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{do_step}))
+ threadset[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{do_step}))
threadset[i].Fopnum++
return 0
}
// This procedure runs in the thread to finalize a virtual machine.
-func do_finalize(tls *crt.TLS, p uintptr) { /* test4.c:517:13: */
+func do_finalize(tls *libc.TLS, p uintptr) { /* test4.c:517:13: */
if (*Thread)(unsafe.Pointer(p)).FpStmt == uintptr(0) {
- (*Thread)(unsafe.Pointer(p)).FzErr = crt.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+22808 /* "no virtual machi..." */)
+ (*Thread)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24907 /* "no virtual machi..." */)
(*Thread)(unsafe.Pointer(p)).Frc = 1
return
}
@@ -48618,14 +53415,14 @@ func do_finalize(tls *crt.TLS, p uintptr) { /* test4.c:517:13: */
// Usage: thread_finalize ID
//
// Finalize the virtual machine.
-func tcl_thread_finalize(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:532:26: */
+func tcl_thread_finalize(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:532:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var i int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22837 /* " IDL" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24936 /* " IDL" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48633,11 +53430,11 @@ func tcl_thread_finalize(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
- threadset[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{do_finalize}))
+ threadset[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{do_finalize}))
sqlite3.Xsqlite3_free(tls, threadset[i].FzArg)
threadset[i].FzArg = uintptr(0)
threadset[i].Fopnum++
@@ -48647,7 +53444,7 @@ func tcl_thread_finalize(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
// Usage: thread_swap ID ID
//
// Interchange the sqlite* pointer between two threads.
-func tcl_thread_swap(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:563:26: */
+func tcl_thread_swap(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:563:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -48655,8 +53452,8 @@ func tcl_thread_swap(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
var j int32
var temp uintptr
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22842 /* " ID1 ID2" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24941 /* " ID1 ID2" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48664,7 +53461,7 @@ func tcl_thread_swap(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
@@ -48673,7 +53470,7 @@ func tcl_thread_swap(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset[j].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+24831 /* "no such thread" */, 0))
return 1
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(j)*1680))
@@ -48688,7 +53485,7 @@ func tcl_thread_swap(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
// Return the database connection pointer for the given thread. Then
// remove the pointer from the thread itself. Afterwards, the thread
// can be stopped and the connection can be used by the main thread.
-func tcl_thread_db_get(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:603:26: */
+func tcl_thread_db_get(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:603:26: */
bp := tls.Alloc(164)
defer tls.Free(164)
@@ -48696,8 +53493,8 @@ func tcl_thread_db_get(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
// var zBuf [100]int8 at bp+64, 100
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22728 /* " ID" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24827 /* " ID" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48705,26 +53502,26 @@ func tcl_thread_db_get(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
sqlite3TestMakePointerStr(tls, interp, bp+64 /* &zBuf[0] */, threadset[i].Fdb)
threadset[i].Fdb = uintptr(0)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, bp+64 /* &zBuf[0] */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, bp+64 /* &zBuf[0] */, uintptr(0)))
return 0
}
// Usage: thread_db_put ID DB
//
-func tcl_thread_db_put(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:634:26: */
+func tcl_thread_db_put(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:634:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var i int32
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22851 /* " ID DB" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24950 /* " ID DB" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48732,7 +53529,7 @@ func tcl_thread_db_put(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
@@ -48745,7 +53542,7 @@ func tcl_thread_db_put(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
//
// Return the database stmt pointer for the given thread. Then
// remove the pointer from the thread itself.
-func tcl_thread_stmt_get(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:666:26: */
+func tcl_thread_stmt_get(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test4.c:666:26: */
bp := tls.Alloc(164)
defer tls.Free(164)
@@ -48753,8 +53550,8 @@ func tcl_thread_stmt_get(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
// var zBuf [100]int8 at bp+64, 100
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22728 /* " ID" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24827 /* " ID" */, 0))
return 1
}
i = parse_thread_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -48762,48 +53559,48 @@ func tcl_thread_stmt_get(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
return 1
}
if !(threadset[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
test_thread_wait(tls, (uintptr(unsafe.Pointer(&threadset)) + uintptr(i)*1680))
sqlite3TestMakePointerStr(tls, interp, bp+64 /* &zBuf[0] */, threadset[i].FpStmt)
threadset[i].FpStmt = uintptr(0)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, bp+64 /* &zBuf[0] */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, bp+64 /* &zBuf[0] */, uintptr(0)))
return 0
}
// Register commands with the TCL interpreter.
-func Sqlitetest4_Init(tls *crt.TLS, interp uintptr) int32 { /* test4.c:696:5: */
+func Sqlitetest4_Init(tls *libc.TLS, interp uintptr) int32 { /* test4.c:696:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd3)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd4)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateCommand(tls, interp, aCmd3[i].FzName, aCmd3[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateCommand(tls, interp, aCmd4[i].FzName, aCmd4[i].FxProc, uintptr(0), uintptr(0))
}
return 0
}
-var aCmd3 = [15]struct {
+var aCmd4 = [15]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 22858 /* "thread_create" */, FxProc: 0},
- {FzName: ts + 22872 /* "thread_wait" */, FxProc: 0},
- {FzName: ts + 22884 /* "thread_halt" */, FxProc: 0},
- {FzName: ts + 22896 /* "thread_argc" */, FxProc: 0},
- {FzName: ts + 22908 /* "thread_argv" */, FxProc: 0},
- {FzName: ts + 22920 /* "thread_colname" */, FxProc: 0},
- {FzName: ts + 22935 /* "thread_result" */, FxProc: 0},
- {FzName: ts + 22949 /* "thread_error" */, FxProc: 0},
- {FzName: ts + 22962 /* "thread_compile" */, FxProc: 0},
- {FzName: ts + 22977 /* "thread_step" */, FxProc: 0},
- {FzName: ts + 22989 /* "thread_finalize" */, FxProc: 0},
- {FzName: ts + 23005 /* "thread_swap" */, FxProc: 0},
- {FzName: ts + 23017 /* "thread_db_get" */, FxProc: 0},
- {FzName: ts + 23031 /* "thread_db_put" */, FxProc: 0},
- {FzName: ts + 23045 /* "thread_stmt_get" */, FxProc: 0},
+ {FzName: ts + 24957 /* "thread_create" */, FxProc: 0},
+ {FzName: ts + 24971 /* "thread_wait" */, FxProc: 0},
+ {FzName: ts + 24983 /* "thread_halt" */, FxProc: 0},
+ {FzName: ts + 24995 /* "thread_argc" */, FxProc: 0},
+ {FzName: ts + 25007 /* "thread_argv" */, FxProc: 0},
+ {FzName: ts + 25019 /* "thread_colname" */, FxProc: 0},
+ {FzName: ts + 25034 /* "thread_result" */, FxProc: 0},
+ {FzName: ts + 25048 /* "thread_error" */, FxProc: 0},
+ {FzName: ts + 25061 /* "thread_compile" */, FxProc: 0},
+ {FzName: ts + 25076 /* "thread_step" */, FxProc: 0},
+ {FzName: ts + 25088 /* "thread_finalize" */, FxProc: 0},
+ {FzName: ts + 25104 /* "thread_swap" */, FxProc: 0},
+ {FzName: ts + 25116 /* "thread_db_get" */, FxProc: 0},
+ {FzName: ts + 25130 /* "thread_db_put" */, FxProc: 0},
+ {FzName: ts + 25144 /* "thread_stmt_get" */, FxProc: 0},
} /* test4.c:700:5 */
// end block for C++
@@ -48854,7 +53651,7 @@ var aCmd3 = [15]struct {
// The first argument is a TCL UTF-8 string. Return the byte array
// object with the encoded representation of the string, including
// the NULL terminator.
-func binarize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test5.c:33:26: */
+func binarize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test5.c:33:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -48878,7 +53675,7 @@ func binarize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv
//
// If <do-calls> is 0, then the calls to sqlite3_value_text() are not
// actually made.
-func test_value_overhead(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test5.c:61:26: */
+func test_value_overhead(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test5.c:61:26: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -48890,8 +53687,8 @@ func test_value_overhead(tls *crt.TLS, clientData uintptr, interp uintptr, objc
// var val Mem at bp+40, 56
if objc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+23061 /* " <repeat-count> ..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)), ts+25160 /* " <repeat-count> ..." */, 0))
return 1
}
@@ -48903,7 +53700,7 @@ func test_value_overhead(tls *crt.TLS, clientData uintptr, interp uintptr, objc
}
(*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fflags = (u16((0x0002 | 0x0200) | 0x0800))
- (*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fz = ts + 23088 /* "hello world" */
+ (*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fz = ts + 25187 /* "hello world" */
(*Mem)(unsafe.Pointer(bp + 40 /* &val */)).Fenc = u8(1)
for i = 0; i < *(*int32)(unsafe.Pointer(bp + 32 /* repeat_count */)); i++ {
@@ -48915,15 +53712,15 @@ func test_value_overhead(tls *crt.TLS, clientData uintptr, interp uintptr, objc
return 0
}
-func name_to_enc(tls *crt.TLS, interp uintptr, pObj uintptr) u8 { /* test5.c:94:11: */
+func name_to_enc(tls *libc.TLS, interp uintptr, pObj uintptr) u8 { /* test5.c:94:11: */
bp := tls.Alloc(104)
defer tls.Free(104)
*(*[5]EncName)(unsafe.Pointer(bp + 24 /* encnames */)) = [5]EncName{
- {FzName: ts + 23100 /* "UTF8" */, Fenc: u8(1)},
- {FzName: ts + 23105 /* "UTF16LE" */, Fenc: u8(2)},
- {FzName: ts + 23113 /* "UTF16BE" */, Fenc: u8(3)},
- {FzName: ts + 23121 /* "UTF16" */, Fenc: u8(4)},
+ {FzName: ts + 25199 /* "UTF8" */, Fenc: u8(1)},
+ {FzName: ts + 25204 /* "UTF16LE" */, Fenc: u8(2)},
+ {FzName: ts + 25212 /* "UTF16BE" */, Fenc: u8(3)},
+ {FzName: ts + 25220 /* "UTF16" */, Fenc: u8(4)},
{FzName: uintptr(0), Fenc: u8(0)},
}
var pEnc uintptr
@@ -48934,7 +53731,7 @@ func name_to_enc(tls *crt.TLS, interp uintptr, pObj uintptr) u8 { /* test5.c:94:
}
}
if !(int32((*EncName)(unsafe.Pointer(pEnc)).Fenc) != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+23127 /* "No such encoding..." */, z, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+25226 /* "No such encoding..." */, z, 0))
}
if int32((*EncName)(unsafe.Pointer(pEnc)).Fenc) == 4 {
return u8(2)
@@ -48950,7 +53747,7 @@ type EncName = struct {
// Usage: test_translate <string/blob> <from enc> <to enc> ?<transient>?
//
-func test_translate(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test5.c:125:26: */
+func test_translate(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test5.c:125:26: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -48963,13 +53760,13 @@ func test_translate(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
var xDel uintptr = uintptr(0)
if (objc != 4) && (objc != 5) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8)), uintptr(0)),
- ts+23146 /* " <string/blob> <..." */, 0))
+ ts+25245 /* " <string/blob> <..." */, 0))
return 1
}
if objc == 5 {
- xDel = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free}))
+ xDel = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free}))
}
enc_from = name_to_enc(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
@@ -48986,7 +53783,7 @@ func test_translate(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
if int32(enc_from) == 1 {
z = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
if objc == 5 {
- z = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+32, z))
+ z = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+32, z))
}
sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, z, enc_from, xDel)
} else {
@@ -48994,7 +53791,7 @@ func test_translate(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
if objc == 5 {
var zTmp uintptr = z
z = sqlite3.Xsqlite3_malloc(tls, *(*int32)(unsafe.Pointer(bp + 40 /* len */)))
- crt.Xmemcpy(tls, z, zTmp, uint64(*(*int32)(unsafe.Pointer(bp + 40 /* len */))))
+ libc.Xmemcpy(tls, z, zTmp, uint64(*(*int32)(unsafe.Pointer(bp + 40 /* len */))))
}
sqlite3.Xsqlite3ValueSetStr(tls, pVal, -1, z, enc_from, xDel)
}
@@ -49012,31 +53809,31 @@ func test_translate(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
return 0
}
-func test_translate_selftest(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test5.c:189:26: */
+func test_translate_selftest(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test5.c:189:26: */
sqlite3.Xsqlite3UtfSelfTest(tls)
return 0
}
// Register commands with the TCL interpreter.
-func Sqlitetest5_Init(tls *crt.TLS, interp uintptr) int32 { /* test5.c:205:5: */
+func Sqlitetest5_Init(tls *libc.TLS, interp uintptr) int32 { /* test5.c:205:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd4)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd5)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aCmd4[i].FzName, aCmd4[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aCmd5[i].FzName, aCmd5[i].FxProc, uintptr(0), uintptr(0))
}
return 0
}
-var aCmd4 = [4]struct {
+var aCmd5 = [4]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 23181 /* "binarize" */, FxProc: 0},
- {FzName: ts + 23190 /* "test_value_overh..." */, FxProc: 0},
- {FzName: ts + 23210 /* "test_translate" */, FxProc: 0},
- {FzName: ts + 23225 /* "translate_selfte..." */, FxProc: 0},
+ {FzName: ts + 25280 /* "binarize" */, FxProc: 0},
+ {FzName: ts + 25289 /* "test_value_overh..." */, FxProc: 0},
+ {FzName: ts + 25309 /* "test_translate" */, FxProc: 0},
+ {FzName: ts + 25324 /* "translate_selfte..." */, FxProc: 0},
} /* test5.c:209:5 */
// end block for C++
@@ -49095,19 +53892,19 @@ var g = CrashGlobal{FpWriteList: uintptr(0), FpWriteListEnd: uintptr(0), FiSecto
// Set this global variable to 1 to enable crash testing.
var sqlite3CrashTestEnable int32 = 0 /* test6.c:161:12 */
-func crash_malloc(tls *crt.TLS, nByte int32) uintptr { /* test6.c:163:13: */
+func crash_malloc(tls *libc.TLS, nByte int32) uintptr { /* test6.c:163:13: */
return tcl.XTcl_AttemptAlloc(tls, uint32(size_t(nByte)))
}
-func crash_free(tls *crt.TLS, p uintptr) { /* test6.c:166:13: */
+func crash_free(tls *libc.TLS, p uintptr) { /* test6.c:166:13: */
tcl.XTcl_Free(tls, p)
}
-func crash_realloc(tls *crt.TLS, p uintptr, n int32) uintptr { /* test6.c:169:13: */
+func crash_realloc(tls *libc.TLS, p uintptr, n int32) uintptr { /* test6.c:169:13: */
return tcl.XTcl_AttemptRealloc(tls, p, uint32(size_t(n)))
}
// Wrapper around the sqlite3OsWrite() function that avoids writing to the
// 512 byte block begining at offset PENDING_BYTE.
-func writeDbFile(tls *crt.TLS, p uintptr, z uintptr, iAmt i64, iOff i64) int32 { /* test6.c:177:12: */
+func writeDbFile(tls *libc.TLS, p uintptr, z uintptr, iAmt i64, iOff i64) int32 { /* test6.c:177:12: */
var rc int32 = 0
var iSkip int32 = 0
if (iAmt - i64(iSkip)) > int64(0) {
@@ -49118,7 +53915,7 @@ func writeDbFile(tls *crt.TLS, p uintptr, z uintptr, iAmt i64, iOff i64) int32 {
// Flush the write-list as if xSync() had been called on file handle
// pFile. If isCrash is true, simulate a crash.
-func writeListSync(tls *crt.TLS, pFile uintptr, isCrash int32) int32 { /* test6.c:190:12: */
+func writeListSync(tls *libc.TLS, pFile uintptr, isCrash int32) int32 { /* test6.c:190:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -49265,7 +54062,7 @@ func writeListSync(tls *crt.TLS, pFile uintptr, isCrash int32) int32 { /* test6.
}
if (rc == 0) && (isCrash != 0) {
- crt.Xexit(tls, -1)
+ libc.Xexit(tls, -1)
}
for pWrite = g.FpWriteList; (pWrite != 0) && ((*WriteBuffer)(unsafe.Pointer(pWrite)).FpNext != 0); pWrite = (*WriteBuffer)(unsafe.Pointer(pWrite)).FpNext {
@@ -49276,20 +54073,20 @@ func writeListSync(tls *crt.TLS, pFile uintptr, isCrash int32) int32 { /* test6.
}
// Add an entry to the end of the write-list.
-func writeListAppend(tls *crt.TLS, pFile uintptr, iOffset sqlite3_int64, zBuf uintptr, nBuf int32) int32 { /* test6.c:362:12: */
+func writeListAppend(tls *libc.TLS, pFile uintptr, iOffset sqlite3_int64, zBuf uintptr, nBuf int32) int32 { /* test6.c:362:12: */
var pNew uintptr
pNew = crash_malloc(tls, (int32(uint64(unsafe.Sizeof(WriteBuffer{})) + uint64(nBuf))))
if pNew == uintptr(0) {
- crt.Xfprintf(tls, crt.Xstderr, ts+23244 /* "out of memory in..." */, 0)
+ libc.Xfprintf(tls, libc.Xstderr, ts+25343 /* "out of memory in..." */, 0)
}
- crt.Xmemset(tls, pNew, 0, (uint64(unsafe.Sizeof(WriteBuffer{})) + uint64(nBuf)))
+ libc.Xmemset(tls, pNew, 0, (uint64(unsafe.Sizeof(WriteBuffer{})) + uint64(nBuf)))
(*WriteBuffer)(unsafe.Pointer(pNew)).FiOffset = iOffset
(*WriteBuffer)(unsafe.Pointer(pNew)).FnBuf = nBuf
(*WriteBuffer)(unsafe.Pointer(pNew)).FpFile = pFile
if zBuf != 0 {
(*WriteBuffer)(unsafe.Pointer(pNew)).FzBuf = (pNew + uintptr(1)*40)
- crt.Xmemcpy(tls, (*WriteBuffer)(unsafe.Pointer(pNew)).FzBuf, zBuf, uint64(nBuf))
+ libc.Xmemcpy(tls, (*WriteBuffer)(unsafe.Pointer(pNew)).FzBuf, zBuf, uint64(nBuf))
}
if g.FpWriteList != 0 {
@@ -49304,7 +54101,7 @@ func writeListAppend(tls *crt.TLS, pFile uintptr, iOffset sqlite3_int64, zBuf ui
}
// Close a crash-file.
-func cfClose(tls *crt.TLS, pFile uintptr) int32 { /* test6.c:399:12: */
+func cfClose(tls *libc.TLS, pFile uintptr) int32 { /* test6.c:399:12: */
var pCrash uintptr = pFile
writeListSync(tls, pCrash, 0)
sqlite3.Xsqlite3OsClose(tls, (*CrashFile)(unsafe.Pointer(pCrash)).FpRealFile)
@@ -49312,7 +54109,7 @@ func cfClose(tls *crt.TLS, pFile uintptr) int32 { /* test6.c:399:12: */
}
// Read data from a crash-file.
-func cfRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test6.c:409:12: */
+func cfRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test6.c:409:12: */
var pCrash uintptr = pFile
var nCopy int32 = func() int32 {
if (i64(iAmt)) < ((*CrashFile)(unsafe.Pointer(pCrash)).FiSize - iOfst) {
@@ -49322,7 +54119,7 @@ func cfRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_
}()
if nCopy > 0 {
- crt.Xmemcpy(tls, zBuf, ((*CrashFile)(unsafe.Pointer(pCrash)).FzData + uintptr(iOfst)), uint64(nCopy))
+ libc.Xmemcpy(tls, zBuf, ((*CrashFile)(unsafe.Pointer(pCrash)).FzData + uintptr(iOfst)), uint64(nCopy))
}
// Check the file-size to see if this is a short-read
@@ -49334,7 +54131,7 @@ func cfRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_
}
// Write data to a crash-file.
-func cfWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test6.c:433:12: */
+func cfWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test6.c:433:12: */
var pCrash uintptr = pFile
if (sqlite_int64(iAmt) + iOfst) > (*CrashFile)(unsafe.Pointer(pCrash)).FiSize {
(*CrashFile)(unsafe.Pointer(pCrash)).FiSize = i64((int32(sqlite_int64(iAmt) + iOfst)))
@@ -49346,16 +54143,16 @@ func cfWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite
if !(zNew != 0) {
return 7
}
- crt.Xmemset(tls, (zNew + uintptr((*CrashFile)(unsafe.Pointer(pCrash)).FnData)), 0, (uint64(nNew - (*CrashFile)(unsafe.Pointer(pCrash)).FnData)))
+ libc.Xmemset(tls, (zNew + uintptr((*CrashFile)(unsafe.Pointer(pCrash)).FnData)), 0, (uint64(nNew - (*CrashFile)(unsafe.Pointer(pCrash)).FnData)))
(*CrashFile)(unsafe.Pointer(pCrash)).FnData = nNew
(*CrashFile)(unsafe.Pointer(pCrash)).FzData = zNew
}
- crt.Xmemcpy(tls, ((*CrashFile)(unsafe.Pointer(pCrash)).FzData + uintptr(iOfst)), zBuf, uint64(iAmt))
+ libc.Xmemcpy(tls, ((*CrashFile)(unsafe.Pointer(pCrash)).FzData + uintptr(iOfst)), zBuf, uint64(iAmt))
return writeListAppend(tls, pFile, iOfst, zBuf, iAmt)
}
// Truncate a crash-file.
-func cfTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* test6.c:461:12: */
+func cfTruncate(tls *libc.TLS, pFile uintptr, size sqlite_int64) int32 { /* test6.c:461:12: */
var pCrash uintptr = pFile
if (*CrashFile)(unsafe.Pointer(pCrash)).FiSize > size {
@@ -49365,14 +54162,14 @@ func cfTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* test6
}
// Sync a crash-file.
-func cfSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test6.c:473:12: */
+func cfSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* test6.c:473:12: */
var pCrash uintptr = pFile
var isCrash int32 = 0
var zName uintptr = (*CrashFile)(unsafe.Pointer(pCrash)).FzName
var zCrashFile uintptr = uintptr(unsafe.Pointer(&g)) + 28 /* &.zCrashFile */
- var nName int32 = int32(crt.Xstrlen(tls, zName))
- var nCrashFile int32 = int32(crt.Xstrlen(tls, zCrashFile))
+ var nName int32 = int32(libc.Xstrlen(tls, zName))
+ var nCrashFile int32 = int32(libc.Xstrlen(tls, zCrashFile))
if (nCrashFile > 0) && (int32(*(*int8)(unsafe.Pointer(zCrashFile + uintptr((nCrashFile - 1))))) == '*') {
nCrashFile--
@@ -49381,8 +54178,8 @@ func cfSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test6.c:473:12:
}
}
- if (nName == nCrashFile) && (0 == crt.Xmemcmp(tls, zName, zCrashFile, uint64(nName))) {
- if (crt.PreDecInt32(&g.FiCrash, 1)) == 0 {
+ if (nName == nCrashFile) && (0 == libc.Xmemcmp(tls, zName, zCrashFile, uint64(nName))) {
+ if (libc.PreDecInt32(&g.FiCrash, 1)) == 0 {
isCrash = 1
}
}
@@ -49391,23 +54188,23 @@ func cfSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test6.c:473:12:
}
// Return the current file-size of the crash-file.
-func cfFileSize(tls *crt.TLS, pFile uintptr, pSize uintptr) int32 { /* test6.c:505:12: */
+func cfFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* test6.c:505:12: */
var pCrash uintptr = pFile
*(*sqlite_int64)(unsafe.Pointer(pSize)) = (*CrashFile)(unsafe.Pointer(pCrash)).FiSize
return 0
}
// Calls related to file-locks are passed on to the real file handle.
-func cfLock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test6.c:514:12: */
+func cfLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test6.c:514:12: */
return sqlite3.Xsqlite3OsLock(tls, (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile, eLock)
}
-func cfUnlock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test6.c:517:12: */
+func cfUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test6.c:517:12: */
return sqlite3.Xsqlite3OsUnlock(tls, (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile, eLock)
}
-func cfCheckReservedLock(tls *crt.TLS, pFile uintptr, pResOut uintptr) int32 { /* test6.c:520:12: */
+func cfCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* test6.c:520:12: */
return sqlite3.Xsqlite3OsCheckReservedLock(tls, (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile, pResOut)
}
-func cfFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test6.c:523:12: */
+func cfFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test6.c:523:12: */
if op == 5 {
var pCrash uintptr = pFile
var nByte i64 = *(*i64)(unsafe.Pointer(pArg))
@@ -49424,24 +54221,24 @@ func cfFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32 {
// The xSectorSize() and xDeviceCharacteristics() functions return
// the global values configured by the [sqlite_crashparams] tcl
// interface.
-func cfSectorSize(tls *crt.TLS, pFile uintptr) int32 { /* test6.c:542:12: */
+func cfSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* test6.c:542:12: */
return g.FiSectorSize
}
-func cfDeviceCharacteristics(tls *crt.TLS, pFile uintptr) int32 { /* test6.c:545:12: */
+func cfDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* test6.c:545:12: */
return g.FiDeviceCharacteristics
}
// Pass-throughs for WAL support.
-func cfShmLock(tls *crt.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* test6.c:552:12: */
+func cfShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* test6.c:552:12: */
return sqlite3.Xsqlite3OsShmLock(tls, (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile, ofst, n, flags)
}
-func cfShmBarrier(tls *crt.TLS, pFile uintptr) { /* test6.c:555:13: */
+func cfShmBarrier(tls *libc.TLS, pFile uintptr) { /* test6.c:555:13: */
sqlite3.Xsqlite3OsShmBarrier(tls, (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile)
}
-func cfShmUnmap(tls *crt.TLS, pFile uintptr, delFlag int32) int32 { /* test6.c:558:12: */
+func cfShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* test6.c:558:12: */
return sqlite3.Xsqlite3OsShmUnmap(tls, (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile, delFlag)
}
-func cfShmMap(tls *crt.TLS, pFile uintptr, iRegion int32, sz int32, w int32, pp uintptr) int32 { /* test6.c:561:12: */
+func cfShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, sz int32, w int32, pp uintptr) int32 { /* test6.c:561:12: */
return sqlite3.Xsqlite3OsShmMap(tls, (*CrashFile)(unsafe.Pointer(pFile)).FpRealFile, iRegion, sz, w, pp)
}
@@ -49474,7 +54271,7 @@ type crashAppData = struct{ FpOrig uintptr }
// and allocates space for the "real" file structure using
// sqlite3_malloc(). The assumption here is (pVfs->szOsFile) is
// equal or greater than sizeof(CrashFile).
-func cfOpen(tls *crt.TLS, pCfVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test6.c:607:12: */
+func cfOpen(tls *libc.TLS, pCfVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test6.c:607:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -49483,7 +54280,7 @@ func cfOpen(tls *crt.TLS, pCfVfs uintptr, zName uintptr, pFile uintptr, flags in
var pWrapper uintptr = pFile
var pReal uintptr = (pWrapper + uintptr(1)*56)
- crt.Xmemset(tls, pWrapper, 0, uint64(unsafe.Sizeof(CrashFile{})))
+ libc.Xmemset(tls, pWrapper, 0, uint64(unsafe.Sizeof(CrashFile{})))
rc = sqlite3.Xsqlite3OsOpen(tls, pVfs, zName, pReal, flags, pOutFlags)
if rc == 0 {
@@ -49509,7 +54306,7 @@ func cfOpen(tls *crt.TLS, pCfVfs uintptr, zName uintptr, pFile uintptr, flags in
// to the xRead() method reads less than 128KB of data.
var iOff i64
- crt.Xmemset(tls, (*CrashFile)(unsafe.Pointer(pWrapper)).FzData, 0, uint64((*CrashFile)(unsafe.Pointer(pWrapper)).FnData))
+ libc.Xmemset(tls, (*CrashFile)(unsafe.Pointer(pWrapper)).FzData, 0, uint64((*CrashFile)(unsafe.Pointer(pWrapper)).FnData))
for iOff = int64(0); iOff < (*CrashFile)(unsafe.Pointer(pWrapper)).FiSize; iOff = iOff + (int64(512)) {
var nRead int32 = (int32((*CrashFile)(unsafe.Pointer(pWrapper)).FiSize - iOff))
if nRead > 512 {
@@ -49527,69 +54324,69 @@ func cfOpen(tls *crt.TLS, pCfVfs uintptr, zName uintptr, pFile uintptr, flags in
return rc
}
-func cfDelete(tls *crt.TLS, pCfVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test6.c:661:12: */
+func cfDelete(tls *libc.TLS, pCfVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test6.c:661:12: */
var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData
- return (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pVfs + 48 /* &.xDelete */))))(tls, pVfs, zPath, dirSync)
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pVfs + 48 /* &.xDelete */))))(tls, pVfs, zPath, dirSync)
}
-func cfAccess(tls *crt.TLS, pCfVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test6.c:665:12: */
+func cfAccess(tls *libc.TLS, pCfVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test6.c:665:12: */
var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 56 /* &.xAccess */))))(tls, pVfs, zPath, flags, pResOut)
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 56 /* &.xAccess */))))(tls, pVfs, zPath, flags, pResOut)
}
-func cfFullPathname(tls *crt.TLS, pCfVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* test6.c:674:12: */
+func cfFullPathname(tls *libc.TLS, pCfVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* test6.c:674:12: */
var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 64 /* &.xFullPathname */))))(tls, pVfs, zPath, nPathOut, zPathOut)
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 64 /* &.xFullPathname */))))(tls, pVfs, zPath, nPathOut, zPathOut)
}
-func cfDlOpen(tls *crt.TLS, pCfVfs uintptr, zPath uintptr) uintptr { /* test6.c:683:13: */
+func cfDlOpen(tls *libc.TLS, pCfVfs uintptr, zPath uintptr) uintptr { /* test6.c:683:13: */
var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData
- return (*(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 72 /* &.xDlOpen */))))(tls, pVfs, zPath)
+ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 72 /* &.xDlOpen */))))(tls, pVfs, zPath)
}
-func cfDlError(tls *crt.TLS, pCfVfs uintptr, nByte int32, zErrMsg uintptr) { /* test6.c:687:13: */
+func cfDlError(tls *libc.TLS, pCfVfs uintptr, nByte int32, zErrMsg uintptr) { /* test6.c:687:13: */
var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData
- (*(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pVfs + 80 /* &.xDlError */))))(tls, pVfs, nByte, zErrMsg)
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pVfs + 80 /* &.xDlError */))))(tls, pVfs, nByte, zErrMsg)
}
-func cfDlSym(tls *crt.TLS, pCfVfs uintptr, pH uintptr, zSym uintptr) uintptr { /* test6.c:691:13: */
+func cfDlSym(tls *libc.TLS, pCfVfs uintptr, pH uintptr, zSym uintptr) uintptr { /* test6.c:691:13: */
var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData
- return (*(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 88 /* &.xDlSym */))))(tls, pVfs, pH, zSym)
+ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 88 /* &.xDlSym */))))(tls, pVfs, pH, zSym)
}
-func cfDlClose(tls *crt.TLS, pCfVfs uintptr, pHandle uintptr) { /* test6.c:695:13: */
+func cfDlClose(tls *libc.TLS, pCfVfs uintptr, pHandle uintptr) { /* test6.c:695:13: */
var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData
- (*(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer((pVfs + 96 /* &.xDlClose */))))(tls, pVfs, pHandle)
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pVfs + 96 /* &.xDlClose */))))(tls, pVfs, pHandle)
}
-func cfRandomness(tls *crt.TLS, pCfVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test6.c:699:12: */
+func cfRandomness(tls *libc.TLS, pCfVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test6.c:699:12: */
var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 104 /* &.xRandomness */))))(tls, pVfs, nByte, zBufOut)
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 104 /* &.xRandomness */))))(tls, pVfs, nByte, zBufOut)
}
-func cfSleep(tls *crt.TLS, pCfVfs uintptr, nMicro int32) int32 { /* test6.c:703:12: */
+func cfSleep(tls *libc.TLS, pCfVfs uintptr, nMicro int32) int32 { /* test6.c:703:12: */
var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((pVfs + 112 /* &.xSleep */))))(tls, pVfs, nMicro)
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pVfs + 112 /* &.xSleep */))))(tls, pVfs, nMicro)
}
-func cfCurrentTime(tls *crt.TLS, pCfVfs uintptr, pTimeOut uintptr) int32 { /* test6.c:707:12: */
+func cfCurrentTime(tls *libc.TLS, pCfVfs uintptr, pTimeOut uintptr) int32 { /* test6.c:707:12: */
var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 120 /* &.xCurrentTime */))))(tls, pVfs, pTimeOut)
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 120 /* &.xCurrentTime */))))(tls, pVfs, pTimeOut)
}
-func cfGetLastError(tls *crt.TLS, pCfVfs uintptr, n int32, z uintptr) int32 { /* test6.c:711:12: */
+func cfGetLastError(tls *libc.TLS, pCfVfs uintptr, n int32, z uintptr) int32 { /* test6.c:711:12: */
var pVfs uintptr = (*sqlite3_vfs)(unsafe.Pointer(pCfVfs)).FpAppData
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 128 /* &.xGetLastError */))))(tls, pVfs, n, z)
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 128 /* &.xGetLastError */))))(tls, pVfs, n, z)
}
-func processDevSymArgs(tls *crt.TLS, interp uintptr, objc int32, objv uintptr, piDeviceChar uintptr, piSectorSize uintptr) int32 { /* test6.c:716:12: */
+func processDevSymArgs(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, piDeviceChar uintptr, piSectorSize uintptr) int32 { /* test6.c:716:12: */
bp := tls.Alloc(316)
defer tls.Free(316)
*(*[14]DeviceFlag)(unsafe.Pointer(bp + 88 /* aFlag */)) = [14]DeviceFlag{
- {FzName: ts + 23282 /* "atomic" */, FiValue: 0x00000001},
- {FzName: ts + 23289 /* "atomic512" */, FiValue: 0x00000002},
- {FzName: ts + 23299 /* "atomic1k" */, FiValue: 0x00000004},
- {FzName: ts + 23308 /* "atomic2k" */, FiValue: 0x00000008},
- {FzName: ts + 23317 /* "atomic4k" */, FiValue: 0x00000010},
- {FzName: ts + 23326 /* "atomic8k" */, FiValue: 0x00000020},
- {FzName: ts + 23335 /* "atomic16k" */, FiValue: 0x00000040},
- {FzName: ts + 23345 /* "atomic32k" */, FiValue: 0x00000080},
- {FzName: ts + 23355 /* "atomic64k" */, FiValue: 0x00000100},
- {FzName: ts + 23365 /* "sequential" */, FiValue: 0x00000400},
- {FzName: ts + 23376 /* "safe_append" */, FiValue: 0x00000200},
- {FzName: ts + 23388 /* "powersafe_overwr..." */, FiValue: 0x00001000},
- {FzName: ts + 23408 /* "batch-atomic" */, FiValue: 0x00004000},
+ {FzName: ts + 25381 /* "atomic" */, FiValue: 0x00000001},
+ {FzName: ts + 25388 /* "atomic512" */, FiValue: 0x00000002},
+ {FzName: ts + 25398 /* "atomic1k" */, FiValue: 0x00000004},
+ {FzName: ts + 25407 /* "atomic2k" */, FiValue: 0x00000008},
+ {FzName: ts + 25416 /* "atomic4k" */, FiValue: 0x00000010},
+ {FzName: ts + 25425 /* "atomic8k" */, FiValue: 0x00000020},
+ {FzName: ts + 25434 /* "atomic16k" */, FiValue: 0x00000040},
+ {FzName: ts + 25444 /* "atomic32k" */, FiValue: 0x00000080},
+ {FzName: ts + 25454 /* "atomic64k" */, FiValue: 0x00000100},
+ {FzName: ts + 25464 /* "sequential" */, FiValue: 0x00000400},
+ {FzName: ts + 25475 /* "safe_append" */, FiValue: 0x00000200},
+ {FzName: ts + 25487 /* "powersafe_overwr..." */, FiValue: 0x00001000},
+ {FzName: ts + 25507 /* "batch-atomic" */, FiValue: 0x00004000},
{FzName: uintptr(0), FiValue: 0},
}
var i int32
@@ -49603,15 +54400,15 @@ func processDevSymArgs(tls *crt.TLS, interp uintptr, objc int32, objv uintptr, p
var zOpt uintptr = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+64 /* &nOpt */)
- if (((*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) > 11) || (*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) < 2)) || (crt.Xstrncmp(tls, ts+23421 /* "-sectorsize" */, zOpt, uint64(*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)))) != 0)) &&
- (((*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) > 16) || (*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) < 2)) || (crt.Xstrncmp(tls, ts+23433 /* "-characteristics" */, zOpt, uint64(*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)))) != 0)) {
+ if (((*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) > 11) || (*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) < 2)) || (libc.Xstrncmp(tls, ts+25520 /* "-sectorsize" */, zOpt, uint64(*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)))) != 0)) &&
+ (((*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) > 16) || (*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)) < 2)) || (libc.Xstrncmp(tls, ts+25532 /* "-characteristics" */, zOpt, uint64(*(*int32)(unsafe.Pointer(bp + 64 /* nOpt */)))) != 0)) {
tcl.XTcl_AppendResult(tls, interp,
- crt.VaList(bp, ts+23450 /* "Bad option: \"" */, zOpt,
- ts+23464 /* "\" - must be \"-ch..." */, 0))
+ libc.VaList(bp, ts+25549 /* "Bad option: \"" */, zOpt,
+ ts+25563 /* "\" - must be \"-ch..." */, 0))
return 1
}
if i == (objc - 1) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+23512 /* "Option requires ..." */, zOpt, ts+9801 /* "\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25611 /* "Option requires ..." */, zOpt, ts+11456 /* "\"" */, 0))
return 1
}
@@ -49638,10 +54435,10 @@ func processDevSymArgs(tls *crt.TLS, interp uintptr, objc int32, objv uintptr, p
tcl.XTcl_UtfToLower(tls, tcl.XTcl_GetString(tls, pFlag))
rc = tcl.XTcl_GetIndexFromObjStruct(tls,
- interp, pFlag, bp+88 /* &aFlag[0] */, int32(unsafe.Sizeof(DeviceFlag{})), ts+23543 /* "no such flag" */, 0, bp+312 /* &iChoice */)
+ interp, pFlag, bp+88 /* &aFlag[0] */, int32(unsafe.Sizeof(DeviceFlag{})), ts+25642 /* "no such flag" */, 0, bp+312 /* &iChoice */)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pFlag
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -49675,7 +54472,7 @@ type DeviceFlag = struct {
//
// Simulate a crash immediately. This function does not return
// (writeListSync() calls exit(-1)).
-func crashNowCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:816:26: */
+func crashNowCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:816:26: */
if objc != 1 {
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */)
return 1
@@ -49689,7 +54486,7 @@ func crashNowCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
//
// Parameter ENABLE must be a boolean value. If true, then the "crash"
// vfs is added to the system. If false, it is removed.
-func crashEnableCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:837:26: */
+func crashEnableCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:837:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -49698,7 +54495,7 @@ func crashEnableCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
*(*int32)(unsafe.Pointer(bp + 4 /* isDefault */)) = 0
if (objc != 2) && (objc != 3) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23556 /* "ENABLE ?DEFAULT?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25655 /* "ENABLE ?DEFAULT?" */)
return 1
}
@@ -49731,7 +54528,7 @@ var crashVfs = sqlite3_vfs{FiVersion: 2, FszOsFile: // iVersion
0, FmxPathname:// szOsFile
0, FpNext:// mxPathname
uintptr(0), FzName:// pNext
-ts + 23573, /* "crash" */ FpAppData:// zName
+ts + 25672, /* "crash" */ FpAppData:// zName
uintptr(0), FxOpen:// pAppData
0, FxDelete:// xOpen
@@ -49765,7 +54562,7 @@ uintptr(0), // xCurrentTimeInt64
//
// sqlite_crashparams -sect 1024 -char {atomic sequential} ./test.db 1
//
-func crashParamsObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:916:26: */
+func crashParamsObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:916:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -49784,7 +54581,7 @@ func crashParamsObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
if !(objc < 3) {
goto __1
}
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23579 /* "?OPTIONS? DELAY ..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25678 /* "?OPTIONS? DELAY ..." */)
goto error
__1:
;
@@ -49793,7 +54590,7 @@ __1:
if !(uint64(*(*int32)(unsafe.Pointer(bp + 32 /* nCrashFile */))) >= uint64(unsafe.Sizeof([500]int8{}))) {
goto __2
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+23605 /* "Filename is too ..." */, zCrashFile, ts+9801 /* "\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+25704 /* "Filename is too ..." */, zCrashFile, ts+11456 /* "\"" */, 0))
goto error
__2:
;
@@ -49825,7 +54622,7 @@ __6:
;
g.FiCrash = *(*int32)(unsafe.Pointer(bp + 36 /* iDelay */))
- crt.Xmemcpy(tls, uintptr(unsafe.Pointer(&g))+28 /* &.zCrashFile */, zCrashFile, (uint64(*(*int32)(unsafe.Pointer(bp + 32 /* nCrashFile */)) + 1)))
+ libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&g))+28 /* &.zCrashFile */, zCrashFile, (uint64(*(*int32)(unsafe.Pointer(bp + 32 /* nCrashFile */)) + 1)))
sqlite3CrashTestEnable = 1
return 0
@@ -49833,7 +54630,7 @@ error:
return 1
}
-func devSymObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:963:26: */
+func devSymObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:963:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -49849,14 +54646,14 @@ func devSymObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
}
// tclcmd: sqlite3_crash_on_write N
-func writeCrashObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:985:26: */
+func writeCrashObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:985:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*int32)(unsafe.Pointer(bp /* nWrite */)) = 0
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23629 /* "NWRITE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25728 /* "NWRITE" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &nWrite */) != 0 {
@@ -49868,7 +54665,7 @@ func writeCrashObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
}
// tclcmd: unregister_devsim
-func dsUnregisterObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:1009:26: */
+func dsUnregisterObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:1009:26: */
if objc != 1 {
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */)
@@ -49880,21 +54677,21 @@ func dsUnregisterObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
}
// tclcmd: register_jt_vfs ?-default? PARENT-VFS
-func jtObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:1029:26: */
+func jtObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:1029:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var zParent uintptr = uintptr(0)
if (objc != 2) && (objc != 3) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+23636 /* "?-default? PAREN..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25735 /* "?-default? PAREN..." */)
return 1
}
zParent = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
if objc == 3 {
- if crt.Xstrcmp(tls, zParent, ts+23658 /* "-default" */) != 0 {
+ if libc.Xstrcmp(tls, zParent, ts+25757 /* "-default" */) != 0 {
tcl.XTcl_AppendResult(tls, interp,
- crt.VaList(bp, ts+9696 /* "bad option \"" */, zParent, ts+23667 /* "\": must be -defa..." */, 0))
+ libc.VaList(bp, ts+11355 /* "bad option \"" */, zParent, ts+25766 /* "\": must be -defa..." */, 0))
return 1
}
zParent = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
@@ -49903,8 +54700,8 @@ func jtObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv
if !(int32(*(*int8)(unsafe.Pointer(zParent))) != 0) {
zParent = uintptr(0)
}
- if jt_register(tls, zParent, (crt.Bool32(objc == 3))) != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+23687 /* "Error in jt_regi..." */, 0))
+ if jt_register(tls, zParent, (libc.Bool32(objc == 3))) != 0 {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+25786 /* "Error in jt_regi..." */, 0))
return 1
}
@@ -49912,7 +54709,7 @@ func jtObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv
}
// tclcmd: unregister_jt_vfs
-func jtUnregisterObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:1067:26: */
+func jtUnregisterObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test6.c:1067:26: */
if objc != 1 {
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */)
@@ -49924,30 +54721,30 @@ func jtUnregisterObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
}
// This procedure registers the TCL procedures defined in this file.
-func Sqlitetest6_Init(tls *crt.TLS, interp uintptr) int32 { /* test6.c:1089:5: */
- tcl.XTcl_CreateObjCommand(tls, interp, ts+23708 /* "sqlite3_crash_en..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+func Sqlitetest6_Init(tls *libc.TLS, interp uintptr) int32 { /* test6.c:1089:5: */
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+25807 /* "sqlite3_crash_en..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{crashEnableCmd})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+23729 /* "sqlite3_crashpar..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+25828 /* "sqlite3_crashpar..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{crashParamsObjCmd})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+23749 /* "sqlite3_crash_no..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+25848 /* "sqlite3_crash_no..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{crashNowCmd})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+23767 /* "sqlite3_simulate..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+25866 /* "sqlite3_simulate..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{devSymObjCmd})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+23791 /* "sqlite3_crash_on..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+25890 /* "sqlite3_crash_on..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{writeCrashObjCmd})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+23814 /* "unregister_devsi..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+25913 /* "unregister_devsi..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{dsUnregisterObjCmd})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+23832 /* "register_jt_vfs" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+25931 /* "register_jt_vfs" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{jtObjCmd})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+23848 /* "unregister_jt_vf..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+25947 /* "unregister_jt_vf..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{jtUnregisterObjCmd})), uintptr(0), uintptr(0))
return 0
}
@@ -49978,31 +54775,31 @@ type Thread1 = struct {
var threadset1 [26]Thread1 /* test7.c:90:15: */
// The main loop for a thread. Threads use busy waiting.
-func client_main(tls *crt.TLS, pArg uintptr) uintptr { /* test7.c:95:13: */
+func client_main(tls *libc.TLS, pArg uintptr) uintptr { /* test7.c:95:13: */
var p uintptr = pArg
if (*Thread1)(unsafe.Pointer(p)).Fdb != 0 {
sqlite3_client_close(tls, (*Thread1)(unsafe.Pointer(p)).Fdb)
}
sqlite3_client_open(tls, (*Thread1)(unsafe.Pointer(p)).FzFilename, (p + 40 /* &.db */))
if 0 != sqlite3.Xsqlite3_errcode(tls, (*Thread1)(unsafe.Pointer(p)).Fdb) {
- (*Thread1)(unsafe.Pointer(p)).FzErr = crt.Xstrdup(tls, sqlite3.Xsqlite3_errmsg(tls, (*Thread1)(unsafe.Pointer(p)).Fdb))
+ (*Thread1)(unsafe.Pointer(p)).FzErr = libc.Xstrdup(tls, sqlite3.Xsqlite3_errmsg(tls, (*Thread1)(unsafe.Pointer(p)).Fdb))
sqlite3_client_close(tls, (*Thread1)(unsafe.Pointer(p)).Fdb)
(*Thread1)(unsafe.Pointer(p)).Fdb = uintptr(0)
}
(*Thread1)(unsafe.Pointer(p)).FpStmt = uintptr(0)
(*Thread1)(unsafe.Pointer(p)).Fcompleted = 1
for (*Thread1)(unsafe.Pointer(p)).Fopnum <= (*Thread1)(unsafe.Pointer(p)).Fcompleted {
- crt2.Xsched_yield(tls)
+ libc2.Xsched_yield(tls)
}
for (*Thread1)(unsafe.Pointer(p)).FxOp != 0 {
if ((*Thread1)(unsafe.Pointer(p)).FzErr != 0) && ((*Thread1)(unsafe.Pointer(p)).FzErr != (*Thread1)(unsafe.Pointer(p)).FzStaticErr) {
sqlite3.Xsqlite3_free(tls, (*Thread1)(unsafe.Pointer(p)).FzErr)
(*Thread1)(unsafe.Pointer(p)).FzErr = uintptr(0)
}
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((p + 8 /* &.xOp */))))(tls, p)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((p + 8 /* &.xOp */))))(tls, p)
(*Thread1)(unsafe.Pointer(p)).Fcompleted++
for (*Thread1)(unsafe.Pointer(p)).Fopnum <= (*Thread1)(unsafe.Pointer(p)).Fcompleted {
- crt2.Xsched_yield(tls)
+ libc2.Xsched_yield(tls)
}
}
if (*Thread1)(unsafe.Pointer(p)).FpStmt != 0 {
@@ -50025,12 +54822,12 @@ func client_main(tls *crt.TLS, pArg uintptr) uintptr { /* test7.c:95:13: */
// Get a thread ID which is an upper case letter. Return the index.
// If the argument is not a valid thread ID put an error message in
// the interpreter and return -1.
-func parse_client_id(tls *crt.TLS, interp uintptr, zArg uintptr) int32 { /* test7.c:142:12: */
+func parse_client_id(tls *libc.TLS, interp uintptr, zArg uintptr) int32 { /* test7.c:142:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
- if (((zArg == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) == 0)) || (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(1)))) != 0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zArg + uintptr(0))))))*2))) & int32(_ISupper)) != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+22620 /* "thread ID must b..." */, 0))
+ if (((zArg == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) == 0)) || (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(1)))) != 0)) || !((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zArg + uintptr(0))))))*2))) & int32(_ISupper)) != 0) {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+24719 /* "thread ID must b..." */, 0))
return -1
}
return (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) - 'A')
@@ -50040,7 +54837,7 @@ func parse_client_id(tls *crt.TLS, interp uintptr, zArg uintptr) int32 { /* test
//
// NAME should be an upper case letter. Start the thread running with
// an open connection to the given database.
-func tcl_client_create(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:156:26: */
+func tcl_client_create(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:156:26: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -50050,8 +54847,8 @@ func tcl_client_create(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
var rc int32
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22659 /* " ID FILENAME" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24758 /* " ID FILENAME" */, 0))
return 1
}
i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -50059,24 +54856,24 @@ func tcl_client_create(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
return 1
}
if threadset1[i].Fbusy != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22672 /* "thread " */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+22680 /* " is already runn..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24771 /* "thread " */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+24779 /* " is already runn..." */, 0))
return 1
}
threadset1[i].Fbusy = 1
sqlite3.Xsqlite3_free(tls, threadset1[i].FzFilename)
- threadset1[i].FzFilename = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ threadset1[i].FzFilename = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
threadset1[i].Fopnum = 1
threadset1[i].Fcompleted = 0
- rc = crt2.Xpthread_create(tls, bp+88 /* &x */, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) uintptr
+ rc = libc2.Xpthread_create(tls, bp+88 /* &x */, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) uintptr
}{client_main})), (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+72, ts+22700 /* "failed to create..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, ts+24799 /* "failed to create..." */, 0))
sqlite3.Xsqlite3_free(tls, threadset1[i].FzFilename)
threadset1[i].Fbusy = 0
return 1
}
- crt2.Xpthread_detach(tls, *(*pthread_t)(unsafe.Pointer(bp + 88 /* x */)))
+ libc2.Xpthread_detach(tls, *(*pthread_t)(unsafe.Pointer(bp + 88 /* x */)))
if threadset1[i].FnServer == 0 {
threadset1[i].FnServer = 1
sqlite3_server_start2(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688 + 1680 /* &.nServer */))
@@ -50085,24 +54882,24 @@ func tcl_client_create(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
}
// Wait for a thread to reach its idle state.
-func client_wait(tls *crt.TLS, p uintptr) { /* test7.c:200:13: */
+func client_wait(tls *libc.TLS, p uintptr) { /* test7.c:200:13: */
for (*Thread1)(unsafe.Pointer(p)).Fopnum > (*Thread1)(unsafe.Pointer(p)).Fcompleted {
- crt2.Xsched_yield(tls)
+ libc2.Xsched_yield(tls)
}
}
// Usage: client_wait ID
//
// Wait on thread ID to reach its idle state.
-func tcl_client_wait(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:209:26: */
+func tcl_client_wait(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:209:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var i int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22728 /* " ID" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24827 /* " ID" */, 0))
return 1
}
i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -50110,7 +54907,7 @@ func tcl_client_wait(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset1[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
@@ -50118,7 +54915,7 @@ func tcl_client_wait(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
}
// Stop a thread.
-func stop_thread(tls *crt.TLS, p uintptr) { /* test7.c:235:13: */
+func stop_thread(tls *libc.TLS, p uintptr) { /* test7.c:235:13: */
client_wait(tls, p)
(*Thread1)(unsafe.Pointer(p)).FxOp = uintptr(0)
(*Thread1)(unsafe.Pointer(p)).Fopnum++
@@ -50134,15 +54931,15 @@ func stop_thread(tls *crt.TLS, p uintptr) { /* test7.c:235:13: */
//
// Cause a client thread to shut itself down. Wait for the shutdown to be
// completed. If ID is "*" then stop all client threads.
-func tcl_client_halt(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:253:26: */
+func tcl_client_halt(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:253:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var i int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22728 /* " ID" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24827 /* " ID" */, 0))
return 1
}
if (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)) + uintptr(0)))) == '*') && (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)) + uintptr(1)))) == 0) {
@@ -50157,7 +54954,7 @@ func tcl_client_halt(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset1[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
stop_thread(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
@@ -50174,7 +54971,7 @@ func tcl_client_halt(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
if i == 26 {
break
}
- crt2.Xsched_yield(tls)
+ libc2.Xsched_yield(tls)
}
}
return 0
@@ -50184,7 +54981,7 @@ func tcl_client_halt(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
//
// Wait on the most recent client_step to complete, then return the
// number of columns in the result set.
-func tcl_client_argc(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:301:26: */
+func tcl_client_argc(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:301:26: */
bp := tls.Alloc(172)
defer tls.Free(172)
@@ -50192,8 +54989,8 @@ func tcl_client_argc(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
// var zBuf [100]int8 at bp+72, 100
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22728 /* " ID" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24827 /* " ID" */, 0))
return 1
}
i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -50201,12 +54998,12 @@ func tcl_client_argc(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset1[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+1237 /* "%d" */, crt.VaList(bp+48, threadset1[i].Fargc))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+56, bp+72 /* &zBuf[0] */, 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+1237 /* "%d" */, libc.VaList(bp+48, threadset1[i].Fargc))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+56, bp+72 /* &zBuf[0] */, 0))
return 0
}
@@ -50214,7 +55011,7 @@ func tcl_client_argc(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
//
// Wait on the most recent client_step to complete, then return the
// value of the N-th columns in the result set.
-func tcl_client_argv(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:333:26: */
+func tcl_client_argv(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:333:26: */
bp := tls.Alloc(84)
defer tls.Free(84)
@@ -50222,8 +55019,8 @@ func tcl_client_argv(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
// var n int32 at bp+80, 4
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22747 /* " ID N" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24846 /* " ID N" */, 0))
return 1
}
i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -50231,7 +55028,7 @@ func tcl_client_argv(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset1[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), bp+80 /* &n */) != 0 {
@@ -50239,10 +55036,10 @@ func tcl_client_argv(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
}
client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
if (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) < 0) || (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) >= threadset1[i].Fargc) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, ts+22753 /* "column number ou..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+24852 /* "column number ou..." */, 0))
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+64, *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688 + 80 /* &.argv */) + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))*8)), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688 + 80 /* &.argv */) + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))*8)), 0))
return 0
}
@@ -50250,7 +55047,7 @@ func tcl_client_argv(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
//
// Wait on the most recent client_step to complete, then return the
// name of the N-th columns in the result set.
-func tcl_client_colname(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:369:26: */
+func tcl_client_colname(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:369:26: */
bp := tls.Alloc(84)
defer tls.Free(84)
@@ -50258,8 +55055,8 @@ func tcl_client_colname(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
// var n int32 at bp+80, 4
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22747 /* " ID N" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24846 /* " ID N" */, 0))
return 1
}
i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -50267,7 +55064,7 @@ func tcl_client_colname(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
return 1
}
if !(threadset1[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
if tcl.XTcl_GetInt(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), bp+80 /* &n */) != 0 {
@@ -50275,10 +55072,10 @@ func tcl_client_colname(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
}
client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
if (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) < 0) || (*(*int32)(unsafe.Pointer(bp + 80 /* n */)) >= threadset1[i].Fargc) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, ts+22753 /* "column number ou..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+24852 /* "column number ou..." */, 0))
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+64, *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688 + 880 /* &.colv */) + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))*8)), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688 + 880 /* &.colv */) + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* n */)))*8)), 0))
return 0
}
@@ -50286,7 +55083,7 @@ func tcl_client_colname(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
//
// Wait on the most recent operation to complete, then return the
// result code from that operation.
-func tcl_client_result(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:407:26: */
+func tcl_client_result(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:407:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -50294,8 +55091,8 @@ func tcl_client_result(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
var zName uintptr
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22728 /* " ID" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24827 /* " ID" */, 0))
return 1
}
i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -50303,12 +55100,12 @@ func tcl_client_result(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
return 1
}
if !(threadset1[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
zName = sqlite3.Xsqlite3ErrName(tls, threadset1[i].Frc)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, zName, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, zName, 0))
return 0
}
@@ -50316,15 +55113,15 @@ func tcl_client_result(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32
//
// Wait on the most recent operation to complete, then return the
// error string.
-func tcl_client_error(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:439:26: */
+func tcl_client_error(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:439:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
var i int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22728 /* " ID" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24827 /* " ID" */, 0))
return 1
}
i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -50332,18 +55129,18 @@ func tcl_client_error(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset1[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, threadset1[i].FzErr, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, threadset1[i].FzErr, 0))
return 0
}
// This procedure runs in the thread to compile an SQL statement.
-func do_compile1(tls *crt.TLS, p uintptr) { /* test7.c:466:13: */
+func do_compile1(tls *libc.TLS, p uintptr) { /* test7.c:466:13: */
if (*Thread1)(unsafe.Pointer(p)).Fdb == uintptr(0) {
- (*Thread1)(unsafe.Pointer(p)).FzErr = crt.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+22780 /* "no database is o..." */)
+ (*Thread1)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24879 /* "no database is o..." */)
(*Thread1)(unsafe.Pointer(p)).Frc = 1
return
}
@@ -50357,14 +55154,14 @@ func do_compile1(tls *crt.TLS, p uintptr) { /* test7.c:466:13: */
// Usage: client_compile ID SQL
//
// Compile a new virtual machine.
-func tcl_client_compile(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:484:26: */
+func tcl_client_compile(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:484:26: */
bp := tls.Alloc(56)
defer tls.Free(56)
var i int32
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22800 /* " ID SQL" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24899 /* " ID SQL" */, 0))
return 1
}
i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -50372,22 +55169,22 @@ func tcl_client_compile(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int3
return 1
}
if !(threadset1[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
- threadset1[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{do_compile1}))
+ threadset1[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{do_compile1}))
sqlite3.Xsqlite3_free(tls, threadset1[i].FzArg)
- threadset1[i].FzArg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ threadset1[i].FzArg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
threadset1[i].Fopnum++
return 0
}
// This procedure runs in the thread to step the virtual machine.
-func do_step1(tls *crt.TLS, p uintptr) { /* test7.c:513:13: */
+func do_step1(tls *libc.TLS, p uintptr) { /* test7.c:513:13: */
var i int32
if (*Thread1)(unsafe.Pointer(p)).FpStmt == uintptr(0) {
- (*Thread1)(unsafe.Pointer(p)).FzErr = crt.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+22808 /* "no virtual machi..." */)
+ (*Thread1)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24907 /* "no virtual machi..." */)
(*Thread1)(unsafe.Pointer(p)).Frc = 1
return
}
@@ -50406,14 +55203,14 @@ func do_step1(tls *crt.TLS, p uintptr) { /* test7.c:513:13: */
// Usage: client_step ID
//
// Advance the virtual machine by one step
-func tcl_client_step(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:537:26: */
+func tcl_client_step(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:537:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var i int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22837 /* " IDL" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24936 /* " IDL" */, 0))
return 1
}
i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -50421,19 +55218,19 @@ func tcl_client_step(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset1[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
- threadset1[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{do_step1}))
+ threadset1[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{do_step1}))
threadset1[i].Fopnum++
return 0
}
// This procedure runs in the thread to finalize a virtual machine.
-func do_finalize1(tls *crt.TLS, p uintptr) { /* test7.c:564:13: */
+func do_finalize1(tls *libc.TLS, p uintptr) { /* test7.c:564:13: */
if (*Thread1)(unsafe.Pointer(p)).FpStmt == uintptr(0) {
- (*Thread1)(unsafe.Pointer(p)).FzErr = crt.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+22808 /* "no virtual machi..." */)
+ (*Thread1)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24907 /* "no virtual machi..." */)
(*Thread1)(unsafe.Pointer(p)).Frc = 1
return
}
@@ -50444,14 +55241,14 @@ func do_finalize1(tls *crt.TLS, p uintptr) { /* test7.c:564:13: */
// Usage: client_finalize ID
//
// Finalize the virtual machine.
-func tcl_client_finalize(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:579:26: */
+func tcl_client_finalize(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:579:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var i int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22837 /* " IDL" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24936 /* " IDL" */, 0))
return 1
}
i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -50459,11 +55256,11 @@ func tcl_client_finalize(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
return 1
}
if !(threadset1[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
- threadset1[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{do_finalize1}))
+ threadset1[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{do_finalize1}))
sqlite3.Xsqlite3_free(tls, threadset1[i].FzArg)
threadset1[i].FzArg = uintptr(0)
threadset1[i].Fopnum++
@@ -50471,9 +55268,9 @@ func tcl_client_finalize(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int
}
// This procedure runs in the thread to reset a virtual machine.
-func do_reset(tls *crt.TLS, p uintptr) { /* test7.c:608:13: */
+func do_reset(tls *libc.TLS, p uintptr) { /* test7.c:608:13: */
if (*Thread1)(unsafe.Pointer(p)).FpStmt == uintptr(0) {
- (*Thread1)(unsafe.Pointer(p)).FzErr = crt.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+22808 /* "no virtual machi..." */)
+ (*Thread1)(unsafe.Pointer(p)).FzErr = libc.AssignPtrUintptr(p+64 /* &.zStaticErr */, ts+24907 /* "no virtual machi..." */)
(*Thread1)(unsafe.Pointer(p)).Frc = 1
return
}
@@ -50484,14 +55281,14 @@ func do_reset(tls *crt.TLS, p uintptr) { /* test7.c:608:13: */
// Usage: client_reset ID
//
// Finalize the virtual machine.
-func tcl_client_reset(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:623:26: */
+func tcl_client_reset(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:623:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
var i int32
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22837 /* " IDL" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24936 /* " IDL" */, 0))
return 1
}
i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -50499,11 +55296,11 @@ func tcl_client_reset(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset1[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
- threadset1[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{do_reset}))
+ threadset1[i].FxOp = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{do_reset}))
sqlite3.Xsqlite3_free(tls, threadset1[i].FzArg)
threadset1[i].FzArg = uintptr(0)
threadset1[i].Fopnum++
@@ -50513,7 +55310,7 @@ func tcl_client_reset(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
// Usage: client_swap ID ID
//
// Interchange the sqlite* pointer between two threads.
-func tcl_client_swap(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:654:26: */
+func tcl_client_swap(tls *libc.TLS, NotUsed uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test7.c:654:26: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -50521,8 +55318,8 @@ func tcl_client_swap(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
var j int32
var temp uintptr
if argc != 3 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+22842 /* " ID1 ID2" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+24941 /* " ID1 ID2" */, 0))
return 1
}
i = parse_client_id(tls, interp, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
@@ -50530,7 +55327,7 @@ func tcl_client_swap(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset1[i].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+24831 /* "no such thread" */, 0))
return 1
}
client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(i)*1688))
@@ -50539,7 +55336,7 @@ func tcl_client_swap(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
return 1
}
if !(threadset1[j].Fbusy != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, ts+22732 /* "no such thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+24831 /* "no such thread" */, 0))
return 1
}
client_wait(tls, (uintptr(unsafe.Pointer(&threadset1)) + uintptr(j)*1688))
@@ -50550,35 +55347,35 @@ func tcl_client_swap(tls *crt.TLS, NotUsed uintptr, interp uintptr, argc int32,
}
// Register commands with the TCL interpreter.
-func Sqlitetest7_Init(tls *crt.TLS, interp uintptr) int32 { /* test7.c:690:5: */
+func Sqlitetest7_Init(tls *libc.TLS, interp uintptr) int32 { /* test7.c:690:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd5)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd6)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateCommand(tls, interp, aCmd5[i].FzName, aCmd5[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateCommand(tls, interp, aCmd6[i].FzName, aCmd6[i].FxProc, uintptr(0), uintptr(0))
}
return 0
}
-var aCmd5 = [13]struct {
+var aCmd6 = [13]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 23866 /* "client_create" */, FxProc: 0},
- {FzName: ts + 23880 /* "client_wait" */, FxProc: 0},
- {FzName: ts + 23892 /* "client_halt" */, FxProc: 0},
- {FzName: ts + 23904 /* "client_argc" */, FxProc: 0},
- {FzName: ts + 23916 /* "client_argv" */, FxProc: 0},
- {FzName: ts + 23928 /* "client_colname" */, FxProc: 0},
- {FzName: ts + 23943 /* "client_result" */, FxProc: 0},
- {FzName: ts + 23957 /* "client_error" */, FxProc: 0},
- {FzName: ts + 23970 /* "client_compile" */, FxProc: 0},
- {FzName: ts + 23985 /* "client_step" */, FxProc: 0},
- {FzName: ts + 23997 /* "client_reset" */, FxProc: 0},
- {FzName: ts + 24010 /* "client_finalize" */, FxProc: 0},
- {FzName: ts + 24026 /* "client_swap" */, FxProc: 0},
+ {FzName: ts + 25965 /* "client_create" */, FxProc: 0},
+ {FzName: ts + 25979 /* "client_wait" */, FxProc: 0},
+ {FzName: ts + 25991 /* "client_halt" */, FxProc: 0},
+ {FzName: ts + 26003 /* "client_argc" */, FxProc: 0},
+ {FzName: ts + 26015 /* "client_argv" */, FxProc: 0},
+ {FzName: ts + 26027 /* "client_colname" */, FxProc: 0},
+ {FzName: ts + 26042 /* "client_result" */, FxProc: 0},
+ {FzName: ts + 26056 /* "client_error" */, FxProc: 0},
+ {FzName: ts + 26069 /* "client_compile" */, FxProc: 0},
+ {FzName: ts + 26084 /* "client_step" */, FxProc: 0},
+ {FzName: ts + 26096 /* "client_reset" */, FxProc: 0},
+ {FzName: ts + 26109 /* "client_finalize" */, FxProc: 0},
+ {FzName: ts + 26125 /* "client_swap" */, FxProc: 0},
} /* test7.c:694:5 */
// end block for C++
@@ -50693,7 +55490,7 @@ type echo_cursor1 = struct {
type echo_cursor = echo_cursor1 /* test8.c:28:28 */
-func simulateVtabError(tls *crt.TLS, p uintptr, zMethod uintptr) int32 { /* test8.c:97:12: */
+func simulateVtabError(tls *libc.TLS, p uintptr, zMethod uintptr) int32 { /* test8.c:97:12: */
bp := tls.Alloc(152)
defer tls.Free(152)
@@ -50701,12 +55498,12 @@ func simulateVtabError(tls *crt.TLS, p uintptr, zMethod uintptr) int32 { /* test
// var zVarname [128]int8 at bp+24, 128
*(*int8)(unsafe.Pointer(bp + 24 /* &zVarname[0] */ + uintptr(127))) = int8(0)
- sqlite3.Xsqlite3_snprintf(tls, 127, bp+24 /* &zVarname[0] */, ts+24038 /* "echo_module_fail..." */, crt.VaList(bp, zMethod, (*echo_vtab)(unsafe.Pointer(p)).FzTableName))
+ sqlite3.Xsqlite3_snprintf(tls, 127, bp+24 /* &zVarname[0] */, ts+26137 /* "echo_module_fail..." */, libc.VaList(bp, zMethod, (*echo_vtab)(unsafe.Pointer(p)).FzTableName))
zErr = tcl.XTcl_GetVar2(tls, (*echo_vtab)(unsafe.Pointer(p)).Finterp, bp+24 /* &zVarname[0] */, uintptr(0), 1)
if zErr != 0 {
- (*echo_vtab)(unsafe.Pointer(p)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+24062 /* "echo-vtab-error:..." */, crt.VaList(bp+16, zErr))
+ (*echo_vtab)(unsafe.Pointer(p)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+26161 /* "echo-vtab-error:..." */, libc.VaList(bp+16, zErr))
}
- return (crt.Bool32(zErr != uintptr(0)))
+ return (libc.Bool32(zErr != uintptr(0)))
}
// Convert an SQL-style quoted string into a normal string by removing
@@ -50720,7 +55517,7 @@ func simulateVtabError(tls *crt.TLS, p uintptr, zMethod uintptr) int32 { /* test
// 'xyz' becomes xyz
// [pqr] becomes pqr
// `mno` becomes mno
-func dequoteString(tls *crt.TLS, z uintptr) { /* test8.c:122:13: */
+func dequoteString(tls *libc.TLS, z uintptr) { /* test8.c:122:13: */
var quote int32
var i int32
var j int32
@@ -50746,14 +55543,14 @@ func dequoteString(tls *crt.TLS, z uintptr) { /* test8.c:122:13: */
for ; *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0; i++ {
if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == quote {
if int32(*(*int8)(unsafe.Pointer(z + uintptr((i + 1))))) == quote {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = int8(quote)
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = int8(quote)
i++
} else {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = int8(0)
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = int8(0)
break
}
} else {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(i)))
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(i)))
}
}
}
@@ -50766,7 +55563,7 @@ func dequoteString(tls *crt.TLS, z uintptr) { /* test8.c:122:13: */
// set to point at sqlite3_malloc()'d space containing the array of
// nCol column names. The caller is responsible for calling sqlite3_free
// on *paCol.
-func getColumnNames(tls *crt.TLS, db uintptr, zTab uintptr, paCol uintptr, pnCol uintptr) int32 { /* test8.c:159:12: */
+func getColumnNames(tls *libc.TLS, db uintptr, zTab uintptr, paCol uintptr, pnCol uintptr) int32 { /* test8.c:159:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -50788,7 +55585,7 @@ func getColumnNames(tls *crt.TLS, db uintptr, zTab uintptr, paCol uintptr, pnCol
// Prepare the statement "SELECT * FROM <tbl>". The column names
// of the result set of the compiled SELECT will be the same as
// the column names of table <tbl>.
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24082 /* "SELECT * FROM %Q" */, crt.VaList(bp, zTab))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26181 /* "SELECT * FROM %Q" */, libc.VaList(bp, zTab))
if !(!(zSql != 0)) {
goto __1
}
@@ -50820,7 +55617,7 @@ __3:
goto out
__6:
;
- nBytes = nBytes + (int32(crt.Xstrlen(tls, zName)) + 1)
+ nBytes = nBytes + (int32(libc.Xstrlen(tls, zName)) + 1)
goto __4
__4:
ii++
@@ -50846,8 +55643,8 @@ __8:
goto __10
}
*(*uintptr)(unsafe.Pointer(aCol + uintptr(ii)*8)) = zSpace
- sqlite3.Xsqlite3_snprintf(tls, nBytes, zSpace, ts /* "%s" */, crt.VaList(bp+8, sqlite3.Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), ii)))
- zSpace += (uintptr(int32(crt.Xstrlen(tls, zSpace)) + 1))
+ sqlite3.Xsqlite3_snprintf(tls, nBytes, zSpace, ts /* "%s" */, libc.VaList(bp+8, sqlite3.Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), ii)))
+ zSpace += (uintptr(int32(libc.Xstrlen(tls, zSpace)) + 1))
goto __9
__9:
ii++
@@ -50876,7 +55673,7 @@ out:
//
// See comments associated with the member variable aIndex above
// "struct echo_vtab" for details of the contents of the array.
-func getIndexArray(tls *crt.TLS, db uintptr, zTab uintptr, nCol int32, paIndex uintptr) int32 { /* test8.c:239:12: */
+func getIndexArray(tls *libc.TLS, db uintptr, zTab uintptr, nCol int32, paIndex uintptr) int32 { /* test8.c:239:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -50904,7 +55701,7 @@ __1:
;
// Compile an sqlite pragma to loop through all indices on table zTab
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24099 /* "PRAGMA index_lis..." */, crt.VaList(bp, zTab))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26198 /* "PRAGMA index_lis..." */, libc.VaList(bp, zTab))
if !(!(zSql != 0)) {
goto __2
}
@@ -50929,7 +55726,7 @@ __3:
goto __3
__5:
;
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24121 /* "PRAGMA index_inf..." */, crt.VaList(bp+8, zIdx))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26220 /* "PRAGMA index_inf..." */, libc.VaList(bp+8, zIdx))
if !(!(zSql != 0)) {
goto __6
}
@@ -50989,9 +55786,9 @@ __12:
// Global Tcl variable $echo_module is a list. This routine appends
// the string element zArg to that list in interpreter interp.
-func appendToEchoModule(tls *crt.TLS, interp uintptr, zArg uintptr) { /* test8.c:313:13: */
+func appendToEchoModule(tls *libc.TLS, interp uintptr, zArg uintptr) { /* test8.c:313:13: */
var flags int32 = ((4 | 8) | 1)
- tcl.XTcl_SetVar2(tls, interp, ts+24143 /* "echo_module" */, uintptr(0), func() uintptr {
+ tcl.XTcl_SetVar2(tls, interp, ts+26242 /* "echo_module" */, uintptr(0), func() uintptr {
if zArg != 0 {
return zArg
}
@@ -51014,7 +55811,7 @@ func appendToEchoModule(tls *crt.TLS, interp uintptr, zArg uintptr) { /* test8.c
// CREATE TABLE statement for the real table to sqlite3_declare_vtab().
// Hence, the virtual table should have exactly the same column names and
// types as the real table.
-func echoDeclareVtab(tls *crt.TLS, pVtab uintptr, db uintptr) int32 { /* test8.c:335:12: */
+func echoDeclareVtab(tls *libc.TLS, pVtab uintptr, db uintptr) int32 { /* test8.c:335:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -51023,7 +55820,7 @@ func echoDeclareVtab(tls *crt.TLS, pVtab uintptr, db uintptr) int32 { /* test8.c
if (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName != 0 {
*(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0)
rc = sqlite3.Xsqlite3_prepare(tls, db,
- ts+24155, /* "SELECT sql FROM ..." */
+ ts+26254, /* "SELECT sql FROM ..." */
-1, bp /* &pStmt */, uintptr(0))
if rc == 0 {
sqlite3.Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 1, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName, -1, uintptr(0))
@@ -51055,7 +55852,7 @@ func echoDeclareVtab(tls *crt.TLS, pVtab uintptr, db uintptr) int32 { /* test8.c
// This function frees all runtime structures associated with the virtual
// table pVtab.
-func echoDestructor(tls *crt.TLS, pVtab uintptr) int32 { /* test8.c:378:12: */
+func echoDestructor(tls *libc.TLS, pVtab uintptr) int32 { /* test8.c:378:12: */
var p uintptr = pVtab
sqlite3.Xsqlite3_free(tls, (*echo_vtab)(unsafe.Pointer(p)).FaIndex)
sqlite3.Xsqlite3_free(tls, (*echo_vtab)(unsafe.Pointer(p)).FaCol)
@@ -51073,7 +55870,7 @@ type EchoModule = EchoModule1 /* test8.c:389:27 */
// This function is called to do the work of the xConnect() method -
// to allocate the required in-memory structures for a newly connected
// virtual table.
-func echoConstructor(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test8.c:399:12: */
+func echoConstructor(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test8.c:399:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -51090,7 +55887,7 @@ func echoConstructor(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv ui
(*echo_vtab)(unsafe.Pointer(pVtab)).Fdb = db
// Allocate echo_vtab.zThis
- (*echo_vtab)(unsafe.Pointer(pVtab)).FzThis = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ (*echo_vtab)(unsafe.Pointer(pVtab)).FzThis = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
if !(int32((*echo_vtab)(unsafe.Pointer(pVtab)).FzThis) != 0) {
echoDestructor(tls, pVtab)
return 7
@@ -51098,10 +55895,10 @@ func echoConstructor(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv ui
// Allocate echo_vtab.zTableName
if argc > 3 {
- (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))
+ (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))
dequoteString(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)
if ((*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName != 0) && (int32(*(*int8)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName + uintptr(0)))) == '*') {
- var z uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+24219 /* "%s%s" */, crt.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ((*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName+uintptr(1))))
+ var z uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+26318 /* "%s%s" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), ((*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName+uintptr(1))))
sqlite3.Xsqlite3_free(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)
(*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName = z
(*echo_vtab)(unsafe.Pointer(pVtab)).FisPattern = 1
@@ -51132,12 +55929,12 @@ func echoConstructor(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv ui
}
// Echo virtual table module xCreate method.
-func echoCreate(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test8.c:464:12: */
+func echoCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test8.c:464:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
var rc int32 = 0
- appendToEchoModule(tls, (*EchoModule)(unsafe.Pointer(pAux)).Finterp, ts+24224 /* "xCreate" */)
+ appendToEchoModule(tls, (*EchoModule)(unsafe.Pointer(pAux)).Finterp, ts+26323 /* "xCreate" */)
rc = echoConstructor(tls, db, pAux, argc, argv, ppVtab, pzErr)
// If there were two arguments passed to the module at the SQL level
@@ -51152,12 +55949,12 @@ func echoCreate(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr
if (rc == 0) && (argc == 5) {
var zSql uintptr
var pVtab uintptr = *(*uintptr)(unsafe.Pointer(ppVtab))
- (*echo_vtab)(unsafe.Pointer(pVtab)).FzLogName = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8))))
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24232 /* "CREATE TABLE %Q(..." */, crt.VaList(bp+8, (*echo_vtab)(unsafe.Pointer(pVtab)).FzLogName))
+ (*echo_vtab)(unsafe.Pointer(pVtab)).FzLogName = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8))))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26331 /* "CREATE TABLE %Q(..." */, libc.VaList(bp+8, (*echo_vtab)(unsafe.Pointer(pVtab)).FzLogName))
rc = sqlite3.Xsqlite3_exec(tls, db, zSql, uintptr(0), uintptr(0), uintptr(0))
sqlite3.Xsqlite3_free(tls, zSql)
if rc != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+16, sqlite3.Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+16, sqlite3.Xsqlite3_errmsg(tls, db)))
}
}
@@ -51174,30 +55971,30 @@ func echoCreate(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr
}
// Echo virtual table module xConnect method.
-func echoConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test8.c:512:12: */
- appendToEchoModule(tls, (*EchoModule)(unsafe.Pointer(pAux)).Finterp, ts+24256 /* "xConnect" */)
+func echoConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test8.c:512:12: */
+ appendToEchoModule(tls, (*EchoModule)(unsafe.Pointer(pAux)).Finterp, ts+26355 /* "xConnect" */)
return echoConstructor(tls, db, pAux, argc, argv, ppVtab, pzErr)
}
// Echo virtual table module xDisconnect method.
-func echoDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* test8.c:526:12: */
- appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+24265 /* "xDisconnect" */)
+func echoDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* test8.c:526:12: */
+ appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+26364 /* "xDisconnect" */)
return echoDestructor(tls, pVtab)
}
// Echo virtual table module xDestroy method.
-func echoDestroy(tls *crt.TLS, pVtab uintptr) int32 { /* test8.c:534:12: */
+func echoDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* test8.c:534:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var rc int32 = 0
var p uintptr = pVtab
- appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+24277 /* "xDestroy" */)
+ appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+26376 /* "xDestroy" */)
// Drop the "log" table, if one exists (see echoCreate() for details)
if (p != 0) && ((*echo_vtab)(unsafe.Pointer(p)).FzLogName != 0) {
var zSql uintptr
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24286 /* "DROP TABLE %Q" */, crt.VaList(bp, (*echo_vtab)(unsafe.Pointer(p)).FzLogName))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+26385 /* "DROP TABLE %Q" */, libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(p)).FzLogName))
rc = sqlite3.Xsqlite3_exec(tls, (*echo_vtab)(unsafe.Pointer(p)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0))
sqlite3.Xsqlite3_free(tls, zSql)
}
@@ -51209,9 +56006,9 @@ func echoDestroy(tls *crt.TLS, pVtab uintptr) int32 { /* test8.c:534:12: */
}
// Echo virtual table module xOpen method.
-func echoOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test8.c:556:12: */
+func echoOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test8.c:556:12: */
var pCur uintptr
- if simulateVtabError(tls, pVTab, ts+24300 /* "xOpen" */) != 0 {
+ if simulateVtabError(tls, pVTab, ts+26399 /* "xOpen" */) != 0 {
return 1
}
pCur = sqlite3.Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(echo_cursor{})))
@@ -51225,7 +56022,7 @@ func echoOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test8.c:
}
// Echo virtual table module xClose method.
-func echoClose(tls *crt.TLS, cur uintptr) int32 { /* test8.c:569:12: */
+func echoClose(tls *libc.TLS, cur uintptr) int32 { /* test8.c:569:12: */
var rc int32
var pCur uintptr = cur
var pStmt uintptr = (*echo_cursor)(unsafe.Pointer(pCur)).FpStmt
@@ -51237,7 +56034,7 @@ func echoClose(tls *crt.TLS, cur uintptr) int32 { /* test8.c:569:12: */
// Return non-zero if the cursor does not currently point to a valid record
// (i.e if the scan has finished), or zero otherwise.
-func echoEof(tls *crt.TLS, cur uintptr) int32 { /* test8.c:583:12: */
+func echoEof(tls *libc.TLS, cur uintptr) int32 { /* test8.c:583:12: */
return func() int32 {
if (*echo_cursor)(unsafe.Pointer(cur)).FpStmt != 0 {
return 0
@@ -51247,11 +56044,11 @@ func echoEof(tls *crt.TLS, cur uintptr) int32 { /* test8.c:583:12: */
}
// Echo virtual table module xNext method.
-func echoNext(tls *crt.TLS, cur uintptr) int32 { /* test8.c:590:12: */
+func echoNext(tls *libc.TLS, cur uintptr) int32 { /* test8.c:590:12: */
var rc int32 = 0
var pCur uintptr = cur
- if simulateVtabError(tls, (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab, ts+24306 /* "xNext" */) != 0 {
+ if simulateVtabError(tls, (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab, ts+26405 /* "xNext" */) != 0 {
return 1
}
@@ -51269,11 +56066,11 @@ func echoNext(tls *crt.TLS, cur uintptr) int32 { /* test8.c:590:12: */
}
// Echo virtual table module xColumn method.
-func echoColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test8.c:614:12: */
+func echoColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test8.c:614:12: */
var iCol int32 = (i + 1)
var pStmt uintptr = (*echo_cursor)(unsafe.Pointer(cur)).FpStmt
- if simulateVtabError(tls, (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab, ts+24312 /* "xColumn" */) != 0 {
+ if simulateVtabError(tls, (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab, ts+26411 /* "xColumn" */) != 0 {
return 1
}
@@ -51287,10 +56084,10 @@ func echoColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test
}
// Echo virtual table module xRowid method.
-func echoRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* test8.c:634:12: */
+func echoRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* test8.c:634:12: */
var pStmt uintptr = (*echo_cursor)(unsafe.Pointer(cur)).FpStmt
- if simulateVtabError(tls, (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab, ts+24320 /* "xRowid" */) != 0 {
+ if simulateVtabError(tls, (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab, ts+2164 /* "xRowid" */) != 0 {
return 1
}
@@ -51305,17 +56102,17 @@ func echoRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* test8.c:634
// in echoBestIndex(), idxNum is set to the corresponding hash value.
// In echoFilter(), code assert()s that the supplied idxNum value is
// indeed the hash of the supplied idxStr.
-func hashString(tls *crt.TLS, zString uintptr) int32 { /* test8.c:654:12: */
- var val u321 = u321(0)
+func hashString(tls *libc.TLS, zString uintptr) int32 { /* test8.c:654:12: */
+ var val u322 = u322(0)
var ii int32
for ii = 0; *(*int8)(unsafe.Pointer(zString + uintptr(ii))) != 0; ii++ {
- val = ((val << 3) + u321(int32(*(*int8)(unsafe.Pointer(zString + uintptr(ii))))))
+ val = ((val << 3) + u322(int32(*(*int8)(unsafe.Pointer(zString + uintptr(ii))))))
}
- return (int32(val & u321(0x7fffffff)))
+ return (int32(val & u322(0x7fffffff)))
}
// Echo virtual table module xFilter method.
-func echoFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test8.c:666:12: */
+func echoFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test8.c:666:12: */
var rc int32
var i int32
@@ -51323,14 +56120,14 @@ func echoFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr,
var pVtab uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab
var db uintptr = (*echo_vtab)(unsafe.Pointer(pVtab)).Fdb
- if simulateVtabError(tls, pVtab, ts+24327 /* "xFilter" */) != 0 {
+ if simulateVtabError(tls, pVtab, ts+26419 /* "xFilter" */) != 0 {
return 1
}
// Check that idxNum matches idxStr
// Log arguments to the ::echo_module Tcl variable
- appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+24327 /* "xFilter" */)
+ appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+26419 /* "xFilter" */)
appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, idxStr)
for i = 0; i < argc; i++ {
appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
@@ -51366,7 +56163,7 @@ func echoFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr,
//
// If the third argument, doFree, is true, then sqlite3_free() is
// also called to free the buffer pointed to by zAppend.
-func string_concat(tls *crt.TLS, pzStr uintptr, zAppend uintptr, doFree int32, pRc uintptr) { /* test8.c:726:13: */
+func string_concat(tls *libc.TLS, pzStr uintptr, zAppend uintptr, doFree int32, pRc uintptr) { /* test8.c:726:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -51380,10 +56177,10 @@ func string_concat(tls *crt.TLS, pzStr uintptr, zAppend uintptr, doFree int32, p
} else {
if zIn != 0 {
var zTemp uintptr = zIn
- zIn = sqlite3.Xsqlite3_mprintf(tls, ts+24219 /* "%s%s" */, crt.VaList(bp, zIn, zAppend))
+ zIn = sqlite3.Xsqlite3_mprintf(tls, ts+26318 /* "%s%s" */, libc.VaList(bp, zIn, zAppend))
sqlite3.Xsqlite3_free(tls, zTemp)
} else {
- zIn = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+16, zAppend))
+ zIn = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+16, zAppend))
}
if !(zIn != 0) {
*(*int32)(unsafe.Pointer(pRc)) = 7
@@ -51403,13 +56200,13 @@ func string_concat(tls *crt.TLS, pzStr uintptr, zAppend uintptr, doFree int32, p
// If the current SQLite version is earlier than 3.10.0, this is just "*"
// (select all columns). Or, for version 3.10.0 and greater, the list of
// columns identified by the pIdxInfo->colUsed mask.
-func echoSelectList(tls *crt.TLS, pTab uintptr, pIdxInfo uintptr) uintptr { /* test8.c:762:13: */
+func echoSelectList(tls *libc.TLS, pTab uintptr, pIdxInfo uintptr) uintptr { /* test8.c:762:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
var zRet uintptr = uintptr(0)
if sqlite3.Xsqlite3_libversion_number(tls) < 3010000 {
- zRet = sqlite3.Xsqlite3_mprintf(tls, ts+24335 /* ", *" */, 0)
+ zRet = sqlite3.Xsqlite3_mprintf(tls, ts+26427 /* ", *" */, 0)
} else {
var i int32
for i = 0; i < (*echo_vtab)(unsafe.Pointer(pTab)).FnCol; i++ {
@@ -51419,9 +56216,9 @@ func echoSelectList(tls *crt.TLS, pTab uintptr, pIdxInfo uintptr) uintptr { /* t
}
return i
}()))) != 0 {
- zRet = sqlite3.Xsqlite3_mprintf(tls, ts+24339 /* "%z, %s" */, crt.VaList(bp, zRet, *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*8))))
+ zRet = sqlite3.Xsqlite3_mprintf(tls, ts+26431 /* "%z, %s" */, libc.VaList(bp, zRet, *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*8))))
} else {
- zRet = sqlite3.Xsqlite3_mprintf(tls, ts+24346 /* "%z, NULL" */, crt.VaList(bp+16, zRet))
+ zRet = sqlite3.Xsqlite3_mprintf(tls, ts+26438 /* "%z, NULL" */, libc.VaList(bp+16, zRet))
}
if !(zRet != 0) {
break
@@ -51451,7 +56248,7 @@ func echoSelectList(tls *crt.TLS, pTab uintptr, pIdxInfo uintptr) uintptr { /* t
//
// where the <where-clause> and <order-by-clause> are determined
// by the contents of the structure pointed to by the pIdxInfo argument.
-func echoBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test8.c:802:12: */
+func echoBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test8.c:802:12: */
bp := tls.Alloc(100)
defer tls.Free(100)
@@ -51460,7 +56257,7 @@ func echoBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test8
var zCol uintptr = uintptr(0)
var zNew uintptr
var nArg int32 = 0
- var zSep uintptr = ts + 7375 /* "WHERE" */
+ var zSep uintptr = ts + 8660 /* "WHERE" */
var pVtab uintptr = tab
*(*uintptr)(unsafe.Pointer(bp + 80 /* pStmt */)) = uintptr(0)
var interp uintptr = (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp
@@ -51471,11 +56268,11 @@ func echoBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test8
var useCost int32 = 0
var cost float64 = float64(0)
var isIgnoreUsable int32 = 0
- if tcl.XTcl_GetVar2(tls, interp, ts+24355 /* "echo_module_igno..." */, uintptr(0), 1) != 0 {
+ if tcl.XTcl_GetVar2(tls, interp, ts+26447 /* "echo_module_igno..." */, uintptr(0), 1) != 0 {
isIgnoreUsable = 1
}
- if simulateVtabError(tls, pVtab, ts+24381 /* "xBestIndex" */) != 0 {
+ if simulateVtabError(tls, pVtab, ts+26473 /* "xBestIndex" */) != 0 {
return 1
}
@@ -51483,11 +56280,11 @@ func echoBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test8
// variable nRow. The 'estimated-cost' of the scan will be the number of
// rows in the table for a linear scan, or the log (base 2) of the
// number of rows if the proposed scan uses an index.
- if tcl.XTcl_GetVar2(tls, interp, ts+24392 /* "echo_module_cost" */, uintptr(0), 1) != 0 {
- cost = crt.Xatof(tls, tcl.XTcl_GetVar2(tls, interp, ts+24392 /* "echo_module_cost" */, uintptr(0), 1))
+ if tcl.XTcl_GetVar2(tls, interp, ts+26484 /* "echo_module_cost" */, uintptr(0), 1) != 0 {
+ cost = libc.Xatof(tls, tcl.XTcl_GetVar2(tls, interp, ts+26484 /* "echo_module_cost" */, uintptr(0), 1))
useCost = 1
} else {
- *(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)) = sqlite3.Xsqlite3_mprintf(tls, ts+24409 /* "SELECT count(*) ..." */, crt.VaList(bp, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))
+ *(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)) = sqlite3.Xsqlite3_mprintf(tls, ts+26501 /* "SELECT count(*) ..." */, libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))
if !(*(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)) != 0) {
return 7
}
@@ -51508,7 +56305,7 @@ func echoBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test8
if !(zCol != 0) {
return 7
}
- *(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)) = sqlite3.Xsqlite3_mprintf(tls, ts+24433 /* "SELECT rowid%z F..." */, crt.VaList(bp+8, zCol, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))
+ *(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)) = sqlite3.Xsqlite3_mprintf(tls, ts+26525 /* "SELECT rowid%z F..." */, libc.VaList(bp+8, zCol, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))
if !(*(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)) != 0) {
return 7
}
@@ -51531,29 +56328,29 @@ func echoBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test8
if iCol >= 0 {
zNewCol = *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pVtab)).FaCol + uintptr(iCol)*8))
} else {
- zNewCol = ts + 24456 /* "rowid" */
+ zNewCol = ts + 26548 /* "rowid" */
}
var zOp uintptr = uintptr(0)
useIdx = 1
switch int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) {
case 2:
- zOp = ts + 24462 /* "=" */
+ zOp = ts + 26554 /* "=" */
break
fallthrough
case 16:
- zOp = ts + 24464 /* "<" */
+ zOp = ts + 26556 /* "<" */
break
fallthrough
case 4:
- zOp = ts + 24466 /* ">" */
+ zOp = ts + 26558 /* ">" */
break
fallthrough
case 8:
- zOp = ts + 24468 /* "<=" */
+ zOp = ts + 26560 /* "<=" */
break
fallthrough
case 32:
- zOp = ts + 24471 /* ">=" */
+ zOp = ts + 26563 /* ">=" */
break
fallthrough
case 64:
@@ -51563,31 +56360,31 @@ func echoBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test8
// of code requires the first letter of this operator to be
// in upper-case to trigger the special MATCH handling (i.e.
// wrapping the bound parameter with literal '%'s).
- zOp = ts + 24474 /* "LIKE" */
+ zOp = ts + 26566 /* "LIKE" */
break
fallthrough
case 65:
- zOp = ts + 24479 /* "like" */
+ zOp = ts + 26571 /* "like" */
break
fallthrough
case 66:
- zOp = ts + 24484 /* "glob" */
+ zOp = ts + 26576 /* "glob" */
break
fallthrough
case 67:
- zOp = ts + 4880 /* "regexp" */
+ zOp = ts + 6165 /* "regexp" */
break
}
if zOp != 0 {
if int32(*(*int8)(unsafe.Pointer(zOp + uintptr(0)))) == 'L' {
- zNew = sqlite3.Xsqlite3_mprintf(tls, ts+24489, /* " %s %s LIKE (SEL..." */
- crt.VaList(bp+24, zSep, zNewCol))
+ zNew = sqlite3.Xsqlite3_mprintf(tls, ts+26581, /* " %s %s LIKE (SEL..." */
+ libc.VaList(bp+24, zSep, zNewCol))
} else {
- zNew = sqlite3.Xsqlite3_mprintf(tls, ts+24524 /* " %s %s %s ?" */, crt.VaList(bp+40, zSep, zNewCol, zOp))
+ zNew = sqlite3.Xsqlite3_mprintf(tls, ts+26616 /* " %s %s %s ?" */, libc.VaList(bp+40, zSep, zNewCol, zOp))
}
string_concat(tls, bp+88 /* &zQuery */, zNew, 1, bp+96 /* &rc */)
- zSep = ts + 7402 /* "AND" */
- (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = crt.PreIncInt32(&nArg, 1)
+ zSep = ts + 8687 /* "AND" */
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = libc.PreIncInt32(&nArg, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).Fomit = uint8(1)
}
}
@@ -51602,20 +56399,20 @@ func echoBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test8
if iCol >= 0 {
zNewCol = *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pVtab)).FaCol + uintptr(iCol)*8))
} else {
- zNewCol = ts + 24456 /* "rowid" */
+ zNewCol = ts + 26548 /* "rowid" */
}
var zDir uintptr
if (*sqlite3_index_orderby)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy)).Fdesc != 0 {
- zDir = ts + 24536 /* "DESC" */
+ zDir = ts + 26628 /* "DESC" */
} else {
- zDir = ts + 24541 /* "ASC" */
+ zDir = ts + 26633 /* "ASC" */
}
- zNew = sqlite3.Xsqlite3_mprintf(tls, ts+24545 /* " ORDER BY %s %s" */, crt.VaList(bp+64, zNewCol, zDir))
+ zNew = sqlite3.Xsqlite3_mprintf(tls, ts+26637 /* " ORDER BY %s %s" */, libc.VaList(bp+64, zNewCol, zDir))
string_concat(tls, bp+88 /* &zQuery */, zNew, 1, bp+96 /* &rc */)
(*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 1
}
- appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+24381 /* "xBestIndex" */)
+ appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, ts+26473 /* "xBestIndex" */)
appendToEchoModule(tls, (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp, *(*uintptr)(unsafe.Pointer(bp + 88 /* zQuery */)))
@@ -51652,7 +56449,7 @@ func echoBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test8
// NULL NULL (nCol args) INSERT INTO (automatic rowid value)
// NULL INTEGER (nCol args) INSERT (incl. rowid value)
//
-func echoUpdate(tls *crt.TLS, tab uintptr, nData int32, apData uintptr, pRowid uintptr) int32 { /* test8.c:968:5: */
+func echoUpdate(tls *libc.TLS, tab uintptr, nData int32, apData uintptr, pRowid uintptr) int32 { /* test8.c:968:5: */
bp := tls.Alloc(136)
defer tls.Free(136)
@@ -51669,36 +56466,36 @@ func echoUpdate(tls *crt.TLS, tab uintptr, nData int32, apData uintptr, pRowid u
// Ticket #3083 - make sure we always start a transaction prior to
// making any changes to a virtual table
- if simulateVtabError(tls, pVtab, ts+24561 /* "xUpdate" */) != 0 {
+ if simulateVtabError(tls, pVtab, ts+26653 /* "xUpdate" */) != 0 {
return 1
}
// If apData[0] is an integer and nData>1 then do an UPDATE
if (nData > 1) && (sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apData + uintptr(0)*8))) == 1) {
- var zSep uintptr = ts + 24569 /* " SET" */
- *(*uintptr)(unsafe.Pointer(bp + 96 /* z */)) = sqlite3.Xsqlite3_mprintf(tls, ts+24574 /* "UPDATE %Q" */, crt.VaList(bp, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))
+ var zSep uintptr = ts + 26661 /* " SET" */
+ *(*uintptr)(unsafe.Pointer(bp + 96 /* z */)) = sqlite3.Xsqlite3_mprintf(tls, ts+26666 /* "UPDATE %Q" */, libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))
if !(*(*uintptr)(unsafe.Pointer(bp + 96 /* z */)) != 0) {
*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = 7
}
- bindArgOne = (crt.Bool32((*(*uintptr)(unsafe.Pointer(apData + uintptr(1)*8)) != 0) && (sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apData + uintptr(1)*8))) == 1)))
+ bindArgOne = (libc.Bool32((*(*uintptr)(unsafe.Pointer(apData + uintptr(1)*8)) != 0) && (sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apData + uintptr(1)*8))) == 1)))
bindArgZero = 1
if bindArgOne != 0 {
- string_concat(tls, bp+96 /* &z */, ts+24584 /* " SET rowid=?1 " */, 0, bp+104 /* &rc */)
- zSep = ts + 3300 /* "," */
+ string_concat(tls, bp+96 /* &z */, ts+26676 /* " SET rowid=?1 " */, 0, bp+104 /* &rc */)
+ zSep = ts + 4449 /* "," */
}
for i = 2; i < nData; i++ {
if *(*uintptr)(unsafe.Pointer(apData + uintptr(i)*8)) == uintptr(0) {
continue
}
string_concat(tls, bp+96 /* &z */, sqlite3.Xsqlite3_mprintf(tls,
- ts+24599 /* "%s %Q=?%d" */, crt.VaList(bp+8, zSep, *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pVtab)).FaCol + uintptr((i-2))*8)), i)), 1, bp+104 /* &rc */)
- zSep = ts + 3300 /* "," */
+ ts+26691 /* "%s %Q=?%d" */, libc.VaList(bp+8, zSep, *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pVtab)).FaCol + uintptr((i-2))*8)), i)), 1, bp+104 /* &rc */)
+ zSep = ts + 4449 /* "," */
}
- string_concat(tls, bp+96 /* &z */, sqlite3.Xsqlite3_mprintf(tls, ts+24609 /* " WHERE rowid=?%d" */, crt.VaList(bp+32, nData)), 1, bp+104 /* &rc */)
+ string_concat(tls, bp+96 /* &z */, sqlite3.Xsqlite3_mprintf(tls, ts+26701 /* " WHERE rowid=?%d" */, libc.VaList(bp+32, nData)), 1, bp+104 /* &rc */)
} else if (nData == 1) && (sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apData + uintptr(0)*8))) == 1) {
- *(*uintptr)(unsafe.Pointer(bp + 96 /* z */)) = sqlite3.Xsqlite3_mprintf(tls, ts+24626 /* "DELETE FROM %Q W..." */, crt.VaList(bp+40, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))
+ *(*uintptr)(unsafe.Pointer(bp + 96 /* z */)) = sqlite3.Xsqlite3_mprintf(tls, ts+26718 /* "DELETE FROM %Q W..." */, libc.VaList(bp+40, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))
if !(*(*uintptr)(unsafe.Pointer(bp + 96 /* z */)) != 0) {
*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = 7
}
@@ -51708,26 +56505,26 @@ func echoUpdate(tls *crt.TLS, tab uintptr, nData int32, apData uintptr, pRowid u
*(*uintptr)(unsafe.Pointer(bp + 112 /* zInsert */)) = uintptr(0)
*(*uintptr)(unsafe.Pointer(bp + 120 /* zValues */)) = uintptr(0)
- *(*uintptr)(unsafe.Pointer(bp + 112 /* zInsert */)) = sqlite3.Xsqlite3_mprintf(tls, ts+24658 /* "INSERT INTO %Q (" */, crt.VaList(bp+48, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))
+ *(*uintptr)(unsafe.Pointer(bp + 112 /* zInsert */)) = sqlite3.Xsqlite3_mprintf(tls, ts+26750 /* "INSERT INTO %Q (" */, libc.VaList(bp+48, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))
if !(*(*uintptr)(unsafe.Pointer(bp + 112 /* zInsert */)) != 0) {
*(*int32)(unsafe.Pointer(bp + 104 /* rc */)) = 7
}
if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apData + uintptr(1)*8))) == 1 {
bindArgOne = 1
- *(*uintptr)(unsafe.Pointer(bp + 120 /* zValues */)) = sqlite3.Xsqlite3_mprintf(tls, ts+2063 /* "?" */, 0)
- string_concat(tls, bp+112 /* &zInsert */, ts+24456 /* "rowid" */, 0, bp+104 /* &rc */)
+ *(*uintptr)(unsafe.Pointer(bp + 120 /* zValues */)) = sqlite3.Xsqlite3_mprintf(tls, ts+3219 /* "?" */, 0)
+ string_concat(tls, bp+112 /* &zInsert */, ts+26548 /* "rowid" */, 0, bp+104 /* &rc */)
}
for ii = 2; ii < nData; ii++ {
string_concat(tls, bp+112, /* &zInsert */
- sqlite3.Xsqlite3_mprintf(tls, ts+24675 /* "%s%Q" */, crt.VaList(bp+56, func() uintptr {
+ sqlite3.Xsqlite3_mprintf(tls, ts+26767 /* "%s%Q" */, libc.VaList(bp+56, func() uintptr {
if *(*uintptr)(unsafe.Pointer(bp + 120 /* zValues */)) != 0 {
return ts + 89 /* ", " */
}
return ts + 488 /* "" */
}(), *(*uintptr)(unsafe.Pointer((*echo_vtab)(unsafe.Pointer(pVtab)).FaCol + uintptr((ii-2))*8)))), 1, bp+104 /* &rc */)
string_concat(tls, bp+120, /* &zValues */
- sqlite3.Xsqlite3_mprintf(tls, ts+24680 /* "%s?%d" */, crt.VaList(bp+72, func() uintptr {
+ sqlite3.Xsqlite3_mprintf(tls, ts+26772 /* "%s?%d" */, libc.VaList(bp+72, func() uintptr {
if *(*uintptr)(unsafe.Pointer(bp + 120 /* zValues */)) != 0 {
return ts + 89 /* ", " */
}
@@ -51736,7 +56533,7 @@ func echoUpdate(tls *crt.TLS, tab uintptr, nData int32, apData uintptr, pRowid u
}
string_concat(tls, bp+96 /* &z */, *(*uintptr)(unsafe.Pointer(bp + 112 /* zInsert */)), 1, bp+104 /* &rc */)
- string_concat(tls, bp+96 /* &z */, ts+24686 /* ") VALUES(" */, 0, bp+104 /* &rc */)
+ string_concat(tls, bp+96 /* &z */, ts+26778 /* ") VALUES(" */, 0, bp+104 /* &rc */)
string_concat(tls, bp+96 /* &z */, *(*uintptr)(unsafe.Pointer(bp + 120 /* zValues */)), 1, bp+104 /* &rc */)
string_concat(tls, bp+96 /* &z */, ts+489 /* ")" */, 0, bp+104 /* &rc */)
} else {
@@ -51773,7 +56570,7 @@ func echoUpdate(tls *crt.TLS, tab uintptr, nData int32, apData uintptr, pRowid u
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = sqlite3.Xsqlite3_last_insert_rowid(tls, db)
}
if *(*int32)(unsafe.Pointer(bp + 104 /* rc */)) != 0 {
- (*sqlite3_vtab)(unsafe.Pointer(tab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+24062 /* "echo-vtab-error:..." */, crt.VaList(bp+88, sqlite3.Xsqlite3_errmsg(tls, db)))
+ (*sqlite3_vtab)(unsafe.Pointer(tab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+26161 /* "echo-vtab-error:..." */, libc.VaList(bp+88, sqlite3.Xsqlite3_errmsg(tls, db)))
}
return *(*int32)(unsafe.Pointer(bp + 104 /* rc */))
@@ -51782,13 +56579,13 @@ func echoUpdate(tls *crt.TLS, tab uintptr, nData int32, apData uintptr, pRowid u
// xBegin, xSync, xCommit and xRollback callbacks for echo module
// virtual tables. Do nothing other than add the name of the callback
// to the $::echo_module Tcl variable.
-func echoTransactionCall(tls *crt.TLS, tab uintptr, zCall uintptr) int32 { /* test8.c:1101:12: */
+func echoTransactionCall(tls *libc.TLS, tab uintptr, zCall uintptr) int32 { /* test8.c:1101:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var z uintptr
var pVtab uintptr = tab
- z = sqlite3.Xsqlite3_mprintf(tls, ts+24696 /* "echo(%s)" */, crt.VaList(bp, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))
+ z = sqlite3.Xsqlite3_mprintf(tls, ts+26788 /* "echo(%s)" */, libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName))
if z == uintptr(0) {
return 7
}
@@ -51797,7 +56594,7 @@ func echoTransactionCall(tls *crt.TLS, tab uintptr, zCall uintptr) int32 { /* te
sqlite3.Xsqlite3_free(tls, z)
return 0
}
-func echoBegin(tls *crt.TLS, tab uintptr) int32 { /* test8.c:1111:12: */
+func echoBegin(tls *libc.TLS, tab uintptr) int32 { /* test8.c:1111:12: */
var rc int32
var pVtab uintptr = tab
var interp uintptr = (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp
@@ -51806,18 +56603,18 @@ func echoBegin(tls *crt.TLS, tab uintptr) int32 { /* test8.c:1111:12: */
// Ticket #3083 - do not start a transaction if we are already in
// a transaction
- if simulateVtabError(tls, pVtab, ts+24705 /* "xBegin" */) != 0 {
+ if simulateVtabError(tls, pVtab, ts+26797 /* "xBegin" */) != 0 {
return 1
}
- rc = echoTransactionCall(tls, tab, ts+24705 /* "xBegin" */)
+ rc = echoTransactionCall(tls, tab, ts+26797 /* "xBegin" */)
if rc == 0 {
// Check if the $::echo_module_begin_fail variable is defined. If it is,
// and it is set to the name of the real table underlying this virtual
// echo module table, then cause this xSync operation to fail.
- zVal = tcl.XTcl_GetVar2(tls, interp, ts+24712 /* "echo_module_begi..." */, uintptr(0), 1)
- if (zVal != 0) && (0 == crt.Xstrcmp(tls, zVal, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) {
+ zVal = tcl.XTcl_GetVar2(tls, interp, ts+26804 /* "echo_module_begi..." */, uintptr(0), 1)
+ if (zVal != 0) && (0 == libc.Xstrcmp(tls, zVal, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) {
rc = 1
}
}
@@ -51826,7 +56623,7 @@ func echoBegin(tls *crt.TLS, tab uintptr) int32 { /* test8.c:1111:12: */
}
return rc
}
-func echoSync(tls *crt.TLS, tab uintptr) int32 { /* test8.c:1142:12: */
+func echoSync(tls *libc.TLS, tab uintptr) int32 { /* test8.c:1142:12: */
var rc int32
var pVtab uintptr = tab
var interp uintptr = (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp
@@ -51835,48 +56632,48 @@ func echoSync(tls *crt.TLS, tab uintptr) int32 { /* test8.c:1142:12: */
// Ticket #3083 - Only call xSync if we have previously started a
// transaction
- if simulateVtabError(tls, pVtab, ts+24735 /* "xSync" */) != 0 {
+ if simulateVtabError(tls, pVtab, ts+26827 /* "xSync" */) != 0 {
return 1
}
- rc = echoTransactionCall(tls, tab, ts+24735 /* "xSync" */)
+ rc = echoTransactionCall(tls, tab, ts+26827 /* "xSync" */)
if rc == 0 {
// Check if the $::echo_module_sync_fail variable is defined. If it is,
// and it is set to the name of the real table underlying this virtual
// echo module table, then cause this xSync operation to fail.
- zVal = tcl.XTcl_GetVar2(tls, interp, ts+24741 /* "echo_module_sync..." */, uintptr(0), 1)
- if (zVal != 0) && (0 == crt.Xstrcmp(tls, zVal, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) {
+ zVal = tcl.XTcl_GetVar2(tls, interp, ts+26833 /* "echo_module_sync..." */, uintptr(0), 1)
+ if (zVal != 0) && (0 == libc.Xstrcmp(tls, zVal, (*echo_vtab)(unsafe.Pointer(pVtab)).FzTableName)) {
rc = -1
}
}
return rc
}
-func echoCommit(tls *crt.TLS, tab uintptr) int32 { /* test8.c:1170:12: */
+func echoCommit(tls *libc.TLS, tab uintptr) int32 { /* test8.c:1170:12: */
var pVtab uintptr = tab
var rc int32
// Ticket #3083 - Only call xCommit if we have previously started
// a transaction
- if simulateVtabError(tls, pVtab, ts+24763 /* "xCommit" */) != 0 {
+ if simulateVtabError(tls, pVtab, ts+26855 /* "xCommit" */) != 0 {
return 1
}
sqlite3.Xsqlite3BeginBenignMalloc(tls)
- rc = echoTransactionCall(tls, tab, ts+24763 /* "xCommit" */)
+ rc = echoTransactionCall(tls, tab, ts+26855 /* "xCommit" */)
sqlite3.Xsqlite3EndBenignMalloc(tls)
(*echo_vtab)(unsafe.Pointer(pVtab)).FinTransaction = 0
return rc
}
-func echoRollback(tls *crt.TLS, tab uintptr) int32 { /* test8.c:1188:12: */
+func echoRollback(tls *libc.TLS, tab uintptr) int32 { /* test8.c:1188:12: */
var rc int32
var pVtab uintptr = tab
// Ticket #3083 - Only call xRollback if we have previously started
// a transaction
- rc = echoTransactionCall(tls, tab, ts+24771 /* "xRollback" */)
+ rc = echoTransactionCall(tls, tab, ts+26863 /* "xRollback" */)
(*echo_vtab)(unsafe.Pointer(pVtab)).FinTransaction = 0
return rc
}
@@ -51884,7 +56681,7 @@ func echoRollback(tls *crt.TLS, tab uintptr) int32 { /* test8.c:1188:12: */
// Implementation of "GLOB" function on the echo module. Pass
// all arguments to the ::echo_glob_overload procedure of TCL
// and return the result of that procedure as a string.
-func overloadedGlobFunction(tls *crt.TLS, pContext uintptr, nArg int32, apArg uintptr) { /* test8.c:1206:13: */
+func overloadedGlobFunction(tls *libc.TLS, pContext uintptr, nArg int32, apArg uintptr) { /* test8.c:1206:13: */
bp := tls.Alloc(216)
defer tls.Free(216)
@@ -51894,7 +56691,7 @@ func overloadedGlobFunction(tls *crt.TLS, pContext uintptr, nArg int32, apArg ui
var i int32
var rc int32
tcl.XTcl_DStringInit(tls, bp /* &str */)
- tcl.XTcl_DStringAppendElement(tls, bp /* &str */, ts+24781 /* "::echo_glob_over..." */)
+ tcl.XTcl_DStringAppendElement(tls, bp /* &str */, ts+26873 /* "::echo_glob_over..." */)
for i = 0; i < nArg; i++ {
tcl.XTcl_DStringAppendElement(tls, bp /* &str */, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(i)*8))))
}
@@ -51904,7 +56701,7 @@ func overloadedGlobFunction(tls *crt.TLS, pContext uintptr, nArg int32, apArg ui
sqlite3.Xsqlite3_result_error(tls, pContext, tcl.XTcl_GetStringResult(tls, interp), -1)
} else {
sqlite3.Xsqlite3_result_text(tls, pContext, tcl.XTcl_GetStringResult(tls, interp),
- -1, crt.UintptrFromInt32(-1))
+ -1, libc.UintptrFromInt32(-1))
}
tcl.XTcl_ResetResult(tls, interp)
}
@@ -51915,7 +56712,7 @@ func overloadedGlobFunction(tls *crt.TLS, pContext uintptr, nArg int32, apArg ui
// override the implementation of that function. It will choose to
// do so if the function is named "glob", and a TCL command named
// ::echo_glob_overload exists.
-func echoFindFunction(tls *crt.TLS, vtab uintptr, nArg int32, zFuncName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* test8.c:1239:12: */
+func echoFindFunction(tls *libc.TLS, vtab uintptr, nArg int32, zFuncName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* test8.c:1239:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -51923,34 +56720,34 @@ func echoFindFunction(tls *crt.TLS, vtab uintptr, nArg int32, zFuncName uintptr,
var interp uintptr = (*echo_vtab)(unsafe.Pointer(pVtab)).Finterp
// var info Tcl_CmdInfo at bp, 64
- if crt.Xstrcmp(tls, zFuncName, ts+24484 /* "glob" */) != 0 {
+ if libc.Xstrcmp(tls, zFuncName, ts+26576 /* "glob" */) != 0 {
return 0
}
- if tcl.XTcl_GetCommandInfo(tls, interp, ts+24781 /* "::echo_glob_over..." */, bp /* &info */) == 0 {
+ if tcl.XTcl_GetCommandInfo(tls, interp, ts+26873 /* "::echo_glob_over..." */, bp /* &info */) == 0 {
return 0
}
*(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{overloadedGlobFunction}))
*(*uintptr)(unsafe.Pointer(ppArg)) = interp
return 1
}
-func echoRename(tls *crt.TLS, vtab uintptr, zNewName uintptr) int32 { /* test8.c:1260:12: */
+func echoRename(tls *libc.TLS, vtab uintptr, zNewName uintptr) int32 { /* test8.c:1260:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
var rc int32 = 0
var p uintptr = vtab
- if simulateVtabError(tls, p, ts+24802 /* "xRename" */) != 0 {
+ if simulateVtabError(tls, p, ts+26894 /* "xRename" */) != 0 {
return 1
}
if (*echo_vtab)(unsafe.Pointer(p)).FisPattern != 0 {
- var nThis int32 = int32(crt.Xstrlen(tls, (*echo_vtab)(unsafe.Pointer(p)).FzThis))
- var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+24810, /* "ALTER TABLE %s R..." */
- crt.VaList(bp, (*echo_vtab)(unsafe.Pointer(p)).FzTableName, zNewName, ((*echo_vtab)(unsafe.Pointer(p)).FzTableName+uintptr(nThis))))
+ var nThis int32 = int32(libc.Xstrlen(tls, (*echo_vtab)(unsafe.Pointer(p)).FzThis))
+ var zSql uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+26902, /* "ALTER TABLE %s R..." */
+ libc.VaList(bp, (*echo_vtab)(unsafe.Pointer(p)).FzTableName, zNewName, ((*echo_vtab)(unsafe.Pointer(p)).FzTableName+uintptr(nThis))))
rc = sqlite3.Xsqlite3_exec(tls, (*echo_vtab)(unsafe.Pointer(p)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0))
sqlite3.Xsqlite3_free(tls, zSql)
}
@@ -51958,17 +56755,17 @@ func echoRename(tls *crt.TLS, vtab uintptr, zNewName uintptr) int32 { /* test8.c
return rc
}
-func echoSavepoint(tls *crt.TLS, pVTab uintptr, iSavepoint int32) int32 { /* test8.c:1280:12: */
+func echoSavepoint(tls *libc.TLS, pVTab uintptr, iSavepoint int32) int32 { /* test8.c:1280:12: */
return 0
}
-func echoRelease(tls *crt.TLS, pVTab uintptr, iSavepoint int32) int32 { /* test8.c:1285:12: */
+func echoRelease(tls *libc.TLS, pVTab uintptr, iSavepoint int32) int32 { /* test8.c:1285:12: */
return 0
}
-func echoRollbackTo(tls *crt.TLS, pVTab uintptr, iSavepoint int32) int32 { /* test8.c:1290:12: */
+func echoRollbackTo(tls *libc.TLS, pVTab uintptr, iSavepoint int32) int32 { /* test8.c:1290:12: */
return 0
}
@@ -52010,12 +56807,12 @@ var echoModuleV2 = sqlite3_module{FiVersion: 2, FxCreate: // iVersion
0, FxRelease: 0, FxRollbackTo: 0,
} /* test8.c:1322:23 */
-func moduleDestroy(tls *crt.TLS, p uintptr) { /* test8.c:1354:13: */
+func moduleDestroy(tls *libc.TLS, p uintptr) { /* test8.c:1354:13: */
sqlite3.Xsqlite3_free(tls, p)
}
// Register the echo virtual table module.
-func register_echo_module(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test8.c:1361:26: */
+func register_echo_module(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test8.c:1361:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -52035,14 +56832,14 @@ func register_echo_module(tls *crt.TLS, clientData ClientData, interp uintptr, o
pMod = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(EchoModule{})))
(*EchoModule)(unsafe.Pointer(pMod)).Finterp = interp
rc = sqlite3.Xsqlite3_create_module_v2(tls,
- *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+24840 /* "echo" */, uintptr(unsafe.Pointer(&echoModule)), pMod, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{moduleDestroy})))
+ *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+26932 /* "echo" */, uintptr(unsafe.Pointer(&echoModule)), pMod, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{moduleDestroy})))
// Virtual table module "echo_v2"
if rc == 0 {
pMod = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(EchoModule{})))
(*EchoModule)(unsafe.Pointer(pMod)).Finterp = interp
- rc = sqlite3.Xsqlite3_create_module_v2(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+24845, /* "echo_v2" */
- uintptr(unsafe.Pointer(&echoModuleV2)), pMod, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{moduleDestroy})))
+ rc = sqlite3.Xsqlite3_create_module_v2(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+26937, /* "echo_v2" */
+ uintptr(unsafe.Pointer(&echoModuleV2)), pMod, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{moduleDestroy})))
}
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0))
@@ -52052,7 +56849,7 @@ func register_echo_module(tls *crt.TLS, clientData ClientData, interp uintptr, o
// Tcl interface to sqlite3_declare_vtab, invoked as follows from Tcl:
//
// sqlite3_declare_vtab DB SQL
-func declare_vtab(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test8.c:1401:26: */
+func declare_vtab(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test8.c:1401:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -52060,7 +56857,7 @@ func declare_vtab(tls *crt.TLS, clientData ClientData, interp uintptr, objc int3
var rc int32
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+24853 /* "DB SQL" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+26945 /* "DB SQL" */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
@@ -52075,26 +56872,26 @@ func declare_vtab(tls *crt.TLS, clientData ClientData, interp uintptr, objc int3
}
// Register commands with the TCL interpreter.
-func Sqlitetest8_Init(tls *crt.TLS, interp uintptr) int32 { /* test8.c:1427:5: */
+func Sqlitetest8_Init(tls *libc.TLS, interp uintptr) int32 { /* test8.c:1427:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd1)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd2)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd1[i].FzName,
- aObjCmd1[i].FxProc, aObjCmd1[i].FclientData, uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd2[i].FzName,
+ aObjCmd2[i].FxProc, aObjCmd2[i].FclientData, uintptr(0))
}
return 0
}
-var aObjCmd1 = [2]struct {
+var aObjCmd2 = [2]struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{
- {FzName: ts + 24860 /* "register_echo_mo..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 24881 /* "sqlite3_declare_..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 26952 /* "register_echo_mo..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 26973 /* "sqlite3_declare_..." */, FxProc: 0, FclientData: uintptr(0)},
} /* test8.c:1433:5 */
// end block for C++
@@ -52143,7 +56940,7 @@ var aObjCmd1 = [2]struct {
// ISO C99 Standard: 7.21 String handling <string.h>
// c_collation_test
-func c_collation_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test9.c:29:26: */
+func c_collation_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test9.c:29:26: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -52151,7 +56948,7 @@ func c_collation_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc
// var db uintptr at bp+24, 8
var rc int32
- zErrFunction = ts + 24902 /* "N/A" */
+ zErrFunction = ts + 26994 /* "N/A" */
if !(objc != 1) {
goto __1
}
@@ -52165,17 +56962,17 @@ __1:
if !(rc != 0) {
goto __2
}
- zErrFunction = ts + 18861 /* "sqlite3_open" */
+ zErrFunction = ts + 20572 /* "sqlite3_open" */
goto error_out
__2:
;
- rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* db */)), ts+11276 /* "collate" */, 456, uintptr(0), uintptr(0))
+ rc = sqlite3.Xsqlite3_create_collation(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* db */)), ts+12916 /* "collate" */, 456, uintptr(0), uintptr(0))
if !(rc != 21) {
goto __3
}
sqlite3.Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* db */)))
- zErrFunction = ts + 24906 /* "sqlite3_create_c..." */
+ zErrFunction = ts + 26998 /* "sqlite3_create_c..." */
goto error_out
__3:
;
@@ -52185,18 +56982,18 @@ __3:
error_out:
tcl.XTcl_ResetResult(tls, interp)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+24931 /* "Error testing fu..." */, zErrFunction, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27023 /* "Error testing fu..." */, zErrFunction, 0))
return 1
}
// c_realloc_test
-func c_realloc_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test9.c:70:26: */
+func c_realloc_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test9.c:70:26: */
bp := tls.Alloc(24)
defer tls.Free(24)
var p uintptr
var zErrFunction uintptr
- zErrFunction = ts + 24902 /* "N/A" */
+ zErrFunction = ts + 26994 /* "N/A" */
if !(objc != 1) {
goto __1
@@ -52210,7 +57007,7 @@ __1:
if !(!(p != 0)) {
goto __2
}
- zErrFunction = ts + 24956 /* "sqlite3_malloc" */
+ zErrFunction = ts + 27048 /* "sqlite3_malloc" */
goto error_out
__2:
;
@@ -52221,7 +57018,7 @@ __2:
if !(p != 0) {
goto __3
}
- zErrFunction = ts + 24971 /* "sqlite3_realloc" */
+ zErrFunction = ts + 27063 /* "sqlite3_realloc" */
goto error_out
__3:
;
@@ -52230,12 +57027,12 @@ __3:
error_out:
tcl.XTcl_ResetResult(tls, interp)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+24931 /* "Error testing fu..." */, zErrFunction, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27023 /* "Error testing fu..." */, zErrFunction, 0))
return 1
}
// c_misuse_test
-func c_misuse_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test9.c:111:26: */
+func c_misuse_test(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test9.c:111:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -52245,7 +57042,7 @@ func c_misuse_test(tls *crt.TLS, clientData ClientData, interp uintptr, objc int
// var pStmt uintptr at bp+32, 8
var rc int32
- zErrFunction = ts + 24902 /* "N/A" */
+ zErrFunction = ts + 26994 /* "N/A" */
*(*uintptr)(unsafe.Pointer(bp + 24 /* db */)) = uintptr(0)
if !(objc != 1) {
@@ -52262,7 +57059,7 @@ __1:
if !(rc != 0) {
goto __2
}
- zErrFunction = ts + 18861 /* "sqlite3_open" */
+ zErrFunction = ts + 20572 /* "sqlite3_open" */
goto error_out
__2:
;
@@ -52272,7 +57069,7 @@ __2:
if !(rc != 21) {
goto __3
}
- zErrFunction = ts + 18788 /* "sqlite3_errcode" */
+ zErrFunction = ts + 20499 /* "sqlite3_errcode" */
goto error_out
__3:
;
@@ -52282,7 +57079,7 @@ __3:
if !(rc != 21) {
goto __4
}
- zErrFunction = ts + 18942 /* "sqlite3_prepare" */
+ zErrFunction = ts + 20653 /* "sqlite3_prepare" */
goto error_out
__4:
;
@@ -52293,7 +57090,7 @@ __4:
if !(rc != 21) {
goto __5
}
- zErrFunction = ts + 18976 /* "sqlite3_prepare_..." */
+ zErrFunction = ts + 20687 /* "sqlite3_prepare_..." */
goto error_out
__5:
;
@@ -52303,7 +57100,7 @@ __5:
if !(rc != 21) {
goto __6
}
- zErrFunction = ts + 18958 /* "sqlite3_prepare1..." */
+ zErrFunction = ts + 20669 /* "sqlite3_prepare1..." */
goto error_out
__6:
;
@@ -52313,7 +57110,7 @@ __6:
if !(rc != 21) {
goto __7
}
- zErrFunction = ts + 19038 /* "sqlite3_prepare1..." */
+ zErrFunction = ts + 20749 /* "sqlite3_prepare1..." */
goto error_out
__7:
;
@@ -52322,32 +57119,32 @@ __7:
error_out:
tcl.XTcl_ResetResult(tls, interp)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+24931 /* "Error testing fu..." */, zErrFunction, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27023 /* "Error testing fu..." */, zErrFunction, 0))
return 1
}
// Register commands with the TCL interpreter.
-func Sqlitetest9_Init(tls *crt.TLS, interp uintptr) int32 { /* test9.c:188:5: */
+func Sqlitetest9_Init(tls *libc.TLS, interp uintptr) int32 { /* test9.c:188:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd2)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd3)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd2[i].FzName,
- aObjCmd2[i].FxProc, aObjCmd2[i].FclientData, uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd3[i].FzName,
+ aObjCmd3[i].FxProc, aObjCmd3[i].FclientData, uintptr(0))
}
return 0
}
-var aObjCmd2 = [3]struct {
+var aObjCmd3 = [3]struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{
- {FzName: ts + 24987 /* "c_misuse_test" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 25001 /* "c_realloc_test" */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 25016 /* "c_collation_test" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 27079 /* "c_misuse_test" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 27093 /* "c_realloc_test" */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 27108 /* "c_collation_test" */, FxProc: 0, FclientData: uintptr(0)},
} /* test9.c:193:5 */
// end block for C++
@@ -52361,7 +57158,7 @@ var aObjCmd2 = [3]struct {
// This routine registers the custom TCL commands defined in this
// module. This should be the only procedure visible from outside
// of this module.
-func Sqlitetestasync_Init(tls *crt.TLS, interp uintptr) int32 { /* test_async.c:238:5: */
+func Sqlitetestasync_Init(tls *libc.TLS, interp uintptr) int32 { /* test_async.c:238:5: */
return 0
}
@@ -52381,29 +57178,29 @@ func Sqlitetestasync_Init(tls *crt.TLS, interp uintptr) int32 { /* test_async.c:
// tclcmd: sqlite3_reset_auto_extension
//
// Reset all auto-extensions
-func resetAutoExtObjCmd(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_autoext.c:196:26: */
+func resetAutoExtObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_autoext.c:196:26: */
sqlite3.Xsqlite3_reset_auto_extension(tls)
return 0
}
// This procedure registers the TCL procs defined in this file.
-func Sqlitetest_autoext_Init(tls *crt.TLS, interp uintptr) int32 { /* test_autoext.c:210:5: */
- tcl.XTcl_CreateObjCommand(tls, interp, ts+25033, /* "sqlite3_reset_au..." */
+func Sqlitetest_autoext_Init(tls *libc.TLS, interp uintptr) int32 { /* test_autoext.c:210:5: */
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+27125, /* "sqlite3_reset_au..." */
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{resetAutoExtObjCmd})), uintptr(0), uintptr(0))
return 0
}
-func backupTestCmd(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_backup.c:33:26: */
+func backupTestCmd(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_backup.c:33:26: */
bp := tls.Alloc(196)
defer tls.Free(196)
*(*[5]BackupSubCommand)(unsafe.Pointer(bp /* aSub */)) = [5]BackupSubCommand{
- {FzCmd: ts + 10895 /* "step" */, FeCmd: uint32(0) /* BACKUP_STEP */, FnArg: 1, FzArg: ts + 25062 /* "npage" */},
- {FzCmd: ts + 25068 /* "finish" */, FeCmd: uint32(1) /* BACKUP_FINISH */, FnArg: 0, FzArg: ts + 488 /* "" */},
- {FzCmd: ts + 25075 /* "remaining" */, FeCmd: uint32(2) /* BACKUP_REMAINING */, FnArg: 0, FzArg: ts + 488 /* "" */},
- {FzCmd: ts + 25085 /* "pagecount" */, FeCmd: uint32(3) /* BACKUP_PAGECOUNT */, FnArg: 0, FzArg: ts + 488 /* "" */},
+ {FzCmd: ts + 9942 /* "step" */, FeCmd: uint32(0) /* BACKUP_STEP */, FnArg: 1, FzArg: ts + 27154 /* "npage" */},
+ {FzCmd: ts + 27160 /* "finish" */, FeCmd: uint32(1) /* BACKUP_FINISH */, FnArg: 0, FzArg: ts + 488 /* "" */},
+ {FzCmd: ts + 27167 /* "remaining" */, FeCmd: uint32(2) /* BACKUP_REMAINING */, FnArg: 0, FzArg: ts + 488 /* "" */},
+ {FzCmd: ts + 27177 /* "pagecount" */, FeCmd: uint32(3) /* BACKUP_PAGECOUNT */, FnArg: 0, FzArg: ts + 488 /* "" */},
{FzCmd: uintptr(0), FeCmd: uint32(0), FnArg: 0, FzArg: uintptr(0)},
}
@@ -52413,7 +57210,7 @@ func backupTestCmd(tls *crt.TLS, clientData ClientData, interp uintptr, objc int
var rc int32
rc = tcl.XTcl_GetIndexFromObjStruct(tls,
- interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &aSub[0] */, int32(unsafe.Sizeof(BackupSubCommand{})), ts+9536 /* "option" */, 0, bp+120 /* &iCmd */)
+ interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &aSub[0] */, int32(unsafe.Sizeof(BackupSubCommand{})), ts+11195 /* "option" */, 0, bp+120 /* &iCmd */)
if rc != 0 {
return rc
}
@@ -52471,14 +57268,14 @@ type BackupSubCommand = struct {
FzArg uintptr
}
-func backupTestFinish(tls *crt.TLS, clientData ClientData) { /* test_backup.c:108:27: */
+func backupTestFinish(tls *libc.TLS, clientData ClientData) { /* test_backup.c:108:27: */
var pBackup uintptr = clientData
sqlite3.Xsqlite3_backup_finish(tls, pBackup)
}
// sqlite3_backup CMDNAME DESTHANDLE DESTNAME SRCHANDLE SRCNAME
//
-func backupTestInit(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_backup.c:117:26: */
+func backupTestInit(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_backup.c:117:26: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -52493,7 +57290,7 @@ func backupTestInit(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
if objc != 6 {
tcl.XTcl_WrongNumArgs(tls,
- interp, 1, objv, ts+25095 /* "CMDNAME DESTHAND..." */)
+ interp, 1, objv, ts+27187 /* "CMDNAME DESTHAND..." */)
return 1
}
@@ -52505,20 +57302,20 @@ func backupTestInit(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
pBackup = sqlite3.Xsqlite3_backup_init(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pDestDb */)), zDestName, *(*uintptr)(unsafe.Pointer(bp + 24 /* pSrcDb */)), zSrcName)
if !(pBackup != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+25141 /* "sqlite3_backup_i..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27233 /* "sqlite3_backup_i..." */, 0))
return 1
}
tcl.XTcl_CreateObjCommand(tls, interp, zCmd, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
- }{backupTestCmd})), pBackup, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, ClientData) }{backupTestFinish})))
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
+ }{backupTestCmd})), pBackup, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{backupTestFinish})))
tcl.XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
return 0
}
-func Sqlitetestbackup_Init(tls *crt.TLS, interp uintptr) int32 { /* test_backup.c:154:5: */
- tcl.XTcl_CreateObjCommand(tls, interp, ts+25170 /* "sqlite3_backup" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
+func Sqlitetestbackup_Init(tls *libc.TLS, interp uintptr) int32 { /* test_backup.c:154:5: */
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+27262 /* "sqlite3_backup" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
}{backupTestInit})), uintptr(0), uintptr(0))
return 0
}
@@ -52555,7 +57352,7 @@ type tcl_cursor1 = struct {
type tcl_cursor = tcl_cursor1 /* test_bestindex.c:105:27 */
// Dequote string z in place.
-func tclDequote(tls *crt.TLS, z uintptr) { /* test_bestindex.c:126:13: */
+func tclDequote(tls *libc.TLS, z uintptr) { /* test_bestindex.c:126:13: */
var q int8 = *(*int8)(unsafe.Pointer(z + uintptr(0)))
// Set stack variable q to the close-quote character
@@ -52577,10 +57374,10 @@ func tclDequote(tls *crt.TLS, z uintptr) { /* test_bestindex.c:126:13: */
// the input cursor past both and copy a single quote character
// to the output buffer.
iIn = iIn + (2)
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&iOut, 1)))) = q
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = q
}
} else {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&iIn, 1))))
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iIn, 1))))
}
}
@@ -52597,7 +57394,7 @@ func tclDequote(tls *crt.TLS, z uintptr) { /* test_bestindex.c:126:13: */
// argv[1] -> database name
// argv[2] -> table name
// argv[...] -> other module argument fields.
-func tclConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_bestindex.c:168:12: */
+func tclConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_bestindex.c:168:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -52608,16 +57405,16 @@ func tclConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr
var rc int32 = 0
if argc != 4 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+25185 /* "wrong number of ..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+27277 /* "wrong number of ..." */, 0)
return 1
}
- zCmd = sqlite3.Xsqlite3_malloc64(tls, (uint64(crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))) + uint64(1))))
+ zCmd = sqlite3.Xsqlite3_malloc64(tls, (uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))) + uint64(1))))
pTab = sqlite3.Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(tcl_vtab{})))
if (zCmd != 0) && (pTab != 0) {
- crt.Xmemcpy(tls, zCmd, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)), (crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))) + uint64(1)))
+ libc.Xmemcpy(tls, zCmd, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)), (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))) + uint64(1)))
tclDequote(tls, zCmd)
- crt.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(tcl_vtab{})))
+ libc.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(tcl_vtab{})))
(*tcl_vtab)(unsafe.Pointer(pTab)).FpCmd = tcl.XTcl_NewStringObj(tls, zCmd, -1)
(*tcl_vtab)(unsafe.Pointer(pTab)).Finterp = interp
@@ -52626,11 +57423,11 @@ func tclConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr
pScript = tcl.XTcl_DuplicateObj(tls, (*tcl_vtab)(unsafe.Pointer(pTab)).FpCmd)
(*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++
- tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+24256 /* "xConnect" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+26355 /* "xConnect" */, -1))
rc = tcl.XTcl_EvalObjEx(tls, interp, pScript, 0x020000)
if rc != 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, tcl.XTcl_GetStringResult(tls, interp)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, tcl.XTcl_GetStringResult(tls, interp)))
rc = 1
} else {
rc = sqlite3.Xsqlite3_declare_vtab(tls, db, tcl.XTcl_GetStringResult(tls, interp))
@@ -52650,11 +57447,11 @@ func tclConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr
}
// The xDisconnect and xDestroy methods are also the same
-func tclDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* test_bestindex.c:224:12: */
+func tclDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* test_bestindex.c:224:12: */
var pTab uintptr = pVtab
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*tcl_vtab)(unsafe.Pointer(pTab)).FpCmd
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -52663,19 +57460,19 @@ func tclDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* test_bestindex.c:224:
}
// Open a new tcl cursor.
-func tclOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_bestindex.c:234:12: */
+func tclOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_bestindex.c:234:12: */
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(tcl_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(tcl_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(tcl_cursor{})))
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
return 0
}
// Close a tcl cursor.
-func tclClose(tls *crt.TLS, cur uintptr) int32 { /* test_bestindex.c:246:12: */
+func tclClose(tls *libc.TLS, cur uintptr) int32 { /* test_bestindex.c:246:12: */
var pCur uintptr = cur
if pCur != 0 {
sqlite3.Xsqlite3_finalize(tls, (*tcl_cursor)(unsafe.Pointer(pCur)).FpStmt)
@@ -52684,7 +57481,7 @@ func tclClose(tls *crt.TLS, cur uintptr) int32 { /* test_bestindex.c:246:12: */
return 0
}
-func tclNext(tls *crt.TLS, pVtabCursor uintptr) int32 { /* test_bestindex.c:255:12: */
+func tclNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* test_bestindex.c:255:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -52698,14 +57495,14 @@ func tclNext(tls *crt.TLS, pVtabCursor uintptr) int32 { /* test_bestindex.c:255:
(*tcl_cursor)(unsafe.Pointer(pCsr)).FpStmt = uintptr(0)
if rc != 0 {
zErr = sqlite3.Xsqlite3_errmsg(tls, (*tcl_vtab)(unsafe.Pointer(pTab)).Fdb)
- (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, zErr))
+ (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, zErr))
}
}
}
return 0
}
-func tclFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_bestindex.c:273:12: */
+func tclFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_bestindex.c:273:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -52719,7 +57516,7 @@ func tclFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr,
pScript = tcl.XTcl_DuplicateObj(tls, (*tcl_vtab)(unsafe.Pointer(pTab)).FpCmd)
(*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++
- tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+24327 /* "xFilter" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+26419 /* "xFilter" */, -1))
tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewIntObj(tls, idxNum))
if idxStr != 0 {
tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, idxStr, -1))
@@ -52742,7 +57539,7 @@ func tclFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr,
tcl.XTcl_ListObjAppendElement(tls, interp, pScript, pArg)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pArg
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -52751,7 +57548,7 @@ func tclFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr,
if rc != 0 {
var zErr uintptr = tcl.XTcl_GetStringResult(tls, interp)
rc = 1
- (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, zErr))
+ (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, zErr))
} else {
// Analyze the scripts return value. The return value should be a tcl
// list object with an even number of elements. The first element of each
@@ -52766,7 +57563,7 @@ func tclFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr,
if rc != 0 {
var zErr uintptr = tcl.XTcl_GetStringResult(tls, interp)
rc = 1
- (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+8, zErr))
+ (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+8, zErr))
} else {
for ii = 0; (rc == 0) && (ii < *(*int32)(unsafe.Pointer(bp + 32 /* nElem */))); ii = ii + (2) {
var zCmd uintptr = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40 /* apElem */)) + uintptr(ii)*8)))
@@ -52776,11 +57573,11 @@ func tclFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr,
rc = sqlite3.Xsqlite3_prepare_v2(tls, (*tcl_vtab)(unsafe.Pointer(pTab)).Fdb, zSql, -1, (pCsr + 8 /* &.pStmt */), uintptr(0))
if rc != 0 {
var zErr uintptr = sqlite3.Xsqlite3_errmsg(tls, (*tcl_vtab)(unsafe.Pointer(pTab)).Fdb)
- (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+25211 /* "unexpected: %s" */, crt.VaList(bp+16, zErr))
+ (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+27303 /* "unexpected: %s" */, libc.VaList(bp+16, zErr))
}
} else {
rc = 1
- (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+25211 /* "unexpected: %s" */, crt.VaList(bp+24, zCmd))
+ (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+27303 /* "unexpected: %s" */, libc.VaList(bp+24, zCmd))
}
}
}
@@ -52792,24 +57589,24 @@ func tclFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr,
return rc
}
-func tclColumn(tls *crt.TLS, pVtabCursor uintptr, ctx uintptr, i int32) int32 { /* test_bestindex.c:356:12: */
+func tclColumn(tls *libc.TLS, pVtabCursor uintptr, ctx uintptr, i int32) int32 { /* test_bestindex.c:356:12: */
var pCsr uintptr = pVtabCursor
sqlite3.Xsqlite3_result_value(tls, ctx, sqlite3.Xsqlite3_column_value(tls, (*tcl_cursor)(unsafe.Pointer(pCsr)).FpStmt, (i+1)))
return 0
}
-func tclRowid(tls *crt.TLS, pVtabCursor uintptr, pRowid uintptr) int32 { /* test_bestindex.c:366:12: */
+func tclRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) int32 { /* test_bestindex.c:366:12: */
var pCsr uintptr = pVtabCursor
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = sqlite3.Xsqlite3_column_int64(tls, (*tcl_cursor)(unsafe.Pointer(pCsr)).FpStmt, 0)
return 0
}
-func tclEof(tls *crt.TLS, pVtabCursor uintptr) int32 { /* test_bestindex.c:372:12: */
+func tclEof(tls *libc.TLS, pVtabCursor uintptr) int32 { /* test_bestindex.c:372:12: */
var pCsr uintptr = pVtabCursor
- return (crt.Bool32((*tcl_cursor)(unsafe.Pointer(pCsr)).FpStmt == uintptr(0)))
+ return (libc.Bool32((*tcl_cursor)(unsafe.Pointer(pCsr)).FpStmt == uintptr(0)))
}
-func tclBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_bestindex.c:377:12: */
+func tclBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_bestindex.c:377:12: */
bp := tls.Alloc(76)
defer tls.Free(76)
@@ -52822,73 +57619,73 @@ func tclBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_b
pScript = tcl.XTcl_DuplicateObj(tls, (*tcl_vtab)(unsafe.Pointer(pTab)).FpCmd)
(*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++
- tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+24381 /* "xBestIndex" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pScript, tcl.XTcl_NewStringObj(tls, ts+26473 /* "xBestIndex" */, -1))
pArg = tcl.XTcl_NewObj(tls)
(*Tcl_Obj)(unsafe.Pointer(pArg)).FrefCount++
for ii = 0; ii < (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint; ii++ {
var pCons uintptr = ((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12)
var pElem uintptr = tcl.XTcl_NewObj(tls)
- var zOp uintptr = ts + 2063 /* "?" */
+ var zOp uintptr = ts + 3219 /* "?" */
(*Tcl_Obj)(unsafe.Pointer(pElem)).FrefCount++
switch int32((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).Fop) {
case 2:
- zOp = ts + 25226 /* "eq" */
+ zOp = ts + 27318 /* "eq" */
break
case 4:
- zOp = ts + 25229 /* "gt" */
+ zOp = ts + 27321 /* "gt" */
break
case 8:
- zOp = ts + 25232 /* "le" */
+ zOp = ts + 27324 /* "le" */
break
case 16:
- zOp = ts + 25235 /* "lt" */
+ zOp = ts + 27327 /* "lt" */
break
case 32:
- zOp = ts + 25238 /* "ge" */
+ zOp = ts + 27330 /* "ge" */
break
case 64:
- zOp = ts + 25241 /* "match" */
+ zOp = ts + 27333 /* "match" */
break
case 65:
- zOp = ts + 24479 /* "like" */
+ zOp = ts + 26571 /* "like" */
break
case 66:
- zOp = ts + 24484 /* "glob" */
+ zOp = ts + 26576 /* "glob" */
break
case 67:
- zOp = ts + 4880 /* "regexp" */
+ zOp = ts + 6165 /* "regexp" */
break
case 68:
- zOp = ts + 25247 /* "ne" */
+ zOp = ts + 27339 /* "ne" */
break
case 69:
- zOp = ts + 25250 /* "isnot" */
+ zOp = ts + 27342 /* "isnot" */
break
case 70:
- zOp = ts + 25256 /* "isnotnull" */
+ zOp = ts + 27348 /* "isnotnull" */
break
case 71:
- zOp = ts + 25266 /* "isnull" */
+ zOp = ts + 27358 /* "isnull" */
break
case 72:
- zOp = ts + 4257 /* "is" */
+ zOp = ts + 5542 /* "is" */
break
}
- tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+25273 /* "op" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27365 /* "op" */, -1))
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, zOp, -1))
- tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+25276 /* "column" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27368 /* "column" */, -1))
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewIntObj(tls, (*sqlite3_index_constraint)(unsafe.Pointer(pCons)).FiColumn))
- tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+25283 /* "usable" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27375 /* "usable" */, -1))
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewIntObj(tls, int32((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).Fusable)))
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pArg, pElem)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pElem
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -52897,7 +57694,7 @@ func tclBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_b
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pScript, pArg)
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = pArg
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -52909,15 +57706,15 @@ func tclBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_b
var pElem uintptr = tcl.XTcl_NewObj(tls)
(*Tcl_Obj)(unsafe.Pointer(pElem)).FrefCount++
- tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+25276 /* "column" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27368 /* "column" */, -1))
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewIntObj(tls, (*sqlite3_index_orderby)(unsafe.Pointer(pOrder)).FiColumn))
- tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+25290 /* "desc" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewStringObj(tls, ts+27382 /* "desc" */, -1))
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pElem, tcl.XTcl_NewIntObj(tls, int32((*sqlite3_index_orderby)(unsafe.Pointer(pOrder)).Fdesc)))
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pArg, pElem)
for ok2 := true; ok2; ok2 = 0 != 0 {
var _objPtr uintptr = pElem
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -52926,7 +57723,7 @@ func tclBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_b
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pScript, pArg)
for ok3 := true; ok3; ok3 = 0 != 0 {
var _objPtr uintptr = pArg
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -52936,14 +57733,14 @@ func tclBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_b
rc = tcl.XTcl_EvalObjEx(tls, interp, pScript, 0x020000)
for ok4 := true; ok4; ok4 = 0 != 0 {
var _objPtr uintptr = pScript
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
if rc != 0 {
var zErr uintptr = tcl.XTcl_GetStringResult(tls, interp)
rc = 1
- (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, zErr))
+ (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, zErr))
} else {
// Analyze the scripts return value. The return value should be a tcl
// list object with an even number of elements. The first element of each
@@ -52964,48 +57761,48 @@ func tclBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_b
if rc != 0 {
var zErr uintptr = tcl.XTcl_GetStringResult(tls, interp)
rc = 1
- (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+8, zErr))
+ (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+8, zErr))
} else {
var iArgv int32 = 1
for ii = 0; (rc == 0) && (ii < *(*int32)(unsafe.Pointer(bp + 48 /* nElem */))); ii = ii + (2) {
var zCmd uintptr = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* apElem */)) + uintptr(ii)*8)))
var p uintptr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56 /* apElem */)) + uintptr((ii+1))*8))
- if sqlite3.Xsqlite3_stricmp(tls, ts+25295 /* "cost" */, zCmd) == 0 {
+ if sqlite3.Xsqlite3_stricmp(tls, ts+27387 /* "cost" */, zCmd) == 0 {
rc = tcl.XTcl_GetDoubleFromObj(tls, interp, p, (pIdxInfo + 64 /* &.estimatedCost */))
- } else if sqlite3.Xsqlite3_stricmp(tls, ts+25300 /* "orderby" */, zCmd) == 0 {
+ } else if sqlite3.Xsqlite3_stricmp(tls, ts+27392 /* "orderby" */, zCmd) == 0 {
rc = tcl.XTcl_GetIntFromObj(tls, interp, p, (pIdxInfo + 60 /* &.orderByConsumed */))
- } else if sqlite3.Xsqlite3_stricmp(tls, ts+25308 /* "idxnum" */, zCmd) == 0 {
+ } else if sqlite3.Xsqlite3_stricmp(tls, ts+27400 /* "idxnum" */, zCmd) == 0 {
rc = tcl.XTcl_GetIntFromObj(tls, interp, p, (pIdxInfo + 40 /* &.idxNum */))
- } else if sqlite3.Xsqlite3_stricmp(tls, ts+25315 /* "idxstr" */, zCmd) == 0 {
+ } else if sqlite3.Xsqlite3_stricmp(tls, ts+27407 /* "idxstr" */, zCmd) == 0 {
sqlite3.Xsqlite3_free(tls, (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr)
- (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+16, tcl.XTcl_GetString(tls, p)))
+ (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+16, tcl.XTcl_GetString(tls, p)))
(*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr = 1
- } else if sqlite3.Xsqlite3_stricmp(tls, ts+25322 /* "rows" */, zCmd) == 0 {
+ } else if sqlite3.Xsqlite3_stricmp(tls, ts+27414 /* "rows" */, zCmd) == 0 {
*(*Tcl_WideInt)(unsafe.Pointer(bp + 64 /* x */)) = int64(0)
rc = tcl.XTcl_GetWideIntFromObj(tls, interp, p, bp+64 /* &x */)
(*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = sqlite3_int64(tRowcnt(*(*Tcl_WideInt)(unsafe.Pointer(bp + 64 /* x */))))
- } else if (sqlite3.Xsqlite3_stricmp(tls, ts+25327 /* "use" */, zCmd) == 0) ||
- (sqlite3.Xsqlite3_stricmp(tls, ts+25331 /* "omit" */, zCmd) == 0) {
+ } else if (sqlite3.Xsqlite3_stricmp(tls, ts+27419 /* "use" */, zCmd) == 0) ||
+ (sqlite3.Xsqlite3_stricmp(tls, ts+27423 /* "omit" */, zCmd) == 0) {
// var iCons int32 at bp+72, 4
rc = tcl.XTcl_GetIntFromObj(tls, interp, p, bp+72 /* &iCons */)
if rc == 0 {
if (*(*int32)(unsafe.Pointer(bp + 72 /* iCons */)) < 0) || (*(*int32)(unsafe.Pointer(bp + 72 /* iCons */)) >= (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) {
rc = 1
- (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+25336 /* "unexpected: %d" */, crt.VaList(bp+24, *(*int32)(unsafe.Pointer(bp + 72 /* iCons */))))
+ (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+27428 /* "unexpected: %d" */, libc.VaList(bp+24, *(*int32)(unsafe.Pointer(bp + 72 /* iCons */))))
} else {
- var bOmit int32 = (crt.Bool32((int32(*(*int8)(unsafe.Pointer(zCmd + uintptr(0)))) == 'o') || (int32(*(*int8)(unsafe.Pointer(zCmd + uintptr(0)))) == 'O')))
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(*(*int32)(unsafe.Pointer(bp + 72 /* iCons */)))*8)).FargvIndex = crt.PostIncInt32(&iArgv, 1)
+ var bOmit int32 = (libc.Bool32((int32(*(*int8)(unsafe.Pointer(zCmd + uintptr(0)))) == 'o') || (int32(*(*int8)(unsafe.Pointer(zCmd + uintptr(0)))) == 'O')))
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(*(*int32)(unsafe.Pointer(bp + 72 /* iCons */)))*8)).FargvIndex = libc.PostIncInt32(&iArgv, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(*(*int32)(unsafe.Pointer(bp + 72 /* iCons */)))*8)).Fomit = uint8(bOmit)
}
}
} else {
rc = 1
- (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+25211 /* "unexpected: %s" */, crt.VaList(bp+32, zCmd))
+ (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+27303 /* "unexpected: %s" */, libc.VaList(bp+32, zCmd))
}
if (rc != 0) && ((*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg == uintptr(0)) {
var zErr uintptr = tcl.XTcl_GetStringResult(tls, interp)
- (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+40, zErr))
+ (*tcl_vtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+40, zErr))
}
}
}
@@ -53034,7 +57831,7 @@ uintptr(0), // xRename
} /* test_bestindex.c:549:23 */
// Register the echo virtual table module.
-func register_tcl_module(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_bestindex.c:580:26: */
+func register_tcl_module(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_bestindex.c:580:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -53047,40 +57844,40 @@ func register_tcl_module(tls *crt.TLS, clientData ClientData, interp uintptr, ob
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
return 1
}
- sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+25351 /* "tcl" */, uintptr(unsafe.Pointer(&tclModule)), interp)
+ sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+27443 /* "tcl" */, uintptr(unsafe.Pointer(&tclModule)), interp)
return 0
}
// Register commands with the TCL interpreter.
-func Sqlitetesttcl_Init(tls *crt.TLS, interp uintptr) int32 { /* test_bestindex.c:604:5: */
+func Sqlitetesttcl_Init(tls *libc.TLS, interp uintptr) int32 { /* test_bestindex.c:604:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd3)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd4)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd3[i].FzName,
- aObjCmd3[i].FxProc, aObjCmd3[i].FclientData, uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd4[i].FzName,
+ aObjCmd4[i].FxProc, aObjCmd4[i].FclientData, uintptr(0))
}
return 0
}
-var aObjCmd3 = [1]struct {
+var aObjCmd4 = [1]struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{
- {FzName: ts + 25355 /* "register_tcl_mod..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 27447 /* "register_tcl_mod..." */, FxProc: 0, FclientData: uintptr(0)},
} /* test_bestindex.c:610:5 */
// Return a pointer to a buffer containing a text representation of the
// pointer passed as the only argument. The original pointer may be extracted
// from the text using sqlite3TestTextToPtr().
-func ptrToText(tls *crt.TLS, p uintptr) uintptr { /* test_blob.c:37:13: */
+func ptrToText(tls *libc.TLS, p uintptr) uintptr { /* test_blob.c:37:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
- sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof(buf)) - uint64(1))), uintptr(unsafe.Pointer(&buf)), ts+11197 /* "%p" */, crt.VaList(bp, p))
+ sqlite3.Xsqlite3_snprintf(tls, (int32(uint64(unsafe.Sizeof(buf)) - uint64(1))), uintptr(unsafe.Pointer(&buf)), ts+12843 /* "%p" */, libc.VaList(bp, p))
return uintptr(unsafe.Pointer(&buf))
}
@@ -53096,7 +57893,7 @@ var buf [100]int8 /* test_blob.c:38:15: */
// is assumed to be the name of a Tcl channel opened using the [db incrblob]
// command (see tclsqlite.c). Otherwise, it is assumed to be a pointer
// encoded using the ptrToText() routine or similar.
-func blobHandleFromObj1(tls *crt.TLS, interp uintptr, pObj uintptr, ppBlob uintptr) int32 { /* test_blob.c:55:12: */
+func blobHandleFromObj1(tls *libc.TLS, interp uintptr, pObj uintptr, ppBlob uintptr) int32 { /* test_blob.c:55:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -53106,7 +57903,7 @@ func blobHandleFromObj1(tls *crt.TLS, interp uintptr, pObj uintptr, ppBlob uintp
z = tcl.XTcl_GetStringFromObj(tls, pObj, bp /* &n */)
if *(*int32)(unsafe.Pointer(bp /* n */)) == 0 {
*(*uintptr)(unsafe.Pointer(ppBlob)) = uintptr(0)
- } else if (*(*int32)(unsafe.Pointer(bp /* n */)) > 9) && (0 == crt.Xmemcmp(tls, ts+25375 /* "incrblob_" */, z, uint64(9))) {
+ } else if (*(*int32)(unsafe.Pointer(bp /* n */)) > 9) && (0 == libc.Xmemcmp(tls, ts+27467 /* "incrblob_" */, z, uint64(9))) {
// var notUsed int32 at bp+4, 4
var channel Tcl_Channel
@@ -53131,7 +57928,7 @@ func blobHandleFromObj1(tls *crt.TLS, interp uintptr, pObj uintptr, ppBlob uintp
// Like Tcl_GetString(), except that if the string is 0 bytes in size, a
// NULL Pointer is returned.
-func blobStringFromObj(tls *crt.TLS, pObj uintptr) uintptr { /* test_blob.c:90:13: */
+func blobStringFromObj(tls *libc.TLS, pObj uintptr) uintptr { /* test_blob.c:90:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -53150,7 +57947,7 @@ func blobStringFromObj(tls *crt.TLS, pObj uintptr) uintptr { /* test_blob.c:90:1
// sqlite3_blob_open DB DATABASE TABLE COLUMN ROWID FLAGS VARNAME
//
// Tcl test harness for the sqlite3_blob_open() function.
-func test_blob_open(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_blob.c:102:26: */
+func test_blob_open(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_blob.c:102:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -53170,7 +57967,7 @@ func test_blob_open(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
var rc int32
if objc != 8 {
- var zUsage uintptr = ts + 25385 /* "DB DATABASE TABL..." */
+ var zUsage uintptr = ts + 27477 /* "DB DATABASE TABL..." */
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, zUsage)
return 1
}
@@ -53205,7 +58002,7 @@ func test_blob_open(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
}
// sqlite3_blob_close HANDLE
-func test_blob_close(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_blob.c:153:26: */
+func test_blob_close(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_blob.c:153:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -53214,7 +58011,7 @@ func test_blob_close(tls *crt.TLS, clientData ClientData, interp uintptr, objc i
var rc int32
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25430 /* "HANDLE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */)
return 1
}
@@ -53232,7 +58029,7 @@ func test_blob_close(tls *crt.TLS, clientData ClientData, interp uintptr, objc i
}
// sqlite3_blob_bytes HANDLE
-func test_blob_bytes(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_blob.c:181:26: */
+func test_blob_bytes(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_blob.c:181:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -53241,7 +58038,7 @@ func test_blob_bytes(tls *crt.TLS, clientData ClientData, interp uintptr, objc i
var nByte int32
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25430 /* "HANDLE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */)
return 1
}
@@ -53267,7 +58064,7 @@ func test_blob_bytes(tls *crt.TLS, clientData ClientData, interp uintptr, objc i
// returned. On failure, the interpreter result is set to the
// text representation of the returned error code (i.e. "SQLITE_NOMEM")
// and a Tcl exception is thrown.
-func test_blob_read(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_blob.c:217:26: */
+func test_blob_read(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_blob.c:217:26: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -53281,7 +58078,7 @@ func test_blob_read(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
var rc int32
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25437 /* "CHANNEL OFFSET N" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27529 /* "CHANNEL OFFSET N" */)
return 1
}
@@ -53296,7 +58093,7 @@ func test_blob_read(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
if *(*int32)(unsafe.Pointer(bp + 28 /* nByte */)) > 0 {
zBuf = tcl.XTcl_AttemptAlloc(tls, uint32(*(*int32)(unsafe.Pointer(bp + 28 /* nByte */))))
if zBuf == uintptr(0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+25454 /* "out of memory in..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+27546 /* "out of memory in..." */, 0))
return 1
}
}
@@ -53328,7 +58125,7 @@ func test_blob_read(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
// On success, an empty string is returned. On failure, the interpreter
// result is set to the text representation of the returned error code
// (i.e. "SQLITE_NOMEM") and a Tcl exception is thrown.
-func test_blob_write(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_blob.c:273:26: */
+func test_blob_write(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_blob.c:273:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -53341,7 +58138,7 @@ func test_blob_write(tls *crt.TLS, clientData ClientData, interp uintptr, objc i
// var nBuf int32 at bp+12, 4
if (objc != 4) && (objc != 5) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25515 /* "HANDLE OFFSET DA..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27607 /* "HANDLE OFFSET DA..." */)
return 1
}
@@ -53370,26 +58167,26 @@ func test_blob_write(tls *crt.TLS, clientData ClientData, interp uintptr, objc i
}
// Register commands with the TCL interpreter.
-func Sqlitetest_blob_Init(tls *crt.TLS, interp uintptr) int32 { /* test_blob.c:312:5: */
+func Sqlitetest_blob_Init(tls *libc.TLS, interp uintptr) int32 { /* test_blob.c:312:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd4)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd5)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd4[i].FzName, aObjCmd4[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd5[i].FzName, aObjCmd5[i].FxProc, uintptr(0), uintptr(0))
}
return 0
}
-var aObjCmd4 = [5]struct {
+var aObjCmd5 = [5]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 25542 /* "sqlite3_blob_ope..." */, FxProc: 0},
- {FzName: ts + 25560 /* "sqlite3_blob_clo..." */, FxProc: 0},
- {FzName: ts + 25579 /* "sqlite3_blob_byt..." */, FxProc: 0},
- {FzName: ts + 25598 /* "sqlite3_blob_rea..." */, FxProc: 0},
- {FzName: ts + 25616 /* "sqlite3_blob_wri..." */, FxProc: 0},
+ {FzName: ts + 27634 /* "sqlite3_blob_ope..." */, FxProc: 0},
+ {FzName: ts + 27652 /* "sqlite3_blob_clo..." */, FxProc: 0},
+ {FzName: ts + 27671 /* "sqlite3_blob_byt..." */, FxProc: 0},
+ {FzName: ts + 27690 /* "sqlite3_blob_rea..." */, FxProc: 0},
+ {FzName: ts + 27708 /* "sqlite3_blob_wri..." */, FxProc: 0},
} /* test_blob.c:317:5 */
// end block for C++
@@ -53404,7 +58201,7 @@ var aObjCmd4 = [5]struct {
//
// Return a list of file that are shared and the number of
// references to each file.
-func sqlite3BtreeSharedCacheReport(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_btree.c:29:19: */
+func sqlite3BtreeSharedCacheReport(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_btree.c:29:19: */
var pBt uintptr
var pRet uintptr = tcl.XTcl_NewObj(tls)
for pBt = sqlite3.Xsqlite3SharedCacheList; pBt != 0; pBt = (*BtShared)(unsafe.Pointer(pBt)).FpNext {
@@ -53417,7 +58214,7 @@ func sqlite3BtreeSharedCacheReport(tls *crt.TLS, clientData uintptr, interp uint
}
// Print debugging information about all cursors to standard output.
-func sqlite3BtreeCursorList(tls *crt.TLS, p uintptr) { /* test_btree.c:52:6: */
+func sqlite3BtreeCursorList(tls *libc.TLS, p uintptr) { /* test_btree.c:52:6: */
}
// end block for C++
@@ -53471,358 +58268,358 @@ func sqlite3BtreeCursorList(tls *crt.TLS, p uintptr) { /* test_btree.c:52:6: */
// This routine sets entries in the global ::sqlite_options() array variable
// according to the compile-time configuration of the database. Test
// procedures use this to determine when tests should be omitted.
-func set_options(tls *crt.TLS, interp uintptr) { /* test_config.c:47:13: */
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25650 /* "malloc_usable_si..." */, ts+12045, /* "0" */
+func set_options(tls *libc.TLS, interp uintptr) { /* test_config.c:47:13: */
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27742 /* "malloc_usable_si..." */, ts+27761, /* "1" */
1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25669 /* "rowid32" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27763 /* "rowid32" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25677 /* "casesensitivelik..." */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27771 /* "casesensitivelik..." */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25695 /* "curdir" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27789 /* "curdir" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25704 /* "win32malloc" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27796 /* "win32malloc" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25716 /* "debug" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27808 /* "debug" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25722 /* "default_ckptfull..." */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27814 /* "default_ckptfull..." */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25744 /* "direct_read" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27836 /* "direct_read" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25756 /* "dirsync" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27848 /* "dirsync" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25764 /* "lfs" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27856 /* "lfs" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25768 /* "pagecache_overfl..." */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27860 /* "pagecache_overfl..." */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25793 /* "mmap" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27885 /* "mmap" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25798, /* "worker_threads" */
- ts+25813 /* "8" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27890, /* "worker_threads" */
+ ts+27905 /* "8" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25815 /* "memdebug" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27907 /* "memdebug" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25824 /* "8_3_names" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27916 /* "8_3_names" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25834 /* "cursorhints" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27926 /* "cursorhints" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25846 /* "hiddencolumns" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27938 /* "hiddencolumns" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+11334 /* "deserialize" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+12974 /* "deserialize" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25860 /* "mem3" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27952 /* "mem3" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25865 /* "mem5" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27957 /* "mem5" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25870 /* "offset_sql_func" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27962 /* "offset_sql_func" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+11442 /* "preupdate" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+13082 /* "preupdate" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25886 /* "snapshot" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27978 /* "snapshot" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25895 /* "mutex" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27987 /* "mutex" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25901 /* "mutex_noop" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+27993 /* "mutex_noop" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25912 /* "altertable" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28004 /* "altertable" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+1817 /* "analyze" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+1817 /* "analyze" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25923 /* "api_armor" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28015 /* "api_armor" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25933 /* "atomicwrite" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28025 /* "atomicwrite" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25945 /* "json1" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28037 /* "json1" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25951 /* "has_codec" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28043 /* "has_codec" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25961 /* "like_match_blobs" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28053 /* "like_match_blobs" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25978 /* "attach" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28070 /* "attach" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25985 /* "auth" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28077 /* "auth" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25990 /* "autoinc" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28082 /* "autoinc" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+10905 /* "autoindex" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+12555 /* "autoindex" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+25998 /* "autoreset" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28090 /* "autoreset" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26008 /* "autovacuum" */, ts+25702 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26019, /* "default_autovacu..." */
- ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28100 /* "autovacuum" */, ts+27761 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28111, /* "default_autovacu..." */
+ ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26038 /* "between_opt" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28130 /* "between_opt" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26050 /* "builtin_test" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28142 /* "builtin_test" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26063 /* "bloblit" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28155 /* "bloblit" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26071 /* "cast" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28163 /* "cast" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26076 /* "check" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28168 /* "check" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26082 /* "cte" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28174 /* "cte" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26086 /* "columnmetadata" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28178 /* "columnmetadata" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26101 /* "oversize_cell_ch..." */, ts+12045, /* "0" */
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28193 /* "oversize_cell_ch..." */, ts+13695, /* "0" */
1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26121 /* "compileoption_di..." */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28213 /* "compileoption_di..." */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+11313 /* "complete" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+12953 /* "complete" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26141 /* "compound" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28233 /* "compound" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26150 /* "conflict" */, ts+25702 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26159 /* "crashtest" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28242 /* "conflict" */, ts+27761 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28251 /* "crashtest" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26169 /* "datetime" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28261 /* "datetime" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26178 /* "decltype" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28270 /* "decltype" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26187 /* "deprecated" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28279 /* "deprecated" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26198 /* "diskio" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28290 /* "diskio" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+3448 /* "explain" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+4665 /* "explain" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26205 /* "floatingpoint" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28297 /* "floatingpoint" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26219 /* "foreignkey" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28311 /* "foreignkey" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26230 /* "fts1" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28322 /* "fts1" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26235 /* "fts2" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28327 /* "fts2" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26240 /* "fts3" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28332 /* "fts3" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26245 /* "fts5" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28337 /* "fts5" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26250 /* "fts3_unicode" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28342 /* "fts3_unicode" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26263 /* "fts4_deferred" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28355 /* "fts4_deferred" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26277 /* "gettable" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28369 /* "gettable" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26286 /* "icu" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28378 /* "icu" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26290 /* "icu_collations" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28382 /* "icu_collations" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+8647 /* "incrblob" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+10346 /* "incrblob" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26305 /* "integrityck" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28397 /* "integrityck" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26317 /* "legacyformat" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28409 /* "legacyformat" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26330 /* "like_opt" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28422 /* "like_opt" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26339 /* "load_ext" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28431 /* "load_ext" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26348 /* "localtime" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28440 /* "localtime" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26358 /* "lookaside" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28450 /* "lookaside" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26368, /* "long_double" */
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28460, /* "long_double" */
func() uintptr {
if uint64(unsafe.Sizeof(float64(0))) > uint64(unsafe.Sizeof(float64(0))) {
- return ts + 25702 /* "1" */
+ return ts + 27761 /* "1" */
}
- return ts + 12045 /* "0" */
+ return ts + 13695 /* "0" */
}(),
1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26380 /* "memorydb" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28472 /* "memorydb" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26389 /* "memorymanage" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28481 /* "memorymanage" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26402 /* "mergesort" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28494 /* "mergesort" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26412 /* "null_trim" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28504 /* "null_trim" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26422 /* "or_opt" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28514 /* "or_opt" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26429 /* "rbu" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28521 /* "rbu" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26433 /* "pager_pragmas" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28525 /* "pager_pragmas" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26447 /* "pragma" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28539 /* "pragma" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+11460 /* "progress" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+10021 /* "progress" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26454 /* "reindex" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28546 /* "reindex" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26462 /* "rtree" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28554 /* "rtree" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26468 /* "rtree_int_only" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28560 /* "rtree_int_only" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26483 /* "schema_pragmas" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28575 /* "schema_pragmas" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26498 /* "schema_version" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28590 /* "schema_version" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26513 /* "session" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28605 /* "session" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+16415 /* "stat4" */, ts+12045 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26521 /* "stmtvtab" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+18111 /* "stat4" */, ts+27761 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28613 /* "stmtvtab" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26530 /* "scanstatus" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28622 /* "scanstatus" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26541 /* "lock_proxy_pragm..." */, ts+12045 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26560 /* "prefer_proxy_loc..." */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28633 /* "lock_proxy_pragm..." */, ts+13695 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28652 /* "prefer_proxy_loc..." */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26581 /* "shared_cache" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28673 /* "shared_cache" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26594 /* "subquery" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28686 /* "subquery" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26603 /* "tclvar" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28695 /* "tclvar" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26610, /* "threadsafe" */
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28702, /* "threadsafe" */
func() uintptr {
if 1 != 0 {
- return ts + 25702 /* "1" */
+ return ts + 27761 /* "1" */
}
- return ts + 12045 /* "0" */
+ return ts + 13695 /* "0" */
}(), 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26621, /* "threadsafe1" */
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28713, /* "threadsafe1" */
func() uintptr {
if 1 == 1 {
- return ts + 25702 /* "1" */
+ return ts + 27761 /* "1" */
}
- return ts + 12045 /* "0" */
+ return ts + 13695 /* "0" */
}(), 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26633, /* "threadsafe2" */
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28725, /* "threadsafe2" */
func() uintptr {
if 1 == 2 {
- return ts + 25702 /* "1" */
+ return ts + 27761 /* "1" */
}
- return ts + 12045 /* "0" */
+ return ts + 13695 /* "0" */
}(), 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26645 /* "tempdb" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28737 /* "tempdb" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+11536 /* "trace" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+13167 /* "trace" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26652 /* "trigger" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28744 /* "trigger" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26660 /* "truncate_opt" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28752 /* "truncate_opt" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+13590 /* "utf16" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+15230 /* "utf16" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26673 /* "vacuum" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28765 /* "vacuum" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26680 /* "view" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28772 /* "view" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26685 /* "vtab" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28777 /* "vtab" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26690 /* "wal" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28782 /* "wal" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26694 /* "wsd" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28786 /* "wsd" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26698 /* "update_delete_li..." */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28790 /* "update_delete_li..." */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+11563 /* "unlock_notify" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+13194 /* "unlock_notify" */, ts+27761 /* "1" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26718 /* "fast_secure_dele..." */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28810 /* "fast_secure_dele..." */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26737 /* "secure_delete" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28829 /* "secure_delete" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26751 /* "userauth" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28843 /* "userauth" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26760 /* "multiplex_ext_ov..." */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28852 /* "multiplex_ext_ov..." */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26784 /* "yytrackmaxstackd..." */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28876 /* "yytrackmaxstackd..." */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26805 /* "sqllog" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28897 /* "sqllog" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26812 /* "uri_00_error" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28904 /* "uri_00_error" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26825 /* "normalize" */, ts+12045 /* "0" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28917 /* "normalize" */, ts+13695 /* "0" */, 1)
- tcl.XTcl_SetVar2(tls, interp, ts+25635 /* "sqlite_options" */, ts+26835 /* "windowfunc" */, ts+25702 /* "1" */, 1)
+ tcl.XTcl_SetVar2(tls, interp, ts+27727 /* "sqlite_options" */, ts+28927 /* "windowfunc" */, ts+27761 /* "1" */, 1)
{
- tcl.XTcl_LinkVar(tls, interp, ts+26846 /* "SQLITE_MAX_LENGT..." */, uintptr(unsafe.Pointer(&cv_MAX_LENGTH)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+28938 /* "SQLITE_MAX_LENGT..." */, uintptr(unsafe.Pointer(&cv_MAX_LENGTH)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+26864 /* "SQLITE_MAX_COLUM..." */, uintptr(unsafe.Pointer(&cv_MAX_COLUMN)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+28956 /* "SQLITE_MAX_COLUM..." */, uintptr(unsafe.Pointer(&cv_MAX_COLUMN)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+26882 /* "SQLITE_MAX_SQL_L..." */, uintptr(unsafe.Pointer(&cv_MAX_SQL_LENGTH)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+28974 /* "SQLITE_MAX_SQL_L..." */, uintptr(unsafe.Pointer(&cv_MAX_SQL_LENGTH)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+26904 /* "SQLITE_MAX_EXPR_..." */, uintptr(unsafe.Pointer(&cv_MAX_EXPR_DEPTH)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+28996 /* "SQLITE_MAX_EXPR_..." */, uintptr(unsafe.Pointer(&cv_MAX_EXPR_DEPTH)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+26926 /* "SQLITE_MAX_COMPO..." */, uintptr(unsafe.Pointer(&cv_MAX_COMPOUND_SELECT)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29018 /* "SQLITE_MAX_COMPO..." */, uintptr(unsafe.Pointer(&cv_MAX_COMPOUND_SELECT)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+26953 /* "SQLITE_MAX_VDBE_..." */, uintptr(unsafe.Pointer(&cv_MAX_VDBE_OP)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29045 /* "SQLITE_MAX_VDBE_..." */, uintptr(unsafe.Pointer(&cv_MAX_VDBE_OP)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+26972 /* "SQLITE_MAX_FUNCT..." */, uintptr(unsafe.Pointer(&cv_MAX_FUNCTION_ARG)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29064 /* "SQLITE_MAX_FUNCT..." */, uintptr(unsafe.Pointer(&cv_MAX_FUNCTION_ARG)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+26996 /* "SQLITE_MAX_VARIA..." */, uintptr(unsafe.Pointer(&cv_MAX_VARIABLE_NUMBER)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29088 /* "SQLITE_MAX_VARIA..." */, uintptr(unsafe.Pointer(&cv_MAX_VARIABLE_NUMBER)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27023 /* "SQLITE_MAX_PAGE_..." */, uintptr(unsafe.Pointer(&cv_MAX_PAGE_SIZE)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29115 /* "SQLITE_MAX_PAGE_..." */, uintptr(unsafe.Pointer(&cv_MAX_PAGE_SIZE)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27044 /* "SQLITE_MAX_PAGE_..." */, uintptr(unsafe.Pointer(&cv_MAX_PAGE_COUNT)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29136 /* "SQLITE_MAX_PAGE_..." */, uintptr(unsafe.Pointer(&cv_MAX_PAGE_COUNT)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27066 /* "SQLITE_MAX_LIKE_..." */, uintptr(unsafe.Pointer(&cv_MAX_LIKE_PATTERN_LENGTH)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29158 /* "SQLITE_MAX_LIKE_..." */, uintptr(unsafe.Pointer(&cv_MAX_LIKE_PATTERN_LENGTH)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27097 /* "SQLITE_MAX_TRIGG..." */, uintptr(unsafe.Pointer(&cv_MAX_TRIGGER_DEPTH)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29189 /* "SQLITE_MAX_TRIGG..." */, uintptr(unsafe.Pointer(&cv_MAX_TRIGGER_DEPTH)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27122 /* "SQLITE_DEFAULT_C..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_CACHE_SIZE)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29214 /* "SQLITE_DEFAULT_C..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_CACHE_SIZE)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27148 /* "SQLITE_DEFAULT_P..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_PAGE_SIZE)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29240 /* "SQLITE_DEFAULT_P..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_PAGE_SIZE)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27173 /* "SQLITE_DEFAULT_F..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_FILE_FORMAT)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29265 /* "SQLITE_DEFAULT_F..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_FILE_FORMAT)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27200 /* "SQLITE_DEFAULT_S..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_SYNCHRONOUS)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29292 /* "SQLITE_DEFAULT_S..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_SYNCHRONOUS)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27227 /* "SQLITE_DEFAULT_W..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_WAL_SYNCHRONOUS)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29319 /* "SQLITE_DEFAULT_W..." */, uintptr(unsafe.Pointer(&cv_DEFAULT_WAL_SYNCHRONOUS)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27258 /* "SQLITE_MAX_ATTAC..." */, uintptr(unsafe.Pointer(&cv_MAX_ATTACHED)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29350 /* "SQLITE_MAX_ATTAC..." */, uintptr(unsafe.Pointer(&cv_MAX_ATTACHED)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27278 /* "SQLITE_MAX_DEFAU..." */, uintptr(unsafe.Pointer(&cv_MAX_DEFAULT_PAGE_SIZE)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29370 /* "SQLITE_MAX_DEFAU..." */, uintptr(unsafe.Pointer(&cv_MAX_DEFAULT_PAGE_SIZE)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27307 /* "SQLITE_MAX_WORKE..." */, uintptr(unsafe.Pointer(&cv_MAX_WORKER_THREADS)), (1 | 0x80))
+ tcl.XTcl_LinkVar(tls, interp, ts+29399 /* "SQLITE_MAX_WORKE..." */, uintptr(unsafe.Pointer(&cv_MAX_WORKER_THREADS)), (1 | 0x80))
}
{
- tcl.XTcl_LinkVar(tls, interp, ts+27333 /* "TEMP_STORE" */, uintptr(unsafe.Pointer(&cv_TEMP_STORE)),
+ tcl.XTcl_LinkVar(tls, interp, ts+29425 /* "TEMP_STORE" */, uintptr(unsafe.Pointer(&cv_TEMP_STORE)),
(1 | 0x80))
}
@@ -53831,7 +58628,7 @@ func set_options(tls *crt.TLS, interp uintptr) { /* test_config.c:47:13: */
var cv_MAX_LENGTH int32 = 1000000000 /* test_config.c:772:3 */
var cv_MAX_COLUMN int32 = 2000 /* test_config.c:773:3 */
var cv_MAX_SQL_LENGTH int32 = 1000000000 /* test_config.c:774:3 */
-var cv_MAX_EXPR_DEPTH int32 = 0 /* test_config.c:775:3 */
+var cv_MAX_EXPR_DEPTH int32 = 1000 /* test_config.c:775:3 */
var cv_MAX_COMPOUND_SELECT int32 = 500 /* test_config.c:776:3 */
var cv_MAX_VDBE_OP int32 = 250000000 /* test_config.c:777:3 */
var cv_MAX_FUNCTION_ARG int32 = 127 /* test_config.c:778:3 */
@@ -53844,14 +58641,14 @@ var cv_DEFAULT_CACHE_SIZE int32 = -2000 /* test_config.c:784:3 */
var cv_DEFAULT_PAGE_SIZE int32 = 1024 /* test_config.c:785:3 */
var cv_DEFAULT_FILE_FORMAT int32 = 4 /* test_config.c:786:3 */
var cv_DEFAULT_SYNCHRONOUS int32 = 2 /* test_config.c:787:3 */
-var cv_DEFAULT_WAL_SYNCHRONOUS int32 = 1 /* test_config.c:788:3 */
+var cv_DEFAULT_WAL_SYNCHRONOUS int32 = 2 /* test_config.c:788:3 */
var cv_MAX_ATTACHED int32 = 10 /* test_config.c:789:3 */
var cv_MAX_DEFAULT_PAGE_SIZE int32 = 8192 /* test_config.c:790:3 */
var cv_MAX_WORKER_THREADS int32 = 8 /* test_config.c:791:3 */
var cv_TEMP_STORE int32 = 1 /* test_config.c:794:22 */
// Register commands with the TCL interpreter.
-func Sqliteconfig_Init(tls *crt.TLS, interp uintptr) int32 { /* test_config.c:819:5: */
+func Sqliteconfig_Init(tls *libc.TLS, interp uintptr) int32 { /* test_config.c:819:5: */
set_options(tls, interp)
return 0
}
@@ -53867,14 +58664,14 @@ func Sqliteconfig_Init(tls *crt.TLS, interp uintptr) int32 { /* test_config.c:81
// This routine is a copy of (most of) the code from SQLite function
// sqlite3FileSuffix3(). It modifies the filename in buffer z in the
// same way as SQLite does when in 8.3 filenames mode.
-func sqlite3Delete83Name(tls *crt.TLS, z uintptr) { /* test_delete.c:46:13: */
+func sqlite3Delete83Name(tls *libc.TLS, z uintptr) { /* test_delete.c:46:13: */
var i int32
var sz int32
- sz = int32(crt.Xstrlen(tls, z))
+ sz = int32(libc.Xstrlen(tls, z))
for i = (sz - 1); ((i > 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != '/')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != '.'); i-- {
}
if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == '.') && (sz > (i + 4)) {
- crt.Xmemmove(tls, (z + uintptr((i + 1))), (z + uintptr((sz - 3))), uint64(4))
+ libc.Xmemmove(tls, (z + uintptr((i + 1))), (z + uintptr((sz - 3))), uint64(4))
}
}
@@ -53883,12 +58680,12 @@ func sqlite3Delete83Name(tls *crt.TLS, z uintptr) { /* test_delete.c:46:13: */
// set *pbExists to false before returning.
//
// If an error occurs, non-zero is returned. Or, if no error occurs, zero.
-func sqlite3DeleteUnlinkIfExists(tls *crt.TLS, pVfs uintptr, zFile uintptr, pbExists uintptr) int32 { /* test_delete.c:60:12: */
+func sqlite3DeleteUnlinkIfExists(tls *libc.TLS, pVfs uintptr, zFile uintptr, pbExists uintptr) int32 { /* test_delete.c:60:12: */
var rc int32 = 1
- rc = crt.Xaccess(tls, zFile, 0)
+ rc = libc.Xaccess(tls, zFile, 0)
if rc != 0 {
- if (*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) == 2 {
+ if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == 2 {
if pbExists != 0 {
*(*int32)(unsafe.Pointer(pbExists)) = 0
}
@@ -53898,14 +58695,14 @@ func sqlite3DeleteUnlinkIfExists(tls *crt.TLS, pVfs uintptr, zFile uintptr, pbEx
if pbExists != 0 {
*(*int32)(unsafe.Pointer(pbExists)) = 1
}
- rc = crt.Xunlink(tls, zFile)
+ rc = libc.Xunlink(tls, zFile)
}
return rc
}
// Delete the database file identified by the string argument passed to this
// function. The string must contain a filename, not an SQLite URI.
-func sqlite3_delete_database(tls *crt.TLS, zFile uintptr) int32 { /* test_delete.c:95:16: */
+func sqlite3_delete_database(tls *libc.TLS, zFile uintptr) int32 { /* test_delete.c:95:16: */
bp := tls.Alloc(156)
defer tls.Free(156)
@@ -53914,22 +58711,22 @@ func sqlite3_delete_database(tls *crt.TLS, zFile uintptr) int32 { /* test_delete
var rc int32 = 0 // System error code
var i int32 // Iterate through azFmt[] and aMFile[]
- *(*[4]uintptr)(unsafe.Pointer(bp + 24 /* azFmt */)) = [4]uintptr{ts /* "%s" */, ts + 27344 /* "%s-journal" */, ts + 27355 /* "%s-wal" */, ts + 27362 /* "%s-shm" */}
+ *(*[4]uintptr)(unsafe.Pointer(bp + 24 /* azFmt */)) = [4]uintptr{ts /* "%s" */, ts + 29436 /* "%s-journal" */, ts + 29447 /* "%s-wal" */, ts + 29454 /* "%s-shm" */}
*(*[6]MFile)(unsafe.Pointer(bp + 56 /* aMFile */)) = [6]MFile{
- {FzFmt: ts + 27369 /* "%s%03d" */, FiOffset: 0, Fb83: 0},
- {FzFmt: ts + 27376 /* "%s-journal%03d" */, FiOffset: 0, Fb83: 0},
- {FzFmt: ts + 27391 /* "%s-wal%03d" */, FiOffset: 0, Fb83: 0},
- {FzFmt: ts + 27369 /* "%s%03d" */, FiOffset: 0, Fb83: 1},
- {FzFmt: ts + 27376 /* "%s-journal%03d" */, FiOffset: 400, Fb83: 1},
- {FzFmt: ts + 27391 /* "%s-wal%03d" */, FiOffset: 700, Fb83: 1},
+ {FzFmt: ts + 29461 /* "%s%03d" */, FiOffset: 0, Fb83: 0},
+ {FzFmt: ts + 29468 /* "%s-journal%03d" */, FiOffset: 0, Fb83: 0},
+ {FzFmt: ts + 29483 /* "%s-wal%03d" */, FiOffset: 0, Fb83: 0},
+ {FzFmt: ts + 29461 /* "%s%03d" */, FiOffset: 0, Fb83: 1},
+ {FzFmt: ts + 29468 /* "%s-journal%03d" */, FiOffset: 400, Fb83: 1},
+ {FzFmt: ts + 29483 /* "%s-wal%03d" */, FiOffset: 700, Fb83: 1},
}
var pVfs uintptr = uintptr(0)
// Allocate a buffer large enough for any of the files that need to be
// deleted.
- nBuf = (int32(crt.Xstrlen(tls, zFile)) + 100)
+ nBuf = (int32(libc.Xstrlen(tls, zFile)) + 100)
zBuf = sqlite3.Xsqlite3_malloc(tls, nBuf)
if zBuf == uintptr(0) {
return 7
@@ -53938,7 +58735,7 @@ func sqlite3_delete_database(tls *crt.TLS, zFile uintptr) int32 { /* test_delete
// Delete both the regular and 8.3 filenames versions of the database,
// journal, wal and shm files.
for i = 0; (rc == 0) && (uint64(i) < (uint64(unsafe.Sizeof([4]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0))))); i++ {
- sqlite3.Xsqlite3_snprintf(tls, nBuf, zBuf, *(*uintptr)(unsafe.Pointer(bp + 24 /* &azFmt[0] */ + uintptr(i)*8)), crt.VaList(bp, zFile))
+ sqlite3.Xsqlite3_snprintf(tls, nBuf, zBuf, *(*uintptr)(unsafe.Pointer(bp + 24 /* &azFmt[0] */ + uintptr(i)*8)), libc.VaList(bp, zFile))
rc = sqlite3DeleteUnlinkIfExists(tls, pVfs, zBuf, uintptr(0))
if (rc == 0) && (i != 0) {
sqlite3Delete83Name(tls, zBuf)
@@ -53953,7 +58750,7 @@ func sqlite3_delete_database(tls *crt.TLS, zFile uintptr) int32 { /* test_delete
for iChunk = 1; iChunk <= 299; iChunk++ {
// var bExists int32 at bp+152, 4
- sqlite3.Xsqlite3_snprintf(tls, nBuf, zBuf, (*MFile)(unsafe.Pointer(p)).FzFmt, crt.VaList(bp+8, zFile, (iChunk+(*MFile)(unsafe.Pointer(p)).FiOffset)))
+ sqlite3.Xsqlite3_snprintf(tls, nBuf, zBuf, (*MFile)(unsafe.Pointer(p)).FzFmt, libc.VaList(bp+8, zFile, (iChunk+(*MFile)(unsafe.Pointer(p)).FiOffset)))
if (*MFile)(unsafe.Pointer(p)).Fb83 != 0 {
sqlite3Delete83Name(tls, zBuf)
}
@@ -53979,12 +58776,6 @@ type MFile = struct {
Fb83 int32
}
-// Some versions of <linux/posix_types.h> define this macros.
-// It's easier to assume 8-bit bytes than to get CHAR_BIT.
-
-// fd_set for select and pselect.
-type fd_set2 = struct{ F__fds_bits [16]int64 } /* select.h:70:5 */
-
// Copyright (C) 1991-2018 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
//
@@ -54047,16 +58838,16 @@ type DemoFile = DemoFile1 /* test_demovfs.c:147:25 */
// Write directly to the file passed as the first argument. Even if the
// file has a write-buffer (DemoFile.aBuffer), ignore it.
-func demoDirectWrite(tls *crt.TLS, p uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_demovfs.c:161:12: */
+func demoDirectWrite(tls *libc.TLS, p uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_demovfs.c:161:12: */
var ofst off_t // Return value from lseek()
var nWrite size_t // Return value from write()
- ofst = crt.Xlseek(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd, int64(iOfst), 0)
+ ofst = libc.Xlseek(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd, int64(iOfst), 0)
if sqlite_int64(ofst) != iOfst {
return (10 | (int32(3) << 8))
}
- nWrite = size_t(crt.Xwrite(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd, zBuf, uint64(iAmt)))
+ nWrite = size_t(libc.Xwrite(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd, zBuf, uint64(iAmt)))
if nWrite != size_t(iAmt) {
return (10 | (int32(3) << 8))
}
@@ -54067,7 +58858,7 @@ func demoDirectWrite(tls *crt.TLS, p uintptr, zBuf uintptr, iAmt int32, iOfst sq
// Flush the contents of the DemoFile.aBuffer buffer to disk. This is a
// no-op if this particular file does not have a buffer (i.e. it is not
// a journal file) or if the buffer is currently empty.
-func demoFlushBuffer(tls *crt.TLS, p uintptr) int32 { /* test_demovfs.c:188:12: */
+func demoFlushBuffer(tls *libc.TLS, p uintptr) int32 { /* test_demovfs.c:188:12: */
var rc int32 = 0
if (*DemoFile)(unsafe.Pointer(p)).FnBuffer != 0 {
rc = demoDirectWrite(tls, p, (*DemoFile)(unsafe.Pointer(p)).FaBuffer, (*DemoFile)(unsafe.Pointer(p)).FnBuffer, (*DemoFile)(unsafe.Pointer(p)).FiBufferOfst)
@@ -54077,17 +58868,17 @@ func demoFlushBuffer(tls *crt.TLS, p uintptr) int32 { /* test_demovfs.c:188:12:
}
// Close a file.
-func demoClose(tls *crt.TLS, pFile uintptr) int32 { /* test_demovfs.c:200:12: */
+func demoClose(tls *libc.TLS, pFile uintptr) int32 { /* test_demovfs.c:200:12: */
var rc int32
var p uintptr = pFile
rc = demoFlushBuffer(tls, p)
sqlite3.Xsqlite3_free(tls, (*DemoFile)(unsafe.Pointer(p)).FaBuffer)
- crt.Xclose(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd)
+ libc.Xclose(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd)
return rc
}
// Read data from a file.
-func demoRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_demovfs.c:212:12: */
+func demoRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_demovfs.c:212:12: */
var p uintptr = pFile
var ofst off_t // Return value from lseek()
var nRead int32 // Return value from read()
@@ -54103,17 +58894,17 @@ func demoRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlit
return rc
}
- ofst = crt.Xlseek(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd, int64(iOfst), 0)
+ ofst = libc.Xlseek(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd, int64(iOfst), 0)
if sqlite_int64(ofst) != iOfst {
return (10 | (int32(1) << 8))
}
- nRead = int32(crt.Xread(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd, zBuf, uint64(iAmt)))
+ nRead = int32(libc.Xread(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd, zBuf, uint64(iAmt)))
if nRead == iAmt {
return 0
} else if nRead >= 0 {
if nRead < iAmt {
- crt.Xmemset(tls, ((zBuf) + uintptr(nRead)), 0, (uint64(iAmt - nRead)))
+ libc.Xmemset(tls, ((zBuf) + uintptr(nRead)), 0, (uint64(iAmt - nRead)))
}
return (10 | (int32(2) << 8))
}
@@ -54122,7 +58913,7 @@ func demoRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlit
}
// Write data to a crash-file.
-func demoWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_demovfs.c:255:12: */
+func demoWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_demovfs.c:255:12: */
var p uintptr = pFile
if (*DemoFile)(unsafe.Pointer(p)).FaBuffer != 0 {
@@ -54150,7 +58941,7 @@ func demoWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqli
if nCopy > n {
nCopy = n
}
- crt.Xmemcpy(tls, ((*DemoFile)(unsafe.Pointer(p)).FaBuffer + uintptr((*DemoFile)(unsafe.Pointer(p)).FnBuffer)), z, uint64(nCopy))
+ libc.Xmemcpy(tls, ((*DemoFile)(unsafe.Pointer(p)).FaBuffer + uintptr((*DemoFile)(unsafe.Pointer(p)).FnBuffer)), z, uint64(nCopy))
*(*int32)(unsafe.Pointer(p + 24 /* &.nBuffer */)) += (nCopy)
n = n - (nCopy)
@@ -54166,12 +58957,12 @@ func demoWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqli
// Truncate a file. This is a no-op for this VFS (see header comments at
// the top of the file).
-func demoTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_demovfs.c:307:12: */
+func demoTruncate(tls *libc.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_demovfs.c:307:12: */
return 0
}
// Sync the contents of the file to the persistent media.
-func demoSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_demovfs.c:317:12: */
+func demoSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* test_demovfs.c:317:12: */
var p uintptr = pFile
var rc int32
@@ -54180,7 +58971,7 @@ func demoSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_demovfs.
return rc
}
- rc = crt.Xfsync(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd)
+ rc = libc.Xfsync(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd)
return func() int32 {
if rc == 0 {
return 0
@@ -54190,13 +58981,13 @@ func demoSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_demovfs.
}
// Write the size of the file in bytes to *pSize.
-func demoFileSize(tls *crt.TLS, pFile uintptr, pSize uintptr) int32 { /* test_demovfs.c:333:12: */
+func demoFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* test_demovfs.c:333:12: */
bp := tls.Alloc(144)
defer tls.Free(144)
var p uintptr = pFile
var rc int32 // Return code from fstat() call
- // var sStat struct {Fst_dev uint64;Fst_ino uint64;Fst_nlink uint64;Fst_mode uint32;Fst_uid uint32;Fst_gid uint32;F__pad0 int32;Fst_rdev uint64;Fst_size int64;Fst_blksize int64;Fst_blocks int64;Fst_atim timespec;Fst_mtim timespec;Fst_ctim timespec;F__glibc_reserved [3]int64;} at bp, 144
+ // var sStat stat at bp, 144
// Output of fstat() call
// Flush the contents of the buffer to disk. As with the flush in the
@@ -54208,27 +58999,11 @@ func demoFileSize(tls *crt.TLS, pFile uintptr, pSize uintptr) int32 { /* test_de
return rc
}
- rc = crt2.Xfstat(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd, bp /* &sStat */)
+ rc = libc.Xfstat(tls, (*DemoFile)(unsafe.Pointer(p)).Ffd, bp /* &sStat */)
if rc != 0 {
return (10 | (int32(7) << 8))
}
- *(*sqlite_int64)(unsafe.Pointer(pSize)) = sqlite_int64((*struct {
- Fst_dev uint64
- Fst_ino uint64
- Fst_nlink uint64
- Fst_mode uint32
- Fst_uid uint32
- Fst_gid uint32
- F__pad0 int32
- Fst_rdev uint64
- Fst_size int64
- Fst_blksize int64
- Fst_blocks int64
- Fst_atim timespec
- Fst_mtim timespec
- Fst_ctim timespec
- F__glibc_reserved [3]int64
- })(unsafe.Pointer(bp /* &sStat */)).Fst_size)
+ *(*sqlite_int64)(unsafe.Pointer(pSize)) = sqlite_int64((*stat)(unsafe.Pointer(bp /* &sStat */)).Fst_size)
return 0
}
@@ -54236,34 +59011,34 @@ func demoFileSize(tls *crt.TLS, pFile uintptr, pSize uintptr) int32 { /* test_de
// The xCheckReservedLock() always indicates that no other process holds
// a reserved lock on the database file. This ensures that if a hot-journal
// file is found in the file-system it is rolled back.
-func demoLock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_demovfs.c:360:12: */
+func demoLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_demovfs.c:360:12: */
return 0
}
-func demoUnlock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_demovfs.c:363:12: */
+func demoUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_demovfs.c:363:12: */
return 0
}
-func demoCheckReservedLock(tls *crt.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_demovfs.c:366:12: */
+func demoCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_demovfs.c:366:12: */
*(*int32)(unsafe.Pointer(pResOut)) = 0
return 0
}
// No xFileControl() verbs are implemented by this VFS.
-func demoFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_demovfs.c:374:12: */
+func demoFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_demovfs.c:374:12: */
return 12
}
// The xSectorSize() and xDeviceCharacteristics() methods. These two
// may return special values allowing SQLite to optimize file-system
// access to some extent. But it is also safe to simply return 0.
-func demoSectorSize(tls *crt.TLS, pFile uintptr) int32 { /* test_demovfs.c:383:12: */
+func demoSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* test_demovfs.c:383:12: */
return 0
}
-func demoDeviceCharacteristics(tls *crt.TLS, pFile uintptr) int32 { /* test_demovfs.c:386:12: */
+func demoDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* test_demovfs.c:386:12: */
return 0
}
// Open a file handle.
-func demoOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_demovfs.c:393:12: */
+func demoOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_demovfs.c:393:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -54295,8 +59070,8 @@ func demoOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags in
oflags = oflags | (02)
}
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DemoFile{})))
- (*DemoFile)(unsafe.Pointer(p)).Ffd = crt.Xopen(tls, zName, oflags, crt.VaList(bp, 0600))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DemoFile{})))
+ (*DemoFile)(unsafe.Pointer(p)).Ffd = libc.Xopen(tls, zName, oflags, libc.VaList(bp, 0600))
if (*DemoFile)(unsafe.Pointer(p)).Ffd < 0 {
sqlite3.Xsqlite3_free(tls, aBuf)
return 14
@@ -54328,14 +59103,14 @@ var demoio = sqlite3_io_methods{FiVersion: 1, FxClose: // iVersion
// Delete the file identified by argument zPath. If the dirSync parameter
// is non-zero, then ensure the file-system modification to delete the
// file has been synced to disk before returning.
-func demoDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_demovfs.c:456:12: */
+func demoDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_demovfs.c:456:12: */
bp := tls.Alloc(529)
defer tls.Free(529)
var rc int32 // Return code
- rc = crt.Xunlink(tls, zPath)
- if (rc != 0) && ((*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) == 2) {
+ rc = libc.Xunlink(tls, zPath)
+ if (rc != 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == 2) {
return 0
}
@@ -54346,19 +59121,19 @@ func demoDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32
// Name of directory containing file zPath
// Figure out the directory name from the path of the file deleted.
- sqlite3.Xsqlite3_snprintf(tls, 512, bp+16 /* &zDir[0] */, ts /* "%s" */, crt.VaList(bp, zPath))
+ sqlite3.Xsqlite3_snprintf(tls, 512, bp+16 /* &zDir[0] */, ts /* "%s" */, libc.VaList(bp, zPath))
*(*int8)(unsafe.Pointer(bp + 16 /* &zDir[0] */ + uintptr(512))) = int8(0)
- for i = int32(crt.Xstrlen(tls, bp+16 /* &zDir[0] */)); (i > 1) && (int32(*(*int8)(unsafe.Pointer(bp + 16 /* &zDir[0] */ + uintptr(i)))) != '/'); i++ {
+ for i = int32(libc.Xstrlen(tls, bp+16 /* &zDir[0] */)); (i > 1) && (int32(*(*int8)(unsafe.Pointer(bp + 16 /* &zDir[0] */ + uintptr(i)))) != '/'); i++ {
}
*(*int8)(unsafe.Pointer(bp + 16 /* &zDir[0] */ + uintptr(i))) = int8(0)
// Open a file-descriptor on the directory. Sync. Close.
- dfd = crt.Xopen(tls, bp+16 /* &zDir[0] */, 00, crt.VaList(bp+8, 0))
+ dfd = libc.Xopen(tls, bp+16 /* &zDir[0] */, 00, libc.VaList(bp+8, 0))
if dfd < 0 {
rc = -1
} else {
- rc = crt.Xfsync(tls, dfd)
- crt.Xclose(tls, dfd)
+ rc = libc.Xfsync(tls, dfd)
+ libc.Xclose(tls, dfd)
}
}
return func() int32 {
@@ -54371,7 +59146,7 @@ func demoDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32
// Query the file-system to see if the named file exists, is readable or
// is both readable and writable.
-func demoAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test_demovfs.c:499:12: */
+func demoAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test_demovfs.c:499:12: */
var rc int32 // access() return code
var eAccess int32 = 0 // Second argument to access()
@@ -54382,8 +59157,8 @@ func demoAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut
eAccess = 4
}
- rc = crt.Xaccess(tls, zPath, eAccess)
- *(*int32)(unsafe.Pointer(pResOut)) = (crt.Bool32(rc == 0))
+ rc = libc.Xaccess(tls, zPath, eAccess)
+ *(*int32)(unsafe.Pointer(pResOut)) = (libc.Bool32(rc == 0))
return 0
}
@@ -54396,7 +59171,7 @@ func demoAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut
//
// 1. Path components are separated by a '/'. and
// 2. Full paths begin with a '/' character.
-func demoFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* test_demovfs.c:532:12: */
+func demoFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* test_demovfs.c:532:12: */
bp := tls.Alloc(529)
defer tls.Free(529)
@@ -54405,13 +59180,13 @@ func demoFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nPathOut int32,
if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(0)))) == '/' {
*(*int8)(unsafe.Pointer(bp + 16 /* &zDir[0] */ + uintptr(0))) = int8(0)
} else {
- if crt.Xgetcwd(tls, bp+16 /* &zDir[0] */, uint64(unsafe.Sizeof([513]int8{}))) == uintptr(0) {
+ if libc.Xgetcwd(tls, bp+16 /* &zDir[0] */, uint64(unsafe.Sizeof([513]int8{}))) == uintptr(0) {
return 10
}
}
*(*int8)(unsafe.Pointer(bp + 16 /* &zDir[0] */ + uintptr(512))) = int8(0)
- sqlite3.Xsqlite3_snprintf(tls, nPathOut, zPathOut, ts+3680 /* "%s/%s" */, crt.VaList(bp, bp+16 /* &zDir[0] */, zPath))
+ sqlite3.Xsqlite3_snprintf(tls, nPathOut, zPathOut, ts+4897 /* "%s/%s" */, libc.VaList(bp, bp+16 /* &zDir[0] */, zPath))
*(*int8)(unsafe.Pointer(zPathOut + uintptr((nPathOut - 1)))) = int8(0)
return 0
@@ -54427,31 +59202,31 @@ func demoFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nPathOut int32,
// are supposed to implement the functionality needed by SQLite to load
// extensions compiled as shared objects. This simple VFS does not support
// this functionality, so the following functions are no-ops.
-func demoDlOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr) uintptr { /* test_demovfs.c:564:13: */
+func demoDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* test_demovfs.c:564:13: */
return uintptr(0)
}
-func demoDlError(tls *crt.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* test_demovfs.c:567:13: */
- sqlite3.Xsqlite3_snprintf(tls, nByte, zErrMsg, ts+27402 /* "Loadable extensi..." */, 0)
+func demoDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* test_demovfs.c:567:13: */
+ sqlite3.Xsqlite3_snprintf(tls, nByte, zErrMsg, ts+29494 /* "Loadable extensi..." */, 0)
*(*int8)(unsafe.Pointer(zErrMsg + uintptr((nByte - 1)))) = int8(0)
}
-func demoDlSym(tls *crt.TLS, pVfs uintptr, pH uintptr, z uintptr) uintptr { /* test_demovfs.c:571:13: */
+func demoDlSym(tls *libc.TLS, pVfs uintptr, pH uintptr, z uintptr) uintptr { /* test_demovfs.c:571:13: */
return uintptr(0)
}
-func demoDlClose(tls *crt.TLS, pVfs uintptr, pHandle uintptr) { /* test_demovfs.c:574:13: */
+func demoDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* test_demovfs.c:574:13: */
return
}
// Parameter zByte points to a buffer nByte bytes in size. Populate this
// buffer with pseudo-random data.
-func demoRandomness(tls *crt.TLS, pVfs uintptr, nByte int32, zByte uintptr) int32 { /* test_demovfs.c:582:12: */
+func demoRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zByte uintptr) int32 { /* test_demovfs.c:582:12: */
return 0
}
// Sleep for at least nMicro microseconds. Return the (approximate) number
// of microseconds slept for.
-func demoSleep(tls *crt.TLS, pVfs uintptr, nMicro int32) int32 { /* test_demovfs.c:590:12: */
- crt.Xsleep(tls, (uint32(nMicro / 1000000)))
- crt.Xusleep(tls, (uint32(nMicro % 1000000)))
+func demoSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* test_demovfs.c:590:12: */
+ libc.Xsleep(tls, (uint32(nMicro / 1000000)))
+ libc.Xusleep(tls, (uint32(nMicro % 1000000)))
return nMicro
}
@@ -54464,8 +59239,8 @@ func demoSleep(tls *crt.TLS, pVfs uintptr, nMicro int32) int32 { /* test_demovfs
// an integer number of seconds. Also, assuming time_t is a signed 32-bit
// value, it will stop working some time in the year 2038 AD (the so-called
// "year 2038" problem that afflicts systems that store time this way).
-func demoCurrentTime(tls *crt.TLS, pVfs uintptr, pTime uintptr) int32 { /* test_demovfs.c:607:12: */
- var t time_t = crt.Xtime(tls, uintptr(0))
+func demoCurrentTime(tls *libc.TLS, pVfs uintptr, pTime uintptr) int32 { /* test_demovfs.c:607:12: */
+ var t time_t = libc.Xtime(tls, uintptr(0))
*(*float64)(unsafe.Pointer(pTime)) = ((float64(t) / 86400.0) + 2440587.5)
return 0
}
@@ -54474,7 +59249,7 @@ func demoCurrentTime(tls *crt.TLS, pVfs uintptr, pTime uintptr) int32 { /* test_
// To make the VFS available to SQLite:
//
// sqlite3_vfs_register(sqlite3_demovfs(), 0);
-func sqlite3_demovfs(tls *crt.TLS) uintptr { /* test_demovfs.c:619:13: */
+func sqlite3_demovfs(tls *libc.TLS) uintptr { /* test_demovfs.c:619:13: */
return uintptr(unsafe.Pointer(&demovfs))
}
@@ -54482,7 +59257,7 @@ var demovfs = sqlite3_vfs{FiVersion: 1, FszOsFile: // iVersion
int32(unsafe.Sizeof(DemoFile{})), FmxPathname:// szOsFile
512, FpNext:// mxPathname
uintptr(0), FzName:// pNext
-ts + 27440, /* "demo" */ FpAppData:// zName
+ts + 29532, /* "demo" */ FpAppData:// zName
uintptr(0), FxOpen:// pAppData
0, FxDelete:// xOpen
0, FxAccess:// xDelete
@@ -54497,23 +59272,7 @@ uintptr(0), FxOpen:// pAppData
0, // xCurrentTime
} /* test_demovfs.c:620:22 */
-type Tcl_StatBuf = struct {
- Fst_dev uint64
- Fst_ino uint64
- Fst_nlink uint64
- Fst_mode uint32
- Fst_uid uint32
- Fst_gid uint32
- F__pad0 int32
- Fst_rdev uint64
- Fst_size int64
- Fst_blksize int64
- Fst_blocks int64
- Fst_atim timespec
- Fst_mtim timespec
- Fst_ctim timespec
- F__glibc_reserved [3]int64
-} /* tcl.h:470:25 */
+type Tcl_StatBuf = stat /* tcl.h:470:25 */
// end block for C++
@@ -54523,22 +59282,22 @@ type Tcl_StatBuf = struct {
// fill-column: 78
// End:
-func register_demovfs(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_demovfs.c:657:26: */
+func register_demovfs(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_demovfs.c:657:26: */
sqlite3.Xsqlite3_vfs_register(tls, sqlite3_demovfs(tls), 1)
return 0
}
-func unregister_demovfs(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_demovfs.c:666:26: */
+func unregister_demovfs(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_demovfs.c:666:26: */
sqlite3.Xsqlite3_vfs_unregister(tls, sqlite3_demovfs(tls))
return 0
}
// Register commands with the TCL interpreter.
-func Sqlitetest_demovfs_Init(tls *crt.TLS, interp uintptr) int32 { /* test_demovfs.c:679:5: */
- tcl.XTcl_CreateObjCommand(tls, interp, ts+27445 /* "register_demovfs" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
+func Sqlitetest_demovfs_Init(tls *libc.TLS, interp uintptr) int32 { /* test_demovfs.c:679:5: */
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+29537 /* "register_demovfs" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
}{register_demovfs})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+27462 /* "unregister_demov..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+29554 /* "unregister_demov..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
}{unregister_demovfs})), uintptr(0), uintptr(0))
return 0
}
@@ -54569,96 +59328,96 @@ type DevsymGlobal = struct {
var g1 = DevsymGlobal{FpVfs: uintptr(0), FiDeviceChar: 0, FiSectorSize: 512, FnWriteCrash: 0} /* test_devsym.c:82:21 */
// Close an devsym-file.
-func devsymClose(tls *crt.TLS, pFile uintptr) int32 { /* test_devsym.c:87:12: */
+func devsymClose(tls *libc.TLS, pFile uintptr) int32 { /* test_devsym.c:87:12: */
var p uintptr = pFile
sqlite3.Xsqlite3OsClose(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal)
return 0
}
// Read data from an devsym-file.
-func devsymRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_devsym.c:96:12: */
+func devsymRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_devsym.c:96:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsRead(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst)
}
// Write data to an devsym-file.
-func devsymWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_devsym.c:109:12: */
+func devsymWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_devsym.c:109:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsWrite(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst)
}
// Truncate an devsym-file.
-func devsymTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_devsym.c:122:12: */
+func devsymTruncate(tls *libc.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_devsym.c:122:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsTruncate(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, size)
}
// Sync an devsym-file.
-func devsymSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_devsym.c:130:12: */
+func devsymSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* test_devsym.c:130:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsSync(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, flags)
}
// Return the current file-size of an devsym-file.
-func devsymFileSize(tls *crt.TLS, pFile uintptr, pSize uintptr) int32 { /* test_devsym.c:138:12: */
+func devsymFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* test_devsym.c:138:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsFileSize(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, pSize)
}
// Lock an devsym-file.
-func devsymLock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_devsym.c:146:12: */
+func devsymLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_devsym.c:146:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsLock(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, eLock)
}
// Unlock an devsym-file.
-func devsymUnlock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_devsym.c:154:12: */
+func devsymUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_devsym.c:154:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsUnlock(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, eLock)
}
// Check if another file-handle holds a RESERVED lock on an devsym-file.
-func devsymCheckReservedLock(tls *crt.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_devsym.c:162:12: */
+func devsymCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_devsym.c:162:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsCheckReservedLock(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, pResOut)
}
// File control method. For custom operations on an devsym-file.
-func devsymFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_devsym.c:170:12: */
+func devsymFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_devsym.c:170:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsFileControl(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, op, pArg)
}
// Return the sector-size in bytes for an devsym-file.
-func devsymSectorSize(tls *crt.TLS, pFile uintptr) int32 { /* test_devsym.c:178:12: */
+func devsymSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* test_devsym.c:178:12: */
return g1.FiSectorSize
}
// Return the device characteristic flags supported by an devsym-file.
-func devsymDeviceCharacteristics(tls *crt.TLS, pFile uintptr) int32 { /* test_devsym.c:185:12: */
+func devsymDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* test_devsym.c:185:12: */
return g1.FiDeviceChar
}
// Shared-memory methods are all pass-thrus.
-func devsymShmLock(tls *crt.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* test_devsym.c:192:12: */
+func devsymShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* test_devsym.c:192:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsShmLock(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, ofst, n, flags)
}
-func devsymShmMap(tls *crt.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 { /* test_devsym.c:196:12: */
+func devsymShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 { /* test_devsym.c:196:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsShmMap(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, iRegion, szRegion, isWrite, pp)
}
-func devsymShmBarrier(tls *crt.TLS, pFile uintptr) { /* test_devsym.c:206:13: */
+func devsymShmBarrier(tls *libc.TLS, pFile uintptr) { /* test_devsym.c:206:13: */
var p uintptr = pFile
sqlite3.Xsqlite3OsShmBarrier(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal)
}
-func devsymShmUnmap(tls *crt.TLS, pFile uintptr, delFlag int32) int32 { /* test_devsym.c:210:12: */
+func devsymShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* test_devsym.c:210:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsShmUnmap(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, delFlag)
}
// Open an devsym file handle.
-func devsymOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_devsym.c:220:12: */
+func devsymOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_devsym.c:220:12: */
var rc int32
var p uintptr = pFile
(*devsym_file)(unsafe.Pointer(p)).FpReal = (p + uintptr(1)*16)
@@ -54691,66 +59450,66 @@ var devsym_io_methods = sqlite3_io_methods{FiVersion: 2, FxClose: // iVersion
// Delete the file located at zPath. If the dirSync argument is true,
// ensure the file-system modifications are synced to disk before
// returning.
-func devsymDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_devsym.c:262:12: */
+func devsymDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_devsym.c:262:12: */
return sqlite3.Xsqlite3OsDelete(tls, g1.FpVfs, zPath, dirSync)
}
// Test for access permissions. Return true if the requested permission
// is available, or false otherwise.
-func devsymAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test_devsym.c:270:12: */
+func devsymAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test_devsym.c:270:12: */
return sqlite3.Xsqlite3OsAccess(tls, g1.FpVfs, zPath, flags, pResOut)
}
// Populate buffer zOut with the full canonical pathname corresponding
// to the pathname in zPath. zOut is guaranteed to point to a buffer
// of at least (DEVSYM_MAX_PATHNAME+1) bytes.
-func devsymFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* test_devsym.c:284:12: */
+func devsymFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* test_devsym.c:284:12: */
return sqlite3.Xsqlite3OsFullPathname(tls, g1.FpVfs, zPath, nOut, zOut)
}
// Populate the buffer pointed to by zBufOut with nByte bytes of
// random data.
-func devsymRandomness(tls *crt.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test_devsym.c:329:12: */
+func devsymRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test_devsym.c:329:12: */
return sqlite3.Xsqlite3OsRandomness(tls, g1.FpVfs, nByte, zBufOut)
}
// Sleep for nMicro microseconds. Return the number of microseconds
// actually slept.
-func devsymSleep(tls *crt.TLS, pVfs uintptr, nMicro int32) int32 { /* test_devsym.c:337:12: */
+func devsymSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* test_devsym.c:337:12: */
return sqlite3.Xsqlite3OsSleep(tls, g1.FpVfs, nMicro)
}
// Return the current time as a Julian Day number in *pTimeOut.
-func devsymCurrentTime(tls *crt.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* test_devsym.c:344:12: */
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((g1.FpVfs + 120 /* &.xCurrentTime */))))(tls, g1.FpVfs, pTimeOut)
+func devsymCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* test_devsym.c:344:12: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((g1.FpVfs + 120 /* &.xCurrentTime */))))(tls, g1.FpVfs, pTimeOut)
}
// Return the sector-size in bytes for an writecrash-file.
-func writecrashSectorSize(tls *crt.TLS, pFile uintptr) int32 { /* test_devsym.c:351:12: */
+func writecrashSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* test_devsym.c:351:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsSectorSize(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal)
}
// Return the device characteristic flags supported by an writecrash-file.
-func writecrashDeviceCharacteristics(tls *crt.TLS, pFile uintptr) int32 { /* test_devsym.c:359:12: */
+func writecrashDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* test_devsym.c:359:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsDeviceCharacteristics(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal)
}
// Write data to an writecrash-file.
-func writecrashWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_devsym.c:367:12: */
+func writecrashWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_devsym.c:367:12: */
var p uintptr = pFile
if g1.FnWriteCrash > 0 {
g1.FnWriteCrash--
if g1.FnWriteCrash == 0 {
- crt.Xabort(tls)
+ libc.Xabort(tls)
}
}
return sqlite3.Xsqlite3OsWrite(tls, (*devsym_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst)
}
// Open an writecrash file handle.
-func writecrashOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_devsym.c:384:12: */
+func writecrashOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_devsym.c:384:12: */
var rc int32
var p uintptr = pFile
(*devsym_file)(unsafe.Pointer(p)).FpReal = (p + uintptr(1)*16)
@@ -54784,7 +59543,7 @@ var devsym_vfs = sqlite3_vfs{FiVersion: 2, FszOsFile: // iVersion
int32(unsafe.Sizeof(devsym_file{})), FmxPathname:// szOsFile
512, FpNext:// mxPathname
uintptr(0), FzName:// pNext
-ts + 27481, /* "devsym" */ FpAppData:// zName
+ts + 29573, /* "devsym" */ FpAppData:// zName
uintptr(0), FxOpen:// pAppData
0, FxDelete:// xOpen
0, FxAccess:// xDelete
@@ -54805,7 +59564,7 @@ var writecrash_vfs = sqlite3_vfs{FiVersion: 2, FszOsFile: // iVersion
int32(unsafe.Sizeof(devsym_file{})), FmxPathname:// szOsFile
512, FpNext:// mxPathname
uintptr(0), FzName:// pNext
-ts + 27488, /* "writecrash" */ FpAppData:// zName
+ts + 29580, /* "writecrash" */ FpAppData:// zName
uintptr(0), FxOpen:// pAppData
0, FxDelete:// xOpen
0, FxAccess:// xDelete
@@ -54825,7 +59584,7 @@ uintptr(0), // xCurrentTimeInt64
// This procedure registers the devsym vfs with SQLite. If the argument is
// true, the devsym vfs becomes the new default vfs. It is the only publicly
// available function in this file.
-func devsym_register(tls *crt.TLS, iDeviceChar int32, iSectorSize int32) { /* test_devsym.c:485:6: */
+func devsym_register(tls *libc.TLS, iDeviceChar int32, iSectorSize int32) { /* test_devsym.c:485:6: */
if g1.FpVfs == uintptr(0) {
g1.FpVfs = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
@@ -54846,7 +59605,7 @@ func devsym_register(tls *crt.TLS, iDeviceChar int32, iSectorSize int32) { /* te
}
}
-func devsym_unregister(tls *crt.TLS) { /* test_devsym.c:506:6: */
+func devsym_unregister(tls *libc.TLS) { /* test_devsym.c:506:6: */
sqlite3.Xsqlite3_vfs_unregister(tls, uintptr(unsafe.Pointer(&devsym_vfs)))
sqlite3.Xsqlite3_vfs_unregister(tls, uintptr(unsafe.Pointer(&writecrash_vfs)))
g1.FpVfs = uintptr(0)
@@ -54854,7 +59613,7 @@ func devsym_unregister(tls *crt.TLS) { /* test_devsym.c:506:6: */
g1.FiSectorSize = 0
}
-func devsym_crash_on_write(tls *crt.TLS, nWrite int32) { /* test_devsym.c:514:6: */
+func devsym_crash_on_write(tls *libc.TLS, nWrite int32) { /* test_devsym.c:514:6: */
if g1.FpVfs == uintptr(0) {
g1.FpVfs = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 4 /* &.szOsFile */)) += ((*sqlite3_vfs)(unsafe.Pointer(g1.FpVfs)).FszOsFile)
@@ -54865,46 +59624,31 @@ func devsym_crash_on_write(tls *crt.TLS, nWrite int32) { /* test_devsym.c:514:6:
g1.FnWriteCrash = nWrite
}
-type Tcl_StatBuf1 = struct {
- Fst_dev uint64
- Fst_ino uint64
- Fst_nlink uint64
- Fst_mode uint32
- Fst_uid uint32
- Fst_gid uint32
- F__pad0 int32
- Fst_rdev uint64
- Fst_size int64
- Fst_blksize int64
- Fst_blocks int64
- Fst_atime int64
- Fst_atimensec uint64
- Fst_mtime int64
- Fst_mtimensec uint64
- Fst_ctime int64
- Fst_ctimensec uint64
- F__glibc_reserved [3]int64
-} /* tcl.h:470:25 */
-
// Note stat64 has the same shape as stat for x86-64.
type stat64 = struct {
- Fst_dev uint64
- Fst_ino uint64
- Fst_nlink uint64
- Fst_mode uint32
- Fst_uid uint32
- Fst_gid uint32
- F__pad0 int32
- Fst_rdev uint64
- Fst_size int64
- Fst_blksize int64
- Fst_blocks int64
- Fst_atime int64
- Fst_atimensec uint64
- Fst_mtime int64
- Fst_mtimensec uint64
- Fst_ctime int64
- Fst_ctimensec uint64
+ Fst_dev uint64
+ Fst_ino uint64
+ Fst_nlink uint64
+ Fst_mode uint32
+ Fst_uid uint32
+ Fst_gid uint32
+ F__pad0 int32
+ Fst_rdev uint64
+ Fst_size int64
+ Fst_blksize int64
+ Fst_blocks int64
+ Fst_atim struct {
+ Ftv_sec int64
+ Ftv_nsec int64
+ }
+ Fst_mtim struct {
+ Ftv_sec int64
+ Ftv_nsec int64
+ }
+ Fst_ctim struct {
+ Ftv_sec int64
+ Ftv_nsec int64
+ }
F__glibc_reserved [3]int64
}
@@ -54972,11 +59716,11 @@ type FsdirCsr = FsdirCsr1 /* test_fs.c:122:25 */
// argv[1] -> database name
// argv[2] -> table name
// argv[...] -> other module argument fields.
-func fsdirConnect1(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_fs.c:146:12: */
+func fsdirConnect1(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_fs.c:146:12: */
var pTab uintptr
if argc != 3 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+25185 /* "wrong number of ..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+27277 /* "wrong number of ..." */, 0)
return 1
}
@@ -54984,16 +59728,16 @@ func fsdirConnect1(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uint
if !(pTab != 0) {
return 7
}
- crt.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(FsdirVtab{})))
+ libc.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(FsdirVtab{})))
*(*uintptr)(unsafe.Pointer(ppVtab)) = (pTab /* &.base */)
- sqlite3.Xsqlite3_declare_vtab(tls, db, ts+27499 /* "CREATE TABLE xyz..." */)
+ sqlite3.Xsqlite3_declare_vtab(tls, db, ts+29591 /* "CREATE TABLE xyz..." */)
return 0
}
// xDestroy/xDisconnect implementation.
-func fsdirDisconnect1(tls *crt.TLS, pVtab uintptr) int32 { /* test_fs.c:173:12: */
+func fsdirDisconnect1(tls *libc.TLS, pVtab uintptr) int32 { /* test_fs.c:173:12: */
sqlite3.Xsqlite3_free(tls, pVtab)
return 0
}
@@ -55001,7 +59745,7 @@ func fsdirDisconnect1(tls *crt.TLS, pVtab uintptr) int32 { /* test_fs.c:173:12:
// xBestIndex implementation. The only constraint supported is:
//
// (dir = ?)
-func fsdirBestIndex1(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_fs.c:183:12: */
+func fsdirBestIndex1(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_fs.c:183:12: */
var ii int32
(*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 1000000000.0
@@ -55025,7 +59769,7 @@ func fsdirBestIndex1(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* tes
// xOpen implementation.
//
// Open a new fsdir cursor.
-func fsdirOpen1(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_fs.c:209:12: */
+func fsdirOpen1(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_fs.c:209:12: */
var pCur uintptr
// Allocate an extra 256 bytes because it is undefined how big dirent.d_name
// is and we need enough space. Linux provides plenty already, but
@@ -55034,16 +59778,16 @@ func fsdirOpen1(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_f
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(FsdirCsr{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(FsdirCsr{})))
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
return 0
}
// Close a fsdir cursor.
-func fsdirClose1(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:224:12: */
+func fsdirClose1(tls *libc.TLS, cur uintptr) int32 { /* test_fs.c:224:12: */
var pCur uintptr = cur
if (*FsdirCsr)(unsafe.Pointer(pCur)).FpDir != 0 {
- crt.Xclosedir(tls, (*FsdirCsr)(unsafe.Pointer(pCur)).FpDir)
+ libc.Xclosedir(tls, (*FsdirCsr)(unsafe.Pointer(pCur)).FpDir)
}
sqlite3.Xsqlite3_free(tls, (*FsdirCsr)(unsafe.Pointer(pCur)).FzDir)
sqlite3.Xsqlite3_free(tls, pCur)
@@ -55051,13 +59795,13 @@ func fsdirClose1(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:224:12: */
}
// Skip the cursor to the next entry.
-func fsdirNext1(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:235:12: */
+func fsdirNext1(tls *libc.TLS, cur uintptr) int32 { /* test_fs.c:235:12: */
var pCsr uintptr = cur
if (*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir != 0 {
- (*FsdirCsr)(unsafe.Pointer(pCsr)).FpEntry = crt.Xreaddir64(tls, (*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir)
+ (*FsdirCsr)(unsafe.Pointer(pCsr)).FpEntry = libc.Xreaddir64(tls, (*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir)
if (*FsdirCsr)(unsafe.Pointer(pCsr)).FpEntry == uintptr(0) {
- crt.Xclosedir(tls, (*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir)
+ libc.Xclosedir(tls, (*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir)
(*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir = uintptr(0)
}
(*FsdirCsr)(unsafe.Pointer(pCsr)).FiRowid++
@@ -55067,7 +59811,7 @@ func fsdirNext1(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:235:12: */
}
// xFilter method implementation.
-func fsdirFilter1(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_fs.c:253:12: */
+func fsdirFilter1(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_fs.c:253:12: */
var pCsr uintptr = pVtabCursor
var zDir uintptr
var nDir int32
@@ -55079,7 +59823,7 @@ func fsdirFilter1(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
(*FsdirCsr)(unsafe.Pointer(pCsr)).FiRowid = int64(0)
sqlite3.Xsqlite3_free(tls, (*FsdirCsr)(unsafe.Pointer(pCsr)).FzDir)
if (*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir != 0 {
- crt.Xclosedir(tls, (*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir)
+ libc.Xclosedir(tls, (*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir)
(*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir = uintptr(0)
}
@@ -55089,20 +59833,20 @@ func fsdirFilter1(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
if (*FsdirCsr)(unsafe.Pointer(pCsr)).FzDir == uintptr(0) {
return 7
}
- crt.Xmemcpy(tls, (*FsdirCsr)(unsafe.Pointer(pCsr)).FzDir, zDir, (uint64(nDir + 1)))
+ libc.Xmemcpy(tls, (*FsdirCsr)(unsafe.Pointer(pCsr)).FzDir, zDir, (uint64(nDir + 1)))
- (*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir = crt.Xopendir(tls, (*FsdirCsr)(unsafe.Pointer(pCsr)).FzDir)
+ (*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir = libc.Xopendir(tls, (*FsdirCsr)(unsafe.Pointer(pCsr)).FzDir)
return fsdirNext1(tls, pVtabCursor)
}
// xEof method implementation.
-func fsdirEof1(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:287:12: */
+func fsdirEof1(tls *libc.TLS, cur uintptr) int32 { /* test_fs.c:287:12: */
var pCsr uintptr = cur
- return (crt.Bool32((*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir == uintptr(0)))
+ return (libc.Bool32((*FsdirCsr)(unsafe.Pointer(pCsr)).FpDir == uintptr(0)))
}
// xColumn method implementation.
-func fsdirColumn1(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_fs.c:295:12: */
+func fsdirColumn1(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_fs.c:295:12: */
var pCsr uintptr = cur
switch i {
case 0: // dir
@@ -55110,7 +59854,7 @@ func fsdirColumn1(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* te
break
case 1: // name
- sqlite3.Xsqlite3_result_text(tls, ctx, (*FsdirCsr)(unsafe.Pointer(pCsr)).FpEntry+19 /* &.d_name */, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, (*FsdirCsr)(unsafe.Pointer(pCsr)).FpEntry+19 /* &.d_name */, -1, libc.UintptrFromInt32(-1))
break
default:
@@ -55120,7 +59864,7 @@ func fsdirColumn1(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* te
}
// xRowid method implementation.
-func fsdirRowid1(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* test_fs.c:316:12: */
+func fsdirRowid1(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* test_fs.c:316:12: */
var pCsr uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*FsdirCsr)(unsafe.Pointer(pCsr)).FiRowid
return 0
@@ -55164,11 +59908,11 @@ type FstreeCsr = FstreeCsr1 /* test_fs.c:329:26 */
// argv[1] -> database name
// argv[2] -> table name
// argv[...] -> other module argument fields.
-func fstreeConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_fs.c:352:12: */
+func fstreeConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_fs.c:352:12: */
var pTab uintptr
if argc != 3 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+25185 /* "wrong number of ..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+27277 /* "wrong number of ..." */, 0)
return 1
}
@@ -55176,17 +59920,17 @@ func fstreeConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uint
if !(pTab != 0) {
return 7
}
- crt.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(FstreeVtab{})))
+ libc.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(FstreeVtab{})))
(*FstreeVtab)(unsafe.Pointer(pTab)).Fdb = db
*(*uintptr)(unsafe.Pointer(ppVtab)) = (pTab /* &.base */)
- sqlite3.Xsqlite3_declare_vtab(tls, db, ts+27528 /* "CREATE TABLE xyz..." */)
+ sqlite3.Xsqlite3_declare_vtab(tls, db, ts+29620 /* "CREATE TABLE xyz..." */)
return 0
}
// xDestroy/xDisconnect implementation.
-func fstreeDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* test_fs.c:380:12: */
+func fstreeDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* test_fs.c:380:12: */
sqlite3.Xsqlite3_free(tls, pVtab)
return 0
}
@@ -55194,7 +59938,7 @@ func fstreeDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* test_fs.c:380:12:
// xBestIndex implementation. The only constraint supported is:
//
// (dir = ?)
-func fstreeBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_fs.c:390:12: */
+func fstreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_fs.c:390:12: */
var ii int32
for ii = 0; ii < (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint; ii++ {
@@ -55218,27 +59962,27 @@ func fstreeBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* tes
// xOpen implementation.
//
// Open a new fstree cursor.
-func fstreeOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_fs.c:418:12: */
+func fstreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_fs.c:418:12: */
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(FstreeCsr{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(FstreeCsr{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(FstreeCsr{})))
(*FstreeCsr)(unsafe.Pointer(pCur)).Ffd = -1
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
return 0
}
-func fstreeCloseFd(tls *crt.TLS, pCsr uintptr) { /* test_fs.c:428:13: */
+func fstreeCloseFd(tls *libc.TLS, pCsr uintptr) { /* test_fs.c:428:13: */
if (*FstreeCsr)(unsafe.Pointer(pCsr)).Ffd >= 0 {
- crt.Xclose(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).Ffd)
+ libc.Xclose(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).Ffd)
(*FstreeCsr)(unsafe.Pointer(pCsr)).Ffd = -1
}
}
// Close a fstree cursor.
-func fstreeClose(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:438:12: */
+func fstreeClose(tls *libc.TLS, cur uintptr) int32 { /* test_fs.c:438:12: */
var pCsr uintptr = cur
sqlite3.Xsqlite3_finalize(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).FpStmt)
fstreeCloseFd(tls, pCsr)
@@ -55247,7 +59991,7 @@ func fstreeClose(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:438:12: */
}
// Skip the cursor to the next entry.
-func fstreeNext(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:449:12: */
+func fstreeNext(tls *libc.TLS, cur uintptr) int32 { /* test_fs.c:449:12: */
var pCsr uintptr = cur
var rc int32
@@ -55258,21 +60002,21 @@ func fstreeNext(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:449:12: */
(*FstreeCsr)(unsafe.Pointer(pCsr)).FpStmt = uintptr(0)
} else {
rc = 0
- (*FstreeCsr)(unsafe.Pointer(pCsr)).Ffd = crt.Xopen64(tls, sqlite3.Xsqlite3_column_text(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).FpStmt, 0), 00, 0)
+ (*FstreeCsr)(unsafe.Pointer(pCsr)).Ffd = libc.Xopen64(tls, sqlite3.Xsqlite3_column_text(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).FpStmt, 0), 00, 0)
}
return rc
}
// xFilter method implementation.
-func fstreeFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_fs.c:469:12: */
+func fstreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_fs.c:469:12: */
bp := tls.Alloc(2)
defer tls.Free(2)
var pCsr uintptr = pVtabCursor
var pTab uintptr = (*FstreeCsr)(unsafe.Pointer(pCsr)).Fbase.FpVtab
var rc int32
- var zSql uintptr = ts + 27564 /* "WITH r(d) AS ( ..." */
+ var zSql uintptr = ts + 29656 /* "WITH r(d) AS ( ..." */
var zRoot uintptr
var nRoot int32
var zPrefix uintptr
@@ -55281,7 +60025,7 @@ func fstreeFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
var nDir int32
*(*[2]int8)(unsafe.Pointer(bp /* aWild */)) = [2]int8{int8(0), int8(0)}
- zRoot = ts + 27796 /* "/" */
+ zRoot = ts + 29888 /* "/" */
nRoot = 1
zPrefix = ts + 488 /* "" */
nPrefix = 0
@@ -55328,21 +60072,21 @@ func fstreeFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
nDir = 1
}
- sqlite3.Xsqlite3_bind_text(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).FpStmt, 1, zDir, nDir, crt.UintptrFromInt32(-1))
- sqlite3.Xsqlite3_bind_text(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).FpStmt, 2, zRoot, nRoot, crt.UintptrFromInt32(-1))
- sqlite3.Xsqlite3_bind_text(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).FpStmt, 3, zPrefix, nPrefix, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_bind_text(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).FpStmt, 1, zDir, nDir, libc.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_bind_text(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).FpStmt, 2, zRoot, nRoot, libc.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_bind_text(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).FpStmt, 3, zPrefix, nPrefix, libc.UintptrFromInt32(-1))
return fstreeNext(tls, pVtabCursor)
}
// xEof method implementation.
-func fstreeEof(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:557:12: */
+func fstreeEof(tls *libc.TLS, cur uintptr) int32 { /* test_fs.c:557:12: */
var pCsr uintptr = cur
- return (crt.Bool32((*FstreeCsr)(unsafe.Pointer(pCsr)).FpStmt == uintptr(0)))
+ return (libc.Bool32((*FstreeCsr)(unsafe.Pointer(pCsr)).FpStmt == uintptr(0)))
}
// xColumn method implementation.
-func fstreeColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_fs.c:565:12: */
+func fstreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_fs.c:565:12: */
bp := tls.Alloc(144)
defer tls.Free(144)
@@ -55352,7 +60096,7 @@ func fstreeColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* te
} else {
// var sBuf stat64 at bp, 144
- crt.Xfstat64(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).Ffd, bp /* &sBuf */)
+ libc.Xfstat64(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).Ffd, bp /* &sBuf */)
if (((*stat64)(unsafe.Pointer(bp /* &sBuf */)).Fst_mode) & uint32(0170000)) == (uint32(0100000)) {
if i == 1 {
@@ -55363,11 +60107,11 @@ func fstreeColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* te
if !(aBuf != 0) {
return 7
}
- nRead = int32(crt.Xread(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).Ffd, aBuf, uint64((*stat64)(unsafe.Pointer(bp /* &sBuf */)).Fst_mode)))
+ nRead = int32(libc.Xread(tls, (*FstreeCsr)(unsafe.Pointer(pCsr)).Ffd, aBuf, uint64((*stat64)(unsafe.Pointer(bp /* &sBuf */)).Fst_mode)))
if uint32(nRead) != (*stat64)(unsafe.Pointer(bp /* &sBuf */)).Fst_mode {
return 10
}
- sqlite3.Xsqlite3_result_blob(tls, ctx, aBuf, nRead, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_blob(tls, ctx, aBuf, nRead, libc.UintptrFromInt32(-1))
sqlite3.Xsqlite3_free(tls, aBuf)
}
}
@@ -55377,7 +60121,7 @@ func fstreeColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* te
}
// xRowid method implementation.
-func fstreeRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* test_fs.c:596:12: */
+func fstreeRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* test_fs.c:596:12: */
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = int64(0)
return 0
}
@@ -55395,31 +60139,31 @@ func fstreeRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* test_fs.c
// argv[1] -> database name
// argv[2] -> table name
// argv[...] -> other module argument fields.
-func fsConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_fs.c:618:12: */
+func fsConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_fs.c:618:12: */
var pVtab uintptr
var nByte int32
var zTbl uintptr
var zDb uintptr = *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))
if argc != 4 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+25185 /* "wrong number of ..." */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = sqlite3.Xsqlite3_mprintf(tls, ts+27277 /* "wrong number of ..." */, 0)
return 1
}
zTbl = *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))
- nByte = (int32((((uint64(unsafe.Sizeof(fs_vtab{})) + uint64(int32(crt.Xstrlen(tls, zTbl)))) + uint64(1)) + uint64(int32(crt.Xstrlen(tls, zDb)))) + uint64(1)))
+ nByte = (int32((((uint64(unsafe.Sizeof(fs_vtab{})) + uint64(int32(libc.Xstrlen(tls, zTbl)))) + uint64(1)) + uint64(int32(libc.Xstrlen(tls, zDb)))) + uint64(1)))
pVtab = sqlite3.Xsqlite3MallocZero(tls, uint64(nByte))
if !(pVtab != 0) {
return 7
}
(*fs_vtab)(unsafe.Pointer(pVtab)).FzTbl = (pVtab + uintptr(1)*48)
- (*fs_vtab)(unsafe.Pointer(pVtab)).FzDb = ((*fs_vtab)(unsafe.Pointer(pVtab)).FzTbl + uintptr((crt.Xstrlen(tls, zTbl) + uint64(1))))
+ (*fs_vtab)(unsafe.Pointer(pVtab)).FzDb = ((*fs_vtab)(unsafe.Pointer(pVtab)).FzTbl + uintptr((libc.Xstrlen(tls, zTbl) + uint64(1))))
(*fs_vtab)(unsafe.Pointer(pVtab)).Fdb = db
- crt.Xmemcpy(tls, (*fs_vtab)(unsafe.Pointer(pVtab)).FzTbl, zTbl, crt.Xstrlen(tls, zTbl))
- crt.Xmemcpy(tls, (*fs_vtab)(unsafe.Pointer(pVtab)).FzDb, zDb, crt.Xstrlen(tls, zDb))
+ libc.Xmemcpy(tls, (*fs_vtab)(unsafe.Pointer(pVtab)).FzTbl, zTbl, libc.Xstrlen(tls, zTbl))
+ libc.Xmemcpy(tls, (*fs_vtab)(unsafe.Pointer(pVtab)).FzDb, zDb, libc.Xstrlen(tls, zDb))
*(*uintptr)(unsafe.Pointer(ppVtab)) = (pVtab /* &.base */)
- sqlite3.Xsqlite3_declare_vtab(tls, db, ts+27798 /* "CREATE TABLE x(p..." */)
+ sqlite3.Xsqlite3_declare_vtab(tls, db, ts+29890 /* "CREATE TABLE x(p..." */)
return 0
}
@@ -55427,7 +60171,7 @@ func fsConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr,
// Note that for this virtual table, the xCreate and xConnect
// methods are identical.
-func fsDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* test_fs.c:653:12: */
+func fsDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* test_fs.c:653:12: */
sqlite3.Xsqlite3_free(tls, pVtab)
return 0
}
@@ -55435,7 +60179,7 @@ func fsDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* test_fs.c:653:12: */
// The xDisconnect and xDestroy methods are also the same
// Open a new fs cursor.
-func fsOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_fs.c:662:12: */
+func fsOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_fs.c:662:12: */
var pCur uintptr
pCur = sqlite3.Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(fs_cursor{})))
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
@@ -55443,7 +60187,7 @@ func fsOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_fs.c:
}
// Close a fs cursor.
-func fsClose(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:672:12: */
+func fsClose(tls *libc.TLS, cur uintptr) int32 { /* test_fs.c:672:12: */
var pCur uintptr = cur
sqlite3.Xsqlite3_finalize(tls, (*fs_cursor)(unsafe.Pointer(pCur)).FpStmt)
sqlite3.Xsqlite3_free(tls, (*fs_cursor)(unsafe.Pointer(pCur)).FzBuf)
@@ -55451,7 +60195,7 @@ func fsClose(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:672:12: */
return 0
}
-func fsNext(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:680:12: */
+func fsNext(tls *libc.TLS, cur uintptr) int32 { /* test_fs.c:680:12: */
var pCur uintptr = cur
var rc int32
@@ -55463,7 +60207,7 @@ func fsNext(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:680:12: */
return rc
}
-func fsFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_fs.c:690:12: */
+func fsFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_fs.c:690:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -55473,7 +60217,7 @@ func fsFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, a
if idxNum == 1 {
var zStmt uintptr = sqlite3.Xsqlite3_mprintf(tls,
- ts+27835 /* "SELECT * FROM %Q..." */, crt.VaList(bp, (*fs_vtab)(unsafe.Pointer(p)).FzDb, (*fs_vtab)(unsafe.Pointer(p)).FzTbl))
+ ts+29927 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*fs_vtab)(unsafe.Pointer(p)).FzDb, (*fs_vtab)(unsafe.Pointer(p)).FzTbl))
if !(zStmt != 0) {
return 7
}
@@ -55483,7 +60227,7 @@ func fsFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, a
sqlite3.Xsqlite3_bind_value(tls, (*fs_cursor)(unsafe.Pointer(pCur)).FpStmt, 1, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
}
} else {
- var zStmt uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+2065 /* "SELECT * FROM %Q..." */, crt.VaList(bp+16, (*fs_vtab)(unsafe.Pointer(p)).FzDb, (*fs_vtab)(unsafe.Pointer(p)).FzTbl))
+ var zStmt uintptr = sqlite3.Xsqlite3_mprintf(tls, ts+3221 /* "SELECT * FROM %Q..." */, libc.VaList(bp+16, (*fs_vtab)(unsafe.Pointer(p)).FzDb, (*fs_vtab)(unsafe.Pointer(p)).FzTbl))
if !(zStmt != 0) {
return 7
}
@@ -55497,7 +60241,7 @@ func fsFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, a
return rc
}
-func fsColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_fs.c:722:12: */
+func fsColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_fs.c:722:12: */
bp := tls.Alloc(144)
defer tls.Free(144)
@@ -55511,11 +60255,11 @@ func fsColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_f
var fd int32
var n int32
- fd = crt.Xopen64(tls, zFile, 00, 0)
+ fd = libc.Xopen64(tls, zFile, 00, 0)
if fd < 0 {
return 10
}
- crt.Xfstat64(tls, fd, bp /* &sbuf */)
+ libc.Xfstat64(tls, fd, bp /* &sbuf */)
if (*stat64)(unsafe.Pointer(bp /* &sbuf */)).Fst_size >= int64((*fs_cursor)(unsafe.Pointer(pCur)).FnAlloc) {
var nNew sqlite3_int64 = (sqlite3_int64((*stat64)(unsafe.Pointer(bp /* &sbuf */)).Fst_size * int64(2)))
@@ -55526,38 +60270,38 @@ func fsColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_f
zNew = sqlite3.Xsqlite3Realloc(tls, (*fs_cursor)(unsafe.Pointer(pCur)).FzBuf, uint64(nNew))
if zNew == uintptr(0) {
- crt.Xclose(tls, fd)
+ libc.Xclose(tls, fd)
return 7
}
(*fs_cursor)(unsafe.Pointer(pCur)).FzBuf = zNew
(*fs_cursor)(unsafe.Pointer(pCur)).FnAlloc = int32(nNew)
}
- n = int32(crt.Xread(tls, fd, (*fs_cursor)(unsafe.Pointer(pCur)).FzBuf, uint64((*stat64)(unsafe.Pointer(bp /* &sbuf */)).Fst_size)))
- crt.Xclose(tls, fd)
+ n = int32(libc.Xread(tls, fd, (*fs_cursor)(unsafe.Pointer(pCur)).FzBuf, uint64((*stat64)(unsafe.Pointer(bp /* &sbuf */)).Fst_size)))
+ libc.Xclose(tls, fd)
if int64(n) != (*stat64)(unsafe.Pointer(bp /* &sbuf */)).Fst_size {
return 1
}
(*fs_cursor)(unsafe.Pointer(pCur)).FnBuf = int32((*stat64)(unsafe.Pointer(bp /* &sbuf */)).Fst_size)
*(*int8)(unsafe.Pointer((*fs_cursor)(unsafe.Pointer(pCur)).FzBuf + uintptr((*fs_cursor)(unsafe.Pointer(pCur)).FnBuf))) = int8(0)
- sqlite3.Xsqlite3_result_text(tls, ctx, (*fs_cursor)(unsafe.Pointer(pCur)).FzBuf, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, (*fs_cursor)(unsafe.Pointer(pCur)).FzBuf, -1, libc.UintptrFromInt32(-1))
}
return 0
}
-func fsRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* test_fs.c:763:12: */
+func fsRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* test_fs.c:763:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = sqlite3.Xsqlite3_column_int64(tls, (*fs_cursor)(unsafe.Pointer(pCur)).FpStmt, 0)
return 0
}
-func fsEof(tls *crt.TLS, cur uintptr) int32 { /* test_fs.c:769:12: */
+func fsEof(tls *libc.TLS, cur uintptr) int32 { /* test_fs.c:769:12: */
var pCur uintptr = cur
- return (crt.Bool32(sqlite3.Xsqlite3_data_count(tls, (*fs_cursor)(unsafe.Pointer(pCur)).FpStmt) == 0))
+ return (libc.Bool32(sqlite3.Xsqlite3_data_count(tls, (*fs_cursor)(unsafe.Pointer(pCur)).FpStmt) == 0))
}
-func fsBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_fs.c:774:12: */
+func fsBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_fs.c:774:12: */
var ii int32
for ii = 0; ii < (*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint; ii++ {
@@ -55641,7 +60385,7 @@ uintptr(0), // xRename
} /* test_fs.c:844:23 */
// Register the echo virtual table module.
-func register_fs_module(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_fs.c:875:26: */
+func register_fs_module(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_fs.c:875:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -55654,38 +60398,38 @@ func register_fs_module(tls *crt.TLS, clientData ClientData, interp uintptr, obj
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
return 1
}
- sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+27869 /* "fs" */, uintptr(unsafe.Pointer(&fsModule)), interp)
- sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+3799 /* "fsdir" */, uintptr(unsafe.Pointer(&fsdirModule)), uintptr(0))
- sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+27872 /* "fstree" */, uintptr(unsafe.Pointer(&fstreeModule)), uintptr(0))
+ sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+29961 /* "fs" */, uintptr(unsafe.Pointer(&fsModule)), interp)
+ sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+5016 /* "fsdir" */, uintptr(unsafe.Pointer(&fsdirModule)), uintptr(0))
+ sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+29964 /* "fstree" */, uintptr(unsafe.Pointer(&fstreeModule)), uintptr(0))
return 0
}
// Register commands with the TCL interpreter.
-func Sqlitetestfs_Init(tls *crt.TLS, interp uintptr) int32 { /* test_fs.c:901:5: */
+func Sqlitetestfs_Init(tls *libc.TLS, interp uintptr) int32 { /* test_fs.c:901:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd5)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd6)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd5[i].FzName,
- aObjCmd5[i].FxProc, aObjCmd5[i].FclientData, uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd6[i].FzName,
+ aObjCmd6[i].FxProc, aObjCmd6[i].FclientData, uintptr(0))
}
return 0
}
-var aObjCmd5 = [1]struct {
+var aObjCmd6 = [1]struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{
- {FzName: ts + 27879 /* "register_fs_modu..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 29971 /* "register_fs_modu..." */, FxProc: 0, FclientData: uintptr(0)},
} /* test_fs.c:907:5 */
// Allocate nByte bytes of space using sqlite3_malloc(). If the
// allocation fails, call sqlite3_result_error_nomem() to notify
// the database handle that malloc() has failed.
-func testContextMalloc(tls *crt.TLS, context uintptr, nByte int32) uintptr { /* test_func.c:33:13: */
+func testContextMalloc(tls *libc.TLS, context uintptr, nByte int32) uintptr { /* test_func.c:33:13: */
var z uintptr = sqlite3.Xsqlite3_malloc(tls, nByte)
if !(z != 0) && (nByte > 0) {
sqlite3.Xsqlite3_result_error_nomem(tls, context)
@@ -55695,7 +60439,7 @@ func testContextMalloc(tls *crt.TLS, context uintptr, nByte int32) uintptr { /*
// This function generates a string of random characters. Used for
// generating test data.
-func randStr(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:45:13: */
+func randStr(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:45:13: */
bp := tls.Alloc(1004)
defer tls.Free(1004)
@@ -55736,10 +60480,10 @@ func randStr(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test_
*(*uint8)(unsafe.Pointer(bp + 4 /* &zBuf[0] */ + uintptr(i))) = zSrc[(uint64(*(*uint8)(unsafe.Pointer(bp + 4 /* &zBuf[0] */ + uintptr(i)))) % (uint64(unsafe.Sizeof(zSrc)) - uint64(1)))]
}
*(*uint8)(unsafe.Pointer(bp + 4 /* &zBuf[0] */ + uintptr(n))) = uint8(0)
- sqlite3.Xsqlite3_result_text(tls, context, bp+4 /* zBuf */, n, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, context, bp+4 /* zBuf */, n, libc.UintptrFromInt32(-1))
}
-var zSrc = *(*[79]uint8)(unsafe.Pointer(ts + 27898 /* "abcdefghijklmnop..." */)) /* test_func.c:46:30 */
+var zSrc = *(*[79]uint8)(unsafe.Pointer(ts + 29990 /* "abcdefghijklmnop..." */)) /* test_func.c:46:30 */
// The following two SQL functions are used to test returning a text
// result with a destructor. Function 'test_destructor' takes one argument
@@ -55751,14 +60495,14 @@ var zSrc = *(*[79]uint8)(unsafe.Pointer(ts + 27898 /* "abcdefghijklmnop..." */))
//
// WARNING: Not threadsafe.
var test_destructor_count_var int32 = 0 /* test_func.c:91:12 */
-func destructor(tls *crt.TLS, p uintptr) { /* test_func.c:92:13: */
+func destructor(tls *libc.TLS, p uintptr) { /* test_func.c:92:13: */
var zVal uintptr = p
zVal--
sqlite3.Xsqlite3_free(tls, zVal)
test_destructor_count_var--
}
-func test_destructor(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:99:13: */
+func test_destructor(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:99:13: */
var zVal uintptr
var len int32
@@ -55775,10 +60519,10 @@ func test_destructor(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /*
*(*int8)(unsafe.Pointer(zVal + uintptr((len + 1)))) = int8(0)
*(*int8)(unsafe.Pointer(zVal + uintptr((len + 2)))) = int8(0)
zVal++
- crt.Xmemcpy(tls, zVal, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))), uint64(len))
- sqlite3.Xsqlite3_result_text(tls, pCtx, zVal, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{destructor})))
+ libc.Xmemcpy(tls, zVal, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))), uint64(len))
+ sqlite3.Xsqlite3_result_text(tls, pCtx, zVal, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{destructor})))
}
-func test_destructor16(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:122:13: */
+func test_destructor16(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:122:13: */
var zVal uintptr
var len int32
@@ -55795,20 +60539,20 @@ func test_destructor16(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /
*(*int8)(unsafe.Pointer(zVal + uintptr((len + 1)))) = int8(0)
*(*int8)(unsafe.Pointer(zVal + uintptr((len + 2)))) = int8(0)
zVal++
- crt.Xmemcpy(tls, zVal, sqlite3.Xsqlite3_value_text16(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))), uint64(len))
- sqlite3.Xsqlite3_result_text16(tls, pCtx, zVal, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{destructor})))
+ libc.Xmemcpy(tls, zVal, sqlite3.Xsqlite3_value_text16(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))), uint64(len))
+ sqlite3.Xsqlite3_result_text16(tls, pCtx, zVal, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{destructor})))
}
-func test_destructor_count(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:145:13: */
+func test_destructor_count(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:145:13: */
sqlite3.Xsqlite3_result_int(tls, pCtx, test_destructor_count_var)
}
-func test_agg_errmsg16_step(tls *crt.TLS, a uintptr, b int32, c uintptr) { /* test_func.c:165:13: */
+func test_agg_errmsg16_step(tls *libc.TLS, a uintptr, b int32, c uintptr) { /* test_func.c:165:13: */
}
-func test_agg_errmsg16_final(tls *crt.TLS, ctx uintptr) { /* test_func.c:167:13: */
+func test_agg_errmsg16_final(tls *libc.TLS, ctx uintptr) { /* test_func.c:167:13: */
var z uintptr
var db uintptr = sqlite3.Xsqlite3_context_db_handle(tls, ctx)
sqlite3.Xsqlite3_aggregate_context(tls, ctx, 2048)
z = sqlite3.Xsqlite3_errmsg16(tls, db)
- sqlite3.Xsqlite3_result_text16(tls, ctx, z, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text16(tls, ctx, z, -1, libc.UintptrFromInt32(-1))
}
// Routines for testing the sqlite3_get_auxdata() and sqlite3_set_auxdata()
@@ -55820,16 +60564,16 @@ func test_agg_errmsg16_final(tls *crt.TLS, ctx uintptr) { /* test_func.c:167:13:
// call) then the result for that argument is 0. If there is a prior
// registration, the result for that argument is 1. The overall result
// is the individual argument results separated by spaces.
-func free_test_auxdata(tls *crt.TLS, p uintptr) { /* test_func.c:188:13: */
+func free_test_auxdata(tls *libc.TLS, p uintptr) { /* test_func.c:188:13: */
sqlite3.Xsqlite3_free(tls, p)
}
-func test_auxdata(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:189:13: */
+func test_auxdata(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:189:13: */
var i int32
var zRet uintptr = testContextMalloc(tls, pCtx, (nArg * 2))
if !(zRet != 0) {
return
}
- crt.Xmemset(tls, zRet, 0, (uint64(nArg * 2)))
+ libc.Xmemset(tls, zRet, 0, (uint64(nArg * 2)))
for i = 0; i < nArg; i++ {
var z uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
if z != 0 {
@@ -55840,22 +60584,22 @@ func test_auxdata(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* tes
} else {
*(*int8)(unsafe.Pointer(zRet + uintptr((i * 2)))) = int8('0')
}
- n = (int32(crt.Xstrlen(tls, z)) + 1)
+ n = (int32(libc.Xstrlen(tls, z)) + 1)
zAux = testContextMalloc(tls, pCtx, n)
if zAux != 0 {
- crt.Xmemcpy(tls, zAux, z, uint64(n))
- sqlite3.Xsqlite3_set_auxdata(tls, pCtx, i, zAux, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{free_test_auxdata})))
+ libc.Xmemcpy(tls, zAux, z, uint64(n))
+ sqlite3.Xsqlite3_set_auxdata(tls, pCtx, i, zAux, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{free_test_auxdata})))
}
*(*int8)(unsafe.Pointer(zRet + uintptr(((i * 2) + 1)))) = int8(' ')
}
}
- sqlite3.Xsqlite3_result_text(tls, pCtx, zRet, ((2 * nArg) - 1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{free_test_auxdata})))
+ sqlite3.Xsqlite3_result_text(tls, pCtx, zRet, ((2 * nArg) - 1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{free_test_auxdata})))
}
// A function to test error reporting from user functions. This function
// returns a copy of its first argument as the error message. If the
// second argument exists, it becomes the error code.
-func test_error(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:226:13: */
+func test_error(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:226:13: */
sqlite3.Xsqlite3_result_error(tls, pCtx, sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))), -1)
if nArg == 2 {
sqlite3.Xsqlite3_result_error_code(tls, pCtx, sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
@@ -55866,7 +60610,7 @@ func test_error(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_
// constant, then the first invocation will return X. The second X+1.
// and so forth. Can be used (for example) to provide a sequence number
// in a result set.
-func counterFunc(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:243:13: */
+func counterFunc(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:243:13: */
var pCounter uintptr = sqlite3.Xsqlite3_get_auxdata(tls, pCtx, 0)
if pCounter == uintptr(0) {
pCounter = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(int32(0))))
@@ -55875,7 +60619,7 @@ func counterFunc(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test
return
}
*(*int32)(unsafe.Pointer(pCounter)) = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- sqlite3.Xsqlite3_set_auxdata(tls, pCtx, 0, pCounter, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ sqlite3.Xsqlite3_set_auxdata(tls, pCtx, 0, pCounter, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
} else {
*(*int32)(unsafe.Pointer(pCounter))++
}
@@ -55892,7 +60636,7 @@ func counterFunc(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test
//
// We want to verify that the type conversions that occur on the
// first argument do not invalidate the second argument.
-func test_isolation(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:276:13: */
+func test_isolation(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:276:13: */
sqlite3.Xsqlite3_value_text16(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
sqlite3.Xsqlite3_value_text16(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
@@ -55902,7 +60646,7 @@ func test_isolation(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* t
// Invoke an SQL statement recursively. The function result is the
// first column of the first row of the result set.
-func test_eval(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:294:13: */
+func test_eval(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:294:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -55924,14 +60668,14 @@ func test_eval(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_f
if rc != 0 {
var zErr uintptr
- zErr = sqlite3.Xsqlite3_mprintf(tls, ts+27977 /* "sqlite3_prepare_..." */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, db)))
- sqlite3.Xsqlite3_result_text(tls, pCtx, zErr, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ zErr = sqlite3.Xsqlite3_mprintf(tls, ts+30069 /* "sqlite3_prepare_..." */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, db)))
+ sqlite3.Xsqlite3_result_text(tls, pCtx, zErr, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
sqlite3.Xsqlite3_result_error_code(tls, pCtx, rc)
}
}
// convert one character from hex to binary
-func testHexChar(tls *crt.TLS, c int8) int32 { /* test_func.c:326:12: */
+func testHexChar(tls *libc.TLS, c int8) int32 { /* test_func.c:326:12: */
if (int32(c) >= '0') && (int32(c) <= '9') {
return (int32(c) - '0')
} else if (int32(c) >= 'a') && (int32(c) <= 'f') {
@@ -55943,9 +60687,9 @@ func testHexChar(tls *crt.TLS, c int8) int32 { /* test_func.c:326:12: */
}
// Convert hex to binary.
-func testHexToBin(tls *crt.TLS, zIn uintptr, zOut uintptr) { /* test_func.c:340:13: */
+func testHexToBin(tls *libc.TLS, zIn uintptr, zOut uintptr) { /* test_func.c:340:13: */
for (*(*int8)(unsafe.Pointer(zIn + uintptr(0))) != 0) && (*(*int8)(unsafe.Pointer(zIn + uintptr(1))) != 0) {
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zOut, 1))) = (int8((testHexChar(tls, *(*int8)(unsafe.Pointer(zIn + uintptr(0)))) << 4) + testHexChar(tls, *(*int8)(unsafe.Pointer(zIn + uintptr(1))))))
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8((testHexChar(tls, *(*int8)(unsafe.Pointer(zIn + uintptr(0)))) << 4) + testHexChar(tls, *(*int8)(unsafe.Pointer(zIn + uintptr(1))))))
zIn += uintptr(2)
}
}
@@ -55954,7 +60698,7 @@ func testHexToBin(tls *crt.TLS, zIn uintptr, zOut uintptr) { /* test_func.c:340:
//
// Convert the input string from HEX into binary. Then return the
// result using sqlite3_result_text16le().
-func testHexToUtf16be(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:354:13: */
+func testHexToUtf16be(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:354:13: */
var n int32
var zIn uintptr
var zOut uintptr
@@ -55966,7 +60710,7 @@ func testHexToUtf16be(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /*
sqlite3.Xsqlite3_result_error_nomem(tls, pCtx)
} else {
testHexToBin(tls, zIn, zOut)
- sqlite3.Xsqlite3_result_text16be(tls, pCtx, zOut, (n / 2), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ sqlite3.Xsqlite3_result_text16be(tls, pCtx, zOut, (n / 2), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
}
}
@@ -55974,7 +60718,7 @@ func testHexToUtf16be(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /*
//
// Convert the input string from HEX into binary. Then return the
// result using sqlite3_result_text16le().
-func testHexToUtf8(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:381:13: */
+func testHexToUtf8(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:381:13: */
var n int32
var zIn uintptr
var zOut uintptr
@@ -55986,7 +60730,7 @@ func testHexToUtf8(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* te
sqlite3.Xsqlite3_result_error_nomem(tls, pCtx)
} else {
testHexToBin(tls, zIn, zOut)
- sqlite3.Xsqlite3_result_text(tls, pCtx, zOut, (n / 2), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ sqlite3.Xsqlite3_result_text(tls, pCtx, zOut, (n / 2), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
}
}
@@ -55994,7 +60738,7 @@ func testHexToUtf8(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* te
//
// Convert the input string from HEX into binary. Then return the
// result using sqlite3_result_text16le().
-func testHexToUtf16le(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:408:13: */
+func testHexToUtf16le(tls *libc.TLS, pCtx uintptr, nArg int32, argv uintptr) { /* test_func.c:408:13: */
var n int32
var zIn uintptr
var zOut uintptr
@@ -56006,7 +60750,7 @@ func testHexToUtf16le(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /*
sqlite3.Xsqlite3_result_error_nomem(tls, pCtx)
} else {
testHexToBin(tls, zIn, zOut)
- sqlite3.Xsqlite3_result_text16le(tls, pCtx, zOut, (n / 2), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ sqlite3.Xsqlite3_result_text16le(tls, pCtx, zOut, (n / 2), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
}
}
@@ -56015,7 +60759,7 @@ func testHexToUtf16le(tls *crt.TLS, pCtx uintptr, nArg int32, argv uintptr) { /*
// If argument X is a real number, then convert it into a string which is
// the big-endian hexadecimal representation of the ieee754 encoding of
// that number. If X is not a real number, return NULL.
-func real2hex(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:436:13: */
+func real2hex(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:436:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -56026,19 +60770,19 @@ func real2hex(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test
var i int32
var bigEndian int32
*(*sqlite3_uint64)(unsafe.Pointer(bp /* &v */)) = uint64(1)
- bigEndian = (crt.Bool32(int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(0)))) == 0))
+ bigEndian = (libc.Bool32(int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(0)))) == 0))
*(*float64)(unsafe.Pointer(bp /* &v */)) = sqlite3.Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
for i = 0; i < 8; i++ {
if bigEndian != 0 {
- *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr((i * 2)))) = *(*int8)(unsafe.Pointer(ts + 28008 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) >> 4))))
- *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr(((i * 2) + 1)))) = *(*int8)(unsafe.Pointer(ts + 28008 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) & 0xf))))
+ *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr((i * 2)))) = *(*int8)(unsafe.Pointer(ts + 30100 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) >> 4))))
+ *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr(((i * 2) + 1)))) = *(*int8)(unsafe.Pointer(ts + 30100 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) & 0xf))))
} else {
- *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr((14 - (i * 2))))) = *(*int8)(unsafe.Pointer(ts + 28008 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) >> 4))))
- *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr(((14 - (i * 2)) + 1)))) = *(*int8)(unsafe.Pointer(ts + 28008 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) & 0xf))))
+ *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr((14 - (i * 2))))) = *(*int8)(unsafe.Pointer(ts + 30100 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) >> 4))))
+ *(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr(((14 - (i * 2)) + 1)))) = *(*int8)(unsafe.Pointer(ts + 30100 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer((bp /* &v */ /* &.x */) + uintptr(i)))) & 0xf))))
}
}
*(*int8)(unsafe.Pointer(bp + 8 /* &zOut[0] */ + uintptr(16))) = int8(0)
- sqlite3.Xsqlite3_result_text(tls, context, bp+8 /* &zOut[0] */, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, context, bp+8 /* &zOut[0] */, -1, libc.UintptrFromInt32(-1))
}
// test_extract(record, field)
@@ -56047,7 +60791,7 @@ func real2hex(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test
// containing a formatted database record as the first argument. The
// second argument is the index of the field within that record to
// extract and return.
-func test_extract(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:473:13: */
+func test_extract(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:473:13: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -56065,18 +60809,18 @@ func test_extract(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
iIdx = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
pHdr = (pRec + uintptr(sqlite3.Xsqlite3GetVarint(tls, pRec, bp /* &nHdr */)))
- pBody = crt.AssignUintptr(&pEndHdr, (pRec + uintptr(*(*u64)(unsafe.Pointer(bp /* nHdr */)))))
+ pBody = libc.AssignUintptr(&pEndHdr, (pRec + uintptr(*(*u64)(unsafe.Pointer(bp /* nHdr */)))))
for iCurrent = 0; (pHdr < pEndHdr) && (iCurrent <= iIdx); iCurrent++ {
// var iSerialType u64 at bp+64, 8
// var mem Mem at bp+8, 56
- crt.Xmemset(tls, bp+8 /* &mem */, 0, uint64(unsafe.Sizeof(Mem{})))
+ libc.Xmemset(tls, bp+8 /* &mem */, 0, uint64(unsafe.Sizeof(Mem{})))
(*Mem)(unsafe.Pointer(bp + 8 /* &mem */)).Fdb = db
(*Mem)(unsafe.Pointer(bp + 8 /* &mem */)).Fenc = (*sqlite31)(unsafe.Pointer(db)).Fenc
pHdr += uintptr(sqlite3.Xsqlite3GetVarint(tls, pHdr, bp+64 /* &iSerialType */))
- pBody += uintptr(sqlite3.Xsqlite3VdbeSerialGet(tls, pBody, u321(*(*u64)(unsafe.Pointer(bp + 64 /* iSerialType */))), bp+8 /* &mem */))
+ pBody += uintptr(sqlite3.Xsqlite3VdbeSerialGet(tls, pBody, u322(*(*u64)(unsafe.Pointer(bp + 64 /* iSerialType */))), bp+8 /* &mem */))
if iCurrent == iIdx {
sqlite3.Xsqlite3_result_value(tls, context, bp+8 /* &mem */)
@@ -56094,7 +60838,7 @@ func test_extract(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
// containing a formatted database record as its only argument. It returns
// a tcl list (type SQLITE_TEXT) containing each of the values stored
// in the record.
-func test_decode(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:520:13: */
+func test_decode(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:520:13: */
bp := tls.Alloc(123)
defer tls.Free(123)
@@ -56113,18 +60857,18 @@ func test_decode(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* t
pRec = sqlite3.Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
pHdr = (pRec + uintptr(sqlite3.Xsqlite3GetVarint(tls, pRec, bp+32 /* &nHdr */)))
- pBody = crt.AssignUintptr(&pEndHdr, (pRec + uintptr(*(*u64)(unsafe.Pointer(bp + 32 /* nHdr */)))))
+ pBody = libc.AssignUintptr(&pEndHdr, (pRec + uintptr(*(*u64)(unsafe.Pointer(bp + 32 /* nHdr */)))))
for pHdr < pEndHdr {
var pVal uintptr = uintptr(0)
// var iSerialType u64 at bp+96, 8
// var mem Mem at bp+40, 56
- crt.Xmemset(tls, bp+40 /* &mem */, 0, uint64(unsafe.Sizeof(Mem{})))
+ libc.Xmemset(tls, bp+40 /* &mem */, 0, uint64(unsafe.Sizeof(Mem{})))
(*Mem)(unsafe.Pointer(bp + 40 /* &mem */)).Fdb = db
(*Mem)(unsafe.Pointer(bp + 40 /* &mem */)).Fenc = (*sqlite31)(unsafe.Pointer(db)).Fenc
pHdr += uintptr(sqlite3.Xsqlite3GetVarint(tls, pHdr, bp+96 /* &iSerialType */))
- pBody += uintptr(sqlite3.Xsqlite3VdbeSerialGet(tls, pBody, u321(*(*u64)(unsafe.Pointer(bp + 96 /* iSerialType */))), bp+40 /* &mem */))
+ pBody += uintptr(sqlite3.Xsqlite3VdbeSerialGet(tls, pBody, u322(*(*u64)(unsafe.Pointer(bp + 96 /* iSerialType */))), bp+40 /* &mem */))
switch sqlite3.Xsqlite3_value_type(tls, bp+40 /* &mem */) {
case 3:
@@ -56140,16 +60884,16 @@ func test_decode(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* t
var n int32 = sqlite3.Xsqlite3_value_bytes(tls, bp+40 /* &mem */)
var z uintptr = sqlite3.Xsqlite3_value_blob(tls, bp+40 /* &mem */)
var i int32
- pVal = tcl.XTcl_NewStringObj(tls, ts+28025 /* "x'" */, -1)
+ pVal = tcl.XTcl_NewStringObj(tls, ts+30117 /* "x'" */, -1)
for i = 0; i < n; i++ {
// var hex [3]int8 at bp+104, 3
*(*int8)(unsafe.Pointer(bp + 104 /* &hex[0] */ + uintptr(0))) = *(*int8)(unsafe.Pointer(bp + 107 /* &hexdigit[0] */ + uintptr(((int32(*(*u8)(unsafe.Pointer(z + uintptr(i)))) >> 4) & 0x0F))))
*(*int8)(unsafe.Pointer(bp + 104 /* &hex[0] */ + uintptr(1))) = *(*int8)(unsafe.Pointer(bp + 107 /* &hexdigit[0] */ + uintptr((int32(*(*u8)(unsafe.Pointer(z + uintptr(i)))) & 0x0F))))
*(*int8)(unsafe.Pointer(bp + 104 /* &hex[0] */ + uintptr(2))) = int8(0)
- tcl.XTcl_AppendStringsToObj(tls, pVal, crt.VaList(bp, bp+104 /* &hex[0] */, 0))
+ tcl.XTcl_AppendStringsToObj(tls, pVal, libc.VaList(bp, bp+104 /* &hex[0] */, 0))
}
- tcl.XTcl_AppendStringsToObj(tls, pVal, crt.VaList(bp+16, ts+4030 /* "'" */, 0))
+ tcl.XTcl_AppendStringsToObj(tls, pVal, libc.VaList(bp+16, ts+5315 /* "'" */, 0))
break
}
@@ -56162,7 +60906,7 @@ func test_decode(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* t
break
case 5:
- pVal = tcl.XTcl_NewStringObj(tls, ts+4252 /* "NULL" */, -1)
+ pVal = tcl.XTcl_NewStringObj(tls, ts+5537 /* "NULL" */, -1)
break
default:
@@ -56175,10 +60919,10 @@ func test_decode(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* t
}
}
- sqlite3.Xsqlite3_result_text(tls, context, tcl.XTcl_GetString(tls, pRet), -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, context, tcl.XTcl_GetString(tls, pRet), -1, libc.UintptrFromInt32(-1))
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pRet
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -56190,7 +60934,7 @@ func test_decode(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* t
// similar to the built-in zeroblob() function, except that it does not
// check that the integer parameter is within range before passing it
// to sqlite3_result_zeroblob().
-func test_zeroblob(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:612:13: */
+func test_zeroblob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:612:13: */
var nZero int32 = sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
sqlite3.Xsqlite3_result_zeroblob(tls, context, nZero)
}
@@ -56198,7 +60942,7 @@ func test_zeroblob(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
// test_getsubtype(V)
//
// Return the subtype for value V.
-func test_getsubtype(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:625:13: */
+func test_getsubtype(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:625:13: */
sqlite3.Xsqlite3_result_int(tls, context, int32(sqlite3.Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))))
}
@@ -56206,7 +60950,7 @@ func test_getsubtype(tls *crt.TLS, context uintptr, argc int32, argv uintptr) {
//
// Return an integer bitmask that has a bit set for every argument
// (up to the first 63 arguments) that originates from a bind a parameter.
-func test_frombind(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:638:13: */
+func test_frombind(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:638:13: */
var m sqlite3_uint64 = uint64(0)
var i int32
for i = 0; (i < argc) && (i < 63); i++ {
@@ -56220,12 +60964,12 @@ func test_frombind(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
// test_setsubtype(V, T)
//
// Return the value V with its subtype changed to T
-func test_setsubtype(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:655:13: */
+func test_setsubtype(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test_func.c:655:13: */
sqlite3.Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
sqlite3.Xsqlite3_result_subtype(tls, context, uint32(sqlite3.Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))))
}
-func registerTestFunctions(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pThunk uintptr) int32 { /* test_func.c:664:12: */
+func registerTestFunctions(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pThunk uintptr) int32 { /* test_func.c:664:12: */
var i int32
for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aFuncs)) / uint64(unsafe.Sizeof(struct {
@@ -56238,10 +60982,10 @@ func registerTestFunctions(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pThunk ui
int32(aFuncs[i].FeTextRep), uintptr(0), aFuncs[i].FxFunc, uintptr(0), uintptr(0))
}
- sqlite3.Xsqlite3_create_function(tls, db, ts+28028 /* "test_agg_errmsg1..." */, 0, 5, uintptr(0), uintptr(0),
+ sqlite3.Xsqlite3_create_function(tls, db, ts+30120 /* "test_agg_errmsg1..." */, 0, 5, uintptr(0), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{test_agg_errmsg16_step})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{test_agg_errmsg16_final})))
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{test_agg_errmsg16_step})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{test_agg_errmsg16_final})))
return 0
}
@@ -56252,26 +60996,26 @@ var aFuncs = [20]struct {
FeTextRep uint32
FxFunc uintptr
}{
- {FzName: ts + 28046 /* "randstr" */, FnArg: int8(2), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28054 /* "test_destructor" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28070 /* "test_destructor1..." */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28088 /* "hex_to_utf16be" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28103 /* "hex_to_utf16le" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28118 /* "hex_to_utf8" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28130 /* "test_destructor_..." */, FnArg: int8(0), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28152 /* "test_auxdata" */, FnArg: int8(-1), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28165 /* "test_error" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28165 /* "test_error" */, FnArg: int8(2), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28176 /* "test_eval" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28186 /* "test_isolation" */, FnArg: int8(2), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28201 /* "test_counter" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28214 /* "real2hex" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28223 /* "test_decode" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28235 /* "test_extract" */, FnArg: int8(2), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28248 /* "test_zeroblob" */, FnArg: int8(1), FeTextRep: (uint32(1 | 0x000000800)), FxFunc: 0},
- {FzName: ts + 28262 /* "test_getsubtype" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28278 /* "test_setsubtype" */, FnArg: int8(2), FeTextRep: uint32(1), FxFunc: 0},
- {FzName: ts + 28294 /* "test_frombind" */, FnArg: int8(-1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30138 /* "randstr" */, FnArg: int8(2), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30146 /* "test_destructor" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30162 /* "test_destructor1..." */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30180 /* "hex_to_utf16be" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30195 /* "hex_to_utf16le" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30210 /* "hex_to_utf8" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30222 /* "test_destructor_..." */, FnArg: int8(0), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30244 /* "test_auxdata" */, FnArg: int8(-1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30257 /* "test_error" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30257 /* "test_error" */, FnArg: int8(2), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30268 /* "test_eval" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30278 /* "test_isolation" */, FnArg: int8(2), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30293 /* "test_counter" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30306 /* "real2hex" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30315 /* "test_decode" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30327 /* "test_extract" */, FnArg: int8(2), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30340 /* "test_zeroblob" */, FnArg: int8(1), FeTextRep: (uint32(1 | 0x000000800)), FxFunc: 0},
+ {FzName: ts + 30354 /* "test_getsubtype" */, FnArg: int8(1), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30370 /* "test_setsubtype" */, FnArg: int8(2), FeTextRep: uint32(1), FxFunc: 0},
+ {FzName: ts + 30386 /* "test_frombind" */, FnArg: int8(-1), FeTextRep: uint32(1), FxFunc: 0},
} /* test_func.c:674:5 */
// TCLCMD: autoinstall_test_functions
@@ -56279,13 +61023,13 @@ var aFuncs = [20]struct {
// Invoke this TCL command to use sqlite3_auto_extension() to cause
// the standard set of test functions to be loaded into each new
// database connection.
-func autoinstall_test_funcs(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_func.c:718:26: */
+func autoinstall_test_funcs(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_func.c:718:26: */
var rc int32 = sqlite3.Xsqlite3_auto_extension(tls, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr) int32
}{registerTestFunctions})))
if rc == 0 {
rc = sqlite3.Xsqlite3_auto_extension(tls, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr) int32
}{Md5_Register})))
}
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, rc))
@@ -56293,16 +61037,16 @@ func autoinstall_test_funcs(tls *crt.TLS, clientData uintptr, interp uintptr, ob
}
// A bogus step function and finalizer function.
-func tStep(tls *crt.TLS, a uintptr, b int32, c uintptr) { /* test_func.c:736:13: */
+func tStep(tls *libc.TLS, a uintptr, b int32, c uintptr) { /* test_func.c:736:13: */
}
-func tFinal(tls *crt.TLS, a uintptr) { /* test_func.c:737:13: */
+func tFinal(tls *libc.TLS, a uintptr) { /* test_func.c:737:13: */
}
// tclcmd: abuse_create_function
//
// Make various calls to sqlite3_create_function that do not have valid
// parameters. Verify that the error condition is detected and reported.
-func abuse_create_function(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_func.c:746:26: */
+func abuse_create_function(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_func.c:746:26: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -56318,11 +61062,11 @@ func abuse_create_function(tls *crt.TLS, clientData uintptr, interp uintptr, obj
__1:
;
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+28308 /* "tx" */, 1, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30400 /* "tx" */, 1, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{tStep})), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{tStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{tFinal})))
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{tStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{tFinal})))
if !(rc != 21) {
goto __2
}
@@ -56330,10 +61074,10 @@ __1:
__2:
;
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+28308 /* "tx" */, 1, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30400 /* "tx" */, 1, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{tStep})), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{tStep})), uintptr(0))
if !(rc != 21) {
goto __3
@@ -56342,9 +61086,9 @@ __2:
__3:
;
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+28308 /* "tx" */, 1, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{tStep})), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{tFinal})))
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30400 /* "tx" */, 1, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{tStep})), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{tFinal})))
if !(rc != 21) {
goto __4
}
@@ -56352,7 +61096,7 @@ __3:
__4:
;
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+28308 /* "tx" */, 1, 1, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{tFinal})))
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30400 /* "tx" */, 1, 1, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{tFinal})))
if !(rc != 21) {
goto __5
}
@@ -56360,8 +61104,8 @@ __4:
__5:
;
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+28308 /* "tx" */, 1, 1, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30400 /* "tx" */, 1, 1, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{tStep})), uintptr(0))
if !(rc != 21) {
goto __6
@@ -56370,8 +61114,8 @@ __5:
__6:
;
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+28308 /* "tx" */, -2, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30400 /* "tx" */, -2, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{tStep})), uintptr(0), uintptr(0))
if !(rc != 21) {
goto __7
@@ -56380,8 +61124,8 @@ __6:
__7:
;
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+28308 /* "tx" */, 128, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), ts+30400 /* "tx" */, 128, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{tStep})), uintptr(0), uintptr(0))
if !(rc != 21) {
goto __8
@@ -56392,9 +61136,9 @@ __8:
rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)),
- ts+28311, /* "funcxx_123456789..." */
+ ts+30403, /* "funcxx_123456789..." */
1, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{tStep})), uintptr(0), uintptr(0))
if !(rc != 21) {
goto __9
@@ -56410,9 +61154,9 @@ __9:
mxArg = sqlite3.Xsqlite3_limit(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), 6, -1)
rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)),
- ts+28568, /* "nullx_123456789_..." */
+ ts+30660, /* "nullx_123456789_..." */
mxArg, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{tStep})), uintptr(0), uintptr(0))
if !(rc != 0) {
goto __10
@@ -56424,7 +61168,7 @@ __10:
return 0
abuse_err:
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+28824, /* "sqlite3_create_f..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+30916, /* "sqlite3_create_f..." */
uintptr(0)))
return 1
}
@@ -56461,7 +61205,7 @@ abuse_err:
// SELECT docid FROM documents
// WHERE documents MATCH <query>
// ORDER BY rank(matchinfo(documents), 1.0, 0.5) DESC
-func rankfunc(tls *crt.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* test_func.c:847:13: */
+func rankfunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* test_func.c:847:13: */
var aMatchinfo uintptr // Return value of matchinfo()
var nMatchinfo int32 // Number of elements in aMatchinfo[]
var nCol int32 // Number of columns in the table
@@ -56511,7 +61255,7 @@ __2:
goto __3
}
sqlite3.Xsqlite3_result_error(tls, pCtx,
- ts+28867 /* "invalid matchinf..." */, -1)
+ ts+30959 /* "invalid matchinf..." */, -1)
return
__3:
;
@@ -56572,10 +61316,10 @@ __7:
// Jump here if the wrong number of arguments are passed to this function
wrong_number_args:
- sqlite3.Xsqlite3_result_error(tls, pCtx, ts+28916 /* "wrong number of ..." */, -1)
+ sqlite3.Xsqlite3_result_error(tls, pCtx, ts+31008 /* "wrong number of ..." */, -1)
}
-func install_fts3_rank_function(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_func.c:910:26: */
+func install_fts3_rank_function(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_func.c:910:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -56589,39 +61333,39 @@ func install_fts3_rank_function(tls *crt.TLS, clientData uintptr, interp uintptr
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
return 1
}
- sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+28961 /* "rank" */, -1, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+31053 /* "rank" */, -1, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{rankfunc})), uintptr(0), uintptr(0))
return 0
}
// Register commands with the TCL interpreter.
-func Sqlitetest_func_Init(tls *crt.TLS, interp uintptr) int32 { /* test_func.c:933:5: */
+func Sqlitetest_func_Init(tls *libc.TLS, interp uintptr) int32 { /* test_func.c:933:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd6)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd7)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd6[i].FzName, aObjCmd6[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd7[i].FzName, aObjCmd7[i].FxProc, uintptr(0), uintptr(0))
}
sqlite3.Xsqlite3_initialize(tls)
sqlite3.Xsqlite3_auto_extension(tls, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr) int32
}{registerTestFunctions})))
sqlite3.Xsqlite3_auto_extension(tls, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr) int32
}{Md5_Register})))
return 0
}
-var aObjCmd6 = [3]struct {
+var aObjCmd7 = [3]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 28966 /* "autoinstall_test..." */, FxProc: 0},
- {FzName: ts + 28993 /* "abuse_create_fun..." */, FxProc: 0},
- {FzName: ts + 29015 /* "install_fts3_ran..." */, FxProc: 0},
+ {FzName: ts + 31058 /* "autoinstall_test..." */, FxProc: 0},
+ {FzName: ts + 31085 /* "abuse_create_fun..." */, FxProc: 0},
+ {FzName: ts + 31107 /* "install_fts3_ran..." */, FxProc: 0},
} /* test_func.c:937:5 */
// end block for C++
@@ -56719,20 +61463,20 @@ var aObjCmd6 = [3]struct {
// Convert binary to hex. The input zBuf[] contains N bytes of
// binary data. zBuf[] is 2*n+1 bytes long. Overwrite zBuf[]
// with a hexadecimal representation of its original binary input.
-func sqlite3TestBinToHex(tls *crt.TLS, zBuf uintptr, N int32) { /* test_hexio.c:36:6: */
+func sqlite3TestBinToHex(tls *libc.TLS, zBuf uintptr, N int32) { /* test_hexio.c:36:6: */
bp := tls.Alloc(17)
defer tls.Free(17)
- *(*[17]uint8)(unsafe.Pointer(bp /* zHex */)) = *(*[17]uint8)(unsafe.Pointer(ts + 29042 /* "0123456789ABCDEF" */))
+ *(*[17]uint8)(unsafe.Pointer(bp /* zHex */)) = *(*[17]uint8)(unsafe.Pointer(ts + 31134 /* "0123456789ABCDEF" */))
var i int32
var j int32
var c uint8
i = (N * 2)
- *(*uint8)(unsafe.Pointer(zBuf + uintptr(crt.PostDecInt32(&i, 1)))) = uint8(0)
+ *(*uint8)(unsafe.Pointer(zBuf + uintptr(libc.PostDecInt32(&i, 1)))) = uint8(0)
for j = (N - 1); j >= 0; j-- {
c = *(*uint8)(unsafe.Pointer(zBuf + uintptr(j)))
- *(*uint8)(unsafe.Pointer(zBuf + uintptr(crt.PostDecInt32(&i, 1)))) = *(*uint8)(unsafe.Pointer(bp /* &zHex[0] */ + uintptr((int32(c) & 0xf))))
- *(*uint8)(unsafe.Pointer(zBuf + uintptr(crt.PostDecInt32(&i, 1)))) = *(*uint8)(unsafe.Pointer(bp /* &zHex[0] */ + uintptr((int32(c) >> 4))))
+ *(*uint8)(unsafe.Pointer(zBuf + uintptr(libc.PostDecInt32(&i, 1)))) = *(*uint8)(unsafe.Pointer(bp /* &zHex[0] */ + uintptr((int32(c) & 0xf))))
+ *(*uint8)(unsafe.Pointer(zBuf + uintptr(libc.PostDecInt32(&i, 1)))) = *(*uint8)(unsafe.Pointer(bp /* &zHex[0] */ + uintptr((int32(c) >> 4))))
}
}
@@ -56741,7 +61485,7 @@ func sqlite3TestBinToHex(tls *crt.TLS, zBuf uintptr, N int32) { /* test_hexio.c:
// hexadecimal. Convert this into binary and write aOut[] with
// the binary data. Spaces in the original input are ignored.
// Return the number of bytes of binary rendered.
-func sqlite3TestHexToBin(tls *crt.TLS, zIn uintptr, N int32, aOut uintptr) int32 { /* test_hexio.c:56:5: */
+func sqlite3TestHexToBin(tls *libc.TLS, zIn uintptr, N int32, aOut uintptr) int32 { /* test_hexio.c:56:5: */
bp := tls.Alloc(256)
defer tls.Free(256)
@@ -56768,7 +61512,7 @@ func sqlite3TestHexToBin(tls *crt.TLS, zIn uintptr, N int32, aOut uintptr) int32
var hi int32 = 1
var c uint8
- for i = crt.AssignInt32(&j, 0); i < N; i++ {
+ for i = libc.AssignInt32(&j, 0); i < N; i++ {
c = *(*uint8)(unsafe.Pointer(bp /* &aMap[0] */ + uintptr(*(*uint8)(unsafe.Pointer(zIn + uintptr(i))))))
if int32(c) == 0 {
continue
@@ -56777,7 +61521,7 @@ func sqlite3TestHexToBin(tls *crt.TLS, zIn uintptr, N int32, aOut uintptr) int32
*(*uint8)(unsafe.Pointer(aOut + uintptr(j))) = (uint8((int32(c) - 1) << 4))
hi = 0
} else {
- *(*uint8)(unsafe.Pointer(aOut + uintptr(crt.PostIncInt32(&j, 1)))) |= uint8((int32(c) - 1))
+ *(*uint8)(unsafe.Pointer(aOut + uintptr(libc.PostIncInt32(&j, 1)))) |= uint8((int32(c) - 1))
hi = 1
}
}
@@ -56789,7 +61533,7 @@ func sqlite3TestHexToBin(tls *crt.TLS, zIn uintptr, N int32, aOut uintptr) int32
// Read AMT bytes from file FILENAME beginning at OFFSET from the
// beginning of the file. Convert that information to hexadecimal
// and return the resulting HEX string.
-func hexio_read(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:101:26: */
+func hexio_read(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:101:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -56803,7 +61547,7 @@ func hexio_read(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, ob
var in uintptr
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29059 /* "FILENAME OFFSET ..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31151 /* "FILENAME OFFSET ..." */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+40 /* &offset */) != 0 {
@@ -56817,22 +61561,22 @@ func hexio_read(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, ob
if zBuf == uintptr(0) {
return 1
}
- in = crt.Xfopen64(tls, zFile, ts+2937 /* "rb" */)
+ in = libc.Xfopen64(tls, zFile, ts+4086 /* "rb" */)
if in == uintptr(0) {
- in = crt.Xfopen64(tls, zFile, ts+29079 /* "r" */)
+ in = libc.Xfopen64(tls, zFile, ts+31171 /* "r" */)
}
if in == uintptr(0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+29081 /* "cannot open inpu..." */, zFile, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31173 /* "cannot open inpu..." */, zFile, 0))
return 1
}
- crt.Xfseek(tls, in, int64(*(*int32)(unsafe.Pointer(bp + 40 /* offset */))), 0)
- got = int32(crt.Xfread(tls, zBuf, uint64(1), uint64(*(*int32)(unsafe.Pointer(bp + 44 /* amt */))), in))
- crt.Xfclose(tls, in)
+ libc.Xfseek(tls, in, int64(*(*int32)(unsafe.Pointer(bp + 40 /* offset */))), 0)
+ got = int32(libc.Xfread(tls, zBuf, uint64(1), uint64(*(*int32)(unsafe.Pointer(bp + 44 /* amt */))), in))
+ libc.Xfclose(tls, in)
if got < 0 {
got = 0
}
sqlite3TestBinToHex(tls, zBuf, got)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+24, zBuf, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, zBuf, 0))
sqlite3.Xsqlite3_free(tls, zBuf)
return 0
}
@@ -56841,7 +61585,7 @@ func hexio_read(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, ob
//
// Write DATA into file FILENAME beginning at OFFSET from the
// beginning of the file. DATA is expressed in hexadecimal.
-func hexio_write(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:151:26: */
+func hexio_write(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:151:26: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -56857,7 +61601,7 @@ func hexio_write(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
var out uintptr
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29105 /* "FILENAME OFFSET ..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31197 /* "FILENAME OFFSET ..." */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+24 /* &offset */) != 0 {
@@ -56870,18 +61614,18 @@ func hexio_write(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
return 1
}
nOut = sqlite3TestHexToBin(tls, zIn, *(*int32)(unsafe.Pointer(bp + 28 /* nIn */)), aOut)
- out = crt.Xfopen64(tls, zFile, ts+29129 /* "r+b" */)
+ out = libc.Xfopen64(tls, zFile, ts+31221 /* "r+b" */)
if out == uintptr(0) {
- out = crt.Xfopen64(tls, zFile, ts+29133 /* "r+" */)
+ out = libc.Xfopen64(tls, zFile, ts+31225 /* "r+" */)
}
if out == uintptr(0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+29136 /* "cannot open outp..." */, zFile, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31228 /* "cannot open outp..." */, zFile, 0))
return 1
}
- crt.Xfseek(tls, out, int64(*(*int32)(unsafe.Pointer(bp + 24 /* offset */))), 0)
- written = int32(crt.Xfwrite(tls, aOut, uint64(1), uint64(nOut), out))
+ libc.Xfseek(tls, out, int64(*(*int32)(unsafe.Pointer(bp + 24 /* offset */))), 0)
+ written = int32(libc.Xfwrite(tls, aOut, uint64(1), uint64(nOut), out))
sqlite3.Xsqlite3_free(tls, aOut)
- crt.Xfclose(tls, out)
+ libc.Xfclose(tls, out)
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, written))
return 0
}
@@ -56891,7 +61635,7 @@ func hexio_write(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
// Interpret the HEXDATA argument as a big-endian integer. Return
// the value of that integer. HEXDATA can contain between 2 and 8
// hexadecimal digits.
-func hexio_get_int(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:199:26: */
+func hexio_get_int(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:199:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -56904,7 +61648,7 @@ func hexio_get_int(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
// var aNum [4]uint8 at bp+4, 4
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29161 /* "HEXDATA" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31253 /* "HEXDATA" */)
return 1
}
zIn = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &nIn */)
@@ -56914,10 +61658,10 @@ func hexio_get_int(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
}
nOut = sqlite3TestHexToBin(tls, zIn, *(*int32)(unsafe.Pointer(bp /* nIn */)), aOut)
if nOut >= 4 {
- crt.Xmemcpy(tls, bp+4 /* &aNum[0] */, aOut, uint64(4))
+ libc.Xmemcpy(tls, bp+4 /* &aNum[0] */, aOut, uint64(4))
} else {
- crt.Xmemset(tls, bp+4 /* &aNum[0] */, 0, uint64(unsafe.Sizeof([4]uint8{})))
- crt.Xmemcpy(tls, (bp + 4 /* &aNum */ + uintptr((4 - nOut))), aOut, uint64(nOut))
+ libc.Xmemset(tls, bp+4 /* &aNum[0] */, 0, uint64(unsafe.Sizeof([4]uint8{})))
+ libc.Xmemcpy(tls, (bp + 4 /* &aNum */ + uintptr((4 - nOut))), aOut, uint64(nOut))
}
sqlite3.Xsqlite3_free(tls, aOut)
val = ((((int32(*(*uint8)(unsafe.Pointer(bp + 4 /* &aNum[0] */ + uintptr(0)))) << 24) | (int32(*(*uint8)(unsafe.Pointer(bp + 4 /* &aNum[0] */ + uintptr(1)))) << 16)) | (int32(*(*uint8)(unsafe.Pointer(bp + 4 /* &aNum[0] */ + uintptr(2)))) << 8)) | int32(*(*uint8)(unsafe.Pointer(bp + 4 /* &aNum[0] */ + uintptr(3)))))
@@ -56928,7 +61672,7 @@ func hexio_get_int(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
// USAGE: hexio_render_int16 INTEGER
//
// Render INTEGER has a 16-bit big-endian integer in hexadecimal.
-func hexio_render_int16(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:239:26: */
+func hexio_render_int16(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:239:26: */
bp := tls.Alloc(14)
defer tls.Free(14)
@@ -56937,7 +61681,7 @@ func hexio_render_int16(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// var aNum [10]uint8 at bp+4, 10
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15173 /* "INTEGER" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2273 /* "INTEGER" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &val */) != 0 {
@@ -56953,7 +61697,7 @@ func hexio_render_int16(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// USAGE: hexio_render_int32 INTEGER
//
// Render INTEGER has a 32-bit big-endian integer in hexadecimal.
-func hexio_render_int32(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:266:26: */
+func hexio_render_int32(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:266:26: */
bp := tls.Alloc(14)
defer tls.Free(14)
@@ -56962,7 +61706,7 @@ func hexio_render_int32(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// var aNum [10]uint8 at bp+4, 10
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15173 /* "INTEGER" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2273 /* "INTEGER" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &val */) != 0 {
@@ -56982,36 +61726,36 @@ func hexio_render_int32(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// The argument is a UTF8 string represented in hexadecimal.
// The UTF8 might not be well-formed. Run this string through
// sqlite3Utf8to8() convert it back to hex and return the result.
-func utf8_to_utf8(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:296:26: */
+func utf8_to_utf8(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:296:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
tcl.XTcl_AppendResult(tls, interp,
- crt.VaList(bp, ts+29169 /* "[utf8_to_utf8] u..." */, 0))
+ libc.VaList(bp, ts+31261 /* "[utf8_to_utf8] u..." */, 0))
return 1
}
-func getFts3Varint(tls *crt.TLS, p uintptr, v uintptr) int32 { /* test_hexio.c:328:12: */
+func getFts3Varint(tls *libc.TLS, p uintptr, v uintptr) int32 { /* test_hexio.c:328:12: */
var q uintptr = p
var x sqlite_uint64 = uint64(0)
var y sqlite_uint64 = uint64(1)
for (int32(*(*uint8)(unsafe.Pointer(q))) & 0x80) == 0x80 {
- x = x + (y * (sqlite_uint64(int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&q, 1)))) & 0x7f)))
+ x = x + (y * (sqlite_uint64(int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&q, 1)))) & 0x7f)))
y <<= 7
}
- x = x + (y * (sqlite_uint64(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&q, 1))))))
+ x = x + (y * (sqlite_uint64(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&q, 1))))))
*(*sqlite_int64)(unsafe.Pointer(v)) = sqlite_int64(x)
return (int32((int64(q) - int64(p)) / 1))
}
-func putFts3Varint(tls *crt.TLS, p uintptr, v sqlite_int64) int32 { /* test_hexio.c:340:12: */
+func putFts3Varint(tls *libc.TLS, p uintptr, v sqlite_int64) int32 { /* test_hexio.c:340:12: */
var q uintptr = p
var vu sqlite_uint64 = sqlite_uint64(v)
for ok := true; ok; ok = (vu != uint64(0)) {
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&q, 1))) = (uint8((vu & uint64(0x7f)) | uint64(0x80)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&q, 1))) = (uint8((vu & uint64(0x7f)) | uint64(0x80)))
vu >>= 7
}
- *(*uint8)(unsafe.Pointer(q + crt.UintptrFromInt32(-1))) &= uint8((0x7f)) // turn off high bit in final byte
+ *(*uint8)(unsafe.Pointer(q + libc.UintptrFromInt32(-1))) &= uint8((0x7f)) // turn off high bit in final byte
return (int32((int64(q) - int64(p)) / 1))
}
@@ -57020,7 +61764,7 @@ func putFts3Varint(tls *crt.TLS, p uintptr, v sqlite_int64) int32 { /* test_hexi
//
// Read a varint from the start of BLOB. Set variable VARNAME to contain
// the interpreted value. Return the number of bytes of BLOB consumed.
-func read_fts3varint(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:358:26: */
+func read_fts3varint(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:358:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -57032,7 +61776,7 @@ func read_fts3varint(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
var nVal int32
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29223 /* "BLOB VARNAME" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31315 /* "BLOB VARNAME" */)
return 1
}
zBlob = tcl.XTcl_GetByteArrayFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &nBlob */)
@@ -57044,7 +61788,7 @@ func read_fts3varint(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
}
// USAGE: make_fts3record ARGLIST
-func make_fts3record(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:384:26: */
+func make_fts3record(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_hexio.c:384:26: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -57056,7 +61800,7 @@ func make_fts3record(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
var i int32
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29236 /* "LIST" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31328 /* "LIST" */)
return 1
}
if tcl.XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &nArg */, bp+8 /* &aArg */) != 0 {
@@ -57101,7 +61845,7 @@ func make_fts3record(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
aOut = aNew
nAlloc = nNew
}
- crt.Xmemcpy(tls, (aOut + uintptr(nOut)), zVal, uint64(*(*int32)(unsafe.Pointer(bp + 24 /* nVal */))))
+ libc.Xmemcpy(tls, (aOut + uintptr(nOut)), zVal, uint64(*(*int32)(unsafe.Pointer(bp + 24 /* nVal */))))
nOut = nOut + (*(*int32)(unsafe.Pointer(bp + 24 /* nVal */)))
}
}
@@ -57112,29 +61856,29 @@ func make_fts3record(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
}
// Register commands with the TCL interpreter.
-func Sqlitetest_hexio_Init(tls *crt.TLS, interp uintptr) int32 { /* test_hexio.c:446:5: */
+func Sqlitetest_hexio_Init(tls *libc.TLS, interp uintptr) int32 { /* test_hexio.c:446:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd7)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd8)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd7[i].FzName, aObjCmd7[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd8[i].FzName, aObjCmd8[i].FxProc, uintptr(0), uintptr(0))
}
return 0
}
-var aObjCmd7 = [8]struct {
+var aObjCmd8 = [8]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 29241 /* "hexio_read" */, FxProc: 0},
- {FzName: ts + 29252 /* "hexio_write" */, FxProc: 0},
- {FzName: ts + 29264 /* "hexio_get_int" */, FxProc: 0},
- {FzName: ts + 29278 /* "hexio_render_int..." */, FxProc: 0},
- {FzName: ts + 29297 /* "hexio_render_int..." */, FxProc: 0},
- {FzName: ts + 29316 /* "utf8_to_utf8" */, FxProc: 0},
- {FzName: ts + 29329 /* "read_fts3varint" */, FxProc: 0},
- {FzName: ts + 29345 /* "make_fts3record" */, FxProc: 0},
+ {FzName: ts + 31333 /* "hexio_read" */, FxProc: 0},
+ {FzName: ts + 31344 /* "hexio_write" */, FxProc: 0},
+ {FzName: ts + 31356 /* "hexio_get_int" */, FxProc: 0},
+ {FzName: ts + 31370 /* "hexio_render_int..." */, FxProc: 0},
+ {FzName: ts + 31389 /* "hexio_render_int..." */, FxProc: 0},
+ {FzName: ts + 31408 /* "utf8_to_utf8" */, FxProc: 0},
+ {FzName: ts + 31421 /* "read_fts3varint" */, FxProc: 0},
+ {FzName: ts + 31437 /* "make_fts3record" */, FxProc: 0},
} /* test_hexio.c:450:5 */
// end block for C++
@@ -57167,155 +61911,174 @@ type Wrapped = struct {
var wrapped Wrapped /* test_init.c:47:3: */
-func wrMemInit(tls *crt.TLS, pAppData uintptr) int32 { /* test_init.c:49:12: */
+func wrMemInit(tls *libc.TLS, pAppData uintptr) int32 { /* test_init.c:49:12: */
var rc int32
if wrapped.Fmem_fail != 0 {
rc = 1
} else {
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ + 40 /* &.xInit */))))(tls, wrapped.Fmem.FpAppData)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ + 40 /* &.xInit */))))(tls, wrapped.Fmem.FpAppData)
}
if rc == 0 {
wrapped.Fmem_init = 1
}
return rc
}
-func wrMemShutdown(tls *crt.TLS, pAppData uintptr) { /* test_init.c:61:13: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ + 48 /* &.xShutdown */))))(tls, wrapped.Fmem.FpAppData)
+func wrMemShutdown(tls *libc.TLS, pAppData uintptr) { /* test_init.c:61:13: */
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ + 48 /* &.xShutdown */))))(tls, wrapped.Fmem.FpAppData)
wrapped.Fmem_init = 0
}
-func wrMemMalloc(tls *crt.TLS, n int32) uintptr { /* test_init.c:65:13: */
- return (*(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ /* &.xMalloc */))))(tls, n)
+func wrMemMalloc(tls *libc.TLS, n int32) uintptr { /* test_init.c:65:13: */
+ return (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ /* &.xMalloc */))))(tls, n)
}
-func wrMemFree(tls *crt.TLS, p uintptr) { /* test_init.c:66:13: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ + 8 /* &.xFree */))))(tls, p)
+func wrMemFree(tls *libc.TLS, p uintptr) { /* test_init.c:66:13: */
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ + 8 /* &.xFree */))))(tls, p)
}
-func wrMemRealloc(tls *crt.TLS, p uintptr, n int32) uintptr { /* test_init.c:67:13: */
- return (*(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ + 16 /* &.xRealloc */))))(tls, p, n)
+func wrMemRealloc(tls *libc.TLS, p uintptr, n int32) uintptr { /* test_init.c:67:13: */
+ return (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ + 16 /* &.xRealloc */))))(tls, p, n)
}
-func wrMemSize(tls *crt.TLS, p uintptr) int32 { /* test_init.c:68:12: */
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ + 24 /* &.xSize */))))(tls, p)
+func wrMemSize(tls *libc.TLS, p uintptr) int32 { /* test_init.c:68:12: */
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ + 24 /* &.xSize */))))(tls, p)
}
-func wrMemRoundup(tls *crt.TLS, n int32) int32 { /* test_init.c:69:12: */
- return (*(*func(*crt.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ + 32 /* &.xRoundup */))))(tls, n)
+func wrMemRoundup(tls *libc.TLS, n int32) int32 { /* test_init.c:69:12: */
+ return (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 104 /* &.mem */ + 32 /* &.xRoundup */))))(tls, n)
}
-func wrMutexInit(tls *crt.TLS) int32 { /* test_init.c:72:12: */
+func wrMutexInit(tls *libc.TLS) int32 { /* test_init.c:72:12: */
var rc int32
if wrapped.Fmutex_fail != 0 {
rc = 1
} else {
- rc = (*(*func(*crt.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ /* &.xMutexInit */))))(tls)
+ rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ /* &.xMutexInit */))))(tls)
}
if rc == 0 {
wrapped.Fmutex_init = 1
}
return rc
}
-func wrMutexEnd(tls *crt.TLS) int32 { /* test_init.c:84:12: */
- (*(*func(*crt.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 8 /* &.xMutexEnd */))))(tls)
+func wrMutexEnd(tls *libc.TLS) int32 { /* test_init.c:84:12: */
+ (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 8 /* &.xMutexEnd */))))(tls)
wrapped.Fmutex_init = 0
return 0
}
-func wrMutexAlloc(tls *crt.TLS, e int32) uintptr { /* test_init.c:89:22: */
- return (*(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 16 /* &.xMutexAlloc */))))(tls, e)
+func wrMutexAlloc(tls *libc.TLS, e int32) uintptr { /* test_init.c:89:22: */
+ return (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 16 /* &.xMutexAlloc */))))(tls, e)
}
-func wrMutexFree(tls *crt.TLS, p uintptr) { /* test_init.c:92:13: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 24 /* &.xMutexFree */))))(tls, p)
+func wrMutexFree(tls *libc.TLS, p uintptr) { /* test_init.c:92:13: */
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 24 /* &.xMutexFree */))))(tls, p)
}
-func wrMutexEnter(tls *crt.TLS, p uintptr) { /* test_init.c:95:13: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 32 /* &.xMutexEnter */))))(tls, p)
+func wrMutexEnter(tls *libc.TLS, p uintptr) { /* test_init.c:95:13: */
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 32 /* &.xMutexEnter */))))(tls, p)
}
-func wrMutexTry(tls *crt.TLS, p uintptr) int32 { /* test_init.c:98:12: */
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 40 /* &.xMutexTry */))))(tls, p)
+func wrMutexTry(tls *libc.TLS, p uintptr) int32 { /* test_init.c:98:12: */
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 40 /* &.xMutexTry */))))(tls, p)
}
-func wrMutexLeave(tls *crt.TLS, p uintptr) { /* test_init.c:101:13: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 48 /* &.xMutexLeave */))))(tls, p)
+func wrMutexLeave(tls *libc.TLS, p uintptr) { /* test_init.c:101:13: */
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 48 /* &.xMutexLeave */))))(tls, p)
}
-func wrMutexHeld(tls *crt.TLS, p uintptr) int32 { /* test_init.c:104:12: */
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 56 /* &.xMutexHeld */))))(tls, p)
+func wrMutexHeld(tls *libc.TLS, p uintptr) int32 { /* test_init.c:104:12: */
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 56 /* &.xMutexHeld */))))(tls, p)
}
-func wrMutexNotheld(tls *crt.TLS, p uintptr) int32 { /* test_init.c:107:12: */
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 64 /* &.xMutexNotheld */))))(tls, p)
+func wrMutexNotheld(tls *libc.TLS, p uintptr) int32 { /* test_init.c:107:12: */
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) + 168 /* &.mutex */ + 64 /* &.xMutexNotheld */))))(tls, p)
}
-func wrPCacheInit(tls *crt.TLS, pArg uintptr) int32 { /* test_init.c:113:12: */
+func wrPCacheInit(tls *libc.TLS, pArg uintptr) int32 { /* test_init.c:113:12: */
var rc int32
if wrapped.Fpcache_fail != 0 {
rc = 1
} else {
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 16 /* &.xInit */))))(tls, wrapped.Fpcache.FpArg)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 16 /* &.xInit */))))(tls, wrapped.Fpcache.FpArg)
}
if rc == 0 {
wrapped.Fpcache_init = 1
}
return rc
}
-func wrPCacheShutdown(tls *crt.TLS, pArg uintptr) { /* test_init.c:125:13: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 24 /* &.xShutdown */))))(tls, wrapped.Fpcache.FpArg)
+func wrPCacheShutdown(tls *libc.TLS, pArg uintptr) { /* test_init.c:125:13: */
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 24 /* &.xShutdown */))))(tls, wrapped.Fpcache.FpArg)
wrapped.Fpcache_init = 0
}
-func wrPCacheCreate(tls *crt.TLS, a int32, b int32, c int32) uintptr { /* test_init.c:130:23: */
- return (*(*func(*crt.TLS, int32, int32, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 32 /* &.xCreate */))))(tls, a, b, c)
+func wrPCacheCreate(tls *libc.TLS, a int32, b int32, c int32) uintptr { /* test_init.c:130:23: */
+ return (*(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 32 /* &.xCreate */))))(tls, a, b, c)
}
-func wrPCacheCachesize(tls *crt.TLS, p uintptr, n int32) { /* test_init.c:133:13: */
- (*(*func(*crt.TLS, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 40 /* &.xCachesize */))))(tls, p, n)
+func wrPCacheCachesize(tls *libc.TLS, p uintptr, n int32) { /* test_init.c:133:13: */
+ (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 40 /* &.xCachesize */))))(tls, p, n)
}
-func wrPCachePagecount(tls *crt.TLS, p uintptr) int32 { /* test_init.c:136:12: */
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 48 /* &.xPagecount */))))(tls, p)
+func wrPCachePagecount(tls *libc.TLS, p uintptr) int32 { /* test_init.c:136:12: */
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 48 /* &.xPagecount */))))(tls, p)
}
-func wrPCacheFetch(tls *crt.TLS, p uintptr, a uint32, b int32) uintptr { /* test_init.c:139:28: */
- return (*(*func(*crt.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 56 /* &.xFetch */))))(tls, p, a, b)
+func wrPCacheFetch(tls *libc.TLS, p uintptr, a uint32, b int32) uintptr { /* test_init.c:139:28: */
+ return (*(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 56 /* &.xFetch */))))(tls, p, a, b)
}
-func wrPCacheUnpin(tls *crt.TLS, p uintptr, a uintptr, b int32) { /* test_init.c:142:13: */
- (*(*func(*crt.TLS, uintptr, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 64 /* &.xUnpin */))))(tls, p, a, b)
+func wrPCacheUnpin(tls *libc.TLS, p uintptr, a uintptr, b int32) { /* test_init.c:142:13: */
+ (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 64 /* &.xUnpin */))))(tls, p, a, b)
}
-func wrPCacheRekey(tls *crt.TLS, p uintptr, a uintptr, b uint32, c uint32) { /* test_init.c:145:13: */
- (*(*func(*crt.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 72 /* &.xRekey */))))(tls, p, a, b, c)
+func wrPCacheRekey(tls *libc.TLS, p uintptr, a uintptr, b uint32, c uint32) { /* test_init.c:145:13: */
+ (*(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 72 /* &.xRekey */))))(tls, p, a, b, c)
}
-func wrPCacheTruncate(tls *crt.TLS, p uintptr, a uint32) { /* test_init.c:153:13: */
- (*(*func(*crt.TLS, uintptr, uint32))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 80 /* &.xTruncate */))))(tls, p, a)
+func wrPCacheTruncate(tls *libc.TLS, p uintptr, a uint32) { /* test_init.c:153:13: */
+ (*(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 80 /* &.xTruncate */))))(tls, p, a)
}
-func wrPCacheDestroy(tls *crt.TLS, p uintptr) { /* test_init.c:156:13: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 88 /* &.xDestroy */))))(tls, p)
+func wrPCacheDestroy(tls *libc.TLS, p uintptr) { /* test_init.c:156:13: */
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */ + 88 /* &.xDestroy */))))(tls, p)
}
-func installInitWrappers(tls *crt.TLS) { /* test_init.c:160:13: */
+func installInitWrappers(tls *libc.TLS) { /* test_init.c:160:13: */
bp := tls.Alloc(288)
defer tls.Free(288)
- *(*sqlite3_mutex_methods)(unsafe.Pointer(bp + 48 /* mutexmethods */)) = sqlite3_mutex_methods{FxMutexInit: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) int32 }{wrMutexInit})), FxMutexEnd: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) int32 }{wrMutexEnd})), FxMutexAlloc: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, int32) uintptr }{wrMutexAlloc})), FxMutexFree: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{wrMutexFree})), FxMutexEnter: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{wrMutexEnter})), FxMutexTry: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{wrMutexTry})), FxMutexLeave: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{wrMutexLeave})), FxMutexHeld: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{wrMutexHeld})), FxMutexNotheld: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{wrMutexNotheld}))}
- *(*sqlite3_pcache_methods2)(unsafe.Pointer(bp + 184 /* pcachemethods */)) = sqlite3_pcache_methods2{FiVersion: 1, FpArg: uintptr(0), FxInit: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{wrPCacheInit})), FxShutdown: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{wrPCacheShutdown})), FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, int32, int32) uintptr
+ *(*sqlite3_mutex_methods)(unsafe.Pointer(bp + 48 /* mutexmethods */)) = sqlite3_mutex_methods{FxMutexInit: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{wrMutexInit})), FxMutexEnd: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{wrMutexEnd})), FxMutexAlloc: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, int32) uintptr
+ }{wrMutexAlloc})), FxMutexFree: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{wrMutexFree})), FxMutexEnter: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{wrMutexEnter})), FxMutexTry: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{wrMutexTry})), FxMutexLeave: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{wrMutexLeave})), FxMutexHeld: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{wrMutexHeld})), FxMutexNotheld: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{wrMutexNotheld})),
+ }
+ *(*sqlite3_pcache_methods2)(unsafe.Pointer(bp + 184 /* pcachemethods */)) = sqlite3_pcache_methods2{FiVersion: 1, FpArg: uintptr(0), FxInit: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{wrPCacheInit})), FxShutdown: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{wrPCacheShutdown})), FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, int32, int32, int32) uintptr
}{wrPCacheCreate})), FxCachesize: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32)
- }{wrPCacheCachesize})), FxPagecount: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{wrPCachePagecount})), FxFetch: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uint32, int32) uintptr
+ f func(*libc.TLS, uintptr, int32)
+ }{wrPCacheCachesize})), FxPagecount: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{wrPCachePagecount})), FxFetch: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uint32, int32) uintptr
}{wrPCacheFetch})), FxUnpin: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32)
+ f func(*libc.TLS, uintptr, uintptr, int32)
}{wrPCacheUnpin})), FxRekey: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uint32, uint32)
+ f func(*libc.TLS, uintptr, uintptr, uint32, uint32)
}{wrPCacheRekey})), FxTruncate: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uint32)
- }{wrPCacheTruncate})), FxDestroy: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{wrPCacheDestroy})),
+ f func(*libc.TLS, uintptr, uint32)
+ }{wrPCacheTruncate})), FxDestroy: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{wrPCacheDestroy})),
}
- *(*sqlite3_mem_methods)(unsafe.Pointer(bp + 120 /* memmethods */)) = sqlite3_mem_methods{FxMalloc: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, int32) uintptr }{wrMemMalloc})), FxFree: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{wrMemFree})), FxRealloc: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) uintptr
- }{wrMemRealloc})), FxSize: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{wrMemSize})), FxRoundup: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, int32) int32 }{wrMemRoundup})), FxInit: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{wrMemInit})), FxShutdown: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{wrMemShutdown})), FpAppData: uintptr(0),
+ *(*sqlite3_mem_methods)(unsafe.Pointer(bp + 120 /* memmethods */)) = sqlite3_mem_methods{FxMalloc: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, int32) uintptr
+ }{wrMemMalloc})), FxFree: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{wrMemFree})), FxRealloc: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{wrMemRealloc})), FxSize: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{wrMemSize})), FxRoundup: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{wrMemRoundup})), FxInit: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{wrMemInit})), FxShutdown: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{wrMemShutdown})), FpAppData: uintptr(0),
}
- crt.Xmemset(tls, uintptr(unsafe.Pointer(&wrapped)), 0, uint64(unsafe.Sizeof(wrapped)))
+ libc.Xmemset(tls, uintptr(unsafe.Pointer(&wrapped)), 0, uint64(unsafe.Sizeof(wrapped)))
sqlite3.Xsqlite3_shutdown(tls)
- sqlite3.Xsqlite3_config(tls, 11, crt.VaList(bp, (uintptr(unsafe.Pointer(&wrapped))+168 /* &.mutex */)))
- sqlite3.Xsqlite3_config(tls, 5, crt.VaList(bp+8, (uintptr(unsafe.Pointer(&wrapped))+104 /* &.mem */)))
- sqlite3.Xsqlite3_config(tls, 19, crt.VaList(bp+16, (uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */)))
- sqlite3.Xsqlite3_config(tls, 10, crt.VaList(bp+24, bp+48 /* &mutexmethods */))
- sqlite3.Xsqlite3_config(tls, 4, crt.VaList(bp+32, bp+120 /* &memmethods */))
- sqlite3.Xsqlite3_config(tls, 18, crt.VaList(bp+40, bp+184 /* &pcachemethods */))
+ sqlite3.Xsqlite3_config(tls, 11, libc.VaList(bp, (uintptr(unsafe.Pointer(&wrapped))+168 /* &.mutex */)))
+ sqlite3.Xsqlite3_config(tls, 5, libc.VaList(bp+8, (uintptr(unsafe.Pointer(&wrapped))+104 /* &.mem */)))
+ sqlite3.Xsqlite3_config(tls, 19, libc.VaList(bp+16, (uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */)))
+ sqlite3.Xsqlite3_config(tls, 10, libc.VaList(bp+24, bp+48 /* &mutexmethods */))
+ sqlite3.Xsqlite3_config(tls, 4, libc.VaList(bp+32, bp+120 /* &memmethods */))
+ sqlite3.Xsqlite3_config(tls, 18, libc.VaList(bp+40, bp+184 /* &pcachemethods */))
}
-func init_wrapper_install(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_init.c:191:26: */
+func init_wrapper_install(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_init.c:191:26: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -57323,21 +62086,21 @@ func init_wrapper_install(tls *crt.TLS, clientData ClientData, interp uintptr, o
installInitWrappers(tls)
for i = 1; i < objc; i++ {
var z uintptr = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))
- if crt.Xstrcmp(tls, z, ts+29361 /* "mem" */) == 0 {
+ if libc.Xstrcmp(tls, z, ts+31453 /* "mem" */) == 0 {
wrapped.Fmem_fail = 1
- } else if crt.Xstrcmp(tls, z, ts+25895 /* "mutex" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+27987 /* "mutex" */) == 0 {
wrapped.Fmutex_fail = 1
- } else if crt.Xstrcmp(tls, z, ts+29365 /* "pcache" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+31457 /* "pcache" */) == 0 {
wrapped.Fpcache_fail = 1
} else {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+29372 /* "Unknown argument..." */, z, ts+9801 /* "\"" */))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31464 /* "Unknown argument..." */, z, ts+11456 /* "\"" */))
return 1
}
}
return 0
}
-func init_wrapper_uninstall(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_init.c:215:26: */
+func init_wrapper_uninstall(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_init.c:215:26: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -57347,13 +62110,13 @@ func init_wrapper_uninstall(tls *crt.TLS, clientData ClientData, interp uintptr,
}
sqlite3.Xsqlite3_shutdown(tls)
- sqlite3.Xsqlite3_config(tls, 10, crt.VaList(bp, (uintptr(unsafe.Pointer(&wrapped))+168 /* &.mutex */)))
- sqlite3.Xsqlite3_config(tls, 4, crt.VaList(bp+8, (uintptr(unsafe.Pointer(&wrapped))+104 /* &.mem */)))
- sqlite3.Xsqlite3_config(tls, 18, crt.VaList(bp+16, (uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */)))
+ sqlite3.Xsqlite3_config(tls, 10, libc.VaList(bp, (uintptr(unsafe.Pointer(&wrapped))+168 /* &.mutex */)))
+ sqlite3.Xsqlite3_config(tls, 4, libc.VaList(bp+8, (uintptr(unsafe.Pointer(&wrapped))+104 /* &.mem */)))
+ sqlite3.Xsqlite3_config(tls, 18, libc.VaList(bp+16, (uintptr(unsafe.Pointer(&wrapped)) /* &.pcache */)))
return 0
}
-func init_wrapper_clear(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_init.c:233:26: */
+func init_wrapper_clear(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_init.c:233:26: */
if objc != 1 {
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */)
return 1
@@ -57365,7 +62128,7 @@ func init_wrapper_clear(tls *crt.TLS, clientData ClientData, interp uintptr, obj
return 0
}
-func init_wrapper_query(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_init.c:250:26: */
+func init_wrapper_query(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_init.c:250:26: */
var pRet uintptr
if objc != 1 {
@@ -57375,40 +62138,40 @@ func init_wrapper_query(tls *crt.TLS, clientData ClientData, interp uintptr, obj
pRet = tcl.XTcl_NewObj(tls)
if wrapped.Fmutex_init != 0 {
- tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+25895 /* "mutex" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+27987 /* "mutex" */, -1))
}
if wrapped.Fmem_init != 0 {
- tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+29361 /* "mem" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+31453 /* "mem" */, -1))
}
if wrapped.Fpcache_init != 0 {
- tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+29365 /* "pcache" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pRet, tcl.XTcl_NewStringObj(tls, ts+31457 /* "pcache" */, -1))
}
tcl.XTcl_SetObjResult(tls, interp, pRet)
return 0
}
-func Sqlitetest_init_Init(tls *crt.TLS, interp uintptr) int32 { /* test_init.c:278:5: */
+func Sqlitetest_init_Init(tls *libc.TLS, interp uintptr) int32 { /* test_init.c:278:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd8)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd9)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd8[i].FzName, aObjCmd8[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd9[i].FzName, aObjCmd9[i].FxProc, uintptr(0), uintptr(0))
}
return 0
}
-var aObjCmd8 = [4]struct {
+var aObjCmd9 = [4]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 29392 /* "init_wrapper_ins..." */, FxProc: 0},
- {FzName: ts + 29413 /* "init_wrapper_que..." */, FxProc: 0},
- {FzName: ts + 29432 /* "init_wrapper_uni..." */, FxProc: 0},
- {FzName: ts + 29455 /* "init_wrapper_cle..." */, FxProc: 0},
+ {FzName: ts + 31484 /* "init_wrapper_ins..." */, FxProc: 0},
+ {FzName: ts + 31505 /* "init_wrapper_que..." */, FxProc: 0},
+ {FzName: ts + 31524 /* "init_wrapper_uni..." */, FxProc: 0},
+ {FzName: ts + 31547 /* "init_wrapper_cle..." */, FxProc: 0},
} /* test_init.c:282:5 */
//
@@ -57458,41 +62221,41 @@ type intarray_cursor = intarray_cursor1 /* test_intarray.c:42:32 */
// None of this works unless we have virtual tables.
// Free an sqlite3_intarray object.
-func intarrayFree(tls *crt.TLS, p uintptr) { /* test_intarray.c:64:13: */
+func intarrayFree(tls *libc.TLS, p uintptr) { /* test_intarray.c:64:13: */
if (*sqlite3_intarray)(unsafe.Pointer(p)).FxFree != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((p + 16 /* &.xFree */))))(tls, (*sqlite3_intarray)(unsafe.Pointer(p)).Fa)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((p + 16 /* &.xFree */))))(tls, (*sqlite3_intarray)(unsafe.Pointer(p)).Fa)
}
sqlite3.Xsqlite3_free(tls, p)
}
// Table destructor for the intarray module.
-func intarrayDestroy(tls *crt.TLS, p uintptr) int32 { /* test_intarray.c:74:12: */
+func intarrayDestroy(tls *libc.TLS, p uintptr) int32 { /* test_intarray.c:74:12: */
var pVtab uintptr = p
sqlite3.Xsqlite3_free(tls, pVtab)
return 0
}
// Table constructor for the intarray module.
-func intarrayCreate(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_intarray.c:83:12: */
+func intarrayCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_intarray.c:83:12: */
var rc int32 = 7
var pVtab uintptr = sqlite3.Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(intarray_vtab{})))
if pVtab != 0 {
- crt.Xmemset(tls, pVtab, 0, uint64(unsafe.Sizeof(intarray_vtab{})))
+ libc.Xmemset(tls, pVtab, 0, uint64(unsafe.Sizeof(intarray_vtab{})))
(*intarray_vtab)(unsafe.Pointer(pVtab)).FpContent = pAux
- rc = sqlite3.Xsqlite3_declare_vtab(tls, db, ts+29474 /* "CREATE TABLE x(v..." */)
+ rc = sqlite3.Xsqlite3_declare_vtab(tls, db, ts+31566 /* "CREATE TABLE x(v..." */)
}
*(*uintptr)(unsafe.Pointer(ppVtab)) = pVtab
return rc
}
// Open a new cursor on the intarray table.
-func intarrayOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_intarray.c:106:12: */
+func intarrayOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_intarray.c:106:12: */
var rc int32 = 7
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(intarray_cursor{})))
if pCur != 0 {
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(intarray_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(intarray_cursor{})))
*(*uintptr)(unsafe.Pointer(ppCursor)) = pCur
rc = 0
}
@@ -57500,14 +62263,14 @@ func intarrayOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test
}
// Close a intarray table cursor.
-func intarrayClose(tls *crt.TLS, cur uintptr) int32 { /* test_intarray.c:121:12: */
+func intarrayClose(tls *libc.TLS, cur uintptr) int32 { /* test_intarray.c:121:12: */
var pCur uintptr = cur
sqlite3.Xsqlite3_free(tls, pCur)
return 0
}
// Retrieve a column of data.
-func intarrayColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_intarray.c:130:12: */
+func intarrayColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_intarray.c:130:12: */
var pCur uintptr = cur
var pVtab uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
if ((*intarray_cursor)(unsafe.Pointer(pCur)).Fi >= 0) && ((*intarray_cursor)(unsafe.Pointer(pCur)).Fi < (*sqlite3_intarray)(unsafe.Pointer((*intarray_vtab)(unsafe.Pointer(pVtab)).FpContent)).Fn) {
@@ -57517,34 +62280,34 @@ func intarrayColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /*
}
// Retrieve the current rowid.
-func intarrayRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* test_intarray.c:142:12: */
+func intarrayRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* test_intarray.c:142:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = sqlite_int64((*intarray_cursor)(unsafe.Pointer(pCur)).Fi)
return 0
}
-func intarrayEof(tls *crt.TLS, cur uintptr) int32 { /* test_intarray.c:148:12: */
+func intarrayEof(tls *libc.TLS, cur uintptr) int32 { /* test_intarray.c:148:12: */
var pCur uintptr = cur
var pVtab uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
- return (crt.Bool32((*intarray_cursor)(unsafe.Pointer(pCur)).Fi >= (*sqlite3_intarray)(unsafe.Pointer((*intarray_vtab)(unsafe.Pointer(pVtab)).FpContent)).Fn))
+ return (libc.Bool32((*intarray_cursor)(unsafe.Pointer(pCur)).Fi >= (*sqlite3_intarray)(unsafe.Pointer((*intarray_vtab)(unsafe.Pointer(pVtab)).FpContent)).Fn))
}
// Advance the cursor to the next row.
-func intarrayNext(tls *crt.TLS, cur uintptr) int32 { /* test_intarray.c:157:12: */
+func intarrayNext(tls *libc.TLS, cur uintptr) int32 { /* test_intarray.c:157:12: */
var pCur uintptr = cur
(*intarray_cursor)(unsafe.Pointer(pCur)).Fi++
return 0
}
// Reset a intarray table cursor.
-func intarrayFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_intarray.c:166:12: */
+func intarrayFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_intarray.c:166:12: */
var pCur uintptr = pVtabCursor
(*intarray_cursor)(unsafe.Pointer(pCur)).Fi = 0
return 0
}
// Analyse the WHERE condition.
-func intarrayBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_intarray.c:179:12: */
+func intarrayBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_intarray.c:179:12: */
return 0
}
@@ -57581,24 +62344,24 @@ uintptr(0), // xRename
// Destroy the intarray object by dropping the virtual table. If not done
// explicitly by the application, the virtual table will be dropped implicitly
// by the system when the database connection is closed.
-func sqlite3_intarray_create(tls *crt.TLS, db uintptr, zName uintptr, ppReturn uintptr) int32 { /* test_intarray.c:223:16: */
+func sqlite3_intarray_create(tls *libc.TLS, db uintptr, zName uintptr, ppReturn uintptr) int32 { /* test_intarray.c:223:16: */
bp := tls.Alloc(16)
defer tls.Free(16)
var rc int32 = 0
var p uintptr
- *(*uintptr)(unsafe.Pointer(ppReturn)) = crt.AssignUintptr(&p, sqlite3.Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(sqlite3_intarray{}))))
+ *(*uintptr)(unsafe.Pointer(ppReturn)) = libc.AssignUintptr(&p, sqlite3.Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(sqlite3_intarray{}))))
if p == uintptr(0) {
return 7
}
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(sqlite3_intarray{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(sqlite3_intarray{})))
rc = sqlite3.Xsqlite3_create_module_v2(tls, db, zName, uintptr(unsafe.Pointer(&intarrayModule)), p,
- *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{intarrayFree})))
+ *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{intarrayFree})))
if rc == 0 {
var zSql uintptr
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+29516, /* "CREATE VIRTUAL T..." */
- crt.VaList(bp, zName, zName))
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+31608, /* "CREATE VIRTUAL T..." */
+ libc.VaList(bp, zName, zName))
rc = sqlite3.Xsqlite3_exec(tls, db, zSql, uintptr(0), uintptr(0), uintptr(0))
sqlite3.Xsqlite3_free(tls, zSql)
}
@@ -57610,9 +62373,9 @@ func sqlite3_intarray_create(tls *crt.TLS, db uintptr, zName uintptr, ppReturn u
// The array of integers bound must be unchanged for the duration of
// any query against the corresponding virtual table. If the integer
// array does change or is deallocated undefined behavior will result.
-func sqlite3_intarray_bind(tls *crt.TLS, pIntArray uintptr, nElements int32, aElements uintptr, xFree uintptr) int32 { /* test_intarray.c:257:16: */
+func sqlite3_intarray_bind(tls *libc.TLS, pIntArray uintptr, nElements int32, aElements uintptr, xFree uintptr) int32 { /* test_intarray.c:257:16: */
if (*sqlite3_intarray)(unsafe.Pointer(pIntArray)).FxFree != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pIntArray + 16 /* &.xFree */))))(tls, (*sqlite3_intarray)(unsafe.Pointer(pIntArray)).Fa)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pIntArray + 16 /* &.xFree */))))(tls, (*sqlite3_intarray)(unsafe.Pointer(pIntArray)).Fa)
}
(*sqlite3_intarray)(unsafe.Pointer(pIntArray)).Fn = nElements
(*sqlite3_intarray)(unsafe.Pointer(pIntArray)).Fa = aElements
@@ -57624,7 +62387,7 @@ func sqlite3_intarray_bind(tls *crt.TLS, pIntArray uintptr, nElements int32, aEl
//
// Invoke the sqlite3_intarray_create interface. A string that becomes
// the first parameter to sqlite3_intarray_bind.
-func test_intarray_create(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_intarray.c:300:26: */
+func test_intarray_create(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_intarray.c:300:26: */
bp := tls.Alloc(148)
defer tls.Free(148)
@@ -57646,18 +62409,18 @@ func test_intarray_create(tls *crt.TLS, clientData ClientData, interp uintptr, o
zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
rc = sqlite3_intarray_create(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), zName, bp+40 /* &pArray */)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0)))
return 1
}
sqlite3TestMakePointerStr(tls, interp, bp+48 /* &zPtr[0] */, *(*uintptr)(unsafe.Pointer(bp + 40 /* pArray */)))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+16, bp+48 /* &zPtr[0] */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, bp+48 /* &zPtr[0] */, uintptr(0)))
return 0
}
// sqlite3_intarray_bind INTARRAY ?VALUE ...?
//
// Invoke the sqlite3_intarray_bind interface on the given array of integers.
-func test_intarray_bind(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_intarray.c:335:26: */
+func test_intarray_bind(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_intarray.c:335:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -57668,14 +62431,14 @@ func test_intarray_bind(tls *crt.TLS, clientData ClientData, interp uintptr, obj
var a uintptr
if objc < 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29554 /* "INTARRAY" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31646 /* "INTARRAY" */)
return 1
}
pArray = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
n = (objc - 2)
a = sqlite3.Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(sqlite3_int64(0))) * uint64(n))))
if a == uintptr(0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+29563 /* "SQLITE_NOMEM" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31655 /* "SQLITE_NOMEM" */, uintptr(0)))
return 1
}
for i = 0; i < n; i++ {
@@ -57683,35 +62446,35 @@ func test_intarray_bind(tls *crt.TLS, clientData ClientData, interp uintptr, obj
tcl.XTcl_GetWideIntFromObj(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(objv + uintptr((i+2))*8)), bp+32 /* &x */)
*(*sqlite3_int64)(unsafe.Pointer(a + uintptr(i)*8)) = sqlite3_int64(*(*Tcl_WideInt)(unsafe.Pointer(bp + 32 /* x */)))
}
- rc = sqlite3_intarray_bind(tls, pArray, n, a, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ rc = sqlite3_intarray_bind(tls, pArray, n, a, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+16, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0)))
return 1
}
return 0
}
// Register commands with the TCL interpreter.
-func Sqlitetestintarray_Init(tls *crt.TLS, interp uintptr) int32 { /* test_intarray.c:375:5: */
+func Sqlitetestintarray_Init(tls *libc.TLS, interp uintptr) int32 { /* test_intarray.c:375:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd9)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd10)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd9[i].FzName,
- aObjCmd9[i].FxProc, aObjCmd9[i].FclientData, uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd10[i].FzName,
+ aObjCmd10[i].FxProc, aObjCmd10[i].FclientData, uintptr(0))
}
return 0
}
-var aObjCmd9 = [2]struct {
+var aObjCmd10 = [2]struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{
- {FzName: ts + 29576 /* "sqlite3_intarray..." */, FxProc: 0, FclientData: uintptr(0)},
- {FzName: ts + 29600 /* "sqlite3_intarray..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 31668 /* "sqlite3_intarray..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 31692 /* "sqlite3_intarray..." */, FxProc: 0, FclientData: uintptr(0)},
} /* test_intarray.c:380:5 */
// Maximum pathname length supported by the jt backend.
@@ -57723,8 +62486,8 @@ type jt_file1 = struct {
FzName uintptr
Fflags int32
FeLock int32
- FnPage u321
- FnPagesize u321
+ FnPage u322
+ FnPagesize u322
FpWritable uintptr
FaCksum uintptr
FnSync int32
@@ -57743,7 +62506,7 @@ var jt_vfs = sqlite3_vfs{FiVersion: 2, FszOsFile: // iVersion
int32(unsafe.Sizeof(jt_file{})), FmxPathname:// szOsFile
512, FpNext:// mxPathname
uintptr(0), FzName:// pNext
-ts + 29622, /* "jt" */ FpAppData:// zName
+ts + 31714, /* "jt" */ FpAppData:// zName
uintptr(0), FxOpen:// pAppData
0, FxDelete:// xOpen
0, FxAccess:// xDelete
@@ -57784,19 +62547,19 @@ var g2 = JtGlobal{FpVfs: uintptr(0), FpList: uintptr(0)} /* test_journal.c:207:2
// Functions to obtain and relinquish a mutex to protect g.pList. The
// STATIC_PRNG mutex is reused, purely for the sake of convenience.
-func enterJtMutex(tls *crt.TLS) { /* test_journal.c:213:13: */
+func enterJtMutex(tls *libc.TLS) { /* test_journal.c:213:13: */
sqlite3.Xsqlite3_mutex_enter(tls, sqlite3.Xsqlite3_mutex_alloc(tls, 5))
}
-func leaveJtMutex(tls *crt.TLS) { /* test_journal.c:216:13: */
+func leaveJtMutex(tls *libc.TLS) { /* test_journal.c:216:13: */
sqlite3.Xsqlite3_mutex_leave(tls, sqlite3.Xsqlite3_mutex_alloc(tls, 5))
}
-func stop_ioerr_simulation(tls *crt.TLS, piSave uintptr, piSave2 uintptr) { /* test_journal.c:222:13: */
+func stop_ioerr_simulation(tls *libc.TLS, piSave uintptr, piSave2 uintptr) { /* test_journal.c:222:13: */
*(*int32)(unsafe.Pointer(piSave)) = sqlite3.Xsqlite3_io_error_pending
*(*int32)(unsafe.Pointer(piSave2)) = sqlite3.Xsqlite3_io_error_hit
sqlite3.Xsqlite3_io_error_pending = -1
sqlite3.Xsqlite3_io_error_hit = 0
}
-func start_ioerr_simulation(tls *crt.TLS, iSave int32, iSave2 int32) { /* test_journal.c:228:13: */
+func start_ioerr_simulation(tls *libc.TLS, iSave int32, iSave2 int32) { /* test_journal.c:228:13: */
sqlite3.Xsqlite3_io_error_pending = iSave
sqlite3.Xsqlite3_io_error_hit = iSave2
}
@@ -57804,7 +62567,7 @@ func start_ioerr_simulation(tls *crt.TLS, iSave int32, iSave2 int32) { /* test_j
// The jt_file pointed to by the argument may or may not be a file-handle
// open on a main database file. If it is, and a transaction is currently
// opened on the file, then discard all transaction related data.
-func closeTransaction(tls *crt.TLS, p uintptr) { /* test_journal.c:238:13: */
+func closeTransaction(tls *libc.TLS, p uintptr) { /* test_journal.c:238:13: */
sqlite3.Xsqlite3BitvecDestroy(tls, (*jt_file)(unsafe.Pointer(p)).FpWritable)
sqlite3.Xsqlite3_free(tls, (*jt_file)(unsafe.Pointer(p)).FaCksum)
(*jt_file)(unsafe.Pointer(p)).FpWritable = uintptr(0)
@@ -57813,7 +62576,7 @@ func closeTransaction(tls *crt.TLS, p uintptr) { /* test_journal.c:238:13: */
}
// Close an jt-file.
-func jtClose(tls *crt.TLS, pFile uintptr) int32 { /* test_journal.c:249:12: */
+func jtClose(tls *libc.TLS, pFile uintptr) int32 { /* test_journal.c:249:12: */
var pp uintptr
var p uintptr = pFile
@@ -57830,7 +62593,7 @@ func jtClose(tls *crt.TLS, pFile uintptr) int32 { /* test_journal.c:249:12: */
}
// Read data from an jt-file.
-func jtRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_journal.c:267:12: */
+func jtRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_journal.c:267:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsRead(tls, (*jt_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst)
}
@@ -57850,14 +62613,14 @@ func jtRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_
// c) There is currently a reserved lock on the file. This
// condition is waived if the noLock argument is non-zero.
//
-func locateDatabaseHandle(tls *crt.TLS, zJournal uintptr, noLock int32) uintptr { /* test_journal.c:292:16: */
+func locateDatabaseHandle(tls *libc.TLS, zJournal uintptr, noLock int32) uintptr { /* test_journal.c:292:16: */
var pMain uintptr = uintptr(0)
enterJtMutex(tls)
for pMain = g2.FpList; pMain != 0; pMain = (*jt_file)(unsafe.Pointer(pMain)).FpNext {
- var nName int32 = (int32(crt.Xstrlen(tls, zJournal) - crt.Xstrlen(tls, ts+29625 /* "-journal" */)))
+ var nName int32 = (int32(libc.Xstrlen(tls, zJournal) - libc.Xstrlen(tls, ts+31717 /* "-journal" */)))
if (((((*jt_file)(unsafe.Pointer(pMain)).Fflags & 0x00000100) != 0) &&
- (int32(crt.Xstrlen(tls, (*jt_file)(unsafe.Pointer(pMain)).FzName)) == nName)) &&
- (0 == crt.Xmemcmp(tls, (*jt_file)(unsafe.Pointer(pMain)).FzName, zJournal, uint64(nName)))) &&
+ (int32(libc.Xstrlen(tls, (*jt_file)(unsafe.Pointer(pMain)).FzName)) == nName)) &&
+ (0 == libc.Xmemcmp(tls, (*jt_file)(unsafe.Pointer(pMain)).FzName, zJournal, uint64(nName)))) &&
(((*jt_file)(unsafe.Pointer(pMain)).FeLock >= 2) || (noLock != 0)) {
break
}
@@ -57869,17 +62632,17 @@ func locateDatabaseHandle(tls *crt.TLS, zJournal uintptr, noLock int32) uintptr
// Parameter z points to a buffer of 4 bytes in size containing a
// unsigned 32-bit integer stored in big-endian format. Decode the
// integer and return its value.
-func decodeUint32(tls *crt.TLS, z uintptr) u321 { /* test_journal.c:314:12: */
- return (u321((((int32(*(*uint8)(unsafe.Pointer(z + uintptr(0)))) << 24) + (int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))) << 16)) + (int32(*(*uint8)(unsafe.Pointer(z + uintptr(2)))) << 8)) + int32(*(*uint8)(unsafe.Pointer(z + uintptr(3))))))
+func decodeUint32(tls *libc.TLS, z uintptr) u322 { /* test_journal.c:314:12: */
+ return (u322((((int32(*(*uint8)(unsafe.Pointer(z + uintptr(0)))) << 24) + (int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))) << 16)) + (int32(*(*uint8)(unsafe.Pointer(z + uintptr(2)))) << 8)) + int32(*(*uint8)(unsafe.Pointer(z + uintptr(3))))))
}
// Calculate a checksum from the buffer of length n bytes pointed to
// by parameter z.
-func genCksum(tls *crt.TLS, z uintptr, n int32) u321 { /* test_journal.c:322:12: */
+func genCksum(tls *libc.TLS, z uintptr, n int32) u322 { /* test_journal.c:322:12: */
var i int32
- var cksum u321 = u321(0)
+ var cksum u322 = u322(0)
for i = 0; i < n; i++ {
- cksum = ((cksum + u321(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) + (cksum << 3))
+ cksum = ((cksum + u322(*(*uint8)(unsafe.Pointer(z + uintptr(i))))) + (cksum << 3))
}
return cksum
}
@@ -57891,32 +62654,32 @@ func genCksum(tls *crt.TLS, z uintptr, n int32) u321 { /* test_journal.c:322:12:
//
// SQLITE_OK is returned if the journal-header is successfully
// decoded. Otherwise, SQLITE_ERROR.
-func decodeJournalHdr(tls *crt.TLS, zBuf uintptr, pnRec uintptr, pnPage uintptr, pnSector uintptr, pnPagesize uintptr) int32 { /* test_journal.c:340:12: */
+func decodeJournalHdr(tls *libc.TLS, zBuf uintptr, pnRec uintptr, pnPage uintptr, pnSector uintptr, pnPagesize uintptr) int32 { /* test_journal.c:340:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*[8]uint8)(unsafe.Pointer(bp /* aMagic */)) = [8]uint8{uint8(0xd9), uint8(0xd5), uint8(0x05), uint8(0xf9), uint8(0x20), uint8(0xa1), uint8(0x63), uint8(0xd7)}
- if crt.Xmemcmp(tls, bp /* &aMagic[0] */, zBuf, uint64(8)) != 0 {
+ if libc.Xmemcmp(tls, bp /* &aMagic[0] */, zBuf, uint64(8)) != 0 {
return 1
}
if pnRec != 0 {
- *(*u321)(unsafe.Pointer(pnRec)) = decodeUint32(tls, (zBuf + uintptr(8)))
+ *(*u322)(unsafe.Pointer(pnRec)) = decodeUint32(tls, (zBuf + uintptr(8)))
}
if pnPage != 0 {
- *(*u321)(unsafe.Pointer(pnPage)) = decodeUint32(tls, (zBuf + uintptr(16)))
+ *(*u322)(unsafe.Pointer(pnPage)) = decodeUint32(tls, (zBuf + uintptr(16)))
}
if pnSector != 0 {
- *(*u321)(unsafe.Pointer(pnSector)) = decodeUint32(tls, (zBuf + uintptr(20)))
+ *(*u322)(unsafe.Pointer(pnSector)) = decodeUint32(tls, (zBuf + uintptr(20)))
}
if pnPagesize != 0 {
- *(*u321)(unsafe.Pointer(pnPagesize)) = decodeUint32(tls, (zBuf + uintptr(24)))
+ *(*u322)(unsafe.Pointer(pnPagesize)) = decodeUint32(tls, (zBuf + uintptr(24)))
}
return 0
}
// This function is called when a new transaction is opened, just after
// the first journal-header is written to the journal file.
-func openTransaction(tls *crt.TLS, pMain uintptr, pJournal uintptr) int32 { /* test_journal.c:360:12: */
+func openTransaction(tls *libc.TLS, pMain uintptr, pJournal uintptr) int32 { /* test_journal.c:360:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -57927,13 +62690,13 @@ func openTransaction(tls *crt.TLS, pMain uintptr, pJournal uintptr) int32 { /* t
closeTransaction(tls, pMain)
aData = sqlite3.Xsqlite3_malloc(tls, int32((*jt_file)(unsafe.Pointer(pMain)).FnPagesize))
(*jt_file)(unsafe.Pointer(pMain)).FpWritable = sqlite3.Xsqlite3BitvecCreate(tls, (*jt_file)(unsafe.Pointer(pMain)).FnPage)
- (*jt_file)(unsafe.Pointer(pMain)).FaCksum = sqlite3.Xsqlite3_malloc(tls, (int32(uint64(unsafe.Sizeof(u321(0))) * (uint64((*jt_file)(unsafe.Pointer(pMain)).FnPage + u321(1))))))
+ (*jt_file)(unsafe.Pointer(pMain)).FaCksum = sqlite3.Xsqlite3_malloc(tls, (int32(uint64(unsafe.Sizeof(u322(0))) * (uint64((*jt_file)(unsafe.Pointer(pMain)).FnPage + u322(1))))))
(*jt_file)(unsafe.Pointer(pJournal)).FiMaxOff = int64(0)
if (!(int32((*jt_file)(unsafe.Pointer(pMain)).FpWritable) != 0) || !(int32((*jt_file)(unsafe.Pointer(pMain)).FaCksum) != 0)) || !(aData != 0) {
rc = (10 | (int32(12) << 8))
- } else if (*jt_file)(unsafe.Pointer(pMain)).FnPage > u321(0) {
- var iTrunk u321
+ } else if (*jt_file)(unsafe.Pointer(pMain)).FnPage > u322(0) {
+ var iTrunk u322
// var iSave int32 at bp, 4
// var iSave2 int32 at bp+4, 4
@@ -57944,23 +62707,23 @@ func openTransaction(tls *crt.TLS, pMain uintptr, pJournal uintptr) int32 { /* t
// leaf to the jt_file.pWritable bitvec.
rc = sqlite3.Xsqlite3OsRead(tls, p, aData, int32((*jt_file)(unsafe.Pointer(pMain)).FnPagesize), int64(0))
if rc == 0 {
- var nDbsize u321 = decodeUint32(tls, (aData + uintptr(28)))
- if (nDbsize > u321(0)) && (crt.Xmemcmp(tls, (aData+uintptr(24)), (aData+uintptr(92)), uint64(4)) == 0) {
- var iPg u321
- for iPg = (nDbsize + u321(1)); iPg <= (*jt_file)(unsafe.Pointer(pMain)).FnPage; iPg++ {
+ var nDbsize u322 = decodeUint32(tls, (aData + uintptr(28)))
+ if (nDbsize > u322(0)) && (libc.Xmemcmp(tls, (aData+uintptr(24)), (aData+uintptr(92)), uint64(4)) == 0) {
+ var iPg u322
+ for iPg = (nDbsize + u322(1)); iPg <= (*jt_file)(unsafe.Pointer(pMain)).FnPage; iPg++ {
sqlite3.Xsqlite3BitvecSet(tls, (*jt_file)(unsafe.Pointer(pMain)).FpWritable, iPg)
}
}
}
iTrunk = decodeUint32(tls, (aData + uintptr(32)))
- for (rc == 0) && (iTrunk > u321(0)) {
- var nLeaf u321
- var iLeaf u321
- var iOff sqlite3_int64 = ((i64(iTrunk - u321(1))) * i64((*jt_file)(unsafe.Pointer(pMain)).FnPagesize))
+ for (rc == 0) && (iTrunk > u322(0)) {
+ var nLeaf u322
+ var iLeaf u322
+ var iOff sqlite3_int64 = ((i64(iTrunk - u322(1))) * i64((*jt_file)(unsafe.Pointer(pMain)).FnPagesize))
rc = sqlite3.Xsqlite3OsRead(tls, p, aData, int32((*jt_file)(unsafe.Pointer(pMain)).FnPagesize), iOff)
nLeaf = decodeUint32(tls, (aData + uintptr(4)))
- for iLeaf = u321(0); (rc == 0) && (iLeaf < nLeaf); iLeaf++ {
- var pgno u321 = decodeUint32(tls, (aData + uintptr((u321(8) + (u321(4) * iLeaf)))))
+ for iLeaf = u322(0); (rc == 0) && (iLeaf < nLeaf); iLeaf++ {
+ var pgno u322 = decodeUint32(tls, (aData + uintptr((u322(8) + (u322(4) * iLeaf)))))
sqlite3.Xsqlite3BitvecSet(tls, (*jt_file)(unsafe.Pointer(pMain)).FpWritable, pgno)
}
iTrunk = decodeUint32(tls, aData)
@@ -57975,7 +62738,7 @@ func openTransaction(tls *crt.TLS, pMain uintptr, pJournal uintptr) int32 { /* t
continue
}
rc = sqlite3.Xsqlite3OsRead(tls, (*jt_file)(unsafe.Pointer(pMain)).FpReal, aData, int32((*jt_file)(unsafe.Pointer(pMain)).FnPagesize), iOff)
- *(*u321)(unsafe.Pointer((*jt_file)(unsafe.Pointer(pMain)).FaCksum + uintptr(ii)*4)) = genCksum(tls, aData, int32((*jt_file)(unsafe.Pointer(pMain)).FnPagesize))
+ *(*u322)(unsafe.Pointer((*jt_file)(unsafe.Pointer(pMain)).FaCksum + uintptr(ii)*4)) = genCksum(tls, aData, int32((*jt_file)(unsafe.Pointer(pMain)).FnPagesize))
if ((ii + 1) == int32((*jt_file)(unsafe.Pointer(pMain)).FnPage)) && (rc == (10 | (int32(2) << 8))) {
rc = 0
}
@@ -57992,7 +62755,7 @@ func openTransaction(tls *crt.TLS, pMain uintptr, pJournal uintptr) int32 { /* t
// The first argument to this function is a handle open on a journal file.
// This function reads the journal file and adds the page number for each
// page in the journal to the Bitvec object passed as the second argument.
-func readJournalFile(tls *crt.TLS, p uintptr, pMain uintptr) int32 { /* test_journal.c:433:12: */
+func readJournalFile(tls *libc.TLS, p uintptr, pMain uintptr) int32 { /* test_journal.c:433:12: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -58007,18 +62770,18 @@ func readJournalFile(tls *crt.TLS, p uintptr, pMain uintptr) int32 { /* test_jou
// var iSave2 int32 at bp+4, 4
- var cksum u321
+ var cksum u322
_ = cksum
- var pgno u321
- // var nRec u321 at bp+36, 4
+ var pgno u322
+ // var nRec u322 at bp+36, 4
- // var nPage u321 at bp+40, 4
+ // var nPage u322 at bp+40, 4
- // var nSector u321 at bp+44, 4
+ // var nSector u322 at bp+44, 4
- // var nPagesize u321 at bp+48, 4
+ // var nPagesize u322 at bp+48, 4
- var ii u321
+ var ii u322
rc = 0
pReal = (*jt_file)(unsafe.Pointer(p)).FpReal
iOff = int64(0)
@@ -58048,15 +62811,15 @@ __2:
goto finish_rjf
__4:
;
- iOff = iOff + (sqlite3_int64(*(*u321)(unsafe.Pointer(bp + 44 /* nSector */))))
+ iOff = iOff + (sqlite3_int64(*(*u322)(unsafe.Pointer(bp + 44 /* nSector */))))
- if !(*(*u321)(unsafe.Pointer(bp + 36 /* nRec */)) == u321(0)) {
+ if !(*(*u322)(unsafe.Pointer(bp + 36 /* nRec */)) == u322(0)) {
goto __5
}
// A trick. There might be another journal-header immediately
// following this one. In this case, 0 records means 0 records,
// not "read until the end of the file". See also ticket #2565.
- if !(iSize >= (iOff + sqlite3_int64(*(*u321)(unsafe.Pointer(bp + 44 /* nSector */))))) {
+ if !(iSize >= (iOff + sqlite3_int64(*(*u322)(unsafe.Pointer(bp + 44 /* nSector */))))) {
goto __6
}
rc = sqlite3.Xsqlite3OsRead(tls, pReal, bp+8 /* &zBuf[0] */, 28, iOff)
@@ -58068,14 +62831,14 @@ __7:
;
__6:
;
- *(*u321)(unsafe.Pointer(bp + 36 /* nRec */)) = (u321((iSize - iOff) / (sqlite3_int64((*jt_file)(unsafe.Pointer(pMain)).FnPagesize + u321(8)))))
+ *(*u322)(unsafe.Pointer(bp + 36 /* nRec */)) = (u322((iSize - iOff) / (sqlite3_int64((*jt_file)(unsafe.Pointer(pMain)).FnPagesize + u322(8)))))
__5:
;
// Read all the records that follow the journal-header just read.
- ii = u321(0)
+ ii = u322(0)
__8:
- if !(((rc == 0) && (ii < *(*u321)(unsafe.Pointer(bp + 36 /* nRec */)))) && (iOff < iSize)) {
+ if !(((rc == 0) && (ii < *(*u322)(unsafe.Pointer(bp + 36 /* nRec */)))) && (iOff < iSize)) {
goto __10
}
rc = sqlite3.Xsqlite3OsRead(tls, pReal, bp+8 /* &zBuf[0] */, 4, iOff)
@@ -58083,7 +62846,7 @@ __8:
goto __11
}
pgno = decodeUint32(tls, bp+8 /* &zBuf[0] */)
- if !((pgno > u321(0)) && (pgno <= (*jt_file)(unsafe.Pointer(pMain)).FnPage)) {
+ if !((pgno > u322(0)) && (pgno <= (*jt_file)(unsafe.Pointer(pMain)).FnPage)) {
goto __12
}
if !(0 == sqlite3.Xsqlite3BitvecTest(tls, (*jt_file)(unsafe.Pointer(pMain)).FpWritable, pgno)) {
@@ -58101,7 +62864,7 @@ __13:
sqlite3.Xsqlite3BitvecSet(tls, (*jt_file)(unsafe.Pointer(pMain)).FpWritable, pgno)
__12:
;
- iOff = iOff + (sqlite3_int64(u321(8) + (*jt_file)(unsafe.Pointer(pMain)).FnPagesize))
+ iOff = iOff + (sqlite3_int64(u322(8) + (*jt_file)(unsafe.Pointer(pMain)).FnPagesize))
__11:
;
goto __9
@@ -58112,7 +62875,7 @@ __9:
__10:
;
- iOff = (((iOff + (sqlite3_int64(*(*u321)(unsafe.Pointer(bp + 44 /* nSector */)) - u321(1)))) / sqlite3_int64(*(*u321)(unsafe.Pointer(bp + 44 /* nSector */)))) * sqlite3_int64(*(*u321)(unsafe.Pointer(bp + 44 /* nSector */))))
+ iOff = (((iOff + (sqlite3_int64(*(*u322)(unsafe.Pointer(bp + 44 /* nSector */)) - u322(1)))) / sqlite3_int64(*(*u322)(unsafe.Pointer(bp + 44 /* nSector */)))) * sqlite3_int64(*(*u322)(unsafe.Pointer(bp + 44 /* nSector */))))
goto __2
__3:
;
@@ -58130,7 +62893,7 @@ __15:
}
// Write data to an jt-file.
-func jtWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_journal.c:512:12: */
+func jtWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_journal.c:512:12: */
var rc int32
var p uintptr = pFile
if ((*jt_file)(unsafe.Pointer(p)).Fflags & 0x00000800) != 0 {
@@ -58147,7 +62910,7 @@ func jtWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite
var z uintptr = zBuf
(*jt_file)(unsafe.Pointer(pMain)).FnPage = decodeUint32(tls, (z + uintptr(16)))
(*jt_file)(unsafe.Pointer(pMain)).FnPagesize = decodeUint32(tls, (z + uintptr(24)))
- if 0 != (crt.AssignInt32(&rc, openTransaction(tls, pMain, p))) {
+ if 0 != (libc.AssignInt32(&rc, openTransaction(tls, pMain, p))) {
return rc
}
}
@@ -58159,11 +62922,11 @@ func jtWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite
if (((*jt_file)(unsafe.Pointer(p)).Fflags & 0x00000100) != 0) && ((*jt_file)(unsafe.Pointer(p)).FpWritable != 0) {
if (((iAmt < int32((*jt_file)(unsafe.Pointer(p)).FnPagesize)) &&
- (((*jt_file)(unsafe.Pointer(p)).FnPagesize % u321(iAmt)) == u321(0))) &&
+ (((*jt_file)(unsafe.Pointer(p)).FnPagesize % u322(iAmt)) == u322(0))) &&
(iOfst >= (sqlite_int64(sqlite3.Xsqlite3PendingByte + 512)))) &&
- ((iOfst + sqlite_int64(iAmt)) <= (sqlite_int64(u321(sqlite3.Xsqlite3PendingByte) + (*jt_file)(unsafe.Pointer(p)).FnPagesize))) {
+ ((iOfst + sqlite_int64(iAmt)) <= (sqlite_int64(u322(sqlite3.Xsqlite3PendingByte) + (*jt_file)(unsafe.Pointer(p)).FnPagesize))) {
} else {
- var pgno u321 = (u321((iOfst / sqlite_int64((*jt_file)(unsafe.Pointer(p)).FnPagesize)) + int64(1)))
+ var pgno u322 = (u322((iOfst / sqlite_int64((*jt_file)(unsafe.Pointer(p)).FnPagesize)) + int64(1)))
_ = pgno
// The following assert() statements may fail if this layer is used
@@ -58185,7 +62948,7 @@ func jtWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite
}
// Truncate an jt-file.
-func jtTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_journal.c:580:12: */
+func jtTruncate(tls *libc.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_journal.c:580:12: */
var p uintptr = pFile
if (((*jt_file)(unsafe.Pointer(p)).Fflags & 0x00000800) != 0) && (size == int64(0)) {
// Truncating a journal file. This is the end of a transaction.
@@ -58193,17 +62956,17 @@ func jtTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_
closeTransaction(tls, pMain)
}
if (((*jt_file)(unsafe.Pointer(p)).Fflags & 0x00000100) != 0) && ((*jt_file)(unsafe.Pointer(p)).FpWritable != 0) {
- var pgno u321
- var locking_page u321 = ((u321(sqlite3.Xsqlite3PendingByte) / (*jt_file)(unsafe.Pointer(p)).FnPagesize) + u321(1))
+ var pgno u322
+ var locking_page u322 = ((u322(sqlite3.Xsqlite3PendingByte) / (*jt_file)(unsafe.Pointer(p)).FnPagesize) + u322(1))
_ = locking_page
- for pgno = (u321((size / sqlite_int64((*jt_file)(unsafe.Pointer(p)).FnPagesize)) + int64(1))); pgno <= (*jt_file)(unsafe.Pointer(p)).FnPage; pgno++ {
+ for pgno = (u322((size / sqlite_int64((*jt_file)(unsafe.Pointer(p)).FnPagesize)) + int64(1))); pgno <= (*jt_file)(unsafe.Pointer(p)).FnPage; pgno++ {
}
}
return sqlite3.Xsqlite3OsTruncate(tls, (*jt_file)(unsafe.Pointer(p)).FpReal, size)
}
// Sync an jt-file.
-func jtSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_journal.c:600:12: */
+func jtSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* test_journal.c:600:12: */
var p uintptr = pFile
if ((*jt_file)(unsafe.Pointer(p)).Fflags & 0x00000800) != 0 {
@@ -58230,13 +62993,13 @@ func jtSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_journal.c:
}
// Return the current file-size of an jt-file.
-func jtFileSize(tls *crt.TLS, pFile uintptr, pSize uintptr) int32 { /* test_journal.c:630:12: */
+func jtFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* test_journal.c:630:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsFileSize(tls, (*jt_file)(unsafe.Pointer(p)).FpReal, pSize)
}
// Lock an jt-file.
-func jtLock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_journal.c:638:12: */
+func jtLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_journal.c:638:12: */
var rc int32
var p uintptr = pFile
rc = sqlite3.Xsqlite3OsLock(tls, (*jt_file)(unsafe.Pointer(p)).FpReal, eLock)
@@ -58247,7 +63010,7 @@ func jtLock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_journal.c:
}
// Unlock an jt-file.
-func jtUnlock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_journal.c:651:12: */
+func jtUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_journal.c:651:12: */
var rc int32
var p uintptr = pFile
rc = sqlite3.Xsqlite3OsUnlock(tls, (*jt_file)(unsafe.Pointer(p)).FpReal, eLock)
@@ -58258,31 +63021,31 @@ func jtUnlock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_journal.
}
// Check if another file-handle holds a RESERVED lock on an jt-file.
-func jtCheckReservedLock(tls *crt.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_journal.c:664:12: */
+func jtCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_journal.c:664:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsCheckReservedLock(tls, (*jt_file)(unsafe.Pointer(p)).FpReal, pResOut)
}
// File control method. For custom operations on an jt-file.
-func jtFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_journal.c:672:12: */
+func jtFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_journal.c:672:12: */
var p uintptr = pFile
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*jt_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 80 /* &.xFileControl */))))(tls, (*jt_file)(unsafe.Pointer(p)).FpReal, op, pArg)
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*jt_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 80 /* &.xFileControl */))))(tls, (*jt_file)(unsafe.Pointer(p)).FpReal, op, pArg)
}
// Return the sector-size in bytes for an jt-file.
-func jtSectorSize(tls *crt.TLS, pFile uintptr) int32 { /* test_journal.c:680:12: */
+func jtSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* test_journal.c:680:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsSectorSize(tls, (*jt_file)(unsafe.Pointer(p)).FpReal)
}
// Return the device characteristic flags supported by an jt-file.
-func jtDeviceCharacteristics(tls *crt.TLS, pFile uintptr) int32 { /* test_journal.c:688:12: */
+func jtDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* test_journal.c:688:12: */
var p uintptr = pFile
return sqlite3.Xsqlite3OsDeviceCharacteristics(tls, (*jt_file)(unsafe.Pointer(p)).FpReal)
}
// Open an jt file handle.
-func jtOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_journal.c:696:12: */
+func jtOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_journal.c:696:12: */
var rc int32
var p uintptr = pFile
(*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods = uintptr(0)
@@ -58311,9 +63074,9 @@ func jtOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int3
// Delete the file located at zPath. If the dirSync argument is true,
// ensure the file-system modifications are synced to disk before
// returning.
-func jtDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_journal.c:733:12: */
- var nPath int32 = int32(crt.Xstrlen(tls, zPath))
- if (nPath > 8) && (0 == crt.Xstrcmp(tls, ts+29625 /* "-journal" */, (zPath+uintptr((nPath-8))))) {
+func jtDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_journal.c:733:12: */
+ var nPath int32 = int32(libc.Xstrlen(tls, zPath))
+ if (nPath > 8) && (0 == libc.Xstrcmp(tls, ts+31717 /* "-journal" */, (zPath+uintptr((nPath-8))))) {
// Deleting a journal file. The end of a transaction.
var pMain uintptr = locateDatabaseHandle(tls, zPath, 0)
if pMain != 0 {
@@ -58326,63 +63089,63 @@ func jtDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 {
// Test for access permissions. Return true if the requested permission
// is available, or false otherwise.
-func jtAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test_journal.c:750:12: */
+func jtAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test_journal.c:750:12: */
return sqlite3.Xsqlite3OsAccess(tls, g2.FpVfs, zPath, flags, pResOut)
}
// Populate buffer zOut with the full canonical pathname corresponding
// to the pathname in zPath. zOut is guaranteed to point to a buffer
// of at least (JT_MAX_PATHNAME+1) bytes.
-func jtFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* test_journal.c:764:12: */
+func jtFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* test_journal.c:764:12: */
return sqlite3.Xsqlite3OsFullPathname(tls, g2.FpVfs, zPath, nOut, zOut)
}
// Open the dynamic library located at zPath and return a handle.
-func jtDlOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr) uintptr { /* test_journal.c:776:13: */
- return (*(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((g2.FpVfs + 72 /* &.xDlOpen */))))(tls, g2.FpVfs, zPath)
+func jtDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* test_journal.c:776:13: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((g2.FpVfs + 72 /* &.xDlOpen */))))(tls, g2.FpVfs, zPath)
}
// Populate the buffer zErrMsg (size nByte bytes) with a human readable
// utf-8 string describing the most recent error encountered associated
// with dynamic libraries.
-func jtDlError(tls *crt.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* test_journal.c:785:13: */
- (*(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer((g2.FpVfs + 80 /* &.xDlError */))))(tls, g2.FpVfs, nByte, zErrMsg)
+func jtDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* test_journal.c:785:13: */
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((g2.FpVfs + 80 /* &.xDlError */))))(tls, g2.FpVfs, nByte, zErrMsg)
}
// Return a pointer to the symbol zSymbol in the dynamic library pHandle.
-func jtDlSym(tls *crt.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr { /* test_journal.c:792:13: */
- return (*(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((g2.FpVfs + 88 /* &.xDlSym */))))(tls, g2.FpVfs, p, zSym)
+func jtDlSym(tls *libc.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr { /* test_journal.c:792:13: */
+ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((g2.FpVfs + 88 /* &.xDlSym */))))(tls, g2.FpVfs, p, zSym)
}
// Close the dynamic library handle pHandle.
-func jtDlClose(tls *crt.TLS, pVfs uintptr, pHandle uintptr) { /* test_journal.c:799:13: */
- (*(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer((g2.FpVfs + 96 /* &.xDlClose */))))(tls, g2.FpVfs, pHandle)
+func jtDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* test_journal.c:799:13: */
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((g2.FpVfs + 96 /* &.xDlClose */))))(tls, g2.FpVfs, pHandle)
}
// Populate the buffer pointed to by zBufOut with nByte bytes of
// random data.
-func jtRandomness(tls *crt.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test_journal.c:807:12: */
+func jtRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test_journal.c:807:12: */
return sqlite3.Xsqlite3OsRandomness(tls, g2.FpVfs, nByte, zBufOut)
}
// Sleep for nMicro microseconds. Return the number of microseconds
// actually slept.
-func jtSleep(tls *crt.TLS, pVfs uintptr, nMicro int32) int32 { /* test_journal.c:815:12: */
+func jtSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* test_journal.c:815:12: */
return sqlite3.Xsqlite3OsSleep(tls, g2.FpVfs, nMicro)
}
// Return the current time as a Julian Day number in *pTimeOut.
-func jtCurrentTime(tls *crt.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* test_journal.c:822:12: */
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((g2.FpVfs + 120 /* &.xCurrentTime */))))(tls, g2.FpVfs, pTimeOut)
+func jtCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* test_journal.c:822:12: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((g2.FpVfs + 120 /* &.xCurrentTime */))))(tls, g2.FpVfs, pTimeOut)
}
// Return the current time as a Julian Day number in *pTimeOut.
-func jtCurrentTimeInt64(tls *crt.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* test_journal.c:828:12: */
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((g2.FpVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, g2.FpVfs, pTimeOut)
+func jtCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* test_journal.c:828:12: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((g2.FpVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, g2.FpVfs, pTimeOut)
}
-func jtGetLastError(tls *crt.TLS, pVfs uintptr, n int32, z uintptr) int32 { /* test_journal.c:832:12: */
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((g2.FpVfs + 128 /* &.xGetLastError */))))(tls, g2.FpVfs, n, z)
+func jtGetLastError(tls *libc.TLS, pVfs uintptr, n int32, z uintptr) int32 { /* test_journal.c:832:12: */
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((g2.FpVfs + 128 /* &.xGetLastError */))))(tls, g2.FpVfs, n, z)
}
// *************************************************************************
@@ -58394,7 +63157,7 @@ func jtGetLastError(tls *crt.TLS, pVfs uintptr, n int32, z uintptr) int32 { /* t
// as the new default VFS for SQLite connections. If isDefault is not
// true, then the jt VFS is installed as non-default. In this case it
// is available via its name, "jt".
-func jt_register(tls *crt.TLS, zWrap uintptr, isDefault int32) int32 { /* test_journal.c:847:5: */
+func jt_register(tls *libc.TLS, zWrap uintptr, isDefault int32) int32 { /* test_journal.c:847:5: */
g2.FpVfs = sqlite3.Xsqlite3_vfs_find(tls, zWrap)
if g2.FpVfs == uintptr(0) {
return 1
@@ -58410,7 +63173,7 @@ func jt_register(tls *crt.TLS, zWrap uintptr, isDefault int32) int32 { /* test_j
}
// Uninstall the jt VFS, if it is installed.
-func jt_unregister(tls *crt.TLS) { /* test_journal.c:865:6: */
+func jt_unregister(tls *libc.TLS) { /* test_journal.c:865:6: */
sqlite3.Xsqlite3_vfs_unregister(tls, uintptr(unsafe.Pointer(&jt_vfs)))
}
@@ -58619,7 +63382,7 @@ var memfault MemFault /* test_malloc.c:41:3: */
// This routine exists as a place to set a breakpoint that will
// fire on any simulated malloc() failure.
-func sqlite3Fault(tls *crt.TLS) { /* test_malloc.c:47:13: */
+func sqlite3Fault(tls *libc.TLS) { /* test_malloc.c:47:13: */
cnt1++
}
@@ -58629,7 +63392,7 @@ var cnt1 int32 = 0 /* test_malloc.c:48:14 */
// fire the first time any malloc() fails on a single test case.
// The sqlite3Fault() routine above runs on every malloc() failure.
// This routine only runs on the first such failure.
-func sqlite3FirstFault(tls *crt.TLS) { /* test_malloc.c:58:13: */
+func sqlite3FirstFault(tls *libc.TLS) { /* test_malloc.c:58:13: */
cnt2++
}
@@ -58637,7 +63400,7 @@ var cnt2 int32 = 0 /* test_malloc.c:59:14 */
// Check to see if a fault should be simulated. Return true to simulate
// the fault. Return false if the fault should not be simulated.
-func faultsimStep(tls *crt.TLS) int32 { /* test_malloc.c:67:12: */
+func faultsimStep(tls *libc.TLS) int32 { /* test_malloc.c:67:12: */
if !(int32(memfault.Fenable) != 0) {
memfault.FnOkAfter++
return 0
@@ -58664,60 +63427,36 @@ func faultsimStep(tls *crt.TLS) int32 { /* test_malloc.c:67:12: */
// A version of sqlite3_mem_methods.xMalloc() that includes fault simulation
// logic.
-func faultsimMalloc(tls *crt.TLS, n int32) uintptr { /* test_malloc.c:94:13: */
+func faultsimMalloc(tls *libc.TLS, n int32) uintptr { /* test_malloc.c:94:13: */
var p uintptr = uintptr(0)
if !(faultsimStep(tls) != 0) {
- p = (*(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&memfault)) + 40 /* &.m */ /* &.xMalloc */))))(tls, n)
+ p = (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&memfault)) + 40 /* &.m */ /* &.xMalloc */))))(tls, n)
}
return p
}
// A version of sqlite3_mem_methods.xRealloc() that includes fault simulation
// logic.
-func faultsimRealloc(tls *crt.TLS, pOld uintptr, n int32) uintptr { /* test_malloc.c:107:13: */
+func faultsimRealloc(tls *libc.TLS, pOld uintptr, n int32) uintptr { /* test_malloc.c:107:13: */
var p uintptr = uintptr(0)
if !(faultsimStep(tls) != 0) {
- p = (*(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&memfault)) + 40 /* &.m */ + 16 /* &.xRealloc */))))(tls, pOld, n)
+ p = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&memfault)) + 40 /* &.m */ + 16 /* &.xRealloc */))))(tls, pOld, n)
}
return p
}
-// The following method calls are passed directly through to the underlying
-// malloc system:
-//
-// xFree
-// xSize
-// xRoundup
-// xInit
-// xShutdown
-func faultsimFree(tls *crt.TLS, p uintptr) { /* test_malloc.c:125:13: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&memfault)) + 40 /* &.m */ + 8 /* &.xFree */))))(tls, p)
-}
-func faultsimSize(tls *crt.TLS, p uintptr) int32 { /* test_malloc.c:128:12: */
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&memfault)) + 40 /* &.m */ + 24 /* &.xSize */))))(tls, p)
-}
-func faultsimRoundup(tls *crt.TLS, n int32) int32 { /* test_malloc.c:131:12: */
- return (*(*func(*crt.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&memfault)) + 40 /* &.m */ + 32 /* &.xRoundup */))))(tls, n)
-}
-func faultsimInit(tls *crt.TLS, p uintptr) int32 { /* test_malloc.c:134:12: */
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&memfault)) + 40 /* &.m */ + 40 /* &.xInit */))))(tls, memfault.Fm.FpAppData)
-}
-func faultsimShutdown(tls *crt.TLS, p uintptr) { /* test_malloc.c:137:13: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&memfault)) + 40 /* &.m */ + 48 /* &.xShutdown */))))(tls, memfault.Fm.FpAppData)
-}
-
// This routine configures the malloc failure simulation. After
// calling this routine, the next nDelay mallocs will succeed, followed
// by a block of nRepeat failures, after which malloc() calls will begin
// to succeed again.
-func faultsimConfig(tls *crt.TLS, nDelay int32, nRepeat int32) { /* test_malloc.c:147:13: */
+func faultsimConfig(tls *libc.TLS, nDelay int32, nRepeat int32) { /* test_malloc.c:121:13: */
memfault.FiCountdown = nDelay
memfault.FnRepeat = nRepeat
memfault.FnBenign = 0
memfault.FnFail = 0
memfault.FnOkBefore = 0
memfault.FnOkAfter = 0
- memfault.Fenable = (u8(crt.Bool32(nDelay >= 0)))
+ memfault.Fenable = (u8(libc.Bool32(nDelay >= 0)))
// Sometimes, when running multi-threaded tests, the isBenignMode
// variable is not properly incremented/decremented so that it is
@@ -58730,19 +63469,19 @@ func faultsimConfig(tls *crt.TLS, nDelay int32, nRepeat int32) { /* test_malloc.
// Return the number of faults (both hard and benign faults) that have
// occurred since the injector was last configured.
-func faultsimFailures(tls *crt.TLS) int32 { /* test_malloc.c:170:12: */
+func faultsimFailures(tls *libc.TLS) int32 { /* test_malloc.c:144:12: */
return memfault.FnFail
}
// Return the number of benign faults that have occurred since the
// injector was last configured.
-func faultsimBenignFailures(tls *crt.TLS) int32 { /* test_malloc.c:178:12: */
+func faultsimBenignFailures(tls *libc.TLS) int32 { /* test_malloc.c:152:12: */
return memfault.FnBenign
}
// Return the number of successes that will occur before the next failure.
// If no failures are scheduled, return -1.
-func faultsimPending(tls *crt.TLS) int32 { /* test_malloc.c:186:12: */
+func faultsimPending(tls *libc.TLS) int32 { /* test_malloc.c:160:12: */
if memfault.Fenable != 0 {
return memfault.FiCountdown
} else {
@@ -58751,18 +63490,18 @@ func faultsimPending(tls *crt.TLS) int32 { /* test_malloc.c:186:12: */
return int32(0)
}
-func faultsimBeginBenign(tls *crt.TLS) { /* test_malloc.c:195:13: */
+func faultsimBeginBenign(tls *libc.TLS) { /* test_malloc.c:169:13: */
memfault.FisBenignMode++
}
-func faultsimEndBenign(tls *crt.TLS) { /* test_malloc.c:198:13: */
+func faultsimEndBenign(tls *libc.TLS) { /* test_malloc.c:172:13: */
memfault.FisBenignMode--
}
// Add or remove the fault-simulation layer using sqlite3_config(). If
// the argument is non-zero, the
-func faultsimInstall(tls *crt.TLS, install int32) int32 { /* test_malloc.c:206:12: */
- bp := tls.Alloc(136)
- defer tls.Free(136)
+func faultsimInstall(tls *libc.TLS, install int32) int32 { /* test_malloc.c:180:12: */
+ bp := tls.Alloc(200)
+ defer tls.Free(200)
var rc int32
@@ -58778,25 +63517,32 @@ func faultsimInstall(tls *crt.TLS, install int32) int32 { /* test_malloc.c:206:1
}
if install != 0 {
- rc = sqlite3.Xsqlite3_config(tls, 5, crt.VaList(bp, (uintptr(unsafe.Pointer(&memfault))+40 /* &.m */)))
+ rc = sqlite3.Xsqlite3_config(tls, 5, libc.VaList(bp, (uintptr(unsafe.Pointer(&memfault))+40 /* &.m */)))
if rc == 0 {
- rc = sqlite3.Xsqlite3_config(tls, 4, crt.VaList(bp+8, uintptr(unsafe.Pointer(&m))))
+ *(*sqlite3_mem_methods)(unsafe.Pointer(bp + 72 /* m */)) = memfault.Fm
+ (*sqlite3_mem_methods)(unsafe.Pointer(bp + 72 /* &m */)).FxMalloc = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, int32) uintptr
+ }{faultsimMalloc}))
+ (*sqlite3_mem_methods)(unsafe.Pointer(bp + 72 /* &m */)).FxRealloc = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{faultsimRealloc}))
+ rc = sqlite3.Xsqlite3_config(tls, 4, libc.VaList(bp+8, bp+72 /* &m */))
}
sqlite3.Xsqlite3_test_control(tls, 10,
- crt.VaList(bp+16, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{faultsimBeginBenign})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{faultsimEndBenign}))))
+ libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) }{faultsimBeginBenign})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) }{faultsimEndBenign}))))
} else {
- // var m2 sqlite3_mem_methods at bp+72, 64
+ // var m2 sqlite3_mem_methods at bp+136, 64
// One should be able to reset the default memory allocator by storing
// a zeroed allocator then calling GETMALLOC.
- crt.Xmemset(tls, bp+72 /* &m2 */, 0, uint64(unsafe.Sizeof(sqlite3_mem_methods{})))
- sqlite3.Xsqlite3_config(tls, 4, crt.VaList(bp+32, bp+72 /* &m2 */))
- sqlite3.Xsqlite3_config(tls, 5, crt.VaList(bp+40, bp+72 /* &m2 */))
+ libc.Xmemset(tls, bp+136 /* &m2 */, 0, uint64(unsafe.Sizeof(sqlite3_mem_methods{})))
+ sqlite3.Xsqlite3_config(tls, 4, libc.VaList(bp+32, bp+136 /* &m2 */))
+ sqlite3.Xsqlite3_config(tls, 5, libc.VaList(bp+40, bp+136 /* &m2 */))
- rc = sqlite3.Xsqlite3_config(tls, 4, crt.VaList(bp+48, (uintptr(unsafe.Pointer(&memfault))+40 /* &.m */)))
+ rc = sqlite3.Xsqlite3_config(tls, 4, libc.VaList(bp+48, (uintptr(unsafe.Pointer(&memfault))+40 /* &.m */)))
sqlite3.Xsqlite3_test_control(tls, 10,
- crt.VaList(bp+56, uintptr(0), uintptr(0)))
+ libc.VaList(bp+56, uintptr(0), uintptr(0)))
}
if rc == 0 {
@@ -58805,18 +63551,8 @@ func faultsimInstall(tls *crt.TLS, install int32) int32 { /* test_malloc.c:206:1
return rc
}
-var m = sqlite3_mem_methods1{FxMalloc: 0, FxFree: // xMalloc
-0, FxRealloc:// xFree
-0, FxSize:// xRealloc
-0, FxRoundup:// xSize
-0, FxInit:// xRoundup
-0, FxShutdown:// xInit
-0, FpAppData:// xShutdown
-uintptr(0), // pAppData
-} /* test_malloc.c:207:37 */
-
// Transform pointers to text and back again
-func pointerToText(tls *crt.TLS, p uintptr, z uintptr) { /* test_malloc.c:272:13: */
+func pointerToText(tls *libc.TLS, p uintptr, z uintptr) { /* test_malloc.c:239:13: */
bp := tls.Alloc(20)
defer tls.Free(20)
*(*uintptr)(unsafe.Pointer(bp + 8)) = p
@@ -58828,13 +63564,13 @@ func pointerToText(tls *crt.TLS, p uintptr, z uintptr) { /* test_malloc.c:272:13
// var n sqlite3_uint64 at bp, 8
if *(*uintptr)(unsafe.Pointer(bp + 8 /* p */)) == uintptr(0) {
- crt.Xstrcpy(tls, z, ts+12045 /* "0" */)
+ libc.Xstrcpy(tls, z, ts+13695 /* "0" */)
return
}
if uint64(unsafe.Sizeof(sqlite3_uint64(0))) == uint64(unsafe.Sizeof(uintptr(0))) {
- crt.Xmemcpy(tls, bp /* &n */, bp+8 /* &p */, uint64(unsafe.Sizeof(uintptr(0))))
+ libc.Xmemcpy(tls, bp /* &n */, bp+8 /* &p */, uint64(unsafe.Sizeof(uintptr(0))))
} else if uint64(unsafe.Sizeof(uint32(0))) == uint64(unsafe.Sizeof(uintptr(0))) {
- crt.Xmemcpy(tls, bp+16 /* &u */, bp+8 /* &p */, uint64(unsafe.Sizeof(uint32(0))))
+ libc.Xmemcpy(tls, bp+16 /* &u */, bp+8 /* &p */, uint64(unsafe.Sizeof(uint32(0))))
*(*sqlite3_uint64)(unsafe.Pointer(bp /* n */)) = sqlite3_uint64(*(*uint32)(unsafe.Pointer(bp + 16 /* u */)))
} else {
}
@@ -58859,8 +63595,8 @@ __3:
*(*int8)(unsafe.Pointer(z + uintptr((uint64(unsafe.Sizeof(uintptr(0))) * uint64(2))))) = int8(0)
}
-var zHex = *(*[17]int8)(unsafe.Pointer(ts + 28008 /* "0123456789abcdef" */)) /* test_malloc.c:273:21 */
-func hexToInt(tls *crt.TLS, h int32) int32 { /* test_malloc.c:295:12: */
+var zHex = *(*[17]int8)(unsafe.Pointer(ts + 30100 /* "0123456789abcdef" */)) /* test_malloc.c:240:21 */
+func hexToInt(tls *libc.TLS, h int32) int32 { /* test_malloc.c:262:12: */
if (h >= '0') && (h <= '9') {
return (h - '0')
} else if (h >= 'a') && (h <= 'f') {
@@ -58870,7 +63606,7 @@ func hexToInt(tls *crt.TLS, h int32) int32 { /* test_malloc.c:295:12: */
}
return int32(0)
}
-func textToPointer(tls *crt.TLS, z uintptr, pp uintptr) int32 { /* test_malloc.c:304:12: */
+func textToPointer(tls *libc.TLS, z uintptr, pp uintptr) int32 { /* test_malloc.c:271:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -58880,7 +63616,7 @@ func textToPointer(tls *crt.TLS, z uintptr, pp uintptr) int32 { /* test_malloc.c
for i = 0; (uint64(i) < (uint64(unsafe.Sizeof(uintptr(0))) * uint64(2))) && (*(*int8)(unsafe.Pointer(z + uintptr(0))) != 0); i++ {
var v int32
- v = hexToInt(tls, int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1)))))
+ v = hexToInt(tls, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))
if v < 0 {
return 1
}
@@ -58890,10 +63626,10 @@ func textToPointer(tls *crt.TLS, z uintptr, pp uintptr) int32 { /* test_malloc.c
return 1
}
if uint64(unsafe.Sizeof(sqlite3_uint64(0))) == uint64(unsafe.Sizeof(uintptr(0))) {
- crt.Xmemcpy(tls, pp, bp /* &n */, uint64(unsafe.Sizeof(sqlite3_uint64(0))))
+ libc.Xmemcpy(tls, pp, bp /* &n */, uint64(unsafe.Sizeof(sqlite3_uint64(0))))
} else if uint64(unsafe.Sizeof(uint32(0))) == uint64(unsafe.Sizeof(uintptr(0))) {
*(*uint32)(unsafe.Pointer(bp + 8 /* u */)) = uint32(*(*sqlite3_uint64)(unsafe.Pointer(bp /* n */)))
- crt.Xmemcpy(tls, pp, bp+8 /* &u */, uint64(unsafe.Sizeof(uint32(0))))
+ libc.Xmemcpy(tls, pp, bp+8 /* &u */, uint64(unsafe.Sizeof(uint32(0))))
} else {
}
return 0
@@ -58902,7 +63638,7 @@ func textToPointer(tls *crt.TLS, z uintptr, pp uintptr) int32 { /* test_malloc.c
// Usage: sqlite3_malloc NBYTES
//
// Raw test interface for sqlite3_malloc().
-func test_malloc(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:331:26: */
+func test_malloc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:298:26: */
bp := tls.Alloc(120)
defer tls.Free(120)
@@ -58912,7 +63648,7 @@ func test_malloc(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
// var zOut [100]int8 at bp+20, 100
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29634 /* "NBYTES" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31726 /* "NBYTES" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+16 /* &nByte */) != 0 {
@@ -58920,14 +63656,14 @@ func test_malloc(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
}
p = sqlite3.Xsqlite3_malloc(tls, int32(uint32(*(*int32)(unsafe.Pointer(bp + 16 /* nByte */)))))
pointerToText(tls, p, bp+20 /* &zOut[0] */)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, bp+20 /* &zOut[0] */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, bp+20 /* &zOut[0] */, uintptr(0)))
return 0
}
// Usage: sqlite3_realloc PRIOR NBYTES
//
// Raw test interface for sqlite3_realloc().
-func test_realloc(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:356:26: */
+func test_realloc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:323:26: */
bp := tls.Alloc(156)
defer tls.Free(156)
@@ -58939,37 +63675,37 @@ func test_realloc(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
// var zOut [100]int8 at bp+56, 100
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29641 /* "PRIOR NBYTES" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31733 /* "PRIOR NBYTES" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+40 /* &nByte */) != 0 {
return 1
}
if textToPointer(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+48 /* &pPrior */) != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+29654 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31746 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), uintptr(0)))
return 1
}
p = sqlite3.Xsqlite3_realloc(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* pPrior */)), int32(uint32(*(*int32)(unsafe.Pointer(bp + 40 /* nByte */)))))
pointerToText(tls, p, bp+56 /* &zOut[0] */)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+24, bp+56 /* &zOut[0] */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, bp+56 /* &zOut[0] */, uintptr(0)))
return 0
}
// Usage: sqlite3_free PRIOR
//
// Raw test interface for sqlite3_free().
-func test_free(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:385:26: */
+func test_free(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:352:26: */
bp := tls.Alloc(32)
defer tls.Free(32)
// var pPrior uintptr at bp+24, 8
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29668 /* "PRIOR" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31760 /* "PRIOR" */)
return 1
}
if textToPointer(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+24 /* &pPrior */) != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+29654 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31746 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), uintptr(0)))
return 1
}
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPrior */)))
@@ -58980,7 +63716,7 @@ func test_free(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, obj
//
// Set a chunk of memory (obtained from malloc, probably) to a
// specified hex pattern.
-func test_memset(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:416:26: */
+func test_memset(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:383:26: */
bp := tls.Alloc(172)
defer tls.Free(172)
@@ -58996,18 +63732,18 @@ func test_memset(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
// var zBin [100]int8 at bp+72, 100
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29674 /* "ADDRESS SIZE HEX" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31766 /* "ADDRESS SIZE HEX" */)
return 1
}
if textToPointer(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+56 /* &p */) != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+29654 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31746 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), uintptr(0)))
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+64 /* &size */) != 0 {
return 1
}
if *(*int32)(unsafe.Pointer(bp + 64 /* size */)) <= 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+24, ts+29691 /* "size must be pos..." */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+31783 /* "size must be pos..." */, uintptr(0)))
return 1
}
zHex = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), bp+68 /* &n */)
@@ -59016,7 +63752,7 @@ func test_memset(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
}
*(*int32)(unsafe.Pointer(bp + 68 /* n */)) = sqlite3TestHexToBin(tls, zHex, *(*int32)(unsafe.Pointer(bp + 68 /* n */)), bp+72 /* &zBin[0] */)
if *(*int32)(unsafe.Pointer(bp + 68 /* n */)) == 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, ts+29713 /* "no data" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, ts+31805 /* "no data" */, uintptr(0)))
return 1
}
zOut = *(*uintptr)(unsafe.Pointer(bp + 56 /* p */))
@@ -59029,7 +63765,7 @@ func test_memset(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
// Usage: memget ADDRESS SIZE
//
// Return memory as hexadecimal text.
-func test_memget(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:462:26: */
+func test_memget(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:429:26: */
bp := tls.Alloc(168)
defer tls.Free(168)
@@ -59042,18 +63778,18 @@ func test_memget(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
// var zHex [100]int8 at bp+68, 100
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29721 /* "ADDRESS SIZE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31813 /* "ADDRESS SIZE" */)
return 1
}
if textToPointer(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+56 /* &p */) != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+29654 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31746 /* "bad pointer: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), uintptr(0)))
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+64 /* &size */) != 0 {
return 1
}
if *(*int32)(unsafe.Pointer(bp + 64 /* size */)) <= 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+24, ts+29691 /* "size must be pos..." */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+31783 /* "size must be pos..." */, uintptr(0)))
return 1
}
zBin = *(*uintptr)(unsafe.Pointer(bp + 56 /* p */))
@@ -59063,11 +63799,11 @@ func test_memget(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
} else {
n = *(*int32)(unsafe.Pointer(bp + 64 /* size */))
}
- crt.Xmemcpy(tls, bp+68 /* &zHex[0] */, zBin, uint64(n))
+ libc.Xmemcpy(tls, bp+68 /* &zHex[0] */, zBin, uint64(n))
zBin += uintptr(n)
*(*int32)(unsafe.Pointer(bp + 64 /* size */)) -= n
sqlite3TestBinToHex(tls, bp+68 /* &zHex[0] */, n)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+68 /* &zHex[0] */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+68 /* &zHex[0] */, uintptr(0)))
}
return 0
}
@@ -59075,7 +63811,7 @@ func test_memget(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
// Usage: sqlite3_memory_used
//
// Raw test interface for sqlite3_memory_used().
-func test_memory_used(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:509:26: */
+func test_memory_used(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:476:26: */
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewWideIntObj(tls, int64(sqlite3.Xsqlite3_memory_used(tls))))
return 0
}
@@ -59083,13 +63819,13 @@ func test_memory_used(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
// Usage: sqlite3_memory_highwater ?RESETFLAG?
//
// Raw test interface for sqlite3_memory_highwater().
-func test_memory_highwater(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:524:26: */
+func test_memory_highwater(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:491:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*int32)(unsafe.Pointer(bp /* resetFlag */)) = 0
if (objc != 1) && (objc != 2) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29734 /* "?RESET?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31826 /* "?RESET?" */)
return 1
}
if objc == 2 {
@@ -59106,14 +63842,14 @@ func test_memory_highwater(tls *crt.TLS, clientData uintptr, interp uintptr, obj
//
// Set the depth of backtracing. If SQLITE_MEMDEBUG is not defined
// then this routine is a no-op.
-func test_memdebug_backtrace(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:549:26: */
+func test_memdebug_backtrace(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:516:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
// var depth int32 at bp, 4
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29742 /* "DEPT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31834 /* "DEPT" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &depth */) != 0 {
@@ -59125,9 +63861,9 @@ func test_memdebug_backtrace(tls *crt.TLS, clientData uintptr, interp uintptr, o
// Usage: sqlite3_memdebug_dump FILENAME
//
// Write a summary of unfreed memory to FILENAME.
-func test_memdebug_dump(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:575:26: */
+func test_memdebug_dump(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:542:26: */
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29747 /* "FILENAME" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31839 /* "FILENAME" */)
return 1
}
return 0
@@ -59136,7 +63872,7 @@ func test_memdebug_dump(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// Usage: sqlite3_memdebug_malloc_count
//
// Return the total number of times malloc() has been called.
-func test_memdebug_malloc_count(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:600:26: */
+func test_memdebug_malloc_count(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:567:26: */
var nMalloc int32 = -1
if objc != 1 {
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */)
@@ -59162,7 +63898,7 @@ func test_memdebug_malloc_count(tls *crt.TLS, clientData uintptr, interp uintptr
// happened since the previous call to this routine.
//
// To disable simulated failures, use a COUNTER of -1.
-func test_memdebug_fail(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:640:26: */
+func test_memdebug_fail(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:607:26: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -59175,7 +63911,7 @@ func test_memdebug_fail(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
var nFail int32 = 0
if objc < 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29756 /* "COUNTER ?OPTIONS..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31848 /* "COUNTER ?OPTIONS..." */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+24 /* &iFail */) != 0 {
@@ -59188,26 +63924,26 @@ func test_memdebug_fail(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
var zOption uintptr = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(ii)*8)), bp+28 /* &nOption */)
var zErr uintptr = uintptr(0)
- if (*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)) > 1) && (crt.Xstrncmp(tls, zOption, ts+29774 /* "-repeat" */, uint64(*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)))) == 0) {
+ if (*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)) > 1) && (libc.Xstrncmp(tls, zOption, ts+31866 /* "-repeat" */, uint64(*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)))) == 0) {
if ii == (objc - 1) {
- zErr = ts + 10494 /* "option requires ..." */
+ zErr = ts + 12149 /* "option requires ..." */
} else {
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((ii+1))*8)), bp+32 /* &nRepeat */) != 0 {
return 1
}
}
- } else if (*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)) > 1) && (crt.Xstrncmp(tls, zOption, ts+29782 /* "-benigncnt" */, uint64(*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)))) == 0) {
+ } else if (*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)) > 1) && (libc.Xstrncmp(tls, zOption, ts+31874 /* "-benigncnt" */, uint64(*(*int32)(unsafe.Pointer(bp + 28 /* nOption */)))) == 0) {
if ii == (objc - 1) {
- zErr = ts + 10494 /* "option requires ..." */
+ zErr = ts + 12149 /* "option requires ..." */
} else {
pBenignCnt = *(*uintptr)(unsafe.Pointer(objv + uintptr((ii+1))*8))
}
} else {
- zErr = ts + 10300 /* "unknown option: " */
+ zErr = ts + 11955 /* "unknown option: " */
}
if zErr != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, zErr, zOption, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, zErr, zOption, 0))
return 1
}
}
@@ -59228,7 +63964,7 @@ func test_memdebug_fail(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// Return the number of malloc() calls that will succeed before a
// simulated failure occurs. A negative return value indicates that
// no malloc() failure is scheduled.
-func test_memdebug_pending(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:706:26: */
+func test_memdebug_pending(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:673:26: */
var nPending int32
if objc != 1 {
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */)
@@ -59242,7 +63978,7 @@ func test_memdebug_pending(tls *crt.TLS, clientData uintptr, interp uintptr, obj
// The following global variable keeps track of the number of tests
// that have run. This variable is only useful when running in the
// debugger.
-var sqlite3_memdebug_title_count int32 = 0 /* test_malloc.c:727:12 */
+var sqlite3_memdebug_title_count int32 = 0 /* test_malloc.c:694:12 */
// Usage: sqlite3_memdebug_settitle TITLE
//
@@ -59252,26 +63988,26 @@ var sqlite3_memdebug_title_count int32 = 0 /* test_malloc.c:727:12 */
// and can be used to figure out which tests are leaking memory.
//
// Each title overwrite the previous.
-func test_memdebug_settitle(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:739:26: */
+func test_memdebug_settitle(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:706:26: */
sqlite3_memdebug_title_count++
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29793 /* "TITLE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31885 /* "TITLE" */)
return 1
}
return 0
}
-var aMallocLog Tcl_HashTable /* test_malloc.c:765:22: */
-var mallocLogEnabled int32 = 0 /* test_malloc.c:766:12 */
+var aMallocLog Tcl_HashTable /* test_malloc.c:732:22: */
+var mallocLogEnabled int32 = 0 /* test_malloc.c:733:12 */
type MallocLog1 = struct {
FnCall int32
FnByte int32
}
-type MallocLog = MallocLog1 /* test_malloc.c:768:26 */
+type MallocLog = MallocLog1 /* test_malloc.c:735:26 */
-func test_memdebug_log_clear(tls *crt.TLS) { /* test_malloc.c:805:13: */
+func test_memdebug_log_clear(tls *libc.TLS) { /* test_malloc.c:772:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -59291,7 +64027,7 @@ func test_memdebug_log_clear(tls *crt.TLS) { /* test_malloc.c:805:13: */
}()))))
}
-func test_memdebug_log(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:820:26: */
+func test_memdebug_log(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:787:26: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -59308,7 +64044,7 @@ func test_memdebug_log(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
}
if objc < 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29799 /* "SUB-COMMAND ..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31891 /* "SUB-COMMAND ..." */)
}
if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), uintptr(unsafe.Pointer(&MB_strs)), int32(unsafe.Sizeof(uintptr(0))), ts+1874 /* "sub-command" */, 0, bp /* &iSub */) != 0 {
return 1
@@ -59368,8 +64104,8 @@ func test_memdebug_log(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
return 0
}
-var isInit int32 = 0 /* test_malloc.c:826:14 */
-var MB_strs = [5]uintptr{ts + 29815 /* "start" */, ts + 29821 /* "stop" */, ts + 29826 /* "dump" */, ts + 29831 /* "clear" */, ts + 29837 /* "sync" */} /* test_malloc.c:829:21 */
+var isInit int32 = 0 /* test_malloc.c:793:14 */
+var MB_strs = [5]uintptr{ts + 31907 /* "start" */, ts + 31913 /* "stop" */, ts + 31918 /* "dump" */, ts + 31923 /* "clear" */, ts + 31929 /* "sync" */} /* test_malloc.c:796:21 */
// Usage: sqlite3_config_pagecache SIZE N
//
@@ -59379,7 +64115,7 @@ var MB_strs = [5]uintptr{ts + 29815 /* "start" */, ts + 29821 /* "stop" */, ts +
// The revised value of N is returned.
//
// A negative SIZE causes the buffer pointer to be NULL.
-func test_config_pagecache(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:918:26: */
+func test_config_pagecache(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:885:26: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -59389,7 +64125,7 @@ func test_config_pagecache(tls *crt.TLS, clientData uintptr, interp uintptr, obj
var pRes uintptr
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29842 /* "SIZE N" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31934 /* "SIZE N" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+48 /* &sz */) != 0 {
@@ -59398,7 +64134,7 @@ func test_config_pagecache(tls *crt.TLS, clientData uintptr, interp uintptr, obj
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+52 /* &N */) != 0 {
return 1
}
- crt.Xfree(tls, buf1)
+ libc.Xfree(tls, buf1)
buf1 = uintptr(0)
// Set the return value
@@ -59408,15 +64144,15 @@ func test_config_pagecache(tls *crt.TLS, clientData uintptr, interp uintptr, obj
tcl.XTcl_SetObjResult(tls, interp, pRes)
if *(*int32)(unsafe.Pointer(bp + 48 /* sz */)) < 0 {
- sqlite3.Xsqlite3_config(tls, 7, crt.VaList(bp, uintptr(0), 0, 0))
+ sqlite3.Xsqlite3_config(tls, 7, libc.VaList(bp, uintptr(0), 0, 0))
} else {
- buf1 = crt.Xmalloc(tls, (uint64(*(*int32)(unsafe.Pointer(bp + 48 /* sz */)) * *(*int32)(unsafe.Pointer(bp + 52 /* N */)))))
- sqlite3.Xsqlite3_config(tls, 7, crt.VaList(bp+24, buf1, *(*int32)(unsafe.Pointer(bp + 48 /* sz */)), *(*int32)(unsafe.Pointer(bp + 52 /* N */))))
+ buf1 = libc.Xmalloc(tls, (uint64(*(*int32)(unsafe.Pointer(bp + 48 /* sz */)) * *(*int32)(unsafe.Pointer(bp + 52 /* N */)))))
+ sqlite3.Xsqlite3_config(tls, 7, libc.VaList(bp+24, buf1, *(*int32)(unsafe.Pointer(bp + 48 /* sz */)), *(*int32)(unsafe.Pointer(bp + 52 /* N */))))
}
return 0
}
-var buf1 uintptr = uintptr(0) /* test_malloc.c:926:15 */
+var buf1 uintptr = uintptr(0) /* test_malloc.c:893:15 */
// Usage: sqlite3_config_alt_pcache INSTALL_FLAG DISCARD_CHANCE PRNG_SEED
//
@@ -59426,7 +64162,7 @@ var buf1 uintptr = uintptr(0) /* test_malloc.c:926:15 */
// which determines the chance of discarding a page when unpinned. 100
// is certainty. 0 is never. PRNG_SEED is the pseudo-random number generator
// seed.
-func test_alt_pcache(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:961:26: */
+func test_alt_pcache(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:928:26: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -59437,7 +64173,7 @@ func test_alt_pcache(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
*(*int32)(unsafe.Pointer(bp + 28 /* highStress */)) = 0
if (objc < 2) || (objc > 5) {
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv,
- ts+29849 /* "INSTALLFLAG DISC..." */)
+ ts+31941 /* "INSTALLFLAG DISC..." */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+16 /* &installFlag */) != 0 {
@@ -59453,7 +64189,7 @@ func test_alt_pcache(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
return 1
}
if (*(*int32)(unsafe.Pointer(bp + 20 /* discardChance */)) < 0) || (*(*int32)(unsafe.Pointer(bp + 20 /* discardChance */)) > 100) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+29896, /* "discard-chance s..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+31988, /* "discard-chance s..." */
uintptr(0)))
return 1
}
@@ -59465,7 +64201,7 @@ func test_alt_pcache(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
// Usage: sqlite3_config_memstatus BOOLEAN
//
// Enable or disable memory status reporting using SQLITE_CONFIG_MEMSTATUS.
-func test_config_memstatus(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1002:26: */
+func test_config_memstatus(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:969:26: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -59473,20 +64209,20 @@ func test_config_memstatus(tls *crt.TLS, clientData uintptr, interp uintptr, obj
var rc int32
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29939 /* "BOOLEAN" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17539 /* "BOOLEAN" */)
return 1
}
if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+8 /* &enable */) != 0 {
return 1
}
- rc = sqlite3.Xsqlite3_config(tls, 9, crt.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* enable */))))
+ rc = sqlite3.Xsqlite3_config(tls, 9, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* enable */))))
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, rc))
return 0
}
// Usage: sqlite3_config_lookaside SIZE COUNT
//
-func test_config_lookaside(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1023:26: */
+func test_config_lookaside(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:990:26: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -59496,7 +64232,7 @@ func test_config_lookaside(tls *crt.TLS, clientData uintptr, interp uintptr, obj
var pRet uintptr
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29947 /* "SIZE COUNT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32031 /* "SIZE COUNT" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+16 /* &sz */) != 0 {
@@ -59510,7 +64246,7 @@ func test_config_lookaside(tls *crt.TLS, clientData uintptr, interp uintptr, obj
interp, pRet, tcl.XTcl_NewIntObj(tls, sqlite3.Xsqlite3Config.FszLookaside))
tcl.XTcl_ListObjAppendElement(tls,
interp, pRet, tcl.XTcl_NewIntObj(tls, sqlite3.Xsqlite3Config.FnLookaside))
- sqlite3.Xsqlite3_config(tls, 13, crt.VaList(bp, *(*int32)(unsafe.Pointer(bp + 16 /* sz */)), *(*int32)(unsafe.Pointer(bp + 20 /* cnt */))))
+ sqlite3.Xsqlite3_config(tls, 13, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 16 /* sz */)), *(*int32)(unsafe.Pointer(bp + 20 /* cnt */))))
tcl.XTcl_SetObjResult(tls, interp, pRet)
return 0
}
@@ -59520,7 +64256,7 @@ func test_config_lookaside(tls *crt.TLS, clientData uintptr, interp uintptr, obj
// There are two static buffers with BUFID 1 and 2. Each static buffer
// is 10KB in size. A BUFID of 0 indicates that the buffer should be NULL
// which will cause sqlite3_db_config() to allocate space on its own.
-func test_db_config_lookaside(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1057:26: */
+func test_db_config_lookaside(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1024:26: */
bp := tls.Alloc(84)
defer tls.Free(84)
@@ -59534,7 +64270,7 @@ func test_db_config_lookaside(tls *crt.TLS, clientData uintptr, interp uintptr,
// var bufid int32 at bp+72, 4
if objc != 5 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29958 /* "BUFID SIZE COUNT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32042 /* "BUFID SIZE COUNT" */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+64 /* &db */) != 0 {
@@ -59550,21 +64286,21 @@ func test_db_config_lookaside(tls *crt.TLS, clientData uintptr, interp uintptr,
return 1
}
if *(*int32)(unsafe.Pointer(bp + 72 /* bufid */)) == 0 {
- rc = sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* db */)), 1001, crt.VaList(bp, uintptr(0), *(*int32)(unsafe.Pointer(bp + 76 /* sz */)), *(*int32)(unsafe.Pointer(bp + 80 /* cnt */))))
+ rc = sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* db */)), 1001, libc.VaList(bp, uintptr(0), *(*int32)(unsafe.Pointer(bp + 76 /* sz */)), *(*int32)(unsafe.Pointer(bp + 80 /* cnt */))))
} else if ((*(*int32)(unsafe.Pointer(bp + 72 /* bufid */)) >= 1) && (*(*int32)(unsafe.Pointer(bp + 72 /* bufid */)) <= 2)) && ((uint64(*(*int32)(unsafe.Pointer(bp + 76 /* sz */)) * *(*int32)(unsafe.Pointer(bp + 80 /* cnt */)))) <= uint64(unsafe.Sizeof([10000]int8{}))) {
- rc = sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* db */)), 1001, crt.VaList(bp+24, (uintptr(unsafe.Pointer(&azBuf))+uintptr(*(*int32)(unsafe.Pointer(bp + 72 /* bufid */)))*10000), *(*int32)(unsafe.Pointer(bp + 76 /* sz */)), *(*int32)(unsafe.Pointer(bp + 80 /* cnt */))))
+ rc = sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* db */)), 1001, libc.VaList(bp+24, (uintptr(unsafe.Pointer(&azBuf))+uintptr(*(*int32)(unsafe.Pointer(bp + 72 /* bufid */)))*10000), *(*int32)(unsafe.Pointer(bp + 76 /* sz */)), *(*int32)(unsafe.Pointer(bp + 80 /* cnt */))))
} else {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, ts+29975 /* "illegal argument..." */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+32059 /* "illegal argument..." */, uintptr(0)))
return 1
}
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, rc))
return 0
}
-var azBuf [2][10000]int8 /* test_malloc.c:1067:15: */
+var azBuf [2][10000]int8 /* test_malloc.c:1034:15: */
// Usage: sqlite3_config_heap NBYTE NMINALLOC
-func test_config_heap(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1092:26: */
+func test_config_heap(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1059:26: */
bp := tls.Alloc(56)
defer tls.Free(56)
// Use this memory
@@ -59578,7 +64314,7 @@ func test_config_heap(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
var nArg int32 = (objc - 1)
if nArg != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+30013 /* "NBYTE NMINALLOC" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32097 /* "NBYTE NMINALLOC" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(aArg + uintptr(0)*8)), bp+48 /* &nByte */) != 0 {
@@ -59589,22 +64325,22 @@ func test_config_heap(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
}
if *(*int32)(unsafe.Pointer(bp + 48 /* nByte */)) == 0 {
- crt.Xfree(tls, zBuf)
+ libc.Xfree(tls, zBuf)
zBuf = uintptr(0)
- rc = sqlite3.Xsqlite3_config(tls, 8, crt.VaList(bp, uintptr(0), 0, 0))
+ rc = sqlite3.Xsqlite3_config(tls, 8, libc.VaList(bp, uintptr(0), 0, 0))
} else {
- zBuf = crt.Xrealloc(tls, zBuf, uint64(*(*int32)(unsafe.Pointer(bp + 48 /* nByte */))))
- rc = sqlite3.Xsqlite3_config(tls, 8, crt.VaList(bp+24, zBuf, *(*int32)(unsafe.Pointer(bp + 48 /* nByte */)), *(*int32)(unsafe.Pointer(bp + 52 /* nMinAlloc */))))
+ zBuf = libc.Xrealloc(tls, zBuf, uint64(*(*int32)(unsafe.Pointer(bp + 48 /* nByte */))))
+ rc = sqlite3.Xsqlite3_config(tls, 8, libc.VaList(bp+24, zBuf, *(*int32)(unsafe.Pointer(bp + 48 /* nByte */)), *(*int32)(unsafe.Pointer(bp + 52 /* nMinAlloc */))))
}
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1))
return 0
}
-var zBuf uintptr /* test_malloc.c:1098:15: */
+var zBuf uintptr /* test_malloc.c:1065:15: */
// Usage: sqlite3_config_heap_size NBYTE
-func test_config_heap_size(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1129:26: */
+func test_config_heap_size(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1096:26: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -59616,14 +64352,14 @@ func test_config_heap_size(tls *crt.TLS, clientData uintptr, interp uintptr, obj
var nArg int32 = (objc - 1)
if nArg != 1 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14082 /* "NBYTE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+15722 /* "NBYTE" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(aArg + uintptr(0)*8)), bp+8 /* &nByte */) != 0 {
return 1
}
- rc = sqlite3.Xsqlite3_config(tls, 23, crt.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* nByte */))))
+ rc = sqlite3.Xsqlite3_config(tls, 23, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* nByte */))))
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1))
return 0
@@ -59633,14 +64369,14 @@ func test_config_heap_size(tls *crt.TLS, clientData uintptr, interp uintptr, obj
//
// Invoke sqlite3_config() or sqlite3_db_config() with invalid
// opcodes and verify that they return errors.
-func test_config_error(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1159:26: */
+func test_config_error(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1126:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
// var db uintptr at bp+32, 8
if (objc != 2) && (objc != 1) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+30029 /* "[DB]" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32113 /* "[DB]" */)
return 1
}
if objc == 2 {
@@ -59649,14 +64385,14 @@ func test_config_error(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
}
if sqlite3.Xsqlite3_db_config(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* db */)), 99999, 0) != 1 {
tcl.XTcl_AppendResult(tls, interp,
- crt.VaList(bp, ts+30034, /* "sqlite3_db_confi..." */
+ libc.VaList(bp, ts+32118, /* "sqlite3_db_confi..." */
uintptr(0)))
return 1
}
} else {
if sqlite3.Xsqlite3_config(tls, 99999, 0) != 1 {
tcl.XTcl_AppendResult(tls, interp,
- crt.VaList(bp+16, ts+30092, /* "sqlite3_config(9..." */
+ libc.VaList(bp+16, ts+32176, /* "sqlite3_config(9..." */
uintptr(0)))
return 1
}
@@ -59668,7 +64404,7 @@ func test_config_error(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
//
// Enables or disables interpretation of URI parameters by default using
// SQLITE_CONFIG_URI.
-func test_config_uri(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1197:26: */
+func test_config_uri(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1164:26: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -59676,14 +64412,14 @@ func test_config_uri(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
// var bOpenUri int32 at bp+8, 4
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16556 /* "BOOL" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18252 /* "BOOL" */)
return 1
}
if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+8 /* &bOpenUri */) != 0 {
return 1
}
- rc = sqlite3.Xsqlite3_config(tls, 17, crt.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* bOpenUri */))))
+ rc = sqlite3.Xsqlite3_config(tls, 17, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* bOpenUri */))))
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1))
return 0
@@ -59693,7 +64429,7 @@ func test_config_uri(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
//
// Enables or disables the use of the covering-index scan optimization.
// SQLITE_CONFIG_COVERING_INDEX_SCAN.
-func test_config_cis(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1226:26: */
+func test_config_cis(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1193:26: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -59701,14 +64437,14 @@ func test_config_cis(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
// var bUseCis int32 at bp+8, 4
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16556 /* "BOOL" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18252 /* "BOOL" */)
return 1
}
if tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+8 /* &bUseCis */) != 0 {
return 1
}
- rc = sqlite3.Xsqlite3_config(tls, 20, crt.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* bUseCis */))))
+ rc = sqlite3.Xsqlite3_config(tls, 20, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* bUseCis */))))
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1))
return 0
@@ -59717,7 +64453,7 @@ func test_config_cis(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
// Usage: sqlite3_config_pmasz INTEGER
//
// Set the minimum PMA size.
-func test_config_pmasz(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1254:26: */
+func test_config_pmasz(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1221:26: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -59725,14 +64461,14 @@ func test_config_pmasz(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
// var iPmaSz int32 at bp+8, 4
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16556 /* "BOOL" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+18252 /* "BOOL" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+8 /* &iPmaSz */) != 0 {
return 1
}
- rc = sqlite3.Xsqlite3_config(tls, 25, crt.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* iPmaSz */))))
+ rc = sqlite3.Xsqlite3_config(tls, 25, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* iPmaSz */))))
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1))
return 0
@@ -59742,9 +64478,9 @@ func test_config_pmasz(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
// sqlite3_dump_memsys5 FILENAME
//
// Write a summary of unfreed memsys3 allocations to FILENAME.
-func test_dump_memsys3(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1284:26: */
+func test_dump_memsys3(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1251:26: */
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29747 /* "FILENAME" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31839 /* "FILENAME" */)
return 1
}
@@ -59764,7 +64500,7 @@ func test_dump_memsys3(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
//
// Return a list of three elements which are the sqlite3_status() return
// code, the current value, and the high-water mark value.
-func test_status(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1320:26: */
+func test_status(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1287:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -59780,7 +64516,7 @@ func test_status(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
var zOpName uintptr
var pResult uintptr
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+30143 /* "PARAMETER RESETF..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32227 /* "PARAMETER RESETF..." */)
return 1
}
zOpName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -59789,7 +64525,7 @@ func test_status(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
Fop int32
_ [4]byte
}{})))); i++ {
- if crt.Xstrcmp(tls, aOp1[i].FzName, zOpName) == 0 {
+ if libc.Xstrcmp(tls, aOp1[i].FzName, zOpName) == 0 {
*(*int32)(unsafe.Pointer(bp /* op */)) = aOp1[i].Fop
break
}
@@ -59822,23 +64558,23 @@ var aOp1 = [10]struct {
Fop int32
_ [4]byte
}{
- {FzName: ts + 30163 /* "SQLITE_STATUS_ME..." */, Fop: 0},
- {FzName: ts + 30189 /* "SQLITE_STATUS_MA..." */, Fop: 5},
- {FzName: ts + 30215 /* "SQLITE_STATUS_PA..." */, Fop: 1},
- {FzName: ts + 30244 /* "SQLITE_STATUS_PA..." */, Fop: 2},
- {FzName: ts + 30277 /* "SQLITE_STATUS_PA..." */, Fop: 7},
- {FzName: ts + 30306 /* "SQLITE_STATUS_SC..." */, Fop: 3},
- {FzName: ts + 30333 /* "SQLITE_STATUS_SC..." */, Fop: 4},
- {FzName: ts + 30364 /* "SQLITE_STATUS_SC..." */, Fop: 8},
- {FzName: ts + 30391 /* "SQLITE_STATUS_PA..." */, Fop: 6},
- {FzName: ts + 30418 /* "SQLITE_STATUS_MA..." */, Fop: 9},
-} /* test_malloc.c:1332:5 */
+ {FzName: ts + 32247 /* "SQLITE_STATUS_ME..." */, Fop: 0},
+ {FzName: ts + 32273 /* "SQLITE_STATUS_MA..." */, Fop: 5},
+ {FzName: ts + 32299 /* "SQLITE_STATUS_PA..." */, Fop: 1},
+ {FzName: ts + 32328 /* "SQLITE_STATUS_PA..." */, Fop: 2},
+ {FzName: ts + 32361 /* "SQLITE_STATUS_PA..." */, Fop: 7},
+ {FzName: ts + 32390 /* "SQLITE_STATUS_SC..." */, Fop: 3},
+ {FzName: ts + 32417 /* "SQLITE_STATUS_SC..." */, Fop: 4},
+ {FzName: ts + 32448 /* "SQLITE_STATUS_SC..." */, Fop: 8},
+ {FzName: ts + 32475 /* "SQLITE_STATUS_PA..." */, Fop: 6},
+ {FzName: ts + 32502 /* "SQLITE_STATUS_MA..." */, Fop: 9},
+} /* test_malloc.c:1299:5 */
// Usage: sqlite3_db_status DATABASE OPCODE RESETFLAG
//
// Return a list of three elements which are the sqlite3_db_status() return
// code, the current value, and the high-water mark value.
-func test_db_status(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1377:26: */
+func test_db_status(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1344:26: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -59856,17 +64592,17 @@ func test_db_status(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
var pResult uintptr
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+30445 /* "DB PARAMETER RES..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32529 /* "DB PARAMETER RES..." */)
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
return 1
}
zOpName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
- if crt.Xmemcmp(tls, zOpName, ts+30468 /* "SQLITE_" */, uint64(7)) == 0 {
+ if libc.Xmemcmp(tls, zOpName, ts+32552 /* "SQLITE_" */, uint64(7)) == 0 {
zOpName += uintptr(7)
}
- if crt.Xmemcmp(tls, zOpName, ts+30476 /* "DBSTATUS_" */, uint64(9)) == 0 {
+ if libc.Xmemcmp(tls, zOpName, ts+32560 /* "DBSTATUS_" */, uint64(9)) == 0 {
zOpName += uintptr(9)
}
for i = 0; i < (int32(uint64(unsafe.Sizeof(aOp2)) / uint64(unsafe.Sizeof(struct {
@@ -59874,7 +64610,7 @@ func test_db_status(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
Fop int32
_ [4]byte
}{})))); i++ {
- if crt.Xstrcmp(tls, aOp2[i].FzName, zOpName) == 0 {
+ if libc.Xstrcmp(tls, aOp2[i].FzName, zOpName) == 0 {
*(*int32)(unsafe.Pointer(bp + 8 /* op */)) = aOp2[i].Fop
break
}
@@ -59907,23 +64643,23 @@ var aOp2 = [13]struct {
Fop int32
_ [4]byte
}{
- {FzName: ts + 30486 /* "LOOKASIDE_USED" */, Fop: 0},
- {FzName: ts + 30501 /* "CACHE_USED" */, Fop: 1},
- {FzName: ts + 30512 /* "SCHEMA_USED" */, Fop: 2},
- {FzName: ts + 30524 /* "STMT_USED" */, Fop: 3},
- {FzName: ts + 30534 /* "LOOKASIDE_HIT" */, Fop: 4},
- {FzName: ts + 30548 /* "LOOKASIDE_MISS_S..." */, Fop: 5},
- {FzName: ts + 30568 /* "LOOKASIDE_MISS_F..." */, Fop: 6},
- {FzName: ts + 30588 /* "CACHE_HIT" */, Fop: 7},
- {FzName: ts + 30598 /* "CACHE_MISS" */, Fop: 8},
- {FzName: ts + 30609 /* "CACHE_WRITE" */, Fop: 9},
- {FzName: ts + 30621 /* "DEFERRED_FKS" */, Fop: 10},
- {FzName: ts + 30634 /* "CACHE_USED_SHARE..." */, Fop: 11},
- {FzName: ts + 30652 /* "CACHE_SPILL" */, Fop: 12},
-} /* test_malloc.c:1391:5 */
+ {FzName: ts + 32570 /* "LOOKASIDE_USED" */, Fop: 0},
+ {FzName: ts + 32585 /* "CACHE_USED" */, Fop: 1},
+ {FzName: ts + 32596 /* "SCHEMA_USED" */, Fop: 2},
+ {FzName: ts + 32608 /* "STMT_USED" */, Fop: 3},
+ {FzName: ts + 32618 /* "LOOKASIDE_HIT" */, Fop: 4},
+ {FzName: ts + 32632 /* "LOOKASIDE_MISS_S..." */, Fop: 5},
+ {FzName: ts + 32652 /* "LOOKASIDE_MISS_F..." */, Fop: 6},
+ {FzName: ts + 32672 /* "CACHE_HIT" */, Fop: 7},
+ {FzName: ts + 32682 /* "CACHE_MISS" */, Fop: 8},
+ {FzName: ts + 32693 /* "CACHE_WRITE" */, Fop: 9},
+ {FzName: ts + 32705 /* "DEFERRED_FKS" */, Fop: 10},
+ {FzName: ts + 32718 /* "CACHE_USED_SHARE..." */, Fop: 11},
+ {FzName: ts + 32736 /* "CACHE_SPILL" */, Fop: 12},
+} /* test_malloc.c:1358:5 */
// install_malloc_faultsim BOOLEAN
-func test_install_malloc_faultsim(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1439:26: */
+func test_install_malloc_faultsim(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1406:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -59931,7 +64667,7 @@ func test_install_malloc_faultsim(tls *crt.TLS, clientData uintptr, interp uintp
// var isInstall int32 at bp, 4
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29939 /* "BOOLEAN" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17539 /* "BOOLEAN" */)
return 1
}
if 0 != tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &isInstall */) {
@@ -59943,18 +64679,18 @@ func test_install_malloc_faultsim(tls *crt.TLS, clientData uintptr, interp uintp
}
// sqlite3_install_memsys3
-func test_install_memsys3(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1463:26: */
+func test_install_memsys3(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1430:26: */
var rc int32 = 21
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(1))
return 0
}
-func test_vfs_oom_test(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1478:26: */
+func test_vfs_oom_test(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_malloc.c:1445:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
if objc > 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+30664 /* "?INTEGER?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32748 /* "?INTEGER?" */)
return 1
} else if objc == 2 {
// var iNew int32 at bp, 4
@@ -59969,59 +64705,59 @@ func test_vfs_oom_test(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
}
// Register commands with the TCL interpreter.
-func Sqlitetest_malloc_Init(tls *crt.TLS, interp uintptr) int32 { /* test_malloc.c:1500:5: */
+func Sqlitetest_malloc_Init(tls *libc.TLS, interp uintptr) int32 { /* test_malloc.c:1467:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd10)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd11)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
FclientData int32
_ [4]byte
}{}))); i++ {
- var c ClientData = uintptr(int64(aObjCmd10[i].FclientData))
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd10[i].FzName, aObjCmd10[i].FxProc, c, uintptr(0))
+ var c ClientData = uintptr(intptr_t(aObjCmd11[i].FclientData))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd11[i].FzName, aObjCmd11[i].FxProc, c, uintptr(0))
}
return 0
}
-var aObjCmd10 = [32]struct {
+var aObjCmd11 = [32]struct {
FzName uintptr
FxProc uintptr
FclientData int32
_ [4]byte
}{
- {FzName: ts + 24956 /* "sqlite3_malloc" */, FxProc: 0, FclientData: 0},
- {FzName: ts + 24971 /* "sqlite3_realloc" */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30674 /* "sqlite3_free" */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30687 /* "memset" */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30694 /* "memget" */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30701 /* "sqlite3_memory_u..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30721 /* "sqlite3_memory_h..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30746 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30773 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30795 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30817 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30842 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30868 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30898 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30919 /* "sqlite3_config_p..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30944 /* "sqlite3_config_a..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30970 /* "sqlite3_status" */, FxProc: 0, FclientData: 0},
- {FzName: ts + 30985 /* "sqlite3_db_statu..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 31003 /* "install_malloc_f..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 31027 /* "sqlite3_config_h..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 31047 /* "sqlite3_config_h..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 31072 /* "sqlite3_config_m..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 31097 /* "sqlite3_config_l..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 31122 /* "sqlite3_config_e..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 31143 /* "sqlite3_config_u..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 31162 /* "sqlite3_config_c..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 31181 /* "sqlite3_config_p..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 31202 /* "sqlite3_db_confi..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 31230 /* "sqlite3_dump_mem..." */, FxProc: 0, FclientData: 3},
- {FzName: ts + 31251 /* "sqlite3_dump_mem..." */, FxProc: 0, FclientData: 5},
- {FzName: ts + 31272 /* "sqlite3_install_..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 31296 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
-} /* test_malloc.c:1505:5 */
+ {FzName: ts + 27048 /* "sqlite3_malloc" */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 27063 /* "sqlite3_realloc" */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 32758 /* "sqlite3_free" */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 32771 /* "memset" */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 32778 /* "memget" */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 32785 /* "sqlite3_memory_u..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 32805 /* "sqlite3_memory_h..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 32830 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 32857 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 32879 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 32901 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 32926 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 32952 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 32982 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33003 /* "sqlite3_config_p..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33028 /* "sqlite3_config_a..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33054 /* "sqlite3_status" */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33069 /* "sqlite3_db_statu..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33087 /* "install_malloc_f..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33111 /* "sqlite3_config_h..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33131 /* "sqlite3_config_h..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33156 /* "sqlite3_config_m..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33181 /* "sqlite3_config_l..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33206 /* "sqlite3_config_e..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33227 /* "sqlite3_config_u..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33246 /* "sqlite3_config_c..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33265 /* "sqlite3_config_p..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33286 /* "sqlite3_db_confi..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33314 /* "sqlite3_dump_mem..." */, FxProc: 0, FclientData: 3},
+ {FzName: ts + 33335 /* "sqlite3_dump_mem..." */, FxProc: 0, FclientData: 5},
+ {FzName: ts + 33356 /* "sqlite3_install_..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 33380 /* "sqlite3_memdebug..." */, FxProc: 0, FclientData: 0},
+} /* test_malloc.c:1472:5 */
// end block for C++
@@ -60063,9 +64799,9 @@ type MD5Context1 = struct {
type MD5Context = MD5Context1 /* test_md5.c:63:27 */
// Note: this code is harmless on little-endian machines.
-func byteReverse(tls *crt.TLS, buf uintptr, longs uint32) { /* test_md5.c:68:13: */
+func byteReverse(tls *libc.TLS, buf uintptr, longs uint32) { /* test_md5.c:68:13: */
var t uint32
- for ok := true; ok; ok = crt.PreDecUint32(&longs, 1) != 0 {
+ for ok := true; ok; ok = libc.PreDecUint32(&longs, 1) != 0 {
t = ((((uint32(*(*uint8)(unsafe.Pointer(buf + uintptr(3)))) << 8) | uint32(*(*uint8)(unsafe.Pointer(buf + uintptr(2))))) << 16) | ((uint32(*(*uint8)(unsafe.Pointer(buf + uintptr(1)))) << 8) | uint32(*(*uint8)(unsafe.Pointer(buf + uintptr(0))))))
*(*uint32)(unsafe.Pointer(buf)) = t
buf += uintptr(4)
@@ -60081,7 +64817,7 @@ func byteReverse(tls *crt.TLS, buf uintptr, longs uint32) { /* test_md5.c:68:13:
// The core of the MD5 algorithm, this alters an existing MD5 hash to
// reflect the addition of 16 longwords of new data. MD5Update blocks
// the data and converts bytes into longwords for this routine.
-func MD5Transform(tls *crt.TLS, buf uintptr, in uintptr) { /* test_md5.c:94:13: */
+func MD5Transform(tls *libc.TLS, buf uintptr, in uintptr) { /* test_md5.c:94:13: */
var a uint32
var b uint32
var c uint32
@@ -60296,7 +65032,7 @@ func MD5Transform(tls *crt.TLS, buf uintptr, in uintptr) { /* test_md5.c:94:13:
// Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
// initialization constants.
-func MD5Init(tls *crt.TLS, ctx uintptr) { /* test_md5.c:180:13: */
+func MD5Init(tls *libc.TLS, ctx uintptr) { /* test_md5.c:180:13: */
(*MD5Context)(unsafe.Pointer(ctx)).FisInit = 1
*(*uint32)(unsafe.Pointer((ctx + 4 /* &.buf */) + uintptr(0)*4)) = uint32(0x67452301)
*(*uint32)(unsafe.Pointer((ctx + 4 /* &.buf */) + uintptr(1)*4)) = 0xefcdab89
@@ -60308,13 +65044,13 @@ func MD5Init(tls *crt.TLS, ctx uintptr) { /* test_md5.c:180:13: */
// Update context to reflect the concatenation of another buffer full
// of bytes.
-func MD5Update(tls *crt.TLS, ctx uintptr, buf uintptr, len uint32) { /* test_md5.c:195:6: */
+func MD5Update(tls *libc.TLS, ctx uintptr, buf uintptr, len uint32) { /* test_md5.c:195:6: */
var t uint32
// Update bitcount
t = *(*uint32)(unsafe.Pointer((ctx + 20 /* &.bits */) + uintptr(0)*4))
- if (crt.AssignPtrUint32((ctx+20 /* &.bits */)+uintptr(0)*4, (t + (len << 3)))) < t {
+ if (libc.AssignPtrUint32((ctx+20 /* &.bits */)+uintptr(0)*4, (t + (len << 3)))) < t {
*(*uint32)(unsafe.Pointer((ctx + 20 /* &.bits */) + uintptr(1)*4))++
} // Carry from low to high
*(*uint32)(unsafe.Pointer((ctx + 20 /* &.bits */) + uintptr(1)*4)) += (len >> 29)
@@ -60328,10 +65064,10 @@ func MD5Update(tls *crt.TLS, ctx uintptr, buf uintptr, len uint32) { /* test_md5
t = (uint32(64) - t)
if len < t {
- crt.Xmemcpy(tls, p, buf, uint64(len))
+ libc.Xmemcpy(tls, p, buf, uint64(len))
return
}
- crt.Xmemcpy(tls, p, buf, uint64(t))
+ libc.Xmemcpy(tls, p, buf, uint64(t))
byteReverse(tls, ctx+28 /* &.in */, uint32(16))
MD5Transform(tls, ctx+4 /* &.buf */, ctx+28 /* &.in */)
buf += uintptr(t)
@@ -60341,7 +65077,7 @@ func MD5Update(tls *crt.TLS, ctx uintptr, buf uintptr, len uint32) { /* test_md5
// Process data in 64-byte chunks
for len >= uint32(64) {
- crt.Xmemcpy(tls, ctx+28 /* &.in */, buf, uint64(64))
+ libc.Xmemcpy(tls, ctx+28 /* &.in */, buf, uint64(64))
byteReverse(tls, ctx+28 /* &.in */, uint32(16))
MD5Transform(tls, ctx+4 /* &.buf */, ctx+28 /* &.in */)
buf += uintptr(64)
@@ -60350,12 +65086,12 @@ func MD5Update(tls *crt.TLS, ctx uintptr, buf uintptr, len uint32) { /* test_md5
// Handle any remaining bytes of data.
- crt.Xmemcpy(tls, ctx+28 /* &.in */, buf, uint64(len))
+ libc.Xmemcpy(tls, ctx+28 /* &.in */, buf, uint64(len))
}
// Final wrapup - pad to 64-byte boundary with the bit pattern
// 1 0* (64-bit count of bits processed, MSB-first)
-func MD5Final(tls *crt.TLS, digest uintptr, ctx uintptr) { /* test_md5.c:243:13: */
+func MD5Final(tls *libc.TLS, digest uintptr, ctx uintptr) { /* test_md5.c:243:13: */
var count uint32
var p uintptr
@@ -60365,7 +65101,7 @@ func MD5Final(tls *crt.TLS, digest uintptr, ctx uintptr) { /* test_md5.c:243:13:
// Set the first char of padding to 0x80. This is safe since there is
// always at least one byte free
p = ((ctx + 28 /* &.in */) + uintptr(count))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&p, 1))) = uint8(0x80)
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = uint8(0x80)
// Bytes of padding needed to make 64 bytes
count = ((uint32(64 - 1)) - count)
@@ -60373,57 +65109,57 @@ func MD5Final(tls *crt.TLS, digest uintptr, ctx uintptr) { /* test_md5.c:243:13:
// Pad out to 56 mod 64
if count < uint32(8) {
// Two lots of padding: Pad the first block to 64 bytes
- crt.Xmemset(tls, p, 0, uint64(count))
+ libc.Xmemset(tls, p, 0, uint64(count))
byteReverse(tls, ctx+28 /* &.in */, uint32(16))
MD5Transform(tls, ctx+4 /* &.buf */, ctx+28 /* &.in */)
// Now fill the next block with 56 bytes
- crt.Xmemset(tls, ctx+28 /* &.in */, 0, uint64(56))
+ libc.Xmemset(tls, ctx+28 /* &.in */, 0, uint64(56))
} else {
// Pad block to 56 bytes
- crt.Xmemset(tls, p, 0, (uint64(count - uint32(8))))
+ libc.Xmemset(tls, p, 0, (uint64(count - uint32(8))))
}
byteReverse(tls, ctx+28 /* &.in */, uint32(14))
// Append length in bits and transform
- crt.Xmemcpy(tls, ((ctx + 28 /* &.in */) + uintptr((14 * 4))), ctx+20 /* &.bits */, uint64(8))
+ libc.Xmemcpy(tls, ((ctx + 28 /* &.in */) + uintptr((14 * 4))), ctx+20 /* &.bits */, uint64(8))
MD5Transform(tls, ctx+4 /* &.buf */, ctx+28 /* &.in */)
byteReverse(tls, ctx+4 /* &.buf */, uint32(4))
- crt.Xmemcpy(tls, digest, ctx+4 /* &.buf */, uint64(16))
+ libc.Xmemcpy(tls, digest, ctx+4 /* &.buf */, uint64(16))
}
// Convert a 128-bit MD5 digest into a 32-digit base-16 number.
-func MD5DigestToBase16(tls *crt.TLS, digest uintptr, zBuf uintptr) { /* test_md5.c:284:13: */
+func MD5DigestToBase16(tls *libc.TLS, digest uintptr, zBuf uintptr) { /* test_md5.c:284:13: */
var i int32
var j int32
- for j = crt.AssignInt32(&i, 0); i < 16; i++ {
+ for j = libc.AssignInt32(&i, 0); i < 16; i++ {
var a int32 = int32(*(*uint8)(unsafe.Pointer(digest + uintptr(i))))
- *(*int8)(unsafe.Pointer(zBuf + uintptr(crt.PostIncInt32(&j, 1)))) = zEncode[((a >> 4) & 0xf)]
- *(*int8)(unsafe.Pointer(zBuf + uintptr(crt.PostIncInt32(&j, 1)))) = zEncode[(a & 0xf)]
+ *(*int8)(unsafe.Pointer(zBuf + uintptr(libc.PostIncInt32(&j, 1)))) = zEncode[((a >> 4) & 0xf)]
+ *(*int8)(unsafe.Pointer(zBuf + uintptr(libc.PostIncInt32(&j, 1)))) = zEncode[(a & 0xf)]
}
*(*int8)(unsafe.Pointer(zBuf + uintptr(j))) = int8(0)
}
-var zEncode = *(*[17]int8)(unsafe.Pointer(ts + 28008 /* "0123456789abcdef" */)) /* test_md5.c:285:21 */
+var zEncode = *(*[17]int8)(unsafe.Pointer(ts + 30100 /* "0123456789abcdef" */)) /* test_md5.c:285:21 */
// Convert a 128-bit MD5 digest into sequency of eight 5-digit integers
// each representing 16 bits of the digest and separated from each
// other by a "-" character.
-func MD5DigestToBase10x8(tls *crt.TLS, digest uintptr, zDigest uintptr) { /* test_md5.c:302:13: */
+func MD5DigestToBase10x8(tls *libc.TLS, digest uintptr, zDigest uintptr) { /* test_md5.c:302:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
var i int32
var j int32
var x uint32
- for i = crt.AssignInt32(&j, 0); i < 16; i = i + (2) {
+ for i = libc.AssignInt32(&j, 0); i < 16; i = i + (2) {
x = (uint32((int32(*(*uint8)(unsafe.Pointer(digest + uintptr(i)))) * 256) + int32(*(*uint8)(unsafe.Pointer(digest + uintptr((i + 1)))))))
if i > 0 {
- *(*int8)(unsafe.Pointer(zDigest + uintptr(crt.PostIncInt32(&j, 1)))) = int8('-')
+ *(*int8)(unsafe.Pointer(zDigest + uintptr(libc.PostIncInt32(&j, 1)))) = int8('-')
}
- sqlite3.Xsqlite3_snprintf(tls, (50 - j), (zDigest + uintptr(j)), ts+31326 /* "%05u" */, crt.VaList(bp, x))
+ sqlite3.Xsqlite3_snprintf(tls, (50 - j), (zDigest + uintptr(j)), ts+33410 /* "%05u" */, libc.VaList(bp, x))
j = j + (5)
}
*(*int8)(unsafe.Pointer(zDigest + uintptr(j))) = int8(0)
@@ -60431,7 +65167,7 @@ func MD5DigestToBase10x8(tls *crt.TLS, digest uintptr, zDigest uintptr) { /* tes
// A TCL command for md5. The argument is the text to be hashed. The
// Result is the hash in base64.
-func md5_cmd(tls *crt.TLS, cd uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test_md5.c:318:26: */
+func md5_cmd(tls *libc.TLS, cd uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test_md5.c:318:26: */
bp := tls.Alloc(206)
defer tls.Free(206)
@@ -60444,22 +65180,22 @@ func md5_cmd(tls *crt.TLS, cd uintptr, interp uintptr, argc int32, argv uintptr)
var converter uintptr
if argc != 2 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+13164 /* " TEXT\"" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+14814 /* " TEXT\"" */, uintptr(0)))
return 1
}
MD5Init(tls, bp+48 /* &ctx */)
- MD5Update(tls, bp+48 /* &ctx */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), uint32(crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))))
+ MD5Update(tls, bp+48 /* &ctx */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), uint32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))))
MD5Final(tls, bp+140 /* &digest[0] */, bp+48 /* &ctx */)
converter = cd
- (*(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(&converter)))(tls, bp+140 /* &digest[0] */, bp+156 /* &zBuf[0] */)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, bp+156 /* &zBuf[0] */, uintptr(0)))
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&converter)))(tls, bp+140 /* &digest[0] */, bp+156 /* &zBuf[0] */)
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, bp+156 /* &zBuf[0] */, uintptr(0)))
return 0
}
// A TCL command to take the md5 hash of a file. The argument is the
// name of the file.
-func md5file_cmd(tls *crt.TLS, cd uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test_md5.c:347:26: */
+func md5file_cmd(tls *libc.TLS, cd uintptr, interp uintptr, argc int32, argv uintptr) int32 { /* test_md5.c:347:26: */
bp := tls.Alloc(10428)
defer tls.Free(10428)
@@ -60474,28 +65210,28 @@ func md5file_cmd(tls *crt.TLS, cd uintptr, interp uintptr, argc int32, argv uint
// var zBuf [10240]int8 at bp+172, 10240
if (argc != 2) && (argc != 4) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
- ts+31331 /* " FILENAME [OFFSE..." */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451 /* "wrong # args: sh..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)),
+ ts+33415 /* " FILENAME [OFFSE..." */, uintptr(0)))
return 1
}
if argc == 4 {
- ofst = crt.Xatoi(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)))
- amt = crt.Xatoi(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)))
+ ofst = libc.Xatoi(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)))
+ amt = libc.Xatoi(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)))
} else {
ofst = 0
amt = 2147483647
}
- in = crt.Xfopen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+2937 /* "rb" */)
+ in = libc.Xfopen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+4086 /* "rb" */)
if in == uintptr(0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+31355 /* "unable to open f..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)),
- ts+31377 /* "\" for reading" */, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+33439 /* "unable to open f..." */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)),
+ ts+33461 /* "\" for reading" */, uintptr(0)))
return 1
}
- crt.Xfseek(tls, in, int64(ofst), 0)
+ libc.Xfseek(tls, in, int64(ofst), 0)
MD5Init(tls, bp+80 /* &ctx */)
for amt > 0 {
var n int32
- n = int32(crt.Xfread(tls, bp+172 /* &zBuf[0] */, uint64(1), func() uint64 {
+ n = int32(libc.Xfread(tls, bp+172 /* &zBuf[0] */, uint64(1), func() uint64 {
if uint64(unsafe.Sizeof([10240]int8{})) <= uint64(amt) {
return uint64(unsafe.Sizeof([10240]int8{}))
}
@@ -60507,47 +65243,47 @@ func md5file_cmd(tls *crt.TLS, cd uintptr, interp uintptr, argc int32, argv uint
MD5Update(tls, bp+80 /* &ctx */, bp+172 /* zBuf */, uint32(n))
amt = amt - (n)
}
- crt.Xfclose(tls, in)
+ libc.Xfclose(tls, in)
MD5Final(tls, bp+10412 /* &digest[0] */, bp+80 /* &ctx */)
converter = cd
- (*(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(&converter)))(tls, bp+10412 /* &digest[0] */, bp+172 /* &zBuf[0] */)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+64, bp+172 /* &zBuf[0] */, uintptr(0)))
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&converter)))(tls, bp+10412 /* &digest[0] */, bp+172 /* &zBuf[0] */)
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, bp+172 /* &zBuf[0] */, uintptr(0)))
return 0
}
// Register the four new TCL commands for generating MD5 checksums
// with the TCL interpreter.
-func Md5_Init(tls *crt.TLS, interp uintptr) int32 { /* test_md5.c:400:5: */
- tcl.XTcl_CreateCommand(tls, interp, ts+31391 /* "md5" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+func Md5_Init(tls *libc.TLS, interp uintptr) int32 { /* test_md5.c:400:5: */
+ tcl.XTcl_CreateCommand(tls, interp, ts+33475 /* "md5" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{md5_cmd})),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{MD5DigestToBase16})), uintptr(0))
- tcl.XTcl_CreateCommand(tls, interp, ts+31395 /* "md5-10x8" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateCommand(tls, interp, ts+33479 /* "md5-10x8" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{md5_cmd})),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{MD5DigestToBase10x8})), uintptr(0))
- tcl.XTcl_CreateCommand(tls, interp, ts+31404 /* "md5file" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateCommand(tls, interp, ts+33488 /* "md5file" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{md5file_cmd})),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{MD5DigestToBase16})), uintptr(0))
- tcl.XTcl_CreateCommand(tls, interp, ts+31412 /* "md5file-10x8" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateCommand(tls, interp, ts+33496 /* "md5file-10x8" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{md5file_cmd})),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{MD5DigestToBase10x8})), uintptr(0))
return 0
}
// During testing, the special md5sum() aggregate function is available.
// inside SQLite. The following routines implement that function.
-func md5step(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test_md5.c:416:13: */
+func md5step(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test_md5.c:416:13: */
var p uintptr
var i int32
if argc < 1 {
@@ -60563,11 +65299,11 @@ func md5step(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test_
for i = 0; i < argc; i++ {
var zData uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
if zData != 0 {
- MD5Update(tls, p, zData, uint32(int32(crt.Xstrlen(tls, zData))))
+ MD5Update(tls, p, zData, uint32(int32(libc.Xstrlen(tls, zData))))
}
}
}
-func md5finalize(tls *crt.TLS, context uintptr) { /* test_md5.c:432:13: */
+func md5finalize(tls *libc.TLS, context uintptr) { /* test_md5.c:432:13: */
bp := tls.Alloc(49)
defer tls.Free(49)
@@ -60579,14 +65315,14 @@ func md5finalize(tls *crt.TLS, context uintptr) { /* test_md5.c:432:13: */
p = sqlite3.Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(MD5Context{})))
MD5Final(tls, bp /* &digest[0] */, p)
MD5DigestToBase16(tls, bp /* &digest[0] */, bp+16 /* &zBuf[0] */)
- sqlite3.Xsqlite3_result_text(tls, context, bp+16 /* &zBuf[0] */, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, context, bp+16 /* &zBuf[0] */, -1, libc.UintptrFromInt32(-1))
}
-func Md5_Register(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pThunk uintptr) int32 { /* test_md5.c:441:5: */
- var rc int32 = sqlite3.Xsqlite3_create_function(tls, db, ts+31425 /* "md5sum" */, -1, 1, uintptr(0), uintptr(0),
+func Md5_Register(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pThunk uintptr) int32 { /* test_md5.c:441:5: */
+ var rc int32 = sqlite3.Xsqlite3_create_function(tls, db, ts+33509 /* "md5sum" */, -1, 1, uintptr(0), uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{md5step})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{md5finalize})))
- sqlite3.Xsqlite3_overload_function(tls, db, ts+31425 /* "md5sum" */, -1) // To exercise this API
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{md5step})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{md5finalize})))
+ sqlite3.Xsqlite3_overload_function(tls, db, ts+33509 /* "md5sum" */, -1) // To exercise this API
return rc
}
@@ -60714,7 +65450,7 @@ var gMultiplex struct {
// The value returned will never be negative. Nor will it ever be greater
// than the actual length of the string. For very long strings (greater
// than 1GiB) the value returned might be less than the true string length.
-func multiplexStrlen30(tls *crt.TLS, z uintptr) int32 { /* test_multiplex.c:187:12: */
+func multiplexStrlen30(tls *libc.TLS, z uintptr) int32 { /* test_multiplex.c:187:12: */
var z2 uintptr = z
if z == uintptr(0) {
return 0
@@ -60748,14 +65484,14 @@ func multiplexStrlen30(tls *crt.TLS, z uintptr) int32 { /* test_multiplex.c:187:
//
// The output buffer string is terminated by 2 0x00 bytes. This makes it safe
// to pass to sqlite3_uri_parameter() and similar.
-func multiplexFilename(tls *crt.TLS, zBase uintptr, nBase int32, flags int32, iChunk int32, zOut uintptr) { /* test_multiplex.c:219:13: */
+func multiplexFilename(tls *libc.TLS, zBase uintptr, nBase int32, flags int32, iChunk int32, zOut uintptr) { /* test_multiplex.c:219:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
var n int32 = nBase
- crt.Xmemcpy(tls, zOut, zBase, (uint64(n + 1)))
+ libc.Xmemcpy(tls, zOut, zBase, (uint64(n + 1)))
if (iChunk != 0) && (iChunk <= 299) {
- sqlite3.Xsqlite3_snprintf(tls, 4, (zOut + uintptr(n)), ts+31432 /* "%03d" */, crt.VaList(bp, iChunk))
+ sqlite3.Xsqlite3_snprintf(tls, 4, (zOut + uintptr(n)), ts+33516 /* "%03d" */, libc.VaList(bp, iChunk))
n = n + (3)
}
@@ -60763,14 +65499,14 @@ func multiplexFilename(tls *crt.TLS, zBase uintptr, nBase int32, flags int32, iC
}
// Compute the filename for the iChunk-th chunk
-func multiplexSubFilename(tls *crt.TLS, pGroup uintptr, iChunk int32) int32 { /* test_multiplex.c:256:12: */
+func multiplexSubFilename(tls *libc.TLS, pGroup uintptr, iChunk int32) int32 { /* test_multiplex.c:256:12: */
if iChunk >= (*multiplexGroup)(unsafe.Pointer(pGroup)).FnReal {
var p uintptr
p = sqlite3.Xsqlite3_realloc64(tls, (*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal, (uint64((uint64(iChunk + 1)) * uint64(unsafe.Sizeof(multiplexReal{})))))
if p == uintptr(0) {
return 7
}
- crt.Xmemset(tls, (p + uintptr((*multiplexGroup)(unsafe.Pointer(pGroup)).FnReal)*16), 0, (uint64(unsafe.Sizeof(multiplexReal{})) * (uint64((iChunk + 1) - (*multiplexGroup)(unsafe.Pointer(pGroup)).FnReal))))
+ libc.Xmemset(tls, (p + uintptr((*multiplexGroup)(unsafe.Pointer(pGroup)).FnReal)*16), 0, (uint64(unsafe.Sizeof(multiplexReal{})) * (uint64((iChunk + 1) - (*multiplexGroup)(unsafe.Pointer(pGroup)).FnReal))))
(*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal = p
(*multiplexGroup)(unsafe.Pointer(pGroup)).FnReal = (iChunk + 1)
}
@@ -60797,7 +65533,7 @@ func multiplexSubFilename(tls *crt.TLS, pGroup uintptr, iChunk int32) int32 { /*
// For chunk 0, the pGroup->flags determines whether or not a new file
// is created if it does not already exist. For chunks 1 and higher, the
// file is created only if createFlag is 1.
-func multiplexSubOpen(tls *crt.TLS, pGroup uintptr, iChunk int32, rc uintptr, pOutFlags uintptr, createFlag int32) uintptr { /* test_multiplex.c:289:21: */
+func multiplexSubOpen(tls *libc.TLS, pGroup uintptr, iChunk int32, rc uintptr, pOutFlags uintptr, createFlag int32) uintptr { /* test_multiplex.c:289:21: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -60805,7 +65541,7 @@ func multiplexSubOpen(tls *crt.TLS, pGroup uintptr, iChunk int32, rc uintptr, pO
var pOrigVfs uintptr = gMultiplex.FpOrigVfs // Real VFS
*(*int32)(unsafe.Pointer(rc)) = multiplexSubFilename(tls, pGroup, iChunk)
- if ((*(*int32)(unsafe.Pointer(rc))) == 0) && ((crt.AssignUintptr(&pSubOpen, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fp)) == uintptr(0)) {
+ if ((*(*int32)(unsafe.Pointer(rc))) == 0) && ((libc.AssignUintptr(&pSubOpen, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fp)) == uintptr(0)) {
var flags int32
// var bExists int32 at bp+16, 4
@@ -60816,16 +65552,16 @@ func multiplexSubOpen(tls *crt.TLS, pGroup uintptr, iChunk int32, rc uintptr, pO
} else if (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz == uintptr(0) {
return uintptr(0)
} else {
- *(*int32)(unsafe.Pointer(rc)) = (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 56 /* &.xAccess */))))(tls, pOrigVfs, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz,
+ *(*int32)(unsafe.Pointer(rc)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 56 /* &.xAccess */))))(tls, pOrigVfs, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz,
0, bp+16 /* &bExists */)
if (*(*int32)(unsafe.Pointer(rc)) != 0) || !(*(*int32)(unsafe.Pointer(bp + 16 /* bExists */)) != 0) {
if *(*int32)(unsafe.Pointer(rc)) != 0 {
- sqlite3.Xsqlite3_log(tls, *(*int32)(unsafe.Pointer(rc)), ts+31437, /* "multiplexor.xAcc..." */
- crt.VaList(bp, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz))
+ sqlite3.Xsqlite3_log(tls, *(*int32)(unsafe.Pointer(rc)), ts+33521, /* "multiplexor.xAcc..." */
+ libc.VaList(bp, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz))
}
return uintptr(0)
}
- flags = flags & (^int32(crt.Int32FromInt32(0x00000004)))
+ flags = flags & (^int32(libc.Int32FromInt32(0x00000004)))
}
pSubOpen = sqlite3.Xsqlite3_malloc64(tls, uint64((*sqlite3_vfs)(unsafe.Pointer(pOrigVfs)).FszOsFile))
if pSubOpen == uintptr(0) {
@@ -60833,11 +65569,11 @@ func multiplexSubOpen(tls *crt.TLS, pGroup uintptr, iChunk int32, rc uintptr, pO
return uintptr(0)
}
(*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal + uintptr(iChunk)*16)).Fp = pSubOpen
- *(*int32)(unsafe.Pointer(rc)) = (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 40 /* &.xOpen */))))(tls, pOrigVfs, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz, pSubOpen,
+ *(*int32)(unsafe.Pointer(rc)) = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 40 /* &.xOpen */))))(tls, pOrigVfs, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz, pSubOpen,
flags, pOutFlags)
if (*(*int32)(unsafe.Pointer(rc))) != 0 {
- sqlite3.Xsqlite3_log(tls, *(*int32)(unsafe.Pointer(rc)), ts+31471, /* "multiplexor.xOpe..." */
- crt.VaList(bp+8, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz))
+ sqlite3.Xsqlite3_log(tls, *(*int32)(unsafe.Pointer(rc)), ts+33555, /* "multiplexor.xOpe..." */
+ libc.VaList(bp+8, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz))
sqlite3.Xsqlite3_free(tls, pSubOpen)
(*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal + uintptr(iChunk)*16)).Fp = uintptr(0)
return uintptr(0)
@@ -60849,7 +65585,7 @@ func multiplexSubOpen(tls *crt.TLS, pGroup uintptr, iChunk int32, rc uintptr, pO
// Return the size, in bytes, of chunk number iChunk. If that chunk
// does not exist, then return 0. This function does not distingish between
// non-existant files and zero-length files.
-func multiplexSubSize(tls *crt.TLS, pGroup uintptr, iChunk int32, rc uintptr) sqlite3_int64 { /* test_multiplex.c:357:22: */
+func multiplexSubSize(tls *libc.TLS, pGroup uintptr, iChunk int32, rc uintptr) sqlite3_int64 { /* test_multiplex.c:357:22: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -60863,12 +65599,12 @@ func multiplexSubSize(tls *crt.TLS, pGroup uintptr, iChunk int32, rc uintptr) sq
if pSub == uintptr(0) {
return int64(0)
}
- *(*int32)(unsafe.Pointer(rc)) = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSub)).FpMethods + 48 /* &.xFileSize */))))(tls, pSub, bp /* &sz */)
+ *(*int32)(unsafe.Pointer(rc)) = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSub)).FpMethods + 48 /* &.xFileSize */))))(tls, pSub, bp /* &sz */)
return *(*sqlite3_int64)(unsafe.Pointer(bp /* sz */))
}
// This is the implementation of the multiplex_control() SQL function.
-func multiplexControlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* test_multiplex.c:375:13: */
+func multiplexControlFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* test_multiplex.c:375:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -60910,31 +65646,31 @@ func multiplexControlFunc(tls *crt.TLS, context uintptr, argc int32, argv uintpt
// This is the entry point to register the auto-extension for the
// multiplex_control() function.
-func multiplexFuncInit(tls *crt.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* test_multiplex.c:417:12: */
+func multiplexFuncInit(tls *libc.TLS, db uintptr, pzErrMsg uintptr, pApi uintptr) int32 { /* test_multiplex.c:417:12: */
var rc int32
- rc = sqlite3.Xsqlite3_create_function(tls, db, ts+31503 /* "multiplex_contro..." */, 2, 5,
+ rc = sqlite3.Xsqlite3_create_function(tls, db, ts+33587 /* "multiplex_contro..." */, 2, 5,
uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{multiplexControlFunc})), uintptr(0), uintptr(0))
return rc
}
// Close a single sub-file in the connection group.
-func multiplexSubClose(tls *crt.TLS, pGroup uintptr, iChunk int32, pOrigVfs uintptr) { /* test_multiplex.c:431:13: */
+func multiplexSubClose(tls *libc.TLS, pGroup uintptr, iChunk int32, pOrigVfs uintptr) { /* test_multiplex.c:431:13: */
var pSubOpen uintptr = (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal + uintptr(iChunk)*16)).Fp
if pSubOpen != 0 {
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 8 /* &.xClose */))))(tls, pSubOpen)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 8 /* &.xClose */))))(tls, pSubOpen)
if (pOrigVfs != 0) && ((*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz != 0) {
- (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pOrigVfs + 48 /* &.xDelete */))))(tls, pOrigVfs, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz, 0)
+ (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pOrigVfs + 48 /* &.xDelete */))))(tls, pOrigVfs, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz, 0)
}
sqlite3.Xsqlite3_free(tls, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fp)
}
sqlite3.Xsqlite3_free_filename(tls, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz)
- crt.Xmemset(tls, ((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal + uintptr(iChunk)*16), 0, uint64(unsafe.Sizeof(multiplexReal{})))
+ libc.Xmemset(tls, ((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal + uintptr(iChunk)*16), 0, uint64(unsafe.Sizeof(multiplexReal{})))
}
// Deallocate memory held by a multiplexGroup
-func multiplexFreeComponents(tls *crt.TLS, pGroup uintptr) { /* test_multiplex.c:451:13: */
+func multiplexFreeComponents(tls *libc.TLS, pGroup uintptr) { /* test_multiplex.c:451:13: */
var i int32
for i = 0; i < (*multiplexGroup)(unsafe.Pointer(pGroup)).FnReal; i++ {
multiplexSubClose(tls, pGroup, i, uintptr(0))
@@ -60951,7 +65687,7 @@ func multiplexFreeComponents(tls *crt.TLS, pGroup uintptr) { /* test_multiplex.c
// Most of the work is done by the underlying original VFS. This method
// simply links the new file into the appropriate multiplex group if it is a
// file that needs to be tracked.
-func multiplexOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, flags int32, pOutFlags uintptr) int32 { /* test_multiplex.c:469:12: */
+func multiplexOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pConn uintptr, flags int32, pOutFlags uintptr) int32 { /* test_multiplex.c:469:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -60965,7 +65701,7 @@ func multiplexOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, fla
var zToFree uintptr = uintptr(0)
_ = pVfs
- crt.Xmemset(tls, pConn, 0, uint64((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))
+ libc.Xmemset(tls, pConn, 0, uint64((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))
// We need to create a group structure and manage
// access to this group of files.
@@ -60994,18 +65730,18 @@ func multiplexOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, fla
zUri = uintptr(0)
}
// assign pointers to extra space allocated
- crt.Xmemset(tls, pGroup, 0, uint64(sz))
+ libc.Xmemset(tls, pGroup, 0, uint64(sz))
(*multiplexConn)(unsafe.Pointer(pMultiplexOpen)).FpGroup = pGroup
- (*multiplexGroup)(unsafe.Pointer(pGroup)).FbEnabled = crt.Uint8(crt.Uint8FromInt32(-1))
- (*multiplexGroup)(unsafe.Pointer(pGroup)).FbTruncate = uint8(sqlite3.Xsqlite3_uri_boolean(tls, zUri, ts+15905, /* "truncate" */
- (crt.Bool32((flags & 0x00000100) == 0))))
- (*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk = uint32(int32(sqlite3.Xsqlite3_uri_int64(tls, zUri, ts+31521, /* "chunksize" */
+ (*multiplexGroup)(unsafe.Pointer(pGroup)).FbEnabled = libc.Uint8(libc.Uint8FromInt32(-1))
+ (*multiplexGroup)(unsafe.Pointer(pGroup)).FbTruncate = uint8(sqlite3.Xsqlite3_uri_boolean(tls, zUri, ts+17605, /* "truncate" */
+ (libc.Bool32((flags & 0x00000100) == 0))))
+ (*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk = uint32(int32(sqlite3.Xsqlite3_uri_int64(tls, zUri, ts+33605, /* "chunksize" */
int64(2147418112))))
- (*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk = (((*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk + uint32(0xffff)) & ^uint32(crt.Int32FromInt32(0xffff)))
+ (*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk = (((*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk + uint32(0xffff)) & ^uint32(libc.Int32FromInt32(0xffff)))
if zName != 0 {
var p uintptr = (pGroup + uintptr(1)*40)
(*multiplexGroup)(unsafe.Pointer(pGroup)).FzName = p
- crt.Xmemcpy(tls, (*multiplexGroup)(unsafe.Pointer(pGroup)).FzName, zName, (uint64(nName + 1)))
+ libc.Xmemcpy(tls, (*multiplexGroup)(unsafe.Pointer(pGroup)).FzName, zName, (uint64(nName + 1)))
(*multiplexGroup)(unsafe.Pointer(pGroup)).FnName = nName
}
if (*multiplexGroup)(unsafe.Pointer(pGroup)).FbEnabled != 0 {
@@ -61013,7 +65749,7 @@ func multiplexOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, fla
*(*uint32)(unsafe.Pointer(pGroup + 32 /* &.szChunk */)) += (uint32(65536))
}
}
- (*multiplexGroup)(unsafe.Pointer(pGroup)).Fflags = (flags & ^int32(crt.Int32FromInt32(0x00000040)))
+ (*multiplexGroup)(unsafe.Pointer(pGroup)).Fflags = (flags & ^int32(libc.Int32FromInt32(0x00000040)))
*(*int32)(unsafe.Pointer(bp /* rc */)) = multiplexSubFilename(tls, pGroup, 1)
if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
pSubOpen = multiplexSubOpen(tls, pGroup, 0, bp /* &rc */, pOutFlags, 0)
@@ -61024,7 +65760,7 @@ func multiplexOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, fla
if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
// var sz64 sqlite3_int64 at bp+8, 8
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 48 /* &.xFileSize */))))(tls, pSubOpen, bp+8 /* &sz64 */)
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 48 /* &.xFileSize */))))(tls, pSubOpen, bp+8 /* &sz64 */)
if (*(*int32)(unsafe.Pointer(bp /* rc */)) == 0) && (zName != 0) {
// var bExists int32 at bp+16, 4
@@ -61037,12 +65773,12 @@ func multiplexOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, fla
// file-system.
var iChunk int32 = 1
for ok := true; ok; ok = ((*(*int32)(unsafe.Pointer(bp /* rc */)) == 0) && (*(*int32)(unsafe.Pointer(bp + 16 /* bExists */)) != 0)) {
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 56 /* &.xAccess */))))(tls, pOrigVfs,
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 56 /* &.xAccess */))))(tls, pOrigVfs,
(*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz, 0, bp+16 /* &bExists */)
if (*(*int32)(unsafe.Pointer(bp /* rc */)) == 0) && (*(*int32)(unsafe.Pointer(bp + 16 /* bExists */)) != 0) {
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pOrigVfs + 48 /* &.xDelete */))))(tls, pOrigVfs, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz, 0)
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pOrigVfs + 48 /* &.xDelete */))))(tls, pOrigVfs, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(iChunk)*16)).Fz, 0)
if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
- *(*int32)(unsafe.Pointer(bp /* rc */)) = multiplexSubFilename(tls, pGroup, crt.PreIncInt32(&iChunk, 1))
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = multiplexSubFilename(tls, pGroup, libc.PreIncInt32(&iChunk, 1))
}
}
}
@@ -61056,9 +65792,9 @@ func multiplexOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, fla
// larger than the chunk size, that means the chunk size is too small.
// But we have no way of determining the intended chunk size, so
// just disable the multiplexor all togethre.
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 56 /* &.xAccess */))))(tls, pOrigVfs, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(1)*16)).Fz,
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 56 /* &.xAccess */))))(tls, pOrigVfs, (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal+uintptr(1)*16)).Fz,
0, bp+16 /* &bExists */)
- *(*int32)(unsafe.Pointer(bp + 16 /* bExists */)) = (crt.Bool32(multiplexSubSize(tls, pGroup, 1, bp /* &rc */) > int64(0)))
+ *(*int32)(unsafe.Pointer(bp + 16 /* bExists */)) = (libc.Bool32(multiplexSubSize(tls, pGroup, 1, bp /* &rc */) > int64(0)))
if ((((*(*int32)(unsafe.Pointer(bp /* rc */)) == 0) && (*(*int32)(unsafe.Pointer(bp + 16 /* bExists */)) != 0)) && (*(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* sz64 */)) == (*(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* sz64 */)) & int64(0xffff0000)))) && (*(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* sz64 */)) > int64(0))) &&
(*(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* sz64 */)) != sqlite3_int64((*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk)) {
(*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk = uint32(int32(*(*sqlite3_int64)(unsafe.Pointer(bp + 8 /* sz64 */))))
@@ -61071,9 +65807,9 @@ func multiplexOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, fla
if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
if (*sqlite3_io_methods1)(unsafe.Pointer((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods)).FiVersion == 1 {
- (*multiplexConn)(unsafe.Pointer(pMultiplexOpen)).Fbase.FpMethods = (uintptr(unsafe.Pointer(&gMultiplex)) + 176 /* &.sIoMethodsV1 */)
+ (*sqlite3_file)(unsafe.Pointer(pConn)).FpMethods = (uintptr(unsafe.Pointer(&gMultiplex)) + 176 /* &.sIoMethodsV1 */)
} else {
- (*multiplexConn)(unsafe.Pointer(pMultiplexOpen)).Fbase.FpMethods = (uintptr(unsafe.Pointer(&gMultiplex)) + 328 /* &.sIoMethodsV2 */)
+ (*sqlite3_file)(unsafe.Pointer(pConn)).FpMethods = (uintptr(unsafe.Pointer(&gMultiplex)) + 328 /* &.sIoMethodsV2 */)
}
} else {
multiplexFreeComponents(tls, pGroup)
@@ -61086,17 +65822,17 @@ func multiplexOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, fla
// This is the xDelete method used for the "multiplex" VFS.
// It attempts to delete the filename specified.
-func multiplexDelete(tls *crt.TLS, pVfs uintptr, zName uintptr, syncDir int32) int32 { /* test_multiplex.c:611:12: */
+func multiplexDelete(tls *libc.TLS, pVfs uintptr, zName uintptr, syncDir int32) int32 { /* test_multiplex.c:611:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
var rc int32
var pOrigVfs uintptr = gMultiplex.FpOrigVfs // Real VFS
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pOrigVfs + 48 /* &.xDelete */))))(tls, pOrigVfs, zName, syncDir)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pOrigVfs + 48 /* &.xDelete */))))(tls, pOrigVfs, zName, syncDir)
if rc == 0 {
// If the main chunk was deleted successfully, also delete any subsequent
// chunks - starting with the last (highest numbered).
- var nName int32 = int32(crt.Xstrlen(tls, zName))
+ var nName int32 = int32(libc.Xstrlen(tls, zName))
var z uintptr
z = sqlite3.Xsqlite3_malloc64(tls, (uint64(nName + 5)))
if z == uintptr(0) {
@@ -61106,22 +65842,22 @@ func multiplexDelete(tls *crt.TLS, pVfs uintptr, zName uintptr, syncDir int32) i
// var bExists int32 at bp, 4
for ok := true; ok; ok = ((rc == 0) && (*(*int32)(unsafe.Pointer(bp /* bExists */)) != 0)) {
- multiplexFilename(tls, zName, nName, 0x00000800, crt.PreIncInt32(&iChunk, 1), z)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 56 /* &.xAccess */))))(tls, pOrigVfs, z, 0, bp /* &bExists */)
+ multiplexFilename(tls, zName, nName, 0x00000800, libc.PreIncInt32(&iChunk, 1), z)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 56 /* &.xAccess */))))(tls, pOrigVfs, z, 0, bp /* &bExists */)
}
for (rc == 0) && (iChunk > 1) {
- multiplexFilename(tls, zName, nName, 0x00000800, crt.PreDecInt32(&iChunk, 1), z)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pOrigVfs + 48 /* &.xDelete */))))(tls, pOrigVfs, z, syncDir)
+ multiplexFilename(tls, zName, nName, 0x00000800, libc.PreDecInt32(&iChunk, 1), z)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pOrigVfs + 48 /* &.xDelete */))))(tls, pOrigVfs, z, syncDir)
}
if rc == 0 {
iChunk = 0
for ok1 := true; ok1; ok1 = ((rc == 0) && (*(*int32)(unsafe.Pointer(bp /* bExists */)) != 0)) {
- multiplexFilename(tls, zName, nName, 0x00080000, crt.PreIncInt32(&iChunk, 1), z)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 56 /* &.xAccess */))))(tls, pOrigVfs, z, 0, bp /* &bExists */)
+ multiplexFilename(tls, zName, nName, 0x00080000, libc.PreIncInt32(&iChunk, 1), z)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 56 /* &.xAccess */))))(tls, pOrigVfs, z, 0, bp /* &bExists */)
}
for (rc == 0) && (iChunk > 1) {
- multiplexFilename(tls, zName, nName, 0x00080000, crt.PreDecInt32(&iChunk, 1), z)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pOrigVfs + 48 /* &.xDelete */))))(tls, pOrigVfs, z, syncDir)
+ multiplexFilename(tls, zName, nName, 0x00080000, libc.PreDecInt32(&iChunk, 1), z)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pOrigVfs + 48 /* &.xDelete */))))(tls, pOrigVfs, z, syncDir)
}
}
}
@@ -61130,43 +65866,43 @@ func multiplexDelete(tls *crt.TLS, pVfs uintptr, zName uintptr, syncDir int32) i
return rc
}
-func multiplexAccess(tls *crt.TLS, a uintptr, b uintptr, c int32, d uintptr) int32 { /* test_multiplex.c:656:12: */
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 56 /* &.xAccess */))))(tls, gMultiplex.FpOrigVfs, b, c, d)
+func multiplexAccess(tls *libc.TLS, a uintptr, b uintptr, c int32, d uintptr) int32 { /* test_multiplex.c:656:12: */
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 56 /* &.xAccess */))))(tls, gMultiplex.FpOrigVfs, b, c, d)
}
-func multiplexFullPathname(tls *crt.TLS, a uintptr, b uintptr, c int32, d uintptr) int32 { /* test_multiplex.c:659:12: */
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 64 /* &.xFullPathname */))))(tls, gMultiplex.FpOrigVfs, b, c, d)
+func multiplexFullPathname(tls *libc.TLS, a uintptr, b uintptr, c int32, d uintptr) int32 { /* test_multiplex.c:659:12: */
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 64 /* &.xFullPathname */))))(tls, gMultiplex.FpOrigVfs, b, c, d)
}
-func multiplexDlOpen(tls *crt.TLS, a uintptr, b uintptr) uintptr { /* test_multiplex.c:662:13: */
- return (*(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((gMultiplex.FpOrigVfs + 72 /* &.xDlOpen */))))(tls, gMultiplex.FpOrigVfs, b)
+func multiplexDlOpen(tls *libc.TLS, a uintptr, b uintptr) uintptr { /* test_multiplex.c:662:13: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((gMultiplex.FpOrigVfs + 72 /* &.xDlOpen */))))(tls, gMultiplex.FpOrigVfs, b)
}
-func multiplexDlError(tls *crt.TLS, a uintptr, b int32, c uintptr) { /* test_multiplex.c:665:13: */
- (*(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer((gMultiplex.FpOrigVfs + 80 /* &.xDlError */))))(tls, gMultiplex.FpOrigVfs, b, c)
+func multiplexDlError(tls *libc.TLS, a uintptr, b int32, c uintptr) { /* test_multiplex.c:665:13: */
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((gMultiplex.FpOrigVfs + 80 /* &.xDlError */))))(tls, gMultiplex.FpOrigVfs, b, c)
}
-func multiplexDlSym(tls *crt.TLS, a uintptr, b uintptr, c uintptr) uintptr { /* test_multiplex.c:668:13: */
- return (*(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((gMultiplex.FpOrigVfs + 88 /* &.xDlSym */))))(tls, gMultiplex.FpOrigVfs, b, c)
+func multiplexDlSym(tls *libc.TLS, a uintptr, b uintptr, c uintptr) uintptr { /* test_multiplex.c:668:13: */
+ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((gMultiplex.FpOrigVfs + 88 /* &.xDlSym */))))(tls, gMultiplex.FpOrigVfs, b, c)
}
-func multiplexDlClose(tls *crt.TLS, a uintptr, b uintptr) { /* test_multiplex.c:671:13: */
- (*(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer((gMultiplex.FpOrigVfs + 96 /* &.xDlClose */))))(tls, gMultiplex.FpOrigVfs, b)
+func multiplexDlClose(tls *libc.TLS, a uintptr, b uintptr) { /* test_multiplex.c:671:13: */
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((gMultiplex.FpOrigVfs + 96 /* &.xDlClose */))))(tls, gMultiplex.FpOrigVfs, b)
}
-func multiplexRandomness(tls *crt.TLS, a uintptr, b int32, c uintptr) int32 { /* test_multiplex.c:674:12: */
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 104 /* &.xRandomness */))))(tls, gMultiplex.FpOrigVfs, b, c)
+func multiplexRandomness(tls *libc.TLS, a uintptr, b int32, c uintptr) int32 { /* test_multiplex.c:674:12: */
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 104 /* &.xRandomness */))))(tls, gMultiplex.FpOrigVfs, b, c)
}
-func multiplexSleep(tls *crt.TLS, a uintptr, b int32) int32 { /* test_multiplex.c:677:12: */
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 112 /* &.xSleep */))))(tls, gMultiplex.FpOrigVfs, b)
+func multiplexSleep(tls *libc.TLS, a uintptr, b int32) int32 { /* test_multiplex.c:677:12: */
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 112 /* &.xSleep */))))(tls, gMultiplex.FpOrigVfs, b)
}
-func multiplexCurrentTime(tls *crt.TLS, a uintptr, b uintptr) int32 { /* test_multiplex.c:680:12: */
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 120 /* &.xCurrentTime */))))(tls, gMultiplex.FpOrigVfs, b)
+func multiplexCurrentTime(tls *libc.TLS, a uintptr, b uintptr) int32 { /* test_multiplex.c:680:12: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 120 /* &.xCurrentTime */))))(tls, gMultiplex.FpOrigVfs, b)
}
-func multiplexGetLastError(tls *crt.TLS, a uintptr, b int32, c uintptr) int32 { /* test_multiplex.c:683:12: */
+func multiplexGetLastError(tls *libc.TLS, a uintptr, b int32, c uintptr) int32 { /* test_multiplex.c:683:12: */
if (*sqlite3_vfs)(unsafe.Pointer(gMultiplex.FpOrigVfs)).FxGetLastError != 0 {
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 128 /* &.xGetLastError */))))(tls, gMultiplex.FpOrigVfs, b, c)
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 128 /* &.xGetLastError */))))(tls, gMultiplex.FpOrigVfs, b, c)
} else {
return 0
}
return int32(0)
}
-func multiplexCurrentTimeInt64(tls *crt.TLS, a uintptr, b uintptr) int32 { /* test_multiplex.c:690:12: */
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, gMultiplex.FpOrigVfs, b)
+func multiplexCurrentTimeInt64(tls *libc.TLS, a uintptr, b uintptr) int32 { /* test_multiplex.c:690:12: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((gMultiplex.FpOrigVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, gMultiplex.FpOrigVfs, b)
}
//*********************** I/O Method Wrappers ******************************
@@ -61175,7 +65911,7 @@ func multiplexCurrentTimeInt64(tls *crt.TLS, a uintptr, b uintptr) int32 { /* te
// We loop over all open chunk handles and close them.
// The group structure for this file is unlinked from
// our list of groups and freed.
-func multiplexClose(tls *crt.TLS, pConn uintptr) int32 { /* test_multiplex.c:701:12: */
+func multiplexClose(tls *libc.TLS, pConn uintptr) int32 { /* test_multiplex.c:701:12: */
var p uintptr = pConn
var pGroup uintptr = (*multiplexConn)(unsafe.Pointer(p)).FpGroup
var rc int32 = 0
@@ -61187,7 +65923,7 @@ func multiplexClose(tls *crt.TLS, pConn uintptr) int32 { /* test_multiplex.c:701
// Pass xRead requests thru to the original VFS after
// determining the correct chunk to operate on.
// Break up reads across chunk boundaries.
-func multiplexRead(tls *crt.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst sqlite3_int64) int32 { /* test_multiplex.c:714:12: */
+func multiplexRead(tls *libc.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst sqlite3_int64) int32 { /* test_multiplex.c:714:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61199,7 +65935,7 @@ func multiplexRead(tls *crt.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst
if pSubOpen == uintptr(0) {
*(*int32)(unsafe.Pointer(bp /* rc */)) = (10 | (int32(1) << 8))
} else {
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 16 /* &.xRead */))))(tls, pSubOpen, pBuf, iAmt, iOfst)
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 16 /* &.xRead */))))(tls, pSubOpen, pBuf, iAmt, iOfst)
}
} else {
for iAmt > 0 {
@@ -61212,7 +65948,7 @@ func multiplexRead(tls *crt.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst
extra = 0
}
iAmt = iAmt - (extra)
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 16 /* &.xRead */))))(tls, pSubOpen, pBuf, iAmt,
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 16 /* &.xRead */))))(tls, pSubOpen, pBuf, iAmt,
(iOfst % sqlite3_int64((*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk)))
if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
break
@@ -61233,7 +65969,7 @@ func multiplexRead(tls *crt.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst
// Pass xWrite requests thru to the original VFS after
// determining the correct chunk to operate on.
// Break up writes across chunk boundaries.
-func multiplexWrite(tls *crt.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst sqlite3_int64) int32 { /* test_multiplex.c:759:12: */
+func multiplexWrite(tls *libc.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst sqlite3_int64) int32 { /* test_multiplex.c:759:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61245,7 +65981,7 @@ func multiplexWrite(tls *crt.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst
if pSubOpen == uintptr(0) {
*(*int32)(unsafe.Pointer(bp /* rc */)) = (10 | (int32(3) << 8))
} else {
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 24 /* &.xWrite */))))(tls, pSubOpen, pBuf, iAmt, iOfst)
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 24 /* &.xWrite */))))(tls, pSubOpen, pBuf, iAmt, iOfst)
}
} else {
for (*(*int32)(unsafe.Pointer(bp /* rc */)) == 0) && (iAmt > 0) {
@@ -61257,7 +65993,7 @@ func multiplexWrite(tls *crt.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst
extra = 0
}
iAmt = iAmt - (extra)
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 24 /* &.xWrite */))))(tls, pSubOpen, pBuf, iAmt,
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 24 /* &.xWrite */))))(tls, pSubOpen, pBuf, iAmt,
(iOfst % sqlite3_int64((*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk)))
pBuf = (pBuf + uintptr(iAmt))
iOfst = iOfst + (sqlite3_int64(iAmt))
@@ -61271,7 +66007,7 @@ func multiplexWrite(tls *crt.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst
// Pass xTruncate requests thru to the original VFS after
// determining the correct chunk to operate on. Delete any
// chunks above the truncate mark.
-func multiplexTruncate(tls *crt.TLS, pConn uintptr, size sqlite3_int64) int32 { /* test_multiplex.c:799:12: */
+func multiplexTruncate(tls *libc.TLS, pConn uintptr, size sqlite3_int64) int32 { /* test_multiplex.c:799:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61283,7 +66019,7 @@ func multiplexTruncate(tls *crt.TLS, pConn uintptr, size sqlite3_int64) int32 {
if pSubOpen == uintptr(0) {
*(*int32)(unsafe.Pointer(bp /* rc */)) = (10 | (int32(6) << 8))
} else {
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*crt.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 32 /* &.xTruncate */))))(tls, pSubOpen, size)
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 32 /* &.xTruncate */))))(tls, pSubOpen, size)
}
} else {
var i int32
@@ -61297,14 +66033,14 @@ func multiplexTruncate(tls *crt.TLS, pConn uintptr, size sqlite3_int64) int32 {
} else {
pSubOpen = multiplexSubOpen(tls, pGroup, i, bp /* &rc */, uintptr(0), 0)
if pSubOpen != 0 {
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*crt.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 32 /* &.xTruncate */))))(tls, pSubOpen, int64(0))
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 32 /* &.xTruncate */))))(tls, pSubOpen, int64(0))
}
}
}
if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
pSubOpen = multiplexSubOpen(tls, pGroup, iBaseGroup, bp /* &rc */, uintptr(0), 0)
if pSubOpen != 0 {
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*crt.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 32 /* &.xTruncate */))))(tls, pSubOpen, (size % sqlite3_int64((*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk)))
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 32 /* &.xTruncate */))))(tls, pSubOpen, (size % sqlite3_int64((*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk)))
}
}
if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
@@ -61315,7 +66051,7 @@ func multiplexTruncate(tls *crt.TLS, pConn uintptr, size sqlite3_int64) int32 {
}
// Pass xSync requests through to the original VFS without change
-func multiplexSync(tls *crt.TLS, pConn uintptr, flags int32) int32 { /* test_multiplex.c:839:12: */
+func multiplexSync(tls *libc.TLS, pConn uintptr, flags int32) int32 { /* test_multiplex.c:839:12: */
var p uintptr = pConn
var pGroup uintptr = (*multiplexConn)(unsafe.Pointer(p)).FpGroup
var rc int32 = 0
@@ -61323,7 +66059,7 @@ func multiplexSync(tls *crt.TLS, pConn uintptr, flags int32) int32 { /* test_mul
for i = 0; i < (*multiplexGroup)(unsafe.Pointer(pGroup)).FnReal; i++ {
var pSubOpen uintptr = (*multiplexReal)(unsafe.Pointer((*multiplexGroup)(unsafe.Pointer(pGroup)).FaReal + uintptr(i)*16)).Fp
if pSubOpen != 0 {
- var rc2 int32 = (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 40 /* &.xSync */))))(tls, pSubOpen, flags)
+ var rc2 int32 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 40 /* &.xSync */))))(tls, pSubOpen, flags)
if rc2 != 0 {
rc = rc2
}
@@ -61334,7 +66070,7 @@ func multiplexSync(tls *crt.TLS, pConn uintptr, flags int32) int32 { /* test_mul
// Pass xFileSize requests through to the original VFS.
// Aggregate the size of all the chunks before returning.
-func multiplexFileSize(tls *crt.TLS, pConn uintptr, pSize uintptr) int32 { /* test_multiplex.c:857:12: */
+func multiplexFileSize(tls *libc.TLS, pConn uintptr, pSize uintptr) int32 { /* test_multiplex.c:857:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61347,7 +66083,7 @@ func multiplexFileSize(tls *crt.TLS, pConn uintptr, pSize uintptr) int32 { /* te
if pSubOpen == uintptr(0) {
*(*int32)(unsafe.Pointer(bp /* rc */)) = (10 | (int32(7) << 8))
} else {
- *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 48 /* &.xFileSize */))))(tls, pSubOpen, pSize)
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 48 /* &.xFileSize */))))(tls, pSubOpen, pSize)
}
} else {
*(*sqlite3_int64)(unsafe.Pointer(pSize)) = int64(0)
@@ -61363,7 +66099,7 @@ func multiplexFileSize(tls *crt.TLS, pConn uintptr, pSize uintptr) int32 { /* te
}
// Pass xLock requests through to the original VFS unchanged.
-func multiplexLock(tls *crt.TLS, pConn uintptr, lock int32) int32 { /* test_multiplex.c:882:12: */
+func multiplexLock(tls *libc.TLS, pConn uintptr, lock int32) int32 { /* test_multiplex.c:882:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61372,13 +66108,13 @@ func multiplexLock(tls *crt.TLS, pConn uintptr, lock int32) int32 { /* test_mult
var pSubOpen uintptr = multiplexSubOpen(tls, (*multiplexConn)(unsafe.Pointer(p)).FpGroup, 0, bp /* &rc */, uintptr(0), 0)
if pSubOpen != 0 {
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 56 /* &.xLock */))))(tls, pSubOpen, lock)
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 56 /* &.xLock */))))(tls, pSubOpen, lock)
}
return 5
}
// Pass xUnlock requests through to the original VFS unchanged.
-func multiplexUnlock(tls *crt.TLS, pConn uintptr, lock int32) int32 { /* test_multiplex.c:894:12: */
+func multiplexUnlock(tls *libc.TLS, pConn uintptr, lock int32) int32 { /* test_multiplex.c:894:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61387,13 +66123,13 @@ func multiplexUnlock(tls *crt.TLS, pConn uintptr, lock int32) int32 { /* test_mu
var pSubOpen uintptr = multiplexSubOpen(tls, (*multiplexConn)(unsafe.Pointer(p)).FpGroup, 0, bp /* &rc */, uintptr(0), 0)
if pSubOpen != 0 {
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 64 /* &.xUnlock */))))(tls, pSubOpen, lock)
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 64 /* &.xUnlock */))))(tls, pSubOpen, lock)
}
return (10 | (int32(8) << 8))
}
// Pass xCheckReservedLock requests through to the original VFS unchanged.
-func multiplexCheckReservedLock(tls *crt.TLS, pConn uintptr, pResOut uintptr) int32 { /* test_multiplex.c:906:12: */
+func multiplexCheckReservedLock(tls *libc.TLS, pConn uintptr, pResOut uintptr) int32 { /* test_multiplex.c:906:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61402,14 +66138,14 @@ func multiplexCheckReservedLock(tls *crt.TLS, pConn uintptr, pResOut uintptr) in
var pSubOpen uintptr = multiplexSubOpen(tls, (*multiplexConn)(unsafe.Pointer(p)).FpGroup, 0, bp /* &rc */, uintptr(0), 0)
if pSubOpen != 0 {
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, pSubOpen, pResOut)
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, pSubOpen, pResOut)
}
return (10 | (int32(14) << 8))
}
// Pass xFileControl requests through to the original VFS unchanged,
// except for any MULTIPLEX_CTRL_* requests here.
-func multiplexFileControl(tls *crt.TLS, pConn uintptr, op int32, pArg uintptr) int32 { /* test_multiplex.c:919:12: */
+func multiplexFileControl(tls *libc.TLS, pConn uintptr, op int32, pArg uintptr) int32 { /* test_multiplex.c:919:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -61437,7 +66173,7 @@ func multiplexFileControl(tls *crt.TLS, pConn uintptr, op int32, pArg uintptr) i
} else {
// Round up to nearest multiple of MAX_PAGE_SIZE.
szChunk = (szChunk + (uint32(0x10000 - 1)))
- szChunk = szChunk & (^uint32(crt.Int32FromInt32((0x10000 - 1))))
+ szChunk = szChunk & (^uint32(libc.Int32FromInt32((0x10000 - 1))))
(*multiplexGroup)(unsafe.Pointer(pGroup)).FszChunk = szChunk
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = 0
}
@@ -61460,13 +66196,13 @@ func multiplexFileControl(tls *crt.TLS, pConn uintptr, op int32, pArg uintptr) i
// second element of the array is the name of the pragma and the third
// element is the argument to the pragma or NULL if the pragma has no
// argument.
- if (*(*uintptr)(unsafe.Pointer(aFcntl + uintptr(1)*8)) != 0) && (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + uintptr(1)*8)), ts+31531 /* "multiplex_trunca..." */) == 0) {
+ if (*(*uintptr)(unsafe.Pointer(aFcntl + uintptr(1)*8)) != 0) && (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + uintptr(1)*8)), ts+33615 /* "multiplex_trunca..." */) == 0) {
if (*(*uintptr)(unsafe.Pointer(aFcntl + uintptr(2)*8)) != 0) && (*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aFcntl + uintptr(2)*8)) + uintptr(0))) != 0) {
- if (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + uintptr(2)*8)), ts+3073 /* "on" */) == 0) ||
- (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + uintptr(2)*8)), ts+25702 /* "1" */) == 0) {
+ if (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + uintptr(2)*8)), ts+4222 /* "on" */) == 0) ||
+ (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + uintptr(2)*8)), ts+27761 /* "1" */) == 0) {
(*multiplexGroup)(unsafe.Pointer(pGroup)).FbTruncate = uint8(1)
- } else if (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + uintptr(2)*8)), ts+3084 /* "off" */) == 0) ||
- (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + uintptr(2)*8)), ts+12045 /* "0" */) == 0) {
+ } else if (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + uintptr(2)*8)), ts+4233 /* "off" */) == 0) ||
+ (sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(aFcntl + uintptr(2)*8)), ts+13695 /* "0" */) == 0) {
(*multiplexGroup)(unsafe.Pointer(pGroup)).FbTruncate = uint8(0)
}
}
@@ -61477,9 +66213,9 @@ func multiplexFileControl(tls *crt.TLS, pConn uintptr, op int32, pArg uintptr) i
// or the error message if the pragma fails.
*(*uintptr)(unsafe.Pointer(aFcntl + uintptr(0)*8)) = sqlite3.Xsqlite3_mprintf(tls, func() uintptr {
if (*multiplexGroup)(unsafe.Pointer(pGroup)).FbTruncate != 0 {
- return ts + 3073 /* "on" */
+ return ts + 4222 /* "on" */
}
- return ts + 3084 /* "off" */
+ return ts + 4233 /* "off" */
}(), 0)
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = 0
break
@@ -61491,9 +66227,9 @@ func multiplexFileControl(tls *crt.TLS, pConn uintptr, op int32, pArg uintptr) i
default:
pSubOpen = multiplexSubOpen(tls, pGroup, 0, bp+8 /* &rc */, uintptr(0), 0)
if pSubOpen != 0 {
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 80 /* &.xFileControl */))))(tls, pSubOpen, op, pArg)
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 80 /* &.xFileControl */))))(tls, pSubOpen, op, pArg)
if (op == 12) && (*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0) {
- *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+31550 /* "multiplex/%z" */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(pArg))))
+ *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+33634 /* "multiplex/%z" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(pArg))))
}
}
break
@@ -61502,7 +66238,7 @@ func multiplexFileControl(tls *crt.TLS, pConn uintptr, op int32, pArg uintptr) i
}
// Pass xSectorSize requests through to the original VFS unchanged.
-func multiplexSectorSize(tls *crt.TLS, pConn uintptr) int32 { /* test_multiplex.c:1004:12: */
+func multiplexSectorSize(tls *libc.TLS, pConn uintptr) int32 { /* test_multiplex.c:1004:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61511,13 +66247,13 @@ func multiplexSectorSize(tls *crt.TLS, pConn uintptr) int32 { /* test_multiplex.
var pSubOpen uintptr = multiplexSubOpen(tls, (*multiplexConn)(unsafe.Pointer(p)).FpGroup, 0, bp /* &rc */, uintptr(0), 0)
if (pSubOpen != 0) && ((*sqlite3_io_methods1)(unsafe.Pointer((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods)).FxSectorSize != 0) {
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 88 /* &.xSectorSize */))))(tls, pSubOpen)
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 88 /* &.xSectorSize */))))(tls, pSubOpen)
}
return 0x1000
}
// Pass xDeviceCharacteristics requests through to the original VFS unchanged.
-func multiplexDeviceCharacteristics(tls *crt.TLS, pConn uintptr) int32 { /* test_multiplex.c:1016:12: */
+func multiplexDeviceCharacteristics(tls *libc.TLS, pConn uintptr) int32 { /* test_multiplex.c:1016:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61526,13 +66262,13 @@ func multiplexDeviceCharacteristics(tls *crt.TLS, pConn uintptr) int32 { /* test
var pSubOpen uintptr = multiplexSubOpen(tls, (*multiplexConn)(unsafe.Pointer(p)).FpGroup, 0, bp /* &rc */, uintptr(0), 0)
if pSubOpen != 0 {
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, pSubOpen)
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, pSubOpen)
}
return 0
}
// Pass xShmMap requests through to the original VFS unchanged.
-func multiplexShmMap(tls *crt.TLS, pConn uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) int32 { /* test_multiplex.c:1028:12: */
+func multiplexShmMap(tls *libc.TLS, pConn uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) int32 { /* test_multiplex.c:1028:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61541,13 +66277,13 @@ func multiplexShmMap(tls *crt.TLS, pConn uintptr, iRegion int32, szRegion int32,
var pSubOpen uintptr = multiplexSubOpen(tls, (*multiplexConn)(unsafe.Pointer(p)).FpGroup, 0, bp /* &rc */, uintptr(0), 0)
if pSubOpen != 0 {
- return (*(*func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 104 /* &.xShmMap */))))(tls, pSubOpen, iRegion, szRegion, bExtend, pp)
+ return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 104 /* &.xShmMap */))))(tls, pSubOpen, iRegion, szRegion, bExtend, pp)
}
return 10
}
// Pass xShmLock requests through to the original VFS unchanged.
-func multiplexShmLock(tls *crt.TLS, pConn uintptr, ofst int32, n int32, flags int32) int32 { /* test_multiplex.c:1046:12: */
+func multiplexShmLock(tls *libc.TLS, pConn uintptr, ofst int32, n int32, flags int32) int32 { /* test_multiplex.c:1046:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61556,13 +66292,13 @@ func multiplexShmLock(tls *crt.TLS, pConn uintptr, ofst int32, n int32, flags in
var pSubOpen uintptr = multiplexSubOpen(tls, (*multiplexConn)(unsafe.Pointer(p)).FpGroup, 0, bp /* &rc */, uintptr(0), 0)
if pSubOpen != 0 {
- return (*(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 112 /* &.xShmLock */))))(tls, pSubOpen, ofst, n, flags)
+ return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 112 /* &.xShmLock */))))(tls, pSubOpen, ofst, n, flags)
}
return 5
}
// Pass xShmBarrier requests through to the original VFS unchanged.
-func multiplexShmBarrier(tls *crt.TLS, pConn uintptr) { /* test_multiplex.c:1063:13: */
+func multiplexShmBarrier(tls *libc.TLS, pConn uintptr) { /* test_multiplex.c:1063:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61571,12 +66307,12 @@ func multiplexShmBarrier(tls *crt.TLS, pConn uintptr) { /* test_multiplex.c:1063
var pSubOpen uintptr = multiplexSubOpen(tls, (*multiplexConn)(unsafe.Pointer(p)).FpGroup, 0, bp /* &rc */, uintptr(0), 0)
if pSubOpen != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 120 /* &.xShmBarrier */))))(tls, pSubOpen)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 120 /* &.xShmBarrier */))))(tls, pSubOpen)
}
}
// Pass xShmUnmap requests through to the original VFS unchanged.
-func multiplexShmUnmap(tls *crt.TLS, pConn uintptr, deleteFlag int32) int32 { /* test_multiplex.c:1074:12: */
+func multiplexShmUnmap(tls *libc.TLS, pConn uintptr, deleteFlag int32) int32 { /* test_multiplex.c:1074:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61585,7 +66321,7 @@ func multiplexShmUnmap(tls *crt.TLS, pConn uintptr, deleteFlag int32) int32 { /*
var pSubOpen uintptr = multiplexSubOpen(tls, (*multiplexConn)(unsafe.Pointer(p)).FpGroup, 0, bp /* &rc */, uintptr(0), 0)
if pSubOpen != 0 {
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 128 /* &.xShmUnmap */))))(tls, pSubOpen, deleteFlag)
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 128 /* &.xShmUnmap */))))(tls, pSubOpen, deleteFlag)
}
return 0
}
@@ -61601,7 +66337,7 @@ func multiplexShmUnmap(tls *crt.TLS, pConn uintptr, deleteFlag int32) int32 { /*
//
// THIS ROUTINE IS NOT THREADSAFE. Call this routine exactly once
// during start-up.
-func sqlite3_multiplex_initialize(tls *crt.TLS, zOrigVfsName uintptr, makeDefault int32) int32 { /* test_multiplex.c:1097:5: */
+func sqlite3_multiplex_initialize(tls *libc.TLS, zOrigVfsName uintptr, makeDefault int32) int32 { /* test_multiplex.c:1097:5: */
var pOrigVfs uintptr
if gMultiplex.FisInitialized != 0 {
return 21
@@ -61615,94 +66351,100 @@ func sqlite3_multiplex_initialize(tls *crt.TLS, zOrigVfsName uintptr, makeDefaul
gMultiplex.FpOrigVfs = pOrigVfs
gMultiplex.FsThisVfs = *(*sqlite3_vfs)(unsafe.Pointer(pOrigVfs))
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&gMultiplex)) + 8 /* &.sThisVfs */ + 4 /* &.szOsFile */)) += int32((uint64(unsafe.Sizeof(multiplexConn{}))))
- gMultiplex.FsThisVfs.FzName = ts + 31563 /* "multiplex" */
+ gMultiplex.FsThisVfs.FzName = ts + 33647 /* "multiplex" */
gMultiplex.FsThisVfs.FxOpen = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
}{multiplexOpen}))
gMultiplex.FsThisVfs.FxDelete = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, uintptr, int32) int32
}{multiplexDelete}))
gMultiplex.FsThisVfs.FxAccess = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{multiplexAccess}))
gMultiplex.FsThisVfs.FxFullPathname = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{multiplexFullPathname}))
gMultiplex.FsThisVfs.FxDlOpen = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) uintptr
+ f func(*libc.TLS, uintptr, uintptr) uintptr
}{multiplexDlOpen}))
gMultiplex.FsThisVfs.FxDlError = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{multiplexDlError}))
gMultiplex.FsThisVfs.FxDlSym = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr) uintptr
+ f func(*libc.TLS, uintptr, uintptr, uintptr) uintptr
}{multiplexDlSym}))
gMultiplex.FsThisVfs.FxDlClose = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{multiplexDlClose}))
gMultiplex.FsThisVfs.FxRandomness = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr) int32
}{multiplexRandomness}))
gMultiplex.FsThisVfs.FxSleep = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{multiplexSleep}))
gMultiplex.FsThisVfs.FxCurrentTime = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{multiplexCurrentTime}))
gMultiplex.FsThisVfs.FxGetLastError = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr) int32
}{multiplexGetLastError}))
gMultiplex.FsThisVfs.FxCurrentTimeInt64 = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{multiplexCurrentTimeInt64}))
gMultiplex.FsIoMethodsV1.FiVersion = 1
- gMultiplex.FsIoMethodsV1.FxClose = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{multiplexClose}))
+ gMultiplex.FsIoMethodsV1.FxClose = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{multiplexClose}))
gMultiplex.FsIoMethodsV1.FxRead = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32
+ f func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32
}{multiplexRead}))
gMultiplex.FsIoMethodsV1.FxWrite = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32
+ f func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32
}{multiplexWrite}))
gMultiplex.FsIoMethodsV1.FxTruncate = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, sqlite3_int64) int32
+ f func(*libc.TLS, uintptr, sqlite3_int64) int32
}{multiplexTruncate}))
gMultiplex.FsIoMethodsV1.FxSync = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{multiplexSync}))
gMultiplex.FsIoMethodsV1.FxFileSize = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{multiplexFileSize}))
gMultiplex.FsIoMethodsV1.FxLock = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{multiplexLock}))
gMultiplex.FsIoMethodsV1.FxUnlock = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{multiplexUnlock}))
gMultiplex.FsIoMethodsV1.FxCheckReservedLock = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{multiplexCheckReservedLock}))
gMultiplex.FsIoMethodsV1.FxFileControl = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr) int32
}{multiplexFileControl}))
- gMultiplex.FsIoMethodsV1.FxSectorSize = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{multiplexSectorSize}))
- gMultiplex.FsIoMethodsV1.FxDeviceCharacteristics = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{multiplexDeviceCharacteristics}))
+ gMultiplex.FsIoMethodsV1.FxSectorSize = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{multiplexSectorSize}))
+ gMultiplex.FsIoMethodsV1.FxDeviceCharacteristics = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{multiplexDeviceCharacteristics}))
gMultiplex.FsIoMethodsV2 = gMultiplex.FsIoMethodsV1
gMultiplex.FsIoMethodsV2.FiVersion = 2
gMultiplex.FsIoMethodsV2.FxShmMap = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32
}{multiplexShmMap}))
gMultiplex.FsIoMethodsV2.FxShmLock = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, int32, int32) int32
+ f func(*libc.TLS, uintptr, int32, int32, int32) int32
}{multiplexShmLock}))
- gMultiplex.FsIoMethodsV2.FxShmBarrier = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{multiplexShmBarrier}))
+ gMultiplex.FsIoMethodsV2.FxShmBarrier = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{multiplexShmBarrier}))
gMultiplex.FsIoMethodsV2.FxShmUnmap = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{multiplexShmUnmap}))
sqlite3.Xsqlite3_vfs_register(tls, (uintptr(unsafe.Pointer(&gMultiplex)) + 8 /* &.sThisVfs */), makeDefault)
sqlite3.Xsqlite3_auto_extension(tls, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr) int32
}{multiplexFuncInit})))
return 0
@@ -61715,19 +66457,19 @@ func sqlite3_multiplex_initialize(tls *crt.TLS, zOrigVfsName uintptr, makeDefaul
//
// THIS ROUTINE IS NOT THREADSAFE. Call this routine exactly once while
// shutting down in order to free all remaining multiplex groups.
-func sqlite3_multiplex_shutdown(tls *crt.TLS, eForce int32) int32 { /* test_multiplex.c:1158:5: */
+func sqlite3_multiplex_shutdown(tls *libc.TLS, eForce int32) int32 { /* test_multiplex.c:1158:5: */
var rc int32 = 0
if gMultiplex.FisInitialized == 0 {
return 21
}
gMultiplex.FisInitialized = 0
sqlite3.Xsqlite3_vfs_unregister(tls, (uintptr(unsafe.Pointer(&gMultiplex)) + 8 /* &.sThisVfs */))
- crt.Xmemset(tls, uintptr(unsafe.Pointer(&gMultiplex)), 0, uint64(unsafe.Sizeof(gMultiplex)))
+ libc.Xmemset(tls, uintptr(unsafe.Pointer(&gMultiplex)), 0, uint64(unsafe.Sizeof(gMultiplex)))
return rc
}
// tclcmd: sqlite3_multiplex_initialize NAME MAKEDEFAULT
-func test_multiplex_initialize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_multiplex.c:1183:26: */
+func test_multiplex_initialize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_multiplex.c:1183:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -61740,7 +66482,7 @@ func test_multiplex_initialize(tls *crt.TLS, clientData uintptr, interp uintptr,
// Process arguments
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31573 /* "NAME MAKEDEFAULT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+33657 /* "NAME MAKEDEFAULT" */)
return 1
}
zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -61759,28 +66501,28 @@ func test_multiplex_initialize(tls *crt.TLS, clientData uintptr, interp uintptr,
}
// tclcmd: sqlite3_multiplex_shutdown
-func test_multiplex_shutdown(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_multiplex.c:1214:26: */
+func test_multiplex_shutdown(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_multiplex.c:1214:26: */
var rc int32 // Value returned by multiplex_shutdown()
_ = clientData
- if (objc == 2) && (crt.Xstrcmp(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), ts+31590 /* "-force" */) != 0) {
+ if (objc == 2) && (libc.Xstrcmp(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), ts+33674 /* "-force" */) != 0) {
objc = 3
}
if (objc != 1) && (objc != 2) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31597 /* "?-force?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+33681 /* "?-force?" */)
return 1
}
// Call sqlite3_multiplex_shutdown()
- rc = sqlite3_multiplex_shutdown(tls, (crt.Bool32(objc == 2)))
+ rc = sqlite3_multiplex_shutdown(tls, (libc.Bool32(objc == 2)))
tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0))
return 0
}
// Tclcmd: test_multiplex_control HANDLE DBNAME SUB-COMMAND ?INT-VALUE?
-func test_multiplex_control(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_multiplex.c:1242:26: */
+func test_multiplex_control(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_multiplex.c:1242:26: */
bp := tls.Alloc(176)
defer tls.Free(176)
@@ -61802,20 +66544,20 @@ func test_multiplex_control(tls *crt.TLS, cd ClientData, interp uintptr, objc in
Fop int32
Fargtype int32
}{
- {FzName: ts + 31606 /* "enable" */, Fop: 214014, Fargtype: 1},
- {FzName: ts + 31613 /* "chunk_size" */, Fop: 214015, Fargtype: 1},
- {FzName: ts + 31624 /* "max_chunks" */, Fop: 214016, Fargtype: 1},
+ {FzName: ts + 33690 /* "enable" */, Fop: 214014, Fargtype: 1},
+ {FzName: ts + 33697 /* "chunk_size" */, Fop: 214015, Fargtype: 1},
+ {FzName: ts + 33708 /* "max_chunks" */, Fop: 214016, Fargtype: 1},
{FzName: uintptr(0), Fop: 0, Fargtype: 0},
}
if objc != 5 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31635 /* "HANDLE DBNAME SU..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+33719 /* "HANDLE DBNAME SU..." */)
return 1
}
if 0 == tcl.XTcl_GetCommandInfo(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+40 /* &cmdInfo */) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+31671 /* "expected databas..." */, 0))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+16, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), ts+9801 /* "\"" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+33755 /* "expected databas..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), ts+11456 /* "\"" */, 0))
return 1
} else {
db = *(*uintptr)(unsafe.Pointer((*Tcl_CmdInfo)(unsafe.Pointer(bp + 40 /* &cmdInfo */)).FobjClientData))
@@ -61843,7 +66585,7 @@ func test_multiplex_control(tls *crt.TLS, cd ClientData, interp uintptr, objc in
pArg = bp + 172 /* &iValue */
break
default:
- tcl.XTcl_WrongNumArgs(tls, interp, 4, objv, ts+31703 /* "SUB-COMMAND" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 4, objv, ts+2383 /* "SUB-COMMAND" */)
return 1
}
@@ -61862,26 +66604,26 @@ func test_multiplex_control(tls *crt.TLS, cd ClientData, interp uintptr, objc in
// This routine registers the custom TCL commands defined in this
// module. This should be the only procedure visible from outside
// of this module.
-func Sqlitemultiplex_Init(tls *crt.TLS, interp uintptr) int32 { /* test_multiplex.c:1306:5: */
+func Sqlitemultiplex_Init(tls *libc.TLS, interp uintptr) int32 { /* test_multiplex.c:1306:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd6)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd7)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aCmd6[i].FzName, aCmd6[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aCmd7[i].FzName, aCmd7[i].FxProc, uintptr(0), uintptr(0))
}
return 0
}
-var aCmd6 = [3]struct {
+var aCmd7 = [3]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 31715 /* "sqlite3_multiple..." */, FxProc: 0},
- {FzName: ts + 31744 /* "sqlite3_multiple..." */, FxProc: 0},
- {FzName: ts + 31771 /* "sqlite3_multiple..." */, FxProc: 0},
+ {FzName: ts + 33787 /* "sqlite3_multiple..." */, FxProc: 0},
+ {FzName: ts + 33816 /* "sqlite3_multiple..." */, FxProc: 0},
+ {FzName: ts + 33843 /* "sqlite3_multiple..." */, FxProc: 0},
} /* test_multiplex.c:1310:5 */
// CAPI3REF: Standard File Control Opcodes
@@ -61950,7 +66692,7 @@ var aCmd6 = [3]struct {
// of the xSync method. In most cases, the pointer argument passed with
// this file-control is NULL. However, if the database file is being synced
// as part of a multi-database commit, the argument points to a nul-terminated
-// string containing the transactions master-journal file name. VFSes that
+// string containing the transactions super-journal file name. VFSes that
// do not need this signal should silently ignore this opcode. Applications
// should not call [sqlite3_file_control()] with this opcode as doing so may
// disrupt the operation of the specialized VFSes that do require it.
@@ -62215,13 +66957,13 @@ var aCmd6 = [3]struct {
// deals with pointers to the [sqlite3_mutex] object.
//
// Mutexes are created using [sqlite3_mutex_alloc()].
-type sqlite3_mutex = sqlite3_mutex1 /* sqlite3.h:1183:30 */
+type sqlite3_mutex = sqlite3_mutex1 /* sqlite3.h:1186:30 */
var aName = [15]uintptr{
- ts + 31797 /* "fast" */, ts + 31802 /* "recursive" */, ts + 31812 /* "static_master" */, ts + 31826, /* "static_mem" */
- ts + 31837 /* "static_open" */, ts + 31849 /* "static_prng" */, ts + 31861 /* "static_lru" */, ts + 31872, /* "static_pmem" */
- ts + 31884 /* "static_app1" */, ts + 31896 /* "static_app2" */, ts + 31908 /* "static_app3" */, ts + 31920, /* "static_vfs1" */
- ts + 31932 /* "static_vfs2" */, ts + 31944 /* "static_vfs3" */, uintptr(0),
+ ts + 33869 /* "fast" */, ts + 33874 /* "recursive" */, ts + 33884 /* "static_main" */, ts + 33896, /* "static_mem" */
+ ts + 33907 /* "static_open" */, ts + 33919 /* "static_prng" */, ts + 33931 /* "static_lru" */, ts + 33942, /* "static_pmem" */
+ ts + 33954 /* "static_app1" */, ts + 33966 /* "static_app2" */, ts + 33978 /* "static_app3" */, ts + 33990, /* "static_vfs1" */
+ ts + 34002 /* "static_vfs2" */, ts + 34014 /* "static_vfs3" */, uintptr(0),
} /* test_mutex.c:32:19 */
// State variables
@@ -62239,47 +66981,47 @@ type test_mutex_globals = struct {
var g3 = test_mutex_globals{FisInstalled: 0} /* test_mutex.c:54:3 */
// Return true if the countable mutex is currently held
-func counterMutexHeld(tls *crt.TLS, p uintptr) int32 { /* test_mutex.c:57:12: */
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 56 /* &.xMutexHeld */))))(tls, (*sqlite3_mutex)(unsafe.Pointer(p)).FpReal)
+func counterMutexHeld(tls *libc.TLS, p uintptr) int32 { /* test_mutex.c:57:12: */
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 56 /* &.xMutexHeld */))))(tls, (*sqlite3_mutex)(unsafe.Pointer(p)).FpReal)
}
// Return true if the countable mutex is not currently held
-func counterMutexNotheld(tls *crt.TLS, p uintptr) int32 { /* test_mutex.c:62:12: */
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 64 /* &.xMutexNotheld */))))(tls, (*sqlite3_mutex)(unsafe.Pointer(p)).FpReal)
+func counterMutexNotheld(tls *libc.TLS, p uintptr) int32 { /* test_mutex.c:62:12: */
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 64 /* &.xMutexNotheld */))))(tls, (*sqlite3_mutex)(unsafe.Pointer(p)).FpReal)
}
// Initialize the countable mutex interface
// Or, if g.disableInit is non-zero, then do not initialize but instead
// return the value of g.disableInit as the result code. This can be used
// to simulate an initialization failure.
-func counterMutexInit(tls *crt.TLS) int32 { /* test_mutex.c:71:12: */
+func counterMutexInit(tls *libc.TLS) int32 { /* test_mutex.c:71:12: */
var rc int32
if g3.FdisableInit != 0 {
return g3.FdisableInit
}
- rc = (*(*func(*crt.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ /* &.xMutexInit */))))(tls)
+ rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ /* &.xMutexInit */))))(tls)
g3.FisInit = 1
return rc
}
// Uninitialize the mutex subsystem
-func counterMutexEnd(tls *crt.TLS) int32 { /* test_mutex.c:82:12: */
+func counterMutexEnd(tls *libc.TLS) int32 { /* test_mutex.c:82:12: */
g3.FisInit = 0
- return (*(*func(*crt.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 8 /* &.xMutexEnd */))))(tls)
+ return (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 8 /* &.xMutexEnd */))))(tls)
}
// Allocate a countable mutex
-func counterMutexAlloc(tls *crt.TLS, eType int32) uintptr { /* test_mutex.c:90:22: */
+func counterMutexAlloc(tls *libc.TLS, eType int32) uintptr { /* test_mutex.c:90:22: */
var pReal uintptr
var pRet uintptr = uintptr(0)
- pReal = (*(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 16 /* &.xMutexAlloc */))))(tls, eType)
+ pReal = (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 16 /* &.xMutexAlloc */))))(tls, eType)
if !(pReal != 0) {
return uintptr(0)
}
if (eType == 0) || (eType == 1) {
- pRet = crt.Xmalloc(tls, uint64(unsafe.Sizeof(sqlite3_mutex{})))
+ pRet = libc.Xmalloc(tls, uint64(unsafe.Sizeof(sqlite3_mutex{})))
} else {
var eStaticType int32 = (eType - ((13 + 1) - ((13 + 1) - (1 + 1))))
@@ -62292,39 +67034,39 @@ func counterMutexAlloc(tls *crt.TLS, eType int32) uintptr { /* test_mutex.c:90:2
}
// Free a countable mutex
-func counterMutexFree(tls *crt.TLS, p uintptr) { /* test_mutex.c:118:13: */
+func counterMutexFree(tls *libc.TLS, p uintptr) { /* test_mutex.c:118:13: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 24 /* &.xMutexFree */))))(tls, (*sqlite3_mutex)(unsafe.Pointer(p)).FpReal)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 24 /* &.xMutexFree */))))(tls, (*sqlite3_mutex)(unsafe.Pointer(p)).FpReal)
if ((*sqlite3_mutex)(unsafe.Pointer(p)).FeType == 0) || ((*sqlite3_mutex)(unsafe.Pointer(p)).FeType == 1) {
- crt.Xfree(tls, p)
+ libc.Xfree(tls, p)
}
}
// Enter a countable mutex. Block until entry is safe.
-func counterMutexEnter(tls *crt.TLS, p uintptr) { /* test_mutex.c:129:13: */
+func counterMutexEnter(tls *libc.TLS, p uintptr) { /* test_mutex.c:129:13: */
*(*int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 88 /* &.aCounter */) + uintptr((*sqlite3_mutex)(unsafe.Pointer(p)).FeType)*4))++
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 32 /* &.xMutexEnter */))))(tls, (*sqlite3_mutex)(unsafe.Pointer(p)).FpReal)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 32 /* &.xMutexEnter */))))(tls, (*sqlite3_mutex)(unsafe.Pointer(p)).FpReal)
}
// Try to enter a mutex. Return true on success.
-func counterMutexTry(tls *crt.TLS, p uintptr) int32 { /* test_mutex.c:140:12: */
+func counterMutexTry(tls *libc.TLS, p uintptr) int32 { /* test_mutex.c:140:12: */
*(*int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 88 /* &.aCounter */) + uintptr((*sqlite3_mutex)(unsafe.Pointer(p)).FeType)*4))++
if g3.FdisableTry != 0 {
return 5
}
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 40 /* &.xMutexTry */))))(tls, (*sqlite3_mutex)(unsafe.Pointer(p)).FpReal)
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 40 /* &.xMutexTry */))))(tls, (*sqlite3_mutex)(unsafe.Pointer(p)).FpReal)
}
// Leave a mutex
-func counterMutexLeave(tls *crt.TLS, p uintptr) { /* test_mutex.c:151:13: */
+func counterMutexLeave(tls *libc.TLS, p uintptr) { /* test_mutex.c:151:13: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 48 /* &.xMutexLeave */))))(tls, (*sqlite3_mutex)(unsafe.Pointer(p)).FpReal)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */ + 48 /* &.xMutexLeave */))))(tls, (*sqlite3_mutex)(unsafe.Pointer(p)).FpReal)
}
// sqlite3_shutdown
-func test_shutdown(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:159:26: */
+func test_shutdown(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:159:26: */
var rc int32
if objc != 1 {
@@ -62338,7 +67080,7 @@ func test_shutdown(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
}
// sqlite3_initialize
-func test_initialize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:180:26: */
+func test_initialize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:180:26: */
var rc int32
if objc != 1 {
@@ -62352,17 +67094,26 @@ func test_initialize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
}
// install_mutex_counters BOOLEAN
-func test_install_mutex_counters(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:201:26: */
+func test_install_mutex_counters(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:201:26: */
bp := tls.Alloc(136)
defer tls.Free(136)
var rc int32 = 0
// var isInstall int32 at bp+56, 4
- *(*sqlite3_mutex_methods)(unsafe.Pointer(bp + 64 /* counter_methods */)) = sqlite3_mutex_methods{FxMutexInit: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) int32 }{counterMutexInit})), FxMutexEnd: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) int32 }{counterMutexEnd})), FxMutexAlloc: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, int32) uintptr }{counterMutexAlloc})), FxMutexFree: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{counterMutexFree})), FxMutexEnter: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{counterMutexEnter})), FxMutexTry: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{counterMutexTry})), FxMutexLeave: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{counterMutexLeave})), FxMutexHeld: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{counterMutexHeld})), FxMutexNotheld: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{counterMutexNotheld}))}
+ *(*sqlite3_mutex_methods)(unsafe.Pointer(bp + 64 /* counter_methods */)) = sqlite3_mutex_methods{FxMutexInit: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{counterMutexInit})), FxMutexEnd: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{counterMutexEnd})), FxMutexAlloc: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, int32) uintptr
+ }{counterMutexAlloc})), FxMutexFree: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{counterMutexFree})), FxMutexEnter: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{counterMutexEnter})), FxMutexTry: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{counterMutexTry})), FxMutexLeave: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{counterMutexLeave})), FxMutexHeld: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{counterMutexHeld})), FxMutexNotheld: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{counterMutexNotheld})),
+ }
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29939 /* "BOOLEAN" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+17539 /* "BOOLEAN" */)
return 1
}
if 0 != tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+56 /* &isInstall */) {
@@ -62370,27 +67121,27 @@ func test_install_mutex_counters(tls *crt.TLS, clientData uintptr, interp uintpt
}
if *(*int32)(unsafe.Pointer(bp + 56 /* isInstall */)) == g3.FisInstalled {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+31956 /* "mutex counters a..." */, 0))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+16, func() uintptr {
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+34026 /* "mutex counters a..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, func() uintptr {
if *(*int32)(unsafe.Pointer(bp + 56 /* isInstall */)) != 0 {
- return ts + 31976 /* "already installe..." */
+ return ts + 34046 /* "already installe..." */
}
- return ts + 31994 /* "not installed" */
+ return ts + 34064 /* "not installed" */
}(), 0))
return 1
}
if *(*int32)(unsafe.Pointer(bp + 56 /* isInstall */)) != 0 {
- rc = sqlite3.Xsqlite3_config(tls, 11, crt.VaList(bp+32, (uintptr(unsafe.Pointer(&g3))+16 /* &.m */)))
+ rc = sqlite3.Xsqlite3_config(tls, 11, libc.VaList(bp+32, (uintptr(unsafe.Pointer(&g3))+16 /* &.m */)))
if rc == 0 {
- sqlite3.Xsqlite3_config(tls, 10, crt.VaList(bp+40, bp+64 /* &counter_methods */))
+ sqlite3.Xsqlite3_config(tls, 10, libc.VaList(bp+40, bp+64 /* &counter_methods */))
}
g3.FdisableTry = 0
} else {
- rc = sqlite3.Xsqlite3_config(tls, 10, crt.VaList(bp+48, (uintptr(unsafe.Pointer(&g3))+16 /* &.m */)))
- crt.Xmemset(tls, (uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */), 0, uint64(unsafe.Sizeof(sqlite3_mutex_methods{})))
+ rc = sqlite3.Xsqlite3_config(tls, 10, libc.VaList(bp+48, (uintptr(unsafe.Pointer(&g3))+16 /* &.m */)))
+ libc.Xmemset(tls, (uintptr(unsafe.Pointer(&g3)) + 16 /* &.m */), 0, uint64(unsafe.Sizeof(sqlite3_mutex_methods{})))
}
if rc == 0 {
@@ -62402,7 +67153,7 @@ func test_install_mutex_counters(tls *crt.TLS, clientData uintptr, interp uintpt
}
// read_mutex_counters
-func test_read_mutex_counters(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:262:26: */
+func test_read_mutex_counters(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:262:26: */
var pRet uintptr
var ii int32
@@ -62420,7 +67171,7 @@ func test_read_mutex_counters(tls *crt.TLS, clientData uintptr, interp uintptr,
tcl.XTcl_SetObjResult(tls, interp, pRet)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pRet
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -62429,7 +67180,7 @@ func test_read_mutex_counters(tls *crt.TLS, clientData uintptr, interp uintptr,
}
// clear_mutex_counters
-func test_clear_mutex_counters(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:291:26: */
+func test_clear_mutex_counters(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:291:26: */
var ii int32
if objc != 1 {
@@ -62446,7 +67197,7 @@ func test_clear_mutex_counters(tls *crt.TLS, clientData uintptr, interp uintptr,
// Create and free a mutex. Return the mutex pointer. The pointer
// will be invalid since the mutex has already been freed. The
// return pointer just checks to see if the mutex really was allocated.
-func test_alloc_mutex(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:315:26: */
+func test_alloc_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:315:26: */
bp := tls.Alloc(124)
defer tls.Free(124)
@@ -62454,8 +67205,8 @@ func test_alloc_mutex(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
// var zBuf [100]int8 at bp+24, 100
sqlite3.Xsqlite3_mutex_free(tls, p)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+24 /* &zBuf[0] */, ts+11197 /* "%p" */, crt.VaList(bp, p))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+8, bp+24 /* &zBuf[0] */, uintptr(0)))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+24 /* &zBuf[0] */, ts+12843 /* "%p" */, libc.VaList(bp, p))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+8, bp+24 /* &zBuf[0] */, uintptr(0)))
return 0
}
@@ -62468,14 +67219,14 @@ func test_alloc_mutex(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
// SQLITE_CONFIG_SERIALIZED
//
// Or OPTION can be an raw integer.
-func test_config(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:342:26: */
+func test_config(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:342:26: */
bp := tls.Alloc(68)
defer tls.Free(68)
*(*[4]ConfigOption)(unsafe.Pointer(bp /* aOpt */)) = [4]ConfigOption{
- {FzName: ts + 32008 /* "singlethread" */, FiValue: 1},
- {FzName: ts + 32021 /* "multithread" */, FiValue: 2},
- {FzName: ts + 32033 /* "serialized" */, FiValue: 3},
+ {FzName: ts + 34078 /* "singlethread" */, FiValue: 1},
+ {FzName: ts + 34091 /* "multithread" */, FiValue: 2},
+ {FzName: ts + 34103 /* "serialized" */, FiValue: 3},
{FzName: uintptr(0), FiValue: 0},
}
var s int32 = int32(unsafe.Sizeof(ConfigOption{}))
@@ -62488,7 +67239,7 @@ func test_config(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
return 1
}
- if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &aOpt[0] */, s, ts+15142 /* "flag" */, 0, bp+64 /* &i */) != 0 {
+ if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp /* &aOpt[0] */, s, ts+16852 /* "flag" */, 0, bp+64 /* &i */) != 0 {
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+64 /* &i */) != 0 {
return 1
}
@@ -62507,7 +67258,7 @@ type ConfigOption = struct {
_ [4]byte
}
-func getDbPointer1(tls *crt.TLS, pInterp uintptr, pObj uintptr) uintptr { /* test_mutex.c:379:16: */
+func getDbPointer1(tls *libc.TLS, pInterp uintptr, pObj uintptr) uintptr { /* test_mutex.c:379:16: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -62524,23 +67275,23 @@ func getDbPointer1(tls *crt.TLS, pInterp uintptr, pObj uintptr) uintptr { /* tes
return db
}
-func getStaticMutexPointer(tls *crt.TLS, pInterp uintptr, pObj uintptr) uintptr { /* test_mutex.c:392:22: */
+func getStaticMutexPointer(tls *libc.TLS, pInterp uintptr, pObj uintptr) uintptr { /* test_mutex.c:392:22: */
bp := tls.Alloc(4)
defer tls.Free(4)
// var iMutex int32 at bp, 4
- if tcl.XTcl_GetIndexFromObjStruct(tls, pInterp, pObj, uintptr(unsafe.Pointer(&aName)), int32(unsafe.Sizeof(uintptr(0))), ts+32044 /* "mutex name" */, 0, bp /* &iMutex */) != 0 {
+ if tcl.XTcl_GetIndexFromObjStruct(tls, pInterp, pObj, uintptr(unsafe.Pointer(&aName)), int32(unsafe.Sizeof(uintptr(0))), ts+34114 /* "mutex name" */, 0, bp /* &iMutex */) != 0 {
return uintptr(0)
}
return counterMutexAlloc(tls, *(*int32)(unsafe.Pointer(bp /* iMutex */)))
}
-func test_enter_static_mutex(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:404:26: */
+func test_enter_static_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:404:26: */
var pMutex uintptr
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32055 /* "NAME" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10219 /* "NAME" */)
return 1
}
pMutex = getStaticMutexPointer(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -62551,10 +67302,10 @@ func test_enter_static_mutex(tls *crt.TLS, clientData uintptr, interp uintptr, o
return 0
}
-func test_leave_static_mutex(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:423:26: */
+func test_leave_static_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:423:26: */
var pMutex uintptr
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32055 /* "NAME" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+10219 /* "NAME" */)
return 1
}
pMutex = getStaticMutexPointer(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -62565,7 +67316,7 @@ func test_leave_static_mutex(tls *crt.TLS, clientData uintptr, interp uintptr, o
return 0
}
-func test_enter_db_mutex(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:442:26: */
+func test_enter_db_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:442:26: */
var db uintptr
if objc != 2 {
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */)
@@ -62579,7 +67330,7 @@ func test_enter_db_mutex(tls *crt.TLS, clientData uintptr, interp uintptr, objc
return 0
}
-func test_leave_db_mutex(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:461:26: */
+func test_leave_db_mutex(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_mutex.c:461:26: */
var db uintptr
if objc != 2 {
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */)
@@ -62593,40 +67344,40 @@ func test_leave_db_mutex(tls *crt.TLS, clientData uintptr, interp uintptr, objc
return 0
}
-func Sqlitetest_mutex_Init(tls *crt.TLS, interp uintptr) int32 { /* test_mutex.c:480:5: */
+func Sqlitetest_mutex_Init(tls *libc.TLS, interp uintptr) int32 { /* test_mutex.c:480:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd7)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd8)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aCmd7[i].FzName, aCmd7[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aCmd8[i].FzName, aCmd8[i].FxProc, uintptr(0), uintptr(0))
}
- tcl.XTcl_LinkVar(tls, interp, ts+32060, /* "disable_mutex_in..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+34125, /* "disable_mutex_in..." */
(uintptr(unsafe.Pointer(&g3)) + 4 /* &.disableInit */), 1)
- tcl.XTcl_LinkVar(tls, interp, ts+32079, /* "disable_mutex_tr..." */
+ tcl.XTcl_LinkVar(tls, interp, ts+34144, /* "disable_mutex_tr..." */
(uintptr(unsafe.Pointer(&g3)) + 8 /* &.disableTry */), 1)
return 0
}
-var aCmd7 = [11]struct {
+var aCmd8 = [11]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 32097 /* "sqlite3_shutdown" */, FxProc: 0},
- {FzName: ts + 32114 /* "sqlite3_initiali..." */, FxProc: 0},
- {FzName: ts + 32133 /* "sqlite3_config" */, FxProc: 0},
+ {FzName: ts + 34162 /* "sqlite3_shutdown" */, FxProc: 0},
+ {FzName: ts + 34179 /* "sqlite3_initiali..." */, FxProc: 0},
+ {FzName: ts + 34198 /* "sqlite3_config" */, FxProc: 0},
- {FzName: ts + 32148 /* "enter_static_mut..." */, FxProc: 0},
- {FzName: ts + 32167 /* "leave_static_mut..." */, FxProc: 0},
+ {FzName: ts + 34213 /* "enter_static_mut..." */, FxProc: 0},
+ {FzName: ts + 34232 /* "leave_static_mut..." */, FxProc: 0},
- {FzName: ts + 32186 /* "enter_db_mutex" */, FxProc: 0},
- {FzName: ts + 32201 /* "leave_db_mutex" */, FxProc: 0},
+ {FzName: ts + 34251 /* "enter_db_mutex" */, FxProc: 0},
+ {FzName: ts + 34266 /* "leave_db_mutex" */, FxProc: 0},
- {FzName: ts + 32216 /* "alloc_dealloc_mu..." */, FxProc: 0},
- {FzName: ts + 32236 /* "install_mutex_co..." */, FxProc: 0},
- {FzName: ts + 32259 /* "read_mutex_count..." */, FxProc: 0},
- {FzName: ts + 32279 /* "clear_mutex_coun..." */, FxProc: 0},
+ {FzName: ts + 34281 /* "alloc_dealloc_mu..." */, FxProc: 0},
+ {FzName: ts + 34301 /* "install_mutex_co..." */, FxProc: 0},
+ {FzName: ts + 34324 /* "read_mutex_count..." */, FxProc: 0},
+ {FzName: ts + 34344 /* "clear_mutex_coun..." */, FxProc: 0},
} /* test_mutex.c:484:5 */
// Maximum pathname length supported by the fs backend.
@@ -62679,7 +67430,7 @@ var fs_vfs = fs_vfs_t{Fbase: sqlite3_vfs{FiVersion: 1, FszOsFile: // iVersion
0, FmxPathname:// szOsFile
0, FpNext:// mxPathname
uintptr(0), FzName:// pNext
-ts + 27869, /* "fs" */ FpAppData:// zName
+ts + 29961, /* "fs" */ FpAppData:// zName
uintptr(0), FxOpen:// pAppData
0, FxDelete:// xOpen
0, FxAccess:// xDelete
@@ -62738,24 +67489,24 @@ uintptr(0), // xShmUnmap
// Useful macros used in several places
// Close a tmp-file.
-func tmpClose(tls *crt.TLS, pFile uintptr) int32 { /* test_onefile.c:257:12: */
+func tmpClose(tls *libc.TLS, pFile uintptr) int32 { /* test_onefile.c:257:12: */
var pTmp uintptr = pFile
sqlite3.Xsqlite3_free(tls, (*tmp_file)(unsafe.Pointer(pTmp)).FzAlloc)
return 0
}
// Read data from a tmp-file.
-func tmpRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_onefile.c:266:12: */
+func tmpRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_onefile.c:266:12: */
var pTmp uintptr = pFile
if (sqlite_int64(iAmt) + iOfst) > sqlite_int64((*tmp_file)(unsafe.Pointer(pTmp)).FnSize) {
return (10 | (int32(2) << 8))
}
- crt.Xmemcpy(tls, zBuf, ((*tmp_file)(unsafe.Pointer(pTmp)).FzAlloc + uintptr(iOfst)), uint64(iAmt))
+ libc.Xmemcpy(tls, zBuf, ((*tmp_file)(unsafe.Pointer(pTmp)).FzAlloc + uintptr(iOfst)), uint64(iAmt))
return 0
}
// Write data to a tmp-file.
-func tmpWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_onefile.c:283:12: */
+func tmpWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_onefile.c:283:12: */
var pTmp uintptr = pFile
if (sqlite_int64(iAmt) + iOfst) > sqlite_int64((*tmp_file)(unsafe.Pointer(pTmp)).FnAlloc) {
var nNew int32 = (int32(int64(2) * ((sqlite_int64(iAmt) + iOfst) + sqlite_int64((*tmp_file)(unsafe.Pointer(pTmp)).FnAlloc))))
@@ -62766,7 +67517,7 @@ func tmpWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlit
(*tmp_file)(unsafe.Pointer(pTmp)).FzAlloc = zNew
(*tmp_file)(unsafe.Pointer(pTmp)).FnAlloc = nNew
}
- crt.Xmemcpy(tls, ((*tmp_file)(unsafe.Pointer(pTmp)).FzAlloc + uintptr(iOfst)), zBuf, uint64(iAmt))
+ libc.Xmemcpy(tls, ((*tmp_file)(unsafe.Pointer(pTmp)).FzAlloc + uintptr(iOfst)), zBuf, uint64(iAmt))
(*tmp_file)(unsafe.Pointer(pTmp)).FnSize = func() int32 {
if (sqlite_int64((*tmp_file)(unsafe.Pointer(pTmp)).FnSize)) > (iOfst + sqlite_int64(iAmt)) {
return (*tmp_file)(unsafe.Pointer(pTmp)).FnSize
@@ -62777,7 +67528,7 @@ func tmpWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlit
}
// Truncate a tmp-file.
-func tmpTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_onefile.c:307:12: */
+func tmpTruncate(tls *libc.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_onefile.c:307:12: */
var pTmp uintptr = pFile
(*tmp_file)(unsafe.Pointer(pTmp)).FnSize = func() int32 {
if (sqlite_int64((*tmp_file)(unsafe.Pointer(pTmp)).FnSize)) < (size) {
@@ -62789,50 +67540,50 @@ func tmpTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* test
}
// Sync a tmp-file.
-func tmpSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_onefile.c:316:12: */
+func tmpSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* test_onefile.c:316:12: */
return 0
}
// Return the current file-size of a tmp-file.
-func tmpFileSize(tls *crt.TLS, pFile uintptr, pSize uintptr) int32 { /* test_onefile.c:323:12: */
+func tmpFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* test_onefile.c:323:12: */
var pTmp uintptr = pFile
*(*sqlite_int64)(unsafe.Pointer(pSize)) = sqlite_int64((*tmp_file)(unsafe.Pointer(pTmp)).FnSize)
return 0
}
// Lock a tmp-file.
-func tmpLock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_onefile.c:332:12: */
+func tmpLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_onefile.c:332:12: */
return 0
}
// Unlock a tmp-file.
-func tmpUnlock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_onefile.c:339:12: */
+func tmpUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_onefile.c:339:12: */
return 0
}
// Check if another file-handle holds a RESERVED lock on a tmp-file.
-func tmpCheckReservedLock(tls *crt.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_onefile.c:346:12: */
+func tmpCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_onefile.c:346:12: */
*(*int32)(unsafe.Pointer(pResOut)) = 0
return 0
}
// File control method. For custom operations on a tmp-file.
-func tmpFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_onefile.c:354:12: */
+func tmpFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_onefile.c:354:12: */
return 0
}
// Return the sector-size in bytes for a tmp-file.
-func tmpSectorSize(tls *crt.TLS, pFile uintptr) int32 { /* test_onefile.c:361:12: */
+func tmpSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* test_onefile.c:361:12: */
return 0
}
// Return the device characteristic flags supported by a tmp-file.
-func tmpDeviceCharacteristics(tls *crt.TLS, pFile uintptr) int32 { /* test_onefile.c:368:12: */
+func tmpDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* test_onefile.c:368:12: */
return 0
}
// Close an fs-file.
-func fsClose1(tls *crt.TLS, pFile uintptr) int32 { /* test_onefile.c:375:12: */
+func fsClose1(tls *libc.TLS, pFile uintptr) int32 { /* test_onefile.c:375:12: */
var rc int32 = 0
var p uintptr = pFile
var pReal uintptr = (*fs_file)(unsafe.Pointer(p)).FpReal
@@ -62846,7 +67597,7 @@ func fsClose1(tls *crt.TLS, pFile uintptr) int32 { /* test_onefile.c:375:12: */
if (*fs_real_file)(unsafe.Pointer(pReal)).FpNext != 0 {
(*fs_real_file)(unsafe.Pointer((*fs_real_file)(unsafe.Pointer(pReal)).FpNext)).FppThis = (*fs_real_file)(unsafe.Pointer(pReal)).FppThis
}
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*fs_real_file)(unsafe.Pointer(pReal)).FpFile)).FpMethods + 8 /* &.xClose */))))(tls, (*fs_real_file)(unsafe.Pointer(pReal)).FpFile)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*fs_real_file)(unsafe.Pointer(pReal)).FpFile)).FpMethods + 8 /* &.xClose */))))(tls, (*fs_real_file)(unsafe.Pointer(pReal)).FpFile)
sqlite3.Xsqlite3_free(tls, pReal)
}
@@ -62854,7 +67605,7 @@ func fsClose1(tls *crt.TLS, pFile uintptr) int32 { /* test_onefile.c:375:12: */
}
// Read data from an fs-file.
-func fsRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_onefile.c:400:12: */
+func fsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_onefile.c:400:12: */
var rc int32 = 0
var p uintptr = pFile
var pReal uintptr = (*fs_file)(unsafe.Pointer(p)).FpReal
@@ -62864,7 +67615,7 @@ func fsRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_
(((*fs_file)(unsafe.Pointer(p)).FeType == 2) && ((sqlite_int64(iAmt) + iOfst) > sqlite_int64((*fs_real_file)(unsafe.Pointer(pReal)).FnJournal))) {
rc = (10 | (int32(2) << 8))
} else if (*fs_file)(unsafe.Pointer(p)).FeType == 1 {
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 16 /* &.xRead */))))(tls, pF, zBuf, iAmt, (iOfst + int64(512)))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 16 /* &.xRead */))))(tls, pF, zBuf, iAmt, (iOfst + int64(512)))
} else {
// Journal file.
var iRem int32 = iAmt
@@ -62879,7 +67630,7 @@ func fsRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_
return (512 - (iRealOff % 512))
}()
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 16 /* &.xRead */))))(tls, pF, ((zBuf) + uintptr(iBuf)), iRealAmt, int64(iRealOff))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 16 /* &.xRead */))))(tls, pF, ((zBuf) + uintptr(iBuf)), iRealAmt, int64(iRealOff))
ii = ii + (iRealAmt)
iBuf = iBuf + (iRealAmt)
iRem = iRem - (iRealAmt)
@@ -62890,7 +67641,7 @@ func fsRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_
}
// Write data to an fs-file.
-func fsWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_onefile.c:439:12: */
+func fsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_onefile.c:439:12: */
var rc int32 = 0
var p uintptr = pFile
var pReal uintptr = (*fs_file)(unsafe.Pointer(p)).FpReal
@@ -62900,7 +67651,7 @@ func fsWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite
if ((sqlite_int64(iAmt) + iOfst) + int64(512)) > (sqlite_int64((*fs_real_file)(unsafe.Pointer(pReal)).FnBlob - (*fs_real_file)(unsafe.Pointer(pReal)).FnJournal)) {
rc = 13
} else {
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 24 /* &.xWrite */))))(tls, pF, zBuf, iAmt, (iOfst + int64(512)))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 24 /* &.xWrite */))))(tls, pF, zBuf, iAmt, (iOfst + int64(512)))
if rc == 0 {
(*fs_real_file)(unsafe.Pointer(pReal)).FnDatabase = func() int32 {
if (sqlite_int64((*fs_real_file)(unsafe.Pointer(pReal)).FnDatabase)) > (sqlite_int64(iAmt) + iOfst) {
@@ -62927,7 +67678,7 @@ func fsWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite
if iRealOff < ((*fs_real_file)(unsafe.Pointer(pReal)).FnDatabase + 512) {
rc = 13
} else {
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 24 /* &.xWrite */))))(tls, pF, ((zBuf) + uintptr(iBuf)), iRealAmt, int64(iRealOff))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 24 /* &.xWrite */))))(tls, pF, ((zBuf) + uintptr(iBuf)), iRealAmt, int64(iRealOff))
ii = ii + (iRealAmt)
iBuf = iBuf + (iRealAmt)
iRem = iRem - (iRealAmt)
@@ -62947,7 +67698,7 @@ func fsWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite
}
// Truncate an fs-file.
-func fsTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_onefile.c:488:12: */
+func fsTruncate(tls *libc.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_onefile.c:488:12: */
var p uintptr = pFile
var pReal uintptr = (*fs_file)(unsafe.Pointer(p)).FpReal
if (*fs_file)(unsafe.Pointer(p)).FeType == 1 {
@@ -62969,7 +67720,7 @@ func fsTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_
}
// Sync an fs-file.
-func fsSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_onefile.c:502:12: */
+func fsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* test_onefile.c:502:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -62985,17 +67736,17 @@ func fsSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_onefile.c:
*(*uint8)(unsafe.Pointer(bp /* &zSize[0] */ + uintptr(1))) = (uint8(((*fs_real_file)(unsafe.Pointer(pReal)).FnDatabase & 0x00FF0000) >> 16))
*(*uint8)(unsafe.Pointer(bp /* &zSize[0] */ + uintptr(2))) = (uint8(((*fs_real_file)(unsafe.Pointer(pReal)).FnDatabase & 0x0000FF00) >> 8))
*(*uint8)(unsafe.Pointer(bp /* &zSize[0] */ + uintptr(3))) = (uint8((*fs_real_file)(unsafe.Pointer(pReal)).FnDatabase & 0x000000FF))
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 24 /* &.xWrite */))))(tls, pRealFile, bp /* &zSize[0] */, 4, int64(0))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 24 /* &.xWrite */))))(tls, pRealFile, bp /* &zSize[0] */, 4, int64(0))
}
if rc == 0 {
- rc = (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 40 /* &.xSync */))))(tls, pRealFile, (flags & (^int32(crt.Int32FromInt32(0x00010)))))
+ rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 40 /* &.xSync */))))(tls, pRealFile, (flags & (^int32(libc.Int32FromInt32(0x00010)))))
}
return rc
}
// Return the current file-size of an fs-file.
-func fsFileSize(tls *crt.TLS, pFile uintptr, pSize uintptr) int32 { /* test_onefile.c:526:12: */
+func fsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* test_onefile.c:526:12: */
var p uintptr = pFile
var pReal uintptr = (*fs_file)(unsafe.Pointer(p)).FpReal
if (*fs_file)(unsafe.Pointer(p)).FeType == 1 {
@@ -63007,23 +67758,23 @@ func fsFileSize(tls *crt.TLS, pFile uintptr, pSize uintptr) int32 { /* test_onef
}
// Lock an fs-file.
-func fsLock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_onefile.c:540:12: */
+func fsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_onefile.c:540:12: */
return 0
}
// Unlock an fs-file.
-func fsUnlock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_onefile.c:547:12: */
+func fsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_onefile.c:547:12: */
return 0
}
// Check if another file-handle holds a RESERVED lock on an fs-file.
-func fsCheckReservedLock(tls *crt.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_onefile.c:554:12: */
+func fsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_onefile.c:554:12: */
*(*int32)(unsafe.Pointer(pResOut)) = 0
return 0
}
// File control method. For custom operations on an fs-file.
-func fsFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_onefile.c:562:12: */
+func fsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_onefile.c:562:12: */
if op == 14 {
return 12
}
@@ -63031,17 +67782,17 @@ func fsFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32 {
}
// Return the sector-size in bytes for an fs-file.
-func fsSectorSize(tls *crt.TLS, pFile uintptr) int32 { /* test_onefile.c:570:12: */
+func fsSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* test_onefile.c:570:12: */
return 512
}
// Return the device characteristic flags supported by an fs-file.
-func fsDeviceCharacteristics(tls *crt.TLS, pFile uintptr) int32 { /* test_onefile.c:577:12: */
+func fsDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* test_onefile.c:577:12: */
return 0
}
// Open an fs file handle.
-func fsOpen1(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_onefile.c:584:12: */
+func fsOpen1(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_onefile.c:584:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -63068,7 +67819,7 @@ func fsOpen1(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int
goto __1
}
p2 = pFile
- crt.Xmemset(tls, p2, 0, uint64(unsafe.Sizeof(tmp_file{})))
+ libc.Xmemset(tls, p2, 0, uint64(unsafe.Sizeof(tmp_file{})))
(*tmp_file)(unsafe.Pointer(p2)).Fbase.FpMethods = uintptr(unsafe.Pointer(&tmp_io_methods))
return 0
__1:
@@ -63083,7 +67834,7 @@ __1:
(*fs_file)(unsafe.Pointer(p)).Fbase.FpMethods = uintptr(unsafe.Pointer(&fs_io_methods))
(*fs_file)(unsafe.Pointer(p)).FeType = eType
- nName = (int32(crt.Xstrlen(tls, zName)) - (func() int32 {
+ nName = (int32(libc.Xstrlen(tls, zName)) - (func() int32 {
if eType == 2 {
return 8
}
@@ -63091,7 +67842,7 @@ __1:
}()))
pReal = (*fs_vfs_t)(unsafe.Pointer(pFsVfs)).FpFileList
__2:
- if !((pReal != 0) && (crt.Xstrncmp(tls, (*fs_real_file)(unsafe.Pointer(pReal)).FzName, zName, uint64(nName)) != 0)) {
+ if !((pReal != 0) && (libc.Xstrncmp(tls, (*fs_real_file)(unsafe.Pointer(pReal)).FzName, zName, uint64(nName)) != 0)) {
goto __4
}
goto __3
@@ -63105,7 +67856,7 @@ __4:
if !(!(pReal != 0)) {
goto __5
}
- real_flags = ((flags & ^int32(crt.Int32FromInt32(0x00000100))) | 0x00000200)
+ real_flags = ((flags & ^int32(libc.Int32FromInt32(0x00000100))) | 0x00000200)
pParent = (*fs_vfs_t)(unsafe.Pointer(pFsVfs)).FpParent
pReal = sqlite3.Xsqlite3_malloc(tls, (int32(uint64(unsafe.Sizeof(fs_real_file{})) + uint64((*sqlite3_vfs)(unsafe.Pointer(pParent)).FszOsFile))))
@@ -63116,11 +67867,11 @@ __4:
goto open_out
__6:
;
- crt.Xmemset(tls, pReal, 0, (uint64(unsafe.Sizeof(fs_real_file{})) + uint64((*sqlite3_vfs)(unsafe.Pointer(pParent)).FszOsFile)))
+ libc.Xmemset(tls, pReal, 0, (uint64(unsafe.Sizeof(fs_real_file{})) + uint64((*sqlite3_vfs)(unsafe.Pointer(pParent)).FszOsFile)))
(*fs_real_file)(unsafe.Pointer(pReal)).FzName = zName
(*fs_real_file)(unsafe.Pointer(pReal)).FpFile = (pReal + uintptr(1)*48)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 40 /* &.xOpen */))))(tls, pParent, zName, (*fs_real_file)(unsafe.Pointer(pReal)).FpFile, real_flags, pOutFlags)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 40 /* &.xOpen */))))(tls, pParent, zName, (*fs_real_file)(unsafe.Pointer(pReal)).FpFile, real_flags, pOutFlags)
if !(rc != 0) {
goto __7
}
@@ -63129,7 +67880,7 @@ __7:
;
pRealFile = (*fs_real_file)(unsafe.Pointer(pReal)).FpFile
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 48 /* &.xFileSize */))))(tls, pRealFile, bp /* &size */)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 48 /* &.xFileSize */))))(tls, pRealFile, bp /* &size */)
if !(rc != 0) {
goto __8
}
@@ -63139,17 +67890,17 @@ __8:
if !(*(*sqlite3_int64)(unsafe.Pointer(bp /* size */)) == int64(0)) {
goto __9
}
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 24 /* &.xWrite */))))(tls, pRealFile, ts+32300 /* "\x00" */, 1, (int64(10485760 - 1)))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 24 /* &.xWrite */))))(tls, pRealFile, ts+34365 /* "\x00" */, 1, (int64(10485760 - 1)))
(*fs_real_file)(unsafe.Pointer(pReal)).FnBlob = 10485760
goto __10
__9:
(*fs_real_file)(unsafe.Pointer(pReal)).FnBlob = int32(*(*sqlite3_int64)(unsafe.Pointer(bp /* size */)))
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 16 /* &.xRead */))))(tls, pRealFile, bp+8 /* &zS[0] */, 4, int64(0))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 16 /* &.xRead */))))(tls, pRealFile, bp+8 /* &zS[0] */, 4, int64(0))
(*fs_real_file)(unsafe.Pointer(pReal)).FnDatabase = ((((int32(*(*uint8)(unsafe.Pointer(bp + 8 /* &zS[0] */ + uintptr(0)))) << 24) + (int32(*(*uint8)(unsafe.Pointer(bp + 8 /* &zS[0] */ + uintptr(1)))) << 16)) + (int32(*(*uint8)(unsafe.Pointer(bp + 8 /* &zS[0] */ + uintptr(2)))) << 8)) + int32(*(*uint8)(unsafe.Pointer(bp + 8 /* &zS[0] */ + uintptr(3)))))
if !(rc == 0) {
goto __11
}
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 16 /* &.xRead */))))(tls, pRealFile, bp+8 /* &zS[0] */, 4, (int64((*fs_real_file)(unsafe.Pointer(pReal)).FnBlob - 4)))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pRealFile)).FpMethods + 16 /* &.xRead */))))(tls, pRealFile, bp+8 /* &zS[0] */, 4, (int64((*fs_real_file)(unsafe.Pointer(pReal)).FnBlob - 4)))
if !((((*(*uint8)(unsafe.Pointer(bp + 8 /* &zS[0] */ + uintptr(0))) != 0) || (*(*uint8)(unsafe.Pointer(bp + 8 /* &zS[0] */ + uintptr(1))) != 0)) || (*(*uint8)(unsafe.Pointer(bp + 8 /* &zS[0] */ + uintptr(2))) != 0)) || (*(*uint8)(unsafe.Pointer(bp + 8 /* &zS[0] */ + uintptr(3))) != 0)) {
goto __12
}
@@ -63192,7 +67943,7 @@ __16:
if !((*sqlite3_file)(unsafe.Pointer((*fs_real_file)(unsafe.Pointer(pReal)).FpFile)).FpMethods != 0) {
goto __18
}
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*fs_real_file)(unsafe.Pointer(pReal)).FpFile)).FpMethods + 8 /* &.xClose */))))(tls, (*fs_real_file)(unsafe.Pointer(pReal)).FpFile)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*fs_real_file)(unsafe.Pointer(pReal)).FpFile)).FpMethods + 8 /* &.xClose */))))(tls, (*fs_real_file)(unsafe.Pointer(pReal)).FpFile)
__18:
;
sqlite3.Xsqlite3_free(tls, pReal)
@@ -63206,19 +67957,19 @@ __15:
// Delete the file located at zPath. If the dirSync argument is true,
// ensure the file-system modifications are synced to disk before
// returning.
-func fsDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_onefile.c:686:12: */
+func fsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_onefile.c:686:12: */
var rc int32 = 0
var pFsVfs uintptr = pVfs
var pReal uintptr
var pF uintptr
- var nName int32 = (int32(crt.Xstrlen(tls, zPath)) - 8)
+ var nName int32 = (int32(libc.Xstrlen(tls, zPath)) - 8)
pReal = (*fs_vfs_t)(unsafe.Pointer(pFsVfs)).FpFileList
- for ; (pReal != 0) && (crt.Xstrncmp(tls, (*fs_real_file)(unsafe.Pointer(pReal)).FzName, zPath, uint64(nName)) != 0); pReal = (*fs_real_file)(unsafe.Pointer(pReal)).FpNext {
+ for ; (pReal != 0) && (libc.Xstrncmp(tls, (*fs_real_file)(unsafe.Pointer(pReal)).FzName, zPath, uint64(nName)) != 0); pReal = (*fs_real_file)(unsafe.Pointer(pReal)).FpNext {
}
if pReal != 0 {
pF = (*fs_real_file)(unsafe.Pointer(pReal)).FpFile
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 24 /* &.xWrite */))))(tls, pF, ts+32302 /* "\x00\x00\x00\x00" */, 4, (int64((*fs_real_file)(unsafe.Pointer(pReal)).FnBlob - 512)))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pF)).FpMethods + 24 /* &.xWrite */))))(tls, pF, ts+34367 /* "\x00\x00\x00\x00" */, 4, (int64((*fs_real_file)(unsafe.Pointer(pReal)).FnBlob - 512)))
if rc == 0 {
(*fs_real_file)(unsafe.Pointer(pReal)).FnJournal = 0
}
@@ -63228,88 +67979,88 @@ func fsDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 {
// Test for access permissions. Return true if the requested permission
// is available, or false otherwise.
-func fsAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test_onefile.c:712:12: */
+func fsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test_onefile.c:712:12: */
var pFsVfs uintptr = pVfs
var pReal uintptr
var isJournal int32 = 0
- var nName int32 = int32(crt.Xstrlen(tls, zPath))
+ var nName int32 = int32(libc.Xstrlen(tls, zPath))
if flags != 0 {
var pParent uintptr = (*fs_vfs_t)(unsafe.Pointer(pVfs)).FpParent
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 56 /* &.xAccess */))))(tls, pParent, zPath, flags, pResOut)
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 56 /* &.xAccess */))))(tls, pParent, zPath, flags, pResOut)
}
- if (nName > 8) && (crt.Xstrcmp(tls, ts+29625 /* "-journal" */, (zPath+uintptr((nName-8)))) == 0) {
+ if (nName > 8) && (libc.Xstrcmp(tls, ts+31717 /* "-journal" */, (zPath+uintptr((nName-8)))) == 0) {
nName = nName - (8)
isJournal = 1
}
pReal = (*fs_vfs_t)(unsafe.Pointer(pFsVfs)).FpFileList
- for ; (pReal != 0) && (crt.Xstrncmp(tls, (*fs_real_file)(unsafe.Pointer(pReal)).FzName, zPath, uint64(nName)) != 0); pReal = (*fs_real_file)(unsafe.Pointer(pReal)).FpNext {
+ for ; (pReal != 0) && (libc.Xstrncmp(tls, (*fs_real_file)(unsafe.Pointer(pReal)).FzName, zPath, uint64(nName)) != 0); pReal = (*fs_real_file)(unsafe.Pointer(pReal)).FpNext {
}
- *(*int32)(unsafe.Pointer(pResOut)) = (crt.Bool32((pReal != 0) && (!(isJournal != 0) || ((*fs_real_file)(unsafe.Pointer(pReal)).FnJournal > 0))))
+ *(*int32)(unsafe.Pointer(pResOut)) = (libc.Bool32((pReal != 0) && (!(isJournal != 0) || ((*fs_real_file)(unsafe.Pointer(pReal)).FnJournal > 0))))
return 0
}
// Populate buffer zOut with the full canonical pathname corresponding
// to the pathname in zPath. zOut is guaranteed to point to a buffer
// of at least (FS_MAX_PATHNAME+1) bytes.
-func fsFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* test_onefile.c:746:12: */
+func fsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* test_onefile.c:746:12: */
var pParent uintptr = (*fs_vfs_t)(unsafe.Pointer(pVfs)).FpParent
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 64 /* &.xFullPathname */))))(tls, pParent, zPath, nOut, zOut)
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 64 /* &.xFullPathname */))))(tls, pParent, zPath, nOut, zOut)
}
// Open the dynamic library located at zPath and return a handle.
-func fsDlOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr) uintptr { /* test_onefile.c:759:13: */
+func fsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* test_onefile.c:759:13: */
var pParent uintptr = (*fs_vfs_t)(unsafe.Pointer(pVfs)).FpParent
- return (*(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pParent + 72 /* &.xDlOpen */))))(tls, pParent, zPath)
+ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pParent + 72 /* &.xDlOpen */))))(tls, pParent, zPath)
}
// Populate the buffer zErrMsg (size nByte bytes) with a human readable
// utf-8 string describing the most recent error encountered associated
// with dynamic libraries.
-func fsDlError(tls *crt.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* test_onefile.c:769:13: */
+func fsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* test_onefile.c:769:13: */
var pParent uintptr = (*fs_vfs_t)(unsafe.Pointer(pVfs)).FpParent
- (*(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pParent + 80 /* &.xDlError */))))(tls, pParent, nByte, zErrMsg)
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pParent + 80 /* &.xDlError */))))(tls, pParent, nByte, zErrMsg)
}
// Return a pointer to the symbol zSymbol in the dynamic library pHandle.
-func fsDlSym(tls *crt.TLS, pVfs uintptr, pH uintptr, zSym uintptr) uintptr { /* test_onefile.c:777:13: */
+func fsDlSym(tls *libc.TLS, pVfs uintptr, pH uintptr, zSym uintptr) uintptr { /* test_onefile.c:777:13: */
var pParent uintptr = (*fs_vfs_t)(unsafe.Pointer(pVfs)).FpParent
- return (*(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((pParent + 88 /* &.xDlSym */))))(tls, pParent, pH, zSym)
+ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((pParent + 88 /* &.xDlSym */))))(tls, pParent, pH, zSym)
}
// Close the dynamic library handle pHandle.
-func fsDlClose(tls *crt.TLS, pVfs uintptr, pHandle uintptr) { /* test_onefile.c:785:13: */
+func fsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* test_onefile.c:785:13: */
var pParent uintptr = (*fs_vfs_t)(unsafe.Pointer(pVfs)).FpParent
- (*(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer((pParent + 96 /* &.xDlClose */))))(tls, pParent, pHandle)
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pParent + 96 /* &.xDlClose */))))(tls, pParent, pHandle)
}
// Populate the buffer pointed to by zBufOut with nByte bytes of
// random data.
-func fsRandomness(tls *crt.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test_onefile.c:794:12: */
+func fsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test_onefile.c:794:12: */
var pParent uintptr = (*fs_vfs_t)(unsafe.Pointer(pVfs)).FpParent
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 104 /* &.xRandomness */))))(tls, pParent, nByte, zBufOut)
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 104 /* &.xRandomness */))))(tls, pParent, nByte, zBufOut)
}
// Sleep for nMicro microseconds. Return the number of microseconds
// actually slept.
-func fsSleep(tls *crt.TLS, pVfs uintptr, nMicro int32) int32 { /* test_onefile.c:803:12: */
+func fsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* test_onefile.c:803:12: */
var pParent uintptr = (*fs_vfs_t)(unsafe.Pointer(pVfs)).FpParent
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((pParent + 112 /* &.xSleep */))))(tls, pParent, nMicro)
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pParent + 112 /* &.xSleep */))))(tls, pParent, nMicro)
}
// Return the current time as a Julian Day number in *pTimeOut.
-func fsCurrentTime(tls *crt.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* test_onefile.c:811:12: */
+func fsCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* test_onefile.c:811:12: */
var pParent uintptr = (*fs_vfs_t)(unsafe.Pointer(pVfs)).FpParent
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pParent + 120 /* &.xCurrentTime */))))(tls, pParent, pTimeOut)
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pParent + 120 /* &.xCurrentTime */))))(tls, pParent, pTimeOut)
}
// This procedure registers the fs vfs with SQLite. If the argument is
// true, the fs vfs becomes the new default vfs. It is the only publicly
// available function in this file.
-func fs_register(tls *crt.TLS) int32 { /* test_onefile.c:821:5: */
+func fs_register(tls *libc.TLS) int32 { /* test_onefile.c:821:5: */
if fs_vfs.FpParent != 0 {
return 0
}
@@ -63324,7 +68075,7 @@ func fs_register(tls *crt.TLS) int32 { /* test_onefile.c:821:5: */
return sqlite3.Xsqlite3_vfs_register(tls, (uintptr(unsafe.Pointer(&fs_vfs)) /* &.base */), 0)
}
-func SqlitetestOnefile_Init(tls *crt.TLS) int32 { /* test_onefile.c:830:7: */
+func SqlitetestOnefile_Init(tls *libc.TLS) int32 { /* test_onefile.c:830:7: */
return fs_register(tls)
}
@@ -63491,25 +68242,25 @@ var vfslog_io_methods = sqlite3_io_methods{FiVersion: 2, FxClose: // iVersion
// Convenience macros for operations on timevals.
// NOTE: `timercmp' does not work for >= or <=.
-func vfslog_time(tls *crt.TLS) sqlite3_uint64 { /* test_osinst.c:224:23: */
+func vfslog_time(tls *libc.TLS) sqlite3_uint64 { /* test_osinst.c:224:23: */
bp := tls.Alloc(16)
defer tls.Free(16)
// var sTime timeval at bp, 16
- crt.Xgettimeofday(tls, bp /* &sTime */, uintptr(0))
+ libc.Xgettimeofday(tls, bp /* &sTime */, uintptr(0))
return (sqlite3_uint64((*timeval)(unsafe.Pointer(bp /* &sTime */)).Ftv_usec) + (sqlite3_uint64((*timeval)(unsafe.Pointer(bp /* &sTime */)).Ftv_sec) * uint64(1000000)))
}
// Close an vfslog-file.
-func vfslogClose(tls *crt.TLS, pFile uintptr) int32 { /* test_osinst.c:256:12: */
+func vfslogClose(tls *libc.TLS, pFile uintptr) int32 { /* test_osinst.c:256:12: */
var t sqlite3_uint64
var rc int32 = 0
var p uintptr = pFile
t = vfslog_time(tls)
if (*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods != 0 {
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 8 /* &.xClose */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 8 /* &.xClose */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal)
}
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 3, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, 0, 0)
@@ -63517,179 +68268,179 @@ func vfslogClose(tls *crt.TLS, pFile uintptr) int32 { /* test_osinst.c:256:12: *
}
// Read data from an vfslog-file.
-func vfslogRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_osinst.c:273:12: */
+func vfslogRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_osinst.c:273:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 16 /* &.xRead */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 16 /* &.xRead */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 14, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, iAmt, int32(iOfst))
return rc
}
// Write data to an vfslog-file.
-func vfslogWrite(tls *crt.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_osinst.c:292:12: */
+func vfslogWrite(tls *libc.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_osinst.c:292:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 24 /* &.xWrite */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, z, iAmt, iOfst)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 24 /* &.xWrite */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, z, iAmt, iOfst)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 20, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, iAmt, int32(iOfst))
return rc
}
// Truncate an vfslog-file.
-func vfslogTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_osinst.c:311:12: */
+func vfslogTruncate(tls *libc.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_osinst.c:311:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 32 /* &.xTruncate */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, size)
+ rc = (*(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 32 /* &.xTruncate */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, size)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 18, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, 0, int32(size))
return rc
}
// Sync an vfslog-file.
-func vfslogSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_osinst.c:325:12: */
+func vfslogSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* test_osinst.c:325:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 40 /* &.xSync */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, flags)
+ rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 40 /* &.xSync */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, flags)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 17, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, flags, 0)
return rc
}
// Return the current file-size of an vfslog-file.
-func vfslogFileSize(tls *crt.TLS, pFile uintptr, pSize uintptr) int32 { /* test_osinst.c:339:12: */
+func vfslogFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* test_osinst.c:339:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 48 /* &.xFileSize */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, pSize)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 48 /* &.xFileSize */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, pSize)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 8, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, 0, int32(*(*sqlite_int64)(unsafe.Pointer(pSize))))
return rc
}
// Lock an vfslog-file.
-func vfslogLock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_osinst.c:353:12: */
+func vfslogLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_osinst.c:353:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 56 /* &.xLock */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, eLock)
+ rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 56 /* &.xLock */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, eLock)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 11, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, eLock, 0)
return rc
}
// Unlock an vfslog-file.
-func vfslogUnlock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_osinst.c:367:12: */
+func vfslogUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_osinst.c:367:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 64 /* &.xUnlock */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, eLock)
+ rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 64 /* &.xUnlock */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, eLock)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 19, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, eLock, 0)
return rc
}
// Check if another file-handle holds a RESERVED lock on an vfslog-file.
-func vfslogCheckReservedLock(tls *crt.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_osinst.c:381:12: */
+func vfslogCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_osinst.c:381:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, pResOut)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, pResOut)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 2, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, *(*int32)(unsafe.Pointer(pResOut)), 0)
return rc
}
// File control method. For custom operations on an vfslog-file.
-func vfslogFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_osinst.c:395:12: */
+func vfslogFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_osinst.c:395:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var p uintptr = pFile
- var rc int32 = (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 80 /* &.xFileControl */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, op, pArg)
+ var rc int32 = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 80 /* &.xFileControl */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, op, pArg)
if (op == 12) && (rc == 0) {
- *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+32307 /* "vfslog/%z" */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(pArg))))
+ *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+34372 /* "vfslog/%z" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(pArg))))
}
return rc
}
// Return the sector-size in bytes for an vfslog-file.
-func vfslogSectorSize(tls *crt.TLS, pFile uintptr) int32 { /* test_osinst.c:407:12: */
+func vfslogSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* test_osinst.c:407:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 88 /* &.xSectorSize */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 88 /* &.xSectorSize */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 15, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, 0, 0)
return rc
}
// Return the device characteristic flags supported by an vfslog-file.
-func vfslogDeviceCharacteristics(tls *crt.TLS, pFile uintptr) int32 { /* test_osinst.c:421:12: */
+func vfslogDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* test_osinst.c:421:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 6, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, 0, 0)
return rc
}
-func vfslogShmLock(tls *crt.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* test_osinst.c:432:12: */
+func vfslogShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* test_osinst.c:432:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 112 /* &.xShmLock */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, ofst, n, flags)
+ rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 112 /* &.xShmLock */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, ofst, n, flags)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 25, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, 0, 0)
return rc
}
-func vfslogShmMap(tls *crt.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 { /* test_osinst.c:442:12: */
+func vfslogShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 { /* test_osinst.c:442:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 104 /* &.xShmMap */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, iRegion, szRegion, isWrite, pp)
+ rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 104 /* &.xShmMap */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, iRegion, szRegion, isWrite, pp)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 23, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, 0, 0)
return rc
}
-func vfslogShmBarrier(tls *crt.TLS, pFile uintptr) { /* test_osinst.c:458:13: */
+func vfslogShmBarrier(tls *libc.TLS, pFile uintptr) { /* test_osinst.c:458:13: */
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 120 /* &.xShmBarrier */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 120 /* &.xShmBarrier */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 26, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), 0, 0, 0)
}
-func vfslogShmUnmap(tls *crt.TLS, pFile uintptr, deleteFlag int32) int32 { /* test_osinst.c:466:12: */
+func vfslogShmUnmap(tls *libc.TLS, pFile uintptr, deleteFlag int32) int32 { /* test_osinst.c:466:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 128 /* &.xShmUnmap */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, deleteFlag)
+ rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogFile)(unsafe.Pointer(p)).FpReal)).FpMethods + 128 /* &.xShmUnmap */))))(tls, (*VfslogFile)(unsafe.Pointer(p)).FpReal, deleteFlag)
t = (vfslog_time(tls) - t)
vfslog_call(tls, (*VfslogFile)(unsafe.Pointer(p)).FpVfslog, 22, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, 0, 0)
return rc
}
// Open an vfslog file handle.
-func vfslogOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_osinst.c:481:12: */
+func vfslogOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_osinst.c:481:12: */
var rc int32
var t sqlite3_uint64
var p uintptr = pFile
@@ -63698,10 +68449,10 @@ func vfslogOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags
(*sqlite3_file)(unsafe.Pointer(pFile)).FpMethods = uintptr(unsafe.Pointer(&vfslog_io_methods))
(*VfslogFile)(unsafe.Pointer(p)).FpReal = (p + uintptr(1)*32)
(*VfslogFile)(unsafe.Pointer(p)).FpVfslog = pVfs
- (*VfslogFile)(unsafe.Pointer(p)).FiFileId = crt.PreIncInt32(&(*VfslogVfs)(unsafe.Pointer(pLog)).FiNextFileId, 1)
+ (*VfslogFile)(unsafe.Pointer(p)).FiFileId = libc.PreIncInt32(&(*VfslogVfs)(unsafe.Pointer(pLog)).FiNextFileId, 1)
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 40 /* &.xOpen */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, zName, (*VfslogFile)(unsafe.Pointer(p)).FpReal, flags, pOutFlags)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 40 /* &.xOpen */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, zName, (*VfslogFile)(unsafe.Pointer(p)).FpReal, flags, pOutFlags)
t = (vfslog_time(tls) - t)
vfslog_call(tls, pVfs, 12, (*VfslogFile)(unsafe.Pointer(p)).FiFileId, int64(t), rc, 0, 0)
@@ -63712,11 +68463,11 @@ func vfslogOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags
// Delete the file located at zPath. If the dirSync argument is true,
// ensure the file-system modifications are synced to disk before
// returning.
-func vfslogDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_osinst.c:512:12: */
+func vfslogDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_osinst.c:512:12: */
var rc int32
var t sqlite3_uint64
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 48 /* &.xDelete */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, zPath, dirSync)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 48 /* &.xDelete */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, zPath, dirSync)
t = (vfslog_time(tls) - t)
vfslog_call(tls, pVfs, 5, 0, int64(t), rc, dirSync, 0)
vfslog_string(tls, pVfs, zPath)
@@ -63725,11 +68476,11 @@ func vfslogDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int3
// Test for access permissions. Return true if the requested permission
// is available, or false otherwise.
-func vfslogAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test_osinst.c:527:12: */
+func vfslogAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test_osinst.c:527:12: */
var rc int32
var t sqlite3_uint64
t = vfslog_time(tls)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 56 /* &.xAccess */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, zPath, flags, pResOut)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 56 /* &.xAccess */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, zPath, flags, pResOut)
t = (vfslog_time(tls) - t)
vfslog_call(tls, pVfs, 1, 0, int64(t), rc, flags, *(*int32)(unsafe.Pointer(pResOut)))
vfslog_string(tls, pVfs, zPath)
@@ -63739,57 +68490,57 @@ func vfslogAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOu
// Populate buffer zOut with the full canonical pathname corresponding
// to the pathname in zPath. zOut is guaranteed to point to a buffer
// of at least (INST_MAX_PATHNAME+1) bytes.
-func vfslogFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* test_osinst.c:548:12: */
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 64 /* &.xFullPathname */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, zPath, nOut, zOut)
+func vfslogFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* test_osinst.c:548:12: */
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 64 /* &.xFullPathname */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, zPath, nOut, zOut)
}
// Open the dynamic library located at zPath and return a handle.
-func vfslogDlOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr) uintptr { /* test_osinst.c:560:13: */
- return (*(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 72 /* &.xDlOpen */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, zPath)
+func vfslogDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* test_osinst.c:560:13: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 72 /* &.xDlOpen */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, zPath)
}
// Populate the buffer zErrMsg (size nByte bytes) with a human readable
// utf-8 string describing the most recent error encountered associated
// with dynamic libraries.
-func vfslogDlError(tls *crt.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* test_osinst.c:569:13: */
- (*(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 80 /* &.xDlError */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, nByte, zErrMsg)
+func vfslogDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* test_osinst.c:569:13: */
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 80 /* &.xDlError */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, nByte, zErrMsg)
}
// Return a pointer to the symbol zSymbol in the dynamic library pHandle.
-func vfslogDlSym(tls *crt.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr { /* test_osinst.c:576:13: */
- return (*(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 88 /* &.xDlSym */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, p, zSym)
+func vfslogDlSym(tls *libc.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr { /* test_osinst.c:576:13: */
+ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 88 /* &.xDlSym */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, p, zSym)
}
// Close the dynamic library handle pHandle.
-func vfslogDlClose(tls *crt.TLS, pVfs uintptr, pHandle uintptr) { /* test_osinst.c:583:13: */
- (*(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 96 /* &.xDlClose */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, pHandle)
+func vfslogDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* test_osinst.c:583:13: */
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 96 /* &.xDlClose */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, pHandle)
}
// Populate the buffer pointed to by zBufOut with nByte bytes of
// random data.
-func vfslogRandomness(tls *crt.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test_osinst.c:591:12: */
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 104 /* &.xRandomness */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, nByte, zBufOut)
+func vfslogRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test_osinst.c:591:12: */
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 104 /* &.xRandomness */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, nByte, zBufOut)
}
// Sleep for nMicro microseconds. Return the number of microseconds
// actually slept.
-func vfslogSleep(tls *crt.TLS, pVfs uintptr, nMicro int32) int32 { /* test_osinst.c:599:12: */
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 112 /* &.xSleep */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, nMicro)
+func vfslogSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* test_osinst.c:599:12: */
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 112 /* &.xSleep */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, nMicro)
}
// Return the current time as a Julian Day number in *pTimeOut.
-func vfslogCurrentTime(tls *crt.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* test_osinst.c:606:12: */
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 120 /* &.xCurrentTime */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, pTimeOut)
+func vfslogCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* test_osinst.c:606:12: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 120 /* &.xCurrentTime */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, pTimeOut)
}
-func vfslogGetLastError(tls *crt.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* test_osinst.c:610:12: */
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 128 /* &.xGetLastError */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, a, b)
+func vfslogGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* test_osinst.c:610:12: */
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 128 /* &.xGetLastError */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, a, b)
}
-func vfslogCurrentTimeInt64(tls *crt.TLS, pVfs uintptr, p uintptr) int32 { /* test_osinst.c:613:12: */
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, p)
+func vfslogCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, p uintptr) int32 { /* test_osinst.c:613:12: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, (*VfslogVfs)(unsafe.Pointer(pVfs)).FpVfs, p)
}
-func vfslog_flush(tls *crt.TLS, p uintptr) { /* test_osinst.c:617:13: */
+func vfslog_flush(tls *libc.TLS, p uintptr) { /* test_osinst.c:617:13: */
var pending int32 = sqlite3.Xsqlite3_io_error_pending
var persist int32 = sqlite3.Xsqlite3_io_error_persist
@@ -63800,7 +68551,7 @@ func vfslog_flush(tls *crt.TLS, p uintptr) { /* test_osinst.c:617:13: */
sqlite3.Xsqlite3_diskfull_pending = 0
if (*VfslogVfs)(unsafe.Pointer(p)).FnBuf != 0 {
- (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVfs)(unsafe.Pointer(p)).FpLog)).FpMethods + 24 /* &.xWrite */))))(tls, (*VfslogVfs)(unsafe.Pointer(p)).FpLog, p+204 /* &.aBuf */, (*VfslogVfs)(unsafe.Pointer(p)).FnBuf, (*VfslogVfs)(unsafe.Pointer(p)).FiOffset)
+ (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVfs)(unsafe.Pointer(p)).FpLog)).FpMethods + 24 /* &.xWrite */))))(tls, (*VfslogVfs)(unsafe.Pointer(p)).FpLog, p+204 /* &.aBuf */, (*VfslogVfs)(unsafe.Pointer(p)).FnBuf, (*VfslogVfs)(unsafe.Pointer(p)).FiOffset)
*(*sqlite3_int64)(unsafe.Pointer(p + 192 /* &.iOffset */)) += (sqlite3_int64((*VfslogVfs)(unsafe.Pointer(p)).FnBuf))
(*VfslogVfs)(unsafe.Pointer(p)).FnBuf = 0
}
@@ -63810,14 +68561,14 @@ func vfslog_flush(tls *crt.TLS, p uintptr) { /* test_osinst.c:617:13: */
sqlite3.Xsqlite3_diskfull_pending = diskfull
}
-func put32bits(tls *crt.TLS, p uintptr, v uint32) { /* test_osinst.c:645:13: */
+func put32bits(tls *libc.TLS, p uintptr, v uint32) { /* test_osinst.c:645:13: */
*(*uint8)(unsafe.Pointer(p + uintptr(0))) = (uint8(v >> 24))
*(*uint8)(unsafe.Pointer(p + uintptr(1))) = (uint8(v >> 16))
*(*uint8)(unsafe.Pointer(p + uintptr(2))) = (uint8(v >> 8))
*(*uint8)(unsafe.Pointer(p + uintptr(3))) = uint8(v)
}
-func vfslog_call(tls *crt.TLS, pVfs uintptr, eEvent int32, iFileid int32, nClick sqlite3_int64, return_code int32, size int32, offset int32) { /* test_osinst.c:652:13: */
+func vfslog_call(tls *libc.TLS, pVfs uintptr, eEvent int32, iFileid int32, nClick sqlite3_int64, return_code int32, size int32, offset int32) { /* test_osinst.c:652:13: */
var p uintptr = pVfs
var zRec uintptr
if (uint64(24 + (*VfslogVfs)(unsafe.Pointer(p)).FnBuf)) > uint64(unsafe.Sizeof([8192]int8{})) {
@@ -63833,12 +68584,12 @@ func vfslog_call(tls *crt.TLS, pVfs uintptr, eEvent int32, iFileid int32, nClick
*(*int32)(unsafe.Pointer(p + 200 /* &.nBuf */)) += (24)
}
-func vfslog_string(tls *crt.TLS, pVfs uintptr, zStr uintptr) { /* test_osinst.c:676:13: */
+func vfslog_string(tls *libc.TLS, pVfs uintptr, zStr uintptr) { /* test_osinst.c:676:13: */
var p uintptr = pVfs
var zRec uintptr
var nStr int32
if zStr != 0 {
- nStr = int32(crt.Xstrlen(tls, zStr))
+ nStr = int32(libc.Xstrlen(tls, zStr))
} else {
nStr = 0
}
@@ -63848,24 +68599,24 @@ func vfslog_string(tls *crt.TLS, pVfs uintptr, zStr uintptr) { /* test_osinst.c:
zRec = ((p + 204 /* &.aBuf */) + uintptr((*VfslogVfs)(unsafe.Pointer(p)).FnBuf))
put32bits(tls, (zRec + uintptr(0)), uint32(nStr))
if zStr != 0 {
- crt.Xmemcpy(tls, (zRec + uintptr(4)), zStr, uint64(nStr))
+ libc.Xmemcpy(tls, (zRec + uintptr(4)), zStr, uint64(nStr))
}
*(*int32)(unsafe.Pointer(p + 200 /* &.nBuf */)) += (4 + nStr)
}
-func vfslog_finalize(tls *crt.TLS, p uintptr) { /* test_osinst.c:691:13: */
+func vfslog_finalize(tls *libc.TLS, p uintptr) { /* test_osinst.c:691:13: */
if (*sqlite3_file)(unsafe.Pointer((*VfslogVfs)(unsafe.Pointer(p)).FpLog)).FpMethods != 0 {
vfslog_flush(tls, p)
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVfs)(unsafe.Pointer(p)).FpLog)).FpMethods + 8 /* &.xClose */))))(tls, (*VfslogVfs)(unsafe.Pointer(p)).FpLog)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVfs)(unsafe.Pointer(p)).FpLog)).FpMethods + 8 /* &.xClose */))))(tls, (*VfslogVfs)(unsafe.Pointer(p)).FpLog)
}
sqlite3.Xsqlite3_free(tls, p)
}
-func sqlite3_vfslog_finalize(tls *crt.TLS, zVfs uintptr) int32 { /* test_osinst.c:699:5: */
+func sqlite3_vfslog_finalize(tls *libc.TLS, zVfs uintptr) int32 { /* test_osinst.c:699:5: */
var pVfs uintptr
pVfs = sqlite3.Xsqlite3_vfs_find(tls, zVfs)
if !(pVfs != 0) || ((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FxOpen != *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
}{vfslogOpen}))) {
return 1
}
@@ -63874,7 +68625,7 @@ func sqlite3_vfslog_finalize(tls *crt.TLS, zVfs uintptr) int32 { /* test_osinst.
return 0
}
-func sqlite3_vfslog_new(tls *crt.TLS, zVfs uintptr, zParentVfs uintptr, zLog uintptr) int32 { /* test_osinst.c:710:5: */
+func sqlite3_vfslog_new(tls *libc.TLS, zVfs uintptr, zParentVfs uintptr, zLog uintptr) int32 { /* test_osinst.c:710:5: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -63892,26 +68643,26 @@ func sqlite3_vfslog_new(tls *crt.TLS, zVfs uintptr, zParentVfs uintptr, zLog uin
return 1
}
- nVfs = int32(crt.Xstrlen(tls, zVfs))
+ nVfs = int32(libc.Xstrlen(tls, zVfs))
nByte = (int32(((((uint64(unsafe.Sizeof(VfslogVfs{})) + uint64((*sqlite3_vfs)(unsafe.Pointer(pParent)).FszOsFile)) + uint64(nVfs)) + uint64(1)) + uint64((*sqlite3_vfs)(unsafe.Pointer(pParent)).FmxPathname)) + uint64(1)))
p = sqlite3.Xsqlite3_malloc(tls, nByte)
- crt.Xmemset(tls, p, 0, uint64(nByte))
+ libc.Xmemset(tls, p, 0, uint64(nByte))
(*VfslogVfs)(unsafe.Pointer(p)).FpVfs = pParent
(*VfslogVfs)(unsafe.Pointer(p)).FpLog = (p + uintptr(1)*8400)
- crt.Xmemcpy(tls, (p /* &.base */), uintptr(unsafe.Pointer(&vfslog_vfs)), uint64(unsafe.Sizeof(sqlite3_vfs{})))
+ libc.Xmemcpy(tls, (p /* &.base */), uintptr(unsafe.Pointer(&vfslog_vfs)), uint64(unsafe.Sizeof(sqlite3_vfs{})))
(*VfslogVfs)(unsafe.Pointer(p)).Fbase.FzName = (((*VfslogVfs)(unsafe.Pointer(p)).FpLog) + uintptr((*sqlite3_vfs)(unsafe.Pointer(pParent)).FszOsFile))
*(*int32)(unsafe.Pointer(p /* &.base */ + 4 /* &.szOsFile */)) += ((*sqlite3_vfs)(unsafe.Pointer(pParent)).FszOsFile)
- crt.Xmemcpy(tls, (*VfslogVfs)(unsafe.Pointer(p)).Fbase.FzName, zVfs, uint64(nVfs))
+ libc.Xmemcpy(tls, (*VfslogVfs)(unsafe.Pointer(p)).Fbase.FzName, zVfs, uint64(nVfs))
zFile = ((*VfslogVfs)(unsafe.Pointer(p)).Fbase.FzName + uintptr((nVfs + 1)))
- (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 64 /* &.xFullPathname */))))(tls, pParent, zLog, (*sqlite3_vfs)(unsafe.Pointer(pParent)).FmxPathname, zFile)
+ (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 64 /* &.xFullPathname */))))(tls, pParent, zLog, (*sqlite3_vfs)(unsafe.Pointer(pParent)).FmxPathname, zFile)
*(*int32)(unsafe.Pointer(bp /* flags */)) = ((0x00000002 | 0x00000004) | 0x00004000)
- (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pParent + 48 /* &.xDelete */))))(tls, pParent, zFile, 0)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 40 /* &.xOpen */))))(tls, pParent, zFile, (*VfslogVfs)(unsafe.Pointer(p)).FpLog, *(*int32)(unsafe.Pointer(bp /* flags */)), bp /* &flags */)
+ (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pParent + 48 /* &.xDelete */))))(tls, pParent, zFile, 0)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pParent + 40 /* &.xOpen */))))(tls, pParent, zFile, (*VfslogVfs)(unsafe.Pointer(p)).FpLog, *(*int32)(unsafe.Pointer(bp /* flags */)), bp /* &flags */)
if rc == 0 {
- crt.Xmemcpy(tls, p+204 /* &.aBuf */, ts+32317 /* "sqlite_ostrace1...." */, uint64(20))
+ libc.Xmemcpy(tls, p+204 /* &.aBuf */, ts+34382 /* "sqlite_ostrace1...." */, uint64(20))
(*VfslogVfs)(unsafe.Pointer(p)).FiOffset = int64(0)
(*VfslogVfs)(unsafe.Pointer(p)).FnBuf = 20
rc = sqlite3.Xsqlite3_vfs_register(tls, p, 1)
@@ -63922,11 +68673,11 @@ func sqlite3_vfslog_new(tls *crt.TLS, zVfs uintptr, zParentVfs uintptr, zLog uin
return rc
}
-func sqlite3_vfslog_annotate(tls *crt.TLS, zVfs uintptr, zMsg uintptr) int32 { /* test_osinst.c:758:5: */
+func sqlite3_vfslog_annotate(tls *libc.TLS, zVfs uintptr, zMsg uintptr) int32 { /* test_osinst.c:758:5: */
var pVfs uintptr
pVfs = sqlite3.Xsqlite3_vfs_find(tls, zVfs)
if !(pVfs != 0) || ((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FxOpen != *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
}{vfslogOpen}))) {
return 1
}
@@ -63935,83 +68686,83 @@ func sqlite3_vfslog_annotate(tls *crt.TLS, zVfs uintptr, zMsg uintptr) int32 { /
return 0
}
-func vfslog_eventname(tls *crt.TLS, eEvent int32) uintptr { /* test_osinst.c:769:19: */
+func vfslog_eventname(tls *libc.TLS, eEvent int32) uintptr { /* test_osinst.c:769:19: */
var zEvent uintptr = uintptr(0)
switch eEvent {
case 3:
- zEvent = ts + 32338 /* "xClose" */
+ zEvent = ts + 34403 /* "xClose" */
break
case 14:
- zEvent = ts + 32345 /* "xRead" */
+ zEvent = ts + 34410 /* "xRead" */
break
case 20:
- zEvent = ts + 32351 /* "xWrite" */
+ zEvent = ts + 34416 /* "xWrite" */
break
case 18:
- zEvent = ts + 32358 /* "xTruncate" */
+ zEvent = ts + 34423 /* "xTruncate" */
break
case 17:
- zEvent = ts + 24735 /* "xSync" */
+ zEvent = ts + 26827 /* "xSync" */
break
case 8:
- zEvent = ts + 32368 /* "xFilesize" */
+ zEvent = ts + 34433 /* "xFilesize" */
break
case 11:
- zEvent = ts + 32378 /* "xLock" */
+ zEvent = ts + 34443 /* "xLock" */
break
case 19:
- zEvent = ts + 32384 /* "xUnlock" */
+ zEvent = ts + 34449 /* "xUnlock" */
break
case 2:
- zEvent = ts + 32392 /* "xCheckResLock" */
+ zEvent = ts + 34457 /* "xCheckResLock" */
break
case 7:
- zEvent = ts + 32406 /* "xFileControl" */
+ zEvent = ts + 34471 /* "xFileControl" */
break
case 15:
- zEvent = ts + 32419 /* "xSectorSize" */
+ zEvent = ts + 34484 /* "xSectorSize" */
break
case 6:
- zEvent = ts + 32431 /* "xDeviceChar" */
+ zEvent = ts + 34496 /* "xDeviceChar" */
break
case 12:
- zEvent = ts + 24300 /* "xOpen" */
+ zEvent = ts + 26399 /* "xOpen" */
break
case 5:
- zEvent = ts + 32443 /* "xDelete" */
+ zEvent = ts + 34508 /* "xDelete" */
break
case 1:
- zEvent = ts + 32451 /* "xAccess" */
+ zEvent = ts + 34516 /* "xAccess" */
break
case 9:
- zEvent = ts + 32459 /* "xFullPathname" */
+ zEvent = ts + 34524 /* "xFullPathname" */
break
case 13:
- zEvent = ts + 32473 /* "xRandomness" */
+ zEvent = ts + 34538 /* "xRandomness" */
break
case 16:
- zEvent = ts + 32485 /* "xSleep" */
+ zEvent = ts + 34550 /* "xSleep" */
break
case 4:
- zEvent = ts + 32492 /* "xCurrentTime" */
+ zEvent = ts + 34557 /* "xCurrentTime" */
break
case 22:
- zEvent = ts + 32505 /* "xShmUnmap" */
+ zEvent = ts + 34570 /* "xShmUnmap" */
break
case 25:
- zEvent = ts + 32515 /* "xShmLock" */
+ zEvent = ts + 34580 /* "xShmLock" */
break
case 26:
- zEvent = ts + 32524 /* "xShmBarrier" */
+ zEvent = ts + 34589 /* "xShmBarrier" */
break
case 23:
- zEvent = ts + 32536 /* "xShmMap" */
+ zEvent = ts + 34601 /* "xShmMap" */
break
case 28:
- zEvent = ts + 32544 /* "annotation" */
+ zEvent = ts + 34609 /* "annotation" */
break
}
@@ -64038,14 +68789,14 @@ type VfslogCsr1 = struct {
type VfslogCsr = VfslogCsr1 /* test_osinst.c:805:26 */
-func get32bits(tls *crt.TLS, p uintptr) uint32 { /* test_osinst.c:830:21: */
+func get32bits(tls *libc.TLS, p uintptr) uint32 { /* test_osinst.c:830:21: */
return (uint32((((int32(*(*uint8)(unsafe.Pointer(p + uintptr(0)))) << 24) + (int32(*(*uint8)(unsafe.Pointer(p + uintptr(1)))) << 16)) + (int32(*(*uint8)(unsafe.Pointer(p + uintptr(2)))) << 8)) + int32(*(*uint8)(unsafe.Pointer(p + uintptr(3))))))
}
// The argument must point to a buffer containing a nul-terminated string.
// If the string begins with an SQL quote character it is overwritten by
// the dequoted version. Otherwise the buffer is left unmodified.
-func dequote(tls *crt.TLS, z uintptr) { /* test_osinst.c:839:13: */
+func dequote(tls *libc.TLS, z uintptr) { /* test_osinst.c:839:13: */
var quote int8 // Quote character (if any )
quote = *(*int8)(unsafe.Pointer(z + uintptr(0)))
if (((int32(quote) == '[') || (int32(quote) == '\'')) || (int32(quote) == '"')) || (int32(quote) == '`') {
@@ -64059,10 +68810,10 @@ func dequote(tls *crt.TLS, z uintptr) { /* test_osinst.c:839:13: */
if int32(*(*int8)(unsafe.Pointer(z + uintptr((iIn + 1))))) != int32(quote) {
break
}
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&iOut, 1)))) = quote
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = quote
iIn = iIn + (2)
} else {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&iIn, 1))))
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iIn, 1))))
}
}
*(*int8)(unsafe.Pointer(z + uintptr(iOut))) = int8(0)
@@ -64070,7 +68821,7 @@ func dequote(tls *crt.TLS, z uintptr) { /* test_osinst.c:839:13: */
}
// Connect to or create a vfslog virtual table.
-func vlogConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_osinst.c:863:12: */
+func vlogConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_osinst.c:863:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -64089,27 +68840,27 @@ func vlogConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt
if p == uintptr(0) {
return 7
}
- crt.Xmemset(tls, p, 0, uint64(nByte))
+ libc.Xmemset(tls, p, 0, uint64(nByte))
(*VfslogVtab)(unsafe.Pointer(p)).FpFd = (p + uintptr(1)*48)
(*VfslogVtab)(unsafe.Pointer(p)).FzFile = (((*VfslogVtab)(unsafe.Pointer(p)).FpFd) + uintptr((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))
- zFile = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))
+ zFile = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))
if !(zFile != 0) {
sqlite3.Xsqlite3_free(tls, p)
return 7
}
dequote(tls, zFile)
- (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 64 /* &.xFullPathname */))))(tls, pVfs, zFile, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname, (*VfslogVtab)(unsafe.Pointer(p)).FzFile)
+ (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 64 /* &.xFullPathname */))))(tls, pVfs, zFile, (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname, (*VfslogVtab)(unsafe.Pointer(p)).FzFile)
sqlite3.Xsqlite3_free(tls, zFile)
*(*int32)(unsafe.Pointer(bp + 8 /* flags */)) = (0x00000002 | 0x00004000)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 40 /* &.xOpen */))))(tls, pVfs, (*VfslogVtab)(unsafe.Pointer(p)).FzFile, (*VfslogVtab)(unsafe.Pointer(p)).FpFd, *(*int32)(unsafe.Pointer(bp + 8 /* flags */)), bp+8 /* &flags */)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 40 /* &.xOpen */))))(tls, pVfs, (*VfslogVtab)(unsafe.Pointer(p)).FzFile, (*VfslogVtab)(unsafe.Pointer(p)).FpFd, *(*int32)(unsafe.Pointer(bp + 8 /* flags */)), bp+8 /* &flags */)
if rc == 0 {
- (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods + 48 /* &.xFileSize */))))(tls, (*VfslogVtab)(unsafe.Pointer(p)).FpFd, (p + 32 /* &.nByte */))
+ (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods + 48 /* &.xFileSize */))))(tls, (*VfslogVtab)(unsafe.Pointer(p)).FpFd, (p + 32 /* &.nByte */))
sqlite3.Xsqlite3_declare_vtab(tls, db,
- ts+32555 /* "CREATE TABLE xxx..." */)
+ ts+34620 /* "CREATE TABLE xxx..." */)
*(*uintptr)(unsafe.Pointer(ppVtab)) = (p /* &.base */)
} else {
sqlite3.Xsqlite3_free(tls, p)
@@ -64120,16 +68871,16 @@ func vlogConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt
// There is no "best-index". This virtual table always does a linear
// scan of the binary VFS log file.
-func vlogBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_osinst.c:916:12: */
+func vlogBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_osinst.c:916:12: */
(*sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 10.0
return 0
}
// Disconnect from or destroy a vfslog virtual table.
-func vlogDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* test_osinst.c:924:12: */
+func vlogDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* test_osinst.c:924:12: */
var p uintptr = pVtab
if (*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods != 0 {
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods + 8 /* &.xClose */))))(tls, (*VfslogVtab)(unsafe.Pointer(p)).FpFd)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods + 8 /* &.xClose */))))(tls, (*VfslogVtab)(unsafe.Pointer(p)).FpFd)
(*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods = uintptr(0)
}
sqlite3.Xsqlite3_free(tls, p)
@@ -64137,20 +68888,20 @@ func vlogDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* test_osinst.c:924:12
}
// Open a new vfslog cursor.
-func vlogOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_osinst.c:937:12: */
+func vlogOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_osinst.c:937:12: */
var pCsr uintptr // Newly allocated cursor object
pCsr = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(VfslogCsr{})))
if !(pCsr != 0) {
return 7
}
- crt.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(VfslogCsr{})))
+ libc.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(VfslogCsr{})))
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCsr /* &.base */)
return 0
}
// Close a vfslog cursor.
-func vlogClose(tls *crt.TLS, pCursor uintptr) int32 { /* test_osinst.c:950:12: */
+func vlogClose(tls *libc.TLS, pCursor uintptr) int32 { /* test_osinst.c:950:12: */
var p uintptr = pCursor
var i int32
for i = 0; i < (*VfslogCsr)(unsafe.Pointer(p)).FnFile; i++ {
@@ -64163,7 +68914,7 @@ func vlogClose(tls *crt.TLS, pCursor uintptr) int32 { /* test_osinst.c:950:12: *
}
// Move a vfslog cursor to the next entry in the file.
-func vlogNext(tls *crt.TLS, pCursor uintptr) int32 { /* test_osinst.c:965:12: */
+func vlogNext(tls *libc.TLS, pCursor uintptr) int32 { /* test_osinst.c:965:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -64178,19 +68929,19 @@ func vlogNext(tls *crt.TLS, pCursor uintptr) int32 { /* test_osinst.c:965:12: */
nRead = 24
if ((*VfslogCsr)(unsafe.Pointer(pCsr)).FiOffset + sqlite3_int64(nRead)) <= (*VfslogVtab)(unsafe.Pointer(p)).FnByte {
var eEvent int32
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods + 16 /* &.xRead */))))(tls, (*VfslogVtab)(unsafe.Pointer(p)).FpFd, pCsr+48 /* &.aBuf */, nRead, (*VfslogCsr)(unsafe.Pointer(pCsr)).FiOffset)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods + 16 /* &.xRead */))))(tls, (*VfslogVtab)(unsafe.Pointer(p)).FpFd, pCsr+48 /* &.aBuf */, nRead, (*VfslogCsr)(unsafe.Pointer(pCsr)).FiOffset)
eEvent = int32(get32bits(tls, pCsr+48 /* &.aBuf */))
if (rc == 0) &&
(((eEvent == 12) || (eEvent == 5)) || (eEvent == 1)) {
// var buf [4]int8 at bp, 4
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods + 16 /* &.xRead */))))(tls, (*VfslogVtab)(unsafe.Pointer(p)).FpFd, bp /* &buf[0] */, 4, ((*VfslogCsr)(unsafe.Pointer(pCsr)).FiOffset + sqlite3_int64(nRead)))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods + 16 /* &.xRead */))))(tls, (*VfslogVtab)(unsafe.Pointer(p)).FpFd, bp /* &buf[0] */, 4, ((*VfslogCsr)(unsafe.Pointer(pCsr)).FiOffset + sqlite3_int64(nRead)))
nRead = nRead + (4)
if rc == 0 {
var nStr int32 = int32(get32bits(tls, bp /* buf */))
var zStr uintptr = sqlite3.Xsqlite3_malloc(tls, (nStr + 1))
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods + 16 /* &.xRead */))))(tls, (*VfslogVtab)(unsafe.Pointer(p)).FpFd, zStr, nStr, ((*VfslogCsr)(unsafe.Pointer(pCsr)).FiOffset + sqlite3_int64(nRead)))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer((*VfslogVtab)(unsafe.Pointer(p)).FpFd)).FpMethods + 16 /* &.xRead */))))(tls, (*VfslogVtab)(unsafe.Pointer(p)).FpFd, zStr, nStr, ((*VfslogCsr)(unsafe.Pointer(pCsr)).FiOffset + sqlite3_int64(nRead)))
*(*int8)(unsafe.Pointer(zStr + uintptr(nStr))) = int8(0)
nRead = nRead + (nStr)
@@ -64200,7 +68951,7 @@ func vlogNext(tls *crt.TLS, pCursor uintptr) int32 { /* test_osinst.c:965:12: */
var nNew int32 = (int32(uint64(unsafe.Sizeof(uintptr(0))) * (uint64(iFileid + 1))))
(*VfslogCsr)(unsafe.Pointer(pCsr)).FazFile = sqlite3.Xsqlite3_realloc(tls, (*VfslogCsr)(unsafe.Pointer(pCsr)).FazFile, nNew)
nNew = int32(uint64(nNew) - (uint64(unsafe.Sizeof(uintptr(0))) * uint64((*VfslogCsr)(unsafe.Pointer(pCsr)).FnFile)))
- crt.Xmemset(tls, ((*VfslogCsr)(unsafe.Pointer(pCsr)).FazFile + uintptr((*VfslogCsr)(unsafe.Pointer(pCsr)).FnFile)*8), 0, uint64(nNew))
+ libc.Xmemset(tls, ((*VfslogCsr)(unsafe.Pointer(pCsr)).FazFile + uintptr((*VfslogCsr)(unsafe.Pointer(pCsr)).FnFile)*8), 0, uint64(nNew))
(*VfslogCsr)(unsafe.Pointer(pCsr)).FnFile = (iFileid + 1)
}
sqlite3.Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*VfslogCsr)(unsafe.Pointer(pCsr)).FazFile + uintptr(iFileid)*8)))
@@ -64217,20 +68968,20 @@ func vlogNext(tls *crt.TLS, pCursor uintptr) int32 { /* test_osinst.c:965:12: */
return rc
}
-func vlogEof(tls *crt.TLS, pCursor uintptr) int32 { /* test_osinst.c:1016:12: */
+func vlogEof(tls *libc.TLS, pCursor uintptr) int32 { /* test_osinst.c:1016:12: */
var pCsr uintptr = pCursor
var p uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
- return (crt.Bool32((*VfslogCsr)(unsafe.Pointer(pCsr)).FiOffset >= (*VfslogVtab)(unsafe.Pointer(p)).FnByte))
+ return (libc.Bool32((*VfslogCsr)(unsafe.Pointer(pCsr)).FiOffset >= (*VfslogVtab)(unsafe.Pointer(p)).FnByte))
}
-func vlogFilter(tls *crt.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_osinst.c:1022:12: */
+func vlogFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_osinst.c:1022:12: */
var pCsr uintptr = pCursor
(*VfslogCsr)(unsafe.Pointer(pCsr)).FiRowid = int64(0)
(*VfslogCsr)(unsafe.Pointer(pCsr)).FiOffset = int64(20)
return vlogNext(tls, pCursor)
}
-func vlogColumn(tls *crt.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /* test_osinst.c:1033:12: */
+func vlogColumn(tls *libc.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /* test_osinst.c:1033:12: */
var val uint32
var pCsr uintptr = pCursor
@@ -64248,7 +68999,7 @@ func vlogColumn(tls *crt.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /*
if (val != uint32(0)) && (val < uint32((*VfslogCsr)(unsafe.Pointer(pCsr)).FnFile)) {
zStr = *(*uintptr)(unsafe.Pointer((*VfslogCsr)(unsafe.Pointer(pCsr)).FazFile + uintptr(val)*8))
}
- sqlite3.Xsqlite3_result_text(tls, ctx, zStr, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, zStr, -1, libc.UintptrFromInt32(-1))
break
}
default:
@@ -64259,15 +69010,15 @@ func vlogColumn(tls *crt.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /*
return 0
}
-func vlogRowid(tls *crt.TLS, pCursor uintptr, pRowid uintptr) int32 { /* test_osinst.c:1065:12: */
+func vlogRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* test_osinst.c:1065:12: */
var pCsr uintptr = pCursor
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = (*VfslogCsr)(unsafe.Pointer(pCsr)).FiRowid
return 0
}
-func sqlite3_vfslog_register(tls *crt.TLS, db uintptr) int32 { /* test_osinst.c:1071:5: */
+func sqlite3_vfslog_register(tls *libc.TLS, db uintptr) int32 { /* test_osinst.c:1071:5: */
- sqlite3.Xsqlite3_create_module(tls, db, ts+32610 /* "vfslog" */, uintptr(unsafe.Pointer(&vfslog_module)), uintptr(0))
+ sqlite3.Xsqlite3_create_module(tls, db, ts+34675 /* "vfslog" */, uintptr(unsafe.Pointer(&vfslog_module)), uintptr(0))
return 0
}
@@ -64301,7 +69052,7 @@ uintptr(0), // xRename
// fill-column: 78
// End:
-func test_vfslog(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_osinst.c:1116:26: */
+func test_vfslog(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_osinst.c:1116:26: */
bp := tls.Alloc(144)
defer tls.Free(144)
@@ -64312,7 +69063,7 @@ func test_vfslog(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
// var iSub int32 at bp+72, 4
if objc < 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29799 /* "SUB-COMMAND ..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31891 /* "SUB-COMMAND ..." */)
return 1
}
if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), uintptr(unsafe.Pointer(&strs)), int32(unsafe.Sizeof(uintptr(0))), ts+1874 /* "sub-command" */, 0, bp+72 /* &iSub */) != 0 {
@@ -64325,14 +69076,14 @@ func test_vfslog(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
var zVfs uintptr
var zMsg uintptr
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 3, objv, ts+32617 /* "VFS" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 3, objv, ts+34682 /* "VFS" */)
return 1
}
zVfs = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
zMsg = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)))
rc = sqlite3_vfslog_annotate(tls, zVfs, zMsg)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+32621 /* "failed" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+34686 /* "failed" */, 0))
return 1
}
break
@@ -64341,13 +69092,13 @@ func test_vfslog(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
{
var zVfs uintptr
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+32617 /* "VFS" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+34682 /* "VFS" */)
return 1
}
zVfs = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
rc = sqlite3_vfslog_finalize(tls, zVfs)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+16, ts+32621 /* "failed" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+16, ts+34686 /* "failed" */, 0))
return 1
}
break
@@ -64359,7 +69110,7 @@ func test_vfslog(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
var zParent uintptr
var zLog uintptr
if objc != 5 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+32628 /* "VFS PARENT LOGFI..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+34693 /* "VFS PARENT LOGFI..." */)
return 1
}
zVfs = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
@@ -64370,7 +69121,7 @@ func test_vfslog(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
}
rc = sqlite3_vfslog_new(tls, zVfs, zParent, zLog)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+32, ts+32621 /* "failed" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+32, ts+34686 /* "failed" */, 0))
return 1
}
break
@@ -64389,7 +69140,7 @@ func test_vfslog(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
rc = sqlite3_vfslog_register(tls, db)
}
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, ts+32647 /* "bad sqlite3 hand..." */, zDb, uintptr(0)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+34712 /* "bad sqlite3 hand..." */, zDb, uintptr(0)))
return 1
}
break
@@ -64399,11 +69150,11 @@ func test_vfslog(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, o
return 0
}
-var strs = [5]uintptr{ts + 32668 /* "annotate" */, ts + 32677 /* "finalize" */, ts + 32686 /* "new" */, ts + 32690 /* "register" */, uintptr(0)} /* test_osinst.c:1127:21 */
+var strs = [5]uintptr{ts + 34733 /* "annotate" */, ts + 34742 /* "finalize" */, ts + 13511 /* "new" */, ts + 34751 /* "register" */, uintptr(0)} /* test_osinst.c:1127:21 */
-func SqlitetestOsinst_Init(tls *crt.TLS, interp uintptr) int32 { /* test_osinst.c:1219:5: */
- tcl.XTcl_CreateObjCommand(tls, interp, ts+32610 /* "vfslog" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+func SqlitetestOsinst_Init(tls *libc.TLS, interp uintptr) int32 { /* test_osinst.c:1219:5: */
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+34675 /* "vfslog" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_vfslog})), uintptr(0), uintptr(0))
return 0
}
@@ -64527,7 +69278,7 @@ var testpcacheGlobal testpcacheGlobalType /* test_pcache.c:41:29: */
// from a failed initialization attempt. It also verifies that the
// the destructor always gets call - otherwise there would be a
// memory leak.
-func testpcacheInit(tls *crt.TLS, pArg uintptr) int32 { /* test_pcache.c:53:12: */
+func testpcacheInit(tls *libc.TLS, pArg uintptr) int32 { /* test_pcache.c:53:12: */
testpcacheGlobal.FpDummy = sqlite3.Xsqlite3_malloc(tls, 10)
if testpcacheGlobal.FpDummy == uintptr(0) {
@@ -64540,7 +69291,7 @@ func testpcacheInit(tls *crt.TLS, pArg uintptr) int32 { /* test_pcache.c:53:12:
//
// Verify that this is only called after initialization.
// Free the memory allocated by the initializer.
-func testpcacheShutdown(tls *crt.TLS, pArg uintptr) { /* test_pcache.c:67:13: */
+func testpcacheShutdown(tls *libc.TLS, pArg uintptr) { /* test_pcache.c:67:13: */
sqlite3.Xsqlite3_free(tls, testpcacheGlobal.FpDummy)
testpcacheGlobal.FpDummy = uintptr(0)
@@ -64591,7 +69342,7 @@ type testpcachePage = struct {
}
// Get a random number using the PRNG in the given page cache.
-func testpcacheRandom(tls *crt.TLS, p uintptr) uint32 { /* test_pcache.c:119:17: */
+func testpcacheRandom(tls *libc.TLS, p uintptr) uint32 { /* test_pcache.c:119:17: */
var x uint32 = uint32(0)
var i int32
for i = 0; i < 4; i++ {
@@ -64602,13 +69353,13 @@ func testpcacheRandom(tls *crt.TLS, p uintptr) uint32 { /* test_pcache.c:119:17:
}
// Allocate a new page cache instance.
-func testpcacheCreate(tls *crt.TLS, szPage int32, szExtra int32, bPurgeable int32) uintptr { /* test_pcache.c:133:23: */
+func testpcacheCreate(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) uintptr { /* test_pcache.c:133:23: */
var nMem int32
var x uintptr
var p uintptr
var i int32
- szPage = ((szPage + 7) & ^int32(crt.Int32FromInt32(7)))
+ szPage = ((szPage + 7) & ^int32(libc.Int32FromInt32(7)))
nMem = (int32(uint64(unsafe.Sizeof(testpcache{})) + (uint64(217 * (szPage + szExtra)))))
p = sqlite3.Xsqlite3_malloc(tls, nMem)
if p == uintptr(0) {
@@ -64646,7 +69397,7 @@ __3:
}
// Set the cache size
-func testpcacheCachesize(tls *crt.TLS, pCache uintptr, newSize int32) { /* test_pcache.c:168:13: */
+func testpcacheCachesize(tls *libc.TLS, pCache uintptr, newSize int32) { /* test_pcache.c:168:13: */
var p uintptr = pCache
_ = p
@@ -64654,14 +69405,14 @@ func testpcacheCachesize(tls *crt.TLS, pCache uintptr, newSize int32) { /* test_
// Return the number of pages in the cache that are being used.
// This includes both pinned and unpinned pages.
-func testpcachePagecount(tls *crt.TLS, pCache uintptr) int32 { /* test_pcache.c:179:12: */
+func testpcachePagecount(tls *libc.TLS, pCache uintptr) int32 { /* test_pcache.c:179:12: */
var p uintptr = pCache
return (217 - (*testpcache)(unsafe.Pointer(p)).FnFree)
}
// Fetch a page.
-func testpcacheFetch(tls *crt.TLS, pCache uintptr, key uint32, createFlag int32) uintptr { /* test_pcache.c:190:28: */
+func testpcacheFetch(tls *libc.TLS, pCache uintptr, key uint32, createFlag int32) uintptr { /* test_pcache.c:190:28: */
var p uintptr = pCache
var i int32
var j int32
@@ -64714,8 +69465,8 @@ func testpcacheFetch(tls *crt.TLS, pCache uintptr, key uint32, createFlag int32)
if (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(j)*24)).Fkey == uint32(0) {
(*testpcachePage)(unsafe.Pointer((p + 32 /* &.a */) + uintptr(j)*24)).Fkey = key
(*testpcachePage)(unsafe.Pointer((p + 32 /* &.a */) + uintptr(j)*24)).FisPinned = 1
- crt.Xmemset(tls, (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(j)*24)).Fpage.FpBuf, 0, uint64((*testpcache)(unsafe.Pointer(p)).FszPage))
- crt.Xmemset(tls, (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(j)*24)).Fpage.FpExtra, 0, uint64((*testpcache)(unsafe.Pointer(p)).FszExtra))
+ libc.Xmemset(tls, (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(j)*24)).Fpage.FpBuf, 0, uint64((*testpcache)(unsafe.Pointer(p)).FszPage))
+ libc.Xmemset(tls, (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(j)*24)).Fpage.FpExtra, 0, uint64((*testpcache)(unsafe.Pointer(p)).FszExtra))
(*testpcache)(unsafe.Pointer(p)).FnPinned++
(*testpcache)(unsafe.Pointer(p)).FnFree--
@@ -64750,8 +69501,8 @@ __4:
if ((*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(j)*24)).Fkey > uint32(0)) && ((*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(j)*24)).FisPinned == 0) {
(*testpcachePage)(unsafe.Pointer((p + 32 /* &.a */) + uintptr(j)*24)).Fkey = key
(*testpcachePage)(unsafe.Pointer((p + 32 /* &.a */) + uintptr(j)*24)).FisPinned = 1
- crt.Xmemset(tls, (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(j)*24)).Fpage.FpBuf, 0, uint64((*testpcache)(unsafe.Pointer(p)).FszPage))
- crt.Xmemset(tls, (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(j)*24)).Fpage.FpExtra, 0, uint64((*testpcache)(unsafe.Pointer(p)).FszExtra))
+ libc.Xmemset(tls, (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(j)*24)).Fpage.FpBuf, 0, uint64((*testpcache)(unsafe.Pointer(p)).FszPage))
+ libc.Xmemset(tls, (*testpcachePage)(unsafe.Pointer((p+32 /* &.a */)+uintptr(j)*24)).Fpage.FpExtra, 0, uint64((*testpcache)(unsafe.Pointer(p)).FszExtra))
(*testpcache)(unsafe.Pointer(p)).FnPinned++
return ((p + 32 /* &.a */) + uintptr(j)*24 /* &.page */)
@@ -64772,7 +69523,7 @@ __6:
}
// Unpin a page.
-func testpcacheUnpin(tls *crt.TLS, pCache uintptr, pOldPage uintptr, discard int32) { /* test_pcache.c:289:13: */
+func testpcacheUnpin(tls *libc.TLS, pCache uintptr, pOldPage uintptr, discard int32) { /* test_pcache.c:289:13: */
var p uintptr = pCache
var i int32
@@ -64804,7 +69555,7 @@ func testpcacheUnpin(tls *crt.TLS, pCache uintptr, pOldPage uintptr, discard int
}
// Rekey a single page.
-func testpcacheRekey(tls *crt.TLS, pCache uintptr, pOldPage uintptr, oldKey uint32, newKey uint32) { /* test_pcache.c:334:13: */
+func testpcacheRekey(tls *libc.TLS, pCache uintptr, pOldPage uintptr, oldKey uint32, newKey uint32) { /* test_pcache.c:334:13: */
var p uintptr = pCache
var i int32
@@ -64839,7 +69590,7 @@ func testpcacheRekey(tls *crt.TLS, pCache uintptr, pOldPage uintptr, oldKey uint
// Truncate the page cache. Every page with a key of iLimit or larger
// is discarded.
-func testpcacheTruncate(tls *crt.TLS, pCache uintptr, iLimit uint32) { /* test_pcache.c:382:13: */
+func testpcacheTruncate(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* test_pcache.c:382:13: */
var p uintptr = pCache
var i uint32
@@ -64855,7 +69606,7 @@ func testpcacheTruncate(tls *crt.TLS, pCache uintptr, iLimit uint32) { /* test_p
}
// Destroy a page cache.
-func testpcacheDestroy(tls *crt.TLS, pCache uintptr) { /* test_pcache.c:404:13: */
+func testpcacheDestroy(tls *libc.TLS, pCache uintptr) { /* test_pcache.c:404:13: */
var p uintptr = pCache
(*testpcache)(unsafe.Pointer(p)).FiMagic = 0xd42670d4
@@ -64873,7 +69624,7 @@ func testpcacheDestroy(tls *crt.TLS, pCache uintptr) { /* test_pcache.c:404:13:
// indicates the probability of discarding a page when unpinning the
// page. 0 means never discard (unless the discard flag is set).
// 100 means always discard.
-func installTestPCache(tls *crt.TLS, installFlag int32, discardChance uint32, prngSeed uint32, highStress uint32) { /* test_pcache.c:427:6: */
+func installTestPCache(tls *libc.TLS, installFlag int32, discardChance uint32, prngSeed uint32, highStress uint32) { /* test_pcache.c:427:6: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -64882,12 +69633,12 @@ func installTestPCache(tls *crt.TLS, installFlag int32, discardChance uint32, pr
testpcacheGlobal.FhighStress = highStress
if installFlag != isInstalled {
if installFlag != 0 {
- sqlite3.Xsqlite3_config(tls, 19, crt.VaList(bp, uintptr(unsafe.Pointer(&defaultPcache))))
+ sqlite3.Xsqlite3_config(tls, 19, libc.VaList(bp, uintptr(unsafe.Pointer(&defaultPcache))))
- sqlite3.Xsqlite3_config(tls, 18, crt.VaList(bp+8, uintptr(unsafe.Pointer(&testPcache))))
+ sqlite3.Xsqlite3_config(tls, 18, libc.VaList(bp+8, uintptr(unsafe.Pointer(&testPcache))))
} else {
- sqlite3.Xsqlite3_config(tls, 18, crt.VaList(bp+16, uintptr(unsafe.Pointer(&defaultPcache))))
+ sqlite3.Xsqlite3_config(tls, 18, libc.VaList(bp+16, uintptr(unsafe.Pointer(&defaultPcache))))
}
isInstalled = installFlag
}
@@ -64974,15 +69725,15 @@ var gQuota struct {
//************************ Utility Routines ********************************
// Acquire and release the mutex used to serialize access to the
// list of quotaGroups.
-func quotaEnter(tls *crt.TLS) { /* test_quota.c:190:13: */
+func quotaEnter(tls *libc.TLS) { /* test_quota.c:190:13: */
sqlite3.Xsqlite3_mutex_enter(tls, gQuota.FpMutex)
}
-func quotaLeave(tls *crt.TLS) { /* test_quota.c:191:13: */
+func quotaLeave(tls *libc.TLS) { /* test_quota.c:191:13: */
sqlite3.Xsqlite3_mutex_leave(tls, gQuota.FpMutex)
}
// Count the number of open files in a quotaGroup
-func quotaGroupOpenFileCount(tls *crt.TLS, pGroup uintptr) int32 { /* test_quota.c:195:12: */
+func quotaGroupOpenFileCount(tls *libc.TLS, pGroup uintptr) int32 { /* test_quota.c:195:12: */
var N int32 = 0
var pFile uintptr = (*quotaGroup)(unsafe.Pointer(pGroup)).FpFiles
for pFile != 0 {
@@ -64995,7 +69746,7 @@ func quotaGroupOpenFileCount(tls *crt.TLS, pGroup uintptr) int32 { /* test_quota
}
// Remove a file from a quota group.
-func quotaRemoveFile(tls *crt.TLS, pFile uintptr) { /* test_quota.c:207:13: */
+func quotaRemoveFile(tls *libc.TLS, pFile uintptr) { /* test_quota.c:207:13: */
var pGroup uintptr = (*quotaFile)(unsafe.Pointer(pFile)).FpGroup
*(*sqlite3_int64)(unsafe.Pointer(pGroup + 16 /* &.iSize */)) -= ((*quotaFile)(unsafe.Pointer(pFile)).FiSize)
*(*uintptr)(unsafe.Pointer((*quotaFile)(unsafe.Pointer(pFile)).FppPrev)) = (*quotaFile)(unsafe.Pointer(pFile)).FpNext
@@ -65007,7 +69758,7 @@ func quotaRemoveFile(tls *crt.TLS, pFile uintptr) { /* test_quota.c:207:13: */
// Remove all files from a quota group. It is always the case that
// all files will be closed when this routine is called.
-func quotaRemoveAllFiles(tls *crt.TLS, pGroup uintptr) { /* test_quota.c:218:13: */
+func quotaRemoveAllFiles(tls *libc.TLS, pGroup uintptr) { /* test_quota.c:218:13: */
for (*quotaGroup)(unsafe.Pointer(pGroup)).FpFiles != 0 {
quotaRemoveFile(tls, (*quotaGroup)(unsafe.Pointer(pGroup)).FpFiles)
@@ -65016,7 +69767,7 @@ func quotaRemoveAllFiles(tls *crt.TLS, pGroup uintptr) { /* test_quota.c:218:13:
// If the reference count and threshold for a quotaGroup are both
// zero, then destroy the quotaGroup.
-func quotaGroupDeref(tls *crt.TLS, pGroup uintptr) { /* test_quota.c:229:13: */
+func quotaGroupDeref(tls *libc.TLS, pGroup uintptr) { /* test_quota.c:229:13: */
if ((*quotaGroup)(unsafe.Pointer(pGroup)).FiLimit == int64(0)) && (quotaGroupOpenFileCount(tls, pGroup) == 0) {
quotaRemoveAllFiles(tls, pGroup)
*(*uintptr)(unsafe.Pointer((*quotaGroup)(unsafe.Pointer(pGroup)).FppPrev)) = (*quotaGroup)(unsafe.Pointer(pGroup)).FpNext
@@ -65024,7 +69775,7 @@ func quotaGroupDeref(tls *crt.TLS, pGroup uintptr) { /* test_quota.c:229:13: */
(*quotaGroup)(unsafe.Pointer((*quotaGroup)(unsafe.Pointer(pGroup)).FpNext)).FppPrev = (*quotaGroup)(unsafe.Pointer(pGroup)).FppPrev
}
if (*quotaGroup)(unsafe.Pointer(pGroup)).FxDestroy != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pGroup + 40 /* &.xDestroy */))))(tls, (*quotaGroup)(unsafe.Pointer(pGroup)).FpArg)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pGroup + 40 /* &.xDestroy */))))(tls, (*quotaGroup)(unsafe.Pointer(pGroup)).FpArg)
}
sqlite3.Xsqlite3_free(tls, pGroup)
}
@@ -65045,17 +69796,17 @@ func quotaGroupDeref(tls *crt.TLS, pGroup uintptr) { /* test_quota.c:229:13: */
//
// / Matches "/" or "\\"
//
-func quotaStrglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* test_quota.c:256:12: */
+func quotaStrglob(tls *libc.TLS, zGlob uintptr, z uintptr) int32 { /* test_quota.c:256:12: */
var c int32
var c2 int32
var cx int32
var invert int32
var seen int32
- for (crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1)))))) != 0 {
+ for (libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) != 0 {
if c == '*' {
- for ((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') {
- if (c == '?') && ((int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) == 0) {
+ for ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1)))))) == '*') || (c == '?') {
+ if (c == '?') && ((int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0) {
return 0
}
}
@@ -65065,16 +69816,16 @@ func quotaStrglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* test_quota.
for (*(*int8)(unsafe.Pointer(z)) != 0) && (quotaStrglob(tls, (zGlob-uintptr(1)), z) == 0) {
z++
}
- return (crt.Bool32((int32(*(*int8)(unsafe.Pointer(z)))) != 0))
+ return (libc.Bool32((int32(*(*int8)(unsafe.Pointer(z)))) != 0))
}
if c == '/' {
cx = '\\'
} else {
cx = c
}
- for (crt.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1)))))) != 0 {
+ for (libc.AssignInt32(&c2, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))) != 0 {
for (c2 != c) && (c2 != cx) {
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
if c2 == 0 {
return 0
}
@@ -65085,31 +69836,31 @@ func quotaStrglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* test_quota.
}
return 0
} else if c == '?' {
- if (int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) == 0 {
+ if (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) == 0 {
return 0
}
} else if c == '[' {
var prior_c int32 = 0
seen = 0
invert = 0
- c = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))
+ c = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))
if c == 0 {
return 0
}
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
if c2 == '^' {
invert = 1
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
}
if c2 == ']' {
if c == ']' {
seen = 1
}
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
}
for (c2 != 0) && (c2 != ']') {
if (((c2 == '-') && (int32(*(*int8)(unsafe.Pointer(zGlob + uintptr(0)))) != ']')) && (int32(*(*int8)(unsafe.Pointer(zGlob + uintptr(0)))) != 0)) && (prior_c > 0) {
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
if (c >= prior_c) && (c <= c2) {
seen = 1
}
@@ -65120,7 +69871,7 @@ func quotaStrglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* test_quota.
}
prior_c = c2
}
- c2 = int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zGlob, 1))))
+ c2 = int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zGlob, 1))))
}
if (c2 == 0) || ((seen ^ invert) == 0) {
return 0
@@ -65131,18 +69882,18 @@ func quotaStrglob(tls *crt.TLS, zGlob uintptr, z uintptr) int32 { /* test_quota.
}
z++
} else {
- if c != (int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) {
+ if c != (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) {
return 0
}
}
}
- return (crt.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0))
+ return (libc.Bool32(int32(*(*int8)(unsafe.Pointer(z))) == 0))
}
// Find a quotaGroup given the filename.
//
// Return a pointer to the quotaGroup object. Return NULL if not found.
-func quotaGroupFind(tls *crt.TLS, zFilename uintptr) uintptr { /* test_quota.c:329:19: */
+func quotaGroupFind(tls *libc.TLS, zFilename uintptr) uintptr { /* test_quota.c:329:19: */
var p uintptr
for p = gQuota.FpGroup; (p != 0) && (quotaStrglob(tls, (*quotaGroup)(unsafe.Pointer(p)).FzPattern, zFilename) == 0); p = (*quotaGroup)(unsafe.Pointer(p)).FpNext {
}
@@ -65151,25 +69902,25 @@ func quotaGroupFind(tls *crt.TLS, zFilename uintptr) uintptr { /* test_quota.c:3
// Translate an sqlite3_file* that is really a quotaConn* into
// the sqlite3_file* for the underlying original VFS.
-func quotaSubOpen(tls *crt.TLS, pConn uintptr) uintptr { /* test_quota.c:339:21: */
+func quotaSubOpen(tls *libc.TLS, pConn uintptr) uintptr { /* test_quota.c:339:21: */
var p uintptr = pConn
return (p + uintptr(1)*16)
}
// Find a file in a quota group and return a pointer to that file.
// Return NULL if the file is not in the group.
-func quotaFindFile(tls *crt.TLS, pGroup uintptr, zName uintptr, createFlag int32) uintptr { /* test_quota.c:347:18: */
+func quotaFindFile(tls *libc.TLS, pGroup uintptr, zName uintptr, createFlag int32) uintptr { /* test_quota.c:347:18: */
var pFile uintptr = (*quotaGroup)(unsafe.Pointer(pGroup)).FpFiles
- for (pFile != 0) && (crt.Xstrcmp(tls, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, zName) != 0) {
+ for (pFile != 0) && (libc.Xstrcmp(tls, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, zName) != 0) {
pFile = (*quotaFile)(unsafe.Pointer(pFile)).FpNext
}
if (pFile == uintptr(0)) && (createFlag != 0) {
- var nName int32 = (int32(crt.Xstrlen(tls, zName) & uint64(0x3fffffff)))
+ var nName int32 = (int32(libc.Xstrlen(tls, zName) & uint64(0x3fffffff)))
pFile = sqlite3.Xsqlite3_malloc(tls, (int32((uint64(unsafe.Sizeof(quotaFile{})) + uint64(nName)) + uint64(1))))
if pFile != 0 {
- crt.Xmemset(tls, pFile, 0, uint64(unsafe.Sizeof(quotaFile{})))
+ libc.Xmemset(tls, pFile, 0, uint64(unsafe.Sizeof(quotaFile{})))
(*quotaFile)(unsafe.Pointer(pFile)).FzFilename = (pFile + uintptr(1)*48)
- crt.Xmemcpy(tls, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, zName, (uint64(nName + 1)))
+ libc.Xmemcpy(tls, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, zName, (uint64(nName + 1)))
(*quotaFile)(unsafe.Pointer(pFile)).FpNext = (*quotaGroup)(unsafe.Pointer(pGroup)).FpFiles
if (*quotaGroup)(unsafe.Pointer(pGroup)).FpFiles != 0 {
(*quotaFile)(unsafe.Pointer((*quotaGroup)(unsafe.Pointer(pGroup)).FpFiles)).FppPrev = (pFile + 32 /* &.pNext */)
@@ -65185,12 +69936,12 @@ func quotaFindFile(tls *crt.TLS, pGroup uintptr, zName uintptr, createFlag int32
// Translate UTF8 to MBCS for use in fopen() calls. Return a pointer to the
// translated text.. Call quota_mbcs_free() to deallocate any memory
// used to store the returned pointer when done.
-func quota_utf8_to_mbcs(tls *crt.TLS, zUtf8 uintptr) uintptr { /* test_quota.c:377:13: */
+func quota_utf8_to_mbcs(tls *libc.TLS, zUtf8 uintptr) uintptr { /* test_quota.c:377:13: */
return zUtf8 // No-op on unix
}
// Deallocate any memory allocated by quota_utf8_to_mbcs().
-func quota_mbcs_free(tls *crt.TLS, zOld uintptr) { /* test_quota.c:408:13: */
+func quota_mbcs_free(tls *libc.TLS, zOld uintptr) { /* test_quota.c:408:13: */
// No-op on unix
}
@@ -65200,7 +69951,7 @@ func quota_mbcs_free(tls *crt.TLS, zOld uintptr) { /* test_quota.c:408:13: */
// Most of the work is done by the underlying original VFS. This method
// simply links the new file into the appropriate quota group if it is a
// file that needs to be tracked.
-func quotaOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, flags int32, pOutFlags uintptr) int32 { /* test_quota.c:424:12: */
+func quotaOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pConn uintptr, flags int32, pOutFlags uintptr) int32 { /* test_quota.c:424:12: */
var rc int32 // Result code
var pQuotaOpen uintptr // The new quota file descriptor
var pFile uintptr // Corresponding quotaFile obj
@@ -65211,7 +69962,7 @@ func quotaOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, flags i
// If the file is not a main database file or a WAL, then use the
// normal xOpen method.
if (flags & (0x00000100 | 0x00080000)) == 0 {
- return (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 40 /* &.xOpen */))))(tls, pOrigVfs, zName, pConn, flags, pOutFlags)
+ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 40 /* &.xOpen */))))(tls, pOrigVfs, zName, pConn, flags, pOutFlags)
}
// If the name of the file does not match any quota group, then
@@ -65219,20 +69970,20 @@ func quotaOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, flags i
quotaEnter(tls)
pGroup = quotaGroupFind(tls, zName)
if pGroup == uintptr(0) {
- rc = (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 40 /* &.xOpen */))))(tls, pOrigVfs, zName, pConn, flags, pOutFlags)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 40 /* &.xOpen */))))(tls, pOrigVfs, zName, pConn, flags, pOutFlags)
} else {
// If we get to this point, it means the file needs to be quota tracked.
pQuotaOpen = pConn
pSubOpen = quotaSubOpen(tls, pConn)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 40 /* &.xOpen */))))(tls, pOrigVfs, zName, pSubOpen, flags, pOutFlags)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pOrigVfs + 40 /* &.xOpen */))))(tls, pOrigVfs, zName, pSubOpen, flags, pOutFlags)
if rc == 0 {
pFile = quotaFindFile(tls, pGroup, zName, 1)
if pFile == uintptr(0) {
quotaLeave(tls)
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 8 /* &.xClose */))))(tls, pSubOpen)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 8 /* &.xClose */))))(tls, pSubOpen)
return 7
}
- (*quotaFile)(unsafe.Pointer(pFile)).FdeleteOnClose = (crt.Bool32((flags & 0x00000008) != 0))
+ (*quotaFile)(unsafe.Pointer(pFile)).FdeleteOnClose = (libc.Bool32((flags & 0x00000008) != 0))
(*quotaFile)(unsafe.Pointer(pFile)).FnRef++
(*quotaConn)(unsafe.Pointer(pQuotaOpen)).FpFile = pFile
if (*sqlite3_io_methods1)(unsafe.Pointer((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods)).FiVersion == 1 {
@@ -65251,14 +70002,14 @@ func quotaOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pConn uintptr, flags i
// If the file being deleted is part of the quota group, then reduce
// the size of the quota group accordingly. And remove the file from
// the set of files in the quota group.
-func quotaDelete(tls *crt.TLS, pVfs uintptr, zName uintptr, syncDir int32) int32 { /* test_quota.c:486:12: */
+func quotaDelete(tls *libc.TLS, pVfs uintptr, zName uintptr, syncDir int32) int32 { /* test_quota.c:486:12: */
var rc int32 // Result code
var pFile uintptr // Files in the quota
var pGroup uintptr // The group file belongs to
var pOrigVfs uintptr = gQuota.FpOrigVfs // Real VFS
// Do the actual file delete
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pOrigVfs + 48 /* &.xDelete */))))(tls, pOrigVfs, zName, syncDir)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pOrigVfs + 48 /* &.xDelete */))))(tls, pOrigVfs, zName, syncDir)
// If the file just deleted is a member of a quota group, then remove
// it from that quota group.
@@ -65286,18 +70037,18 @@ func quotaDelete(tls *crt.TLS, pVfs uintptr, zName uintptr, syncDir int32) int32
// xClose requests get passed through to the original VFS. But we
// also have to unlink the quotaConn from the quotaFile and quotaGroup.
// The quotaFile and/or quotaGroup are freed if they are no longer in use.
-func quotaClose(tls *crt.TLS, pConn uintptr) int32 { /* test_quota.c:528:12: */
+func quotaClose(tls *libc.TLS, pConn uintptr) int32 { /* test_quota.c:528:12: */
var p uintptr = pConn
var pFile uintptr = (*quotaConn)(unsafe.Pointer(p)).FpFile
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
var rc int32
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 8 /* &.xClose */))))(tls, pSubOpen)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 8 /* &.xClose */))))(tls, pSubOpen)
quotaEnter(tls)
(*quotaFile)(unsafe.Pointer(pFile)).FnRef--
if (*quotaFile)(unsafe.Pointer(pFile)).FnRef == 0 {
var pGroup uintptr = (*quotaFile)(unsafe.Pointer(pFile)).FpGroup
if (*quotaFile)(unsafe.Pointer(pFile)).FdeleteOnClose != 0 {
- (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((gQuota.FpOrigVfs + 48 /* &.xDelete */))))(tls, gQuota.FpOrigVfs, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, 0)
+ (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((gQuota.FpOrigVfs + 48 /* &.xDelete */))))(tls, gQuota.FpOrigVfs, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, 0)
quotaRemoveFile(tls, pFile)
}
quotaGroupDeref(tls, pGroup)
@@ -65308,15 +70059,15 @@ func quotaClose(tls *crt.TLS, pConn uintptr) int32 { /* test_quota.c:528:12: */
// Pass xRead requests directory thru to the original VFS without
// further processing.
-func quotaRead(tls *crt.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst sqlite3_int64) int32 { /* test_quota.c:551:12: */
+func quotaRead(tls *libc.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst sqlite3_int64) int32 { /* test_quota.c:551:12: */
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 16 /* &.xRead */))))(tls, pSubOpen, pBuf, iAmt, iOfst)
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 16 /* &.xRead */))))(tls, pSubOpen, pBuf, iAmt, iOfst)
}
// Check xWrite requests to see if they expand the file. If they do,
// the perform a quota check before passing them through to the
// original VFS.
-func quotaWrite(tls *crt.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst sqlite3_int64) int32 { /* test_quota.c:565:12: */
+func quotaWrite(tls *libc.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst sqlite3_int64) int32 { /* test_quota.c:565:12: */
var p uintptr = pConn
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
var iEnd sqlite3_int64 = (iOfst + sqlite3_int64(iAmt))
@@ -65330,7 +70081,7 @@ func quotaWrite(tls *crt.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst sql
szNew = (((*quotaGroup)(unsafe.Pointer(pGroup)).FiSize - (*quotaFile)(unsafe.Pointer(pFile)).FiSize) + iEnd)
if (szNew > (*quotaGroup)(unsafe.Pointer(pGroup)).FiLimit) && ((*quotaGroup)(unsafe.Pointer(pGroup)).FiLimit > int64(0)) {
if (*quotaGroup)(unsafe.Pointer(pGroup)).FxCallback != 0 {
- (*(*func(*crt.TLS, uintptr, uintptr, sqlite3_int64, uintptr))(unsafe.Pointer((pGroup + 24 /* &.xCallback */))))(tls, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, (pGroup + 8 /* &.iLimit */), szNew,
+ (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_int64, uintptr))(unsafe.Pointer((pGroup + 24 /* &.xCallback */))))(tls, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, (pGroup + 8 /* &.iLimit */), szNew,
(*quotaGroup)(unsafe.Pointer(pGroup)).FpArg)
}
if (szNew > (*quotaGroup)(unsafe.Pointer(pGroup)).FiLimit) && ((*quotaGroup)(unsafe.Pointer(pGroup)).FiLimit > int64(0)) {
@@ -65342,15 +70093,15 @@ func quotaWrite(tls *crt.TLS, pConn uintptr, pBuf uintptr, iAmt int32, iOfst sql
(*quotaFile)(unsafe.Pointer(pFile)).FiSize = iEnd
quotaLeave(tls)
}
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 24 /* &.xWrite */))))(tls, pSubOpen, pBuf, iAmt, iOfst)
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 24 /* &.xWrite */))))(tls, pSubOpen, pBuf, iAmt, iOfst)
}
// Pass xTruncate requests thru to the original VFS. If the
// success, update the file size.
-func quotaTruncate(tls *crt.TLS, pConn uintptr, size sqlite3_int64) int32 { /* test_quota.c:602:12: */
+func quotaTruncate(tls *libc.TLS, pConn uintptr, size sqlite3_int64) int32 { /* test_quota.c:602:12: */
var p uintptr = pConn
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- var rc int32 = (*(*func(*crt.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 32 /* &.xTruncate */))))(tls, pSubOpen, size)
+ var rc int32 = (*(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 32 /* &.xTruncate */))))(tls, pSubOpen, size)
var pFile uintptr = (*quotaConn)(unsafe.Pointer(p)).FpFile
var pGroup uintptr
if rc == 0 {
@@ -65365,14 +70116,14 @@ func quotaTruncate(tls *crt.TLS, pConn uintptr, size sqlite3_int64) int32 { /* t
}
// Pass xSync requests through to the original VFS without change
-func quotaSync(tls *crt.TLS, pConn uintptr, flags int32) int32 { /* test_quota.c:621:12: */
+func quotaSync(tls *libc.TLS, pConn uintptr, flags int32) int32 { /* test_quota.c:621:12: */
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 40 /* &.xSync */))))(tls, pSubOpen, flags)
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 40 /* &.xSync */))))(tls, pSubOpen, flags)
}
// Pass xFileSize requests through to the original VFS but then
// update the quotaGroup with the new size before returning.
-func quotaFileSize(tls *crt.TLS, pConn uintptr, pSize uintptr) int32 { /* test_quota.c:629:12: */
+func quotaFileSize(tls *libc.TLS, pConn uintptr, pSize uintptr) int32 { /* test_quota.c:629:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -65384,7 +70135,7 @@ func quotaFileSize(tls *crt.TLS, pConn uintptr, pSize uintptr) int32 { /* test_q
var rc int32
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 48 /* &.xFileSize */))))(tls, pSubOpen, bp /* &sz */)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 48 /* &.xFileSize */))))(tls, pSubOpen, bp /* &sz */)
if rc == 0 {
quotaEnter(tls)
pGroup = (*quotaFile)(unsafe.Pointer(pFile)).FpGroup
@@ -65398,70 +70149,70 @@ func quotaFileSize(tls *crt.TLS, pConn uintptr, pSize uintptr) int32 { /* test_q
}
// Pass xLock requests through to the original VFS unchanged.
-func quotaLock(tls *crt.TLS, pConn uintptr, lock int32) int32 { /* test_quota.c:652:12: */
+func quotaLock(tls *libc.TLS, pConn uintptr, lock int32) int32 { /* test_quota.c:652:12: */
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 56 /* &.xLock */))))(tls, pSubOpen, lock)
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 56 /* &.xLock */))))(tls, pSubOpen, lock)
}
// Pass xUnlock requests through to the original VFS unchanged.
-func quotaUnlock(tls *crt.TLS, pConn uintptr, lock int32) int32 { /* test_quota.c:659:12: */
+func quotaUnlock(tls *libc.TLS, pConn uintptr, lock int32) int32 { /* test_quota.c:659:12: */
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 64 /* &.xUnlock */))))(tls, pSubOpen, lock)
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 64 /* &.xUnlock */))))(tls, pSubOpen, lock)
}
// Pass xCheckReservedLock requests through to the original VFS unchanged.
-func quotaCheckReservedLock(tls *crt.TLS, pConn uintptr, pResOut uintptr) int32 { /* test_quota.c:666:12: */
+func quotaCheckReservedLock(tls *libc.TLS, pConn uintptr, pResOut uintptr) int32 { /* test_quota.c:666:12: */
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, pSubOpen, pResOut)
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, pSubOpen, pResOut)
}
// Pass xFileControl requests through to the original VFS unchanged.
-func quotaFileControl(tls *crt.TLS, pConn uintptr, op int32, pArg uintptr) int32 { /* test_quota.c:673:12: */
+func quotaFileControl(tls *libc.TLS, pConn uintptr, op int32, pArg uintptr) int32 { /* test_quota.c:673:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- var rc int32 = (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 80 /* &.xFileControl */))))(tls, pSubOpen, op, pArg)
+ var rc int32 = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 80 /* &.xFileControl */))))(tls, pSubOpen, op, pArg)
if (op == 12) && (rc == 0) {
- *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+32699 /* "quota/%z" */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(pArg))))
+ *(*uintptr)(unsafe.Pointer(pArg)) = sqlite3.Xsqlite3_mprintf(tls, ts+34760 /* "quota/%z" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(pArg))))
}
return rc
}
// Pass xSectorSize requests through to the original VFS unchanged.
-func quotaSectorSize(tls *crt.TLS, pConn uintptr) int32 { /* test_quota.c:686:12: */
+func quotaSectorSize(tls *libc.TLS, pConn uintptr) int32 { /* test_quota.c:686:12: */
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 88 /* &.xSectorSize */))))(tls, pSubOpen)
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 88 /* &.xSectorSize */))))(tls, pSubOpen)
}
// Pass xDeviceCharacteristics requests through to the original VFS unchanged.
-func quotaDeviceCharacteristics(tls *crt.TLS, pConn uintptr) int32 { /* test_quota.c:693:12: */
+func quotaDeviceCharacteristics(tls *libc.TLS, pConn uintptr) int32 { /* test_quota.c:693:12: */
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, pSubOpen)
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, pSubOpen)
}
// Pass xShmMap requests through to the original VFS unchanged.
-func quotaShmMap(tls *crt.TLS, pConn uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) int32 { /* test_quota.c:700:12: */
+func quotaShmMap(tls *libc.TLS, pConn uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) int32 { /* test_quota.c:700:12: */
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- return (*(*func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 104 /* &.xShmMap */))))(tls, pSubOpen, iRegion, szRegion, bExtend, pp)
+ return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 104 /* &.xShmMap */))))(tls, pSubOpen, iRegion, szRegion, bExtend, pp)
}
// Pass xShmLock requests through to the original VFS unchanged.
-func quotaShmLock(tls *crt.TLS, pConn uintptr, ofst int32, n int32, flags int32) int32 { /* test_quota.c:713:12: */
+func quotaShmLock(tls *libc.TLS, pConn uintptr, ofst int32, n int32, flags int32) int32 { /* test_quota.c:713:12: */
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- return (*(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 112 /* &.xShmLock */))))(tls, pSubOpen, ofst, n, flags)
+ return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 112 /* &.xShmLock */))))(tls, pSubOpen, ofst, n, flags)
}
// Pass xShmBarrier requests through to the original VFS unchanged.
-func quotaShmBarrier(tls *crt.TLS, pConn uintptr) { /* test_quota.c:725:13: */
+func quotaShmBarrier(tls *libc.TLS, pConn uintptr) { /* test_quota.c:725:13: */
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 120 /* &.xShmBarrier */))))(tls, pSubOpen)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 120 /* &.xShmBarrier */))))(tls, pSubOpen)
}
// Pass xShmUnmap requests through to the original VFS unchanged.
-func quotaShmUnmap(tls *crt.TLS, pConn uintptr, deleteFlag int32) int32 { /* test_quota.c:732:12: */
+func quotaShmUnmap(tls *libc.TLS, pConn uintptr, deleteFlag int32) int32 { /* test_quota.c:732:12: */
var pSubOpen uintptr = quotaSubOpen(tls, pConn)
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 128 /* &.xShmUnmap */))))(tls, pSubOpen, deleteFlag)
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(pSubOpen)).FpMethods + 128 /* &.xShmUnmap */))))(tls, pSubOpen, deleteFlag)
}
//************************* Public Interfaces ****************************
@@ -65474,7 +70225,7 @@ func quotaShmUnmap(tls *crt.TLS, pConn uintptr, deleteFlag int32) int32 { /* tes
//
// THIS ROUTINE IS NOT THREADSAFE. Call this routine exactly once
// during start-up.
-func sqlite3_quota_initialize(tls *crt.TLS, zOrigVfsName uintptr, makeDefault int32) int32 { /* test_quota.c:749:5: */
+func sqlite3_quota_initialize(tls *libc.TLS, zOrigVfsName uintptr, makeDefault int32) int32 { /* test_quota.c:749:5: */
var pOrigVfs uintptr
if gQuota.FisInitialized != 0 {
return 21
@@ -65492,55 +70243,61 @@ func sqlite3_quota_initialize(tls *crt.TLS, zOrigVfsName uintptr, makeDefault in
gQuota.FpOrigVfs = pOrigVfs
gQuota.FsThisVfs = *(*sqlite3_vfs)(unsafe.Pointer(pOrigVfs))
gQuota.FsThisVfs.FxOpen = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
}{quotaOpen}))
gQuota.FsThisVfs.FxDelete = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, uintptr, int32) int32
}{quotaDelete}))
*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&gQuota)) + 8 /* &.sThisVfs */ + 4 /* &.szOsFile */)) += int32((uint64(unsafe.Sizeof(quotaConn{}))))
- gQuota.FsThisVfs.FzName = ts + 32708 /* "quota" */
+ gQuota.FsThisVfs.FzName = ts + 34769 /* "quota" */
gQuota.FsIoMethodsV1.FiVersion = 1
- gQuota.FsIoMethodsV1.FxClose = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{quotaClose}))
+ gQuota.FsIoMethodsV1.FxClose = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{quotaClose}))
gQuota.FsIoMethodsV1.FxRead = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32
+ f func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32
}{quotaRead}))
gQuota.FsIoMethodsV1.FxWrite = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32
+ f func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32
}{quotaWrite}))
gQuota.FsIoMethodsV1.FxTruncate = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, sqlite3_int64) int32
+ f func(*libc.TLS, uintptr, sqlite3_int64) int32
}{quotaTruncate}))
gQuota.FsIoMethodsV1.FxSync = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{quotaSync}))
gQuota.FsIoMethodsV1.FxFileSize = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{quotaFileSize}))
gQuota.FsIoMethodsV1.FxLock = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{quotaLock}))
gQuota.FsIoMethodsV1.FxUnlock = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{quotaUnlock}))
gQuota.FsIoMethodsV1.FxCheckReservedLock = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{quotaCheckReservedLock}))
gQuota.FsIoMethodsV1.FxFileControl = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr) int32
}{quotaFileControl}))
- gQuota.FsIoMethodsV1.FxSectorSize = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{quotaSectorSize}))
- gQuota.FsIoMethodsV1.FxDeviceCharacteristics = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{quotaDeviceCharacteristics}))
+ gQuota.FsIoMethodsV1.FxSectorSize = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{quotaSectorSize}))
+ gQuota.FsIoMethodsV1.FxDeviceCharacteristics = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{quotaDeviceCharacteristics}))
gQuota.FsIoMethodsV2 = gQuota.FsIoMethodsV1
gQuota.FsIoMethodsV2.FiVersion = 2
gQuota.FsIoMethodsV2.FxShmMap = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32
}{quotaShmMap}))
gQuota.FsIoMethodsV2.FxShmLock = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, int32, int32) int32
+ f func(*libc.TLS, uintptr, int32, int32, int32) int32
}{quotaShmLock}))
- gQuota.FsIoMethodsV2.FxShmBarrier = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{quotaShmBarrier}))
+ gQuota.FsIoMethodsV2.FxShmBarrier = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{quotaShmBarrier}))
gQuota.FsIoMethodsV2.FxShmUnmap = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{quotaShmUnmap}))
sqlite3.Xsqlite3_vfs_register(tls, (uintptr(unsafe.Pointer(&gQuota)) + 8 /* &.sThisVfs */), makeDefault)
return 0
@@ -65553,7 +70310,7 @@ func sqlite3_quota_initialize(tls *crt.TLS, zOrigVfsName uintptr, makeDefault in
//
// THIS ROUTINE IS NOT THREADSAFE. Call this routine exactly once while
// shutting down in order to free all remaining quota groups.
-func sqlite3_quota_shutdown(tls *crt.TLS) int32 { /* test_quota.c:798:5: */
+func sqlite3_quota_shutdown(tls *libc.TLS) int32 { /* test_quota.c:798:5: */
var pGroup uintptr
if gQuota.FisInitialized == 0 {
return 21
@@ -65573,7 +70330,7 @@ func sqlite3_quota_shutdown(tls *crt.TLS) int32 { /* test_quota.c:798:5: */
gQuota.FisInitialized = 0
sqlite3.Xsqlite3_mutex_free(tls, gQuota.FpMutex)
sqlite3.Xsqlite3_vfs_unregister(tls, (uintptr(unsafe.Pointer(&gQuota)) + 8 /* &.sThisVfs */))
- crt.Xmemset(tls, uintptr(unsafe.Pointer(&gQuota)), 0, uint64(unsafe.Sizeof(gQuota)))
+ libc.Xmemset(tls, uintptr(unsafe.Pointer(&gQuota)), 0, uint64(unsafe.Sizeof(gQuota)))
return 0
}
@@ -65595,15 +70352,15 @@ func sqlite3_quota_shutdown(tls *crt.TLS) int32 { /* test_quota.c:798:5: */
// database connections if those connections are to participate in the
// quota group. Creating a quota group does not affect database connections
// that are already open.
-func sqlite3_quota_set(tls *crt.TLS, zPattern uintptr, iLimit sqlite3_int64, xCallback uintptr, pArg uintptr, xDestroy uintptr) int32 { /* test_quota.c:838:5: */
+func sqlite3_quota_set(tls *libc.TLS, zPattern uintptr, iLimit sqlite3_int64, xCallback uintptr, pArg uintptr, xDestroy uintptr) int32 { /* test_quota.c:838:5: */
var pGroup uintptr
quotaEnter(tls)
pGroup = gQuota.FpGroup
- for (pGroup != 0) && (crt.Xstrcmp(tls, (*quotaGroup)(unsafe.Pointer(pGroup)).FzPattern, zPattern) != 0) {
+ for (pGroup != 0) && (libc.Xstrcmp(tls, (*quotaGroup)(unsafe.Pointer(pGroup)).FzPattern, zPattern) != 0) {
pGroup = (*quotaGroup)(unsafe.Pointer(pGroup)).FpNext
}
if pGroup == uintptr(0) {
- var nPattern int32 = (int32(crt.Xstrlen(tls, zPattern) & uint64(0x3fffffff)))
+ var nPattern int32 = (int32(libc.Xstrlen(tls, zPattern) & uint64(0x3fffffff)))
if iLimit <= int64(0) {
quotaLeave(tls)
return 0
@@ -65613,9 +70370,9 @@ func sqlite3_quota_set(tls *crt.TLS, zPattern uintptr, iLimit sqlite3_int64, xCa
quotaLeave(tls)
return 7
}
- crt.Xmemset(tls, pGroup, 0, uint64(unsafe.Sizeof(quotaGroup{})))
+ libc.Xmemset(tls, pGroup, 0, uint64(unsafe.Sizeof(quotaGroup{})))
(*quotaGroup)(unsafe.Pointer(pGroup)).FzPattern = (pGroup + uintptr(1)*72)
- crt.Xmemcpy(tls, (*quotaGroup)(unsafe.Pointer(pGroup)).FzPattern, zPattern, (uint64(nPattern + 1)))
+ libc.Xmemcpy(tls, (*quotaGroup)(unsafe.Pointer(pGroup)).FzPattern, zPattern, (uint64(nPattern + 1)))
if gQuota.FpGroup != 0 {
(*quotaGroup)(unsafe.Pointer(gQuota.FpGroup)).FppPrev = (pGroup + 48 /* &.pNext */)
}
@@ -65626,7 +70383,7 @@ func sqlite3_quota_set(tls *crt.TLS, zPattern uintptr, iLimit sqlite3_int64, xCa
(*quotaGroup)(unsafe.Pointer(pGroup)).FiLimit = iLimit
(*quotaGroup)(unsafe.Pointer(pGroup)).FxCallback = xCallback
if ((*quotaGroup)(unsafe.Pointer(pGroup)).FxDestroy != 0) && ((*quotaGroup)(unsafe.Pointer(pGroup)).FpArg != pArg) {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pGroup + 40 /* &.xDestroy */))))(tls, (*quotaGroup)(unsafe.Pointer(pGroup)).FpArg)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pGroup + 40 /* &.xDestroy */))))(tls, (*quotaGroup)(unsafe.Pointer(pGroup)).FpArg)
}
(*quotaGroup)(unsafe.Pointer(pGroup)).FpArg = pArg
(*quotaGroup)(unsafe.Pointer(pGroup)).FxDestroy = xDestroy
@@ -65637,7 +70394,7 @@ func sqlite3_quota_set(tls *crt.TLS, zPattern uintptr, iLimit sqlite3_int64, xCa
// Bring the named file under quota management. Or if it is already under
// management, update its size.
-func sqlite3_quota_file(tls *crt.TLS, zFilename uintptr) int32 { /* test_quota.c:891:5: */
+func sqlite3_quota_file(tls *libc.TLS, zFilename uintptr) int32 { /* test_quota.c:891:5: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -65655,17 +70412,17 @@ func sqlite3_quota_file(tls *crt.TLS, zFilename uintptr) int32 { /* test_quota.c
rc = 7
} else {
zFull = ((fd) + uintptr(gQuota.FsThisVfs.FszOsFile))
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((gQuota.FpOrigVfs + 64 /* &.xFullPathname */))))(tls, gQuota.FpOrigVfs, zFilename,
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((gQuota.FpOrigVfs + 64 /* &.xFullPathname */))))(tls, gQuota.FpOrigVfs, zFilename,
(gQuota.FsThisVfs.FmxPathname + 1), zFull)
}
if rc == 0 {
- *(*int8)(unsafe.Pointer(zFull + uintptr((crt.Xstrlen(tls, zFull) + uint64(1))))) = int8(0)
+ *(*int8)(unsafe.Pointer(zFull + uintptr((libc.Xstrlen(tls, zFull) + uint64(1))))) = int8(0)
rc = quotaOpen(tls, (uintptr(unsafe.Pointer(&gQuota)) + 8 /* &.sThisVfs */), zFull, fd,
(0x00000001 | 0x00000100), bp /* &outFlags */)
if rc == 0 {
- (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(fd)).FpMethods + 48 /* &.xFileSize */))))(tls, fd, bp+8 /* &iSize */)
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(fd)).FpMethods + 8 /* &.xClose */))))(tls, fd)
+ (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(fd)).FpMethods + 48 /* &.xFileSize */))))(tls, fd, bp+8 /* &iSize */)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(fd)).FpMethods + 8 /* &.xClose */))))(tls, fd)
} else if rc == 14 {
var pGroup uintptr
var pFile uintptr
@@ -65686,7 +70443,7 @@ func sqlite3_quota_file(tls *crt.TLS, zFilename uintptr) int32 { /* test_quota.c
}
// Open a potentially quotaed file for I/O.
-func sqlite3_quota_fopen(tls *crt.TLS, zFilename uintptr, zMode uintptr) uintptr { /* test_quota.c:936:12: */
+func sqlite3_quota_fopen(tls *libc.TLS, zFilename uintptr, zMode uintptr) uintptr { /* test_quota.c:936:12: */
var p uintptr
var zFull uintptr
var zFullTranslated uintptr
@@ -65704,7 +70461,7 @@ func sqlite3_quota_fopen(tls *crt.TLS, zFilename uintptr, zMode uintptr) uintptr
return uintptr(0)
__1:
;
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((gQuota.FpOrigVfs + 64 /* &.xFullPathname */))))(tls, gQuota.FpOrigVfs, zFilename,
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((gQuota.FpOrigVfs + 64 /* &.xFullPathname */))))(tls, gQuota.FpOrigVfs, zFilename,
(gQuota.FsThisVfs.FmxPathname + 1), zFull)
if !(rc != 0) {
goto __2
@@ -65719,7 +70476,7 @@ __2:
goto quota_fopen_error
__3:
;
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(quota_FILE{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(quota_FILE{})))
zFullTranslated = quota_utf8_to_mbcs(tls, zFull)
if !(zFullTranslated == uintptr(0)) {
goto __4
@@ -65727,7 +70484,7 @@ __3:
goto quota_fopen_error
__4:
;
- (*quota_FILE)(unsafe.Pointer(p)).Ff = crt.Xfopen(tls, zFullTranslated, zMode)
+ (*quota_FILE)(unsafe.Pointer(p)).Ff = libc.Xfopen(tls, zFullTranslated, zMode)
if !((*quota_FILE)(unsafe.Pointer(p)).Ff == uintptr(0)) {
goto __5
}
@@ -65761,7 +70518,7 @@ quota_fopen_error:
if !((p != 0) && ((*quota_FILE)(unsafe.Pointer(p)).Ff != 0)) {
goto __8
}
- crt.Xfclose(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff)
+ libc.Xfclose(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff)
__8:
;
sqlite3.Xsqlite3_free(tls, p)
@@ -65769,20 +70526,20 @@ __8:
}
// Read content from a quota_FILE
-func sqlite3_quota_fread(tls *crt.TLS, pBuf uintptr, size size_t, nmemb size_t, p uintptr) size_t { /* test_quota.c:985:8: */
- return crt.Xfread(tls, pBuf, size, nmemb, (*quota_FILE)(unsafe.Pointer(p)).Ff)
+func sqlite3_quota_fread(tls *libc.TLS, pBuf uintptr, size size_t, nmemb size_t, p uintptr) size_t { /* test_quota.c:985:8: */
+ return libc.Xfread(tls, pBuf, size, nmemb, (*quota_FILE)(unsafe.Pointer(p)).Ff)
}
// Write content into a quota_FILE. Invoke the quota callback and block
// the write if we exceed quota.
-func sqlite3_quota_fwrite(tls *crt.TLS, pBuf uintptr, size size_t, nmemb size_t, p uintptr) size_t { /* test_quota.c:998:8: */
+func sqlite3_quota_fwrite(tls *libc.TLS, pBuf uintptr, size size_t, nmemb size_t, p uintptr) size_t { /* test_quota.c:998:8: */
var iOfst sqlite3_int64
var iEnd sqlite3_int64
var szNew sqlite3_int64
var pFile uintptr
var rc size_t
- iOfst = sqlite3_int64(crt.Xftell(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff))
+ iOfst = sqlite3_int64(libc.Xftell(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff))
iEnd = (sqlite3_int64(uint64(iOfst) + (uint64(size * nmemb))))
pFile = (*quota_FILE)(unsafe.Pointer(p)).FpFile
if (pFile != 0) && ((*quotaFile)(unsafe.Pointer(pFile)).FiSize < iEnd) {
@@ -65791,7 +70548,7 @@ func sqlite3_quota_fwrite(tls *crt.TLS, pBuf uintptr, size size_t, nmemb size_t,
szNew = (((*quotaGroup)(unsafe.Pointer(pGroup)).FiSize - (*quotaFile)(unsafe.Pointer(pFile)).FiSize) + iEnd)
if (szNew > (*quotaGroup)(unsafe.Pointer(pGroup)).FiLimit) && ((*quotaGroup)(unsafe.Pointer(pGroup)).FiLimit > int64(0)) {
if (*quotaGroup)(unsafe.Pointer(pGroup)).FxCallback != 0 {
- (*(*func(*crt.TLS, uintptr, uintptr, sqlite3_int64, uintptr))(unsafe.Pointer((pGroup + 24 /* &.xCallback */))))(tls, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, (pGroup + 8 /* &.iLimit */), szNew,
+ (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_int64, uintptr))(unsafe.Pointer((pGroup + 24 /* &.xCallback */))))(tls, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, (pGroup + 8 /* &.iLimit */), szNew,
(*quotaGroup)(unsafe.Pointer(pGroup)).FpArg)
}
if (szNew > (*quotaGroup)(unsafe.Pointer(pGroup)).FiLimit) && ((*quotaGroup)(unsafe.Pointer(pGroup)).FiLimit > int64(0)) {
@@ -65807,7 +70564,7 @@ func sqlite3_quota_fwrite(tls *crt.TLS, pBuf uintptr, size size_t, nmemb size_t,
} else {
pFile = uintptr(0)
}
- rc = crt.Xfwrite(tls, pBuf, size, nmemb, (*quota_FILE)(unsafe.Pointer(p)).Ff)
+ rc = libc.Xfwrite(tls, pBuf, size, nmemb, (*quota_FILE)(unsafe.Pointer(p)).Ff)
// If the write was incomplete, adjust the file size and group size
// downward
@@ -65826,10 +70583,10 @@ func sqlite3_quota_fwrite(tls *crt.TLS, pBuf uintptr, size size_t, nmemb size_t,
}
// Close an open quota_FILE stream.
-func sqlite3_quota_fclose(tls *crt.TLS, p uintptr) int32 { /* test_quota.c:1054:5: */
+func sqlite3_quota_fclose(tls *libc.TLS, p uintptr) int32 { /* test_quota.c:1054:5: */
var rc int32
var pFile uintptr
- rc = crt.Xfclose(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff)
+ rc = libc.Xfclose(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff)
pFile = (*quota_FILE)(unsafe.Pointer(p)).FpFile
if pFile != 0 {
quotaEnter(tls)
@@ -65837,7 +70594,7 @@ func sqlite3_quota_fclose(tls *crt.TLS, p uintptr) int32 { /* test_quota.c:1054:
if (*quotaFile)(unsafe.Pointer(pFile)).FnRef == 0 {
var pGroup uintptr = (*quotaFile)(unsafe.Pointer(pFile)).FpGroup
if (*quotaFile)(unsafe.Pointer(pFile)).FdeleteOnClose != 0 {
- (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((gQuota.FpOrigVfs + 48 /* &.xDelete */))))(tls, gQuota.FpOrigVfs, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, 0)
+ (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((gQuota.FpOrigVfs + 48 /* &.xDelete */))))(tls, gQuota.FpOrigVfs, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, 0)
quotaRemoveFile(tls, pFile)
}
quotaGroupDeref(tls, pGroup)
@@ -65849,40 +70606,40 @@ func sqlite3_quota_fclose(tls *crt.TLS, p uintptr) int32 { /* test_quota.c:1054:
}
// Flush memory buffers for a quota_FILE to disk.
-func sqlite3_quota_fflush(tls *crt.TLS, p uintptr, doFsync int32) int32 { /* test_quota.c:1082:5: */
+func sqlite3_quota_fflush(tls *libc.TLS, p uintptr, doFsync int32) int32 { /* test_quota.c:1082:5: */
var rc int32
- rc = crt.Xfflush(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff)
+ rc = libc.Xfflush(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff)
if (rc == 0) && (doFsync != 0) {
- rc = crt.Xfsync(tls, crt.Xfileno(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff))
+ rc = libc.Xfsync(tls, libc.Xfileno(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff))
}
- return (crt.Bool32(rc != 0))
+ return (libc.Bool32(rc != 0))
}
// Seek on a quota_FILE stream.
-func sqlite3_quota_fseek(tls *crt.TLS, p uintptr, offset int64, whence int32) int32 { /* test_quota.c:1099:5: */
- return crt.Xfseek(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff, offset, whence)
+func sqlite3_quota_fseek(tls *libc.TLS, p uintptr, offset int64, whence int32) int32 { /* test_quota.c:1099:5: */
+ return libc.Xfseek(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff, offset, whence)
}
// rewind a quota_FILE stream.
-func sqlite3_quota_rewind(tls *crt.TLS, p uintptr) { /* test_quota.c:1106:6: */
- crt.Xrewind(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff)
+func sqlite3_quota_rewind(tls *libc.TLS, p uintptr) { /* test_quota.c:1106:6: */
+ libc.Xrewind(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff)
}
// Tell the current location of a quota_FILE stream.
-func sqlite3_quota_ftell(tls *crt.TLS, p uintptr) int64 { /* test_quota.c:1113:6: */
- return crt.Xftell(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff)
+func sqlite3_quota_ftell(tls *libc.TLS, p uintptr) int64 { /* test_quota.c:1113:6: */
+ return libc.Xftell(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff)
}
// Test the error indicator for the given file.
-func sqlite3_quota_ferror(tls *crt.TLS, p uintptr) int32 { /* test_quota.c:1120:5: */
- return crt2.Xferror(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff)
+func sqlite3_quota_ferror(tls *libc.TLS, p uintptr) int32 { /* test_quota.c:1120:5: */
+ return libc.Xferror(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff)
}
// Truncate a file to szNew bytes.
-func sqlite3_quota_ftruncate(tls *crt.TLS, p uintptr, szNew sqlite3_int64) int32 { /* test_quota.c:1127:5: */
+func sqlite3_quota_ftruncate(tls *libc.TLS, p uintptr, szNew sqlite3_int64) int32 { /* test_quota.c:1127:5: */
var pFile uintptr = (*quota_FILE)(unsafe.Pointer(p)).FpFile
var rc int32
- if ((crt.AssignUintptr(&pFile, (*quota_FILE)(unsafe.Pointer(p)).FpFile)) != uintptr(0)) && ((*quotaFile)(unsafe.Pointer(pFile)).FiSize < szNew) {
+ if ((libc.AssignUintptr(&pFile, (*quota_FILE)(unsafe.Pointer(p)).FpFile)) != uintptr(0)) && ((*quotaFile)(unsafe.Pointer(pFile)).FiSize < szNew) {
var pGroup uintptr
if (*quotaFile)(unsafe.Pointer(pFile)).FiSize < szNew {
// This routine cannot be used to extend a file that is under
@@ -65894,7 +70651,7 @@ func sqlite3_quota_ftruncate(tls *crt.TLS, p uintptr, szNew sqlite3_int64) int32
*(*sqlite3_int64)(unsafe.Pointer(pGroup + 16 /* &.iSize */)) += (szNew - (*quotaFile)(unsafe.Pointer(pFile)).FiSize)
quotaLeave(tls)
}
- rc = crt.Xftruncate(tls, crt.Xfileno(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff), int64(szNew))
+ rc = libc.Xftruncate(tls, libc.Xfileno(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff), int64(szNew))
if (pFile != 0) && (rc == 0) {
var pGroup uintptr = (*quotaFile)(unsafe.Pointer(pFile)).FpGroup
quotaEnter(tls)
@@ -65908,70 +70665,38 @@ func sqlite3_quota_ftruncate(tls *crt.TLS, p uintptr, szNew sqlite3_int64) int32
// Determine the time that the given file was last modified, in
// seconds size 1970. Write the result into *pTime. Return 0 on
// success and non-zero on any kind of error.
-func sqlite3_quota_file_mtime(tls *crt.TLS, p uintptr, pTime uintptr) int32 { /* test_quota.c:1169:5: */
+func sqlite3_quota_file_mtime(tls *libc.TLS, p uintptr, pTime uintptr) int32 { /* test_quota.c:1169:5: */
bp := tls.Alloc(144)
defer tls.Free(144)
var rc int32
- // var buf struct {Fst_dev uint64;Fst_ino uint64;Fst_nlink uint64;Fst_mode uint32;Fst_uid uint32;Fst_gid uint32;F__pad0 int32;Fst_rdev uint64;Fst_size int64;Fst_blksize int64;Fst_blocks int64;Fst_atim timespec;Fst_mtim timespec;Fst_ctim timespec;F__glibc_reserved [3]int64;} at bp, 144
+ // var buf stat at bp, 144
- rc = crt2.Xfstat(tls, crt.Xfileno(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff), bp /* &buf */)
+ rc = libc.Xfstat(tls, libc.Xfileno(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff), bp /* &buf */)
if rc == 0 {
- *(*time_t)(unsafe.Pointer(pTime)) = (*struct {
- Fst_dev uint64
- Fst_ino uint64
- Fst_nlink uint64
- Fst_mode uint32
- Fst_uid uint32
- Fst_gid uint32
- F__pad0 int32
- Fst_rdev uint64
- Fst_size int64
- Fst_blksize int64
- Fst_blocks int64
- Fst_atim timespec
- Fst_mtim timespec
- Fst_ctim timespec
- F__glibc_reserved [3]int64
- })(unsafe.Pointer(bp /* &buf */)).Fst_mtim.Ftv_sec
+ *(*time_t)(unsafe.Pointer(pTime)) = (*stat)(unsafe.Pointer(bp /* &buf */)).Fst_mtim.Ftv_sec
}
return rc
}
// Return the true size of the file, as reported by the operating
// system.
-func sqlite3_quota_file_truesize(tls *crt.TLS, p uintptr) sqlite3_int64 { /* test_quota.c:1187:15: */
+func sqlite3_quota_file_truesize(tls *libc.TLS, p uintptr) sqlite3_int64 { /* test_quota.c:1187:15: */
bp := tls.Alloc(144)
defer tls.Free(144)
var rc int32
- // var buf struct {Fst_dev uint64;Fst_ino uint64;Fst_nlink uint64;Fst_mode uint32;Fst_uid uint32;Fst_gid uint32;F__pad0 int32;Fst_rdev uint64;Fst_size int64;Fst_blksize int64;Fst_blocks int64;Fst_atim timespec;Fst_mtim timespec;Fst_ctim timespec;F__glibc_reserved [3]int64;} at bp, 144
+ // var buf stat at bp, 144
- rc = crt2.Xfstat(tls, crt.Xfileno(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff), bp /* &buf */)
+ rc = libc.Xfstat(tls, libc.Xfileno(tls, (*quota_FILE)(unsafe.Pointer(p)).Ff), bp /* &buf */)
if rc == 0 {
- return int64((*struct {
- Fst_dev uint64
- Fst_ino uint64
- Fst_nlink uint64
- Fst_mode uint32
- Fst_uid uint32
- Fst_gid uint32
- F__pad0 int32
- Fst_rdev uint64
- Fst_size int64
- Fst_blksize int64
- Fst_blocks int64
- Fst_atim timespec
- Fst_mtim timespec
- Fst_ctim timespec
- F__glibc_reserved [3]int64
- })(unsafe.Pointer(bp /* &buf */)).Fst_size)
+ return int64((*stat)(unsafe.Pointer(bp /* &buf */)).Fst_size)
}
return int64(-1)
}
// Return the size of the file, as it is known to the quota subsystem.
-func sqlite3_quota_file_size(tls *crt.TLS, p uintptr) sqlite3_int64 { /* test_quota.c:1203:15: */
+func sqlite3_quota_file_size(tls *libc.TLS, p uintptr) sqlite3_int64 { /* test_quota.c:1203:15: */
if (*quota_FILE)(unsafe.Pointer(p)).FpFile != 0 {
return (*quotaFile)(unsafe.Pointer((*quota_FILE)(unsafe.Pointer(p)).FpFile)).FiSize
}
@@ -65980,24 +70705,24 @@ func sqlite3_quota_file_size(tls *crt.TLS, p uintptr) sqlite3_int64 { /* test_qu
// Determine the amount of data in bytes available for reading
// in the given file.
-func sqlite3_quota_file_available(tls *crt.TLS, p uintptr) int64 { /* test_quota.c:1211:6: */
+func sqlite3_quota_file_available(tls *libc.TLS, p uintptr) int64 { /* test_quota.c:1211:6: */
var f uintptr = (*quota_FILE)(unsafe.Pointer(p)).Ff
var pos1 int64
var pos2 int64
var rc int32
- pos1 = crt.Xftell(tls, f)
+ pos1 = libc.Xftell(tls, f)
if pos1 < int64(0) {
return int64(-1)
}
- rc = crt.Xfseek(tls, f, int64(0), 2)
+ rc = libc.Xfseek(tls, f, int64(0), 2)
if rc != 0 {
return int64(-1)
}
- pos2 = crt.Xftell(tls, f)
+ pos2 = libc.Xftell(tls, f)
if pos2 < int64(0) {
return int64(-1)
}
- rc = crt.Xfseek(tls, f, pos1, 0)
+ rc = libc.Xfseek(tls, f, pos1, 0)
if rc != 0 {
return int64(-1)
}
@@ -66005,7 +70730,7 @@ func sqlite3_quota_file_available(tls *crt.TLS, p uintptr) int64 { /* test_quota
}
// Remove a managed file. Update quotas accordingly.
-func sqlite3_quota_remove(tls *crt.TLS, zFilename uintptr) int32 { /* test_quota.c:1229:5: */
+func sqlite3_quota_remove(tls *libc.TLS, zFilename uintptr) int32 { /* test_quota.c:1229:5: */
var zFull uintptr // Full pathname for zFilename
var nFull size_t // Number of bytes in zFilename
var rc int32 // Result code
@@ -66019,7 +70744,7 @@ func sqlite3_quota_remove(tls *crt.TLS, zFilename uintptr) int32 { /* test_quota
if zFull == uintptr(0) {
return 7
}
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((gQuota.FpOrigVfs + 64 /* &.xFullPathname */))))(tls, gQuota.FpOrigVfs, zFilename,
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((gQuota.FpOrigVfs + 64 /* &.xFullPathname */))))(tls, gQuota.FpOrigVfs, zFilename,
(gQuota.FsThisVfs.FmxPathname + 1), zFull)
if rc != 0 {
sqlite3.Xsqlite3_free(tls, zFull)
@@ -66028,7 +70753,7 @@ func sqlite3_quota_remove(tls *crt.TLS, zFilename uintptr) int32 { /* test_quota
// Figure out the length of the full pathname. If the name ends with
// / (or \ on windows) then remove the trailing /.
- nFull = crt.Xstrlen(tls, zFull)
+ nFull = libc.Xstrlen(tls, zFull)
if (nFull > uint64(0)) && ((int32(*(*int8)(unsafe.Pointer(zFull + uintptr((nFull - uint64(1)))))) == '/') || (int32(*(*int8)(unsafe.Pointer(zFull + uintptr((nFull - uint64(1)))))) == '\\')) {
nFull--
*(*int8)(unsafe.Pointer(zFull + uintptr(nFull))) = int8(0)
@@ -66039,12 +70764,12 @@ func sqlite3_quota_remove(tls *crt.TLS, zFilename uintptr) int32 { /* test_quota
if pGroup != 0 {
for pFile = (*quotaGroup)(unsafe.Pointer(pGroup)).FpFiles; (pFile != 0) && (rc == 0); pFile = pNextFile {
pNextFile = (*quotaFile)(unsafe.Pointer(pFile)).FpNext
- diff = crt.Xstrncmp(tls, zFull, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, nFull)
- if (diff == 0) && ((((int32(crt.AssignInt8(&c, *(*int8)(unsafe.Pointer((*quotaFile)(unsafe.Pointer(pFile)).FzFilename + uintptr(nFull)))))) == 0) || (int32(c) == '/')) || (int32(c) == '\\')) {
+ diff = libc.Xstrncmp(tls, zFull, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, nFull)
+ if (diff == 0) && ((((int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer((*quotaFile)(unsafe.Pointer(pFile)).FzFilename + uintptr(nFull)))))) == 0) || (int32(c) == '/')) || (int32(c) == '\\')) {
if (*quotaFile)(unsafe.Pointer(pFile)).FnRef != 0 {
(*quotaFile)(unsafe.Pointer(pFile)).FdeleteOnClose = 1
} else {
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((gQuota.FpOrigVfs + 48 /* &.xDelete */))))(tls, gQuota.FpOrigVfs, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, 0)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((gQuota.FpOrigVfs + 48 /* &.xDelete */))))(tls, gQuota.FpOrigVfs, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename, 0)
quotaRemoveFile(tls, pFile)
quotaGroupDeref(tls, pGroup)
}
@@ -66056,24 +70781,6 @@ func sqlite3_quota_remove(tls *crt.TLS, zFilename uintptr) int32 { /* test_quota
return rc
}
-type Tcl_StatBuf2 = struct {
- Fst_dev uint64
- Fst_ino uint64
- Fst_nlink uint64
- Fst_mode uint32
- Fst_uid uint32
- Fst_gid uint32
- F__pad0 int32
- Fst_rdev uint64
- Fst_size int64
- Fst_blksize int64
- Fst_blocks int64
- Fst_atim timespec
- Fst_mtim timespec
- Fst_ctim timespec
- F__glibc_reserved [3]int64
-} /* tcl.h:470:25 */
-
// end block for C++
// Local Variables:
@@ -66100,7 +70807,7 @@ type TclQuotaCallback1 = struct {
type TclQuotaCallback = TclQuotaCallback1 /* test_quota.c:1293:33 */
// This is the callback from a quota-over-limit.
-func tclQuotaCallback(tls *crt.TLS, zFilename uintptr, piLimit uintptr, iSize sqlite3_int64, pArg uintptr) { /* test_quota.c:1305:13: */
+func tclQuotaCallback(tls *libc.TLS, zFilename uintptr, piLimit uintptr, iSize sqlite3_int64, pArg uintptr) { /* test_quota.c:1305:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -66116,7 +70823,7 @@ func tclQuotaCallback(tls *crt.TLS, zFilename uintptr, piLimit uintptr, iSize sq
return
}
- pVarname = tcl.XTcl_NewStringObj(tls, ts+32714 /* "::piLimit_" */, -1)
+ pVarname = tcl.XTcl_NewStringObj(tls, ts+34775 /* "::piLimit_" */, -1)
(*Tcl_Obj)(unsafe.Pointer(pVarname)).FrefCount++
sqlite3.Xsqlite3_randomness(tls, int32(unsafe.Sizeof(uint32(0))), bp /* &rnd */)
tcl.XTcl_AppendObjToObj(tls, pVarname, tcl.XTcl_NewIntObj(tls, (int32(*(*uint32)(unsafe.Pointer(bp /* rnd */))&uint32(0x7FFFFFFF)))))
@@ -66140,13 +70847,13 @@ func tclQuotaCallback(tls *crt.TLS, zFilename uintptr, piLimit uintptr, iSize sq
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pEval
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = pVarname
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -66156,12 +70863,12 @@ func tclQuotaCallback(tls *crt.TLS, zFilename uintptr, piLimit uintptr, iSize sq
}
// Destructor for a TCL quota-over-limit callback.
-func tclCallbackDestructor(tls *crt.TLS, pObj uintptr) { /* test_quota.c:1349:13: */
+func tclCallbackDestructor(tls *libc.TLS, pObj uintptr) { /* test_quota.c:1349:13: */
var p uintptr = pObj
if p != 0 {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*TclQuotaCallback)(unsafe.Pointer(p)).FpScript
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -66170,7 +70877,7 @@ func tclCallbackDestructor(tls *crt.TLS, pObj uintptr) { /* test_quota.c:1349:13
}
// tclcmd: sqlite3_quota_initialize NAME MAKEDEFAULT
-func test_quota_initialize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1360:26: */
+func test_quota_initialize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1360:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -66181,7 +70888,7 @@ func test_quota_initialize(tls *crt.TLS, clientData uintptr, interp uintptr, obj
// Process arguments
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31573 /* "NAME MAKEDEFAULT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+33657 /* "NAME MAKEDEFAULT" */)
return 1
}
zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -66200,7 +70907,7 @@ func test_quota_initialize(tls *crt.TLS, clientData uintptr, interp uintptr, obj
}
// tclcmd: sqlite3_quota_shutdown
-func test_quota_shutdown(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1389:26: */
+func test_quota_shutdown(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1389:26: */
var rc int32 // Value returned by quota_shutdown()
if objc != 1 {
@@ -66216,7 +70923,7 @@ func test_quota_shutdown(tls *crt.TLS, clientData uintptr, interp uintptr, objc
}
// tclcmd: sqlite3_quota_set PATTERN LIMIT SCRIPT
-func test_quota_set(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1412:26: */
+func test_quota_set(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1412:26: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -66233,7 +70940,7 @@ func test_quota_set(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// Process arguments
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32725 /* "PATTERN LIMIT SC..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34786 /* "PATTERN LIMIT SC..." */)
return 1
}
zPattern = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -66247,16 +70954,16 @@ func test_quota_set(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
// Allocate a TclQuotaCallback object
p = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(TclQuotaCallback{})))
if !(p != 0) {
- tcl.XTcl_SetResult(tls, interp, ts+29563 /* "SQLITE_NOMEM" */, uintptr(0))
+ tcl.XTcl_SetResult(tls, interp, ts+31655 /* "SQLITE_NOMEM" */, uintptr(0))
return 0
}
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(TclQuotaCallback{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(TclQuotaCallback{})))
(*TclQuotaCallback)(unsafe.Pointer(p)).Finterp = interp
(*Tcl_Obj)(unsafe.Pointer(pScript)).FrefCount++
(*TclQuotaCallback)(unsafe.Pointer(p)).FpScript = pScript
- xDestroy = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{tclCallbackDestructor}))
+ xDestroy = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{tclCallbackDestructor}))
xCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, sqlite3_int64, uintptr)
+ f func(*libc.TLS, uintptr, uintptr, sqlite3_int64, uintptr)
}{tclQuotaCallback}))
} else {
p = uintptr(0)
@@ -66272,13 +70979,13 @@ func test_quota_set(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32
}
// tclcmd: sqlite3_quota_file FILENAME
-func test_quota_file(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1466:26: */
+func test_quota_file(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1466:26: */
var zFilename uintptr // File pattern to configure
var rc int32 // Value returned by quota_file()
// Process arguments
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29747 /* "FILENAME" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31839 /* "FILENAME" */)
return 1
}
zFilename = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -66291,7 +70998,7 @@ func test_quota_file(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
}
// tclcmd: sqlite3_quota_dump
-func test_quota_dump(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1492:26: */
+func test_quota_dump(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1492:26: */
bp := tls.Alloc(1008)
defer tls.Free(1008)
@@ -66316,7 +71023,7 @@ func test_quota_dump(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
// var zTemp [1000]int8 at bp+8, 1000
pFileTerm = tcl.XTcl_NewObj(tls)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1000]int8{})), bp+8 /* &zTemp[0] */, ts /* "%s" */, crt.VaList(bp, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([1000]int8{})), bp+8 /* &zTemp[0] */, ts /* "%s" */, libc.VaList(bp, (*quotaFile)(unsafe.Pointer(pFile)).FzFilename))
for i = 0; *(*int8)(unsafe.Pointer(bp + 8 /* &zTemp[0] */ + uintptr(i))) != 0; i++ {
if int32(*(*int8)(unsafe.Pointer(bp + 8 /* &zTemp[0] */ + uintptr(i)))) == '\\' {
*(*int8)(unsafe.Pointer(bp + 8 /* &zTemp[0] */ + uintptr(i))) = int8('/')
@@ -66340,7 +71047,7 @@ func test_quota_dump(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
}
// tclcmd: sqlite3_quota_fopen FILENAME MODE
-func test_quota_fopen(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1540:26: */
+func test_quota_fopen(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1540:26: */
bp := tls.Alloc(58)
defer tls.Free(58)
@@ -66352,19 +71059,19 @@ func test_quota_fopen(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
// Process arguments
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32746 /* "FILENAME MODE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34807 /* "FILENAME MODE" */)
return 1
}
zFilename = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
zMode = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
p = sqlite3_quota_fopen(tls, zFilename, zMode)
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+8 /* &zReturn[0] */, ts+11197 /* "%p" */, crt.VaList(bp, p))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+8 /* &zReturn[0] */, ts+12843 /* "%p" */, libc.VaList(bp, p))
tcl.XTcl_SetResult(tls, interp, bp+8 /* &zReturn[0] */, uintptr(1))
return 0
}
// tclcmd: sqlite3_quota_fread HANDLE SIZE NELEM
-func test_quota_fread(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1570:26: */
+func test_quota_fread(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1570:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -66377,7 +71084,7 @@ func test_quota_fread(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
var got size_t
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32760 /* "HANDLE SIZE NELE..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34821 /* "HANDLE SIZE NELE..." */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66400,7 +71107,7 @@ func test_quota_fread(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
}
// tclcmd: sqlite3_quota_fwrite HANDLE SIZE NELEM CONTENT
-func test_quota_fwrite(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1604:26: */
+func test_quota_fwrite(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1604:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -66413,7 +71120,7 @@ func test_quota_fwrite(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
var got size_t
if objc != 5 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32778 /* "HANDLE SIZE NELE..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34839 /* "HANDLE SIZE NELE..." */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66430,12 +71137,12 @@ func test_quota_fwrite(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
}
// tclcmd: sqlite3_quota_fclose HANDLE
-func test_quota_fclose(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1632:26: */
+func test_quota_fclose(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1632:26: */
var p uintptr
var rc int32
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25430 /* "HANDLE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66445,7 +71152,7 @@ func test_quota_fclose(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
}
// tclcmd: sqlite3_quota_fflush HANDLE ?HARDSYNC?
-func test_quota_fflush(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1654:26: */
+func test_quota_fflush(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1654:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -66454,7 +71161,7 @@ func test_quota_fflush(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
*(*int32)(unsafe.Pointer(bp /* doSync */)) = 0
if (objc != 2) && (objc != 3) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32804 /* "HANDLE ?HARDSYNC..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34865 /* "HANDLE ?HARDSYNC..." */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66469,7 +71176,7 @@ func test_quota_fflush(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
}
// tclcmd: sqlite3_quota_fseek HANDLE OFFSET WHENCE
-func test_quota_fseek(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1680:26: */
+func test_quota_fseek(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1680:26: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -66481,7 +71188,7 @@ func test_quota_fseek(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
var rc int32
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32822 /* "HANDLE OFFSET WH..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34883 /* "HANDLE OFFSET WH..." */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66489,15 +71196,15 @@ func test_quota_fseek(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
return 1
}
zWhence = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)))
- if crt.Xstrcmp(tls, zWhence, ts+32843 /* "SEEK_SET" */) == 0 {
+ if libc.Xstrcmp(tls, zWhence, ts+34904 /* "SEEK_SET" */) == 0 {
whence = 0
- } else if crt.Xstrcmp(tls, zWhence, ts+32852 /* "SEEK_CUR" */) == 0 {
+ } else if libc.Xstrcmp(tls, zWhence, ts+34913 /* "SEEK_CUR" */) == 0 {
whence = 1
- } else if crt.Xstrcmp(tls, zWhence, ts+32861 /* "SEEK_END" */) == 0 {
+ } else if libc.Xstrcmp(tls, zWhence, ts+34922 /* "SEEK_END" */) == 0 {
whence = 2
} else {
tcl.XTcl_AppendResult(tls, interp,
- crt.VaList(bp, ts+32870 /* "WHENCE should be..." */, uintptr(0)))
+ libc.VaList(bp, ts+34931 /* "WHENCE should be..." */, uintptr(0)))
return 1
}
rc = sqlite3_quota_fseek(tls, p, int64(*(*int32)(unsafe.Pointer(bp + 16 /* ofst */))), whence)
@@ -66506,10 +71213,10 @@ func test_quota_fseek(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
}
// tclcmd: sqlite3_quota_rewind HANDLE
-func test_quota_rewind(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1718:26: */
+func test_quota_rewind(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1718:26: */
var p uintptr
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25430 /* "HANDLE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66518,11 +71225,11 @@ func test_quota_rewind(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
}
// tclcmd: sqlite3_quota_ftell HANDLE
-func test_quota_ftell(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1737:26: */
+func test_quota_ftell(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1737:26: */
var p uintptr
var x sqlite3_int64
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25430 /* "HANDLE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66532,7 +71239,7 @@ func test_quota_ftell(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
}
// tclcmd: sqlite3_quota_ftruncate HANDLE SIZE
-func test_quota_ftruncate(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1758:26: */
+func test_quota_ftruncate(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1758:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -66542,7 +71249,7 @@ func test_quota_ftruncate(tls *crt.TLS, clientData uintptr, interp uintptr, objc
var rc int32
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32919 /* "HANDLE SIZE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34980 /* "HANDLE SIZE" */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66556,11 +71263,11 @@ func test_quota_ftruncate(tls *crt.TLS, clientData uintptr, interp uintptr, objc
}
// tclcmd: sqlite3_quota_file_size HANDLE
-func test_quota_file_size(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1783:26: */
+func test_quota_file_size(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1783:26: */
var p uintptr
var x sqlite3_int64
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25430 /* "HANDLE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66570,11 +71277,11 @@ func test_quota_file_size(tls *crt.TLS, clientData uintptr, interp uintptr, objc
}
// tclcmd: sqlite3_quota_file_truesize HANDLE
-func test_quota_file_truesize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1804:26: */
+func test_quota_file_truesize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1804:26: */
var p uintptr
var x sqlite3_int64
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25430 /* "HANDLE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66584,7 +71291,7 @@ func test_quota_file_truesize(tls *crt.TLS, clientData uintptr, interp uintptr,
}
// tclcmd: sqlite3_quota_file_mtime HANDLE
-func test_quota_file_mtime(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1825:26: */
+func test_quota_file_mtime(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1825:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -66592,7 +71299,7 @@ func test_quota_file_mtime(tls *crt.TLS, clientData uintptr, interp uintptr, obj
// var t time_t at bp, 8
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25430 /* "HANDLE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66603,11 +71310,11 @@ func test_quota_file_mtime(tls *crt.TLS, clientData uintptr, interp uintptr, obj
}
// tclcmd: sqlite3_quota_remove FILENAME
-func test_quota_remove(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1848:26: */
+func test_quota_remove(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1848:26: */
var zFilename uintptr // File pattern to configure
var rc int32
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29747 /* "FILENAME" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31839 /* "FILENAME" */)
return 1
}
zFilename = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -66620,12 +71327,12 @@ func test_quota_remove(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
//
// Test the glob pattern matching. Return 1 if TEXT matches PATTERN
// and return 0 if it does not.
-func test_quota_glob(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1872:26: */
+func test_quota_glob(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1872:26: */
var zPattern uintptr // The glob pattern
var zText uintptr // Text to compare agains the pattern
var rc int32
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+32931 /* "PATTERN TEXT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34992 /* "PATTERN TEXT" */)
return 1
}
zPattern = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
@@ -66639,11 +71346,11 @@ func test_quota_glob(tls *crt.TLS, clientData uintptr, interp uintptr, objc int3
//
// Return the number of bytes from the current file point to the end of
// the file.
-func test_quota_file_available(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1898:26: */
+func test_quota_file_available(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1898:26: */
var p uintptr
var x sqlite3_int64
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25430 /* "HANDLE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66655,11 +71362,11 @@ func test_quota_file_available(tls *crt.TLS, clientData uintptr, interp uintptr,
// tclcmd: sqlite3_quota_ferror HANDLE
//
// Return true if the file handle is in the error state.
-func test_quota_ferror(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1921:26: */
+func test_quota_ferror(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_quota.c:1921:26: */
var p uintptr
var x int32
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+25430 /* "HANDLE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+27522 /* "HANDLE" */)
return 1
}
p = sqlite3TestTextToPtr(tls, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))))
@@ -66671,68 +71378,688 @@ func test_quota_ferror(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
// This routine registers the custom TCL commands defined in this
// module. This should be the only procedure visible from outside
// of this module.
-func Sqlitequota_Init(tls *crt.TLS, interp uintptr) int32 { /* test_quota.c:1944:5: */
+func Sqlitequota_Init(tls *libc.TLS, interp uintptr) int32 { /* test_quota.c:1944:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd8)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aCmd9)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aCmd8[i].FzName, aCmd8[i].FxProc, uintptr(0), uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aCmd9[i].FzName, aCmd9[i].FxProc, uintptr(0), uintptr(0))
}
return 0
}
-var aCmd8 = [21]struct {
+var aCmd9 = [21]struct {
FzName uintptr
FxProc uintptr
}{
- {FzName: ts + 32944 /* "sqlite3_quota_in..." */, FxProc: 0},
- {FzName: ts + 32969 /* "sqlite3_quota_sh..." */, FxProc: 0},
- {FzName: ts + 32992 /* "sqlite3_quota_se..." */, FxProc: 0},
- {FzName: ts + 33010 /* "sqlite3_quota_fi..." */, FxProc: 0},
- {FzName: ts + 33029 /* "sqlite3_quota_du..." */, FxProc: 0},
- {FzName: ts + 33048 /* "sqlite3_quota_fo..." */, FxProc: 0},
- {FzName: ts + 33068 /* "sqlite3_quota_fr..." */, FxProc: 0},
- {FzName: ts + 33088 /* "sqlite3_quota_fw..." */, FxProc: 0},
- {FzName: ts + 33109 /* "sqlite3_quota_fc..." */, FxProc: 0},
- {FzName: ts + 33130 /* "sqlite3_quota_ff..." */, FxProc: 0},
- {FzName: ts + 33151 /* "sqlite3_quota_fs..." */, FxProc: 0},
- {FzName: ts + 33171 /* "sqlite3_quota_re..." */, FxProc: 0},
- {FzName: ts + 33192 /* "sqlite3_quota_ft..." */, FxProc: 0},
- {FzName: ts + 33212 /* "sqlite3_quota_ft..." */, FxProc: 0},
- {FzName: ts + 33236 /* "sqlite3_quota_fi..." */, FxProc: 0},
- {FzName: ts + 33260 /* "sqlite3_quota_fi..." */, FxProc: 0},
- {FzName: ts + 33288 /* "sqlite3_quota_fi..." */, FxProc: 0},
- {FzName: ts + 33313 /* "sqlite3_quota_re..." */, FxProc: 0},
- {FzName: ts + 33334 /* "sqlite3_quota_gl..." */, FxProc: 0},
- {FzName: ts + 33353 /* "sqlite3_quota_fi..." */, FxProc: 0},
- {FzName: ts + 33382 /* "sqlite3_quota_fe..." */, FxProc: 0},
+ {FzName: ts + 35005 /* "sqlite3_quota_in..." */, FxProc: 0},
+ {FzName: ts + 35030 /* "sqlite3_quota_sh..." */, FxProc: 0},
+ {FzName: ts + 35053 /* "sqlite3_quota_se..." */, FxProc: 0},
+ {FzName: ts + 35071 /* "sqlite3_quota_fi..." */, FxProc: 0},
+ {FzName: ts + 35090 /* "sqlite3_quota_du..." */, FxProc: 0},
+ {FzName: ts + 35109 /* "sqlite3_quota_fo..." */, FxProc: 0},
+ {FzName: ts + 35129 /* "sqlite3_quota_fr..." */, FxProc: 0},
+ {FzName: ts + 35149 /* "sqlite3_quota_fw..." */, FxProc: 0},
+ {FzName: ts + 35170 /* "sqlite3_quota_fc..." */, FxProc: 0},
+ {FzName: ts + 35191 /* "sqlite3_quota_ff..." */, FxProc: 0},
+ {FzName: ts + 35212 /* "sqlite3_quota_fs..." */, FxProc: 0},
+ {FzName: ts + 35232 /* "sqlite3_quota_re..." */, FxProc: 0},
+ {FzName: ts + 35253 /* "sqlite3_quota_ft..." */, FxProc: 0},
+ {FzName: ts + 35273 /* "sqlite3_quota_ft..." */, FxProc: 0},
+ {FzName: ts + 35297 /* "sqlite3_quota_fi..." */, FxProc: 0},
+ {FzName: ts + 35321 /* "sqlite3_quota_fi..." */, FxProc: 0},
+ {FzName: ts + 35349 /* "sqlite3_quota_fi..." */, FxProc: 0},
+ {FzName: ts + 35374 /* "sqlite3_quota_re..." */, FxProc: 0},
+ {FzName: ts + 35395 /* "sqlite3_quota_gl..." */, FxProc: 0},
+ {FzName: ts + 35414 /* "sqlite3_quota_fi..." */, FxProc: 0},
+ {FzName: ts + 35443 /* "sqlite3_quota_fe..." */, FxProc: 0},
} /* test_quota.c:1948:5 */
-func register_cube_geom(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_rtree.c:443:26: */
- _ = clientData
- _ = interp
- _ = objc
- _ = objv
+// Type used to cache parameter information for the "circle" r-tree geometry
+// callback.
+type Circle1 = struct {
+ FaBox [2]struct {
+ Fxmin float64
+ Fxmax float64
+ Fymin float64
+ Fymax float64
+ }
+ Fcenterx float64
+ Fcentery float64
+ Fradius float64
+ FmxArea float64
+ FeScoreType int32
+ _ [4]byte
+}
+
+// Type used to cache parameter information for the "circle" r-tree geometry
+// callback.
+type Circle = Circle1 /* test_rtree.c:31:23 */
+type Box = struct {
+ Fxmin float64
+ Fxmax float64
+ Fymin float64
+ Fymax float64
+}
+
+// Destructor function for Circle objects allocated by circle_geom().
+func circle_del(tls *libc.TLS, p uintptr) { /* test_rtree.c:49:13: */
+ sqlite3.Xsqlite3_free(tls, p)
+}
+
+// Implementation of "circle" r-tree geometry callback.
+func circle_geom(tls *libc.TLS, p uintptr, nCoord int32, aCoord uintptr, pRes uintptr) int32 { /* test_rtree.c:56:12: */
+ var i int32 // Iterator variable
+ var pCircle uintptr // Structure defining circular region
+ var xmin float64
+ var xmax float64 // X dimensions of box being tested
+ var ymin float64
+ var ymax float64 // X dimensions of box being tested
+
+ xmin = *(*sqlite3_rtree_dbl)(unsafe.Pointer(aCoord + uintptr(0)*8))
+ xmax = *(*sqlite3_rtree_dbl)(unsafe.Pointer(aCoord + uintptr(1)*8))
+ ymin = *(*sqlite3_rtree_dbl)(unsafe.Pointer(aCoord + uintptr(2)*8))
+ ymax = *(*sqlite3_rtree_dbl)(unsafe.Pointer(aCoord + uintptr(3)*8))
+ pCircle = (*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FpUser
+ if pCircle == uintptr(0) {
+ // If pUser is still 0, then the parameter values have not been tested
+ // for correctness or stored into a Circle structure yet. Do this now.
+
+ // This geometry callback is for use with a 2-dimensional r-tree table.
+ // Return an error if the table does not have exactly 2 dimensions.
+ if nCoord != 4 {
+ return 1
+ }
+
+ // Test that the correct number of parameters (3) have been supplied,
+ // and that the parameters are in range (that the radius of the circle
+ // radius is greater than zero).
+ if ((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FnParam != 3) || (*(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(2)*8)) < 0.0) {
+ return 1
+ }
+
+ // Allocate a structure to cache parameter data in. Return SQLITE_NOMEM
+ // if the allocation fails.
+ pCircle = libc.AssignPtrUintptr(p+24 /* &.pUser */, sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Circle{}))))
+ if !(pCircle != 0) {
+ return 7
+ }
+ (*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FxDelUser = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{circle_del}))
+
+ // Record the center and radius of the circular region. One way that
+ // tested bounding boxes that intersect the circular region are detected
+ // is by testing if each corner of the bounding box lies within radius
+ // units of the center of the circle.
+ (*Circle)(unsafe.Pointer(pCircle)).Fcenterx = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(0)*8))
+ (*Circle)(unsafe.Pointer(pCircle)).Fcentery = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(1)*8))
+ (*Circle)(unsafe.Pointer(pCircle)).Fradius = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(2)*8))
+
+ // Define two bounding box regions. The first, aBox[0], extends to
+ // infinity in the X dimension. It covers the same range of the Y dimension
+ // as the circular region. The second, aBox[1], extends to infinity in
+ // the Y dimension and is constrained to the range of the circle in the
+ // X dimension.
+ //
+ // Then imagine each box is split in half along its short axis by a line
+ // that intersects the center of the circular region. A bounding box
+ // being tested can be said to intersect the circular region if it contains
+ // points from each half of either of the two infinite bounding boxes.
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(0)*32)).Fxmin = (*Circle)(unsafe.Pointer(pCircle)).Fcenterx
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(0)*32)).Fxmax = (*Circle)(unsafe.Pointer(pCircle)).Fcenterx
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(0)*32)).Fymin = ((*Circle)(unsafe.Pointer(pCircle)).Fcentery + (*Circle)(unsafe.Pointer(pCircle)).Fradius)
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(0)*32)).Fymax = ((*Circle)(unsafe.Pointer(pCircle)).Fcentery - (*Circle)(unsafe.Pointer(pCircle)).Fradius)
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(1)*32)).Fxmin = ((*Circle)(unsafe.Pointer(pCircle)).Fcenterx + (*Circle)(unsafe.Pointer(pCircle)).Fradius)
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(1)*32)).Fxmax = ((*Circle)(unsafe.Pointer(pCircle)).Fcenterx - (*Circle)(unsafe.Pointer(pCircle)).Fradius)
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(1)*32)).Fymin = (*Circle)(unsafe.Pointer(pCircle)).Fcentery
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(1)*32)).Fymax = (*Circle)(unsafe.Pointer(pCircle)).Fcentery
+ (*Circle)(unsafe.Pointer(pCircle)).FmxArea = (((xmax - xmin) * (ymax - ymin)) + 1.0)
+ }
+
+ // Check if any of the 4 corners of the bounding-box being tested lie
+ // inside the circular region. If they do, then the bounding-box does
+ // intersect the region of interest. Set the output variable to true and
+ // return SQLITE_OK in this case.
+ for i = 0; i < 4; i++ {
+ var x float64
+ if (i & 0x01) != 0 {
+ x = xmax
+ } else {
+ x = xmin
+ }
+ var y float64
+ if (i & 0x02) != 0 {
+ y = ymax
+ } else {
+ y = ymin
+ }
+ var d2 float64
+
+ d2 = ((x - (*Circle)(unsafe.Pointer(pCircle)).Fcenterx) * (x - (*Circle)(unsafe.Pointer(pCircle)).Fcenterx))
+ d2 = d2 + ((y - (*Circle)(unsafe.Pointer(pCircle)).Fcentery) * (y - (*Circle)(unsafe.Pointer(pCircle)).Fcentery))
+ if d2 < ((*Circle)(unsafe.Pointer(pCircle)).Fradius * (*Circle)(unsafe.Pointer(pCircle)).Fradius) {
+ *(*int32)(unsafe.Pointer(pRes)) = 1
+ return 0
+ }
+ }
+
+ // Check if the bounding box covers any other part of the circular region.
+ // See comments above for a description of how this test works. If it does
+ // cover part of the circular region, set the output variable to true
+ // and return SQLITE_OK.
+ for i = 0; i < 2; i++ {
+ if (((xmin <= (*Box)(unsafe.Pointer((pCircle /* &.aBox */)+uintptr(i)*32)).Fxmin) &&
+ (xmax >= (*Box)(unsafe.Pointer((pCircle /* &.aBox */)+uintptr(i)*32)).Fxmax)) &&
+ (ymin <= (*Box)(unsafe.Pointer((pCircle /* &.aBox */)+uintptr(i)*32)).Fymin)) &&
+ (ymax >= (*Box)(unsafe.Pointer((pCircle /* &.aBox */)+uintptr(i)*32)).Fymax) {
+ *(*int32)(unsafe.Pointer(pRes)) = 1
+ return 0
+ }
+ }
+
+ // The specified bounding box does not intersect the circular region. Set
+ // the output variable to zero and return SQLITE_OK.
+ *(*int32)(unsafe.Pointer(pRes)) = 0
return 0
}
-func register_circle_geom(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_rtree.c:471:26: */
- _ = clientData
- _ = interp
- _ = objc
- _ = objv
+// Implementation of "circle" r-tree geometry callback using the
+// 2nd-generation interface that allows scoring.
+//
+// Two calling forms:
+//
+// Qcircle(X,Y,Radius,eType) -- All values are doubles
+// Qcircle('x:X y:Y r:R e:ETYPE') -- Single string parameter
+func circle_query_func(tls *libc.TLS, p uintptr) int32 { /* test_rtree.c:168:12: */
+ var i int32 // Iterator variable
+ var pCircle uintptr // Structure defining circular region
+ var xmin float64
+ var xmax float64 // X dimensions of box being tested
+ var ymin float64
+ var ymax float64 // X dimensions of box being tested
+ var nWithin int32 = 0 // Number of corners inside the circle
+
+ xmin = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaCoord + uintptr(0)*8))
+ xmax = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaCoord + uintptr(1)*8))
+ ymin = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaCoord + uintptr(2)*8))
+ ymax = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaCoord + uintptr(3)*8))
+ pCircle = (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FpUser
+ if pCircle == uintptr(0) {
+ // If pUser is still 0, then the parameter values have not been tested
+ // for correctness or stored into a Circle structure yet. Do this now.
+
+ // This geometry callback is for use with a 2-dimensional r-tree table.
+ // Return an error if the table does not have exactly 2 dimensions.
+ if (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FnCoord != 4 {
+ return 1
+ }
+
+ // Test that the correct number of parameters (1 or 4) have been supplied.
+ if ((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FnParam != 4) && ((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FnParam != 1) {
+ return 1
+ }
+
+ // Allocate a structure to cache parameter data in. Return SQLITE_NOMEM
+ // if the allocation fails.
+ pCircle = libc.AssignPtrUintptr(p+24 /* &.pUser */, sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Circle{}))))
+ if !(pCircle != 0) {
+ return 7
+ }
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FxDelUser = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{circle_del}))
+
+ // Record the center and radius of the circular region. One way that
+ // tested bounding boxes that intersect the circular region are detected
+ // is by testing if each corner of the bounding box lies within radius
+ // units of the center of the circle.
+ if (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FnParam == 4 {
+ (*Circle)(unsafe.Pointer(pCircle)).Fcenterx = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaParam + uintptr(0)*8))
+ (*Circle)(unsafe.Pointer(pCircle)).Fcentery = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaParam + uintptr(1)*8))
+ (*Circle)(unsafe.Pointer(pCircle)).Fradius = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaParam + uintptr(2)*8))
+ (*Circle)(unsafe.Pointer(pCircle)).FeScoreType = int32(*(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaParam + uintptr(3)*8)))
+ } else {
+ var z uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FapSqlParam + uintptr(0)*8)))
+ (*Circle)(unsafe.Pointer(pCircle)).Fcenterx = 0.0
+ (*Circle)(unsafe.Pointer(pCircle)).Fcentery = 0.0
+ (*Circle)(unsafe.Pointer(pCircle)).Fradius = 0.0
+ (*Circle)(unsafe.Pointer(pCircle)).FeScoreType = 0
+ for (z != 0) && (*(*int8)(unsafe.Pointer(z + uintptr(0))) != 0) {
+ if (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == 'r') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) == ':') {
+ (*Circle)(unsafe.Pointer(pCircle)).Fradius = libc.Xatof(tls, (z + uintptr(2)))
+ } else if (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == 'x') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) == ':') {
+ (*Circle)(unsafe.Pointer(pCircle)).Fcenterx = libc.Xatof(tls, (z + uintptr(2)))
+ } else if (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == 'y') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) == ':') {
+ (*Circle)(unsafe.Pointer(pCircle)).Fcentery = libc.Xatof(tls, (z + uintptr(2)))
+ } else if (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == 'e') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) == ':') {
+ (*Circle)(unsafe.Pointer(pCircle)).FeScoreType = int32(libc.Xatof(tls, (z + uintptr(2))))
+ } else if int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == ' ' {
+ z++
+ continue
+ }
+ for (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) != ' ') {
+ z++
+ }
+ for int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == ' ' {
+ z++
+ }
+ }
+ }
+ if (*Circle)(unsafe.Pointer(pCircle)).Fradius < 0.0 {
+ sqlite3.Xsqlite3_free(tls, pCircle)
+ return 7
+ }
+
+ // Define two bounding box regions. The first, aBox[0], extends to
+ // infinity in the X dimension. It covers the same range of the Y dimension
+ // as the circular region. The second, aBox[1], extends to infinity in
+ // the Y dimension and is constrained to the range of the circle in the
+ // X dimension.
+ //
+ // Then imagine each box is split in half along its short axis by a line
+ // that intersects the center of the circular region. A bounding box
+ // being tested can be said to intersect the circular region if it contains
+ // points from each half of either of the two infinite bounding boxes.
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(0)*32)).Fxmin = (*Circle)(unsafe.Pointer(pCircle)).Fcenterx
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(0)*32)).Fxmax = (*Circle)(unsafe.Pointer(pCircle)).Fcenterx
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(0)*32)).Fymin = ((*Circle)(unsafe.Pointer(pCircle)).Fcentery + (*Circle)(unsafe.Pointer(pCircle)).Fradius)
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(0)*32)).Fymax = ((*Circle)(unsafe.Pointer(pCircle)).Fcentery - (*Circle)(unsafe.Pointer(pCircle)).Fradius)
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(1)*32)).Fxmin = ((*Circle)(unsafe.Pointer(pCircle)).Fcenterx + (*Circle)(unsafe.Pointer(pCircle)).Fradius)
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(1)*32)).Fxmax = ((*Circle)(unsafe.Pointer(pCircle)).Fcenterx - (*Circle)(unsafe.Pointer(pCircle)).Fradius)
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(1)*32)).Fymin = (*Circle)(unsafe.Pointer(pCircle)).Fcentery
+ (*Box)(unsafe.Pointer((pCircle /* &.aBox */) + uintptr(1)*32)).Fymax = (*Circle)(unsafe.Pointer(pCircle)).Fcentery
+ (*Circle)(unsafe.Pointer(pCircle)).FmxArea = (float64(200.0) * 200.0)
+ }
+
+ // Check if any of the 4 corners of the bounding-box being tested lie
+ // inside the circular region. If they do, then the bounding-box does
+ // intersect the region of interest. Set the output variable to true and
+ // return SQLITE_OK in this case.
+ for i = 0; i < 4; i++ {
+ var x float64
+ if (i & 0x01) != 0 {
+ x = xmax
+ } else {
+ x = xmin
+ }
+ var y float64
+ if (i & 0x02) != 0 {
+ y = ymax
+ } else {
+ y = ymin
+ }
+ var d2 float64
+
+ d2 = ((x - (*Circle)(unsafe.Pointer(pCircle)).Fcenterx) * (x - (*Circle)(unsafe.Pointer(pCircle)).Fcenterx))
+ d2 = d2 + ((y - (*Circle)(unsafe.Pointer(pCircle)).Fcentery) * (y - (*Circle)(unsafe.Pointer(pCircle)).Fcentery))
+ if d2 < ((*Circle)(unsafe.Pointer(pCircle)).Fradius * (*Circle)(unsafe.Pointer(pCircle)).Fradius) {
+ nWithin++
+ }
+ }
+
+ // Check if the bounding box covers any other part of the circular region.
+ // See comments above for a description of how this test works. If it does
+ // cover part of the circular region, set the output variable to true
+ // and return SQLITE_OK.
+ if nWithin == 0 {
+ for i = 0; i < 2; i++ {
+ if (((xmin <= (*Box)(unsafe.Pointer((pCircle /* &.aBox */)+uintptr(i)*32)).Fxmin) &&
+ (xmax >= (*Box)(unsafe.Pointer((pCircle /* &.aBox */)+uintptr(i)*32)).Fxmax)) &&
+ (ymin <= (*Box)(unsafe.Pointer((pCircle /* &.aBox */)+uintptr(i)*32)).Fymin)) &&
+ (ymax >= (*Box)(unsafe.Pointer((pCircle /* &.aBox */)+uintptr(i)*32)).Fymax) {
+ nWithin = 1
+ break
+ }
+ }
+ }
+
+ if (*Circle)(unsafe.Pointer(pCircle)).FeScoreType == 1 {
+ // Depth first search
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FrScore = sqlite3_rtree_dbl((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FiLevel)
+ } else if (*Circle)(unsafe.Pointer(pCircle)).FeScoreType == 2 {
+ // Breadth first search
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FrScore = (sqlite3_rtree_dbl(100 - (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FiLevel))
+ } else if (*Circle)(unsafe.Pointer(pCircle)).FeScoreType == 3 {
+ // Depth-first search, except sort the leaf nodes by area with
+ // the largest area first
+ if (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FiLevel == 1 {
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FrScore = (1.0 - (((xmax - xmin) * (ymax - ymin)) / (*Circle)(unsafe.Pointer(pCircle)).FmxArea))
+ if (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FrScore < 0.01 {
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FrScore = 0.01
+ }
+ } else {
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FrScore = 0.0
+ }
+ } else if (*Circle)(unsafe.Pointer(pCircle)).FeScoreType == 4 {
+ // Depth-first search, except exclude odd rowids
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FrScore = sqlite3_rtree_dbl((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FiLevel)
+ if ((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FiRowid & int64(1)) != 0 {
+ nWithin = 0
+ }
+ } else {
+ // Breadth-first search, except exclude odd rowids
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FrScore = (sqlite3_rtree_dbl(100 - (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FiLevel))
+ if ((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FiRowid & int64(1)) != 0 {
+ nWithin = 0
+ }
+ }
+ if nWithin == 0 {
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FeWithin = 0
+ } else if nWithin >= 4 {
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FeWithin = 2
+ } else {
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FeWithin = 1
+ }
+ return 0
+}
+
+// Implementation of "breadthfirstsearch" r-tree geometry callback using the
+// 2nd-generation interface that allows scoring.
+//
+// ... WHERE id MATCH breadthfirstsearch($x0,$x1,$y0,$y1) ...
+//
+// It returns all entries whose bounding boxes overlap with $x0,$x1,$y0,$y1.
+func bfs_query_func(tls *libc.TLS, p uintptr) int32 { /* test_rtree.c:329:12: */
+ var x0 float64
+ var x1 float64
+ var y0 float64
+ var y1 float64 // Dimensions of box being tested
+ var bx0 float64
+ var bx1 float64
+ var by0 float64
+ var by1 float64 // Boundary of the query function
+
+ if (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FnParam != 4 {
+ return 1
+ }
+ x0 = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaCoord + uintptr(0)*8))
+ x1 = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaCoord + uintptr(1)*8))
+ y0 = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaCoord + uintptr(2)*8))
+ y1 = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaCoord + uintptr(3)*8))
+ bx0 = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaParam + uintptr(0)*8))
+ bx1 = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaParam + uintptr(1)*8))
+ by0 = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaParam + uintptr(2)*8))
+ by1 = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FaParam + uintptr(3)*8))
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FrScore = (sqlite3_rtree_dbl(100 - (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FiLevel))
+ if (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FeParentWithin == 2 {
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FeWithin = 2
+ } else if (((x0 >= bx0) && (x1 <= bx1)) && (y0 >= by0)) && (y1 <= by1) {
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FeWithin = 2
+ } else if (((x1 >= bx0) && (x0 <= bx1)) && (y1 >= by0)) && (y0 <= by1) {
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FeWithin = 1
+ } else {
+ (*sqlite3_rtree_query_info)(unsafe.Pointer(p)).FeWithin = 0
+ }
+ return 0
+}
+
+// END of implementation of "circle" geometry callback.
+//
+//
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// ISO C99 Standard: 7.2 Diagnostics <assert.h>
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// void assert (int expression);
+//
+// If NDEBUG is defined, do nothing.
+// If not, and EXPRESSION is zero, print an error message and abort.
+
+// void assert_perror (int errnum);
+//
+// If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an
+// error message with the error text for ERRNUM and abort.
+// (This is a GNU extension.)
+
+// tcl.h --
+//
+// This header file describes the externally-visible facilities of the
+// Tcl interpreter.
+//
+// Copyright (c) 1987-1994 The Regents of the University of California.
+// Copyright (c) 1993-1996 Lucent Technologies.
+// Copyright (c) 1994-1998 Sun Microsystems, Inc.
+// Copyright (c) 1998-2000 by Scriptics Corporation.
+// Copyright (c) 2002 by Kevin B. Kenny. All rights reserved.
+//
+// See the file "license.terms" for information on usage and redistribution of
+// this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+// Local Variables:
+// mode: c
+// c-basic-offset: 4
+// fill-column: 78
+// End:
+
+type Cube1 = struct {
+ Fx float64
+ Fy float64
+ Fz float64
+ Fwidth float64
+ Fheight float64
+ Fdepth float64
+}
+
+// END of implementation of "circle" geometry callback.
+//
+//
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// ISO C99 Standard: 7.2 Diagnostics <assert.h>
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// void assert (int expression);
+//
+// If NDEBUG is defined, do nothing.
+// If not, and EXPRESSION is zero, print an error message and abort.
+
+// void assert_perror (int errnum);
+//
+// If NDEBUG is defined, do nothing. If not, and ERRNUM is not zero, print an
+// error message with the error text for ERRNUM and abort.
+// (This is a GNU extension.)
+
+// tcl.h --
+//
+// This header file describes the externally-visible facilities of the
+// Tcl interpreter.
+//
+// Copyright (c) 1987-1994 The Regents of the University of California.
+// Copyright (c) 1993-1996 Lucent Technologies.
+// Copyright (c) 1994-1998 Sun Microsystems, Inc.
+// Copyright (c) 1998-2000 by Scriptics Corporation.
+// Copyright (c) 2002 by Kevin B. Kenny. All rights reserved.
+//
+// See the file "license.terms" for information on usage and redistribution of
+// this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+// Local Variables:
+// mode: c
+// c-basic-offset: 4
+// fill-column: 78
+// End:
+
+type Cube = Cube1 /* test_rtree.c:366:21 */
+
+func cube_context_free(tls *libc.TLS, p uintptr) { /* test_rtree.c:376:13: */
+ sqlite3.Xsqlite3_free(tls, p)
+}
+
+// The context pointer registered along with the 'cube' callback is
+// always ((void *)&gHere). This is just to facilitate testing, it is not
+// actually used for anything.
+var gHere int32 = 42 /* test_rtree.c:385:12 */
+
+// Implementation of a simple r-tree geom callback to test for intersection
+// of r-tree rows with a "cube" shape. Cubes are defined by six scalar
+// coordinates as follows:
+//
+// cube(x, y, z, width, height, depth)
+//
+// The width, height and depth parameters must all be greater than zero.
+func cube_geom(tls *libc.TLS, p uintptr, nCoord int32, aCoord uintptr, piRes uintptr) int32 { /* test_rtree.c:396:12: */
+ var pCube uintptr = (*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FpUser
+
+ if pCube == uintptr(0) {
+ if (((((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FnParam != 6) || (nCoord != 6)) ||
+ (*(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(3)*8)) <= 0.0)) || (*(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(4)*8)) <= 0.0)) || (*(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(5)*8)) <= 0.0) {
+ return 1
+ }
+ pCube = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Cube{})))
+ if !(pCube != 0) {
+ return 7
+ }
+ (*Cube)(unsafe.Pointer(pCube)).Fx = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(0)*8))
+ (*Cube)(unsafe.Pointer(pCube)).Fy = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(1)*8))
+ (*Cube)(unsafe.Pointer(pCube)).Fz = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(2)*8))
+ (*Cube)(unsafe.Pointer(pCube)).Fwidth = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(3)*8))
+ (*Cube)(unsafe.Pointer(pCube)).Fheight = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(4)*8))
+ (*Cube)(unsafe.Pointer(pCube)).Fdepth = *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FaParam + uintptr(5)*8))
+
+ (*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FpUser = pCube
+ (*sqlite3_rtree_geometry)(unsafe.Pointer(p)).FxDelUser = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{cube_context_free}))
+ }
+
+ *(*int32)(unsafe.Pointer(piRes)) = 0
+ if (((((*(*sqlite3_rtree_dbl)(unsafe.Pointer(aCoord + uintptr(0)*8)) <= ((*Cube)(unsafe.Pointer(pCube)).Fx + (*Cube)(unsafe.Pointer(pCube)).Fwidth)) &&
+ (*(*sqlite3_rtree_dbl)(unsafe.Pointer(aCoord + uintptr(1)*8)) >= (*Cube)(unsafe.Pointer(pCube)).Fx)) &&
+ (*(*sqlite3_rtree_dbl)(unsafe.Pointer(aCoord + uintptr(2)*8)) <= ((*Cube)(unsafe.Pointer(pCube)).Fy + (*Cube)(unsafe.Pointer(pCube)).Fheight))) &&
+ (*(*sqlite3_rtree_dbl)(unsafe.Pointer(aCoord + uintptr(3)*8)) >= (*Cube)(unsafe.Pointer(pCube)).Fy)) &&
+ (*(*sqlite3_rtree_dbl)(unsafe.Pointer(aCoord + uintptr(4)*8)) <= ((*Cube)(unsafe.Pointer(pCube)).Fz + (*Cube)(unsafe.Pointer(pCube)).Fdepth))) &&
+ (*(*sqlite3_rtree_dbl)(unsafe.Pointer(aCoord + uintptr(5)*8)) >= (*Cube)(unsafe.Pointer(pCube)).Fz) {
+ *(*int32)(unsafe.Pointer(piRes)) = 1
+ }
+
return 0
}
-func Sqlitetestrtree_Init(tls *crt.TLS, interp uintptr) int32 { /* test_rtree.c:507:5: */
- tcl.XTcl_CreateObjCommand(tls, interp, ts+33403 /* "register_cube_ge..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+func register_cube_geom(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_rtree.c:443:26: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ // var db uintptr at bp, 8
+
+ var rc int32
+
+ if objc != 2 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */)
+ return 1
+ }
+ if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
+ return 1
+ }
+ rc = sqlite3.Xsqlite3_rtree_geometry_callback(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+35464 /* "cube" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
+ }{cube_geom})), uintptr(unsafe.Pointer(&gHere)))
+ tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0))
+ return 0
+}
+
+func register_circle_geom(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_rtree.c:471:26: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ // var db uintptr at bp, 8
+
+ var rc int32
+
+ if objc != 2 {
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+1910 /* "DB" */)
+ return 1
+ }
+ if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
+ return 1
+ }
+ rc = sqlite3.Xsqlite3_rtree_geometry_callback(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+35469 /* "circle" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
+ }{circle_geom})), uintptr(0))
+ if rc == 0 {
+ rc = sqlite3.Xsqlite3_rtree_query_callback(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+35476, /* "Qcircle" */
+ *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{circle_query_func})), uintptr(0), uintptr(0))
+ }
+ if rc == 0 {
+ rc = sqlite3.Xsqlite3_rtree_query_callback(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+35484, /* "breadthfirstsear..." */
+ *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{bfs_query_func})), uintptr(0), uintptr(0))
+ }
+ tcl.XTcl_SetResult(tls, interp, sqlite3.Xsqlite3ErrName(tls, rc), uintptr(0))
+ return 0
+}
+
+func Sqlitetestrtree_Init(tls *libc.TLS, interp uintptr) int32 { /* test_rtree.c:507:5: */
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+35503 /* "register_cube_ge..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{register_cube_geom})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+33422 /* "register_circle_..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+35522 /* "register_circle_..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{register_circle_geom})), uintptr(0), uintptr(0))
return 0
}
@@ -66943,31 +72270,31 @@ type schema_cursor = schema_cursor1 /* test_schema.c:54:30 */
// None of this works unless we have virtual tables.
// Table destructor for the schema module.
-func schemaDestroy(tls *crt.TLS, pVtab uintptr) int32 { /* test_schema.c:79:12: */
+func schemaDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* test_schema.c:79:12: */
sqlite3.Xsqlite3_free(tls, pVtab)
return 0
}
// Table constructor for the schema module.
-func schemaCreate(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_schema.c:87:12: */
+func schemaCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_schema.c:87:12: */
var rc int32 = 7
var pVtab uintptr = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(schema_vtab{})))
if pVtab != 0 {
- crt.Xmemset(tls, pVtab, 0, uint64(unsafe.Sizeof(schema_vtab{})))
+ libc.Xmemset(tls, pVtab, 0, uint64(unsafe.Sizeof(schema_vtab{})))
(*schema_vtab)(unsafe.Pointer(pVtab)).Fdb = db
- rc = sqlite3.Xsqlite3_declare_vtab(tls, db /* Name of database (i.e. main, temp etc.) */ /* Name of table */ /* Column number (from left-to-right, 0 upward) */ /* Column name */ /* Specified type (i.e. VARCHAR(32)) */ /* Boolean. True if NOT NULL was specified */ /* Default value for this column */ /* True if this column is part of the primary key */, ts+33443 /* "CREATE TABLE x(d..." */)
+ rc = sqlite3.Xsqlite3_declare_vtab(tls, db /* Name of database (i.e. main, temp etc.) */ /* Name of table */ /* Column number (from left-to-right, 0 upward) */ /* Column name */ /* Specified type (i.e. VARCHAR(32)) */ /* Boolean. True if NOT NULL was specified */ /* Default value for this column */ /* True if this column is part of the primary key */, ts+35543 /* "CREATE TABLE x(d..." */)
}
*(*uintptr)(unsafe.Pointer(ppVtab)) = pVtab
return rc
}
// Open a new cursor on the schema table.
-func schemaOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_schema.c:110:12: */
+func schemaOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_schema.c:110:12: */
var rc int32 = 7
var pCur uintptr
pCur = sqlite3.Xsqlite3_malloc(tls, int32(unsafe.Sizeof(schema_cursor{})))
if pCur != 0 {
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(schema_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(schema_cursor{})))
*(*uintptr)(unsafe.Pointer(ppCursor)) = pCur
rc = 0
}
@@ -66975,7 +72302,7 @@ func schemaOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_s
}
// Close a schema table cursor.
-func schemaClose(tls *crt.TLS, cur uintptr) int32 { /* test_schema.c:125:12: */
+func schemaClose(tls *libc.TLS, cur uintptr) int32 { /* test_schema.c:125:12: */
var pCur uintptr = cur
sqlite3.Xsqlite3_finalize(tls, (*schema_cursor)(unsafe.Pointer(pCur)).FpDbList)
sqlite3.Xsqlite3_finalize(tls, (*schema_cursor)(unsafe.Pointer(pCur)).FpTableList)
@@ -66985,7 +72312,7 @@ func schemaClose(tls *crt.TLS, cur uintptr) int32 { /* test_schema.c:125:12: */
}
// Retrieve a column of data.
-func schemaColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_schema.c:137:12: */
+func schemaColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_schema.c:137:12: */
var pCur uintptr = cur
switch i {
case 0:
@@ -67002,19 +72329,19 @@ func schemaColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* te
}
// Retrieve the current rowid.
-func schemaRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* test_schema.c:156:12: */
+func schemaRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* test_schema.c:156:12: */
var pCur uintptr = cur
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = sqlite_int64((*schema_cursor)(unsafe.Pointer(pCur)).Frowid)
return 0
}
-func finalize(tls *crt.TLS, ppStmt uintptr) int32 { /* test_schema.c:162:12: */
+func finalize(tls *libc.TLS, ppStmt uintptr) int32 { /* test_schema.c:162:12: */
var rc int32 = sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(ppStmt)))
*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
return rc
}
-func schemaEof(tls *crt.TLS, cur uintptr) int32 { /* test_schema.c:168:12: */
+func schemaEof(tls *libc.TLS, cur uintptr) int32 { /* test_schema.c:168:12: */
var pCur uintptr = cur
return func() int32 {
if (*schema_cursor)(unsafe.Pointer(pCur)).FpDbList != 0 {
@@ -67025,7 +72352,7 @@ func schemaEof(tls *crt.TLS, cur uintptr) int32 { /* test_schema.c:168:12: */
}
// Advance the cursor to the next row.
-func schemaNext(tls *crt.TLS, cur uintptr) int32 { /* test_schema.c:176:12: */
+func schemaNext(tls *libc.TLS, cur uintptr) int32 { /* test_schema.c:176:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -67043,7 +72370,7 @@ __1:
if !(!(int32((*schema_cursor)(unsafe.Pointer(pCur)).FpColumnList) != 0) || (100 != sqlite3.Xsqlite3_step(tls, (*schema_cursor)(unsafe.Pointer(pCur)).FpColumnList))) {
goto __2
}
- if !(0 != (crt.AssignInt32(&rc, finalize(tls, (pCur+24 /* &.pColumnList */))))) {
+ if !(0 != (libc.AssignInt32(&rc, finalize(tls, (pCur+24 /* &.pColumnList */))))) {
goto __3
}
goto next_exit
@@ -67054,7 +72381,7 @@ __4:
if !(!(int32((*schema_cursor)(unsafe.Pointer(pCur)).FpTableList) != 0) || (100 != sqlite3.Xsqlite3_step(tls, (*schema_cursor)(unsafe.Pointer(pCur)).FpTableList))) {
goto __5
}
- if !(0 != (crt.AssignInt32(&rc, finalize(tls, (pCur+16 /* &.pTableList */))))) {
+ if !(0 != (libc.AssignInt32(&rc, finalize(tls, (pCur+16 /* &.pTableList */))))) {
goto __6
}
goto next_exit
@@ -67072,20 +72399,20 @@ __8:
;
// Set zSql to the SQL to pull the list of tables from the
- // sqlite_master (or sqlite_temp_master) table of the database
+ // sqlite_schema (or sqlite_temp_schema) table of the database
// identified by the row pointed to by the SQL statement pCur->pDbList
// (iterating through a "PRAGMA database_list;" statement).
if !(sqlite3.Xsqlite3_column_int(tls, (*schema_cursor)(unsafe.Pointer(pCur)).FpDbList, 0) == 1) {
goto __9
}
zSql = sqlite3.Xsqlite3_mprintf(tls,
- ts+33515 /* "SELECT name FROM..." */, 0)
+ ts+35615 /* "SELECT name FROM..." */, 0)
goto __10
__9:
pDbList = (*schema_cursor)(unsafe.Pointer(pCur)).FpDbList
zSql = sqlite3.Xsqlite3_mprintf(tls,
- ts+33570, /* "SELECT name FROM..." */
- crt.VaList(bp, sqlite3.Xsqlite3_column_text(tls, pDbList, 1)))
+ ts+35670, /* "SELECT name FROM..." */
+ libc.VaList(bp, sqlite3.Xsqlite3_column_text(tls, pDbList, 1)))
__10:
;
if !(!(zSql != 0)) {
@@ -67111,8 +72438,8 @@ __5:
// Set zSql to the SQL to the table_info pragma for the table currently
// identified by the rows pointed to by statements pCur->pDbList and
// pCur->pTableList.
- zSql = sqlite3.Xsqlite3_mprintf(tls, ts+33623, /* "PRAGMA %Q.table_..." */
- crt.VaList(bp+8, sqlite3.Xsqlite3_column_text(tls, (*schema_cursor)(unsafe.Pointer(pCur)).FpDbList, 1),
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+35723, /* "PRAGMA %Q.table_..." */
+ libc.VaList(bp+8, sqlite3.Xsqlite3_column_text(tls, (*schema_cursor)(unsafe.Pointer(pCur)).FpDbList, 1),
sqlite3.Xsqlite3_column_text(tls, (*schema_cursor)(unsafe.Pointer(pCur)).FpTableList, 0)))
if !(!(zSql != 0)) {
@@ -67141,7 +72468,7 @@ next_exit:
}
// Reset a schema table cursor.
-func schemaFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_schema.c:247:12: */
+func schemaFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_schema.c:247:12: */
var rc int32
var pVtab uintptr = (*sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab
var pCur uintptr = pVtabCursor
@@ -67149,7 +72476,7 @@ func schemaFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
finalize(tls, (pCur + 16 /* &.pTableList */))
finalize(tls, (pCur + 24 /* &.pColumnList */))
finalize(tls, (pCur + 8 /* &.pDbList */))
- rc = sqlite3.Xsqlite3_prepare(tls, (*schema_vtab)(unsafe.Pointer(pVtab)).Fdb, ts+33648 /* "PRAGMA database_..." */, -1, (pCur + 8 /* &.pDbList */), uintptr(0))
+ rc = sqlite3.Xsqlite3_prepare(tls, (*schema_vtab)(unsafe.Pointer(pVtab)).Fdb, ts+35748 /* "PRAGMA database_..." */, -1, (pCur + 8 /* &.pDbList */), uintptr(0))
return func() int32 {
if rc == 0 {
return schemaNext(tls, pVtabCursor)
@@ -67159,7 +72486,7 @@ func schemaFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
}
// Analyse the WHERE condition.
-func schemaBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_schema.c:266:12: */
+func schemaBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_schema.c:266:12: */
return 0
}
@@ -67183,7 +72510,7 @@ uintptr(0), // xRename
} /* test_schema.c:274:23 */
// Register the schema virtual table module.
-func register_schema_module(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_schema.c:309:26: */
+func register_schema_module(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_schema.c:309:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -67196,30 +72523,30 @@ func register_schema_module(tls *crt.TLS, clientData ClientData, interp uintptr,
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
return 1
}
- sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+3350 /* "schema" */, uintptr(unsafe.Pointer(&schemaModule)), uintptr(0))
+ sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+4499 /* "schema" */, uintptr(unsafe.Pointer(&schemaModule)), uintptr(0))
return 0
}
// Register commands with the TCL interpreter.
-func Sqlitetestschema_Init(tls *crt.TLS, interp uintptr) int32 { /* test_schema.c:330:5: */
+func Sqlitetestschema_Init(tls *libc.TLS, interp uintptr) int32 { /* test_schema.c:330:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd11)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd12)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd11[i].FzName,
- aObjCmd11[i].FxProc, aObjCmd11[i].FclientData, uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd12[i].FzName,
+ aObjCmd12[i].FxProc, aObjCmd12[i].FclientData, uintptr(0))
}
return 0
}
-var aObjCmd11 = [1]struct {
+var aObjCmd12 = [1]struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{
- {FzName: ts + 33669 /* "register_schema_..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 35769 /* "register_schema_..." */, FxProc: 0, FclientData: uintptr(0)},
} /* test_schema.c:335:5 */
// 2001-09-15
@@ -67400,13 +72727,13 @@ var g4 = ServerState{FqueueMutex: pthread_mutex_t{F__data: __pthread_mutex_s{F__
// The mutex and condition variable in the message are uninitialized
// when this routine is called. This routine takes care of
// initializing them and destroying them when it has finished.
-func sendToServer(tls *crt.TLS, pMsg uintptr) { /* test_server.c:272:13: */
+func sendToServer(tls *libc.TLS, pMsg uintptr) { /* test_server.c:272:13: */
// Initialize the mutex and condition variable on the message
- crt2.Xpthread_mutex_init(tls, (pMsg + 72 /* &.clientMutex */), uintptr(0))
- crt2.Xpthread_cond_init(tls, (pMsg + 112 /* &.clientWakeup */), uintptr(0))
+ libc2.Xpthread_mutex_init(tls, (pMsg + 72 /* &.clientMutex */), uintptr(0))
+ libc2.Xpthread_cond_init(tls, (pMsg + 112 /* &.clientWakeup */), uintptr(0))
// Add the message to the head of the server's message queue.
- crt2.Xpthread_mutex_lock(tls, (uintptr(unsafe.Pointer(&g4)) /* &.queueMutex */))
+ libc2.Xpthread_mutex_lock(tls, (uintptr(unsafe.Pointer(&g4)) /* &.queueMutex */))
(*SqlMessage)(unsafe.Pointer(pMsg)).FpNext = g4.FpQueueHead
if g4.FpQueueHead == uintptr(0) {
g4.FpQueueTail = pMsg
@@ -67415,20 +72742,20 @@ func sendToServer(tls *crt.TLS, pMsg uintptr) { /* test_server.c:272:13: */
}
(*SqlMessage)(unsafe.Pointer(pMsg)).FpPrev = uintptr(0)
g4.FpQueueHead = pMsg
- crt2.Xpthread_mutex_unlock(tls, (uintptr(unsafe.Pointer(&g4)) /* &.queueMutex */))
+ libc2.Xpthread_mutex_unlock(tls, (uintptr(unsafe.Pointer(&g4)) /* &.queueMutex */))
// Signal the server that the new message has be queued, then
// block waiting for the server to process the message.
- crt2.Xpthread_mutex_lock(tls, (pMsg + 72 /* &.clientMutex */))
- crt2.Xpthread_cond_signal(tls, (uintptr(unsafe.Pointer(&g4)) + 80 /* &.serverWakeup */))
+ libc2.Xpthread_mutex_lock(tls, (pMsg + 72 /* &.clientMutex */))
+ libc2.Xpthread_cond_signal(tls, (uintptr(unsafe.Pointer(&g4)) + 80 /* &.serverWakeup */))
for (*SqlMessage)(unsafe.Pointer(pMsg)).Fop != 7 {
- crt2.Xpthread_cond_wait(tls, (pMsg + 112 /* &.clientWakeup */), (pMsg + 72 /* &.clientMutex */))
+ libc2.Xpthread_cond_wait(tls, (pMsg + 112 /* &.clientWakeup */), (pMsg + 72 /* &.clientMutex */))
}
- crt2.Xpthread_mutex_unlock(tls, (pMsg + 72 /* &.clientMutex */))
+ libc2.Xpthread_mutex_unlock(tls, (pMsg + 72 /* &.clientMutex */))
// Destroy the mutex and condition variable of the message.
- crt2.Xpthread_mutex_destroy(tls, (pMsg + 72 /* &.clientMutex */))
- crt2.Xpthread_cond_destroy(tls, (pMsg + 112 /* &.clientWakeup */))
+ libc2.Xpthread_mutex_destroy(tls, (pMsg + 72 /* &.clientMutex */))
+ libc2.Xpthread_cond_destroy(tls, (pMsg + 112 /* &.clientWakeup */))
}
// The following 6 routines are client-side implementations of the
@@ -67454,7 +72781,7 @@ func sendToServer(tls *crt.TLS, pMsg uintptr) { /* test_server.c:272:13: */
// Each of these routines creates a message for the desired operation,
// sends that message to the server, waits for the server to process
// then message and return a response.
-func sqlite3_client_open(tls *crt.TLS, zDatabaseName uintptr, ppDb uintptr) int32 { /* test_server.c:332:5: */
+func sqlite3_client_open(tls *libc.TLS, zDatabaseName uintptr, ppDb uintptr) int32 { /* test_server.c:332:5: */
bp := tls.Alloc(160)
defer tls.Free(160)
@@ -67466,7 +72793,7 @@ func sqlite3_client_open(tls *crt.TLS, zDatabaseName uintptr, ppDb uintptr) int3
*(*uintptr)(unsafe.Pointer(ppDb)) = (*SqlMessage)(unsafe.Pointer(bp /* &msg */)).FpDb
return (*SqlMessage)(unsafe.Pointer(bp /* &msg */)).FerrCode
}
-func sqlite3_client_prepare(tls *crt.TLS, pDb uintptr, zSql uintptr, nByte int32, ppStmt uintptr, pzTail uintptr) int32 { /* test_server.c:340:5: */
+func sqlite3_client_prepare(tls *libc.TLS, pDb uintptr, zSql uintptr, nByte int32, ppStmt uintptr, pzTail uintptr) int32 { /* test_server.c:340:5: */
bp := tls.Alloc(160)
defer tls.Free(160)
@@ -67483,7 +72810,7 @@ func sqlite3_client_prepare(tls *crt.TLS, pDb uintptr, zSql uintptr, nByte int32
}
return (*SqlMessage)(unsafe.Pointer(bp /* &msg */)).FerrCode
}
-func sqlite3_client_step(tls *crt.TLS, pStmt uintptr) int32 { /* test_server.c:357:5: */
+func sqlite3_client_step(tls *libc.TLS, pStmt uintptr) int32 { /* test_server.c:357:5: */
bp := tls.Alloc(160)
defer tls.Free(160)
@@ -67494,7 +72821,7 @@ func sqlite3_client_step(tls *crt.TLS, pStmt uintptr) int32 { /* test_server.c:3
sendToServer(tls, bp /* &msg */)
return (*SqlMessage)(unsafe.Pointer(bp /* &msg */)).FerrCode
}
-func sqlite3_client_reset(tls *crt.TLS, pStmt uintptr) int32 { /* test_server.c:364:5: */
+func sqlite3_client_reset(tls *libc.TLS, pStmt uintptr) int32 { /* test_server.c:364:5: */
bp := tls.Alloc(160)
defer tls.Free(160)
@@ -67505,7 +72832,7 @@ func sqlite3_client_reset(tls *crt.TLS, pStmt uintptr) int32 { /* test_server.c:
sendToServer(tls, bp /* &msg */)
return (*SqlMessage)(unsafe.Pointer(bp /* &msg */)).FerrCode
}
-func sqlite3_client_finalize(tls *crt.TLS, pStmt uintptr) int32 { /* test_server.c:371:5: */
+func sqlite3_client_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* test_server.c:371:5: */
bp := tls.Alloc(160)
defer tls.Free(160)
@@ -67516,7 +72843,7 @@ func sqlite3_client_finalize(tls *crt.TLS, pStmt uintptr) int32 { /* test_server
sendToServer(tls, bp /* &msg */)
return (*SqlMessage)(unsafe.Pointer(bp /* &msg */)).FerrCode
}
-func sqlite3_client_close(tls *crt.TLS, pDb uintptr) int32 { /* test_server.c:378:5: */
+func sqlite3_client_close(tls *libc.TLS, pDb uintptr) int32 { /* test_server.c:378:5: */
bp := tls.Alloc(160)
defer tls.Free(160)
@@ -67533,8 +72860,8 @@ func sqlite3_client_close(tls *crt.TLS, pDb uintptr) int32 { /* test_server.c:37
// on this procedure. See the sqlite3_server_start() routine below
// for an example. This procedure loops until g.serverHalt becomes
// true.
-func sqlite3_server(tls *crt.TLS, NotUsed uintptr) uintptr { /* test_server.c:393:6: */
- if crt2.Xpthread_mutex_trylock(tls, (uintptr(unsafe.Pointer(&g4))+40 /* &.serverMutex */)) != 0 {
+func sqlite3_server(tls *libc.TLS, NotUsed uintptr) uintptr { /* test_server.c:393:6: */
+ if libc2.Xpthread_mutex_trylock(tls, (uintptr(unsafe.Pointer(&g4))+40 /* &.serverMutex */)) != 0 {
return uintptr(0)
}
sqlite3.Xsqlite3_enable_shared_cache(tls, 1)
@@ -67542,9 +72869,9 @@ func sqlite3_server(tls *crt.TLS, NotUsed uintptr) uintptr { /* test_server.c:39
var pMsg uintptr
// Remove the last message from the message queue.
- crt2.Xpthread_mutex_lock(tls, (uintptr(unsafe.Pointer(&g4)) /* &.queueMutex */))
+ libc2.Xpthread_mutex_lock(tls, (uintptr(unsafe.Pointer(&g4)) /* &.queueMutex */))
for (g4.FpQueueTail == uintptr(0)) && (g4.FserverHalt == 0) {
- crt2.Xpthread_cond_wait(tls, (uintptr(unsafe.Pointer(&g4)) + 80 /* &.serverWakeup */), (uintptr(unsafe.Pointer(&g4)) /* &.queueMutex */))
+ libc2.Xpthread_cond_wait(tls, (uintptr(unsafe.Pointer(&g4)) + 80 /* &.serverWakeup */), (uintptr(unsafe.Pointer(&g4)) /* &.queueMutex */))
}
pMsg = g4.FpQueueTail
if pMsg != 0 {
@@ -67555,13 +72882,13 @@ func sqlite3_server(tls *crt.TLS, NotUsed uintptr) uintptr { /* test_server.c:39
}
g4.FpQueueTail = (*SqlMessage)(unsafe.Pointer(pMsg)).FpPrev
}
- crt2.Xpthread_mutex_unlock(tls, (uintptr(unsafe.Pointer(&g4)) /* &.queueMutex */))
+ libc2.Xpthread_mutex_unlock(tls, (uintptr(unsafe.Pointer(&g4)) /* &.queueMutex */))
if pMsg == uintptr(0) {
break
}
// Process the message just removed
- crt2.Xpthread_mutex_lock(tls, (pMsg + 72 /* &.clientMutex */))
+ libc2.Xpthread_mutex_lock(tls, (pMsg + 72 /* &.clientMutex */))
switch (*SqlMessage)(unsafe.Pointer(pMsg)).Fop {
case 1:
{
@@ -67598,17 +72925,17 @@ func sqlite3_server(tls *crt.TLS, NotUsed uintptr) uintptr { /* test_server.c:39
// Signal the client that the message has been processed.
(*SqlMessage)(unsafe.Pointer(pMsg)).Fop = 7
- crt2.Xpthread_mutex_unlock(tls, (pMsg + 72 /* &.clientMutex */))
- crt2.Xpthread_cond_signal(tls, (pMsg + 112 /* &.clientWakeup */))
+ libc2.Xpthread_mutex_unlock(tls, (pMsg + 72 /* &.clientMutex */))
+ libc2.Xpthread_cond_signal(tls, (pMsg + 112 /* &.clientWakeup */))
}
- crt2.Xpthread_mutex_unlock(tls, (uintptr(unsafe.Pointer(&g4)) + 40 /* &.serverMutex */))
+ libc2.Xpthread_mutex_unlock(tls, (uintptr(unsafe.Pointer(&g4)) + 40 /* &.serverMutex */))
return uintptr(0)
}
// Start a server thread if one is not already running. If there
// is aleady a server thread running, the new thread will quickly
// die and this routine is effectively a no-op.
-func sqlite3_server_start(tls *crt.TLS) { /* test_server.c:465:6: */
+func sqlite3_server_start(tls *libc.TLS) { /* test_server.c:465:6: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -67616,18 +72943,18 @@ func sqlite3_server_start(tls *crt.TLS) { /* test_server.c:465:6: */
var rc int32
g4.FserverHalt = 0
- rc = crt2.Xpthread_create(tls, bp /* &x */, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) uintptr
+ rc = libc2.Xpthread_create(tls, bp /* &x */, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) uintptr
}{sqlite3_server})), uintptr(0))
if rc == 0 {
- crt2.Xpthread_detach(tls, *(*pthread_t)(unsafe.Pointer(bp /* x */)))
+ libc2.Xpthread_detach(tls, *(*pthread_t)(unsafe.Pointer(bp /* x */)))
}
}
// A wrapper around sqlite3_server() that decrements the int variable
// pointed to by the first argument after the sqlite3_server() call
// returns.
-func serverWrapper(tls *crt.TLS, pnDecr uintptr) uintptr { /* test_server.c:480:13: */
+func serverWrapper(tls *libc.TLS, pnDecr uintptr) uintptr { /* test_server.c:480:13: */
var p uintptr = sqlite3_server(tls, uintptr(0))
(*(*int32)(unsafe.Pointer(pnDecr)))--
return p
@@ -67636,7 +72963,7 @@ func serverWrapper(tls *crt.TLS, pnDecr uintptr) uintptr { /* test_server.c:480:
// This function is the similar to sqlite3_server_start(), except that
// the integer pointed to by the first argument is decremented when
// the server thread exits.
-func sqlite3_server_start2(tls *crt.TLS, pnDecr uintptr) { /* test_server.c:491:6: */
+func sqlite3_server_start2(tls *libc.TLS, pnDecr uintptr) { /* test_server.c:491:6: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -67644,11 +72971,11 @@ func sqlite3_server_start2(tls *crt.TLS, pnDecr uintptr) { /* test_server.c:491:
var rc int32
g4.FserverHalt = 0
- rc = crt2.Xpthread_create(tls, bp /* &x */, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) uintptr
+ rc = libc2.Xpthread_create(tls, bp /* &x */, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) uintptr
}{serverWrapper})), pnDecr)
if rc == 0 {
- crt2.Xpthread_detach(tls, *(*pthread_t)(unsafe.Pointer(bp /* x */)))
+ libc2.Xpthread_detach(tls, *(*pthread_t)(unsafe.Pointer(bp /* x */)))
}
}
@@ -67657,11 +72984,11 @@ func sqlite3_server_start2(tls *crt.TLS, pnDecr uintptr) { /* test_server.c:491:
//
// This routine waits until the server has actually stopped before
// returning.
-func sqlite3_server_stop(tls *crt.TLS) { /* test_server.c:508:6: */
+func sqlite3_server_stop(tls *libc.TLS) { /* test_server.c:508:6: */
g4.FserverHalt = 1
- crt2.Xpthread_cond_broadcast(tls, (uintptr(unsafe.Pointer(&g4)) + 80 /* &.serverWakeup */))
- crt2.Xpthread_mutex_lock(tls, (uintptr(unsafe.Pointer(&g4)) + 40 /* &.serverMutex */))
- crt2.Xpthread_mutex_unlock(tls, (uintptr(unsafe.Pointer(&g4)) + 40 /* &.serverMutex */))
+ libc2.Xpthread_cond_broadcast(tls, (uintptr(unsafe.Pointer(&g4)) + 80 /* &.serverWakeup */))
+ libc2.Xpthread_mutex_lock(tls, (uintptr(unsafe.Pointer(&g4)) + 40 /* &.serverMutex */))
+ libc2.Xpthread_mutex_unlock(tls, (uintptr(unsafe.Pointer(&g4)) + 40 /* &.serverMutex */))
}
// Copyright (C) 1991-2018 Free Software Foundation, Inc.
@@ -67736,12 +73063,12 @@ type Superlock = Superlock1 /* test_superlock.c:45:26 */
// The pCtx pointer passed to this function is actually a pointer to a
// SuperlockBusy structure. Invoke the busy-handler function encapsulated
// by the structure and return the result.
-func superlockBusyHandler(tls *crt.TLS, pCtx uintptr, UNUSED int32) int32 { /* test_superlock.c:52:12: */
+func superlockBusyHandler(tls *libc.TLS, pCtx uintptr, UNUSED int32) int32 { /* test_superlock.c:52:12: */
var pBusy uintptr = pCtx
if (*SuperlockBusy)(unsafe.Pointer(pBusy)).FxBusy == uintptr(0) {
return 0
}
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((pBusy /* &.xBusy */))))(tls, (*SuperlockBusy)(unsafe.Pointer(pBusy)).FpBusyArg, crt.PostIncInt32(&(*SuperlockBusy)(unsafe.Pointer(pBusy)).FnBusy, 1))
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pBusy /* &.xBusy */))))(tls, (*SuperlockBusy)(unsafe.Pointer(pBusy)).FpBusyArg, libc.PostIncInt32(&(*SuperlockBusy)(unsafe.Pointer(pBusy)).FnBusy, 1))
}
// This function is used to determine if the main database file for
@@ -67751,7 +73078,7 @@ func superlockBusyHandler(tls *crt.TLS, pCtx uintptr, UNUSED int32) int32 { /* t
//
// If an error occurs, return an SQLite error code. The value of *pbWal
// is undefined in this case.
-func superlockIsWal(tls *crt.TLS, pLock uintptr) int32 { /* test_superlock.c:67:12: */
+func superlockIsWal(tls *libc.TLS, pLock uintptr) int32 { /* test_superlock.c:67:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -67759,7 +73086,7 @@ func superlockIsWal(tls *crt.TLS, pLock uintptr) int32 { /* test_superlock.c:67:
// var pStmt uintptr at bp, 8
// Compiled PRAGMA journal_mode statement
- rc = sqlite3.Xsqlite3_prepare(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, ts+33692 /* "PRAGMA main.jour..." */, -1, bp /* &pStmt */, uintptr(0))
+ rc = sqlite3.Xsqlite3_prepare(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, ts+35792 /* "PRAGMA main.jour..." */, -1, bp /* &pStmt */, uintptr(0))
if rc != 0 {
return rc
}
@@ -67767,7 +73094,7 @@ func superlockIsWal(tls *crt.TLS, pLock uintptr) int32 { /* test_superlock.c:67:
(*Superlock)(unsafe.Pointer(pLock)).FbWal = 0
if 100 == sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) {
var zMode uintptr = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 0)
- if ((zMode != 0) && (crt.Xstrlen(tls, zMode) == uint64(3))) && (sqlite3.Xsqlite3_strnicmp(tls, ts+26690 /* "wal" */, zMode, 3) == 0) {
+ if ((zMode != 0) && (libc.Xstrlen(tls, zMode) == uint64(3))) && (sqlite3.Xsqlite3_strnicmp(tls, ts+28782 /* "wal" */, zMode, 3) == 0) {
(*Superlock)(unsafe.Pointer(pLock)).FbWal = 1
}
}
@@ -67779,18 +73106,18 @@ func superlockIsWal(tls *crt.TLS, pLock uintptr) int32 { /* test_superlock.c:67:
// of the file fd. If the lock cannot be obtained immediately, invoke
// the busy-handler until either it is obtained or the busy-handler
// callback returns 0.
-func superlockShmLock(tls *crt.TLS, fd uintptr, idx int32, nByte int32, pBusy uintptr) int32 { /* test_superlock.c:91:12: */
+func superlockShmLock(tls *libc.TLS, fd uintptr, idx int32, nByte int32, pBusy uintptr) int32 { /* test_superlock.c:91:12: */
var rc int32
var xShmLock uintptr = (*sqlite3_io_methods1)(unsafe.Pointer((*sqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FxShmLock
for ok := true; ok; ok = ((rc == 5) && (superlockBusyHandler(tls, pBusy, 0) != 0)) {
- rc = (*(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&xShmLock)))(tls, fd, idx, nByte, (2 | 8))
+ rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&xShmLock)))(tls, fd, idx, nByte, (2 | 8))
}
return rc
}
// Obtain the extra locks on the database file required for WAL databases.
// Invoke the supplied busy-handler as required.
-func superlockWalLock(tls *crt.TLS, db uintptr, pBusy uintptr) int32 { /* test_superlock.c:109:12: */
+func superlockWalLock(tls *libc.TLS, db uintptr, pBusy uintptr) int32 { /* test_superlock.c:109:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -67817,11 +73144,11 @@ func superlockWalLock(tls *crt.TLS, db uintptr, pBusy uintptr) int32 { /* test_s
// lock that this process is holding to do that, no new read or write
// transactions may now be opened. Nor can a checkpoint be run, for the
// same reason.
- rc = (*(*func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* fd */)))).FpMethods + 104 /* &.xShmMap */))))(tls, *(*uintptr)(unsafe.Pointer(bp /* fd */)), 0, (32 * 1024), 1, bp+8 /* &p */)
+ rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* fd */)))).FpMethods + 104 /* &.xShmMap */))))(tls, *(*uintptr)(unsafe.Pointer(bp /* fd */)), 0, (32 * 1024), 1, bp+8 /* &p */)
if rc != 0 {
return rc
}
- crt.Xmemset(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p */)), 0, uint64(32))
+ libc.Xmemset(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p */)), 0, uint64(32))
// Obtain exclusive locks on all the "read-lock" slots. Once these locks
// are held, it is guaranteed that there are no active reader, writer or
@@ -67833,7 +73160,7 @@ func superlockWalLock(tls *crt.TLS, db uintptr, pBusy uintptr) int32 { /* test_s
// Release a superlock held on a database file. The argument passed to
// this function must have been obtained from a successful call to
// sqlite3demo_superlock().
-func sqlite3demo_superunlock(tls *crt.TLS, pLock uintptr) { /* test_superlock.c:151:6: */
+func sqlite3demo_superunlock(tls *libc.TLS, pLock uintptr) { /* test_superlock.c:151:6: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -67844,8 +73171,8 @@ func sqlite3demo_superunlock(tls *crt.TLS, pLock uintptr) { /* test_superlock.c:
*(*uintptr)(unsafe.Pointer(bp /* fd */)) = uintptr(0)
rc = sqlite3.Xsqlite3_file_control(tls, (*Superlock)(unsafe.Pointer(p)).Fdb, ts+84 /* "main" */, 7, bp /* &fd */)
if rc == 0 {
- (*(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* fd */)))).FpMethods + 112 /* &.xShmLock */))))(tls, *(*uintptr)(unsafe.Pointer(bp /* fd */)), 2, 1, flags)
- (*(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* fd */)))).FpMethods + 112 /* &.xShmLock */))))(tls, *(*uintptr)(unsafe.Pointer(bp /* fd */)), 3, (8 - 3), flags)
+ (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* fd */)))).FpMethods + 112 /* &.xShmLock */))))(tls, *(*uintptr)(unsafe.Pointer(bp /* fd */)), 2, 1, flags)
+ (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* fd */)))).FpMethods + 112 /* &.xShmLock */))))(tls, *(*uintptr)(unsafe.Pointer(bp /* fd */)), 3, (8 - 3), flags)
}
}
sqlite3.Xsqlite3_close(tls, (*Superlock)(unsafe.Pointer(p)).Fdb)
@@ -67865,7 +73192,7 @@ func sqlite3demo_superunlock(tls *crt.TLS, pLock uintptr) { /* test_superlock.c:
// as a busy-handler registered with SQLite (using sqlite3_busy_handler())
// until either the lock can be obtained or the busy-handler function returns
// 0 (indicating "give up").
-func sqlite3demo_superlock(tls *crt.TLS, zPath uintptr, zVfs uintptr, xBusy uintptr, pBusyArg uintptr, ppLock uintptr) int32 { /* test_superlock.c:182:5: */
+func sqlite3demo_superlock(tls *libc.TLS, zPath uintptr, zVfs uintptr, xBusy uintptr, pBusyArg uintptr, ppLock uintptr) int32 { /* test_superlock.c:182:5: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -67877,7 +73204,7 @@ func sqlite3demo_superlock(tls *crt.TLS, zPath uintptr, zVfs uintptr, xBusy uint
if !(pLock != 0) {
return 7
}
- crt.Xmemset(tls, pLock, 0, uint64(unsafe.Sizeof(Superlock{})))
+ libc.Xmemset(tls, pLock, 0, uint64(unsafe.Sizeof(Superlock{})))
// Open a database handle on the file to superlock.
rc = sqlite3.Xsqlite3_open_v2(tls,
@@ -67899,9 +73226,9 @@ func sqlite3demo_superlock(tls *crt.TLS, zPath uintptr, zVfs uintptr, xBusy uint
(*SuperlockBusy)(unsafe.Pointer(bp /* &busy */)).FxBusy = xBusy
(*SuperlockBusy)(unsafe.Pointer(bp /* &busy */)).FpBusyArg = pBusyArg
sqlite3.Xsqlite3_busy_handler(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{superlockBusyHandler})), bp /* &busy */)
- rc = sqlite3.Xsqlite3_exec(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, ts+11078 /* "BEGIN EXCLUSIVE" */, uintptr(0), uintptr(0), uintptr(0))
+ rc = sqlite3.Xsqlite3_exec(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, ts+12728 /* "BEGIN EXCLUSIVE" */, uintptr(0), uintptr(0), uintptr(0))
}
// If the BEGIN EXCLUSIVE was executed successfully and this is a WAL
@@ -67913,8 +73240,8 @@ func sqlite3demo_superlock(tls *crt.TLS, zPath uintptr, zVfs uintptr, xBusy uint
// to drop the WAL read and write locks currently held. Otherwise, the
// new WAL locks may conflict with the old.
if rc == 0 {
- if (0 == (crt.AssignInt32(&rc, superlockIsWal(tls, pLock)))) && ((*Superlock)(unsafe.Pointer(pLock)).FbWal != 0) {
- rc = sqlite3.Xsqlite3_exec(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, ts+9473 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0))
+ if (0 == (libc.AssignInt32(&rc, superlockIsWal(tls, pLock)))) && ((*Superlock)(unsafe.Pointer(pLock)).FbWal != 0) {
+ rc = sqlite3.Xsqlite3_exec(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, ts+11132 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0))
if rc == 0 {
rc = superlockWalLock(tls, (*Superlock)(unsafe.Pointer(pLock)).Fdb, bp /* &busy */)
}
@@ -67946,11 +73273,11 @@ type InterpAndScript1 = struct {
type InterpAndScript = InterpAndScript1 /* test_superlock.c:272:32 */
-func superunlock_del(tls *crt.TLS, cd ClientData) { /* test_superlock.c:274:27: */
+func superunlock_del(tls *libc.TLS, cd ClientData) { /* test_superlock.c:274:27: */
sqlite3demo_superunlock(tls, cd)
}
-func superunlock_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_superlock.c:278:26: */
+func superunlock_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_superlock.c:278:26: */
if objc != 1 {
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+488 /* "" */)
return 1
@@ -67959,7 +73286,7 @@ func superunlock_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, ob
return 0
}
-func superlock_busy(tls *crt.TLS, pCtx uintptr, nBusy int32) int32 { /* test_superlock.c:292:12: */
+func superlock_busy(tls *libc.TLS, pCtx uintptr, nBusy int32) int32 { /* test_superlock.c:292:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -67974,7 +73301,7 @@ func superlock_busy(tls *crt.TLS, pCtx uintptr, nBusy int32) int32 { /* test_sup
tcl.XTcl_GetIntFromObj(tls, (*InterpAndScript)(unsafe.Pointer(p)).Finterp, tcl.XTcl_GetObjResult(tls, (*InterpAndScript)(unsafe.Pointer(p)).Finterp), bp /* &iVal */)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pEval
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -67983,7 +73310,7 @@ func superlock_busy(tls *crt.TLS, pCtx uintptr, nBusy int32) int32 { /* test_sup
}
// Tclcmd: sqlite3demo_superlock CMDNAME PATH VFS BUSY-HANDLER-SCRIPT
-func superlock_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_superlock.c:310:26: */
+func superlock_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_superlock.c:310:26: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -67997,7 +73324,7 @@ func superlock_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, objv
if (objc < 3) || (objc > 5) {
tcl.XTcl_WrongNumArgs(tls,
- interp, 1, objv, ts+33717 /* "CMDNAME PATH ?VF..." */)
+ interp, 1, objv, ts+35817 /* "CMDNAME PATH ?VF..." */)
return 1
}
@@ -68005,7 +73332,7 @@ func superlock_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, objv
if objc > 3 {
zVfs = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)))
- if crt.Xstrlen(tls, zVfs) == uint64(0) {
+ if libc.Xstrlen(tls, zVfs) == uint64(0) {
zVfs = uintptr(0)
}
}
@@ -68013,7 +73340,7 @@ func superlock_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, objv
(*InterpAndScript)(unsafe.Pointer(bp + 16 /* &busy */)).Finterp = interp
(*InterpAndScript)(unsafe.Pointer(bp + 16 /* &busy */)).FpScript = *(*uintptr)(unsafe.Pointer(objv + uintptr(4)*8))
xBusy = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{superlock_busy}))
}
@@ -68021,21 +73348,21 @@ func superlock_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, objv
if rc != 0 {
tcl.XTcl_ResetResult(tls, interp)
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, sqlite3.Xsqlite3ErrStr(tls, rc), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, sqlite3.Xsqlite3ErrStr(tls, rc), 0))
return 1
}
tcl.XTcl_CreateObjCommand(tls,
interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
- }{superunlock_cmd})), *(*uintptr)(unsafe.Pointer(bp + 32 /* pLock */)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, ClientData) }{superunlock_del})))
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
+ }{superunlock_cmd})), *(*uintptr)(unsafe.Pointer(bp + 32 /* pLock */)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{superunlock_del})))
tcl.XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
return 0
}
-func SqliteSuperlock_Init(tls *crt.TLS, interp uintptr) int32 { /* test_superlock.c:359:5: */
- tcl.XTcl_CreateObjCommand(tls, interp, ts+33758 /* "sqlite3demo_supe..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
+func SqliteSuperlock_Init(tls *libc.TLS, interp uintptr) int32 { /* test_superlock.c:359:5: */
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+35858 /* "sqlite3demo_supe..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
}{superlock_cmd})), uintptr(0), uintptr(0))
return 0
}
@@ -68059,31 +73386,31 @@ type TestSyscallArray = struct {
}
var aSyscall = [19]TestSyscallArray{
- /* 0 */ {FzName: ts + 33780 /* "open" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 13, Fcustom_errno: 0},
- /* 1 */ {FzName: ts + 11270 /* "close" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 2 */ {FzName: ts + 33785 /* "access" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 3 */ {FzName: ts + 33792 /* "getcwd" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 4 */ {FzName: ts + 33799 /* "stat" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 5 */ {FzName: ts + 33804 /* "fstat" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 6 */ {FzName: ts + 33810 /* "ftruncate" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 5, Fcustom_errno: 0},
- /* 7 */ {FzName: ts + 33820 /* "fcntl" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 13, Fcustom_errno: 0},
- /* 8 */ {FzName: ts + 22005 /* "read" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 9 */ {FzName: ts + 33826 /* "pread" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 10 */ {FzName: ts + 33832 /* "pread64" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 11 */ {FzName: ts + 22010 /* "write" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 12 */ {FzName: ts + 33840 /* "pwrite" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 13 */ {FzName: ts + 33847 /* "pwrite64" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 14 */ {FzName: ts + 33856 /* "fchmod" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 15 */ {FzName: ts + 33863 /* "fallocate" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 16 */ {FzName: ts + 25793 /* "mmap" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
- /* 17 */ {FzName: ts + 33873 /* "mremap" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 0 */ {FzName: ts + 35880 /* "open" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 13, Fcustom_errno: 0},
+ /* 1 */ {FzName: ts + 9947 /* "close" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 2 */ {FzName: ts + 35885 /* "access" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 3 */ {FzName: ts + 35892 /* "getcwd" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 4 */ {FzName: ts + 35899 /* "stat" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 5 */ {FzName: ts + 35904 /* "fstat" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 6 */ {FzName: ts + 35910 /* "ftruncate" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 5, Fcustom_errno: 0},
+ /* 7 */ {FzName: ts + 35920 /* "fcntl" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 13, Fcustom_errno: 0},
+ /* 8 */ {FzName: ts + 24104 /* "read" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 9 */ {FzName: ts + 35926 /* "pread" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 10 */ {FzName: ts + 35932 /* "pread64" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 11 */ {FzName: ts + 24109 /* "write" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 12 */ {FzName: ts + 35940 /* "pwrite" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 13 */ {FzName: ts + 35947 /* "pwrite64" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 14 */ {FzName: ts + 35956 /* "fchmod" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 15 */ {FzName: ts + 35963 /* "fallocate" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 16 */ {FzName: ts + 27885 /* "mmap" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
+ /* 17 */ {FzName: ts + 35973 /* "mremap" */, FxTest: 0, FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
{FzName: uintptr(0), FxTest: uintptr(0), FxOrig: uintptr(0), Fdefault_errno: 0, Fcustom_errno: 0},
} /* test_syscall.c:133:3 */
// This function is called exactly once from within each invocation of a
// system call wrapper in this file. It returns 1 if the function should
// fail, or 0 if it should succeed.
-func tsIsFail(tls *crt.TLS) int32 { /* test_syscall.c:181:12: */
+func tsIsFail(tls *libc.TLS) int32 { /* test_syscall.c:181:12: */
gSyscall.FnCount--
if (gSyscall.FnCount == 0) || ((gSyscall.FnFail != 0) && (gSyscall.FbPersist != 0)) {
gSyscall.FnFail++
@@ -68098,14 +73425,14 @@ func tsIsFail(tls *crt.TLS) int32 { /* test_syscall.c:181:12: */
// Usually, the current error-number is the value that errno should be set
// to if the named system call fails. The exception is "fallocate". See
// comments above the implementation of ts_fallocate() for details.
-func tsErrno(tls *crt.TLS, zFunc uintptr) int32 { /* test_syscall.c:198:12: */
+func tsErrno(tls *libc.TLS, zFunc uintptr) int32 { /* test_syscall.c:198:12: */
var i int32
- var nFunc int32 = int32(crt.Xstrlen(tls, zFunc))
+ var nFunc int32 = int32(libc.Xstrlen(tls, zFunc))
for i = 0; aSyscall[i].FzName != 0; i++ {
- if crt.Xstrlen(tls, aSyscall[i].FzName) != size_t(nFunc) {
+ if libc.Xstrlen(tls, aSyscall[i].FzName) != size_t(nFunc) {
continue
}
- if crt.Xmemcmp(tls, aSyscall[i].FzName, zFunc, uint64(nFunc)) != 0 {
+ if libc.Xmemcmp(tls, aSyscall[i].FzName, zFunc, uint64(nFunc)) != 0 {
continue
}
return aSyscall[i].Fcustom_errno
@@ -68118,149 +73445,149 @@ func tsErrno(tls *crt.TLS, zFunc uintptr) int32 { /* test_syscall.c:198:12: */
** A wrapper around tsIsFail(). If tsIsFail() returns non-zero, set the
** value of errno before returning.
*/
-func tsIsFailErrno(tls *crt.TLS, zFunc uintptr) int32 { /* test_syscall.c:215:12: */
+func tsIsFailErrno(tls *libc.TLS, zFunc uintptr) int32 { /* test_syscall.c:215:12: */
if tsIsFail(tls) != 0 {
- (*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) = tsErrno(tls, zFunc)
+ (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) = tsErrno(tls, zFunc)
return 1
}
return 0
}
// A wrapper around open().
-func ts_open(tls *crt.TLS, zFile uintptr, flags int32, mode int32) int32 { /* test_syscall.c:226:12: */
- if tsIsFailErrno(tls, ts+33780 /* "open" */) != 0 {
+func ts_open(tls *libc.TLS, zFile uintptr, flags int32, mode int32) int32 { /* test_syscall.c:226:12: */
+ if tsIsFailErrno(tls, ts+35880 /* "open" */) != 0 {
return -1
}
- return (*(*func(*crt.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(0)*32 + 16 /* &.xOrig */))))(tls, zFile, flags, mode)
+ return (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(0)*32 + 16 /* &.xOrig */))))(tls, zFile, flags, mode)
}
// A wrapper around close().
-func ts_close(tls *crt.TLS, fd int32) int32 { /* test_syscall.c:236:12: */
+func ts_close(tls *libc.TLS, fd int32) int32 { /* test_syscall.c:236:12: */
if tsIsFail(tls) != 0 {
// Even if simulating an error, close the original file-descriptor.
// This is to stop the test process from running out of file-descriptors
// when running a long test. If a call to close() appears to fail, SQLite
// never attempts to use the file-descriptor afterwards (or even to close
// it a second time).
- (*(*func(*crt.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(1)*32 + 16 /* &.xOrig */))))(tls, fd)
+ (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(1)*32 + 16 /* &.xOrig */))))(tls, fd)
return -1
}
- return (*(*func(*crt.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(1)*32 + 16 /* &.xOrig */))))(tls, fd)
+ return (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(1)*32 + 16 /* &.xOrig */))))(tls, fd)
}
// A wrapper around access().
-func ts_access(tls *crt.TLS, zPath uintptr, mode int32) int32 { /* test_syscall.c:252:12: */
+func ts_access(tls *libc.TLS, zPath uintptr, mode int32) int32 { /* test_syscall.c:252:12: */
if tsIsFail(tls) != 0 {
return -1
}
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(2)*32 + 16 /* &.xOrig */))))(tls, zPath, mode)
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(2)*32 + 16 /* &.xOrig */))))(tls, zPath, mode)
}
// A wrapper around getcwd().
-func ts_getcwd(tls *crt.TLS, zPath uintptr, nPath size_t) uintptr { /* test_syscall.c:262:13: */
+func ts_getcwd(tls *libc.TLS, zPath uintptr, nPath size_t) uintptr { /* test_syscall.c:262:13: */
if tsIsFail(tls) != 0 {
return uintptr(0)
}
- return (*(*func(*crt.TLS, uintptr, size_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(3)*32 + 16 /* &.xOrig */))))(tls, zPath, nPath)
+ return (*(*func(*libc.TLS, uintptr, size_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(3)*32 + 16 /* &.xOrig */))))(tls, zPath, nPath)
}
// A wrapper around stat().
-func ts_stat(tls *crt.TLS, zPath uintptr, p uintptr) int32 { /* test_syscall.c:272:12: */
+func ts_stat(tls *libc.TLS, zPath uintptr, p uintptr) int32 { /* test_syscall.c:272:12: */
if tsIsFail(tls) != 0 {
return -1
}
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(4)*32 + 16 /* &.xOrig */))))(tls, zPath, p)
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(4)*32 + 16 /* &.xOrig */))))(tls, zPath, p)
}
// A wrapper around fstat().
-func ts_fstat(tls *crt.TLS, fd int32, p uintptr) int32 { /* test_syscall.c:282:12: */
- if tsIsFailErrno(tls, ts+33804 /* "fstat" */) != 0 {
+func ts_fstat(tls *libc.TLS, fd int32, p uintptr) int32 { /* test_syscall.c:282:12: */
+ if tsIsFailErrno(tls, ts+35904 /* "fstat" */) != 0 {
return -1
}
- return (*(*func(*crt.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*32 + 16 /* &.xOrig */))))(tls, fd, p)
+ return (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*32 + 16 /* &.xOrig */))))(tls, fd, p)
}
// A wrapper around ftruncate().
-func ts_ftruncate(tls *crt.TLS, fd int32, n off_t) int32 { /* test_syscall.c:292:12: */
- if tsIsFailErrno(tls, ts+33810 /* "ftruncate" */) != 0 {
+func ts_ftruncate(tls *libc.TLS, fd int32, n off_t) int32 { /* test_syscall.c:292:12: */
+ if tsIsFailErrno(tls, ts+35910 /* "ftruncate" */) != 0 {
return -1
}
- return (*(*func(*crt.TLS, int32, off_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(6)*32 + 16 /* &.xOrig */))))(tls, fd, n)
+ return (*(*func(*libc.TLS, int32, off_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(6)*32 + 16 /* &.xOrig */))))(tls, fd, n)
}
// A wrapper around fcntl().
-func ts_fcntl(tls *crt.TLS, fd int32, cmd int32, va uintptr) int32 { /* test_syscall.c:302:12: */
+func ts_fcntl(tls *libc.TLS, fd int32, cmd int32, va uintptr) int32 { /* test_syscall.c:302:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var ap va_list
_ = ap
var pArg uintptr
- if tsIsFailErrno(tls, ts+33820 /* "fcntl" */) != 0 {
+ if tsIsFailErrno(tls, ts+35920 /* "fcntl" */) != 0 {
return -1
}
ap = va
- pArg = crt.VaUintptr(&ap)
- return (*(*func(*crt.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*32 + 16 /* &.xOrig */))))(tls, fd, cmd, crt.VaList(bp, pArg))
+ pArg = libc.VaUintptr(&ap)
+ return (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*32 + 16 /* &.xOrig */))))(tls, fd, cmd, libc.VaList(bp, pArg))
}
// A wrapper around read().
-func ts_read(tls *crt.TLS, fd int32, aBuf uintptr, nBuf size_t) int32 { /* test_syscall.c:316:12: */
- if tsIsFailErrno(tls, ts+22005 /* "read" */) != 0 {
+func ts_read(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t) int32 { /* test_syscall.c:316:12: */
+ if tsIsFailErrno(tls, ts+24104 /* "read" */) != 0 {
return -1
}
- return int32((*(*func(*crt.TLS, int32, uintptr, size_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(8)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf))
+ return int32((*(*func(*libc.TLS, int32, uintptr, size_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(8)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf))
}
// A wrapper around pread().
-func ts_pread(tls *crt.TLS, fd int32, aBuf uintptr, nBuf size_t, off off_t) int32 { /* test_syscall.c:326:12: */
- if tsIsFailErrno(tls, ts+33826 /* "pread" */) != 0 {
+func ts_pread(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t, off off_t) int32 { /* test_syscall.c:326:12: */
+ if tsIsFailErrno(tls, ts+35926 /* "pread" */) != 0 {
return -1
}
- return int32((*(*func(*crt.TLS, int32, uintptr, size_t, off_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(9)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf, off))
+ return int32((*(*func(*libc.TLS, int32, uintptr, size_t, off_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(9)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf, off))
}
// A wrapper around pread64().
-func ts_pread64(tls *crt.TLS, fd int32, aBuf uintptr, nBuf size_t, off sqlite3_uint64) int32 { /* test_syscall.c:336:12: */
- if tsIsFailErrno(tls, ts+33832 /* "pread64" */) != 0 {
+func ts_pread64(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t, off sqlite3_uint64) int32 { /* test_syscall.c:336:12: */
+ if tsIsFailErrno(tls, ts+35932 /* "pread64" */) != 0 {
return -1
}
- return int32((*(*func(*crt.TLS, int32, uintptr, size_t, sqlite3_uint64) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(10)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf, off))
+ return int32((*(*func(*libc.TLS, int32, uintptr, size_t, sqlite3_uint64) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(10)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf, off))
}
// A wrapper around write().
-func ts_write(tls *crt.TLS, fd int32, aBuf uintptr, nBuf size_t) int32 { /* test_syscall.c:346:12: */
- if tsIsFailErrno(tls, ts+22010 /* "write" */) != 0 {
- if tsErrno(tls, ts+22010 /* "write" */) == 4 {
- (*(*func(*crt.TLS, int32, uintptr, size_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(11)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, (nBuf / uint64(2)))
+func ts_write(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t) int32 { /* test_syscall.c:346:12: */
+ if tsIsFailErrno(tls, ts+24109 /* "write" */) != 0 {
+ if tsErrno(tls, ts+24109 /* "write" */) == 4 {
+ (*(*func(*libc.TLS, int32, uintptr, size_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(11)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, (nBuf / uint64(2)))
}
return -1
}
- return int32((*(*func(*crt.TLS, int32, uintptr, size_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(11)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf))
+ return int32((*(*func(*libc.TLS, int32, uintptr, size_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(11)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf))
}
// A wrapper around pwrite().
-func ts_pwrite(tls *crt.TLS, fd int32, aBuf uintptr, nBuf size_t, off off_t) int32 { /* test_syscall.c:357:12: */
- if tsIsFailErrno(tls, ts+33840 /* "pwrite" */) != 0 {
+func ts_pwrite(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t, off off_t) int32 { /* test_syscall.c:357:12: */
+ if tsIsFailErrno(tls, ts+35940 /* "pwrite" */) != 0 {
return -1
}
- return int32((*(*func(*crt.TLS, int32, uintptr, size_t, off_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(12)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf, off))
+ return int32((*(*func(*libc.TLS, int32, uintptr, size_t, off_t) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(12)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf, off))
}
// A wrapper around pwrite64().
-func ts_pwrite64(tls *crt.TLS, fd int32, aBuf uintptr, nBuf size_t, off sqlite3_uint64) int32 { /* test_syscall.c:367:12: */
- if tsIsFailErrno(tls, ts+33847 /* "pwrite64" */) != 0 {
+func ts_pwrite64(tls *libc.TLS, fd int32, aBuf uintptr, nBuf size_t, off sqlite3_uint64) int32 { /* test_syscall.c:367:12: */
+ if tsIsFailErrno(tls, ts+35947 /* "pwrite64" */) != 0 {
return -1
}
- return int32((*(*func(*crt.TLS, int32, uintptr, size_t, sqlite3_uint64) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(13)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf, off))
+ return int32((*(*func(*libc.TLS, int32, uintptr, size_t, sqlite3_uint64) ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(13)*32 + 16 /* &.xOrig */))))(tls, fd, aBuf, nBuf, off))
}
// A wrapper around fchmod().
-func ts_fchmod(tls *crt.TLS, fd int32, mode mode_t) int32 { /* test_syscall.c:377:12: */
+func ts_fchmod(tls *libc.TLS, fd int32, mode mode_t) int32 { /* test_syscall.c:377:12: */
if tsIsFail(tls) != 0 {
return -1
}
- return (*(*func(*crt.TLS, int32, mode_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(14)*32 + 16 /* &.xOrig */))))(tls, fd, mode)
+ return (*(*func(*libc.TLS, int32, mode_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(14)*32 + 16 /* &.xOrig */))))(tls, fd, mode)
}
// A wrapper around fallocate().
@@ -68270,36 +73597,36 @@ func ts_fchmod(tls *crt.TLS, fd int32, mode mode_t) int32 { /* test_syscall.c:37
//
// posix_fallocate() returns zero on success, or an error number on
// failure. Note that errno is not set.
-func ts_fallocate(tls *crt.TLS, fd int32, off off_t, len off_t) int32 { /* test_syscall.c:393:12: */
+func ts_fallocate(tls *libc.TLS, fd int32, off off_t, len off_t) int32 { /* test_syscall.c:393:12: */
if tsIsFail(tls) != 0 {
- return tsErrno(tls, ts+33863 /* "fallocate" */)
+ return tsErrno(tls, ts+35963 /* "fallocate" */)
}
- return (*(*func(*crt.TLS, int32, off_t, off_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(15)*32 + 16 /* &.xOrig */))))(tls, fd, off, len)
+ return (*(*func(*libc.TLS, int32, off_t, off_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(15)*32 + 16 /* &.xOrig */))))(tls, fd, off, len)
}
-func ts_mmap(tls *crt.TLS, pAddr uintptr, nByte size_t, prot int32, flags int32, fd int32, iOff off_t) uintptr { /* test_syscall.c:400:13: */
- if tsIsFailErrno(tls, ts+25793 /* "mmap" */) != 0 {
- return crt.UintptrFromInt32(-1)
+func ts_mmap(tls *libc.TLS, pAddr uintptr, nByte size_t, prot int32, flags int32, fd int32, iOff off_t) uintptr { /* test_syscall.c:400:13: */
+ if tsIsFailErrno(tls, ts+27885 /* "mmap" */) != 0 {
+ return libc.UintptrFromInt32(-1)
}
- return (*(*func(*crt.TLS, uintptr, size_t, int32, int32, int32, off_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(16)*32 + 16 /* &.xOrig */))))(tls, pAddr, nByte, prot, flags, fd, iOff)
+ return (*(*func(*libc.TLS, uintptr, size_t, int32, int32, int32, off_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(16)*32 + 16 /* &.xOrig */))))(tls, pAddr, nByte, prot, flags, fd, iOff)
}
-func ts_mremap(tls *crt.TLS, a uintptr, b size_t, c size_t, d int32, va uintptr) uintptr { /* test_syscall.c:414:13: */
+func ts_mremap(tls *libc.TLS, a uintptr, b size_t, c size_t, d int32, va uintptr) uintptr { /* test_syscall.c:414:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
var ap va_list
_ = ap
var pArg uintptr
- if tsIsFailErrno(tls, ts+33873 /* "mremap" */) != 0 {
- return crt.UintptrFromInt32(-1)
+ if tsIsFailErrno(tls, ts+35973 /* "mremap" */) != 0 {
+ return libc.UintptrFromInt32(-1)
}
ap = va
- pArg = crt.VaUintptr(&ap)
- return (*(*func(*crt.TLS, uintptr, size_t, size_t, int32, uintptr) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(17)*32 + 16 /* &.xOrig */))))(tls, a, b, c, d, crt.VaList(bp, pArg))
+ pArg = libc.VaUintptr(&ap)
+ return (*(*func(*libc.TLS, uintptr, size_t, size_t, int32, uintptr) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(17)*32 + 16 /* &.xOrig */))))(tls, a, b, c, d, libc.VaList(bp, pArg))
}
-func test_syscall_install(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:425:26: */
+func test_syscall_install(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:425:26: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -68310,7 +73637,7 @@ func test_syscall_install(tls *crt.TLS, clientData uintptr, interp uintptr, objc
// var apElem uintptr at bp+8, 8
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+33880 /* "SYSCALL-LIST" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+35980 /* "SYSCALL-LIST" */)
return 1
}
if tcl.XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp /* &nElem */, bp+8 /* &apElem */) != 0 {
@@ -68322,13 +73649,13 @@ func test_syscall_install(tls *crt.TLS, clientData uintptr, interp uintptr, objc
// var iCall int32 at bp+16, 4
var rc int32 = tcl.XTcl_GetIndexFromObjStruct(tls, interp,
- *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* apElem */)) + uintptr(i)*8)), uintptr(unsafe.Pointer(&aSyscall)), int32(unsafe.Sizeof(TestSyscallArray{})), ts+33893 /* "system-call" */, 0, bp+16 /* &iCall */)
+ *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* apElem */)) + uintptr(i)*8)), uintptr(unsafe.Pointer(&aSyscall)), int32(unsafe.Sizeof(TestSyscallArray{})), ts+35993 /* "system-call" */, 0, bp+16 /* &iCall */)
if rc != 0 {
return rc
}
if aSyscall[*(*int32)(unsafe.Pointer(bp + 16 /* iCall */))].FxOrig == uintptr(0) {
- aSyscall[*(*int32)(unsafe.Pointer(bp + 16 /* iCall */))].FxOrig = (*(*func(*crt.TLS, uintptr, uintptr) sqlite3_syscall_ptr)(unsafe.Pointer((pVfs + 152 /* &.xGetSystemCall */))))(tls, pVfs, aSyscall[*(*int32)(unsafe.Pointer(bp + 16 /* iCall */))].FzName)
- (*(*func(*crt.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, pVfs, aSyscall[*(*int32)(unsafe.Pointer(bp + 16 /* iCall */))].FzName, aSyscall[*(*int32)(unsafe.Pointer(bp + 16 /* iCall */))].FxTest)
+ aSyscall[*(*int32)(unsafe.Pointer(bp + 16 /* iCall */))].FxOrig = (*(*func(*libc.TLS, uintptr, uintptr) sqlite3_syscall_ptr)(unsafe.Pointer((pVfs + 152 /* &.xGetSystemCall */))))(tls, pVfs, aSyscall[*(*int32)(unsafe.Pointer(bp + 16 /* iCall */))].FzName)
+ (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, pVfs, aSyscall[*(*int32)(unsafe.Pointer(bp + 16 /* iCall */))].FzName, aSyscall[*(*int32)(unsafe.Pointer(bp + 16 /* iCall */))].FxTest)
}
aSyscall[*(*int32)(unsafe.Pointer(bp + 16 /* iCall */))].Fcustom_errno = aSyscall[*(*int32)(unsafe.Pointer(bp + 16 /* iCall */))].Fdefault_errno
}
@@ -68336,7 +73663,7 @@ func test_syscall_install(tls *crt.TLS, clientData uintptr, interp uintptr, objc
return 0
}
-func test_syscall_uninstall(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:461:26: */
+func test_syscall_uninstall(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:461:26: */
var pVfs uintptr
var i int32
@@ -68348,14 +73675,14 @@ func test_syscall_uninstall(tls *crt.TLS, clientData uintptr, interp uintptr, ob
pVfs = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
for i = 0; aSyscall[i].FzName != 0; i++ {
if aSyscall[i].FxOrig != 0 {
- (*(*func(*crt.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, pVfs, aSyscall[i].FzName, uintptr(0))
+ (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, pVfs, aSyscall[i].FzName, uintptr(0))
aSyscall[i].FxOrig = uintptr(0)
}
}
return 0
}
-func test_syscall_reset(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:485:26: */
+func test_syscall_reset(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:485:26: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -68370,7 +73697,7 @@ func test_syscall_reset(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
pVfs = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
if objc == 2 {
- rc = (*(*func(*crt.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, pVfs, uintptr(0), uintptr(0))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, pVfs, uintptr(0), uintptr(0))
for i = 0; aSyscall[i].FzName != 0; i++ {
aSyscall[i].FxOrig = uintptr(0)
}
@@ -68378,12 +73705,12 @@ func test_syscall_reset(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// var nFunc int32 at bp, 4
var zFunc uintptr = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp /* &nFunc */)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, pVfs, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), uintptr(0))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, pVfs, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), uintptr(0))
for i = 0; (rc == 0) && (aSyscall[i].FzName != 0); i++ {
- if crt.Xstrlen(tls, aSyscall[i].FzName) != size_t(*(*int32)(unsafe.Pointer(bp /* nFunc */))) {
+ if libc.Xstrlen(tls, aSyscall[i].FzName) != size_t(*(*int32)(unsafe.Pointer(bp /* nFunc */))) {
continue
}
- if crt.Xmemcmp(tls, aSyscall[i].FzName, zFunc, uint64(*(*int32)(unsafe.Pointer(bp /* nFunc */)))) != 0 {
+ if libc.Xmemcmp(tls, aSyscall[i].FzName, zFunc, uint64(*(*int32)(unsafe.Pointer(bp /* nFunc */)))) != 0 {
continue
}
aSyscall[i].FxOrig = uintptr(0)
@@ -68398,7 +73725,7 @@ func test_syscall_reset(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
return 0
}
-func test_syscall_exists(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:523:26: */
+func test_syscall_exists(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:523:26: */
var pVfs uintptr
var x sqlite3_syscall_ptr
@@ -68408,13 +73735,13 @@ func test_syscall_exists(tls *crt.TLS, clientData uintptr, interp uintptr, objc
}
pVfs = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
- x = (*(*func(*crt.TLS, uintptr, uintptr) sqlite3_syscall_ptr)(unsafe.Pointer((pVfs + 152 /* &.xGetSystemCall */))))(tls, pVfs, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))))
+ x = (*(*func(*libc.TLS, uintptr, uintptr) sqlite3_syscall_ptr)(unsafe.Pointer((pVfs + 152 /* &.xGetSystemCall */))))(tls, pVfs, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))))
- tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (crt.Bool32((crt.Bool32(x != uintptr(0))) != 0))))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, (libc.Bool32((libc.Bool32(x != uintptr(0))) != 0))))
return 0
}
-func test_syscall_fault(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:544:26: */
+func test_syscall_fault(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:544:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -68422,7 +73749,7 @@ func test_syscall_fault(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
*(*int32)(unsafe.Pointer(bp + 4 /* bPersist */)) = 0
if (objc != 2) && (objc != 4) {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+33905 /* "?COUNT PERSIST?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+36005 /* "?COUNT PERSIST?" */)
return 1
}
@@ -68440,7 +73767,7 @@ func test_syscall_fault(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
return 0
}
-func test_syscall_errno(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:573:26: */
+func test_syscall_errno(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:573:26: */
bp := tls.Alloc(204)
defer tls.Free(204)
@@ -68451,32 +73778,32 @@ func test_syscall_errno(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
var rc int32
*(*[12]Errno)(unsafe.Pointer(bp + 8 /* aErrno */)) = [12]Errno{
- {Fz: ts + 33921 /* "EACCES" */, Fi: 13},
- {Fz: ts + 33928 /* "EINTR" */, Fi: 4},
- {Fz: ts + 33934 /* "EIO" */, Fi: 5},
- {Fz: ts + 33938 /* "EOVERFLOW" */, Fi: 75},
- {Fz: ts + 33948 /* "ENOMEM" */, Fi: 12},
- {Fz: ts + 33955 /* "EAGAIN" */, Fi: 11},
- {Fz: ts + 33962 /* "ETIMEDOUT" */, Fi: 110},
- {Fz: ts + 33972 /* "EBUSY" */, Fi: 16},
- {Fz: ts + 33978 /* "EPERM" */, Fi: 1},
- {Fz: ts + 33984 /* "EDEADLK" */, Fi: 35},
- {Fz: ts + 33992 /* "ENOLCK" */, Fi: 37},
+ {Fz: ts + 36021 /* "EACCES" */, Fi: 13},
+ {Fz: ts + 36028 /* "EINTR" */, Fi: 4},
+ {Fz: ts + 36034 /* "EIO" */, Fi: 5},
+ {Fz: ts + 36038 /* "EOVERFLOW" */, Fi: 75},
+ {Fz: ts + 36048 /* "ENOMEM" */, Fi: 12},
+ {Fz: ts + 36055 /* "EAGAIN" */, Fi: 11},
+ {Fz: ts + 36062 /* "ETIMEDOUT" */, Fi: 110},
+ {Fz: ts + 36072 /* "EBUSY" */, Fi: 16},
+ {Fz: ts + 36078 /* "EPERM" */, Fi: 1},
+ {Fz: ts + 36084 /* "EDEADLK" */, Fi: 35},
+ {Fz: ts + 36092 /* "ENOLCK" */, Fi: 37},
{Fz: uintptr(0), Fi: 0},
}
if objc != 4 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+33999 /* "SYSCALL ERRNO" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+36099 /* "SYSCALL ERRNO" */)
return 1
}
rc = tcl.XTcl_GetIndexFromObjStruct(tls, interp,
- *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), uintptr(unsafe.Pointer(&aSyscall)), int32(unsafe.Sizeof(TestSyscallArray{})), ts+33893 /* "system-call" */, 0, bp /* &iCall */)
+ *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), uintptr(unsafe.Pointer(&aSyscall)), int32(unsafe.Sizeof(TestSyscallArray{})), ts+35993 /* "system-call" */, 0, bp /* &iCall */)
if rc != 0 {
return rc
}
rc = tcl.XTcl_GetIndexFromObjStruct(tls, interp,
- *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), bp+8 /* &aErrno[0] */, int32(unsafe.Sizeof(Errno{})), ts+34013 /* "errno" */, 0, bp+200 /* &iErrno */)
+ *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), bp+8 /* &aErrno[0] */, int32(unsafe.Sizeof(Errno{})), ts+36113 /* "errno" */, 0, bp+200 /* &iErrno */)
if rc != 0 {
return rc
}
@@ -68491,7 +73818,7 @@ type Errno = struct {
_ [4]byte
}
-func test_syscall_list(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:619:26: */
+func test_syscall_list(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:619:26: */
var zSys uintptr
var pVfs uintptr
var pList uintptr
@@ -68504,21 +73831,21 @@ func test_syscall_list(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
pVfs = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
pList = tcl.XTcl_NewObj(tls)
(*Tcl_Obj)(unsafe.Pointer(pList)).FrefCount++
- for zSys = (*(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 160 /* &.xNextSystemCall */))))(tls, pVfs, uintptr(0)); zSys != uintptr(0); zSys = (*(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 160 /* &.xNextSystemCall */))))(tls, pVfs, zSys) {
+ for zSys = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 160 /* &.xNextSystemCall */))))(tls, pVfs, uintptr(0)); zSys != uintptr(0); zSys = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 160 /* &.xNextSystemCall */))))(tls, pVfs, zSys) {
tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewStringObj(tls, zSys, -1))
}
tcl.XTcl_SetObjResult(tls, interp, pList)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pList
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
return 0
}
-func test_syscall_defaultvfs(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:649:26: */
+func test_syscall_defaultvfs(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:649:26: */
var pVfs uintptr
if objc != 2 {
@@ -68531,11 +73858,11 @@ func test_syscall_defaultvfs(tls *crt.TLS, clientData uintptr, interp uintptr, o
return 0
}
-func ts_getpagesize(tls *crt.TLS) int32 { /* test_syscall.c:667:12: */
+func ts_getpagesize(tls *libc.TLS) int32 { /* test_syscall.c:667:12: */
return gSyscall.Fpgsz
}
-func test_syscall_pagesize(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:671:26: */
+func test_syscall_pagesize(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:671:26: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -68543,7 +73870,7 @@ func test_syscall_pagesize(tls *crt.TLS, clientData uintptr, interp uintptr, obj
// var pgsz int32 at bp+16, 4
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+34019 /* "PGSZ" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+36119 /* "PGSZ" */)
return 1
}
if tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+16 /* &pgsz */) != 0 {
@@ -68552,53 +73879,53 @@ func test_syscall_pagesize(tls *crt.TLS, clientData uintptr, interp uintptr, obj
if *(*int32)(unsafe.Pointer(bp + 16 /* pgsz */)) < 0 {
if gSyscall.Forig_getpagesize != 0 {
- (*(*func(*crt.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, pVfs, ts+34024 /* "getpagesize" */, gSyscall.Forig_getpagesize)
+ (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls, pVfs, ts+36124 /* "getpagesize" */, gSyscall.Forig_getpagesize)
}
} else {
if (*(*int32)(unsafe.Pointer(bp + 16 /* pgsz */)) < 512) || ((*(*int32)(unsafe.Pointer(bp + 16 /* pgsz */)) & (*(*int32)(unsafe.Pointer(bp + 16 /* pgsz */)) - 1)) != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+34036 /* "pgsz out of rang..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+36136 /* "pgsz out of rang..." */, 0))
return 1
}
- gSyscall.Forig_getpagesize = (*(*func(*crt.TLS, uintptr, uintptr) sqlite3_syscall_ptr)(unsafe.Pointer((pVfs + 152 /* &.xGetSystemCall */))))(tls, pVfs, ts+34024 /* "getpagesize" */)
+ gSyscall.Forig_getpagesize = (*(*func(*libc.TLS, uintptr, uintptr) sqlite3_syscall_ptr)(unsafe.Pointer((pVfs + 152 /* &.xGetSystemCall */))))(tls, pVfs, ts+36124 /* "getpagesize" */)
gSyscall.Fpgsz = *(*int32)(unsafe.Pointer(bp + 16 /* pgsz */))
- (*(*func(*crt.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls,
- pVfs, ts+34024 /* "getpagesize" */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) int32 }{ts_getpagesize})))
+ (*(*func(*libc.TLS, uintptr, uintptr, sqlite3_syscall_ptr) int32)(unsafe.Pointer((pVfs + 144 /* &.xSetSystemCall */))))(tls,
+ pVfs, ts+36124 /* "getpagesize" */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{ts_getpagesize})))
}
return 0
}
-func test_syscall(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:706:26: */
+func test_syscall(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_syscall.c:706:26: */
bp := tls.Alloc(180)
defer tls.Free(180)
*(*[10]SyscallCmd)(unsafe.Pointer(bp + 16 /* aCmd */)) = [10]SyscallCmd{
- {FzName: ts + 34054 /* "fault" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ {FzName: ts + 36154 /* "fault" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_syscall_fault}))},
- {FzName: ts + 34060 /* "install" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ {FzName: ts + 36160 /* "install" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_syscall_install}))},
- {FzName: ts + 34068 /* "uninstall" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ {FzName: ts + 36168 /* "uninstall" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_syscall_uninstall}))},
- {FzName: ts + 5916 /* "reset" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ {FzName: ts + 7201 /* "reset" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_syscall_reset}))},
- {FzName: ts + 34013 /* "errno" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ {FzName: ts + 36113 /* "errno" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_syscall_errno}))},
- {FzName: ts + 11378 /* "exists" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ {FzName: ts + 13018 /* "exists" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_syscall_exists}))},
- {FzName: ts + 34078 /* "list" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ {FzName: ts + 36178 /* "list" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_syscall_list}))},
- {FzName: ts + 34083 /* "defaultvfs" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ {FzName: ts + 36183 /* "defaultvfs" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_syscall_defaultvfs}))},
- {FzName: ts + 34094 /* "pagesize" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ {FzName: ts + 36194 /* "pagesize" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_syscall_pagesize}))},
{FzName: uintptr(0), FxCmd: uintptr(0)},
}
@@ -68608,11 +73935,11 @@ func test_syscall(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
var pVfs uintptr = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
if objc < 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+29799 /* "SUB-COMMAND ..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31891 /* "SUB-COMMAND ..." */)
return 1
}
if ((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FiVersion < 3) || ((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FxSetSystemCall == uintptr(0)) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+34103 /* "VFS does not sup..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+36203 /* "VFS does not sup..." */, 0))
rc = 1
} else {
rc = tcl.XTcl_GetIndexFromObjStruct(tls, interp,
@@ -68621,7 +73948,7 @@ func test_syscall(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32,
if rc != 0 {
return rc
}
- return (*(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer((bp + 16 /* &aCmd */ + uintptr(*(*int32)(unsafe.Pointer(bp + 176 /* iCmd */)))*16 + 8 /* &.xCmd */))))(tls, clientData, interp, objc, objv)
+ return (*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer((bp + 16 /* &aCmd */ + uintptr(*(*int32)(unsafe.Pointer(bp + 176 /* iCmd */)))*16 + 8 /* &.xCmd */))))(tls, clientData, interp, objc, objv)
}
type SyscallCmd = struct {
@@ -68629,13 +73956,13 @@ type SyscallCmd = struct {
FxCmd uintptr
}
-func SqlitetestSyscall_Init(tls *crt.TLS, interp uintptr) int32 { /* test_syscall.c:747:5: */
+func SqlitetestSyscall_Init(tls *libc.TLS, interp uintptr) int32 { /* test_syscall.c:747:5: */
bp := tls.Alloc(16)
defer tls.Free(16)
*(*[1]SyscallCmd)(unsafe.Pointer(bp /* aCmd */)) = [1]SyscallCmd{
- {FzName: ts + 34139 /* "test_syscall" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ {FzName: ts + 36239 /* "test_syscall" */, FxCmd: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_syscall}))},
}
var i int32
@@ -68657,7 +73984,7 @@ func SqlitetestSyscall_Init(tls *crt.TLS, interp uintptr) int32 { /* test_syscal
//
// * If SQLITE_TEST is set, the various test interfaces used by the Tcl
// test suite.
-func sqlite3TestInit(tls *crt.TLS, interp uintptr) uintptr { /* test_tclsh.c:58:12: */
+func sqlite3TestInit(tls *libc.TLS, interp uintptr) uintptr { /* test_tclsh.c:58:12: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -68668,12 +73995,12 @@ func sqlite3TestInit(tls *crt.TLS, interp uintptr) uintptr { /* test_tclsh.c:58:
{
// var x rlimit at bp, 16
- crt.Xgetrlimit(tls, RLIMIT_CORE, bp /* &x */)
+ libc.Xgetrlimit(tls, RLIMIT_CORE, bp /* &x */)
(*rlimit)(unsafe.Pointer(bp /* &x */)).Frlim_cur = (*rlimit)(unsafe.Pointer(bp /* &x */)).Frlim_max
- crt.Xsetrlimit(tls, RLIMIT_CORE, bp /* &x */)
+ libc.Xsetrlimit(tls, RLIMIT_CORE, bp /* &x */)
}
- if tcl.XTcl_GetCommandInfo(tls, interp, ts+12119 /* "sqlite3" */, bp+16 /* &cmdInfo */) == 0 {
+ if tcl.XTcl_GetCommandInfo(tls, interp, ts+13769 /* "sqlite3" */, bp+16 /* &cmdInfo */) == 0 {
Sqlite3_Init(tls, interp)
}
Md5_Init(tls, interp)
@@ -68719,17 +74046,17 @@ func sqlite3TestInit(tls *crt.TLS, interp uintptr) uintptr { /* test_tclsh.c:58:
Sqlitetestvdbecov_Init(tls, interp)
tcl.XTcl_CreateObjCommand(tls,
- interp, ts+34152 /* "load_testfixture..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
+ interp, ts+36252 /* "load_testfixture..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
}{load_testfixture_extensions})), uintptr(0), uintptr(0))
return uintptr(0)
}
// tclcmd: load_testfixture_extensions
-func load_testfixture_extensions(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_tclsh.c:185:26: */
+func load_testfixture_extensions(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_tclsh.c:185:26: */
var slave uintptr
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+34180 /* "SLAVE" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+36280 /* "SLAVE" */)
return 1
}
@@ -68853,7 +74180,7 @@ type tclvar_cursor1 = struct {
type tclvar_cursor = tclvar_cursor1 /* test_tclvar.c:59:30 */
// Methods for the tclvar module
-func tclvarConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_tclvar.c:80:12: */
+func tclvarConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* test_tclvar.c:80:12: */
var pVtab uintptr
pVtab = sqlite3.Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(tclvar_vtab{})))
if pVtab == uintptr(0) {
@@ -68865,11 +74192,11 @@ func tclvarConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uint
return 0
}
-var zSchema = *(*[100]int8)(unsafe.Pointer(ts + 34186 /* "CREATE TABLE x( ..." */)) /* test_tclvar.c:88:21 */
+var zSchema = *(*[100]int8)(unsafe.Pointer(ts + 36286 /* "CREATE TABLE x( ..." */)) /* test_tclvar.c:88:21 */
// Note that for this virtual table, the xCreate and xConnect
// methods are identical.
-func tclvarDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* test_tclvar.c:105:12: */
+func tclvarDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* test_tclvar.c:105:12: */
sqlite3.Xsqlite3_free(tls, pVtab)
return 0
}
@@ -68877,7 +74204,7 @@ func tclvarDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* test_tclvar.c:105:
// The xDisconnect and xDestroy methods are also the same
// Open a new tclvar cursor.
-func tclvarOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_tclvar.c:114:12: */
+func tclvarOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_tclvar.c:114:12: */
var pCur uintptr
pCur = sqlite3.Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(tclvar_cursor{})))
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
@@ -68885,12 +74212,12 @@ func tclvarOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* test_t
}
// Close a tclvar cursor.
-func tclvarClose(tls *crt.TLS, cur uintptr) int32 { /* test_tclvar.c:124:12: */
+func tclvarClose(tls *libc.TLS, cur uintptr) int32 { /* test_tclvar.c:124:12: */
var pCur uintptr = cur
if (*tclvar_cursor)(unsafe.Pointer(pCur)).FpList1 != 0 {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*tclvar_cursor)(unsafe.Pointer(pCur)).FpList1
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -68898,7 +74225,7 @@ func tclvarClose(tls *crt.TLS, cur uintptr) int32 { /* test_tclvar.c:124:12: */
if (*tclvar_cursor)(unsafe.Pointer(pCur)).FpList2 != 0 {
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = (*tclvar_cursor)(unsafe.Pointer(pCur)).FpList2
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -68908,7 +74235,7 @@ func tclvarClose(tls *crt.TLS, cur uintptr) int32 { /* test_tclvar.c:124:12: */
}
// Returns 1 if data is ready, or 0 if not.
-func next2(tls *crt.TLS, interp uintptr, pCur uintptr, pObj uintptr) int32 { /* test_tclvar.c:139:12: */
+func next2(tls *libc.TLS, interp uintptr, pCur uintptr, pObj uintptr) int32 { /* test_tclvar.c:139:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -68916,13 +74243,13 @@ func next2(tls *crt.TLS, interp uintptr, pCur uintptr, pObj uintptr) int32 { /*
if pObj != 0 {
if !(int32((*tclvar_cursor)(unsafe.Pointer(pCur)).FpList2) != 0) {
- p = tcl.XTcl_NewStringObj(tls, ts+34286 /* "array names" */, -1)
+ p = tcl.XTcl_NewStringObj(tls, ts+36386 /* "array names" */, -1)
(*Tcl_Obj)(unsafe.Pointer(p)).FrefCount++
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), p, pObj)
tcl.XTcl_EvalObjEx(tls, interp, p, 0x020000)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = p
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -68935,7 +74262,7 @@ func next2(tls *crt.TLS, interp uintptr, pCur uintptr, pObj uintptr) int32 { /*
if (*tclvar_cursor)(unsafe.Pointer(pCur)).Fi2 >= *(*int32)(unsafe.Pointer(bp /* n */)) {
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = (*tclvar_cursor)(unsafe.Pointer(pCur)).FpList2
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -68949,7 +74276,7 @@ func next2(tls *crt.TLS, interp uintptr, pCur uintptr, pObj uintptr) int32 { /*
return 1
}
-func tclvarNext(tls *crt.TLS, cur uintptr) int32 { /* test_tclvar.c:168:12: */
+func tclvarNext(tls *libc.TLS, cur uintptr) int32 { /* test_tclvar.c:168:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -68973,10 +74300,10 @@ func tclvarNext(tls *crt.TLS, cur uintptr) int32 { /* test_tclvar.c:168:12: */
return 0
}
-func tclvarFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_tclvar.c:188:12: */
+func tclvarFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* test_tclvar.c:188:12: */
var pCur uintptr = pVtabCursor
var interp uintptr = (*tclvar_vtab)(unsafe.Pointer((*sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab)).Finterp
- var p uintptr = tcl.XTcl_NewStringObj(tls, ts+34298 /* "tclvar_filter_cm..." */, -1)
+ var p uintptr = tcl.XTcl_NewStringObj(tls, ts+36398 /* "tclvar_filter_cm..." */, -1)
var zEq uintptr = ts + 488 /* "" */
var zMatch uintptr = ts + 488 /* "" */
@@ -69017,7 +74344,7 @@ func tclvarFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
if (*tclvar_cursor)(unsafe.Pointer(pCur)).FpList1 != 0 {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*tclvar_cursor)(unsafe.Pointer(pCur)).FpList1
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -69025,7 +74352,7 @@ func tclvarFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
if (*tclvar_cursor)(unsafe.Pointer(pCur)).FpList2 != 0 {
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = (*tclvar_cursor)(unsafe.Pointer(pCur)).FpList2
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -69038,14 +74365,14 @@ func tclvarFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintpt
for ok2 := true; ok2; ok2 = 0 != 0 {
var _objPtr uintptr = p
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
return tclvarNext(tls, pVtabCursor)
}
-func tclvarColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_tclvar.c:250:12: */
+func tclvarColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* test_tclvar.c:250:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -69067,12 +74394,12 @@ func tclvarColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* te
switch i {
case 0:
{
- sqlite3.Xsqlite3_result_text(tls, ctx, z1, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, z1, -1, libc.UintptrFromInt32(-1))
break
}
case 1:
{
- sqlite3.Xsqlite3_result_text(tls, ctx, z2, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, z2, -1, libc.UintptrFromInt32(-1))
break
}
case 2:
@@ -69083,17 +74410,17 @@ func tclvarColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* te
}
return uintptr(0)
}(), 1)
- sqlite3.Xsqlite3_result_text(tls, ctx, tcl.XTcl_GetString(tls, pVal), -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, tcl.XTcl_GetString(tls, pVal), -1, libc.UintptrFromInt32(-1))
break
}
case 3:
{
var z3 uintptr
if *(*uintptr)(unsafe.Pointer(bp + 24 /* p2 */)) != 0 {
- z3 = sqlite3.Xsqlite3_mprintf(tls, ts+34316 /* "%s(%s)" */, crt.VaList(bp, z1, z2))
- sqlite3.Xsqlite3_result_text(tls, ctx, z3, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
+ z3 = sqlite3.Xsqlite3_mprintf(tls, ts+36416 /* "%s(%s)" */, libc.VaList(bp, z1, z2))
+ sqlite3.Xsqlite3_result_text(tls, ctx, z3, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sqlite3.Xsqlite3_free})))
} else {
- sqlite3.Xsqlite3_result_text(tls, ctx, z1, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, z1, -1, libc.UintptrFromInt32(-1))
}
break
}
@@ -69101,12 +74428,12 @@ func tclvarColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* te
return 0
}
-func tclvarRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* test_tclvar.c:292:12: */
+func tclvarRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* test_tclvar.c:292:12: */
*(*sqlite_int64)(unsafe.Pointer(pRowid)) = int64(0)
return 0
}
-func tclvarEof(tls *crt.TLS, cur uintptr) int32 { /* test_tclvar.c:297:12: */
+func tclvarEof(tls *libc.TLS, cur uintptr) int32 { /* test_tclvar.c:297:12: */
var pCur uintptr = cur
return func() int32 {
if (*tclvar_cursor)(unsafe.Pointer(pCur)).FpList2 != 0 {
@@ -69122,7 +74449,7 @@ func tclvarEof(tls *crt.TLS, cur uintptr) int32 { /* test_tclvar.c:297:12: */
//
// There is guaranteed to be enough room in the buffer pointed to by zStr
// for the new character and nul-terminator.
-func tclvarAddToIdxstr(tls *crt.TLS, zStr uintptr, x int8) int32 { /* test_tclvar.c:310:12: */
+func tclvarAddToIdxstr(tls *libc.TLS, zStr uintptr, x int8) int32 { /* test_tclvar.c:310:12: */
var i int32
for i = 0; *(*int8)(unsafe.Pointer(zStr + uintptr(i))) != 0; i++ {
if int32(*(*int8)(unsafe.Pointer(zStr + uintptr(i)))) == int32(x) {
@@ -69136,7 +74463,7 @@ func tclvarAddToIdxstr(tls *crt.TLS, zStr uintptr, x int8) int32 { /* test_tclva
// Return true if variable $::tclvar_set_omit exists and is set to true.
// False otherwise.
-func tclvarSetOmit(tls *crt.TLS, interp uintptr) int32 { /* test_tclvar.c:324:12: */
+func tclvarSetOmit(tls *libc.TLS, interp uintptr) int32 { /* test_tclvar.c:324:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -69144,12 +74471,12 @@ func tclvarSetOmit(tls *crt.TLS, interp uintptr) int32 { /* test_tclvar.c:324:12
*(*int32)(unsafe.Pointer(bp /* res */)) = 0
var pRes uintptr
rc = tcl.XTcl_Eval(tls, interp,
- ts+34323 /* "expr {[info exis..." */)
+ ts+36423 /* "expr {[info exis..." */)
if rc == 0 {
pRes = tcl.XTcl_GetObjResult(tls, interp)
rc = tcl.XTcl_GetBooleanFromObj(tls, uintptr(0), pRes, bp /* &res */)
}
- return (crt.Bool32((rc == 0) && (*(*int32)(unsafe.Pointer(bp /* res */)) != 0)))
+ return (libc.Bool32((rc == 0) && (*(*int32)(unsafe.Pointer(bp /* res */)) != 0)))
}
// The xBestIndex() method. This virtual table supports the following
@@ -69163,7 +74490,7 @@ func tclvarSetOmit(tls *crt.TLS, interp uintptr) int32 { /* test_tclvar.c:324:12
//
// For each constraint present, the corresponding TCLVAR_XXX character is
// appended to the idxStr value.
-func tclvarBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_tclvar.c:351:12: */
+func tclvarBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* test_tclvar.c:351:12: */
var pTab uintptr = tab
var ii int32
var zStr uintptr = sqlite3.Xsqlite3_malloc(tls, 32)
@@ -69183,7 +74510,7 @@ func tclvarBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* tes
// name = ?
if (int32((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).Fop) == 2) && ((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).FiColumn == 0) {
if 0 == tclvarAddToIdxstr(tls, zStr, int8('e')) {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = crt.PreIncInt32(&iStr, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = libc.PreIncInt32(&iStr, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).Fomit = uint8(0)
}
}
@@ -69191,7 +74518,7 @@ func tclvarBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* tes
// name MATCH ?
if (int32((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).Fop) == 64) && ((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).FiColumn == 0) {
if 0 == tclvarAddToIdxstr(tls, zStr, int8('m')) {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = crt.PreIncInt32(&iStr, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = libc.PreIncInt32(&iStr, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).Fomit = uint8(1)
}
}
@@ -69199,7 +74526,7 @@ func tclvarBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* tes
// value GLOB ?
if (int32((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).Fop) == 66) && ((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).FiColumn == 2) {
if 0 == tclvarAddToIdxstr(tls, zStr, int8('g')) {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = crt.PreIncInt32(&iStr, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = libc.PreIncInt32(&iStr, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).Fomit = uint8(tclvarSetOmit(tls, (*tclvar_vtab)(unsafe.Pointer(pTab)).Finterp))
}
}
@@ -69207,7 +74534,7 @@ func tclvarBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* tes
// value REGEXP ?
if (int32((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).Fop) == 67) && ((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).FiColumn == 2) {
if 0 == tclvarAddToIdxstr(tls, zStr, int8('r')) {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = crt.PreIncInt32(&iStr, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = libc.PreIncInt32(&iStr, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).Fomit = uint8(tclvarSetOmit(tls, (*tclvar_vtab)(unsafe.Pointer(pTab)).Finterp))
}
}
@@ -69215,7 +74542,7 @@ func tclvarBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* tes
// value LIKE ?
if (int32((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).Fop) == 65) && ((*sqlite3_index_constraint)(unsafe.Pointer(pCons)).FiColumn == 2) {
if 0 == tclvarAddToIdxstr(tls, zStr, int8('l')) {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = crt.PreIncInt32(&iStr, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).FargvIndex = libc.PreIncInt32(&iStr, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage)).Fomit = uint8(tclvarSetOmit(tls, (*tclvar_vtab)(unsafe.Pointer(pTab)).Finterp))
}
}
@@ -69228,7 +74555,7 @@ func tclvarBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* tes
}
// Invoked for any UPDATE, INSERT, or DELETE against a tclvar table
-func tclvarUpdate(tls *crt.TLS, tab uintptr, argc int32, argv uintptr, pRowid uintptr) int32 { /* test_tclvar.c:416:12: */
+func tclvarUpdate(tls *libc.TLS, tab uintptr, argc int32, argv uintptr, pRowid uintptr) int32 { /* test_tclvar.c:416:12: */
var pTab uintptr = tab
if argc == 1 {
// A DELETE operation. The variable to be deleted is stored in argv[0]
@@ -69241,7 +74568,7 @@ func tclvarUpdate(tls *crt.TLS, tab uintptr, argc int32, argv uintptr, pRowid ui
var zValue uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)))
var zName uintptr
if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(5)*8))) != 3 {
- (*sqlite3_vtab)(unsafe.Pointer(tab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+34384 /* "the 'fullname' c..." */, 0)
+ (*sqlite3_vtab)(unsafe.Pointer(tab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+36484 /* "the 'fullname' c..." */, 0)
return 1
}
zName = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(5)*8)))
@@ -69259,7 +74586,7 @@ func tclvarUpdate(tls *crt.TLS, tab uintptr, argc int32, argv uintptr, pRowid ui
var zNewName uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
var zValue uintptr = sqlite3.Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)))
- if (crt.Xstrcmp(tls, zOldName, zNewName) != 0) || (zValue == uintptr(0)) {
+ if (libc.Xstrcmp(tls, zOldName, zNewName) != 0) || (zValue == uintptr(0)) {
tcl.XTcl_UnsetVar2(tls, (*tclvar_vtab)(unsafe.Pointer(pTab)).Finterp, zOldName, uintptr(0), 1)
}
if zValue != uintptr(0) {
@@ -69267,7 +74594,7 @@ func tclvarUpdate(tls *crt.TLS, tab uintptr, argc int32, argv uintptr, pRowid ui
}
return 0
}
- (*sqlite3_vtab)(unsafe.Pointer(tab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+34419 /* "prohibited TCL v..." */, 0)
+ (*sqlite3_vtab)(unsafe.Pointer(tab)).FzErrMsg = sqlite3.Xsqlite3_mprintf(tls, ts+36519 /* "prohibited TCL v..." */, 0)
return 1
}
@@ -69291,7 +74618,7 @@ uintptr(0), // xRename
} /* test_tclvar.c:469:23 */
// Register the echo virtual table module.
-func register_tclvar_module(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_tclvar.c:500:26: */
+func register_tclvar_module(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_tclvar.c:500:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -69305,42 +74632,35 @@ func register_tclvar_module(tls *crt.TLS, clientData ClientData, interp uintptr,
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0 {
return 1
}
- sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+26603 /* "tclvar" */, uintptr(unsafe.Pointer(&tclvarModule)), interp)
+ sqlite3.Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+28695 /* "tclvar" */, uintptr(unsafe.Pointer(&tclvarModule)), interp)
rc = tcl.XTcl_Eval(tls, interp,
- ts+34450 /* "proc like {patte..." */)
+ ts+36550 /* "proc like {patte..." */)
return rc
}
// Register commands with the TCL interpreter.
-func Sqlitetesttclvar_Init(tls *crt.TLS, interp uintptr) int32 { /* test_tclvar.c:546:5: */
+func Sqlitetesttclvar_Init(tls *libc.TLS, interp uintptr) int32 { /* test_tclvar.c:546:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd12)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd13)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{}))); i++ {
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd12[i].FzName,
- aObjCmd12[i].FxProc, aObjCmd12[i].FclientData, uintptr(0))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd13[i].FzName,
+ aObjCmd13[i].FxProc, aObjCmd13[i].FclientData, uintptr(0))
}
return 0
}
-var aObjCmd12 = [1]struct {
+var aObjCmd13 = [1]struct {
FzName uintptr
FxProc uintptr
FclientData uintptr
}{
- {FzName: ts + 34986 /* "register_tclvar_..." */, FxProc: 0, FclientData: uintptr(0)},
+ {FzName: ts + 37086 /* "register_tclvar_..." */, FxProc: 0, FclientData: uintptr(0)},
} /* test_tclvar.c:552:5 */
-// Prior to Issue 6, the Single Unix Specification required these
-// prototypes to appear in this header. They are also found in
-// <stdio.h>.
-
-// Unix98 requires this function to be declared here. In other
-// standards it is in <pthread.h>.
-
// Define some macros helping to catch buffer overflows.
// One of these is allocated for each thread created by [sqlthread spawn].
@@ -69351,13 +74671,6 @@ type SqlThread1 = struct {
FzVarname uintptr
}
-// Prior to Issue 6, the Single Unix Specification required these
-// prototypes to appear in this header. They are also found in
-// <stdio.h>.
-
-// Unix98 requires this function to be declared here. In other
-// standards it is in <pthread.h>.
-
// Define some macros helping to catch buffer overflows.
// One of these is allocated for each thread created by [sqlthread spawn].
@@ -69382,7 +74695,7 @@ type EvalEvent1 = struct {
type EvalEvent = EvalEvent1 /* test_thread.c:51:26 */
// Handler for events of type EvalEvent.
-func tclScriptEvent(tls *crt.TLS, evPtr uintptr, flags int32) int32 { /* test_thread.c:79:26: */
+func tclScriptEvent(tls *libc.TLS, evPtr uintptr, flags int32) int32 { /* test_thread.c:79:26: */
var rc int32
var p uintptr = evPtr
rc = tcl.XTcl_Eval(tls, (*EvalEvent)(unsafe.Pointer(p)).Finterp, (*EvalEvent)(unsafe.Pointer(p)).FzScript)
@@ -69395,7 +74708,7 @@ func tclScriptEvent(tls *crt.TLS, evPtr uintptr, flags int32) int32 { /* test_th
// Register an EvalEvent to evaluate the script pScript in the
// parent interpreter/thread of SqlThread p.
-func postToParent(tls *crt.TLS, p uintptr, pScript uintptr) { /* test_thread.c:94:13: */
+func postToParent(tls *libc.TLS, p uintptr, pScript uintptr) { /* test_thread.c:94:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -69407,10 +74720,10 @@ func postToParent(tls *crt.TLS, p uintptr, pScript uintptr) { /* test_thread.c:9
pEvent = tcl.XTcl_Alloc(tls, (uint32((uint64(unsafe.Sizeof(EvalEvent{})) + uint64(*(*int32)(unsafe.Pointer(bp /* nMsg */)))) + uint64(1))))
(*EvalEvent)(unsafe.Pointer(pEvent)).Fbase.FnextPtr = uintptr(0)
(*EvalEvent)(unsafe.Pointer(pEvent)).Fbase.Fproc = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{tclScriptEvent}))
(*EvalEvent)(unsafe.Pointer(pEvent)).FzScript = (pEvent + uintptr(1)*32)
- crt.Xmemcpy(tls, (*EvalEvent)(unsafe.Pointer(pEvent)).FzScript, zMsg, (uint64(*(*int32)(unsafe.Pointer(bp /* nMsg */)) + 1)))
+ libc.Xmemcpy(tls, (*EvalEvent)(unsafe.Pointer(pEvent)).FzScript, zMsg, (uint64(*(*int32)(unsafe.Pointer(bp /* nMsg */)) + 1)))
(*EvalEvent)(unsafe.Pointer(pEvent)).Finterp = (*SqlThread)(unsafe.Pointer(p)).Finterp
tcl.XTcl_ThreadQueueEvent(tls, (*SqlThread)(unsafe.Pointer(p)).Fparent, pEvent, TCL_QUEUE_TAIL)
@@ -69418,7 +74731,7 @@ func postToParent(tls *crt.TLS, p uintptr, pScript uintptr) { /* test_thread.c:9
}
// The main function for threads created with [sqlthread spawn].
-func tclScriptThread(tls *crt.TLS, pSqlThread ClientData) { /* test_thread.c:114:29: */
+func tclScriptThread(tls *libc.TLS, pSqlThread ClientData) { /* test_thread.c:114:29: */
var interp uintptr
var pRes uintptr
var pList uintptr
@@ -69426,22 +74739,22 @@ func tclScriptThread(tls *crt.TLS, pSqlThread ClientData) { /* test_thread.c:114
var p uintptr = pSqlThread
interp = tcl.XTcl_CreateInterp(tls)
- tcl.XTcl_CreateObjCommand(tls, interp, ts+35009 /* "clock_seconds" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+37109 /* "clock_seconds" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
}{clock_seconds_proc})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+35023 /* "sqlthread" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+37123 /* "sqlthread" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
}{sqlthread_proc})), pSqlThread, uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+35033 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+37133 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{blocking_step_proc})), uintptr(0), uintptr(0))
tcl.XTcl_CreateObjCommand(tls, interp,
- ts+35055 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ ts+37155 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{blocking_prepare_v2_proc})), uintptr(1), uintptr(0))
tcl.XTcl_CreateObjCommand(tls, interp,
- ts+35083 /* "sqlite3_nonblock..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ ts+37183 /* "sqlite3_nonblock..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{blocking_prepare_v2_proc})), uintptr(0), uintptr(0))
Sqlitetest1_Init(tls, interp)
Sqlitetest_mutex_Init(tls, interp)
@@ -69454,19 +74767,19 @@ func tclScriptThread(tls *crt.TLS, pSqlThread ClientData) { /* test_thread.c:114
(*Tcl_Obj)(unsafe.Pointer(pRes)).FrefCount++
if rc != 0 {
- tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewStringObj(tls, ts+35114 /* "error" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewStringObj(tls, ts+10131 /* "error" */, -1))
tcl.XTcl_ListObjAppendElement(tls, interp, pList, pRes)
postToParent(tls, p, pList)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pList
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
pList = tcl.XTcl_NewObj(tls)
}
- tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewStringObj(tls, ts+35120 /* "set" */, -1))
+ tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewStringObj(tls, ts+37214 /* "set" */, -1))
tcl.XTcl_ListObjAppendElement(tls, interp, pList, tcl.XTcl_NewStringObj(tls, (*SqlThread)(unsafe.Pointer(p)).FzVarname, -1))
tcl.XTcl_ListObjAppendElement(tls, interp, pList, pRes)
postToParent(tls, p, pList)
@@ -69474,18 +74787,18 @@ func tclScriptThread(tls *crt.TLS, pSqlThread ClientData) { /* test_thread.c:114
tcl.XTcl_Free(tls, p)
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = pList
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
for ok2 := true; ok2; ok2 = 0 != 0 {
var _objPtr uintptr = pRes
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
tcl.XTcl_DeleteInterp(tls, interp)
- for tcl.XTcl_DoOneEvent(tls, ((^int32(crt.Int32FromInt32((int32(1) << 1))))|(int32(1)<<1))) != 0 {
+ for tcl.XTcl_DoOneEvent(tls, ((^int32(libc.Int32FromInt32((int32(1) << 1))))|(int32(1)<<1))) != 0 {
}
tcl.XTcl_ExitThread(tls, 0)
@@ -69499,7 +74812,7 @@ func tclScriptThread(tls *crt.TLS, pSqlThread ClientData) { /* test_thread.c:114
// VARNAME.
//
// The caller can wait for the script to terminate using [vwait VARNAME].
-func sqlthread_spawn(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:174:26: */
+func sqlthread_spawn(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:174:26: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -69527,14 +74840,14 @@ func sqlthread_spawn(tls *crt.TLS, clientData ClientData, interp uintptr, objc i
pNew = tcl.XTcl_Alloc(tls, (uint32(((uint64(unsafe.Sizeof(SqlThread{})) + uint64(*(*int32)(unsafe.Pointer(bp + 16 /* nVarname */)))) + uint64(*(*int32)(unsafe.Pointer(bp + 20 /* nScript */)))) + uint64(2))))
(*SqlThread)(unsafe.Pointer(pNew)).FzVarname = (pNew + uintptr(1)*32)
(*SqlThread)(unsafe.Pointer(pNew)).FzScript = ((*SqlThread)(unsafe.Pointer(pNew)).FzVarname + uintptr((*(*int32)(unsafe.Pointer(bp + 16 /* nVarname */)) + 1)))
- crt.Xmemcpy(tls, (*SqlThread)(unsafe.Pointer(pNew)).FzVarname, zVarname, (uint64(*(*int32)(unsafe.Pointer(bp + 16 /* nVarname */)) + 1)))
- crt.Xmemcpy(tls, (*SqlThread)(unsafe.Pointer(pNew)).FzScript, zScript, (uint64(*(*int32)(unsafe.Pointer(bp + 20 /* nScript */)) + 1)))
+ libc.Xmemcpy(tls, (*SqlThread)(unsafe.Pointer(pNew)).FzVarname, zVarname, (uint64(*(*int32)(unsafe.Pointer(bp + 16 /* nVarname */)) + 1)))
+ libc.Xmemcpy(tls, (*SqlThread)(unsafe.Pointer(pNew)).FzScript, zScript, (uint64(*(*int32)(unsafe.Pointer(bp + 20 /* nScript */)) + 1)))
(*SqlThread)(unsafe.Pointer(pNew)).Fparent = tcl.XTcl_GetCurrentThread(tls)
(*SqlThread)(unsafe.Pointer(pNew)).Finterp = interp
- rc = tcl.XTcl_CreateThread(tls, bp+24 /* &x */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, ClientData) }{tclScriptThread})), pNew, nStack, flags)
+ rc = tcl.XTcl_CreateThread(tls, bp+24 /* &x */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{tclScriptThread})), pNew, nStack, flags)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+35124 /* "Error in Tcl_Cre..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+37218 /* "Error in Tcl_Cre..." */, 0))
tcl.XTcl_Free(tls, pNew)
return 1
}
@@ -69551,7 +74864,7 @@ func sqlthread_spawn(tls *crt.TLS, clientData ClientData, interp uintptr, objc i
// block indefinitely.
//
// NOTE: At the moment, this doesn't work. FIXME.
-func sqlthread_parent(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:227:26: */
+func sqlthread_parent(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:227:26: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -69564,7 +74877,7 @@ func sqlthread_parent(tls *crt.TLS, clientData ClientData, interp uintptr, objc
_ = objc
if p == uintptr(0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+35152 /* "no parent thread" */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+37246 /* "no parent thread" */, 0))
return 1
}
@@ -69572,10 +74885,10 @@ func sqlthread_parent(tls *crt.TLS, clientData ClientData, interp uintptr, objc
pEvent = tcl.XTcl_Alloc(tls, (uint32((uint64(unsafe.Sizeof(EvalEvent{})) + uint64(*(*int32)(unsafe.Pointer(bp + 16 /* nMsg */)))) + uint64(1))))
(*EvalEvent)(unsafe.Pointer(pEvent)).Fbase.FnextPtr = uintptr(0)
(*EvalEvent)(unsafe.Pointer(pEvent)).Fbase.Fproc = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{tclScriptEvent}))
(*EvalEvent)(unsafe.Pointer(pEvent)).FzScript = (pEvent + uintptr(1)*32)
- crt.Xmemcpy(tls, (*EvalEvent)(unsafe.Pointer(pEvent)).FzScript, zMsg, (uint64(*(*int32)(unsafe.Pointer(bp + 16 /* nMsg */)) + 1)))
+ libc.Xmemcpy(tls, (*EvalEvent)(unsafe.Pointer(pEvent)).FzScript, zMsg, (uint64(*(*int32)(unsafe.Pointer(bp + 16 /* nMsg */)) + 1)))
(*EvalEvent)(unsafe.Pointer(pEvent)).Finterp = (*SqlThread)(unsafe.Pointer(p)).Finterp
tcl.XTcl_ThreadQueueEvent(tls, (*SqlThread)(unsafe.Pointer(p)).Fparent, pEvent, TCL_QUEUE_TAIL)
tcl.XTcl_ThreadAlert(tls, (*SqlThread)(unsafe.Pointer(p)).Fparent)
@@ -69583,7 +74896,7 @@ func sqlthread_parent(tls *crt.TLS, clientData ClientData, interp uintptr, objc
return 0
}
-func xBusy(tls *crt.TLS, pArg uintptr, nBusy int32) int32 { /* test_thread.c:259:12: */
+func xBusy(tls *libc.TLS, pArg uintptr, nBusy int32) int32 { /* test_thread.c:259:12: */
_ = pArg
_ = nBusy
sqlite3.Xsqlite3_sleep(tls, 50)
@@ -69594,7 +74907,7 @@ func xBusy(tls *crt.TLS, pArg uintptr, nBusy int32) int32 { /* test_thread.c:259
//
// Open a database handle and return the string representation of
// the pointer value.
-func sqlthread_open(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:272:26: */
+func sqlthread_open(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:272:26: */
bp := tls.Alloc(124)
defer tls.Free(124)
@@ -69610,13 +74923,13 @@ func sqlthread_open(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
sqlite3.Xsqlite3_open(tls, zFilename, bp+16 /* &db */)
Md5_Register(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), uintptr(0), uintptr(0))
sqlite3.Xsqlite3_busy_handler(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */)), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{xBusy})), uintptr(0))
if sqlite3TestMakePointerStr(tls, interp, bp+24 /* &zBuf[0] */, *(*uintptr)(unsafe.Pointer(bp + 16 /* db */))) != 0 {
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, bp+24 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, bp+24 /* &zBuf[0] */, 0))
return 0
}
@@ -69625,7 +74938,7 @@ func sqlthread_open(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
//
// Return the current thread-id (Tcl_GetCurrentThread()) cast to
// an integer.
-func sqlthread_id(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:306:26: */
+func sqlthread_id(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:306:26: */
var id Tcl_ThreadId = tcl.XTcl_GetCurrentThread(tls)
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, int32(id)))
_ = clientData
@@ -69635,7 +74948,7 @@ func sqlthread_id(tls *crt.TLS, clientData ClientData, interp uintptr, objc int3
}
// Dispatch routine for the sub-commands of [sqlthread].
-func sqlthread_proc(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:324:26: */
+func sqlthread_proc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:324:26: */
bp := tls.Alloc(164)
defer tls.Free(164)
@@ -69650,17 +74963,17 @@ func sqlthread_proc(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
FnArg int32
FzUsage uintptr
}{
- {FzName: ts + 35169 /* "parent" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
- }{sqlthread_parent})), FnArg: 1, FzUsage: ts + 9746 /* "SCRIPT" */},
- {FzName: ts + 35176 /* "spawn" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
- }{sqlthread_spawn})), FnArg: 2, FzUsage: ts + 35182 /* "VARNAME SCRIPT" */},
- {FzName: ts + 33780 /* "open" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
- }{sqlthread_open})), FnArg: 1, FzUsage: ts + 35197 /* "DBNAME" */},
- {FzName: ts + 35204 /* "id" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
+ {FzName: ts + 37263 /* "parent" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
+ }{sqlthread_parent})), FnArg: 1, FzUsage: ts + 11405 /* "SCRIPT" */},
+ {FzName: ts + 37270 /* "spawn" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
+ }{sqlthread_spawn})), FnArg: 2, FzUsage: ts + 37276 /* "VARNAME SCRIPT" */},
+ {FzName: ts + 35880 /* "open" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
+ }{sqlthread_open})), FnArg: 1, FzUsage: ts + 37291 /* "DBNAME" */},
+ {FzName: ts + 37298 /* "id" */, FxProc: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
}{sqlthread_id})), FnArg: 0, FzUsage: ts + 488 /* "" */},
{FzName: uintptr(0), FxProc: uintptr(0), FnArg: 0},
}
@@ -69669,7 +74982,7 @@ func sqlthread_proc(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
// var iIndex int32 at bp+160, 4
if objc < 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+31703 /* "SUB-COMMAND" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+2383 /* "SUB-COMMAND" */)
return 1
}
@@ -69700,7 +75013,7 @@ func sqlthread_proc(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
return 1
}
- return (*(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer((pSub + 8 /* &.xProc */))))(tls, clientData, interp, objc, objv)
+ return (*(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer((pSub + 8 /* &.xProc */))))(tls, clientData, interp, objc, objv)
}
/*
@@ -69710,7 +75023,7 @@ func sqlthread_proc(tls *crt.TLS, clientData ClientData, interp uintptr, objc in
** implemented as a script in Tcl 8.5, it is not usually available to
** testfixture.
*/
-func clock_seconds_proc(tls *crt.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:372:26: */
+func clock_seconds_proc(tls *libc.TLS, clientData ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:372:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -69737,14 +75050,14 @@ type UnlockNotification1 = struct {
type UnlockNotification = UnlockNotification1 /* test_thread.c:410:35 */
// This function is an unlock-notify callback registered with SQLite.
-func unlock_notify_cb(tls *crt.TLS, apArg uintptr, nArg int32) { /* test_thread.c:420:13: */
+func unlock_notify_cb(tls *libc.TLS, apArg uintptr, nArg int32) { /* test_thread.c:420:13: */
var i int32
for i = 0; i < nArg; i++ {
var p uintptr = *(*uintptr)(unsafe.Pointer(apArg + uintptr(i)*8))
- crt2.Xpthread_mutex_lock(tls, (p + 56 /* &.mutex */))
+ libc2.Xpthread_mutex_lock(tls, (p + 56 /* &.mutex */))
(*UnlockNotification)(unsafe.Pointer(p)).Ffired = 1
- crt2.Xpthread_cond_signal(tls, (p + 8 /* &.cond */))
- crt2.Xpthread_mutex_unlock(tls, (p + 56 /* &.mutex */))
+ libc2.Xpthread_cond_signal(tls, (p + 8 /* &.cond */))
+ libc2.Xpthread_mutex_unlock(tls, (p + 56 /* &.mutex */))
}
}
@@ -69760,7 +75073,7 @@ func unlock_notify_cb(tls *crt.TLS, apArg uintptr, nArg int32) { /* test_thread.
// the system, then this function returns SQLITE_LOCKED immediately. In
// this case the caller should not retry the operation and should roll
// back the current transaction (if any).
-func wait_for_unlock_notify(tls *crt.TLS, db uintptr) int32 { /* test_thread.c:445:12: */
+func wait_for_unlock_notify(tls *libc.TLS, db uintptr) int32 { /* test_thread.c:445:12: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -69769,12 +75082,12 @@ func wait_for_unlock_notify(tls *crt.TLS, db uintptr) int32 { /* test_thread.c:4
// Initialize the UnlockNotification structure.
(*UnlockNotification)(unsafe.Pointer(bp /* &un */)).Ffired = 0
- crt2.Xpthread_mutex_init(tls, (bp /* &un */ + 56 /* &.mutex */), uintptr(0))
- crt2.Xpthread_cond_init(tls, (bp /* &un */ + 8 /* &.cond */), uintptr(0))
+ libc2.Xpthread_mutex_init(tls, (bp /* &un */ + 56 /* &.mutex */), uintptr(0))
+ libc2.Xpthread_cond_init(tls, (bp /* &un */ + 8 /* &.cond */), uintptr(0))
// Register for an unlock-notify callback.
rc = sqlite3.Xsqlite3_unlock_notify(tls, db, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32)
+ f func(*libc.TLS, uintptr, int32)
}{unlock_notify_cb})), bp /* &un */)
// The call to sqlite3_unlock_notify() always returns either SQLITE_LOCKED
@@ -69785,16 +75098,16 @@ func wait_for_unlock_notify(tls *crt.TLS, db uintptr) int32 { /* test_thread.c:4
// that the current transaction can be rolled back. Otherwise, block
// until the unlock-notify callback is invoked, then return SQLITE_OK.
if rc == 0 {
- crt2.Xpthread_mutex_lock(tls, (bp /* &un */ + 56 /* &.mutex */))
+ libc2.Xpthread_mutex_lock(tls, (bp /* &un */ + 56 /* &.mutex */))
if !((*UnlockNotification)(unsafe.Pointer(bp /* &un */)).Ffired != 0) {
- crt2.Xpthread_cond_wait(tls, (bp /* &un */ + 8 /* &.cond */), (bp /* &un */ + 56 /* &.mutex */))
+ libc2.Xpthread_cond_wait(tls, (bp /* &un */ + 8 /* &.cond */), (bp /* &un */ + 56 /* &.mutex */))
}
- crt2.Xpthread_mutex_unlock(tls, (bp /* &un */ + 56 /* &.mutex */))
+ libc2.Xpthread_mutex_unlock(tls, (bp /* &un */ + 56 /* &.mutex */))
}
// Destroy the mutex and condition variables.
- crt2.Xpthread_cond_destroy(tls, (bp /* &un */ + 8 /* &.cond */))
- crt2.Xpthread_mutex_destroy(tls, (bp /* &un */ + 56 /* &.mutex */))
+ libc2.Xpthread_cond_destroy(tls, (bp /* &un */ + 8 /* &.cond */))
+ libc2.Xpthread_mutex_destroy(tls, (bp /* &un */ + 56 /* &.mutex */))
return rc
}
@@ -69808,9 +75121,9 @@ func wait_for_unlock_notify(tls *crt.TLS, db uintptr) int32 { /* test_thread.c:4
// If this function returns SQLITE_LOCKED, the caller should rollback
// the current transaction (if any) and try again later. Otherwise, the
// system may become deadlocked.
-func sqlite3_blocking_step(tls *crt.TLS, pStmt uintptr) int32 { /* test_thread.c:492:5: */
+func sqlite3_blocking_step(tls *libc.TLS, pStmt uintptr) int32 { /* test_thread.c:492:5: */
var rc int32
- for 6 == (crt.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) {
+ for 6 == (libc.AssignInt32(&rc, sqlite3.Xsqlite3_step(tls, pStmt))) {
rc = wait_for_unlock_notify(tls, sqlite3.Xsqlite3_db_handle(tls, pStmt))
if rc != 0 {
break
@@ -69829,9 +75142,9 @@ func sqlite3_blocking_step(tls *crt.TLS, pStmt uintptr) int32 { /* test_thread.c
// If this function returns SQLITE_LOCKED, the caller should rollback
// the current transaction (if any) and try again later. Otherwise, the
// system may become deadlocked.
-func sqlite3_blocking_prepare_v2(tls *crt.TLS, db uintptr, zSql uintptr, nSql int32, ppStmt uintptr, pz uintptr) int32 { /* test_thread.c:513:5: */
+func sqlite3_blocking_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nSql int32, ppStmt uintptr, pz uintptr) int32 { /* test_thread.c:513:5: */
var rc int32
- for 6 == (crt.AssignInt32(&rc, sqlite3.Xsqlite3_prepare_v2(tls, db, zSql, nSql, ppStmt, pz))) {
+ for 6 == (libc.AssignInt32(&rc, sqlite3.Xsqlite3_prepare_v2(tls, db, zSql, nSql, ppStmt, pz))) {
rc = wait_for_unlock_notify(tls, db)
if rc != 0 {
break
@@ -69845,12 +75158,12 @@ func sqlite3_blocking_prepare_v2(tls *crt.TLS, db uintptr, zSql uintptr, nSql in
// Usage: sqlite3_blocking_step STMT
//
// Advance the statement to the next row.
-func blocking_step_proc(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:534:26: */
+func blocking_step_proc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:534:26: */
var pStmt uintptr
var rc int32
if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+14574 /* "STMT" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+16285 /* "STMT" */)
return 1
}
@@ -69863,7 +75176,7 @@ func blocking_step_proc(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
// Usage: sqlite3_blocking_prepare_v2 DB sql bytes ?tailvar?
// Usage: sqlite3_nonblocking_prepare_v2 DB sql bytes ?tailvar?
-func blocking_prepare_v2_proc(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:560:26: */
+func blocking_prepare_v2_proc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_thread.c:560:26: */
bp := tls.Alloc(162)
defer tls.Free(162)
@@ -69877,11 +75190,11 @@ func blocking_prepare_v2_proc(tls *crt.TLS, clientData uintptr, interp uintptr,
// var zBuf [50]int8 at bp+112, 50
var rc int32
- var isBlocking int32 = crt.BoolInt32(!(clientData == uintptr(0)))
+ var isBlocking int32 = libc.BoolInt32(!(clientData == uintptr(0)))
if (objc != 5) && (objc != 4) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+12801, /* "wrong # args: sh..." */
- tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+14620 /* " DB sql bytes ta..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+14451, /* "wrong # args: sh..." */
+ tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(0)*8))), ts+16331 /* " DB sql bytes ta..." */, 0))
return 1
}
if getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp+80 /* &db */) != 0 {
@@ -69906,8 +75219,8 @@ func blocking_prepare_v2_proc(tls *crt.TLS, clientData uintptr, interp uintptr,
}
if rc != 0 {
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+35207 /* "%s " */, crt.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc)))
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+40, bp+112 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zBuf[0] */, ts+37301 /* "%s " */, libc.VaList(bp+32, sqlite3.Xsqlite3ErrName(tls, rc)))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+40, bp+112 /* &zBuf[0] */, sqlite3.Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* db */))), 0))
return 1
}
@@ -69915,7 +75228,7 @@ func blocking_prepare_v2_proc(tls *crt.TLS, clientData uintptr, interp uintptr,
if sqlite3TestMakePointerStr(tls, interp, bp+112 /* &zBuf[0] */, *(*uintptr)(unsafe.Pointer(bp + 96 /* pStmt */))) != 0 {
return 1
}
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+64, bp+112 /* &zBuf[0] */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+64, bp+112 /* &zBuf[0] */, 0))
}
return 0
}
@@ -69925,23 +75238,23 @@ func blocking_prepare_v2_proc(tls *crt.TLS, clientData uintptr, interp uintptr,
//
// Register commands with the TCL interpreter.
-func SqlitetestThread_Init(tls *crt.TLS, interp uintptr) int32 { /* test_thread.c:619:5: */
- tcl.XTcl_CreateObjCommand(tls, interp, ts+35023 /* "sqlthread" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
+func SqlitetestThread_Init(tls *libc.TLS, interp uintptr) int32 { /* test_thread.c:619:5: */
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+37123 /* "sqlthread" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
}{sqlthread_proc})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+35009 /* "clock_seconds" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+37109 /* "clock_seconds" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
}{clock_seconds_proc})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+35033 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+37133 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{blocking_step_proc})), uintptr(0), uintptr(0))
tcl.XTcl_CreateObjCommand(tls, interp,
- ts+35055 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ ts+37155 /* "sqlite3_blocking..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{blocking_prepare_v2_proc})), uintptr(1), uintptr(0))
tcl.XTcl_CreateObjCommand(tls, interp,
- ts+35083 /* "sqlite3_nonblock..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ ts+37183 /* "sqlite3_nonblock..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{blocking_prepare_v2_proc})), uintptr(0), uintptr(0))
return 0
}
@@ -69954,7 +75267,7 @@ func SqlitetestThread_Init(tls *crt.TLS, interp uintptr) int32 { /* test_thread.
// fill-column: 78
// End:
-func Sqlitetestvdbecov_Init(tls *crt.TLS, interp uintptr) int32 { /* test_vdbecov.c:113:5: */
+func Sqlitetestvdbecov_Init(tls *libc.TLS, interp uintptr) int32 { /* test_vdbecov.c:113:5: */
return 0
}
@@ -70013,8 +75326,8 @@ type TestvfsFd1 = struct {
FpReal uintptr
FpShmId uintptr
FpShm uintptr
- Fexcllock u321
- Fsharedlock u321
+ Fexcllock u322
+ Fsharedlock u322
FpNext uintptr
}
@@ -70048,27 +75361,27 @@ var tvfs_io_methods = sqlite3_io_methods{FiVersion: 3, FxClose: // iVersion
0, FxUnfetch: 0,
} /* test_vfs.c:204:27 */
-func tvfsResultCode(tls *crt.TLS, p uintptr, pRc uintptr) int32 { /* test_vfs.c:226:12: */
+func tvfsResultCode(tls *libc.TLS, p uintptr, pRc uintptr) int32 { /* test_vfs.c:226:12: */
bp := tls.Alloc(144)
defer tls.Free(144)
*(*[9]errcode)(unsafe.Pointer(bp /* aCode */)) = [9]errcode{
- {FeCode: 0, FzCode: ts + 9424 /* "SQLITE_OK" */},
- {FeCode: 1, FzCode: ts + 35211 /* "SQLITE_ERROR" */},
- {FeCode: 10, FzCode: ts + 35224 /* "SQLITE_IOERR" */},
- {FeCode: 6, FzCode: ts + 35237 /* "SQLITE_LOCKED" */},
- {FeCode: 5, FzCode: ts + 35251 /* "SQLITE_BUSY" */},
- {FeCode: 8, FzCode: ts + 35263 /* "SQLITE_READONLY" */},
- {FeCode: (8 | (int32(5) << 8)), FzCode: ts + 35279 /* "SQLITE_READONLY_..." */},
- {FeCode: 12, FzCode: ts + 35304 /* "SQLITE_NOTFOUND" */},
- {FeCode: -1, FzCode: ts + 35320 /* "SQLITE_OMIT" */},
+ {FeCode: 0, FzCode: ts + 1987 /* "SQLITE_OK" */},
+ {FeCode: 1, FzCode: ts + 1974 /* "SQLITE_ERROR" */},
+ {FeCode: 10, FzCode: ts + 37305 /* "SQLITE_IOERR" */},
+ {FeCode: 6, FzCode: ts + 37318 /* "SQLITE_LOCKED" */},
+ {FeCode: 5, FzCode: ts + 37332 /* "SQLITE_BUSY" */},
+ {FeCode: 8, FzCode: ts + 37344 /* "SQLITE_READONLY" */},
+ {FeCode: (8 | (int32(5) << 8)), FzCode: ts + 37360 /* "SQLITE_READONLY_..." */},
+ {FeCode: 12, FzCode: ts + 37385 /* "SQLITE_NOTFOUND" */},
+ {FeCode: -1, FzCode: ts + 37401 /* "SQLITE_OMIT" */},
}
var z uintptr
var i int32
z = tcl.XTcl_GetStringResult(tls, (*Testvfs)(unsafe.Pointer(p)).Finterp)
for i = 0; i < (int32(uint64(unsafe.Sizeof([9]errcode{})) / uint64(unsafe.Sizeof(errcode{})))); i++ {
- if 0 == crt.Xstrcmp(tls, z, (*errcode)(unsafe.Pointer(bp /* &aCode */ +uintptr(i)*16)).FzCode) {
+ if 0 == libc.Xstrcmp(tls, z, (*errcode)(unsafe.Pointer(bp /* &aCode */ +uintptr(i)*16)).FzCode) {
*(*int32)(unsafe.Pointer(pRc)) = (*errcode)(unsafe.Pointer(bp /* &aCode */ + uintptr(i)*16)).FeCode
return 1
}
@@ -70082,7 +75395,7 @@ type errcode = struct {
FzCode uintptr
}
-func tvfsInjectFault(tls *crt.TLS, p uintptr) int32 { /* test_vfs.c:256:12: */
+func tvfsInjectFault(tls *libc.TLS, p uintptr) int32 { /* test_vfs.c:256:12: */
var ret int32 = 0
if (*TestFaultInject)(unsafe.Pointer(p)).FeFault != 0 {
(*TestFaultInject)(unsafe.Pointer(p)).FiCnt--
@@ -70094,18 +75407,18 @@ func tvfsInjectFault(tls *crt.TLS, p uintptr) int32 { /* test_vfs.c:256:12: */
return ret
}
-func tvfsInjectIoerr(tls *crt.TLS, p uintptr) int32 { /* test_vfs.c:269:12: */
+func tvfsInjectIoerr(tls *libc.TLS, p uintptr) int32 { /* test_vfs.c:269:12: */
return tvfsInjectFault(tls, (p + 60 /* &.ioerr_err */))
}
-func tvfsInjectFullerr(tls *crt.TLS, p uintptr) int32 { /* test_vfs.c:273:12: */
+func tvfsInjectFullerr(tls *libc.TLS, p uintptr) int32 { /* test_vfs.c:273:12: */
return tvfsInjectFault(tls, (p + 72 /* &.full_err */))
}
-func tvfsInjectCantopenerr(tls *crt.TLS, p uintptr) int32 { /* test_vfs.c:276:12: */
+func tvfsInjectCantopenerr(tls *libc.TLS, p uintptr) int32 { /* test_vfs.c:276:12: */
return tvfsInjectFault(tls, (p + 84 /* &.cantopen_err */))
}
-func tvfsExecTcl(tls *crt.TLS, p uintptr, zMethod uintptr, arg1 uintptr, arg2 uintptr, arg3 uintptr, arg4 uintptr) { /* test_vfs.c:281:13: */
+func tvfsExecTcl(tls *libc.TLS, p uintptr, zMethod uintptr, arg1 uintptr, arg2 uintptr, arg3 uintptr, arg4 uintptr) { /* test_vfs.c:281:13: */
var rc int32 // Return code from Tcl_EvalObj()
var pEval uintptr
@@ -70133,20 +75446,20 @@ func tvfsExecTcl(tls *crt.TLS, p uintptr, zMethod uintptr, arg1 uintptr, arg2 ui
}
// Close an tvfs-file.
-func tvfsClose(tls *crt.TLS, pFile uintptr) int32 { /* test_vfs.c:317:12: */
+func tvfsClose(tls *libc.TLS, pFile uintptr) int32 { /* test_vfs.c:317:12: */
var pTestfile uintptr = pFile
var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pTestfile)).FpFd
var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00000800) != 0) {
- tvfsExecTcl(tls, p, ts+32338, /* "xClose" */
+ tvfsExecTcl(tls, p, ts+34403, /* "xClose" */
tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, uintptr(0), uintptr(0))
}
if (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId != 0 {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -70162,7 +75475,7 @@ func tvfsClose(tls *crt.TLS, pFile uintptr) int32 { /* test_vfs.c:317:12: */
}
// Read data from an tvfs-file.
-func tvfsRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_vfs.c:344:12: */
+func tvfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_vfs.c:344:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70170,7 +75483,7 @@ func tvfsRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlit
var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd
var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00010000) != 0) {
- tvfsExecTcl(tls, p, ts+32345, /* "xRead" */
+ tvfsExecTcl(tls, p, ts+34410, /* "xRead" */
tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, uintptr(0), uintptr(0))
tvfsResultCode(tls, p, bp /* &rc */)
}
@@ -70184,7 +75497,7 @@ func tvfsRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlit
}
// Write data to an tvfs-file.
-func tvfsWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_vfs.c:371:12: */
+func tvfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqlite_int64) int32 { /* test_vfs.c:371:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70193,7 +75506,7 @@ func tvfsWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqli
var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00001000) != 0) {
- tvfsExecTcl(tls, p, ts+32351, /* "xWrite" */
+ tvfsExecTcl(tls, p, ts+34416, /* "xWrite" */
tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId,
tcl.XTcl_NewWideIntObj(tls, int64(iOfst)), tcl.XTcl_NewIntObj(tls, iAmt))
tvfsResultCode(tls, p, bp /* &rc */)
@@ -70216,7 +75529,7 @@ func tvfsWrite(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst sqli
}
// Truncate an tvfs-file.
-func tvfsTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_vfs.c:406:12: */
+func tvfsTruncate(tls *libc.TLS, pFile uintptr, size sqlite_int64) int32 { /* test_vfs.c:406:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70225,7 +75538,7 @@ func tvfsTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* tes
var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00002000) != 0) {
- tvfsExecTcl(tls, p, ts+32358, /* "xTruncate" */
+ tvfsExecTcl(tls, p, ts+34423, /* "xTruncate" */
tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, uintptr(0), uintptr(0))
tvfsResultCode(tls, p, bp /* &rc */)
}
@@ -70237,7 +75550,7 @@ func tvfsTruncate(tls *crt.TLS, pFile uintptr, size sqlite_int64) int32 { /* tes
}
// Sync an tvfs-file.
-func tvfsSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_vfs.c:427:12: */
+func tvfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* test_vfs.c:427:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70250,25 +75563,25 @@ func tvfsSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_vfs.c:42
switch flags {
case 0x00002:
- zFlags = ts + 14189 /* "normal" */
+ zFlags = ts + 15900 /* "normal" */
break
fallthrough
case 0x00003:
- zFlags = ts + 15892 /* "full" */
+ zFlags = ts + 17592 /* "full" */
break
fallthrough
case (0x00002 | 0x00010):
- zFlags = ts + 35332 /* "normal|dataonly" */
+ zFlags = ts + 37413 /* "normal|dataonly" */
break
fallthrough
case (0x00003 | 0x00010):
- zFlags = ts + 35348 /* "full|dataonly" */
+ zFlags = ts + 37429 /* "full|dataonly" */
break
fallthrough
default:
}
- tvfsExecTcl(tls, p, ts+24735, /* "xSync" */
+ tvfsExecTcl(tls, p, ts+26827, /* "xSync" */
tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId,
tcl.XTcl_NewStringObj(tls, zFlags, -1), uintptr(0))
tvfsResultCode(tls, p, bp /* &rc */)
@@ -70286,13 +75599,13 @@ func tvfsSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* test_vfs.c:42
}
// Return the current file-size of an tvfs-file.
-func tvfsFileSize(tls *crt.TLS, pFile uintptr, pSize uintptr) int32 { /* test_vfs.c:471:12: */
+func tvfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* test_vfs.c:471:12: */
var p uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd
return sqlite3.Xsqlite3OsFileSize(tls, (*TestvfsFd)(unsafe.Pointer(p)).FpReal, pSize)
}
// Lock an tvfs-file.
-func tvfsLock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_vfs.c:479:12: */
+func tvfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_vfs.c:479:12: */
bp := tls.Alloc(38)
defer tls.Free(38)
@@ -70301,15 +75614,15 @@ func tvfsLock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_vfs.c:47
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00040000) != 0) {
// var zLock [30]int8 at bp+8, 30
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zLock[0] */, ts+1237 /* "%d" */, crt.VaList(bp, eLock))
- tvfsExecTcl(tls, p, ts+32378 /* "xLock" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1),
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zLock[0] */, ts+1237 /* "%d" */, libc.VaList(bp, eLock))
+ tvfsExecTcl(tls, p, ts+34443 /* "xLock" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1),
tcl.XTcl_NewStringObj(tls, bp+8 /* &zLock[0] */, -1), uintptr(0), uintptr(0))
}
return sqlite3.Xsqlite3OsLock(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal, eLock)
}
// Unlock an tvfs-file.
-func tvfsUnlock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_vfs.c:494:12: */
+func tvfsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* test_vfs.c:494:12: */
bp := tls.Alloc(38)
defer tls.Free(38)
@@ -70318,8 +75631,8 @@ func tvfsUnlock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_vfs.c:
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00020000) != 0) {
// var zLock [30]int8 at bp+8, 30
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zLock[0] */, ts+1237 /* "%d" */, crt.VaList(bp, eLock))
- tvfsExecTcl(tls, p, ts+32384 /* "xUnlock" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1),
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([30]int8{})), bp+8 /* &zLock[0] */, ts+1237 /* "%d" */, libc.VaList(bp, eLock))
+ tvfsExecTcl(tls, p, ts+34449 /* "xUnlock" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1),
tcl.XTcl_NewStringObj(tls, bp+8 /* &zLock[0] */, -1), uintptr(0), uintptr(0))
}
if (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00001000) != 0) && (tvfsInjectIoerr(tls, p) != 0) {
@@ -70329,18 +75642,18 @@ func tvfsUnlock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* test_vfs.c:
}
// Check if another file-handle holds a RESERVED lock on an tvfs-file.
-func tvfsCheckReservedLock(tls *crt.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_vfs.c:512:12: */
+func tvfsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* test_vfs.c:512:12: */
var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd
var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00080000) != 0) {
- tvfsExecTcl(tls, p, ts+35362 /* "xCheckReservedLo..." */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1),
+ tvfsExecTcl(tls, p, ts+37443 /* "xCheckReservedLo..." */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1),
uintptr(0), uintptr(0), uintptr(0))
}
return sqlite3.Xsqlite3OsCheckReservedLock(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal, pResOut)
}
// File control method. For custom operations on an tvfs-file.
-func tvfsFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_vfs.c:525:12: */
+func tvfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* test_vfs.c:525:12: */
bp := tls.Alloc(68)
defer tls.Free(68)
@@ -70348,11 +75661,11 @@ func tvfsFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32
var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData
if op == 14 {
var argv uintptr = pArg
- if sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+35114 /* "error" */) == 0 {
+ if sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+10131 /* "error" */) == 0 {
var rc int32 = 1
if *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)) != 0 {
var z uintptr = *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))
- var x int32 = crt.Xatoi(tls, z)
+ var x int32 = libc.Xatoi(tls, z)
if x != 0 {
rc = x
for (int32(sqlite3.Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(0))))]) & 0x04) != 0 {
@@ -70363,21 +75676,21 @@ func tvfsFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32
}
}
if *(*int8)(unsafe.Pointer(z + uintptr(0))) != 0 {
- *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp, z))
+ *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp, z))
}
}
return rc
}
- if sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+3336 /* "filename" */) == 0 {
- *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, crt.VaList(bp+8, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename))
+ if sqlite3.Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+4485 /* "filename" */) == 0 {
+ *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)) = sqlite3.Xsqlite3_mprintf(tls, ts /* "%s" */, libc.VaList(bp+8, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename))
return 0
}
}
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00100000) != 0) {
*(*[3]Fcntl)(unsafe.Pointer(bp + 16 /* aF */)) = [3]Fcntl{
- {FiFnctl: 31, FzFnctl: ts + 35381 /* "BEGIN_ATOMIC_WRI..." */},
- {FiFnctl: 32, FzFnctl: ts + 35400 /* "COMMIT_ATOMIC_WR..." */},
- {FiFnctl: 25, FzFnctl: ts + 35420 /* "ZIPVFS" */},
+ {FiFnctl: 31, FzFnctl: ts + 37462 /* "BEGIN_ATOMIC_WRI..." */},
+ {FiFnctl: 32, FzFnctl: ts + 37481 /* "COMMIT_ATOMIC_WR..." */},
+ {FiFnctl: 25, FzFnctl: ts + 37501 /* "ZIPVFS" */},
}
var i int32
for i = 0; uint64(i) < (uint64(unsafe.Sizeof([3]Fcntl{})) / uint64(unsafe.Sizeof(Fcntl{}))); i++ {
@@ -70387,7 +75700,7 @@ func tvfsFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32
}
if uint64(i) < (uint64(unsafe.Sizeof([3]Fcntl{})) / uint64(unsafe.Sizeof(Fcntl{}))) {
*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = 0
- tvfsExecTcl(tls, p, ts+32406, /* "xFileControl" */
+ tvfsExecTcl(tls, p, ts+34471, /* "xFileControl" */
tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1),
tcl.XTcl_NewStringObj(tls, (*Fcntl)(unsafe.Pointer(bp+16 /* &aF */ +uintptr(i)*16)).FzFnctl, -1),
uintptr(0), uintptr(0))
@@ -70411,7 +75724,7 @@ type Fcntl = struct {
}
// Return the sector-size in bytes for an tvfs-file.
-func tvfsSectorSize(tls *crt.TLS, pFile uintptr) int32 { /* test_vfs.c:579:12: */
+func tvfsSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* test_vfs.c:579:12: */
var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd
var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData
if (*Testvfs)(unsafe.Pointer(p)).FiSectorsize >= 0 {
@@ -70421,7 +75734,7 @@ func tvfsSectorSize(tls *crt.TLS, pFile uintptr) int32 { /* test_vfs.c:579:12: *
}
// Return the device characteristic flags supported by an tvfs-file.
-func tvfsDeviceCharacteristics(tls *crt.TLS, pFile uintptr) int32 { /* test_vfs.c:591:12: */
+func tvfsDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* test_vfs.c:591:12: */
var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd
var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData
if (*Testvfs)(unsafe.Pointer(p)).FiDevchar >= 0 {
@@ -70431,7 +75744,7 @@ func tvfsDeviceCharacteristics(tls *crt.TLS, pFile uintptr) int32 { /* test_vfs.
}
// Open an tvfs file handle.
-func tvfsOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_vfs.c:603:12: */
+func tvfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* test_vfs.c:603:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70443,13 +75756,13 @@ func tvfsOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags in
var p uintptr = (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData
pFd = tcl.XTcl_Alloc(tls, (uint32(uint64(unsafe.Sizeof(TestvfsFd{})) + uint64((*sqlite3_vfs)(unsafe.Pointer(((*Testvfs)(unsafe.Pointer((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FpParent))).FszOsFile))))
- crt.Xmemset(tls, pFd, 0, (uint64(unsafe.Sizeof(TestvfsFd{})) + uint64((*sqlite3_vfs)(unsafe.Pointer(((*Testvfs)(unsafe.Pointer((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FpParent))).FszOsFile)))
+ libc.Xmemset(tls, pFd, 0, (uint64(unsafe.Sizeof(TestvfsFd{})) + uint64((*sqlite3_vfs)(unsafe.Pointer(((*Testvfs)(unsafe.Pointer((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FpParent))).FszOsFile)))
(*TestvfsFd)(unsafe.Pointer(pFd)).FpShm = uintptr(0)
(*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId = uintptr(0)
(*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename = zName
(*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs = pVfs
(*TestvfsFd)(unsafe.Pointer(pFd)).FpReal = (pFd + uintptr(1)*56)
- crt.Xmemset(tls, pTestfile, 0, uint64(unsafe.Sizeof(TestvfsFile{})))
+ libc.Xmemset(tls, pTestfile, 0, uint64(unsafe.Sizeof(TestvfsFile{})))
(*TestvfsFile)(unsafe.Pointer(pTestfile)).FpFd = pFd
// Evaluate the Tcl script:
@@ -70465,18 +75778,18 @@ func tvfsOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags in
var pArg uintptr = tcl.XTcl_NewObj(tls)
(*Tcl_Obj)(unsafe.Pointer(pArg)).FrefCount++
if (flags & 0x00000100) != 0 {
- var z uintptr = (zName + uintptr((crt.Xstrlen(tls, zName) + uint64(1))))
+ var z uintptr = (zName + uintptr((libc.Xstrlen(tls, zName) + uint64(1))))
for *(*int8)(unsafe.Pointer(z)) != 0 {
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pArg, tcl.XTcl_NewStringObj(tls, z, -1))
- z += (uintptr(crt.Xstrlen(tls, z) + uint64(1)))
+ z += (uintptr(libc.Xstrlen(tls, z) + uint64(1)))
tcl.XTcl_ListObjAppendElement(tls, uintptr(0), pArg, tcl.XTcl_NewStringObj(tls, z, -1))
- z += (uintptr(crt.Xstrlen(tls, z) + uint64(1)))
+ z += (uintptr(libc.Xstrlen(tls, z) + uint64(1)))
}
}
- tvfsExecTcl(tls, p, ts+24300 /* "xOpen" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), pArg, uintptr(0), uintptr(0))
+ tvfsExecTcl(tls, p, ts+26399 /* "xOpen" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), pArg, uintptr(0), uintptr(0))
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pArg
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -70500,7 +75813,7 @@ func tvfsOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags in
}
if !(pId != 0) {
- pId = tcl.XTcl_NewStringObj(tls, ts+35427 /* "anon" */, -1)
+ pId = tcl.XTcl_NewStringObj(tls, ts+37508 /* "anon" */, -1)
}
(*Tcl_Obj)(unsafe.Pointer(pId)).FrefCount++
(*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId = pId
@@ -70518,7 +75831,7 @@ func tvfsOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags in
}
pMethods = tcl.XTcl_Alloc(tls, uint32(nByte))
- crt.Xmemcpy(tls, pMethods, uintptr(unsafe.Pointer(&tvfs_io_methods)), uint64(nByte))
+ libc.Xmemcpy(tls, pMethods, uintptr(unsafe.Pointer(&tvfs_io_methods)), uint64(nByte))
(*sqlite3_io_methods)(unsafe.Pointer(pMethods)).FiVersion = (*sqlite3_io_methods1)(unsafe.Pointer((*sqlite3_file)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpReal)).FpMethods)).FiVersion
if (*sqlite3_io_methods)(unsafe.Pointer(pMethods)).FiVersion > (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FiVersion {
(*sqlite3_io_methods)(unsafe.Pointer(pMethods)).FiVersion = (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FiVersion
@@ -70538,7 +75851,7 @@ func tvfsOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags in
// Delete the file located at zPath. If the dirSync argument is true,
// ensure the file-system modifications are synced to disk before
// returning.
-func tvfsDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_vfs.c:702:12: */
+func tvfsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* test_vfs.c:702:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70546,7 +75859,7 @@ func tvfsDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32
var p uintptr = (*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00000400) != 0) {
- tvfsExecTcl(tls, p, ts+32443, /* "xDelete" */
+ tvfsExecTcl(tls, p, ts+34508, /* "xDelete" */
tcl.XTcl_NewStringObj(tls, zPath, -1), tcl.XTcl_NewIntObj(tls, dirSync), uintptr(0), uintptr(0))
tvfsResultCode(tls, p, bp /* &rc */)
}
@@ -70558,7 +75871,7 @@ func tvfsDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32
// Test for access permissions. Return true if the requested permission
// is available, or false otherwise.
-func tvfsAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test_vfs.c:722:12: */
+func tvfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* test_vfs.c:722:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70568,15 +75881,15 @@ func tvfsAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut
var zArg uintptr = uintptr(0)
if flags == 0 {
- zArg = ts + 35432 /* "SQLITE_ACCESS_EX..." */
+ zArg = ts + 37513 /* "SQLITE_ACCESS_EX..." */
}
if flags == 1 {
- zArg = ts + 35453 /* "SQLITE_ACCESS_RE..." */
+ zArg = ts + 37534 /* "SQLITE_ACCESS_RE..." */
}
if flags == 2 {
- zArg = ts + 35477 /* "SQLITE_ACCESS_RE..." */
+ zArg = ts + 37558 /* "SQLITE_ACCESS_RE..." */
}
- tvfsExecTcl(tls, p, ts+32451, /* "xAccess" */
+ tvfsExecTcl(tls, p, ts+34516, /* "xAccess" */
tcl.XTcl_NewStringObj(tls, zPath, -1), tcl.XTcl_NewStringObj(tls, zArg, -1), uintptr(0), uintptr(0))
if tvfsResultCode(tls, p, bp /* &rc */) != 0 {
if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
@@ -70595,7 +75908,7 @@ func tvfsAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut
// Populate buffer zOut with the full canonical pathname corresponding
// to the pathname in zPath. zOut is guaranteed to point to a buffer
// of at least (DEVSYM_MAX_PATHNAME+1) bytes.
-func tvfsFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* test_vfs.c:755:12: */
+func tvfsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* test_vfs.c:755:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70603,7 +75916,7 @@ func tvfsFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOu
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00008000) != 0) {
// var rc int32 at bp, 4
- tvfsExecTcl(tls, p, ts+32459 /* "xFullPathname" */, tcl.XTcl_NewStringObj(tls, zPath, -1), uintptr(0), uintptr(0), uintptr(0))
+ tvfsExecTcl(tls, p, ts+34524 /* "xFullPathname" */, tcl.XTcl_NewStringObj(tls, zPath, -1), uintptr(0), uintptr(0), uintptr(0))
if tvfsResultCode(tls, p, bp /* &rc */) != 0 {
if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
return *(*int32)(unsafe.Pointer(bp /* rc */))
@@ -70615,22 +75928,22 @@ func tvfsFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOu
// Populate the buffer pointed to by zBufOut with nByte bytes of
// random data.
-func tvfsRandomness(tls *crt.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test_vfs.c:808:12: */
+func tvfsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* test_vfs.c:808:12: */
return sqlite3.Xsqlite3OsRandomness(tls, (*Testvfs)(unsafe.Pointer((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FpParent, nByte, zBufOut)
}
// Sleep for nMicro microseconds. Return the number of microseconds
// actually slept.
-func tvfsSleep(tls *crt.TLS, pVfs uintptr, nMicro int32) int32 { /* test_vfs.c:816:12: */
+func tvfsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* test_vfs.c:816:12: */
return sqlite3.Xsqlite3OsSleep(tls, (*Testvfs)(unsafe.Pointer((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FpParent, nMicro)
}
// Return the current time as a Julian Day number in *pTimeOut.
-func tvfsCurrentTime(tls *crt.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* test_vfs.c:823:12: */
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Testvfs)(unsafe.Pointer((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FpParent + 120 /* &.xCurrentTime */))))(tls, (*Testvfs)(unsafe.Pointer((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FpParent, pTimeOut)
+func tvfsCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* test_vfs.c:823:12: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Testvfs)(unsafe.Pointer((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FpParent + 120 /* &.xCurrentTime */))))(tls, (*Testvfs)(unsafe.Pointer((*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData)).FpParent, pTimeOut)
}
-func tvfsShmOpen(tls *crt.TLS, pFile uintptr) int32 { /* test_vfs.c:827:12: */
+func tvfsShmOpen(tls *libc.TLS, pFile uintptr) int32 { /* test_vfs.c:827:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70647,7 +75960,7 @@ func tvfsShmOpen(tls *crt.TLS, pFile uintptr) int32 { /* test_vfs.c:827:12: */
// SCRIPT xShmOpen FILENAME
tcl.XTcl_ResetResult(tls, (*Testvfs)(unsafe.Pointer(p)).Finterp)
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00000001) != 0) {
- tvfsExecTcl(tls, p, ts+35496 /* "xShmOpen" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), uintptr(0), uintptr(0), uintptr(0))
+ tvfsExecTcl(tls, p, ts+37577 /* "xShmOpen" */, tcl.XTcl_NewStringObj(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, -1), uintptr(0), uintptr(0), uintptr(0))
if tvfsResultCode(tls, p, bp /* &rc */) != 0 {
if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
return *(*int32)(unsafe.Pointer(bp /* rc */))
@@ -70661,17 +75974,17 @@ func tvfsShmOpen(tls *crt.TLS, pFile uintptr) int32 { /* test_vfs.c:827:12: */
// Search for a TestvfsBuffer. Create a new one if required.
for pBuffer = (*Testvfs)(unsafe.Pointer(p)).FpBuffer; pBuffer != 0; pBuffer = (*TestvfsBuffer)(unsafe.Pointer(pBuffer)).FpNext {
- if 0 == crt.Xstrcmp(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, (*TestvfsBuffer)(unsafe.Pointer(pBuffer)).FzFile) {
+ if 0 == libc.Xstrcmp(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, (*TestvfsBuffer)(unsafe.Pointer(pBuffer)).FzFile) {
break
}
}
if !(pBuffer != 0) {
- var szName int32 = int32(crt.Xstrlen(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename))
+ var szName int32 = int32(libc.Xstrlen(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename))
var nByte int32 = (int32((uint64(unsafe.Sizeof(TestvfsBuffer{})) + uint64(szName)) + uint64(1)))
pBuffer = tcl.XTcl_Alloc(tls, uint32(nByte))
- crt.Xmemset(tls, pBuffer, 0, uint64(nByte))
+ libc.Xmemset(tls, pBuffer, 0, uint64(nByte))
(*TestvfsBuffer)(unsafe.Pointer(pBuffer)).FzFile = (pBuffer + uintptr(1)*8224)
- crt.Xmemcpy(tls, (*TestvfsBuffer)(unsafe.Pointer(pBuffer)).FzFile, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, (uint64(szName + 1)))
+ libc.Xmemcpy(tls, (*TestvfsBuffer)(unsafe.Pointer(pBuffer)).FzFile, (*TestvfsFd)(unsafe.Pointer(pFd)).FzFilename, (uint64(szName + 1)))
(*TestvfsBuffer)(unsafe.Pointer(pBuffer)).FpNext = (*Testvfs)(unsafe.Pointer(p)).FpBuffer
(*Testvfs)(unsafe.Pointer(p)).FpBuffer = pBuffer
}
@@ -70683,16 +75996,16 @@ func tvfsShmOpen(tls *crt.TLS, pFile uintptr) int32 { /* test_vfs.c:827:12: */
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
-func tvfsAllocPage(tls *crt.TLS, p uintptr, iPage int32, pgsz int32) { /* test_vfs.c:877:13: */
+func tvfsAllocPage(tls *libc.TLS, p uintptr, iPage int32, pgsz int32) { /* test_vfs.c:877:13: */
if *(*uintptr)(unsafe.Pointer((p + 16 /* &.aPage */) + uintptr(iPage)*8)) == uintptr(0) {
*(*uintptr)(unsafe.Pointer((p + 16 /* &.aPage */) + uintptr(iPage)*8)) = tcl.XTcl_Alloc(tls, uint32(pgsz))
- crt.Xmemset(tls, *(*uintptr)(unsafe.Pointer((p + 16 /* &.aPage */) + uintptr(iPage)*8)), 0, uint64(pgsz))
+ libc.Xmemset(tls, *(*uintptr)(unsafe.Pointer((p + 16 /* &.aPage */) + uintptr(iPage)*8)), 0, uint64(pgsz))
(*TestvfsBuffer)(unsafe.Pointer(p)).Fpgsz = pgsz
}
}
-func tvfsShmMap(tls *crt.TLS, pFile uintptr, iPage int32, pgsz int32, isWrite int32, pp uintptr) int32 { /* test_vfs.c:886:12: */
+func tvfsShmMap(tls *libc.TLS, pFile uintptr, iPage int32, pgsz int32, isWrite int32, pp uintptr) int32 { /* test_vfs.c:886:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70717,12 +76030,12 @@ func tvfsShmMap(tls *crt.TLS, pFile uintptr, iPage int32, pgsz int32, isWrite in
tcl.XTcl_ListObjAppendElement(tls, (*Testvfs)(unsafe.Pointer(p)).Finterp, pArg, tcl.XTcl_NewIntObj(tls, iPage))
tcl.XTcl_ListObjAppendElement(tls, (*Testvfs)(unsafe.Pointer(p)).Finterp, pArg, tcl.XTcl_NewIntObj(tls, pgsz))
tcl.XTcl_ListObjAppendElement(tls, (*Testvfs)(unsafe.Pointer(p)).Finterp, pArg, tcl.XTcl_NewIntObj(tls, isWrite))
- tvfsExecTcl(tls, p, ts+32536, /* "xShmMap" */
+ tvfsExecTcl(tls, p, ts+34601, /* "xShmMap" */
tcl.XTcl_NewStringObj(tls, (*TestvfsBuffer)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpShm)).FzFile, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, pArg, uintptr(0))
tvfsResultCode(tls, p, bp /* &rc */)
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = pArg
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -70741,7 +76054,7 @@ func tvfsShmMap(tls *crt.TLS, pFile uintptr, iPage int32, pgsz int32, isWrite in
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
-func tvfsShmLock(tls *crt.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* test_vfs.c:935:12: */
+func tvfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* test_vfs.c:935:12: */
bp := tls.Alloc(100)
defer tls.Free(100)
@@ -70756,20 +76069,20 @@ func tvfsShmLock(tls *crt.TLS, pFile uintptr, ofst int32, n int32, flags int32)
}
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00000010) != 0) {
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([80]int8{})), bp+16 /* &zLock[0] */, ts+15440 /* "%d %d" */, crt.VaList(bp, ofst, n))
- nLock = int32(crt.Xstrlen(tls, bp+16 /* &zLock[0] */))
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([80]int8{})), bp+16 /* &zLock[0] */, ts+17132 /* "%d %d" */, libc.VaList(bp, ofst, n))
+ nLock = int32(libc.Xstrlen(tls, bp+16 /* &zLock[0] */))
if (flags & 2) != 0 {
- crt.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+35505 /* " lock" */)
+ libc.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+37586 /* " lock" */)
} else {
- crt.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+35511 /* " unlock" */)
+ libc.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+37592 /* " unlock" */)
}
- nLock = nLock + (int32(crt.Xstrlen(tls, (bp + 16 /* &zLock */ + uintptr(nLock)))))
+ nLock = nLock + (int32(libc.Xstrlen(tls, (bp + 16 /* &zLock */ + uintptr(nLock)))))
if (flags & 4) != 0 {
- crt.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+35519 /* " shared" */)
+ libc.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+37600 /* " shared" */)
} else {
- crt.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+35527 /* " exclusive" */)
+ libc.Xstrcpy(tls, (bp + 16 /* &zLock */ + uintptr(nLock)), ts+37608 /* " exclusive" */)
}
- tvfsExecTcl(tls, p, ts+32515, /* "xShmLock" */
+ tvfsExecTcl(tls, p, ts+34580, /* "xShmLock" */
tcl.XTcl_NewStringObj(tls, (*TestvfsBuffer)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpShm)).FzFile, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId,
tcl.XTcl_NewStringObj(tls, bp+16 /* &zLock[0] */, -1), uintptr(0))
tvfsResultCode(tls, p, bp+96 /* &rc */)
@@ -70782,7 +76095,7 @@ func tvfsShmLock(tls *crt.TLS, pFile uintptr, ofst int32, n int32, flags int32)
if *(*int32)(unsafe.Pointer(bp + 96 /* rc */)) == 0 {
var isLock int32 = (flags & 2)
var isExcl int32 = (flags & 8)
- var mask u321 = (u321(((int32(1) << n) - 1) << ofst))
+ var mask u322 = (u322(((int32(1) << n) - 1) << ofst))
if isLock != 0 {
var p2 uintptr
for p2 = (*TestvfsBuffer)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpShm)).FpFile; p2 != 0; p2 = (*TestvfsFd)(unsafe.Pointer(p2)).FpNext {
@@ -70796,18 +76109,18 @@ func tvfsShmLock(tls *crt.TLS, pFile uintptr, ofst int32, n int32, flags int32)
}
if *(*int32)(unsafe.Pointer(bp + 96 /* rc */)) == 0 {
if isExcl != 0 {
- *(*u321)(unsafe.Pointer(pFd + 40 /* &.excllock */)) |= (mask)
+ *(*u322)(unsafe.Pointer(pFd + 40 /* &.excllock */)) |= (mask)
}
if !(isExcl != 0) {
- *(*u321)(unsafe.Pointer(pFd + 44 /* &.sharedlock */)) |= (mask)
+ *(*u322)(unsafe.Pointer(pFd + 44 /* &.sharedlock */)) |= (mask)
}
}
} else {
if isExcl != 0 {
- *(*u321)(unsafe.Pointer(pFd + 40 /* &.excllock */)) &= (^mask)
+ *(*u322)(unsafe.Pointer(pFd + 40 /* &.excllock */)) &= (^mask)
}
if !(isExcl != 0) {
- *(*u321)(unsafe.Pointer(pFd + 44 /* &.sharedlock */)) &= (^mask)
+ *(*u322)(unsafe.Pointer(pFd + 44 /* &.sharedlock */)) &= (^mask)
}
}
}
@@ -70815,7 +76128,7 @@ func tvfsShmLock(tls *crt.TLS, pFile uintptr, ofst int32, n int32, flags int32)
return *(*int32)(unsafe.Pointer(bp + 96 /* rc */))
}
-func tvfsShmBarrier(tls *crt.TLS, pFile uintptr) { /* test_vfs.c:1002:13: */
+func tvfsShmBarrier(tls *libc.TLS, pFile uintptr) { /* test_vfs.c:1002:13: */
var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd
var p uintptr = (*sqlite3_vfs)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpVfs)).FpAppData
@@ -70826,7 +76139,7 @@ func tvfsShmBarrier(tls *crt.TLS, pFile uintptr) { /* test_vfs.c:1002:13: */
} else {
z = ts + 488 /* "" */
}
- tvfsExecTcl(tls, p, ts+32524 /* "xShmBarrier" */, tcl.XTcl_NewStringObj(tls, z, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, uintptr(0), uintptr(0))
+ tvfsExecTcl(tls, p, ts+34589 /* "xShmBarrier" */, tcl.XTcl_NewStringObj(tls, z, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, uintptr(0), uintptr(0))
}
if (*Testvfs)(unsafe.Pointer(p)).FisFullshm != 0 {
@@ -70835,7 +76148,7 @@ func tvfsShmBarrier(tls *crt.TLS, pFile uintptr) { /* test_vfs.c:1002:13: */
}
}
-func tvfsShmUnmap(tls *crt.TLS, pFile uintptr, deleteFlag int32) int32 { /* test_vfs.c:1017:12: */
+func tvfsShmUnmap(tls *libc.TLS, pFile uintptr, deleteFlag int32) int32 { /* test_vfs.c:1017:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70854,7 +76167,7 @@ func tvfsShmUnmap(tls *crt.TLS, pFile uintptr, deleteFlag int32) int32 { /* test
}
if ((*Testvfs)(unsafe.Pointer(p)).FpScript != 0) && (((*Testvfs)(unsafe.Pointer(p)).Fmask & 0x00000080) != 0) {
- tvfsExecTcl(tls, p, ts+32505, /* "xShmUnmap" */
+ tvfsExecTcl(tls, p, ts+34570, /* "xShmUnmap" */
tcl.XTcl_NewStringObj(tls, (*TestvfsBuffer)(unsafe.Pointer((*TestvfsFd)(unsafe.Pointer(pFd)).FpShm)).FzFile, -1), (*TestvfsFd)(unsafe.Pointer(pFd)).FpShmId, uintptr(0), uintptr(0))
tvfsResultCode(tls, p, bp /* &rc */)
}
@@ -70881,31 +76194,31 @@ func tvfsShmUnmap(tls *crt.TLS, pFile uintptr, deleteFlag int32) int32 { /* test
return *(*int32)(unsafe.Pointer(bp /* rc */))
}
-func tvfsFetch(tls *crt.TLS, pFile uintptr, iOfst sqlite3_int64, iAmt int32, pp uintptr) int32 { /* test_vfs.c:1061:12: */
+func tvfsFetch(tls *libc.TLS, pFile uintptr, iOfst sqlite3_int64, iAmt int32, pp uintptr) int32 { /* test_vfs.c:1061:12: */
var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd
return sqlite3.Xsqlite3OsFetch(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal, iOfst, iAmt, pp)
}
-func tvfsUnfetch(tls *crt.TLS, pFile uintptr, iOfst sqlite3_int64, p uintptr) int32 { /* test_vfs.c:1071:12: */
+func tvfsUnfetch(tls *libc.TLS, pFile uintptr, iOfst sqlite3_int64, p uintptr) int32 { /* test_vfs.c:1071:12: */
var pFd uintptr = (*TestvfsFile)(unsafe.Pointer(pFile)).FpFd
return sqlite3.Xsqlite3OsUnfetch(tls, (*TestvfsFd)(unsafe.Pointer(pFd)).FpReal, iOfst, p)
}
-func testvfs_obj_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1076:26: */
+func testvfs_obj_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1076:26: */
bp := tls.Alloc(568)
defer tls.Free(568)
var p uintptr = cd
*(*[10]TestvfsSubcmd)(unsafe.Pointer(bp + 96 /* aSubcmd */)) = [10]TestvfsSubcmd{
- {FzName: ts + 35538 /* "shm" */, FeCmd: uint32(0) /* CMD_SHM */},
- {FzName: ts + 35542 /* "delete" */, FeCmd: uint32(1) /* CMD_DELETE */},
- {FzName: ts + 35549 /* "filter" */, FeCmd: uint32(2) /* CMD_FILTER */},
- {FzName: ts + 35556 /* "ioerr" */, FeCmd: uint32(3) /* CMD_IOERR */},
- {FzName: ts + 35562 /* "fullerr" */, FeCmd: uint32(7) /* CMD_FULLERR */},
- {FzName: ts + 35570 /* "cantopenerr" */, FeCmd: uint32(8) /* CMD_CANTOPENERR */},
- {FzName: ts + 35582 /* "script" */, FeCmd: uint32(4) /* CMD_SCRIPT */},
- {FzName: ts + 35589 /* "devchar" */, FeCmd: uint32(5) /* CMD_DEVCHAR */},
- {FzName: ts + 35597 /* "sectorsize" */, FeCmd: uint32(6) /* CMD_SECTORSIZE */},
+ {FzName: ts + 37619 /* "shm" */, FeCmd: uint32(0) /* CMD_SHM */},
+ {FzName: ts + 37623 /* "delete" */, FeCmd: uint32(1) /* CMD_DELETE */},
+ {FzName: ts + 37630 /* "filter" */, FeCmd: uint32(2) /* CMD_FILTER */},
+ {FzName: ts + 37637 /* "ioerr" */, FeCmd: uint32(3) /* CMD_IOERR */},
+ {FzName: ts + 37643 /* "fullerr" */, FeCmd: uint32(7) /* CMD_FULLERR */},
+ {FzName: ts + 37651 /* "cantopenerr" */, FeCmd: uint32(8) /* CMD_CANTOPENERR */},
+ {FzName: ts + 37663 /* "script" */, FeCmd: uint32(4) /* CMD_SCRIPT */},
+ {FzName: ts + 37670 /* "devchar" */, FeCmd: uint32(5) /* CMD_DEVCHAR */},
+ {FzName: ts + 37678 /* "sectorsize" */, FeCmd: uint32(6) /* CMD_SECTORSIZE */},
{FzName: uintptr(0), FeCmd: uint32(0)},
}
// var i int32 at bp+256, 4
@@ -70915,7 +76228,7 @@ func testvfs_obj_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, ob
return 1
}
if tcl.XTcl_GetIndexFromObjStruct(tls,
- interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+96 /* &aSubcmd[0] */, int32(unsafe.Sizeof(TestvfsSubcmd{})), ts+35608 /* "subcommand" */, 0, bp+256 /* &i */) != 0 {
+ interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)), bp+96 /* &aSubcmd[0] */, int32(unsafe.Sizeof(TestvfsSubcmd{})), ts+37689 /* "subcommand" */, 0, bp+256 /* &i */) != 0 {
return 1
}
tcl.XTcl_ResetResult(tls, interp)
@@ -70928,27 +76241,27 @@ func testvfs_obj_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, ob
var pBuffer uintptr
var zName uintptr
if (objc != 3) && (objc != 4) {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+35619 /* "FILE ?VALUE?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+37700 /* "FILE ?VALUE?" */)
return 1
}
zName = tcl.XTcl_Alloc(tls, uint32((*sqlite3_vfs)(unsafe.Pointer((*Testvfs)(unsafe.Pointer(p)).FpParent)).FmxPathname))
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Testvfs)(unsafe.Pointer(p)).FpParent + 64 /* &.xFullPathname */))))(tls,
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Testvfs)(unsafe.Pointer(p)).FpParent + 64 /* &.xFullPathname */))))(tls,
(*Testvfs)(unsafe.Pointer(p)).FpParent, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))),
(*sqlite3_vfs)(unsafe.Pointer((*Testvfs)(unsafe.Pointer(p)).FpParent)).FmxPathname, zName)
if rc != 0 {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+35632, /* "failed to get fu..." */
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+37713, /* "failed to get fu..." */
tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), 0))
tcl.XTcl_Free(tls, zName)
return 1
}
for pBuffer = (*Testvfs)(unsafe.Pointer(p)).FpBuffer; pBuffer != 0; pBuffer = (*TestvfsBuffer)(unsafe.Pointer(pBuffer)).FpNext {
- if 0 == crt.Xstrcmp(tls, (*TestvfsBuffer)(unsafe.Pointer(pBuffer)).FzFile, zName) {
+ if 0 == libc.Xstrcmp(tls, (*TestvfsBuffer)(unsafe.Pointer(pBuffer)).FzFile, zName) {
break
}
}
tcl.XTcl_Free(tls, zName)
if !(pBuffer != 0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+24, ts+35658 /* "no such file: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+24, ts+37739 /* "no such file: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), 0))
return 1
}
if objc == 4 {
@@ -70965,7 +76278,7 @@ func testvfs_obj_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, ob
if (*(*int32)(unsafe.Pointer(bp + 260 /* n */)) - (*(*int32)(unsafe.Pointer(bp + 256 /* i */)) * pgsz)) < pgsz {
nByte = *(*int32)(unsafe.Pointer(bp + 260 /* n */))
}
- crt.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((pBuffer + 16 /* &.aPage */) + uintptr(*(*int32)(unsafe.Pointer(bp + 256 /* i */)))*8)), (a + uintptr((*(*int32)(unsafe.Pointer(bp + 256 /* i */)) * pgsz))), uint64(nByte))
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((pBuffer + 16 /* &.aPage */) + uintptr(*(*int32)(unsafe.Pointer(bp + 256 /* i */)))*8)), (a + uintptr((*(*int32)(unsafe.Pointer(bp + 256 /* i */)) * pgsz))), uint64(nByte))
}
}
@@ -70990,7 +76303,7 @@ func testvfs_obj_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, ob
*(*int32)(unsafe.Pointer(bp + 264 /* nElem */)) = 0
var mask int32 = 0
if objc != 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+29236 /* "LIST" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+31328 /* "LIST" */)
return 1
}
if tcl.XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)), bp+264 /* &nElem */, bp+272 /* &apElem */) != 0 {
@@ -71001,13 +76314,13 @@ func testvfs_obj_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, ob
var iMethod int32
var zElem uintptr = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272 /* apElem */)) + uintptr(*(*int32)(unsafe.Pointer(bp + 256 /* i */)))*8)))
for iMethod = 0; iMethod < (int32(uint64(unsafe.Sizeof(vfsmethod)) / uint64(unsafe.Sizeof(VfsMethod{})))); iMethod++ {
- if crt.Xstrcmp(tls, zElem, vfsmethod[iMethod].FzName) == 0 {
+ if libc.Xstrcmp(tls, zElem, vfsmethod[iMethod].FzName) == 0 {
mask = mask | (vfsmethod[iMethod].Fmask)
break
}
}
if iMethod == (int32(uint64(unsafe.Sizeof(vfsmethod)) / uint64(unsafe.Sizeof(VfsMethod{})))) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+48, ts+35673 /* "unknown method: " */, zElem, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+48, ts+37754 /* "unknown method: " */, zElem, 0))
return 1
}
}
@@ -71027,7 +76340,7 @@ func testvfs_obj_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, ob
if (*Testvfs)(unsafe.Pointer(p)).FpScript != 0 {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*Testvfs)(unsafe.Pointer(p)).FpScript
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -71039,7 +76352,7 @@ func testvfs_obj_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, ob
(*Tcl_Obj)(unsafe.Pointer((*Testvfs)(unsafe.Pointer(p)).FpScript)).FrefCount++
}
} else if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+11110 /* "?SCRIPT?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+12760 /* "?SCRIPT?" */)
return 1
}
@@ -71097,7 +76410,7 @@ func testvfs_obj_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, ob
}()
(*TestFaultInject)(unsafe.Pointer(pTest)).FiCnt = *(*int32)(unsafe.Pointer(bp + 284 /* iCnt */))
} else if objc != 2 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+35690 /* "?CNT PERSIST?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+37771 /* "?CNT PERSIST?" */)
return 1
}
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, iRet))
@@ -71113,28 +76426,28 @@ func testvfs_obj_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, ob
case uint32(5) /* CMD_DEVCHAR */ :
{
*(*[16]DeviceFlag)(unsafe.Pointer(bp + 304 /* aFlag */)) = [16]DeviceFlag{
- {FzName: ts + 35704 /* "default" */, FiValue: -1},
- {FzName: ts + 23282 /* "atomic" */, FiValue: 0x00000001},
- {FzName: ts + 23289 /* "atomic512" */, FiValue: 0x00000002},
- {FzName: ts + 23299 /* "atomic1k" */, FiValue: 0x00000004},
- {FzName: ts + 23308 /* "atomic2k" */, FiValue: 0x00000008},
- {FzName: ts + 23317 /* "atomic4k" */, FiValue: 0x00000010},
- {FzName: ts + 23326 /* "atomic8k" */, FiValue: 0x00000020},
- {FzName: ts + 23335 /* "atomic16k" */, FiValue: 0x00000040},
- {FzName: ts + 23345 /* "atomic32k" */, FiValue: 0x00000080},
- {FzName: ts + 23355 /* "atomic64k" */, FiValue: 0x00000100},
- {FzName: ts + 23365 /* "sequential" */, FiValue: 0x00000400},
- {FzName: ts + 23376 /* "safe_append" */, FiValue: 0x00000200},
- {FzName: ts + 35712 /* "undeletable_when..." */, FiValue: 0x00000800},
- {FzName: ts + 23388 /* "powersafe_overwr..." */, FiValue: 0x00001000},
- {FzName: ts + 35734 /* "immutable" */, FiValue: 0x00002000},
+ {FzName: ts + 37785 /* "default" */, FiValue: -1},
+ {FzName: ts + 25381 /* "atomic" */, FiValue: 0x00000001},
+ {FzName: ts + 25388 /* "atomic512" */, FiValue: 0x00000002},
+ {FzName: ts + 25398 /* "atomic1k" */, FiValue: 0x00000004},
+ {FzName: ts + 25407 /* "atomic2k" */, FiValue: 0x00000008},
+ {FzName: ts + 25416 /* "atomic4k" */, FiValue: 0x00000010},
+ {FzName: ts + 25425 /* "atomic8k" */, FiValue: 0x00000020},
+ {FzName: ts + 25434 /* "atomic16k" */, FiValue: 0x00000040},
+ {FzName: ts + 25444 /* "atomic32k" */, FiValue: 0x00000080},
+ {FzName: ts + 25454 /* "atomic64k" */, FiValue: 0x00000100},
+ {FzName: ts + 25464 /* "sequential" */, FiValue: 0x00000400},
+ {FzName: ts + 25475 /* "safe_append" */, FiValue: 0x00000200},
+ {FzName: ts + 37793 /* "undeletable_when..." */, FiValue: 0x00000800},
+ {FzName: ts + 25487 /* "powersafe_overwr..." */, FiValue: 0x00001000},
+ {FzName: ts + 37815 /* "immutable" */, FiValue: 0x00002000},
{FzName: uintptr(0), FiValue: 0},
}
var pRet uintptr
var iFlag int32
if objc > 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+35744 /* "?ATTR-LIST?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+37825 /* "?ATTR-LIST?" */)
return 1
}
if objc == 3 {
@@ -71150,11 +76463,11 @@ func testvfs_obj_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, ob
for j = 0; j < *(*int32)(unsafe.Pointer(bp + 292 /* nFlags */)); j++ {
*(*int32)(unsafe.Pointer(bp + 560 /* idx */)) = 0
if tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 296 /* flags */)) + uintptr(j)*8)), bp+304, /* &aFlag[0] */
- int32(unsafe.Sizeof(DeviceFlag{})), ts+15142 /* "flag" */, 0, bp+560 /* &idx */) != 0 {
+ int32(unsafe.Sizeof(DeviceFlag{})), ts+16852 /* "flag" */, 0, bp+560 /* &idx */) != 0 {
return 1
}
if ((*DeviceFlag)(unsafe.Pointer(bp+304 /* &aFlag */ +uintptr(*(*int32)(unsafe.Pointer(bp + 560 /* idx */)))*16)).FiValue < 0) && (*(*int32)(unsafe.Pointer(bp + 292 /* nFlags */)) > 1) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp+72, ts+35756 /* "bad flags: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp+72, ts+37837 /* "bad flags: " */, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8))), 0))
return 1
}
iNew = iNew | ((*DeviceFlag)(unsafe.Pointer(bp + 304 /* &aFlag */ + uintptr(*(*int32)(unsafe.Pointer(bp + 560 /* idx */)))*16)).FiValue)
@@ -71178,7 +76491,7 @@ func testvfs_obj_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, ob
case uint32(6) /* CMD_SECTORSIZE */ :
{
if objc > 3 {
- tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+35768 /* "?VALUE?" */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 2, objv, ts+37849 /* "?VALUE?" */)
return 1
}
if objc == 3 {
@@ -71209,40 +76522,40 @@ type VfsMethod = struct {
}
var vfsmethod = [18]VfsMethod{
- {FzName: ts + 35496 /* "xShmOpen" */, Fmask: 0x00000001},
- {FzName: ts + 32515 /* "xShmLock" */, Fmask: 0x00000010},
- {FzName: ts + 32524 /* "xShmBarrier" */, Fmask: 0x00000040},
- {FzName: ts + 32505 /* "xShmUnmap" */, Fmask: 0x00000080},
- {FzName: ts + 32536 /* "xShmMap" */, Fmask: 0x00000020},
- {FzName: ts + 24735 /* "xSync" */, Fmask: 0x00000200},
- {FzName: ts + 32443 /* "xDelete" */, Fmask: 0x00000400},
- {FzName: ts + 32351 /* "xWrite" */, Fmask: 0x00001000},
- {FzName: ts + 32345 /* "xRead" */, Fmask: 0x00010000},
- {FzName: ts + 32358 /* "xTruncate" */, Fmask: 0x00002000},
- {FzName: ts + 24300 /* "xOpen" */, Fmask: 0x00000100},
- {FzName: ts + 32338 /* "xClose" */, Fmask: 0x00000800},
- {FzName: ts + 32451 /* "xAccess" */, Fmask: 0x00004000},
- {FzName: ts + 32459 /* "xFullPathname" */, Fmask: 0x00008000},
- {FzName: ts + 32384 /* "xUnlock" */, Fmask: 0x00020000},
- {FzName: ts + 32378 /* "xLock" */, Fmask: 0x00040000},
- {FzName: ts + 35362 /* "xCheckReservedLo..." */, Fmask: 0x00080000},
- {FzName: ts + 32406 /* "xFileControl" */, Fmask: 0x00100000},
+ {FzName: ts + 37577 /* "xShmOpen" */, Fmask: 0x00000001},
+ {FzName: ts + 34580 /* "xShmLock" */, Fmask: 0x00000010},
+ {FzName: ts + 34589 /* "xShmBarrier" */, Fmask: 0x00000040},
+ {FzName: ts + 34570 /* "xShmUnmap" */, Fmask: 0x00000080},
+ {FzName: ts + 34601 /* "xShmMap" */, Fmask: 0x00000020},
+ {FzName: ts + 26827 /* "xSync" */, Fmask: 0x00000200},
+ {FzName: ts + 34508 /* "xDelete" */, Fmask: 0x00000400},
+ {FzName: ts + 34416 /* "xWrite" */, Fmask: 0x00001000},
+ {FzName: ts + 34410 /* "xRead" */, Fmask: 0x00010000},
+ {FzName: ts + 34423 /* "xTruncate" */, Fmask: 0x00002000},
+ {FzName: ts + 26399 /* "xOpen" */, Fmask: 0x00000100},
+ {FzName: ts + 34403 /* "xClose" */, Fmask: 0x00000800},
+ {FzName: ts + 34516 /* "xAccess" */, Fmask: 0x00004000},
+ {FzName: ts + 34524 /* "xFullPathname" */, Fmask: 0x00008000},
+ {FzName: ts + 34449 /* "xUnlock" */, Fmask: 0x00020000},
+ {FzName: ts + 34443 /* "xLock" */, Fmask: 0x00040000},
+ {FzName: ts + 37443 /* "xCheckReservedLo..." */, Fmask: 0x00080000},
+ {FzName: ts + 34471 /* "xFileControl" */, Fmask: 0x00100000},
} /* test_vfs.c:1178:9 */
-func testvfs_obj_del(tls *crt.TLS, cd ClientData) { /* test_vfs.c:1389:27: */
+func testvfs_obj_del(tls *libc.TLS, cd ClientData) { /* test_vfs.c:1389:27: */
var p uintptr = cd
if (*Testvfs)(unsafe.Pointer(p)).FpScript != 0 {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*Testvfs)(unsafe.Pointer(p)).FpScript
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
}
sqlite3.Xsqlite3_vfs_unregister(tls, (*Testvfs)(unsafe.Pointer(p)).FpVfs)
- crt.Xmemset(tls, (*Testvfs)(unsafe.Pointer(p)).FpVfs, 0, uint64(unsafe.Sizeof(sqlite3_vfs{})))
+ libc.Xmemset(tls, (*Testvfs)(unsafe.Pointer(p)).FpVfs, 0, uint64(unsafe.Sizeof(sqlite3_vfs{})))
tcl.XTcl_Free(tls, (*Testvfs)(unsafe.Pointer(p)).FpVfs)
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Testvfs{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Testvfs{})))
tcl.XTcl_Free(tls, p)
}
@@ -71279,7 +76592,7 @@ func testvfs_obj_del(tls *crt.TLS, cd ClientData) { /* test_vfs.c:1389:27: */
// SCRIPT xShmLock FILENAME ID LOCK
//
// where LOCK is of the form "OFFSET NBYTE lock/unlock shared/exclusive"
-func testvfs_cmd(tls *crt.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1434:26: */
+func testvfs_cmd(tls *libc.TLS, cd ClientData, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1434:26: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -71324,7 +76637,7 @@ __2:
}
zSwitch = tcl.XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp /* &nSwitch */)
- if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == crt.Xstrncmp(tls, ts+35776 /* "-noshm" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {
+ if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+37857 /* "-noshm" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {
goto __5
}
if !(tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+4 /* &isNoshm */) != 0) {
@@ -71341,7 +76654,7 @@ __8:
;
goto __6
__5:
- if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == crt.Xstrncmp(tls, ts+23658 /* "-default" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {
+ if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+25757 /* "-default" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {
goto __9
}
if !(tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+8 /* &isDefault */) != 0) {
@@ -71352,7 +76665,7 @@ __11:
;
goto __10
__9:
- if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == crt.Xstrncmp(tls, ts+35783 /* "-szosfile" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {
+ if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+37864 /* "-szosfile" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {
goto __12
}
if !(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+12 /* &szOsFile */) != 0) {
@@ -71363,7 +76676,7 @@ __14:
;
goto __13
__12:
- if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == crt.Xstrncmp(tls, ts+35793 /* "-mxpathname" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {
+ if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+37874 /* "-mxpathname" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {
goto __15
}
if !(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+16 /* &mxPathname */) != 0) {
@@ -71374,7 +76687,7 @@ __17:
;
goto __16
__15:
- if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == crt.Xstrncmp(tls, ts+35805 /* "-iversion" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {
+ if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+37886 /* "-iversion" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {
goto __18
}
if !(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+20 /* &iVersion */) != 0) {
@@ -71385,7 +76698,7 @@ __20:
;
goto __19
__18:
- if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == crt.Xstrncmp(tls, ts+35815 /* "-fullshm" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {
+ if !((*(*int32)(unsafe.Pointer(bp /* nSwitch */)) > 2) && (0 == libc.Xstrncmp(tls, ts+37896 /* "-fullshm" */, zSwitch, uint64(*(*int32)(unsafe.Pointer(bp /* nSwitch */)))))) {
goto __21
}
if !(tcl.XTcl_GetBooleanFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr((i+1))*8)), bp+24 /* &isFullshm */) != 0) {
@@ -71431,9 +76744,9 @@ __25:
;
zVfs = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8)))
- nByte = (int32((uint64(unsafe.Sizeof(Testvfs{})) + uint64(int32(crt.Xstrlen(tls, zVfs)))) + uint64(1)))
+ nByte = (int32((uint64(unsafe.Sizeof(Testvfs{})) + uint64(int32(libc.Xstrlen(tls, zVfs)))) + uint64(1)))
p = tcl.XTcl_Alloc(tls, uint32(nByte))
- crt.Xmemset(tls, p, 0, uint64(nByte))
+ libc.Xmemset(tls, p, 0, uint64(nByte))
(*Testvfs)(unsafe.Pointer(p)).FiDevchar = -1
(*Testvfs)(unsafe.Pointer(p)).FiSectorsize = -1
@@ -71443,16 +76756,16 @@ __25:
// is currently the default, the new [testvfs] may end up calling the
// methods of a deleted object.
tcl.XTcl_CreateObjCommand(tls, interp, zVfs, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
- }{testvfs_obj_cmd})), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, ClientData) }{testvfs_obj_del})))
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
+ }{testvfs_obj_cmd})), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, ClientData) }{testvfs_obj_del})))
(*Testvfs)(unsafe.Pointer(p)).FpParent = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
(*Testvfs)(unsafe.Pointer(p)).Finterp = interp
(*Testvfs)(unsafe.Pointer(p)).FzName = (p + uintptr(1)*104)
- crt.Xmemcpy(tls, (*Testvfs)(unsafe.Pointer(p)).FzName, zVfs, (crt.Xstrlen(tls, zVfs) + uint64(1)))
+ libc.Xmemcpy(tls, (*Testvfs)(unsafe.Pointer(p)).FzName, zVfs, (libc.Xstrlen(tls, zVfs) + uint64(1)))
pVfs = tcl.XTcl_Alloc(tls, uint32(unsafe.Sizeof(sqlite3_vfs{})))
- crt.Xmemcpy(tls, pVfs, uintptr(unsafe.Pointer(&tvfs_vfs)), uint64(unsafe.Sizeof(sqlite3_vfs{})))
+ libc.Xmemcpy(tls, pVfs, uintptr(unsafe.Pointer(&tvfs_vfs)), uint64(unsafe.Sizeof(sqlite3_vfs{})))
(*sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData = p
(*sqlite3_vfs)(unsafe.Pointer(pVfs)).FiVersion = *(*int32)(unsafe.Pointer(bp + 20 /* iVersion */))
(*sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName = (*Testvfs)(unsafe.Pointer(p)).FzName
@@ -71474,7 +76787,7 @@ __26:
return 0
bad_args:
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+35824 /* "VFSNAME ?-noshm ..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+37905 /* "VFSNAME ?-noshm ..." */)
return 1
}
@@ -71503,12 +76816,12 @@ uintptr(0), // xNextSystemCall
} /* test_vfs.c:1440:22 */
// tclcmd: vfs_shmlock DB DBNAME (shared|exclusive) (lock|unlock) OFFSET N
-func test_vfs_shmlock(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1582:26: */
+func test_vfs_shmlock(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1582:26: */
bp := tls.Alloc(88)
defer tls.Free(88)
- *(*[3]uintptr)(unsafe.Pointer(bp + 8 /* azArg1 */)) = [3]uintptr{ts + 35928 /* "shared" */, ts + 11849 /* "exclusive" */, uintptr(0)}
- *(*[3]uintptr)(unsafe.Pointer(bp + 40 /* azArg2 */)) = [3]uintptr{ts + 35935 /* "lock" */, ts + 35940 /* "unlock" */, uintptr(0)}
+ *(*[3]uintptr)(unsafe.Pointer(bp + 8 /* azArg1 */)) = [3]uintptr{ts + 38009 /* "shared" */, ts + 13480 /* "exclusive" */, uintptr(0)}
+ *(*[3]uintptr)(unsafe.Pointer(bp + 40 /* azArg2 */)) = [3]uintptr{ts + 38016 /* "lock" */, ts + 38021 /* "unlock" */, uintptr(0)}
*(*uintptr)(unsafe.Pointer(bp /* db */)) = uintptr(0)
var rc int32 = 0
var zDbname uintptr = uintptr(0)
@@ -71520,14 +76833,14 @@ func test_vfs_shmlock(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
if objc != 7 {
tcl.XTcl_WrongNumArgs(tls, interp, 1, objv,
- ts+35947 /* "DB DBNAME (share..." */)
+ ts+38028 /* "DB DBNAME (share..." */)
return 1
}
zDbname = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
if ((((getDbPointer(tls, interp, tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(1)*8))), bp /* &db */) != 0) ||
- (tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), bp+8 /* &azArg1[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+35999 /* "ARG" */, 0, bp+32 /* &iArg1 */) != 0)) ||
- (tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(4)*8)), bp+40 /* &azArg2[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+35999 /* "ARG" */, 0, bp+64 /* &iArg2 */) != 0)) ||
+ (tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)), bp+8 /* &azArg1[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+38080 /* "ARG" */, 0, bp+32 /* &iArg1 */) != 0)) ||
+ (tcl.XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(4)*8)), bp+40 /* &azArg2[0] */, int32(unsafe.Sizeof(uintptr(0))), ts+38080 /* "ARG" */, 0, bp+64 /* &iArg2 */) != 0)) ||
(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(5)*8)), bp+68 /* &iOffset */) != 0)) ||
(tcl.XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(6)*8)), bp+72 /* &n */) != 0) {
return 1
@@ -71537,7 +76850,7 @@ func test_vfs_shmlock(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
if *(*uintptr)(unsafe.Pointer(bp + 80 /* pFd */)) == uintptr(0) {
return 1
}
- rc = (*(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* pFd */)))).FpMethods + 112 /* &.xShmLock */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pFd */)), *(*int32)(unsafe.Pointer(bp + 68 /* iOffset */)), *(*int32)(unsafe.Pointer(bp + 72 /* n */)),
+ rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* pFd */)))).FpMethods + 112 /* &.xShmLock */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 80 /* pFd */)), *(*int32)(unsafe.Pointer(bp + 68 /* iOffset */)), *(*int32)(unsafe.Pointer(bp + 72 /* n */)),
((func() int32 {
if *(*int32)(unsafe.Pointer(bp + 32 /* iArg1 */)) == 0 {
return 4
@@ -71554,7 +76867,7 @@ func test_vfs_shmlock(tls *crt.TLS, clientData uintptr, interp uintptr, objc int
return 0
}
-func test_vfs_set_readmark(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1628:26: */
+func test_vfs_set_readmark(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_vfs.c:1628:26: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -71570,7 +76883,7 @@ func test_vfs_set_readmark(tls *crt.TLS, clientData uintptr, interp uintptr, obj
var iOff int32
if (objc != 4) && (objc != 5) {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+36003 /* "DB DBNAME SLOT ?..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+38084 /* "DB DBNAME SLOT ?..." */)
return 1
}
@@ -71585,39 +76898,52 @@ func test_vfs_set_readmark(tls *crt.TLS, clientData uintptr, interp uintptr, obj
if *(*uintptr)(unsafe.Pointer(bp + 32 /* pFd */)) == uintptr(0) {
return 1
}
- rc = (*(*func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pFd */)))).FpMethods + 104 /* &.xShmMap */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pFd */)), 0, (32 * 1024), 0, bp+40 /* &pShm */)
+ rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*sqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32 /* pFd */)))).FpMethods + 104 /* &.xShmMap */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pFd */)), 0, (32 * 1024), 0, bp+40 /* &pShm */)
if rc != 0 {
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
return 1
}
if *(*uintptr)(unsafe.Pointer(bp + 40 /* pShm */)) == uintptr(0) {
- tcl.XTcl_AppendResult(tls, interp, crt.VaList(bp, ts+36026 /* "*-shm is not yet..." */, 0))
+ tcl.XTcl_AppendResult(tls, interp, libc.VaList(bp, ts+38107 /* "*-shm is not yet..." */, 0))
return 1
}
aShm = *(*uintptr)(unsafe.Pointer(bp + 40 /* pShm */))
iOff = (((12 * 2) + 1) + *(*int32)(unsafe.Pointer(bp + 24 /* iSlot */)))
if objc == 5 {
- *(*u321)(unsafe.Pointer(aShm + uintptr(iOff)*4)) = u321(*(*int32)(unsafe.Pointer(bp + 28 /* iVal */)))
+ *(*u322)(unsafe.Pointer(aShm + uintptr(iOff)*4)) = u322(*(*int32)(unsafe.Pointer(bp + 28 /* iVal */)))
}
- tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, int32(*(*u321)(unsafe.Pointer(aShm + uintptr(iOff)*4)))))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewIntObj(tls, int32(*(*u322)(unsafe.Pointer(aShm + uintptr(iOff)*4)))))
return 0
}
-func Sqlitetestvfs_Init(tls *crt.TLS, interp uintptr) int32 { /* test_vfs.c:1681:5: */
- tcl.XTcl_CreateObjCommand(tls, interp, ts+36050 /* "testvfs" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32
+func Sqlitetestvfs_Init(tls *libc.TLS, interp uintptr) int32 { /* test_vfs.c:1681:5: */
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+38131 /* "testvfs" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32
}{testvfs_cmd})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+36058 /* "vfs_shmlock" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+38139 /* "vfs_shmlock" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_vfs_shmlock})), uintptr(0), uintptr(0))
- tcl.XTcl_CreateObjCommand(tls, interp, ts+36070 /* "vfs_set_readmark" */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ tcl.XTcl_CreateObjCommand(tls, interp, ts+38151 /* "vfs_set_readmark" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_vfs_set_readmark})), uintptr(0), uintptr(0))
return 0
}
+// 2015 November 30
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+// This file contains code to implement most of the opendir() family of
+// POSIX functions on Win32 using the MSVCRT.
+
type TestWindow1 = struct {
FxStep uintptr
FxFinal uintptr
@@ -71632,7 +76958,7 @@ type TestWindowCtx1 = struct{ FpVal uintptr }
type TestWindowCtx = TestWindowCtx1 /* test_window.c:33:30 */
-func doTestWindowStep(tls *crt.TLS, bInverse int32, ctx uintptr, nArg int32, apArg uintptr) { /* test_window.c:38:13: */
+func doTestWindowStep(tls *libc.TLS, bInverse int32, ctx uintptr, nArg int32, apArg uintptr) { /* test_window.c:38:13: */
var i int32
var p uintptr = sqlite3.Xsqlite3_user_data(tls, ctx)
var pEval uintptr = tcl.XTcl_DuplicateObj(tls, func() uintptr {
@@ -71665,7 +76991,7 @@ func doTestWindowStep(tls *crt.TLS, bInverse int32, ctx uintptr, nArg int32, apA
if (*TestWindowCtx)(unsafe.Pointer(pCtx)).FpVal != 0 {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*TestWindowCtx)(unsafe.Pointer(pCtx)).FpVal
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -71676,13 +77002,13 @@ func doTestWindowStep(tls *crt.TLS, bInverse int32, ctx uintptr, nArg int32, apA
}
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = pEval
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
}
-func doTestWindowFinalize(tls *crt.TLS, bValue int32, ctx uintptr) { /* test_window.c:76:13: */
+func doTestWindowFinalize(tls *libc.TLS, bValue int32, ctx uintptr) { /* test_window.c:76:13: */
var p uintptr = sqlite3.Xsqlite3_user_data(tls, ctx)
var pEval uintptr = tcl.XTcl_DuplicateObj(tls, func() uintptr {
if bValue != 0 {
@@ -71707,14 +77033,14 @@ func doTestWindowFinalize(tls *crt.TLS, bValue int32, ctx uintptr) { /* test_win
if rc != 0 {
sqlite3.Xsqlite3_result_error(tls, ctx, zResult, -1)
} else {
- sqlite3.Xsqlite3_result_text(tls, ctx, zResult, -1, crt.UintptrFromInt32(-1))
+ sqlite3.Xsqlite3_result_text(tls, ctx, zResult, -1, libc.UintptrFromInt32(-1))
}
if bValue == 0 {
if (*TestWindowCtx)(unsafe.Pointer(pCtx)).FpVal != 0 {
for ok := true; ok; ok = 0 != 0 {
var _objPtr uintptr = (*TestWindowCtx)(unsafe.Pointer(pCtx)).FpVal
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
@@ -71724,32 +77050,32 @@ func doTestWindowFinalize(tls *crt.TLS, bValue int32, ctx uintptr) { /* test_win
}
for ok1 := true; ok1; ok1 = 0 != 0 {
var _objPtr uintptr = pEval
- if crt.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
+ if libc.PostDecInt32(&(*Tcl_Obj)(unsafe.Pointer((_objPtr))).FrefCount, 1) <= 1 {
tcl.XTclFreeObj(tls, _objPtr)
}
}
}
-func testWindowStep(tls *crt.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* test_window.c:107:13: */
+func testWindowStep(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* test_window.c:107:13: */
doTestWindowStep(tls, 0, ctx, nArg, apArg)
}
-func testWindowInverse(tls *crt.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* test_window.c:114:13: */
+func testWindowInverse(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* test_window.c:114:13: */
doTestWindowStep(tls, 1, ctx, nArg, apArg)
}
-func testWindowFinal(tls *crt.TLS, ctx uintptr) { /* test_window.c:122:13: */
+func testWindowFinal(tls *libc.TLS, ctx uintptr) { /* test_window.c:122:13: */
doTestWindowFinalize(tls, 0, ctx)
}
-func testWindowValue(tls *crt.TLS, ctx uintptr) { /* test_window.c:125:13: */
+func testWindowValue(tls *libc.TLS, ctx uintptr) { /* test_window.c:125:13: */
doTestWindowFinalize(tls, 1, ctx)
}
-func testWindowDestroy(tls *crt.TLS, pCtx uintptr) { /* test_window.c:129:13: */
+func testWindowDestroy(tls *libc.TLS, pCtx uintptr) { /* test_window.c:129:13: */
tcl.XTcl_Free(tls, pCtx)
}
// Usage: sqlite3_create_window_function DB NAME XSTEP XFINAL XVALUE XINVERSE
-func test_create_window(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_window.c:136:26: */
+func test_create_window(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_window.c:136:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -71760,7 +77086,7 @@ func test_create_window(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
var rc int32
if objc != 7 {
- tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+36087 /* "DB NAME XSTEP XF..." */)
+ tcl.XTcl_WrongNumArgs(tls, interp, 1, objv, ts+38168 /* "DB NAME XSTEP XF..." */)
return 1
}
@@ -71769,7 +77095,7 @@ func test_create_window(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
}
zName = tcl.XTcl_GetString(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(2)*8)))
pNew = tcl.XTcl_Alloc(tls, uint32(unsafe.Sizeof(TestWindow{})))
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(TestWindow{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(TestWindow{})))
(*TestWindow)(unsafe.Pointer(pNew)).FxStep = tcl.XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(3)*8)))
(*TestWindow)(unsafe.Pointer(pNew)).FxFinal = tcl.XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(4)*8)))
(*TestWindow)(unsafe.Pointer(pNew)).FxValue = tcl.XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(5)*8)))
@@ -71783,11 +77109,11 @@ func test_create_window(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), zName, -1, 1, pNew,
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{testWindowStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{testWindowFinal})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{testWindowValue})), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{testWindowStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowFinal})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowValue})), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{testWindowInverse})),
- *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{testWindowDestroy})))
+ *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowDestroy})))
if rc != 0 {
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
return 1
@@ -71796,7 +77122,7 @@ func test_create_window(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
return 0
}
-func test_create_window_misuse(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_window.c:179:26: */
+func test_create_window_misuse(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_window.c:179:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -71818,9 +77144,9 @@ __1:
__2:
;
- rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+36124 /* "fff" */, -1, 1, uintptr(0),
- uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{testWindowFinal})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{testWindowValue})), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38205 /* "fff" */, -1, 1, uintptr(0),
+ uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowFinal})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowValue})), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{testWindowInverse})),
uintptr(0))
if !(rc != 21) {
@@ -71829,11 +77155,11 @@ __2:
goto error
__3:
;
- rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+36124 /* "fff" */, -1, 1, uintptr(0),
+ rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38205 /* "fff" */, -1, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{testWindowStep})), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{testWindowValue})), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{testWindowStep})), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowValue})), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{testWindowInverse})),
uintptr(0))
if !(rc != 21) {
@@ -71842,11 +77168,11 @@ __3:
goto error
__4:
;
- rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+36124 /* "fff" */, -1, 1, uintptr(0),
+ rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38205 /* "fff" */, -1, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{testWindowStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{testWindowFinal})), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{testWindowStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowFinal})), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{testWindowInverse})),
uintptr(0))
if !(rc != 21) {
@@ -71855,10 +77181,10 @@ __4:
goto error
__5:
;
- rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+36124 /* "fff" */, -1, 1, uintptr(0),
+ rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38205 /* "fff" */, -1, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{testWindowStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{testWindowFinal})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{testWindowValue})), uintptr(0),
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{testWindowStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowFinal})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{testWindowValue})), uintptr(0),
uintptr(0))
if !(rc != 21) {
goto __6
@@ -71870,16 +77196,16 @@ __6:
return 0
error:
- tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, ts+36128 /* "misuse test erro..." */, -1))
+ tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, ts+38209 /* "misuse test erro..." */, -1))
return 1
}
// xStep for sumint().
-func sumintStep(tls *crt.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* test_window.c:225:13: */
+func sumintStep(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* test_window.c:225:13: */
var pInt uintptr
if sqlite3.Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(0)*8))) != 1 {
- sqlite3.Xsqlite3_result_error(tls, ctx, ts+36146 /* "invalid argument" */, -1)
+ sqlite3.Xsqlite3_result_error(tls, ctx, ts+38227 /* "invalid argument" */, -1)
return
}
pInt = sqlite3.Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(sqlite3_int64(0))))
@@ -71889,14 +77215,14 @@ func sumintStep(tls *crt.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* test_
}
// xInverse for sumint().
-func sumintInverse(tls *crt.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* test_window.c:246:13: */
+func sumintInverse(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* test_window.c:246:13: */
var pInt uintptr
pInt = sqlite3.Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(sqlite3_int64(0))))
*(*sqlite3_int64)(unsafe.Pointer(pInt)) -= (sqlite3.Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(0)*8))))
}
// xFinal for sumint().
-func sumintFinal(tls *crt.TLS, ctx uintptr) { /* test_window.c:259:13: */
+func sumintFinal(tls *libc.TLS, ctx uintptr) { /* test_window.c:259:13: */
var res sqlite3_int64 = int64(0)
var pInt uintptr
pInt = sqlite3.Xsqlite3_aggregate_context(tls, ctx, 0)
@@ -71907,7 +77233,7 @@ func sumintFinal(tls *crt.TLS, ctx uintptr) { /* test_window.c:259:13: */
}
// xValue for sumint().
-func sumintValue(tls *crt.TLS, ctx uintptr) { /* test_window.c:270:13: */
+func sumintValue(tls *libc.TLS, ctx uintptr) { /* test_window.c:270:13: */
var res sqlite3_int64 = int64(0)
var pInt uintptr
pInt = sqlite3.Xsqlite3_aggregate_context(tls, ctx, 0)
@@ -71917,7 +77243,7 @@ func sumintValue(tls *crt.TLS, ctx uintptr) { /* test_window.c:270:13: */
sqlite3.Xsqlite3_result_int64(tls, ctx, res)
}
-func test_create_sumint(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_window.c:278:26: */
+func test_create_sumint(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_window.c:278:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -71933,11 +77259,11 @@ func test_create_sumint(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
return 1
}
- rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+36163 /* "sumint" */, 1, 1, uintptr(0),
+ rc = sqlite3.Xsqlite3_create_window_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38244 /* "sumint" */, 1, 1, uintptr(0),
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{sumintStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sumintFinal})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sumintValue})), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{sumintStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sumintFinal})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sumintValue})), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{sumintInverse})),
uintptr(0))
@@ -71948,7 +77274,7 @@ func test_create_sumint(tls *crt.TLS, clientData uintptr, interp uintptr, objc i
return 0
}
-func test_override_sum(tls *crt.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_window.c:305:26: */
+func test_override_sum(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) int32 { /* test_window.c:305:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -71964,10 +77290,10 @@ func test_override_sum(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
return 1
}
- rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+36170 /* "sum" */, -1, 1, uintptr(0),
+ rc = sqlite3.Xsqlite3_create_function(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+38251 /* "sum" */, -1, 1, uintptr(0),
uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{sumintStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{sumintFinal})))
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{sumintStep})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{sumintFinal})))
if rc != 0 {
tcl.XTcl_SetObjResult(tls, interp, tcl.XTcl_NewStringObj(tls, sqlite3.Xsqlite3ErrName(tls, rc), -1))
@@ -71976,1288 +77302,1367 @@ func test_override_sum(tls *crt.TLS, clientData uintptr, interp uintptr, objc in
return 0
}
-func Sqlitetest_window_Init(tls *crt.TLS, interp uintptr) int32 { /* test_window.c:331:5: */
+func Sqlitetest_window_Init(tls *libc.TLS, interp uintptr) int32 { /* test_window.c:331:5: */
var i int32
- for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd13)) / uint64(unsafe.Sizeof(struct {
+ for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aObjCmd14)) / uint64(unsafe.Sizeof(struct {
FzName uintptr
FxProc uintptr
FclientData int32
_ [4]byte
}{}))); i++ {
- var c ClientData = uintptr(int64(aObjCmd13[i].FclientData))
- tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd13[i].FzName, aObjCmd13[i].FxProc, c, uintptr(0))
+ var c ClientData = uintptr(intptr_t(aObjCmd14[i].FclientData))
+ tcl.XTcl_CreateObjCommand(tls, interp, aObjCmd14[i].FzName, aObjCmd14[i].FxProc, c, uintptr(0))
}
return 0
}
-var aObjCmd13 = [4]struct {
+var aObjCmd14 = [4]struct {
FzName uintptr
FxProc uintptr
FclientData int32
_ [4]byte
}{
- {FzName: ts + 36174 /* "sqlite3_create_w..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 36205 /* "test_create_wind..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 36240 /* "test_create_sumi..." */, FxProc: 0, FclientData: 0},
- {FzName: ts + 36259 /* "test_override_su..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 38255 /* "sqlite3_create_w..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 38286 /* "test_create_wind..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 38321 /* "test_create_sumi..." */, FxProc: 0, FclientData: 0},
+ {FzName: ts + 38340 /* "test_override_su..." */, FxProc: 0, FclientData: 0},
} /* test_window.c:336:5 */
+// 2008 September 1
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// The code in this file contains sample implementations of the
+// sqlite3_wsd_init() and sqlite3_wsd_find() functions required if the
+// SQLITE_OMIT_WSD symbol is defined at build time.
+
func init() {
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 8 /* .xClose */)) = cfClose // test6.c:573:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 16 /* .xRead */)) = cfRead // test6.c:574:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 24 /* .xWrite */)) = cfWrite // test6.c:575:3:
- *(*func(*crt.TLS, uintptr, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 32 /* .xTruncate */)) = cfTruncate // test6.c:576:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 40 /* .xSync */)) = cfSync // test6.c:577:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 48 /* .xFileSize */)) = cfFileSize // test6.c:578:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 56 /* .xLock */)) = cfLock // test6.c:579:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 64 /* .xUnlock */)) = cfUnlock // test6.c:580:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 72 /* .xCheckReservedLock */)) = cfCheckReservedLock // test6.c:581:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 80 /* .xFileControl */)) = cfFileControl // test6.c:582:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 88 /* .xSectorSize */)) = cfSectorSize // test6.c:583:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 96 /* .xDeviceCharacteristics */)) = cfDeviceCharacteristics // test6.c:584:3:
- *(*func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 104 /* .xShmMap */)) = cfShmMap // test6.c:585:3:
- *(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 112 /* .xShmLock */)) = cfShmLock // test6.c:586:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 120 /* .xShmBarrier */)) = cfShmBarrier // test6.c:587:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 128 /* .xShmUnmap */)) = cfShmUnmap // test6.c:588:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 8 /* .xCreate */)) = csvtabCreate // csv.c:874:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 16 /* .xConnect */)) = csvtabConnect // csv.c:875:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 24 /* .xBestIndex */)) = csvtabBestIndex // csv.c:876:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 32 /* .xDisconnect */)) = csvtabDisconnect // csv.c:877:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 40 /* .xDestroy */)) = csvtabDisconnect // csv.c:878:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 48 /* .xOpen */)) = csvtabOpen // csv.c:879:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 56 /* .xClose */)) = csvtabClose // csv.c:880:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 64 /* .xFilter */)) = csvtabFilter // csv.c:881:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 72 /* .xNext */)) = csvtabNext // csv.c:882:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 80 /* .xEof */)) = csvtabEof // csv.c:883:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 88 /* .xColumn */)) = csvtabColumn // csv.c:884:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 96 /* .xRowid */)) = csvtabRowid // csv.c:885:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 8 /* .xCreate */)) = csvtabCreate // csv.c:906:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 16 /* .xConnect */)) = csvtabConnect // csv.c:907:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 24 /* .xBestIndex */)) = csvtabBestIndex // csv.c:908:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 32 /* .xDisconnect */)) = csvtabDisconnect // csv.c:909:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 40 /* .xDestroy */)) = csvtabDisconnect // csv.c:910:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 48 /* .xOpen */)) = csvtabOpen // csv.c:911:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 56 /* .xClose */)) = csvtabClose // csv.c:912:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 64 /* .xFilter */)) = csvtabFilter // csv.c:913:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 72 /* .xNext */)) = csvtabNext // csv.c:914:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 80 /* .xEof */)) = csvtabEof // csv.c:915:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 88 /* .xColumn */)) = csvtabColumn // csv.c:916:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 96 /* .xRowid */)) = csvtabRowid // csv.c:917:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 104 /* .xUpdate */)) = csvtabUpdate // csv.c:918:3:
- *(*func(*crt.TLS, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&IncrblobChannelType)) + 16 /* .closeProc */)) = incrblobClose // tclsqlite.c:372:3:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&IncrblobChannelType)) + 24 /* .inputProc */)) = incrblobInput // tclsqlite.c:373:3:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&IncrblobChannelType)) + 32 /* .outputProc */)) = incrblobOutput // tclsqlite.c:374:3:
- *(*func(*crt.TLS, ClientData, int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&IncrblobChannelType)) + 40 /* .seekProc */)) = incrblobSeek // tclsqlite.c:375:3:
- *(*func(*crt.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&IncrblobChannelType)) + 64 /* .watchProc */)) = incrblobWatch // tclsqlite.c:378:3:
- *(*func(*crt.TLS, ClientData, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&IncrblobChannelType)) + 72 /* .getHandleProc */)) = incrblobHandle // tclsqlite.c:379:3:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{db_enter})) // test1.c:7878:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 24 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{db_leave})) // test1.c:7879:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 40 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite3_mprintf_int})) // test1.c:7880:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 56 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite3_mprintf_int64})) // test1.c:7881:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 72 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite3_mprintf_long})) // test1.c:7882:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 88 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite3_mprintf_str})) // test1.c:7883:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 104 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite3_snprintf_str})) // test1.c:7884:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 120 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite3_mprintf_stronly})) // test1.c:7885:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 136 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite3_mprintf_double})) // test1.c:7886:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 152 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite3_mprintf_scaled})) // test1.c:7887:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 168 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite3_mprintf_hexdouble})) // test1.c:7888:39:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 184 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_mprintf_z})) // test1.c:7889:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 200 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_mprintf_n})) // test1.c:7890:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 216 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_snprintf_int})) // test1.c:7891:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 232 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_last_rowid})) // test1.c:7892:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 248 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_exec_printf})) // test1.c:7893:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 264 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_exec_hex})) // test1.c:7894:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 280 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_exec})) // test1.c:7895:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 296 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_exec_nr})) // test1.c:7896:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 312 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_get_table_printf})) // test1.c:7898:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 328 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite_test_close})) // test1.c:7900:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 344 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite_test_close_v2})) // test1.c:7901:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 360 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_create_function})) // test1.c:7902:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 376 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_create_aggregate})) // test1.c:7903:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 392 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_drop_modules})) // test1.c:7904:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 408 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_register_func})) // test1.c:7905:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 424 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite_abort})) // test1.c:7906:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 440 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_bind})) // test1.c:7907:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 456 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_breakpoint})) // test1.c:7908:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 472 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_key})) // test1.c:7909:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 488 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_rekey})) // test1.c:7910:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 504 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{sqlite_set_magic})) // test1.c:7911:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 520 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_interrupt})) // test1.c:7912:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 536 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{delete_function})) // test1.c:7913:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 552 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{delete_collation})) // test1.c:7914:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 568 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{get_autocommit})) // test1.c:7915:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 584 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_busy_timeout})) // test1.c:7916:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 600 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_printf})) // test1.c:7917:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 616 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{test_io_trace})) // test1.c:7918:39:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 632 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{clang_sanitize_address})) // test1.c:7919:41:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 8 /* .xClose */)) = cfClose // test6.c:573:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 16 /* .xRead */)) = cfRead // test6.c:574:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 24 /* .xWrite */)) = cfWrite // test6.c:575:3:
+ *(*func(*libc.TLS, uintptr, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 32 /* .xTruncate */)) = cfTruncate // test6.c:576:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 40 /* .xSync */)) = cfSync // test6.c:577:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 48 /* .xFileSize */)) = cfFileSize // test6.c:578:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 56 /* .xLock */)) = cfLock // test6.c:579:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 64 /* .xUnlock */)) = cfUnlock // test6.c:580:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 72 /* .xCheckReservedLock */)) = cfCheckReservedLock // test6.c:581:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 80 /* .xFileControl */)) = cfFileControl // test6.c:582:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 88 /* .xSectorSize */)) = cfSectorSize // test6.c:583:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 96 /* .xDeviceCharacteristics */)) = cfDeviceCharacteristics // test6.c:584:3:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 104 /* .xShmMap */)) = cfShmMap // test6.c:585:3:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 112 /* .xShmLock */)) = cfShmLock // test6.c:586:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 120 /* .xShmBarrier */)) = cfShmBarrier // test6.c:587:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CrashFileVtab)) + 128 /* .xShmUnmap */)) = cfShmUnmap // test6.c:588:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 8 /* .xCreate */)) = csvtabCreate // csv.c:874:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 16 /* .xConnect */)) = csvtabConnect // csv.c:875:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 24 /* .xBestIndex */)) = csvtabBestIndex // csv.c:876:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 32 /* .xDisconnect */)) = csvtabDisconnect // csv.c:877:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 40 /* .xDestroy */)) = csvtabDisconnect // csv.c:878:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 48 /* .xOpen */)) = csvtabOpen // csv.c:879:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 56 /* .xClose */)) = csvtabClose // csv.c:880:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 64 /* .xFilter */)) = csvtabFilter // csv.c:881:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 72 /* .xNext */)) = csvtabNext // csv.c:882:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 80 /* .xEof */)) = csvtabEof // csv.c:883:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 88 /* .xColumn */)) = csvtabColumn // csv.c:884:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModule)) + 96 /* .xRowid */)) = csvtabRowid // csv.c:885:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 8 /* .xCreate */)) = csvtabCreate // csv.c:906:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 16 /* .xConnect */)) = csvtabConnect // csv.c:907:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 24 /* .xBestIndex */)) = csvtabBestIndex // csv.c:908:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 32 /* .xDisconnect */)) = csvtabDisconnect // csv.c:909:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 40 /* .xDestroy */)) = csvtabDisconnect // csv.c:910:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 48 /* .xOpen */)) = csvtabOpen // csv.c:911:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 56 /* .xClose */)) = csvtabClose // csv.c:912:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 64 /* .xFilter */)) = csvtabFilter // csv.c:913:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 72 /* .xNext */)) = csvtabNext // csv.c:914:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 80 /* .xEof */)) = csvtabEof // csv.c:915:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 88 /* .xColumn */)) = csvtabColumn // csv.c:916:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 96 /* .xRowid */)) = csvtabRowid // csv.c:917:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&CsvModuleFauxWrite)) + 104 /* .xUpdate */)) = csvtabUpdate // csv.c:918:3:
+ *(*func(*libc.TLS, ClientData, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&IncrblobChannelType)) + 16 /* .closeProc */)) = incrblobClose // tclsqlite.c:372:3:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&IncrblobChannelType)) + 24 /* .inputProc */)) = incrblobInput // tclsqlite.c:373:3:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&IncrblobChannelType)) + 32 /* .outputProc */)) = incrblobOutput // tclsqlite.c:374:3:
+ *(*func(*libc.TLS, ClientData, int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&IncrblobChannelType)) + 40 /* .seekProc */)) = incrblobSeek // tclsqlite.c:375:3:
+ *(*func(*libc.TLS, ClientData, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&IncrblobChannelType)) + 64 /* .watchProc */)) = incrblobWatch // tclsqlite.c:378:3:
+ *(*func(*libc.TLS, ClientData, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&IncrblobChannelType)) + 72 /* .getHandleProc */)) = incrblobHandle // tclsqlite.c:379:3:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 8 /* .xProc */)) = f5tCreateTokenizer // fts5_tcl.c:1125:42:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 32 /* .xProc */)) = f5tTokenizerReturn // fts5_tcl.c:1126:42:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 56 /* .xProc */)) = f5tTokenize // fts5_tcl.c:1127:42:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 80 /* .xProc */)) = f5tCreateFunction // fts5_tcl.c:1128:42:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 104 /* .xProc */)) = f5tMayBeCorrupt // fts5_tcl.c:1129:42:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 128 /* .xProc */)) = f5tTokenHash // fts5_tcl.c:1130:42:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 152 /* .xProc */)) = f5tRegisterMatchinfo // fts5_tcl.c:1131:42:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd)) + 176 /* .xProc */)) = f5tRegisterTok // fts5_tcl.c:1132:45:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{pager_open})) // test2.c:708:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{db_enter})) // test1.c:7939:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 24 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{pager_close})) // test2.c:709:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{db_leave})) // test1.c:7940:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 40 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{pager_commit})) // test2.c:710:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite3_mprintf_int})) // test1.c:7941:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 56 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{pager_rollback})) // test2.c:711:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite3_mprintf_int64})) // test1.c:7942:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 72 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{pager_stmt_begin})) // test2.c:712:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite3_mprintf_long})) // test1.c:7943:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 88 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{pager_stmt_commit})) // test2.c:713:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite3_mprintf_str})) // test1.c:7944:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 104 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{pager_stmt_rollback})) // test2.c:714:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite3_snprintf_str})) // test1.c:7945:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 120 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{pager_stats})) // test2.c:715:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite3_mprintf_stronly})) // test1.c:7946:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 136 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{pager_pagecount})) // test2.c:716:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite3_mprintf_double})) // test1.c:7947:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 152 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{page_get})) // test2.c:717:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite3_mprintf_scaled})) // test1.c:7948:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 168 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{page_lookup})) // test2.c:718:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite3_mprintf_hexdouble})) // test1.c:7949:39:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 184 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{page_unref})) // test2.c:719:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_mprintf_z})) // test1.c:7950:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 200 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{page_read})) // test2.c:720:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_mprintf_n})) // test1.c:7951:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 216 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{page_write})) // test2.c:721:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_snprintf_int})) // test1.c:7952:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 232 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{page_number})) // test2.c:722:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_last_rowid})) // test1.c:7953:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 248 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{pager_truncate})) // test2.c:723:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_exec_printf})) // test1.c:7954:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 264 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{fake_big_file})) // test2.c:725:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_exec_hex})) // test1.c:7955:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 280 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{testBitvecBuiltinTest})) // test2.c:727:34:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_exec})) // test1.c:7956:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 296 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{testPendingByte})) // test2.c:728:45:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_exec_nr})) // test1.c:7957:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 312 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{faultInstallCmd})) // test2.c:729:45:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_get_table_printf})) // test1.c:7959:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 328 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite_test_close})) // test1.c:7961:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 344 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite_test_close_v2})) // test1.c:7962:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 360 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_create_function})) // test1.c:7963:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 376 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_create_aggregate})) // test1.c:7964:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 392 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_drop_modules})) // test1.c:7965:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 408 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_register_func})) // test1.c:7966:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 424 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite_abort})) // test1.c:7967:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 440 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_bind})) // test1.c:7968:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 456 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_breakpoint})) // test1.c:7969:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 472 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_key})) // test1.c:7970:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 488 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_rekey})) // test1.c:7971:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 504 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{sqlite_set_magic})) // test1.c:7972:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 520 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_interrupt})) // test1.c:7973:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 536 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{delete_function})) // test1.c:7974:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 552 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{delete_collation})) // test1.c:7975:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 568 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{get_autocommit})) // test1.c:7976:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 584 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_busy_timeout})) // test1.c:7977:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 600 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_printf})) // test1.c:7978:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 616 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{test_io_trace})) // test1.c:7979:39:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd1)) + 632 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{clang_sanitize_address})) // test1.c:7980:41:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_open})) // test3.c:666:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{pager_open})) // test2.c:708:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 24 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_close})) // test3.c:667:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{pager_close})) // test2.c:709:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 40 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_begin_transaction})) // test3.c:668:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{pager_commit})) // test2.c:710:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 56 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_pager_stats})) // test3.c:669:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{pager_rollback})) // test2.c:711:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 72 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_cursor})) // test3.c:670:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{pager_stmt_begin})) // test2.c:712:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 88 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_close_cursor})) // test3.c:671:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{pager_stmt_commit})) // test2.c:713:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 104 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_next})) // test3.c:672:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{pager_stmt_rollback})) // test2.c:714:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 120 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_eof})) // test3.c:673:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{pager_stats})) // test2.c:715:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 136 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_payload_size})) // test3.c:674:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{pager_pagecount})) // test2.c:716:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 152 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_first})) // test3.c:675:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{page_get})) // test2.c:717:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 168 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_varint_test})) // test3.c:676:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{page_lookup})) // test2.c:718:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 184 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_from_db})) // test3.c:677:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{page_unref})) // test2.c:719:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 200 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_ismemdb})) // test3.c:678:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{page_read})) // test2.c:720:34:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 216 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{btree_set_cache_size})) // test3.c:679:36:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{page_write})) // test2.c:721:34:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 232 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{page_number})) // test2.c:722:34:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 248 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{pager_truncate})) // test2.c:723:34:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 264 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{fake_big_file})) // test2.c:725:34:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 280 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{testBitvecBuiltinTest})) // test2.c:727:34:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 296 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{testPendingByte})) // test2.c:728:45:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd2)) + 312 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{faultInstallCmd})) // test2.c:729:45:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_create})) // test4.c:701:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_open})) // test3.c:666:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 24 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_wait})) // test4.c:702:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_close})) // test3.c:667:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 40 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_halt})) // test4.c:703:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_begin_transaction})) // test3.c:668:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 56 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_argc})) // test4.c:704:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_pager_stats})) // test3.c:669:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 72 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_argv})) // test4.c:705:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_cursor})) // test3.c:670:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 88 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_colname})) // test4.c:706:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_close_cursor})) // test3.c:671:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 104 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_result})) // test4.c:707:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_next})) // test3.c:672:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 120 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_error})) // test4.c:708:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_eof})) // test3.c:673:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 136 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_compile})) // test4.c:709:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_payload_size})) // test3.c:674:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 152 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_step})) // test4.c:710:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_first})) // test3.c:675:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 168 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_finalize})) // test4.c:711:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_varint_test})) // test3.c:676:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 184 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_swap})) // test4.c:712:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_from_db})) // test3.c:677:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 200 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
- }{tcl_thread_db_get})) // test4.c:713:29:
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_ismemdb})) // test3.c:678:36:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 216 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{btree_set_cache_size})) // test3.c:679:36:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_create})) // test4.c:701:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 24 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_wait})) // test4.c:702:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 40 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_halt})) // test4.c:703:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 56 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_argc})) // test4.c:704:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 72 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_argv})) // test4.c:705:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 88 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_colname})) // test4.c:706:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 104 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_result})) // test4.c:707:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 120 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_error})) // test4.c:708:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 136 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_compile})) // test4.c:709:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 152 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_step})) // test4.c:710:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 168 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_finalize})) // test4.c:711:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 184 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_swap})) // test4.c:712:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 200 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{tcl_thread_db_get})) // test4.c:713:29:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 216 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_thread_db_put})) // test4.c:714:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd3)) + 232 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 232 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_thread_stmt_get})) // test4.c:715:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{binarize})) // test5.c:210:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 24 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 24 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_value_overhead})) // test5.c:211:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 40 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 40 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_translate})) // test5.c:212:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd4)) + 56 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 56 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_translate_selftest})) // test5.c:213:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_create})) // test7.c:695:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 24 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 24 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_wait})) // test7.c:696:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 40 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 40 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_halt})) // test7.c:697:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 56 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 56 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_argc})) // test7.c:698:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 72 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 72 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_argv})) // test7.c:699:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 88 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 88 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_colname})) // test7.c:700:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 104 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 104 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_result})) // test7.c:701:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 120 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 120 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_error})) // test7.c:702:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 136 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 136 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_compile})) // test7.c:703:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 152 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 152 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_step})) // test7.c:704:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 168 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 168 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_reset})) // test7.c:705:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 184 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 184 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_finalize})) // test7.c:706:29:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd5)) + 200 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 200 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{tcl_client_swap})) // test7.c:707:29:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 8 /* .xProc */)) = test_multiplex_initialize // test_multiplex.c:1311:39:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 24 /* .xProc */)) = test_multiplex_shutdown // test_multiplex.c:1312:37:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd6)) + 40 /* .xProc */)) = test_multiplex_control // test_multiplex.c:1313:36:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 8 /* .xProc */)) = test_multiplex_initialize // test_multiplex.c:1311:39:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 24 /* .xProc */)) = test_multiplex_shutdown // test_multiplex.c:1312:37:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 40 /* .xProc */)) = test_multiplex_control // test_multiplex.c:1313:36:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 8 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_shutdown})) // test_mutex.c:485:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 24 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 24 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_initialize})) // test_mutex.c:486:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 40 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 40 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_config})) // test_mutex.c:487:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 56 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 56 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_enter_static_mutex})) // test_mutex.c:489:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 72 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 72 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_leave_static_mutex})) // test_mutex.c:490:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 88 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 88 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_enter_db_mutex})) // test_mutex.c:492:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 104 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 104 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_leave_db_mutex})) // test_mutex.c:493:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 120 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 120 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_alloc_mutex})) // test_mutex.c:495:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 136 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 136 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_install_mutex_counters})) // test_mutex.c:496:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 152 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 152 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_read_mutex_counters})) // test_mutex.c:497:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd7)) + 168 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 168 /* .xProc */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
}{test_clear_mutex_counters})) // test_mutex.c:498:34:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 8 /* .xProc */)) = test_quota_initialize // test_quota.c:1949:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 24 /* .xProc */)) = test_quota_shutdown // test_quota.c:1950:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 40 /* .xProc */)) = test_quota_set // test_quota.c:1951:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 56 /* .xProc */)) = test_quota_file // test_quota.c:1952:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 72 /* .xProc */)) = test_quota_dump // test_quota.c:1953:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 88 /* .xProc */)) = test_quota_fopen // test_quota.c:1954:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 104 /* .xProc */)) = test_quota_fread // test_quota.c:1955:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 120 /* .xProc */)) = test_quota_fwrite // test_quota.c:1956:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 136 /* .xProc */)) = test_quota_fclose // test_quota.c:1957:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 152 /* .xProc */)) = test_quota_fflush // test_quota.c:1958:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 168 /* .xProc */)) = test_quota_fseek // test_quota.c:1959:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 184 /* .xProc */)) = test_quota_rewind // test_quota.c:1960:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 200 /* .xProc */)) = test_quota_ftell // test_quota.c:1961:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 216 /* .xProc */)) = test_quota_ftruncate // test_quota.c:1962:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 232 /* .xProc */)) = test_quota_file_size // test_quota.c:1963:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 248 /* .xProc */)) = test_quota_file_truesize // test_quota.c:1964:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 264 /* .xProc */)) = test_quota_file_mtime // test_quota.c:1965:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 280 /* .xProc */)) = test_quota_remove // test_quota.c:1966:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 296 /* .xProc */)) = test_quota_glob // test_quota.c:1967:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 312 /* .xProc */)) = test_quota_file_available // test_quota.c:1968:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd8)) + 328 /* .xProc */)) = test_quota_ferror // test_quota.c:1969:38:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 8 /* .pInit */)) = sqlite3_amatch_init // test1.c:7281:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 24 /* .pInit */)) = sqlite3_carray_init // test1.c:7282:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 40 /* .pInit */)) = sqlite3_closure_init // test1.c:7283:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 56 /* .pInit */)) = sqlite3_csv_init // test1.c:7284:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 72 /* .pInit */)) = sqlite3_eval_init // test1.c:7285:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 88 /* .pInit */)) = sqlite3_explain_init // test1.c:7286:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 104 /* .pInit */)) = sqlite3_fileio_init // test1.c:7287:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 120 /* .pInit */)) = sqlite3_fuzzer_init // test1.c:7288:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 136 /* .pInit */)) = sqlite3_ieee_init // test1.c:7289:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 152 /* .pInit */)) = sqlite3_nextchar_init // test1.c:7290:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 168 /* .pInit */)) = sqlite3_percentile_init // test1.c:7291:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 184 /* .pInit */)) = sqlite3_prefixes_init // test1.c:7293:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 200 /* .pInit */)) = sqlite3_regexp_init // test1.c:7295:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 216 /* .pInit */)) = sqlite3_remember_init // test1.c:7296:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 232 /* .pInit */)) = sqlite3_series_init // test1.c:7297:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 248 /* .pInit */)) = sqlite3_spellfix_init // test1.c:7298:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 264 /* .pInit */)) = sqlite3_totype_init // test1.c:7299:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 280 /* .pInit */)) = sqlite3_unionvtab_init // test1.c:7300:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 296 /* .pInit */)) = sqlite3_wholenumber_init // test1.c:7301:32:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 312 /* .pInit */)) = sqlite3_zipfile_init // test1.c:7303:32:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 16 /* .xFunc */)) = randStr // test_func.c:675:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 40 /* .xFunc */)) = test_destructor // test_func.c:676:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 64 /* .xFunc */)) = test_destructor16 // test_func.c:678:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 88 /* .xFunc */)) = testHexToUtf16be // test_func.c:679:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 112 /* .xFunc */)) = testHexToUtf16le // test_func.c:680:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 136 /* .xFunc */)) = testHexToUtf8 // test_func.c:682:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 160 /* .xFunc */)) = test_destructor_count // test_func.c:683:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 184 /* .xFunc */)) = test_auxdata // test_func.c:684:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 208 /* .xFunc */)) = test_error // test_func.c:685:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 232 /* .xFunc */)) = test_error // test_func.c:686:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 256 /* .xFunc */)) = test_eval // test_func.c:687:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 280 /* .xFunc */)) = test_isolation // test_func.c:688:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 304 /* .xFunc */)) = counterFunc // test_func.c:689:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 328 /* .xFunc */)) = real2hex // test_func.c:690:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 352 /* .xFunc */)) = test_decode // test_func.c:691:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 376 /* .xFunc */)) = test_extract // test_func.c:692:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 400 /* .xFunc */)) = test_zeroblob // test_func.c:693:62:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 424 /* .xFunc */)) = test_getsubtype // test_func.c:694:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 448 /* .xFunc */)) = test_setsubtype // test_func.c:695:48:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 472 /* .xFunc */)) = test_frombind // test_func.c:696:48:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 8 /* .xProc */)) = test_sqlite3_db_config // test1.c:7926:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 32 /* .xProc */)) = test_bad_behavior // test1.c:7927:41:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 40 /* .clientData */)) = uintptr(unsafe.Pointer(&iZero)) // test1.c:7927:61:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 56 /* .xProc */)) = test_register_dbstat_vtab // test1.c:7928:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 80 /* .xProc */)) = get_sqlite_pointer // test1.c:7929:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 104 /* .xProc */)) = test_intarray_addr // test1.c:7930:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 128 /* .xProc */)) = test_int64array_addr // test1.c:7931:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 152 /* .xProc */)) = test_doublearray_addr // test1.c:7932:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 176 /* .xProc */)) = test_textarray_addr // test1.c:7933:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 200 /* .xProc */)) = test_bind_int // test1.c:7934:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 224 /* .xProc */)) = test_bind_zeroblob // test1.c:7935:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 248 /* .xProc */)) = test_bind_zeroblob64 // test1.c:7936:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 272 /* .xProc */)) = test_bind_int64 // test1.c:7937:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 296 /* .xProc */)) = test_bind_double // test1.c:7938:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 320 /* .xProc */)) = test_bind_null // test1.c:7939:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 344 /* .xProc */)) = test_bind_text // test1.c:7940:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 368 /* .xProc */)) = test_bind_text16 // test1.c:7941:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 392 /* .xProc */)) = test_bind_blob // test1.c:7942:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 416 /* .xProc */)) = test_bind_parameter_count // test1.c:7943:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 440 /* .xProc */)) = test_bind_parameter_name // test1.c:7944:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 464 /* .xProc */)) = test_bind_parameter_index // test1.c:7945:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 488 /* .xProc */)) = test_clear_bindings // test1.c:7946:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 512 /* .xProc */)) = test_sleep // test1.c:7947:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 536 /* .xProc */)) = test_errcode // test1.c:7948:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 560 /* .xProc */)) = test_ex_errcode // test1.c:7949:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 584 /* .xProc */)) = test_errmsg // test1.c:7950:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 608 /* .xProc */)) = test_errmsg16 // test1.c:7951:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 632 /* .xProc */)) = test_open // test1.c:7952:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 656 /* .xProc */)) = test_open16 // test1.c:7953:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 680 /* .xProc */)) = test_open_v2 // test1.c:7954:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 704 /* .xProc */)) = test_complete16 // test1.c:7955:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 728 /* .xProc */)) = test_normalize // test1.c:7956:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 752 /* .xProc */)) = test_prepare // test1.c:7958:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 776 /* .xProc */)) = test_prepare16 // test1.c:7959:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 800 /* .xProc */)) = test_prepare_v2 // test1.c:7960:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 824 /* .xProc */)) = test_prepare_v3 // test1.c:7961:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 848 /* .xProc */)) = test_prepare_tkt3134 // test1.c:7962:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 872 /* .xProc */)) = test_prepare16_v2 // test1.c:7963:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 896 /* .xProc */)) = test_finalize // test1.c:7964:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 920 /* .xProc */)) = test_stmt_status // test1.c:7965:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 944 /* .xProc */)) = test_reset // test1.c:7966:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 968 /* .xProc */)) = test_expired // test1.c:7967:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 992 /* .xProc */)) = test_transfer_bind // test1.c:7968:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1016 /* .xProc */)) = test_changes // test1.c:7969:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1040 /* .xProc */)) = test_step // test1.c:7970:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1064 /* .xProc */)) = test_sql // test1.c:7971:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1088 /* .xProc */)) = test_ex_sql // test1.c:7972:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1112 /* .xProc */)) = test_next_stmt // test1.c:7976:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1136 /* .xProc */)) = test_stmt_readonly // test1.c:7977:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1160 /* .xProc */)) = test_stmt_isexplain // test1.c:7978:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1184 /* .xProc */)) = test_stmt_busy // test1.c:7979:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1208 /* .xProc */)) = uses_stmt_journal // test1.c:7980:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1232 /* .xProc */)) = test_release_memory // test1.c:7982:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1256 /* .xProc */)) = test_db_release_memory // test1.c:7983:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1280 /* .xProc */)) = test_db_cacheflush // test1.c:7984:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1304 /* .xProc */)) = test_system_errno // test1.c:7985:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1328 /* .xProc */)) = test_db_filename // test1.c:7986:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1352 /* .xProc */)) = test_db_readonly // test1.c:7987:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1376 /* .xProc */)) = test_soft_heap_limit // test1.c:7988:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1400 /* .xProc */)) = test_soft_heap_limit // test1.c:7989:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1424 /* .xProc */)) = test_hard_heap_limit // test1.c:7990:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1448 /* .xProc */)) = test_thread_cleanup // test1.c:7991:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1472 /* .xProc */)) = test_pager_refcounts // test1.c:7992:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1496 /* .xProc */)) = test_load_extension // test1.c:7994:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1520 /* .xProc */)) = test_enable_load // test1.c:7995:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1544 /* .xProc */)) = test_extended_result_codes // test1.c:7996:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1568 /* .xProc */)) = test_limit // test1.c:7997:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1592 /* .xProc */)) = test_dbconfig_maindbname_icecube // test1.c:7998:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1616 /* .xProc */)) = save_prng_state // test1.c:8000:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1640 /* .xProc */)) = restore_prng_state // test1.c:8001:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1664 /* .xProc */)) = reset_prng_state // test1.c:8002:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1688 /* .xProc */)) = prng_seed // test1.c:8003:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1712 /* .xProc */)) = database_never_corrupt // test1.c:8004:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1736 /* .xProc */)) = database_may_be_corrupt // test1.c:8005:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1760 /* .xProc */)) = optimization_control // test1.c:8006:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1784 /* .xProc */)) = runAsObjProc // test1.c:8015:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1808 /* .xProc */)) = test_column_count // test1.c:8018:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1832 /* .xProc */)) = test_data_count // test1.c:8019:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1856 /* .xProc */)) = test_column_type // test1.c:8020:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1880 /* .xProc */)) = test_column_blob // test1.c:8021:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1904 /* .xProc */)) = test_column_double // test1.c:8022:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1928 /* .xProc */)) = test_column_int64 // test1.c:8023:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1952 /* .xProc */)) = test_stmt_utf8 // test1.c:8024:33:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1960 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) uintptr
- }{sqlite3.Xsqlite3_column_text})) // test1.c:8024:50:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1976 /* .xProc */)) = test_stmt_utf8 // test1.c:8025:33:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 1984 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) uintptr
- }{sqlite3.Xsqlite3_column_name})) // test1.c:8025:50:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2000 /* .xProc */)) = test_stmt_int // test1.c:8026:33:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2008 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
- }{sqlite3.Xsqlite3_column_int})) // test1.c:8026:50:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2024 /* .xProc */)) = test_stmt_int // test1.c:8027:33:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2032 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
- }{sqlite3.Xsqlite3_column_bytes})) // test1.c:8027:50:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2048 /* .xProc */)) = test_stmt_utf8 // test1.c:8029:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2056 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) uintptr
- }{sqlite3.Xsqlite3_column_decltype})) // test1.c:8029:49:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2072 /* .xProc */)) = test_stmt_int // test1.c:8038:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2080 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
- }{sqlite3.Xsqlite3_column_bytes16})) // test1.c:8038:49:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2096 /* .xProc */)) = test_stmt_utf16 // test1.c:8039:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2104 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) uintptr
- }{sqlite3.Xsqlite3_column_text16})) // test1.c:8039:51:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2120 /* .xProc */)) = test_stmt_utf16 // test1.c:8040:34:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2128 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) uintptr
- }{sqlite3.Xsqlite3_column_name16})) // test1.c:8040:51:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2144 /* .xProc */)) = add_alignment_test_collations // test1.c:8041:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2168 /* .xProc */)) = test_stmt_utf16 // test1.c:8043:36:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2176 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) uintptr
- }{sqlite3.Xsqlite3_column_decltype16})) // test1.c:8043:52:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2192 /* .xProc */)) = test_create_collation_v2 // test1.c:8052:39:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2216 /* .xProc */)) = test_global_recover // test1.c:8053:38:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2240 /* .xProc */)) = working_64bit_int // test1.c:8054:38:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2264 /* .xProc */)) = vfs_unlink_test // test1.c:8055:38:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2288 /* .xProc */)) = vfs_initfail_test // test1.c:8056:38:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2312 /* .xProc */)) = vfs_unregister_all // test1.c:8057:38:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2336 /* .xProc */)) = vfs_reregister_all // test1.c:8058:38:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2360 /* .xProc */)) = file_control_test // test1.c:8059:38:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2384 /* .xProc */)) = file_control_lasterrno_test // test1.c:8060:39:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2408 /* .xProc */)) = file_control_lockproxy_test // test1.c:8061:39:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2432 /* .xProc */)) = file_control_chunksize_test // test1.c:8062:39:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2456 /* .xProc */)) = file_control_sizehint_test // test1.c:8063:39:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2480 /* .xProc */)) = file_control_data_version // test1.c:8064:39:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2504 /* .xProc */)) = file_control_persist_wal // test1.c:8070:39:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2528 /* .xProc */)) = file_control_powersafe_overwrite // test1.c:8071:43:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2552 /* .xProc */)) = file_control_vfsname // test1.c:8072:39:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2576 /* .xProc */)) = file_control_tempfilename // test1.c:8073:39:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2600 /* .xProc */)) = vfs_list // test1.c:8074:38:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2624 /* .xProc */)) = test_create_function_v2 // test1.c:8075:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2648 /* .xProc */)) = test_collate // test1.c:8079:35:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2672 /* .xProc */)) = test_collate_needed // test1.c:8080:35:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2696 /* .xProc */)) = test_function // test1.c:8081:35:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2720 /* .xProc */)) = test_utf16bin_collate // test1.c:8082:40:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2744 /* .xProc */)) = test_errstr // test1.c:8084:35:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2768 /* .xProc */)) = tcl_variable_type // test1.c:8085:35:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2792 /* .xProc */)) = test_enable_shared // test1.c:8087:39:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2816 /* .xProc */)) = sqlite3BtreeSharedCacheReport // test1.c:8088:39:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2840 /* .xProc */)) = test_libversion_number // test1.c:8090:37:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2864 /* .xProc */)) = test_table_column_metadata // test1.c:8091:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2888 /* .xProc */)) = test_blob_reopen // test1.c:8093:31:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2912 /* .xProc */)) = test_pcache_stats // test1.c:8095:30:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2936 /* .xProc */)) = test_unlock_notify // test1.c:8097:33:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2960 /* .xProc */)) = test_wal_checkpoint // test1.c:8099:36:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 2984 /* .xProc */)) = test_wal_checkpoint_v2 // test1.c:8100:36:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3008 /* .xProc */)) = test_wal_autocheckpoint // test1.c:8101:37:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3032 /* .xProc */)) = test_sqlite3_log // test1.c:8102:36:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3056 /* .xProc */)) = test_print_eqp // test1.c:8104:36:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3080 /* .xProc */)) = test_test_control // test1.c:8106:32:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3104 /* .xProc */)) = test_getrusage // test1.c:8108:21:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3128 /* .xProc */)) = tclLoadStaticExtensionCmd // test1.c:8110:33:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3152 /* .xProc */)) = sorter_test_fakeheap // test1.c:8111:32:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3176 /* .xProc */)) = sorter_test_sort4_helper // test1.c:8112:36:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3200 /* .xProc */)) = vfsCurrentTimeInt64 // test1.c:8126:44:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3224 /* .xProc */)) = test_delete_database // test1.c:8137:35:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3248 /* .xProc */)) = test_atomic_batch_write // test1.c:8138:35:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3272 /* .xProc */)) = test_mmap_warm // test1.c:8139:35:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3296 /* .xProc */)) = test_config_sorterref // test1.c:8140:36:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 3320 /* .xProc */)) = test_decode_hexdb // test1.c:8141:36:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 8 /* .xProc */)) = register_echo_module // test8.c:1434:38:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 32 /* .xProc */)) = declare_vtab // test8.c:1435:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 8 /* .xProc */)) = test_malloc // test_malloc.c:1506:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 32 /* .xProc */)) = test_realloc // test_malloc.c:1507:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 56 /* .xProc */)) = test_free // test_malloc.c:1508:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 80 /* .xProc */)) = test_memset // test_malloc.c:1509:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 104 /* .xProc */)) = test_memget // test_malloc.c:1510:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 128 /* .xProc */)) = test_memory_used // test_malloc.c:1511:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 152 /* .xProc */)) = test_memory_highwater // test_malloc.c:1512:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 176 /* .xProc */)) = test_memdebug_backtrace // test_malloc.c:1513:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 200 /* .xProc */)) = test_memdebug_dump // test_malloc.c:1514:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 224 /* .xProc */)) = test_memdebug_fail // test_malloc.c:1515:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 248 /* .xProc */)) = test_memdebug_pending // test_malloc.c:1516:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 272 /* .xProc */)) = test_memdebug_settitle // test_malloc.c:1517:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 296 /* .xProc */)) = test_memdebug_malloc_count // test_malloc.c:1518:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 320 /* .xProc */)) = test_memdebug_log // test_malloc.c:1519:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 344 /* .xProc */)) = test_config_pagecache // test_malloc.c:1520:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 368 /* .xProc */)) = test_alt_pcache // test_malloc.c:1521:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 392 /* .xProc */)) = test_status // test_malloc.c:1522:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 416 /* .xProc */)) = test_db_status // test_malloc.c:1523:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 440 /* .xProc */)) = test_install_malloc_faultsim // test_malloc.c:1524:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 464 /* .xProc */)) = test_config_heap // test_malloc.c:1525:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 488 /* .xProc */)) = test_config_heap_size // test_malloc.c:1526:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 512 /* .xProc */)) = test_config_memstatus // test_malloc.c:1527:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 536 /* .xProc */)) = test_config_lookaside // test_malloc.c:1528:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 560 /* .xProc */)) = test_config_error // test_malloc.c:1529:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 584 /* .xProc */)) = test_config_uri // test_malloc.c:1530:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 608 /* .xProc */)) = test_config_cis // test_malloc.c:1531:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 632 /* .xProc */)) = test_config_pmasz // test_malloc.c:1532:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 656 /* .xProc */)) = test_db_config_lookaside // test_malloc.c:1533:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 680 /* .xProc */)) = test_dump_memsys3 // test_malloc.c:1534:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 704 /* .xProc */)) = test_dump_memsys3 // test_malloc.c:1535:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 728 /* .xProc */)) = test_install_memsys3 // test_malloc.c:1536:38:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 752 /* .xProc */)) = test_vfs_oom_test // test_malloc.c:1537:41:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 8 /* .xProc */)) = register_schema_module // test_schema.c:336:34:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd12)) + 8 /* .xProc */)) = register_tclvar_module // test_tclvar.c:553:36:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd13)) + 8 /* .xProc */)) = test_create_window // test_window.c:337:42:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd13)) + 32 /* .xProc */)) = test_create_window_misuse // test_window.c:338:46:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd13)) + 56 /* .xProc */)) = test_create_sumint // test_window.c:339:30:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd13)) + 80 /* .xProc */)) = test_override_sum // test_window.c:340:29:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd2)) + 8 /* .xProc */)) = c_misuse_test // test9.c:194:28:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd2)) + 32 /* .xProc */)) = c_realloc_test // test9.c:195:28:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd2)) + 56 /* .xProc */)) = c_collation_test // test9.c:196:28:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd3)) + 8 /* .xProc */)) = register_tcl_module // test_bestindex.c:611:33:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd4)) + 8 /* .xProc */)) = test_blob_open // test_blob.c:318:40:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd4)) + 24 /* .xProc */)) = test_blob_close // test_blob.c:319:40:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd4)) + 40 /* .xProc */)) = test_blob_bytes // test_blob.c:320:40:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd4)) + 56 /* .xProc */)) = test_blob_read // test_blob.c:321:40:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd4)) + 72 /* .xProc */)) = test_blob_write // test_blob.c:322:40:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd5)) + 8 /* .xProc */)) = register_fs_module // test_fs.c:908:32:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd6)) + 8 /* .xProc */)) = autoinstall_test_funcs // test_func.c:938:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd6)) + 24 /* .xProc */)) = abuse_create_function // test_func.c:939:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd6)) + 40 /* .xProc */)) = install_fts3_rank_function // test_func.c:940:41:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd7)) + 8 /* .xProc */)) = hexio_read // test_hexio.c:451:40:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd7)) + 24 /* .xProc */)) = hexio_write // test_hexio.c:452:40:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd7)) + 40 /* .xProc */)) = hexio_get_int // test_hexio.c:453:40:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd7)) + 56 /* .xProc */)) = hexio_render_int16 // test_hexio.c:454:40:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd7)) + 72 /* .xProc */)) = hexio_render_int32 // test_hexio.c:455:40:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd7)) + 88 /* .xProc */)) = utf8_to_utf8 // test_hexio.c:456:40:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd7)) + 104 /* .xProc */)) = read_fts3varint // test_hexio.c:457:40:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd7)) + 120 /* .xProc */)) = make_fts3record // test_hexio.c:458:40:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd8)) + 8 /* .xProc */)) = init_wrapper_install // test_init.c:283:32:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd8)) + 24 /* .xProc */)) = init_wrapper_query // test_init.c:284:32:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd8)) + 40 /* .xProc */)) = init_wrapper_uninstall // test_init.c:285:32:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd8)) + 56 /* .xProc */)) = init_wrapper_clear // test_init.c:286:32:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd9)) + 8 /* .xProc */)) = test_intarray_create // test_intarray.c:381:35:
- *(*func(*crt.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd9)) + 32 /* .xProc */)) = test_intarray_bind // test_intarray.c:382:33:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 8 /* .xProc */)) = test_quota_initialize // test_quota.c:1949:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 24 /* .xProc */)) = test_quota_shutdown // test_quota.c:1950:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 40 /* .xProc */)) = test_quota_set // test_quota.c:1951:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 56 /* .xProc */)) = test_quota_file // test_quota.c:1952:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 72 /* .xProc */)) = test_quota_dump // test_quota.c:1953:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 88 /* .xProc */)) = test_quota_fopen // test_quota.c:1954:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 104 /* .xProc */)) = test_quota_fread // test_quota.c:1955:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 120 /* .xProc */)) = test_quota_fwrite // test_quota.c:1956:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 136 /* .xProc */)) = test_quota_fclose // test_quota.c:1957:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 152 /* .xProc */)) = test_quota_fflush // test_quota.c:1958:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 168 /* .xProc */)) = test_quota_fseek // test_quota.c:1959:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 184 /* .xProc */)) = test_quota_rewind // test_quota.c:1960:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 200 /* .xProc */)) = test_quota_ftell // test_quota.c:1961:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 216 /* .xProc */)) = test_quota_ftruncate // test_quota.c:1962:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 232 /* .xProc */)) = test_quota_file_size // test_quota.c:1963:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 248 /* .xProc */)) = test_quota_file_truesize // test_quota.c:1964:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 264 /* .xProc */)) = test_quota_file_mtime // test_quota.c:1965:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 280 /* .xProc */)) = test_quota_remove // test_quota.c:1966:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 296 /* .xProc */)) = test_quota_glob // test_quota.c:1967:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 312 /* .xProc */)) = test_quota_file_available // test_quota.c:1968:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aCmd9)) + 328 /* .xProc */)) = test_quota_ferror // test_quota.c:1969:38:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 8 /* .pInit */)) = sqlite3_amatch_init // test1.c:7306:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 24 /* .pInit */)) = sqlite3_carray_init // test1.c:7307:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 40 /* .pInit */)) = sqlite3_closure_init // test1.c:7308:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 56 /* .pInit */)) = sqlite3_csv_init // test1.c:7309:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 72 /* .pInit */)) = sqlite3_decimal_init // test1.c:7310:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 88 /* .pInit */)) = sqlite3_eval_init // test1.c:7311:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 104 /* .pInit */)) = sqlite3_explain_init // test1.c:7312:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 120 /* .pInit */)) = sqlite3_fileio_init // test1.c:7313:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 136 /* .pInit */)) = sqlite3_fuzzer_init // test1.c:7314:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 152 /* .pInit */)) = sqlite3_ieee_init // test1.c:7315:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 168 /* .pInit */)) = sqlite3_nextchar_init // test1.c:7316:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 184 /* .pInit */)) = sqlite3_percentile_init // test1.c:7317:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 200 /* .pInit */)) = sqlite3_prefixes_init // test1.c:7319:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 216 /* .pInit */)) = sqlite3_regexp_init // test1.c:7321:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 232 /* .pInit */)) = sqlite3_remember_init // test1.c:7322:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 248 /* .pInit */)) = sqlite3_series_init // test1.c:7323:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 264 /* .pInit */)) = sqlite3_spellfix_init // test1.c:7324:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 280 /* .pInit */)) = sqlite3_totype_init // test1.c:7325:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 296 /* .pInit */)) = sqlite3_unionvtab_init // test1.c:7326:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 312 /* .pInit */)) = sqlite3_wholenumber_init // test1.c:7327:32:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aExtension)) + 328 /* .pInit */)) = sqlite3_zipfile_init // test1.c:7329:32:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 16 /* .xFunc */)) = decimalFunc // decimal.c:607:29:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 40 /* .xFunc */)) = decimalCmpFunc // decimal.c:608:29:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 64 /* .xFunc */)) = decimalAddFunc // decimal.c:609:29:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 88 /* .xFunc */)) = decimalSubFunc // decimal.c:610:29:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 112 /* .xFunc */)) = decimalMulFunc // decimal.c:611:29:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 16 /* .xFunc */)) = ieee754func // ieee754.c:262:36:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 40 /* .xFunc */)) = ieee754func // ieee754.c:263:36:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 64 /* .xFunc */)) = ieee754func // ieee754.c:264:36:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 88 /* .xFunc */)) = ieee754func // ieee754.c:265:36:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 112 /* .xFunc */)) = ieee754func_to_blob // ieee754.c:266:36:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 136 /* .xFunc */)) = ieee754func_from_blob // ieee754.c:267:36:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 16 /* .xFunc */)) = randStr // test_func.c:675:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 40 /* .xFunc */)) = test_destructor // test_func.c:676:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 64 /* .xFunc */)) = test_destructor16 // test_func.c:678:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 88 /* .xFunc */)) = testHexToUtf16be // test_func.c:679:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 112 /* .xFunc */)) = testHexToUtf16le // test_func.c:680:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 136 /* .xFunc */)) = testHexToUtf8 // test_func.c:682:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 160 /* .xFunc */)) = test_destructor_count // test_func.c:683:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 184 /* .xFunc */)) = test_auxdata // test_func.c:684:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 208 /* .xFunc */)) = test_error // test_func.c:685:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 232 /* .xFunc */)) = test_error // test_func.c:686:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 256 /* .xFunc */)) = test_eval // test_func.c:687:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 280 /* .xFunc */)) = test_isolation // test_func.c:688:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 304 /* .xFunc */)) = counterFunc // test_func.c:689:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 328 /* .xFunc */)) = real2hex // test_func.c:690:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 352 /* .xFunc */)) = test_decode // test_func.c:691:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 376 /* .xFunc */)) = test_extract // test_func.c:692:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 400 /* .xFunc */)) = test_zeroblob // test_func.c:693:62:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 424 /* .xFunc */)) = test_getsubtype // test_func.c:694:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 448 /* .xFunc */)) = test_setsubtype // test_func.c:695:48:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFuncs)) + 472 /* .xFunc */)) = test_frombind // test_func.c:696:48:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 8 /* .xProc */)) = test_sqlite3rbu // test_rbu.c:370:21:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 24 /* .xProc */)) = test_sqlite3rbu_vacuum // test_rbu.c:371:28:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 40 /* .xProc */)) = test_sqlite3rbu_create_vfs // test_rbu.c:372:32:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 56 /* .xProc */)) = test_sqlite3rbu_destroy_vfs // test_rbu.c:373:33:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd)) + 72 /* .xProc */)) = test_sqlite3rbu_internal_test // test_rbu.c:374:35:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 8 /* .xProc */)) = test_sqlite3_db_config // test1.c:7987:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 32 /* .xProc */)) = test_bad_behavior // test1.c:7988:41:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 40 /* .clientData */)) = uintptr(unsafe.Pointer(&iZero)) // test1.c:7988:61:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 56 /* .xProc */)) = test_register_dbstat_vtab // test1.c:7989:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 80 /* .xProc */)) = get_sqlite_pointer // test1.c:7990:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 104 /* .xProc */)) = test_intarray_addr // test1.c:7991:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 128 /* .xProc */)) = test_int64array_addr // test1.c:7992:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 152 /* .xProc */)) = test_doublearray_addr // test1.c:7993:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 176 /* .xProc */)) = test_textarray_addr // test1.c:7994:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 200 /* .xProc */)) = test_bind_int // test1.c:7995:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 224 /* .xProc */)) = test_bind_zeroblob // test1.c:7996:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 248 /* .xProc */)) = test_bind_zeroblob64 // test1.c:7997:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 272 /* .xProc */)) = test_bind_int64 // test1.c:7998:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 296 /* .xProc */)) = test_bind_double // test1.c:7999:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 320 /* .xProc */)) = test_bind_null // test1.c:8000:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 344 /* .xProc */)) = test_bind_text // test1.c:8001:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 368 /* .xProc */)) = test_bind_text16 // test1.c:8002:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 392 /* .xProc */)) = test_bind_blob // test1.c:8003:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 416 /* .xProc */)) = test_bind_parameter_count // test1.c:8004:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 440 /* .xProc */)) = test_bind_parameter_name // test1.c:8005:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 464 /* .xProc */)) = test_bind_parameter_index // test1.c:8006:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 488 /* .xProc */)) = test_clear_bindings // test1.c:8007:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 512 /* .xProc */)) = test_sleep // test1.c:8008:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 536 /* .xProc */)) = test_errcode // test1.c:8009:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 560 /* .xProc */)) = test_ex_errcode // test1.c:8010:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 584 /* .xProc */)) = test_errmsg // test1.c:8011:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 608 /* .xProc */)) = test_errmsg16 // test1.c:8012:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 632 /* .xProc */)) = test_open // test1.c:8013:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 656 /* .xProc */)) = test_open16 // test1.c:8014:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 680 /* .xProc */)) = test_open_v2 // test1.c:8015:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 704 /* .xProc */)) = test_complete16 // test1.c:8016:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 728 /* .xProc */)) = test_normalize // test1.c:8017:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 752 /* .xProc */)) = test_prepare // test1.c:8019:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 776 /* .xProc */)) = test_prepare16 // test1.c:8020:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 800 /* .xProc */)) = test_prepare_v2 // test1.c:8021:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 824 /* .xProc */)) = test_prepare_v3 // test1.c:8022:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 848 /* .xProc */)) = test_prepare_tkt3134 // test1.c:8023:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 872 /* .xProc */)) = test_prepare16_v2 // test1.c:8024:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 896 /* .xProc */)) = test_finalize // test1.c:8025:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 920 /* .xProc */)) = test_stmt_status // test1.c:8026:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 944 /* .xProc */)) = test_reset // test1.c:8027:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 968 /* .xProc */)) = test_expired // test1.c:8028:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 992 /* .xProc */)) = test_transfer_bind // test1.c:8029:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1016 /* .xProc */)) = test_changes // test1.c:8030:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1040 /* .xProc */)) = test_step // test1.c:8031:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1064 /* .xProc */)) = test_sql // test1.c:8032:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1088 /* .xProc */)) = test_ex_sql // test1.c:8033:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1112 /* .xProc */)) = test_next_stmt // test1.c:8037:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1136 /* .xProc */)) = test_stmt_readonly // test1.c:8038:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1160 /* .xProc */)) = test_stmt_isexplain // test1.c:8039:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1184 /* .xProc */)) = test_stmt_busy // test1.c:8040:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1208 /* .xProc */)) = uses_stmt_journal // test1.c:8041:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1232 /* .xProc */)) = test_release_memory // test1.c:8043:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1256 /* .xProc */)) = test_db_release_memory // test1.c:8044:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1280 /* .xProc */)) = test_db_cacheflush // test1.c:8045:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1304 /* .xProc */)) = test_system_errno // test1.c:8046:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1328 /* .xProc */)) = test_db_filename // test1.c:8047:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1352 /* .xProc */)) = test_db_readonly // test1.c:8048:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1376 /* .xProc */)) = test_soft_heap_limit // test1.c:8049:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1400 /* .xProc */)) = test_soft_heap_limit // test1.c:8050:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1424 /* .xProc */)) = test_hard_heap_limit // test1.c:8051:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1448 /* .xProc */)) = test_thread_cleanup // test1.c:8052:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1472 /* .xProc */)) = test_pager_refcounts // test1.c:8053:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1496 /* .xProc */)) = test_load_extension // test1.c:8055:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1520 /* .xProc */)) = test_enable_load // test1.c:8056:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1544 /* .xProc */)) = test_extended_result_codes // test1.c:8057:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1568 /* .xProc */)) = test_limit // test1.c:8058:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1592 /* .xProc */)) = test_dbconfig_maindbname_icecube // test1.c:8059:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1616 /* .xProc */)) = save_prng_state // test1.c:8061:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1640 /* .xProc */)) = restore_prng_state // test1.c:8062:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1664 /* .xProc */)) = reset_prng_state // test1.c:8063:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1688 /* .xProc */)) = prng_seed // test1.c:8064:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1712 /* .xProc */)) = extra_schema_checks // test1.c:8065:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1736 /* .xProc */)) = database_never_corrupt // test1.c:8066:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1760 /* .xProc */)) = database_may_be_corrupt // test1.c:8067:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1784 /* .xProc */)) = optimization_control // test1.c:8068:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1808 /* .xProc */)) = runAsObjProc // test1.c:8077:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1832 /* .xProc */)) = test_column_count // test1.c:8080:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1856 /* .xProc */)) = test_data_count // test1.c:8081:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1880 /* .xProc */)) = test_column_type // test1.c:8082:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1904 /* .xProc */)) = test_column_blob // test1.c:8083:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1928 /* .xProc */)) = test_column_double // test1.c:8084:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1952 /* .xProc */)) = test_column_int64 // test1.c:8085:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1976 /* .xProc */)) = test_stmt_utf8 // test1.c:8086:33:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 1984 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{sqlite3.Xsqlite3_column_text})) // test1.c:8086:50:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2000 /* .xProc */)) = test_stmt_utf8 // test1.c:8087:33:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2008 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{sqlite3.Xsqlite3_column_name})) // test1.c:8087:50:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2024 /* .xProc */)) = test_stmt_int // test1.c:8088:33:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2032 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) int32
+ }{sqlite3.Xsqlite3_column_int})) // test1.c:8088:50:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2048 /* .xProc */)) = test_stmt_int // test1.c:8089:33:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2056 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) int32
+ }{sqlite3.Xsqlite3_column_bytes})) // test1.c:8089:50:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2072 /* .xProc */)) = test_stmt_utf8 // test1.c:8091:34:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2080 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{sqlite3.Xsqlite3_column_decltype})) // test1.c:8091:49:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2096 /* .xProc */)) = test_stmt_utf8 // test1.c:8094:34:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2104 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{sqlite3.Xsqlite3_column_database_name})) // test1.c:8094:49:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2120 /* .xProc */)) = test_stmt_utf8 // test1.c:8095:31:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2128 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{sqlite3.Xsqlite3_column_table_name})) // test1.c:8095:46:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2144 /* .xProc */)) = test_stmt_utf8 // test1.c:8096:32:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2152 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{sqlite3.Xsqlite3_column_origin_name})) // test1.c:8096:47:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2168 /* .xProc */)) = test_stmt_int // test1.c:8100:34:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2176 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) int32
+ }{sqlite3.Xsqlite3_column_bytes16})) // test1.c:8100:49:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2192 /* .xProc */)) = test_stmt_utf16 // test1.c:8101:34:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2200 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{sqlite3.Xsqlite3_column_text16})) // test1.c:8101:51:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2216 /* .xProc */)) = test_stmt_utf16 // test1.c:8102:34:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2224 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{sqlite3.Xsqlite3_column_name16})) // test1.c:8102:51:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2240 /* .xProc */)) = add_alignment_test_collations // test1.c:8103:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2264 /* .xProc */)) = test_stmt_utf16 // test1.c:8105:36:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2272 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{sqlite3.Xsqlite3_column_decltype16})) // test1.c:8105:52:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2288 /* .xProc */)) = test_stmt_utf16 // test1.c:8109:3:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2296 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{sqlite3.Xsqlite3_column_database_name16})) // test1.c:8109:20:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2312 /* .xProc */)) = test_stmt_utf16 // test1.c:8110:33:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2320 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{sqlite3.Xsqlite3_column_table_name16})) // test1.c:8110:50:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2336 /* .xProc */)) = test_stmt_utf16 // test1.c:8111:34:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2344 /* .clientData */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32) uintptr
+ }{sqlite3.Xsqlite3_column_origin_name16})) // test1.c:8111:51:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2360 /* .xProc */)) = test_create_collation_v2 // test1.c:8114:39:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2384 /* .xProc */)) = test_global_recover // test1.c:8115:38:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2408 /* .xProc */)) = working_64bit_int // test1.c:8116:38:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2432 /* .xProc */)) = vfs_unlink_test // test1.c:8117:38:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2456 /* .xProc */)) = vfs_initfail_test // test1.c:8118:38:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2480 /* .xProc */)) = vfs_unregister_all // test1.c:8119:38:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2504 /* .xProc */)) = vfs_reregister_all // test1.c:8120:38:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2528 /* .xProc */)) = file_control_test // test1.c:8121:38:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2552 /* .xProc */)) = file_control_lasterrno_test // test1.c:8122:39:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2576 /* .xProc */)) = file_control_lockproxy_test // test1.c:8123:39:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2600 /* .xProc */)) = file_control_chunksize_test // test1.c:8124:39:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2624 /* .xProc */)) = file_control_sizehint_test // test1.c:8125:39:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2648 /* .xProc */)) = file_control_data_version // test1.c:8126:39:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2672 /* .xProc */)) = file_control_persist_wal // test1.c:8132:39:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2696 /* .xProc */)) = file_control_powersafe_overwrite // test1.c:8133:43:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2720 /* .xProc */)) = file_control_vfsname // test1.c:8134:39:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2744 /* .xProc */)) = file_control_tempfilename // test1.c:8135:39:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2768 /* .xProc */)) = vfs_list // test1.c:8136:38:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2792 /* .xProc */)) = test_create_function_v2 // test1.c:8137:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2816 /* .xProc */)) = test_collate // test1.c:8141:35:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2840 /* .xProc */)) = test_collate_needed // test1.c:8142:35:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2864 /* .xProc */)) = test_function // test1.c:8143:35:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2888 /* .xProc */)) = test_utf16bin_collate // test1.c:8144:40:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2912 /* .xProc */)) = test_errstr // test1.c:8146:35:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2936 /* .xProc */)) = tcl_variable_type // test1.c:8147:35:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2960 /* .xProc */)) = test_enable_shared // test1.c:8149:39:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 2984 /* .xProc */)) = sqlite3BtreeSharedCacheReport // test1.c:8150:39:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3008 /* .xProc */)) = test_libversion_number // test1.c:8152:37:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3032 /* .xProc */)) = test_table_column_metadata // test1.c:8153:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3056 /* .xProc */)) = test_blob_reopen // test1.c:8155:31:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3080 /* .xProc */)) = test_pcache_stats // test1.c:8157:30:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3104 /* .xProc */)) = test_unlock_notify // test1.c:8159:33:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3128 /* .xProc */)) = test_wal_checkpoint // test1.c:8161:36:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3152 /* .xProc */)) = test_wal_checkpoint_v2 // test1.c:8162:36:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3176 /* .xProc */)) = test_wal_autocheckpoint // test1.c:8163:37:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3200 /* .xProc */)) = test_sqlite3_log // test1.c:8164:36:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3224 /* .xProc */)) = test_print_eqp // test1.c:8166:36:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3248 /* .xProc */)) = test_test_control // test1.c:8168:32:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3272 /* .xProc */)) = test_getrusage // test1.c:8170:21:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3296 /* .xProc */)) = tclLoadStaticExtensionCmd // test1.c:8172:33:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3320 /* .xProc */)) = sorter_test_fakeheap // test1.c:8173:32:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3344 /* .xProc */)) = sorter_test_sort4_helper // test1.c:8174:36:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3368 /* .xProc */)) = vfsCurrentTimeInt64 // test1.c:8188:44:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3392 /* .xProc */)) = test_snapshot_get // test1.c:8190:32:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3416 /* .xProc */)) = test_snapshot_open // test1.c:8191:33:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3440 /* .xProc */)) = test_snapshot_free // test1.c:8192:33:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3464 /* .xProc */)) = test_snapshot_cmp // test1.c:8193:32:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3488 /* .xProc */)) = test_snapshot_recover // test1.c:8194:36:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3512 /* .xProc */)) = test_snapshot_get_blob // test1.c:8195:37:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3536 /* .xProc */)) = test_snapshot_open_blob // test1.c:8196:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3560 /* .xProc */)) = test_snapshot_cmp_blob // test1.c:8197:37:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3584 /* .xProc */)) = test_delete_database // test1.c:8199:35:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3608 /* .xProc */)) = test_atomic_batch_write // test1.c:8200:35:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3632 /* .xProc */)) = test_mmap_warm // test1.c:8201:35:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3656 /* .xProc */)) = test_config_sorterref // test1.c:8202:36:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3680 /* .xProc */)) = test_decode_hexdb // test1.c:8203:36:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd1)) + 3704 /* .xProc */)) = test_write_db // test1.c:8204:36:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 8 /* .xProc */)) = test_intarray_create // test_intarray.c:381:35:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd10)) + 32 /* .xProc */)) = test_intarray_bind // test_intarray.c:382:33:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 8 /* .xProc */)) = test_malloc // test_malloc.c:1473:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 32 /* .xProc */)) = test_realloc // test_malloc.c:1474:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 56 /* .xProc */)) = test_free // test_malloc.c:1475:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 80 /* .xProc */)) = test_memset // test_malloc.c:1476:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 104 /* .xProc */)) = test_memget // test_malloc.c:1477:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 128 /* .xProc */)) = test_memory_used // test_malloc.c:1478:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 152 /* .xProc */)) = test_memory_highwater // test_malloc.c:1479:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 176 /* .xProc */)) = test_memdebug_backtrace // test_malloc.c:1480:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 200 /* .xProc */)) = test_memdebug_dump // test_malloc.c:1481:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 224 /* .xProc */)) = test_memdebug_fail // test_malloc.c:1482:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 248 /* .xProc */)) = test_memdebug_pending // test_malloc.c:1483:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 272 /* .xProc */)) = test_memdebug_settitle // test_malloc.c:1484:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 296 /* .xProc */)) = test_memdebug_malloc_count // test_malloc.c:1485:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 320 /* .xProc */)) = test_memdebug_log // test_malloc.c:1486:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 344 /* .xProc */)) = test_config_pagecache // test_malloc.c:1487:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 368 /* .xProc */)) = test_alt_pcache // test_malloc.c:1488:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 392 /* .xProc */)) = test_status // test_malloc.c:1489:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 416 /* .xProc */)) = test_db_status // test_malloc.c:1490:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 440 /* .xProc */)) = test_install_malloc_faultsim // test_malloc.c:1491:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 464 /* .xProc */)) = test_config_heap // test_malloc.c:1492:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 488 /* .xProc */)) = test_config_heap_size // test_malloc.c:1493:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 512 /* .xProc */)) = test_config_memstatus // test_malloc.c:1494:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 536 /* .xProc */)) = test_config_lookaside // test_malloc.c:1495:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 560 /* .xProc */)) = test_config_error // test_malloc.c:1496:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 584 /* .xProc */)) = test_config_uri // test_malloc.c:1497:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 608 /* .xProc */)) = test_config_cis // test_malloc.c:1498:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 632 /* .xProc */)) = test_config_pmasz // test_malloc.c:1499:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 656 /* .xProc */)) = test_db_config_lookaside // test_malloc.c:1500:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 680 /* .xProc */)) = test_dump_memsys3 // test_malloc.c:1501:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 704 /* .xProc */)) = test_dump_memsys3 // test_malloc.c:1502:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 728 /* .xProc */)) = test_install_memsys3 // test_malloc.c:1503:38:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd11)) + 752 /* .xProc */)) = test_vfs_oom_test // test_malloc.c:1504:41:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd12)) + 8 /* .xProc */)) = register_schema_module // test_schema.c:336:34:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd13)) + 8 /* .xProc */)) = register_tclvar_module // test_tclvar.c:553:36:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd14)) + 8 /* .xProc */)) = test_create_window // test_window.c:337:42:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd14)) + 32 /* .xProc */)) = test_create_window_misuse // test_window.c:338:46:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd14)) + 56 /* .xProc */)) = test_create_sumint // test_window.c:339:30:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd14)) + 80 /* .xProc */)) = test_override_sum // test_window.c:340:29:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd2)) + 8 /* .xProc */)) = register_echo_module // test8.c:1434:38:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd2)) + 32 /* .xProc */)) = declare_vtab // test8.c:1435:38:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd3)) + 8 /* .xProc */)) = c_misuse_test // test9.c:194:28:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd3)) + 32 /* .xProc */)) = c_realloc_test // test9.c:195:28:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd3)) + 56 /* .xProc */)) = c_collation_test // test9.c:196:28:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd4)) + 8 /* .xProc */)) = register_tcl_module // test_bestindex.c:611:33:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd5)) + 8 /* .xProc */)) = test_blob_open // test_blob.c:318:40:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd5)) + 24 /* .xProc */)) = test_blob_close // test_blob.c:319:40:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd5)) + 40 /* .xProc */)) = test_blob_bytes // test_blob.c:320:40:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd5)) + 56 /* .xProc */)) = test_blob_read // test_blob.c:321:40:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd5)) + 72 /* .xProc */)) = test_blob_write // test_blob.c:322:40:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd6)) + 8 /* .xProc */)) = register_fs_module // test_fs.c:908:32:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd7)) + 8 /* .xProc */)) = autoinstall_test_funcs // test_func.c:938:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd7)) + 24 /* .xProc */)) = abuse_create_function // test_func.c:939:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd7)) + 40 /* .xProc */)) = install_fts3_rank_function // test_func.c:940:41:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd8)) + 8 /* .xProc */)) = hexio_read // test_hexio.c:451:40:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd8)) + 24 /* .xProc */)) = hexio_write // test_hexio.c:452:40:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd8)) + 40 /* .xProc */)) = hexio_get_int // test_hexio.c:453:40:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd8)) + 56 /* .xProc */)) = hexio_render_int16 // test_hexio.c:454:40:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd8)) + 72 /* .xProc */)) = hexio_render_int32 // test_hexio.c:455:40:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd8)) + 88 /* .xProc */)) = utf8_to_utf8 // test_hexio.c:456:40:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd8)) + 104 /* .xProc */)) = read_fts3varint // test_hexio.c:457:40:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd8)) + 120 /* .xProc */)) = make_fts3record // test_hexio.c:458:40:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd9)) + 8 /* .xProc */)) = init_wrapper_install // test_init.c:283:32:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd9)) + 24 /* .xProc */)) = init_wrapper_query // test_init.c:284:32:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd9)) + 40 /* .xProc */)) = init_wrapper_uninstall // test_init.c:285:32:
+ *(*func(*libc.TLS, ClientData, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aObjCmd9)) + 56 /* .xProc */)) = init_wrapper_clear // test_init.c:286:32:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, int32) int32
+ f func(*libc.TLS, uintptr, int32, int32) int32
}{ts_open})) // test_syscall.c:134:27:
- *(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 40 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, int32) int32 }{ts_close})) // test_syscall.c:135:27:
+ *(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 40 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{ts_close})) // test_syscall.c:135:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 72 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{ts_access})) // test_syscall.c:136:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 104 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, size_t) uintptr
+ f func(*libc.TLS, uintptr, size_t) uintptr
}{ts_getcwd})) // test_syscall.c:137:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 136 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{ts_stat})) // test_syscall.c:138:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 168 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr) int32
+ f func(*libc.TLS, int32, uintptr) int32
}{ts_fstat})) // test_syscall.c:139:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 200 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, off_t) int32
+ f func(*libc.TLS, int32, off_t) int32
}{ts_ftruncate})) // test_syscall.c:140:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 232 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, int32, uintptr) int32
+ f func(*libc.TLS, int32, int32, uintptr) int32
}{ts_fcntl})) // test_syscall.c:141:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 264 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr, size_t) int32
+ f func(*libc.TLS, int32, uintptr, size_t) int32
}{ts_read})) // test_syscall.c:142:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 296 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr, size_t, off_t) int32
+ f func(*libc.TLS, int32, uintptr, size_t, off_t) int32
}{ts_pread})) // test_syscall.c:143:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 328 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr, size_t, sqlite3_uint64) int32
+ f func(*libc.TLS, int32, uintptr, size_t, sqlite3_uint64) int32
}{ts_pread64})) // test_syscall.c:144:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 360 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr, size_t) int32
+ f func(*libc.TLS, int32, uintptr, size_t) int32
}{ts_write})) // test_syscall.c:145:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 392 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr, size_t, off_t) int32
+ f func(*libc.TLS, int32, uintptr, size_t, off_t) int32
}{ts_pwrite})) // test_syscall.c:146:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 424 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr, size_t, sqlite3_uint64) int32
+ f func(*libc.TLS, int32, uintptr, size_t, sqlite3_uint64) int32
}{ts_pwrite64})) // test_syscall.c:147:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 456 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, mode_t) int32
+ f func(*libc.TLS, int32, mode_t) int32
}{ts_fchmod})) // test_syscall.c:148:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 488 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, off_t, off_t) int32
+ f func(*libc.TLS, int32, off_t, off_t) int32
}{ts_fallocate})) // test_syscall.c:149:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 520 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, size_t, int32, int32, int32, off_t) uintptr
+ f func(*libc.TLS, uintptr, size_t, int32, int32, int32, off_t) uintptr
}{ts_mmap})) // test_syscall.c:150:27:
*(*sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 552 /* .xTest */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, size_t, size_t, int32, uintptr) uintptr
+ f func(*libc.TLS, uintptr, size_t, size_t, int32, uintptr) uintptr
}{ts_mremap})) // test_syscall.c:151:27:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 8 /* .xCreate */)) = amatchConnect // amatch.c:1456:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 16 /* .xConnect */)) = amatchConnect // amatch.c:1457:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 24 /* .xBestIndex */)) = amatchBestIndex // amatch.c:1458:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 32 /* .xDisconnect */)) = amatchDisconnect // amatch.c:1459:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 40 /* .xDestroy */)) = amatchDisconnect // amatch.c:1460:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 48 /* .xOpen */)) = amatchOpen // amatch.c:1461:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 56 /* .xClose */)) = amatchClose // amatch.c:1462:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 64 /* .xFilter */)) = amatchFilter // amatch.c:1463:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 72 /* .xNext */)) = amatchNext // amatch.c:1464:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 80 /* .xEof */)) = amatchEof // amatch.c:1465:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 88 /* .xColumn */)) = amatchColumn // amatch.c:1466:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 96 /* .xRowid */)) = amatchRowid // amatch.c:1467:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 104 /* .xUpdate */)) = amatchUpdate // amatch.c:1468:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 16 /* .xConnect */)) = carrayConnect // carray.c:336:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 24 /* .xBestIndex */)) = carrayBestIndex // carray.c:337:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 32 /* .xDisconnect */)) = carrayDisconnect // carray.c:338:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 48 /* .xOpen */)) = carrayOpen // carray.c:340:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 56 /* .xClose */)) = carrayClose // carray.c:341:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 64 /* .xFilter */)) = carrayFilter // carray.c:342:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 72 /* .xNext */)) = carrayNext // carray.c:343:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 80 /* .xEof */)) = carrayEof // carray.c:344:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 88 /* .xColumn */)) = carrayColumn // carray.c:345:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 96 /* .xRowid */)) = carrayRowid // carray.c:346:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 8 /* .xCreate */)) = closureConnect // closure.c:920:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 16 /* .xConnect */)) = closureConnect // closure.c:921:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 24 /* .xBestIndex */)) = closureBestIndex // closure.c:922:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 32 /* .xDisconnect */)) = closureDisconnect // closure.c:923:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 40 /* .xDestroy */)) = closureDisconnect // closure.c:924:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 48 /* .xOpen */)) = closureOpen // closure.c:925:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 56 /* .xClose */)) = closureClose // closure.c:926:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 64 /* .xFilter */)) = closureFilter // closure.c:927:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 72 /* .xNext */)) = closureNext // closure.c:928:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 80 /* .xEof */)) = closureEof // closure.c:929:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 88 /* .xColumn */)) = closureColumn // closure.c:930:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 96 /* .xRowid */)) = closureRowid // closure.c:931:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 40 /* .xOpen */)) = cfOpen // test6.c:853:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 48 /* .xDelete */)) = cfDelete // test6.c:854:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 56 /* .xAccess */)) = cfAccess // test6.c:855:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 64 /* .xFullPathname */)) = cfFullPathname // test6.c:856:5:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 72 /* .xDlOpen */)) = cfDlOpen // test6.c:857:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 80 /* .xDlError */)) = cfDlError // test6.c:858:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 88 /* .xDlSym */)) = cfDlSym // test6.c:859:5:
- *(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 96 /* .xDlClose */)) = cfDlClose // test6.c:860:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 104 /* .xRandomness */)) = cfRandomness // test6.c:861:5:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 112 /* .xSleep */)) = cfSleep // test6.c:862:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 120 /* .xCurrentTime */)) = cfCurrentTime // test6.c:863:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 128 /* .xGetLastError */)) = cfGetLastError // test6.c:864:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 8 /* .xClose */)) = demoClose // test_demovfs.c:402:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 16 /* .xRead */)) = demoRead // test_demovfs.c:403:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 24 /* .xWrite */)) = demoWrite // test_demovfs.c:404:5:
- *(*func(*crt.TLS, uintptr, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 32 /* .xTruncate */)) = demoTruncate // test_demovfs.c:405:5:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 40 /* .xSync */)) = demoSync // test_demovfs.c:406:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 48 /* .xFileSize */)) = demoFileSize // test_demovfs.c:407:5:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 56 /* .xLock */)) = demoLock // test_demovfs.c:408:5:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 64 /* .xUnlock */)) = demoUnlock // test_demovfs.c:409:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 72 /* .xCheckReservedLock */)) = demoCheckReservedLock // test_demovfs.c:410:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 80 /* .xFileControl */)) = demoFileControl // test_demovfs.c:411:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 88 /* .xSectorSize */)) = demoSectorSize // test_demovfs.c:412:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 96 /* .xDeviceCharacteristics */)) = demoDeviceCharacteristics // test_demovfs.c:413:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 40 /* .xOpen */)) = demoOpen // test_demovfs.c:627:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 48 /* .xDelete */)) = demoDelete // test_demovfs.c:628:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 56 /* .xAccess */)) = demoAccess // test_demovfs.c:629:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 64 /* .xFullPathname */)) = demoFullPathname // test_demovfs.c:630:5:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 72 /* .xDlOpen */)) = demoDlOpen // test_demovfs.c:631:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 80 /* .xDlError */)) = demoDlError // test_demovfs.c:632:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 88 /* .xDlSym */)) = demoDlSym // test_demovfs.c:633:5:
- *(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 96 /* .xDlClose */)) = demoDlClose // test_demovfs.c:634:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 104 /* .xRandomness */)) = demoRandomness // test_demovfs.c:635:5:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 112 /* .xSleep */)) = demoSleep // test_demovfs.c:636:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 120 /* .xCurrentTime */)) = demoCurrentTime // test_demovfs.c:637:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 8 /* .xClose */)) = devsymClose // test_devsym.c:229:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 16 /* .xRead */)) = devsymRead // test_devsym.c:230:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 24 /* .xWrite */)) = devsymWrite // test_devsym.c:231:3:
- *(*func(*crt.TLS, uintptr, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 32 /* .xTruncate */)) = devsymTruncate // test_devsym.c:232:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 40 /* .xSync */)) = devsymSync // test_devsym.c:233:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 48 /* .xFileSize */)) = devsymFileSize // test_devsym.c:234:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 56 /* .xLock */)) = devsymLock // test_devsym.c:235:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 64 /* .xUnlock */)) = devsymUnlock // test_devsym.c:236:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 72 /* .xCheckReservedLock */)) = devsymCheckReservedLock // test_devsym.c:237:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 80 /* .xFileControl */)) = devsymFileControl // test_devsym.c:238:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 88 /* .xSectorSize */)) = devsymSectorSize // test_devsym.c:239:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 96 /* .xDeviceCharacteristics */)) = devsymDeviceCharacteristics // test_devsym.c:240:3:
- *(*func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 104 /* .xShmMap */)) = devsymShmMap // test_devsym.c:241:3:
- *(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 112 /* .xShmLock */)) = devsymShmLock // test_devsym.c:242:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 120 /* .xShmBarrier */)) = devsymShmBarrier // test_devsym.c:243:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 128 /* .xShmUnmap */)) = devsymShmUnmap // test_devsym.c:244:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 40 /* .xOpen */)) = devsymOpen // test_devsym.c:428:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 48 /* .xDelete */)) = devsymDelete // test_devsym.c:429:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 56 /* .xAccess */)) = devsymAccess // test_devsym.c:430:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 64 /* .xFullPathname */)) = devsymFullPathname // test_devsym.c:431:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 104 /* .xRandomness */)) = devsymRandomness // test_devsym.c:443:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 112 /* .xSleep */)) = devsymSleep // test_devsym.c:444:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 120 /* .xCurrentTime */)) = devsymCurrentTime // test_devsym.c:445:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 8 /* .xCreate */)) = echoCreate // test8.c:1301:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 16 /* .xConnect */)) = echoConnect // test8.c:1302:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 24 /* .xBestIndex */)) = echoBestIndex // test8.c:1303:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 32 /* .xDisconnect */)) = echoDisconnect // test8.c:1304:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 40 /* .xDestroy */)) = echoDestroy // test8.c:1305:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 48 /* .xOpen */)) = echoOpen // test8.c:1306:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 56 /* .xClose */)) = echoClose // test8.c:1307:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 64 /* .xFilter */)) = echoFilter // test8.c:1308:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 72 /* .xNext */)) = echoNext // test8.c:1309:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 80 /* .xEof */)) = echoEof // test8.c:1310:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 88 /* .xColumn */)) = echoColumn // test8.c:1311:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 96 /* .xRowid */)) = echoRowid // test8.c:1312:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 104 /* .xUpdate */)) = echoUpdate // test8.c:1313:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 112 /* .xBegin */)) = echoBegin // test8.c:1314:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 120 /* .xSync */)) = echoSync // test8.c:1315:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 128 /* .xCommit */)) = echoCommit // test8.c:1316:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 136 /* .xRollback */)) = echoRollback // test8.c:1317:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 144 /* .xFindFunction */)) = echoFindFunction // test8.c:1318:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 152 /* .xRename */)) = echoRename // test8.c:1319:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 8 /* .xCreate */)) = echoCreate // test8.c:1324:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 16 /* .xConnect */)) = echoConnect // test8.c:1325:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 24 /* .xBestIndex */)) = echoBestIndex // test8.c:1326:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 32 /* .xDisconnect */)) = echoDisconnect // test8.c:1327:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 40 /* .xDestroy */)) = echoDestroy // test8.c:1328:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 48 /* .xOpen */)) = echoOpen // test8.c:1329:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 56 /* .xClose */)) = echoClose // test8.c:1330:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 64 /* .xFilter */)) = echoFilter // test8.c:1331:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 72 /* .xNext */)) = echoNext // test8.c:1332:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 80 /* .xEof */)) = echoEof // test8.c:1333:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 88 /* .xColumn */)) = echoColumn // test8.c:1334:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 96 /* .xRowid */)) = echoRowid // test8.c:1335:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 104 /* .xUpdate */)) = echoUpdate // test8.c:1336:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 112 /* .xBegin */)) = echoBegin // test8.c:1337:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 120 /* .xSync */)) = echoSync // test8.c:1338:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 128 /* .xCommit */)) = echoCommit // test8.c:1339:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 136 /* .xRollback */)) = echoRollback // test8.c:1340:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 144 /* .xFindFunction */)) = echoFindFunction // test8.c:1341:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 152 /* .xRename */)) = echoRename // test8.c:1342:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 160 /* .xSavepoint */)) = echoSavepoint // test8.c:1343:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 168 /* .xRelease */)) = echoRelease // test8.c:1344:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 176 /* .xRollbackTo */)) = echoRollbackTo // test8.c:1345:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 8 /* .xCreate */)) = expertConnect // sqlite3expert.c:625:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 16 /* .xConnect */)) = expertConnect // sqlite3expert.c:626:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 24 /* .xBestIndex */)) = expertBestIndex // sqlite3expert.c:627:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 32 /* .xDisconnect */)) = expertDisconnect // sqlite3expert.c:628:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 40 /* .xDestroy */)) = expertDisconnect // sqlite3expert.c:629:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 48 /* .xOpen */)) = expertOpen // sqlite3expert.c:630:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 56 /* .xClose */)) = expertClose // sqlite3expert.c:631:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 64 /* .xFilter */)) = expertFilter // sqlite3expert.c:632:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 72 /* .xNext */)) = expertNext // sqlite3expert.c:633:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 80 /* .xEof */)) = expertEof // sqlite3expert.c:634:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 88 /* .xColumn */)) = expertColumn // sqlite3expert.c:635:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 96 /* .xRowid */)) = expertRowid // sqlite3expert.c:636:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 104 /* .xUpdate */)) = expertUpdate // sqlite3expert.c:637:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 16 /* .xConnect */)) = explainConnect // explain.c:274:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 24 /* .xBestIndex */)) = explainBestIndex // explain.c:275:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 32 /* .xDisconnect */)) = explainDisconnect // explain.c:276:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 48 /* .xOpen */)) = explainOpen // explain.c:278:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 56 /* .xClose */)) = explainClose // explain.c:279:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 64 /* .xFilter */)) = explainFilter // explain.c:280:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 72 /* .xNext */)) = explainNext // explain.c:281:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 80 /* .xEof */)) = explainEof // explain.c:282:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 88 /* .xColumn */)) = explainColumn // explain.c:283:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 96 /* .xRowid */)) = explainRowid // explain.c:284:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 8 /* .xCreate */)) = fsConnect // test_fs.c:800:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 16 /* .xConnect */)) = fsConnect // test_fs.c:801:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 24 /* .xBestIndex */)) = fsBestIndex // test_fs.c:802:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 32 /* .xDisconnect */)) = fsDisconnect // test_fs.c:803:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 40 /* .xDestroy */)) = fsDisconnect // test_fs.c:804:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 48 /* .xOpen */)) = fsOpen // test_fs.c:805:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 56 /* .xClose */)) = fsClose // test_fs.c:806:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 64 /* .xFilter */)) = fsFilter // test_fs.c:807:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 72 /* .xNext */)) = fsNext // test_fs.c:808:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 80 /* .xEof */)) = fsEof // test_fs.c:809:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 88 /* .xColumn */)) = fsColumn // test_fs.c:810:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 96 /* .xRowid */)) = fsRowid // test_fs.c:811:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 8 /* .xClose */)) = fsClose1 // test_onefile.c:210:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 16 /* .xRead */)) = fsRead // test_onefile.c:211:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 24 /* .xWrite */)) = fsWrite // test_onefile.c:212:3:
- *(*func(*crt.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 32 /* .xTruncate */)) = fsTruncate // test_onefile.c:213:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 40 /* .xSync */)) = fsSync // test_onefile.c:214:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 48 /* .xFileSize */)) = fsFileSize // test_onefile.c:215:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 56 /* .xLock */)) = fsLock // test_onefile.c:216:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 64 /* .xUnlock */)) = fsUnlock // test_onefile.c:217:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 72 /* .xCheckReservedLock */)) = fsCheckReservedLock // test_onefile.c:218:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 80 /* .xFileControl */)) = fsFileControl // test_onefile.c:219:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 88 /* .xSectorSize */)) = fsSectorSize // test_onefile.c:220:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 96 /* .xDeviceCharacteristics */)) = fsDeviceCharacteristics // test_onefile.c:221:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 40 /* .xOpen */)) = fsOpen1 // test_onefile.c:191:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 48 /* .xDelete */)) = fsDelete // test_onefile.c:192:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 56 /* .xAccess */)) = fsAccess // test_onefile.c:193:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 64 /* .xFullPathname */)) = fsFullPathname // test_onefile.c:194:5:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 72 /* .xDlOpen */)) = fsDlOpen // test_onefile.c:195:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 80 /* .xDlError */)) = fsDlError // test_onefile.c:196:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 88 /* .xDlSym */)) = fsDlSym // test_onefile.c:197:5:
- *(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 96 /* .xDlClose */)) = fsDlClose // test_onefile.c:198:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 104 /* .xRandomness */)) = fsRandomness // test_onefile.c:199:5:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 112 /* .xSleep */)) = fsSleep // test_onefile.c:200:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 120 /* .xCurrentTime */)) = fsCurrentTime // test_onefile.c:201:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 8 /* .xCreate */)) = fsdirConnect1 // test_fs.c:823:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 16 /* .xConnect */)) = fsdirConnect1 // test_fs.c:824:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 24 /* .xBestIndex */)) = fsdirBestIndex1 // test_fs.c:825:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 32 /* .xDisconnect */)) = fsdirDisconnect1 // test_fs.c:826:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 40 /* .xDestroy */)) = fsdirDisconnect1 // test_fs.c:827:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 48 /* .xOpen */)) = fsdirOpen1 // test_fs.c:828:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 56 /* .xClose */)) = fsdirClose1 // test_fs.c:829:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 64 /* .xFilter */)) = fsdirFilter1 // test_fs.c:830:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 72 /* .xNext */)) = fsdirNext1 // test_fs.c:831:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 80 /* .xEof */)) = fsdirEof1 // test_fs.c:832:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 88 /* .xColumn */)) = fsdirColumn1 // test_fs.c:833:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 96 /* .xRowid */)) = fsdirRowid1 // test_fs.c:834:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 16 /* .xConnect */)) = fsdirConnect // fileio.c:942:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 24 /* .xBestIndex */)) = fsdirBestIndex // fileio.c:943:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 32 /* .xDisconnect */)) = fsdirDisconnect // fileio.c:944:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 48 /* .xOpen */)) = fsdirOpen // fileio.c:946:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 56 /* .xClose */)) = fsdirClose // fileio.c:947:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 64 /* .xFilter */)) = fsdirFilter // fileio.c:948:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 72 /* .xNext */)) = fsdirNext // fileio.c:949:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 80 /* .xEof */)) = fsdirEof // fileio.c:950:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 88 /* .xColumn */)) = fsdirColumn // fileio.c:951:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 96 /* .xRowid */)) = fsdirRowid // fileio.c:952:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 8 /* .xCreate */)) = fstreeConnect // test_fs.c:846:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 16 /* .xConnect */)) = fstreeConnect // test_fs.c:847:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 24 /* .xBestIndex */)) = fstreeBestIndex // test_fs.c:848:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 32 /* .xDisconnect */)) = fstreeDisconnect // test_fs.c:849:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 40 /* .xDestroy */)) = fstreeDisconnect // test_fs.c:850:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 48 /* .xOpen */)) = fstreeOpen // test_fs.c:851:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 56 /* .xClose */)) = fstreeClose // test_fs.c:852:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 64 /* .xFilter */)) = fstreeFilter // test_fs.c:853:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 72 /* .xNext */)) = fstreeNext // test_fs.c:854:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 80 /* .xEof */)) = fstreeEof // test_fs.c:855:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 88 /* .xColumn */)) = fstreeColumn // test_fs.c:856:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 96 /* .xRowid */)) = fstreeRowid // test_fs.c:857:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 8 /* .xCreate */)) = fuzzerConnect // fuzzer.c:1149:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 16 /* .xConnect */)) = fuzzerConnect // fuzzer.c:1150:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 24 /* .xBestIndex */)) = fuzzerBestIndex // fuzzer.c:1151:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 32 /* .xDisconnect */)) = fuzzerDisconnect // fuzzer.c:1152:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 40 /* .xDestroy */)) = fuzzerDisconnect // fuzzer.c:1153:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 48 /* .xOpen */)) = fuzzerOpen // fuzzer.c:1154:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 56 /* .xClose */)) = fuzzerClose // fuzzer.c:1155:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 64 /* .xFilter */)) = fuzzerFilter // fuzzer.c:1156:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 72 /* .xNext */)) = fuzzerNext // fuzzer.c:1157:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 80 /* .xEof */)) = fuzzerEof // fuzzer.c:1158:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 88 /* .xColumn */)) = fuzzerColumn // fuzzer.c:1159:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 96 /* .xRowid */)) = fuzzerRowid // fuzzer.c:1160:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 8 /* .xCreate */)) = intarrayCreate // test_intarray.c:189:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 16 /* .xConnect */)) = intarrayCreate // test_intarray.c:190:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 24 /* .xBestIndex */)) = intarrayBestIndex // test_intarray.c:191:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 32 /* .xDisconnect */)) = intarrayDestroy // test_intarray.c:192:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 40 /* .xDestroy */)) = intarrayDestroy // test_intarray.c:193:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 48 /* .xOpen */)) = intarrayOpen // test_intarray.c:194:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 56 /* .xClose */)) = intarrayClose // test_intarray.c:195:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 64 /* .xFilter */)) = intarrayFilter // test_intarray.c:196:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 72 /* .xNext */)) = intarrayNext // test_intarray.c:197:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 80 /* .xEof */)) = intarrayEof // test_intarray.c:198:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 88 /* .xColumn */)) = intarrayColumn // test_intarray.c:199:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 96 /* .xRowid */)) = intarrayRowid // test_intarray.c:200:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 8 /* .xClose */)) = jtClose // test_journal.c:189:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 16 /* .xRead */)) = jtRead // test_journal.c:190:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 24 /* .xWrite */)) = jtWrite // test_journal.c:191:3:
- *(*func(*crt.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 32 /* .xTruncate */)) = jtTruncate // test_journal.c:192:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 40 /* .xSync */)) = jtSync // test_journal.c:193:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 48 /* .xFileSize */)) = jtFileSize // test_journal.c:194:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 56 /* .xLock */)) = jtLock // test_journal.c:195:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 64 /* .xUnlock */)) = jtUnlock // test_journal.c:196:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 72 /* .xCheckReservedLock */)) = jtCheckReservedLock // test_journal.c:197:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 80 /* .xFileControl */)) = jtFileControl // test_journal.c:198:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 88 /* .xSectorSize */)) = jtSectorSize // test_journal.c:199:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 96 /* .xDeviceCharacteristics */)) = jtDeviceCharacteristics // test_journal.c:200:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 40 /* .xOpen */)) = jtOpen // test_journal.c:172:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 48 /* .xDelete */)) = jtDelete // test_journal.c:173:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 56 /* .xAccess */)) = jtAccess // test_journal.c:174:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 64 /* .xFullPathname */)) = jtFullPathname // test_journal.c:175:3:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 72 /* .xDlOpen */)) = jtDlOpen // test_journal.c:176:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 80 /* .xDlError */)) = jtDlError // test_journal.c:177:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 88 /* .xDlSym */)) = jtDlSym // test_journal.c:178:3:
- *(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 96 /* .xDlClose */)) = jtDlClose // test_journal.c:179:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 104 /* .xRandomness */)) = jtRandomness // test_journal.c:180:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 112 /* .xSleep */)) = jtSleep // test_journal.c:181:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 120 /* .xCurrentTime */)) = jtCurrentTime // test_journal.c:182:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 128 /* .xGetLastError */)) = jtGetLastError // test_journal.c:183:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 136 /* .xCurrentTimeInt64 */)) = jtCurrentTimeInt64 // test_journal.c:184:3:
- *(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&m)) + 0 /* .xMalloc */)) = faultsimMalloc // test_malloc.c:208:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&m)) + 8 /* .xFree */)) = faultsimFree // test_malloc.c:209:5:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&m)) + 16 /* .xRealloc */)) = faultsimRealloc // test_malloc.c:210:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&m)) + 24 /* .xSize */)) = faultsimSize // test_malloc.c:211:5:
- *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&m)) + 32 /* .xRoundup */)) = faultsimRoundup // test_malloc.c:212:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&m)) + 40 /* .xInit */)) = faultsimInit // test_malloc.c:213:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&m)) + 48 /* .xShutdown */)) = faultsimShutdown // test_malloc.c:214:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 16 /* .xConnect */)) = prefixesConnect // prefixes.c:230:21:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 24 /* .xBestIndex */)) = prefixesBestIndex // prefixes.c:231:21:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 32 /* .xDisconnect */)) = prefixesDisconnect // prefixes.c:232:21:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 48 /* .xOpen */)) = prefixesOpen // prefixes.c:234:21:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 56 /* .xClose */)) = prefixesClose // prefixes.c:235:21:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 64 /* .xFilter */)) = prefixesFilter // prefixes.c:236:21:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 72 /* .xNext */)) = prefixesNext // prefixes.c:237:21:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 80 /* .xEof */)) = prefixesEof // prefixes.c:238:21:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 88 /* .xColumn */)) = prefixesColumn // prefixes.c:239:21:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 96 /* .xRowid */)) = prefixesRowid // prefixes.c:240:21:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&pzNeededCollation)) + 0)) = uintptr(unsafe.Pointer(&zNeededCollation)) // test1.c:3130:34:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 8 /* .xCreate */)) = schemaCreate // test_schema.c:276:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 16 /* .xConnect */)) = schemaCreate // test_schema.c:277:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 24 /* .xBestIndex */)) = schemaBestIndex // test_schema.c:278:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 32 /* .xDisconnect */)) = schemaDestroy // test_schema.c:279:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 40 /* .xDestroy */)) = schemaDestroy // test_schema.c:280:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 48 /* .xOpen */)) = schemaOpen // test_schema.c:281:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 56 /* .xClose */)) = schemaClose // test_schema.c:282:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 64 /* .xFilter */)) = schemaFilter // test_schema.c:283:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 72 /* .xNext */)) = schemaNext // test_schema.c:284:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 80 /* .xEof */)) = schemaEof // test_schema.c:285:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 88 /* .xColumn */)) = schemaColumn // test_schema.c:286:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 96 /* .xRowid */)) = schemaRowid // test_schema.c:287:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 16 /* .xConnect */)) = seriesConnect // series.c:383:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 24 /* .xBestIndex */)) = seriesBestIndex // series.c:384:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 32 /* .xDisconnect */)) = seriesDisconnect // series.c:385:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 48 /* .xOpen */)) = seriesOpen // series.c:387:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 56 /* .xClose */)) = seriesClose // series.c:388:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 64 /* .xFilter */)) = seriesFilter // series.c:389:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 72 /* .xNext */)) = seriesNext // series.c:390:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 80 /* .xEof */)) = seriesEof // series.c:391:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 88 /* .xColumn */)) = seriesColumn // series.c:392:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 96 /* .xRowid */)) = seriesRowid // series.c:393:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 8 /* .xCreate */)) = spellfix1Create // spellfix.c:2993:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 16 /* .xConnect */)) = spellfix1Connect // spellfix.c:2994:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 24 /* .xBestIndex */)) = spellfix1BestIndex // spellfix.c:2995:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 32 /* .xDisconnect */)) = spellfix1Disconnect // spellfix.c:2996:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 40 /* .xDestroy */)) = spellfix1Destroy // spellfix.c:2997:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 48 /* .xOpen */)) = spellfix1Open // spellfix.c:2998:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 56 /* .xClose */)) = spellfix1Close // spellfix.c:2999:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 64 /* .xFilter */)) = spellfix1Filter // spellfix.c:3000:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 72 /* .xNext */)) = spellfix1Next // spellfix.c:3001:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 80 /* .xEof */)) = spellfix1Eof // spellfix.c:3002:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 88 /* .xColumn */)) = spellfix1Column // spellfix.c:3003:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 96 /* .xRowid */)) = spellfix1Rowid // spellfix.c:3004:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 104 /* .xUpdate */)) = spellfix1Update // spellfix.c:3005:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 152 /* .xRename */)) = spellfix1Rename // spellfix.c:3011:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 8 /* .xCreate */)) = tclConnect // test_bestindex.c:551:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 16 /* .xConnect */)) = tclConnect // test_bestindex.c:552:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 24 /* .xBestIndex */)) = tclBestIndex // test_bestindex.c:553:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 32 /* .xDisconnect */)) = tclDisconnect // test_bestindex.c:554:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 40 /* .xDestroy */)) = tclDisconnect // test_bestindex.c:555:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 48 /* .xOpen */)) = tclOpen // test_bestindex.c:556:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 56 /* .xClose */)) = tclClose // test_bestindex.c:557:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 64 /* .xFilter */)) = tclFilter // test_bestindex.c:558:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 72 /* .xNext */)) = tclNext // test_bestindex.c:559:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 80 /* .xEof */)) = tclEof // test_bestindex.c:560:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 88 /* .xColumn */)) = tclColumn // test_bestindex.c:561:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 96 /* .xRowid */)) = tclRowid // test_bestindex.c:562:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 8 /* .xCreate */)) = tclvarConnect // test_tclvar.c:471:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 16 /* .xConnect */)) = tclvarConnect // test_tclvar.c:472:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 24 /* .xBestIndex */)) = tclvarBestIndex // test_tclvar.c:473:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 32 /* .xDisconnect */)) = tclvarDisconnect // test_tclvar.c:474:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 40 /* .xDestroy */)) = tclvarDisconnect // test_tclvar.c:475:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 48 /* .xOpen */)) = tclvarOpen // test_tclvar.c:476:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 56 /* .xClose */)) = tclvarClose // test_tclvar.c:477:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 64 /* .xFilter */)) = tclvarFilter // test_tclvar.c:478:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 72 /* .xNext */)) = tclvarNext // test_tclvar.c:479:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 80 /* .xEof */)) = tclvarEof // test_tclvar.c:480:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 88 /* .xColumn */)) = tclvarColumn // test_tclvar.c:481:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 96 /* .xRowid */)) = tclvarRowid // test_tclvar.c:482:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 104 /* .xUpdate */)) = tclvarUpdate // test_tclvar.c:483:3:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 8 /* .pArg */)) = uintptr(unsafe.Pointer(&testpcacheGlobal)) // test_pcache.c:435:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 16 /* .xInit */)) = testpcacheInit // test_pcache.c:436:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 24 /* .xShutdown */)) = testpcacheShutdown // test_pcache.c:437:5:
- *(*func(*crt.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 32 /* .xCreate */)) = testpcacheCreate // test_pcache.c:438:5:
- *(*func(*crt.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 40 /* .xCachesize */)) = testpcacheCachesize // test_pcache.c:439:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 48 /* .xPagecount */)) = testpcachePagecount // test_pcache.c:440:5:
- *(*func(*crt.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 56 /* .xFetch */)) = testpcacheFetch // test_pcache.c:441:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 64 /* .xUnpin */)) = testpcacheUnpin // test_pcache.c:442:5:
- *(*func(*crt.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 72 /* .xRekey */)) = testpcacheRekey // test_pcache.c:443:5:
- *(*func(*crt.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 80 /* .xTruncate */)) = testpcacheTruncate // test_pcache.c:444:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 88 /* .xDestroy */)) = testpcacheDestroy // test_pcache.c:445:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 8 /* .xClose */)) = tmpClose // test_onefile.c:231:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 16 /* .xRead */)) = tmpRead // test_onefile.c:232:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 24 /* .xWrite */)) = tmpWrite // test_onefile.c:233:3:
- *(*func(*crt.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 32 /* .xTruncate */)) = tmpTruncate // test_onefile.c:234:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 40 /* .xSync */)) = tmpSync // test_onefile.c:235:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 48 /* .xFileSize */)) = tmpFileSize // test_onefile.c:236:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 56 /* .xLock */)) = tmpLock // test_onefile.c:237:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 64 /* .xUnlock */)) = tmpUnlock // test_onefile.c:238:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 72 /* .xCheckReservedLock */)) = tmpCheckReservedLock // test_onefile.c:239:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 80 /* .xFileControl */)) = tmpFileControl // test_onefile.c:240:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 88 /* .xSectorSize */)) = tmpSectorSize // test_onefile.c:241:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 96 /* .xDeviceCharacteristics */)) = tmpDeviceCharacteristics // test_onefile.c:242:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 8 /* .xClose */)) = tvfsClose // test_vfs.c:206:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 16 /* .xRead */)) = tvfsRead // test_vfs.c:207:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 24 /* .xWrite */)) = tvfsWrite // test_vfs.c:208:3:
- *(*func(*crt.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 32 /* .xTruncate */)) = tvfsTruncate // test_vfs.c:209:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 40 /* .xSync */)) = tvfsSync // test_vfs.c:210:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 48 /* .xFileSize */)) = tvfsFileSize // test_vfs.c:211:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 56 /* .xLock */)) = tvfsLock // test_vfs.c:212:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 64 /* .xUnlock */)) = tvfsUnlock // test_vfs.c:213:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 72 /* .xCheckReservedLock */)) = tvfsCheckReservedLock // test_vfs.c:214:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 80 /* .xFileControl */)) = tvfsFileControl // test_vfs.c:215:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 88 /* .xSectorSize */)) = tvfsSectorSize // test_vfs.c:216:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 96 /* .xDeviceCharacteristics */)) = tvfsDeviceCharacteristics // test_vfs.c:217:3:
- *(*func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 104 /* .xShmMap */)) = tvfsShmMap // test_vfs.c:218:3:
- *(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 112 /* .xShmLock */)) = tvfsShmLock // test_vfs.c:219:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 120 /* .xShmBarrier */)) = tvfsShmBarrier // test_vfs.c:220:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 128 /* .xShmUnmap */)) = tvfsShmUnmap // test_vfs.c:221:3:
- *(*func(*crt.TLS, uintptr, sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 136 /* .xFetch */)) = tvfsFetch // test_vfs.c:222:3:
- *(*func(*crt.TLS, uintptr, sqlite3_int64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 144 /* .xUnfetch */)) = tvfsUnfetch // test_vfs.c:223:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 40 /* .xOpen */)) = tvfsOpen // test_vfs.c:1447:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 48 /* .xDelete */)) = tvfsDelete // test_vfs.c:1448:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 56 /* .xAccess */)) = tvfsAccess // test_vfs.c:1449:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 64 /* .xFullPathname */)) = tvfsFullPathname // test_vfs.c:1450:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 104 /* .xRandomness */)) = tvfsRandomness // test_vfs.c:1462:5:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 112 /* .xSleep */)) = tvfsSleep // test_vfs.c:1463:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 120 /* .xCurrentTime */)) = tvfsCurrentTime // test_vfs.c:1464:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 8 /* .xCreate */)) = unionConnect // unionvtab.c:1332:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 16 /* .xConnect */)) = unionConnect // unionvtab.c:1333:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 24 /* .xBestIndex */)) = unionBestIndex // unionvtab.c:1334:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 32 /* .xDisconnect */)) = unionDisconnect // unionvtab.c:1335:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 40 /* .xDestroy */)) = unionDisconnect // unionvtab.c:1336:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 48 /* .xOpen */)) = unionOpen // unionvtab.c:1337:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 56 /* .xClose */)) = unionClose // unionvtab.c:1338:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 64 /* .xFilter */)) = unionFilter // unionvtab.c:1339:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 72 /* .xNext */)) = unionNext // unionvtab.c:1340:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 80 /* .xEof */)) = unionEof // unionvtab.c:1341:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 88 /* .xColumn */)) = unionColumn // unionvtab.c:1342:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 96 /* .xRowid */)) = unionRowid // unionvtab.c:1343:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 8 /* .xClose */)) = vfslogClose // test_osinst.c:204:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 16 /* .xRead */)) = vfslogRead // test_osinst.c:205:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 24 /* .xWrite */)) = vfslogWrite // test_osinst.c:206:3:
- *(*func(*crt.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 32 /* .xTruncate */)) = vfslogTruncate // test_osinst.c:207:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 40 /* .xSync */)) = vfslogSync // test_osinst.c:208:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 48 /* .xFileSize */)) = vfslogFileSize // test_osinst.c:209:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 56 /* .xLock */)) = vfslogLock // test_osinst.c:210:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 64 /* .xUnlock */)) = vfslogUnlock // test_osinst.c:211:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 72 /* .xCheckReservedLock */)) = vfslogCheckReservedLock // test_osinst.c:212:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 80 /* .xFileControl */)) = vfslogFileControl // test_osinst.c:213:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 88 /* .xSectorSize */)) = vfslogSectorSize // test_osinst.c:214:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 96 /* .xDeviceCharacteristics */)) = vfslogDeviceCharacteristics // test_osinst.c:215:3:
- *(*func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 104 /* .xShmMap */)) = vfslogShmMap // test_osinst.c:216:3:
- *(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 112 /* .xShmLock */)) = vfslogShmLock // test_osinst.c:217:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 120 /* .xShmBarrier */)) = vfslogShmBarrier // test_osinst.c:218:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 128 /* .xShmUnmap */)) = vfslogShmUnmap // test_osinst.c:219:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 8 /* .xCreate */)) = vlogConnect // test_osinst.c:1074:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 16 /* .xConnect */)) = vlogConnect // test_osinst.c:1075:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 24 /* .xBestIndex */)) = vlogBestIndex // test_osinst.c:1076:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 32 /* .xDisconnect */)) = vlogDisconnect // test_osinst.c:1077:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 40 /* .xDestroy */)) = vlogDisconnect // test_osinst.c:1078:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 48 /* .xOpen */)) = vlogOpen // test_osinst.c:1079:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 56 /* .xClose */)) = vlogClose // test_osinst.c:1080:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 64 /* .xFilter */)) = vlogFilter // test_osinst.c:1081:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 72 /* .xNext */)) = vlogNext // test_osinst.c:1082:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 80 /* .xEof */)) = vlogEof // test_osinst.c:1083:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 88 /* .xColumn */)) = vlogColumn // test_osinst.c:1084:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 96 /* .xRowid */)) = vlogRowid // test_osinst.c:1085:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 40 /* .xOpen */)) = vfslogOpen // test_osinst.c:187:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 48 /* .xDelete */)) = vfslogDelete // test_osinst.c:188:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 56 /* .xAccess */)) = vfslogAccess // test_osinst.c:189:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 64 /* .xFullPathname */)) = vfslogFullPathname // test_osinst.c:190:3:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 72 /* .xDlOpen */)) = vfslogDlOpen // test_osinst.c:191:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 80 /* .xDlError */)) = vfslogDlError // test_osinst.c:192:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 88 /* .xDlSym */)) = vfslogDlSym // test_osinst.c:193:3:
- *(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 96 /* .xDlClose */)) = vfslogDlClose // test_osinst.c:194:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 104 /* .xRandomness */)) = vfslogRandomness // test_osinst.c:195:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 112 /* .xSleep */)) = vfslogSleep // test_osinst.c:196:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 120 /* .xCurrentTime */)) = vfslogCurrentTime // test_osinst.c:197:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 128 /* .xGetLastError */)) = vfslogGetLastError // test_osinst.c:198:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 136 /* .xCurrentTimeInt64 */)) = vfslogCurrentTimeInt64 // test_osinst.c:199:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 8 /* .xCreate */)) = wholenumberConnect // wholenumber.c:238:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 16 /* .xConnect */)) = wholenumberConnect // wholenumber.c:239:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 24 /* .xBestIndex */)) = wholenumberBestIndex // wholenumber.c:240:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 32 /* .xDisconnect */)) = wholenumberDisconnect // wholenumber.c:241:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 40 /* .xDestroy */)) = wholenumberDisconnect // wholenumber.c:242:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 48 /* .xOpen */)) = wholenumberOpen // wholenumber.c:243:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 56 /* .xClose */)) = wholenumberClose // wholenumber.c:244:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 64 /* .xFilter */)) = wholenumberFilter // wholenumber.c:245:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 72 /* .xNext */)) = wholenumberNext // wholenumber.c:246:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 80 /* .xEof */)) = wholenumberEof // wholenumber.c:247:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 88 /* .xColumn */)) = wholenumberColumn // wholenumber.c:248:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 96 /* .xRowid */)) = wholenumberRowid // wholenumber.c:249:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 8 /* .xClose */)) = devsymClose // test_devsym.c:393:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 16 /* .xRead */)) = devsymRead // test_devsym.c:394:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 24 /* .xWrite */)) = writecrashWrite // test_devsym.c:395:3:
- *(*func(*crt.TLS, uintptr, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 32 /* .xTruncate */)) = devsymTruncate // test_devsym.c:396:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 40 /* .xSync */)) = devsymSync // test_devsym.c:397:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 48 /* .xFileSize */)) = devsymFileSize // test_devsym.c:398:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 56 /* .xLock */)) = devsymLock // test_devsym.c:399:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 64 /* .xUnlock */)) = devsymUnlock // test_devsym.c:400:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 72 /* .xCheckReservedLock */)) = devsymCheckReservedLock // test_devsym.c:401:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 80 /* .xFileControl */)) = devsymFileControl // test_devsym.c:402:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 88 /* .xSectorSize */)) = writecrashSectorSize // test_devsym.c:403:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 96 /* .xDeviceCharacteristics */)) = writecrashDeviceCharacteristics // test_devsym.c:404:3:
- *(*func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 104 /* .xShmMap */)) = devsymShmMap // test_devsym.c:405:3:
- *(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 112 /* .xShmLock */)) = devsymShmLock // test_devsym.c:406:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 120 /* .xShmBarrier */)) = devsymShmBarrier // test_devsym.c:407:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 128 /* .xShmUnmap */)) = devsymShmUnmap // test_devsym.c:408:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 40 /* .xOpen */)) = writecrashOpen // test_devsym.c:457:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 48 /* .xDelete */)) = devsymDelete // test_devsym.c:458:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 56 /* .xAccess */)) = devsymAccess // test_devsym.c:459:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 64 /* .xFullPathname */)) = devsymFullPathname // test_devsym.c:460:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 104 /* .xRandomness */)) = devsymRandomness // test_devsym.c:472:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 112 /* .xSleep */)) = devsymSleep // test_devsym.c:473:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 120 /* .xCurrentTime */)) = devsymCurrentTime // test_devsym.c:474:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 8 /* .xCreate */)) = zipfileConnect // zipfile.c:2143:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 16 /* .xConnect */)) = zipfileConnect // zipfile.c:2144:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 24 /* .xBestIndex */)) = zipfileBestIndex // zipfile.c:2145:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 32 /* .xDisconnect */)) = zipfileDisconnect // zipfile.c:2146:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 40 /* .xDestroy */)) = zipfileDisconnect // zipfile.c:2147:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 48 /* .xOpen */)) = zipfileOpen // zipfile.c:2148:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 56 /* .xClose */)) = zipfileClose // zipfile.c:2149:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 64 /* .xFilter */)) = zipfileFilter // zipfile.c:2150:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 72 /* .xNext */)) = zipfileNext // zipfile.c:2151:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 80 /* .xEof */)) = zipfileEof // zipfile.c:2152:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 88 /* .xColumn */)) = zipfileColumn // zipfile.c:2153:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 104 /* .xUpdate */)) = zipfileUpdate // zipfile.c:2155:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 112 /* .xBegin */)) = zipfileBegin // zipfile.c:2156:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 128 /* .xCommit */)) = zipfileCommit // zipfile.c:2158:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 136 /* .xRollback */)) = zipfileRollback // zipfile.c:2159:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 144 /* .xFindFunction */)) = zipfileFindFunction // zipfile.c:2160:5:
-}
-
-var ts1 = "%s\x00internal error!\x00SELECT * FROM main.%Q WHERE sample()\x00expert\x00PRAGMA table_info=%Q\x00main\x00, \x00%Q\x00 COLLATE %Q\x00 COLLATE %s\x00 DESC\x00PRAGMA index_list=%Q\x00PRAGMA index_xInfo=%Q\x00%s_idx_%08x\x00CREATE INDEX '%q' ON %Q(%s)\x00CREATE INDEX %s ON %s(%s)\x00EXPLAIN QUERY PLAN %s\x00 USING INDEX \x00 USING COVERING INDEX \x00%s\n\x00%s;\n\x00SELECT 'CREATE TEMP' || substr(sql, 7) FROM sqlite_master WHERE tbl_name = %Q AND type IN ('table', 'trigger') ORDER BY type;\x00ALTER TABLE temp.%Q RENAME TO %Q\x00INSERT INTO %Q VALUES(\x00%s?\x00\x00)\x00UPDATE %Q SET \x00%s%Q=?\x00DELETE FROM %Q\x00t592690916721053953805701627921227776\x00DROP TABLE t592690916721053953805701627921227776\x00SELECT type, name, sql, 1 FROM sqlite_master WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%%' UNION ALL SELECT type, name, sql, 2 FROM sqlite_master WHERE type = 'trigger' AND tbl_name IN(SELECT name FROM sqlite_master WHERE type = 'view') ORDER BY 4, 1\x00CREATE TABLE x(\x00%s%Q COLLATE %s\x00CREATE VIRTUAL TABLE %Q USING expert(%Q)\x00SELECT max(i.seqno) FROM sqlite_master AS s, pragma_index_list(s.name) AS l, pragma_index_info(l.name) AS i WHERE s.type = 'table'\x00%sx.%Q IS rem(%d, x.%Q) COLLATE %s\x00%s%d\x00SELECT %s FROM %Q x ORDER BY %s\x00SELECT %s FROM temp.t592690916721053953805701627921227776 x ORDER BY %s\x00%d\x00 %d\x00DROP TABLE IF EXISTS temp.t592690916721053953805701627921227776\x00CREATE TABLE temp.t592690916721053953805701627921227776 AS SELECT * FROM %Q\x00SELECT s.rowid, s.name, l.name FROM sqlite_master AS s, pragma_index_list(s.name) AS l WHERE s.type = 'table'\x00SELECT name, coll FROM pragma_index_xinfo(?) WHERE key\x00INSERT INTO sqlite_stat1 VALUES(?, ?, ?)\x00ANALYZE; PRAGMA writable_schema=1\x00rem\x00sample\x00ANALYZE sqlite_master\x00:memory:\x00SELECT sql FROM sqlite_master WHERE name NOT LIKE 'sqlite_%%' AND sql NOT LIKE 'CREATE VIRTUAL %%'\x00%s;%s%s\n\x00 -- stat1: \x00no such handle: \x00sql\x00TABLE\x00analyze\x00count\x00report\x00STMT EREPORT\x00destroy\x00SUBCOMMAND ...\x00sub-command\x00indexes\x00plan\x00candidates\x00DB\x00sqlite3expert%d\x00out of memory\x00sqlite3_expert_new\x00%s: cost must be between 1 and %d\x00%s: maximum string length is %d\x00%s: iLang must be between 0 and %d\x00?\x00SELECT * FROM %Q.%Q\x00%s: %s\x00%s: %s has %d columns, expected 4\x00vocabulary_table\x00vocabulary_word\x00vocabulary_language\x00edit_distances\x00unrecognized argument: [%s]\n\x00no edit_distances table specified\x00CREATE TABLE x(word,distance,language,command HIDDEN,nword HIDDEN)\x000123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^abcdefghijklmnopqrstuvwxyz~\x00SELECT \"%w\" FROM \"%w\"\x00 WHERE \"%w\">=?1 AND \"%w\"=?2 ORDER BY 1\x00SELECT \"%w\" FROM \"%w\" WHERE \"%w\">=?1 ORDER BY 1\x00*\x00DELETE from %s is not allowed\x00UPDATE of %s is not allowed\x00INSERT INTO %s allowed for column [command] only\x00approximate_match\x00int32\x00int64\x00double\x00char*\x00CREATE TABLE x(value,pointer hidden,count hidden,ctype hidden)\x00carray\x00unknown datatype: %Q\x00inttoptr\x00tablename\x00idcolumn\x00parentcolumn\x00CREATE TABLE x(id,depth,root HIDDEN,tablename HIDDEN,idcolumn HIDDEN,parentcolumn HIDDEN)\x00SELECT \"%w\".\"%w\" FROM \"%w\" WHERE \"%w\".\"%w\"=?1\x00transitive_closure\x00rb\x00cannot open '%s' for reading\x00line %d: unescaped %c character\x00line %d: unterminated %c-quoted field\n\x00more than one '%s' parameter\x00yes\x00on\x00true\x00no\x00off\x00false\x00header\x00more than one 'header' parameter\x00testflags\x00columns\x00more than one 'columns' parameter\x00column= value must be positive\x00bad parameter: '%s'\x00must specify either filename= or data= but not both\x00%sc%d TEXT\x00,\x00%s\"%w\" TEXT\x00bad schema: '%s' - %s\x00filename\x00data\x00schema\x00csv\x00csv_wr\x00 \x00eval\x00CREATE TABLE x(addr,opcode,p1,p2,p3,p4,p5,comment,sql HIDDEN)\x00EXPLAIN %s\x00explain\x00wb\x00wrong number of arguments to function writefile()\x00failed to create symlink: %s\x00failed to create directory: %s\x00failed to write file: %s\x00CREATE TABLE x(name,mode,mtime,data,path HIDDEN,dir HIDDEN)\x00cannot read directory: %s\x00%s/%s\x00cannot stat file: %s\x00table function fsdir requires an argument\x00table function fsdir requires a non-NULL argument\x00fsdir\x00readfile\x00writefile\x00lsmode\x00%s: ruleset must be between 0 and %d\x00%s: wrong number of CREATE VIRTUAL TABLE arguments\x00CREATE TABLE x(word,distance,ruleset)\x00fuzzer\x00ieee754(%lld,%d)\x00ieee754\x00BEGIN; SELECT * FROM %s%q%ssqlite_master\x00'\x00'.\x00PRAGMA %s%q%spage_size\x00sqlite3_mmap_warm_cache: Warmed up %d pages of %s\x00END\x00AND (%s)\x00collate \"%w\"\x00SELECT %s FROM %s WHERE %s>=(?1 || ?2) %s AND %s<=(?1 || char(1114111)) %s %s ORDER BY 1 %s ASC LIMIT 1\x00next_char\x00NULL\x00is\x00not\x00in(\x00in(select\x00in(with\x00?,?,?\x002nd argument to percentile() is not a number between 0.0 and 100.0\x002nd argument to percentile() is not the same for all input rows\x001st argument to percentile() is not numeric\x00Inf input to percentile()\x00percentile\x00CREATE TABLE prefixes(prefix TEXT, original_string TEXT HIDDEN)\x00prefixes\x00prefix_length\x00unknown \\ escape\x00afnrtv\\()*.+?[$^{|}]\x00\a\f\n\r\t\v\x00unmatched '('\x00'*' without operand\x00'+' without operand\x00'?' without operand\x00'{m,n}' without operand\x00unmatched '{'\x00n less than m in '{m,n}'\x00both m and n are zero in '{m,n}'\x00POSIX character classes not supported\x00unclosed '['\x00unrecognized character\x00regexp\x00remember\x00CREATE TABLE x(value,start hidden,stop hidden,step hidden)\x00generate_series() requires SQLite 3.8.12 or later\x00generate_series\x00.ABCDHLRMY9 ?\x00non-ASCII input to editdist()\x00NULL input to editdist()\x00SELECT iLang, cFrom, cTo, iCost FROM \"%w\" WHERE iLang>=0 ORDER BY iLang\x00editdist3\x00DROP TABLE IF EXISTS \"%w\".\"%w_vocab\"\x00CREATE TABLE x(word,rank,distance,langid, score, matchlen, phonehash HIDDEN, top HIDDEN, scope HIDDEN, srchcnt HIDDEN, soundslike HIDDEN, command HIDDEN)\x00CREATE TABLE IF NOT EXISTS \"%w\".\"%w_vocab\"(\n id INTEGER PRIMARY KEY,\n rank INT,\n langid INT,\n word TEXT,\n k1 TEXT,\n k2 TEXT\n);\n\x00CREATE INDEX IF NOT EXISTS \"%w\".\"%w_vocab_index_langid_k2\" ON \"%w_vocab\"(langid,k2);\x00edit_cost_table=\x00bad argument to spellfix1(): \"%s\"\x00SELECT id, word, rank, coalesce(k1,word) FROM \"%w\".\"%w_vocab\" WHERE langid=%d AND k2>=?1 AND k2<?2\x00SELECT word, rank, NULL, langid, id FROM \"%w\".\"%w_vocab\"%s\x00 WHERE rowid=?\x00ROLLBACK\x00IGNORE\x00ABORT\x00REPLACE\x00DELETE FROM \"%w\".\"%w_vocab\" WHERE id=%lld\x00NOT NULL constraint failed: %s.word\x00reset\x00null\x00unknown value for %s.command: \"%w\"\x00INSERT INTO \"%w\".\"%w_vocab\"(rank,langid,word,k1,k2) VALUES(%d,%d,%Q,nullif(%Q,%Q),%Q)\x00INSERT OR %s INTO \"%w\".\"%w_vocab\"(id,rank,langid,word,k1,k2) VALUES(%lld,%d,%d,%Q,nullif(%Q,%Q),%Q)\x00UPDATE OR %s \"%w\".\"%w_vocab\" SET id=%lld, rank=%d, langid=%d, word=%Q, k1=nullif(%Q,%Q), k2=%Q WHERE id=%lld\x00ALTER TABLE \"%w\".\"%w_vocab\" RENAME TO \"%w_vocab\"\x00spellfix1_translit\x00spellfix1_editdist\x00spellfix1_phonehash\x00spellfix1_scriptcode\x00spellfix1\x00922337203685477580\x00tointeger\x00toreal\x00sql error: %s\x00_rowid_\x00integer\x00no such rowid table: %s%s%s\x00.\x00SELECT group_concat(quote(name) || '.' || quote(type)) FROM pragma_table_info(?, ?)\x00source table schema mismatch\x00swarmvtab: no such SQL parameter: %s\x00maxopen\x00swarmvtab: illegal maxopen value\x00missing\x00swarmvtab: duplicate \"missing\" option\x00SELECT \"%w\"(?%s)\x00,?\x00openclose\x00swarmvtab: duplicate \"openclose\" option\x00SELECT \"%w\"(?,?%s)\x00swarmvtab: unrecognized option: %s\x00SELECT \"%w\"(?)\x00swarmvtab: parse error: %s\x00swarmvtab\x00unionvtab\x00temp\x00%s tables must be created in TEMP schema\x00wrong number of arguments for %s\x00SELECT * FROM (%z) ORDER BY 3\x00rowid range mismatch error\x00no source tables configured\x00SELECT 'CREATE TABLE xyz(' || group_concat(quote(name) || ' ' || type, ', ') || ')',max((cid+1) * (type='INTEGER' COLLATE nocase AND pk=1))-1 FROM pragma_table_info(%Q, ?)\x00SELECT rowid, * FROM %Q %s %lld\x00WHERE _rowid_ <=\x00-- \x00%z%sSELECT rowid, * FROM %s%q%s%Q\x00 UNION ALL \x00%z WHERE rowid=%lld\x00WHERE\x00%z WHERE rowid>=%lld\x00AND\x00%z %s rowid<=%lld\x00CREATE TABLE x(value)\x00wholenumber\x00CREATE TABLE y(name PRIMARY KEY,mode,mtime,sz,rawdata,data,method,z HIDDEN) WITHOUT ROWID;\x00zipfile\x00zipfile constructor requires one argument\x00error in fread()\x00error in fwrite()\x00failed to read CDS at offset %lld\x00%.*s\x00failed to read LFH at offset %d\x001.2.11\x00inflateInit2() failed (%d)\x00inflate() failed (%d)\x00zipfile: deflate() error\x00cannot find end of central directory record\x00zipfile() function requires an argument\x00cannot open file: %s\x00-rwxrwxrwx\x00zipfile: mode does not match data\x00zipfile: parse error in mode: %s\x00zipfile: missing filename\x00ab+\x00zipfile: failed to open file %s for writing\x00sz must be NULL\x00rawdata must be NULL\x00unknown compression method: %d\x00%s/\x00duplicate name: \"%s\"\x00{\"version-made-by\" : %u, \"version-to-extract\" : %u, \"flags\" : %u, \"compression\" : %u, \"time\" : %u, \"date\" : %u, \"crc32\" : %u, \"compressed-size\" : %u, \"uncompressed-size\" : %u, \"file-name-length\" : %u, \"extra-field-length\" : %u, \"file-comment-length\" : %u, \"disk-number-start\" : %u, \"internal-attr\" : %u, \"external-attr\" : %u, \"offset\" : %u }\x00zipfile_cds\x00wrong number of arguments to function zipfile()\x00first argument to zipfile() must be non-NULL\x00illegal method value: %d\x00non-directory name must not end with /\x00incrblob\x00incrblob_%d\x00%lld\x00sqlite_unlock_notify_arg\x00sqlite_unlock_notify_argcount\x00DELETE\x00INSERT\x00UPDATE\x00bytearray\x00boolean\x00wideInt\x00int\x00SQLITE_COPY\x00SQLITE_CREATE_INDEX\x00SQLITE_CREATE_TABLE\x00SQLITE_CREATE_TEMP_INDEX\x00SQLITE_CREATE_TEMP_TABLE\x00SQLITE_CREATE_TEMP_TRIGGER\x00SQLITE_CREATE_TEMP_VIEW\x00SQLITE_CREATE_TRIGGER\x00SQLITE_CREATE_VIEW\x00SQLITE_DELETE\x00SQLITE_DROP_INDEX\x00SQLITE_DROP_TABLE\x00SQLITE_DROP_TEMP_INDEX\x00SQLITE_DROP_TEMP_TABLE\x00SQLITE_DROP_TEMP_TRIGGER\x00SQLITE_DROP_TEMP_VIEW\x00SQLITE_DROP_TRIGGER\x00SQLITE_DROP_VIEW\x00SQLITE_INSERT\x00SQLITE_PRAGMA\x00SQLITE_READ\x00SQLITE_SELECT\x00SQLITE_TRANSACTION\x00SQLITE_UPDATE\x00SQLITE_ATTACH\x00SQLITE_DETACH\x00SQLITE_ALTER_TABLE\x00SQLITE_REINDEX\x00SQLITE_ANALYZE\x00SQLITE_CREATE_VTABLE\x00SQLITE_DROP_VTABLE\x00SQLITE_FUNCTION\x00SQLITE_SAVEPOINT\x00SQLITE_RECURSIVE\x00????\x00SQLITE_DENY\x00SQLITE_OK\x00SQLITE_IGNORE\x00RELEASE _tcl_transaction\x00COMMIT\x00ROLLBACK TO _tcl_transaction ; RELEASE _tcl_transaction\x00option\x00?CALLBACK?\x00?DATABASE? FILENAME\x00cannot open target database: \x00backup failed: \x00CALLBACK\x00cache option ?arg?\x00flush\x00size\x00size n\x00cannot convert \"\x00\" to integer\x00bad option \"\x00\": must be flush or size\x00NAME SCRIPT\x00SCRIPT\x00SQL\x00?OPTION? ?BOOLEAN?\x00unknown config option: \"\x00\"\x00CONFLICT-ALGORITHM TABLE FILENAME ?SEPARATOR? ?NULLINDICATOR?\x00\t\x00Error: non-null separator required for copy\x00rollback\x00abort\x00fail\x00ignore\x00replace\x00Error: \"\x00\", conflict-algorithm must be one of: rollback, abort, fail, ignore, or replace\x00SELECT * FROM '%q'\x00Error: no such table: \x00Error: \x00Error: can't malloc()\x00INSERT OR %q INTO '%q' VALUES(?\x00Error: cannot open file: \x00BEGIN\x00Error: %s line %d: expected %d columns of data but found %d\x00, failed while processing line: \x00?DATABASE? VALUE\x00-maxsize\x00-readonly\x00unknown option: \x00unable to set MEMDB content\x00extension loading is turned off at compile-time\x00-withoutnulls\x00unknown option: \"\x00?OPTIONS? SQL ?ARRAY-NAME? ?SCRIPT?\x00NAME ?SWITCHES? SCRIPT\x00-argcount\x00option requires an argument: \x00number of arguments must be non-negative\x00-deterministic\x00-directonly\x00-innocuous\x00-returntype\x00real\x00text\x00blob\x00any\x00type\x00\": must be -argcount, -deterministic, -directonly, -innocuous, or -returntype\x00?-readonly? ?DB? TABLE COLUMN ROWID\x00NULLVALUE\x00N CALLBACK\x00KEY\x00cannot open source database: \x00restore failed: \x00restore failed: source database busy\x00?DATABASE?\x00(step|sort|autoindex)\x00step\x00sort\x00autoindex\x00vmstep\x00bad argument: should be autoindex, step, sort or vmstep\x00MILLISECONDS\x00?CALLBACK? ?MASK?\x00trace type\x00SAVEPOINT _tcl_transaction\x00[TYPE] SCRIPT\x00transaction type\x00BEGIN EXCLUSIVE\x00BEGIN IMMEDIATE\x00?SCRIPT?\x00preupdate_hook was omitted at compile-time\x00-use-legacy-prepare\x00-last-stmt-ptr\x00%p\x00unknown argument: \x00authorizer\x00backup\x00bind_fallback\x00busy\x00cache\x00changes\x00close\x00collate\x00collation_needed\x00commit_hook\x00complete\x00config\x00copy\x00deserialize\x00enable_load_extension\x00errorcode\x00exists\x00function\x00interrupt\x00last_insert_rowid\x00nullvalue\x00onecolumn\x00preupdate\x00profile\x00progress\x00rekey\x00restore\x00rollback_hook\x00serialize\x00status\x00timeout\x00total_changes\x00trace\x00trace_v2\x00transaction\x00unlock_notify\x00update_hook\x00version\x00wal_hook\x00defensive\x00dqs_ddl\x00dqs_dml\x00enable_fkey\x00enable_qpsg\x00enable_trigger\x00enable_view\x00fts3_tokenizer\x00legacy_alter_table\x00legacy_file_format\x00load_extension\x00no_ckpt_on_close\x00reset_database\x00trigger_eqp\x00trusted_schema\x00writable_schema\x00statement\x00row\x00deferred\x00exclusive\x00immediate\x00HANDLE ?FILENAME? ?-vfs VFSNAME? ?-readonly BOOLEAN? ?-create BOOLEAN? ?-nofollow BOOLEAN? ?-nomutex BOOLEAN? ?-fullmutex BOOLEAN? ?-uri BOOLEAN?\x00-version\x00-sourceid\x00-has-codec\x000\x00-key\x00-vfs\x00-create\x00-nofollow\x00-nomutex\x00-fullmutex\x00-uri\x00-translatefilename\x00sqlite3\x00sqlite\x003.32.3\x00if {[llength $argv]>=1} {\nset argv0 [lindex $argv 0]\nset argv [lrange $argv 1 end]\nsource $argv0\n} else {\nset line {}\nwhile {![eof stdin]} {\nif {$line!=\"\"} {\nputs -nonewline \"> \"\n} else {\nputs -nonewline \"% \"\n}\nflush stdout\nappend line [gets stdin]\nif {[info complete $line]} {\nif {[catch {uplevel #0 $line} result]} {\nputs stderr \"Error: $result\"\n} elseif {$result!=\"\"} {\nputs $result\n}\nset line {}\n} else {\nappend line \\n\n}\n}\n}\n\x00SQLITE_DEBUG_BREAK\x00attach debugger to process %d and press any key to continue.\n\x00utf-8\x00argc\x00argv0\x00argv\x00errorInfo\x00%s: %s\n\x00SQLITE-CONNECTION\x00command not found: \x00error code %s (%d) does not match sqlite3_errcode %s (%d)\x00OMIT_MISUSE\x00wrong # args: should be \"\x00 DB FORMAT STRING\x00 DB HEX\x00 DB\x00 DB SQL\x00%z%s%s\x00%s%n\x00abcdefghijklmnopqrstuvwxyz\x00 DB FORMAT STRING ?COUNT?\x00 DB\"\x00 FILENAME\"\x00%02x\x00%04x\x00tkt2213 is not fixed\x00text16\x00bytes\x00bytes16\x00noop\x00x_coalesce\x00hex8\x00hex16\x00tkt2213func\x00pointer_change\x00counter1\x00counter2\x00intreal\x00x_sqlite_exec\x00value of 40 handed to x_count\x00x_count totals to 42\x00x_count\x00legacy_count\x00 TEXT\"\x00 FORMAT INT INT INT\"\x00argument is not a valid 64-bit integer\x00 FORMAT INT INT ?STRING?\"\x00 INT FORMAT INT INT ?STRING?\"\x00N must be non-negative\x00 FORMAT INT INT DOUBLE\"\x00 FORMAT DOUBLE DOUBLE\"\x00 FORMAT STRING\"\x00%08x%08x\x002nd argument should be 16-characters of hex\x00?BOOLEAN?\x00DB BOOLEAN\x00DB dbname tblname colname\x00CHANNEL ROWID\x00DB-HANDLE NAME CMP-PROC DEL-PROC\x00sqlite3_create_collate_v2() failed to detect an invalid encoding\x00utf8\x00utf16\x00utf16le\x00utf16be\x00DB NAME NARG ENC SWITCHES...\x00encoding\x00-func\x00-step\x00-final\x00-destroy\x00switch\x00DB-HANDLE FILE ?PROC?\x00this build omits sqlite3_load_extension()\x00DB-HANDLE ONOFF\x00string\x00value\x00first argument should be one of: int int64 string double null value\x00 DB FUNCTION-NAME\x00 <STMT>\x00STMT PARAMETER RESETFLAG\x00SQLITE_STMTSTATUS_FULLSCAN_STEP\x00SQLITE_STMTSTATUS_SORT\x00SQLITE_STMTSTATUS_AUTOINDEX\x00SQLITE_STMTSTATUS_VM_STEP\x00SQLITE_STMTSTATUS_REPREPARE\x00SQLITE_STMTSTATUS_RUN\x00SQLITE_STMTSTATUS_MEMUSED\x00NBYTE\x00FILE\x00PATH\x00 DB STMT\x00 STMT\x00 FROM-STMT TO-STMT\x00 VM IDX VALUE (null|static|normal)\"\x00static\x00static-nbytes\x00normal\x00blob10\x00abc\x00xyz\x00pq\x004th argument should be \"null\" or \"static\" or \"normal\"\x00(%d) \x00test_collate\x00UTF-8\x00UTF-16LE\x00UTF-16BE\x00 <DB> <utf8> <utf16le> <utf16be>\x00utf16bin\x00utf16_unaligned\x00utf16_aligned\x00test_function\x00<error code>\x00STMT IDX N\x00 STMT N VALUE\x00NaN\x00SNaN\x00-NaN\x00-SNaN\x00+Inf\x00-Inf\x00Epsilon\x00-Epsilon\x00NaN0\x00-NaN0\x00 STMT N\x00 STMT N VALUE BYTES\x00 STMT N DATA BYTES\x00cannot use %d blob bytes, have %d\x00STMT\x00STMT N\x00STMT NAME\x00 DB sql bytes ?tailvar?\x00 DB sql bytes tailvar\x00 DB sql bytes flags tailvar\x00\x00SELECT 1\x00 filename options-list\x00FILENAME FLAGS VFS\x00SQLITE_OPEN_READONLY\x00SQLITE_OPEN_READWRITE\x00SQLITE_OPEN_CREATE\x00SQLITE_OPEN_DELETEONCLOSE\x00SQLITE_OPEN_EXCLUSIVE\x00SQLITE_OPEN_AUTOPROXY\x00SQLITE_OPEN_MAIN_DB\x00SQLITE_OPEN_TEMP_DB\x00SQLITE_OPEN_TRANSIENT_DB\x00SQLITE_OPEN_MAIN_JOURNAL\x00SQLITE_OPEN_TEMP_JOURNAL\x00SQLITE_OPEN_SUBJOURNAL\x00SQLITE_OPEN_MASTER_JOURNAL\x00SQLITE_OPEN_NOMUTEX\x00SQLITE_OPEN_FULLMUTEX\x00SQLITE_OPEN_SHAREDCACHE\x00SQLITE_OPEN_PRIVATECACHE\x00SQLITE_OPEN_WAL\x00SQLITE_OPEN_URI\x00flag\x00<utf-16 sql>\x00 STMT column\x00INTEGER\x00FLOAT\x00TEXT\x00BLOB\x00 DB MAGIC\x00SQLITE_MAGIC_OPEN\x00SQLITE_MAGIC_CLOSED\x00SQLITE_MAGIC_BUSY\x00SQLITE_MAGIC_ERROR\x00 DB function-name\x00VARIABLE\x00DB DBNAME\x00?N?\x001234567890000000\x00__one\x00__two\x00notadatabase\x00Unexpected non-zero errno: \x00DB [DBNAME]\x00%u\x00DB DBNAME SIZE\x00 DB PWD\x00 DB FLAG\x00%d %d\x00 DB ?AUXDB?\x00 DB ID VALUE\x00unknown limit type: \x00SQLITE_LIMIT_LENGTH\x00SQLITE_LIMIT_SQL_LENGTH\x00SQLITE_LIMIT_COLUMN\x00SQLITE_LIMIT_EXPR_DEPTH\x00SQLITE_LIMIT_COMPOUND_SELECT\x00SQLITE_LIMIT_VDBE_OP\x00SQLITE_LIMIT_FUNCTION_ARG\x00SQLITE_LIMIT_ATTACHED\x00SQLITE_LIMIT_LIKE_PATTERN_LENGTH\x00SQLITE_LIMIT_VARIABLE_NUMBER\x00SQLITE_LIMIT_TRIGGER_DEPTH\x00SQLITE_LIMIT_WORKER_THREADS\x00SQLITE_LIMIT_TOOSMALL\x00SQLITE_LIMIT_TOOBIG\x00SEED ?DB?\x00current\x00max\x00min\x00recyclable\x00DB ?NAME?\x00passive\x00full\x00restart\x00truncate\x00DB MODE ?NAME?\x00mode\x00 - \x00DB VALUE\x00COMMAND ...\x00command has no objProc: \x00%d %d %d %s\n\x00SQLITE_TESTCTRL_LOCALTIME_FAULT\x00SQLITE_TESTCTRL_SORTER_MMAP\x00SQLITE_TESTCTRL_IMPOSTER\x00SQLITE_TESTCTRL_INTERNAL_FUNCTIONS\x00VERB ARGS...\x00VERB\x00ONOFF\x00DB LIMIT\x00DB dbName onOff tnum\x00ru_utime=%d.%06d ru_stime=%d.%06d ru_minflt=%d ru_majflt=%d\x00DB OPT BOOLEAN\x00unknown optimization - should be one of:\x00all\x00none\x00query-flattener\x00groupby-order\x00factor-constants\x00distinct-opt\x00cover-idx-scan\x00order-by-idx-join\x00transitive\x00omit-noop-join\x00stat4\x00skip-scan\x00push-down\x00DB NAME ...\x00no such extension: \x00initialization of \x00 failed: \x00amatch\x00closure\x00fileio\x00nextchar\x00series\x00spellfix\x00totype\x00BOOL\x00DB SQL1 NSTEP SQL2\x00data error: (a!=b)\x00checksum mismatch\x00sql error: \x00TYPE\x00Deliberate panic\x00DB SETTING [VALUE]\x00SQLITE_*\x00DBCONFIG_*\x00ENABLE_*\x00unknown sqlite3_db_config setting\x00FKEY\x00TRIGGER\x00FTS3_TOKENIZER\x00LOAD_EXTENSION\x00NO_CKPT_ON_CLOSE\x00QPSG\x00TRIGGER_EQP\x00RESET_DB\x00DEFENSIVE\x00WRITABLE_SCHEMA\x00LEGACY_ALTER_TABLE\x00DQS_DML\x00DQS_DDL\x00LEGACY_FILE_FORMAT\x00icecube\x00DB ?DBNAME?\x00HEXDB\x00| size %d pagesize %d\x00bad 'pagesize' field\x00bad 'size' field\x00| page %d offset %d\x00| %d: %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x\x00sqlite_search_count\x00sqlite_found_count\x00sqlite_sort_count\x00sqlite3_max_blobsize\x00sqlite_like_count\x00sqlite_interrupt_count\x00sqlite_open_file_count\x00sqlite_current_time\x00sqlite3_xferopt_count\x00sqlite3_pager_readdb_count\x00sqlite3_pager_writedb_count\x00sqlite3_pager_writej_count\x00unaligned_string_counter\x00sqlite_last_needed_collation\x00sqlite_query_plan\x00sqlite_opentemp_count\x00sqlite_static_bind_value\x00sqlite_static_bind_nbyte\x00sqlite_temp_directory\x00sqlite_data_directory\x00bitmask_size\x00longdouble_size\x00sqlite_sync_count\x00sqlite_fullsync_count\x00db_enter\x00db_leave\x00sqlite3_mprintf_int\x00sqlite3_mprintf_int64\x00sqlite3_mprintf_long\x00sqlite3_mprintf_str\x00sqlite3_snprintf_str\x00sqlite3_mprintf_stronly\x00sqlite3_mprintf_double\x00sqlite3_mprintf_scaled\x00sqlite3_mprintf_hexdouble\x00sqlite3_mprintf_z_test\x00sqlite3_mprintf_n_test\x00sqlite3_snprintf_int\x00sqlite3_last_insert_rowid\x00sqlite3_exec_printf\x00sqlite3_exec_hex\x00sqlite3_exec\x00sqlite3_exec_nr\x00sqlite3_get_table_printf\x00sqlite3_close\x00sqlite3_close_v2\x00sqlite3_create_function\x00sqlite3_create_aggregate\x00sqlite3_drop_modules\x00sqlite_register_test_function\x00sqlite_abort\x00sqlite_bind\x00breakpoint\x00sqlite3_key\x00sqlite3_rekey\x00sqlite_set_magic\x00sqlite3_interrupt\x00sqlite_delete_function\x00sqlite_delete_collation\x00sqlite3_get_autocommit\x00sqlite3_busy_timeout\x00printf\x00sqlite3IoTrace\x00clang_sanitize_address\x00sqlite3_db_config\x00bad_behavior\x00register_dbstat_vtab\x00sqlite3_connection_pointer\x00intarray_addr\x00int64array_addr\x00doublearray_addr\x00textarray_addr\x00sqlite3_bind_int\x00sqlite3_bind_zeroblob\x00sqlite3_bind_zeroblob64\x00sqlite3_bind_int64\x00sqlite3_bind_double\x00sqlite3_bind_null\x00sqlite3_bind_text\x00sqlite3_bind_text16\x00sqlite3_bind_blob\x00sqlite3_bind_parameter_count\x00sqlite3_bind_parameter_name\x00sqlite3_bind_parameter_index\x00sqlite3_clear_bindings\x00sqlite3_sleep\x00sqlite3_errcode\x00sqlite3_extended_errcode\x00sqlite3_errmsg\x00sqlite3_errmsg16\x00sqlite3_open\x00sqlite3_open16\x00sqlite3_open_v2\x00sqlite3_complete16\x00sqlite3_normalize\x00sqlite3_prepare\x00sqlite3_prepare16\x00sqlite3_prepare_v2\x00sqlite3_prepare_v3\x00sqlite3_prepare_tkt3134\x00sqlite3_prepare16_v2\x00sqlite3_finalize\x00sqlite3_stmt_status\x00sqlite3_reset\x00sqlite3_expired\x00sqlite3_transfer_bindings\x00sqlite3_changes\x00sqlite3_step\x00sqlite3_sql\x00sqlite3_expanded_sql\x00sqlite3_next_stmt\x00sqlite3_stmt_readonly\x00sqlite3_stmt_isexplain\x00sqlite3_stmt_busy\x00uses_stmt_journal\x00sqlite3_release_memory\x00sqlite3_db_release_memory\x00sqlite3_db_cacheflush\x00sqlite3_system_errno\x00sqlite3_db_filename\x00sqlite3_db_readonly\x00sqlite3_soft_heap_limit\x00sqlite3_soft_heap_limit64\x00sqlite3_hard_heap_limit64\x00sqlite3_thread_cleanup\x00sqlite3_pager_refcounts\x00sqlite3_load_extension\x00sqlite3_enable_load_extension\x00sqlite3_extended_result_codes\x00sqlite3_limit\x00dbconfig_maindbname_icecube\x00save_prng_state\x00restore_prng_state\x00reset_prng_state\x00prng_seed\x00database_never_corrupt\x00database_may_be_corrupt\x00optimization_control\x00tcl_objproc\x00sqlite3_column_count\x00sqlite3_data_count\x00sqlite3_column_type\x00sqlite3_column_blob\x00sqlite3_column_double\x00sqlite3_column_int64\x00sqlite3_column_text\x00sqlite3_column_name\x00sqlite3_column_int\x00sqlite3_column_bytes\x00sqlite3_column_decltype\x00sqlite3_column_bytes16\x00sqlite3_column_text16\x00sqlite3_column_name16\x00add_alignment_test_collations\x00sqlite3_column_decltype16\x00sqlite3_create_collation_v2\x00sqlite3_global_recover\x00working_64bit_int\x00vfs_unlink_test\x00vfs_initfail_test\x00vfs_unregister_all\x00vfs_reregister_all\x00file_control_test\x00file_control_lasterrno_test\x00file_control_lockproxy_test\x00file_control_chunksize_test\x00file_control_sizehint_test\x00file_control_data_version\x00file_control_persist_wal\x00file_control_powersafe_overwrite\x00file_control_vfsname\x00file_control_tempfilename\x00sqlite3_vfs_list\x00sqlite3_create_function_v2\x00add_test_collate\x00add_test_collate_needed\x00add_test_function\x00add_test_utf16bin_collate\x00sqlite3_test_errstr\x00tcl_variable_type\x00sqlite3_enable_shared_cache\x00sqlite3_shared_cache_report\x00sqlite3_libversion_number\x00sqlite3_table_column_metadata\x00sqlite3_blob_reopen\x00pcache_stats\x00sqlite3_unlock_notify\x00sqlite3_wal_checkpoint\x00sqlite3_wal_checkpoint_v2\x00sqlite3_wal_autocheckpoint\x00test_sqlite3_log\x00print_explain_query_plan\x00sqlite3_test_control\x00getrusage\x00load_static_extension\x00sorter_test_fakeheap\x00sorter_test_sort4_helper\x00vfs_current_time_int64\x00sqlite3_delete_database\x00atomic_batch_write\x00sqlite3_mmap_warm\x00sqlite3_config_sorterref\x00decode_hexdb\x00*** OBSOLETE VARIABLE ***\x00 FILENAME N-PAGE\"\x00 ID\"\x00ref\x00page\x00state\x00err\x00hit\x00miss\x00ovfl\x00 ID PGNO\"\x00 PAGE\"\x00 PAGE DATA\"\x00 N-MEGABYTES FILE\"\x00open failed: \x00Hello, World!\x00write failed: \x00 PENDING-BYTE\"\x00fault simulator script failed: [%s]\x00 SCRIPT\"\x00 SIZE PROGRAM\"\x00sqlite_io_error_pending\x00sqlite_io_error_persist\x00sqlite_io_error_hit\x00sqlite_io_error_hardhit\x00sqlite_diskfull_pending\x00sqlite_diskfull\x00sqlite_pending_byte\x00pager_open\x00pager_close\x00pager_commit\x00pager_rollback\x00pager_stmt_begin\x00pager_stmt_commit\x00pager_stmt_rollback\x00pager_stats\x00pager_pagecount\x00page_get\x00page_lookup\x00page_unref\x00page_read\x00page_write\x00page_number\x00pager_truncate\x00fake_big_file\x00sqlite3BitvecBuiltinTest\x00sqlite3_test_control_pending_byte\x00sqlite3_test_control_fault_install\x00 FILENAME NCACHE FLAGS\"\x00read\x00write\x00 ID TABLENUM WRITEABLE\"\x00 START MULTIPLIER COUNT INCREMENT\"\x00putVarint returned %d - should be between 1 and 9\x00putVarint returned %d and getVarint returned %d\x00Wrote 0x%016llx and got back 0x%016llx\x00putVarint returned %d and GetVarint32 returned %d\x00Wrote 0x%016llx and got back 0x%016llx from GetVarint32\x00 DB-HANDLE ?N?\"\x00No such db-handle: \"\x00 BT NCACHE\"\x00?-intkey? CSR KEY VALUE\x00btree_insert\x00btree_open\x00btree_close\x00btree_begin_transaction\x00btree_pager_stats\x00btree_cursor\x00btree_close_cursor\x00btree_next\x00btree_eof\x00btree_payload_size\x00btree_first\x00btree_varint_test\x00btree_from_db\x00btree_ismemdb\x00btree_set_cache_size\x00thread ID must be an upper case letter\x00 ID FILENAME\x00thread \x00 is already running\x00failed to create the thread\x00 ID\x00no such thread\x00 ID N\x00column number out of range\x00no database is open\x00 ID SQL\x00no virtual machine available\x00 IDL\x00 ID1 ID2\x00 ID DB\x00thread_create\x00thread_wait\x00thread_halt\x00thread_argc\x00thread_argv\x00thread_colname\x00thread_result\x00thread_error\x00thread_compile\x00thread_step\x00thread_finalize\x00thread_swap\x00thread_db_get\x00thread_db_put\x00thread_stmt_get\x00 <repeat-count> <do-calls>\x00hello world\x00UTF8\x00UTF16LE\x00UTF16BE\x00UTF16\x00No such encoding: \x00 <string/blob> <from enc> <to enc>\x00binarize\x00test_value_overhead\x00test_translate\x00translate_selftest\x00out of memory in the crash simulator\n\x00atomic\x00atomic512\x00atomic1k\x00atomic2k\x00atomic4k\x00atomic8k\x00atomic16k\x00atomic32k\x00atomic64k\x00sequential\x00safe_append\x00powersafe_overwrite\x00batch-atomic\x00-sectorsize\x00-characteristics\x00Bad option: \"\x00\" - must be \"-characteristics\" or \"-sectorsize\"\x00Option requires an argument: \"\x00no such flag\x00ENABLE ?DEFAULT?\x00crash\x00?OPTIONS? DELAY CRASHFILE\x00Filename is too long: \"\x00NWRITE\x00?-default? PARENT-VFS\x00-default\x00\": must be -default\x00Error in jt_register\x00sqlite3_crash_enable\x00sqlite3_crashparams\x00sqlite3_crash_now\x00sqlite3_simulate_device\x00sqlite3_crash_on_write\x00unregister_devsim\x00register_jt_vfs\x00unregister_jt_vfs\x00client_create\x00client_wait\x00client_halt\x00client_argc\x00client_argv\x00client_colname\x00client_result\x00client_error\x00client_compile\x00client_step\x00client_reset\x00client_finalize\x00client_swap\x00echo_module_fail(%s,%s)\x00echo-vtab-error: %s\x00SELECT * FROM %Q\x00PRAGMA index_list(%s)\x00PRAGMA index_info(%s)\x00echo_module\x00SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ?\x00%s%s\x00xCreate\x00CREATE TABLE %Q(logmsg)\x00xConnect\x00xDisconnect\x00xDestroy\x00DROP TABLE %Q\x00xOpen\x00xNext\x00xColumn\x00xRowid\x00xFilter\x00, *\x00%z, %s\x00%z, NULL\x00echo_module_ignore_usable\x00xBestIndex\x00echo_module_cost\x00SELECT count(*) FROM %Q\x00SELECT rowid%z FROM %Q\x00rowid\x00=\x00<\x00>\x00<=\x00>=\x00LIKE\x00like\x00glob\x00 %s %s LIKE (SELECT '%%'||?||'%%')\x00 %s %s %s ?\x00DESC\x00ASC\x00 ORDER BY %s %s\x00xUpdate\x00 SET\x00UPDATE %Q\x00 SET rowid=?1 \x00%s %Q=?%d\x00 WHERE rowid=?%d\x00DELETE FROM %Q WHERE rowid = ?1\x00INSERT INTO %Q (\x00%s%Q\x00%s?%d\x00) VALUES(\x00echo(%s)\x00xBegin\x00echo_module_begin_fail\x00xSync\x00echo_module_sync_fail\x00xCommit\x00xRollback\x00::echo_glob_overload\x00xRename\x00ALTER TABLE %s RENAME TO %s%s\x00echo\x00echo_v2\x00DB SQL\x00register_echo_module\x00sqlite3_declare_vtab\x00N/A\x00sqlite3_create_collation\x00Error testing function: \x00sqlite3_malloc\x00sqlite3_realloc\x00c_misuse_test\x00c_realloc_test\x00c_collation_test\x00sqlite3_reset_auto_extension\x00npage\x00finish\x00remaining\x00pagecount\x00CMDNAME DESTHANDLE DESTNAME SRCHANDLE SRCNAME\x00sqlite3_backup_init() failed\x00sqlite3_backup\x00wrong number of arguments\x00unexpected: %s\x00eq\x00gt\x00le\x00lt\x00ge\x00match\x00ne\x00isnot\x00isnotnull\x00isnull\x00op\x00column\x00usable\x00desc\x00cost\x00orderby\x00idxnum\x00idxstr\x00rows\x00use\x00omit\x00unexpected: %d\x00tcl\x00register_tcl_module\x00incrblob_\x00DB DATABASE TABLE COLUMN ROWID FLAGS VARNAME\x00HANDLE\x00CHANNEL OFFSET N\x00out of memory in testdata/sqlite-src-3320300/src/test_blob.c\x00HANDLE OFFSET DATA ?NDATA?\x00sqlite3_blob_open\x00sqlite3_blob_close\x00sqlite3_blob_bytes\x00sqlite3_blob_read\x00sqlite3_blob_write\x00sqlite_options\x00malloc_usable_size\x00rowid32\x00casesensitivelike\x00curdir\x001\x00win32malloc\x00debug\x00default_ckptfullfsync\x00direct_read\x00dirsync\x00lfs\x00pagecache_overflow_stats\x00mmap\x00worker_threads\x008\x00memdebug\x008_3_names\x00cursorhints\x00hiddencolumns\x00mem3\x00mem5\x00offset_sql_func\x00snapshot\x00mutex\x00mutex_noop\x00altertable\x00api_armor\x00atomicwrite\x00json1\x00has_codec\x00like_match_blobs\x00attach\x00auth\x00autoinc\x00autoreset\x00autovacuum\x00default_autovacuum\x00between_opt\x00builtin_test\x00bloblit\x00cast\x00check\x00cte\x00columnmetadata\x00oversize_cell_check\x00compileoption_diags\x00compound\x00conflict\x00crashtest\x00datetime\x00decltype\x00deprecated\x00diskio\x00floatingpoint\x00foreignkey\x00fts1\x00fts2\x00fts3\x00fts5\x00fts3_unicode\x00fts4_deferred\x00gettable\x00icu\x00icu_collations\x00integrityck\x00legacyformat\x00like_opt\x00load_ext\x00localtime\x00lookaside\x00long_double\x00memorydb\x00memorymanage\x00mergesort\x00null_trim\x00or_opt\x00rbu\x00pager_pragmas\x00pragma\x00reindex\x00rtree\x00rtree_int_only\x00schema_pragmas\x00schema_version\x00session\x00stmtvtab\x00scanstatus\x00lock_proxy_pragmas\x00prefer_proxy_locking\x00shared_cache\x00subquery\x00tclvar\x00threadsafe\x00threadsafe1\x00threadsafe2\x00tempdb\x00trigger\x00truncate_opt\x00vacuum\x00view\x00vtab\x00wal\x00wsd\x00update_delete_limit\x00fast_secure_delete\x00secure_delete\x00userauth\x00multiplex_ext_overwrite\x00yytrackmaxstackdepth\x00sqllog\x00uri_00_error\x00normalize\x00windowfunc\x00SQLITE_MAX_LENGTH\x00SQLITE_MAX_COLUMN\x00SQLITE_MAX_SQL_LENGTH\x00SQLITE_MAX_EXPR_DEPTH\x00SQLITE_MAX_COMPOUND_SELECT\x00SQLITE_MAX_VDBE_OP\x00SQLITE_MAX_FUNCTION_ARG\x00SQLITE_MAX_VARIABLE_NUMBER\x00SQLITE_MAX_PAGE_SIZE\x00SQLITE_MAX_PAGE_COUNT\x00SQLITE_MAX_LIKE_PATTERN_LENGTH\x00SQLITE_MAX_TRIGGER_DEPTH\x00SQLITE_DEFAULT_CACHE_SIZE\x00SQLITE_DEFAULT_PAGE_SIZE\x00SQLITE_DEFAULT_FILE_FORMAT\x00SQLITE_DEFAULT_SYNCHRONOUS\x00SQLITE_DEFAULT_WAL_SYNCHRONOUS\x00SQLITE_MAX_ATTACHED\x00SQLITE_MAX_DEFAULT_PAGE_SIZE\x00SQLITE_MAX_WORKER_THREADS\x00TEMP_STORE\x00%s-journal\x00%s-wal\x00%s-shm\x00%s%03d\x00%s-journal%03d\x00%s-wal%03d\x00Loadable extensions are not supported\x00demo\x00register_demovfs\x00unregister_demovfs\x00devsym\x00writecrash\x00CREATE TABLE xyz(dir, name);\x00CREATE TABLE xyz(path, size, data);\x00WITH r(d) AS ( SELECT CASE WHEN dir=?2 THEN ?3 ELSE dir END || '/' || name FROM fsdir WHERE dir=?1 AND name NOT LIKE '.%' UNION ALL SELECT dir || '/' || name FROM r, fsdir WHERE dir=d AND name NOT LIKE '.%') SELECT d FROM r;\x00/\x00CREATE TABLE x(path TEXT, data TEXT)\x00SELECT * FROM %Q.%Q WHERE rowid=?\x00fs\x00fstree\x00register_fs_module\x00abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-!,:*^+=_|?/<> \x00sqlite3_prepare_v2() error: %s\x000123456789abcdef\x00x'\x00test_agg_errmsg16\x00randstr\x00test_destructor\x00test_destructor16\x00hex_to_utf16be\x00hex_to_utf16le\x00hex_to_utf8\x00test_destructor_count\x00test_auxdata\x00test_error\x00test_eval\x00test_isolation\x00test_counter\x00real2hex\x00test_decode\x00test_extract\x00test_zeroblob\x00test_getsubtype\x00test_setsubtype\x00test_frombind\x00tx\x00funcxx_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789\x00nullx_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789\x00sqlite3_create_function abused test failed\x00invalid matchinfo blob passed to function rank()\x00wrong number of arguments to function rank()\x00rank\x00autoinstall_test_functions\x00abuse_create_function\x00install_fts3_rank_function\x000123456789ABCDEF\x00FILENAME OFFSET AMT\x00r\x00cannot open input file \x00FILENAME OFFSET HEXDATA\x00r+b\x00r+\x00cannot open output file \x00HEXDATA\x00[utf8_to_utf8] unavailable - SQLITE_DEBUG not defined\x00BLOB VARNAME\x00LIST\x00hexio_read\x00hexio_write\x00hexio_get_int\x00hexio_render_int16\x00hexio_render_int32\x00utf8_to_utf8\x00read_fts3varint\x00make_fts3record\x00mem\x00pcache\x00Unknown argument: \"\x00init_wrapper_install\x00init_wrapper_query\x00init_wrapper_uninstall\x00init_wrapper_clear\x00CREATE TABLE x(value INTEGER PRIMARY KEY)\x00CREATE VIRTUAL TABLE temp.%Q USING %Q\x00INTARRAY\x00SQLITE_NOMEM\x00sqlite3_intarray_create\x00sqlite3_intarray_bind\x00jt\x00-journal\x00NBYTES\x00PRIOR NBYTES\x00bad pointer: \x00PRIOR\x00ADDRESS SIZE HEX\x00size must be positive\x00no data\x00ADDRESS SIZE\x00?RESET?\x00DEPT\x00FILENAME\x00COUNTER ?OPTIONS?\x00-repeat\x00-benigncnt\x00TITLE\x00SUB-COMMAND ...\x00start\x00stop\x00dump\x00clear\x00sync\x00SIZE N\x00INSTALLFLAG DISCARDCHANCE PRNGSEEED HIGHSTRESS\x00discard-chance should be between 0 and 100\x00BOOLEAN\x00SIZE COUNT\x00BUFID SIZE COUNT\x00illegal arguments - see documentation\x00NBYTE NMINALLOC\x00[DB]\x00sqlite3_db_config(db, 99999) does not return SQLITE_ERROR\x00sqlite3_config(99999) does not return SQLITE_ERROR\x00PARAMETER RESETFLAG\x00SQLITE_STATUS_MEMORY_USED\x00SQLITE_STATUS_MALLOC_SIZE\x00SQLITE_STATUS_PAGECACHE_USED\x00SQLITE_STATUS_PAGECACHE_OVERFLOW\x00SQLITE_STATUS_PAGECACHE_SIZE\x00SQLITE_STATUS_SCRATCH_USED\x00SQLITE_STATUS_SCRATCH_OVERFLOW\x00SQLITE_STATUS_SCRATCH_SIZE\x00SQLITE_STATUS_PARSER_STACK\x00SQLITE_STATUS_MALLOC_COUNT\x00DB PARAMETER RESETFLAG\x00SQLITE_\x00DBSTATUS_\x00LOOKASIDE_USED\x00CACHE_USED\x00SCHEMA_USED\x00STMT_USED\x00LOOKASIDE_HIT\x00LOOKASIDE_MISS_SIZE\x00LOOKASIDE_MISS_FULL\x00CACHE_HIT\x00CACHE_MISS\x00CACHE_WRITE\x00DEFERRED_FKS\x00CACHE_USED_SHARED\x00CACHE_SPILL\x00?INTEGER?\x00sqlite3_free\x00memset\x00memget\x00sqlite3_memory_used\x00sqlite3_memory_highwater\x00sqlite3_memdebug_backtrace\x00sqlite3_memdebug_dump\x00sqlite3_memdebug_fail\x00sqlite3_memdebug_pending\x00sqlite3_memdebug_settitle\x00sqlite3_memdebug_malloc_count\x00sqlite3_memdebug_log\x00sqlite3_config_pagecache\x00sqlite3_config_alt_pcache\x00sqlite3_status\x00sqlite3_db_status\x00install_malloc_faultsim\x00sqlite3_config_heap\x00sqlite3_config_heap_size\x00sqlite3_config_memstatus\x00sqlite3_config_lookaside\x00sqlite3_config_error\x00sqlite3_config_uri\x00sqlite3_config_cis\x00sqlite3_config_pmasz\x00sqlite3_db_config_lookaside\x00sqlite3_dump_memsys3\x00sqlite3_dump_memsys5\x00sqlite3_install_memsys3\x00sqlite3_memdebug_vfs_oom_test\x00%05u\x00 FILENAME [OFFSET AMT]\"\x00unable to open file \"\x00\" for reading\x00md5\x00md5-10x8\x00md5file\x00md5file-10x8\x00md5sum\x00%03d\x00multiplexor.xAccess failure on %s\x00multiplexor.xOpen failure on %s\x00multiplex_control\x00chunksize\x00multiplex_truncate\x00multiplex/%z\x00multiplex\x00NAME MAKEDEFAULT\x00-force\x00?-force?\x00enable\x00chunk_size\x00max_chunks\x00HANDLE DBNAME SUB-COMMAND INT-VALUE\x00expected database handle, got \"\x00SUB-COMMAND\x00sqlite3_multiplex_initialize\x00sqlite3_multiplex_shutdown\x00sqlite3_multiplex_control\x00fast\x00recursive\x00static_master\x00static_mem\x00static_open\x00static_prng\x00static_lru\x00static_pmem\x00static_app1\x00static_app2\x00static_app3\x00static_vfs1\x00static_vfs2\x00static_vfs3\x00mutex counters are \x00already installed\x00not installed\x00singlethread\x00multithread\x00serialized\x00mutex name\x00NAME\x00disable_mutex_init\x00disable_mutex_try\x00sqlite3_shutdown\x00sqlite3_initialize\x00sqlite3_config\x00enter_static_mutex\x00leave_static_mutex\x00enter_db_mutex\x00leave_db_mutex\x00alloc_dealloc_mutex\x00install_mutex_counters\x00read_mutex_counters\x00clear_mutex_counters\x00\x00\x00\x00\x00\x00\x00\x00vfslog/%z\x00sqlite_ostrace1.....\x00xClose\x00xRead\x00xWrite\x00xTruncate\x00xFilesize\x00xLock\x00xUnlock\x00xCheckResLock\x00xFileControl\x00xSectorSize\x00xDeviceChar\x00xDelete\x00xAccess\x00xFullPathname\x00xRandomness\x00xSleep\x00xCurrentTime\x00xShmUnmap\x00xShmLock\x00xShmBarrier\x00xShmMap\x00annotation\x00CREATE TABLE xxx(event, file, click, rc, size, offset)\x00vfslog\x00VFS\x00failed\x00VFS PARENT LOGFILE\x00bad sqlite3 handle: \x00annotate\x00finalize\x00new\x00register\x00quota/%z\x00quota\x00::piLimit_\x00PATTERN LIMIT SCRIPT\x00FILENAME MODE\x00HANDLE SIZE NELEM\x00HANDLE SIZE NELEM CONTENT\x00HANDLE ?HARDSYNC?\x00HANDLE OFFSET WHENCE\x00SEEK_SET\x00SEEK_CUR\x00SEEK_END\x00WHENCE should be SEEK_SET, SEEK_CUR, or SEEK_END\x00HANDLE SIZE\x00PATTERN TEXT\x00sqlite3_quota_initialize\x00sqlite3_quota_shutdown\x00sqlite3_quota_set\x00sqlite3_quota_file\x00sqlite3_quota_dump\x00sqlite3_quota_fopen\x00sqlite3_quota_fread\x00sqlite3_quota_fwrite\x00sqlite3_quota_fclose\x00sqlite3_quota_fflush\x00sqlite3_quota_fseek\x00sqlite3_quota_rewind\x00sqlite3_quota_ftell\x00sqlite3_quota_ftruncate\x00sqlite3_quota_file_size\x00sqlite3_quota_file_truesize\x00sqlite3_quota_file_mtime\x00sqlite3_quota_remove\x00sqlite3_quota_glob\x00sqlite3_quota_file_available\x00sqlite3_quota_ferror\x00register_cube_geom\x00register_circle_geom\x00CREATE TABLE x(database,tablename,cid,name,type,not_null,dflt_value,pk)\x00SELECT name FROM sqlite_temp_master WHERE type='table'\x00SELECT name FROM %Q.sqlite_master WHERE type='table'\x00PRAGMA %Q.table_info(%Q)\x00PRAGMA database_list\x00register_schema_module\x00PRAGMA main.journal_mode\x00CMDNAME PATH ?VFS? ?BUSY-HANDLER-SCRIPT?\x00sqlite3demo_superlock\x00open\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00pread\x00pread64\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00mremap\x00SYSCALL-LIST\x00system-call\x00?COUNT PERSIST?\x00EACCES\x00EINTR\x00EIO\x00EOVERFLOW\x00ENOMEM\x00EAGAIN\x00ETIMEDOUT\x00EBUSY\x00EPERM\x00EDEADLK\x00ENOLCK\x00SYSCALL ERRNO\x00errno\x00PGSZ\x00getpagesize\x00pgsz out of range\x00fault\x00install\x00uninstall\x00list\x00defaultvfs\x00pagesize\x00VFS does not support xSetSystemCall\x00test_syscall\x00load_testfixture_extensions\x00SLAVE\x00CREATE TABLE x( name TEXT, arrayname TEXT, value TEXT, fullname TEXT PRIMARY KEY) WITHOUT ROWID\x00array names\x00tclvar_filter_cmd\x00%s(%s)\x00expr {[info exists ::tclvar_set_omit] && $::tclvar_set_omit}\x00the 'fullname' column must be TEXT\x00prohibited TCL variable change\x00proc like {pattern str} {\n set p [string map {% * _ ?} $pattern]\n string match $p $str\n}\nproc tclvar_filter_cmd {eq match glob regexp like} {\n set res {}\n set pattern $eq\n if {$pattern=={}} { set pattern $match }\n if {$pattern=={}} { set pattern * }\n foreach v [uplevel #0 info vars $pattern] {\n if {($glob=={} || [string match $glob [uplevel #0 set $v]])\n && ($like=={} || [like $like [uplevel #0 set $v]])\n && ($regexp=={} || [regexp $regexp [uplevel #0 set $v]])\n } {\n lappend res $v\n }\n }\n set res\n}\n\x00register_tclvar_module\x00clock_seconds\x00sqlthread\x00sqlite3_blocking_step\x00sqlite3_blocking_prepare_v2\x00sqlite3_nonblocking_prepare_v2\x00error\x00set\x00Error in Tcl_CreateThread()\x00no parent thread\x00parent\x00spawn\x00VARNAME SCRIPT\x00DBNAME\x00id\x00%s \x00SQLITE_ERROR\x00SQLITE_IOERR\x00SQLITE_LOCKED\x00SQLITE_BUSY\x00SQLITE_READONLY\x00SQLITE_READONLY_CANTINIT\x00SQLITE_NOTFOUND\x00SQLITE_OMIT\x00normal|dataonly\x00full|dataonly\x00xCheckReservedLock\x00BEGIN_ATOMIC_WRITE\x00COMMIT_ATOMIC_WRITE\x00ZIPVFS\x00anon\x00SQLITE_ACCESS_EXISTS\x00SQLITE_ACCESS_READWRITE\x00SQLITE_ACCESS_READ\x00xShmOpen\x00 lock\x00 unlock\x00 shared\x00 exclusive\x00shm\x00delete\x00filter\x00ioerr\x00fullerr\x00cantopenerr\x00script\x00devchar\x00sectorsize\x00subcommand\x00FILE ?VALUE?\x00failed to get full path: \x00no such file: \x00unknown method: \x00?CNT PERSIST?\x00default\x00undeletable_when_open\x00immutable\x00?ATTR-LIST?\x00bad flags: \x00?VALUE?\x00-noshm\x00-szosfile\x00-mxpathname\x00-iversion\x00-fullshm\x00VFSNAME ?-noshm BOOL? ?-fullshm BOOL? ?-default BOOL? ?-mxpathname INT? ?-szosfile INT? ?-iversion INT?\x00shared\x00lock\x00unlock\x00DB DBNAME (shared|exclusive) (lock|unlock) OFFSET N\x00ARG\x00DB DBNAME SLOT ?VALUE?\x00*-shm is not yet mapped\x00testvfs\x00vfs_shmlock\x00vfs_set_readmark\x00DB NAME XSTEP XFINAL XVALUE XINVERSE\x00fff\x00misuse test error\x00invalid argument\x00sumint\x00sum\x00sqlite3_create_window_function\x00test_create_window_function_misuse\x00test_create_sumint\x00test_override_sum\x00"
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 8 /* .xCreate */)) = amatchConnect // amatch.c:1456:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 16 /* .xConnect */)) = amatchConnect // amatch.c:1457:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 24 /* .xBestIndex */)) = amatchBestIndex // amatch.c:1458:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 32 /* .xDisconnect */)) = amatchDisconnect // amatch.c:1459:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 40 /* .xDestroy */)) = amatchDisconnect // amatch.c:1460:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 48 /* .xOpen */)) = amatchOpen // amatch.c:1461:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 56 /* .xClose */)) = amatchClose // amatch.c:1462:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 64 /* .xFilter */)) = amatchFilter // amatch.c:1463:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 72 /* .xNext */)) = amatchNext // amatch.c:1464:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 80 /* .xEof */)) = amatchEof // amatch.c:1465:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 88 /* .xColumn */)) = amatchColumn // amatch.c:1466:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 96 /* .xRowid */)) = amatchRowid // amatch.c:1467:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&amatchModule)) + 104 /* .xUpdate */)) = amatchUpdate // amatch.c:1468:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 16 /* .xConnect */)) = carrayConnect // carray.c:336:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 24 /* .xBestIndex */)) = carrayBestIndex // carray.c:337:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 32 /* .xDisconnect */)) = carrayDisconnect // carray.c:338:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 48 /* .xOpen */)) = carrayOpen // carray.c:340:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 56 /* .xClose */)) = carrayClose // carray.c:341:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 64 /* .xFilter */)) = carrayFilter // carray.c:342:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 72 /* .xNext */)) = carrayNext // carray.c:343:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 80 /* .xEof */)) = carrayEof // carray.c:344:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 88 /* .xColumn */)) = carrayColumn // carray.c:345:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&carrayModule)) + 96 /* .xRowid */)) = carrayRowid // carray.c:346:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 8 /* .xCreate */)) = closureConnect // closure.c:920:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 16 /* .xConnect */)) = closureConnect // closure.c:921:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 24 /* .xBestIndex */)) = closureBestIndex // closure.c:922:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 32 /* .xDisconnect */)) = closureDisconnect // closure.c:923:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 40 /* .xDestroy */)) = closureDisconnect // closure.c:924:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 48 /* .xOpen */)) = closureOpen // closure.c:925:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 56 /* .xClose */)) = closureClose // closure.c:926:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 64 /* .xFilter */)) = closureFilter // closure.c:927:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 72 /* .xNext */)) = closureNext // closure.c:928:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 80 /* .xEof */)) = closureEof // closure.c:929:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 88 /* .xColumn */)) = closureColumn // closure.c:930:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&closureModule)) + 96 /* .xRowid */)) = closureRowid // closure.c:931:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 40 /* .xOpen */)) = cfOpen // test6.c:853:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 48 /* .xDelete */)) = cfDelete // test6.c:854:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 56 /* .xAccess */)) = cfAccess // test6.c:855:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 64 /* .xFullPathname */)) = cfFullPathname // test6.c:856:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 72 /* .xDlOpen */)) = cfDlOpen // test6.c:857:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 80 /* .xDlError */)) = cfDlError // test6.c:858:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 88 /* .xDlSym */)) = cfDlSym // test6.c:859:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 96 /* .xDlClose */)) = cfDlClose // test6.c:860:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 104 /* .xRandomness */)) = cfRandomness // test6.c:861:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 112 /* .xSleep */)) = cfSleep // test6.c:862:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 120 /* .xCurrentTime */)) = cfCurrentTime // test6.c:863:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&crashVfs)) + 128 /* .xGetLastError */)) = cfGetLastError // test6.c:864:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 8 /* .xClose */)) = demoClose // test_demovfs.c:402:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 16 /* .xRead */)) = demoRead // test_demovfs.c:403:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 24 /* .xWrite */)) = demoWrite // test_demovfs.c:404:5:
+ *(*func(*libc.TLS, uintptr, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 32 /* .xTruncate */)) = demoTruncate // test_demovfs.c:405:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 40 /* .xSync */)) = demoSync // test_demovfs.c:406:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 48 /* .xFileSize */)) = demoFileSize // test_demovfs.c:407:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 56 /* .xLock */)) = demoLock // test_demovfs.c:408:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 64 /* .xUnlock */)) = demoUnlock // test_demovfs.c:409:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 72 /* .xCheckReservedLock */)) = demoCheckReservedLock // test_demovfs.c:410:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 80 /* .xFileControl */)) = demoFileControl // test_demovfs.c:411:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 88 /* .xSectorSize */)) = demoSectorSize // test_demovfs.c:412:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demoio)) + 96 /* .xDeviceCharacteristics */)) = demoDeviceCharacteristics // test_demovfs.c:413:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 40 /* .xOpen */)) = demoOpen // test_demovfs.c:627:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 48 /* .xDelete */)) = demoDelete // test_demovfs.c:628:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 56 /* .xAccess */)) = demoAccess // test_demovfs.c:629:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 64 /* .xFullPathname */)) = demoFullPathname // test_demovfs.c:630:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 72 /* .xDlOpen */)) = demoDlOpen // test_demovfs.c:631:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 80 /* .xDlError */)) = demoDlError // test_demovfs.c:632:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 88 /* .xDlSym */)) = demoDlSym // test_demovfs.c:633:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 96 /* .xDlClose */)) = demoDlClose // test_demovfs.c:634:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 104 /* .xRandomness */)) = demoRandomness // test_demovfs.c:635:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 112 /* .xSleep */)) = demoSleep // test_demovfs.c:636:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&demovfs)) + 120 /* .xCurrentTime */)) = demoCurrentTime // test_demovfs.c:637:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 8 /* .xClose */)) = devsymClose // test_devsym.c:229:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 16 /* .xRead */)) = devsymRead // test_devsym.c:230:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 24 /* .xWrite */)) = devsymWrite // test_devsym.c:231:3:
+ *(*func(*libc.TLS, uintptr, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 32 /* .xTruncate */)) = devsymTruncate // test_devsym.c:232:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 40 /* .xSync */)) = devsymSync // test_devsym.c:233:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 48 /* .xFileSize */)) = devsymFileSize // test_devsym.c:234:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 56 /* .xLock */)) = devsymLock // test_devsym.c:235:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 64 /* .xUnlock */)) = devsymUnlock // test_devsym.c:236:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 72 /* .xCheckReservedLock */)) = devsymCheckReservedLock // test_devsym.c:237:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 80 /* .xFileControl */)) = devsymFileControl // test_devsym.c:238:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 88 /* .xSectorSize */)) = devsymSectorSize // test_devsym.c:239:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 96 /* .xDeviceCharacteristics */)) = devsymDeviceCharacteristics // test_devsym.c:240:3:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 104 /* .xShmMap */)) = devsymShmMap // test_devsym.c:241:3:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 112 /* .xShmLock */)) = devsymShmLock // test_devsym.c:242:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 120 /* .xShmBarrier */)) = devsymShmBarrier // test_devsym.c:243:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_io_methods)) + 128 /* .xShmUnmap */)) = devsymShmUnmap // test_devsym.c:244:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 40 /* .xOpen */)) = devsymOpen // test_devsym.c:428:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 48 /* .xDelete */)) = devsymDelete // test_devsym.c:429:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 56 /* .xAccess */)) = devsymAccess // test_devsym.c:430:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 64 /* .xFullPathname */)) = devsymFullPathname // test_devsym.c:431:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 104 /* .xRandomness */)) = devsymRandomness // test_devsym.c:443:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 112 /* .xSleep */)) = devsymSleep // test_devsym.c:444:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&devsym_vfs)) + 120 /* .xCurrentTime */)) = devsymCurrentTime // test_devsym.c:445:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 8 /* .xCreate */)) = echoCreate // test8.c:1301:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 16 /* .xConnect */)) = echoConnect // test8.c:1302:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 24 /* .xBestIndex */)) = echoBestIndex // test8.c:1303:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 32 /* .xDisconnect */)) = echoDisconnect // test8.c:1304:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 40 /* .xDestroy */)) = echoDestroy // test8.c:1305:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 48 /* .xOpen */)) = echoOpen // test8.c:1306:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 56 /* .xClose */)) = echoClose // test8.c:1307:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 64 /* .xFilter */)) = echoFilter // test8.c:1308:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 72 /* .xNext */)) = echoNext // test8.c:1309:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 80 /* .xEof */)) = echoEof // test8.c:1310:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 88 /* .xColumn */)) = echoColumn // test8.c:1311:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 96 /* .xRowid */)) = echoRowid // test8.c:1312:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 104 /* .xUpdate */)) = echoUpdate // test8.c:1313:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 112 /* .xBegin */)) = echoBegin // test8.c:1314:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 120 /* .xSync */)) = echoSync // test8.c:1315:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 128 /* .xCommit */)) = echoCommit // test8.c:1316:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 136 /* .xRollback */)) = echoRollback // test8.c:1317:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 144 /* .xFindFunction */)) = echoFindFunction // test8.c:1318:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModule)) + 152 /* .xRename */)) = echoRename // test8.c:1319:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 8 /* .xCreate */)) = echoCreate // test8.c:1324:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 16 /* .xConnect */)) = echoConnect // test8.c:1325:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 24 /* .xBestIndex */)) = echoBestIndex // test8.c:1326:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 32 /* .xDisconnect */)) = echoDisconnect // test8.c:1327:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 40 /* .xDestroy */)) = echoDestroy // test8.c:1328:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 48 /* .xOpen */)) = echoOpen // test8.c:1329:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 56 /* .xClose */)) = echoClose // test8.c:1330:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 64 /* .xFilter */)) = echoFilter // test8.c:1331:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 72 /* .xNext */)) = echoNext // test8.c:1332:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 80 /* .xEof */)) = echoEof // test8.c:1333:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 88 /* .xColumn */)) = echoColumn // test8.c:1334:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 96 /* .xRowid */)) = echoRowid // test8.c:1335:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 104 /* .xUpdate */)) = echoUpdate // test8.c:1336:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 112 /* .xBegin */)) = echoBegin // test8.c:1337:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 120 /* .xSync */)) = echoSync // test8.c:1338:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 128 /* .xCommit */)) = echoCommit // test8.c:1339:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 136 /* .xRollback */)) = echoRollback // test8.c:1340:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 144 /* .xFindFunction */)) = echoFindFunction // test8.c:1341:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 152 /* .xRename */)) = echoRename // test8.c:1342:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 160 /* .xSavepoint */)) = echoSavepoint // test8.c:1343:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 168 /* .xRelease */)) = echoRelease // test8.c:1344:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&echoModuleV2)) + 176 /* .xRollbackTo */)) = echoRollbackTo // test8.c:1345:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 8 /* .xCreate */)) = expertConnect // sqlite3expert.c:625:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 16 /* .xConnect */)) = expertConnect // sqlite3expert.c:626:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 24 /* .xBestIndex */)) = expertBestIndex // sqlite3expert.c:627:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 32 /* .xDisconnect */)) = expertDisconnect // sqlite3expert.c:628:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 40 /* .xDestroy */)) = expertDisconnect // sqlite3expert.c:629:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 48 /* .xOpen */)) = expertOpen // sqlite3expert.c:630:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 56 /* .xClose */)) = expertClose // sqlite3expert.c:631:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 64 /* .xFilter */)) = expertFilter // sqlite3expert.c:632:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 72 /* .xNext */)) = expertNext // sqlite3expert.c:633:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 80 /* .xEof */)) = expertEof // sqlite3expert.c:634:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 88 /* .xColumn */)) = expertColumn // sqlite3expert.c:635:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 96 /* .xRowid */)) = expertRowid // sqlite3expert.c:636:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&expertModule)) + 104 /* .xUpdate */)) = expertUpdate // sqlite3expert.c:637:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 16 /* .xConnect */)) = explainConnect // explain.c:274:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 24 /* .xBestIndex */)) = explainBestIndex // explain.c:275:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 32 /* .xDisconnect */)) = explainDisconnect // explain.c:276:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 48 /* .xOpen */)) = explainOpen // explain.c:278:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 56 /* .xClose */)) = explainClose // explain.c:279:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 64 /* .xFilter */)) = explainFilter // explain.c:280:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 72 /* .xNext */)) = explainNext // explain.c:281:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 80 /* .xEof */)) = explainEof // explain.c:282:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 88 /* .xColumn */)) = explainColumn // explain.c:283:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&explainModule)) + 96 /* .xRowid */)) = explainRowid // explain.c:284:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 8 /* .xCreate */)) = fsConnect // test_fs.c:800:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 16 /* .xConnect */)) = fsConnect // test_fs.c:801:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 24 /* .xBestIndex */)) = fsBestIndex // test_fs.c:802:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 32 /* .xDisconnect */)) = fsDisconnect // test_fs.c:803:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 40 /* .xDestroy */)) = fsDisconnect // test_fs.c:804:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 48 /* .xOpen */)) = fsOpen // test_fs.c:805:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 56 /* .xClose */)) = fsClose // test_fs.c:806:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 64 /* .xFilter */)) = fsFilter // test_fs.c:807:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 72 /* .xNext */)) = fsNext // test_fs.c:808:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 80 /* .xEof */)) = fsEof // test_fs.c:809:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 88 /* .xColumn */)) = fsColumn // test_fs.c:810:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsModule)) + 96 /* .xRowid */)) = fsRowid // test_fs.c:811:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 8 /* .xClose */)) = fsClose1 // test_onefile.c:210:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 16 /* .xRead */)) = fsRead // test_onefile.c:211:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 24 /* .xWrite */)) = fsWrite // test_onefile.c:212:3:
+ *(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 32 /* .xTruncate */)) = fsTruncate // test_onefile.c:213:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 40 /* .xSync */)) = fsSync // test_onefile.c:214:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 48 /* .xFileSize */)) = fsFileSize // test_onefile.c:215:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 56 /* .xLock */)) = fsLock // test_onefile.c:216:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 64 /* .xUnlock */)) = fsUnlock // test_onefile.c:217:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 72 /* .xCheckReservedLock */)) = fsCheckReservedLock // test_onefile.c:218:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 80 /* .xFileControl */)) = fsFileControl // test_onefile.c:219:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 88 /* .xSectorSize */)) = fsSectorSize // test_onefile.c:220:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_io_methods)) + 96 /* .xDeviceCharacteristics */)) = fsDeviceCharacteristics // test_onefile.c:221:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 40 /* .xOpen */)) = fsOpen1 // test_onefile.c:191:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 48 /* .xDelete */)) = fsDelete // test_onefile.c:192:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 56 /* .xAccess */)) = fsAccess // test_onefile.c:193:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 64 /* .xFullPathname */)) = fsFullPathname // test_onefile.c:194:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 72 /* .xDlOpen */)) = fsDlOpen // test_onefile.c:195:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 80 /* .xDlError */)) = fsDlError // test_onefile.c:196:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 88 /* .xDlSym */)) = fsDlSym // test_onefile.c:197:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 96 /* .xDlClose */)) = fsDlClose // test_onefile.c:198:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 104 /* .xRandomness */)) = fsRandomness // test_onefile.c:199:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 112 /* .xSleep */)) = fsSleep // test_onefile.c:200:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fs_vfs)) + 120 /* .xCurrentTime */)) = fsCurrentTime // test_onefile.c:201:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 8 /* .xCreate */)) = fsdirConnect1 // test_fs.c:823:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 16 /* .xConnect */)) = fsdirConnect1 // test_fs.c:824:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 24 /* .xBestIndex */)) = fsdirBestIndex1 // test_fs.c:825:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 32 /* .xDisconnect */)) = fsdirDisconnect1 // test_fs.c:826:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 40 /* .xDestroy */)) = fsdirDisconnect1 // test_fs.c:827:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 48 /* .xOpen */)) = fsdirOpen1 // test_fs.c:828:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 56 /* .xClose */)) = fsdirClose1 // test_fs.c:829:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 64 /* .xFilter */)) = fsdirFilter1 // test_fs.c:830:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 72 /* .xNext */)) = fsdirNext1 // test_fs.c:831:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 80 /* .xEof */)) = fsdirEof1 // test_fs.c:832:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 88 /* .xColumn */)) = fsdirColumn1 // test_fs.c:833:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule)) + 96 /* .xRowid */)) = fsdirRowid1 // test_fs.c:834:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 16 /* .xConnect */)) = fsdirConnect // fileio.c:942:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 24 /* .xBestIndex */)) = fsdirBestIndex // fileio.c:943:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 32 /* .xDisconnect */)) = fsdirDisconnect // fileio.c:944:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 48 /* .xOpen */)) = fsdirOpen // fileio.c:946:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 56 /* .xClose */)) = fsdirClose // fileio.c:947:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 64 /* .xFilter */)) = fsdirFilter // fileio.c:948:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 72 /* .xNext */)) = fsdirNext // fileio.c:949:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 80 /* .xEof */)) = fsdirEof // fileio.c:950:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 88 /* .xColumn */)) = fsdirColumn // fileio.c:951:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fsdirModule1)) + 96 /* .xRowid */)) = fsdirRowid // fileio.c:952:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 8 /* .xCreate */)) = fstreeConnect // test_fs.c:846:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 16 /* .xConnect */)) = fstreeConnect // test_fs.c:847:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 24 /* .xBestIndex */)) = fstreeBestIndex // test_fs.c:848:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 32 /* .xDisconnect */)) = fstreeDisconnect // test_fs.c:849:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 40 /* .xDestroy */)) = fstreeDisconnect // test_fs.c:850:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 48 /* .xOpen */)) = fstreeOpen // test_fs.c:851:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 56 /* .xClose */)) = fstreeClose // test_fs.c:852:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 64 /* .xFilter */)) = fstreeFilter // test_fs.c:853:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 72 /* .xNext */)) = fstreeNext // test_fs.c:854:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 80 /* .xEof */)) = fstreeEof // test_fs.c:855:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 88 /* .xColumn */)) = fstreeColumn // test_fs.c:856:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fstreeModule)) + 96 /* .xRowid */)) = fstreeRowid // test_fs.c:857:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5tok_module)) + 8 /* .xCreate */)) = fts5tokConnectMethod // fts5_test_tok.c:453:6:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5tok_module)) + 16 /* .xConnect */)) = fts5tokConnectMethod // fts5_test_tok.c:454:6:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5tok_module)) + 24 /* .xBestIndex */)) = fts5tokBestIndexMethod // fts5_test_tok.c:455:6:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5tok_module)) + 32 /* .xDisconnect */)) = fts5tokDisconnectMethod // fts5_test_tok.c:456:6:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5tok_module)) + 40 /* .xDestroy */)) = fts5tokDisconnectMethod // fts5_test_tok.c:457:6:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5tok_module)) + 48 /* .xOpen */)) = fts5tokOpenMethod // fts5_test_tok.c:458:6:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5tok_module)) + 56 /* .xClose */)) = fts5tokCloseMethod // fts5_test_tok.c:459:6:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5tok_module)) + 64 /* .xFilter */)) = fts5tokFilterMethod // fts5_test_tok.c:460:6:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5tok_module)) + 72 /* .xNext */)) = fts5tokNextMethod // fts5_test_tok.c:461:6:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5tok_module)) + 80 /* .xEof */)) = fts5tokEofMethod // fts5_test_tok.c:462:6:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5tok_module)) + 88 /* .xColumn */)) = fts5tokColumnMethod // fts5_test_tok.c:463:6:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5tok_module)) + 96 /* .xRowid */)) = fts5tokRowidMethod // fts5_test_tok.c:464:6:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 8 /* .xCreate */)) = fuzzerConnect // fuzzer.c:1149:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 16 /* .xConnect */)) = fuzzerConnect // fuzzer.c:1150:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 24 /* .xBestIndex */)) = fuzzerBestIndex // fuzzer.c:1151:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 32 /* .xDisconnect */)) = fuzzerDisconnect // fuzzer.c:1152:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 40 /* .xDestroy */)) = fuzzerDisconnect // fuzzer.c:1153:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 48 /* .xOpen */)) = fuzzerOpen // fuzzer.c:1154:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 56 /* .xClose */)) = fuzzerClose // fuzzer.c:1155:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 64 /* .xFilter */)) = fuzzerFilter // fuzzer.c:1156:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 72 /* .xNext */)) = fuzzerNext // fuzzer.c:1157:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 80 /* .xEof */)) = fuzzerEof // fuzzer.c:1158:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 88 /* .xColumn */)) = fuzzerColumn // fuzzer.c:1159:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fuzzerModule)) + 96 /* .xRowid */)) = fuzzerRowid // fuzzer.c:1160:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 8 /* .xCreate */)) = intarrayCreate // test_intarray.c:189:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 16 /* .xConnect */)) = intarrayCreate // test_intarray.c:190:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 24 /* .xBestIndex */)) = intarrayBestIndex // test_intarray.c:191:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 32 /* .xDisconnect */)) = intarrayDestroy // test_intarray.c:192:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 40 /* .xDestroy */)) = intarrayDestroy // test_intarray.c:193:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 48 /* .xOpen */)) = intarrayOpen // test_intarray.c:194:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 56 /* .xClose */)) = intarrayClose // test_intarray.c:195:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 64 /* .xFilter */)) = intarrayFilter // test_intarray.c:196:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 72 /* .xNext */)) = intarrayNext // test_intarray.c:197:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 80 /* .xEof */)) = intarrayEof // test_intarray.c:198:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 88 /* .xColumn */)) = intarrayColumn // test_intarray.c:199:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&intarrayModule)) + 96 /* .xRowid */)) = intarrayRowid // test_intarray.c:200:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 8 /* .xClose */)) = jtClose // test_journal.c:189:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 16 /* .xRead */)) = jtRead // test_journal.c:190:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 24 /* .xWrite */)) = jtWrite // test_journal.c:191:3:
+ *(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 32 /* .xTruncate */)) = jtTruncate // test_journal.c:192:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 40 /* .xSync */)) = jtSync // test_journal.c:193:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 48 /* .xFileSize */)) = jtFileSize // test_journal.c:194:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 56 /* .xLock */)) = jtLock // test_journal.c:195:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 64 /* .xUnlock */)) = jtUnlock // test_journal.c:196:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 72 /* .xCheckReservedLock */)) = jtCheckReservedLock // test_journal.c:197:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 80 /* .xFileControl */)) = jtFileControl // test_journal.c:198:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 88 /* .xSectorSize */)) = jtSectorSize // test_journal.c:199:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_io_methods)) + 96 /* .xDeviceCharacteristics */)) = jtDeviceCharacteristics // test_journal.c:200:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 40 /* .xOpen */)) = jtOpen // test_journal.c:172:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 48 /* .xDelete */)) = jtDelete // test_journal.c:173:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 56 /* .xAccess */)) = jtAccess // test_journal.c:174:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 64 /* .xFullPathname */)) = jtFullPathname // test_journal.c:175:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 72 /* .xDlOpen */)) = jtDlOpen // test_journal.c:176:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 80 /* .xDlError */)) = jtDlError // test_journal.c:177:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 88 /* .xDlSym */)) = jtDlSym // test_journal.c:178:3:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 96 /* .xDlClose */)) = jtDlClose // test_journal.c:179:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 104 /* .xRandomness */)) = jtRandomness // test_journal.c:180:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 112 /* .xSleep */)) = jtSleep // test_journal.c:181:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 120 /* .xCurrentTime */)) = jtCurrentTime // test_journal.c:182:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 128 /* .xGetLastError */)) = jtGetLastError // test_journal.c:183:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jt_vfs)) + 136 /* .xCurrentTimeInt64 */)) = jtCurrentTimeInt64 // test_journal.c:184:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 16 /* .xConnect */)) = prefixesConnect // prefixes.c:230:21:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 24 /* .xBestIndex */)) = prefixesBestIndex // prefixes.c:231:21:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 32 /* .xDisconnect */)) = prefixesDisconnect // prefixes.c:232:21:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 48 /* .xOpen */)) = prefixesOpen // prefixes.c:234:21:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 56 /* .xClose */)) = prefixesClose // prefixes.c:235:21:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 64 /* .xFilter */)) = prefixesFilter // prefixes.c:236:21:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 72 /* .xNext */)) = prefixesNext // prefixes.c:237:21:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 80 /* .xEof */)) = prefixesEof // prefixes.c:238:21:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 88 /* .xColumn */)) = prefixesColumn // prefixes.c:239:21:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&prefixesModule)) + 96 /* .xRowid */)) = prefixesRowid // prefixes.c:240:21:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&pzNeededCollation)) + 0)) = uintptr(unsafe.Pointer(&zNeededCollation)) // test1.c:3130:34:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 8 /* .xCreate */)) = schemaCreate // test_schema.c:276:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 16 /* .xConnect */)) = schemaCreate // test_schema.c:277:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 24 /* .xBestIndex */)) = schemaBestIndex // test_schema.c:278:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 32 /* .xDisconnect */)) = schemaDestroy // test_schema.c:279:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 40 /* .xDestroy */)) = schemaDestroy // test_schema.c:280:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 48 /* .xOpen */)) = schemaOpen // test_schema.c:281:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 56 /* .xClose */)) = schemaClose // test_schema.c:282:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 64 /* .xFilter */)) = schemaFilter // test_schema.c:283:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 72 /* .xNext */)) = schemaNext // test_schema.c:284:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 80 /* .xEof */)) = schemaEof // test_schema.c:285:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 88 /* .xColumn */)) = schemaColumn // test_schema.c:286:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&schemaModule)) + 96 /* .xRowid */)) = schemaRowid // test_schema.c:287:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 16 /* .xConnect */)) = seriesConnect // series.c:383:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 24 /* .xBestIndex */)) = seriesBestIndex // series.c:384:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 32 /* .xDisconnect */)) = seriesDisconnect // series.c:385:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 48 /* .xOpen */)) = seriesOpen // series.c:387:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 56 /* .xClose */)) = seriesClose // series.c:388:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 64 /* .xFilter */)) = seriesFilter // series.c:389:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 72 /* .xNext */)) = seriesNext // series.c:390:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 80 /* .xEof */)) = seriesEof // series.c:391:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 88 /* .xColumn */)) = seriesColumn // series.c:392:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&seriesModule)) + 96 /* .xRowid */)) = seriesRowid // series.c:393:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 8 /* .xCreate */)) = spellfix1Create // spellfix.c:2993:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 16 /* .xConnect */)) = spellfix1Connect // spellfix.c:2994:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 24 /* .xBestIndex */)) = spellfix1BestIndex // spellfix.c:2995:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 32 /* .xDisconnect */)) = spellfix1Disconnect // spellfix.c:2996:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 40 /* .xDestroy */)) = spellfix1Destroy // spellfix.c:2997:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 48 /* .xOpen */)) = spellfix1Open // spellfix.c:2998:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 56 /* .xClose */)) = spellfix1Close // spellfix.c:2999:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 64 /* .xFilter */)) = spellfix1Filter // spellfix.c:3000:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 72 /* .xNext */)) = spellfix1Next // spellfix.c:3001:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 80 /* .xEof */)) = spellfix1Eof // spellfix.c:3002:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 88 /* .xColumn */)) = spellfix1Column // spellfix.c:3003:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 96 /* .xRowid */)) = spellfix1Rowid // spellfix.c:3004:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 104 /* .xUpdate */)) = spellfix1Update // spellfix.c:3005:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&spellfix1Module)) + 152 /* .xRename */)) = spellfix1Rename // spellfix.c:3011:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 8 /* .xCreate */)) = tclConnect // test_bestindex.c:551:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 16 /* .xConnect */)) = tclConnect // test_bestindex.c:552:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 24 /* .xBestIndex */)) = tclBestIndex // test_bestindex.c:553:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 32 /* .xDisconnect */)) = tclDisconnect // test_bestindex.c:554:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 40 /* .xDestroy */)) = tclDisconnect // test_bestindex.c:555:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 48 /* .xOpen */)) = tclOpen // test_bestindex.c:556:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 56 /* .xClose */)) = tclClose // test_bestindex.c:557:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 64 /* .xFilter */)) = tclFilter // test_bestindex.c:558:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 72 /* .xNext */)) = tclNext // test_bestindex.c:559:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 80 /* .xEof */)) = tclEof // test_bestindex.c:560:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 88 /* .xColumn */)) = tclColumn // test_bestindex.c:561:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclModule)) + 96 /* .xRowid */)) = tclRowid // test_bestindex.c:562:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 8 /* .xCreate */)) = tclvarConnect // test_tclvar.c:471:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 16 /* .xConnect */)) = tclvarConnect // test_tclvar.c:472:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 24 /* .xBestIndex */)) = tclvarBestIndex // test_tclvar.c:473:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 32 /* .xDisconnect */)) = tclvarDisconnect // test_tclvar.c:474:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 40 /* .xDestroy */)) = tclvarDisconnect // test_tclvar.c:475:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 48 /* .xOpen */)) = tclvarOpen // test_tclvar.c:476:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 56 /* .xClose */)) = tclvarClose // test_tclvar.c:477:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 64 /* .xFilter */)) = tclvarFilter // test_tclvar.c:478:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 72 /* .xNext */)) = tclvarNext // test_tclvar.c:479:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 80 /* .xEof */)) = tclvarEof // test_tclvar.c:480:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 88 /* .xColumn */)) = tclvarColumn // test_tclvar.c:481:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 96 /* .xRowid */)) = tclvarRowid // test_tclvar.c:482:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tclvarModule)) + 104 /* .xUpdate */)) = tclvarUpdate // test_tclvar.c:483:3:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 8 /* .pArg */)) = uintptr(unsafe.Pointer(&testpcacheGlobal)) // test_pcache.c:435:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 16 /* .xInit */)) = testpcacheInit // test_pcache.c:436:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 24 /* .xShutdown */)) = testpcacheShutdown // test_pcache.c:437:5:
+ *(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 32 /* .xCreate */)) = testpcacheCreate // test_pcache.c:438:5:
+ *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 40 /* .xCachesize */)) = testpcacheCachesize // test_pcache.c:439:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 48 /* .xPagecount */)) = testpcachePagecount // test_pcache.c:440:5:
+ *(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 56 /* .xFetch */)) = testpcacheFetch // test_pcache.c:441:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 64 /* .xUnpin */)) = testpcacheUnpin // test_pcache.c:442:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 72 /* .xRekey */)) = testpcacheRekey // test_pcache.c:443:5:
+ *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 80 /* .xTruncate */)) = testpcacheTruncate // test_pcache.c:444:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&testPcache)) + 88 /* .xDestroy */)) = testpcacheDestroy // test_pcache.c:445:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 8 /* .xClose */)) = tmpClose // test_onefile.c:231:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 16 /* .xRead */)) = tmpRead // test_onefile.c:232:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 24 /* .xWrite */)) = tmpWrite // test_onefile.c:233:3:
+ *(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 32 /* .xTruncate */)) = tmpTruncate // test_onefile.c:234:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 40 /* .xSync */)) = tmpSync // test_onefile.c:235:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 48 /* .xFileSize */)) = tmpFileSize // test_onefile.c:236:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 56 /* .xLock */)) = tmpLock // test_onefile.c:237:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 64 /* .xUnlock */)) = tmpUnlock // test_onefile.c:238:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 72 /* .xCheckReservedLock */)) = tmpCheckReservedLock // test_onefile.c:239:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 80 /* .xFileControl */)) = tmpFileControl // test_onefile.c:240:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 88 /* .xSectorSize */)) = tmpSectorSize // test_onefile.c:241:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tmp_io_methods)) + 96 /* .xDeviceCharacteristics */)) = tmpDeviceCharacteristics // test_onefile.c:242:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 8 /* .xClose */)) = tvfsClose // test_vfs.c:206:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 16 /* .xRead */)) = tvfsRead // test_vfs.c:207:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 24 /* .xWrite */)) = tvfsWrite // test_vfs.c:208:3:
+ *(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 32 /* .xTruncate */)) = tvfsTruncate // test_vfs.c:209:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 40 /* .xSync */)) = tvfsSync // test_vfs.c:210:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 48 /* .xFileSize */)) = tvfsFileSize // test_vfs.c:211:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 56 /* .xLock */)) = tvfsLock // test_vfs.c:212:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 64 /* .xUnlock */)) = tvfsUnlock // test_vfs.c:213:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 72 /* .xCheckReservedLock */)) = tvfsCheckReservedLock // test_vfs.c:214:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 80 /* .xFileControl */)) = tvfsFileControl // test_vfs.c:215:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 88 /* .xSectorSize */)) = tvfsSectorSize // test_vfs.c:216:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 96 /* .xDeviceCharacteristics */)) = tvfsDeviceCharacteristics // test_vfs.c:217:3:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 104 /* .xShmMap */)) = tvfsShmMap // test_vfs.c:218:3:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 112 /* .xShmLock */)) = tvfsShmLock // test_vfs.c:219:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 120 /* .xShmBarrier */)) = tvfsShmBarrier // test_vfs.c:220:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 128 /* .xShmUnmap */)) = tvfsShmUnmap // test_vfs.c:221:3:
+ *(*func(*libc.TLS, uintptr, sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 136 /* .xFetch */)) = tvfsFetch // test_vfs.c:222:3:
+ *(*func(*libc.TLS, uintptr, sqlite3_int64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_io_methods)) + 144 /* .xUnfetch */)) = tvfsUnfetch // test_vfs.c:223:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 40 /* .xOpen */)) = tvfsOpen // test_vfs.c:1447:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 48 /* .xDelete */)) = tvfsDelete // test_vfs.c:1448:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 56 /* .xAccess */)) = tvfsAccess // test_vfs.c:1449:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 64 /* .xFullPathname */)) = tvfsFullPathname // test_vfs.c:1450:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 104 /* .xRandomness */)) = tvfsRandomness // test_vfs.c:1462:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 112 /* .xSleep */)) = tvfsSleep // test_vfs.c:1463:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&tvfs_vfs)) + 120 /* .xCurrentTime */)) = tvfsCurrentTime // test_vfs.c:1464:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 8 /* .xCreate */)) = unionConnect // unionvtab.c:1332:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 16 /* .xConnect */)) = unionConnect // unionvtab.c:1333:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 24 /* .xBestIndex */)) = unionBestIndex // unionvtab.c:1334:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 32 /* .xDisconnect */)) = unionDisconnect // unionvtab.c:1335:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 40 /* .xDestroy */)) = unionDisconnect // unionvtab.c:1336:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 48 /* .xOpen */)) = unionOpen // unionvtab.c:1337:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 56 /* .xClose */)) = unionClose // unionvtab.c:1338:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 64 /* .xFilter */)) = unionFilter // unionvtab.c:1339:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 72 /* .xNext */)) = unionNext // unionvtab.c:1340:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 80 /* .xEof */)) = unionEof // unionvtab.c:1341:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 88 /* .xColumn */)) = unionColumn // unionvtab.c:1342:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&unionModule)) + 96 /* .xRowid */)) = unionRowid // unionvtab.c:1343:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 8 /* .xClose */)) = vfslogClose // test_osinst.c:204:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 16 /* .xRead */)) = vfslogRead // test_osinst.c:205:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 24 /* .xWrite */)) = vfslogWrite // test_osinst.c:206:3:
+ *(*func(*libc.TLS, uintptr, sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 32 /* .xTruncate */)) = vfslogTruncate // test_osinst.c:207:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 40 /* .xSync */)) = vfslogSync // test_osinst.c:208:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 48 /* .xFileSize */)) = vfslogFileSize // test_osinst.c:209:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 56 /* .xLock */)) = vfslogLock // test_osinst.c:210:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 64 /* .xUnlock */)) = vfslogUnlock // test_osinst.c:211:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 72 /* .xCheckReservedLock */)) = vfslogCheckReservedLock // test_osinst.c:212:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 80 /* .xFileControl */)) = vfslogFileControl // test_osinst.c:213:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 88 /* .xSectorSize */)) = vfslogSectorSize // test_osinst.c:214:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 96 /* .xDeviceCharacteristics */)) = vfslogDeviceCharacteristics // test_osinst.c:215:3:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 104 /* .xShmMap */)) = vfslogShmMap // test_osinst.c:216:3:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 112 /* .xShmLock */)) = vfslogShmLock // test_osinst.c:217:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 120 /* .xShmBarrier */)) = vfslogShmBarrier // test_osinst.c:218:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_io_methods)) + 128 /* .xShmUnmap */)) = vfslogShmUnmap // test_osinst.c:219:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 8 /* .xCreate */)) = vlogConnect // test_osinst.c:1074:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 16 /* .xConnect */)) = vlogConnect // test_osinst.c:1075:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 24 /* .xBestIndex */)) = vlogBestIndex // test_osinst.c:1076:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 32 /* .xDisconnect */)) = vlogDisconnect // test_osinst.c:1077:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 40 /* .xDestroy */)) = vlogDisconnect // test_osinst.c:1078:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 48 /* .xOpen */)) = vlogOpen // test_osinst.c:1079:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 56 /* .xClose */)) = vlogClose // test_osinst.c:1080:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 64 /* .xFilter */)) = vlogFilter // test_osinst.c:1081:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 72 /* .xNext */)) = vlogNext // test_osinst.c:1082:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 80 /* .xEof */)) = vlogEof // test_osinst.c:1083:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 88 /* .xColumn */)) = vlogColumn // test_osinst.c:1084:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_module)) + 96 /* .xRowid */)) = vlogRowid // test_osinst.c:1085:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 40 /* .xOpen */)) = vfslogOpen // test_osinst.c:187:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 48 /* .xDelete */)) = vfslogDelete // test_osinst.c:188:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 56 /* .xAccess */)) = vfslogAccess // test_osinst.c:189:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 64 /* .xFullPathname */)) = vfslogFullPathname // test_osinst.c:190:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 72 /* .xDlOpen */)) = vfslogDlOpen // test_osinst.c:191:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 80 /* .xDlError */)) = vfslogDlError // test_osinst.c:192:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 88 /* .xDlSym */)) = vfslogDlSym // test_osinst.c:193:3:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 96 /* .xDlClose */)) = vfslogDlClose // test_osinst.c:194:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 104 /* .xRandomness */)) = vfslogRandomness // test_osinst.c:195:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 112 /* .xSleep */)) = vfslogSleep // test_osinst.c:196:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 120 /* .xCurrentTime */)) = vfslogCurrentTime // test_osinst.c:197:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 128 /* .xGetLastError */)) = vfslogGetLastError // test_osinst.c:198:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfslog_vfs)) + 136 /* .xCurrentTimeInt64 */)) = vfslogCurrentTimeInt64 // test_osinst.c:199:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 8 /* .xCreate */)) = wholenumberConnect // wholenumber.c:238:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 16 /* .xConnect */)) = wholenumberConnect // wholenumber.c:239:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 24 /* .xBestIndex */)) = wholenumberBestIndex // wholenumber.c:240:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 32 /* .xDisconnect */)) = wholenumberDisconnect // wholenumber.c:241:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 40 /* .xDestroy */)) = wholenumberDisconnect // wholenumber.c:242:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 48 /* .xOpen */)) = wholenumberOpen // wholenumber.c:243:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 56 /* .xClose */)) = wholenumberClose // wholenumber.c:244:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 64 /* .xFilter */)) = wholenumberFilter // wholenumber.c:245:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 72 /* .xNext */)) = wholenumberNext // wholenumber.c:246:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 80 /* .xEof */)) = wholenumberEof // wholenumber.c:247:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 88 /* .xColumn */)) = wholenumberColumn // wholenumber.c:248:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&wholenumberModule)) + 96 /* .xRowid */)) = wholenumberRowid // wholenumber.c:249:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 8 /* .xClose */)) = devsymClose // test_devsym.c:393:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 16 /* .xRead */)) = devsymRead // test_devsym.c:394:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 24 /* .xWrite */)) = writecrashWrite // test_devsym.c:395:3:
+ *(*func(*libc.TLS, uintptr, sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 32 /* .xTruncate */)) = devsymTruncate // test_devsym.c:396:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 40 /* .xSync */)) = devsymSync // test_devsym.c:397:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 48 /* .xFileSize */)) = devsymFileSize // test_devsym.c:398:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 56 /* .xLock */)) = devsymLock // test_devsym.c:399:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 64 /* .xUnlock */)) = devsymUnlock // test_devsym.c:400:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 72 /* .xCheckReservedLock */)) = devsymCheckReservedLock // test_devsym.c:401:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 80 /* .xFileControl */)) = devsymFileControl // test_devsym.c:402:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 88 /* .xSectorSize */)) = writecrashSectorSize // test_devsym.c:403:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 96 /* .xDeviceCharacteristics */)) = writecrashDeviceCharacteristics // test_devsym.c:404:3:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 104 /* .xShmMap */)) = devsymShmMap // test_devsym.c:405:3:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 112 /* .xShmLock */)) = devsymShmLock // test_devsym.c:406:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 120 /* .xShmBarrier */)) = devsymShmBarrier // test_devsym.c:407:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_io_methods)) + 128 /* .xShmUnmap */)) = devsymShmUnmap // test_devsym.c:408:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 40 /* .xOpen */)) = writecrashOpen // test_devsym.c:457:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 48 /* .xDelete */)) = devsymDelete // test_devsym.c:458:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 56 /* .xAccess */)) = devsymAccess // test_devsym.c:459:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 64 /* .xFullPathname */)) = devsymFullPathname // test_devsym.c:460:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 104 /* .xRandomness */)) = devsymRandomness // test_devsym.c:472:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 112 /* .xSleep */)) = devsymSleep // test_devsym.c:473:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&writecrash_vfs)) + 120 /* .xCurrentTime */)) = devsymCurrentTime // test_devsym.c:474:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 8 /* .xCreate */)) = zipfileConnect // zipfile.c:2143:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 16 /* .xConnect */)) = zipfileConnect // zipfile.c:2144:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 24 /* .xBestIndex */)) = zipfileBestIndex // zipfile.c:2145:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 32 /* .xDisconnect */)) = zipfileDisconnect // zipfile.c:2146:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 40 /* .xDestroy */)) = zipfileDisconnect // zipfile.c:2147:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 48 /* .xOpen */)) = zipfileOpen // zipfile.c:2148:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 56 /* .xClose */)) = zipfileClose // zipfile.c:2149:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 64 /* .xFilter */)) = zipfileFilter // zipfile.c:2150:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 72 /* .xNext */)) = zipfileNext // zipfile.c:2151:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 80 /* .xEof */)) = zipfileEof // zipfile.c:2152:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 88 /* .xColumn */)) = zipfileColumn // zipfile.c:2153:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 104 /* .xUpdate */)) = zipfileUpdate // zipfile.c:2155:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 112 /* .xBegin */)) = zipfileBegin // zipfile.c:2156:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 128 /* .xCommit */)) = zipfileCommit // zipfile.c:2158:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 136 /* .xRollback */)) = zipfileRollback // zipfile.c:2159:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&zipfileModule)) + 144 /* .xFindFunction */)) = zipfileFindFunction // zipfile.c:2160:5:
+}
+
+var ts1 = "%s\x00internal error!\x00SELECT * FROM main.%Q WHERE sample()\x00expert\x00PRAGMA table_info=%Q\x00main\x00, \x00%Q\x00 COLLATE %Q\x00 COLLATE %s\x00 DESC\x00PRAGMA index_list=%Q\x00PRAGMA index_xInfo=%Q\x00%s_idx_%08x\x00CREATE INDEX '%q' ON %Q(%s)\x00CREATE INDEX %s ON %s(%s)\x00EXPLAIN QUERY PLAN %s\x00 USING INDEX \x00 USING COVERING INDEX \x00%s\n\x00%s;\n\x00SELECT 'CREATE TEMP' || substr(sql, 7) FROM sqlite_schema WHERE tbl_name = %Q AND type IN ('table', 'trigger') ORDER BY type;\x00ALTER TABLE temp.%Q RENAME TO %Q\x00INSERT INTO %Q VALUES(\x00%s?\x00\x00)\x00UPDATE %Q SET \x00%s%Q=?\x00DELETE FROM %Q\x00t592690916721053953805701627921227776\x00DROP TABLE t592690916721053953805701627921227776\x00SELECT type, name, sql, 1 FROM sqlite_schema WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%%' UNION ALL SELECT type, name, sql, 2 FROM sqlite_schema WHERE type = 'trigger' AND tbl_name IN(SELECT name FROM sqlite_schema WHERE type = 'view') ORDER BY 4, 1\x00CREATE TABLE x(\x00%s%Q COLLATE %s\x00CREATE VIRTUAL TABLE %Q USING expert(%Q)\x00SELECT max(i.seqno) FROM sqlite_schema AS s, pragma_index_list(s.name) AS l, pragma_index_info(l.name) AS i WHERE s.type = 'table'\x00%sx.%Q IS rem(%d, x.%Q) COLLATE %s\x00%s%d\x00SELECT %s FROM %Q x ORDER BY %s\x00SELECT %s FROM temp.t592690916721053953805701627921227776 x ORDER BY %s\x00%d\x00 %d\x00DROP TABLE IF EXISTS temp.t592690916721053953805701627921227776\x00CREATE TABLE temp.t592690916721053953805701627921227776 AS SELECT * FROM %Q\x00SELECT s.rowid, s.name, l.name FROM sqlite_schema AS s, pragma_index_list(s.name) AS l WHERE s.type = 'table'\x00SELECT name, coll FROM pragma_index_xinfo(?) WHERE key\x00INSERT INTO sqlite_stat1 VALUES(?, ?, ?)\x00ANALYZE; PRAGMA writable_schema=1\x00rem\x00sample\x00ANALYZE sqlite_schema\x00:memory:\x00SELECT sql FROM sqlite_schema WHERE name NOT LIKE 'sqlite_%%' AND sql NOT LIKE 'CREATE VIRTUAL %%'\x00%s;%s%s\n\x00 -- stat1: \x00no such handle: \x00sql\x00TABLE\x00analyze\x00count\x00report\x00STMT EREPORT\x00destroy\x00SUBCOMMAND ...\x00sub-command\x00indexes\x00plan\x00candidates\x00DB\x00sqlite3expert%d\x00out of memory\x00sqlite3_expert_new\x00SQLITE_DONE\x00SQLITE_ERROR\x00SQLITE_OK\x00SELECT fts5(?1)\x00error: \x00fts5_api_ptr\x00f5t_2_%lld\x00xColumnCount\x00xRowCount\x00xColumnTotalSize\x00COL\x00xTokenize\x00TEXT SCRIPT\x00xPhraseCount\x00xPhraseSize\x00PHRASE\x00xInstCount\x00xInst\x00IDX\x00xRowid\x00xColumnText\x00xColumnSize\x00xQueryPhrase\x00PHRASE SCRIPT\x00xSetAuxdata\x00VALUE\x00xGetAuxdata\x00CLEAR\x00xSetAuxdataInt\x00INTEGER\x00xGetAuxdataInt\x00xPhraseForeach\x00IPHRASE COLVAR OFFVAR SCRIPT\x00xPhraseColumnForeach\x00IPHRASE COLVAR SCRIPT\x00SUB-COMMAND\x00f5t_%lld\x00bytearray\x00boolean\x00double\x00wideInt\x00int\x00DB NAME SCRIPT\x00?-subst? DB NAME TEXT\x00-subst\x00unrecognized option: \x00no such tokenizer: \x00error in tokenizer.xCreate()\x00error in tokenizer.xTokenize()\x00document\x00aux\x00query\x00prefixquery\x00invalid\x00-colocated\x00sqlite3_fts5_token may only be used by tokenizer callback\x00?-colocated? TEXT START END\x00error in fts5_api.xCreateTokenizer()\x00?BOOLEAN?\x00NSLOT TOKEN\x00sqlite3_fts5_create_tokenizer\x00sqlite3_fts5_token\x00sqlite3_fts5_tokenize\x00sqlite3_fts5_create_function\x00sqlite3_fts5_may_be_corrupt\x00sqlite3_fts5_token_hash\x00sqlite3_fts5_register_matchinfo\x00sqlite3_fts5_register_fts5tokenize\x00unrecognized matchinfo flag: %c\x00pcx\x00matchinfo\x00CREATE TABLE x(input HIDDEN, token, start, end, position)\x00fts5tokenize\x00%s: cost must be between 1 and %d\x00%s: maximum string length is %d\x00%s: iLang must be between 0 and %d\x00?\x00SELECT * FROM %Q.%Q\x00%s: %s\x00%s: %s has %d columns, expected 4\x00vocabulary_table\x00vocabulary_word\x00vocabulary_language\x00edit_distances\x00unrecognized argument: [%s]\n\x00no edit_distances table specified\x00CREATE TABLE x(word,distance,language,command HIDDEN,nword HIDDEN)\x000123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^abcdefghijklmnopqrstuvwxyz~\x00SELECT \"%w\" FROM \"%w\"\x00 WHERE \"%w\">=?1 AND \"%w\"=?2 ORDER BY 1\x00SELECT \"%w\" FROM \"%w\" WHERE \"%w\">=?1 ORDER BY 1\x00*\x00DELETE from %s is not allowed\x00UPDATE of %s is not allowed\x00INSERT INTO %s allowed for column [command] only\x00approximate_match\x00int32\x00int64\x00char*\x00CREATE TABLE x(value,pointer hidden,count hidden,ctype hidden)\x00carray\x00unknown datatype: %Q\x00inttoptr\x00tablename\x00idcolumn\x00parentcolumn\x00CREATE TABLE x(id,depth,root HIDDEN,tablename HIDDEN,idcolumn HIDDEN,parentcolumn HIDDEN)\x00SELECT \"%w\".\"%w\" FROM \"%w\" WHERE \"%w\".\"%w\"=?1\x00transitive_closure\x00rb\x00cannot open '%s' for reading\x00line %d: unescaped %c character\x00line %d: unterminated %c-quoted field\n\x00more than one '%s' parameter\x00yes\x00on\x00true\x00no\x00off\x00false\x00header\x00more than one 'header' parameter\x00testflags\x00columns\x00more than one 'columns' parameter\x00column= value must be positive\x00bad parameter: '%s'\x00must specify either filename= or data= but not both\x00%sc%d TEXT\x00,\x00%s\"%w\" TEXT\x00bad schema: '%s' - %s\x00filename\x00data\x00schema\x00csv\x00csv_wr\x00decimal_sum\x00decimal\x00decimal_cmp\x00decimal_add\x00decimal_sub\x00decimal_mul\x00 \x00eval\x00CREATE TABLE x(addr,opcode,p1,p2,p3,p4,p5,comment,sql HIDDEN)\x00EXPLAIN %s\x00explain\x00wb\x00wrong number of arguments to function writefile()\x00failed to create symlink: %s\x00failed to create directory: %s\x00failed to write file: %s\x00CREATE TABLE x(name,mode,mtime,data,path HIDDEN,dir HIDDEN)\x00cannot read directory: %s\x00%s/%s\x00cannot stat file: %s\x00table function fsdir requires an argument\x00table function fsdir requires a non-NULL argument\x00fsdir\x00readfile\x00writefile\x00lsmode\x00%s: ruleset must be between 0 and %d\x00%s: wrong number of CREATE VIRTUAL TABLE arguments\x00CREATE TABLE x(word,distance,ruleset)\x00fuzzer\x00ieee754(%lld,%d)\x00ieee754\x00ieee754_mantissa\x00ieee754_exponent\x00ieee754_to_blob\x00ieee754_from_blob\x00BEGIN; SELECT * FROM %s%q%ssqlite_schema\x00'\x00'.\x00PRAGMA %s%q%spage_size\x00sqlite3_mmap_warm_cache: Warmed up %d pages of %s\x00END\x00AND (%s)\x00collate \"%w\"\x00SELECT %s FROM %s WHERE %s>=(?1 || ?2) %s AND %s<=(?1 || char(1114111)) %s %s ORDER BY 1 %s ASC LIMIT 1\x00next_char\x00NULL\x00is\x00not\x00in(\x00in(select\x00in(with\x00?,?,?\x002nd argument to percentile() is not a number between 0.0 and 100.0\x002nd argument to percentile() is not the same for all input rows\x001st argument to percentile() is not numeric\x00Inf input to percentile()\x00percentile\x00CREATE TABLE prefixes(prefix TEXT, original_string TEXT HIDDEN)\x00prefixes\x00prefix_length\x00unknown \\ escape\x00afnrtv\\()*.+?[$^{|}]\x00\a\f\n\r\t\v\x00unmatched '('\x00'*' without operand\x00'+' without operand\x00'?' without operand\x00'{m,n}' without operand\x00unmatched '{'\x00n less than m in '{m,n}'\x00both m and n are zero in '{m,n}'\x00POSIX character classes not supported\x00unclosed '['\x00unrecognized character\x00regexp\x00remember\x00CREATE TABLE x(value,start hidden,stop hidden,step hidden)\x00generate_series() requires SQLite 3.8.12 or later\x00generate_series\x00.ABCDHLRMY9 ?\x00non-ASCII input to editdist()\x00NULL input to editdist()\x00SELECT iLang, cFrom, cTo, iCost FROM \"%w\" WHERE iLang>=0 ORDER BY iLang\x00editdist3\x00DROP TABLE IF EXISTS \"%w\".\"%w_vocab\"\x00CREATE TABLE x(word,rank,distance,langid, score, matchlen, phonehash HIDDEN, top HIDDEN, scope HIDDEN, srchcnt HIDDEN, soundslike HIDDEN, command HIDDEN)\x00CREATE TABLE IF NOT EXISTS \"%w\".\"%w_vocab\"(\n id INTEGER PRIMARY KEY,\n rank INT,\n langid INT,\n word TEXT,\n k1 TEXT,\n k2 TEXT\n);\n\x00CREATE INDEX IF NOT EXISTS \"%w\".\"%w_vocab_index_langid_k2\" ON \"%w_vocab\"(langid,k2);\x00edit_cost_table=\x00bad argument to spellfix1(): \"%s\"\x00SELECT id, word, rank, coalesce(k1,word) FROM \"%w\".\"%w_vocab\" WHERE langid=%d AND k2>=?1 AND k2<?2\x00SELECT word, rank, NULL, langid, id FROM \"%w\".\"%w_vocab\"%s\x00 WHERE rowid=?\x00ROLLBACK\x00IGNORE\x00ABORT\x00REPLACE\x00DELETE FROM \"%w\".\"%w_vocab\" WHERE id=%lld\x00NOT NULL constraint failed: %s.word\x00reset\x00null\x00unknown value for %s.command: \"%w\"\x00INSERT INTO \"%w\".\"%w_vocab\"(rank,langid,word,k1,k2) VALUES(%d,%d,%Q,nullif(%Q,%Q),%Q)\x00INSERT OR %s INTO \"%w\".\"%w_vocab\"(id,rank,langid,word,k1,k2) VALUES(%lld,%d,%d,%Q,nullif(%Q,%Q),%Q)\x00UPDATE OR %s \"%w\".\"%w_vocab\" SET id=%lld, rank=%d, langid=%d, word=%Q, k1=nullif(%Q,%Q), k2=%Q WHERE id=%lld\x00ALTER TABLE \"%w\".\"%w_vocab\" RENAME TO \"%w_vocab\"\x00spellfix1_translit\x00spellfix1_editdist\x00spellfix1_phonehash\x00spellfix1_scriptcode\x00spellfix1\x00922337203685477580\x00tointeger\x00toreal\x00sql error: %s\x00_rowid_\x00integer\x00no such rowid table: %s%s%s\x00.\x00SELECT group_concat(quote(name) || '.' || quote(type)) FROM pragma_table_info(?, ?)\x00source table schema mismatch\x00swarmvtab: no such SQL parameter: %s\x00maxopen\x00swarmvtab: illegal maxopen value\x00missing\x00swarmvtab: duplicate \"missing\" option\x00SELECT \"%w\"(?%s)\x00,?\x00openclose\x00swarmvtab: duplicate \"openclose\" option\x00SELECT \"%w\"(?,?%s)\x00swarmvtab: unrecognized option: %s\x00SELECT \"%w\"(?)\x00swarmvtab: parse error: %s\x00swarmvtab\x00unionvtab\x00temp\x00%s tables must be created in TEMP schema\x00wrong number of arguments for %s\x00SELECT * FROM (%z) ORDER BY 3\x00rowid range mismatch error\x00no source tables configured\x00SELECT 'CREATE TABLE xyz(' || group_concat(quote(name) || ' ' || type, ', ') || ')',max((cid+1) * (type='INTEGER' COLLATE nocase AND pk=1))-1 FROM pragma_table_info(%Q, ?)\x00SELECT rowid, * FROM %Q %s %lld\x00WHERE _rowid_ <=\x00-- \x00%z%sSELECT rowid, * FROM %s%q%s%Q\x00 UNION ALL \x00%z WHERE rowid=%lld\x00WHERE\x00%z WHERE rowid>=%lld\x00AND\x00%z %s rowid<=%lld\x00CREATE TABLE x(value)\x00wholenumber\x00CREATE TABLE y(name PRIMARY KEY,mode,mtime,sz,rawdata,data,method,z HIDDEN) WITHOUT ROWID;\x00zipfile\x00zipfile constructor requires one argument\x00error in fread()\x00error in fwrite()\x00failed to read CDS at offset %lld\x00%.*s\x00failed to read LFH at offset %d\x001.2.11\x00inflateInit2() failed (%d)\x00inflate() failed (%d)\x00zipfile: deflate() error\x00cannot find end of central directory record\x00zipfile() function requires an argument\x00cannot open file: %s\x00-rwxrwxrwx\x00zipfile: mode does not match data\x00zipfile: parse error in mode: %s\x00zipfile: missing filename\x00ab+\x00zipfile: failed to open file %s for writing\x00sz must be NULL\x00rawdata must be NULL\x00unknown compression method: %d\x00%s/\x00duplicate name: \"%s\"\x00{\"version-made-by\" : %u, \"version-to-extract\" : %u, \"flags\" : %u, \"compression\" : %u, \"time\" : %u, \"date\" : %u, \"crc32\" : %u, \"compressed-size\" : %u, \"uncompressed-size\" : %u, \"file-name-length\" : %u, \"extra-field-length\" : %u, \"file-comment-length\" : %u, \"disk-number-start\" : %u, \"internal-attr\" : %u, \"external-attr\" : %u, \"offset\" : %u }\x00zipfile_cds\x00wrong number of arguments to function zipfile()\x00first argument to zipfile() must be non-NULL\x00illegal method value: %d\x00non-directory name must not end with /\x00rbu_delta\x00step\x00close\x00create_rbu_delta\x00savestate\x00dbMain_eval\x00SQL\x00bp_progress\x00db\x00RBU\x00state\x00progress\x00close_no_error\x00temp_size_limit\x00LIMIT\x00temp_size\x00dbRbu_eval\x00METHOD\x00method\x00 - \x00oal\x00move\x00checkpoint\x00done\x00error\x00NAME TARGET-DB RBU-DB ?STATE-DB?\x00NAME TARGET-DB ?STATE-DB?\x00?-default? NAME PARENT\x00NAME\x00sqlite3rbu_db(0, 0)!=0\x00sqlite3rbu\x00sqlite3rbu_vacuum\x00sqlite3rbu_create_vfs\x00sqlite3rbu_destroy_vfs\x00sqlite3rbu_internal_test\x00incrblob\x00incrblob_%d\x00%lld\x00sqlite_unlock_notify_arg\x00sqlite_unlock_notify_argcount\x00DELETE\x00INSERT\x00UPDATE\x00SQLITE_COPY\x00SQLITE_CREATE_INDEX\x00SQLITE_CREATE_TABLE\x00SQLITE_CREATE_TEMP_INDEX\x00SQLITE_CREATE_TEMP_TABLE\x00SQLITE_CREATE_TEMP_TRIGGER\x00SQLITE_CREATE_TEMP_VIEW\x00SQLITE_CREATE_TRIGGER\x00SQLITE_CREATE_VIEW\x00SQLITE_DELETE\x00SQLITE_DROP_INDEX\x00SQLITE_DROP_TABLE\x00SQLITE_DROP_TEMP_INDEX\x00SQLITE_DROP_TEMP_TABLE\x00SQLITE_DROP_TEMP_TRIGGER\x00SQLITE_DROP_TEMP_VIEW\x00SQLITE_DROP_TRIGGER\x00SQLITE_DROP_VIEW\x00SQLITE_INSERT\x00SQLITE_PRAGMA\x00SQLITE_READ\x00SQLITE_SELECT\x00SQLITE_TRANSACTION\x00SQLITE_UPDATE\x00SQLITE_ATTACH\x00SQLITE_DETACH\x00SQLITE_ALTER_TABLE\x00SQLITE_REINDEX\x00SQLITE_ANALYZE\x00SQLITE_CREATE_VTABLE\x00SQLITE_DROP_VTABLE\x00SQLITE_FUNCTION\x00SQLITE_SAVEPOINT\x00SQLITE_RECURSIVE\x00????\x00SQLITE_DENY\x00SQLITE_IGNORE\x00RELEASE _tcl_transaction\x00COMMIT\x00ROLLBACK TO _tcl_transaction ; RELEASE _tcl_transaction\x00option\x00?CALLBACK?\x00?DATABASE? FILENAME\x00cannot open target database: \x00backup failed: \x00CALLBACK\x00cache option ?arg?\x00flush\x00size\x00size n\x00cannot convert \"\x00\" to integer\x00bad option \"\x00\": must be flush or size\x00NAME SCRIPT\x00SCRIPT\x00?OPTION? ?BOOLEAN?\x00unknown config option: \"\x00\"\x00CONFLICT-ALGORITHM TABLE FILENAME ?SEPARATOR? ?NULLINDICATOR?\x00\t\x00Error: non-null separator required for copy\x00rollback\x00abort\x00fail\x00ignore\x00replace\x00Error: \"\x00\", conflict-algorithm must be one of: rollback, abort, fail, ignore, or replace\x00SELECT * FROM '%q'\x00Error: no such table: \x00Error: \x00Error: can't malloc()\x00INSERT OR %q INTO '%q' VALUES(?\x00Error: cannot open file: \x00BEGIN\x00Error: %s line %d: expected %d columns of data but found %d\x00, failed while processing line: \x00?DATABASE? VALUE\x00-maxsize\x00-readonly\x00unknown option: \x00unable to set MEMDB content\x00extension loading is turned off at compile-time\x00-withoutnulls\x00unknown option: \"\x00?OPTIONS? SQL ?ARRAY-NAME? ?SCRIPT?\x00NAME ?SWITCHES? SCRIPT\x00-argcount\x00option requires an argument: \x00number of arguments must be non-negative\x00-deterministic\x00-directonly\x00-innocuous\x00-returntype\x00real\x00text\x00blob\x00any\x00type\x00\": must be -argcount, -deterministic, -directonly, -innocuous, or -returntype\x00?-readonly? ?DB? TABLE COLUMN ROWID\x00NULLVALUE\x00N CALLBACK\x00KEY\x00cannot open source database: \x00restore failed: \x00restore failed: source database busy\x00?DATABASE?\x00(step|sort|autoindex)\x00sort\x00autoindex\x00vmstep\x00bad argument: should be autoindex, step, sort or vmstep\x00MILLISECONDS\x00?CALLBACK? ?MASK?\x00trace type\x00SAVEPOINT _tcl_transaction\x00[TYPE] SCRIPT\x00transaction type\x00BEGIN EXCLUSIVE\x00BEGIN IMMEDIATE\x00?SCRIPT?\x00SUB-COMMAND ?ARGS?\x00hook ?SCRIPT?\x00INDEX\x00-use-legacy-prepare\x00-last-stmt-ptr\x00%p\x00unknown argument: \x00authorizer\x00backup\x00bind_fallback\x00busy\x00cache\x00changes\x00collate\x00collation_needed\x00commit_hook\x00complete\x00config\x00copy\x00deserialize\x00enable_load_extension\x00errorcode\x00exists\x00function\x00interrupt\x00last_insert_rowid\x00nullvalue\x00onecolumn\x00preupdate\x00profile\x00rekey\x00restore\x00rollback_hook\x00serialize\x00status\x00timeout\x00total_changes\x00trace\x00trace_v2\x00transaction\x00unlock_notify\x00update_hook\x00version\x00wal_hook\x00defensive\x00dqs_ddl\x00dqs_dml\x00enable_fkey\x00enable_qpsg\x00enable_trigger\x00enable_view\x00fts3_tokenizer\x00legacy_alter_table\x00legacy_file_format\x00load_extension\x00no_ckpt_on_close\x00reset_database\x00trigger_eqp\x00trusted_schema\x00writable_schema\x00statement\x00row\x00deferred\x00exclusive\x00immediate\x00depth\x00hook\x00new\x00old\x00HANDLE ?FILENAME? ?-vfs VFSNAME? ?-readonly BOOLEAN? ?-create BOOLEAN? ?-nofollow BOOLEAN? ?-nomutex BOOLEAN? ?-fullmutex BOOLEAN? ?-uri BOOLEAN?\x00-version\x00-sourceid\x00-has-codec\x000\x00-key\x00-vfs\x00-create\x00-nofollow\x00-nomutex\x00-fullmutex\x00-uri\x00-translatefilename\x00sqlite3\x00sqlite\x003.33.0\x00if {[llength $argv]>=1} {\nset argv0 [lindex $argv 0]\nset argv [lrange $argv 1 end]\nsource $argv0\n} else {\nset line {}\nwhile {![eof stdin]} {\nif {$line!=\"\"} {\nputs -nonewline \"> \"\n} else {\nputs -nonewline \"% \"\n}\nflush stdout\nappend line [gets stdin]\nif {[info complete $line]} {\nif {[catch {uplevel #0 $line} result]} {\nputs stderr \"Error: $result\"\n} elseif {$result!=\"\"} {\nputs $result\n}\nset line {}\n} else {\nappend line \\n\n}\n}\n}\n\x00SQLITE_DEBUG_BREAK\x00attach debugger to process %d and press any key to continue.\n\x00utf-8\x00argc\x00argv0\x00argv\x00errorInfo\x00%s: %s\n\x00SQLITE-CONNECTION\x00command not found: \x00error code %s (%d) does not match sqlite3_errcode %s (%d)\x00OMIT_MISUSE\x00wrong # args: should be \"\x00 DB FORMAT STRING\x00 DB HEX\x00 DB\x00 DB SQL\x00%z%s%s\x00%s%n\x00abcdefghijklmnopqrstuvwxyz\x00 DB FORMAT STRING ?COUNT?\x00 DB\"\x00 FILENAME\"\x00%02x\x00%04x\x00tkt2213 is not fixed\x00text16\x00bytes\x00bytes16\x00noop\x00x_coalesce\x00hex8\x00hex16\x00tkt2213func\x00pointer_change\x00counter1\x00counter2\x00intreal\x00x_sqlite_exec\x00value of 40 handed to x_count\x00x_count totals to 42\x00x_count\x00legacy_count\x00 TEXT\"\x00 FORMAT INT INT INT\"\x00argument is not a valid 64-bit integer\x00 FORMAT INT INT ?STRING?\"\x00 INT FORMAT INT INT ?STRING?\"\x00N must be non-negative\x00 FORMAT INT INT DOUBLE\"\x00 FORMAT DOUBLE DOUBLE\"\x00 FORMAT STRING\"\x00%08x%08x\x002nd argument should be 16-characters of hex\x00DB BOOLEAN\x00DB dbname tblname colname\x00CHANNEL ROWID\x00DB-HANDLE NAME CMP-PROC DEL-PROC\x00sqlite3_create_collate_v2() failed to detect an invalid encoding\x00utf8\x00utf16\x00utf16le\x00utf16be\x00DB NAME NARG ENC SWITCHES...\x00encoding\x00-func\x00-step\x00-final\x00-destroy\x00switch\x00DB-HANDLE FILE ?PROC?\x00this build omits sqlite3_load_extension()\x00DB-HANDLE ONOFF\x00string\x00value\x00first argument should be one of: int int64 string double null value\x00 DB FUNCTION-NAME\x00 <STMT>\x00STMT PARAMETER RESETFLAG\x00SQLITE_STMTSTATUS_FULLSCAN_STEP\x00SQLITE_STMTSTATUS_SORT\x00SQLITE_STMTSTATUS_AUTOINDEX\x00SQLITE_STMTSTATUS_VM_STEP\x00SQLITE_STMTSTATUS_REPREPARE\x00SQLITE_STMTSTATUS_RUN\x00SQLITE_STMTSTATUS_MEMUSED\x00NBYTE\x00DB DBNAME\x00DB DBNAME SNAPSHOT\x00SNAPSHOT\x00SNAPSHOT1 SNAPSHOT2\x00bad SNAPSHOT\x00FILE\x00PATH\x00 DB STMT\x00 STMT\x00 FROM-STMT TO-STMT\x00 VM IDX VALUE (null|static|normal)\"\x00static\x00static-nbytes\x00normal\x00blob10\x00abc\x00xyz\x00pq\x004th argument should be \"null\" or \"static\" or \"normal\"\x00(%d) \x00test_collate\x00UTF-8\x00UTF-16LE\x00UTF-16BE\x00 <DB> <utf8> <utf16le> <utf16be>\x00utf16bin\x00utf16_unaligned\x00utf16_aligned\x00test_function\x00<error code>\x00STMT IDX N\x00 STMT N VALUE\x00NaN\x00SNaN\x00-NaN\x00-SNaN\x00+Inf\x00-Inf\x00Epsilon\x00-Epsilon\x00NaN0\x00-NaN0\x00 STMT N\x00 STMT N VALUE BYTES\x00 STMT N DATA BYTES\x00cannot use %d blob bytes, have %d\x00STMT\x00STMT N\x00STMT NAME\x00 DB sql bytes ?tailvar?\x00 DB sql bytes tailvar\x00 DB sql bytes flags tailvar\x00\x00SELECT 1\x00 filename options-list\x00FILENAME FLAGS VFS\x00SQLITE_OPEN_READONLY\x00SQLITE_OPEN_READWRITE\x00SQLITE_OPEN_CREATE\x00SQLITE_OPEN_DELETEONCLOSE\x00SQLITE_OPEN_EXCLUSIVE\x00SQLITE_OPEN_AUTOPROXY\x00SQLITE_OPEN_MAIN_DB\x00SQLITE_OPEN_TEMP_DB\x00SQLITE_OPEN_TRANSIENT_DB\x00SQLITE_OPEN_MAIN_JOURNAL\x00SQLITE_OPEN_TEMP_JOURNAL\x00SQLITE_OPEN_SUBJOURNAL\x00SQLITE_OPEN_SUPER_JOURNAL\x00SQLITE_OPEN_NOMUTEX\x00SQLITE_OPEN_FULLMUTEX\x00SQLITE_OPEN_SHAREDCACHE\x00SQLITE_OPEN_PRIVATECACHE\x00SQLITE_OPEN_WAL\x00SQLITE_OPEN_URI\x00flag\x00<utf-16 sql>\x00 STMT column\x00FLOAT\x00TEXT\x00BLOB\x00 DB MAGIC\x00SQLITE_MAGIC_OPEN\x00SQLITE_MAGIC_CLOSED\x00SQLITE_MAGIC_BUSY\x00SQLITE_MAGIC_ERROR\x00 DB function-name\x00VARIABLE\x00?N?\x001234567890000000\x00__one\x00__two\x00notadatabase\x00Unexpected non-zero errno: \x00DB [DBNAME]\x00%u\x00DB DBNAME SIZE\x00 DB PWD\x00 DB FLAG\x00%d %d\x00 DB ?AUXDB?\x00 DB ID VALUE\x00unknown limit type: \x00SQLITE_LIMIT_LENGTH\x00SQLITE_LIMIT_SQL_LENGTH\x00SQLITE_LIMIT_COLUMN\x00SQLITE_LIMIT_EXPR_DEPTH\x00SQLITE_LIMIT_COMPOUND_SELECT\x00SQLITE_LIMIT_VDBE_OP\x00SQLITE_LIMIT_FUNCTION_ARG\x00SQLITE_LIMIT_ATTACHED\x00SQLITE_LIMIT_LIKE_PATTERN_LENGTH\x00SQLITE_LIMIT_VARIABLE_NUMBER\x00SQLITE_LIMIT_TRIGGER_DEPTH\x00SQLITE_LIMIT_WORKER_THREADS\x00SQLITE_LIMIT_TOOSMALL\x00SQLITE_LIMIT_TOOBIG\x00SEED ?DB?\x00BOOLEAN\x00current\x00max\x00min\x00recyclable\x00DB ?NAME?\x00passive\x00full\x00restart\x00truncate\x00DB MODE ?NAME?\x00mode\x00DB VALUE\x00COMMAND ...\x00command has no objProc: \x00%d %d %d %s\n\x00SQLITE_TESTCTRL_LOCALTIME_FAULT\x00SQLITE_TESTCTRL_SORTER_MMAP\x00SQLITE_TESTCTRL_IMPOSTER\x00SQLITE_TESTCTRL_INTERNAL_FUNCTIONS\x00VERB ARGS...\x00VERB\x00ONOFF\x00DB LIMIT\x00DB dbName onOff tnum\x00ru_utime=%d.%06d ru_stime=%d.%06d ru_minflt=%d ru_majflt=%d\x00DB OPT BOOLEAN\x00unknown optimization - should be one of:\x00all\x00none\x00query-flattener\x00groupby-order\x00factor-constants\x00distinct-opt\x00cover-idx-scan\x00order-by-idx-join\x00transitive\x00omit-noop-join\x00stat4\x00skip-scan\x00push-down\x00DB NAME ...\x00no such extension: \x00initialization of \x00 failed: \x00amatch\x00closure\x00fileio\x00nextchar\x00series\x00spellfix\x00totype\x00BOOL\x00DB SQL1 NSTEP SQL2\x00data error: (a!=b)\x00checksum mismatch\x00sql error: \x00TYPE\x00Deliberate panic\x00DB SETTING [VALUE]\x00SQLITE_*\x00DBCONFIG_*\x00ENABLE_*\x00unknown sqlite3_db_config setting\x00FKEY\x00TRIGGER\x00FTS3_TOKENIZER\x00LOAD_EXTENSION\x00NO_CKPT_ON_CLOSE\x00QPSG\x00TRIGGER_EQP\x00RESET_DB\x00DEFENSIVE\x00WRITABLE_SCHEMA\x00LEGACY_ALTER_TABLE\x00DQS_DML\x00DQS_DDL\x00LEGACY_FILE_FORMAT\x00icecube\x00DB ?DBNAME?\x00DB OFFSET DATA\x00HEXDB\x00| size %d pagesize %d\x00bad 'pagesize' field\x00bad 'size' field\x00| page %d offset %d\x00| %d: %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x\x00sqlite_search_count\x00sqlite_found_count\x00sqlite_sort_count\x00sqlite3_max_blobsize\x00sqlite_like_count\x00sqlite_interrupt_count\x00sqlite_open_file_count\x00sqlite_current_time\x00sqlite3_xferopt_count\x00sqlite3_pager_readdb_count\x00sqlite3_pager_writedb_count\x00sqlite3_pager_writej_count\x00unaligned_string_counter\x00sqlite_last_needed_collation\x00sqlite_query_plan\x00sqlite_opentemp_count\x00sqlite_static_bind_value\x00sqlite_static_bind_nbyte\x00sqlite_temp_directory\x00sqlite_data_directory\x00bitmask_size\x00longdouble_size\x00sqlite_sync_count\x00sqlite_fullsync_count\x00db_enter\x00db_leave\x00sqlite3_mprintf_int\x00sqlite3_mprintf_int64\x00sqlite3_mprintf_long\x00sqlite3_mprintf_str\x00sqlite3_snprintf_str\x00sqlite3_mprintf_stronly\x00sqlite3_mprintf_double\x00sqlite3_mprintf_scaled\x00sqlite3_mprintf_hexdouble\x00sqlite3_mprintf_z_test\x00sqlite3_mprintf_n_test\x00sqlite3_snprintf_int\x00sqlite3_last_insert_rowid\x00sqlite3_exec_printf\x00sqlite3_exec_hex\x00sqlite3_exec\x00sqlite3_exec_nr\x00sqlite3_get_table_printf\x00sqlite3_close\x00sqlite3_close_v2\x00sqlite3_create_function\x00sqlite3_create_aggregate\x00sqlite3_drop_modules\x00sqlite_register_test_function\x00sqlite_abort\x00sqlite_bind\x00breakpoint\x00sqlite3_key\x00sqlite3_rekey\x00sqlite_set_magic\x00sqlite3_interrupt\x00sqlite_delete_function\x00sqlite_delete_collation\x00sqlite3_get_autocommit\x00sqlite3_busy_timeout\x00printf\x00sqlite3IoTrace\x00clang_sanitize_address\x00sqlite3_db_config\x00bad_behavior\x00register_dbstat_vtab\x00sqlite3_connection_pointer\x00intarray_addr\x00int64array_addr\x00doublearray_addr\x00textarray_addr\x00sqlite3_bind_int\x00sqlite3_bind_zeroblob\x00sqlite3_bind_zeroblob64\x00sqlite3_bind_int64\x00sqlite3_bind_double\x00sqlite3_bind_null\x00sqlite3_bind_text\x00sqlite3_bind_text16\x00sqlite3_bind_blob\x00sqlite3_bind_parameter_count\x00sqlite3_bind_parameter_name\x00sqlite3_bind_parameter_index\x00sqlite3_clear_bindings\x00sqlite3_sleep\x00sqlite3_errcode\x00sqlite3_extended_errcode\x00sqlite3_errmsg\x00sqlite3_errmsg16\x00sqlite3_open\x00sqlite3_open16\x00sqlite3_open_v2\x00sqlite3_complete16\x00sqlite3_normalize\x00sqlite3_prepare\x00sqlite3_prepare16\x00sqlite3_prepare_v2\x00sqlite3_prepare_v3\x00sqlite3_prepare_tkt3134\x00sqlite3_prepare16_v2\x00sqlite3_finalize\x00sqlite3_stmt_status\x00sqlite3_reset\x00sqlite3_expired\x00sqlite3_transfer_bindings\x00sqlite3_changes\x00sqlite3_step\x00sqlite3_sql\x00sqlite3_expanded_sql\x00sqlite3_next_stmt\x00sqlite3_stmt_readonly\x00sqlite3_stmt_isexplain\x00sqlite3_stmt_busy\x00uses_stmt_journal\x00sqlite3_release_memory\x00sqlite3_db_release_memory\x00sqlite3_db_cacheflush\x00sqlite3_system_errno\x00sqlite3_db_filename\x00sqlite3_db_readonly\x00sqlite3_soft_heap_limit\x00sqlite3_soft_heap_limit64\x00sqlite3_hard_heap_limit64\x00sqlite3_thread_cleanup\x00sqlite3_pager_refcounts\x00sqlite3_load_extension\x00sqlite3_enable_load_extension\x00sqlite3_extended_result_codes\x00sqlite3_limit\x00dbconfig_maindbname_icecube\x00save_prng_state\x00restore_prng_state\x00reset_prng_state\x00prng_seed\x00extra_schema_checks\x00database_never_corrupt\x00database_may_be_corrupt\x00optimization_control\x00tcl_objproc\x00sqlite3_column_count\x00sqlite3_data_count\x00sqlite3_column_type\x00sqlite3_column_blob\x00sqlite3_column_double\x00sqlite3_column_int64\x00sqlite3_column_text\x00sqlite3_column_name\x00sqlite3_column_int\x00sqlite3_column_bytes\x00sqlite3_column_decltype\x00sqlite3_column_database_name\x00sqlite3_column_table_name\x00sqlite3_column_origin_name\x00sqlite3_column_bytes16\x00sqlite3_column_text16\x00sqlite3_column_name16\x00add_alignment_test_collations\x00sqlite3_column_decltype16\x00sqlite3_column_database_name16\x00sqlite3_column_table_name16\x00sqlite3_column_origin_name16\x00sqlite3_create_collation_v2\x00sqlite3_global_recover\x00working_64bit_int\x00vfs_unlink_test\x00vfs_initfail_test\x00vfs_unregister_all\x00vfs_reregister_all\x00file_control_test\x00file_control_lasterrno_test\x00file_control_lockproxy_test\x00file_control_chunksize_test\x00file_control_sizehint_test\x00file_control_data_version\x00file_control_persist_wal\x00file_control_powersafe_overwrite\x00file_control_vfsname\x00file_control_tempfilename\x00sqlite3_vfs_list\x00sqlite3_create_function_v2\x00add_test_collate\x00add_test_collate_needed\x00add_test_function\x00add_test_utf16bin_collate\x00sqlite3_test_errstr\x00tcl_variable_type\x00sqlite3_enable_shared_cache\x00sqlite3_shared_cache_report\x00sqlite3_libversion_number\x00sqlite3_table_column_metadata\x00sqlite3_blob_reopen\x00pcache_stats\x00sqlite3_unlock_notify\x00sqlite3_wal_checkpoint\x00sqlite3_wal_checkpoint_v2\x00sqlite3_wal_autocheckpoint\x00test_sqlite3_log\x00print_explain_query_plan\x00sqlite3_test_control\x00getrusage\x00load_static_extension\x00sorter_test_fakeheap\x00sorter_test_sort4_helper\x00vfs_current_time_int64\x00sqlite3_snapshot_get\x00sqlite3_snapshot_open\x00sqlite3_snapshot_free\x00sqlite3_snapshot_cmp\x00sqlite3_snapshot_recover\x00sqlite3_snapshot_get_blob\x00sqlite3_snapshot_open_blob\x00sqlite3_snapshot_cmp_blob\x00sqlite3_delete_database\x00atomic_batch_write\x00sqlite3_mmap_warm\x00sqlite3_config_sorterref\x00decode_hexdb\x00test_write_db\x00*** OBSOLETE VARIABLE ***\x00 FILENAME N-PAGE\"\x00 ID\"\x00ref\x00page\x00err\x00hit\x00miss\x00ovfl\x00 ID PGNO\"\x00 PAGE\"\x00 PAGE DATA\"\x00 N-MEGABYTES FILE\"\x00open failed: \x00Hello, World!\x00write failed: \x00 PENDING-BYTE\"\x00fault simulator script failed: [%s]\x00 SCRIPT\"\x00 SIZE PROGRAM\"\x00sqlite_io_error_pending\x00sqlite_io_error_persist\x00sqlite_io_error_hit\x00sqlite_io_error_hardhit\x00sqlite_diskfull_pending\x00sqlite_diskfull\x00sqlite_pending_byte\x00pager_open\x00pager_close\x00pager_commit\x00pager_rollback\x00pager_stmt_begin\x00pager_stmt_commit\x00pager_stmt_rollback\x00pager_stats\x00pager_pagecount\x00page_get\x00page_lookup\x00page_unref\x00page_read\x00page_write\x00page_number\x00pager_truncate\x00fake_big_file\x00sqlite3BitvecBuiltinTest\x00sqlite3_test_control_pending_byte\x00sqlite3_test_control_fault_install\x00 FILENAME NCACHE FLAGS\"\x00read\x00write\x00 ID TABLENUM WRITEABLE\"\x00 START MULTIPLIER COUNT INCREMENT\"\x00putVarint returned %d - should be between 1 and 9\x00putVarint returned %d and getVarint returned %d\x00Wrote 0x%016llx and got back 0x%016llx\x00putVarint returned %d and GetVarint32 returned %d\x00Wrote 0x%016llx and got back 0x%016llx from GetVarint32\x00 DB-HANDLE ?N?\"\x00No such db-handle: \"\x00 BT NCACHE\"\x00?-intkey? CSR KEY VALUE\x00btree_insert\x00btree_open\x00btree_close\x00btree_begin_transaction\x00btree_pager_stats\x00btree_cursor\x00btree_close_cursor\x00btree_next\x00btree_eof\x00btree_payload_size\x00btree_first\x00btree_varint_test\x00btree_from_db\x00btree_ismemdb\x00btree_set_cache_size\x00thread ID must be an upper case letter\x00 ID FILENAME\x00thread \x00 is already running\x00failed to create the thread\x00 ID\x00no such thread\x00 ID N\x00column number out of range\x00no database is open\x00 ID SQL\x00no virtual machine available\x00 IDL\x00 ID1 ID2\x00 ID DB\x00thread_create\x00thread_wait\x00thread_halt\x00thread_argc\x00thread_argv\x00thread_colname\x00thread_result\x00thread_error\x00thread_compile\x00thread_step\x00thread_finalize\x00thread_swap\x00thread_db_get\x00thread_db_put\x00thread_stmt_get\x00 <repeat-count> <do-calls>\x00hello world\x00UTF8\x00UTF16LE\x00UTF16BE\x00UTF16\x00No such encoding: \x00 <string/blob> <from enc> <to enc>\x00binarize\x00test_value_overhead\x00test_translate\x00translate_selftest\x00out of memory in the crash simulator\n\x00atomic\x00atomic512\x00atomic1k\x00atomic2k\x00atomic4k\x00atomic8k\x00atomic16k\x00atomic32k\x00atomic64k\x00sequential\x00safe_append\x00powersafe_overwrite\x00batch-atomic\x00-sectorsize\x00-characteristics\x00Bad option: \"\x00\" - must be \"-characteristics\" or \"-sectorsize\"\x00Option requires an argument: \"\x00no such flag\x00ENABLE ?DEFAULT?\x00crash\x00?OPTIONS? DELAY CRASHFILE\x00Filename is too long: \"\x00NWRITE\x00?-default? PARENT-VFS\x00-default\x00\": must be -default\x00Error in jt_register\x00sqlite3_crash_enable\x00sqlite3_crashparams\x00sqlite3_crash_now\x00sqlite3_simulate_device\x00sqlite3_crash_on_write\x00unregister_devsim\x00register_jt_vfs\x00unregister_jt_vfs\x00client_create\x00client_wait\x00client_halt\x00client_argc\x00client_argv\x00client_colname\x00client_result\x00client_error\x00client_compile\x00client_step\x00client_reset\x00client_finalize\x00client_swap\x00echo_module_fail(%s,%s)\x00echo-vtab-error: %s\x00SELECT * FROM %Q\x00PRAGMA index_list(%s)\x00PRAGMA index_info(%s)\x00echo_module\x00SELECT sql FROM sqlite_schema WHERE type = 'table' AND name = ?\x00%s%s\x00xCreate\x00CREATE TABLE %Q(logmsg)\x00xConnect\x00xDisconnect\x00xDestroy\x00DROP TABLE %Q\x00xOpen\x00xNext\x00xColumn\x00xFilter\x00, *\x00%z, %s\x00%z, NULL\x00echo_module_ignore_usable\x00xBestIndex\x00echo_module_cost\x00SELECT count(*) FROM %Q\x00SELECT rowid%z FROM %Q\x00rowid\x00=\x00<\x00>\x00<=\x00>=\x00LIKE\x00like\x00glob\x00 %s %s LIKE (SELECT '%%'||?||'%%')\x00 %s %s %s ?\x00DESC\x00ASC\x00 ORDER BY %s %s\x00xUpdate\x00 SET\x00UPDATE %Q\x00 SET rowid=?1 \x00%s %Q=?%d\x00 WHERE rowid=?%d\x00DELETE FROM %Q WHERE rowid = ?1\x00INSERT INTO %Q (\x00%s%Q\x00%s?%d\x00) VALUES(\x00echo(%s)\x00xBegin\x00echo_module_begin_fail\x00xSync\x00echo_module_sync_fail\x00xCommit\x00xRollback\x00::echo_glob_overload\x00xRename\x00ALTER TABLE %s RENAME TO %s%s\x00echo\x00echo_v2\x00DB SQL\x00register_echo_module\x00sqlite3_declare_vtab\x00N/A\x00sqlite3_create_collation\x00Error testing function: \x00sqlite3_malloc\x00sqlite3_realloc\x00c_misuse_test\x00c_realloc_test\x00c_collation_test\x00sqlite3_reset_auto_extension\x00npage\x00finish\x00remaining\x00pagecount\x00CMDNAME DESTHANDLE DESTNAME SRCHANDLE SRCNAME\x00sqlite3_backup_init() failed\x00sqlite3_backup\x00wrong number of arguments\x00unexpected: %s\x00eq\x00gt\x00le\x00lt\x00ge\x00match\x00ne\x00isnot\x00isnotnull\x00isnull\x00op\x00column\x00usable\x00desc\x00cost\x00orderby\x00idxnum\x00idxstr\x00rows\x00use\x00omit\x00unexpected: %d\x00tcl\x00register_tcl_module\x00incrblob_\x00DB DATABASE TABLE COLUMN ROWID FLAGS VARNAME\x00HANDLE\x00CHANNEL OFFSET N\x00out of memory in testdata/sqlite-src-3330000/src/test_blob.c\x00HANDLE OFFSET DATA ?NDATA?\x00sqlite3_blob_open\x00sqlite3_blob_close\x00sqlite3_blob_bytes\x00sqlite3_blob_read\x00sqlite3_blob_write\x00sqlite_options\x00malloc_usable_size\x001\x00rowid32\x00casesensitivelike\x00curdir\x00win32malloc\x00debug\x00default_ckptfullfsync\x00direct_read\x00dirsync\x00lfs\x00pagecache_overflow_stats\x00mmap\x00worker_threads\x008\x00memdebug\x008_3_names\x00cursorhints\x00hiddencolumns\x00mem3\x00mem5\x00offset_sql_func\x00snapshot\x00mutex\x00mutex_noop\x00altertable\x00api_armor\x00atomicwrite\x00json1\x00has_codec\x00like_match_blobs\x00attach\x00auth\x00autoinc\x00autoreset\x00autovacuum\x00default_autovacuum\x00between_opt\x00builtin_test\x00bloblit\x00cast\x00check\x00cte\x00columnmetadata\x00oversize_cell_check\x00compileoption_diags\x00compound\x00conflict\x00crashtest\x00datetime\x00decltype\x00deprecated\x00diskio\x00floatingpoint\x00foreignkey\x00fts1\x00fts2\x00fts3\x00fts5\x00fts3_unicode\x00fts4_deferred\x00gettable\x00icu\x00icu_collations\x00integrityck\x00legacyformat\x00like_opt\x00load_ext\x00localtime\x00lookaside\x00long_double\x00memorydb\x00memorymanage\x00mergesort\x00null_trim\x00or_opt\x00rbu\x00pager_pragmas\x00pragma\x00reindex\x00rtree\x00rtree_int_only\x00schema_pragmas\x00schema_version\x00session\x00stmtvtab\x00scanstatus\x00lock_proxy_pragmas\x00prefer_proxy_locking\x00shared_cache\x00subquery\x00tclvar\x00threadsafe\x00threadsafe1\x00threadsafe2\x00tempdb\x00trigger\x00truncate_opt\x00vacuum\x00view\x00vtab\x00wal\x00wsd\x00update_delete_limit\x00fast_secure_delete\x00secure_delete\x00userauth\x00multiplex_ext_overwrite\x00yytrackmaxstackdepth\x00sqllog\x00uri_00_error\x00normalize\x00windowfunc\x00SQLITE_MAX_LENGTH\x00SQLITE_MAX_COLUMN\x00SQLITE_MAX_SQL_LENGTH\x00SQLITE_MAX_EXPR_DEPTH\x00SQLITE_MAX_COMPOUND_SELECT\x00SQLITE_MAX_VDBE_OP\x00SQLITE_MAX_FUNCTION_ARG\x00SQLITE_MAX_VARIABLE_NUMBER\x00SQLITE_MAX_PAGE_SIZE\x00SQLITE_MAX_PAGE_COUNT\x00SQLITE_MAX_LIKE_PATTERN_LENGTH\x00SQLITE_MAX_TRIGGER_DEPTH\x00SQLITE_DEFAULT_CACHE_SIZE\x00SQLITE_DEFAULT_PAGE_SIZE\x00SQLITE_DEFAULT_FILE_FORMAT\x00SQLITE_DEFAULT_SYNCHRONOUS\x00SQLITE_DEFAULT_WAL_SYNCHRONOUS\x00SQLITE_MAX_ATTACHED\x00SQLITE_MAX_DEFAULT_PAGE_SIZE\x00SQLITE_MAX_WORKER_THREADS\x00TEMP_STORE\x00%s-journal\x00%s-wal\x00%s-shm\x00%s%03d\x00%s-journal%03d\x00%s-wal%03d\x00Loadable extensions are not supported\x00demo\x00register_demovfs\x00unregister_demovfs\x00devsym\x00writecrash\x00CREATE TABLE xyz(dir, name);\x00CREATE TABLE xyz(path, size, data);\x00WITH r(d) AS ( SELECT CASE WHEN dir=?2 THEN ?3 ELSE dir END || '/' || name FROM fsdir WHERE dir=?1 AND name NOT LIKE '.%' UNION ALL SELECT dir || '/' || name FROM r, fsdir WHERE dir=d AND name NOT LIKE '.%') SELECT d FROM r;\x00/\x00CREATE TABLE x(path TEXT, data TEXT)\x00SELECT * FROM %Q.%Q WHERE rowid=?\x00fs\x00fstree\x00register_fs_module\x00abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-!,:*^+=_|?/<> \x00sqlite3_prepare_v2() error: %s\x000123456789abcdef\x00x'\x00test_agg_errmsg16\x00randstr\x00test_destructor\x00test_destructor16\x00hex_to_utf16be\x00hex_to_utf16le\x00hex_to_utf8\x00test_destructor_count\x00test_auxdata\x00test_error\x00test_eval\x00test_isolation\x00test_counter\x00real2hex\x00test_decode\x00test_extract\x00test_zeroblob\x00test_getsubtype\x00test_setsubtype\x00test_frombind\x00tx\x00funcxx_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789\x00nullx_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789\x00sqlite3_create_function abused test failed\x00invalid matchinfo blob passed to function rank()\x00wrong number of arguments to function rank()\x00rank\x00autoinstall_test_functions\x00abuse_create_function\x00install_fts3_rank_function\x000123456789ABCDEF\x00FILENAME OFFSET AMT\x00r\x00cannot open input file \x00FILENAME OFFSET HEXDATA\x00r+b\x00r+\x00cannot open output file \x00HEXDATA\x00[utf8_to_utf8] unavailable - SQLITE_DEBUG not defined\x00BLOB VARNAME\x00LIST\x00hexio_read\x00hexio_write\x00hexio_get_int\x00hexio_render_int16\x00hexio_render_int32\x00utf8_to_utf8\x00read_fts3varint\x00make_fts3record\x00mem\x00pcache\x00Unknown argument: \"\x00init_wrapper_install\x00init_wrapper_query\x00init_wrapper_uninstall\x00init_wrapper_clear\x00CREATE TABLE x(value INTEGER PRIMARY KEY)\x00CREATE VIRTUAL TABLE temp.%Q USING %Q\x00INTARRAY\x00SQLITE_NOMEM\x00sqlite3_intarray_create\x00sqlite3_intarray_bind\x00jt\x00-journal\x00NBYTES\x00PRIOR NBYTES\x00bad pointer: \x00PRIOR\x00ADDRESS SIZE HEX\x00size must be positive\x00no data\x00ADDRESS SIZE\x00?RESET?\x00DEPT\x00FILENAME\x00COUNTER ?OPTIONS?\x00-repeat\x00-benigncnt\x00TITLE\x00SUB-COMMAND ...\x00start\x00stop\x00dump\x00clear\x00sync\x00SIZE N\x00INSTALLFLAG DISCARDCHANCE PRNGSEEED HIGHSTRESS\x00discard-chance should be between 0 and 100\x00SIZE COUNT\x00BUFID SIZE COUNT\x00illegal arguments - see documentation\x00NBYTE NMINALLOC\x00[DB]\x00sqlite3_db_config(db, 99999) does not return SQLITE_ERROR\x00sqlite3_config(99999) does not return SQLITE_ERROR\x00PARAMETER RESETFLAG\x00SQLITE_STATUS_MEMORY_USED\x00SQLITE_STATUS_MALLOC_SIZE\x00SQLITE_STATUS_PAGECACHE_USED\x00SQLITE_STATUS_PAGECACHE_OVERFLOW\x00SQLITE_STATUS_PAGECACHE_SIZE\x00SQLITE_STATUS_SCRATCH_USED\x00SQLITE_STATUS_SCRATCH_OVERFLOW\x00SQLITE_STATUS_SCRATCH_SIZE\x00SQLITE_STATUS_PARSER_STACK\x00SQLITE_STATUS_MALLOC_COUNT\x00DB PARAMETER RESETFLAG\x00SQLITE_\x00DBSTATUS_\x00LOOKASIDE_USED\x00CACHE_USED\x00SCHEMA_USED\x00STMT_USED\x00LOOKASIDE_HIT\x00LOOKASIDE_MISS_SIZE\x00LOOKASIDE_MISS_FULL\x00CACHE_HIT\x00CACHE_MISS\x00CACHE_WRITE\x00DEFERRED_FKS\x00CACHE_USED_SHARED\x00CACHE_SPILL\x00?INTEGER?\x00sqlite3_free\x00memset\x00memget\x00sqlite3_memory_used\x00sqlite3_memory_highwater\x00sqlite3_memdebug_backtrace\x00sqlite3_memdebug_dump\x00sqlite3_memdebug_fail\x00sqlite3_memdebug_pending\x00sqlite3_memdebug_settitle\x00sqlite3_memdebug_malloc_count\x00sqlite3_memdebug_log\x00sqlite3_config_pagecache\x00sqlite3_config_alt_pcache\x00sqlite3_status\x00sqlite3_db_status\x00install_malloc_faultsim\x00sqlite3_config_heap\x00sqlite3_config_heap_size\x00sqlite3_config_memstatus\x00sqlite3_config_lookaside\x00sqlite3_config_error\x00sqlite3_config_uri\x00sqlite3_config_cis\x00sqlite3_config_pmasz\x00sqlite3_db_config_lookaside\x00sqlite3_dump_memsys3\x00sqlite3_dump_memsys5\x00sqlite3_install_memsys3\x00sqlite3_memdebug_vfs_oom_test\x00%05u\x00 FILENAME [OFFSET AMT]\"\x00unable to open file \"\x00\" for reading\x00md5\x00md5-10x8\x00md5file\x00md5file-10x8\x00md5sum\x00%03d\x00multiplexor.xAccess failure on %s\x00multiplexor.xOpen failure on %s\x00multiplex_control\x00chunksize\x00multiplex_truncate\x00multiplex/%z\x00multiplex\x00NAME MAKEDEFAULT\x00-force\x00?-force?\x00enable\x00chunk_size\x00max_chunks\x00HANDLE DBNAME SUB-COMMAND INT-VALUE\x00expected database handle, got \"\x00sqlite3_multiplex_initialize\x00sqlite3_multiplex_shutdown\x00sqlite3_multiplex_control\x00fast\x00recursive\x00static_main\x00static_mem\x00static_open\x00static_prng\x00static_lru\x00static_pmem\x00static_app1\x00static_app2\x00static_app3\x00static_vfs1\x00static_vfs2\x00static_vfs3\x00mutex counters are \x00already installed\x00not installed\x00singlethread\x00multithread\x00serialized\x00mutex name\x00disable_mutex_init\x00disable_mutex_try\x00sqlite3_shutdown\x00sqlite3_initialize\x00sqlite3_config\x00enter_static_mutex\x00leave_static_mutex\x00enter_db_mutex\x00leave_db_mutex\x00alloc_dealloc_mutex\x00install_mutex_counters\x00read_mutex_counters\x00clear_mutex_counters\x00\x00\x00\x00\x00\x00\x00\x00vfslog/%z\x00sqlite_ostrace1.....\x00xClose\x00xRead\x00xWrite\x00xTruncate\x00xFilesize\x00xLock\x00xUnlock\x00xCheckResLock\x00xFileControl\x00xSectorSize\x00xDeviceChar\x00xDelete\x00xAccess\x00xFullPathname\x00xRandomness\x00xSleep\x00xCurrentTime\x00xShmUnmap\x00xShmLock\x00xShmBarrier\x00xShmMap\x00annotation\x00CREATE TABLE xxx(event, file, click, rc, size, offset)\x00vfslog\x00VFS\x00failed\x00VFS PARENT LOGFILE\x00bad sqlite3 handle: \x00annotate\x00finalize\x00register\x00quota/%z\x00quota\x00::piLimit_\x00PATTERN LIMIT SCRIPT\x00FILENAME MODE\x00HANDLE SIZE NELEM\x00HANDLE SIZE NELEM CONTENT\x00HANDLE ?HARDSYNC?\x00HANDLE OFFSET WHENCE\x00SEEK_SET\x00SEEK_CUR\x00SEEK_END\x00WHENCE should be SEEK_SET, SEEK_CUR, or SEEK_END\x00HANDLE SIZE\x00PATTERN TEXT\x00sqlite3_quota_initialize\x00sqlite3_quota_shutdown\x00sqlite3_quota_set\x00sqlite3_quota_file\x00sqlite3_quota_dump\x00sqlite3_quota_fopen\x00sqlite3_quota_fread\x00sqlite3_quota_fwrite\x00sqlite3_quota_fclose\x00sqlite3_quota_fflush\x00sqlite3_quota_fseek\x00sqlite3_quota_rewind\x00sqlite3_quota_ftell\x00sqlite3_quota_ftruncate\x00sqlite3_quota_file_size\x00sqlite3_quota_file_truesize\x00sqlite3_quota_file_mtime\x00sqlite3_quota_remove\x00sqlite3_quota_glob\x00sqlite3_quota_file_available\x00sqlite3_quota_ferror\x00cube\x00circle\x00Qcircle\x00breadthfirstsearch\x00register_cube_geom\x00register_circle_geom\x00CREATE TABLE x(database,tablename,cid,name,type,not_null,dflt_value,pk)\x00SELECT name FROM sqlite_temp_schema WHERE type='table'\x00SELECT name FROM %Q.sqlite_schema WHERE type='table'\x00PRAGMA %Q.table_info(%Q)\x00PRAGMA database_list\x00register_schema_module\x00PRAGMA main.journal_mode\x00CMDNAME PATH ?VFS? ?BUSY-HANDLER-SCRIPT?\x00sqlite3demo_superlock\x00open\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00pread\x00pread64\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00mremap\x00SYSCALL-LIST\x00system-call\x00?COUNT PERSIST?\x00EACCES\x00EINTR\x00EIO\x00EOVERFLOW\x00ENOMEM\x00EAGAIN\x00ETIMEDOUT\x00EBUSY\x00EPERM\x00EDEADLK\x00ENOLCK\x00SYSCALL ERRNO\x00errno\x00PGSZ\x00getpagesize\x00pgsz out of range\x00fault\x00install\x00uninstall\x00list\x00defaultvfs\x00pagesize\x00VFS does not support xSetSystemCall\x00test_syscall\x00load_testfixture_extensions\x00SLAVE\x00CREATE TABLE x( name TEXT, arrayname TEXT, value TEXT, fullname TEXT PRIMARY KEY) WITHOUT ROWID\x00array names\x00tclvar_filter_cmd\x00%s(%s)\x00expr {[info exists ::tclvar_set_omit] && $::tclvar_set_omit}\x00the 'fullname' column must be TEXT\x00prohibited TCL variable change\x00proc like {pattern str} {\n set p [string map {% * _ ?} $pattern]\n string match $p $str\n}\nproc tclvar_filter_cmd {eq match glob regexp like} {\n set res {}\n set pattern $eq\n if {$pattern=={}} { set pattern $match }\n if {$pattern=={}} { set pattern * }\n foreach v [uplevel #0 info vars $pattern] {\n if {($glob=={} || [string match $glob [uplevel #0 set $v]])\n && ($like=={} || [like $like [uplevel #0 set $v]])\n && ($regexp=={} || [regexp $regexp [uplevel #0 set $v]])\n } {\n lappend res $v\n }\n }\n set res\n}\n\x00register_tclvar_module\x00clock_seconds\x00sqlthread\x00sqlite3_blocking_step\x00sqlite3_blocking_prepare_v2\x00sqlite3_nonblocking_prepare_v2\x00set\x00Error in Tcl_CreateThread()\x00no parent thread\x00parent\x00spawn\x00VARNAME SCRIPT\x00DBNAME\x00id\x00%s \x00SQLITE_IOERR\x00SQLITE_LOCKED\x00SQLITE_BUSY\x00SQLITE_READONLY\x00SQLITE_READONLY_CANTINIT\x00SQLITE_NOTFOUND\x00SQLITE_OMIT\x00normal|dataonly\x00full|dataonly\x00xCheckReservedLock\x00BEGIN_ATOMIC_WRITE\x00COMMIT_ATOMIC_WRITE\x00ZIPVFS\x00anon\x00SQLITE_ACCESS_EXISTS\x00SQLITE_ACCESS_READWRITE\x00SQLITE_ACCESS_READ\x00xShmOpen\x00 lock\x00 unlock\x00 shared\x00 exclusive\x00shm\x00delete\x00filter\x00ioerr\x00fullerr\x00cantopenerr\x00script\x00devchar\x00sectorsize\x00subcommand\x00FILE ?VALUE?\x00failed to get full path: \x00no such file: \x00unknown method: \x00?CNT PERSIST?\x00default\x00undeletable_when_open\x00immutable\x00?ATTR-LIST?\x00bad flags: \x00?VALUE?\x00-noshm\x00-szosfile\x00-mxpathname\x00-iversion\x00-fullshm\x00VFSNAME ?-noshm BOOL? ?-fullshm BOOL? ?-default BOOL? ?-mxpathname INT? ?-szosfile INT? ?-iversion INT?\x00shared\x00lock\x00unlock\x00DB DBNAME (shared|exclusive) (lock|unlock) OFFSET N\x00ARG\x00DB DBNAME SLOT ?VALUE?\x00*-shm is not yet mapped\x00testvfs\x00vfs_shmlock\x00vfs_set_readmark\x00DB NAME XSTEP XFINAL XVALUE XINVERSE\x00fff\x00misuse test error\x00invalid argument\x00sumint\x00sum\x00sqlite3_create_window_function\x00test_create_window_function_misuse\x00test_create_sumint\x00test_override_sum\x00"
var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data
diff --git a/lib/capi_linux_amd64.go b/lib/capi_linux_amd64.go
index 90f5a17..ac3502a 100644
--- a/lib/capi_linux_amd64.go
+++ b/lib/capi_linux_amd64.go
@@ -1,10 +1,11 @@
-// Code generated by 'ccgo -DSQLITE_PRIVATE= -ccgo-export-defines -ccgo-export-enums -ccgo-export-externs X -ccgo-export-fields F -ccgo-export-typedefs -ccgo-pkgname sqlite3 -o lib/sqlite_linux_amd64.go testdata/sqlite-amalgamation-3320300/sqlite3.c -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_DQS=0 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_MAX_MMAP_SIZE=8589934592 -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_NO_SYNC=1 -DSQLITE_OS_UNIX=1 -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 -DSQLITE_SERVER=1 -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.
+// Code generated by 'ccgo -DSQLITE_PRIVATE= -ccgo-export-defines -ccgo-export-enums -ccgo-export-externs X -ccgo-export-fields F -ccgo-export-typedefs -ccgo-pkgname sqlite3 -o lib/sqlite_linux_amd64.go testdata/sqlite-amalgamation-3330000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.
package sqlite3
var CAPI = map[string]struct{}{
"disable_simulated_io_errors": {},
"enable_simulated_io_errors": {},
+ "rbuVacuumIndexStart": {},
"sqlite3AbsInt32": {},
"sqlite3AddCheckConstraint": {},
"sqlite3AddCollateType": {},
@@ -115,6 +116,7 @@ var CAPI = map[string]struct{}{
"sqlite3BtreeMovetoUnpacked": {},
"sqlite3BtreeNewDb": {},
"sqlite3BtreeNext": {},
+ "sqlite3BtreeOffset": {},
"sqlite3BtreeOpen": {},
"sqlite3BtreePager": {},
"sqlite3BtreePayload": {},
@@ -230,6 +232,7 @@ var CAPI = map[string]struct{}{
"sqlite3ExprAssignVarNumber": {},
"sqlite3ExprAttachSubtrees": {},
"sqlite3ExprCanBeNull": {},
+ "sqlite3ExprCheckHeight": {},
"sqlite3ExprCheckIN": {},
"sqlite3ExprCode": {},
"sqlite3ExprCodeCopy": {},
@@ -314,6 +317,7 @@ var CAPI = map[string]struct{}{
"sqlite3FkReferences": {},
"sqlite3FkRequired": {},
"sqlite3FreeIndex": {},
+ "sqlite3Fts5Init": {},
"sqlite3FunctionSearch": {},
"sqlite3FunctionUsesThisSrc": {},
"sqlite3GenerateConstraintChecks": {},
@@ -327,6 +331,7 @@ var CAPI = map[string]struct{}{
"sqlite3GetTempRange": {},
"sqlite3GetTempReg": {},
"sqlite3GetToken": {},
+ "sqlite3GetUInt32": {},
"sqlite3GetVTable": {},
"sqlite3GetVarint": {},
"sqlite3GetVarint32": {},
@@ -349,6 +354,7 @@ var CAPI = map[string]struct{}{
"sqlite3IdListIndex": {},
"sqlite3IndexAffinityOk": {},
"sqlite3IndexAffinityStr": {},
+ "sqlite3IndexColumnAffinity": {},
"sqlite3IndexHasDuplicateRootPage": {},
"sqlite3IndexedByLookup": {},
"sqlite3Init": {},
@@ -356,6 +362,7 @@ var CAPI = map[string]struct{}{
"sqlite3InitOne": {},
"sqlite3Insert": {},
"sqlite3InsertBuiltinFuncs": {},
+ "sqlite3Int64ToText": {},
"sqlite3InvokeBusyHandler": {},
"sqlite3IsBinary": {},
"sqlite3IsIdChar": {},
@@ -370,6 +377,7 @@ var CAPI = map[string]struct{}{
"sqlite3JournalModename": {},
"sqlite3JournalOpen": {},
"sqlite3JournalSize": {},
+ "sqlite3Json1Init": {},
"sqlite3KeyInfoAlloc": {},
"sqlite3KeyInfoFromExprList": {},
"sqlite3KeyInfoOfIndex": {},
@@ -383,6 +391,7 @@ var CAPI = map[string]struct{}{
"sqlite3LogEst": {},
"sqlite3LogEstAdd": {},
"sqlite3LogEstFromDouble": {},
+ "sqlite3LogEstToInt": {},
"sqlite3LookasideUsed": {},
"sqlite3MPrintf": {},
"sqlite3Malloc": {},
@@ -414,7 +423,7 @@ var CAPI = map[string]struct{}{
"sqlite3OomFault": {},
"sqlite3OpcodeName": {},
"sqlite3OpcodeProperty": {},
- "sqlite3OpenMasterTable": {},
+ "sqlite3OpenSchemaTable": {},
"sqlite3OpenTable": {},
"sqlite3OpenTableAndIndices": {},
"sqlite3OpenTempDatabase": {},
@@ -509,6 +518,11 @@ var CAPI = map[string]struct{}{
"sqlite3PagerSetSpillsize": {},
"sqlite3PagerSharedLock": {},
"sqlite3PagerShrink": {},
+ "sqlite3PagerSnapshotCheck": {},
+ "sqlite3PagerSnapshotGet": {},
+ "sqlite3PagerSnapshotOpen": {},
+ "sqlite3PagerSnapshotRecover": {},
+ "sqlite3PagerSnapshotUnlock": {},
"sqlite3PagerStats": {},
"sqlite3PagerSync": {},
"sqlite3PagerTempSpace": {},
@@ -548,6 +562,7 @@ var CAPI = map[string]struct{}{
"sqlite3PcacheRef": {},
"sqlite3PcacheRefCount": {},
"sqlite3PcacheRelease": {},
+ "sqlite3PcacheReleaseMemory": {},
"sqlite3PcacheSetCachesize": {},
"sqlite3PcacheSetPageSize": {},
"sqlite3PcacheSetSpillsize": {},
@@ -600,6 +615,7 @@ var CAPI = map[string]struct{}{
"sqlite3RowSetNext": {},
"sqlite3RowSetTest": {},
"sqlite3RowidConstraint": {},
+ "sqlite3RtreeInit": {},
"sqlite3RunParser": {},
"sqlite3RunVacuum": {},
"sqlite3SafetyCheckOk": {},
@@ -614,9 +630,9 @@ var CAPI = map[string]struct{}{
"sqlite3SelectDelete": {},
"sqlite3SelectDestInit": {},
"sqlite3SelectDup": {},
+ "sqlite3SelectExprHeight": {},
"sqlite3SelectNew": {},
"sqlite3SelectPrep": {},
- "sqlite3SelectReset": {},
"sqlite3SelectWalkFail": {},
"sqlite3SelectWalkNoop": {},
"sqlite3SelectWrongNumTermsError": {},
@@ -627,6 +643,7 @@ var CAPI = map[string]struct{}{
"sqlite3SharedCacheList": {},
"sqlite3SrcListAppend": {},
"sqlite3SrcListAppendFromTerm": {},
+ "sqlite3SrcListAppendList": {},
"sqlite3SrcListAssignCursors": {},
"sqlite3SrcListDelete": {},
"sqlite3SrcListDup": {},
@@ -636,6 +653,10 @@ var CAPI = map[string]struct{}{
"sqlite3SrcListLookup": {},
"sqlite3SrcListShiftJoinType": {},
"sqlite3StartTable": {},
+ "sqlite3Stat4Column": {},
+ "sqlite3Stat4ProbeFree": {},
+ "sqlite3Stat4ProbeSetValue": {},
+ "sqlite3Stat4ValueFromExpr": {},
"sqlite3StatusDown": {},
"sqlite3StatusHighwater": {},
"sqlite3StatusUp": {},
@@ -667,6 +688,7 @@ var CAPI = map[string]struct{}{
"sqlite3TriggerInsertStep": {},
"sqlite3TriggerList": {},
"sqlite3TriggerSelectStep": {},
+ "sqlite3TriggerStepSrc": {},
"sqlite3TriggerUpdateStep": {},
"sqlite3TriggersExist": {},
"sqlite3TwoPartName": {},
@@ -725,6 +747,7 @@ var CAPI = map[string]struct{}{
"sqlite3VdbeCheckFk": {},
"sqlite3VdbeClearObject": {},
"sqlite3VdbeCloseStatement": {},
+ "sqlite3VdbeComment": {},
"sqlite3VdbeCountChanges": {},
"sqlite3VdbeCreate": {},
"sqlite3VdbeCurrentAddr": {},
@@ -734,6 +757,7 @@ var CAPI = map[string]struct{}{
"sqlite3VdbeDelete": {},
"sqlite3VdbeDeleteAuxData": {},
"sqlite3VdbeDeletePriorOpcode": {},
+ "sqlite3VdbeDisplayComment": {},
"sqlite3VdbeDisplayP4": {},
"sqlite3VdbeEndCoroutine": {},
"sqlite3VdbeEnter": {},
@@ -798,9 +822,11 @@ var CAPI = map[string]struct{}{
"sqlite3VdbeMemTranslate": {},
"sqlite3VdbeMultiLoad": {},
"sqlite3VdbeNextOpcode": {},
+ "sqlite3VdbeNoopComment": {},
"sqlite3VdbeOneByteSerialTypeLen": {},
"sqlite3VdbeParameterIndex": {},
"sqlite3VdbeParser": {},
+ "sqlite3VdbePreUpdateHook": {},
"sqlite3VdbePrepareFlags": {},
"sqlite3VdbeRealValue": {},
"sqlite3VdbeRecordCompare": {},
@@ -879,6 +905,11 @@ var CAPI = map[string]struct{}{
"sqlite3WalReadFrame": {},
"sqlite3WalSavepoint": {},
"sqlite3WalSavepointUndo": {},
+ "sqlite3WalSnapshotCheck": {},
+ "sqlite3WalSnapshotGet": {},
+ "sqlite3WalSnapshotOpen": {},
+ "sqlite3WalSnapshotRecover": {},
+ "sqlite3WalSnapshotUnlock": {},
"sqlite3WalUndo": {},
"sqlite3WalkExpr": {},
"sqlite3WalkExprList": {},
@@ -974,6 +1005,8 @@ var CAPI = map[string]struct{}{
"sqlite3_column_bytes": {},
"sqlite3_column_bytes16": {},
"sqlite3_column_count": {},
+ "sqlite3_column_database_name": {},
+ "sqlite3_column_database_name16": {},
"sqlite3_column_decltype": {},
"sqlite3_column_decltype16": {},
"sqlite3_column_double": {},
@@ -981,6 +1014,10 @@ var CAPI = map[string]struct{}{
"sqlite3_column_int64": {},
"sqlite3_column_name": {},
"sqlite3_column_name16": {},
+ "sqlite3_column_origin_name": {},
+ "sqlite3_column_origin_name16": {},
+ "sqlite3_column_table_name": {},
+ "sqlite3_column_table_name16": {},
"sqlite3_column_text": {},
"sqlite3_column_text16": {},
"sqlite3_column_type": {},
@@ -1039,6 +1076,7 @@ var CAPI = map[string]struct{}{
"sqlite3_free": {},
"sqlite3_free_filename": {},
"sqlite3_free_table": {},
+ "sqlite3_fts5_may_be_corrupt": {},
"sqlite3_fullsync_count": {},
"sqlite3_get_autocommit": {},
"sqlite3_get_auxdata": {},
@@ -1095,6 +1133,11 @@ var CAPI = map[string]struct{}{
"sqlite3_prepare16_v3": {},
"sqlite3_prepare_v2": {},
"sqlite3_prepare_v3": {},
+ "sqlite3_preupdate_count": {},
+ "sqlite3_preupdate_depth": {},
+ "sqlite3_preupdate_hook": {},
+ "sqlite3_preupdate_new": {},
+ "sqlite3_preupdate_old": {},
"sqlite3_profile": {},
"sqlite3_progress_handler": {},
"sqlite3_randomness": {},
@@ -1125,6 +1168,8 @@ var CAPI = map[string]struct{}{
"sqlite3_result_zeroblob": {},
"sqlite3_result_zeroblob64": {},
"sqlite3_rollback_hook": {},
+ "sqlite3_rtree_geometry_callback": {},
+ "sqlite3_rtree_query_callback": {},
"sqlite3_search_count": {},
"sqlite3_serialize": {},
"sqlite3_set_authorizer": {},
@@ -1132,6 +1177,11 @@ var CAPI = map[string]struct{}{
"sqlite3_set_last_insert_rowid": {},
"sqlite3_shutdown": {},
"sqlite3_sleep": {},
+ "sqlite3_snapshot_cmp": {},
+ "sqlite3_snapshot_free": {},
+ "sqlite3_snapshot_get": {},
+ "sqlite3_snapshot_open": {},
+ "sqlite3_snapshot_recover": {},
"sqlite3_snprintf": {},
"sqlite3_soft_heap_limit": {},
"sqlite3_soft_heap_limit64": {},
@@ -1172,6 +1222,7 @@ var CAPI = map[string]struct{}{
"sqlite3_trace_v2": {},
"sqlite3_transfer_bindings": {},
"sqlite3_unlock_notify": {},
+ "sqlite3_unsupported_selecttrace": {},
"sqlite3_update_hook": {},
"sqlite3_uri_boolean": {},
"sqlite3_uri_int64": {},
@@ -1211,4 +1262,17 @@ var CAPI = map[string]struct{}{
"sqlite3_wal_checkpoint_v2": {},
"sqlite3_wal_hook": {},
"sqlite3_xferopt_count": {},
+ "sqlite3rbu_bp_progress": {},
+ "sqlite3rbu_close": {},
+ "sqlite3rbu_create_vfs": {},
+ "sqlite3rbu_db": {},
+ "sqlite3rbu_destroy_vfs": {},
+ "sqlite3rbu_open": {},
+ "sqlite3rbu_progress": {},
+ "sqlite3rbu_savestate": {},
+ "sqlite3rbu_state": {},
+ "sqlite3rbu_step": {},
+ "sqlite3rbu_temp_size": {},
+ "sqlite3rbu_temp_size_limit": {},
+ "sqlite3rbu_vacuum": {},
}
diff --git a/lib/sqlite_linux_amd64.go b/lib/sqlite_linux_amd64.go
index 17cce2a..67170ea 100644
--- a/lib/sqlite_linux_amd64.go
+++ b/lib/sqlite_linux_amd64.go
@@ -1,4 +1,4 @@
-// Code generated by 'ccgo -DSQLITE_PRIVATE= -ccgo-export-defines -ccgo-export-enums -ccgo-export-externs X -ccgo-export-fields F -ccgo-export-typedefs -ccgo-pkgname sqlite3 -o lib/sqlite_linux_amd64.go testdata/sqlite-amalgamation-3320300/sqlite3.c -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_DQS=0 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_MAX_MMAP_SIZE=8589934592 -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_NO_SYNC=1 -DSQLITE_OS_UNIX=1 -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 -DSQLITE_SERVER=1 -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.
+// Code generated by 'ccgo -ccgo-export-defines "" -ccgo-export-enums "" -ccgo-export-externs X -ccgo-export-fields F -ccgo-export-typedefs "" -ccgo-pkgname sqlite3 -o lib/sqlite_linux_amd64.go testdata/sqlite-amalgamation-3330000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.
package sqlite3
@@ -7,7 +7,7 @@ import (
"reflect"
"unsafe"
- "modernc.org/crt/v3"
+ "modernc.org/libc"
)
var _ = math.Pi
@@ -15,7 +15,8 @@ var _ reflect.Kind
var _ unsafe.Pointer
const (
- AggInfoMagic = 0x2059e99e
+ ALT_SCHEMA_TABLE = "sqlite_schema"
+ ALT_TEMP_SCHEMA_TABLE = "sqlite_temp_schema"
BITVEC_SZ = 512
BITVEC_SZELEM = 8
BTALLOC_ANY = 0
@@ -135,7 +136,7 @@ const (
COLNAME_COLUMN = 4
COLNAME_DATABASE = 2
COLNAME_DECLTYPE = 1
- COLNAME_N = 2
+ COLNAME_N = 5
COLNAME_NAME = 0
COLNAME_TABLE = 3
CQUIT = 034
@@ -169,6 +170,8 @@ const (
DB_ResetWanted = 0x0008
DB_SchemaLoaded = 0x0001
DB_UnresetViews = 0x0002
+ DFLT_SCHEMA_TABLE = "sqlite_master"
+ DFLT_TEMP_SCHEMA_TABLE = "sqlite_temp_master"
DIRECT_MODE = 0
DOTLOCK_SUFFIX = ".lock"
E2BIG = 7
@@ -340,6 +343,7 @@ const (
EUNATCH = 49
EUSERS = 87
EWOULDBLOCK = 11
+ EXCLUDED_TABLE_NUMBER = 2
EXCLUSIVE_LOCK = 4
EXDEV = 18
EXFULL = 54
@@ -371,11 +375,114 @@ const (
FP_NORMAL1 = 4
FP_SUBNORMAL1 = 3
FP_ZERO1 = 2
+ FTS5CSR_EOF = 0x01
+ FTS5CSR_FREE_ZRANK = 0x10
+ FTS5CSR_REQUIRE_CONTENT = 0x02
+ FTS5CSR_REQUIRE_DOCSIZE = 0x04
+ FTS5CSR_REQUIRE_INST = 0x08
+ FTS5CSR_REQUIRE_POSLIST = 0x40
+ FTS5CSR_REQUIRE_RESEEK = 0x20
+ FTS5INDEX_QUERY_DESC = 0x0002
+ FTS5INDEX_QUERY_NOOUTPUT = 0x0020
+ FTS5INDEX_QUERY_PREFIX = 0x0001
+ FTS5INDEX_QUERY_SCAN = 0x0008
+ FTS5INDEX_QUERY_SKIPEMPTY = 0x0010
+ FTS5INDEX_QUERY_TEST_NOIDX = 0x0004
+ FTS5_AND = 2
+ FTS5_AVERAGES_ROWID = 1
+ FTS5_BI_MATCH = 0x0001
+ FTS5_BI_ORDER_DESC = 0x0080
+ FTS5_BI_ORDER_RANK = 0x0020
+ FTS5_BI_ORDER_ROWID = 0x0040
+ FTS5_BI_RANK = 0x0002
+ FTS5_BI_ROWID_EQ = 0x0004
+ FTS5_BI_ROWID_GE = 0x0010
+ FTS5_BI_ROWID_LE = 0x0008
+ FTS5_CARET = 12
+ FTS5_COLON = 5
+ FTS5_COMMA = 13
+ FTS5_CONTENT_EXTERNAL = 2
+ FTS5_CONTENT_NONE = 1
+ FTS5_CONTENT_NORMAL = 0
+ FTS5_CORRUPT = 267
+ FTS5_CURRENT_VERSION = 4
+ FTS5_DATA_DLI_B = 1
+ FTS5_DATA_HEIGHT_B = 5
+ FTS5_DATA_ID_B = 16
+ FTS5_DATA_PADDING = 20
+ FTS5_DATA_PAGE_B = 31
+ FTS5_DATA_ZERO_PADDING = 8
+ FTS5_DEFAULT_AUTOMERGE = 4
+ FTS5_DEFAULT_CRISISMERGE = 16
+ FTS5_DEFAULT_HASHSIZE = 1048576
+ FTS5_DEFAULT_NEARDIST = 10
+ FTS5_DEFAULT_PAGE_SIZE = 4050
+ FTS5_DEFAULT_RANK = "bm25"
+ FTS5_DEFAULT_USERMERGE = 4
+ FTS5_DETAIL_COLUMNS = 2
+ FTS5_DETAIL_FULL = 0
+ FTS5_DETAIL_NONE = 1
+ FTS5_EOF = 0
+ FTS5_LCP = 7
+ FTS5_LP = 10
+ FTS5_MAIN_PREFIX = 48
+ FTS5_MAX_PAGE_SIZE = 65536
+ FTS5_MAX_PREFIX_INDEXES = 31
+ FTS5_MAX_SEGMENT = 2000
+ FTS5_MAX_TOKEN_SIZE = 32768
+ FTS5_MINUS = 6
+ FTS5_MIN_DLIDX_SIZE = 4
+ FTS5_NOINLINE = 0
+ FTS5_NOT = 3
+ FTS5_OPT_WORK_UNIT = 1000
+ FTS5_OR = 1
+ FTS5_PLAN_MATCH = 1
+ FTS5_PLAN_ROWID = 6
+ FTS5_PLAN_SCAN = 5
+ FTS5_PLAN_SORTED_MATCH = 4
+ FTS5_PLAN_SOURCE = 2
+ FTS5_PLAN_SPECIAL = 3
+ FTS5_PLUS = 14
+ FTS5_PORTER_MAX_TOKEN = 64
+ FTS5_RANK_NAME = "rank"
+ FTS5_RCP = 8
+ FTS5_REMOVE_DIACRITICS_COMPLEX = 2
+ FTS5_REMOVE_DIACRITICS_NONE = 0
+ FTS5_REMOVE_DIACRITICS_SIMPLE = 1
+ FTS5_ROWID_NAME = "rowid"
+ FTS5_RP = 11
+ FTS5_SEGITER_ONETERM = 0x01
+ FTS5_SEGITER_REVERSE = 0x02
+ FTS5_STAR = 15
+ FTS5_STMT_DELETE_CONTENT = 5
+ FTS5_STMT_DELETE_DOCSIZE = 7
+ FTS5_STMT_INSERT_CONTENT = 3
+ FTS5_STMT_LOOKUP = 2
+ FTS5_STMT_LOOKUP_DOCSIZE = 8
+ FTS5_STMT_REPLACE_CONFIG = 9
+ FTS5_STMT_REPLACE_CONTENT = 4
+ FTS5_STMT_REPLACE_DOCSIZE = 6
+ FTS5_STMT_SCAN = 10
+ FTS5_STMT_SCAN_ASC = 0
+ FTS5_STMT_SCAN_DESC = 1
+ FTS5_STRING = 9
+ FTS5_STRUCTURE_ROWID = 10
+ FTS5_TERM = 4
FTS5_TOKENIZE_AUX = 0x0008
FTS5_TOKENIZE_DOCUMENT = 0x0004
FTS5_TOKENIZE_PREFIX = 0x0002
FTS5_TOKENIZE_QUERY = 0x0001
FTS5_TOKEN_COLOCATED = 0x0001
+ FTS5_VOCAB_COL = 0
+ FTS5_VOCAB_COL_SCHEMA = "term, col, doc, cnt"
+ FTS5_VOCAB_INSTANCE = 2
+ FTS5_VOCAB_INST_SCHEMA = "term, doc, col, offset"
+ FTS5_VOCAB_ROW = 1
+ FTS5_VOCAB_ROW_SCHEMA = "term, doc, cnt"
+ FTS5_VOCAB_TERM_EQ = 0x01
+ FTS5_VOCAB_TERM_GE = 0x02
+ FTS5_VOCAB_TERM_LE = 0x04
+ FTS5_WORK_UNIT = 64
FULLY_WITHIN = 2
FUNC_PERFECT_MATCH = 6
F_DUPFD = 0
@@ -402,6 +509,8 @@ const (
F_UNLCK = 2
F_WRLCK = 1
GCC_VERSION = 0
+ GEOPOLY_PI = 3.1415926535897932385
+ HASHSIZE = 97
HASHTABLE_HASH_1 = 383
HASHTABLE_NPAGE = 4096
HASHTABLE_NSLOT = 8192
@@ -441,7 +550,37 @@ const (
IOC_IN = 1073741824
IOC_INOUT = 3221225472
IOC_OUT = 2147483648
- IsStat4 = 0
+ IsStat4 = 1
+ JEACH_ATOM = 3
+ JEACH_FULLKEY = 6
+ JEACH_ID = 4
+ JEACH_JSON = 8
+ JEACH_KEY = 0
+ JEACH_PARENT = 5
+ JEACH_PATH = 7
+ JEACH_ROOT = 9
+ JEACH_TYPE = 2
+ JEACH_VALUE = 1
+ JNODE_APPEND = 0x20
+ JNODE_ESCAPE = 0x02
+ JNODE_LABEL = 0x40
+ JNODE_PATCH = 0x10
+ JNODE_RAW = 0x01
+ JNODE_REMOVE = 0x04
+ JNODE_REPLACE = 0x08
+ JSON_ARRAY = 6
+ JSON_CACHE_ID = -429938
+ JSON_CACHE_SZ = 4
+ JSON_FALSE = 2
+ JSON_INT = 3
+ JSON_MAX_DEPTH = 2000
+ JSON_NOINLINE = 0
+ JSON_NULL = 0
+ JSON_OBJECT = 7
+ JSON_REAL = 4
+ JSON_STRING = 5
+ JSON_SUBTYPE = 74
+ JSON_TRUE = 1
JT_CROSS = 0x0002
JT_ERROR = 0x0040
JT_INNER = 0x0001
@@ -459,8 +598,6 @@ const (
MAP_FIXED = 0x10
MAP_PRIVATE = 0x02
MAP_SHARED = 0x01
- MASTER_NAME = "sqlite_master"
- MASTER_ROOT = 1
MATH_ERREXCEPT = 2
MATH_ERRNO = 1
MAXFLOAT = 3.40282347e+38
@@ -473,7 +610,7 @@ const (
MEMTYPE_HEAP = 0x01
MEMTYPE_LOOKASIDE = 0x02
MEMTYPE_PCACHE = 0x04
- MEM_AffMask = 0x003
+ MEM_AffMask = 0x003f
MEM_Agg = 0x2000
MEM_Blob = 0x0010
MEM_Cleared = 0x0100
@@ -488,7 +625,7 @@ const (
MEM_Str = 0x0002
MEM_Subtype = 0x8000
MEM_Term = 0x0200
- MEM_TypeMask = 0xc1b
+ MEM_TypeMask = 0xc1bf
MEM_Undefined = 0x0080
MEM_Zero = 0x4000
MSVC_VERSION = 0
@@ -547,6 +684,7 @@ const (
N_SLIP = 1
N_SMSBLOCK = 12
N_SORT_BUCKET = 32
+ N_STATEMENT = 8
N_STRIP = 4
N_SYNC_PPP = 14
N_TTY = 0
@@ -828,7 +966,6 @@ const (
PAGER_LOCKINGMODE_EXCLUSIVE = 1
PAGER_LOCKINGMODE_NORMAL = 0
PAGER_LOCKINGMODE_QUERY = -1
- PAGER_MAX_PGNO = 2147483647
PAGER_MEMORY = 0x0002
PAGER_OMIT_JOURNAL = 0x0001
PAGER_OPEN = 0
@@ -851,7 +988,7 @@ const (
PARSE_MODE_RENAME = 2
PARSE_MODE_UNMAP = 3
PARTLY_WITHIN = 1
- PCACHE1_MIGHT_USE_GROUP_MUTEX = 0
+ PCACHE1_MIGHT_USE_GROUP_MUTEX = 1
PCACHE_DIRTYLIST_ADD = 2
PCACHE_DIRTYLIST_FRONT = 3
PCACHE_DIRTYLIST_REMOVE = 1
@@ -944,9 +1081,40 @@ const (
PragTyp_WAL_AUTOCHECKPOINT = 41
PragTyp_WAL_CHECKPOINT = 42
RAND_MAX = 2147483647
- READMARK_NOT_USED = 4294967295
+ RBU_CREATE_STATE = "CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)"
+ RBU_DELETE = 2
+ RBU_ENABLE_DELTA_CKSUM = 0
+ RBU_IDX_DELETE = 4
+ RBU_IDX_INSERT = 5
+ RBU_INSERT = 1
+ RBU_PK_EXTERNAL = 3
+ RBU_PK_IPK = 2
+ RBU_PK_NONE = 1
+ RBU_PK_NOTABLE = 0
+ RBU_PK_VTAB = 5
+ RBU_PK_WITHOUT_ROWID = 4
+ RBU_REPLACE = 3
+ RBU_STAGE_CAPTURE = 3
+ RBU_STAGE_CKPT = 4
+ RBU_STAGE_DONE = 5
+ RBU_STAGE_MOVE = 2
+ RBU_STAGE_OAL = 1
+ RBU_STATE_CKPT = 6
+ RBU_STATE_COOKIE = 7
+ RBU_STATE_DATATBL = 10
+ RBU_STATE_IDX = 3
+ RBU_STATE_OALSZ = 8
+ RBU_STATE_PHASEONESTEP = 9
+ RBU_STATE_PROGRESS = 5
+ RBU_STATE_ROW = 4
+ RBU_STATE_STAGE = 1
+ RBU_STATE_TBL = 2
+ RBU_UPDATE = 6
+ READMARK_NOT_USED = 0xffffffff
READ_LOCK = 1
RESERVED_LOCK = 2
+ RNDAWAY = 0
+ RNDTOWARDS = 0
ROWSET_ALLOCATION_SIZE = 1024
ROWSET_NEXT = 0x02
ROWSET_SORTED = 0x01
@@ -958,10 +1126,31 @@ const (
RTLD_NODELETE = 0x01000
RTLD_NOLOAD = 0x00004
RTLD_NOW = 0x00002
+ RTREE_CACHE_SZ = 5
+ RTREE_CHECK_MAX_ERROR = 100
+ RTREE_COORD_INT32 = 1
+ RTREE_COORD_REAL32 = 0
+ RTREE_DEFAULT_ROWEST = 1048576
+ RTREE_EQ = 0x41
+ RTREE_FALSE = 0x40
+ RTREE_GE = 0x44
+ RTREE_GT = 0x45
+ RTREE_LE = 0x42
+ RTREE_LT = 0x43
+ RTREE_MATCH = 0x46
+ RTREE_MAXCELLS = 51
+ RTREE_MAX_AUX_COLUMN = 100
+ RTREE_MAX_DEPTH = 40
+ RTREE_MAX_DIMENSIONS = 5
+ RTREE_MIN_ROWEST = 100
+ RTREE_QUERY = 0x47
+ RTREE_TRUE = 0x3f
+ RTREE_ZERO = 0.0
R_OK = 4
SAVEPOINT_BEGIN = 0
SAVEPOINT_RELEASE = 1
SAVEPOINT_ROLLBACK = 2
+ SCHEMA_ROOT = 1
SEEK_CUR = 1
SEEK_END = 2
SEEK_SET = 0
@@ -984,6 +1173,7 @@ const (
SF_NoopOrderBy = 0x0400000
SF_Recursive = 0x0002000
SF_Resolved = 0x0000004
+ SF_UpdateFrom = 0x0800000
SF_UsesEphemeral = 0x0000020
SF_Values = 0x0000200
SF_View = 0x0200000
@@ -1013,7 +1203,7 @@ const (
SIOCGIFHWADDR = 0x8927
SIOCGIFINDEX = 0x8933
SIOCGIFMAP = 0x8970
- SIOCGIFMEM = 0x891
+ SIOCGIFMEM = 0x891f
SIOCGIFMETRIC = 0x891d
SIOCGIFMTU = 0x8921
SIOCGIFNAME = 0x8910
@@ -1045,8 +1235,8 @@ const (
SIOCSIFTXQLEN = 0x8943
SIOCSRARP = 0x8962
SIOGIFINDEX = 35123
- SLOT_2_0 = 0x001fc07
- SLOT_4_2_0 = 0xf01fc07
+ SLOT_2_0 = 0x001fc07f
+ SLOT_4_2_0 = 0xf01fc07f
SORTER_MAX_MERGE_COUNT = 16
SORTER_TYPE_INTEGER = 0x01
SORTER_TYPE_TEXT = 0x02
@@ -1081,7 +1271,7 @@ const (
SQLITE_ATTACH = 24
SQLITE_AUTH = 23
SQLITE_AUTH_USER = 279
- SQLITE_AllOpts = 65535
+ SQLITE_AllOpts = 0xffff
SQLITE_AutoIndex = 0x00008000
SQLITE_BIGENDIAN = 0
SQLITE_BIG_DBL = 0
@@ -1215,10 +1405,10 @@ const (
SQLITE_DEFAULT_PROXYDIR_PERMISSIONS = 0755
SQLITE_DEFAULT_RECURSIVE_TRIGGERS = 0
SQLITE_DEFAULT_SECTOR_SIZE = 4096
- SQLITE_DEFAULT_SORTERREF_SIZE = 0x7
+ SQLITE_DEFAULT_SORTERREF_SIZE = 0x7fffffff
SQLITE_DEFAULT_SYNCHRONOUS = 2
SQLITE_DEFAULT_WAL_AUTOCHECKPOINT = 1000
- SQLITE_DEFAULT_WAL_SYNCHRONOUS = 1
+ SQLITE_DEFAULT_WAL_SYNCHRONOUS = 2
SQLITE_DEFAULT_WORKER_THREADS = 0
SQLITE_DELETE = 9
SQLITE_DENY = 1
@@ -1230,7 +1420,7 @@ const (
SQLITE_DETERMINISTIC = 0x000000800
SQLITE_DIRECTONLY = 0x000080000
SQLITE_DONE = 101
- SQLITE_DQS = 0
+ SQLITE_DQS = 3
SQLITE_DROP_INDEX = 10
SQLITE_DROP_TABLE = 11
SQLITE_DROP_TEMP_INDEX = 12
@@ -1251,9 +1441,22 @@ const (
SQLITE_ECEL_REF = 0x04
SQLITE_EMPTY = 16
SQLITE_ENABLE_BYTECODE_VTAB = 1
+ SQLITE_ENABLE_COLUMN_METADATA = 1
SQLITE_ENABLE_DBPAGE_VTAB = 1
+ SQLITE_ENABLE_DBSTAT_VTAB = 1
SQLITE_ENABLE_DESERIALIZE = 1
+ SQLITE_ENABLE_EXPLAIN_COMMENTS = 1
+ SQLITE_ENABLE_FTS5 = 1
+ SQLITE_ENABLE_GEOPOLY = 1
+ SQLITE_ENABLE_JSON1 = 1
SQLITE_ENABLE_LOCKING_STYLE = 0
+ SQLITE_ENABLE_MEMORY_MANAGEMENT = 1
+ SQLITE_ENABLE_OFFSET_SQL_FUNC = 1
+ SQLITE_ENABLE_PREUPDATE_HOOK = 1
+ SQLITE_ENABLE_RBU = 1
+ SQLITE_ENABLE_RTREE = 1
+ SQLITE_ENABLE_SNAPSHOT = 1
+ SQLITE_ENABLE_STAT4 = 1
SQLITE_ENABLE_STMTVTAB = 1
SQLITE_ENABLE_UNLOCK_NOTIFY = 1
SQLITE_ERROR = 1
@@ -1292,6 +1495,7 @@ const (
SQLITE_FCNTL_POWERSAFE_OVERWRITE = 13
SQLITE_FCNTL_PRAGMA = 14
SQLITE_FCNTL_RBU = 26
+ SQLITE_FCNTL_RBUCNT = 5149216
SQLITE_FCNTL_RESERVE_BYTES = 38
SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE = 33
SQLITE_FCNTL_SET_LOCKPROXYFILE = 3
@@ -1458,20 +1662,20 @@ const (
SQLITE_MAGIC_ERROR = 0xb5357930
SQLITE_MAGIC_OPEN = 0xa029a697
SQLITE_MAGIC_SICK = 0x4b771290
- SQLITE_MAGIC_ZOMBIE = 0x64cffc7
+ SQLITE_MAGIC_ZOMBIE = 0x64cffc7f
SQLITE_MALLOC_SOFT_LIMIT = 1024
SQLITE_MATCH = 0
SQLITE_MAX_ATTACHED = 10
SQLITE_MAX_COLUMN = 2000
SQLITE_MAX_COMPOUND_SELECT = 500
SQLITE_MAX_DEFAULT_PAGE_SIZE = 8192
- SQLITE_MAX_EXPR_DEPTH = 0
+ SQLITE_MAX_EXPR_DEPTH = 1000
SQLITE_MAX_FILE_FORMAT = 4
SQLITE_MAX_FUNCTION_ARG = 127
SQLITE_MAX_LENGTH = 1000000000
SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000
SQLITE_MAX_MEMORY = 0
- SQLITE_MAX_MMAP_SIZE = 8589934592
+ SQLITE_MAX_MMAP_SIZE = 0x7fff0000
SQLITE_MAX_PAGE_COUNT = 1073741823
SQLITE_MAX_PAGE_SIZE = 65536
SQLITE_MAX_PMASZ = 536870912
@@ -1497,6 +1701,7 @@ const (
SQLITE_MUTEX_STATIC_APP3 = 10
SQLITE_MUTEX_STATIC_LRU = 6
SQLITE_MUTEX_STATIC_LRU2 = 7
+ SQLITE_MUTEX_STATIC_MAIN = 2
SQLITE_MUTEX_STATIC_MASTER = 2
SQLITE_MUTEX_STATIC_MEM = 3
SQLITE_MUTEX_STATIC_MEM2 = 4
@@ -1520,7 +1725,6 @@ const (
SQLITE_NOTICE_RECOVER_WAL = 283
SQLITE_NOTNULL = 0x90
SQLITE_NOWILDCARDMATCH = 2
- SQLITE_NO_SYNC = 1
SQLITE_NO_TSAN = 0
SQLITE_NULL = 5
SQLITE_NULLEQ = 0x80
@@ -1549,6 +1753,7 @@ const (
SQLITE_OPEN_READWRITE = 0x00000002
SQLITE_OPEN_SHAREDCACHE = 0x00020000
SQLITE_OPEN_SUBJOURNAL = 0x00002000
+ SQLITE_OPEN_SUPER_JOURNAL = 0x00004000
SQLITE_OPEN_TEMP_DB = 0x00000200
SQLITE_OPEN_TEMP_JOURNAL = 0x00001000
SQLITE_OPEN_TRANSIENT_DB = 0x00000400
@@ -1563,7 +1768,7 @@ const (
SQLITE_PERM = 3
SQLITE_POWERSAFE_OVERWRITE = 1
SQLITE_PRAGMA = 19
- SQLITE_PREPARE_MASK = 0x0
+ SQLITE_PREPARE_MASK = 0x0f
SQLITE_PREPARE_NORMALIZE = 0x02
SQLITE_PREPARE_NO_VTAB = 0x04
SQLITE_PREPARE_PERSISTENT = 0x01
@@ -1582,6 +1787,12 @@ const (
SQLITE_QueryFlattener = 0x0001
SQLITE_QueryOnly = 0x00100000
SQLITE_RANGE = 25
+ SQLITE_RBU_STATE_CHECKPOINT = 3
+ SQLITE_RBU_STATE_DONE = 4
+ SQLITE_RBU_STATE_ERROR = 5
+ SQLITE_RBU_STATE_MOVE = 2
+ SQLITE_RBU_STATE_OAL = 1
+ SQLITE_RBU_UPDATE_CACHESIZE = 16
SQLITE_READ = 20
SQLITE_READONLY = 8
SQLITE_READONLY_CANTINIT = 1288
@@ -1609,8 +1820,6 @@ const (
SQLITE_SCHEMA = 17
SQLITE_SELECT = 21
SQLITE_SERIALIZE_NOCOPY = 0x001
- SQLITE_SERIES_CONSTRAINT_VERIFY = 1
- SQLITE_SERVER = 1
SQLITE_SET_LOCKPROXYFILE = 3
SQLITE_SHM_EXCLUSIVE = 8
SQLITE_SHM_LOCK = 2
@@ -1618,11 +1827,12 @@ const (
SQLITE_SHM_SHARED = 4
SQLITE_SHM_UNLOCK = 1
SQLITE_SORTER_PMASZ = 250
- SQLITE_SOURCE_ID = "2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd"
+ SQLITE_SOUNDEX = 1
+ SQLITE_SOURCE_ID = "2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f"
SQLITE_SO_ASC = 0
SQLITE_SO_DESC = 1
SQLITE_SO_UNDEFINED = -1
- SQLITE_STAT4_SAMPLES = 1
+ SQLITE_STAT4_SAMPLES = 24
SQLITE_STATUS_MALLOC_COUNT = 9
SQLITE_STATUS_MALLOC_SIZE = 5
SQLITE_STATUS_MEMORY_USED = 0
@@ -1693,7 +1903,7 @@ const (
SQLITE_TOOBIG = 18
SQLITE_TRACE_CLOSE = 0x08
SQLITE_TRACE_LEGACY = 0x40
- SQLITE_TRACE_NONLEGACY_MASK = 0x0
+ SQLITE_TRACE_NONLEGACY_MASK = 0x0f
SQLITE_TRACE_PROFILE = 0x02
SQLITE_TRACE_ROW = 0x04
SQLITE_TRACE_STMT = 0x01
@@ -1712,8 +1922,8 @@ const (
SQLITE_UTF8 = 1
SQLITE_VDBEINT_H = 0
SQLITE_VDBE_H = 0
- SQLITE_VERSION = "3.32.3"
- SQLITE_VERSION_NUMBER = 3032003
+ SQLITE_VERSION = "3.33.0"
+ SQLITE_VERSION_NUMBER = 3033000
SQLITE_VTABRISK_High = 2
SQLITE_VTABRISK_Low = 0
SQLITE_VTABRISK_Normal = 1
@@ -1743,6 +1953,7 @@ const (
SRT_Set = 11
SRT_Table = 14
SRT_Union = 1
+ SRT_Upfrom = 15
STAT_GET_NDLT = 4
STAT_GET_NEQ = 2
STAT_GET_NLT = 3
@@ -1801,13 +2012,12 @@ const (
TCSETXF = 0x5434
TCSETXW = 0x5435
TCXONC = 0x540A
- TEMP_MASTER_NAME = "sqlite_temp_master"
TERM_ANDINFO = 0x0020
TERM_CODED = 0x0004
TERM_COPIED = 0x0008
TERM_DYNAMIC = 0x0001
TERM_HEURTRUTH = 0x2000
- TERM_HIGHTRUTH = 0
+ TERM_HIGHTRUTH = 0x4000
TERM_IS = 0x0800
TERM_LIKE = 0x0400
TERM_LIKECOND = 0x0200
@@ -1816,7 +2026,7 @@ const (
TERM_OR_OK = 0x0040
TERM_VARSELECT = 0x1000
TERM_VIRTUAL = 0x0002
- TERM_VNULL = 0x0000
+ TERM_VNULL = 0x0080
TF_Autoincrement = 0x0008
TF_Ephemeral = 0x0002
TF_HasGenerated = 0x0060
@@ -1841,7 +2051,7 @@ const (
TIOCGETD = 0x5424
TIOCGICOUNT = 0x545D
TIOCGLCKTRMIOS = 0x5456
- TIOCGPGRP = 0x540
+ TIOCGPGRP = 0x540F
TIOCGPTPEER = 21569
TIOCGRS485 = 0x542E
TIOCGSERIAL = 0x541E
@@ -1891,8 +2101,8 @@ const (
TIOCSETD = 0x5423
TIOCSLCKTRMIOS = 0x5457
TIOCSPGRP = 0x5410
- TIOCSRS485 = 0x542
- TIOCSSERIAL = 0x541
+ TIOCSRS485 = 0x542F
+ TIOCSSERIAL = 0x541F
TIOCSSOFTCAR = 0x541A
TIOCSTI = 0x5412
TIOCSWINSZ = 0x5414
@@ -2107,6 +2317,9 @@ const (
WAL_FRAME_HDRSIZE = 24
WAL_HDRSIZE = 32
WAL_HEAPMEMORY_MODE = 2
+ WAL_LOCK_CKPT = 1
+ WAL_LOCK_READ0 = 3
+ WAL_LOCK_WRITE = 0
WAL_MAGIC = 0x377f0682
WAL_MAX_VERSION = 3007000
WAL_NORMAL_MODE = 0
@@ -2128,7 +2341,7 @@ const (
WHERE_COLUMN_IN = 0x00000004
WHERE_COLUMN_NULL = 0x00000008
WHERE_COLUMN_RANGE = 0x00000002
- WHERE_CONSTRAINT = 0x0000000
+ WHERE_CONSTRAINT = 0x0000000f
WHERE_DISTINCTBY = 0x0080
WHERE_DISTINCT_NOOP = 0
WHERE_DISTINCT_ORDERED = 2
@@ -2170,7 +2383,7 @@ const (
WINDOW_STARTING_NUM = 3
WNOHANG = 1
WNOWAIT = 0x01000000
- WO_ALL = 0x1
+ WO_ALL = 0x1fff
WO_AND = 0x0400
WO_AUX = 0x0040
WO_EQ = 0x0002
@@ -2184,7 +2397,7 @@ const (
WO_LT = 16
WO_NOOP = 0x1000
WO_OR = 0x0200
- WO_SINGLE = 0x01
+ WO_SINGLE = 0x01ff
WRC_Abort = 2
WRC_Continue = 0
WRC_Prune = 1
@@ -2200,25 +2413,25 @@ const (
YYNOERRORRECOVERY = 1
YYNRULE = 385
YYNRULE_WITH_ACTION = 325
- YYNSTATE = 551
+ YYNSTATE = 553
YYNTOKEN = 181
YYPARSEFREENEVERNULL = 1
YYSTACKDEPTH = 100
YYWILDCARD = 100
- YY_ACCEPT_ACTION = 1187
- YY_ACTTAB_COUNT = 1958
- YY_ERROR_ACTION = 1186
- YY_MAX_REDUCE = 1573
- YY_MAX_SHIFT = 550
- YY_MAX_SHIFTREDUCE = 1185
- YY_MIN_REDUCE = 1189
- YY_MIN_SHIFTREDUCE = 801
- YY_NO_ACTION = 1188
- YY_REDUCE_COUNT = 389
- YY_REDUCE_MAX = 1617
+ YY_ACCEPT_ACTION = 1189
+ YY_ACTTAB_COUNT = 1962
+ YY_ERROR_ACTION = 1188
+ YY_MAX_REDUCE = 1575
+ YY_MAX_SHIFT = 552
+ YY_MAX_SHIFTREDUCE = 1187
+ YY_MIN_REDUCE = 1191
+ YY_MIN_SHIFTREDUCE = 803
+ YY_NO_ACTION = 1190
+ YY_REDUCE_COUNT = 391
+ YY_REDUCE_MAX = 1625
YY_REDUCE_MIN = -262
- YY_SHIFT_COUNT = 550
- YY_SHIFT_MAX = 1948
+ YY_SHIFT_COUNT = 552
+ YY_SHIFT_MAX = 1951
YY_SHIFT_MIN = 0
X_ANSI_STDARG_H_ = 0
X_ANSI_STDDEF_H = 0
@@ -2247,6 +2460,7 @@ const (
X_FCNTL_H = 1
X_FEATURES_H = 1
X_FILE_OFFSET_BITS = 64
+ X_FTS5INT_H = 0
X_FTS5_H = 0
X_FTSINT_H = 0
X_GCC_MAX_ALIGN_T = 0
@@ -2362,6 +2576,7 @@ const (
X_SIZE_T_DECLARED = 0
X_SIZE_T_DEFINED = 0
X_SIZE_T_DEFINED_ = 0
+ X_SQLITE3RBU_H = 0
X_SQLITE3RTREE_H_ = 0
X_SQLITE_OS_H_ = 0
X_STATBUF_ST_BLKSIZE = 0
@@ -2421,6 +2636,7 @@ const (
X_XOPEN_XPG3 = 1
X_XOPEN_XPG4 = 1
BBatch = 0
+ Deliberate_fall_through = 0
EtBUFSIZE = 70
EtCHARX = 8
EtDECIMAL = 16
@@ -2440,20 +2656,42 @@ const (
EtSRCLIST = 12
EtSTRING = 5
EtTOKEN = 11
+ Fts5YYNFTS5TOKEN = 16
+ Fts5YYNOCODE = 27
+ Fts5YYNOERRORRECOVERY = 1
+ Fts5YYNRULE = 28
+ Fts5YYNRULE_WITH_ACTION = 28
+ Fts5YYNSTATE = 35
+ Fts5YYPARSEFREENOTNULL = 1
+ Fts5YYSTACKDEPTH = 100
+ Fts5YY_ACCEPT_ACTION = 81
+ Fts5YY_ACTTAB_COUNT = 105
+ Fts5YY_ERROR_ACTION = 80
+ Fts5YY_MAX_REDUCE = 110
+ Fts5YY_MAX_SHIFT = 34
+ Fts5YY_MAX_SHIFTREDUCE = 79
+ Fts5YY_MIN_REDUCE = 83
+ Fts5YY_MIN_SHIFTREDUCE = 52
+ Fts5YY_NO_ACTION = 82
+ Fts5YY_REDUCE_COUNT = 17
+ Fts5YY_REDUCE_MAX = 67
+ Fts5YY_REDUCE_MIN = -17
+ Fts5YY_SHIFT_COUNT = 34
+ Fts5YY_SHIFT_MAX = 93
+ Fts5YY_SHIFT_MIN = 0
Linux = 1
Math_errhandling = 3
+ Sqlite3Fts5ParserCTX_FETCH = 0
+ Sqlite3Fts5ParserCTX_PARAM = 0
+ Sqlite3Fts5ParserCTX_PDECL = 0
+ Sqlite3Fts5ParserCTX_SDECL = 0
+ Sqlite3Fts5ParserCTX_STORE = 0
Sqlite3ParserARG_FETCH = 0
Sqlite3ParserARG_PARAM = 0
Sqlite3ParserARG_PDECL = 0
Sqlite3ParserARG_SDECL = 0
Sqlite3ParserARG_STORE = 0
Sqlite3Parser_ENGINEALWAYSONSTACK = 1
- Sqlite3_column_database_name = 0
- Sqlite3_column_database_name16 = 0
- Sqlite3_column_origin_name = 0
- Sqlite3_column_origin_name16 = 0
- Sqlite3_column_table_name = 0
- Sqlite3_column_table_name16 = 0
TkCREATE = 4
TkEND = 7
TkEXPLAIN = 3
@@ -2915,10 +3153,13 @@ type Size_t = uint64 /* <builtin>:9:23 */
type Wchar_t = int32 /* <builtin>:15:24 */
+type X__builtin_va_list = uintptr /* <builtin>:28:14 */
+type X__float128 = float64 /* <builtin>:29:21 */
+
// *****************************************************************************
//
// This file is an amalgamation of many separate C source files from SQLite
-// version 3.32.3. By combining all the individual C code files into this
+// version 3.33.0. By combining all the individual C code files into this
// single large file, the entire code can be compiled as a single translation
// unit. This allows many compilers to do optimizations that would not be
// possible if the files were compiled separately. Performance improvements
@@ -2965,30 +3206,245 @@ type Wchar_t = int32 /* <builtin>:15:24 */
// This array looks large, but in a typical installation actually uses
// only a handful of compile-time options, so most times this array is usually
// rather short and uses little memory space.
-var sqlite3azCompileOpt = [13]uintptr{
+var sqlite3azCompileOpt = [21]uintptr{
// BEGIN CODE GENERATED BY tool/mkctime.tcl
ts, /* "DEFAULT_PAGE_SIZ..." */
- ts + 23, /* "DEFAULT_WAL_SYNC..." */
- ts + 49, /* "ENABLE_BYTECODE_..." */
- ts + 70, /* "ENABLE_STMTVTAB" */
- ts + 86, /* "ENABLE_UNLOCK_NO..." */
- ts + 107, /* "LIKE_DOESNT_MATC..." */
- ts + 131, /* "MAX_EXPR_DEPTH=0" */
- ts + 148, /* "MAX_MMAP_SIZE=85..." */
- ts + 173, /* "MUTEX_NOOP" */
- ts + 184, /* "NO_SYNC" */
- ts + 192, /* "TEMP_STORE=1" */
- ts + 205, /* "TEST" */
- ts + 210, /* "THREADSAFE=1" */
+ ts + 23, /* "ENABLE_BYTECODE_..." */
+ ts + 44, /* "ENABLE_COLUMN_ME..." */
+ ts + 67, /* "ENABLE_DBSTAT_VT..." */
+ ts + 86, /* "ENABLE_FTS5" */
+ ts + 98, /* "ENABLE_GEOPOLY" */
+ ts + 113, /* "ENABLE_JSON1" */
+ ts + 126, /* "ENABLE_MEMORY_MA..." */
+ ts + 151, /* "ENABLE_PREUPDATE..." */
+ ts + 173, /* "ENABLE_RBU" */
+ ts + 184, /* "ENABLE_RTREE" */
+ ts + 197, /* "ENABLE_SNAPSHOT" */
+ ts + 213, /* "ENABLE_STAT4" */
+ ts + 226, /* "ENABLE_STMTVTAB" */
+ ts + 242, /* "ENABLE_UNLOCK_NO..." */
+ ts + 263, /* "LIKE_DOESNT_MATC..." */
+ ts + 287, /* "MUTEX_NOOP" */
+ ts + 298, /* "SOUNDEX" */
+ ts + 306, /* "TEMP_STORE=1" */
+ ts + 319, /* "TEST" */
+ ts + 324, /* "THREADSAFE=1" */
// END CODE GENERATED BY tool/mkctime.tcl
} /* sqlite3.c:72:19 */
-func Xsqlite3CompileOptions(tls *crt.TLS, pnOpt uintptr) uintptr { /* sqlite3.c:782:27: */
+func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr { /* sqlite3.c:782:27: */
*(*int32)(unsafe.Pointer(pnOpt)) = (int32(uint64(unsafe.Sizeof(sqlite3azCompileOpt)) / uint64(unsafe.Sizeof(uintptr(0)))))
return uintptr(uintptr(unsafe.Pointer(&sqlite3azCompileOpt)))
}
+//************* End of ctime.c **********************************************
+//************* Begin file sqliteInt.h **************************************
+// 2001 September 15
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+// Internal interface definitions for SQLite.
+//
+
+// Special Comments:
+//
+// Some comments have special meaning to the tools that measure test
+// coverage:
+//
+// NO_TEST - The branches on this line are not
+// measured by branch coverage. This is
+// used on lines of code that actually
+// implement parts of coverage testing.
+//
+// OPTIMIZATION-IF-TRUE - This branch is allowed to alway be false
+// and the correct answer is still obtained,
+// though perhaps more slowly.
+//
+// OPTIMIZATION-IF-FALSE - This branch is allowed to alway be true
+// and the correct answer is still obtained,
+// though perhaps more slowly.
+//
+// PREVENTS-HARMLESS-OVERREAD - This branch prevents a buffer overread
+// that would be harmless and undetectable
+// if it did occur.
+//
+// In all cases, the special comment must be enclosed in the usual
+// slash-asterisk...asterisk-slash comment marks, with no spaces between the
+// asterisks and the comment text.
+
+// Make sure the Tcl calling convention macro is defined. This macro is
+// only used by test code and Tcl integration code.
+
+// Include the header file used to customize the compiler options for MSVC.
+// This should be done first so that it can successfully prevent spurious
+// compiler warnings due to subsequent content in this file and other files
+// that are included by this file.
+//************* Include msvc.h in the middle of sqliteInt.h *****************
+//************* Begin file msvc.h *******************************************
+// 2015 January 12
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// This file contains code that is specific to MSVC.
+
+//************* End of msvc.h ***********************************************
+//************* Continuing where we left off in sqliteInt.h *****************
+
+// Special setup for VxWorks
+//************* Include vxworks.h in the middle of sqliteInt.h **************
+//************* Begin file vxworks.h ****************************************
+// 2015-03-02
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// This file contains code that is specific to Wind River's VxWorks
+// This is not VxWorks.
+
+//************* End of vxworks.h ********************************************
+//************* Continuing where we left off in sqliteInt.h *****************
+
+// These #defines should enable >2GB file support on POSIX if the
+// underlying operating system supports it. If the OS lacks
+// large file support, or if the OS is windows, these should be no-ops.
+//
+// Ticket #2739: The _LARGEFILE_SOURCE macro must appear before any
+// system #includes. Hence, this block of code must be the very first
+// code in all source files.
+//
+// Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
+// on the compiler command line. This is necessary if you are compiling
+// on a recent machine (ex: Red Hat 7.2) but you want your code to work
+// on an older machine (ex: Red Hat 6.0). If you compile on Red Hat 7.2
+// without this option, LFS is enable. But LFS does not exist in the kernel
+// in Red Hat 6.0, so the code won't work. Hence, for maximum binary
+// portability you should omit LFS.
+//
+// The previous paragraph was written in 2005. (This paragraph is written
+// on 2008-11-28.) These days, all Linux kernels support large files, so
+// you should probably leave LFS enabled. But some embedded platforms might
+// lack LFS in which case the SQLITE_DISABLE_LFS macro might still be useful.
+//
+// Similar is true for Mac OS X. LFS is only supported on Mac OS X 9 and later.
+
+// The GCC_VERSION and MSVC_VERSION macros are used to
+// conditionally include optimizations for each of these compilers. A
+// value of 0 means that compiler is not being used. The
+// SQLITE_DISABLE_INTRINSIC macro means do not use any compiler-specific
+// optimizations, and hence set all compiler macros to 0
+//
+// There was once also a CLANG_VERSION macro. However, we learn that the
+// version numbers in clang are for "marketing" only and are inconsistent
+// and unreliable. Fortunately, all versions of clang also recognize the
+// gcc version numbers and have reasonable settings for gcc version numbers,
+// so the GCC_VERSION macro will be set to a correct non-zero value even
+// when compiling with clang.
+
+// Needed for various definitions...
+
+// Macro to disable warnings about missing "break" at the end of a "case".
+
+// For MinGW, check to see if we can include the header file containing its
+// version information, among other things. Normally, this internal MinGW
+// header file would [only] be included automatically by other MinGW header
+// files; however, the contained version information is now required by this
+// header file to work around binary compatibility issues (see below) and
+// this is the only known way to reliably obtain it. This entire #if block
+// would be completely unnecessary if there was any other way of detecting
+// MinGW via their preprocessor (e.g. if they customized their GCC to define
+// some MinGW-specific macros). When compiling for MinGW, either the
+// _HAVE_MINGW_H or _HAVE__MINGW_H (note the extra underscore) macro must be
+// defined; otherwise, detection of conditions specific to MinGW will be
+// disabled.
+
+// For MinGW version 4.x (and higher), check to see if the _USE_32BIT_TIME_T
+// define is required to maintain binary compatibility with the MSVC runtime
+// library in use (e.g. for Windows XP).
+
+// The public SQLite interface. The _FILE_OFFSET_BITS macro must appear
+// first in QNX. Also, the _USE_32BIT_TIME_T macro must appear first for
+// MinGW.
+//************* Include sqlite3.h in the middle of sqliteInt.h **************
+//************* Begin file sqlite3.h ****************************************
+// 2001-09-15
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+// This header file defines the interface that the SQLite library
+// presents to client programs. If a C-function, structure, datatype,
+// or constant definition does not appear in this file, then it is
+// not a published API of SQLite, is subject to change without
+// notice, and should not be referenced by programs that use SQLite.
+//
+// Some of the definitions that are in this file are marked as
+// "experimental". Experimental interfaces are normally new
+// features recently added to SQLite. We do not anticipate changes
+// to experimental interfaces but reserve the right to make minor changes
+// if experience from use "in the wild" suggest such changes are prudent.
+//
+// The official C-language API documentation for SQLite is derived
+// from comments in this file. This file is the authoritative source
+// on how SQLite interfaces are supposed to operate.
+//
+// The name of this file under configuration management is "sqlite.h.in".
+// The makefile makes some minor changes to this file (such as inserting
+// the version number) and changes its name to "sqlite3.h" as
+// part of the build process.
+// Copyright (C) 1989-2018 Free Software Foundation, Inc.
+//
+//This file is part of GCC.
+//
+//GCC is free software; you can redistribute it and/or modify
+//it under the terms of the GNU General Public License as published by
+//the Free Software Foundation; either version 3, or (at your option)
+//any later version.
+//
+//GCC is distributed in the hope that it will be useful,
+//but WITHOUT ANY WARRANTY; without even the implied warranty of
+//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//GNU General Public License for more details.
+//
+//Under Section 7 of GPL version 3, you are granted additional
+//permissions described in the GCC Runtime Library Exception, version
+//3.1, as published by the Free Software Foundation.
+//
+//You should have received a copy of the GNU General Public License and
+//a copy of the GCC Runtime Library Exception along with this program;
+//see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+//<http://www.gnu.org/licenses/>.
+
+// ISO C Standard: 7.15 Variable arguments <stdarg.h>
+
+// Define __gnuc_va_list.
+
+type X__gnuc_va_list = X__builtin_va_list /* stdarg.h:40:27 */
+
// Define the standard macros for the user,
// if this invocation was from the user program.
@@ -3007,7 +3463,7 @@ func Xsqlite3CompileOptions(tls *crt.TLS, pnOpt uintptr) uintptr { /* sqlite3.c:
// The macro _VA_LIST is used in SCO Unix 3.2.
// The macro _VA_LIST_T_H is used in the Bull dpx2
// The macro __va_list__ is used by BeOS.
-type Va_list = uintptr /* stdarg.h:99:24 */
+type Va_list = X__gnuc_va_list /* stdarg.h:99:24 */
// Make sure we can call this stuff from C++.
@@ -3086,7 +3542,7 @@ type Va_list = uintptr /* stdarg.h:99:24 */
// of the hash might be different from [SQLITE_SOURCE_ID].)^
//
// See also: [sqlite_version()] and [sqlite_source_id()].
-var Xsqlite3_version = *(*[7]int8)(unsafe.Pointer(ts + 223 /* "3.32.3" */)) /* sqlite3.c:1201:23 */
+var Xsqlite3_version = *(*[7]int8)(unsafe.Pointer(ts + 337 /* "3.33.0" */)) /* sqlite3.c:1210:23 */
// CAPI3REF: Database Connection Handle
// KEYWORDS: {database connection} {database connections}
@@ -3137,38 +3593,41 @@ type sqlite3 = struct {
FaLimit [12]int32
FnMaxSorterMmap int32
Finit struct {
- FnewTnum int32
+ FnewTnum Pgno
FiDb U8
Fbusy U8
_ [2]byte
ForphanTrigger uint8 /* unsigned orphanTrigger: 1, unsigned imposterTable: 1, unsigned reopenMemdb: 1 */
FazInit uintptr
}
- FnVdbeActive int32
- FnVdbeRead int32
- FnVdbeWrite int32
- FnVdbeExec int32
- FnVDestroy int32
- FnExtension int32
- FaExtension uintptr
- FxTrace uintptr
- FpTraceArg uintptr
- FxProfile uintptr
- FpProfileArg uintptr
- FpCommitArg uintptr
- FxCommitCallback uintptr
- FpRollbackArg uintptr
- FxRollbackCallback uintptr
- FpUpdateArg uintptr
- FxUpdateCallback uintptr
- FpParse uintptr
- FxWalCallback uintptr
- FpWalArg uintptr
- FxCollNeeded uintptr
- FxCollNeeded16 uintptr
- FpCollNeededArg uintptr
- FpErr uintptr
- Fu1 struct {
+ FnVdbeActive int32
+ FnVdbeRead int32
+ FnVdbeWrite int32
+ FnVdbeExec int32
+ FnVDestroy int32
+ FnExtension int32
+ FaExtension uintptr
+ Ftrace struct{ FxLegacy uintptr }
+ FpTraceArg uintptr
+ FxProfile uintptr
+ FpProfileArg uintptr
+ FpCommitArg uintptr
+ FxCommitCallback uintptr
+ FpRollbackArg uintptr
+ FxRollbackCallback uintptr
+ FpUpdateArg uintptr
+ FxUpdateCallback uintptr
+ FpParse uintptr
+ FpPreUpdateArg uintptr
+ FxPreUpdateCallback uintptr
+ FpPreUpdate uintptr
+ FxWalCallback uintptr
+ FpWalArg uintptr
+ FxCollNeeded uintptr
+ FxCollNeeded16 uintptr
+ FpCollNeededArg uintptr
+ FpErr uintptr
+ Fu1 struct {
_ [0]uint64
FisInterrupted int32
_ [4]byte
@@ -3215,7 +3674,7 @@ type sqlite3 = struct {
// [sqlite3_prepare_v2()], [sqlite3_create_function()], and
// [sqlite3_busy_timeout()] to name but three) that are methods on an
// sqlite3 object.
-type Sqlite3 = sqlite3 /* sqlite3.c:1288:24 */
+type Sqlite3 = sqlite3 /* sqlite3.c:1297:24 */
// CAPI3REF: 64-Bit Integer Types
// KEYWORDS: sqlite_int64 sqlite_uint64
@@ -3231,15 +3690,15 @@ type Sqlite3 = sqlite3 /* sqlite3.c:1288:24 */
// between -9223372036854775808 and +9223372036854775807 inclusive. ^The
// sqlite3_uint64 and sqlite_uint64 types can store integer values
// between 0 and +18446744073709551615 inclusive.
-type Sqlite_int64 = int64 /* sqlite3.c:1317:25 */
-type Sqlite_uint64 = uint64 /* sqlite3.c:1318:34 */
-type Sqlite3_int64 = Sqlite_int64 /* sqlite3.c:1320:22 */
-type Sqlite3_uint64 = Sqlite_uint64 /* sqlite3.c:1321:23 */
+type Sqlite_int64 = int64 /* sqlite3.c:1326:25 */
+type Sqlite_uint64 = uint64 /* sqlite3.c:1327:34 */
+type Sqlite3_int64 = Sqlite_int64 /* sqlite3.c:1329:22 */
+type Sqlite3_uint64 = Sqlite_uint64 /* sqlite3.c:1330:23 */
// The type for a callback function.
// This is legacy and deprecated. It is included for historical
// compatibility and is not documented.
-type Sqlite3_callback = uintptr /* sqlite3.c:1377:13 */
+type Sqlite3_callback = uintptr /* sqlite3.c:1386:13 */
// CAPI3REF: Result Codes
// KEYWORDS: {result code definitions}
@@ -3276,6 +3735,7 @@ type Sqlite3_callback = uintptr /* sqlite3.c:1377:13 */
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
// Reserved: 0x00F00000
+// Legacy compatibility:
// CAPI3REF: Device Characteristics
//
@@ -3386,6 +3846,7 @@ type sqlite3_file = struct{ FpMethods uintptr }
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
// Reserved: 0x00F00000
+// Legacy compatibility:
// CAPI3REF: Device Characteristics
//
@@ -3459,7 +3920,7 @@ type sqlite3_file = struct{ FpMethods uintptr }
// for their own use. The pMethods entry is a pointer to an
// [sqlite3_io_methods] object that defines methods for performing
// I/O operations on the open file.
-type Sqlite3_file = sqlite3_file /* sqlite3.c:1719:29 */
+type Sqlite3_file = sqlite3_file /* sqlite3.c:1731:29 */
type sqlite3_io_methods = struct {
FiVersion int32
FxClose uintptr
@@ -3574,7 +4035,7 @@ type sqlite3_io_methods = struct {
// fails to zero-fill short reads might seem to work. However,
// failure to zero-fill short reads will eventually lead to
// database corruption.
-type Sqlite3_io_methods = sqlite3_io_methods /* sqlite3.c:1818:35 */
+type Sqlite3_io_methods = sqlite3_io_methods /* sqlite3.c:1830:35 */
// CAPI3REF: Loadable Extension Thunk
//
@@ -3843,7 +4304,7 @@ type sqlite3_api_routines = struct {
// the third parameter to entry points of [loadable extensions]. This
// structure must be typedefed in order to work around compiler warnings
// on some platforms.
-type Sqlite3_api_routines = sqlite3_api_routines /* sqlite3.c:2232:37 */
+type Sqlite3_api_routines = sqlite3_api_routines /* sqlite3.c:2244:37 */
// CAPI3REF: OS Interface Object
//
@@ -3919,7 +4380,7 @@ type Sqlite3_api_routines = sqlite3_api_routines /* sqlite3.c:2232:37 */
// <li> [SQLITE_OPEN_TEMP_JOURNAL]
// <li> [SQLITE_OPEN_TRANSIENT_DB]
// <li> [SQLITE_OPEN_SUBJOURNAL]
-// <li> [SQLITE_OPEN_MASTER_JOURNAL]
+// <li> [SQLITE_OPEN_SUPER_JOURNAL]
// <li> [SQLITE_OPEN_WAL]
// </ul>)^
//
@@ -4111,7 +4572,7 @@ type sqlite3_vfs = struct {
// <li> [SQLITE_OPEN_TEMP_JOURNAL]
// <li> [SQLITE_OPEN_TRANSIENT_DB]
// <li> [SQLITE_OPEN_SUBJOURNAL]
-// <li> [SQLITE_OPEN_MASTER_JOURNAL]
+// <li> [SQLITE_OPEN_SUPER_JOURNAL]
// <li> [SQLITE_OPEN_WAL]
// </ul>)^
//
@@ -4204,8 +4665,8 @@ type sqlite3_vfs = struct {
// or all of these interfaces to be NULL or for their behavior to change
// from one release to the next. Applications must not attempt to access
// any of these methods if the iVersion of the VFS is less than 3.
-type Sqlite3_vfs = sqlite3_vfs /* sqlite3.c:2403:28 */
-type Sqlite3_syscall_ptr = uintptr /* sqlite3.c:2404:14 */
+type Sqlite3_vfs = sqlite3_vfs /* sqlite3.c:2415:28 */
+type Sqlite3_syscall_ptr = uintptr /* sqlite3.c:2416:14 */
// CAPI3REF: Memory Allocation Routines
//
@@ -4255,7 +4716,7 @@ type Sqlite3_syscall_ptr = uintptr /* sqlite3.c:2404:14 */
// by xInit. The pAppData pointer is used as the only parameter to
// xInit and xShutdown.
//
-// SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
+// SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
// the xInit method, so the xInit method need not be threadsafe. The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either. For all other methods, SQLite
@@ -4327,7 +4788,7 @@ type sqlite3_mem_methods = struct {
// by xInit. The pAppData pointer is used as the only parameter to
// xInit and xShutdown.
//
-// SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
+// SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
// the xInit method, so the xInit method need not be threadsafe. The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either. For all other methods, SQLite
@@ -4340,7 +4801,7 @@ type sqlite3_mem_methods = struct {
//
// SQLite will never invoke xInit() more than once without an intervening
// call to xShutdown().
-type Sqlite3_mem_methods = sqlite3_mem_methods /* sqlite3.c:2701:36 */
+type Sqlite3_mem_methods = sqlite3_mem_methods /* sqlite3.c:2713:36 */
// CAPI3REF: Dynamically Typed Value Object
// KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
@@ -4432,7 +4893,7 @@ type sqlite3_value = struct {
// [sqlite3_value_dup()].
// The [sqlite3_value_blob | sqlite3_value_type()] family of
// interfaces require protected sqlite3_value objects.
-type Sqlite3_value = sqlite3_value /* sqlite3.c:5281:30 */
+type Sqlite3_value = sqlite3_value /* sqlite3.c:5292:30 */
// CAPI3REF: SQL Function Context Object
//
@@ -4466,7 +4927,7 @@ type sqlite3_context = struct {
// [sqlite3_aggregate_context()], [sqlite3_user_data()],
// [sqlite3_context_db_handle()], [sqlite3_get_auxdata()],
// and/or [sqlite3_set_auxdata()].
-type Sqlite3_context = sqlite3_context /* sqlite3.c:5295:32 */
+type Sqlite3_context = sqlite3_context /* sqlite3.c:5306:32 */
// CAPI3REF: Constants Defining Special Destructor Behavior
//
@@ -4480,7 +4941,7 @@ type Sqlite3_context = sqlite3_context /* sqlite3.c:5295:32 */
//
// The typedef is necessary to work around problems in certain
// C++ compilers.
-type Sqlite3_destructor_type = uintptr /* sqlite3.c:6658:14 */
+type Sqlite3_destructor_type = uintptr /* sqlite3.c:6669:14 */
// The interface to the virtual-table mechanism is currently considered
// to be experimental. The interface might change in incompatible ways.
@@ -4504,7 +4965,7 @@ type sqlite3_vtab = struct {
// interface fixed, support it indefinitely, and remove this comment.
// Structures used by the virtual table interface
-type Sqlite3_vtab = sqlite3_vtab /* sqlite3.c:7726:29 */
+type Sqlite3_vtab = sqlite3_vtab /* sqlite3.c:7737:29 */
type sqlite3_index_info = struct {
FnConstraint int32
FaConstraint uintptr
@@ -4521,10 +4982,10 @@ type sqlite3_index_info = struct {
FcolUsed Sqlite3_uint64
}
-type Sqlite3_index_info = sqlite3_index_info /* sqlite3.c:7727:35 */
+type Sqlite3_index_info = sqlite3_index_info /* sqlite3.c:7738:35 */
type sqlite3_vtab_cursor = struct{ FpVtab uintptr }
-type Sqlite3_vtab_cursor = sqlite3_vtab_cursor /* sqlite3.c:7728:36 */
+type Sqlite3_vtab_cursor = sqlite3_vtab_cursor /* sqlite3.c:7739:36 */
type sqlite3_module = struct {
FiVersion int32
FxCreate uintptr
@@ -4552,7 +5013,7 @@ type sqlite3_module = struct {
FxShadowName uintptr
}
-type Sqlite3_module = sqlite3_module /* sqlite3.c:7729:31 */
+type Sqlite3_module = sqlite3_module /* sqlite3.c:7740:31 */
// CAPI3REF: Virtual Table Indexing Information
// KEYWORDS: sqlite3_index_info
@@ -5011,7 +5472,7 @@ type sqlite3_mutex_methods = struct {
// called, but only if the prior call to xMutexInit returned SQLITE_OK.
// If xMutexInit fails in any way, it is expected to clean up after itself
// prior to returning.
-type Sqlite3_mutex_methods = sqlite3_mutex_methods /* sqlite3.c:8561:38 */
+type Sqlite3_mutex_methods = sqlite3_mutex_methods /* sqlite3.c:8572:38 */
// CAPI3REF: Dynamic String Object
// KEYWORDS: {dynamic string}
@@ -5052,7 +5513,7 @@ type sqlite3_str = struct {
// <li> ^The sqlite3_str object is destroyed and the string it created
// is returned using the [sqlite3_str_finish()] interface.
// </ol>
-type Sqlite3_str = sqlite3_str /* sqlite3.c:8817:28 */
+type Sqlite3_str = sqlite3_str /* sqlite3.c:8832:28 */
// CAPI3REF: Custom Page Cache Object
//
@@ -5075,7 +5536,7 @@ type sqlite3_pcache_page = struct {
// of this object as parameters or as their return value.
//
// See [sqlite3_pcache_methods2] for additional information.
-type Sqlite3_pcache_page = sqlite3_pcache_page /* sqlite3.c:9310:36 */
+type Sqlite3_pcache_page = sqlite3_pcache_page /* sqlite3.c:9325:36 */
// CAPI3REF: Application Defined Page Cache.
// KEYWORDS: {page cache}
@@ -5407,7 +5868,7 @@ type sqlite3_pcache_methods2 = struct {
// free up as much of heap memory as possible. The page cache implementation
// is not obligated to free any memory, but well-behaved implementations should
// do their best.
-type Sqlite3_pcache_methods2 = sqlite3_pcache_methods2 /* sqlite3.c:9475:40 */
+type Sqlite3_pcache_methods2 = sqlite3_pcache_methods2 /* sqlite3.c:9490:40 */
// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -5429,7 +5890,7 @@ type sqlite3_pcache_methods = struct {
// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
// retained in the header file for backwards compatibility only.
-type Sqlite3_pcache_methods = sqlite3_pcache_methods /* sqlite3.c:9498:39 */
+type Sqlite3_pcache_methods = sqlite3_pcache_methods /* sqlite3.c:9513:39 */
// CAPI3REF: Online Backup Object
//
@@ -5462,7 +5923,7 @@ type sqlite3_backup = struct {
// [sqlite3_backup_finish()].
//
// See Also: [Using the SQLite Online Backup API]
-type Sqlite3_backup = sqlite3_backup /* sqlite3.c:9524:31 */
+type Sqlite3_backup = sqlite3_backup /* sqlite3.c:9539:31 */
// CAPI3REF: Database Snapshot
// KEYWORDS: {snapshot} {sqlite3_snapshot}
@@ -5502,7 +5963,7 @@ type sqlite3_snapshot = struct{ Fhidden [48]uint8 }
// version of the database file so that it is possible to later open a new read
// transaction that sees that historical version of the database rather than
// the most recent version.
-type Sqlite3_snapshot = sqlite3_snapshot /* sqlite3.c:10547:3 */
+type Sqlite3_snapshot = sqlite3_snapshot /* sqlite3.c:10562:3 */
// CAPI3REF: Flags for sqlite3_deserialize()
//
@@ -5582,7 +6043,7 @@ type sqlite3_rtree_geometry = struct {
//
//
-type Sqlite3_rtree_geometry = sqlite3_rtree_geometry /* sqlite3.c:10872:39 */
+type Sqlite3_rtree_geometry = sqlite3_rtree_geometry /* sqlite3.c:10887:39 */
type sqlite3_rtree_query_info = struct {
FpContext uintptr
FnParam int32
@@ -5602,11 +6063,11 @@ type sqlite3_rtree_query_info = struct {
FapSqlParam uintptr
}
-type Sqlite3_rtree_query_info = sqlite3_rtree_query_info /* sqlite3.c:10873:41 */
+type Sqlite3_rtree_query_info = sqlite3_rtree_query_info /* sqlite3.c:10888:41 */
// The double-precision datatype used by RTree depends on the
// SQLITE_RTREE_INT_ONLY compile-time option.
-type Sqlite3_rtree_dbl = float64 /* sqlite3.c:10881:18 */
+type Sqlite3_rtree_dbl = float64 /* sqlite3.c:10896:18 */
// Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin.
@@ -5693,22 +6154,22 @@ type Fts5ExtensionApi1 = struct {
// Virtual table implementations may overload SQL functions by implementing
// the sqlite3_module.xFindFunction() method.
-type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.c:12667:33 */
+type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.c:12682:33 */
type Fts5PhraseIter1 = struct {
Fa uintptr
Fb uintptr
}
-type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.c:12669:31 */
+type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.c:12684:31 */
-type Fts5_extension_function = uintptr /* sqlite3.c:12671:14 */
+type Fts5_extension_function = uintptr /* sqlite3.c:12686:14 */
type fts5_tokenizer = struct {
FxCreate uintptr
FxDelete uintptr
FxTokenize uintptr
}
-type Fts5_tokenizer = fts5_tokenizer /* sqlite3.c:13130:31 */
+type Fts5_tokenizer = fts5_tokenizer /* sqlite3.c:13145:31 */
// Flags that may be passed as the third argument to xTokenize()
@@ -5741,7 +6202,7 @@ type fts5_api = struct {
// ************************************************************************
//
// FTS5 EXTENSION REGISTRATION API
-type Fts5_api = fts5_api /* sqlite3.c:13166:25 */
+type Fts5_api = fts5_api /* sqlite3.c:13181:25 */
// Is the sqlite3ErrName() function needed in the build? Currently,
// it is needed by "mutex_w32.c" (when debugging), "os_win.c" (when
@@ -5816,7 +6277,7 @@ type Hash1 = struct {
// used in SQLite.
// Forward declarations of structures.
-type Hash = Hash1 /* sqlite3.c:13845:21 */
+type Hash = Hash1 /* sqlite3.c:13860:21 */
type HashElem1 = struct {
Fnext uintptr
Fprev uintptr
@@ -5824,7 +6285,7 @@ type HashElem1 = struct {
FpKey uintptr
}
-type HashElem = HashElem1 /* sqlite3.c:13846:25 */
+type HashElem = HashElem1 /* sqlite3.c:13861:25 */
// A complete hash table is an instance of the following structure.
// The internals of this structure are intended to be opaque -- client
@@ -5851,17 +6312,299 @@ type _ht = struct {
Fchain uintptr
}
+// Wide character type.
+// Locale-writers should change this as necessary to
+// be big enough to hold unique values not between 0 and 127,
+// and not (wchar_t) -1, for each defined multibyte character.
+
+// Define this type if we are doing the whole job,
+// or if we want this type in particular.
+
+// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
+// are already defined.
+// BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here.
+// NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here.
+
+// A null pointer constant.
+
+// Copyright (C) 1989-2018 Free Software Foundation, Inc.
+//
+//This file is part of GCC.
+//
+//GCC is free software; you can redistribute it and/or modify
+//it under the terms of the GNU General Public License as published by
+//the Free Software Foundation; either version 3, or (at your option)
+//any later version.
+//
+//GCC is distributed in the hope that it will be useful,
+//but WITHOUT ANY WARRANTY; without even the implied warranty of
+//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//GNU General Public License for more details.
+//
+//Under Section 7 of GPL version 3, you are granted additional
+//permissions described in the GCC Runtime Library Exception, version
+//3.1, as published by the Free Software Foundation.
+//
+//You should have received a copy of the GNU General Public License and
+//a copy of the GCC Runtime Library Exception along with this program;
+//see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+//<http://www.gnu.org/licenses/>.
+
+// ISO C Standard: 7.15 Variable arguments <stdarg.h>
+
+// bits/types.h -- definitions of __*_t types underlying *_t types.
+// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Never include this file directly; use <sys/types.h> instead.
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Determine the wordsize from the preprocessor defines.
+
+// Both x86-64 and x32 use the 64-bit system call interface.
+
+// Convenience types.
+type X__u_char = uint8 /* types.h:30:23 */
+type X__u_short = uint16 /* types.h:31:28 */
+type X__u_int = uint32 /* types.h:32:22 */
+type X__u_long = uint64 /* types.h:33:27 */
+
+// Fixed-size types, underlying types depend on word size and compiler.
+type X__int8_t = int8 /* types.h:36:21 */
+type X__uint8_t = uint8 /* types.h:37:23 */
+type X__int16_t = int16 /* types.h:38:26 */
+type X__uint16_t = uint16 /* types.h:39:28 */
+type X__int32_t = int32 /* types.h:40:20 */
+type X__uint32_t = uint32 /* types.h:41:22 */
+type X__int64_t = int64 /* types.h:43:25 */
+type X__uint64_t = uint64 /* types.h:44:27 */
+
+// Smallest types with at least a given width.
+type X__int_least8_t = X__int8_t /* types.h:51:18 */
+type X__uint_least8_t = X__uint8_t /* types.h:52:19 */
+type X__int_least16_t = X__int16_t /* types.h:53:19 */
+type X__uint_least16_t = X__uint16_t /* types.h:54:20 */
+type X__int_least32_t = X__int32_t /* types.h:55:19 */
+type X__uint_least32_t = X__uint32_t /* types.h:56:20 */
+type X__int_least64_t = X__int64_t /* types.h:57:19 */
+type X__uint_least64_t = X__uint64_t /* types.h:58:20 */
+
+// quad_t is also 64 bits.
+type X__quad_t = int64 /* types.h:62:18 */
+type X__u_quad_t = uint64 /* types.h:63:27 */
+
+// Largest integral types.
+type X__intmax_t = int64 /* types.h:71:18 */
+type X__uintmax_t = uint64 /* types.h:72:27 */
+
+// The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
+// macros for each of the OS types we define below. The definitions
+// of those macros must use the following macros for underlying types.
+// We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
+// variants of each of the following integer types on this machine.
+//
+// 16 -- "natural" 16-bit type (always short)
+// 32 -- "natural" 32-bit type (always int)
+// 64 -- "natural" 64-bit type (long or long long)
+// LONG32 -- 32-bit type, traditionally long
+// QUAD -- 64-bit type, always long long
+// WORD -- natural type of __WORDSIZE bits (int or long)
+// LONGWORD -- type of __WORDSIZE bits, traditionally long
+//
+// We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
+// conventional uses of `long' or `long long' type modifiers match the
+// types we define, even when a less-adorned type would be the same size.
+// This matters for (somewhat) portably writing printf/scanf formats for
+// these types, where using the appropriate l or ll format modifiers can
+// make the typedefs and the formats match up across all GNU platforms. If
+// we used `long' when it's 64 bits where `long long' is expected, then the
+// compiler would warn about the formats not matching the argument types,
+// and the programmer changing them to shut up the compiler would break the
+// program's portability.
+//
+// Here we assume what is presently the case in all the GCC configurations
+// we support: long long is always 64 bits, long is always word/address size,
+// and int is always 32 bits.
+
+// No need to mark the typedef with __extension__.
+// bits/typesizes.h -- underlying types for *_t. Linux/x86-64 version.
+// Copyright (C) 2012-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// See <bits/types.h> for the meaning of these macros. This file exists so
+// that <bits/types.h> need not vary across different GNU platforms.
+
+// X32 kernel interface is 64-bit.
+
+// Tell the libc code that off_t and off64_t are actually the same type
+// for all ABI purposes, even if possibly expressed as different base types
+// for C type-checking purposes.
+
+// Same for ino_t and ino64_t.
+
+// And for __rlim_t and __rlim64_t.
+
+// Number of descriptors that can fit in an `fd_set'.
+
+type X__dev_t = uint64 /* types.h:143:25 */ // Type of device numbers.
+type X__uid_t = uint32 /* types.h:144:25 */ // Type of user identifications.
+type X__gid_t = uint32 /* types.h:145:25 */ // Type of group identifications.
+type X__ino_t = uint64 /* types.h:146:25 */ // Type of file serial numbers.
+type X__ino64_t = uint64 /* types.h:147:27 */ // Type of file serial numbers (LFS).
+type X__mode_t = uint32 /* types.h:148:26 */ // Type of file attribute bitmasks.
+type X__nlink_t = uint64 /* types.h:149:27 */ // Type of file link counts.
+type X__off_t = int64 /* types.h:150:25 */ // Type of file sizes and offsets.
+type X__off64_t = int64 /* types.h:151:27 */ // Type of file sizes and offsets (LFS).
+type X__pid_t = int32 /* types.h:152:25 */ // Type of process identifications.
+type X__fsid_t = struct{ F__val [2]int32 } /* types.h:153:26 */ // Type of file system IDs.
+type X__clock_t = int64 /* types.h:154:27 */ // Type of CPU usage counts.
+type X__rlim_t = uint64 /* types.h:155:26 */ // Type for resource measurement.
+type X__rlim64_t = uint64 /* types.h:156:28 */ // Type for resource measurement (LFS).
+type X__id_t = uint32 /* types.h:157:24 */ // General type for IDs.
+type X__time_t = int64 /* types.h:158:26 */ // Seconds since the Epoch.
+type X__useconds_t = uint32 /* types.h:159:30 */ // Count of microseconds.
+type X__suseconds_t = int64 /* types.h:160:31 */ // Signed count of microseconds.
+
+type X__daddr_t = int32 /* types.h:162:27 */ // The type of a disk address.
+type X__key_t = int32 /* types.h:163:25 */ // Type of an IPC key.
+
+// Clock ID used in clock and timer functions.
+type X__clockid_t = int32 /* types.h:166:29 */
+
+// Timer ID returned by `timer_create'.
+type X__timer_t = uintptr /* types.h:169:12 */
+
+// Type to represent block size.
+type X__blksize_t = int64 /* types.h:172:29 */
+
+// Types from the Large File Support interface.
+
+// Type to count number of disk blocks.
+type X__blkcnt_t = int64 /* types.h:177:28 */
+type X__blkcnt64_t = int64 /* types.h:178:30 */
+
+// Type to count file system blocks.
+type X__fsblkcnt_t = uint64 /* types.h:181:30 */
+type X__fsblkcnt64_t = uint64 /* types.h:182:32 */
+
+// Type to count file system nodes.
+type X__fsfilcnt_t = uint64 /* types.h:185:30 */
+type X__fsfilcnt64_t = uint64 /* types.h:186:32 */
+
+// Type of miscellaneous file system fields.
+type X__fsword_t = int64 /* types.h:189:28 */
+
+type X__ssize_t = int64 /* types.h:191:27 */ // Type of a byte count, or error.
+
+// Signed long type used in system calls.
+type X__syscall_slong_t = int64 /* types.h:194:33 */
+// Unsigned long type used in system calls.
+type X__syscall_ulong_t = uint64 /* types.h:196:33 */
+
+// These few don't really vary by system, they always correspond
+// to one of the other defined types.
+type X__loff_t = X__off64_t /* types.h:200:19 */ // Type of file sizes and offsets (LFS).
+type X__caddr_t = uintptr /* types.h:201:14 */
+
+// Duplicates info from stdint.h but this is used in unistd.h.
+type X__intptr_t = int64 /* types.h:204:25 */
+
+// Duplicate info from sys/socket.h.
+type X__socklen_t = uint32 /* types.h:207:23 */
+
+// C99: An integer type that can be accessed as an atomic entity,
+// even in the presence of asynchronous interrupts.
+// It is not currently necessary for this to be machine-specific.
+type X__sig_atomic_t = int32 /* types.h:212:13 */
+
+// bits/types.h -- definitions of __*_t types underlying *_t types.
+// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Never include this file directly; use <sys/types.h> instead.
+
+// Integral type unchanged by default argument promotions that can
+// hold any value corresponding to members of the extended character
+// set, as well as at least one value that does not correspond to any
+// member of the extended character set.
+
+// Conversion state information.
+type X__mbstate_t = struct {
+ F__count int32
+ F__value struct{ F__wch uint32 }
+} /* __mbstate_t.h:21:3 */
+
// The tag name of this struct is _G_fpos_t to preserve historic
// C++ mangled names for functions taking fpos_t arguments.
// That name should not be used in new code.
type _G_fpos_t = struct {
- F__pos int64
- F__state struct {
- F__count int32
- F__value struct{ F__wch uint32 }
- }
+ F__pos X__off_t
+ F__state X__mbstate_t
}
+// The tag name of this struct is _G_fpos_t to preserve historic
+// C++ mangled names for functions taking fpos_t arguments.
+// That name should not be used in new code.
+type X__fpos_t = _G_fpos_t /* __fpos_t.h:14:3 */
+
// bits/types.h -- definitions of __*_t types underlying *_t types.
// Copyright (C) 2002-2018 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
@@ -5886,13 +6629,35 @@ type _G_fpos_t = struct {
// C++ mangled names for functions taking fpos_t and/or fpos64_t
// arguments. That name should not be used in new code.
type _G_fpos64_t = struct {
- F__pos int64
- F__state struct {
- F__count int32
- F__value struct{ F__wch uint32 }
- }
+ F__pos X__off64_t
+ F__state X__mbstate_t
}
+// bits/types.h -- definitions of __*_t types underlying *_t types.
+// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Never include this file directly; use <sys/types.h> instead.
+
+// The tag name of this struct is _G_fpos64_t to preserve historic
+// C++ mangled names for functions taking fpos_t and/or fpos64_t
+// arguments. That name should not be used in new code.
+type X__fpos64_t = _G_fpos64_t /* __fpos64_t.h:14:3 */
+
type _IO_FILE = struct {
F_flags int32
F_IO_read_ptr uintptr
@@ -5910,12 +6675,12 @@ type _IO_FILE = struct {
F_chain uintptr
F_fileno int32
F_flags2 int32
- F_old_offset int64
+ F_old_offset X__off_t
F_cur_column uint16
F_vtable_offset int8
F_shortbuf [1]int8
F_lock uintptr
- F_offset int64
+ F_offset X__off64_t
F_codecvt uintptr
F_wide_data uintptr
F_freeres_list uintptr
@@ -5925,6 +6690,8 @@ type _IO_FILE = struct {
F_unused2 [20]int8
}
+type X__FILE = _IO_FILE /* __FILE.h:5:25 */
+
// The opaque type of streams. This is the definition used elsewhere.
type FILE = _IO_FILE /* FILE.h:7:25 */
@@ -5957,12 +6724,12 @@ type FILE = _IO_FILE /* FILE.h:7:25 */
// ISO C Standard: 7.15 Variable arguments <stdarg.h>
-type Off_t = int64 /* stdio.h:65:19 */
-type Off64_t = int64 /* stdio.h:70:19 */
+type Off_t = X__off64_t /* stdio.h:65:19 */
+type Off64_t = X__off64_t /* stdio.h:70:19 */
// The type of the second argument to `fgetpos' and `fsetpos'.
-type Fpos_t = _G_fpos64_t /* stdio.h:86:20 */
-type Fpos64_t = _G_fpos64_t /* stdio.h:89:20 */
+type Fpos_t = X__fpos64_t /* stdio.h:86:20 */
+type Fpos64_t = X__fpos64_t /* stdio.h:89:20 */
// In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
// are already defined.
@@ -6075,26 +6842,26 @@ type Lldiv_t = struct {
// Never include this file directly; use <sys/types.h> instead.
-type Ino_t = uint64 /* types.h:49:19 */
-type Ino64_t = uint64 /* types.h:54:19 */
+type Ino_t = X__ino64_t /* types.h:49:19 */
+type Ino64_t = X__ino64_t /* types.h:54:19 */
-type Dev_t = uint64 /* types.h:59:17 */
+type Dev_t = X__dev_t /* types.h:59:17 */
-type Gid_t = uint32 /* types.h:64:17 */
+type Gid_t = X__gid_t /* types.h:64:17 */
-type Mode_t = uint32 /* types.h:69:18 */
+type Mode_t = X__mode_t /* types.h:69:18 */
-type Nlink_t = uint64 /* types.h:74:19 */
+type Nlink_t = X__nlink_t /* types.h:74:19 */
-type Uid_t = uint32 /* types.h:79:17 */
+type Uid_t = X__uid_t /* types.h:79:17 */
-type Pid_t = int32 /* types.h:97:17 */
+type Pid_t = X__pid_t /* types.h:97:17 */
-type Id_t = uint32 /* types.h:103:16 */
+type Id_t = X__id_t /* types.h:103:16 */
-type Ssize_t = int64 /* types.h:108:19 */
+type Ssize_t = X__ssize_t /* types.h:108:19 */
-type Key_t = int32 /* types.h:121:17 */
+type Key_t = X__key_t /* types.h:121:17 */
// bits/types.h -- definitions of __*_t types underlying *_t types.
// Copyright (C) 2002-2018 Free Software Foundation, Inc.
@@ -6117,7 +6884,7 @@ type Key_t = int32 /* types.h:121:17 */
// Never include this file directly; use <sys/types.h> instead.
// Returned by `clock'.
-type Clock_t = int64 /* clock_t.h:7:19 */
+type Clock_t = X__clock_t /* clock_t.h:7:19 */
// bits/types.h -- definitions of __*_t types underlying *_t types.
// Copyright (C) 2002-2018 Free Software Foundation, Inc.
@@ -6140,7 +6907,7 @@ type Clock_t = int64 /* clock_t.h:7:19 */
// Never include this file directly; use <sys/types.h> instead.
// Clock ID used in clock and timer functions.
-type Clockid_t = int32 /* clockid_t.h:7:21 */
+type Clockid_t = X__clockid_t /* clockid_t.h:7:21 */
// bits/types.h -- definitions of __*_t types underlying *_t types.
// Copyright (C) 2002-2018 Free Software Foundation, Inc.
@@ -6163,7 +6930,7 @@ type Clockid_t = int32 /* clockid_t.h:7:21 */
// Never include this file directly; use <sys/types.h> instead.
// Returned by `time'.
-type Time_t = int64 /* time_t.h:7:18 */
+type Time_t = X__time_t /* time_t.h:7:18 */
// bits/types.h -- definitions of __*_t types underlying *_t types.
// Copyright (C) 2002-2018 Free Software Foundation, Inc.
@@ -6186,10 +6953,10 @@ type Time_t = int64 /* time_t.h:7:18 */
// Never include this file directly; use <sys/types.h> instead.
// Timer ID returned by `timer_create'.
-type Timer_t = uintptr /* timer_t.h:7:19 */
+type Timer_t = X__timer_t /* timer_t.h:7:19 */
-type Useconds_t = uint32 /* types.h:134:22 */
-type Suseconds_t = int64 /* types.h:138:23 */
+type Useconds_t = X__useconds_t /* types.h:134:22 */
+type Suseconds_t = X__suseconds_t /* types.h:138:23 */
// Copyright (C) 1989-2018 Free Software Foundation, Inc.
//
@@ -6313,10 +7080,10 @@ type Suseconds_t = int64 /* types.h:138:23 */
// Never include this file directly; use <sys/types.h> instead.
-type Int8_t = int8 /* stdint-intn.h:24:18 */
-type Int16_t = int16 /* stdint-intn.h:25:19 */
-type Int32_t = int32 /* stdint-intn.h:26:19 */
-type Int64_t = int64 /* stdint-intn.h:27:19 */
+type Int8_t = X__int8_t /* stdint-intn.h:24:18 */
+type Int16_t = X__int16_t /* stdint-intn.h:25:19 */
+type Int32_t = X__int32_t /* stdint-intn.h:26:19 */
+type Int64_t = X__int64_t /* stdint-intn.h:27:19 */
// These were defined by ISO C without the first `_'.
type U_int8_t = uint8 /* types.h:160:23 */
@@ -6326,16 +7093,16 @@ type U_int64_t = uint64 /* types.h:164:27 */
type Register_t = int32 /* types.h:169:13 */
-type Blksize_t = int64 /* types.h:202:21 */
+type Blksize_t = X__blksize_t /* types.h:202:21 */
// Types from the Large File Support interface.
-type Blkcnt_t = int64 /* types.h:222:22 */ // Type to count number of disk blocks.
-type Fsblkcnt_t = uint64 /* types.h:226:24 */ // Type to count file system blocks.
-type Fsfilcnt_t = uint64 /* types.h:230:24 */ // Type to count file system inodes.
+type Blkcnt_t = X__blkcnt64_t /* types.h:222:22 */ // Type to count number of disk blocks.
+type Fsblkcnt_t = X__fsblkcnt64_t /* types.h:226:24 */ // Type to count file system blocks.
+type Fsfilcnt_t = X__fsfilcnt64_t /* types.h:230:24 */ // Type to count file system inodes.
-type Blkcnt64_t = int64 /* types.h:236:22 */ // Type to count number of disk blocks.
-type Fsblkcnt64_t = uint64 /* types.h:237:24 */ // Type to count file system blocks.
-type Fsfilcnt64_t = uint64 /* types.h:238:24 */ // Type to count file system inodes.
+type Blkcnt64_t = X__blkcnt64_t /* types.h:236:22 */ // Type to count number of disk blocks.
+type Fsblkcnt64_t = X__fsblkcnt64_t /* types.h:237:24 */ // Type to count file system blocks.
+type Fsfilcnt64_t = X__fsfilcnt64_t /* types.h:238:24 */ // Type to count file system inodes.
// Now add the thread types.
// Declaration of common pthread types for all architectures.
@@ -6476,6 +7243,10 @@ type __pthread_internal_list = struct {
F__next uintptr
}
+// Common definition of pthread_mutex_t.
+
+type X__pthread_list_t = __pthread_internal_list /* thread-shared-types.h:86:3 */
+
// Lock elision support.
type __pthread_mutex_s = struct {
@@ -6486,10 +7257,7 @@ type __pthread_mutex_s = struct {
F__kind int32
F__spins int16
F__elision int16
- F__list struct {
- F__prev uintptr
- F__next uintptr
- }
+ F__list X__pthread_list_t
}
// Common definition of pthread_cond_t.
@@ -6563,6 +7331,9 @@ type Pthread_barrierattr_t = struct {
F__size [4]int8
} /* pthreadtypes.h:118:3 */
+// Shorthand for type of comparison functions.
+type X__compar_fn_t = uintptr /* stdlib.h:805:13 */
+
// If this symbol has done its job, get rid of it.
// Unsigned type of `sizeof' something.
@@ -6652,13 +7423,13 @@ type Max_align_t = struct {
// types can be conveniently redefined at compile-type. Like this:
//
// cc '-DUINTPTR_TYPE=long long int' ...
-type I64 = Sqlite_int64 /* sqlite3.c:14314:22 */ // 8-byte signed integer
-type U64 = Sqlite_uint64 /* sqlite3.c:14315:23 */ // 8-byte unsigned integer
-type U32 = uint32 /* sqlite3.c:14316:21 */ // 4-byte unsigned integer
-type U16 = uint16 /* sqlite3.c:14317:21 */ // 2-byte unsigned integer
-type I16 = int16 /* sqlite3.c:14318:20 */ // 2-byte signed integer
-type U8 = uint8 /* sqlite3.c:14319:20 */ // 1-byte unsigned integer
-type I8 = int8 /* sqlite3.c:14320:19 */ // 1-byte signed integer
+type I64 = Sqlite_int64 /* sqlite3.c:14329:22 */ // 8-byte signed integer
+type U64 = Sqlite_uint64 /* sqlite3.c:14330:23 */ // 8-byte unsigned integer
+type U32 = uint32 /* sqlite3.c:14331:21 */ // 4-byte unsigned integer
+type U16 = uint16 /* sqlite3.c:14332:21 */ // 2-byte unsigned integer
+type I16 = int16 /* sqlite3.c:14333:20 */ // 2-byte signed integer
+type U8 = uint8 /* sqlite3.c:14334:20 */ // 1-byte unsigned integer
+type I8 = int8 /* sqlite3.c:14335:19 */ // 1-byte signed integer
// SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value
// that can be stored in a u32 without loss of data. The value
@@ -6669,7 +7440,7 @@ type I8 = int8 /* sqlite3.c:14320:19 */ // 1-byte signed integer
// table or index. This is an unsigned integer type. For 99.9% of
// the world, a 32-bit integer is sufficient. But a 64-bit integer
// can be used at compile-time if desired.
-type TRowcnt = U32 /* sqlite3.c:14339:14 */ // 32-bit is the default
+type TRowcnt = U32 /* sqlite3.c:14354:14 */ // 32-bit is the default
// Estimated quantities used for query planning are stored as 16-bit
// logarithms. For quantity X, the value stored is 10*log2(X). This
@@ -6692,12 +7463,12 @@ type TRowcnt = U32 /* sqlite3.c:14339:14 */ // 32-bit is the default
// Examples:
//
// 0.5 -> -10 0.1 -> -33 0.0625 -> -40
-type LogEst = int16 /* sqlite3.c:14365:20 */
+type LogEst = int16 /* sqlite3.c:14380:20 */
// Set the SQLITE_PTRSIZE macro to the number of bytes in a pointer
// The uptr type is an unsigned integer large enough to hold a pointer
-type Uptr = U64 /* sqlite3.c:14389:15 */
+type Uptr = U64 /* sqlite3.c:14404:15 */
// The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to
// something between S (inclusive) and E (exclusive).
@@ -6806,15 +7577,13 @@ type BusyHandler1 = struct {
// callback for the database handle. Each pager opened via the sqlite
// handle is passed a pointer to sqlite.busyHandler. The busy-handler
// callback is currently invoked only from within pager.c.
-type BusyHandler = BusyHandler1 /* sqlite3.c:14537:28 */
+type BusyHandler = BusyHandler1 /* sqlite3.c:14563:28 */
-// Name of the master database table. The master database table
-// is a special table that holds the names and attributes of all
-// user tables and indices.
+// Name of table that holds the database schema.
-// The root-page of the master database table.
+// The root-page of the schema table.
-// The name of the schema table.
+// The name of the schema table. The name is different for TEMP.
// A convenience macro that returns the number of elements in
// an array.
@@ -6871,16 +7640,15 @@ type AggInfo1 = struct {
FnAccumulator int32
FaFunc uintptr
FnFunc int32
+ FselId U32
FpNext uintptr
}
-// Name of the master database table. The master database table
-// is a special table that holds the names and attributes of all
-// user tables and indices.
+// Name of table that holds the database schema.
-// The root-page of the master database table.
+// The root-page of the schema table.
-// The name of the schema table.
+// The name of the schema table. The name is different for TEMP.
// A convenience macro that returns the number of elements in
// an array.
@@ -6923,13 +7691,13 @@ type AggInfo1 = struct {
// cases the parameters are named as per the usual conventions.
// Forward references to structures
-type AggInfo = AggInfo1 /* sqlite3.c:14631:24 */
+type AggInfo = AggInfo1 /* sqlite3.c:14659:24 */
type AuthContext1 = struct {
FzAuthContext uintptr
FpParse uintptr
}
-type AuthContext = AuthContext1 /* sqlite3.c:14632:28 */
+type AuthContext = AuthContext1 /* sqlite3.c:14660:28 */
type AutoincInfo1 = struct {
FpNext uintptr
FpTab uintptr
@@ -6937,7 +7705,7 @@ type AutoincInfo1 = struct {
FregCtr int32
}
-type AutoincInfo = AutoincInfo1 /* sqlite3.c:14633:28 */
+type AutoincInfo = AutoincInfo1 /* sqlite3.c:14661:28 */
type Bitvec1 = struct {
FiSize U32
FnSet U32
@@ -6948,7 +7716,7 @@ type Bitvec1 = struct {
}
}
-type Bitvec = Bitvec1 /* sqlite3.c:14634:23 */
+type Bitvec = Bitvec1 /* sqlite3.c:14662:23 */
type CollSeq1 = struct {
FzName uintptr
Fenc U8
@@ -6957,7 +7725,7 @@ type CollSeq1 = struct {
FxDel uintptr
}
-type CollSeq = CollSeq1 /* sqlite3.c:14635:24 */
+type CollSeq = CollSeq1 /* sqlite3.c:14663:24 */
type Column1 = struct {
FzName uintptr
FpDflt uintptr
@@ -6970,7 +7738,7 @@ type Column1 = struct {
_ [2]byte
}
-type Column = Column1 /* sqlite3.c:14636:23 */
+type Column = Column1 /* sqlite3.c:14664:23 */
type Db1 = struct {
FzDbSName uintptr
FpBt uintptr
@@ -6979,7 +7747,7 @@ type Db1 = struct {
FpSchema uintptr
}
-type Db = Db1 /* sqlite3.c:14637:19 */
+type Db = Db1 /* sqlite3.c:14665:19 */
type Schema1 = struct {
Fschema_cookie int32
FiGeneration int32
@@ -6994,7 +7762,7 @@ type Schema1 = struct {
Fcache_size int32
}
-type Schema = Schema1 /* sqlite3.c:14638:23 */
+type Schema = Schema1 /* sqlite3.c:14666:23 */
type Expr1 = struct {
Fop U8
FaffExpr int8
@@ -7004,6 +7772,7 @@ type Expr1 = struct {
FpLeft uintptr
FpRight uintptr
Fx struct{ FpList uintptr }
+ FnHeight int32
FiTable int32
FiColumn YnVar
FiAgg I16
@@ -7012,7 +7781,7 @@ type Expr1 = struct {
Fy struct{ FpTab uintptr }
}
-type Expr = Expr1 /* sqlite3.c:14639:21 */
+type Expr = Expr1 /* sqlite3.c:14667:21 */
type ExprList1 = struct {
FnExpr int32
Fa [1]struct {
@@ -7032,7 +7801,7 @@ type ExprList1 = struct {
}
}
-type ExprList = ExprList1 /* sqlite3.c:14640:25 */
+type ExprList = ExprList1 /* sqlite3.c:14668:25 */
type FKey1 = struct {
FpFrom uintptr
FpNextFrom uintptr
@@ -7049,14 +7818,14 @@ type FKey1 = struct {
}
}
-type FKey = FKey1 /* sqlite3.c:14641:21 */
+type FKey = FKey1 /* sqlite3.c:14669:21 */
type FuncDestructor1 = struct {
FnRef int32
FxDestroy uintptr
FpUserData uintptr
}
-type FuncDestructor = FuncDestructor1 /* sqlite3.c:14642:31 */
+type FuncDestructor = FuncDestructor1 /* sqlite3.c:14670:31 */
type FuncDef1 = struct {
FnArg I8
FfuncFlags U32
@@ -7070,17 +7839,17 @@ type FuncDef1 = struct {
Fu struct{ FpHash uintptr }
}
-type FuncDef = FuncDef1 /* sqlite3.c:14643:24 */
+type FuncDef = FuncDef1 /* sqlite3.c:14671:24 */
type FuncDefHash1 = struct{ Fa [23]uintptr }
-type FuncDefHash = FuncDefHash1 /* sqlite3.c:14644:28 */
+type FuncDefHash = FuncDefHash1 /* sqlite3.c:14672:28 */
type IdList1 = struct {
Fa uintptr
FnId int32
_ [4]byte
}
-type IdList = IdList1 /* sqlite3.c:14645:23 */
+type IdList = IdList1 /* sqlite3.c:14673:23 */
type Index1 = struct {
FzName uintptr
FaiColumn uintptr
@@ -7093,16 +7862,22 @@ type Index1 = struct {
FazColl uintptr
FpPartIdxWhere uintptr
FaColExpr uintptr
- Ftnum int32
+ Ftnum Pgno
FszIdxRow LogEst
FnKeyCol U16
FnColumn U16
FonError U8
FidxType uint16 /* unsigned idxType: 2, unsigned bUnordered: 1, unsigned uniqNotNull: 1, unsigned isResized: 1, unsigned isCovering: 1, unsigned noSkipScan: 1, unsigned hasStat1: 1, unsigned bNoQuery: 1, unsigned bAscKeyBug: 1, unsigned bHasVCol: 1 */
+ FnSample int32
+ FnSampleCol int32
+ FaAvgEq uintptr
+ FaSample uintptr
+ FaiRowEst uintptr
+ FnRowEst0 TRowcnt
FcolNotIdxed Bitmask
}
-type Index = Index1 /* sqlite3.c:14646:22 */
+type Index = Index1 /* sqlite3.c:14674:22 */
type IndexSample1 = struct {
Fp uintptr
Fn int32
@@ -7111,7 +7886,7 @@ type IndexSample1 = struct {
FanDLt uintptr
}
-type IndexSample = IndexSample1 /* sqlite3.c:14647:28 */
+type IndexSample = IndexSample1 /* sqlite3.c:14675:28 */
type KeyInfo1 = struct {
FnRef U32
Fenc U8
@@ -7122,7 +7897,7 @@ type KeyInfo1 = struct {
FaColl [1]uintptr
}
-type KeyInfo = KeyInfo1 /* sqlite3.c:14649:24 */
+type KeyInfo = KeyInfo1 /* sqlite3.c:14677:24 */
type Lookaside1 = struct {
FbDisable U32
Fsz U16
@@ -7139,10 +7914,10 @@ type Lookaside1 = struct {
FpEnd uintptr
}
-type Lookaside = Lookaside1 /* sqlite3.c:14650:26 */
+type Lookaside = Lookaside1 /* sqlite3.c:14678:26 */
type LookasideSlot1 = struct{ FpNext uintptr }
-type LookasideSlot = LookasideSlot1 /* sqlite3.c:14651:30 */
+type LookasideSlot = LookasideSlot1 /* sqlite3.c:14679:30 */
type Module1 = struct {
FpModule uintptr
FzName uintptr
@@ -7152,7 +7927,7 @@ type Module1 = struct {
FpEpoTab uintptr
}
-type Module = Module1 /* sqlite3.c:14652:23 */
+type Module = Module1 /* sqlite3.c:14680:23 */
type NameContext1 = struct {
FpParse uintptr
FpSrcList uintptr
@@ -7164,7 +7939,7 @@ type NameContext1 = struct {
FpWinSelect uintptr
}
-type NameContext = NameContext1 /* sqlite3.c:14653:28 */
+type NameContext = NameContext1 /* sqlite3.c:14681:28 */
type Parse1 = struct {
Fdb uintptr
FzErrMsg uintptr
@@ -7238,7 +8013,7 @@ type Parse1 = struct {
FpRename uintptr
}
-type Parse = Parse1 /* sqlite3.c:14654:22 */
+type Parse = Parse1 /* sqlite3.c:14682:22 */
type PreUpdate1 = struct {
Fv uintptr
FpCsr uintptr
@@ -7255,21 +8030,21 @@ type PreUpdate1 = struct {
FpPk uintptr
}
-type PreUpdate = PreUpdate1 /* sqlite3.c:14655:26 */
+type PreUpdate = PreUpdate1 /* sqlite3.c:14683:26 */
type PrintfArguments1 = struct {
FnArg int32
FnUsed int32
FapArg uintptr
}
-type PrintfArguments = PrintfArguments1 /* sqlite3.c:14656:32 */
+type PrintfArguments = PrintfArguments1 /* sqlite3.c:14684:32 */
type RenameToken1 = struct {
Fp uintptr
Ft Token
FpNext uintptr
}
-type RenameToken = RenameToken1 /* sqlite3.c:14657:28 */
+type RenameToken = RenameToken1 /* sqlite3.c:14685:28 */
type RowSet1 = struct {
FpChunk uintptr
Fdb uintptr
@@ -7282,7 +8057,7 @@ type RowSet1 = struct {
FiBatch int32
}
-type RowSet = RowSet1 /* sqlite3.c:14658:23 */
+type RowSet = RowSet1 /* sqlite3.c:14686:23 */
type Savepoint1 = struct {
FzName uintptr
FnDeferredCons I64
@@ -7290,7 +8065,7 @@ type Savepoint1 = struct {
FpNext uintptr
}
-type Savepoint = Savepoint1 /* sqlite3.c:14659:26 */
+type Savepoint = Savepoint1 /* sqlite3.c:14687:26 */
type Select1 = struct {
Fop U8
FnSelectRow LogEst
@@ -7313,24 +8088,25 @@ type Select1 = struct {
FpWinDefn uintptr
}
-type Select = Select1 /* sqlite3.c:14660:23 */
+type Select = Select1 /* sqlite3.c:14688:23 */
type SQLiteThread1 = struct {
FxTask uintptr
FpIn uintptr
FpResult uintptr
}
-type SQLiteThread = SQLiteThread1 /* sqlite3.c:14661:29 */
+type SQLiteThread = SQLiteThread1 /* sqlite3.c:14689:29 */
type SelectDest1 = struct {
FeDest U8
FiSDParm int32
+ FiSDParm2 int32
FiSdst int32
FnSdst int32
FzAffSdst uintptr
FpOrderBy uintptr
}
-type SelectDest = SelectDest1 /* sqlite3.c:14662:27 */
+type SelectDest = SelectDest1 /* sqlite3.c:14690:27 */
type SrcList1 = struct {
FnSrc int32
FnAlloc U32
@@ -7360,8 +8136,8 @@ type SrcList1 = struct {
}
}
-type SrcList = SrcList1 /* sqlite3.c:14663:24 */
-type StrAccum = sqlite3_str /* sqlite3.c:14664:28 */ // Internal alias for sqlite3_str
+type SrcList = SrcList1 /* sqlite3.c:14691:24 */
+type StrAccum = sqlite3_str /* sqlite3.c:14692:28 */ // Internal alias for sqlite3_str
type Table1 = struct {
FzName uintptr
FaCol uintptr
@@ -7370,7 +8146,7 @@ type Table1 = struct {
FpFKey uintptr
FzColAff uintptr
FpCheck uintptr
- Ftnum int32
+ Ftnum Pgno
FnTabRef U32
FtabFlags U32
FiPKey I16
@@ -7389,22 +8165,22 @@ type Table1 = struct {
}
// Internal alias for sqlite3_str
-type Table = Table1 /* sqlite3.c:14665:22 */
+type Table = Table1 /* sqlite3.c:14693:22 */
type TableLock1 = struct {
FiDb int32
- FiTab int32
+ FiTab Pgno
FisWriteLock U8
FzLockName uintptr
}
-type TableLock = TableLock1 /* sqlite3.c:14666:26 */
+type TableLock = TableLock1 /* sqlite3.c:14694:26 */
type Token1 = struct {
Fz uintptr
Fn uint32
_ [4]byte
}
-type Token = Token1 /* sqlite3.c:14667:22 */
+type Token = Token1 /* sqlite3.c:14695:22 */
type Trigger1 = struct {
FzName uintptr
Ftable uintptr
@@ -7418,7 +8194,7 @@ type Trigger1 = struct {
FpNext uintptr
}
-type Trigger = Trigger1 /* sqlite3.c:14669:24 */
+type Trigger = Trigger1 /* sqlite3.c:14697:24 */
type TriggerPrg1 = struct {
FpTrigger uintptr
FpNext uintptr
@@ -7428,13 +8204,14 @@ type TriggerPrg1 = struct {
_ [4]byte
}
-type TriggerPrg = TriggerPrg1 /* sqlite3.c:14670:27 */
+type TriggerPrg = TriggerPrg1 /* sqlite3.c:14698:27 */
type TriggerStep1 = struct {
Fop U8
Forconf U8
FpTrig uintptr
FpSelect uintptr
FzTarget uintptr
+ FpFrom uintptr
FpWhere uintptr
FpExprList uintptr
FpIdList uintptr
@@ -7444,7 +8221,7 @@ type TriggerStep1 = struct {
FpLast uintptr
}
-type TriggerStep = TriggerStep1 /* sqlite3.c:14671:28 */
+type TriggerStep = TriggerStep1 /* sqlite3.c:14699:28 */
type UnpackedRecord1 = struct {
FpKeyInfo uintptr
FaMem uintptr
@@ -7457,7 +8234,7 @@ type UnpackedRecord1 = struct {
_ [1]byte
}
-type UnpackedRecord = UnpackedRecord1 /* sqlite3.c:14672:31 */
+type UnpackedRecord = UnpackedRecord1 /* sqlite3.c:14700:31 */
type Upsert1 = struct {
FpUpsertTarget uintptr
FpUpsertTargetWhere uintptr
@@ -7471,7 +8248,7 @@ type Upsert1 = struct {
_ [4]byte
}
-type Upsert = Upsert1 /* sqlite3.c:14673:23 */
+type Upsert = Upsert1 /* sqlite3.c:14701:23 */
type VTable1 = struct {
Fdb uintptr
FpMod uintptr
@@ -7483,7 +8260,7 @@ type VTable1 = struct {
FpNext uintptr
}
-type VTable = VTable1 /* sqlite3.c:14674:23 */
+type VTable = VTable1 /* sqlite3.c:14702:23 */
type VtabCtx1 = struct {
FpVTable uintptr
FpTab uintptr
@@ -7492,7 +8269,7 @@ type VtabCtx1 = struct {
_ [4]byte
}
-type VtabCtx = VtabCtx1 /* sqlite3.c:14675:24 */
+type VtabCtx = VtabCtx1 /* sqlite3.c:14703:24 */
type Walker1 = struct {
FpParse uintptr
FxExprCallback uintptr
@@ -7503,7 +8280,7 @@ type Walker1 = struct {
Fu struct{ FpNC uintptr }
}
-type Walker = Walker1 /* sqlite3.c:14676:23 */
+type Walker = Walker1 /* sqlite3.c:14704:23 */
type WhereInfo1 = struct {
FpParse uintptr
FpTabList uintptr
@@ -7531,7 +8308,7 @@ type WhereInfo1 = struct {
Fa [1]WhereLevel
}
-type WhereInfo = WhereInfo1 /* sqlite3.c:14677:26 */
+type WhereInfo = WhereInfo1 /* sqlite3.c:14705:26 */
type Window1 = struct {
FzName uintptr
FzBase uintptr
@@ -7564,7 +8341,7 @@ type Window1 = struct {
_ [3]byte
}
-type Window = Window1 /* sqlite3.c:14678:23 */
+type Window = Window1 /* sqlite3.c:14706:23 */
type With1 = struct {
FnCte int32
FpOuter uintptr
@@ -7576,14 +8353,14 @@ type With1 = struct {
}
}
-type With = With1 /* sqlite3.c:14679:21 */
+type With = With1 /* sqlite3.c:14707:21 */
// The bitmask datatype defined below is used for various optimizations.
//
// Changing this from a 64-bit to a 32-bit type limits the number of
// tables in a join to 32 instead of 64. But it also reduces the size
// of the library by 738 bytes on ix86.
-type Bitmask = U64 /* sqlite3.c:14692:15 */
+type Bitmask = U64 /* sqlite3.c:14720:15 */
// The number of bits in a Bitmask. "BMS" means "BitMask Size".
@@ -7594,11 +8371,124 @@ type Bitmask = U64 /* sqlite3.c:14692:15 */
// variable number associated with that parameter. See the format description
// on the sqlite3VListAdd() routine for more information. A VList is really
// just an array of integers.
-type VList = int32 /* sqlite3.c:14714:13 */
+type VList = int32 /* sqlite3.c:14742:13 */
// Defer sourcing vdbe.h and btree.h until after the "u8" and
// "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
// pointer types (i.e. FuncDef) defined above.
+//************* Include pager.h in the middle of sqliteInt.h ****************
+//************* Begin file pager.h ******************************************
+// 2001 September 15
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+// This header file defines the interface that the sqlite page cache
+// subsystem. The page cache subsystem reads and writes a file a page
+// at a time and provides a journal for rollback.
+
+// Default maximum size for persistent journal files. A negative
+// value means no limit. This value may be overridden using the
+// sqlite3PagerJournalSizeLimit() API. See also "PRAGMA journal_size_limit".
+
+// The type used to represent a page number. The first page in a file
+// is called page 1. 0 is used to represent "not a page".
+type Pgno = U32 /* sqlite3.c:14783:13 */
+
+// Each open file is managed by a separate instance of the "Pager" structure.
+type Pager1 = struct {
+ FpVfs uintptr
+ FexclusiveMode U8
+ FjournalMode U8
+ FuseJournal U8
+ FnoSync U8
+ FfullSync U8
+ FextraSync U8
+ FsyncFlags U8
+ FwalSyncFlags U8
+ FtempFile U8
+ FnoLock U8
+ FreadOnly U8
+ FmemDb U8
+ FeState U8
+ FeLock U8
+ FchangeCountDone U8
+ FsetSuper U8
+ FdoNotSpill U8
+ FsubjInMemory U8
+ FbUseFetch U8
+ FhasHeldSharedLock U8
+ FdbSize Pgno
+ FdbOrigSize Pgno
+ FdbFileSize Pgno
+ FdbHintSize Pgno
+ FerrCode int32
+ FnRec int32
+ FcksumInit U32
+ FnSubRec U32
+ FpInJournal uintptr
+ Ffd uintptr
+ Fjfd uintptr
+ Fsjfd uintptr
+ FjournalOff I64
+ FjournalHdr I64
+ FpBackup uintptr
+ FaSavepoint uintptr
+ FnSavepoint int32
+ FiDataVersion U32
+ FdbFileVers [16]int8
+ FnMmapOut int32
+ FszMmap Sqlite3_int64
+ FpMmapFreelist uintptr
+ FnExtra U16
+ FnReserve I16
+ FvfsFlags U32
+ FsectorSize U32
+ FpageSize int32
+ FmxPgno Pgno
+ FjournalSizeLimit I64
+ FzFilename uintptr
+ FzJournal uintptr
+ FxBusyHandler uintptr
+ FpBusyHandlerArg uintptr
+ FaStat [4]int32
+ FnRead int32
+ FxReiniter uintptr
+ FxGet uintptr
+ FpTmpSpace uintptr
+ FpPCache uintptr
+ FpWal uintptr
+ FzWal uintptr
+}
+
+// Each open file is managed by a separate instance of the "Pager" structure.
+type Pager = Pager1 /* sqlite3.c:14788:22 */
+
+// Handle type for pages.
+type PgHdr2 = struct {
+ FpPage uintptr
+ FpData uintptr
+ FpExtra uintptr
+ FpCache uintptr
+ FpDirty uintptr
+ FpPager uintptr
+ Fpgno Pgno
+ Fflags U16
+ FnRef I16
+ FpDirtyNext uintptr
+ FpDirtyPrev uintptr
+}
+
+// Handle type for pages.
+type DbPage = PgHdr2 /* sqlite3.c:14793:22 */
+
+//************* End of pager.h **********************************************
+//************* Continuing where we left off in sqliteInt.h *****************
//************* Include btree.h in the middle of sqliteInt.h ****************
//************* Begin file btree.h ******************************************
// 2001 September 15
@@ -7637,9 +8527,8 @@ type Btree1 = struct {
Flock BtLock
}
-// Defer sourcing vdbe.h and btree.h until after the "u8" and
-// "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
-// pointer types (i.e. FuncDef) defined above.
+//************* End of pager.h **********************************************
+//************* Continuing where we left off in sqliteInt.h *****************
//************* Include btree.h in the middle of sqliteInt.h ****************
//************* Begin file btree.h ******************************************
// 2001 September 15
@@ -7663,7 +8552,7 @@ type Btree1 = struct {
// it must be turned on for each database using "PRAGMA auto_vacuum = 1".
// Forward declarations of structure
-type Btree = Btree1 /* sqlite3.c:14761:22 */
+type Btree = Btree1 /* sqlite3.c:15036:22 */
type BtCursor1 = struct {
FeState U8
FcurFlags U8
@@ -7687,7 +8576,7 @@ type BtCursor1 = struct {
FapPage [19]uintptr
}
-type BtCursor = BtCursor1 /* sqlite3.c:14762:25 */
+type BtCursor = BtCursor1 /* sqlite3.c:15037:25 */
type BtShared1 = struct {
FpPager uintptr
Fdb uintptr
@@ -7720,7 +8609,7 @@ type BtShared1 = struct {
FpTmpSpace uintptr
}
-type BtShared = BtShared1 /* sqlite3.c:14763:25 */
+type BtShared = BtShared1 /* sqlite3.c:15038:25 */
type BtreePayload1 = struct {
FpKey uintptr
FnKey Sqlite3_int64
@@ -7732,71 +8621,7 @@ type BtreePayload1 = struct {
_ [4]byte
}
-type BtreePayload = BtreePayload1 /* sqlite3.c:14764:29 */
-type Pager1 = struct {
- FpVfs uintptr
- FexclusiveMode U8
- FjournalMode U8
- FuseJournal U8
- FnoSync U8
- FfullSync U8
- FextraSync U8
- FsyncFlags U8
- FwalSyncFlags U8
- FtempFile U8
- FnoLock U8
- FreadOnly U8
- FmemDb U8
- FeState U8
- FeLock U8
- FchangeCountDone U8
- FsetMaster U8
- FdoNotSpill U8
- FsubjInMemory U8
- FbUseFetch U8
- FhasHeldSharedLock U8
- FdbSize Pgno
- FdbOrigSize Pgno
- FdbFileSize Pgno
- FdbHintSize Pgno
- FerrCode int32
- FnRec int32
- FcksumInit U32
- FnSubRec U32
- FpInJournal uintptr
- Ffd uintptr
- Fjfd uintptr
- Fsjfd uintptr
- FjournalOff I64
- FjournalHdr I64
- FpBackup uintptr
- FaSavepoint uintptr
- FnSavepoint int32
- FiDataVersion U32
- FdbFileVers [16]int8
- FnMmapOut int32
- FszMmap Sqlite3_int64
- FpMmapFreelist uintptr
- FnExtra U16
- FnReserve I16
- FvfsFlags U32
- FsectorSize U32
- FpageSize int32
- FmxPgno Pgno
- FjournalSizeLimit I64
- FzFilename uintptr
- FzJournal uintptr
- FxBusyHandler uintptr
- FpBusyHandlerArg uintptr
- FaStat [4]int32
- FnRead int32
- FxReiniter uintptr
- FxGet uintptr
- FpTmpSpace uintptr
- FpPCache uintptr
- FpWal uintptr
- FzWal uintptr
-}
+type BtreePayload = BtreePayload1 /* sqlite3.c:15039:29 */
//************* End of btree.h **********************************************
//************* Continuing where we left off in sqliteInt.h *****************
@@ -7896,11 +8721,11 @@ type Vdbe1 = struct {
// A single VDBE is an opaque structure named "Vdbe". Only routines
// in the source file sqliteVdbe.c are allowed to see the insides
// of this structure.
-type Vdbe = Vdbe1 /* sqlite3.c:15145:21 */
+type Vdbe = Vdbe1 /* sqlite3.c:15420:21 */
// The names of the following types declared in vdbeInt.h are required
// for the VdbeOp definition.
-type Mem = sqlite3_value /* sqlite3.c:15151:30 */
+type Mem = sqlite3_value /* sqlite3.c:15426:30 */
type SubProgram1 = struct {
FaOp uintptr
FnOp int32
@@ -7911,7 +8736,7 @@ type SubProgram1 = struct {
FpNext uintptr
}
-type SubProgram = SubProgram1 /* sqlite3.c:15152:27 */
+type SubProgram = SubProgram1 /* sqlite3.c:15427:27 */
// A single instruction of the virtual machine has an opcode
// and as many as three operands. The instruction is recorded
@@ -7928,6 +8753,7 @@ type VdbeOp1 = struct {
Fi int32
_ [4]byte
}
+ FzComment uintptr
}
// A single instruction of the virtual machine has an opcode
@@ -7939,7 +8765,7 @@ type p4union = struct {
_ [4]byte
}
-type VdbeOp = VdbeOp1 /* sqlite3.c:15198:23 */
+type VdbeOp = VdbeOp1 /* sqlite3.c:15473:23 */
// A smaller version of VdbeOp used for the VdbeAddOpList() function because
// it takes up less space.
@@ -7950,16 +8776,9 @@ type VdbeOpList1 = struct {
Fp3 int8
}
-type VdbeOpList = VdbeOpList1 /* sqlite3.c:15224:27 */
-
-type RecordCompare = uintptr /* sqlite3.c:15629:13 */
+type VdbeOpList = VdbeOpList1 /* sqlite3.c:15499:27 */
-// Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on
-// each VDBE opcode.
-//
-// Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op
-// comments in VDBE programs that show key decision points in the code
-// generator.
+type RecordCompare = uintptr /* sqlite3.c:15904:13 */
// The VdbeCoverage macros are used to set a coverage testing point
// for VDBE branch instructions. The coverage testing points are line
@@ -8002,53 +8821,6 @@ type RecordCompare = uintptr /* sqlite3.c:15629:13 */
//************* End of vdbe.h ***********************************************
//************* Continuing where we left off in sqliteInt.h *****************
-//************* Include pager.h in the middle of sqliteInt.h ****************
-//************* Begin file pager.h ******************************************
-// 2001 September 15
-//
-// The author disclaims copyright to this source code. In place of
-// a legal notice, here is a blessing:
-//
-// May you do good and not evil.
-// May you find forgiveness for yourself and forgive others.
-// May you share freely, never taking more than you give.
-//
-//
-// This header file defines the interface that the sqlite page cache
-// subsystem. The page cache subsystem reads and writes a file a page
-// at a time and provides a journal for rollback.
-
-// Default maximum size for persistent journal files. A negative
-// value means no limit. This value may be overridden using the
-// sqlite3PagerJournalSizeLimit() API. See also "PRAGMA journal_size_limit".
-
-// The type used to represent a page number. The first page in a file
-// is called page 1. 0 is used to represent "not a page".
-type Pgno = U32 /* sqlite3.c:15777:13 */
-
-// Each open file is managed by a separate instance of the "Pager" structure.
-type Pager = Pager1 /* sqlite3.c:15782:22 */
-
-// Handle type for pages.
-type PgHdr2 = struct {
- FpPage uintptr
- FpData uintptr
- FpExtra uintptr
- FpCache uintptr
- FpDirty uintptr
- FpPager uintptr
- Fpgno Pgno
- Fflags U16
- FnRef I16
- FpDirtyNext uintptr
- FpDirtyPrev uintptr
-}
-
-// Handle type for pages.
-type DbPage = PgHdr2 /* sqlite3.c:15787:22 */
-
-//************* End of pager.h **********************************************
-//************* Continuing where we left off in sqliteInt.h *****************
//************* Include pcache.h in the middle of sqliteInt.h ***************
//************* Begin file pcache.h *****************************************
// 2008 August 05
@@ -8064,7 +8836,7 @@ type DbPage = PgHdr2 /* sqlite3.c:15787:22 */
// This header file defines the interface that the sqlite page cache
// subsystem.
-type PgHdr = PgHdr2 /* sqlite3.c:16009:22 */
+type PgHdr = PgHdr2 /* sqlite3.c:16037:22 */
type PCache2 = struct {
FpDirty uintptr
FpDirtyTail uintptr
@@ -8081,17 +8853,17 @@ type PCache2 = struct {
FpCache uintptr
}
-type PCache = PCache2 /* sqlite3.c:16010:23 */
+type PCache = PCache2 /* sqlite3.c:16038:23 */
// typedef for the authorization callback function.
-type Sqlite3_xauth = uintptr /* sqlite3.c:16772:15 */
+type Sqlite3_xauth = uintptr /* sqlite3.c:16800:15 */
// This is an extra SQLITE_TRACE macro that indicates "legacy" tracing
// in the style of sqlite3_trace()
// Each database connection is an instance of the following structure.
type sqlite3InitInfo = struct {
- FnewTnum int32
+ FnewTnum Pgno
FiDb U8
Fbusy U8
_ [2]byte
@@ -8167,7 +8939,7 @@ type sColMap = struct {
// fields do not need to be freed when deallocating the AggInfo structure.
type AggInfo_col = struct {
FpTab uintptr
- FpExpr uintptr
+ FpCExpr uintptr
FiTable int32
FiMem int32
FiColumn I16
@@ -8187,14 +8959,12 @@ type AggInfo_col = struct {
// original Select structure that describes the SELECT statement. These
// fields do not need to be freed when deallocating the AggInfo structure.
type AggInfo_func = struct {
- FpExpr uintptr
+ FpFExpr uintptr
FpFunc uintptr
FiMem int32
FiDistinct int32
}
-// Value for AggInfo.iAggMagic when the structure is valid
-
// The datatype ynVar is a signed integer, either 16-bit or 32-bit.
// Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater
// than 32767 we have to make it 32-bit. 16-bit is preferred because
@@ -8203,7 +8973,7 @@ type AggInfo_func = struct {
// need more than about 10 or 20 variables. But some extreme users want
// to have prepared statements with over 32766 variables, and for them
// the option is available (at compile-time).
-type YnVar = I16 /* sqlite3.c:17905:13 */
+type YnVar = I16 /* sqlite3.c:17929:13 */
// The following are the meanings of bits in the Expr.flags field.
// Value restrictions:
@@ -8335,7 +9105,7 @@ type SrcList_item = struct {
}
// The yDbMask datatype for the bitmask of all attached databases.
-type YDbMask = uint32 /* sqlite3.c:18625:24 */
+type YDbMask = uint32 /* sqlite3.c:18660:24 */
// The following structure contains information used by the sqliteFix...
// routines as they walk the parse tree to make database references
@@ -8352,7 +9122,7 @@ type DbFixer1 = struct {
// The following structure contains information used by the sqliteFix...
// routines as they walk the parse tree to make database references
// explicit.
-type DbFixer = DbFixer1 /* sqlite3.c:18925:24 */
+type DbFixer = DbFixer1 /* sqlite3.c:18959:24 */
// A pointer to this structure is used to communicate information
// from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback.
@@ -8363,7 +9133,9 @@ type InitData = struct {
Frc int32
FmInitFlags U32
FnInitRow U32
-} /* sqlite3.c:18966:3 */
+ FmxPage Pgno
+ _ [4]byte
+} /* sqlite3.c:19001:3 */
// Allowed values for mInitFlags
@@ -8608,7 +9380,7 @@ var Xsqlite3UpperToLower = [256]uint8{
uint8(216), uint8(217), uint8(218), uint8(219), uint8(220), uint8(221), uint8(222), uint8(223), uint8(224), uint8(225), uint8(226), uint8(227), uint8(228), uint8(229), uint8(230), uint8(231), uint8(232), uint8(233),
uint8(234), uint8(235), uint8(236), uint8(237), uint8(238), uint8(239), uint8(240), uint8(241), uint8(242), uint8(243), uint8(244), uint8(245), uint8(246), uint8(247), uint8(248), uint8(249), uint8(250), uint8(251),
uint8(252), uint8(253), uint8(254), uint8(255),
-} /* sqlite3.c:20352:36 */
+} /* sqlite3.c:20392:36 */
// The following 256 byte lookup table is used to support SQLites built-in
// equivalents to the following standard library functions:
@@ -8672,7 +9444,7 @@ var Xsqlite3CtypeMap = [256]uint8{
uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), // e8..ef ........
uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), // f0..f7 ........
uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), uint8(0x40), // f8..ff ........
-} /* sqlite3.c:20418:36 */
+} /* sqlite3.c:20458:36 */
// EVIDENCE-OF: R-02982-34736 In order to maintain full backwards
// compatibility for legacy applications, the URI filename capability is
@@ -8719,7 +9491,7 @@ var Xsqlite3CtypeMap = [256]uint8{
// the SQLite library.
var Xsqlite3Config = Sqlite3Config{FbMemstat: 0, FbCoreMutex: // bMemstat
U8(1), FbFullMutex:// bCoreMutex
-(U8(crt.Bool32(1 == 1))), FbOpenUri:// bFullMutex
+(U8(libc.Bool32(1 == 1))), FbOpenUri:// bFullMutex
U8(0), FbUseCis:// bOpenUri
U8(1), FbSmallMalloc:// bUseCis
U8(0), FbExtraSchemaChecks:// bSmallMalloc
@@ -8735,7 +9507,7 @@ uintptr(0), FnHeap:// pHeap
0, FmnReq:// nHeap
0, FmxReq: 0, FszMmap: // mnHeap, mxHeap
int64(0), FmxMmap:// szMmap
-8589934592, FpPage:// mxMmap
+int64(0x7fff0000), FpPage:// mxMmap
uintptr(0), FszPage:// pPage
0, FnPage:// szPage
20, FmxParserStack:// nPage
@@ -8758,12 +9530,12 @@ uintptr(0), FbLocaltimeFault:// xTestCallback
0x7ffffffe, FszSorterRef:// iOnceResetThreshold
U32(0x7fffffff), FiPrngSeed:// szSorterRef
uint32(0), // iPrngSeed
-} /* sqlite3.c:20538:48 */
+} /* sqlite3.c:20578:48 */
// Hash table for global functions - functions common to all
// database connections. After initialization, this table is
// read-only.
-var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:20599:28: */
+var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:20639:28: */
// The value of the "pending" byte must be 0x40000000 (1 byte past the
// 1-gibabyte boundary) in a compatible database. SQLite never uses
@@ -8781,17 +9553,20 @@ var Xsqlite3BuiltinFunctions FuncDefHash /* sqlite3.c:20599:28: */
// 0x40000000 results in an incompatible database file format!
// Changing the pending byte during operation will result in undefined
// and incorrect behavior.
-var Xsqlite3PendingByte int32 = 0x40000000 /* sqlite3.c:20628:20 */
+var Xsqlite3PendingByte int32 = 0x40000000 /* sqlite3.c:20668:20 */
+
+// Flags for select tracing and the ".selecttrace" macro of the CLI
+var Xsqlite3_unsupported_selecttrace U32 = U32(0) /* sqlite3.c:20674:16 */
// #include "opcodes.h"
// Properties of opcodes. The OPFLG_INITIALIZER macro is
// created by mkopcodeh.awk during compilation. Data is obtained
// from the comments following the "case OP_xxxx:" statements in
// the vdbe.c file.
-var Xsqlite3OpcodeProperty = [176]uint8{ /* 0 */ uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00), uint8(0x10) /* 8 */, uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x03) /* 16 */, uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x12), uint8(0x03), uint8(0x01), uint8(0x09), uint8(0x09) /* 24 */, uint8(0x09), uint8(0x09), uint8(0x01), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09) /* 32 */, uint8(0x09), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01) /* 40 */, uint8(0x01), uint8(0x01), uint8(0x23), uint8(0x26), uint8(0x26), uint8(0x0b), uint8(0x01), uint8(0x01) /* 48 */, uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x0b), uint8(0x0b), uint8(0x0b), uint8(0x0b) /* 56 */, uint8(0x0b), uint8(0x0b), uint8(0x01), uint8(0x03), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00) /* 64 */, uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x08), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x10) /* 72 */, uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10) /* 80 */, uint8(0x00), uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x00), uint8(0x00), uint8(0x12) /* 88 */, uint8(0x20), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00) /* 96 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x26), uint8(0x26), uint8(0x26) /* 104 */, uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x00) /* 112 */, uint8(0x12), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10) /* 120 */, uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10) /* 128 */, uint8(0x00), uint8(0x00), uint8(0x04), uint8(0x04), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00) /* 136 */, uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 144 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x06), uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x04) /* 152 */, uint8(0x1a), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 160 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 168 */, uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00)} /* sqlite3.c:20638:36 */
+var Xsqlite3OpcodeProperty = [176]uint8{ /* 0 */ uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00), uint8(0x10) /* 8 */, uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x03) /* 16 */, uint8(0x01), uint8(0x01), uint8(0x03), uint8(0x12), uint8(0x03), uint8(0x01), uint8(0x09), uint8(0x09) /* 24 */, uint8(0x09), uint8(0x09), uint8(0x01), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09), uint8(0x09) /* 32 */, uint8(0x09), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x01) /* 40 */, uint8(0x01), uint8(0x01), uint8(0x23), uint8(0x26), uint8(0x26), uint8(0x0b), uint8(0x01), uint8(0x01) /* 48 */, uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x03), uint8(0x0b), uint8(0x0b), uint8(0x0b), uint8(0x0b) /* 56 */, uint8(0x0b), uint8(0x0b), uint8(0x01), uint8(0x03), uint8(0x01), uint8(0x01), uint8(0x01), uint8(0x00) /* 64 */, uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x08), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x10) /* 72 */, uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10) /* 80 */, uint8(0x00), uint8(0x00), uint8(0x02), uint8(0x02), uint8(0x02), uint8(0x00), uint8(0x00), uint8(0x12) /* 88 */, uint8(0x20), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00) /* 96 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x26), uint8(0x26), uint8(0x26) /* 104 */, uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x26), uint8(0x00) /* 112 */, uint8(0x12), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10) /* 120 */, uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x10) /* 128 */, uint8(0x00), uint8(0x00), uint8(0x04), uint8(0x04), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00) /* 136 */, uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 144 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x06), uint8(0x10), uint8(0x00), uint8(0x10), uint8(0x04) /* 152 */, uint8(0x1a), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 160 */, uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00) /* 168 */, uint8(0x10), uint8(0x10), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00), uint8(0x00)} /* sqlite3.c:20683:36 */
// Name of the default collating sequence
-var Xsqlite3StrBINARY = *(*[7]int8)(unsafe.Pointer(ts + 230 /* "BINARY" */)) /* sqlite3.c:20643:27 */
+var Xsqlite3StrBINARY = *(*[7]int8)(unsafe.Pointer(ts + 344 /* "BINARY" */)) /* sqlite3.c:20688:27 */
//************* End of global.c *********************************************
//************* Begin file status.c *****************************************
@@ -8836,10 +9611,10 @@ var Xsqlite3StrBINARY = *(*[7]int8)(unsafe.Pointer(ts + 230 /* "BINARY" */)) /*
// SQL is translated into a sequence of instructions to be
// executed by a virtual machine. Each instruction is an instance
// of the following structure.
-type Op = VdbeOp1 /* sqlite3.c:20710:23 */
+type Op = VdbeOp1 /* sqlite3.c:20755:23 */
// Boolean values
-type Bool = uint32 /* sqlite3.c:20715:18 */
+type Bool = uint32 /* sqlite3.c:20760:18 */
// Opaque type used by code in vdbesort.c
type VdbeSorter1 = struct {
@@ -8864,7 +9639,7 @@ type VdbeSorter1 = struct {
}
// Opaque type used by code in vdbesort.c
-type VdbeSorter = VdbeSorter1 /* sqlite3.c:20718:27 */
+type VdbeSorter = VdbeSorter1 /* sqlite3.c:20763:27 */
// Elements of the linked list at Vdbe.pAuxData
type AuxData1 = struct {
@@ -8876,7 +9651,7 @@ type AuxData1 = struct {
}
// Elements of the linked list at Vdbe.pAuxData
-type AuxData = AuxData1 /* sqlite3.c:20721:24 */
+type AuxData = AuxData1 /* sqlite3.c:20766:24 */
// Types of VDBE cursors
@@ -8927,7 +9702,7 @@ type VdbeCursor1 = struct {
// * A sorter
// * A virtual table
// * A one-row "pseudotable" stored in a single register
-type VdbeCursor = VdbeCursor1 /* sqlite3.c:20739:27 */
+type VdbeCursor = VdbeCursor1 /* sqlite3.c:20784:27 */
// A value for VdbeCursor.cacheStatus that means the cache is always invalid.
@@ -8992,7 +9767,7 @@ type VdbeFrame1 = struct {
//
// The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is
// set to NULL if the currently executing frame is the main program.
-type VdbeFrame = VdbeFrame1 /* sqlite3.c:20825:26 */
+type VdbeFrame = VdbeFrame1 /* sqlite3.c:20870:26 */
// Magic number for sanity checking on VdbeFrame objects
@@ -9006,7 +9781,7 @@ type MemValue = struct{ Fr float64 }
// A bitfield type for use inside of structures. Always follow with :N where
// N is the number of bits.
-type Bft = uint32 /* sqlite3.c:21008:18 */ // Bit Field Type
+type Bft = uint32 /* sqlite3.c:21053:18 */ // Bit Field Type
// The ScanStatus object holds a single value for the
// sqlite3_stmt_scanstatus() interface.
@@ -9023,7 +9798,7 @@ type ScanStatus1 = struct {
// The ScanStatus object holds a single value for the
// sqlite3_stmt_scanstatus() interface.
-type ScanStatus = ScanStatus1 /* sqlite3.c:21013:27 */
+type ScanStatus = ScanStatus1 /* sqlite3.c:21058:27 */
// The DblquoteStr object holds the text of a double-quoted
// string for a prepared statement. A linked list of these objects
@@ -9042,20 +9817,20 @@ type DblquoteStr1 = struct {
// When computing a normalized SQL statement for an SQL statement, that
// list is consulted for each double-quoted identifier to see if the
// identifier should really be a string literal.
-type DblquoteStr = DblquoteStr1 /* sqlite3.c:21030:28 */
+type DblquoteStr = DblquoteStr1 /* sqlite3.c:21075:28 */
//************* End of vdbeInt.h ********************************************
//************* Continuing where we left off in status.c ********************
// Variables in which to record status information.
-type Sqlite3StatValueType = Sqlite3_int64 /* sqlite3.c:21296:23 */
+type Sqlite3StatValueType = Sqlite3_int64 /* sqlite3.c:21341:23 */
type sqlite3StatType = struct {
FnowValue [10]Sqlite3StatValueType
FmxValue [10]Sqlite3StatValueType
}
-type Sqlite3StatType = sqlite3StatType /* sqlite3.c:21300:32 */
-var sqlite3Stat = sqlite3StatType{FnowValue: [10]Sqlite3StatValueType{int64(0)}, FmxValue: [10]Sqlite3StatValueType{int64(0)}} /* sqlite3.c:21304:3 */
+type Sqlite3StatType = sqlite3StatType /* sqlite3.c:21345:32 */
+var sqlite3Stat = sqlite3StatType{FnowValue: [10]Sqlite3StatValueType{int64(0)}, FmxValue: [10]Sqlite3StatValueType{int64(0)}} /* sqlite3.c:21349:3 */
// Elements of sqlite3Stat[] are protected by either the memory allocator
// mutex, or by the pcache1 mutex. The following array determines which.
@@ -9070,7 +9845,7 @@ var statMutex = [10]int8{
int8(1), // SQLITE_STATUS_PAGECACHE_SIZE
int8(0), // SQLITE_STATUS_SCRATCH_SIZE
int8(0), // SQLITE_STATUS_MALLOC_COUNT
-} /* sqlite3.c:21310:19 */
+} /* sqlite3.c:21355:19 */
// The "wsdStat" macro will resolve to the status information
// state vector. If writable static data is unsupported on the target,
@@ -9080,7 +9855,7 @@ var statMutex = [10]int8{
// Return the current value of a status parameter. The caller must
// be holding the appropriate mutex.
-func Xsqlite3StatusValue(tls *crt.TLS, op int32) Sqlite3_int64 { /* sqlite3.c:21342:30: */
+func Xsqlite3StatusValue(tls *libc.TLS, op int32) Sqlite3_int64 { /* sqlite3.c:21387:30: */
return *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8))
}
@@ -9094,21 +9869,21 @@ func Xsqlite3StatusValue(tls *crt.TLS, op int32) Sqlite3_int64 { /* sqlite3.c:21
//
// The StatusDown() routine lowers the current value by N. The highwater
// mark is unchanged. N must be non-negative for StatusDown().
-func Xsqlite3StatusUp(tls *crt.TLS, op int32, N int32) { /* sqlite3.c:21362:21: */
+func Xsqlite3StatusUp(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21407:21: */
*(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8)) += (Sqlite3StatValueType(N))
if *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8)) > *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) + 80 /* &.mxValue */) + uintptr(op)*8)) {
*(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) + 80 /* &.mxValue */) + uintptr(op)*8)) = *(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8))
}
}
-func Xsqlite3StatusDown(tls *crt.TLS, op int32, N int32) { /* sqlite3.c:21373:21: */
+func Xsqlite3StatusDown(tls *libc.TLS, op int32, N int32) { /* sqlite3.c:21418:21: */
*(*Sqlite3StatValueType)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Stat)) /* &.nowValue */) + uintptr(op)*8)) -= (Sqlite3StatValueType(N))
}
// Adjust the highwater mark if necessary.
// The caller must hold the appropriate mutex.
-func Xsqlite3StatusHighwater(tls *crt.TLS, op int32, X int32) { /* sqlite3.c:21387:21: */
+func Xsqlite3StatusHighwater(tls *libc.TLS, op int32, X int32) { /* sqlite3.c:21432:21: */
var newValue Sqlite3StatValueType
newValue = Sqlite3StatValueType(X)
@@ -9119,12 +9894,12 @@ func Xsqlite3StatusHighwater(tls *crt.TLS, op int32, X int32) { /* sqlite3.c:213
}
// Query status information.
-func Xsqlite3_status64(tls *crt.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21407:16: */
+func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21452:16: */
var pMutex uintptr
_ = pMutex
if (op < 0) || (op >= (int32(uint64(unsafe.Sizeof([10]Sqlite3StatValueType{})) / uint64(unsafe.Sizeof(Sqlite3StatValueType(0)))))) {
- return Xsqlite3MisuseError(tls, 21416)
+ return Xsqlite3MisuseError(tls, 21461)
}
if statMutex[op] != 0 {
pMutex = Xsqlite3Pcache1Mutex(tls)
@@ -9141,7 +9916,7 @@ func Xsqlite3_status64(tls *crt.TLS, op int32, pCurrent uintptr, pHighwater uint
_ = pMutex // Prevent warning when SQLITE_THREADSAFE=0
return 0
}
-func Xsqlite3_status(tls *crt.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21432:16: */
+func Xsqlite3_status(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21477:16: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -9157,7 +9932,7 @@ func Xsqlite3_status(tls *crt.TLS, op int32, pCurrent uintptr, pHighwater uintpt
}
// Return the number of LookasideSlot elements on the linked list
-func countLookasideSlots(tls *crt.TLS, p uintptr) U32 { /* sqlite3.c:21449:12: */
+func countLookasideSlots(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:21494:12: */
var cnt U32 = U32(0)
for p != 0 {
p = (*LookasideSlot)(unsafe.Pointer(p)).FpNext
@@ -9167,7 +9942,7 @@ func countLookasideSlots(tls *crt.TLS, p uintptr) U32 { /* sqlite3.c:21449:12: *
}
// Count the number of slots of lookaside memory that are outstanding
-func Xsqlite3LookasideUsed(tls *crt.TLS, db uintptr, pHighwater uintptr) int32 { /* sqlite3.c:21461:20: */
+func Xsqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) int32 { /* sqlite3.c:21506:20: */
var nInit U32 = countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit)
var nFree U32 = countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree)
nInit = nInit + (countLookasideSlots(tls, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit))
@@ -9179,7 +9954,7 @@ func Xsqlite3LookasideUsed(tls *crt.TLS, db uintptr, pHighwater uintptr) int32 {
}
// Query status information for a single database connection
-func Xsqlite3_db_status(tls *crt.TLS, db uintptr, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21475:16: */
+func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, pHighwater uintptr, resetFlag int32) int32 { /* sqlite3.c:21520:16: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -9220,9 +9995,9 @@ func Xsqlite3_db_status(tls *crt.TLS, db uintptr, op int32, pCurrent uintptr, pH
{
*(*int32)(unsafe.Pointer(pCurrent)) = 0
- *(*int32)(unsafe.Pointer(pHighwater)) = int32(*(*U32)(unsafe.Pointer((db + 376 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-4))*4)))
+ *(*int32)(unsafe.Pointer(pHighwater)) = int32(*(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-4))*4)))
if resetFlag != 0 {
- *(*U32)(unsafe.Pointer((db + 376 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-4))*4)) = U32(0)
+ *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + uintptr((op-4))*4)) = U32(0)
}
break
}
@@ -9269,7 +10044,7 @@ func Xsqlite3_db_status(tls *crt.TLS, db uintptr, op int32, pCurrent uintptr, pH
if pSchema != uintptr(0) {
var p uintptr
- *(*int32)(unsafe.Pointer(bp /* nByte */)) += int32((uint32((*(*func(*crt.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 32 /* &.xRoundup */))))(tls, int32(unsafe.Sizeof(HashElem{})))) * ((((*Schema)(unsafe.Pointer(pSchema)).FtblHash.Fcount +
+ *(*int32)(unsafe.Pointer(bp /* nByte */)) += int32((uint32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 32 /* &.xRoundup */))))(tls, int32(unsafe.Sizeof(HashElem{})))) * ((((*Schema)(unsafe.Pointer(pSchema)).FtblHash.Fcount +
(*Schema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount) +
(*Schema)(unsafe.Pointer(pSchema)).FidxHash.Fcount) +
(*Schema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)))
@@ -9321,7 +10096,7 @@ func Xsqlite3_db_status(tls *crt.TLS, db uintptr, op int32, pCurrent uintptr, pH
case 12:
op = (9 + 1)
fallthrough
- // Fall through into the next case
+ /* no break */
case 7:
fallthrough
case 8:
@@ -9350,7 +10125,7 @@ func Xsqlite3_db_status(tls *crt.TLS, db uintptr, op int32, pCurrent uintptr, pH
case 10:
{
*(*int32)(unsafe.Pointer(pHighwater)) = 0 // IMP: R-11967-56545
- *(*int32)(unsafe.Pointer(pCurrent)) = (crt.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > int64(0)) || ((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons > int64(0))))
+ *(*int32)(unsafe.Pointer(pCurrent)) = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > int64(0)) || ((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons > int64(0))))
break
}
@@ -9659,8 +10434,8 @@ type tm = struct {
// POSIX.1b structure for a time value. This is like a `struct timeval' but
// has nanoseconds instead of microseconds.
type timespec = struct {
- Ftv_sec int64
- Ftv_nsec int64
+ Ftv_sec X__time_t
+ Ftv_nsec X__syscall_slong_t
}
// bits/types.h -- definitions of __*_t types underlying *_t types.
@@ -9688,12 +10463,12 @@ type timespec = struct {
// POSIX.1b structure for timer start values and intervals.
type itimerspec = struct {
Fit_interval struct {
- Ftv_sec int64
- Ftv_nsec int64
+ Ftv_sec X__time_t
+ Ftv_nsec X__syscall_slong_t
}
Fit_value struct {
- Ftv_sec int64
- Ftv_nsec int64
+ Ftv_sec X__time_t
+ Ftv_nsec X__syscall_slong_t
}
}
@@ -9726,7 +10501,7 @@ type DateTime1 = struct {
// defined in "os_win.c".
// A structure for holding a single date and time.
-type DateTime = DateTime1 /* sqlite3.c:21735:25 */
+type DateTime = DateTime1 /* sqlite3.c:21780:25 */
// Convert zDate into one or more integers according to the conversion
// specifier zFormat.
@@ -9753,7 +10528,7 @@ type DateTime = DateTime1 /* sqlite3.c:21735:25 */
// the 2-digit day which is the last integer in the set.
//
// The function returns the number of successful conversions.
-func getDigits(tls *crt.TLS, zDate uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:21779:12: */
+func getDigits(tls *libc.TLS, zDate uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:21824:12: */
var ap Va_list
_ = ap
var cnt int32
@@ -9773,7 +10548,7 @@ __1:
nextC = *(*int8)(unsafe.Pointer(zFormat + uintptr(3)))
val = 0
__4:
- if !(crt.PostDecInt8(&N, 1) != 0) {
+ if !(libc.PostDecInt8(&N, 1) != 0) {
goto __5
}
if !(!((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))]) & 0x04) != 0)) {
@@ -9793,7 +10568,7 @@ __5:
goto end_getDigits
__7:
;
- *(*int32)(unsafe.Pointer(crt.VaUintptr(&ap))) = val
+ *(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = val
zDate++
cnt++
zFormat += uintptr(4)
@@ -9810,7 +10585,7 @@ end_getDigits:
return cnt
}
-var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)} /* sqlite3.c:21782:20 */
+var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)} /* sqlite3.c:21827:20 */
// Parse a timezone extension on the end of a date-time.
// The extension is of the form:
@@ -9826,7 +10601,7 @@ var aMx = [6]U16{U16(12), U16(14), U16(24), U16(31), U16(59), U16(9999)} /* sqli
// return non-zero.
//
// A missing specifier is not considered an error.
-func parseTimezone(tls *crt.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:21833:12: */
+func parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:21878:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -9866,7 +10641,7 @@ __5:
goto zulu_time
goto __8
__7:
- return (crt.Bool32(c != 0))
+ return (libc.Bool32(c != 0))
__8:
;
__6:
@@ -9874,7 +10649,7 @@ __6:
__4:
;
zDate++
- if !(getDigits(tls, zDate, ts+237 /* "20b:20e" */, crt.VaList(bp, bp+16 /* &nHr */, bp+20 /* &nMn */)) != 2) {
+ if !(getDigits(tls, zDate, ts+351 /* "20b:20e" */, libc.VaList(bp, bp+16 /* &nHr */, bp+20 /* &nMn */)) != 2) {
goto __9
}
return 1
@@ -9892,7 +10667,7 @@ __10:
__11:
;
(*DateTime)(unsafe.Pointer(p)).FtzSet = int8(1)
- return (crt.Bool32(int32(*(*int8)(unsafe.Pointer(zDate))) != 0))
+ return (libc.Bool32(int32(*(*int8)(unsafe.Pointer(zDate))) != 0))
}
// Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF.
@@ -9900,7 +10675,7 @@ __11:
// fractional seconds FFFF can be one or more digits.
//
// Return 1 if there is a parsing error and 0 on success.
-func parseHhMmSs(tls *crt.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:21869:12: */
+func parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:21914:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -9911,13 +10686,13 @@ func parseHhMmSs(tls *crt.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:21
// var s int32 at bp+32, 4
var ms float64 = 0.0
- if getDigits(tls, zDate, ts+245 /* "20c:20e" */, crt.VaList(bp, bp+24 /* &h */, bp+28 /* &m */)) != 2 {
+ if getDigits(tls, zDate, ts+359 /* "20c:20e" */, libc.VaList(bp, bp+24 /* &h */, bp+28 /* &m */)) != 2 {
return 1
}
zDate += uintptr(5)
if int32(*(*int8)(unsafe.Pointer(zDate))) == ':' {
zDate++
- if getDigits(tls, zDate, ts+253 /* "20e" */, crt.VaList(bp+16, bp+32 /* &s */)) != 1 {
+ if getDigits(tls, zDate, ts+367 /* "20e" */, libc.VaList(bp+16, bp+32 /* &s */)) != 1 {
return 1
}
zDate += uintptr(2)
@@ -9953,8 +10728,8 @@ func parseHhMmSs(tls *crt.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:21
}
// Put the DateTime object into its error state.
-func datetimeError(tls *crt.TLS, p uintptr) { /* sqlite3.c:21909:13: */
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DateTime{})))
+func datetimeError(tls *libc.TLS, p uintptr) { /* sqlite3.c:21954:13: */
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DateTime{})))
(*DateTime)(unsafe.Pointer(p)).FisError = int8(1)
}
@@ -9962,7 +10737,7 @@ func datetimeError(tls *crt.TLS, p uintptr) { /* sqlite3.c:21909:13: */
// that the YYYY-MM-DD is according to the Gregorian calendar.
//
// Reference: Meeus page 61
-func computeJD(tls *crt.TLS, p uintptr) { /* sqlite3.c:21920:13: */
+func computeJD(tls *libc.TLS, p uintptr) { /* sqlite3.c:21965:13: */
var Y int32
var M int32
var D int32
@@ -10018,7 +10793,7 @@ func computeJD(tls *crt.TLS, p uintptr) { /* sqlite3.c:21920:13: */
// Write the result into the DateTime structure and return 0
// on success and 1 if the input string is not a well-formed
// date.
-func parseYyyyMmDd(tls *crt.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:21970:12: */
+func parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22015:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -10036,7 +10811,7 @@ func parseYyyyMmDd(tls *crt.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:
} else {
neg = 0
}
- if getDigits(tls, zDate, ts+257 /* "40f-21a-21d" */, crt.VaList(bp, bp+24 /* &Y */, bp+28 /* &M */, bp+32 /* &D */)) != 3 {
+ if getDigits(tls, zDate, ts+371 /* "40f-21a-21d" */, libc.VaList(bp, bp+24 /* &Y */, bp+28 /* &M */, bp+32 /* &D */)) != 3 {
return 1
}
zDate += uintptr(10)
@@ -10068,7 +10843,7 @@ func parseYyyyMmDd(tls *crt.TLS, zDate uintptr, p uintptr) int32 { /* sqlite3.c:
// Set the time to the current time reported by the VFS.
//
// Return the number of errors.
-func setDateTimeToCurrent(tls *crt.TLS, context uintptr, p uintptr) int32 { /* sqlite3.c:22007:12: */
+func setDateTimeToCurrent(tls *libc.TLS, context uintptr, p uintptr) int32 { /* sqlite3.c:22052:12: */
(*DateTime)(unsafe.Pointer(p)).FiJD = Xsqlite3StmtCurrentTime(tls, context)
if (*DateTime)(unsafe.Pointer(p)).FiJD > int64(0) {
(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(1)
@@ -10083,7 +10858,7 @@ func setDateTimeToCurrent(tls *crt.TLS, context uintptr, p uintptr) int32 { /* s
// or the number of seconds since 1970. If the value if r is within
// range of a julian day number, install it as such and set validJD.
// If the value is a valid unix timestamp, put it in p->s and set p->rawS.
-func setRawDateNumber(tls *crt.TLS, p uintptr, r float64) { /* sqlite3.c:22023:13: */
+func setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { /* sqlite3.c:22068:13: */
(*DateTime)(unsafe.Pointer(p)).Fs = r
(*DateTime)(unsafe.Pointer(p)).FrawS = int8(1)
if (r >= 0.0) && (r < 5373484.5) {
@@ -10106,7 +10881,7 @@ func setRawDateNumber(tls *crt.TLS, p uintptr, r float64) { /* sqlite3.c:22023:1
// (":SS.FFF") is option. The year and date can be omitted as long
// as there is a time string. The time string can be omitted as long
// as there is a year and date.
-func parseDateOrTime(tls *crt.TLS, context uintptr, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22048:12: */
+func parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) int32 { /* sqlite3.c:22093:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -10116,7 +10891,7 @@ func parseDateOrTime(tls *crt.TLS, context uintptr, zDate uintptr, p uintptr) in
return 0
} else if parseHhMmSs(tls, zDate, p) == 0 {
return 0
- } else if (Xsqlite3StrICmp(tls, zDate, ts+269 /* "now" */) == 0) && (Xsqlite3NotPureFunc(tls, context) != 0) {
+ } else if (Xsqlite3StrICmp(tls, zDate, ts+383 /* "now" */) == 0) && (Xsqlite3NotPureFunc(tls, context) != 0) {
return setDateTimeToCurrent(tls, context, p)
} else if Xsqlite3AtoF(tls, zDate, bp /* &r */, Xsqlite3Strlen30(tls, zDate), uint8(1)) > 0 {
setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp /* r */)))
@@ -10135,12 +10910,12 @@ func parseDateOrTime(tls *crt.TLS, context uintptr, zDate uintptr, p uintptr) in
// Return TRUE if the given julian day number is within range.
//
// The input is the JulianDay times 86400000.
-func validJulianDay(tls *crt.TLS, iJD Sqlite3_int64) int32 { /* sqlite3.c:22081:12: */
- return (crt.Bool32((iJD >= int64(0)) && (iJD <= ((I64((int64(0x1a640))) << 32) | int64(0x1072fdff)))))
+func validJulianDay(tls *libc.TLS, iJD Sqlite3_int64) int32 { /* sqlite3.c:22126:12: */
+ return (libc.Bool32((iJD >= int64(0)) && (iJD <= ((I64((int64(0x1a640))) << 32) | int64(0x1072fdff)))))
}
// Compute the Year, Month, and Day from the julian day number.
-func computeYMD(tls *crt.TLS, p uintptr) { /* sqlite3.c:22088:13: */
+func computeYMD(tls *libc.TLS, p uintptr) { /* sqlite3.c:22133:13: */
var Z int32
var A int32
var B int32
@@ -10185,7 +10960,7 @@ func computeYMD(tls *crt.TLS, p uintptr) { /* sqlite3.c:22088:13: */
}
// Compute the Hour, Minute, and Seconds from the julian day number.
-func computeHMS(tls *crt.TLS, p uintptr) { /* sqlite3.c:22117:13: */
+func computeHMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22162:13: */
var s int32
if (*DateTime)(unsafe.Pointer(p)).FvalidHMS != 0 {
return
@@ -10204,13 +10979,13 @@ func computeHMS(tls *crt.TLS, p uintptr) { /* sqlite3.c:22117:13: */
}
// Compute both YMD and HMS
-func computeYMD_HMS(tls *crt.TLS, p uintptr) { /* sqlite3.c:22136:13: */
+func computeYMD_HMS(tls *libc.TLS, p uintptr) { /* sqlite3.c:22181:13: */
computeYMD(tls, p)
computeHMS(tls, p)
}
// Clear the YMD and HMS and the TZ
-func clearYMD_HMS_TZ(tls *crt.TLS, p uintptr) { /* sqlite3.c:22144:13: */
+func clearYMD_HMS_TZ(tls *libc.TLS, p uintptr) { /* sqlite3.c:22189:13: */
(*DateTime)(unsafe.Pointer(p)).FvalidYMD = int8(0)
(*DateTime)(unsafe.Pointer(p)).FvalidHMS = int8(0)
(*DateTime)(unsafe.Pointer(p)).FvalidTZ = int8(0)
@@ -10238,12 +11013,12 @@ func clearYMD_HMS_TZ(tls *crt.TLS, p uintptr) { /* sqlite3.c:22144:13: */
// EVIDENCE-OF: R-62172-00036 In this implementation, the standard C
// library function localtime_r() is used to assist in the calculation of
// local time.
-func osLocaltime(tls *crt.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:22182:12: */
+func osLocaltime(tls *libc.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:22227:12: */
var rc int32
var pX uintptr
var mutex uintptr = Xsqlite3MutexAlloc(tls, 2)
Xsqlite3_mutex_enter(tls, mutex)
- pX = crt.Xlocaltime(tls, t)
+ pX = libc.Xlocaltime(tls, t)
if Xsqlite3Config.FbLocaltimeFault != 0 {
pX = uintptr(0)
}
@@ -10251,7 +11026,7 @@ func osLocaltime(tls *crt.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:2218
*(*tm)(unsafe.Pointer(pTm)) = *(*tm)(unsafe.Pointer(pX))
}
Xsqlite3_mutex_leave(tls, mutex)
- rc = (crt.Bool32(pX == uintptr(0)))
+ rc = (libc.Bool32(pX == uintptr(0)))
return rc
}
@@ -10261,7 +11036,7 @@ func osLocaltime(tls *crt.TLS, t uintptr, pTm uintptr) int32 { /* sqlite3.c:2218
//
// Or, if an error does occur, set *pRc to SQLITE_ERROR. The returned value
// is undefined in this case.
-func localtimeOffset(tls *crt.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite3_int64 { /* sqlite3.c:22221:22: */
+func localtimeOffset(tls *libc.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite3_int64 { /* sqlite3.c:22266:22: */
bp := tls.Alloc(160)
defer tls.Free(160)
@@ -10274,7 +11049,7 @@ func localtimeOffset(tls *crt.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite3
// var sLocal tm at bp, 56
// Initialize the contents of sLocal to avoid a compiler warning.
- crt.Xmemset(tls, bp /* &sLocal */, 0, uint64(unsafe.Sizeof(tm{})))
+ libc.Xmemset(tls, bp /* &sLocal */, 0, uint64(unsafe.Sizeof(tm{})))
*(*DateTime)(unsafe.Pointer(bp + 56 /* x */)) = *(*DateTime)(unsafe.Pointer(p))
computeYMD_HMS(tls, bp+56 /* &x */)
@@ -10298,7 +11073,7 @@ func localtimeOffset(tls *crt.TLS, p uintptr, pCtx uintptr, pRc uintptr) Sqlite3
computeJD(tls, bp+56 /* &x */)
*(*Time_t)(unsafe.Pointer(bp + 104 /* t */)) = (Time_t(((*DateTime)(unsafe.Pointer(bp+56 /* &x */)).FiJD / int64(1000)) - (int64(21086676) * int64(10000))))
if osLocaltime(tls, bp+104 /* &t */, bp /* &sLocal */) != 0 {
- Xsqlite3_result_error(tls, pCtx, ts+273 /* "local time unava..." */, -1)
+ Xsqlite3_result_error(tls, pCtx, ts+387 /* "local time unava..." */, -1)
*(*int32)(unsafe.Pointer(pRc)) = 1
return int64(0)
}
@@ -10332,13 +11107,13 @@ var aXformType = [6]struct {
FrLimit float64
FrXform float64
}{
- {FeType: U8(0), FnName: U8(6), FzName: ts + 296 /* "second" */, FrLimit: 464269060800.0, FrXform: 1000.0},
- {FeType: U8(0), FnName: U8(6), FzName: ts + 303 /* "minute" */, FrLimit: 7737817680.0, FrXform: 60000.0},
- {FeType: U8(0), FnName: U8(4), FzName: ts + 310 /* "hour" */, FrLimit: 128963628.0, FrXform: 3600000.0},
- {FeType: U8(0), FnName: U8(3), FzName: ts + 315 /* "day" */, FrLimit: 5373485.0, FrXform: 86400000.0},
- {FeType: U8(1), FnName: U8(5), FzName: ts + 319 /* "month" */, FrLimit: 176546.0, FrXform: 2592000000.0},
- {FeType: U8(2), FnName: U8(4), FzName: ts + 325 /* "year" */, FrLimit: 14713.0, FrXform: 31536000000.0},
-} /* sqlite3.c:22292:3 */
+ {FeType: U8(0), FnName: U8(6), FzName: ts + 410 /* "second" */, FrLimit: 464269060800.0, FrXform: 1000.0},
+ {FeType: U8(0), FnName: U8(6), FzName: ts + 417 /* "minute" */, FrLimit: 7737817680.0, FrXform: 60000.0},
+ {FeType: U8(0), FnName: U8(4), FzName: ts + 424 /* "hour" */, FrLimit: 128963628.0, FrXform: 3600000.0},
+ {FeType: U8(0), FnName: U8(3), FzName: ts + 429 /* "day" */, FrLimit: 5373485.0, FrXform: 86400000.0},
+ {FeType: U8(1), FnName: U8(5), FzName: ts + 433 /* "month" */, FrLimit: 176546.0, FrXform: 2592000000.0},
+ {FeType: U8(2), FnName: U8(4), FzName: ts + 439 /* "year" */, FrLimit: 14713.0, FrXform: 31536000000.0},
+} /* sqlite3.c:22337:3 */
// Process a modifier to a date-time stamp. The modifiers are
// as follows:
@@ -10362,7 +11137,7 @@ var aXformType = [6]struct {
// is in a system call (i.e. localtime()), then an error message is written
// to context pCtx. If the error is an unrecognized modifier, no error is
// written to pCtx.
-func parseModifier(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) int32 { /* sqlite3.c:22325:12: */
+func parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) int32 { /* sqlite3.c:22370:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -10376,7 +11151,7 @@ func parseModifier(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) in
//
// Assuming the current time value is UTC (a.k.a. GMT), shift it to
// show local time.
- if (Xsqlite3_stricmp(tls, z, ts+330 /* "localtime" */) == 0) && (Xsqlite3NotPureFunc(tls, pCtx) != 0) {
+ if (Xsqlite3_stricmp(tls, z, ts+444 /* "localtime" */) == 0) && (Xsqlite3NotPureFunc(tls, pCtx) != 0) {
computeJD(tls, p)
*(*Sqlite3_int64)(unsafe.Pointer(p /* &.iJD */)) += (localtimeOffset(tls, p, pCtx, bp /* &rc */))
clearYMD_HMS_TZ(tls, p)
@@ -10389,7 +11164,7 @@ func parseModifier(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) in
//
// Treat the current value of p->s as the number of
// seconds since 1970. Convert to a real julian day number.
- if (Xsqlite3_stricmp(tls, z, ts+340 /* "unixepoch" */) == 0) && ((*DateTime)(unsafe.Pointer(p)).FrawS != 0) {
+ if (Xsqlite3_stricmp(tls, z, ts+454 /* "unixepoch" */) == 0) && ((*DateTime)(unsafe.Pointer(p)).FrawS != 0) {
*(*float64)(unsafe.Pointer(bp + 8 /* r */)) = (((*DateTime)(unsafe.Pointer(p)).Fs * 1000.0) + 210866760000000.0)
if (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) >= 0.0) && (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) < 464269060800000.0) {
clearYMD_HMS_TZ(tls, p)
@@ -10398,7 +11173,7 @@ func parseModifier(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) in
(*DateTime)(unsafe.Pointer(p)).FrawS = int8(0)
*(*int32)(unsafe.Pointer(bp /* rc */)) = 0
}
- } else if (Xsqlite3_stricmp(tls, z, ts+350 /* "utc" */) == 0) && (Xsqlite3NotPureFunc(tls, pCtx) != 0) {
+ } else if (Xsqlite3_stricmp(tls, z, ts+464 /* "utc" */) == 0) && (Xsqlite3NotPureFunc(tls, pCtx) != 0) {
if int32((*DateTime)(unsafe.Pointer(p)).FtzSet) == 0 {
var c1 Sqlite3_int64
computeJD(tls, p)
@@ -10422,9 +11197,9 @@ func parseModifier(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) in
// Move the date to the same time on the next occurrence of
// weekday N where 0==Sunday, 1==Monday, and so forth. If the
// date is already on the appropriate weekday, this is a no-op.
- if ((((Xsqlite3_strnicmp(tls, z, ts+354 /* "weekday " */, 8) == 0) &&
+ if ((((Xsqlite3_strnicmp(tls, z, ts+468 /* "weekday " */, 8) == 0) &&
(Xsqlite3AtoF(tls, (z+uintptr(8)), bp+8 /* &r */, Xsqlite3Strlen30(tls, (z+uintptr(8))), uint8(1)) > 0)) &&
- ((float64(crt.AssignInt32(&n, int32(*(*float64)(unsafe.Pointer(bp + 8 /* r */)))))) == *(*float64)(unsafe.Pointer(bp + 8 /* r */)))) && (n >= 0)) && (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) < float64(7)) {
+ ((float64(libc.AssignInt32(&n, int32(*(*float64)(unsafe.Pointer(bp + 8 /* r */)))))) == *(*float64)(unsafe.Pointer(bp + 8 /* r */)))) && (n >= 0)) && (*(*float64)(unsafe.Pointer(bp + 8 /* r */)) < float64(7)) {
var Z Sqlite3_int64
computeYMD_HMS(tls, p)
(*DateTime)(unsafe.Pointer(p)).FvalidTZ = int8(0)
@@ -10446,7 +11221,7 @@ func parseModifier(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) in
//
// Move the date backwards to the beginning of the current day,
// or month or year.
- if Xsqlite3_strnicmp(tls, z, ts+363 /* "start of " */, 9) != 0 {
+ if Xsqlite3_strnicmp(tls, z, ts+477 /* "start of " */, 9) != 0 {
break
}
if (!(int32((*DateTime)(unsafe.Pointer(p)).FvalidJD) != 0) && !(int32((*DateTime)(unsafe.Pointer(p)).FvalidYMD) != 0)) && !(int32((*DateTime)(unsafe.Pointer(p)).FvalidHMS) != 0) {
@@ -10455,19 +11230,19 @@ func parseModifier(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) in
z += uintptr(9)
computeYMD(tls, p)
(*DateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1)
- (*DateTime)(unsafe.Pointer(p)).Fh = crt.AssignPtrInt32(p+24 /* &.m */, 0)
+ (*DateTime)(unsafe.Pointer(p)).Fh = libc.AssignPtrInt32(p+24 /* &.m */, 0)
(*DateTime)(unsafe.Pointer(p)).Fs = 0.0
(*DateTime)(unsafe.Pointer(p)).FrawS = int8(0)
(*DateTime)(unsafe.Pointer(p)).FvalidTZ = int8(0)
(*DateTime)(unsafe.Pointer(p)).FvalidJD = int8(0)
- if Xsqlite3_stricmp(tls, z, ts+319 /* "month" */) == 0 {
+ if Xsqlite3_stricmp(tls, z, ts+433 /* "month" */) == 0 {
(*DateTime)(unsafe.Pointer(p)).FD = 1
*(*int32)(unsafe.Pointer(bp /* rc */)) = 0
- } else if Xsqlite3_stricmp(tls, z, ts+325 /* "year" */) == 0 {
+ } else if Xsqlite3_stricmp(tls, z, ts+439 /* "year" */) == 0 {
(*DateTime)(unsafe.Pointer(p)).FM = 1
(*DateTime)(unsafe.Pointer(p)).FD = 1
*(*int32)(unsafe.Pointer(bp /* rc */)) = 0
- } else if Xsqlite3_stricmp(tls, z, ts+315 /* "day" */) == 0 {
+ } else if Xsqlite3_stricmp(tls, z, ts+429 /* "day" */) == 0 {
*(*int32)(unsafe.Pointer(bp /* rc */)) = 0
}
break
@@ -10516,7 +11291,7 @@ func parseModifier(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) in
if !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z2)))]) & 0x04) != 0) {
z2++
}
- crt.Xmemset(tls, bp+16 /* &tx */, 0, uint64(unsafe.Sizeof(DateTime{})))
+ libc.Xmemset(tls, bp+16 /* &tx */, 0, uint64(unsafe.Sizeof(DateTime{})))
if parseHhMmSs(tls, z2, bp+16 /* &tx */) != 0 {
break
}
@@ -10616,16 +11391,16 @@ func parseModifier(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, p uintptr) in
//
// If there are zero parameters (if even argv[0] is undefined)
// then assume a default value of "now" for argv[0].
-func isDate(tls *crt.TLS, context uintptr, argc int32, argv uintptr, p uintptr) int32 { /* sqlite3.c:22542:12: */
+func isDate(tls *libc.TLS, context uintptr, argc int32, argv uintptr, p uintptr) int32 { /* sqlite3.c:22587:12: */
var i int32
var n int32
var z uintptr
var eType int32
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DateTime{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(DateTime{})))
if argc == 0 {
return setDateTimeToCurrent(tls, context, p)
}
- if ((crt.AssignInt32(&eType, Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))) == 2) ||
+ if ((libc.AssignInt32(&eType, Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))) == 2) ||
(eType == 1) {
setRawDateNumber(tls, p, Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
} else {
@@ -10654,7 +11429,7 @@ func isDate(tls *crt.TLS, context uintptr, argc int32, argv uintptr, p uintptr)
// julianday( TIMESTRING, MOD, MOD, ...)
//
// Return the julian day number of the date specified in the arguments
-func juliandayFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22585:13: */
+func juliandayFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22630:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -10669,7 +11444,7 @@ func juliandayFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
// datetime( TIMESTRING, MOD, MOD, ...)
//
// Return YYYY-MM-DD HH:MM:SS
-func datetimeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22602:13: */
+func datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22647:13: */
bp := tls.Alloc(196)
defer tls.Free(196)
@@ -10679,16 +11454,16 @@ func datetimeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
// var zBuf [100]int8 at bp+96, 100
computeYMD_HMS(tls, bp+48 /* &x */)
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+96 /* &zBuf[0] */, ts+373, /* "%04d-%02d-%02d %..." */
- crt.VaList(bp, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FY, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FM, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FD, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).Fh, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).Fm, int32((*DateTime)(unsafe.Pointer(bp+48 /* &x */)).Fs)))
- Xsqlite3_result_text(tls, context, bp+96 /* &zBuf[0] */, -1, crt.UintptrFromInt32(-1))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+96 /* &zBuf[0] */, ts+487, /* "%04d-%02d-%02d %..." */
+ libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FY, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FM, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).FD, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).Fh, (*DateTime)(unsafe.Pointer(bp+48 /* &x */)).Fm, int32((*DateTime)(unsafe.Pointer(bp+48 /* &x */)).Fs)))
+ Xsqlite3_result_text(tls, context, bp+96 /* &zBuf[0] */, -1, libc.UintptrFromInt32(-1))
}
}
// time( TIMESTRING, MOD, MOD, ...)
//
// Return HH:MM:SS
-func timeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22622:13: */
+func timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22667:13: */
bp := tls.Alloc(172)
defer tls.Free(172)
@@ -10698,15 +11473,15 @@ func timeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
// var zBuf [100]int8 at bp+72, 100
computeHMS(tls, bp+24 /* &x */)
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+403 /* "%02d:%02d:%02d" */, crt.VaList(bp, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).Fh, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).Fm, int32((*DateTime)(unsafe.Pointer(bp+24 /* &x */)).Fs)))
- Xsqlite3_result_text(tls, context, bp+72 /* &zBuf[0] */, -1, crt.UintptrFromInt32(-1))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+517 /* "%02d:%02d:%02d" */, libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).Fh, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).Fm, int32((*DateTime)(unsafe.Pointer(bp+24 /* &x */)).Fs)))
+ Xsqlite3_result_text(tls, context, bp+72 /* &zBuf[0] */, -1, libc.UintptrFromInt32(-1))
}
}
// date( TIMESTRING, MOD, MOD, ...)
//
// Return YYYY-MM-DD
-func dateFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22641:13: */
+func dateFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22686:13: */
bp := tls.Alloc(172)
defer tls.Free(172)
@@ -10716,8 +11491,8 @@ func dateFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
// var zBuf [100]int8 at bp+72, 100
computeYMD(tls, bp+24 /* &x */)
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+418 /* "%04d-%02d-%02d" */, crt.VaList(bp, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).FY, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).FM, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).FD))
- Xsqlite3_result_text(tls, context, bp+72 /* &zBuf[0] */, -1, crt.UintptrFromInt32(-1))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([100]int8{})), bp+72 /* &zBuf[0] */, ts+532 /* "%04d-%02d-%02d" */, libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).FY, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).FM, (*DateTime)(unsafe.Pointer(bp+24 /* &x */)).FD))
+ Xsqlite3_result_text(tls, context, bp+72 /* &zBuf[0] */, -1, libc.UintptrFromInt32(-1))
}
}
@@ -10738,11 +11513,11 @@ func dateFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
// %W week of year 00-53
// %Y year 0000-9999
// %% %
-func strftimeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22674:13: */
- bp := tls.Alloc(288)
- defer tls.Free(288)
+func strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:22719:13: */
+ bp := tls.Alloc(280)
+ defer tls.Free(280)
- // var x DateTime at bp+88, 48
+ // var x DateTime at bp+80, 48
var n U64
var i Size_t
@@ -10750,13 +11525,13 @@ func strftimeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
var z uintptr
var db uintptr
var zFmt uintptr
- // var zBuf [100]int8 at bp+136, 100
+ // var zBuf [100]int8 at bp+128, 100
if argc == 0 {
return
}
zFmt = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- if (zFmt == uintptr(0)) || (isDate(tls, context, (argc-1), (argv+uintptr(1)*8), bp+88 /* &x */) != 0) {
+ if (zFmt == uintptr(0)) || (isDate(tls, context, (argc-1), (argv+uintptr(1)*8), bp+80 /* &x */) != 0) {
return
}
db = Xsqlite3_context_db_handle(tls, context)
@@ -10822,7 +11597,7 @@ __3:
;
if n < U64(unsafe.Sizeof([100]int8{})) {
- z = bp + 136 /* &zBuf[0] */
+ z = bp + 128 /* &zBuf[0] */
} else if n > U64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(0)*4))) {
Xsqlite3_result_error_toobig(tls, context)
return
@@ -10833,32 +11608,32 @@ __3:
return
}
}
- computeJD(tls, bp+88 /* &x */)
- computeYMD_HMS(tls, bp+88 /* &x */)
- for i = crt.AssignUint64(&j, uint64(0)); *(*int8)(unsafe.Pointer(zFmt + uintptr(i))) != 0; i++ {
+ computeJD(tls, bp+80 /* &x */)
+ computeYMD_HMS(tls, bp+80 /* &x */)
+ for i = libc.AssignUint64(&j, uint64(0)); *(*int8)(unsafe.Pointer(zFmt + uintptr(i))) != 0; i++ {
if int32(*(*int8)(unsafe.Pointer(zFmt + uintptr(i)))) != '%' {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncUint64(&j, 1)))) = *(*int8)(unsafe.Pointer(zFmt + uintptr(i)))
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncUint64(&j, 1)))) = *(*int8)(unsafe.Pointer(zFmt + uintptr(i)))
} else {
i++
switch int32(*(*int8)(unsafe.Pointer(zFmt + uintptr(i)))) {
case 'd':
- Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+433 /* "%02d" */, crt.VaList(bp, (*DateTime)(unsafe.Pointer(bp+88 /* &x */)).FD))
+ Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+547 /* "%02d" */, libc.VaList(bp, (*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FD))
j = j + (uint64(2))
break
fallthrough
case 'f':
{
- var s float64 = (*DateTime)(unsafe.Pointer(bp + 88 /* &x */)).Fs
+ var s float64 = (*DateTime)(unsafe.Pointer(bp + 80 /* &x */)).Fs
if s > 59.999 {
s = 59.999
}
- Xsqlite3_snprintf(tls, 7, (z + uintptr(j)), ts+438 /* "%06.3f" */, crt.VaList(bp+8, s))
+ Xsqlite3_snprintf(tls, 7, (z + uintptr(j)), ts+552 /* "%06.3f" */, libc.VaList(bp+8, s))
j = j + (Size_t(Xsqlite3Strlen30(tls, (z + uintptr(j)))))
break
}
fallthrough
case 'H':
- Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+433 /* "%02d" */, crt.VaList(bp+16, (*DateTime)(unsafe.Pointer(bp+88 /* &x */)).Fh))
+ Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+547 /* "%02d" */, libc.VaList(bp+16, (*DateTime)(unsafe.Pointer(bp+80 /* &x */)).Fh))
j = j + (uint64(2))
break
fallthrough
@@ -10867,19 +11642,19 @@ __3:
case 'j':
{
var nDay int32 // Number of days since 1st day of year
- *(*DateTime)(unsafe.Pointer(bp + 240 /* y */)) = *(*DateTime)(unsafe.Pointer(bp + 88 /* x */))
- (*DateTime)(unsafe.Pointer(bp + 240 /* &y */)).FvalidJD = int8(0)
- (*DateTime)(unsafe.Pointer(bp + 240 /* &y */)).FM = 1
- (*DateTime)(unsafe.Pointer(bp + 240 /* &y */)).FD = 1
- computeJD(tls, bp+240 /* &y */)
- nDay = (int32((((*DateTime)(unsafe.Pointer(bp+88 /* &x */)).FiJD - (*DateTime)(unsafe.Pointer(bp+240 /* &y */)).FiJD) + int64(43200000)) / int64(86400000)))
+ *(*DateTime)(unsafe.Pointer(bp + 232 /* y */)) = *(*DateTime)(unsafe.Pointer(bp + 80 /* x */))
+ (*DateTime)(unsafe.Pointer(bp + 232 /* &y */)).FvalidJD = int8(0)
+ (*DateTime)(unsafe.Pointer(bp + 232 /* &y */)).FM = 1
+ (*DateTime)(unsafe.Pointer(bp + 232 /* &y */)).FD = 1
+ computeJD(tls, bp+232 /* &y */)
+ nDay = (int32((((*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FiJD - (*DateTime)(unsafe.Pointer(bp+232 /* &y */)).FiJD) + int64(43200000)) / int64(86400000)))
if int32(*(*int8)(unsafe.Pointer(zFmt + uintptr(i)))) == 'W' {
var wd int32 // 0=Monday, 1=Tuesday, ... 6=Sunday
- wd = (int32((((*DateTime)(unsafe.Pointer(bp+88 /* &x */)).FiJD + int64(43200000)) / int64(86400000)) % int64(7)))
- Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+433 /* "%02d" */, crt.VaList(bp+24, (((nDay+7)-wd)/7)))
+ wd = (int32((((*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FiJD + int64(43200000)) / int64(86400000)) % int64(7)))
+ Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+547 /* "%02d" */, libc.VaList(bp+24, (((nDay+7)-wd)/7)))
j = j + (uint64(2))
} else {
- Xsqlite3_snprintf(tls, 4, (z + uintptr(j)), ts+445 /* "%03d" */, crt.VaList(bp+32, (nDay+1)))
+ Xsqlite3_snprintf(tls, 4, (z + uintptr(j)), ts+559 /* "%03d" */, libc.VaList(bp+32, (nDay+1)))
j = j + (uint64(3))
}
break
@@ -10887,49 +11662,49 @@ __3:
fallthrough
case 'J':
{
- Xsqlite3_snprintf(tls, 20, (z + uintptr(j)), ts+450 /* "%.16g" */, crt.VaList(bp+40, (float64((*DateTime)(unsafe.Pointer(bp+88 /* &x */)).FiJD)/86400000.0)))
+ Xsqlite3_snprintf(tls, 20, (z + uintptr(j)), ts+564 /* "%.16g" */, libc.VaList(bp+40, (float64((*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FiJD)/86400000.0)))
j = j + (Size_t(Xsqlite3Strlen30(tls, (z + uintptr(j)))))
break
}
fallthrough
case 'm':
- Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+433 /* "%02d" */, crt.VaList(bp+48, (*DateTime)(unsafe.Pointer(bp+88 /* &x */)).FM))
+ Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+547 /* "%02d" */, libc.VaList(bp+48, (*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FM))
j = j + (uint64(2))
break
fallthrough
case 'M':
- Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+433 /* "%02d" */, crt.VaList(bp+56, (*DateTime)(unsafe.Pointer(bp+88 /* &x */)).Fm))
+ Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+547 /* "%02d" */, libc.VaList(bp+56, (*DateTime)(unsafe.Pointer(bp+80 /* &x */)).Fm))
j = j + (uint64(2))
break
fallthrough
case 's':
{
- Xsqlite3_snprintf(tls, 30, (z + uintptr(j)), ts+456, /* "%lld" */
- crt.VaList(bp+64, (((*DateTime)(unsafe.Pointer(bp+88 /* &x */)).FiJD/int64(1000))-(int64(21086676)*int64(10000)))))
+ var iS I64 = (((*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FiJD / int64(1000)) - (int64(21086676) * int64(10000)))
+ Xsqlite3Int64ToText(tls, iS, (z + uintptr(j)))
j = j + (Size_t(Xsqlite3Strlen30(tls, (z + uintptr(j)))))
break
}
fallthrough
case 'S':
- Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+433 /* "%02d" */, crt.VaList(bp+72, int32((*DateTime)(unsafe.Pointer(bp+88 /* &x */)).Fs)))
+ Xsqlite3_snprintf(tls, 3, (z + uintptr(j)), ts+547 /* "%02d" */, libc.VaList(bp+64, int32((*DateTime)(unsafe.Pointer(bp+80 /* &x */)).Fs)))
j = j + (uint64(2))
break
fallthrough
case 'w':
{
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncUint64(&j, 1)))) = (int8(int32((int8((((*DateTime)(unsafe.Pointer(bp+88 /* &x */)).FiJD + int64(129600000)) / int64(86400000)) % int64(7)))) + '0'))
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncUint64(&j, 1)))) = (int8(int32((int8((((*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FiJD + int64(129600000)) / int64(86400000)) % int64(7)))) + '0'))
break
}
fallthrough
case 'Y':
{
- Xsqlite3_snprintf(tls, 5, (z + uintptr(j)), ts+461 /* "%04d" */, crt.VaList(bp+80, (*DateTime)(unsafe.Pointer(bp+88 /* &x */)).FY))
+ Xsqlite3_snprintf(tls, 5, (z + uintptr(j)), ts+570 /* "%04d" */, libc.VaList(bp+72, (*DateTime)(unsafe.Pointer(bp+80 /* &x */)).FY))
j = j + (Size_t(Xsqlite3Strlen30(tls, (z + uintptr(j)))))
break
}
fallthrough
default:
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncUint64(&j, 1)))) = int8('%')
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncUint64(&j, 1)))) = int8('%')
break
}
}
@@ -10937,17 +11712,17 @@ __3:
*(*int8)(unsafe.Pointer(z + uintptr(j))) = int8(0)
Xsqlite3_result_text(tls, context, z, -1,
func() uintptr {
- if z == bp+136 /* zBuf */ {
- return crt.UintptrFromInt32(-1)
+ if z == bp+128 /* zBuf */ {
+ return libc.UintptrFromInt32(-1)
}
- return *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{Xsqlite3MallocSize}))
+ return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))
}())
}
// current_time()
//
// This function returns the same value as time('now').
-func ctimeFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:22812:13: */
+func ctimeFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:22857:13: */
_ = NotUsed
_ = NotUsed2
timeFunc(tls, context, 0, uintptr(0))
@@ -10956,7 +11731,7 @@ func ctimeFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) {
// current_date()
//
// This function returns the same value as date('now').
-func cdateFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:22826:13: */
+func cdateFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:22871:13: */
_ = NotUsed
_ = NotUsed2
dateFunc(tls, context, 0, uintptr(0))
@@ -10965,7 +11740,7 @@ func cdateFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) {
// current_timestamp()
//
// This function returns the same value as datetime('now').
-func ctimestampFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:22840:13: */
+func ctimestampFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:22885:13: */
_ = NotUsed
_ = NotUsed2
datetimeFunc(tls, context, 0, uintptr(0))
@@ -10974,20 +11749,20 @@ func ctimestampFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintp
// This function registered all of the above C functions as SQL
// functions. This should be the only routine in this file with
// external linkage.
-func Xsqlite3RegisterDateTimeFunctions(tls *crt.TLS) { /* sqlite3.c:22900:21: */
+func Xsqlite3RegisterDateTimeFunctions(tls *libc.TLS) { /* sqlite3.c:22945:21: */
Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aDateTimeFuncs)), (int32(uint64(unsafe.Sizeof(aDateTimeFuncs)) / uint64(unsafe.Sizeof(FuncDef{})))))
}
var aDateTimeFuncs = [8]FuncDef{
- {FnArg: int8(-1), FfuncFlags: (U32((0x2000 | 1) | 0x0800)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 466 /* "julianday" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(-1), FfuncFlags: (U32((0x2000 | 1) | 0x0800)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 476 /* "date" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(-1), FfuncFlags: (U32((0x2000 | 1) | 0x0800)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 481 /* "time" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(-1), FfuncFlags: (U32((0x2000 | 1) | 0x0800)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 486 /* "datetime" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(-1), FfuncFlags: (U32((0x2000 | 1) | 0x0800)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 495 /* "strftime" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 504 /* "current_time" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 517 /* "current_timestam..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 535 /* "current_date" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
-} /* sqlite3.c:22901:18 */
+ {FnArg: int8(-1), FfuncFlags: (U32((0x2000 | 1) | 0x0800)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 575 /* "julianday" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(-1), FfuncFlags: (U32((0x2000 | 1) | 0x0800)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 585 /* "date" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(-1), FfuncFlags: (U32((0x2000 | 1) | 0x0800)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 590 /* "time" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(-1), FfuncFlags: (U32((0x2000 | 1) | 0x0800)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 595 /* "datetime" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(-1), FfuncFlags: (U32((0x2000 | 1) | 0x0800)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 604 /* "strftime" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 613 /* "current_time" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 626 /* "current_timestam..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 644 /* "current_date" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+} /* sqlite3.c:22946:18 */
//************* End of date.c ***********************************************
//************* Begin file os.c *********************************************
@@ -11009,16 +11784,16 @@ var aDateTimeFuncs = [8]FuncDef{
// If we compile with the SQLITE_TEST macro set, then the following block
// of code will give us the ability to simulate a disk I/O error. This
// is used for testing the I/O recovery logic.
-var Xsqlite3_io_error_hit int32 = 0 /* sqlite3.c:22945:16 */ // Total number of I/O Errors
-var Xsqlite3_io_error_hardhit int32 = 0 /* sqlite3.c:22946:16 */ // Number of non-benign errors
-var Xsqlite3_io_error_pending int32 = 0 /* sqlite3.c:22947:16 */ // Count down to first I/O error
-var Xsqlite3_io_error_persist int32 = 0 /* sqlite3.c:22948:16 */ // True if I/O errors persist
-var Xsqlite3_io_error_benign int32 = 0 /* sqlite3.c:22949:16 */ // True if errors are benign
-var Xsqlite3_diskfull_pending int32 = 0 /* sqlite3.c:22950:16 */
-var Xsqlite3_diskfull int32 = 0 /* sqlite3.c:22951:16 */
+var Xsqlite3_io_error_hit int32 = 0 /* sqlite3.c:22990:16 */ // Total number of I/O Errors
+var Xsqlite3_io_error_hardhit int32 = 0 /* sqlite3.c:22991:16 */ // Number of non-benign errors
+var Xsqlite3_io_error_pending int32 = 0 /* sqlite3.c:22992:16 */ // Count down to first I/O error
+var Xsqlite3_io_error_persist int32 = 0 /* sqlite3.c:22993:16 */ // True if I/O errors persist
+var Xsqlite3_io_error_benign int32 = 0 /* sqlite3.c:22994:16 */ // True if errors are benign
+var Xsqlite3_diskfull_pending int32 = 0 /* sqlite3.c:22995:16 */
+var Xsqlite3_diskfull int32 = 0 /* sqlite3.c:22996:16 */
// When testing, also keep a count of the number of open files.
-var Xsqlite3_open_file_count int32 = 0 /* sqlite3.c:22958:16 */
+var Xsqlite3_open_file_count int32 = 0 /* sqlite3.c:23003:16 */
// The default SQLite sqlite3_vfs implementations do not allocate
// memory (actually, os_unix.c allocates a small amount of memory
@@ -11042,19 +11817,19 @@ var Xsqlite3_open_file_count int32 = 0 /* sqlite3.c:22958:16 */
// sqlite3OsAccess()
// sqlite3OsFullPathname()
//
-var Xsqlite3_memdebug_vfs_oom_test int32 = 1 /* sqlite3.c:22986:16 */
+var Xsqlite3_memdebug_vfs_oom_test int32 = 1 /* sqlite3.c:23031:16 */
// The following routines are convenience wrappers around methods
// of the sqlite3_file object. This is mostly just syntactic sugar. All
// of this would be completely automatic if SQLite were coded using
// C++ instead of plain old C.
-func Xsqlite3OsClose(tls *crt.TLS, pId uintptr) { /* sqlite3.c:23003:21: */
+func Xsqlite3OsClose(tls *libc.TLS, pId uintptr) { /* sqlite3.c:23048:21: */
if (*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 {
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods + 8 /* &.xClose */))))(tls, pId)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods + 8 /* &.xClose */))))(tls, pId)
(*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0)
}
}
-func Xsqlite3OsRead(tls *crt.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23009:20: */
+func Xsqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23054:20: */
if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) {
var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10))
if !(pTstAlloc != 0) {
@@ -11063,9 +11838,9 @@ func Xsqlite3OsRead(tls *crt.TLS, id uintptr, pBuf uintptr, amt int32, offset I6
Xsqlite3_free(tls, pTstAlloc)
}
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 16 /* &.xRead */))))(tls, id, pBuf, amt, offset)
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 16 /* &.xRead */))))(tls, id, pBuf, amt, offset)
}
-func Xsqlite3OsWrite(tls *crt.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23013:20: */
+func Xsqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32 { /* sqlite3.c:23058:20: */
if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) {
var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10))
if !(pTstAlloc != 0) {
@@ -11074,12 +11849,12 @@ func Xsqlite3OsWrite(tls *crt.TLS, id uintptr, pBuf uintptr, amt int32, offset I
Xsqlite3_free(tls, pTstAlloc)
}
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 24 /* &.xWrite */))))(tls, id, pBuf, amt, offset)
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 24 /* &.xWrite */))))(tls, id, pBuf, amt, offset)
}
-func Xsqlite3OsTruncate(tls *crt.TLS, id uintptr, size I64) int32 { /* sqlite3.c:23017:20: */
- return (*(*func(*crt.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 32 /* &.xTruncate */))))(tls, id, size)
+func Xsqlite3OsTruncate(tls *libc.TLS, id uintptr, size I64) int32 { /* sqlite3.c:23062:20: */
+ return (*(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 32 /* &.xTruncate */))))(tls, id, size)
}
-func Xsqlite3OsSync(tls *crt.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:23020:20: */
+func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:23065:20: */
if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) {
var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10))
if !(pTstAlloc != 0) {
@@ -11089,11 +11864,11 @@ func Xsqlite3OsSync(tls *crt.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:
}
if flags != 0 {
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 40 /* &.xSync */))))(tls, id, flags)
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 40 /* &.xSync */))))(tls, id, flags)
}
return 0
}
-func Xsqlite3OsFileSize(tls *crt.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:23024:20: */
+func Xsqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:23069:20: */
if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) {
var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10))
if !(pTstAlloc != 0) {
@@ -11102,9 +11877,9 @@ func Xsqlite3OsFileSize(tls *crt.TLS, id uintptr, pSize uintptr) int32 { /* sqli
Xsqlite3_free(tls, pTstAlloc)
}
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 48 /* &.xFileSize */))))(tls, id, pSize)
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 48 /* &.xFileSize */))))(tls, id, pSize)
}
-func Xsqlite3OsLock(tls *crt.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23028:20: */
+func Xsqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23073:20: */
if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) {
var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10))
if !(pTstAlloc != 0) {
@@ -11113,12 +11888,12 @@ func Xsqlite3OsLock(tls *crt.TLS, id uintptr, lockType int32) int32 { /* sqlite3
Xsqlite3_free(tls, pTstAlloc)
}
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 56 /* &.xLock */))))(tls, id, lockType)
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 56 /* &.xLock */))))(tls, id, lockType)
}
-func Xsqlite3OsUnlock(tls *crt.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23032:20: */
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 64 /* &.xUnlock */))))(tls, id, lockType)
+func Xsqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) int32 { /* sqlite3.c:23077:20: */
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 64 /* &.xUnlock */))))(tls, id, lockType)
}
-func Xsqlite3OsCheckReservedLock(tls *crt.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:23035:20: */
+func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:23080:20: */
if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) {
var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10))
if !(pTstAlloc != 0) {
@@ -11127,7 +11902,7 @@ func Xsqlite3OsCheckReservedLock(tls *crt.TLS, id uintptr, pResOut uintptr) int3
Xsqlite3_free(tls, pTstAlloc)
}
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, id, pResOut)
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, id, pResOut)
}
// Use sqlite3OsFileControl() when we are doing something that might fail
@@ -11136,7 +11911,7 @@ func Xsqlite3OsCheckReservedLock(tls *crt.TLS, id uintptr, pResOut uintptr) int3
// really care if the VFS receives and understands the information since it
// is only a hint and can be safely ignored. The sqlite3OsFileControlHint()
// routine has no return value since the return value would be meaningless.
-func Xsqlite3OsFileControl(tls *crt.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:23048:20: */
+func Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:23093:20: */
if (*Sqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) {
return 12
}
@@ -11160,36 +11935,36 @@ func Xsqlite3OsFileControl(tls *crt.TLS, id uintptr, op int32, pArg uintptr) int
Xsqlite3_free(tls, pTstAlloc)
}
}
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 80 /* &.xFileControl */))))(tls, id, op, pArg)
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 80 /* &.xFileControl */))))(tls, id, op, pArg)
}
-func Xsqlite3OsFileControlHint(tls *crt.TLS, id uintptr, op int32, pArg uintptr) { /* sqlite3.c:23069:21: */
+func Xsqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { /* sqlite3.c:23114:21: */
if (*Sqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 {
- (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 80 /* &.xFileControl */))))(tls, id, op, pArg)
+ (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 80 /* &.xFileControl */))))(tls, id, op, pArg)
}
}
-func Xsqlite3OsSectorSize(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:23073:20: */
+func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23118:20: */
var xSectorSize uintptr = (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize
return func() int32 {
if xSectorSize != 0 {
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(&xSectorSize)))(tls, id)
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&xSectorSize)))(tls, id)
}
return 4096
}()
}
-func Xsqlite3OsDeviceCharacteristics(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:23077:20: */
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, id)
+func Xsqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:23122:20: */
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, id)
}
-func Xsqlite3OsShmLock(tls *crt.TLS, id uintptr, offset int32, n int32, flags int32) int32 { /* sqlite3.c:23081:20: */
- return (*(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 112 /* &.xShmLock */))))(tls, id, offset, n, flags)
+func Xsqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) int32 { /* sqlite3.c:23126:20: */
+ return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 112 /* &.xShmLock */))))(tls, id, offset, n, flags)
}
-func Xsqlite3OsShmBarrier(tls *crt.TLS, id uintptr) { /* sqlite3.c:23084:21: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 120 /* &.xShmBarrier */))))(tls, id)
+func Xsqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { /* sqlite3.c:23129:21: */
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 120 /* &.xShmBarrier */))))(tls, id)
}
-func Xsqlite3OsShmUnmap(tls *crt.TLS, id uintptr, deleteFlag int32) int32 { /* sqlite3.c:23087:20: */
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 128 /* &.xShmUnmap */))))(tls, id, deleteFlag)
+func Xsqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) int32 { /* sqlite3.c:23132:20: */
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 128 /* &.xShmUnmap */))))(tls, id, deleteFlag)
}
-func Xsqlite3OsShmMap(tls *crt.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:23090:20: */
+func Xsqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:23135:20: */
if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) {
var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10))
if !(pTstAlloc != 0) {
@@ -11198,11 +11973,11 @@ func Xsqlite3OsShmMap(tls *crt.TLS, id uintptr, iPage int32, pgsz int32, bExtend
Xsqlite3_free(tls, pTstAlloc)
}
- return (*(*func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 104 /* &.xShmMap */))))(tls, id, iPage, pgsz, bExtend, pp)
+ return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 104 /* &.xShmMap */))))(tls, id, iPage, pgsz, bExtend, pp)
}
// The real implementation of xFetch and xUnfetch
-func Xsqlite3OsFetch(tls *crt.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:23104:20: */
+func Xsqlite3OsFetch(tls *libc.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:23149:20: */
if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(id != 0) || !(Xsqlite3JournalIsInMemory(tls, id) != 0)) {
var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10))
if !(pTstAlloc != 0) {
@@ -11211,15 +11986,15 @@ func Xsqlite3OsFetch(tls *crt.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr)
Xsqlite3_free(tls, pTstAlloc)
}
- return (*(*func(*crt.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 136 /* &.xFetch */))))(tls, id, iOff, iAmt, pp)
+ return (*(*func(*libc.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 136 /* &.xFetch */))))(tls, id, iOff, iAmt, pp)
}
-func Xsqlite3OsUnfetch(tls *crt.TLS, id uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:23108:20: */
- return (*(*func(*crt.TLS, uintptr, Sqlite3_int64, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 144 /* &.xUnfetch */))))(tls, id, iOff, p)
+func Xsqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:23153:20: */
+ return (*(*func(*libc.TLS, uintptr, Sqlite3_int64, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(id)).FpMethods + 144 /* &.xUnfetch */))))(tls, id, iOff, p)
}
// The next group of routines are convenience wrappers around the
// VFS methods.
-func Xsqlite3OsOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pFlagsOut uintptr) int32 { /* sqlite3.c:23126:20: */
+func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pFlagsOut uintptr) int32 { /* sqlite3.c:23171:20: */
var rc int32
if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(0 != 0) || !(Xsqlite3JournalIsInMemory(tls, uintptr(0)) != 0)) {
var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10))
@@ -11233,11 +12008,11 @@ func Xsqlite3OsOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, fl
// down into the VFS layer. Some SQLITE_OPEN_ flags (for example,
// SQLITE_OPEN_FULLMUTEX or SQLITE_OPEN_SHAREDCACHE) are blocked before
// reaching the VFS.
- rc = (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 40 /* &.xOpen */))))(tls, pVfs, zPath, pFile, (flags & 0x1087f7f), pFlagsOut)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 40 /* &.xOpen */))))(tls, pVfs, zPath, pFile, (flags & 0x1087f7f), pFlagsOut)
return rc
}
-func Xsqlite3OsDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:23143:20: */
+func Xsqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:23188:20: */
if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(0 != 0) || !(Xsqlite3JournalIsInMemory(tls, uintptr(0)) != 0)) {
var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10))
if !(pTstAlloc != 0) {
@@ -11246,9 +12021,9 @@ func Xsqlite3OsDelete(tls *crt.TLS, pVfs uintptr, zPath uintptr, dirSync int32)
Xsqlite3_free(tls, pTstAlloc)
}
- return (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pVfs + 48 /* &.xDelete */))))(tls, pVfs, zPath, dirSync)
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pVfs + 48 /* &.xDelete */))))(tls, pVfs, zPath, dirSync)
}
-func Xsqlite3OsAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:23148:20: */
+func Xsqlite3OsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:23193:20: */
if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(0 != 0) || !(Xsqlite3JournalIsInMemory(tls, uintptr(0)) != 0)) {
var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10))
if !(pTstAlloc != 0) {
@@ -11257,9 +12032,9 @@ func Xsqlite3OsAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pR
Xsqlite3_free(tls, pTstAlloc)
}
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 56 /* &.xAccess */))))(tls, pVfs, zPath, flags, pResOut)
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 56 /* &.xAccess */))))(tls, pVfs, zPath, flags, pResOut)
}
-func Xsqlite3OsFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* sqlite3.c:23157:20: */
+func Xsqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32 { /* sqlite3.c:23202:20: */
if (Xsqlite3_memdebug_vfs_oom_test != 0) && (!(0 != 0) || !(Xsqlite3JournalIsInMemory(tls, uintptr(0)) != 0)) {
var pTstAlloc uintptr = Xsqlite3Malloc(tls, uint64(10))
if !(pTstAlloc != 0) {
@@ -11269,44 +12044,44 @@ func Xsqlite3OsFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nPathOut
}
*(*int8)(unsafe.Pointer(zPathOut + uintptr(0))) = int8(0)
- return (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 64 /* &.xFullPathname */))))(tls, pVfs, zPath, nPathOut, zPathOut)
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 64 /* &.xFullPathname */))))(tls, pVfs, zPath, nPathOut, zPathOut)
}
-func Xsqlite3OsDlOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:23168:21: */
- return (*(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 72 /* &.xDlOpen */))))(tls, pVfs, zPath)
+func Xsqlite3OsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:23213:21: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 72 /* &.xDlOpen */))))(tls, pVfs, zPath)
}
-func Xsqlite3OsDlError(tls *crt.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) { /* sqlite3.c:23171:21: */
- (*(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pVfs + 80 /* &.xDlError */))))(tls, pVfs, nByte, zBufOut)
+func Xsqlite3OsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) { /* sqlite3.c:23216:21: */
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pVfs + 80 /* &.xDlError */))))(tls, pVfs, nByte, zBufOut)
}
-func Xsqlite3OsDlSym(tls *crt.TLS, pVfs uintptr, pHdle uintptr, zSym uintptr) uintptr { /* sqlite3.c:23174:21: */
- return (*(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 88 /* &.xDlSym */))))(tls, pVfs, pHdle, zSym)
+func Xsqlite3OsDlSym(tls *libc.TLS, pVfs uintptr, pHdle uintptr, zSym uintptr) uintptr { /* sqlite3.c:23219:21: */
+ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 88 /* &.xDlSym */))))(tls, pVfs, pHdle, zSym)
}
-func Xsqlite3OsDlClose(tls *crt.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:23177:21: */
- (*(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer((pVfs + 96 /* &.xDlClose */))))(tls, pVfs, pHandle)
+func Xsqlite3OsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:23222:21: */
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pVfs + 96 /* &.xDlClose */))))(tls, pVfs, pHandle)
}
-func Xsqlite3OsRandomness(tls *crt.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:23181:20: */
+func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:23226:20: */
if Xsqlite3Config.FiPrngSeed != 0 {
- crt.Xmemset(tls, zBufOut, 0, uint64(nByte))
+ libc.Xmemset(tls, zBufOut, 0, uint64(nByte))
if nByte > int32(unsafe.Sizeof(uint32(0))) {
nByte = int32(unsafe.Sizeof(uint32(0)))
}
- crt.Xmemcpy(tls, zBufOut, (uintptr(unsafe.Pointer(&Xsqlite3Config)) + 420 /* &.iPrngSeed */), uint64(nByte))
+ libc.Xmemcpy(tls, zBufOut, (uintptr(unsafe.Pointer(&Xsqlite3Config)) + 420 /* &.iPrngSeed */), uint64(nByte))
return 0
} else {
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 104 /* &.xRandomness */))))(tls, pVfs, nByte, zBufOut)
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 104 /* &.xRandomness */))))(tls, pVfs, nByte, zBufOut)
}
return int32(0)
}
-func Xsqlite3OsSleep(tls *crt.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:23192:20: */
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((pVfs + 112 /* &.xSleep */))))(tls, pVfs, nMicro)
+func Xsqlite3OsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:23237:20: */
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pVfs + 112 /* &.xSleep */))))(tls, pVfs, nMicro)
}
-func Xsqlite3OsGetLastError(tls *crt.TLS, pVfs uintptr) int32 { /* sqlite3.c:23195:20: */
+func Xsqlite3OsGetLastError(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23240:20: */
if (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxGetLastError != 0 {
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 128 /* &.xGetLastError */))))(tls, pVfs, 0, uintptr(0))
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pVfs + 128 /* &.xGetLastError */))))(tls, pVfs, 0, uintptr(0))
}
return 0
}
-func Xsqlite3OsCurrentTimeInt64(tls *crt.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:23198:20: */
+func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:23243:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -11317,17 +12092,17 @@ func Xsqlite3OsCurrentTimeInt64(tls *crt.TLS, pVfs uintptr, pTimeOut uintptr) in
// will fall back to xCurrentTime() if xCurrentTimeInt64() is
// unavailable.
if ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FiVersion >= 2) && ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64 != 0) {
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, pVfs, pTimeOut)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, pVfs, pTimeOut)
} else {
// var r float64 at bp, 8
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 120 /* &.xCurrentTime */))))(tls, pVfs, bp /* &r */)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pVfs + 120 /* &.xCurrentTime */))))(tls, pVfs, bp /* &r */)
*(*Sqlite3_int64)(unsafe.Pointer(pTimeOut)) = (Sqlite3_int64(*(*float64)(unsafe.Pointer(bp /* r */)) * 86400000.0))
}
return rc
}
-func Xsqlite3OsOpenMalloc(tls *crt.TLS, pVfs uintptr, zFile uintptr, ppFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:23216:20: */
+func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:23261:20: */
var rc int32
var pFile uintptr
pFile = Xsqlite3MallocZero(tls, uint64((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))
@@ -11343,7 +12118,7 @@ func Xsqlite3OsOpenMalloc(tls *crt.TLS, pVfs uintptr, zFile uintptr, ppFile uint
}
return rc
}
-func Xsqlite3OsCloseFree(tls *crt.TLS, pFile uintptr) { /* sqlite3.c:23238:21: */
+func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:23283:21: */
Xsqlite3OsClose(tls, pFile)
Xsqlite3_free(tls, pFile)
@@ -11353,7 +12128,7 @@ func Xsqlite3OsCloseFree(tls *crt.TLS, pFile uintptr) { /* sqlite3.c:23238:21: *
// sqlite3_os_init(). The purpose of the wrapper is to provide the
// ability to simulate a malloc failure, so that the handling of an
// error in sqlite3_os_init() by the upper layers can be tested.
-func Xsqlite3OsInit(tls *crt.TLS) int32 { /* sqlite3.c:23250:20: */
+func Xsqlite3OsInit(tls *libc.TLS) int32 { /* sqlite3.c:23295:20: */
var p uintptr = Xsqlite3_malloc(tls, 10)
if p == uintptr(0) {
return 7
@@ -11363,11 +12138,11 @@ func Xsqlite3OsInit(tls *crt.TLS) int32 { /* sqlite3.c:23250:20: */
}
// The list of all registered VFS implementations.
-var vfsList uintptr = uintptr(0) /* sqlite3.c:23260:20 */
+var vfsList uintptr = uintptr(0) /* sqlite3.c:23305:20 */
// Locate a VFS by name. If no name is given, simply return the
// first VFS on the list.
-func Xsqlite3_vfs_find(tls *crt.TLS, zVfs uintptr) uintptr { /* sqlite3.c:23267:24: */
+func Xsqlite3_vfs_find(tls *libc.TLS, zVfs uintptr) uintptr { /* sqlite3.c:23312:24: */
var pVfs uintptr = uintptr(0)
var mutex uintptr
var rc int32 = Xsqlite3_initialize(tls)
@@ -11380,7 +12155,7 @@ func Xsqlite3_vfs_find(tls *crt.TLS, zVfs uintptr) uintptr { /* sqlite3.c:23267:
if zVfs == uintptr(0) {
break
}
- if crt.Xstrcmp(tls, zVfs, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName) == 0 {
+ if libc.Xstrcmp(tls, zVfs, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName) == 0 {
break
}
}
@@ -11389,7 +12164,7 @@ func Xsqlite3_vfs_find(tls *crt.TLS, zVfs uintptr) uintptr { /* sqlite3.c:23267:
}
// Unlink a VFS from the linked list
-func vfsUnlink(tls *crt.TLS, pVfs uintptr) { /* sqlite3.c:23291:13: */
+func vfsUnlink(tls *libc.TLS, pVfs uintptr) { /* sqlite3.c:23336:13: */
if pVfs == uintptr(0) {
} else if vfsList == pVfs {
@@ -11408,7 +12183,7 @@ func vfsUnlink(tls *crt.TLS, pVfs uintptr) { /* sqlite3.c:23291:13: */
// Register a VFS with the system. It is harmless to register the same
// VFS multiple times. The new VFS becomes the default if makeDflt is
// true.
-func Xsqlite3_vfs_register(tls *crt.TLS, pVfs uintptr, makeDflt int32) int32 { /* sqlite3.c:23313:16: */
+func Xsqlite3_vfs_register(tls *libc.TLS, pVfs uintptr, makeDflt int32) int32 { /* sqlite3.c:23358:16: */
var mutex uintptr
var rc int32 = Xsqlite3_initialize(tls)
if rc != 0 {
@@ -11431,7 +12206,7 @@ func Xsqlite3_vfs_register(tls *crt.TLS, pVfs uintptr, makeDflt int32) int32 { /
}
// Unregister a VFS so that it is no longer accessible.
-func Xsqlite3_vfs_unregister(tls *crt.TLS, pVfs uintptr) int32 { /* sqlite3.c:23341:16: */
+func Xsqlite3_vfs_unregister(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:23386:16: */
var mutex uintptr
var rc int32 = Xsqlite3_initialize(tls)
if rc != 0 {
@@ -11507,8 +12282,8 @@ type BenignMallocHooks1 = struct {
// #include "sqliteInt.h"
// Global variables.
-type BenignMallocHooks = BenignMallocHooks1 /* sqlite3.c:23389:34 */
-var sqlite3Hooks = BenignMallocHooks1{FxBenignBegin: uintptr(0), FxBenignEnd: uintptr(0)} /* sqlite3.c:23393:3 */
+type BenignMallocHooks = BenignMallocHooks1 /* sqlite3.c:23434:34 */
+var sqlite3Hooks = BenignMallocHooks1{FxBenignBegin: uintptr(0), FxBenignEnd: uintptr(0)} /* sqlite3.c:23438:3 */
// The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks
// structure. If writable static data is unsupported on the target,
@@ -11518,7 +12293,7 @@ var sqlite3Hooks = BenignMallocHooks1{FxBenignBegin: uintptr(0), FxBenignEnd: ui
// Register hooks to call when sqlite3BeginBenignMalloc() and
// sqlite3EndBenignMalloc() are called, respectively.
-func Xsqlite3BenignMallocHooks(tls *crt.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { /* sqlite3.c:23415:21: */
+func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { /* sqlite3.c:23460:21: */
sqlite3Hooks.FxBenignBegin = xBenignBegin
sqlite3Hooks.FxBenignEnd = xBenignEnd
@@ -11527,16 +12302,16 @@ func Xsqlite3BenignMallocHooks(tls *crt.TLS, xBenignBegin uintptr, xBenignEnd ui
// This (sqlite3EndBenignMalloc()) is called by SQLite code to indicate that
// subsequent malloc failures are benign. A call to sqlite3EndBenignMalloc()
// indicates that subsequent malloc failures are non-benign.
-func Xsqlite3BeginBenignMalloc(tls *crt.TLS) { /* sqlite3.c:23429:21: */
+func Xsqlite3BeginBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23474:21: */
if sqlite3Hooks.FxBenignBegin != 0 {
- (*(*func(*crt.TLS))(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Hooks)) /* &.xBenignBegin */))))(tls)
+ (*(*func(*libc.TLS))(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Hooks)) /* &.xBenignBegin */))))(tls)
}
}
-func Xsqlite3EndBenignMalloc(tls *crt.TLS) { /* sqlite3.c:23435:21: */
+func Xsqlite3EndBenignMalloc(tls *libc.TLS) { /* sqlite3.c:23480:21: */
if sqlite3Hooks.FxBenignEnd != 0 {
- (*(*func(*crt.TLS))(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Hooks)) + 8 /* &.xBenignEnd */))))(tls)
+ (*(*func(*libc.TLS))(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Hooks)) + 8 /* &.xBenignEnd */))))(tls)
}
}
@@ -11631,19 +12406,19 @@ func Xsqlite3EndBenignMalloc(tls *crt.TLS) { /* sqlite3.c:23435:21: */
// For this low-level routine, we are guaranteed that nByte>0 because
// cases of nByte<=0 will be intercepted and dealt with by higher level
// routines.
-func sqlite3MemMalloc(tls *crt.TLS, nByte int32) uintptr { /* sqlite3.c:23635:13: */
+func sqlite3MemMalloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:23680:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
var p uintptr
- p = crt.Xmalloc(tls, (uint64(nByte + 8)))
+ p = libc.Xmalloc(tls, (uint64(nByte + 8)))
if p != 0 {
*(*Sqlite3_int64)(unsafe.Pointer(p + uintptr(0)*8)) = Sqlite3_int64(nByte)
p += 8
} else {
- Xsqlite3_log(tls, 7, ts+548 /* "failed to alloca..." */, crt.VaList(bp, nByte))
+ Xsqlite3_log(tls, 7, ts+657 /* "failed to alloca..." */, libc.VaList(bp, nByte))
}
return p
}
@@ -11654,16 +12429,16 @@ func sqlite3MemMalloc(tls *crt.TLS, nByte int32) uintptr { /* sqlite3.c:23635:13
// For this low-level routine, we already know that pPrior!=0 since
// cases where pPrior==0 will have been intecepted and dealt with
// by higher-level routines.
-func sqlite3MemFree(tls *crt.TLS, pPrior uintptr) { /* sqlite3.c:23669:13: */
+func sqlite3MemFree(tls *libc.TLS, pPrior uintptr) { /* sqlite3.c:23714:13: */
var p uintptr = pPrior
p -= 8
- crt.Xfree(tls, p)
+ libc.Xfree(tls, p)
}
// Report the allocated size of a prior return from xMalloc()
// or xRealloc().
-func sqlite3MemSize(tls *crt.TLS, pPrior uintptr) int32 { /* sqlite3.c:23684:12: */
+func sqlite3MemSize(tls *libc.TLS, pPrior uintptr) int32 { /* sqlite3.c:23729:12: */
var p uintptr
p = pPrior
@@ -11679,7 +12454,7 @@ func sqlite3MemSize(tls *crt.TLS, pPrior uintptr) int32 { /* sqlite3.c:23684:12:
// redirected to xMalloc. Similarly, we know that nByte>0 because
// cases where nByte<=0 will have been intercepted by higher-level
// routines and redirected to xFree.
-func sqlite3MemRealloc(tls *crt.TLS, pPrior uintptr, nByte int32) uintptr { /* sqlite3.c:23707:13: */
+func sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) uintptr { /* sqlite3.c:23752:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -11687,32 +12462,32 @@ func sqlite3MemRealloc(tls *crt.TLS, pPrior uintptr, nByte int32) uintptr { /* s
// EV: R-46199-30249
p -= 8
- p = crt.Xrealloc(tls, p, (uint64(nByte + 8)))
+ p = libc.Xrealloc(tls, p, (uint64(nByte + 8)))
if p != 0 {
*(*Sqlite3_int64)(unsafe.Pointer(p + uintptr(0)*8)) = Sqlite3_int64(nByte)
p += 8
} else {
Xsqlite3_log(tls, 7,
- ts+586, /* "failed memory re..." */
- crt.VaList(bp, sqlite3MemSize(tls, pPrior), nByte))
+ ts+695, /* "failed memory re..." */
+ libc.VaList(bp, sqlite3MemSize(tls, pPrior), nByte))
}
return p
}
// Round up a request size to the next valid allocation size.
-func sqlite3MemRoundup(tls *crt.TLS, n int32) int32 { /* sqlite3.c:23739:12: */
- return (((n) + 7) & ^int32(crt.Int32FromInt32(7)))
+func sqlite3MemRoundup(tls *libc.TLS, n int32) int32 { /* sqlite3.c:23784:12: */
+ return (((n) + 7) & ^int32(libc.Int32FromInt32(7)))
}
// Initialize this module.
-func sqlite3MemInit(tls *crt.TLS, NotUsed uintptr) int32 { /* sqlite3.c:23746:12: */
+func sqlite3MemInit(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:23791:12: */
_ = NotUsed
return 0
}
// Deinitialize this module.
-func sqlite3MemShutdown(tls *crt.TLS, NotUsed uintptr) { /* sqlite3.c:23773:13: */
+func sqlite3MemShutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:23818:13: */
_ = NotUsed
return
}
@@ -11721,14 +12496,14 @@ func sqlite3MemShutdown(tls *crt.TLS, NotUsed uintptr) { /* sqlite3.c:23773:13:
//
// Populate the low-level memory allocation function pointers in
// sqlite3GlobalConfig.m with pointers to the routines in this file.
-func Xsqlite3MemSetDefault(tls *crt.TLS) { /* sqlite3.c:23784:21: */
+func Xsqlite3MemSetDefault(tls *libc.TLS) { /* sqlite3.c:23829:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
- Xsqlite3_config(tls, 4, crt.VaList(bp, uintptr(unsafe.Pointer(&defaultMethods))))
+ Xsqlite3_config(tls, 4, libc.VaList(bp, uintptr(unsafe.Pointer(&defaultMethods))))
}
-var defaultMethods = Sqlite3_mem_methods{FxMalloc: 0, FxFree: 0, FxRealloc: 0, FxSize: 0, FxRoundup: 0, FxInit: 0, FxShutdown: 0, FpAppData: uintptr(0)} /* sqlite3.c:23785:36 */
+var defaultMethods = Sqlite3_mem_methods{FxMalloc: 0, FxFree: 0, FxRealloc: 0, FxSize: 0, FxRoundup: 0, FxInit: 0, FxShutdown: 0, FpAppData: uintptr(0)} /* sqlite3.c:23830:36 */
//************* End of mem1.c ***********************************************
//************* Begin file mem2.c *******************************************
@@ -11862,7 +12637,7 @@ var defaultMethods = Sqlite3_mem_methods{FxMalloc: 0, FxFree: 0, FxRealloc: 0, F
// #include "sqliteInt.h"
// Initialize the mutex system.
-func Xsqlite3MutexInit(tls *crt.TLS) int32 { /* sqlite3.c:25820:20: */
+func Xsqlite3MutexInit(tls *libc.TLS) int32 { /* sqlite3.c:25865:20: */
var rc int32 = 0
if !(int32(Xsqlite3Config.Fmutex.FxMutexAlloc) != 0) {
// If the xMutexAlloc method has not been set, then the user did not
@@ -11889,24 +12664,24 @@ func Xsqlite3MutexInit(tls *crt.TLS) int32 { /* sqlite3.c:25820:20: */
(*Sqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexAlloc = (*Sqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexAlloc
}
- rc = (*(*func(*crt.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ /* &.xMutexInit */))))(tls)
+ rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ /* &.xMutexInit */))))(tls)
return rc
}
// Shutdown the mutex system. This call frees resources allocated by
// sqlite3MutexInit().
-func Xsqlite3MutexEnd(tls *crt.TLS) int32 { /* sqlite3.c:25866:20: */
+func Xsqlite3MutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:25911:20: */
var rc int32 = 0
if Xsqlite3Config.Fmutex.FxMutexEnd != 0 {
- rc = (*(*func(*crt.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 8 /* &.xMutexEnd */))))(tls)
+ rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 8 /* &.xMutexEnd */))))(tls)
}
return rc
}
// Retrieve a pointer to a static mutex or allocate a new dynamic one.
-func Xsqlite3_mutex_alloc(tls *crt.TLS, id int32) uintptr { /* sqlite3.c:25882:26: */
+func Xsqlite3_mutex_alloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:25927:26: */
if (id <= 1) && (Xsqlite3_initialize(tls) != 0) {
return uintptr(0)
}
@@ -11914,41 +12689,41 @@ func Xsqlite3_mutex_alloc(tls *crt.TLS, id int32) uintptr { /* sqlite3.c:25882:2
return uintptr(0)
}
- return (*(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 16 /* &.xMutexAlloc */))))(tls, id)
+ return (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 16 /* &.xMutexAlloc */))))(tls, id)
}
-func Xsqlite3MutexAlloc(tls *crt.TLS, id int32) uintptr { /* sqlite3.c:25891:30: */
+func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:25936:30: */
if !(int32(Xsqlite3Config.FbCoreMutex) != 0) {
return uintptr(0)
}
- return (*(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 16 /* &.xMutexAlloc */))))(tls, id)
+ return (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 16 /* &.xMutexAlloc */))))(tls, id)
}
// Free a dynamic mutex.
-func Xsqlite3_mutex_free(tls *crt.TLS, p uintptr) { /* sqlite3.c:25903:17: */
+func Xsqlite3_mutex_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:25948:17: */
if p != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 24 /* &.xMutexFree */))))(tls, p)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 24 /* &.xMutexFree */))))(tls, p)
}
}
// Obtain the mutex p. If some other thread already has the mutex, block
// until it can be obtained.
-func Xsqlite3_mutex_enter(tls *crt.TLS, p uintptr) { /* sqlite3.c:25914:17: */
+func Xsqlite3_mutex_enter(tls *libc.TLS, p uintptr) { /* sqlite3.c:25959:17: */
if p != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 32 /* &.xMutexEnter */))))(tls, p)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 32 /* &.xMutexEnter */))))(tls, p)
}
}
// Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
// thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
-func Xsqlite3_mutex_try(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:25925:16: */
+func Xsqlite3_mutex_try(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:25970:16: */
var rc int32 = 0
if p != 0 {
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 40 /* &.xMutexTry */))))(tls, p)
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 40 /* &.xMutexTry */))))(tls, p)
}
return rc
}
@@ -11957,10 +12732,10 @@ func Xsqlite3_mutex_try(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:25925:16:
// entered by the same thread. The behavior is undefined if the mutex
// is not currently entered. If a NULL pointer is passed as an argument
// this function is a no-op.
-func Xsqlite3_mutex_leave(tls *crt.TLS, p uintptr) { /* sqlite3.c:25940:17: */
+func Xsqlite3_mutex_leave(tls *libc.TLS, p uintptr) { /* sqlite3.c:25985:17: */
if p != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 48 /* &.xMutexLeave */))))(tls, p)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 96 /* &.mutex */ + 48 /* &.xMutexLeave */))))(tls, p)
}
}
@@ -11996,30 +12771,30 @@ func Xsqlite3_mutex_leave(tls *crt.TLS, p uintptr) { /* sqlite3.c:25940:17: */
// Stub routines for all mutex methods.
//
// This routines provide no mutual exclusion or error checking.
-func noopMutexInit(tls *crt.TLS) int32 { /* sqlite3.c:26003:12: */ return 0 }
-func noopMutexEnd(tls *crt.TLS) int32 { /* sqlite3.c:26004:12: */ return 0 }
-func noopMutexAlloc(tls *crt.TLS, id int32) uintptr { /* sqlite3.c:26005:22: */
+func noopMutexInit(tls *libc.TLS) int32 { /* sqlite3.c:26048:12: */ return 0 }
+func noopMutexEnd(tls *libc.TLS) int32 { /* sqlite3.c:26049:12: */ return 0 }
+func noopMutexAlloc(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:26050:22: */
_ = id
return uintptr(8)
}
-func noopMutexFree(tls *crt.TLS, p uintptr) { /* sqlite3.c:26009:13: */ _ = p; return }
-func noopMutexEnter(tls *crt.TLS, p uintptr) { /* sqlite3.c:26010:13: */ _ = p; return }
-func noopMutexTry(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:26011:12: */
+func noopMutexFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:26054:13: */ _ = p; return }
+func noopMutexEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:26055:13: */ _ = p; return }
+func noopMutexTry(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:26056:12: */
_ = p
return 0
}
-func noopMutexLeave(tls *crt.TLS, p uintptr) { /* sqlite3.c:26015:13: */ _ = p; return }
+func noopMutexLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:26060:13: */ _ = p; return }
-func Xsqlite3NoopMutex(tls *crt.TLS) uintptr { /* sqlite3.c:26017:44: */
+func Xsqlite3NoopMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26062:44: */
return uintptr(unsafe.Pointer(&sMutex))
}
-var sMutex = Sqlite3_mutex_methods{FxMutexInit: 0, FxMutexEnd: 0, FxMutexAlloc: 0, FxMutexFree: 0, FxMutexEnter: 0, FxMutexTry: 0, FxMutexLeave: 0, FxMutexHeld: uintptr(0), FxMutexNotheld: uintptr(0)} /* sqlite3.c:26018:38 */
+var sMutex = Sqlite3_mutex_methods{FxMutexInit: 0, FxMutexEnd: 0, FxMutexAlloc: 0, FxMutexFree: 0, FxMutexEnter: 0, FxMutexTry: 0, FxMutexLeave: 0, FxMutexHeld: uintptr(0), FxMutexNotheld: uintptr(0)} /* sqlite3.c:26063:38 */
// If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation
// is used regardless of the run-time threadsafety setting.
-func Xsqlite3DefaultMutex(tls *crt.TLS) uintptr { /* sqlite3.c:26176:44: */
+func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr { /* sqlite3.c:26221:44: */
return Xsqlite3NoopMutex(tls)
}
@@ -12082,12 +12857,8 @@ func Xsqlite3DefaultMutex(tls *crt.TLS) uintptr { /* sqlite3.c:26176:44: */
// Attempt to release up to n bytes of non-essential memory currently
// held by SQLite. An example of non-essential memory is memory used to
// cache database pages that are not currently in use.
-func Xsqlite3_release_memory(tls *crt.TLS, n int32) int32 { /* sqlite3.c:27295:16: */
- // IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
- // is a no-op returning zero if SQLite is not compiled with
- // SQLITE_ENABLE_MEMORY_MANAGEMENT.
- _ = n
- return 0
+func Xsqlite3_release_memory(tls *libc.TLS, n int32) int32 { /* sqlite3.c:27340:16: */
+ return Xsqlite3PcacheReleaseMemory(tls, n)
}
// Default value of the hard heap limit. 0 means "no limit".
@@ -12104,17 +12875,17 @@ type Mem0Global = struct {
// Default value of the hard heap limit. 0 means "no limit".
// State information local to the memory allocation subsystem.
-var mem0 = Mem0Global{Fmutex: uintptr(0), FalarmThreshold: int64(0), FhardLimit: int64(0), FnearlyFull: 0} /* sqlite3.c:27327:3 */
+var mem0 = Mem0Global{Fmutex: uintptr(0), FalarmThreshold: int64(0), FhardLimit: int64(0), FnearlyFull: 0} /* sqlite3.c:27372:3 */
// Return the memory allocator mutex. sqlite3_status() needs it.
-func Xsqlite3MallocMutex(tls *crt.TLS) uintptr { /* sqlite3.c:27334:30: */
+func Xsqlite3MallocMutex(tls *libc.TLS) uintptr { /* sqlite3.c:27379:30: */
return mem0.Fmutex
}
// Deprecated external interface. It used to set an alarm callback
// that was invoked when memory usage grew too large. Now it is a
// no-op.
-func Xsqlite3_memory_alarm(tls *crt.TLS, xCallback uintptr, pArg uintptr, iThreshold Sqlite3_int64) int32 { /* sqlite3.c:27344:16: */
+func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Sqlite3_int64) int32 { /* sqlite3.c:27389:16: */
_ = xCallback
_ = pArg
_ = iThreshold
@@ -12130,7 +12901,7 @@ func Xsqlite3_memory_alarm(tls *crt.TLS, xCallback uintptr, pArg uintptr, iThres
//
// If the hard heap limit is enabled, then the soft heap limit cannot
// be disabled nor raised above the hard heap limit.
-func Xsqlite3_soft_heap_limit64(tls *crt.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27367:26: */
+func Xsqlite3_soft_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27412:26: */
var priorLimit Sqlite3_int64
var excess Sqlite3_int64
var nUsed Sqlite3_int64
@@ -12149,7 +12920,7 @@ func Xsqlite3_soft_heap_limit64(tls *crt.TLS, n Sqlite3_int64) Sqlite3_int64 { /
}
mem0.FalarmThreshold = n
nUsed = Xsqlite3StatusValue(tls, 0)
- *(*int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&mem0)) + 24 /* &.nearlyFull */))) = (crt.Bool32((n > int64(0)) && (n <= nUsed)))
+ *(*int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&mem0)) + 24 /* &.nearlyFull */))) = (libc.Bool32((n > int64(0)) && (n <= nUsed)))
Xsqlite3_mutex_leave(tls, mem0.Fmutex)
excess = (Xsqlite3_memory_used(tls) - n)
if excess > int64(0) {
@@ -12157,7 +12928,7 @@ func Xsqlite3_soft_heap_limit64(tls *crt.TLS, n Sqlite3_int64) Sqlite3_int64 { /
}
return priorLimit
}
-func Xsqlite3_soft_heap_limit(tls *crt.TLS, n int32) { /* sqlite3.c:27392:17: */
+func Xsqlite3_soft_heap_limit(tls *libc.TLS, n int32) { /* sqlite3.c:27437:17: */
if n < 0 {
n = 0
}
@@ -12174,7 +12945,7 @@ func Xsqlite3_soft_heap_limit(tls *crt.TLS, n int32) { /* sqlite3.c:27392:17: */
// Setting the hard heap limit will also activate the soft heap limit
// and constrain the soft heap limit to be no more than the hard heap
// limit.
-func Xsqlite3_hard_heap_limit64(tls *crt.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27409:26: */
+func Xsqlite3_hard_heap_limit64(tls *libc.TLS, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:27454:26: */
var priorLimit Sqlite3_int64
var rc int32 = Xsqlite3_initialize(tls)
if rc != 0 {
@@ -12193,21 +12964,21 @@ func Xsqlite3_hard_heap_limit64(tls *crt.TLS, n Sqlite3_int64) Sqlite3_int64 { /
}
// Initialize the memory allocation subsystem.
-func Xsqlite3MallocInit(tls *crt.TLS) int32 { /* sqlite3.c:27431:20: */
+func Xsqlite3MallocInit(tls *libc.TLS) int32 { /* sqlite3.c:27476:20: */
var rc int32
if Xsqlite3Config.Fm.FxMalloc == uintptr(0) {
Xsqlite3MemSetDefault(tls)
}
- crt.Xmemset(tls, uintptr(unsafe.Pointer(&mem0)), 0, uint64(unsafe.Sizeof(mem0)))
+ libc.Xmemset(tls, uintptr(unsafe.Pointer(&mem0)), 0, uint64(unsafe.Sizeof(mem0)))
mem0.Fmutex = Xsqlite3MutexAlloc(tls, 3)
if ((Xsqlite3Config.FpPage == uintptr(0)) || (Xsqlite3Config.FszPage < 512)) ||
(Xsqlite3Config.FnPage <= 0) {
Xsqlite3Config.FpPage = uintptr(0)
Xsqlite3Config.FszPage = 0
}
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 40 /* &.xInit */))))(tls, Xsqlite3Config.Fm.FpAppData)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 40 /* &.xInit */))))(tls, Xsqlite3Config.Fm.FpAppData)
if rc != 0 {
- crt.Xmemset(tls, uintptr(unsafe.Pointer(&mem0)), 0, uint64(unsafe.Sizeof(mem0)))
+ libc.Xmemset(tls, uintptr(unsafe.Pointer(&mem0)), 0, uint64(unsafe.Sizeof(mem0)))
}
return rc
}
@@ -12215,20 +12986,20 @@ func Xsqlite3MallocInit(tls *crt.TLS) int32 { /* sqlite3.c:27431:20: */
// Return true if the heap is currently under memory pressure - in other
// words if the amount of heap used is close to the limit set by
// sqlite3_soft_heap_limit().
-func Xsqlite3HeapNearlyFull(tls *crt.TLS) int32 { /* sqlite3.c:27453:20: */
+func Xsqlite3HeapNearlyFull(tls *libc.TLS) int32 { /* sqlite3.c:27498:20: */
return *(*int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&mem0)) + 24 /* &.nearlyFull */)))
}
// Deinitialize the memory allocation subsystem.
-func Xsqlite3MallocEnd(tls *crt.TLS) { /* sqlite3.c:27460:21: */
+func Xsqlite3MallocEnd(tls *libc.TLS) { /* sqlite3.c:27505:21: */
if Xsqlite3Config.Fm.FxShutdown != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 48 /* &.xShutdown */))))(tls, Xsqlite3Config.Fm.FpAppData)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 48 /* &.xShutdown */))))(tls, Xsqlite3Config.Fm.FpAppData)
}
- crt.Xmemset(tls, uintptr(unsafe.Pointer(&mem0)), 0, uint64(unsafe.Sizeof(mem0)))
+ libc.Xmemset(tls, uintptr(unsafe.Pointer(&mem0)), 0, uint64(unsafe.Sizeof(mem0)))
}
// Return the amount of memory currently checked out.
-func Xsqlite3_memory_used(tls *crt.TLS) Sqlite3_int64 { /* sqlite3.c:27470:26: */
+func Xsqlite3_memory_used(tls *libc.TLS) Sqlite3_int64 { /* sqlite3.c:27515:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -12243,7 +13014,7 @@ func Xsqlite3_memory_used(tls *crt.TLS) Sqlite3_int64 { /* sqlite3.c:27470:26: *
// Return the maximum amount of memory that has ever been
// checked out since either the beginning of this process
// or since the most recent reset.
-func Xsqlite3_memory_highwater(tls *crt.TLS, resetFlag int32) Sqlite3_int64 { /* sqlite3.c:27481:26: */
+func Xsqlite3_memory_highwater(tls *libc.TLS, resetFlag int32) Sqlite3_int64 { /* sqlite3.c:27526:26: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -12256,7 +13027,7 @@ func Xsqlite3_memory_highwater(tls *crt.TLS, resetFlag int32) Sqlite3_int64 { /*
}
// Trigger the alarm
-func sqlite3MallocAlarm(tls *crt.TLS, nByte int32) { /* sqlite3.c:27490:13: */
+func sqlite3MallocAlarm(tls *libc.TLS, nByte int32) { /* sqlite3.c:27535:13: */
if mem0.FalarmThreshold <= int64(0) {
return
}
@@ -12267,7 +13038,7 @@ func sqlite3MallocAlarm(tls *crt.TLS, nByte int32) { /* sqlite3.c:27490:13: */
// Do a memory allocation with statistics and alarms. Assume the
// lock is already held.
-func mallocWithAlarm(tls *crt.TLS, n int32, pp uintptr) { /* sqlite3.c:27501:13: */
+func mallocWithAlarm(tls *libc.TLS, n int32, pp uintptr) { /* sqlite3.c:27546:13: */
var p uintptr
var nFull int32
@@ -12276,7 +13047,7 @@ func mallocWithAlarm(tls *crt.TLS, n int32, pp uintptr) { /* sqlite3.c:27501:13:
// mode and specifically when the DMD "Dark Matter Detector" is enabled
// or else a crash results. Hence, do not attempt to optimize out the
// following xRoundup() call.
- nFull = (*(*func(*crt.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 32 /* &.xRoundup */))))(tls, n)
+ nFull = (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 32 /* &.xRoundup */))))(tls, n)
Xsqlite3StatusHighwater(tls, 5, n)
if mem0.FalarmThreshold > int64(0) {
@@ -12295,7 +13066,11 @@ func mallocWithAlarm(tls *crt.TLS, n int32, pp uintptr) { /* sqlite3.c:27501:13:
*(*int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&mem0)) + 24 /* &.nearlyFull */))) = 0
}
}
- p = (*(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ /* &.xMalloc */))))(tls, nFull)
+ p = (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ /* &.xMalloc */))))(tls, nFull)
+ if (p == uintptr(0)) && (mem0.FalarmThreshold > int64(0)) {
+ sqlite3MallocAlarm(tls, nFull)
+ p = (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ /* &.xMalloc */))))(tls, nFull)
+ }
if p != 0 {
nFull = Xsqlite3MallocSize(tls, p)
Xsqlite3StatusUp(tls, 0, nFull)
@@ -12306,7 +13081,7 @@ func mallocWithAlarm(tls *crt.TLS, n int32, pp uintptr) { /* sqlite3.c:27501:13:
// Allocate memory. This routine is like sqlite3_malloc() except that it
// assumes the memory subsystem has already been initialized.
-func Xsqlite3Malloc(tls *crt.TLS, n U64) uintptr { /* sqlite3.c:27550:21: */
+func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:27595:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -12324,7 +13099,7 @@ func Xsqlite3Malloc(tls *crt.TLS, n U64) uintptr { /* sqlite3.c:27550:21: */
mallocWithAlarm(tls, int32(n), bp /* &p */)
Xsqlite3_mutex_leave(tls, mem0.Fmutex)
} else {
- *(*uintptr)(unsafe.Pointer(bp /* p */)) = (*(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ /* &.xMalloc */))))(tls, int32(n))
+ *(*uintptr)(unsafe.Pointer(bp /* p */)) = (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ /* &.xMalloc */))))(tls, int32(n))
}
// IMP: R-11148-40995
return *(*uintptr)(unsafe.Pointer(bp /* p */))
@@ -12333,7 +13108,7 @@ func Xsqlite3Malloc(tls *crt.TLS, n U64) uintptr { /* sqlite3.c:27550:21: */
// This version of the memory allocation is for use by the application.
// First make sure the memory subsystem is initialized, then do the
// allocation.
-func Xsqlite3_malloc(tls *crt.TLS, n int32) uintptr { /* sqlite3.c:27575:17: */
+func Xsqlite3_malloc(tls *libc.TLS, n int32) uintptr { /* sqlite3.c:27620:17: */
if Xsqlite3_initialize(tls) != 0 {
return uintptr(0)
}
@@ -12342,7 +13117,7 @@ func Xsqlite3_malloc(tls *crt.TLS, n int32) uintptr { /* sqlite3.c:27575:17: */
}
return Xsqlite3Malloc(tls, uint64(n))
}
-func Xsqlite3_malloc64(tls *crt.TLS, n Sqlite3_uint64) uintptr { /* sqlite3.c:27581:17: */
+func Xsqlite3_malloc64(tls *libc.TLS, n Sqlite3_uint64) uintptr { /* sqlite3.c:27626:17: */
if Xsqlite3_initialize(tls) != 0 {
return uintptr(0)
}
@@ -12350,23 +13125,23 @@ func Xsqlite3_malloc64(tls *crt.TLS, n Sqlite3_uint64) uintptr { /* sqlite3.c:27
}
// TRUE if p is a lookaside memory allocation from db
-func isLookaside(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27592:12: */
- return (crt.Bool32((Uptr((p)) >= Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart))) && (Uptr((p)) < Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd)))))
+func isLookaside(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27637:12: */
+ return (libc.Bool32((Uptr((p)) >= Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart))) && (Uptr((p)) < Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd)))))
}
// Return the size of a memory allocation previously obtained from
// sqlite3Malloc() or sqlite3_malloc().
-func Xsqlite3MallocSize(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:27603:20: */
+func Xsqlite3MallocSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:27648:20: */
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 24 /* &.xSize */))))(tls, p)
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 24 /* &.xSize */))))(tls, p)
}
-func lookasideMallocSize(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27607:12: */
+func lookasideMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27652:12: */
if p < (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpMiddle {
return int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue)
}
return 128
}
-func Xsqlite3DbMallocSize(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27614:20: */
+func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:27659:20: */
if db != 0 {
if (Uptr(p)) < Uptr(((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd)) {
@@ -12380,18 +13155,18 @@ func Xsqlite3DbMallocSize(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite
}
}
}
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 24 /* &.xSize */))))(tls, p)
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 24 /* &.xSize */))))(tls, p)
}
-func Xsqlite3_msize(tls *crt.TLS, p uintptr) Sqlite3_uint64 { /* sqlite3.c:27643:27: */
+func Xsqlite3_msize(tls *libc.TLS, p uintptr) Sqlite3_uint64 { /* sqlite3.c:27688:27: */
if p != 0 {
- return uint64((*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 24 /* &.xSize */))))(tls, p))
+ return uint64((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 24 /* &.xSize */))))(tls, p))
}
return uint64(0)
}
// Free memory previously obtained from sqlite3Malloc().
-func Xsqlite3_free(tls *crt.TLS, p uintptr) { /* sqlite3.c:27652:17: */
+func Xsqlite3_free(tls *libc.TLS, p uintptr) { /* sqlite3.c:27697:17: */
if p == uintptr(0) {
return
} // IMP: R-49053-54554
@@ -12400,23 +13175,23 @@ func Xsqlite3_free(tls *crt.TLS, p uintptr) { /* sqlite3.c:27652:17: */
Xsqlite3_mutex_enter(tls, mem0.Fmutex)
Xsqlite3StatusDown(tls, 0, Xsqlite3MallocSize(tls, p))
Xsqlite3StatusDown(tls, 9, 1)
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 8 /* &.xFree */))))(tls, p)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 8 /* &.xFree */))))(tls, p)
Xsqlite3_mutex_leave(tls, mem0.Fmutex)
} else {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 8 /* &.xFree */))))(tls, p)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 8 /* &.xFree */))))(tls, p)
}
}
// Add the size of memory allocation "p" to the count in
// *db->pnBytesFreed.
-func measureAllocationSize(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:27671:29: */
+func measureAllocationSize(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27716:29: */
*(*int32)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed)) += (Xsqlite3DbMallocSize(tls, db, p))
}
// Free memory that might be associated with a particular database
// connection. Calling sqlite3DbFree(D,X) for X==0 is a harmless no-op.
// The sqlite3DbFreeNN(D,X) version requires that X be non-NULL.
-func Xsqlite3DbFreeNN(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:27680:21: */
+func Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27725:21: */
if db != 0 {
if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed != 0 {
@@ -12441,7 +13216,7 @@ func Xsqlite3DbFreeNN(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:27680:
Xsqlite3_free(tls, p)
}
-func Xsqlite3DbFree(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:27717:21: */
+func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:27762:21: */
if p != 0 {
Xsqlite3DbFreeNN(tls, db, p)
@@ -12449,7 +13224,7 @@ func Xsqlite3DbFree(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:27717:21
}
// Change the size of an existing memory allocation
-func Xsqlite3Realloc(tls *crt.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlite3.c:27725:21: */
+func Xsqlite3Realloc(tls *libc.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlite3.c:27770:21: */
var nOld int32
var nNew int32
var nDiff int32
@@ -12470,7 +13245,7 @@ func Xsqlite3Realloc(tls *crt.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlite
// 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(*crt.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 32 /* &.xRoundup */))))(tls, int32(nBytes))
+ nNew = (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 32 /* &.xRoundup */))))(tls, int32(nBytes))
if nOld == nNew {
pNew = pOld
} else if Xsqlite3Config.FbMemstat != 0 {
@@ -12480,14 +13255,18 @@ func Xsqlite3Realloc(tls *crt.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlite
if (nDiff > 0) && (Xsqlite3StatusValue(tls, 0) >= (mem0.FalarmThreshold - Sqlite3_int64(nDiff))) {
sqlite3MallocAlarm(tls, nDiff)
}
- pNew = (*(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 16 /* &.xRealloc */))))(tls, pOld, nNew)
+ pNew = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 16 /* &.xRealloc */))))(tls, pOld, nNew)
+ if (pNew == uintptr(0)) && (mem0.FalarmThreshold > int64(0)) {
+ sqlite3MallocAlarm(tls, int32(nBytes))
+ pNew = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 16 /* &.xRealloc */))))(tls, pOld, nNew)
+ }
if pNew != 0 {
nNew = Xsqlite3MallocSize(tls, pNew)
Xsqlite3StatusUp(tls, 0, (nNew - nOld))
}
Xsqlite3_mutex_leave(tls, mem0.Fmutex)
} else {
- pNew = (*(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 16 /* &.xRealloc */))))(tls, pOld, nNew)
+ pNew = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 32 /* &.m */ + 16 /* &.xRealloc */))))(tls, pOld, nNew)
}
// IMP: R-11148-40995
return pNew
@@ -12495,7 +13274,7 @@ func Xsqlite3Realloc(tls *crt.TLS, pOld uintptr, nBytes U64) uintptr { /* sqlite
// The public interface to sqlite3Realloc. Make sure that the memory
// subsystem is initialized prior to invoking sqliteRealloc.
-func Xsqlite3_realloc(tls *crt.TLS, pOld uintptr, n int32) uintptr { /* sqlite3.c:27779:17: */
+func Xsqlite3_realloc(tls *libc.TLS, pOld uintptr, n int32) uintptr { /* sqlite3.c:27824:17: */
if Xsqlite3_initialize(tls) != 0 {
return uintptr(0)
}
@@ -12504,39 +13283,37 @@ func Xsqlite3_realloc(tls *crt.TLS, pOld uintptr, n int32) uintptr { /* sqlite3.
} // IMP: R-26507-47431
return Xsqlite3Realloc(tls, pOld, uint64(n))
}
-func Xsqlite3_realloc64(tls *crt.TLS, pOld uintptr, n Sqlite3_uint64) uintptr { /* sqlite3.c:27786:17: */
+func Xsqlite3_realloc64(tls *libc.TLS, pOld uintptr, n Sqlite3_uint64) uintptr { /* sqlite3.c:27831:17: */
if Xsqlite3_initialize(tls) != 0 {
return uintptr(0)
}
return Xsqlite3Realloc(tls, pOld, n)
}
-/*
-** Allocate and zero memory.
- */
-func Xsqlite3MallocZero(tls *crt.TLS, n U64) uintptr { /* sqlite3.c:27797:21: */
+// Allocate and zero memory.
+func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr { /* sqlite3.c:27842:21: */
var p uintptr = Xsqlite3Malloc(tls, n)
if p != 0 {
- crt.Xmemset(tls, p, 0, Size_t(n))
+ libc.Xmemset(tls, p, 0, Size_t(n))
}
return p
}
// Allocate and zero memory. If the allocation fails, make
// the mallocFailed flag in the connection pointer.
-func Xsqlite3DbMallocZero(tls *crt.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27809:21: */
+func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27854:21: */
var p uintptr
p = Xsqlite3DbMallocRaw(tls, db, n)
if p != 0 {
- crt.Xmemset(tls, p, 0, Size_t(n))
+ libc.Xmemset(tls, p, 0, Size_t(n))
}
return p
}
// Finish the work of sqlite3DbMallocRawNN for the unusual and
// slower case when the allocation cannot be fulfilled using lookaside.
-func dbMallocRawFinish(tls *crt.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27821:29: */
+func dbMallocRawFinish(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27866:29: */
var p uintptr
p = Xsqlite3Malloc(tls, n)
@@ -12567,7 +13344,7 @@ func dbMallocRawFinish(tls *crt.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:2
//
// The sqlite3MallocRawNN() variant guarantees that the "db" parameter is
// not a NULL pointer.
-func Xsqlite3DbMallocRaw(tls *crt.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27853:21: */
+func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27898:21: */
var p uintptr
if db != 0 {
return Xsqlite3DbMallocRawNN(tls, db, n)
@@ -12576,45 +13353,45 @@ func Xsqlite3DbMallocRaw(tls *crt.TLS, db uintptr, n U64) uintptr { /* sqlite3.c
return p
}
-func Xsqlite3DbMallocRawNN(tls *crt.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27860:21: */
+func Xsqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n U64) uintptr { /* sqlite3.c:27905:21: */
var pBuf uintptr
if n > U64((*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz) {
if !(int32((*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable) != 0) {
- *(*U32)(unsafe.Pointer((db + 376 /* &.lookaside */ + 16 /* &.anStat */) + uintptr(1)*4))++
+ *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + uintptr(1)*4))++
} else if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return uintptr(0)
}
return dbMallocRawFinish(tls, db, n)
}
if n <= uint64(128) {
- if (crt.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree)) != uintptr(0) {
+ if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree)) != uintptr(0) {
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallFree = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext
- *(*U32)(unsafe.Pointer((db + 376 /* &.lookaside */ + 16 /* &.anStat */) + uintptr(0)*4))++
+ *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + uintptr(0)*4))++
return pBuf
- } else if (crt.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit)) != uintptr(0) {
+ } else if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit)) != uintptr(0) {
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpSmallInit = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext
- *(*U32)(unsafe.Pointer((db + 376 /* &.lookaside */ + 16 /* &.anStat */) + uintptr(0)*4))++
+ *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + uintptr(0)*4))++
return pBuf
}
}
- if (crt.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree)) != uintptr(0) {
+ if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree)) != uintptr(0) {
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpFree = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext
- *(*U32)(unsafe.Pointer((db + 376 /* &.lookaside */ + 16 /* &.anStat */) + uintptr(0)*4))++
+ *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + uintptr(0)*4))++
return pBuf
- } else if (crt.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit)) != uintptr(0) {
+ } else if (libc.AssignUintptr(&pBuf, (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit)) != uintptr(0) {
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit = (*LookasideSlot)(unsafe.Pointer(pBuf)).FpNext
- *(*U32)(unsafe.Pointer((db + 376 /* &.lookaside */ + 16 /* &.anStat */) + uintptr(0)*4))++
+ *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + uintptr(0)*4))++
return pBuf
} else {
- *(*U32)(unsafe.Pointer((db + 376 /* &.lookaside */ + 16 /* &.anStat */) + uintptr(2)*4))++
+ *(*U32)(unsafe.Pointer((db + 400 /* &.lookaside */ + 16 /* &.anStat */) + uintptr(2)*4))++
}
return dbMallocRawFinish(tls, db, n)
}
// Resize the block of memory pointed to by p to n bytes. If the
// resize fails, set the mallocFailed flag in the connection object.
-func Xsqlite3DbRealloc(tls *crt.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:27916:21: */
+func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:27961:21: */
if p == uintptr(0) {
return Xsqlite3DbMallocRawNN(tls, db, n)
@@ -12633,14 +13410,14 @@ func Xsqlite3DbRealloc(tls *crt.TLS, db uintptr, p uintptr, n U64) uintptr { /*
}
return dbReallocFinish(tls, db, p, n)
}
-func dbReallocFinish(tls *crt.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:27932:29: */
+func dbReallocFinish(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:27977:29: */
var pNew uintptr = uintptr(0)
if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
if isLookaside(tls, db, p) != 0 {
pNew = Xsqlite3DbMallocRawNN(tls, db, n)
if pNew != 0 {
- crt.Xmemcpy(tls, pNew, p, uint64(lookasideMallocSize(tls, db, p)))
+ libc.Xmemcpy(tls, pNew, p, uint64(lookasideMallocSize(tls, db, p)))
Xsqlite3DbFree(tls, db, p)
}
} else {
@@ -12656,7 +13433,7 @@ func dbReallocFinish(tls *crt.TLS, db uintptr, p uintptr, n U64) uintptr { /* sq
// Attempt to reallocate p. If the reallocation fails, then free p
// and set the mallocFailed flag in the database connection.
-func Xsqlite3DbReallocOrFree(tls *crt.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:27962:21: */
+func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr { /* sqlite3.c:28007:21: */
var pNew uintptr
pNew = Xsqlite3DbRealloc(tls, db, p, n)
if !(pNew != 0) {
@@ -12670,29 +13447,29 @@ func Xsqlite3DbReallocOrFree(tls *crt.TLS, db uintptr, p uintptr, n U64) uintptr
// is because when memory debugging is turned on, these two functions are
// called via macros that record the current file and line number in the
// ThreadData structure.
-func Xsqlite3DbStrDup(tls *crt.TLS, db uintptr, z uintptr) uintptr { /* sqlite3.c:27978:21: */
+func Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr { /* sqlite3.c:28023:21: */
var zNew uintptr
var n Size_t
if z == uintptr(0) {
return uintptr(0)
}
- n = (crt.Xstrlen(tls, z) + uint64(1))
+ n = (libc.Xstrlen(tls, z) + uint64(1))
zNew = Xsqlite3DbMallocRaw(tls, db, uint64(n))
if zNew != 0 {
- crt.Xmemcpy(tls, zNew, z, n)
+ libc.Xmemcpy(tls, zNew, z, n)
}
return zNew
}
-func Xsqlite3DbStrNDup(tls *crt.TLS, db uintptr, z uintptr, n U64) uintptr { /* sqlite3.c:27991:21: */
+func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr { /* sqlite3.c:28036:21: */
var zNew uintptr
- if z == uintptr(0) {
- return uintptr(0)
+ if z != 0 {
+ zNew = Xsqlite3DbMallocRawNN(tls, db, (n + uint64(1)))
+ } else {
+ zNew = uintptr(0)
}
-
- zNew = Xsqlite3DbMallocRawNN(tls, db, (n + uint64(1)))
if zNew != 0 {
- crt.Xmemcpy(tls, zNew, z, Size_t(n))
+ libc.Xmemcpy(tls, zNew, z, Size_t(n))
*(*int8)(unsafe.Pointer(zNew + uintptr(n))) = int8(0)
}
return zNew
@@ -12701,7 +13478,7 @@ func Xsqlite3DbStrNDup(tls *crt.TLS, db uintptr, z uintptr, n U64) uintptr { /*
// The text between zStart and zEnd represents a phrase within a larger
// SQL statement. Make a copy of this phrase in space obtained form
// sqlite3DbMalloc(). Omit leading and trailing whitespace.
-func Xsqlite3DbSpanDup(tls *crt.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:28011:21: */
+func Xsqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:28054:21: */
var n int32
for (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zStart + uintptr(0))))]) & 0x01) != 0 {
zStart++
@@ -12714,7 +13491,7 @@ func Xsqlite3DbSpanDup(tls *crt.TLS, db uintptr, zStart uintptr, zEnd uintptr) u
}
// Free any prior content in *pz and replace it with a copy of zNew.
-func Xsqlite3SetString(tls *crt.TLS, pz uintptr, db uintptr, zNew uintptr) { /* sqlite3.c:28022:21: */
+func Xsqlite3SetString(tls *libc.TLS, pz uintptr, db uintptr, zNew uintptr) { /* sqlite3.c:28065:21: */
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pz)))
*(*uintptr)(unsafe.Pointer(pz)) = Xsqlite3DbStrDup(tls, db, zNew)
}
@@ -12723,11 +13500,11 @@ func Xsqlite3SetString(tls *crt.TLS, pz uintptr, db uintptr, zNew uintptr) { /*
// has happened. This routine will set db->mallocFailed, and also
// temporarily disable the lookaside memory allocator and interrupt
// any running VDBEs.
-func Xsqlite3OomFault(tls *crt.TLS, db uintptr) { /* sqlite3.c:28033:21: */
+func Xsqlite3OomFault(tls *libc.TLS, db uintptr) { /* sqlite3.c:28076:21: */
if (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc) == 0) {
(*Sqlite3)(unsafe.Pointer(db)).FmallocFailed = U8(1)
if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 0 {
- *(*int32)(unsafe.Pointer((db + 368 /* &.u1 */ /* &.isInterrupted */))) = 1
+ *(*int32)(unsafe.Pointer((db + 392 /* &.u1 */ /* &.isInterrupted */))) = 1
}
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
@@ -12742,10 +13519,10 @@ func Xsqlite3OomFault(tls *crt.TLS, db uintptr) { /* sqlite3.c:28033:21: */
//
// The memory allocator is not restarted if there are running
// VDBEs.
-func Xsqlite3OomClear(tls *crt.TLS, db uintptr) { /* sqlite3.c:28053:21: */
+func Xsqlite3OomClear(tls *libc.TLS, db uintptr) { /* sqlite3.c:28096:21: */
if ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0) {
(*Sqlite3)(unsafe.Pointer(db)).FmallocFailed = U8(0)
- *(*int32)(unsafe.Pointer((db + 368 /* &.u1 */ /* &.isInterrupted */))) = 0
+ *(*int32)(unsafe.Pointer((db + 392 /* &.u1 */ /* &.isInterrupted */))) = 0
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable--
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 {
@@ -12758,7 +13535,7 @@ func Xsqlite3OomClear(tls *crt.TLS, db uintptr) { /* sqlite3.c:28053:21: */
}
// Take actions at the end of an API call to indicate an OOM error
-func apiOomError(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:28065:28: */
+func apiOomError(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:28108:28: */
Xsqlite3OomClear(tls, db)
Xsqlite3Error(tls, db, 7)
return 7
@@ -12774,7 +13551,7 @@ func apiOomError(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:28065:28: */
//
// If an OOM as occurred, then the connection error-code (the value
// returned by sqlite3_errcode()) is set to SQLITE_NOMEM.
-func Xsqlite3ApiExit(tls *crt.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28083:20: */
+func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28126:20: */
// If the db handle must hold the connection handle mutex here.
// Otherwise the read (and possible write) of db->mallocFailed
// is unsafe, as is the call to sqlite3Error().
@@ -12803,7 +13580,7 @@ func Xsqlite3ApiExit(tls *crt.TLS, db uintptr, rc int32) int32 { /* sqlite3.c:28
// The rest are extensions, not normally found in printf()
// An "etByte" is an 8-bit unsigned value.
-type EtByte = uint8 /* sqlite3.c:28141:23 */
+type EtByte = uint8 /* sqlite3.c:28184:23 */
// Each builtin conversion character (ex: the 'd' in "%d") is described
// by an instance of the following structure
@@ -12818,14 +13595,14 @@ type et_info = struct {
// Each builtin conversion character (ex: the 'd' in "%d") is described
// by an instance of the following structure
-type Et_info = et_info /* sqlite3.c:28154:3 */
+type Et_info = et_info /* sqlite3.c:28197:3 */
// Allowed values for et_info.flags
// The following table is searched linearly, so it is good to put the
// most frequently used conversion types first.
-var aDigits = *(*[33]int8)(unsafe.Pointer(ts + 622 /* "0123456789ABCDEF..." */)) /* sqlite3.c:28167:19 */
-var aPrefix = *(*[7]int8)(unsafe.Pointer(ts + 655 /* "-x0\x00X0" */)) /* sqlite3.c:28168:19 */
+var aDigits = *(*[33]int8)(unsafe.Pointer(ts + 731 /* "0123456789ABCDEF..." */)) /* sqlite3.c:28210:19 */
+var aPrefix = *(*[7]int8)(unsafe.Pointer(ts + 764 /* "-x0\x00X0" */)) /* sqlite3.c:28211:19 */
var fmtinfo = [23]Et_info{
{Ffmttype: int8('d'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(16), Fcharset: EtByte(0), Fprefix: EtByte(0)},
{Ffmttype: int8('s'), Fbase: EtByte(0), Fflags: EtByte(4), Ftype: EtByte(5), Fcharset: EtByte(0), Fprefix: EtByte(0)},
@@ -12852,13 +13629,13 @@ var fmtinfo = [23]Et_info{
{Ffmttype: int8('T'), Fbase: EtByte(0), Fflags: EtByte(0), Ftype: EtByte(11), Fcharset: EtByte(0), Fprefix: EtByte(0)},
{Ffmttype: int8('S'), Fbase: EtByte(0), Fflags: EtByte(0), Ftype: EtByte(12), Fcharset: EtByte(0), Fprefix: EtByte(0)},
{Ffmttype: int8('r'), Fbase: EtByte(10), Fflags: EtByte(1), Ftype: EtByte(15), Fcharset: EtByte(0), Fprefix: EtByte(0)},
-} /* sqlite3.c:28169:22 */
+} /* sqlite3.c:28212:22 */
// Floating point constants used for rounding
var arRound = [10]float64{
5.0e-01, 5.0e-02, 5.0e-03, 5.0e-04, 5.0e-05,
5.0e-06, 5.0e-07, 5.0e-08, 5.0e-09, 5.0e-10,
-} /* sqlite3.c:28200:21 */
+} /* sqlite3.c:28243:21 */
// If SQLITE_OMIT_FLOATING_POINT is defined, then none of the floating point
// conversions will work.
@@ -12873,7 +13650,7 @@ var arRound = [10]float64{
// The counter *cnt is incremented each time. After counter exceeds
// 16 (the number of significant digits in a 64-bit float) '0' is
// always returned.
-func et_getdigit(tls *crt.TLS, val uintptr, cnt uintptr) int8 { /* sqlite3.c:28223:13: */
+func et_getdigit(tls *libc.TLS, val uintptr, cnt uintptr) int8 { /* sqlite3.c:28266:13: */
var digit int32
var d float64
if (*(*int32)(unsafe.Pointer(cnt))) <= 0 {
@@ -12888,7 +13665,7 @@ func et_getdigit(tls *crt.TLS, val uintptr, cnt uintptr) int8 { /* sqlite3.c:282
}
// Set the StrAccum object to an error mode.
-func setStrAccumError(tls *crt.TLS, p uintptr, eError U8) { /* sqlite3.c:28239:13: */
+func setStrAccumError(tls *libc.TLS, p uintptr, eError U8) { /* sqlite3.c:28282:13: */
(*StrAccum)(unsafe.Pointer(p)).FaccError = eError
if (*StrAccum)(unsafe.Pointer(p)).FmxAlloc != 0 {
@@ -12900,23 +13677,23 @@ func setStrAccumError(tls *crt.TLS, p uintptr, eError U8) { /* sqlite3.c:28239:1
}
// Extra argument values from a PrintfArguments object
-func getIntArg(tls *crt.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:28249:22: */
+func getIntArg(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:28292:22: */
if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed {
return int64(0)
}
- return Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(crt.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8)))
+ return Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(libc.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8)))
}
-func getDoubleArg(tls *crt.TLS, p uintptr) float64 { /* sqlite3.c:28253:15: */
+func getDoubleArg(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:28296:15: */
if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed {
return 0.0
}
- return Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(crt.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8)))
+ return Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(libc.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8)))
}
-func getTextArg(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:28257:13: */
+func getTextArg(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:28300:13: */
if (*PrintfArguments)(unsafe.Pointer(p)).FnArg <= (*PrintfArguments)(unsafe.Pointer(p)).FnUsed {
return uintptr(0)
}
- return Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(crt.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8)))
+ return Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer((*PrintfArguments)(unsafe.Pointer(p)).FapArg + uintptr(libc.PostIncInt32(&(*PrintfArguments)(unsafe.Pointer(p)).FnUsed, 1))*8)))
}
// Allocate memory for a temporary buffer needed for printf rendering.
@@ -12926,7 +13703,7 @@ func getTextArg(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:28257:13: */
// Do the size check before the memory allocation to prevent rogue
// SQL from requesting large allocations using the precision or width
// field of the printf() function.
-func printfTempBuf(tls *crt.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* sqlite3.c:28271:13: */
+func printfTempBuf(tls *libc.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* sqlite3.c:28314:13: */
var z uintptr
if (*Sqlite3_str)(unsafe.Pointer(pAccum)).FaccError != 0 {
return uintptr(0)
@@ -12948,7 +13725,7 @@ func printfTempBuf(tls *crt.TLS, pAccum uintptr, n Sqlite3_int64) uintptr { /* s
// Hard limit on the precision of floating-point conversions.
// Render a string given by "fmt" into the StrAccum object.
-func Xsqlite3_str_vappendf(tls *crt.TLS, pAccum uintptr, fmt uintptr, ap Va_list) { /* sqlite3.c:28304:17: */
+func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Va_list) { /* sqlite3.c:28347:17: */
bp := tls.Alloc(100)
defer tls.Free(100)
@@ -13037,7 +13814,7 @@ func Xsqlite3_str_vappendf(tls *crt.TLS, pAccum uintptr, fmt uintptr, ap Va_list
if !((int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags) & 0x02) != 0) {
goto __1
}
- pArgList = crt.VaUintptr(&ap)
+ pArgList = libc.VaUintptr(&ap)
bArgList = U8(1)
goto __2
__1:
@@ -13045,7 +13822,7 @@ __1:
__2:
;
__3:
- if !((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(fmt))))) != 0) {
+ if !((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(fmt))))) != 0) {
goto __5
}
if !(c != '%') {
@@ -13071,15 +13848,15 @@ __10:
;
__6:
;
- if !((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(crt.PreIncUintptr(&fmt, 1)))))) == 0) {
+ if !((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1)))))) == 0) {
goto __11
}
- Xsqlite3_str_append(tls, pAccum, ts+662 /* "%" */, 1)
+ Xsqlite3_str_append(tls, pAccum, ts+771 /* "%" */, 1)
goto __5
__11:
;
// Find out what flags are present
- flag_leftjustify = crt.AssignUint8(&flag_prefix, crt.AssignUint8(&cThousand, crt.AssignUint8(&flag_alternateform, crt.AssignUint8(&flag_altform2, crt.AssignUint8(&flag_zeropad, EtByte(0))))))
+ flag_leftjustify = libc.AssignUint8(&flag_prefix, libc.AssignUint8(&cThousand, libc.AssignUint8(&flag_alternateform, libc.AssignUint8(&flag_altform2, libc.AssignUint8(&flag_zeropad, EtByte(0))))))
done = EtByte(0)
width = 0
flag_long = EtByte(0)
@@ -13154,11 +13931,11 @@ __23:
goto __15
__24:
flag_long = EtByte(1)
- c = int32(*(*int8)(unsafe.Pointer(crt.PreIncUintptr(&fmt, 1))))
+ c = int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
if !(c == 'l') {
goto __36
}
- c = int32(*(*int8)(unsafe.Pointer(crt.PreIncUintptr(&fmt, 1))))
+ c = int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
flag_long = EtByte(2)
__36:
;
@@ -13175,7 +13952,7 @@ __32:
__33:
wx = (uint32(c - '0'))
__37:
- if !(((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(crt.PreIncUintptr(&fmt, 1)))))) >= '0') && (c <= '9')) {
+ if !(((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1)))))) >= '0') && (c <= '9')) {
goto __38
}
wx = (((wx * uint32(10)) + uint32(c)) - uint32('0'))
@@ -13201,7 +13978,7 @@ __34:
width = int32(getIntArg(tls, pArgList))
goto __42
__41:
- width = int32(crt.VaInt32(&ap))
+ width = int32(libc.VaInt32(&ap))
__42:
;
if !(width < 0) {
@@ -13215,16 +13992,16 @@ __42:
}
__43:
;
- if !(((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(fmt + uintptr(1)))))) != '.') && (c != 'l')) {
+ if !(((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(fmt + uintptr(1)))))) != '.') && (c != 'l')) {
goto __44
}
- c = int32(*(*int8)(unsafe.Pointer(crt.PreIncUintptr(&fmt, 1))))
+ c = int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
done = EtByte(1)
__44:
;
goto __15
__35:
- c = int32(*(*int8)(unsafe.Pointer(crt.PreIncUintptr(&fmt, 1))))
+ c = int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
if !(c == '*') {
goto __45
}
@@ -13234,7 +14011,7 @@ __35:
precision = int32(getIntArg(tls, pArgList))
goto __48
__47:
- precision = int32(crt.VaInt32(&ap))
+ precision = int32(libc.VaInt32(&ap))
__48:
;
if !(precision < 0) {
@@ -13247,7 +14024,7 @@ __48:
}
__49:
;
- c = int32(*(*int8)(unsafe.Pointer(crt.PreIncUintptr(&fmt, 1))))
+ c = int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
goto __46
__45:
px = uint32(0)
@@ -13256,7 +14033,7 @@ __50:
goto __51
}
px = (((px * uint32(10)) + uint32(c)) - uint32('0'))
- c = int32(*(*int8)(unsafe.Pointer(crt.PreIncUintptr(&fmt, 1))))
+ c = int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1))))
goto __50
__51:
;
@@ -13278,7 +14055,7 @@ __15:
;
goto __13
__13:
- if !(done != 0) && ((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(crt.PreIncUintptr(&fmt, 1)))))) != 0) {
+ if !(done != 0) && ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PreIncUintptr(&fmt, 1)))))) != 0) {
goto __12
}
goto __14
@@ -13328,12 +14105,12 @@ __56:
switch int32(xtype) {
case 13:
goto __59
- // Fall through into the next case
+ /* no break */
case 15:
goto __60
case 0:
goto __61
- // Fall through into the next case
+ /* no break */
case 16:
goto __62
case 1:
@@ -13376,11 +14153,11 @@ __59:
flag_long = uint8(0)
}
}
- // Fall through into the next case
+ /* no break */
__60:
__61:
cThousand = EtByte(0)
- // Fall through into the next case
+ /* no break */
__62:
if !((int32((*Et_info)(unsafe.Pointer(infop)).Fflags) & 1) != 0) {
goto __77
@@ -13397,15 +14174,15 @@ __79:
if !(int32(flag_long) == 2) {
goto __83
}
- v = I64(crt.VaInt64(&ap))
+ v = I64(libc.VaInt64(&ap))
goto __84
__83:
- v = I64(crt.VaInt64(&ap))
+ v = I64(libc.VaInt64(&ap))
__84:
;
goto __82
__81:
- v = I64(crt.VaInt32(&ap))
+ v = I64(libc.VaInt32(&ap))
__82:
;
__80:
@@ -13443,15 +14220,15 @@ __89:
if !(int32(flag_long) == 2) {
goto __93
}
- longvalue = Sqlite_uint64(crt.VaUint64(&ap))
+ longvalue = Sqlite_uint64(libc.VaUint64(&ap))
goto __94
__93:
- longvalue = Sqlite_uint64(crt.VaUint64(&ap))
+ longvalue = Sqlite_uint64(libc.VaUint64(&ap))
__94:
;
goto __92
__91:
- longvalue = Sqlite_uint64(crt.VaUint32(&ap))
+ longvalue = Sqlite_uint64(libc.VaUint32(&ap))
__92:
;
__90:
@@ -13465,10 +14242,10 @@ __78:
flag_alternateform = EtByte(0)
__95:
;
- if !((flag_zeropad != 0) && (precision < (width - (crt.Bool32(int32(prefix) != 0))))) {
+ if !((flag_zeropad != 0) && (precision < (width - (libc.Bool32(int32(prefix) != 0))))) {
goto __96
}
- precision = (width - (crt.Bool32(int32(prefix) != 0)))
+ precision = (width - (libc.Bool32(int32(prefix) != 0)))
__96:
;
if !(precision < ((70 - 10) - (70 / 3))) {
@@ -13485,7 +14262,7 @@ __97:
n = n + (U64(precision / 3))
__99:
;
- zOut = crt.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, int64(n)))
+ zOut = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, int64(n)))
if !(zOut == uintptr(0)) {
goto __100
}
@@ -13506,15 +14283,15 @@ __98:
x = 0
__102:
;
- *(*int8)(unsafe.Pointer(crt.PreDecUintptr(&bufpt, 1))) = zOrd[((x * 2) + 1)]
- *(*int8)(unsafe.Pointer(crt.PreDecUintptr(&bufpt, 1))) = zOrd[(x * 2)]
+ *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = zOrd[((x * 2) + 1)]
+ *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = zOrd[(x * 2)]
__101:
;
cset = (uintptr(unsafe.Pointer(&aDigits)) + uintptr((*Et_info)(unsafe.Pointer(infop)).Fcharset))
base = (*Et_info)(unsafe.Pointer(infop)).Fbase
__103: // Convert to ascii
- *(*int8)(unsafe.Pointer(crt.PreDecUintptr(&bufpt, 1))) = *(*int8)(unsafe.Pointer(cset + uintptr((longvalue % Sqlite_uint64(base)))))
+ *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = *(*int8)(unsafe.Pointer(cset + uintptr((longvalue % Sqlite_uint64(base)))))
longvalue = (longvalue / Sqlite_uint64(base))
goto __104
__104:
@@ -13529,7 +14306,7 @@ __106:
if !(precision > length) {
goto __107
}
- *(*int8)(unsafe.Pointer(crt.PreDecUintptr(&bufpt, 1))) = int8('0') // Zero pad
+ *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = int8('0') // Zero pad
length++
goto __106
__107:
@@ -13550,7 +14327,7 @@ __109:
if !(ix == 0) {
goto __112
}
- *(*int8)(unsafe.Pointer(bufpt + uintptr(crt.PreIncInt32(&idx, 1)))) = int8(cThousand)
+ *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PreIncInt32(&idx, 1)))) = int8(cThousand)
nn--
ix = 3
__112:
@@ -13567,7 +14344,7 @@ __108:
if !(prefix != 0) {
goto __113
}
- *(*int8)(unsafe.Pointer(crt.PreDecUintptr(&bufpt, 1))) = prefix
+ *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = prefix
__113:
; // Add sign
if !((flag_alternateform != 0) && ((*Et_info)(unsafe.Pointer(infop)).Fprefix != 0)) {
@@ -13575,10 +14352,10 @@ __113:
}
pre = (uintptr(unsafe.Pointer(&aPrefix)) + uintptr((*Et_info)(unsafe.Pointer(infop)).Fprefix))
__115:
- if !((int32(crt.AssignInt8(&x1, *(*int8)(unsafe.Pointer(pre))))) != 0) {
+ if !((int32(libc.AssignInt8(&x1, *(*int8)(unsafe.Pointer(pre))))) != 0) {
goto __117
}
- *(*int8)(unsafe.Pointer(crt.PreDecUintptr(&bufpt, 1))) = x1
+ *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = x1
goto __116
__116:
pre++
@@ -13599,7 +14376,7 @@ __65:
*(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) = getDoubleArg(tls, pArgList)
goto __119
__118:
- *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) = float64(crt.VaFloat64(&ap))
+ *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */)) = float64(libc.VaFloat64(&ap))
__119:
;
if !(precision < 0) {
@@ -13646,7 +14423,7 @@ __126:
goto __127
}
*(*float64)(unsafe.Pointer(bp + 80 /* rx */)) = *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */))
- crt.Xmemcpy(tls, bp+72 /* &u */, bp+80 /* &rx */, uint64(unsafe.Sizeof(Sqlite3_uint64(0))))
+ libc.Xmemcpy(tls, bp+72 /* &u */, bp+80 /* &rx */, uint64(unsafe.Sizeof(Sqlite3_uint64(0))))
ex = (-1023 + (int32((*(*Sqlite3_uint64)(unsafe.Pointer(bp + 72 /* u */)) >> 52) & uint64(0x7ff))))
if !((precision + (ex / 3)) < 15) {
goto __128
@@ -13662,7 +14439,7 @@ __127:
if !(Xsqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(bp + 88 /* realvalue */))) != 0) {
goto __129
}
- bufpt = ts + 664 /* "NaN" */
+ bufpt = ts + 773 /* "NaN" */
length = 3
goto __58
__129:
@@ -13722,8 +14499,8 @@ __140:
}
bufpt = bp /* &buf[0] */
*(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(0))) = prefix
- crt.Xmemcpy(tls, (bp /* &buf[0] */ + uintptr((crt.Bool32(int32(prefix) != 0)))), ts+668 /* "Inf" */, uint64(4))
- length = (3 + (crt.Bool32(int32(prefix) != 0)))
+ libc.Xmemcpy(tls, (bp /* &buf[0] */ + uintptr((libc.Bool32(int32(prefix) != 0)))), ts+777 /* "Inf" */, uint64(4))
+ length = (3 + (libc.Bool32(int32(prefix) != 0)))
goto __58
__141:
;
@@ -13748,7 +14525,7 @@ __142:
if !(int32(xtype) == 3) {
goto __144
}
- flag_rtz = crt.BoolUint8(!(flag_alternateform != 0))
+ flag_rtz = libc.BoolUint8(!(flag_alternateform != 0))
if !((exp < -4) || (exp > precision)) {
goto __146
}
@@ -13783,7 +14560,7 @@ __149:
if !(szBufNeeded > int64(70)) {
goto __150
}
- bufpt = crt.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, szBufNeeded))
+ bufpt = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, szBufNeeded))
if !(bufpt == uintptr(0)) {
goto __151
}
@@ -13804,14 +14581,14 @@ __150:
if !(prefix != 0) {
goto __152
}
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = prefix
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = prefix
__152:
;
// Digits prior to the decimal point
if !(e2 < 0) {
goto __153
}
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = int8('0')
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('0')
goto __154
__153:
;
@@ -13819,7 +14596,7 @@ __155:
if !(e2 >= 0) {
goto __157
}
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = et_getdigit(tls, bp+88 /* &realvalue */, bp+96 /* &nsd */)
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = et_getdigit(tls, bp+88 /* &realvalue */, bp+96 /* &nsd */)
goto __156
__156:
e2--
@@ -13833,7 +14610,7 @@ __154:
if !(flag_dp != 0) {
goto __158
}
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = int8('.')
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('.')
__158:
;
// "0" digits after the decimal point but before the first
@@ -13844,7 +14621,7 @@ __159:
goto __161
}
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = int8('0')
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('0')
goto __160
__160:
precision--
@@ -13855,10 +14632,10 @@ __161:
;
// Significant digits after the decimal point
__162:
- if !((crt.PostDecInt32(&precision, 1)) > 0) {
+ if !((libc.PostDecInt32(&precision, 1)) > 0) {
goto __163
}
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = et_getdigit(tls, bp+88 /* &realvalue */, bp+96 /* &nsd */)
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = et_getdigit(tls, bp+88 /* &realvalue */, bp+96 /* &nsd */)
goto __162
__163:
;
@@ -13867,24 +14644,24 @@ __163:
goto __164
}
__165:
- if !(int32(*(*int8)(unsafe.Pointer(bufpt + crt.UintptrFromInt32(-1)))) == '0') {
+ if !(int32(*(*int8)(unsafe.Pointer(bufpt + libc.UintptrFromInt32(-1)))) == '0') {
goto __166
}
- *(*int8)(unsafe.Pointer(crt.PreDecUintptr(&bufpt, 1))) = int8(0)
+ *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = int8(0)
goto __165
__166:
;
- if !(int32(*(*int8)(unsafe.Pointer(bufpt + crt.UintptrFromInt32(-1)))) == '.') {
+ if !(int32(*(*int8)(unsafe.Pointer(bufpt + libc.UintptrFromInt32(-1)))) == '.') {
goto __167
}
if !(flag_altform2 != 0) {
goto __168
}
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = int8('0')
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('0')
goto __169
__168:
- *(*int8)(unsafe.Pointer(crt.PreDecUintptr(&bufpt, 1))) = int8(0)
+ *(*int8)(unsafe.Pointer(libc.PreDecUintptr(&bufpt, 1))) = int8(0)
__169:
;
__167:
@@ -13895,26 +14672,26 @@ __164:
if !(int32(xtype) == 2) {
goto __170
}
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = aDigits[(*Et_info)(unsafe.Pointer(infop)).Fcharset]
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = aDigits[(*Et_info)(unsafe.Pointer(infop)).Fcharset]
if !(exp < 0) {
goto __171
}
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = int8('-')
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('-')
exp = -exp
goto __172
__171:
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = int8('+')
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = int8('+')
__172:
;
if !(exp >= 100) {
goto __173
}
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = (int8((exp / 100) + '0')) // 100's digit
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = (int8((exp / 100) + '0')) // 100's digit
exp = exp % (100)
__173:
;
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = (int8((exp / 10) + '0')) // 10's digit
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))) = (int8((exp % 10) + '0'))
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = (int8((exp / 10) + '0')) // 10's digit
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))) = (int8((exp % 10) + '0'))
__170:
;
*(*int8)(unsafe.Pointer(bufpt)) = int8(0)
@@ -13944,12 +14721,12 @@ __176:
goto __177
__177:
;
- i = (crt.Bool32(int32(prefix) != 0))
+ i = (libc.Bool32(int32(prefix) != 0))
__178:
- if !(crt.PostDecInt32(&nPad, 1) != 0) {
+ if !(libc.PostDecInt32(&nPad, 1) != 0) {
goto __179
}
- *(*int8)(unsafe.Pointer(bufpt + uintptr(crt.PostIncInt32(&i, 1)))) = int8('0')
+ *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&i, 1)))) = int8('0')
goto __178
__179:
;
@@ -13961,10 +14738,10 @@ __66:
if !(!(bArgList != 0)) {
goto __180
}
- *(*int32)(unsafe.Pointer(crt.VaUintptr(&ap))) = int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar)
+ *(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar)
__180:
;
- length = crt.AssignInt32(&width, 0)
+ length = libc.AssignInt32(&width, 0)
goto __58
__67:
*(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(0))) = int8('%')
@@ -13980,7 +14757,7 @@ __68:
if !(bufpt != 0) {
goto __183
}
- *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(0))) = int8(crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1))))))
+ *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(0))) = int8(libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1))))))
if !((c & 0xc0) == 0xc0) {
goto __185
}
@@ -13988,7 +14765,7 @@ __186:
if !((length < 4) && ((int32(*(*int8)(unsafe.Pointer(bufpt + uintptr(0)))) & 0xc0) == 0x80)) {
goto __187
}
- *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(crt.PostIncInt32(&length, 1)))) = *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&bufpt, 1)))
+ *(*int8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(libc.PostIncInt32(&length, 1)))) = *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&bufpt, 1)))
goto __186
__187:
;
@@ -14001,7 +14778,7 @@ __184:
;
goto __182
__181:
- ch = uint32(crt.VaUint32(&ap))
+ ch = uint32(libc.VaUint32(&ap))
if !(ch < uint32(0x00080)) {
goto __188
}
@@ -14051,7 +14828,7 @@ __182:
__195:
;
__196:
- if !(crt.PostDecInt32(&precision, 1) > 1) {
+ if !(libc.PostDecInt32(&precision, 1) > 1) {
goto __197
}
Xsqlite3_str_append(tls, pAccum, bp /* &buf[0] */, length)
@@ -14072,13 +14849,13 @@ __70:
xtype = EtByte(5)
goto __199
__198:
- bufpt = crt.VaUintptr(&ap)
+ bufpt = libc.VaUintptr(&ap)
__199:
;
if !(bufpt == uintptr(0)) {
goto __200
}
- bufpt = ts + 672 /* "" */
+ bufpt = ts + 781 /* "" */
goto __201
__200:
if !(int32(xtype) == 6) {
@@ -14097,7 +14874,7 @@ __200:
(*Sqlite3_str)(unsafe.Pointer(pAccum)).FzText = bufpt
(*Sqlite3_str)(unsafe.Pointer(pAccum)).FnAlloc = U32(Xsqlite3DbMallocSize(tls, (*Sqlite3_str)(unsafe.Pointer(pAccum)).Fdb, bufpt))
- (*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar = (U32(0x7fffffff & int32(crt.Xstrlen(tls, bufpt))))
+ (*Sqlite3_str)(unsafe.Pointer(pAccum)).FnChar = (U32(0x7fffffff & int32(libc.Xstrlen(tls, bufpt))))
*(*U8)(unsafe.Pointer(pAccum + 29 /* &.printfFlags */)) |= U8((0x04))
length = 0
goto __58
@@ -14118,10 +14895,10 @@ __201:
// precision characters
z = bufpt
__208:
- if !((crt.PostDecInt32(&precision, 1) > 0) && (*(*uint8)(unsafe.Pointer(z + uintptr(0))) != 0)) {
+ if !((libc.PostDecInt32(&precision, 1) > 0) && (*(*uint8)(unsafe.Pointer(z + uintptr(0))) != 0)) {
goto __209
}
- if !((int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) >= 0xc0) {
+ if !((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) >= 0xc0) {
goto __210
}
__211:
@@ -14156,7 +14933,7 @@ __207:
;
goto __205
__204:
- length = (0x7fffffff & int32(crt.Xstrlen(tls, bufpt)))
+ length = (0x7fffffff & int32(libc.Xstrlen(tls, bufpt)))
__205:
;
adjust_width_for_utf8:
@@ -14169,7 +14946,7 @@ __217:
if !(ii >= 0) {
goto __218
}
- if !((int32(*(*int8)(unsafe.Pointer(bufpt + uintptr(crt.PostDecInt32(&ii, 1))))) & 0xc0) == 0x80) {
+ if !((int32(*(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostDecInt32(&ii, 1))))) & 0xc0) == 0x80) {
goto __219
}
width++
@@ -14197,18 +14974,18 @@ __73:
escarg = getTextArg(tls, pArgList)
goto __221
__220:
- escarg = crt.VaUintptr(&ap)
+ escarg = libc.VaUintptr(&ap)
__221:
;
- isnull = (crt.Bool32(escarg == uintptr(0)))
+ isnull = (libc.Bool32(escarg == uintptr(0)))
if !(isnull != 0) {
goto __222
}
escarg = func() uintptr {
if int32(xtype) == 10 {
- return ts + 673 /* "NULL" */
+ return ts + 782 /* "NULL" */
}
- return ts + 678 /* "(NULL)" */
+ return ts + 787 /* "(NULL)" */
}()
__222:
;
@@ -14217,9 +14994,9 @@ __222:
// Because of the extra quoting characters inserted, the number
// of output characters may be larger than the precision.
k = precision
- i1 = crt.AssignInt32(&n1, 0)
+ i1 = libc.AssignInt32(&n1, 0)
__223:
- if !((k != 0) && ((int32(crt.AssignInt8(&ch1, *(*int8)(unsafe.Pointer(escarg + uintptr(i1)))))) != 0)) {
+ if !((k != 0) && ((int32(libc.AssignInt8(&ch1, *(*int8)(unsafe.Pointer(escarg + uintptr(i1)))))) != 0)) {
goto __225
}
if !(int32(ch1) == int32(q)) {
@@ -14249,12 +15026,12 @@ __224:
goto __225
__225:
;
- needQuote = (crt.Bool32(!(isnull != 0) && (int32(xtype) == 10)))
+ needQuote = (libc.Bool32(!(isnull != 0) && (int32(xtype) == 10)))
n1 = n1 + (i1 + 3)
if !(n1 > 70) {
goto __230
}
- bufpt = crt.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, int64(n1)))
+ bufpt = libc.AssignUintptr(&zExtra, printfTempBuf(tls, pAccum, int64(n1)))
if !(bufpt == uintptr(0)) {
goto __232
}
@@ -14270,7 +15047,7 @@ __231:
if !(needQuote != 0) {
goto __233
}
- *(*int8)(unsafe.Pointer(bufpt + uintptr(crt.PostIncInt32(&j, 1)))) = q
+ *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&j, 1)))) = q
__233:
;
k = i1
@@ -14279,11 +15056,11 @@ __234:
if !(i1 < k) {
goto __236
}
- *(*int8)(unsafe.Pointer(bufpt + uintptr(crt.PostIncInt32(&j, 1)))) = crt.AssignInt8(&ch1, *(*int8)(unsafe.Pointer(escarg + uintptr(i1))))
+ *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&j, 1)))) = libc.AssignInt8(&ch1, *(*int8)(unsafe.Pointer(escarg + uintptr(i1))))
if !(int32(ch1) == int32(q)) {
goto __237
}
- *(*int8)(unsafe.Pointer(bufpt + uintptr(crt.PostIncInt32(&j, 1)))) = ch1
+ *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&j, 1)))) = ch1
__237:
;
goto __235
@@ -14296,7 +15073,7 @@ __236:
if !(needQuote != 0) {
goto __238
}
- *(*int8)(unsafe.Pointer(bufpt + uintptr(crt.PostIncInt32(&j, 1)))) = q
+ *(*int8)(unsafe.Pointer(bufpt + uintptr(libc.PostIncInt32(&j, 1)))) = q
__238:
;
*(*int8)(unsafe.Pointer(bufpt + uintptr(j))) = int8(0)
@@ -14309,7 +15086,7 @@ __74:
return
__239:
;
- pToken = crt.VaUintptr(&ap)
+ pToken = libc.VaUintptr(&ap)
if !((pToken != 0) && ((*Token)(unsafe.Pointer(pToken)).Fn != 0)) {
goto __240
@@ -14317,7 +15094,7 @@ __239:
Xsqlite3_str_append(tls, pAccum, (*Token)(unsafe.Pointer(pToken)).Fz, int32((*Token)(unsafe.Pointer(pToken)).Fn))
__240:
;
- length = crt.AssignInt32(&width, 0)
+ length = libc.AssignInt32(&width, 0)
goto __58
__75:
if !((int32((*Sqlite3_str)(unsafe.Pointer(pAccum)).FprintfFlags) & 0x01) == 0) {
@@ -14326,19 +15103,19 @@ __75:
return
__241:
;
- pSrc = crt.VaUintptr(&ap)
- k1 = int32(crt.VaInt32(&ap))
+ pSrc = libc.VaUintptr(&ap)
+ k1 = int32(libc.VaInt32(&ap))
pItem = ((pSrc + 8 /* &.a */) + uintptr(k1)*112)
if !((*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase != 0) {
goto __242
}
Xsqlite3_str_appendall(tls, pAccum, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase)
- Xsqlite3_str_append(tls, pAccum, ts+685 /* "." */, 1)
+ Xsqlite3_str_append(tls, pAccum, ts+794 /* "." */, 1)
__242:
;
Xsqlite3_str_appendall(tls, pAccum, (*SrcList_item)(unsafe.Pointer(pItem)).FzName)
- length = crt.AssignInt32(&width, 0)
+ length = libc.AssignInt32(&width, 0)
goto __58
__76:
;
@@ -14390,14 +15167,14 @@ __5:
// End for loop over the format string
}
-var zOrd = *(*[9]int8)(unsafe.Pointer(ts + 687 /* "thstndrd" */)) /* sqlite3.c:28568:29 */ // End of function
+var zOrd = *(*[9]int8)(unsafe.Pointer(ts + 796 /* "thstndrd" */)) /* sqlite3.c:28611:29 */ // End of function
// Enlarge the memory allocation on a StrAccum object so that it is
// able to accept at least N more bytes of text.
//
// Return the number of bytes of text that StrAccum is able to accept
// after the attempted enlargement. The value returned might be zero.
-func sqlite3StrAccumEnlarge(tls *crt.TLS, p uintptr, N int32) int32 { /* sqlite3.c:29008:12: */
+func sqlite3StrAccumEnlarge(tls *libc.TLS, p uintptr, N int32) int32 { /* sqlite3.c:29051:12: */
var zNew uintptr
// Only called if really needed
if (*StrAccum)(unsafe.Pointer(p)).FaccError != 0 {
@@ -14436,7 +15213,7 @@ func sqlite3StrAccumEnlarge(tls *crt.TLS, p uintptr, N int32) int32 { /* sqlite3
if zNew != 0 {
if !((int32((*StrAccum)(unsafe.Pointer((p))).FprintfFlags) & 0x04) != 0) && ((*StrAccum)(unsafe.Pointer(p)).FnChar > U32(0)) {
- crt.Xmemcpy(tls, zNew, (*StrAccum)(unsafe.Pointer(p)).FzText, uint64((*StrAccum)(unsafe.Pointer(p)).FnChar))
+ libc.Xmemcpy(tls, zNew, (*StrAccum)(unsafe.Pointer(p)).FzText, uint64((*StrAccum)(unsafe.Pointer(p)).FnChar))
}
(*StrAccum)(unsafe.Pointer(p)).FzText = zNew
(*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(Xsqlite3DbMallocSize(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, zNew))
@@ -14451,13 +15228,13 @@ func sqlite3StrAccumEnlarge(tls *crt.TLS, p uintptr, N int32) int32 { /* sqlite3
}
// Append N copies of character c to the given string buffer.
-func Xsqlite3_str_appendchar(tls *crt.TLS, p uintptr, N int32, c int8) { /* sqlite3.c:29058:17: */
+func Xsqlite3_str_appendchar(tls *libc.TLS, p uintptr, N int32, c int8) { /* sqlite3.c:29101:17: */
- if ((I64((*Sqlite3_str)(unsafe.Pointer(p)).FnChar) + I64(N)) >= I64((*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc)) && ((crt.AssignInt32(&N, sqlite3StrAccumEnlarge(tls, p, N))) <= 0) {
+ if ((I64((*Sqlite3_str)(unsafe.Pointer(p)).FnChar) + I64(N)) >= I64((*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc)) && ((libc.AssignInt32(&N, sqlite3StrAccumEnlarge(tls, p, N))) <= 0) {
return
}
- for (crt.PostDecInt32(&N, 1)) > 0 {
- *(*int8)(unsafe.Pointer((*Sqlite3_str)(unsafe.Pointer(p)).FzText + uintptr(crt.PostIncUint32(&(*Sqlite3_str)(unsafe.Pointer(p)).FnChar, 1)))) = c
+ for (libc.PostDecInt32(&N, 1)) > 0 {
+ *(*int8)(unsafe.Pointer((*Sqlite3_str)(unsafe.Pointer(p)).FzText + uintptr(libc.PostIncUint32(&(*Sqlite3_str)(unsafe.Pointer(p)).FnChar, 1)))) = c
}
}
@@ -14467,41 +15244,41 @@ func Xsqlite3_str_appendchar(tls *crt.TLS, p uintptr, N int32, c int8) { /* sqli
// This is a helper routine to sqlite3_str_append() that does special-case
// work (enlarging the buffer) using tail recursion, so that the
// sqlite3_str_append() routine can use fast calling semantics.
-func enlargeAndAppend(tls *crt.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29074:29: */
+func enlargeAndAppend(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29117:29: */
N = sqlite3StrAccumEnlarge(tls, p, N)
if N > 0 {
- crt.Xmemcpy(tls, ((*StrAccum)(unsafe.Pointer(p)).FzText + uintptr((*StrAccum)(unsafe.Pointer(p)).FnChar)), z, uint64(N))
+ libc.Xmemcpy(tls, ((*StrAccum)(unsafe.Pointer(p)).FzText + uintptr((*StrAccum)(unsafe.Pointer(p)).FnChar)), z, uint64(N))
*(*U32)(unsafe.Pointer(p + 24 /* &.nChar */)) += (U32(N))
}
}
// Append N bytes of text from z to the StrAccum object. Increase the
// size of the memory allocation for StrAccum if necessary.
-func Xsqlite3_str_append(tls *crt.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29086:17: */
+func Xsqlite3_str_append(tls *libc.TLS, p uintptr, z uintptr, N int32) { /* sqlite3.c:29129:17: */
if ((*Sqlite3_str)(unsafe.Pointer(p)).FnChar + U32(N)) >= (*Sqlite3_str)(unsafe.Pointer(p)).FnAlloc {
enlargeAndAppend(tls, p, z, N)
} else if N != 0 {
*(*U32)(unsafe.Pointer(p + 24 /* &.nChar */)) += (U32(N))
- crt.Xmemcpy(tls, ((*Sqlite3_str)(unsafe.Pointer(p)).FzText + uintptr(((*Sqlite3_str)(unsafe.Pointer(p)).FnChar - U32(N)))), z, uint64(N))
+ libc.Xmemcpy(tls, ((*Sqlite3_str)(unsafe.Pointer(p)).FzText + uintptr(((*Sqlite3_str)(unsafe.Pointer(p)).FnChar - U32(N)))), z, uint64(N))
}
}
// Append the complete text of zero-terminated string z[] to the p string.
-func Xsqlite3_str_appendall(tls *crt.TLS, p uintptr, z uintptr) { /* sqlite3.c:29103:17: */
+func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:29146:17: */
Xsqlite3_str_append(tls, p, z, Xsqlite3Strlen30(tls, z))
}
// Finish off a string by making sure it is zero-terminated.
// Return a pointer to the resulting string. Return a NULL
// pointer if any kind of error was encountered.
-func strAccumFinishRealloc(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:29113:29: */
+func strAccumFinishRealloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29156:29: */
var zText uintptr
zText = Xsqlite3DbMallocRaw(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, (uint64((*StrAccum)(unsafe.Pointer(p)).FnChar + U32(1))))
if zText != 0 {
- crt.Xmemcpy(tls, zText, (*StrAccum)(unsafe.Pointer(p)).FzText, (uint64((*StrAccum)(unsafe.Pointer(p)).FnChar + U32(1))))
+ libc.Xmemcpy(tls, zText, (*StrAccum)(unsafe.Pointer(p)).FzText, (uint64((*StrAccum)(unsafe.Pointer(p)).FnChar + U32(1))))
*(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) |= U8((0x04))
} else {
setStrAccumError(tls, p, uint8(7))
@@ -14509,7 +15286,7 @@ func strAccumFinishRealloc(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:29113
(*StrAccum)(unsafe.Pointer(p)).FzText = zText
return zText
}
-func Xsqlite3StrAccumFinish(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:29126:21: */
+func Xsqlite3StrAccumFinish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29169:21: */
if (*StrAccum)(unsafe.Pointer(p)).FzText != 0 {
*(*int8)(unsafe.Pointer((*StrAccum)(unsafe.Pointer(p)).FzText + uintptr((*StrAccum)(unsafe.Pointer(p)).FnChar))) = int8(0)
if ((*StrAccum)(unsafe.Pointer(p)).FmxAlloc > U32(0)) && !((int32((*StrAccum)(unsafe.Pointer((p))).FprintfFlags) & 0x04) != 0) {
@@ -14523,10 +15300,10 @@ func Xsqlite3StrAccumFinish(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:2912
// sqlite3_malloc() fails to provide space for a real one. This
// sqlite3_str object accepts no new text and always returns
// an SQLITE_NOMEM error.
-var sqlite3OomStr = Sqlite3_str{Fdb: uintptr(0), FzText: uintptr(0), FnAlloc: U32(0), FmxAlloc: U32(0), FnChar: U32(0), FaccError: U8(7), FprintfFlags: U8(0)} /* sqlite3.c:29142:20 */
+var sqlite3OomStr = Sqlite3_str{Fdb: uintptr(0), FzText: uintptr(0), FnAlloc: U32(0), FmxAlloc: U32(0), FnChar: U32(0), FaccError: U8(7), FprintfFlags: U8(0)} /* sqlite3.c:29185:20 */
// Finalize a string created using sqlite3_str_new().
-func Xsqlite3_str_finish(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:29148:17: */
+func Xsqlite3_str_finish(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29191:17: */
var z uintptr
if (p != uintptr(0)) && (p != uintptr(unsafe.Pointer(&sqlite3OomStr))) {
z = Xsqlite3StrAccumFinish(tls, p)
@@ -14538,7 +15315,7 @@ func Xsqlite3_str_finish(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:29148:1
}
// Return any error code associated with p
-func Xsqlite3_str_errcode(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:29160:16: */
+func Xsqlite3_str_errcode(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29203:16: */
if p != 0 {
return int32((*Sqlite3_str)(unsafe.Pointer(p)).FaccError)
}
@@ -14546,7 +15323,7 @@ func Xsqlite3_str_errcode(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:29160:16
}
// Return the current length of p in bytes
-func Xsqlite3_str_length(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:29165:16: */
+func Xsqlite3_str_length(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:29208:16: */
if p != 0 {
return int32((*Sqlite3_str)(unsafe.Pointer(p)).FnChar)
}
@@ -14554,7 +15331,7 @@ func Xsqlite3_str_length(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:29165:16:
}
// Return the current value for p
-func Xsqlite3_str_value(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:29170:17: */
+func Xsqlite3_str_value(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:29213:17: */
if (p == uintptr(0)) || ((*Sqlite3_str)(unsafe.Pointer(p)).FnChar == U32(0)) {
return uintptr(0)
}
@@ -14563,10 +15340,10 @@ func Xsqlite3_str_value(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:29170:17
}
// Reset an StrAccum string. Reclaim all malloced memory.
-func Xsqlite3_str_reset(tls *crt.TLS, p uintptr) { /* sqlite3.c:29179:17: */
+func Xsqlite3_str_reset(tls *libc.TLS, p uintptr) { /* sqlite3.c:29222:17: */
if (int32((*StrAccum)(unsafe.Pointer((p))).FprintfFlags) & 0x04) != 0 {
Xsqlite3DbFree(tls, (*StrAccum)(unsafe.Pointer(p)).Fdb, (*StrAccum)(unsafe.Pointer(p)).FzText)
- *(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(0x04))))
+ *(*U8)(unsafe.Pointer(p + 29 /* &.printfFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(0x04))))
}
(*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(0)
(*StrAccum)(unsafe.Pointer(p)).FnChar = U32(0)
@@ -14585,7 +15362,7 @@ func Xsqlite3_str_reset(tls *crt.TLS, p uintptr) { /* sqlite3.c:29179:17: */
// n then no memory allocations ever occur.
// mx: Maximum number of bytes to accumulate. If mx==0 then no memory
// allocations will ever occur.
-func Xsqlite3StrAccumInit(tls *crt.TLS, p uintptr, db uintptr, zBase uintptr, n int32, mx int32) { /* sqlite3.c:29203:21: */
+func Xsqlite3StrAccumInit(tls *libc.TLS, p uintptr, db uintptr, zBase uintptr, n int32, mx int32) { /* sqlite3.c:29246:21: */
(*StrAccum)(unsafe.Pointer(p)).FzText = zBase
(*StrAccum)(unsafe.Pointer(p)).Fdb = db
(*StrAccum)(unsafe.Pointer(p)).FnAlloc = U32(n)
@@ -14596,7 +15373,7 @@ func Xsqlite3StrAccumInit(tls *crt.TLS, p uintptr, db uintptr, zBase uintptr, n
}
// Allocate and initialize a new dynamic string object
-func Xsqlite3_str_new(tls *crt.TLS, db uintptr) uintptr { /* sqlite3.c:29214:24: */
+func Xsqlite3_str_new(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:29257:24: */
var p uintptr = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Sqlite3_str{})))
if p != 0 {
Xsqlite3StrAccumInit(tls, p, uintptr(0), uintptr(0), 0,
@@ -14614,7 +15391,7 @@ func Xsqlite3_str_new(tls *crt.TLS, db uintptr) uintptr { /* sqlite3.c:29214:24:
// Print into memory obtained from sqliteMalloc(). Use the internal
// %-conversion extensions.
-func Xsqlite3VMPrintf(tls *crt.TLS, db uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29229:21: */
+func Xsqlite3VMPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29272:21: */
bp := tls.Alloc(102)
defer tls.Free(102)
@@ -14636,7 +15413,7 @@ func Xsqlite3VMPrintf(tls *crt.TLS, db uintptr, zFormat uintptr, ap Va_list) uin
// Print into memory obtained from sqliteMalloc(). Use the internal
// %-conversion extensions.
-func Xsqlite3MPrintf(tls *crt.TLS, db uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29249:21: */
+func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29292:21: */
var ap Va_list
_ = ap
var z uintptr
@@ -14648,7 +15425,7 @@ func Xsqlite3MPrintf(tls *crt.TLS, db uintptr, zFormat uintptr, va uintptr) uint
// Print into memory obtained from sqlite3_malloc(). Omit the internal
// %-conversion extensions.
-func Xsqlite3_vmprintf(tls *crt.TLS, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29262:17: */
+func Xsqlite3_vmprintf(tls *libc.TLS, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29305:17: */
bp := tls.Alloc(102)
defer tls.Free(102)
@@ -14668,7 +15445,7 @@ func Xsqlite3_vmprintf(tls *crt.TLS, zFormat uintptr, ap Va_list) uintptr { /* s
// Print into memory obtained from sqlite3_malloc()(). Omit the internal
// %-conversion extensions.
-func Xsqlite3_mprintf(tls *crt.TLS, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29286:17: */
+func Xsqlite3_mprintf(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29329:17: */
var ap Va_list
_ = ap
var z uintptr
@@ -14692,7 +15469,7 @@ func Xsqlite3_mprintf(tls *crt.TLS, zFormat uintptr, va uintptr) uintptr { /* sq
// mistake.
//
// sqlite3_vsnprintf() is the varargs version.
-func Xsqlite3_vsnprintf(tls *crt.TLS, n int32, zBuf uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29311:17: */
+func Xsqlite3_vsnprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, ap Va_list) uintptr { /* sqlite3.c:29354:17: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -14706,7 +15483,7 @@ func Xsqlite3_vsnprintf(tls *crt.TLS, n int32, zBuf uintptr, zFormat uintptr, ap
*(*int8)(unsafe.Pointer(zBuf + uintptr((*StrAccum)(unsafe.Pointer(bp /* &acc */)).FnChar))) = int8(0)
return zBuf
}
-func Xsqlite3_snprintf(tls *crt.TLS, n int32, zBuf uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29326:17: */
+func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va uintptr) uintptr { /* sqlite3.c:29369:17: */
var z uintptr
var ap Va_list
_ = ap
@@ -14728,7 +15505,7 @@ func Xsqlite3_snprintf(tls *crt.TLS, n int32, zBuf uintptr, zFormat uintptr, va
// certain format characters (%q) or for very large precisions or widths.
// Care must be taken that any sqlite3_log() calls that occur while the
// memory mutex is held do not use these mechanisms.
-func renderLogMsg(tls *crt.TLS, iErrCode int32, zFormat uintptr, ap Va_list) { /* sqlite3.c:29349:13: */
+func renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Va_list) { /* sqlite3.c:29392:13: */
bp := tls.Alloc(242)
defer tls.Free(242)
@@ -14739,12 +15516,12 @@ func renderLogMsg(tls *crt.TLS, iErrCode int32, zFormat uintptr, ap Va_list) { /
Xsqlite3StrAccumInit(tls, bp /* &acc */, uintptr(0), bp+32 /* &zMsg[0] */, int32(unsafe.Sizeof([210]int8{})), 0)
Xsqlite3_str_vappendf(tls, bp /* &acc */, zFormat, ap)
- (*(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 376 /* &.xLog */))))(tls, Xsqlite3Config.FpLogArg, iErrCode,
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 376 /* &.xLog */))))(tls, Xsqlite3Config.FpLogArg, iErrCode,
Xsqlite3StrAccumFinish(tls, bp /* &acc */))
}
// Format and write a message to the log if logging is enabled.
-func Xsqlite3_log(tls *crt.TLS, iErrCode int32, zFormat uintptr, va uintptr) { /* sqlite3.c:29362:17: */
+func Xsqlite3_log(tls *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr) { /* sqlite3.c:29405:17: */
var ap Va_list
_ = ap // Vararg list
if Xsqlite3Config.FxLog != 0 {
@@ -14757,7 +15534,7 @@ func Xsqlite3_log(tls *crt.TLS, iErrCode int32, zFormat uintptr, va uintptr) { /
// A version of printf() that understands %lld. Used for debugging.
// The printf() built into some versions of windows does not understand %lld
// and segfaults if you give it a long long int.
-func Xsqlite3DebugPrintf(tls *crt.TLS, zFormat uintptr, va uintptr) { /* sqlite3.c:29377:21: */
+func Xsqlite3DebugPrintf(tls *libc.TLS, zFormat uintptr, va uintptr) { /* sqlite3.c:29420:21: */
bp := tls.Alloc(740)
defer tls.Free(740)
@@ -14772,13 +15549,13 @@ func Xsqlite3DebugPrintf(tls *crt.TLS, zFormat uintptr, va uintptr) { /* sqlite3
Xsqlite3_str_vappendf(tls, bp+8 /* &acc */, zFormat, ap)
_ = ap
Xsqlite3StrAccumFinish(tls, bp+8 /* &acc */)
- crt.Xfprintf(tls, crt.Xstdout, ts+696 /* "%s" */, crt.VaList(bp, bp+40 /* &zBuf[0] */))
- crt.Xfflush(tls, crt.Xstdout)
+ libc.Xfprintf(tls, libc.Xstdout, ts+805 /* "%s" */, libc.VaList(bp, bp+40 /* &zBuf[0] */))
+ libc.Xfflush(tls, libc.Xstdout)
}
// variable-argument wrapper around sqlite3_str_vappendf(). The bFlags argument
// can contain the bit SQLITE_PRINTF_INTERNAL enable internal formats.
-func Xsqlite3_str_appendf(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:29403:17: */
+func Xsqlite3_str_appendf(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:29446:17: */
var ap Va_list
_ = ap
ap = va
@@ -14877,10 +15654,10 @@ type sqlite3PrngType = struct {
// All threads share a single random number generator.
// This structure is the current state of the generator.
-var sqlite3Prng sqlite3PrngType /* sqlite3.c:30218:3: */
+var sqlite3Prng sqlite3PrngType /* sqlite3.c:30262:3: */
// Return N random bytes.
-func Xsqlite3_randomness(tls *crt.TLS, N int32, pBuf uintptr) { /* sqlite3.c:30223:17: */
+func Xsqlite3_randomness(tls *libc.TLS, N int32, pBuf uintptr) { /* sqlite3.c:30267:17: */
bp := tls.Alloc(256)
defer tls.Free(256)
@@ -14935,14 +15712,14 @@ func Xsqlite3_randomness(tls *crt.TLS, N int32, pBuf uintptr) { /* sqlite3.c:302
sqlite3Prng.FisInit = uint8(1)
}
- for ok := true; ok; ok = crt.PreDecInt32(&N, 1) != 0 {
+ for ok := true; ok; ok = libc.PreDecInt32(&N, 1) != 0 {
sqlite3Prng.Fi++
t = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(sqlite3Prng.Fi)))
*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Prng)) + 2 /* &.j */)) += uint8((int32(t)))
*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(sqlite3Prng.Fi))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(sqlite3Prng.Fj)))
*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(sqlite3Prng.Fj))) = t
t = uint8(int32(t) + (int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(sqlite3Prng.Fi))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zBuf, 1))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(t)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zBuf, 1))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3Prng)) + 3 /* &.s */) + uintptr(t)))
}
Xsqlite3_mutex_leave(tls, mutex)
}
@@ -14954,22 +15731,22 @@ func Xsqlite3_randomness(tls *crt.TLS, N int32, pBuf uintptr) { /* sqlite3.c:302
//
// The sqlite3_test_control() interface calls these routines to
// control the PRNG.
-var sqlite3SavedPrng sqlite3PrngType /* sqlite3.c:30309:42: */
-func Xsqlite3PrngSaveState(tls *crt.TLS) { /* sqlite3.c:30310:21: */
- crt.Xmemcpy(tls,
+var sqlite3SavedPrng sqlite3PrngType /* sqlite3.c:30353:42: */
+func Xsqlite3PrngSaveState(tls *libc.TLS) { /* sqlite3.c:30354:21: */
+ libc.Xmemcpy(tls,
uintptr(unsafe.Pointer(&sqlite3SavedPrng)),
uintptr(unsafe.Pointer(&sqlite3Prng)),
uint64(unsafe.Sizeof(sqlite3Prng)))
}
-func Xsqlite3PrngRestoreState(tls *crt.TLS) { /* sqlite3.c:30317:21: */
- crt.Xmemcpy(tls,
+func Xsqlite3PrngRestoreState(tls *libc.TLS) { /* sqlite3.c:30361:21: */
+ libc.Xmemcpy(tls,
uintptr(unsafe.Pointer(&sqlite3Prng)),
uintptr(unsafe.Pointer(&sqlite3SavedPrng)),
uint64(unsafe.Sizeof(sqlite3Prng)))
}
// Create a new thread
-func Xsqlite3ThreadCreate(tls *crt.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:30553:20: */
+func Xsqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:30597:20: */
var p uintptr
*(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0)
@@ -14982,20 +15759,20 @@ func Xsqlite3ThreadCreate(tls *crt.TLS, ppThread uintptr, xTask uintptr, pIn uin
(*SQLiteThread)(unsafe.Pointer(p)).FpIn = pIn
} else {
(*SQLiteThread)(unsafe.Pointer(p)).FxTask = uintptr(0)
- (*SQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(&xTask)))(tls, pIn)
+ (*SQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&xTask)))(tls, pIn)
}
*(*uintptr)(unsafe.Pointer(ppThread)) = p
return 0
}
// Get the results of the thread
-func Xsqlite3ThreadJoin(tls *crt.TLS, p uintptr, ppOut uintptr) int32 { /* sqlite3.c:30577:20: */
+func Xsqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) int32 { /* sqlite3.c:30621:20: */
if p == uintptr(0) {
return 7
}
if (*SQLiteThread)(unsafe.Pointer(p)).FxTask != 0 {
- *(*uintptr)(unsafe.Pointer(ppOut)) = (*(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer((p /* &.xTask */))))(tls, (*SQLiteThread)(unsafe.Pointer(p)).FpIn)
+ *(*uintptr)(unsafe.Pointer(ppOut)) = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer((p /* &.xTask */))))(tls, (*SQLiteThread)(unsafe.Pointer(p)).FpIn)
} else {
*(*uintptr)(unsafe.Pointer(ppOut)) = (*SQLiteThread)(unsafe.Pointer(p)).FpResult
}
@@ -15064,7 +15841,7 @@ var sqlite3Utf8Trans1 = [64]uint8{
uint8(0x08), uint8(0x09), uint8(0x0a), uint8(0x0b), uint8(0x0c), uint8(0x0d), uint8(0x0e), uint8(0x0f),
uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x04), uint8(0x05), uint8(0x06), uint8(0x07),
uint8(0x00), uint8(0x01), uint8(0x02), uint8(0x03), uint8(0x00), uint8(0x01), uint8(0x00), uint8(0x00),
-} /* sqlite3.c:30656:28 */
+} /* sqlite3.c:30700:28 */
// Translate a single UTF-8 character. Return the unicode value.
//
@@ -15091,16 +15868,16 @@ var sqlite3Utf8Trans1 = [64]uint8{
// * This routine accepts over-length UTF8 encodings
// for unicode values 0x80 and greater. It does not change over-length
// encodings to 0xfffd as some systems recommend.
-func Xsqlite3Utf8Read(tls *crt.TLS, pz uintptr) U32 { /* sqlite3.c:30750:20: */
+func Xsqlite3Utf8Read(tls *libc.TLS, pz uintptr) U32 { /* sqlite3.c:30794:20: */
var c uint32
// Same as READ_UTF8() above but without the zTerm parameter.
// For this routine, we assume the UTF8 string is always zero-terminated.
- c = uint32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&(*(*uintptr)(unsafe.Pointer(pz))), 1))))
+ c = uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*(*uintptr)(unsafe.Pointer(pz))), 1))))
if c >= uint32(0xc0) {
c = uint32(sqlite3Utf8Trans1[(c - uint32(0xc0))])
for (int32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pz))))) & 0xc0) == 0x80 {
- c = ((c << 6) + (uint32(0x3f & int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&(*(*uintptr)(unsafe.Pointer(pz))), 1)))))))
+ c = ((c << 6) + (uint32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&(*(*uintptr)(unsafe.Pointer(pz))), 1)))))))
}
if ((c < uint32(0x80)) ||
((c & 0xFFFFF800) == uint32(0xD800))) ||
@@ -15111,16 +15888,14 @@ func Xsqlite3Utf8Read(tls *crt.TLS, pz uintptr) U32 { /* sqlite3.c:30750:20: */
return c
}
-/*
-** If the TRANSLATE_TRACE macro is defined, the value of each Mem is
-** printed on stderr on the way into and out of sqlite3VdbeMemTranslate().
- */
+// If the TRANSLATE_TRACE macro is defined, the value of each Mem is
+// printed on stderr on the way into and out of sqlite3VdbeMemTranslate().
// #define TRANSLATE_TRACE 1
// This routine transforms the internal text encoding used by pMem to
// desiredEnc. It is an error if the string is already of the desired
// encoding, or if *pMem does not contain a string value.
-func Xsqlite3VdbeMemTranslate(tls *crt.TLS, pMem uintptr, desiredEnc U8) int32 { /* sqlite3.c:30786:36: */
+func Xsqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc U8) int32 { /* sqlite3.c:30830:36: */
var len Sqlite3_int64 // Maximum length of output string in bytes
var zOut uintptr // Output buffer
var zIn uintptr // Input iterator
@@ -15147,7 +15922,7 @@ func Xsqlite3VdbeMemTranslate(tls *crt.TLS, pMem uintptr, desiredEnc U8) int32 {
__2:
;
zIn = (*Mem)(unsafe.Pointer(pMem)).Fz
- zTerm = (zIn + uintptr(((*Mem)(unsafe.Pointer(pMem)).Fn & ^int32(crt.Int32FromInt32(1)))))
+ zTerm = (zIn + uintptr(((*Mem)(unsafe.Pointer(pMem)).Fn & ^int32(libc.Int32FromInt32(1)))))
__3:
if !(zIn < zTerm) {
goto __4
@@ -15155,7 +15930,7 @@ __3:
temp = *(*uint8)(unsafe.Pointer(zIn))
*(*uint8)(unsafe.Pointer(zIn)) = *(*uint8)(unsafe.Pointer((zIn + uintptr(1))))
zIn++
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1))) = temp
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))) = temp
goto __3
__4:
;
@@ -15172,7 +15947,7 @@ __1:
// translating a 2-byte character to a 4-byte UTF-8 character.
// A single byte is required for the output string
// nul-terminator.
- *(*int32)(unsafe.Pointer(pMem + 12 /* &.n */)) &= (^int32(crt.Int32FromInt32(1)))
+ *(*int32)(unsafe.Pointer(pMem + 12 /* &.n */)) &= (^int32(libc.Int32FromInt32(1)))
len = ((int64(2) * Sqlite3_int64((*Mem)(unsafe.Pointer(pMem)).Fn)) + int64(1))
goto __6
__5:
@@ -15211,7 +15986,7 @@ __12:
if !(zIn < zTerm) {
goto __13
}
- c = uint32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1))))
+ c = uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
if !(c >= uint32(0xc0)) {
goto __14
}
@@ -15220,7 +15995,7 @@ __15:
if !((zIn != zTerm) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80)) {
goto __16
}
- c = ((c << 6) + (uint32(0x3f & int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1)))))))
+ c = ((c << 6) + (uint32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))))
goto __15
__16:
;
@@ -15236,14 +16011,14 @@ __14:
if !(c <= uint32(0xFFFF)) {
goto __18
}
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8(c & uint32(0x00FF)))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8((c >> 8) & uint32(0x00FF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(c & uint32(0x00FF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8((c >> 8) & uint32(0x00FF)))
goto __19
__18:
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8(((c >> 10) & uint32(0x003F)) + (((c - uint32(0x10000)) >> 10) & uint32(0x00C0))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8(uint32(0x00D8) + (((c - uint32(0x10000)) >> 18) & uint32(0x03))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8(c & uint32(0x00FF)))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8(uint32(0x00DC) + ((c >> 8) & uint32(0x03))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(((c >> 10) & uint32(0x003F)) + (((c - uint32(0x10000)) >> 10) & uint32(0x00C0))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(uint32(0x00D8) + (((c - uint32(0x10000)) >> 18) & uint32(0x03))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(c & uint32(0x00FF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(uint32(0x00DC) + ((c >> 8) & uint32(0x03))))
__19:
;
goto __12
@@ -15257,7 +16032,7 @@ __20:
if !(zIn < zTerm) {
goto __21
}
- c = uint32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1))))
+ c = uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
if !(c >= uint32(0xc0)) {
goto __22
}
@@ -15266,7 +16041,7 @@ __23:
if !((zIn != zTerm) && ((int32(*(*uint8)(unsafe.Pointer(zIn))) & 0xc0) == 0x80)) {
goto __24
}
- c = ((c << 6) + (uint32(0x3f & int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1)))))))
+ c = ((c << 6) + (uint32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))))
goto __23
__24:
;
@@ -15282,14 +16057,14 @@ __22:
if !(c <= uint32(0xFFFF)) {
goto __26
}
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8((c >> 8) & uint32(0x00FF)))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8(c & uint32(0x00FF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8((c >> 8) & uint32(0x00FF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(c & uint32(0x00FF)))
goto __27
__26:
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8(uint32(0x00D8) + (((c - uint32(0x10000)) >> 18) & uint32(0x03))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8(((c >> 10) & uint32(0x003F)) + (((c - uint32(0x10000)) >> 10) & uint32(0x00C0))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8(uint32(0x00DC) + ((c >> 8) & uint32(0x03))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8(c & uint32(0x00FF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(uint32(0x00D8) + (((c - uint32(0x10000)) >> 18) & uint32(0x03))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(((c >> 10) & uint32(0x003F)) + (((c - uint32(0x10000)) >> 10) & uint32(0x00C0))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(uint32(0x00DC) + ((c >> 8) & uint32(0x03))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(c & uint32(0x00FF)))
__27:
;
goto __20
@@ -15298,7 +16073,7 @@ __21:
__11:
;
(*Mem)(unsafe.Pointer(pMem)).Fn = (int32((int64(z) - int64(zOut)) / 1))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = uint8(0)
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = uint8(0)
goto __9
__8:
;
@@ -15310,16 +16085,16 @@ __30:
if !(zIn < zTerm) {
goto __31
}
- c = uint32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1))))
- c = c + (uint32((int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1))))) << 8))
+ c = uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
+ c = c + (uint32((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))) << 8))
if !((c >= uint32(0xd800)) && (c < uint32(0xe000))) {
goto __32
}
if !(zIn < zTerm) {
goto __33
}
- c2 = int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1))))
- c2 = c2 + ((int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1))))) << 8)
+ c2 = int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))
+ c2 = c2 + ((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))) << 8)
c = (((uint32(c2 & 0x03FF)) + ((c & uint32(0x003F)) << 10)) + (((c & uint32(0x03C0)) + uint32(0x0040)) << 10))
__33:
;
@@ -15328,28 +16103,28 @@ __32:
if !(c < uint32(0x00080)) {
goto __34
}
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8(c & uint32(0xFF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(c & uint32(0xFF)))
goto __35
__34:
if !(c < uint32(0x00800)) {
goto __36
}
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0xC0 + int32((U8((c >> 6) & uint32(0x1F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0xC0 + int32((U8((c >> 6) & uint32(0x1F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
goto __37
__36:
if !(c < uint32(0x10000)) {
goto __38
}
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0xE0 + int32((U8((c >> 12) & uint32(0x0F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0xE0 + int32((U8((c >> 12) & uint32(0x0F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
goto __39
__38:
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0xF0 + int32((U8((c >> 18) & uint32(0x07))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 12) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0xF0 + int32((U8((c >> 18) & uint32(0x07))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 12) & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
__39:
;
__37:
@@ -15366,16 +16141,16 @@ __40:
if !(zIn < zTerm) {
goto __41
}
- c = (uint32((int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1))))) << 8))
- c = c + (uint32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1)))))
+ c = (uint32((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))) << 8))
+ c = c + (uint32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
if !((c >= uint32(0xd800)) && (c < uint32(0xe000))) {
goto __42
}
if !(zIn < zTerm) {
goto __43
}
- c21 = ((int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1))))) << 8)
- c21 = c21 + (int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zIn, 1)))))
+ c21 = ((int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1))))) << 8)
+ c21 = c21 + (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))))
c = (((uint32(c21 & 0x03FF)) + ((c & uint32(0x003F)) << 10)) + (((c & uint32(0x03C0)) + uint32(0x0040)) << 10))
__43:
;
@@ -15384,28 +16159,28 @@ __42:
if !(c < uint32(0x00080)) {
goto __44
}
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (U8(c & uint32(0xFF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (U8(c & uint32(0xFF)))
goto __45
__44:
if !(c < uint32(0x00800)) {
goto __46
}
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0xC0 + int32((U8((c >> 6) & uint32(0x1F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0xC0 + int32((U8((c >> 6) & uint32(0x1F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
goto __47
__46:
if !(c < uint32(0x10000)) {
goto __48
}
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0xE0 + int32((U8((c >> 12) & uint32(0x0F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0xE0 + int32((U8((c >> 12) & uint32(0x0F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
goto __49
__48:
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0xF0 + int32((U8((c >> 18) & uint32(0x07))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 12) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0xF0 + int32((U8((c >> 18) & uint32(0x07))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 12) & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
__49:
;
__47:
@@ -15422,9 +16197,9 @@ __9:
;
*(*uint8)(unsafe.Pointer(z)) = uint8(0)
- c = uint32((*Mem)(unsafe.Pointer(pMem)).Fflags)
+ c = (uint32((0x0002 | 0x0200) | (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (0x003f | 0x8000))))
Xsqlite3VdbeMemRelease(tls, pMem)
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((uint32(0x0002 | 0x0200)) | (c & (uint32(0x003f | 0x8000)))))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = U16(c)
(*Mem)(unsafe.Pointer(pMem)).Fenc = desiredEnc
(*Mem)(unsafe.Pointer(pMem)).Fz = zOut
(*Mem)(unsafe.Pointer(pMem)).FzMalloc = (*Mem)(unsafe.Pointer(pMem)).Fz
@@ -15441,7 +16216,7 @@ translate_out:
//
// The allocation (static, dynamic etc.) and encoding of the Mem may be
// changed by this function.
-func Xsqlite3VdbeMemHandleBom(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:30981:20: */
+func Xsqlite3VdbeMemHandleBom(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:31025:20: */
var rc int32 = 0
var bom U8 = U8(0)
@@ -15460,7 +16235,7 @@ func Xsqlite3VdbeMemHandleBom(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:3
rc = Xsqlite3VdbeMemMakeWriteable(tls, pMem)
if rc == 0 {
*(*int32)(unsafe.Pointer(pMem + 12 /* &.n */)) -= (2)
- crt.Xmemmove(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, ((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(2)), uint64((*Mem)(unsafe.Pointer(pMem)).Fn))
+ libc.Xmemmove(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, ((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(2)), uint64((*Mem)(unsafe.Pointer(pMem)).Fn))
*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn))) = int8(0)
*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(((*Mem)(unsafe.Pointer(pMem)).Fn + 1)))) = int8(0)
*(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16((0x0200))
@@ -15475,19 +16250,19 @@ func Xsqlite3VdbeMemHandleBom(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:3
// the first 0x00 byte. If nByte is not less than zero, return the
// number of unicode characters in the first nByte of pZ (or up to
// the first 0x00, whichever comes first).
-func Xsqlite3Utf8CharLen(tls *crt.TLS, zIn uintptr, nByte int32) int32 { /* sqlite3.c:31019:20: */
+func Xsqlite3Utf8CharLen(tls *libc.TLS, zIn uintptr, nByte int32) int32 { /* sqlite3.c:31063:20: */
var r int32 = 0
var z uintptr = zIn
var zTerm uintptr
if nByte >= 0 {
zTerm = (z + uintptr(nByte))
} else {
- zTerm = crt.UintptrFromInt32(-1)
+ zTerm = libc.UintptrFromInt32(-1)
}
for (int32(*(*U8)(unsafe.Pointer(z))) != 0) && (z < zTerm) {
{
- if (int32(*(*U8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) >= 0xc0 {
+ if (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) >= 0xc0 {
for (int32(*(*U8)(unsafe.Pointer(z))) & 0xc0) == 0x80 {
z++
}
@@ -15507,13 +16282,13 @@ func Xsqlite3Utf8CharLen(tls *crt.TLS, zIn uintptr, nByte int32) int32 { /* sqli
// be freed by the calling function.
//
// NULL is returned if there is an allocation error.
-func Xsqlite3Utf16to8(tls *crt.TLS, db uintptr, z uintptr, nByte int32, enc U8) uintptr { /* sqlite3.c:31073:21: */
+func Xsqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc U8) uintptr { /* sqlite3.c:31117:21: */
bp := tls.Alloc(56)
defer tls.Free(56)
// var m Mem at bp, 56
- crt.Xmemset(tls, bp /* &m */, 0, uint64(unsafe.Sizeof(Mem{})))
+ libc.Xmemset(tls, bp /* &m */, 0, uint64(unsafe.Sizeof(Mem{})))
(*Mem)(unsafe.Pointer(bp /* &m */)).Fdb = db
Xsqlite3VdbeMemSetStr(tls, bp /* &m */, z, nByte, enc, uintptr(0))
Xsqlite3VdbeChangeEncoding(tls, bp /* &m */, 1)
@@ -15528,7 +16303,7 @@ func Xsqlite3Utf16to8(tls *crt.TLS, db uintptr, z uintptr, nByte int32, enc U8)
// zIn is a UTF-16 encoded unicode string at least nChar characters long.
// Return the number of bytes in the first nChar unicode characters
// in pZ. nChar must be non-negative.
-func Xsqlite3Utf16ByteLen(tls *crt.TLS, zIn uintptr, nChar int32) int32 { /* sqlite3.c:31094:20: */
+func Xsqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) int32 { /* sqlite3.c:31138:20: */
var c int32
var z uintptr = zIn
var n int32 = 0
@@ -15545,13 +16320,13 @@ func Xsqlite3Utf16ByteLen(tls *crt.TLS, zIn uintptr, nChar int32) int32 { /* sql
n++
}
return ((int32((int64(z) - int64(zIn)) / 1)) -
- (crt.Bool32(2 == 2)))
+ (libc.Bool32(2 == 2)))
}
// This routine is called from the TCL test function "translate_selftest".
// It checks that the primitives for serializing and deserializing
// characters in each encoding are inverses of each other.
-func Xsqlite3UtfSelfTest(tls *crt.TLS) { /* sqlite3.c:31116:21: */
+func Xsqlite3UtfSelfTest(tls *libc.TLS) { /* sqlite3.c:31160:21: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -15571,19 +16346,19 @@ func Xsqlite3UtfSelfTest(tls *crt.TLS) { /* sqlite3.c:31116:21: */
*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)) = bp /* &zBuf[0] */
{
if i < uint32(0x00080) {
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (U8(i & uint32(0xFF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (U8(i & uint32(0xFF)))
} else if i < uint32(0x00800) {
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0xC0 + int32((U8((i >> 6) & uint32(0x1F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0x80 + int32((U8(i & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0xC0 + int32((U8((i >> 6) & uint32(0x1F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0x80 + int32((U8(i & uint32(0x3F))))))
} else if i < uint32(0x10000) {
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0xE0 + int32((U8((i >> 12) & uint32(0x0F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0x80 + int32((U8((i >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0x80 + int32((U8(i & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0xE0 + int32((U8((i >> 12) & uint32(0x0F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0x80 + int32((U8((i >> 6) & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0x80 + int32((U8(i & uint32(0x3F))))))
} else {
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0xF0 + int32((U8((i >> 18) & uint32(0x07))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0x80 + int32((U8((i >> 12) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0x80 + int32((U8((i >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0x80 + int32((U8(i & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0xF0 + int32((U8((i >> 18) & uint32(0x07))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0x80 + int32((U8((i >> 12) & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0x80 + int32((U8((i >> 6) & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 24 /* z */)), 1))) = (uint8(0x80 + int32((U8(i & uint32(0x3F))))))
}
}
@@ -15889,24 +16664,24 @@ type Double_t = float64 /* math.h:150:16 */
// sqlite3FaultSim() instance is being invoked. Each call to sqlite3FaultSim()
// should have a unique code. To prevent legacy testing applications from
// breaking, the codes should not be changed or reused.
-func Xsqlite3FaultSim(tls *crt.TLS, iTest int32) int32 { /* sqlite3.c:31196:20: */
+func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32 { /* sqlite3.c:31240:20: */
var xCallback uintptr = Xsqlite3Config.FxTestCallback
if xCallback != 0 {
- return (*(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&xCallback)))(tls, iTest)
+ return (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&xCallback)))(tls, iTest)
}
return 0
}
// Return true if the floating point value is Not a Number (NaN).
-func Xsqlite3IsNaN(tls *crt.TLS, x float64) int32 { /* sqlite3.c:31206:20: */
+func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32 { /* sqlite3.c:31250:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
*(*float64)(unsafe.Pointer(bp + 8)) = x
// var y U64 at bp, 8
- crt.Xmemcpy(tls, bp /* &y */, bp+8 /* &x */, uint64(unsafe.Sizeof(U64(0))))
- return (crt.Bool32((((*(*U64)(unsafe.Pointer(bp /* y */))) & (U64((uint64(0x7ff))) << 52)) == (U64((uint64(0x7ff))) << 52)) && (((*(*U64)(unsafe.Pointer(bp /* y */))) & ((U64((uint64(1))) << 52) - uint64(1))) != uint64(0))))
+ libc.Xmemcpy(tls, bp /* &y */, bp+8 /* &x */, uint64(unsafe.Sizeof(U64(0))))
+ return (libc.Bool32((((*(*U64)(unsafe.Pointer(bp /* y */))) & (U64((uint64(0x7ff))) << 52)) == (U64((uint64(0x7ff))) << 52)) && (((*(*U64)(unsafe.Pointer(bp /* y */))) & ((U64((uint64(1))) << 52) - uint64(1))) != uint64(0))))
}
// Compute a string length that is limited to what can be stored in
@@ -15915,11 +16690,11 @@ func Xsqlite3IsNaN(tls *crt.TLS, x float64) int32 { /* sqlite3.c:31206:20: */
// The value returned will never be negative. Nor will it ever be greater
// than the actual length of the string. For very long strings (greater
// than 1GiB) the value returned might be less than the true string length.
-func Xsqlite3Strlen30(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:31221:20: */
+func Xsqlite3Strlen30(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:31265:20: */
if z == uintptr(0) {
return 0
}
- return (0x3fffffff & int32(crt.Xstrlen(tls, z)))
+ return (0x3fffffff & int32(libc.Xstrlen(tls, z)))
}
// Return the declared type of a column. Or return zDflt if the column
@@ -15927,17 +16702,17 @@ func Xsqlite3Strlen30(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:31221:20: */
//
// The column type is an extra string stored after the zero-terminator on
// the column name if and only if the COLFLAG_HASTYPE flag is set.
-func Xsqlite3ColumnType(tls *crt.TLS, pCol uintptr, zDflt uintptr) uintptr { /* sqlite3.c:31233:21: */
+func Xsqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) uintptr { /* sqlite3.c:31277:21: */
if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0004) == 0 {
return zDflt
}
- return (((*Column)(unsafe.Pointer(pCol)).FzName + uintptr(crt.Xstrlen(tls, (*Column)(unsafe.Pointer(pCol)).FzName))) + uintptr(1))
+ return (((*Column)(unsafe.Pointer(pCol)).FzName + uintptr(libc.Xstrlen(tls, (*Column)(unsafe.Pointer(pCol)).FzName))) + uintptr(1))
}
// Helper function for sqlite3Error() - called rarely. Broken out into
// a separate routine to avoid unnecessary register saves on entry to
// sqlite3Error().
-func sqlite3ErrorFinish(tls *crt.TLS, db uintptr, err_code int32) { /* sqlite3.c:31243:30: */
+func sqlite3ErrorFinish(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:31287:30: */
if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 {
Xsqlite3ValueSetNull(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr)
}
@@ -15947,7 +16722,7 @@ func sqlite3ErrorFinish(tls *crt.TLS, db uintptr, err_code int32) { /* sqlite3.c
// Set the current error code to err_code and clear any prior error message.
// Also set iSysErrno (by calling sqlite3System) if the err_code indicates
// that would be appropriate.
-func Xsqlite3Error(tls *crt.TLS, db uintptr, err_code int32) { /* sqlite3.c:31253:21: */
+func Xsqlite3Error(tls *libc.TLS, db uintptr, err_code int32) { /* sqlite3.c:31297:21: */
(*Sqlite3)(unsafe.Pointer(db)).FerrCode = err_code
if (err_code != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) {
@@ -15957,7 +16732,7 @@ func Xsqlite3Error(tls *crt.TLS, db uintptr, err_code int32) { /* sqlite3.c:3125
// Load the sqlite3.iSysErrno field if that is an appropriate thing
// to do based on the SQLite error code in rc.
-func Xsqlite3SystemError(tls *crt.TLS, db uintptr, rc int32) { /* sqlite3.c:31263:21: */
+func Xsqlite3SystemError(tls *libc.TLS, db uintptr, rc int32) { /* sqlite3.c:31307:21: */
if rc == (10 | (int32(12) << 8)) {
return
}
@@ -15986,20 +16761,20 @@ func Xsqlite3SystemError(tls *crt.TLS, db uintptr, rc int32) { /* sqlite3.c:3126
// To clear the most recent error for sqlite handle "db", sqlite3Error
// should be called with err_code set to SQLITE_OK and zFormat set
// to NULL.
-func Xsqlite3ErrorWithMsg(tls *crt.TLS, db uintptr, err_code int32, zFormat uintptr, va uintptr) { /* sqlite3.c:31292:21: */
+func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uintptr, va uintptr) { /* sqlite3.c:31336:21: */
(*Sqlite3)(unsafe.Pointer(db)).FerrCode = err_code
Xsqlite3SystemError(tls, db, err_code)
if zFormat == uintptr(0) {
Xsqlite3Error(tls, db, err_code)
- } else if ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) || ((crt.AssignPtrUintptr(db+360 /* &.pErr */, Xsqlite3ValueNew(tls, db))) != uintptr(0)) {
+ } else if ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) || ((libc.AssignPtrUintptr(db+384 /* &.pErr */, Xsqlite3ValueNew(tls, db))) != uintptr(0)) {
var z uintptr
var ap Va_list
_ = ap
ap = va
z = Xsqlite3VMPrintf(tls, db, zFormat, ap)
_ = ap
- Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, z, uint8(1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{Xsqlite3MallocSize})))
+ Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, z, uint8(1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault})))
}
}
@@ -16018,7 +16793,7 @@ func Xsqlite3ErrorWithMsg(tls *crt.TLS, db uintptr, err_code int32, zFormat uint
// stored by this function into the database handle using sqlite3Error().
// Functions sqlite3Error() or sqlite3ErrorWithMsg() should be used
// during statement execution (sqlite3_step() etc.).
-func Xsqlite3ErrorMsg(tls *crt.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:31325:21: */
+func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:31369:21: */
var zMsg uintptr
var ap Va_list
_ = ap
@@ -16040,9 +16815,9 @@ func Xsqlite3ErrorMsg(tls *crt.TLS, pParse uintptr, zFormat uintptr, va uintptr)
// If database connection db is currently parsing SQL, then transfer
// error code errCode to that parser if the parser has not already
// encountered some other kind of error.
-func Xsqlite3ErrorToParser(tls *crt.TLS, db uintptr, errCode int32) int32 { /* sqlite3.c:31348:20: */
+func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32 { /* sqlite3.c:31392:20: */
var pParse uintptr
- if (db == uintptr(0)) || ((crt.AssignUintptr(&pParse, (*Sqlite3)(unsafe.Pointer(db)).FpParse)) == uintptr(0)) {
+ if (db == uintptr(0)) || ((libc.AssignUintptr(&pParse, (*Sqlite3)(unsafe.Pointer(db)).FpParse)) == uintptr(0)) {
return errCode
}
(*Parse)(unsafe.Pointer(pParse)).Frc = errCode
@@ -16065,7 +16840,7 @@ func Xsqlite3ErrorToParser(tls *crt.TLS, db uintptr, errCode int32) int32 { /* s
// 2002-02-14: This routine is extended to remove MS-Access style
// brackets from around identifiers. For example: "[a-b-c]" becomes
// "a-b-c".
-func Xsqlite3Dequote(tls *crt.TLS, z uintptr) { /* sqlite3.c:31373:21: */
+func Xsqlite3Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:31417:21: */
var quote int8
var i int32
var j int32
@@ -16085,18 +16860,18 @@ func Xsqlite3Dequote(tls *crt.TLS, z uintptr) { /* sqlite3.c:31373:21: */
if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32(quote) {
if int32(*(*int8)(unsafe.Pointer(z + uintptr((i + 1))))) == int32(quote) {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = quote
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = quote
i++
} else {
break
}
} else {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(i)))
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(i)))
}
}
*(*int8)(unsafe.Pointer(z + uintptr(j))) = int8(0)
}
-func Xsqlite3DequoteExpr(tls *crt.TLS, p uintptr) { /* sqlite3.c:31395:21: */
+func Xsqlite3DequoteExpr(tls *libc.TLS, p uintptr) { /* sqlite3.c:31439:21: */
*(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (func() uint32 {
if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) + uintptr(0)))) == '"' {
@@ -16108,7 +16883,7 @@ func Xsqlite3DequoteExpr(tls *crt.TLS, p uintptr) { /* sqlite3.c:31395:21: */
}
// Generate a Token object from a string
-func Xsqlite3TokenInit(tls *crt.TLS, p uintptr, z uintptr) { /* sqlite3.c:31404:21: */
+func Xsqlite3TokenInit(tls *libc.TLS, p uintptr, z uintptr) { /* sqlite3.c:31448:21: */
(*Token)(unsafe.Pointer(p)).Fz = z
(*Token)(unsafe.Pointer(p)).Fn = uint32(Xsqlite3Strlen30(tls, z))
}
@@ -16123,7 +16898,7 @@ func Xsqlite3TokenInit(tls *crt.TLS, p uintptr, z uintptr) { /* sqlite3.c:31404:
// the contents of two buffers containing UTF-8 strings in a
// case-independent fashion, using the same definition of "case
// independence" that SQLite uses internally when comparing identifiers.
-func Xsqlite3_stricmp(tls *crt.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31422:16: */
+func Xsqlite3_stricmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31466:16: */
if zLeft == uintptr(0) {
if zRight != 0 {
return -1
@@ -16134,7 +16909,7 @@ func Xsqlite3_stricmp(tls *crt.TLS, zLeft uintptr, zRight uintptr) int32 { /* sq
}
return Xsqlite3StrICmp(tls, zLeft, zRight)
}
-func Xsqlite3StrICmp(tls *crt.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31430:20: */
+func Xsqlite3StrICmp(tls *libc.TLS, zLeft uintptr, zRight uintptr) int32 { /* sqlite3.c:31474:20: */
var a uintptr
var b uintptr
var c int32
@@ -16159,7 +16934,7 @@ func Xsqlite3StrICmp(tls *crt.TLS, zLeft uintptr, zRight uintptr) int32 { /* sql
}
return c
}
-func Xsqlite3_strnicmp(tls *crt.TLS, zLeft uintptr, zRight uintptr, N int32) int32 { /* sqlite3.c:31449:16: */
+func Xsqlite3_strnicmp(tls *libc.TLS, zLeft uintptr, zRight uintptr, N int32) int32 { /* sqlite3.c:31493:16: */
var a uintptr
var b uintptr
if zLeft == uintptr(0) {
@@ -16172,7 +16947,7 @@ func Xsqlite3_strnicmp(tls *crt.TLS, zLeft uintptr, zRight uintptr, N int32) int
}
a = zLeft
b = zRight
- for ((crt.PostDecInt32(&N, 1) > 0) && (int32(*(*uint8)(unsafe.Pointer(a))) != 0)) && (int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(a))]) == int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(b))])) {
+ for ((libc.PostDecInt32(&N, 1) > 0) && (int32(*(*uint8)(unsafe.Pointer(a))) != 0)) && (int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(a))]) == int32(Xsqlite3UpperToLower[*(*uint8)(unsafe.Pointer(b))])) {
a++
b++
}
@@ -16183,7 +16958,7 @@ func Xsqlite3_strnicmp(tls *crt.TLS, zLeft uintptr, zRight uintptr, N int32) int
}
// Compute an 8-bit hash on a string that is insensitive to case differences
-func Xsqlite3StrIHash(tls *crt.TLS, z uintptr) U8 { /* sqlite3.c:31465:19: */
+func Xsqlite3StrIHash(tls *libc.TLS, z uintptr) U8 { /* sqlite3.c:31509:19: */
var h U8 = U8(0)
if z == uintptr(0) {
return U8(0)
@@ -16199,7 +16974,7 @@ func Xsqlite3StrIHash(tls *crt.TLS, z uintptr) U8 { /* sqlite3.c:31465:19: */
// E==2 results in 100. E==50 results in 1.0e50.
//
// This routine only works for values of E between 1 and 341.
-func sqlite3Pow10(tls *crt.TLS, E int32) float64 { /* sqlite3.c:31481:24: */
+func sqlite3Pow10(tls *libc.TLS, E int32) float64 { /* sqlite3.c:31525:24: */
var x float64 = 10.0
var r float64 = 1.0
for 1 != 0 {
@@ -16242,7 +17017,7 @@ func sqlite3Pow10(tls *crt.TLS, E int32) float64 { /* sqlite3.c:31481:24: */
// If some prefix of the input string is a valid number, this routine
// returns FALSE but it still converts the prefix and writes the result
// into *pResult.
-func Xsqlite3AtoF(tls *crt.TLS, z uintptr, pResult uintptr, length int32, enc U8) int32 { /* sqlite3.c:31546:20: */
+func Xsqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc U8) int32 { /* sqlite3.c:31590:20: */
var incr int32
var zEnd uintptr
// sign * significand * (10 ^ (esign * exponent))
@@ -16283,7 +17058,7 @@ __1:
goto __3
__2:
incr = 2
- length = length & (^int32(crt.Int32FromInt32(1)))
+ length = length & (^int32(libc.Int32FromInt32(1)))
i = (3 - int32(enc))
__4:
@@ -16489,7 +17264,7 @@ __35:
}
// In the IEEE 754 standard, zero is signed.
if sign < 0 {
- result = -crt.Float64FromFloat64(float64(0))
+ result = -libc.Float64FromFloat64(float64(0))
} else {
result = float64(0)
}
@@ -16619,6 +17394,38 @@ __57:
return int32(0)
}
+// Render an signed 64-bit integer as text. Store the result in zOut[].
+//
+// The caller must ensure that zOut[] is at least 21 bytes in size.
+func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr) { /* sqlite3.c:31789:21: */
+ bp := tls.Alloc(22)
+ defer tls.Free(22)
+
+ var i int32
+ var x U64
+ // var zTemp [22]int8 at bp, 22
+
+ if v < int64(0) {
+ if v == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) {
+ x = (U64((uint64(1))) << 63)
+ } else {
+ x = U64(-v)
+ }
+ } else {
+ x = U64(v)
+ }
+ i = (int32(uint64(unsafe.Sizeof([22]int8{})) - uint64(2)))
+ *(*int8)(unsafe.Pointer(bp /* &zTemp[0] */ + uintptr((uint64(unsafe.Sizeof([22]int8{})) - uint64(1))))) = int8(0)
+ for ok := true; ok; ok = x != 0 {
+ *(*int8)(unsafe.Pointer(bp /* &zTemp[0] */ + uintptr(libc.PostDecInt32(&i, 1)))) = (int8((x % uint64(10)) + uint64('0')))
+ x = (x / uint64(10))
+ }
+ if v < int64(0) {
+ *(*int8)(unsafe.Pointer(bp /* &zTemp[0] */ + uintptr(libc.PostDecInt32(&i, 1)))) = int8('-')
+ }
+ libc.Xmemcpy(tls, zOut, (bp /* &zTemp */ + uintptr((i + 1))), ((uint64(unsafe.Sizeof([22]int8{})) - uint64(1)) - uint64(i)))
+}
+
// Compare the 19-character string zNum against the text representation
// value 2^63: 9223372036854775808. Return negative, zero, or positive
// if zNum is less than, equal to, or greater than the string.
@@ -16631,11 +17438,11 @@ __57:
// compare2pow63("9223372036854775800", 1)
//
// will return -8.
-func compare2pow63(tls *crt.TLS, zNum uintptr, incr int32) int32 { /* sqlite3.c:31754:12: */
+func compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) int32 { /* sqlite3.c:31822:12: */
var c int32 = 0
var i int32
// 012345678901234567
- var pow63 uintptr = ts + 699 /* "9223372036854775..." */
+ var pow63 uintptr = ts + 808 /* "9223372036854775..." */
for i = 0; (c == 0) && (i < 18); i++ {
c = ((int32(*(*int8)(unsafe.Pointer(zNum + uintptr((i * incr))))) - int32(*(*int8)(unsafe.Pointer(pow63 + uintptr(i))))) * 10)
}
@@ -16660,7 +17467,7 @@ func compare2pow63(tls *crt.TLS, zNum uintptr, incr int32) int32 { /* sqlite3.c:
// length is the number of bytes in the string (bytes, not characters).
// The string is not necessarily zero-terminated. The encoding is
// given by enc.
-func Xsqlite3Atoi64(tls *crt.TLS, zNum uintptr, pNum uintptr, length int32, enc U8) int32 { /* sqlite3.c:31787:20: */
+func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc U8) int32 { /* sqlite3.c:31855:20: */
var incr int32
var u U64 = uint64(0)
var neg int32 = 0 // assume positive
@@ -16678,7 +17485,7 @@ func Xsqlite3Atoi64(tls *crt.TLS, zNum uintptr, pNum uintptr, length int32, enc
for i = (3 - int32(enc)); (i < length) && (int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))) == 0); i = i + (2) {
}
- nonNum = (crt.Bool32(i < length))
+ nonNum = (libc.Bool32(i < length))
zEnd = (zNum + uintptr((i ^ 1)))
zNum += (uintptr(int32(enc) & 1))
}
@@ -16697,7 +17504,7 @@ func Xsqlite3Atoi64(tls *crt.TLS, zNum uintptr, pNum uintptr, length int32, enc
for (zNum < zEnd) && (int32(*(*int8)(unsafe.Pointer(zNum + uintptr(0)))) == '0') {
zNum += uintptr(incr)
} // Skip leading zeros.
- for i = 0; (((zNum + uintptr(i)) < zEnd) && ((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))))) >= '0')) && (c <= '9'); i = i + (incr) {
+ for i = 0; (((zNum + uintptr(i)) < zEnd) && ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))))) >= '0')) && (c <= '9'); i = i + (incr) {
u = (((u * uint64(10)) + U64(c)) - uint64('0'))
}
@@ -16781,7 +17588,7 @@ func Xsqlite3Atoi64(tls *crt.TLS, zNum uintptr, pNum uintptr, length int32, enc
// 1 Excess text after the integer value
// 2 Integer too large for a 64-bit signed integer or is malformed
// 3 Special case of 9223372036854775808
-func Xsqlite3DecOrHexToI64(tls *crt.TLS, z uintptr, pOut uintptr) int32 { /* sqlite3.c:31889:20: */
+func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32 { /* sqlite3.c:31957:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -16795,7 +17602,7 @@ func Xsqlite3DecOrHexToI64(tls *crt.TLS, z uintptr, pOut uintptr) int32 { /* sql
for k = i; (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(k))))]) & 0x08) != 0; k++ {
*(*U64)(unsafe.Pointer(bp /* u */)) = ((*(*U64)(unsafe.Pointer(bp /* u */)) * uint64(16)) + U64(Xsqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(k)))))))
}
- crt.Xmemcpy(tls, pOut, bp /* &u */, uint64(8))
+ libc.Xmemcpy(tls, pOut, bp /* &u */, uint64(8))
if (int32(*(*int8)(unsafe.Pointer(z + uintptr(k)))) == 0) && ((k - i) <= 16) {
return 0
}
@@ -16814,7 +17621,7 @@ func Xsqlite3DecOrHexToI64(tls *crt.TLS, z uintptr, pOut uintptr) int32 { /* sql
// Any non-numeric characters that following zNum are ignored.
// This is different from sqlite3Atoi64() which requires the
// input number to be zero-terminated.
-func Xsqlite3GetInt32(tls *crt.TLS, zNum uintptr, pValue uintptr) int32 { /* sqlite3.c:31919:20: */
+func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32 { /* sqlite3.c:31987:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -16839,7 +17646,7 @@ func Xsqlite3GetInt32(tls *crt.TLS, zNum uintptr, pValue uintptr) int32 { /* sql
*(*U32)(unsafe.Pointer(bp /* u */)) = ((*(*U32)(unsafe.Pointer(bp /* u */)) * U32(16)) + U32(Xsqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))))))
}
if ((*(*U32)(unsafe.Pointer(bp /* u */)) & 0x80000000) == U32(0)) && ((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zNum + uintptr(i))))]) & 0x08) == 0) {
- crt.Xmemcpy(tls, pValue, bp /* &u */, uint64(4))
+ libc.Xmemcpy(tls, pValue, bp /* &u */, uint64(4))
return 1
} else {
return 0
@@ -16851,7 +17658,7 @@ func Xsqlite3GetInt32(tls *crt.TLS, zNum uintptr, pValue uintptr) int32 { /* sql
for int32(*(*int8)(unsafe.Pointer(zNum + uintptr(0)))) == '0' {
zNum++
}
- for i = 0; ((i < 11) && ((crt.AssignInt32(&c, (int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))) - '0'))) >= 0)) && (c <= 9); i++ {
+ for i = 0; ((i < 11) && ((libc.AssignInt32(&c, (int32(*(*int8)(unsafe.Pointer(zNum + uintptr(i)))) - '0'))) >= 0)) && (c <= 9); i++ {
v = ((v * int64(10)) + Sqlite_int64(c))
}
@@ -16876,17 +17683,37 @@ func Xsqlite3GetInt32(tls *crt.TLS, zNum uintptr, pValue uintptr) int32 { /* sql
// Return a 32-bit integer value extracted from a string. If the
// string is not an integer, just return 0.
-func Xsqlite3Atoi(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:31978:20: */
+func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:32046:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*int32)(unsafe.Pointer(bp /* x */)) = 0
- if z != 0 {
- Xsqlite3GetInt32(tls, z, bp /* &x */)
- }
+ Xsqlite3GetInt32(tls, z, bp /* &x */)
return *(*int32)(unsafe.Pointer(bp /* x */))
}
+// Try to convert z into an unsigned 32-bit integer. Return true on
+// success and false if there is an error.
+//
+// Only decimal notation is accepted.
+func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32 { /* sqlite3.c:32058:20: */
+ var v U64 = uint64(0)
+ var i int32
+ for i = 0; (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))]) & 0x04) != 0; i++ {
+ v = (((v * uint64(10)) + U64(*(*int8)(unsafe.Pointer(z + uintptr(i))))) - uint64('0'))
+ if v > uint64(4294967296) {
+ *(*U32)(unsafe.Pointer(pI)) = U32(0)
+ return 0
+ }
+ }
+ if (i == 0) || (int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) != 0) {
+ *(*U32)(unsafe.Pointer(pI)) = U32(0)
+ return 0
+ }
+ *(*U32)(unsafe.Pointer(pI)) = U32(v)
+ return 1
+}
+
// The variable-length integer encoding is as follows:
//
// KEY:
@@ -16912,7 +17739,7 @@ func Xsqlite3Atoi(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:31978:20: */
// for all bytes that have the 8th bit set and one byte with the 8th
// bit clear. Except, if we get to the 9th byte, it stores the full
// 8 bits and is the last byte.
-func putVarint64(tls *crt.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32013:28: */
+func putVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32099:28: */
bp := tls.Alloc(10)
defer tls.Free(10)
@@ -16932,7 +17759,7 @@ func putVarint64(tls *crt.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32013:28:
}
n = 0
for ok := true; ok; ok = (v != uint64(0)) {
- *(*U8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(crt.PostIncInt32(&n, 1)))) = (U8((v & uint64(0x7f)) | uint64(0x80)))
+ *(*U8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(libc.PostIncInt32(&n, 1)))) = (U8((v & uint64(0x7f)) | uint64(0x80)))
v >>= 7
}
*(*U8)(unsafe.Pointer(bp /* &buf */ + uintptr(0))) &= U8((0x7f))
@@ -16956,7 +17783,7 @@ __3:
;
return n
}
-func Xsqlite3PutVarint(tls *crt.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32037:20: */
+func Xsqlite3PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:32123:20: */
if v <= uint64(0x7f) {
*(*uint8)(unsafe.Pointer(p + uintptr(0))) = (uint8(v & uint64(0x7f)))
return 1
@@ -16979,7 +17806,7 @@ func Xsqlite3PutVarint(tls *crt.TLS, p uintptr, v U64) int32 { /* sqlite3.c:3203
// Read a 64-bit variable-length integer from memory starting at p[0].
// Return the number of bytes read. The value is stored in *v.
-func Xsqlite3GetVarint(tls *crt.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32067:19: */
+func Xsqlite3GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32153:19: */
var a U32
var b U32
var s U32
@@ -17113,7 +17940,7 @@ func Xsqlite3GetVarint(tls *crt.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:320
a = a | (b)
s = (s << 4)
- b = U32(*(*uint8)(unsafe.Pointer(p + crt.UintptrFromInt32(-4))))
+ b = U32(*(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(-4))))
b = b & (U32(0x7f))
b = (b >> 3)
s = s | (b)
@@ -17132,7 +17959,7 @@ func Xsqlite3GetVarint(tls *crt.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:320
// A MACRO version, getVarint32, is provided which inlines the
// single-byte case. All code should use the MACRO version as
// this function assumes the single-byte case has already been handled.
-func Xsqlite3GetVarint32(tls *crt.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32228:19: */
+func Xsqlite3GetVarint32(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:32314:19: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -17184,8 +18011,7 @@ func Xsqlite3GetVarint32(tls *crt.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:3
var n U8
- p -= uintptr(2)
- n = Xsqlite3GetVarint(tls, p, bp /* &v64 */)
+ n = Xsqlite3GetVarint(tls, (p - uintptr(2)), bp /* &v64 */)
if (*(*U64)(unsafe.Pointer(bp /* v64 */)) & ((U64((uint64(1))) << 32) - uint64(1))) != *(*U64)(unsafe.Pointer(bp /* v64 */)) {
*(*U32)(unsafe.Pointer(v)) = 0xffffffff
@@ -17200,19 +18026,19 @@ func Xsqlite3GetVarint32(tls *crt.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:3
// Return the number of bytes that will be needed to store the given
// 64-bit integer.
-func Xsqlite3VarintLen(tls *crt.TLS, v U64) int32 { /* sqlite3.c:32351:20: */
+func Xsqlite3VarintLen(tls *libc.TLS, v U64) int32 { /* sqlite3.c:32436:20: */
var i int32
- for i = 1; (crt.AssignShrUint64(&v, int(uint64(7)))) != uint64(0); i++ {
+ for i = 1; (libc.AssignShrUint64(&v, int(uint64(7)))) != uint64(0); i++ {
}
return i
}
// Read or write a four-byte big-endian integer value.
-func Xsqlite3Get4byte(tls *crt.TLS, p uintptr) U32 { /* sqlite3.c:32361:20: */
+func Xsqlite3Get4byte(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:32446:20: */
return ((((uint32(*(*U8)(unsafe.Pointer(p + uintptr(0)))) << 24) | (uint32(int32(*(*U8)(unsafe.Pointer(p + uintptr(1)))) << 16))) | (uint32(int32(*(*U8)(unsafe.Pointer(p + uintptr(2)))) << 8))) | uint32(*(*U8)(unsafe.Pointer(p + uintptr(3)))))
}
-func Xsqlite3Put4byte(tls *crt.TLS, p uintptr, v U32) { /* sqlite3.c:32379:21: */
+func Xsqlite3Put4byte(tls *libc.TLS, p uintptr, v U32) { /* sqlite3.c:32464:21: */
*(*uint8)(unsafe.Pointer(p + uintptr(0))) = (U8(v >> 24))
*(*uint8)(unsafe.Pointer(p + uintptr(1))) = (U8(v >> 16))
*(*uint8)(unsafe.Pointer(p + uintptr(2))) = (U8(v >> 8))
@@ -17222,7 +18048,7 @@ func Xsqlite3Put4byte(tls *crt.TLS, p uintptr, v U32) { /* sqlite3.c:32379:21: *
// Translate a single byte of Hex into an integer.
// This routine only works if h really is a valid hexadecimal
// character: 0..9a..fA..F
-func Xsqlite3HexToInt(tls *crt.TLS, h int32) U8 { /* sqlite3.c:32403:19: */
+func Xsqlite3HexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:32488:19: */
h = h + (9 * (1 & (h >> 6)))
return (U8(h & 0xf))
@@ -17232,7 +18058,7 @@ func Xsqlite3HexToInt(tls *crt.TLS, h int32) U8 { /* sqlite3.c:32403:19: */
// value. Return a pointer to its binary value. Space to hold the
// binary value has been obtained from malloc and must be freed by
// the calling routine.
-func Xsqlite3HexToBlob(tls *crt.TLS, db uintptr, z uintptr, n int32) uintptr { /* sqlite3.c:32421:21: */
+func Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr { /* sqlite3.c:32506:21: */
var zBlob uintptr
var i int32
@@ -17250,13 +18076,13 @@ func Xsqlite3HexToBlob(tls *crt.TLS, db uintptr, z uintptr, n int32) uintptr { /
// Log an error that is an API call on a connection pointer that should
// not have been used. The "type" of connection pointer is given as the
// argument. The zType is a word like "NULL" or "closed" or "invalid".
-func logBadConnection(tls *crt.TLS, zType uintptr) { /* sqlite3.c:32442:13: */
+func logBadConnection(tls *libc.TLS, zType uintptr) { /* sqlite3.c:32527:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
Xsqlite3_log(tls, 21,
- ts+718, /* "API call with %s..." */
- crt.VaList(bp, zType))
+ ts+827, /* "API call with %s..." */
+ libc.VaList(bp, zType))
}
// Check to make sure we have a valid db pointer. This test is not
@@ -17271,17 +18097,17 @@ func logBadConnection(tls *crt.TLS, zType uintptr) { /* sqlite3.c:32442:13: */
// use. sqlite3SafetyCheckSickOrOk() allows a db pointer that failed to
// open properly and is not fit for general use but which can be
// used as an argument to sqlite3_errmsg() or sqlite3_close().
-func Xsqlite3SafetyCheckOk(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:32463:20: */
+func Xsqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32548:20: */
var magic U32
if db == uintptr(0) {
- logBadConnection(tls, ts+673 /* "NULL" */)
+ logBadConnection(tls, ts+782 /* "NULL" */)
return 0
}
magic = (*Sqlite3)(unsafe.Pointer(db)).Fmagic
if magic != 0xa029a697 {
if Xsqlite3SafetyCheckSickOrOk(tls, db) != 0 {
- logBadConnection(tls, ts+763 /* "unopened" */)
+ logBadConnection(tls, ts+872 /* "unopened" */)
}
return 0
} else {
@@ -17289,12 +18115,12 @@ func Xsqlite3SafetyCheckOk(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:32463:
}
return int32(0)
}
-func Xsqlite3SafetyCheckSickOrOk(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:32480:20: */
+func Xsqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:32565:20: */
var magic U32
magic = (*Sqlite3)(unsafe.Pointer(db)).Fmagic
if ((magic != U32(0x4b771290)) && (magic != 0xa029a697)) && (magic != 0xf03b7906) {
- logBadConnection(tls, ts+772 /* "invalid" */)
+ logBadConnection(tls, ts+881 /* "invalid" */)
return 0
} else {
return 1
@@ -17306,7 +18132,7 @@ func Xsqlite3SafetyCheckSickOrOk(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:
// the other 64-bit signed integer at *pA and store the result in *pA.
// Return 0 on success. Or if the operation would have resulted in an
// overflow, leave *pA unchanged and return 1.
-func Xsqlite3AddInt64(tls *crt.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32500:20: */
+func Xsqlite3AddInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32585:20: */
var iA I64 = *(*I64)(unsafe.Pointer(pA))
if iB >= int64(0) {
@@ -17323,7 +18149,7 @@ func Xsqlite3AddInt64(tls *crt.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:325
*(*I64)(unsafe.Pointer(pA)) += (iB)
return 0
}
-func Xsqlite3SubInt64(tls *crt.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32520:20: */
+func Xsqlite3SubInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32605:20: */
if iB == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) {
@@ -17337,7 +18163,7 @@ func Xsqlite3SubInt64(tls *crt.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:325
}
return int32(0)
}
-func Xsqlite3MulInt64(tls *crt.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32535:20: */
+func Xsqlite3MulInt64(tls *libc.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:32620:20: */
var iA I64 = *(*I64)(unsafe.Pointer(pA))
if iB > int64(0) {
if iA > ((int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) / iB) {
@@ -17369,11 +18195,11 @@ func Xsqlite3MulInt64(tls *crt.TLS, pA uintptr, iB I64) int32 { /* sqlite3.c:325
// Compute the absolute value of a 32-bit signed integer, of possible. Or
// if the integer has a value of -2147483648, return +2147483647
-func Xsqlite3AbsInt32(tls *crt.TLS, x int32) int32 { /* sqlite3.c:32561:20: */
+func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32 { /* sqlite3.c:32646:20: */
if x >= 0 {
return x
}
- if x == crt.Int32FromUint32(0x80000000) {
+ if x == libc.Int32FromUint32(0x80000000) {
return 0x7fffffff
}
return -x
@@ -17383,7 +18209,7 @@ func Xsqlite3AbsInt32(tls *crt.TLS, x int32) int32 { /* sqlite3.c:32561:20: */
// not a simple "+" operator because LogEst is stored as a logarithmic
// value.
//
-func Xsqlite3LogEstAdd(tls *crt.TLS, a LogEst, b LogEst) LogEst { /* sqlite3.c:32604:23: */
+func Xsqlite3LogEstAdd(tls *libc.TLS, a LogEst, b LogEst) LogEst { /* sqlite3.c:32689:23: */
if int32(a) >= int32(b) {
if int32(a) > (int32(b) + 49) {
return a
@@ -17414,11 +18240,11 @@ var x = [32]uint8{
uint8(4), uint8(4), uint8(4), uint8(4), // 15-18
uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), uint8(3), // 19-24
uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), // 25-31
-} /* sqlite3.c:32605:30 */
+} /* sqlite3.c:32690:30 */
// Convert an integer into a LogEst. In other words, compute an
// approximation for 10*log2(x).
-func Xsqlite3LogEst(tls *crt.TLS, x U64) LogEst { /* sqlite3.c:32631:23: */
+func Xsqlite3LogEst(tls *libc.TLS, x U64) LogEst { /* sqlite3.c:32716:23: */
var y LogEst = int16(40)
if x < uint64(8) {
if x < uint64(2) {
@@ -17441,11 +18267,11 @@ func Xsqlite3LogEst(tls *crt.TLS, x U64) LogEst { /* sqlite3.c:32631:23: */
return (LogEst((int32(a[(x&uint64(7))]) + int32(y)) - 10))
}
-var a = [8]LogEst{int16(0), int16(2), int16(3), int16(5), int16(6), int16(7), int16(8), int16(9)} /* sqlite3.c:32632:17 */
+var a = [8]LogEst{int16(0), int16(2), int16(3), int16(5), int16(6), int16(7), int16(8), int16(9)} /* sqlite3.c:32717:17 */
// Convert a double into a LogEst
// In other words, compute an approximation for 10*log2(x).
-func Xsqlite3LogEstFromDouble(tls *crt.TLS, x float64) LogEst { /* sqlite3.c:32655:23: */
+func Xsqlite3LogEstFromDouble(tls *libc.TLS, x float64) LogEst { /* sqlite3.c:32740:23: */
bp := tls.Alloc(16)
defer tls.Free(16)
*(*float64)(unsafe.Pointer(bp + 8)) = x
@@ -17460,11 +18286,33 @@ func Xsqlite3LogEstFromDouble(tls *crt.TLS, x float64) LogEst { /* sqlite3.c:326
if *(*float64)(unsafe.Pointer(bp + 8 /* x */)) <= float64(2000000000) {
return Xsqlite3LogEst(tls, U64(*(*float64)(unsafe.Pointer(bp + 8 /* x */))))
}
- crt.Xmemcpy(tls, bp /* &a */, bp+8 /* &x */, uint64(8))
+ libc.Xmemcpy(tls, bp /* &a */, bp+8 /* &x */, uint64(8))
e = (LogEst((*(*U64)(unsafe.Pointer(bp /* a */)) >> 52) - uint64(1022)))
return (LogEst(int32(e) * 10))
}
+// Convert a LogEst into an integer.
+//
+// Note that this routine is only used when one or more of various
+// non-standard compile-time options is enabled.
+func Xsqlite3LogEstToInt(tls *libc.TLS, x LogEst) U64 { /* sqlite3.c:32761:20: */
+ var n U64
+ n = (U64(int32(x) % 10))
+ x = int16(int32(x) / (10))
+ if n >= uint64(5) {
+ n = n - (uint64(2))
+ } else if n >= uint64(1) {
+ n = n - (uint64(1))
+ }
+ // If only SQLITE_ENABLE_STAT4 is on, then the largest input
+ // possible to this routine is 310, resulting in a maximum x of 31
+
+ if int32(x) >= 3 {
+ return ((n + uint64(8)) << (int32(x) - 3))
+ }
+ return ((n + uint64(8)) >> (3 - int32(x)))
+}
+
// Add a new name/number pair to a VList. This might require that the
// VList object be reallocated, so return the new VList. If an OOM
// error occurs, the original VList returned and the
@@ -17499,7 +18347,7 @@ func Xsqlite3LogEstFromDouble(tls *crt.TLS, x float64) LogEst { /* sqlite3.c:326
// VList are taken. When that happens, nAlloc is set to zero as an
// indication that the VList may never again be enlarged, since the
// accompanying realloc() would invalidate the pointers.
-func Xsqlite3VListAdd(tls *crt.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) uintptr { /* sqlite3.c:32730:22: */
+func Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) uintptr { /* sqlite3.c:32815:22: */
var nInt int32 // number of sizeof(int) objects needed for zName
var z uintptr // Pointer to where zName will be stored
var i int32 // Index in pIn[] where zName is stored
@@ -17530,7 +18378,7 @@ func Xsqlite3VListAdd(tls *crt.TLS, db uintptr, pIn uintptr, zName uintptr, nNam
z = (pIn + uintptr((i+2))*4)
*(*VList)(unsafe.Pointer(pIn + uintptr(1)*4)) = (i + nInt)
- crt.Xmemcpy(tls, z, zName, uint64(nName))
+ libc.Xmemcpy(tls, z, zName, uint64(nName))
*(*int8)(unsafe.Pointer(z + uintptr(nName))) = int8(0)
return pIn
}
@@ -17538,7 +18386,7 @@ func Xsqlite3VListAdd(tls *crt.TLS, db uintptr, pIn uintptr, zName uintptr, nNam
// Return a pointer to the name of a variable in the given VList that
// has the value iVal. Or return a NULL if there is no such variable in
// the list
-func Xsqlite3VListNumToName(tls *crt.TLS, pIn uintptr, iVal int32) uintptr { /* sqlite3.c:32768:27: */
+func Xsqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) uintptr { /* sqlite3.c:32853:27: */
var i int32
var mx int32
if pIn == uintptr(0) {
@@ -17557,7 +18405,7 @@ func Xsqlite3VListNumToName(tls *crt.TLS, pIn uintptr, iVal int32) uintptr { /*
// Return the number of the variable named zName, if it is in VList.
// or return 0 if there is no such variable.
-func Xsqlite3VListNameToNum(tls *crt.TLS, pIn uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:32784:20: */
+func Xsqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:32869:20: */
var i int32
var mx int32
if pIn == uintptr(0) {
@@ -17567,7 +18415,7 @@ func Xsqlite3VListNameToNum(tls *crt.TLS, pIn uintptr, zName uintptr, nName int3
i = 2
for ok := true; ok; ok = (i < mx) {
var z uintptr = (pIn + uintptr((i+2))*4)
- if (crt.Xstrncmp(tls, z, zName, uint64(nName)) == 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(nName)))) == 0) {
+ if (libc.Xstrncmp(tls, z, zName, uint64(nName)) == 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(nName)))) == 0) {
return *(*VList)(unsafe.Pointer(pIn + uintptr(i)*4))
}
i = i + (*(*VList)(unsafe.Pointer(pIn + uintptr((i+1))*4)))
@@ -17596,7 +18444,7 @@ func Xsqlite3VListNameToNum(tls *crt.TLS, pIn uintptr, zName uintptr, nName int3
// fields of the Hash structure.
//
// "pNew" is a pointer to the hash table that is to be initialized.
-func Xsqlite3HashInit(tls *crt.TLS, pNew uintptr) { /* sqlite3.c:32821:21: */
+func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr) { /* sqlite3.c:32906:21: */
(*Hash)(unsafe.Pointer(pNew)).Ffirst = uintptr(0)
(*Hash)(unsafe.Pointer(pNew)).Fcount = uint32(0)
@@ -17607,7 +18455,7 @@ func Xsqlite3HashInit(tls *crt.TLS, pNew uintptr) { /* sqlite3.c:32821:21: */
// Remove all entries from a hash table. Reclaim all memory.
// Call this routine to delete a hash table or to reset a hash table
// to the empty state.
-func Xsqlite3HashClear(tls *crt.TLS, pH uintptr) { /* sqlite3.c:32833:21: */
+func Xsqlite3HashClear(tls *libc.TLS, pH uintptr) { /* sqlite3.c:32918:21: */
var elem uintptr // For looping over all elements of the table
elem = (*Hash)(unsafe.Pointer(pH)).Ffirst
@@ -17624,10 +18472,10 @@ func Xsqlite3HashClear(tls *crt.TLS, pH uintptr) { /* sqlite3.c:32833:21: */
}
// The hashing function.
-func strHash(tls *crt.TLS, z uintptr) uint32 { /* sqlite3.c:32853:21: */
+func strHash(tls *libc.TLS, z uintptr) uint32 { /* sqlite3.c:32938:21: */
var h uint32 = uint32(0)
var c uint8
- for (int32(crt.AssignUint8(&c, uint8(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))))) != 0 { //OPTIMIZATION-IF-TRUE
+ for (int32(libc.AssignUint8(&c, uint8(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))))) != 0 { //OPTIMIZATION-IF-TRUE
// Knuth multiplicative hashing. (Sorting & Searching, p. 510).
// 0x9e3779b1 is 2654435761 which is the closest prime number to
// (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2.
@@ -17639,7 +18487,7 @@ func strHash(tls *crt.TLS, z uintptr) uint32 { /* sqlite3.c:32853:21: */
// Link pNew element into the hash table pH. If pEntry!=0 then also
// insert pNew into the pEntry hash bucket.
-func insertElement(tls *crt.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { /* sqlite3.c:32870:13: */
+func insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { /* sqlite3.c:32955:13: */
var pHead uintptr // First element already in pEntry
if pEntry != 0 {
if (*_ht)(unsafe.Pointer(pEntry)).Fcount != 0 {
@@ -17676,7 +18524,7 @@ func insertElement(tls *crt.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { /*
// The hash table might fail to resize if sqlite3_malloc() fails or
// if the new size is the same as the prior size.
// Return TRUE if the resize occurs and false if not.
-func rehash(tls *crt.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:32904:12: */
+func rehash(tls *libc.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:32989:12: */
var new_ht uintptr // The new hash table
var elem uintptr
var next_elem uintptr // For looping over existing elements
@@ -17704,8 +18552,8 @@ func rehash(tls *crt.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:3290
}
Xsqlite3_free(tls, (*Hash)(unsafe.Pointer(pH)).Fht)
(*Hash)(unsafe.Pointer(pH)).Fht = new_ht
- (*Hash)(unsafe.Pointer(pH)).Fhtsize = crt.AssignUint32(&new_size, (uint32(uint64(Xsqlite3MallocSize(tls, new_ht)) / uint64(unsafe.Sizeof(_ht{})))))
- crt.Xmemset(tls, new_ht, 0, (uint64(new_size) * uint64(unsafe.Sizeof(_ht{}))))
+ (*Hash)(unsafe.Pointer(pH)).Fhtsize = libc.AssignUint32(&new_size, (uint32(uint64(Xsqlite3MallocSize(tls, new_ht)) / uint64(unsafe.Sizeof(_ht{})))))
+ libc.Xmemset(tls, new_ht, 0, (uint64(new_size) * uint64(unsafe.Sizeof(_ht{}))))
elem = (*Hash)(unsafe.Pointer(pH)).Ffirst
(*Hash)(unsafe.Pointer(pH)).Ffirst = uintptr(0)
for ; elem != 0; elem = next_elem {
@@ -17720,7 +18568,7 @@ func rehash(tls *crt.TLS, pH uintptr, new_size uint32) int32 { /* sqlite3.c:3290
// hash table that matches the given key. If no element is found,
// a pointer to a static null element with HashElem.data==0 is returned.
// If pH is not NULL, then the hash for this key is written to *pH.
-func findElementWithHash(tls *crt.TLS, pH uintptr, pKey uintptr, pHash uintptr) uintptr { /* sqlite3.c:32945:17: */
+func findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr) uintptr { /* sqlite3.c:33030:17: */
var elem uintptr // Used to loop thru the element list
var count uint32 // Number of elements left to test
var h uint32
@@ -17739,7 +18587,7 @@ func findElementWithHash(tls *crt.TLS, pH uintptr, pKey uintptr, pHash uintptr)
if pHash != 0 {
*(*uint32)(unsafe.Pointer(pHash)) = h
}
- for crt.PostDecUint32(&count, 1) != 0 {
+ for libc.PostDecUint32(&count, 1) != 0 {
if Xsqlite3StrICmp(tls, (*HashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 {
return elem
@@ -17749,11 +18597,11 @@ func findElementWithHash(tls *crt.TLS, pH uintptr, pKey uintptr, pHash uintptr)
return uintptr(unsafe.Pointer(&nullElement))
}
-var nullElement = HashElem{Fnext: uintptr(0), Fprev: uintptr(0), Fdata: uintptr(0), FpKey: uintptr(0)} /* sqlite3.c:32953:19 */
+var nullElement = HashElem{Fnext: uintptr(0), Fprev: uintptr(0), Fdata: uintptr(0), FpKey: uintptr(0)} /* sqlite3.c:33038:19 */
// Remove a single entry from the hash table given a pointer to that
// element and a hash on the element's key.
-func removeElementGivenHash(tls *crt.TLS, pH uintptr, elem uintptr, h uint32) { /* sqlite3.c:32980:13: */
+func removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { /* sqlite3.c:33065:13: */
var pEntry uintptr
if (*HashElem)(unsafe.Pointer(elem)).Fprev != 0 {
(*HashElem)(unsafe.Pointer((*HashElem)(unsafe.Pointer(elem)).Fprev)).Fnext = (*HashElem)(unsafe.Pointer(elem)).Fnext
@@ -17782,7 +18630,7 @@ func removeElementGivenHash(tls *crt.TLS, pH uintptr, elem uintptr, h uint32) {
// Attempt to locate an element of the hash table pH with a key
// that matches pKey. Return the data for this element if it is
// found, or NULL if there is no match.
-func Xsqlite3HashFind(tls *crt.TLS, pH uintptr, pKey uintptr) uintptr { /* sqlite3.c:33015:21: */
+func Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr { /* sqlite3.c:33100:21: */
return (*HashElem)(unsafe.Pointer(findElementWithHash(tls, pH, pKey, uintptr(0)))).Fdata
}
@@ -17800,7 +18648,7 @@ func Xsqlite3HashFind(tls *crt.TLS, pH uintptr, pKey uintptr) uintptr { /* sqlit
//
// If the "data" parameter to this function is NULL, then the
// element corresponding to "key" is removed from the hash table.
-func Xsqlite3HashInsert(tls *crt.TLS, pH uintptr, pKey uintptr, data uintptr) uintptr { /* sqlite3.c:33035:21: */
+func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) uintptr { /* sqlite3.c:33120:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -17849,188 +18697,188 @@ func Xsqlite3HashInsert(tls *crt.TLS, pH uintptr, pKey uintptr, data uintptr) ui
//************* Begin file opcodes.c ****************************************
// Automatically generated. Do not edit
// See the tool/mkopcodec.tcl script for details.
-func Xsqlite3OpcodeName(tls *crt.TLS, i int32) uintptr { /* sqlite3.c:33081:27: */
+func Xsqlite3OpcodeName(tls *libc.TLS, i int32) uintptr { /* sqlite3.c:33166:27: */
return azName[i]
}
var azName = [176]uintptr{
- /* 0 */ ts + 780, /* "Savepoint" */
- /* 1 */ ts + 790, /* "AutoCommit" */
- /* 2 */ ts + 801, /* "Transaction" */
- /* 3 */ ts + 813, /* "SorterNext" */
- /* 4 */ ts + 824, /* "Prev" */
- /* 5 */ ts + 829, /* "Next" */
- /* 6 */ ts + 834, /* "Checkpoint" */
- /* 7 */ ts + 845, /* "JournalMode" */
- /* 8 */ ts + 857, /* "Vacuum" */
- /* 9 */ ts + 864, /* "VFilter" */
- /* 10 */ ts + 872, /* "VUpdate" */
- /* 11 */ ts + 880, /* "Goto" */
- /* 12 */ ts + 885, /* "Gosub" */
- /* 13 */ ts + 891, /* "InitCoroutine" */
- /* 14 */ ts + 905, /* "Yield" */
- /* 15 */ ts + 911, /* "MustBeInt" */
- /* 16 */ ts + 921, /* "Jump" */
- /* 17 */ ts + 926, /* "Once" */
- /* 18 */ ts + 931, /* "If" */
- /* 19 */ ts + 934, /* "Not" */
- /* 20 */ ts + 938, /* "IfNot" */
- /* 21 */ ts + 944, /* "IfNullRow" */
- /* 22 */ ts + 954, /* "SeekLT" */
- /* 23 */ ts + 961, /* "SeekLE" */
- /* 24 */ ts + 968, /* "SeekGE" */
- /* 25 */ ts + 975, /* "SeekGT" */
- /* 26 */ ts + 982, /* "IfNotOpen" */
- /* 27 */ ts + 992, /* "IfNoHope" */
- /* 28 */ ts + 1001, /* "NoConflict" */
- /* 29 */ ts + 1012, /* "NotFound" */
- /* 30 */ ts + 1021, /* "Found" */
- /* 31 */ ts + 1027, /* "SeekRowid" */
- /* 32 */ ts + 1037, /* "NotExists" */
- /* 33 */ ts + 1047, /* "Last" */
- /* 34 */ ts + 1052, /* "IfSmaller" */
- /* 35 */ ts + 1062, /* "SorterSort" */
- /* 36 */ ts + 1073, /* "Sort" */
- /* 37 */ ts + 1078, /* "Rewind" */
- /* 38 */ ts + 1085, /* "IdxLE" */
- /* 39 */ ts + 1091, /* "IdxGT" */
- /* 40 */ ts + 1097, /* "IdxLT" */
- /* 41 */ ts + 1103, /* "IdxGE" */
- /* 42 */ ts + 1109, /* "RowSetRead" */
- /* 43 */ ts + 1120, /* "Or" */
- /* 44 */ ts + 1123, /* "And" */
- /* 45 */ ts + 1127, /* "RowSetTest" */
- /* 46 */ ts + 1138, /* "Program" */
- /* 47 */ ts + 1146, /* "FkIfZero" */
- /* 48 */ ts + 1155, /* "IfPos" */
- /* 49 */ ts + 1161, /* "IfNotZero" */
- /* 50 */ ts + 1171, /* "IsNull" */
- /* 51 */ ts + 1178, /* "NotNull" */
- /* 52 */ ts + 1186, /* "Ne" */
- /* 53 */ ts + 1189, /* "Eq" */
- /* 54 */ ts + 1192, /* "Gt" */
- /* 55 */ ts + 1195, /* "Le" */
- /* 56 */ ts + 1198, /* "Lt" */
- /* 57 */ ts + 1201, /* "Ge" */
- /* 58 */ ts + 1204, /* "ElseNotEq" */
- /* 59 */ ts + 1214, /* "DecrJumpZero" */
- /* 60 */ ts + 1227, /* "IncrVacuum" */
- /* 61 */ ts + 1238, /* "VNext" */
- /* 62 */ ts + 1244, /* "Init" */
- /* 63 */ ts + 1249, /* "PureFunc" */
- /* 64 */ ts + 1258, /* "Function" */
- /* 65 */ ts + 1267, /* "Return" */
- /* 66 */ ts + 1274, /* "EndCoroutine" */
- /* 67 */ ts + 1287, /* "HaltIfNull" */
- /* 68 */ ts + 1298, /* "Halt" */
- /* 69 */ ts + 1303, /* "Integer" */
- /* 70 */ ts + 1311, /* "Int64" */
- /* 71 */ ts + 1317, /* "String" */
- /* 72 */ ts + 1324, /* "Null" */
- /* 73 */ ts + 1329, /* "SoftNull" */
- /* 74 */ ts + 1338, /* "Blob" */
- /* 75 */ ts + 1343, /* "Variable" */
- /* 76 */ ts + 1352, /* "Move" */
- /* 77 */ ts + 1357, /* "Copy" */
- /* 78 */ ts + 1362, /* "SCopy" */
- /* 79 */ ts + 1368, /* "IntCopy" */
- /* 80 */ ts + 1376, /* "ResultRow" */
- /* 81 */ ts + 1386, /* "CollSeq" */
- /* 82 */ ts + 1394, /* "AddImm" */
- /* 83 */ ts + 1401, /* "RealAffinity" */
- /* 84 */ ts + 1414, /* "Cast" */
- /* 85 */ ts + 1419, /* "Permutation" */
- /* 86 */ ts + 1431, /* "Compare" */
- /* 87 */ ts + 1439, /* "IsTrue" */
- /* 88 */ ts + 1446, /* "Offset" */
- /* 89 */ ts + 1453, /* "Column" */
- /* 90 */ ts + 1460, /* "Affinity" */
- /* 91 */ ts + 1469, /* "MakeRecord" */
- /* 92 */ ts + 1480, /* "Count" */
- /* 93 */ ts + 1486, /* "ReadCookie" */
- /* 94 */ ts + 1497, /* "SetCookie" */
- /* 95 */ ts + 1507, /* "ReopenIdx" */
- /* 96 */ ts + 1517, /* "OpenRead" */
- /* 97 */ ts + 1526, /* "OpenWrite" */
- /* 98 */ ts + 1536, /* "OpenDup" */
- /* 99 */ ts + 1544, /* "OpenAutoindex" */
- /* 100 */ ts + 1558, /* "OpenEphemeral" */
- /* 101 */ ts + 1572, /* "BitAnd" */
- /* 102 */ ts + 1579, /* "BitOr" */
- /* 103 */ ts + 1585, /* "ShiftLeft" */
- /* 104 */ ts + 1595, /* "ShiftRight" */
- /* 105 */ ts + 1606, /* "Add" */
- /* 106 */ ts + 1610, /* "Subtract" */
- /* 107 */ ts + 1619, /* "Multiply" */
- /* 108 */ ts + 1628, /* "Divide" */
- /* 109 */ ts + 1635, /* "Remainder" */
- /* 110 */ ts + 1645, /* "Concat" */
- /* 111 */ ts + 1652, /* "SorterOpen" */
- /* 112 */ ts + 1663, /* "BitNot" */
- /* 113 */ ts + 1670, /* "SequenceTest" */
- /* 114 */ ts + 1683, /* "OpenPseudo" */
- /* 115 */ ts + 1694, /* "String8" */
- /* 116 */ ts + 1702, /* "Close" */
- /* 117 */ ts + 1708, /* "ColumnsUsed" */
- /* 118 */ ts + 1720, /* "SeekHit" */
- /* 119 */ ts + 1728, /* "Sequence" */
- /* 120 */ ts + 1737, /* "NewRowid" */
- /* 121 */ ts + 1746, /* "Insert" */
- /* 122 */ ts + 1753, /* "Delete" */
- /* 123 */ ts + 1760, /* "ResetCount" */
- /* 124 */ ts + 1771, /* "SorterCompare" */
- /* 125 */ ts + 1785, /* "SorterData" */
- /* 126 */ ts + 1796, /* "RowData" */
- /* 127 */ ts + 1804, /* "Rowid" */
- /* 128 */ ts + 1810, /* "NullRow" */
- /* 129 */ ts + 1818, /* "SeekEnd" */
- /* 130 */ ts + 1826, /* "IdxInsert" */
- /* 131 */ ts + 1836, /* "SorterInsert" */
- /* 132 */ ts + 1849, /* "IdxDelete" */
- /* 133 */ ts + 1859, /* "DeferredSeek" */
- /* 134 */ ts + 1872, /* "IdxRowid" */
- /* 135 */ ts + 1881, /* "FinishSeek" */
- /* 136 */ ts + 1892, /* "Destroy" */
- /* 137 */ ts + 1900, /* "Clear" */
- /* 138 */ ts + 1906, /* "ResetSorter" */
- /* 139 */ ts + 1918, /* "CreateBtree" */
- /* 140 */ ts + 1930, /* "SqlExec" */
- /* 141 */ ts + 1938, /* "ParseSchema" */
- /* 142 */ ts + 1950, /* "LoadAnalysis" */
- /* 143 */ ts + 1963, /* "DropTable" */
- /* 144 */ ts + 1973, /* "DropIndex" */
- /* 145 */ ts + 1983, /* "DropTrigger" */
- /* 146 */ ts + 1995, /* "IntegrityCk" */
- /* 147 */ ts + 2007, /* "RowSetAdd" */
- /* 148 */ ts + 2017, /* "Param" */
- /* 149 */ ts + 2023, /* "FkCounter" */
- /* 150 */ ts + 2033, /* "Real" */
- /* 151 */ ts + 2038, /* "MemMax" */
- /* 152 */ ts + 2045, /* "OffsetLimit" */
- /* 153 */ ts + 2057, /* "AggInverse" */
- /* 154 */ ts + 2068, /* "AggStep" */
- /* 155 */ ts + 2076, /* "AggStep1" */
- /* 156 */ ts + 2085, /* "AggValue" */
- /* 157 */ ts + 2094, /* "AggFinal" */
- /* 158 */ ts + 2103, /* "Expire" */
- /* 159 */ ts + 2110, /* "CursorLock" */
- /* 160 */ ts + 2121, /* "CursorUnlock" */
- /* 161 */ ts + 2134, /* "TableLock" */
- /* 162 */ ts + 2144, /* "VBegin" */
- /* 163 */ ts + 2151, /* "VCreate" */
- /* 164 */ ts + 2159, /* "VDestroy" */
- /* 165 */ ts + 2168, /* "VOpen" */
- /* 166 */ ts + 2174, /* "VColumn" */
- /* 167 */ ts + 2182, /* "VRename" */
- /* 168 */ ts + 2190, /* "Pagecount" */
- /* 169 */ ts + 2200, /* "MaxPgcnt" */
- /* 170 */ ts + 2209, /* "Trace" */
- /* 171 */ ts + 2215, /* "CursorHint" */
- /* 172 */ ts + 2226, /* "ReleaseReg" */
- /* 173 */ ts + 2237, /* "Noop" */
- /* 174 */ ts + 2242, /* "Explain" */
- /* 175 */ ts + 2250, /* "Abortable" */
-} /* sqlite3.c:33082:20 */
+ /* 0 */ ts + 889, /* "Savepoint\x00" */
+ /* 1 */ ts + 900, /* "AutoCommit\x00" */
+ /* 2 */ ts + 912, /* "Transaction\x00" */
+ /* 3 */ ts + 925, /* "SorterNext\x00" */
+ /* 4 */ ts + 937, /* "Prev\x00" */
+ /* 5 */ ts + 943, /* "Next\x00" */
+ /* 6 */ ts + 949, /* "Checkpoint\x00" */
+ /* 7 */ ts + 961, /* "JournalMode\x00" */
+ /* 8 */ ts + 974, /* "Vacuum\x00" */
+ /* 9 */ ts + 982, /* "VFilter\x00iplan=r[..." */
+ /* 10 */ ts + 1013, /* "VUpdate\x00data=r[P..." */
+ /* 11 */ ts + 1035, /* "Goto\x00" */
+ /* 12 */ ts + 1041, /* "Gosub\x00" */
+ /* 13 */ ts + 1048, /* "InitCoroutine\x00" */
+ /* 14 */ ts + 1063, /* "Yield\x00" */
+ /* 15 */ ts + 1070, /* "MustBeInt\x00" */
+ /* 16 */ ts + 1081, /* "Jump\x00" */
+ /* 17 */ ts + 1087, /* "Once\x00" */
+ /* 18 */ ts + 1093, /* "If\x00" */
+ /* 19 */ ts + 1097, /* "Not\x00r[P2]= !r[P1..." */
+ /* 20 */ ts + 1115, /* "IfNot\x00" */
+ /* 21 */ ts + 1122, /* "IfNullRow\x00if P1...." */
+ /* 22 */ ts + 1171, /* "SeekLT\x00key=r[P3@..." */
+ /* 23 */ ts + 1191, /* "SeekLE\x00key=r[P3@..." */
+ /* 24 */ ts + 1211, /* "SeekGE\x00key=r[P3@..." */
+ /* 25 */ ts + 1231, /* "SeekGT\x00key=r[P3@..." */
+ /* 26 */ ts + 1251, /* "IfNotOpen\x00if( !c..." */
+ /* 27 */ ts + 1284, /* "IfNoHope\x00key=r[P..." */
+ /* 28 */ ts + 1306, /* "NoConflict\x00key=r..." */
+ /* 29 */ ts + 1330, /* "NotFound\x00key=r[P..." */
+ /* 30 */ ts + 1352, /* "Found\x00key=r[P3@P..." */
+ /* 31 */ ts + 1371, /* "SeekRowid\x00intkey..." */
+ /* 32 */ ts + 1394, /* "NotExists\x00intkey..." */
+ /* 33 */ ts + 1417, /* "Last\x00" */
+ /* 34 */ ts + 1423, /* "IfSmaller\x00" */
+ /* 35 */ ts + 1434, /* "SorterSort\x00" */
+ /* 36 */ ts + 1446, /* "Sort\x00" */
+ /* 37 */ ts + 1452, /* "Rewind\x00" */
+ /* 38 */ ts + 1460, /* "IdxLE\x00key=r[P3@P..." */
+ /* 39 */ ts + 1479, /* "IdxGT\x00key=r[P3@P..." */
+ /* 40 */ ts + 1498, /* "IdxLT\x00key=r[P3@P..." */
+ /* 41 */ ts + 1517, /* "IdxGE\x00key=r[P3@P..." */
+ /* 42 */ ts + 1536, /* "RowSetRead\x00r[P3]..." */
+ /* 43 */ ts + 1564, /* "Or\x00r[P3]=(r[P1] ..." */
+ /* 44 */ ts + 1590, /* "And\x00r[P3]=(r[P1]..." */
+ /* 45 */ ts + 1617, /* "RowSetTest\x00if r[..." */
+ /* 46 */ ts + 1659, /* "Program\x00" */
+ /* 47 */ ts + 1668, /* "FkIfZero\x00if fkct..." */
+ /* 48 */ ts + 1701, /* "IfPos\x00if r[P1]>0..." */
+ /* 49 */ ts + 1742, /* "IfNotZero\x00if r[P..." */
+ /* 50 */ ts + 1786, /* "IsNull\x00if r[P1]=..." */
+ /* 51 */ ts + 1816, /* "NotNull\x00if r[P1]..." */
+ /* 52 */ ts + 1847, /* "Ne\x00IF r[P3]!=r[P..." */
+ /* 53 */ ts + 1866, /* "Eq\x00IF r[P3]==r[P..." */
+ /* 54 */ ts + 1885, /* "Gt\x00IF r[P3]>r[P1..." */
+ /* 55 */ ts + 1903, /* "Le\x00IF r[P3]<=r[P..." */
+ /* 56 */ ts + 1922, /* "Lt\x00IF r[P3]<r[P1..." */
+ /* 57 */ ts + 1940, /* "Ge\x00IF r[P3]>=r[P..." */
+ /* 58 */ ts + 1959, /* "ElseNotEq\x00" */
+ /* 59 */ ts + 1970, /* "DecrJumpZero\x00if ..." */
+ /* 60 */ ts + 2007, /* "IncrVacuum\x00" */
+ /* 61 */ ts + 2019, /* "VNext\x00" */
+ /* 62 */ ts + 2026, /* "Init\x00Start at P2" */
+ /* 63 */ ts + 2043, /* "PureFunc\x00r[P3]=f..." */
+ /* 64 */ ts + 2073, /* "Function\x00r[P3]=f..." */
+ /* 65 */ ts + 2103, /* "Return\x00" */
+ /* 66 */ ts + 2111, /* "EndCoroutine\x00" */
+ /* 67 */ ts + 2125, /* "HaltIfNull\x00if r[..." */
+ /* 68 */ ts + 2155, /* "Halt\x00" */
+ /* 69 */ ts + 2161, /* "Integer\x00r[P2]=P1" */
+ /* 70 */ ts + 2178, /* "Int64\x00r[P2]=P4" */
+ /* 71 */ ts + 2193, /* "String\x00r[P2]='P4..." */
+ /* 72 */ ts + 2220, /* "Null\x00r[P2..P3]=N..." */
+ /* 73 */ ts + 2240, /* "SoftNull\x00r[P1]=N..." */
+ /* 74 */ ts + 2260, /* "Blob\x00r[P2]=P4 (l..." */
+ /* 75 */ ts + 2283, /* "Variable\x00r[P2]=p..." */
+ /* 76 */ ts + 2315, /* "Move\x00r[P2@P3]=r[..." */
+ /* 77 */ ts + 2338, /* "Copy\x00r[P2@P3+1]=..." */
+ /* 78 */ ts + 2365, /* "SCopy\x00r[P2]=r[P1..." */
+ /* 79 */ ts + 2383, /* "IntCopy\x00r[P2]=r[..." */
+ /* 80 */ ts + 2403, /* "ResultRow\x00output..." */
+ /* 81 */ ts + 2429, /* "CollSeq\x00" */
+ /* 82 */ ts + 2438, /* "AddImm\x00r[P1]=r[P..." */
+ /* 83 */ ts + 2460, /* "RealAffinity\x00" */
+ /* 84 */ ts + 2474, /* "Cast\x00affinity(r[..." */
+ /* 85 */ ts + 2495, /* "Permutation\x00" */
+ /* 86 */ ts + 2508, /* "Compare\x00r[P1@P3]..." */
+ /* 87 */ ts + 2538, /* "IsTrue\x00r[P2] = c..." */
+ /* 88 */ ts + 2583, /* "Offset\x00r[P3] = s..." */
+ /* 89 */ ts + 2616, /* "Column\x00r[P3]=PX" */
+ /* 90 */ ts + 2632, /* "Affinity\x00affinit..." */
+ /* 91 */ ts + 2660, /* "MakeRecord\x00r[P3]..." */
+ /* 92 */ ts + 2693, /* "Count\x00r[P2]=coun..." */
+ /* 93 */ ts + 2713, /* "ReadCookie\x00" */
+ /* 94 */ ts + 2725, /* "SetCookie\x00" */
+ /* 95 */ ts + 2736, /* "ReopenIdx\x00root=P..." */
+ /* 96 */ ts + 2761, /* "OpenRead\x00root=P2..." */
+ /* 97 */ ts + 2785, /* "OpenWrite\x00root=P..." */
+ /* 98 */ ts + 2810, /* "OpenDup\x00" */
+ /* 99 */ ts + 2819, /* "OpenAutoindex\x00nC..." */
+ /* 100 */ ts + 2844, /* "OpenEphemeral\x00nC..." */
+ /* 101 */ ts + 2869, /* "BitAnd\x00r[P3]=r[P..." */
+ /* 102 */ ts + 2894, /* "BitOr\x00r[P3]=r[P1..." */
+ /* 103 */ ts + 2918, /* "ShiftLeft\x00r[P3]=..." */
+ /* 104 */ ts + 2947, /* "ShiftRight\x00r[P3]..." */
+ /* 105 */ ts + 2977, /* "Add\x00r[P3]=r[P1]+..." */
+ /* 106 */ ts + 2999, /* "Subtract\x00r[P3]=r..." */
+ /* 107 */ ts + 3026, /* "Multiply\x00r[P3]=r..." */
+ /* 108 */ ts + 3053, /* "Divide\x00r[P3]=r[P..." */
+ /* 109 */ ts + 3078, /* "Remainder\x00r[P3]=..." */
+ /* 110 */ ts + 3106, /* "Concat\x00r[P3]=r[P..." */
+ /* 111 */ ts + 3131, /* "SorterOpen\x00" */
+ /* 112 */ ts + 3143, /* "BitNot\x00r[P2]= ~r..." */
+ /* 113 */ ts + 3164, /* "SequenceTest\x00if(..." */
+ /* 114 */ ts + 3208, /* "OpenPseudo\x00P3 co..." */
+ /* 115 */ ts + 3239, /* "String8\x00r[P2]='P..." */
+ /* 116 */ ts + 3258, /* "Close\x00" */
+ /* 117 */ ts + 3265, /* "ColumnsUsed\x00" */
+ /* 118 */ ts + 3278, /* "SeekHit\x00seekHit=..." */
+ /* 119 */ ts + 3297, /* "Sequence\x00r[P2]=c..." */
+ /* 120 */ ts + 3329, /* "NewRowid\x00r[P2]=r..." */
+ /* 121 */ ts + 3350, /* "Insert\x00intkey=r[..." */
+ /* 122 */ ts + 3381, /* "Delete\x00" */
+ /* 123 */ ts + 3389, /* "ResetCount\x00" */
+ /* 124 */ ts + 3401, /* "SorterCompare\x00if..." */
+ /* 125 */ ts + 3450, /* "SorterData\x00r[P2]..." */
+ /* 126 */ ts + 3472, /* "RowData\x00r[P2]=da..." */
+ /* 127 */ ts + 3491, /* "Rowid\x00r[P2]=rowi..." */
+ /* 128 */ ts + 3509, /* "NullRow\x00" */
+ /* 129 */ ts + 3518, /* "SeekEnd\x00" */
+ /* 130 */ ts + 3527, /* "IdxInsert\x00key=r[..." */
+ /* 131 */ ts + 3547, /* "SorterInsert\x00key..." */
+ /* 132 */ ts + 3570, /* "IdxDelete\x00key=r[..." */
+ /* 133 */ ts + 3593, /* "DeferredSeek\x00Mov..." */
+ /* 134 */ ts + 3636, /* "IdxRowid\x00r[P2]=r..." */
+ /* 135 */ ts + 3657, /* "FinishSeek\x00" */
+ /* 136 */ ts + 3669, /* "Destroy\x00" */
+ /* 137 */ ts + 3678, /* "Clear\x00" */
+ /* 138 */ ts + 3685, /* "ResetSorter\x00" */
+ /* 139 */ ts + 3698, /* "CreateBtree\x00r[P2..." */
+ /* 140 */ ts + 3737, /* "SqlExec\x00" */
+ /* 141 */ ts + 3746, /* "ParseSchema\x00" */
+ /* 142 */ ts + 3759, /* "LoadAnalysis\x00" */
+ /* 143 */ ts + 3773, /* "DropTable\x00" */
+ /* 144 */ ts + 3784, /* "DropIndex\x00" */
+ /* 145 */ ts + 3795, /* "DropTrigger\x00" */
+ /* 146 */ ts + 3808, /* "IntegrityCk\x00" */
+ /* 147 */ ts + 3821, /* "RowSetAdd\x00rowset..." */
+ /* 148 */ ts + 3848, /* "Param\x00" */
+ /* 149 */ ts + 3855, /* "FkCounter\x00fkctr[..." */
+ /* 150 */ ts + 3879, /* "Real\x00r[P2]=P4" */
+ /* 151 */ ts + 3893, /* "MemMax\x00r[P1]=max..." */
+ /* 152 */ ts + 3923, /* "OffsetLimit\x00if r..." */
+ /* 153 */ ts + 3992, /* "AggInverse\x00accum..." */
+ /* 154 */ ts + 4033, /* "AggStep\x00accum=r[..." */
+ /* 155 */ ts + 4068, /* "AggStep1\x00accum=r..." */
+ /* 156 */ ts + 4104, /* "AggValue\x00r[P3]=v..." */
+ /* 157 */ ts + 4130, /* "AggFinal\x00accum=r..." */
+ /* 158 */ ts + 4156, /* "Expire\x00" */
+ /* 159 */ ts + 4164, /* "CursorLock\x00" */
+ /* 160 */ ts + 4176, /* "CursorUnlock\x00" */
+ /* 161 */ ts + 4190, /* "TableLock\x00iDb=P1..." */
+ /* 162 */ ts + 4224, /* "VBegin\x00" */
+ /* 163 */ ts + 4232, /* "VCreate\x00" */
+ /* 164 */ ts + 4241, /* "VDestroy\x00" */
+ /* 165 */ ts + 4251, /* "VOpen\x00" */
+ /* 166 */ ts + 4258, /* "VColumn\x00r[P3]=vc..." */
+ /* 167 */ ts + 4284, /* "VRename\x00" */
+ /* 168 */ ts + 4293, /* "Pagecount\x00" */
+ /* 169 */ ts + 4304, /* "MaxPgcnt\x00" */
+ /* 170 */ ts + 4314, /* "Trace\x00" */
+ /* 171 */ ts + 4321, /* "CursorHint\x00" */
+ /* 172 */ ts + 4333, /* "ReleaseReg\x00relea..." */
+ /* 173 */ ts + 4369, /* "Noop\x00" */
+ /* 174 */ ts + 4375, /* "Explain\x00" */
+ /* 175 */ ts + 4384, /* "Abortable\x00" */
+} /* sqlite3.c:33167:20 */
//************* End of opcodes.c ********************************************
//************* Begin file os_unix.c ****************************************
@@ -18198,46 +19046,46 @@ var azName = [176]uintptr{
// x86-64 versions of the `xmknod' interface.
type stat = struct {
- Fst_dev uint64
- Fst_ino uint64
- Fst_nlink uint64
- Fst_mode uint32
- Fst_uid uint32
- Fst_gid uint32
+ Fst_dev X__dev_t
+ Fst_ino X__ino_t
+ Fst_nlink X__nlink_t
+ Fst_mode X__mode_t
+ Fst_uid X__uid_t
+ Fst_gid X__gid_t
F__pad0 int32
- Fst_rdev uint64
- Fst_size int64
- Fst_blksize int64
- Fst_blocks int64
- Fst_atime int64
- Fst_atimensec uint64
- Fst_mtime int64
- Fst_mtimensec uint64
- Fst_ctime int64
- Fst_ctimensec uint64
- F__glibc_reserved [3]int64
+ Fst_rdev X__dev_t
+ Fst_size X__off_t
+ Fst_blksize X__blksize_t
+ Fst_blocks X__blkcnt_t
+ Fst_atime X__time_t
+ Fst_atimensec X__syscall_ulong_t
+ Fst_mtime X__time_t
+ Fst_mtimensec X__syscall_ulong_t
+ Fst_ctime X__time_t
+ Fst_ctimensec X__syscall_ulong_t
+ F__glibc_reserved [3]X__syscall_slong_t
}
// Note stat64 has the same shape as stat for x86-64.
type stat64 = struct {
- Fst_dev uint64
- Fst_ino uint64
- Fst_nlink uint64
- Fst_mode uint32
- Fst_uid uint32
- Fst_gid uint32
+ Fst_dev X__dev_t
+ Fst_ino X__ino64_t
+ Fst_nlink X__nlink_t
+ Fst_mode X__mode_t
+ Fst_uid X__uid_t
+ Fst_gid X__gid_t
F__pad0 int32
- Fst_rdev uint64
- Fst_size int64
- Fst_blksize int64
- Fst_blocks int64
- Fst_atime int64
- Fst_atimensec uint64
- Fst_mtime int64
- Fst_mtimensec uint64
- Fst_ctime int64
- Fst_ctimensec uint64
- F__glibc_reserved [3]int64
+ Fst_rdev X__dev_t
+ Fst_size X__off_t
+ Fst_blksize X__blksize_t
+ Fst_blocks X__blkcnt64_t
+ Fst_atime X__time_t
+ Fst_atimensec X__syscall_ulong_t
+ Fst_mtime X__time_t
+ Fst_mtimensec X__syscall_ulong_t
+ Fst_ctime X__time_t
+ Fst_ctimensec X__syscall_ulong_t
+ F__glibc_reserved [3]X__syscall_slong_t
}
// Copyright (C) 1991-2018 Free Software Foundation, Inc.
@@ -18324,18 +19172,18 @@ type stat64 = struct {
type flock = struct {
Fl_type int16
Fl_whence int16
- Fl_start int64
- Fl_len int64
- Fl_pid int32
+ Fl_start X__off64_t
+ Fl_len X__off64_t
+ Fl_pid X__pid_t
_ [4]byte
}
type flock64 = struct {
Fl_type int16
Fl_whence int16
- Fl_start int64
- Fl_len int64
- Fl_pid int32
+ Fl_start X__off64_t
+ Fl_len X__off64_t
+ Fl_pid X__pid_t
_ [4]byte
}
@@ -18957,9 +19805,9 @@ type termio = struct {
// The Single Unix specification says that some more types are
// available here.
-type Intptr_t = int64 /* unistd.h:267:20 */
+type Intptr_t = X__intptr_t /* unistd.h:267:20 */
-type Socklen_t = uint32 /* unistd.h:274:21 */
+type Socklen_t = X__socklen_t /* unistd.h:274:21 */
// Prior to Issue 6, the Single Unix Specification required these
// prototypes to appear in this header. They are also found in
@@ -19048,32 +19896,131 @@ type Socklen_t = uint32 /* unistd.h:274:21 */
// A time value that is accurate to the nearest
// microsecond but also has a range of years.
type timeval = struct {
- Ftv_sec int64
- Ftv_usec int64
+ Ftv_sec X__time_t
+ Ftv_usec X__suseconds_t
}
+// `fd_set' type and related macros, and `select'/`pselect' declarations.
+// Copyright (C) 1996-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// POSIX 1003.1g: 6.2 Select from File Descriptor Sets <sys/select.h>
+
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Get definition of needed basic types.
+// bits/types.h -- definitions of __*_t types underlying *_t types.
+// Copyright (C) 2002-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Never include this file directly; use <sys/types.h> instead.
+
+// Get __FD_* definitions.
+// Copyright (C) 1997-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// Determine the wordsize from the preprocessor defines.
+
+// Both x86-64 and x32 use the 64-bit system call interface.
+
+// We don't use `memset' because this would require a prototype and
+// the array isn't too big.
+
+// Get sigset_t.
+
+type X__sigset_t = struct{ F__val [16]uint64 } /* __sigset_t.h:8:3 */
+
// A set of signals to be blocked, unblocked, or waited for.
-type Sigset_t = struct{ F__val [16]uint64 } /* sigset_t.h:7:20 */
+type Sigset_t = X__sigset_t /* sigset_t.h:7:20 */
+
+// Get definition of timer specification structures.
+// NB: Include guard matches what <linux/time.h> uses.
+
+// The fd_set member is required to be an array of longs.
+type X__fd_mask = int64 /* select.h:49:18 */
// Some versions of <linux/posix_types.h> define this macros.
// It's easier to assume 8-bit bytes than to get CHAR_BIT.
// fd_set for select and pselect.
-type Fd_set = struct{ Ffds_bits [16]int64 } /* select.h:70:5 */
+type Fd_set = struct{ Ffds_bits [16]X__fd_mask } /* select.h:70:5 */
+
+// Define some inlines helping to catch common problems.
+
+type X__timezone_ptr_t = uintptr /* time.h:60:14 */
// Type of the second argument to `getitimer' and
// the second and third arguments `setitimer'.
type itimerval = struct {
Fit_interval struct {
- Ftv_sec int64
- Ftv_usec int64
+ Ftv_sec X__time_t
+ Ftv_usec X__suseconds_t
}
Fit_value struct {
- Ftv_sec int64
- Ftv_usec int64
+ Ftv_sec X__time_t
+ Ftv_usec X__suseconds_t
}
}
+type X__itimer_which_t = int32 /* time.h:117:13 */
+
// Try to determine if gethostuuid() is available based on standard
// macros. This might sometimes compute the wrong value for some
// obscure platforms. For those cases, simply compile with one of
@@ -19146,7 +20093,7 @@ type unixShm = struct {
// a normal expected return code of SQLITE_BUSY or SQLITE_OK
// Forward references
-type UnixShm = unixShm /* sqlite3.c:33461:24 */ // Connection shared memory
+type UnixShm = unixShm /* sqlite3.c:33546:24 */ // Connection shared memory
type unixShmNode = struct {
FpInode uintptr
FpShmMutex uintptr
@@ -19162,7 +20109,7 @@ type unixShmNode = struct {
}
// Connection shared memory
-type UnixShmNode = unixShmNode /* sqlite3.c:33462:28 */ // Shared memory instance
+type UnixShmNode = unixShmNode /* sqlite3.c:33547:28 */ // Shared memory instance
type unixInodeInfo = struct {
FfileId struct {
Fdev Dev_t
@@ -19181,7 +20128,7 @@ type unixInodeInfo = struct {
}
// Shared memory instance
-type UnixInodeInfo = unixInodeInfo /* sqlite3.c:33463:30 */ // An i-node
+type UnixInodeInfo = unixInodeInfo /* sqlite3.c:33548:30 */ // An i-node
type UnixUnusedFd1 = struct {
Ffd int32
Fflags int32
@@ -19189,7 +20136,7 @@ type UnixUnusedFd1 = struct {
}
// An i-node
-type UnixUnusedFd = UnixUnusedFd1 /* sqlite3.c:33464:29 */
+type UnixUnusedFd = UnixUnusedFd1 /* sqlite3.c:33549:29 */
// The unixFile structure is subclass of sqlite3_file specific to the unix
// VFS implementations.
@@ -19218,13 +20165,13 @@ type unixFile = struct {
// The unixFile structure is subclass of sqlite3_file specific to the unix
// VFS implementations.
-type UnixFile = unixFile /* sqlite3.c:33482:25 */
+type UnixFile = unixFile /* sqlite3.c:33567:25 */
// This variable holds the process id (pid) from when the xRandomness()
// method was called. If xOpen() is called from a different process id,
// indicating that a fork() has occurred, the PRNG will be reset.
-var randomnessPid Pid_t = 0 /* sqlite3.c:33543:14 */
-func local_ioerr(tls *crt.TLS) { /* sqlite3.c:33727:13: */
+var randomnessPid Pid_t = 0 /* sqlite3.c:33628:14 */
+func local_ioerr(tls *libc.TLS) { /* sqlite3.c:33812:13: */
Xsqlite3_io_error_hit++
if !(Xsqlite3_io_error_benign != 0) {
@@ -19253,11 +20200,11 @@ func local_ioerr(tls *crt.TLS) { /* sqlite3.c:33727:13: */
//
// The safest way to deal with the problem is to always use this wrapper
// which always has the same well-defined interface.
-func posixOpen(tls *crt.TLS, zFile uintptr, flags int32, mode int32) int32 { /* sqlite3.c:33832:12: */
+func posixOpen(tls *libc.TLS, zFile uintptr, flags int32, mode int32) int32 { /* sqlite3.c:33917:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
- return crt.Xopen64(tls, zFile, flags, crt.VaList(bp, mode))
+ return libc.Xopen64(tls, zFile, flags, libc.VaList(bp, mode))
}
// Many system calls are accessed through pointer-to-functions so that
@@ -19275,84 +20222,84 @@ type unix_syscall = struct {
// testing and sandboxing. The following array holds the names and pointers
// to all overrideable system calls.
var aSyscall = [29]unix_syscall{
- {FzName: ts + 2260 /* "open" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4395 /* "open" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2265 /* "close" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4400 /* "close" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2271 /* "access" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4406 /* "access" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2278 /* "getcwd" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4413 /* "getcwd" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2285 /* "stat" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4420 /* "stat" */, FpCurrent: 0, FpDefault: uintptr(0)},
// The DJGPP compiler environment looks mostly like Unix, but it
// lacks the fcntl() system call. So redefine fcntl() to be something
// that always succeeds. This means that locking does not occur under
// DJGPP. But it is DOS - what did you expect?
- {FzName: ts + 2290 /* "fstat" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4425 /* "fstat" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2296 /* "ftruncate" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4431 /* "ftruncate" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2306 /* "fcntl" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4441 /* "fcntl" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2312 /* "read" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4447 /* "read" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2317 /* "pread" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
+ {FzName: ts + 4452 /* "pread" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
- {FzName: ts + 2323 /* "pread64" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
+ {FzName: ts + 4458 /* "pread64" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
- {FzName: ts + 2331 /* "write" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4466 /* "write" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2337 /* "pwrite" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
+ {FzName: ts + 4472 /* "pwrite" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
- {FzName: ts + 2344 /* "pwrite64" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
+ {FzName: ts + 4479 /* "pwrite64" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
- {FzName: ts + 2353 /* "fchmod" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4488 /* "fchmod" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2360 /* "fallocate" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
+ {FzName: ts + 4495 /* "fallocate" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
- {FzName: ts + 2370 /* "unlink" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4505 /* "unlink" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2377 /* "openDirectory" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4512 /* "openDirectory" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2391 /* "mkdir" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4526 /* "mkdir" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2397 /* "rmdir" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4532 /* "rmdir" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2403 /* "fchown" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4538 /* "fchown" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2410 /* "geteuid" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4545 /* "geteuid" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2418 /* "mmap" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4553 /* "mmap" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2423 /* "munmap" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4558 /* "munmap" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2430 /* "mremap" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
+ {FzName: ts + 4565 /* "mremap" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
- {FzName: ts + 2437 /* "getpagesize" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4572 /* "getpagesize" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2449 /* "readlink" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4584 /* "readlink" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2458 /* "lstat" */, FpCurrent: 0, FpDefault: uintptr(0)},
+ {FzName: ts + 4593 /* "lstat" */, FpCurrent: 0, FpDefault: uintptr(0)},
- {FzName: ts + 2464 /* "ioctl" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
-} /* sqlite3.c:33850:3 */ // End of the overrideable system calls
+ {FzName: ts + 4599 /* "ioctl" */, FpCurrent: uintptr(0), FpDefault: uintptr(0)},
+} /* sqlite3.c:33935:3 */ // End of the overrideable system calls
// On some systems, calls to fchown() will trigger a message in a security
// log if they come from non-root processes. So avoid calling fchown() if
// we are not running as root.
-func robustFchown(tls *crt.TLS, fd int32, uid Uid_t, gid Gid_t) int32 { /* sqlite3.c:34020:12: */
- if (*(*func(*crt.TLS) Uid_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(21)*24 + 8 /* &.pCurrent */))))(tls) != 0 {
+func robustFchown(tls *libc.TLS, fd int32, uid Uid_t, gid Gid_t) int32 { /* sqlite3.c:34105:12: */
+ if (*(*func(*libc.TLS) Uid_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(21)*24 + 8 /* &.pCurrent */))))(tls) != 0 {
return 0
}
- return (*(*func(*crt.TLS, int32, Uid_t, Gid_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(20)*24 + 8 /* &.pCurrent */))))(tls, fd, uid, gid)
+ return (*(*func(*libc.TLS, int32, Uid_t, Gid_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(20)*24 + 8 /* &.pCurrent */))))(tls, fd, uid, gid)
}
// This is the xSetSystemCall() method of sqlite3_vfs for all of the
// "unix" VFSes. Return SQLITE_OK opon successfully updating the
// system call pointer, or SQLITE_NOTFOUND if there is no configurable
// system call named zName.
-func unixSetSystemCall(tls *crt.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Sqlite3_syscall_ptr) int32 { /* sqlite3.c:34034:12: */
+func unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Sqlite3_syscall_ptr) int32 { /* sqlite3.c:34119:12: */
var i uint32
var rc int32 = 12
@@ -19370,7 +20317,7 @@ func unixSetSystemCall(tls *crt.TLS, pNotUsed uintptr, zName uintptr, pNewFunc S
// If zName is specified, operate on only the one system call
// specified.
for i = uint32(0); uint64(i) < (uint64(unsafe.Sizeof(aSyscall)) / uint64(unsafe.Sizeof(unix_syscall{}))); i++ {
- if crt.Xstrcmp(tls, zName, aSyscall[i].FzName) == 0 {
+ if libc.Xstrcmp(tls, zName, aSyscall[i].FzName) == 0 {
if aSyscall[i].FpDefault == uintptr(0) {
aSyscall[i].FpDefault = aSyscall[i].FpCurrent
}
@@ -19389,12 +20336,12 @@ func unixSetSystemCall(tls *crt.TLS, pNotUsed uintptr, zName uintptr, pNewFunc S
// Return the value of a system call. Return NULL if zName is not a
// recognized system call name. NULL is also returned if the system call
// is currently undefined.
-func unixGetSystemCall(tls *crt.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_syscall_ptr { /* sqlite3.c:34077:28: */
+func unixGetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_syscall_ptr { /* sqlite3.c:34162:28: */
var i uint32
_ = pNotUsed
for i = uint32(0); uint64(i) < (uint64(unsafe.Sizeof(aSyscall)) / uint64(unsafe.Sizeof(unix_syscall{}))); i++ {
- if crt.Xstrcmp(tls, zName, aSyscall[i].FzName) == 0 {
+ if libc.Xstrcmp(tls, zName, aSyscall[i].FzName) == 0 {
return aSyscall[i].FpCurrent
}
}
@@ -19405,13 +20352,13 @@ func unixGetSystemCall(tls *crt.TLS, pNotUsed uintptr, zName uintptr) Sqlite3_sy
// then return the name of the first system call. Return NULL if zName
// is the last system call or if zName is not the name of a valid
// system call.
-func unixNextSystemCall(tls *crt.TLS, p uintptr, zName uintptr) uintptr { /* sqlite3.c:34096:19: */
+func unixNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) uintptr { /* sqlite3.c:34181:19: */
var i int32 = -1
_ = p
if zName != 0 {
for i = 0; i < ((int32(uint64(unsafe.Sizeof(aSyscall)) / uint64(unsafe.Sizeof(unix_syscall{})))) - 1); i++ {
- if crt.Xstrcmp(tls, zName, aSyscall[i].FzName) == 0 {
+ if libc.Xstrcmp(tls, zName, aSyscall[i].FzName) == 0 {
break
}
}
@@ -19443,7 +20390,7 @@ func unixNextSystemCall(tls *crt.TLS, p uintptr, zName uintptr) uintptr { /* sql
// transaction crashes and leaves behind hot journals, then any
// process that is able to write to the database will also be able to
// recover the hot journals.
-func robust_open(tls *crt.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3.c:34137:12: */
+func robust_open(tls *libc.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3.c:34222:12: */
bp := tls.Alloc(176)
defer tls.Free(176)
@@ -19455,9 +20402,9 @@ func robust_open(tls *crt.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3.
m2 = uint32(0644)
}
for 1 != 0 {
- fd = (*(*func(*crt.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(0)*24 + 8 /* &.pCurrent */))))(tls, z, f, int32(m2))
+ fd = (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(0)*24 + 8 /* &.pCurrent */))))(tls, z, f, int32(m2))
if fd < 0 {
- if (*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) == 4 {
+ if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == 4 {
continue
}
break
@@ -19465,11 +20412,11 @@ func robust_open(tls *crt.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3.
if fd >= 3 {
break
}
- (*(*func(*crt.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(1)*24 + 8 /* &.pCurrent */))))(tls, fd)
+ (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(1)*24 + 8 /* &.pCurrent */))))(tls, fd)
Xsqlite3_log(tls, 28,
- ts+2470 /* "attempt to open ..." */, crt.VaList(bp, z, fd))
+ ts+4605 /* "attempt to open ..." */, libc.VaList(bp, z, fd))
fd = -1
- if (*(*func(*crt.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(0)*24 + 8 /* &.pCurrent */))))(tls, ts+2513 /* "/dev/null" */, 00, int32(m)) < 0 {
+ if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(0)*24 + 8 /* &.pCurrent */))))(tls, ts+4648 /* "/dev/null" */, 00, int32(m)) < 0 {
break
}
}
@@ -19477,13 +20424,13 @@ func robust_open(tls *crt.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3.
if m != Mode_t(0) {
// var statbuf stat64 at bp+32, 144
- if (((*(*func(*crt.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, fd, bp+32 /* &statbuf */) == 0) &&
+ if (((*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, fd, bp+32 /* &statbuf */) == 0) &&
((*stat64)(unsafe.Pointer(bp+32 /* &statbuf */)).Fst_size == int64(0))) &&
- (((*stat64)(unsafe.Pointer(bp+32 /* &statbuf */)).Fst_mode & uint32(0777)) != m) {
- (*(*func(*crt.TLS, int32, Mode_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(14)*24 + 8 /* &.pCurrent */))))(tls, fd, m)
+ (((*stat64)(unsafe.Pointer(bp+32 /* &statbuf */)).Fst_mode & X__mode_t(0777)) != m) {
+ (*(*func(*libc.TLS, int32, Mode_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(14)*24 + 8 /* &.pCurrent */))))(tls, fd, m)
}
}
- (*(*func(*crt.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, fd, 2, crt.VaList(bp+16, ((*(*func(*crt.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, fd, 1, crt.VaList(bp+24, 0))|1)))
+ (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, fd, 2, libc.VaList(bp+16, ((*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, fd, 1, libc.VaList(bp+24, 0))|1)))
}
return fd
}
@@ -19511,12 +20458,12 @@ func robust_open(tls *crt.TLS, z uintptr, f int32, m Mode_t) int32 { /* sqlite3.
// OK: enter(unixBigLock)
// OK: enter(pLockInfo)
// ERROR: enter(pLockInfo), enter(unixBigLock)
-var unixBigLock uintptr = uintptr(0) /* sqlite3.c:34199:22 */
-func unixEnterMutex(tls *crt.TLS) { /* sqlite3.c:34200:13: */
+var unixBigLock uintptr = uintptr(0) /* sqlite3.c:34284:22 */
+func unixEnterMutex(tls *libc.TLS) { /* sqlite3.c:34285:13: */
// Not a recursive mutex
Xsqlite3_mutex_enter(tls, unixBigLock)
}
-func unixLeaveMutex(tls *crt.TLS) { /* sqlite3.c:34204:13: */
+func unixLeaveMutex(tls *libc.TLS) { /* sqlite3.c:34289:13: */
Xsqlite3_mutex_leave(tls, unixBigLock)
}
@@ -19524,20 +20471,20 @@ func unixLeaveMutex(tls *crt.TLS) { /* sqlite3.c:34204:13: */
// Helper function for printing out trace information from debugging
// binaries. This returns the string representation of the supplied
// integer lock-type.
-func azFileLock(tls *crt.TLS, eFileLock int32) uintptr { /* sqlite3.c:34221:19: */
+func azFileLock(tls *libc.TLS, eFileLock int32) uintptr { /* sqlite3.c:34306:19: */
switch eFileLock {
case 0:
- return ts + 2523 /* "NONE" */
+ return ts + 4658 /* "NONE" */
case 1:
- return ts + 2528 /* "SHARED" */
+ return ts + 4663 /* "SHARED" */
case 2:
- return ts + 2535 /* "RESERVED" */
+ return ts + 4670 /* "RESERVED" */
case 3:
- return ts + 2544 /* "PENDING" */
+ return ts + 4679 /* "PENDING" */
case 4:
- return ts + 2552 /* "EXCLUSIVE" */
+ return ts + 4687 /* "EXCLUSIVE" */
}
- return ts + 2562 /* "ERROR" */
+ return ts + 4697 /* "ERROR" */
}
// Retry ftruncate() calls that fail due to EINTR
@@ -19545,10 +20492,10 @@ func azFileLock(tls *crt.TLS, eFileLock int32) uintptr { /* sqlite3.c:34221:19:
// All calls to ftruncate() within this file should be made through
// this wrapper. On the Android platform, bypassing the logic below
// could lead to a corrupt database.
-func robust_ftruncate(tls *crt.TLS, h int32, sz Sqlite3_int64) int32 { /* sqlite3.c:34300:12: */
+func robust_ftruncate(tls *libc.TLS, h int32, sz Sqlite3_int64) int32 { /* sqlite3.c:34385:12: */
var rc int32
- for ok := true; ok; ok = ((rc < 0) && ((*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) == 4)) {
- rc = (*(*func(*crt.TLS, int32, Off_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(6)*24 + 8 /* &.pCurrent */))))(tls, h, int64(sz))
+ for ok := true; ok; ok = ((rc < 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == 4)) {
+ rc = (*(*func(*libc.TLS, int32, Off_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(6)*24 + 8 /* &.pCurrent */))))(tls, h, int64(sz))
}
return rc
}
@@ -19561,7 +20508,7 @@ func robust_ftruncate(tls *crt.TLS, h int32, sz Sqlite3_int64) int32 { /* sqlite
//
// Errors during initialization of locks, or file system support for locks,
// should handle ENOLCK, ENOTSUP, EOPNOTSUPP separately.
-func sqliteErrorFromPosixError(tls *crt.TLS, posixError int32, sqliteIOErr int32) int32 { /* sqlite3.c:34325:12: */
+func sqliteErrorFromPosixError(tls *libc.TLS, posixError int32, sqliteIOErr int32) int32 { /* sqlite3.c:34410:12: */
switch posixError {
case 13:
@@ -19716,7 +20663,7 @@ type unixFileId = struct {
// A lists of all unixInodeInfo objects.
//
// Must hold unixBigLock in order to read or write this variable.
-var inodeList uintptr = uintptr(0) /* sqlite3.c:34649:22 */ // All unixInodeInfo objects
+var inodeList uintptr = uintptr(0) /* sqlite3.c:34734:22 */ // All unixInodeInfo objects
//
// This function - unixLogErrorAtLine(), is only ever called via the macro
@@ -19732,26 +20679,25 @@ var inodeList uintptr = uintptr(0) /* sqlite3.c:34649:22 */ // All unixInodeInfo
// The two subsequent arguments should be the name of the OS function that
// failed (e.g. "unlink", "open") and the associated file-system path,
// if any.
-func unixLogErrorAtLine(tls *crt.TLS, errcode int32, zFunc uintptr, zPath uintptr, iLine int32) int32 { /* sqlite3.c:34684:12: */
+func unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uintptr, iLine int32) int32 { /* sqlite3.c:34769:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
- var zErr uintptr // Message from strerror() or equivalent
- var iErrno int32 = *(*int32)(unsafe.Pointer(crt.X__errno_location(tls))) // Saved syscall error number
+ var zErr uintptr // Message from strerror() or equivalent
+ var iErrno int32 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) // Saved syscall error number
- /* If this is not a threadsafe build (SQLITE_THREADSAFE==0), then use
- ** the strerror() function to obtain the human-readable error message
- ** equivalent to errno. Otherwise, use strerror_r().
- */
+ // If this is not a threadsafe build (SQLITE_THREADSAFE==0), then use
+ // the strerror() function to obtain the human-readable error message
+ // equivalent to errno. Otherwise, use strerror_r().
// This is a threadsafe build, but strerror_r() is not available.
- zErr = ts + 672 /* "" */
+ zErr = ts + 781 /* "" */
if zPath == uintptr(0) {
- zPath = ts + 672 /* "" */
+ zPath = ts + 781 /* "" */
}
Xsqlite3_log(tls, errcode,
- ts+2568, /* "os_unix.c:%d: (%..." */
- crt.VaList(bp, iLine, iErrno, zFunc, zPath, zErr))
+ ts+4703, /* "os_unix.c:%d: (%..." */
+ libc.VaList(bp, iLine, iErrno, zFunc, zPath, zErr))
return errcode
}
@@ -19767,9 +20713,9 @@ func unixLogErrorAtLine(tls *crt.TLS, errcode int32, zFunc uintptr, zPath uintpt
// file descriptor might have already been reused by another thread.
// So we don't even try to recover from an EINTR. Just log the error
// and move on.
-func robust_close(tls *crt.TLS, pFile uintptr, h int32, lineno int32) { /* sqlite3.c:34749:13: */
- if (*(*func(*crt.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(1)*24 + 8 /* &.pCurrent */))))(tls, h) != 0 {
- unixLogErrorAtLine(tls, (10 | (int32(16) << 8)), ts+2265, /* "close" */
+func robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { /* sqlite3.c:34834:13: */
+ if (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(1)*24 + 8 /* &.pCurrent */))))(tls, h) != 0 {
+ unixLogErrorAtLine(tls, (10 | (int32(16) << 8)), ts+4400, /* "close" */
func() uintptr {
if pFile != 0 {
return (*UnixFile)(unsafe.Pointer(pFile)).FzPath
@@ -19781,21 +20727,19 @@ func robust_close(tls *crt.TLS, pFile uintptr, h int32, lineno int32) { /* sqlit
// Set the pFile->lastErrno. Do this in a subroutine as that provides
// a convenient place to set a breakpoint.
-func storeLastErrno(tls *crt.TLS, pFile uintptr, error int32) { /* sqlite3.c:34760:13: */
+func storeLastErrno(tls *libc.TLS, pFile uintptr, error int32) { /* sqlite3.c:34845:13: */
(*UnixFile)(unsafe.Pointer(pFile)).FlastErrno = error
}
-/*
-** Close all file descriptors accumuated in the unixInodeInfo->pUnused list.
- */
-func closePendingFds(tls *crt.TLS, pFile uintptr) { /* sqlite3.c:34767:13: */
+// Close all file descriptors accumuated in the unixInodeInfo->pUnused list.
+func closePendingFds(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:34852:13: */
var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode
var p uintptr
var pNext uintptr
for p = (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpUnused; p != 0; p = pNext {
pNext = (*UnixUnusedFd)(unsafe.Pointer(p)).FpNext
- robust_close(tls, pFile, (*UnixUnusedFd)(unsafe.Pointer(p)).Ffd, 34774)
+ robust_close(tls, pFile, (*UnixUnusedFd)(unsafe.Pointer(p)).Ffd, 34859)
Xsqlite3_free(tls, p)
}
(*UnixInodeInfo)(unsafe.Pointer(pInode)).FpUnused = uintptr(0)
@@ -19805,7 +20749,7 @@ func closePendingFds(tls *crt.TLS, pFile uintptr) { /* sqlite3.c:34767:13: */
//
// The global mutex must be held when this routine is called, but the mutex
// on the inode being deleted must NOT be held.
-func releaseInodeInfo(tls *crt.TLS, pFile uintptr) { /* sqlite3.c:34786:13: */
+func releaseInodeInfo(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:34871:13: */
var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode
if pInode != 0 {
@@ -19839,7 +20783,7 @@ func releaseInodeInfo(tls *crt.TLS, pFile uintptr) { /* sqlite3.c:34786:13: */
// The global mutex must held when calling this routine.
//
// Return an appropriate error code.
-func findInodeInfo(tls *crt.TLS, pFile uintptr, ppInode uintptr) int32 { /* sqlite3.c:34823:12: */
+func findInodeInfo(tls *libc.TLS, pFile uintptr, ppInode uintptr) int32 { /* sqlite3.c:34908:12: */
bp := tls.Alloc(160)
defer tls.Free(160)
@@ -19854,18 +20798,18 @@ func findInodeInfo(tls *crt.TLS, pFile uintptr, ppInode uintptr) int32 { /* sqli
// Get low-level information about the file that we can used to
// create a unique name for the file.
fd = (*UnixFile)(unsafe.Pointer(pFile)).Fh
- rc = (*(*func(*crt.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, fd, bp /* &statbuf */)
+ rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, fd, bp /* &statbuf */)
if rc != 0 {
- storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(crt.X__errno_location(tls))))
+ storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
return 10
}
- crt.Xmemset(tls, bp+144 /* &fileId */, 0, uint64(unsafe.Sizeof(unixFileId{})))
+ libc.Xmemset(tls, bp+144 /* &fileId */, 0, uint64(unsafe.Sizeof(unixFileId{})))
(*unixFileId)(unsafe.Pointer(bp + 144 /* &fileId */)).Fdev = (*stat64)(unsafe.Pointer(bp /* &statbuf */)).Fst_dev
(*unixFileId)(unsafe.Pointer(bp + 144 /* &fileId */)).Fino = U64((*stat64)(unsafe.Pointer(bp /* &statbuf */)).Fst_ino)
pInode = inodeList
- for (pInode != 0) && (crt.Xmemcmp(tls, bp+144 /* &fileId */, (pInode /* &.fileId */), uint64(unsafe.Sizeof(unixFileId{}))) != 0) {
+ for (pInode != 0) && (libc.Xmemcmp(tls, bp+144 /* &fileId */, (pInode /* &.fileId */), uint64(unsafe.Sizeof(unixFileId{}))) != 0) {
pInode = (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpNext
}
if pInode == uintptr(0) {
@@ -19873,8 +20817,8 @@ func findInodeInfo(tls *crt.TLS, pFile uintptr, ppInode uintptr) int32 { /* sqli
if pInode == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pInode, 0, uint64(unsafe.Sizeof(UnixInodeInfo{})))
- crt.Xmemcpy(tls, (pInode /* &.fileId */), bp+144 /* &fileId */, uint64(unsafe.Sizeof(unixFileId{})))
+ libc.Xmemset(tls, pInode, 0, uint64(unsafe.Sizeof(UnixInodeInfo{})))
+ libc.Xmemcpy(tls, (pInode /* &.fileId */), bp+144 /* &fileId */, uint64(unsafe.Sizeof(unixFileId{})))
if Xsqlite3Config.FbCoreMutex != 0 {
(*UnixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex = Xsqlite3_mutex_alloc(tls, 0)
if (*UnixInodeInfo)(unsafe.Pointer(pInode)).FpLockMutex == uintptr(0) {
@@ -19898,13 +20842,13 @@ func findInodeInfo(tls *crt.TLS, pFile uintptr, ppInode uintptr) int32 { /* sqli
}
// Return TRUE if pFile has been renamed or unlinked since it was first opened.
-func fileHasMoved(tls *crt.TLS, pFile uintptr) int32 { /* sqlite3.c:34915:12: */
+func fileHasMoved(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:35000:12: */
bp := tls.Alloc(144)
defer tls.Free(144)
// var buf stat64 at bp, 144
- return (crt.Bool32(((*UnixFile)(unsafe.Pointer(pFile)).FpInode != uintptr(0)) && (((*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(4)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, bp /* &buf */) != 0) ||
+ return (libc.Bool32(((*UnixFile)(unsafe.Pointer(pFile)).FpInode != uintptr(0)) && (((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(4)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, bp /* &buf */) != 0) ||
(U64((*stat64)(unsafe.Pointer(bp /* &buf */)).Fst_ino) != (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FfileId.Fino))))
}
@@ -19915,7 +20859,7 @@ func fileHasMoved(tls *crt.TLS, pFile uintptr) int32 { /* sqlite3.c:34915:12: */
// (3) The file has not been renamed or unlinked
//
// Issue sqlite3_log(SQLITE_WARNING,...) messages if anything is not right.
-func verifyDbFile(tls *crt.TLS, pFile uintptr) { /* sqlite3.c:34936:13: */
+func verifyDbFile(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35021:13: */
bp := tls.Alloc(176)
defer tls.Free(176)
@@ -19928,21 +20872,21 @@ func verifyDbFile(tls *crt.TLS, pFile uintptr) { /* sqlite3.c:34936:13: */
return
}
- rc = (*(*func(*crt.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, bp+32 /* &buf */)
+ rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, bp+32 /* &buf */)
if rc != 0 {
- Xsqlite3_log(tls, 28, ts+2599 /* "cannot fstat db ..." */, crt.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
+ Xsqlite3_log(tls, 28, ts+4734 /* "cannot fstat db ..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
return
}
if (*stat64)(unsafe.Pointer(bp+32 /* &buf */)).Fst_nlink == uint64(0) {
- Xsqlite3_log(tls, 28, ts+2623 /* "file unlinked wh..." */, crt.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
+ Xsqlite3_log(tls, 28, ts+4758 /* "file unlinked wh..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
return
}
if (*stat64)(unsafe.Pointer(bp+32 /* &buf */)).Fst_nlink > uint64(1) {
- Xsqlite3_log(tls, 28, ts+2652 /* "multiple links t..." */, crt.VaList(bp+16, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
+ Xsqlite3_log(tls, 28, ts+4787 /* "multiple links t..." */, libc.VaList(bp+16, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
return
}
if fileHasMoved(tls, pFile) != 0 {
- Xsqlite3_log(tls, 28, ts+2679 /* "file renamed whi..." */, crt.VaList(bp+24, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
+ Xsqlite3_log(tls, 28, ts+4814 /* "file renamed whi..." */, libc.VaList(bp+24, (*UnixFile)(unsafe.Pointer(pFile)).FzPath))
return
}
}
@@ -19951,7 +20895,7 @@ func verifyDbFile(tls *crt.TLS, pFile uintptr) { /* sqlite3.c:34936:13: */
// file by this or any other process. If such a lock is held, set *pResOut
// to a non-zero value otherwise *pResOut is set to zero. The return value
// is set to SQLITE_OK unless an I/O error occurs during lock checking.
-func unixCheckReservedLock(tls *crt.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:34969:12: */
+func unixCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:35054:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -19959,7 +20903,7 @@ func unixCheckReservedLock(tls *crt.TLS, id uintptr, pResOut uintptr) int32 { /*
var reserved int32 = 0
var pFile uintptr = id
- if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (crt.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
+ if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
local_ioerr(tls)
return (10 | (int32(14) << 8))
}
@@ -19976,12 +20920,12 @@ func unixCheckReservedLock(tls *crt.TLS, id uintptr, pResOut uintptr) int32 { /*
// var lock flock at bp+32, 32
(*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_whence = int16(0)
- (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_start = (int64(Xsqlite3PendingByte + 1))
+ (*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 1))
(*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_len = int64(1)
(*flock)(unsafe.Pointer(bp + 32 /* &lock */)).Fl_type = int16(1)
- if (*(*func(*crt.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 5, crt.VaList(bp, bp+32 /* &lock */)) != 0 {
+ if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 5, libc.VaList(bp, bp+32 /* &lock */)) != 0 {
rc = (10 | (int32(14) << 8))
- storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(crt.X__errno_location(tls))))
+ storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
} else if int32((*flock)(unsafe.Pointer(bp+32 /* &lock */)).Fl_type) != 2 {
reserved = 1
}
@@ -19989,7 +20933,7 @@ func unixCheckReservedLock(tls *crt.TLS, id uintptr, pResOut uintptr) int32 { /*
Xsqlite3_mutex_leave(tls, (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FpLockMutex)
if Xsqlite3OSTrace != 0 {
- Xsqlite3DebugPrintf(tls, ts+2707 /* "TEST WR-LOCK %d ..." */, crt.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).Fh, rc, reserved))
+ Xsqlite3DebugPrintf(tls, ts+4842 /* "TEST WR-LOCK %d ..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).Fh, rc, reserved))
}
*(*int32)(unsafe.Pointer(pResOut)) = reserved
@@ -20025,7 +20969,7 @@ func unixCheckReservedLock(tls *crt.TLS, id uintptr, pResOut uintptr) int32 { /*
//
// Zero is returned if the call completes successfully, or -1 if a call
// to fcntl() fails. In this case, errno is set appropriately (by fcntl()).
-func unixFileLock(tls *crt.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite3.c:35067:12: */
+func unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite3.c:35152:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -20037,10 +20981,10 @@ func unixFileLock(tls *crt.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite3
// var lock flock at bp+16, 32
(*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_whence = int16(0)
- (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_start = (int64(Xsqlite3PendingByte + 2))
+ (*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2))
(*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_len = int64(510)
(*flock)(unsafe.Pointer(bp + 16 /* &lock */)).Fl_type = int16(1)
- rc = (*(*func(*crt.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 6, crt.VaList(bp, bp+16 /* &lock */))
+ rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 6, libc.VaList(bp, bp+16 /* &lock */))
if rc < 0 {
return rc
}
@@ -20050,7 +20994,7 @@ func unixFileLock(tls *crt.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite3
rc = 0
}
} else {
- rc = (*(*func(*crt.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 6, crt.VaList(bp+8, pLock))
+ rc = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 6, libc.VaList(bp+8, pLock))
}
return rc
}
@@ -20077,7 +21021,7 @@ func unixFileLock(tls *crt.TLS, pFile uintptr, pLock uintptr) int32 { /* sqlite3
//
// This routine will only increase a lock. Use the sqlite3OsUnlock()
// routine to lower a locking level.
-func unixLock(tls *crt.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35117:12: */
+func unixLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35202:12: */
bp := tls.Alloc(120)
defer tls.Free(120)
@@ -20132,7 +21076,7 @@ func unixLock(tls *crt.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35
if !(Xsqlite3OSTrace != 0) {
goto __1
}
- Xsqlite3DebugPrintf(tls, ts+2737 /* "LOCK %d %s wa..." */, crt.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, azFileLock(tls, eFileLock), azFileLock(tls, int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock)), azFileLock(tls, int32((*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FeFileLock)), (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FnShared, crt.Xgetpid(tls)))
+ Xsqlite3DebugPrintf(tls, ts+4872 /* "LOCK %d %s wa..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, azFileLock(tls, eFileLock), azFileLock(tls, int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock)), azFileLock(tls, int32((*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FeFileLock)), (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FnShared, libc.Xgetpid(tls)))
__1:
;
@@ -20145,7 +21089,7 @@ __1:
if !(Xsqlite3OSTrace != 0) {
goto __3
}
- Xsqlite3DebugPrintf(tls, ts+2780 /* "LOCK %d %s ok..." */, crt.VaList(bp+48, (*UnixFile)(unsafe.Pointer(pFile)).Fh, azFileLock(tls, eFileLock)))
+ Xsqlite3DebugPrintf(tls, ts+4915 /* "LOCK %d %s ok..." */, libc.VaList(bp+48, (*UnixFile)(unsafe.Pointer(pFile)).Fh, azFileLock(tls, eFileLock)))
__3:
;
return 0
@@ -20200,11 +21144,11 @@ __5:
}
return int16(1)
}()
- (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = int64(Xsqlite3PendingByte)
+ (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte)
if !(unixFileLock(tls, pFile, bp+88 /* &lock */) != 0) {
goto __7
}
- tErrno = *(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))
+ tErrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
rc = sqliteErrorFromPosixError(tls, tErrno, (10 | (int32(15) << 8)))
if !(rc != 5) {
goto __8
@@ -20225,25 +21169,25 @@ __6:
}
// Now get the read-lock
- (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = (int64(Xsqlite3PendingByte + 2))
+ (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2))
(*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = int64(510)
if !(unixFileLock(tls, pFile, bp+88 /* &lock */) != 0) {
goto __11
}
- tErrno = *(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))
+ tErrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
rc = sqliteErrorFromPosixError(tls, tErrno, (10 | (int32(15) << 8)))
__11:
;
// Drop the temporary PENDING lock
- (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = int64(Xsqlite3PendingByte)
+ (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte)
(*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = 1
(*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_type = int16(2)
if !((unixFileLock(tls, pFile, bp+88 /* &lock */) != 0) && (rc == 0)) {
goto __12
}
// This could happen with a network mount
- tErrno = *(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))
+ tErrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
rc = (10 | (int32(8) << 8))
__12:
;
@@ -20284,11 +21228,11 @@ __16:
if !(eFileLock == 2) {
goto __18
}
- (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = (int64(Xsqlite3PendingByte + 1))
+ (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 1))
(*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = 1
goto __19
__18:
- (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = (int64(Xsqlite3PendingByte + 2))
+ (*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2))
(*flock)(unsafe.Pointer(bp + 88 /* &lock */)).Fl_len = int64(510)
__19:
;
@@ -20296,7 +21240,7 @@ __19:
if !(unixFileLock(tls, pFile, bp+88 /* &lock */) != 0) {
goto __20
}
- tErrno = *(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))
+ tErrno = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
rc = sqliteErrorFromPosixError(tls, tErrno, (10 | (int32(15) << 8)))
if !(rc != 5) {
goto __21
@@ -20333,11 +21277,11 @@ end_lock:
if !(Xsqlite3OSTrace != 0) {
goto __25
}
- Xsqlite3DebugPrintf(tls, ts+2820 /* "LOCK %d %s %s..." */, crt.VaList(bp+64, (*UnixFile)(unsafe.Pointer(pFile)).Fh, azFileLock(tls, eFileLock), func() uintptr {
+ Xsqlite3DebugPrintf(tls, ts+4955 /* "LOCK %d %s %s..." */, libc.VaList(bp+64, (*UnixFile)(unsafe.Pointer(pFile)).Fh, azFileLock(tls, eFileLock), func() uintptr {
if rc == 0 {
- return ts + 2845 /* "ok" */
+ return ts + 4980 /* "ok" */
}
- return ts + 2848 /* "failed" */
+ return ts + 4983 /* "failed" */
}()))
__25:
;
@@ -20346,7 +21290,7 @@ __25:
// Add the file descriptor used by file handle pFile to the corresponding
// pUnused list.
-func setPendingFd(tls *crt.TLS, pFile uintptr) { /* sqlite3.c:35344:13: */
+func setPendingFd(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:35429:13: */
var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode
var p uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused
@@ -20367,7 +21311,7 @@ func setPendingFd(tls *crt.TLS, pFile uintptr) { /* sqlite3.c:35344:13: */
// set to a read lock, then the other part is simply unlocked. This works
// around a bug in BSD NFS lockd (also seen on MacOSX 10.3+) that fails to
// remove the write lock on a region when a read lock is set.
-func posixUnlock(tls *crt.TLS, id uintptr, eFileLock int32, handleNFSUnlock int32) int32 { /* sqlite3.c:35367:12: */
+func posixUnlock(tls *libc.TLS, id uintptr, eFileLock int32, handleNFSUnlock int32) int32 { /* sqlite3.c:35452:12: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -20382,7 +21326,7 @@ func posixUnlock(tls *crt.TLS, id uintptr, eFileLock int32, handleNFSUnlock int3
if !(Xsqlite3OSTrace != 0) {
goto __1
}
- Xsqlite3DebugPrintf(tls, ts+2855 /* "UNLOCK %d %d wa..." */, crt.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, eFileLock, int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock), int32((*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FeFileLock), (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FnShared, crt.Xgetpid(tls)))
+ Xsqlite3DebugPrintf(tls, ts+4990 /* "UNLOCK %d %d wa..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, eFileLock, int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock), int32((*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FeFileLock), (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpInode)).FnShared, libc.Xgetpid(tls)))
__1:
;
@@ -20414,19 +21358,19 @@ __2:
(*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = int16(0)
(*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = int16(0)
- (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = (int64(Xsqlite3PendingByte + 2))
+ (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = (X__off64_t(Xsqlite3PendingByte + 2))
(*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_len = int64(510)
if !(unixFileLock(tls, pFile, bp+48 /* &lock */) != 0) {
goto __5
}
- /* In theory, the call to unixFileLock() cannot fail because another
- ** process is holding an incompatible lock. If it does, this
- ** indicates that the other process is not following the locking
- ** protocol. If this happens, return SQLITE_IOERR_RDLOCK. Returning
- ** SQLITE_BUSY would confuse the upper layer (in practice it causes
- ** an assert to fail). */
+ // In theory, the call to unixFileLock() cannot fail because another
+ // process is holding an incompatible lock. If it does, this
+ // indicates that the other process is not following the locking
+ // protocol. If this happens, return SQLITE_IOERR_RDLOCK. Returning
+ // SQLITE_BUSY would confuse the upper layer (in practice it causes
+ // an assert to fail).
rc = (10 | (int32(9) << 8))
- storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(crt.X__errno_location(tls))))
+ storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
goto end_unlock
__5:
;
@@ -20434,7 +21378,7 @@ __4:
;
(*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = int16(2)
(*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = int16(0)
- (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = int64(Xsqlite3PendingByte)
+ (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = X__off64_t(Xsqlite3PendingByte)
(*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_len = 2
if !(unixFileLock(tls, pFile, bp+48 /* &lock */) == 0) {
goto __6
@@ -20443,7 +21387,7 @@ __4:
goto __7
__6:
rc = (10 | (int32(8) << 8))
- storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(crt.X__errno_location(tls))))
+ storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
goto end_unlock
__7:
;
@@ -20461,7 +21405,7 @@ __3:
}
(*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_type = int16(2)
(*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_whence = int16(0)
- (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = crt.AssignPtrInt64(bp+48 /* &lock */ +16 /* &.l_len */, 0)
+ (*flock)(unsafe.Pointer(bp + 48 /* &lock */)).Fl_start = libc.AssignPtrInt64(bp+48 /* &lock */ +16 /* &.l_len */, 0)
if !(unixFileLock(tls, pFile, bp+48 /* &lock */) == 0) {
goto __10
}
@@ -20469,7 +21413,7 @@ __3:
goto __11
__10:
rc = (10 | (int32(8) << 8))
- storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(crt.X__errno_location(tls))))
+ storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
(*UnixInodeInfo)(unsafe.Pointer(pInode)).FeFileLock = uint8(0)
(*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(0)
__11:
@@ -20507,7 +21451,7 @@ __13:
//
// If the locking level of the file descriptor is already at or below
// the requested locking level, this routine is a no-op.
-func unixUnlock(tls *crt.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35527:12: */
+func unixUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35612:12: */
return posixUnlock(tls, id, eFileLock, 0)
}
@@ -20520,27 +21464,27 @@ func unixUnlock(tls *crt.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:
// It is *not* necessary to hold the mutex when this routine is called,
// even on VxWorks. A mutex will be acquired on VxWorks by the
// vxworksReleaseFileId() routine.
-func closeUnixFile(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:35549:12: */
+func closeUnixFile(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35634:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var pFile uintptr = id
unixUnmapfile(tls, pFile)
if (*UnixFile)(unsafe.Pointer(pFile)).Fh >= 0 {
- robust_close(tls, pFile, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 35555)
+ robust_close(tls, pFile, (*UnixFile)(unsafe.Pointer(pFile)).Fh, 35640)
(*UnixFile)(unsafe.Pointer(pFile)).Fh = -1
}
if Xsqlite3OSTrace != 0 {
- Xsqlite3DebugPrintf(tls, ts+2898 /* "CLOSE %-3d\n" */, crt.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh))
+ Xsqlite3DebugPrintf(tls, ts+5033 /* "CLOSE %-3d\n" */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh))
}
Xsqlite3_open_file_count = Xsqlite3_open_file_count + (-1)
Xsqlite3_free(tls, (*UnixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused)
- crt.Xmemset(tls, pFile, 0, uint64(unsafe.Sizeof(UnixFile{})))
+ libc.Xmemset(tls, pFile, 0, uint64(unsafe.Sizeof(UnixFile{})))
return 0
}
// Close a file.
-func unixClose(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:35584:12: */
+func unixClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35669:12: */
var rc int32 = 0
var pFile uintptr = id
var pInode uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FpInode
@@ -20589,24 +21533,24 @@ func unixClose(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:35584:12: */
// database connections are accessing the same database file at the same
// time and one or more of those connections are writing.
-func nolockCheckReservedLock(tls *crt.TLS, NotUsed uintptr, pResOut uintptr) int32 { /* sqlite3.c:35635:12: */
+func nolockCheckReservedLock(tls *libc.TLS, NotUsed uintptr, pResOut uintptr) int32 { /* sqlite3.c:35720:12: */
_ = NotUsed
*(*int32)(unsafe.Pointer(pResOut)) = 0
return 0
}
-func nolockLock(tls *crt.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:35640:12: */
+func nolockLock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:35725:12: */
_ = NotUsed
_ = NotUsed2
return 0
}
-func nolockUnlock(tls *crt.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:35644:12: */
+func nolockUnlock(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32) int32 { /* sqlite3.c:35729:12: */
_ = NotUsed
_ = NotUsed2
return 0
}
// Close the file.
-func nolockClose(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:35652:12: */
+func nolockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35737:12: */
return closeUnixFile(tls, id)
}
@@ -20647,7 +21591,7 @@ func nolockClose(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:35652:12: */
// In dotfile locking, either a lock exists or it does not. So in this
// variation of CheckReservedLock(), *pResOut is set to true if any lock
// is held on the file and false if the file is unlocked.
-func dotlockCheckReservedLock(tls *crt.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:35697:12: */
+func dotlockCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32 { /* sqlite3.c:35782:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -20655,14 +21599,14 @@ func dotlockCheckReservedLock(tls *crt.TLS, id uintptr, pResOut uintptr) int32 {
var reserved int32 = 0
var pFile uintptr = id
- if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (crt.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
+ if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
local_ioerr(tls)
return (10 | (int32(14) << 8))
}
- reserved = (crt.Bool32((*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(2)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext, 0) == 0))
+ reserved = (libc.Bool32((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(2)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext, 0) == 0))
if Xsqlite3OSTrace != 0 {
- Xsqlite3DebugPrintf(tls, ts+2912 /* "TEST WR-LOCK %d ..." */, crt.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, rc, reserved))
+ Xsqlite3DebugPrintf(tls, ts+5047 /* "TEST WR-LOCK %d ..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, rc, reserved))
}
*(*int32)(unsafe.Pointer(pResOut)) = reserved
return rc
@@ -20693,7 +21637,7 @@ func dotlockCheckReservedLock(tls *crt.TLS, id uintptr, pResOut uintptr) int32 {
//
// With dotfile locking, we really only support state (4): EXCLUSIVE.
// But we track the other locking levels internally.
-func dotlockLock(tls *crt.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35738:12: */
+func dotlockLock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35823:12: */
var pFile uintptr = id
var zLockFile uintptr = (*UnixFile)(unsafe.Pointer(pFile)).FlockingContext
var rc int32 = 0
@@ -20703,15 +21647,15 @@ func dotlockLock(tls *crt.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c
if int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock) > 0 {
(*UnixFile)(unsafe.Pointer(pFile)).FeFileLock = uint8(eFileLock)
// Always update the timestamp on the old file
- crt.Xutimes(tls, zLockFile, uintptr(0))
+ libc.Xutimes(tls, zLockFile, uintptr(0))
return 0
}
// grab an exclusive lock
- rc = (*(*func(*crt.TLS, uintptr, Mode_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(18)*24 + 8 /* &.pCurrent */))))(tls, zLockFile, uint32(0777))
+ rc = (*(*func(*libc.TLS, uintptr, Mode_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(18)*24 + 8 /* &.pCurrent */))))(tls, zLockFile, uint32(0777))
if rc < 0 {
// failed to open/create the lock directory
- var tErrno int32 = *(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))
+ var tErrno int32 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
if 17 == tErrno {
rc = 5
} else {
@@ -20735,7 +21679,7 @@ func dotlockLock(tls *crt.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c
// the requested locking level, this routine is a no-op.
//
// When the locking level reaches NO_LOCK, delete the lock file.
-func dotlockUnlock(tls *crt.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35788:12: */
+func dotlockUnlock(tls *libc.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3.c:35873:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -20744,7 +21688,7 @@ func dotlockUnlock(tls *crt.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3
var rc int32
if Xsqlite3OSTrace != 0 {
- Xsqlite3DebugPrintf(tls, ts+2945 /* "UNLOCK %d %d wa..." */, crt.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, eFileLock, int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock), crt.Xgetpid(tls)))
+ Xsqlite3DebugPrintf(tls, ts+5080 /* "UNLOCK %d %d wa..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh, eFileLock, int32((*UnixFile)(unsafe.Pointer(pFile)).FeFileLock), libc.Xgetpid(tls)))
}
// no-op if possible
@@ -20761,9 +21705,9 @@ func dotlockUnlock(tls *crt.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3
// To fully unlock the database, delete the lock file
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(19)*24 + 8 /* &.pCurrent */))))(tls, zLockFile)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(19)*24 + 8 /* &.pCurrent */))))(tls, zLockFile)
if rc < 0 {
- var tErrno int32 = *(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))
+ var tErrno int32 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
if tErrno == 2 {
rc = 0
} else {
@@ -20777,7 +21721,7 @@ func dotlockUnlock(tls *crt.TLS, id uintptr, eFileLock int32) int32 { /* sqlite3
}
// Close a file. Make sure the lock has been released before closing.
-func dotlockClose(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:35831:12: */
+func dotlockClose(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:35916:12: */
var pFile uintptr = id
dotlockUnlock(tls, id, 0)
@@ -20876,7 +21820,7 @@ func dotlockClose(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:35831:12: */
//
// To avoid stomping the errno value on a failed read the lastErrno value
// is set before returning.
-func seekAndRead(tls *crt.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:36745:12: */
+func seekAndRead(tls *libc.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:36830:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -20885,27 +21829,27 @@ func seekAndRead(tls *crt.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, c
var newOffset I64
for ok := true; ok; ok = (got > 0) {
- newOffset = I64(crt.Xlseek64(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, int64(offset), 0))
- if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (crt.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
+ newOffset = I64(libc.Xlseek64(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, int64(offset), 0))
+ if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
local_ioerr(tls)
newOffset = int64(-1)
}
if newOffset < int64(0) {
- storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(crt.X__errno_location(tls))))
+ storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
return -1
}
- got = int32((*(*func(*crt.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(8)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, pBuf, uint64(cnt)))
+ got = int32((*(*func(*libc.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(8)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, pBuf, uint64(cnt)))
if got == cnt {
break
}
if got < 0 {
- if (*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) == 4 {
+ if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == 4 {
got = 1
continue
}
prior = 0
- storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(crt.X__errno_location(tls))))
+ storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
break
} else if got > 0 {
cnt = cnt - (got)
@@ -20916,7 +21860,7 @@ func seekAndRead(tls *crt.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, c
}
if Xsqlite3OSTrace != 0 {
- Xsqlite3DebugPrintf(tls, ts+2984 /* "READ %-3d %5d..." */, crt.VaList(bp, (*UnixFile)(unsafe.Pointer(id)).Fh, (got+prior), (offset-Sqlite3_int64(prior)), uint64(0)))
+ Xsqlite3DebugPrintf(tls, ts+5119 /* "READ %-3d %5d..." */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(id)).Fh, (got+prior), (offset-Sqlite3_int64(prior)), uint64(0)))
}
return (got + prior)
}
@@ -20924,22 +21868,22 @@ func seekAndRead(tls *crt.TLS, id uintptr, offset Sqlite3_int64, pBuf uintptr, c
// Read data from a file into a buffer. Return SQLITE_OK if all
// bytes were read successfully and SQLITE_IOERR if anything goes
// wrong.
-func unixRead(tls *crt.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:36794:12: */
+func unixRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:36879:12: */
var pFile uintptr = id
var got int32
- // If this is a database file (not a journal, master-journal or temp
+ // If this is a database file (not a journal, super-journal or temp
// file), the bytes in the locking range should never be read or written.
// Deal with as much of this read request as possible by transfering
// data from the memory mapping using memcpy().
if offset < (*UnixFile)(unsafe.Pointer(pFile)).FmmapSize {
if (offset + Sqlite3_int64(amt)) <= (*UnixFile)(unsafe.Pointer(pFile)).FmmapSize {
- crt.Xmemcpy(tls, pBuf, (((*UnixFile)(unsafe.Pointer(pFile)).FpMapRegion) + uintptr(offset)), uint64(amt))
+ libc.Xmemcpy(tls, pBuf, (((*UnixFile)(unsafe.Pointer(pFile)).FpMapRegion) + uintptr(offset)), uint64(amt))
return 0
} else {
var nCopy int32 = (int32((*UnixFile)(unsafe.Pointer(pFile)).FmmapSize - offset))
- crt.Xmemcpy(tls, pBuf, (((*UnixFile)(unsafe.Pointer(pFile)).FpMapRegion) + uintptr(offset)), uint64(nCopy))
+ libc.Xmemcpy(tls, pBuf, (((*UnixFile)(unsafe.Pointer(pFile)).FpMapRegion) + uintptr(offset)), uint64(nCopy))
pBuf = ((pBuf) + uintptr(nCopy))
amt = amt - (nCopy)
offset = offset + (Sqlite3_int64(nCopy))
@@ -20955,7 +21899,7 @@ func unixRead(tls *crt.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_
} else {
storeLastErrno(tls, pFile, 0) // not a system error
// Unread parts of the buffer must be zero-filled
- crt.Xmemset(tls, ((pBuf) + uintptr(got)), 0, (uint64(amt - got)))
+ libc.Xmemset(tls, ((pBuf) + uintptr(got)), 0, (uint64(amt - got)))
return (10 | (int32(2) << 8))
}
return int32(0)
@@ -20966,7 +21910,7 @@ func unixRead(tls *crt.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_
// pBuf to it. If an error occurs, return -1 and set *piErrno. Otherwise,
// return the actual number of bytes written (which may be less than
// nBuf).
-func seekAndWriteFd(tls *crt.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32, piErrno uintptr) int32 { /* sqlite3.c:36853:12: */
+func seekAndWriteFd(tls *libc.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32, piErrno uintptr) int32 { /* sqlite3.c:36938:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -20974,9 +21918,9 @@ func seekAndWriteFd(tls *crt.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32,
nBuf = nBuf & (0x1ffff)
- for ok := true; ok; ok = ((rc < 0) && ((*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) == 4)) {
- var iSeek I64 = I64(crt.Xlseek64(tls, fd, int64(iOff), 0))
- if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (crt.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
+ for ok := true; ok; ok = ((rc < 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == 4)) {
+ var iSeek I64 = I64(libc.Xlseek64(tls, fd, int64(iOff), 0))
+ if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
local_ioerr(tls)
iSeek = int64(-1)
}
@@ -20985,15 +21929,15 @@ func seekAndWriteFd(tls *crt.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32,
rc = -1
break
}
- rc = int32((*(*func(*crt.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(11)*24 + 8 /* &.pCurrent */))))(tls, fd, pBuf, uint64(nBuf)))
+ rc = int32((*(*func(*libc.TLS, int32, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(11)*24 + 8 /* &.pCurrent */))))(tls, fd, pBuf, uint64(nBuf)))
}
if Xsqlite3OSTrace != 0 {
- Xsqlite3DebugPrintf(tls, ts+3013 /* "WRITE %-3d %5d..." */, crt.VaList(bp, fd, rc, iOff, uint64(0)))
+ Xsqlite3DebugPrintf(tls, ts+5148 /* "WRITE %-3d %5d..." */, libc.VaList(bp, fd, rc, iOff, uint64(0)))
}
if rc < 0 {
- *(*int32)(unsafe.Pointer(piErrno)) = *(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))
+ *(*int32)(unsafe.Pointer(piErrno)) = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
}
return rc
}
@@ -21003,25 +21947,25 @@ func seekAndWriteFd(tls *crt.TLS, fd int32, iOff I64, pBuf uintptr, nBuf int32,
//
// To avoid stomping the errno value on a failed write the lastErrno value
// is set before returning.
-func seekAndWrite(tls *crt.TLS, id uintptr, offset I64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:36899:12: */
+func seekAndWrite(tls *libc.TLS, id uintptr, offset I64, pBuf uintptr, cnt int32) int32 { /* sqlite3.c:36984:12: */
return seekAndWriteFd(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, offset, pBuf, cnt, (id + 32 /* &.lastErrno */))
}
// Write data from a buffer into a file. Return SQLITE_OK on success
// or some other error code on failure.
-func unixWrite(tls *crt.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:36908:12: */
+func unixWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3_int64) int32 { /* sqlite3.c:36993:12: */
var pFile uintptr = id
var wrote int32 = 0
- // If this is a database file (not a journal, master-journal or temp
+ // If this is a database file (not a journal, super-journal or temp
// file), the bytes in the locking range should never be read or written.
- for ((crt.AssignInt32(&wrote, seekAndWrite(tls, pFile, offset, pBuf, amt))) < amt) && (wrote > 0) {
+ for ((libc.AssignInt32(&wrote, seekAndWrite(tls, pFile, offset, pBuf, amt))) < amt) && (wrote > 0) {
amt = amt - (wrote)
offset = offset + (Sqlite3_int64(wrote))
pBuf = ((pBuf) + uintptr(wrote))
}
- if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (crt.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
+ if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
local_ioerr(tls)
wrote = -1
amt = 1
@@ -21054,8 +21998,8 @@ func unixWrite(tls *crt.TLS, id uintptr, pBuf uintptr, amt int32, offset Sqlite3
// Count the number of fullsyncs and normal syncs. This is used to test
// that syncs and fullsyncs are occurring at the right times.
-var Xsqlite3_sync_count int32 = 0 /* sqlite3.c:36993:16 */
-var Xsqlite3_fullsync_count int32 = 0 /* sqlite3.c:36994:16 */
+var Xsqlite3_sync_count int32 = 0 /* sqlite3.c:37078:16 */
+var Xsqlite3_fullsync_count int32 = 0 /* sqlite3.c:37079:16 */
// We do not trust systems to provide a working fdatasync(). Some do.
// Others do no. To be safe, we will stick with the (slightly slower)
@@ -21088,16 +22032,12 @@ var Xsqlite3_fullsync_count int32 = 0 /* sqlite3.c:36994:16 */
// as far as SQLite is concerned, an fdatasync() is always adequate.
// So, we always use fdatasync() if it is available, regardless of
// the value of the dataOnly flag.
-func full_fsync(tls *crt.TLS, fd int32, fullSync int32, dataOnly int32) int32 { /* sqlite3.c:37043:12: */
- bp := tls.Alloc(144)
- defer tls.Free(144)
-
+func full_fsync(tls *libc.TLS, fd int32, fullSync int32, dataOnly int32) int32 { /* sqlite3.c:37128:12: */
var rc int32
// The following "ifdef/elif/else/" block has the same structure as
// the one below. It is replicated here solely to avoid cluttering
// up the real code with the UNUSED_PARAMETER() macros.
- _ = fd
_ = fullSync
_ = dataOnly
@@ -21109,16 +22049,11 @@ func full_fsync(tls *crt.TLS, fd int32, fullSync int32, dataOnly int32) int32 {
}
Xsqlite3_sync_count++
- /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a
- ** no-op. But go ahead and call fstat() to validate the file
- ** descriptor as we need a method to provoke a failure during
- ** coverate testing.
- */
- {
- // var buf stat64 at bp, 144
-
- rc = (*(*func(*crt.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, fd, bp /* &buf */)
- }
+ // If we compiled with the SQLITE_NO_SYNC flag, then syncing is a
+ // no-op. But go ahead and call fstat() to validate the file
+ // descriptor as we need a method to provoke a failure during
+ // coverate testing.
+ rc = libc.Xfsync(tls, fd)
if (0 != 0) && (rc != -1) {
rc = 0
@@ -21147,7 +22082,7 @@ func full_fsync(tls *crt.TLS, fd int32, fullSync int32, dataOnly int32) int32 {
//
// If SQLITE_OK is returned, the caller is responsible for closing
// the file descriptor *pFd using close().
-func openDirectory(tls *crt.TLS, zFilename uintptr, pFd uintptr) int32 { /* sqlite3.c:37139:12: */
+func openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) int32 { /* sqlite3.c:37224:12: */
bp := tls.Alloc(537)
defer tls.Free(537)
@@ -21155,8 +22090,8 @@ func openDirectory(tls *crt.TLS, zFilename uintptr, pFd uintptr) int32 { /* sqli
var fd int32 = -1
// var zDirname [513]int8 at bp+24, 513
- Xsqlite3_snprintf(tls, 512, bp+24 /* &zDirname[0] */, ts+696 /* "%s" */, crt.VaList(bp, zFilename))
- for ii = int32(crt.Xstrlen(tls, bp+24 /* &zDirname[0] */)); (ii > 0) && (int32(*(*int8)(unsafe.Pointer(bp + 24 /* &zDirname[0] */ + uintptr(ii)))) != '/'); ii-- {
+ Xsqlite3_snprintf(tls, 512, bp+24 /* &zDirname[0] */, ts+805 /* "%s" */, libc.VaList(bp, zFilename))
+ for ii = int32(libc.Xstrlen(tls, bp+24 /* &zDirname[0] */)); (ii > 0) && (int32(*(*int8)(unsafe.Pointer(bp + 24 /* &zDirname[0] */ + uintptr(ii)))) != '/'); ii-- {
}
if ii > 0 {
*(*int8)(unsafe.Pointer(bp + 24 /* &zDirname[0] */ + uintptr(ii))) = int8(0)
@@ -21169,14 +22104,14 @@ func openDirectory(tls *crt.TLS, zFilename uintptr, pFd uintptr) int32 { /* sqli
fd = robust_open(tls, bp+24 /* &zDirname[0] */, (00 | 0), uint32(0))
if fd >= 0 {
if Xsqlite3OSTrace != 0 {
- Xsqlite3DebugPrintf(tls, ts+3042 /* "OPENDIR %-3d %s\n" */, crt.VaList(bp+8, fd, bp+24 /* &zDirname[0] */))
+ Xsqlite3DebugPrintf(tls, ts+5177 /* "OPENDIR %-3d %s\n" */, libc.VaList(bp+8, fd, bp+24 /* &zDirname[0] */))
}
}
*(*int32)(unsafe.Pointer(pFd)) = fd
if fd >= 0 {
return 0
}
- return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 37158), ts+2377 /* "openDirectory" */, bp+24 /* &zDirname[0] */, 37158)
+ return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 37243), ts+4512 /* "openDirectory" */, bp+24 /* &zDirname[0] */, 37243)
}
// Make sure all writes to a particular file are committed to disk.
@@ -21192,7 +22127,7 @@ func openDirectory(tls *crt.TLS, zFilename uintptr, pFd uintptr) int32 { /* sqli
// SQLite to access the file will not know that the journal exists (because
// the directory entry for the journal was never created) and the transaction
// will not roll back - possibly leading to database corruption.
-func unixSync(tls *crt.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37176:12: */
+func unixSync(tls *libc.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37261:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -21200,7 +22135,7 @@ func unixSync(tls *crt.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37176:
var pFile uintptr = id
var isDataOnly int32 = (flags & 0x00010)
- var isFullsync int32 = (crt.Bool32((flags & 0x0F) == 0x00003))
+ var isFullsync int32 = (libc.Bool32((flags & 0x0F) == 0x00003))
// Check that one of SQLITE_SYNC_NORMAL or FULL was passed
@@ -21218,17 +22153,17 @@ func unixSync(tls *crt.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37176:
}
if Xsqlite3OSTrace != 0 {
- Xsqlite3DebugPrintf(tls, ts+3059 /* "SYNC %-3d\n" */, crt.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh))
+ Xsqlite3DebugPrintf(tls, ts+5194 /* "SYNC %-3d\n" */, libc.VaList(bp, (*UnixFile)(unsafe.Pointer(pFile)).Fh))
}
rc = full_fsync(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly)
- if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (crt.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
+ if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
local_ioerr(tls)
rc = 1
}
if rc != 0 {
- storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(crt.X__errno_location(tls))))
- return unixLogErrorAtLine(tls, (10 | (int32(4) << 8)), ts+3073 /* "full_fsync" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37199)
+ storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
+ return unixLogErrorAtLine(tls, (10 | (int32(4) << 8)), ts+5208 /* "full_fsync" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37284)
}
// Also fsync the directory containing the file if the DIRSYNC flag
@@ -21238,27 +22173,27 @@ func unixSync(tls *crt.TLS, id uintptr, flags int32) int32 { /* sqlite3.c:37176:
// var dirfd int32 at bp+32, 4
if Xsqlite3OSTrace != 0 {
- Xsqlite3DebugPrintf(tls, ts+3084 /* "DIRSYNC %s (have..." */, crt.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 0, isFullsync))
+ Xsqlite3DebugPrintf(tls, ts+5219 /* "DIRSYNC %s (have..." */, libc.VaList(bp+8, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 0, isFullsync))
}
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(17)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, bp+32 /* &dirfd */)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(17)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, bp+32 /* &dirfd */)
if rc == 0 {
full_fsync(tls, *(*int32)(unsafe.Pointer(bp + 32 /* dirfd */)), 0, 0)
- robust_close(tls, pFile, *(*int32)(unsafe.Pointer(bp + 32 /* dirfd */)), 37213)
+ robust_close(tls, pFile, *(*int32)(unsafe.Pointer(bp + 32 /* dirfd */)), 37298)
} else {
rc = 0
}
- *(*uint16)(unsafe.Pointer(pFile + 30 /* &.ctrlFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x08))))
+ *(*uint16)(unsafe.Pointer(pFile + 30 /* &.ctrlFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x08))))
}
return rc
}
// Truncate an open file to a specified size
-func unixTruncate(tls *crt.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:37226:12: */
+func unixTruncate(tls *libc.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:37311:12: */
var pFile uintptr = id
var rc int32
- if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (crt.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
+ if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
local_ioerr(tls)
return (10 | (int32(6) << 8))
}
@@ -21273,8 +22208,8 @@ func unixTruncate(tls *crt.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:3722
rc = robust_ftruncate(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, nByte)
if rc != 0 {
- storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(crt.X__errno_location(tls))))
- return unixLogErrorAtLine(tls, (10 | (int32(6) << 8)), ts+2296 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37244)
+ storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
+ return unixLogErrorAtLine(tls, (10 | (int32(6) << 8)), ts+4431 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37329)
} else {
// If the file was just truncated to a size smaller than the currently
@@ -21290,21 +22225,21 @@ func unixTruncate(tls *crt.TLS, id uintptr, nByte I64) int32 { /* sqlite3.c:3722
}
// Determine the current size of a file in bytes
-func unixFileSize(tls *crt.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:37276:12: */
+func unixFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:37361:12: */
bp := tls.Alloc(144)
defer tls.Free(144)
var rc int32
// var buf stat64 at bp, 144
- rc = (*(*func(*crt.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, bp /* &buf */)
- if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (crt.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
+ rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(id)).Fh, bp /* &buf */)
+ if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
local_ioerr(tls)
rc = 1
}
if rc != 0 {
- storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(crt.X__errno_location(tls))))
+ storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
return (10 | (int32(7) << 8))
}
*(*I64)(unsafe.Pointer(pSize)) = I64((*stat64)(unsafe.Pointer(bp /* &buf */)).Fst_size)
@@ -21325,7 +22260,7 @@ func unixFileSize(tls *crt.TLS, id uintptr, pSize uintptr) int32 { /* sqlite3.c:
// file-control operation. Enlarge the database to nBytes in size
// (rounded up to the next chunk-size). If the database is already
// nBytes or larger, this routine is a no-op.
-func fcntlSizeHint(tls *crt.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c:37314:12: */
+func fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c:37399:12: */
bp := tls.Alloc(144)
defer tls.Free(144)
@@ -21334,7 +22269,7 @@ func fcntlSizeHint(tls *crt.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c:
// var buf stat64 at bp, 144
// Used to hold return values of fstat()
- if (*(*func(*crt.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, bp /* &buf */) != 0 {
+ if (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, bp /* &buf */) != 0 {
return (10 | (int32(7) << 8))
}
@@ -21351,13 +22286,13 @@ func fcntlSizeHint(tls *crt.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c:
var nWrite int32 = 0 // Number of bytes written by seekAndWrite
var iWrite I64 // Next offset to write to
- iWrite = (I64(((((*stat64)(unsafe.Pointer(bp /* &buf */)).Fst_size / int64(nBlk)) * int64(nBlk)) + int64(nBlk)) - int64(1)))
+ iWrite = (I64(((((*stat64)(unsafe.Pointer(bp /* &buf */)).Fst_size / X__off_t(nBlk)) * X__off_t(nBlk)) + X__off_t(nBlk)) - int64(1)))
for ; iWrite < ((nSize + I64(nBlk)) - int64(1)); iWrite = iWrite + (I64(nBlk)) {
if iWrite >= nSize {
iWrite = (nSize - int64(1))
}
- nWrite = seekAndWrite(tls, pFile, iWrite, ts+672 /* "" */, 1)
+ nWrite = seekAndWrite(tls, pFile, iWrite, ts+781 /* "" */, 1)
if nWrite != 1 {
return (10 | (int32(3) << 8))
}
@@ -21369,8 +22304,8 @@ func fcntlSizeHint(tls *crt.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c:
var rc int32
if (*UnixFile)(unsafe.Pointer(pFile)).FszChunk <= 0 {
if robust_ftruncate(tls, (*UnixFile)(unsafe.Pointer(pFile)).Fh, nByte) != 0 {
- storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(crt.X__errno_location(tls))))
- return unixLogErrorAtLine(tls, (10 | (int32(6) << 8)), ts+2296 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37365)
+ storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))))
+ return unixLogErrorAtLine(tls, (10 | (int32(6) << 8)), ts+4431 /* "ftruncate" */, (*UnixFile)(unsafe.Pointer(pFile)).FzPath, 37450)
}
}
@@ -21385,9 +22320,9 @@ func fcntlSizeHint(tls *crt.TLS, pFile uintptr, nByte I64) int32 { /* sqlite3.c:
// 1 or 0 depending on whether or not bit mask of pFile->ctrlFlags is set.
//
// If *pArg is 0 or 1, then clear or set the mask bit of pFile->ctrlFlags.
-func unixModeBit(tls *crt.TLS, pFile uintptr, mask uint8, pArg uintptr) { /* sqlite3.c:37383:13: */
+func unixModeBit(tls *libc.TLS, pFile uintptr, mask uint8, pArg uintptr) { /* sqlite3.c:37468:13: */
if *(*int32)(unsafe.Pointer(pArg)) < 0 {
- *(*int32)(unsafe.Pointer(pArg)) = (crt.Bool32((int32((*UnixFile)(unsafe.Pointer(pFile)).FctrlFlags) & int32(mask)) != 0))
+ *(*int32)(unsafe.Pointer(pArg)) = (libc.Bool32((int32((*UnixFile)(unsafe.Pointer(pFile)).FctrlFlags) & int32(mask)) != 0))
} else if (*(*int32)(unsafe.Pointer(pArg))) == 0 {
*(*uint16)(unsafe.Pointer(pFile + 30 /* &.ctrlFlags */)) &= uint16((^int32(mask)))
} else {
@@ -21396,7 +22331,7 @@ func unixModeBit(tls *crt.TLS, pFile uintptr, mask uint8, pArg uintptr) { /* sql
}
// Information and control of an open file handle.
-func unixFileControl(tls *crt.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:37399:12: */
+func unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:37484:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -21438,7 +22373,7 @@ func unixFileControl(tls *crt.TLS, id uintptr, op int32, pArg uintptr) int32 { /
}
case 12:
{
- *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+696 /* "%s" */, crt.VaList(bp, (*Sqlite3_vfs)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpVfs)).FzName))
+ *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp, (*Sqlite3_vfs)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFile)).FpVfs)).FzName))
return 0
}
case 16:
@@ -21491,7 +22426,7 @@ func unixFileControl(tls *crt.TLS, id uintptr, op int32, pArg uintptr) int32 { /
//
// There are two versions of this function. One for QNX and one for all
// other systems.
-func setDeviceCharacteristics(tls *crt.TLS, pFd uintptr) { /* sqlite3.c:37525:13: */
+func setDeviceCharacteristics(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37610:13: */
if (*UnixFile)(unsafe.Pointer(pFd)).FsectorSize == 0 {
@@ -21512,7 +22447,7 @@ func setDeviceCharacteristics(tls *crt.TLS, pFd uintptr) { /* sqlite3.c:37525:13
// if two files are created in the same file-system directory (i.e.
// a database and its journal file) that the sector size will be the
// same for both.
-func unixSectorSize(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:37632:12: */
+func unixSectorSize(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:37717:12: */
var pFd uintptr = id
setDeviceCharacteristics(tls, pFd)
return (*UnixFile)(unsafe.Pointer(pFd)).FsectorSize
@@ -21529,7 +22464,7 @@ func unixSectorSize(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:37632:12: */
// of required I/O for journaling, since a lot of padding is eliminated.
// Hence, while POWERSAFE_OVERWRITE is on by default, there is a file-control
// available to turn it off and URI query parameter available to turn it off.
-func unixDeviceCharacteristics(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:37651:12: */
+func unixDeviceCharacteristics(tls *libc.TLS, id uintptr) int32 { /* sqlite3.c:37736:12: */
var pFd uintptr = id
setDeviceCharacteristics(tls, pFd)
return (*UnixFile)(unsafe.Pointer(pFd)).FdeviceCharacteristics
@@ -21539,8 +22474,8 @@ func unixDeviceCharacteristics(tls *crt.TLS, id uintptr) int32 { /* sqlite3.c:37
//
// This function should not be called directly by other code in this file.
// Instead, it should be called via macro osGetpagesize().
-func unixGetpagesize(tls *crt.TLS) int32 { /* sqlite3.c:37665:12: */
- return int32(crt.Xsysconf(tls, X_SC_PAGESIZE))
+func unixGetpagesize(tls *libc.TLS) int32 { /* sqlite3.c:37750:12: */
+ return int32(libc.Xsysconf(tls, X_SC_PAGESIZE))
}
// Constants used for locking
@@ -21549,7 +22484,7 @@ func unixGetpagesize(tls *crt.TLS) int32 { /* sqlite3.c:37665:12: */
//
// Locks block if the mask is exactly UNIX_SHM_C and are non-blocking
// otherwise.
-func unixShmSystemLock(tls *crt.TLS, pFile uintptr, lockType int32, ofst int32, n int32) int32 { /* sqlite3.c:37761:12: */
+func unixShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, n int32) int32 { /* sqlite3.c:37846:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -21570,9 +22505,9 @@ func unixShmSystemLock(tls *crt.TLS, pFile uintptr, lockType int32, ofst int32,
// Initialize the locking parameters
(*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_type = int16(lockType)
(*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_whence = int16(0)
- (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_start = int64(ofst)
- (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_len = int64(n)
- res = (*(*func(*crt.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, 6, crt.VaList(bp, bp+8 /* &f */))
+ (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_start = X__off64_t(ofst)
+ (*flock)(unsafe.Pointer(bp + 8 /* &f */)).Fl_len = X__off64_t(n)
+ res = (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, 6, libc.VaList(bp, bp+8 /* &f */))
if res == -1 {
rc = 5
}
@@ -21590,9 +22525,9 @@ func unixShmSystemLock(tls *crt.TLS, pFile uintptr, lockType int32, ofst int32,
// Usually, this is 1. The exception seems to be systems that are configured
// to use 64KB pages - in this case each mapping must cover at least two
// shm regions.
-func unixShmRegionPerMap(tls *crt.TLS) int32 { /* sqlite3.c:37846:12: */
- var shmsz int32 = (32 * 1024) // SHM region size
- var pgsz int32 = (*(*func(*crt.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(25)*24 + 8 /* &.pCurrent */))))(tls) // System page size
+func unixShmRegionPerMap(tls *libc.TLS) int32 { /* sqlite3.c:37931:12: */
+ var shmsz int32 = (32 * 1024) // SHM region size
+ var pgsz int32 = (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(25)*24 + 8 /* &.pCurrent */))))(tls) // System page size
// Page size must be a power of 2
if pgsz < shmsz {
return 1
@@ -21604,7 +22539,7 @@ func unixShmRegionPerMap(tls *crt.TLS) int32 { /* sqlite3.c:37846:12: */
//
// This is not a VFS shared-memory method; it is a utility function called
// by VFS shared-memory methods.
-func unixShmPurge(tls *crt.TLS, pFd uintptr) { /* sqlite3.c:37860:13: */
+func unixShmPurge(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:37945:13: */
var p uintptr = (*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pFd)).FpInode)).FpShmNode
if (p != 0) && ((*UnixShmNode)(unsafe.Pointer(p)).FnRef == 0) {
@@ -21614,14 +22549,14 @@ func unixShmPurge(tls *crt.TLS, pFd uintptr) { /* sqlite3.c:37860:13: */
Xsqlite3_mutex_free(tls, (*UnixShmNode)(unsafe.Pointer(p)).FpShmMutex)
for i = 0; i < int32((*UnixShmNode)(unsafe.Pointer(p)).FnRegion); i = i + (nShmPerMap) {
if (*UnixShmNode)(unsafe.Pointer(p)).FhShm >= 0 {
- (*(*func(*crt.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(23)*24 + 8 /* &.pCurrent */))))(tls, *(*uintptr)(unsafe.Pointer((*UnixShmNode)(unsafe.Pointer(p)).FapRegion + uintptr(i)*8)), uint64((*UnixShmNode)(unsafe.Pointer(p)).FszRegion))
+ (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(23)*24 + 8 /* &.pCurrent */))))(tls, *(*uintptr)(unsafe.Pointer((*UnixShmNode)(unsafe.Pointer(p)).FapRegion + uintptr(i)*8)), uint64((*UnixShmNode)(unsafe.Pointer(p)).FszRegion))
} else {
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*UnixShmNode)(unsafe.Pointer(p)).FapRegion + uintptr(i)*8)))
}
}
Xsqlite3_free(tls, (*UnixShmNode)(unsafe.Pointer(p)).FapRegion)
if (*UnixShmNode)(unsafe.Pointer(p)).FhShm >= 0 {
- robust_close(tls, pFd, (*UnixShmNode)(unsafe.Pointer(p)).FhShm, 37877)
+ robust_close(tls, pFd, (*UnixShmNode)(unsafe.Pointer(p)).FhShm, 37962)
(*UnixShmNode)(unsafe.Pointer(p)).FhShm = -1
}
(*UnixInodeInfo)(unsafe.Pointer((*UnixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0)
@@ -21636,7 +22571,7 @@ func unixShmPurge(tls *crt.TLS, pFd uintptr) { /* sqlite3.c:37860:13: */
// If the DMS cannot be locked because this is a readonly_shm=1
// connection and no other process already holds a lock, return
// SQLITE_READONLY_CANTINIT and set pShmNode->isUnlocked=1.
-func unixLockSharedMemory(tls *crt.TLS, pDbFd uintptr, pShmNode uintptr) int32 { /* sqlite3.c:37894:12: */
+func unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) int32 { /* sqlite3.c:37979:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -21666,7 +22601,7 @@ func unixLockSharedMemory(tls *crt.TLS, pDbFd uintptr, pShmNode uintptr) int32 {
(*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_start = (int64(((22 + 8) * 4) + 8))
(*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_len = int64(1)
(*flock)(unsafe.Pointer(bp + 8 /* &lock */)).Fl_type = int16(1)
- if (*(*func(*crt.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, 5, crt.VaList(bp, bp+8 /* &lock */)) != 0 {
+ if (*(*func(*libc.TLS, int32, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(7)*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, 5, libc.VaList(bp, bp+8 /* &lock */)) != 0 {
rc = (10 | (int32(15) << 8))
} else if int32((*flock)(unsafe.Pointer(bp+8 /* &lock */)).Fl_type) == 2 {
if (*UnixShmNode)(unsafe.Pointer(pShmNode)).FisReadonly != 0 {
@@ -21680,7 +22615,7 @@ func unixLockSharedMemory(tls *crt.TLS, pDbFd uintptr, pShmNode uintptr) int32 {
// help detect if a -shm file truncation is legitimate or is the work
// or a rogue process.
if (rc == 0) && (robust_ftruncate(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0) {
- rc = unixLogErrorAtLine(tls, (10 | (int32(18) << 8)), ts+2296 /* "ftruncate" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 37934)
+ rc = unixLogErrorAtLine(tls, (10 | (int32(18) << 8)), ts+4431 /* "ftruncate" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38019)
}
}
} else if int32((*flock)(unsafe.Pointer(bp+8 /* &lock */)).Fl_type) == 1 {
@@ -21727,7 +22662,7 @@ func unixLockSharedMemory(tls *crt.TLS, pDbFd uintptr, pShmNode uintptr) int32 {
// that no other processes are able to read or write the database. In
// that case, we do not really need shared memory. No shared memory
// file is created. The shared memory will be simulated with heap memory.
-func unixOpenSharedMemory(tls *crt.TLS, pDbFd uintptr) int32 { /* sqlite3.c:37983:12: */
+func unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) int32 { /* sqlite3.c:38068:12: */
bp := tls.Alloc(152)
defer tls.Free(152)
@@ -21751,7 +22686,7 @@ func unixOpenSharedMemory(tls *crt.TLS, pDbFd uintptr) int32 { /* sqlite3.c:3798
return 7
__1:
;
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(unixShm{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(unixShm{})))
// Check to see if a unixShmNode object already exists. Reuse an existing
// one if present. Create a new one if necessary.
@@ -21767,7 +22702,7 @@ __1:
// Call fstat() to figure out the permissions on the database file. If
// a new *-shm file is created, an attempt will be made to create it
// with the same permissions.
- if !((*(*func(*crt.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pDbFd)).Fh, bp+8 /* &sStat */) != 0) {
+ if !((*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pDbFd)).Fh, bp+8 /* &sStat */) != 0) {
goto __3
}
rc = (10 | (int32(7) << 8))
@@ -21775,7 +22710,7 @@ __1:
__3:
;
- nShmFilename = (6 + int32(crt.Xstrlen(tls, zBasePath)))
+ nShmFilename = (6 + int32(libc.Xstrlen(tls, zBasePath)))
pShmNode = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(unixShmNode{})) + uint64(nShmFilename))))
if !(pShmNode == uintptr(0)) {
goto __4
@@ -21784,9 +22719,9 @@ __3:
goto shm_open_err
__4:
;
- crt.Xmemset(tls, pShmNode, 0, (uint64(unsafe.Sizeof(unixShmNode{})) + uint64(nShmFilename)))
- zShm = crt.AssignPtrUintptr(pShmNode+16 /* &.zFilename */, (pShmNode + uintptr(1)*64))
- Xsqlite3_snprintf(tls, nShmFilename, zShm, ts+3128 /* "%s-shm" */, crt.VaList(bp, zBasePath))
+ libc.Xmemset(tls, pShmNode, 0, (uint64(unsafe.Sizeof(unixShmNode{})) + uint64(nShmFilename)))
+ zShm = libc.AssignPtrUintptr(pShmNode+16 /* &.zFilename */, (pShmNode + uintptr(1)*64))
+ Xsqlite3_snprintf(tls, nShmFilename, zShm, ts+5263 /* "%s-shm" */, libc.VaList(bp, zBasePath))
(*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm = -1
(*UnixInodeInfo)(unsafe.Pointer((*UnixFile)(unsafe.Pointer(pDbFd)).FpInode)).FpShmNode = pShmNode
@@ -21808,22 +22743,22 @@ __5:
if !(int32((*UnixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0) {
goto __7
}
- if !(0 == Xsqlite3_uri_boolean(tls, (*UnixFile)(unsafe.Pointer(pDbFd)).FzPath, ts+3135 /* "readonly_shm" */, 0)) {
+ if !(0 == Xsqlite3_uri_boolean(tls, (*UnixFile)(unsafe.Pointer(pDbFd)).FzPath, ts+5270 /* "readonly_shm" */, 0)) {
goto __8
}
(*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm = robust_open(tls, zShm, ((02 | 0100) | 0),
- ((*stat64)(unsafe.Pointer(bp+8 /* &sStat */)).Fst_mode & uint32(0777)))
+ ((*stat64)(unsafe.Pointer(bp+8 /* &sStat */)).Fst_mode & X__mode_t(0777)))
__8:
;
if !((*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm < 0) {
goto __9
}
(*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm = robust_open(tls, zShm, (00 | 0),
- ((*stat64)(unsafe.Pointer(bp+8 /* &sStat */)).Fst_mode & uint32(0777)))
+ ((*stat64)(unsafe.Pointer(bp+8 /* &sStat */)).Fst_mode & X__mode_t(0777)))
if !((*unixShmNode)(unsafe.Pointer(pShmNode)).FhShm < 0) {
goto __10
}
- rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 38059), ts+2260 /* "open" */, zShm, 38059)
+ rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 38144), ts+4395 /* "open" */, zShm, 38144)
goto shm_open_err
__10:
;
@@ -21891,7 +22826,7 @@ shm_open_err:
// this call as described above, then it is mapped into this processes
// address space (if it is not already), *pp is set to point to the mapped
// memory and SQLITE_OK returned.
-func unixShmMap(tls *crt.TLS, fd uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:38125:12: */
+func unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExtend int32, pp uintptr) int32 { /* sqlite3.c:38210:12: */
bp := tls.Alloc(148)
defer tls.Free(148)
@@ -21962,7 +22897,7 @@ __3:
// The requested region is not mapped into this processes address space.
// Check to see if it has been allocated (i.e. if the wal-index file is
// large enough to contain the requested region).
- if !((*(*func(*crt.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, bp /* &sStat */) != 0) {
+ if !((*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, bp /* &sStat */) != 0) {
goto __7
}
rc = (10 | (int32(19) << 8))
@@ -21970,7 +22905,7 @@ __3:
__7:
;
- if !((*stat64)(unsafe.Pointer(bp /* &sStat */)).Fst_size < int64(nByte)) {
+ if !((*stat64)(unsafe.Pointer(bp /* &sStat */)).Fst_size < X__off_t(nByte)) {
goto __8
}
// The requested memory region does not exist. If bExtend is set to
@@ -21984,17 +22919,17 @@ __9:
// Write to the last byte of each newly allocated or extended page
;
- iPg = (int32((*stat64)(unsafe.Pointer(bp /* &sStat */)).Fst_size / int64(pgsz)))
+ iPg = (int32((*stat64)(unsafe.Pointer(bp /* &sStat */)).Fst_size / X__off_t(pgsz)))
__11:
if !(iPg < (nByte / pgsz)) {
goto __13
}
*(*int32)(unsafe.Pointer(bp + 144 /* x */)) = 0
- if !(seekAndWriteFd(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, (int64(((iPg*pgsz)+pgsz)-1)), ts+672 /* "" */, 1, bp+144 /* &x */) != 1) {
+ if !(seekAndWriteFd(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, (int64(((iPg*pgsz)+pgsz)-1)), ts+781 /* "" */, 1, bp+144 /* &x */) != 1) {
goto __14
}
zFile = (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename
- rc = unixLogErrorAtLine(tls, (10 | (int32(19) << 8)), ts+2331 /* "write" */, zFile, 38203)
+ rc = unixLogErrorAtLine(tls, (10 | (int32(19) << 8)), ts+4466 /* "write" */, zFile, 38288)
goto shmpage_out
__14:
;
@@ -22031,7 +22966,7 @@ __16:
if !((*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm >= 0) {
goto __18
}
- pMem = (*(*func(*crt.TLS, uintptr, Size_t, int32, int32, int32, Off_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(22)*24 + 8 /* &.pCurrent */))))(tls, uintptr(0), uint64(nMap),
+ pMem = (*(*func(*libc.TLS, uintptr, Size_t, int32, int32, int32, Off_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(22)*24 + 8 /* &.pCurrent */))))(tls, uintptr(0), uint64(nMap),
func() int32 {
if (*UnixShmNode)(unsafe.Pointer(pShmNode)).FisReadonly != 0 {
return 0x1
@@ -22039,10 +22974,10 @@ __16:
return (0x1 | 0x2)
}(),
0x01, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm, (int64(I64(szRegion) * I64((*UnixShmNode)(unsafe.Pointer(pShmNode)).FnRegion))))
- if !(pMem == (crt.UintptrFromInt32(-1))) {
+ if !(pMem == (libc.UintptrFromInt32(-1))) {
goto __20
}
- rc = unixLogErrorAtLine(tls, (10 | (int32(21) << 8)), ts+2418 /* "mmap" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38230)
+ rc = unixLogErrorAtLine(tls, (10 | (int32(21) << 8)), ts+4553 /* "mmap" */, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, 38315)
goto shmpage_out
__20:
;
@@ -22056,7 +22991,7 @@ __18:
goto shmpage_out
__21:
;
- crt.Xmemset(tls, pMem, 0, uint64(nMap))
+ libc.Xmemset(tls, pMem, 0, uint64(nMap))
__19:
;
@@ -22100,7 +23035,7 @@ __27:
return rc
}
-var pgsz int32 = 4096 /* sqlite3.c:38194:28 */
+var pgsz int32 = 4096 /* sqlite3.c:38279:28 */
// Change the lock state for a shared-memory segment.
//
@@ -22108,7 +23043,7 @@ var pgsz int32 = 4096 /* sqlite3.c:38194:28 */
// different here than in posix. In xShmLock(), one can go from unlocked
// to shared and back or from unlocked to exclusive and back. But one may
// not go from shared to exclusive or from exclusive to shared.
-func unixShmLock(tls *crt.TLS, fd uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:38268:12: */
+func unixShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:38353:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -22129,6 +23064,8 @@ func unixShmLock(tls *crt.TLS, fd uintptr, ofst int32, n int32, flags int32) int
// In other words, if this is a blocking lock, none of the locks that
// occur later in the above list than the lock being obtained may be
// held.
+ //
+ // It is not permitted to block on the RECOVER lock.
mask = (U16((int32(1) << (ofst + n)) - (int32(1) << ofst)))
@@ -22206,7 +23143,7 @@ func unixShmLock(tls *crt.TLS, fd uintptr, ofst int32, n int32, flags int32) int
}
Xsqlite3_mutex_leave(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex)
if Xsqlite3OSTrace != 0 {
- Xsqlite3DebugPrintf(tls, ts+3148 /* "SHM-LOCK shmid-%..." */, crt.VaList(bp, int32((*UnixShm)(unsafe.Pointer(p)).Fid), crt.Xgetpid(tls), int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask), int32((*UnixShm)(unsafe.Pointer(p)).FexclMask)))
+ Xsqlite3DebugPrintf(tls, ts+5283 /* "SHM-LOCK shmid-%..." */, libc.VaList(bp, int32((*UnixShm)(unsafe.Pointer(p)).Fid), libc.Xgetpid(tls), int32((*UnixShm)(unsafe.Pointer(p)).FsharedMask), int32((*UnixShm)(unsafe.Pointer(p)).FexclMask)))
}
return rc
}
@@ -22215,7 +23152,7 @@ func unixShmLock(tls *crt.TLS, fd uintptr, ofst int32, n int32, flags int32) int
//
// All loads and stores begun before the barrier must complete before
// any load or store begun after the barrier.
-func unixShmBarrier(tls *crt.TLS, fd uintptr) { /* sqlite3.c:38399:13: */
+func unixShmBarrier(tls *libc.TLS, fd uintptr) { /* sqlite3.c:38487:13: */
_ = fd
// compiler-defined memory barrier
@@ -22228,7 +23165,7 @@ func unixShmBarrier(tls *crt.TLS, fd uintptr) { /* sqlite3.c:38399:13: */
//
// If there is no shared memory associated with the connection then this
// routine is a harmless no-op.
-func unixShmUnmap(tls *crt.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite3.c:38418:12: */
+func unixShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite3.c:38506:12: */
var p uintptr // The connection to be closed
var pShmNode uintptr // The underlying shared-memory file
var pp uintptr // For looping over sibling connections
@@ -22261,7 +23198,7 @@ func unixShmUnmap(tls *crt.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite3
(*UnixShmNode)(unsafe.Pointer(pShmNode)).FnRef--
if (*UnixShmNode)(unsafe.Pointer(pShmNode)).FnRef == 0 {
if (deleteFlag != 0) && ((*UnixShmNode)(unsafe.Pointer(pShmNode)).FhShm >= 0) {
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(16)*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(16)*24 + 8 /* &.pCurrent */))))(tls, (*UnixShmNode)(unsafe.Pointer(pShmNode)).FzFilename)
}
unixShmPurge(tls, pDbFd)
}
@@ -22271,10 +23208,10 @@ func unixShmUnmap(tls *crt.TLS, fd uintptr, deleteFlag int32) int32 { /* sqlite3
}
// If it is currently memory mapped, unmap file pFd.
-func unixUnmapfile(tls *crt.TLS, pFd uintptr) { /* sqlite3.c:38475:13: */
+func unixUnmapfile(tls *libc.TLS, pFd uintptr) { /* sqlite3.c:38563:13: */
if (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion != 0 {
- (*(*func(*crt.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(23)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion, uint64((*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeActual))
+ (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(23)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion, uint64((*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeActual))
(*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion = uintptr(0)
(*UnixFile)(unsafe.Pointer(pFd)).FmmapSize = int64(0)
(*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeActual = int64(0)
@@ -22294,8 +23231,8 @@ func unixUnmapfile(tls *crt.TLS, pFd uintptr) { /* sqlite3.c:38475:13: */
// the three variables above are zeroed. In this case SQLite should
// continue accessing the database using the xRead() and xWrite()
// methods.
-func unixRemapfile(tls *crt.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38500:13: */
- var zErr uintptr = ts + 2418 /* "mmap" */
+func unixRemapfile(tls *libc.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38588:13: */
+ var zErr uintptr = ts + 4553 /* "mmap" */
var h int32 = (*UnixFile)(unsafe.Pointer(pFd)).Fh // File descriptor open on db file
var pOrig uintptr = (*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion // Pointer to current file mapping
var nOrig I64 = (*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeActual // Size of pOrig region in bytes
@@ -22303,19 +23240,19 @@ func unixRemapfile(tls *crt.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38500:13:
var flags int32 = 0x1 // Flags to pass to mmap()
if pOrig != 0 {
- var szSyspage int32 = (*(*func(*crt.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(25)*24 + 8 /* &.pCurrent */))))(tls)
+ var szSyspage int32 = (*(*func(*libc.TLS) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(25)*24 + 8 /* &.pCurrent */))))(tls)
var nReuse I64 = ((*UnixFile)(unsafe.Pointer(pFd)).FmmapSize & Sqlite3_int64(^(szSyspage - 1)))
var pReq uintptr = (pOrig + uintptr(nReuse))
// Unmap any pages of the existing mapping that cannot be reused.
if nReuse != nOrig {
- (*(*func(*crt.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(23)*24 + 8 /* &.pCurrent */))))(tls, pReq, (uint64(nOrig - nReuse)))
+ (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(23)*24 + 8 /* &.pCurrent */))))(tls, pReq, (uint64(nOrig - nReuse)))
}
- pNew = (*(*func(*crt.TLS, uintptr, Size_t, int32, int32, int32, Off_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(22)*24 + 8 /* &.pCurrent */))))(tls, pReq, (uint64(nNew - nReuse)), flags, 0x01, h, int64(nReuse))
- if pNew != (crt.UintptrFromInt32(-1)) {
+ pNew = (*(*func(*libc.TLS, uintptr, Size_t, int32, int32, int32, Off_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(22)*24 + 8 /* &.pCurrent */))))(tls, pReq, (uint64(nNew - nReuse)), flags, 0x01, h, int64(nReuse))
+ if pNew != (libc.UintptrFromInt32(-1)) {
if pNew != pReq {
- (*(*func(*crt.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(23)*24 + 8 /* &.pCurrent */))))(tls, pNew, (uint64(nNew - nReuse)))
+ (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(23)*24 + 8 /* &.pCurrent */))))(tls, pNew, (uint64(nNew - nReuse)))
pNew = uintptr(0)
} else {
pNew = pOrig
@@ -22323,20 +23260,20 @@ func unixRemapfile(tls *crt.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38500:13:
}
// The attempt to extend the existing mapping failed. Free it.
- if (pNew == (crt.UintptrFromInt32(-1))) || (pNew == uintptr(0)) {
- (*(*func(*crt.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(23)*24 + 8 /* &.pCurrent */))))(tls, pOrig, uint64(nReuse))
+ if (pNew == (libc.UintptrFromInt32(-1))) || (pNew == uintptr(0)) {
+ (*(*func(*libc.TLS, uintptr, Size_t) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(23)*24 + 8 /* &.pCurrent */))))(tls, pOrig, uint64(nReuse))
}
}
// If pNew is still NULL, try to create an entirely new mapping.
if pNew == uintptr(0) {
- pNew = (*(*func(*crt.TLS, uintptr, Size_t, int32, int32, int32, Off_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(22)*24 + 8 /* &.pCurrent */))))(tls, uintptr(0), uint64(nNew), flags, 0x01, h, int64(0))
+ pNew = (*(*func(*libc.TLS, uintptr, Size_t, int32, int32, int32, Off_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(22)*24 + 8 /* &.pCurrent */))))(tls, uintptr(0), uint64(nNew), flags, 0x01, h, int64(0))
}
- if pNew == (crt.UintptrFromInt32(-1)) {
+ if pNew == (libc.UintptrFromInt32(-1)) {
pNew = uintptr(0)
nNew = int64(0)
- unixLogErrorAtLine(tls, 0, zErr, (*UnixFile)(unsafe.Pointer(pFd)).FzPath, 38565)
+ unixLogErrorAtLine(tls, 0, zErr, (*UnixFile)(unsafe.Pointer(pFd)).FzPath, 38653)
// If the mmap() above failed, assume that all subsequent mmap() calls
// will probably fail too. Fall back to using xRead/xWrite exclusively
@@ -22344,7 +23281,7 @@ func unixRemapfile(tls *crt.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38500:13:
(*UnixFile)(unsafe.Pointer(pFd)).FmmapSizeMax = int64(0)
}
(*UnixFile)(unsafe.Pointer(pFd)).FpMapRegion = pNew
- (*UnixFile)(unsafe.Pointer(pFd)).FmmapSize = crt.AssignPtrInt64(pFd+88 /* &.mmapSizeActual */, nNew)
+ (*UnixFile)(unsafe.Pointer(pFd)).FmmapSize = libc.AssignPtrInt64(pFd+88 /* &.mmapSizeActual */, nNew)
}
// Memory map or remap the file opened by file-descriptor pFd (if the file
@@ -22361,7 +23298,7 @@ func unixRemapfile(tls *crt.TLS, pFd uintptr, nNew I64) { /* sqlite3.c:38500:13:
// SQLITE_OK is returned if no error occurs (even if the mapping is not
// recreated as a result of outstanding references) or an SQLite error
// code otherwise.
-func unixMapfile(tls *crt.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:38592:12: */
+func unixMapfile(tls *libc.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:38680:12: */
bp := tls.Alloc(144)
defer tls.Free(144)
@@ -22372,7 +23309,7 @@ func unixMapfile(tls *crt.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:38592
if nMap < int64(0) {
// var statbuf stat64 at bp, 144
// Low-level file information
- if (*(*func(*crt.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFd)).Fh, bp /* &statbuf */) != 0 {
+ if (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(5)*24 + 8 /* &.pCurrent */))))(tls, (*UnixFile)(unsafe.Pointer(pFd)).Fh, bp /* &statbuf */) != 0 {
return (10 | (int32(7) << 8))
}
nMap = I64((*stat64)(unsafe.Pointer(bp /* &statbuf */)).Fst_size)
@@ -22398,7 +23335,7 @@ func unixMapfile(tls *crt.TLS, pFd uintptr, nMap I64) int32 { /* sqlite3.c:38592
//
// If this function does return a pointer, the caller must eventually
// release the reference by calling unixUnfetch().
-func unixFetch(tls *crt.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int32 { /* sqlite3.c:38629:12: */
+func unixFetch(tls *libc.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int32 { /* sqlite3.c:38717:12: */
var pFd uintptr = fd // The underlying database file
*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
@@ -22425,7 +23362,7 @@ func unixFetch(tls *crt.TLS, fd uintptr, iOff I64, nAmt int32, pp uintptr) int32
// Or, if the third argument is NULL, then this function is being called
// to inform the VFS layer that, according to POSIX, any existing mapping
// may now be invalid and should be unmapped.
-func unixUnfetch(tls *crt.TLS, fd uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:38660:12: */
+func unixUnfetch(tls *libc.TLS, fd uintptr, iOff I64, p uintptr) int32 { /* sqlite3.c:38748:12: */
var pFd uintptr = fd // The underlying database file
_ = iOff
@@ -22486,30 +23423,30 @@ func unixUnfetch(tls *crt.TLS, fd uintptr, iOff I64, p uintptr) int32 { /* sqlit
// Here are all of the sqlite3_io_methods objects for each of the
// locking strategies. Functions that return pointers to these methods
// are also created.
-var posixIoMethods = Sqlite3_io_methods{FiVersion: 3, FxClose: /* iVersion */ 0, FxRead: /* xClose */ 0, FxWrite: /* xRead */ 0, FxTruncate: /* xWrite */ 0, FxSync: /* xTruncate */ 0, FxFileSize: /* xSync */ 0, FxLock: /* xFileSize */ 0, FxUnlock: /* xLock */ 0, FxCheckReservedLock: /* xUnlock */ 0, FxFileControl: /* xCheckReservedLock */ 0, FxSectorSize: /* xFileControl */ 0, FxDeviceCharacteristics: /* xSectorSize */ 0, FxShmMap: /* xDeviceCapabilities */ 0, FxShmLock: /* xShmMap */ 0, FxShmBarrier: /* xShmLock */ 0, FxShmUnmap: /* xShmBarrier */ 0, FxFetch: /* xShmUnmap */ 0, FxUnfetch: /* xFetch */ 0 /* xUnfetch */} /* sqlite3.c:38762:1 */
-func posixIoFinderImpl(tls *crt.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:38762:1: */
+var posixIoMethods = Sqlite3_io_methods{FiVersion: 3, FxClose: /* iVersion */ 0, FxRead: /* xClose */ 0, FxWrite: /* xRead */ 0, FxTruncate: /* xWrite */ 0, FxSync: /* xTruncate */ 0, FxFileSize: /* xSync */ 0, FxLock: /* xFileSize */ 0, FxUnlock: /* xLock */ 0, FxCheckReservedLock: /* xUnlock */ 0, FxFileControl: /* xCheckReservedLock */ 0, FxSectorSize: /* xFileControl */ 0, FxDeviceCharacteristics: /* xSectorSize */ 0, FxShmMap: /* xDeviceCapabilities */ 0, FxShmLock: /* xShmMap */ 0, FxShmBarrier: /* xShmLock */ 0, FxShmUnmap: /* xShmBarrier */ 0, FxFetch: /* xShmUnmap */ 0, FxUnfetch: /* xFetch */ 0 /* xUnfetch */} /* sqlite3.c:38850:1 */
+func posixIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:38850:1: */
_ = z
_ = p
return uintptr(unsafe.Pointer(&posixIoMethods))
}
-var posixIoFinder uintptr = 0 /* sqlite3.c:38762:1 */
-var nolockIoMethods = Sqlite3_io_methods{FiVersion: 3, FxClose: /* iVersion */ 0, FxRead: /* xClose */ 0, FxWrite: /* xRead */ 0, FxTruncate: /* xWrite */ 0, FxSync: /* xTruncate */ 0, FxFileSize: /* xSync */ 0, FxLock: /* xFileSize */ 0, FxUnlock: /* xLock */ 0, FxCheckReservedLock: /* xUnlock */ 0, FxFileControl: /* xCheckReservedLock */ 0, FxSectorSize: /* xFileControl */ 0, FxDeviceCharacteristics: /* xSectorSize */ 0, FxShmMap: /* xDeviceCapabilities */ uintptr(0), FxShmLock: /* xShmMap */ 0, FxShmBarrier: /* xShmLock */ 0, FxShmUnmap: /* xShmBarrier */ 0, FxFetch: /* xShmUnmap */ 0, FxUnfetch: /* xFetch */ 0 /* xUnfetch */} /* sqlite3.c:38772:1 */
-func nolockIoFinderImpl(tls *crt.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:38772:1: */
+var posixIoFinder uintptr = 0 /* sqlite3.c:38850:1 */
+var nolockIoMethods = Sqlite3_io_methods{FiVersion: 3, FxClose: /* iVersion */ 0, FxRead: /* xClose */ 0, FxWrite: /* xRead */ 0, FxTruncate: /* xWrite */ 0, FxSync: /* xTruncate */ 0, FxFileSize: /* xSync */ 0, FxLock: /* xFileSize */ 0, FxUnlock: /* xLock */ 0, FxCheckReservedLock: /* xUnlock */ 0, FxFileControl: /* xCheckReservedLock */ 0, FxSectorSize: /* xFileControl */ 0, FxDeviceCharacteristics: /* xSectorSize */ 0, FxShmMap: /* xDeviceCapabilities */ uintptr(0), FxShmLock: /* xShmMap */ 0, FxShmBarrier: /* xShmLock */ 0, FxShmUnmap: /* xShmBarrier */ 0, FxFetch: /* xShmUnmap */ 0, FxUnfetch: /* xFetch */ 0 /* xUnfetch */} /* sqlite3.c:38860:1 */
+func nolockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:38860:1: */
_ = z
_ = p
return uintptr(unsafe.Pointer(&nolockIoMethods))
}
-var nolockIoFinder uintptr = 0 /* sqlite3.c:38772:1 */
-var dotlockIoMethods = Sqlite3_io_methods{FiVersion: 1, FxClose: /* iVersion */ 0, FxRead: /* xClose */ 0, FxWrite: /* xRead */ 0, FxTruncate: /* xWrite */ 0, FxSync: /* xTruncate */ 0, FxFileSize: /* xSync */ 0, FxLock: /* xFileSize */ 0, FxUnlock: /* xLock */ 0, FxCheckReservedLock: /* xUnlock */ 0, FxFileControl: /* xCheckReservedLock */ 0, FxSectorSize: /* xFileControl */ 0, FxDeviceCharacteristics: /* xSectorSize */ 0, FxShmMap: /* xDeviceCapabilities */ uintptr(0), FxShmLock: /* xShmMap */ 0, FxShmBarrier: /* xShmLock */ 0, FxShmUnmap: /* xShmBarrier */ 0, FxFetch: /* xShmUnmap */ 0, FxUnfetch: /* xFetch */ 0 /* xUnfetch */} /* sqlite3.c:38782:1 */
-func dotlockIoFinderImpl(tls *crt.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:38782:1: */
+var nolockIoFinder uintptr = 0 /* sqlite3.c:38860:1 */
+var dotlockIoMethods = Sqlite3_io_methods{FiVersion: 1, FxClose: /* iVersion */ 0, FxRead: /* xClose */ 0, FxWrite: /* xRead */ 0, FxTruncate: /* xWrite */ 0, FxSync: /* xTruncate */ 0, FxFileSize: /* xSync */ 0, FxLock: /* xFileSize */ 0, FxUnlock: /* xLock */ 0, FxCheckReservedLock: /* xUnlock */ 0, FxFileControl: /* xCheckReservedLock */ 0, FxSectorSize: /* xFileControl */ 0, FxDeviceCharacteristics: /* xSectorSize */ 0, FxShmMap: /* xDeviceCapabilities */ uintptr(0), FxShmLock: /* xShmMap */ 0, FxShmBarrier: /* xShmLock */ 0, FxShmUnmap: /* xShmBarrier */ 0, FxFetch: /* xShmUnmap */ 0, FxUnfetch: /* xFetch */ 0 /* xUnfetch */} /* sqlite3.c:38870:1 */
+func dotlockIoFinderImpl(tls *libc.TLS, z uintptr, p uintptr) uintptr { /* sqlite3.c:38870:1: */
_ = z
_ = p
return uintptr(unsafe.Pointer(&dotlockIoMethods))
}
-var dotlockIoFinder uintptr = 0 /* sqlite3.c:38782:1 */
+var dotlockIoFinder uintptr = 0 /* sqlite3.c:38870:1 */
// The proxy locking method is a "super-method" in the sense that it
// opens secondary file descriptors for the conch and lock files and
@@ -22522,7 +23459,7 @@ var dotlockIoFinder uintptr = 0 /* sqlite3.c:38782:1 */
// nfs lockd on OSX 10.3+ doesn't clear write locks when a read lock is set
// An abstract type for a pointer to an IO method finder function:
-type Finder_type = uintptr /* sqlite3.c:38977:34 */
+type Finder_type = uintptr /* sqlite3.c:39065:34 */
// ***************************************************************************
//
@@ -22532,7 +23469,7 @@ type Finder_type = uintptr /* sqlite3.c:38977:34 */
// sqlite3_vfs object.
// Initialize the contents of the unixFile structure pointed to by pId.
-func fillInUnixFile(tls *crt.TLS, pVfs uintptr, h int32, pId uintptr, zFilename uintptr, ctrlFlags int32) int32 { /* sqlite3.c:38990:12: */
+func fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilename uintptr, ctrlFlags int32) int32 { /* sqlite3.c:39078:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -22543,7 +23480,7 @@ func fillInUnixFile(tls *crt.TLS, pVfs uintptr, h int32, pId uintptr, zFilename
// No locking occurs in temporary files
if Xsqlite3OSTrace != 0 {
- Xsqlite3DebugPrintf(tls, ts+3189 /* "OPEN %-3d %s\n" */, crt.VaList(bp, h, zFilename))
+ Xsqlite3DebugPrintf(tls, ts+5324 /* "OPEN %-3d %s\n" */, libc.VaList(bp, h, zFilename))
}
(*UnixFile)(unsafe.Pointer(pNew)).Fh = h
(*UnixFile)(unsafe.Pointer(pNew)).FpVfs = pVfs
@@ -22556,17 +23493,17 @@ func fillInUnixFile(tls *crt.TLS, pVfs uintptr, h int32, pId uintptr, zFilename
}
return uintptr(0)
}(),
- ts+3206 /* "psow" */, 1) != 0 {
+ ts+5341 /* "psow" */, 1) != 0 {
*(*uint16)(unsafe.Pointer(pNew + 30 /* &.ctrlFlags */)) |= uint16((0x10))
}
- if crt.Xstrcmp(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName, ts+3211 /* "unix-excl" */) == 0 {
+ if libc.Xstrcmp(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName, ts+5346 /* "unix-excl" */) == 0 {
*(*uint16)(unsafe.Pointer(pNew + 30 /* &.ctrlFlags */)) |= uint16((0x01))
}
if (ctrlFlags & 0x80) != 0 {
pLockingStyle = uintptr(unsafe.Pointer(&nolockIoMethods))
} else {
- pLockingStyle = (**(**func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 32 /* &.pAppData */))))(tls, zFilename, pNew)
+ pLockingStyle = (**(**func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pVfs + 32 /* &.pAppData */))))(tls, zFilename, pNew)
}
if pLockingStyle == uintptr(unsafe.Pointer(&posixIoMethods)) {
@@ -22590,7 +23527,7 @@ func fillInUnixFile(tls *crt.TLS, pVfs uintptr, h int32, pId uintptr, zFilename
// If scenario (a) caused the error then things are not so safe. The
// implicit assumption here is that if fstat() fails, things are in
// such bad shape that dropping a lock or two doesn't matter much.
- robust_close(tls, pNew, h, 39068)
+ robust_close(tls, pNew, h, 39156)
h = -1
}
unixLeaveMutex(tls)
@@ -22600,12 +23537,12 @@ func fillInUnixFile(tls *crt.TLS, pVfs uintptr, h int32, pId uintptr, zFilename
var zLockFile uintptr
var nFilename int32
- nFilename = (int32(crt.Xstrlen(tls, zFilename)) + 6)
+ nFilename = (int32(libc.Xstrlen(tls, zFilename)) + 6)
zLockFile = Xsqlite3_malloc64(tls, uint64(nFilename))
if zLockFile == uintptr(0) {
rc = 7
} else {
- Xsqlite3_snprintf(tls, nFilename, zLockFile, ts+3221 /* "%s.lock" */, crt.VaList(bp+16, zFilename))
+ Xsqlite3_snprintf(tls, nFilename, zLockFile, ts+5356 /* "%s.lock" */, libc.VaList(bp+16, zFilename))
}
(*UnixFile)(unsafe.Pointer(pNew)).FlockingContext = zLockFile
}
@@ -22613,10 +23550,10 @@ func fillInUnixFile(tls *crt.TLS, pVfs uintptr, h int32, pId uintptr, zFilename
storeLastErrno(tls, pNew, 0)
if rc != 0 {
if h >= 0 {
- robust_close(tls, pNew, h, 39153)
+ robust_close(tls, pNew, h, 39241)
}
} else {
- (*UnixFile)(unsafe.Pointer(pNew)).FpMethod = pLockingStyle
+ (*Sqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle
Xsqlite3_open_file_count = Xsqlite3_open_file_count + (+1)
verifyDbFile(tls, pNew)
}
@@ -22625,7 +23562,7 @@ func fillInUnixFile(tls *crt.TLS, pVfs uintptr, h int32, pId uintptr, zFilename
// Return the name of a directory in which to put temporary files.
// If no suitable temporary file directory can be found, return NULL.
-func unixTempFileDir(tls *crt.TLS) uintptr { /* sqlite3.c:39166:19: */
+func unixTempFileDir(tls *libc.TLS) uintptr { /* sqlite3.c:39254:19: */
bp := tls.Alloc(144)
defer tls.Free(144)
@@ -22635,22 +23572,22 @@ func unixTempFileDir(tls *crt.TLS) uintptr { /* sqlite3.c:39166:19: */
var zDir uintptr = Xsqlite3_temp_directory
if !(int32(azDirs[0]) != 0) {
- azDirs[0] = crt.Xgetenv(tls, ts+3229 /* "SQLITE_TMPDIR" */)
+ azDirs[0] = libc.Xgetenv(tls, ts+5364 /* "SQLITE_TMPDIR" */)
}
if !(int32(azDirs[1]) != 0) {
- azDirs[1] = crt.Xgetenv(tls, ts+3243 /* "TMPDIR" */)
+ azDirs[1] = libc.Xgetenv(tls, ts+5378 /* "TMPDIR" */)
}
for 1 != 0 {
if (((zDir != uintptr(0)) &&
- ((*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(4)*24 + 8 /* &.pCurrent */))))(tls, zDir, bp /* &buf */) == 0)) &&
- ((((*stat64)(unsafe.Pointer(bp /* &buf */)).Fst_mode) & uint32(0170000)) == (uint32(0040000)))) &&
- ((*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(2)*24 + 8 /* &.pCurrent */))))(tls, zDir, 03) == 0) {
+ ((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(4)*24 + 8 /* &.pCurrent */))))(tls, zDir, bp /* &buf */) == 0)) &&
+ ((((*stat64)(unsafe.Pointer(bp /* &buf */)).Fst_mode) & X__mode_t(0170000)) == (X__mode_t(0040000)))) &&
+ ((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(2)*24 + 8 /* &.pCurrent */))))(tls, zDir, 03) == 0) {
return zDir
}
if uint64(i) >= (uint64(unsafe.Sizeof(azDirs)) / uint64(unsafe.Sizeof(uintptr(0)))) {
break
}
- zDir = azDirs[crt.PostIncUint32(&i, 1)]
+ zDir = azDirs[libc.PostIncUint32(&i, 1)]
}
return uintptr(0)
}
@@ -22658,16 +23595,16 @@ func unixTempFileDir(tls *crt.TLS) uintptr { /* sqlite3.c:39166:19: */
var azDirs = [6]uintptr{
uintptr(0),
uintptr(0),
- ts + 3250, /* "/var/tmp" */
- ts + 3259, /* "/usr/tmp" */
- ts + 3268, /* "/tmp" */
- ts + 685, /* "." */
-} /* sqlite3.c:39167:21 */
+ ts + 5385, /* "/var/tmp" */
+ ts + 5394, /* "/usr/tmp" */
+ ts + 5403, /* "/tmp" */
+ ts + 794, /* "." */
+} /* sqlite3.c:39255:21 */
// Create a temporary file name in zBuf. zBuf must be allocated
// by the calling process and must be big enough to hold at least
// pVfs->mxPathname bytes.
-func unixGetTempname(tls *crt.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:39200:12: */
+func unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:39288:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -22678,7 +23615,7 @@ func unixGetTempname(tls *crt.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3.
// using the io-error infrastructure to test that SQLite handles this
// function failing.
*(*int8)(unsafe.Pointer(zBuf + uintptr(0))) = int8(0)
- if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (crt.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
+ if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
local_ioerr(tls)
return 10
}
@@ -22687,15 +23624,15 @@ func unixGetTempname(tls *crt.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3.
if zDir == uintptr(0) {
return (10 | (int32(25) << 8))
}
- for ok := true; ok; ok = ((*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(2)*24 + 8 /* &.pCurrent */))))(tls, zBuf, 0) == 0) {
+ for ok := true; ok; ok = ((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(2)*24 + 8 /* &.pCurrent */))))(tls, zBuf, 0) == 0) {
// var r U64 at bp+24, 8
Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U64(0))), bp+24 /* &r */)
*(*int8)(unsafe.Pointer(zBuf + uintptr((nBuf - 2)))) = int8(0)
- Xsqlite3_snprintf(tls, nBuf, zBuf, ts+3273, /* "%s/etilqs_%llx%c" */
- crt.VaList(bp, zDir, *(*U64)(unsafe.Pointer(bp + 24 /* r */)), 0))
- if (int32(*(*int8)(unsafe.Pointer(zBuf + uintptr((nBuf - 2))))) != 0) || ((crt.PostIncInt32(&iLimit, 1)) > 10) {
+ Xsqlite3_snprintf(tls, nBuf, zBuf, ts+5408, /* "%s/etilqs_%llx%c" */
+ libc.VaList(bp, zDir, *(*U64)(unsafe.Pointer(bp + 24 /* r */)), 0))
+ if (int32(*(*int8)(unsafe.Pointer(zBuf + uintptr((nBuf - 2))))) != 0) || ((libc.PostIncInt32(&iLimit, 1)) > 10) {
return 1
}
}
@@ -22703,7 +23640,7 @@ func unixGetTempname(tls *crt.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3.
}
// Search for an unused file descriptor that was opened on the database
-// file (not a journal or master-journal file) identified by pathname
+// file (not a journal or super-journal file) identified by pathname
// zPath with SQLITE_OPEN_XXX flags matching those passed as the second
// argument to this function.
//
@@ -22716,7 +23653,7 @@ func unixGetTempname(tls *crt.TLS, nBuf int32, zBuf uintptr) int32 { /* sqlite3.
//
// If a suitable file descriptor is found, then it is returned. If no
// such file descriptor is located, -1 is returned.
-func findReusableFd(tls *crt.TLS, zPath uintptr, flags int32) uintptr { /* sqlite3.c:39250:21: */
+func findReusableFd(tls *libc.TLS, zPath uintptr, flags int32) uintptr { /* sqlite3.c:39338:21: */
bp := tls.Alloc(144)
defer tls.Free(144)
@@ -22740,7 +23677,7 @@ func findReusableFd(tls *crt.TLS, zPath uintptr, flags int32) uintptr { /* sqlit
//
// Even if a subsequent open() call does succeed, the consequences of
// not searching for a reusable file descriptor are not dire.
- if (inodeList != uintptr(0)) && (0 == (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(4)*24 + 8 /* &.pCurrent */))))(tls, zPath, bp /* &sStat */)) {
+ if (inodeList != uintptr(0)) && (0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(4)*24 + 8 /* &.pCurrent */))))(tls, zPath, bp /* &sStat */)) {
var pInode uintptr
pInode = inodeList
@@ -22767,15 +23704,15 @@ func findReusableFd(tls *crt.TLS, zPath uintptr, flags int32) uintptr { /* sqlit
}
// Find the mode, uid and gid of file zFile.
-func getFileMode(tls *crt.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39300:12: */
+func getFileMode(tls *libc.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39388:12: */
bp := tls.Alloc(144)
defer tls.Free(144)
// var sStat stat64 at bp, 144
// Output of stat() on database file
var rc int32 = 0
- if 0 == (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(4)*24 + 8 /* &.pCurrent */))))(tls, zFile, bp /* &sStat */) {
- *(*Mode_t)(unsafe.Pointer(pMode)) = ((*stat64)(unsafe.Pointer(bp /* &sStat */)).Fst_mode & uint32(0777))
+ if 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(4)*24 + 8 /* &.pCurrent */))))(tls, zFile, bp /* &sStat */) {
+ *(*Mode_t)(unsafe.Pointer(pMode)) = ((*stat64)(unsafe.Pointer(bp /* &sStat */)).Fst_mode & X__mode_t(0777))
*(*Uid_t)(unsafe.Pointer(pUid)) = (*stat64)(unsafe.Pointer(bp /* &sStat */)).Fst_uid
*(*Gid_t)(unsafe.Pointer(pGid)) = (*stat64)(unsafe.Pointer(bp /* &sStat */)).Fst_gid
} else {
@@ -22803,7 +23740,7 @@ func getFileMode(tls *crt.TLS, zFile uintptr, pMode uintptr, pUid uintptr, pGid
// original filename is unavailable. But 8_3_NAMES is only used for
// FAT filesystems and permissions do not matter there, so just use
// the default permissions. In 8_3_NAMES mode, leave *pMode set to zero.
-func findCreateFileMode(tls *crt.TLS, zPath uintptr, flags int32, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39339:12: */
+func findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintptr, pUid uintptr, pGid uintptr) int32 { /* sqlite3.c:39427:12: */
bp := tls.Alloc(513)
defer tls.Free(513)
@@ -22831,14 +23768,14 @@ func findCreateFileMode(tls *crt.TLS, zPath uintptr, flags int32, pMode uintptr,
for int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nDb)))) != '-' {
// In normal operation, the journal file name will always contain
// a '-' character. However in 8+3 filename mode, or if a corrupt
- // rollback journal specifies a master journal with a goofy name, then
+ // rollback journal specifies a super-journal with a goofy name, then
// the '-' might be missing.
if (nDb == 0) || (int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nDb)))) == '.') {
return 0
}
nDb--
}
- crt.Xmemcpy(tls, bp /* &zDb[0] */, zPath, uint64(nDb))
+ libc.Xmemcpy(tls, bp /* &zDb[0] */, zPath, uint64(nDb))
*(*int8)(unsafe.Pointer(bp /* &zDb[0] */ + uintptr(nDb))) = int8(0)
rc = getFileMode(tls, bp /* &zDb[0] */, pMode, pUid, pGid)
@@ -22849,7 +23786,7 @@ func findCreateFileMode(tls *crt.TLS, zPath uintptr, flags int32, pMode uintptr,
// filename, check for the "modeof" parameter. If present, interpret
// its value as a filename and try to copy the mode, uid and gid from
// that file.
- var z uintptr = Xsqlite3_uri_parameter(tls, zPath, ts+3290 /* "modeof" */)
+ var z uintptr = Xsqlite3_uri_parameter(tls, zPath, ts+5425 /* "modeof" */)
if z != 0 {
rc = getFileMode(tls, z, pMode, pUid, pGid)
}
@@ -22877,7 +23814,7 @@ func findCreateFileMode(tls *crt.TLS, zPath uintptr, flags int32, pMode uintptr,
// file handle closed. To achieve the same effect using this new
// interface, add the DELETEONCLOSE flag to those specified above for
// OpenExclusive().
-func unixOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:39416:12: */
+func unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:39504:12: */
bp := tls.Alloc(552)
defer tls.Free(552)
@@ -22895,7 +23832,7 @@ func unixOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags in
var isReadonly int32
var isReadWrite int32
- // If creating a master or main-file journal, this function will open
+ // If creating a super- or main-file journal, this function will open
// a file-descriptor on the directory too. The first time unixSync()
// is called the directory file descriptor will be fsync()ed and close()d.
var isNewJrnl int32
@@ -22923,7 +23860,7 @@ func unixOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags in
isCreate = (flags & 0x00000004)
isReadonly = (flags & 0x00000001)
isReadWrite = (flags & 0x00000002)
- isNewJrnl = (crt.Bool32((isCreate != 0) && (((eType == 0x00004000) ||
+ isNewJrnl = (libc.Bool32((isCreate != 0) && (((eType == 0x00004000) ||
(eType == 0x00000800)) ||
(eType == 0x00080000))))
zName = zPath
@@ -22935,7 +23872,7 @@ func unixOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags in
// (c) if EXCLUSIVE is set, then CREATE must also be set.
// (d) if DELETEONCLOSE is set, then CREATE must also be set.
- // The main DB, main journal, WAL file and master journal are never
+ // The main DB, main journal, WAL file and super-journal are never
// automatically deleted. Nor are they ever temporary files.
// Assert that the upper layer has set one of the "file-type" flags.
@@ -22944,14 +23881,14 @@ func unixOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags in
// here such that two or more threads all trying to open databases at
// the same instant might all reset the PRNG. But multiple resets
// are harmless.
- if !(randomnessPid != crt.Xgetpid(tls)) {
+ if !(randomnessPid != libc.Xgetpid(tls)) {
goto __1
}
- randomnessPid = crt.Xgetpid(tls)
+ randomnessPid = libc.Xgetpid(tls)
Xsqlite3_randomness(tls, 0, uintptr(0))
__1:
;
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(UnixFile{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(UnixFile{})))
if !(eType == 0x00000100) {
goto __2
@@ -23045,14 +23982,14 @@ __14:
if !(Xsqlite3OSTrace != 0) {
goto __15
}
- Xsqlite3DebugPrintf(tls, ts+3297 /* "OPENX %-3d %s ..." */, crt.VaList(bp, fd, zName, openFlags))
+ Xsqlite3DebugPrintf(tls, ts+5432 /* "OPENX %-3d %s ..." */, libc.VaList(bp, fd, zName, openFlags))
__15:
;
if !(fd < 0) {
goto __16
}
- if !(((isNewJrnl != 0) && ((*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) == 13)) && ((*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(2)*24 + 8 /* &.pCurrent */))))(tls, zName, 0) != 0)) {
+ if !(((isNewJrnl != 0) && ((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == 13)) && ((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(2)*24 + 8 /* &.pCurrent */))))(tls, zName, 0) != 0)) {
goto __17
}
// If unable to create a journal because the directory is not
@@ -23060,12 +23997,12 @@ __15:
rc = (8 | (int32(6) << 8))
goto __18
__17:
- if !(((*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) != 21) && (isReadWrite != 0)) {
+ if !(((*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) != 21) && (isReadWrite != 0)) {
goto __19
}
// Failed to open the file for read/write access. Try read-only.
- flags = flags & (^int32(crt.Int32FromInt32((0x00000002 | 0x00000004))))
- openFlags = openFlags & (^int32(crt.Int32FromInt32((02 | 0100))))
+ flags = flags & (^int32(libc.Int32FromInt32((0x00000002 | 0x00000004))))
+ openFlags = openFlags & (^int32(libc.Int32FromInt32((02 | 0100))))
flags = flags | (0x00000001)
openFlags = openFlags | (00)
isReadonly = 1
@@ -23079,7 +24016,7 @@ __16:
if !(fd < 0) {
goto __20
}
- rc2 = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39567), ts+2260 /* "open" */, zName, 39567)
+ rc2 = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39655), ts+4395 /* "open" */, zName, 39655)
if !(rc == 0) {
goto __21
}
@@ -23128,7 +24065,7 @@ __24:
if !(isDelete != 0) {
goto __25
}
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(16)*24 + 8 /* &.pCurrent */))))(tls, zName)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(16)*24 + 8 /* &.pCurrent */))))(tls, zName)
__25:
;
@@ -23145,7 +24082,7 @@ __26:
ctrlFlags = ctrlFlags | (0x02)
__27:
;
- noLock = (crt.Bool32(eType != 0x00000100))
+ noLock = (libc.Bool32(eType != 0x00000100))
if !(noLock != 0) {
goto __28
}
@@ -23179,34 +24116,34 @@ __31:
// Delete the file at zPath. If the dirSync argument is true, fsync()
// the directory after deleting the file.
-func unixDelete(tls *crt.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:39690:12: */
+func unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:39778:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
var rc int32 = 0
_ = NotUsed
- if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (crt.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
+ if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
local_ioerr(tls)
return (10 | (int32(10) << 8))
}
- if (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(16)*24 + 8 /* &.pCurrent */))))(tls, zPath) == (-1) {
- if (*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) == 2 {
+ if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(16)*24 + 8 /* &.pCurrent */))))(tls, zPath) == (-1) {
+ if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) == 2 {
rc = (10 | (int32(23) << 8))
} else {
- rc = unixLogErrorAtLine(tls, (10 | (int32(10) << 8)), ts+2370 /* "unlink" */, zPath, 39706)
+ rc = unixLogErrorAtLine(tls, (10 | (int32(10) << 8)), ts+4505 /* "unlink" */, zPath, 39794)
}
return rc
}
if (dirSync & 1) != 0 {
// var fd int32 at bp, 4
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(17)*24 + 8 /* &.pCurrent */))))(tls, zPath, bp /* &fd */)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(17)*24 + 8 /* &.pCurrent */))))(tls, zPath, bp /* &fd */)
if rc == 0 {
if full_fsync(tls, *(*int32)(unsafe.Pointer(bp /* fd */)), 0, 0) != 0 {
- rc = unixLogErrorAtLine(tls, (10 | (int32(5) << 8)), ts+3318 /* "fsync" */, zPath, 39716)
+ rc = unixLogErrorAtLine(tls, (10 | (int32(5) << 8)), ts+5453 /* "fsync" */, zPath, 39804)
}
- robust_close(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp /* fd */)), 39718)
+ robust_close(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp /* fd */)), 39806)
} else {
rc = 0
@@ -23223,12 +24160,12 @@ func unixDelete(tls *crt.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) int
// SQLITE_ACCESS_READONLY: Return 1 if the file is readable.
//
// Otherwise return 0.
-func unixAccess(tls *crt.TLS, NotUsed uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:39738:12: */
+func unixAccess(tls *libc.TLS, NotUsed uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:39826:12: */
bp := tls.Alloc(144)
defer tls.Free(144)
_ = NotUsed
- if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (crt.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
+ if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
local_ioerr(tls)
return (10 | (int32(13) << 8))
}
@@ -23239,34 +24176,34 @@ func unixAccess(tls *crt.TLS, NotUsed uintptr, zPath uintptr, flags int32, pResO
if flags == 0 {
// var buf stat64 at bp, 144
- *(*int32)(unsafe.Pointer(pResOut)) = (crt.Bool32((0 == (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(4)*24 + 8 /* &.pCurrent */))))(tls, zPath, bp /* &buf */)) && (!((((*stat64)(unsafe.Pointer(bp /* &buf */)).Fst_mode) & uint32(0170000)) == (uint32(0100000))) || ((*stat64)(unsafe.Pointer(bp /* &buf */)).Fst_size > int64(0)))))
+ *(*int32)(unsafe.Pointer(pResOut)) = (libc.Bool32((0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(4)*24 + 8 /* &.pCurrent */))))(tls, zPath, bp /* &buf */)) && (!((((*stat64)(unsafe.Pointer(bp /* &buf */)).Fst_mode) & X__mode_t(0170000)) == (X__mode_t(0100000))) || ((*stat64)(unsafe.Pointer(bp /* &buf */)).Fst_size > int64(0)))))
} else {
- *(*int32)(unsafe.Pointer(pResOut)) = (crt.Bool32((*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(2)*24 + 8 /* &.pCurrent */))))(tls, zPath, (2|4)) == 0))
+ *(*int32)(unsafe.Pointer(pResOut)) = (libc.Bool32((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(2)*24 + 8 /* &.pCurrent */))))(tls, zPath, (2|4)) == 0))
}
return 0
}
//
-func mkFullPathname(tls *crt.TLS, zPath uintptr, zOut uintptr, nOut int32) int32 { /* sqlite3.c:39765:12: */
+func mkFullPathname(tls *libc.TLS, zPath uintptr, zOut uintptr, nOut int32) int32 { /* sqlite3.c:39853:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var nPath int32 = Xsqlite3Strlen30(tls, zPath)
var iOff int32 = 0
if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(0)))) != '/' {
- if (*(*func(*crt.TLS, uintptr, Size_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(3)*24 + 8 /* &.pCurrent */))))(tls, zOut, (uint64(nOut-2))) == uintptr(0) {
- return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39774), ts+2278 /* "getcwd" */, zPath, 39774)
+ if (*(*func(*libc.TLS, uintptr, Size_t) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(3)*24 + 8 /* &.pCurrent */))))(tls, zOut, (uint64(nOut-2))) == uintptr(0) {
+ return unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39862), ts+4413 /* "getcwd" */, zPath, 39862)
}
iOff = Xsqlite3Strlen30(tls, zOut)
- *(*int8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&iOff, 1)))) = int8('/')
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&iOff, 1)))) = int8('/')
}
if ((iOff + nPath) + 1) > nOut {
// SQLite assumes that xFullPathname() nul-terminates the output buffer
// even if it returns an error.
*(*int8)(unsafe.Pointer(zOut + uintptr(iOff))) = int8(0)
- return Xsqlite3CantopenError(tls, 39783)
+ return Xsqlite3CantopenError(tls, 39871)
}
- Xsqlite3_snprintf(tls, (nOut - iOff), (zOut + uintptr(iOff)), ts+696 /* "%s" */, crt.VaList(bp, zPath))
+ Xsqlite3_snprintf(tls, (nOut - iOff), (zOut + uintptr(iOff)), ts+805 /* "%s" */, libc.VaList(bp, zPath))
return 0
}
@@ -23277,7 +24214,7 @@ func mkFullPathname(tls *crt.TLS, zPath uintptr, zOut uintptr, nOut int32) int32
// zOut points to a buffer of at least sqlite3_vfs.mxPathname bytes
// (in this case, MAX_PATHNAME bytes). The full-path is written to
// this buffer before returning.
-func unixFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:39798:12: */
+func unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:39886:12: */
bp := tls.Alloc(144)
defer tls.Free(144)
@@ -23293,7 +24230,7 @@ func unixFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOu
// using the io-error infrastructure to test that SQLite handles this
// function failing. This function could fail if, for example, the
// current working directory has been unlinked.
- if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (crt.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
+ if ((Xsqlite3_io_error_persist != 0) && (Xsqlite3_io_error_hit != 0)) || (libc.PostDecInt32(&Xsqlite3_io_error_pending, 1) == 1) {
local_ioerr(tls)
return 1
}
@@ -23305,12 +24242,12 @@ func unixFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOu
var bLink int32 = 0
// var buf stat64 at bp, 144
- if (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(27)*24 + 8 /* &.pCurrent */))))(tls, zIn, bp /* &buf */) != 0 {
- if (*(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))) != 2 {
- rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39831), ts+2458 /* "lstat" */, zIn, 39831)
+ if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(27)*24 + 8 /* &.pCurrent */))))(tls, zIn, bp /* &buf */) != 0 {
+ if (*(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) != 2 {
+ rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39919), ts+4593 /* "lstat" */, zIn, 39919)
}
} else {
- bLink = (crt.Bool32((((*stat64)(unsafe.Pointer(bp /* &buf */)).Fst_mode) & uint32(0170000)) == (uint32(0120000))))
+ bLink = (libc.Bool32((((*stat64)(unsafe.Pointer(bp /* &buf */)).Fst_mode) & X__mode_t(0170000)) == (X__mode_t(0120000))))
}
if bLink != 0 {
@@ -23321,23 +24258,23 @@ func unixFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOu
rc = 7
}
} else if nLink >= 100 {
- rc = Xsqlite3CantopenError(tls, 39843)
+ rc = Xsqlite3CantopenError(tls, 39931)
}
if rc == 0 {
- nByte = int32((*(*func(*crt.TLS, uintptr, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(26)*24 + 8 /* &.pCurrent */))))(tls, zIn, zDel, (uint64(nOut - 1))))
+ nByte = int32((*(*func(*libc.TLS, uintptr, uintptr, Size_t) Ssize_t)(unsafe.Pointer((uintptr(unsafe.Pointer(&aSyscall)) + uintptr(26)*24 + 8 /* &.pCurrent */))))(tls, zIn, zDel, (uint64(nOut - 1))))
if nByte < 0 {
- rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39849), ts+2449 /* "readlink" */, zIn, 39849)
+ rc = unixLogErrorAtLine(tls, Xsqlite3CantopenError(tls, 39937), ts+4584 /* "readlink" */, zIn, 39937)
} else {
if int32(*(*int8)(unsafe.Pointer(zDel + uintptr(0)))) != '/' {
var n int32
for n = Xsqlite3Strlen30(tls, zIn); (n > 0) && (int32(*(*int8)(unsafe.Pointer(zIn + uintptr((n - 1))))) != '/'); n-- {
}
if ((nByte + n) + 1) > nOut {
- rc = Xsqlite3CantopenError(tls, 39855)
+ rc = Xsqlite3CantopenError(tls, 39943)
} else {
- crt.Xmemmove(tls, (zDel + uintptr(n)), zDel, (uint64(nByte + 1)))
- crt.Xmemcpy(tls, zDel, zIn, uint64(n))
+ libc.Xmemmove(tls, (zDel + uintptr(n)), zDel, (uint64(nByte + 1)))
+ libc.Xmemcpy(tls, zDel, zIn, uint64(n))
nByte = nByte + (n)
}
}
@@ -23364,9 +24301,9 @@ func unixFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOu
return rc
}
-func unixDlOpen(tls *crt.TLS, NotUsed uintptr, zFilename uintptr) uintptr { /* sqlite3.c:39890:13: */
+func unixDlOpen(tls *libc.TLS, NotUsed uintptr, zFilename uintptr) uintptr { /* sqlite3.c:39978:13: */
_ = NotUsed
- return crt.Xdlopen(tls, zFilename, (0x00002 | 0x00100))
+ return libc.Xdlopen(tls, zFilename, (0x00002 | 0x00100))
}
// SQLite calls this function immediately after a call to unixDlSym() or
@@ -23374,20 +24311,20 @@ func unixDlOpen(tls *crt.TLS, NotUsed uintptr, zFilename uintptr) uintptr { /* s
// message is available, it is written to zBufOut. If no error message
// is available, zBufOut is left unmodified and SQLite uses a default
// error message.
-func unixDlError(tls *crt.TLS, NotUsed uintptr, nBuf int32, zBufOut uintptr) { /* sqlite3.c:39902:13: */
+func unixDlError(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBufOut uintptr) { /* sqlite3.c:39990:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
var zErr uintptr
_ = NotUsed
unixEnterMutex(tls)
- zErr = crt.Xdlerror(tls)
+ zErr = libc.Xdlerror(tls)
if zErr != 0 {
- Xsqlite3_snprintf(tls, nBuf, zBufOut, ts+696 /* "%s" */, crt.VaList(bp, zErr))
+ Xsqlite3_snprintf(tls, nBuf, zBufOut, ts+805 /* "%s" */, libc.VaList(bp, zErr))
}
unixLeaveMutex(tls)
}
-func unixDlSym(tls *crt.TLS, NotUsed uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:39912:13: */
+func unixDlSym(tls *libc.TLS, NotUsed uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:40000:13: */
// GCC with -pedantic-errors says that C90 does not allow a void* to be
// cast into a pointer to a function. And yet the library dlsym() routine
// returns a void* which is really a pointer to a function. So how do we
@@ -23406,17 +24343,17 @@ func unixDlSym(tls *crt.TLS, NotUsed uintptr, p uintptr, zSym uintptr) uintptr {
var x uintptr
_ = NotUsed
x = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) uintptr
- }{crt.Xdlsym}))
- return (*(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&x)))(tls, p, zSym)
+ f func(*libc.TLS, uintptr, uintptr) uintptr
+ }{libc.Xdlsym}))
+ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&x)))(tls, p, zSym)
}
-func unixDlClose(tls *crt.TLS, NotUsed uintptr, pHandle uintptr) { /* sqlite3.c:39935:13: */
+func unixDlClose(tls *libc.TLS, NotUsed uintptr, pHandle uintptr) { /* sqlite3.c:40023:13: */
_ = NotUsed
- crt.Xdlclose(tls, pHandle)
+ libc.Xdlclose(tls, pHandle)
}
// Write nBuf bytes of random data to the supplied buffer zBuf.
-func unixRandomness(tls *crt.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:39949:12: */
+func unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:40037:12: */
_ = NotUsed
// We have to initialize zBuf to prevent valgrind from reporting
@@ -23430,8 +24367,8 @@ func unixRandomness(tls *crt.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) int
// When testing, initializing zBuf[] to zero is all we do. That means
// that we always use the same random number sequence. This makes the
// tests repeatable.
- crt.Xmemset(tls, zBuf, 0, uint64(nBuf))
- randomnessPid = crt.Xgetpid(tls)
+ libc.Xmemset(tls, zBuf, 0, uint64(nBuf))
+ randomnessPid = libc.Xgetpid(tls)
return nBuf
}
@@ -23441,8 +24378,8 @@ func unixRandomness(tls *crt.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) int
// requested from the underlying operating system, a number which
// might be greater than or equal to the argument, but not less
// than the argument.
-func unixSleep(tls *crt.TLS, NotUsed uintptr, microseconds int32) int32 { /* sqlite3.c:39996:12: */
- crt.Xusleep(tls, uint32(microseconds))
+func unixSleep(tls *libc.TLS, NotUsed uintptr, microseconds int32) int32 { /* sqlite3.c:40084:12: */
+ libc.Xusleep(tls, uint32(microseconds))
_ = NotUsed
return microseconds
}
@@ -23450,7 +24387,7 @@ func unixSleep(tls *crt.TLS, NotUsed uintptr, microseconds int32) int32 { /* sql
// The following variable, if set to a non-zero value, is interpreted as
// the number of seconds since 1970 and is used to set the result of
// sqlite3OsCurrentTime() during testing.
-var Xsqlite3_current_time int32 = 0 /* sqlite3.c:40023:16 */ // Fake system time in seconds since 1970.
+var Xsqlite3_current_time int32 = 0 /* sqlite3.c:40111:16 */ // Fake system time in seconds since 1970.
// Find the current time (in Universal Coordinated Time). Write into *piNow
// the current time and date as a Julian Day number times 86_400_000. In
@@ -23460,14 +24397,14 @@ var Xsqlite3_current_time int32 = 0 /* sqlite3.c:40023:16 */ // Fake system time
//
// On success, return SQLITE_OK. Return SQLITE_ERROR if the time and date
// cannot be found.
-func unixCurrentTimeInt64(tls *crt.TLS, NotUsed uintptr, piNow uintptr) int32 { /* sqlite3.c:40036:12: */
+func unixCurrentTimeInt64(tls *libc.TLS, NotUsed uintptr, piNow uintptr) int32 { /* sqlite3.c:40124:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
var rc int32 = 0
// var sNow timeval at bp, 16
- crt.Xgettimeofday(tls, bp /* &sNow */, uintptr(0)) // Cannot fail given valid arguments
+ libc.Xgettimeofday(tls, bp /* &sNow */, uintptr(0)) // Cannot fail given valid arguments
*(*Sqlite3_int64)(unsafe.Pointer(piNow)) = ((unixEpoch + (int64(1000) * Sqlite3_int64((*timeval)(unsafe.Pointer(bp /* &sNow */)).Ftv_sec))) + (Sqlite3_int64((*timeval)(unsafe.Pointer(bp /* &sNow */)).Ftv_usec / int64(1000))))
if Xsqlite3_current_time != 0 {
@@ -23477,12 +24414,12 @@ func unixCurrentTimeInt64(tls *crt.TLS, NotUsed uintptr, piNow uintptr) int32 {
return rc
}
-var unixEpoch Sqlite3_int64 = (int64(24405875) * int64(8640000)) /* sqlite3.c:40037:30 */
+var unixEpoch Sqlite3_int64 = (int64(24405875) * int64(8640000)) /* sqlite3.c:40125:30 */
// Find the current time (in Universal Coordinated Time). Write the
// current time and date as a Julian Day number into *prNow and
// return 0. Return 1 if the time and date cannot be found.
-func unixCurrentTime(tls *crt.TLS, NotUsed uintptr, prNow uintptr) int32 { /* sqlite3.c:40068:12: */
+func unixCurrentTime(tls *libc.TLS, NotUsed uintptr, prNow uintptr) int32 { /* sqlite3.c:40156:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -23498,11 +24435,11 @@ func unixCurrentTime(tls *crt.TLS, NotUsed uintptr, prNow uintptr) int32 { /* sq
// low-level error message when operating-system problems come up
// during SQLite operation. Only the integer return code is currently
// used.
-func unixGetLastError(tls *crt.TLS, NotUsed uintptr, NotUsed2 int32, NotUsed3 uintptr) int32 { /* sqlite3.c:40086:12: */
+func unixGetLastError(tls *libc.TLS, NotUsed uintptr, NotUsed2 int32, NotUsed3 uintptr) int32 { /* sqlite3.c:40174:12: */
_ = NotUsed
_ = NotUsed2
_ = NotUsed3
- return *(*int32)(unsafe.Pointer(crt.X__errno_location(tls)))
+ return *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))
}
//
@@ -23680,7 +24617,7 @@ func unixGetLastError(tls *crt.TLS, NotUsed uintptr, NotUsed2 int32, NotUsed3 ui
// single thread. The memory allocation and mutex subsystems have not
// necessarily been initialized when this routine is called, and so they
// should not be used.
-func Xsqlite3_os_init(tls *crt.TLS) int32 { /* sqlite3.c:41291:16: */
+func Xsqlite3_os_init(tls *libc.TLS) int32 { /* sqlite3.c:41379:16: */
var i uint32 // Loop counter
// Double-check that the aSyscall[] array has been constructed
@@ -23688,25 +24625,25 @@ func Xsqlite3_os_init(tls *crt.TLS) int32 { /* sqlite3.c:41291:16: */
// Register all VFSes defined in the aVfs[] array
for i = uint32(0); uint64(i) < (uint64(unsafe.Sizeof(aVfs)) / uint64(unsafe.Sizeof(Sqlite3_vfs{}))); i++ {
- Xsqlite3_vfs_register(tls, (uintptr(unsafe.Pointer(&aVfs)) + uintptr(i)*168), (crt.Bool32(i == uint32(0))))
+ Xsqlite3_vfs_register(tls, (uintptr(unsafe.Pointer(&aVfs)) + uintptr(i)*168), (libc.Bool32(i == uint32(0))))
}
unixBigLock = Xsqlite3MutexAlloc(tls, 11)
return 0
}
var aVfs = [4]Sqlite3_vfs{
- {FiVersion: 3, FszOsFile: /* iVersion */ int32(unsafe.Sizeof(UnixFile{})), FmxPathname: /* szOsFile */ 512, FpNext: /* mxPathname */ uintptr(0), FzName: /* pNext */ ts + 3324 /* "unix" */, FpAppData: /* zName */ 0, FxOpen: /* pAppData */ 0, FxDelete: /* xOpen */ 0, FxAccess: /* xDelete */ 0, FxFullPathname: /* xAccess */ 0, FxDlOpen: /* xFullPathname */ 0, FxDlError: /* xDlOpen */ 0, FxDlSym: /* xDlError */ 0, FxDlClose: /* xDlSym */ 0, FxRandomness: /* xDlClose */ 0, FxSleep: /* xRandomness */ 0, FxCurrentTime: /* xSleep */ 0, FxGetLastError: /* xCurrentTime */ 0, FxCurrentTimeInt64: /* xGetLastError */ 0, FxSetSystemCall: /* xCurrentTimeInt64 */ 0, FxGetSystemCall: /* xSetSystemCall */ 0, FxNextSystemCall: /* xGetSystemCall */ 0 /* xNextSystemCall */},
- {FiVersion: 3, FszOsFile: /* iVersion */ int32(unsafe.Sizeof(UnixFile{})), FmxPathname: /* szOsFile */ 512, FpNext: /* mxPathname */ uintptr(0), FzName: /* pNext */ ts + 3329 /* "unix-none" */, FpAppData: /* zName */ 0, FxOpen: /* pAppData */ 0, FxDelete: /* xOpen */ 0, FxAccess: /* xDelete */ 0, FxFullPathname: /* xAccess */ 0, FxDlOpen: /* xFullPathname */ 0, FxDlError: /* xDlOpen */ 0, FxDlSym: /* xDlError */ 0, FxDlClose: /* xDlSym */ 0, FxRandomness: /* xDlClose */ 0, FxSleep: /* xRandomness */ 0, FxCurrentTime: /* xSleep */ 0, FxGetLastError: /* xCurrentTime */ 0, FxCurrentTimeInt64: /* xGetLastError */ 0, FxSetSystemCall: /* xCurrentTimeInt64 */ 0, FxGetSystemCall: /* xSetSystemCall */ 0, FxNextSystemCall: /* xGetSystemCall */ 0 /* xNextSystemCall */},
- {FiVersion: 3, FszOsFile: /* iVersion */ int32(unsafe.Sizeof(UnixFile{})), FmxPathname: /* szOsFile */ 512, FpNext: /* mxPathname */ uintptr(0), FzName: /* pNext */ ts + 3339 /* "unix-dotfile" */, FpAppData: /* zName */ 0, FxOpen: /* pAppData */ 0, FxDelete: /* xOpen */ 0, FxAccess: /* xDelete */ 0, FxFullPathname: /* xAccess */ 0, FxDlOpen: /* xFullPathname */ 0, FxDlError: /* xDlOpen */ 0, FxDlSym: /* xDlError */ 0, FxDlClose: /* xDlSym */ 0, FxRandomness: /* xDlClose */ 0, FxSleep: /* xRandomness */ 0, FxCurrentTime: /* xSleep */ 0, FxGetLastError: /* xCurrentTime */ 0, FxCurrentTimeInt64: /* xGetLastError */ 0, FxSetSystemCall: /* xCurrentTimeInt64 */ 0, FxGetSystemCall: /* xSetSystemCall */ 0, FxNextSystemCall: /* xGetSystemCall */ 0 /* xNextSystemCall */},
- {FiVersion: 3, FszOsFile: /* iVersion */ int32(unsafe.Sizeof(UnixFile{})), FmxPathname: /* szOsFile */ 512, FpNext: /* mxPathname */ uintptr(0), FzName: /* pNext */ ts + 3211 /* "unix-excl" */, FpAppData: /* zName */ 0, FxOpen: /* pAppData */ 0, FxDelete: /* xOpen */ 0, FxAccess: /* xDelete */ 0, FxFullPathname: /* xAccess */ 0, FxDlOpen: /* xFullPathname */ 0, FxDlError: /* xDlOpen */ 0, FxDlSym: /* xDlError */ 0, FxDlClose: /* xDlSym */ 0, FxRandomness: /* xDlClose */ 0, FxSleep: /* xRandomness */ 0, FxCurrentTime: /* xSleep */ 0, FxGetLastError: /* xCurrentTime */ 0, FxCurrentTimeInt64: /* xGetLastError */ 0, FxSetSystemCall: /* xCurrentTimeInt64 */ 0, FxGetSystemCall: /* xSetSystemCall */ 0, FxNextSystemCall: /* xGetSystemCall */ 0 /* xNextSystemCall */},
-} /* sqlite3.c:41344:22 */
+ {FiVersion: 3, FszOsFile: /* iVersion */ int32(unsafe.Sizeof(UnixFile{})), FmxPathname: /* szOsFile */ 512, FpNext: /* mxPathname */ uintptr(0), FzName: /* pNext */ ts + 5459 /* "unix" */, FpAppData: /* zName */ 0, FxOpen: /* pAppData */ 0, FxDelete: /* xOpen */ 0, FxAccess: /* xDelete */ 0, FxFullPathname: /* xAccess */ 0, FxDlOpen: /* xFullPathname */ 0, FxDlError: /* xDlOpen */ 0, FxDlSym: /* xDlError */ 0, FxDlClose: /* xDlSym */ 0, FxRandomness: /* xDlClose */ 0, FxSleep: /* xRandomness */ 0, FxCurrentTime: /* xSleep */ 0, FxGetLastError: /* xCurrentTime */ 0, FxCurrentTimeInt64: /* xGetLastError */ 0, FxSetSystemCall: /* xCurrentTimeInt64 */ 0, FxGetSystemCall: /* xSetSystemCall */ 0, FxNextSystemCall: /* xGetSystemCall */ 0 /* xNextSystemCall */},
+ {FiVersion: 3, FszOsFile: /* iVersion */ int32(unsafe.Sizeof(UnixFile{})), FmxPathname: /* szOsFile */ 512, FpNext: /* mxPathname */ uintptr(0), FzName: /* pNext */ ts + 5464 /* "unix-none" */, FpAppData: /* zName */ 0, FxOpen: /* pAppData */ 0, FxDelete: /* xOpen */ 0, FxAccess: /* xDelete */ 0, FxFullPathname: /* xAccess */ 0, FxDlOpen: /* xFullPathname */ 0, FxDlError: /* xDlOpen */ 0, FxDlSym: /* xDlError */ 0, FxDlClose: /* xDlSym */ 0, FxRandomness: /* xDlClose */ 0, FxSleep: /* xRandomness */ 0, FxCurrentTime: /* xSleep */ 0, FxGetLastError: /* xCurrentTime */ 0, FxCurrentTimeInt64: /* xGetLastError */ 0, FxSetSystemCall: /* xCurrentTimeInt64 */ 0, FxGetSystemCall: /* xSetSystemCall */ 0, FxNextSystemCall: /* xGetSystemCall */ 0 /* xNextSystemCall */},
+ {FiVersion: 3, FszOsFile: /* iVersion */ int32(unsafe.Sizeof(UnixFile{})), FmxPathname: /* szOsFile */ 512, FpNext: /* mxPathname */ uintptr(0), FzName: /* pNext */ ts + 5474 /* "unix-dotfile" */, FpAppData: /* zName */ 0, FxOpen: /* pAppData */ 0, FxDelete: /* xOpen */ 0, FxAccess: /* xDelete */ 0, FxFullPathname: /* xAccess */ 0, FxDlOpen: /* xFullPathname */ 0, FxDlError: /* xDlOpen */ 0, FxDlSym: /* xDlError */ 0, FxDlClose: /* xDlSym */ 0, FxRandomness: /* xDlClose */ 0, FxSleep: /* xRandomness */ 0, FxCurrentTime: /* xSleep */ 0, FxGetLastError: /* xCurrentTime */ 0, FxCurrentTimeInt64: /* xGetLastError */ 0, FxSetSystemCall: /* xCurrentTimeInt64 */ 0, FxGetSystemCall: /* xSetSystemCall */ 0, FxNextSystemCall: /* xGetSystemCall */ 0 /* xNextSystemCall */},
+ {FiVersion: 3, FszOsFile: /* iVersion */ int32(unsafe.Sizeof(UnixFile{})), FmxPathname: /* szOsFile */ 512, FpNext: /* mxPathname */ uintptr(0), FzName: /* pNext */ ts + 5346 /* "unix-excl" */, FpAppData: /* zName */ 0, FxOpen: /* pAppData */ 0, FxDelete: /* xOpen */ 0, FxAccess: /* xDelete */ 0, FxFullPathname: /* xAccess */ 0, FxDlOpen: /* xFullPathname */ 0, FxDlError: /* xDlOpen */ 0, FxDlSym: /* xDlError */ 0, FxDlClose: /* xDlSym */ 0, FxRandomness: /* xDlClose */ 0, FxSleep: /* xRandomness */ 0, FxCurrentTime: /* xSleep */ 0, FxGetLastError: /* xCurrentTime */ 0, FxCurrentTimeInt64: /* xGetLastError */ 0, FxSetSystemCall: /* xCurrentTimeInt64 */ 0, FxGetSystemCall: /* xSetSystemCall */ 0, FxNextSystemCall: /* xGetSystemCall */ 0 /* xNextSystemCall */},
+} /* sqlite3.c:41432:22 */
// Shutdown the operating system interface.
//
// Some operating systems might need to do some cleanup in this routine,
// to release dynamically allocated objects. But not on unix.
// This routine is a no-op for unix.
-func Xsqlite3_os_end(tls *crt.TLS) int32 { /* sqlite3.c:41391:16: */
+func Xsqlite3_os_end(tls *libc.TLS) int32 { /* sqlite3.c:41479:16: */
unixBigLock = uintptr(0)
return 0
}
@@ -23748,7 +24685,7 @@ func Xsqlite3_os_end(tls *crt.TLS) int32 { /* sqlite3.c:41391:16: */
// #include "sqliteInt.h"
// Forward declaration of objects used by this utility
-type MemVfs = sqlite3_vfs /* sqlite3.c:47775:28 */
+type MemVfs = sqlite3_vfs /* sqlite3.c:47863:28 */
type MemFile1 = struct {
Fbase Sqlite3_file
Fsz Sqlite3_int64
@@ -23761,14 +24698,14 @@ type MemFile1 = struct {
_ [4]byte
}
-type MemFile = MemFile1 /* sqlite3.c:47776:24 */
+type MemFile = MemFile1 /* sqlite3.c:47864:24 */
var memdb_vfs = Sqlite3_vfs{FiVersion: 2, FszOsFile: // iVersion
0, FmxPathname:// szOsFile (set when registered)
1024, FpNext:// mxPathname
uintptr(0), FzName:// pNext
-ts + 3352, /* "memdb" */ FpAppData:// zName
-uintptr(0), FxOpen:/* pAppData (set when registered) */
+ts + 5487, /* "memdb" */ FpAppData:// zName
+uintptr(0), FxOpen:// pAppData (set when registered)
0, FxDelete:// xOpen
uintptr(0), FxAccess:/* memdbDelete, */ // xDelete
0, FxFullPathname:// xAccess
@@ -23782,7 +24719,7 @@ uintptr(0), FxAccess:/* memdbDelete, */ // xDelete
uintptr(0), FxGetLastError:/* memdbCurrentTime, */ // xCurrentTime
0, FxCurrentTimeInt64:// xGetLastError
0, // xCurrentTimeInt64
-} /* sqlite3.c:47829:20 */
+} /* sqlite3.c:47917:20 */
var memdb_io_methods = Sqlite3_io_methods{FiVersion: 3, FxClose: // iVersion
0, FxRead:// xClose
@@ -23792,7 +24729,7 @@ var memdb_io_methods = Sqlite3_io_methods{FiVersion: 3, FxClose: // iVersion
0, FxFileSize:// xSync
0, FxLock:// xFileSize
0, FxUnlock:// xLock
-0, FxCheckReservedLock:/* xUnlock - same as xLock in this case */
+0, FxCheckReservedLock:// xUnlock - same as xLock in this case
uintptr(0), FxFileControl:/* memdbCheckReservedLock, */ // xCheckReservedLock
0, FxSectorSize:// xFileControl
uintptr(0), FxDeviceCharacteristics:/* memdbSectorSize,*/ // xSectorSize
@@ -23803,13 +24740,13 @@ uintptr(0), FxShmUnmap:// xShmBarrier
uintptr(0), FxFetch:// xShmUnmap
0, FxUnfetch:// xFetch
0, // xUnfetch
-} /* sqlite3.c:47851:33 */
+} /* sqlite3.c:47939:33 */
// Close an memdb-file.
//
// The pData pointer is owned by the application, so there is nothing
// to free.
-func memdbClose(tls *crt.TLS, pFile uintptr) int32 { /* sqlite3.c:47881:12: */
+func memdbClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:47969:12: */
var p uintptr = pFile
if ((*MemFile)(unsafe.Pointer(p)).FmFlags & uint32(1)) != 0 {
Xsqlite3_free(tls, (*MemFile)(unsafe.Pointer(p)).FaData)
@@ -23818,21 +24755,21 @@ func memdbClose(tls *crt.TLS, pFile uintptr) int32 { /* sqlite3.c:47881:12: */
}
// Read data from an memdb-file.
-func memdbRead(tls *crt.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:47890:12: */
+func memdbRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:47978:12: */
var p uintptr = pFile
if (iOfst + Sqlite_int64(iAmt)) > (*MemFile)(unsafe.Pointer(p)).Fsz {
- crt.Xmemset(tls, zBuf, 0, uint64(iAmt))
+ libc.Xmemset(tls, zBuf, 0, uint64(iAmt))
if iOfst < (*MemFile)(unsafe.Pointer(p)).Fsz {
- crt.Xmemcpy(tls, zBuf, ((*MemFile)(unsafe.Pointer(p)).FaData + uintptr(iOfst)), (uint64((*MemFile)(unsafe.Pointer(p)).Fsz - iOfst)))
+ libc.Xmemcpy(tls, zBuf, ((*MemFile)(unsafe.Pointer(p)).FaData + uintptr(iOfst)), (uint64((*MemFile)(unsafe.Pointer(p)).Fsz - iOfst)))
}
return (10 | (int32(2) << 8))
}
- crt.Xmemcpy(tls, zBuf, ((*MemFile)(unsafe.Pointer(p)).FaData + uintptr(iOfst)), uint64(iAmt))
+ libc.Xmemcpy(tls, zBuf, ((*MemFile)(unsafe.Pointer(p)).FaData + uintptr(iOfst)), uint64(iAmt))
return 0
}
// Try to enlarge the memory allocation to hold at least sz bytes
-func memdbEnlarge(tls *crt.TLS, p uintptr, newSz Sqlite3_int64) int32 { /* sqlite3.c:47909:12: */
+func memdbEnlarge(tls *libc.TLS, p uintptr, newSz Sqlite3_int64) int32 { /* sqlite3.c:47997:12: */
var pNew uintptr
if (((*MemFile)(unsafe.Pointer(p)).FmFlags & uint32(2)) == uint32(0)) || ((*MemFile)(unsafe.Pointer(p)).FnMmap > 0) {
return 13
@@ -23854,7 +24791,7 @@ func memdbEnlarge(tls *crt.TLS, p uintptr, newSz Sqlite3_int64) int32 { /* sqlit
}
// Write data to an memdb-file.
-func memdbWrite(tls *crt.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:47929:12: */
+func memdbWrite(tls *libc.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:48017:12: */
var p uintptr = pFile
if ((*MemFile)(unsafe.Pointer(p)).FmFlags & uint32(4)) != 0 {
return 8
@@ -23862,15 +24799,15 @@ func memdbWrite(tls *crt.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Sqlite
if (iOfst + Sqlite_int64(iAmt)) > (*MemFile)(unsafe.Pointer(p)).Fsz {
var rc int32
if ((iOfst + Sqlite_int64(iAmt)) > (*MemFile)(unsafe.Pointer(p)).FszAlloc) &&
- ((crt.AssignInt32(&rc, memdbEnlarge(tls, p, (iOfst+Sqlite_int64(iAmt))))) != 0) {
+ ((libc.AssignInt32(&rc, memdbEnlarge(tls, p, (iOfst+Sqlite_int64(iAmt))))) != 0) {
return rc
}
if iOfst > (*MemFile)(unsafe.Pointer(p)).Fsz {
- crt.Xmemset(tls, ((*MemFile)(unsafe.Pointer(p)).FaData + uintptr((*MemFile)(unsafe.Pointer(p)).Fsz)), 0, (uint64(iOfst - (*MemFile)(unsafe.Pointer(p)).Fsz)))
+ libc.Xmemset(tls, ((*MemFile)(unsafe.Pointer(p)).FaData + uintptr((*MemFile)(unsafe.Pointer(p)).Fsz)), 0, (uint64(iOfst - (*MemFile)(unsafe.Pointer(p)).Fsz)))
}
(*MemFile)(unsafe.Pointer(p)).Fsz = (iOfst + Sqlite_int64(iAmt))
}
- crt.Xmemcpy(tls, ((*MemFile)(unsafe.Pointer(p)).FaData + uintptr(iOfst)), z, uint64(iAmt))
+ libc.Xmemcpy(tls, ((*MemFile)(unsafe.Pointer(p)).FaData + uintptr(iOfst)), z, uint64(iAmt))
return 0
}
@@ -23879,7 +24816,7 @@ func memdbWrite(tls *crt.TLS, pFile uintptr, z uintptr, iAmt int32, iOfst Sqlite
// In rollback mode (which is always the case for memdb, as it does not
// support WAL mode) the truncate() method is only used to reduce
// the size of a file, never to increase the size.
-func memdbTruncate(tls *crt.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:47958:12: */
+func memdbTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:48046:12: */
var p uintptr = pFile
if size > (*MemFile)(unsafe.Pointer(p)).Fsz {
return 13
@@ -23889,19 +24826,19 @@ func memdbTruncate(tls *crt.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sq
}
// Sync an memdb-file.
-func memdbSync(tls *crt.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:47968:12: */
+func memdbSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:48056:12: */
return 0
}
// Return the current file-size of an memdb-file.
-func memdbFileSize(tls *crt.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:47975:12: */
+func memdbFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:48063:12: */
var p uintptr = pFile
*(*Sqlite_int64)(unsafe.Pointer(pSize)) = (*MemFile)(unsafe.Pointer(p)).Fsz
return 0
}
// Lock an memdb-file.
-func memdbLock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:47984:12: */
+func memdbLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:48072:12: */
var p uintptr = pFile
if (eLock > 1) &&
(((*MemFile)(unsafe.Pointer(p)).FmFlags & uint32(4)) != uint32(0)) {
@@ -23912,14 +24849,14 @@ func memdbLock(tls *crt.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:47
}
// File control method. For custom operations on an memdb-file.
-func memdbFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:48008:12: */
+func memdbFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:48096:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
var p uintptr = pFile
var rc int32 = 12
if op == 12 {
- *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+3358 /* "memdb(%p,%lld)" */, crt.VaList(bp, (*MemFile)(unsafe.Pointer(p)).FaData, (*MemFile)(unsafe.Pointer(p)).Fsz))
+ *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, ts+5493 /* "memdb(%p,%lld)" */, libc.VaList(bp, (*MemFile)(unsafe.Pointer(p)).FaData, (*MemFile)(unsafe.Pointer(p)).Fsz))
rc = 0
}
if op == 36 {
@@ -23939,12 +24876,12 @@ func memdbFileControl(tls *crt.TLS, pFile uintptr, op int32, pArg uintptr) int32
}
// Return the device characteristic flags supported by an memdb-file.
-func memdbDeviceCharacteristics(tls *crt.TLS, pFile uintptr) int32 { /* sqlite3.c:48043:12: */
+func memdbDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:48131:12: */
return (((0x00000001 | 0x00001000) | 0x00000200) | 0x00000400)
}
// Fetch a page of a memory-mapped file
-func memdbFetch(tls *crt.TLS, pFile uintptr, iOfst Sqlite3_int64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:48051:12: */
+func memdbFetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, iAmt int32, pp uintptr) int32 { /* sqlite3.c:48139:12: */
var p uintptr = pFile
if (iOfst + Sqlite3_int64(iAmt)) > (*MemFile)(unsafe.Pointer(p)).Fsz {
*(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
@@ -23956,23 +24893,23 @@ func memdbFetch(tls *crt.TLS, pFile uintptr, iOfst Sqlite3_int64, iAmt int32, pp
}
// Release a memory-mapped page
-func memdbUnfetch(tls *crt.TLS, pFile uintptr, iOfst Sqlite3_int64, pPage uintptr) int32 { /* sqlite3.c:48068:12: */
+func memdbUnfetch(tls *libc.TLS, pFile uintptr, iOfst Sqlite3_int64, pPage uintptr) int32 { /* sqlite3.c:48156:12: */
var p uintptr = pFile
(*MemFile)(unsafe.Pointer(p)).FnMmap--
return 0
}
// Open an mem file handle.
-func memdbOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:48077:12: */
+func memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:48165:12: */
var p uintptr = pFile
if (flags & 0x00000100) == 0 {
- return (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 40 /* &.xOpen */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zName, pFile, flags, pOutFlags)
+ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 40 /* &.xOpen */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zName, pFile, flags, pOutFlags)
}
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(MemFile{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(MemFile{})))
(*MemFile)(unsafe.Pointer(p)).FmFlags = (uint32(2 | 1))
// True because flags==SQLITE_OPEN_MAIN_DB
*(*int32)(unsafe.Pointer(pOutFlags)) = (flags | 0x00000080)
- (*MemFile)(unsafe.Pointer(p)).Fbase.FpMethods = uintptr(unsafe.Pointer(&memdb_io_methods))
+ (*Sqlite3_file)(unsafe.Pointer(pFile)).FpMethods = uintptr(unsafe.Pointer(&memdb_io_methods))
(*MemFile)(unsafe.Pointer(p)).FszMax = Xsqlite3Config.FmxMemdbSize
return 0
}
@@ -23981,7 +24918,7 @@ func memdbOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags i
// is available, or false otherwise.
//
// With memdb, no files ever exist on disk. So always return false.
-func memdbAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:48115:12: */
+func memdbAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:48203:12: */
*(*int32)(unsafe.Pointer(pResOut)) = 0
return 0
}
@@ -23989,58 +24926,58 @@ func memdbAccess(tls *crt.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut
// Populate buffer zOut with the full canonical pathname corresponding
// to the pathname in zPath. zOut is guaranteed to point to a buffer
// of at least (INST_MAX_PATHNAME+1) bytes.
-func memdbFullPathname(tls *crt.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:48130:12: */
+func memdbFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:48218:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
- Xsqlite3_snprintf(tls, nOut, zOut, ts+696 /* "%s" */, crt.VaList(bp, zPath))
+ Xsqlite3_snprintf(tls, nOut, zOut, ts+805 /* "%s" */, libc.VaList(bp, zPath))
return 0
}
// Open the dynamic library located at zPath and return a handle.
-func memdbDlOpen(tls *crt.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:48143:13: */
- return (*(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 72 /* &.xDlOpen */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath)
+func memdbDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:48231:13: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 72 /* &.xDlOpen */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, zPath)
}
// Populate the buffer zErrMsg (size nByte bytes) with a human readable
// utf-8 string describing the most recent error encountered associated
// with dynamic libraries.
-func memdbDlError(tls *crt.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:48152:13: */
- (*(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 80 /* &.xDlError */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zErrMsg)
+func memdbDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:48240:13: */
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 80 /* &.xDlError */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zErrMsg)
}
// Return a pointer to the symbol zSymbol in the dynamic library pHandle.
-func memdbDlSym(tls *crt.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:48159:13: */
- return (*(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 88 /* &.xDlSym */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p, zSym)
+func memdbDlSym(tls *libc.TLS, pVfs uintptr, p uintptr, zSym uintptr) uintptr { /* sqlite3.c:48247:13: */
+ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 88 /* &.xDlSym */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p, zSym)
}
// Close the dynamic library handle pHandle.
-func memdbDlClose(tls *crt.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:48166:13: */
- (*(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 96 /* &.xDlClose */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, pHandle)
+func memdbDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:48254:13: */
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 96 /* &.xDlClose */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, pHandle)
}
// Populate the buffer pointed to by zBufOut with nByte bytes of
// random data.
-func memdbRandomness(tls *crt.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:48174:12: */
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 104 /* &.xRandomness */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zBufOut)
+func memdbRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:48262:12: */
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 104 /* &.xRandomness */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nByte, zBufOut)
}
// Sleep for nMicro microseconds. Return the number of microseconds
// actually slept.
-func memdbSleep(tls *crt.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:48182:12: */
- return (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 112 /* &.xSleep */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nMicro)
+func memdbSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:48270:12: */
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 112 /* &.xSleep */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, nMicro)
}
-func memdbGetLastError(tls *crt.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:48195:12: */
- return (*(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 128 /* &.xGetLastError */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, a, b)
+func memdbGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:48283:12: */
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 128 /* &.xGetLastError */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, a, b)
}
-func memdbCurrentTimeInt64(tls *crt.TLS, pVfs uintptr, p uintptr) int32 { /* sqlite3.c:48198:12: */
- return (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 136 /* &.xCurrentTimeInt64 */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p)
+func memdbCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, p uintptr) int32 { /* sqlite3.c:48286:12: */
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData + 136 /* &.xCurrentTimeInt64 */))))(tls, (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FpAppData, p)
}
// Translate a database connection pointer and schema name into a
// MemFile pointer.
-func memdbFromDbSchema(tls *crt.TLS, db uintptr, zSchema uintptr) uintptr { /* sqlite3.c:48206:16: */
+func memdbFromDbSchema(tls *libc.TLS, db uintptr, zSchema uintptr) uintptr { /* sqlite3.c:48294:16: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -24056,7 +24993,7 @@ func memdbFromDbSchema(tls *crt.TLS, db uintptr, zSchema uintptr) uintptr { /* s
}
// Return the serialization of a database
-func Xsqlite3_serialize(tls *crt.TLS, db uintptr, zSchema uintptr, piSize uintptr, mFlags uint32) uintptr { /* sqlite3.c:48217:26: */
+func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintptr, mFlags uint32) uintptr { /* sqlite3.c:48305:26: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -24090,7 +25027,7 @@ func Xsqlite3_serialize(tls *crt.TLS, db uintptr, zSchema uintptr, piSize uintpt
} else {
pOut = Xsqlite3_malloc64(tls, uint64((*MemFile)(unsafe.Pointer(p)).Fsz))
if pOut != 0 {
- crt.Xmemcpy(tls, pOut, (*MemFile)(unsafe.Pointer(p)).FaData, uint64((*MemFile)(unsafe.Pointer(p)).Fsz))
+ libc.Xmemcpy(tls, pOut, (*MemFile)(unsafe.Pointer(p)).FaData, uint64((*MemFile)(unsafe.Pointer(p)).Fsz))
}
}
return pOut
@@ -24100,7 +25037,7 @@ func Xsqlite3_serialize(tls *crt.TLS, db uintptr, zSchema uintptr, piSize uintpt
return uintptr(0)
}
szPage = Xsqlite3BtreeGetPageSize(tls, pBt)
- zSql = Xsqlite3_mprintf(tls, ts+3373 /* "PRAGMA \"%w\".page..." */, crt.VaList(bp, zSchema))
+ zSql = Xsqlite3_mprintf(tls, ts+5508 /* "PRAGMA \"%w\".page..." */, libc.VaList(bp, zSchema))
if zSql != 0 {
rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+8 /* &pStmt */, uintptr(0))
} else {
@@ -24131,9 +25068,9 @@ func Xsqlite3_serialize(tls *crt.TLS, db uintptr, zSchema uintptr, piSize uintpt
var pTo uintptr = (pOut + uintptr((Sqlite3_int64(szPage) * (Sqlite3_int64(pgno - 1)))))
rc = Xsqlite3PagerGet(tls, pPager, uint32(pgno), bp+16 /* &pPage */, 0)
if rc == 0 {
- crt.Xmemcpy(tls, pTo, Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pPage */))), uint64(szPage))
+ libc.Xmemcpy(tls, pTo, Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pPage */))), uint64(szPage))
} else {
- crt.Xmemset(tls, pTo, 0, uint64(szPage))
+ libc.Xmemset(tls, pTo, 0, uint64(szPage))
}
Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pPage */)))
}
@@ -24145,7 +25082,7 @@ func Xsqlite3_serialize(tls *crt.TLS, db uintptr, zSchema uintptr, piSize uintpt
}
// Convert zSchema to a MemDB and initialize its content.
-func Xsqlite3_deserialize(tls *crt.TLS, db uintptr, zSchema uintptr, pData uintptr, szDb Sqlite3_int64, szBuf Sqlite3_int64, mFlags uint32) int32 { /* sqlite3.c:48296:16: */
+func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uintptr, szDb Sqlite3_int64, szBuf Sqlite3_int64, mFlags uint32) int32 { /* sqlite3.c:48384:16: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -24172,7 +25109,7 @@ __1:
goto end_deserialize
__2:
;
- zSql = Xsqlite3_mprintf(tls, ts+3396 /* "ATTACH x AS %Q" */, crt.VaList(bp, zSchema))
+ zSql = Xsqlite3_mprintf(tls, ts+5531 /* "ATTACH x AS %Q" */, libc.VaList(bp, zSchema))
rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+8 /* &pStmt */, uintptr(0))
Xsqlite3_free(tls, zSql)
if !(rc != 0) {
@@ -24182,9 +25119,9 @@ __2:
__3:
;
(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(iDb)
- crt.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.reopenMemdb */, uint32(1), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.reopenMemdb */, uint32(1), 2, 0x4)
rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))
- crt.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.reopenMemdb */, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.reopenMemdb */, uint32(0), 2, 0x4)
if !(rc != 101) {
goto __4
}
@@ -24222,7 +25159,7 @@ end_deserialize:
// This routine is called when the extension is loaded.
// Register the new VFS.
-func Xsqlite3MemdbInit(tls *crt.TLS) int32 { /* sqlite3.c:48362:20: */
+func Xsqlite3MemdbInit(tls *libc.TLS) int32 { /* sqlite3.c:48450:20: */
var pLower uintptr = Xsqlite3_vfs_find(tls, uintptr(0))
var sz int32 = (*Sqlite3_vfs)(unsafe.Pointer(pLower)).FszOsFile
memdb_vfs.FpAppData = pLower
@@ -24240,7 +25177,7 @@ func Xsqlite3MemdbInit(tls *crt.TLS) int32 { /* sqlite3.c:48362:20: */
// Create a new bitmap object able to handle bits between 0 and iSize,
// inclusive. Return a pointer to the new object. Return NULL if
// malloc fails.
-func Xsqlite3BitvecCreate(tls *crt.TLS, iSize U32) uintptr { /* sqlite3.c:48492:23: */
+func Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr { /* sqlite3.c:48580:23: */
var p uintptr
p = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Bitvec{})))
@@ -24253,7 +25190,7 @@ func Xsqlite3BitvecCreate(tls *crt.TLS, iSize U32) uintptr { /* sqlite3.c:48492:
// Check to see if the i-th bit is set. Return true or false.
// If p is NULL (if the bitmap has not been created) or if
// i is out of range, then return false.
-func Xsqlite3BitvecTestNotNull(tls *crt.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48507:20: */
+func Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48595:20: */
i--
if i >= (*Bitvec)(unsafe.Pointer(p)).FiSize {
@@ -24268,9 +25205,9 @@ func Xsqlite3BitvecTestNotNull(tls *crt.TLS, p uintptr, i U32) int32 { /* sqlite
}
}
if uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) <= (((((uint64(512) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U8(0)))) * uint64(8)) {
- return (crt.Bool32((int32(*(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(8)))))) & (int32(1) << (i & (U32(8 - 1))))) != 0))
+ return (libc.Bool32((int32(*(*U8)(unsafe.Pointer((p + 16 /* &.u */ /* &.aBitmap */) + uintptr((i / U32(8)))))) & (int32(1) << (i & (U32(8 - 1))))) != 0))
} else {
- var h U32 = (U32((uint64((crt.PostIncUint32(&i, 1)) * U32(1))) % ((((uint64(512) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))))
+ var h U32 = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((uint64(512) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))))
for *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) != 0 {
if *(*U32)(unsafe.Pointer((p + 16 /* &.u */ /* &.aHash */) + uintptr(h)*4)) == i {
return 1
@@ -24281,8 +25218,8 @@ func Xsqlite3BitvecTestNotNull(tls *crt.TLS, p uintptr, i U32) int32 { /* sqlite
}
return int32(0)
}
-func Xsqlite3BitvecTest(tls *crt.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48530:20: */
- return (crt.Bool32((p != uintptr(0)) && (Xsqlite3BitvecTestNotNull(tls, p, i) != 0)))
+func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48618:20: */
+ return (libc.Bool32((p != uintptr(0)) && (Xsqlite3BitvecTestNotNull(tls, p, i) != 0)))
}
// Set the i-th bit. Return 0 on success and an error code if
@@ -24295,7 +25232,7 @@ func Xsqlite3BitvecTest(tls *crt.TLS, p uintptr, i U32) int32 { /* sqlite3.c:485
// The calling function must ensure that p is a valid Bitvec object
// and that the value for "i" is within range of the Bitvec object.
// Otherwise the behavior is undefined.
-func Xsqlite3BitvecSet(tls *crt.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48546:20: */
+func Xsqlite3BitvecSet(tls *libc.TLS, p uintptr, i U32) int32 { /* sqlite3.c:48634:20: */
var h U32
var bin U32
var j uint32
@@ -24338,7 +25275,7 @@ __3:
return 0
__6:
;
- h = (U32((uint64((crt.PostIncUint32(&i, 1)) * U32(1))) % ((((uint64(512) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))))
+ h = (U32((uint64((libc.PostIncUint32(&i, 1)) * U32(1))) % ((((uint64(512) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0))))))
// if there wasn't a hash collision, and this doesn't
// completely fill the hash, then just add it without
// worring about sub-dividing and re-hashing.
@@ -24394,8 +25331,8 @@ bitvec_set_rehash:
return 7
goto __17
__16:
- crt.Xmemcpy(tls, aiValues, p+16 /* &.u */ /* &.aHash */, uint64(unsafe.Sizeof([124]U32{})))
- crt.Xmemset(tls, p+16 /* &.u */ /* &.apSub */, 0, uint64(unsafe.Sizeof([62]uintptr{})))
+ libc.Xmemcpy(tls, aiValues, p+16 /* &.u */ /* &.aHash */, uint64(unsafe.Sizeof([124]U32{})))
+ libc.Xmemset(tls, p+16 /* &.u */ /* &.apSub */, 0, uint64(unsafe.Sizeof([62]uintptr{})))
(*Bitvec)(unsafe.Pointer(p)).FiDivisor = (U32(((uint64((*Bitvec)(unsafe.Pointer(p)).FiSize) + ((((uint64(512) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0))))) - uint64(1)) / ((((uint64(512) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(uintptr(0))))))
rc = Xsqlite3BitvecSet(tls, p, i)
j = uint32(0)
@@ -24432,7 +25369,7 @@ bitvec_set_end:
//
// pBuf must be a pointer to at least BITVEC_SZ bytes of temporary storage
// that BitvecClear can use to rebuilt its hash table.
-func Xsqlite3BitvecClear(tls *crt.TLS, p uintptr, i U32, pBuf uintptr) { /* sqlite3.c:48617:21: */
+func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr) { /* sqlite3.c:48705:21: */
if p == uintptr(0) {
return
}
@@ -24451,8 +25388,8 @@ func Xsqlite3BitvecClear(tls *crt.TLS, p uintptr, i U32, pBuf uintptr) { /* sqli
} else {
var j uint32
var aiValues uintptr = pBuf
- crt.Xmemcpy(tls, aiValues, p+16 /* &.u */ /* &.aHash */, uint64(unsafe.Sizeof([124]U32{})))
- crt.Xmemset(tls, p+16 /* &.u */ /* &.aHash */, 0, uint64(unsafe.Sizeof([124]U32{})))
+ libc.Xmemcpy(tls, aiValues, p+16 /* &.u */ /* &.aHash */, uint64(unsafe.Sizeof([124]U32{})))
+ libc.Xmemset(tls, p+16 /* &.u */ /* &.aHash */, 0, uint64(unsafe.Sizeof([124]U32{})))
(*Bitvec)(unsafe.Pointer(p)).FnSet = U32(0)
for j = uint32(0); uint64(j) < ((((uint64(512) - (uint64(3) * uint64(unsafe.Sizeof(U32(0))))) / uint64(unsafe.Sizeof(uintptr(0)))) * uint64(unsafe.Sizeof(uintptr(0)))) / uint64(unsafe.Sizeof(U32(0)))); j++ {
if (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != 0) && (*(*U32)(unsafe.Pointer(aiValues + uintptr(j)*4)) != (i + U32(1))) {
@@ -24471,7 +25408,7 @@ func Xsqlite3BitvecClear(tls *crt.TLS, p uintptr, i U32, pBuf uintptr) { /* sqli
}
// Destroy a bitmap object. Reclaim all memory used.
-func Xsqlite3BitvecDestroy(tls *crt.TLS, p uintptr) { /* sqlite3.c:48654:21: */
+func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:48742:21: */
if p == uintptr(0) {
return
}
@@ -24486,7 +25423,7 @@ func Xsqlite3BitvecDestroy(tls *crt.TLS, p uintptr) { /* sqlite3.c:48654:21: */
// Return the value of the iSize parameter specified when Bitvec *p
// was created.
-func Xsqlite3BitvecSize(tls *crt.TLS, p uintptr) U32 { /* sqlite3.c:48669:20: */
+func Xsqlite3BitvecSize(tls *libc.TLS, p uintptr) U32 { /* sqlite3.c:48757:20: */
return (*Bitvec)(unsafe.Pointer(p)).FiSize
}
@@ -24523,7 +25460,7 @@ func Xsqlite3BitvecSize(tls *crt.TLS, p uintptr) U32 { /* sqlite3.c:48669:20: */
// an error is returned. If they are the same, zero is returned.
//
// If a memory allocation error occurs, return -1.
-func Xsqlite3BitvecBuiltinTest(tls *crt.TLS, sz int32, aOp uintptr) int32 { /* sqlite3.c:48714:20: */
+func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32 { /* sqlite3.c:48802:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -24559,7 +25496,7 @@ __1:
// Run the program
pc = 0
__2:
- if !((crt.AssignInt32(&op, *(*int32)(unsafe.Pointer(aOp + uintptr(pc)*4)))) != 0) {
+ if !((libc.AssignInt32(&op, *(*int32)(unsafe.Pointer(aOp + uintptr(pc)*4)))) != 0) {
goto __3
}
switch op {
@@ -24592,7 +25529,7 @@ __10:
goto __4
__4:
;
- if !((crt.PreDecInt32(&*(*int32)(unsafe.Pointer(aOp + uintptr((pc+1))*4)), 1)) > 0) {
+ if !((libc.PreDecInt32(&*(*int32)(unsafe.Pointer(aOp + uintptr((pc+1))*4)), 1)) > 0) {
goto __11
}
nx = 0
@@ -24637,7 +25574,7 @@ __16:
if !(*(*int32)(unsafe.Pointer(bp /* i */)) <= sz) {
goto __18
}
- if !((crt.Bool32((int32(*(*uint8)(unsafe.Pointer(pV + uintptr((*(*int32)(unsafe.Pointer(bp /* i */)) >> 3))))) & (int32(1) << (*(*int32)(unsafe.Pointer(bp /* i */)) & 7))) != 0)) != Xsqlite3BitvecTest(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp /* i */))))) {
+ if !((libc.Bool32((int32(*(*uint8)(unsafe.Pointer(pV + uintptr((*(*int32)(unsafe.Pointer(bp /* i */)) >> 3))))) & (int32(1) << (*(*int32)(unsafe.Pointer(bp /* i */)) & 7))) != 0)) != Xsqlite3BitvecTest(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp /* i */))))) {
goto __19
}
rc = *(*int32)(unsafe.Pointer(bp /* i */))
@@ -24684,7 +25621,7 @@ bitvec_end:
// argument determines what operation to do. The 0x01 bit means first
// remove pPage from the dirty list. The 0x02 means add pPage back to
// the dirty list. Doing both moves pPage to the front of the dirty list.
-func pcacheManageDirtyList(tls *crt.TLS, pPage uintptr, addRemove U8) { /* sqlite3.c:48949:13: */
+func pcacheManageDirtyList(tls *libc.TLS, pPage uintptr, addRemove U8) { /* sqlite3.c:49037:13: */
var p uintptr = (*PgHdr)(unsafe.Pointer(pPage)).FpCache
if (int32(addRemove) & 1) != 0 {
@@ -24746,16 +25683,16 @@ func pcacheManageDirtyList(tls *crt.TLS, pPage uintptr, addRemove U8) { /* sqlit
// Wrapper around the pluggable caches xUnpin method. If the cache is
// being used for an in-memory database, this function is a no-op.
-func pcacheUnpin(tls *crt.TLS, p uintptr) { /* sqlite3.c:49019:13: */
+func pcacheUnpin(tls *libc.TLS, p uintptr) { /* sqlite3.c:49107:13: */
if (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FbPurgeable != 0 {
- (*(*func(*crt.TLS, uintptr, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 64 /* &.xUnpin */))))(tls, (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, 0)
+ (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 64 /* &.xUnpin */))))(tls, (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, 0)
}
}
// Compute the number of pages of cache requested. p->szCache is the
// cache size requested by the "PRAGMA cache_size" statement.
-func numberOfCachePages(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:49031:12: */
+func numberOfCachePages(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:49119:12: */
if (*PCache)(unsafe.Pointer(p)).FszCache >= 0 {
// IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the
// suggested cache size is set to N.
@@ -24775,24 +25712,24 @@ func numberOfCachePages(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:49031:12:
//
// Initialize and shutdown the page cache subsystem. Neither of these
// functions are threadsafe.
-func Xsqlite3PcacheInitialize(tls *crt.TLS) int32 { /* sqlite3.c:49050:20: */
+func Xsqlite3PcacheInitialize(tls *libc.TLS) int32 { /* sqlite3.c:49138:20: */
if Xsqlite3Config.Fpcache2.FxInit == uintptr(0) {
// IMPLEMENTATION-OF: R-26801-64137 If the xInit() method is NULL, then the
// built-in default page cache is used instead of the application defined
// page cache.
Xsqlite3PCacheSetDefault(tls)
}
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 16 /* &.xInit */))))(tls, Xsqlite3Config.Fpcache2.FpArg)
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 16 /* &.xInit */))))(tls, Xsqlite3Config.Fpcache2.FpArg)
}
-func Xsqlite3PcacheShutdown(tls *crt.TLS) { /* sqlite3.c:49060:21: */
+func Xsqlite3PcacheShutdown(tls *libc.TLS) { /* sqlite3.c:49148:21: */
if Xsqlite3Config.Fpcache2.FxShutdown != 0 {
// IMPLEMENTATION-OF: R-26000-56589 The xShutdown() method may be NULL.
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 24 /* &.xShutdown */))))(tls, Xsqlite3Config.Fpcache2.FpArg)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 24 /* &.xShutdown */))))(tls, Xsqlite3Config.Fpcache2.FpArg)
}
}
// Return the size in bytes of a PCache object.
-func Xsqlite3PcacheSize(tls *crt.TLS) int32 { /* sqlite3.c:49070:20: */
+func Xsqlite3PcacheSize(tls *libc.TLS) int32 { /* sqlite3.c:49158:20: */
return int32(unsafe.Sizeof(PCache{}))
}
@@ -24806,8 +25743,8 @@ func Xsqlite3PcacheSize(tls *crt.TLS) int32 { /* sqlite3.c:49070:20: */
// but remaining content will be uninitialized. Though it is opaque
// to this module, the extra space really ends up being the MemPage
// structure in the pager.
-func Xsqlite3PcacheOpen(tls *crt.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) int32 { /* sqlite3.c:49084:20: */
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PCache{})))
+func Xsqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) int32 { /* sqlite3.c:49172:20: */
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PCache{})))
(*PCache)(unsafe.Pointer(p)).FszPage = 1
(*PCache)(unsafe.Pointer(p)).FszExtra = szExtra
// First 8 bytes will be zeroed
@@ -24823,19 +25760,19 @@ func Xsqlite3PcacheOpen(tls *crt.TLS, szPage int32, szExtra int32, bPurgeable in
// Change the page size for PCache object. The caller must ensure that there
// are no outstanding page references when this function is called.
-func Xsqlite3PcacheSetPageSize(tls *crt.TLS, pCache uintptr, szPage int32) int32 { /* sqlite3.c:49110:20: */
+func Xsqlite3PcacheSetPageSize(tls *libc.TLS, pCache uintptr, szPage int32) int32 { /* sqlite3.c:49198:20: */
if (*PCache)(unsafe.Pointer(pCache)).FszPage != 0 {
var pNew uintptr
- pNew = (*(*func(*crt.TLS, int32, int32, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 32 /* &.xCreate */))))(tls,
- szPage, (int32(uint64((*PCache)(unsafe.Pointer(pCache)).FszExtra) + (((uint64(unsafe.Sizeof(PgHdr{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))))),
+ pNew = (*(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 32 /* &.xCreate */))))(tls,
+ szPage, (int32(uint64((*PCache)(unsafe.Pointer(pCache)).FszExtra) + (((uint64(unsafe.Sizeof(PgHdr{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))))),
int32((*PCache)(unsafe.Pointer(pCache)).FbPurgeable))
if pNew == uintptr(0) {
return 7
}
- (*(*func(*crt.TLS, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 40 /* &.xCachesize */))))(tls, pNew, numberOfCachePages(tls, pCache))
+ (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 40 /* &.xCachesize */))))(tls, pNew, numberOfCachePages(tls, pCache))
if (*PCache)(unsafe.Pointer(pCache)).FpCache != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 88 /* &.xDestroy */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 88 /* &.xDestroy */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
}
(*PCache)(unsafe.Pointer(pCache)).FpCache = pNew
(*PCache)(unsafe.Pointer(pCache)).FszPage = szPage
@@ -24865,7 +25802,7 @@ func Xsqlite3PcacheSetPageSize(tls *crt.TLS, pCache uintptr, szPage int32) int32
// they can both (usually) operate without having to push values to
// the stack on entry and pop them back off on exit, which saves a
// lot of pushing and popping.
-func Xsqlite3PcacheFetch(tls *crt.TLS, pCache uintptr, pgno Pgno, createFlag int32) uintptr { /* sqlite3.c:49154:36: */
+func Xsqlite3PcacheFetch(tls *libc.TLS, pCache uintptr, pgno Pgno, createFlag int32) uintptr { /* sqlite3.c:49242:36: */
var eCreate int32
var pRes uintptr
@@ -24877,7 +25814,7 @@ func Xsqlite3PcacheFetch(tls *crt.TLS, pCache uintptr, pgno Pgno, createFlag int
// (createFlag==1 AND !(bPurgeable AND pDirty)
eCreate = (createFlag & int32((*PCache)(unsafe.Pointer(pCache)).FeCreate))
- pRes = (*(*func(*crt.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 56 /* &.xFetch */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, pgno, eCreate)
+ pRes = (*(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 56 /* &.xFetch */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, pgno, eCreate)
return pRes
}
@@ -24891,7 +25828,7 @@ func Xsqlite3PcacheFetch(tls *crt.TLS, pCache uintptr, pgno Pgno, createFlag int
// an OOM error.
//
// This routine should be invoked only after sqlite3PcacheFetch() fails.
-func Xsqlite3PcacheFetchStress(tls *crt.TLS, pCache uintptr, pgno Pgno, ppPage uintptr) int32 { /* sqlite3.c:49195:20: */
+func Xsqlite3PcacheFetchStress(tls *libc.TLS, pCache uintptr, pgno Pgno, ppPage uintptr) int32 { /* sqlite3.c:49283:20: */
var pPg uintptr
if int32((*PCache)(unsafe.Pointer(pCache)).FeCreate) == 2 {
return 0
@@ -24917,14 +25854,14 @@ func Xsqlite3PcacheFetchStress(tls *crt.TLS, pCache uintptr, pgno Pgno, ppPage u
if pPg != 0 {
var rc int32
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pCache + 48 /* &.xStress */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpStress, pPg)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pCache + 48 /* &.xStress */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpStress, pPg)
if (rc != 0) && (rc != 5) {
return rc
}
}
}
- *(*uintptr)(unsafe.Pointer(ppPage)) = (*(*func(*crt.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 56 /* &.xFetch */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, pgno, 2)
+ *(*uintptr)(unsafe.Pointer(ppPage)) = (*(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 56 /* &.xFetch */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, pgno, 2)
if *(*uintptr)(unsafe.Pointer(ppPage)) == uintptr(0) {
return 7
}
@@ -24938,16 +25875,16 @@ func Xsqlite3PcacheFetchStress(tls *crt.TLS, pCache uintptr, pgno Pgno, ppPage u
// This routine is broken out into a separate function since it
// requires extra stack manipulation that can be avoided in the common
// case.
-func pcacheFetchFinishWithInit(tls *crt.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:49251:30: */
+func pcacheFetchFinishWithInit(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:49339:30: */
var pPgHdr uintptr
pPgHdr = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpExtra
- crt.Xmemset(tls, (pPgHdr + 32 /* &.pDirty */), 0, (uint64(unsafe.Sizeof(PgHdr{})) - (uint64((uintptr(0) + 32 /* &.pDirty */)))))
+ libc.Xmemset(tls, (pPgHdr + 32 /* &.pDirty */), 0, (uint64(unsafe.Sizeof(PgHdr{})) - (uint64((uintptr(0) + 32 /* &.pDirty */)))))
(*PgHdr)(unsafe.Pointer(pPgHdr)).FpPage = pPage
(*PgHdr)(unsafe.Pointer(pPgHdr)).FpData = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpBuf
(*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra = (pPgHdr + uintptr(1)*72)
- crt.Xmemset(tls, (*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra, 0, uint64(8))
+ libc.Xmemset(tls, (*PgHdr)(unsafe.Pointer(pPgHdr)).FpExtra, 0, uint64(8))
(*PgHdr)(unsafe.Pointer(pPgHdr)).FpCache = pCache
(*PgHdr)(unsafe.Pointer(pPgHdr)).Fpgno = pgno
(*PgHdr)(unsafe.Pointer(pPgHdr)).Fflags = U16(0x001)
@@ -24958,7 +25895,7 @@ func pcacheFetchFinishWithInit(tls *crt.TLS, pCache uintptr, pgno Pgno, pPage ui
// sqlite3PcacheFetch() into an initialized PgHdr object. This routine
// must be called after sqlite3PcacheFetch() in order to get a usable
// result.
-func Xsqlite3PcacheFetchFinish(tls *crt.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:49277:22: */
+func Xsqlite3PcacheFetchFinish(tls *libc.TLS, pCache uintptr, pgno Pgno, pPage uintptr) uintptr { /* sqlite3.c:49365:22: */
var pPgHdr uintptr
pPgHdr = (*Sqlite3_pcache_page)(unsafe.Pointer(pPage)).FpExtra
@@ -24974,10 +25911,10 @@ func Xsqlite3PcacheFetchFinish(tls *crt.TLS, pCache uintptr, pgno Pgno, pPage ui
// Decrement the reference count on a page. If the page is clean and the
// reference count drops to 0, then it is made eligible for recycling.
-func Xsqlite3PcacheRelease(tls *crt.TLS, p uintptr) { /* sqlite3.c:49300:37: */
+func Xsqlite3PcacheRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:49388:37: */
(*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum--
- if (int32(crt.PreDecInt16(&(*PgHdr)(unsafe.Pointer(p)).FnRef, 1))) == 0 {
+ if (int32(libc.PreDecInt16(&(*PgHdr)(unsafe.Pointer(p)).FnRef, 1))) == 0 {
if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & 0x001) != 0 {
pcacheUnpin(tls, p)
} else {
@@ -24987,7 +25924,7 @@ func Xsqlite3PcacheRelease(tls *crt.TLS, p uintptr) { /* sqlite3.c:49300:37: */
}
// Increase the reference count of a supplied page by 1.
-func Xsqlite3PcacheRef(tls *crt.TLS, p uintptr) { /* sqlite3.c:49315:21: */
+func Xsqlite3PcacheRef(tls *libc.TLS, p uintptr) { /* sqlite3.c:49403:21: */
(*PgHdr)(unsafe.Pointer(p)).FnRef++
(*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum++
@@ -24996,21 +25933,21 @@ func Xsqlite3PcacheRef(tls *crt.TLS, p uintptr) { /* sqlite3.c:49315:21: */
// Drop a page from the cache. There must be exactly one reference to the
// page. This function deletes that reference, so after it returns the
// page pointed to by p is invalid.
-func Xsqlite3PcacheDrop(tls *crt.TLS, p uintptr) { /* sqlite3.c:49327:21: */
+func Xsqlite3PcacheDrop(tls *libc.TLS, p uintptr) { /* sqlite3.c:49415:21: */
if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & 0x002) != 0 {
pcacheManageDirtyList(tls, p, uint8(1))
}
(*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FnRefSum--
- (*(*func(*crt.TLS, uintptr, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 64 /* &.xUnpin */))))(tls, (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, 1)
+ (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 64 /* &.xUnpin */))))(tls, (*PCache)(unsafe.Pointer((*PgHdr)(unsafe.Pointer(p)).FpCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, 1)
}
// Make sure the page is marked as dirty. If it isn't dirty already,
// make it so.
-func Xsqlite3PcacheMakeDirty(tls *crt.TLS, p uintptr) { /* sqlite3.c:49341:21: */
+func Xsqlite3PcacheMakeDirty(tls *libc.TLS, p uintptr) { /* sqlite3.c:49429:21: */
if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & (0x001 | 0x010)) != 0 { //OPTIMIZATION-IF-FALSE
- *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x010))))
+ *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x010))))
if (int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & 0x001) != 0 {
*(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) ^= U16((0x002 | 0x001))
@@ -25021,10 +25958,10 @@ func Xsqlite3PcacheMakeDirty(tls *crt.TLS, p uintptr) { /* sqlite3.c:49341:21: *
// Make sure the page is marked as clean. If it isn't clean already,
// make it so.
-func Xsqlite3PcacheMakeClean(tls *crt.TLS, p uintptr) { /* sqlite3.c:49360:21: */
+func Xsqlite3PcacheMakeClean(tls *libc.TLS, p uintptr) { /* sqlite3.c:49448:21: */
pcacheManageDirtyList(tls, p, uint8(1))
- *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(((0x002 | 0x008) | 0x004)))))
+ *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(((0x002 | 0x008) | 0x004)))))
*(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) |= U16((0x001))
if int32((*PgHdr)(unsafe.Pointer(p)).FnRef) == 0 {
@@ -25033,38 +25970,38 @@ func Xsqlite3PcacheMakeClean(tls *crt.TLS, p uintptr) { /* sqlite3.c:49360:21: *
}
// Make every page in the cache clean.
-func Xsqlite3PcacheCleanAll(tls *crt.TLS, pCache uintptr) { /* sqlite3.c:49377:21: */
+func Xsqlite3PcacheCleanAll(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49465:21: */
var p uintptr
- for (crt.AssignUintptr(&p, (*PCache)(unsafe.Pointer(pCache)).FpDirty)) != uintptr(0) {
+ for (libc.AssignUintptr(&p, (*PCache)(unsafe.Pointer(pCache)).FpDirty)) != uintptr(0) {
Xsqlite3PcacheMakeClean(tls, p)
}
}
// Clear the PGHDR_NEED_SYNC and PGHDR_WRITEABLE flag from all dirty pages.
-func Xsqlite3PcacheClearWritable(tls *crt.TLS, pCache uintptr) { /* sqlite3.c:49388:21: */
+func Xsqlite3PcacheClearWritable(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49476:21: */
var p uintptr
for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext {
- *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32((0x008 | 0x004)))))
+ *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32((0x008 | 0x004)))))
}
(*PCache)(unsafe.Pointer(pCache)).FpSynced = (*PCache)(unsafe.Pointer(pCache)).FpDirtyTail
}
// Clear the PGHDR_NEED_SYNC flag from all dirty pages.
-func Xsqlite3PcacheClearSyncFlags(tls *crt.TLS, pCache uintptr) { /* sqlite3.c:49400:21: */
+func Xsqlite3PcacheClearSyncFlags(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49488:21: */
var p uintptr
for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext {
- *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x008))))
+ *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x008))))
}
(*PCache)(unsafe.Pointer(pCache)).FpSynced = (*PCache)(unsafe.Pointer(pCache)).FpDirtyTail
}
// Change the page number of page p to newPgno.
-func Xsqlite3PcacheMove(tls *crt.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:49411:21: */
+func Xsqlite3PcacheMove(tls *libc.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:49499:21: */
var pCache uintptr = (*PgHdr)(unsafe.Pointer(p)).FpCache
- (*(*func(*crt.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 72 /* &.xRekey */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, (*PgHdr)(unsafe.Pointer(p)).Fpgno, newPgno)
+ (*(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 72 /* &.xRekey */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, (*PgHdr)(unsafe.Pointer(p)).FpPage, (*PgHdr)(unsafe.Pointer(p)).Fpgno, newPgno)
(*PgHdr)(unsafe.Pointer(p)).Fpgno = newPgno
if ((int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & 0x002) != 0) && ((int32((*PgHdr)(unsafe.Pointer(p)).Fflags) & 0x008) != 0) {
pcacheManageDirtyList(tls, p, uint8(3))
@@ -25078,7 +26015,7 @@ func Xsqlite3PcacheMove(tls *crt.TLS, p uintptr, newPgno Pgno) { /* sqlite3.c:49
// If there is a reference to page 1 and the pgno parameter passed to this
// function is 0, then the data area associated with page 1 is zeroed, but
// the page object is not dropped.
-func Xsqlite3PcacheTruncate(tls *crt.TLS, pCache uintptr, pgno Pgno) { /* sqlite3.c:49433:21: */
+func Xsqlite3PcacheTruncate(tls *libc.TLS, pCache uintptr, pgno Pgno) { /* sqlite3.c:49521:21: */
if (*PCache)(unsafe.Pointer(pCache)).FpCache != 0 {
var p uintptr
var pNext uintptr
@@ -25096,31 +26033,31 @@ func Xsqlite3PcacheTruncate(tls *crt.TLS, pCache uintptr, pgno Pgno) { /* sqlite
}
if (pgno == Pgno(0)) && ((*PCache)(unsafe.Pointer(pCache)).FnRefSum != 0) {
var pPage1 uintptr
- pPage1 = (*(*func(*crt.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 56 /* &.xFetch */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, uint32(1), 0)
+ pPage1 = (*(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 56 /* &.xFetch */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, uint32(1), 0)
if pPage1 != 0 { // Page 1 is always available in cache, because
// pCache->nRefSum>0
- crt.Xmemset(tls, (*Sqlite3_pcache_page)(unsafe.Pointer(pPage1)).FpBuf, 0, uint64((*PCache)(unsafe.Pointer(pCache)).FszPage))
+ libc.Xmemset(tls, (*Sqlite3_pcache_page)(unsafe.Pointer(pPage1)).FpBuf, 0, uint64((*PCache)(unsafe.Pointer(pCache)).FszPage))
pgno = Pgno(1)
}
}
- (*(*func(*crt.TLS, uintptr, uint32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 80 /* &.xTruncate */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, (pgno + Pgno(1)))
+ (*(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 80 /* &.xTruncate */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache, (pgno + Pgno(1)))
}
}
// Close a cache.
-func Xsqlite3PcacheClose(tls *crt.TLS, pCache uintptr) { /* sqlite3.c:49466:21: */
+func Xsqlite3PcacheClose(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49554:21: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 88 /* &.xDestroy */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 88 /* &.xDestroy */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
}
// Discard the contents of the cache.
-func Xsqlite3PcacheClear(tls *crt.TLS, pCache uintptr) { /* sqlite3.c:49475:21: */
+func Xsqlite3PcacheClear(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49563:21: */
Xsqlite3PcacheTruncate(tls, pCache, uint32(0))
}
// Merge two lists of pages connected by pDirty and in pgno order.
// Do not bother fixing the pDirtyPrev pointers.
-func pcacheMergeDirtyList(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:49483:14: */
+func pcacheMergeDirtyList(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:49571:14: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -25159,7 +26096,7 @@ func pcacheMergeDirtyList(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* sql
// there cannot be more than 31 buckets required by the merge sorter.
// One extra bucket is added to catch overflow in case something
// ever changes to make the previous sentence incorrect.
-func pcacheSortDirtyList(tls *crt.TLS, pIn uintptr) uintptr { /* sqlite3.c:49520:14: */
+func pcacheSortDirtyList(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:49608:14: */
bp := tls.Alloc(256)
defer tls.Free(256)
@@ -25167,7 +26104,7 @@ func pcacheSortDirtyList(tls *crt.TLS, pIn uintptr) uintptr { /* sqlite3.c:49520
var p uintptr
var i int32
- crt.Xmemset(tls, bp /* &a[0] */, 0, uint64(unsafe.Sizeof([32]uintptr{})))
+ libc.Xmemset(tls, bp /* &a[0] */, 0, uint64(unsafe.Sizeof([32]uintptr{})))
for pIn != 0 {
p = pIn
pIn = (*PgHdr)(unsafe.Pointer(p)).FpDirty
@@ -25202,7 +26139,7 @@ func pcacheSortDirtyList(tls *crt.TLS, pIn uintptr) uintptr { /* sqlite3.c:49520
}
// Return a list of all dirty pages in the cache, sorted by page number.
-func Xsqlite3PcacheDirtyList(tls *crt.TLS, pCache uintptr) uintptr { /* sqlite3.c:49555:22: */
+func Xsqlite3PcacheDirtyList(tls *libc.TLS, pCache uintptr) uintptr { /* sqlite3.c:49643:22: */
var p uintptr
for p = (*PCache)(unsafe.Pointer(pCache)).FpDirty; p != 0; p = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext {
(*PgHdr)(unsafe.Pointer(p)).FpDirty = (*PgHdr)(unsafe.Pointer(p)).FpDirtyNext
@@ -25214,38 +26151,38 @@ func Xsqlite3PcacheDirtyList(tls *crt.TLS, pCache uintptr) uintptr { /* sqlite3.
//
// This is not the total number of pages referenced, but the sum of the
// reference count for all pages.
-func Xsqlite3PcacheRefCount(tls *crt.TLS, pCache uintptr) int32 { /* sqlite3.c:49569:20: */
+func Xsqlite3PcacheRefCount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:49657:20: */
return (*PCache)(unsafe.Pointer(pCache)).FnRefSum
}
// Return the number of references to the page supplied as an argument.
-func Xsqlite3PcachePageRefcount(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:49576:20: */
+func Xsqlite3PcachePageRefcount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:49664:20: */
return int32((*PgHdr)(unsafe.Pointer(p)).FnRef)
}
// Return the total number of pages in the cache.
-func Xsqlite3PcachePagecount(tls *crt.TLS, pCache uintptr) int32 { /* sqlite3.c:49583:20: */
+func Xsqlite3PcachePagecount(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:49671:20: */
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 48 /* &.xPagecount */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 48 /* &.xPagecount */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
}
// Get the suggested cache-size value.
-func Xsqlite3PcacheGetCachesize(tls *crt.TLS, pCache uintptr) int32 { /* sqlite3.c:49592:20: */
+func Xsqlite3PcacheGetCachesize(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:49680:20: */
return numberOfCachePages(tls, pCache)
}
// Set the suggested cache-size value.
-func Xsqlite3PcacheSetCachesize(tls *crt.TLS, pCache uintptr, mxPage int32) { /* sqlite3.c:49600:21: */
+func Xsqlite3PcacheSetCachesize(tls *libc.TLS, pCache uintptr, mxPage int32) { /* sqlite3.c:49688:21: */
(*PCache)(unsafe.Pointer(pCache)).FszCache = mxPage
- (*(*func(*crt.TLS, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 40 /* &.xCachesize */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache,
+ (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 40 /* &.xCachesize */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache,
numberOfCachePages(tls, pCache))
}
// Set the suggested cache-spill value. Make no changes if if the
// argument is zero. Return the effective cache-spill size, which will
// be the larger of the szSpill and szCache.
-func Xsqlite3PcacheSetSpillsize(tls *crt.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:49612:20: */
+func Xsqlite3PcacheSetSpillsize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:49700:20: */
var res int32
if mxPage != 0 {
@@ -25262,20 +26199,20 @@ func Xsqlite3PcacheSetSpillsize(tls *crt.TLS, p uintptr, mxPage int32) int32 { /
}
// Free up as much memory as possible from the page cache.
-func Xsqlite3PcacheShrink(tls *crt.TLS, pCache uintptr) { /* sqlite3.c:49629:21: */
+func Xsqlite3PcacheShrink(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:49717:21: */
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 96 /* &.xShrink */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3Config)) + 168 /* &.pcache2 */ + 96 /* &.xShrink */))))(tls, (*PCache)(unsafe.Pointer(pCache)).FpCache)
}
// Return the size of the header added by this middleware layer
// in the page-cache hierarchy.
-func Xsqlite3HeaderSizePcache(tls *crt.TLS) int32 { /* sqlite3.c:49638:20: */
- return (int32(((uint64(unsafe.Sizeof(PgHdr{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))))
+func Xsqlite3HeaderSizePcache(tls *libc.TLS) int32 { /* sqlite3.c:49726:20: */
+ return (int32(((uint64(unsafe.Sizeof(PgHdr{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))))
}
// Return the number of dirty pages currently in the cache, as a percentage
// of the configured cache size.
-func Xsqlite3PCachePercentDirty(tls *crt.TLS, pCache uintptr) int32 { /* sqlite3.c:49644:20: */
+func Xsqlite3PCachePercentDirty(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:49732:20: */
var pDirty uintptr
var nDirty int32 = 0
var nCache int32 = numberOfCachePages(tls, pCache)
@@ -25476,7 +26413,7 @@ type PCache11 = struct {
// common workloads.
// #include "sqliteInt.h"
-type PCache1 = PCache11 /* sqlite3.c:49761:24 */
+type PCache1 = PCache11 /* sqlite3.c:49849:24 */
type PgHdr11 = struct {
Fpage Sqlite3_pcache_page
FiKey uint32
@@ -25488,10 +26425,10 @@ type PgHdr11 = struct {
FpLruPrev uintptr
}
-type PgHdr1 = PgHdr11 /* sqlite3.c:49762:23 */
+type PgHdr1 = PgHdr11 /* sqlite3.c:49850:23 */
type PgFreeslot1 = struct{ FpNext uintptr }
-type PgFreeslot = PgFreeslot1 /* sqlite3.c:49763:27 */
+type PgFreeslot = PgFreeslot1 /* sqlite3.c:49851:27 */
type PGroup1 = struct {
Fmutex uintptr
FnMaxPage uint32
@@ -25501,7 +26438,7 @@ type PGroup1 = struct {
Flru PgHdr1
}
-type PGroup = PGroup1 /* sqlite3.c:49764:23 */
+type PGroup = PGroup1 /* sqlite3.c:49852:23 */
// Global data used by this cache.
type PCacheGlobal = struct {
@@ -25521,7 +26458,7 @@ type PCacheGlobal = struct {
}
// Global data used by this cache.
-var pcache1_g PCacheGlobal /* sqlite3.c:49905:3: */
+var pcache1_g PCacheGlobal /* sqlite3.c:49993:3: */
// All code in this file should access the global structure above via the
// alias "pcache1". This ensures that the WSD emulation is used when
@@ -25539,18 +26476,18 @@ var pcache1_g PCacheGlobal /* sqlite3.c:49905:3: */
//
// This routine is called from sqlite3_initialize() and so it is guaranteed
// to be serialized already. There is no need for further mutexing.
-func Xsqlite3PCacheBufferSetup(tls *crt.TLS, pBuf uintptr, sz int32, n int32) { /* sqlite3.c:49940:21: */
+func Xsqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { /* sqlite3.c:50028:21: */
if pcache1_g.FisInit != 0 {
var p uintptr
if pBuf == uintptr(0) {
- sz = crt.AssignInt32(&n, 0)
+ sz = libc.AssignInt32(&n, 0)
}
if n == 0 {
sz = 0
}
- sz = ((sz) & ^int32(crt.Int32FromInt32(7)))
+ sz = ((sz) & ^int32(libc.Int32FromInt32(7)))
pcache1_g.FszSlot = sz
- pcache1_g.FnSlot = crt.AssignPtrInt32(uintptr(unsafe.Pointer(&pcache1_g))+136 /* &.nFreeSlot */, n)
+ pcache1_g.FnSlot = libc.AssignPtrInt32(uintptr(unsafe.Pointer(&pcache1_g))+136 /* &.nFreeSlot */, n)
pcache1_g.FnReserve = func() int32 {
if n > 90 {
return 10
@@ -25560,7 +26497,7 @@ func Xsqlite3PCacheBufferSetup(tls *crt.TLS, pBuf uintptr, sz int32, n int32) {
pcache1_g.FpStart = pBuf
pcache1_g.FpFree = uintptr(0)
pcache1_g.FbUnderPressure = 0
- for crt.PostDecInt32(&n, 1) != 0 {
+ for libc.PostDecInt32(&n, 1) != 0 {
p = pBuf
(*PgFreeslot)(unsafe.Pointer(p)).FpNext = pcache1_g.FpFree
pcache1_g.FpFree = p
@@ -25572,7 +26509,7 @@ func Xsqlite3PCacheBufferSetup(tls *crt.TLS, pBuf uintptr, sz int32, n int32) {
// Try to initialize the pCache->pFree and pCache->pBulk fields. Return
// true if pCache->pFree ends up containing one or more free pages.
-func pcache1InitBulk(tls *crt.TLS, pCache uintptr) int32 { /* sqlite3.c:49966:12: */
+func pcache1InitBulk(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50054:12: */
var szBulk I64
var zBulk uintptr
if pcache1_g.FnInitPage == 0 {
@@ -25591,11 +26528,11 @@ func pcache1InitBulk(tls *crt.TLS, pCache uintptr) int32 { /* sqlite3.c:49966:12
if szBulk > (I64((*PCache1)(unsafe.Pointer(pCache)).FszAlloc) * I64((*PCache1)(unsafe.Pointer(pCache)).FnMax)) {
szBulk = (I64((*PCache1)(unsafe.Pointer(pCache)).FszAlloc) * I64((*PCache1)(unsafe.Pointer(pCache)).FnMax))
}
- zBulk = crt.AssignPtrUintptr(pCache+80 /* &.pBulk */, Xsqlite3Malloc(tls, uint64(szBulk)))
+ zBulk = libc.AssignPtrUintptr(pCache+80 /* &.pBulk */, Xsqlite3Malloc(tls, uint64(szBulk)))
Xsqlite3EndBenignMalloc(tls)
if zBulk != 0 {
var nBulk int32 = (Xsqlite3MallocSize(tls, zBulk) / (*PCache1)(unsafe.Pointer(pCache)).FszAlloc)
- for ok := true; ok; ok = crt.PreDecInt32(&nBulk, 1) != 0 {
+ for ok := true; ok; ok = libc.PreDecInt32(&nBulk, 1) != 0 {
var pX uintptr = (zBulk + uintptr((*PCache1)(unsafe.Pointer(pCache)).FszPage))
(*PgHdr1)(unsafe.Pointer(pX)).Fpage.FpBuf = zBulk
(*PgHdr1)(unsafe.Pointer(pX)).Fpage.FpExtra = (pX + uintptr(1)*56)
@@ -25607,7 +26544,7 @@ func pcache1InitBulk(tls *crt.TLS, pCache uintptr) int32 { /* sqlite3.c:49966:12
zBulk += uintptr((*PCache1)(unsafe.Pointer(pCache)).FszAlloc)
}
}
- return (crt.Bool32((*PCache1)(unsafe.Pointer(pCache)).FpFree != uintptr(0)))
+ return (libc.Bool32((*PCache1)(unsafe.Pointer(pCache)).FpFree != uintptr(0)))
}
// Malloc function used within this file to allocate space from the buffer
@@ -25617,7 +26554,7 @@ func pcache1InitBulk(tls *crt.TLS, pCache uintptr) int32 { /* sqlite3.c:49966:12
//
// Multiple threads can run this routine at the same time. Global variables
// in pcache1 need to be protected via mutex.
-func pcache1Alloc(tls *crt.TLS, nByte int32) uintptr { /* sqlite3.c:50009:13: */
+func pcache1Alloc(tls *libc.TLS, nByte int32) uintptr { /* sqlite3.c:50097:13: */
var p uintptr = uintptr(0)
if nByte <= pcache1_g.FszSlot {
@@ -25626,7 +26563,7 @@ func pcache1Alloc(tls *crt.TLS, nByte int32) uintptr { /* sqlite3.c:50009:13: */
if p != 0 {
pcache1_g.FpFree = (*PgFreeslot)(unsafe.Pointer(pcache1_g.FpFree)).FpNext
pcache1_g.FnFreeSlot--
- pcache1_g.FbUnderPressure = (crt.Bool32(pcache1_g.FnFreeSlot < pcache1_g.FnReserve))
+ pcache1_g.FbUnderPressure = (libc.Bool32(pcache1_g.FnFreeSlot < pcache1_g.FnReserve))
Xsqlite3StatusHighwater(tls, 7, nByte)
Xsqlite3StatusUp(tls, 1, 1)
@@ -25649,7 +26586,7 @@ func pcache1Alloc(tls *crt.TLS, nByte int32) uintptr { /* sqlite3.c:50009:13: */
}
// Free an allocated buffer obtained from pcache1Alloc().
-func pcache1Free(tls *crt.TLS, p uintptr) { /* sqlite3.c:50047:13: */
+func pcache1Free(tls *libc.TLS, p uintptr) { /* sqlite3.c:50135:13: */
if p == uintptr(0) {
return
}
@@ -25661,7 +26598,7 @@ func pcache1Free(tls *crt.TLS, p uintptr) { /* sqlite3.c:50047:13: */
(*PgFreeslot)(unsafe.Pointer(pSlot)).FpNext = pcache1_g.FpFree
pcache1_g.FpFree = pSlot
pcache1_g.FnFreeSlot++
- pcache1_g.FbUnderPressure = (crt.Bool32(pcache1_g.FnFreeSlot < pcache1_g.FnReserve))
+ pcache1_g.FbUnderPressure = (libc.Bool32(pcache1_g.FnFreeSlot < pcache1_g.FnReserve))
Xsqlite3_mutex_leave(tls, pcache1_g.Fmutex)
} else {
@@ -25677,8 +26614,22 @@ func pcache1Free(tls *crt.TLS, p uintptr) { /* sqlite3.c:50047:13: */
}
}
+// Return the size of a pcache allocation
+func pcache1MemSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50168:12: */
+ if (p >= pcache1_g.FpStart) && (p < pcache1_g.FpEnd) {
+ return pcache1_g.FszSlot
+ } else {
+ var iSize int32
+
+ iSize = Xsqlite3MallocSize(tls, p)
+
+ return iSize
+ }
+ return int32(0)
+}
+
// Allocate a new page object initially associated with cache pCache.
-func pcache1AllocPage(tls *crt.TLS, pCache uintptr, benignMalloc int32) uintptr { /* sqlite3.c:50097:15: */
+func pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) uintptr { /* sqlite3.c:50185:15: */
var p uintptr = uintptr(0)
var pPg uintptr
@@ -25688,6 +26639,11 @@ func pcache1AllocPage(tls *crt.TLS, pCache uintptr, benignMalloc int32) uintptr
(*PCache1)(unsafe.Pointer(pCache)).FpFree = (*PgHdr1)(unsafe.Pointer(p)).FpNext
(*PgHdr1)(unsafe.Pointer(p)).FpNext = uintptr(0)
} else {
+ // The group mutex must be released before pcache1Alloc() is called. This
+ // is because it might call sqlite3_release_memory(), which assumes that
+ // this mutex is not held.
+
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
if benignMalloc != 0 {
Xsqlite3BeginBenignMalloc(tls)
}
@@ -25695,6 +26651,7 @@ func pcache1AllocPage(tls *crt.TLS, pCache uintptr, benignMalloc int32) uintptr
if benignMalloc != 0 {
Xsqlite3EndBenignMalloc(tls)
}
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
if pPg == uintptr(0) {
return uintptr(0)
}
@@ -25709,7 +26666,7 @@ func pcache1AllocPage(tls *crt.TLS, pCache uintptr, benignMalloc int32) uintptr
}
// Free a page object allocated by pcache1AllocPage().
-func pcache1FreePage(tls *crt.TLS, p uintptr) { /* sqlite3.c:50148:13: */
+func pcache1FreePage(tls *libc.TLS, p uintptr) { /* sqlite3.c:50236:13: */
var pCache uintptr
pCache = (*PgHdr1)(unsafe.Pointer(p)).FpCache
@@ -25726,13 +26683,13 @@ func pcache1FreePage(tls *crt.TLS, p uintptr) { /* sqlite3.c:50148:13: */
// Malloc function used by SQLite to obtain space from the buffer configured
// using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no such buffer
// exists, this function falls back to sqlite3Malloc().
-func Xsqlite3PageMalloc(tls *crt.TLS, sz int32) uintptr { /* sqlite3.c:50170:21: */
+func Xsqlite3PageMalloc(tls *libc.TLS, sz int32) uintptr { /* sqlite3.c:50258:21: */
// These allocations are never very large
return pcache1Alloc(tls, sz)
}
// Free an allocated buffer obtained from sqlite3PageMalloc().
-func Xsqlite3PageFree(tls *crt.TLS, p uintptr) { /* sqlite3.c:50178:21: */
+func Xsqlite3PageFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:50266:21: */
pcache1Free(tls, p)
}
@@ -25750,7 +26707,7 @@ func Xsqlite3PageFree(tls *crt.TLS, p uintptr) { /* sqlite3.c:50178:21: */
// under memory pressure, then again it is desirable to avoid
// allocating a new page cache entry in order to avoid stressing
// the heap even further.
-func pcache1UnderMemoryPressure(tls *crt.TLS, pCache uintptr) int32 { /* sqlite3.c:50199:12: */
+func pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) int32 { /* sqlite3.c:50287:12: */
if (pcache1_g.FnSlot != 0) && (((*PCache1)(unsafe.Pointer(pCache)).FszPage + (*PCache1)(unsafe.Pointer(pCache)).FszExtra) <= pcache1_g.FszSlot) {
return pcache1_g.FbUnderPressure
} else {
@@ -25766,7 +26723,7 @@ func pcache1UnderMemoryPressure(tls *crt.TLS, pCache uintptr) int32 { /* sqlite3
// as the first argument.
//
// The PCache mutex must be held when this function is called.
-func pcache1ResizeHash(tls *crt.TLS, p uintptr) { /* sqlite3.c:50216:13: */
+func pcache1ResizeHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:50304:13: */
var apNew uintptr
var nNew uint32
var i uint32
@@ -25776,6 +26733,7 @@ func pcache1ResizeHash(tls *crt.TLS, p uintptr) { /* sqlite3.c:50216:13: */
nNew = uint32(256)
}
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex)
if (*PCache1)(unsafe.Pointer(p)).FnHash != 0 {
Xsqlite3BeginBenignMalloc(tls)
}
@@ -25783,12 +26741,12 @@ func pcache1ResizeHash(tls *crt.TLS, p uintptr) { /* sqlite3.c:50216:13: */
if (*PCache1)(unsafe.Pointer(p)).FnHash != 0 {
Xsqlite3EndBenignMalloc(tls)
}
-
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex)
if apNew != 0 {
for i = uint32(0); i < (*PCache1)(unsafe.Pointer(p)).FnHash; i++ {
var pPage uintptr
var pNext uintptr = *(*uintptr)(unsafe.Pointer((*PCache1)(unsafe.Pointer(p)).FapHash + uintptr(i)*8))
- for (crt.AssignUintptr(&pPage, pNext)) != uintptr(0) {
+ for (libc.AssignUintptr(&pPage, pNext)) != uintptr(0) {
var h uint32 = ((*PgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew)
pNext = (*PgHdr1)(unsafe.Pointer(pPage)).FpNext
(*PgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8))
@@ -25806,7 +26764,7 @@ func pcache1ResizeHash(tls *crt.TLS, p uintptr) { /* sqlite3.c:50216:13: */
// LRU list, then this function is a no-op.
//
// The PGroup mutex must be held when this function is called.
-func pcache1PinPage(tls *crt.TLS, pPage uintptr) uintptr { /* sqlite3.c:50257:15: */
+func pcache1PinPage(tls *libc.TLS, pPage uintptr) uintptr { /* sqlite3.c:50345:15: */
(*PgHdr1)(unsafe.Pointer((*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev)).FpLruNext = (*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext
(*PgHdr1)(unsafe.Pointer((*PgHdr1)(unsafe.Pointer(pPage)).FpLruNext)).FpLruPrev = (*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev
@@ -25823,7 +26781,7 @@ func pcache1PinPage(tls *crt.TLS, pPage uintptr) uintptr { /* sqlite3.c:50257:15
// Also free the page if freePage is true.
//
// The PGroup mutex must be held when this function is called.
-func pcache1RemoveFromHash(tls *crt.TLS, pPage uintptr, freeFlag int32) { /* sqlite3.c:50282:13: */
+func pcache1RemoveFromHash(tls *libc.TLS, pPage uintptr, freeFlag int32) { /* sqlite3.c:50370:13: */
var h uint32
var pCache uintptr = (*PgHdr1)(unsafe.Pointer(pPage)).FpCache
var pp uintptr
@@ -25841,19 +26799,19 @@ func pcache1RemoveFromHash(tls *crt.TLS, pPage uintptr, freeFlag int32) { /* sql
// If there are currently more than nMaxPage pages allocated, try
// to recycle pages to reduce the number allocated to nMaxPage.
-func pcache1EnforceMaxPage(tls *crt.TLS, pCache uintptr) { /* sqlite3.c:50300:13: */
+func pcache1EnforceMaxPage(tls *libc.TLS, pCache uintptr) { /* sqlite3.c:50388:13: */
var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
var p uintptr
for ((*PGroup)(unsafe.Pointer(pGroup)).FnPurgeable > (*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage) &&
- (int32((*PgHdr1)(unsafe.Pointer((crt.AssignUintptr(&p, (*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev)))).FisAnchor) == 0) {
+ (int32((*PgHdr1)(unsafe.Pointer((libc.AssignUintptr(&p, (*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev)))).FisAnchor) == 0) {
pcache1PinPage(tls, p)
pcache1RemoveFromHash(tls, p, 1)
}
if ((*PCache1)(unsafe.Pointer(pCache)).FnPage == uint32(0)) && ((*PCache1)(unsafe.Pointer(pCache)).FpBulk != 0) {
Xsqlite3_free(tls, (*PCache1)(unsafe.Pointer(pCache)).FpBulk)
- (*PCache1)(unsafe.Pointer(pCache)).FpBulk = crt.AssignPtrUintptr(pCache+72 /* &.pFree */, uintptr(0))
+ (*PCache1)(unsafe.Pointer(pCache)).FpBulk = libc.AssignPtrUintptr(pCache+72 /* &.pFree */, uintptr(0))
}
}
@@ -25862,7 +26820,7 @@ func pcache1EnforceMaxPage(tls *crt.TLS, pCache uintptr) { /* sqlite3.c:50300:13
// criteria are unpinned before they are discarded.
//
// The PCache mutex must be held when this function is called.
-func pcache1TruncateUnsafe(tls *crt.TLS, pCache uintptr, iLimit uint32) { /* sqlite3.c:50325:13: */
+func pcache1TruncateUnsafe(tls *libc.TLS, pCache uintptr, iLimit uint32) { /* sqlite3.c:50413:13: */
var h uint32
var iStop uint32
@@ -25884,7 +26842,7 @@ func pcache1TruncateUnsafe(tls *crt.TLS, pCache uintptr, iLimit uint32) { /* sql
var pPage uintptr
pp = ((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*8)
- for (crt.AssignUintptr(&pPage, *(*uintptr)(unsafe.Pointer(pp)))) != uintptr(0) {
+ for (libc.AssignUintptr(&pPage, *(*uintptr)(unsafe.Pointer(pp)))) != uintptr(0) {
if (*PgHdr1)(unsafe.Pointer(pPage)).FiKey >= iLimit {
(*PCache1)(unsafe.Pointer(pCache)).FnPage--
*(*uintptr)(unsafe.Pointer(pp)) = (*PgHdr1)(unsafe.Pointer(pPage)).FpNext
@@ -25908,10 +26866,10 @@ func pcache1TruncateUnsafe(tls *crt.TLS, pCache uintptr, iLimit uint32) { /* sql
//******* sqlite3_pcache Methods *********************************************
// Implementation of the sqlite3_pcache.xInit method.
-func pcache1Init(tls *crt.TLS, NotUsed uintptr) int32 { /* sqlite3.c:50376:12: */
+func pcache1Init(tls *libc.TLS, NotUsed uintptr) int32 { /* sqlite3.c:50464:12: */
_ = NotUsed
- crt.Xmemset(tls, uintptr(unsafe.Pointer(&pcache1_g)), 0, uint64(unsafe.Sizeof(pcache1_g)))
+ libc.Xmemset(tls, uintptr(unsafe.Pointer(&pcache1_g)), 0, uint64(unsafe.Sizeof(pcache1_g)))
// The pcache1.separateCache variable is true if each PCache has its own
// private PGroup (mode-1). pcache1.separateCache is false if the single
@@ -25925,8 +26883,7 @@ func pcache1Init(tls *crt.TLS, NotUsed uintptr) int32 { /* sqlite3.c:50376:12: *
// pBuf argument.
//
// * Otherwise use separate caches (mode-1)
- pcache1_g.FseparateCache = (crt.Bool32((Xsqlite3Config.FpPage == uintptr(0)) ||
- (int32(Xsqlite3Config.FbCoreMutex) > 0)))
+ pcache1_g.FseparateCache = 0
if Xsqlite3Config.FbCoreMutex != 0 {
pcache1_g.Fgrp.Fmutex = Xsqlite3MutexAlloc(tls, 6)
@@ -25947,16 +26904,16 @@ func pcache1Init(tls *crt.TLS, NotUsed uintptr) int32 { /* sqlite3.c:50376:12: *
// Implementation of the sqlite3_pcache.xShutdown method.
// Note that the static mutex allocated in xInit does
// not need to be freed.
-func pcache1Shutdown(tls *crt.TLS, NotUsed uintptr) { /* sqlite3.c:50429:13: */
+func pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { /* sqlite3.c:50517:13: */
_ = NotUsed
- crt.Xmemset(tls, uintptr(unsafe.Pointer(&pcache1_g)), 0, uint64(unsafe.Sizeof(pcache1_g)))
+ libc.Xmemset(tls, uintptr(unsafe.Pointer(&pcache1_g)), 0, uint64(unsafe.Sizeof(pcache1_g)))
}
// Implementation of the sqlite3_pcache.xCreate method.
//
// Allocate a new cache.
-func pcache1Create(tls *crt.TLS, szPage int32, szExtra int32, bPurgeable int32) uintptr { /* sqlite3.c:50443:23: */
+func pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) uintptr { /* sqlite3.c:50531:23: */
var pCache uintptr // The newly created page cache
var pGroup uintptr // The group the new page cache will belong to
var sz int32 // Bytes of memory required to allocate the new cache
@@ -25970,15 +26927,15 @@ func pcache1Create(tls *crt.TLS, szPage int32, szExtra int32, bPurgeable int32)
} else {
pGroup = (uintptr(unsafe.Pointer(&pcache1_g)) /* &.grp */)
}
-
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
if int32((*PGroup)(unsafe.Pointer(pGroup)).Flru.FisAnchor) == 0 {
(*PGroup)(unsafe.Pointer(pGroup)).Flru.FisAnchor = U16(1)
- (*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev = crt.AssignPtrUintptr(pGroup+24 /* &.lru */ +40 /* &.pLruNext */, (pGroup + 24 /* &.lru */))
+ (*PGroup)(unsafe.Pointer(pGroup)).Flru.FpLruPrev = libc.AssignPtrUintptr(pGroup+24 /* &.lru */ +40 /* &.pLruNext */, (pGroup + 24 /* &.lru */))
}
(*PCache1)(unsafe.Pointer(pCache)).FpGroup = pGroup
(*PCache1)(unsafe.Pointer(pCache)).FszPage = szPage
(*PCache1)(unsafe.Pointer(pCache)).FszExtra = szExtra
- (*PCache1)(unsafe.Pointer(pCache)).FszAlloc = (int32((uint64(szPage + szExtra)) + (((uint64(unsafe.Sizeof(PgHdr1{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7)))))
+ (*PCache1)(unsafe.Pointer(pCache)).FszAlloc = (int32((uint64(szPage + szExtra)) + (((uint64(unsafe.Sizeof(PgHdr1{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7)))))
(*PCache1)(unsafe.Pointer(pCache)).FbPurgeable = func() int32 {
if bPurgeable != 0 {
return 1
@@ -25994,7 +26951,7 @@ func pcache1Create(tls *crt.TLS, szPage int32, szExtra int32, bPurgeable int32)
} else {
(*PCache1)(unsafe.Pointer(pCache)).FpnPurgeable = (pCache + 48 /* &.nPurgeableDummy */)
}
-
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
if (*PCache1)(unsafe.Pointer(pCache)).FnHash == uint32(0) {
pcache1Destroy(tls, pCache)
pCache = uintptr(0)
@@ -26006,42 +26963,44 @@ func pcache1Create(tls *crt.TLS, szPage int32, szExtra int32, bPurgeable int32)
// Implementation of the sqlite3_pcache.xCachesize method.
//
// Configure the cache_size limit for a cache.
-func pcache1Cachesize(tls *crt.TLS, p uintptr, nMax int32) { /* sqlite3.c:50493:13: */
+func pcache1Cachesize(tls *libc.TLS, p uintptr, nMax int32) { /* sqlite3.c:50581:13: */
var pCache uintptr = p
if (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 {
var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
-
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
*(*uint32)(unsafe.Pointer(pGroup + 8 /* &.nMaxPage */)) += (uint32(nMax) - (*PCache1)(unsafe.Pointer(pCache)).FnMax)
(*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = (((*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + uint32(10)) - (*PGroup)(unsafe.Pointer(pGroup)).FnMinPage)
(*PCache1)(unsafe.Pointer(pCache)).FnMax = uint32(nMax)
(*PCache1)(unsafe.Pointer(pCache)).Fn90pct = (((*PCache1)(unsafe.Pointer(pCache)).FnMax * uint32(9)) / uint32(10))
pcache1EnforceMaxPage(tls, pCache)
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
}
}
// Implementation of the sqlite3_pcache.xShrink method.
//
// Free up as much memory as possible.
-func pcache1Shrink(tls *crt.TLS, p uintptr) { /* sqlite3.c:50512:13: */
+func pcache1Shrink(tls *libc.TLS, p uintptr) { /* sqlite3.c:50600:13: */
var pCache uintptr = p
if (*PCache1)(unsafe.Pointer(pCache)).FbPurgeable != 0 {
var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
var savedMaxPage int32
-
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
savedMaxPage = int32((*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage)
(*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage = uint32(0)
pcache1EnforceMaxPage(tls, pCache)
(*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage = uint32(savedMaxPage)
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
}
}
// Implementation of the sqlite3_pcache.xPagecount method.
-func pcache1Pagecount(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:50529:12: */
+func pcache1Pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:50617:12: */
var n int32
var pCache uintptr = p
-
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
n = int32((*PCache1)(unsafe.Pointer(pCache)).FnPage)
-
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
return n
}
@@ -26051,7 +27010,7 @@ func pcache1Pagecount(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:50529:12: */
// This steps are broken out into a separate procedure because they are
// usually not needed, and by avoiding the stack initialization required
// for these steps, the main pcache1Fetch() procedure can run faster.
-func pcache1FetchStage2(tls *crt.TLS, pCache uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50547:31: */
+func pcache1FetchStage2(tls *libc.TLS, pCache uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50635:31: */
var nPinned uint32
var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
var pPage uintptr = uintptr(0)
@@ -26091,7 +27050,7 @@ func pcache1FetchStage2(tls *crt.TLS, pCache uintptr, iKey uint32, createFlag in
// Step 5. If a usable page buffer has still not been found,
// attempt to allocate a new one.
if !(pPage != 0) {
- pPage = pcache1AllocPage(tls, pCache, (crt.Bool32(createFlag == 1)))
+ pPage = pcache1AllocPage(tls, pCache, (libc.Bool32(createFlag == 1)))
}
if pPage != 0 {
@@ -26169,7 +27128,7 @@ func pcache1FetchStage2(tls *crt.TLS, pCache uintptr, iKey uint32, createFlag in
// the general case. pcache1FetchNoMutex() is a faster implementation for
// the common case where pGroup->mutex is NULL. The pcache1Fetch() wrapper
// invokes the appropriate routine.
-func pcache1FetchNoMutex(tls *crt.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50675:15: */
+func pcache1FetchNoMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50763:15: */
var pCache uintptr = p
var pPage uintptr = uintptr(0)
@@ -26197,9 +27156,22 @@ func pcache1FetchNoMutex(tls *crt.TLS, p uintptr, iKey uint32, createFlag int32)
}
return uintptr(0)
}
-func pcache1Fetch(tls *crt.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50720:28: */
+func pcache1FetchWithMutex(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50793:15: */
+ var pCache uintptr = p
+ var pPage uintptr
- {
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
+ pPage = pcache1FetchNoMutex(tls, p, iKey, createFlag)
+
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
+ return pPage
+}
+func pcache1Fetch(tls *libc.TLS, p uintptr, iKey uint32, createFlag int32) uintptr { /* sqlite3.c:50808:28: */
+ var pCache uintptr = p
+
+ if (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex != 0 {
+ return pcache1FetchWithMutex(tls, p, iKey, createFlag)
+ } else {
return pcache1FetchNoMutex(tls, p, iKey, createFlag)
}
return uintptr(0)
@@ -26208,11 +27180,13 @@ func pcache1Fetch(tls *crt.TLS, p uintptr, iKey uint32, createFlag int32) uintpt
// Implementation of the sqlite3_pcache.xUnpin method.
//
// Mark a page as unpinned (eligible for asynchronous recycling).
-func pcache1Unpin(tls *crt.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) { /* sqlite3.c:50751:13: */
+func pcache1Unpin(tls *libc.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) { /* sqlite3.c:50839:13: */
var pCache uintptr = p
var pPage uintptr = pPg
var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
+
// It is an error to call this function if the page is already
// part of the PGroup LRU list.
@@ -26222,20 +27196,23 @@ func pcache1Unpin(tls *crt.TLS, p uintptr, pPg uintptr, reuseUnlikely int32) { /
// Add the page to the PGroup LRU list.
var ppFirst uintptr = (pGroup + 24 /* &.lru */ + 40 /* &.pLruNext */)
(*PgHdr1)(unsafe.Pointer(pPage)).FpLruPrev = (pGroup + 24 /* &.lru */)
- (*PgHdr1)(unsafe.Pointer(crt.AssignPtrUintptr(pPage+40 /* &.pLruNext */, *(*uintptr)(unsafe.Pointer(ppFirst))))).FpLruPrev = pPage
+ (*PgHdr1)(unsafe.Pointer(libc.AssignPtrUintptr(pPage+40 /* &.pLruNext */, *(*uintptr)(unsafe.Pointer(ppFirst))))).FpLruPrev = pPage
*(*uintptr)(unsafe.Pointer(ppFirst)) = pPage
(*PCache1)(unsafe.Pointer(pCache)).FnRecyclable++
}
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
}
// Implementation of the sqlite3_pcache.xRekey method.
-func pcache1Rekey(tls *crt.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint32) { /* sqlite3.c:50786:13: */
+func pcache1Rekey(tls *libc.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint32) { /* sqlite3.c:50874:13: */
var pCache uintptr = p
var pPage uintptr = pPg
var pp uintptr
var h uint32
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
+
h = (iOld % (*PCache1)(unsafe.Pointer(pCache)).FnHash)
pp = ((*PCache1)(unsafe.Pointer(pCache)).FapHash + uintptr(h)*8)
for (*(*uintptr)(unsafe.Pointer(pp))) != pPage {
@@ -26251,6 +27228,7 @@ func pcache1Rekey(tls *crt.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint32
(*PCache1)(unsafe.Pointer(pCache)).FiMaxKey = iNew
}
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
}
// Implementation of the sqlite3_pcache.xTruncate method.
@@ -26258,23 +27236,24 @@ func pcache1Rekey(tls *crt.TLS, p uintptr, pPg uintptr, iOld uint32, iNew uint32
// Discard all unpinned pages in the cache with a page number equal to
// or greater than parameter iLimit. Any pinned pages with a page number
// equal to or greater than iLimit are implicitly unpinned.
-func pcache1Truncate(tls *crt.TLS, p uintptr, iLimit uint32) { /* sqlite3.c:50826:13: */
+func pcache1Truncate(tls *libc.TLS, p uintptr, iLimit uint32) { /* sqlite3.c:50914:13: */
var pCache uintptr = p
-
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
if iLimit <= (*PCache1)(unsafe.Pointer(pCache)).FiMaxKey {
pcache1TruncateUnsafe(tls, pCache, iLimit)
(*PCache1)(unsafe.Pointer(pCache)).FiMaxKey = (iLimit - uint32(1))
}
-
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((*PCache1)(unsafe.Pointer(pCache)).FpGroup)).Fmutex)
}
// Implementation of the sqlite3_pcache.xDestroy method.
//
// Destroy a cache allocated using pcache1Create().
-func pcache1Destroy(tls *crt.TLS, p uintptr) { /* sqlite3.c:50841:13: */
+func pcache1Destroy(tls *libc.TLS, p uintptr) { /* sqlite3.c:50929:13: */
var pCache uintptr = p
var pGroup uintptr = (*PCache1)(unsafe.Pointer(pCache)).FpGroup
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
if (*PCache1)(unsafe.Pointer(pCache)).FnPage != 0 {
pcache1TruncateUnsafe(tls, pCache, uint32(0))
}
@@ -26284,7 +27263,7 @@ func pcache1Destroy(tls *crt.TLS, p uintptr) { /* sqlite3.c:50841:13: */
*(*uint32)(unsafe.Pointer(pGroup + 12 /* &.nMinPage */)) -= ((*PCache1)(unsafe.Pointer(pCache)).FnMin)
(*PGroup)(unsafe.Pointer(pGroup)).FmxPinned = (((*PGroup)(unsafe.Pointer(pGroup)).FnMaxPage + uint32(10)) - (*PGroup)(unsafe.Pointer(pGroup)).FnMinPage)
pcache1EnforceMaxPage(tls, pCache)
-
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer(pGroup)).Fmutex)
Xsqlite3_free(tls, (*PCache1)(unsafe.Pointer(pCache)).FpBulk)
Xsqlite3_free(tls, (*PCache1)(unsafe.Pointer(pCache)).FapHash)
Xsqlite3_free(tls, pCache)
@@ -26293,11 +27272,11 @@ func pcache1Destroy(tls *crt.TLS, p uintptr) { /* sqlite3.c:50841:13: */
// This function is called during initialization (sqlite3_initialize()) to
// install the default pluggable cache module, assuming the user has not
// already provided an alternative.
-func Xsqlite3PCacheSetDefault(tls *crt.TLS) { /* sqlite3.c:50864:21: */
+func Xsqlite3PCacheSetDefault(tls *libc.TLS) { /* sqlite3.c:50952:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
- Xsqlite3_config(tls, 18, crt.VaList(bp, uintptr(unsafe.Pointer(&defaultMethods1))))
+ Xsqlite3_config(tls, 18, libc.VaList(bp, uintptr(unsafe.Pointer(&defaultMethods1))))
}
var defaultMethods1 = Sqlite3_pcache_methods2{FiVersion: 1, FpArg: // iVersion
@@ -26313,22 +27292,48 @@ uintptr(0), FxInit:// pArg
0, FxDestroy:// xTruncate
0, FxShrink:// xDestroy
0, // xShrink
-} /* sqlite3.c:50865:40 */
+} /* sqlite3.c:50953:40 */
// Return the size of the header on each page of this PCACHE implementation.
-func Xsqlite3HeaderSizePcache1(tls *crt.TLS) int32 { /* sqlite3.c:50886:20: */
- return (int32(((uint64(unsafe.Sizeof(PgHdr1{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))))
+func Xsqlite3HeaderSizePcache1(tls *libc.TLS) int32 { /* sqlite3.c:50974:20: */
+ return (int32(((uint64(unsafe.Sizeof(PgHdr1{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))))
}
// Return the global mutex used by this PCACHE implementation. The
// sqlite3_status() routine needs access to this mutex.
-func Xsqlite3Pcache1Mutex(tls *crt.TLS) uintptr { /* sqlite3.c:50892:30: */
+func Xsqlite3Pcache1Mutex(tls *libc.TLS) uintptr { /* sqlite3.c:50980:30: */
return pcache1_g.Fmutex
}
+// This function is called to free superfluous dynamically allocated memory
+// held by the pager system. Memory in use by any SQLite pager allocated
+// by the current thread may be sqlite3_free()ed.
+//
+// nReq is the number of bytes of memory required. Once this much has
+// been released, the function returns. The return value is the total number
+// of bytes of memory released.
+func Xsqlite3PcacheReleaseMemory(tls *libc.TLS, nReq int32) int32 { /* sqlite3.c:50994:20: */
+ var nFree int32 = 0
+
+ if Xsqlite3Config.FpPage == uintptr(0) {
+ var p uintptr
+ Xsqlite3_mutex_enter(tls, (*PGroup)(unsafe.Pointer((uintptr(unsafe.Pointer(&pcache1_g)) /* &.grp */))).Fmutex)
+ for (((nReq < 0) || (nFree < nReq)) &&
+ ((libc.AssignUintptr(&p, pcache1_g.Fgrp.Flru.FpLruPrev)) != uintptr(0))) &&
+ (int32((*PgHdr1)(unsafe.Pointer(p)).FisAnchor) == 0) {
+ nFree = nFree + (pcache1MemSize(tls, (*PgHdr1)(unsafe.Pointer(p)).Fpage.FpBuf))
+
+ pcache1PinPage(tls, p)
+ pcache1RemoveFromHash(tls, p, 1)
+ }
+ Xsqlite3_mutex_leave(tls, (*PGroup)(unsafe.Pointer((uintptr(unsafe.Pointer(&pcache1_g)) /* &.grp */))).Fmutex)
+ }
+ return nFree
+}
+
// This function is used by test procedures to inspect the internal state
// of the global cache.
-func Xsqlite3PcacheStats(tls *crt.TLS, pnCurrent uintptr, pnMax uintptr, pnMin uintptr, pnRecyclable uintptr) { /* sqlite3.c:50936:21: */
+func Xsqlite3PcacheStats(tls *libc.TLS, pnCurrent uintptr, pnMax uintptr, pnMin uintptr, pnRecyclable uintptr) { /* sqlite3.c:51024:21: */
var p uintptr
var nRecyclable int32 = 0
for p = pcache1_g.Fgrp.Flru.FpLruNext; (p != 0) && !(int32((*PgHdr1)(unsafe.Pointer(p)).FisAnchor) != 0); p = (*PgHdr1)(unsafe.Pointer(p)).FpLruNext {
@@ -26439,7 +27444,7 @@ type RowSetChunk = struct {
// Allocate a RowSet object. Return NULL if a memory allocation
// error occurs.
-func Xsqlite3RowSetInit(tls *crt.TLS, db uintptr) uintptr { /* sqlite3.c:51086:23: */
+func Xsqlite3RowSetInit(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:51174:23: */
var p uintptr = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(RowSet{})))
if p != 0 {
var N int32 = Xsqlite3DbMallocSize(tls, db, p)
@@ -26448,8 +27453,8 @@ func Xsqlite3RowSetInit(tls *crt.TLS, db uintptr) uintptr { /* sqlite3.c:51086:2
(*RowSet)(unsafe.Pointer(p)).FpEntry = uintptr(0)
(*RowSet)(unsafe.Pointer(p)).FpLast = uintptr(0)
(*RowSet)(unsafe.Pointer(p)).FpForest = uintptr(0)
- (*RowSet)(unsafe.Pointer(p)).FpFresh = (uintptr((((uint64(unsafe.Sizeof(RowSet{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7)))) + p)
- (*RowSet)(unsafe.Pointer(p)).FnFresh = (U16((uint64(N) - (((uint64(unsafe.Sizeof(RowSet{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7)))) / uint64(unsafe.Sizeof(RowSetEntry{}))))
+ (*RowSet)(unsafe.Pointer(p)).FpFresh = (uintptr((((uint64(unsafe.Sizeof(RowSet{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7)))) + p)
+ (*RowSet)(unsafe.Pointer(p)).FnFresh = (U16((uint64(N) - (((uint64(unsafe.Sizeof(RowSet{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7)))) / uint64(unsafe.Sizeof(RowSetEntry{}))))
(*RowSet)(unsafe.Pointer(p)).FrsFlags = U16(0x01)
(*RowSet)(unsafe.Pointer(p)).FiBatch = 0
}
@@ -26459,7 +27464,7 @@ func Xsqlite3RowSetInit(tls *crt.TLS, db uintptr) uintptr { /* sqlite3.c:51086:2
// Deallocate all chunks from a RowSet. This frees all memory that
// the RowSet has allocated over its lifetime. This routine is
// the destructor for the RowSet.
-func Xsqlite3RowSetClear(tls *crt.TLS, pArg uintptr) { /* sqlite3.c:51108:21: */
+func Xsqlite3RowSetClear(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51196:21: */
var p uintptr = pArg
var pChunk uintptr
var pNextChunk uintptr
@@ -26478,7 +27483,7 @@ func Xsqlite3RowSetClear(tls *crt.TLS, pArg uintptr) { /* sqlite3.c:51108:21: */
// Deallocate all chunks from a RowSet. This frees all memory that
// the RowSet has allocated over its lifetime. This routine is
// the destructor for the RowSet.
-func Xsqlite3RowSetDelete(tls *crt.TLS, pArg uintptr) { /* sqlite3.c:51128:21: */
+func Xsqlite3RowSetDelete(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:51216:21: */
Xsqlite3RowSetClear(tls, pArg)
Xsqlite3DbFree(tls, (*RowSet)(unsafe.Pointer(pArg)).Fdb, pArg)
}
@@ -26489,7 +27494,7 @@ func Xsqlite3RowSetDelete(tls *crt.TLS, pArg uintptr) { /* sqlite3.c:51128:21: *
//
// In an OOM situation, the RowSet.db->mallocFailed flag is set and this
// routine returns NULL.
-func rowSetEntryAlloc(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:51141:27: */
+func rowSetEntryAlloc(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:51229:27: */
if int32((*RowSet)(unsafe.Pointer(p)).FnFresh) == 0 { //OPTIMIZATION-IF-FALSE
// We could allocate a fresh RowSetEntry each time one is needed, but it
@@ -26505,14 +27510,14 @@ func rowSetEntryAlloc(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:51141:27:
(*RowSet)(unsafe.Pointer(p)).FnFresh = (uint16((uint64(1024 - 8)) / uint64(unsafe.Sizeof(RowSetEntry{}))))
}
(*RowSet)(unsafe.Pointer(p)).FnFresh--
- return crt.PostIncUintptr(&(*RowSet)(unsafe.Pointer(p)).FpFresh, 24)
+ return libc.PostIncUintptr(&(*RowSet)(unsafe.Pointer(p)).FpFresh, 24)
}
// Insert a new value into a RowSet.
//
// The mallocFailed flag of the database connection is set if a
// memory allocation fails.
-func Xsqlite3RowSetInsert(tls *crt.TLS, p uintptr, rowid I64) { /* sqlite3.c:51166:21: */
+func Xsqlite3RowSetInsert(tls *libc.TLS, p uintptr, rowid I64) { /* sqlite3.c:51254:21: */
var pEntry uintptr // The new entry
var pLast uintptr // The last prior entry
@@ -26529,7 +27534,7 @@ func Xsqlite3RowSetInsert(tls *crt.TLS, p uintptr, rowid I64) { /* sqlite3.c:511
if rowid <= (*RowSetEntry)(unsafe.Pointer(pLast)).Fv { //OPTIMIZATION-IF-FALSE
// Avoid unnecessary sorts by preserving the ROWSET_SORTED flags
// where possible
- *(*U16)(unsafe.Pointer(p + 50 /* &.rsFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x01))))
+ *(*U16)(unsafe.Pointer(p + 50 /* &.rsFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x01))))
}
(*RowSetEntry)(unsafe.Pointer(pLast)).FpRight = pEntry
} else {
@@ -26542,7 +27547,7 @@ func Xsqlite3RowSetInsert(tls *crt.TLS, p uintptr, rowid I64) { /* sqlite3.c:511
//
// The input lists are connected via pRight pointers and are
// assumed to each already be in sorted order.
-func rowSetEntryMerge(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:51197:27: */
+func rowSetEntryMerge(tls *libc.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3.c:51285:27: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -26556,7 +27561,7 @@ func rowSetEntryMerge(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3
if (*RowSetEntry)(unsafe.Pointer(pA)).Fv <= (*RowSetEntry)(unsafe.Pointer(pB)).Fv {
if (*RowSetEntry)(unsafe.Pointer(pA)).Fv < (*RowSetEntry)(unsafe.Pointer(pB)).Fv {
- pTail = crt.AssignPtrUintptr(pTail+8 /* &.pRight */, pA)
+ pTail = libc.AssignPtrUintptr(pTail+8 /* &.pRight */, pA)
}
pA = (*RowSetEntry)(unsafe.Pointer(pA)).FpRight
if pA == uintptr(0) {
@@ -26564,7 +27569,7 @@ func rowSetEntryMerge(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3
break
}
} else {
- pTail = crt.AssignPtrUintptr(pTail+8 /* &.pRight */, pB)
+ pTail = libc.AssignPtrUintptr(pTail+8 /* &.pRight */, pB)
pB = (*RowSetEntry)(unsafe.Pointer(pB)).FpRight
if pB == uintptr(0) {
(*RowSetEntry)(unsafe.Pointer(pTail)).FpRight = pA
@@ -26575,11 +27580,9 @@ func rowSetEntryMerge(tls *crt.TLS, pA uintptr, pB uintptr) uintptr { /* sqlite3
return (*RowSetEntry)(unsafe.Pointer(bp /* &head */)).FpRight
}
-/*
-** Sort all elements on the list of RowSetEntry objects into order of
-** increasing v.
- */
-func rowSetEntrySort(tls *crt.TLS, pIn uintptr) uintptr { /* sqlite3.c:51232:27: */
+// Sort all elements on the list of RowSetEntry objects into order of
+// increasing v.
+func rowSetEntrySort(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:51320:27: */
bp := tls.Alloc(320)
defer tls.Free(320)
@@ -26587,7 +27590,7 @@ func rowSetEntrySort(tls *crt.TLS, pIn uintptr) uintptr { /* sqlite3.c:51232:27:
var pNext uintptr
// var aBucket [40]uintptr at bp, 320
- crt.Xmemset(tls, bp /* &aBucket[0] */, 0, uint64(unsafe.Sizeof([40]uintptr{})))
+ libc.Xmemset(tls, bp /* &aBucket[0] */, 0, uint64(unsafe.Sizeof([40]uintptr{})))
for pIn != 0 {
pNext = (*RowSetEntry)(unsafe.Pointer(pIn)).FpRight
(*RowSetEntry)(unsafe.Pointer(pIn)).FpRight = uintptr(0)
@@ -26615,7 +27618,7 @@ func rowSetEntrySort(tls *crt.TLS, pIn uintptr) uintptr { /* sqlite3.c:51232:27:
// The input, pIn, is a binary tree (or subtree) of RowSetEntry objects.
// Convert this tree into a linked list connected by the pRight pointers
// and return pointers to the first and last elements of the new list.
-func rowSetTreeToList(tls *crt.TLS, pIn uintptr, ppFirst uintptr, ppLast uintptr) { /* sqlite3.c:51261:13: */
+func rowSetTreeToList(tls *libc.TLS, pIn uintptr, ppFirst uintptr, ppLast uintptr) { /* sqlite3.c:51349:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -26646,7 +27649,7 @@ func rowSetTreeToList(tls *crt.TLS, pIn uintptr, ppFirst uintptr, ppLast uintptr
// and leave *ppList set to NULL.
//
// Return a pointer to the root of the constructed binary tree.
-func rowSetNDeepTree(tls *crt.TLS, ppList uintptr, iDepth int32) uintptr { /* sqlite3.c:51296:27: */
+func rowSetNDeepTree(tls *libc.TLS, ppList uintptr, iDepth int32) uintptr { /* sqlite3.c:51384:27: */
var p uintptr // Root of the new tree
var pLeft uintptr // Left subtree
if *(*uintptr)(unsafe.Pointer(ppList)) == uintptr(0) { //OPTIMIZATION-IF-TRUE
@@ -26670,14 +27673,14 @@ func rowSetNDeepTree(tls *crt.TLS, ppList uintptr, iDepth int32) uintptr { /* sq
} else {
p = *(*uintptr)(unsafe.Pointer(ppList))
*(*uintptr)(unsafe.Pointer(ppList)) = (*RowSetEntry)(unsafe.Pointer(p)).FpRight
- (*RowSetEntry)(unsafe.Pointer(p)).FpLeft = crt.AssignPtrUintptr(p+8 /* &.pRight */, uintptr(0))
+ (*RowSetEntry)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+8 /* &.pRight */, uintptr(0))
}
return p
}
// Convert a sorted list of elements into a binary tree. Make the tree
// as deep as it needs to be in order to contain the entire list.
-func rowSetListToTree(tls *crt.TLS, pList uintptr) uintptr { /* sqlite3.c:51332:27: */
+func rowSetListToTree(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:51420:27: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = pList
@@ -26688,7 +27691,7 @@ func rowSetListToTree(tls *crt.TLS, pList uintptr) uintptr { /* sqlite3.c:51332:
p = *(*uintptr)(unsafe.Pointer(bp /* pList */))
*(*uintptr)(unsafe.Pointer(bp /* pList */)) = (*RowSetEntry)(unsafe.Pointer(p)).FpRight
- (*RowSetEntry)(unsafe.Pointer(p)).FpLeft = crt.AssignPtrUintptr(p+8 /* &.pRight */, uintptr(0))
+ (*RowSetEntry)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+8 /* &.pRight */, uintptr(0))
for iDepth = 1; *(*uintptr)(unsafe.Pointer(bp /* pList */)) != 0; iDepth++ {
pLeft = p
p = *(*uintptr)(unsafe.Pointer(bp /* pList */))
@@ -26710,7 +27713,7 @@ func rowSetListToTree(tls *crt.TLS, pList uintptr) uintptr { /* sqlite3.c:51332:
// been used. Older versions of RowSet allowed that, but as the
// capability was not used by the code generator, it was removed
// for code economy.
-func Xsqlite3RowSetNext(tls *crt.TLS, p uintptr, pRowid uintptr) int32 { /* sqlite3.c:51364:20: */
+func Xsqlite3RowSetNext(tls *libc.TLS, p uintptr, pRowid uintptr) int32 { /* sqlite3.c:51452:20: */
// Cannot be used with sqlite3RowSetText()
@@ -26743,7 +27746,7 @@ func Xsqlite3RowSetNext(tls *crt.TLS, p uintptr, pRowid uintptr) int32 { /* sqli
// If this is the first test of a new batch and if there exist entries
// on pRowSet->pEntry, then sort those entries into the forest at
// pRowSet->pForest so that they can be tested.
-func Xsqlite3RowSetTest(tls *crt.TLS, pRowSet uintptr, iBatch int32, iRowid Sqlite3_int64) int32 { /* sqlite3.c:51398:20: */
+func Xsqlite3RowSetTest(tls *libc.TLS, pRowSet uintptr, iBatch int32, iRowid Sqlite3_int64) int32 { /* sqlite3.c:51486:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -26778,7 +27781,7 @@ func Xsqlite3RowSetTest(tls *crt.TLS, pRowSet uintptr, iBatch int32, iRowid Sqli
}
}
if pTree == uintptr(0) {
- *(*uintptr)(unsafe.Pointer(ppPrevTree)) = crt.AssignUintptr(&pTree, rowSetEntryAlloc(tls, pRowSet))
+ *(*uintptr)(unsafe.Pointer(ppPrevTree)) = libc.AssignUintptr(&pTree, rowSetEntryAlloc(tls, pRowSet))
if pTree != 0 {
(*RowSetEntry)(unsafe.Pointer(pTree)).Fv = int64(0)
(*RowSetEntry)(unsafe.Pointer(pTree)).FpRight = uintptr(0)
@@ -26878,7 +27881,7 @@ type Wal1 = struct {
FiReCksum U32
FzWalName uintptr
FnCkpt U32
- _ [4]byte
+ FpSnapshot uintptr
}
//************* End of rowset.c *********************************************
@@ -26925,7 +27928,7 @@ type Wal1 = struct {
// Connection to a write-ahead log (WAL) file.
// There is one object of this type for each pager.
-type Wal = Wal1 /* sqlite3.c:51540:20 */
+type Wal = Wal1 /* sqlite3.c:51628:20 */
//************* End of wal.h ************************************************
//************* Continuing where we left off in pager.c *********************
@@ -26978,8 +27981,8 @@ type Wal = Wal1 /* sqlite3.c:51540:20 */
// (5) All writes to the database file are synced prior to the rollback journal
// being deleted, truncated, or zeroed.
//
-// (6) If a master journal file is used, then all writes to the database file
-// are synced prior to the master journal being deleted.
+// (6) If a super-journal file is used, then all writes to the database file
+// are synced prior to the super-journal being deleted.
//
// Definition: Two databases (or the same database at two points it time)
// are said to be "logically equivalent" if they give the same answer to
@@ -27365,8 +28368,8 @@ type PagerSavepoint1 = struct {
// (5) All writes to the database file are synced prior to the rollback journal
// being deleted, truncated, or zeroed.
//
-// (6) If a master journal file is used, then all writes to the database file
-// are synced prior to the master journal being deleted.
+// (6) If a super-journal file is used, then all writes to the database file
+// are synced prior to the super-journal being deleted.
//
// Definition: Two databases (or the same database at two points it time)
// are said to be "logically equivalent" if they give the same answer to
@@ -27692,7 +28695,7 @@ type PagerSavepoint1 = struct {
// immediately following the last journal record written into the main
// journal before the journal-header. This is required during savepoint
// rollback (see pagerPlaybackSavepoint()).
-type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:52051:31 */
+type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:52139:31 */
// Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains
// the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS
@@ -27701,9 +28704,9 @@ type PagerSavepoint = PagerSavepoint1 /* sqlite3.c:52051:31 */
// The following global variables hold counters used for
// testing purposes only. These variables do not exist in
// a non-testing build. These variables are not thread-safe.
-var Xsqlite3_pager_readdb_count int32 = 0 /* sqlite3.c:52338:16 */ // Number of full pages read from DB
-var Xsqlite3_pager_writedb_count int32 = 0 /* sqlite3.c:52339:16 */ // Number of full pages written to DB
-var Xsqlite3_pager_writej_count int32 = 0 /* sqlite3.c:52340:16 */ // Number of pages written to journal
+var Xsqlite3_pager_readdb_count int32 = 0 /* sqlite3.c:52426:16 */ // Number of full pages read from DB
+var Xsqlite3_pager_writedb_count int32 = 0 /* sqlite3.c:52427:16 */ // Number of full pages written to DB
+var Xsqlite3_pager_writej_count int32 = 0 /* sqlite3.c:52428:16 */ // Number of pages written to journal
// Journal files begin with the following magic string. The data
// was obtained from /dev/random. It is used only as a sanity check.
@@ -27728,22 +28731,22 @@ var Xsqlite3_pager_writej_count int32 = 0 /* sqlite3.c:52340:16 */ // Number of
// is different for every journal, we minimize that risk.
var aJournalMagic = [8]uint8{
uint8(0xd9), uint8(0xd5), uint8(0x05), uint8(0xf9), uint8(0x20), uint8(0xa1), uint8(0x63), uint8(0xd7),
-} /* sqlite3.c:52371:28 */
+} /* sqlite3.c:52459:28 */
// Set the Pager.xGet method for the appropriate routine used to fetch
// content from the pager.
-func setGetterMethod(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:52669:13: */
+func setGetterMethod(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:52752:13: */
if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 {
(*Pager)(unsafe.Pointer(pPager)).FxGet = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, Pgno, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32
}{getPageError}))
} else if (*Pager)(unsafe.Pointer(pPager)).FbUseFetch != 0 {
(*Pager)(unsafe.Pointer(pPager)).FxGet = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, Pgno, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32
}{getPageMMap}))
} else {
(*Pager)(unsafe.Pointer(pPager)).FxGet = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, Pgno, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32
}{getPageNormal}))
}
}
@@ -27755,7 +28758,7 @@ func setGetterMethod(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:52669:13: */
// * The page-number is less than or equal to PagerSavepoint.nOrig, and
// * The bit corresponding to the page-number is not set in
// PagerSavepoint.pInSavepoint.
-func subjRequiresPage(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:52690:12: */
+func subjRequiresPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:52773:12: */
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
var p uintptr
var pgno Pgno = (*PgHdr)(unsafe.Pointer(pPg)).Fpgno
@@ -27774,7 +28777,7 @@ func subjRequiresPage(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:52690:12:
// error code is something goes wrong.
//
// All values are stored on disk as big-endian.
-func read32bits(tls *crt.TLS, fd uintptr, offset I64, pRes uintptr) int32 { /* sqlite3.c:52720:12: */
+func read32bits(tls *libc.TLS, fd uintptr, offset I64, pRes uintptr) int32 { /* sqlite3.c:52803:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -27791,7 +28794,7 @@ func read32bits(tls *crt.TLS, fd uintptr, offset I64, pRes uintptr) int32 { /* s
// Write a 32-bit integer into the given file descriptor. Return SQLITE_OK
// on success or an error code is something goes wrong.
-func write32bits(tls *crt.TLS, fd uintptr, offset I64, val U32) int32 { /* sqlite3.c:52739:12: */
+func write32bits(tls *libc.TLS, fd uintptr, offset I64, val U32) int32 { /* sqlite3.c:52822:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -27808,7 +28811,7 @@ func write32bits(tls *crt.TLS, fd uintptr, offset I64, val U32) int32 { /* sqlit
// Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is
// called, do not modify it. See the comment above the #define of
// UNKNOWN_LOCK for an explanation of this.
-func pagerUnlockDb(tls *crt.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:52754:12: */
+func pagerUnlockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:52837:12: */
var rc int32 = 0
if (*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0) {
@@ -27834,7 +28837,7 @@ func pagerUnlockDb(tls *crt.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3
// called, do not modify it unless the new locking state is EXCLUSIVE_LOCK.
// See the comment above the #define of UNKNOWN_LOCK for an explanation
// of this.
-func pagerLockDb(tls *crt.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:52782:12: */
+func pagerLockDb(tls *libc.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c:52865:12: */
var rc int32 = 0
if (int32((*Pager)(unsafe.Pointer(pPager)).FeLock) < eLock) || (int32((*Pager)(unsafe.Pointer(pPager)).FeLock) == (4 + 1)) {
@@ -27867,7 +28870,7 @@ func pagerLockDb(tls *crt.TLS, pPager uintptr, eLock int32) int32 { /* sqlite3.c
// returned in this case.
//
// If neither optimization can be used, 0 is returned.
-func jrnlBufferSize(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:52815:12: */
+func jrnlBufferSize(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:52898:12: */
_ = pPager
@@ -27879,35 +28882,35 @@ func jrnlBufferSize(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:52815:12:
// and debugging only.
// When this is called the journal file for pager pPager must be open.
-// This function attempts to read a master journal file name from the
+// This function attempts to read a super-journal file name from the
// end of the file and, if successful, copies it into memory supplied
-// by the caller. See comments above writeMasterJournal() for the format
-// used to store a master journal file name at the end of a journal file.
+// by the caller. See comments above writeSuperJournal() for the format
+// used to store a super-journal file name at the end of a journal file.
//
-// zMaster must point to a buffer of at least nMaster bytes allocated by
+// zSuper must point to a buffer of at least nSuper bytes allocated by
// the caller. This should be sqlite3_vfs.mxPathname+1 (to ensure there is
-// enough space to write the master journal name). If the master journal
-// name in the journal is longer than nMaster bytes (including a
-// nul-terminator), then this is handled as if no master journal name
+// enough space to write the super-journal name). If the super-journal
+// name in the journal is longer than nSuper bytes (including a
+// nul-terminator), then this is handled as if no super-journal name
// were present in the journal.
//
-// If a master journal file name is present at the end of the journal
-// file, then it is copied into the buffer pointed to by zMaster. A
-// nul-terminator byte is appended to the buffer following the master
-// journal file name.
+// If a super-journal file name is present at the end of the journal
+// file, then it is copied into the buffer pointed to by zSuper. A
+// nul-terminator byte is appended to the buffer following the
+// super-journal file name.
//
-// If it is determined that no master journal file name is present
-// zMaster[0] is set to 0 and SQLITE_OK returned.
+// If it is determined that no super-journal file name is present
+// zSuper[0] is set to 0 and SQLITE_OK returned.
//
// If an error occurs while reading from the journal file, an SQLite
// error code is returned.
-func readMasterJournal(tls *crt.TLS, pJrnl uintptr, zMaster uintptr, nMaster U32) int32 { /* sqlite3.c:52920:12: */
+func readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper U32) int32 { /* sqlite3.c:53003:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
var rc int32 // Return code
// var len U32 at bp+8, 4
- // Length in bytes of master journal name
+ // Length in bytes of super-journal name
// var szJ I64 at bp, 8
// Total size in bytes of journal file pJrnl
// var cksum U32 at bp+12, 4
@@ -27915,34 +28918,34 @@ func readMasterJournal(tls *crt.TLS, pJrnl uintptr, zMaster uintptr, nMaster U32
var u U32 // Unsigned loop counter
// var aMagic [8]uint8 at bp+16, 8
// A buffer to hold the magic header
- *(*int8)(unsafe.Pointer(zMaster + uintptr(0))) = int8(0)
+ *(*int8)(unsafe.Pointer(zSuper + uintptr(0))) = int8(0)
- if (((((((((0 != (crt.AssignInt32(&rc, Xsqlite3OsFileSize(tls, pJrnl, bp /* &szJ */)))) ||
+ if (((((((((0 != (libc.AssignInt32(&rc, Xsqlite3OsFileSize(tls, pJrnl, bp /* &szJ */)))) ||
(*(*I64)(unsafe.Pointer(bp /* szJ */)) < int64(16))) ||
- (0 != (crt.AssignInt32(&rc, read32bits(tls, pJrnl, (*(*I64)(unsafe.Pointer(bp /* szJ */))-int64(16)), bp+8 /* &len */))))) ||
- (*(*U32)(unsafe.Pointer(bp + 8 /* len */)) >= nMaster)) ||
+ (0 != (libc.AssignInt32(&rc, read32bits(tls, pJrnl, (*(*I64)(unsafe.Pointer(bp /* szJ */))-int64(16)), bp+8 /* &len */))))) ||
+ (*(*U32)(unsafe.Pointer(bp + 8 /* len */)) >= nSuper)) ||
(I64(*(*U32)(unsafe.Pointer(bp + 8 /* len */))) > (*(*I64)(unsafe.Pointer(bp /* szJ */)) - int64(16)))) ||
(*(*U32)(unsafe.Pointer(bp + 8 /* len */)) == U32(0))) ||
- (0 != (crt.AssignInt32(&rc, read32bits(tls, pJrnl, (*(*I64)(unsafe.Pointer(bp /* szJ */))-int64(12)), bp+12 /* &cksum */))))) ||
- (0 != (crt.AssignInt32(&rc, Xsqlite3OsRead(tls, pJrnl, bp+16 /* &aMagic[0] */, 8, (*(*I64)(unsafe.Pointer(bp /* szJ */))-int64(8))))))) ||
- (crt.Xmemcmp(tls, bp+16 /* &aMagic[0] */, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(8)) != 0)) ||
- (0 != (crt.AssignInt32(&rc, Xsqlite3OsRead(tls, pJrnl, zMaster, int32(*(*U32)(unsafe.Pointer(bp + 8 /* len */))), ((*(*I64)(unsafe.Pointer(bp /* szJ */))-int64(16))-I64(*(*U32)(unsafe.Pointer(bp + 8 /* len */)))))))) {
+ (0 != (libc.AssignInt32(&rc, read32bits(tls, pJrnl, (*(*I64)(unsafe.Pointer(bp /* szJ */))-int64(12)), bp+12 /* &cksum */))))) ||
+ (0 != (libc.AssignInt32(&rc, Xsqlite3OsRead(tls, pJrnl, bp+16 /* &aMagic[0] */, 8, (*(*I64)(unsafe.Pointer(bp /* szJ */))-int64(8))))))) ||
+ (libc.Xmemcmp(tls, bp+16 /* &aMagic[0] */, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(8)) != 0)) ||
+ (0 != (libc.AssignInt32(&rc, Xsqlite3OsRead(tls, pJrnl, zSuper, int32(*(*U32)(unsafe.Pointer(bp + 8 /* len */))), ((*(*I64)(unsafe.Pointer(bp /* szJ */))-int64(16))-I64(*(*U32)(unsafe.Pointer(bp + 8 /* len */)))))))) {
return rc
}
- // See if the checksum matches the master journal name
+ // See if the checksum matches the super-journal name
for u = U32(0); u < *(*U32)(unsafe.Pointer(bp + 8 /* len */)); u++ {
- *(*U32)(unsafe.Pointer(bp + 12 /* cksum */)) -= U32(*(*int8)(unsafe.Pointer(zMaster + uintptr(u))))
+ *(*U32)(unsafe.Pointer(bp + 12 /* cksum */)) -= U32(*(*int8)(unsafe.Pointer(zSuper + uintptr(u))))
}
if *(*U32)(unsafe.Pointer(bp + 12 /* cksum */)) != 0 {
// If the checksum doesn't add up, then one or more of the disk sectors
- // containing the master journal filename is corrupted. This means
+ // containing the super-journal filename is corrupted. This means
// definitely roll back, so just return SQLITE_OK and report a (nul)
- // master-journal filename.
+ // super-journal filename.
*(*U32)(unsafe.Pointer(bp + 8 /* len */)) = U32(0)
}
- *(*int8)(unsafe.Pointer(zMaster + uintptr(*(*U32)(unsafe.Pointer(bp + 8 /* len */))))) = int8(0)
- *(*int8)(unsafe.Pointer(zMaster + uintptr((*(*U32)(unsafe.Pointer(bp + 8 /* len */)) + U32(1))))) = int8(0)
+ *(*int8)(unsafe.Pointer(zSuper + uintptr(*(*U32)(unsafe.Pointer(bp + 8 /* len */))))) = int8(0)
+ *(*int8)(unsafe.Pointer(zSuper + uintptr((*(*U32)(unsafe.Pointer(bp + 8 /* len */)) + U32(1))))) = int8(0)
return 0
}
@@ -27960,7 +28963,7 @@ func readMasterJournal(tls *crt.TLS, pJrnl uintptr, zMaster uintptr, nMaster U32
// 100 512
// 2000 2048
//
-func journalHdrOffset(tls *crt.TLS, pPager uintptr) I64 { /* sqlite3.c:52976:12: */
+func journalHdrOffset(tls *libc.TLS, pPager uintptr) I64 { /* sqlite3.c:53059:12: */
var offset I64 = int64(0)
var c I64 = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
if c != 0 {
@@ -27989,7 +28992,7 @@ func journalHdrOffset(tls *crt.TLS, pPager uintptr) I64 { /* sqlite3.c:52976:12:
//
// If an IO error occurs, abandon processing and return the IO error code.
// Otherwise, return SQLITE_OK.
-func zeroJournalHdr(tls *crt.TLS, pPager uintptr, doTruncate int32) int32 { /* sqlite3.c:53009:12: */
+func zeroJournalHdr(tls *libc.TLS, pPager uintptr, doTruncate int32) int32 { /* sqlite3.c:53092:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -28024,7 +29027,7 @@ func zeroJournalHdr(tls *crt.TLS, pPager uintptr, doTruncate int32) int32 { /* s
return rc
}
-var zeroHdr = [28]int8{int8(0)} /* sqlite3.c:53020:25 */
+var zeroHdr = [28]int8{int8(0)} /* sqlite3.c:53103:25 */
// The journal file must be open when this routine is called. A journal
// header (JOURNAL_HDR_SZ bytes) is written into the journal file at the
@@ -28039,7 +29042,7 @@ var zeroHdr = [28]int8{int8(0)} /* sqlite3.c:53020:25 */
// - 4 bytes: Database page size.
//
// Followed by (JOURNAL_HDR_SZ - 28) bytes of unused space.
-func writeJournalHdr(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:53059:12: */
+func writeJournalHdr(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:53142:12: */
var rc int32 = 0 // Return code
var zHeader uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace // Temporary space used to build header
var nHeader U32 = U32((*Pager)(unsafe.Pointer(pPager)).FpageSize) // Size of buffer pointed to by zHeader
@@ -28061,7 +29064,7 @@ func writeJournalHdr(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:53059:12
}
}
- (*Pager)(unsafe.Pointer(pPager)).FjournalHdr = crt.AssignPtrInt64(pPager+96 /* &.journalOff */, journalHdrOffset(tls, pPager))
+ (*Pager)(unsafe.Pointer(pPager)).FjournalHdr = libc.AssignPtrInt64(pPager+96 /* &.journalOff */, journalHdrOffset(tls, pPager))
// Write the nRec Field - the number of page records that follow this
// journal header. Normally, zero is written to this value at this time.
@@ -28084,13 +29087,13 @@ func writeJournalHdr(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:53059:12
if (((*Pager)(unsafe.Pointer(pPager)).FnoSync != 0) || (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == 4)) ||
((Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd) & 0x00000200) != 0) {
- crt.Xmemcpy(tls, zHeader, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(unsafe.Sizeof(aJournalMagic)))
+ libc.Xmemcpy(tls, zHeader, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(unsafe.Sizeof(aJournalMagic)))
Xsqlite3Put4byte(tls, (zHeader + uintptr(uint64(unsafe.Sizeof(aJournalMagic)))), 0xffffffff)
} else {
- crt.Xmemset(tls, zHeader, 0, (uint64(unsafe.Sizeof(aJournalMagic)) + uint64(4)))
+ libc.Xmemset(tls, zHeader, 0, (uint64(unsafe.Sizeof(aJournalMagic)) + uint64(4)))
}
- /* The random check-hash initializer */
+ // The random check-hash initializer
Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), (pPager + 52 /* &.cksumInit */))
Xsqlite3Put4byte(tls, (zHeader + uintptr((uint64(unsafe.Sizeof(aJournalMagic)) + uint64(4)))), (*Pager)(unsafe.Pointer(pPager)).FcksumInit)
// The initial database size
@@ -28105,26 +29108,25 @@ func writeJournalHdr(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:53059:12
// works find if the following memset() is omitted. But initializing
// the memory prevents valgrind from complaining, so we are willing to
// take the performance hit.
- crt.Xmemset(tls, (zHeader + uintptr((uint64(unsafe.Sizeof(aJournalMagic)) + uint64(20)))), 0,
+ libc.Xmemset(tls, (zHeader + uintptr((uint64(unsafe.Sizeof(aJournalMagic)) + uint64(20)))), 0,
(uint64(nHeader) - (uint64(unsafe.Sizeof(aJournalMagic)) + uint64(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
- ** record is written to the following sector (leaving a gap in the file
- ** that will be implicitly filled in by the OS).
- **
- ** However it has been discovered that on some systems this pattern can
- ** be significantly slower than contiguously writing data to the file,
- ** even if that means explicitly writing data to the block of
- ** (JOURNAL_HDR_SZ - 28) bytes that will not be used. So that is what
- ** is done.
- **
- ** The loop is required here in case the sector-size is larger than the
- ** database page size. Since the zHeader buffer is only Pager.pageSize
- ** bytes in size, more than one call to sqlite3OsWrite() may be required
- ** to populate the entire journal header sector.
- */
+ // 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
+ // record is written to the following sector (leaving a gap in the file
+ // that will be implicitly filled in by the OS).
+ //
+ // However it has been discovered that on some systems this pattern can
+ // be significantly slower than contiguously writing data to the file,
+ // even if that means explicitly writing data to the block of
+ // (JOURNAL_HDR_SZ - 28) bytes that will not be used. So that is what
+ // is done.
+ //
+ // The loop is required here in case the sector-size is larger than the
+ // database page size. Since the zHeader buffer is only Pager.pageSize
+ // bytes in size, more than one call to sqlite3OsWrite() may be required
+ // to populate the entire journal header sector.
for nWrite = U32(0); (rc == 0) && (nWrite < ((*Pager)(unsafe.Pointer(pPager)).FsectorSize)); nWrite = nWrite + (nHeader) {
rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zHeader, int32(nHeader), (*Pager)(unsafe.Pointer(pPager)).FjournalOff)
@@ -28150,7 +29152,7 @@ func writeJournalHdr(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:53059:12
// If the journal header file appears to be corrupted, SQLITE_DONE is
// returned and *pNRec and *PDbSize are undefined. If JOURNAL_HDR_SZ bytes
// cannot be read from the journal file an error code is returned.
-func readJournalHdr(tls *crt.TLS, pPager uintptr, isHot int32, journalSize I64, pNRec uintptr, pDbSize uintptr) int32 { /* sqlite3.c:53177:12: */
+func readJournalHdr(tls *libc.TLS, pPager uintptr, isHot int32, journalSize I64, pNRec uintptr, pDbSize uintptr) int32 { /* sqlite3.c:53260:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -28179,7 +29181,7 @@ func readJournalHdr(tls *crt.TLS, pPager uintptr, isHot int32, journalSize I64,
if rc != 0 {
return rc
}
- if crt.Xmemcmp(tls, bp /* &aMagic[0] */, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(unsafe.Sizeof([8]uint8{}))) != 0 {
+ if libc.Xmemcmp(tls, bp /* &aMagic[0] */, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(unsafe.Sizeof([8]uint8{}))) != 0 {
return 101
}
}
@@ -28187,9 +29189,9 @@ func readJournalHdr(tls *crt.TLS, pPager uintptr, isHot int32, journalSize I64,
// Read the first three 32-bit fields of the journal header: The nRec
// field, the checksum-initializer and the database size at the start
// of the transaction. Return an error code if anything goes wrong.
- if ((0 != (crt.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(8)), pNRec)))) ||
- (0 != (crt.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(12)), (pPager+52 /* &.cksumInit */)))))) ||
- (0 != (crt.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(16)), pDbSize)))) {
+ if ((0 != (libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(8)), pNRec)))) ||
+ (0 != (libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(12)), (pPager+52 /* &.cksumInit */)))))) ||
+ (0 != (libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(16)), pDbSize)))) {
return rc
}
@@ -28200,8 +29202,8 @@ func readJournalHdr(tls *crt.TLS, pPager uintptr, isHot int32, journalSize I64,
// Sector-size field of journal header
// Read the page-size and sector-size journal header fields.
- if (0 != (crt.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(20)), bp+8 /* &iSectorSize */)))) ||
- (0 != (crt.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(24)), bp+12 /* &iPageSize */)))) {
+ if (0 != (libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(20)), bp+8 /* &iSectorSize */)))) ||
+ (0 != (libc.AssignInt32(&rc, read32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (iHdrOff+int64(24)), bp+12 /* &iPageSize */)))) {
return rc
}
@@ -28243,77 +29245,76 @@ func readJournalHdr(tls *crt.TLS, pPager uintptr, isHot int32, journalSize I64,
return rc
}
-// Write the supplied master journal name into the journal file for pager
-// pPager at the current location. The master journal name must be the last
+// Write the supplied super-journal name into the journal file for pager
+// pPager at the current location. The super-journal name must be the last
// thing written to a journal file. If the pager is in full-sync mode, the
// journal file descriptor is advanced to the next sector boundary before
// anything is written. The format is:
//
// + 4 bytes: PAGER_MJ_PGNO.
-// + N bytes: Master journal filename in utf-8.
-// + 4 bytes: N (length of master journal name in bytes, no nul-terminator).
-// + 4 bytes: Master journal name checksum.
+// + N bytes: super-journal filename in utf-8.
+// + 4 bytes: N (length of super-journal name in bytes, no nul-terminator).
+// + 4 bytes: super-journal name checksum.
// + 8 bytes: aJournalMagic[].
//
-// The master journal page checksum is the sum of the bytes in the master
-// journal name, where each byte is interpreted as a signed 8-bit integer.
+// The super-journal page checksum is the sum of the bytes in thesuper-journal
+// name, where each byte is interpreted as a signed 8-bit integer.
//
-// If zMaster is a NULL pointer (occurs for a single database transaction),
+// If zSuper is a NULL pointer (occurs for a single database transaction),
// this call is a no-op.
-func writeMasterJournal(tls *crt.TLS, pPager uintptr, zMaster uintptr) int32 { /* sqlite3.c:53302:12: */
+func writeSuperJournal(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:53385:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
- var rc int32 // Return code
- var nMaster int32 // Length of string zMaster
- var iHdrOff I64 // Offset of header in journal file
+ var rc int32 // Return code
+ var nSuper int32 // Length of string zSuper
+ var iHdrOff I64 // Offset of header in journal file
// var jrnlSize I64 at bp, 8
// Size of journal file on disk
- var cksum U32 = U32(0) // Checksum of string zMaster
+ var cksum U32 = U32(0) // Checksum of string zSuper
- if (!(zMaster != 0) ||
+ if (!(zSuper != 0) ||
(int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == 4)) ||
!((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0)) {
return 0
}
- (*Pager)(unsafe.Pointer(pPager)).FsetMaster = U8(1)
+ (*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(1)
- // Calculate the length in bytes and the checksum of zMaster
- for nMaster = 0; *(*int8)(unsafe.Pointer(zMaster + uintptr(nMaster))) != 0; nMaster++ {
- cksum = cksum + (U32(*(*int8)(unsafe.Pointer(zMaster + uintptr(nMaster)))))
+ // Calculate the length in bytes and the checksum of zSuper
+ for nSuper = 0; *(*int8)(unsafe.Pointer(zSuper + uintptr(nSuper))) != 0; nSuper++ {
+ cksum = cksum + (U32(*(*int8)(unsafe.Pointer(zSuper + uintptr(nSuper)))))
}
// If in full-sync mode, advance to the next disk sector before writing
- // the master journal name. This is in case the previous page written to
+ // the super-journal name. This is in case the previous page written to
// the journal has already been synced.
if (*Pager)(unsafe.Pointer(pPager)).FfullSync != 0 {
(*Pager)(unsafe.Pointer(pPager)).FjournalOff = journalHdrOffset(tls, pPager)
}
iHdrOff = (*Pager)(unsafe.Pointer(pPager)).FjournalOff
- // Write the master journal data to the end of the journal file. If
+ // Write the super-journal data to the end of the journal file. If
// an error occurs, return the error code to the caller.
- if ((((0 != (crt.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff, (Pgno((Xsqlite3PendingByte/((*Pager)(unsafe.Pointer(pPager)).FpageSize))+1)))))) ||
- (0 != (crt.AssignInt32(&rc, Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zMaster, nMaster, (iHdrOff+int64(4))))))) ||
- (0 != (crt.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, ((iHdrOff+int64(4))+I64(nMaster)), uint32(nMaster)))))) ||
- (0 != (crt.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (((iHdrOff+int64(4))+I64(nMaster))+int64(4)), cksum))))) ||
- (0 != (crt.AssignInt32(&rc, Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&aJournalMagic)), 8,
- (((iHdrOff+int64(4))+I64(nMaster))+int64(8)))))) {
+ if ((((0 != (libc.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, iHdrOff, (Pgno((Xsqlite3PendingByte/((*Pager)(unsafe.Pointer(pPager)).FpageSize))+1)))))) ||
+ (0 != (libc.AssignInt32(&rc, Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, nSuper, (iHdrOff+int64(4))))))) ||
+ (0 != (libc.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, ((iHdrOff+int64(4))+I64(nSuper)), uint32(nSuper)))))) ||
+ (0 != (libc.AssignInt32(&rc, write32bits(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (((iHdrOff+int64(4))+I64(nSuper))+int64(4)), cksum))))) ||
+ (0 != (libc.AssignInt32(&rc, Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&aJournalMagic)), 8,
+ (((iHdrOff+int64(4))+I64(nSuper))+int64(8)))))) {
return rc
}
- *(*I64)(unsafe.Pointer(pPager + 96 /* &.journalOff */)) += (I64(nMaster + 20))
+ *(*I64)(unsafe.Pointer(pPager + 96 /* &.journalOff */)) += (I64(nSuper + 20))
- /* If the pager is in peristent-journal mode, then the physical
- ** journal-file may extend past the end of the master-journal name
- ** and 8 bytes of magic data just written to the file. This is
- ** dangerous because the code to rollback a hot-journal file
- ** will not be able to find the master-journal name to determine
- ** whether or not the journal is hot.
- **
- ** Easiest thing to do in this scenario is to truncate the journal
- ** file to the required size.
- */
- if (0 == (crt.AssignInt32(&rc, Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp /* &jrnlSize */)))) &&
+ // If the pager is in peristent-journal mode, then the physical
+ // journal-file may extend past the end of the super-journal name
+ // and 8 bytes of magic data just written to the file. This is
+ // dangerous because the code to rollback a hot-journal file
+ // will not be able to find the super-journal name to determine
+ // whether or not the journal is hot.
+ //
+ // Easiest thing to do in this scenario is to truncate the journal
+ // file to the required size.
+ if (0 == (libc.AssignInt32(&rc, Xsqlite3OsFileSize(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp /* &jrnlSize */)))) &&
(*(*I64)(unsafe.Pointer(bp /* jrnlSize */)) > (*Pager)(unsafe.Pointer(pPager)).FjournalOff) {
rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, (*Pager)(unsafe.Pointer(pPager)).FjournalOff)
}
@@ -28321,21 +29322,21 @@ func writeMasterJournal(tls *crt.TLS, pPager uintptr, zMaster uintptr) int32 { /
}
// Discard the entire contents of the in-memory page-cache.
-func pager_reset(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:53370:13: */
+func pager_reset(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53453:13: */
(*Pager)(unsafe.Pointer(pPager)).FiDataVersion++
Xsqlite3BackupRestart(tls, (*Pager)(unsafe.Pointer(pPager)).FpBackup)
Xsqlite3PcacheClear(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
}
// Return the pPager->iDataVersion value
-func Xsqlite3PagerDataVersion(tls *crt.TLS, pPager uintptr) U32 { /* sqlite3.c:53379:20: */
+func Xsqlite3PagerDataVersion(tls *libc.TLS, pPager uintptr) U32 { /* sqlite3.c:53462:20: */
return (*Pager)(unsafe.Pointer(pPager)).FiDataVersion
}
// Free all structures in the Pager.aSavepoint[] array and set both
// Pager.aSavepoint and Pager.nSavepoint to zero. Close the sub-journal
// if it is open and the pager is not in exclusive mode.
-func releaseAllSavepoints(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:53388:13: */
+func releaseAllSavepoints(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53471:13: */
var ii int32 // Iterator for looping through Pager.aSavepoint
for ii = 0; ii < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint; ii++ {
Xsqlite3BitvecDestroy(tls, (*PagerSavepoint)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FaSavepoint+uintptr(ii)*48)).FpInSavepoint)
@@ -28352,7 +29353,7 @@ func releaseAllSavepoints(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:53388:13:
// Set the bit number pgno in the PagerSavepoint.pInSavepoint
// bitvecs of all open savepoints. Return SQLITE_OK if successful
// or SQLITE_NOMEM if a malloc failure occurs.
-func addToSavepointBitvecs(tls *crt.TLS, pPager uintptr, pgno Pgno) int32 { /* sqlite3.c:53407:12: */
+func addToSavepointBitvecs(tls *libc.TLS, pPager uintptr, pgno Pgno) int32 { /* sqlite3.c:53490:12: */
var ii int32 // Loop counter
var rc int32 = 0 // Result code
@@ -28381,7 +29382,7 @@ func addToSavepointBitvecs(tls *crt.TLS, pPager uintptr, pgno Pgno) int32 { /* s
// or not, any journal file left in the file-system will be treated
// as a hot-journal and rolled back the next time a read-transaction
// is opened (by this or by any other connection).
-func pager_unlock(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:53439:13: */
+func pager_unlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53522:13: */
Xsqlite3BitvecDestroy(tls, (*Pager)(unsafe.Pointer(pPager)).FpInJournal)
(*Pager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0)
@@ -28453,7 +29454,7 @@ func pager_unlock(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:53439:13: */
(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
(*Pager)(unsafe.Pointer(pPager)).FjournalHdr = int64(0)
- (*Pager)(unsafe.Pointer(pPager)).FsetMaster = U8(0)
+ (*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(0)
}
// This function is called whenever an IOERR or FULL error that requires
@@ -28473,7 +29474,7 @@ func pager_unlock(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:53439:13: */
// the persistent error occurred, then the rollback journal may need
// to be replayed to restore the contents of the database file (as if
// it were a hot-journal).
-func pager_error(tls *crt.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:53536:12: */
+func pager_error(tls *libc.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:53619:12: */
var rc2 int32 = (rc & 0xff)
if (rc2 == 13) || (rc2 == 10) {
@@ -28498,7 +29499,7 @@ func pager_error(tls *crt.TLS, pPager uintptr, rc int32) int32 { /* sqlite3.c:53
// file has been created already (via a spill on pagerStress()) and
// when the number of dirty pages in memory exceeds 25% of the total
// cache size.
-func pagerFlushOnCommit(tls *crt.TLS, pPager uintptr, bCommit int32) int32 { /* sqlite3.c:53570:12: */
+func pagerFlushOnCommit(tls *libc.TLS, pPager uintptr, bCommit int32) int32 { /* sqlite3.c:53653:12: */
if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 {
return 1
}
@@ -28508,7 +29509,7 @@ func pagerFlushOnCommit(tls *crt.TLS, pPager uintptr, bCommit int32) int32 { /*
if !((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0)) {
return 0
}
- return (crt.Bool32(Xsqlite3PCachePercentDirty(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) >= 25))
+ return (libc.Bool32(Xsqlite3PCachePercentDirty(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) >= 25))
}
// This routine ends a transaction. A transaction is usually ended by
@@ -28562,7 +29563,7 @@ func pagerFlushOnCommit(tls *crt.TLS, pPager uintptr, bCommit int32) int32 { /*
// unlock operation fails as well, then the first error code related
// to the first error encountered (the journal finalization one) is
// returned.
-func pager_end_transaction(tls *crt.TLS, pPager uintptr, hasMaster int32, bCommit int32) int32 { /* sqlite3.c:53630:12: */
+func pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bCommit int32) int32 { /* sqlite3.c:53713:12: */
var rc int32 = 0 // Error code from journal finalization operation
var rc2 int32 = 0 // Error code from db file unlock operation
@@ -28607,14 +29608,14 @@ func pager_end_transaction(tls *crt.TLS, pPager uintptr, hasMaster int32, bCommi
(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
} else if (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) == 1) ||
(((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0) && (int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != 5)) {
- rc = zeroJournalHdr(tls, pPager, (crt.Bool32((hasMaster != 0) || ((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0))))
+ rc = zeroJournalHdr(tls, pPager, (libc.Bool32((hasSuper != 0) || ((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0))))
(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
} else {
// This branch may be executed with Pager.journalMode==MEMORY if
// a hot-journal was just rolled back. In this case the journal
// file should be closed and deleted. If this connection writes to
// the database file, it will do so using an in-memory journal.
- var bDelete int32 = crt.BoolInt32(!((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0))
+ var bDelete int32 = libc.BoolInt32(!((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0))
Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
if bDelete != 0 {
@@ -28663,7 +29664,7 @@ func pager_end_transaction(tls *crt.TLS, pPager uintptr, hasMaster int32, bCommi
rc2 = pagerUnlockDb(tls, pPager, 1)
}
(*Pager)(unsafe.Pointer(pPager)).FeState = U8(1)
- (*Pager)(unsafe.Pointer(pPager)).FsetMaster = U8(0)
+ (*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(0)
return func() int32 {
if rc == 0 {
@@ -28688,7 +29689,7 @@ func pager_end_transaction(tls *crt.TLS, pPager uintptr, hasMaster int32, bCommi
// malloc error occurs during a rollback, then this will itself cause
// the pager to enter the ERROR state. Which will be cleared by the
// call to pager_unlock(), as described above.
-func pagerUnlockAndRollback(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:53777:13: */
+func pagerUnlockAndRollback(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:53860:13: */
if (int32((*Pager)(unsafe.Pointer(pPager)).FeState) != 6) && (int32((*Pager)(unsafe.Pointer(pPager)).FeState) != 0) {
if int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= 2 {
@@ -28720,7 +29721,7 @@ func pagerUnlockAndRollback(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:53777:1
// It is much less likely that the two ends of the journal record will be
// correct and the middle be corrupt. Thus, this "checksum" scheme,
// though fast and simple, catches the mostly likely kind of corruption.
-func pager_cksum(tls *crt.TLS, pPager uintptr, aData uintptr) U32 { /* sqlite3.c:53811:12: */
+func pager_cksum(tls *libc.TLS, pPager uintptr, aData uintptr) U32 { /* sqlite3.c:53894:12: */
var cksum U32 = (*Pager)(unsafe.Pointer(pPager)).FcksumInit // Checksum value to return
var i int32 = ((*Pager)(unsafe.Pointer(pPager)).FpageSize - 200) // Loop counter
for i > 0 {
@@ -28765,7 +29766,7 @@ func pager_cksum(tls *crt.TLS, pPager uintptr, aData uintptr) U32 { /* sqlite3.c
// If this is a savepoint rollback, then memory may have to be dynamically
// allocated by this function. If this is the case and an allocation fails,
// SQLITE_NOMEM is returned.
-func pager_playback_one_page(tls *crt.TLS, pPager uintptr, pOffset uintptr, pDone uintptr, isMainJrnl int32, isSavepnt int32) int32 { /* sqlite3.c:53858:12: */
+func pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pDone uintptr, isMainJrnl int32, isSavepnt int32) int32 { /* sqlite3.c:53941:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -28834,7 +29835,7 @@ func pager_playback_one_page(tls *crt.TLS, pPager uintptr, pOffset uintptr, pDon
// If this page has already been played back before during the current
// rollback, then don't bother to play it back again.
- if (pDone != 0) && ((crt.AssignInt32(&rc, Xsqlite3BitvecSet(tls, pDone, *(*Pgno)(unsafe.Pointer(bp /* pgno */))))) != 0) {
+ if (pDone != 0) && ((libc.AssignInt32(&rc, Xsqlite3BitvecSet(tls, pDone, *(*Pgno)(unsafe.Pointer(bp /* pgno */))))) != 0) {
return rc
}
@@ -28884,9 +29885,9 @@ func pager_playback_one_page(tls *crt.TLS, pPager uintptr, pOffset uintptr, pDon
}
if isMainJrnl != 0 {
- isSynced = (crt.Bool32(((*Pager)(unsafe.Pointer(pPager)).FnoSync != 0) || (*(*I64)(unsafe.Pointer(pOffset)) <= (*Pager)(unsafe.Pointer(pPager)).FjournalHdr)))
+ isSynced = (libc.Bool32(((*Pager)(unsafe.Pointer(pPager)).FnoSync != 0) || (*(*I64)(unsafe.Pointer(pOffset)) <= (*Pager)(unsafe.Pointer(pPager)).FjournalHdr)))
} else {
- isSynced = (crt.Bool32((*(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)) == uintptr(0)) || (0 == (int32((*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)))).Fflags) & 0x008))))
+ isSynced = (libc.Bool32((*(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)) == uintptr(0)) || (0 == (int32((*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)))).Fflags) & 0x008))))
}
if (((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Ffd))).FpMethods != uintptr(0)) &&
((int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= 4) || (int32((*Pager)(unsafe.Pointer(pPager)).FeState) == 0))) &&
@@ -28927,7 +29928,7 @@ func pager_playback_one_page(tls *crt.TLS, pPager uintptr, pOffset uintptr, pDon
*(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) |= U8((0x02))
rc = Xsqlite3PagerGet(tls, pPager, *(*Pgno)(unsafe.Pointer(bp /* pgno */)), bp+8 /* &pPg */, 1)
- *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(0x02))))
+ *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(0x02))))
if rc != 0 {
return rc
}
@@ -28941,8 +29942,8 @@ func pager_playback_one_page(tls *crt.TLS, pPager uintptr, pOffset uintptr, pDon
// sqlite3PagerRollback().
var pData uintptr
pData = (*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)))).FpData
- crt.Xmemcpy(tls, pData, aData, uint64((*Pager)(unsafe.Pointer(pPager)).FpageSize))
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pPager + 264 /* &.xReiniter */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)))
+ libc.Xmemcpy(tls, pData, aData, uint64((*Pager)(unsafe.Pointer(pPager)).FpageSize))
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pPager + 264 /* &.xReiniter */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)))
// It used to be that sqlite3PcacheMakeClean(pPg) was called here. But
// that call was dangerous and had no detectable benefit since the cache
// is normally cleaned by sqlite3PcacheCleanAll() after rollback and so
@@ -28951,43 +29952,43 @@ func pager_playback_one_page(tls *crt.TLS, pPager uintptr, pOffset uintptr, pDon
// If this was page 1, then restore the value of Pager.dbFileVers.
// Do this before any decoding.
if *(*Pgno)(unsafe.Pointer(bp /* pgno */)) == Pgno(1) {
- crt.Xmemcpy(tls, (pPager + 136 /* &.dbFileVers */), ((pData) + uintptr(24)), uint64(unsafe.Sizeof([16]int8{})))
+ libc.Xmemcpy(tls, (pPager + 136 /* &.dbFileVers */), ((pData) + uintptr(24)), uint64(unsafe.Sizeof([16]int8{})))
}
Xsqlite3PcacheRelease(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pPg */)))
}
return rc
}
-// Parameter zMaster is the name of a master journal file. A single journal
-// file that referred to the master journal file has just been rolled back.
-// This routine checks if it is possible to delete the master journal file,
+// Parameter zSuper is the name of a super-journal file. A single journal
+// file that referred to the super-journal file has just been rolled back.
+// This routine checks if it is possible to delete the super-journal file,
// and does so if it is.
//
-// Argument zMaster may point to Pager.pTmpSpace. So that buffer is not
+// Argument zSuper may point to Pager.pTmpSpace. So that buffer is not
// available for use within this function.
//
-// When a master journal file is created, it is populated with the names
+// When a super-journal file is created, it is populated with the names
// of all of its child journals, one after another, formatted as utf-8
// encoded text. The end of each child journal file is marked with a
-// nul-terminator byte (0x00). i.e. the entire contents of a master journal
+// nul-terminator byte (0x00). i.e. the entire contents of a super-journal
// file for a transaction involving two databases might be:
//
// "/home/bill/a.db-journal\x00/home/bill/b.db-journal\x00"
//
-// A master journal file may only be deleted once all of its child
+// A super-journal file may only be deleted once all of its child
// journals have been rolled back.
//
-// This function reads the contents of the master-journal file into
+// This function reads the contents of the super-journal file into
// memory and loops through each of the child journal names. For
// each child journal, it checks if:
//
// * if the child journal exists, and if so
-// * if the child journal contains a reference to master journal
-// file zMaster
+// * if the child journal contains a reference to super-journal
+// file zSuper
//
// If a child journal can be found that matches both of the criteria
// above, this function returns without doing anything. Otherwise, if
-// no such child journal can be found, file zMaster is deleted from
+// no such child journal can be found, file zSuper is deleted from
// the file-system using sqlite3OsDelete().
//
// If an IO error within this function, an error code is returned. This
@@ -28996,98 +29997,99 @@ func pager_playback_one_page(tls *crt.TLS, pPager uintptr, pOffset uintptr, pDon
// occur, SQLITE_OK is returned.
//
// TODO: This function allocates a single block of memory to load
-// the entire contents of the master journal file. This could be
+// the entire contents of the super-journal file. This could be
// a couple of kilobytes or so - potentially larger than the page
// size.
-func pager_delmaster(tls *crt.TLS, pPager uintptr, zMaster uintptr) int32 { /* sqlite3.c:54105:12: */
+func pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:54188:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
var pVfs uintptr
- var rc int32 // Return code
- var pMaster uintptr // Malloc'd master-journal file descriptor
- var pJournal uintptr // Malloc'd child-journal file descriptor
- var zMasterJournal uintptr // Contents of master journal file
- // var nMasterJournal I64 at bp, 8
- // Size of master journal file
- var zJournal uintptr // Pointer to one journal within MJ file
- var zMasterPtr uintptr // Space to hold MJ filename from a journal file
- var nMasterPtr int32
+ var rc int32 // Return code
+ var pSuper uintptr // Malloc'd super-journal file descriptor
+ var pJournal uintptr // Malloc'd child-journal file descriptor
+ var zSuperJournal uintptr // Contents of super-journal file
+ // var nSuperJournal I64 at bp, 8
+ // Size of super-journal file
+ var zJournal uintptr // Pointer to one journal within MJ file
+ var zSuperPtr uintptr // Space to hold super-journal filename
+ var nSuperPtr int32
var flags int32
- // One of the journals pointed to by the master journal exists.
- // Open it and check if it points at the master journal. If
- // so, return without deleting the master journal file.
+ // One of the journals pointed to by the super-journal exists.
+ // Open it and check if it points at the super-journal. If
+ // so, return without deleting the super-journal file.
// NB: zJournal is really a MAIN_JOURNAL. But call it a
- // MASTER_JOURNAL here so that the VFS will not send the zJournal
+ // SUPER_JOURNAL here so that the VFS will not send the zJournal
// name into sqlite3_database_file_object().
var c int32
var flags1 int32
// var exists int32 at bp+8, 4
pVfs = (*Pager)(unsafe.Pointer(pPager)).FpVfs
- zMasterJournal = uintptr(0) // Amount of space allocated to zMasterPtr[]
+ zSuperJournal = uintptr(0) // Amount of space allocated to zSuperPtr[]
- // Allocate space for both the pJournal and pMaster file descriptors.
- // If successful, open the master journal file for reading.
- pMaster = Xsqlite3MallocZero(tls, (uint64((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile * 2)))
- pJournal = ((pMaster) + uintptr((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))
- if !(!(pMaster != 0)) {
+ // Allocate space for both the pJournal and pSuper file descriptors.
+ // If successful, open the super-journal file for reading.
+ pSuper = Xsqlite3MallocZero(tls, (uint64((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile * 2)))
+ if !(!(pSuper != 0)) {
goto __1
}
rc = 7
+ pJournal = uintptr(0)
goto __2
__1:
flags = (0x00000001 | 0x00004000)
- rc = Xsqlite3OsOpen(tls, pVfs, zMaster, pMaster, flags, uintptr(0))
+ rc = Xsqlite3OsOpen(tls, pVfs, zSuper, pSuper, flags, uintptr(0))
+ pJournal = ((pSuper) + uintptr((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))
__2:
;
if !(rc != 0) {
goto __3
}
- goto delmaster_out
+ goto delsuper_out
__3:
;
- // Load the entire master journal file into space obtained from
- // sqlite3_malloc() and pointed to by zMasterJournal. Also obtain
- // sufficient space (in zMasterPtr) to hold the names of master
- // journal files extracted from regular rollback-journals.
- rc = Xsqlite3OsFileSize(tls, pMaster, bp /* &nMasterJournal */)
+ // Load the entire super-journal file into space obtained from
+ // sqlite3_malloc() and pointed to by zSuperJournal. Also obtain
+ // sufficient space (in zSuperPtr) to hold the names of super-journal
+ // files extracted from regular rollback-journals.
+ rc = Xsqlite3OsFileSize(tls, pSuper, bp /* &nSuperJournal */)
if !(rc != 0) {
goto __4
}
- goto delmaster_out
+ goto delsuper_out
__4:
;
- nMasterPtr = ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1)
- zMasterJournal = Xsqlite3Malloc(tls, (uint64((*(*I64)(unsafe.Pointer(bp /* nMasterJournal */)) + I64(nMasterPtr)) + int64(2))))
- if !(!(zMasterJournal != 0)) {
+ nSuperPtr = ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + 1)
+ zSuperJournal = Xsqlite3Malloc(tls, (uint64((*(*I64)(unsafe.Pointer(bp /* nSuperJournal */)) + I64(nSuperPtr)) + int64(2))))
+ if !(!(zSuperJournal != 0)) {
goto __5
}
rc = 7
- goto delmaster_out
+ goto delsuper_out
__5:
;
- zMasterPtr = (zMasterJournal + uintptr((*(*I64)(unsafe.Pointer(bp /* nMasterJournal */)) + int64(2))))
- rc = Xsqlite3OsRead(tls, pMaster, zMasterJournal, int32(*(*I64)(unsafe.Pointer(bp /* nMasterJournal */))), int64(0))
+ zSuperPtr = (zSuperJournal + uintptr((*(*I64)(unsafe.Pointer(bp /* nSuperJournal */)) + int64(2))))
+ rc = Xsqlite3OsRead(tls, pSuper, zSuperJournal, int32(*(*I64)(unsafe.Pointer(bp /* nSuperJournal */))), int64(0))
if !(rc != 0) {
goto __6
}
- goto delmaster_out
+ goto delsuper_out
__6:
;
- *(*int8)(unsafe.Pointer(zMasterJournal + uintptr(*(*I64)(unsafe.Pointer(bp /* nMasterJournal */))))) = int8(0)
- *(*int8)(unsafe.Pointer(zMasterJournal + uintptr((*(*I64)(unsafe.Pointer(bp /* nMasterJournal */)) + int64(1))))) = int8(0)
+ *(*int8)(unsafe.Pointer(zSuperJournal + uintptr(*(*I64)(unsafe.Pointer(bp /* nSuperJournal */))))) = int8(0)
+ *(*int8)(unsafe.Pointer(zSuperJournal + uintptr((*(*I64)(unsafe.Pointer(bp /* nSuperJournal */)) + int64(1))))) = int8(0)
- zJournal = zMasterJournal
+ zJournal = zSuperJournal
__7:
- if !((I64((int64(zJournal) - int64(zMasterJournal)) / 1)) < *(*I64)(unsafe.Pointer(bp /* nMasterJournal */))) {
+ if !((I64((int64(zJournal) - int64(zSuperJournal)) / 1)) < *(*I64)(unsafe.Pointer(bp /* nSuperJournal */))) {
goto __8
}
rc = Xsqlite3OsAccess(tls, pVfs, zJournal, 0, bp+8 /* &exists */)
if !(rc != 0) {
goto __9
}
- goto delmaster_out
+ goto delsuper_out
__9:
;
if !(*(*int32)(unsafe.Pointer(bp + 8 /* exists */)) != 0) {
@@ -29098,25 +30100,25 @@ __9:
if !(rc != 0) {
goto __11
}
- goto delmaster_out
+ goto delsuper_out
__11:
;
- rc = readMasterJournal(tls, pJournal, zMasterPtr, uint32(nMasterPtr))
+ rc = readSuperJournal(tls, pJournal, zSuperPtr, uint32(nSuperPtr))
Xsqlite3OsClose(tls, pJournal)
if !(rc != 0) {
goto __12
}
- goto delmaster_out
+ goto delsuper_out
__12:
;
- c = (crt.Bool32((int32(*(*int8)(unsafe.Pointer(zMasterPtr + uintptr(0)))) != 0) && (crt.Xstrcmp(tls, zMasterPtr, zMaster) == 0)))
+ c = (libc.Bool32((int32(*(*int8)(unsafe.Pointer(zSuperPtr + uintptr(0)))) != 0) && (libc.Xstrcmp(tls, zSuperPtr, zSuper) == 0)))
if !(c != 0) {
goto __13
}
- // We have a match. Do not delete the master journal file.
- goto delmaster_out
+ // We have a match. Do not delete the super-journal file.
+ goto delsuper_out
__13:
;
__10:
@@ -29126,17 +30128,17 @@ __10:
__8:
;
- Xsqlite3OsClose(tls, pMaster)
- rc = Xsqlite3OsDelete(tls, pVfs, zMaster, 0)
+ Xsqlite3OsClose(tls, pSuper)
+ rc = Xsqlite3OsDelete(tls, pVfs, zSuper, 0)
-delmaster_out:
- Xsqlite3_free(tls, zMasterJournal)
- if !(pMaster != 0) {
+delsuper_out:
+ Xsqlite3_free(tls, zSuperJournal)
+ if !(pSuper != 0) {
goto __14
}
- Xsqlite3OsClose(tls, pMaster)
+ Xsqlite3OsClose(tls, pSuper)
- Xsqlite3_free(tls, pMaster)
+ Xsqlite3_free(tls, pSuper)
__14:
;
return rc
@@ -29160,7 +30162,7 @@ __14:
//
// If successful, return SQLITE_OK. If an IO error occurs while modifying
// the database file, return the error code to the caller.
-func pager_truncate(tls *crt.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite3.c:54219:12: */
+func pager_truncate(tls *libc.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite3.c:54303:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -29181,7 +30183,7 @@ func pager_truncate(tls *crt.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite3
rc = Xsqlite3OsTruncate(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, newSize)
} else if (*(*I64)(unsafe.Pointer(bp /* currentSize */)) + I64(szPage)) <= newSize {
var pTmp uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
- crt.Xmemset(tls, pTmp, 0, uint64(szPage))
+ libc.Xmemset(tls, pTmp, 0, uint64(szPage))
rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, pTmp, szPage, (newSize - I64(szPage)))
}
@@ -29195,7 +30197,7 @@ func pager_truncate(tls *crt.TLS, pPager uintptr, nPage Pgno) int32 { /* sqlite3
// Return a sanitized version of the sector-size of OS file pFile. The
// return value is guaranteed to lie between 32 and MAX_SECTOR_SIZE.
-func Xsqlite3SectorSize(tls *crt.TLS, pFile uintptr) int32 { /* sqlite3.c:54255:20: */
+func Xsqlite3SectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:54339:20: */
var iRet int32 = Xsqlite3OsSectorSize(tls, pFile)
if iRet < 32 {
iRet = 512
@@ -29210,7 +30212,7 @@ func Xsqlite3SectorSize(tls *crt.TLS, pFile uintptr) int32 { /* sqlite3.c:54255:
// pager based on the value returned by the xSectorSize method
// of the open database file. The sector size will be used
// to determine the size and alignment of journal header and
-// master journal pointers within created journal files.
+// super-journal pointers within created journal files.
//
// For temporary files the effective sector size is always 512 bytes.
//
@@ -29227,7 +30229,7 @@ func Xsqlite3SectorSize(tls *crt.TLS, pFile uintptr) int32 { /* sqlite3.c:54255:
// (that is what POWERSAFE_OVERWRITE means), so we minimize the sector
// size. For backwards compatibility of the rollback journal file format,
// we cannot reduce the effective sector size below 512.
-func setSectorSize(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:54289:13: */
+func setSectorSize(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:54373:13: */
if ((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0) ||
((Xsqlite3OsDeviceCharacteristics(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd) & 0x00001000) != 0) {
@@ -29295,7 +30297,7 @@ func setSectorSize(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:54289:13: */
// If the journal really is hot, reset the pager cache prior rolling
// back any content. If the journal is merely persistent, no reset is
// needed.
-func pager_playback(tls *crt.TLS, pPager uintptr, isHot int32) int32 { /* sqlite3.c:54362:12: */
+func pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) int32 { /* sqlite3.c:54446:12: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -29310,14 +30312,14 @@ func pager_playback(tls *crt.TLS, pPager uintptr, isHot int32) int32 { /* sqlite
var rc int32 // Result code of a subroutine
// var res int32 at bp+24, 4
// Value returned by sqlite3OsAccess()
- var zMaster uintptr // Name of master journal file if any
+ var zSuper uintptr // Name of super-journal file if any
var needPagerReset int32 // True to reset page prior to first page rollback
var nPlayback int32 // Total number of pages restored from journal
// var savedPageSize U32 at bp+36, 4
pVfs = (*Pager)(unsafe.Pointer(pPager)).FpVfs
*(*Pgno)(unsafe.Pointer(bp + 32 /* mxPg */)) = Pgno(0)
*(*int32)(unsafe.Pointer(bp + 24 /* res */)) = 1
- zMaster = uintptr(0)
+ zSuper = uintptr(0)
nPlayback = 0
*(*U32)(unsafe.Pointer(bp + 36 /* savedPageSize */)) = U32((*Pager)(unsafe.Pointer(pPager)).FpageSize)
@@ -29332,8 +30334,8 @@ func pager_playback(tls *crt.TLS, pPager uintptr, isHot int32) int32 { /* sqlite
__1:
;
- // Read the master journal name from the journal, if it is present.
- // If a master journal file name is specified, but the file is not
+ // Read the super-journal name from the journal, if it is present.
+ // If a super-journal file name is specified, but the file is not
// present on disk, then the journal is not hot and does not need to be
// played back.
//
@@ -29342,15 +30344,15 @@ __1:
// (pPager->pageSize >= pPager->pVfs->mxPathname+1). Using os_unix.c,
// mxPathname is 512, which is the same as the minimum allowable value
// for pageSize.
- zMaster = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
- rc = readMasterJournal(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zMaster, (uint32((*Sqlite3_vfs)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname + 1)))
- if !((rc == 0) && (*(*int8)(unsafe.Pointer(zMaster + uintptr(0))) != 0)) {
+ zSuper = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
+ rc = readSuperJournal(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, (uint32((*Sqlite3_vfs)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname + 1)))
+ if !((rc == 0) && (*(*int8)(unsafe.Pointer(zSuper + uintptr(0))) != 0)) {
goto __2
}
- rc = Xsqlite3OsAccess(tls, pVfs, zMaster, 0, bp+24 /* &res */)
+ rc = Xsqlite3OsAccess(tls, pVfs, zSuper, 0, bp+24 /* &res */)
__2:
;
- zMaster = uintptr(0)
+ zSuper = uintptr(0)
if !((rc != 0) || !(*(*int32)(unsafe.Pointer(bp + 24 /* res */)) != 0)) {
goto __3
}
@@ -29521,8 +30523,8 @@ __22:
if !(rc == 0) {
goto __23
}
- zMaster = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
- rc = readMasterJournal(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zMaster, (uint32((*Sqlite3_vfs)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname + 1)))
+ zSuper = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
+ rc = readSuperJournal(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, zSuper, (uint32((*Sqlite3_vfs)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname + 1)))
__23:
;
if !((rc == 0) &&
@@ -29535,22 +30537,22 @@ __24:
if !(rc == 0) {
goto __25
}
- rc = pager_end_transaction(tls, pPager, (crt.Bool32(int32(*(*int8)(unsafe.Pointer(zMaster + uintptr(0)))) != 0)), 0)
+ rc = pager_end_transaction(tls, pPager, (libc.Bool32(int32(*(*int8)(unsafe.Pointer(zSuper + uintptr(0)))) != 0)), 0)
__25:
;
- if !(((rc == 0) && (*(*int8)(unsafe.Pointer(zMaster + uintptr(0))) != 0)) && (*(*int32)(unsafe.Pointer(bp + 24 /* res */)) != 0)) {
+ if !(((rc == 0) && (*(*int8)(unsafe.Pointer(zSuper + uintptr(0))) != 0)) && (*(*int32)(unsafe.Pointer(bp + 24 /* res */)) != 0)) {
goto __26
}
- // If there was a master journal and this routine will return success,
- // see if it is possible to delete the master journal.
- rc = pager_delmaster(tls, pPager, zMaster)
+ // If there was a super-journal and this routine will return success,
+ // see if it is possible to delete the super-journal.
+ rc = pager_delsuper(tls, pPager, zSuper)
__26:
;
if !((isHot != 0) && (nPlayback != 0)) {
goto __27
}
- Xsqlite3_log(tls, (27 | (int32(2) << 8)), ts+3411, /* "recovered %d pag..." */
- crt.VaList(bp, nPlayback, (*Pager)(unsafe.Pointer(pPager)).FzJournal))
+ Xsqlite3_log(tls, (27 | (int32(2) << 8)), ts+5546, /* "recovered %d pag..." */
+ libc.VaList(bp, nPlayback, (*Pager)(unsafe.Pointer(pPager)).FzJournal))
__27:
;
@@ -29571,7 +30573,7 @@ __27:
//
// If an IO error occurs, then the IO error is returned to the caller.
// Otherwise, SQLITE_OK is returned.
-func readDbPage(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:54573:12: */
+func readDbPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:54657:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -29609,10 +30611,10 @@ func readDbPage(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:54573:12: */
// 24..39 of the database are white noise. But the probability of
// white noise equaling 16 bytes of 0xff is vanishingly small so
// we should still be ok.
- crt.Xmemset(tls, pPager+136 /* &.dbFileVers */, 0xff, uint64(unsafe.Sizeof([16]int8{})))
+ libc.Xmemset(tls, pPager+136 /* &.dbFileVers */, 0xff, uint64(unsafe.Sizeof([16]int8{})))
} else {
var dbFileVers uintptr = (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(24))
- crt.Xmemcpy(tls, (pPager + 136 /* &.dbFileVers */), dbFileVers, uint64(unsafe.Sizeof([16]int8{})))
+ libc.Xmemcpy(tls, (pPager + 136 /* &.dbFileVers */), dbFileVers, uint64(unsafe.Sizeof([16]int8{})))
}
}
Xsqlite3_pager_readdb_count++
@@ -29627,7 +30629,7 @@ func readDbPage(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:54573:12: */
// This is an unconditional update. See also the pager_incr_changecounter()
// routine which only updates the change-counter if the update is actually
// needed, as determined by the pPager->changeCountDone state variable.
-func pager_write_changecounter(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:54636:13: */
+func pager_write_changecounter(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:54720:13: */
var change_counter U32
// Increment the value just read and write it back to byte 24.
@@ -29638,7 +30640,7 @@ func pager_write_changecounter(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:54636:1
// bytes 92..95 store the change counter for which the version number
// is valid.
Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(92)), change_counter)
- Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(96)), uint32(3032003))
+ Xsqlite3Put4byte(tls, (((*PgHdr)(unsafe.Pointer(pPg)).FpData) + uintptr(96)), uint32(3033000))
}
// This function is invoked once for each page that has already been
@@ -29651,7 +30653,7 @@ func pager_write_changecounter(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:54636:1
// references, the page content is reloaded from the database. If the
// attempt to reload content from the database is required and fails,
// return an SQLite error code. Otherwise, SQLITE_OK.
-func pagerUndoCallback(tls *crt.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3.c:54663:12: */
+func pagerUndoCallback(tls *libc.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3.c:54747:12: */
var rc int32 = 0
var pPager uintptr = pCtx
var pPg uintptr
@@ -29663,7 +30665,7 @@ func pagerUndoCallback(tls *crt.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3.
} else {
rc = readDbPage(tls, pPg)
if rc == 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pPager + 264 /* &.xReiniter */))))(tls, pPg)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pPager + 264 /* &.xReiniter */))))(tls, pPg)
}
Xsqlite3PagerUnrefNotNull(tls, pPg)
}
@@ -29682,7 +30684,7 @@ func pagerUndoCallback(tls *crt.TLS, pCtx uintptr, iPg Pgno) int32 { /* sqlite3.
}
// This function is called to rollback a transaction on a WAL database.
-func pagerRollbackWal(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:54698:12: */
+func pagerRollbackWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54782:12: */
var rc int32 // Return Code
var pList uintptr // List of dirty pages to revert
@@ -29694,7 +30696,7 @@ func pagerRollbackWal(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:54698:1
// + Reload page content from the database (if refcount>0).
(*Pager)(unsafe.Pointer(pPager)).FdbSize = (*Pager)(unsafe.Pointer(pPager)).FdbOrigSize
rc = Xsqlite3WalUndo(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, Pgno) int32
+ f func(*libc.TLS, uintptr, Pgno) int32
}{pagerUndoCallback})), pPager)
pList = Xsqlite3PcacheDirtyList(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
for (pList != 0) && (rc == 0) {
@@ -29706,16 +30708,14 @@ func pagerRollbackWal(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:54698:1
return rc
}
-/*
-** This function is a wrapper around sqlite3WalFrames(). As well as logging
-** the contents of the list of pages headed by pList (connected by pDirty),
-** this function notifies any active backup processes that the pages have
-** changed.
-**
-** The list of pages passed into this routine is always sorted by page number.
-** Hence, if page 1 appears anywhere on the list, it will be the first page.
- */
-func pagerWalFrames(tls *crt.TLS, pPager uintptr, pList uintptr, nTruncate Pgno, isCommit int32) int32 { /* sqlite3.c:54730:12: */
+// This function is a wrapper around sqlite3WalFrames(). As well as logging
+// the contents of the list of pages headed by pList (connected by pDirty),
+// this function notifies any active backup processes that the pages have
+// changed.
+//
+// The list of pages passed into this routine is always sorted by page number.
+// Hence, if page 1 appears anywhere on the list, it will be the first page.
+func pagerWalFrames(tls *libc.TLS, pPager uintptr, pList uintptr, nTruncate Pgno, isCommit int32) int32 { /* sqlite3.c:54814:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = pList
@@ -29731,7 +30731,7 @@ func pagerWalFrames(tls *crt.TLS, pPager uintptr, pList uintptr, nTruncate Pgno,
// list here.
var ppNext uintptr = bp /* &pList */
nList = 0
- for p = *(*uintptr)(unsafe.Pointer(bp /* pList */)); (crt.AssignPtrUintptr(ppNext, p)) != uintptr(0); p = (*PgHdr)(unsafe.Pointer(p)).FpDirty {
+ for p = *(*uintptr)(unsafe.Pointer(bp /* pList */)); (libc.AssignPtrUintptr(ppNext, p)) != uintptr(0); p = (*PgHdr)(unsafe.Pointer(p)).FpDirty {
if (*PgHdr)(unsafe.Pointer(p)).Fpgno <= nTruncate {
ppNext = (p + 32 /* &.pDirty */)
nList++
@@ -29762,7 +30762,7 @@ func pagerWalFrames(tls *crt.TLS, pPager uintptr, pList uintptr, nTruncate Pgno,
// makes a snapshot of the database at the current point in time and preserves
// that snapshot for use by the reader in spite of concurrently changes by
// other writers or checkpointers.
-func pagerBeginReadTransaction(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:54797:12: */
+func pagerBeginReadTransaction(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54881:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -29793,7 +30793,7 @@ func pagerBeginReadTransaction(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.
// If no error occurs, SQLITE_OK is returned and the size of the database
// in pages is stored in *pnPage. Otherwise, an error code (perhaps
// SQLITE_IOERR_FSTAT) is returned and *pnPage is left unmodified.
-func pagerPagecount(tls *crt.TLS, pPager uintptr, pnPage uintptr) int32 { /* sqlite3.c:54830:12: */
+func pagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) int32 { /* sqlite3.c:54914:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -29847,7 +30847,7 @@ func pagerPagecount(tls *crt.TLS, pPager uintptr, pnPage uintptr) int32 { /* sql
// a WAL on a none-empty database, this ensures there is no race condition
// between the xAccess() below and an xDelete() being executed by some
// other connection.
-func pagerOpenWalIfPresent(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:54890:12: */
+func pagerOpenWalIfPresent(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:54974:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -29882,7 +30882,7 @@ func pagerOpenWalIfPresent(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:54
}
// Playback savepoint pSavepoint. Or, if pSavepoint==NULL, then playback
-// the entire master journal file. The case pSavepoint==NULL occurs when
+// the entire super-journal file. The case pSavepoint==NULL occurs when
// a ROLLBACK TO command is invoked on a SAVEPOINT that is a transaction
// savepoint.
//
@@ -29915,7 +30915,7 @@ func pagerOpenWalIfPresent(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:54
// is reset to the value that it held at the start of the savepoint
// (or transaction). No page with a page-number greater than this value
// is played back. If one is encountered it is simply skipped.
-func pagerPlaybackSavepoint(tls *crt.TLS, pPager uintptr, pSavepoint uintptr) int32 { /* sqlite3.c:54957:12: */
+func pagerPlaybackSavepoint(tls *libc.TLS, pPager uintptr, pSavepoint uintptr) int32 { /* sqlite3.c:55041:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -30021,18 +31021,18 @@ func pagerPlaybackSavepoint(tls *crt.TLS, pPager uintptr, pSavepoint uintptr) in
// Change the maximum number of in-memory pages that are allowed
// before attempting to recycle clean and unused pages.
-func Xsqlite3PagerSetCachesize(tls *crt.TLS, pPager uintptr, mxPage int32) { /* sqlite3.c:55069:21: */
+func Xsqlite3PagerSetCachesize(tls *libc.TLS, pPager uintptr, mxPage int32) { /* sqlite3.c:55153:21: */
Xsqlite3PcacheSetCachesize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, mxPage)
}
// Change the maximum number of in-memory pages that are allowed
// before attempting to spill pages to journal.
-func Xsqlite3PagerSetSpillsize(tls *crt.TLS, pPager uintptr, mxPage int32) int32 { /* sqlite3.c:55077:20: */
+func Xsqlite3PagerSetSpillsize(tls *libc.TLS, pPager uintptr, mxPage int32) int32 { /* sqlite3.c:55161:20: */
return Xsqlite3PcacheSetSpillsize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, mxPage)
}
// Invoke SQLITE_FCNTL_MMAP_SIZE based on the current value of szMmap.
-func pagerFixMaplimit(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:55084:13: */
+func pagerFixMaplimit(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55168:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -30041,20 +31041,20 @@ func pagerFixMaplimit(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:55084:13: */
// var sz Sqlite3_int64 at bp, 8
*(*Sqlite3_int64)(unsafe.Pointer(bp /* sz */)) = (*Pager)(unsafe.Pointer(pPager)).FszMmap
- (*Pager)(unsafe.Pointer(pPager)).FbUseFetch = (U8(crt.Bool32(*(*Sqlite3_int64)(unsafe.Pointer(bp /* sz */)) > int64(0))))
+ (*Pager)(unsafe.Pointer(pPager)).FbUseFetch = (U8(libc.Bool32(*(*Sqlite3_int64)(unsafe.Pointer(bp /* sz */)) > int64(0))))
setGetterMethod(tls, pPager)
Xsqlite3OsFileControlHint(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, 18, bp /* &sz */)
}
}
// Change the maximum size of any memory mapping made of the database file.
-func Xsqlite3PagerSetMmapLimit(tls *crt.TLS, pPager uintptr, szMmap Sqlite3_int64) { /* sqlite3.c:55100:21: */
+func Xsqlite3PagerSetMmapLimit(tls *libc.TLS, pPager uintptr, szMmap Sqlite3_int64) { /* sqlite3.c:55184:21: */
(*Pager)(unsafe.Pointer(pPager)).FszMmap = szMmap
pagerFixMaplimit(tls, pPager)
}
// Free as much memory as possible from the pager.
-func Xsqlite3PagerShrink(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:55108:21: */
+func Xsqlite3PagerShrink(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55192:21: */
Xsqlite3PcacheShrink(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
}
@@ -30107,7 +31107,7 @@ func Xsqlite3PagerShrink(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:55108:21:
//
// Numeric values associated with these states are OFF==1, NORMAL=2,
// and FULL=3.
-func Xsqlite3PagerSetFlags(tls *crt.TLS, pPager uintptr, pgFlags uint32) { /* sqlite3.c:55164:21: */
+func Xsqlite3PagerSetFlags(tls *libc.TLS, pPager uintptr, pgFlags uint32) { /* sqlite3.c:55248:21: */
var level uint32 = (pgFlags & uint32(0x07))
if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 {
(*Pager)(unsafe.Pointer(pPager)).FnoSync = U8(1)
@@ -30148,7 +31148,7 @@ func Xsqlite3PagerSetFlags(tls *crt.TLS, pPager uintptr, pgFlags uint32) { /* sq
*(*U8)(unsafe.Pointer(pPager + 15 /* &.walSyncFlags */)) |= U8((int32(0x00003) << 2))
}
if (pgFlags & uint32(0x20)) != 0 {
- *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(0x01))))
+ *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(0x01))))
} else {
*(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) |= U8((0x01))
}
@@ -30157,7 +31157,7 @@ func Xsqlite3PagerSetFlags(tls *crt.TLS, pPager uintptr, pgFlags uint32) { /* sq
// The following global variable is incremented whenever the library
// attempts to open a temporary file. This information is used for
// testing and analysis only.
-var Xsqlite3_opentemp_count int32 = 0 /* sqlite3.c:55206:16 */
+var Xsqlite3_opentemp_count int32 = 0 /* sqlite3.c:55290:16 */
// Open a temporary file.
//
@@ -30172,7 +31172,7 @@ var Xsqlite3_opentemp_count int32 = 0 /* sqlite3.c:55206:16 */
// SQLITE_OPEN_CREATE
// SQLITE_OPEN_EXCLUSIVE
// SQLITE_OPEN_DELETEONCLOSE
-func pagerOpentemp(tls *crt.TLS, pPager uintptr, pFile uintptr, vfsFlags int32) int32 { /* sqlite3.c:55224:12: */
+func pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32) int32 { /* sqlite3.c:55308:12: */
var rc int32 // Return code
Xsqlite3_opentemp_count++ // Used for testing and analysis only
@@ -30202,7 +31202,7 @@ func pagerOpentemp(tls *crt.TLS, pPager uintptr, pFile uintptr, vfsFlags int32)
// If the busy-handler callback returns non-zero, the lock is
// retried. If it returns zero, then the SQLITE_BUSY error is
// returned to the caller of the pager API function.
-func Xsqlite3PagerSetBusyHandler(tls *crt.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { /* sqlite3.c:55263:21: */
+func Xsqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { /* sqlite3.c:55347:21: */
var ap uintptr
(*Pager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler
(*Pager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg
@@ -30239,7 +31239,7 @@ func Xsqlite3PagerSetBusyHandler(tls *crt.TLS, pPager uintptr, xBusyHandler uint
// conditions above is not true, the pager was in error state when this
// function was called, or because the memory allocation attempt failed,
// then *pPageSize is set to the old, retained page size before returning.
-func Xsqlite3PagerSetPagesize(tls *crt.TLS, pPager uintptr, pPageSize uintptr, nReserve int32) int32 { /* sqlite3.c:55307:20: */
+func Xsqlite3PagerSetPagesize(tls *libc.TLS, pPager uintptr, pPageSize uintptr, nReserve int32) int32 { /* sqlite3.c:55391:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -30272,7 +31272,7 @@ func Xsqlite3PagerSetPagesize(tls *crt.TLS, pPager uintptr, pPageSize uintptr, n
if !(pNew != 0) {
rc = 7
} else {
- crt.Xmemset(tls, (pNew + uintptr(pageSize)), 0, uint64(8))
+ libc.Xmemset(tls, (pNew + uintptr(pageSize)), 0, uint64(8))
}
}
@@ -30308,7 +31308,7 @@ func Xsqlite3PagerSetPagesize(tls *crt.TLS, pPager uintptr, pPageSize uintptr, n
// during rollback and will be overwritten whenever a rollback
// occurs. But other modules are free to use it too, as long as
// no rollbacks are happening.
-func Xsqlite3PagerTempSpace(tls *crt.TLS, pPager uintptr) uintptr { /* sqlite3.c:55375:21: */
+func Xsqlite3PagerTempSpace(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:55459:21: */
return (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
}
@@ -30317,24 +31317,24 @@ func Xsqlite3PagerTempSpace(tls *crt.TLS, pPager uintptr) uintptr { /* sqlite3.c
// maximum page count below the current size of the database.
//
// Regardless of mxPage, return the current maximum page count.
-func Xsqlite3PagerMaxPageCount(tls *crt.TLS, pPager uintptr, mxPage int32) int32 { /* sqlite3.c:55386:20: */
- if mxPage > 0 {
- (*Pager)(unsafe.Pointer(pPager)).FmxPgno = Pgno(mxPage)
+func Xsqlite3PagerMaxPageCount(tls *libc.TLS, pPager uintptr, mxPage Pgno) Pgno { /* sqlite3.c:55470:21: */
+ if mxPage > Pgno(0) {
+ (*Pager)(unsafe.Pointer(pPager)).FmxPgno = mxPage
}
// Called only by OP_MaxPgcnt
// assert( pPager->mxPgno>=pPager->dbSize );
// OP_MaxPgcnt ensures that the parameter passed to this function is not
// less than the total number of valid pages in the database. But this
// may be less than Pager.dbSize, and so the assert() above is not valid
- return int32((*Pager)(unsafe.Pointer(pPager)).FmxPgno)
+ return (*Pager)(unsafe.Pointer(pPager)).FmxPgno
}
-var saved_cnt int32 /* sqlite3.c:55409:12: */
-func Xdisable_simulated_io_errors(tls *crt.TLS) { /* sqlite3.c:55410:6: */
+var saved_cnt int32 /* sqlite3.c:55493:12: */
+func Xdisable_simulated_io_errors(tls *libc.TLS) { /* sqlite3.c:55494:6: */
saved_cnt = Xsqlite3_io_error_pending
Xsqlite3_io_error_pending = -1
}
-func Xenable_simulated_io_errors(tls *crt.TLS) { /* sqlite3.c:55414:6: */
+func Xenable_simulated_io_errors(tls *libc.TLS) { /* sqlite3.c:55498:6: */
Xsqlite3_io_error_pending = saved_cnt
}
@@ -30350,9 +31350,9 @@ func Xenable_simulated_io_errors(tls *crt.TLS) { /* sqlite3.c:55414:6: */
// If any IO error apart from SQLITE_IOERR_SHORT_READ is encountered,
// the error code is returned to the caller and the contents of the
// output buffer undefined.
-func Xsqlite3PagerReadFileheader(tls *crt.TLS, pPager uintptr, N int32, pDest uintptr) int32 { /* sqlite3.c:55436:20: */
+func Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest uintptr) int32 { /* sqlite3.c:55520:20: */
var rc int32 = 0
- crt.Xmemset(tls, pDest, 0, uint64(N))
+ libc.Xmemset(tls, pDest, 0, uint64(N))
// This routine is only called by btree immediately after creating
// the Pager object. There has not been an opportunity to transition
@@ -30373,7 +31373,7 @@ func Xsqlite3PagerReadFileheader(tls *crt.TLS, pPager uintptr, N int32, pDest ui
//
// However, if the file is between 1 and <page-size> bytes in size, then
// this is considered a 1 page file.
-func Xsqlite3PagerPagecount(tls *crt.TLS, pPager uintptr, pnPage uintptr) { /* sqlite3.c:55464:21: */
+func Xsqlite3PagerPagecount(tls *libc.TLS, pPager uintptr, pnPage uintptr) { /* sqlite3.c:55548:21: */
*(*int32)(unsafe.Pointer(pnPage)) = int32((*Pager)(unsafe.Pointer(pPager)).FdbSize)
}
@@ -30390,7 +31390,7 @@ func Xsqlite3PagerPagecount(tls *crt.TLS, pPager uintptr, pnPage uintptr) { /* s
// Return SQLITE_OK on success and an error code if we cannot obtain
// the lock. If the lock is obtained successfully, set the Pager.state
// variable to locktype before returning.
-func pager_wait_on_lock(tls *crt.TLS, pPager uintptr, locktype int32) int32 { /* sqlite3.c:55485:12: */
+func pager_wait_on_lock(tls *libc.TLS, pPager uintptr, locktype int32) int32 { /* sqlite3.c:55569:12: */
var rc int32 // Return code
// Check that this is either a no-op (because the requested lock is
@@ -30398,7 +31398,7 @@ func pager_wait_on_lock(tls *crt.TLS, pPager uintptr, locktype int32) int32 { /*
// may be invoked during, according to the comment above
// sqlite3PagerSetBusyhandler().
- for ok := true; ok; ok = ((rc == 5) && ((*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((pPager + 224 /* &.xBusyHandler */))))(tls, (*Pager)(unsafe.Pointer(pPager)).FpBusyHandlerArg) != 0)) {
+ for ok := true; ok; ok = ((rc == 5) && ((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pPager + 224 /* &.xBusyHandler */))))(tls, (*Pager)(unsafe.Pointer(pPager)).FpBusyHandlerArg) != 0)) {
rc = pagerLockDb(tls, pPager, locktype)
}
return rc
@@ -30434,7 +31434,7 @@ func pager_wait_on_lock(tls *crt.TLS, pPager uintptr, locktype int32) int32 { /*
// Once this function has been called, the transaction must either be
// rolled back or committed. It is not safe to call this function and
// then continue writing to the database.
-func Xsqlite3PagerTruncateImage(tls *crt.TLS, pPager uintptr, nPage Pgno) { /* sqlite3.c:55549:21: */
+func Xsqlite3PagerTruncateImage(tls *libc.TLS, pPager uintptr, nPage Pgno) { /* sqlite3.c:55633:21: */
(*Pager)(unsafe.Pointer(pPager)).FdbSize = nPage
@@ -30461,7 +31461,7 @@ func Xsqlite3PagerTruncateImage(tls *crt.TLS, pPager uintptr, nPage Pgno) { /* s
//
// If everything goes as planned, SQLITE_OK is returned. Otherwise,
// an SQLite error code.
-func pagerSyncHotJournal(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:55580:12: */
+func pagerSyncHotJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55664:12: */
var rc int32 = 0
if !(int32((*Pager)(unsafe.Pointer(pPager)).FnoSync) != 0) {
rc = Xsqlite3OsSync(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, 0x00002)
@@ -30480,17 +31480,17 @@ func pagerSyncHotJournal(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:5558
//
// Page references obtained by calling this function should be released
// by calling pagerReleaseMapPage().
-func pagerAcquireMapPage(tls *crt.TLS, pPager uintptr, pgno Pgno, pData uintptr, ppPage uintptr) int32 { /* sqlite3.c:55602:12: */
+func pagerAcquireMapPage(tls *libc.TLS, pPager uintptr, pgno Pgno, pData uintptr, ppPage uintptr) int32 { /* sqlite3.c:55686:12: */
var p uintptr // Memory mapped page to return
if (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist != 0 {
- *(*uintptr)(unsafe.Pointer(ppPage)) = crt.AssignUintptr(&p, (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist)
+ *(*uintptr)(unsafe.Pointer(ppPage)) = libc.AssignUintptr(&p, (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist)
(*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist = (*PgHdr)(unsafe.Pointer(p)).FpDirty
(*PgHdr)(unsafe.Pointer(p)).FpDirty = uintptr(0)
- crt.Xmemset(tls, (*PgHdr)(unsafe.Pointer(p)).FpExtra, 0, uint64(8))
+ libc.Xmemset(tls, (*PgHdr)(unsafe.Pointer(p)).FpExtra, 0, uint64(8))
} else {
- *(*uintptr)(unsafe.Pointer(ppPage)) = crt.AssignUintptr(&p, Xsqlite3MallocZero(tls, (uint64(uint64(unsafe.Sizeof(PgHdr{}))+uint64((*Pager)(unsafe.Pointer(pPager)).FnExtra)))))
+ *(*uintptr)(unsafe.Pointer(ppPage)) = libc.AssignUintptr(&p, Xsqlite3MallocZero(tls, (uint64(uint64(unsafe.Sizeof(PgHdr{}))+uint64((*Pager)(unsafe.Pointer(pPager)).FnExtra)))))
if p == uintptr(0) {
Xsqlite3OsUnfetch(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, ((I64(pgno - Pgno(1))) * I64((*Pager)(unsafe.Pointer(pPager)).FpageSize)), pData)
return 7
@@ -30510,7 +31510,7 @@ func pagerAcquireMapPage(tls *crt.TLS, pPager uintptr, pgno Pgno, pData uintptr,
// Release a reference to page pPg. pPg must have been returned by an
// earlier call to pagerAcquireMapPage().
-func pagerReleaseMapPage(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:55646:13: */
+func pagerReleaseMapPage(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55730:13: */
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
(*Pager)(unsafe.Pointer(pPager)).FnMmapOut--
(*PgHdr)(unsafe.Pointer(pPg)).FpDirty = (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist
@@ -30520,7 +31520,7 @@ func pagerReleaseMapPage(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:55646:13: */
}
// Free all PgHdr objects stored in the Pager.pMmapFreelist list.
-func pagerFreeMapHdrs(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:55659:13: */
+func pagerFreeMapHdrs(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:55743:13: */
var p uintptr
var pNext uintptr
for p = (*Pager)(unsafe.Pointer(pPager)).FpMmapFreelist; p != 0; p = pNext {
@@ -30533,7 +31533,7 @@ func pagerFreeMapHdrs(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:55659:13: */
// under the pager. Return SQLITE_OK if the database is still where it ought
// to be on disk. Return non-zero (SQLITE_READONLY_DBMOVED or some other error
// code from sqlite3OsAccess()) if the database has gone missing.
-func databaseIsUnmoved(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:55673:12: */
+func databaseIsUnmoved(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:55757:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -30571,7 +31571,7 @@ func databaseIsUnmoved(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:55673:
// is made to roll it back. If an error occurs during the rollback
// a hot journal may be left in the filesystem but no error is returned
// to the caller.
-func Xsqlite3PagerClose(tls *crt.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:55707:20: */
+func Xsqlite3PagerClose(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:55791:20: */
var pTmp uintptr = (*Pager)(unsafe.Pointer(pPager)).FpTmpSpace
Xdisable_simulated_io_errors(tls)
@@ -30621,12 +31621,12 @@ func Xsqlite3PagerClose(tls *crt.TLS, pPager uintptr, db uintptr) int32 { /* sql
}
// Return the page number for page pPg.
-func Xsqlite3PagerPagenumber(tls *crt.TLS, pPg uintptr) Pgno { /* sqlite3.c:55768:21: */
+func Xsqlite3PagerPagenumber(tls *libc.TLS, pPg uintptr) Pgno { /* sqlite3.c:55852:21: */
return (*DbPage)(unsafe.Pointer(pPg)).Fpgno
}
// Increment the reference count for page pPg.
-func Xsqlite3PagerRef(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:55776:21: */
+func Xsqlite3PagerRef(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:55860:21: */
Xsqlite3PcacheRef(tls, pPg)
}
@@ -30663,7 +31663,7 @@ func Xsqlite3PagerRef(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:55776:21: */
// If successful, this routine clears the PGHDR_NEED_SYNC flag of every
// page currently held in memory before returning SQLITE_OK. If an IO
// error is encountered, then the IO error code is returned to the caller.
-func syncJournal(tls *crt.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3.c:55815:12: */
+func syncJournal(tls *libc.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3.c:55899:12: */
bp := tls.Alloc(20)
defer tls.Free(20)
@@ -30706,12 +31706,12 @@ func syncJournal(tls *crt.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3.
// var zHeader [12]U8 at bp, 12
- crt.Xmemcpy(tls, bp /* &zHeader[0] */, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(unsafe.Sizeof(aJournalMagic)))
+ libc.Xmemcpy(tls, bp /* &zHeader[0] */, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(unsafe.Sizeof(aJournalMagic)))
Xsqlite3Put4byte(tls, (bp /* &zHeader */ + uintptr(uint64(unsafe.Sizeof(aJournalMagic)))), uint32((*Pager)(unsafe.Pointer(pPager)).FnRec))
iNextHdrOffset = journalHdrOffset(tls, pPager)
rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, bp+12 /* &aMagic[0] */, 8, iNextHdrOffset)
- if (rc == 0) && (0 == crt.Xmemcmp(tls, bp+12 /* &aMagic[0] */, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(8))) {
+ if (rc == 0) && (0 == libc.Xmemcmp(tls, bp+12 /* &aMagic[0] */, uintptr(unsafe.Pointer(&aJournalMagic)), uint64(8))) {
rc = Xsqlite3OsWrite(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd, uintptr(unsafe.Pointer(&zerobyte)), 1, iNextHdrOffset)
}
if (rc != 0) && (rc != (10 | (int32(2) << 8))) {
@@ -30777,7 +31777,7 @@ func syncJournal(tls *crt.TLS, pPager uintptr, newHdr int32) int32 { /* sqlite3.
return 0
}
-var zerobyte U8 = U8(0) /* sqlite3.c:55866:27 */
+var zerobyte U8 = U8(0) /* sqlite3.c:55950:27 */
// The argument is the first in a linked list of dirty pages connected
// by the PgHdr.pDirty pointer. This function writes each one of the
@@ -30809,7 +31809,7 @@ var zerobyte U8 = U8(0) /* sqlite3.c:55866:27 */
// If everything is successful, SQLITE_OK is returned. If an IO error
// occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot
// be obtained, SQLITE_BUSY is returned.
-func pager_write_pagelist(tls *crt.TLS, pPager uintptr, pList uintptr) int32 { /* sqlite3.c:55958:12: */
+func pager_write_pagelist(tls *libc.TLS, pPager uintptr, pList uintptr) int32 { /* sqlite3.c:56042:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -30848,7 +31848,7 @@ func pager_write_pagelist(tls *crt.TLS, pPager uintptr, pList uintptr) int32 { /
// set (set by sqlite3PagerDontWrite()).
if (pgno <= (*Pager)(unsafe.Pointer(pPager)).FdbSize) && (0 == (int32((*PgHdr)(unsafe.Pointer(pList)).Fflags) & 0x010)) {
var offset I64 = ((I64(pgno - Pgno(1))) * I64((*Pager)(unsafe.Pointer(pPager)).FpageSize)) // Offset to write
- var pData uintptr /* Data to write */
+ var pData uintptr // Data to write
if (*PgHdr)(unsafe.Pointer(pList)).Fpgno == Pgno(1) {
pager_write_changecounter(tls, pList)
@@ -30863,7 +31863,7 @@ func pager_write_pagelist(tls *crt.TLS, pPager uintptr, pList uintptr) int32 { /
// the value now stored in the database file. If writing this
// page caused the database file to grow, update dbFileSize.
if pgno == Pgno(1) {
- crt.Xmemcpy(tls, (pPager + 136 /* &.dbFileVers */), (pData + uintptr(24)), uint64(unsafe.Sizeof([16]int8{})))
+ libc.Xmemcpy(tls, (pPager + 136 /* &.dbFileVers */), (pData + uintptr(24)), uint64(unsafe.Sizeof([16]int8{})))
}
if pgno > (*Pager)(unsafe.Pointer(pPager)).FdbFileSize {
(*Pager)(unsafe.Pointer(pPager)).FdbFileSize = pgno
@@ -30889,7 +31889,7 @@ func pager_write_pagelist(tls *crt.TLS, pPager uintptr, pList uintptr) int32 { /
// SQLITE_OK is returned if everything goes according to plan. An
// SQLITE_IOERR_XXX error code is returned if a call to sqlite3OsOpen()
// fails.
-func openSubJournal(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:56049:12: */
+func openSubJournal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56133:12: */
var rc int32 = 0
if !((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fsjfd))).FpMethods != uintptr(0)) {
var flags int32 = ((((0x00002000 | 0x00000002) |
@@ -30913,7 +31913,7 @@ func openSubJournal(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:56049:12:
// error code if the attempt to write to the sub-journal fails, or
// SQLITE_NOMEM if a malloc fails while setting a bit in a savepoint
// bitvec.
-func subjournalPage(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:56075:12: */
+func subjournalPage(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:56159:12: */
var rc int32 = 0
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
if int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode) != 2 {
@@ -30943,7 +31943,7 @@ func subjournalPage(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:56075:12: */
}
return rc
}
-func subjournalPageIfRequired(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:56111:12: */
+func subjournalPageIfRequired(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:56195:12: */
if subjRequiresPage(tls, pPg) != 0 {
return subjournalPage(tls, pPg)
} else {
@@ -30969,7 +31969,7 @@ func subjournalPageIfRequired(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:56
// page clean, the IO error code is returned. If the page cannot be
// made clean for some other reason, but no error occurs, then SQLITE_OK
// is returned by sqlite3PcacheMakeClean() is not called.
-func pagerStress(tls *crt.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:56138:12: */
+func pagerStress(tls *libc.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:56222:12: */
var pPager uintptr = p
var rc int32 = 0
@@ -31031,7 +32031,7 @@ func pagerStress(tls *crt.TLS, p uintptr, pPg uintptr) int32 { /* sqlite3.c:5613
}
// Flush all unreferenced dirty pages to disk.
-func Xsqlite3PagerFlush(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:56215:20: */
+func Xsqlite3PagerFlush(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56299:20: */
var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode
if !(int32((*Pager)(unsafe.Pointer(pPager)).FmemDb) != 0) {
var pList uintptr = Xsqlite3PcacheDirtyList(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
@@ -31078,7 +32078,7 @@ func Xsqlite3PagerFlush(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:56215
// and error code returned. This function may return SQLITE_NOMEM
// (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or
// various SQLITE_IO_XXX errors.
-func Xsqlite3PagerOpen(tls *crt.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) int32 { /* sqlite3.c:56264:20: */
+func Xsqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) int32 { /* sqlite3.c:56348:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -31111,7 +32111,7 @@ func Xsqlite3PagerOpen(tls *crt.TLS, pVfs uintptr, ppPager uintptr, zFilename ui
readOnly = 0
zPathname = uintptr(0)
nPathname = 0
- useJournal = (crt.Bool32((flags & 0x0001) == 0))
+ useJournal = (libc.Bool32((flags & 0x0001) == 0))
pcacheSize = Xsqlite3PcacheSize(tls)
*(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */)) = U32(1024)
zUri = uintptr(0)
@@ -31120,7 +32120,7 @@ func Xsqlite3PagerOpen(tls *crt.TLS, pVfs uintptr, ppPager uintptr, zFilename ui
// Figure out how much space is required for each journal file-handle
// (there are two of them, the main journal and the sub-journal).
- journalFileSize = (((Xsqlite3JournalSize(tls, pVfs)) + 7) & ^int32(crt.Int32FromInt32(7)))
+ journalFileSize = (((Xsqlite3JournalSize(tls, pVfs)) + 7) & ^int32(libc.Int32FromInt32(7)))
// Set the output variable to NULL in case an error occurs.
*(*uintptr)(unsafe.Pointer(ppPager)) = uintptr(0)
@@ -31182,13 +32182,13 @@ __7:
__6:
;
nPathname = Xsqlite3Strlen30(tls, zPathname)
- z = crt.AssignUintptr(&zUri, (zFilename + uintptr((Xsqlite3Strlen30(tls, zFilename) + 1))))
+ z = libc.AssignUintptr(&zUri, (zFilename + uintptr((Xsqlite3Strlen30(tls, zFilename) + 1))))
__10:
if !(*(*int8)(unsafe.Pointer(z)) != 0) {
goto __11
}
- z += (uintptr(crt.Xstrlen(tls, z) + uint64(1)))
- z += (uintptr(crt.Xstrlen(tls, z) + uint64(1)))
+ z += (uintptr(libc.Xstrlen(tls, z) + uint64(1)))
+ z += (uintptr(libc.Xstrlen(tls, z) + uint64(1)))
nUri++
goto __10
__11:
@@ -31203,7 +32203,7 @@ __11:
// bytes in length. This means the database cannot be opened,
// as it will not be possible to open the journal file or even
// check for a hot-journal before reading.
- rc = Xsqlite3CantopenError(tls, 56351)
+ rc = Xsqlite3CantopenError(tls, 56435)
__12:
;
if !(rc != 0) {
@@ -31260,7 +32260,7 @@ __4:
// specific formatting and order of the various filenames, so if the format
// changes here, be sure to change it there as well.
pPtr = Xsqlite3MallocZero(tls,
- (uint64((((((((((((((((((uint64(unsafe.Sizeof(Pager{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))) + (uint64(((pcacheSize) + 7) & ^int32(crt.Int32FromInt32(7))))) + (uint64((((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile) + 7) & ^int32(crt.Int32FromInt32(7))))) + (uint64(journalFileSize * 2))) + uint64(unsafe.Sizeof(uintptr(0)))) + uint64(4)) + uint64(nPathname)) + uint64(1)) + uint64(nUriByte)) + uint64(nPathname)) + uint64(8)) + uint64(1)) + uint64(nPathname)) + uint64(4)) + uint64(1)) + uint64(3))))
+ (uint64((((((((((((((((((uint64(unsafe.Sizeof(Pager{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))) + (uint64(((pcacheSize) + 7) & ^int32(libc.Int32FromInt32(7))))) + (uint64((((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile) + 7) & ^int32(libc.Int32FromInt32(7))))) + (uint64(journalFileSize * 2))) + uint64(unsafe.Sizeof(uintptr(0)))) + uint64(4)) + uint64(nPathname)) + uint64(1)) + uint64(nUriByte)) + uint64(nPathname)) + uint64(8)) + uint64(1)) + uint64(nPathname)) + uint64(4)) + uint64(1)) + uint64(3))))
if !(!(pPtr != 0)) {
goto __14
@@ -31270,17 +32270,17 @@ __4:
__14:
;
*(*uintptr)(unsafe.Pointer(bp /* pPager */)) = pPtr
- pPtr += (uintptr(((uint64(unsafe.Sizeof(Pager{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))))
+ pPtr += (uintptr(((uint64(unsafe.Sizeof(Pager{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))))
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FpPCache = pPtr
- pPtr += (uintptr(((pcacheSize) + 7) & ^int32(crt.Int32FromInt32(7))))
+ pPtr += (uintptr(((pcacheSize) + 7) & ^int32(libc.Int32FromInt32(7))))
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).Ffd = pPtr
- pPtr += (uintptr((((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile) + 7) & ^int32(crt.Int32FromInt32(7))))
+ pPtr += (uintptr((((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile) + 7) & ^int32(libc.Int32FromInt32(7))))
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).Fsjfd = pPtr
pPtr += uintptr(journalFileSize)
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).Fjfd = pPtr
pPtr += uintptr(journalFileSize)
- crt.Xmemcpy(tls, pPtr, bp /* &pPager */, uint64(unsafe.Sizeof(uintptr(0))))
+ libc.Xmemcpy(tls, pPtr, bp /* &pPager */, uint64(unsafe.Sizeof(uintptr(0))))
pPtr += uintptr(unsafe.Sizeof(uintptr(0)))
// Fill in the Pager.zFilename and pPager.zQueryParam fields
@@ -31289,12 +32289,12 @@ __14:
if !(nPathname > 0) {
goto __15
}
- crt.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname))
+ libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname))
pPtr += (uintptr(nPathname + 1))
if !(zUri != 0) {
goto __16
}
- crt.Xmemcpy(tls, pPtr, zUri, uint64(nUriByte))
+ libc.Xmemcpy(tls, pPtr, zUri, uint64(nUriByte))
pPtr += uintptr(nUriByte)
goto __17
__16:
@@ -31309,9 +32309,9 @@ __15:
goto __18
}
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzJournal = pPtr
- crt.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname))
+ libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname))
pPtr += uintptr(nPathname)
- crt.Xmemcpy(tls, pPtr, ts+3438 /* "-journal" */, uint64(8))
+ libc.Xmemcpy(tls, pPtr, ts+5573 /* "-journal" */, uint64(8))
pPtr += (uintptr(8 + 1))
goto __19
__18:
@@ -31324,9 +32324,9 @@ __19:
goto __20
}
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzWal = pPtr
- crt.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname))
+ libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname))
pPtr += uintptr(nPathname)
- crt.Xmemcpy(tls, pPtr, ts+3447 /* "-wal" */, uint64(4))
+ libc.Xmemcpy(tls, pPtr, ts+5582 /* "-wal" */, uint64(4))
pPtr += (uintptr(4 + 1))
goto __21
__20:
@@ -31350,8 +32350,8 @@ __22:
*(*int32)(unsafe.Pointer(bp + 8 /* fout */)) = 0 // VFS flags returned by xOpen()
rc = Xsqlite3OsOpen(tls, pVfs, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).Ffd, vfsFlags, bp+8 /* &fout */)
- memJM = (crt.Bool32((*(*int32)(unsafe.Pointer(bp + 8 /* fout */)) & 0x00000080) != 0))
- readOnly = (crt.Bool32((*(*int32)(unsafe.Pointer(bp + 8 /* fout */)) & 0x00000001) != 0))
+ memJM = (libc.Bool32((*(*int32)(unsafe.Pointer(bp + 8 /* fout */)) & 0x00000080) != 0))
+ readOnly = (libc.Bool32((*(*int32)(unsafe.Pointer(bp + 8 /* fout */)) & 0x00000001) != 0))
// If the file was successfully opened for read/write access,
// choose a default page size in case we have to create the
@@ -31385,9 +32385,9 @@ __27:
;
__26:
;
- (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+3452 /* "nolock" */, 0))
+ (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FnoLock = U8(Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+5587 /* "nolock" */, 0))
if !(((iDc & 0x00002000) != 0) ||
- (Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+3459 /* "immutable" */, 0) != 0)) {
+ (Xsqlite3_uri_boolean(tls, (*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FzFilename, ts+5594 /* "immutable" */, 0) != 0)) {
goto __30
}
vfsFlags = vfsFlags | (0x00000001)
@@ -31398,16 +32398,15 @@ __25:
;
goto __24
__23:
- /* If a temporary file is requested, it is not opened immediately.
- ** In this case we accept the default page size and delay actually
- ** opening the file until the first call to OsWrite().
- **
- ** This branch is also run for an in-memory database. An in-memory
- ** database is the same as a temp-file that is never written out to
- ** disk and uses an in-memory rollback journal.
- **
- ** This branch also runs for files marked as immutable.
- */
+ // If a temporary file is requested, it is not opened immediately.
+ // In this case we accept the default page size and delay actually
+ // opening the file until the first call to OsWrite().
+ //
+ // This branch is also run for an in-memory database. An in-memory
+ // database is the same as a temp-file that is never written out to
+ // disk and uses an in-memory rollback journal.
+ //
+ // This branch also runs for files marked as immutable.
act_like_temp_file:
tempFile = 1
(*Pager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPager */)))).FeState = U8(1) // Pretend we already have a lock
@@ -31431,13 +32430,13 @@ __31:
if !(rc == 0) {
goto __32
}
- nExtra = (((nExtra) + 7) & ^int32(crt.Int32FromInt32(7)))
+ nExtra = (((nExtra) + 7) & ^int32(libc.Int32FromInt32(7)))
- rc = Xsqlite3PcacheOpen(tls, int32(*(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */))), nExtra, crt.BoolInt32(!(memDb != 0)),
+ rc = Xsqlite3PcacheOpen(tls, int32(*(*U32)(unsafe.Pointer(bp + 12 /* szPageDflt */))), nExtra, libc.BoolInt32(!(memDb != 0)),
func() uintptr {
if !(memDb != 0) {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{pagerStress}))
}
return uintptr(0)
@@ -31521,9 +32520,9 @@ __37:
// Return the sqlite3_file for the main database given the name
// of the corresonding WAL or Journal name as passed into
// xOpen.
-func Xsqlite3_database_file_object(tls *crt.TLS, zName uintptr) uintptr { /* sqlite3.c:56635:25: */
+func Xsqlite3_database_file_object(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:56719:25: */
var pPager uintptr
- for (((int32(*(*int8)(unsafe.Pointer(zName + crt.UintptrFromInt32(-1)))) != 0) || (int32(*(*int8)(unsafe.Pointer(zName + crt.UintptrFromInt32(-2)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + crt.UintptrFromInt32(-3)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + crt.UintptrFromInt32(-4)))) != 0) {
+ for (((int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-1)))) != 0) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-2)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-3)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-4)))) != 0) {
zName--
}
pPager = *(*uintptr)(unsafe.Pointer(((zName - uintptr(4)) - uintptr(uint64(unsafe.Sizeof(uintptr(0)))))))
@@ -31547,8 +32546,8 @@ func Xsqlite3_database_file_object(tls *crt.TLS, zName uintptr) uintptr { /* sql
// just deleted using OsDelete, *pExists is set to 0 and SQLITE_OK
// is returned.
//
-// This routine does not check if there is a master journal filename
-// at the end of the file. If there is, and that master journal file
+// This routine does not check if there is a super-journal filename
+// at the end of the file. If there is, and that super-journal file
// does not exist, then the journal file is not really hot. In this
// case this routine will return a false-positive. The pager_playback()
// routine will discover that the journal file is not really hot and
@@ -31559,14 +32558,14 @@ func Xsqlite3_database_file_object(tls *crt.TLS, zName uintptr) uintptr { /* sql
// set to 0 and SQLITE_OK returned. If an IO error occurs while trying
// to determine whether or not a hot-journal file exists, the IO error
// code is returned and the value of *pExists is undefined.
-func hasHotJournal(tls *crt.TLS, pPager uintptr, pExists uintptr) int32 { /* sqlite3.c:56676:12: */
+func hasHotJournal(tls *libc.TLS, pPager uintptr, pExists uintptr) int32 { /* sqlite3.c:56760:12: */
bp := tls.Alloc(17)
defer tls.Free(17)
var pVfs uintptr = (*Pager)(unsafe.Pointer(pPager)).FpVfs
var rc int32 = 0 // Return code
*(*int32)(unsafe.Pointer(bp /* exists */)) = 1 // True if a journal file is present
- var jrnlOpen int32 = crt.BoolInt32(!(!((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0))))
+ var jrnlOpen int32 = libc.BoolInt32(!(!((*Sqlite3_file)(unsafe.Pointer(((*Pager)(unsafe.Pointer(pPager)).Fjfd))).FpMethods != uintptr(0))))
*(*int32)(unsafe.Pointer(pExists)) = 0
if !(jrnlOpen != 0) {
@@ -31624,7 +32623,7 @@ func hasHotJournal(tls *crt.TLS, pPager uintptr, pExists uintptr) int32 { /* sql
if !(jrnlOpen != 0) {
Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
}
- *(*int32)(unsafe.Pointer(pExists)) = (crt.Bool32(int32(*(*U8)(unsafe.Pointer(bp + 16 /* first */))) != 0))
+ *(*int32)(unsafe.Pointer(pExists)) = (libc.Bool32(int32(*(*U8)(unsafe.Pointer(bp + 16 /* first */))) != 0))
} else if rc == 14 {
// If we cannot open the rollback journal file in order to see if
// it has a zero header, that might be due to an I/O error, or
@@ -31670,7 +32669,7 @@ func hasHotJournal(tls *crt.TLS, pPager uintptr, pExists uintptr) int32 { /* sql
// If everything is successful, SQLITE_OK is returned. If an IO error
// occurs while locking the database, checking for a hot-journal file or
// rolling back a journal file, the IO error code is returned.
-func Xsqlite3PagerSharedLock(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:56796:20: */
+func Xsqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:56880:20: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -31796,7 +32795,7 @@ __7:
if !((rc == 0) && ((*(*int32)(unsafe.Pointer(bp + 8 /* fout */)) & 0x00000001) != 0)) {
goto __10
}
- rc = Xsqlite3CantopenError(tls, 56880)
+ rc = Xsqlite3CantopenError(tls, 56964)
Xsqlite3OsClose(tls, (*Pager)(unsafe.Pointer(pPager)).Fjfd)
__10:
;
@@ -31820,7 +32819,7 @@ __8:
if !(rc == 0) {
goto __13
}
- rc = pager_playback(tls, pPager, crt.BoolInt32(!((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0)))
+ rc = pager_playback(tls, pPager, libc.BoolInt32(!((*Pager)(unsafe.Pointer(pPager)).FtempFile != 0)))
(*Pager)(unsafe.Pointer(pPager)).FeState = U8(0)
__13:
;
@@ -31875,11 +32874,11 @@ __5:
goto failed
__18:
;
- crt.Xmemset(tls, bp+12 /* &dbFileVers[0] */, 0, uint64(unsafe.Sizeof([16]int8{})))
+ libc.Xmemset(tls, bp+12 /* &dbFileVers[0] */, 0, uint64(unsafe.Sizeof([16]int8{})))
__17:
;
- if !(crt.Xmemcmp(tls, pPager+136 /* &.dbFileVers */, bp+12 /* &dbFileVers[0] */, uint64(unsafe.Sizeof([16]int8{}))) != 0) {
+ if !(libc.Xmemcmp(tls, pPager+136 /* &.dbFileVers */, bp+12 /* &dbFileVers[0] */, uint64(unsafe.Sizeof([16]int8{}))) != 0) {
goto __19
}
pager_reset(tls, pPager)
@@ -31937,15 +32936,13 @@ __24:
return rc
}
-/*
-** If the reference count has reached zero, rollback any active
-** transaction and unlock the pager.
-**
-** Except, in locking_mode=EXCLUSIVE when there is nothing to in
-** the rollback journal, the unlock is not performed and there is
-** nothing to rollback, so this routine is a no-op.
- */
-func pagerUnlockIfUnused(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:57013:13: */
+// If the reference count has reached zero, rollback any active
+// transaction and unlock the pager.
+//
+// Except, in locking_mode=EXCLUSIVE when there is nothing to in
+// the rollback journal, the unlock is not performed and there is
+// nothing to rollback, so this routine is a no-op.
+func pagerUnlockIfUnused(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:57097:13: */
if Xsqlite3PcacheRefCount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache) == 0 {
// because page1 is never memory mapped
pagerUnlockAndRollback(tls, pPager)
@@ -32007,7 +33004,7 @@ func pagerUnlockIfUnused(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:57013:13:
// has to go to disk, and could also playback an old journal if necessary.
// Since Lookup() never goes to disk, it never has to deal with locks
// or journal files.
-func getPageNormal(tls *crt.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57077:12: */
+func getPageNormal(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57161:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -32020,7 +33017,7 @@ func getPageNormal(tls *crt.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flag
if !(pgno == Pgno(0)) {
goto __1
}
- return Xsqlite3CorruptError(tls, 57093)
+ return Xsqlite3CorruptError(tls, 57177)
__1:
;
*(*uintptr)(unsafe.Pointer(bp /* pBase */)) = Xsqlite3PcacheFetch(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, 3)
@@ -32044,9 +33041,9 @@ __4:
;
__2:
;
- pPg = crt.AssignPtrUintptr(ppPage, Xsqlite3PcacheFetchFinish(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, *(*uintptr)(unsafe.Pointer(bp /* pBase */))))
+ pPg = libc.AssignPtrUintptr(ppPage, Xsqlite3PcacheFetchFinish(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, *(*uintptr)(unsafe.Pointer(bp /* pBase */))))
- noContent = (U8(crt.Bool32((flags & 0x01) != 0)))
+ noContent = (U8(libc.Bool32((flags & 0x01) != 0)))
if !(((*PgHdr)(unsafe.Pointer(pPg)).FpPager != 0) && !(noContent != 0)) {
goto __5
}
@@ -32060,12 +33057,12 @@ __5:
// The pager cache has created a new page. Its content needs to
// be initialized. But first some error checks:
//
- // (1) The maximum page number is 2^31
+ // (*) obsolete. Was: maximum page number is 2^31
// (2) Never try to fetch the locking page
- if !((pgno > Pgno(2147483647)) || (pgno == (Pgno((Xsqlite3PendingByte / ((*Pager)(unsafe.Pointer(pPager)).FpageSize)) + 1)))) {
+ if !(pgno == (Pgno((Xsqlite3PendingByte / ((*Pager)(unsafe.Pointer(pPager)).FpageSize)) + 1))) {
goto __7
}
- rc = Xsqlite3CorruptError(tls, 57125)
+ rc = Xsqlite3CorruptError(tls, 57209)
goto pager_acquire_err
__7:
;
@@ -32102,7 +33099,7 @@ __12:
Xsqlite3EndBenignMalloc(tls)
__11:
;
- crt.Xmemset(tls, (*PgHdr)(unsafe.Pointer(pPg)).FpData, 0, uint64((*Pager)(unsafe.Pointer(pPager)).FpageSize))
+ libc.Xmemset(tls, (*PgHdr)(unsafe.Pointer(pPg)).FpData, 0, uint64((*Pager)(unsafe.Pointer(pPager)).FpageSize))
goto __9
__8:
;
@@ -32134,7 +33131,7 @@ __14:
}
// The page getter for when memory-mapped I/O is enabled
-func getPageMMap(tls *crt.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57179:12: */
+func getPageMMap(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57263:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -32146,7 +33143,7 @@ func getPageMMap(tls *crt.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags
// page 1 if there is no write-transaction open or the ACQUIRE_READONLY
// flag was specified by the caller. And so long as the db is not a
// temporary or in-memory database.
- var bMmapOk int32 = (crt.Bool32((pgno > Pgno(1)) &&
+ var bMmapOk int32 = (libc.Bool32((pgno > Pgno(1)) &&
((int32((*Pager)(unsafe.Pointer(pPager)).FeState) == 1) || ((flags & 0x02) != 0))))
// Optimization note: Adding the "pgno<=1" term before "pgno==0" here
@@ -32154,7 +33151,7 @@ func getPageMMap(tls *crt.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags
// test in the previous statement, and avoid testing pgno==0 in the
// common case where pgno is large.
if (pgno <= Pgno(1)) && (pgno == Pgno(0)) {
- return Xsqlite3CorruptError(tls, 57204)
+ return Xsqlite3CorruptError(tls, 57288)
}
if (bMmapOk != 0) && ((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0)) {
@@ -32192,7 +33189,7 @@ func getPageMMap(tls *crt.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags
}
// The page getter method for when the pager is an error state
-func getPageError(tls *crt.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57248:12: */
+func getPageError(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57332:12: */
_ = pgno
_ = flags
@@ -32201,8 +33198,8 @@ func getPageError(tls *crt.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags
}
// Dispatch all page fetch requests to the appropriate getter method.
-func Xsqlite3PagerGet(tls *crt.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57264:20: */
- return (*(*func(*crt.TLS, uintptr, Pgno, uintptr, int32) int32)(unsafe.Pointer((pPager + 272 /* &.xGet */))))(tls, pPager, pgno, ppPage, flags)
+func Xsqlite3PagerGet(tls *libc.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:57348:20: */
+ return (*(*func(*libc.TLS, uintptr, Pgno, uintptr, int32) int32)(unsafe.Pointer((pPager + 272 /* &.xGet */))))(tls, pPager, pgno, ppPage, flags)
}
// Acquire a page if it is already in the in-memory cache. Do
@@ -32214,7 +33211,7 @@ func Xsqlite3PagerGet(tls *crt.TLS, pPager uintptr, pgno Pgno, ppPage uintptr, f
// in the page if the page is not already in cache. This routine
// returns NULL if the page is not in cache or if a disk I/O error
// has ever happened.
-func Xsqlite3PagerLookup(tls *crt.TLS, pPager uintptr, pgno Pgno) uintptr { /* sqlite3.c:57284:23: */
+func Xsqlite3PagerLookup(tls *libc.TLS, pPager uintptr, pgno Pgno) uintptr { /* sqlite3.c:57368:23: */
var pPage uintptr
pPage = Xsqlite3PcacheFetch(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache, pgno, 0)
@@ -32235,7 +33232,7 @@ func Xsqlite3PagerLookup(tls *crt.TLS, pPager uintptr, pgno Pgno) uintptr { /* s
// Use sqlite3PagerUnrefPageOne() to release page1. This latter routine
// checks the total number of outstanding pages and if the number of
// pages reaches zero it drops the database lock.
-func Xsqlite3PagerUnrefNotNull(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:57307:21: */
+func Xsqlite3PagerUnrefNotNull(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57391:21: */
if (int32((*DbPage)(unsafe.Pointer(pPg)).Fflags) & 0x020) != 0 {
// Page1 is never memory mapped
@@ -32246,12 +33243,12 @@ func Xsqlite3PagerUnrefNotNull(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:57307:2
// Do not use this routine to release the last reference to page1
}
-func Xsqlite3PagerUnref(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:57319:21: */
+func Xsqlite3PagerUnref(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57403:21: */
if pPg != 0 {
Xsqlite3PagerUnrefNotNull(tls, pPg)
}
}
-func Xsqlite3PagerUnrefPageOne(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:57322:21: */
+func Xsqlite3PagerUnrefPageOne(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57406:21: */
var pPager uintptr
// Page1 is never memory mapped
@@ -32280,7 +33277,7 @@ func Xsqlite3PagerUnrefPageOne(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:57322:2
// Return SQLITE_OK if everything is successful. Otherwise, return
// SQLITE_NOMEM if the attempt to allocate Pager.pInJournal fails, or
// an IO error code if opening or writing the journal file fails.
-func pager_open_journal(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:57354:12: */
+func pager_open_journal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:57438:12: */
var rc int32 = 0 // Return code
var pVfs uintptr = (*Pager)(unsafe.Pointer(pPager)).FpVfs // Local cache of vfs pointer
@@ -32329,7 +33326,7 @@ func pager_open_journal(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:57354
// TODO: Check if all of these are really required.
(*Pager)(unsafe.Pointer(pPager)).FnRec = 0
(*Pager)(unsafe.Pointer(pPager)).FjournalOff = int64(0)
- (*Pager)(unsafe.Pointer(pPager)).FsetMaster = U8(0)
+ (*Pager)(unsafe.Pointer(pPager)).FsetSuper = U8(0)
(*Pager)(unsafe.Pointer(pPager)).FjournalHdr = int64(0)
rc = writeJournalHdr(tls, pPager)
}
@@ -32361,7 +33358,7 @@ func pager_open_journal(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:57354
// sub-journal. If the subjInMemory argument is zero, then any required
// sub-journal is implemented in-memory if pPager is an in-memory database,
// or using a temporary file otherwise.
-func Xsqlite3PagerBegin(tls *crt.TLS, pPager uintptr, exFlag int32, subjInMemory int32) int32 { /* sqlite3.c:57443:20: */
+func Xsqlite3PagerBegin(tls *libc.TLS, pPager uintptr, exFlag int32, subjInMemory int32) int32 { /* sqlite3.c:57527:20: */
var rc int32 = 0
if (*Pager)(unsafe.Pointer(pPager)).FerrCode != 0 {
@@ -32421,7 +33418,7 @@ func Xsqlite3PagerBegin(tls *crt.TLS, pPager uintptr, exFlag int32, subjInMemory
}
// Write page pPg onto the end of the rollback journal.
-func pagerAddPageToRollbackJournal(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:57512:28: */
+func pagerAddPageToRollbackJournal(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57596:28: */
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
var rc int32
var cksum U32
@@ -32473,7 +33470,7 @@ func pagerAddPageToRollbackJournal(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3
// one of the journals, the corresponding bit is set in the
// Pager.pInJournal bitvec and the PagerSavepoint.pInSavepoint bitvecs
// of any open savepoints as appropriate.
-func pager_write(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:57569:12: */
+func pager_write(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57653:12: */
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
var rc int32 = 0
@@ -32546,7 +33543,7 @@ func pager_write(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:57569:12: */
// Usually, the sector size is less than or equal to the page size, in which
// case pages can be individually written. This routine only runs in the
// exceptional case where the page size is smaller than the sector size.
-func pagerWriteLargeSector(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:57661:28: */
+func pagerWriteLargeSector(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57745:28: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -32594,7 +33591,7 @@ func pagerWriteLargeSector(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:57661
Xsqlite3PagerUnrefNotNull(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)))
}
}
- } else if (crt.AssignPtrUintptr(bp /* pPage */, Xsqlite3PagerLookup(tls, pPager, pg))) != uintptr(0) {
+ } else if (libc.AssignPtrUintptr(bp /* pPage */, Xsqlite3PagerLookup(tls, pPager, pg))) != uintptr(0) {
if (int32((*PgHdr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).Fflags) & 0x008) != 0 {
needSync = 1
}
@@ -32618,7 +33615,7 @@ func pagerWriteLargeSector(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:57661
}
}
- *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(0x04))))
+ *(*U8)(unsafe.Pointer(pPager + 24 /* &.doNotSpill */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(0x04))))
return rc
}
@@ -32634,7 +33631,7 @@ func pagerWriteLargeSector(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:57661
//
// If an error occurs, SQLITE_NOMEM or an IO error code is returned
// as appropriate. Otherwise, SQLITE_OK.
-func Xsqlite3PagerWrite(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:57755:20: */
+func Xsqlite3PagerWrite(tls *libc.TLS, pPg uintptr) int32 { /* sqlite3.c:57839:20: */
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
if ((int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags) & 0x004) != 0) && ((*Pager)(unsafe.Pointer(pPager)).FdbSize >= (*PgHdr)(unsafe.Pointer(pPg)).Fpgno) {
@@ -32675,12 +33672,12 @@ func Xsqlite3PagerWrite(tls *crt.TLS, pPg uintptr) int32 { /* sqlite3.c:57755:20
// memory pressure forces page pPg out of the cache, the data does need
// to be written out to disk so that it may be read back in if the
// current transaction is rolled back.
-func Xsqlite3PagerDontWrite(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:57804:21: */
+func Xsqlite3PagerDontWrite(tls *libc.TLS, pPg uintptr) { /* sqlite3.c:57888:21: */
var pPager uintptr = (*PgHdr)(unsafe.Pointer(pPg)).FpPager
if (!(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && ((int32((*PgHdr)(unsafe.Pointer(pPg)).Fflags) & 0x002) != 0)) && ((*Pager)(unsafe.Pointer(pPager)).FnSavepoint == 0) {
*(*U16)(unsafe.Pointer(pPg + 52 /* &.flags */)) |= U16((0x010))
- *(*U16)(unsafe.Pointer(pPg + 52 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x004))))
+ *(*U16)(unsafe.Pointer(pPg + 52 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x004))))
}
}
@@ -32705,7 +33702,7 @@ func Xsqlite3PagerDontWrite(tls *crt.TLS, pPg uintptr) { /* sqlite3.c:57804:21:
// if isDirect is non-zero, then the database file is updated directly
// by writing an updated version of page 1 using a call to the
// sqlite3OsWrite() function.
-func pager_incr_changecounter(tls *crt.TLS, pPager uintptr, isDirectMode int32) int32 { /* sqlite3.c:57838:12: */
+func pager_incr_changecounter(tls *libc.TLS, pPager uintptr, isDirectMode int32) int32 { /* sqlite3.c:57922:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -32756,7 +33753,7 @@ func pager_incr_changecounter(tls *crt.TLS, pPager uintptr, isDirectMode int32)
// next time a read transaction is opened the cache will be
// flushed (as the change-counter values will not match).
var pCopy uintptr = ((zBuf) + uintptr(24))
- crt.Xmemcpy(tls, (pPager + 136 /* &.dbFileVers */), pCopy, uint64(unsafe.Sizeof([16]int8{})))
+ libc.Xmemcpy(tls, (pPager + 136 /* &.dbFileVers */), pCopy, uint64(unsafe.Sizeof([16]int8{})))
(*Pager)(unsafe.Pointer(pPager)).FchangeCountDone = U8(1)
}
} else {
@@ -32775,9 +33772,9 @@ func pager_incr_changecounter(tls *crt.TLS, pPager uintptr, isDirectMode int32)
//
// If successful, or if called on a pager for which it is a no-op, this
// function returns SQLITE_OK. Otherwise, an IO error code is returned.
-func Xsqlite3PagerSync(tls *crt.TLS, pPager uintptr, zMaster uintptr) int32 { /* sqlite3.c:57921:20: */
+func Xsqlite3PagerSync(tls *libc.TLS, pPager uintptr, zSuper uintptr) int32 { /* sqlite3.c:58005:20: */
var rc int32 = 0
- var pArg uintptr = zMaster
+ var pArg uintptr = zSuper
rc = Xsqlite3OsFileControl(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, 21, pArg)
if rc == 12 {
rc = 0
@@ -32798,22 +33795,22 @@ func Xsqlite3PagerSync(tls *crt.TLS, pPager uintptr, zMaster uintptr) int32 { /*
// successful, or the connection is in WAL mode, SQLITE_OK is returned.
// Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is
// returned.
-func Xsqlite3PagerExclusiveLock(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:57944:20: */
+func Xsqlite3PagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58028:20: */
var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode
if rc == 0 {
- if 0 == (crt.Bool32((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0))) {
+ if 0 == (libc.Bool32((*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0))) {
rc = pager_wait_on_lock(tls, pPager, 4)
}
}
return rc
}
-// Sync the database file for the pager pPager. zMaster points to the name
-// of a master journal file that should be written into the individual
-// journal file. zMaster may be NULL, which is interpreted as no master
-// journal (a single database transaction).
+// Sync the database file for the pager pPager. zSuper points to the name
+// of a super-journal file that should be written into the individual
+// journal file. zSuper may be NULL, which is interpreted as no
+// super-journal (a single database transaction).
//
// This routine ensures that:
//
@@ -32825,16 +33822,16 @@ func Xsqlite3PagerExclusiveLock(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3
//
// The only thing that remains to commit the transaction is to finalize
// (delete, truncate or zero the first part of) the journal file (or
-// delete the master journal file if specified).
+// delete the super-journal file if specified).
//
-// Note that if zMaster==NULL, this does not overwrite a previous value
+// Note that if zSuper==NULL, this does not overwrite a previous value
// passed to an sqlite3PagerCommitPhaseOne() call.
//
// If the final parameter - noSync - is true, then the database file itself
// is not synced. The caller must call sqlite3PagerSync() directly to
// sync the database file before calling CommitPhaseTwo() to delete the
// journal file in this case.
-func Xsqlite3PagerCommitPhaseOne(tls *crt.TLS, pPager uintptr, zMaster uintptr, noSync int32) int32 { /* sqlite3.c:57986:20: */
+func Xsqlite3PagerCommitPhaseOne(tls *libc.TLS, pPager uintptr, zSuper uintptr, noSync int32) int32 { /* sqlite3.c:58070:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -32921,10 +33918,10 @@ __6:
__11:
;
- // Write the master journal name into the journal file. If a master
- // journal file name has already been written to the journal file,
- // or if zMaster is NULL (no master journal), then this call is a no-op.
- rc = writeMasterJournal(tls, pPager, zMaster)
+ // Write the super-journal name into the journal file. If a
+ // super-journal file name has already been written to the journal file,
+ // or if zSuper is NULL (no super-journal), then this call is a no-op.
+ rc = writeSuperJournal(tls, pPager, zSuper)
if !(rc != 0) {
goto __12
}
@@ -32976,7 +33973,7 @@ __15:
if !((*Pager)(unsafe.Pointer(pPager)).FdbSize > (*Pager)(unsafe.Pointer(pPager)).FdbFileSize) {
goto __16
}
- nNew = ((*Pager)(unsafe.Pointer(pPager)).FdbSize - (Pgno(crt.Bool32((*Pager)(unsafe.Pointer(pPager)).FdbSize == (Pgno((Xsqlite3PendingByte / ((*Pager)(unsafe.Pointer(pPager)).FpageSize)) + 1))))))
+ nNew = ((*Pager)(unsafe.Pointer(pPager)).FdbSize - (Pgno(libc.Bool32((*Pager)(unsafe.Pointer(pPager)).FdbSize == (Pgno((Xsqlite3PendingByte / ((*Pager)(unsafe.Pointer(pPager)).FpageSize)) + 1))))))
rc = pager_truncate(tls, pPager, nNew)
if !(rc != 0) {
@@ -32992,7 +33989,7 @@ __16:
if !(!(noSync != 0)) {
goto __18
}
- rc = Xsqlite3PagerSync(tls, pPager, zMaster)
+ rc = Xsqlite3PagerSync(tls, pPager, zSuper)
__18:
;
__7:
@@ -33023,7 +34020,7 @@ __19:
//
// If an error occurs, an IO error code is returned and the pager
// moves into the error state. Otherwise, SQLITE_OK is returned.
-func Xsqlite3PagerCommitPhaseTwo(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:58216:20: */
+func Xsqlite3PagerCommitPhaseTwo(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58300:20: */
var rc int32 = 0 // Return code
// This routine should not be called if a prior error has occurred.
@@ -33052,7 +34049,7 @@ func Xsqlite3PagerCommitPhaseTwo(tls *crt.TLS, pPager uintptr) int32 { /* sqlite
return 0
}
- rc = pager_end_transaction(tls, pPager, int32((*Pager)(unsafe.Pointer(pPager)).FsetMaster), 1)
+ rc = pager_end_transaction(tls, pPager, int32((*Pager)(unsafe.Pointer(pPager)).FsetSuper), 1)
return pager_error(tls, pPager, rc)
}
@@ -33080,7 +34077,7 @@ func Xsqlite3PagerCommitPhaseTwo(tls *crt.TLS, pPager uintptr) int32 { /* sqlite
// current transaction are either expelled from the cache or reverted to
// their pre-transaction state by re-reading data from the database or
// WAL files. The WAL transaction is then closed.
-func Xsqlite3PagerRollback(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:58282:20: */
+func Xsqlite3PagerRollback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58366:20: */
var rc int32 = 0 // Return code
// PagerRollback() is a no-op if called in READER or OPEN state. If
@@ -33097,7 +34094,7 @@ func Xsqlite3PagerRollback(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:58
if (*Pager)(unsafe.Pointer((pPager))).FpWal != uintptr(0) {
var rc2 int32
rc = Xsqlite3PagerSavepoint(tls, pPager, 2, -1)
- rc2 = pager_end_transaction(tls, pPager, int32((*Pager)(unsafe.Pointer(pPager)).FsetMaster), 0)
+ rc2 = pager_end_transaction(tls, pPager, int32((*Pager)(unsafe.Pointer(pPager)).FsetSuper), 0)
if rc == 0 {
rc = rc2
}
@@ -33124,13 +34121,13 @@ func Xsqlite3PagerRollback(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:58
// Return TRUE if the database file is opened read-only. Return FALSE
// if the database is (in theory) writable.
-func Xsqlite3PagerIsreadonly(tls *crt.TLS, pPager uintptr) U8 { /* sqlite3.c:58332:19: */
+func Xsqlite3PagerIsreadonly(tls *libc.TLS, pPager uintptr) U8 { /* sqlite3.c:58416:19: */
return (*Pager)(unsafe.Pointer(pPager)).FreadOnly
}
// Return the approximate number of bytes of memory currently
// used by the pager and its associated cache.
-func Xsqlite3PagerMemUsed(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:58349:20: */
+func Xsqlite3PagerMemUsed(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58433:20: */
var perPageSize int32 = (int32(((uint64((*Pager)(unsafe.Pointer(pPager)).FpageSize + int32((*Pager)(unsafe.Pointer(pPager)).FnExtra))) + uint64(unsafe.Sizeof(PgHdr{}))) +
(uint64(5) * uint64(unsafe.Sizeof(uintptr(0))))))
return (((perPageSize * Xsqlite3PcachePagecount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)) +
@@ -33139,12 +34136,12 @@ func Xsqlite3PagerMemUsed(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:583
}
// Return the number of references to the specified page.
-func Xsqlite3PagerPageRefcount(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:58360:20: */
+func Xsqlite3PagerPageRefcount(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:58444:20: */
return Xsqlite3PcachePageRefcount(tls, pPage)
}
// This routine is used for testing and analysis only.
-func Xsqlite3PagerStats(tls *crt.TLS, pPager uintptr) uintptr { /* sqlite3.c:58368:20: */
+func Xsqlite3PagerStats(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58452:20: */
a1[0] = Xsqlite3PcacheRefCount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
a1[1] = Xsqlite3PcachePagecount(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
a1[2] = Xsqlite3PcacheGetCachesize(tls, (*Pager)(unsafe.Pointer(pPager)).FpPCache)
@@ -33164,7 +34161,7 @@ func Xsqlite3PagerStats(tls *crt.TLS, pPager uintptr) uintptr { /* sqlite3.c:583
return uintptr(unsafe.Pointer(&a1))
}
-var a1 [11]int32 /* sqlite3.c:58369:14: */
+var a1 [11]int32 /* sqlite3.c:58453:14: */
// Parameter eStat must be one of SQLITE_DBSTATUS_CACHE_HIT, _MISS, _WRITE,
// or _WRITE+1. The SQLITE_DBSTATUS_CACHE_WRITE+1 case is a translation
@@ -33175,7 +34172,7 @@ var a1 [11]int32 /* sqlite3.c:58369:14: */
// current cache hit or miss count, according to the value of eStat. If the
// reset parameter is non-zero, the cache hit or miss count is zeroed before
// returning.
-func Xsqlite3PagerCacheStat(tls *crt.TLS, pPager uintptr, eStat int32, reset int32, pnVal uintptr) { /* sqlite3.c:58396:21: */
+func Xsqlite3PagerCacheStat(tls *libc.TLS, pPager uintptr, eStat int32, reset int32, pnVal uintptr) { /* sqlite3.c:58480:21: */
eStat = eStat - (7)
*(*int32)(unsafe.Pointer(pnVal)) += (*(*int32)(unsafe.Pointer((pPager + 240 /* &.aStat */) + uintptr(eStat)*4)))
@@ -33185,7 +34182,7 @@ func Xsqlite3PagerCacheStat(tls *crt.TLS, pPager uintptr, eStat int32, reset int
}
// Return true if this is an in-memory or temp-file backed pager.
-func Xsqlite3PagerIsMemdb(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:58419:20: */
+func Xsqlite3PagerIsMemdb(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:58503:20: */
return int32((*Pager)(unsafe.Pointer(pPager)).FtempFile)
}
@@ -33197,7 +34194,7 @@ func Xsqlite3PagerIsMemdb(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:584
// If a memory allocation fails, SQLITE_NOMEM is returned. If an error
// occurs while opening the sub-journal file, then an IO error code is
// returned. Otherwise, SQLITE_OK.
-func pagerOpenSavepoint(tls *crt.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:58433:28: */
+func pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:58517:28: */
var rc int32 = 0 // Return code
var nCurrent int32 = (*Pager)(unsafe.Pointer(pPager)).FnSavepoint // Current number of savepoints
var ii int32 // Iterator variable
@@ -33211,7 +34208,7 @@ func pagerOpenSavepoint(tls *crt.TLS, pPager uintptr, nSavepoint int32) int32 {
if !(aNew != 0) {
return 7
}
- crt.Xmemset(tls, (aNew + uintptr(nCurrent)*48), 0, ((uint64(nSavepoint - nCurrent)) * uint64(unsafe.Sizeof(PagerSavepoint{}))))
+ libc.Xmemset(tls, (aNew + uintptr(nCurrent)*48), 0, ((uint64(nSavepoint - nCurrent)) * uint64(unsafe.Sizeof(PagerSavepoint{}))))
(*Pager)(unsafe.Pointer(pPager)).FaSavepoint = aNew
// Populate the PagerSavepoint structures just allocated.
@@ -33235,7 +34232,7 @@ func pagerOpenSavepoint(tls *crt.TLS, pPager uintptr, nSavepoint int32) int32 {
return rc
}
-func Xsqlite3PagerOpenSavepoint(tls *crt.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:58478:20: */
+func Xsqlite3PagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) int32 { /* sqlite3.c:58562:20: */
if (nSavepoint > (*Pager)(unsafe.Pointer(pPager)).FnSavepoint) && ((*Pager)(unsafe.Pointer(pPager)).FuseJournal != 0) {
return pagerOpenSavepoint(tls, pPager, nSavepoint)
@@ -33245,37 +34242,35 @@ func Xsqlite3PagerOpenSavepoint(tls *crt.TLS, pPager uintptr, nSavepoint int32)
return int32(0)
}
-/*
-** This function is called to rollback or release (commit) a savepoint.
-** The savepoint to release or rollback need not be the most recently
-** created savepoint.
-**
-** Parameter op is always either SAVEPOINT_ROLLBACK or SAVEPOINT_RELEASE.
-** If it is SAVEPOINT_RELEASE, then release and destroy the savepoint with
-** index iSavepoint. If it is SAVEPOINT_ROLLBACK, then rollback all changes
-** that have occurred since the specified savepoint was created.
-**
-** The savepoint to rollback or release is identified by parameter
-** iSavepoint. A value of 0 means to operate on the outermost savepoint
-** (the first created). A value of (Pager.nSavepoint-1) means operate
-** on the most recently created savepoint. If iSavepoint is greater than
-** (Pager.nSavepoint-1), then this function is a no-op.
-**
-** If a negative value is passed to this function, then the current
-** transaction is rolled back. This is different to calling
-** sqlite3PagerRollback() because this function does not terminate
-** the transaction or unlock the database, it just restores the
-** contents of the database to its original state.
-**
-** In any case, all savepoints with an index greater than iSavepoint
-** are destroyed. If this is a release operation (op==SAVEPOINT_RELEASE),
-** then savepoint iSavepoint is also destroyed.
-**
-** This function may return SQLITE_NOMEM if a memory allocation fails,
-** or an IO error code if an IO error occurs while rolling back a
-** savepoint. If no errors occur, SQLITE_OK is returned.
- */
-func Xsqlite3PagerSavepoint(tls *crt.TLS, pPager uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:58520:20: */
+// This function is called to rollback or release (commit) a savepoint.
+// The savepoint to release or rollback need not be the most recently
+// created savepoint.
+//
+// Parameter op is always either SAVEPOINT_ROLLBACK or SAVEPOINT_RELEASE.
+// If it is SAVEPOINT_RELEASE, then release and destroy the savepoint with
+// index iSavepoint. If it is SAVEPOINT_ROLLBACK, then rollback all changes
+// that have occurred since the specified savepoint was created.
+//
+// The savepoint to rollback or release is identified by parameter
+// iSavepoint. A value of 0 means to operate on the outermost savepoint
+// (the first created). A value of (Pager.nSavepoint-1) means operate
+// on the most recently created savepoint. If iSavepoint is greater than
+// (Pager.nSavepoint-1), then this function is a no-op.
+//
+// If a negative value is passed to this function, then the current
+// transaction is rolled back. This is different to calling
+// sqlite3PagerRollback() because this function does not terminate
+// the transaction or unlock the database, it just restores the
+// contents of the database to its original state.
+//
+// In any case, all savepoints with an index greater than iSavepoint
+// are destroyed. If this is a release operation (op==SAVEPOINT_RELEASE),
+// then savepoint iSavepoint is also destroyed.
+//
+// This function may return SQLITE_NOMEM if a memory allocation fails,
+// or an IO error code if an IO error occurs while rolling back a
+// savepoint. If no errors occur, SQLITE_OK is returned.
+func Xsqlite3PagerSavepoint(tls *libc.TLS, pPager uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:58604:20: */
var rc int32 = (*Pager)(unsafe.Pointer(pPager)).FerrCode
if (rc == 0) && (iSavepoint < (*Pager)(unsafe.Pointer(pPager)).FnSavepoint) {
@@ -33331,30 +34326,30 @@ func Xsqlite3PagerSavepoint(tls *crt.TLS, pPager uintptr, op int32, iSavepoint i
//
// The return value to this routine is always safe to use with
// sqlite3_uri_parameter() and sqlite3_filename_database() and friends.
-func Xsqlite3PagerFilename(tls *crt.TLS, pPager uintptr, nullIfMemDb int32) uintptr { /* sqlite3.c:58599:27: */
+func Xsqlite3PagerFilename(tls *libc.TLS, pPager uintptr, nullIfMemDb int32) uintptr { /* sqlite3.c:58683:27: */
if (nullIfMemDb != 0) && ((*Pager)(unsafe.Pointer(pPager)).FmemDb != 0) {
return (uintptr(unsafe.Pointer(&zFake)) + uintptr(4))
}
return (*Pager)(unsafe.Pointer(pPager)).FzFilename
}
-var zFake = [8]int8{int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:58600:21 */
+var zFake = [8]int8{int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:58684:21 */
// Return the VFS structure for the pager.
-func Xsqlite3PagerVfs(tls *crt.TLS, pPager uintptr) uintptr { /* sqlite3.c:58607:28: */
+func Xsqlite3PagerVfs(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58691:28: */
return (*Pager)(unsafe.Pointer(pPager)).FpVfs
}
// Return the file handle for the database file associated
// with the pager. This might return NULL if the file has
// not yet been opened.
-func Xsqlite3PagerFile(tls *crt.TLS, pPager uintptr) uintptr { /* sqlite3.c:58616:29: */
+func Xsqlite3PagerFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58700:29: */
return (*Pager)(unsafe.Pointer(pPager)).Ffd
}
// Return the file handle for the journal file (if it exists).
// This will be either the rollback journal or the WAL file.
-func Xsqlite3PagerJrnlFile(tls *crt.TLS, pPager uintptr) uintptr { /* sqlite3.c:58624:29: */
+func Xsqlite3PagerJrnlFile(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58708:29: */
if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
return Xsqlite3WalFile(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
}
@@ -33362,7 +34357,7 @@ func Xsqlite3PagerJrnlFile(tls *crt.TLS, pPager uintptr) uintptr { /* sqlite3.c:
}
// Return the full pathname of the journal file.
-func Xsqlite3PagerJournalname(tls *crt.TLS, pPager uintptr) uintptr { /* sqlite3.c:58635:27: */
+func Xsqlite3PagerJournalname(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:58719:27: */
return (*Pager)(unsafe.Pointer(pPager)).FzJournal
}
@@ -33389,7 +34384,7 @@ func Xsqlite3PagerJournalname(tls *crt.TLS, pPager uintptr) uintptr { /* sqlite3
//
// This function may return SQLITE_NOMEM or an IO error code if an error
// occurs. Otherwise, it returns SQLITE_OK.
-func Xsqlite3PagerMovepage(tls *crt.TLS, pPager uintptr, pPg uintptr, pgno Pgno, isCommit int32) int32 { /* sqlite3.c:58665:20: */
+func Xsqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno Pgno, isCommit int32) int32 { /* sqlite3.c:58749:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -33426,7 +34421,7 @@ func Xsqlite3PagerMovepage(tls *crt.TLS, pPager uintptr, pPg uintptr, pgno Pgno,
// one or more savepoint bitvecs. This is the reason this function
// may return SQLITE_NOMEM.
if ((int32((*DbPage)(unsafe.Pointer(pPg)).Fflags) & 0x002) != 0) &&
- (0 != (crt.AssignInt32(&rc, subjournalPageIfRequired(tls, pPg)))) {
+ (0 != (libc.AssignInt32(&rc, subjournalPageIfRequired(tls, pPg)))) {
return rc
}
@@ -33445,13 +34440,13 @@ func Xsqlite3PagerMovepage(tls *crt.TLS, pPager uintptr, pPg uintptr, pgno Pgno,
// from its hash chain. Also, if the PGHDR_NEED_SYNC flag was set for
// page pgno before the 'move' operation, it needs to be retained
// for the page moved there.
- *(*U16)(unsafe.Pointer(pPg + 52 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x008))))
+ *(*U16)(unsafe.Pointer(pPg + 52 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x008))))
pPgOld = Xsqlite3PagerLookup(tls, pPager, pgno)
if pPgOld != 0 {
if int32((*PgHdr)(unsafe.Pointer(pPgOld)).FnRef) > 1 {
Xsqlite3PagerUnrefNotNull(tls, pPgOld)
- return Xsqlite3CorruptError(tls, 58739)
+ return Xsqlite3CorruptError(tls, 58823)
}
*(*U16)(unsafe.Pointer(pPg + 52 /* &.flags */)) |= U16((int32((*PgHdr)(unsafe.Pointer(pPgOld)).Fflags) & 0x008))
if (*Pager)(unsafe.Pointer(pPager)).FtempFile != 0 {
@@ -33511,21 +34506,21 @@ func Xsqlite3PagerMovepage(tls *crt.TLS, pPager uintptr, pPg uintptr, pgno Pgno,
// with a page number other than iNew. This function changes the page's
// page number to iNew and sets the value of the PgHdr.flags field to
// the value passed as the third parameter.
-func Xsqlite3PagerRekey(tls *crt.TLS, pPg uintptr, iNew Pgno, flags U16) { /* sqlite3.c:58803:21: */
+func Xsqlite3PagerRekey(tls *libc.TLS, pPg uintptr, iNew Pgno, flags U16) { /* sqlite3.c:58887:21: */
(*DbPage)(unsafe.Pointer(pPg)).Fflags = flags
Xsqlite3PcacheMove(tls, pPg, iNew)
}
// Return a pointer to the data for the specified page.
-func Xsqlite3PagerGetData(tls *crt.TLS, pPg uintptr) uintptr { /* sqlite3.c:58812:21: */
+func Xsqlite3PagerGetData(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:58896:21: */
return (*DbPage)(unsafe.Pointer(pPg)).FpData
}
// Return a pointer to the Pager.nExtra bytes of "extra" space
// allocated along with the specified page.
-func Xsqlite3PagerGetExtra(tls *crt.TLS, pPg uintptr) uintptr { /* sqlite3.c:58821:21: */
+func Xsqlite3PagerGetExtra(tls *libc.TLS, pPg uintptr) uintptr { /* sqlite3.c:58905:21: */
return (*DbPage)(unsafe.Pointer(pPg)).FpExtra
}
@@ -33537,7 +34532,7 @@ func Xsqlite3PagerGetExtra(tls *crt.TLS, pPg uintptr) uintptr { /* sqlite3.c:588
// The returned value is either PAGER_LOCKINGMODE_NORMAL or
// PAGER_LOCKINGMODE_EXCLUSIVE, indicating the current (possibly updated)
// locking-mode.
-func Xsqlite3PagerLockingMode(tls *crt.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:58835:20: */
+func Xsqlite3PagerLockingMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:58919:20: */
if ((eMode >= 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0)) && !(Xsqlite3WalHeapMemory(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal) != 0) {
(*Pager)(unsafe.Pointer(pPager)).FexclusiveMode = U8(eMode)
@@ -33563,7 +34558,7 @@ func Xsqlite3PagerLockingMode(tls *crt.TLS, pPager uintptr, eMode int32) int32 {
// * Temporary databases cannot have _WAL journalmode.
//
// The returned indicate the current (possibly updated) journal-mode.
-func Xsqlite3PagerSetJournalMode(tls *crt.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:58868:20: */
+func Xsqlite3PagerSetJournalMode(tls *libc.TLS, pPager uintptr, eMode int32) int32 { /* sqlite3.c:58952:20: */
var eOld U8 = (*Pager)(unsafe.Pointer(pPager)).FjournalMode // Prior journalmode
// The eMode parameter is always valid
@@ -33633,14 +34628,14 @@ func Xsqlite3PagerSetJournalMode(tls *crt.TLS, pPager uintptr, eMode int32) int3
}
// Return the current journal mode.
-func Xsqlite3PagerGetJournalMode(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:58959:20: */
+func Xsqlite3PagerGetJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59043:20: */
return int32((*Pager)(unsafe.Pointer(pPager)).FjournalMode)
}
// Return TRUE if the pager is in a state where it is OK to change the
// journalmode. Journalmode changes can only happen when the database
// is unmodified.
-func Xsqlite3PagerOkToChangeJournalMode(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:58968:20: */
+func Xsqlite3PagerOkToChangeJournalMode(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59052:20: */
if int32((*Pager)(unsafe.Pointer(pPager)).FeState) >= 3 {
return 0
@@ -33655,7 +34650,7 @@ func Xsqlite3PagerOkToChangeJournalMode(tls *crt.TLS, pPager uintptr) int32 { /*
//
// Setting the size limit to -1 means no limit is enforced.
// An attempt to set a limit smaller than -1 is a no-op.
-func Xsqlite3PagerJournalSizeLimit(tls *crt.TLS, pPager uintptr, iLimit I64) I64 { /* sqlite3.c:58981:20: */
+func Xsqlite3PagerJournalSizeLimit(tls *libc.TLS, pPager uintptr, iLimit I64) I64 { /* sqlite3.c:59065:20: */
if iLimit >= int64(-1) {
(*Pager)(unsafe.Pointer(pPager)).FjournalSizeLimit = iLimit
Xsqlite3WalLimit(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, iLimit)
@@ -33667,12 +34662,12 @@ func Xsqlite3PagerJournalSizeLimit(tls *crt.TLS, pPager uintptr, iLimit I64) I64
// in backup.c maintains the content of this variable. This module
// uses it opaquely as an argument to sqlite3BackupRestart() and
// sqlite3BackupUpdate() only.
-func Xsqlite3PagerBackupPtr(tls *crt.TLS, pPager uintptr) uintptr { /* sqlite3.c:58995:31: */
+func Xsqlite3PagerBackupPtr(tls *libc.TLS, pPager uintptr) uintptr { /* sqlite3.c:59079:31: */
return (pPager + 112 /* &.pBackup */)
}
// Unless this is an in-memory or temporary database, clear the pager cache.
-func Xsqlite3PagerClearCache(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:59003:21: */
+func Xsqlite3PagerClearCache(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:59087:21: */
if int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) == 0 {
pager_reset(tls, pPager)
@@ -33684,7 +34679,7 @@ func Xsqlite3PagerClearCache(tls *crt.TLS, pPager uintptr) { /* sqlite3.c:59003:
// or wal_blocking_checkpoint() API functions.
//
// Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
-func Xsqlite3PagerCheckpoint(tls *crt.TLS, pPager uintptr, db uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:59018:20: */
+func Xsqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:59102:20: */
var rc int32 = 0
if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
rc = Xsqlite3WalCheckpoint(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, db, eMode,
@@ -33701,23 +34696,23 @@ func Xsqlite3PagerCheckpoint(tls *crt.TLS, pPager uintptr, db uintptr, eMode int
return rc
}
-func Xsqlite3PagerWalCallback(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:59037:20: */
+func Xsqlite3PagerWalCallback(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59121:20: */
return Xsqlite3WalCallback(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
}
// Return true if the underlying VFS for the given pager supports the
// primitives necessary for write-ahead logging.
-func Xsqlite3PagerWalSupported(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:59045:20: */
+func Xsqlite3PagerWalSupported(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59129:20: */
var pMethods uintptr = (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods
if (*Pager)(unsafe.Pointer(pPager)).FnoLock != 0 {
return 0
}
- return (crt.Bool32(((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0) || (((*Sqlite3_io_methods)(unsafe.Pointer(pMethods)).FiVersion >= 2) && ((*Sqlite3_io_methods)(unsafe.Pointer(pMethods)).FxShmMap != 0))))
+ return (libc.Bool32(((*Pager)(unsafe.Pointer(pPager)).FexclusiveMode != 0) || (((*Sqlite3_io_methods)(unsafe.Pointer(pMethods)).FiVersion >= 2) && ((*Sqlite3_io_methods)(unsafe.Pointer(pMethods)).FxShmMap != 0))))
}
// Attempt to take an exclusive lock on the database file. If a PENDING lock
// is obtained instead, immediately release it.
-func pagerExclusiveLock(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:59055:12: */
+func pagerExclusiveLock(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59139:12: */
var rc int32 // Return code
rc = pagerLockDb(tls, pPager, 4)
@@ -33734,7 +34729,7 @@ func pagerExclusiveLock(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:59055
// exclusive-locking mode when this function is called, take an EXCLUSIVE
// lock on the database file and use heap-memory to store the wal-index
// in. Otherwise, use the normal shared-memory.
-func pagerOpenWal(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:59075:12: */
+func pagerOpenWal(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59159:12: */
var rc int32 = 0
// If the pager is already in exclusive-mode, the WAL module will use
@@ -33770,7 +34765,7 @@ func pagerOpenWal(tls *crt.TLS, pPager uintptr) int32 { /* sqlite3.c:59075:12: *
// If the pager is open on a temp-file (or in-memory database), or if
// the WAL file is already open, set *pbOpen to 1 and return SQLITE_OK
// without doing anything.
-func Xsqlite3PagerOpenWal(tls *crt.TLS, pPager uintptr, pbOpen uintptr) int32 { /* sqlite3.c:59120:20: */
+func Xsqlite3PagerOpenWal(tls *libc.TLS, pPager uintptr, pbOpen uintptr) int32 { /* sqlite3.c:59204:20: */
var rc int32 = 0 // Return code
if !(int32((*Pager)(unsafe.Pointer(pPager)).FtempFile) != 0) && !(int32((*Pager)(unsafe.Pointer(pPager)).FpWal) != 0) {
@@ -33800,7 +34795,7 @@ func Xsqlite3PagerOpenWal(tls *crt.TLS, pPager uintptr, pbOpen uintptr) int32 {
// EXCLUSIVE lock on the database file. If this cannot be obtained, an
// error (SQLITE_BUSY) is returned and the log connection is not closed.
// If successful, the EXCLUSIVE lock is not released before returning.
-func Xsqlite3PagerCloseWal(tls *crt.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:59159:20: */
+func Xsqlite3PagerCloseWal(tls *libc.TLS, pPager uintptr, db uintptr) int32 { /* sqlite3.c:59243:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -33838,6 +34833,68 @@ func Xsqlite3PagerCloseWal(tls *crt.TLS, pPager uintptr, db uintptr) int32 { /*
return rc
}
+// If this is a WAL database, obtain a snapshot handle for the snapshot
+// currently open. Otherwise, return an error.
+func Xsqlite3PagerSnapshotGet(tls *libc.TLS, pPager uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:59312:20: */
+ var rc int32 = 1
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
+ rc = Xsqlite3WalSnapshotGet(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, ppSnapshot)
+ }
+ return rc
+}
+
+// If this is a WAL database, store a pointer to pSnapshot. Next time a
+// read transaction is opened, attempt to read from the snapshot it
+// identifies. If this is not a WAL database, return an error.
+func Xsqlite3PagerSnapshotOpen(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:59325:20: */
+ var rc int32 = 0
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
+ Xsqlite3WalSnapshotOpen(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSnapshot)
+ } else {
+ rc = 1
+ }
+ return rc
+}
+
+// If this is a WAL database, call sqlite3WalSnapshotRecover(). If this
+// is not a WAL database, return an error.
+func Xsqlite3PagerSnapshotRecover(tls *libc.TLS, pPager uintptr) int32 { /* sqlite3.c:59342:20: */
+ var rc int32
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
+ rc = Xsqlite3WalSnapshotRecover(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
+ } else {
+ rc = 1
+ }
+ return rc
+}
+
+// The caller currently has a read transaction open on the database.
+// If this is not a WAL database, SQLITE_ERROR is returned. Otherwise,
+// this function takes a SHARED lock on the CHECKPOINTER slot and then
+// checks if the snapshot passed as the second argument is still
+// available. If so, SQLITE_OK is returned.
+//
+// If the snapshot is not available, SQLITE_ERROR is returned. Or, if
+// the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error
+// occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER
+// lock is released before returning.
+func Xsqlite3PagerSnapshotCheck(tls *libc.TLS, pPager uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:59364:20: */
+ var rc int32
+ if (*Pager)(unsafe.Pointer(pPager)).FpWal != 0 {
+ rc = Xsqlite3WalSnapshotCheck(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal, pSnapshot)
+ } else {
+ rc = 1
+ }
+ return rc
+}
+
+// Release a lock obtained by an earlier successful call to
+// sqlite3PagerSnapshotCheck().
+func Xsqlite3PagerSnapshotUnlock(tls *libc.TLS, pPager uintptr) { /* sqlite3.c:59378:21: */
+
+ Xsqlite3WalSnapshotUnlock(tls, (*Pager)(unsafe.Pointer(pPager)).FpWal)
+}
+
//************* End of pager.c **********************************************
//************* Begin file wal.c ********************************************
// 2010 February 1
@@ -34406,9 +35463,9 @@ type WalIndexHdr1 = struct {
// byte.
// Object declarations
-type WalIndexHdr = WalIndexHdr1 /* sqlite3.c:59619:28 */
+type WalIndexHdr = WalIndexHdr1 /* sqlite3.c:59703:28 */
type WalIterator1 = struct {
- FiPrior int32
+ FiPrior U32
FnSegment int32
FaSegment [1]struct {
FiNext int32
@@ -34419,7 +35476,7 @@ type WalIterator1 = struct {
}
}
-type WalIterator = WalIterator1 /* sqlite3.c:59620:28 */
+type WalIterator = WalIterator1 /* sqlite3.c:59704:28 */
type WalCkptInfo1 = struct {
FnBackfill U32
FaReadMark [5]U32
@@ -34428,7 +35485,7 @@ type WalCkptInfo1 = struct {
FnotUsed0 U32
}
-type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:59621:28 */
+type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:59705:28 */
// Candidate values for Wal.exclusiveMode.
@@ -34436,7 +35493,7 @@ type WalCkptInfo = WalCkptInfo1 /* sqlite3.c:59621:28 */
// Each page of the wal-index mapping contains a hash-table made up of
// an array of HASHTABLE_NSLOT elements of the following type.
-type Ht_slot = U16 /* sqlite3.c:59812:13 */
+type Ht_slot = U16 /* sqlite3.c:59896:13 */
// This structure is used to implement an iterator that loops through
// all frames in the WAL in database page order. Where two or more frames
@@ -34484,7 +35541,7 @@ type WalSegment = struct {
// If this call is successful, *ppPage is set to point to the wal-index
// page and SQLITE_OK is returned. If an error (an OOM or VFS error) occurs,
// then an SQLite error code is returned and *ppPage is set to 0.
-func walIndexPageRealloc(tls *crt.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:59879:28: */
+func walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:59963:28: */
var rc int32 = 0
// Enlarge the pWal->apWiData[] array if required
@@ -34496,7 +35553,7 @@ func walIndexPageRealloc(tls *crt.TLS, pWal uintptr, iPage int32, ppPage uintptr
*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
return 7
}
- crt.Xmemset(tls, (apNew + uintptr((*Wal)(unsafe.Pointer(pWal)).FnWiData)*8), 0,
+ libc.Xmemset(tls, (apNew + uintptr((*Wal)(unsafe.Pointer(pWal)).FnWiData)*8), 0,
(uint64(unsafe.Sizeof(uintptr(0))) * (uint64((iPage + 1) - (*Wal)(unsafe.Pointer(pWal)).FnWiData))))
(*Wal)(unsafe.Pointer(pWal)).FapWiData = apNew
(*Wal)(unsafe.Pointer(pWal)).FnWiData = (iPage + 1)
@@ -34513,7 +35570,11 @@ func walIndexPageRealloc(tls *crt.TLS, pWal uintptr, iPage int32, ppPage uintptr
rc = Xsqlite3OsShmMap(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, iPage, (int32((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(4096 * 2))) + (uint64(4096) * uint64(unsafe.Sizeof(U32(0)))))),
int32((*Wal)(unsafe.Pointer(pWal)).FwriteLock), ((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8))
- if (rc & 0xff) == 8 {
+ if rc == 0 {
+ if (iPage > 0) && (Xsqlite3FaultSim(tls, 600) != 0) {
+ rc = 7
+ }
+ } else if (rc & 0xff) == 8 {
*(*U8)(unsafe.Pointer(pWal + 66 /* &.readOnly */)) |= U8((2))
if rc == 8 {
rc = 0
@@ -34525,21 +35586,21 @@ func walIndexPageRealloc(tls *crt.TLS, pWal uintptr, iPage int32, ppPage uintptr
return rc
}
-func walIndexPage(tls *crt.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:59924:12: */
- if ((*Wal)(unsafe.Pointer(pWal)).FnWiData <= iPage) || ((crt.AssignPtrUintptr(ppPage, *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)))) == uintptr(0)) {
+func walIndexPage(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintptr) int32 { /* sqlite3.c:60010:12: */
+ if ((*Wal)(unsafe.Pointer(pWal)).FnWiData <= iPage) || ((libc.AssignPtrUintptr(ppPage, *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)))) == uintptr(0)) {
return walIndexPageRealloc(tls, pWal, iPage, ppPage)
}
return 0
}
// Return a pointer to the WalCkptInfo structure in the wal-index.
-func walCkptInfo(tls *crt.TLS, pWal uintptr) uintptr { /* sqlite3.c:59938:29: */
+func walCkptInfo(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60024:29: */
return (*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(0)*8)) + uintptr((uint64(unsafe.Sizeof(WalIndexHdr{}))/uint64(2)))*4)
}
// Return a pointer to the WalIndexHdr structure in the wal-index.
-func walIndexHdr(tls *crt.TLS, pWal uintptr) uintptr { /* sqlite3.c:59946:29: */
+func walIndexHdr(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:60032:29: */
return *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(0)*8))
}
@@ -34557,7 +35618,7 @@ func walIndexHdr(tls *crt.TLS, pWal uintptr) uintptr { /* sqlite3.c:59946:29: */
// The checksum is written back into aOut[] before returning.
//
// nByte must be a positive multiple of 8.
-func walChecksumBytes(tls *crt.TLS, nativeCksum int32, a uintptr, nByte int32, aIn uintptr, aOut uintptr) { /* sqlite3.c:59972:13: */
+func walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, aIn uintptr, aOut uintptr) { /* sqlite3.c:60058:13: */
var s1 U32
var s2 U32
var aData uintptr = a
@@ -34567,13 +35628,13 @@ func walChecksumBytes(tls *crt.TLS, nativeCksum int32, a uintptr, nByte int32, a
s1 = *(*U32)(unsafe.Pointer(aIn + uintptr(0)*4))
s2 = *(*U32)(unsafe.Pointer(aIn + uintptr(1)*4))
} else {
- s1 = crt.AssignUint32(&s2, U32(0))
+ s1 = libc.AssignUint32(&s2, U32(0))
}
if nativeCksum != 0 {
for ok := true; ok; ok = (aData < aEnd) {
- s1 = s1 + (*(*U32)(unsafe.Pointer(crt.PostIncUintptr(&aData, 4))) + s2)
- s2 = s2 + (*(*U32)(unsafe.Pointer(crt.PostIncUintptr(&aData, 4))) + s1)
+ s1 = s1 + (*(*U32)(unsafe.Pointer(libc.PostIncUintptr(&aData, 4))) + s2)
+ s2 = s2 + (*(*U32)(unsafe.Pointer(libc.PostIncUintptr(&aData, 4))) + s1)
}
} else {
for ok1 := true; ok1; ok1 = (aData < aEnd) {
@@ -34589,7 +35650,7 @@ func walChecksumBytes(tls *crt.TLS, nativeCksum int32, a uintptr, nByte int32, a
// If there is the possibility of concurrent access to the SHM file
// from multiple threads and/or processes, then do a memory barrier.
-func walShmBarrier(tls *crt.TLS, pWal uintptr) { /* sqlite3.c:60015:13: */
+func walShmBarrier(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60101:13: */
if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) != 2 {
Xsqlite3OsShmBarrier(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd)
}
@@ -34604,7 +35665,7 @@ func walShmBarrier(tls *crt.TLS, pWal uintptr) { /* sqlite3.c:60015:13: */
// Write the header information in pWal->hdr into the wal-index.
//
// The checksum on pWal->hdr is updated before it is written.
-func walIndexWriteHdr(tls *crt.TLS, pWal uintptr) { /* sqlite3.c:60039:28: */
+func walIndexWriteHdr(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60125:28: */
var aHdr uintptr = walIndexHdr(tls, pWal)
var nCksum int32 = int32((uintptr(0) + 40 /* &.aCksum */))
@@ -34612,9 +35673,9 @@ func walIndexWriteHdr(tls *crt.TLS, pWal uintptr) { /* sqlite3.c:60039:28: */
(*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion = U32(3007000)
walChecksumBytes(tls, 1, (pWal + 72 /* &.hdr */), nCksum, uintptr(0), pWal+72 /* &.hdr */ +40 /* &.aCksum */)
// Possible TSAN false-positive. See tag-20200519-1
- crt.Xmemcpy(tls, (aHdr + uintptr(1)*48), (pWal + 72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, (aHdr + uintptr(1)*48), (pWal + 72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{})))
walShmBarrier(tls, pWal)
- crt.Xmemcpy(tls, (aHdr + uintptr(0)*48), (pWal + 72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, (aHdr + uintptr(0)*48), (pWal + 72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{})))
}
// This function encodes a single frame header and writes it to a buffer
@@ -34628,37 +35689,37 @@ func walIndexWriteHdr(tls *crt.TLS, pWal uintptr) { /* sqlite3.c:60039:28: */
// 12: Salt-2 (copied from the wal-header)
// 16: Checksum-1.
// 20: Checksum-2.
-func walEncodeFrame(tls *crt.TLS, pWal uintptr, iPage U32, nTruncate U32, aData uintptr, aFrame uintptr) { /* sqlite3.c:60066:13: */
+func walEncodeFrame(tls *libc.TLS, pWal uintptr, iPage U32, nTruncate U32, aData uintptr, aFrame uintptr) { /* sqlite3.c:60152:13: */
var nativeCksum int32 // True for native byte-order checksums
var aCksum uintptr = pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */
Xsqlite3Put4byte(tls, (aFrame + uintptr(0)), iPage)
Xsqlite3Put4byte(tls, (aFrame + uintptr(4)), nTruncate)
if (*Wal)(unsafe.Pointer(pWal)).FiReCksum == U32(0) {
- crt.Xmemcpy(tls, (aFrame + uintptr(8)), pWal+72 /* &.hdr */ +32 /* &.aSalt */, uint64(8))
+ libc.Xmemcpy(tls, (aFrame + uintptr(8)), pWal+72 /* &.hdr */ +32 /* &.aSalt */, uint64(8))
- nativeCksum = (crt.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == 0))
+ nativeCksum = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == 0))
walChecksumBytes(tls, nativeCksum, aFrame, 8, aCksum, aCksum)
walChecksumBytes(tls, nativeCksum, aData, int32((*Wal)(unsafe.Pointer(pWal)).FszPage), aCksum, aCksum)
Xsqlite3Put4byte(tls, (aFrame + uintptr(16)), *(*U32)(unsafe.Pointer(aCksum + uintptr(0)*4)))
Xsqlite3Put4byte(tls, (aFrame + uintptr(20)), *(*U32)(unsafe.Pointer(aCksum + uintptr(1)*4)))
} else {
- crt.Xmemset(tls, (aFrame + uintptr(8)), 0, uint64(16))
+ libc.Xmemset(tls, (aFrame + uintptr(8)), 0, uint64(16))
}
}
// Check to see if the frame with header in aFrame[] and content
// in aData[] is valid. If it is a valid frame, fill *piPage and
// *pnTruncate and return true. Return if the frame is not valid.
-func walDecodeFrame(tls *crt.TLS, pWal uintptr, piPage uintptr, pnTruncate uintptr, aData uintptr, aFrame uintptr) int32 { /* sqlite3.c:60097:12: */
+func walDecodeFrame(tls *libc.TLS, pWal uintptr, piPage uintptr, pnTruncate uintptr, aData uintptr, aFrame uintptr) int32 { /* sqlite3.c:60183:12: */
var nativeCksum int32 // True for native byte-order checksums
var aCksum uintptr = pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */
var pgno U32 // Page number of the frame
// A frame is only valid if the salt values in the frame-header
// match the salt values in the wal-header.
- if crt.Xmemcmp(tls, (pWal+72 /* &.hdr */ +32 /* &.aSalt */), (aFrame+uintptr(8)), uint64(8)) != 0 {
+ if libc.Xmemcmp(tls, (pWal+72 /* &.hdr */ +32 /* &.aSalt */), (aFrame+uintptr(8)), uint64(8)) != 0 {
return 0
}
@@ -34672,7 +35733,7 @@ func walDecodeFrame(tls *crt.TLS, pWal uintptr, piPage uintptr, pnTruncate uintp
// all prior frams, the first 16 bytes of this frame-header,
// and the frame-data matches the checksum in the last 8
// bytes of this frame-header.
- nativeCksum = (crt.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == 0))
+ nativeCksum = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == 0))
walChecksumBytes(tls, nativeCksum, aFrame, 8, aCksum, aCksum)
walChecksumBytes(tls, nativeCksum, aData, int32((*Wal)(unsafe.Pointer(pWal)).FszPage), aCksum, aCksum)
if (*(*U32)(unsafe.Pointer(aCksum + uintptr(0)*4)) != Xsqlite3Get4byte(tls, (aFrame+uintptr(16)))) ||
@@ -34693,7 +35754,7 @@ func walDecodeFrame(tls *crt.TLS, pWal uintptr, piPage uintptr, pnTruncate uintp
// through the unlocked state first.
//
// In locking_mode=EXCLUSIVE, all of these routines become no-ops.
-func walLockShared(tls *crt.TLS, pWal uintptr, lockIdx int32) int32 { /* sqlite3.c:60176:12: */
+func walLockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) int32 { /* sqlite3.c:60262:12: */
var rc int32
if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 {
return 0
@@ -34703,7 +35764,7 @@ func walLockShared(tls *crt.TLS, pWal uintptr, lockIdx int32) int32 { /* sqlite3
return rc
}
-func walUnlockShared(tls *crt.TLS, pWal uintptr, lockIdx int32) { /* sqlite3.c:60186:13: */
+func walUnlockShared(tls *libc.TLS, pWal uintptr, lockIdx int32) { /* sqlite3.c:60272:13: */
if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 {
return
}
@@ -34711,7 +35772,7 @@ func walUnlockShared(tls *crt.TLS, pWal uintptr, lockIdx int32) { /* sqlite3.c:6
(1 | 4))
}
-func walLockExclusive(tls *crt.TLS, pWal uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:60192:12: */
+func walLockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:60278:12: */
var rc int32
if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 {
return 0
@@ -34721,7 +35782,7 @@ func walLockExclusive(tls *crt.TLS, pWal uintptr, lockIdx int32, n int32) int32
return rc
}
-func walUnlockExclusive(tls *crt.TLS, pWal uintptr, lockIdx int32, n int32) { /* sqlite3.c:60202:13: */
+func walUnlockExclusive(tls *libc.TLS, pWal uintptr, lockIdx int32, n int32) { /* sqlite3.c:60288:13: */
if (*Wal)(unsafe.Pointer(pWal)).FexclusiveMode != 0 {
return
}
@@ -34733,11 +35794,11 @@ func walUnlockExclusive(tls *crt.TLS, pWal uintptr, lockIdx int32, n int32) { /*
// Compute a hash on a page number. The resulting hash value must land
// between 0 and (HASHTABLE_NSLOT-1). The walHashNext() function advances
// the hash to the next value in the event of a collision.
-func walHash(tls *crt.TLS, iPage U32) int32 { /* sqlite3.c:60215:12: */
+func walHash(tls *libc.TLS, iPage U32) int32 { /* sqlite3.c:60301:12: */
return (int32((iPage * U32(383)) & (U32((4096 * 2) - 1))))
}
-func walNextHash(tls *crt.TLS, iPriorHash int32) int32 { /* sqlite3.c:60220:12: */
+func walNextHash(tls *libc.TLS, iPriorHash int32) int32 { /* sqlite3.c:60306:12: */
return ((iPriorHash + 1) & ((4096 * 2) - 1))
}
@@ -34754,7 +35815,7 @@ type WalHashLoc1 = struct {
// An instance of the WalHashLoc object is used to describe the location
// of a page hash table in the wal-index. This becomes the return value
// from walHashGet().
-type WalHashLoc = WalHashLoc1 /* sqlite3.c:60229:27 */
+type WalHashLoc = WalHashLoc1 /* sqlite3.c:60315:27 */
// Return pointers to the hash table and page number array stored on
// page iHash of the wal-index. The wal-index is broken into 32KB pages
@@ -34768,7 +35829,7 @@ type WalHashLoc = WalHashLoc1 /* sqlite3.c:60229:27 */
//
// Finally, set pLoc->aPgno so that pLoc->aPgno[1] is the page number of the
// first frame indexed by the hash table, frame (pLoc->iZero+1).
-func walHashGet(tls *crt.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { /* sqlite3.c:60250:12: */
+func walHashGet(tls *libc.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { /* sqlite3.c:60336:12: */
var rc int32 // Return code
rc = walIndexPage(tls, pWal, iHash, (pLoc + 8 /* &.aPgno */))
@@ -34781,7 +35842,7 @@ func walHashGet(tls *crt.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { /
} else {
(*WalHashLoc)(unsafe.Pointer(pLoc)).FiZero = (U32((uint64(4096) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iHash - 1) * 4096))))
}
- (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + crt.UintptrFromInt32(-1)*4)
+ (*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno = ((*WalHashLoc)(unsafe.Pointer(pLoc)).FaPgno + libc.UintptrFromInt32(-1)*4)
}
return rc
}
@@ -34790,14 +35851,14 @@ func walHashGet(tls *crt.TLS, pWal uintptr, iHash int32, pLoc uintptr) int32 { /
// and page-number array that contain entries corresponding to WAL frame
// iFrame. The wal-index is broken up into 32KB pages. Wal-index pages
// are numbered starting from 0.
-func walFramePage(tls *crt.TLS, iFrame U32) int32 { /* sqlite3.c:60279:12: */
+func walFramePage(tls *libc.TLS, iFrame U32) int32 { /* sqlite3.c:60365:12: */
var iHash int32 = (int32((((uint64(iFrame + U32(4096))) - (uint64(4096) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0)))))) - uint64(1)) / uint64(4096)))
return iHash
}
// Return the page number associated with frame iFrame in this WAL.
-func walFramePgno(tls *crt.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:60293:12: */
+func walFramePgno(tls *libc.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:60380:12: */
var iHash int32 = walFramePage(tls, iFrame)
if iHash == 0 {
return *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(0)*8)) + uintptr((((((uint64(unsafe.Sizeof(WalIndexHdr{}))*uint64(2))+uint64(unsafe.Sizeof(WalCkptInfo{})))/uint64(unsafe.Sizeof(U32(0))))+uint64(iFrame))-uint64(1)))*4))
@@ -34815,7 +35876,7 @@ func walFramePgno(tls *crt.TLS, pWal uintptr, iFrame U32) U32 { /* sqlite3.c:602
// updated. Any later hash tables will be automatically cleared when
// pWal->hdr.mxFrame advances to the point where those hash tables are
// actually needed.
-func walCleanupHash(tls *crt.TLS, pWal uintptr) { /* sqlite3.c:60313:13: */
+func walCleanupHash(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:60400:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -34852,13 +35913,13 @@ func walCleanupHash(tls *crt.TLS, pWal uintptr) { /* sqlite3.c:60313:13: */
// Zero the entries in the aPgno array that correspond to frames with
// frame numbers greater than pWal->hdr.mxFrame.
nByte = (int32((int64((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash) - int64(((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr((iLimit+1))*4))) / 1))
- crt.Xmemset(tls, ((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr((iLimit+1))*4), 0, uint64(nByte))
+ libc.Xmemset(tls, ((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr((iLimit+1))*4), 0, uint64(nByte))
}
// Set an entry in the wal-index that will map database page number
// pPage into WAL frame iFrame.
-func walIndexAppend(tls *crt.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { /* sqlite3.c:60375:12: */
+func walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { /* sqlite3.c:60462:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -34882,7 +35943,7 @@ func walIndexAppend(tls *crt.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { /
if idx == 1 {
var nByte int32 = (int32((int64(((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + uintptr((4096*2))*2)) -
int64(((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr(1)*4))) / 1))
- crt.Xmemset(tls, ((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr(1)*4), 0, uint64(nByte))
+ libc.Xmemset(tls, ((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr(1)*4), 0, uint64(nByte))
}
// If the entry in aPgno[] is already set, then the previous writer
@@ -34897,12 +35958,12 @@ func walIndexAppend(tls *crt.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { /
// Write the aPgno[] array entry and the hash-table slot.
nCollide = idx
for iKey = walHash(tls, iPage); *(*Ht_slot)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + uintptr(iKey)*2)) != 0; iKey = walNextHash(tls, iKey) {
- if (crt.PostDecInt32(&nCollide, 1)) == 0 {
- return Xsqlite3CorruptError(tls, 60415)
+ if (libc.PostDecInt32(&nCollide, 1)) == 0 {
+ return Xsqlite3CorruptError(tls, 60502)
}
}
*(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr(idx)*4)) = iPage
- *(*Ht_slot)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + uintptr(iKey)*2)) = Ht_slot(idx)
+ *(*Ht_slot)(unsafe.Pointer(((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + uintptr(iKey)*2))) = Ht_slot(idx)
}
return rc
@@ -34916,34 +35977,43 @@ func walIndexAppend(tls *crt.TLS, pWal uintptr, iFrame U32, iPage U32) int32 { /
// WAL_RECOVER_LOCK is also held so that other threads will know
// that this thread is running recovery. If unable to establish
// the necessary locks, this routine returns SQLITE_BUSY.
-func walIndexRecover(tls *crt.TLS, pWal uintptr) int32 { /* sqlite3.c:60465:12: */
- bp := tls.Alloc(72)
- defer tls.Free(72)
+func walIndexRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:60552:12: */
+ bp := tls.Alloc(80)
+ defer tls.Free(80)
var rc int32 // Return Code
// var nSize I64 at bp+16, 8
// Size of log file
- // var aFrameCksum [2]U32 at bp+64, 8
+ // var aFrameCksum [2]U32 at bp+72, 8
var iLock int32
- // var pgno U32 at bp+56, 4
+ var iOffset I64
+ // var pgno U32 at bp+64, 4
// Database page number for frame
- // var nTruncate U32 at bp+60, 4
+ // var nTruncate U32 at bp+68, 4
+ // var aShare uintptr at bp+56, 8
+
+ var iFrame U32 // Index of last frame read
+ var iLast U32
+ var iFirst U32
+ var nHdr U32
+ var nHdr32 U32
// var aBuf [32]U8 at bp+24, 32
// Buffer to load WAL header into
- var aFrame uintptr // Malloc'd buffer to load entire frame
- var szFrame int32 // Number of bytes in buffer aFrame[]
- var aData uintptr // Pointer to data part of aFrame buffer
- var iFrame int32 // Index of last frame read
- var iOffset I64 // Next offset to read from log file
- var szPage int32 // Page size according to the log
- var magic U32 // Magic value read from WAL header
- var version U32 // Magic value read from WAL header
- var isValid int32
+ var aPrivate uintptr // Heap copy of *-shm hash being populated
+ var aFrame uintptr // Malloc'd buffer to load entire frame
+ var szFrame int32 // Number of bytes in buffer aFrame[]
+ var aData uintptr // Pointer to data part of aFrame buffer
+ var szPage int32 // Page size according to the log
+ var magic U32 // Magic value read from WAL header
+ var version U32 // Magic value read from WAL header
+ var isValid int32 // True if this frame is valid
+ var iPg U32 // Current 32KB wal-index page
+ var iLastFrame U32
var pInfo uintptr
var i int32
- *(*[2]U32)(unsafe.Pointer(bp + 64 /* aFrameCksum */)) = [2]U32{U32(0), U32(0)} // Lock offset to lock for checkpoint
+ *(*[2]U32)(unsafe.Pointer(bp + 72 /* aFrameCksum */)) = [2]U32{U32(0), U32(0)} // Lock offset to lock for checkpoint
// Obtain an exclusive lock on all byte in the locking range not already
// locked by the caller. The caller is guaranteed to have locked the
@@ -34953,47 +36023,36 @@ func walIndexRecover(tls *crt.TLS, pWal uintptr) int32 { /* sqlite3.c:60465:12:
iLock = (1 + int32((*Wal)(unsafe.Pointer(pWal)).FckptLock))
rc = walLockExclusive(tls, pWal, iLock, ((3 + (0)) - iLock))
- if !(rc == 0) {
- goto __1
- }
- rc = walLockExclusive(tls, pWal, (3 + (1)), ((8 - 3) - 1))
- if !(rc != 0) {
- goto __2
- }
- walUnlockExclusive(tls, pWal, iLock, ((3 + (0)) - iLock))
-__2:
- ;
-__1:
- ;
if !(rc != 0) {
- goto __3
+ goto __1
}
return rc
-__3:
+__1:
;
- crt.Xmemset(tls, (pWal + 72 /* &.hdr */), 0, uint64(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemset(tls, (pWal + 72 /* &.hdr */), 0, uint64(unsafe.Sizeof(WalIndexHdr{})))
rc = Xsqlite3OsFileSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp+16 /* &nSize */)
if !(rc != 0) {
- goto __4
+ goto __2
}
goto recovery_error
-__4:
+__2:
;
if !(*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) > int64(32)) {
- goto __5
+ goto __3
} // Buffer to load WAL header into
- aFrame = uintptr(0) // True if this frame is valid
+ aPrivate = uintptr(0) // Heap copy of *-shm hash being populated
+ aFrame = uintptr(0) // Last frame in wal, based on nSize alone
// Read in the WAL header.
rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, bp+24 /* &aBuf[0] */, 32, int64(0))
if !(rc != 0) {
- goto __6
+ goto __4
}
goto recovery_error
-__6:
+__4:
;
// If the database page size is not a power of two, or is greater than
@@ -35006,139 +36065,212 @@ __6:
((szPage & (szPage - 1)) != 0)) ||
(szPage > 65536)) ||
(szPage < 512)) {
- goto __7
+ goto __5
}
goto finished
-__7:
+__5:
;
(*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum = (U8(magic & U32(0x00000001)))
(*Wal)(unsafe.Pointer(pWal)).FszPage = U32(szPage)
(*Wal)(unsafe.Pointer(pWal)).FnCkpt = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + uintptr(12)))
- crt.Xmemcpy(tls, (pWal + 72 /* &.hdr */ + 32 /* &.aSalt */), (bp + 24 /* &aBuf */ + uintptr(16)), uint64(8))
+ libc.Xmemcpy(tls, (pWal + 72 /* &.hdr */ + 32 /* &.aSalt */), (bp + 24 /* &aBuf */ + uintptr(16)), uint64(8))
// Verify that the WAL header checksum is correct
- walChecksumBytes(tls, (crt.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == 0)),
+ walChecksumBytes(tls, (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FbigEndCksum) == 0)),
bp+24 /* &aBuf[0] */, (32 - (2 * 4)), uintptr(0), pWal+72 /* &.hdr */ +24 /* &.aFrameCksum */)
if !((*(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + uintptr(0)*4)) != Xsqlite3Get4byte(tls, (bp+24 /* &aBuf */ +uintptr(24)))) ||
(*(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + uintptr(1)*4)) != Xsqlite3Get4byte(tls, (bp+24 /* &aBuf */ +uintptr(28))))) {
- goto __8
+ goto __6
}
goto finished
-__8:
+__6:
;
// Verify that the version number on the WAL format is one that
// are able to understand
version = Xsqlite3Get4byte(tls, (bp + 24 /* &aBuf */ + uintptr(4)))
if !(version != U32(3007000)) {
- goto __9
+ goto __7
}
- rc = Xsqlite3CantopenError(tls, 60553)
+ rc = Xsqlite3CantopenError(tls, 60635)
goto finished
-__9:
+__7:
;
// Malloc a buffer to read frames into.
szFrame = (szPage + 24)
- aFrame = Xsqlite3_malloc64(tls, uint64(szFrame))
+ aFrame = Xsqlite3_malloc64(tls, (uint64(uint64(szFrame) + ((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(4096 * 2))) + (uint64(4096) * uint64(unsafe.Sizeof(U32(0))))))))
if !(!(aFrame != 0)) {
- goto __10
+ goto __8
}
rc = 7
goto recovery_error
-__10:
+__8:
;
aData = (aFrame + uintptr(24))
+ aPrivate = (aData + uintptr(szPage))
// Read all frames from the log file.
- iFrame = 0
- iOffset = int64(32)
-__11:
- if !((iOffset + I64(szFrame)) <= *(*I64)(unsafe.Pointer(bp + 16 /* nSize */))) {
- goto __13
- } // dbsize field from frame header
+ iLastFrame = (U32((*(*I64)(unsafe.Pointer(bp + 16 /* nSize */)) - int64(32)) / I64(szFrame)))
+ iPg = U32(0)
+__9:
+ if !(iPg <= U32(walFramePage(tls, iLastFrame))) {
+ goto __11
+ } // Index of last frame read
+ iLast = func() uint32 {
+ if (uint64(iLastFrame)) < ((uint64(4096) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * U32(4096)))) {
+ return iLastFrame
+ }
+ return (uint32((uint64(4096) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64(iPg * U32(4096)))))
+ }()
+ iFirst = (U32(uint64(1) + (func() uint64 {
+ if iPg == U32(0) {
+ return uint64(0)
+ }
+ return ((uint64(4096) - (((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))) / uint64(unsafe.Sizeof(U32(0))))) + (uint64((iPg - U32(1)) * U32(4096))))
+ }())))
+ rc = walIndexPage(tls, pWal, int32(iPg), bp+56 /* &aShare */)
+ if !(rc != 0) {
+ goto __12
+ }
+ goto __11
+__12:
+ ;
+ *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPg)*8)) = aPrivate
+
+ iFrame = iFirst
+__13:
+ if !(iFrame <= iLast) {
+ goto __15
+ }
+ iOffset = (int64(32) + ((I64((iFrame) - U32(1))) * (I64((szPage) + 24)))) // dbsize field from frame header
// Read and decode the next log frame.
- iFrame++
rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, aFrame, szFrame, iOffset)
if !(rc != 0) {
- goto __14
+ goto __16
}
- goto __13
-__14:
+ goto __15
+__16:
;
- isValid = walDecodeFrame(tls, pWal, bp+56 /* &pgno */, bp+60 /* &nTruncate */, aData, aFrame)
+ isValid = walDecodeFrame(tls, pWal, bp+64 /* &pgno */, bp+68 /* &nTruncate */, aData, aFrame)
if !(!(isValid != 0)) {
- goto __15
+ goto __17
}
- goto __13
-__15:
+ goto __15
+__17:
;
- rc = walIndexAppend(tls, pWal, uint32(iFrame), *(*U32)(unsafe.Pointer(bp + 56 /* pgno */)))
+ rc = walIndexAppend(tls, pWal, iFrame, *(*U32)(unsafe.Pointer(bp + 64 /* pgno */)))
if !(rc != 0) {
- goto __16
+ goto __18
}
- goto __13
-__16:
+ goto __15
+__18:
;
// If nTruncate is non-zero, this is a commit record.
- if !(*(*U32)(unsafe.Pointer(bp + 60 /* nTruncate */)) != 0) {
- goto __17
+ if !(*(*U32)(unsafe.Pointer(bp + 68 /* nTruncate */)) != 0) {
+ goto __19
}
- (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = U32(iFrame)
- (*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage = *(*U32)(unsafe.Pointer(bp + 60 /* nTruncate */))
+ (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = iFrame
+ (*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage = *(*U32)(unsafe.Pointer(bp + 68 /* nTruncate */))
(*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage = (U16((szPage & 0xff00) | (szPage >> 16)))
- *(*U32)(unsafe.Pointer(bp + 64 /* &aFrameCksum[0] */ + uintptr(0)*4)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + uintptr(0)*4))
- *(*U32)(unsafe.Pointer(bp + 64 /* &aFrameCksum[0] */ + uintptr(1)*4)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + uintptr(1)*4))
-__17:
+ *(*U32)(unsafe.Pointer(bp + 72 /* &aFrameCksum[0] */ + uintptr(0)*4)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + uintptr(0)*4))
+ *(*U32)(unsafe.Pointer(bp + 72 /* &aFrameCksum[0] */ + uintptr(1)*4)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + uintptr(1)*4))
+__19:
;
- goto __12
-__12:
- iOffset = iOffset + (I64(szFrame))
- goto __11
+ goto __14
+__14:
+ iFrame++
goto __13
-__13:
+ goto __15
+__15:
+ ;
+ *(*uintptr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPg)*8)) = *(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */))
+ nHdr = func() uint32 {
+ if iPg == U32(0) {
+ return (uint32((uint64(unsafe.Sizeof(WalIndexHdr{})) * uint64(2)) + uint64(unsafe.Sizeof(WalCkptInfo{}))))
+ }
+ return uint32(0)
+ }()
+ nHdr32 = (U32(uint64(nHdr) / uint64(unsafe.Sizeof(U32(0)))))
+ // Memcpy() should work fine here, on all reasonable implementations.
+ // Technically, memcpy() might change the destination to some
+ // intermediate value before setting to the final value, and that might
+ // cause a concurrent reader to malfunction. Memcpy() is allowed to
+ // do that, according to the spec, but no memcpy() implementation that
+ // we know of actually does that, which is why we say that memcpy()
+ // is safe for this. Memcpy() is certainly a lot faster.
+ libc.Xmemcpy(tls, (*(*uintptr)(unsafe.Pointer(bp + 56 /* aShare */)) + uintptr(nHdr32)*4), (aPrivate + uintptr(nHdr32)*4), (((uint64(unsafe.Sizeof(Ht_slot(0))) * (uint64(4096 * 2))) + (uint64(4096) * uint64(unsafe.Sizeof(U32(0))))) - uint64(nHdr)))
+ if !(iFrame <= iLast) {
+ goto __20
+ }
+ goto __11
+__20:
+ ;
+ goto __10
+__10:
+ iPg++
+ goto __9
+ goto __11
+__11:
;
Xsqlite3_free(tls, aFrame)
-__5:
+__3:
;
finished:
if !(rc == 0) {
- goto __18
+ goto __21
}
- *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + uintptr(0)*4)) = *(*U32)(unsafe.Pointer(bp + 64 /* &aFrameCksum[0] */ + uintptr(0)*4))
- *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + uintptr(1)*4)) = *(*U32)(unsafe.Pointer(bp + 64 /* &aFrameCksum[0] */ + uintptr(1)*4))
+ *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + uintptr(0)*4)) = *(*U32)(unsafe.Pointer(bp + 72 /* &aFrameCksum[0] */ + uintptr(0)*4))
+ *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + uintptr(1)*4)) = *(*U32)(unsafe.Pointer(bp + 72 /* &aFrameCksum[0] */ + uintptr(1)*4))
walIndexWriteHdr(tls, pWal)
// Reset the checkpoint-header. This is safe because this thread is
- // currently holding locks that exclude all other readers, writers and
- // checkpointers.
+ // currently holding locks that exclude all other writers and
+ // checkpointers. Then set the values of read-mark slots 1 through N.
pInfo = walCkptInfo(tls, pWal)
(*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill = U32(0)
(*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
*(*U32)(unsafe.Pointer((pInfo + 4 /* &.aReadMark */) + uintptr(0)*4)) = U32(0)
i = 1
-__19:
+__22:
if !(i < (8 - 3)) {
- goto __21
+ goto __24
+ }
+ rc = walLockExclusive(tls, pWal, (3 + (i)), 1)
+ if !(rc == 0) {
+ goto __25
+ }
+ if !((i == 1) && ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0)) {
+ goto __27
}
+ *(*U32)(unsafe.Pointer((pInfo + 4 /* &.aReadMark */) + uintptr(i)*4)) = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
+ goto __28
+__27:
*(*U32)(unsafe.Pointer((pInfo + 4 /* &.aReadMark */) + uintptr(i)*4)) = 0xffffffff
- goto __20
-__20:
- i++
- goto __19
- goto __21
-__21:
+__28:
;
- if !((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0) {
- goto __22
+ walUnlockExclusive(tls, pWal, (3 + (i)), 1)
+ goto __26
+__25:
+ if !(rc != 5) {
+ goto __29
}
- *(*U32)(unsafe.Pointer((pInfo + 4 /* &.aReadMark */) + uintptr(1)*4)) = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
-__22:
+ goto recovery_error
+__29:
+ ;
+__26:
+ ;
+ goto __23
+__23:
+ i++
+ goto __22
+ goto __24
+__24:
;
// If more than one frame was recovered from the log file, report an
@@ -35146,25 +36278,24 @@ __22:
// problems caused by applications routinely shutting down without
// checkpointing the log file.
if !((*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0) {
- goto __23
+ goto __30
}
Xsqlite3_log(tls, (27 | (int32(1) << 8)),
- ts+3469, /* "recovered %d fra..." */
- crt.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame, (*Wal)(unsafe.Pointer(pWal)).FzWalName))
-__23:
+ ts+5604, /* "recovered %d fra..." */
+ libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame, (*Wal)(unsafe.Pointer(pWal)).FzWalName))
+__30:
;
-__18:
+__21:
;
recovery_error:
;
walUnlockExclusive(tls, pWal, iLock, ((3 + (0)) - iLock))
- walUnlockExclusive(tls, pWal, (3 + (1)), ((8 - 3) - 1))
return rc
}
// Close an open wal-index.
-func walIndexClose(tls *crt.TLS, pWal uintptr, isDelete int32) { /* sqlite3.c:60638:13: */
+func walIndexClose(tls *libc.TLS, pWal uintptr, isDelete int32) { /* sqlite3.c:60774:13: */
if (int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == 2) || ((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0) {
var i int32
for i = 0; i < (*Wal)(unsafe.Pointer(pWal)).FnWiData; i++ {
@@ -35190,7 +36321,7 @@ func walIndexClose(tls *crt.TLS, pWal uintptr, isDelete int32) { /* sqlite3.c:60
// If the log file is successfully opened, SQLITE_OK is returned and
// *ppWal is set to point to a new WAL handle. If an error occurs,
// an SQLite error code is returned and *ppWal is left unmodified.
-func Xsqlite3WalOpen(tls *crt.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintptr, bNoShm int32, mxWalSize I64, ppWal uintptr) int32 { /* sqlite3.c:60666:20: */
+func Xsqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintptr, bNoShm int32, mxWalSize I64, ppWal uintptr) int32 { /* sqlite3.c:60802:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -35213,7 +36344,7 @@ func Xsqlite3WalOpen(tls *crt.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintptr
}
(*Wal)(unsafe.Pointer(pRet)).FpVfs = pVfs
- (*Wal)(unsafe.Pointer(pRet)).FpWalFd = (pRet + uintptr(1)*144)
+ (*Wal)(unsafe.Pointer(pRet)).FpWalFd = (pRet + uintptr(1)*152)
(*Wal)(unsafe.Pointer(pRet)).FpDbFd = pDbFd
(*Wal)(unsafe.Pointer(pRet)).FreadLock = int16(-1)
(*Wal)(unsafe.Pointer(pRet)).FmxWalSize = mxWalSize
@@ -35252,7 +36383,7 @@ func Xsqlite3WalOpen(tls *crt.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintptr
}
// Change the size to which the WAL file is trucated on each reset.
-func Xsqlite3WalLimit(tls *crt.TLS, pWal uintptr, iLimit I64) { /* sqlite3.c:60740:21: */
+func Xsqlite3WalLimit(tls *libc.TLS, pWal uintptr, iLimit I64) { /* sqlite3.c:60876:21: */
if pWal != 0 {
(*Wal)(unsafe.Pointer(pWal)).FmxWalSize = iLimit
}
@@ -35266,12 +36397,12 @@ func Xsqlite3WalLimit(tls *crt.TLS, pWal uintptr, iLimit I64) { /* sqlite3.c:607
//
// Return 0 on success. If there are no pages in the WAL with a page
// number larger than *piPage, then return 1.
-func walIteratorNext(tls *crt.TLS, p uintptr, piPage uintptr, piFrame uintptr) int32 { /* sqlite3.c:60754:12: */
+func walIteratorNext(tls *libc.TLS, p uintptr, piPage uintptr, piFrame uintptr) int32 { /* sqlite3.c:60890:12: */
var iMin U32 // Result pgno must be greater than iMin
var iRet U32 = 0xFFFFFFFF // 0xffffffff is never a valid page number
var i int32 // For looping through segments
- iMin = U32((*WalIterator)(unsafe.Pointer(p)).FiPrior)
+ iMin = (*WalIterator)(unsafe.Pointer(p)).FiPrior
for i = ((*WalIterator)(unsafe.Pointer(p)).FnSegment - 1); i >= 0; i-- {
var pSegment uintptr = ((p + 8 /* &.aSegment */) + uintptr(i)*32)
@@ -35288,8 +36419,8 @@ func walIteratorNext(tls *crt.TLS, p uintptr, piPage uintptr, piFrame uintptr) i
}
}
- *(*U32)(unsafe.Pointer(piPage)) = U32(crt.AssignPtrInt32(p /* &.iPrior */, int32(iRet)))
- return (crt.Bool32(iRet == 0xFFFFFFFF))
+ *(*U32)(unsafe.Pointer(piPage)) = libc.AssignPtrUint32(p /* &.iPrior */, iRet)
+ return (libc.Bool32(iRet == 0xFFFFFFFF))
}
// This function merges two sorted lists into a single sorted list.
@@ -35313,7 +36444,7 @@ func walIteratorNext(tls *crt.TLS, p uintptr, piPage uintptr, piFrame uintptr) i
// aLeft[X]!=aRight[Y] && aContent[aLeft[X]] == aContent[aRight[Y]]
//
// When that happens, omit the aLeft[X] and use the aRight[Y] index.
-func walMerge(tls *crt.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRight uintptr, pnRight uintptr, aTmp uintptr) { /* sqlite3.c:60807:13: */
+func walMerge(tls *libc.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRight uintptr, pnRight uintptr, aTmp uintptr) { /* sqlite3.c:60943:13: */
var iLeft int32 = 0 // Current index in aLeft
var iRight int32 = 0 // Current index in aRight
var iOut int32 = 0 // Current index in output buffer
@@ -35326,13 +36457,13 @@ func walMerge(tls *crt.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRigh
if (iLeft < nLeft) &&
((iRight >= nRight) || (*(*U32)(unsafe.Pointer(aContent + uintptr(*(*Ht_slot)(unsafe.Pointer(aLeft + uintptr(iLeft)*2)))*4)) < *(*U32)(unsafe.Pointer(aContent + uintptr(*(*Ht_slot)(unsafe.Pointer(aRight + uintptr(iRight)*2)))*4)))) {
- logpage = *(*Ht_slot)(unsafe.Pointer(aLeft + uintptr(crt.PostIncInt32(&iLeft, 1))*2))
+ logpage = *(*Ht_slot)(unsafe.Pointer(aLeft + uintptr(libc.PostIncInt32(&iLeft, 1))*2))
} else {
- logpage = *(*Ht_slot)(unsafe.Pointer(aRight + uintptr(crt.PostIncInt32(&iRight, 1))*2))
+ logpage = *(*Ht_slot)(unsafe.Pointer(aRight + uintptr(libc.PostIncInt32(&iRight, 1))*2))
}
dbpage = *(*U32)(unsafe.Pointer(aContent + uintptr(logpage)*4))
- *(*Ht_slot)(unsafe.Pointer(aTmp + uintptr(crt.PostIncInt32(&iOut, 1))*2)) = logpage
+ *(*Ht_slot)(unsafe.Pointer(aTmp + uintptr(libc.PostIncInt32(&iOut, 1))*2)) = logpage
if (iLeft < nLeft) && (*(*U32)(unsafe.Pointer(aContent + uintptr(*(*Ht_slot)(unsafe.Pointer(aLeft + uintptr(iLeft)*2)))*4)) == dbpage) {
iLeft++
}
@@ -35341,7 +36472,7 @@ func walMerge(tls *crt.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRigh
*(*uintptr)(unsafe.Pointer(paRight)) = aLeft
*(*int32)(unsafe.Pointer(pnRight)) = iOut
- crt.Xmemcpy(tls, aLeft, aTmp, (uint64(unsafe.Sizeof(Ht_slot(0))) * uint64(iOut)))
+ libc.Xmemcpy(tls, aLeft, aTmp, (uint64(unsafe.Sizeof(Ht_slot(0))) * uint64(iOut)))
}
// Sort the elements in list aList using aContent[] as the sort key.
@@ -35359,7 +36490,7 @@ func walMerge(tls *crt.TLS, aContent uintptr, aLeft uintptr, nLeft int32, paRigh
//
// Keep the larger of the two values aList[X] and aList[Y] and discard
// the smaller.
-func walMergesort(tls *crt.TLS, aContent uintptr, aBuffer uintptr, aList uintptr, pnList uintptr) { /* sqlite3.c:60864:13: */
+func walMergesort(tls *libc.TLS, aContent uintptr, aBuffer uintptr, aList uintptr, pnList uintptr) { /* sqlite3.c:61000:13: */
bp := tls.Alloc(220)
defer tls.Free(220)
@@ -35371,7 +36502,7 @@ func walMergesort(tls *crt.TLS, aContent uintptr, aBuffer uintptr, aList uintptr
// var aSub [13]Sublist at bp, 208
// Array of sub-lists
- crt.Xmemset(tls, bp /* &aSub[0] */, 0, uint64(unsafe.Sizeof([13]Sublist{})))
+ libc.Xmemset(tls, bp /* &aSub[0] */, 0, uint64(unsafe.Sizeof([13]Sublist{})))
for iList = 0; iList < nList; iList++ {
*(*int32)(unsafe.Pointer(bp + 216 /* nMerge */)) = 1
@@ -35407,7 +36538,7 @@ type Sublist = struct {
}
// Free an iterator allocated by walIteratorInit().
-func walIteratorFree(tls *crt.TLS, p uintptr) { /* sqlite3.c:60927:13: */
+func walIteratorFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:61063:13: */
Xsqlite3_free(tls, p)
}
@@ -35422,7 +36553,7 @@ func walIteratorFree(tls *crt.TLS, p uintptr) { /* sqlite3.c:60927:13: */
//
// The calling routine should invoke walIteratorFree() to destroy the
// WalIterator object when it has finished with it.
-func walIteratorInit(tls *crt.TLS, pWal uintptr, nBackfill U32, pp uintptr) int32 { /* sqlite3.c:60944:12: */
+func walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill U32, pp uintptr) int32 { /* sqlite3.c:61080:12: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -35448,7 +36579,7 @@ func walIteratorInit(tls *crt.TLS, pWal uintptr, nBackfill U32, pp uintptr) int3
if !(p != 0) {
return 7
}
- crt.Xmemset(tls, p, 0, uint64(nByte))
+ libc.Xmemset(tls, p, 0, uint64(nByte))
(*WalIterator)(unsafe.Pointer(p)).FnSegment = nSegment
// Allocate temporary space used by the merge-sort routine. This block
@@ -35507,9 +36638,9 @@ func walIteratorInit(tls *crt.TLS, pWal uintptr, nBackfill U32, pp uintptr) int3
// n. If the attempt fails and parameter xBusy is not NULL, then it is a
// busy-handler function. Invoke it and retry the lock until either the
// lock is successfully obtained or the busy-handler returns 0.
-func walBusyLock(tls *crt.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:61108:12: */
+func walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) int32 { /* sqlite3.c:61244:12: */
var rc int32
- for ok := true; ok; ok = (((xBusy != 0) && (rc == 5)) && ((*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(&xBusy)))(tls, pBusyArg) != 0)) {
+ for ok := true; ok; ok = (((xBusy != 0) && (rc == 5)) && ((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&xBusy)))(tls, pBusyArg) != 0)) {
rc = walLockExclusive(tls, pWal, lockIdx, n)
}
return rc
@@ -35517,7 +36648,7 @@ func walBusyLock(tls *crt.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lo
// The cache of the wal-index header must be valid to call this function.
// Return the page-size in bytes used by the database.
-func walPagesize(tls *crt.TLS, pWal uintptr) int32 { /* sqlite3.c:61132:12: */
+func walPagesize(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:61268:12: */
return ((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) & 0xfe00) + ((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) & 0x0001) << 16))
}
@@ -35536,7 +36667,7 @@ func walPagesize(tls *crt.TLS, pWal uintptr) int32 { /* sqlite3.c:61132:12: */
// The value of parameter salt1 is used as the aSalt[1] value in the
// new wal-index header. It should be passed a pseudo-random value (i.e.
// one obtained from sqlite3_randomness()).
-func walRestartHdr(tls *crt.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:61153:13: */
+func walRestartHdr(tls *libc.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:61289:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
*(*U32)(unsafe.Pointer(bp)) = salt1
@@ -35547,7 +36678,7 @@ func walRestartHdr(tls *crt.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:61153:1
(*Wal)(unsafe.Pointer(pWal)).FnCkpt++
(*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame = U32(0)
Xsqlite3Put4byte(tls, (aSalt + uintptr(0)*4), (U32(1) + Xsqlite3Get4byte(tls, (aSalt+uintptr(0)*4))))
- crt.Xmemcpy(tls, ((pWal + 72 /* &.hdr */ + 32 /* &.aSalt */) + uintptr(1)*4), bp /* &salt1 */, uint64(4))
+ libc.Xmemcpy(tls, ((pWal + 72 /* &.hdr */ + 32 /* &.aSalt */) + uintptr(1)*4), bp /* &salt1 */, uint64(4))
walIndexWriteHdr(tls, pWal)
*(*U32)(unsafe.Pointer((pInfo /* &.nBackfill */))) = U32(0)
(*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = U32(0)
@@ -35587,7 +36718,7 @@ func walRestartHdr(tls *crt.TLS, pWal uintptr, salt1 U32) { /* sqlite3.c:61153:1
// The caller must be holding sufficient locks to ensure that no other
// checkpoint is running (in any other thread or process) at the same
// time.
-func walCheckpoint(tls *crt.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) int32 { /* sqlite3.c:61200:12: */
+func walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) int32 { /* sqlite3.c:61336:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -35689,7 +36820,7 @@ __10:
;
if !((*(*uintptr)(unsafe.Pointer(bp /* pIter */)) != 0) &&
- ((crt.AssignInt32(&rc, walBusyLock(tls, pWal, xBusy, pBusyArg, (3+(0)), 1))) == 0)) {
+ ((libc.AssignInt32(&rc, walBusyLock(tls, pWal, xBusy, pBusyArg, (3+(0)), 1))) == 0)) {
goto __11
}
nBackfill = (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill
@@ -35710,83 +36841,95 @@ __10:
if !((rc == 0) && (*(*I64)(unsafe.Pointer(bp + 8 /* nSize */)) < *(*I64)(unsafe.Pointer(bp + 16 /* nReq */)))) {
goto __13
}
+ if !(((*(*I64)(unsafe.Pointer(bp + 8 /* nSize */)) + int64(65536)) + (I64((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame) * I64(szPage))) < *(*I64)(unsafe.Pointer(bp + 16 /* nReq */))) {
+ goto __14
+ }
+ // If the size of the final database is larger than the current
+ // database plus the amount of data in the wal file, plus the
+ // maximum size of the pending-byte page (65536 bytes), then
+ // must be corruption somewhere.
+ rc = Xsqlite3CorruptError(tls, 61420)
+ goto __15
+__14:
Xsqlite3OsFileControlHint(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 5, bp+16 /* &nReq */)
+__15:
+ ;
__13:
;
__12:
;
// Iterate through the contents of the WAL, copying data to the db file
-__14:
+__16:
if !((rc == 0) && (0 == walIteratorNext(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter */)), bp+24 /* &iDbpage */, bp+28 /* &iFrame */))) {
- goto __15
+ goto __17
}
- if !(*(*int32)(unsafe.Pointer((db + 368 /* &.u1 */ /* &.isInterrupted */))) != 0) {
- goto __16
+ if !(*(*int32)(unsafe.Pointer((db + 392 /* &.u1 */ /* &.isInterrupted */))) != 0) {
+ goto __18
}
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
rc = 7
} else {
rc = 9
}
- goto __15
-__16:
+ goto __17
+__18:
;
if !(((*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */)) <= nBackfill) || (*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */)) > mxSafeFrame)) || (*(*U32)(unsafe.Pointer(bp + 24 /* iDbpage */)) > mxPage)) {
- goto __17
+ goto __19
}
- goto __14
-__17:
+ goto __16
+__19:
;
iOffset = ((int64(32) + ((I64((*(*U32)(unsafe.Pointer(bp + 28 /* iFrame */))) - U32(1))) * (I64((szPage) + 24)))) + int64(24))
// testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL file
rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, zBuf, szPage, iOffset)
if !(rc != 0) {
- goto __18
+ goto __20
}
- goto __15
-__18:
+ goto __17
+__20:
;
iOffset = ((I64(*(*U32)(unsafe.Pointer(bp + 24 /* iDbpage */)) - U32(1))) * I64(szPage))
rc = Xsqlite3OsWrite(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, zBuf, szPage, iOffset)
if !(rc != 0) {
- goto __19
+ goto __21
}
- goto __15
-__19:
+ goto __17
+__21:
;
- goto __14
-__15:
+ goto __16
+__17:
;
Xsqlite3OsFileControl(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 37, uintptr(0))
// If work was actually accomplished...
if !(rc == 0) {
- goto __20
+ goto __22
}
if !(mxSafeFrame == (*WalIndexHdr)(unsafe.Pointer(walIndexHdr(tls, pWal))).FmxFrame) {
- goto __21
+ goto __23
}
szDb = (I64((*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage) * I64(szPage))
rc = Xsqlite3OsTruncate(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, szDb)
if !(rc == 0) {
- goto __22
+ goto __24
}
rc = Xsqlite3OsSync(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, (((sync_flags) >> 2) & 0x03))
-__22:
+__24:
;
-__21:
+__23:
;
if !(rc == 0) {
- goto __23
+ goto __25
}
*(*U32)(unsafe.Pointer((pInfo /* &.nBackfill */))) = mxSafeFrame
-__23:
+__25:
;
-__20:
+__22:
;
// Release the reader lock held while backfilling
@@ -35795,12 +36938,12 @@ __11:
;
if !(rc == 5) {
- goto __24
+ goto __26
}
// Reset the return code so as not to report a checkpoint failure
// just because there are active readers.
rc = 0
-__24:
+__26:
;
__1:
;
@@ -35810,26 +36953,26 @@ __1:
// until all readers have finished using the wal file. This ensures that
// the next process to write to the database restarts the wal file.
if !((rc == 0) && (eMode != 0)) {
- goto __25
+ goto __27
}
if !((*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill < (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame) {
- goto __26
+ goto __28
}
rc = 5
- goto __27
-__26:
+ goto __29
+__28:
if !(eMode >= 2) {
- goto __28
+ goto __30
}
Xsqlite3_randomness(tls, 4, bp+32 /* &salt1 */)
rc = walBusyLock(tls, pWal, xBusy, pBusyArg, (3 + (1)), ((8 - 3) - 1))
if !(rc == 0) {
- goto __29
+ goto __31
}
if !(eMode == 3) {
- goto __30
+ goto __32
}
// IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as
// SQLITE_CHECKPOINT_RESTART with the addition that it also
@@ -35846,16 +36989,16 @@ __26:
// indicate that the log file contains zero valid frames.
walRestartHdr(tls, pWal, *(*U32)(unsafe.Pointer(bp + 32 /* salt1 */)))
rc = Xsqlite3OsTruncate(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, int64(0))
-__30:
+__32:
;
walUnlockExclusive(tls, pWal, (3 + (1)), ((8 - 3) - 1))
-__29:
+__31:
;
-__28:
+__30:
;
-__27:
+__29:
;
-__25:
+__27:
;
walcheckpoint_out:
@@ -35865,7 +37008,7 @@ walcheckpoint_out:
// If the WAL file is currently larger than nMax bytes in size, truncate
// it to exactly nMax bytes. If an error occurs while doing so, ignore it.
-func walLimitSize(tls *crt.TLS, pWal uintptr, nMax I64) { /* sqlite3.c:61378:13: */
+func walLimitSize(tls *libc.TLS, pWal uintptr, nMax I64) { /* sqlite3.c:61522:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -35879,12 +37022,12 @@ func walLimitSize(tls *crt.TLS, pWal uintptr, nMax I64) { /* sqlite3.c:61378:13:
}
Xsqlite3EndBenignMalloc(tls)
if rx != 0 {
- Xsqlite3_log(tls, rx, ts+3506 /* "cannot limit WAL..." */, crt.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).FzWalName))
+ Xsqlite3_log(tls, rx, ts+5641 /* "cannot limit WAL..." */, libc.VaList(bp, (*Wal)(unsafe.Pointer(pWal)).FzWalName))
}
}
// Close a connection to a log file.
-func Xsqlite3WalClose(tls *crt.TLS, pWal uintptr, db uintptr, sync_flags int32, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:61395:20: */
+func Xsqlite3WalClose(tls *libc.TLS, pWal uintptr, db uintptr, sync_flags int32, nBuf int32, zBuf uintptr) int32 { /* sqlite3.c:61539:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -35900,7 +37043,7 @@ func Xsqlite3WalClose(tls *crt.TLS, pWal uintptr, db uintptr, sync_flags int32,
//
// The EXCLUSIVE lock is not released before returning.
if (zBuf != uintptr(0)) &&
- (0 == (crt.AssignInt32(&rc, Xsqlite3OsLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 4)))) {
+ (0 == (libc.AssignInt32(&rc, Xsqlite3OsLock(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, 4)))) {
if int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == 0 {
(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(1)
}
@@ -35956,7 +37099,7 @@ func Xsqlite3WalClose(tls *crt.TLS, pWal uintptr, db uintptr, sync_flags int32,
//
// If the checksum cannot be verified return non-zero. If the header
// is read successfully and the checksum verified, return zero.
-func walIndexTryHdr(tls *crt.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:61476:27: */
+func walIndexTryHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:61620:27: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -35986,11 +37129,11 @@ func walIndexTryHdr(tls *crt.TLS, pWal uintptr, pChanged uintptr) int32 { /* sql
// shared among multiple processes and not all mutex implementions work
// reliably in that environment.
aHdr = walIndexHdr(tls, pWal)
- crt.Xmemcpy(tls, bp /* &h1 */, (aHdr + uintptr(0)*48), uint64(unsafe.Sizeof(WalIndexHdr{}))) // Possible TSAN false-positive
+ libc.Xmemcpy(tls, bp /* &h1 */, (aHdr + uintptr(0)*48), uint64(unsafe.Sizeof(WalIndexHdr{}))) // Possible TSAN false-positive
walShmBarrier(tls, pWal)
- crt.Xmemcpy(tls, bp+48 /* &h2 */, (aHdr + uintptr(1)*48), uint64(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, bp+48 /* &h2 */, (aHdr + uintptr(1)*48), uint64(unsafe.Sizeof(WalIndexHdr{})))
- if (crt.Xmemcmp(tls, bp /* &h1 */, bp+48 /* &h2 */, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
+ if (libc.Xmemcmp(tls, bp /* &h1 */, bp+48 /* &h2 */, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
return 1
}
if int32((*WalIndexHdr)(unsafe.Pointer(bp /* &h1 */)).FisInit) == 0 {
@@ -36001,9 +37144,9 @@ func walIndexTryHdr(tls *crt.TLS, pWal uintptr, pChanged uintptr) int32 { /* sql
return 1
}
- if crt.Xmemcmp(tls, (pWal+72 /* &.hdr */), bp /* &h1 */, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
+ if libc.Xmemcmp(tls, (pWal+72 /* &.hdr */), bp /* &h1 */, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
*(*int32)(unsafe.Pointer(pChanged)) = 1
- crt.Xmemcpy(tls, (pWal + 72 /* &.hdr */), bp /* &h1 */, uint64(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, (pWal + 72 /* &.hdr */), bp /* &h1 */, uint64(unsafe.Sizeof(WalIndexHdr{})))
(*Wal)(unsafe.Pointer(pWal)).FszPage = (U32((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) & 0xfe00) + ((int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage) & 0x0001) << 16)))
}
@@ -36025,7 +37168,7 @@ func walIndexTryHdr(tls *crt.TLS, pWal uintptr, pChanged uintptr) int32 { /* sql
//
// If the wal-index header is successfully read, return SQLITE_OK.
// Otherwise an SQLite error code.
-func walIndexReadHdr(tls *crt.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:61546:12: */
+func walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:61690:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -36074,15 +37217,15 @@ func walIndexReadHdr(tls *crt.TLS, pWal uintptr, pChanged uintptr) int32 { /* sq
// with a writer. So get a WRITE lock and try again.
if badHdr != 0 {
if (int32((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0) && ((int32((*Wal)(unsafe.Pointer(pWal)).FreadOnly) & 2) != 0) {
- if 0 == (crt.AssignInt32(&rc, walLockShared(tls, pWal, 0))) {
+ if 0 == (libc.AssignInt32(&rc, walLockShared(tls, pWal, 0))) {
walUnlockShared(tls, pWal, 0)
rc = (8 | (int32(1) << 8))
}
} else {
var bWriteLock int32 = int32((*Wal)(unsafe.Pointer(pWal)).FwriteLock)
- if (bWriteLock != 0) || (0 == (crt.AssignInt32(&rc, walLockExclusive(tls, pWal, 0, 1)))) {
+ if (bWriteLock != 0) || (0 == (libc.AssignInt32(&rc, walLockExclusive(tls, pWal, 0, 1)))) {
(*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(1)
- if 0 == (crt.AssignInt32(&rc, walIndexPage(tls, pWal, 0, bp /* &page0 */))) {
+ if 0 == (libc.AssignInt32(&rc, walIndexPage(tls, pWal, 0, bp /* &page0 */))) {
badHdr = walIndexTryHdr(tls, pWal, pChanged)
if badHdr != 0 {
// If the wal-index header is still malformed even while holding
@@ -36104,7 +37247,7 @@ func walIndexReadHdr(tls *crt.TLS, pWal uintptr, pChanged uintptr) int32 { /* sq
// sure the wal-index was not constructed with some future format that
// this version of SQLite cannot understand.
if (badHdr == 0) && ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != U32(3007000)) {
- rc = Xsqlite3CantopenError(tls, 61625)
+ rc = Xsqlite3CantopenError(tls, 61769)
}
if (*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 {
if rc != 0 {
@@ -36149,7 +37292,7 @@ func walIndexReadHdr(tls *crt.TLS, pWal uintptr, pChanged uintptr) int32 { /* sq
// beginning (including attempting to map the *-shm file).
//
// If an error occurs, an SQLite error code is returned.
-func walBeginShmUnreliable(tls *crt.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:61670:12: */
+func walBeginShmUnreliable(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:61814:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -36230,7 +37373,7 @@ __3:
// We reach this point only if the real shared-memory is still unreliable.
// Assume the in-memory WAL-index substitute is correct and load it
// into pWal->hdr.
- crt.Xmemcpy(tls, (pWal + 72 /* &.hdr */), walIndexHdr(tls, pWal), uint64(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, (pWal + 72 /* &.hdr */), walIndexHdr(tls, pWal), uint64(unsafe.Sizeof(WalIndexHdr{})))
// Make sure some writer hasn't come in and changed the WAL file out
// from under us, then disconnected, while we were not looking.
@@ -36269,7 +37412,7 @@ __5:
goto begin_unreliable_shm_out
__6:
;
- if !(crt.Xmemcmp(tls, (pWal+72 /* &.hdr */ +32 /* &.aSalt */), (bp+16 /* &aBuf */ +uintptr(16)), uint64(8)) != 0) {
+ if !(libc.Xmemcmp(tls, (pWal+72 /* &.hdr */ +32 /* &.aSalt */), (bp+16 /* &aBuf */ +uintptr(16)), uint64(8)) != 0) {
goto __7
}
// Some writer has wrapped the WAL file while we were not looking.
@@ -36414,7 +37557,7 @@ __15:
// update values of the aReadMark[] array in the header, but if it does
// so it takes care to hold an exclusive lock on the corresponding
// WAL_READ_LOCK() while changing values.
-func walTryBeginRead(tls *crt.TLS, pWal uintptr, pChanged uintptr, useWal int32, cnt int32) int32 { /* sqlite3.c:61865:12: */
+func walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int32, cnt int32) int32 { /* sqlite3.c:62009:12: */
var pInfo uintptr // Checkpoint information in wal-index
var mxReadMark U32 // Largest aReadMark[] value
var mxI int32 // Index of largest aReadMark[] value
@@ -36475,7 +37618,7 @@ func walTryBeginRead(tls *crt.TLS, pWal uintptr, pChanged uintptr, useWal int32,
// code that determines whether or not the shared-memory region
// must be zeroed before the requested page is returned.
rc = -1
- } else if 0 == (crt.AssignInt32(&rc, walLockShared(tls, pWal, 2))) {
+ } else if 0 == (libc.AssignInt32(&rc, walLockShared(tls, pWal, 2))) {
walUnlockShared(tls, pWal, 2)
rc = -1
} else if rc == 5 {
@@ -36490,13 +37633,14 @@ func walTryBeginRead(tls *crt.TLS, pWal uintptr, pChanged uintptr, useWal int32,
}
pInfo = walCkptInfo(tls, pWal)
- if !(useWal != 0) && ((*(*U32)(unsafe.Pointer((pInfo /* &.nBackfill */)))) == (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame) {
+ if (!(useWal != 0) && ((*(*U32)(unsafe.Pointer((pInfo /* &.nBackfill */)))) == (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame)) &&
+ (((*Wal)(unsafe.Pointer(pWal)).FpSnapshot == uintptr(0)) || ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame == U32(0))) {
// The WAL has been completely backfilled (or it is empty).
// and can be safely ignored.
rc = walLockShared(tls, pWal, (3 + (0)))
walShmBarrier(tls, pWal)
if rc == 0 {
- if crt.Xmemcmp(tls, walIndexHdr(tls, pWal), (pWal+72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
+ if libc.Xmemcmp(tls, walIndexHdr(tls, pWal), (pWal+72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0 {
// It is not safe to allow the reader to continue here if frames
// may have been appended to the log before READ_LOCK(0) was obtained.
// When holding READ_LOCK(0), the reader ignores the entire log file,
@@ -36526,6 +37670,9 @@ func walTryBeginRead(tls *crt.TLS, pWal uintptr, pChanged uintptr, useWal int32,
mxReadMark = U32(0)
mxI = 0
mxFrame = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
+ if ((*Wal)(unsafe.Pointer(pWal)).FpSnapshot != 0) && ((*WalIndexHdr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FpSnapshot)).FmxFrame < mxFrame) {
+ mxFrame = (*WalIndexHdr)(unsafe.Pointer((*Wal)(unsafe.Pointer(pWal)).FpSnapshot)).FmxFrame
+ }
for i = 1; i < (8 - 3); i++ {
var thisMark U32 = *(*U32)(unsafe.Pointer(((pInfo + 4 /* &.aReadMark */) + uintptr(i)*4)))
if (mxReadMark <= thisMark) && (thisMark <= mxFrame) {
@@ -36600,7 +37747,7 @@ func walTryBeginRead(tls *crt.TLS, pWal uintptr, pChanged uintptr, useWal int32,
(*Wal)(unsafe.Pointer(pWal)).FminFrame = ((*(*U32)(unsafe.Pointer((pInfo /* &.nBackfill */)))) + U32(1))
walShmBarrier(tls, pWal)
if ((*(*U32)(unsafe.Pointer(((pInfo + 4 /* &.aReadMark */) + uintptr(mxI)*4)))) != mxReadMark) ||
- (crt.Xmemcmp(tls, walIndexHdr(tls, pWal), (pWal+72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
+ (libc.Xmemcmp(tls, walIndexHdr(tls, pWal), (pWal+72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
walUnlockShared(tls, pWal, (3 + (mxI)))
return -1
} else {
@@ -36610,6 +37757,84 @@ func walTryBeginRead(tls *crt.TLS, pWal uintptr, pChanged uintptr, useWal int32,
return rc
}
+// Attempt to reduce the value of the WalCkptInfo.nBackfillAttempted
+// variable so that older snapshots can be accessed. To do this, loop
+// through all wal frames from nBackfillAttempted to (nBackfill+1),
+// comparing their content to the corresponding page with the database
+// file, if any. Set nBackfillAttempted to the frame number of the
+// first frame for which the wal file content matches the db file.
+//
+// This is only really safe if the file-system is such that any page
+// writes made by earlier checkpointers were atomic operations, which
+// is not always true. It is also possible that nBackfillAttempted
+// may be left set to a value larger than expected, if a wal frame
+// contains content that duplicate of an earlier version of the same
+// page.
+//
+// SQLITE_OK is returned if successful, or an SQLite error code if an
+// error occurs. It is not an error if nBackfillAttempted cannot be
+// decreased at all.
+func Xsqlite3WalSnapshotRecover(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62239:20: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ var rc int32
+
+ rc = walLockExclusive(tls, pWal, 1, 1)
+ if rc == 0 {
+ var pInfo uintptr = walCkptInfo(tls, pWal)
+ var szPage int32 = int32((*Wal)(unsafe.Pointer(pWal)).FszPage)
+ // var szDb I64 at bp, 8
+ // Size of db file in bytes
+
+ rc = Xsqlite3OsFileSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, bp /* &szDb */)
+ if rc == 0 {
+ var pBuf1 uintptr = Xsqlite3_malloc(tls, szPage)
+ var pBuf2 uintptr = Xsqlite3_malloc(tls, szPage)
+ if (pBuf1 == uintptr(0)) || (pBuf2 == uintptr(0)) {
+ rc = 7
+ } else {
+ var i U32 = (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted
+ for i = (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted; i > (*(*U32)(unsafe.Pointer((pInfo /* &.nBackfill */)))); i-- {
+ // var sLoc WalHashLoc at bp+8, 24
+ // Hash table location
+ var pgno U32 // Page number in db file
+ var iDbOff I64 // Offset of db file entry
+ var iWalOff I64 // Offset of wal file entry
+
+ rc = walHashGet(tls, pWal, walFramePage(tls, i), bp+8 /* &sLoc */)
+ if rc != 0 {
+ break
+ }
+ pgno = *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp+8 /* &sLoc */)).FaPgno + uintptr((i-(*WalHashLoc)(unsafe.Pointer(bp+8 /* &sLoc */)).FiZero))*4))
+ iDbOff = ((I64(pgno - U32(1))) * I64(szPage))
+
+ if (iDbOff + I64(szPage)) <= *(*I64)(unsafe.Pointer(bp /* szDb */)) {
+ iWalOff = ((int64(32) + ((I64((i) - U32(1))) * (I64((szPage) + 24)))) + int64(24))
+ rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pBuf1, szPage, iWalOff)
+
+ if rc == 0 {
+ rc = Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpDbFd, pBuf2, szPage, iDbOff)
+ }
+
+ if (rc != 0) || (0 == libc.Xmemcmp(tls, pBuf1, pBuf2, uint64(szPage))) {
+ break
+ }
+ }
+
+ (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted = (i - U32(1))
+ }
+ }
+
+ Xsqlite3_free(tls, pBuf1)
+ Xsqlite3_free(tls, pBuf2)
+ }
+ walUnlockExclusive(tls, pWal, 1, 1)
+ }
+
+ return rc
+}
+
// Begin a read transaction on the database.
//
// This routine used to be called sqlite3OpenSnapshot() and with good reason:
@@ -36622,20 +37847,95 @@ func walTryBeginRead(tls *crt.TLS, pWal uintptr, pChanged uintptr, useWal int32,
// transaction, then *pChanged is set to 1 before returning. The
// Pager layer will use this to know that its cache is stale and
// needs to be flushed.
-func Xsqlite3WalBeginReadTransaction(tls *crt.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62165:20: */
+func Xsqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintptr) int32 { /* sqlite3.c:62309:20: */
var rc int32 // Return code
var cnt int32 = 0 // Number of TryBeginRead attempts
+ var bChanged int32 = 0
+ var pSnapshot uintptr = (*Wal)(unsafe.Pointer(pWal)).FpSnapshot
+
+ if pSnapshot != 0 {
+ if (libc.Xmemcmp(tls, pSnapshot, (pWal+72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
+ bChanged = 1
+ }
+
+ // It is possible that there is a checkpointer thread running
+ // concurrent with this code. If this is the case, it may be that the
+ // checkpointer has already determined that it will checkpoint
+ // snapshot X, where X is later in the wal file than pSnapshot, but
+ // has not yet set the pInfo->nBackfillAttempted variable to indicate
+ // its intent. To avoid the race condition this leads to, ensure that
+ // there is no checkpointer process by taking a shared CKPT lock
+ // before checking pInfo->nBackfillAttempted.
+
+ rc = walLockShared(tls, pWal, 1)
+
+ if rc != 0 {
+ return rc
+ }
+ (*Wal)(unsafe.Pointer(pWal)).FckptLock = U8(1)
+ }
for ok := true; ok; ok = (rc == (-1)) {
- rc = walTryBeginRead(tls, pWal, pChanged, 0, crt.PreIncInt32(&cnt, 1))
+ rc = walTryBeginRead(tls, pWal, pChanged, 0, libc.PreIncInt32(&cnt, 1))
}
+ if rc == 0 {
+ if (pSnapshot != 0) && (libc.Xmemcmp(tls, pSnapshot, (pWal+72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
+ // At this point the client has a lock on an aReadMark[] slot holding
+ // a value equal to or smaller than pSnapshot->mxFrame, but pWal->hdr
+ // is populated with the wal-index header corresponding to the head
+ // of the wal file. Verify that pSnapshot is still valid before
+ // continuing. Reasons why pSnapshot might no longer be valid:
+ //
+ // (1) The WAL file has been reset since the snapshot was taken.
+ // In this case, the salt will have changed.
+ //
+ // (2) A checkpoint as been attempted that wrote frames past
+ // pSnapshot->mxFrame into the database file. Note that the
+ // checkpoint need not have completed for this to cause problems.
+ var pInfo uintptr = walCkptInfo(tls, pWal)
+
+ // Check that the wal file has not been wrapped. Assuming that it has
+ // not, also check that no checkpointer has attempted to checkpoint any
+ // frames beyond pSnapshot->mxFrame. If either of these conditions are
+ // true, return SQLITE_ERROR_SNAPSHOT. Otherwise, overwrite pWal->hdr
+ // with *pSnapshot and set *pChanged as appropriate for opening the
+ // snapshot.
+ if !(libc.Xmemcmp(tls, pSnapshot+32 /* &.aSalt */, pWal+72 /* &.hdr */ +32 /* &.aSalt */, uint64(unsafe.Sizeof([2]U32{}))) != 0) &&
+ ((*WalIndexHdr)(unsafe.Pointer(pSnapshot)).FmxFrame >= (*WalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfillAttempted) {
+
+ libc.Xmemcpy(tls, (pWal + 72 /* &.hdr */), pSnapshot, uint64(unsafe.Sizeof(WalIndexHdr{})))
+ *(*int32)(unsafe.Pointer(pChanged)) = bChanged
+ } else {
+ rc = (1 | (int32(3) << 8))
+ }
+
+ // A client using a non-current snapshot may not ignore any frames
+ // from the start of the wal file. This is because, for a system
+ // where (minFrame < iSnapshot < maxFrame), a checkpointer may
+ // have omitted to checkpoint a frame earlier than minFrame in
+ // the file because there exists a frame after iSnapshot that
+ // is the same database page.
+ (*Wal)(unsafe.Pointer(pWal)).FminFrame = U32(1)
+
+ if rc != 0 {
+ Xsqlite3WalEndReadTransaction(tls, pWal)
+ }
+ }
+ }
+
+ // Release the shared CKPT lock obtained above.
+ if (*Wal)(unsafe.Pointer(pWal)).FckptLock != 0 {
+
+ walUnlockShared(tls, pWal, 1)
+ (*Wal)(unsafe.Pointer(pWal)).FckptLock = U8(0)
+ }
return rc
}
// Finish with a read transaction. All this does is release the
// read-lock.
-func Xsqlite3WalEndReadTransaction(tls *crt.TLS, pWal uintptr) { /* sqlite3.c:62273:21: */
+func Xsqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:62417:21: */
Xsqlite3WalEndWriteTransaction(tls, pWal)
if int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) >= 0 {
walUnlockShared(tls, pWal, (3 + (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock))))
@@ -36649,7 +37949,7 @@ func Xsqlite3WalEndReadTransaction(tls *crt.TLS, pWal uintptr) { /* sqlite3.c:62
//
// Return SQLITE_OK if successful, or an error code if an error occurs. If an
// error does occur, the final value of *piRead is undefined.
-func Xsqlite3WalFindFrame(tls *crt.TLS, pWal uintptr, pgno Pgno, piRead uintptr) int32 { /* sqlite3.c:62289:20: */
+func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr) int32 { /* sqlite3.c:62433:20: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -36709,14 +38009,14 @@ func Xsqlite3WalFindFrame(tls *crt.TLS, pWal uintptr, pgno Pgno, piRead uintptr)
}
nCollide = (4096 * 2)
iKey = walHash(tls, pgno)
- for (crt.AssignUint32(&iH, U32(*(*Ht_slot)(unsafe.Pointer(((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + uintptr(iKey)*2)))))) != U32(0) {
+ for (libc.AssignUint32(&iH, U32(*(*Ht_slot)(unsafe.Pointer(((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaHash + uintptr(iKey)*2)))))) != U32(0) {
var iFrame U32 = (iH + (*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FiZero)
if ((iFrame <= iLast) && (iFrame >= (*Wal)(unsafe.Pointer(pWal)).FminFrame)) && (*(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp /* &sLoc */)).FaPgno + uintptr(iH)*4)) == pgno) {
iRead = iFrame
}
- if (crt.PostDecInt32(&nCollide, 1)) == 0 {
- return Xsqlite3CorruptError(tls, 62359)
+ if (libc.PostDecInt32(&nCollide, 1)) == 0 {
+ return Xsqlite3CorruptError(tls, 62503)
}
iKey = walNextHash(tls, iKey)
}
@@ -36732,7 +38032,7 @@ func Xsqlite3WalFindFrame(tls *crt.TLS, pWal uintptr, pgno Pgno, piRead uintptr)
// Read the contents of frame iRead from the wal file into buffer pOut
// (which is nOut bytes in size). Return SQLITE_OK if successful, or an
// error code otherwise.
-func Xsqlite3WalReadFrame(tls *crt.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 { /* sqlite3.c:62393:20: */
+func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 { /* sqlite3.c:62537:20: */
var sz int32
var iOffset I64
sz = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)
@@ -36749,7 +38049,7 @@ func Xsqlite3WalReadFrame(tls *crt.TLS, pWal uintptr, iRead U32, nOut int32, pOu
}
// Return the size of the database in pages (or zero, if unknown).
-func Xsqlite3WalDbsize(tls *crt.TLS, pWal uintptr) Pgno { /* sqlite3.c:62413:21: */
+func Xsqlite3WalDbsize(tls *libc.TLS, pWal uintptr) Pgno { /* sqlite3.c:62557:21: */
if (pWal != 0) && (int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) >= 0) {
return (*Wal)(unsafe.Pointer(pWal)).Fhdr.FnPage
}
@@ -36767,7 +38067,7 @@ func Xsqlite3WalDbsize(tls *crt.TLS, pWal uintptr) Pgno { /* sqlite3.c:62413:21:
// returns SQLITE_BUSY in that case and no write transaction is started.
//
// There can only be a single writer active at a time.
-func Xsqlite3WalBeginWriteTransaction(tls *crt.TLS, pWal uintptr) int32 { /* sqlite3.c:62434:20: */
+func Xsqlite3WalBeginWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62578:20: */
var rc int32
// Cannot start a write transaction without first holding a read
@@ -36788,7 +38088,7 @@ func Xsqlite3WalBeginWriteTransaction(tls *crt.TLS, pWal uintptr) int32 { /* sql
// If another connection has written to the database file since the
// time the read transaction on this connection was started, then
// the write is disallowed.
- if (crt.Xmemcmp(tls, (pWal+72 /* &.hdr */), walIndexHdr(tls, pWal), uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
+ if (libc.Xmemcmp(tls, (pWal+72 /* &.hdr */), walIndexHdr(tls, pWal), uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
walUnlockExclusive(tls, pWal, 0, 1)
(*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(0)
rc = (5 | (int32(2) << 8))
@@ -36799,7 +38099,7 @@ func Xsqlite3WalBeginWriteTransaction(tls *crt.TLS, pWal uintptr) int32 { /* sql
// End a write transaction. The commit has already been done. This
// routine merely releases the lock.
-func Xsqlite3WalEndWriteTransaction(tls *crt.TLS, pWal uintptr) int32 { /* sqlite3.c:62482:20: */
+func Xsqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62626:20: */
if (*Wal)(unsafe.Pointer(pWal)).FwriteLock != 0 {
walUnlockExclusive(tls, pWal, 0, 1)
(*Wal)(unsafe.Pointer(pWal)).FwriteLock = U8(0)
@@ -36819,7 +38119,7 @@ func Xsqlite3WalEndWriteTransaction(tls *crt.TLS, pWal uintptr) int32 { /* sqlit
//
// Otherwise, if the callback function does not return an error, this
// function returns SQLITE_OK.
-func Xsqlite3WalUndo(tls *crt.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) int32 { /* sqlite3.c:62504:20: */
+func Xsqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) int32 { /* sqlite3.c:62648:20: */
var rc int32 = 0
if (*Wal)(unsafe.Pointer(pWal)).FwriteLock != 0 {
var iMax Pgno = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
@@ -36827,7 +38127,7 @@ func Xsqlite3WalUndo(tls *crt.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr
// Restore the clients cache of the wal-index header to the state it
// was in before the client began writing to the database.
- crt.Xmemcpy(tls, (pWal + 72 /* &.hdr */), walIndexHdr(tls, pWal), uint64(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemcpy(tls, (pWal + 72 /* &.hdr */), walIndexHdr(tls, pWal), uint64(unsafe.Sizeof(WalIndexHdr{})))
for iFrame = ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame + U32(1)); (rc == 0) && (iFrame <= iMax); iFrame++ {
// This call cannot fail. Unless the page for which the page number
@@ -36841,7 +38141,7 @@ func Xsqlite3WalUndo(tls *crt.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr
// page 1 is never written to the log until the transaction is
// committed. As a result, the call to xUndo may not fail.
- rc = (*(*func(*crt.TLS, uintptr, Pgno) int32)(unsafe.Pointer(&xUndo)))(tls, pUndoCtx, walFramePgno(tls, pWal, iFrame))
+ rc = (*(*func(*libc.TLS, uintptr, Pgno) int32)(unsafe.Pointer(&xUndo)))(tls, pUndoCtx, walFramePgno(tls, pWal, iFrame))
}
if iMax != (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame {
walCleanupHash(tls, pWal)
@@ -36854,7 +38154,7 @@ func Xsqlite3WalUndo(tls *crt.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr
// values. This function populates the array with values required to
// "rollback" the write position of the WAL handle back to the current
// point in the event of a savepoint rollback (via WalSavepointUndo()).
-func Xsqlite3WalSavepoint(tls *crt.TLS, pWal uintptr, aWalData uintptr) { /* sqlite3.c:62544:21: */
+func Xsqlite3WalSavepoint(tls *libc.TLS, pWal uintptr, aWalData uintptr) { /* sqlite3.c:62688:21: */
*(*U32)(unsafe.Pointer(aWalData + uintptr(0)*4)) = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
*(*U32)(unsafe.Pointer(aWalData + uintptr(1)*4)) = *(*U32)(unsafe.Pointer((pWal + 72 /* &.hdr */ + 24 /* &.aFrameCksum */) + uintptr(0)*4))
@@ -36866,7 +38166,7 @@ func Xsqlite3WalSavepoint(tls *crt.TLS, pWal uintptr, aWalData uintptr) { /* sql
// the values in the aWalData[] array. aWalData must point to an array
// of WAL_SAVEPOINT_NDATA u32 values that has been previously populated
// by a call to WalSavepoint().
-func Xsqlite3WalSavepointUndo(tls *crt.TLS, pWal uintptr, aWalData uintptr) int32 { /* sqlite3.c:62558:20: */
+func Xsqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) int32 { /* sqlite3.c:62702:20: */
var rc int32 = 0
if *(*U32)(unsafe.Pointer(aWalData + uintptr(3)*4)) != (*Wal)(unsafe.Pointer(pWal)).FnCkpt {
@@ -36897,7 +38197,7 @@ func Xsqlite3WalSavepointUndo(tls *crt.TLS, pWal uintptr, aWalData uintptr) int3
// SQLITE_OK is returned if no error is encountered (regardless of whether
// or not pWal->hdr.mxFrame is modified). An SQLite error code is returned
// if an error occurs.
-func walRestartLog(tls *crt.TLS, pWal uintptr) int32 { /* sqlite3.c:62595:12: */
+func walRestartLog(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:62739:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -36934,7 +38234,7 @@ func walRestartLog(tls *crt.TLS, pWal uintptr) int32 { /* sqlite3.c:62595:12: */
for ok := true; ok; ok = (rc == (-1)) {
// var notUsed int32 at bp+4, 4
- rc = walTryBeginRead(tls, pWal, bp+4 /* &notUsed */, 1, crt.PreIncInt32(&cnt, 1))
+ rc = walTryBeginRead(tls, pWal, bp+4 /* &notUsed */, 1, libc.PreIncInt32(&cnt, 1))
}
// BUSY not possible when useWal==1
@@ -36956,7 +38256,7 @@ type WalWriter1 = struct {
// Information about the current state of the WAL file and where
// the next fsync should occur - passed from sqlite3WalFrames() into
// walWriteToLog().
-type WalWriter = WalWriter1 /* sqlite3.c:62648:3 */
+type WalWriter = WalWriter1 /* sqlite3.c:62792:3 */
// Write iAmt bytes of content into the WAL file beginning at iOffset.
// Do a sync when crossing the p->iSyncPoint boundary.
@@ -36964,7 +38264,7 @@ type WalWriter = WalWriter1 /* sqlite3.c:62648:3 */
// In other words, if iSyncPoint is in between iOffset and iOffset+iAmt,
// first write the part before iSyncPoint, then sync, then write the
// rest.
-func walWriteToLog(tls *crt.TLS, p uintptr, pContent uintptr, iAmt int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:62658:12: */
+func walWriteToLog(tls *libc.TLS, p uintptr, pContent uintptr, iAmt int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:62802:12: */
var rc int32
if (iOffset < (*WalWriter)(unsafe.Pointer(p)).FiSyncPoint) && ((iOffset + Sqlite3_int64(iAmt)) >= (*WalWriter)(unsafe.Pointer(p)).FiSyncPoint) {
var iFirstAmt int32 = (int32((*WalWriter)(unsafe.Pointer(p)).FiSyncPoint - iOffset))
@@ -36986,7 +38286,7 @@ func walWriteToLog(tls *crt.TLS, p uintptr, pContent uintptr, iAmt int32, iOffse
}
// Write out a single frame of the WAL
-func walWriteOneFrame(tls *crt.TLS, p uintptr, pPage uintptr, nTruncate int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:62683:12: */
+func walWriteOneFrame(tls *libc.TLS, p uintptr, pPage uintptr, nTruncate int32, iOffset Sqlite3_int64) int32 { /* sqlite3.c:62827:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -37011,7 +38311,7 @@ func walWriteOneFrame(tls *crt.TLS, p uintptr, pPage uintptr, nTruncate int32, i
// with the earliest to have been overwritten.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
-func walRewriteChecksums(tls *crt.TLS, pWal uintptr, iLast U32) int32 { /* sqlite3.c:62709:12: */
+func walRewriteChecksums(tls *libc.TLS, pWal uintptr, iLast U32) int32 { /* sqlite3.c:62853:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -37065,7 +38365,7 @@ func walRewriteChecksums(tls *crt.TLS, pWal uintptr, iLast U32) int32 { /* sqlit
// Write a set of frames to the log. The caller must hold the write-lock
// on the log file (obtained using sqlite3WalBeginWriteTransaction()).
-func Xsqlite3WalFrames(tls *crt.TLS, pWal uintptr, szPage int32, pList uintptr, nTruncate Pgno, isCommit int32, sync_flags int32) int32 { /* sqlite3.c:62758:20: */
+func Xsqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTruncate Pgno, isCommit int32, sync_flags int32) int32 { /* sqlite3.c:62902:20: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -37085,13 +38385,13 @@ func Xsqlite3WalFrames(tls *crt.TLS, pWal uintptr, szPage int32, pList uintptr,
// nTruncate==0 then this frame set does not complete the transaction.
pLive = walIndexHdr(tls, pWal)
- if (crt.Xmemcmp(tls, (pWal+72 /* &.hdr */), pLive, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
+ if (libc.Xmemcmp(tls, (pWal+72 /* &.hdr */), pLive, uint64(unsafe.Sizeof(WalIndexHdr{}))) != 0) {
iFirst = ((*WalIndexHdr)(unsafe.Pointer(pLive)).FmxFrame + U32(1))
}
// See if it is possible to write these frames into the start of the
// log file, instead of appending to it at pWal->hdr.mxFrame.
- if 0 != (crt.AssignInt32(&rc, walRestartLog(tls, pWal))) {
+ if 0 != (libc.AssignInt32(&rc, walRestartLog(tls, pWal))) {
return rc
}
@@ -37112,7 +38412,7 @@ func Xsqlite3WalFrames(tls *crt.TLS, pWal uintptr, szPage int32, pList uintptr,
if (*Wal)(unsafe.Pointer(pWal)).FnCkpt == U32(0) {
Xsqlite3_randomness(tls, 8, pWal+72 /* &.hdr */ +32 /* &.aSalt */)
}
- crt.Xmemcpy(tls, (bp /* &aWalHdr */ + uintptr(16)), pWal+72 /* &.hdr */ +32 /* &.aSalt */, uint64(8))
+ libc.Xmemcpy(tls, (bp /* &aWalHdr */ + uintptr(16)), pWal+72 /* &.hdr */ +32 /* &.aSalt */, uint64(8))
walChecksumBytes(tls, 1, bp /* &aWalHdr[0] */, (32 - (2 * 4)), uintptr(0), bp+32 /* &aCksum[0] */)
Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + uintptr(24)), *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + uintptr(0)*4)))
Xsqlite3Put4byte(tls, (bp /* &aWalHdr */ + uintptr(28)), *(*U32)(unsafe.Pointer(bp + 32 /* &aCksum[0] */ + uintptr(1)*4)))
@@ -37175,7 +38475,7 @@ func Xsqlite3WalFrames(tls *crt.TLS, pWal uintptr, szPage int32, pList uintptr,
if rc != 0 {
return rc
}
- *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x040))))
+ *(*U16)(unsafe.Pointer(p + 52 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x040))))
continue
}
}
@@ -37222,7 +38522,7 @@ func Xsqlite3WalFrames(tls *crt.TLS, pWal uintptr, szPage int32, pList uintptr,
if (*Wal)(unsafe.Pointer(pWal)).FpadToSectorBoundary != 0 {
var sectorSize int32 = Xsqlite3SectorSize(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd)
(*WalWriter)(unsafe.Pointer(bp + 48 /* &w */)).FiSyncPoint = ((((iOffset + I64(sectorSize)) - int64(1)) / I64(sectorSize)) * I64(sectorSize))
- bSync = (crt.Bool32((*WalWriter)(unsafe.Pointer(bp+48 /* &w */)).FiSyncPoint == iOffset))
+ bSync = (libc.Bool32((*WalWriter)(unsafe.Pointer(bp+48 /* &w */)).FiSyncPoint == iOffset))
for iOffset < (*WalWriter)(unsafe.Pointer(bp+48 /* &w */)).FiSyncPoint {
rc = walWriteOneFrame(tls, bp+48 /* &w */, pLast, int32(nTruncate), iOffset)
@@ -37297,7 +38597,7 @@ func Xsqlite3WalFrames(tls *crt.TLS, pWal uintptr, szPage int32, pList uintptr,
//
// If parameter xBusy is not NULL, it is a pointer to a busy-handler
// callback. In this case this function runs a blocking checkpoint.
-func Xsqlite3WalCheckpoint(tls *crt.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:62996:20: */
+func Xsqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:63140:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -37362,7 +38662,7 @@ func Xsqlite3WalCheckpoint(tls *crt.TLS, pWal uintptr, db uintptr, eMode int32,
if rc == 0 {
if ((*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0) && (walPagesize(tls, pWal) != nBuf) {
- rc = Xsqlite3CorruptError(tls, 63078)
+ rc = Xsqlite3CorruptError(tls, 63222)
} else {
rc = walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf)
}
@@ -37384,7 +38684,7 @@ func Xsqlite3WalCheckpoint(tls *crt.TLS, pWal uintptr, db uintptr, eMode int32,
// out of date. So zero the cached wal-index header to ensure that
// next time the pager opens a snapshot on this database it knows that
// the cache needs to be reset.
- crt.Xmemset(tls, (pWal + 72 /* &.hdr */), 0, uint64(unsafe.Sizeof(WalIndexHdr{})))
+ libc.Xmemset(tls, (pWal + 72 /* &.hdr */), 0, uint64(unsafe.Sizeof(WalIndexHdr{})))
}
// Release the locks.
@@ -37406,7 +38706,7 @@ func Xsqlite3WalCheckpoint(tls *crt.TLS, pWal uintptr, db uintptr, eMode int32,
// number of frames in the WAL at the point of the last commit since
// sqlite3WalCallback() was called. If no commits have occurred since
// the last call, then return 0.
-func Xsqlite3WalCallback(tls *crt.TLS, pWal uintptr) int32 { /* sqlite3.c:63121:20: */
+func Xsqlite3WalCallback(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63265:20: */
var ret U32 = U32(0)
if pWal != 0 {
ret = (*Wal)(unsafe.Pointer(pWal)).FiCallback
@@ -37437,7 +38737,7 @@ func Xsqlite3WalCallback(tls *crt.TLS, pWal uintptr) int32 { /* sqlite3.c:63121:
// not actually change anything. The pager uses this to see if it
// should acquire the database exclusive lock prior to invoking
// the op==1 case.
-func Xsqlite3WalExclusiveMode(tls *crt.TLS, pWal uintptr, op int32) int32 { /* sqlite3.c:63154:20: */
+func Xsqlite3WalExclusiveMode(tls *libc.TLS, pWal uintptr, op int32) int32 { /* sqlite3.c:63298:20: */
var rc int32
// pWal->readLock is usually set, but might be -1 if there was a
@@ -37452,7 +38752,7 @@ func Xsqlite3WalExclusiveMode(tls *crt.TLS, pWal uintptr, op int32) int32 { /* s
if walLockShared(tls, pWal, (3+(int32((*Wal)(unsafe.Pointer(pWal)).FreadLock)))) != 0 {
(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(1)
}
- rc = (crt.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == 0))
+ rc = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == 0))
} else {
// Already in locking_mode=NORMAL
rc = 0
@@ -37463,7 +38763,7 @@ func Xsqlite3WalExclusiveMode(tls *crt.TLS, pWal uintptr, op int32) int32 { /* s
(*Wal)(unsafe.Pointer(pWal)).FexclusiveMode = U8(1)
rc = 1
} else {
- rc = (crt.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == 0))
+ rc = (libc.Bool32(int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == 0))
}
return rc
}
@@ -37471,12 +38771,94 @@ func Xsqlite3WalExclusiveMode(tls *crt.TLS, pWal uintptr, op int32) int32 { /* s
// Return true if the argument is non-NULL and the WAL module is using
// heap-memory for the wal-index. Otherwise, if the argument is NULL or the
// WAL module is using shared-memory, return false.
-func Xsqlite3WalHeapMemory(tls *crt.TLS, pWal uintptr) int32 { /* sqlite3.c:63196:20: */
- return (crt.Bool32((pWal != 0) && (int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == 2)))
+func Xsqlite3WalHeapMemory(tls *libc.TLS, pWal uintptr) int32 { /* sqlite3.c:63340:20: */
+ return (libc.Bool32((pWal != 0) && (int32((*Wal)(unsafe.Pointer(pWal)).FexclusiveMode) == 2)))
+}
+
+// Create a snapshot object. The content of a snapshot is opaque to
+// every other subsystem, so the WAL module can put whatever it needs
+// in the object.
+func Xsqlite3WalSnapshotGet(tls *libc.TLS, pWal uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:63349:20: */
+ var rc int32 = 0
+ var pRet uintptr
+
+ if libc.Xmemcmp(tls, ((pWal+72 /* &.hdr */ +24 /* &.aFrameCksum */)+uintptr(0)*4), uintptr(unsafe.Pointer(&aZero)), uint64(16)) == 0 {
+ *(*uintptr)(unsafe.Pointer(ppSnapshot)) = uintptr(0)
+ return 1
+ }
+ pRet = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(WalIndexHdr{})))
+ if pRet == uintptr(0) {
+ rc = 7
+ } else {
+ libc.Xmemcpy(tls, pRet, (pWal + 72 /* &.hdr */), uint64(unsafe.Sizeof(WalIndexHdr{})))
+ *(*uintptr)(unsafe.Pointer(ppSnapshot)) = pRet
+ }
+
+ return rc
+}
+
+var aZero = [4]U32{U32(0), U32(0), U32(0), U32(0)} /* sqlite3.c:63352:20 */
+
+// Try to open on pSnapshot when the next read-transaction starts
+func Xsqlite3WalSnapshotOpen(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) { /* sqlite3.c:63373:21: */
+ (*Wal)(unsafe.Pointer(pWal)).FpSnapshot = pSnapshot
+}
+
+// Return a +ve value if snapshot p1 is newer than p2. A -ve value if
+// p1 is older than p2 and zero if p1 and p2 are the same snapshot.
+func Xsqlite3_snapshot_cmp(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:63384:16: */
+ var pHdr1 uintptr = p1
+ var pHdr2 uintptr = p2
+
+ // aSalt[0] is a copy of the value stored in the wal file header. It
+ // is incremented each time the wal file is restarted.
+ if *(*U32)(unsafe.Pointer((pHdr1 + 32 /* &.aSalt */) + uintptr(0)*4)) < *(*U32)(unsafe.Pointer((pHdr2 + 32 /* &.aSalt */) + uintptr(0)*4)) {
+ return -1
+ }
+ if *(*U32)(unsafe.Pointer((pHdr1 + 32 /* &.aSalt */) + uintptr(0)*4)) > *(*U32)(unsafe.Pointer((pHdr2 + 32 /* &.aSalt */) + uintptr(0)*4)) {
+ return +1
+ }
+ if (*WalIndexHdr)(unsafe.Pointer(pHdr1)).FmxFrame < (*WalIndexHdr)(unsafe.Pointer(pHdr2)).FmxFrame {
+ return -1
+ }
+ if (*WalIndexHdr)(unsafe.Pointer(pHdr1)).FmxFrame > (*WalIndexHdr)(unsafe.Pointer(pHdr2)).FmxFrame {
+ return +1
+ }
+ return 0
+}
+
+// The caller currently has a read transaction open on the database.
+// This function takes a SHARED lock on the CHECKPOINTER slot and then
+// checks if the snapshot passed as the second argument is still
+// available. If so, SQLITE_OK is returned.
+//
+// If the snapshot is not available, SQLITE_ERROR is returned. Or, if
+// the CHECKPOINTER lock cannot be obtained, SQLITE_BUSY. If any error
+// occurs (any value other than SQLITE_OK is returned), the CHECKPOINTER
+// lock is released before returning.
+func Xsqlite3WalSnapshotCheck(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:63408:20: */
+ var rc int32
+ rc = walLockShared(tls, pWal, 1)
+ if rc == 0 {
+ var pNew uintptr = pSnapshot
+ if (libc.Xmemcmp(tls, pNew+32 /* &.aSalt */, pWal+72 /* &.hdr */ +32 /* &.aSalt */, uint64(unsafe.Sizeof([2]U32{}))) != 0) ||
+ ((*WalIndexHdr)(unsafe.Pointer(pNew)).FmxFrame < (*WalCkptInfo)(unsafe.Pointer(walCkptInfo(tls, pWal))).FnBackfillAttempted) {
+ rc = (1 | (int32(3) << 8))
+ walUnlockShared(tls, pWal, 1)
+ }
+ }
+ return rc
+}
+
+// Release a lock obtained by an earlier successful call to
+// sqlite3WalSnapshotCheck().
+func Xsqlite3WalSnapshotUnlock(tls *libc.TLS, pWal uintptr) { /* sqlite3.c:63427:21: */
+
+ walUnlockShared(tls, pWal, 1)
}
// Return the sqlite3_file object for the WAL file
-func Xsqlite3WalFile(tls *crt.TLS, pWal uintptr) uintptr { /* sqlite3.c:63305:29: */
+func Xsqlite3WalFile(tls *libc.TLS, pWal uintptr) uintptr { /* sqlite3.c:63449:29: */
return (*Wal)(unsafe.Pointer(pWal)).FpWalFd
}
@@ -37995,7 +39377,7 @@ type MemPage1 = struct {
// small cells will be rare, but they are possible.
// Forward declarations
-type MemPage = MemPage1 /* sqlite3.c:63563:24 */
+type MemPage = MemPage1 /* sqlite3.c:63707:24 */
type BtLock1 = struct {
FpBtree uintptr
FiTable Pgno
@@ -38003,7 +39385,7 @@ type BtLock1 = struct {
FpNext uintptr
}
-type BtLock = BtLock1 /* sqlite3.c:63564:23 */
+type BtLock = BtLock1 /* sqlite3.c:63708:23 */
type CellInfo1 = struct {
FnKey I64
FpPayload uintptr
@@ -38012,7 +39394,7 @@ type CellInfo1 = struct {
FnSize U16
}
-type CellInfo = CellInfo1 /* sqlite3.c:63565:25 */
+type CellInfo = CellInfo1 /* sqlite3.c:63709:25 */
// Legal values for BtCursor.curFlags
@@ -38109,19 +39491,19 @@ type CellInfo = CellInfo1 /* sqlite3.c:63565:25 */
// detect pages that are used twice and orphaned pages (both of which
// indicate corruption).
type IntegrityCk1 = struct {
- FpBt uintptr
- FpPager uintptr
- FaPgRef uintptr
- FnPage Pgno
- FmxErr int32
- FnErr int32
- FmallocFailed int32
- FzPfx uintptr
- Fv1 int32
- Fv2 int32
- FerrMsg StrAccum
- Fheap uintptr
- Fdb uintptr
+ FpBt uintptr
+ FpPager uintptr
+ FaPgRef uintptr
+ FnPage Pgno
+ FmxErr int32
+ FnErr int32
+ FbOomFault int32
+ FzPfx uintptr
+ Fv1 Pgno
+ Fv2 int32
+ FerrMsg StrAccum
+ Fheap uintptr
+ Fdb uintptr
}
// Legal values for BtCursor.curFlags
@@ -38218,7 +39600,7 @@ type IntegrityCk1 = struct {
// the database the corresponding bit is set. This allows integrity-check to
// detect pages that are used twice and orphaned pages (both of which
// indicate corruption).
-type IntegrityCk = IntegrityCk1 /* sqlite3.c:64005:28 */
+type IntegrityCk = IntegrityCk1 /* sqlite3.c:64149:28 */
// Routines to read or write a two- and four-byte big-endian integer values.
@@ -38232,7 +39614,7 @@ type IntegrityCk = IntegrityCk1 /* sqlite3.c:64005:28 */
// Obtain the BtShared mutex associated with B-Tree handle p. Also,
// set BtShared.db to the database handle associated with p and the
// p->locked boolean to true.
-func lockBtreeMutex(tls *crt.TLS, p uintptr) { /* sqlite3.c:64054:13: */
+func lockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:64199:13: */
Xsqlite3_mutex_enter(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).Fmutex)
(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).Fdb = (*Btree)(unsafe.Pointer(p)).Fdb
@@ -38241,7 +39623,7 @@ func lockBtreeMutex(tls *crt.TLS, p uintptr) { /* sqlite3.c:64054:13: */
// Release the BtShared mutex associated with B-Tree handle p and
// clear the p->locked boolean.
-func unlockBtreeMutex(tls *crt.TLS, p uintptr) { /* sqlite3.c:64068:29: */
+func unlockBtreeMutex(tls *libc.TLS, p uintptr) { /* sqlite3.c:64213:29: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3_mutex_leave(tls, (*BtShared)(unsafe.Pointer(pBt)).Fmutex)
@@ -38262,7 +39644,7 @@ func unlockBtreeMutex(tls *crt.TLS, p uintptr) { /* sqlite3.c:64068:29: */
// p, then first unlock all of the others on p->pNext, then wait
// for the lock to become available on p, then relock all of the
// subsequent Btrees that desire a lock.
-func Xsqlite3BtreeEnter(tls *crt.TLS, p uintptr) { /* sqlite3.c:64098:21: */
+func Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:64243:21: */
// Some basic sanity checking on the Btree. The list of Btrees
// connected by pNext and pPrev should be in sorted order by
// Btree.pBt value. All elements of the list should belong to
@@ -38290,7 +39672,7 @@ func Xsqlite3BtreeEnter(tls *crt.TLS, p uintptr) { /* sqlite3.c:64098:21: */
// into this routine, we avoid unnecessary stack pointer changes
// and thus help the sqlite3BtreeLock() routine to run much faster
// in the common case.
-func btreeLockCarefully(tls *crt.TLS, p uintptr) { /* sqlite3.c:64132:29: */
+func btreeLockCarefully(tls *libc.TLS, p uintptr) { /* sqlite3.c:64277:29: */
var pLater uintptr
// In most cases, we should be able to acquire the lock we
@@ -38321,7 +39703,7 @@ func btreeLockCarefully(tls *crt.TLS, p uintptr) { /* sqlite3.c:64132:29: */
}
// Exit the recursive mutex on a Btree.
-func Xsqlite3BtreeLeave(tls *crt.TLS, p uintptr) { /* sqlite3.c:64170:21: */
+func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:64315:21: */
if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 {
@@ -38344,7 +39726,7 @@ func Xsqlite3BtreeLeave(tls *crt.TLS, p uintptr) { /* sqlite3.c:64170:21: */
// to avoid the possibility of deadlock when two threads with
// two or more btrees in common both try to lock all their btrees
// at the same instant.
-func btreeEnterAll(tls *crt.TLS, db uintptr) { /* sqlite3.c:64213:29: */
+func btreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64358:29: */
var i int32
var skipOk int32 = 1
var p uintptr
@@ -38358,12 +39740,12 @@ func btreeEnterAll(tls *crt.TLS, db uintptr) { /* sqlite3.c:64213:29: */
}
(*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache = U8(skipOk)
}
-func Xsqlite3BtreeEnterAll(tls *crt.TLS, db uintptr) { /* sqlite3.c:64227:21: */
+func Xsqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64372:21: */
if int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 {
btreeEnterAll(tls, db)
}
}
-func btreeLeaveAll(tls *crt.TLS, db uintptr) { /* sqlite3.c:64230:29: */
+func btreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64375:29: */
var i int32
var p uintptr
@@ -38374,7 +39756,7 @@ func btreeLeaveAll(tls *crt.TLS, db uintptr) { /* sqlite3.c:64230:29: */
}
}
}
-func Xsqlite3BtreeLeaveAll(tls *crt.TLS, db uintptr) { /* sqlite3.c:64239:21: */
+func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr) { /* sqlite3.c:64384:21: */
if int32((*Sqlite3)(unsafe.Pointer(db)).FnoSharedCache) == 0 {
btreeLeaveAll(tls, db)
}
@@ -38385,10 +39767,10 @@ func Xsqlite3BtreeLeaveAll(tls *crt.TLS, db uintptr) { /* sqlite3.c:64239:21: */
// These entry points are used by incremental I/O only. Enter() is required
// any time OMIT_SHARED_CACHE is not defined, regardless of whether or not
// the build is threadsafe. Leave() is only required by threadsafe builds.
-func Xsqlite3BtreeEnterCursor(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:64325:21: */
+func Xsqlite3BtreeEnterCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:64470:21: */
Xsqlite3BtreeEnter(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree)
}
-func Xsqlite3BtreeLeaveCursor(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:64329:21: */
+func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:64474:21: */
Xsqlite3BtreeLeave(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree)
}
@@ -38411,7 +39793,7 @@ func Xsqlite3BtreeLeaveCursor(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:64329:2
// The header string that appears at the beginning of every
// SQLite database.
-var zMagicHeader = *(*[16]int8)(unsafe.Pointer(ts + 3532 /* "SQLite format 3" */)) /* sqlite3.c:64360:19 */
+var zMagicHeader = *(*[16]int8)(unsafe.Pointer(ts + 5667 /* "SQLite format 3" */)) /* sqlite3.c:64505:19 */
// Set this global variable to 1 to enable tracing using the TRACE
// macro.
@@ -38436,15 +39818,15 @@ var zMagicHeader = *(*[16]int8)(unsafe.Pointer(ts + 3532 /* "SQLite format 3" */
// but the test harness needs to access it so we make it global for
// test builds.
//
-// Access to this variable is protected by SQLITE_MUTEX_STATIC_MASTER.
-var Xsqlite3SharedCacheList uintptr = uintptr(0) /* sqlite3.c:64413:25 */
+// Access to this variable is protected by SQLITE_MUTEX_STATIC_MAIN.
+var Xsqlite3SharedCacheList uintptr = uintptr(0) /* sqlite3.c:64558:25 */
// Enable or disable the shared pager and schema features.
//
// This routine has no effect on existing database connections.
// The shared cache setting effects only future calls to
// sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
-func Xsqlite3_enable_shared_cache(tls *crt.TLS, enable int32) int32 { /* sqlite3.c:64427:16: */
+func Xsqlite3_enable_shared_cache(tls *libc.TLS, enable int32) int32 { /* sqlite3.c:64572:16: */
Xsqlite3Config.FsharedCacheEnabled = enable
return 0
}
@@ -38461,7 +39843,7 @@ func Xsqlite3_enable_shared_cache(tls *crt.TLS, enable int32) int32 { /* sqlite3
// (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return
// SQLITE_OK if the lock may be obtained (by calling
// setSharedCacheTableLock()), or SQLITE_LOCKED if not.
-func querySharedCacheTableLock(tls *crt.TLS, p uintptr, iTab Pgno, eLock U8) int32 { /* sqlite3.c:64615:12: */
+func querySharedCacheTableLock(tls *libc.TLS, p uintptr, iTab Pgno, eLock U8) int32 { /* sqlite3.c:64760:12: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var pIter uintptr
@@ -38518,14 +39900,14 @@ func querySharedCacheTableLock(tls *crt.TLS, p uintptr, iTab Pgno, eLock U8) int
//
// SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM
// is returned if a malloc attempt fails.
-func setSharedCacheTableLock(tls *crt.TLS, p uintptr, iTable Pgno, eLock U8) int32 { /* sqlite3.c:64687:12: */
+func setSharedCacheTableLock(tls *libc.TLS, p uintptr, iTable Pgno, eLock U8) int32 { /* sqlite3.c:64832:12: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var pLock uintptr = uintptr(0)
var pIter uintptr
// A connection with the read-uncommitted flag set will never try to
// obtain a read-lock using this function. The only read-lock obtained
- // by a connection in read-uncommitted mode is on the sqlite_master
+ // by a connection in read-uncommitted mode is on the sqlite_schema
// table, and that lock is obtained in BtreeBeginTrans().
// This function should only be called on a sharable b-tree after it
@@ -38569,7 +39951,7 @@ func setSharedCacheTableLock(tls *crt.TLS, p uintptr, iTable Pgno, eLock U8) int
// This function assumes that Btree p has an open read or write
// transaction. If it does not, then the BTS_PENDING flag
// may be incorrectly cleared.
-func clearAllSharedCacheTableLocks(tls *crt.TLS, p uintptr) { /* sqlite3.c:64751:13: */
+func clearAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:64896:13: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var ppIter uintptr = (pBt + 120 /* &.pLock */)
@@ -38589,7 +39971,7 @@ func clearAllSharedCacheTableLocks(tls *crt.TLS, p uintptr) { /* sqlite3.c:64751
if (*BtShared)(unsafe.Pointer(pBt)).FpWriter == p {
(*BtShared)(unsafe.Pointer(pBt)).FpWriter = uintptr(0)
- *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32((0x0040 | 0x0080)))))
+ *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32((0x0040 | 0x0080)))))
} else if (*BtShared)(unsafe.Pointer(pBt)).FnTransaction == 2 {
// This function is called when Btree p is concluding its
// transaction. If there currently exists a writer, and p is not
@@ -38599,17 +39981,17 @@ func clearAllSharedCacheTableLocks(tls *crt.TLS, p uintptr) { /* sqlite3.c:64751
//
// If there is not currently a writer, then BTS_PENDING must
// be zero already. So this next line is harmless in that case.
- *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0080))))
+ *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0080))))
}
}
// This function changes all write-locks held by Btree p into read-locks.
-func downgradeAllSharedCacheTableLocks(tls *crt.TLS, p uintptr) { /* sqlite3.c:64795:13: */
+func downgradeAllSharedCacheTableLocks(tls *libc.TLS, p uintptr) { /* sqlite3.c:64940:13: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
if (*BtShared)(unsafe.Pointer(pBt)).FpWriter == p {
var pLock uintptr
(*BtShared)(unsafe.Pointer(pBt)).FpWriter = uintptr(0)
- *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32((0x0040 | 0x0080)))))
+ *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32((0x0040 | 0x0080)))))
for pLock = (*BtShared)(unsafe.Pointer(pBt)).FpLock; pLock != 0; pLock = (*BtLock)(unsafe.Pointer(pLock)).FpNext {
(*BtLock)(unsafe.Pointer(pLock)).FeLock = U8(1)
@@ -38626,11 +40008,11 @@ func downgradeAllSharedCacheTableLocks(tls *crt.TLS, p uintptr) { /* sqlite3.c:6
// Invalidate the overflow page-list cache for all cursors opened
// on the shared btree structure pBt.
-func invalidateAllOverflowCache(tls *crt.TLS, pBt uintptr) { /* sqlite3.c:64848:13: */
+func invalidateAllOverflowCache(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:64993:13: */
var p uintptr
for p = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext {
- *(*U8)(unsafe.Pointer(p + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(0x04))))
+ *(*U8)(unsafe.Pointer(p + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(0x04))))
}
}
@@ -38645,7 +40027,7 @@ func invalidateAllOverflowCache(tls *crt.TLS, pBt uintptr) { /* sqlite3.c:64848:
// Otherwise, if argument isClearTable is false, then the row with
// rowid iRow is being replaced or deleted. In this case invalidate
// only those incrblob cursors open on that specific row.
-func invalidateIncrblobCursors(tls *crt.TLS, pBtree uintptr, pgnoRoot Pgno, iRow I64, isClearTable int32) { /* sqlite3.c:64870:13: */
+func invalidateIncrblobCursors(tls *libc.TLS, pBtree uintptr, pgnoRoot Pgno, iRow I64, isClearTable int32) { /* sqlite3.c:65015:13: */
var p uintptr
if int32((*Btree)(unsafe.Pointer(pBtree)).FhasIncrblobCur) == 0 {
return
@@ -38695,7 +40077,7 @@ func invalidateIncrblobCursors(tls *crt.TLS, pBtree uintptr, pgnoRoot Pgno, iRow
// optimization 2 above is omitted if the corresponding bit is already
// set in BtShared.pHasContent. The contents of the bitvec are cleared
// at the end of every transaction.
-func btreeSetHasContent(tls *crt.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:64930:12: */
+func btreeSetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:65075:12: */
var rc int32 = 0
if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpHasContent) != 0) {
@@ -38715,20 +40097,20 @@ func btreeSetHasContent(tls *crt.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3
// This function is called when a free-list leaf page is removed from the
// free-list for reuse. It returns false if it is safe to retrieve the
// page from the pager layer with the 'no-content' flag set. True otherwise.
-func btreeGetHasContent(tls *crt.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:64952:12: */
+func btreeGetHasContent(tls *libc.TLS, pBt uintptr, pgno Pgno) int32 { /* sqlite3.c:65097:12: */
var p uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpHasContent
- return (crt.Bool32((p != 0) && ((pgno > Xsqlite3BitvecSize(tls, p)) || (Xsqlite3BitvecTestNotNull(tls, p, pgno) != 0))))
+ return (libc.Bool32((p != 0) && ((pgno > Xsqlite3BitvecSize(tls, p)) || (Xsqlite3BitvecTestNotNull(tls, p, pgno) != 0))))
}
// Clear (destroy) the BtShared.pHasContent bitvec. This should be
// invoked at the conclusion of each write-transaction.
-func btreeClearHasContent(tls *crt.TLS, pBt uintptr) { /* sqlite3.c:64961:13: */
+func btreeClearHasContent(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:65106:13: */
Xsqlite3BitvecDestroy(tls, (*BtShared)(unsafe.Pointer(pBt)).FpHasContent)
(*BtShared)(unsafe.Pointer(pBt)).FpHasContent = uintptr(0)
}
// Release all of the apPage[] pages for a cursor.
-func btreeReleaseAllCursorPages(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:64969:13: */
+func btreeReleaseAllCursorPages(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65114:13: */
var i int32
if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) >= 0 {
for i = 0; i < int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage); i++ {
@@ -38750,7 +40132,7 @@ func btreeReleaseAllCursorPages(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:64969
// NULL. If the cursor is open on a non-intkey table, then pCur->pKey is
// set to point to a malloced buffer pCur->nKey bytes in size containing
// the key.
-func saveCursorKey(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:64993:12: */
+func saveCursorKey(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65138:12: */
var rc int32 = 0
if (*BtCursor)(unsafe.Pointer(pCur)).FcurIntKey != 0 {
@@ -38769,7 +40151,7 @@ func saveCursorKey(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:64993:12: */
if pKey != 0 {
rc = Xsqlite3BtreePayload(tls, pCur, uint32(0), uint32(int32((*BtCursor)(unsafe.Pointer(pCur)).FnKey)), pKey)
if rc == 0 {
- crt.Xmemset(tls, ((pKey) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FnKey)), 0, (uint64(9 + 8)))
+ libc.Xmemset(tls, ((pKey) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FnKey)), 0, (uint64(9 + 8)))
(*BtCursor)(unsafe.Pointer(pCur)).FpKey = pKey
} else {
Xsqlite3_free(tls, pKey)
@@ -38787,7 +40169,7 @@ func saveCursorKey(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:64993:12: */
//
// The caller must ensure that the cursor is valid (has eState==CURSOR_VALID)
// prior to calling this routine.
-func saveCursorPosition(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:65035:12: */
+func saveCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65180:12: */
var rc int32
if (int32((*BtCursor)(unsafe.Pointer(pCur)).FcurFlags) & 0x40) != 0 {
@@ -38805,7 +40187,7 @@ func saveCursorPosition(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:65035:1
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(3)
}
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(((0x02 | 0x04) | 0x08)))))
+ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(((0x02 | 0x04) | 0x08)))))
return rc
}
@@ -38828,7 +40210,7 @@ func saveCursorPosition(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:65035:1
// Implementation note: This routine merely checks to see if any cursors
// need to be saved. It calls out to saveCursorsOnList() in the (unusual)
// event that cursors are in need to being saved.
-func saveAllCursors(tls *crt.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:65085:12: */
+func saveAllCursors(tls *libc.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:65230:12: */
var p uintptr
for p = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; p != 0; p = (*BtCursor)(unsafe.Pointer(p)).FpNext {
@@ -38840,7 +40222,7 @@ func saveAllCursors(tls *crt.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int3
return saveCursorsOnList(tls, p, iRoot, pExcept)
}
if pExcept != 0 {
- *(*U8)(unsafe.Pointer(pExcept + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(0x20))))
+ *(*U8)(unsafe.Pointer(pExcept + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(0x20))))
}
return 0
}
@@ -38849,7 +40231,7 @@ func saveAllCursors(tls *crt.TLS, pBt uintptr, iRoot Pgno, pExcept uintptr) int3
// the cursors if and when a cursor is found that actually requires saving.
// The common case is that no cursors need to be saved, so this routine is
// broken out from its caller to avoid unnecessary stack pointer movement.
-func saveCursorsOnList(tls *crt.TLS, p uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:65102:28: */
+func saveCursorsOnList(tls *libc.TLS, p uintptr, iRoot Pgno, pExcept uintptr) int32 { /* sqlite3.c:65247:28: */
for ok := true; ok; ok = p != 0 {
if (p != pExcept) && ((Pgno(0) == iRoot) || ((*BtCursor)(unsafe.Pointer(p)).FpgnoRoot == iRoot)) {
if (int32((*BtCursor)(unsafe.Pointer(p)).FeState) == 0) || (int32((*BtCursor)(unsafe.Pointer(p)).FeState) == 2) {
@@ -38868,7 +40250,7 @@ func saveCursorsOnList(tls *crt.TLS, p uintptr, iRoot Pgno, pExcept uintptr) int
}
// Clear the current cursor position.
-func Xsqlite3BtreeClearCursor(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:65127:21: */
+func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:65272:21: */
Xsqlite3_free(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey)
(*BtCursor)(unsafe.Pointer(pCur)).FpKey = uintptr(0)
@@ -38878,7 +40260,7 @@ func Xsqlite3BtreeClearCursor(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:65127:2
// In this version of BtreeMoveto, pKey is a packed index record
// such as is generated by the OP_MakeRecord opcode. Unpack the
// record and then call BtreeMovetoUnpacked() to do the work.
-func btreeMoveto(tls *crt.TLS, pCur uintptr, pKey uintptr, nKey I64, bias int32, pRes uintptr) int32 { /* sqlite3.c:65139:12: */
+func btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey I64, bias int32, pRes uintptr) int32 { /* sqlite3.c:65284:12: */
var rc int32 // Status code
var pIdxKey uintptr
var pKeyInfo uintptr // Unpacked index key
@@ -38899,7 +40281,7 @@ __3:
if !((int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0) || (int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField))) {
goto __4
}
- rc = Xsqlite3CorruptError(tls, 65156)
+ rc = Xsqlite3CorruptError(tls, 65301)
goto moveto_done
__4:
;
@@ -38924,7 +40306,7 @@ __5:
// saved position info stored by saveCursorPosition(), so there can be
// at most one effective restoreCursorPosition() call after each
// saveCursorPosition().
-func btreeRestoreCursorPosition(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:65177:12: */
+func btreeRestoreCursorPosition(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65322:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -38964,20 +40346,20 @@ func btreeRestoreCursorPosition(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c
//
// Use the separate sqlite3BtreeCursorRestore() routine to restore a cursor
// back to where it ought to be if this routine returns true.
-func Xsqlite3BtreeCursorHasMoved(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:65220:20: */
+func Xsqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:65365:20: */
- return (crt.Bool32(0 != int32(*(*U8)(unsafe.Pointer(pCur)))))
+ return (libc.Bool32(0 != int32(*(*U8)(unsafe.Pointer(pCur)))))
}
// Return a pointer to a fake BtCursor object that will always answer
// false to the sqlite3BtreeCursorHasMoved() routine above. The fake
// cursor returned must not be used with any other Btree interface.
-func Xsqlite3BtreeFakeValidCursor(tls *crt.TLS) uintptr { /* sqlite3.c:65233:25: */
+func Xsqlite3BtreeFakeValidCursor(tls *libc.TLS) uintptr { /* sqlite3.c:65378:25: */
return uintptr(unsafe.Pointer(&fakeCursor))
}
-var fakeCursor U8 = U8(0) /* sqlite3.c:65234:13 */
+var fakeCursor U8 = U8(0) /* sqlite3.c:65379:13 */
// This routine restores a cursor back to its original position after it
// has been moved by some outside activity (such as a btree rebalance or
@@ -38990,7 +40372,7 @@ var fakeCursor U8 = U8(0) /* sqlite3.c:65234:13 */
//
// This routine should only be called for a cursor that just returned
// TRUE from sqlite3BtreeCursorHasMoved().
-func Xsqlite3BtreeCursorRestore(tls *crt.TLS, pCur uintptr, pDifferentRow uintptr) int32 { /* sqlite3.c:65252:20: */
+func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintptr) int32 { /* sqlite3.c:65397:20: */
var rc int32
rc = func() int32 {
@@ -39012,7 +40394,7 @@ func Xsqlite3BtreeCursorRestore(tls *crt.TLS, pCur uintptr, pDifferentRow uintpt
}
// Provide flag hints to the cursor.
-func Xsqlite3BtreeCursorHintFlags(tls *crt.TLS, pCur uintptr, x uint32) { /* sqlite3.c:65284:21: */
+func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32) { /* sqlite3.c:65429:21: */
(*BtCursor)(unsafe.Pointer(pCur)).Fhints = U8(x)
}
@@ -39024,7 +40406,7 @@ func Xsqlite3BtreeCursorHintFlags(tls *crt.TLS, pCur uintptr, x uint32) { /* sql
// Return 0 (not a valid page) for pgno==1 since there is
// no pointer map associated with page 1. The integrity_check logic
// requires that ptrmapPageno(*,1)!=1.
-func ptrmapPageno(tls *crt.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:65300:13: */
+func ptrmapPageno(tls *libc.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:65445:13: */
var nPagesPerMapPage int32
var iPtrMap Pgno
var ret Pgno
@@ -39049,7 +40431,7 @@ func ptrmapPageno(tls *crt.TLS, pBt uintptr, pgno Pgno) Pgno { /* sqlite3.c:6530
// If *pRC is initially non-zero (non-SQLITE_OK) then this routine is
// a no-op. If an error occurs, the appropriate error code is written
// into *pRC.
-func ptrmapPut(tls *crt.TLS, pBt uintptr, key Pgno, eType U8, parent Pgno, pRC uintptr) { /* sqlite3.c:65324:13: */
+func ptrmapPut(tls *libc.TLS, pBt uintptr, key Pgno, eType U8, parent Pgno, pRC uintptr) { /* sqlite3.c:65469:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -39067,12 +40449,12 @@ func ptrmapPut(tls *crt.TLS, pBt uintptr, key Pgno, eType U8, parent Pgno, pRC u
__1:
;
- // The master-journal page number must never be used as a pointer map page
+ // The super-journal page number must never be used as a pointer map page
if !(key == Pgno(0)) {
goto __2
}
- *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65339)
+ *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65484)
return
__2:
;
@@ -39091,7 +40473,7 @@ __3:
// The first byte of the extra data is the MemPage.isInit byte.
// If that byte is set, it means this page is also being used
// as a btree page.
- *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65352)
+ *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65497)
goto ptrmap_exit
__4:
;
@@ -39099,7 +40481,7 @@ __4:
if !(offset < 0) {
goto __5
}
- *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65357)
+ *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65502)
goto ptrmap_exit
__5:
;
@@ -39110,7 +40492,7 @@ __5:
goto __6
}
- *(*int32)(unsafe.Pointer(pRC)) = crt.AssignInt32(&rc, Xsqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */))))
+ *(*int32)(unsafe.Pointer(pRC)) = libc.AssignInt32(&rc, Xsqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */))))
if !(rc == 0) {
goto __7
}
@@ -39130,7 +40512,7 @@ ptrmap_exit:
// This routine retrieves the pointer map entry for page 'key', writing
// the type and parent page number to *pEType and *pPgno respectively.
// An error code is returned if something goes wrong, otherwise SQLITE_OK.
-func ptrmapGet(tls *crt.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintptr) int32 { /* sqlite3.c:65383:12: */
+func ptrmapGet(tls *libc.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintptr) int32 { /* sqlite3.c:65528:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -39151,7 +40533,7 @@ func ptrmapGet(tls *crt.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintpt
offset = (int32(Pgno(5) * ((key - Pgno(iPtrmap)) - Pgno(1))))
if offset < 0 {
Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */)))
- return Xsqlite3CorruptError(tls, 65402)
+ return Xsqlite3CorruptError(tls, 65547)
}
*(*U8)(unsafe.Pointer(pEType)) = *(*U8)(unsafe.Pointer(pPtrmap + uintptr(offset)))
@@ -39161,7 +40543,7 @@ func ptrmapGet(tls *crt.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintpt
Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */)))
if (int32(*(*U8)(unsafe.Pointer(pEType))) < 1) || (int32(*(*U8)(unsafe.Pointer(pEType))) > 5) {
- return Xsqlite3CorruptError(tls, 65410)
+ return Xsqlite3CorruptError(tls, 65555)
}
return 0
}
@@ -39179,7 +40561,7 @@ func ptrmapGet(tls *crt.TLS, pBt uintptr, key Pgno, pEType uintptr, pPgno uintpt
// btreeParseCellPtrIndex() for the case when the cell does not fit entirely
// on a single B-tree page. Make necessary adjustments to the CellInfo
// structure.
-func btreeParseCellAdjustSizeForOverflow(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65442:29: */
+func btreeParseCellAdjustSizeForOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65587:29: */
// If the payload will not fit completely on the local page, we have
// to decide how much to store locally and how much to spill onto
// overflow pages. The strategy is to minimize the amount of unused
@@ -39216,7 +40598,7 @@ func btreeParseCellAdjustSizeForOverflow(tls *crt.TLS, pPage uintptr, pCell uint
// There is also a wrapper function btreeParseCell() that works for
// all MemPage types and that references the cell by index rather than
// by pointer.
-func btreeParseCellPtrNoPayload(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65487:13: */
+func btreeParseCellPtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65632:13: */
_ = pPage
(*CellInfo)(unsafe.Pointer(pInfo)).FnSize = (U16(4 + int32(Xsqlite3GetVarint(tls, (pCell+uintptr(4)), (pInfo /* &.nKey */)))))
@@ -39225,7 +40607,7 @@ func btreeParseCellPtrNoPayload(tls *crt.TLS, pPage uintptr, pCell uintptr, pInf
(*CellInfo)(unsafe.Pointer(pInfo)).FpPayload = uintptr(0)
return
}
-func btreeParseCellPtr(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65504:13: */
+func btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65649:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -39246,7 +40628,7 @@ func btreeParseCellPtr(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr
var pEnd uintptr = (pIter + uintptr(8))
nPayload = nPayload & (U32(0x7f))
for ok := true; ok; ok = (((int32(*(*U8)(unsafe.Pointer(pIter)))) >= 0x80) && (pIter < pEnd)) {
- nPayload = ((nPayload << 7) | (U32(int32(*(*U8)(unsafe.Pointer(crt.PreIncUintptr(&pIter, 1)))) & 0x7f)))
+ nPayload = ((nPayload << 7) | (U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))) & 0x7f)))
}
}
pIter++
@@ -39261,12 +40643,12 @@ func btreeParseCellPtr(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr
var pEnd uintptr = (pIter + uintptr(7))
*(*U64)(unsafe.Pointer(bp /* iKey */)) &= uint64(0x7f)
for 1 != 0 {
- *(*U64)(unsafe.Pointer(bp /* iKey */)) = ((*(*U64)(unsafe.Pointer(bp /* iKey */)) << 7) | (U64(int32(*(*U8)(unsafe.Pointer(crt.PreIncUintptr(&pIter, 1)))) & 0x7f)))
+ *(*U64)(unsafe.Pointer(bp /* iKey */)) = ((*(*U64)(unsafe.Pointer(bp /* iKey */)) << 7) | (U64(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))) & 0x7f)))
if (int32(*(*U8)(unsafe.Pointer(pIter)))) < 0x80 {
break
}
if pIter >= pEnd {
- *(*U64)(unsafe.Pointer(bp /* iKey */)) = ((*(*U64)(unsafe.Pointer(bp /* iKey */)) << 8) | U64(*(*U8)(unsafe.Pointer(crt.PreIncUintptr(&pIter, 1)))))
+ *(*U64)(unsafe.Pointer(bp /* iKey */)) = ((*(*U64)(unsafe.Pointer(bp /* iKey */)) << 8) | U64(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))))
break
}
}
@@ -39289,7 +40671,7 @@ func btreeParseCellPtr(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr
btreeParseCellAdjustSizeForOverflow(tls, pPage, pCell, pInfo)
}
}
-func btreeParseCellPtrIndex(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65572:13: */
+func btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) { /* sqlite3.c:65717:13: */
var pIter uintptr // For scanning through pCell
var nPayload U32 // Number of bytes of cell payload
@@ -39299,7 +40681,7 @@ func btreeParseCellPtrIndex(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo ui
var pEnd uintptr = (pIter + uintptr(8))
nPayload = nPayload & (U32(0x7f))
for ok := true; ok; ok = ((int32(*(*U8)(unsafe.Pointer(pIter))) >= 0x80) && (pIter < pEnd)) {
- nPayload = ((nPayload << 7) | (U32(int32(*(*U8)(unsafe.Pointer(crt.PreIncUintptr(&pIter, 1)))) & 0x7f)))
+ nPayload = ((nPayload << 7) | (U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))) & 0x7f)))
}
}
pIter++
@@ -39319,8 +40701,8 @@ func btreeParseCellPtrIndex(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo ui
btreeParseCellAdjustSizeForOverflow(tls, pPage, pCell, pInfo)
}
}
-func btreeParseCell(tls *crt.TLS, pPage uintptr, iCell int32, pInfo uintptr) { /* sqlite3.c:65609:13: */
- (*(*func(*crt.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & ((int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (iCell)))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (iCell)))) + uintptr(1)))))))), pInfo)
+func btreeParseCell(tls *libc.TLS, pPage uintptr, iCell int32, pInfo uintptr) { /* sqlite3.c:65754:13: */
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & ((int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (iCell)))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (iCell)))) + uintptr(1)))))))), pInfo)
}
// The following routines are implementations of the MemPage.xCellSize
@@ -39333,7 +40715,7 @@ func btreeParseCell(tls *crt.TLS, pPage uintptr, iCell int32, pInfo uintptr) { /
//
// cellSizePtrNoPayload() => table internal nodes
// cellSizePtr() => all index nodes & table leaf nodes
-func cellSizePtr(tls *crt.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:65629:12: */
+func cellSizePtr(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:65774:12: */
var pIter uintptr = (pCell + uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) // For looping over bytes of pCell
var pEnd uintptr // End mark for a varint
var nSize U32 // Size value to return
@@ -39343,7 +40725,7 @@ func cellSizePtr(tls *crt.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:
pEnd = (pIter + uintptr(8))
nSize = nSize & (U32(0x7f))
for ok := true; ok; ok = ((int32(*(*U8)(unsafe.Pointer(pIter))) >= 0x80) && (pIter < pEnd)) {
- nSize = ((nSize << 7) | (U32(int32(*(*U8)(unsafe.Pointer(crt.PreIncUintptr(&pIter, 1)))) & 0x7f)))
+ nSize = ((nSize << 7) | (U32(int32(*(*U8)(unsafe.Pointer(libc.PreIncUintptr(&pIter, 1)))) & 0x7f)))
}
}
pIter++
@@ -39352,7 +40734,7 @@ func cellSizePtr(tls *crt.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:
// integer. The following block moves pIter to point at the first byte
// past the end of the key value.
pEnd = (pIter + uintptr(9))
- for (((int32(*(*U8)(unsafe.Pointer(crt.PostIncUintptr(&pIter, 1))))) & 0x80) != 0) && (pIter < pEnd) {
+ for (((int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))) & 0x80) != 0) && (pIter < pEnd) {
}
}
@@ -39373,14 +40755,14 @@ func cellSizePtr(tls *crt.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:
return U16(nSize)
}
-func cellSizePtrNoPayload(tls *crt.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:65677:12: */
+func cellSizePtrNoPayload(tls *libc.TLS, pPage uintptr, pCell uintptr) U16 { /* sqlite3.c:65822:12: */
var pIter uintptr = (pCell + uintptr(4)) // For looping over bytes of pCell
var pEnd uintptr // End mark for a varint
_ = pPage
pEnd = (pIter + uintptr(9))
- for (((int32(*(*U8)(unsafe.Pointer(crt.PostIncUintptr(&pIter, 1))))) & 0x80) != 0) && (pIter < pEnd) {
+ for (((int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pIter, 1))))) & 0x80) != 0) && (pIter < pEnd) {
}
return (U16((int64(pIter) - int64(pCell)) / 1))
@@ -39390,7 +40772,7 @@ func cellSizePtrNoPayload(tls *crt.TLS, pPage uintptr, pCell uintptr) U16 { /* s
// of pPage. (pSrc and pPager are often the same.) If pCell contains a
// pointer to an overflow page, insert an entry into the pointer-map for
// the overflow page that will be valid after pCell has been moved to pPage.
-func ptrmapPutOvflPtr(tls *crt.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, pRC uintptr) { /* sqlite3.c:65715:13: */
+func ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr, pRC uintptr) { /* sqlite3.c:65860:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -39400,12 +40782,12 @@ func ptrmapPutOvflPtr(tls *crt.TLS, pPage uintptr, pSrc uintptr, pCell uintptr,
return
}
- (*(*func(*crt.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, pCell, bp /* &info */)
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, pCell, bp /* &info */)
if U32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnLocal) < (*CellInfo)(unsafe.Pointer(bp /* &info */)).FnPayload {
var ovfl Pgno
if (Uptr(((*MemPage)(unsafe.Pointer(pSrc)).FaDataEnd)) >= Uptr((pCell))) && (Uptr(((*MemPage)(unsafe.Pointer(pSrc)).FaDataEnd)) < Uptr((pCell + uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnLocal)))) {
- *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65724)
+ *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 65869)
return
}
ovfl = Xsqlite3Get4byte(tls, (pCell + uintptr((int32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize) - 4))))
@@ -39423,7 +40805,7 @@ func ptrmapPutOvflPtr(tls *crt.TLS, pPage uintptr, pSrc uintptr, pCell uintptr,
// b-tree page so that there are no freeblocks or fragment bytes, all
// unused bytes are contained in the unallocated space region, and all
// cells are packed tightly at the end of the page.
-func defragmentPage(tls *crt.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sqlite3.c:65746:12: */
+func defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sqlite3.c:65891:12: */
var i int32 // Loop counter
var pc int32 // Address of the i-th cell
var hdr int32 // Offset to the page header
@@ -39448,7 +40830,7 @@ func defragmentPage(tls *crt.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sqli
var pAddr1 uintptr // Last possible cell index
temp = uintptr(0)
- src = crt.AssignUintptr(&data, (*MemPage)(unsafe.Pointer(pPage)).FaData)
+ src = libc.AssignUintptr(&data, (*MemPage)(unsafe.Pointer(pPage)).FaData)
hdr = int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)
cellOffset = int32((*MemPage)(unsafe.Pointer(pPage)).FcellOffset)
nCell = int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)
@@ -39468,7 +40850,7 @@ func defragmentPage(tls *crt.TLS, pPage uintptr, nMaxFrag int32) int32 { /* sqli
if !(iFree > (usableSize - 4)) {
goto __2
}
- return Xsqlite3CorruptError(tls, 65782)
+ return Xsqlite3CorruptError(tls, 65927)
__2:
;
if !(iFree != 0) {
@@ -39478,7 +40860,7 @@ __2:
if !(iFree2 > (usableSize - 4)) {
goto __4
}
- return Xsqlite3CorruptError(tls, 65785)
+ return Xsqlite3CorruptError(tls, 65930)
__4:
;
if !((0 == iFree2) || ((int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0) && (int32(*(*uint8)(unsafe.Pointer(data + uintptr((iFree2 + 1))))) == 0))) {
@@ -39491,7 +40873,7 @@ __4:
if !(top >= iFree) {
goto __6
}
- return Xsqlite3CorruptError(tls, 65793)
+ return Xsqlite3CorruptError(tls, 65938)
__6:
;
if !(iFree2 != 0) {
@@ -39500,24 +40882,24 @@ __6:
if !((iFree + sz) > iFree2) {
goto __9
}
- return Xsqlite3CorruptError(tls, 65796)
+ return Xsqlite3CorruptError(tls, 65941)
__9:
;
sz2 = ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((iFree2 + 2))) + uintptr(0)))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((iFree2 + 2))) + uintptr(1)))))
if !((iFree2 + sz2) > usableSize) {
goto __10
}
- return Xsqlite3CorruptError(tls, 65798)
+ return Xsqlite3CorruptError(tls, 65943)
__10:
;
- crt.Xmemmove(tls, (data + uintptr(((iFree + sz) + sz2))), (data + uintptr((iFree + sz))), (uint64(iFree2 - (iFree + sz))))
+ libc.Xmemmove(tls, (data + uintptr(((iFree + sz) + sz2))), (data + uintptr((iFree + sz))), (uint64(iFree2 - (iFree + sz))))
sz = sz + (sz2)
goto __8
__7:
if !((iFree + sz) > usableSize) {
goto __11
}
- return Xsqlite3CorruptError(tls, 65802)
+ return Xsqlite3CorruptError(tls, 65947)
__11:
;
__8:
@@ -39525,7 +40907,7 @@ __8:
cbrk = (top + sz)
- crt.Xmemmove(tls, (data + uintptr(cbrk)), (data + uintptr(top)), (uint64(iFree - top)))
+ libc.Xmemmove(tls, (data + uintptr(cbrk)), (data + uintptr(top)), (uint64(iFree - top)))
pAddr = (data + uintptr(cellOffset))
__12:
if !(pAddr < pEnd) {
@@ -39578,16 +40960,16 @@ __18:
if !((pc < iCellFirst) || (pc > iCellLast)) {
goto __21
}
- return Xsqlite3CorruptError(tls, 65830)
+ return Xsqlite3CorruptError(tls, 65975)
__21:
;
- size = int32((*(*func(*crt.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pPage + 120 /* &.xCellSize */))))(tls, pPage, (src + uintptr(pc))))
+ size = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pPage + 120 /* &.xCellSize */))))(tls, pPage, (src + uintptr(pc))))
cbrk = cbrk - (size)
if !((cbrk < iCellFirst) || ((pc + size) > usableSize)) {
goto __22
}
- return Xsqlite3CorruptError(tls, 65836)
+ return Xsqlite3CorruptError(tls, 65981)
__22:
;
@@ -39604,11 +40986,11 @@ __24:
;
temp = Xsqlite3PagerTempSpace(tls, (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FpPager)
x = ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((hdr + 5))) + uintptr(0)))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((hdr + 5))) + uintptr(1)))))
- crt.Xmemcpy(tls, (temp + uintptr(x)), (data + uintptr(x)), (uint64((cbrk + size) - x)))
+ libc.Xmemcpy(tls, (temp + uintptr(x)), (data + uintptr(x)), (uint64((cbrk + size) - x)))
src = temp
__23:
;
- crt.Xmemcpy(tls, (data + uintptr(cbrk)), (src + uintptr(pc)), uint64(size))
+ libc.Xmemcpy(tls, (data + uintptr(cbrk)), (src + uintptr(pc)), uint64(size))
goto __19
__19:
i++
@@ -39623,7 +41005,7 @@ defragment_out:
if !(((int32(*(*uint8)(unsafe.Pointer(data + uintptr((hdr + 7))))) + cbrk) - iCellFirst) != (*MemPage)(unsafe.Pointer(pPage)).FnFree) {
goto __25
}
- return Xsqlite3CorruptError(tls, 65857)
+ return Xsqlite3CorruptError(tls, 66002)
__25:
;
@@ -39631,7 +41013,7 @@ __25:
*(*uint8)(unsafe.Pointer((data + uintptr((hdr + 5))) + uintptr(1))) = U8(cbrk)
*(*uint8)(unsafe.Pointer(data + uintptr((hdr + 1)))) = uint8(0)
*(*uint8)(unsafe.Pointer(data + uintptr((hdr + 2)))) = uint8(0)
- crt.Xmemset(tls, (data + uintptr(iCellFirst)), 0, (uint64(cbrk - iCellFirst)))
+ libc.Xmemset(tls, (data + uintptr(iCellFirst)), 0, (uint64(cbrk - iCellFirst)))
return 0
}
@@ -39648,7 +41030,7 @@ __25:
// Slots on the free list that are between 1 and 3 bytes larger than nByte
// will be ignored if adding the extra space to the fragmentation count
// causes the fragmentation count to exceed 60.
-func pageFindSlot(tls *crt.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr { /* sqlite3.c:65882:11: */
+func pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr { /* sqlite3.c:66027:11: */
var hdr int32 = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) // Offset to page header
var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData // Page data
var iAddr int32 = (hdr + 1) // Address of ptr to pc
@@ -39662,7 +41044,7 @@ func pageFindSlot(tls *crt.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr {
// freeblock form a big-endian integer which is the size of the freeblock
// in bytes, including the 4-byte header.
size = ((int32(*(*U8)(unsafe.Pointer((aData + uintptr((pc + 2))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer((aData + uintptr((pc + 2))) + uintptr(1)))))
- if (crt.AssignInt32(&x, (size - nByte))) >= 0 {
+ if (libc.AssignInt32(&x, (size - nByte))) >= 0 {
if x < 4 {
// EVIDENCE-OF: R-11498-58022 In a well-formed b-tree page, the total
@@ -39673,11 +41055,11 @@ func pageFindSlot(tls *crt.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr {
// Remove the slot from the free-list. Update the number of
// fragmented bytes within the page.
- crt.Xmemcpy(tls, (aData + uintptr(iAddr)), (aData + uintptr(pc)), uint64(2))
+ libc.Xmemcpy(tls, (aData + uintptr(iAddr)), (aData + uintptr(pc)), uint64(2))
*(*U8)(unsafe.Pointer(aData + uintptr((hdr + 7)))) += U8((int32(U8(x))))
} else if (x + pc) > maxPC {
// This slot extends off the end of the usable part of the page
- *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 65911)
+ *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66056)
return uintptr(0)
} else {
// The slot remains on the free-list. Reduce its size to account
@@ -39692,14 +41074,14 @@ func pageFindSlot(tls *crt.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr {
if pc <= (iAddr + size) {
if pc != 0 {
// The next slot in the chain is not past the end of the current slot
- *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 65925)
+ *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66070)
}
return uintptr(0)
}
}
if pc > ((maxPC + nByte) - 4) {
// The free slot chain extends off the end of the page
- *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 65932)
+ *(*int32)(unsafe.Pointer(pRc)) = Xsqlite3CorruptError(tls, 66077)
}
return uintptr(0)
}
@@ -39715,7 +41097,7 @@ func pageFindSlot(tls *crt.TLS, pPg uintptr, nByte int32, pRc uintptr) uintptr {
// the first two bytes past the cell pointer area since presumably this
// allocation is being made in order to insert a new cell, so we will
// also end up needing a new cell pointer.
-func allocateSpace(tls *crt.TLS, pPage uintptr, nByte int32, pIdx uintptr) int32 { /* sqlite3.c:65950:12: */
+func allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) int32 { /* sqlite3.c:66095:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -39740,7 +41122,7 @@ func allocateSpace(tls *crt.TLS, pPage uintptr, nByte int32, pIdx uintptr) int32
if (top == 0) && ((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == U32(65536)) {
top = 65536
} else {
- return Xsqlite3CorruptError(tls, 65979)
+ return Xsqlite3CorruptError(tls, 66124)
}
}
@@ -39753,9 +41135,9 @@ func allocateSpace(tls *crt.TLS, pPage uintptr, nByte int32, pIdx uintptr) int32
if pSpace != 0 {
var g2 int32
- *(*int32)(unsafe.Pointer(pIdx)) = crt.AssignInt32(&g2, (int32((int64(pSpace) - int64(data)) / 1)))
+ *(*int32)(unsafe.Pointer(pIdx)) = libc.AssignInt32(&g2, (int32((int64(pSpace) - int64(data)) / 1)))
if g2 <= gap {
- return Xsqlite3CorruptError(tls, 65997)
+ return Xsqlite3CorruptError(tls, 66142)
} else {
return 0
}
@@ -39805,7 +41187,7 @@ func allocateSpace(tls *crt.TLS, pPage uintptr, nByte int32, pIdx uintptr) int32
// does it detect cells or freeblocks that encrouch into the reserved bytes
// at the end of the page. So do additional corruption checks inside this
// routine and return SQLITE_CORRUPT if any problems are found.
-func freeSpace(tls *crt.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sqlite3.c:66046:12: */
+func freeSpace(tls *libc.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sqlite3.c:66191:12: */
var iPtr U16 // Address of ptr to next freeblock
var iFreeBlk U16 // Address of the next freeblock
var hdr U8 // Page header size. 0 or 100
@@ -39824,17 +41206,17 @@ func freeSpace(tls *crt.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sq
if (int32(*(*uint8)(unsafe.Pointer(data + uintptr((int32(iPtr) + 1))))) == 0) && (int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0) {
iFreeBlk = U16(0)
} else {
- for (int32(crt.AssignUint16(&iFreeBlk, (U16((int32(*(*uint8)(unsafe.Pointer((data + uintptr(iPtr)) + uintptr(0)))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr(iPtr)) + uintptr(1))))))))) < int32(iStart) {
+ for (int32(libc.AssignUint16(&iFreeBlk, (U16((int32(*(*uint8)(unsafe.Pointer((data + uintptr(iPtr)) + uintptr(0)))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr(iPtr)) + uintptr(1))))))))) < int32(iStart) {
if int32(iFreeBlk) < (int32(iPtr) + 4) {
if int32(iFreeBlk) == 0 {
break
} // TH3: corrupt082.100
- return Xsqlite3CorruptError(tls, 66075)
+ return Xsqlite3CorruptError(tls, 66220)
}
iPtr = iFreeBlk
}
if U32(iFreeBlk) > ((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32(4)) { // TH3: corrupt081.100
- return Xsqlite3CorruptError(tls, 66080)
+ return Xsqlite3CorruptError(tls, 66225)
}
// At this point:
@@ -39845,11 +41227,11 @@ func freeSpace(tls *crt.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sq
if (iFreeBlk != 0) && ((iEnd + U32(3)) >= U32(iFreeBlk)) {
nFrag = (U8(U32(iFreeBlk) - iEnd))
if iEnd > U32(iFreeBlk) {
- return Xsqlite3CorruptError(tls, 66092)
+ return Xsqlite3CorruptError(tls, 66237)
}
iEnd = (U32(int32(iFreeBlk) + ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iFreeBlk) + 2))) + uintptr(0)))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iFreeBlk) + 2))) + uintptr(1)))))))
if iEnd > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize {
- return Xsqlite3CorruptError(tls, 66095)
+ return Xsqlite3CorruptError(tls, 66240)
}
iSize = (U16(iEnd - U32(iStart)))
iFreeBlk = (U16((int32(*(*uint8)(unsafe.Pointer((data + uintptr(iFreeBlk)) + uintptr(0)))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr(iFreeBlk)) + uintptr(1))))))
@@ -39862,7 +41244,7 @@ func freeSpace(tls *crt.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sq
var iPtrEnd int32 = (int32(iPtr) + ((int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iPtr) + 2))) + uintptr(0)))) << 8) | int32(*(*uint8)(unsafe.Pointer((data + uintptr((int32(iPtr) + 2))) + uintptr(1))))))
if (iPtrEnd + 3) >= int32(iStart) {
if iPtrEnd > int32(iStart) {
- return Xsqlite3CorruptError(tls, 66108)
+ return Xsqlite3CorruptError(tls, 66253)
}
nFrag = U8(int32(nFrag) + (int32(iStart) - iPtrEnd))
iSize = (U16(iEnd - U32(iPtr)))
@@ -39870,7 +41252,7 @@ func freeSpace(tls *crt.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sq
}
}
if int32(nFrag) > int32(*(*uint8)(unsafe.Pointer(data + uintptr((int32(hdr) + 7))))) {
- return Xsqlite3CorruptError(tls, 66114)
+ return Xsqlite3CorruptError(tls, 66259)
}
*(*uint8)(unsafe.Pointer(data + uintptr((int32(hdr) + 7)))) -= uint8((int32(nFrag)))
}
@@ -39880,10 +41262,10 @@ func freeSpace(tls *crt.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sq
// so just extend the cell content area rather than create another
// freelist entry
if int32(iStart) < int32(x) {
- return Xsqlite3CorruptError(tls, 66122)
+ return Xsqlite3CorruptError(tls, 66267)
}
if int32(iPtr) != (int32(hdr) + 1) {
- return Xsqlite3CorruptError(tls, 66123)
+ return Xsqlite3CorruptError(tls, 66268)
}
*(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 1))) + uintptr(0))) = (U8((int32(iFreeBlk)) >> 8))
*(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 1))) + uintptr(1))) = U8(iFreeBlk)
@@ -39897,7 +41279,7 @@ func freeSpace(tls *crt.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sq
if (int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FbtsFlags) & 0x000c) != 0 {
// Overwrite deleted information with zeros when the secure_delete
// option is enabled
- crt.Xmemset(tls, (data + uintptr(iStart)), 0, uint64(iSize))
+ libc.Xmemset(tls, (data + uintptr(iStart)), 0, uint64(iSize))
}
*(*uint8)(unsafe.Pointer((data + uintptr(iStart)) + uintptr(0))) = (U8((int32(iFreeBlk)) >> 8))
*(*uint8)(unsafe.Pointer((data + uintptr(iStart)) + uintptr(1))) = U8(iFreeBlk)
@@ -39917,14 +41299,14 @@ func freeSpace(tls *crt.TLS, pPage uintptr, iStart U16, iSize U16) int32 { /* sq
// PTF_ZERODATA | PTF_LEAF
// PTF_LEAFDATA | PTF_INTKEY
// PTF_LEAFDATA | PTF_INTKEY | PTF_LEAF
-func decodeFlags(tls *crt.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite3.c:66153:12: */
+func decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite3.c:66298:12: */
var pBt uintptr // A copy of pPage->pBt
(*MemPage)(unsafe.Pointer(pPage)).Fleaf = (U8(flagByte >> 3))
- flagByte = flagByte & (^int32(crt.Int32FromInt32(0x08)))
+ flagByte = flagByte & (^int32(libc.Int32FromInt32(0x08)))
(*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize = (U8(4 - (4 * int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf))))
(*MemPage)(unsafe.Pointer(pPage)).FxCellSize = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) U16
+ f func(*libc.TLS, uintptr, uintptr) U16
}{cellSizePtr}))
pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt
if flagByte == (0x04 | 0x01) {
@@ -39938,15 +41320,15 @@ func decodeFlags(tls *crt.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite3
if (*MemPage)(unsafe.Pointer(pPage)).Fleaf != 0 {
(*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = U8(1)
(*MemPage)(unsafe.Pointer(pPage)).FxParseCell = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr, uintptr)
}{btreeParseCellPtr}))
} else {
(*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = U8(0)
(*MemPage)(unsafe.Pointer(pPage)).FxCellSize = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) U16
+ f func(*libc.TLS, uintptr, uintptr) U16
}{cellSizePtrNoPayload}))
(*MemPage)(unsafe.Pointer(pPage)).FxParseCell = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr, uintptr)
}{btreeParseCellPtrNoPayload}))
}
(*MemPage)(unsafe.Pointer(pPage)).FmaxLocal = (*BtShared)(unsafe.Pointer(pBt)).FmaxLeaf
@@ -39961,14 +41343,14 @@ func decodeFlags(tls *crt.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite3
(*MemPage)(unsafe.Pointer(pPage)).FintKey = U8(0)
(*MemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = U8(0)
(*MemPage)(unsafe.Pointer(pPage)).FxParseCell = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr, uintptr)
}{btreeParseCellPtrIndex}))
(*MemPage)(unsafe.Pointer(pPage)).FmaxLocal = (*BtShared)(unsafe.Pointer(pBt)).FmaxLocal
(*MemPage)(unsafe.Pointer(pPage)).FminLocal = (*BtShared)(unsafe.Pointer(pBt)).FminLocal
} else {
// EVIDENCE-OF: R-47608-56469 Any other value for the b-tree page type is
// an error.
- return Xsqlite3CorruptError(tls, 66196)
+ return Xsqlite3CorruptError(tls, 66341)
}
(*MemPage)(unsafe.Pointer(pPage)).Fmax1bytePayload = (*BtShared)(unsafe.Pointer(pBt)).Fmax1bytePayload
return 0
@@ -39976,7 +41358,7 @@ func decodeFlags(tls *crt.TLS, pPage uintptr, flagByte int32) int32 { /* sqlite3
// Compute the amount of freespace on the page. In other words, fill
// in the pPage->nFree field.
-func btreeComputeFreeSpace(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:66206:12: */
+func btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66351:12: */
var pc int32 // Address of a freeblock within pPage->aData[]
var hdr U8 // Offset to beginning of page header
var data uintptr // Equal to pPage->aData
@@ -40008,12 +41390,12 @@ func btreeComputeFreeSpace(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:662
if pc < top {
// EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will
// always be at least one cell before the first freeblock.
- return Xsqlite3CorruptError(tls, 66247)
+ return Xsqlite3CorruptError(tls, 66392)
}
for 1 != 0 {
if pc > iCellLast {
// Freeblock off the end of the page
- return Xsqlite3CorruptError(tls, 66252)
+ return Xsqlite3CorruptError(tls, 66397)
}
next = (U32((int32(*(*U8)(unsafe.Pointer((data + uintptr(pc)) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr(pc)) + uintptr(1))))))
size = (U32((int32(*(*U8)(unsafe.Pointer((data + uintptr((pc + 2))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((pc + 2))) + uintptr(1))))))
@@ -40025,11 +41407,11 @@ func btreeComputeFreeSpace(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:662
}
if next > U32(0) {
// Freeblock not in ascending order
- return Xsqlite3CorruptError(tls, 66262)
+ return Xsqlite3CorruptError(tls, 66407)
}
if (U32(pc) + size) > uint32(usableSize) {
// Last freeblock extends past page end
- return Xsqlite3CorruptError(tls, 66266)
+ return Xsqlite3CorruptError(tls, 66411)
}
}
@@ -40040,7 +41422,7 @@ func btreeComputeFreeSpace(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:662
// serves to verify that the offset to the start of the cell-content
// area, according to the page header, lies within the page.
if (nFree > usableSize) || (nFree < iCellFirst) {
- return Xsqlite3CorruptError(tls, 66278)
+ return Xsqlite3CorruptError(tls, 66423)
}
(*MemPage)(unsafe.Pointer(pPage)).FnFree = int32((U16(nFree - iCellFirst)))
return 0
@@ -40048,7 +41430,7 @@ func btreeComputeFreeSpace(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:662
// Do additional sanity check after btreeInitPage() if
// PRAGMA cell_size_check=ON
-func btreeCellSizeCheck(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:66288:28: */
+func btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66433:28: */
var iCellFirst int32 // First allowable cell or freeblock offset
var iCellLast int32 // Last possible cell or freeblock offset
var i int32 // Index into the cell pointer array
@@ -40070,12 +41452,12 @@ func btreeCellSizeCheck(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:66288:
pc = ((int32(*(*U8)(unsafe.Pointer((data + uintptr((cellOffset + (i * 2)))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((cellOffset + (i * 2)))) + uintptr(1)))))
if (pc < iCellFirst) || (pc > iCellLast) {
- return Xsqlite3CorruptError(tls, 66309)
+ return Xsqlite3CorruptError(tls, 66454)
}
- sz = int32((*(*func(*crt.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pPage + 120 /* &.xCellSize */))))(tls, pPage, (data + uintptr(pc))))
+ sz = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pPage + 120 /* &.xCellSize */))))(tls, pPage, (data + uintptr(pc))))
if (pc + sz) > usableSize {
- return Xsqlite3CorruptError(tls, 66314)
+ return Xsqlite3CorruptError(tls, 66459)
}
}
return 0
@@ -40088,7 +41470,7 @@ func btreeCellSizeCheck(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:66288:
// SQLITE_CORRUPT. Note that a return of SQLITE_OK does not
// guarantee that the page is well-formed. It only shows that
// we failed to detect any corruption.
-func btreeInitPage(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:66329:12: */
+func btreeInitPage(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:66474:12: */
var data uintptr // Equal to pPage->aData
var pBt uintptr // The main btree structure
@@ -40097,7 +41479,7 @@ func btreeInitPage(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:66329:12: *
// EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating
// the b-tree page type.
if decodeFlags(tls, pPage, int32(*(*U8)(unsafe.Pointer(data + uintptr(0))))) != 0 {
- return Xsqlite3CorruptError(tls, 66346)
+ return Xsqlite3CorruptError(tls, 66491)
}
(*MemPage)(unsafe.Pointer(pPage)).FmaskPage = (U16((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(1)))
@@ -40111,7 +41493,7 @@ func btreeInitPage(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:66329:12: *
(*MemPage)(unsafe.Pointer(pPage)).FnCell = (U16((int32(*(*U8)(unsafe.Pointer((data + uintptr(3)) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr(3)) + uintptr(1))))))
if U32((*MemPage)(unsafe.Pointer(pPage)).FnCell) > (((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(8)) / U32(6)) {
// To many cells for a single page. The page must be corrupt
- return Xsqlite3CorruptError(tls, 66360)
+ return Xsqlite3CorruptError(tls, 66505)
}
// EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only
@@ -40129,14 +41511,14 @@ func btreeInitPage(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:66329:12: *
// Set up a raw page so that it looks like a database page holding
// no entries.
-func zeroPage(tls *crt.TLS, pPage uintptr, flags int32) { /* sqlite3.c:66382:13: */
+func zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { /* sqlite3.c:66527:13: */
var data uintptr = (*MemPage)(unsafe.Pointer(pPage)).FaData
var pBt uintptr = (*MemPage)(unsafe.Pointer(pPage)).FpBt
var hdr U8 = (*MemPage)(unsafe.Pointer(pPage)).FhdrOffset
var first U16
if (int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & 0x000c) != 0 {
- crt.Xmemset(tls, (data + uintptr(hdr)), 0, (uint64((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(hdr))))
+ libc.Xmemset(tls, (data + uintptr(hdr)), 0, (uint64((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(hdr))))
}
*(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = uint8(int8(flags))
first = (U16(int32(hdr) + (func() int32 {
@@ -40145,7 +41527,7 @@ func zeroPage(tls *crt.TLS, pPage uintptr, flags int32) { /* sqlite3.c:66382:13:
}
return 8
}())))
- crt.Xmemset(tls, (data + uintptr((int32(hdr) + 1))), 0, uint64(4))
+ libc.Xmemset(tls, (data + uintptr((int32(hdr) + 1))), 0, uint64(4))
*(*uint8)(unsafe.Pointer(data + uintptr((int32(hdr) + 7)))) = uint8(0)
*(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 5))) + uintptr(0))) = (U8(((*BtShared)(unsafe.Pointer(pBt)).FusableSize) >> 8))
*(*uint8)(unsafe.Pointer((data + uintptr((int32(hdr) + 5))) + uintptr(1))) = U8((*BtShared)(unsafe.Pointer(pBt)).FusableSize)
@@ -40164,7 +41546,7 @@ func zeroPage(tls *crt.TLS, pPage uintptr, flags int32) { /* sqlite3.c:66382:13:
// Convert a DbPage obtained from the pager into a MemPage used by
// the btree layer.
-func btreePageFromDbPage(tls *crt.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr) uintptr { /* sqlite3.c:66419:16: */
+func btreePageFromDbPage(tls *libc.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr) uintptr { /* sqlite3.c:66564:16: */
var pPage uintptr = Xsqlite3PagerGetExtra(tls, pDbPage)
if pgno != (*MemPage)(unsafe.Pointer(pPage)).Fpgno {
(*MemPage)(unsafe.Pointer(pPage)).FaData = Xsqlite3PagerGetData(tls, pDbPage)
@@ -40191,7 +41573,7 @@ func btreePageFromDbPage(tls *crt.TLS, pDbPage uintptr, pgno Pgno, pBt uintptr)
// If in the future we call sqlite3PagerWrite() on this page, that
// means we have started to be concerned about content and the disk
// read should occur at that point.
-func btreeGetPage(tls *crt.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:66443:12: */
+func btreeGetPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:66588:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -40209,7 +41591,7 @@ func btreeGetPage(tls *crt.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags in
// Retrieve a page from the pager cache. If the requested page is not
// already in the pager cache return NULL. Initialize the MemPage.pBt and
// MemPage.aData elements if needed.
-func btreePageLookup(tls *crt.TLS, pBt uintptr, pgno Pgno) uintptr { /* sqlite3.c:66465:16: */
+func btreePageLookup(tls *libc.TLS, pBt uintptr, pgno Pgno) uintptr { /* sqlite3.c:66610:16: */
var pDbPage uintptr
pDbPage = Xsqlite3PagerLookup(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, pgno)
@@ -40221,13 +41603,12 @@ func btreePageLookup(tls *crt.TLS, pBt uintptr, pgno Pgno) uintptr { /* sqlite3.
// Return the size of the database file in pages. If there is any kind of
// error, return ((unsigned int)-1).
-func btreePagecount(tls *crt.TLS, pBt uintptr) Pgno { /* sqlite3.c:66479:13: */
-
+func btreePagecount(tls *libc.TLS, pBt uintptr) Pgno { /* sqlite3.c:66624:13: */
return (*BtShared)(unsafe.Pointer(pBt)).FnPage
}
-func Xsqlite3BtreeLastPage(tls *crt.TLS, p uintptr) U32 { /* sqlite3.c:66483:20: */
+func Xsqlite3BtreeLastPage(tls *libc.TLS, p uintptr) Pgno { /* sqlite3.c:66627:21: */
- return (btreePagecount(tls, (*Btree)(unsafe.Pointer(p)).FpBt) & Pgno(0x7fffffff))
+ return btreePagecount(tls, (*Btree)(unsafe.Pointer(p)).FpBt)
}
// Get a page from the pager and initialize it.
@@ -40241,7 +41622,7 @@ func Xsqlite3BtreeLastPage(tls *crt.TLS, p uintptr) U32 { /* sqlite3.c:66483:20:
//
// If an error occurs, then *ppPage is undefined. It
// may remain unchanged, or it may be set to an invalid value.
-func getAndInitPage(tls *crt.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur uintptr, bReadOnly int32) int32 { /* sqlite3.c:66501:12: */
+func getAndInitPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur uintptr, bReadOnly int32) int32 { /* sqlite3.c:66645:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -40251,7 +41632,7 @@ func getAndInitPage(tls *crt.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, pCur u
if !(pgno > btreePagecount(tls, pBt)) {
goto __1
}
- rc = Xsqlite3CorruptError(tls, 66516)
+ rc = Xsqlite3CorruptError(tls, 66660)
goto getAndInitPage_error1
__1:
;
@@ -40282,7 +41663,7 @@ __3:
if !((pCur != 0) && ((int32((*MemPage)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppPage))))).FnCell) < 1) || (int32((*MemPage)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppPage))))).FintKey) != int32((*BtCursor)(unsafe.Pointer(pCur)).FcurIntKey)))) {
goto __5
}
- rc = Xsqlite3CorruptError(tls, 66537)
+ rc = Xsqlite3CorruptError(tls, 66681)
goto getAndInitPage_error2
__5:
;
@@ -40306,16 +41687,16 @@ __6:
// call to btreeGetPage.
//
// Page1 is a special case and must be released using releasePageOne().
-func releasePageNotNull(tls *crt.TLS, pPage uintptr) { /* sqlite3.c:66560:13: */
+func releasePageNotNull(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:66704:13: */
Xsqlite3PagerUnrefNotNull(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
}
-func releasePage(tls *crt.TLS, pPage uintptr) { /* sqlite3.c:66569:13: */
+func releasePage(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:66713:13: */
if pPage != 0 {
releasePageNotNull(tls, pPage)
}
}
-func releasePageOne(tls *crt.TLS, pPage uintptr) { /* sqlite3.c:66572:13: */
+func releasePageOne(tls *libc.TLS, pPage uintptr) { /* sqlite3.c:66716:13: */
Xsqlite3PagerUnrefPageOne(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
}
@@ -40327,13 +41708,13 @@ func releasePageOne(tls *crt.TLS, pPage uintptr) { /* sqlite3.c:66572:13: */
// * If the page is already in use for some other purpose, immediately
// release it and return an SQLITE_CURRUPT error.
// * Make sure the isInit flag is clear
-func btreeGetUnusedPage(tls *crt.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:66592:12: */
+func btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, flags int32) int32 { /* sqlite3.c:66736:12: */
var rc int32 = btreeGetPage(tls, pBt, pgno, ppPage, flags)
if rc == 0 {
if Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > 1 {
releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage)))
*(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0)
- return Xsqlite3CorruptError(tls, 66603)
+ return Xsqlite3CorruptError(tls, 66747)
}
(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = U8(0)
} else {
@@ -40348,7 +41729,7 @@ func btreeGetUnusedPage(tls *crt.TLS, pBt uintptr, pgno Pgno, ppPage uintptr, fl
//
// This routine needs to reset the extra data section at the end of the
// page to agree with the restored data.
-func pageReinit(tls *crt.TLS, pData uintptr) { /* sqlite3.c:66621:13: */
+func pageReinit(tls *libc.TLS, pData uintptr) { /* sqlite3.c:66765:13: */
var pPage uintptr
pPage = Xsqlite3PagerGetExtra(tls, pData)
@@ -40368,10 +41749,10 @@ func pageReinit(tls *crt.TLS, pData uintptr) { /* sqlite3.c:66621:13: */
}
// Invoke the busy handler for a btree.
-func btreeInvokeBusyHandler(tls *crt.TLS, pArg uintptr) int32 { /* sqlite3.c:66643:12: */
+func btreeInvokeBusyHandler(tls *libc.TLS, pArg uintptr) int32 { /* sqlite3.c:66787:12: */
var pBt uintptr = pArg
- return Xsqlite3InvokeBusyHandler(tls, ((*BtShared)(unsafe.Pointer(pBt)).Fdb + 600 /* &.busyHandler */))
+ return Xsqlite3InvokeBusyHandler(tls, ((*BtShared)(unsafe.Pointer(pBt)).Fdb + 624 /* &.busyHandler */))
}
// Open a database file.
@@ -40393,7 +41774,7 @@ func btreeInvokeBusyHandler(tls *crt.TLS, pArg uintptr) int32 { /* sqlite3.c:666
// SQLITE_CONSTRAINT error. We cannot allow two or more BtShared
// objects in the same database connection since doing so will lead
// to problems with locking.
-func Xsqlite3BtreeOpen(tls *crt.TLS, pVfs uintptr, zFilename uintptr, db uintptr, ppBtree uintptr, flags int32, vfsFlags int32) int32 { /* sqlite3.c:66671:20: */
+func Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintptr, ppBtree uintptr, flags int32, vfsFlags int32) int32 { /* sqlite3.c:66815:20: */
bp := tls.Alloc(100)
defer tls.Free(100)
@@ -40424,8 +41805,8 @@ func Xsqlite3BtreeOpen(tls *crt.TLS, pVfs uintptr, zFilename uintptr, db uintptr
pBt = uintptr(0)
mutexOpen = uintptr(0)
rc = 0
- isTempDb = (crt.Bool32((zFilename == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(0)))) == 0)))
- isMemdb = (crt.Bool32((((zFilename != 0) && (crt.Xstrcmp(tls, zFilename, ts+3548 /* ":memory:" */) == 0)) ||
+ isTempDb = (libc.Bool32((zFilename == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer(zFilename + uintptr(0)))) == 0)))
+ isMemdb = (libc.Bool32((((zFilename != 0) && (libc.Xstrcmp(tls, zFilename, ts+5683 /* ":memory:" */) == 0)) ||
((isTempDb != 0) && (Xsqlite3TempInMemory(tls, db) != 0))) ||
((vfsFlags & 0x00000080) != 0)))
@@ -40444,7 +41825,7 @@ __1:
if !(((vfsFlags & 0x00000100) != 0) && ((isMemdb != 0) || (isTempDb != 0))) {
goto __2
}
- vfsFlags = ((vfsFlags & ^int32(crt.Int32FromInt32(0x00000100))) | 0x00000200)
+ vfsFlags = ((vfsFlags & ^int32(libc.Int32FromInt32(0x00000100))) | 0x00000200)
__2:
;
p = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Btree{})))
@@ -40487,7 +41868,7 @@ __6:
if !(isMemdb != 0) {
goto __7
}
- crt.Xmemcpy(tls, zFullPathname, zFilename, uint64(nFilename))
+ libc.Xmemcpy(tls, zFullPathname, zFilename, uint64(nFilename))
goto __8
__7:
rc = Xsqlite3OsFullPathname(tls, pVfs, zFilename,
@@ -40520,7 +41901,7 @@ __12:
goto __14
}
- if !((0 == crt.Xstrcmp(tls, zFullPathname, Xsqlite3PagerFilename(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, 0))) &&
+ if !((0 == libc.Xstrcmp(tls, zFullPathname, Xsqlite3PagerFilename(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, 0))) &&
(Xsqlite3PagerVfs(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager) == pVfs)) {
goto __15
}
@@ -40581,7 +41962,7 @@ __4:
__21:
;
rc = Xsqlite3PagerOpen(tls, pVfs, (pBt /* &.pPager */), zFilename,
- int32(unsafe.Sizeof(MemPage{})), flags, vfsFlags, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{pageReinit})))
+ int32(unsafe.Sizeof(MemPage{})), flags, vfsFlags, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{pageReinit})))
if !(rc == 0) {
goto __22
}
@@ -40597,7 +41978,9 @@ __23:
;
(*BtShared)(unsafe.Pointer(pBt)).FopenFlags = U8(flags)
(*BtShared)(unsafe.Pointer(pBt)).Fdb = db
- Xsqlite3PagerSetBusyHandler(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{btreeInvokeBusyHandler})), pBt)
+ Xsqlite3PagerSetBusyHandler(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{btreeInvokeBusyHandler})), pBt)
(*Btree)(unsafe.Pointer(p)).FpBt = pBt
(*BtShared)(unsafe.Pointer(pBt)).FpCursor = uintptr(0)
@@ -40710,7 +42093,7 @@ __33:
if !(i < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
goto __35
}
- if !(((crt.AssignUintptr(&pSib, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpBt)) != uintptr(0)) && ((*Btree)(unsafe.Pointer(pSib)).Fsharable != 0)) {
+ if !(((libc.AssignUintptr(&pSib, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpBt)) != uintptr(0)) && ((*Btree)(unsafe.Pointer(pSib)).Fsharable != 0)) {
goto __36
}
__37:
@@ -40812,13 +42195,13 @@ __49:
// remove the BtShared structure from the sharing list. Return
// true if the BtShared.nRef counter reaches zero and return
// false if it is still positive.
-func removeFromSharingList(tls *crt.TLS, pBt uintptr) int32 { /* sqlite3.c:66969:12: */
- var pMaster uintptr
+func removeFromSharingList(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67113:12: */
+ var pMainMtx uintptr
var pList uintptr
var removed int32 = 0
- pMaster = Xsqlite3MutexAlloc(tls, 2)
- Xsqlite3_mutex_enter(tls, pMaster)
+ pMainMtx = Xsqlite3MutexAlloc(tls, 2)
+ Xsqlite3_mutex_enter(tls, pMainMtx)
(*BtShared)(unsafe.Pointer(pBt)).FnRef--
if (*BtShared)(unsafe.Pointer(pBt)).FnRef <= 0 {
if Xsqlite3SharedCacheList == pBt {
@@ -40837,14 +42220,14 @@ func removeFromSharingList(tls *crt.TLS, pBt uintptr) int32 { /* sqlite3.c:66969
}
removed = 1
}
- Xsqlite3_mutex_leave(tls, pMaster)
+ Xsqlite3_mutex_leave(tls, pMainMtx)
return removed
}
// Make sure pBt->pTmpSpace points to an allocation of
// MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child
// pointer.
-func allocateTempSpace(tls *crt.TLS, pBt uintptr) { /* sqlite3.c:67008:13: */
+func allocateTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67152:13: */
if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace) != 0) {
(*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace = Xsqlite3PageMalloc(tls, int32((*BtShared)(unsafe.Pointer(pBt)).FpageSize))
@@ -40863,14 +42246,14 @@ func allocateTempSpace(tls *crt.TLS, pBt uintptr) { /* sqlite3.c:67008:13: */
// beginning of pTmpSpace as an area available to prepend the
// left-child pointer to the beginning of a cell.
if (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace != 0 {
- crt.Xmemset(tls, (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace, 0, uint64(8))
+ libc.Xmemset(tls, (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace, 0, uint64(8))
*(*uintptr)(unsafe.Pointer(pBt + 136 /* &.pTmpSpace */)) += (uintptr(4))
}
}
}
// Free the pBt->pTmpSpace allocation
-func freeTempSpace(tls *crt.TLS, pBt uintptr) { /* sqlite3.c:67037:13: */
+func freeTempSpace(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67181:13: */
if (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace != 0 {
*(*uintptr)(unsafe.Pointer(pBt + 136 /* &.pTmpSpace */)) -= (uintptr(4))
Xsqlite3PageFree(tls, (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace)
@@ -40879,7 +42262,7 @@ func freeTempSpace(tls *crt.TLS, pBt uintptr) { /* sqlite3.c:67037:13: */
}
// Close an open database and invalidate all cursors.
-func Xsqlite3BtreeClose(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:67048:20: */
+func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67192:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var pCur uintptr
@@ -40913,7 +42296,7 @@ func Xsqlite3BtreeClose(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:67048:20:
Xsqlite3PagerClose(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, (*Btree)(unsafe.Pointer(p)).Fdb)
if ((*BtShared)(unsafe.Pointer(pBt)).FxFreeSchema != 0) && ((*BtShared)(unsafe.Pointer(pBt)).FpSchema != 0) {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pBt + 80 /* &.xFreeSchema */))))(tls, (*BtShared)(unsafe.Pointer(pBt)).FpSchema)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pBt + 80 /* &.xFreeSchema */))))(tls, (*BtShared)(unsafe.Pointer(pBt)).FpSchema)
}
Xsqlite3DbFree(tls, uintptr(0), (*BtShared)(unsafe.Pointer(pBt)).FpSchema)
freeTempSpace(tls, pBt)
@@ -40936,7 +42319,7 @@ func Xsqlite3BtreeClose(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:67048:20:
// pages in the cache exceeds this soft limit. But the size of the
// cache is allowed to grow larger than this limit if it contains
// dirty pages or pages still in active use.
-func Xsqlite3BtreeSetCacheSize(tls *crt.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67110:20: */
+func Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67254:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
@@ -40953,7 +42336,7 @@ func Xsqlite3BtreeSetCacheSize(tls *crt.TLS, p uintptr, mxPage int32) int32 { /*
// The value returned is the current spill size. If zero is passed
// as an argument, no changes are made to the spill size setting, so
// using mxPage of 0 is a way to query the current spill size.
-func Xsqlite3BtreeSetSpillSize(tls *crt.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67129:20: */
+func Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67273:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var res int32
@@ -40965,7 +42348,7 @@ func Xsqlite3BtreeSetSpillSize(tls *crt.TLS, p uintptr, mxPage int32) int32 { /*
// Change the limit on the amount of the database file that may be
// memory mapped.
-func Xsqlite3BtreeSetMmapLimit(tls *crt.TLS, p uintptr, szMmap Sqlite3_int64) int32 { /* sqlite3.c:67144:20: */
+func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) int32 { /* sqlite3.c:67288:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
@@ -40980,7 +42363,7 @@ func Xsqlite3BtreeSetMmapLimit(tls *crt.TLS, p uintptr, szMmap Sqlite3_int64) in
// there is a high probability of damage) Level 2 is the default. There
// is a very low but non-zero probability of damage. Level 3 reduces the
// probability of damage to near zero but with a write performance reduction.
-func Xsqlite3BtreeSetPagerFlags(tls *crt.TLS, p uintptr, pgFlags uint32) int32 { /* sqlite3.c:67163:20: */
+func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32 { /* sqlite3.c:67307:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
@@ -41007,7 +42390,7 @@ func Xsqlite3BtreeSetPagerFlags(tls *crt.TLS, p uintptr, pgFlags uint32) int32 {
//
// If the iFix!=0 then the BTS_PAGESIZE_FIXED flag is set so that the page size
// and autovacuum mode can no longer be changed.
-func Xsqlite3BtreeSetPageSize(tls *crt.TLS, p uintptr, pageSize int32, nReserve int32, iFix int32) int32 { /* sqlite3.c:67196:20: */
+func Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve int32, iFix int32) int32 { /* sqlite3.c:67340:20: */
var rc int32 = 0
var x int32
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
@@ -41038,7 +42421,7 @@ func Xsqlite3BtreeSetPageSize(tls *crt.TLS, p uintptr, pageSize int32, nReserve
}
// Return the currently defined page size
-func Xsqlite3BtreeGetPageSize(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:67227:20: */
+func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67371:20: */
return int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpageSize)
}
@@ -41051,7 +42434,7 @@ func Xsqlite3BtreeGetPageSize(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:6722
// database handle that owns *p is not. In this case if sqlite3BtreeEnter()
// were to be called, it might collide with some other operation on the
// database handle that owns *p, causing undefined behavior.
-func Xsqlite3BtreeGetReserveNoMutex(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:67242:20: */
+func Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67386:20: */
var n int32
n = (int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpageSize - (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FusableSize))
@@ -41065,7 +42448,7 @@ func Xsqlite3BtreeGetReserveNoMutex(tls *crt.TLS, p uintptr) int32 { /* sqlite3.
// The value returned is the larger of the current reserve size and
// the latest reserve size requested by SQLITE_FILECTRL_RESERVE_BYTES.
// The amount of reserve can only grow - never shrink.
-func Xsqlite3BtreeGetRequestedReserve(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:67258:20: */
+func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67402:20: */
var n1 int32
var n2 int32
Xsqlite3BtreeEnter(tls, p)
@@ -41081,8 +42464,8 @@ func Xsqlite3BtreeGetRequestedReserve(tls *crt.TLS, p uintptr) int32 { /* sqlite
// Set the maximum page count for a database if mxPage is positive.
// No changes are made if mxPage is 0 or negative.
// Regardless of the value of mxPage, return the maximum page count.
-func Xsqlite3BtreeMaxPageCount(tls *crt.TLS, p uintptr, mxPage int32) int32 { /* sqlite3.c:67273:20: */
- var n int32
+func Xsqlite3BtreeMaxPageCount(tls *libc.TLS, p uintptr, mxPage Pgno) Pgno { /* sqlite3.c:67417:21: */
+ var n Pgno
Xsqlite3BtreeEnter(tls, p)
n = Xsqlite3PagerMaxPageCount(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager, mxPage)
Xsqlite3BtreeLeave(tls, p)
@@ -41105,7 +42488,7 @@ func Xsqlite3BtreeMaxPageCount(tls *crt.TLS, p uintptr, mxPage int32) int32 { /*
// With BTS_SECURE_DELETE, operation is like BTS_OVERWRITE with the addition
// that freelist leaf pages are written back into the database, increasing
// the amount of disk I/O.
-func Xsqlite3BtreeSecureDelete(tls *crt.TLS, p uintptr, newFlag int32) int32 { /* sqlite3.c:67299:20: */
+func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32 { /* sqlite3.c:67443:20: */
var b int32
if p == uintptr(0) {
return 0
@@ -41113,7 +42496,7 @@ func Xsqlite3BtreeSecureDelete(tls *crt.TLS, p uintptr, newFlag int32) int32 { /
Xsqlite3BtreeEnter(tls, p)
if newFlag >= 0 {
- *(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt + 40 /* &.btsFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x000c))))
+ *(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x000c))))
*(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt + 40 /* &.btsFlags */)) |= U16((0x0004 * newFlag))
}
b = ((int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & 0x000c) / 0x0004)
@@ -41125,7 +42508,7 @@ func Xsqlite3BtreeSecureDelete(tls *crt.TLS, p uintptr, newFlag int32) int32 { /
// parameter is non-zero, then auto-vacuum mode is enabled. If zero, it
// is disabled. The default value for the auto-vacuum property is
// determined by the SQLITE_DEFAULT_AUTOVACUUM macro.
-func Xsqlite3BtreeSetAutoVacuum(tls *crt.TLS, p uintptr, autoVacuum int32) int32 { /* sqlite3.c:67320:20: */
+func Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int32 { /* sqlite3.c:67464:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var rc int32 = 0
var av U8 = U8(autoVacuum)
@@ -41158,7 +42541,7 @@ func Xsqlite3BtreeSetAutoVacuum(tls *crt.TLS, p uintptr, autoVacuum int32) int32
// Return the value of the 'auto-vacuum' property. If auto-vacuum is
// enabled 1 is returned. Otherwise 0.
-func Xsqlite3BtreeGetAutoVacuum(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:67344:20: */
+func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67488:20: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
rc = func() int32 {
@@ -41176,27 +42559,6 @@ func Xsqlite3BtreeGetAutoVacuum(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:67
return rc
}
-// If the user has not set the safety-level for this database connection
-// using "PRAGMA synchronous", and if the safety-level is not already
-// set to the value passed to this function as the second parameter,
-// set it so.
-func setDefaultSyncFlag(tls *crt.TLS, pBt uintptr, safety_level U8) { /* sqlite3.c:67368:13: */
- var db uintptr
- var pDb uintptr
- if ((crt.AssignUintptr(&db, (*BtShared)(unsafe.Pointer(pBt)).Fdb)) != uintptr(0)) && ((crt.AssignUintptr(&pDb, (*Sqlite3)(unsafe.Pointer(db)).FaDb)) != uintptr(0)) {
- for ((*Db)(unsafe.Pointer(pDb)).FpBt == uintptr(0)) || ((*Btree)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpBt)).FpBt != pBt) {
- pDb += 32
- }
- if ((int32((*Db)(unsafe.Pointer(pDb)).FbSyncSet) == 0) &&
- (int32((*Db)(unsafe.Pointer(pDb)).Fsafety_level) != int32(safety_level))) &&
- (pDb != ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(1)*32)) {
- (*Db)(unsafe.Pointer(pDb)).Fsafety_level = safety_level
- Xsqlite3PagerSetFlags(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager,
- (uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x38)))))
- }
- }
-}
-
// Get a reference to pPage1 of the database file. This will
// also acquire a readlock on that file.
//
@@ -41204,7 +42566,7 @@ func setDefaultSyncFlag(tls *crt.TLS, pBt uintptr, safety_level U8) { /* sqlite3
// well-formed database file, then SQLITE_CORRUPT is returned.
// SQLITE_BUSY is returned if the database is locked. SQLITE_NOMEM
// is returned if we run out of memory.
-func lockBtree(tls *crt.TLS, pBt uintptr) int32 { /* sqlite3.c:67400:12: */
+func lockBtree(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67544:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -41240,9 +42602,9 @@ __2:
// Do some checking to help insure the file we opened really is
// a valid database file.
- nPage = crt.AssignUint32(&nPageHeader, Xsqlite3Get4byte(tls, (uintptr(28)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage1 */)))).FaData)))
+ nPage = libc.AssignUint32(&nPageHeader, Xsqlite3Get4byte(tls, (uintptr(28)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage1 */)))).FaData)))
Xsqlite3PagerPagecount(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, bp+8 /* &nPageFile */)
- if !((nPage == U32(0)) || (crt.Xmemcmp(tls, (uintptr(24)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage1 */)))).FaData), (uintptr(92)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage1 */)))).FaData), uint64(4)) != 0)) {
+ if !((nPage == U32(0)) || (libc.Xmemcmp(tls, (uintptr(24)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage1 */)))).FaData), (uintptr(92)+(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage1 */)))).FaData), uint64(4)) != 0)) {
goto __3
}
nPage = *(*U32)(unsafe.Pointer(bp + 8 /* nPageFile */))
@@ -41262,7 +42624,7 @@ __4:
// EVIDENCE-OF: R-43737-39999 Every valid SQLite database file begins
// with the following 16 bytes (in hex): 53 51 4c 69 74 65 20 66 6f 72 6d
// 61 74 20 33 00.
- if !(crt.Xmemcmp(tls, page1, uintptr(unsafe.Pointer(&zMagicHeader)), uint64(16)) != 0) {
+ if !(libc.Xmemcmp(tls, page1, uintptr(unsafe.Pointer(&zMagicHeader)), uint64(16)) != 0) {
goto __6
}
goto page1_init_failed
@@ -41300,7 +42662,7 @@ __8:
goto page1_init_failed
goto __12
__11:
- setDefaultSyncFlag(tls, pBt, (uint8(1 + 1)))
+ ;
if !(*(*int32)(unsafe.Pointer(bp + 12 /* isOpen */)) == 0) {
goto __13
}
@@ -41313,7 +42675,7 @@ __12:
rc = 26
goto __10
__9:
- setDefaultSyncFlag(tls, pBt, (uint8(2 + 1)))
+ ;
__10:
;
@@ -41322,7 +42684,7 @@ __10:
//
// The original design allowed these amounts to vary, but as of
// version 3.6.0, we require them to be fixed.
- if !(crt.Xmemcmp(tls, (page1+uintptr(21)), ts+3557 /* "@ " */, uint64(3)) != 0) {
+ if !(libc.Xmemcmp(tls, (page1+uintptr(21)), ts+5692 /* "@ " */, uint64(3)) != 0) {
goto __14
}
goto page1_init_failed
@@ -41372,7 +42734,7 @@ __16:
if !((Xsqlite3WritableSchema(tls, (*BtShared)(unsafe.Pointer(pBt)).Fdb) == 0) && (nPage > *(*U32)(unsafe.Pointer(bp + 8 /* nPageFile */)))) {
goto __17
}
- rc = Xsqlite3CorruptError(tls, 67525)
+ rc = Xsqlite3CorruptError(tls, 67669)
goto page1_init_failed
__17:
;
@@ -41444,7 +42806,7 @@ page1_init_failed:
// has the effect of releasing the read lock.
//
// If there is a transaction in progress, this routine is a no-op.
-func unlockBtreeIfUnused(tls *crt.TLS, pBt uintptr) { /* sqlite3.c:67607:13: */
+func unlockBtreeIfUnused(tls *libc.TLS, pBt uintptr) { /* sqlite3.c:67751:13: */
if (int32((*BtShared)(unsafe.Pointer(pBt)).FinTransaction) == 0) && ((*BtShared)(unsafe.Pointer(pBt)).FpPage1 != uintptr(0)) {
var pPage1 uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpPage1
@@ -41457,7 +42819,7 @@ func unlockBtreeIfUnused(tls *crt.TLS, pBt uintptr) { /* sqlite3.c:67607:13: */
// If pBt points to an empty file then convert that empty file
// into a new empty database by initializing the first page of
// the database.
-func newDatabase(tls *crt.TLS, pBt uintptr) int32 { /* sqlite3.c:67624:12: */
+func newDatabase(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:67768:12: */
var pP1 uintptr
var data uintptr
var rc int32
@@ -41472,7 +42834,7 @@ func newDatabase(tls *crt.TLS, pBt uintptr) int32 { /* sqlite3.c:67624:12: */
if rc != 0 {
return rc
}
- crt.Xmemcpy(tls, data, uintptr(unsafe.Pointer(&zMagicHeader)), uint64(unsafe.Sizeof(zMagicHeader)))
+ libc.Xmemcpy(tls, data, uintptr(unsafe.Pointer(&zMagicHeader)), uint64(unsafe.Sizeof(zMagicHeader)))
*(*uint8)(unsafe.Pointer(data + uintptr(16))) = (U8(((*BtShared)(unsafe.Pointer(pBt)).FpageSize >> 8) & U32(0xff)))
*(*uint8)(unsafe.Pointer(data + uintptr(17))) = (U8(((*BtShared)(unsafe.Pointer(pBt)).FpageSize >> 16) & U32(0xff)))
@@ -41483,7 +42845,7 @@ func newDatabase(tls *crt.TLS, pBt uintptr) int32 { /* sqlite3.c:67624:12: */
*(*uint8)(unsafe.Pointer(data + uintptr(21))) = uint8(64)
*(*uint8)(unsafe.Pointer(data + uintptr(22))) = uint8(32)
*(*uint8)(unsafe.Pointer(data + uintptr(23))) = uint8(32)
- crt.Xmemset(tls, (data + uintptr(24)), 0, (uint64(100 - 24)))
+ libc.Xmemset(tls, (data + uintptr(24)), 0, (uint64(100 - 24)))
zeroPage(tls, pP1, ((0x01 | 0x08) | 0x04))
*(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) |= U16((0x0002))
@@ -41497,7 +42859,7 @@ func newDatabase(tls *crt.TLS, pBt uintptr) int32 { /* sqlite3.c:67624:12: */
// Initialize the first page of the database file (creating a database
// consisting of a single page and no schema objects). Return SQLITE_OK
// if successful, or an SQLite error code otherwise.
-func Xsqlite3BtreeNewDb(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:67668:20: */
+func Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:67812:20: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
(*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FnPage = U32(0)
@@ -41539,7 +42901,7 @@ func Xsqlite3BtreeNewDb(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:67668:20:
// no progress. By returning SQLITE_BUSY and not invoking the busy callback
// when A already has a read lock, we encourage A to give up and let B
// proceed.
-func Xsqlite3BtreeBeginTrans(tls *crt.TLS, p uintptr, wrflag int32, pSchemaVersion uintptr) int32 { /* sqlite3.c:67712:20: */
+func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uintptr) int32 { /* sqlite3.c:67856:20: */
var pBt uintptr
var pPager uintptr
var rc int32
@@ -41566,7 +42928,7 @@ __1:
(int32(Xsqlite3PagerIsreadonly(tls, pPager)) == 0)) {
goto __2
}
- *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0001))))
+ *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0001))))
__2:
;
@@ -41636,7 +42998,7 @@ __11:
__12:
;
- *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0010))))
+ *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0010))))
if !((*BtShared)(unsafe.Pointer(pBt)).FnPage == U32(0)) {
goto __13
}
@@ -41653,7 +43015,7 @@ __14:
// file is not pBt->pageSize. In this case lockBtree() will update
// pBt->pageSize to the page-size of the file on disk.
__17:
- if !(((*BtShared)(unsafe.Pointer(pBt)).FpPage1 == uintptr(0)) && (0 == (crt.AssignInt32(&rc, lockBtree(tls, pBt))))) {
+ if !(((*BtShared)(unsafe.Pointer(pBt)).FpPage1 == uintptr(0)) && (0 == (libc.AssignInt32(&rc, lockBtree(tls, pBt))))) {
goto __18
}
goto __17
@@ -41669,7 +43031,7 @@ __18:
rc = 8
goto __21
__20:
- rc = Xsqlite3PagerBegin(tls, pPager, (crt.Bool32(wrflag > 1)), Xsqlite3TempInMemory(tls, (*Btree)(unsafe.Pointer(p)).Fdb))
+ rc = Xsqlite3PagerBegin(tls, pPager, (libc.Bool32(wrflag > 1)), Xsqlite3TempInMemory(tls, (*Btree)(unsafe.Pointer(p)).Fdb))
if !(rc == 0) {
goto __22
}
@@ -41744,7 +43106,7 @@ __29:
pPage1 = (*BtShared)(unsafe.Pointer(pBt)).FpPage1
(*BtShared)(unsafe.Pointer(pBt)).FpWriter = p
- *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0040))))
+ *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0040))))
if !(wrflag > 1) {
goto __31
}
@@ -41803,7 +43165,7 @@ __34:
// Set the pointer-map entries for all children of page pPage. Also, if
// pPage contains cells that point to overflow pages, set the pointer
// map entries for the overflow pages as well.
-func setChildPtrmaps(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:67892:12: */
+func setChildPtrmaps(tls *libc.TLS, pPage uintptr) int32 { /* sqlite3.c:68036:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -41855,14 +43217,14 @@ func setChildPtrmaps(tls *crt.TLS, pPage uintptr) int32 { /* sqlite3.c:67892:12:
//
// PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next
// overflow page in the list.
-func modifyPagePointer(tls *crt.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType U8) int32 { /* sqlite3.c:67937:12: */
+func modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType U8) int32 { /* sqlite3.c:68081:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
if int32(eType) == 4 {
// The pointer is always the first 4 bytes of the page in this case.
if Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData) != iFrom {
- return Xsqlite3CorruptError(tls, 67943)
+ return Xsqlite3CorruptError(tls, 68087)
}
Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(pPage)).FaData, iTo)
} else {
@@ -41885,10 +43247,10 @@ func modifyPagePointer(tls *crt.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType
if int32(eType) == 3 {
// var info CellInfo at bp, 24
- (*(*func(*crt.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, pCell, bp /* &info */)
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, pCell, bp /* &info */)
if U32((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnLocal) < (*CellInfo)(unsafe.Pointer(bp /* &info */)).FnPayload {
if (pCell + uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize)) > ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)) {
- return Xsqlite3CorruptError(tls, 67962)
+ return Xsqlite3CorruptError(tls, 68106)
}
if iFrom == Xsqlite3Get4byte(tls, ((pCell+uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize))-uintptr(4))) {
Xsqlite3Put4byte(tls, ((pCell + uintptr((*CellInfo)(unsafe.Pointer(bp /* &info */)).FnSize)) - uintptr(4)), iTo)
@@ -41905,7 +43267,7 @@ func modifyPagePointer(tls *crt.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType
if i == nCell {
if (int32(eType) != 5) || (Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData+uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)+8)))) != iFrom) {
- return Xsqlite3CorruptError(tls, 67980)
+ return Xsqlite3CorruptError(tls, 68124)
}
Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8))), iTo)
}
@@ -41920,7 +43282,7 @@ func modifyPagePointer(tls *crt.TLS, pPage uintptr, iFrom Pgno, iTo Pgno, eType
// the journal needs to be sync()ed before database page pDbPage->pgno
// can be written to. The caller has already promised not to write to that
// page.
-func relocatePage(tls *crt.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPage Pgno, iFreePage Pgno, isCommit int32) int32 { /* sqlite3.c:67998:12: */
+func relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPage Pgno, iFreePage Pgno, isCommit int32) int32 { /* sqlite3.c:68142:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -41931,7 +43293,7 @@ func relocatePage(tls *crt.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPage
// var rc int32 at bp, 4
if iDbPage < Pgno(3) {
- return Xsqlite3CorruptError(tls, 68015)
+ return Xsqlite3CorruptError(tls, 68159)
}
// Move page iDbPage from its current location to page number iFreePage
@@ -42001,7 +43363,7 @@ func relocatePage(tls *crt.TLS, pBt uintptr, pDbPage uintptr, eType U8, iPtrPage
// caller will keep calling incrVacuumStep() until it returns SQLITE_DONE
// or an error. bCommit is passed true for an auto-vacuum-on-commit
// operation, or false for an incremental vacuum.
-func incrVacuumStep(tls *crt.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit int32) int32 { /* sqlite3.c:68092:12: */
+func incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit int32) int32 { /* sqlite3.c:68236:12: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -42023,7 +43385,7 @@ func incrVacuumStep(tls *crt.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit
return rc
}
if int32(*(*U8)(unsafe.Pointer(bp /* eType */))) == 1 {
- return Xsqlite3CorruptError(tls, 68113)
+ return Xsqlite3CorruptError(tls, 68257)
}
if int32(*(*U8)(unsafe.Pointer(bp /* eType */))) == 2 {
@@ -42098,7 +43460,7 @@ func incrVacuumStep(tls *crt.TLS, pBt uintptr, nFin Pgno, iLastPg Pgno, bCommit
// The database opened by the first argument is an auto-vacuum database
// nOrig pages in size containing nFree free pages. Return the expected
// size of the database in pages following an auto-vacuum operation.
-func finalDbSize(tls *crt.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno { /* sqlite3.c:68188:13: */
+func finalDbSize(tls *libc.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno { /* sqlite3.c:68332:13: */
var nEntry int32 // Number of entries on one ptrmap page
var nPtrmap Pgno // Number of PtrMap pages to be freed
var nFin Pgno // Return value
@@ -42122,7 +43484,7 @@ func finalDbSize(tls *crt.TLS, pBt uintptr, nOrig Pgno, nFree Pgno) Pgno { /* sq
// If the incremental vacuum is finished after this function has run,
// SQLITE_DONE is returned. If it is not finished, but no error occurred,
// SQLITE_OK is returned. Otherwise an SQLite error code.
-func Xsqlite3BtreeIncrVacuum(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:68214:20: */
+func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68358:20: */
var rc int32
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
@@ -42135,8 +43497,8 @@ func Xsqlite3BtreeIncrVacuum(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:68214
var nFree Pgno = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + uintptr(36)))
var nFin Pgno = finalDbSize(tls, pBt, nOrig, nFree)
- if nOrig < nFin {
- rc = Xsqlite3CorruptError(tls, 68228)
+ if (nOrig < nFin) || (nFree >= nOrig) {
+ rc = Xsqlite3CorruptError(tls, 68372)
} else if nFree > Pgno(0) {
rc = saveAllCursors(tls, pBt, uint32(0), uintptr(0))
if rc == 0 {
@@ -42162,7 +43524,7 @@ func Xsqlite3BtreeIncrVacuum(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:68214
// the database file should be truncated to during the commit process.
// i.e. the database has been reorganized so that only the first *pnTrunc
// pages are in use.
-func autoVacuumCommit(tls *crt.TLS, pBt uintptr) int32 { /* sqlite3.c:68256:12: */
+func autoVacuumCommit(tls *libc.TLS, pBt uintptr) int32 { /* sqlite3.c:68400:12: */
var rc int32 = 0
var pPager uintptr = (*BtShared)(unsafe.Pointer(pBt)).FpPager
@@ -42179,13 +43541,13 @@ func autoVacuumCommit(tls *crt.TLS, pBt uintptr) int32 { /* sqlite3.c:68256:12:
// It is not possible to create a database for which the final page
// is either a pointer-map page or the pending-byte page. If one
// is encountered, this indicates corruption.
- return Xsqlite3CorruptError(tls, 68276)
+ return Xsqlite3CorruptError(tls, 68420)
}
nFree = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + uintptr(36)))
nFin = finalDbSize(tls, pBt, nOrig, nFree)
if nFin > nOrig {
- return Xsqlite3CorruptError(tls, 68281)
+ return Xsqlite3CorruptError(tls, 68425)
}
if nFin < nOrig {
rc = saveAllCursors(tls, pBt, uint32(0), uintptr(0))
@@ -42223,17 +43585,17 @@ func autoVacuumCommit(tls *crt.TLS, pBt uintptr) int32 { /* sqlite3.c:68256:12:
//
// This call is a no-op if no write-transaction is currently active on pBt.
//
-// Otherwise, sync the database file for the btree pBt. zMaster points to
-// the name of a master journal file that should be written into the
-// individual journal file, or is NULL, indicating no master journal file
+// Otherwise, sync the database file for the btree pBt. zSuperJrnl points to
+// the name of a super-journal file that should be written into the
+// individual journal file, or is NULL, indicating no super-journal file
// (single database transaction).
//
-// When this is called, the master journal should already have been
+// When this is called, the super-journal should already have been
// created, populated with this journal pointer and synced to disk.
//
// Once this is routine has returned, the only thing required to commit
// the write-transaction for this database file is to delete the journal.
-func Xsqlite3BtreeCommitPhaseOne(tls *crt.TLS, p uintptr, zMaster uintptr) int32 { /* sqlite3.c:68335:20: */
+func Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) int32 { /* sqlite3.c:68479:20: */
var rc int32 = 0
if int32((*Btree)(unsafe.Pointer(p)).FinTrans) == 2 {
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
@@ -42248,7 +43610,7 @@ func Xsqlite3BtreeCommitPhaseOne(tls *crt.TLS, p uintptr, zMaster uintptr) int32
if (*BtShared)(unsafe.Pointer(pBt)).FbDoTruncate != 0 {
Xsqlite3PagerTruncateImage(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, (*BtShared)(unsafe.Pointer(pBt)).FnPage)
}
- rc = Xsqlite3PagerCommitPhaseOne(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, zMaster, 0)
+ rc = Xsqlite3PagerCommitPhaseOne(tls, (*BtShared)(unsafe.Pointer(pBt)).FpPager, zSuperJrnl, 0)
Xsqlite3BtreeLeave(tls, p)
}
return rc
@@ -42256,7 +43618,7 @@ func Xsqlite3BtreeCommitPhaseOne(tls *crt.TLS, p uintptr, zMaster uintptr) int32
// This function is called from both BtreeCommitPhaseTwo() and BtreeRollback()
// at the conclusion of a transaction.
-func btreeEndTransaction(tls *crt.TLS, p uintptr) { /* sqlite3.c:68362:13: */
+func btreeEndTransaction(tls *libc.TLS, p uintptr) { /* sqlite3.c:68506:13: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var db uintptr = (*Btree)(unsafe.Pointer(p)).Fdb
@@ -42304,7 +43666,7 @@ func btreeEndTransaction(tls *crt.TLS, p uintptr) { /* sqlite3.c:68362:13: */
// the upper layer will attempt a rollback. However, if the second argument
// is non-zero then this b-tree transaction is part of a multi-file
// transaction. In this case, the transaction has already been committed
-// (by deleting a master journal file) and the caller will ignore this
+// (by deleting a super-journal file) and the caller will ignore this
// functions return code. So, even if an error occurs in the pager layer,
// reset the b-tree objects internal state to indicate that the write
// transaction has been closed. This is quite safe, as the pager will have
@@ -42312,7 +43674,7 @@ func btreeEndTransaction(tls *crt.TLS, p uintptr) { /* sqlite3.c:68362:13: */
//
// This will release the write lock on the database file. If there
// are no active cursors, it also releases the read lock.
-func Xsqlite3BtreeCommitPhaseTwo(tls *crt.TLS, p uintptr, bCleanup int32) int32 { /* sqlite3.c:68424:20: */
+func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32 { /* sqlite3.c:68568:20: */
if int32((*Btree)(unsafe.Pointer(p)).FinTrans) == 0 {
return 0
@@ -42341,7 +43703,7 @@ func Xsqlite3BtreeCommitPhaseTwo(tls *crt.TLS, p uintptr, bCleanup int32) int32
}
// Do both phases of a commit.
-func Xsqlite3BtreeCommit(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:68456:20: */
+func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:68600:20: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
rc = Xsqlite3BtreeCommitPhaseOne(tls, p, uintptr(0))
@@ -42376,7 +43738,7 @@ func Xsqlite3BtreeCommit(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:68456:20:
//
// SQLITE_OK is returned if successful, or if an error occurs while
// saving a cursor position, an SQLite error code.
-func Xsqlite3BtreeTripAllCursors(tls *crt.TLS, pBtree uintptr, errCode int32, writeOnly int32) int32 { /* sqlite3.c:68493:20: */
+func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, writeOnly int32) int32 { /* sqlite3.c:68637:20: */
var p uintptr
var rc int32 = 0
@@ -42405,7 +43767,7 @@ func Xsqlite3BtreeTripAllCursors(tls *crt.TLS, pBtree uintptr, errCode int32, wr
// Set the pBt->nPage field correctly, according to the current
// state of the database. Assume pBt->pPage1 is valid.
-func btreeSetNPage(tls *crt.TLS, pBt uintptr, pPage1 uintptr) { /* sqlite3.c:68525:13: */
+func btreeSetNPage(tls *libc.TLS, pBt uintptr, pPage1 uintptr) { /* sqlite3.c:68669:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -42427,7 +43789,7 @@ func btreeSetNPage(tls *crt.TLS, pBt uintptr, pPage1 uintptr) { /* sqlite3.c:685
//
// This will release the write lock on the database file. If there
// are no active cursors, it also releases the read lock.
-func Xsqlite3BtreeRollback(tls *crt.TLS, p uintptr, tripCode int32, writeOnly int32) int32 { /* sqlite3.c:68544:20: */
+func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly int32) int32 { /* sqlite3.c:68688:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -42437,7 +43799,7 @@ func Xsqlite3BtreeRollback(tls *crt.TLS, p uintptr, tripCode int32, writeOnly in
Xsqlite3BtreeEnter(tls, p)
if tripCode == 0 {
- rc = crt.AssignInt32(&tripCode, saveAllCursors(tls, pBt, uint32(0), uintptr(0)))
+ rc = libc.AssignInt32(&tripCode, saveAllCursors(tls, pBt, uint32(0), uintptr(0)))
if rc != 0 {
writeOnly = 0
}
@@ -42493,7 +43855,7 @@ func Xsqlite3BtreeRollback(tls *crt.TLS, p uintptr, tripCode int32, writeOnly in
// are no active savepoints and no other statement-transactions open,
// iStatement is 1. This anonymous savepoint can be released or rolled back
// using the sqlite3BtreeSavepoint() function.
-func Xsqlite3BtreeBeginStmt(tls *crt.TLS, p uintptr, iStatement int32) int32 { /* sqlite3.c:68609:20: */
+func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32 { /* sqlite3.c:68753:20: */
var rc int32
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
@@ -42517,7 +43879,7 @@ func Xsqlite3BtreeBeginStmt(tls *crt.TLS, p uintptr, iStatement int32) int32 { /
// contents of the entire transaction are rolled back. This is different
// from a normal transaction rollback, as no locks are released and the
// transaction remains open.
-func Xsqlite3BtreeSavepoint(tls *crt.TLS, p uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:68640:20: */
+func Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:68784:20: */
var rc int32 = 0
if (p != 0) && (int32((*Btree)(unsafe.Pointer(p)).FinTrans) == 2) {
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
@@ -42584,7 +43946,7 @@ func Xsqlite3BtreeSavepoint(tls *crt.TLS, p uintptr, op int32, iSavepoint int32)
//
// It is assumed that the sqlite3BtreeCursorZero() has been called
// on pCur to initialize the memory space prior to invoking this routine.
-func btreeCursor(tls *crt.TLS, p uintptr, iTable int32, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:68711:12: */
+func btreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:68855:12: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt // Shared b-tree handle
var pX uintptr // Looping over other all cursors
@@ -42601,18 +43963,18 @@ func btreeCursor(tls *crt.TLS, p uintptr, iTable int32, wrFlag int32, pKeyInfo u
return 7
}
}
- if iTable <= 1 {
- if iTable < 1 {
- return Xsqlite3CorruptError(tls, 68747)
+ if iTable <= Pgno(1) {
+ if iTable < Pgno(1) {
+ return Xsqlite3CorruptError(tls, 68891)
} else if btreePagecount(tls, pBt) == Pgno(0) {
- iTable = 0
+ iTable = Pgno(0)
}
}
// Now that no other errors can occur, finish filling in the BtCursor
// variables and link the cursor into the BtShared list.
- (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot = Pgno(iTable)
+ (*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot = iTable
(*BtCursor)(unsafe.Pointer(pCur)).FiPage = int8(-1)
(*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo = pKeyInfo
(*BtCursor)(unsafe.Pointer(pCur)).FpBtree = p
@@ -42632,7 +43994,7 @@ func btreeCursor(tls *crt.TLS, p uintptr, iTable int32, wrFlag int32, pKeyInfo u
// If there are two or more cursors on the same btree, then all such
// cursors *must* have the BTCF_Multiple flag set.
for pX = (*BtShared)(unsafe.Pointer(pBt)).FpCursor; pX != 0; pX = (*BtCursor)(unsafe.Pointer(pX)).FpNext {
- if (*BtCursor)(unsafe.Pointer(pX)).FpgnoRoot == Pgno(iTable) {
+ if (*BtCursor)(unsafe.Pointer(pX)).FpgnoRoot == iTable {
*(*U8)(unsafe.Pointer(pX + 1 /* &.curFlags */)) |= U8((0x20))
*(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((0x20))
}
@@ -42642,14 +44004,14 @@ func btreeCursor(tls *crt.TLS, p uintptr, iTable int32, wrFlag int32, pKeyInfo u
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(1)
return 0
}
-func btreeCursorWithLock(tls *crt.TLS, p uintptr, iTable int32, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:68776:12: */
+func btreeCursorWithLock(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:68920:12: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
rc = btreeCursor(tls, p, iTable, wrFlag, pKeyInfo, pCur)
Xsqlite3BtreeLeave(tls, p)
return rc
}
-func Xsqlite3BtreeCursor(tls *crt.TLS, p uintptr, iTable int32, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:68789:20: */
+func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32 { /* sqlite3.c:68933:20: */
if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 {
return btreeCursorWithLock(tls, p, iTable, wrFlag, pKeyInfo, pCur)
} else {
@@ -42664,8 +44026,8 @@ func Xsqlite3BtreeCursor(tls *crt.TLS, p uintptr, iTable int32, wrFlag int32, pK
// sufficient storage to hold a cursor. The BtCursor object is opaque
// to users so they cannot do the sizeof() themselves - they must call
// this routine.
-func Xsqlite3BtreeCursorSize(tls *crt.TLS) int32 { /* sqlite3.c:68811:20: */
- return (int32(((uint64(unsafe.Sizeof(BtCursor{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))))
+func Xsqlite3BtreeCursorSize(tls *libc.TLS) int32 { /* sqlite3.c:68955:20: */
+ return (int32(((uint64(unsafe.Sizeof(BtCursor{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))))
}
// Initialize memory that will be converted into a BtCursor object.
@@ -42674,13 +44036,13 @@ func Xsqlite3BtreeCursorSize(tls *crt.TLS) int32 { /* sqlite3.c:68811:20: */
// to zero. But it turns out that the apPage[] and aiIdx[] arrays
// do not need to be zeroed and they are large, so we can save a lot
// of run-time by skipping the initialization of those elements.
-func Xsqlite3BtreeCursorZero(tls *crt.TLS, p uintptr) { /* sqlite3.c:68823:21: */
- crt.Xmemset(tls, p, 0, uint64((uintptr(0) + 32 /* &.pBt */)))
+func Xsqlite3BtreeCursorZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:68967:21: */
+ libc.Xmemset(tls, p, 0, uint64((uintptr(0) + 32 /* &.pBt */)))
}
// Close a cursor. The read lock on the database file is released
// when the last cursor is closed.
-func Xsqlite3BtreeCloseCursor(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:68831:20: */
+func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:68975:20: */
var pBtree uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBtree
if pBtree != 0 {
var pBt uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBt
@@ -42714,7 +44076,7 @@ func Xsqlite3BtreeCloseCursor(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:6
//
// BtCursor.info is a cache of the information in the current cell.
// Using this cache reduces the number of calls to btreeParseCell().
-func getCellInfo(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:68885:29: */
+func getCellInfo(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69029:29: */
if int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize) == 0 {
*(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((0x02))
btreeParseCell(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage, int32((*BtCursor)(unsafe.Pointer(pCur)).Fix), (pCur + 48 /* &.info */))
@@ -42722,29 +44084,37 @@ func getCellInfo(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:68885:29: */
}
}
-func Xsqlite3BtreeCursorIsValidNN(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:68904:20: */
+func Xsqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69048:20: */
- return (crt.Bool32(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == 0))
+ return (libc.Bool32(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == 0))
}
// Return the value of the integer key or "rowid" for a table btree.
// This routine is only valid for a cursor that is pointing into a
// ordinary table btree. If the cursor points to an index btree or
// is invalid, the result of this routine is undefined.
-func Xsqlite3BtreeIntegerKey(tls *crt.TLS, pCur uintptr) I64 { /* sqlite3.c:68915:20: */
+func Xsqlite3BtreeIntegerKey(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:69059:20: */
getCellInfo(tls, pCur)
return (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey
}
// Pin or unpin a cursor.
-func Xsqlite3BtreeCursorPin(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:68926:21: */
+func Xsqlite3BtreeCursorPin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69070:21: */
*(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((0x40))
}
-func Xsqlite3BtreeCursorUnpin(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:68930:21: */
+func Xsqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69074:21: */
+
+ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(0x40))))
+}
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(0x40))))
+// Return the offset into the database file for the start of the
+// payload to which the cursor is pointing.
+func Xsqlite3BtreeOffset(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:69084:20: */
+
+ getCellInfo(tls, pCur)
+ return ((I64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize) * (I64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).Fpgno) - int64(1))) + (I64((int64((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload) - int64((*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FaData)) / 1)))
}
// Return the number of bytes of payload for the entry that pCur is
@@ -42754,7 +44124,7 @@ func Xsqlite3BtreeCursorUnpin(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:68930:2
// The caller must guarantee that the cursor is pointing to a non-NULL
// valid entry. In other words, the calling procedure must guarantee
// that the cursor has Cursor.eState==CURSOR_VALID.
-func Xsqlite3BtreePayloadSize(tls *crt.TLS, pCur uintptr) U32 { /* sqlite3.c:68958:20: */
+func Xsqlite3BtreePayloadSize(tls *libc.TLS, pCur uintptr) U32 { /* sqlite3.c:69102:20: */
getCellInfo(tls, pCur)
return (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnPayload
@@ -42771,7 +44141,7 @@ func Xsqlite3BtreePayloadSize(tls *crt.TLS, pCur uintptr) U32 { /* sqlite3.c:689
//
// The current implementation merely returns the size of the underlying
// database file.
-func Xsqlite3BtreeMaxRecordSize(tls *crt.TLS, pCur uintptr) Sqlite3_int64 { /* sqlite3.c:68978:30: */
+func Xsqlite3BtreeMaxRecordSize(tls *libc.TLS, pCur uintptr) Sqlite3_int64 { /* sqlite3.c:69122:30: */
return (Sqlite3_int64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize) * Sqlite3_int64((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage))
}
@@ -42793,7 +44163,7 @@ func Xsqlite3BtreeMaxRecordSize(tls *crt.TLS, pCur uintptr) Sqlite3_int64 { /* s
// on *ppPage to free the reference. In no reference was obtained (because
// the pointer-map was used to obtain the value for *pPgnoNext), then
// *ppPage is set to zero.
-func getOverflowPage(tls *crt.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgnoNext uintptr) int32 { /* sqlite3.c:69003:12: */
+func getOverflowPage(tls *libc.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgnoNext uintptr) int32 { /* sqlite3.c:69147:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -42861,17 +44231,17 @@ func getOverflowPage(tls *crt.TLS, pBt uintptr, ovfl Pgno, ppPage uintptr, pPgno
// of data are copied from the buffer pBuf to pPayload.
//
// SQLITE_OK is returned on success, otherwise an error code.
-func copyPayload(tls *crt.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp int32, pDbPage uintptr) int32 { /* sqlite3.c:69071:12: */
+func copyPayload(tls *libc.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp int32, pDbPage uintptr) int32 { /* sqlite3.c:69215:12: */
if eOp != 0 {
// Copy data from buffer to page (a write operation)
var rc int32 = Xsqlite3PagerWrite(tls, pDbPage)
if rc != 0 {
return rc
}
- crt.Xmemcpy(tls, pPayload, pBuf, uint64(nByte))
+ libc.Xmemcpy(tls, pPayload, pBuf, uint64(nByte))
} else {
// Copy data from page to buffer (a read operation)
- crt.Xmemcpy(tls, pBuf, pPayload, uint64(nByte))
+ libc.Xmemcpy(tls, pBuf, pPayload, uint64(nByte))
}
return 0
}
@@ -42903,7 +44273,7 @@ func copyPayload(tls *crt.TLS, pPayload uintptr, pBuf uintptr, nByte int32, eOp
// * An incremental vacuum,
// * A commit in auto_vacuum="full" mode,
// * Creating a table (may require moving an overflow page).
-func accessPayload(tls *crt.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr, eOp int32) int32 { /* sqlite3.c:69121:12: */
+func accessPayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr, eOp int32) int32 { /* sqlite3.c:69265:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -42921,7 +44291,7 @@ func accessPayload(tls *crt.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr
// conditional above is really:
// &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize]
// but is recast into its current form to avoid integer overflow problems
- return Xsqlite3CorruptError(tls, 69154)
+ return Xsqlite3CorruptError(tls, 69298)
}
// Check if data must be read/written to/from the btree page itself.
@@ -42962,7 +44332,7 @@ func accessPayload(tls *crt.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr
(*BtCursor)(unsafe.Pointer(pCur)).FaOverflow = aNew
}
}
- crt.Xmemset(tls, (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow, 0, (uint64(nOvfl) * uint64(unsafe.Sizeof(Pgno(0)))))
+ libc.Xmemset(tls, (*BtCursor)(unsafe.Pointer(pCur)).FaOverflow, 0, (uint64(nOvfl) * uint64(unsafe.Sizeof(Pgno(0)))))
*(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((0x04))
} else {
// If the overflow page-list cache has been allocated and the
@@ -42977,6 +44347,9 @@ func accessPayload(tls *crt.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr
for *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) != 0 {
// If required, populate the overflow page-list cache.
+ if *(*Pgno)(unsafe.Pointer(bp /* nextPage */)) > (*BtShared)(unsafe.Pointer(pBt)).FnPage {
+ return Xsqlite3CorruptError(tls, 69360)
+ }
*(*Pgno)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*Pgno)(unsafe.Pointer(bp /* nextPage */))
@@ -43034,7 +44407,7 @@ func accessPayload(tls *crt.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr
if (rc == 0) && (amt > U32(0)) {
// Overflow chain ends prematurely
- return Xsqlite3CorruptError(tls, 69300)
+ return Xsqlite3CorruptError(tls, 69445)
}
return rc
}
@@ -43054,7 +44427,7 @@ func accessPayload(tls *crt.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr
// Return SQLITE_OK on success or an error code if anything goes
// wrong. An error is returned if "offset+amt" is larger than
// the available payload.
-func Xsqlite3BtreePayload(tls *crt.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69322:20: */
+func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69467:20: */
return accessPayload(tls, pCur, offset, amt, pBuf, 0)
}
@@ -43062,7 +44435,7 @@ func Xsqlite3BtreePayload(tls *crt.TLS, pCur uintptr, offset U32, amt U32, pBuf
// This variant of sqlite3BtreePayload() works even if the cursor has not
// in the CURSOR_VALID state. It is only used by the sqlite3_blob_read()
// interface.
-func accessPayloadChecked(tls *crt.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69336:28: */
+func accessPayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69481:28: */
var rc int32
if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == 1 {
return 4
@@ -43074,7 +44447,7 @@ func accessPayloadChecked(tls *crt.TLS, pCur uintptr, offset U32, amt U32, pBuf
}
return accessPayload(tls, pCur, offset, amt, pBuf, 0)
}
-func Xsqlite3BtreePayloadChecked(tls *crt.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69350:20: */
+func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32 { /* sqlite3.c:69495:20: */
if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) == 0 {
return accessPayload(tls, pCur, offset, amt, pBuf, 0)
@@ -43101,7 +44474,7 @@ func Xsqlite3BtreePayloadChecked(tls *crt.TLS, pCur uintptr, offset U32, amt U32
// The pointer returned by this routine looks directly into the cached
// page of the database. The data might change or move the next time
// any btree routine is called.
-func fetchPayload(tls *crt.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:69379:19: */
+func fetchPayload(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:69524:19: */
var amt int32
amt = int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)
@@ -43132,7 +44505,7 @@ func fetchPayload(tls *crt.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3
//
// These routines is used to get quick access to key and data
// in the common case where no overflow pages are used.
-func Xsqlite3BtreePayloadFetch(tls *crt.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:69418:27: */
+func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr { /* sqlite3.c:69563:27: */
return fetchPayload(tls, pCur, pAmt)
}
@@ -43143,14 +44516,14 @@ func Xsqlite3BtreePayloadFetch(tls *crt.TLS, pCur uintptr, pAmt uintptr) uintptr
// the new child page does not match the flags field of the parent (i.e.
// if an intkey page appears to be the parent of a non-intkey page, or
// vice-versa).
-func moveToChild(tls *crt.TLS, pCur uintptr, newPgno U32) int32 { /* sqlite3.c:69432:12: */
+func moveToChild(tls *libc.TLS, pCur uintptr, newPgno U32) int32 { /* sqlite3.c:69577:12: */
var pBt uintptr = (*BtCursor)(unsafe.Pointer(pCur)).FpBt
if int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) >= (20 - 1) {
- return Xsqlite3CorruptError(tls, 69440)
+ return Xsqlite3CorruptError(tls, 69585)
}
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32((0x02 | 0x04)))))
+ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32((0x02 | 0x04)))))
*(*U16)(unsafe.Pointer((pCur + 88 /* &.aiIdx */) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = (*BtCursor)(unsafe.Pointer(pCur)).Fix
*(*uintptr)(unsafe.Pointer((pCur + 144 /* &.apPage */) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(0)
@@ -43164,14 +44537,14 @@ func moveToChild(tls *crt.TLS, pCur uintptr, newPgno U32) int32 { /* sqlite3.c:6
// to the page we are coming from. If we are coming from the
// right-most child page then pCur->idx is set to one more than
// the largest cell index.
-func moveToParent(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:69481:13: */
+func moveToParent(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:69626:13: */
var pLeaf uintptr
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32((0x02 | 0x04)))))
+ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32((0x02 | 0x04)))))
(*BtCursor)(unsafe.Pointer(pCur)).Fix = *(*U16)(unsafe.Pointer((pCur + 88 /* &.aiIdx */) + uintptr((int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage)-1))*2))
pLeaf = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
- (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer((pCur + 144 /* &.apPage */) + uintptr(crt.PreDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1))*8))
+ (*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer((pCur + 144 /* &.apPage */) + uintptr(libc.PreDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1))*8))
releasePageNotNull(tls, pLeaf)
}
@@ -43194,7 +44567,7 @@ func moveToParent(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:69481:13: */
// indicating a table b-tree, or if the caller did specify a KeyInfo
// structure the flags byte is set to 0x02 or 0x0A, indicating an index
// b-tree).
-func moveToRoot(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:69522:12: */
+func moveToRoot(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69667:12: */
var pRoot uintptr
var rc int32
var subpage Pgno
@@ -43208,7 +44581,7 @@ func moveToRoot(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:69522:12: */
}
releasePageNotNull(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage)
__4:
- if !(crt.PreDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1) != 0) {
+ if !(libc.PreDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1) != 0) {
goto __5
}
releasePageNotNull(tls, *(*uintptr)(unsafe.Pointer((pCur + 144 /* &.apPage */) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*8)))
@@ -43270,17 +44643,17 @@ __2:
// in such a way that page pRoot is linked into a second b-tree table
// (or the freelist).
- if !((int32((*MemPage)(unsafe.Pointer(pRoot)).FisInit) == 0) || ((crt.Bool32((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0))) != int32((*MemPage)(unsafe.Pointer(pRoot)).FintKey))) {
+ if !((int32((*MemPage)(unsafe.Pointer(pRoot)).FisInit) == 0) || ((libc.Bool32((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0))) != int32((*MemPage)(unsafe.Pointer(pRoot)).FintKey))) {
goto __11
}
- return Xsqlite3CorruptError(tls, 69578)
+ return Xsqlite3CorruptError(tls, 69723)
__11:
;
skip_init:
(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(0)
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(((0x08 | 0x02) | 0x04)))))
+ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(((0x08 | 0x02) | 0x04)))))
pRoot = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
if !(int32((*MemPage)(unsafe.Pointer(pRoot)).FnCell) > 0) {
@@ -43295,7 +44668,7 @@ __12:
if !((*MemPage)(unsafe.Pointer(pRoot)).Fpgno != Pgno(1)) {
goto __16
}
- return Xsqlite3CorruptError(tls, 69591)
+ return Xsqlite3CorruptError(tls, 69736)
__16:
;
subpage = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pRoot)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pRoot)).FhdrOffset) + 8))))
@@ -43317,12 +44690,12 @@ __13:
//
// The left-most leaf is the one with the smallest key - the first
// in ascending order.
-func moveToLeftmost(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:69609:12: */
+func moveToLeftmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69754:12: */
var pgno Pgno
var rc int32 = 0
var pPage uintptr
- for (rc == 0) && !(int32((*MemPage)(unsafe.Pointer(crt.AssignUintptr(&pPage, (*BtCursor)(unsafe.Pointer(pCur)).FpPage))).Fleaf) != 0) {
+ for (rc == 0) && !(int32((*MemPage)(unsafe.Pointer(libc.AssignUintptr(&pPage, (*BtCursor)(unsafe.Pointer(pCur)).FpPage))).Fleaf) != 0) {
pgno = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & ((int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (int32((*BtCursor)(unsafe.Pointer(pCur)).Fix))))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (int32((*BtCursor)(unsafe.Pointer(pCur)).Fix))))) + uintptr(1)))))))))
rc = moveToChild(tls, pCur, pgno)
@@ -43338,12 +44711,12 @@ func moveToLeftmost(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:69609:12: *
//
// The right-most entry is the one with the largest key - the last
// key in ascending order.
-func moveToRightmost(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:69634:12: */
+func moveToRightmost(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:69779:12: */
var pgno Pgno
var rc int32 = 0
var pPage uintptr = uintptr(0)
- for !(int32((*MemPage)(unsafe.Pointer(crt.AssignUintptr(&pPage, (*BtCursor)(unsafe.Pointer(pCur)).FpPage))).Fleaf) != 0) {
+ for !(int32((*MemPage)(unsafe.Pointer(libc.AssignUintptr(&pPage, (*BtCursor)(unsafe.Pointer(pCur)).FpPage))).Fleaf) != 0) {
pgno = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 8))))
(*BtCursor)(unsafe.Pointer(pCur)).Fix = (*MemPage)(unsafe.Pointer(pPage)).FnCell
rc = moveToChild(tls, pCur, pgno)
@@ -43359,7 +44732,7 @@ func moveToRightmost(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:69634:12:
// Move the cursor to the first entry in the table. Return SQLITE_OK
// on success. Set *pRes to 0 if the cursor actually points to something
// or set *pRes to 1 if the table is empty.
-func Xsqlite3BtreeFirst(tls *crt.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:69657:20: */
+func Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:69802:20: */
var rc int32
rc = moveToRoot(tls, pCur)
@@ -43378,7 +44751,7 @@ func Xsqlite3BtreeFirst(tls *crt.TLS, pCur uintptr, pRes uintptr) int32 { /* sql
// Move the cursor to the last entry in the table. Return SQLITE_OK
// on success. Set *pRes to 0 if the cursor actually points to something
// or set *pRes to 1 if the table is empty.
-func Xsqlite3BtreeLast(tls *crt.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:69679:20: */
+func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32 { /* sqlite3.c:69824:20: */
var rc int32
// If the cursor already points to the last entry, this is a no-op.
@@ -43395,7 +44768,7 @@ func Xsqlite3BtreeLast(tls *crt.TLS, pCur uintptr, pRes uintptr) int32 { /* sqli
if rc == 0 {
*(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((0x08))
} else {
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(0x08))))
+ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(0x08))))
}
} else if rc == 16 {
@@ -43434,7 +44807,7 @@ func Xsqlite3BtreeLast(tls *crt.TLS, pCur uintptr, pRes uintptr) int32 { /* sqli
//
// For index tables, the pIdxKey->eqSeen field is set to 1 if there
// exists an entry in the table that exactly matches pIdxKey.
-func Xsqlite3BtreeMovetoUnpacked(tls *crt.TLS, pCur uintptr, pIdxKey uintptr, intKey I64, biasRight int32, pRes uintptr) int32 { /* sqlite3.c:69749:20: */
+func Xsqlite3BtreeMovetoUnpacked(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, intKey I64, biasRight int32, pRes uintptr) int32 { /* sqlite3.c:69894:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -43576,13 +44949,13 @@ __20:
goto __23
}
__24:
- if !(0x80 <= int32(*(*U8)(unsafe.Pointer(crt.PostIncUintptr(&pCell, 1))))) {
+ if !(0x80 <= int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&pCell, 1))))) {
goto __25
}
if !(pCell >= (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) {
goto __26
}
- return Xsqlite3CorruptError(tls, 69852)
+ return Xsqlite3CorruptError(tls, 69997)
__26:
;
goto __24
@@ -43665,22 +45038,22 @@ __35: // Size of the pCell cell in bytes
// single byte varint and the record fits entirely on the main
// b-tree page.
- c = (*(*func(*crt.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&xRecordCompare)))(tls, nCell, (pCell + uintptr(1)), pIdxKey)
+ c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&xRecordCompare)))(tls, nCell, (pCell + uintptr(1)), pIdxKey)
goto __39
__38:
if !(!((int32(*(*U8)(unsafe.Pointer(pCell + uintptr(1)))) & 0x80) != 0) &&
- ((crt.AssignInt32(&nCell, (((nCell & 0x7f) << 7) + int32(*(*U8)(unsafe.Pointer(pCell + uintptr(1))))))) <= int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal))) {
+ ((libc.AssignInt32(&nCell, (((nCell & 0x7f) << 7) + int32(*(*U8)(unsafe.Pointer(pCell + uintptr(1))))))) <= int32((*MemPage)(unsafe.Pointer(pPage)).FmaxLocal))) {
goto __40
}
// The record-size field is a 2 byte varint and the record
// fits entirely on the main b-tree page.
- c = (*(*func(*crt.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&xRecordCompare)))(tls, nCell, (pCell + uintptr(2)), pIdxKey)
+ c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&xRecordCompare)))(tls, nCell, (pCell + uintptr(2)), pIdxKey)
goto __41
__40:
pCellBody = (pCell - uintptr((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize))
nOverrun = 18 // Size of the overrun padding
- (*(*func(*crt.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, pCellBody, (pCur + 48 /* &.info */))
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, pCellBody, (pCur + 48 /* &.info */))
nCell = int32((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnKey)
// True if key size is 2^32 or more
// Invalid key size: 0x80 0x80 0x00
@@ -43689,7 +45062,7 @@ __40:
if !((nCell < 2) || ((U32(nCell) / (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize) > (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage)) {
goto __42
}
- rc = Xsqlite3CorruptError(tls, 69927)
+ rc = Xsqlite3CorruptError(tls, 70072)
goto moveto_finish
__42:
;
@@ -43703,8 +45076,8 @@ __43:
;
(*BtCursor)(unsafe.Pointer(pCur)).Fix = U16(idx)
rc = accessPayload(tls, pCur, uint32(0), uint32(nCell), pCellKey, 0)
- crt.Xmemset(tls, ((pCellKey) + uintptr(nCell)), 0, uint64(nOverrun)) // Fix uninit warnings
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(0x04))))
+ libc.Xmemset(tls, ((pCellKey) + uintptr(nCell)), 0, uint64(nOverrun)) // Fix uninit warnings
+ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(0x04))))
if !(rc != 0) {
goto __44
}
@@ -43738,7 +45111,7 @@ __47:
if !((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0) {
goto __49
}
- rc = Xsqlite3CorruptError(tls, 69959)
+ rc = Xsqlite3CorruptError(tls, 70104)
__49:
;
goto moveto_finish
@@ -43808,17 +45181,17 @@ moveto_finish:
// TRUE will be returned after a call to sqlite3BtreeNext() moves
// past the last entry in the table or sqlite3BtreePrev() moves past
// the first entry. TRUE is also returned if the table is empty.
-func Xsqlite3BtreeEof(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:70000:20: */
+func Xsqlite3BtreeEof(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70145:20: */
// TODO: What if the cursor is in CURSOR_REQUIRESEEK but all table entries
// have been deleted? This API will need to change to return an error code
// as well as the boolean result value.
- return (crt.Bool32(0 != int32((*BtCursor)(unsafe.Pointer(pCur)).FeState)))
+ return (libc.Bool32(0 != int32((*BtCursor)(unsafe.Pointer(pCur)).FeState)))
}
// Return an estimate for the number of rows in the table that pCur is
// pointing to. Return a negative number if no estimate is currently
// available.
-func Xsqlite3BtreeRowCountEst(tls *crt.TLS, pCur uintptr) I64 { /* sqlite3.c:70013:20: */
+func Xsqlite3BtreeRowCountEst(tls *libc.TLS, pCur uintptr) I64 { /* sqlite3.c:70158:20: */
var n I64
var i U8
@@ -43857,7 +45230,7 @@ func Xsqlite3BtreeRowCountEst(tls *crt.TLS, pCur uintptr) I64 { /* sqlite3.c:700
// skipped if the SQL index had been a unique index. The F argument
// is a hint to the implement. SQLite btree implementation does not use
// this hint, but COMDB2 does.
-func btreeNext(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:70053:28: */
+func btreeNext(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70198:28: */
var rc int32
var idx int32
var pPage uintptr
@@ -43885,7 +45258,7 @@ func btreeNext(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:70053:28: */
}
pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
- idx = int32(crt.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1))
+ idx = int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1))
if !(int32((*MemPage)(unsafe.Pointer(pPage)).FisInit) != 0) {
// The only known way for this to happen is for there to be a
// recursive SQL function that does a DELETE operation as part of a
@@ -43894,7 +45267,7 @@ func btreeNext(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:70053:28: */
// has pages in common with the table being queried. See TH3
// module cov1/btree78.test testcase 220 (2018-06-08) for an
// example.
- return Xsqlite3CorruptError(tls, 70084)
+ return Xsqlite3CorruptError(tls, 70229)
}
// If the database file is corrupt, it is possible for the value of idx
@@ -43935,17 +45308,17 @@ func btreeNext(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:70053:28: */
}
return int32(0)
}
-func Xsqlite3BtreeNext(tls *crt.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:70123:20: */
+func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:70268:20: */
var pPage uintptr
_ = flags // Used in COMDB2 but not native SQLite
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32((0x02 | 0x04)))))
+ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32((0x02 | 0x04)))))
if int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != 0 {
return btreeNext(tls, pCur)
}
pPage = (*BtCursor)(unsafe.Pointer(pCur)).FpPage
- if (int32(crt.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1))) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
+ if (int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1))) >= int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) {
(*BtCursor)(unsafe.Pointer(pCur)).Fix--
return btreeNext(tls, pCur)
}
@@ -43975,7 +45348,7 @@ func Xsqlite3BtreeNext(tls *crt.TLS, pCur uintptr, flags int32) int32 { /* sqlit
// skipped if the SQL index had been a unique index. The F argument is a
// hint to the implement. The native SQLite btree implementation does not
// use this hint, but COMDB2 does.
-func btreePrevious(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:70163:28: */
+func btreePrevious(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:70308:28: */
var rc int32
var pPage uintptr
@@ -44028,10 +45401,10 @@ func btreePrevious(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:70163:28: */
}
return rc
}
-func Xsqlite3BtreePrevious(tls *crt.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:70212:20: */
+func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32 { /* sqlite3.c:70357:20: */
_ = flags // Used in COMDB2 but not native SQLite
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(((0x08 | 0x04) | 0x02)))))
+ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(((0x08 | 0x04) | 0x02)))))
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
if ((int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) != 0) ||
(int32((*BtCursor)(unsafe.Pointer(pCur)).Fix) == 0)) ||
@@ -44062,7 +45435,7 @@ func Xsqlite3BtreePrevious(tls *crt.TLS, pCur uintptr, flags int32) int32 { /* s
// eMode is BTALLOC_LT then the page returned will be less than or equal
// to nearby if any such page exists. If eMode is BTALLOC_ANY then there
// are no restrictions on which page is returned.
-func allocateBtreePage(tls *crt.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr, nearby Pgno, eMode U8) int32 { /* sqlite3.c:70250:12: */
+func allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr, nearby Pgno, eMode U8) int32 { /* sqlite3.c:70395:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -44129,7 +45502,7 @@ func allocateBtreePage(tls *crt.TLS, pBt uintptr, ppPage uintptr, pPgno uintptr,
if !(n >= mxPage) {
goto __1
}
- return Xsqlite3CorruptError(tls, 70274)
+ return Xsqlite3CorruptError(tls, 70419)
__1:
;
if !(n > U32(0)) {
@@ -44207,10 +45580,10 @@ __14:
__15:
;
- if !((iTrunk > mxPage) || (crt.PostIncUint32(&nSearch, 1) > n)) {
+ if !((iTrunk > mxPage) || (libc.PostIncUint32(&nSearch, 1) > n)) {
goto __16
}
- rc = Xsqlite3CorruptError(tls, 70330)
+ rc = Xsqlite3CorruptError(tls, 70475)
goto __17
__16:
rc = btreeGetUnusedPage(tls, pBt, iTrunk, bp+8 /* &pTrunk */, 0)
@@ -44242,7 +45615,7 @@ __18:
__21:
;
*(*Pgno)(unsafe.Pointer(pPgno)) = iTrunk
- crt.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + uintptr(32)), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + uintptr(0)), uint64(4))
+ libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + uintptr(32)), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + uintptr(0)), uint64(4))
*(*uintptr)(unsafe.Pointer(ppPage)) = *(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */))
*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)) = uintptr(0)
goto __20
@@ -44251,7 +45624,7 @@ __19:
goto __22
}
// Value of k is out of range. Database corruption
- rc = Xsqlite3CorruptError(tls, 70359)
+ rc = Xsqlite3CorruptError(tls, 70504)
goto end_allocate_page
goto __23
__22:
@@ -44277,7 +45650,7 @@ __26:
if !(!(pPrevTrunk != 0)) {
goto __29
}
- crt.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + uintptr(32)), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + uintptr(0)), uint64(4))
+ libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + uintptr(32)), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + uintptr(0)), uint64(4))
goto __30
__29:
rc = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPrevTrunk)).FpDbPage)
@@ -44287,7 +45660,7 @@ __29:
goto end_allocate_page
__31:
;
- crt.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pPrevTrunk)).FaData + uintptr(0)), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + uintptr(0)), uint64(4))
+ libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pPrevTrunk)).FaData + uintptr(0)), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + uintptr(0)), uint64(4))
__30:
;
goto __28
@@ -44296,7 +45669,7 @@ __27:
if !(iNewTrunk > mxPage) {
goto __32
}
- rc = Xsqlite3CorruptError(tls, 70393)
+ rc = Xsqlite3CorruptError(tls, 70538)
goto end_allocate_page
__32:
;
@@ -44316,9 +45689,9 @@ __33:
goto end_allocate_page
__34:
;
- crt.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pNewTrunk */)))).FaData + uintptr(0)), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + uintptr(0)), uint64(4))
+ libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pNewTrunk */)))).FaData + uintptr(0)), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + uintptr(0)), uint64(4))
Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pNewTrunk */)))).FaData + uintptr(4)), (k - U32(1)))
- crt.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pNewTrunk */)))).FaData + uintptr(8)), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + uintptr(12)), (uint64((k - U32(1)) * U32(4))))
+ libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pNewTrunk */)))).FaData + uintptr(8)), ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pTrunk */)))).FaData + uintptr(12)), (uint64((k - U32(1)) * U32(4))))
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pNewTrunk */)))
if !(!(pPrevTrunk != 0)) {
goto __35
@@ -44409,7 +45782,7 @@ __40:
if !(iPage > mxPage) {
goto __51
}
- rc = Xsqlite3CorruptError(tls, 70458)
+ rc = Xsqlite3CorruptError(tls, 70603)
goto end_allocate_page
__51:
;
@@ -44430,7 +45803,7 @@ __53:
if !(closest < (k - U32(1))) {
goto __54
}
- crt.Xmemcpy(tls, (aData + uintptr((U32(8) + (closest * U32(4))))), (aData + uintptr((U32(4) + (k * U32(4))))), uint64(4))
+ libc.Xmemcpy(tls, (aData + uintptr((U32(8) + (closest * U32(4))))), (aData + uintptr((U32(4) + (k * U32(4))))), uint64(4))
__54:
;
Xsqlite3Put4byte(tls, (aData + uintptr(4)), (k - U32(1)))
@@ -44583,13 +45956,13 @@ end_allocate_page:
//
// If a pointer to a MemPage object is passed as the second argument,
// its reference count is not altered by this function.
-func freePage2(tls *crt.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 { /* sqlite3.c:70572:12: */
+func freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 { /* sqlite3.c:70717:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
// var pTrunk uintptr at bp+16, 8
// Free-list trunk page
- var iTrunk Pgno /* Page number of free-list trunk page */
+ var iTrunk Pgno // Page number of free-list trunk page
var pPage1 uintptr // Local reference to page 1
// var pPage uintptr at bp, 8
// Page being freed. May be NULL.
@@ -44604,7 +45977,7 @@ func freePage2(tls *crt.TLS, pBt uintptr, pMemPage uintptr, iPage Pgno) int32 {
if !((iPage < Pgno(2)) || (iPage > (*BtShared)(unsafe.Pointer(pBt)).FnPage)) {
goto __1
}
- return Xsqlite3CorruptError(tls, 70585)
+ return Xsqlite3CorruptError(tls, 70730)
__1:
;
if !(pMemPage != 0) {
@@ -44634,14 +46007,14 @@ __4:
}
// If the secure_delete option is enabled, then
// always fully overwrite deleted information with zeros.
- if !((!(*(*uintptr)(unsafe.Pointer(bp /* pPage */)) != 0) && ((crt.AssignPtrInt32(bp+8 /* rc */, btreeGetPage(tls, pBt, iPage, bp /* &pPage */, 0))) != 0)) ||
- ((crt.AssignPtrInt32(bp+8 /* rc */, Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage))) != 0)) {
+ if !((!(*(*uintptr)(unsafe.Pointer(bp /* pPage */)) != 0) && ((libc.AssignPtrInt32(bp+8 /* rc */, btreeGetPage(tls, pBt, iPage, bp /* &pPage */, 0))) != 0)) ||
+ ((libc.AssignPtrInt32(bp+8 /* rc */, Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage))) != 0)) {
goto __6
}
goto freepage_out
__6:
;
- crt.Xmemset(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData, 0, uint64((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpBt)).FpageSize))
+ libc.Xmemset(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData, 0, uint64((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpBt)).FpageSize))
__5:
;
@@ -44671,25 +46044,32 @@ __7:
} // Initial number of leaf cells on trunk page
iTrunk = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(pPage1)).FaData + uintptr(32)))
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = btreeGetPage(tls, pBt, iTrunk, bp+16 /* &pTrunk */, 0)
- if !(*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0) {
+ if !(iTrunk > btreePagecount(tls, pBt)) {
goto __10
}
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3CorruptError(tls, 70777)
goto freepage_out
__10:
;
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = btreeGetPage(tls, pBt, iTrunk, bp+16 /* &pTrunk */, 0)
+ if !(*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0) {
+ goto __11
+ }
+ goto freepage_out
+__11:
+ ;
nLeaf = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pTrunk */)))).FaData + uintptr(4)))
if !(nLeaf > (((*BtShared)(unsafe.Pointer(pBt)).FusableSize / U32(4)) - U32(2))) {
- goto __11
+ goto __12
}
- *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3CorruptError(tls, 70639)
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3CorruptError(tls, 70788)
goto freepage_out
-__11:
+__12:
;
if !(nLeaf < (((*BtShared)(unsafe.Pointer(pBt)).FusableSize / U32(4)) - U32(8))) {
- goto __12
+ goto __13
}
// In this case there is room on the trunk page to insert the page
// being freed as a new leaf.
@@ -44711,22 +46091,22 @@ __11:
// read by older versions of SQLite.
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pTrunk */)))).FpDbPage)
if !(*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0) {
- goto __13
+ goto __14
}
Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pTrunk */)))).FaData + uintptr(4)), (nLeaf + U32(1)))
Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pTrunk */)))).FaData + uintptr((U32(8) + (nLeaf * U32(4))))), iPage)
if !((*(*uintptr)(unsafe.Pointer(bp /* pPage */)) != 0) && ((int32((*BtShared)(unsafe.Pointer(pBt)).FbtsFlags) & 0x0004) == 0)) {
- goto __14
+ goto __15
}
Xsqlite3PagerDontWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage)
-__14:
+__15:
;
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = btreeSetHasContent(tls, pBt, iPage)
-__13:
+__14:
;
goto freepage_out
-__12:
+__13:
;
__9:
;
@@ -44736,18 +46116,18 @@ __9:
// Possibly because the free-list is empty, or possibly because the
// first trunk in the free-list is full. Either way, the page being freed
// will become the new first trunk page in the free-list.
- if !((*(*uintptr)(unsafe.Pointer(bp /* pPage */)) == uintptr(0)) && (0 != (crt.AssignPtrInt32(bp+8 /* rc */, btreeGetPage(tls, pBt, iPage, bp /* &pPage */, 0))))) {
- goto __15
+ if !((*(*uintptr)(unsafe.Pointer(bp /* pPage */)) == uintptr(0)) && (0 != (libc.AssignPtrInt32(bp+8 /* rc */, btreeGetPage(tls, pBt, iPage, bp /* &pPage */, 0))))) {
+ goto __16
}
goto freepage_out
-__15:
+__16:
;
*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage)
if !(*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0) {
- goto __16
+ goto __17
}
goto freepage_out
-__16:
+__17:
;
Xsqlite3Put4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData, iTrunk)
Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData + uintptr(4)), uint32(0))
@@ -44755,16 +46135,16 @@ __16:
freepage_out:
if !(*(*uintptr)(unsafe.Pointer(bp /* pPage */)) != 0) {
- goto __17
+ goto __18
}
(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FisInit = U8(0)
-__17:
+__18:
;
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)))
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pTrunk */)))
return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
}
-func freePage(tls *crt.TLS, pPage uintptr, pRC uintptr) { /* sqlite3.c:70702:13: */
+func freePage(tls *libc.TLS, pPage uintptr, pRC uintptr) { /* sqlite3.c:70851:13: */
if (*(*int32)(unsafe.Pointer(pRC))) == 0 {
*(*int32)(unsafe.Pointer(pRC)) = freePage2(tls, (*MemPage)(unsafe.Pointer(pPage)).FpBt, pPage, (*MemPage)(unsafe.Pointer(pPage)).Fpgno)
}
@@ -44772,7 +46152,7 @@ func freePage(tls *crt.TLS, pPage uintptr, pRC uintptr) { /* sqlite3.c:70702:13:
// Free any overflow pages associated with the given Cell. Store
// size information about the cell in pInfo.
-func clearCell(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 { /* sqlite3.c:70712:12: */
+func clearCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32 { /* sqlite3.c:70861:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -44782,14 +46162,14 @@ func clearCell(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32
var nOvfl int32
var ovflPageSize U32
- (*(*func(*crt.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, pCell, pInfo)
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pPage + 128 /* &.xParseCell */))))(tls, pPage, pCell, pInfo)
if U32((*CellInfo)(unsafe.Pointer(pInfo)).FnLocal) == (*CellInfo)(unsafe.Pointer(pInfo)).FnPayload {
return 0
}
if (pCell + uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnSize)) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd {
// Cell extends past end of page
- return Xsqlite3CorruptError(tls, 70732)
+ return Xsqlite3CorruptError(tls, 70881)
}
ovflPgno = Xsqlite3Get4byte(tls, ((pCell + uintptr((*CellInfo)(unsafe.Pointer(pInfo)).FnSize)) - uintptr(4)))
pBt = (*MemPage)(unsafe.Pointer(pPage)).FpBt
@@ -44797,14 +46177,14 @@ func clearCell(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32
ovflPageSize = ((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(4))
nOvfl = (int32(((((*CellInfo)(unsafe.Pointer(pInfo)).FnPayload - U32((*CellInfo)(unsafe.Pointer(pInfo)).FnLocal)) + ovflPageSize) - U32(1)) / ovflPageSize))
- for crt.PostDecInt32(&nOvfl, 1) != 0 {
+ for libc.PostDecInt32(&nOvfl, 1) != 0 {
*(*Pgno)(unsafe.Pointer(bp + 8 /* iNext */)) = Pgno(0)
*(*uintptr)(unsafe.Pointer(bp /* pOvfl */)) = uintptr(0)
if (ovflPgno < Pgno(2)) || (ovflPgno > btreePagecount(tls, pBt)) {
// 0 is not a legal page number and page 1 cannot be an
// overflow page. Therefore if ovflPgno<2 or past the end of the
// file the database must be corrupt.
- return Xsqlite3CorruptError(tls, 70749)
+ return Xsqlite3CorruptError(tls, 70898)
}
if nOvfl != 0 {
rc = getOverflowPage(tls, pBt, ovflPgno, bp /* &pOvfl */, bp+8 /* &iNext */)
@@ -44813,7 +46193,7 @@ func clearCell(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32
}
}
- if ((*(*uintptr)(unsafe.Pointer(bp /* pOvfl */)) != 0) || ((crt.AssignPtrUintptr(bp /* pOvfl */, btreePageLookup(tls, pBt, ovflPgno))) != uintptr(0))) &&
+ if ((*(*uintptr)(unsafe.Pointer(bp /* pOvfl */)) != 0) || ((libc.AssignPtrUintptr(bp /* pOvfl */, btreePageLookup(tls, pBt, ovflPgno))) != uintptr(0))) &&
(Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pOvfl */)))).FpDbPage) != 1) {
// There is no reason any cursor should have an outstanding reference
// to an overflow page belonging to a cell that is being deleted/updated.
@@ -44824,7 +46204,7 @@ func clearCell(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32
// enabled. If this 'overflow' page happens to be a page that the
// caller is iterating through or using in some other way, this
// can be problematic.
- rc = Xsqlite3CorruptError(tls, 70769)
+ rc = Xsqlite3CorruptError(tls, 70918)
} else {
rc = freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp /* pOvfl */)), ovflPgno)
}
@@ -44850,7 +46230,7 @@ func clearCell(tls *crt.TLS, pPage uintptr, pCell uintptr, pInfo uintptr) int32
// area. pCell might point to some temporary storage. The cell will
// be constructed in this temporary area then copied into pPage->aData
// later.
-func fillInCell(tls *crt.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize uintptr) int32 { /* sqlite3.c:70795:12: */
+func fillInCell(tls *libc.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize uintptr) int32 { /* sqlite3.c:70944:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -44889,7 +46269,7 @@ func fillInCell(tls *crt.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize u
nHeader = nHeader + (Xsqlite3PutVarint(tls, (pCell + uintptr(nHeader)), *(*U64)(unsafe.Pointer((pX + 8 /* &.nKey */)))))
} else {
- nSrc = crt.AssignInt32(&nPayload, int32((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
+ nSrc = libc.AssignInt32(&nPayload, int32((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
pSrc = (*BtreePayload)(unsafe.Pointer(pX)).FpKey
nHeader = nHeader + (int32(func() uint8 {
if (U32(nPayload)) < U32(0x80) {
@@ -44911,8 +46291,8 @@ func fillInCell(tls *crt.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize u
}
*(*int32)(unsafe.Pointer(pnSize)) = n
- crt.Xmemcpy(tls, pPayload, pSrc, uint64(nSrc))
- crt.Xmemset(tls, (pPayload + uintptr(nSrc)), 0, (uint64(nPayload - nSrc)))
+ libc.Xmemcpy(tls, pPayload, pSrc, uint64(nSrc))
+ libc.Xmemset(tls, (pPayload + uintptr(nSrc)), 0, (uint64(nPayload - nSrc)))
return 0
}
@@ -44957,12 +46337,12 @@ func fillInCell(tls *crt.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize u
// is still writeable
if nSrc >= n {
- crt.Xmemcpy(tls, pPayload, pSrc, uint64(n))
+ libc.Xmemcpy(tls, pPayload, pSrc, uint64(n))
} else if nSrc > 0 {
n = nSrc
- crt.Xmemcpy(tls, pPayload, pSrc, uint64(n))
+ libc.Xmemcpy(tls, pPayload, pSrc, uint64(n))
} else {
- crt.Xmemset(tls, pPayload, 0, uint64(n))
+ libc.Xmemset(tls, pPayload, 0, uint64(n))
}
nPayload = nPayload - (n)
if nPayload <= 0 {
@@ -45032,7 +46412,7 @@ func fillInCell(tls *crt.TLS, pPage uintptr, pCell uintptr, pX uintptr, pnSize u
// removes the reference to the cell from pPage.
//
// "sz" must be the number of bytes in the cell.
-func dropCell(tls *crt.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { /* sqlite3.c:70985:13: */
+func dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { /* sqlite3.c:71134:13: */
var pc U32 // Offset to cell content of cell being deleted
var data uintptr // pPage->aData
var ptr uintptr // Used to move bytes around within data[]
@@ -45049,7 +46429,7 @@ func dropCell(tls *crt.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { /
hdr = int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)
if (pc + U32(sz)) > (*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize {
- *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 71005)
+ *(*int32)(unsafe.Pointer(pRC)) = Xsqlite3CorruptError(tls, 71154)
return
}
rc = freeSpace(tls, pPage, uint16(pc), uint16(sz))
@@ -45059,14 +46439,14 @@ func dropCell(tls *crt.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { /
}
(*MemPage)(unsafe.Pointer(pPage)).FnCell--
if int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) == 0 {
- crt.Xmemset(tls, (data + uintptr((hdr + 1))), 0, uint64(4))
+ libc.Xmemset(tls, (data + uintptr((hdr + 1))), 0, uint64(4))
*(*U8)(unsafe.Pointer(data + uintptr((hdr + 7)))) = U8(0)
*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))) + uintptr(0))) = (U8(((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) >> 8))
*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))) + uintptr(1))) = U8((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)
(*MemPage)(unsafe.Pointer(pPage)).FnFree = (int32((((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize - U32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)) -
U32((*MemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) - U32(8)))
} else {
- crt.Xmemmove(tls, ptr, (ptr + uintptr(2)), (uint64(2 * (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - idx))))
+ libc.Xmemmove(tls, ptr, (ptr + uintptr(2)), (uint64(2 * (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - idx))))
*(*U8)(unsafe.Pointer((data + uintptr((hdr + 3))) + uintptr(0))) = (U8((int32((*MemPage)(unsafe.Pointer(pPage)).FnCell)) >> 8))
*(*U8)(unsafe.Pointer((data + uintptr((hdr + 3))) + uintptr(1))) = U8((*MemPage)(unsafe.Pointer(pPage)).FnCell)
*(*int32)(unsafe.Pointer(pPage + 20 /* &.nFree */)) += (2)
@@ -45085,7 +46465,7 @@ func dropCell(tls *crt.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { /
// pPage->nOverflow is incremented.
//
// *pRC must be SQLITE_OK when this routine is called.
-func insertCell(tls *crt.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, pTemp uintptr, iChild Pgno, pRC uintptr) { /* sqlite3.c:71041:13: */
+func insertCell(tls *libc.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, pTemp uintptr, iChild Pgno, pRC uintptr) { /* sqlite3.c:71190:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -45096,13 +46476,13 @@ func insertCell(tls *crt.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, p
if ((*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0) || ((sz + 2) > (*MemPage)(unsafe.Pointer(pPage)).FnFree) {
if pTemp != 0 {
- crt.Xmemcpy(tls, pTemp, pCell, uint64(sz))
+ libc.Xmemcpy(tls, pTemp, pCell, uint64(sz))
pCell = pTemp
}
if iChild != 0 {
Xsqlite3Put4byte(tls, pCell, iChild)
}
- j = int32(crt.PostIncUint8(&(*MemPage)(unsafe.Pointer(pPage)).FnOverflow, 1))
+ j = int32(libc.PostIncUint8(&(*MemPage)(unsafe.Pointer(pPage)).FnOverflow, 1))
// Comparison against ArraySize-1 since we hold back one extra slot
// as a contingency. In other words, never need more than 3 overflow
// slots but 4 are allocated, just to be safe.
@@ -45139,18 +46519,18 @@ func insertCell(tls *crt.TLS, pPage uintptr, i int32, pCell uintptr, sz int32, p
// as many as 4 bytes in front of the start of the aData buffer for
// the source page. Make sure this does not cause problems by not
// reading the first 4 bytes
- crt.Xmemcpy(tls, (data + uintptr((*(*int32)(unsafe.Pointer(bp /* idx */)) + 4))), (pCell + uintptr(4)), (uint64(sz - 4)))
+ libc.Xmemcpy(tls, (data + uintptr((*(*int32)(unsafe.Pointer(bp /* idx */)) + 4))), (pCell + uintptr(4)), (uint64(sz - 4)))
Xsqlite3Put4byte(tls, (data + uintptr(*(*int32)(unsafe.Pointer(bp /* idx */)))), iChild)
} else {
- crt.Xmemcpy(tls, (data + uintptr(*(*int32)(unsafe.Pointer(bp /* idx */)))), pCell, uint64(sz))
+ libc.Xmemcpy(tls, (data + uintptr(*(*int32)(unsafe.Pointer(bp /* idx */)))), pCell, uint64(sz))
}
pIns = ((*MemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr((i * 2)))
- crt.Xmemmove(tls, (pIns + uintptr(2)), pIns, (uint64(2 * (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - i))))
+ libc.Xmemmove(tls, (pIns + uintptr(2)), pIns, (uint64(2 * (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - i))))
*(*U8)(unsafe.Pointer((pIns) + uintptr(0))) = (U8((*(*int32)(unsafe.Pointer(bp /* idx */))) >> 8))
*(*U8)(unsafe.Pointer((pIns) + uintptr(1))) = U8(*(*int32)(unsafe.Pointer(bp /* idx */)))
(*MemPage)(unsafe.Pointer(pPage)).FnCell++
// increment the cell count
- if (int32(crt.PreIncUint8(&*(*U8)(unsafe.Pointer(data + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 4)))), 1))) == 0 {
+ if (int32(libc.PreIncUint8(&*(*U8)(unsafe.Pointer(data + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 4)))), 1))) == 0 {
*(*U8)(unsafe.Pointer(data + uintptr((int32((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset) + 3))))++
}
@@ -45321,16 +46701,16 @@ type CellArray1 = struct {
// cases, ixNx[] entries with higher indexes, and the corresponding apEnd[]
// entries, shift down. The end result is that each ixNx[] entry should
// be larger than the previous
-type CellArray = CellArray1 /* sqlite3.c:71216:26 */
+type CellArray = CellArray1 /* sqlite3.c:71365:26 */
// Make sure the cell sizes at idx, idx+1, ..., idx+N-1 have been
// computed.
-func populateCellCache(tls *crt.TLS, p uintptr, idx int32, N int32) { /* sqlite3.c:71230:13: */
+func populateCellCache(tls *libc.TLS, p uintptr, idx int32, N int32) { /* sqlite3.c:71379:13: */
for N > 0 {
if int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(idx)*2))) == 0 {
- *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(idx)*2)) = (*(*func(*crt.TLS, uintptr, uintptr) U16)(unsafe.Pointer(((*CellArray)(unsafe.Pointer(p)).FpRef + 120 /* &.xCellSize */))))(tls, (*CellArray)(unsafe.Pointer(p)).FpRef, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FapCell + uintptr(idx)*8)))
+ *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(idx)*2)) = (*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer(((*CellArray)(unsafe.Pointer(p)).FpRef + 120 /* &.xCellSize */))))(tls, (*CellArray)(unsafe.Pointer(p)).FpRef, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FapCell + uintptr(idx)*8)))
} else {
}
idx++
@@ -45339,12 +46719,12 @@ func populateCellCache(tls *crt.TLS, p uintptr, idx int32, N int32) { /* sqlite3
}
// Return the size of the Nth element of the cell array
-func computeCellSize(tls *crt.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71248:28: */
+func computeCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71397:28: */
- *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) = (*(*func(*crt.TLS, uintptr, uintptr) U16)(unsafe.Pointer(((*CellArray)(unsafe.Pointer(p)).FpRef + 120 /* &.xCellSize */))))(tls, (*CellArray)(unsafe.Pointer(p)).FpRef, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FapCell + uintptr(N)*8)))
+ *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) = (*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer(((*CellArray)(unsafe.Pointer(p)).FpRef + 120 /* &.xCellSize */))))(tls, (*CellArray)(unsafe.Pointer(p)).FpRef, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FapCell + uintptr(N)*8)))
return *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2))
}
-func cachedCellSize(tls *crt.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71254:12: */
+func cachedCellSize(tls *libc.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71403:12: */
if *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2)) != 0 {
return *(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(p)).FszCell + uintptr(N)*2))
@@ -45363,7 +46743,7 @@ func cachedCellSize(tls *crt.TLS, p uintptr, N int32) U16 { /* sqlite3.c:71254:1
//
// The MemPage.nFree field is invalidated by this function. It is the
// responsibility of the caller to set it correctly.
-func rebuildPage(tls *crt.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg uintptr) int32 { /* sqlite3.c:71273:12: */
+func rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg uintptr) int32 { /* sqlite3.c:71422:12: */
var hdr int32 = int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) // Offset of header on pPg
var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData // Pointer to data for pPg
var usableSize int32 = int32((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize)
@@ -45381,7 +46761,7 @@ func rebuildPage(tls *crt.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg u
if j > U32(usableSize) {
j = U32(0)
}
- crt.Xmemcpy(tls, (pTmp + uintptr(j)), (aData + uintptr(j)), (uint64(U32(usableSize) - j)))
+ libc.Xmemcpy(tls, (pTmp + uintptr(j)), (aData + uintptr(j)), (uint64(U32(usableSize) - j)))
for k = 0; (*(*int32)(unsafe.Pointer((pCArray + 80 /* &.ixNx */) + uintptr(k)*4)) <= i) && (k < (3 * 2)); k++ {
}
@@ -45394,12 +46774,12 @@ func rebuildPage(tls *crt.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg u
if (Uptr((pCell)) >= Uptr((aData))) && (Uptr((pCell)) < Uptr((pEnd))) {
if (Uptr((pCell + uintptr(sz)))) > Uptr(pEnd) {
- return Xsqlite3CorruptError(tls, 71306)
+ return Xsqlite3CorruptError(tls, 71455)
}
pCell = (pTmp + uintptr(((int64(pCell) - int64(aData)) / 1)))
} else if (Uptr((pCell + uintptr(sz))) > Uptr(pSrcEnd)) &&
(Uptr((pCell)) < Uptr(pSrcEnd)) {
- return Xsqlite3CorruptError(tls, 71311)
+ return Xsqlite3CorruptError(tls, 71460)
}
pData -= uintptr(sz)
@@ -45407,9 +46787,9 @@ func rebuildPage(tls *crt.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg u
*(*U8)(unsafe.Pointer((pCellptr) + uintptr(1))) = (U8((int64(pData) - int64(aData)) / 1))
pCellptr += uintptr(2)
if pData < pCellptr {
- return Xsqlite3CorruptError(tls, 71317)
+ return Xsqlite3CorruptError(tls, 71466)
}
- crt.Xmemcpy(tls, pData, pCell, uint64(sz))
+ libc.Xmemcpy(tls, pData, pCell, uint64(sz))
i++
if i >= iEnd {
@@ -45457,7 +46837,7 @@ func rebuildPage(tls *crt.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg u
// all cells - not just those inserted by the current call). If the content
// area must be extended to before this point in order to accomodate all
// cells in apCell[], then the cells do not fit and non-zero is returned.
-func pageInsertArray(tls *crt.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, pCellptr uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:71364:12: */
+func pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr, pCellptr uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:71513:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -45481,7 +46861,7 @@ func pageInsertArray(tls *crt.TLS, pPg uintptr, pBegin uintptr, ppData uintptr,
var pSlot uintptr
sz = int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)))
- if ((int32(*(*U8)(unsafe.Pointer(aData + uintptr(1)))) == 0) && (int32(*(*U8)(unsafe.Pointer(aData + uintptr(2)))) == 0)) || ((crt.AssignUintptr(&pSlot, pageFindSlot(tls, pPg, sz, bp /* &rc */))) == uintptr(0)) {
+ if ((int32(*(*U8)(unsafe.Pointer(aData + uintptr(1)))) == 0) && (int32(*(*U8)(unsafe.Pointer(aData + uintptr(2)))) == 0)) || ((libc.AssignUintptr(&pSlot, pageFindSlot(tls, pPg, sz, bp /* &rc */))) == uintptr(0)) {
if ((int64(pData) - int64(pBegin)) / 1) < int64(sz) {
return 1
}
@@ -45495,10 +46875,10 @@ func pageInsertArray(tls *crt.TLS, pPg uintptr, pBegin uintptr, ppData uintptr,
if (Uptr((*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)) + uintptr(sz))) > Uptr(pEnd)) &&
(Uptr((*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)))) < Uptr(pEnd)) {
- Xsqlite3CorruptError(tls, 71403)
+ Xsqlite3CorruptError(tls, 71552)
return 1
}
- crt.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), uint64(sz))
+ libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), uint64(sz))
*(*U8)(unsafe.Pointer((pCellptr) + uintptr(0))) = (U8(((int64(pSlot) - int64(aData)) / 1) >> 8))
*(*U8)(unsafe.Pointer((pCellptr) + uintptr(1))) = (U8((int64(pSlot) - int64(aData)) / 1))
pCellptr += uintptr(2)
@@ -45522,7 +46902,7 @@ func pageInsertArray(tls *crt.TLS, pPg uintptr, pBegin uintptr, ppData uintptr,
// The cell-pointers and other fields of the page are not updated.
//
// This function returns the total number of cells added to the free-list.
-func pageFreeArray(tls *crt.TLS, pPg uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:71429:12: */
+func pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArray uintptr) int32 { /* sqlite3.c:71578:12: */
var aData uintptr = (*MemPage)(unsafe.Pointer(pPg)).FaData
var pEnd uintptr = (aData + uintptr((*BtShared)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pPg)).FpBt)).FusableSize))
var pStart uintptr = (aData + uintptr(((int32((*MemPage)(unsafe.Pointer(pPg)).FhdrOffset) + 8) + int32((*MemPage)(unsafe.Pointer(pPg)).FchildPtrSize))))
@@ -45574,7 +46954,7 @@ func pageFreeArray(tls *crt.TLS, pPg uintptr, iFirst int32, nCell int32, pCArray
//
// The pPg->nFree field is invalid when this function returns. It is the
// responsibility of the caller to set it correctly.
-func editPage(tls *crt.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pCArray uintptr) int32 { /* sqlite3.c:71486:12: */
+func editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pCArray uintptr) int32 { /* sqlite3.c:71635:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -45608,10 +46988,10 @@ func editPage(tls *crt.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, pCA
if !(nShift > nCell) {
goto __2
}
- return Xsqlite3CorruptError(tls, 71512)
+ return Xsqlite3CorruptError(tls, 71661)
__2:
;
- crt.Xmemmove(tls, (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx, ((*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr((nShift * 2))), (uint64(nCell * 2)))
+ libc.Xmemmove(tls, (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx, ((*MemPage)(unsafe.Pointer(pPg)).FaCellIdx + uintptr((nShift * 2))), (uint64(nCell * 2)))
nCell = nCell - (nShift)
__1:
;
@@ -45644,7 +47024,7 @@ __4:
}()
pCellptr = (*MemPage)(unsafe.Pointer(pPg)).FaCellIdx
- crt.Xmemmove(tls, (pCellptr + uintptr((nAdd * 2))), pCellptr, (uint64(nCell * 2)))
+ libc.Xmemmove(tls, (pCellptr + uintptr((nAdd * 2))), pCellptr, (uint64(nCell * 2)))
if !(pageInsertArray(tls,
pPg, pBegin, bp /* &pData */, pCellptr,
iNew, nAdd, pCArray) != 0) {
@@ -45671,7 +47051,7 @@ __7:
if !(nCell > iCell) {
goto __11
}
- crt.Xmemmove(tls, (pCellptr + uintptr(2)), pCellptr, (uint64((nCell - iCell) * 2)))
+ libc.Xmemmove(tls, (pCellptr + uintptr(2)), pCellptr, (uint64((nCell - iCell) * 2)))
__11:
;
nCell++
@@ -45742,7 +47122,7 @@ editpage_fail:
// byte page number followed by a variable length integer. In other
// words, at most 13 bytes. Hence the pSpace buffer must be at
// least 13 bytes in size.
-func balance_quick(tls *crt.TLS, pParent uintptr, pPage uintptr, pSpace uintptr) int32 { /* sqlite3.c:71614:12: */
+func balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintptr) int32 { /* sqlite3.c:71763:12: */
bp := tls.Alloc(140)
defer tls.Free(140)
@@ -45755,7 +47135,7 @@ func balance_quick(tls *crt.TLS, pParent uintptr, pPage uintptr, pSpace uintptr)
// Page number of pNew
if int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) == 0 {
- return Xsqlite3CorruptError(tls, 71624)
+ return Xsqlite3CorruptError(tls, 71773)
} // dbfuzz001.test
// Allocate a new page. This page will become the right-sibling of
@@ -45767,7 +47147,7 @@ func balance_quick(tls *crt.TLS, pParent uintptr, pPage uintptr, pSpace uintptr)
var pOut uintptr = (pSpace + uintptr(4))
*(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)) = *(*uintptr)(unsafe.Pointer((pPage + 40 /* &.apOvfl */) + uintptr(0)*8))
- *(*U16)(unsafe.Pointer(bp + 24 /* szCell */)) = (*(*func(*crt.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pPage + 120 /* &.xCellSize */))))(tls, pPage, *(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)))
+ *(*U16)(unsafe.Pointer(bp + 24 /* szCell */)) = (*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pPage + 120 /* &.xCellSize */))))(tls, pPage, *(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)))
var pStop uintptr
// var b CellArray at bp+32, 104
@@ -45814,10 +47194,10 @@ func balance_quick(tls *crt.TLS, pParent uintptr, pPage uintptr, pSpace uintptr)
// cell on pPage into the pSpace buffer.
*(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)) = ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & ((int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1)))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) - 1)))) + uintptr(1))))))))
pStop = (*(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)) + uintptr(9))
- for ((int32(*(*U8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)), 1)))) & 0x80) != 0) && (*(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)) < pStop) {
+ for ((int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)), 1)))) & 0x80) != 0) && (*(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)) < pStop) {
}
pStop = (*(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)) + uintptr(9))
- for (((int32(crt.AssignPtrUint8(crt.PostIncUintptr(&pOut, 1), *(*U8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)), 1)))))) & 0x80) != 0) && (*(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)) < pStop) {
+ for (((int32(libc.AssignPtrUint8(libc.PostIncUintptr(&pOut, 1), *(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)), 1)))))) & 0x80) != 0) && (*(*uintptr)(unsafe.Pointer(bp + 16 /* pCell */)) < pStop) {
}
// Insert the new divider cell into pParent.
@@ -45851,7 +47231,7 @@ func balance_quick(tls *crt.TLS, pParent uintptr, pPage uintptr, pSpace uintptr)
// The performance of this function is not critical. It is only used by
// the balance_shallower() and balance_deeper() procedures, neither of
// which are called often under normal circumstances.
-func copyNodeContent(tls *crt.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { /* sqlite3.c:71769:13: */
+func copyNodeContent(tls *libc.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { /* sqlite3.c:71918:13: */
if (*(*int32)(unsafe.Pointer(pRC))) == 0 {
var pBt uintptr = (*MemPage)(unsafe.Pointer(pFrom)).FpBt
var aFrom uintptr = (*MemPage)(unsafe.Pointer(pFrom)).FaData
@@ -45868,8 +47248,8 @@ func copyNodeContent(tls *crt.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { /*
// Copy the b-tree node content from page pFrom to page pTo.
iData = ((int32(*(*U8)(unsafe.Pointer((aFrom + uintptr((iFromHdr + 5))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer((aFrom + uintptr((iFromHdr + 5))) + uintptr(1)))))
- crt.Xmemcpy(tls, (aTo + uintptr(iData)), (aFrom + uintptr(iData)), (uint64((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(iData))))
- crt.Xmemcpy(tls, (aTo + uintptr(iToHdr)), (aFrom + uintptr(iFromHdr)), (uint64(int32((*MemPage)(unsafe.Pointer(pFrom)).FcellOffset) + (2 * int32((*MemPage)(unsafe.Pointer(pFrom)).FnCell)))))
+ libc.Xmemcpy(tls, (aTo + uintptr(iData)), (aFrom + uintptr(iData)), (uint64((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(iData))))
+ libc.Xmemcpy(tls, (aTo + uintptr(iToHdr)), (aFrom + uintptr(iFromHdr)), (uint64(int32((*MemPage)(unsafe.Pointer(pFrom)).FcellOffset) + (2 * int32((*MemPage)(unsafe.Pointer(pFrom)).FnCell)))))
// Reinitialize page pTo so that the contents of the MemPage structure
// match the new data. The initialization of pTo can actually fail under
@@ -45931,7 +47311,7 @@ func copyNodeContent(tls *crt.TLS, pFrom uintptr, pTo uintptr, pRC uintptr) { /*
//
// If aOvflSpace is set to a null pointer, this function returns
// SQLITE_NOMEM.
-func balance_nonroot(tls *crt.TLS, pParent uintptr, iParentIdx int32, aOvflSpace uintptr, isRoot int32, bBulk int32) int32 { /* sqlite3.c:71851:12: */
+func balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpace uintptr, isRoot int32, bBulk int32) int32 { /* sqlite3.c:72000:12: */
bp := tls.Alloc(352)
defer tls.Free(352)
@@ -46024,7 +47404,7 @@ func balance_nonroot(tls *crt.TLS, pParent uintptr, iParentIdx int32, aOvflSpace
iSpace1 = 0
iOvflSpace = 0 // Parsed information on cells being balanced
- crt.Xmemset(tls, bp /* &abDone[0] */, 0, uint64(unsafe.Sizeof([5]U8{})))
+ libc.Xmemset(tls, bp /* &abDone[0] */, 0, uint64(unsafe.Sizeof([5]U8{})))
(*CellArray)(unsafe.Pointer(bp + 96 /* &b */)).FnCell = 0
(*CellArray)(unsafe.Pointer(bp + 96 /* &b */)).FapCell = uintptr(0)
pBt = (*MemPage)(unsafe.Pointer(pParent)).FpBt
@@ -46098,7 +47478,7 @@ __10:
if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) {
goto __12
}
- crt.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint64(i + 1)) * uint64(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint64(i + 1)) * uint64(unsafe.Sizeof(uintptr(0)))))
goto balance_cleanup
__12:
;
@@ -46109,13 +47489,13 @@ __12:
if !(*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) != 0) {
goto __14
}
- crt.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint64(i)) * uint64(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint64(i)) * uint64(unsafe.Sizeof(uintptr(0)))))
goto balance_cleanup
__14:
;
__13:
;
- if !((crt.PostDecInt32(&i, 1)) == 0) {
+ if !((libc.PostDecInt32(&i, 1)) == 0) {
goto __15
}
goto __11
@@ -46127,13 +47507,13 @@ __15:
}
*(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((pParent + 40 /* &.apOvfl */) + uintptr(0)*8))
*(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)) = Xsqlite3Get4byte(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)))
- *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4)) = int32((*(*func(*crt.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pParent + 120 /* &.xCellSize */))))(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8))))
+ *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4)) = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pParent + 120 /* &.xCellSize */))))(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8))))
(*MemPage)(unsafe.Pointer(pParent)).FnOverflow = U8(0)
goto __17
__16:
*(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)) = ((*MemPage)(unsafe.Pointer((pParent))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pParent))).FmaskPage) & ((int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pParent))).FaCellIdx + uintptr((2 * ((i + nxDiv) - int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow))))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pParent))).FaCellIdx + uintptr((2 * ((i + nxDiv) - int32((*MemPage)(unsafe.Pointer(pParent)).FnOverflow))))) + uintptr(1))))))))
*(*Pgno)(unsafe.Pointer(bp + 272 /* pgno */)) = Xsqlite3Get4byte(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)))
- *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4)) = int32((*(*func(*crt.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pParent + 120 /* &.xCellSize */))))(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8))))
+ *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4)) = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pParent + 120 /* &.xCellSize */))))(tls, pParent, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8))))
// Drop the cell from the parent page. apDiv[i] still points to
// the cell within the parent, even though it has been dropped.
@@ -46155,12 +47535,12 @@ __16:
if !((iOff + *(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4))) > int32((*BtShared)(unsafe.Pointer(pBt)).FusableSize)) {
goto __19
}
- *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 71981)
- crt.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint64(i + 1)) * uint64(unsafe.Sizeof(uintptr(0)))))
+ *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72130)
+ libc.Xmemset(tls, bp+8 /* &apOld[0] */, 0, ((uint64(i + 1)) * uint64(unsafe.Sizeof(uintptr(0)))))
goto balance_cleanup
goto __20
__19:
- crt.Xmemcpy(tls, (aOvflSpace + uintptr(iOff)), *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)), uint64(*(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4))))
+ libc.Xmemcpy(tls, (aOvflSpace + uintptr(iOff)), *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)), uint64(*(*int32)(unsafe.Pointer(bp + 48 /* &szNew[0] */ + uintptr(i)*4))))
*(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)) = (aOvflSpace + uintptr(((int64(*(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8))) - int64((*MemPage)(unsafe.Pointer(pParent)).FaData)) / 1)))
__20:
;
@@ -46176,7 +47556,7 @@ __11:
// Make nMaxCells a multiple of 4 in order to preserve 8-byte
// alignment
nMaxCells = (int32(U32(nOld) * ((((*BtShared)(unsafe.Pointer(pBt)).FpageSize - U32(8)) / U32(6)) + (U32((int32(uint64(unsafe.Sizeof([4]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0))))))))))
- nMaxCells = ((nMaxCells + 3) & ^int32(crt.Int32FromInt32(3)))
+ nMaxCells = ((nMaxCells + 3) & ^int32(libc.Int32FromInt32(3)))
// Allocate space for memory structures
szScratch = (int32(((uint64(nMaxCells) * uint64(unsafe.Sizeof(uintptr(0)))) + // b.apCell
@@ -46227,7 +47607,7 @@ __22:
if !(int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(pOld)).FaData + uintptr(0)))) != int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(0)*8)))).FaData + uintptr(0))))) {
goto __25
}
- *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72048)
+ *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72197)
goto balance_cleanup
__25:
;
@@ -46248,14 +47628,14 @@ __25:
// offset section of the btree page will be overwritten and we will no
// long be able to find the cells if a pointer to each cell is not saved
// first.
- crt.Xmemset(tls, ((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FnCell)*2), 0, (uint64(unsafe.Sizeof(U16(0))) * (uint64(limit + int32((*MemPage)(unsafe.Pointer(pOld)).FnOverflow)))))
+ libc.Xmemset(tls, ((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FnCell)*2), 0, (uint64(unsafe.Sizeof(U16(0))) * (uint64(limit + int32((*MemPage)(unsafe.Pointer(pOld)).FnOverflow)))))
if !(int32((*MemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0) {
goto __26
}
if !(limit < int32(*(*U16)(unsafe.Pointer((pOld + 28 /* &.aiOvfl */) + uintptr(0)*2)))) {
goto __27
}
- *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72072)
+ *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72221)
goto balance_cleanup
__27:
;
@@ -46315,7 +47695,7 @@ __35:
pTemp = (aSpace1 + uintptr(iSpace1))
iSpace1 = iSpace1 + (int32(sz))
- crt.Xmemcpy(tls, pTemp, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)), uint64(sz))
+ libc.Xmemcpy(tls, pTemp, *(*uintptr)(unsafe.Pointer(bp + 32 /* &apDiv[0] */ + uintptr(i)*8)), uint64(sz))
*(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FnCell)*8)) = (pTemp + uintptr(leafCorrection))
*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FnCell)*2)) = (U16(int32(*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FnCell)*2))) - int32(leafCorrection)))
@@ -46325,7 +47705,7 @@ __35:
// The right pointer of the child page pOld becomes the left
// pointer of the divider cell
- crt.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FnCell)*8)), ((*MemPage)(unsafe.Pointer(pOld)).FaData + uintptr(8)), uint64(4))
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FapCell + uintptr((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FnCell)*8)), ((*MemPage)(unsafe.Pointer(pOld)).FaData + uintptr(8)), uint64(4))
goto __38
__37:
;
@@ -46336,7 +47716,7 @@ __39:
// Do not allow any cells smaller than 4 bytes. If a smaller cell
// does exist, pad it with 0x00 bytes.
- *(*U8)(unsafe.Pointer(aSpace1 + uintptr(crt.PostIncInt32(&iSpace1, 1)))) = U8(0x00)
+ *(*U8)(unsafe.Pointer(aSpace1 + uintptr(libc.PostIncInt32(&iSpace1, 1)))) = U8(0x00)
*(*U16)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FszCell + uintptr((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FnCell)*2))++
goto __39
__40:
@@ -46369,7 +47749,7 @@ __24:
// usableSpace: Number of bytes of space available on each sibling.
//
usableSpace = (int32(((*BtShared)(unsafe.Pointer(pBt)).FusableSize - U32(12)) + U32(leafCorrection)))
- i = crt.AssignInt32(&k, 0)
+ i = libc.AssignInt32(&k, 0)
__41:
if !(i < nOld) {
goto __43
@@ -46398,7 +47778,7 @@ __46:
if !(j < int32((*MemPage)(unsafe.Pointer(p)).FnOverflow)) {
goto __48
}
- *(*int32)(unsafe.Pointer(bp + 48 /* &szNew */ + uintptr(i)*4)) += (2 + int32((*(*func(*crt.TLS, uintptr, uintptr) U16)(unsafe.Pointer((p + 120 /* &.xCellSize */))))(tls, p, *(*uintptr)(unsafe.Pointer((p + 40 /* &.apOvfl */) + uintptr(j)*8)))))
+ *(*int32)(unsafe.Pointer(bp + 48 /* &szNew */ + uintptr(i)*4)) += (2 + int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((p + 120 /* &.xCellSize */))))(tls, p, *(*uintptr)(unsafe.Pointer((p + 40 /* &.apOvfl */) + uintptr(j)*8)))))
goto __47
__47:
j++
@@ -46432,7 +47812,7 @@ __52:
if !(k > (3 + 2)) {
goto __55
}
- *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72173)
+ *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72322)
goto balance_cleanup
__55:
;
@@ -46506,7 +47886,7 @@ __65:
}())) {
goto __67
}
- *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72206)
+ *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72355)
goto balance_cleanup
__67:
;
@@ -46579,7 +47959,7 @@ __73:
}())) {
goto __75
}
- *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72248)
+ *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72397)
goto balance_cleanup
__75:
;
@@ -46608,7 +47988,7 @@ __76:
if !(i < nOld) {
goto __79
}
- *(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)) = crt.AssignPtrUintptr(bp+224 /* &apNew */ +uintptr(i)*8, *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8)))
+ *(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)) = libc.AssignPtrUintptr(bp+224 /* &apNew */ +uintptr(i)*8, *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8)))
*(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(i)*8)) = uintptr(0)
*(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264 /* pNew */)))).FpDbPage)
nNew++
@@ -46676,7 +48056,7 @@ __85:
if !(i < nNew) {
goto __87
}
- *(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(i)*4)) = crt.AssignPtrUint32(bp+296 /* &aPgno */ +uintptr(i)*4, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno)
+ *(*Pgno)(unsafe.Pointer(bp + 276 /* &aPgOrder[0] */ + uintptr(i)*4)) = libc.AssignPtrUint32(bp+296 /* &aPgno */ +uintptr(i)*4, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).Fpgno)
*(*U16)(unsafe.Pointer(bp + 316 /* &aPgFlags[0] */ + uintptr(i)*2)) = (*DbPage)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(i)*8)))).FpDbPage)).Fflags
j = 0
__88:
@@ -46693,7 +48073,7 @@ __88:
// cache with two separate objects associated with the same
// page number.
- *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72322)
+ *(*int32)(unsafe.Pointer(bp + 68 /* rc */)) = Xsqlite3CorruptError(tls, 72471)
goto balance_cleanup
__91:
;
@@ -46772,7 +48152,7 @@ __94:
}
return bp + 8 /* &apOld[0] */
}() + uintptr((nOld-1))*8))
- crt.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr((nNew-1))*8)))).FaData + uintptr(8)), ((*MemPage)(unsafe.Pointer(pOld1)).FaData + uintptr(8)), uint64(4))
+ libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr((nNew-1))*8)))).FaData + uintptr(8)), ((*MemPage)(unsafe.Pointer(pOld1)).FaData + uintptr(8)), uint64(4))
__101:
;
@@ -46794,7 +48174,7 @@ __101:
if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
goto __102
}
- pNew1 = crt.AssignUintptr(&pOld2, *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(0)*8)))
+ pNew1 = libc.AssignUintptr(&pOld2, *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(0)*8)))
cntOldNext = (int32((*MemPage)(unsafe.Pointer(pNew1)).FnCell) + int32((*MemPage)(unsafe.Pointer(pNew1)).FnOverflow))
iNew = 0
iOld = 0
@@ -46816,14 +48196,14 @@ __106:
} else {
pOld2 = *(*uintptr)(unsafe.Pointer(bp + 8 /* &apOld[0] */ + uintptr(iOld)*8))
}
- cntOldNext = cntOldNext + ((int32((*MemPage)(unsafe.Pointer(pOld2)).FnCell) + int32((*MemPage)(unsafe.Pointer(pOld2)).FnOverflow)) + crt.BoolInt32(!(leafData != 0)))
+ cntOldNext = cntOldNext + ((int32((*MemPage)(unsafe.Pointer(pOld2)).FnCell) + int32((*MemPage)(unsafe.Pointer(pOld2)).FnOverflow)) + libc.BoolInt32(!(leafData != 0)))
goto __106
__107:
;
if !(i == *(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr(iNew)*4))) {
goto __108
}
- pNew1 = *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(crt.PreIncInt32(&iNew, 1))*8))
+ pNew1 = *(*uintptr)(unsafe.Pointer(bp + 224 /* &apNew[0] */ + uintptr(libc.PreIncInt32(&iNew, 1))*8))
if !(!(leafData != 0)) {
goto __109
}
@@ -46889,14 +48269,14 @@ __114:
if !(!(int32((*MemPage)(unsafe.Pointer(pNew2)).Fleaf) != 0)) {
goto __117
}
- crt.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pNew2)).FaData + uintptr(8)), pCell1, uint64(4))
+ libc.Xmemcpy(tls, ((*MemPage)(unsafe.Pointer(pNew2)).FaData + uintptr(8)), pCell1, uint64(4))
goto __118
__117:
if !(leafData != 0) {
goto __119
}
j--
- (*(*func(*crt.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pNew2 + 128 /* &.xParseCell */))))(tls, pNew2, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FapCell + uintptr(j)*8)), bp+328 /* &info */)
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pNew2 + 128 /* &.xParseCell */))))(tls, pNew2, *(*uintptr)(unsafe.Pointer((*CellArray)(unsafe.Pointer(bp+96 /* &b */)).FapCell + uintptr(j)*8)), bp+328 /* &info */)
pCell1 = pTemp1
sz2 = (4 + Xsqlite3PutVarint(tls, (pCell1+uintptr(4)), uint64((*CellInfo)(unsafe.Pointer(bp+328 /* &info */)).FnKey)))
pTemp1 = uintptr(0)
@@ -46917,7 +48297,7 @@ __119:
goto __121
}
- sz2 = int32((*(*func(*crt.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pParent + 120 /* &.xCellSize */))))(tls, pParent, pCell1))
+ sz2 = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pParent + 120 /* &.xCellSize */))))(tls, pParent, pCell1))
__121:
;
__120:
@@ -46993,16 +48373,16 @@ __126:
if !(iPg == 0) {
goto __128
}
- iNew1 = crt.AssignInt32(&iOld1, 0)
+ iNew1 = libc.AssignInt32(&iOld1, 0)
nNewCell = *(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr(0)*4))
goto __129
__128:
if iPg < nOld {
- iOld1 = (*(*int32)(unsafe.Pointer(bp + 72 /* &cntOld[0] */ + uintptr((iPg-1))*4)) + crt.BoolInt32(!(leafData != 0)))
+ iOld1 = (*(*int32)(unsafe.Pointer(bp + 72 /* &cntOld[0] */ + uintptr((iPg-1))*4)) + libc.BoolInt32(!(leafData != 0)))
} else {
iOld1 = (*CellArray)(unsafe.Pointer(bp + 96 /* &b */)).FnCell
}
- iNew1 = (*(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr((iPg-1))*4)) + crt.BoolInt32(!(leafData != 0)))
+ iNew1 = (*(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr((iPg-1))*4)) + libc.BoolInt32(!(leafData != 0)))
nNewCell = (*(*int32)(unsafe.Pointer(bp + 200 /* &cntNew[0] */ + uintptr(iPg)*4)) - iNew1)
__129:
;
@@ -47143,7 +48523,7 @@ __145:
// page and SQLITE_OK is returned. In this case the caller is required
// to call releasePage() on *ppChild exactly once. If an error occurs,
// an error code is returned and *ppChild is set to 0.
-func balance_deeper(tls *crt.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sqlite3.c:72637:12: */
+func balance_deeper(tls *libc.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sqlite3.c:72786:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -47171,14 +48551,14 @@ func balance_deeper(tls *crt.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sql
}
// Copy the overflow cells from pRoot to pChild
- crt.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp /* pChild */))+28 /* &.aiOvfl */, pRoot+28, /* &.aiOvfl */
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp /* pChild */))+28 /* &.aiOvfl */, pRoot+28, /* &.aiOvfl */
(uint64((*MemPage)(unsafe.Pointer(pRoot)).FnOverflow) * uint64(unsafe.Sizeof(U16(0)))))
- crt.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp /* pChild */))+40 /* &.apOvfl */, pRoot+40, /* &.apOvfl */
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp /* pChild */))+40 /* &.apOvfl */, pRoot+40, /* &.apOvfl */
(uint64((*MemPage)(unsafe.Pointer(pRoot)).FnOverflow) * uint64(unsafe.Sizeof(uintptr(0)))))
(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pChild */)))).FnOverflow = (*MemPage)(unsafe.Pointer(pRoot)).FnOverflow
// Zero the contents of pRoot. Then install pChild as the right-child.
- zeroPage(tls, pRoot, (int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pChild */)))).FaData + uintptr(0)))) & ^int32(crt.Int32FromInt32(0x08))))
+ zeroPage(tls, pRoot, (int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pChild */)))).FaData + uintptr(0)))) & ^int32(libc.Int32FromInt32(0x08))))
Xsqlite3Put4byte(tls, ((*MemPage)(unsafe.Pointer(pRoot)).FaData + uintptr((int32((*MemPage)(unsafe.Pointer(pRoot)).FhdrOffset) + 8))), *(*Pgno)(unsafe.Pointer(bp + 8 /* pgnoChild */)))
*(*uintptr)(unsafe.Pointer(ppChild)) = *(*uintptr)(unsafe.Pointer(bp /* pChild */))
@@ -47194,13 +48574,13 @@ func balance_deeper(tls *crt.TLS, pRoot uintptr, ppChild uintptr) int32 { /* sql
// table linked to the same b-tree. If the secondary insert causes a
// rebalance, that can change content out from under the cursor on the
// first SQL table, violating invariants on the first insert.
-func anotherValidCursor(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:72695:12: */
+func anotherValidCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:72844:12: */
var pOther uintptr
for pOther = (*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpCursor; pOther != 0; pOther = (*BtCursor)(unsafe.Pointer(pOther)).FpNext {
if ((pOther != pCur) &&
(int32((*BtCursor)(unsafe.Pointer(pOther)).FeState) == 0)) &&
((*BtCursor)(unsafe.Pointer(pOther)).FpPage == (*BtCursor)(unsafe.Pointer(pCur)).FpPage) {
- return Xsqlite3CorruptError(tls, 72702)
+ return Xsqlite3CorruptError(tls, 72851)
}
}
return 0
@@ -47214,7 +48594,7 @@ func anotherValidCursor(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:72695:1
// balance_quick()
// balance_deeper()
// balance_nonroot()
-func balance(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:72718:12: */
+func balance(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:72867:12: */
bp := tls.Alloc(13)
defer tls.Free(13)
@@ -47233,13 +48613,12 @@ func balance(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:72718:12: */
}
if (int32((*MemPage)(unsafe.Pointer(pPage)).FnOverflow) == 0) && ((*MemPage)(unsafe.Pointer(pPage)).FnFree <= nMin) {
break
- } else if (crt.AssignInt32(&iPage, int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage))) == 0 {
- if ((*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0) && ((crt.AssignInt32(&rc, anotherValidCursor(tls, pCur))) == 0) {
- /* The root page of the b-tree is overfull. In this case call the
- ** balance_deeper() function to create a new child for the root-page
- ** and copy the current contents of the root-page to it. The
- ** next iteration of the do-loop will balance the child page.
- */
+ } else if (libc.AssignInt32(&iPage, int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage))) == 0 {
+ if ((*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0) && ((libc.AssignInt32(&rc, anotherValidCursor(tls, pCur))) == 0) {
+ // The root page of the b-tree is overfull. In this case call the
+ // balance_deeper() function to create a new child for the root-page
+ // and copy the current contents of the root-page to it. The
+ // next iteration of the do-loop will balance the child page.
rc = balance_deeper(tls, pPage, ((pCur + 144 /* &.apPage */) + uintptr(1)*8))
if rc == 0 {
@@ -47298,7 +48677,7 @@ func balance(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:72718:12: */
// copied either into the body of a database page or into the new
// pSpace buffer passed to the latter call to balance_nonroot().
var pSpace uintptr = Xsqlite3PageMalloc(tls, int32((*BtShared)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBt)).FpageSize))
- rc = balance_nonroot(tls, pParent, iIdx, pSpace, (crt.Bool32(iPage == 1)),
+ rc = balance_nonroot(tls, pParent, iIdx, pSpace, (libc.Bool32(iPage == 1)),
(int32((*BtCursor)(unsafe.Pointer(pCur)).Fhints) & 0x00000001))
if pFree != 0 {
// If pFree is not NULL, it points to the pSpace buffer used
@@ -47333,7 +48712,7 @@ func balance(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:72718:12: */
// Overwrite content from pX into pDest. Only do the write if the
// content is different from what is already there.
-func btreeOverwriteContent(tls *crt.TLS, pPage uintptr, pDest uintptr, pX uintptr, iOffset int32, iAmt int32) int32 { /* sqlite3.c:72844:12: */
+func btreeOverwriteContent(tls *libc.TLS, pPage uintptr, pDest uintptr, pX uintptr, iOffset int32, iAmt int32) int32 { /* sqlite3.c:72993:12: */
var nData int32 = ((*BtreePayload)(unsafe.Pointer(pX)).FnData - iOffset)
if nData <= 0 {
// Overwritting with zeros
@@ -47345,7 +48724,7 @@ func btreeOverwriteContent(tls *crt.TLS, pPage uintptr, pDest uintptr, pX uintpt
if rc != 0 {
return rc
}
- crt.Xmemset(tls, (pDest + uintptr(i)), 0, (uint64(iAmt - i)))
+ libc.Xmemset(tls, (pDest + uintptr(i)), 0, (uint64(iAmt - i)))
}
} else {
if nData < iAmt {
@@ -47358,7 +48737,7 @@ func btreeOverwriteContent(tls *crt.TLS, pPage uintptr, pDest uintptr, pX uintpt
}
iAmt = nData
}
- if crt.Xmemcmp(tls, pDest, (((*BtreePayload)(unsafe.Pointer(pX)).FpData)+uintptr(iOffset)), uint64(iAmt)) != 0 {
+ if libc.Xmemcmp(tls, pDest, (((*BtreePayload)(unsafe.Pointer(pX)).FpData)+uintptr(iOffset)), uint64(iAmt)) != 0 {
var rc int32 = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
if rc != 0 {
return rc
@@ -47367,7 +48746,7 @@ func btreeOverwriteContent(tls *crt.TLS, pPage uintptr, pDest uintptr, pX uintpt
// buffers to overlap. This is harmless since the database is already
// corrupt but it does cause valgrind and ASAN warnings. So use
// memmove().
- crt.Xmemmove(tls, pDest, (((*BtreePayload)(unsafe.Pointer(pX)).FpData) + uintptr(iOffset)), uint64(iAmt))
+ libc.Xmemmove(tls, pDest, (((*BtreePayload)(unsafe.Pointer(pX)).FpData) + uintptr(iOffset)), uint64(iAmt))
}
}
return 0
@@ -47375,7 +48754,7 @@ func btreeOverwriteContent(tls *crt.TLS, pPage uintptr, pDest uintptr, pX uintpt
// Overwrite the cell that cursor pCur is pointing to with fresh content
// contained in pX.
-func btreeOverwriteCell(tls *crt.TLS, pCur uintptr, pX uintptr) int32 { /* sqlite3.c:72887:12: */
+func btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) int32 { /* sqlite3.c:73036:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -47389,7 +48768,7 @@ func btreeOverwriteCell(tls *crt.TLS, pCur uintptr, pX uintptr) int32 { /* sqlit
if (((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload + uintptr((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal)) > (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaDataEnd) ||
((*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < ((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData + uintptr((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FcellOffset))) {
- return Xsqlite3CorruptError(tls, 72899)
+ return Xsqlite3CorruptError(tls, 73048)
}
// Overwrite the local portion first
rc = btreeOverwriteContent(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)), (*BtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload, pX,
@@ -47413,7 +48792,7 @@ func btreeOverwriteCell(tls *crt.TLS, pCur uintptr, pX uintptr) int32 { /* sqlit
return rc
}
if Xsqlite3PagerPageRefcount(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage) != 1 {
- rc = Xsqlite3CorruptError(tls, 72918)
+ rc = Xsqlite3CorruptError(tls, 73067)
} else {
if (U32(iOffset) + ovflPageSize) < U32(nTotal) {
ovflPgno = Xsqlite3Get4byte(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData)
@@ -47460,7 +48839,7 @@ func btreeOverwriteCell(tls *crt.TLS, pCur uintptr, pX uintptr) int32 { /* sqlit
// if pX->nMem is non-zero, then pX->aMem contains pointers to the unpacked
// key values and pX->aMem can be used instead of pX->pKey to avoid having
// to decode the key.
-func Xsqlite3BtreeInsert(tls *crt.TLS, pCur uintptr, pX uintptr, flags int32, seekResult int32) int32 { /* sqlite3.c:72966:20: */
+func Xsqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, seekResult int32) int32 { /* sqlite3.c:73115:20: */
bp := tls.Alloc(116)
defer tls.Free(116)
@@ -47560,7 +48939,7 @@ __6:
// The cursor is *not* pointing to the cell to be overwritten, nor
// to an adjacent cell. Move the cursor so that it is pointing either
// to the cell to be overwritten or an adjacent cell.
- *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, uintptr(0), (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (crt.Bool32(flags != 0)), bp /* &loc */)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, uintptr(0), (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (libc.Bool32(flags != 0)), bp /* &loc */)
if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) {
goto __10
}
@@ -47597,10 +48976,10 @@ __4:
(*UnpackedRecord)(unsafe.Pointer(bp + 8 /* &r */)).Fr1 = int8(0)
(*UnpackedRecord)(unsafe.Pointer(bp + 8 /* &r */)).Fr2 = int8(0)
(*UnpackedRecord)(unsafe.Pointer(bp + 8 /* &r */)).FeqSeen = U8(0)
- *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, bp+8 /* &r */, int64(0), (crt.Bool32(flags != 0)), bp /* &loc */)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3BtreeMovetoUnpacked(tls, pCur, bp+8 /* &r */, int64(0), (libc.Bool32(flags != 0)), bp /* &loc */)
goto __13
__12:
- *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = btreeMoveto(tls, pCur, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (crt.Bool32(flags != 0)), bp /* &loc */)
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = btreeMoveto(tls, pCur, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FnKey, (libc.Bool32(flags != 0)), bp /* &loc */)
__13:
;
if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) {
@@ -47638,12 +49017,20 @@ __5:
if !((*MemPage)(unsafe.Pointer(pPage)).FnFree < 0) {
goto __17
}
+ if !(int32((*BtCursor)(unsafe.Pointer(pCur)).FeState) > 1) {
+ goto __18
+ }
+ *(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3CorruptError(tls, 73263)
+ goto __19
+__18:
*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = btreeComputeFreeSpace(tls, pPage)
+__19:
+ ;
if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) {
- goto __18
+ goto __20
}
return *(*int32)(unsafe.Pointer(bp + 112 /* rc */))
-__18:
+__20:
;
__17:
;
@@ -47652,37 +49039,37 @@ __17:
*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = fillInCell(tls, pPage, newCell, pX, bp+80 /* &szNew */)
if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) {
- goto __19
+ goto __21
}
goto end_insert
-__19:
+__21:
;
idx = int32((*BtCursor)(unsafe.Pointer(pCur)).Fix)
if !(*(*int32)(unsafe.Pointer(bp /* loc */)) == 0) {
- goto __20
+ goto __22
}
*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(pPage)).FpDbPage)
if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) {
- goto __22
+ goto __24
}
goto end_insert
-__22:
+__24:
;
oldCell = ((*MemPage)(unsafe.Pointer((pPage))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pPage))).FmaskPage) & ((int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (idx)))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pPage))).FaCellIdx + uintptr((2 * (idx)))) + uintptr(1))))))))
if !(!(int32((*MemPage)(unsafe.Pointer(pPage)).Fleaf) != 0)) {
- goto __23
+ goto __25
}
- crt.Xmemcpy(tls, newCell, oldCell, uint64(4))
-__23:
+ libc.Xmemcpy(tls, newCell, oldCell, uint64(4))
+__25:
;
*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = clearCell(tls, pPage, oldCell, bp+88 /* &info */)
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(0x04))))
+ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(0x04))))
if !(((int32((*CellInfo)(unsafe.Pointer(bp+88 /* &info */)).FnSize) == *(*int32)(unsafe.Pointer(bp + 80 /* szNew */))) && (U32((*CellInfo)(unsafe.Pointer(bp+88 /* &info */)).FnLocal) == (*CellInfo)(unsafe.Pointer(bp+88 /* &info */)).FnPayload)) &&
(!(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0) || (*(*int32)(unsafe.Pointer(bp + 80 /* szNew */)) < int32((*MemPage)(unsafe.Pointer(pPage)).FminLocal)))) {
- goto __24
+ goto __26
}
// Overwrite the old cell with the new if they are the same size.
// We could also try to do this if the old cell is smaller, then add
@@ -47695,42 +49082,42 @@ __23:
// necessary to add the PTRMAP_OVERFLOW1 pointer-map entry.
// clearCell never fails when nLocal==nPayload
if !(oldCell < (((*MemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*MemPage)(unsafe.Pointer(pPage)).FhdrOffset)) + uintptr(10))) {
- goto __25
+ goto __27
}
- return Xsqlite3CorruptError(tls, 73156)
-__25:
+ return Xsqlite3CorruptError(tls, 73309)
+__27:
;
if !((oldCell + uintptr(*(*int32)(unsafe.Pointer(bp + 80 /* szNew */)))) > (*MemPage)(unsafe.Pointer(pPage)).FaDataEnd) {
- goto __26
+ goto __28
}
- return Xsqlite3CorruptError(tls, 73159)
-__26:
+ return Xsqlite3CorruptError(tls, 73312)
+__28:
;
- crt.Xmemcpy(tls, oldCell, newCell, uint64(*(*int32)(unsafe.Pointer(bp + 80 /* szNew */))))
+ libc.Xmemcpy(tls, oldCell, newCell, uint64(*(*int32)(unsafe.Pointer(bp + 80 /* szNew */))))
return 0
-__24:
+__26:
;
dropCell(tls, pPage, idx, int32((*CellInfo)(unsafe.Pointer(bp+88 /* &info */)).FnSize), bp+112 /* &rc */)
if !(*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) != 0) {
- goto __27
+ goto __29
}
goto end_insert
-__27:
+__29:
;
- goto __21
-__20:
+ goto __23
+__22:
if !((*(*int32)(unsafe.Pointer(bp /* loc */)) < 0) && (int32((*MemPage)(unsafe.Pointer(pPage)).FnCell) > 0)) {
- goto __28
+ goto __30
}
- idx = int32(crt.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1))
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(0x02))))
- goto __29
-__28:
+ idx = int32(libc.PreIncUint16(&(*BtCursor)(unsafe.Pointer(pCur)).Fix, 1))
+ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(0x02))))
+ goto __31
+__30:
;
-__29:
+__31:
;
-__21:
+__23:
;
insertCell(tls, pPage, idx, newCell, *(*int32)(unsafe.Pointer(bp + 80 /* szNew */)), uintptr(0), uint32(0), bp+112 /* &rc */)
@@ -47755,10 +49142,10 @@ __21:
// row without seeking the cursor. This can be a big performance boost.
(*BtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = U16(0)
if !((*MemPage)(unsafe.Pointer(pPage)).FnOverflow != 0) {
- goto __30
+ goto __32
}
- *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32(0x02))))
+ *(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32(0x02))))
*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = balance(tls, pCur)
// Must make sure nOverflow is reset to zero even if the balance()
@@ -47768,30 +49155,30 @@ __21:
(*MemPage)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpPage)).FnOverflow = U8(0)
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(1)
if !(((flags & 0x02) != 0) && (*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) == 0)) {
- goto __31
+ goto __33
}
btreeReleaseAllCursorPages(tls, pCur)
if !((*BtCursor)(unsafe.Pointer(pCur)).FpKeyInfo != 0) {
- goto __32
+ goto __34
}
(*BtCursor)(unsafe.Pointer(pCur)).FpKey = Xsqlite3Malloc(tls, uint64((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
if !((*BtCursor)(unsafe.Pointer(pCur)).FpKey == uintptr(0)) {
- goto __33
+ goto __35
}
*(*int32)(unsafe.Pointer(bp + 112 /* rc */)) = 7
- goto __34
-__33:
- crt.Xmemcpy(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, uint64((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
-__34:
+ goto __36
+__35:
+ libc.Xmemcpy(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpKey, (*BtreePayload)(unsafe.Pointer(pX)).FpKey, uint64((*BtreePayload)(unsafe.Pointer(pX)).FnKey))
+__36:
;
-__32:
+__34:
;
(*BtCursor)(unsafe.Pointer(pCur)).FeState = U8(3)
(*BtCursor)(unsafe.Pointer(pCur)).FnKey = (*BtreePayload)(unsafe.Pointer(pX)).FnKey
-__31:
+__33:
;
-__30:
+__32:
;
end_insert:
@@ -47813,7 +49200,7 @@ end_insert:
// operation on non-FORDELETE cursors is tagged with the AUXDELETE flag.
// The BTREE_AUXDELETE bit is a hint that is not used by this implementation,
// but which might be used by alternative storage engines.
-func Xsqlite3BtreeDelete(tls *crt.TLS, pCur uintptr, flags U8) int32 { /* sqlite3.c:73247:20: */
+func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32 { /* sqlite3.c:73400:20: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -47824,7 +49211,7 @@ func Xsqlite3BtreeDelete(tls *crt.TLS, pCur uintptr, flags U8) int32 { /* sqlite
var pPage uintptr // Page to delete cell from
var pCell uintptr // Pointer to cell to delete
var iCellIdx int32 // Index of cell to delete
- var iCellDepth int32 /* Depth of node containing pCell */
+ var iCellDepth int32 // Depth of node containing pCell
// var info CellInfo at bp, 24
// Size of the cell being deleted
var bSkipnext int32 = 0 // Leaf cursor in SKIPNEXT state
@@ -47936,9 +49323,9 @@ func Xsqlite3BtreeDelete(tls *crt.TLS, pCur uintptr, flags U8) int32 { /* sqlite
}
pCell = ((*MemPage)(unsafe.Pointer((pLeaf))).FaData + uintptr((int32((*MemPage)(unsafe.Pointer((pLeaf))).FmaskPage) & ((int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pLeaf))).FaCellIdx + uintptr((2 * (int32((*MemPage)(unsafe.Pointer(pLeaf)).FnCell) - 1)))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer(((*MemPage)(unsafe.Pointer((pLeaf))).FaCellIdx + uintptr((2 * (int32((*MemPage)(unsafe.Pointer(pLeaf)).FnCell) - 1)))) + uintptr(1))))))))
if pCell < ((*MemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(4)) {
- return Xsqlite3CorruptError(tls, 73357)
+ return Xsqlite3CorruptError(tls, 73510)
}
- nCell = int32((*(*func(*crt.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pLeaf + 120 /* &.xCellSize */))))(tls, pLeaf, pCell))
+ nCell = int32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((pLeaf + 120 /* &.xCellSize */))))(tls, pLeaf, pCell))
pTmp = (*BtShared)(unsafe.Pointer(pBt)).FpTmpSpace
@@ -47972,7 +49359,7 @@ func Xsqlite3BtreeDelete(tls *crt.TLS, pCur uintptr, flags U8) int32 { /* sqlite
releasePageNotNull(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpPage)
(*BtCursor)(unsafe.Pointer(pCur)).FiPage--
for int32((*BtCursor)(unsafe.Pointer(pCur)).FiPage) > iCellDepth {
- releasePage(tls, *(*uintptr)(unsafe.Pointer((pCur + 144 /* &.apPage */) + uintptr(crt.PostDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1))*8)))
+ releasePage(tls, *(*uintptr)(unsafe.Pointer((pCur + 144 /* &.apPage */) + uintptr(libc.PostDecInt8(&(*BtCursor)(unsafe.Pointer(pCur)).FiPage, 1))*8)))
}
(*BtCursor)(unsafe.Pointer(pCur)).FpPage = *(*uintptr)(unsafe.Pointer((pCur + 144 /* &.apPage */) + uintptr((*BtCursor)(unsafe.Pointer(pCur)).FiPage)*8))
*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = balance(tls, pCur)
@@ -48011,7 +49398,7 @@ func Xsqlite3BtreeDelete(tls *crt.TLS, pCur uintptr, flags U8) int32 { /* sqlite
//
// BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys
// BTREE_ZERODATA Used for SQL indices
-func btreeCreateTable(tls *crt.TLS, p uintptr, piTable uintptr, createTabFlags int32) int32 { /* sqlite3.c:73431:12: */
+func btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags int32) int32 { /* sqlite3.c:73584:12: */
bp := tls.Alloc(44)
defer tls.Free(44)
@@ -48040,6 +49427,9 @@ func btreeCreateTable(tls *crt.TLS, p uintptr, piTable uintptr, createTabFlags i
// root page of the new table should go. meta[3] is the largest root-page
// created so far, so the new root-page is (meta[3]+1).
Xsqlite3BtreeGetMeta(tls, p, 4, bp /* &pgnoRoot */)
+ if *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)) > btreePagecount(tls, pBt) {
+ return Xsqlite3CorruptError(tls, 73618)
+ }
*(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */))++
// The new root-page may not be allocated on a pointer-map page, or the
@@ -48081,7 +49471,7 @@ func btreeCreateTable(tls *crt.TLS, p uintptr, piTable uintptr, createTabFlags i
}
*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = ptrmapGet(tls, pBt, *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)), bp+32 /* &eType */, bp+36 /* &iPtrPage */)
if (int32(*(*U8)(unsafe.Pointer(bp + 32 /* eType */))) == 1) || (int32(*(*U8)(unsafe.Pointer(bp + 32 /* eType */))) == 2) {
- *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = Xsqlite3CorruptError(tls, 73511)
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = Xsqlite3CorruptError(tls, 73666)
}
if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != 0 {
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)))
@@ -48139,10 +49529,10 @@ func btreeCreateTable(tls *crt.TLS, p uintptr, piTable uintptr, createTabFlags i
zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)), ptfFlags)
Xsqlite3PagerUnref(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)))).FpDbPage)
- *(*int32)(unsafe.Pointer(piTable)) = int32(*(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */)))
+ *(*Pgno)(unsafe.Pointer(piTable)) = *(*Pgno)(unsafe.Pointer(bp /* pgnoRoot */))
return 0
}
-func Xsqlite3BtreeCreateTable(tls *crt.TLS, p uintptr, piTable uintptr, flags int32) int32 { /* sqlite3.c:73574:20: */
+func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags int32) int32 { /* sqlite3.c:73729:20: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
rc = btreeCreateTable(tls, p, piTable, flags)
@@ -48152,7 +49542,7 @@ func Xsqlite3BtreeCreateTable(tls *crt.TLS, p uintptr, piTable uintptr, flags in
// Erase the given database page and all its children. Return
// the page to the freelist.
-func clearDatabasePage(tls *crt.TLS, pBt uintptr, pgno Pgno, freePageFlag int32, pnChange uintptr) int32 { /* sqlite3.c:73586:12: */
+func clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno Pgno, freePageFlag int32, pnChange uintptr) int32 { /* sqlite3.c:73741:12: */
bp := tls.Alloc(36)
defer tls.Free(36)
@@ -48168,7 +49558,7 @@ func clearDatabasePage(tls *crt.TLS, pBt uintptr, pgno Pgno, freePageFlag int32,
if !(pgno > btreePagecount(tls, pBt)) {
goto __1
}
- return Xsqlite3CorruptError(tls, 73601)
+ return Xsqlite3CorruptError(tls, 73756)
__1:
;
*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = getAndInitPage(tls, pBt, pgno, bp /* &pPage */, uintptr(0), 0)
@@ -48181,7 +49571,7 @@ __2:
if !((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FbBusy != 0) {
goto __3
}
- *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3CorruptError(tls, 73606)
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3CorruptError(tls, 73761)
goto cleardatabasepage_out
__3:
;
@@ -48246,7 +49636,7 @@ __11:
freePage(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)), bp+32 /* &rc */)
goto __15
__14:
- if !((crt.AssignPtrInt32(bp+32 /* rc */, Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage))) == 0) {
+ if !((libc.AssignPtrInt32(bp+32 /* rc */, Xsqlite3PagerWrite(tls, (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FpDbPage))) == 0) {
goto __16
}
zeroPage(tls, *(*uintptr)(unsafe.Pointer(bp /* pPage */)), (int32(*(*U8)(unsafe.Pointer((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pPage */)))).FaData + uintptr(hdr)))) | 0x08))
@@ -48272,7 +49662,7 @@ cleardatabasepage_out:
// If pnChange is not NULL, then table iTable must be an intkey table. The
// integer value pointed to by pnChange is incremented by the number of
// entries in the table.
-func Xsqlite3BtreeClearTable(tls *crt.TLS, p uintptr, iTable int32, pnChange uintptr) int32 { /* sqlite3.c:73653:20: */
+func Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange uintptr) int32 { /* sqlite3.c:73808:20: */
var rc int32
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
@@ -48293,7 +49683,7 @@ func Xsqlite3BtreeClearTable(tls *crt.TLS, p uintptr, iTable int32, pnChange uin
// Delete all information from the single table that pCur is open on.
//
// This routine only work for pCur on an ephemeral table.
-func Xsqlite3BtreeClearTableOfCursor(tls *crt.TLS, pCur uintptr) int32 { /* sqlite3.c:73677:20: */
+func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:73832:20: */
return Xsqlite3BtreeClearTable(tls, (*BtCursor)(unsafe.Pointer(pCur)).FpBtree, int32((*BtCursor)(unsafe.Pointer(pCur)).FpgnoRoot), uintptr(0))
}
@@ -48315,7 +49705,7 @@ func Xsqlite3BtreeClearTableOfCursor(tls *crt.TLS, pCur uintptr) int32 { /* sqli
// the move. If no page gets moved, *piMoved is set to 0.
// The last root page is recorded in meta[3] and the value of
// meta[3] is updated by this procedure.
-func btreeDropTable(tls *crt.TLS, p uintptr, iTable Pgno, piMoved uintptr) int32 { /* sqlite3.c:73701:12: */
+func btreeDropTable(tls *libc.TLS, p uintptr, iTable Pgno, piMoved uintptr) int32 { /* sqlite3.c:73856:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -48325,7 +49715,7 @@ func btreeDropTable(tls *crt.TLS, p uintptr, iTable Pgno, piMoved uintptr) int32
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
if iTable > btreePagecount(tls, pBt) {
- return Xsqlite3CorruptError(tls, 73710)
+ return Xsqlite3CorruptError(tls, 73865)
}
*(*int32)(unsafe.Pointer(bp + 12 /* rc */)) = btreeGetPage(tls, pBt, iTable, bp /* &pPage */, 0)
@@ -48396,7 +49786,7 @@ func btreeDropTable(tls *crt.TLS, p uintptr, iTable Pgno, piMoved uintptr) int32
}
return *(*int32)(unsafe.Pointer(bp + 12 /* rc */))
}
-func Xsqlite3BtreeDropTable(tls *crt.TLS, p uintptr, iTable int32, piMoved uintptr) int32 { /* sqlite3.c:73786:20: */
+func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uintptr) int32 { /* sqlite3.c:73941:20: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
rc = btreeDropTable(tls, p, uint32(iTable), piMoved)
@@ -48422,7 +49812,7 @@ func Xsqlite3BtreeDropTable(tls *crt.TLS, p uintptr, iTable int32, piMoved uintp
// database file. It is a number computed by the pager. But its access
// pattern is the same as header meta values, and so it is convenient to
// read it from this routine.
-func Xsqlite3BtreeGetMeta(tls *crt.TLS, p uintptr, idx int32, pMeta uintptr) { /* sqlite3.c:73815:21: */
+func Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr) { /* sqlite3.c:73970:21: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
@@ -48441,7 +49831,7 @@ func Xsqlite3BtreeGetMeta(tls *crt.TLS, p uintptr, idx int32, pMeta uintptr) { /
// Write meta-information back into the database. Meta[0] is
// read-only and may not be written.
-func Xsqlite3BtreeUpdateMeta(tls *crt.TLS, p uintptr, idx int32, iMeta U32) int32 { /* sqlite3.c:73845:20: */
+func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int32 { /* sqlite3.c:74000:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
var pP1 uintptr
var rc int32
@@ -48467,7 +49857,7 @@ func Xsqlite3BtreeUpdateMeta(tls *crt.TLS, p uintptr, idx int32, iMeta U32) int3
// SQLITE_OK is returned if the operation is successfully executed.
// Otherwise, if an error is encountered (i.e. an IO error or database
// corruption) an SQLite error code is returned.
-func Xsqlite3BtreeCount(tls *crt.TLS, db uintptr, pCur uintptr, pnEntry uintptr) int32 { /* sqlite3.c:73877:20: */
+func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr) int32 { /* sqlite3.c:74032:20: */
var nEntry I64 = int64(0) // Value to return in *pnEntry
var rc int32 // Return code
@@ -48479,7 +49869,7 @@ func Xsqlite3BtreeCount(tls *crt.TLS, db uintptr, pCur uintptr, pnEntry uintptr)
// Unless an error occurs, the following loop runs one iteration for each
// page in the B-Tree structure (not including overflow pages).
- for (rc == 0) && !(*(*int32)(unsafe.Pointer((db + 368 /* &.u1 */ /* &.isInterrupted */))) != 0) {
+ for (rc == 0) && !(*(*int32)(unsafe.Pointer((db + 392 /* &.u1 */ /* &.isInterrupted */))) != 0) {
var iIdx int32 // Index of child node in parent
var pPage uintptr // Current page of the b-tree
@@ -48530,12 +49920,12 @@ func Xsqlite3BtreeCount(tls *crt.TLS, db uintptr, pCur uintptr, pnEntry uintptr)
// Return the pager associated with a BTree. This routine is used for
// testing and debugging only.
-func Xsqlite3BtreePager(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:73946:22: */
+func Xsqlite3BtreePager(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:74101:22: */
return (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager
}
// Append a message to the error message string.
-func checkAppendMsg(tls *crt.TLS, pCheck uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:73954:13: */
+func checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:74109:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -48548,27 +49938,27 @@ func checkAppendMsg(tls *crt.TLS, pCheck uintptr, zFormat uintptr, va uintptr) {
(*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr++
ap = va
if (*IntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 {
- Xsqlite3_str_append(tls, (pCheck + 56 /* &.errMsg */), ts+3561 /* "\n" */, 1)
+ Xsqlite3_str_append(tls, (pCheck + 56 /* &.errMsg */), ts+5696 /* "\n" */, 1)
}
if (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 {
- Xsqlite3_str_appendf(tls, (pCheck + 56 /* &.errMsg */), (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, crt.VaList(bp, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2))
+ Xsqlite3_str_appendf(tls, (pCheck + 56 /* &.errMsg */), (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2))
}
Xsqlite3_str_vappendf(tls, (pCheck + 56 /* &.errMsg */), zFormat, ap)
_ = ap
if int32((*IntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FaccError) == 7 {
- (*IntegrityCk)(unsafe.Pointer(pCheck)).FmallocFailed = 1
+ (*IntegrityCk)(unsafe.Pointer(pCheck)).FbOomFault = 1
}
}
// Return non-zero if the bit in the IntegrityCk.aPgRef[] array that
// corresponds to page iPg is already set.
-func getPageReferenced(tls *crt.TLS, pCheck uintptr, iPg Pgno) int32 { /* sqlite3.c:73984:12: */
+func getPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) int32 { /* sqlite3.c:74139:12: */
return (int32(*(*U8)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr((iPg / Pgno(8)))))) & (int32(1) << (iPg & Pgno(0x07))))
}
// Set the bit in the IntegrityCk.aPgRef[] array that corresponds to page iPg.
-func setPageReferenced(tls *crt.TLS, pCheck uintptr, iPg Pgno) { /* sqlite3.c:73992:13: */
+func setPageReferenced(tls *libc.TLS, pCheck uintptr, iPg Pgno) { /* sqlite3.c:74147:13: */
*(*U8)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FaPgRef + uintptr((iPg / Pgno(8))))) |= U8((int32(1) << (iPg & Pgno(0x07))))
}
@@ -48579,19 +49969,19 @@ func setPageReferenced(tls *crt.TLS, pCheck uintptr, iPg Pgno) { /* sqlite3.c:73
// if this is the first reference to the page.
//
// Also check that the page number is in bounds.
-func checkRef(tls *crt.TLS, pCheck uintptr, iPage Pgno) int32 { /* sqlite3.c:74006:12: */
+func checkRef(tls *libc.TLS, pCheck uintptr, iPage Pgno) int32 { /* sqlite3.c:74161:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
if (iPage > (*IntegrityCk)(unsafe.Pointer(pCheck)).FnPage) || (iPage == Pgno(0)) {
- checkAppendMsg(tls, pCheck, ts+3563 /* "invalid page num..." */, crt.VaList(bp, iPage))
+ checkAppendMsg(tls, pCheck, ts+5698 /* "invalid page num..." */, libc.VaList(bp, iPage))
return 1
}
if getPageReferenced(tls, pCheck, iPage) != 0 {
- checkAppendMsg(tls, pCheck, ts+3586 /* "2nd reference to..." */, crt.VaList(bp+8, iPage))
+ checkAppendMsg(tls, pCheck, ts+5721 /* "2nd reference to..." */, libc.VaList(bp+8, iPage))
return 1
}
- if *(*int32)(unsafe.Pointer(((*IntegrityCk)(unsafe.Pointer(pCheck)).Fdb + 368 /* &.u1 */ /* &.isInterrupted */))) != 0 {
+ if *(*int32)(unsafe.Pointer(((*IntegrityCk)(unsafe.Pointer(pCheck)).Fdb + 392 /* &.u1 */ /* &.isInterrupted */))) != 0 {
return 1
}
setPageReferenced(tls, pCheck, iPage)
@@ -48601,7 +49991,7 @@ func checkRef(tls *crt.TLS, pCheck uintptr, iPage Pgno) int32 { /* sqlite3.c:740
// Check that the entry in the pointer-map for page iChild maps to
// page iParent, pointer type ptrType. If not, append an error message
// to pCheck.
-func checkPtrmap(tls *crt.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent Pgno) { /* sqlite3.c:74026:13: */
+func checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent Pgno) { /* sqlite3.c:74181:13: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -48613,49 +50003,49 @@ func checkPtrmap(tls *crt.TLS, pCheck uintptr, iChild Pgno, eType U8, iParent Pg
rc = ptrmapGet(tls, (*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt, iChild, bp+48 /* &ePtrmapType */, bp+52 /* &iPtrmapParent */)
if rc != 0 {
if (rc == 7) || (rc == (10 | (int32(12) << 8))) {
- (*IntegrityCk)(unsafe.Pointer(pCheck)).FmallocFailed = 1
+ (*IntegrityCk)(unsafe.Pointer(pCheck)).FbOomFault = 1
}
- checkAppendMsg(tls, pCheck, ts+3611 /* "Failed to read p..." */, crt.VaList(bp, iChild))
+ checkAppendMsg(tls, pCheck, ts+5746 /* "Failed to read p..." */, libc.VaList(bp, iChild))
return
}
if (int32(*(*U8)(unsafe.Pointer(bp + 48 /* ePtrmapType */))) != int32(eType)) || (*(*Pgno)(unsafe.Pointer(bp + 52 /* iPtrmapParent */)) != iParent) {
checkAppendMsg(tls, pCheck,
- ts+3640, /* "Bad ptr map entr..." */
- crt.VaList(bp+8, iChild, int32(eType), iParent, int32(*(*U8)(unsafe.Pointer(bp + 48 /* ePtrmapType */))), *(*Pgno)(unsafe.Pointer(bp + 52 /* iPtrmapParent */))))
+ ts+5775, /* "Bad ptr map entr..." */
+ libc.VaList(bp+8, iChild, int32(eType), iParent, int32(*(*U8)(unsafe.Pointer(bp + 48 /* ePtrmapType */))), *(*Pgno)(unsafe.Pointer(bp + 52 /* iPtrmapParent */))))
}
}
// Check the integrity of the freelist or of an overflow page list.
// Verify that the number of pages on the list is N.
-func checkList(tls *crt.TLS, pCheck uintptr, isFreeList int32, iPage int32, N U32) { /* sqlite3.c:74055:13: */
+func checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage Pgno, N U32) { /* sqlite3.c:74210:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
var i int32
var expected U32 = N
var nErrAtStart int32 = (*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr
- for (iPage != 0) && ((*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr != 0) {
+ for (iPage != Pgno(0)) && ((*IntegrityCk)(unsafe.Pointer(pCheck)).FmxErr != 0) {
// var pOvflPage uintptr at bp+40, 8
var pOvflData uintptr
- if checkRef(tls, pCheck, uint32(iPage)) != 0 {
+ if checkRef(tls, pCheck, iPage) != 0 {
break
}
N--
- if Xsqlite3PagerGet(tls, (*IntegrityCk)(unsafe.Pointer(pCheck)).FpPager, Pgno(iPage), bp+40 /* &pOvflPage */, 0) != 0 {
- checkAppendMsg(tls, pCheck, ts+3694 /* "failed to get pa..." */, crt.VaList(bp, iPage))
+ if Xsqlite3PagerGet(tls, (*IntegrityCk)(unsafe.Pointer(pCheck)).FpPager, iPage, bp+40 /* &pOvflPage */, 0) != 0 {
+ checkAppendMsg(tls, pCheck, ts+5829 /* "failed to get pa..." */, libc.VaList(bp, iPage))
break
}
pOvflData = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pOvflPage */)))
if isFreeList != 0 {
var n U32 = Xsqlite3Get4byte(tls, (pOvflData + uintptr(4)))
if (*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0 {
- checkPtrmap(tls, pCheck, uint32(iPage), uint8(2), uint32(0))
+ checkPtrmap(tls, pCheck, iPage, uint8(2), uint32(0))
}
if n > (((*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize / U32(4)) - U32(2)) {
checkAppendMsg(tls, pCheck,
- ts+3716 /* "freelist leaf co..." */, crt.VaList(bp+8, iPage))
+ ts+5851 /* "freelist leaf co..." */, libc.VaList(bp+8, iPage))
N--
} else {
for i = 0; i < int32(n); i++ {
@@ -48673,20 +50063,20 @@ func checkList(tls *crt.TLS, pCheck uintptr, isFreeList int32, iPage int32, N U3
// the following page matches iPage.
if ((*BtShared)(unsafe.Pointer((*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FautoVacuum != 0) && (N > U32(0)) {
i = int32(Xsqlite3Get4byte(tls, pOvflData))
- checkPtrmap(tls, pCheck, uint32(i), uint8(4), uint32(iPage))
+ checkPtrmap(tls, pCheck, uint32(i), uint8(4), iPage)
}
}
- iPage = int32(Xsqlite3Get4byte(tls, pOvflData))
+ iPage = Xsqlite3Get4byte(tls, pOvflData)
Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pOvflPage */)))
}
if (N != 0) && (nErrAtStart == (*IntegrityCk)(unsafe.Pointer(pCheck)).FnErr) {
checkAppendMsg(tls, pCheck,
- ts+3755, /* "%s is %d but sho..." */
- crt.VaList(bp+16, func() uintptr {
+ ts+5890, /* "%s is %d but sho..." */
+ libc.VaList(bp+16, func() uintptr {
if isFreeList != 0 {
- return ts + 3781 /* "size" */
+ return ts + 5916 /* "size" */
}
- return ts + 3786 /* "overflow list le..." */
+ return ts + 5921 /* "overflow list le..." */
}(),
(expected-N), expected))
}
@@ -48712,22 +50102,22 @@ func checkList(tls *crt.TLS, pCheck uintptr, isFreeList int32, iPage int32, N U3
// entry represents the span of a cell or freeblock on a btree page.
// The upper 16 bits are the index of the first byte of a range and the
// lower 16 bits are the index of the last byte of that range.
-func btreeHeapInsert(tls *crt.TLS, aHeap uintptr, x U32) { /* sqlite3.c:74144:13: */
+func btreeHeapInsert(tls *libc.TLS, aHeap uintptr, x U32) { /* sqlite3.c:74299:13: */
var j U32
- var i U32 = crt.PreIncUint32(&*(*U32)(unsafe.Pointer(aHeap + uintptr(0)*4)), 1)
+ var i U32 = libc.PreIncUint32(&*(*U32)(unsafe.Pointer(aHeap + uintptr(0)*4)), 1)
*(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) = x
- for ((crt.AssignUint32(&j, (i / U32(2)))) > U32(0)) && (*(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) > *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4))) {
+ for ((libc.AssignUint32(&j, (i / U32(2)))) > U32(0)) && (*(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) > *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4))) {
x = *(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4))
*(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) = *(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4))
*(*U32)(unsafe.Pointer(aHeap + uintptr(i)*4)) = x
i = j
}
}
-func btreeHeapPull(tls *crt.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite3.c:74154:12: */
+func btreeHeapPull(tls *libc.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite3.c:74309:12: */
var j U32
var i U32
var x U32
- if (crt.AssignUint32(&x, *(*U32)(unsafe.Pointer(aHeap + uintptr(0)*4)))) == U32(0) {
+ if (libc.AssignUint32(&x, *(*U32)(unsafe.Pointer(aHeap + uintptr(0)*4)))) == U32(0) {
return 0
}
*(*U32)(unsafe.Pointer(pOut)) = *(*U32)(unsafe.Pointer(aHeap + uintptr(1)*4))
@@ -48735,7 +50125,7 @@ func btreeHeapPull(tls *crt.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite3
*(*U32)(unsafe.Pointer(aHeap + uintptr(x)*4)) = 0xffffffff
*(*U32)(unsafe.Pointer(aHeap + uintptr(0)*4))--
i = U32(1)
- for (crt.AssignUint32(&j, (i * U32(2)))) <= *(*U32)(unsafe.Pointer(aHeap + uintptr(0)*4)) {
+ for (libc.AssignUint32(&j, (i * U32(2)))) <= *(*U32)(unsafe.Pointer(aHeap + uintptr(0)*4)) {
if *(*U32)(unsafe.Pointer(aHeap + uintptr(j)*4)) > *(*U32)(unsafe.Pointer(aHeap + uintptr((j+U32(1)))*4)) {
j++
}
@@ -48762,7 +50152,7 @@ func btreeHeapPull(tls *crt.TLS, aHeap uintptr, pOut uintptr) int32 { /* sqlite3
// 3. Check the integrity of overflow pages.
// 4. Recursively call checkTreePage on all children.
// 5. Verify that the depth of all children is the same.
-func checkTreePage(tls *crt.TLS, pCheck uintptr, iPage int32, piMinKey uintptr, maxKey I64) int32 { /* sqlite3.c:74188:12: */
+func checkTreePage(tls *libc.TLS, pCheck uintptr, iPage Pgno, piMinKey uintptr, maxKey I64) int32 { /* sqlite3.c:74343:12: */
bp := tls.Alloc(140)
defer tls.Free(140)
*(*I64)(unsafe.Pointer(bp + 104)) = maxKey
@@ -48810,32 +50200,32 @@ func checkTreePage(tls *crt.TLS, pCheck uintptr, iPage int32, piMinKey uintptr,
heap = uintptr(0)
prev = U32(0)
saved_zPfx = (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx
- saved_v1 = (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1
+ saved_v1 = int32((*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1)
saved_v2 = (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2
savedIsInit = U8(0)
// Check that the page exists
pBt = (*IntegrityCk)(unsafe.Pointer(pCheck)).FpBt
usableSize = (*BtShared)(unsafe.Pointer(pBt)).FusableSize
- if !(iPage == 0) {
+ if !(iPage == Pgno(0)) {
goto __1
}
return 0
__1:
;
- if !(checkRef(tls, pCheck, uint32(iPage)) != 0) {
+ if !(checkRef(tls, pCheck, iPage) != 0) {
goto __2
}
return 0
__2:
;
- (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3807 /* "Page %d: " */
+ (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 5942 /* "Page %u: " */
(*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage
- if !((crt.AssignInt32(&rc, btreeGetPage(tls, pBt, Pgno(iPage), bp+96 /* &pPage */, 0))) != 0) {
+ if !((libc.AssignInt32(&rc, btreeGetPage(tls, pBt, iPage, bp+96 /* &pPage */, 0))) != 0) {
goto __3
}
checkAppendMsg(tls, pCheck,
- ts+3817 /* "unable to get th..." */, crt.VaList(bp, rc))
+ ts+5952 /* "unable to get th..." */, libc.VaList(bp, rc))
goto end_of_check
__3:
;
@@ -48844,20 +50234,20 @@ __3:
// btreeInitPage() is executed.
savedIsInit = (*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FisInit
(*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FisInit = U8(0)
- if !((crt.AssignInt32(&rc, btreeInitPage(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */))))) != 0) {
+ if !((libc.AssignInt32(&rc, btreeInitPage(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */))))) != 0) {
goto __4
}
// The only possible error from InitPage
checkAppendMsg(tls, pCheck,
- ts+3855 /* "btreeInitPage() ..." */, crt.VaList(bp+8, rc))
+ ts+5990 /* "btreeInitPage() ..." */, libc.VaList(bp+8, rc))
goto end_of_check
__4:
;
- if !((crt.AssignInt32(&rc, btreeComputeFreeSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */))))) != 0) {
+ if !((libc.AssignInt32(&rc, btreeComputeFreeSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */))))) != 0) {
goto __5
}
- checkAppendMsg(tls, pCheck, ts+3893 /* "free space corru..." */, crt.VaList(bp+16, rc))
+ checkAppendMsg(tls, pCheck, ts+6028 /* "free space corru..." */, libc.VaList(bp+16, rc))
goto end_of_check
__5:
;
@@ -48865,7 +50255,7 @@ __5:
hdr = int32((*MemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))).FhdrOffset)
// Set up for cell analysis
- (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3915 /* "On tree page %d ..." */
+ (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 6050 /* "On tree page %u ..." */
contentOffset = (U32(((((int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((hdr + 5))) + uintptr(1))))) - 1) & 0xffff) + 1))
// Enforced by btreeInitPage()
@@ -48887,11 +50277,11 @@ __5:
if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
goto __8
}
- (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 3941 /* "On page %d at ri..." */
- checkPtrmap(tls, pCheck, uint32(pgno), uint8(5), uint32(iPage))
+ (*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = ts + 6076 /* "On page %u at ri..." */
+ checkPtrmap(tls, pCheck, uint32(pgno), uint8(5), iPage)
__8:
;
- depth = checkTreePage(tls, pCheck, pgno, bp+104 /* &maxKey */, *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */)))
+ depth = checkTreePage(tls, pCheck, uint32(pgno), bp+104 /* &maxKey */, *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */)))
keyCanBeEqual = 0
goto __7
__6:
@@ -48918,18 +50308,18 @@ __9:
if !((pc < contentOffset) || (pc > (usableSize - U32(4)))) {
goto __12
}
- checkAppendMsg(tls, pCheck, ts+3969, /* "Offset %d out of..." */
- crt.VaList(bp+24, pc, contentOffset, (usableSize-U32(4))))
+ checkAppendMsg(tls, pCheck, ts+6104, /* "Offset %d out of..." */
+ libc.VaList(bp+24, pc, contentOffset, (usableSize-U32(4))))
doCoverageCheck = 0
goto __10
__12:
;
pCell = (data + uintptr(pc))
- (*(*func(*crt.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)) + 128 /* &.xParseCell */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)), pCell, bp+112 /* &info */)
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)) + 128 /* &.xParseCell */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)), pCell, bp+112 /* &info */)
if !((pc + U32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnSize)) > usableSize) {
goto __13
}
- checkAppendMsg(tls, pCheck, ts+3999 /* "Extends off end ..." */, 0)
+ checkAppendMsg(tls, pCheck, ts+6134 /* "Extends off end ..." */, 0)
doCoverageCheck = 0
goto __10
__13:
@@ -48941,13 +50331,13 @@ __13:
}
if !(func() int32 {
if keyCanBeEqual != 0 {
- return (crt.Bool32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey > *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))))
+ return (libc.Bool32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey > *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))))
}
- return (crt.Bool32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey >= *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))))
+ return (libc.Bool32((*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey >= *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */))))
}() != 0) {
goto __15
}
- checkAppendMsg(tls, pCheck, ts+4023 /* "Rowid %lld out o..." */, crt.VaList(bp+48, (*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey))
+ checkAppendMsg(tls, pCheck, ts+6158 /* "Rowid %lld out o..." */, libc.VaList(bp+48, (*CellInfo)(unsafe.Pointer(bp+112 /* &info */)).FnKey))
__15:
;
*(*I64)(unsafe.Pointer(bp + 104 /* maxKey */)) = (*CellInfo)(unsafe.Pointer(bp + 112 /* &info */)).FnKey
@@ -48965,10 +50355,10 @@ __14:
if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
goto __17
}
- checkPtrmap(tls, pCheck, pgnoOvfl, uint8(3), uint32(iPage))
+ checkPtrmap(tls, pCheck, pgnoOvfl, uint8(3), iPage)
__17:
;
- checkList(tls, pCheck, 0, int32(pgnoOvfl), nPage)
+ checkList(tls, pCheck, 0, pgnoOvfl, nPage)
__16:
;
@@ -48980,15 +50370,15 @@ __16:
if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
goto __20
}
- checkPtrmap(tls, pCheck, uint32(pgno), uint8(5), uint32(iPage))
+ checkPtrmap(tls, pCheck, uint32(pgno), uint8(5), iPage)
__20:
;
- d2 = checkTreePage(tls, pCheck, pgno, bp+104 /* &maxKey */, *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */)))
+ d2 = checkTreePage(tls, pCheck, uint32(pgno), bp+104 /* &maxKey */, *(*I64)(unsafe.Pointer(bp + 104 /* maxKey */)))
keyCanBeEqual = 0
if !(d2 != depth) {
goto __21
}
- checkAppendMsg(tls, pCheck, ts+4047 /* "Child page depth..." */, 0)
+ checkAppendMsg(tls, pCheck, ts+6182 /* "Child page depth..." */, 0)
depth = d2
__21:
;
@@ -49026,7 +50416,7 @@ __24:
goto __26
}
pc = (U32((int32(*(*U8)(unsafe.Pointer((data + uintptr((cellStart + (i * 2)))) + uintptr(0)))) << 8) | int32(*(*U8)(unsafe.Pointer((data + uintptr((cellStart + (i * 2)))) + uintptr(1))))))
- size = U32((*(*func(*crt.TLS, uintptr, uintptr) U16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)) + 120 /* &.xCellSize */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)), (data + uintptr(pc))))
+ size = U32((*(*func(*libc.TLS, uintptr, uintptr) U16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)) + 120 /* &.xCellSize */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)), (data + uintptr(pc))))
btreeHeapInsert(tls, heap, ((pc << 16) | ((pc + size) - U32(1))))
goto __25
__25:
@@ -49086,7 +50476,7 @@ __29:
goto __31
}
checkAppendMsg(tls, pCheck,
- ts+4072 /* "Multiple uses fo..." */, crt.VaList(bp+56, (*(*U32)(unsafe.Pointer(bp + 136 /* x */))>>16), iPage))
+ ts+6207 /* "Multiple uses fo..." */, libc.VaList(bp+56, (*(*U32)(unsafe.Pointer(bp + 136 /* x */))>>16), iPage))
goto __30
goto __32
__31:
@@ -49106,8 +50496,8 @@ __30:
goto __33
}
checkAppendMsg(tls, pCheck,
- ts+4109, /* "Fragmentation of..." */
- crt.VaList(bp+72, nFrag, int32(*(*U8)(unsafe.Pointer(data + uintptr((hdr + 7))))), iPage))
+ ts+6244, /* "Fragmentation of..." */
+ libc.VaList(bp+72, nFrag, int32(*(*U8)(unsafe.Pointer(data + uintptr((hdr + 7))))), iPage))
__33:
;
__22:
@@ -49122,7 +50512,7 @@ __34:
;
releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 96 /* pPage */)))
(*IntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = saved_zPfx
- (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = saved_v1
+ (*IntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = Pgno(saved_v1)
(*IntegrityCk)(unsafe.Pointer(pCheck)).Fv2 = saved_v2
return (depth + 1)
}
@@ -49138,7 +50528,16 @@ __34:
// allocation errors, an error message held in memory obtained from
// malloc is returned if *pnErr is non-zero. If *pnErr==0 then NULL is
// returned. If a memory allocation error occurs, NULL is returned.
-func Xsqlite3BtreeIntegrityCheck(tls *crt.TLS, db uintptr, p uintptr, aRoot uintptr, nRoot int32, mxErr int32, pnErr uintptr) uintptr { /* sqlite3.c:74458:21: */
+//
+// If the first entry in aRoot[] is 0, that indicates that the list of
+// root pages is incomplete. This is a "partial integrity-check". This
+// happens when performing an integrity check on a single table. The
+// zero is skipped, of course. But in addition, the freelist checks
+// and the checks to make sure every page is referenced are also skipped,
+// since obviously it is not possible to know which pages are covered by
+// the unverified btrees. Except, if aRoot[1] is 1, then the freelist
+// checks are still performed.
+func Xsqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uintptr, nRoot int32, mxErr int32, pnErr uintptr) uintptr { /* sqlite3.c:74622:21: */
bp := tls.Alloc(248)
defer tls.Free(248)
@@ -49149,11 +50548,30 @@ func Xsqlite3BtreeIntegrityCheck(tls *crt.TLS, db uintptr, p uintptr, aRoot uint
var savedDbFlags U64
// var zErr [100]int8 at bp+136, 100
- var mx int32
- var mxInHdr int32
+ var bPartial int32 // True if not checking all btrees
+ var bCkFreelist int32
+ var mx Pgno
+ var mxInHdr Pgno
// var notUsed I64 at bp+240, 8
pBt = (*Btree)(unsafe.Pointer(p)).FpBt
savedDbFlags = (*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags
+ bPartial = 0
+ bCkFreelist = 1 // True to scan the freelist
+
+ // aRoot[0]==0 means this is a partial check
+ if !(*(*Pgno)(unsafe.Pointer(aRoot + uintptr(0)*4)) == Pgno(0)) {
+ goto __1
+ }
+
+ bPartial = 1
+ if !(*(*Pgno)(unsafe.Pointer(aRoot + uintptr(1)*4)) != Pgno(1)) {
+ goto __2
+ }
+ bCkFreelist = 0
+__2:
+ ;
+__1:
+ ;
Xsqlite3BtreeEnter(tls, p)
@@ -49163,169 +50581,184 @@ func Xsqlite3BtreeIntegrityCheck(tls *crt.TLS, db uintptr, p uintptr, aRoot uint
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FnPage = btreePagecount(tls, (*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FpBt)
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FmxErr = mxErr
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FnErr = 0
- (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FmallocFailed = 0
+ (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FbOomFault = 0
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = uintptr(0)
- (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).Fv1 = 0
+ (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).Fv1 = Pgno(0)
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).Fv2 = 0
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FaPgRef = uintptr(0)
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).Fheap = uintptr(0)
Xsqlite3StrAccumInit(tls, (bp + 32 /* &sCheck */ + 56 /* &.errMsg */), uintptr(0), bp+136 /* &zErr[0] */, int32(unsafe.Sizeof([100]int8{})), 1000000000)
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FerrMsg.FprintfFlags = U8(0x01)
if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnPage == Pgno(0)) {
- goto __1
+ goto __3
}
goto integrity_ck_cleanup
-__1:
+__3:
;
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FaPgRef = Xsqlite3MallocZero(tls, (uint64(((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnPage / Pgno(8)) + Pgno(1))))
if !(!(int32((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FaPgRef) != 0)) {
- goto __2
+ goto __4
}
- (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FmallocFailed = 1
+ (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FbOomFault = 1
goto integrity_ck_cleanup
-__2:
+__4:
;
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).Fheap = Xsqlite3PageMalloc(tls, int32((*BtShared)(unsafe.Pointer(pBt)).FpageSize))
if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).Fheap == uintptr(0)) {
- goto __3
+ goto __5
}
- (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FmallocFailed = 1
+ (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FbOomFault = 1
goto integrity_ck_cleanup
-__3:
+__5:
;
i = ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer(pBt)).FpageSize)) + U32(1))
if !(i <= (*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnPage) {
- goto __4
+ goto __6
}
setPageReferenced(tls, bp+32 /* &sCheck */, i)
-__4:
+__6:
;
// Check the integrity of the freelist
- (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = ts + 4161 /* "Main freelist: " */
- checkList(tls, bp+32 /* &sCheck */, 1, int32(Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+uintptr(32)))),
+ if !(bCkFreelist != 0) {
+ goto __7
+ }
+ (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = ts + 6296 /* "Main freelist: " */
+ checkList(tls, bp+32 /* &sCheck */, 1, Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+uintptr(32))),
Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+uintptr(36))))
(*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FzPfx = uintptr(0)
+__7:
+ ;
// Check all the tables.
+ if !(!(bPartial != 0)) {
+ goto __8
+ }
if !((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) {
- goto __5
+ goto __9
}
- mx = 0
+ mx = Pgno(0)
i = Pgno(0)
-__7:
+__11:
if !(int32(i) < nRoot) {
- goto __9
+ goto __13
}
- if !(mx < *(*int32)(unsafe.Pointer(aRoot + uintptr(i)*4))) {
- goto __10
+ if !(mx < *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4))) {
+ goto __14
}
- mx = *(*int32)(unsafe.Pointer(aRoot + uintptr(i)*4))
-__10:
+ mx = *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4))
+__14:
;
- goto __8
-__8:
+ goto __12
+__12:
i++
- goto __7
- goto __9
-__9:
+ goto __11
+ goto __13
+__13:
;
- mxInHdr = int32(Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + uintptr(52))))
+ mxInHdr = Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData + uintptr(52)))
if !(mx != mxInHdr) {
- goto __11
+ goto __15
}
checkAppendMsg(tls, bp+32, /* &sCheck */
- ts+4177, /* "max rootpage (%d..." */
- crt.VaList(bp, mx, mxInHdr))
-__11:
+ ts+6312, /* "max rootpage (%d..." */
+ libc.VaList(bp, mx, mxInHdr))
+__15:
;
- goto __6
-__5:
+ goto __10
+__9:
if !(Xsqlite3Get4byte(tls, ((*MemPage)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+uintptr(64))) != U32(0)) {
- goto __12
+ goto __16
}
checkAppendMsg(tls, bp+32, /* &sCheck */
- ts+4222 /* "incremental_vacu..." */, 0)
-__12:
+ ts+6357 /* "incremental_vacu..." */, 0)
+__16:
;
-__6:
+__10:
+ ;
+__8:
;
- *(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 48 /* &.flags */)) &= (^uint64(crt.Uint64FromUint64(uint64(0x00200000))))
+ *(*U64)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb + 48 /* &.flags */)) &= (^uint64(libc.Uint64FromUint64(uint64(0x00200000))))
i = Pgno(0)
-__13:
+__17:
if !((int32(i) < nRoot) && ((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FmxErr != 0)) {
- goto __15
+ goto __19
}
- if !(*(*int32)(unsafe.Pointer(aRoot + uintptr(i)*4)) == 0) {
- goto __16
+ if !(*(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) == Pgno(0)) {
+ goto __20
}
- goto __14
-__16:
+ goto __18
+__20:
;
- if !(((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*int32)(unsafe.Pointer(aRoot + uintptr(i)*4)) > 1)) {
- goto __17
+ if !((((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) && (*(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)) > Pgno(1))) && !(bPartial != 0)) {
+ goto __21
}
- checkPtrmap(tls, bp+32 /* &sCheck */, uint32(*(*int32)(unsafe.Pointer(aRoot + uintptr(i)*4))), uint8(1), uint32(0))
-__17:
+ checkPtrmap(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), uint8(1), uint32(0))
+__21:
;
- checkTreePage(tls, bp+32 /* &sCheck */, *(*int32)(unsafe.Pointer(aRoot + uintptr(i)*4)), bp+240 /* &notUsed */, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
- goto __14
-__14:
+ checkTreePage(tls, bp+32 /* &sCheck */, *(*Pgno)(unsafe.Pointer(aRoot + uintptr(i)*4)), bp+240 /* &notUsed */, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
+ goto __18
+__18:
i++
- goto __13
- goto __15
-__15:
+ goto __17
+ goto __19
+__19:
;
(*Sqlite3)(unsafe.Pointer((*BtShared)(unsafe.Pointer(pBt)).Fdb)).Fflags = savedDbFlags
// Make sure every page in the file is referenced
+ if !(!(bPartial != 0)) {
+ goto __22
+ }
i = Pgno(1)
-__18:
+__23:
if !((i <= (*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnPage) && ((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FmxErr != 0)) {
- goto __20
+ goto __25
}
// If the database supports auto-vacuum, make sure no tables contain
// references to pointer-map pages.
if !((getPageReferenced(tls, bp+32 /* &sCheck */, i) == 0) && ((ptrmapPageno(tls, pBt, i) != i) || !(int32((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum) != 0))) {
- goto __21
+ goto __26
}
- checkAppendMsg(tls, bp+32 /* &sCheck */, ts+4277 /* "Page %d is never..." */, crt.VaList(bp+16, i))
-__21:
+ checkAppendMsg(tls, bp+32 /* &sCheck */, ts+6412 /* "Page %d is never..." */, libc.VaList(bp+16, i))
+__26:
;
if !((getPageReferenced(tls, bp+32 /* &sCheck */, i) != 0) && ((ptrmapPageno(tls, pBt, i) == i) && ((*BtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0))) {
- goto __22
+ goto __27
}
- checkAppendMsg(tls, bp+32 /* &sCheck */, ts+4299 /* "Pointer map page..." */, crt.VaList(bp+24, i))
-__22:
+ checkAppendMsg(tls, bp+32 /* &sCheck */, ts+6434 /* "Pointer map page..." */, libc.VaList(bp+24, i))
+__27:
;
- goto __19
-__19:
+ goto __24
+__24:
i++
- goto __18
- goto __20
-__20:
+ goto __23
+ goto __25
+__25:
+ ;
+__22:
;
// Clean up and report errors.
integrity_ck_cleanup:
Xsqlite3PageFree(tls, (*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).Fheap)
Xsqlite3_free(tls, (*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FaPgRef)
- if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FmallocFailed != 0) {
- goto __23
+ if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FbOomFault != 0) {
+ goto __28
}
Xsqlite3_str_reset(tls, (bp + 32 /* &sCheck */ + 56 /* &.errMsg */))
(*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnErr++
-__23:
+__28:
;
*(*int32)(unsafe.Pointer(pnErr)) = (*IntegrityCk)(unsafe.Pointer(bp + 32 /* &sCheck */)).FnErr
if !((*IntegrityCk)(unsafe.Pointer(bp+32 /* &sCheck */)).FnErr == 0) {
- goto __24
+ goto __29
}
Xsqlite3_str_reset(tls, (bp + 32 /* &sCheck */ + 56 /* &.errMsg */))
-__24:
+__29:
;
// Make sure this analysis did not leave any unref() pages.
@@ -49338,7 +50771,7 @@ __24:
//
// The pager filename is invariant as long as the pager is
// open so it is safe to access without the BtShared mutex.
-func Xsqlite3BtreeGetFilename(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:74597:27: */
+func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:74777:27: */
return Xsqlite3PagerFilename(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager, 1)
}
@@ -49349,15 +50782,15 @@ func Xsqlite3BtreeGetFilename(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:74
//
// The pager journal filename is invariant as long as the pager is
// open so it is safe to access without the BtShared mutex.
-func Xsqlite3BtreeGetJournalname(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:74610:27: */
+func Xsqlite3BtreeGetJournalname(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:74790:27: */
return Xsqlite3PagerJournalname(tls, (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FpPager)
}
// Return non-zero if a transaction is active.
-func Xsqlite3BtreeIsInTrans(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:74618:20: */
+func Xsqlite3BtreeIsInTrans(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74798:20: */
- return (crt.Bool32((p != 0) && (int32((*Btree)(unsafe.Pointer(p)).FinTrans) == 2)))
+ return (libc.Bool32((p != 0) && (int32((*Btree)(unsafe.Pointer(p)).FinTrans) == 2)))
}
// Run a checkpoint on the Btree passed as the first argument.
@@ -49366,7 +50799,7 @@ func Xsqlite3BtreeIsInTrans(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:74618:
// transaction on the shared-cache the argument Btree is connected to.
//
// Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
-func Xsqlite3BtreeCheckpoint(tls *crt.TLS, p uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:74632:20: */
+func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:74812:20: */
var rc int32 = 0
if p != 0 {
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
@@ -49382,14 +50815,14 @@ func Xsqlite3BtreeCheckpoint(tls *crt.TLS, p uintptr, eMode int32, pnLog uintptr
}
// Return non-zero if a read (or write) transaction is active.
-func Xsqlite3BtreeIsInReadTrans(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:74651:20: */
+func Xsqlite3BtreeIsInReadTrans(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74831:20: */
- return (crt.Bool32(int32((*Btree)(unsafe.Pointer(p)).FinTrans) != 0))
+ return (libc.Bool32(int32((*Btree)(unsafe.Pointer(p)).FinTrans) != 0))
}
-func Xsqlite3BtreeIsInBackup(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:74657:20: */
+func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74837:20: */
- return (crt.Bool32((*Btree)(unsafe.Pointer(p)).FnBackup != 0))
+ return (libc.Bool32((*Btree)(unsafe.Pointer(p)).FnBackup != 0))
}
// This function returns a pointer to a blob of memory associated with
@@ -49410,7 +50843,7 @@ func Xsqlite3BtreeIsInBackup(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:74657
// xFree argument when the memory allocation was made is invoked on the
// blob of allocated memory. The xFree function should not call sqlite3_free()
// on the memory, the btree layer does that.
-func Xsqlite3BtreeSchema(tls *crt.TLS, p uintptr, nBytes int32, xFree uintptr) uintptr { /* sqlite3.c:74683:21: */
+func Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) uintptr { /* sqlite3.c:74863:21: */
var pBt uintptr = (*Btree)(unsafe.Pointer(p)).FpBt
Xsqlite3BtreeEnter(tls, p)
if !(int32((*BtShared)(unsafe.Pointer(pBt)).FpSchema) != 0) && (nBytes != 0) {
@@ -49423,8 +50856,8 @@ func Xsqlite3BtreeSchema(tls *crt.TLS, p uintptr, nBytes int32, xFree uintptr) u
// Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared
// btree as the argument handle holds an exclusive lock on the
-// sqlite_master table. Otherwise SQLITE_OK.
-func Xsqlite3BtreeSchemaLocked(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:74699:20: */
+// sqlite_schema table. Otherwise SQLITE_OK.
+func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:74879:20: */
var rc int32
Xsqlite3BtreeEnter(tls, p)
@@ -49437,7 +50870,7 @@ func Xsqlite3BtreeSchemaLocked(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:746
// Obtain a lock on the table whose root page is iTab. The
// lock is a write lock if isWritelock is true or a read lock
// if it is false.
-func Xsqlite3BtreeLockTable(tls *crt.TLS, p uintptr, iTab int32, isWriteLock U8) int32 { /* sqlite3.c:74716:20: */
+func Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8) int32 { /* sqlite3.c:74896:20: */
var rc int32 = 0
if (*Btree)(unsafe.Pointer(p)).Fsharable != 0 {
@@ -49461,7 +50894,7 @@ func Xsqlite3BtreeLockTable(tls *crt.TLS, p uintptr, iTab int32, isWriteLock U8)
// change the length of the data stored. If this function is called with
// parameters that attempt to write past the end of the existing data,
// no modifications are made and SQLITE_CORRUPT is returned.
-func Xsqlite3BtreePutData(tls *crt.TLS, pCsr uintptr, offset U32, amt U32, z uintptr) int32 { /* sqlite3.c:74746:20: */
+func Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z uintptr) int32 { /* sqlite3.c:74926:20: */
var rc int32
rc = func() int32 {
@@ -49501,7 +50934,7 @@ func Xsqlite3BtreePutData(tls *crt.TLS, pCsr uintptr, offset U32, amt U32, z uin
}
// Mark this cursor as an incremental blob cursor.
-func Xsqlite3BtreeIncrblobCursor(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:74794:21: */
+func Xsqlite3BtreeIncrblobCursor(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:74974:21: */
*(*U8)(unsafe.Pointer(pCur + 1 /* &.curFlags */)) |= U8((0x10))
(*Btree)(unsafe.Pointer((*BtCursor)(unsafe.Pointer(pCur)).FpBtree)).FhasIncrblobCur = U8(1)
}
@@ -49509,13 +50942,13 @@ func Xsqlite3BtreeIncrblobCursor(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:7479
// Set both the "read version" (single byte at byte offset 18) and
// "write version" (single byte at byte offset 19) fields in the database
// header to iVersion.
-func Xsqlite3BtreeSetVersion(tls *crt.TLS, pBtree uintptr, iVersion int32) int32 { /* sqlite3.c:74805:20: */
+func Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int32 { /* sqlite3.c:74985:20: */
var pBt uintptr = (*Btree)(unsafe.Pointer(pBtree)).FpBt
var rc int32 // Return code
// If setting the version fields to 1, do not automatically open the
// WAL connection, even if the version fields are currently set to 2.
- *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0020))))
+ *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0020))))
if iVersion == 1 {
*(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) |= U16((0x0020))
}
@@ -49535,35 +50968,35 @@ func Xsqlite3BtreeSetVersion(tls *crt.TLS, pBtree uintptr, iVersion int32) int32
}
}
- *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0020))))
+ *(*U16)(unsafe.Pointer(pBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0020))))
return rc
}
// Return true if the cursor has a hint specified. This routine is
// only used from within assert() statements
-func Xsqlite3BtreeCursorHasHint(tls *crt.TLS, pCsr uintptr, mask uint32) int32 { /* sqlite3.c:74840:20: */
- return (crt.Bool32((uint32((*BtCursor)(unsafe.Pointer(pCsr)).Fhints) & mask) != uint32(0)))
+func Xsqlite3BtreeCursorHasHint(tls *libc.TLS, pCsr uintptr, mask uint32) int32 { /* sqlite3.c:75020:20: */
+ return (libc.Bool32((uint32((*BtCursor)(unsafe.Pointer(pCsr)).Fhints) & mask) != uint32(0)))
}
// Return true if the given Btree is read-only.
-func Xsqlite3BtreeIsReadonly(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:74847:20: */
- return (crt.Bool32((int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & 0x0001) != 0))
+func Xsqlite3BtreeIsReadonly(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75027:20: */
+ return (libc.Bool32((int32((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & 0x0001) != 0))
}
// Return the size of the header added to each page by this module.
-func Xsqlite3HeaderSizeBtree(tls *crt.TLS) int32 { /* sqlite3.c:74854:20: */
- return (int32(((uint64(unsafe.Sizeof(MemPage{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))))
+func Xsqlite3HeaderSizeBtree(tls *libc.TLS) int32 { /* sqlite3.c:75034:20: */
+ return (int32(((uint64(unsafe.Sizeof(MemPage{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))))
}
// Return true if the Btree passed as the only argument is sharable.
-func Xsqlite3BtreeSharable(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:74860:20: */
+func Xsqlite3BtreeSharable(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75040:20: */
return int32((*Btree)(unsafe.Pointer(p)).Fsharable)
}
// Return the number of connections to the BtShared object accessed by
// the Btree handle passed as the only argument. For private caches
// this is always 1. For shared caches it may be 1 or greater.
-func Xsqlite3BtreeConnectionCount(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:74869:20: */
+func Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75049:20: */
return (*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer(p)).FpBt)).FnRef
}
@@ -49603,7 +51036,7 @@ func Xsqlite3BtreeConnectionCount(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:
// If the "temp" database is requested, it may need to be opened by this
// function. If an error occurs while doing so, return 0 and write an
// error message to pErrorDb.
-func findBtree(tls *crt.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintptr { /* sqlite3.c:74958:14: */
+func findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintptr { /* sqlite3.c:75138:14: */
bp := tls.Alloc(440)
defer tls.Free(440)
@@ -49613,10 +51046,10 @@ func findBtree(tls *crt.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintptr
// var sParse Parse at bp+16, 424
var rc int32 = 0
- crt.Xmemset(tls, bp+16 /* &sParse */, 0, uint64(unsafe.Sizeof(Parse{})))
+ libc.Xmemset(tls, bp+16 /* &sParse */, 0, uint64(unsafe.Sizeof(Parse{})))
(*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).Fdb = pDb
if Xsqlite3OpenTempDatabase(tls, bp+16 /* &sParse */) != 0 {
- Xsqlite3ErrorWithMsg(tls, pErrorDb, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc, ts+696 /* "%s" */, crt.VaList(bp, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzErrMsg))
+ Xsqlite3ErrorWithMsg(tls, pErrorDb, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).Frc, ts+805 /* "%s" */, libc.VaList(bp, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzErrMsg))
rc = 1
}
Xsqlite3DbFree(tls, pErrorDb, (*Parse)(unsafe.Pointer(bp+16 /* &sParse */)).FzErrMsg)
@@ -49627,7 +51060,7 @@ func findBtree(tls *crt.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintptr
}
if i < 0 {
- Xsqlite3ErrorWithMsg(tls, pErrorDb, 1, ts+4333 /* "unknown database..." */, crt.VaList(bp+8, zDb))
+ Xsqlite3ErrorWithMsg(tls, pErrorDb, 1, ts+6468 /* "unknown database..." */, libc.VaList(bp+8, zDb))
return uintptr(0)
}
@@ -49636,7 +51069,7 @@ func findBtree(tls *crt.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) uintptr
// Attempt to set the page size of the destination to match the page size
// of the source.
-func setDestPgsz(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:74989:12: */
+func setDestPgsz(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75169:12: */
var rc int32
rc = Xsqlite3BtreeSetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, Xsqlite3BtreeGetPageSize(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc), 0, 0)
return rc
@@ -49646,9 +51079,9 @@ func setDestPgsz(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:74989:12: */
// second argument. If there is not, return SQLITE_OK. Otherwise, if there
// is an open read-transaction, return SQLITE_ERROR and leave an error
// message in database handle db.
-func checkReadTransaction(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:75001:12: */
+func checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:75181:12: */
if Xsqlite3BtreeIsInReadTrans(tls, p) != 0 {
- Xsqlite3ErrorWithMsg(tls, db, 1, ts+4353 /* "destination data..." */, 0)
+ Xsqlite3ErrorWithMsg(tls, db, 1, ts+6488 /* "destination data..." */, 0)
return 1
}
return 0
@@ -49660,7 +51093,7 @@ func checkReadTransaction(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite
//
// If an error occurs, NULL is returned and an error code and error message
// stored in database handle pDestDb.
-func Xsqlite3_backup_init(tls *crt.TLS, pDestDb uintptr, zDestDb uintptr, pSrcDb uintptr, zSrcDb uintptr) uintptr { /* sqlite3.c:75017:27: */
+func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcDb uintptr, zSrcDb uintptr) uintptr { /* sqlite3.c:75197:27: */
var p uintptr // Value to return
// Lock the source database handle. The destination database
@@ -49675,7 +51108,7 @@ func Xsqlite3_backup_init(tls *crt.TLS, pDestDb uintptr, zDestDb uintptr, pSrcDb
if pSrcDb == pDestDb {
Xsqlite3ErrorWithMsg(tls,
- pDestDb, 1, ts+4384 /* "source and desti..." */, 0)
+ pDestDb, 1, ts+6519 /* "source and desti..." */, 0)
p = uintptr(0)
} else {
// Allocate space for a new sqlite3_backup object...
@@ -49720,14 +51153,14 @@ func Xsqlite3_backup_init(tls *crt.TLS, pDestDb uintptr, zDestDb uintptr, pSrcDb
// Argument rc is an SQLite error code. Return true if this error is
// considered fatal if encountered during a backup operation. All errors
// are considered fatal except for SQLITE_BUSY and SQLITE_LOCKED.
-func isFatalError(tls *crt.TLS, rc int32) int32 { /* sqlite3.c:75094:12: */
- return (crt.Bool32(((rc != 0) && (rc != 5)) && (rc != 6)))
+func isFatalError(tls *libc.TLS, rc int32) int32 { /* sqlite3.c:75274:12: */
+ return (libc.Bool32(((rc != 0) && (rc != 5)) && (rc != 6)))
}
// Parameter zSrcData points to a buffer containing the data for
// page iSrcPg from the source database. Copy this data into the
// destination database.
-func backupOnePage(tls *crt.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpdate int32) int32 { /* sqlite3.c:75103:12: */
+func backupOnePage(tls *libc.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpdate int32) int32 { /* sqlite3.c:75283:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -49759,8 +51192,8 @@ func backupOnePage(tls *crt.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpda
if iDest == ((U32(Xsqlite3PendingByte) / ((*BtShared)(unsafe.Pointer((*Btree)(unsafe.Pointer((*Sqlite3_backup)(unsafe.Pointer(p)).FpDest)).FpBt)).FpageSize)) + U32(1)) {
continue
}
- if (0 == (crt.AssignInt32(&rc, Xsqlite3PagerGet(tls, pDestPager, iDest, bp /* &pDestPg */, 0)))) &&
- (0 == (crt.AssignInt32(&rc, Xsqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp /* pDestPg */)))))) {
+ if (0 == (libc.AssignInt32(&rc, Xsqlite3PagerGet(tls, pDestPager, iDest, bp /* &pDestPg */, 0)))) &&
+ (0 == (libc.AssignInt32(&rc, Xsqlite3PagerWrite(tls, *(*uintptr)(unsafe.Pointer(bp /* pDestPg */)))))) {
var zIn uintptr = (zSrcData + uintptr((iOff % I64(nSrcPgsz))))
var zDestData uintptr = Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp /* pDestPg */)))
var zOut uintptr = (zDestData + uintptr((iOff % I64(nDestPgsz))))
@@ -49771,7 +51204,7 @@ func backupOnePage(tls *crt.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpda
// of the page 'extra' space to invalidate the Btree layers
// cached parse of the page). MemPage.isInit is marked
// "MUST BE FIRST" for this purpose.
- crt.Xmemcpy(tls, zOut, zIn, uint64(nCopy))
+ libc.Xmemcpy(tls, zOut, zIn, uint64(nCopy))
*(*U8)(unsafe.Pointer((Xsqlite3PagerGetExtra(tls, *(*uintptr)(unsafe.Pointer(bp /* pDestPg */)))) + uintptr(0))) = U8(0)
if (iOff == int64(0)) && (bUpdate == 0) {
Xsqlite3Put4byte(tls, (zOut + uintptr(28)), Xsqlite3BtreeLastPage(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc))
@@ -49789,7 +51222,7 @@ func backupOnePage(tls *crt.TLS, p uintptr, iSrcPg Pgno, zSrcData uintptr, bUpda
//
// Return SQLITE_OK if everything is successful, or an SQLite error
// code if an error occurs.
-func backupTruncateFile(tls *crt.TLS, pFile uintptr, iSize I64) int32 { /* sqlite3.c:75172:12: */
+func backupTruncateFile(tls *libc.TLS, pFile uintptr, iSize I64) int32 { /* sqlite3.c:75352:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -49804,7 +51237,7 @@ func backupTruncateFile(tls *crt.TLS, pFile uintptr, iSize I64) int32 { /* sqlit
// Register this backup object with the associated source pager for
// callbacks when pages are changed or the cache invalidated.
-func attachBackupObject(tls *crt.TLS, p uintptr) { /* sqlite3.c:75185:13: */
+func attachBackupObject(tls *libc.TLS, p uintptr) { /* sqlite3.c:75365:13: */
var pp uintptr
pp = Xsqlite3PagerBackupPtr(tls, Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpSrc))
@@ -49814,7 +51247,7 @@ func attachBackupObject(tls *crt.TLS, p uintptr) { /* sqlite3.c:75185:13: */
}
// Copy nPage pages from the source b-tree to the destination.
-func Xsqlite3_backup_step(tls *crt.TLS, p uintptr, nPage int32) int32 { /* sqlite3.c:75197:16: */
+func Xsqlite3_backup_step(tls *libc.TLS, p uintptr, nPage int32) int32 { /* sqlite3.c:75377:16: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -49865,7 +51298,7 @@ func Xsqlite3_backup_step(tls *crt.TLS, p uintptr, nPage int32) int32 { /* sqlit
// Lock the destination database, if it is not locked already.
if ((0 == rc) && ((*Sqlite3_backup)(unsafe.Pointer(p)).FbDestLocked == 0)) &&
- (0 == (crt.AssignInt32(&rc, Xsqlite3BtreeBeginTrans(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 2,
+ (0 == (libc.AssignInt32(&rc, Xsqlite3BtreeBeginTrans(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 2,
(p+16 /* &.iDestSchema */))))) {
(*Sqlite3_backup)(unsafe.Pointer(p)).FbDestLocked = 1
}
@@ -50021,7 +51454,7 @@ func Xsqlite3_backup_step(tls *crt.TLS, p uintptr, nPage int32) int32 { /* sqlit
// Finish committing the transaction to the destination database.
if (0 == rc) &&
- (0 == (crt.AssignInt32(&rc, Xsqlite3BtreeCommitPhaseTwo(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 0)))) {
+ (0 == (libc.AssignInt32(&rc, Xsqlite3BtreeCommitPhaseTwo(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).FpDest, 0)))) {
rc = 101
}
}
@@ -50051,7 +51484,7 @@ func Xsqlite3_backup_step(tls *crt.TLS, p uintptr, nPage int32) int32 { /* sqlit
}
// Release all resources associated with an sqlite3_backup* handle.
-func Xsqlite3_backup_finish(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:75451:16: */
+func Xsqlite3_backup_finish(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75631:16: */
var pp uintptr // Ptr to head of pagers backup list
var pSrcDb uintptr // Source database connection
var rc int32 // Value to return
@@ -50108,13 +51541,13 @@ func Xsqlite3_backup_finish(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:75451:
// Return the number of pages still to be backed up as of the most recent
// call to sqlite3_backup_step().
-func Xsqlite3_backup_remaining(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:75505:16: */
+func Xsqlite3_backup_remaining(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75685:16: */
return int32((*Sqlite3_backup)(unsafe.Pointer(p)).FnRemaining)
}
// Return the total number of pages in the source database as of the most
// recent call to sqlite3_backup_step().
-func Xsqlite3_backup_pagecount(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:75519:16: */
+func Xsqlite3_backup_pagecount(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:75699:16: */
return int32((*Sqlite3_backup)(unsafe.Pointer(p)).FnPagecount)
}
@@ -50128,9 +51561,9 @@ func Xsqlite3_backup_pagecount(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:755
// It is assumed that the mutex associated with the BtShared object
// corresponding to the source database is held when this function is
// called.
-func backupUpdate(tls *crt.TLS, p uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:75541:29: */
+func backupUpdate(tls *libc.TLS, p uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:75721:29: */
- for ok := true; ok; ok = ((crt.AssignUintptr(&p, (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext)) != uintptr(0)) {
+ for ok := true; ok; ok = ((libc.AssignUintptr(&p, (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext)) != uintptr(0)) {
if !(isFatalError(tls, (*Sqlite3_backup)(unsafe.Pointer(p)).Frc) != 0) && (iPage < (*Sqlite3_backup)(unsafe.Pointer(p)).FiNext) {
// The backup process p has already copied page iPage. But now it
@@ -50148,7 +51581,7 @@ func backupUpdate(tls *crt.TLS, p uintptr, iPage Pgno, aData uintptr) { /* sqlit
}
}
}
-func Xsqlite3BackupUpdate(tls *crt.TLS, pBackup uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:75566:21: */
+func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uintptr) { /* sqlite3.c:75746:21: */
if pBackup != 0 {
backupUpdate(tls, pBackup, iPage, aData)
}
@@ -50163,7 +51596,7 @@ func Xsqlite3BackupUpdate(tls *crt.TLS, pBackup uintptr, iPage Pgno, aData uintp
// It is assumed that the mutex associated with the BtShared object
// corresponding to the source database is held when this function is
// called.
-func Xsqlite3BackupRestart(tls *crt.TLS, pBackup uintptr) { /* sqlite3.c:75581:21: */
+func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr) { /* sqlite3.c:75761:21: */
var p uintptr // Iterator variable
for p = pBackup; p != 0; p = (*Sqlite3_backup)(unsafe.Pointer(p)).FpNext {
@@ -50177,7 +51610,7 @@ func Xsqlite3BackupRestart(tls *crt.TLS, pBackup uintptr) { /* sqlite3.c:75581:2
// The size of file pTo may be reduced by this operation. If anything
// goes wrong, the transaction on pTo is rolled back. If successful, the
// transaction is committed before returning.
-func Xsqlite3BtreeCopyFile(tls *crt.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:75598:20: */
+func Xsqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:75778:20: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -50215,7 +51648,7 @@ __1:
// to 0. This is used by the implementations of sqlite3_backup_step()
// and sqlite3_backup_finish() to detect that they are being called
// from this function, not directly by the user.
- crt.Xmemset(tls, bp+8 /* &b */, 0, uint64(unsafe.Sizeof(Sqlite3_backup{})))
+ libc.Xmemset(tls, bp+8 /* &b */, 0, uint64(unsafe.Sizeof(Sqlite3_backup{})))
(*Sqlite3_backup)(unsafe.Pointer(bp + 8 /* &b */)).FpSrcDb = (*Btree)(unsafe.Pointer(pFrom)).Fdb
(*Sqlite3_backup)(unsafe.Pointer(bp + 8 /* &b */)).FpSrc = pFrom
(*Sqlite3_backup)(unsafe.Pointer(bp + 8 /* &b */)).FpDest = pTo
@@ -50233,7 +51666,7 @@ __1:
if !(rc == 0) {
goto __4
}
- *(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(pTo)).FpBt + 40 /* &.btsFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0002))))
+ *(*U16)(unsafe.Pointer((*Btree)(unsafe.Pointer(pTo)).FpBt + 40 /* &.btsFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0002))))
goto __5
__4:
Xsqlite3PagerClearCache(tls, Xsqlite3BtreePager(tls, (*Sqlite3_backup)(unsafe.Pointer(bp+8 /* &b */)).FpDest))
@@ -50271,22 +51704,26 @@ copy_finished:
// Render a Mem object which is one of MEM_Int, MEM_Real, or MEM_IntReal
// into a buffer.
-func vdbeMemRenderNum(tls *crt.TLS, sz int32, zBuf uintptr, p uintptr) { /* sqlite3.c:75754:13: */
- bp := tls.Alloc(56)
- defer tls.Free(56)
+func vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { /* sqlite3.c:75934:13: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
- // var acc StrAccum at bp+24, 32
+ // var acc StrAccum at bp+8, 32
- Xsqlite3StrAccumInit(tls, bp+24 /* &acc */, uintptr(0), zBuf, sz, 0)
if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & 0x0004) != 0 {
- Xsqlite3_str_appendf(tls, bp+24 /* &acc */, ts+456 /* "%lld" */, crt.VaList(bp, *(*I64)(unsafe.Pointer(p /* &.u */))))
- } else if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & 0x0020) != 0 {
- Xsqlite3_str_appendf(tls, bp+24 /* &acc */, ts+4424 /* "%!.15g" */, crt.VaList(bp+8, float64(*(*I64)(unsafe.Pointer(p /* &.u */)))))
+ Xsqlite3Int64ToText(tls, *(*I64)(unsafe.Pointer(p /* &.u */)), zBuf)
} else {
- Xsqlite3_str_appendf(tls, bp+24 /* &acc */, ts+4424 /* "%!.15g" */, crt.VaList(bp+16, *(*float64)(unsafe.Pointer(p /* &.u */))))
- }
+ Xsqlite3StrAccumInit(tls, bp+8 /* &acc */, uintptr(0), zBuf, sz, 0)
+ Xsqlite3_str_appendf(tls, bp+8 /* &acc */, ts+6559, /* "%!.15g" */
+ libc.VaList(bp, func() float64 {
+ if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & 0x0020) != 0 {
+ return float64(*(*I64)(unsafe.Pointer(p /* &.u */)))
+ }
+ return *(*float64)(unsafe.Pointer(p /* &.u */))
+ }()))
- *(*int8)(unsafe.Pointer(zBuf + uintptr((*StrAccum)(unsafe.Pointer(bp+24 /* &acc */)).FnChar))) = int8(0) // Fast version of sqlite3StrAccumFinish(&acc)
+ *(*int8)(unsafe.Pointer(zBuf + uintptr((*StrAccum)(unsafe.Pointer(bp+8 /* &acc */)).FnChar))) = int8(0)
+ }
}
// If pMem is an object with a valid string representation, this routine
@@ -50300,7 +51737,7 @@ func vdbeMemRenderNum(tls *crt.TLS, sz int32, zBuf uintptr, p uintptr) { /* sqli
// SQLITE_OK is returned if the conversion is successful (or not required).
// SQLITE_NOMEM may be returned if a malloc() fails during conversion
// between formats.
-func Xsqlite3VdbeChangeEncoding(tls *crt.TLS, pMem uintptr, desiredEnc int32) int32 { /* sqlite3.c:75838:20: */
+func Xsqlite3VdbeChangeEncoding(tls *libc.TLS, pMem uintptr, desiredEnc int32) int32 { /* sqlite3.c:76027:20: */
var rc int32
if !((int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & 0x0002) != 0) || (int32((*Mem)(unsafe.Pointer(pMem)).Fenc) == desiredEnc) {
@@ -50320,14 +51757,14 @@ func Xsqlite3VdbeChangeEncoding(tls *crt.TLS, pMem uintptr, desiredEnc int32) in
// pMem->z into the new allocation. pMem must be either a string or
// blob if bPreserve is true. If bPreserve is false, any prior content
// in pMem->z is discarded.
-func Xsqlite3VdbeMemGrow(tls *crt.TLS, pMem uintptr, n int32, bPreserve int32) int32 { /* sqlite3.c:75872:36: */
+func Xsqlite3VdbeMemGrow(tls *libc.TLS, pMem uintptr, n int32, bPreserve int32) int32 { /* sqlite3.c:76061:36: */
// If the bPreserve flag is set to true, then the memory cell must already
// contain a valid string or blob value.
if (((*Mem)(unsafe.Pointer(pMem)).FszMalloc > 0) && (bPreserve != 0)) && ((*Mem)(unsafe.Pointer(pMem)).Fz == (*Mem)(unsafe.Pointer(pMem)).FzMalloc) {
if (*Mem)(unsafe.Pointer(pMem)).Fdb != 0 {
- (*Mem)(unsafe.Pointer(pMem)).Fz = crt.AssignPtrUintptr(pMem+24 /* &.zMalloc */, Xsqlite3DbReallocOrFree(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64(n)))
+ (*Mem)(unsafe.Pointer(pMem)).Fz = libc.AssignPtrUintptr(pMem+24 /* &.zMalloc */, Xsqlite3DbReallocOrFree(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64(n)))
} else {
(*Mem)(unsafe.Pointer(pMem)).FzMalloc = Xsqlite3Realloc(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64(n))
if (*Mem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) {
@@ -50353,15 +51790,15 @@ func Xsqlite3VdbeMemGrow(tls *crt.TLS, pMem uintptr, n int32, bPreserve int32) i
if (bPreserve != 0) && ((*Mem)(unsafe.Pointer(pMem)).Fz != 0) {
- crt.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pMem)).FzMalloc, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64((*Mem)(unsafe.Pointer(pMem)).Fn))
+ libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pMem)).FzMalloc, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64((*Mem)(unsafe.Pointer(pMem)).Fn))
}
if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & 0x0400) != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pMem + 48 /* &.xDel */))))(tls, (*Mem)(unsafe.Pointer(pMem)).Fz)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pMem + 48 /* &.xDel */))))(tls, (*Mem)(unsafe.Pointer(pMem)).Fz)
}
(*Mem)(unsafe.Pointer(pMem)).Fz = (*Mem)(unsafe.Pointer(pMem)).FzMalloc
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(((0x0400 | 0x1000) | 0x0800)))))
+ *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(((0x0400 | 0x1000) | 0x0800)))))
return 0
}
@@ -50376,7 +51813,7 @@ func Xsqlite3VdbeMemGrow(tls *crt.TLS, pMem uintptr, n int32, bPreserve int32) i
//
// Return SQLITE_OK on success or an error code (probably SQLITE_NOMEM)
// if unable to complete the resizing.
-func Xsqlite3VdbeMemClearAndResize(tls *crt.TLS, pMem uintptr, szNew int32) int32 { /* sqlite3.c:75933:20: */
+func Xsqlite3VdbeMemClearAndResize(tls *libc.TLS, pMem uintptr, szNew int32) int32 { /* sqlite3.c:76122:20: */
if (*Mem)(unsafe.Pointer(pMem)).FszMalloc < szNew {
return Xsqlite3VdbeMemGrow(tls, pMem, szNew, 0)
@@ -50394,7 +51831,7 @@ func Xsqlite3VdbeMemClearAndResize(tls *crt.TLS, pMem uintptr, szNew int32) int3
// to be a double-zero byte at an even byte boundary in order to
// terminate a UTF16 string, even if the initial size of the buffer
// is an odd number of bytes.
-func vdbeMemAddTerminator(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:75954:28: */
+func vdbeMemAddTerminator(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76143:28: */
if Xsqlite3VdbeMemGrow(tls, pMem, ((*Mem)(unsafe.Pointer(pMem)).Fn+3), 1) != 0 {
return 7
}
@@ -50409,7 +51846,7 @@ func vdbeMemAddTerminator(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:75954
// MEM.zMalloc, where it can be safely written.
//
// Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
-func Xsqlite3VdbeMemMakeWriteable(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:75971:20: */
+func Xsqlite3VdbeMemMakeWriteable(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76160:20: */
if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (0x0002 | 0x0010)) != 0 {
if func() int32 {
@@ -50427,14 +51864,14 @@ func Xsqlite3VdbeMemMakeWriteable(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3
}
}
}
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x1000))))
+ *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x1000))))
return 0
}
// If the given Mem* has a zero-filled tail, turn it into an ordinary
// blob stored in dynamically allocated space.
-func Xsqlite3VdbeMemExpandBlob(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:75994:20: */
+func Xsqlite3VdbeMemExpandBlob(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76183:20: */
var nByte int32
// Set nByte to the number of bytes required to store the expanded blob.
@@ -50449,14 +51886,14 @@ func Xsqlite3VdbeMemExpandBlob(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:
return 7
}
- crt.Xmemset(tls, ((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn)), 0, uint64(*(*int32)(unsafe.Pointer(pMem /* &.u */))))
+ libc.Xmemset(tls, ((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr((*Mem)(unsafe.Pointer(pMem)).Fn)), 0, uint64(*(*int32)(unsafe.Pointer(pMem /* &.u */))))
*(*int32)(unsafe.Pointer(pMem + 12 /* &.n */)) += (*(*int32)(unsafe.Pointer(pMem /* &.u */)))
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32((0x4000 | 0x0200)))))
+ *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32((0x4000 | 0x0200)))))
return 0
}
// Make sure the given Mem is \u0000 terminated.
-func Xsqlite3VdbeMemNulTerminate(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:76022:20: */
+func Xsqlite3VdbeMemNulTerminate(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76211:20: */
if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (0x0200 | 0x0002)) != 0x0002 {
return 0
@@ -50478,7 +51915,7 @@ func Xsqlite3VdbeMemNulTerminate(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.
// sqlite3_value_text()), or for ensuring that values to be used as btree
// keys are strings. In the former case a NULL pointer is returned the
// user and the latter is an internal programming error.
-func Xsqlite3VdbeMemStringify(tls *crt.TLS, pMem uintptr, enc U8, bForce U8) int32 { /* sqlite3.c:76047:20: */
+func Xsqlite3VdbeMemStringify(tls *libc.TLS, pMem uintptr, enc U8, bForce U8) int32 { /* sqlite3.c:76236:20: */
var nByte int32 = 32
if Xsqlite3VdbeMemClearAndResize(tls, pMem, nByte) != 0 {
@@ -50488,11 +51925,11 @@ func Xsqlite3VdbeMemStringify(tls *crt.TLS, pMem uintptr, enc U8, bForce U8) int
vdbeMemRenderNum(tls, nByte, (*Mem)(unsafe.Pointer(pMem)).Fz, pMem)
- (*Mem)(unsafe.Pointer(pMem)).Fn = (int32(crt.Xstrlen(tls, (*Mem)(unsafe.Pointer(pMem)).Fz) & uint64(0x3fffffff)))
+ (*Mem)(unsafe.Pointer(pMem)).Fn = (int32(libc.Xstrlen(tls, (*Mem)(unsafe.Pointer(pMem)).Fz) & uint64(0x3fffffff)))
(*Mem)(unsafe.Pointer(pMem)).Fenc = U8(1)
*(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16((0x0002 | 0x0200))
if bForce != 0 {
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(((0x0004 | 0x0008) | 0x0020)))))
+ *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(((0x0004 | 0x0008) | 0x0020)))))
}
Xsqlite3VdbeChangeEncoding(tls, pMem, int32(enc))
return 0
@@ -50504,7 +51941,7 @@ func Xsqlite3VdbeMemStringify(tls *crt.TLS, pMem uintptr, enc U8, bForce U8) int
//
// Return SQLITE_ERROR if the finalizer reports an error. SQLITE_OK
// otherwise.
-func Xsqlite3VdbeMemFinalize(tls *crt.TLS, pMem uintptr, pFunc uintptr) int32 { /* sqlite3.c:76081:20: */
+func Xsqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) int32 { /* sqlite3.c:76270:20: */
bp := tls.Alloc(112)
defer tls.Free(112)
@@ -50512,19 +51949,19 @@ func Xsqlite3VdbeMemFinalize(tls *crt.TLS, pMem uintptr, pFunc uintptr) int32 {
// var t Mem at bp+56, 56
- crt.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(Sqlite3_context{})))
- crt.Xmemset(tls, bp+56 /* &t */, 0, uint64(unsafe.Sizeof(Mem{})))
+ libc.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(Sqlite3_context{})))
+ libc.Xmemset(tls, bp+56 /* &t */, 0, uint64(unsafe.Sizeof(Mem{})))
(*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fflags = U16(0x0001)
(*Mem)(unsafe.Pointer(bp + 56 /* &t */)).Fdb = (*Mem)(unsafe.Pointer(pMem)).Fdb
(*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpOut = bp + 56 /* &t */
(*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpMem = pMem
(*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpFunc = pFunc
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pFunc + 32 /* &.xFinalize */))))(tls, bp /* &ctx */) // IMP: R-24505-23230
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pFunc + 32 /* &.xFinalize */))))(tls, bp /* &ctx */) // IMP: R-24505-23230
if (*Mem)(unsafe.Pointer(pMem)).FszMalloc > 0 {
Xsqlite3DbFreeNN(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).FzMalloc)
}
- crt.Xmemcpy(tls, pMem, bp+56 /* &t */, uint64(unsafe.Sizeof(Mem{})))
+ libc.Xmemcpy(tls, pMem, bp+56 /* &t */, uint64(unsafe.Sizeof(Mem{})))
return (*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FisError
}
@@ -50534,18 +51971,18 @@ func Xsqlite3VdbeMemFinalize(tls *crt.TLS, pMem uintptr, pFunc uintptr) int32 {
//
// SQLITE_ERROR is returned if xValue() reports an error. SQLITE_OK
// otherwise.
-func Xsqlite3VdbeMemAggValue(tls *crt.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) int32 { /* sqlite3.c:76111:20: */
+func Xsqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) int32 { /* sqlite3.c:76300:20: */
bp := tls.Alloc(56)
defer tls.Free(56)
// var ctx Sqlite3_context at bp, 56
- crt.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(Sqlite3_context{})))
+ libc.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(Sqlite3_context{})))
Xsqlite3VdbeMemSetNull(tls, pOut)
(*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpOut = pOut
(*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpMem = pAccum
(*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FpFunc = pFunc
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pFunc + 40 /* &.xValue */))))(tls, bp /* &ctx */)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pFunc + 40 /* &.xValue */))))(tls, bp /* &ctx */)
return (*Sqlite3_context)(unsafe.Pointer(bp /* &ctx */)).FisError
}
@@ -50556,7 +51993,7 @@ func Xsqlite3VdbeMemAggValue(tls *crt.TLS, pAccum uintptr, pOut uintptr, pFunc u
// This is a helper routine for sqlite3VdbeMemSetNull() and
// for sqlite3VdbeMemRelease(). Use those other routines as the
// entry point for releasing Mem resources.
-func vdbeMemClearExternAndSetNull(tls *crt.TLS, p uintptr) { /* sqlite3.c:76136:29: */
+func vdbeMemClearExternAndSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:76325:29: */
if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & 0x2000) != 0 {
Xsqlite3VdbeMemFinalize(tls, p, *(*uintptr)(unsafe.Pointer(p /* &.u */)))
@@ -50564,7 +52001,7 @@ func vdbeMemClearExternAndSetNull(tls *crt.TLS, p uintptr) { /* sqlite3.c:76136:
}
if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & 0x0400) != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((p + 48 /* &.xDel */))))(tls, (*Mem)(unsafe.Pointer(p)).Fz)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((p + 48 /* &.xDel */))))(tls, (*Mem)(unsafe.Pointer(p)).Fz)
}
(*Mem)(unsafe.Pointer(p)).Fflags = U16(0x0001)
}
@@ -50575,7 +52012,7 @@ func vdbeMemClearExternAndSetNull(tls *crt.TLS, p uintptr) { /* sqlite3.c:76136:
// This is a helper routine invoked by sqlite3VdbeMemRelease() in
// the unusual case where there really is memory in p that needs
// to be freed.
-func vdbeMemClear(tls *crt.TLS, p uintptr) { /* sqlite3.c:76159:29: */
+func vdbeMemClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:76348:29: */
if (int32((*Mem)(unsafe.Pointer((p))).Fflags) & (0x2000 | 0x0400)) != 0 {
vdbeMemClearExternAndSetNull(tls, p)
}
@@ -50594,7 +52031,7 @@ func vdbeMemClear(tls *crt.TLS, p uintptr) { /* sqlite3.c:76159:29: */
//
// Use sqlite3VdbeMemSetNull() to release just the Mem.xDel space
// prior to inserting new content into the Mem.
-func Xsqlite3VdbeMemRelease(tls *crt.TLS, p uintptr) { /* sqlite3.c:76180:21: */
+func Xsqlite3VdbeMemRelease(tls *libc.TLS, p uintptr) { /* sqlite3.c:76369:21: */
if ((int32((*Mem)(unsafe.Pointer((p))).Fflags) & (0x2000 | 0x0400)) != 0) || ((*Mem)(unsafe.Pointer(p)).FszMalloc != 0) {
vdbeMemClear(tls, p)
@@ -50604,7 +52041,7 @@ func Xsqlite3VdbeMemRelease(tls *crt.TLS, p uintptr) { /* sqlite3.c:76180:21: */
// Convert a 64-bit IEEE double into a 64-bit signed integer.
// If the double is out of range of a 64-bit signed integer then
// return the closest available 64-bit signed integer.
-func doubleToInt64(tls *crt.TLS, r float64) I64 { /* sqlite3.c:76192:28: */
+func doubleToInt64(tls *libc.TLS, r float64) I64 { /* sqlite3.c:76381:28: */
if r <= float64(minInt) {
return minInt
@@ -50616,8 +52053,8 @@ func doubleToInt64(tls *crt.TLS, r float64) I64 { /* sqlite3.c:76192:28: */
return I64(0)
}
-var maxInt I64 = (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) /* sqlite3.c:76204:20 */
-var minInt I64 = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) /* sqlite3.c:76205:20 */
+var maxInt I64 = (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) /* sqlite3.c:76393:20 */
+var minInt I64 = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) /* sqlite3.c:76394:20 */
// Return some kind of integer value which is the best we can do
// at representing the value that *pMem describes as an integer.
@@ -50628,7 +52065,7 @@ var minInt I64 = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) <
// an SQL-NULL value, return 0.
//
// If pMem represents a string value, its encoding might be changed.
-func memIntValue(tls *crt.TLS, pMem uintptr) I64 { /* sqlite3.c:76228:28: */
+func memIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:76417:28: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -50636,7 +52073,7 @@ func memIntValue(tls *crt.TLS, pMem uintptr) I64 { /* sqlite3.c:76228:28: */
Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &value */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc)
return *(*I64)(unsafe.Pointer(bp /* value */))
}
-func Xsqlite3VdbeIntValue(tls *crt.TLS, pMem uintptr) I64 { /* sqlite3.c:76233:20: */
+func Xsqlite3VdbeIntValue(tls *libc.TLS, pMem uintptr) I64 { /* sqlite3.c:76422:20: */
var flags int32
flags = int32((*Mem)(unsafe.Pointer(pMem)).Fflags)
@@ -50657,7 +52094,7 @@ func Xsqlite3VdbeIntValue(tls *crt.TLS, pMem uintptr) I64 { /* sqlite3.c:76233:2
// double. If pMem is already a double or an integer, return its
// value. If it is a string or blob, try to convert it to a double.
// If it is a NULL, return 0.0.
-func memRealValue(tls *crt.TLS, pMem uintptr) float64 { /* sqlite3.c:76256:31: */
+func memRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:76445:31: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -50666,7 +52103,7 @@ func memRealValue(tls *crt.TLS, pMem uintptr) float64 { /* sqlite3.c:76256:31: *
Xsqlite3AtoF(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &val */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc)
return *(*float64)(unsafe.Pointer(bp /* val */))
}
-func Xsqlite3VdbeRealValue(tls *crt.TLS, pMem uintptr) float64 { /* sqlite3.c:76262:23: */
+func Xsqlite3VdbeRealValue(tls *libc.TLS, pMem uintptr) float64 { /* sqlite3.c:76451:23: */
if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & 0x0008) != 0 {
return *(*float64)(unsafe.Pointer(pMem /* &.u */))
@@ -50684,20 +52121,20 @@ func Xsqlite3VdbeRealValue(tls *crt.TLS, pMem uintptr) float64 { /* sqlite3.c:76
// Return 1 if pMem represents true, and return 0 if pMem represents false.
// Return the value ifNull if pMem is NULL.
-func Xsqlite3VdbeBooleanValue(tls *crt.TLS, pMem uintptr, ifNull int32) int32 { /* sqlite3.c:76282:20: */
+func Xsqlite3VdbeBooleanValue(tls *libc.TLS, pMem uintptr, ifNull int32) int32 { /* sqlite3.c:76471:20: */
if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (0x0004 | 0x0020)) != 0 {
- return (crt.Bool32(*(*I64)(unsafe.Pointer(pMem /* &.u */)) != int64(0)))
+ return (libc.Bool32(*(*I64)(unsafe.Pointer(pMem /* &.u */)) != int64(0)))
}
if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & 0x0001) != 0 {
return ifNull
}
- return (crt.Bool32(Xsqlite3VdbeRealValue(tls, pMem) != 0.0))
+ return (libc.Bool32(Xsqlite3VdbeRealValue(tls, pMem) != 0.0))
}
// The MEM structure is already a MEM_Real. Try to also make it a
// MEM_Int if we can.
-func Xsqlite3VdbeIntegerAffinity(tls *crt.TLS, pMem uintptr) { /* sqlite3.c:76293:21: */
+func Xsqlite3VdbeIntegerAffinity(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:76482:21: */
var ix I64
ix = doubleToInt64(tls, *(*float64)(unsafe.Pointer(pMem /* &.u */)))
@@ -50713,24 +52150,24 @@ func Xsqlite3VdbeIntegerAffinity(tls *crt.TLS, pMem uintptr) { /* sqlite3.c:7629
// values to wrap around.
if ((*(*float64)(unsafe.Pointer(pMem /* &.u */)) == float64(ix)) && (ix > ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) && (ix < (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) {
*(*I64)(unsafe.Pointer(pMem /* &.u */)) = ix
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
}
}
// Convert pMem to type integer. Invalidate any prior representations.
-func Xsqlite3VdbeMemIntegerify(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:76321:20: */
+func Xsqlite3VdbeMemIntegerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76510:20: */
*(*I64)(unsafe.Pointer(pMem /* &.u */)) = Xsqlite3VdbeIntValue(tls, pMem)
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
return 0
}
// Convert pMem so that it is of type MEM_Real.
// Invalidate any prior representations.
-func Xsqlite3VdbeMemRealify(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:76335:20: */
+func Xsqlite3VdbeMemRealify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76524:20: */
*(*float64)(unsafe.Pointer(pMem /* &.u */)) = Xsqlite3VdbeRealValue(tls, pMem)
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0008))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0008))
return 0
}
@@ -50742,14 +52179,14 @@ func Xsqlite3VdbeMemRealify(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:763
// For some versions of GCC on 32-bit machines, if you do the more obvious
// comparison of "r1==(double)i" you sometimes get an answer of false even
// though the r1 and (double)i values are bit-for-bit the same.
-func Xsqlite3RealSameAsInt(tls *crt.TLS, r1 float64, i Sqlite3_int64) int32 { /* sqlite3.c:76353:20: */
+func Xsqlite3RealSameAsInt(tls *libc.TLS, r1 float64, i Sqlite3_int64) int32 { /* sqlite3.c:76542:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
*(*float64)(unsafe.Pointer(bp)) = r1
*(*float64)(unsafe.Pointer(bp + 8 /* r2 */)) = float64(i)
- return (crt.Bool32((*(*float64)(unsafe.Pointer(bp /* r1 */)) == 0.0) ||
- (((crt.Xmemcmp(tls, bp /* &r1 */, bp+8 /* &r2 */, uint64(unsafe.Sizeof(float64(0)))) == 0) &&
+ return (libc.Bool32((*(*float64)(unsafe.Pointer(bp /* r1 */)) == 0.0) ||
+ (((libc.Xmemcmp(tls, bp /* &r1 */, bp+8 /* &r2 */, uint64(unsafe.Sizeof(float64(0)))) == 0) &&
(i >= -2251799813685248)) && (i < 2251799813685248))))
}
@@ -50759,7 +52196,7 @@ func Xsqlite3RealSameAsInt(tls *crt.TLS, r1 float64, i Sqlite3_int64) int32 { /*
// Every effort is made to force the conversion, even if the input
// is a string that does not look completely like a number. Convert
// as much of the string as we can and ignore the rest.
-func Xsqlite3VdbeMemNumerify(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:76368:20: */
+func Xsqlite3VdbeMemNumerify(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76557:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -50769,15 +52206,15 @@ func Xsqlite3VdbeMemNumerify(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:76
rc = Xsqlite3AtoF(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, (pMem /* &.u */ /* &.r */), (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc)
if (((rc == 0) || (rc == 1)) && (Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, bp /* &ix */, (*Mem)(unsafe.Pointer(pMem)).Fn, (*Mem)(unsafe.Pointer(pMem)).Fenc) <= 1)) ||
- (Xsqlite3RealSameAsInt(tls, *(*float64)(unsafe.Pointer(pMem /* &.u */)), crt.AssignPtrInt64(bp /* ix */, I64(*(*float64)(unsafe.Pointer(pMem /* &.u */))))) != 0) {
+ (Xsqlite3RealSameAsInt(tls, *(*float64)(unsafe.Pointer(pMem /* &.u */)), libc.AssignPtrInt64(bp /* ix */, I64(*(*float64)(unsafe.Pointer(pMem /* &.u */))))) != 0) {
*(*I64)(unsafe.Pointer(pMem /* &.u */)) = *(*Sqlite3_int64)(unsafe.Pointer(bp /* ix */))
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
} else {
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0008))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0008))
}
}
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(((0x0002 | 0x0010) | 0x4000)))))
+ *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(((0x0002 | 0x0010) | 0x4000)))))
return 0
}
@@ -50786,7 +52223,7 @@ func Xsqlite3VdbeMemNumerify(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:76
// is forced. In other words, the value is converted into the desired
// affinity even if that results in loss of data. This routine is
// used (for example) to implement the SQL "cast()" operator.
-func Xsqlite3VdbeMemCast(tls *crt.TLS, pMem uintptr, aff U8, encoding U8) int32 { /* sqlite3.c:76400:20: */
+func Xsqlite3VdbeMemCast(tls *libc.TLS, pMem uintptr, aff U8, encoding U8) int32 { /* sqlite3.c:76589:20: */
if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & 0x0001) != 0 {
return 0
}
@@ -50797,10 +52234,10 @@ func Xsqlite3VdbeMemCast(tls *crt.TLS, pMem uintptr, aff U8, encoding U8) int32
Xsqlite3ValueApplyAffinity(tls, pMem, uint8(0x42), encoding)
if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & 0x0002) != 0 {
- (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0010))
+ (*Mem)(unsafe.Pointer(pMem)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0010))
}
} else {
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32((0xc1bf & ^int32(crt.Int32FromInt32(0x0010)))))))
+ *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32((0xc1bf & ^int32(libc.Int32FromInt32(0x0010)))))))
}
break
}
@@ -50825,7 +52262,7 @@ func Xsqlite3VdbeMemCast(tls *crt.TLS, pMem uintptr, aff U8, encoding U8) int32
*(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) |= U16(((int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & 0x0010) >> 3))
Xsqlite3ValueApplyAffinity(tls, pMem, uint8(0x42), encoding)
- *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(((((0x0004 | 0x0008) | 0x0020) | 0x0010) | 0x4000)))))
+ *(*U16)(unsafe.Pointer(pMem + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(((((0x0004 | 0x0008) | 0x0020) | 0x0010) | 0x4000)))))
return Xsqlite3VdbeChangeEncoding(tls, pMem, int32(encoding))
}
}
@@ -50835,7 +52272,7 @@ func Xsqlite3VdbeMemCast(tls *crt.TLS, pMem uintptr, aff U8, encoding U8) int32
// Initialize bulk memory to be a consistent Mem object.
//
// The minimum amount of initialization feasible is performed.
-func Xsqlite3VdbeMemInit(tls *crt.TLS, pMem uintptr, db uintptr, flags U16) { /* sqlite3.c:76443:21: */
+func Xsqlite3VdbeMemInit(tls *libc.TLS, pMem uintptr, db uintptr, flags U16) { /* sqlite3.c:76632:21: */
(*Mem)(unsafe.Pointer(pMem)).Fflags = flags
(*Mem)(unsafe.Pointer(pMem)).Fdb = db
@@ -50852,20 +52289,20 @@ func Xsqlite3VdbeMemInit(tls *crt.TLS, pMem uintptr, db uintptr, flags U16) { /*
// Use this routine to reset the Mem prior to insert a new value.
//
// Use sqlite3VdbeMemRelease() to complete erase the Mem prior to abandoning it.
-func Xsqlite3VdbeMemSetNull(tls *crt.TLS, pMem uintptr) { /* sqlite3.c:76463:21: */
+func Xsqlite3VdbeMemSetNull(tls *libc.TLS, pMem uintptr) { /* sqlite3.c:76652:21: */
if (int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & (0x2000 | 0x0400)) != 0 {
vdbeMemClearExternAndSetNull(tls, pMem)
} else {
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(0x0001)
}
}
-func Xsqlite3ValueSetNull(tls *crt.TLS, p uintptr) { /* sqlite3.c:76470:21: */
+func Xsqlite3ValueSetNull(tls *libc.TLS, p uintptr) { /* sqlite3.c:76659:21: */
Xsqlite3VdbeMemSetNull(tls, p)
}
// Delete any previous value and set the value to be a BLOB of length
// n containing all zeros.
-func Xsqlite3VdbeMemSetZeroBlob(tls *crt.TLS, pMem uintptr, n int32) { /* sqlite3.c:76478:21: */
+func Xsqlite3VdbeMemSetZeroBlob(tls *libc.TLS, pMem uintptr, n int32) { /* sqlite3.c:76667:21: */
Xsqlite3VdbeMemRelease(tls, pMem)
(*Mem)(unsafe.Pointer(pMem)).Fflags = (U16(0x0010 | 0x4000))
(*Mem)(unsafe.Pointer(pMem)).Fn = 0
@@ -50880,7 +52317,7 @@ func Xsqlite3VdbeMemSetZeroBlob(tls *crt.TLS, pMem uintptr, n int32) { /* sqlite
// The pMem is known to contain content that needs to be destroyed prior
// to a value change. So invoke the destructor, then set the value to
// a 64-bit integer.
-func vdbeReleaseAndSetInt64(tls *crt.TLS, pMem uintptr, val I64) { /* sqlite3.c:76493:29: */
+func vdbeReleaseAndSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:76682:29: */
Xsqlite3VdbeMemSetNull(tls, pMem)
*(*I64)(unsafe.Pointer(pMem /* &.u */)) = val
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(0x0004)
@@ -50888,7 +52325,7 @@ func vdbeReleaseAndSetInt64(tls *crt.TLS, pMem uintptr, val I64) { /* sqlite3.c:
// Delete any previous value and set the value stored in *pMem to val,
// manifest type INTEGER.
-func Xsqlite3VdbeMemSetInt64(tls *crt.TLS, pMem uintptr, val I64) { /* sqlite3.c:76503:21: */
+func Xsqlite3VdbeMemSetInt64(tls *libc.TLS, pMem uintptr, val I64) { /* sqlite3.c:76692:21: */
if (int32((*Mem)(unsafe.Pointer((pMem))).Fflags) & (0x2000 | 0x0400)) != 0 {
vdbeReleaseAndSetInt64(tls, pMem, val)
} else {
@@ -50898,17 +52335,17 @@ func Xsqlite3VdbeMemSetInt64(tls *crt.TLS, pMem uintptr, val I64) { /* sqlite3.c
}
// A no-op destructor
-func Xsqlite3NoopDestructor(tls *crt.TLS, p uintptr) { /* sqlite3.c:76513:21: */ _ = p }
+func Xsqlite3NoopDestructor(tls *libc.TLS, p uintptr) { /* sqlite3.c:76702:21: */ _ = p }
// Set the value stored in *pMem should already be a NULL.
// Also store a pointer to go with it.
-func Xsqlite3VdbeMemSetPointer(tls *crt.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:76519:21: */
+func Xsqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:76708:21: */
*(*uintptr)(unsafe.Pointer(pMem /* &.u */)) = func() uintptr {
if zPType != 0 {
return zPType
}
- return ts + 672 /* "" */
+ return ts + 781 /* "" */
}()
(*Mem)(unsafe.Pointer(pMem)).Fz = pPtr
(*Mem)(unsafe.Pointer(pMem)).Fflags = (U16(((0x0001 | 0x0400) | 0x8000) | 0x0200))
@@ -50917,13 +52354,13 @@ func Xsqlite3VdbeMemSetPointer(tls *crt.TLS, pMem uintptr, pPtr uintptr, zPType
if xDestructor != 0 {
return xDestructor
}
- return *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3NoopDestructor}))
+ return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3NoopDestructor}))
}()
}
// Delete any previous value and set the value stored in *pMem to val,
// manifest type REAL.
-func Xsqlite3VdbeMemSetDouble(tls *crt.TLS, pMem uintptr, val float64) { /* sqlite3.c:76538:21: */
+func Xsqlite3VdbeMemSetDouble(tls *libc.TLS, pMem uintptr, val float64) { /* sqlite3.c:76727:21: */
Xsqlite3VdbeMemSetNull(tls, pMem)
if !(Xsqlite3IsNaN(tls, val) != 0) {
*(*float64)(unsafe.Pointer(pMem /* &.u */)) = val
@@ -50936,7 +52373,7 @@ func Xsqlite3VdbeMemSetDouble(tls *crt.TLS, pMem uintptr, val float64) { /* sqli
//
// Return SQLITE_OK on success and SQLITE_NOMEM if a memory allocation
// error occurs.
-func Xsqlite3VdbeMemSetRowSet(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:76565:20: */
+func Xsqlite3VdbeMemSetRowSet(tls *libc.TLS, pMem uintptr) int32 { /* sqlite3.c:76754:20: */
var db uintptr = (*Mem)(unsafe.Pointer(pMem)).Fdb
var p uintptr
@@ -50947,20 +52384,20 @@ func Xsqlite3VdbeMemSetRowSet(tls *crt.TLS, pMem uintptr) int32 { /* sqlite3.c:7
}
(*Mem)(unsafe.Pointer(pMem)).Fz = p
(*Mem)(unsafe.Pointer(pMem)).Fflags = (U16(0x0010 | 0x0400))
- (*Mem)(unsafe.Pointer(pMem)).FxDel = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3RowSetDelete}))
+ (*Mem)(unsafe.Pointer(pMem)).FxDel = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3RowSetDelete}))
return 0
}
// Return true if the Mem object contains a TEXT or BLOB that is
// too large - whose size exceeds SQLITE_MAX_LENGTH.
-func Xsqlite3VdbeMemTooBig(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:76583:20: */
+func Xsqlite3VdbeMemTooBig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:76772:20: */
if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & (0x0002 | 0x0010)) != 0 {
var n int32 = (*Mem)(unsafe.Pointer(p)).Fn
if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & 0x4000) != 0 {
n = n + (*(*int32)(unsafe.Pointer(p /* &.u */)))
}
- return (crt.Bool32(n > *(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(p)).Fdb + 124 /* &.aLimit */) + uintptr(0)*4))))
+ return (libc.Bool32(n > *(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(p)).Fdb + 124 /* &.aLimit */) + uintptr(0)*4))))
}
return 0
}
@@ -50969,20 +52406,20 @@ func Xsqlite3VdbeMemTooBig(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:76583:2
// pTo are freed. The pFrom->z field is not duplicated. If
// pFrom->z is used, then pTo->z points to the same thing as pFrom->z
// and flags gets srcType (either MEM_Ephem or MEM_Static).
-func vdbeClrCopy(tls *crt.TLS, pTo uintptr, pFrom uintptr, eType int32) { /* sqlite3.c:76639:29: */
+func vdbeClrCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, eType int32) { /* sqlite3.c:76828:29: */
vdbeMemClearExternAndSetNull(tls, pTo)
Xsqlite3VdbeMemShallowCopy(tls, pTo, pFrom, eType)
}
-func Xsqlite3VdbeMemShallowCopy(tls *crt.TLS, pTo uintptr, pFrom uintptr, srcType int32) { /* sqlite3.c:76644:21: */
+func Xsqlite3VdbeMemShallowCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr, srcType int32) { /* sqlite3.c:76833:21: */
if (int32((*Mem)(unsafe.Pointer((pTo))).Fflags) & (0x2000 | 0x0400)) != 0 {
vdbeClrCopy(tls, pTo, pFrom, srcType)
return
}
- crt.Xmemcpy(tls, pTo, pFrom, uint64((uintptr(0) + 24 /* &.zMalloc */)))
+ libc.Xmemcpy(tls, pTo, pFrom, uint64((uintptr(0) + 24 /* &.zMalloc */)))
if (int32((*Mem)(unsafe.Pointer(pFrom)).Fflags) & 0x0800) == 0 {
- *(*U16)(unsafe.Pointer(pTo + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(((0x0400 | 0x0800) | 0x1000)))))
+ *(*U16)(unsafe.Pointer(pTo + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(((0x0400 | 0x0800) | 0x1000)))))
*(*U16)(unsafe.Pointer(pTo + 8 /* &.flags */)) |= U16((srcType))
}
@@ -50990,14 +52427,14 @@ func Xsqlite3VdbeMemShallowCopy(tls *crt.TLS, pTo uintptr, pFrom uintptr, srcTyp
// Make a full copy of pFrom into pTo. Prior contents of pTo are
// freed before the copy is made.
-func Xsqlite3VdbeMemCopy(tls *crt.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:76660:20: */
+func Xsqlite3VdbeMemCopy(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:76849:20: */
var rc int32 = 0
if (int32((*Mem)(unsafe.Pointer((pTo))).Fflags) & (0x2000 | 0x0400)) != 0 {
vdbeMemClearExternAndSetNull(tls, pTo)
}
- crt.Xmemcpy(tls, pTo, pFrom, uint64((uintptr(0) + 24 /* &.zMalloc */)))
- *(*U16)(unsafe.Pointer(pTo + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0400))))
+ libc.Xmemcpy(tls, pTo, pFrom, uint64((uintptr(0) + 24 /* &.zMalloc */)))
+ *(*U16)(unsafe.Pointer(pTo + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0400))))
if (int32((*Mem)(unsafe.Pointer(pTo)).Fflags) & (0x0002 | 0x0010)) != 0 {
if 0 == (int32((*Mem)(unsafe.Pointer(pFrom)).Fflags) & 0x0800) {
*(*U16)(unsafe.Pointer(pTo + 8 /* &.flags */)) |= U16((0x1000))
@@ -51012,10 +52449,10 @@ func Xsqlite3VdbeMemCopy(tls *crt.TLS, pTo uintptr, pFrom uintptr) int32 { /* sq
// freed. If pFrom contains ephemeral data, a copy is made.
//
// pFrom contains an SQL NULL when this routine returns.
-func Xsqlite3VdbeMemMove(tls *crt.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:76683:21: */
+func Xsqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:76872:21: */
Xsqlite3VdbeMemRelease(tls, pTo)
- crt.Xmemcpy(tls, pTo, pFrom, uint64(unsafe.Sizeof(Mem{})))
+ libc.Xmemcpy(tls, pTo, pFrom, uint64(unsafe.Sizeof(Mem{})))
(*Mem)(unsafe.Pointer(pFrom)).Fflags = U16(0x0001)
(*Mem)(unsafe.Pointer(pFrom)).FszMalloc = 0
}
@@ -51033,7 +52470,7 @@ func Xsqlite3VdbeMemMove(tls *crt.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.
// stored without allocating memory, then it is. If a memory allocation
// is required to store the string, then value of pMem is unchanged. In
// either case, SQLITE_TOOBIG is returned.
-func Xsqlite3VdbeMemSetStr(tls *crt.TLS, pMem uintptr, z uintptr, n int32, enc U8, xDel uintptr) int32 { /* sqlite3.c:76709:20: */
+func Xsqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n int32, enc U8, xDel uintptr) int32 { /* sqlite3.c:76898:20: */
var nByte int32 = n // New value for pMem->n
var iLimit int32 // Maximum allowed string or blob size
var flags U16 = U16(0) // New value for pMem->flags
@@ -51058,7 +52495,7 @@ func Xsqlite3VdbeMemSetStr(tls *crt.TLS, pMem uintptr, z uintptr, n int32, enc U
if nByte < 0 {
if int32(enc) == 1 {
- nByte = (0x7fffffff & int32(crt.Xstrlen(tls, z)))
+ nByte = (0x7fffffff & int32(libc.Xstrlen(tls, z)))
} else {
for nByte = 0; (nByte <= iLimit) && ((int32(*(*int8)(unsafe.Pointer(z + uintptr(nByte)))) | int32(*(*int8)(unsafe.Pointer(z + uintptr((nByte + 1)))))) != 0); nByte = nByte + (2) {
}
@@ -51069,7 +52506,7 @@ func Xsqlite3VdbeMemSetStr(tls *crt.TLS, pMem uintptr, z uintptr, n int32, enc U
// The following block sets the new values of Mem.z and Mem.xDel. It
// also sets a flag in local variable "flags" to indicate the memory
// management (one of MEM_Dyn or MEM_Static).
- if xDel == (crt.UintptrFromInt32(-1)) {
+ if xDel == (libc.UintptrFromInt32(-1)) {
var nAlloc U32 = U32(nByte)
if (int32(flags) & 0x0200) != 0 {
nAlloc = nAlloc + (func() uint32 {
@@ -51091,11 +52528,11 @@ func Xsqlite3VdbeMemSetStr(tls *crt.TLS, pMem uintptr, z uintptr, n int32, enc U
}()) != 0 {
return 7
}
- crt.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, z, uint64(nAlloc))
+ libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, z, uint64(nAlloc))
} else {
Xsqlite3VdbeMemRelease(tls, pMem)
(*Mem)(unsafe.Pointer(pMem)).Fz = z
- if xDel == (*(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{Xsqlite3MallocSize}))) {
+ if xDel == (*(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault}))) {
(*Mem)(unsafe.Pointer(pMem)).FzMalloc = (*Mem)(unsafe.Pointer(pMem)).Fz
(*Mem)(unsafe.Pointer(pMem)).FszMalloc = Xsqlite3DbMallocSize(tls, (*Mem)(unsafe.Pointer(pMem)).Fdb, (*Mem)(unsafe.Pointer(pMem)).FzMalloc)
} else {
@@ -51142,13 +52579,13 @@ func Xsqlite3VdbeMemSetStr(tls *crt.TLS, pMem uintptr, z uintptr, n int32, enc U
//
// If this routine fails for any reason (malloc returns NULL or unable
// to read from the disk) then the pMem is left in an inconsistent state.
-func Xsqlite3VdbeMemFromBtree(tls *crt.TLS, pCur uintptr, offset U32, amt U32, pMem uintptr) int32 { /* sqlite3.c:76817:20: */
+func Xsqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pMem uintptr) int32 { /* sqlite3.c:77006:20: */
var rc int32
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(0x0001)
if Xsqlite3BtreeMaxRecordSize(tls, pCur) < (Sqlite3_int64(offset + amt)) {
- return Xsqlite3CorruptError(tls, 76826)
+ return Xsqlite3CorruptError(tls, 77015)
}
- if 0 == (crt.AssignInt32(&rc, Xsqlite3VdbeMemClearAndResize(tls, pMem, (int32(amt+U32(1)))))) {
+ if 0 == (libc.AssignInt32(&rc, Xsqlite3VdbeMemClearAndResize(tls, pMem, (int32(amt+U32(1)))))) {
rc = Xsqlite3BtreePayload(tls, pCur, offset, amt, (*Mem)(unsafe.Pointer(pMem)).Fz)
if rc == 0 {
*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(amt))) = int8(0) // Overrun area used when reading malformed records
@@ -51160,7 +52597,7 @@ func Xsqlite3VdbeMemFromBtree(tls *crt.TLS, pCur uintptr, offset U32, amt U32, p
}
return rc
}
-func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *crt.TLS, pCur uintptr, amt U32, pMem uintptr) int32 { /* sqlite3.c:76840:20: */
+func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *libc.TLS, pCur uintptr, amt U32, pMem uintptr) int32 { /* sqlite3.c:77029:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -51185,7 +52622,7 @@ func Xsqlite3VdbeMemFromBtreeZeroOffset(tls *crt.TLS, pCur uintptr, amt U32, pMe
// The pVal argument is known to be a value other than NULL.
// Convert it into a string with encoding enc and return a pointer
// to a zero-terminated version of that string.
-func valueToText(tls *crt.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:76872:35: */
+func valueToText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:77061:35: */
if (int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & (0x0010 | 0x0002)) != 0 {
if func() int32 {
@@ -51197,8 +52634,8 @@ func valueToText(tls *crt.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:7687
return uintptr(0)
}
*(*U16)(unsafe.Pointer(pVal + 8 /* &.flags */)) |= U16((0x0002))
- if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) != (int32(enc) & ^int32(crt.Int32FromInt32(8))) {
- Xsqlite3VdbeChangeEncoding(tls, pVal, (int32(enc) & ^int32(crt.Int32FromInt32(8))))
+ if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) != (int32(enc) & ^int32(libc.Int32FromInt32(8))) {
+ Xsqlite3VdbeChangeEncoding(tls, pVal, (int32(enc) & ^int32(libc.Int32FromInt32(8))))
}
if ((int32(enc) & 8) != 0) && (1 == (1 & (int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fz)))) {
@@ -51211,7 +52648,7 @@ func valueToText(tls *crt.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:7687
Xsqlite3VdbeMemStringify(tls, pVal, enc, uint8(0))
}
- if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == (int32(enc) & ^int32(crt.Int32FromInt32(8))) {
+ if int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == (int32(enc) & ^int32(libc.Int32FromInt32(8))) {
return (*Sqlite3_value)(unsafe.Pointer(pVal)).Fz
} else {
@@ -51229,7 +52666,7 @@ func valueToText(tls *crt.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:7687
// (2006-02-16:) The enc value can be or-ed with SQLITE_UTF16_ALIGNED.
// If that is the case, then the result must be aligned on an even byte
// boundary.
-func Xsqlite3ValueText(tls *crt.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:76915:27: */
+func Xsqlite3ValueText(tls *libc.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.c:77104:27: */
if !(pVal != 0) {
return uintptr(0)
}
@@ -51245,7 +52682,7 @@ func Xsqlite3ValueText(tls *crt.TLS, pVal uintptr, enc U8) uintptr { /* sqlite3.
}
// Create a new sqlite3_value object.
-func Xsqlite3ValueNew(tls *crt.TLS, db uintptr) uintptr { /* sqlite3.c:76933:30: */
+func Xsqlite3ValueNew(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:77122:30: */
var p uintptr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Mem{})))
if p != 0 {
(*Mem)(unsafe.Pointer(p)).Fflags = U16(0x0001)
@@ -51273,8 +52710,41 @@ type ValueNewStat4Ctx = struct {
// already been allocated, allocate the UnpackedRecord structure that
// that function will return to its caller here. Then return a pointer to
// an sqlite3_value within the UnpackedRecord.a[] array.
-func valueNew(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:76964:22: */
- _ = p
+func valueNew(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:77153:22: */
+ if p != 0 {
+ var pRec uintptr = *(*uintptr)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FppRec + uintptr(0)*8))
+
+ if pRec == uintptr(0) {
+ var pIdx uintptr = (*ValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx // Index being probed
+ var nByte int32 // Bytes of space to allocate
+ var i int32 // Counter variable
+ var nCol int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) // Number of index columns including rowid
+
+ nByte = (int32((uint64(unsafe.Sizeof(Mem{})) * uint64(nCol)) + (((uint64(unsafe.Sizeof(UnpackedRecord{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7)))))
+ pRec = Xsqlite3DbMallocZero(tls, db, uint64(nByte))
+ if pRec != 0 {
+ (*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = Xsqlite3KeyInfoOfIndex(tls, (*ValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx)
+ if (*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 {
+
+ (*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem = (pRec + uintptr((((uint64(unsafe.Sizeof(UnpackedRecord{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7)))))
+ for i = 0; i < nCol; i++ {
+ (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fflags = U16(0x0001)
+ (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr(i)*56)).Fdb = db
+ }
+ } else {
+ Xsqlite3DbFreeNN(tls, db, pRec)
+ pRec = uintptr(0)
+ }
+ }
+ if pRec == uintptr(0) {
+ return uintptr(0)
+ }
+ *(*uintptr)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FppRec + uintptr(0)*8)) = pRec
+ }
+
+ (*UnpackedRecord)(unsafe.Pointer(pRec)).FnField = (U16((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FiVal + 1))
+ return ((*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem + uintptr((*ValueNewStat4Ctx)(unsafe.Pointer(p)).FiVal)*56)
+ }
return Xsqlite3ValueNew(tls, db)
}
@@ -51296,6 +52766,140 @@ func valueNew(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:76964:
// If the conditions above are not met, this function returns SQLITE_OK
// and sets (*ppVal) to NULL. Or, if an error occurs, (*ppVal) is set to
// NULL and an SQLite error code returned.
+func valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc U8, aff U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:77215:12: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ // var ctx Sqlite3_context at bp+8, 56
+ // Context object for function invocation
+ var apVal uintptr // Function arguments
+ var nVal int32 // Size of apVal[] array
+ var pFunc uintptr // Function definition
+ var pVal uintptr // New value
+ var rc int32 // Return code
+ var pList uintptr // Function arguments
+ var i int32
+ apVal = uintptr(0)
+ nVal = 0
+ pFunc = uintptr(0)
+ pVal = uintptr(0)
+ rc = 0
+ pList = uintptr(0) // Iterator variable
+
+ pList = *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */))
+ if !(pList != 0) {
+ goto __1
+ }
+ nVal = (*ExprList)(unsafe.Pointer(pList)).FnExpr
+__1:
+ ;
+ pFunc = Xsqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), nVal, enc, uint8(0))
+
+ if !((((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & (U32(0x0800 | 0x2000))) == U32(0)) ||
+ (((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(0x0020)) != 0)) {
+ goto __2
+ }
+ return 0
+__2:
+ ;
+
+ if !(pList != 0) {
+ goto __3
+ }
+ apVal = Xsqlite3DbMallocZero(tls, db, (uint64(uint64(unsafe.Sizeof(uintptr(0))) * uint64(nVal))))
+ if !(apVal == uintptr(0)) {
+ goto __4
+ }
+ rc = 7
+ goto value_from_function_out
+__4:
+ ;
+ i = 0
+__5:
+ if !(i < nVal) {
+ goto __7
+ }
+ rc = Xsqlite3ValueFromExpr(tls, db, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FpExpr, enc, aff, (apVal + uintptr(i)*8))
+ if !((*(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)) == uintptr(0)) || (rc != 0)) {
+ goto __8
+ }
+ goto value_from_function_out
+__8:
+ ;
+ goto __6
+__6:
+ i++
+ goto __5
+ goto __7
+__7:
+ ;
+__3:
+ ;
+
+ pVal = valueNew(tls, db, pCtx)
+ if !(pVal == uintptr(0)) {
+ goto __9
+ }
+ rc = 7
+ goto value_from_function_out
+__9:
+ ;
+
+ libc.Xmemset(tls, bp+8 /* &ctx */, 0, uint64(unsafe.Sizeof(Sqlite3_context{})))
+ (*Sqlite3_context)(unsafe.Pointer(bp + 8 /* &ctx */)).FpOut = pVal
+ (*Sqlite3_context)(unsafe.Pointer(bp + 8 /* &ctx */)).FpFunc = pFunc
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pFunc + 24 /* &.xSFunc */))))(tls, bp+8 /* &ctx */, nVal, apVal)
+ if !((*Sqlite3_context)(unsafe.Pointer(bp+8 /* &ctx */)).FisError != 0) {
+ goto __10
+ }
+ rc = (*Sqlite3_context)(unsafe.Pointer(bp + 8 /* &ctx */)).FisError
+ Xsqlite3ErrorMsg(tls, (*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, ts+805 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, pVal)))
+ goto __11
+__10:
+ Xsqlite3ValueApplyAffinity(tls, pVal, aff, uint8(1))
+
+ rc = Xsqlite3VdbeChangeEncoding(tls, pVal, int32(enc))
+ if !((rc == 0) && (Xsqlite3VdbeMemTooBig(tls, pVal) != 0)) {
+ goto __12
+ }
+ rc = 18
+ (*Parse)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr++
+__12:
+ ;
+__11:
+ ;
+ (*Parse)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).Frc = rc
+
+value_from_function_out:
+ if !(rc != 0) {
+ goto __13
+ }
+ pVal = uintptr(0)
+__13:
+ ;
+ if !(apVal != 0) {
+ goto __14
+ }
+ i = 0
+__15:
+ if !(i < nVal) {
+ goto __17
+ }
+ Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)))
+ goto __16
+__16:
+ i++
+ goto __15
+ goto __17
+__17:
+ ;
+ Xsqlite3DbFreeNN(tls, db, apVal)
+__14:
+ ;
+
+ *(*uintptr)(unsafe.Pointer(ppVal)) = pVal
+ return rc
+}
// Extract a value from the supplied expression in the manner described
// above sqlite3ValueFromExpr(). Allocate the sqlite3_value object
@@ -51305,7 +52909,7 @@ func valueNew(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:76964:
// has been allocated, it is freed before returning. Or, if pCtx is not
// NULL, it is assumed that the caller will free any allocated object
// in all cases.
-func valueFromExpr(tls *crt.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:77120:12: */
+func valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr, pCtx uintptr) int32 { /* sqlite3.c:77309:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -51321,11 +52925,11 @@ func valueFromExpr(tls *crt.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8,
zVal = uintptr(0)
*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) = uintptr(0)
negInt = 1
- zNeg = ts + 672 /* "" */
+ zNeg = ts + 781 /* "" */
rc = 0
__1:
- if !(((crt.AssignInt32(&op, int32((*Expr)(unsafe.Pointer(pExpr)).Fop))) == 171) || (op == 178)) {
+ if !(((libc.AssignInt32(&op, int32((*Expr)(unsafe.Pointer(pExpr)).Fop))) == 171) || (op == 178)) {
goto __2
}
pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
@@ -51370,7 +52974,7 @@ __4:
pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop)
negInt = -1
- zNeg = ts + 4431 /* "-" */
+ zNeg = ts + 6566 /* "-" */
__6:
;
@@ -51390,14 +52994,14 @@ __9:
Xsqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), (I64(*(*int32)(unsafe.Pointer(pExpr + 8 /* &.u */))) * I64(negInt)))
goto __11
__10:
- zVal = Xsqlite3MPrintf(tls, db, ts+4433 /* "%s%s" */, crt.VaList(bp, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))
+ zVal = Xsqlite3MPrintf(tls, db, ts+6568 /* "%s%s" */, libc.VaList(bp, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))
if !(zVal == uintptr(0)) {
goto __12
}
goto no_mem
__12:
;
- Xsqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), -1, zVal, uint8(1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{Xsqlite3MallocSize})))
+ Xsqlite3ValueSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), -1, zVal, uint8(1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault})))
__11:
;
if !(((op == 152) || (op == 150)) && (int32(affinity) == 0x41)) {
@@ -51414,7 +53018,7 @@ __14:
goto __15
}
- *(*U16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0002))))
+ *(*U16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0002))))
__15:
;
if !(int32(enc) != 1) {
@@ -51444,7 +53048,7 @@ __20:
goto __22
}
*(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) = -(float64((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))
- (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = (U16((int32((*Sqlite3_value)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */))))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0008))
+ (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = (U16((int32((*Sqlite3_value)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */))))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0008))
goto __23
__22:
*(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) = -*(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */))
@@ -51485,21 +53089,29 @@ __29:
nVal = (Xsqlite3Strlen30(tls, zVal) - 1)
Xsqlite3VdbeMemSetStr(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), Xsqlite3HexToBlob(tls, db, zVal, nVal), (nVal / 2),
- uint8(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{Xsqlite3MallocSize})))
+ uint8(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault})))
goto __28
__27:
- if !(op == 167) {
+ if !((op == 169) && (pCtx != uintptr(0))) {
goto __30
}
+ rc = valueFromFunction(tls, db, pExpr, enc, affinity, bp+16 /* &pVal */, pCtx)
+ goto __31
+__30:
+ if !(op == 167) {
+ goto __32
+ }
*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) = valueNew(tls, db, pCtx)
if !(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) != 0) {
- goto __31
+ goto __33
}
(*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))).Fflags = U16(0x0004)
- *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) = (I64(crt.Bool32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + uintptr(4)))) == 0)))
-__31:
+ *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) /* &.u */)) = (I64(libc.Bool32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + uintptr(4)))) == 0)))
+__33:
;
-__30:
+__32:
+ ;
+__31:
;
__28:
;
@@ -51514,10 +53126,20 @@ __8:
return rc
no_mem:
+ if !((pCtx == uintptr(0)) || ((*Parse)(unsafe.Pointer((*ValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse)).FnErr == 0)) {
+ goto __34
+ }
Xsqlite3OomFault(tls, db)
+__34:
+ ;
Xsqlite3DbFree(tls, db, zVal)
+ if !(pCtx == uintptr(0)) {
+ goto __35
+ }
Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))
+__35:
+ ;
return 7
}
@@ -51529,22 +53151,237 @@ no_mem:
// a pointer written to *ppVal. The caller is responsible for deallocating
// the value by passing it to sqlite3ValueFree() later on. If the expression
// cannot be converted to a value, then *ppVal is set to NULL.
-func Xsqlite3ValueFromExpr(tls *crt.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:77275:20: */
+func Xsqlite3ValueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc U8, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:77464:20: */
if pExpr != 0 {
return valueFromExpr(tls, db, pExpr, enc, affinity, ppVal, uintptr(0))
}
return 0
}
+// Attempt to extract a value from pExpr and use it to construct *ppVal.
+//
+// If pAlloc is not NULL, then an UnpackedRecord object is created for
+// pAlloc if one does not exist and the new value is added to the
+// UnpackedRecord object.
+//
+// A value is extracted in the following cases:
+//
+// * (pExpr==0). In this case the value is assumed to be an SQL NULL,
+//
+// * The expression is a bound variable, and this is a reprepare, or
+//
+// * The expression is a literal value.
+//
+// On success, *ppVal is made to point to the extracted value. The caller
+// is responsible for ensuring that the value is eventually freed.
+func stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, pAlloc uintptr, ppVal uintptr) int32 { /* sqlite3.c:77493:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 = 0
+ *(*uintptr)(unsafe.Pointer(bp /* pVal */)) = uintptr(0)
+ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
+
+ // Skip over any TK_COLLATE nodes
+ pExpr = Xsqlite3ExprSkipCollate(tls, pExpr)
+
+ if !(pExpr != 0) {
+ *(*uintptr)(unsafe.Pointer(bp /* pVal */)) = valueNew(tls, db, pAlloc)
+ if *(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0 {
+ Xsqlite3VdbeMemSetNull(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */)))
+ }
+ } else if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 153) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00800000)) == uint64(0)) {
+ var v uintptr
+ var iBindVar int32 = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
+ Xsqlite3VdbeSetVarmask(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iBindVar)
+ if (libc.AssignUintptr(&v, (*Parse)(unsafe.Pointer(pParse)).FpReprepare)) != uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(bp /* pVal */)) = valueNew(tls, db, pAlloc)
+ if *(*uintptr)(unsafe.Pointer(bp /* pVal */)) != 0 {
+ rc = Xsqlite3VdbeMemCopy(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */)), ((*Vdbe)(unsafe.Pointer(v)).FaVar + uintptr((iBindVar-1))*56))
+ Xsqlite3ValueApplyAffinity(tls, *(*uintptr)(unsafe.Pointer(bp /* pVal */)), affinity, (*Sqlite3)(unsafe.Pointer(db)).Fenc)
+ (*Sqlite3_value)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pVal */)))).Fdb = (*Parse)(unsafe.Pointer(pParse)).Fdb
+ }
+ }
+ } else {
+ rc = valueFromExpr(tls, db, pExpr, (*Sqlite3)(unsafe.Pointer(db)).Fenc, affinity, bp /* &pVal */, pAlloc)
+ }
+
+ *(*uintptr)(unsafe.Pointer(ppVal)) = *(*uintptr)(unsafe.Pointer(bp /* pVal */))
+ return rc
+}
+
+// This function is used to allocate and populate UnpackedRecord
+// structures intended to be compared against sample index keys stored
+// in the sqlite_stat4 table.
+//
+// A single call to this function populates zero or more fields of the
+// record starting with field iVal (fields are numbered from left to
+// right starting with 0). A single field is populated if:
+//
+// * (pExpr==0). In this case the value is assumed to be an SQL NULL,
+//
+// * The expression is a bound variable, and this is a reprepare, or
+//
+// * The sqlite3ValueFromExpr() function is able to extract a value
+// from the expression (i.e. the expression is a literal value).
+//
+// Or, if pExpr is a TK_VECTOR, one field is populated for each of the
+// vector components that match either of the two latter criteria listed
+// above.
+//
+// Before any value is appended to the record, the affinity of the
+// corresponding column within index pIdx is applied to it. Before
+// this function returns, output parameter *pnExtract is set to the
+// number of values appended to the record.
+//
+// When this function is called, *ppRec must either point to an object
+// allocated by an earlier call to this function, or must be NULL. If it
+// is NULL and a value can be successfully extracted, a new UnpackedRecord
+// is allocated (and *ppRec set to point to it) before returning.
+//
+// Unless an error is encountered, SQLITE_OK is returned. It is not an
+// error if a value cannot be extracted from pExpr. If an error does
+// occur, an SQLite error code is returned.
+func Xsqlite3Stat4ProbeSetValue(tls *libc.TLS, pParse uintptr, pIdx uintptr, ppRec uintptr, pExpr uintptr, nElem int32, iVal int32, pnExtract uintptr) int32 { /* sqlite3.c:77568:20: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
+
+ var rc int32 = 0
+ var nExtract int32 = 0
+
+ if (pExpr == uintptr(0)) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != 136) {
+ var i int32
+ // var alloc ValueNewStat4Ctx at bp, 32
+
+ (*ValueNewStat4Ctx)(unsafe.Pointer(bp /* &alloc */)).FpParse = pParse
+ (*ValueNewStat4Ctx)(unsafe.Pointer(bp /* &alloc */)).FpIdx = pIdx
+ (*ValueNewStat4Ctx)(unsafe.Pointer(bp /* &alloc */)).FppRec = ppRec
+
+ for i = 0; i < nElem; i++ {
+ *(*uintptr)(unsafe.Pointer(bp + 32 /* pVal */)) = uintptr(0)
+ var pElem uintptr = func() uintptr {
+ if pExpr != 0 {
+ return Xsqlite3VectorFieldSubexpr(tls, pExpr, i)
+ }
+ return uintptr(0)
+ }()
+ var aff U8 = U8(Xsqlite3IndexColumnAffinity(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIdx, (iVal + i)))
+ (*ValueNewStat4Ctx)(unsafe.Pointer(bp /* &alloc */)).FiVal = (iVal + i)
+ rc = stat4ValueFromExpr(tls, pParse, pElem, aff, bp /* &alloc */, bp+32 /* &pVal */)
+ if !(*(*uintptr)(unsafe.Pointer(bp + 32 /* pVal */)) != 0) {
+ break
+ }
+ nExtract++
+ }
+ }
+
+ *(*int32)(unsafe.Pointer(pnExtract)) = nExtract
+ return rc
+}
+
+// Attempt to extract a value from expression pExpr using the methods
+// as described for sqlite3Stat4ProbeSetValue() above.
+//
+// If successful, set *ppVal to point to a new value object and return
+// SQLITE_OK. If no value can be extracted, but no other error occurs
+// (e.g. OOM), return SQLITE_OK and set *ppVal to NULL. Or, if an error
+// does occur, return an SQLite error code. The final value of *ppVal
+// is undefined in this case.
+func Xsqlite3Stat4ValueFromExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr, affinity U8, ppVal uintptr) int32 { /* sqlite3.c:77613:20: */
+ return stat4ValueFromExpr(tls, pParse, pExpr, affinity, uintptr(0), ppVal)
+}
+
+// Extract the iCol-th column from the nRec-byte record in pRec. Write
+// the column value into *ppVal. If *ppVal is initially NULL then a new
+// sqlite3_value object is allocated.
+//
+// If *ppVal is initially NULL then the caller is responsible for
+// ensuring that the value written into *ppVal is eventually freed.
+func Xsqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iCol int32, ppVal uintptr) int32 { /* sqlite3.c:77630:20: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ *(*U32)(unsafe.Pointer(bp + 4 /* t */)) = U32(0) // a column type code
+ // var nHdr int32 at bp, 4
+ // Size of the header in the record
+ var iHdr int32 // Next unread header byte
+ var iField int32 // Next unread data byte
+ var szField int32 = 0 // Size of the current data field
+ var i int32 // Column index
+ var a uintptr = pRec // Typecast byte array
+ var pMem uintptr = *(*uintptr)(unsafe.Pointer(ppVal)) // Write result into this Mem object
+
+ iHdr = int32(func() uint8 {
+ if int32(*(*U8)(unsafe.Pointer(a))) < int32(U8(0x80)) {
+ return uint8(func() int32 {
+ (*(*int32)(unsafe.Pointer(bp /* nHdr */))) = int32(U32(*(*U8)(unsafe.Pointer(a))))
+ return 1
+ }())
+ }
+ return Xsqlite3GetVarint32(tls, a, bp /* &nHdr */)
+ }())
+ if (*(*int32)(unsafe.Pointer(bp /* nHdr */)) > nRec) || (iHdr >= *(*int32)(unsafe.Pointer(bp /* nHdr */))) {
+ return Xsqlite3CorruptError(tls, 77648)
+ }
+ iField = *(*int32)(unsafe.Pointer(bp /* nHdr */))
+ for i = 0; i <= iCol; i++ {
+ iHdr = iHdr + (int32(func() uint8 {
+ if int32(*(*U8)(unsafe.Pointer((a + uintptr(iHdr))))) < int32(U8(0x80)) {
+ return uint8(func() int32 {
+ (*(*U32)(unsafe.Pointer(bp + 4 /* t */))) = U32(*(*U8)(unsafe.Pointer((a + uintptr(iHdr)))))
+ return 1
+ }())
+ }
+ return Xsqlite3GetVarint32(tls, (a + uintptr(iHdr)), bp+4 /* &t */)
+ }()))
+
+ if iHdr > *(*int32)(unsafe.Pointer(bp /* nHdr */)) {
+ return Xsqlite3CorruptError(tls, 77654)
+ }
+ szField = int32(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 4 /* t */))))
+ iField = iField + (szField)
+ }
+
+ if iField > nRec {
+ return Xsqlite3CorruptError(tls, 77660)
+ }
+ if pMem == uintptr(0) {
+ pMem = libc.AssignPtrUintptr(ppVal, Xsqlite3ValueNew(tls, db))
+ if pMem == uintptr(0) {
+ return 7
+ }
+ }
+ Xsqlite3VdbeSerialGet(tls, (a + uintptr((iField - szField))), *(*U32)(unsafe.Pointer(bp + 4 /* t */)), pMem)
+ (*Mem)(unsafe.Pointer(pMem)).Fenc = (*Sqlite3)(unsafe.Pointer(db)).Fenc
+ return 0
+}
+
+// Unless it is NULL, the argument must be an UnpackedRecord object returned
+// by an earlier call to sqlite3Stat4ProbeSetValue(). This call deletes
+// the object.
+func Xsqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { /* sqlite3.c:77675:21: */
+ if pRec != 0 {
+ var i int32
+ var nCol int32 = int32((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo)).FnAllField)
+ var aMem uintptr = (*UnpackedRecord)(unsafe.Pointer(pRec)).FaMem
+ var db uintptr = (*Mem)(unsafe.Pointer(aMem + uintptr(0)*56)).Fdb
+ for i = 0; i < nCol; i++ {
+ Xsqlite3VdbeMemRelease(tls, (aMem + uintptr(i)*56))
+ }
+ Xsqlite3KeyInfoUnref(tls, (*UnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo)
+ Xsqlite3DbFreeNN(tls, db, pRec)
+ }
+}
+
// Change the string value of an sqlite3_value object
-func Xsqlite3ValueSetStr(tls *crt.TLS, v uintptr, n int32, z uintptr, enc U8, xDel uintptr) { /* sqlite3.c:77504:21: */
+func Xsqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc U8, xDel uintptr) { /* sqlite3.c:77693:21: */
if v != 0 {
Xsqlite3VdbeMemSetStr(tls, v, z, n, enc, xDel)
}
}
// Free an sqlite3_value object
-func Xsqlite3ValueFree(tls *crt.TLS, v uintptr) { /* sqlite3.c:77517:21: */
+func Xsqlite3ValueFree(tls *libc.TLS, v uintptr) { /* sqlite3.c:77706:21: */
if !(v != 0) {
return
}
@@ -51555,13 +53392,13 @@ func Xsqlite3ValueFree(tls *crt.TLS, v uintptr) { /* sqlite3.c:77517:21: */
// The sqlite3ValueBytes() routine returns the number of bytes in the
// sqlite3_value object assuming that it uses the encoding "enc".
// The valueBytes() routine is a helper function.
-func valueBytes(tls *crt.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:77528:28: */
+func valueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:77717:28: */
if valueToText(tls, pVal, enc) != uintptr(0) {
return (*Sqlite3_value)(unsafe.Pointer(pVal)).Fn
}
return 0
}
-func Xsqlite3ValueBytes(tls *crt.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:77531:20: */
+func Xsqlite3ValueBytes(tls *libc.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c:77720:20: */
var p uintptr = pVal
if ((int32((*Mem)(unsafe.Pointer(p)).Fflags) & 0x0002) != 0) && (int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fenc) == int32(enc)) {
@@ -51581,14 +53418,14 @@ func Xsqlite3ValueBytes(tls *crt.TLS, pVal uintptr, enc U8) int32 { /* sqlite3.c
}
// Create a new virtual database engine.
-func Xsqlite3VdbeCreate(tls *crt.TLS, pParse uintptr) uintptr { /* sqlite3.c:77574:21: */
+func Xsqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:77763:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var p uintptr
p = Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(Vdbe{})))
if p == uintptr(0) {
return uintptr(0)
}
- crt.Xmemset(tls, (p + 136 /* &.aOp */), 0, (uint64(unsafe.Sizeof(Vdbe{})) - (uint64((uintptr(0) + 136 /* &.aOp */)))))
+ libc.Xmemset(tls, (p + 136 /* &.aOp */), 0, (uint64(unsafe.Sizeof(Vdbe{})) - (uint64((uintptr(0) + 136 /* &.aOp */)))))
(*Vdbe)(unsafe.Pointer(p)).Fdb = db
if (*Sqlite3)(unsafe.Pointer(db)).FpVdbe != 0 {
(*Vdbe1)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FpVdbe)).FpPrev = p
@@ -51605,12 +53442,12 @@ func Xsqlite3VdbeCreate(tls *crt.TLS, pParse uintptr) uintptr { /* sqlite3.c:775
}
// Return the Parse object that owns a Vdbe object.
-func Xsqlite3VdbeParser(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:77601:22: */
+func Xsqlite3VdbeParser(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:77790:22: */
return (*Vdbe)(unsafe.Pointer(p)).FpParse
}
// Change the error string stored in Vdbe.zErrMsg
-func Xsqlite3VdbeError(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:77608:21: */
+func Xsqlite3VdbeError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:77797:21: */
var ap Va_list
_ = ap
Xsqlite3DbFree(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
@@ -51620,7 +53457,7 @@ func Xsqlite3VdbeError(tls *crt.TLS, p uintptr, zFormat uintptr, va uintptr) { /
}
// Remember the SQL string for a prepared statement.
-func Xsqlite3VdbeSetSql(tls *crt.TLS, p uintptr, z uintptr, n int32, prepFlags U8) { /* sqlite3.c:77619:21: */
+func Xsqlite3VdbeSetSql(tls *libc.TLS, p uintptr, z uintptr, n int32, prepFlags U8) { /* sqlite3.c:77808:21: */
if p == uintptr(0) {
return
}
@@ -51633,7 +53470,7 @@ func Xsqlite3VdbeSetSql(tls *crt.TLS, p uintptr, z uintptr, n int32, prepFlags U
}
// Swap all content between two VDBE structures.
-func Xsqlite3VdbeSwap(tls *crt.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:77669:21: */
+func Xsqlite3VdbeSwap(tls *libc.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:77858:21: */
var tmp Vdbe
var pTmp uintptr
var zTmp uintptr
@@ -51652,7 +53489,7 @@ func Xsqlite3VdbeSwap(tls *crt.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:77669
(*Vdbe)(unsafe.Pointer(pB)).FzSql = zTmp
(*Vdbe)(unsafe.Pointer(pB)).Fexpmask = (*Vdbe)(unsafe.Pointer(pA)).Fexpmask
(*Vdbe)(unsafe.Pointer(pB)).FprepFlags = (*Vdbe)(unsafe.Pointer(pA)).FprepFlags
- crt.Xmemcpy(tls, pB+212 /* &.aCounter */, pA+212 /* &.aCounter */, uint64(unsafe.Sizeof([7]U32{})))
+ libc.Xmemcpy(tls, pB+212 /* &.aCounter */, pA+212 /* &.aCounter */, uint64(unsafe.Sizeof([7]U32{})))
*(*U32)(unsafe.Pointer((pB + 212 /* &.aCounter */) + uintptr(5)*4))++
}
@@ -51664,7 +53501,7 @@ func Xsqlite3VdbeSwap(tls *crt.TLS, pA uintptr, pB uintptr) { /* sqlite3.c:77669
// SQLITE_NOMEM. In this case Vdbe.aOp and Vdbe.nOpAlloc remain
// unchanged (this is so that any opcodes already allocated can be
// correctly deallocated along with the rest of the Vdbe).
-func growOpArray(tls *crt.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:77706:12: */
+func growOpArray(tls *libc.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:77895:12: */
var pNew uintptr
var p uintptr = (*Vdbe)(unsafe.Pointer(v)).FpParse
@@ -51717,7 +53554,7 @@ func growOpArray(tls *crt.TLS, v uintptr, nOp int32) int32 { /* sqlite3.c:77706:
// Use the sqlite3VdbeResolveLabel() function to fix an address and
// the sqlite3VdbeChangeP4() function to change the value of the P4
// operand.
-func growOp3(tls *crt.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:77777:28: */
+func growOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:77966:28: */
if growOpArray(tls, p, 1) != 0 {
return 1
@@ -51725,7 +53562,7 @@ func growOp3(tls *crt.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) in
return Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3)
}
-func Xsqlite3VdbeAddOp3(tls *crt.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:77783:20: */
+func Xsqlite3VdbeAddOp3(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32) int32 { /* sqlite3.c:77972:20: */
var i int32
var pOp uintptr
@@ -51735,7 +53572,7 @@ func Xsqlite3VdbeAddOp3(tls *crt.TLS, p uintptr, op int32, p1 int32, p2 int32, p
return growOp3(tls, p, op, p1, p2, p3)
}
(*Vdbe)(unsafe.Pointer(p)).FnOp++
- pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(i)*24)
+ pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(i)*32)
(*VdbeOp)(unsafe.Pointer(pOp)).Fopcode = U8(op)
(*VdbeOp)(unsafe.Pointer(pOp)).Fp5 = U16(0)
(*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = p1
@@ -51743,26 +53580,27 @@ func Xsqlite3VdbeAddOp3(tls *crt.TLS, p uintptr, op int32, p1 int32, p2 int32, p
(*VdbeOp)(unsafe.Pointer(pOp)).Fp3 = p3
*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0)
(*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(0)
+ (*VdbeOp)(unsafe.Pointer(pOp)).FzComment = uintptr(0)
return i
}
-func Xsqlite3VdbeAddOp0(tls *crt.TLS, p uintptr, op int32) int32 { /* sqlite3.c:77820:20: */
+func Xsqlite3VdbeAddOp0(tls *libc.TLS, p uintptr, op int32) int32 { /* sqlite3.c:78009:20: */
return Xsqlite3VdbeAddOp3(tls, p, op, 0, 0, 0)
}
-func Xsqlite3VdbeAddOp1(tls *crt.TLS, p uintptr, op int32, p1 int32) int32 { /* sqlite3.c:77823:20: */
+func Xsqlite3VdbeAddOp1(tls *libc.TLS, p uintptr, op int32, p1 int32) int32 { /* sqlite3.c:78012:20: */
return Xsqlite3VdbeAddOp3(tls, p, op, p1, 0, 0)
}
-func Xsqlite3VdbeAddOp2(tls *crt.TLS, p uintptr, op int32, p1 int32, p2 int32) int32 { /* sqlite3.c:77826:20: */
+func Xsqlite3VdbeAddOp2(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32) int32 { /* sqlite3.c:78015:20: */
return Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, 0)
}
// Generate code for an unconditional jump to instruction iDest
-func Xsqlite3VdbeGoto(tls *crt.TLS, p uintptr, iDest int32) int32 { /* sqlite3.c:77832:20: */
+func Xsqlite3VdbeGoto(tls *libc.TLS, p uintptr, iDest int32) int32 { /* sqlite3.c:78021:20: */
return Xsqlite3VdbeAddOp3(tls, p, 11, 0, iDest, 0)
}
// Generate code to cause the string zStr to be loaded into
// register iDest
-func Xsqlite3VdbeLoadString(tls *crt.TLS, p uintptr, iDest int32, zStr uintptr) int32 { /* sqlite3.c:77839:20: */
+func Xsqlite3VdbeLoadString(tls *libc.TLS, p uintptr, iDest int32, zStr uintptr) int32 { /* sqlite3.c:78028:20: */
return Xsqlite3VdbeAddOp4(tls, p, 115, 0, iDest, 0, zStr, 0)
}
@@ -51775,7 +53613,7 @@ func Xsqlite3VdbeLoadString(tls *crt.TLS, p uintptr, iDest int32, zStr uintptr)
//
// If the input string does not end with "X" then an OP_ResultRow instruction
// is generated for the values inserted.
-func Xsqlite3VdbeMultiLoad(tls *crt.TLS, p uintptr, iDest int32, zTypes uintptr, va uintptr) { /* sqlite3.c:77854:21: */
+func Xsqlite3VdbeMultiLoad(tls *libc.TLS, p uintptr, iDest int32, zTypes uintptr, va uintptr) { /* sqlite3.c:78043:21: */
var ap Va_list
_ = ap
var i int32
@@ -51784,13 +53622,13 @@ func Xsqlite3VdbeMultiLoad(tls *crt.TLS, p uintptr, iDest int32, zTypes uintptr,
ap = va
i = 0
__1:
- if !((int32(crt.AssignInt8(&c, *(*int8)(unsafe.Pointer(zTypes + uintptr(i)))))) != 0) {
+ if !((int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(zTypes + uintptr(i)))))) != 0) {
goto __3
}
if !(int32(c) == 's') {
goto __4
}
- z = crt.VaUintptr(&ap)
+ z = libc.VaUintptr(&ap)
Xsqlite3VdbeAddOp4(tls, p, func() int32 {
if z == uintptr(0) {
return 72
@@ -51802,7 +53640,7 @@ __4:
if !(int32(c) == 'i') {
goto __6
}
- Xsqlite3VdbeAddOp2(tls, p, 69, int32(crt.VaInt32(&ap)), (iDest + i))
+ Xsqlite3VdbeAddOp2(tls, p, 69, int32(libc.VaInt32(&ap)), (iDest + i))
goto __7
__6:
goto skip_op_resultrow
@@ -51823,7 +53661,7 @@ skip_op_resultrow:
}
// Add an opcode that includes the p4 value as a pointer.
-func Xsqlite3VdbeAddOp4(tls *crt.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:77877:20: */
+func Xsqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:78066:20: */
var addr int32 = Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3)
Xsqlite3VdbeChangeP4(tls, p, addr, zP4, p4type)
return addr
@@ -51837,7 +53675,7 @@ func Xsqlite3VdbeAddOp4(tls *crt.TLS, p uintptr, op int32, p1 int32, p2 int32, p
// NC_IdxExpr means called as part of an index expression. NC_PartIdx
// means in the WHERE clause of a partial index. NC_GenCol means called
// while computing a generated column value. 0 is the usual case.
-func Xsqlite3VdbeAddFunctionCall(tls *crt.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) int32 { /* sqlite3.c:77901:20: */
+func Xsqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) int32 { /* sqlite3.c:78090:20: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var nByte int32
var addr int32
@@ -51869,17 +53707,17 @@ func Xsqlite3VdbeAddFunctionCall(tls *crt.TLS, pParse uintptr, p1 int32, p2 int3
// Add an opcode that includes the p4 value with a P4_INT64 or
// P4_REAL type.
-func Xsqlite3VdbeAddOp4Dup8(tls *crt.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:77938:20: */
+func Xsqlite3VdbeAddOp4Dup8(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, zP4 uintptr, p4type int32) int32 { /* sqlite3.c:78127:20: */
var p4copy uintptr = Xsqlite3DbMallocRawNN(tls, Xsqlite3VdbeDb(tls, p), uint64(8))
if p4copy != 0 {
- crt.Xmemcpy(tls, p4copy, zP4, uint64(8))
+ libc.Xmemcpy(tls, p4copy, zP4, uint64(8))
}
return Xsqlite3VdbeAddOp4(tls, p, op, p1, p2, p3, p4copy, p4type)
}
// Return the address of the current EXPLAIN QUERY PLAN baseline.
// 0 means "none".
-func Xsqlite3VdbeExplainParent(tls *crt.TLS, pParse uintptr) int32 { /* sqlite3.c:77957:20: */
+func Xsqlite3VdbeExplainParent(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:78146:20: */
var pOp uintptr
if (*Parse)(unsafe.Pointer(pParse)).FaddrExplain == 0 {
return 0
@@ -51895,7 +53733,7 @@ func Xsqlite3VdbeExplainParent(tls *crt.TLS, pParse uintptr) int32 { /* sqlite3.
//
// If the bPush flag is true, then make this opcode the parent for
// subsequent Explains until sqlite3VdbeExplainPop() is called.
-func Xsqlite3VdbeExplain(tls *crt.TLS, pParse uintptr, bPush U8, zFmt uintptr, va uintptr) { /* sqlite3.c:77981:21: */
+func Xsqlite3VdbeExplain(tls *libc.TLS, pParse uintptr, bPush U8, zFmt uintptr, va uintptr) { /* sqlite3.c:78170:21: */
// Always include the OP_Explain opcodes if SQLITE_DEBUG is defined.
// But omit them (for performance) during production builds
if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 {
@@ -51919,7 +53757,7 @@ func Xsqlite3VdbeExplain(tls *crt.TLS, pParse uintptr, bPush U8, zFmt uintptr, v
}
// Pop the EXPLAIN QUERY PLAN stack one level.
-func Xsqlite3VdbeExplainPop(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:78009:21: */
+func Xsqlite3VdbeExplainPop(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:78198:21: */
(*Parse)(unsafe.Pointer(pParse)).FaddrExplain = Xsqlite3VdbeExplainParent(tls, pParse)
}
@@ -51930,7 +53768,7 @@ func Xsqlite3VdbeExplainPop(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:78009:2
//
// The zWhere string must have been obtained from sqlite3_malloc().
// This routine will take ownership of the allocated memory.
-func Xsqlite3VdbeAddParseSchemaOp(tls *crt.TLS, p uintptr, iDb int32, zWhere uintptr) { /* sqlite3.c:78023:21: */
+func Xsqlite3VdbeAddParseSchemaOp(tls *libc.TLS, p uintptr, iDb int32, zWhere uintptr) { /* sqlite3.c:78212:21: */
var j int32
Xsqlite3VdbeAddOp4(tls, p, 141, iDb, 0, 0, zWhere, -7)
for j = 0; j < (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FnDb; j++ {
@@ -51939,10 +53777,10 @@ func Xsqlite3VdbeAddParseSchemaOp(tls *crt.TLS, p uintptr, iDb int32, zWhere uin
}
// Add an opcode that includes the p4 value as an integer.
-func Xsqlite3VdbeAddOp4Int(tls *crt.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, p4 int32) int32 { /* sqlite3.c:78032:20: */
+func Xsqlite3VdbeAddOp4Int(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, p3 int32, p4 int32) int32 { /* sqlite3.c:78221:20: */
var addr int32 = Xsqlite3VdbeAddOp3(tls, p, op, p1, p2, p3)
if int32((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed) == 0 {
- var pOp uintptr = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*24)
+ var pOp uintptr = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*32)
(*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-3)
*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = p4
}
@@ -51950,7 +53788,7 @@ func Xsqlite3VdbeAddOp4Int(tls *crt.TLS, p uintptr, op int32, p1 int32, p2 int32
}
// Insert the end of a co-routine
-func Xsqlite3VdbeEndCoroutine(tls *crt.TLS, v uintptr, regYield int32) { /* sqlite3.c:78051:21: */
+func Xsqlite3VdbeEndCoroutine(tls *libc.TLS, v uintptr, regYield int32) { /* sqlite3.c:78240:21: */
Xsqlite3VdbeAddOp1(tls, v, 66, regYield)
// Clear the temporary register cache, thereby ensuring that each
@@ -51985,14 +53823,14 @@ func Xsqlite3VdbeEndCoroutine(tls *crt.TLS, v uintptr, regYield int32) { /* sqli
// been issued. The negative is stored because
// that gives a performance improvement over storing
// the equivalent positive value.
-func Xsqlite3VdbeMakeLabel(tls *crt.TLS, pParse uintptr) int32 { /* sqlite3.c:78089:20: */
- return crt.PreDecInt32(&(*Parse)(unsafe.Pointer(pParse)).FnLabel, 1)
+func Xsqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:78278:20: */
+ return libc.PreDecInt32(&(*Parse)(unsafe.Pointer(pParse)).FnLabel, 1)
}
// Resolve label "x" to be the address of the next instruction to
// be inserted. The parameter "x" must have been obtained from
// a prior call to sqlite3VdbeMakeLabel().
-func resizeResolveLabel(tls *crt.TLS, p uintptr, v uintptr, j int32) { /* sqlite3.c:78098:29: */
+func resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { /* sqlite3.c:78287:29: */
var nNewSize int32 = (10 - (*Parse)(unsafe.Pointer(p)).FnLabel)
(*Parse)(unsafe.Pointer(p)).FaLabel = Xsqlite3DbReallocOrFree(tls, (*Parse)(unsafe.Pointer(p)).Fdb, (*Parse)(unsafe.Pointer(p)).FaLabel,
(uint64(uint64(nNewSize) * uint64(unsafe.Sizeof(int32(0))))))
@@ -52003,7 +53841,7 @@ func resizeResolveLabel(tls *crt.TLS, p uintptr, v uintptr, j int32) { /* sqlite
*(*int32)(unsafe.Pointer((*Parse)(unsafe.Pointer(p)).FaLabel + uintptr(j)*4)) = (*Vdbe)(unsafe.Pointer(v)).FnOp
}
}
-func Xsqlite3VdbeResolveLabel(tls *crt.TLS, v uintptr, x int32) { /* sqlite3.c:78113:21: */
+func Xsqlite3VdbeResolveLabel(tls *libc.TLS, v uintptr, x int32) { /* sqlite3.c:78302:21: */
var p uintptr = (*Vdbe)(unsafe.Pointer(v)).FpParse
var j int32 = ^x
@@ -52016,13 +53854,13 @@ func Xsqlite3VdbeResolveLabel(tls *crt.TLS, v uintptr, x int32) { /* sqlite3.c:7
}
// Mark the VDBE as one that can only be run one time.
-func Xsqlite3VdbeRunOnlyOnce(tls *crt.TLS, p uintptr) { /* sqlite3.c:78135:21: */
- crt.SetBitFieldPtr16Uint32(p+200 /* &.runOnlyOnce */, Bft(1), 5, 0x20)
+func Xsqlite3VdbeRunOnlyOnce(tls *libc.TLS, p uintptr) { /* sqlite3.c:78324:21: */
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.runOnlyOnce */, Bft(1), 5, 0x20)
}
// Mark the VDBE as one that can only be run multiple times.
-func Xsqlite3VdbeReusable(tls *crt.TLS, p uintptr) { /* sqlite3.c:78142:21: */
- crt.SetBitFieldPtr16Uint32(p+200 /* &.runOnlyOnce */, Bft(0), 5, 0x20)
+func Xsqlite3VdbeReusable(tls *libc.TLS, p uintptr) { /* sqlite3.c:78331:21: */
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.runOnlyOnce */, Bft(0), 5, 0x20)
}
// This routine is called after all opcodes have been inserted. It loops
@@ -52044,14 +53882,14 @@ func Xsqlite3VdbeReusable(tls *crt.TLS, p uintptr) { /* sqlite3.c:78142:21: */
// This routine will only function correctly if the mkopcodeh.tcl generator
// script numbers the opcodes correctly. Changes to this routine must be
// coordinated with changes to mkopcodeh.tcl.
-func resolveP2Values(tls *crt.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3.c:78338:13: */
+func resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3.c:78527:13: */
var nMaxArgs int32 = *(*int32)(unsafe.Pointer(pMaxFuncArgs))
var pOp uintptr
var pParse uintptr = (*Vdbe)(unsafe.Pointer(p)).FpParse
var aLabel uintptr = (*Parse)(unsafe.Pointer(pParse)).FaLabel
- crt.SetBitFieldPtr16Uint32(p+200 /* &.readOnly */, Bft(1), 7, 0x80)
- crt.SetBitFieldPtr16Uint32(p+200 /* &.bIsReader */, Bft(0), 8, 0x100)
- pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*24)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.readOnly */, Bft(1), 7, 0x80)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.bIsReader */, Bft(0), 8, 0x100)
+ pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*32)
for 1 != 0 {
// Only JUMP opcodes and the short list of special opcodes in the switch
@@ -52066,16 +53904,16 @@ func resolveP2Values(tls *crt.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3
case 2:
{
if (*Op)(unsafe.Pointer(pOp)).Fp2 != 0 {
- crt.SetBitFieldPtr16Uint32(p+200 /* &.readOnly */, Bft(0), 7, 0x80)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.readOnly */, Bft(0), 7, 0x80)
}
- // fall thru
+ /* no break */
}
fallthrough
case 1:
fallthrough
case 0:
{
- crt.SetBitFieldPtr16Uint32(p+200 /* &.bIsReader */, Bft(1), 8, 0x100)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.bIsReader */, Bft(1), 8, 0x100)
break
}
fallthrough
@@ -52085,8 +53923,8 @@ func resolveP2Values(tls *crt.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3
fallthrough
case 7:
{
- crt.SetBitFieldPtr16Uint32(p+200 /* &.readOnly */, Bft(0), 7, 0x80)
- crt.SetBitFieldPtr16Uint32(p+200 /* &.bIsReader */, Bft(1), 8, 0x100)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.readOnly */, Bft(0), 7, 0x80)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.bIsReader */, Bft(1), 8, 0x100)
break
}
fallthrough
@@ -52095,7 +53933,7 @@ func resolveP2Values(tls *crt.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3
case 3:
{
*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{Xsqlite3BtreeNext}))
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-5)
// The code generator never codes any of these opcodes as a jump
@@ -52108,7 +53946,7 @@ func resolveP2Values(tls *crt.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3
case 4:
{
*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{Xsqlite3BtreePrevious}))
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-5)
// The code generator never codes any of these opcodes as a jump
@@ -52130,11 +53968,12 @@ func resolveP2Values(tls *crt.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3
{
var n int32
- n = (*Op)(unsafe.Pointer(pOp + crt.UintptrFromInt32(-1)*24)).Fp1
+ n = (*Op)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*32)).Fp1
if n > nMaxArgs {
nMaxArgs = n
}
// Fall through into the default case
+ /* no break */
}
fallthrough
default:
@@ -52156,7 +53995,7 @@ func resolveP2Values(tls *crt.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3
if pOp == (*Vdbe)(unsafe.Pointer(p)).FaOp {
break
}
- pOp -= 24
+ pOp -= 32
}
Xsqlite3DbFree(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, (*Parse)(unsafe.Pointer(pParse)).FaLabel)
(*Parse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0)
@@ -52166,7 +54005,7 @@ func resolveP2Values(tls *crt.TLS, p uintptr, pMaxFuncArgs uintptr) { /* sqlite3
}
// Return the address of the next instruction to be inserted.
-func Xsqlite3VdbeCurrentAddr(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:78439:20: */
+func Xsqlite3VdbeCurrentAddr(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:78629:20: */
return (*Vdbe)(unsafe.Pointer(p)).FnOp
}
@@ -52197,7 +54036,7 @@ func Xsqlite3VdbeCurrentAddr(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:78439
// array. Also, *pnMaxArg is set to the larger of its current value and
// the number of entries in the Vdbe.apArg[] array required to execute the
// returned program.
-func Xsqlite3VdbeTakeOpArray(tls *crt.TLS, p uintptr, pnOp uintptr, pnMaxArg uintptr) uintptr { /* sqlite3.c:78496:23: */
+func Xsqlite3VdbeTakeOpArray(tls *libc.TLS, p uintptr, pnOp uintptr, pnMaxArg uintptr) uintptr { /* sqlite3.c:78686:23: */
var aOp uintptr = (*Vdbe)(unsafe.Pointer(p)).FaOp
// Check that sqlite3VdbeUsesBtree() was not called on this VM
@@ -52213,7 +54052,7 @@ func Xsqlite3VdbeTakeOpArray(tls *crt.TLS, p uintptr, pnOp uintptr, pnMaxArg uin
//
// Non-zero P2 arguments to jump instructions are automatically adjusted
// so that the jump target is relative to the first operation inserted.
-func Xsqlite3VdbeAddOpList(tls *crt.TLS, p uintptr, nOp int32, aOp uintptr, iLineno int32) uintptr { /* sqlite3.c:78516:23: */
+func Xsqlite3VdbeAddOpList(tls *libc.TLS, p uintptr, nOp int32, aOp uintptr, iLineno int32) uintptr { /* sqlite3.c:78706:23: */
var i int32
var pOut uintptr
var pFirst uintptr
@@ -52221,7 +54060,7 @@ func Xsqlite3VdbeAddOpList(tls *crt.TLS, p uintptr, nOp int32, aOp uintptr, iLin
if (((*Vdbe)(unsafe.Pointer(p)).FnOp + nOp) > (*Vdbe)(unsafe.Pointer(p)).FnOpAlloc) && (growOpArray(tls, p, nOp) != 0) {
return uintptr(0)
}
- pFirst = crt.AssignUintptr(&pOut, ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp)*24))
+ pFirst = libc.AssignUintptr(&pOut, ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr((*Vdbe)(unsafe.Pointer(p)).FnOp)*32))
i = 0
__1:
if !(i < nOp) {
@@ -52239,13 +54078,14 @@ __1:
(*VdbeOp)(unsafe.Pointer(pOut)).Fp4type = int8(0)
*(*uintptr)(unsafe.Pointer(pOut + 16 /* &.p4 */)) = uintptr(0)
(*VdbeOp)(unsafe.Pointer(pOut)).Fp5 = U16(0)
+ (*VdbeOp)(unsafe.Pointer(pOut)).FzComment = uintptr(0)
_ = iLineno
}
goto __2
__2:
i++
aOp += 4
- pOut += 24
+ pOut += 32
goto __1
goto __3
__3:
@@ -52256,28 +54096,28 @@ __3:
// Change the value of the opcode, or P1, P2, P3, or P5 operands
// for a specific instruction.
-func Xsqlite3VdbeChangeOpcode(tls *crt.TLS, p uintptr, addr int32, iNewOpcode U8) { /* sqlite3.c:78592:21: */
+func Xsqlite3VdbeChangeOpcode(tls *libc.TLS, p uintptr, addr int32, iNewOpcode U8) { /* sqlite3.c:78782:21: */
(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fopcode = iNewOpcode
}
-func Xsqlite3VdbeChangeP1(tls *crt.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:78595:21: */
+func Xsqlite3VdbeChangeP1(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:78785:21: */
(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp1 = val
}
-func Xsqlite3VdbeChangeP2(tls *crt.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:78598:21: */
+func Xsqlite3VdbeChangeP2(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:78788:21: */
(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp2 = val
}
-func Xsqlite3VdbeChangeP3(tls *crt.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:78601:21: */
+func Xsqlite3VdbeChangeP3(tls *libc.TLS, p uintptr, addr int32, val int32) { /* sqlite3.c:78791:21: */
(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, p, addr))).Fp3 = val
}
-func Xsqlite3VdbeChangeP5(tls *crt.TLS, p uintptr, p5 U16) { /* sqlite3.c:78604:21: */
+func Xsqlite3VdbeChangeP5(tls *libc.TLS, p uintptr, p5 U16) { /* sqlite3.c:78794:21: */
if (*Vdbe)(unsafe.Pointer(p)).FnOp > 0 {
- (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*24)).Fp5 = p5
+ (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*32)).Fp5 = p5
}
}
// Change the P2 operand of instruction addr so that it points to
// the address of the next instruction to be coded.
-func Xsqlite3VdbeJumpHere(tls *crt.TLS, p uintptr, addr int32) { /* sqlite3.c:78613:21: */
+func Xsqlite3VdbeJumpHere(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:78803:21: */
Xsqlite3VdbeChangeP2(tls, p, addr, (*Vdbe)(unsafe.Pointer(p)).FnOp)
}
@@ -52292,7 +54132,7 @@ func Xsqlite3VdbeJumpHere(tls *crt.TLS, p uintptr, addr int32) { /* sqlite3.c:78
//
// 7 Once 0 8 0
// 8 ...
-func Xsqlite3VdbeJumpHereOrPopInst(tls *crt.TLS, p uintptr, addr int32) { /* sqlite3.c:78630:21: */
+func Xsqlite3VdbeJumpHereOrPopInst(tls *libc.TLS, p uintptr, addr int32) { /* sqlite3.c:78820:21: */
if addr == ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1) {
(*Vdbe)(unsafe.Pointer(p)).FnOp--
@@ -52303,24 +54143,24 @@ func Xsqlite3VdbeJumpHereOrPopInst(tls *crt.TLS, p uintptr, addr int32) { /* sql
// If the input FuncDef structure is ephemeral, then free it. If
// the FuncDef is not ephermal, then do nothing.
-func freeEphemeralFunction(tls *crt.TLS, db uintptr, pDef uintptr) { /* sqlite3.c:78650:13: */
+func freeEphemeralFunction(tls *libc.TLS, db uintptr, pDef uintptr) { /* sqlite3.c:78840:13: */
if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(0x0010)) != U32(0) {
Xsqlite3DbFreeNN(tls, db, pDef)
}
}
// Delete a P4 value if necessary.
-func freeP4Mem(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:78659:29: */
+func freeP4Mem(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:78849:29: */
if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
Xsqlite3DbFree(tls, db, (*Mem)(unsafe.Pointer(p)).FzMalloc)
}
Xsqlite3DbFreeNN(tls, db, p)
}
-func freeP4FuncCtx(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:78663:29: */
+func freeP4FuncCtx(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:78853:29: */
freeEphemeralFunction(tls, db, (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc)
Xsqlite3DbFreeNN(tls, db, p)
}
-func freeP4(tls *crt.TLS, db uintptr, p4type int32, p4 uintptr) { /* sqlite3.c:78667:13: */
+func freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { /* sqlite3.c:78857:13: */
switch p4type {
case -16:
@@ -52375,13 +54215,14 @@ func freeP4(tls *crt.TLS, db uintptr, p4type int32, p4 uintptr) { /* sqlite3.c:7
// Free the space allocated for aOp and any p4 values allocated for the
// opcodes contained within. If aOp is not NULL it is assumed to contain
// nOp entries.
-func vdbeFreeOpArray(tls *crt.TLS, db uintptr, aOp uintptr, nOp int32) { /* sqlite3.c:78716:13: */
+func vdbeFreeOpArray(tls *libc.TLS, db uintptr, aOp uintptr, nOp int32) { /* sqlite3.c:78906:13: */
if aOp != 0 {
var pOp uintptr
- for pOp = (aOp + uintptr((nOp-1))*24); pOp >= aOp; pOp -= 24 {
+ for pOp = (aOp + uintptr((nOp-1))*32); pOp >= aOp; pOp -= 32 {
if int32((*Op)(unsafe.Pointer(pOp)).Fp4type) <= (-7) {
freeP4(tls, db, int32((*Op)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
}
+ Xsqlite3DbFree(tls, db, (*Op)(unsafe.Pointer(pOp)).FzComment)
}
Xsqlite3DbFreeNN(tls, db, aOp)
}
@@ -52390,24 +54231,24 @@ func vdbeFreeOpArray(tls *crt.TLS, db uintptr, aOp uintptr, nOp int32) { /* sqli
// Link the SubProgram object passed as the second argument into the linked
// list at Vdbe.pSubProgram. This list is used to delete all sub-program
// objects when the VM is no longer required.
-func Xsqlite3VdbeLinkSubProgram(tls *crt.TLS, pVdbe uintptr, p uintptr) { /* sqlite3.c:78734:21: */
+func Xsqlite3VdbeLinkSubProgram(tls *libc.TLS, pVdbe uintptr, p uintptr) { /* sqlite3.c:78924:21: */
(*SubProgram)(unsafe.Pointer(p)).FpNext = (*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram
(*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram = p
}
// Return true if the given Vdbe has any SubPrograms.
-func Xsqlite3VdbeHasSubProgram(tls *crt.TLS, pVdbe uintptr) int32 { /* sqlite3.c:78742:20: */
- return (crt.Bool32((*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram != uintptr(0)))
+func Xsqlite3VdbeHasSubProgram(tls *libc.TLS, pVdbe uintptr) int32 { /* sqlite3.c:78932:20: */
+ return (libc.Bool32((*Vdbe)(unsafe.Pointer(pVdbe)).FpProgram != uintptr(0)))
}
// Change the opcode at addr into OP_Noop
-func Xsqlite3VdbeChangeToNoop(tls *crt.TLS, p uintptr, addr int32) int32 { /* sqlite3.c:78749:20: */
+func Xsqlite3VdbeChangeToNoop(tls *libc.TLS, p uintptr, addr int32) int32 { /* sqlite3.c:78939:20: */
var pOp uintptr
if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 {
return 0
}
- pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*24)
+ pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*32)
freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
(*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(0)
*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0)
@@ -52417,8 +54258,8 @@ func Xsqlite3VdbeChangeToNoop(tls *crt.TLS, p uintptr, addr int32) int32 { /* sq
// If the last opcode is "op" and it is not a jump destination,
// then remove it. Return true if and only if an opcode was removed.
-func Xsqlite3VdbeDeletePriorOpcode(tls *crt.TLS, p uintptr, op U8) int32 { /* sqlite3.c:78765:20: */
- if ((*Vdbe)(unsafe.Pointer(p)).FnOp > 0) && (int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*24)).Fopcode) == int32(op)) {
+func Xsqlite3VdbeDeletePriorOpcode(tls *libc.TLS, p uintptr, op U8) int32 { /* sqlite3.c:78955:20: */
+ if ((*Vdbe)(unsafe.Pointer(p)).FnOp > 0) && (int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*32)).Fopcode) == int32(op)) {
return Xsqlite3VdbeChangeToNoop(tls, p, ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1))
} else {
return 0
@@ -52441,14 +54282,14 @@ func Xsqlite3VdbeDeletePriorOpcode(tls *crt.TLS, p uintptr, op U8) int32 { /* sq
// the Vdbe. In these cases we can just copy the pointer.
//
// If addr<0 then change P4 on the most recently inserted instruction.
-func vdbeChangeP4Full(tls *crt.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int32) { /* sqlite3.c:78825:29: */
+func vdbeChangeP4Full(tls *libc.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int32) { /* sqlite3.c:79015:29: */
if (*Op)(unsafe.Pointer(pOp)).Fp4type != 0 {
freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, int32((*Op)(unsafe.Pointer(pOp)).Fp4type), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(0)
*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = uintptr(0)
}
if n < 0 {
- Xsqlite3VdbeChangeP4(tls, p, (int32((int64(pOp) - int64((*Vdbe)(unsafe.Pointer(p)).FaOp)) / 24)), zP4, n)
+ Xsqlite3VdbeChangeP4(tls, p, (int32((int64(pOp) - int64((*Vdbe)(unsafe.Pointer(p)).FaOp)) / 32)), zP4, n)
} else {
if n == 0 {
n = Xsqlite3Strlen30(tls, zP4)
@@ -52457,7 +54298,7 @@ func vdbeChangeP4Full(tls *crt.TLS, p uintptr, pOp uintptr, zP4 uintptr, n int32
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-7)
}
}
-func Xsqlite3VdbeChangeP4(tls *crt.TLS, p uintptr, addr int32, zP4 uintptr, n int32) { /* sqlite3.c:78844:21: */
+func Xsqlite3VdbeChangeP4(tls *libc.TLS, p uintptr, addr int32, zP4 uintptr, n int32) { /* sqlite3.c:79034:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = zP4
@@ -52477,7 +54318,7 @@ func Xsqlite3VdbeChangeP4(tls *crt.TLS, p uintptr, addr int32, zP4 uintptr, n in
if addr < 0 {
addr = ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1)
}
- pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*24)
+ pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*32)
if (n >= 0) || ((*Op)(unsafe.Pointer(pOp)).Fp4type != 0) {
vdbeChangeP4Full(tls, p, pOp, *(*uintptr)(unsafe.Pointer(bp /* zP4 */)), n)
return
@@ -52504,14 +54345,14 @@ func Xsqlite3VdbeChangeP4(tls *crt.TLS, p uintptr, addr int32, zP4 uintptr, n in
// The P4 operand must not have been previously defined. And the new
// P4 must not be P4_INT32. Use sqlite3VdbeChangeP4() in either of
// those cases.
-func Xsqlite3VdbeAppendP4(tls *crt.TLS, p uintptr, pP4 uintptr, n int32) { /* sqlite3.c:78887:21: */
+func Xsqlite3VdbeAppendP4(tls *libc.TLS, p uintptr, pP4 uintptr, n int32) { /* sqlite3.c:79077:21: */
var pOp uintptr
if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 {
freeP4(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, n, pP4)
} else {
- pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*24)
+ pOp = ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*32)
(*VdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(n)
*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = pP4
@@ -52520,7 +54361,7 @@ func Xsqlite3VdbeAppendP4(tls *crt.TLS, p uintptr, pP4 uintptr, n int32) { /* sq
// Set the P4 on the most recently added opcode to the KeyInfo for the
// index given.
-func Xsqlite3VdbeSetP4KeyInfo(tls *crt.TLS, pParse uintptr, pIdx uintptr) { /* sqlite3.c:78907:21: */
+func Xsqlite3VdbeSetP4KeyInfo(tls *libc.TLS, pParse uintptr, pIdx uintptr) { /* sqlite3.c:79097:21: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var pKeyInfo uintptr
@@ -52530,6 +54371,38 @@ func Xsqlite3VdbeSetP4KeyInfo(tls *crt.TLS, pParse uintptr, pIdx uintptr) { /* s
}
}
+// Change the comment on the most recently coded instruction. Or
+// insert a No-op and add the comment to that new instruction. This
+// makes the code easier to read during debugging. None of this happens
+// in a production build.
+func vdbeVComment(tls *libc.TLS, p uintptr, zFormat uintptr, ap Va_list) { /* sqlite3.c:79113:13: */
+
+ if (*Vdbe)(unsafe.Pointer(p)).FnOp != 0 {
+
+ Xsqlite3DbFree(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*32)).FzComment)
+ (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(((*Vdbe)(unsafe.Pointer(p)).FnOp-1))*32)).FzComment = Xsqlite3VMPrintf(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, zFormat, ap)
+ }
+}
+func Xsqlite3VdbeComment(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:79123:21: */
+ var ap Va_list
+ _ = ap
+ if p != 0 {
+ ap = va
+ vdbeVComment(tls, p, zFormat, ap)
+ _ = ap
+ }
+}
+func Xsqlite3VdbeNoopComment(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:79131:21: */
+ var ap Va_list
+ _ = ap
+ if p != 0 {
+ Xsqlite3VdbeAddOp0(tls, p, 173)
+ ap = va
+ vdbeVComment(tls, p, zFormat, ap)
+ _ = ap
+ }
+}
+
// Return the opcode for a given address. If the address is -1, then
// return the most recently inserted opcode.
//
@@ -52541,7 +54414,7 @@ func Xsqlite3VdbeSetP4KeyInfo(tls *crt.TLS, pParse uintptr, pIdx uintptr) { /* s
// this routine is a valid pointer. But because the dummy.opcode is 0,
// dummy will never be written to. This is verified by code inspection and
// by running with Valgrind.
-func Xsqlite3VdbeGetOp(tls *crt.TLS, p uintptr, addr int32) uintptr { /* sqlite3.c:78974:23: */ // Ignore the MSVC warning about no initializer
+func Xsqlite3VdbeGetOp(tls *libc.TLS, p uintptr, addr int32) uintptr { /* sqlite3.c:79164:23: */ // Ignore the MSVC warning about no initializer
if addr < 0 {
addr = ((*Vdbe)(unsafe.Pointer(p)).FnOp - 1)
@@ -52550,16 +54423,130 @@ func Xsqlite3VdbeGetOp(tls *crt.TLS, p uintptr, addr int32) uintptr { /* sqlite3
if (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FmallocFailed != 0 {
return uintptr(unsafe.Pointer(&dummy))
} else {
- return ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*24)
+ return ((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(addr)*32)
}
return uintptr(0)
}
-var dummy VdbeOp /* sqlite3.c:78977:17: */
+var dummy VdbeOp /* sqlite3.c:79167:17: */
+
+// Return an integer value for one of the parameters to the opcode pOp
+// determined by character c.
+func translateP(tls *libc.TLS, c int8, pOp uintptr) int32 { /* sqlite3.c:79185:12: */
+ if int32(c) == '1' {
+ return (*Op)(unsafe.Pointer(pOp)).Fp1
+ }
+ if int32(c) == '2' {
+ return (*Op)(unsafe.Pointer(pOp)).Fp2
+ }
+ if int32(c) == '3' {
+ return (*Op)(unsafe.Pointer(pOp)).Fp3
+ }
+ if int32(c) == '4' {
+ return *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ }
+ return int32((*Op)(unsafe.Pointer(pOp)).Fp5)
+}
+
+// Compute a string for the "comment" field of a VDBE opcode listing.
+//
+// The Synopsis: field in comments in the vdbe.c source file gets converted
+// to an extra string that is appended to the sqlite3OpcodeName(). In the
+// absence of other comments, this synopsis becomes the comment on the opcode.
+// Some translation occurs:
+//
+// "PX" -> "r[X]"
+// "PX@PY" -> "r[X..X+Y-1]" or "r[x]" if y is 0 or 1
+// "PX@PY+1" -> "r[X..X+Y]" or "r[x]" if y is 0
+// "PY..PY" -> "r[X..Y]" or "r[x]" if y<=x
+func Xsqlite3VdbeDisplayComment(tls *libc.TLS, db uintptr, pOp uintptr, zP4 uintptr) uintptr { /* sqlite3.c:79206:21: */
+ bp := tls.Alloc(162)
+ defer tls.Free(162)
+
+ var zOpName uintptr
+ var zSynopsis uintptr
+ var nOpName int32
+ var ii int32
+ // var zAlt [50]int8 at bp+112, 50
+
+ // var x StrAccum at bp+80, 32
+
+ Xsqlite3StrAccumInit(tls, bp+80 /* &x */, uintptr(0), uintptr(0), 0, 1000000000)
+ zOpName = Xsqlite3OpcodeName(tls, int32((*Op)(unsafe.Pointer(pOp)).Fopcode))
+ nOpName = Xsqlite3Strlen30(tls, zOpName)
+ if *(*int8)(unsafe.Pointer(zOpName + uintptr((nOpName + 1)))) != 0 {
+ var seenCom int32 = 0
+ var c int8
+ zSynopsis = libc.AssignAddUintptr(&zOpName, (uintptr(nOpName + 1)))
+ if libc.Xstrncmp(tls, zSynopsis, ts+6573 /* "IF " */, uint64(3)) == 0 {
+ if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x20) != 0 {
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zAlt[0] */, ts+6577 /* "r[P2] = (%s)" */, libc.VaList(bp, (zSynopsis+uintptr(3))))
+ } else {
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+112 /* &zAlt[0] */, ts+6590 /* "if %s goto P2" */, libc.VaList(bp+8, (zSynopsis+uintptr(3))))
+ }
+ zSynopsis = bp + 112 /* &zAlt[0] */
+ }
+ for ii = 0; (int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(zSynopsis + uintptr(ii)))))) != 0; ii++ {
+ if int32(c) == 'P' {
+ c = *(*int8)(unsafe.Pointer(zSynopsis + uintptr(libc.PreIncInt32(&ii, 1))))
+ if int32(c) == '4' {
+ Xsqlite3_str_appendall(tls, bp+80 /* &x */, zP4)
+ } else if int32(c) == 'X' {
+ Xsqlite3_str_appendall(tls, bp+80 /* &x */, (*Op)(unsafe.Pointer(pOp)).FzComment)
+ seenCom = 1
+ } else {
+ var v1 int32 = translateP(tls, c, pOp)
+ var v2 int32
+ if libc.Xstrncmp(tls, ((zSynopsis+uintptr(ii))+uintptr(1)), ts+6604 /* "@P" */, uint64(2)) == 0 {
+ ii = ii + (3)
+ v2 = translateP(tls, *(*int8)(unsafe.Pointer(zSynopsis + uintptr(ii))), pOp)
+ if libc.Xstrncmp(tls, ((zSynopsis+uintptr(ii))+uintptr(1)), ts+6607 /* "+1" */, uint64(2)) == 0 {
+ ii = ii + (2)
+ v2++
+ }
+ if v2 < 2 {
+ Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6610 /* "%d" */, libc.VaList(bp+16, v1))
+ } else {
+ Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6613 /* "%d..%d" */, libc.VaList(bp+24, v1, ((v1+v2)-1)))
+ }
+ } else if libc.Xstrncmp(tls, ((zSynopsis+uintptr(ii))+uintptr(1)), ts+6620 /* "@NP" */, uint64(3)) == 0 {
+ var pCtx uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
+ if (int32((*Op)(unsafe.Pointer(pOp)).Fp4type) != (-16)) || (int32((*Sqlite3_context)(unsafe.Pointer(pCtx)).Fargc) == 1) {
+ Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6610 /* "%d" */, libc.VaList(bp+40, v1))
+ } else if int32((*Sqlite3_context)(unsafe.Pointer(pCtx)).Fargc) > 1 {
+ Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6613 /* "%d..%d" */, libc.VaList(bp+48, v1, ((v1+int32((*Sqlite3_context)(unsafe.Pointer(pCtx)).Fargc))-1)))
+ } else {
+
+ *(*U32)(unsafe.Pointer(bp + 80 /* &x */ + 24 /* &.nChar */)) -= (U32(2))
+ ii++
+ }
+ ii = ii + (3)
+ } else {
+ Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6610 /* "%d" */, libc.VaList(bp+64, v1))
+ if (libc.Xstrncmp(tls, ((zSynopsis+uintptr(ii))+uintptr(1)), ts+6624 /* "..P3" */, uint64(4)) == 0) && ((*Op)(unsafe.Pointer(pOp)).Fp3 == 0) {
+ ii = ii + (4)
+ }
+ }
+ }
+ } else {
+ Xsqlite3_str_appendchar(tls, bp+80 /* &x */, 1, c)
+ }
+ }
+ if !(seenCom != 0) && ((*Op)(unsafe.Pointer(pOp)).FzComment != 0) {
+ Xsqlite3_str_appendf(tls, bp+80 /* &x */, ts+6629 /* "; %s" */, libc.VaList(bp+72, (*Op)(unsafe.Pointer(pOp)).FzComment))
+ }
+ } else if (*Op)(unsafe.Pointer(pOp)).FzComment != 0 {
+ Xsqlite3_str_appendall(tls, bp+80 /* &x */, (*Op)(unsafe.Pointer(pOp)).FzComment)
+ }
+ if ((int32((*StrAccum)(unsafe.Pointer(bp+80 /* &x */)).FaccError) & 7) != 0) && (db != uintptr(0)) {
+ Xsqlite3OomFault(tls, db)
+ }
+ return Xsqlite3StrAccumFinish(tls, bp+80 /* &x */)
+}
// Compute a string that describes the P4 parameter for an opcode.
// Use zTemp for any required temporary buffer space.
-func Xsqlite3VdbeDisplayP4(tls *crt.TLS, db uintptr, pOp uintptr) uintptr { /* sqlite3.c:79181:21: */
+func Xsqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) uintptr { /* sqlite3.c:79371:21: */
bp := tls.Alloc(176)
defer tls.Free(176)
@@ -52573,69 +54560,69 @@ func Xsqlite3VdbeDisplayP4(tls *crt.TLS, db uintptr, pOp uintptr) uintptr { /* s
var j int32
var pKeyInfo uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4438 /* "k(%d" */, crt.VaList(bp, int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6634 /* "k(%d" */, libc.VaList(bp, int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)))
for j = 0; j < int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField); j++ {
var pColl uintptr = *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(j)*8))
var zColl uintptr
if pColl != 0 {
zColl = (*CollSeq)(unsafe.Pointer(pColl)).FzName
} else {
- zColl = ts + 672 /* "" */
+ zColl = ts + 781 /* "" */
}
- if crt.Xstrcmp(tls, zColl, ts+230 /* "BINARY" */) == 0 {
- zColl = ts + 4443 /* "B" */
+ if libc.Xstrcmp(tls, zColl, ts+344 /* "BINARY" */) == 0 {
+ zColl = ts + 6639 /* "B" */
}
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4445, /* ",%s%s%s" */
- crt.VaList(bp+8, func() uintptr {
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6641, /* ",%s%s%s" */
+ libc.VaList(bp+8, func() uintptr {
if (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j)))) & 0x01) != 0 {
- return ts + 4431 /* "-" */
+ return ts + 6566 /* "-" */
}
- return ts + 672 /* "" */
+ return ts + 781 /* "" */
}(),
func() uintptr {
if (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j)))) & 0x02) != 0 {
- return ts + 4453 /* "N." */
+ return ts + 6649 /* "N." */
}
- return ts + 672 /* "" */
+ return ts + 781 /* "" */
}(),
zColl))
}
- Xsqlite3_str_append(tls, bp+144 /* &x */, ts+4456 /* ")" */, 1)
+ Xsqlite3_str_append(tls, bp+144 /* &x */, ts+6652 /* ")" */, 1)
break
}
case -2:
{
var pColl uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4458 /* "%.18s-%s" */, crt.VaList(bp+32, (*CollSeq)(unsafe.Pointer(pColl)).FzName,
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6654 /* "%.18s-%s" */, libc.VaList(bp+32, (*CollSeq)(unsafe.Pointer(pColl)).FzName,
encnames[(*CollSeq)(unsafe.Pointer(pColl)).Fenc]))
break
}
case -8:
{
var pDef uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4467 /* "%s(%d)" */, crt.VaList(bp+48, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg)))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6663 /* "%s(%d)" */, libc.VaList(bp+48, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg)))
break
}
case -16:
{
var pDef uintptr = (*Sqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpFunc
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4467 /* "%s(%d)" */, crt.VaList(bp+64, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg)))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6663 /* "%s(%d)" */, libc.VaList(bp+64, (*FuncDef)(unsafe.Pointer(pDef)).FzName, int32((*FuncDef)(unsafe.Pointer(pDef)).FnArg)))
break
}
case -14:
{
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+456 /* "%lld" */, crt.VaList(bp+80, *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6670 /* "%lld" */, libc.VaList(bp+80, *(*I64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))))
break
}
case -3:
{
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4474 /* "%d" */, crt.VaList(bp+88, *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6610 /* "%d" */, libc.VaList(bp+88, *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
break
}
case -13:
{
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+450 /* "%.16g" */, crt.VaList(bp+96, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+564 /* "%.16g" */, libc.VaList(bp+96, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))))
break
}
case -11:
@@ -52644,43 +54631,43 @@ func Xsqlite3VdbeDisplayP4(tls *crt.TLS, db uintptr, pOp uintptr) uintptr { /* s
if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & 0x0002) != 0 {
zP4 = (*Mem)(unsafe.Pointer(pMem)).Fz
} else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (0x0004 | 0x0020)) != 0 {
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+456 /* "%lld" */, crt.VaList(bp+104, *(*I64)(unsafe.Pointer(pMem /* &.u */))))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6670 /* "%lld" */, libc.VaList(bp+104, *(*I64)(unsafe.Pointer(pMem /* &.u */))))
} else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & 0x0008) != 0 {
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+450 /* "%.16g" */, crt.VaList(bp+112, *(*float64)(unsafe.Pointer(pMem /* &.u */))))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+564 /* "%.16g" */, libc.VaList(bp+112, *(*float64)(unsafe.Pointer(pMem /* &.u */))))
} else if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & 0x0001) != 0 {
- zP4 = ts + 673 /* "NULL" */
+ zP4 = ts + 782 /* "NULL" */
} else {
- zP4 = ts + 4477 /* "(blob)" */
+ zP4 = ts + 6675 /* "(blob)" */
}
break
}
case -12:
{
var pVtab uintptr = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4484 /* "vtab:%p" */, crt.VaList(bp+120, pVtab))
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6682 /* "vtab:%p" */, libc.VaList(bp+120, pVtab))
break
}
case -15:
{
- var i int32
+ var i U32
var ai uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- var n int32 = *(*int32)(unsafe.Pointer(ai + uintptr(0)*4)) // The first element of an INTARRAY is always the
+ var n U32 = *(*U32)(unsafe.Pointer(ai + uintptr(0)*4)) // The first element of an INTARRAY is always the
// count of the number of elements to follow
- for i = 1; i <= n; i++ {
- Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+4492 /* "%c%d" */, crt.VaList(bp+128, func() int32 {
- if i == 1 {
+ for i = U32(1); i <= n; i++ {
+ Xsqlite3_str_appendf(tls, bp+144 /* &x */, ts+6690 /* "%c%u" */, libc.VaList(bp+128, func() int32 {
+ if i == U32(1) {
return '['
}
return ','
- }(), *(*int32)(unsafe.Pointer(ai + uintptr(i)*4))))
+ }(), *(*U32)(unsafe.Pointer(ai + uintptr(i)*4))))
}
- Xsqlite3_str_append(tls, bp+144 /* &x */, ts+4497 /* "]" */, 1)
+ Xsqlite3_str_append(tls, bp+144 /* &x */, ts+6695 /* "]" */, 1)
break
}
case -4:
{
- zP4 = ts + 4499 /* "program" */
+ zP4 = ts + 6697 /* "program" */
break
}
case -17:
@@ -52708,7 +54695,7 @@ func Xsqlite3VdbeDisplayP4(tls *crt.TLS, db uintptr, pOp uintptr) uintptr { /* s
return Xsqlite3StrAccumFinish(tls, bp+144 /* &x */)
}
-var encnames = [4]uintptr{ts + 4507 /* "?" */, ts + 4509 /* "8" */, ts + 4511 /* "16LE" */, ts + 4516 /* "16BE" */} /* sqlite3.c:79211:25 */
+var encnames = [4]uintptr{ts + 6705 /* "?" */, ts + 6707 /* "8" */, ts + 6709 /* "16LE" */, ts + 6714 /* "16BE" */} /* sqlite3.c:79401:25 */
// Declare to the Vdbe that the BTree object at db->aDb[i] is used.
//
@@ -52716,7 +54703,7 @@ var encnames = [4]uintptr{ts + 4507 /* "?" */, ts + 4509 /* "8" */, ts + 4511 /*
// attached databases that will be use. A mask of these databases
// is maintained in p->btreeMask. The p->lockMask value is the subset of
// p->btreeMask of databases that will require a lock.
-func Xsqlite3VdbeUsesBtree(tls *crt.TLS, p uintptr, i int32) { /* sqlite3.c:79306:21: */
+func Xsqlite3VdbeUsesBtree(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:79496:21: */
*(*YDbMask)(unsafe.Pointer(p + 204 /* &.btreeMask */)) |= (YDbMask((YDbMask(1))) << (i))
if (i != 1) && (Xsqlite3BtreeSharable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FaDb+uintptr(i)*32)).FpBt) != 0) {
@@ -52743,7 +54730,7 @@ func Xsqlite3VdbeUsesBtree(tls *crt.TLS, p uintptr, i int32) { /* sqlite3.c:7930
// corresponding to btrees that use shared cache. Then the runtime of
// this routine is N*N. But as N is rarely more than 1, this should not
// be a problem.
-func Xsqlite3VdbeEnter(tls *crt.TLS, p uintptr) { /* sqlite3.c:79337:21: */
+func Xsqlite3VdbeEnter(tls *libc.TLS, p uintptr) { /* sqlite3.c:79527:21: */
var i int32
var db uintptr
var aDb uintptr
@@ -52762,7 +54749,7 @@ func Xsqlite3VdbeEnter(tls *crt.TLS, p uintptr) { /* sqlite3.c:79337:21: */
}
// Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter().
-func vdbeLeave(tls *crt.TLS, p uintptr) { /* sqlite3.c:79358:29: */
+func vdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:79548:29: */
var i int32
var db uintptr
var aDb uintptr
@@ -52776,7 +54763,7 @@ func vdbeLeave(tls *crt.TLS, p uintptr) { /* sqlite3.c:79358:29: */
}
}
}
-func Xsqlite3VdbeLeave(tls *crt.TLS, p uintptr) { /* sqlite3.c:79372:21: */
+func Xsqlite3VdbeLeave(tls *libc.TLS, p uintptr) { /* sqlite3.c:79562:21: */
if ((*Vdbe)(unsafe.Pointer(p)).FlockMask) == YDbMask(0) {
return
} // The common case
@@ -52784,8 +54771,8 @@ func Xsqlite3VdbeLeave(tls *crt.TLS, p uintptr) { /* sqlite3.c:79372:21: */
}
// Initialize an array of N Mem element.
-func initMemArray(tls *crt.TLS, p uintptr, N int32, db uintptr, flags U16) { /* sqlite3.c:79414:13: */
- for (crt.PostDecInt32(&N, 1)) > 0 {
+func initMemArray(tls *libc.TLS, p uintptr, N int32, db uintptr, flags U16) { /* sqlite3.c:79604:13: */
+ for (libc.PostDecInt32(&N, 1)) > 0 {
(*Mem)(unsafe.Pointer(p)).Fdb = db
(*Mem)(unsafe.Pointer(p)).Fflags = flags
(*Mem)(unsafe.Pointer(p)).FszMalloc = 0
@@ -52794,19 +54781,19 @@ func initMemArray(tls *crt.TLS, p uintptr, N int32, db uintptr, flags U16) { /*
}
// Release an array of N Mem elements
-func releaseMemArray(tls *crt.TLS, p uintptr, N int32) { /* sqlite3.c:79429:13: */
+func releaseMemArray(tls *libc.TLS, p uintptr, N int32) { /* sqlite3.c:79619:13: */
if (p != 0) && (N != 0) {
var pEnd uintptr = (p + uintptr(N)*56)
var db uintptr = (*Mem)(unsafe.Pointer(p)).Fdb
if (*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed != 0 {
- for ok := true; ok; ok = ((crt.PreIncUintptr(&p, 56)) < pEnd) {
+ for ok := true; ok; ok = ((libc.PreIncUintptr(&p, 56)) < pEnd) {
if (*Mem)(unsafe.Pointer(p)).FszMalloc != 0 {
Xsqlite3DbFree(tls, db, (*Mem)(unsafe.Pointer(p)).FzMalloc)
}
}
return
}
- for ok1 := true; ok1; ok1 = ((crt.PreIncUintptr(&p, 56)) < pEnd) {
+ for ok1 := true; ok1; ok1 = ((libc.PreIncUintptr(&p, 56)) < pEnd) {
// This block is really an inlined version of sqlite3VdbeMemRelease()
// that takes advantage of the fact that the memory cell value is
@@ -52837,7 +54824,7 @@ func releaseMemArray(tls *crt.TLS, p uintptr, N int32) { /* sqlite3.c:79429:13:
//
// This routine does not delete the Frame right away. It merely adds the
// frame to a list of frames to be deleted when the Vdbe halts.
-func Xsqlite3VdbeFrameMemDel(tls *crt.TLS, pArg uintptr) { /* sqlite3.c:79491:21: */
+func Xsqlite3VdbeFrameMemDel(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:79681:21: */
var pFrame uintptr = pArg
(*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent = (*Vdbe)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame)).Fv)).FpDelFrame
@@ -52849,7 +54836,7 @@ func Xsqlite3VdbeFrameMemDel(tls *crt.TLS, pArg uintptr) { /* sqlite3.c:79491:21
//
// Return SQLITE_ROW on success. Return SQLITE_DONE if there are no
// more opcodes to be displayed.
-func Xsqlite3VdbeNextOpcode(tls *crt.TLS, p uintptr, pSub uintptr, eMode int32, piPc uintptr, piAddr uintptr, paOp uintptr) int32 { /* sqlite3.c:79506:20: */
+func Xsqlite3VdbeNextOpcode(tls *libc.TLS, p uintptr, pSub uintptr, eMode int32, piPc uintptr, piAddr uintptr, paOp uintptr) int32 { /* sqlite3.c:79696:20: */
var nRow int32 // Stop when row count reaches this
var nSub int32 = 0 // Number of sub-vdbes seen so far
var apSub uintptr = uintptr(0) // Array of sub-vdbes
@@ -52878,7 +54865,7 @@ func Xsqlite3VdbeNextOpcode(tls *crt.TLS, p uintptr, pSub uintptr, eMode int32,
}
iPc = *(*int32)(unsafe.Pointer(piPc))
for 1 != 0 { // Loop exits via break
- i = crt.PostIncInt32(&iPc, 1)
+ i = libc.PostIncInt32(&iPc, 1)
if i >= nRow {
(*Vdbe)(unsafe.Pointer(p)).Frc = 0
rc = 101
@@ -52904,32 +54891,32 @@ func Xsqlite3VdbeNextOpcode(tls *crt.TLS, p uintptr, pSub uintptr, eMode int32,
// a P4_SUBPROGRAM argument), expand the size of the array of subprograms
// kept in p->aMem[9].z to hold the new program - assuming this subprogram
// has not already been seen.
- if (pSub != uintptr(0)) && (int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*24)).Fp4type) == (-4)) {
+ if (pSub != uintptr(0)) && (int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*32)).Fp4type) == (-4)) {
var nByte int32 = (int32((uint64(nSub + 1)) * uint64(unsafe.Sizeof(uintptr(0)))))
var j int32
for j = 0; j < nSub; j++ {
- if *(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*8)) == *(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*24 + 16 /* &.p4 */)) {
+ if *(*uintptr)(unsafe.Pointer(apSub + uintptr(j)*8)) == *(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*32 + 16 /* &.p4 */)) {
break
}
}
if j == nSub {
- (*Vdbe)(unsafe.Pointer(p)).Frc = Xsqlite3VdbeMemGrow(tls, pSub, nByte, (crt.Bool32(nSub != 0)))
+ (*Vdbe)(unsafe.Pointer(p)).Frc = Xsqlite3VdbeMemGrow(tls, pSub, nByte, (libc.Bool32(nSub != 0)))
if (*Vdbe)(unsafe.Pointer(p)).Frc != 0 {
rc = 1
break
}
apSub = (*Mem)(unsafe.Pointer(pSub)).Fz
- *(*uintptr)(unsafe.Pointer(apSub + uintptr(crt.PostIncInt32(&nSub, 1))*8)) = *(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*24 + 16 /* &.p4 */))
- (*Mem)(unsafe.Pointer(pSub)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pSub))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0010))
+ *(*uintptr)(unsafe.Pointer(apSub + uintptr(libc.PostIncInt32(&nSub, 1))*8)) = *(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*32 + 16 /* &.p4 */))
+ (*Mem)(unsafe.Pointer(pSub)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pSub))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0010))
(*Mem)(unsafe.Pointer(pSub)).Fn = (int32(uint64(nSub) * uint64(unsafe.Sizeof(uintptr(0)))))
- nRow = nRow + ((*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*24 + 16 /* &.p4 */)))).FnOp)
+ nRow = nRow + ((*SubProgram)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aOp + uintptr(i)*32 + 16 /* &.p4 */)))).FnOp)
}
}
if eMode == 0 {
break
}
if eMode == 2 {
- var pOp uintptr = (aOp + uintptr(i)*24)
+ var pOp uintptr = (aOp + uintptr(i)*32)
if int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == 96 {
break
}
@@ -52941,10 +54928,10 @@ func Xsqlite3VdbeNextOpcode(tls *crt.TLS, p uintptr, pSub uintptr, eMode int32,
}
} else {
- if int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*24)).Fopcode) == 174 {
+ if int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*32)).Fopcode) == 174 {
break
}
- if (int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*24)).Fopcode) == 62) && (iPc > 1) {
+ if (int32((*Op)(unsafe.Pointer(aOp+uintptr(i)*32)).Fopcode) == 62) && (iPc > 1) {
break
}
}
@@ -52957,9 +54944,9 @@ func Xsqlite3VdbeNextOpcode(tls *crt.TLS, p uintptr, pSub uintptr, eMode int32,
// Delete a VdbeFrame object and its contents. VdbeFrame objects are
// allocated by the OP_Program opcode in sqlite3VdbeExec().
-func Xsqlite3VdbeFrameDelete(tls *crt.TLS, p uintptr) { /* sqlite3.c:79618:21: */
+func Xsqlite3VdbeFrameDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:79808:21: */
var i int32
- var aMem uintptr = ((p) + uintptr((((uint64(unsafe.Sizeof(VdbeFrame{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7)))))
+ var aMem uintptr = ((p) + uintptr((((uint64(unsafe.Sizeof(VdbeFrame{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7)))))
var apCsr uintptr = (aMem + uintptr((*VdbeFrame)(unsafe.Pointer(p)).FnChildMem)*56)
for i = 0; i < (*VdbeFrame)(unsafe.Pointer(p)).FnChildCsr; i++ {
@@ -52986,7 +54973,7 @@ func Xsqlite3VdbeFrameDelete(tls *crt.TLS, p uintptr) { /* sqlite3.c:79618:21: *
//
// When p->explain==1, first the main program is listed, then each of
// the trigger subprograms are listed one by one.
-func Xsqlite3VdbeList(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:79650:20: */
+func Xsqlite3VdbeList(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:79840:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -52996,7 +54983,7 @@ func Xsqlite3VdbeList(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:79650:20: */
// Loop counter
var rc int32 = 0 // Return code
var pMem uintptr = ((*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr(1)*56) // First Mem of result set
- var bListSubprogs int32 = (crt.Bool32((int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */))&0xc>>2) == 1) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x01000000)) != uint64(0))))
+ var bListSubprogs int32 = (libc.Bool32((int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */))&0xc>>2) == 1) || (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x01000000)) != uint64(0))))
// var aOp uintptr at bp+8, 8
// Array of opcodes
var pOp uintptr // Current opcode
@@ -53026,11 +55013,11 @@ func Xsqlite3VdbeList(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:79650:20: */
}
// Figure out which opcode is next to display
- rc = Xsqlite3VdbeNextOpcode(tls, p, pSub, (crt.Bool32(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */))&0xc>>2) == 2)), (p + 52 /* &.pc */), bp /* &i */, bp+8 /* &aOp */)
+ rc = Xsqlite3VdbeNextOpcode(tls, p, pSub, (libc.Bool32(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */))&0xc>>2) == 2)), (p + 52 /* &.pc */), bp /* &i */, bp+8 /* &aOp */)
if rc == 0 {
- pOp = (*(*uintptr)(unsafe.Pointer(bp + 8 /* aOp */)) + uintptr(*(*int32)(unsafe.Pointer(bp /* i */)))*24)
- if *(*int32)(unsafe.Pointer((db + 368 /* &.u1 */ /* &.isInterrupted */))) != 0 {
+ pOp = (*(*uintptr)(unsafe.Pointer(bp + 8 /* aOp */)) + uintptr(*(*int32)(unsafe.Pointer(bp /* i */)))*32)
+ if *(*int32)(unsafe.Pointer((db + 392 /* &.u1 */ /* &.isInterrupted */))) != 0 {
(*Vdbe)(unsafe.Pointer(p)).Frc = 9
rc = 1
Xsqlite3VdbeError(tls, p, Xsqlite3ErrStr(tls, (*Vdbe)(unsafe.Pointer(p)).Frc), 0)
@@ -53040,7 +55027,7 @@ func Xsqlite3VdbeList(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:79650:20: */
Xsqlite3VdbeMemSetInt64(tls, pMem, int64((*Op)(unsafe.Pointer(pOp)).Fp1))
Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(1)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp2))
Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(2)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp3))
- Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(3)*56), zP4, -1, uint8(1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(3)*56), zP4, -1, uint8(1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
(*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(4)
} else {
Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(0)*56), int64(*(*int32)(unsafe.Pointer(bp /* i */))))
@@ -53051,8 +55038,11 @@ func Xsqlite3VdbeList(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:79650:20: */
Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(4)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp3))
// pMem+5 for p4 is done last
Xsqlite3VdbeMemSetInt64(tls, (pMem + uintptr(6)*56), int64((*Op)(unsafe.Pointer(pOp)).Fp5))
- Xsqlite3VdbeMemSetNull(tls, (pMem + uintptr(7)*56))
- Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(5)*56), zP4, -1, uint8(1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})))
+ {
+ var zCom uintptr = Xsqlite3VdbeDisplayComment(tls, db, pOp, zP4)
+ Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(7)*56), zCom, -1, uint8(1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ }
+ Xsqlite3VdbeMemSetStr(tls, (pMem + uintptr(5)*56), zP4, -1, uint8(1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
(*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(8)
}
(*Vdbe)(unsafe.Pointer(p)).FpResultSet = pMem
@@ -53090,10 +55080,10 @@ type ReusableSpace = struct {
// This allocator is employed to repurpose unused slots at the end of the
// opcode array of prepared state for other memory needs of the prepared
// statement.
-func allocSpace(tls *crt.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:79815:13: */
+func allocSpace(tls *libc.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:80005:13: */
if pBuf == uintptr(0) {
- nByte = (((nByte) + int64(7)) & ^int64(crt.Int32FromInt32(7)))
+ nByte = (((nByte) + int64(7)) & ^int64(libc.Int32FromInt32(7)))
if nByte <= (*ReusableSpace)(unsafe.Pointer(p)).FnFree {
*(*Sqlite3_int64)(unsafe.Pointer(p + 8 /* &.nFree */)) -= (nByte)
pBuf = ((*ReusableSpace)(unsafe.Pointer(p)).FpSpace + uintptr((*ReusableSpace)(unsafe.Pointer(p)).FnFree))
@@ -53107,7 +55097,7 @@ func allocSpace(tls *crt.TLS, p uintptr, pBuf uintptr, nByte Sqlite3_int64) uint
// Rewind the VDBE back to the beginning in preparation for
// running it.
-func Xsqlite3VdbeRewind(tls *crt.TLS, p uintptr) { /* sqlite3.c:79838:21: */
+func Xsqlite3VdbeRewind(tls *libc.TLS, p uintptr) { /* sqlite3.c:80028:21: */
// There should be at least one opcode.
@@ -53140,7 +55130,7 @@ func Xsqlite3VdbeRewind(tls *crt.TLS, p uintptr) { /* sqlite3.c:79838:21: */
//
// Use the sqlite3VdbeRewind() procedure to restore a virtual machine back
// to its initial state after it has been run.
-func Xsqlite3VdbeMakeReady(tls *crt.TLS, p uintptr, pParse uintptr) { /* sqlite3.c:79891:21: */
+func Xsqlite3VdbeMakeReady(tls *libc.TLS, p uintptr, pParse uintptr) { /* sqlite3.c:80081:21: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -53173,13 +55163,13 @@ func Xsqlite3VdbeMakeReady(tls *crt.TLS, p uintptr, pParse uintptr) { /* sqlite3
// Figure out how much reusable memory is available at the end of the
// opcode array. This extra memory will be reallocated for other elements
// of the prepared statement.
- n = (int32(((uint64(unsafe.Sizeof(Op{})) * uint64((*Vdbe)(unsafe.Pointer(p)).FnOp)) + uint64(7)) & ^uint64(crt.Int32FromInt32(7)))) // Bytes of opcode memory used
- (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FpSpace = (((*Vdbe)(unsafe.Pointer(p)).FaOp) + uintptr(n)) // Unused opcode memory
+ n = (int32(((uint64(unsafe.Sizeof(Op{})) * uint64((*Vdbe)(unsafe.Pointer(p)).FnOp)) + uint64(7)) & ^uint64(libc.Int32FromInt32(7)))) // Bytes of opcode memory used
+ (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FpSpace = (((*Vdbe)(unsafe.Pointer(p)).FaOp) + uintptr(n)) // Unused opcode memory
- (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FnFree = (Sqlite3_int64(((*Parse)(unsafe.Pointer(pParse)).FszOpAlloc - n) & ^int32(crt.Int32FromInt32(7)))) // Bytes of unused memory
+ (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FnFree = (Sqlite3_int64(((*Parse)(unsafe.Pointer(pParse)).FszOpAlloc - n) & ^int32(libc.Int32FromInt32(7)))) // Bytes of unused memory
resolveP2Values(tls, p, bp /* &nArg */)
- crt.SetBitFieldPtr16Uint32(p+200 /* &.usesStmtJournal */, Bft((U8(crt.Bool32(((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite != 0) && ((*Parse)(unsafe.Pointer(pParse)).FmayAbort != 0))))), 6, 0x40)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.usesStmtJournal */, Bft((U8(libc.Bool32(((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite != 0) && ((*Parse)(unsafe.Pointer(pParse)).FmayAbort != 0))))), 6, 0x40)
if (*Parse)(unsafe.Pointer(pParse)).Fexplain != 0 {
var iFirst int32
var mx int32
@@ -53187,7 +55177,7 @@ func Xsqlite3VdbeMakeReady(tls *crt.TLS, p uintptr, pParse uintptr) { /* sqlite3
if nMem < 10 {
nMem = 10
}
- crt.SetBitFieldPtr16Uint32(p+200 /* &.explain */, Bft((*Parse)(unsafe.Pointer(pParse)).Fexplain), 2, 0xc)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.explain */, Bft((*Parse)(unsafe.Pointer(pParse)).Fexplain), 2, 0xc)
if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 {
Xsqlite3VdbeSetNumCols(tls, p, 4)
iFirst = 8
@@ -53202,7 +55192,7 @@ func Xsqlite3VdbeMakeReady(tls *crt.TLS, p uintptr, pParse uintptr) { /* sqlite3
azColName[i], uintptr(0))
}
}
- crt.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3)
// Memory for registers, parameters, cursor, etc, is allocated in one or two
// passes. On the first pass, we try to reuse unused memory at the
@@ -53219,7 +55209,7 @@ func Xsqlite3VdbeMakeReady(tls *crt.TLS, p uintptr, pParse uintptr) { /* sqlite3
(*Vdbe)(unsafe.Pointer(p)).FapArg = allocSpace(tls, bp+8 /* &x */, uintptr(0), (int64(uint64(*(*int32)(unsafe.Pointer(bp /* nArg */))) * uint64(unsafe.Sizeof(uintptr(0))))))
(*Vdbe)(unsafe.Pointer(p)).FapCsr = allocSpace(tls, bp+8 /* &x */, uintptr(0), (int64(uint64(nCursor) * uint64(unsafe.Sizeof(uintptr(0))))))
if (*ReusableSpace)(unsafe.Pointer(bp+8 /* &x */)).FnNeeded != 0 {
- (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FpSpace = crt.AssignPtrUintptr(p+248 /* &.pFree */, Xsqlite3DbMallocRawNN(tls, db, uint64((*ReusableSpace)(unsafe.Pointer(bp+8 /* &x */)).FnNeeded)))
+ (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FpSpace = libc.AssignPtrUintptr(p+248 /* &.pFree */, Xsqlite3DbMallocRawNN(tls, db, uint64((*ReusableSpace)(unsafe.Pointer(bp+8 /* &x */)).FnNeeded)))
(*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FnFree = (*ReusableSpace)(unsafe.Pointer(bp + 8 /* &x */)).FnNeeded
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
(*Vdbe)(unsafe.Pointer(p)).FaMem = allocSpace(tls, bp+8 /* &x */, (*Vdbe)(unsafe.Pointer(p)).FaMem, (int64(uint64(nMem) * uint64(unsafe.Sizeof(Mem{})))))
@@ -53241,19 +55231,19 @@ func Xsqlite3VdbeMakeReady(tls *crt.TLS, p uintptr, pParse uintptr) { /* sqlite3
initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaVar, nVar, db, uint16(0x0001))
(*Vdbe)(unsafe.Pointer(p)).FnMem = nMem
initMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaMem, nMem, db, uint16(0x0080))
- crt.Xmemset(tls, (*Vdbe)(unsafe.Pointer(p)).FapCsr, 0, (uint64(nCursor) * uint64(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemset(tls, (*Vdbe)(unsafe.Pointer(p)).FapCsr, 0, (uint64(nCursor) * uint64(unsafe.Sizeof(uintptr(0)))))
}
Xsqlite3VdbeRewind(tls, p)
}
var azColName = [12]uintptr{
- ts + 4521 /* "addr" */, ts + 4526 /* "opcode" */, ts + 4533 /* "p1" */, ts + 4536 /* "p2" */, ts + 4539 /* "p3" */, ts + 4542 /* "p4" */, ts + 4545 /* "p5" */, ts + 4548, /* "comment" */
- ts + 4556 /* "id" */, ts + 4559 /* "parent" */, ts + 4566 /* "notused" */, ts + 4574, /* "detail" */
-} /* sqlite3.c:79937:23 */
+ ts + 6719 /* "addr" */, ts + 6724 /* "opcode" */, ts + 6731 /* "p1" */, ts + 6734 /* "p2" */, ts + 6737 /* "p3" */, ts + 6740 /* "p4" */, ts + 6743 /* "p5" */, ts + 6746, /* "comment" */
+ ts + 6754 /* "id" */, ts + 6757 /* "parent" */, ts + 6764 /* "notused" */, ts + 6772, /* "detail" */
+} /* sqlite3.c:80127:23 */
// Close a VDBE cursor and release all the resources that cursor
// happens to hold.
-func Xsqlite3VdbeFreeCursor(tls *crt.TLS, p uintptr, pCx uintptr) { /* sqlite3.c:80016:21: */
+func Xsqlite3VdbeFreeCursor(tls *libc.TLS, p uintptr, pCx uintptr) { /* sqlite3.c:80206:21: */
if pCx == uintptr(0) {
return
}
@@ -53282,14 +55272,14 @@ func Xsqlite3VdbeFreeCursor(tls *crt.TLS, p uintptr, pCx uintptr) { /* sqlite3.c
var pModule uintptr = (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pVCur)).FpVtab)).FpModule
(*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pVCur)).FpVtab)).FnRef--
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((pModule + 56 /* &.xClose */))))(tls, pVCur)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule + 56 /* &.xClose */))))(tls, pVCur)
break
}
}
}
// Close all cursors in the current frame.
-func closeCursorsInFrame(tls *crt.TLS, p uintptr) { /* sqlite3.c:80053:13: */
+func closeCursorsInFrame(tls *libc.TLS, p uintptr) { /* sqlite3.c:80243:13: */
if (*Vdbe)(unsafe.Pointer(p)).FapCsr != 0 {
var i int32
for i = 0; i < (*Vdbe)(unsafe.Pointer(p)).FnCursor; i++ {
@@ -53305,7 +55295,7 @@ func closeCursorsInFrame(tls *crt.TLS, p uintptr) { /* sqlite3.c:80053:13: */
// Copy the values stored in the VdbeFrame structure to its Vdbe. This
// is used, for example, when a trigger sub-program is halted to restore
// control to the main program.
-func Xsqlite3VdbeFrameRestore(tls *crt.TLS, pFrame uintptr) int32 { /* sqlite3.c:80071:20: */
+func Xsqlite3VdbeFrameRestore(tls *libc.TLS, pFrame uintptr) int32 { /* sqlite3.c:80261:20: */
var v uintptr = (*VdbeFrame)(unsafe.Pointer(pFrame)).Fv
closeCursorsInFrame(tls, v)
(*Vdbe)(unsafe.Pointer(v)).FaOp = (*VdbeFrame)(unsafe.Pointer(pFrame)).FaOp
@@ -53329,7 +55319,7 @@ func Xsqlite3VdbeFrameRestore(tls *crt.TLS, pFrame uintptr) int32 { /* sqlite3.c
// cell array. This is necessary as the memory cell array may contain
// pointers to VdbeFrame objects, which may in turn contain pointers to
// open cursors.
-func closeAllCursors(tls *crt.TLS, p uintptr) { /* sqlite3.c:80100:13: */
+func closeAllCursors(tls *libc.TLS, p uintptr) { /* sqlite3.c:80290:13: */
if (*Vdbe)(unsafe.Pointer(p)).FpFrame != 0 {
var pFrame uintptr
for pFrame = (*Vdbe)(unsafe.Pointer(p)).FpFrame; (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent != 0; pFrame = (*VdbeFrame)(unsafe.Pointer(pFrame)).FpParent {
@@ -53360,15 +55350,15 @@ func closeAllCursors(tls *crt.TLS, p uintptr) { /* sqlite3.c:80100:13: */
// statement. This is now set at compile time, rather than during
// execution of the vdbe program so that sqlite3_column_count() can
// be called on an SQL statement before sqlite3_step().
-func Xsqlite3VdbeSetNumCols(tls *crt.TLS, p uintptr, nResColumn int32) { /* sqlite3.c:80130:21: */
+func Xsqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { /* sqlite3.c:80320:21: */
var n int32
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
if (*Vdbe)(unsafe.Pointer(p)).FnResColumn != 0 {
- releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, (int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn) * 2))
+ releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, (int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn) * 5))
Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FaColName)
}
- n = (nResColumn * 2)
+ n = (nResColumn * 5)
(*Vdbe)(unsafe.Pointer(p)).FnResColumn = U16(nResColumn)
(*Vdbe)(unsafe.Pointer(p)).FaColName = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(unsafe.Sizeof(Mem{})) * uint64(n))))
if (*Vdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) {
@@ -53385,7 +55375,7 @@ func Xsqlite3VdbeSetNumCols(tls *crt.TLS, p uintptr, nResColumn int32) { /* sqli
// The final parameter, xDel, must be one of SQLITE_DYNAMIC, SQLITE_STATIC
// or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed
// to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed.
-func Xsqlite3VdbeSetColName(tls *crt.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) int32 { /* sqlite3.c:80155:20: */
+func Xsqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) int32 { /* sqlite3.c:80345:20: */
var rc int32
var pColName uintptr
@@ -53403,31 +55393,30 @@ func Xsqlite3VdbeSetColName(tls *crt.TLS, p uintptr, idx int32, var1 int32, zNam
// A read or write transaction may or may not be active on database handle
// db. If a transaction is active, commit it. If there is a
// write-transaction spanning more than one database file, this routine
-// takes care of the master journal trickery.
-func vdbeCommit(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80183:12: */
+// takes care of the super-journal trickery.
+func vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80373:12: */
bp := tls.Alloc(72)
defer tls.Free(72)
var i int32
var nTrans int32 = 0 // Number of databases with an active write-transaction
// that are candidates for a two-phase commit using a
- // master-journal
+ // super-journal
var rc int32 = 0
var needXcommit int32 = 0
// Before doing anything else, call the xSync() callback for any
// virtual module tables written in this transaction. This has to
- // be done before determining whether a master journal file is
+ // be done before determining whether a super-journal file is
// required, as an xSync() callback may add an attached database
// to the transaction.
rc = Xsqlite3VtabSync(tls, db, p)
- /* This loop determines (a) if the commit hook should be invoked and
- ** (b) how many database files have open write transactions, not
- ** including the temp database. (b) is important because if more than
- ** one database file has an open write transaction, a master journal
- ** file is required for an atomic commit.
- */
+ // This loop determines (a) if the commit hook should be invoked and
+ // (b) how many database files have open write transactions, not
+ // including the temp database. (b) is important because if more than
+ // one database file has an open write transaction, a super-journal
+ // file is required for an atomic commit.
for i = 0; (rc == 0) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb); i++ {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
if Xsqlite3BtreeIsInTrans(tls, pBt) != 0 {
@@ -53451,7 +55440,7 @@ func vdbeCommit(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80183:
// If there are any write-transactions at all, invoke the commit hook
if (needXcommit != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FxCommitCallback != 0) {
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((db + 272 /* &.xCommitCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCommitArg)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 272 /* &.xCommitCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCommitArg)
if rc != 0 {
return (19 | (int32(2) << 8))
}
@@ -53459,7 +55448,7 @@ func vdbeCommit(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80183:
// The simple case - no more than one database file (not counting the
// TEMP database) has a transaction active. There is no need for the
- // master-journal.
+ // super-journal.
//
// If the return value of sqlite3BtreeGetFilename() is a zero length
// string, it means the main database is :memory: or a temp file. In
@@ -53489,57 +55478,57 @@ func vdbeCommit(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80183:
}
} else {
var pVfs uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpVfs
- var zMaster uintptr = uintptr(0) // File-name for the master journal
+ var zSuper uintptr = uintptr(0) // File-name for the super-journal
var zMainFile uintptr = Xsqlite3BtreeGetFilename(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(0)*32)).FpBt)
- *(*uintptr)(unsafe.Pointer(bp + 64 /* pMaster */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */)) = uintptr(0)
var offset I64 = int64(0)
// var res int32 at bp+60, 4
var retryCount int32 = 0
var nMainFile int32
- // Select a master journal file name
+ // Select a super-journal file name
nMainFile = Xsqlite3Strlen30(tls, zMainFile)
- zMaster = Xsqlite3MPrintf(tls, db, ts+4581 /* "%.4c%s%.16c" */, crt.VaList(bp, 0, zMainFile, 0))
- if zMaster == uintptr(0) {
+ zSuper = Xsqlite3MPrintf(tls, db, ts+6779 /* "%.4c%s%.16c" */, libc.VaList(bp, 0, zMainFile, 0))
+ if zSuper == uintptr(0) {
return 7
}
- zMaster += uintptr(4)
+ zSuper += uintptr(4)
for ok := true; ok; ok = ((rc == 0) && (*(*int32)(unsafe.Pointer(bp + 60 /* res */)) != 0)) {
// var iRandom U32 at bp+56, 4
if retryCount != 0 {
if retryCount > 100 {
- Xsqlite3_log(tls, 13, ts+4593 /* "MJ delete: %s" */, crt.VaList(bp+24, zMaster))
- Xsqlite3OsDelete(tls, pVfs, zMaster, 0)
+ Xsqlite3_log(tls, 13, ts+6791 /* "MJ delete: %s" */, libc.VaList(bp+24, zSuper))
+ Xsqlite3OsDelete(tls, pVfs, zSuper, 0)
break
} else if retryCount == 1 {
- Xsqlite3_log(tls, 13, ts+4607 /* "MJ collide: %s" */, crt.VaList(bp+32, zMaster))
+ Xsqlite3_log(tls, 13, ts+6805 /* "MJ collide: %s" */, libc.VaList(bp+32, zSuper))
}
}
retryCount++
Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), bp+56 /* &iRandom */)
- Xsqlite3_snprintf(tls, 13, (zMaster + uintptr(nMainFile)), ts+4622, /* "-mj%06X9%02X" */
- crt.VaList(bp+40, ((*(*U32)(unsafe.Pointer(bp + 56 /* iRandom */))>>8)&U32(0xffffff)), (*(*U32)(unsafe.Pointer(bp + 56 /* iRandom */))&U32(0xff))))
- // The antipenultimate character of the master journal name must
+ Xsqlite3_snprintf(tls, 13, (zSuper + uintptr(nMainFile)), ts+6820, /* "-mj%06X9%02X" */
+ libc.VaList(bp+40, ((*(*U32)(unsafe.Pointer(bp + 56 /* iRandom */))>>8)&U32(0xffffff)), (*(*U32)(unsafe.Pointer(bp + 56 /* iRandom */))&U32(0xff))))
+ // The antipenultimate character of the super-journal name must
// be "9" to avoid name collisions when using 8+3 filenames.
- rc = Xsqlite3OsAccess(tls, pVfs, zMaster, 0, bp+60 /* &res */)
+ rc = Xsqlite3OsAccess(tls, pVfs, zSuper, 0, bp+60 /* &res */)
}
if rc == 0 {
- // Open the master journal.
- rc = Xsqlite3OsOpenMalloc(tls, pVfs, zMaster, bp+64, /* &pMaster */
+ // Open the super-journal.
+ rc = Xsqlite3OsOpenMalloc(tls, pVfs, zSuper, bp+64, /* &pSuperJrnl */
(((0x00000002 | 0x00000004) | 0x00000010) | 0x00004000), uintptr(0))
}
if rc != 0 {
- Xsqlite3DbFree(tls, db, (zMaster - uintptr(4)))
+ Xsqlite3DbFree(tls, db, (zSuper - uintptr(4)))
return rc
}
// Write the name of each database file in the transaction into the new
- // master journal file. If an error occurs at this point close
- // and delete the master journal file. All the individual journal files
- // still have 'null' as the master journal pointer, so they will roll
+ // super-journal file. If an error occurs at this point close
+ // and delete the super-journal file. All the individual journal files
+ // still have 'null' as the super-journal pointer, so they will roll
// back independently if a failure occurs.
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
@@ -53549,55 +55538,55 @@ func vdbeCommit(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:80183:
continue
}
- rc = Xsqlite3OsWrite(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pMaster */)), zFile, (Xsqlite3Strlen30(tls, zFile) + 1), offset)
+ rc = Xsqlite3OsWrite(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */)), zFile, (Xsqlite3Strlen30(tls, zFile) + 1), offset)
offset = offset + (I64(Xsqlite3Strlen30(tls, zFile) + 1))
if rc != 0 {
- Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pMaster */)))
- Xsqlite3OsDelete(tls, pVfs, zMaster, 0)
- Xsqlite3DbFree(tls, db, (zMaster - uintptr(4)))
+ Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */)))
+ Xsqlite3OsDelete(tls, pVfs, zSuper, 0)
+ Xsqlite3DbFree(tls, db, (zSuper - uintptr(4)))
return rc
}
}
}
- // Sync the master journal file. If the IOCAP_SEQUENTIAL device
+ // Sync the super-journal file. If the IOCAP_SEQUENTIAL device
// flag is set this is not required.
- if (0 == (Xsqlite3OsDeviceCharacteristics(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pMaster */))) & 0x00000400)) &&
- (0 != (crt.AssignInt32(&rc, Xsqlite3OsSync(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pMaster */)), 0x00002)))) {
- Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pMaster */)))
- Xsqlite3OsDelete(tls, pVfs, zMaster, 0)
- Xsqlite3DbFree(tls, db, (zMaster - uintptr(4)))
+ if (0 == (Xsqlite3OsDeviceCharacteristics(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */))) & 0x00000400)) &&
+ (0 != (libc.AssignInt32(&rc, Xsqlite3OsSync(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */)), 0x00002)))) {
+ Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */)))
+ Xsqlite3OsDelete(tls, pVfs, zSuper, 0)
+ Xsqlite3DbFree(tls, db, (zSuper - uintptr(4)))
return rc
}
// Sync all the db files involved in the transaction. The same call
- // sets the master journal pointer in each individual journal. If
- // an error occurs here, do not delete the master journal file.
+ // sets the super-journal pointer in each individual journal. If
+ // an error occurs here, do not delete the super-journal file.
//
// If the error occurs during the first call to
// sqlite3BtreeCommitPhaseOne(), then there is a chance that the
- // master journal file will be orphaned. But we cannot delete it,
- // in case the master journal file name was written into the journal
+ // super-journal file will be orphaned. But we cannot delete it,
+ // in case the super-journal file name was written into the journal
// file before the failure occurred.
for i = 0; (rc == 0) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnDb); i++ {
var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
if pBt != 0 {
- rc = Xsqlite3BtreeCommitPhaseOne(tls, pBt, zMaster)
+ rc = Xsqlite3BtreeCommitPhaseOne(tls, pBt, zSuper)
}
}
- Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pMaster */)))
+ Xsqlite3OsCloseFree(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pSuperJrnl */)))
if rc != 0 {
- Xsqlite3DbFree(tls, db, (zMaster - uintptr(4)))
+ Xsqlite3DbFree(tls, db, (zSuper - uintptr(4)))
return rc
}
- // Delete the master journal file. This commits the transaction. After
+ // Delete the super-journal file. This commits the transaction. After
// doing this the directory is synced again before any individual
// transaction files are deleted.
- rc = Xsqlite3OsDelete(tls, pVfs, zMaster, 1)
- Xsqlite3DbFree(tls, db, (zMaster - uintptr(4)))
- zMaster = uintptr(0)
+ rc = Xsqlite3OsDelete(tls, pVfs, zSuper, 1)
+ Xsqlite3DbFree(tls, db, (zSuper - uintptr(4)))
+ zSuper = uintptr(0)
if rc != 0 {
return rc
}
@@ -53632,7 +55621,7 @@ var aMJNeeded = [6]U8{
/* TRUNCATE */ U8(1),
/* MEMORY */ U8(0),
/* WAL */ U8(0),
-} /* sqlite3.c:80218:23 */
+} /* sqlite3.c:80408:23 */
// This routine checks that the sqlite3.nVdbeActive count variable
// matches the number of vdbe's in the list sqlite3.pVdbe that are
@@ -53650,7 +55639,7 @@ var aMJNeeded = [6]U8{
//
// If an IO error occurs, an SQLITE_IOERR_XXX error code is returned.
// Otherwise SQLITE_OK.
-func vdbeCloseStatement(tls *crt.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:80479:28: */
+func vdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:80669:28: */
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
var rc int32 = 0
var i int32
@@ -53692,7 +55681,7 @@ func vdbeCloseStatement(tls *crt.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c
}
return rc
}
-func Xsqlite3VdbeCloseStatement(tls *crt.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:80525:20: */
+func Xsqlite3VdbeCloseStatement(tls *libc.TLS, p uintptr, eOp int32) int32 { /* sqlite3.c:80715:20: */
if ((*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).FnStatement != 0) && ((*Vdbe)(unsafe.Pointer(p)).FiStatement != 0) {
return vdbeCloseStatement(tls, p, eOp)
}
@@ -53707,13 +55696,13 @@ func Xsqlite3VdbeCloseStatement(tls *crt.TLS, p uintptr, eOp int32) int32 { /* s
// If there are outstanding FK violations and this function returns
// SQLITE_ERROR, set the result of the VM to SQLITE_CONSTRAINT_FOREIGNKEY
// and write an error message to it. Then return SQLITE_ERROR.
-func Xsqlite3VdbeCheckFk(tls *crt.TLS, p uintptr, deferred int32) int32 { /* sqlite3.c:80544:20: */
+func Xsqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) int32 { /* sqlite3.c:80734:20: */
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
if ((deferred != 0) && (((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons + (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons) > int64(0))) ||
(!(deferred != 0) && ((*Vdbe)(unsafe.Pointer(p)).FnFkConstraint > int64(0))) {
(*Vdbe)(unsafe.Pointer(p)).Frc = (19 | (int32(3) << 8))
(*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(2)
- Xsqlite3VdbeError(tls, p, ts+4635 /* "FOREIGN KEY cons..." */, 0)
+ Xsqlite3VdbeError(tls, p, ts+6833 /* "FOREIGN KEY cons..." */, 0)
return 1
}
return 0
@@ -53730,7 +55719,7 @@ func Xsqlite3VdbeCheckFk(tls *crt.TLS, p uintptr, deferred int32) int32 { /* sql
// Return an error code. If the commit could not complete because of
// lock contention, return SQLITE_BUSY. If SQLITE_BUSY is returned, it
// means the close did not happen and needs to be repeated.
-func Xsqlite3VdbeHalt(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:80571:20: */
+func Xsqlite3VdbeHalt(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80761:20: */
var rc int32 // Used to store transient return codes
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
@@ -53769,7 +55758,7 @@ func Xsqlite3VdbeHalt(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:80571:20: */
// Check for one of the special errors
mrc = ((*Vdbe)(unsafe.Pointer(p)).Frc & 0xff)
- isSpecialError = (crt.Bool32((((mrc == 7) || (mrc == 10)) ||
+ isSpecialError = (libc.Bool32((((mrc == 7) || (mrc == 10)) ||
(mrc == 9)) || (mrc == 13)))
if isSpecialError != 0 {
// If the query was read-only and the error code is SQLITE_INTERRUPT,
@@ -53809,7 +55798,7 @@ func Xsqlite3VdbeHalt(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:80571:20: */
// above has occurred.
if (!(((*Sqlite3)(unsafe.Pointer((db))).FnVTrans > 0) && ((*Sqlite3)(unsafe.Pointer((db))).FaVTrans == uintptr(0))) &&
((*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0)) &&
- ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite == (crt.Bool32(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.readOnly */))&0x80>>7) == 0))) {
+ ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite == (libc.Bool32(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.readOnly */))&0x80>>7) == 0))) {
if ((*Vdbe)(unsafe.Pointer(p)).Frc == 0) || ((int32((*Vdbe)(unsafe.Pointer(p)).FerrorAction) == 3) && !(isSpecialError != 0)) {
rc = Xsqlite3VdbeCheckFk(tls, p, 1)
if rc != 0 {
@@ -53835,7 +55824,7 @@ func Xsqlite3VdbeHalt(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:80571:20: */
} else {
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0)
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0)
- *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(crt.Uint64FromUint64(uint64(0x00080000))))
+ *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(libc.Uint64FromUint64(uint64(0x00080000))))
Xsqlite3CommitInternalChanges(tls, db)
}
} else {
@@ -53925,7 +55914,7 @@ func Xsqlite3VdbeHalt(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:80571:20: */
// Each VDBE holds the result of the most recent sqlite3_step() call
// in p->rc. This routine sets that result back to SQLITE_OK.
-func Xsqlite3VdbeResetStepResult(tls *crt.TLS, p uintptr) { /* sqlite3.c:80772:21: */
+func Xsqlite3VdbeResetStepResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:80962:21: */
(*Vdbe)(unsafe.Pointer(p)).Frc = 0
}
@@ -53935,7 +55924,7 @@ func Xsqlite3VdbeResetStepResult(tls *crt.TLS, p uintptr) { /* sqlite3.c:80772:2
//
// This function does not clear the VDBE error code or message, just
// copies them to the database handle.
-func Xsqlite3VdbeTransferError(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:80784:20: */
+func Xsqlite3VdbeTransferError(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:80974:20: */
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
var rc int32 = (*Vdbe)(unsafe.Pointer(p)).Frc
if (*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0 {
@@ -53944,7 +55933,7 @@ func Xsqlite3VdbeTransferError(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:807
if (*Sqlite3)(unsafe.Pointer(db)).FpErr == uintptr(0) {
(*Sqlite3)(unsafe.Pointer(db)).FpErr = Xsqlite3ValueNew(tls, db)
}
- Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, uint8(1), crt.UintptrFromInt32(-1))
+ Xsqlite3ValueSetStr(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr, -1, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, uint8(1), libc.UintptrFromInt32(-1))
Xsqlite3EndBenignMalloc(tls)
(*Sqlite3)(unsafe.Pointer(db)).FbBenignMalloc--
} else if (*Sqlite3)(unsafe.Pointer(db)).FpErr != 0 {
@@ -53963,7 +55952,7 @@ func Xsqlite3VdbeTransferError(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:807
// To look at it another way, this routine resets the state of the
// virtual machine from VDBE_MAGIC_RUN or VDBE_MAGIC_HALT back to
// VDBE_MAGIC_INIT.
-func Xsqlite3VdbeReset(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:80833:20: */
+func Xsqlite3VdbeReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81023:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -53981,9 +55970,13 @@ func Xsqlite3VdbeReset(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:80833:20: *
// instructions yet, leave the main database error information unchanged.
if (*Vdbe)(unsafe.Pointer(p)).Fpc >= 0 {
- Xsqlite3VdbeTransferError(tls, p)
+ if ((*Sqlite3)(unsafe.Pointer(db)).FpErr != 0) || ((*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0) {
+ Xsqlite3VdbeTransferError(tls, p)
+ } else {
+ (*Sqlite3)(unsafe.Pointer(db)).FerrCode = (*Vdbe)(unsafe.Pointer(p)).Frc
+ }
if Bft(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.runOnlyOnce */))&0x20>>5)) != 0 {
- crt.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(1), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(1), 0, 0x3)
}
} else if ((*Vdbe)(unsafe.Pointer(p)).Frc != 0) && (Bft(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.expired */))&0x3>>0)) != 0) {
// The expired flag was set on the VDBE before the first call
@@ -53991,15 +55984,17 @@ func Xsqlite3VdbeReset(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:80833:20: *
// called), set the database error in this case as well.
Xsqlite3ErrorWithMsg(tls, db, (*Vdbe)(unsafe.Pointer(p)).Frc, func() uintptr {
if (*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0 {
- return ts + 696 /* "%s" */
+ return ts + 805 /* "%s" */
}
return uintptr(0)
- }(), crt.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
+ }(), libc.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
}
// Reset register contents and reclaim error message memory.
- Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
- (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = uintptr(0)
+ if (*Vdbe)(unsafe.Pointer(p)).FzErrMsg != 0 {
+ Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
+ (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = uintptr(0)
+ }
(*Vdbe)(unsafe.Pointer(p)).FpResultSet = uintptr(0)
// Save profiling information from this VDBE run.
@@ -54009,7 +56004,7 @@ func Xsqlite3VdbeReset(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:80833:20: *
// Clean up and delete a VDBE after execution. Return an integer which is
// the result code. Write any error message text into *pzErrMsg.
-func Xsqlite3VdbeFinalize(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:80924:20: */
+func Xsqlite3VdbeFinalize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81120:20: */
var rc int32 = 0
if ((*Vdbe)(unsafe.Pointer(p)).Fmagic == U32(0x2df20da3)) || ((*Vdbe)(unsafe.Pointer(p)).Fmagic == U32(0x319c2973)) {
rc = Xsqlite3VdbeReset(tls, p)
@@ -54032,7 +56027,7 @@ func Xsqlite3VdbeFinalize(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:80924:20
//
// * the corresponding bit in argument mask is clear (where the first
// function parameter corresponds to bit 0 etc.).
-func Xsqlite3VdbeDeleteAuxData(tls *crt.TLS, db uintptr, pp uintptr, iOp int32, mask int32) { /* sqlite3.c:80950:21: */
+func Xsqlite3VdbeDeleteAuxData(tls *libc.TLS, db uintptr, pp uintptr, iOp int32, mask int32) { /* sqlite3.c:81146:21: */
for *(*uintptr)(unsafe.Pointer(pp)) != 0 {
var pAux uintptr = *(*uintptr)(unsafe.Pointer(pp))
if (iOp < 0) ||
@@ -54041,7 +56036,7 @@ func Xsqlite3VdbeDeleteAuxData(tls *crt.TLS, db uintptr, pp uintptr, iOp int32,
(((*AuxData)(unsafe.Pointer(pAux)).FiAuxArg > 31) || !((uint32(mask) & (uint32((uint32(1))) << ((*AuxData)(unsafe.Pointer(pAux)).FiAuxArg))) != 0))) {
if (*AuxData)(unsafe.Pointer(pAux)).FxDeleteAux != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pAux + 16 /* &.xDeleteAux */))))(tls, (*AuxData)(unsafe.Pointer(pAux)).FpAux)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pAux + 16 /* &.xDeleteAux */))))(tls, (*AuxData)(unsafe.Pointer(pAux)).FpAux)
}
*(*uintptr)(unsafe.Pointer(pp)) = (*AuxData)(unsafe.Pointer(pAux)).FpNextAux
Xsqlite3DbFree(tls, db, pAux)
@@ -54057,11 +56052,11 @@ func Xsqlite3VdbeDeleteAuxData(tls *crt.TLS, db uintptr, pp uintptr, iOp int32,
// The difference between this function and sqlite3VdbeDelete() is that
// VdbeDelete() also unlinks the Vdbe from the list of VMs associated with
// the database connection and frees the object itself.
-func Xsqlite3VdbeClearObject(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:80978:21: */
+func Xsqlite3VdbeClearObject(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:81174:21: */
var pSub uintptr
var pNext uintptr
- releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, (int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn) * 2))
+ releaseMemArray(tls, (*Vdbe)(unsafe.Pointer(p)).FaColName, (int32((*Vdbe)(unsafe.Pointer(p)).FnResColumn) * 5))
for pSub = (*Vdbe)(unsafe.Pointer(p)).FpProgram; pSub != 0; pSub = pNext {
pNext = (*SubProgram)(unsafe.Pointer(pSub)).FpNext
vdbeFreeOpArray(tls, db, (*SubProgram)(unsafe.Pointer(pSub)).FaOp, (*SubProgram)(unsafe.Pointer(pSub)).FnOp)
@@ -54078,7 +56073,7 @@ func Xsqlite3VdbeClearObject(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c
}
// Delete an entire VDBE.
-func Xsqlite3VdbeDelete(tls *crt.TLS, p uintptr) { /* sqlite3.c:81019:21: */
+func Xsqlite3VdbeDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:81215:21: */
var db uintptr
db = (*Vdbe)(unsafe.Pointer(p)).Fdb
@@ -54101,7 +56096,7 @@ func Xsqlite3VdbeDelete(tls *crt.TLS, p uintptr) { /* sqlite3.c:81019:21: */
// The cursor "p" has a pending seek operation that has not yet been
// carried out. Seek the cursor now. If an error occurs, return
// the appropriate error code.
-func Xsqlite3VdbeFinishMoveto(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:81045:36: */
+func Xsqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81241:36: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -54114,7 +56109,7 @@ func Xsqlite3VdbeFinishMoveto(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:8104
return rc
}
if *(*int32)(unsafe.Pointer(bp /* res */)) != 0 {
- return Xsqlite3CorruptError(tls, 81055)
+ return Xsqlite3CorruptError(tls, 81251)
}
Xsqlite3_search_count++
(*VdbeCursor)(unsafe.Pointer(p)).FdeferredMoveto = U8(0)
@@ -54127,7 +56122,7 @@ func Xsqlite3VdbeFinishMoveto(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:8104
// rebalanced. Whatever the cause, try to restore "p" to the place it
// is supposed to be pointing. If the row was deleted out from under the
// cursor, set the cursor to point to a NULL row.
-func handleMovedCursor(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:81071:28: */
+func handleMovedCursor(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81267:28: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -54145,7 +56140,7 @@ func handleMovedCursor(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:81071:28: *
// Check to ensure that the cursor is valid. Restore the cursor
// if need be. Return any I/O error from the restore operation.
-func Xsqlite3VdbeCursorRestore(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:81086:20: */
+func Xsqlite3VdbeCursorRestore(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:81282:20: */
if Xsqlite3BtreeCursorHasMoved(tls, *(*uintptr)(unsafe.Pointer(p + 56 /* &.uc */))) != 0 {
return handleMovedCursor(tls, p)
@@ -54164,14 +56159,14 @@ func Xsqlite3VdbeCursorRestore(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:810
//
// If the cursor is already pointing to the correct row and that row has
// not been deleted out from under the cursor, then this routine is a no-op.
-func Xsqlite3VdbeCursorMoveto(tls *crt.TLS, pp uintptr, piCol uintptr) int32 { /* sqlite3.c:81107:20: */
+func Xsqlite3VdbeCursorMoveto(tls *libc.TLS, pp uintptr, piCol uintptr) int32 { /* sqlite3.c:81303:20: */
var p uintptr = *(*uintptr)(unsafe.Pointer(pp))
if (*VdbeCursor)(unsafe.Pointer(p)).FdeferredMoveto != 0 {
- var iMap int32
- if (((*VdbeCursor)(unsafe.Pointer(p)).FaAltMap != 0) && ((crt.AssignInt32(&iMap, *(*int32)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(p)).FaAltMap + uintptr((1+*(*int32)(unsafe.Pointer(piCol))))*4)))) > 0)) && !(int32((*VdbeCursor)(unsafe.Pointer(p)).FnullRow) != 0) {
+ var iMap U32
+ if (((*VdbeCursor)(unsafe.Pointer(p)).FaAltMap != 0) && ((libc.AssignUint32(&iMap, *(*U32)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(p)).FaAltMap + uintptr((U32(1)+*(*U32)(unsafe.Pointer(piCol))))*4)))) > U32(0))) && !(int32((*VdbeCursor)(unsafe.Pointer(p)).FnullRow) != 0) {
*(*uintptr)(unsafe.Pointer(pp)) = (*VdbeCursor)(unsafe.Pointer(p)).FpAltCursor
- *(*int32)(unsafe.Pointer(piCol)) = (iMap - 1)
+ *(*U32)(unsafe.Pointer(piCol)) = (iMap - U32(1))
return 0
}
return Xsqlite3VdbeFinishMoveto(tls, p)
@@ -54224,7 +56219,7 @@ func Xsqlite3VdbeCursorMoveto(tls *crt.TLS, pp uintptr, piCol uintptr) int32 { /
// The sizes for serial types less than 128
var sqlite3SmallTypeSizes = [128]U8{
- /* 0 1 2 3 4 5 6 7 8 9 */
+ // 0 1 2 3 4 5 6 7 8 9
/* 0 */ U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(8), U8(0), U8(0),
/* 10 */ U8(0), U8(0), U8(0), U8(0), U8(1), U8(1), U8(2), U8(2), U8(3), U8(3),
/* 20 */ U8(4), U8(4), U8(5), U8(5), U8(6), U8(6), U8(7), U8(7), U8(8), U8(8),
@@ -54238,10 +56233,10 @@ var sqlite3SmallTypeSizes = [128]U8{
/* 100 */ U8(44), U8(44), U8(45), U8(45), U8(46), U8(46), U8(47), U8(47), U8(48), U8(48),
/* 110 */ U8(49), U8(49), U8(50), U8(50), U8(51), U8(51), U8(52), U8(52), U8(53), U8(53),
/* 120 */ U8(54), U8(54), U8(55), U8(55), U8(56), U8(56), U8(57), U8(57),
-} /* sqlite3.c:81243:17 */
+} /* sqlite3.c:81439:17 */
// Return the length of the data corresponding to the supplied serial-type.
-func Xsqlite3VdbeSerialTypeLen(tls *crt.TLS, serial_type U32) U32 { /* sqlite3.c:81263:20: */
+func Xsqlite3VdbeSerialTypeLen(tls *libc.TLS, serial_type U32) U32 { /* sqlite3.c:81459:20: */
if serial_type >= U32(128) {
return ((serial_type - U32(12)) / U32(2))
} else {
@@ -54250,7 +56245,7 @@ func Xsqlite3VdbeSerialTypeLen(tls *crt.TLS, serial_type U32) U32 { /* sqlite3.c
}
return U32(0)
}
-func Xsqlite3VdbeOneByteSerialTypeLen(tls *crt.TLS, serial_type U8) U8 { /* sqlite3.c:81272:19: */
+func Xsqlite3VdbeOneByteSerialTypeLen(tls *libc.TLS, serial_type U8) U8 { /* sqlite3.c:81468:19: */
return sqlite3SmallTypeSizes[serial_type]
}
@@ -54288,20 +56283,18 @@ func Xsqlite3VdbeOneByteSerialTypeLen(tls *crt.TLS, serial_type U8) U8 { /* sqli
// verify this, but Frank seems to know what he is talking about
// so we trust him.
-/*
-** Write the serialized data blob for the value stored in pMem into
-** buf. It is assumed that the caller has allocated sufficient space.
-** Return the number of bytes written.
-**
-** nBuf is the amount of space left in buf[]. The caller is responsible
-** for allocating enough space to buf[] to hold the entire field, exclusive
-** of the pMem->u.nZero bytes for a MEM_Zero value.
-**
-** Return the number of bytes actually written into buf[]. The number
-** of bytes in the zero-filled tail is included in the return value only
-** if those bytes were zeroed in buf[].
- */
-func Xsqlite3VdbeSerialPut(tls *crt.TLS, buf uintptr, pMem uintptr, serial_type U32) U32 { /* sqlite3.c:81343:20: */
+// Write the serialized data blob for the value stored in pMem into
+// buf. It is assumed that the caller has allocated sufficient space.
+// Return the number of bytes written.
+//
+// nBuf is the amount of space left in buf[]. The caller is responsible
+// for allocating enough space to buf[] to hold the entire field, exclusive
+// of the pMem->u.nZero bytes for a MEM_Zero value.
+//
+// Return the number of bytes actually written into buf[]. The number
+// of bytes in the zero-filled tail is included in the return value only
+// if those bytes were zeroed in buf[].
+func Xsqlite3VdbeSerialPut(tls *libc.TLS, buf uintptr, pMem uintptr, serial_type U32) U32 { /* sqlite3.c:81539:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -54314,14 +56307,14 @@ func Xsqlite3VdbeSerialPut(tls *crt.TLS, buf uintptr, pMem uintptr, serial_type
var i U32
if serial_type == U32(7) {
- crt.Xmemcpy(tls, bp /* &v */, (pMem /* &.u */ /* &.r */), uint64(unsafe.Sizeof(U64(0))))
+ libc.Xmemcpy(tls, bp /* &v */, (pMem /* &.u */ /* &.r */), uint64(unsafe.Sizeof(U64(0))))
} else {
*(*U64)(unsafe.Pointer(bp /* v */)) = U64(*(*I64)(unsafe.Pointer(pMem /* &.u */)))
}
- len = crt.AssignUint32(&i, U32(sqlite3SmallTypeSizes[serial_type]))
+ len = libc.AssignUint32(&i, U32(sqlite3SmallTypeSizes[serial_type]))
for ok := true; ok; ok = i != 0 {
- *(*U8)(unsafe.Pointer(buf + uintptr(crt.PreDecUint32(&i, 1)))) = (U8(*(*U64)(unsafe.Pointer(bp /* v */)) & uint64(0xFF)))
+ *(*U8)(unsafe.Pointer(buf + uintptr(libc.PreDecUint32(&i, 1)))) = (U8(*(*U64)(unsafe.Pointer(bp /* v */)) & uint64(0xFF)))
*(*U64)(unsafe.Pointer(bp /* v */)) >>= 8
}
return len
@@ -54332,7 +56325,7 @@ func Xsqlite3VdbeSerialPut(tls *crt.TLS, buf uintptr, pMem uintptr, serial_type
len = U32((*Mem)(unsafe.Pointer(pMem)).Fn)
if len > U32(0) {
- crt.Xmemcpy(tls, buf, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64(len))
+ libc.Xmemcpy(tls, buf, (*Mem)(unsafe.Pointer(pMem)).Fz, uint64(len))
}
return len
}
@@ -54344,16 +56337,14 @@ func Xsqlite3VdbeSerialPut(tls *crt.TLS, buf uintptr, pMem uintptr, serial_type
// Input "x" is a sequence of unsigned characters that represent a
// big-endian integer. Return the equivalent native integer
-/*
-** Deserialize the data blob pointed to by buf as serial type serial_type
-** and store the result in pMem. Return the number of bytes read.
-**
-** This function is implemented as two separate routines for performance.
-** The few cases that require local variables are broken out into a separate
-** routine so that in most cases the overhead of moving the stack pointer
-** is avoided.
- */
-func serialGet(tls *crt.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:81397:12: */
+// Deserialize the data blob pointed to by buf as serial type serial_type
+// and store the result in pMem. Return the number of bytes read.
+//
+// This function is implemented as two separate routines for performance.
+// The few cases that require local variables are broken out into a separate
+// routine so that in most cases the overhead of moving the stack pointer
+// is avoided.
+func serialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:81593:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -54369,7 +56360,7 @@ func serialGet(tls *crt.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /
// EVIDENCE-OF: R-57343-49114 Value is a big-endian IEEE 754-2008 64-bit
// floating point number.
- crt.Xmemcpy(tls, (pMem /* &.u */ /* &.r */), bp /* &x */, uint64(unsafe.Sizeof(U64(0))))
+ libc.Xmemcpy(tls, (pMem /* &.u */ /* &.r */), bp /* &x */, uint64(unsafe.Sizeof(U64(0))))
(*Mem)(unsafe.Pointer(pMem)).Fflags = func() uint16 {
if (((*(*U64)(unsafe.Pointer(bp /* x */))) & (U64((uint64(0x7ff))) << 52)) == (U64((uint64(0x7ff))) << 52)) && (((*(*U64)(unsafe.Pointer(bp /* x */))) & ((U64((uint64(1))) << 52) - uint64(1))) != uint64(0)) {
return uint16(0x0001)
@@ -54379,7 +56370,7 @@ func serialGet(tls *crt.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /
}
return U32(8)
}
-func Xsqlite3VdbeSerialGet(tls *crt.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:81433:20: */
+func Xsqlite3VdbeSerialGet(tls *libc.TLS, buf uintptr, serial_type U32, pMem uintptr) U32 { /* sqlite3.c:81629:20: */
switch serial_type {
case U32(10):
{ // Internal use only: NULL with virtual table
@@ -54471,7 +56462,7 @@ func Xsqlite3VdbeSerialGet(tls *crt.TLS, buf uintptr, serial_type U32, pMem uint
return U32(0)
}
-var aFlag = [2]U16{(U16(0x0010 | 0x1000)), (U16(0x0002 | 0x1000))} /* sqlite3.c:81515:24 */
+var aFlag = [2]U16{(U16(0x0010 | 0x1000)), (U16(0x0002 | 0x1000))} /* sqlite3.c:81711:24 */
// This routine is used to allocate sufficient space for an UnpackedRecord
// structure large enough to be used with sqlite3VdbeRecordUnpack() if
// the first argument is a pointer to KeyInfo structure pKeyInfo.
@@ -54484,27 +56475,25 @@ var aFlag = [2]U16{(U16(0x0010 | 0x1000)), (U16(0x0002 | 0x1000))} /* sqlite3.c:
// before returning.
//
// If an OOM error occurs, NULL is returned.
-func Xsqlite3VdbeAllocUnpackedRecord(tls *crt.TLS, pKeyInfo uintptr) uintptr { /* sqlite3.c:81538:31: */
+func Xsqlite3VdbeAllocUnpackedRecord(tls *libc.TLS, pKeyInfo uintptr) uintptr { /* sqlite3.c:81734:31: */
var p uintptr // Unpacked record to return
var nByte int32 // Number of bytes required for *p
- nByte = (int32((((uint64(unsafe.Sizeof(UnpackedRecord{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))) + (uint64(unsafe.Sizeof(Mem{})) * (uint64(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + 1)))))
+ nByte = (int32((((uint64(unsafe.Sizeof(UnpackedRecord{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))) + (uint64(unsafe.Sizeof(Mem{})) * (uint64(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + 1)))))
p = Xsqlite3DbMallocRaw(tls, (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb, uint64(nByte))
if !(p != 0) {
return uintptr(0)
}
- (*UnpackedRecord)(unsafe.Pointer(p)).FaMem = ((p) + uintptr((((uint64(unsafe.Sizeof(UnpackedRecord{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7)))))
+ (*UnpackedRecord)(unsafe.Pointer(p)).FaMem = ((p) + uintptr((((uint64(unsafe.Sizeof(UnpackedRecord{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7)))))
(*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo = pKeyInfo
(*UnpackedRecord)(unsafe.Pointer(p)).FnField = (U16(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + 1))
return p
}
-/*
-** Given the nKey-byte encoding of a record in pKey[], populate the
-** UnpackedRecord structure indicated by the fourth argument with the
-** contents of the decoded record.
- */
-func Xsqlite3VdbeRecordUnpack(tls *crt.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr, p uintptr) { /* sqlite3.c:81558:21: */
+// Given the nKey-byte encoding of a record in pKey[], populate the
+// UnpackedRecord structure indicated by the fourth argument with the
+// contents of the decoded record.
+func Xsqlite3VdbeRecordUnpack(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr, p uintptr) { /* sqlite3.c:81754:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -54548,7 +56537,7 @@ func Xsqlite3VdbeRecordUnpack(tls *crt.TLS, pKeyInfo uintptr, nKey int32, pKey u
(*Mem)(unsafe.Pointer(pMem)).Fz = uintptr(0)
d = d + (Xsqlite3VdbeSerialGet(tls, (aKey + uintptr(d)), *(*U32)(unsafe.Pointer(bp + 4 /* serial_type */)), pMem))
pMem += 56
- if (int32(crt.PreIncUint16(&u, 1))) >= int32((*UnpackedRecord)(unsafe.Pointer(p)).FnField) {
+ if (int32(libc.PreIncUint16(&u, 1))) >= int32((*UnpackedRecord)(unsafe.Pointer(p)).FnField) {
break
}
}
@@ -54567,14 +56556,14 @@ func Xsqlite3VdbeRecordUnpack(tls *crt.TLS, pKeyInfo uintptr, nKey int32, pKey u
// using the collation sequence pColl. As usual, return a negative , zero
// or positive value if *pMem1 is less than, equal to or greater than
// *pMem2, respectively. Similar in spirit to "rc = (*pMem1) - (*pMem2);".
-func vdbeCompareMemString(tls *crt.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr, prcErr uintptr) int32 { /* sqlite3.c:81753:12: */
+func vdbeCompareMemString(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr, prcErr uintptr) int32 { /* sqlite3.c:81949:12: */
bp := tls.Alloc(112)
defer tls.Free(112)
if int32((*Mem)(unsafe.Pointer(pMem1)).Fenc) == int32((*CollSeq)(unsafe.Pointer(pColl)).Fenc) {
// The strings are already in the correct encoding. Call the
// comparison function directly
- return (*(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer((pColl + 24 /* &.xCmp */))))(tls, (*CollSeq)(unsafe.Pointer(pColl)).FpUser, (*Mem)(unsafe.Pointer(pMem1)).Fn, (*Mem)(unsafe.Pointer(pMem1)).Fz, (*Mem)(unsafe.Pointer(pMem2)).Fn, (*Mem)(unsafe.Pointer(pMem2)).Fz)
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer((pColl + 24 /* &.xCmp */))))(tls, (*CollSeq)(unsafe.Pointer(pColl)).FpUser, (*Mem)(unsafe.Pointer(pMem1)).Fn, (*Mem)(unsafe.Pointer(pMem1)).Fz, (*Mem)(unsafe.Pointer(pMem2)).Fn, (*Mem)(unsafe.Pointer(pMem2)).Fz)
} else {
var rc int32
var v1 uintptr
@@ -54595,7 +56584,7 @@ func vdbeCompareMemString(tls *crt.TLS, pMem1 uintptr, pMem2 uintptr, pColl uint
}
rc = 0
} else {
- rc = (*(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer((pColl + 24 /* &.xCmp */))))(tls, (*CollSeq)(unsafe.Pointer(pColl)).FpUser, (*Mem)(unsafe.Pointer(bp /* &c1 */)).Fn, v1, (*Mem)(unsafe.Pointer(bp+56 /* &c2 */)).Fn, v2)
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer((pColl + 24 /* &.xCmp */))))(tls, (*CollSeq)(unsafe.Pointer(pColl)).FpUser, (*Mem)(unsafe.Pointer(bp /* &c1 */)).Fn, v1, (*Mem)(unsafe.Pointer(bp+56 /* &c2 */)).Fn, v2)
}
Xsqlite3VdbeMemRelease(tls, bp /* &c1 */)
Xsqlite3VdbeMemRelease(tls, bp+56 /* &c2 */)
@@ -54606,7 +56595,7 @@ func vdbeCompareMemString(tls *crt.TLS, pMem1 uintptr, pMem2 uintptr, pColl uint
// The input pBlob is guaranteed to be a Blob that is not marked
// with MEM_Zero. Return true if it could be a zero-blob.
-func isAllZero(tls *crt.TLS, z uintptr, n int32) int32 { /* sqlite3.c:81790:12: */
+func isAllZero(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:81986:12: */
var i int32
for i = 0; i < n; i++ {
if *(*int8)(unsafe.Pointer(z + uintptr(i))) != 0 {
@@ -54619,7 +56608,7 @@ func isAllZero(tls *crt.TLS, z uintptr, n int32) int32 { /* sqlite3.c:81790:12:
// Compare two blobs. Return negative, zero, or positive if the first
// is less than, equal to, or greater than the second, respectively.
// If one blob is a prefix of the other, then the shorter is the lessor.
-func Xsqlite3BlobCompare(tls *crt.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sqlite3.c:81803:36: */
+func Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sqlite3.c:81999:36: */
var c int32
var n1 int32 = (*Mem)(unsafe.Pointer(pB1)).Fn
var n2 int32 = (*Mem)(unsafe.Pointer(pB2)).Fn
@@ -54644,7 +56633,7 @@ func Xsqlite3BlobCompare(tls *crt.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sqli
return (n1 - *(*int32)(unsafe.Pointer(pB2 /* &.u */)))
}
}
- c = crt.Xmemcmp(tls, (*Mem)(unsafe.Pointer(pB1)).Fz, (*Mem)(unsafe.Pointer(pB2)).Fz, func() uint64 {
+ c = libc.Xmemcmp(tls, (*Mem)(unsafe.Pointer(pB1)).Fz, (*Mem)(unsafe.Pointer(pB2)).Fz, func() uint64 {
if n1 > n2 {
return uint64(n2)
}
@@ -54659,7 +56648,7 @@ func Xsqlite3BlobCompare(tls *crt.TLS, pB1 uintptr, pB2 uintptr) int32 { /* sqli
// Do a comparison between a 64-bit signed integer and a 64-bit floating-point
// number. Return negative, zero, or positive if the first (i64) is less than,
// equal to, or greater than the second (double).
-func sqlite3IntFloatCompare(tls *crt.TLS, i I64, r float64) int32 { /* sqlite3.c:81836:12: */
+func sqlite3IntFloatCompare(tls *libc.TLS, i I64, r float64) int32 { /* sqlite3.c:82032:12: */
if uint64(unsafe.Sizeof(float64(0))) > uint64(8) {
var x float64 = float64(i)
if x < r {
@@ -54704,7 +56693,7 @@ func sqlite3IntFloatCompare(tls *crt.TLS, i I64, r float64) int32 { /* sqlite3.c
// sequence pColl and finally blob's ordered by memcmp().
//
// Two NULL values are considered equal by this function.
-func Xsqlite3MemCompare(tls *crt.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr) int32 { /* sqlite3.c:81866:20: */
+func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr) int32 { /* sqlite3.c:82062:20: */
var f1 int32
var f2 int32
var combined_flags int32
@@ -54796,7 +56785,7 @@ func Xsqlite3MemCompare(tls *crt.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintpt
// except 7. The second points to a buffer containing an integer value
// serialized according to serial_type. This function deserializes
// and returns the value.
-func vdbeRecordDecodeInt(tls *crt.TLS, serial_type U32, aKey uintptr) I64 { /* sqlite3.c:81965:12: */
+func vdbeRecordDecodeInt(tls *libc.TLS, serial_type U32, aKey uintptr) I64 { /* sqlite3.c:82161:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -54856,7 +56845,7 @@ func vdbeRecordDecodeInt(tls *crt.TLS, serial_type U32, aKey uintptr) I64 { /* s
// SQLITE_CORRUPT and return 0. If an OOM error is encountered,
// pPKey2->errCode is set to SQLITE_NOMEM and, if it is not NULL, the
// malloc-failed flag set on database handle (pPKey2->pKeyInfo->db).
-func Xsqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr, bSkip int32) int32 { /* sqlite3.c:82020:20: */
+func Xsqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr, bSkip int32) int32 { /* sqlite3.c:82216:20: */
bp := tls.Alloc(68)
defer tls.Free(68)
@@ -54904,7 +56893,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, nKey1 int32, pKey1 uintptr,
i = 0
}
if d1 > uint32(nKey1) {
- (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82051))
+ (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82247))
return 0
}
@@ -54968,8 +56957,8 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, nKey1 int32, pKey1 uintptr,
(*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fn = (int32((*(*U32)(unsafe.Pointer(bp + 64 /* serial_type */)) - U32(12)) / U32(2)))
if ((d1 + U32((*Mem)(unsafe.Pointer(bp+8 /* &mem1 */)).Fn)) > uint32(nKey1)) ||
- (int32((*KeyInfo)(unsafe.Pointer((crt.AssignUintptr(&pKeyInfo, (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo)))).FnAllField) <= i) {
- (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82128))
+ (int32((*KeyInfo)(unsafe.Pointer((libc.AssignUintptr(&pKeyInfo, (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FpKeyInfo)))).FnAllField) <= i) {
+ (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82324))
return 0
} else if *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(i)*8)) != 0 {
(*Mem)(unsafe.Pointer(bp + 8 /* &mem1 */)).Fenc = (*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fenc
@@ -54985,7 +56974,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, nKey1 int32, pKey1 uintptr,
}
return (*Mem)(unsafe.Pointer(pRhs)).Fn
}()
- rc = crt.Xmemcmp(tls, (aKey1 + uintptr(d1)), (*Mem)(unsafe.Pointer(pRhs)).Fz, uint64(nCmp))
+ rc = libc.Xmemcmp(tls, (aKey1 + uintptr(d1)), (*Mem)(unsafe.Pointer(pRhs)).Fz, uint64(nCmp))
if rc == 0 {
rc = ((*Mem)(unsafe.Pointer(bp+8 /* &mem1 */)).Fn - (*Mem)(unsafe.Pointer(pRhs)).Fn)
}
@@ -55004,7 +56993,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, nKey1 int32, pKey1 uintptr,
var nStr int32 = (int32((*(*U32)(unsafe.Pointer(bp + 64 /* serial_type */)) - U32(12)) / U32(2)))
if (d1 + U32(nStr)) > uint32(nKey1) {
- (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82158))
+ (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82354))
return 0
} else if (int32((*Mem)(unsafe.Pointer(pRhs)).Fflags) & 0x4000) != 0 {
if !(isAllZero(tls, (aKey1+uintptr(d1)), nStr) != 0) {
@@ -55019,7 +57008,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, nKey1 int32, pKey1 uintptr,
}
return (*Mem)(unsafe.Pointer(pRhs)).Fn
}()
- rc = crt.Xmemcmp(tls, (aKey1 + uintptr(d1)), (*Mem)(unsafe.Pointer(pRhs)).Fz, uint64(nCmp))
+ rc = libc.Xmemcmp(tls, (aKey1 + uintptr(d1)), (*Mem)(unsafe.Pointer(pRhs)).Fz, uint64(nCmp))
if rc == 0 {
rc = (nStr - (*Mem)(unsafe.Pointer(pRhs)).Fn)
}
@@ -55027,7 +57016,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, nKey1 int32, pKey1 uintptr,
}
} else {
*(*U32)(unsafe.Pointer(bp + 64 /* serial_type */)) = U32(*(*uint8)(unsafe.Pointer(aKey1 + uintptr(idx1))))
- rc = (crt.Bool32(*(*U32)(unsafe.Pointer(bp + 64 /* serial_type */)) != U32(0)))
+ rc = (libc.Bool32(*(*U32)(unsafe.Pointer(bp + 64 /* serial_type */)) != U32(0)))
}
if rc != 0 {
@@ -55035,7 +57024,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, nKey1 int32, pKey1 uintptr,
if sortFlags != 0 {
if ((sortFlags & 0x02) == 0) ||
((sortFlags & 0x01) !=
- (crt.Bool32((*(*U32)(unsafe.Pointer(bp + 64 /* serial_type */)) == U32(0)) || ((int32((*Mem)(unsafe.Pointer(pRhs)).Fflags) & 0x0001) != 0)))) {
+ (libc.Bool32((*(*U32)(unsafe.Pointer(bp + 64 /* serial_type */)) == U32(0)) || ((int32((*Mem)(unsafe.Pointer(pRhs)).Fflags) & 0x0001) != 0)))) {
rc = -rc
}
}
@@ -55064,7 +57053,7 @@ func Xsqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, nKey1 int32, pKey1 uintptr,
(*UnpackedRecord)(unsafe.Pointer(pPKey2)).FeqSeen = U8(1)
return int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fdefault_rc)
}
-func Xsqlite3VdbeRecordCompare(tls *crt.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:82217:20: */
+func Xsqlite3VdbeRecordCompare(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:82413:20: */
return Xsqlite3VdbeRecordCompareWithSkip(tls, nKey1, pKey1, pPKey2, 0)
}
@@ -55075,7 +57064,7 @@ func Xsqlite3VdbeRecordCompare(tls *crt.TLS, nKey1 int32, pKey1 uintptr, pPKey2
//
// To avoid concerns about buffer overreads, this routine is only used
// on schemas where the maximum valid header size is 63 bytes or less.
-func vdbeRecordCompareInt(tls *crt.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:82234:12: */
+func vdbeRecordCompareInt(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:82430:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -55136,12 +57125,12 @@ func vdbeRecordCompareInt(tls *crt.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintp
lhs = int64(1)
break
- /* This case could be removed without changing the results of running
- ** this code. Including it causes gcc to generate a faster switch
- ** statement (since the range of switch targets now starts at zero and
- ** is contiguous) but does not cause any duplicate code to be generated
- ** (as gcc is clever enough to combine the two like cases). Other
- ** compilers might be similar. */
+ // This case could be removed without changing the results of running
+ // this code. Including it causes gcc to generate a faster switch
+ // statement (since the range of switch targets now starts at zero and
+ // is contiguous) but does not cause any duplicate code to be generated
+ // (as gcc is clever enough to combine the two like cases). Other
+ // compilers might be similar.
case 0:
fallthrough
case 7:
@@ -55174,7 +57163,7 @@ func vdbeRecordCompareInt(tls *crt.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintp
// that (a) the first field of pPKey2 is a string, that (b) the first field
// uses the collation sequence BINARY and (c) that the size-of-header varint
// at the start of (pKey1/nKey1) fits in a single byte.
-func vdbeRecordCompareString(tls *crt.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:82328:12: */
+func vdbeRecordCompareString(tls *libc.TLS, nKey1 int32, pKey1 uintptr, pPKey2 uintptr) int32 { /* sqlite3.c:82524:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -55198,7 +57187,7 @@ func vdbeRecordCompareString(tls *crt.TLS, nKey1 int32, pKey1 uintptr, pPKey2 ui
nStr = ((*(*int32)(unsafe.Pointer(bp /* serial_type */)) - 12) / 2)
if (szHdr + nStr) > nKey1 {
- (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82353))
+ (*UnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = U8(Xsqlite3CorruptError(tls, 82549))
return 0
}
nCmp = func() int32 {
@@ -55207,7 +57196,7 @@ func vdbeRecordCompareString(tls *crt.TLS, nKey1 int32, pKey1 uintptr, pPKey2 ui
}
return nStr
}()
- res = crt.Xmemcmp(tls, (aKey1 + uintptr(szHdr)), (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FaMem+uintptr(0)*56)).Fz, uint64(nCmp))
+ res = libc.Xmemcmp(tls, (aKey1 + uintptr(szHdr)), (*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pPKey2)).FaMem+uintptr(0)*56)).Fz, uint64(nCmp))
if res > 0 {
res = int32((*UnpackedRecord)(unsafe.Pointer(pPKey2)).Fr2)
@@ -55236,7 +57225,7 @@ func vdbeRecordCompareString(tls *crt.TLS, nKey1 int32, pKey1 uintptr, pPKey2 ui
// Return a pointer to an sqlite3VdbeRecordCompare() compatible function
// suitable for comparing serialized records to the unpacked record passed
// as the only argument.
-func Xsqlite3VdbeFindCompare(tls *crt.TLS, p uintptr) RecordCompare { /* sqlite3.c:82392:30: */
+func Xsqlite3VdbeFindCompare(tls *libc.TLS, p uintptr) RecordCompare { /* sqlite3.c:82588:30: */
// varintRecordCompareInt() and varintRecordCompareString() both assume
// that the size-of-header varint that occurs at the start of each record
// fits in a single byte (i.e. is 127 or less). varintRecordCompareInt()
@@ -55255,7 +57244,7 @@ func Xsqlite3VdbeFindCompare(tls *crt.TLS, p uintptr) RecordCompare { /* sqlite3
if *(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FaSortFlags + uintptr(0))) != 0 {
if (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo)).FaSortFlags + uintptr(0)))) & 0x02) != 0 {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, int32, uintptr, uintptr) int32
}{Xsqlite3VdbeRecordCompare}))
}
(*UnpackedRecord)(unsafe.Pointer(p)).Fr1 = int8(1)
@@ -55266,7 +57255,7 @@ func Xsqlite3VdbeFindCompare(tls *crt.TLS, p uintptr) RecordCompare { /* sqlite3
}
if (flags & 0x0004) != 0 {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, int32, uintptr, uintptr) int32
}{vdbeRecordCompareInt}))
}
@@ -55274,13 +57263,13 @@ func Xsqlite3VdbeFindCompare(tls *crt.TLS, p uintptr) RecordCompare { /* sqlite3
(*(*uintptr)(unsafe.Pointer(((*UnpackedRecord)(unsafe.Pointer(p)).FpKeyInfo + 32 /* &.aColl */) + uintptr(0)*8)) == uintptr(0)) {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, int32, uintptr, uintptr) int32
}{vdbeRecordCompareString}))
}
}
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, int32, uintptr, uintptr) int32
}{Xsqlite3VdbeRecordCompare}))
}
@@ -55290,7 +57279,7 @@ func Xsqlite3VdbeFindCompare(tls *crt.TLS, p uintptr) RecordCompare { /* sqlite3
//
// pCur might be pointing to text obtained from a corrupt database file.
// So the content cannot be trusted. Do appropriate checks on the content.
-func Xsqlite3VdbeIdxRowid(tls *crt.TLS, db uintptr, pCur uintptr, rowid uintptr) int32 { /* sqlite3.c:82443:20: */
+func Xsqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr) int32 { /* sqlite3.c:82639:20: */
bp := tls.Alloc(120)
defer tls.Free(120)
@@ -55375,7 +57364,7 @@ __6:
idx_rowid_corruption:
;
Xsqlite3VdbeMemRelease(tls, bp /* &m */)
- return Xsqlite3CorruptError(tls, 82508)
+ return Xsqlite3CorruptError(tls, 82704)
}
// Compare the key of the index entry that cursor pC is pointing to against
@@ -55387,7 +57376,7 @@ idx_rowid_corruption:
// omits the rowid at the end. The rowid at the end of the index entry
// is ignored as well. Hence, this routine only compares the prefixes
// of the keys prior to the final rowid, not the entire key.
-func Xsqlite3VdbeIdxKeyCompare(tls *crt.TLS, db uintptr, pC uintptr, pUnpacked uintptr, res uintptr) int32 { /* sqlite3.c:82522:20: */
+func Xsqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked uintptr, res uintptr) int32 { /* sqlite3.c:82718:20: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -55403,7 +57392,7 @@ func Xsqlite3VdbeIdxKeyCompare(tls *crt.TLS, db uintptr, pC uintptr, pUnpacked u
// that btreeParseCellPtr() and sqlite3GetVarint32() are implemented
if (nCellKey <= int64(0)) || (nCellKey > int64(0x7fffffff)) {
*(*int32)(unsafe.Pointer(res)) = 0
- return Xsqlite3CorruptError(tls, 82541)
+ return Xsqlite3CorruptError(tls, 82737)
}
Xsqlite3VdbeMemInit(tls, bp /* &m */, db, uint16(0))
rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, U32(nCellKey), bp /* &m */)
@@ -55417,7 +57406,7 @@ func Xsqlite3VdbeIdxKeyCompare(tls *crt.TLS, db uintptr, pC uintptr, pUnpacked u
// This routine sets the value to be returned by subsequent calls to
// sqlite3_changes() on the database handle 'db'.
-func Xsqlite3VdbeSetChanges(tls *crt.TLS, db uintptr, nChange int32) { /* sqlite3.c:82557:21: */
+func Xsqlite3VdbeSetChanges(tls *libc.TLS, db uintptr, nChange int32) { /* sqlite3.c:82753:21: */
(*Sqlite3)(unsafe.Pointer(db)).FnChange = nChange
*(*int32)(unsafe.Pointer(db + 120 /* &.nTotalChange */)) += (nChange)
@@ -55425,8 +57414,8 @@ func Xsqlite3VdbeSetChanges(tls *crt.TLS, db uintptr, nChange int32) { /* sqlite
// Set a flag in the vdbe to update the change counter when it is finalised
// or reset.
-func Xsqlite3VdbeCountChanges(tls *crt.TLS, v uintptr) { /* sqlite3.c:82567:21: */
- crt.SetBitFieldPtr16Uint32(v+200 /* &.changeCntOn */, Bft(1), 4, 0x10)
+func Xsqlite3VdbeCountChanges(tls *libc.TLS, v uintptr) { /* sqlite3.c:82763:21: */
+ libc.SetBitFieldPtr16Uint32(v+200 /* &.changeCntOn */, Bft(1), 4, 0x10)
}
// Mark every prepared statement associated with a database connection
@@ -55445,20 +57434,20 @@ func Xsqlite3VdbeCountChanges(tls *crt.TLS, v uintptr) { /* sqlite3.c:82567:21:
// Internally, this function just sets the Vdbe.expired flag on all
// prepared statements. The flag is set to 1 for an immediate expiration
// and set to 2 for an advisory expiration.
-func Xsqlite3ExpirePreparedStatements(tls *crt.TLS, db uintptr, iCode int32) { /* sqlite3.c:82589:21: */
+func Xsqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32) { /* sqlite3.c:82785:21: */
var p uintptr
for p = (*Sqlite3)(unsafe.Pointer(db)).FpVdbe; p != 0; p = (*Vdbe)(unsafe.Pointer(p)).FpNext {
- crt.SetBitFieldPtr16Uint32(p+200 /* &.expired */, (Bft(iCode + 1)), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, (Bft(iCode + 1)), 0, 0x3)
}
}
// Return the database associated with the Vdbe.
-func Xsqlite3VdbeDb(tls *crt.TLS, v uintptr) uintptr { /* sqlite3.c:82599:24: */
+func Xsqlite3VdbeDb(tls *libc.TLS, v uintptr) uintptr { /* sqlite3.c:82795:24: */
return (*Vdbe)(unsafe.Pointer(v)).Fdb
}
// Return the SQLITE_PREPARE flags for a Vdbe.
-func Xsqlite3VdbePrepareFlags(tls *crt.TLS, v uintptr) U8 { /* sqlite3.c:82606:19: */
+func Xsqlite3VdbePrepareFlags(tls *libc.TLS, v uintptr) U8 { /* sqlite3.c:82802:19: */
return (*Vdbe)(unsafe.Pointer(v)).FprepFlags
}
@@ -55468,7 +57457,7 @@ func Xsqlite3VdbePrepareFlags(tls *crt.TLS, v uintptr) U8 { /* sqlite3.c:82606:1
// constants) to the value before returning it.
//
// The returned value must be freed by the caller using sqlite3ValueFree().
-func Xsqlite3VdbeGetBoundValue(tls *crt.TLS, v uintptr, iVar int32, aff U8) uintptr { /* sqlite3.c:82618:30: */
+func Xsqlite3VdbeGetBoundValue(tls *libc.TLS, v uintptr, iVar int32, aff U8) uintptr { /* sqlite3.c:82814:30: */
if v != 0 {
var pMem uintptr = ((*Vdbe)(unsafe.Pointer(v)).FaVar + uintptr((iVar-1))*56)
@@ -55488,7 +57477,7 @@ func Xsqlite3VdbeGetBoundValue(tls *crt.TLS, v uintptr, iVar int32, aff U8) uint
// Configure SQL variable iVar so that binding a new value to it signals
// to sqlite3_reoptimize() that re-preparing the statement may result
// in a better query plan.
-func Xsqlite3VdbeSetVarmask(tls *crt.TLS, v uintptr, iVar int32) { /* sqlite3.c:82640:21: */
+func Xsqlite3VdbeSetVarmask(tls *libc.TLS, v uintptr, iVar int32) { /* sqlite3.c:82836:21: */
if iVar >= 32 {
*(*U32)(unsafe.Pointer(v + 276 /* &.expmask */)) |= (0x80000000)
@@ -55504,24 +57493,27 @@ func Xsqlite3VdbeSetVarmask(tls *crt.TLS, v uintptr, iVar int32) { /* sqlite3.c:
// throw an error if it is given inputs that would make it non-deterministic.
// This routine is invoked by date/time functions that use non-deterministic
// features such as 'now'.
-func Xsqlite3NotPureFunc(tls *crt.TLS, pCtx uintptr) int32 { /* sqlite3.c:82659:20: */
+func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:82855:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
var pOp uintptr
- pOp = ((*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24)
+ if (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe == uintptr(0) {
+ return 1
+ }
+ pOp = ((*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*32)
if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == 63 {
var zContext uintptr
var zMsg uintptr
if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5) & 0x00004) != 0 {
- zContext = ts + 4665 /* "a CHECK constrai..." */
+ zContext = ts + 6863 /* "a CHECK constrai..." */
} else if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5) & 0x00008) != 0 {
- zContext = ts + 4684 /* "a generated colu..." */
+ zContext = ts + 6882 /* "a generated colu..." */
} else {
- zContext = ts + 4703 /* "an index" */
+ zContext = ts + 6901 /* "an index" */
}
- zMsg = Xsqlite3_mprintf(tls, ts+4712, /* "non-deterministi..." */
- crt.VaList(bp, (*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext))
+ zMsg = Xsqlite3_mprintf(tls, ts+6910, /* "non-deterministi..." */
+ libc.VaList(bp, (*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext))
Xsqlite3_result_error(tls, pCtx, zMsg, -1)
Xsqlite3_free(tls, zMsg)
return 0
@@ -55532,7 +57524,7 @@ func Xsqlite3NotPureFunc(tls *crt.TLS, pCtx uintptr) int32 { /* sqlite3.c:82659:
// Transfer error message text from an sqlite3_vtab.zErrMsg (text stored
// in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored
// in memory obtained from sqlite3DbMalloc).
-func Xsqlite3VtabImportErrmsg(tls *crt.TLS, p uintptr, pVtab uintptr) { /* sqlite3.c:82690:21: */
+func Xsqlite3VtabImportErrmsg(tls *libc.TLS, p uintptr, pVtab uintptr) { /* sqlite3.c:82886:21: */
if (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg != 0 {
var db uintptr = (*Vdbe)(unsafe.Pointer(p)).Fdb
Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
@@ -55542,6 +57534,80 @@ func Xsqlite3VtabImportErrmsg(tls *crt.TLS, p uintptr, pVtab uintptr) { /* sqlit
}
}
+// If the second argument is not NULL, release any allocations associated
+// with the memory cells in the p->aMem[] array. Also free the UnpackedRecord
+// structure itself, using sqlite3DbFree().
+//
+// This function is used to free UnpackedRecord structures allocated by
+// the vdbeUnpackRecord() function found in vdbeapi.c.
+func vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { /* sqlite3.c:82907:13: */
+ if p != 0 {
+ var i int32
+ for i = 0; i < nField; i++ {
+ var pMem uintptr = ((*UnpackedRecord)(unsafe.Pointer(p)).FaMem + uintptr(i)*56)
+ if (*Mem)(unsafe.Pointer(pMem)).FzMalloc != 0 {
+ Xsqlite3VdbeMemRelease(tls, pMem)
+ }
+ }
+ Xsqlite3DbFreeNN(tls, db, p)
+ }
+}
+
+// Invoke the pre-update hook. If this is an UPDATE or DELETE pre-update call,
+// then cursor passed as the second argument should point to the row about
+// to be update or deleted. If the application calls sqlite3_preupdate_old(),
+// the required value will be read from the row the cursor points to.
+func Xsqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 I64, iReg int32) { /* sqlite3.c:82926:21: */
+ bp := tls.Alloc(136)
+ defer tls.Free(136)
+
+ var db uintptr = (*Vdbe)(unsafe.Pointer(v)).Fdb
+ var iKey2 I64
+ // var preupdate PreUpdate at bp, 136
+
+ var zTbl uintptr = (*Table)(unsafe.Pointer(pTab)).FzName
+
+ libc.Xmemset(tls, bp /* &preupdate */, 0, uint64(unsafe.Sizeof(PreUpdate{})))
+ if (libc.Bool32(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0))) == 0 {
+ iKey1 = libc.AssignInt64(&iKey2, int64(0))
+ (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
+ } else {
+ if op == 23 {
+ iKey2 = *(*I64)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FaMem + uintptr(iReg)*56 /* &.u */))
+ } else {
+ iKey2 = iKey1
+ }
+ }
+
+ (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).Fv = v
+ (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpCsr = pCsr
+ (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).Fop = op
+ (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FiNewReg = iReg
+ (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).Fkeyinfo.Fdb = db
+ (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).Fkeyinfo.Fenc = (*Sqlite3)(unsafe.Pointer(db)).Fenc
+ (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).Fkeyinfo.FnKeyField = U16((*Table)(unsafe.Pointer(pTab)).FnCol)
+ (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&fakeSortOrder))
+ (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FiKey1 = iKey1
+ (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FiKey2 = iKey2
+ (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpTab = pTab
+
+ (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate = bp /* &preupdate */
+ (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Sqlite3_int64, Sqlite3_int64))(unsafe.Pointer((db + 328 /* &.xPreUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2)
+ (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0)
+ Xsqlite3DbFree(tls, db, (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FaRecord)
+ vdbeFreeUnpacked(tls, db, (int32((*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).Fkeyinfo.FnKeyField) + 1), (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpUnpacked)
+ vdbeFreeUnpacked(tls, db, (int32((*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).Fkeyinfo.FnKeyField) + 1), (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FpNewUnpacked)
+ if (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FaNew != 0 {
+ var i int32
+ for i = 0; i < int32((*VdbeCursor)(unsafe.Pointer(pCsr)).FnField); i++ {
+ Xsqlite3VdbeMemRelease(tls, ((*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FaNew + uintptr(i)*56))
+ }
+ Xsqlite3DbFreeNN(tls, db, (*PreUpdate)(unsafe.Pointer(bp /* &preupdate */)).FaNew)
+ }
+}
+
+var fakeSortOrder U8 = U8(0) /* sqlite3.c:82939:19 */
+
//************* End of vdbeaux.c ********************************************
//************* Begin file vdbeapi.c ****************************************
// 2004 May 26
@@ -55566,26 +57632,26 @@ func Xsqlite3VtabImportErrmsg(tls *crt.TLS, p uintptr, pVtab uintptr) { /* sqlit
// that sqlite3_prepare() generates. For example, if new functions or
// collating sequences are registered or if an authorizer function is
// added or changed.
-func Xsqlite3_expired(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:82819:16: */
+func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83015:16: */
var p uintptr = pStmt
- return (crt.Bool32((p == uintptr(0)) || (Bft(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.expired */))&0x3>>0)) != 0)))
+ return (libc.Bool32((p == uintptr(0)) || (Bft(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.expired */))&0x3>>0)) != 0)))
}
// Check on a Vdbe to make sure it has not been finalized. Log
// an error and return true if it has been finalized (or is otherwise
// invalid). Return false if it is ok.
-func vdbeSafety(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:82830:12: */
+func vdbeSafety(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83026:12: */
if (*Vdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) {
- Xsqlite3_log(tls, 21, ts+4748 /* "API called with ..." */, 0)
+ Xsqlite3_log(tls, 21, ts+6946 /* "API called with ..." */, 0)
return 1
} else {
return 0
}
return int32(0)
}
-func vdbeSafetyNotNull(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:82838:12: */
+func vdbeSafetyNotNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83034:12: */
if p == uintptr(0) {
- Xsqlite3_log(tls, 21, ts+4793 /* "API called with ..." */, 0)
+ Xsqlite3_log(tls, 21, ts+6991 /* "API called with ..." */, 0)
return 1
} else {
return vdbeSafety(tls, p)
@@ -55595,7 +57661,7 @@ func vdbeSafetyNotNull(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:82838:12: *
// Invoke the profile callback. This routine is only called if we already
// know that the profile callback is defined and needs to be invoked.
-func invokeProfileCallback(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:82852:29: */
+func invokeProfileCallback(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:83048:29: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -55606,10 +57672,10 @@ func invokeProfileCallback(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:8
Xsqlite3OsCurrentTimeInt64(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, bp /* &iNow */)
*(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */)) = ((*(*Sqlite3_int64)(unsafe.Pointer(bp /* iNow */)) - (*Vdbe)(unsafe.Pointer(p)).FstartTime) * int64(1000000))
if (*Sqlite3)(unsafe.Pointer(db)).FxProfile != 0 {
- (*(*func(*crt.TLS, uintptr, uintptr, U64))(unsafe.Pointer((db + 248 /* &.xProfile */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg, (*Vdbe)(unsafe.Pointer(p)).FzSql, uint64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */))))
+ (*(*func(*libc.TLS, uintptr, uintptr, U64))(unsafe.Pointer((db + 248 /* &.xProfile */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProfileArg, (*Vdbe)(unsafe.Pointer(p)).FzSql, uint64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* iElapse */))))
}
if (int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & 0x02) != 0 {
- (*(*func(*crt.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.xTrace */))))(tls, uint32(0x02), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8 /* &iElapse */)
+ (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(0x02), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, bp+8 /* &iElapse */)
}
(*Vdbe)(unsafe.Pointer(p)).FstartTime = int64(0)
}
@@ -55624,7 +57690,7 @@ func invokeProfileCallback(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:8
//
// This routine sets the error code and string returned by
// sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
-func Xsqlite3_finalize(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:82890:16: */
+func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83086:16: */
var rc int32
if pStmt == uintptr(0) {
// IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
@@ -55634,7 +57700,7 @@ func Xsqlite3_finalize(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:82890:1
var v uintptr = pStmt
var db uintptr = (*Vdbe)(unsafe.Pointer(v)).Fdb
if vdbeSafety(tls, v) != 0 {
- return Xsqlite3MisuseError(tls, 82899)
+ return Xsqlite3MisuseError(tls, 83095)
}
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if ((*Vdbe)(unsafe.Pointer(v)).FstartTime) > int64(0) {
@@ -55654,7 +57720,7 @@ func Xsqlite3_finalize(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:82890:1
//
// This routine sets the error code and string returned by
// sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
-func Xsqlite3_reset(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:82917:16: */
+func Xsqlite3_reset(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83113:16: */
var rc int32
if pStmt == uintptr(0) {
rc = 0
@@ -55676,7 +57742,7 @@ func Xsqlite3_reset(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:82917:16:
}
// Set all the parameters in the compiled SQL statement to NULL.
-func Xsqlite3_clear_bindings(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:82938:16: */
+func Xsqlite3_clear_bindings(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83134:16: */
var i int32
var rc int32 = 0
var p uintptr = pStmt
@@ -55688,7 +57754,7 @@ func Xsqlite3_clear_bindings(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:8
}
if (*Vdbe)(unsafe.Pointer(p)).Fexpmask != 0 {
- crt.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(1), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(1), 0, 0x3)
}
Xsqlite3_mutex_leave(tls, mutex)
return rc
@@ -55698,7 +57764,7 @@ func Xsqlite3_clear_bindings(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:8
//
// The following routines extract information from a Mem or sqlite3_value
// structure.
-func Xsqlite3_value_blob(tls *crt.TLS, pVal uintptr) uintptr { /* sqlite3.c:82963:23: */
+func Xsqlite3_value_blob(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83159:23: */
var p uintptr = pVal
if (int32((*Mem)(unsafe.Pointer(p)).Fflags) & (0x0010 | 0x0002)) != 0 {
if (func() int32 {
@@ -55720,22 +57786,22 @@ func Xsqlite3_value_blob(tls *crt.TLS, pVal uintptr) uintptr { /* sqlite3.c:8296
}
return uintptr(0)
}
-func Xsqlite3_value_bytes(tls *crt.TLS, pVal uintptr) int32 { /* sqlite3.c:82976:16: */
+func Xsqlite3_value_bytes(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83172:16: */
return Xsqlite3ValueBytes(tls, pVal, uint8(1))
}
-func Xsqlite3_value_bytes16(tls *crt.TLS, pVal uintptr) int32 { /* sqlite3.c:82979:16: */
+func Xsqlite3_value_bytes16(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83175:16: */
return Xsqlite3ValueBytes(tls, pVal, uint8(2))
}
-func Xsqlite3_value_double(tls *crt.TLS, pVal uintptr) float64 { /* sqlite3.c:82982:19: */
+func Xsqlite3_value_double(tls *libc.TLS, pVal uintptr) float64 { /* sqlite3.c:83178:19: */
return Xsqlite3VdbeRealValue(tls, pVal)
}
-func Xsqlite3_value_int(tls *crt.TLS, pVal uintptr) int32 { /* sqlite3.c:82985:16: */
+func Xsqlite3_value_int(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83181:16: */
return int32(Xsqlite3VdbeIntValue(tls, pVal))
}
-func Xsqlite3_value_int64(tls *crt.TLS, pVal uintptr) Sqlite_int64 { /* sqlite3.c:82988:25: */
+func Xsqlite3_value_int64(tls *libc.TLS, pVal uintptr) Sqlite_int64 { /* sqlite3.c:83184:25: */
return Xsqlite3VdbeIntValue(tls, pVal)
}
-func Xsqlite3_value_subtype(tls *crt.TLS, pVal uintptr) uint32 { /* sqlite3.c:82991:25: */
+func Xsqlite3_value_subtype(tls *libc.TLS, pVal uintptr) uint32 { /* sqlite3.c:83187:25: */
var pMem uintptr = pVal
return func() uint32 {
if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & 0x8000) != 0 {
@@ -55744,35 +57810,35 @@ func Xsqlite3_value_subtype(tls *crt.TLS, pVal uintptr) uint32 { /* sqlite3.c:82
return uint32(0)
}()
}
-func Xsqlite3_value_pointer(tls *crt.TLS, pVal uintptr, zPType uintptr) uintptr { /* sqlite3.c:82995:17: */
+func Xsqlite3_value_pointer(tls *libc.TLS, pVal uintptr, zPType uintptr) uintptr { /* sqlite3.c:83191:17: */
var p uintptr = pVal
if ((((int32((*Mem)(unsafe.Pointer(p)).Fflags) & ((0xc1bf | 0x0200) | 0x8000)) == ((0x0001 | 0x0200) | 0x8000)) &&
(zPType != uintptr(0))) &&
(int32((*Mem)(unsafe.Pointer(p)).FeSubtype) == 'p')) &&
- (crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(p /* &.u */)), zPType) == 0) {
+ (libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(p /* &.u */)), zPType) == 0) {
return (*Mem)(unsafe.Pointer(p)).Fz
} else {
return uintptr(0)
}
return uintptr(0)
}
-func Xsqlite3_value_text(tls *crt.TLS, pVal uintptr) uintptr { /* sqlite3.c:83008:32: */
+func Xsqlite3_value_text(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83204:32: */
return Xsqlite3ValueText(tls, pVal, uint8(1))
}
-func Xsqlite3_value_text16(tls *crt.TLS, pVal uintptr) uintptr { /* sqlite3.c:83012:23: */
+func Xsqlite3_value_text16(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83208:23: */
return Xsqlite3ValueText(tls, pVal, uint8(2))
}
-func Xsqlite3_value_text16be(tls *crt.TLS, pVal uintptr) uintptr { /* sqlite3.c:83015:23: */
+func Xsqlite3_value_text16be(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83211:23: */
return Xsqlite3ValueText(tls, pVal, uint8(3))
}
-func Xsqlite3_value_text16le(tls *crt.TLS, pVal uintptr) uintptr { /* sqlite3.c:83018:23: */
+func Xsqlite3_value_text16le(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:83214:23: */
return Xsqlite3ValueText(tls, pVal, uint8(2))
}
// EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
// fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
// point number string BLOB NULL
-func Xsqlite3_value_type(tls *crt.TLS, pVal uintptr) int32 { /* sqlite3.c:83026:16: */
+func Xsqlite3_value_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83222:16: */
return int32(aType[(int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & 0x003f)])
}
@@ -55841,20 +57907,20 @@ var aType = [64]U8{
U8(5), // 0x3d (not possible)
U8(2), // 0x3e (not possible)
U8(5), // 0x3f (not possible)
-} /* sqlite3.c:83027:19 */
+} /* sqlite3.c:83223:19 */
// Return true if a parameter to xUpdate represents an unchanged column
-func Xsqlite3_value_nochange(tls *crt.TLS, pVal uintptr) int32 { /* sqlite3.c:83112:16: */
- return (crt.Bool32((int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & (0x0001 | 0x4000)) == (0x0001 | 0x4000)))
+func Xsqlite3_value_nochange(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83308:16: */
+ return (libc.Bool32((int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & (0x0001 | 0x4000)) == (0x0001 | 0x4000)))
}
// Return true if a parameter value originated from an sqlite3_bind()
-func Xsqlite3_value_frombind(tls *crt.TLS, pVal uintptr) int32 { /* sqlite3.c:83117:16: */
- return (crt.Bool32((int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & 0x0040) != 0))
+func Xsqlite3_value_frombind(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:83313:16: */
+ return (libc.Bool32((int32((*Sqlite3_value)(unsafe.Pointer(pVal)).Fflags) & 0x0040) != 0))
}
// Make a copy of an sqlite3_value object
-func Xsqlite3_value_dup(tls *crt.TLS, pOrig uintptr) uintptr { /* sqlite3.c:83123:26: */
+func Xsqlite3_value_dup(tls *libc.TLS, pOrig uintptr) uintptr { /* sqlite3.c:83319:26: */
var pNew uintptr
if pOrig == uintptr(0) {
return uintptr(0)
@@ -55863,12 +57929,12 @@ func Xsqlite3_value_dup(tls *crt.TLS, pOrig uintptr) uintptr { /* sqlite3.c:8312
if pNew == uintptr(0) {
return uintptr(0)
}
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Sqlite3_value{})))
- crt.Xmemcpy(tls, pNew, pOrig, uint64((uintptr(0) + 24 /* &.zMalloc */)))
- *(*U16)(unsafe.Pointer(pNew + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0400))))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Sqlite3_value{})))
+ libc.Xmemcpy(tls, pNew, pOrig, uint64((uintptr(0) + 24 /* &.zMalloc */)))
+ *(*U16)(unsafe.Pointer(pNew + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0400))))
(*Sqlite3_value)(unsafe.Pointer(pNew)).Fdb = uintptr(0)
if (int32((*Sqlite3_value)(unsafe.Pointer(pNew)).Fflags) & (0x0002 | 0x0010)) != 0 {
- *(*U16)(unsafe.Pointer(pNew + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32((0x0800 | 0x0400)))))
+ *(*U16)(unsafe.Pointer(pNew + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32((0x0800 | 0x0400)))))
*(*U16)(unsafe.Pointer(pNew + 8 /* &.flags */)) |= U16((0x1000))
if Xsqlite3VdbeMemMakeWriteable(tls, pNew) != 0 {
Xsqlite3ValueFree(tls, pNew)
@@ -55880,7 +57946,7 @@ func Xsqlite3_value_dup(tls *crt.TLS, pOrig uintptr) uintptr { /* sqlite3.c:8312
// Destroy an sqlite3_value object previously obtained from
// sqlite3_value_dup().
-func Xsqlite3_value_free(tls *crt.TLS, pOld uintptr) { /* sqlite3.c:83146:17: */
+func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:83342:17: */
Xsqlite3ValueFree(tls, pOld)
}
@@ -55895,28 +57961,28 @@ func Xsqlite3_value_free(tls *crt.TLS, pOld uintptr) { /* sqlite3.c:83146:17: */
//
// The invokeValueDestructor(P,X) routine invokes destructor function X()
// on value P is not going to be used and need to be destroyed.
-func setResultStrOrError(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, enc U8, xDel uintptr) { /* sqlite3.c:83162:13: */
+func setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc U8, xDel uintptr) { /* sqlite3.c:83358:13: */
if Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, enc, xDel) == 18 {
Xsqlite3_result_error_toobig(tls, pCtx)
}
}
-func invokeValueDestructor(tls *crt.TLS, p uintptr, xDel uintptr, pCtx uintptr) int32 { /* sqlite3.c:83173:12: */
+func invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) int32 { /* sqlite3.c:83369:12: */
if xDel == uintptr(0) {
- } else if xDel == (crt.UintptrFromInt32(-1)) {
+ } else if xDel == (libc.UintptrFromInt32(-1)) {
} else {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer(&xDel)))(tls, p)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&xDel)))(tls, p)
}
if pCtx != 0 {
Xsqlite3_result_error_toobig(tls, pCtx)
}
return 18
}
-func Xsqlite3_result_blob(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83189:17: */
+func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83385:17: */
setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel)
}
-func Xsqlite3_result_blob64(tls *crt.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr) { /* sqlite3.c:83199:17: */
+func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr) { /* sqlite3.c:83395:17: */
if n > uint64(0x7fffffff) {
invokeValueDestructor(tls, z, xDel, pCtx)
@@ -55924,50 +57990,50 @@ func Xsqlite3_result_blob64(tls *crt.TLS, pCtx uintptr, z uintptr, n Sqlite3_uin
setResultStrOrError(tls, pCtx, z, int32(n), uint8(0), xDel)
}
}
-func Xsqlite3_result_double(tls *crt.TLS, pCtx uintptr, rVal float64) { /* sqlite3.c:83213:17: */
+func Xsqlite3_result_double(tls *libc.TLS, pCtx uintptr, rVal float64) { /* sqlite3.c:83409:17: */
Xsqlite3VdbeMemSetDouble(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, rVal)
}
-func Xsqlite3_result_error(tls *crt.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:83217:17: */
+func Xsqlite3_result_error(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:83413:17: */
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = 1
- Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, uint8(1), crt.UintptrFromInt32(-1))
+ Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, uint8(1), libc.UintptrFromInt32(-1))
}
-func Xsqlite3_result_error16(tls *crt.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:83223:17: */
+func Xsqlite3_result_error16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32) { /* sqlite3.c:83419:17: */
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = 1
- Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, uint8(2), crt.UintptrFromInt32(-1))
+ Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, z, n, uint8(2), libc.UintptrFromInt32(-1))
}
-func Xsqlite3_result_int(tls *crt.TLS, pCtx uintptr, iVal int32) { /* sqlite3.c:83229:17: */
+func Xsqlite3_result_int(tls *libc.TLS, pCtx uintptr, iVal int32) { /* sqlite3.c:83425:17: */
Xsqlite3VdbeMemSetInt64(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, I64(iVal))
}
-func Xsqlite3_result_int64(tls *crt.TLS, pCtx uintptr, iVal I64) { /* sqlite3.c:83233:17: */
+func Xsqlite3_result_int64(tls *libc.TLS, pCtx uintptr, iVal I64) { /* sqlite3.c:83429:17: */
Xsqlite3VdbeMemSetInt64(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, iVal)
}
-func Xsqlite3_result_null(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:83237:17: */
+func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83433:17: */
Xsqlite3VdbeMemSetNull(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)
}
-func Xsqlite3_result_pointer(tls *crt.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:83241:17: */
+func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { /* sqlite3.c:83437:17: */
var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut
Xsqlite3VdbeMemRelease(tls, pOut)
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(0x0001)
Xsqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor)
}
-func Xsqlite3_result_subtype(tls *crt.TLS, pCtx uintptr, eSubtype uint32) { /* sqlite3.c:83253:17: */
+func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { /* sqlite3.c:83449:17: */
var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut
(*Mem)(unsafe.Pointer(pOut)).FeSubtype = (U8(eSubtype & uint32(0xff)))
*(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((0x8000))
}
-func Xsqlite3_result_text(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83259:17: */
+func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83455:17: */
setResultStrOrError(tls, pCtx, z, n, uint8(1), xDel)
}
-func Xsqlite3_result_text64(tls *crt.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr, enc uint8) { /* sqlite3.c:83268:17: */
+func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Sqlite3_uint64, xDel uintptr, enc uint8) { /* sqlite3.c:83464:17: */
if int32(enc) == 4 {
enc = uint8(2)
@@ -55978,27 +58044,27 @@ func Xsqlite3_result_text64(tls *crt.TLS, pCtx uintptr, z uintptr, n Sqlite3_uin
setResultStrOrError(tls, pCtx, z, int32(n), enc, xDel)
}
}
-func Xsqlite3_result_text16(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83285:17: */
+func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83481:17: */
setResultStrOrError(tls, pCtx, z, n, uint8(2), xDel)
}
-func Xsqlite3_result_text16be(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83294:17: */
+func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83490:17: */
setResultStrOrError(tls, pCtx, z, n, uint8(3), xDel)
}
-func Xsqlite3_result_text16le(tls *crt.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83303:17: */
+func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { /* sqlite3.c:83499:17: */
setResultStrOrError(tls, pCtx, z, n, uint8(2), xDel)
}
-func Xsqlite3_result_value(tls *crt.TLS, pCtx uintptr, pValue uintptr) { /* sqlite3.c:83313:17: */
+func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { /* sqlite3.c:83509:17: */
Xsqlite3VdbeMemCopy(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, pValue)
}
-func Xsqlite3_result_zeroblob(tls *crt.TLS, pCtx uintptr, n int32) { /* sqlite3.c:83317:17: */
+func Xsqlite3_result_zeroblob(tls *libc.TLS, pCtx uintptr, n int32) { /* sqlite3.c:83513:17: */
Xsqlite3VdbeMemSetZeroBlob(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, n)
}
-func Xsqlite3_result_zeroblob64(tls *crt.TLS, pCtx uintptr, n U64) int32 { /* sqlite3.c:83321:16: */
+func Xsqlite3_result_zeroblob64(tls *libc.TLS, pCtx uintptr, n U64) int32 { /* sqlite3.c:83517:16: */
var pOut uintptr = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut
if n > U64(*(*int32)(unsafe.Pointer(((*Mem)(unsafe.Pointer(pOut)).Fdb + 124 /* &.aLimit */) + uintptr(0)*4))) {
@@ -56007,7 +58073,7 @@ func Xsqlite3_result_zeroblob64(tls *crt.TLS, pCtx uintptr, n U64) int32 { /* sq
Xsqlite3VdbeMemSetZeroBlob(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, int32(n))
return 0
}
-func Xsqlite3_result_error_code(tls *crt.TLS, pCtx uintptr, errCode int32) { /* sqlite3.c:83330:17: */
+func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { /* sqlite3.c:83526:17: */
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = func() int32 {
if errCode != 0 {
return errCode
@@ -56021,15 +58087,15 @@ func Xsqlite3_result_error_code(tls *crt.TLS, pCtx uintptr, errCode int32) { /*
}
// Force an SQLITE_TOOBIG error.
-func Xsqlite3_result_error_toobig(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:83342:17: */
+func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83538:17: */
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = 18
- Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, ts+4833 /* "string or blob t..." */, -1,
+ Xsqlite3VdbeMemSetStr(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, ts+7031 /* "string or blob t..." */, -1,
uint8(1), uintptr(0))
}
// An SQLITE_NOMEM error.
-func Xsqlite3_result_error_nomem(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:83350:17: */
+func Xsqlite3_result_error_nomem(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83546:17: */
Xsqlite3VdbeMemSetNull(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = 7
@@ -56039,17 +58105,17 @@ func Xsqlite3_result_error_nomem(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:8335
// Force the INT64 value currently stored as the result to be
// a MEM_IntReal value. See the SQLITE_TESTCTRL_RESULT_INTREAL
// test-control.
-func Xsqlite3ResultIntReal(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:83362:21: */
+func Xsqlite3ResultIntReal(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:83558:21: */
if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut)).Fflags) & 0x0004) != 0 {
- *(*U16)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0004))))
+ *(*U16)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0004))))
*(*U16)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut + 8 /* &.flags */)) |= U16((0x0020))
}
}
// This function is called after a transaction has been committed. It
// invokes callbacks registered with sqlite3_wal_hook() as required.
-func doWalCallbacks(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:83376:12: */
+func doWalCallbacks(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:83572:12: */
var rc int32 = 0
var i int32
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
@@ -56060,7 +58126,7 @@ func doWalCallbacks(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:83376:12: */
nEntry = Xsqlite3PagerWalCallback(tls, Xsqlite3BtreePager(tls, pBt))
Xsqlite3BtreeLeave(tls, pBt)
if ((nEntry > 0) && ((*Sqlite3)(unsafe.Pointer(db)).FxWalCallback != 0)) && (rc == 0) {
- rc = (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer((db + 320 /* &.xWalCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpWalArg, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FzDbSName, nEntry)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32)(unsafe.Pointer((db + 344 /* &.xWalCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpWalArg, db, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FzDbSName, nEntry)
}
}
}
@@ -56074,7 +58140,7 @@ func doWalCallbacks(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:83376:12: */
// API. The only thing omitted is the automatic recompile if a
// schema change has occurred. That detail is handled by the
// outer sqlite3_step() wrapper procedure.
-func sqlite3Step(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:83406:12: */
+func sqlite3Step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83602:12: */
var db uintptr
var rc int32
@@ -56115,116 +58181,125 @@ __2:
}
(*Vdbe)(unsafe.Pointer(p)).Frc = 17
rc = 1
+ if !((int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags) & 0x80) != 0) {
+ goto __4
+ }
+ // If this statement was prepared using saved SQL and an
+ // error has occurred, then return the error code in p->rc to the
+ // caller. Set the error code in the database handle to the same value.
+ rc = Xsqlite3VdbeTransferError(tls, p)
+__4:
+ ;
goto end_of_step
__3:
;
if !((*Vdbe)(unsafe.Pointer(p)).Fpc < 0) {
- goto __4
+ goto __5
}
// If there are no other statements currently running, then
// reset the interrupt flag. This prevents a call to sqlite3_interrupt
// from interrupting a statement that has not yet started.
if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0) {
- goto __5
+ goto __6
}
- *(*int32)(unsafe.Pointer((db + 368 /* &.u1 */ /* &.isInterrupted */))) = 0
-__5:
+ *(*int32)(unsafe.Pointer((db + 392 /* &.u1 */ /* &.isInterrupted */))) = 0
+__6:
;
if !((((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & (0x02 | 0x80)) != 0) &&
!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0)) && ((*Vdbe)(unsafe.Pointer(p)).FzSql != 0)) {
- goto __6
+ goto __7
}
Xsqlite3OsCurrentTimeInt64(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, (p + 184 /* &.startTime */))
- goto __7
-__6:
- ;
+ goto __8
__7:
;
+__8:
+ ;
(*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive++
if !(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.readOnly */))&0x80>>7) == 0) {
- goto __8
+ goto __9
}
(*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite++
-__8:
+__9:
;
if !(Bft(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.bIsReader */))&0x100>>8)) != 0) {
- goto __9
+ goto __10
}
(*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead++
-__9:
+__10:
;
(*Vdbe)(unsafe.Pointer(p)).Fpc = 0
-__4:
+__5:
;
if !(Bft(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.explain */))&0xc>>2)) != 0) {
- goto __10
+ goto __11
}
rc = Xsqlite3VdbeList(tls, p)
- goto __11
-__10:
+ goto __12
+__11:
(*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec++
rc = Xsqlite3VdbeExec(tls, p)
(*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec--
-__11:
+__12:
;
if !(rc != 100) {
- goto __12
+ goto __13
}
// If the statement completed successfully, invoke the profile callback
if !(((*Vdbe)(unsafe.Pointer(p)).FstartTime) > int64(0)) {
- goto __13
+ goto __14
}
invokeProfileCallback(tls, db, p)
-__13:
+__14:
;
if !((rc == 101) && ((*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0)) {
- goto __14
+ goto __15
}
(*Vdbe)(unsafe.Pointer(p)).Frc = doWalCallbacks(tls, db)
if !((*Vdbe)(unsafe.Pointer(p)).Frc != 0) {
- goto __15
+ goto __17
}
rc = 1
+__17:
+ ;
+ goto __16
__15:
+ if !((rc != 101) && ((int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags) & 0x80) != 0)) {
+ goto __18
+ }
+ // If this statement was prepared using saved SQL and an
+ // error has occurred, then return the error code in p->rc to the
+ // caller. Set the error code in the database handle to the same value.
+ rc = Xsqlite3VdbeTransferError(tls, p)
+__18:
;
-__14:
+__16:
;
-__12:
+__13:
;
(*Sqlite3)(unsafe.Pointer(db)).FerrCode = rc
if !(7 == Xsqlite3ApiExit(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, (*Vdbe)(unsafe.Pointer(p)).Frc)) {
- goto __16
+ goto __19
}
(*Vdbe)(unsafe.Pointer(p)).Frc = 7
-__16:
+ if !((int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags) & 0x80) != 0) {
+ goto __20
+ }
+ rc = (*Vdbe)(unsafe.Pointer(p)).Frc
+__20:
;
-end_of_step:
- // At this point local variable rc holds the value that should be
- // returned if this statement was compiled using the legacy
- // sqlite3_prepare() interface. According to the docs, this can only
- // be one of the values in the first assert() below. Variable p->rc
- // contains the value that would be returned if sqlite3_finalize()
- // were called on statement p.
+__19:
;
-
- if !(((rc != 100) &&
- (rc != 101)) &&
- ((int32((*Vdbe)(unsafe.Pointer(p)).FprepFlags) & 0x80) != 0)) {
- goto __17
- }
- /* If this statement was prepared using saved SQL and an
- ** error has occurred, then return the error code in p->rc to the
- ** caller. Set the error code in the database handle to the same value.
- */
- rc = Xsqlite3VdbeTransferError(tls, p)
-__17:
+end_of_step:
+ // There are only a limited number of result codes allowed from the
+ // statements prepared using the legacy sqlite3_prepare() interface
;
return (rc & (*Sqlite3)(unsafe.Pointer(db)).FerrMask)
}
@@ -56232,20 +58307,20 @@ __17:
// This is the top-level implementation of sqlite3_step(). Call
// sqlite3Step() to do most of the work. If a schema error occurs,
// call sqlite3Reprepare() and try again.
-func Xsqlite3_step(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:83541:16: */
+func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83736:16: */
var rc int32 = 0 // Result from sqlite3Step()
var v uintptr = pStmt // the prepared statement
var cnt int32 = 0 // Counter to prevent infinite loop of reprepares
var db uintptr // The database connection
if vdbeSafetyNotNull(tls, v) != 0 {
- return Xsqlite3MisuseError(tls, 83548)
+ return Xsqlite3MisuseError(tls, 83743)
}
db = (*Vdbe)(unsafe.Pointer(v)).Fdb
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Vdbe)(unsafe.Pointer(v)).FdoingRerun = U8(0)
- for ((crt.AssignInt32(&rc, sqlite3Step(tls, v))) == 17) &&
- (crt.PostIncInt32(&cnt, 1) < 50) {
+ for ((libc.AssignInt32(&rc, sqlite3Step(tls, v))) == 17) &&
+ (libc.PostIncInt32(&cnt, 1) < 50) {
var savedPc int32 = (*Vdbe)(unsafe.Pointer(v)).Fpc
rc = Xsqlite3Reprepare(tls, v)
if rc != 0 {
@@ -56260,10 +58335,10 @@ func Xsqlite3_step(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:83541:16: *
Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(v)).FzErrMsg)
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
(*Vdbe)(unsafe.Pointer(v)).FzErrMsg = Xsqlite3DbStrDup(tls, db, zErr)
- (*Vdbe)(unsafe.Pointer(v)).Frc = crt.AssignInt32(&rc, Xsqlite3ApiExit(tls, db, rc))
+ (*Vdbe)(unsafe.Pointer(v)).Frc = libc.AssignInt32(&rc, Xsqlite3ApiExit(tls, db, rc))
} else {
(*Vdbe)(unsafe.Pointer(v)).FzErrMsg = uintptr(0)
- (*Vdbe)(unsafe.Pointer(v)).Frc = crt.AssignInt32(&rc, 7)
+ (*Vdbe)(unsafe.Pointer(v)).Frc = libc.AssignInt32(&rc, 7)
}
break
}
@@ -56278,7 +58353,7 @@ func Xsqlite3_step(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:83541:16: *
// Extract the user data from a sqlite3_context structure and return a
// pointer to it.
-func Xsqlite3_user_data(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:83590:17: */
+func Xsqlite3_user_data(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:83785:17: */
return (*FuncDef)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpFunc)).FpUserData
}
@@ -56291,7 +58366,7 @@ func Xsqlite3_user_data(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:83590:17
// parameter) of the sqlite3_create_function() and
// sqlite3_create_function16() routines that originally registered the
// application defined function.
-func Xsqlite3_context_db_handle(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:83605:20: */
+func Xsqlite3_context_db_handle(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:83800:20: */
return (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpOut)).Fdb
}
@@ -56308,7 +58383,7 @@ func Xsqlite3_context_db_handle(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:
// Virtual table implements might use this routine to optimize their
// performance by substituting a NULL result, or some other light-weight
// value, as a signal to the xUpdate routine that the column is unchanged.
-func Xsqlite3_vtab_nochange(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:83624:16: */
+func Xsqlite3_vtab_nochange(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83819:16: */
return Xsqlite3_value_nochange(tls, (*Sqlite3_context)(unsafe.Pointer(p)).FpOut)
}
@@ -56318,10 +58393,18 @@ func Xsqlite3_vtab_nochange(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:83624:
// statement, the exact same time is returned for each invocation regardless
// of the amount of time that elapses between invocations. In other words,
// the time returned is always the time of the first call.
-func Xsqlite3StmtCurrentTime(tls *crt.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:83636:30: */
- var rc int32
- var piTime uintptr = ((*Sqlite3_context)(unsafe.Pointer(p)).FpVdbe + 72 /* &.iCurrentTime */)
+func Xsqlite3StmtCurrentTime(tls *libc.TLS, p uintptr) Sqlite3_int64 { /* sqlite3.c:83831:30: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+ var rc int32
+ *(*Sqlite3_int64)(unsafe.Pointer(bp /* iTime */)) = int64(0)
+ var piTime uintptr
+ if (*Sqlite3_context)(unsafe.Pointer(p)).FpVdbe != uintptr(0) {
+ piTime = ((*Sqlite3_context)(unsafe.Pointer(p)).FpVdbe + 72 /* &.iCurrentTime */)
+ } else {
+ piTime = bp /* &iTime */
+ }
if *(*Sqlite3_int64)(unsafe.Pointer(piTime)) == int64(0) {
rc = Xsqlite3OsCurrentTimeInt64(tls, (*Sqlite3)(unsafe.Pointer((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpOut)).Fdb)).FpVfs, piTime)
if rc != 0 {
@@ -56333,7 +58416,7 @@ func Xsqlite3StmtCurrentTime(tls *crt.TLS, p uintptr) Sqlite3_int64 { /* sqlite3
// Create a new aggregate context for p and return a pointer to
// its pMem->z element.
-func createAggContext(tls *crt.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:83656:29: */
+func createAggContext(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:83851:29: */
var pMem uintptr = (*Sqlite3_context)(unsafe.Pointer(p)).FpMem
if nByte <= 0 {
@@ -56344,7 +58427,7 @@ func createAggContext(tls *crt.TLS, p uintptr, nByte int32) uintptr { /* sqlite3
(*Mem)(unsafe.Pointer(pMem)).Fflags = U16(0x2000)
*(*uintptr)(unsafe.Pointer(pMem /* &.u */)) = (*Sqlite3_context)(unsafe.Pointer(p)).FpFunc
if (*Mem)(unsafe.Pointer(pMem)).Fz != 0 {
- crt.Xmemset(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, 0, uint64(nByte))
+ libc.Xmemset(tls, (*Mem)(unsafe.Pointer(pMem)).Fz, 0, uint64(nByte))
}
}
return (*Mem)(unsafe.Pointer(pMem)).Fz
@@ -56353,7 +58436,7 @@ func createAggContext(tls *crt.TLS, p uintptr, nByte int32) uintptr { /* sqlite3
// Allocate or return the aggregate context for a user function. A new
// context is allocated on the first call. Subsequent calls return the
// same context that was returned on prior calls.
-func Xsqlite3_aggregate_context(tls *crt.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:83678:17: */
+func Xsqlite3_aggregate_context(tls *libc.TLS, p uintptr, nByte int32) uintptr { /* sqlite3.c:83873:17: */
if (int32((*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fflags) & 0x2000) == 0 {
return createAggContext(tls, p, nByte)
@@ -56371,9 +58454,12 @@ func Xsqlite3_aggregate_context(tls *crt.TLS, p uintptr, nByte int32) uintptr {
// Undocumented behavior: If iArg is negative then access a cache of
// auxiliary data pointers that is available to all functions within a
// single prepared statement. The iArg values must match.
-func Xsqlite3_get_auxdata(tls *crt.TLS, pCtx uintptr, iArg int32) uintptr { /* sqlite3.c:83699:17: */
+func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) uintptr { /* sqlite3.c:83894:17: */
var pAuxData uintptr
+ if (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe == uintptr(0) {
+ return uintptr(0)
+ }
for pAuxData = (*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FpAuxData; pAuxData != 0; pAuxData = (*AuxData)(unsafe.Pointer(pAuxData)).FpNextAux {
if ((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxArg == iArg) && (((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxOp == (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp) || (iArg < 0)) {
return (*AuxData)(unsafe.Pointer(pAuxData)).FpAux
@@ -56391,58 +58477,65 @@ func Xsqlite3_get_auxdata(tls *crt.TLS, pCtx uintptr, iArg int32) uintptr { /* s
// Undocumented behavior: If iArg is negative then make the data available
// to all functions within the current prepared statement using iArg as an
// access code.
-func Xsqlite3_set_auxdata(tls *crt.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { /* sqlite3.c:83727:17: */
+func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { /* sqlite3.c:83922:17: */
var pAuxData uintptr
var pVdbe uintptr
pVdbe = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe
- pAuxData = (*Vdbe)(unsafe.Pointer(pVdbe)).FpAuxData
+ if !(pVdbe == uintptr(0)) {
+ goto __1
+ }
+ goto failed
__1:
+ ;
+
+ pAuxData = (*Vdbe)(unsafe.Pointer(pVdbe)).FpAuxData
+__2:
if !(pAuxData != 0) {
- goto __3
+ goto __4
}
if !(((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxArg == iArg) && (((*AuxData)(unsafe.Pointer(pAuxData)).FiAuxOp == (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp) || (iArg < 0))) {
- goto __4
+ goto __5
}
- goto __3
-__4:
+ goto __4
+__5:
;
- goto __2
-__2:
- pAuxData = (*AuxData)(unsafe.Pointer(pAuxData)).FpNextAux
- goto __1
goto __3
__3:
+ pAuxData = (*AuxData)(unsafe.Pointer(pAuxData)).FpNextAux
+ goto __2
+ goto __4
+__4:
;
if !(pAuxData == uintptr(0)) {
- goto __5
+ goto __6
}
pAuxData = Xsqlite3DbMallocZero(tls, (*Vdbe)(unsafe.Pointer(pVdbe)).Fdb, uint64(unsafe.Sizeof(AuxData{})))
if !(!(pAuxData != 0)) {
- goto __7
+ goto __8
}
goto failed
-__7:
+__8:
;
(*AuxData)(unsafe.Pointer(pAuxData)).FiAuxOp = (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp
(*AuxData)(unsafe.Pointer(pAuxData)).FiAuxArg = iArg
(*AuxData)(unsafe.Pointer(pAuxData)).FpNextAux = (*Vdbe)(unsafe.Pointer(pVdbe)).FpAuxData
(*Vdbe)(unsafe.Pointer(pVdbe)).FpAuxData = pAuxData
if !((*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError == 0) {
- goto __8
+ goto __9
}
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = -1
-__8:
+__9:
;
- goto __6
-__5:
+ goto __7
+__6:
if !((*AuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux != 0) {
- goto __9
+ goto __10
}
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pAuxData + 16 /* &.xDeleteAux */))))(tls, (*AuxData)(unsafe.Pointer(pAuxData)).FpAux)
-__9:
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pAuxData + 16 /* &.xDeleteAux */))))(tls, (*AuxData)(unsafe.Pointer(pAuxData)).FpAux)
+__10:
;
-__6:
+__7:
;
(*AuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux
@@ -56451,10 +58544,10 @@ __6:
failed:
if !(xDelete != 0) {
- goto __10
+ goto __11
}
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer(&xDelete)))(tls, pAux)
-__10:
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&xDelete)))(tls, pAux)
+__11:
}
// Return the number of times the Step function of an aggregate has been
@@ -56464,13 +58557,13 @@ __10:
// provide only to avoid breaking legacy code. New aggregate function
// implementations should keep their own counts within their aggregate
// context.
-func Xsqlite3_aggregate_count(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:83780:16: */
+func Xsqlite3_aggregate_count(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:83975:16: */
return (*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(p)).FpMem)).Fn
}
// Return the number of columns in the result set for the statement pStmt.
-func Xsqlite3_column_count(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:83789:16: */
+func Xsqlite3_column_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83984:16: */
var pVm uintptr = pStmt
if pVm != 0 {
return int32((*Vdbe)(unsafe.Pointer(pVm)).FnResColumn)
@@ -56480,7 +58573,7 @@ func Xsqlite3_column_count(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:837
// Return the number of values available from the current row of the
// currently executing statement pStmt.
-func Xsqlite3_data_count(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:83798:16: */
+func Xsqlite3_data_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:83993:16: */
var pVm uintptr = pStmt
if (pVm == uintptr(0)) || ((*Vdbe)(unsafe.Pointer(pVm)).FpResultSet == uintptr(0)) {
return 0
@@ -56489,7 +58582,7 @@ func Xsqlite3_data_count(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:83798
}
// Return a pointer to static memory containing an SQL NULL value.
-func columnNullValue(tls *crt.TLS) uintptr { /* sqlite3.c:83807:18: */
+func columnNullValue(tls *libc.TLS) uintptr { /* sqlite3.c:84002:18: */
return uintptr(unsafe.Pointer(&nullMem))
}
@@ -56505,13 +58598,13 @@ var nullMem = Mem{Fu:
/* .uTemp = */ U32(0), Fdb:
/* .db = */ uintptr(0), FxDel:
/* .xDel = */ uintptr(0),
-} /* sqlite3.c:83817:20 */
+} /* sqlite3.c:84012:20 */
// Check to see if column iCol of the given statement is valid. If
// it is, return a pointer to the Mem for the value of that column.
// If iCol is not valid, return a pointer to a Mem which has a value
// of NULL.
-func columnMem(tls *crt.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:83847:12: */
+func columnMem(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84042:12: */
var pVm uintptr
var pOut uintptr
@@ -56546,7 +58639,7 @@ func columnMem(tls *crt.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:8384
// sqlite3_column_bytes()
// sqlite3_column_bytes16()
// sqiite3_column_blob()
-func columnMallocFailure(tls *crt.TLS, pStmt uintptr) { /* sqlite3.c:83882:13: */
+func columnMallocFailure(tls *libc.TLS, pStmt uintptr) { /* sqlite3.c:84077:13: */
// If malloc() failed during an encoding conversion within an
// sqlite3_column_XXX API, then set the return code of the statement to
// SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR
@@ -56563,7 +58656,7 @@ func columnMallocFailure(tls *crt.TLS, pStmt uintptr) { /* sqlite3.c:83882:13: *
//
// The following routines are used to access elements of the current row
// in the result set.
-func Xsqlite3_column_blob(tls *crt.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:83902:23: */
+func Xsqlite3_column_blob(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84097:23: */
var val uintptr
val = Xsqlite3_value_blob(tls, columnMem(tls, pStmt, i))
// Even though there is no encoding conversion, value_blob() might
@@ -56572,51 +58665,51 @@ func Xsqlite3_column_blob(tls *crt.TLS, pStmt uintptr, i int32) uintptr { /* sql
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_bytes(tls *crt.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:83912:16: */
+func Xsqlite3_column_bytes(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84107:16: */
var val int32 = Xsqlite3_value_bytes(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_bytes16(tls *crt.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:83917:16: */
+func Xsqlite3_column_bytes16(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84112:16: */
var val int32 = Xsqlite3_value_bytes16(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_double(tls *crt.TLS, pStmt uintptr, i int32) float64 { /* sqlite3.c:83922:19: */
+func Xsqlite3_column_double(tls *libc.TLS, pStmt uintptr, i int32) float64 { /* sqlite3.c:84117:19: */
var val float64 = Xsqlite3_value_double(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_int(tls *crt.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:83927:16: */
+func Xsqlite3_column_int(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84122:16: */
var val int32 = Xsqlite3_value_int(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_int64(tls *crt.TLS, pStmt uintptr, i int32) Sqlite_int64 { /* sqlite3.c:83932:25: */
+func Xsqlite3_column_int64(tls *libc.TLS, pStmt uintptr, i int32) Sqlite_int64 { /* sqlite3.c:84127:25: */
var val Sqlite_int64 = Xsqlite3_value_int64(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_text(tls *crt.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:83937:32: */
+func Xsqlite3_column_text(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84132:32: */
var val uintptr = Xsqlite3_value_text(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_value(tls *crt.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:83942:26: */
+func Xsqlite3_column_value(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84137:26: */
var pOut uintptr = columnMem(tls, pStmt, i)
if (int32((*Mem)(unsafe.Pointer(pOut)).Fflags) & 0x0800) != 0 {
- *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0800))))
+ *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0800))))
*(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((0x1000))
}
columnMallocFailure(tls, pStmt)
return pOut
}
-func Xsqlite3_column_text16(tls *crt.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:83952:23: */
+func Xsqlite3_column_text16(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84147:23: */
var val uintptr = Xsqlite3_value_text16(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return val
}
-func Xsqlite3_column_type(tls *crt.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:83958:16: */
+func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84153:16: */
var iType int32 = Xsqlite3_value_type(tls, columnMem(tls, pStmt, i))
columnMallocFailure(tls, pStmt)
return iType
@@ -56636,7 +58729,7 @@ func Xsqlite3_column_type(tls *crt.TLS, pStmt uintptr, i int32) int32 { /* sqlit
//
// If the result is not a simple column reference (if it is an expression
// or a constant) then useTypes 2, 3, and 4 return NULL.
-func columnName(tls *crt.TLS, pStmt uintptr, N int32, useUtf16 int32, useType int32) uintptr { /* sqlite3.c:83980:19: */
+func columnName(tls *libc.TLS, pStmt uintptr, N int32, useUtf16 int32, useType int32) uintptr { /* sqlite3.c:84175:19: */
var ret uintptr
var p uintptr
var n int32
@@ -56668,10 +58761,10 @@ func columnName(tls *crt.TLS, pStmt uintptr, N int32, useUtf16 int32, useType in
// Return the name of the Nth column of the result set returned by SQL
// statement pStmt.
-func Xsqlite3_column_name(tls *crt.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84029:23: */
+func Xsqlite3_column_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84224:23: */
return columnName(tls, pStmt, N, 0, 0)
}
-func Xsqlite3_column_name16(tls *crt.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84033:23: */
+func Xsqlite3_column_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84228:23: */
return columnName(tls, pStmt, N, 1, 0)
}
@@ -56680,13 +58773,43 @@ func Xsqlite3_column_name16(tls *crt.TLS, pStmt uintptr, N int32) uintptr { /* s
// Return the column declaration type (if applicable) of the 'i'th column
// of the result set of SQL statement pStmt.
-func Xsqlite3_column_decltype(tls *crt.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84052:23: */
+func Xsqlite3_column_decltype(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84247:23: */
return columnName(tls, pStmt, N, 0, 1)
}
-func Xsqlite3_column_decltype16(tls *crt.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84056:23: */
+func Xsqlite3_column_decltype16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84251:23: */
return columnName(tls, pStmt, N, 1, 1)
}
+// Return the name of the database from which a result column derives.
+// NULL is returned if the result column is an expression or constant or
+// anything else which is not an unambiguous reference to a database column.
+func Xsqlite3_column_database_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84263:23: */
+ return columnName(tls, pStmt, N, 0, 2)
+}
+func Xsqlite3_column_database_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84267:23: */
+ return columnName(tls, pStmt, N, 1, 2)
+}
+
+// Return the name of the table from which a result column derives.
+// NULL is returned if the result column is an expression or constant or
+// anything else which is not an unambiguous reference to a database column.
+func Xsqlite3_column_table_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84277:23: */
+ return columnName(tls, pStmt, N, 0, 3)
+}
+func Xsqlite3_column_table_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84281:23: */
+ return columnName(tls, pStmt, N, 1, 3)
+}
+
+// Return the name of the table column from which a result column derives.
+// NULL is returned if the result column is an expression or constant or
+// anything else which is not an unambiguous reference to a database column.
+func Xsqlite3_column_origin_name(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84291:23: */
+ return columnName(tls, pStmt, N, 0, 4)
+}
+func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) uintptr { /* sqlite3.c:84295:23: */
+ return columnName(tls, pStmt, N, 1, 4)
+}
+
// ****************************** sqlite3_bind_ ***************************
//
//
@@ -56700,21 +58823,21 @@ func Xsqlite3_column_decltype16(tls *crt.TLS, pStmt uintptr, N int32) uintptr {
//
// The error code stored in database p->db is overwritten with the return
// value in any case.
-func vdbeUnbind(tls *crt.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84122:12: */
+func vdbeUnbind(tls *libc.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84317:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
var pVar uintptr
if vdbeSafetyNotNull(tls, p) != 0 {
- return Xsqlite3MisuseError(tls, 84125)
+ return Xsqlite3MisuseError(tls, 84320)
}
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
if ((*Vdbe)(unsafe.Pointer(p)).Fmagic != U32(0x2df20da3)) || ((*Vdbe)(unsafe.Pointer(p)).Fpc >= 0) {
Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, 21)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
Xsqlite3_log(tls, 21,
- ts+4856 /* "bind on a busy p..." */, crt.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzSql))
- return Xsqlite3MisuseError(tls, 84133)
+ ts+7054 /* "bind on a busy p..." */, libc.VaList(bp, (*Vdbe)(unsafe.Pointer(p)).FzSql))
+ return Xsqlite3MisuseError(tls, 84328)
}
if (i < 1) || (i > int32((*Vdbe)(unsafe.Pointer(p)).FnVar)) {
Xsqlite3Error(tls, (*Vdbe)(unsafe.Pointer(p)).Fdb, 25)
@@ -56742,13 +58865,13 @@ func vdbeUnbind(tls *crt.TLS, p uintptr, i int32) int32 { /* sqlite3.c:84122:12:
}
return (U32(U32(1)) << i)
}())) != U32(0)) {
- crt.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(1), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(1), 0, 0x3)
}
return 0
}
// Bind a text or BLOB value.
-func bindText(tls *crt.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr, encoding U8) int32 { /* sqlite3.c:84165:12: */
+func bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr, encoding U8) int32 { /* sqlite3.c:84360:12: */
var p uintptr = pStmt
var pVar uintptr
var rc int32
@@ -56767,17 +58890,17 @@ func bindText(tls *crt.TLS, pStmt uintptr, i int32, zData uintptr, nData int32,
}
}
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
- } else if (xDel != (uintptr(0))) && (xDel != (crt.UintptrFromInt32(-1))) {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer(&xDel)))(tls, zData)
+ } else if (xDel != (uintptr(0))) && (xDel != (libc.UintptrFromInt32(-1))) {
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&xDel)))(tls, zData)
}
return rc
}
// Bind a blob value to an SQL statement variable.
-func Xsqlite3_bind_blob(tls *crt.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84201:16: */
+func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84396:16: */
return bindText(tls, pStmt, i, zData, nData, xDel, uint8(0))
}
-func Xsqlite3_bind_blob64(tls *crt.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr) int32 { /* sqlite3.c:84213:16: */
+func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr) int32 { /* sqlite3.c:84408:16: */
if nData > uint64(0x7fffffff) {
return invokeValueDestructor(tls, zData, xDel, uintptr(0))
@@ -56786,7 +58909,7 @@ func Xsqlite3_bind_blob64(tls *crt.TLS, pStmt uintptr, i int32, zData uintptr, n
}
return int32(0)
}
-func Xsqlite3_bind_double(tls *crt.TLS, pStmt uintptr, i int32, rValue float64) int32 { /* sqlite3.c:84227:16: */
+func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) int32 { /* sqlite3.c:84422:16: */
var rc int32
var p uintptr = pStmt
rc = vdbeUnbind(tls, p, i)
@@ -56796,10 +58919,10 @@ func Xsqlite3_bind_double(tls *crt.TLS, pStmt uintptr, i int32, rValue float64)
}
return rc
}
-func Xsqlite3_bind_int(tls *crt.TLS, p uintptr, i int32, iValue int32) int32 { /* sqlite3.c:84237:16: */
+func Xsqlite3_bind_int(tls *libc.TLS, p uintptr, i int32, iValue int32) int32 { /* sqlite3.c:84432:16: */
return Xsqlite3_bind_int64(tls, p, i, I64(iValue))
}
-func Xsqlite3_bind_int64(tls *crt.TLS, pStmt uintptr, i int32, iValue Sqlite_int64) int32 { /* sqlite3.c:84240:16: */
+func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Sqlite_int64) int32 { /* sqlite3.c:84435:16: */
var rc int32
var p uintptr = pStmt
rc = vdbeUnbind(tls, p, i)
@@ -56809,7 +58932,7 @@ func Xsqlite3_bind_int64(tls *crt.TLS, pStmt uintptr, i int32, iValue Sqlite_int
}
return rc
}
-func Xsqlite3_bind_null(tls *crt.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84250:16: */
+func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) int32 { /* sqlite3.c:84445:16: */
var rc int32
var p uintptr = pStmt
rc = vdbeUnbind(tls, p, i)
@@ -56818,7 +58941,7 @@ func Xsqlite3_bind_null(tls *crt.TLS, pStmt uintptr, i int32) int32 { /* sqlite3
}
return rc
}
-func Xsqlite3_bind_pointer(tls *crt.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) int32 { /* sqlite3.c:84259:16: */
+func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) int32 { /* sqlite3.c:84454:16: */
var rc int32
var p uintptr = pStmt
rc = vdbeUnbind(tls, p, i)
@@ -56826,14 +58949,14 @@ func Xsqlite3_bind_pointer(tls *crt.TLS, pStmt uintptr, i int32, pPtr uintptr, z
Xsqlite3VdbeMemSetPointer(tls, ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr((i-1))*56), pPtr, zPTtype, xDestructor)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
} else if xDestructor != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer(&xDestructor)))(tls, pPtr)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&xDestructor)))(tls, pPtr)
}
return rc
}
-func Xsqlite3_bind_text(tls *crt.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84277:16: */
+func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84472:16: */
return bindText(tls, pStmt, i, zData, nData, xDel, uint8(1))
}
-func Xsqlite3_bind_text64(tls *crt.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr, enc uint8) int32 { /* sqlite3.c:84286:16: */
+func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Sqlite3_uint64, xDel uintptr, enc uint8) int32 { /* sqlite3.c:84481:16: */
if nData > uint64(0x7fffffff) {
return invokeValueDestructor(tls, zData, xDel, uintptr(0))
@@ -56845,10 +58968,10 @@ func Xsqlite3_bind_text64(tls *crt.TLS, pStmt uintptr, i int32, zData uintptr, n
}
return int32(0)
}
-func Xsqlite3_bind_text16(tls *crt.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84303:16: */
+func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) int32 { /* sqlite3.c:84498:16: */
return bindText(tls, pStmt, i, zData, nData, xDel, uint8(2))
}
-func Xsqlite3_bind_value(tls *crt.TLS, pStmt uintptr, i int32, pValue uintptr) int32 { /* sqlite3.c:84313:16: */
+func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) int32 { /* sqlite3.c:84508:16: */
var rc int32
switch Xsqlite3_value_type(tls, pValue) {
case 1:
@@ -56866,13 +58989,13 @@ func Xsqlite3_bind_value(tls *crt.TLS, pStmt uintptr, i int32, pValue uintptr) i
if (int32((*Sqlite3_value)(unsafe.Pointer(pValue)).Fflags) & 0x4000) != 0 {
rc = Xsqlite3_bind_zeroblob(tls, pStmt, i, *(*int32)(unsafe.Pointer(pValue /* &.u */)))
} else {
- rc = Xsqlite3_bind_blob(tls, pStmt, i, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fz, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fn, crt.UintptrFromInt32(-1))
+ rc = Xsqlite3_bind_blob(tls, pStmt, i, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fz, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fn, libc.UintptrFromInt32(-1))
}
break
}
case 3:
{
- rc = bindText(tls, pStmt, i, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fz, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fn, crt.UintptrFromInt32(-1),
+ rc = bindText(tls, pStmt, i, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fz, (*Sqlite3_value)(unsafe.Pointer(pValue)).Fn, libc.UintptrFromInt32(-1),
(*Sqlite3_value)(unsafe.Pointer(pValue)).Fenc)
break
}
@@ -56884,7 +59007,7 @@ func Xsqlite3_bind_value(tls *crt.TLS, pStmt uintptr, i int32, pValue uintptr) i
}
return rc
}
-func Xsqlite3_bind_zeroblob(tls *crt.TLS, pStmt uintptr, i int32, n int32) int32 { /* sqlite3.c:84344:16: */
+func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) int32 { /* sqlite3.c:84539:16: */
var rc int32
var p uintptr = pStmt
rc = vdbeUnbind(tls, p, i)
@@ -56894,7 +59017,7 @@ func Xsqlite3_bind_zeroblob(tls *crt.TLS, pStmt uintptr, i int32, n int32) int32
}
return rc
}
-func Xsqlite3_bind_zeroblob64(tls *crt.TLS, pStmt uintptr, i int32, n Sqlite3_uint64) int32 { /* sqlite3.c:84354:16: */
+func Xsqlite3_bind_zeroblob64(tls *libc.TLS, pStmt uintptr, i int32, n Sqlite3_uint64) int32 { /* sqlite3.c:84549:16: */
var rc int32
var p uintptr = pStmt
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).Fdb)).Fmutex)
@@ -56911,7 +59034,7 @@ func Xsqlite3_bind_zeroblob64(tls *crt.TLS, pStmt uintptr, i int32, n Sqlite3_ui
// Return the number of wildcards that can be potentially bound to.
// This routine is added to support DBD::SQLite.
-func Xsqlite3_bind_parameter_count(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:84373:16: */
+func Xsqlite3_bind_parameter_count(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84568:16: */
var p uintptr = pStmt
if p != 0 {
return int32((*Vdbe)(unsafe.Pointer(p)).FnVar)
@@ -56923,7 +59046,7 @@ func Xsqlite3_bind_parameter_count(tls *crt.TLS, pStmt uintptr) int32 { /* sqlit
// is out of range or if the wildcard is unnamed.
//
// The result is always UTF-8.
-func Xsqlite3_bind_parameter_name(tls *crt.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84384:23: */
+func Xsqlite3_bind_parameter_name(tls *libc.TLS, pStmt uintptr, i int32) uintptr { /* sqlite3.c:84579:23: */
var p uintptr = pStmt
if p == uintptr(0) {
return uintptr(0)
@@ -56934,18 +59057,18 @@ func Xsqlite3_bind_parameter_name(tls *crt.TLS, pStmt uintptr, i int32) uintptr
// Given a wildcard parameter name, return the index of the variable
// with that name. If there is no variable with the given name,
// return 0.
-func Xsqlite3VdbeParameterIndex(tls *crt.TLS, p uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:84395:20: */
+func Xsqlite3VdbeParameterIndex(tls *libc.TLS, p uintptr, zName uintptr, nName int32) int32 { /* sqlite3.c:84590:20: */
if (p == uintptr(0)) || (zName == uintptr(0)) {
return 0
}
return Xsqlite3VListNameToNum(tls, (*Vdbe)(unsafe.Pointer(p)).FpVList, zName, nName)
}
-func Xsqlite3_bind_parameter_index(tls *crt.TLS, pStmt uintptr, zName uintptr) int32 { /* sqlite3.c:84399:16: */
+func Xsqlite3_bind_parameter_index(tls *libc.TLS, pStmt uintptr, zName uintptr) int32 { /* sqlite3.c:84594:16: */
return Xsqlite3VdbeParameterIndex(tls, pStmt, zName, Xsqlite3Strlen30(tls, zName))
}
// Transfer all bindings from the first statement over to the second.
-func Xsqlite3TransferBindings(tls *crt.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:84406:20: */
+func Xsqlite3TransferBindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:84601:20: */
var pFrom uintptr = pFromStmt
var pTo uintptr = pToStmt
var i int32
@@ -56968,7 +59091,7 @@ func Xsqlite3TransferBindings(tls *crt.TLS, pFromStmt uintptr, pToStmt uintptr)
// If the two statements contain a different number of bindings, then
// an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
// SQLITE_OK is returned.
-func Xsqlite3_transfer_bindings(tls *crt.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:84433:16: */
+func Xsqlite3_transfer_bindings(tls *libc.TLS, pFromStmt uintptr, pToStmt uintptr) int32 { /* sqlite3.c:84628:16: */
var pFrom uintptr = pFromStmt
var pTo uintptr = pToStmt
if int32((*Vdbe)(unsafe.Pointer(pFrom)).FnVar) != int32((*Vdbe)(unsafe.Pointer(pTo)).FnVar) {
@@ -56976,11 +59099,11 @@ func Xsqlite3_transfer_bindings(tls *crt.TLS, pFromStmt uintptr, pToStmt uintptr
}
if (*Vdbe)(unsafe.Pointer(pTo)).Fexpmask != 0 {
- crt.SetBitFieldPtr16Uint32(pTo+200 /* &.expired */, Bft(1), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(pTo+200 /* &.expired */, Bft(1), 0, 0x3)
}
if (*Vdbe)(unsafe.Pointer(pFrom)).Fexpmask != 0 {
- crt.SetBitFieldPtr16Uint32(pFrom+200 /* &.expired */, Bft(1), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(pFrom+200 /* &.expired */, Bft(1), 0, 0x3)
}
return Xsqlite3TransferBindings(tls, pFromStmt, pToStmt)
}
@@ -56989,7 +59112,7 @@ func Xsqlite3_transfer_bindings(tls *crt.TLS, pFromStmt uintptr, pToStmt uintptr
// in the argument belongs. This is the same database handle that was
// the first argument to the sqlite3_prepare() that was used to create
// the statement in the first place.
-func Xsqlite3_db_handle(tls *crt.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84457:20: */
+func Xsqlite3_db_handle(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84652:20: */
if pStmt != 0 {
return (*Vdbe)(unsafe.Pointer(pStmt)).Fdb
}
@@ -56998,7 +59121,7 @@ func Xsqlite3_db_handle(tls *crt.TLS, pStmt uintptr) uintptr { /* sqlite3.c:8445
// Return true if the prepared statement is guaranteed to not modify the
// database.
-func Xsqlite3_stmt_readonly(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:84465:16: */
+func Xsqlite3_stmt_readonly(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84660:16: */
if pStmt != 0 {
return int32(*(*uint16)(unsafe.Pointer(pStmt + 200 /* &.readOnly */)) & 0x80 >> 7)
}
@@ -57007,7 +59130,7 @@ func Xsqlite3_stmt_readonly(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:84
// Return 1 if the statement is an EXPLAIN and return 2 if the
// statement is an EXPLAIN QUERY PLAN
-func Xsqlite3_stmt_isexplain(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:84473:16: */
+func Xsqlite3_stmt_isexplain(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84668:16: */
if pStmt != 0 {
return int32(*(*uint16)(unsafe.Pointer(pStmt + 200 /* &.explain */)) & 0xc >> 2)
}
@@ -57015,16 +59138,16 @@ func Xsqlite3_stmt_isexplain(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:8
}
// Return true if the prepared statement is in need of being reset.
-func Xsqlite3_stmt_busy(tls *crt.TLS, pStmt uintptr) int32 { /* sqlite3.c:84480:16: */
+func Xsqlite3_stmt_busy(tls *libc.TLS, pStmt uintptr) int32 { /* sqlite3.c:84675:16: */
var v uintptr = pStmt
- return (crt.Bool32(((v != uintptr(0)) && ((*Vdbe)(unsafe.Pointer(v)).Fmagic == U32(0x2df20da3))) && ((*Vdbe)(unsafe.Pointer(v)).Fpc >= 0)))
+ return (libc.Bool32(((v != uintptr(0)) && ((*Vdbe)(unsafe.Pointer(v)).Fmagic == U32(0x2df20da3))) && ((*Vdbe)(unsafe.Pointer(v)).Fpc >= 0)))
}
// Return a pointer to the next prepared statement after pStmt associated
// with database connection pDb. If pStmt is NULL, return the first
// prepared statement for the database connection. Return NULL if there
// are no more.
-func Xsqlite3_next_stmt(tls *crt.TLS, pDb uintptr, pStmt uintptr) uintptr { /* sqlite3.c:84491:25: */
+func Xsqlite3_next_stmt(tls *libc.TLS, pDb uintptr, pStmt uintptr) uintptr { /* sqlite3.c:84686:25: */
var pNext uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(pDb)).Fmutex)
if pStmt == uintptr(0) {
@@ -57037,7 +59160,7 @@ func Xsqlite3_next_stmt(tls *crt.TLS, pDb uintptr, pStmt uintptr) uintptr { /* s
}
// Return the value of a status counter for a prepared statement
-func Xsqlite3_stmt_status(tls *crt.TLS, pStmt uintptr, op int32, resetFlag int32) int32 { /* sqlite3.c:84512:16: */
+func Xsqlite3_stmt_status(tls *libc.TLS, pStmt uintptr, op int32, resetFlag int32) int32 { /* sqlite3.c:84707:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -57063,7 +59186,7 @@ func Xsqlite3_stmt_status(tls *crt.TLS, pStmt uintptr, op int32, resetFlag int32
}
// Return the SQL associated with a prepared statement
-func Xsqlite3_sql(tls *crt.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84542:23: */
+func Xsqlite3_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84737:23: */
var p uintptr = pStmt
if p != 0 {
return (*Vdbe)(unsafe.Pointer(p)).FzSql
@@ -57078,7 +59201,7 @@ func Xsqlite3_sql(tls *crt.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84542:23:
//
// The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
// expanded bound parameters.
-func Xsqlite3_expanded_sql(tls *crt.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84556:17: */
+func Xsqlite3_expanded_sql(tls *libc.TLS, pStmt uintptr) uintptr { /* sqlite3.c:84751:17: */
var z uintptr = uintptr(0)
var zSql uintptr = Xsqlite3_sql(tls, pStmt)
if zSql != 0 {
@@ -57090,6 +59213,290 @@ func Xsqlite3_expanded_sql(tls *crt.TLS, pStmt uintptr) uintptr { /* sqlite3.c:8
return z
}
+// Allocate and populate an UnpackedRecord structure based on the serialized
+// record in nKey/pKey. Return a pointer to the new UnpackedRecord structure
+// if successful, or a NULL pointer if an OOM error is encountered.
+func vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr) uintptr { /* sqlite3.c:84789:23: */
+ var pRet uintptr // Return value
+
+ pRet = Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo)
+ if pRet != 0 {
+ libc.Xmemset(tls, (*UnpackedRecord)(unsafe.Pointer(pRet)).FaMem, 0, (uint64(unsafe.Sizeof(Mem{})) * (uint64(int32((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField) + 1))))
+ Xsqlite3VdbeRecordUnpack(tls, pKeyInfo, nKey, pKey, pRet)
+ }
+ return pRet
+}
+
+// This function is called from within a pre-update callback to retrieve
+// a field of the row currently being updated or deleted.
+func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:84808:16: */
+ var p uintptr
+ var pMem uintptr
+ var rc int32
+ var nRec U32
+ var aRec uintptr
+ p = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
+ rc = 0
+
+ // Test that this call is being made from within an SQLITE_DELETE or
+ // SQLITE_UPDATE pre-update callback, and that iIdx is within range.
+ if !(!(p != 0) || ((*PreUpdate)(unsafe.Pointer(p)).Fop == 18)) {
+ goto __1
+ }
+ rc = Xsqlite3MisuseError(tls, 84816)
+ goto preupdate_old_out
+__1:
+ ;
+ if !((*PreUpdate)(unsafe.Pointer(p)).FpPk != 0) {
+ goto __2
+ }
+ iIdx = int32(Xsqlite3TableColumnToIndex(tls, (*PreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx)))
+__2:
+ ;
+ if !((iIdx >= int32((*VdbeCursor)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) || (iIdx < 0)) {
+ goto __3
+ }
+ rc = 25
+ goto preupdate_old_out
+__3:
+ ;
+
+ // If the old.* record has not yet been loaded into memory, do so now.
+ if !((*PreUpdate)(unsafe.Pointer(p)).FpUnpacked == uintptr(0)) {
+ goto __4
+ }
+
+ nRec = Xsqlite3BtreePayloadSize(tls, *(*uintptr)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr + 56 /* &.uc */)))
+ aRec = Xsqlite3DbMallocRaw(tls, db, uint64(nRec))
+ if !(!(aRec != 0)) {
+ goto __5
+ }
+ goto preupdate_old_out
+__5:
+ ;
+ rc = Xsqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr + 56 /* &.uc */)), uint32(0), nRec, aRec)
+ if !(rc == 0) {
+ goto __6
+ }
+ (*PreUpdate)(unsafe.Pointer(p)).FpUnpacked = vdbeUnpackRecord(tls, (p + 32 /* &.keyinfo */), int32(nRec), aRec)
+ if !(!(int32((*PreUpdate)(unsafe.Pointer(p)).FpUnpacked) != 0)) {
+ goto __7
+ }
+ rc = 7
+__7:
+ ;
+__6:
+ ;
+ if !(rc != 0) {
+ goto __8
+ }
+ Xsqlite3DbFree(tls, db, aRec)
+ goto preupdate_old_out
+__8:
+ ;
+ (*PreUpdate)(unsafe.Pointer(p)).FaRecord = aRec
+__4:
+ ;
+
+ pMem = libc.AssignPtrUintptr(ppValue, ((*UnpackedRecord)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpUnpacked)).FaMem + uintptr(iIdx)*56))
+ if !(iIdx == int32((*Table)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey)) {
+ goto __9
+ }
+ Xsqlite3VdbeMemSetInt64(tls, pMem, (*PreUpdate)(unsafe.Pointer(p)).FiKey1)
+ goto __10
+__9:
+ if !(iIdx >= int32((*UnpackedRecord)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpUnpacked)).FnField)) {
+ goto __11
+ }
+ *(*uintptr)(unsafe.Pointer(ppValue)) = columnNullValue(tls)
+ goto __12
+__11:
+ if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpTab)).FaCol+uintptr(iIdx)*32)).Faffinity) == 0x45) {
+ goto __13
+ }
+ if !((int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & (0x0004 | 0x0020)) != 0) {
+ goto __14
+ }
+
+ Xsqlite3VdbeMemRealify(tls, pMem)
+__14:
+ ;
+__13:
+ ;
+__12:
+ ;
+__10:
+ ;
+
+preupdate_old_out:
+ Xsqlite3Error(tls, db, rc)
+ return Xsqlite3ApiExit(tls, db, rc)
+}
+
+// This function is called from within a pre-update callback to retrieve
+// the number of columns in the row being updated, deleted or inserted.
+func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84871:16: */
+ var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
+ return func() int32 {
+ if p != 0 {
+ return int32((*PreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField)
+ }
+ return 0
+ }()
+}
+
+// This function is designed to be called from within a pre-update callback
+// only. It returns zero if the change that caused the callback was made
+// immediately by a user SQL statement. Or, if the change was made by a
+// trigger program, it returns the number of trigger programs currently
+// on the stack (1 for a top-level trigger, 2 for a trigger fired by a
+// top-level trigger etc.).
+//
+// For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL
+// or SET DEFAULT action is considered a trigger.
+func Xsqlite3_preupdate_depth(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:84889:16: */
+ var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
+ return func() int32 {
+ if p != 0 {
+ return (*Vdbe)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).Fv)).FnFrame
+ }
+ return 0
+ }()
+}
+
+// This function is called from within a pre-update callback to retrieve
+// a field of the row currently being updated or inserted.
+func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) int32 { /* sqlite3.c:84900:16: */
+ var p uintptr
+ var rc int32
+ var pMem uintptr
+ var pData uintptr
+ // For an INSERT, memory cell p->iNewReg contains the serialized record
+ // that is being inserted. Deserialize it.
+ var pUnpack uintptr
+ p = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdate
+ rc = 0
+
+ if !(!(p != 0) || ((*PreUpdate)(unsafe.Pointer(p)).Fop == 9)) {
+ goto __1
+ }
+ rc = Xsqlite3MisuseError(tls, 84906)
+ goto preupdate_new_out
+__1:
+ ;
+ if !(((*PreUpdate)(unsafe.Pointer(p)).FpPk != 0) && ((*PreUpdate)(unsafe.Pointer(p)).Fop != 23)) {
+ goto __2
+ }
+ iIdx = int32(Xsqlite3TableColumnToIndex(tls, (*PreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx)))
+__2:
+ ;
+ if !((iIdx >= int32((*VdbeCursor)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) || (iIdx < 0)) {
+ goto __3
+ }
+ rc = 25
+ goto preupdate_new_out
+__3:
+ ;
+
+ if !((*PreUpdate)(unsafe.Pointer(p)).Fop == 18) {
+ goto __4
+ }
+ // For an INSERT, memory cell p->iNewReg contains the serialized record
+ // that is being inserted. Deserialize it.
+ pUnpack = (*PreUpdate)(unsafe.Pointer(p)).FpNewUnpacked
+ if !(!(pUnpack != 0)) {
+ goto __6
+ }
+ pData = ((*Vdbe)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).Fv)).FaMem + uintptr((*PreUpdate)(unsafe.Pointer(p)).FiNewReg)*56)
+ rc = func() int32 {
+ if (int32((*Mem)(unsafe.Pointer((pData))).Fflags) & 0x4000) != 0 {
+ return Xsqlite3VdbeMemExpandBlob(tls, pData)
+ }
+ return 0
+ }()
+ if !(rc != 0) {
+ goto __7
+ }
+ goto preupdate_new_out
+__7:
+ ;
+ pUnpack = vdbeUnpackRecord(tls, (p + 32 /* &.keyinfo */), (*Mem)(unsafe.Pointer(pData)).Fn, (*Mem)(unsafe.Pointer(pData)).Fz)
+ if !(!(pUnpack != 0)) {
+ goto __8
+ }
+ rc = 7
+ goto preupdate_new_out
+__8:
+ ;
+ (*PreUpdate)(unsafe.Pointer(p)).FpNewUnpacked = pUnpack
+__6:
+ ;
+ pMem = ((*UnpackedRecord)(unsafe.Pointer(pUnpack)).FaMem + uintptr(iIdx)*56)
+ if !(iIdx == int32((*Table)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey)) {
+ goto __9
+ }
+ Xsqlite3VdbeMemSetInt64(tls, pMem, (*PreUpdate)(unsafe.Pointer(p)).FiKey2)
+ goto __10
+__9:
+ if !(iIdx >= int32((*UnpackedRecord)(unsafe.Pointer(pUnpack)).FnField)) {
+ goto __11
+ }
+ pMem = columnNullValue(tls)
+__11:
+ ;
+__10:
+ ;
+ goto __5
+__4:
+ // For an UPDATE, memory cell (p->iNewReg+1+iIdx) contains the required
+ // value. Make a copy of the cell contents and return a pointer to it.
+ // It is not safe to return a pointer to the memory cell itself as the
+ // caller may modify the value text encoding.
+ ;
+ if !(!(int32((*PreUpdate)(unsafe.Pointer(p)).FaNew) != 0)) {
+ goto __12
+ }
+ (*PreUpdate)(unsafe.Pointer(p)).FaNew = Xsqlite3DbMallocZero(tls, db, (uint64(uint64(unsafe.Sizeof(Mem{})) * uint64((*VdbeCursor)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))))
+ if !(!(int32((*PreUpdate)(unsafe.Pointer(p)).FaNew) != 0)) {
+ goto __13
+ }
+ rc = 7
+ goto preupdate_new_out
+__13:
+ ;
+__12:
+ ;
+
+ pMem = ((*PreUpdate)(unsafe.Pointer(p)).FaNew + uintptr(iIdx)*56)
+ if !(int32((*Mem)(unsafe.Pointer(pMem)).Fflags) == 0) {
+ goto __14
+ }
+ if !(iIdx == int32((*Table)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey)) {
+ goto __15
+ }
+ Xsqlite3VdbeMemSetInt64(tls, pMem, (*PreUpdate)(unsafe.Pointer(p)).FiKey2)
+ goto __16
+__15:
+ rc = Xsqlite3VdbeMemCopy(tls, pMem, ((*Vdbe)(unsafe.Pointer((*PreUpdate)(unsafe.Pointer(p)).Fv)).FaMem + uintptr((((*PreUpdate)(unsafe.Pointer(p)).FiNewReg+1)+iIdx))*56))
+ if !(rc != 0) {
+ goto __17
+ }
+ goto preupdate_new_out
+__17:
+ ;
+__16:
+ ;
+__14:
+ ;
+__5:
+ ;
+ *(*uintptr)(unsafe.Pointer(ppValue)) = pMem
+
+preupdate_new_out:
+ Xsqlite3Error(tls, db, rc)
+ return Xsqlite3ApiExit(tls, db, rc)
+}
+
//************* End of vdbeapi.c ********************************************
//************* Begin file vdbetrace.c **************************************
// 2009 November 25
@@ -57114,7 +59521,7 @@ func Xsqlite3_expanded_sql(tls *crt.TLS, pStmt uintptr) uintptr { /* sqlite3.c:8
// bytes in this text up to but excluding the first character in
// a host parameter. If the text contains no host parameters, return
// the total number of bytes in the text.
-func findNextHostParameter(tls *crt.TLS, zSql uintptr, pnToken uintptr) int32 { /* sqlite3.c:84875:12: */
+func findNextHostParameter(tls *libc.TLS, zSql uintptr, pnToken uintptr) int32 { /* sqlite3.c:85070:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -57159,7 +59566,7 @@ func findNextHostParameter(tls *crt.TLS, zSql uintptr, pnToken uintptr) int32 {
// statement for the corresponding OP_Variable opcode. Once the host
// parameter index is known, locate the value in p->aVar[]. Then render
// the value as a literal in place of the host parameter name.
-func Xsqlite3VdbeExpandSql(tls *crt.TLS, p uintptr, zRawSql uintptr) uintptr { /* sqlite3.c:84918:21: */
+func Xsqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) uintptr { /* sqlite3.c:85113:21: */
bp := tls.Alloc(248)
defer tls.Free(248)
@@ -57184,9 +59591,9 @@ func Xsqlite3VdbeExpandSql(tls *crt.TLS, p uintptr, zRawSql uintptr) uintptr { /
if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 1 {
for *(*int8)(unsafe.Pointer(zRawSql)) != 0 {
var zStart uintptr = zRawSql
- for (int32(*(*int8)(unsafe.Pointer(crt.PostIncUintptr(&zRawSql, 1)))) != '\n') && (*(*int8)(unsafe.Pointer(zRawSql)) != 0) {
+ for (int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zRawSql, 1)))) != '\n') && (*(*int8)(unsafe.Pointer(zRawSql)) != 0) {
}
- Xsqlite3_str_append(tls, bp+48 /* &out */, ts+4896 /* "-- " */, 3)
+ Xsqlite3_str_append(tls, bp+48 /* &out */, ts+7094 /* "-- " */, 3)
Xsqlite3_str_append(tls, bp+48 /* &out */, zStart, (int32((int64(zRawSql) - int64(zStart)) / 1)))
}
@@ -57218,16 +59625,16 @@ func Xsqlite3VdbeExpandSql(tls *crt.TLS, p uintptr, zRawSql uintptr) uintptr { /
pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr((*(*int32)(unsafe.Pointer(bp + 184 /* idx */))-1))*56)
if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & 0x0001) != 0 {
- Xsqlite3_str_append(tls, bp+48 /* &out */, ts+673 /* "NULL" */, 4)
+ Xsqlite3_str_append(tls, bp+48 /* &out */, ts+782 /* "NULL" */, 4)
} else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & (0x0004 | 0x0020)) != 0 {
- Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+456 /* "%lld" */, crt.VaList(bp, *(*I64)(unsafe.Pointer(pVar /* &.u */))))
+ Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+6670 /* "%lld" */, libc.VaList(bp, *(*I64)(unsafe.Pointer(pVar /* &.u */))))
} else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & 0x0008) != 0 {
- Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4424 /* "%!.15g" */, crt.VaList(bp+8, *(*float64)(unsafe.Pointer(pVar /* &.u */))))
+ Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+6559 /* "%!.15g" */, libc.VaList(bp+8, *(*float64)(unsafe.Pointer(pVar /* &.u */))))
} else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & 0x0002) != 0 {
var nOut int32 // Number of bytes of the string text to include in output
var enc U8 = (*Sqlite3)(unsafe.Pointer(db)).Fenc
if int32(enc) != 1 {
- crt.Xmemset(tls, bp+192 /* &utf8 */, 0, uint64(unsafe.Sizeof(Mem{})))
+ libc.Xmemset(tls, bp+192 /* &utf8 */, 0, uint64(unsafe.Sizeof(Mem{})))
(*Mem)(unsafe.Pointer(bp + 192 /* &utf8 */)).Fdb = db
Xsqlite3VdbeMemSetStr(tls, bp+192 /* &utf8 */, (*Mem)(unsafe.Pointer(pVar)).Fz, (*Mem)(unsafe.Pointer(pVar)).Fn, enc, uintptr(0))
if 7 == Xsqlite3VdbeChangeEncoding(tls, bp+192 /* &utf8 */, 1) {
@@ -57237,21 +59644,21 @@ func Xsqlite3VdbeExpandSql(tls *crt.TLS, p uintptr, zRawSql uintptr) uintptr { /
pVar = bp + 192 /* &utf8 */
}
nOut = (*Mem)(unsafe.Pointer(pVar)).Fn
- Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4900 /* "'%.*q'" */, crt.VaList(bp+16, nOut, (*Mem)(unsafe.Pointer(pVar)).Fz))
+ Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+7098 /* "'%.*q'" */, libc.VaList(bp+16, nOut, (*Mem)(unsafe.Pointer(pVar)).Fz))
if int32(enc) != 1 {
Xsqlite3VdbeMemRelease(tls, bp+192 /* &utf8 */)
}
} else if (int32((*Mem)(unsafe.Pointer(pVar)).Fflags) & 0x4000) != 0 {
- Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4907 /* "zeroblob(%d)" */, crt.VaList(bp+32, *(*int32)(unsafe.Pointer(pVar /* &.u */))))
+ Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+7105 /* "zeroblob(%d)" */, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pVar /* &.u */))))
} else {
var nOut int32 // Number of bytes of the blob to include in output
- Xsqlite3_str_append(tls, bp+48 /* &out */, ts+4920 /* "x'" */, 2)
+ Xsqlite3_str_append(tls, bp+48 /* &out */, ts+7118 /* "x'" */, 2)
nOut = (*Mem)(unsafe.Pointer(pVar)).Fn
for i = 0; i < nOut; i++ {
- Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+4923 /* "%02x" */, crt.VaList(bp+40, (int32(*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&0xff)))
+ Xsqlite3_str_appendf(tls, bp+48 /* &out */, ts+7121 /* "%02x" */, libc.VaList(bp+40, (int32(*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&0xff)))
}
- Xsqlite3_str_append(tls, bp+48 /* &out */, ts+4928 /* "'" */, 1)
+ Xsqlite3_str_append(tls, bp+48 /* &out */, ts+7126 /* "'" */, 1)
}
}
}
@@ -57297,7 +59704,7 @@ func Xsqlite3VdbeExpandSql(tls *crt.TLS, p uintptr, zRawSql uintptr) uintptr { /
// procedures use this information to make sure that indices are
// working correctly. This variable has no function other than to
// help verify the correct operation of the library.
-var Xsqlite3_search_count int32 = 0 /* sqlite3.c:85090:16 */
+var Xsqlite3_search_count int32 = 0 /* sqlite3.c:85285:16 */
// When this global variable is positive, it gets decremented once before
// each instruction in the VDBE. When it reaches zero, the u1.isInterrupted
@@ -57305,22 +59712,22 @@ var Xsqlite3_search_count int32 = 0 /* sqlite3.c:85090:16 */
//
// This facility is used for testing purposes only. It does not function
// in an ordinary build.
-var Xsqlite3_interrupt_count int32 = 0 /* sqlite3.c:85102:16 */
+var Xsqlite3_interrupt_count int32 = 0 /* sqlite3.c:85297:16 */
// The next global variable is incremented each type the OP_Sort opcode
// is executed. The test procedures use this information to make sure that
// sorting is occurring or not occurring at appropriate times. This variable
// has no function other than to help verify the correct operation of the
// library.
-var Xsqlite3_sort_count int32 = 0 /* sqlite3.c:85113:16 */
+var Xsqlite3_sort_count int32 = 0 /* sqlite3.c:85308:16 */
// The next global variable records the size of the largest MEM_Blob
// or MEM_Str that has been used by a VDBE opcode. The test procedures
// use this information to make sure that the zero-blob functionality
// is working correctly. This variable has no function other than to
// help verify the correct operation of the library.
-var Xsqlite3_max_blobsize int32 = 0 /* sqlite3.c:85124:16 */
-func updateMaxBlobsize(tls *crt.TLS, p uintptr) { /* sqlite3.c:85125:13: */
+var Xsqlite3_max_blobsize int32 = 0 /* sqlite3.c:85319:16 */
+func updateMaxBlobsize(tls *libc.TLS, p uintptr) { /* sqlite3.c:85320:13: */
if ((int32((*Mem)(unsafe.Pointer(p)).Fflags) & (0x0002 | 0x0010)) != 0) && ((*Mem)(unsafe.Pointer(p)).Fn > Xsqlite3_max_blobsize) {
Xsqlite3_max_blobsize = (*Mem)(unsafe.Pointer(p)).Fn
}
@@ -57334,7 +59741,7 @@ func updateMaxBlobsize(tls *crt.TLS, p uintptr) { /* sqlite3.c:85125:13: */
// operation implemented using OP_FkIsZero is working. This variable
// has no function other than to help verify the correct operation of the
// library.
-var Xsqlite3_found_count int32 = 0 /* sqlite3.c:85150:16 */
+var Xsqlite3_found_count int32 = 0 /* sqlite3.c:85345:16 */
// Test a register to see if it exceeds the current maximum blob size.
// If it does, record the new maximum blob size.
@@ -57389,7 +59796,7 @@ var Xsqlite3_found_count int32 = 0 /* sqlite3.c:85150:16 */
// Allocate VdbeCursor number iCur. Return a pointer to it. Return NULL
// if we run out of memory.
-func allocateCursor(tls *crt.TLS, p uintptr, iCur int32, nField int32, iDb int32, eCurType U8) uintptr { /* sqlite3.c:85283:19: */
+func allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, iDb int32, eCurType U8) uintptr { /* sqlite3.c:85478:19: */
// Find the memory cell that will be used to store the blob of memory
// required for this VdbeCursor structure. It is convenient to use a
// vdbe memory cell to manage the memory allocation required for a
@@ -57415,7 +59822,7 @@ func allocateCursor(tls *crt.TLS, p uintptr, iCur int32, nField int32, iDb int32
}
var nByte int32
var pCx uintptr = uintptr(0)
- nByte = (int32(((((uint64(unsafe.Sizeof(VdbeCursor{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))) + ((uint64(2) * uint64(unsafe.Sizeof(U32(0)))) * uint64(nField))) + (func() uint64 {
+ nByte = (int32(((((uint64(unsafe.Sizeof(VdbeCursor{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))) + ((uint64(2) * uint64(unsafe.Sizeof(U32(0)))) * uint64(nField))) + (func() uint64 {
if int32(eCurType) == 0 {
return uint64(Xsqlite3BtreeCursorSize(tls))
}
@@ -57428,20 +59835,20 @@ func allocateCursor(tls *crt.TLS, p uintptr, iCur int32, nField int32, iDb int32
// OP_OpenDup, the cursor will not be closed and will still be part
// of a BtShared.pCursor list.
if (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)))).FpBtx == uintptr(0) {
- crt.SetBitFieldPtr8Uint32(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))+8 /* &.isEphemeral */, Bool(0), 0, 0x1)
+ libc.SetBitFieldPtr8Uint32(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))+8 /* &.isEphemeral */, Bool(0), 0, 0x1)
}
Xsqlite3VdbeFreeCursor(tls, p, *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)))
*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0)
}
if 0 == Xsqlite3VdbeMemClearAndResize(tls, pMem, nByte) {
- *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = crt.AssignUintptr(&pCx, (*Mem)(unsafe.Pointer(pMem)).Fz)
- crt.Xmemset(tls, pCx, 0, uint64((uintptr(0) + 48 /* &.pAltCursor */)))
+ *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = libc.AssignUintptr(&pCx, (*Mem)(unsafe.Pointer(pMem)).Fz)
+ libc.Xmemset(tls, pCx, 0, uint64((uintptr(0) + 48 /* &.pAltCursor */)))
(*VdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType
(*VdbeCursor)(unsafe.Pointer(pCx)).FiDb = I8(iDb)
(*VdbeCursor)(unsafe.Pointer(pCx)).FnField = I16(nField)
(*VdbeCursor)(unsafe.Pointer(pCx)).FaOffset = ((pCx + 120 /* &.aType */) + uintptr(nField)*4)
if int32(eCurType) == 0 {
- *(*uintptr)(unsafe.Pointer(pCx + 56 /* &.uc */)) = ((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(((((uint64(unsafe.Sizeof(VdbeCursor{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))) + ((uint64(2) * uint64(unsafe.Sizeof(U32(0)))) * uint64(nField)))))
+ *(*uintptr)(unsafe.Pointer(pCx + 56 /* &.uc */)) = ((*Mem)(unsafe.Pointer(pMem)).Fz + uintptr(((((uint64(unsafe.Sizeof(VdbeCursor{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))) + ((uint64(2) * uint64(unsafe.Sizeof(U32(0)))) * uint64(nField)))))
Xsqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 56 /* &.uc */)))
}
}
@@ -57452,13 +59859,13 @@ func allocateCursor(tls *crt.TLS, p uintptr, iCur int32, nField int32, iDb int32
// floating point value of rValue. Return true and set *piValue to the
// integer value if the string is in range to be an integer. Otherwise,
// return false.
-func alsoAnInt(tls *crt.TLS, pRec uintptr, rValue float64, piValue uintptr) int32 { /* sqlite3.c:85348:12: */
+func alsoAnInt(tls *libc.TLS, pRec uintptr, rValue float64, piValue uintptr) int32 { /* sqlite3.c:85543:12: */
var iValue I64 = I64(rValue)
if Xsqlite3RealSameAsInt(tls, rValue, iValue) != 0 {
*(*I64)(unsafe.Pointer(piValue)) = iValue
return 1
}
- return (crt.Bool32(0 == Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pRec)).Fz, piValue, (*Mem)(unsafe.Pointer(pRec)).Fn, (*Mem)(unsafe.Pointer(pRec)).Fenc)))
+ return (libc.Bool32(0 == Xsqlite3Atoi64(tls, (*Mem)(unsafe.Pointer(pRec)).Fz, piValue, (*Mem)(unsafe.Pointer(pRec)).Fn, (*Mem)(unsafe.Pointer(pRec)).Fenc)))
}
// Try to convert a value into a numeric representation if we can
@@ -57474,7 +59881,7 @@ func alsoAnInt(tls *crt.TLS, pRec uintptr, rValue float64, piValue uintptr) int3
// If bTryForInt is false, then if the input string contains a decimal
// point or exponential notation, the result is only MEM_Real, even
// if there is an exact integer representation of the quantity.
-func applyNumericAffinity(tls *crt.TLS, pRec uintptr, bTryForInt int32) { /* sqlite3.c:85372:13: */
+func applyNumericAffinity(tls *libc.TLS, pRec uintptr, bTryForInt int32) { /* sqlite3.c:85567:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -57500,7 +59907,7 @@ func applyNumericAffinity(tls *crt.TLS, pRec uintptr, bTryForInt int32) { /* sql
// string representation after computing a numeric equivalent, because the
// string representation might not be the canonical representation for the
// numeric value. Ticket [343634942dd54ab57b7024] 2018-01-31.
- *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0002))))
+ *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0002))))
}
// Processing is determine by the affinity parameter:
@@ -57520,7 +59927,7 @@ func applyNumericAffinity(tls *crt.TLS, pRec uintptr, bTryForInt int32) { /* sql
// SQLITE_AFF_BLOB:
// SQLITE_AFF_NONE:
// No-op. pRec is unchanged.
-func applyAffinity(tls *crt.TLS, pRec uintptr, affinity int8, enc U8) { /* sqlite3.c:85412:13: */
+func applyAffinity(tls *libc.TLS, pRec uintptr, affinity int8, enc U8) { /* sqlite3.c:85607:13: */
if int32(affinity) >= 0x43 {
if (int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & 0x0004) == 0 { //OPTIMIZATION-IF-FALSE
@@ -57544,7 +59951,7 @@ func applyAffinity(tls *crt.TLS, pRec uintptr, affinity int8, enc U8) { /* sqlit
Xsqlite3VdbeMemStringify(tls, pRec, enc, uint8(1))
}
}
- *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(((0x0008 | 0x0004) | 0x0020)))))
+ *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(((0x0008 | 0x0004) | 0x0020)))))
}
}
@@ -57552,7 +59959,7 @@ func applyAffinity(tls *crt.TLS, pRec uintptr, affinity int8, enc U8) { /* sqlit
// into a numeric representation. Use either INTEGER or REAL whichever
// is appropriate. But only do the conversion if it is possible without
// loss of information and return the revised type of the argument.
-func Xsqlite3_value_numeric_type(tls *crt.TLS, pVal uintptr) int32 { /* sqlite3.c:85451:16: */
+func Xsqlite3_value_numeric_type(tls *libc.TLS, pVal uintptr) int32 { /* sqlite3.c:85646:16: */
var eType int32 = Xsqlite3_value_type(tls, pVal)
if eType == 3 {
var pMem uintptr = pVal
@@ -57564,7 +59971,7 @@ func Xsqlite3_value_numeric_type(tls *crt.TLS, pVal uintptr) int32 { /* sqlite3.
// Exported version of applyAffinity(). This one works on sqlite3_value*,
// not the internal Mem* type.
-func Xsqlite3ValueApplyAffinity(tls *crt.TLS, pVal uintptr, affinity U8, enc U8) { /* sqlite3.c:85465:21: */
+func Xsqlite3ValueApplyAffinity(tls *libc.TLS, pVal uintptr, affinity U8, enc U8) { /* sqlite3.c:85660:21: */
applyAffinity(tls, pVal, int8(affinity), enc)
}
@@ -57572,7 +59979,7 @@ func Xsqlite3ValueApplyAffinity(tls *crt.TLS, pVal uintptr, affinity U8, enc U8)
// interpret as a string if we want to). Compute its corresponding
// numeric type, if has one. Set the pMem->u.r and pMem->u.i fields
// accordingly.
-func computeNumericType(tls *crt.TLS, pMem uintptr) U16 { /* sqlite3.c:85479:28: */
+func computeNumericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85674:28: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -57603,7 +60010,7 @@ func computeNumericType(tls *crt.TLS, pMem uintptr) U16 { /* sqlite3.c:85479:28:
//
// Unlike applyNumericAffinity(), this routine does not modify pMem->flags.
// But it does set pMem->u.r and pMem->u.i appropriately.
-func numericType(tls *crt.TLS, pMem uintptr) U16 { /* sqlite3.c:85507:12: */
+func numericType(tls *libc.TLS, pMem uintptr) U16 { /* sqlite3.c:85702:12: */
if (int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & ((0x0004 | 0x0008) | 0x0020)) != 0 {
return (U16(int32((*Mem)(unsafe.Pointer(pMem)).Fflags) & ((0x0004 | 0x0008) | 0x0020)))
@@ -57617,12 +60024,12 @@ func numericType(tls *crt.TLS, pMem uintptr) U16 { /* sqlite3.c:85507:12: */
// Return the register of pOp->p2 after first preparing it to be
// overwritten with an integer value.
-func out2PrereleaseWithClear(tls *crt.TLS, pOut uintptr) uintptr { /* sqlite3.c:85766:28: */
+func out2PrereleaseWithClear(tls *libc.TLS, pOut uintptr) uintptr { /* sqlite3.c:85961:28: */
Xsqlite3VdbeMemSetNull(tls, pOut)
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(0x0004)
return pOut
}
-func out2Prerelease(tls *crt.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3.c:85771:12: */
+func out2Prerelease(tls *libc.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3.c:85966:12: */
var pOut uintptr
pOut = ((*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*VdbeOp)(unsafe.Pointer(pOp)).Fp2)*56)
@@ -57638,7 +60045,7 @@ func out2Prerelease(tls *crt.TLS, p uintptr, pOp uintptr) uintptr { /* sqlite3.c
// Execute as much of a VDBE program as we can.
// This is the core of sqlite3_step().
-func Xsqlite3VdbeExec(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:85790:20: */
+func Xsqlite3VdbeExec(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:85985:20: */
bp := tls.Alloc(848)
defer tls.Free(848)
@@ -57649,8 +60056,8 @@ func Xsqlite3VdbeExec(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:85790:20: */
var resetSchemaOnFault U8 // Reset schema after an error if positive
var encoding U8 // The database encoding
var iCompare int32 // Result of last comparison
- var nVmStep uint32 // Number of virtual machine steps
- var nProgressLimit uint32 // Invoke xProgress() when nVmStep reaches this
+ var nVmStep U64 // Number of virtual machine steps
+ var nProgressLimit U64 // Invoke xProgress() when nVmStep reaches this
var aMem uintptr // Copy of p->aMem
var pIn1 uintptr // 1st input operand
var pIn2 uintptr // 2nd input operand
@@ -57677,13 +60084,13 @@ func Xsqlite3VdbeExec(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:85790:20: */
var type1 U16 // Numeric type of left operand
var type2 U16 // Numeric type of right operand
var iA I64 // Integer value of left operand
- // var iB I64 at bp+184, 8
+ // var iB I64 at bp+176, 8
// Integer value of right operand
var rA float64 // Real value of left operand
var rB float64 // same as TK_RSHIFT, in1, in2, out3
- // var iA1 I64 at bp+200, 8
+ // var iA1 I64 at bp+192, 8
- // var uA U64 at bp+192, 8
+ // var uA U64 at bp+184, 8
var iB1 I64
var op U8 // same as TK_GE, jump, in1, in3
@@ -57697,7 +60104,7 @@ func Xsqlite3VdbeExec(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:85790:20: */
var p11 int32
var p21 int32
var pKeyInfo uintptr
- var idx int32
+ var idx U32
var pColl uintptr // Collating sequence to use on this term
var bRev int32 // True for DESCENDING sort order
var aPermute uintptr // same as TK_OR, in1, in2, out3
@@ -57705,23 +60112,24 @@ func Xsqlite3VdbeExec(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:85790:20: */
var v2 int32 // jump
var iAddr U32 // jump, in1
var c int32 // jump, in1
- var c1 int32
- // var p22 int32 at bp+216, 4
+ var c1 int32 // out3
+ var pC uintptr
+ // var p22 U32 at bp+208, 4
// column number to retrieve
- // var pC uintptr at bp+208, 8
+ // var pC1 uintptr at bp+200, 8
// The VDBE cursor
var pCrsr uintptr // The BTree cursor
var aOffset uintptr // aOffset[i] is offset to start of data for i-th column
var len int32 // The length of the serialized data for the column
var i2 int32 // Loop counter
var pDest uintptr // Where to write the extracted value
- // var sMem Mem at bp+224, 56
+ // var sMem Mem at bp+216, 56
// For storing the record being decoded
var zData uintptr // Part of the record being decoded
var zHdr uintptr // Next unparsed byte of the header
var zEndHdr uintptr // Pointer to first byte after the header
var offset64 U64 // 64-bit offset
- // var t U32 at bp+280, 4
+ // var t U32 at bp+272, 4
// A type code from the record header
var pReg uintptr
var zAffinity uintptr
@@ -57743,7 +60151,7 @@ func Xsqlite3VdbeExec(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:85790:20: */
var len1 U32 // Length of a field
var zHdr1 uintptr // Where to write next byte of the header
var zPayload uintptr // out2
- // var nEntry I64 at bp+288, 8
+ // var nEntry I64 at bp+280, 8
var pCrsr1 uintptr
var isSchemaChange int32
@@ -57763,16 +60171,16 @@ func Xsqlite3VdbeExec(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:85790:20: */
var desiredAutoCommit int32
var iRollback int32
var pBt uintptr
- // var iMeta int32 at bp+296, 4
+ // var iMeta int32 at bp+288, 4
// out2
- // var iMeta1 int32 at bp+300, 4
+ // var iMeta1 int32 at bp+292, 4
var iDb int32
var iCookie int32
var pDb uintptr
var nField1 int32
var pKeyInfo1 uintptr
- var p23 int32
+ var p23 U32
var iDb1 int32
var wrFlag int32
var pX uintptr
@@ -57783,124 +60191,124 @@ func Xsqlite3VdbeExec(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:85790:20: */
var pCx1 uintptr
var pKeyInfo2 uintptr
var pCx2 uintptr
- var pC1 uintptr
+ var pC2 uintptr
var pCx3 uintptr
var flags31 U16
var newType U16 // jump, in3, group
- // var res1 int32 at bp+304, 4
+ // var res1 int32 at bp+296, 4
// Comparison result
var oc int32 // Opcode
- var pC2 uintptr // The cursor to seek
- // var r UnpackedRecord at bp+312, 24
+ var pC3 uintptr // The cursor to seek
+ // var r UnpackedRecord at bp+304, 24
// The key to seek for
var nField2 int32 // Number of columns or fields in the key
var iKey I64 // The rowid we are to seek to
var eqOnly int32
- var pC3 uintptr // jump, in3
var pC4 uintptr // jump, in3
+ var pC5 uintptr // jump, in3
var alreadyExists int32
var takeJump int32
var ii1 int32
- var pC5 uintptr
- // var res3 int32 at bp+360, 4
+ var pC6 uintptr
+ // var res3 int32 at bp+352, 4
var pFree uintptr
var pIdxKey uintptr
- // var r1 UnpackedRecord at bp+336, 24
+ // var r1 UnpackedRecord at bp+328, 24
// If pIn3->u.i does not contain an integer, compute iKey as the
// integer value of pIn3. Jump to P2 if pIn3 cannot be converted
// into an integer without loss of information. Take care to avoid
// changing the datatype of pIn3, however, as it is used by other
// parts of the prepared statement.
- // var x Mem at bp+368, 56
+ // var x Mem at bp+360, 56
// jump, in3
- var pC6 uintptr
+ var pC7 uintptr
var pCrsr2 uintptr
- // var res4 int32 at bp+424, 4
+ // var res4 int32 at bp+416, 4
var iKey1 U64 // out2
- // var v I64 at bp+432, 8
+ // var v I64 at bp+424, 8
// The new rowid
- var pC7 uintptr // Cursor of table to get the new rowid
- // var res5 int32 at bp+428, 4
+ var pC8 uintptr // Cursor of table to get the new rowid
+ // var res5 int32 at bp+420, 4
// Result of an sqlite3BtreeLast()
var cnt1 int32 // Counter to limit the number of searches
var pMem1 uintptr // Register holding largest rowid for AUTOINCREMENT
var pFrame1 uintptr
var pData uintptr // MEM cell holding data for the record to be inserted
var pKey uintptr // MEM cell holding key for the record
- var pC8 uintptr // Cursor to table into which insert is written
+ var pC9 uintptr // Cursor to table into which insert is written
var seekResult int32 // Result of prior seek or 0 if no USESEEKRESULT flag
var zDb uintptr // database name - used by the update hook
var pTab uintptr // Table structure - used by update and pre-update hooks
- // var x1 BtreePayload at bp+440, 48
+ // var x1 BtreePayload at bp+432, 48
- var pC9 uintptr
+ var pC10 uintptr
var zDb1 uintptr
var pTab1 uintptr
var opflags int32
- var pC10 uintptr
- // var res6 int32 at bp+488, 4
+ var pC11 uintptr
+ // var res6 int32 at bp+480, 4
var nKeyCol int32
- var pC11 uintptr
var pC12 uintptr
+ var pC13 uintptr
var pCrsr3 uintptr
var n3 U32 // out2
- var pC13 uintptr
- // var v3 I64 at bp+496, 8
+ var pC14 uintptr
+ // var v3 I64 at bp+488, 8
var pVtab uintptr
var pModule uintptr
- var pC14 uintptr // jump
- var pC15 uintptr
+ var pC15 uintptr // jump
+ var pC16 uintptr
var pCrsr4 uintptr
- // var res7 int32 at bp+504, 4
+ // var res7 int32 at bp+496, 4
// jump
- var pC16 uintptr
+ var pC17 uintptr
var pCrsr5 uintptr
- // var res8 int32 at bp+508, 4
+ // var res8 int32 at bp+500, 4
var sz I64 // jump
- var pC17 uintptr
+ var pC18 uintptr
var pCrsr6 uintptr
- // var res9 int32 at bp+512, 4
+ // var res9 int32 at bp+504, 4
// jump
- var pC18 uintptr // in2
- var pC19 uintptr
- // var x2 BtreePayload at bp+520, 48
- // in2
+ var pC19 uintptr // in2
var pC20 uintptr
+ // var x2 BtreePayload at bp+512, 48
+ // in2
var pC21 uintptr
+ var pC22 uintptr
var pCrsr7 uintptr
- // var res10 int32 at bp+592, 4
+ // var res10 int32 at bp+584, 4
- // var r2 UnpackedRecord at bp+568, 24
+ // var r2 UnpackedRecord at bp+560, 24
// out2
- var pC22 uintptr // The P1 index cursor
+ var pC23 uintptr // The P1 index cursor
var pTabCur uintptr // The P2 table cursor (OP_DeferredSeek only)
- // var rowid I64 at bp+600, 8
+ // var rowid I64 at bp+592, 8
- var pC23 uintptr // jump
- var pC24 uintptr
- // var res11 int32 at bp+632, 4
+ var pC24 uintptr // jump
+ var pC25 uintptr
+ // var res11 int32 at bp+624, 4
- // var r3 UnpackedRecord at bp+608, 24
+ // var r3 UnpackedRecord at bp+600, 24
// out2
- // var iMoved int32 at bp+636, 4
+ // var iMoved int32 at bp+628, 4
var iDb2 int32
- // var nChange int32 at bp+640, 4
+ // var nChange int32 at bp+632, 4
- var pC25 uintptr // out2
- // var pgno int32 at bp+644, 4
+ var pC26 uintptr // out2
+ // var pgno Pgno at bp+636, 4
var pDb2 uintptr
var iDb3 int32
- var zMaster uintptr
+ var zSchema uintptr
var zSql uintptr
- // var initData InitData at bp+648, 32
+ // var initData InitData at bp+640, 40
var nRoot int32 // Number of tables to check. (Number of root pages.)
var aRoot uintptr // Array of rootpage numbers for tables to be checked
@@ -57941,8 +60349,8 @@ func Xsqlite3VdbeExec(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:85790:20: */
var eOld int32 // The old journal mode
var zFilename uintptr // jump
var pBt2 uintptr
- var pC26 uintptr
var pC27 uintptr
+ var pC28 uintptr
var z1 uintptr
var p13 int32
var isWriteLock U8
@@ -57992,7 +60400,6 @@ func Xsqlite3VdbeExec(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:85790:20: */
var pBt3 uintptr // group
var i8 int32
var pCtx2 uintptr
- var x4 uintptr
var z2 uintptr
var z3 uintptr // jump
var i9 int32
@@ -58004,7 +60411,7 @@ func Xsqlite3VdbeExec(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:85790:20: */
resetSchemaOnFault = U8(0)
encoding = (*Sqlite3)(unsafe.Pointer(db)).Fenc
iCompare = 0
- nVmStep = uint32(0)
+ nVmStep = uint64(0)
aMem = (*Vdbe)(unsafe.Pointer(p)).FaMem
pIn1 = uintptr(0)
pIn2 = uintptr(0)
@@ -58019,10 +60426,10 @@ func Xsqlite3VdbeExec(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:85790:20: */
}
iPrior = *(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + uintptr(4)*4))
- nProgressLimit = ((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps - (iPrior % (*Sqlite3)(unsafe.Pointer(db)).FnProgressOps))
+ nProgressLimit = (U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps - (iPrior % (*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)))
goto __2
__1:
- nProgressLimit = 0xffffffff
+ nProgressLimit = (uint64(0xffffffff) | (U64((uint64(0xffffffff))) << 32))
__2:
;
if !((*Vdbe)(unsafe.Pointer(p)).Frc == 7) {
@@ -58040,14 +60447,14 @@ __3:
(*Vdbe)(unsafe.Pointer(p)).FpResultSet = uintptr(0)
(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0
- if !(*(*int32)(unsafe.Pointer((db + 368 /* &.u1 */ /* &.isInterrupted */))) != 0) {
+ if !(*(*int32)(unsafe.Pointer((db + 392 /* &.u1 */ /* &.isInterrupted */))) != 0) {
goto __4
}
goto abort_due_to_interrupt
__4:
;
- pOp = (aOp + uintptr((*Vdbe)(unsafe.Pointer(p)).Fpc)*24)
+ pOp = (aOp + uintptr((*Vdbe)(unsafe.Pointer(p)).Fpc)*32)
__5:
if !(1 != 0) {
goto __7
@@ -58810,6 +61217,23 @@ __8:
case 21:
goto __68
+ // Opcode: Offset P1 P2 P3 * *
+ // Synopsis: r[P3] = sqlite_offset(P1)
+ //
+ // Store in register r[P3] the byte offset into the database file that is the
+ // start of the payload for the record at which that cursor P1 is currently
+ // pointing.
+ //
+ // P2 is the column number for the argument to the sqlite_offset() function.
+ // This opcode does not use P2 itself, but the P2 value is used by the
+ // code generator. The P1, P2, and P3 operands to this opcode are the
+ // same as for OP_Column.
+ //
+ // This opcode is only available if SQLite is compiled with the
+ // -DSQLITE_ENABLE_OFFSET_SQL_FUNC option.
+ case 88:
+ goto __69
+
// Opcode: Column P1 P2 P3 P4 P5
// Synopsis: r[P3]=PX
//
@@ -58830,7 +61254,7 @@ __8:
// or typeof() function, respectively. The loading of large blobs can be
// skipped for length() and all content loading can be skipped for typeof().
case 89:
- goto __69
+ goto __70
// Opcode: Affinity P1 P2 * P4 *
// Synopsis: affinity(r[P1@P2])
@@ -58841,7 +61265,7 @@ __8:
// string indicates the column affinity that should be used for the N-th
// memory cell in the range.
case 90:
- goto __70
+ goto __71
// Opcode: MakeRecord P1 P2 P3 P4 *
// Synopsis: r[P3]=mkrec(r[P1@P2])
@@ -58858,8 +61282,19 @@ __8:
// macros defined in sqliteInt.h.
//
// If P4 is NULL then all index fields have the affinity BLOB.
+ //
+ // The meaning of P5 depends on whether or not the SQLITE_ENABLE_NULL_TRIM
+ // compile-time option is enabled:
+ //
+ // * If SQLITE_ENABLE_NULL_TRIM is enabled, then the P5 is the index
+ // of the right-most table that can be null-trimmed.
+ //
+ // * If SQLITE_ENABLE_NULL_TRIM is omitted, then P5 has the value
+ // OPFLAG_NOCHNG_MAGIC if the OP_MakeRecord opcode is allowed to
+ // accept no-change records with serial_type 10. This value is
+ // only used inside an assert() and does not affect the end result.
case 91:
- goto __71
+ goto __72
// Opcode: Count P1 P2 p3 * *
// Synopsis: r[P2]=count()
@@ -58871,7 +61306,7 @@ __8:
// every btree page of the table. But if P3 is non-zero, an estimate
// is returned based on the current cursor position.
case 92:
- goto __72
+ goto __73
// Opcode: Savepoint P1 * * P4 *
//
@@ -58880,7 +61315,7 @@ __8:
// To release (commit) an existing savepoint set P1==1 (SAVEPOINT_RELEASE).
// To rollback an existing savepoint set P1==2 (SAVEPOINT_ROLLBACK).
case 0:
- goto __73
+ goto __74
// Opcode: AutoCommit P1 P2 * * *
//
@@ -58891,7 +61326,7 @@ __8:
//
// This instruction causes the VM to halt.
case 1:
- goto __74
+ goto __75
// Opcode: Transaction P1 P2 P3 P4 P5
//
@@ -58927,7 +61362,7 @@ __8:
// halts. The sqlite3_step() wrapper function might then reprepare the
// statement and rerun it from the beginning.
case 2:
- goto __75
+ goto __76
// Opcode: ReadCookie P1 P2 P3 * *
//
@@ -58941,9 +61376,9 @@ __8:
// must be started or there must be an open cursor) before
// executing this instruction.
case 93:
- goto __76
+ goto __77
- // Opcode: SetCookie P1 P2 P3 * *
+ // Opcode: SetCookie P1 P2 P3 * P5
//
// Write the integer value P3 into cookie number P2 of database P1.
// P2==1 is the schema version. P2==2 is the database format.
@@ -58952,8 +61387,13 @@ __8:
// database file used to store temporary tables.
//
// A transaction must be started before executing this opcode.
+ //
+ // If P2 is the SCHEMA_VERSION cookie (cookie number 1) then the internal
+ // schema version is set to P3-P5. The "PRAGMA schema_version=N" statement
+ // has P5 set to 1, so that the internal schema version will be different
+ // from the database schema version, resulting in a schema reset.
case 94:
- goto __77
+ goto __78
// Opcode: OpenRead P1 P2 P3 P4 P5
// Synopsis: root=P2 iDb=P3
@@ -59037,13 +61477,13 @@ __8:
//
// See also: OP_OpenRead, OP_ReopenIdx
case 95:
- goto __78
+ goto __79
// If the cursor is not currently open or is open on a different
// index, then fall through into OP_OpenRead to force a reopen
case 96:
- goto __79
- case 97:
goto __80
+ case 97:
+ goto __81
// Opcode: OpenDup P1 P2 * * *
//
@@ -59053,7 +61493,7 @@ __8:
//
// Duplicate ephemeral cursors are used for self-joins of materialized views.
case 98:
- goto __81
+ goto __82
// Opcode: OpenEphemeral P1 P2 * P4 P5
// Synopsis: nColumn=P2
@@ -59083,9 +61523,9 @@ __8:
// by this opcode will be used for automatically created transient
// indices in joins.
case 99:
- goto __82
- case 100:
goto __83
+ case 100:
+ goto __84
// Opcode: SorterOpen P1 P2 P3 P4 *
//
@@ -59097,7 +61537,7 @@ __8:
// assume that a stable sort considering the first P3 fields of each
// key is sufficient to produce the required results.
case 111:
- goto __84
+ goto __85
// Opcode: SequenceTest P1 P2 * * *
// Synopsis: if( cursor[P1].ctr++ ) pc = P2
@@ -59106,7 +61546,7 @@ __8:
// to P2. Regardless of whether or not the jump is taken, increment the
// the sequence value.
case 113:
- goto __85
+ goto __86
// Opcode: OpenPseudo P1 P2 P3 * *
// Synopsis: P3 columns in r[P2]
@@ -59124,14 +61564,14 @@ __8:
// P3 is the number of fields in the records that will be stored by
// the pseudo-table.
case 114:
- goto __86
+ goto __87
// Opcode: Close P1 * * * *
//
// Close a cursor previously opened as P1. If P1 is not
// currently open, this instruction is a no-op.
case 116:
- goto __87
+ goto __88
// Opcode: SeekGE P1 P2 P3 P4 *
// Synopsis: key=r[P3@P4]
@@ -59220,13 +61660,13 @@ __8:
//
// See also: Found, NotFound, SeekGt, SeekGe, SeekLt
case 22:
- goto __88 // jump, in3, group
- case 23:
goto __89 // jump, in3, group
- case 24:
+ case 23:
goto __90 // jump, in3, group
+ case 24:
+ goto __91 // jump, in3, group
case 25:
- goto __91
+ goto __92
// Opcode: SeekHit P1 P2 * * *
// Synopsis: seekHit=P2
@@ -59237,14 +61677,14 @@ __8:
// P1 must be a valid b-tree cursor. P2 must be a boolean value,
// either 0 or 1.
case 118:
- goto __92
+ goto __93
// Opcode: IfNotOpen P1 P2 * * *
// Synopsis: if( !csr[P1] ) goto P2
//
// If cursor P1 is not open, jump to instruction P2. Otherwise, fall through.
case 26:
- goto __93
+ goto __94
// Opcode: Found P1 P2 P3 P4 *
// Synopsis: key=r[P3@P4]
@@ -59329,13 +61769,13 @@ __8:
//
// See also: NotFound, Found, NotExists
case 27:
- goto __94
+ goto __95
case 28:
- goto __95 // jump, in3
- case 29:
goto __96 // jump, in3
+ case 29:
+ goto __97 // jump, in3
case 30:
- goto __97
+ goto __98
// Opcode: SeekRowid P1 P2 P3 * *
// Synopsis: intkey=r[P3]
@@ -59383,10 +61823,11 @@ __8:
//
// See also: Found, NotFound, NoConflict, SeekRowid
case 31:
- goto __98
+ goto __99
// Fall through into OP_NotExists
+ /* no break */
case 32:
- goto __99
+ goto __100
// Opcode: Sequence P1 P2 * * *
// Synopsis: r[P2]=cursor[P1].ctr++
@@ -59396,7 +61837,7 @@ __8:
// The sequence number on the cursor is incremented after this
// instruction.
case 119:
- goto __100
+ goto __101
// Opcode: NewRowid P1 P2 P3 * *
// Synopsis: r[P2]=rowid
@@ -59413,7 +61854,7 @@ __8:
// generated record number. This P3 mechanism is used to help implement the
// AUTOINCREMENT feature.
case 120:
- goto __101
+ goto __102
// Opcode: Insert P1 P2 P3 P4 P5
// Synopsis: intkey=r[P3] data=r[P2]
@@ -59452,7 +61893,7 @@ __8:
// This instruction only works on tables. The equivalent instruction
// for indices is OP_IdxInsert.
case 121:
- goto __102
+ goto __103
// Opcode: Delete P1 P2 P3 P4 P5
//
@@ -59489,7 +61930,7 @@ __8:
// of the memory cell that contains the value that the rowid of the row will
// be set to by the update.
case 122:
- goto __103
+ goto __104
// Opcode: ResetCount * * * * *
//
// The value of the change counter is copied to the database handle
@@ -59497,7 +61938,7 @@ __8:
// Then the VMs internal change counter resets to 0.
// This is used by trigger programs.
case 123:
- goto __104
+ goto __105
// Opcode: SorterCompare P1 P2 P3 P4
// Synopsis: if key(P1)!=trim(r[P3],P4) goto P2
@@ -59514,7 +61955,7 @@ __8:
// Fall through to next instruction if the two records compare equal to
// each other. Jump to P2 if they are different.
case 124:
- goto __105
+ goto __106
// Opcode: SorterData P1 P2 P3 * *
// Synopsis: r[P2]=data
@@ -59528,7 +61969,7 @@ __8:
// parameter P3. Clearing the P3 column cache as part of this opcode saves
// us from having to issue a separate NullRow instruction to clear that cache.
case 125:
- goto __106
+ goto __107
// Opcode: RowData P1 P2 P3 * *
// Synopsis: r[P2]=data
@@ -59558,7 +61999,7 @@ __8:
// The P2 register content is invalidated by opcodes like OP_Function or
// by any use of another cursor pointing to the same table.
case 126:
- goto __107
+ goto __108
// Opcode: Rowid P1 P2 * * *
// Synopsis: r[P2]=rowid
@@ -59570,7 +62011,7 @@ __8:
// be a separate OP_VRowid opcode for use with virtual tables, but this
// one opcode now works for both table types.
case 127:
- goto __108
+ goto __109
// Opcode: NullRow P1 * * * *
//
@@ -59578,7 +62019,7 @@ __8:
// that occur while the cursor is on the null row will always
// write a NULL.
case 128:
- goto __109
+ goto __110
// Opcode: SeekEnd P1 * * * *
//
@@ -59601,16 +62042,16 @@ __8:
// from the end toward the beginning. In other words, the cursor is
// configured to use Prev, not Next.
case 129:
- goto __110
- case 33:
goto __111
+ case 33:
+ goto __112
// Opcode: IfSmaller P1 P2 P3 * *
//
// Estimate the number of rows in the table P1. Jump to P2 if that
// estimate is less than approximately 2**(0.1*P3).
case 34:
- goto __112
+ goto __113
// Opcode: SorterSort P1 P2 * * *
//
@@ -59632,9 +62073,9 @@ __8:
// regression tests can determine whether or not the optimizer is
// correctly optimizing out sorts.
case 35:
- goto __113 // jump
+ goto __114 // jump
case 36:
- goto __114
+ goto __115
// Opcode: Rewind P1 P2 * * *
//
// The next use of the Rowid or Column or Next instruction for P1
@@ -59647,7 +62088,7 @@ __8:
// from the beginning toward the end. In other words, the cursor is
// configured to use Next, not Prev.
case 37:
- goto __115
+ goto __116
// Opcode: Next P1 P2 P3 P4 P5
//
@@ -59707,11 +62148,11 @@ __8:
// invoked. This opcode advances the cursor to the next sorted
// record, or jumps to P2 if there are no more sorted records.
case 3:
- goto __116
+ goto __117
case 4:
- goto __117 // jump
+ goto __118 // jump
case 5:
- goto __118
+ goto __119
// Opcode: IdxInsert P1 P2 P3 P4 P5
// Synopsis: key=r[P2]
@@ -59741,7 +62182,7 @@ __8:
// This instruction only works for indices. The equivalent instruction
// for tables is OP_Insert.
case 130:
- goto __119
+ goto __120
// Opcode: SorterInsert P1 P2 * * *
// Synopsis: key=r[P2]
@@ -59750,7 +62191,7 @@ __8:
// MakeRecord instructions. This opcode writes that key
// into the sorter P1. Data for the entry is nil.
case 131:
- goto __120
+ goto __121
// Opcode: IdxDelete P1 P2 P3 * P5
// Synopsis: key=r[P2@P3]
@@ -59766,7 +62207,7 @@ __8:
// (example: the EXCEPT operator) it does not matter that no matching
// entry is found. For those cases, P5 is zero.
case 132:
- goto __121
+ goto __122
// Opcode: DeferredSeek P1 * P3 P4 *
// Synopsis: Move P3 to P1.rowid if needed
@@ -59795,9 +62236,9 @@ __8:
//
// See also: Rowid, MakeRecord.
case 133:
- goto __122
- case 134:
goto __123
+ case 134:
+ goto __124
// Opcode: FinishSeek P1 * * * *
//
@@ -59805,7 +62246,7 @@ __8:
// seek operation now, without further delay. If the cursor seek has
// already occurred, this instruction is a no-op.
case 135:
- goto __124
+ goto __125
// Opcode: IdxGE P1 P2 P3 P4 P5
// Synopsis: key=r[P3@P4]
@@ -59848,13 +62289,13 @@ __8:
// If the P1 index entry is less than or equal to the key value then jump
// to P2. Otherwise fall through to the next instruction.
case 38:
- goto __125 // jump
- case 39:
goto __126 // jump
- case 40:
+ case 39:
goto __127 // jump
+ case 40:
+ goto __128 // jump
case 41:
- goto __128
+ goto __129
// Opcode: Destroy P1 P2 P3 * *
//
@@ -59883,7 +62324,7 @@ __8:
//
// See also: Clear
case 136:
- goto __129
+ goto __130
// Opcode: Clear P1 P2 P3
//
@@ -59903,7 +62344,7 @@ __8:
//
// See also: Destroy
case 137:
- goto __130
+ goto __131
// Opcode: ResetSorter P1 * * * *
//
@@ -59913,7 +62354,7 @@ __8:
// This opcode only works for cursors used for sorting and
// opened with OP_OpenEphemeral or OP_SorterOpen.
case 138:
- goto __131
+ goto __132
// Opcode: CreateBtree P1 P2 P3 * *
// Synopsis: r[P2]=root iDb=P1 flags=P3
@@ -59924,24 +62365,24 @@ __8:
// it must be 2 (BTREE_BLOBKEY) for an index or WITHOUT ROWID table.
// The root page number of the new b-tree is stored in register P2.
case 139:
- goto __132
+ goto __133
// Opcode: SqlExec * * * P4 *
//
// Run the SQL statement or statements specified in the P4 string.
case 140:
- goto __133
+ goto __134
// Opcode: ParseSchema P1 * * P4 *
//
- // Read and parse all entries from the SQLITE_MASTER table of database P1
+ // Read and parse all entries from the schema table of database P1
// that match the WHERE clause P4. If P4 is a NULL pointer, then the
// entire schema for P1 is reparsed.
//
// This opcode invokes the parser to create a new virtual machine,
// then runs the new virtual machine. It is thus a re-entrant opcode.
case 141:
- goto __134
+ goto __135
// Opcode: LoadAnalysis P1 * * * *
//
@@ -59949,7 +62390,7 @@ __8:
// of that table into the internal index hash table. This will cause
// the analysis to be used when preparing all subsequent queries.
case 142:
- goto __135
+ goto __136
// Opcode: DropTable P1 * * P4 *
//
@@ -59959,7 +62400,7 @@ __8:
// the internal representation of the
// schema consistent with what is on disk.
case 143:
- goto __136
+ goto __137
// Opcode: DropIndex P1 * * P4 *
//
@@ -59969,7 +62410,7 @@ __8:
// in order to keep the internal representation of the
// schema consistent with what is on disk.
case 144:
- goto __137
+ goto __138
// Opcode: DropTrigger P1 * * P4 *
//
@@ -59979,7 +62420,7 @@ __8:
// the internal representation of the
// schema consistent with what is on disk.
case 145:
- goto __138
+ goto __139
// Opcode: IntegrityCk P1 P2 P3 P4 P5
//
@@ -60000,7 +62441,7 @@ __8:
//
// This opcode is used to implement the integrity_check pragma.
case 146:
- goto __139
+ goto __140
// Opcode: RowSetAdd P1 P2 * * *
// Synopsis: rowset(P1)=r[P2]
@@ -60010,7 +62451,7 @@ __8:
//
// An assertion fails if P2 is not an integer.
case 147:
- goto __140
+ goto __141
// Opcode: RowSetRead P1 P2 P3 * *
// Synopsis: r[P3]=rowset(P1)
@@ -60020,7 +62461,7 @@ __8:
// Or, if RowSet object P1 is initially empty, leave P3
// unchanged and jump to instruction P2.
case 42:
- goto __141
+ goto __142
// Opcode: RowSetTest P1 P2 P3 P4
// Synopsis: if r[P3] in rowset(P1) goto P2
@@ -60045,7 +62486,7 @@ __8:
// previously inserted as part of set X (only if it was previously
// inserted as part of some other set).
case 45:
- goto __142
+ goto __143
// Opcode: Program P1 P2 P3 P4 P5
//
@@ -60062,7 +62503,7 @@ __8:
//
// If P5 is non-zero, then recursive program invocation is enabled.
case 46:
- goto __143
+ goto __144
// Opcode: Param P1 P2 * * *
//
@@ -60076,7 +62517,7 @@ __8:
// the value of the P1 argument to the value of the P1 argument to the
// calling OP_Program instruction.
case 148:
- goto __144
+ goto __145
// Opcode: FkCounter P1 P2 * * *
// Synopsis: fkctr[P1]+=P2
@@ -60086,7 +62527,7 @@ __8:
// (deferred foreign key constraints). Otherwise, if P1 is zero, the
// statement counter is incremented (immediate foreign key constraints).
case 149:
- goto __145
+ goto __146
// Opcode: FkIfZero P1 P2 * * *
// Synopsis: if fkctr[P1]==0 goto P2
@@ -60100,7 +62541,7 @@ __8:
// zero, the jump is taken if the statement constraint-counter is zero
// (immediate foreign key constraint violations).
case 47:
- goto __146
+ goto __147
// Opcode: MemMax P1 P2 * * *
// Synopsis: r[P1]=max(r[P1],r[P2])
@@ -60113,7 +62554,7 @@ __8:
// This instruction throws an error if the memory cell is not initially
// an integer.
case 151:
- goto __147
+ goto __148
// Opcode: IfPos P1 P2 P3 * *
// Synopsis: if r[P1]>0 then r[P1]-=P3, goto P2
@@ -60125,7 +62566,7 @@ __8:
// If the initial value of register P1 is less than 1, then the
// value is unchanged and control passes through to the next instruction.
case 48:
- goto __148
+ goto __149
// Opcode: OffsetLimit P1 P2 P3 * *
// Synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)
@@ -60145,7 +62586,7 @@ __8:
//
// Otherwise, r[P2] is set to the sum of r[P1] and r[P3].
case 152:
- goto __149
+ goto __150
// Opcode: IfNotZero P1 P2 * * *
// Synopsis: if r[P1]!=0 then r[P1]--, goto P2
@@ -60155,7 +62596,7 @@ __8:
// If it is non-zero (negative or positive) and then also jump to P2.
// If register P1 is initially zero, leave it unchanged and fall through.
case 49:
- goto __150
+ goto __151
// Opcode: DecrJumpZero P1 P2 * * *
// Synopsis: if (--r[P1])==0 goto P2
@@ -60163,7 +62604,7 @@ __8:
// Register P1 must hold an integer. Decrement the value in P1
// and jump to P2 if the new value is exactly zero.
case 59:
- goto __151
+ goto __152
// Opcode: AggStep * P2 P3 P4 P5
// Synopsis: accum=r[P3] step(r[P2@P5])
@@ -60202,11 +62643,11 @@ __8:
// sqlite3_context only happens once, instead of on each call to the
// step function.
case 153:
- goto __152
- case 154:
goto __153
- case 155:
+ case 154:
goto __154
+ case 155:
+ goto __155
// Opcode: AggFinal P1 P2 * P4 *
// Synopsis: accum=r[P1] N=P2
@@ -60233,9 +62674,9 @@ __8:
// P4 argument is only needed for the case where
// the step function was not previously called.
case 156:
- goto __155
- case 157:
goto __156
+ case 157:
+ goto __157
// Opcode: Checkpoint P1 P2 P3 * *
//
@@ -60248,7 +62689,7 @@ __8:
// completes into mem[P3+2]. However on an error, mem[P3+1] and
// mem[P3+2] are initialized to -1.
case 6:
- goto __157
+ goto __158
// Opcode: JournalMode P1 P2 P3 * *
//
@@ -60261,7 +62702,7 @@ __8:
//
// Write a string containing the final journal-mode to register P2.
case 7:
- goto __158
+ goto __159
// Opcode: Vacuum P1 P2 * * *
//
@@ -60272,7 +62713,7 @@ __8:
// the file into which the result of vacuum should be written. When
// P2 is zero, the vacuum overwrites the original database.
case 8:
- goto __159
+ goto __160
// Opcode: IncrVacuum P1 P2 * * *
//
@@ -60280,7 +62721,7 @@ __8:
// the P1 database. If the vacuum has finished, jump to instruction
// P2. Otherwise, fall through to the next instruction.
case 60:
- goto __160
+ goto __161
// Opcode: Expire P1 P2 * * *
//
@@ -60298,21 +62739,21 @@ __8:
// that might help the statement run faster but which does not affect the
// correctness of operation.
case 158:
- goto __161
+ goto __162
// Opcode: CursorLock P1 * * * *
//
// Lock the btree to which cursor P1 is pointing so that the btree cannot be
// written by an other cursor.
case 159:
- goto __162
+ goto __163
// Opcode: CursorUnlock P1 * * * *
//
// Unlock the btree to which cursor P1 is pointing so that it can be
// written by other cursors.
case 160:
- goto __163
+ goto __164
// Opcode: TableLock P1 P2 P3 P4 *
// Synopsis: iDb=P1 root=P2 write=P3
@@ -60329,7 +62770,7 @@ __8:
// P4 contains a pointer to the name of the table being locked. This is only
// used to generate an error message if the lock cannot be obtained.
case 161:
- goto __164
+ goto __165
// Opcode: VBegin * * * P4 *
//
@@ -60340,21 +62781,21 @@ __8:
// within a callback to a virtual table xSync() method. If it is, the error
// code will be set to SQLITE_LOCKED.
case 162:
- goto __165
+ goto __166
// Opcode: VCreate P1 P2 * * *
//
// P2 is a register that holds the name of a virtual table in database
// P1. Call the xCreate method for that table.
case 163:
- goto __166
+ goto __167
// Opcode: VDestroy P1 * * P4 *
//
// P4 is the name of a virtual table in database P1. Call the xDestroy method
// of that table.
case 164:
- goto __167
+ goto __168
// Opcode: VOpen P1 * * P4 *
//
@@ -60362,7 +62803,7 @@ __8:
// P1 is a cursor number. This opcode opens a cursor to the virtual
// table and stores that cursor in P1.
case 165:
- goto __168
+ goto __169
// Opcode: VFilter P1 P2 P3 P4 *
// Synopsis: iplan=r[P3] zplan='P4'
@@ -60383,7 +62824,7 @@ __8:
//
// A jump is made to P2 if the result set after filtering would be empty.
case 9:
- goto __169
+ goto __170
// Opcode: VColumn P1 P2 P3 * P5
// Synopsis: r[P3]=vcolumn(P2)
@@ -60399,7 +62840,7 @@ __8:
// bits (OPFLAG_LENGTHARG or OPFLAG_TYPEOFARG) but those bits are
// unused by OP_VColumn.
case 166:
- goto __170
+ goto __171
// Opcode: VNext P1 P2 * * *
//
@@ -60407,7 +62848,7 @@ __8:
// jump to instruction P2. Or, if the virtual table has reached
// the end of its result set, then fall through to the next instruction.
case 61:
- goto __171
+ goto __172
// Opcode: VRename P1 * * P4 *
//
@@ -60415,7 +62856,7 @@ __8:
// This opcode invokes the corresponding xRename method. The value
// in register P1 is passed as the zName argument to the xRename method.
case 167:
- goto __172
+ goto __173
// Opcode: VUpdate P1 P2 P3 P4 P5
// Synopsis: data=r[P3@P2]
@@ -60444,13 +62885,13 @@ __8:
// P5 is the error actions (OE_Replace, OE_Fail, OE_Ignore, etc) to
// apply in the case of a constraint failure on an insert or update.
case 10:
- goto __173
+ goto __174
// Opcode: Pagecount P1 P2 * * *
//
// Write the current number of pages in database P1 to memory cell P2.
case 168:
- goto __174
+ goto __175
// Opcode: MaxPgcnt P1 P2 P3 * *
//
@@ -60460,7 +62901,7 @@ __8:
//
// Store the maximum page count after the change in register P2.
case 169:
- goto __175
+ goto __176
// Opcode: Function P1 P2 P3 P4 *
// Synopsis: r[P3]=func(r[P2@NP])
@@ -60507,9 +62948,9 @@ __8:
//
// See also: AggStep, AggFinal, Function
case 63:
- goto __176 // group
+ goto __177 // group
case 64:
- goto __177
+ goto __178
// Opcode: Trace P1 P2 * P4 *
//
@@ -60535,9 +62976,9 @@ __8:
// If P3 is not zero, then it is an address to jump to if an SQLITE_CORRUPT
// error is encountered.
case 170:
- goto __178
- case 62:
goto __179
+ case 62:
+ goto __180
// Opcode: Noop * * * * *
//
@@ -60548,7 +62989,7 @@ __8:
// This opcode records information from the optimizer. It is the
// the same as a no-op. This opcodesnever appears in a real VM program.
default:
- goto __180
+ goto __181
}
goto __10
@@ -60602,7 +63043,7 @@ __8:
__11: // jump
jump_to_p2_and_check_for_interrupt:
- pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2-1))*24)
+ pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2-1))*32)
// Opcodes that are used as the bottom of a loop (OP_Next, OP_Prev,
// OP_VNext, or OP_SorterNext) all jump here upon
@@ -60615,33 +63056,33 @@ jump_to_p2_and_check_for_interrupt:
// checks on every opcode. This helps sqlite3_step() to run about 1.5%
// faster according to "valgrind --tool=cachegrind"
check_for_interrupt:
- if !(*(*int32)(unsafe.Pointer((db + 368 /* &.u1 */ /* &.isInterrupted */))) != 0) {
- goto __181
+ if !(*(*int32)(unsafe.Pointer((db + 392 /* &.u1 */ /* &.isInterrupted */))) != 0) {
+ goto __182
}
goto abort_due_to_interrupt
-__181:
+__182:
;
// Call the progress callback if it is configured and the required number
// of VDBE ops have been executed (either since this invocation of
// sqlite3VdbeExec() or since last time the progress callback was called).
// If the progress callback returns non-zero, exit the virtual machine with
// a return code SQLITE_ABORT.
-__182:
+__183:
if !((nVmStep >= nProgressLimit) && ((*Sqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0))) {
- goto __183
+ goto __184
}
- nProgressLimit = nProgressLimit + ((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)
- if !((*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((db + 480 /* &.xProgress */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) {
- goto __184
+ nProgressLimit = nProgressLimit + (U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps))
+ if !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 504 /* &.xProgress */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) {
+ goto __185
}
- nProgressLimit = 0xffffffff
+ nProgressLimit = (uint64(0xffffffff) | (U64((uint64(0xffffffff))) << 32))
rc = 9
goto abort_due_to_error
-__184:
+__185:
;
- goto __182
-__183:
+ goto __183
+__184:
;
goto __10
@@ -60655,12 +63096,12 @@ __12: // jump
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
(*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(0x0004)
- *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64((int32((int64(pOp) - int64(aOp)) / 24)))
+ *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64((int32((int64(pOp) - int64(aOp)) / 32)))
// Most jump operations do a goto to this spot in order to update
// the pOp pointer.
jump_to_p2:
- pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2-1))*24)
+ pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2-1))*32)
goto __10
// Opcode: Return P1 * * * *
@@ -60670,7 +63111,7 @@ jump_to_p2:
__13: // in1
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
- pOp = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*24)
+ pOp = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*32)
(*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(0x0080)
goto __10
@@ -60692,10 +63133,10 @@ __14: // jump
*(*I64)(unsafe.Pointer(pOut /* &.u */)) = (I64((*Op)(unsafe.Pointer(pOp)).Fp3 - 1))
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(0x0004)
if !((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) {
- goto __185
+ goto __186
}
goto jump_to_p2
-__185:
+__186:
;
goto __10
@@ -60709,9 +63150,9 @@ __185:
__15:
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
- pCaller = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*24)
+ pCaller = (aOp + uintptr(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))*32)
- pOp = (aOp + uintptr(((*VdbeOp)(unsafe.Pointer(pCaller)).Fp2-1))*24)
+ pOp = (aOp + uintptr(((*VdbeOp)(unsafe.Pointer(pCaller)).Fp2-1))*32)
(*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(0x0080)
goto __10
@@ -60732,9 +63173,9 @@ __16:
(*Mem)(unsafe.Pointer(pIn1)).Fflags = U16(0x0004)
pcDest = int32(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))
- *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64((int32((int64(pOp) - int64(aOp)) / 24)))
+ *(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = I64((int32((int64(pOp) - int64(aOp)) / 32)))
- pOp = (aOp + uintptr(pcDest)*24)
+ pOp = (aOp + uintptr(pcDest)*32)
goto __10
// Opcode: HaltIfNull P1 P2 P3 P4 P5
@@ -60747,10 +63188,10 @@ __16:
__17: // in3
pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
if !((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & 0x0001) == 0) {
- goto __186
+ goto __187
}
goto __10
-__186:
+__187:
;
// Opcode: Halt P1 P2 * P4 P5
@@ -60784,9 +63225,9 @@ __186:
// is the same as executing Halt.
__18:
- pcx = (int32((int64(pOp) - int64(aOp)) / 24))
+ pcx = (int32((int64(pOp) - int64(aOp)) / 32))
if !(((*Op)(unsafe.Pointer(pOp)).Fp1 == 0) && ((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0)) {
- goto __187
+ goto __188
}
// Halt the sub-program. Return control to the parent frame.
pFrame = (*Vdbe)(unsafe.Pointer(p)).FpFrame
@@ -60795,56 +63236,56 @@ __18:
Xsqlite3VdbeSetChanges(tls, db, (*Vdbe)(unsafe.Pointer(p)).FnChange)
pcx = Xsqlite3VdbeFrameRestore(tls, pFrame)
if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 4) {
- goto __188
+ goto __189
}
// Instruction pcx is the OP_Program that invoked the sub-program
// currently being halted. If the p2 instruction of this OP_Halt
// instruction is set to OE_Ignore, then the sub-program is throwing
// an IGNORE exception. In this case jump to the address specified
// as the p2 of the calling OP_Program.
- pcx = ((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(pcx)*24)).Fp2 - 1)
-__188:
+ pcx = ((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(pcx)*32)).Fp2 - 1)
+__189:
;
aOp = (*Vdbe)(unsafe.Pointer(p)).FaOp
aMem = (*Vdbe)(unsafe.Pointer(p)).FaMem
- pOp = (aOp + uintptr(pcx)*24)
+ pOp = (aOp + uintptr(pcx)*32)
goto __10
-__187:
+__188:
;
(*Vdbe)(unsafe.Pointer(p)).Frc = (*Op)(unsafe.Pointer(pOp)).Fp1
(*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8((*Op)(unsafe.Pointer(pOp)).Fp2)
(*Vdbe)(unsafe.Pointer(p)).Fpc = pcx
if !((*Vdbe)(unsafe.Pointer(p)).Frc != 0) {
- goto __189
+ goto __190
}
if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) {
- goto __190
+ goto __191
}
- Xsqlite3VdbeError(tls, p, ts+4930 /* "%s constraint fa..." */, crt.VaList(bp, azType[(int32((*Op)(unsafe.Pointer(pOp)).Fp5)-1)]))
+ Xsqlite3VdbeError(tls, p, ts+7128 /* "%s constraint fa..." */, libc.VaList(bp, azType[(int32((*Op)(unsafe.Pointer(pOp)).Fp5)-1)]))
if !(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) != 0) {
- goto __192
+ goto __193
}
- (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+4951 /* "%z: %s" */, crt.VaList(bp+8, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
-__192:
+ (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+7149 /* "%z: %s" */, libc.VaList(bp+8, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
+__193:
;
- goto __191
-__190:
- Xsqlite3VdbeError(tls, p, ts+696 /* "%s" */, crt.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
+ goto __192
__191:
+ Xsqlite3VdbeError(tls, p, ts+805 /* "%s" */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
+__192:
;
- Xsqlite3_log(tls, (*Op)(unsafe.Pointer(pOp)).Fp1, ts+4958 /* "abort at %d in [..." */, crt.VaList(bp+32, pcx, (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
-__189:
+ Xsqlite3_log(tls, (*Op)(unsafe.Pointer(pOp)).Fp1, ts+7156 /* "abort at %d in [..." */, libc.VaList(bp+32, pcx, (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
+__190:
;
rc = Xsqlite3VdbeHalt(tls, p)
if !(rc == 5) {
- goto __193
+ goto __194
}
(*Vdbe)(unsafe.Pointer(p)).Frc = 5
- goto __194
-__193:
+ goto __195
+__194:
;
if (*Vdbe)(unsafe.Pointer(p)).Frc != 0 {
@@ -60852,7 +63293,7 @@ __193:
} else {
rc = 101
}
-__194:
+__195:
;
goto vdbe_return
@@ -60901,41 +63342,41 @@ __22: // same as TK_STRING, out2
(*Op)(unsafe.Pointer(pOp)).Fp1 = Xsqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
if !(int32(encoding) != 1) {
- goto __195
+ goto __196
}
rc = Xsqlite3VdbeMemSetStr(tls, pOut, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), -1, uint8(1), uintptr(0))
if !(rc != 0) {
- goto __196
+ goto __197
}
goto too_big
-__196:
+__197:
;
if !(0 != Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding))) {
- goto __197
+ goto __198
}
goto no_mem
-__197:
+__198:
;
(*Mem)(unsafe.Pointer(pOut)).FszMalloc = 0
*(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((0x0800))
if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-7)) {
- goto __198
+ goto __199
}
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
-__198:
+__199:
;
(*Op)(unsafe.Pointer(pOp)).Fp4type = int8(-7)
*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = (*Mem)(unsafe.Pointer(pOut)).Fz
(*Op)(unsafe.Pointer(pOp)).Fp1 = (*Mem)(unsafe.Pointer(pOut)).Fn
-__195:
+__196:
;
if !((*Op)(unsafe.Pointer(pOp)).Fp1 > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(0)*4))) {
- goto __199
+ goto __200
}
goto too_big
-__199:
+__200:
;
(*Op)(unsafe.Pointer(pOp)).Fopcode = U8(71)
@@ -60975,16 +63416,16 @@ __24:
pOut = out2Prerelease(tls, p, pOp)
cnt = ((*Op)(unsafe.Pointer(pOp)).Fp3 - (*Op)(unsafe.Pointer(pOp)).Fp2)
- (*Mem)(unsafe.Pointer(pOut)).Fflags = crt.AssignUint16(&nullFlag, func() uint16 {
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = libc.AssignUint16(&nullFlag, func() uint16 {
if (*Op)(unsafe.Pointer(pOp)).Fp1 != 0 {
return (uint16(0x0001 | 0x0100))
}
return uint16(0x0001)
}())
(*Mem)(unsafe.Pointer(pOut)).Fn = 0
-__200:
+__201:
if !(cnt > 0) {
- goto __201
+ goto __202
}
pOut += 56
@@ -60992,8 +63433,8 @@ __200:
(*Mem)(unsafe.Pointer(pOut)).Fflags = nullFlag
(*Mem)(unsafe.Pointer(pOut)).Fn = 0
cnt--
- goto __200
-__201:
+ goto __201
+__202:
;
goto __10
@@ -61007,7 +63448,7 @@ __201:
__25:
;
pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer(pOut)).Fflags) & ^int32(crt.Int32FromInt32((0x0080 | 0x003f)))) | 0x0001))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer(pOut)).Fflags) & ^int32(libc.Int32FromInt32((0x0080 | 0x003f)))) | 0x0001))
goto __10
// Opcode: Blob P1 P2 * P4 *
@@ -61036,20 +63477,20 @@ __27: // Value being transferred
pVar = ((*Vdbe)(unsafe.Pointer(p)).FaVar + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1-1))*56)
if !(Xsqlite3VdbeMemTooBig(tls, pVar) != 0) {
- goto __202
+ goto __203
}
goto too_big
-__202:
+__203:
;
pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
if !((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & (0x2000 | 0x0400)) != 0) {
- goto __203
+ goto __204
}
Xsqlite3VdbeMemSetNull(tls, pOut)
-__203:
+__204:
;
- crt.Xmemcpy(tls, pOut, pVar, uint64((uintptr(0) + 24 /* &.zMalloc */)))
- *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32((0x0400 | 0x1000)))))
+ libc.Xmemcpy(tls, pOut, pVar, uint64((uintptr(0) + 24 /* &.zMalloc */)))
+ *(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32((0x0400 | 0x1000)))))
*(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((0x0800 | 0x0040))
updateMaxBlobsize(tls, pOut)
goto __10
@@ -61070,26 +63511,26 @@ __28: // Register to copy to
pIn1 = (aMem + uintptr(p1)*56)
pOut = (aMem + uintptr(p2)*56)
-__204:
+__205:
;
Xsqlite3VdbeMemMove(tls, pOut, pIn1)
if !(((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & 0x1000) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0)) {
- goto __207
+ goto __208
}
goto no_mem
-__207:
+__208:
;
pIn1 += 56
pOut += 56
- goto __205
-__205:
- if crt.PreDecInt32(&n, 1) != 0 {
- goto __204
- }
goto __206
__206:
+ if libc.PreDecInt32(&n, 1) != 0 {
+ goto __205
+ }
+ goto __207
+__207:
;
goto __10
@@ -61106,29 +63547,29 @@ __29:
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
-__208:
+__209:
if !(1 != 0) {
- goto __209
+ goto __210
}
Xsqlite3VdbeMemShallowCopy(tls, pOut, pIn1, 0x1000)
if !(((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & 0x1000) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0)) {
- goto __210
+ goto __211
}
goto no_mem
-__210:
+__211:
;
- if !((crt.PostDecInt32(&n1, 1)) == 0) {
- goto __211
+ if !((libc.PostDecInt32(&n1, 1)) == 0) {
+ goto __212
}
- goto __209
-__211:
+ goto __210
+__212:
;
pOut += 56
pIn1 += 56
- goto __208
-__209:
+ goto __209
+__210:
;
goto __10
@@ -61179,12 +63620,12 @@ __32:
// If this statement has violated immediate foreign key constraints, do
// not return the number of rows modified. And do not RELEASE the statement
// transaction. It needs to be rolled back.
- if !(0 != (crt.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 0)))) {
- goto __212
+ if !(0 != (libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 0)))) {
+ goto __213
}
goto abort_due_to_error
-__212:
+__213:
;
// If the SQLITE_CountRows flag is set in sqlite3.flags mask, then
@@ -61210,44 +63651,44 @@ __212:
// Make sure the results of the current row are \000 terminated
// and have an assigned type. The results are de-ephemeralized as
// a side effect.
- pMem = crt.AssignPtrUintptr(p+160 /* &.pResultSet */, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56))
+ pMem = libc.AssignPtrUintptr(p+160 /* &.pResultSet */, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56))
i = 0
-__213:
+__214:
if !(i < (*Op)(unsafe.Pointer(pOp)).Fp2) {
- goto __215
+ goto __216
}
if !(((int32((*Mem)(unsafe.Pointer((pMem + uintptr(i)*56))).Fflags) & 0x1000) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, (pMem+uintptr(i)*56)) != 0)) {
- goto __216
+ goto __217
}
goto no_mem
-__216:
+__217:
;
Xsqlite3VdbeMemNulTerminate(tls, (pMem + uintptr(i)*56))
- goto __214
-__214:
- i++
- goto __213
goto __215
__215:
+ i++
+ goto __214
+ goto __216
+__216:
;
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __217
+ goto __218
}
goto no_mem
-__217:
+__218:
;
if !((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & 0x04) != 0) {
- goto __218
+ goto __219
}
- (*(*func(*crt.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.xTrace */))))(tls, uint32(0x04), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0))
-__218:
+ (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(0x04), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, uintptr(0))
+__219:
;
// Return SQLITE_ROW
- (*Vdbe)(unsafe.Pointer(p)).Fpc = ((int32((int64(pOp) - int64(aOp)) / 24)) + 1)
+ (*Vdbe)(unsafe.Pointer(p)).Fpc = ((int32((int64(pOp) - int64(aOp)) / 32)) + 1)
rc = 100
goto vdbe_return
@@ -61272,88 +63713,88 @@ __33: // Initial flags for P2
flags1 = (*Mem)(unsafe.Pointer(pIn1)).Fflags
if !(((int32(flags1) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)) & 0x0001) != 0) {
- goto __219
+ goto __220
}
Xsqlite3VdbeMemSetNull(tls, pOut)
goto __10
-__219:
+__220:
;
if !((int32(flags1) & (0x0002 | 0x0010)) == 0) {
- goto __220
+ goto __221
}
if !(Xsqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(0)) != 0) {
- goto __222
+ goto __223
}
goto no_mem
-__222:
+__223:
;
- flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & ^int32(crt.Int32FromInt32(0x0002))))
- goto __221
-__220:
+ flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & ^int32(libc.Int32FromInt32(0x0002))))
+ goto __222
+__221:
if !((int32(flags1) & 0x4000) != 0) {
- goto __223
+ goto __224
}
if !(Xsqlite3VdbeMemExpandBlob(tls, pIn1) != 0) {
- goto __224
+ goto __225
}
goto no_mem
-__224:
+__225:
;
- flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & ^int32(crt.Int32FromInt32(0x0002))))
-__223:
+ flags1 = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & ^int32(libc.Int32FromInt32(0x0002))))
+__224:
;
-__221:
+__222:
;
flags2 = (*Mem)(unsafe.Pointer(pIn2)).Fflags
if !((int32(flags2) & (0x0002 | 0x0010)) == 0) {
- goto __225
+ goto __226
}
if !(Xsqlite3VdbeMemStringify(tls, pIn2, encoding, uint8(0)) != 0) {
- goto __227
+ goto __228
}
goto no_mem
-__227:
+__228:
;
- flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & ^int32(crt.Int32FromInt32(0x0002))))
- goto __226
-__225:
+ flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & ^int32(libc.Int32FromInt32(0x0002))))
+ goto __227
+__226:
if !((int32(flags2) & 0x4000) != 0) {
- goto __228
+ goto __229
}
if !(Xsqlite3VdbeMemExpandBlob(tls, pIn2) != 0) {
- goto __229
+ goto __230
}
goto no_mem
-__229:
+__230:
;
- flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & ^int32(crt.Int32FromInt32(0x0002))))
-__228:
+ flags2 = (U16(int32((*Mem)(unsafe.Pointer(pIn2)).Fflags) & ^int32(libc.Int32FromInt32(0x0002))))
+__229:
;
-__226:
+__227:
;
nByte = (I64((*Mem)(unsafe.Pointer(pIn1)).Fn + (*Mem)(unsafe.Pointer(pIn2)).Fn))
if !(nByte > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(0)*4)))) {
- goto __230
+ goto __231
}
goto too_big
-__230:
+__231:
;
- if !(Xsqlite3VdbeMemGrow(tls, pOut, (int32(nByte)+3), (crt.Bool32(pOut == pIn2))) != 0) {
- goto __231
+ if !(Xsqlite3VdbeMemGrow(tls, pOut, (int32(nByte)+3), (libc.Bool32(pOut == pIn2))) != 0) {
+ goto __232
}
goto no_mem
-__231:
+__232:
;
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0002))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0002))
if !(pOut != pIn2) {
- goto __232
+ goto __233
}
- crt.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pOut)).Fz, (*Mem)(unsafe.Pointer(pIn2)).Fz, uint64((*Mem)(unsafe.Pointer(pIn2)).Fn))
+ libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pOut)).Fz, (*Mem)(unsafe.Pointer(pIn2)).Fz, uint64((*Mem)(unsafe.Pointer(pIn2)).Fn))
(*Mem)(unsafe.Pointer(pIn2)).Fflags = flags2
-__232:
+__233:
;
- crt.Xmemcpy(tls, ((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr((*Mem)(unsafe.Pointer(pIn2)).Fn)), (*Mem)(unsafe.Pointer(pIn1)).Fz, uint64((*Mem)(unsafe.Pointer(pIn1)).Fn))
+ libc.Xmemcpy(tls, ((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr((*Mem)(unsafe.Pointer(pIn2)).Fn)), (*Mem)(unsafe.Pointer(pIn1)).Fz, uint64((*Mem)(unsafe.Pointer(pIn1)).Fn))
(*Mem)(unsafe.Pointer(pIn1)).Fflags = flags1
*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pOut)).Fz + uintptr(nByte))) = int8(0)
@@ -61411,154 +63852,154 @@ __38: // Real value of right operand
pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
flags = (U16(int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)))
if !(((int32(type1) & int32(type2)) & 0x0004) != 0) {
- goto __233
+ goto __234
}
iA = *(*I64)(unsafe.Pointer(pIn1 /* &.u */))
- *(*I64)(unsafe.Pointer(bp + 184 /* iB */)) = *(*I64)(unsafe.Pointer(pIn2 /* &.u */))
+ *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) = *(*I64)(unsafe.Pointer(pIn2 /* &.u */))
switch int32((*Op)(unsafe.Pointer(pOp)).Fopcode) {
case 105:
- goto __236
- case 106:
goto __237
- case 107:
+ case 106:
goto __238
- case 108:
+ case 107:
goto __239
- default:
+ case 108:
goto __240
- }
- goto __235
-__236:
- if !(Xsqlite3AddInt64(tls, bp+184 /* &iB */, iA) != 0) {
+ default:
goto __241
}
- goto fp_math
-__241:
- ;
- goto __235
+ goto __236
__237:
- if !(Xsqlite3SubInt64(tls, bp+184 /* &iB */, iA) != 0) {
+ if !(Xsqlite3AddInt64(tls, bp+176 /* &iB */, iA) != 0) {
goto __242
}
goto fp_math
__242:
;
- goto __235
+ goto __236
__238:
- if !(Xsqlite3MulInt64(tls, bp+184 /* &iB */, iA) != 0) {
+ if !(Xsqlite3SubInt64(tls, bp+176 /* &iB */, iA) != 0) {
goto __243
}
goto fp_math
__243:
;
- goto __235
+ goto __236
__239:
- if !(iA == int64(0)) {
+ if !(Xsqlite3MulInt64(tls, bp+176 /* &iB */, iA) != 0) {
goto __244
}
- goto arithmetic_result_is_null
+ goto fp_math
__244:
;
- if !((iA == int64(-1)) && (*(*I64)(unsafe.Pointer(bp + 184 /* iB */)) == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) {
+ goto __236
+__240:
+ if !(iA == int64(0)) {
goto __245
}
- goto fp_math
+ goto arithmetic_result_is_null
__245:
;
- *(*I64)(unsafe.Pointer(bp + 184 /* iB */)) /= iA
- goto __235
-__240:
- if !(iA == int64(0)) {
+ if !((iA == int64(-1)) && (*(*I64)(unsafe.Pointer(bp + 176 /* iB */)) == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) {
goto __246
}
- goto arithmetic_result_is_null
+ goto fp_math
__246:
;
- if !(iA == int64(-1)) {
+ *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) /= iA
+ goto __236
+__241:
+ if !(iA == int64(0)) {
goto __247
}
- iA = int64(1)
+ goto arithmetic_result_is_null
__247:
;
- *(*I64)(unsafe.Pointer(bp + 184 /* iB */)) %= iA
- goto __235
-__235:
+ if !(iA == int64(-1)) {
+ goto __248
+ }
+ iA = int64(1)
+__248:
;
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 184 /* iB */))
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
- goto __234
-__233:
+ *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) %= iA
+ goto __236
+__236:
+ ;
+ *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 176 /* iB */))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
+ goto __235
+__234:
if !((int32(flags) & 0x0001) != 0) {
- goto __248
+ goto __249
}
goto arithmetic_result_is_null
- goto __249
-__248:
+ goto __250
+__249:
fp_math:
rA = Xsqlite3VdbeRealValue(tls, pIn1)
rB = Xsqlite3VdbeRealValue(tls, pIn2)
switch int32((*Op)(unsafe.Pointer(pOp)).Fopcode) {
case 105:
- goto __251
- case 106:
goto __252
- case 107:
+ case 106:
goto __253
- case 108:
+ case 107:
goto __254
- default:
+ case 108:
goto __255
+ default:
+ goto __256
}
- goto __250
-__251:
- rB = rB + (rA)
- goto __250
+ goto __251
__252:
- rB = rB - (rA)
- goto __250
+ rB = rB + (rA)
+ goto __251
__253:
- rB = rB * (rA)
- goto __250
+ rB = rB - (rA)
+ goto __251
__254:
+ rB = rB * (rA)
+ goto __251
+__255:
// (double)0 In case of SQLITE_OMIT_FLOATING_POINT...
if !(rA == float64(0)) {
- goto __256
+ goto __257
}
goto arithmetic_result_is_null
-__256:
+__257:
;
rB = rB / (rA)
- goto __250
-__255:
+ goto __251
+__256:
iA = Xsqlite3VdbeIntValue(tls, pIn1)
- *(*I64)(unsafe.Pointer(bp + 184 /* iB */)) = Xsqlite3VdbeIntValue(tls, pIn2)
+ *(*I64)(unsafe.Pointer(bp + 176 /* iB */)) = Xsqlite3VdbeIntValue(tls, pIn2)
if !(iA == int64(0)) {
- goto __257
+ goto __258
}
goto arithmetic_result_is_null
-__257:
+__258:
;
if !(iA == int64(-1)) {
- goto __258
+ goto __259
}
iA = int64(1)
-__258:
+__259:
;
- rB = (float64(*(*I64)(unsafe.Pointer(bp + 184 /* iB */)) % iA))
- goto __250
-__250:
+ rB = (float64(*(*I64)(unsafe.Pointer(bp + 176 /* iB */)) % iA))
+ goto __251
+__251:
;
if !(Xsqlite3IsNaN(tls, rB) != 0) {
- goto __259
+ goto __260
}
goto arithmetic_result_is_null
-__259:
+__260:
;
*(*float64)(unsafe.Pointer(pOut /* &.u */)) = rB
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0008))
-__249:
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0008))
+__250:
;
-__234:
+__235:
;
goto __10
@@ -61583,10 +64024,10 @@ arithmetic_result_is_null:
__39:
;
if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
- goto __260
+ goto __261
}
Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), int64(0))
-__260:
+__261:
;
goto __10
@@ -61625,34 +64066,34 @@ __43:
pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
if !(((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) | int32((*Mem)(unsafe.Pointer(pIn2)).Fflags)) & 0x0001) != 0) {
- goto __261
+ goto __262
}
Xsqlite3VdbeMemSetNull(tls, pOut)
goto __10
-__261:
+__262:
;
- *(*I64)(unsafe.Pointer(bp + 200 /* iA1 */)) = Xsqlite3VdbeIntValue(tls, pIn2)
+ *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) = Xsqlite3VdbeIntValue(tls, pIn2)
iB1 = Xsqlite3VdbeIntValue(tls, pIn1)
op = (*Op)(unsafe.Pointer(pOp)).Fopcode
if !(int32(op) == 101) {
- goto __262
+ goto __263
}
- *(*I64)(unsafe.Pointer(bp + 200 /* iA1 */)) &= iB1
- goto __263
-__262:
+ *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) &= iB1
+ goto __264
+__263:
if !(int32(op) == 102) {
- goto __264
+ goto __265
}
- *(*I64)(unsafe.Pointer(bp + 200 /* iA1 */)) |= iB1
- goto __265
-__264:
+ *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) |= iB1
+ goto __266
+__265:
if !(iB1 != int64(0)) {
- goto __266
+ goto __267
}
// If shifting by a negative amount, shift in the other direction
if !(iB1 < int64(0)) {
- goto __267
+ goto __268
}
op = (U8(((2 * 103) + 1) - int32(op)))
@@ -61661,47 +64102,47 @@ __264:
} else {
iB1 = int64(64)
}
-__267:
+__268:
;
if !(iB1 >= int64(64)) {
- goto __268
+ goto __269
}
- if (*(*I64)(unsafe.Pointer(bp + 200 /* iA1 */)) >= int64(0)) || (int32(op) == 103) {
- *(*I64)(unsafe.Pointer(bp + 200 /* iA1 */)) = int64(0)
+ if (*(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) >= int64(0)) || (int32(op) == 103) {
+ *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) = int64(0)
} else {
- *(*I64)(unsafe.Pointer(bp + 200 /* iA1 */)) = int64(-1)
+ *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) = int64(-1)
}
- goto __269
-__268:
- crt.Xmemcpy(tls, bp+192 /* &uA */, bp+200 /* &iA1 */, uint64(unsafe.Sizeof(U64(0))))
+ goto __270
+__269:
+ libc.Xmemcpy(tls, bp+184 /* &uA */, bp+192 /* &iA1 */, uint64(unsafe.Sizeof(U64(0))))
if !(int32(op) == 103) {
- goto __270
+ goto __271
}
- *(*U64)(unsafe.Pointer(bp + 192 /* uA */)) <<= iB1
- goto __271
-__270:
- *(*U64)(unsafe.Pointer(bp + 192 /* uA */)) >>= iB1
+ *(*U64)(unsafe.Pointer(bp + 184 /* uA */)) <<= iB1
+ goto __272
+__271:
+ *(*U64)(unsafe.Pointer(bp + 184 /* uA */)) >>= iB1
// Sign-extend on a right shift of a negative number
- if !(*(*I64)(unsafe.Pointer(bp + 200 /* iA1 */)) < int64(0)) {
- goto __272
+ if !(*(*I64)(unsafe.Pointer(bp + 192 /* iA1 */)) < int64(0)) {
+ goto __273
}
- *(*U64)(unsafe.Pointer(bp + 192 /* uA */)) |= (U64(((U64((uint64(0xffffffff))) << 32) | uint64(0xffffffff))) << (int64(64) - iB1))
+ *(*U64)(unsafe.Pointer(bp + 184 /* uA */)) |= (U64(((U64((uint64(0xffffffff))) << 32) | uint64(0xffffffff))) << (int64(64) - iB1))
+__273:
+ ;
__272:
;
-__271:
+ libc.Xmemcpy(tls, bp+192 /* &iA1 */, bp+184 /* &uA */, uint64(unsafe.Sizeof(I64(0))))
+__270:
;
- crt.Xmemcpy(tls, bp+200 /* &iA1 */, bp+192 /* &uA */, uint64(unsafe.Sizeof(I64(0))))
-__269:
+__267:
;
__266:
;
-__265:
- ;
-__263:
+__264:
;
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 200 /* iA1 */))
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
+ *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 192 /* iA1 */))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
goto __10
// Opcode: AddImm P1 P2 * * *
@@ -61727,29 +64168,29 @@ __44: // in1
__45: // jump, in1
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & 0x0004) == 0) {
- goto __273
+ goto __274
}
applyAffinity(tls, pIn1, int8(0x43), encoding)
if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & 0x0004) == 0) {
- goto __274
+ goto __275
}
if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 0) {
- goto __275
+ goto __276
}
rc = 20
goto abort_due_to_error
- goto __276
-__275:
- goto jump_to_p2
+ goto __277
__276:
+ goto jump_to_p2
+__277:
;
-__274:
+__275:
;
-__273:
+__274:
;
- (*Mem)(unsafe.Pointer(pIn1)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pIn1))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
+ (*Mem)(unsafe.Pointer(pIn1)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pIn1))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
goto __10
// Opcode: RealAffinity P1 * * * *
@@ -61763,11 +64204,11 @@ __273:
__46: // in1
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & (0x0004 | 0x0020)) != 0) {
- goto __277
+ goto __278
}
Xsqlite3VdbeMemRealify(tls, pIn1)
-__277:
+__278:
;
goto __10
@@ -61797,17 +64238,17 @@ __47: // in1
return 0
}()
if !(rc != 0) {
- goto __278
+ goto __279
}
goto abort_due_to_error
-__278:
+__279:
;
rc = Xsqlite3VdbeMemCast(tls, pIn1, uint8((*Op)(unsafe.Pointer(pOp)).Fp2), encoding)
if !(rc != 0) {
- goto __279
+ goto __280
}
goto abort_due_to_error
-__279:
+__280:
;
updateMaxBlobsize(tls, pIn1)
@@ -61915,11 +64356,11 @@ __53: // Copy of initial value of pIn3->flags
flags11 = (*Mem)(unsafe.Pointer(pIn1)).Fflags
flags3 = (*Mem)(unsafe.Pointer(pIn3)).Fflags
if !(((int32(flags11) | int32(flags3)) & 0x0001) != 0) {
- goto __280
+ goto __281
}
// One or both operands are NULL
if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x80) != 0) {
- goto __282
+ goto __283
}
// 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
@@ -61927,130 +64368,130 @@ __53: // Copy of initial value of pIn3->flags
if !((((int32(flags11) & int32(flags3)) & 0x0001) != 0) &&
((int32(flags3) & 0x0100) == 0)) {
- goto __284
+ goto __285
}
res = 0
- goto __285
-__284:
+ goto __286
+__285:
res = func() int32 {
if (int32(flags3) & 0x0001) != 0 {
return -1
}
return +1
}()
-__285:
+__286:
;
- goto __283
-__282:
+ goto __284
+__283:
// SQLITE_NULLEQ is clear and at least one operand is NULL,
// then the result is always NULL.
// The jump is taken if the SQLITE_JUMPIFNULL bit is set.
if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x20) != 0) {
- goto __286
+ goto __287
}
pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
iCompare = 1 // Operands are not equal
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0001))
- goto __287
-__286:
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0001))
+ goto __288
+__287:
;
if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x10) != 0) {
- goto __288
+ goto __289
}
goto jump_to_p2
-__288:
+__289:
;
-__287:
+__288:
;
goto __10
-__283:
+__284:
;
- goto __281
-__280:
+ goto __282
+__281:
// Neither operand is NULL. Do a comparison.
affinity = (int8(int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x47))
if !(int32(affinity) >= 0x43) {
- goto __289
+ goto __290
}
if !(((int32(flags11) | int32(flags3)) & 0x0002) != 0) {
- goto __291
+ goto __292
}
if !((int32(flags11) & (((0x0004 | 0x0020) | 0x0008) | 0x0002)) == 0x0002) {
- goto __292
+ goto __293
}
applyNumericAffinity(tls, pIn1, 0)
flags3 = (*Mem)(unsafe.Pointer(pIn3)).Fflags
-__292:
+__293:
;
if !((int32(flags3) & (((0x0004 | 0x0020) | 0x0008) | 0x0002)) == 0x0002) {
- goto __293
+ goto __294
}
applyNumericAffinity(tls, pIn3, 0)
-__293:
+__294:
;
-__291:
+__292:
;
// Handle the common case of integer comparison here, as an
// optimization, to avoid a call to sqlite3MemCompare()
if !(((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & int32((*Mem)(unsafe.Pointer(pIn3)).Fflags)) & 0x0004) != 0) {
- goto __294
+ goto __295
}
if !(*(*I64)(unsafe.Pointer(pIn3 /* &.u */)) > *(*I64)(unsafe.Pointer(pIn1 /* &.u */))) {
- goto __295
+ goto __296
}
res = +1
goto compare_op
-__295:
+__296:
;
if !(*(*I64)(unsafe.Pointer(pIn3 /* &.u */)) < *(*I64)(unsafe.Pointer(pIn1 /* &.u */))) {
- goto __296
+ goto __297
}
res = -1
goto compare_op
-__296:
+__297:
;
res = 0
goto compare_op
-__294:
+__295:
;
- goto __290
-__289:
+ goto __291
+__290:
if !(int32(affinity) == 0x42) {
- goto __297
+ goto __298
}
if !(((int32(flags11) & 0x0002) == 0) && ((int32(flags11) & ((0x0004 | 0x0008) | 0x0020)) != 0)) {
- goto __298
+ goto __299
}
Xsqlite3VdbeMemStringify(tls, pIn1, encoding, uint8(1))
- flags11 = (U16((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & ^int32(crt.Int32FromInt32(0xc1bf))) | (int32(flags11) & 0xc1bf)))
+ flags11 = (U16((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & ^int32(libc.Int32FromInt32(0xc1bf))) | (int32(flags11) & 0xc1bf)))
if !(pIn1 == pIn3) {
- goto __299
+ goto __300
}
flags3 = (U16(int32(flags11) | 0x0002))
-__299:
+__300:
;
-__298:
+__299:
;
if !(((int32(flags3) & 0x0002) == 0) && ((int32(flags3) & ((0x0004 | 0x0008) | 0x0020)) != 0)) {
- goto __300
+ goto __301
}
Xsqlite3VdbeMemStringify(tls, pIn3, encoding, uint8(1))
- flags3 = (U16((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & ^int32(crt.Int32FromInt32(0xc1bf))) | (int32(flags3) & 0xc1bf)))
-__300:
+ flags3 = (U16((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & ^int32(libc.Int32FromInt32(0xc1bf))) | (int32(flags3) & 0xc1bf)))
+__301:
;
-__297:
+__298:
;
-__290:
+__291:
;
res = Xsqlite3MemCompare(tls, pIn3, pIn1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
-__281:
+__282:
;
compare_op:
// At this point, res is negative, zero, or positive if reg[P1] is
@@ -62062,21 +64503,21 @@ compare_op:
;
if !(res < 0) {
- goto __301
+ goto __302
}
res2 = int32(aLTb[(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) - 52)])
- goto __302
-__301:
+ goto __303
+__302:
if !(res == 0) {
- goto __303
+ goto __304
}
res2 = int32(aEQb[(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) - 52)])
- goto __304
-__303:
- res2 = int32(aGTb[(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) - 52)])
+ goto __305
__304:
+ res2 = int32(aGTb[(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) - 52)])
+__305:
;
-__302:
+__303:
;
// Undo any changes made by applyAffinity() to the input registers.
@@ -62086,12 +64527,12 @@ __302:
(*Mem)(unsafe.Pointer(pIn1)).Fflags = flags11
if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x20) != 0) {
- goto __305
+ goto __306
}
pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
iCompare = res
if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x08) != 0) {
- goto __307
+ goto __308
}
// The KEEPNULL flag prevents OP_Eq from overwriting a NULL with 1
// and prevents OP_Ne from overwriting NULL with 0. This flag
@@ -62101,27 +64542,27 @@ __302:
// Therefore it is not necessary to check the content of r[P2] for
// NULL.
- if !((crt.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == 53)) == res2) {
- goto __308
+ if !((libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == 53)) == res2) {
+ goto __309
}
goto __10
-__308:
+__309:
;
-__307:
+__308:
;
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
*(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(res2)
- goto __306
-__305:
+ goto __307
+__306:
;
if !(res2 != 0) {
- goto __309
+ goto __310
}
goto jump_to_p2
-__309:
+__310:
;
-__306:
+__307:
;
goto __10
@@ -62141,10 +64582,10 @@ __54: // same as TK_ESCAPE, jump
;
if !(iCompare != 0) {
- goto __310
+ goto __311
}
goto jump_to_p2
-__310:
+__311:
;
goto __10
@@ -62186,15 +64627,15 @@ __55:
__56: // The permutation
if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x01) == 0) {
- goto __311
+ goto __312
}
aPermute = uintptr(0)
- goto __312
-__311:
+ goto __313
+__312:
;
- aPermute = (*(*uintptr)(unsafe.Pointer(pOp + crt.UintptrFromInt32(-1)*24 + 16 /* &.p4 */)) + uintptr(1)*4)
-__312:
+ aPermute = (*(*uintptr)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*32 + 16 /* &.p4 */)) + uintptr(1)*4)
+__313:
;
n2 = (*Op)(unsafe.Pointer(pOp)).Fp3
pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
@@ -62202,44 +64643,44 @@ __312:
p11 = (*Op)(unsafe.Pointer(pOp)).Fp1
p21 = (*Op)(unsafe.Pointer(pOp)).Fp2
i1 = 0
-__313:
+__314:
if !(i1 < n2) {
- goto __315
+ goto __316
}
if aPermute != 0 {
- idx = *(*int32)(unsafe.Pointer(aPermute + uintptr(i1)*4))
+ idx = *(*U32)(unsafe.Pointer(aPermute + uintptr(i1)*4))
} else {
- idx = i1
+ idx = U32(i1)
}
pColl = *(*uintptr)(unsafe.Pointer((pKeyInfo + 32 /* &.aColl */) + uintptr(i1)*8))
bRev = (int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i1)))) & 0x01)
- iCompare = Xsqlite3MemCompare(tls, (aMem + uintptr((p11+idx))*56), (aMem + uintptr((p21+idx))*56), pColl)
+ iCompare = Xsqlite3MemCompare(tls, (aMem + uintptr((U32(p11)+idx))*56), (aMem + uintptr((U32(p21)+idx))*56), pColl)
if !(iCompare != 0) {
- goto __316
+ goto __317
}
if !(((int32(*(*U8)(unsafe.Pointer((*KeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(i1)))) & 0x02) != 0) &&
- (((int32((*Mem)(unsafe.Pointer(aMem+uintptr((p11+idx))*56)).Fflags) & 0x0001) != 0) || ((int32((*Mem)(unsafe.Pointer(aMem+uintptr((p21+idx))*56)).Fflags) & 0x0001) != 0))) {
- goto __317
+ (((int32((*Mem)(unsafe.Pointer(aMem+uintptr((U32(p11)+idx))*56)).Fflags) & 0x0001) != 0) || ((int32((*Mem)(unsafe.Pointer(aMem+uintptr((U32(p21)+idx))*56)).Fflags) & 0x0001) != 0))) {
+ goto __318
}
iCompare = -iCompare
-__317:
+__318:
;
if !(bRev != 0) {
- goto __318
+ goto __319
}
iCompare = -iCompare
-__318:
+__319:
;
- goto __315
-__316:
+ goto __316
+__317:
;
- goto __314
-__314:
- i1++
- goto __313
goto __315
__315:
+ i1++
+ goto __314
+ goto __316
+__316:
;
goto __10
@@ -62250,22 +64691,22 @@ __315:
// equal to, or greater than the P2 vector, respectively.
__57: // jump
if !(iCompare < 0) {
- goto __319
+ goto __320
}
- pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1-1))*24)
- goto __320
-__319:
+ pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1-1))*32)
+ goto __321
+__320:
if !(iCompare == 0) {
- goto __321
+ goto __322
}
- pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2-1))*24)
- goto __322
-__321:
- ;
- pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp3-1))*24)
+ pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2-1))*32)
+ goto __323
__322:
;
-__320:
+ pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp3-1))*32)
+__323:
+ ;
+__321:
;
goto __10
@@ -62293,24 +64734,24 @@ __59: // Right operand: 0==FALSE, 1==TRUE, 2==UNKNOWN or NULL
v1 = Xsqlite3VdbeBooleanValue(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), 2)
v2 = Xsqlite3VdbeBooleanValue(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56), 2)
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == 44) {
- goto __323
+ goto __324
}
v1 = int32(and_logic[((v1 * 3) + v2)])
- goto __324
-__323:
- v1 = int32(or_logic[((v1 * 3) + v2)])
+ goto __325
__324:
+ v1 = int32(or_logic[((v1 * 3) + v2)])
+__325:
;
pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
if !(v1 == 2) {
- goto __325
+ goto __326
}
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0001))
- goto __326
-__325:
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(v1)
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0001))
+ goto __327
__326:
+ *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(v1)
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0004))
+__327:
;
goto __10
@@ -62350,13 +64791,13 @@ __61: // same as TK_NOT, in1, out2
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & 0x0001) == 0) {
- goto __327
+ goto __328
}
- Xsqlite3VdbeMemSetInt64(tls, pOut, crt.BoolInt64(!(Xsqlite3VdbeBooleanValue(tls, pIn1, 0) != 0)))
- goto __328
-__327:
- Xsqlite3VdbeMemSetNull(tls, pOut)
+ Xsqlite3VdbeMemSetInt64(tls, pOut, libc.BoolInt64(!(Xsqlite3VdbeBooleanValue(tls, pIn1, 0) != 0)))
+ goto __329
__328:
+ Xsqlite3VdbeMemSetNull(tls, pOut)
+__329:
;
goto __10
@@ -62371,11 +64812,11 @@ __62: // same as TK_BITNOT, in1, out2
pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
Xsqlite3VdbeMemSetNull(tls, pOut)
if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & 0x0001) == 0) {
- goto __329
+ goto __330
}
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(0x0004)
*(*I64)(unsafe.Pointer(pOut /* &.u */)) = ^Xsqlite3VdbeIntValue(tls, pIn1)
-__329:
+__330:
;
goto __10
@@ -62398,30 +64839,30 @@ __329:
__63: // Address of this instruction
;
if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) {
- goto __330
+ goto __331
}
- iAddr = U32((int32((int64(pOp) - int64((*Vdbe)(unsafe.Pointer(p)).FaOp)) / 24)))
+ iAddr = U32((int32((int64(pOp) - int64((*Vdbe)(unsafe.Pointer(p)).FaOp)) / 32)))
if !((int32(*(*U8)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr((iAddr / U32(8)))))) & (int32(1) << (iAddr & U32(7)))) != 0) {
- goto __332
+ goto __333
}
goto jump_to_p2
-__332:
+__333:
;
*(*U8)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FpFrame)).FaOnce + uintptr((iAddr / U32(8))))) |= U8((int32(1) << (iAddr & U32(7))))
- goto __331
-__330:
- if !((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(0)*24)).Fp1 == (*Op)(unsafe.Pointer(pOp)).Fp1) {
- goto __333
+ goto __332
+__331:
+ if !((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(0)*32)).Fp1 == (*Op)(unsafe.Pointer(pOp)).Fp1) {
+ goto __334
}
goto jump_to_p2
-__333:
+__334:
;
-__331:
+__332:
;
- (*Op)(unsafe.Pointer(pOp)).Fp1 = (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(0)*24)).Fp1
+ (*Op)(unsafe.Pointer(pOp)).Fp1 = (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(0)*32)).Fp1
goto __10
// Opcode: If P1 P2 P3 * *
@@ -62433,10 +64874,10 @@ __64:
c = Xsqlite3VdbeBooleanValue(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), (*Op)(unsafe.Pointer(pOp)).Fp3)
if !(c != 0) {
- goto __334
+ goto __335
}
goto jump_to_p2
-__334:
+__335:
;
goto __10
@@ -62446,13 +64887,13 @@ __334:
// is considered false if it has a numeric value of zero. If the value
// in P1 is NULL then take the jump if and only if P3 is non-zero.
__65:
- c1 = crt.BoolInt32(!(Xsqlite3VdbeBooleanValue(tls, (aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), crt.BoolInt32(!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0))) != 0))
+ c1 = libc.BoolInt32(!(Xsqlite3VdbeBooleanValue(tls, (aMem+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56), libc.BoolInt32(!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0))) != 0))
if !(c1 != 0) {
- goto __335
+ goto __336
}
goto jump_to_p2
-__335:
+__336:
;
goto __10
@@ -62464,10 +64905,10 @@ __66: // same as TK_ISNULL, jump, in1
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & 0x0001) != 0) {
- goto __336
+ goto __337
}
goto jump_to_p2
-__336:
+__337:
;
goto __10
@@ -62479,10 +64920,10 @@ __67: // same as TK_NOTNULL, jump, in1
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & 0x0001) == 0) {
- goto __337
+ goto __338
}
goto jump_to_p2
-__337:
+__338:
;
goto __10
@@ -62497,11 +64938,40 @@ __68: // jump
;
if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)))).FnullRow != 0) {
- goto __338
+ goto __339
}
Xsqlite3VdbeMemSetNull(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56))
goto jump_to_p2
-__338:
+__339:
+ ;
+ goto __10
+
+ // Opcode: Offset P1 P2 P3 * *
+ // Synopsis: r[P3] = sqlite_offset(P1)
+ //
+ // Store in register r[P3] the byte offset into the database file that is the
+ // start of the payload for the record at which that cursor P1 is currently
+ // pointing.
+ //
+ // P2 is the column number for the argument to the sqlite_offset() function.
+ // This opcode does not use P2 itself, but the P2 value is used by the
+ // code generator. The P1, P2, and P3 operands to this opcode are the
+ // same as for OP_Column.
+ //
+ // This opcode is only available if SQLite is compiled with the
+ // -DSQLITE_ENABLE_OFFSET_SQL_FUNC option.
+__69: // The VDBE cursor
+ ;
+ pC = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pOut = ((*Vdbe)(unsafe.Pointer(p)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
+ if !((pC == uintptr(0)) || (int32((*VdbeCursor)(unsafe.Pointer(pC)).FeCurType) != 0)) {
+ goto __340
+ }
+ Xsqlite3VdbeMemSetNull(tls, pOut)
+ goto __341
+__340:
+ Xsqlite3VdbeMemSetInt64(tls, pOut, Xsqlite3BtreeOffset(tls, *(*uintptr)(unsafe.Pointer(pC + 56 /* &.uc */))))
+__341:
;
goto __10
@@ -62524,87 +64994,87 @@ __338:
// the result is guaranteed to only be used as the argument of a length()
// or typeof() function, respectively. The loading of large blobs can be
// skipped for length() and all content loading can be skipped for typeof().
-__69: // PseudoTable input register
+__70: // PseudoTable input register
;
- *(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)) = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ *(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- *(*int32)(unsafe.Pointer(bp + 216 /* p22 */)) = (*Op)(unsafe.Pointer(pOp)).Fp2
+ *(*U32)(unsafe.Pointer(bp + 208 /* p22 */)) = U32((*Op)(unsafe.Pointer(pOp)).Fp2)
// If the cursor cache is stale (meaning it is not currently point at
// the correct row) then bring it up-to-date by doing the necessary
// B-Tree seek.
- rc = Xsqlite3VdbeCursorMoveto(tls, bp+208 /* &pC */, bp+216 /* &p22 */)
+ rc = Xsqlite3VdbeCursorMoveto(tls, bp+200 /* &pC1 */, bp+208 /* &p22 */)
if !(rc != 0) {
- goto __339
+ goto __342
}
goto abort_due_to_error
-__339:
+__342:
;
pDest = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
- aOffset = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaOffset
+ aOffset = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaOffset
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FcacheStatus != (*Vdbe)(unsafe.Pointer(p)).FcacheCtr) {
- goto __340
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FcacheStatus != (*Vdbe)(unsafe.Pointer(p)).FcacheCtr) {
+ goto __343
} //OPTIMIZATION-IF-FALSE
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FnullRow != 0) {
- goto __341
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnullRow != 0) {
+ goto __344
}
- if !(int32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FeCurType) == 3) {
- goto __343
+ if !(int32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FeCurType) == 3) {
+ goto __346
}
// For the special case of as pseudo-cursor, the seekResult field
// identifies the register that holds the record
- pReg = (aMem + uintptr((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FseekResult)*56)
+ pReg = (aMem + uintptr((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FseekResult)*56)
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FpayloadSize = crt.AssignPtrUint32(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */))+116 /* &.szRow */, U32((*Mem)(unsafe.Pointer(pReg)).Fn))
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaRow = (*Mem)(unsafe.Pointer(pReg)).Fz
- goto __344
-__343:
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize = libc.AssignPtrUint32(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */))+116 /* &.szRow */, U32((*Mem)(unsafe.Pointer(pReg)).Fn))
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow = (*Mem)(unsafe.Pointer(pReg)).Fz
+ goto __347
+__346:
Xsqlite3VdbeMemSetNull(tls, pDest)
goto op_column_out
-__344:
+__347:
;
- goto __342
-__341:
- pCrsr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)) + 56 /* &.uc */))
+ goto __345
+__344:
+ pCrsr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 56 /* &.uc */))
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FpayloadSize = Xsqlite3BtreePayloadSize(tls, pCrsr)
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaRow = Xsqlite3BtreePayloadFetch(tls, pCrsr, (*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)) + 116 /* &.szRow */))
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize = Xsqlite3BtreePayloadSize(tls, pCrsr)
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow = Xsqlite3BtreePayloadFetch(tls, pCrsr, (*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 116 /* &.szRow */))
// Maximum page size is 64KiB
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FpayloadSize > U32(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(0)*4)))) {
- goto __345
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize > U32(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(0)*4)))) {
+ goto __348
}
goto too_big
-__345:
+__348:
;
-__342:
+__345:
;
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FcacheStatus = (*Vdbe)(unsafe.Pointer(p)).FcacheCtr
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FiHdrOffset = U32(func() uint8 {
- if int32(*(*U8)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaRow))) < int32(U8(0x80)) {
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FcacheStatus = (*Vdbe)(unsafe.Pointer(p)).FcacheCtr
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset = U32(func() uint8 {
+ if int32(*(*U8)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow))) < int32(U8(0x80)) {
return uint8(func() int32 {
- (*(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4))) = U32(*(*U8)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaRow)))
+ (*(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4))) = U32(*(*U8)(unsafe.Pointer((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow)))
return 1
}())
}
- return Xsqlite3GetVarint32(tls, (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaRow, (aOffset + uintptr(0)*4))
+ return Xsqlite3GetVarint32(tls, (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow, (aOffset + uintptr(0)*4))
}())
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FnHdrParsed = U16(0)
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed = U16(0)
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FszRow < *(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4))) {
- goto __346
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FszRow < *(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4))) {
+ goto __349
} //OPTIMIZATION-IF-FALSE
// pC->aRow does not have to hold the entire row, but it does at least
// need to cover the header of the record. If pC->aRow does not contain
// the complete header, then set it to zero, forcing the header to be
// dynamically allocated.
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaRow = uintptr(0)
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FszRow = U32(0)
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow = uintptr(0)
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FszRow = U32(0)
// Make sure a corrupt database has not given us an oversize header.
// Do this now to avoid an oversize memory allocation.
@@ -62614,14 +65084,14 @@ __342:
// them, respectively. So the maximum header length results from a
// 3-byte type for each of the maximum of 32768 columns plus three
// extra bytes for the header length itself. 32768*3 + 3 = 98307.
- if !((*(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4)) > U32(98307)) || (*(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4)) > (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FpayloadSize)) {
- goto __348
+ if !((*(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4)) > U32(98307)) || (*(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4)) > (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize)) {
+ goto __351
}
goto op_column_corrupt
-__348:
+__351:
;
- goto __347
-__346:
+ goto __350
+__349:
// This is an optimization. By skipping over the first few tests
// (ex: pC->nHdrParsed<=p2) in the next section, we achieve a
// measurable performance gain.
@@ -62634,137 +65104,137 @@ __346:
// content area, the "page header" comes after the page content and so
// this overread is harmless. Similar overreads can occur for a corrupt
// database file.
- zData = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaRow
+ zData = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow
// Conditional skipped
goto op_column_read_header
-__347:
+__350:
;
-__340:
+__343:
;
// Make sure at least the first p2+1 entries of the header have been
// parsed and valid information is in aOffset[] and pC->aType[].
- if !(int32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FnHdrParsed) <= *(*int32)(unsafe.Pointer(bp + 216 /* p22 */))) {
- goto __349
+ if !(U32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed) <= *(*U32)(unsafe.Pointer(bp + 208 /* p22 */))) {
+ goto __352
}
// If there is more header available for parsing in the record, try
// to extract additional fields up through the p2+1-th field
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FiHdrOffset < *(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4))) {
- goto __351
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset < *(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4))) {
+ goto __354
}
// Make sure zData points to enough of the record to cover the header.
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaRow == uintptr(0)) {
- goto __353
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow == uintptr(0)) {
+ goto __356
}
- crt.Xmemset(tls, bp+224 /* &sMem */, 0, uint64(unsafe.Sizeof(Mem{})))
- rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)) + 56 /* &.uc */)), *(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4)), bp+224 /* &sMem */)
+ libc.Xmemset(tls, bp+216 /* &sMem */, 0, uint64(unsafe.Sizeof(Mem{})))
+ rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 56 /* &.uc */)), *(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4)), bp+216 /* &sMem */)
if !(rc != 0) {
- goto __355
+ goto __358
}
goto abort_due_to_error
-__355:
+__358:
;
- zData = (*Mem)(unsafe.Pointer(bp + 224 /* &sMem */)).Fz
- goto __354
-__353:
- zData = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaRow
-__354:
+ zData = (*Mem)(unsafe.Pointer(bp + 216 /* &sMem */)).Fz
+ goto __357
+__356:
+ zData = (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow
+__357:
;
// Fill in pC->aType[i] and aOffset[i] values through the p2-th field.
op_column_read_header:
- i2 = int32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FnHdrParsed)
+ i2 = int32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed)
offset64 = U64(*(*U32)(unsafe.Pointer(aOffset + uintptr(i2)*4)))
- zHdr = (zData + uintptr((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FiHdrOffset))
+ zHdr = (zData + uintptr((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset))
zEndHdr = (zData + uintptr(*(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4))))
-__356:
- if !((crt.AssignPtrUint32((*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */))+120 /* &.aType */)+uintptr(i2)*4, crt.AssignPtrUint32(bp+280 /* t */, U32(*(*U8)(unsafe.Pointer(zHdr + uintptr(0))))))) < U32(0x80)) {
- goto __359
+__359:
+ if !((libc.AssignPtrUint32((*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */))+120 /* &.aType */)+uintptr(i2)*4, libc.AssignPtrUint32(bp+272 /* t */, U32(*(*U8)(unsafe.Pointer(zHdr + uintptr(0))))))) < U32(0x80)) {
+ goto __362
}
zHdr++
- offset64 = offset64 + (U64(Xsqlite3VdbeOneByteSerialTypeLen(tls, uint8(*(*U32)(unsafe.Pointer(bp + 280 /* t */))))))
+ offset64 = offset64 + (U64(Xsqlite3VdbeOneByteSerialTypeLen(tls, uint8(*(*U32)(unsafe.Pointer(bp + 272 /* t */))))))
+ goto __363
+__362:
+ zHdr += uintptr(Xsqlite3GetVarint32(tls, zHdr, bp+272 /* &t */))
+ *(*U32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 120 /* &.aType */) + uintptr(i2)*4)) = *(*U32)(unsafe.Pointer(bp + 272 /* t */))
+ offset64 = offset64 + (U64(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 272 /* t */)))))
+__363:
+ ;
+ *(*U32)(unsafe.Pointer(aOffset + uintptr(libc.PreIncInt32(&i2, 1))*4)) = (U32(offset64 & uint64(0xffffffff)))
goto __360
-__359:
- zHdr += uintptr(Xsqlite3GetVarint32(tls, zHdr, bp+280 /* &t */))
- *(*U32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)) + 120 /* &.aType */) + uintptr(i2)*4)) = *(*U32)(unsafe.Pointer(bp + 280 /* t */))
- offset64 = offset64 + (U64(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 280 /* t */)))))
__360:
- ;
- *(*U32)(unsafe.Pointer(aOffset + uintptr(crt.PreIncInt32(&i2, 1))*4)) = (U32(offset64 & uint64(0xffffffff)))
- goto __357
-__357:
- if (i2 <= *(*int32)(unsafe.Pointer(bp + 216 /* p22 */))) && (zHdr < zEndHdr) {
- goto __356
+ if (U32(i2) <= *(*U32)(unsafe.Pointer(bp + 208 /* p22 */))) && (zHdr < zEndHdr) {
+ goto __359
}
- goto __358
-__358:
+ goto __361
+__361:
;
// The record is corrupt if any of the following are true:
// (1) the bytes of the header extend past the declared header size
// (2) the entire header was used but not all data was used
// (3) the end of the data extends beyond the end of the record.
- if !(((zHdr >= zEndHdr) && ((zHdr > zEndHdr) || (offset64 != U64((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FpayloadSize)))) ||
- (offset64 > U64((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FpayloadSize))) {
- goto __361
+ if !(((zHdr >= zEndHdr) && ((zHdr > zEndHdr) || (offset64 != U64((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize)))) ||
+ (offset64 > U64((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FpayloadSize))) {
+ goto __364
}
if !(*(*U32)(unsafe.Pointer(aOffset + uintptr(0)*4)) == U32(0)) {
- goto __362
+ goto __365
}
i2 = 0
zHdr = zEndHdr
- goto __363
-__362:
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaRow == uintptr(0)) {
- goto __364
+ goto __366
+__365:
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow == uintptr(0)) {
+ goto __367
}
- Xsqlite3VdbeMemRelease(tls, bp+224 /* &sMem */)
-__364:
+ Xsqlite3VdbeMemRelease(tls, bp+216 /* &sMem */)
+__367:
;
goto op_column_corrupt
-__363:
+__366:
;
-__361:
+__364:
;
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FnHdrParsed = U16(i2)
- (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FiHdrOffset = (U32((int64(zHdr) - int64(zData)) / 1))
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaRow == uintptr(0)) {
- goto __365
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed = U16(i2)
+ (*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FiHdrOffset = (U32((int64(zHdr) - int64(zData)) / 1))
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow == uintptr(0)) {
+ goto __368
}
- Xsqlite3VdbeMemRelease(tls, bp+224 /* &sMem */)
-__365:
+ Xsqlite3VdbeMemRelease(tls, bp+216 /* &sMem */)
+__368:
;
- goto __352
-__351:
- *(*U32)(unsafe.Pointer(bp + 280 /* t */)) = U32(0)
-__352:
+ goto __355
+__354:
+ *(*U32)(unsafe.Pointer(bp + 272 /* t */)) = U32(0)
+__355:
;
// If after trying to extract new entries from the header, nHdrParsed is
// still not up to p2, that means that the record has fewer than p2
// columns. So the result will be either the default value or a NULL.
- if !(int32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FnHdrParsed) <= *(*int32)(unsafe.Pointer(bp + 216 /* p22 */))) {
- goto __366
+ if !(U32((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FnHdrParsed) <= *(*U32)(unsafe.Pointer(bp + 208 /* p22 */))) {
+ goto __369
}
if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-11)) {
- goto __367
+ goto __370
}
Xsqlite3VdbeMemShallowCopy(tls, pDest, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), 0x0800)
- goto __368
-__367:
+ goto __371
+__370:
Xsqlite3VdbeMemSetNull(tls, pDest)
-__368:
+__371:
;
goto op_column_out
-__366:
+__369:
;
- goto __350
-__349:
- *(*U32)(unsafe.Pointer(bp + 280 /* t */)) = *(*U32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)) + 120 /* &.aType */) + uintptr(*(*int32)(unsafe.Pointer(bp + 216 /* p22 */)))*4))
-__350:
+ goto __353
+__352:
+ *(*U32)(unsafe.Pointer(bp + 272 /* t */)) = *(*U32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 120 /* &.aType */) + uintptr(*(*U32)(unsafe.Pointer(bp + 208 /* p22 */)))*4))
+__353:
;
// Extract the content for the p2+1-th column. Control can only
@@ -62772,55 +65242,55 @@ __350:
// all valid.
if !((int32((*Mem)(unsafe.Pointer((pDest))).Fflags) & (0x2000 | 0x0400)) != 0) {
- goto __369
+ goto __372
}
Xsqlite3VdbeMemSetNull(tls, pDest)
-__369:
+__372:
;
- if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FszRow >= *(*U32)(unsafe.Pointer(aOffset + uintptr((*(*int32)(unsafe.Pointer(bp + 216 /* p22 */))+1))*4))) {
- goto __370
+ if !((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FszRow >= *(*U32)(unsafe.Pointer(aOffset + uintptr((*(*U32)(unsafe.Pointer(bp + 208 /* p22 */))+U32(1)))*4))) {
+ goto __373
}
// This is the common case where the desired content fits on the original
// page - where the content is not on an overflow page
- zData = ((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)))).FaRow + uintptr(*(*U32)(unsafe.Pointer(aOffset + uintptr(*(*int32)(unsafe.Pointer(bp + 216 /* p22 */)))*4))))
- if !(*(*U32)(unsafe.Pointer(bp + 280 /* t */)) < U32(12)) {
- goto __372
+ zData = ((*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)))).FaRow + uintptr(*(*U32)(unsafe.Pointer(aOffset + uintptr(*(*U32)(unsafe.Pointer(bp + 208 /* p22 */)))*4))))
+ if !(*(*U32)(unsafe.Pointer(bp + 272 /* t */)) < U32(12)) {
+ goto __375
}
- Xsqlite3VdbeSerialGet(tls, zData, *(*U32)(unsafe.Pointer(bp + 280 /* t */)), pDest)
- goto __373
-__372:
- (*Mem)(unsafe.Pointer(pDest)).Fn = crt.AssignInt32(&len, (int32((*(*U32)(unsafe.Pointer(bp + 280 /* t */)) - U32(12)) / U32(2))))
+ Xsqlite3VdbeSerialGet(tls, zData, *(*U32)(unsafe.Pointer(bp + 272 /* t */)), pDest)
+ goto __376
+__375:
+ (*Mem)(unsafe.Pointer(pDest)).Fn = libc.AssignInt32(&len, (int32((*(*U32)(unsafe.Pointer(bp + 272 /* t */)) - U32(12)) / U32(2))))
(*Mem)(unsafe.Pointer(pDest)).Fenc = encoding
if !((*Mem)(unsafe.Pointer(pDest)).FszMalloc < (len + 2)) {
- goto __374
+ goto __377
}
(*Mem)(unsafe.Pointer(pDest)).Fflags = U16(0x0001)
if !(Xsqlite3VdbeMemGrow(tls, pDest, (len+2), 0) != 0) {
- goto __376
+ goto __379
}
goto no_mem
-__376:
+__379:
;
- goto __375
-__374:
+ goto __378
+__377:
(*Mem)(unsafe.Pointer(pDest)).Fz = (*Mem)(unsafe.Pointer(pDest)).FzMalloc
-__375:
+__378:
;
- crt.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, zData, uint64(len))
+ libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, zData, uint64(len))
*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pDest)).Fz + uintptr(len))) = int8(0)
*(*int8)(unsafe.Pointer((*Mem)(unsafe.Pointer(pDest)).Fz + uintptr((len + 1)))) = int8(0)
- (*Mem)(unsafe.Pointer(pDest)).Fflags = aFlag1[(*(*U32)(unsafe.Pointer(bp + 280 /* t */)) & U32(1))]
-__373:
+ (*Mem)(unsafe.Pointer(pDest)).Fflags = aFlag1[(*(*U32)(unsafe.Pointer(bp + 272 /* t */)) & U32(1))]
+__376:
;
- goto __371
-__370:
+ goto __374
+__373:
(*Mem)(unsafe.Pointer(pDest)).Fenc = encoding
// This branch happens only when content is on overflow pages
if !((((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (0x40 | 0x80)) != 0) &&
- (((*(*U32)(unsafe.Pointer(bp + 280 /* t */)) >= U32(12)) && ((*(*U32)(unsafe.Pointer(bp + 280 /* t */)) & U32(1)) == U32(0))) || ((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x80) != 0))) ||
- ((crt.AssignInt32(&len, int32(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 280 /* t */)))))) == 0)) {
- goto __377
+ (((*(*U32)(unsafe.Pointer(bp + 272 /* t */)) >= U32(12)) && ((*(*U32)(unsafe.Pointer(bp + 272 /* t */)) & U32(1)) == U32(0))) || ((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x80) != 0))) ||
+ ((libc.AssignInt32(&len, int32(Xsqlite3VdbeSerialTypeLen(tls, *(*U32)(unsafe.Pointer(bp + 272 /* t */)))))) == 0)) {
+ goto __380
}
// Content is irrelevant for
// 1. the typeof() function,
@@ -62834,21 +65304,21 @@ __370:
// read more. Use the global constant sqlite3CtypeMap[] as the array,
// as that array is 256 bytes long (plenty for VdbeMemPrettyPrint())
// and it begins with a bunch of zeros.
- Xsqlite3VdbeSerialGet(tls, uintptr(uintptr(unsafe.Pointer(&Xsqlite3CtypeMap))), *(*U32)(unsafe.Pointer(bp + 280 /* t */)), pDest)
- goto __378
-__377:
- rc = Xsqlite3VdbeMemFromBtree(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 208 /* pC */)) + 56 /* &.uc */)), *(*U32)(unsafe.Pointer(aOffset + uintptr(*(*int32)(unsafe.Pointer(bp + 216 /* p22 */)))*4)), uint32(len), pDest)
+ Xsqlite3VdbeSerialGet(tls, uintptr(uintptr(unsafe.Pointer(&Xsqlite3CtypeMap))), *(*U32)(unsafe.Pointer(bp + 272 /* t */)), pDest)
+ goto __381
+__380:
+ rc = Xsqlite3VdbeMemFromBtree(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 200 /* pC1 */)) + 56 /* &.uc */)), *(*U32)(unsafe.Pointer(aOffset + uintptr(*(*U32)(unsafe.Pointer(bp + 208 /* p22 */)))*4)), uint32(len), pDest)
if !(rc != 0) {
- goto __379
+ goto __382
}
goto abort_due_to_error
-__379:
+__382:
;
- Xsqlite3VdbeSerialGet(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, *(*U32)(unsafe.Pointer(bp + 280 /* t */)), pDest)
- *(*U16)(unsafe.Pointer(pDest + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x1000))))
-__378:
+ Xsqlite3VdbeSerialGet(tls, (*Mem)(unsafe.Pointer(pDest)).Fz, *(*U32)(unsafe.Pointer(bp + 272 /* t */)), pDest)
+ *(*U16)(unsafe.Pointer(pDest + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x1000))))
+__381:
;
-__371:
+__374:
;
op_column_out:
@@ -62857,16 +65327,16 @@ op_column_out:
goto __10
op_column_corrupt:
- if !((*Op)(unsafe.Pointer(aOp+uintptr(0)*24)).Fp3 > 0) {
- goto __380
+ if !((*Op)(unsafe.Pointer(aOp+uintptr(0)*32)).Fp3 > 0) {
+ goto __383
}
- pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(aOp+uintptr(0)*24)).Fp3-1))*24)
+ pOp = (aOp + uintptr(((*Op)(unsafe.Pointer(aOp+uintptr(0)*32)).Fp3-1))*32)
goto __10
- goto __381
-__380:
- rc = Xsqlite3CorruptError(tls, 87990)
+ goto __384
+__383:
+ rc = Xsqlite3CorruptError(tls, 88187)
goto abort_due_to_error
-__381:
+__384:
;
// Opcode: Affinity P1 P2 * P4 *
@@ -62877,19 +65347,19 @@ __381:
// P4 is a string that is P2 characters long. The N-th character of the
// string indicates the column affinity that should be used for the N-th
// memory cell in the range.
-__70: // The affinity to be applied
+__71: // The affinity to be applied
zAffinity = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
-__382:
+__385:
if !(1 != 0) {
- goto __383
+ goto __386
}
applyAffinity(tls, pIn1, *(*int8)(unsafe.Pointer(zAffinity + uintptr(0))), encoding)
if !((int32(*(*int8)(unsafe.Pointer(zAffinity + uintptr(0)))) == 0x45) && ((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & 0x0004) != 0)) {
- goto __384
+ goto __387
}
// When applying REAL affinity, if the result is still an MEM_Int
// that will fit in 6 bytes, then change the type to MEM_IntReal
@@ -62897,30 +65367,30 @@ __382:
// the type really wants to be REAL.
if !((*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) <= 140737488355327) && (*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) >= -140737488355328)) {
- goto __385
+ goto __388
}
*(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) |= U16((0x0020))
- *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0004))))
- goto __386
-__385:
+ *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0004))))
+ goto __389
+__388:
*(*float64)(unsafe.Pointer(pIn1 /* &.u */)) = float64(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)))
*(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) |= U16((0x0008))
- *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0004))))
-__386:
+ *(*U16)(unsafe.Pointer(pIn1 + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0004))))
+__389:
;
-__384:
+__387:
;
zAffinity++
if !(int32(*(*int8)(unsafe.Pointer(zAffinity + uintptr(0)))) == 0) {
- goto __387
+ goto __390
}
- goto __383
-__387:
+ goto __386
+__390:
;
pIn1 += 56
- goto __382
-__383:
+ goto __385
+__386:
;
goto __10
@@ -62939,7 +65409,18 @@ __383:
// macros defined in sqliteInt.h.
//
// If P4 is NULL then all index fields have the affinity BLOB.
-__71: // Where to write next byte of the payload
+ //
+ // The meaning of P5 depends on whether or not the SQLITE_ENABLE_NULL_TRIM
+ // compile-time option is enabled:
+ //
+ // * If SQLITE_ENABLE_NULL_TRIM is enabled, then the P5 is the index
+ // of the right-most table that can be null-trimmed.
+ //
+ // * If SQLITE_ENABLE_NULL_TRIM is omitted, then P5 has the value
+ // OPFLAG_NOCHNG_MAGIC if the OP_MakeRecord opcode is allowed to
+ // accept no-change records with serial_type 10. This value is
+ // only used inside an assert() and does not affect the end result.
+__72: // Where to write next byte of the payload
// Assuming the record contains N fields, the record format looks
// like this:
@@ -62973,30 +65454,30 @@ __71: // Where to write next byte of the payload
// Apply the requested affinity to all inputs
if !(zAffinity1 != 0) {
- goto __388
+ goto __391
}
pRec = pData0
-__389:
+__392:
applyAffinity(tls, pRec, *(*int8)(unsafe.Pointer(zAffinity1 + uintptr(0))), encoding)
if !((int32(*(*int8)(unsafe.Pointer(zAffinity1 + uintptr(0)))) == 0x45) && ((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & 0x0004) != 0)) {
- goto __392
+ goto __395
}
*(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) |= U16((0x0020))
- *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0004))))
-__392:
+ *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0004))))
+__395:
;
zAffinity1++
pRec += 56
- goto __390
-__390:
+ goto __393
+__393:
if *(*int8)(unsafe.Pointer(zAffinity1 + uintptr(0))) != 0 {
- goto __389
+ goto __392
}
- goto __391
-__391:
+ goto __394
+__394:
;
-__388:
+__391:
;
// Loop through the elements that will make up the record to figure
@@ -63025,13 +65506,13 @@ __388:
// nData Number of bytes of data space needed for the record
// nZero Zero bytes at the end of the record
pRec = pLast
-__393:
+__396:
;
if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & 0x0001) != 0) {
- goto __396
+ goto __399
}
if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & 0x4000) != 0) {
- goto __398
+ goto __401
}
// Values with MEM_Null and MEM_Zero are created by xColumn virtual
// table methods that never invoke sqlite3_result_xxxxx() while
@@ -63041,158 +65522,158 @@ __393:
// a true sqlite3_value_nochange().
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(10)
- goto __399
-__398:
+ goto __402
+__401:
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(0)
-__399:
+__402:
;
nHdr++
- goto __397
-__396:
+ goto __400
+__399:
if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & (0x0004 | 0x0020)) != 0) {
- goto __400
+ goto __403
}
// Figure out whether to use 1, 2, 4, 6 or 8 bytes.
i3 = *(*I64)(unsafe.Pointer(pRec /* &.u */))
if !(i3 < int64(0)) {
- goto __402
+ goto __405
}
uu = U64(^i3)
- goto __403
-__402:
+ goto __406
+__405:
uu = U64(i3)
-__403:
+__406:
;
nHdr++
if !(uu <= uint64(127)) {
- goto __404
+ goto __407
}
if !(((i3 & int64(1)) == i3) && (file_format >= 4)) {
- goto __406
+ goto __409
}
(*Mem)(unsafe.Pointer(pRec)).FuTemp = (U32(8) + U32(uu))
- goto __407
-__406:
+ goto __410
+__409:
nData++
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(1)
-__407:
+__410:
;
- goto __405
-__404:
+ goto __408
+__407:
if !(uu <= uint64(32767)) {
- goto __408
+ goto __411
}
nData = nData + (uint64(2))
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(2)
- goto __409
-__408:
+ goto __412
+__411:
if !(uu <= uint64(8388607)) {
- goto __410
+ goto __413
}
nData = nData + (uint64(3))
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(3)
- goto __411
-__410:
+ goto __414
+__413:
if !(uu <= uint64(2147483647)) {
- goto __412
+ goto __415
}
nData = nData + (uint64(4))
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(4)
- goto __413
-__412:
+ goto __416
+__415:
if !(uu <= uint64(140737488355327)) {
- goto __414
+ goto __417
}
nData = nData + (uint64(6))
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(5)
- goto __415
-__414:
+ goto __418
+__417:
nData = nData + (uint64(8))
if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & 0x0020) != 0) {
- goto __416
+ goto __419
}
// If the value is IntReal and is going to take up 8 bytes to store
// as an integer, then we might as well make it an 8-byte floating
// point value
*(*float64)(unsafe.Pointer(pRec /* &.u */)) = float64(*(*I64)(unsafe.Pointer(pRec /* &.u */)))
- *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0020))))
+ *(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0020))))
*(*U16)(unsafe.Pointer(pRec + 8 /* &.flags */)) |= U16((0x0008))
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(7)
- goto __417
-__416:
+ goto __420
+__419:
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(6)
-__417:
+__420:
;
-__415:
+__418:
;
-__413:
+__416:
;
-__411:
+__414:
;
-__409:
+__412:
;
-__405:
+__408:
;
- goto __401
-__400:
+ goto __404
+__403:
if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & 0x0008) != 0) {
- goto __418
+ goto __421
}
nHdr++
nData = nData + (uint64(8))
(*Mem)(unsafe.Pointer(pRec)).FuTemp = U32(7)
- goto __419
-__418:
+ goto __422
+__421:
;
len1 = U32((*Mem)(unsafe.Pointer(pRec)).Fn)
- serial_type = (((len1 * U32(2)) + U32(12)) + (U32(crt.Bool32((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & 0x0002) != 0))))
+ serial_type = (((len1 * U32(2)) + U32(12)) + (U32(libc.Bool32((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & 0x0002) != 0))))
if !((int32((*Mem)(unsafe.Pointer(pRec)).Fflags) & 0x4000) != 0) {
- goto __420
+ goto __423
}
serial_type = serial_type + (U32(*(*int32)(unsafe.Pointer(pRec /* &.u */)) * 2))
if !(nData != 0) {
- goto __421
+ goto __424
}
if !(Xsqlite3VdbeMemExpandBlob(tls, pRec) != 0) {
- goto __423
+ goto __426
}
goto no_mem
-__423:
+__426:
;
len1 = len1 + (U32(*(*int32)(unsafe.Pointer(pRec /* &.u */))))
- goto __422
-__421:
+ goto __425
+__424:
nZero = nZero + (I64(*(*int32)(unsafe.Pointer(pRec /* &.u */))))
-__422:
+__425:
;
-__420:
+__423:
;
nData = nData + (U64(len1))
nHdr = nHdr + (Xsqlite3VarintLen(tls, uint64(serial_type)))
(*Mem)(unsafe.Pointer(pRec)).FuTemp = serial_type
-__419:
+__422:
;
-__401:
+__404:
;
-__397:
+__400:
;
if !(pRec == pData0) {
- goto __424
+ goto __427
}
- goto __395
-__424:
+ goto __398
+__427:
;
pRec -= 56
- goto __394
-__394:
+ goto __397
+__397:
if 1 != 0 {
- goto __393
+ goto __396
}
- goto __395
-__395:
+ goto __398
+__398:
;
// EVIDENCE-OF: R-22564-11647 The header begins with a single varint
@@ -63201,22 +65682,22 @@ __395:
// itself.
if !(nHdr <= 126) {
- goto __425
+ goto __428
}
// The common case
nHdr = nHdr + (1)
- goto __426
-__425:
+ goto __429
+__428:
// Rare case of a really large header
nVarint = Xsqlite3VarintLen(tls, uint64(nHdr))
nHdr = nHdr + (nVarint)
if !(nVarint < Xsqlite3VarintLen(tls, uint64(nHdr))) {
- goto __427
+ goto __430
}
nHdr++
-__427:
+__430:
;
-__426:
+__429:
;
nByte1 = (I64(U64(nHdr) + nData))
@@ -63225,37 +65706,37 @@ __426:
// be one of the input registers (because the following call to
// sqlite3VdbeMemClearAndResize() could clobber the value before it is used).
if !((nByte1 + nZero) <= I64((*Mem)(unsafe.Pointer(pOut)).FszMalloc)) {
- goto __428
+ goto __431
}
// The output register is already large enough to hold the record.
// No error checks or buffer enlargement is required
(*Mem)(unsafe.Pointer(pOut)).Fz = (*Mem)(unsafe.Pointer(pOut)).FzMalloc
- goto __429
-__428:
+ goto __432
+__431:
// Need to make sure that the output is not too big and then enlarge
// the output register to hold the full result
if !((nByte1 + nZero) > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(0)*4)))) {
- goto __430
+ goto __433
}
goto too_big
-__430:
+__433:
;
if !(Xsqlite3VdbeMemClearAndResize(tls, pOut, int32(nByte1)) != 0) {
- goto __431
+ goto __434
}
goto no_mem
-__431:
+__434:
;
-__429:
+__432:
;
(*Mem)(unsafe.Pointer(pOut)).Fn = int32(nByte1)
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(0x0010)
if !(nZero != 0) {
- goto __432
+ goto __435
}
*(*int32)(unsafe.Pointer(pOut /* &.u */)) = int32(nZero)
*(*U16)(unsafe.Pointer(pOut + 8 /* &.flags */)) |= U16((0x4000))
-__432:
+__435:
;
updateMaxBlobsize(tls, pOut)
zHdr1 = (*Mem)(unsafe.Pointer(pOut)).Fz
@@ -63270,7 +65751,7 @@ __432:
}())
pRec = pData0
-__433:
+__436:
serial_type = (*Mem)(unsafe.Pointer(pRec)).FuTemp
// EVIDENCE-OF: R-06529-47362 Following the size varint are one or more
// additional varints, one per column.
@@ -63283,13 +65764,13 @@ __433:
// EVIDENCE-OF: R-64536-51728 The values for each column in the record
// immediately follow the header.
zPayload += uintptr(Xsqlite3VdbeSerialPut(tls, zPayload, pRec, serial_type))
- goto __434
-__434:
- if (crt.PreIncUintptr(&pRec, 56)) <= pLast {
- goto __433
+ goto __437
+__437:
+ if (libc.PreIncUintptr(&pRec, 56)) <= pLast {
+ goto __436
}
- goto __435
-__435:
+ goto __438
+__438:
;
goto __10
@@ -63303,28 +65784,28 @@ __435:
// If P3==0, then an exact count is obtained, which involves visiting
// every btree page of the table. But if P3 is non-zero, an estimate
// is returned based on the current cursor position.
-__72:
+__73:
;
pCrsr1 = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) + 56 /* &.uc */))
if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
- goto __436
+ goto __439
}
- *(*I64)(unsafe.Pointer(bp + 288 /* nEntry */)) = Xsqlite3BtreeRowCountEst(tls, pCrsr1)
- goto __437
-__436:
- *(*I64)(unsafe.Pointer(bp + 288 /* nEntry */)) = int64(0) // Not needed. Only used to silence a warning.
- rc = Xsqlite3BtreeCount(tls, db, pCrsr1, bp+288 /* &nEntry */)
+ *(*I64)(unsafe.Pointer(bp + 280 /* nEntry */)) = Xsqlite3BtreeRowCountEst(tls, pCrsr1)
+ goto __440
+__439:
+ *(*I64)(unsafe.Pointer(bp + 280 /* nEntry */)) = int64(0) // Not needed. Only used to silence a warning.
+ rc = Xsqlite3BtreeCount(tls, db, pCrsr1, bp+280 /* &nEntry */)
if !(rc != 0) {
- goto __438
+ goto __441
}
goto abort_due_to_error
-__438:
+__441:
;
-__437:
+__440:
;
pOut = out2Prerelease(tls, p, pOp)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 288 /* nEntry */))
+ *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 280 /* nEntry */))
goto check_for_interrupt
// Opcode: Savepoint P1 * * P4 *
@@ -63333,7 +65814,7 @@ __437:
// on the value of P1. To open a new savepoint set P1==0 (SAVEPOINT_BEGIN).
// To release (commit) an existing savepoint set P1==1 (SAVEPOINT_RELEASE).
// To rollback an existing savepoint set P1==2 (SAVEPOINT_ROLLBACK).
-__73:
+__74:
p12 = (*Op)(unsafe.Pointer(pOp)).Fp1
zName = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
@@ -63342,17 +65823,17 @@ __73:
// transaction, then there cannot be any savepoints.
if !(p12 == 0) {
- goto __439
+ goto __442
}
if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0) {
- goto __441
+ goto __444
}
// A new savepoint cannot be created if there are active write
// statements (i.e. open read/write incremental blob handles).
- Xsqlite3VdbeError(tls, p, ts+4982 /* "cannot open save..." */, 0)
+ Xsqlite3VdbeError(tls, p, ts+7180 /* "cannot open save..." */, 0)
rc = 5
- goto __442
-__441:
+ goto __445
+__444:
nName = Xsqlite3Strlen30(tls, zName)
// This call is Ok even if this savepoint is actually a transaction
@@ -63363,31 +65844,31 @@ __441:
rc = Xsqlite3VtabSavepoint(tls, db, 0,
((*Sqlite3)(unsafe.Pointer(db)).FnStatement + (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint))
if !(rc != 0) {
- goto __443
+ goto __446
}
goto abort_due_to_error
-__443:
+__446:
;
// Create a new savepoint structure.
pNew = Xsqlite3DbMallocRawNN(tls, db, (uint64((uint64(unsafe.Sizeof(Savepoint{})) + uint64(nName)) + uint64(1))))
if !(pNew != 0) {
- goto __444
+ goto __447
}
(*Savepoint)(unsafe.Pointer(pNew)).FzName = (pNew + uintptr(1)*32)
- crt.Xmemcpy(tls, (*Savepoint)(unsafe.Pointer(pNew)).FzName, zName, (uint64(nName + 1)))
+ libc.Xmemcpy(tls, (*Savepoint)(unsafe.Pointer(pNew)).FzName, zName, (uint64(nName + 1)))
// If there is no open transaction, then mark this as a special
// "transaction savepoint".
if !((*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0) {
- goto __445
+ goto __448
}
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0)
(*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint = U8(1)
- goto __446
-__445:
+ goto __449
+__448:
(*Sqlite3)(unsafe.Pointer(db)).FnSavepoint++
-__446:
+__449:
;
// Link the new savepoint into the database handle's list.
@@ -63395,163 +65876,163 @@ __446:
(*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = pNew
(*Savepoint)(unsafe.Pointer(pNew)).FnDeferredCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons
(*Savepoint)(unsafe.Pointer(pNew)).FnDeferredImmCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons
-__444:
+__447:
;
-__442:
+__445:
;
- goto __440
-__439:
+ goto __443
+__442:
;
iSavepoint = 0
// Find the named savepoint. If there is no such savepoint, then an
// an error is returned to the user.
pSavepoint = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint
-__447:
+__450:
if !((pSavepoint != 0) && (Xsqlite3StrICmp(tls, (*Savepoint)(unsafe.Pointer(pSavepoint)).FzName, zName) != 0)) {
- goto __449
+ goto __452
}
iSavepoint++
- goto __448
-__448:
+ goto __451
+__451:
pSavepoint = (*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext
- goto __447
- goto __449
-__449:
+ goto __450
+ goto __452
+__452:
;
if !(!(pSavepoint != 0)) {
- goto __450
+ goto __453
}
- Xsqlite3VdbeError(tls, p, ts+5033 /* "no such savepoin..." */, crt.VaList(bp+56, zName))
+ Xsqlite3VdbeError(tls, p, ts+7231 /* "no such savepoin..." */, libc.VaList(bp+56, zName))
rc = 1
- goto __451
-__450:
+ goto __454
+__453:
if !(((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0) && (p12 == 1)) {
- goto __452
+ goto __455
}
// It is not possible to release (commit) a savepoint if there are
// active write statements.
Xsqlite3VdbeError(tls, p,
- ts+5055 /* "cannot release s..." */, 0)
+ ts+7253 /* "cannot release s..." */, 0)
rc = 5
- goto __453
-__452:
+ goto __456
+__455:
// Determine whether or not this is a transaction savepoint. If so,
// and this is a RELEASE command, then the current transaction
// is committed.
- isTransaction = (crt.Bool32(((*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext == uintptr(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint != 0)))
+ isTransaction = (libc.Bool32(((*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext == uintptr(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint != 0)))
if !((isTransaction != 0) && (p12 == 1)) {
- goto __454
+ goto __457
}
- if !((crt.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1))) != 0) {
- goto __456
+ if !((libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1))) != 0) {
+ goto __459
}
goto vdbe_return
-__456:
+__459:
;
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
if !(Xsqlite3VdbeHalt(tls, p) == 5) {
- goto __457
+ goto __460
}
- (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32((int64(pOp) - int64(aOp)) / 24))
+ (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32((int64(pOp) - int64(aOp)) / 32))
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0)
- (*Vdbe)(unsafe.Pointer(p)).Frc = crt.AssignInt32(&rc, 5)
+ (*Vdbe)(unsafe.Pointer(p)).Frc = libc.AssignInt32(&rc, 5)
goto vdbe_return
-__457:
+__460:
;
rc = (*Vdbe)(unsafe.Pointer(p)).Frc
if !(rc != 0) {
- goto __458
+ goto __461
}
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(0)
- goto __459
-__458:
+ goto __462
+__461:
(*Sqlite3)(unsafe.Pointer(db)).FisTransactionSavepoint = U8(0)
-__459:
+__462:
;
- goto __455
-__454:
+ goto __458
+__457:
iSavepoint = (((*Sqlite3)(unsafe.Pointer(db)).FnSavepoint - iSavepoint) - 1)
if !(p12 == 2) {
- goto __460
+ goto __463
}
- isSchemaChange = (crt.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0001)) != U32(0)))
+ isSchemaChange = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0001)) != U32(0)))
ii = 0
-__462:
+__465:
if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
- goto __464
+ goto __467
}
rc = Xsqlite3BtreeTripAllCursors(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii)*32)).FpBt,
(4 | (int32(2) << 8)),
- (crt.Bool32(isSchemaChange == 0)))
+ (libc.Bool32(isSchemaChange == 0)))
if !(rc != 0) {
- goto __465
+ goto __468
}
goto abort_due_to_error
-__465:
+__468:
;
- goto __463
-__463:
+ goto __466
+__466:
ii++
- goto __462
- goto __464
-__464:
+ goto __465
+ goto __467
+__467:
;
- goto __461
-__460:
+ goto __464
+__463:
;
isSchemaChange = 0
-__461:
+__464:
;
ii = 0
-__466:
+__469:
if !(ii < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
- goto __468
+ goto __471
}
rc = Xsqlite3BtreeSavepoint(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii)*32)).FpBt, p12, iSavepoint)
if !(rc != 0) {
- goto __469
+ goto __472
}
goto abort_due_to_error
-__469:
+__472:
;
- goto __467
-__467:
+ goto __470
+__470:
ii++
- goto __466
- goto __468
-__468:
+ goto __469
+ goto __471
+__471:
;
if !(isSchemaChange != 0) {
- goto __470
+ goto __473
}
Xsqlite3ExpirePreparedStatements(tls, db, 0)
Xsqlite3ResetAllSchemasOfConnection(tls, db)
*(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(0x0001))
-__470:
+__473:
;
-__455:
+__458:
;
if !(rc != 0) {
- goto __471
+ goto __474
}
goto abort_due_to_error
-__471:
+__474:
;
// Regardless of whether this is a RELEASE or ROLLBACK, destroy all
// savepoints nested inside of the savepoint being operated on.
-__472:
+__475:
if !((*Sqlite3)(unsafe.Pointer(db)).FpSavepoint != pSavepoint) {
- goto __473
+ goto __476
}
pTmp = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint
(*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pTmp)).FpNext
Xsqlite3DbFree(tls, db, pTmp)
(*Sqlite3)(unsafe.Pointer(db)).FnSavepoint--
- goto __472
-__473:
+ goto __475
+__476:
;
// If it is a RELEASE, then destroy the savepoint being operated on
@@ -63559,48 +66040,48 @@ __473:
// constraint violations present in the database to the value stored
// when the savepoint was created.
if !(p12 == 1) {
- goto __474
+ goto __477
}
(*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pSavepoint)).FpNext
Xsqlite3DbFree(tls, db, pSavepoint)
if !(!(isTransaction != 0)) {
- goto __476
+ goto __479
}
(*Sqlite3)(unsafe.Pointer(db)).FnSavepoint--
-__476:
+__479:
;
- goto __475
-__474:
+ goto __478
+__477:
;
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = (*Savepoint)(unsafe.Pointer(pSavepoint)).FnDeferredCons
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = (*Savepoint)(unsafe.Pointer(pSavepoint)).FnDeferredImmCons
-__475:
+__478:
;
if !(!(isTransaction != 0) || (p12 == 2)) {
- goto __477
+ goto __480
}
rc = Xsqlite3VtabSavepoint(tls, db, p12, iSavepoint)
if !(rc != 0) {
- goto __478
+ goto __481
}
goto abort_due_to_error
-__478:
+__481:
;
-__477:
+__480:
;
-__453:
+__456:
;
-__451:
+__454:
;
-__440:
+__443:
;
if !(rc != 0) {
- goto __479
+ goto __482
}
goto abort_due_to_error
-__479:
+__482:
;
goto __10
@@ -63613,7 +66094,7 @@ __479:
// there are active writing VMs or active VMs that use shared cache.
//
// This instruction causes the VM to halt.
-__74:
+__75:
desiredAutoCommit = (*Op)(unsafe.Pointer(pOp)).Fp1
iRollback = (*Op)(unsafe.Pointer(pOp)).Fp2
@@ -63621,78 +66102,78 @@ __74:
// At least this one VM is active
if !(desiredAutoCommit != int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit)) {
- goto __480
+ goto __483
}
if !(iRollback != 0) {
- goto __482
+ goto __485
}
Xsqlite3RollbackAll(tls, db, (4 | (int32(2) << 8)))
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
- goto __483
-__482:
+ goto __486
+__485:
if !((desiredAutoCommit != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0)) {
- goto __484
+ goto __487
}
// If this instruction implements a COMMIT and other VMs are writing
// return an error indicating that the other VMs must complete first.
Xsqlite3VdbeError(tls, p,
- ts+5109 /* "cannot commit tr..." */, 0)
+ ts+7307 /* "cannot commit tr..." */, 0)
rc = 5
goto abort_due_to_error
- goto __485
-__484:
- if !((crt.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1))) != 0) {
- goto __486
+ goto __488
+__487:
+ if !((libc.AssignInt32(&rc, Xsqlite3VdbeCheckFk(tls, p, 1))) != 0) {
+ goto __489
}
goto vdbe_return
- goto __487
-__486:
+ goto __490
+__489:
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(desiredAutoCommit)
-__487:
+__490:
;
-__485:
+__488:
;
-__483:
+__486:
;
if !(Xsqlite3VdbeHalt(tls, p) == 5) {
- goto __488
+ goto __491
}
- (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32((int64(pOp) - int64(aOp)) / 24))
+ (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32((int64(pOp) - int64(aOp)) / 32))
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = (U8(1 - desiredAutoCommit))
- (*Vdbe)(unsafe.Pointer(p)).Frc = crt.AssignInt32(&rc, 5)
+ (*Vdbe)(unsafe.Pointer(p)).Frc = libc.AssignInt32(&rc, 5)
goto vdbe_return
-__488:
+__491:
;
Xsqlite3CloseSavepoints(tls, db)
if !((*Vdbe)(unsafe.Pointer(p)).Frc == 0) {
- goto __489
+ goto __492
}
rc = 101
- goto __490
-__489:
+ goto __493
+__492:
rc = 1
-__490:
+__493:
;
goto vdbe_return
- goto __481
-__480:
+ goto __484
+__483:
Xsqlite3VdbeError(tls, p,
func() uintptr {
if !(desiredAutoCommit != 0) {
- return ts + 5164 /* "cannot start a t..." */
+ return ts + 7362 /* "cannot start a t..." */
}
return func() uintptr {
if iRollback != 0 {
- return ts + 5212 /* "cannot rollback ..." */
+ return ts + 7410 /* "cannot rollback ..." */
}
- return ts + 5255 /* "cannot commit - ..." */
+ return ts + 7453 /* "cannot commit - ..." */
}()
}(), 0)
rc = 1
goto abort_due_to_error
-__481:
+__484:
;
/*NOTREACHED*/
@@ -63729,59 +66210,59 @@ __481:
// generation counter, then an SQLITE_SCHEMA error is raised and execution
// halts. The sqlite3_step() wrapper function might then reprepare the
// statement and rerun it from the beginning.
-__75:
- *(*int32)(unsafe.Pointer(bp + 296 /* iMeta */)) = 0
+__76:
+ *(*int32)(unsafe.Pointer(bp + 288 /* iMeta */)) = 0
if !(((*Op)(unsafe.Pointer(pOp)).Fp2 != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00100000)) != uint64(0))) {
- goto __491
+ goto __494
}
rc = 8
goto abort_due_to_error
-__491:
+__494:
;
pBt = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt
if !(pBt != 0) {
- goto __492
+ goto __495
}
- rc = Xsqlite3BtreeBeginTrans(tls, pBt, (*Op)(unsafe.Pointer(pOp)).Fp2, bp+296 /* &iMeta */)
+ rc = Xsqlite3BtreeBeginTrans(tls, pBt, (*Op)(unsafe.Pointer(pOp)).Fp2, bp+288 /* &iMeta */)
if !(rc != 0) {
- goto __493
+ goto __496
}
if !((rc & 0xff) == 5) {
- goto __494
+ goto __497
}
- (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32((int64(pOp) - int64(aOp)) / 24))
+ (*Vdbe)(unsafe.Pointer(p)).Fpc = (int32((int64(pOp) - int64(aOp)) / 32))
(*Vdbe)(unsafe.Pointer(p)).Frc = rc
goto vdbe_return
-__494:
+__497:
;
goto abort_due_to_error
-__493:
+__496:
;
if !(((Bft(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.usesStmtJournal */))&0x40>>6)) != 0) &&
((*Op)(unsafe.Pointer(pOp)).Fp2 != 0)) &&
((int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0) || ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1))) {
- goto __495
+ goto __498
}
if !((*Vdbe)(unsafe.Pointer(p)).FiStatement == 0) {
- goto __496
+ goto __499
}
(*Sqlite3)(unsafe.Pointer(db)).FnStatement++
(*Vdbe)(unsafe.Pointer(p)).FiStatement = ((*Sqlite3)(unsafe.Pointer(db)).FnSavepoint + (*Sqlite3)(unsafe.Pointer(db)).FnStatement)
-__496:
+__499:
;
rc = Xsqlite3VtabSavepoint(tls, db, 0, ((*Vdbe)(unsafe.Pointer(p)).FiStatement - 1))
if !(rc == 0) {
- goto __497
+ goto __500
}
rc = Xsqlite3BtreeBeginStmt(tls, pBt, (*Vdbe)(unsafe.Pointer(p)).FiStatement)
-__497:
+__500:
;
// Store the current value of the database handles deferred constraint
@@ -63789,21 +66270,21 @@ __497:
// the value of this counter needs to be restored too.
(*Vdbe)(unsafe.Pointer(p)).FnStmtDefCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons
(*Vdbe)(unsafe.Pointer(p)).FnStmtDefImmCons = (*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons
-__495:
+__498:
;
-__492:
+__495:
;
if !(((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) &&
- ((*(*int32)(unsafe.Pointer(bp + 296 /* iMeta */)) != (*Op)(unsafe.Pointer(pOp)).Fp3) ||
+ ((*(*int32)(unsafe.Pointer(bp + 288 /* iMeta */)) != (*Op)(unsafe.Pointer(pOp)).Fp3) ||
((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpSchema)).FiGeneration != *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))))) {
- goto __498
+ goto __501
}
// IMPLEMENTATION-OF: R-03189-51135 As each SQL statement runs, the schema
// version is checked to ensure that the schema has not changed since the
// SQL statement was prepared.
Xsqlite3DbFree(tls, db, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg)
- (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3DbStrDup(tls, db, ts+5296 /* "database schema ..." */)
+ (*Vdbe)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3DbStrDup(tls, db, ts+7494 /* "database schema ..." */)
// If the schema-cookie from the database file matches the cookie
// stored with the in-memory representation of the schema, do
// not reload the schema from the database file.
@@ -63816,21 +66297,21 @@ __492:
// v-table would have to be ready for the sqlite3_vtab structure itself
// to be invalidated whenever sqlite3_step() is called from within
// a v-table method.
- if !((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpSchema)).Fschema_cookie != *(*int32)(unsafe.Pointer(bp + 296 /* iMeta */))) {
- goto __499
+ if !((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpSchema)).Fschema_cookie != *(*int32)(unsafe.Pointer(bp + 288 /* iMeta */))) {
+ goto __502
}
Xsqlite3ResetOneSchema(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1)
-__499:
+__502:
;
- crt.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(1), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(1), 0, 0x3)
rc = 17
-__498:
+__501:
;
if !(rc != 0) {
- goto __500
+ goto __503
}
goto abort_due_to_error
-__500:
+__503:
;
goto __10
@@ -63845,17 +66326,17 @@ __500:
// There must be a read-lock on the database (either a transaction
// must be started or there must be an open cursor) before
// executing this instruction.
-__76:
+__77:
;
iDb = (*Op)(unsafe.Pointer(pOp)).Fp1
iCookie = (*Op)(unsafe.Pointer(pOp)).Fp3
- Xsqlite3BtreeGetMeta(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpBt, iCookie, bp+300 /* &iMeta1 */)
+ Xsqlite3BtreeGetMeta(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpBt, iCookie, bp+292 /* &iMeta1 */)
pOut = out2Prerelease(tls, p, pOp)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 300 /* iMeta1 */)))
+ *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 292 /* iMeta1 */)))
goto __10
- // Opcode: SetCookie P1 P2 P3 * *
+ // Opcode: SetCookie P1 P2 P3 * P5
//
// Write the integer value P3 into cookie number P2 of database P1.
// P2==1 is the schema version. P2==2 is the database format.
@@ -63864,7 +66345,12 @@ __76:
// database file used to store temporary tables.
//
// A transaction must be started before executing this opcode.
-__77:
+ //
+ // If P2 is the SCHEMA_VERSION cookie (cookie number 1) then the internal
+ // schema version is set to P3-P5. The "PRAGMA schema_version=N" statement
+ // has P5 set to 1, so that the internal schema version will be different
+ // from the database schema version, resulting in a schema reset.
+__78:
;
pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)
@@ -63872,36 +66358,36 @@ __77:
// See note about index shifting on OP_ReadCookie
rc = Xsqlite3BtreeUpdateMeta(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp2, uint32((*Op)(unsafe.Pointer(pOp)).Fp3))
if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 1) {
- goto __501
+ goto __504
}
// When the schema cookie changes, record the new cookie internally
- (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fschema_cookie = (*Op)(unsafe.Pointer(pOp)).Fp3
+ (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fschema_cookie = ((*Op)(unsafe.Pointer(pOp)).Fp3 - int32((*Op)(unsafe.Pointer(pOp)).Fp5))
*(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(0x0001))
- goto __502
-__501:
+ goto __505
+__504:
if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 2) {
- goto __503
+ goto __506
}
// Record changes in the file format
(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = U8((*Op)(unsafe.Pointer(pOp)).Fp3)
-__503:
+__506:
;
-__502:
+__505:
;
if !((*Op)(unsafe.Pointer(pOp)).Fp1 == 1) {
- goto __504
+ goto __507
}
// Invalidate all prepared statements whenever the TEMP database
// schema is changed. Ticket #1644
Xsqlite3ExpirePreparedStatements(tls, db, 0)
- crt.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3)
-__504:
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3)
+__507:
;
if !(rc != 0) {
- goto __505
+ goto __508
}
goto abort_due_to_error
-__505:
+__508:
;
goto __10
@@ -63986,105 +66472,105 @@ __505:
// in read/write mode.
//
// See also: OP_OpenRead, OP_ReopenIdx
-__78:
+__79:
;
pCur = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
if !((pCur != 0) && ((*VdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot == U32((*Op)(unsafe.Pointer(pOp)).Fp2))) {
- goto __506
+ goto __509
}
// Guaranteed by the code generator
goto open_cursor_set_hints
-__506:
+__509:
;
// If the cursor is not currently open or is open on a different
// index, then fall through into OP_OpenRead to force a reopen
-__79:
__80:
+__81:
;
if !(int32(*(*uint16)(unsafe.Pointer(p + 200 /* &.expired */))&0x3>>0) == 1) {
- goto __507
+ goto __510
}
rc = (4 | (int32(2) << 8))
goto abort_due_to_error
-__507:
+__510:
;
nField1 = 0
pKeyInfo1 = uintptr(0)
- p23 = (*Op)(unsafe.Pointer(pOp)).Fp2
+ p23 = U32((*Op)(unsafe.Pointer(pOp)).Fp2)
iDb1 = (*Op)(unsafe.Pointer(pOp)).Fp3
pDb1 = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb1)*32)
pX = (*Db)(unsafe.Pointer(pDb1)).FpBt
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == 97) {
- goto __508
+ goto __511
}
wrFlag = (0x00000004 | (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x08))
if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb1)).FpSchema)).Ffile_format) < int32((*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat)) {
- goto __510
+ goto __513
}
(*Vdbe)(unsafe.Pointer(p)).FminWriteFileFormat = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb1)).FpSchema)).Ffile_format
-__510:
+__513:
;
- goto __509
-__508:
+ goto __512
+__511:
wrFlag = 0
-__509:
+__512:
;
if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x10) != 0) {
- goto __511
+ goto __514
}
pIn2 = (aMem + uintptr(p23)*56)
Xsqlite3VdbeMemIntegerify(tls, pIn2)
- p23 = int32(*(*I64)(unsafe.Pointer(pIn2 /* &.u */)))
+ p23 = U32(int32(*(*I64)(unsafe.Pointer(pIn2 /* &.u */))))
// The p2 value always comes from a prior OP_CreateBtree opcode and
// that opcode will always set the p2 value to 2 or more or else fail.
// If there were a failure, the prepared statement would have halted
// before reaching this instruction.
-__511:
+__514:
;
if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-9)) {
- goto __512
+ goto __515
}
pKeyInfo1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
nField1 = int32((*KeyInfo)(unsafe.Pointer(pKeyInfo1)).FnAllField)
- goto __513
-__512:
+ goto __516
+__515:
if !(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-3)) {
- goto __514
+ goto __517
}
nField1 = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))
-__514:
+__517:
;
-__513:
+__516:
;
// Table with INTEGER PRIMARY KEY and nothing else
pCur = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, nField1, iDb1, uint8(0))
if !(pCur == uintptr(0)) {
- goto __515
+ goto __518
}
goto no_mem
-__515:
+__518:
;
(*VdbeCursor)(unsafe.Pointer(pCur)).FnullRow = U8(1)
- crt.SetBitFieldPtr8Uint32(pCur+8 /* &.isOrdered */, Bool(1), 2, 0x4)
- (*VdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot = Pgno(p23)
+ libc.SetBitFieldPtr8Uint32(pCur+8 /* &.isOrdered */, Bool(1), 2, 0x4)
+ (*VdbeCursor)(unsafe.Pointer(pCur)).FpgnoRoot = p23
rc = Xsqlite3BtreeCursor(tls, pX, p23, wrFlag, pKeyInfo1, *(*uintptr)(unsafe.Pointer(pCur + 56 /* &.uc */)))
(*VdbeCursor)(unsafe.Pointer(pCur)).FpKeyInfo = pKeyInfo1
- /* Set the VdbeCursor.isTable variable. Previous versions of
- ** SQLite used to check if the root-page flags were sane at this point
- ** and report database corruption if they were not, but this check has
- ** since moved into the btree layer. */
- (*VdbeCursor)(unsafe.Pointer(pCur)).FisTable = (U8(crt.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) != (-9))))
+ // Set the VdbeCursor.isTable variable. Previous versions of
+ // SQLite used to check if the root-page flags were sane at this point
+ // and report database corruption if they were not, but this check has
+ // since moved into the btree layer.
+ (*VdbeCursor)(unsafe.Pointer(pCur)).FisTable = (U8(libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fp4type) != (-9))))
open_cursor_set_hints:
;
@@ -64092,10 +66578,10 @@ open_cursor_set_hints:
Xsqlite3BtreeCursorHintFlags(tls, *(*uintptr)(unsafe.Pointer(pCur + 56 /* &.uc */)),
(uint32(int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (0x01 | 0x02))))
if !(rc != 0) {
- goto __516
+ goto __519
}
goto abort_due_to_error
-__516:
+__519:
;
goto __10
@@ -64106,7 +66592,7 @@ __516:
// opcode. Only ephemeral cursors may be duplicated.
//
// Duplicate ephemeral cursors are used for self-joins of materialized views.
-__81: // The new cursor
+__82: // The new cursor
pOrig = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*8))
@@ -64114,18 +66600,18 @@ __81: // The new cursor
pCx = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, int32((*VdbeCursor)(unsafe.Pointer(pOrig)).FnField), -1, uint8(0))
if !(pCx == uintptr(0)) {
- goto __517
+ goto __520
}
goto no_mem
-__517:
+__520:
;
(*VdbeCursor)(unsafe.Pointer(pCx)).FnullRow = U8(1)
- crt.SetBitFieldPtr8Uint32(pCx+8 /* &.isEphemeral */, Bool(1), 0, 0x1)
+ libc.SetBitFieldPtr8Uint32(pCx+8 /* &.isEphemeral */, Bool(1), 0, 0x1)
(*VdbeCursor)(unsafe.Pointer(pCx)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pOrig)).FpKeyInfo
(*VdbeCursor)(unsafe.Pointer(pCx)).FisTable = (*VdbeCursor)(unsafe.Pointer(pOrig)).FisTable
(*VdbeCursor)(unsafe.Pointer(pCx)).FpgnoRoot = (*VdbeCursor)(unsafe.Pointer(pOrig)).FpgnoRoot
- crt.SetBitFieldPtr8Uint32(pCx+8 /* &.isOrdered */, Bool(int32(*(*uint8)(unsafe.Pointer(pOrig + 8 /* &.isOrdered */))&0x4>>2)), 2, 0x4)
- rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pOrig)).FpBtx, int32((*VdbeCursor)(unsafe.Pointer(pCx)).FpgnoRoot), 0x00000004,
+ libc.SetBitFieldPtr8Uint32(pCx+8 /* &.isOrdered */, Bool(int32(*(*uint8)(unsafe.Pointer(pOrig + 8 /* &.isOrdered */))&0x4>>2)), 2, 0x4)
+ rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pOrig)).FpBtx, (*VdbeCursor)(unsafe.Pointer(pCx)).FpgnoRoot, 0x00000004,
(*VdbeCursor)(unsafe.Pointer(pCx)).FpKeyInfo, *(*uintptr)(unsafe.Pointer(pCx + 56 /* &.uc */)))
// The sqlite3BtreeCursor() routine can only fail for the first cursor
// opened for a database. Since there is already an open cursor when this
@@ -64160,13 +66646,13 @@ __517:
// different name to distinguish its use. Tables created using
// by this opcode will be used for automatically created transient
// indices in joins.
-__82:
__83:
+__84:
;
pCx1 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
if !((pCx1 != 0) && ((*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx != 0)) {
- goto __518
+ goto __521
}
// If the ephermeral table is already open, erase all existing content
// so that the table is empty again, rather than creating a new table.
@@ -64174,65 +66660,65 @@ __83:
(*VdbeCursor)(unsafe.Pointer(pCx1)).FseqCount = int64(0)
(*VdbeCursor)(unsafe.Pointer(pCx1)).FcacheStatus = U32(0)
rc = Xsqlite3BtreeClearTable(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, int32((*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot), uintptr(0))
- goto __519
-__518:
+ goto __522
+__521:
pCx1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, uint8(0))
if !(pCx1 == uintptr(0)) {
- goto __520
+ goto __523
}
goto no_mem
-__520:
+__523:
;
- crt.SetBitFieldPtr8Uint32(pCx1+8 /* &.isEphemeral */, Bool(1), 0, 0x1)
+ libc.SetBitFieldPtr8Uint32(pCx1+8 /* &.isEphemeral */, Bool(1), 0, 0x1)
rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, (pCx1 + 16 /* &.pBtx */),
((1 | 4) | int32((*Op)(unsafe.Pointer(pOp)).Fp5)),
vfsFlags)
if !(rc == 0) {
- goto __521
+ goto __524
}
rc = Xsqlite3BtreeBeginTrans(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, 1, uintptr(0))
-__521:
+__524:
;
if !(rc == 0) {
- goto __522
+ goto __525
}
// If a transient index is required, create it by calling
// sqlite3BtreeCreateTable() with the BTREE_BLOBKEY flag before
// opening it. If a transient table is required, just use the
// automatically created table with root-page 1 (an BLOB_INTKEY table).
- if !((crt.AssignPtrUintptr(pCx1+64 /* &.pKeyInfo */, crt.AssignUintptr(&pKeyInfo2, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))) != uintptr(0)) {
- goto __523
+ if !((libc.AssignPtrUintptr(pCx1+64 /* &.pKeyInfo */, libc.AssignUintptr(&pKeyInfo2, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))) != uintptr(0)) {
+ goto __526
}
rc = Xsqlite3BtreeCreateTable(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, (pCx1 + 76 /* &.pgnoRoot */),
(2 | int32((*Op)(unsafe.Pointer(pOp)).Fp5)))
if !(rc == 0) {
- goto __525
+ goto __528
}
- rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, int32((*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot), 0x00000004,
+ rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot, 0x00000004,
pKeyInfo2, *(*uintptr)(unsafe.Pointer(pCx1 + 56 /* &.uc */)))
-__525:
+__528:
;
(*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(0)
- goto __524
-__523:
+ goto __527
+__526:
(*VdbeCursor)(unsafe.Pointer(pCx1)).FpgnoRoot = Pgno(1)
- rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, 1, 0x00000004,
+ rc = Xsqlite3BtreeCursor(tls, (*VdbeCursor)(unsafe.Pointer(pCx1)).FpBtx, uint32(1), 0x00000004,
uintptr(0), *(*uintptr)(unsafe.Pointer(pCx1 + 56 /* &.uc */)))
(*VdbeCursor)(unsafe.Pointer(pCx1)).FisTable = U8(1)
-__524:
+__527:
;
-__522:
+__525:
;
- crt.SetBitFieldPtr8Uint32(pCx1+8 /* &.isOrdered */, (Bool(crt.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fp5) != 8))), 2, 0x4)
-__519:
+ libc.SetBitFieldPtr8Uint32(pCx1+8 /* &.isOrdered */, (Bool(libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fp5) != 8))), 2, 0x4)
+__522:
;
if !(rc != 0) {
- goto __526
+ goto __529
}
goto abort_due_to_error
-__526:
+__529:
;
(*VdbeCursor)(unsafe.Pointer(pCx1)).FnullRow = U8(1)
goto __10
@@ -64246,24 +66732,24 @@ __526:
// If argument P3 is non-zero, then it indicates that the sorter may
// assume that a stable sort considering the first P3 fields of each
// key is sufficient to produce the required results.
-__84:
+__85:
;
pCx2 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, -1, uint8(1))
if !(pCx2 == uintptr(0)) {
- goto __527
+ goto __530
}
goto no_mem
-__527:
+__530:
;
(*VdbeCursor)(unsafe.Pointer(pCx2)).FpKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
rc = Xsqlite3VdbeSorterInit(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp3, pCx2)
if !(rc != 0) {
- goto __528
+ goto __531
}
goto abort_due_to_error
-__528:
+__531:
;
goto __10
@@ -64273,15 +66759,15 @@ __528:
// P1 is a sorter cursor. If the sequence counter is currently zero, jump
// to P2. Regardless of whether or not the jump is taken, increment the
// the sequence value.
-__85:
+__86:
;
- pC1 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC2 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- if !((crt.PostIncInt64(&(*VdbeCursor)(unsafe.Pointer(pC1)).FseqCount, 1)) == int64(0)) {
- goto __529
+ if !((libc.PostIncInt64(&(*VdbeCursor)(unsafe.Pointer(pC2)).FseqCount, 1)) == int64(0)) {
+ goto __532
}
goto jump_to_p2
-__529:
+__532:
;
goto __10
@@ -64300,15 +66786,15 @@ __529:
//
// P3 is the number of fields in the records that will be stored by
// the pseudo-table.
-__86:
+__87:
;
pCx3 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp3, -1, uint8(3))
if !(pCx3 == uintptr(0)) {
- goto __530
+ goto __533
}
goto no_mem
-__530:
+__533:
;
(*VdbeCursor)(unsafe.Pointer(pCx3)).FnullRow = U8(1)
(*VdbeCursor)(unsafe.Pointer(pCx3)).FseekResult = (*Op)(unsafe.Pointer(pOp)).Fp2
@@ -64325,7 +66811,7 @@ __530:
//
// Close a cursor previously opened as P1. If P1 is not
// currently open, this instruction is a no-op.
-__87:
+__88:
;
Xsqlite3VdbeFreeCursor(tls, p, *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)))
*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)) = uintptr(0)
@@ -64417,23 +66903,23 @@ __87:
// is an equality search.
//
// See also: Found, NotFound, SeekGt, SeekGe, SeekLt
-__88: // jump, in3, group
__89: // jump, in3, group
__90: // jump, in3, group
-__91: // Only interested in == results
+__91: // jump, in3, group
+__92: // Only interested in == results
;
- pC2 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC3 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
oc = int32((*Op)(unsafe.Pointer(pOp)).Fopcode)
eqOnly = 0
- (*VdbeCursor)(unsafe.Pointer(pC2)).FnullRow = U8(0)
+ (*VdbeCursor)(unsafe.Pointer(pC3)).FnullRow = U8(0)
- (*VdbeCursor)(unsafe.Pointer(pC2)).FdeferredMoveto = U8(0)
- (*VdbeCursor)(unsafe.Pointer(pC2)).FcacheStatus = U32(0)
- if !((*VdbeCursor)(unsafe.Pointer(pC2)).FisTable != 0) {
- goto __531
+ (*VdbeCursor)(unsafe.Pointer(pC3)).FdeferredMoveto = U8(0)
+ (*VdbeCursor)(unsafe.Pointer(pC3)).FcacheStatus = U32(0)
+ if !((*VdbeCursor)(unsafe.Pointer(pC3)).FisTable != 0) {
+ goto __534
}
// The OPFLAG_SEEKEQ/BTREE_SEEK_EQ flag is only set on index cursors
@@ -64443,10 +66929,10 @@ __91: // Only interested in == results
pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
flags31 = (*Mem)(unsafe.Pointer(pIn3)).Fflags
if !((int32(flags31) & (((0x0004 | 0x0008) | 0x0020) | 0x0002)) == 0x0002) {
- goto __533
+ goto __536
}
applyNumericAffinity(tls, pIn3, 0)
-__533:
+__536:
;
iKey = Xsqlite3VdbeIntValue(tls, pIn3) // Get the integer key value
newType = (*Mem)(unsafe.Pointer(pIn3)).Fflags // Record the type after applying numeric affinity
@@ -64455,30 +66941,30 @@ __533:
// If the P3 value could not be converted into an integer without
// loss of information, then special processing is required...
if !((int32(newType) & (0x0004 | 0x0020)) == 0) {
- goto __534
+ goto __537
}
if !((int32(newType) & 0x0008) == 0) {
- goto __535
+ goto __538
}
if !(((int32(newType) & 0x0001) != 0) || (oc >= 24)) {
- goto __537
+ goto __540
}
goto jump_to_p2
- goto __538
-__537:
- rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC2 + 56 /* &.uc */)), bp+304 /* &res1 */)
+ goto __541
+__540:
+ rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), bp+296 /* &res1 */)
if !(rc != 0) {
- goto __539
+ goto __542
}
goto abort_due_to_error
-__539:
+__542:
;
goto seek_not_found
-__538:
+__541:
;
- goto __536
-__535:
+ goto __539
+__538:
// If the approximation iKey is larger than the actual real search
// term, substitute >= for > and < for <=. e.g. if the search term
@@ -64487,61 +66973,61 @@ __535:
// (x > 4.9) -> (x >= 5)
// (x <= 4.9) -> (x < 5)
if !(*(*float64)(unsafe.Pointer(pIn3 /* &.u */)) < float64(iKey)) {
- goto __540
+ goto __543
}
if !((oc & 0x0001) == (25 & 0x0001)) {
- goto __542
+ goto __545
}
oc--
-__542:
+__545:
;
- goto __541
-__540:
+ goto __544
+__543:
if !(*(*float64)(unsafe.Pointer(pIn3 /* &.u */)) > float64(iKey)) {
- goto __543
+ goto __546
}
if !((oc & 0x0001) == (22 & 0x0001)) {
- goto __544
+ goto __547
}
oc++
-__544:
+__547:
;
-__543:
+__546:
;
-__541:
+__544:
;
-__536:
+__539:
;
-__534:
+__537:
;
- rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC2 + 56 /* &.uc */)), uintptr(0), int64(U64(iKey)), 0, bp+304 /* &res1 */)
- (*VdbeCursor)(unsafe.Pointer(pC2)).FmovetoTarget = iKey // Used by OP_Delete
+ rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), uintptr(0), int64(U64(iKey)), 0, bp+296 /* &res1 */)
+ (*VdbeCursor)(unsafe.Pointer(pC3)).FmovetoTarget = iKey // Used by OP_Delete
if !(rc != 0) {
- goto __545
+ goto __548
}
goto abort_due_to_error
-__545:
+__548:
;
- goto __532
-__531:
+ goto __535
+__534:
// For a cursor with the OPFLAG_SEEKEQ/BTREE_SEEK_EQ hint, only the
// OP_SeekGE and OP_SeekLE opcodes are allowed, and these must be
// immediately followed by an OP_IdxGT or OP_IdxLT opcode, respectively,
// with the same key.
- if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC2 + 56 /* &.uc */)), uint32(0x00000002)) != 0) {
- goto __546
+ if !(Xsqlite3BtreeCursorHasHint(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), uint32(0x00000002)) != 0) {
+ goto __549
}
eqOnly = 1
-__546:
+__549:
;
nField2 = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- (*UnpackedRecord)(unsafe.Pointer(bp + 312 /* &r */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC2)).FpKeyInfo
- (*UnpackedRecord)(unsafe.Pointer(bp + 312 /* &r */)).FnField = U16(nField2)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 304 /* &r */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC3)).FpKeyInfo
+ (*UnpackedRecord)(unsafe.Pointer(bp + 304 /* &r */)).FnField = U16(nField2)
// The next line of code computes as follows, only faster:
// if( oc==OP_SeekGT || oc==OP_SeekLE ){
@@ -64549,109 +67035,109 @@ __546:
// }else{
// r.default_rc = +1;
// }
- (*UnpackedRecord)(unsafe.Pointer(bp + 312 /* &r */)).Fdefault_rc = func() int8 {
+ (*UnpackedRecord)(unsafe.Pointer(bp + 304 /* &r */)).Fdefault_rc = func() int8 {
if (1 & (oc - 22)) != 0 {
return int8(-1)
}
return +int8(1)
}()
- (*UnpackedRecord)(unsafe.Pointer(bp + 312 /* &r */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
- (*UnpackedRecord)(unsafe.Pointer(bp + 312 /* &r */)).FeqSeen = U8(0)
- rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC2 + 56 /* &.uc */)), bp+312 /* &r */, int64(0), 0, bp+304 /* &res1 */)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 304 /* &r */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 304 /* &r */)).FeqSeen = U8(0)
+ rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), bp+304 /* &r */, int64(0), 0, bp+296 /* &res1 */)
if !(rc != 0) {
- goto __547
+ goto __550
}
goto abort_due_to_error
-__547:
+__550:
;
- if !((eqOnly != 0) && (int32((*UnpackedRecord)(unsafe.Pointer(bp+312 /* &r */)).FeqSeen) == 0)) {
- goto __548
+ if !((eqOnly != 0) && (int32((*UnpackedRecord)(unsafe.Pointer(bp+304 /* &r */)).FeqSeen) == 0)) {
+ goto __551
}
goto seek_not_found
-__548:
+__551:
;
-__532:
+__535:
;
Xsqlite3_search_count++
if !(oc >= 24) {
- goto __549
+ goto __552
}
- if !((*(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) < 0) || ((*(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) == 0) && (oc == 25))) {
- goto __551
+ if !((*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) < 0) || ((*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) == 0) && (oc == 25))) {
+ goto __554
}
- *(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) = 0
- rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC2 + 56 /* &.uc */)), 0)
+ *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 0
+ rc = Xsqlite3BtreeNext(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), 0)
if !(rc != 0) {
- goto __553
+ goto __556
}
if !(rc == 101) {
- goto __554
+ goto __557
}
rc = 0
- *(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) = 1
+ *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 1
+ goto __558
+__557:
+ goto abort_due_to_error
+__558:
+ ;
+__556:
+ ;
goto __555
__554:
- goto abort_due_to_error
+ *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 0
__555:
;
-__553:
- ;
- goto __552
-__551:
- *(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) = 0
+ goto __553
__552:
;
- goto __550
-__549:
- ;
- if !((*(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) > 0) || ((*(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) == 0) && (oc == 22))) {
- goto __556
+ if !((*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) > 0) || ((*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) == 0) && (oc == 22))) {
+ goto __559
}
- *(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) = 0
- rc = Xsqlite3BtreePrevious(tls, *(*uintptr)(unsafe.Pointer(pC2 + 56 /* &.uc */)), 0)
+ *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 0
+ rc = Xsqlite3BtreePrevious(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)), 0)
if !(rc != 0) {
- goto __558
+ goto __561
}
if !(rc == 101) {
- goto __559
+ goto __562
}
rc = 0
- *(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) = 1
- goto __560
-__559:
+ *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = 1
+ goto __563
+__562:
goto abort_due_to_error
-__560:
+__563:
;
-__558:
+__561:
;
- goto __557
-__556:
+ goto __560
+__559:
// res might be negative because the table is empty. Check to
// see if this is the case.
- *(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) = Xsqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC2 + 56 /* &.uc */)))
-__557:
+ *(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) = Xsqlite3BtreeEof(tls, *(*uintptr)(unsafe.Pointer(pC3 + 56 /* &.uc */)))
+__560:
;
-__550:
+__553:
;
seek_not_found:
;
- if !(*(*int32)(unsafe.Pointer(bp + 304 /* res1 */)) != 0) {
- goto __561
+ if !(*(*int32)(unsafe.Pointer(bp + 296 /* res1 */)) != 0) {
+ goto __564
}
goto jump_to_p2
- goto __562
-__561:
+ goto __565
+__564:
if !(eqOnly != 0) {
- goto __563
+ goto __566
}
- pOp += 24
-__563:
+ pOp += 32
+__566:
;
-__562:
+__565:
;
goto __10
@@ -64663,25 +67149,25 @@ __562:
//
// P1 must be a valid b-tree cursor. P2 must be a boolean value,
// either 0 or 1.
-__92:
+__93:
;
- pC3 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- crt.SetBitFieldPtr8Uint32(pC3+8 /* &.seekHit */, (Bool((*Op)(unsafe.Pointer(pOp)).Fp2 & 1)), 3, 0x8)
+ libc.SetBitFieldPtr8Uint32(pC4+8 /* &.seekHit */, (Bool((*Op)(unsafe.Pointer(pOp)).Fp2 & 1)), 3, 0x8)
goto __10
// Opcode: IfNotOpen P1 P2 * * *
// Synopsis: if( !csr[P1] ) goto P2
//
// If cursor P1 is not open, jump to instruction P2. Otherwise, fall through.
-__93: // jump
+__94: // jump
;
if !(!(int32(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))) != 0)) {
- goto __564
+ goto __567
}
goto jump_to_p2_and_check_for_interrupt
-__564:
+__567:
;
goto __10
@@ -64767,41 +67253,41 @@ __564:
// opcodes do not work after this operation.
//
// See also: NotFound, Found, NotExists
-__94:
+__95:
;
- pC4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC5 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- if !(Bool(int32(*(*uint8)(unsafe.Pointer(pC4 + 8 /* &.seekHit */))&0x8>>3)) != 0) {
- goto __565
+ if !(Bool(int32(*(*uint8)(unsafe.Pointer(pC5 + 8 /* &.seekHit */))&0x8>>3)) != 0) {
+ goto __568
}
goto __10
-__565:
+__568:
;
-__95: // jump, in3
__96: // jump, in3
-__97:
+__97: // jump, in3
+__98:
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) != 28) {
- goto __566
+ goto __569
}
Xsqlite3_found_count++
-__566:
+__569:
;
- pC5 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC6 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
if !(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)) > 0) {
- goto __567
+ goto __570
}
- (*UnpackedRecord)(unsafe.Pointer(bp + 336 /* &r1 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC5)).FpKeyInfo
- (*UnpackedRecord)(unsafe.Pointer(bp + 336 /* &r1 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
- (*UnpackedRecord)(unsafe.Pointer(bp + 336 /* &r1 */)).FaMem = pIn3
- pIdxKey = bp + 336 /* &r1 */
+ (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC6)).FpKeyInfo
+ (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
+ (*UnpackedRecord)(unsafe.Pointer(bp + 328 /* &r1 */)).FaMem = pIn3
+ pIdxKey = bp + 328 /* &r1 */
pFree = uintptr(0)
- goto __568
-__567:
+ goto __571
+__570:
;
rc = func() int32 {
if (int32((*Mem)(unsafe.Pointer((pIn3))).Fflags) & 0x4000) != 0 {
@@ -64811,88 +67297,88 @@ __567:
}()
if !(rc != 0) {
- goto __569
+ goto __572
}
goto no_mem
-__569:
+__572:
;
- pFree = crt.AssignUintptr(&pIdxKey, Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeCursor)(unsafe.Pointer(pC5)).FpKeyInfo))
+ pFree = libc.AssignUintptr(&pIdxKey, Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeCursor)(unsafe.Pointer(pC6)).FpKeyInfo))
if !(pIdxKey == uintptr(0)) {
- goto __570
+ goto __573
}
goto no_mem
-__570:
+__573:
;
- Xsqlite3VdbeRecordUnpack(tls, (*VdbeCursor)(unsafe.Pointer(pC5)).FpKeyInfo, (*Mem)(unsafe.Pointer(pIn3)).Fn, (*Mem)(unsafe.Pointer(pIn3)).Fz, pIdxKey)
-__568:
+ Xsqlite3VdbeRecordUnpack(tls, (*VdbeCursor)(unsafe.Pointer(pC6)).FpKeyInfo, (*Mem)(unsafe.Pointer(pIn3)).Fn, (*Mem)(unsafe.Pointer(pIn3)).Fz, pIdxKey)
+__571:
;
(*UnpackedRecord)(unsafe.Pointer(pIdxKey)).Fdefault_rc = int8(0)
takeJump = 0
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == 28) {
- goto __571
+ goto __574
}
// For the OP_NoConflict opcode, take the jump if any of the
// input fields are NULL, since any key with a NULL will not
// conflict
ii1 = 0
-__572:
+__575:
if !(ii1 < int32((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField)) {
- goto __574
+ goto __577
}
if !((int32((*Mem)(unsafe.Pointer((*UnpackedRecord)(unsafe.Pointer(pIdxKey)).FaMem+uintptr(ii1)*56)).Fflags) & 0x0001) != 0) {
- goto __575
+ goto __578
}
takeJump = 1
- goto __574
-__575:
+ goto __577
+__578:
;
- goto __573
-__573:
+ goto __576
+__576:
ii1++
- goto __572
- goto __574
-__574:
+ goto __575
+ goto __577
+__577:
;
-__571:
+__574:
;
- rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC5 + 56 /* &.uc */)), pIdxKey, int64(0), 0, bp+360 /* &res3 */)
+ rc = Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC6 + 56 /* &.uc */)), pIdxKey, int64(0), 0, bp+352 /* &res3 */)
if !(pFree != 0) {
- goto __576
+ goto __579
}
Xsqlite3DbFreeNN(tls, db, pFree)
-__576:
+__579:
;
if !(rc != 0) {
- goto __577
+ goto __580
}
goto abort_due_to_error
-__577:
+__580:
;
- (*VdbeCursor)(unsafe.Pointer(pC5)).FseekResult = *(*int32)(unsafe.Pointer(bp + 360 /* res3 */))
- alreadyExists = (crt.Bool32(*(*int32)(unsafe.Pointer(bp + 360 /* res3 */)) == 0))
- (*VdbeCursor)(unsafe.Pointer(pC5)).FnullRow = (U8(1 - alreadyExists))
- (*VdbeCursor)(unsafe.Pointer(pC5)).FdeferredMoveto = U8(0)
- (*VdbeCursor)(unsafe.Pointer(pC5)).FcacheStatus = U32(0)
+ (*VdbeCursor)(unsafe.Pointer(pC6)).FseekResult = *(*int32)(unsafe.Pointer(bp + 352 /* res3 */))
+ alreadyExists = (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 352 /* res3 */)) == 0))
+ (*VdbeCursor)(unsafe.Pointer(pC6)).FnullRow = (U8(1 - alreadyExists))
+ (*VdbeCursor)(unsafe.Pointer(pC6)).FdeferredMoveto = U8(0)
+ (*VdbeCursor)(unsafe.Pointer(pC6)).FcacheStatus = U32(0)
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == 30) {
- goto __578
+ goto __581
}
if !(alreadyExists != 0) {
- goto __580
+ goto __583
}
goto jump_to_p2
-__580:
+__583:
;
- goto __579
-__578:
+ goto __582
+__581:
;
if !((takeJump != 0) || !(alreadyExists != 0)) {
- goto __581
+ goto __584
}
goto jump_to_p2
-__581:
+__584:
;
-__579:
+__582:
;
goto __10
@@ -64941,69 +67427,70 @@ __579:
// not work following this opcode.
//
// See also: Found, NotFound, NoConflict, SeekRowid
-__98:
+__99:
pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
if !((int32((*Mem)(unsafe.Pointer(pIn3)).Fflags) & (0x0004 | 0x0020)) == 0) {
- goto __582
+ goto __585
}
// If pIn3->u.i does not contain an integer, compute iKey as the
// integer value of pIn3. Jump to P2 if pIn3 cannot be converted
// into an integer without loss of information. Take care to avoid
// changing the datatype of pIn3, however, as it is used by other
// parts of the prepared statement.
- *(*Mem)(unsafe.Pointer(bp + 368 /* x */)) = *(*Mem)(unsafe.Pointer(pIn3 + uintptr(0)*56))
- applyAffinity(tls, bp+368 /* &x */, int8(0x43), encoding)
- if !((int32((*Mem)(unsafe.Pointer(bp+368 /* &x */)).Fflags) & 0x0004) == 0) {
- goto __583
+ *(*Mem)(unsafe.Pointer(bp + 360 /* x */)) = *(*Mem)(unsafe.Pointer(pIn3 + uintptr(0)*56))
+ applyAffinity(tls, bp+360 /* &x */, int8(0x43), encoding)
+ if !((int32((*Mem)(unsafe.Pointer(bp+360 /* &x */)).Fflags) & 0x0004) == 0) {
+ goto __586
}
goto jump_to_p2
-__583:
+__586:
;
- iKey1 = U64(*(*I64)(unsafe.Pointer(bp + 368 /* &x */ /* &.u */)))
+ iKey1 = U64(*(*I64)(unsafe.Pointer(bp + 360 /* &x */ /* &.u */)))
goto notExistsWithKey
-__582:
+__585:
;
// Fall through into OP_NotExists
-__99: // jump, in3
+ /* no break */
+__100: // jump, in3
pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
iKey1 = U64(*(*I64)(unsafe.Pointer(pIn3 /* &.u */)))
notExistsWithKey:
- pC6 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC7 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- pCrsr2 = *(*uintptr)(unsafe.Pointer(pC6 + 56 /* &.uc */))
+ pCrsr2 = *(*uintptr)(unsafe.Pointer(pC7 + 56 /* &.uc */))
- *(*int32)(unsafe.Pointer(bp + 424 /* res4 */)) = 0
- rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr2, uintptr(0), int64(iKey1), 0, bp+424 /* &res4 */)
+ *(*int32)(unsafe.Pointer(bp + 416 /* res4 */)) = 0
+ rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr2, uintptr(0), int64(iKey1), 0, bp+416 /* &res4 */)
- (*VdbeCursor)(unsafe.Pointer(pC6)).FmovetoTarget = I64(iKey1) // Used by OP_Delete
- (*VdbeCursor)(unsafe.Pointer(pC6)).FnullRow = U8(0)
- (*VdbeCursor)(unsafe.Pointer(pC6)).FcacheStatus = U32(0)
- (*VdbeCursor)(unsafe.Pointer(pC6)).FdeferredMoveto = U8(0)
+ (*VdbeCursor)(unsafe.Pointer(pC7)).FmovetoTarget = I64(iKey1) // Used by OP_Delete
+ (*VdbeCursor)(unsafe.Pointer(pC7)).FnullRow = U8(0)
+ (*VdbeCursor)(unsafe.Pointer(pC7)).FcacheStatus = U32(0)
+ (*VdbeCursor)(unsafe.Pointer(pC7)).FdeferredMoveto = U8(0)
- (*VdbeCursor)(unsafe.Pointer(pC6)).FseekResult = *(*int32)(unsafe.Pointer(bp + 424 /* res4 */))
- if !(*(*int32)(unsafe.Pointer(bp + 424 /* res4 */)) != 0) {
- goto __584
+ (*VdbeCursor)(unsafe.Pointer(pC7)).FseekResult = *(*int32)(unsafe.Pointer(bp + 416 /* res4 */))
+ if !(*(*int32)(unsafe.Pointer(bp + 416 /* res4 */)) != 0) {
+ goto __587
}
if !((*Op)(unsafe.Pointer(pOp)).Fp2 == 0) {
- goto __585
+ goto __588
}
- rc = Xsqlite3CorruptError(tls, 89805)
- goto __586
-__585:
+ rc = Xsqlite3CorruptError(tls, 90022)
+ goto __589
+__588:
goto jump_to_p2
-__586:
+__589:
;
-__584:
+__587:
;
if !(rc != 0) {
- goto __587
+ goto __590
}
goto abort_due_to_error
-__587:
+__590:
;
goto __10
@@ -65014,11 +67501,11 @@ __587:
// Write the sequence number into register P2.
// The sequence number on the cursor is incremented after this
// instruction.
-__100: // out2
+__101: // out2
;
pOut = out2Prerelease(tls, p, pOp)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = crt.PostIncInt64(&(*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)))).FseqCount, 1)
+ *(*I64)(unsafe.Pointer(pOut /* &.u */)) = libc.PostIncInt64(&(*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8)))).FseqCount, 1)
goto __10
// Opcode: NewRowid P1 P2 P3 * *
@@ -65035,13 +67522,13 @@ __100: // out2
// an SQLITE_FULL error is generated. The P3 register is updated with the '
// generated record number. This P3 mechanism is used to help implement the
// AUTOINCREMENT feature.
-__101: // Root frame of VDBE
+__102: // Root frame of VDBE
- *(*I64)(unsafe.Pointer(bp + 432 /* v */)) = int64(0)
- *(*int32)(unsafe.Pointer(bp + 428 /* res5 */)) = 0
+ *(*I64)(unsafe.Pointer(bp + 424 /* v */)) = int64(0)
+ *(*int32)(unsafe.Pointer(bp + 420 /* res5 */)) = 0
pOut = out2Prerelease(tls, p, pOp)
- pC7 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC8 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
// The next rowid or record number (different terms for the same
// thing) is obtained in a two-step algorithm.
@@ -65060,89 +67547,89 @@ __101: // Root frame of VDBE
// Others complain about 0x7ffffffffffffffffLL. The following macro seems
// to provide the constant while making all compilers happy.
- if !(!(int32(*(*uint8)(unsafe.Pointer(pC7 + 8 /* &.useRandomRowid */))&0x2>>1) != 0)) {
- goto __588
+ if !(!(int32(*(*uint8)(unsafe.Pointer(pC8 + 8 /* &.useRandomRowid */))&0x2>>1) != 0)) {
+ goto __591
}
- rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC7 + 56 /* &.uc */)), bp+428 /* &res5 */)
+ rc = Xsqlite3BtreeLast(tls, *(*uintptr)(unsafe.Pointer(pC8 + 56 /* &.uc */)), bp+420 /* &res5 */)
if !(rc != 0) {
- goto __589
+ goto __592
}
goto abort_due_to_error
-__589:
+__592:
;
- if !(*(*int32)(unsafe.Pointer(bp + 428 /* res5 */)) != 0) {
- goto __590
+ if !(*(*int32)(unsafe.Pointer(bp + 420 /* res5 */)) != 0) {
+ goto __593
}
- *(*I64)(unsafe.Pointer(bp + 432 /* v */)) = int64(1)
- goto __591
-__590:
+ *(*I64)(unsafe.Pointer(bp + 424 /* v */)) = int64(1)
+ goto __594
+__593:
;
- *(*I64)(unsafe.Pointer(bp + 432 /* v */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC7 + 56 /* &.uc */)))
- if !(*(*I64)(unsafe.Pointer(bp + 432 /* v */)) >= (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) {
- goto __592
+ *(*I64)(unsafe.Pointer(bp + 424 /* v */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC8 + 56 /* &.uc */)))
+ if !(*(*I64)(unsafe.Pointer(bp + 424 /* v */)) >= (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) {
+ goto __595
}
- crt.SetBitFieldPtr8Uint32(pC7+8 /* &.useRandomRowid */, Bool(1), 1, 0x2)
- goto __593
-__592:
- *(*I64)(unsafe.Pointer(bp + 432 /* v */))++
-__593:
+ libc.SetBitFieldPtr8Uint32(pC8+8 /* &.useRandomRowid */, Bool(1), 1, 0x2)
+ goto __596
+__595:
+ *(*I64)(unsafe.Pointer(bp + 424 /* v */))++
+__596:
;
-__591:
+__594:
;
-__588:
+__591:
;
if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
- goto __594
+ goto __597
}
// Assert that P3 is a valid memory cell.
if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) {
- goto __595
+ goto __598
}
pFrame1 = (*Vdbe)(unsafe.Pointer(p)).FpFrame
-__597:
+__600:
if !((*VdbeFrame)(unsafe.Pointer(pFrame1)).FpParent != 0) {
- goto __599
+ goto __602
}
- goto __598
-__598:
+ goto __601
+__601:
pFrame1 = (*VdbeFrame)(unsafe.Pointer(pFrame1)).FpParent
- goto __597
- goto __599
-__599:
+ goto __600
+ goto __602
+__602:
;
// Assert that P3 is a valid memory cell.
pMem1 = ((*VdbeFrame)(unsafe.Pointer(pFrame1)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
- goto __596
-__595:
+ goto __599
+__598:
// Assert that P3 is a valid memory cell.
;
pMem1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
-__596:
+__599:
;
Xsqlite3VdbeMemIntegerify(tls, pMem1)
// mem(P3) holds an integer
- if !((*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) == (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) || (Bool(int32(*(*uint8)(unsafe.Pointer(pC7 + 8 /* &.useRandomRowid */))&0x2>>1)) != 0)) {
- goto __600
+ if !((*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) == (int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) || (Bool(int32(*(*uint8)(unsafe.Pointer(pC8 + 8 /* &.useRandomRowid */))&0x2>>1)) != 0)) {
+ goto __603
}
rc = 13 // IMP: R-17817-00630
goto abort_due_to_error
-__600:
+__603:
;
- if !(*(*I64)(unsafe.Pointer(bp + 432 /* v */)) < (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1))) {
- goto __601
+ if !(*(*I64)(unsafe.Pointer(bp + 424 /* v */)) < (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1))) {
+ goto __604
}
- *(*I64)(unsafe.Pointer(bp + 432 /* v */)) = (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1))
-__601:
+ *(*I64)(unsafe.Pointer(bp + 424 /* v */)) = (*(*I64)(unsafe.Pointer(pMem1 /* &.u */)) + int64(1))
+__604:
;
- *(*I64)(unsafe.Pointer(pMem1 /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 432 /* v */))
-__594:
+ *(*I64)(unsafe.Pointer(pMem1 /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 424 /* v */))
+__597:
;
- if !(Bool(int32(*(*uint8)(unsafe.Pointer(pC7 + 8 /* &.useRandomRowid */))&0x2>>1)) != 0) {
- goto __602
+ if !(Bool(int32(*(*uint8)(unsafe.Pointer(pC8 + 8 /* &.useRandomRowid */))&0x2>>1)) != 0) {
+ goto __605
}
// IMPLEMENTATION-OF: R-07677-41881 If the largest ROWID is equal to the
// largest possible integer (9223372036854775807) then the database
@@ -65151,39 +67638,39 @@ __594:
// We cannot be in random rowid mode if this is
// an AUTOINCREMENT table.
cnt1 = 0
-__603:
- Xsqlite3_randomness(tls, int32(unsafe.Sizeof(I64(0))), bp+432 /* &v */)
- *(*I64)(unsafe.Pointer(bp + 432 /* v */)) &= (I64((int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) >> 1)
- *(*I64)(unsafe.Pointer(bp + 432 /* v */))++
- goto __604
-__604:
- if (((crt.AssignInt32(&rc, Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC7 + 56 /* &.uc */)), uintptr(0), int64(U64(*(*I64)(unsafe.Pointer(bp + 432 /* v */)))),
- 0, bp+428 /* &res5 */))) == 0) &&
- (*(*int32)(unsafe.Pointer(bp + 428 /* res5 */)) == 0)) &&
- (crt.PreIncInt32(&cnt1, 1) < 100) {
- goto __603
+__606:
+ Xsqlite3_randomness(tls, int32(unsafe.Sizeof(I64(0))), bp+424 /* &v */)
+ *(*I64)(unsafe.Pointer(bp + 424 /* v */)) &= (I64((int64((U64((uint64(0x7fffffff))) << 32) | uint64(0xffffffff)))) >> 1)
+ *(*I64)(unsafe.Pointer(bp + 424 /* v */))++
+ goto __607
+__607:
+ if (((libc.AssignInt32(&rc, Xsqlite3BtreeMovetoUnpacked(tls, *(*uintptr)(unsafe.Pointer(pC8 + 56 /* &.uc */)), uintptr(0), int64(U64(*(*I64)(unsafe.Pointer(bp + 424 /* v */)))),
+ 0, bp+420 /* &res5 */))) == 0) &&
+ (*(*int32)(unsafe.Pointer(bp + 420 /* res5 */)) == 0)) &&
+ (libc.PreIncInt32(&cnt1, 1) < 100) {
+ goto __606
}
- goto __605
-__605:
+ goto __608
+__608:
;
if !(rc != 0) {
- goto __606
+ goto __609
}
goto abort_due_to_error
-__606:
+__609:
;
- if !(*(*int32)(unsafe.Pointer(bp + 428 /* res5 */)) == 0) {
- goto __607
+ if !(*(*int32)(unsafe.Pointer(bp + 420 /* res5 */)) == 0) {
+ goto __610
}
rc = 13 // IMP: R-38219-53002
goto abort_due_to_error
-__607:
+__610:
;
-__602:
+__605:
;
- (*VdbeCursor)(unsafe.Pointer(pC7)).FdeferredMoveto = U8(0)
- (*VdbeCursor)(unsafe.Pointer(pC7)).FcacheStatus = U32(0)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 432 /* v */))
+ (*VdbeCursor)(unsafe.Pointer(pC8)).FdeferredMoveto = U8(0)
+ (*VdbeCursor)(unsafe.Pointer(pC8)).FcacheStatus = U32(0)
+ *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 424 /* v */))
goto __10
// Opcode: Insert P1 P2 P3 P4 P5
@@ -65222,85 +67709,111 @@ __602:
//
// This instruction only works on tables. The equivalent instruction
// for indices is OP_IdxInsert.
-__102: // Payload to be inserted
+__103: // Payload to be inserted
pData = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
- pC8 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC9 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
pKey = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
- (*BtreePayload)(unsafe.Pointer(bp + 440 /* &x1 */)).FnKey = *(*I64)(unsafe.Pointer(pKey /* &.u */))
+ (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnKey = *(*I64)(unsafe.Pointer(pKey /* &.u */))
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-6)) && ((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0)) {
- goto __608
+ if !((int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-6)) && (((*Sqlite3)(unsafe.Pointer((db))).FxPreUpdateCallback != 0) || ((*Sqlite3)(unsafe.Pointer((db))).FxUpdateCallback != 0))) {
+ goto __611
}
- zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC8)).FiDb)*32)).FzDbSName
+ zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC9)).FiDb)*32)).FzDbSName
pTab = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- goto __609
-__608:
+ goto __612
+__611:
pTab = uintptr(0)
zDb = uintptr(0)
-__609:
+__612:
+ ;
+
+ // Invoke the pre-update hook, if any
+ if !(pTab != 0) {
+ goto __613
+ }
+ if !(((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0) && !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x04) != 0)) {
+ goto __614
+ }
+ Xsqlite3VdbePreUpdateHook(tls, p, pC9, 18, zDb, pTab, (*BtreePayload)(unsafe.Pointer(bp+432 /* &x1 */)).FnKey, (*Op)(unsafe.Pointer(pOp)).Fp2)
+__614:
+ ;
+ if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback == uintptr(0)) || ((*Table)(unsafe.Pointer(pTab)).FaCol == uintptr(0))) {
+ goto __615
+ }
+ // Prevent post-update hook from running in cases when it should not
+ pTab = uintptr(0)
+__615:
+ ;
+__613:
+ ;
+ if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x40) != 0) {
+ goto __616
+ }
+ goto __10
+__616:
;
if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x01) != 0) {
- goto __610
+ goto __617
}
(*Vdbe)(unsafe.Pointer(p)).FnChange++
-__610:
+__617:
;
if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x20) != 0) {
- goto __611
+ goto __618
}
- (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = (*BtreePayload)(unsafe.Pointer(bp + 440 /* &x1 */)).FnKey
-__611:
+ (*Sqlite3)(unsafe.Pointer(db)).FlastRowid = (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnKey
+__618:
;
- (*BtreePayload)(unsafe.Pointer(bp + 440 /* &x1 */)).FpData = (*Mem)(unsafe.Pointer(pData)).Fz
- (*BtreePayload)(unsafe.Pointer(bp + 440 /* &x1 */)).FnData = (*Mem)(unsafe.Pointer(pData)).Fn
+ (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FpData = (*Mem)(unsafe.Pointer(pData)).Fz
+ (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnData = (*Mem)(unsafe.Pointer(pData)).Fn
seekResult = func() int32 {
if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x10) != 0 {
- return (*VdbeCursor)(unsafe.Pointer(pC8)).FseekResult
+ return (*VdbeCursor)(unsafe.Pointer(pC9)).FseekResult
}
return 0
}()
if !((int32((*Mem)(unsafe.Pointer(pData)).Fflags) & 0x4000) != 0) {
- goto __612
+ goto __619
}
- (*BtreePayload)(unsafe.Pointer(bp + 440 /* &x1 */)).FnZero = *(*int32)(unsafe.Pointer(pData /* &.u */))
- goto __613
-__612:
- (*BtreePayload)(unsafe.Pointer(bp + 440 /* &x1 */)).FnZero = 0
-__613:
+ (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnZero = *(*int32)(unsafe.Pointer(pData /* &.u */))
+ goto __620
+__619:
+ (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FnZero = 0
+__620:
;
- (*BtreePayload)(unsafe.Pointer(bp + 440 /* &x1 */)).FpKey = uintptr(0)
- rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC8 + 56 /* &.uc */)), bp+440, /* &x1 */
+ (*BtreePayload)(unsafe.Pointer(bp + 432 /* &x1 */)).FpKey = uintptr(0)
+ rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */)), bp+432, /* &x1 */
(int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (0x08 | 0x02)), seekResult)
- (*VdbeCursor)(unsafe.Pointer(pC8)).FdeferredMoveto = U8(0)
- (*VdbeCursor)(unsafe.Pointer(pC8)).FcacheStatus = U32(0)
+ (*VdbeCursor)(unsafe.Pointer(pC9)).FdeferredMoveto = U8(0)
+ (*VdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = U32(0)
// Invoke the update-hook if required.
if !(rc != 0) {
- goto __614
+ goto __621
}
goto abort_due_to_error
-__614:
+__621:
;
if !(pTab != 0) {
- goto __615
+ goto __622
}
- (*(*func(*crt.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 304 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg,
+ (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 304 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg,
func() int32 {
if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x04) != 0 {
return 23
}
return 18
}(),
- zDb, (*Table)(unsafe.Pointer(pTab)).FzName, (*BtreePayload)(unsafe.Pointer(bp+440 /* &x1 */)).FnKey)
-__615:
+ zDb, (*Table)(unsafe.Pointer(pTab)).FzName, (*BtreePayload)(unsafe.Pointer(bp+432 /* &x1 */)).FnKey)
+__622:
;
goto __10
@@ -65338,61 +67851,84 @@ __615:
// If the OPFLAG_ISUPDATE flag is set in P2, then P3 contains the address
// of the memory cell that contains the value that the rowid of the row will
// be set to by the update.
-__103:
+__104:
opflags = (*Op)(unsafe.Pointer(pOp)).Fp2
- pC9 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC10 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
// If the update-hook or pre-update-hook will be invoked, set zDb to
// the name of the db to pass as to it. Also set local pTab to a copy
// of p4.pTab. Finally, if p5 is true, indicating that this cursor was
// last moved with OP_Next or OP_Prev, not Seek or NotFound, set
// VdbeCursor.movetoTarget to the current rowid.
- if !((int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-6)) && ((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0)) {
- goto __616
+ if !((int32((*Op)(unsafe.Pointer(pOp)).Fp4type) == (-6)) && (((*Sqlite3)(unsafe.Pointer((db))).FxPreUpdateCallback != 0) || ((*Sqlite3)(unsafe.Pointer((db))).FxUpdateCallback != 0))) {
+ goto __623
}
- zDb1 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC9)).FiDb)*32)).FzDbSName
+ zDb1 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*VdbeCursor)(unsafe.Pointer(pC10)).FiDb)*32)).FzDbSName
pTab1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- if !(((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x02) != 0) && ((*VdbeCursor)(unsafe.Pointer(pC9)).FisTable != 0)) {
- goto __618
+ if !(((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x02) != 0) && ((*VdbeCursor)(unsafe.Pointer(pC10)).FisTable != 0)) {
+ goto __625
}
- (*VdbeCursor)(unsafe.Pointer(pC9)).FmovetoTarget = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */)))
-__618:
+ (*VdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC10 + 56 /* &.uc */)))
+__625:
;
- goto __617
-__616:
+ goto __624
+__623:
zDb1 = uintptr(0) // Not needed. Silence a compiler warning.
pTab1 = uintptr(0)
-__617:
+__624:
;
- /* Only flags that can be set are SAVEPOISTION and AUXDELETE */
+ // Invoke the pre-update-hook if required.
+ if !(((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0) && (*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) != 0)) {
+ goto __626
+ }
- rc = Xsqlite3BtreeDelete(tls, *(*uintptr)(unsafe.Pointer(pC9 + 56 /* &.uc */)), uint8((*Op)(unsafe.Pointer(pOp)).Fp5))
- (*VdbeCursor)(unsafe.Pointer(pC9)).FcacheStatus = U32(0)
- (*VdbeCursor)(unsafe.Pointer(pC9)).FseekResult = 0
+ Xsqlite3VdbePreUpdateHook(tls, p, pC10,
+ func() int32 {
+ if (opflags & 0x04) != 0 {
+ return 23
+ }
+ return 9
+ }(),
+ zDb1, pTab1, (*VdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget,
+ (*Op)(unsafe.Pointer(pOp)).Fp3)
+__626:
+ ;
+ if !((opflags & 0x40) != 0) {
+ goto __627
+ }
+ goto __10
+__627:
+ ;
+
+ // Only flags that can be set are SAVEPOISTION and AUXDELETE
+
+ rc = Xsqlite3BtreeDelete(tls, *(*uintptr)(unsafe.Pointer(pC10 + 56 /* &.uc */)), uint8((*Op)(unsafe.Pointer(pOp)).Fp5))
+ (*VdbeCursor)(unsafe.Pointer(pC10)).FcacheStatus = U32(0)
+ (*VdbeCursor)(unsafe.Pointer(pC10)).FseekResult = 0
if !(rc != 0) {
- goto __619
+ goto __628
}
goto abort_due_to_error
-__619:
+__628:
;
// Invoke the update-hook if required.
if !((opflags & 0x01) != 0) {
- goto __620
+ goto __629
}
(*Vdbe)(unsafe.Pointer(p)).FnChange++
if !(((*Sqlite3)(unsafe.Pointer(db)).FxUpdateCallback != 0) && (((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(0x0080)) == U32(0))) {
- goto __621
+ goto __630
}
- (*(*func(*crt.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 304 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, 9, zDb1, (*Table)(unsafe.Pointer(pTab1)).FzName,
- (*VdbeCursor)(unsafe.Pointer(pC9)).FmovetoTarget)
-__621:
+ (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, Sqlite_int64))(unsafe.Pointer((db + 304 /* &.xUpdateCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpUpdateArg, 9, zDb1, (*Table)(unsafe.Pointer(pTab1)).FzName,
+ (*VdbeCursor)(unsafe.Pointer(pC10)).FmovetoTarget)
+__630:
;
-__620:
+__629:
;
goto __10
@@ -65402,7 +67938,7 @@ __620:
// change counter (returned by subsequent calls to sqlite3_changes()).
// Then the VMs internal change counter resets to 0.
// This is used by trigger programs.
-__104:
+__105:
Xsqlite3VdbeSetChanges(tls, db, (*Vdbe)(unsafe.Pointer(p)).FnChange)
(*Vdbe)(unsafe.Pointer(p)).FnChange = 0
goto __10
@@ -65421,26 +67957,26 @@ __104:
//
// Fall through to next instruction if the two records compare equal to
// each other. Jump to P2 if they are different.
-__105:
+__106:
- pC10 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC11 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
nKeyCol = *(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- *(*int32)(unsafe.Pointer(bp + 488 /* res6 */)) = 0
- rc = Xsqlite3VdbeSorterCompare(tls, pC10, pIn3, nKeyCol, bp+488 /* &res6 */)
+ *(*int32)(unsafe.Pointer(bp + 480 /* res6 */)) = 0
+ rc = Xsqlite3VdbeSorterCompare(tls, pC11, pIn3, nKeyCol, bp+480 /* &res6 */)
if !(rc != 0) {
- goto __622
+ goto __631
}
goto abort_due_to_error
-__622:
+__631:
;
- if !(*(*int32)(unsafe.Pointer(bp + 488 /* res6 */)) != 0) {
- goto __623
+ if !(*(*int32)(unsafe.Pointer(bp + 480 /* res6 */)) != 0) {
+ goto __632
}
goto jump_to_p2
-__623:
+__632:
;
goto __10
@@ -65455,18 +67991,18 @@ __623:
// OpenPseudo. That pseudo-table cursor is the one that is identified by
// parameter P3. Clearing the P3 column cache as part of this opcode saves
// us from having to issue a separate NullRow instruction to clear that cache.
-__106:
+__107:
pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
- pC11 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC12 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- rc = Xsqlite3VdbeSorterRowkey(tls, pC11, pOut)
+ rc = Xsqlite3VdbeSorterRowkey(tls, pC12, pOut)
if !(rc != 0) {
- goto __624
+ goto __633
}
goto abort_due_to_error
-__624:
+__633:
;
(*VdbeCursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8)))).FcacheStatus = U32(0)
goto __10
@@ -65498,13 +68034,13 @@ __624:
// in OP_Result and any OP_Result will invalidate the P2 register content.
// The P2 register content is invalidated by opcodes like OP_Function or
// by any use of another cursor pointing to the same table.
-__107:
+__108:
pOut = out2Prerelease(tls, p, pOp)
- pC12 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC13 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- pCrsr3 = *(*uintptr)(unsafe.Pointer(pC12 + 56 /* &.uc */))
+ pCrsr3 = *(*uintptr)(unsafe.Pointer(pC13 + 56 /* &.uc */))
// The OP_RowData opcodes always follow OP_NotExists or
// OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions
@@ -65516,29 +68052,29 @@ __107:
n3 = Xsqlite3BtreePayloadSize(tls, pCrsr3)
if !(n3 > U32(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(0)*4)))) {
- goto __625
+ goto __634
}
goto too_big
-__625:
+__634:
;
rc = Xsqlite3VdbeMemFromBtreeZeroOffset(tls, pCrsr3, n3, pOut)
if !(rc != 0) {
- goto __626
+ goto __635
}
goto abort_due_to_error
-__626:
+__635:
;
if !(!((*Op)(unsafe.Pointer(pOp)).Fp3 != 0)) {
- goto __627
+ goto __636
}
if !(((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & 0x1000) != 0) && (Xsqlite3VdbeMemMakeWriteable(tls, pOut) != 0)) {
- goto __628
+ goto __637
}
goto no_mem
-__628:
+__637:
;
-__627:
+__636:
;
updateMaxBlobsize(tls, pOut)
@@ -65554,66 +68090,66 @@ __627:
// P1 can be either an ordinary table or a virtual table. There used to
// be a separate OP_VRowid opcode for use with virtual tables, but this
// one opcode now works for both table types.
-__108:
+__109:
pOut = out2Prerelease(tls, p, pOp)
- pC13 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC14 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- if !((*VdbeCursor)(unsafe.Pointer(pC13)).FnullRow != 0) {
- goto __629
+ if !((*VdbeCursor)(unsafe.Pointer(pC14)).FnullRow != 0) {
+ goto __638
}
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(0x0001)
goto __10
- goto __630
-__629:
- if !((*VdbeCursor)(unsafe.Pointer(pC13)).FdeferredMoveto != 0) {
- goto __631
+ goto __639
+__638:
+ if !((*VdbeCursor)(unsafe.Pointer(pC14)).FdeferredMoveto != 0) {
+ goto __640
}
- *(*I64)(unsafe.Pointer(bp + 496 /* v3 */)) = (*VdbeCursor)(unsafe.Pointer(pC13)).FmovetoTarget
- goto __632
-__631:
- if !(int32((*VdbeCursor)(unsafe.Pointer(pC13)).FeCurType) == 2) {
- goto __633
+ *(*I64)(unsafe.Pointer(bp + 488 /* v3 */)) = (*VdbeCursor)(unsafe.Pointer(pC14)).FmovetoTarget
+ goto __641
+__640:
+ if !(int32((*VdbeCursor)(unsafe.Pointer(pC14)).FeCurType) == 2) {
+ goto __642
}
- pVtab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pC13 + 56 /* &.uc */)))).FpVtab
+ pVtab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pC14 + 56 /* &.uc */)))).FpVtab
pModule = (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pModule + 96 /* &.xRowid */))))(tls, *(*uintptr)(unsafe.Pointer(pC13 + 56 /* &.uc */)), bp+496 /* &v3 */)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pModule + 96 /* &.xRowid */))))(tls, *(*uintptr)(unsafe.Pointer(pC14 + 56 /* &.uc */)), bp+488 /* &v3 */)
Xsqlite3VtabImportErrmsg(tls, p, pVtab)
if !(rc != 0) {
- goto __635
+ goto __644
}
goto abort_due_to_error
-__635:
+__644:
;
- goto __634
-__633:
+ goto __643
+__642:
;
- rc = Xsqlite3VdbeCursorRestore(tls, pC13)
+ rc = Xsqlite3VdbeCursorRestore(tls, pC14)
if !(rc != 0) {
- goto __636
+ goto __645
}
goto abort_due_to_error
-__636:
+__645:
;
- if !((*VdbeCursor)(unsafe.Pointer(pC13)).FnullRow != 0) {
- goto __637
+ if !((*VdbeCursor)(unsafe.Pointer(pC14)).FnullRow != 0) {
+ goto __646
}
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(0x0001)
goto __10
-__637:
+__646:
;
- *(*I64)(unsafe.Pointer(bp + 496 /* v3 */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC13 + 56 /* &.uc */)))
-__634:
+ *(*I64)(unsafe.Pointer(bp + 488 /* v3 */)) = Xsqlite3BtreeIntegerKey(tls, *(*uintptr)(unsafe.Pointer(pC14 + 56 /* &.uc */)))
+__643:
;
-__632:
+__641:
;
-__630:
+__639:
;
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 496 /* v3 */))
+ *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 488 /* v3 */))
goto __10
// Opcode: NullRow P1 * * * *
@@ -65621,18 +68157,18 @@ __630:
// Move the cursor P1 to a null row. Any OP_Column operations
// that occur while the cursor is on the null row will always
// write a NULL.
-__109:
+__110:
;
- pC14 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC15 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- (*VdbeCursor)(unsafe.Pointer(pC14)).FnullRow = U8(1)
- (*VdbeCursor)(unsafe.Pointer(pC14)).FcacheStatus = U32(0)
- if !(int32((*VdbeCursor)(unsafe.Pointer(pC14)).FeCurType) == 0) {
- goto __638
+ (*VdbeCursor)(unsafe.Pointer(pC15)).FnullRow = U8(1)
+ (*VdbeCursor)(unsafe.Pointer(pC15)).FcacheStatus = U32(0)
+ if !(int32((*VdbeCursor)(unsafe.Pointer(pC15)).FeCurType) == 0) {
+ goto __647
}
- Xsqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pC14 + 56 /* &.uc */)))
-__638:
+ Xsqlite3BtreeClearCursor(tls, *(*uintptr)(unsafe.Pointer(pC15 + 56 /* &.uc */)))
+__647:
;
goto __10
@@ -65656,48 +68192,48 @@ __638:
// This opcode leaves the cursor configured to move in reverse order,
// from the end toward the beginning. In other words, the cursor is
// configured to use Prev, not Next.
-__110:
__111:
+__112:
;
- pC15 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC16 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- pCrsr4 = *(*uintptr)(unsafe.Pointer(pC15 + 56 /* &.uc */))
- *(*int32)(unsafe.Pointer(bp + 504 /* res7 */)) = 0
+ pCrsr4 = *(*uintptr)(unsafe.Pointer(pC16 + 56 /* &.uc */))
+ *(*int32)(unsafe.Pointer(bp + 496 /* res7 */)) = 0
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == 129) {
- goto __639
+ goto __648
}
- (*VdbeCursor)(unsafe.Pointer(pC15)).FseekResult = -1
+ (*VdbeCursor)(unsafe.Pointer(pC16)).FseekResult = -1
if !(Xsqlite3BtreeCursorIsValidNN(tls, pCrsr4) != 0) {
- goto __640
+ goto __649
}
goto __10
-__640:
+__649:
;
-__639:
+__648:
;
- rc = Xsqlite3BtreeLast(tls, pCrsr4, bp+504 /* &res7 */)
- (*VdbeCursor)(unsafe.Pointer(pC15)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 504 /* res7 */)))
- (*VdbeCursor)(unsafe.Pointer(pC15)).FdeferredMoveto = U8(0)
- (*VdbeCursor)(unsafe.Pointer(pC15)).FcacheStatus = U32(0)
+ rc = Xsqlite3BtreeLast(tls, pCrsr4, bp+496 /* &res7 */)
+ (*VdbeCursor)(unsafe.Pointer(pC16)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 496 /* res7 */)))
+ (*VdbeCursor)(unsafe.Pointer(pC16)).FdeferredMoveto = U8(0)
+ (*VdbeCursor)(unsafe.Pointer(pC16)).FcacheStatus = U32(0)
if !(rc != 0) {
- goto __641
+ goto __650
}
goto abort_due_to_error
-__641:
+__650:
;
if !((*Op)(unsafe.Pointer(pOp)).Fp2 > 0) {
- goto __642
+ goto __651
}
- if !(*(*int32)(unsafe.Pointer(bp + 504 /* res7 */)) != 0) {
- goto __643
+ if !(*(*int32)(unsafe.Pointer(bp + 496 /* res7 */)) != 0) {
+ goto __652
}
goto jump_to_p2
-__643:
+__652:
;
-__642:
+__651:
;
goto __10
@@ -65705,37 +68241,37 @@ __642:
//
// Estimate the number of rows in the table P1. Jump to P2 if that
// estimate is less than approximately 2**(0.1*P3).
-__112:
+__113:
;
- pC16 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC17 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- pCrsr5 = *(*uintptr)(unsafe.Pointer(pC16 + 56 /* &.uc */))
+ pCrsr5 = *(*uintptr)(unsafe.Pointer(pC17 + 56 /* &.uc */))
- rc = Xsqlite3BtreeFirst(tls, pCrsr5, bp+508 /* &res8 */)
+ rc = Xsqlite3BtreeFirst(tls, pCrsr5, bp+500 /* &res8 */)
if !(rc != 0) {
- goto __644
+ goto __653
}
goto abort_due_to_error
-__644:
+__653:
;
- if !(*(*int32)(unsafe.Pointer(bp + 508 /* res8 */)) == 0) {
- goto __645
+ if !(*(*int32)(unsafe.Pointer(bp + 500 /* res8 */)) == 0) {
+ goto __654
}
sz = Xsqlite3BtreeRowCountEst(tls, pCrsr5)
if !((sz >= int64(0)) && (int32(Xsqlite3LogEst(tls, U64(sz))) < (*Op)(unsafe.Pointer(pOp)).Fp3)) {
- goto __646
+ goto __655
}
- *(*int32)(unsafe.Pointer(bp + 508 /* res8 */)) = 1
-__646:
+ *(*int32)(unsafe.Pointer(bp + 500 /* res8 */)) = 1
+__655:
;
-__645:
+__654:
;
- if !(*(*int32)(unsafe.Pointer(bp + 508 /* res8 */)) != 0) {
- goto __647
+ if !(*(*int32)(unsafe.Pointer(bp + 500 /* res8 */)) != 0) {
+ goto __656
}
goto jump_to_p2
-__647:
+__656:
;
goto __10
@@ -65758,8 +68294,8 @@ __647:
// rewinding so that the global variable will be incremented and
// regression tests can determine whether or not the optimizer is
// correctly optimizing out sorts.
-__113: // jump
__114: // jump
+__115: // jump
Xsqlite3_sort_count++
Xsqlite3_search_count--
*(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + uintptr(2)*4))++
@@ -65774,39 +68310,39 @@ __114: // jump
// This opcode leaves the cursor configured to move in forward order,
// from the beginning toward the end. In other words, the cursor is
// configured to use Next, not Prev.
-__115:
+__116:
;
- pC17 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC18 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- *(*int32)(unsafe.Pointer(bp + 512 /* res9 */)) = 1
- if !(int32((*VdbeCursor)(unsafe.Pointer((pC17))).FeCurType) == 1) {
- goto __648
+ *(*int32)(unsafe.Pointer(bp + 504 /* res9 */)) = 1
+ if !(int32((*VdbeCursor)(unsafe.Pointer((pC18))).FeCurType) == 1) {
+ goto __657
}
- rc = Xsqlite3VdbeSorterRewind(tls, pC17, bp+512 /* &res9 */)
- goto __649
-__648:
+ rc = Xsqlite3VdbeSorterRewind(tls, pC18, bp+504 /* &res9 */)
+ goto __658
+__657:
;
- pCrsr6 = *(*uintptr)(unsafe.Pointer(pC17 + 56 /* &.uc */))
+ pCrsr6 = *(*uintptr)(unsafe.Pointer(pC18 + 56 /* &.uc */))
- rc = Xsqlite3BtreeFirst(tls, pCrsr6, bp+512 /* &res9 */)
- (*VdbeCursor)(unsafe.Pointer(pC17)).FdeferredMoveto = U8(0)
- (*VdbeCursor)(unsafe.Pointer(pC17)).FcacheStatus = U32(0)
-__649:
+ rc = Xsqlite3BtreeFirst(tls, pCrsr6, bp+504 /* &res9 */)
+ (*VdbeCursor)(unsafe.Pointer(pC18)).FdeferredMoveto = U8(0)
+ (*VdbeCursor)(unsafe.Pointer(pC18)).FcacheStatus = U32(0)
+__658:
;
if !(rc != 0) {
- goto __650
+ goto __659
}
goto abort_due_to_error
-__650:
+__659:
;
- (*VdbeCursor)(unsafe.Pointer(pC17)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 512 /* res9 */)))
+ (*VdbeCursor)(unsafe.Pointer(pC18)).FnullRow = U8(*(*int32)(unsafe.Pointer(bp + 504 /* res9 */)))
- if !(*(*int32)(unsafe.Pointer(bp + 512 /* res9 */)) != 0) {
- goto __651
+ if !(*(*int32)(unsafe.Pointer(bp + 504 /* res9 */)) != 0) {
+ goto __660
}
goto jump_to_p2
-__651:
+__660:
;
goto __10
@@ -65867,42 +68403,42 @@ __651:
// sorter object for which the OP_SorterSort opcode has been
// invoked. This opcode advances the cursor to the next sorted
// record, or jumps to P2 if there are no more sorted records.
-__116:
+__117:
- pC18 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC19 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- rc = Xsqlite3VdbeSorterNext(tls, db, pC18)
+ rc = Xsqlite3VdbeSorterNext(tls, db, pC19)
goto next_tail
-__117: // jump
__118: // jump
+__119: // jump
;
- pC18 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC19 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
// The Next opcode is only used after SeekGT, SeekGE, Rewind, and Found.
// The Prev opcode is only used after SeekLT, SeekLE, and Last.
- rc = (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((pOp + 16 /* &.p4 */ /* &.xAdvance */))))(tls, *(*uintptr)(unsafe.Pointer(pC18 + 56 /* &.uc */)), (*Op)(unsafe.Pointer(pOp)).Fp3)
+ rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pOp + 16 /* &.p4 */ /* &.xAdvance */))))(tls, *(*uintptr)(unsafe.Pointer(pC19 + 56 /* &.uc */)), (*Op)(unsafe.Pointer(pOp)).Fp3)
next_tail:
- (*VdbeCursor)(unsafe.Pointer(pC18)).FcacheStatus = U32(0)
+ (*VdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = U32(0)
if !(rc == 0) {
- goto __652
+ goto __661
}
- (*VdbeCursor)(unsafe.Pointer(pC18)).FnullRow = U8(0)
+ (*VdbeCursor)(unsafe.Pointer(pC19)).FnullRow = U8(0)
*(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + uintptr((*Op)(unsafe.Pointer(pOp)).Fp5)*4))++
Xsqlite3_search_count++
goto jump_to_p2_and_check_for_interrupt
-__652:
+__661:
;
if !(rc != 101) {
- goto __653
+ goto __662
}
goto abort_due_to_error
-__653:
+__662:
;
rc = 0
- (*VdbeCursor)(unsafe.Pointer(pC18)).FnullRow = U8(1)
+ (*VdbeCursor)(unsafe.Pointer(pC19)).FnullRow = U8(1)
goto check_for_interrupt
// Opcode: IdxInsert P1 P2 P3 P4 P5
@@ -65932,17 +68468,17 @@ __653:
//
// This instruction only works for indices. The equivalent instruction
// for tables is OP_Insert.
-__119:
+__120:
;
- pC19 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC20 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x01) != 0) {
- goto __654
+ goto __663
}
(*Vdbe)(unsafe.Pointer(p)).FnChange++
-__654:
+__663:
;
rc = func() int32 {
@@ -65952,30 +68488,30 @@ __654:
return 0
}()
if !(rc != 0) {
- goto __655
+ goto __664
}
goto abort_due_to_error
-__655:
+__664:
;
- (*BtreePayload)(unsafe.Pointer(bp + 520 /* &x2 */)).FnKey = Sqlite3_int64((*Mem)(unsafe.Pointer(pIn2)).Fn)
- (*BtreePayload)(unsafe.Pointer(bp + 520 /* &x2 */)).FpKey = (*Mem)(unsafe.Pointer(pIn2)).Fz
- (*BtreePayload)(unsafe.Pointer(bp + 520 /* &x2 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
- (*BtreePayload)(unsafe.Pointer(bp + 520 /* &x2 */)).FnMem = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
- rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC19 + 56 /* &.uc */)), bp+520, /* &x2 */
+ (*BtreePayload)(unsafe.Pointer(bp + 512 /* &x2 */)).FnKey = Sqlite3_int64((*Mem)(unsafe.Pointer(pIn2)).Fn)
+ (*BtreePayload)(unsafe.Pointer(bp + 512 /* &x2 */)).FpKey = (*Mem)(unsafe.Pointer(pIn2)).Fz
+ (*BtreePayload)(unsafe.Pointer(bp + 512 /* &x2 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
+ (*BtreePayload)(unsafe.Pointer(bp + 512 /* &x2 */)).FnMem = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
+ rc = Xsqlite3BtreeInsert(tls, *(*uintptr)(unsafe.Pointer(pC20 + 56 /* &.uc */)), bp+512, /* &x2 */
(int32((*Op)(unsafe.Pointer(pOp)).Fp5) & (0x08 | 0x02)),
func() int32 {
if (int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x10) != 0 {
- return (*VdbeCursor)(unsafe.Pointer(pC19)).FseekResult
+ return (*VdbeCursor)(unsafe.Pointer(pC20)).FseekResult
}
return 0
}())
- (*VdbeCursor)(unsafe.Pointer(pC19)).FcacheStatus = U32(0)
+ (*VdbeCursor)(unsafe.Pointer(pC20)).FcacheStatus = U32(0)
if !(rc != 0) {
- goto __656
+ goto __665
}
goto abort_due_to_error
-__656:
+__665:
;
goto __10
@@ -65985,9 +68521,9 @@ __656:
// Register P2 holds an SQL index key made using the
// MakeRecord instructions. This opcode writes that key
// into the sorter P1. Data for the entry is nil.
-__120:
+__121:
;
- pC20 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC21 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
@@ -65998,17 +68534,17 @@ __120:
return 0
}()
if !(rc != 0) {
- goto __657
+ goto __666
}
goto abort_due_to_error
-__657:
+__666:
;
- rc = Xsqlite3VdbeSorterWrite(tls, pC20, pIn2)
+ rc = Xsqlite3VdbeSorterWrite(tls, pC21, pIn2)
if !(rc != 0) {
- goto __658
+ goto __667
}
goto abort_due_to_error
-__658:
+__667:
;
goto __10
@@ -66025,48 +68561,48 @@ __658:
// or deleted is not found. For some uses of IdxDelete
// (example: the EXCEPT operator) it does not matter that no matching
// entry is found. For those cases, P5 is zero.
-__121:
+__122:
;
- pC21 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC22 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- pCrsr7 = *(*uintptr)(unsafe.Pointer(pC21 + 56 /* &.uc */))
+ pCrsr7 = *(*uintptr)(unsafe.Pointer(pC22 + 56 /* &.uc */))
- (*UnpackedRecord)(unsafe.Pointer(bp + 568 /* &r2 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC21)).FpKeyInfo
- (*UnpackedRecord)(unsafe.Pointer(bp + 568 /* &r2 */)).FnField = U16((*Op)(unsafe.Pointer(pOp)).Fp3)
- (*UnpackedRecord)(unsafe.Pointer(bp + 568 /* &r2 */)).Fdefault_rc = int8(0)
- (*UnpackedRecord)(unsafe.Pointer(bp + 568 /* &r2 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
- rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr7, bp+568 /* &r2 */, int64(0), 0, bp+592 /* &res10 */)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 560 /* &r2 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC22)).FpKeyInfo
+ (*UnpackedRecord)(unsafe.Pointer(bp + 560 /* &r2 */)).FnField = U16((*Op)(unsafe.Pointer(pOp)).Fp3)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 560 /* &r2 */)).Fdefault_rc = int8(0)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 560 /* &r2 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
+ rc = Xsqlite3BtreeMovetoUnpacked(tls, pCrsr7, bp+560 /* &r2 */, int64(0), 0, bp+584 /* &res10 */)
if !(rc != 0) {
- goto __659
+ goto __668
}
goto abort_due_to_error
-__659:
+__668:
;
- if !(*(*int32)(unsafe.Pointer(bp + 592 /* res10 */)) == 0) {
- goto __660
+ if !(*(*int32)(unsafe.Pointer(bp + 584 /* res10 */)) == 0) {
+ goto __669
}
rc = Xsqlite3BtreeDelete(tls, pCrsr7, uint8(0x04))
if !(rc != 0) {
- goto __662
+ goto __671
}
goto abort_due_to_error
-__662:
+__671:
;
- goto __661
-__660:
+ goto __670
+__669:
if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) {
- goto __663
+ goto __672
}
rc = (11 | (int32(3) << 8))
goto abort_due_to_error
-__663:
+__672:
;
-__661:
+__670:
;
- (*VdbeCursor)(unsafe.Pointer(pC21)).FcacheStatus = U32(0)
- (*VdbeCursor)(unsafe.Pointer(pC21)).FseekResult = 0
+ (*VdbeCursor)(unsafe.Pointer(pC22)).FcacheStatus = U32(0)
+ (*VdbeCursor)(unsafe.Pointer(pC22)).FseekResult = 0
goto __10
// Opcode: DeferredSeek P1 * P3 P4 *
@@ -66095,60 +68631,60 @@ __661:
// the rowid of the table entry to which this index entry points.
//
// See also: Rowid, MakeRecord.
-__122:
-__123: // Rowid that P1 current points to
+__123:
+__124: // Rowid that P1 current points to
;
- pC22 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC23 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
// The IdxRowid and Seek opcodes are combined because of the commonality
// of sqlite3VdbeCursorRestore() and sqlite3VdbeIdxRowid().
- rc = Xsqlite3VdbeCursorRestore(tls, pC22)
+ rc = Xsqlite3VdbeCursorRestore(tls, pC23)
// sqlite3VbeCursorRestore() can only fail if the record has been deleted
// out from under the cursor. That will never happens for an IdxRowid
// or Seek opcode
if !(rc != 0) {
- goto __664
+ goto __673
}
goto abort_due_to_error
-__664:
+__673:
;
- if !(!(int32((*VdbeCursor)(unsafe.Pointer(pC22)).FnullRow) != 0)) {
- goto __665
+ if !(!(int32((*VdbeCursor)(unsafe.Pointer(pC23)).FnullRow) != 0)) {
+ goto __674
}
- *(*I64)(unsafe.Pointer(bp + 600 /* rowid */)) = int64(0) // Not needed. Only used to silence a warning.
- rc = Xsqlite3VdbeIdxRowid(tls, db, *(*uintptr)(unsafe.Pointer(pC22 + 56 /* &.uc */)), bp+600 /* &rowid */)
+ *(*I64)(unsafe.Pointer(bp + 592 /* rowid */)) = int64(0) // Not needed. Only used to silence a warning.
+ rc = Xsqlite3VdbeIdxRowid(tls, db, *(*uintptr)(unsafe.Pointer(pC23 + 56 /* &.uc */)), bp+592 /* &rowid */)
if !(rc != 0) {
- goto __667
+ goto __676
}
goto abort_due_to_error
-__667:
+__676:
;
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == 133) {
- goto __668
+ goto __677
}
pTabCur = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*8))
(*VdbeCursor)(unsafe.Pointer(pTabCur)).FnullRow = U8(0)
- (*VdbeCursor)(unsafe.Pointer(pTabCur)).FmovetoTarget = *(*I64)(unsafe.Pointer(bp + 600 /* rowid */))
+ (*VdbeCursor)(unsafe.Pointer(pTabCur)).FmovetoTarget = *(*I64)(unsafe.Pointer(bp + 592 /* rowid */))
(*VdbeCursor)(unsafe.Pointer(pTabCur)).FdeferredMoveto = U8(1)
(*VdbeCursor)(unsafe.Pointer(pTabCur)).FaAltMap = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- (*VdbeCursor)(unsafe.Pointer(pTabCur)).FpAltCursor = pC22
- goto __669
-__668:
+ (*VdbeCursor)(unsafe.Pointer(pTabCur)).FpAltCursor = pC23
+ goto __678
+__677:
pOut = out2Prerelease(tls, p, pOp)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 600 /* rowid */))
-__669:
+ *(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 592 /* rowid */))
+__678:
;
- goto __666
-__665:
+ goto __675
+__674:
;
Xsqlite3VdbeMemSetNull(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56))
-__666:
+__675:
;
goto __10
@@ -66157,21 +68693,21 @@ __666:
// If cursor P1 was previously moved via OP_DeferredSeek, complete that
// seek operation now, without further delay. If the cursor seek has
// already occurred, this instruction is a no-op.
-__124: // The P1 index cursor
+__125: // The P1 index cursor
;
- pC23 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- if !((*VdbeCursor)(unsafe.Pointer(pC23)).FdeferredMoveto != 0) {
- goto __670
+ pC24 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ if !((*VdbeCursor)(unsafe.Pointer(pC24)).FdeferredMoveto != 0) {
+ goto __679
}
- rc = Xsqlite3VdbeFinishMoveto(tls, pC23)
+ rc = Xsqlite3VdbeFinishMoveto(tls, pC24)
if !(rc != 0) {
- goto __671
+ goto __680
}
goto abort_due_to_error
-__671:
+__680:
;
-__670:
+__679:
;
goto __10
@@ -66215,53 +68751,53 @@ __670:
//
// If the P1 index entry is less than or equal to the key value then jump
// to P2. Otherwise fall through to the next instruction.
-__125: // jump
__126: // jump
__127: // jump
-__128:
+__128: // jump
+__129:
;
- pC24 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC25 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- (*UnpackedRecord)(unsafe.Pointer(bp + 608 /* &r3 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC24)).FpKeyInfo
- (*UnpackedRecord)(unsafe.Pointer(bp + 608 /* &r3 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
+ (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).FpKeyInfo = (*VdbeCursor)(unsafe.Pointer(pC25)).FpKeyInfo
+ (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).FnField = U16(*(*int32)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) < 40) {
- goto __672
+ goto __681
}
- (*UnpackedRecord)(unsafe.Pointer(bp + 608 /* &r3 */)).Fdefault_rc = int8(-1)
- goto __673
-__672:
+ (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).Fdefault_rc = int8(-1)
+ goto __682
+__681:
;
- (*UnpackedRecord)(unsafe.Pointer(bp + 608 /* &r3 */)).Fdefault_rc = int8(0)
-__673:
+ (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).Fdefault_rc = int8(0)
+__682:
;
- (*UnpackedRecord)(unsafe.Pointer(bp + 608 /* &r3 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
- *(*int32)(unsafe.Pointer(bp + 632 /* res11 */)) = 0 // Not needed. Only used to silence a warning.
- rc = Xsqlite3VdbeIdxKeyCompare(tls, db, pC24, bp+608 /* &r3 */, bp+632 /* &res11 */)
+ (*UnpackedRecord)(unsafe.Pointer(bp + 600 /* &r3 */)).FaMem = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
+ *(*int32)(unsafe.Pointer(bp + 624 /* res11 */)) = 0 // Not needed. Only used to silence a warning.
+ rc = Xsqlite3VdbeIdxKeyCompare(tls, db, pC25, bp+600 /* &r3 */, bp+624 /* &res11 */)
if !((int32((*Op)(unsafe.Pointer(pOp)).Fopcode) & 1) == (40 & 1)) {
- goto __674
+ goto __683
}
- *(*int32)(unsafe.Pointer(bp + 632 /* res11 */)) = -*(*int32)(unsafe.Pointer(bp + 632 /* res11 */))
- goto __675
-__674:
+ *(*int32)(unsafe.Pointer(bp + 624 /* res11 */)) = -*(*int32)(unsafe.Pointer(bp + 624 /* res11 */))
+ goto __684
+__683:
;
- *(*int32)(unsafe.Pointer(bp + 632 /* res11 */))++
-__675:
+ *(*int32)(unsafe.Pointer(bp + 624 /* res11 */))++
+__684:
;
if !(rc != 0) {
- goto __676
+ goto __685
}
goto abort_due_to_error
-__676:
+__685:
;
- if !(*(*int32)(unsafe.Pointer(bp + 632 /* res11 */)) > 0) {
- goto __677
+ if !(*(*int32)(unsafe.Pointer(bp + 624 /* res11 */)) > 0) {
+ goto __686
}
goto jump_to_p2
-__677:
+__686:
;
goto __10
@@ -66291,41 +68827,41 @@ __677:
// and non-autovacuum modes.
//
// See also: Clear
-__129:
+__130:
;
pOut = out2Prerelease(tls, p, pOp)
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(0x0001)
if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > ((*Sqlite3)(unsafe.Pointer(db)).FnVDestroy + 1)) {
- goto __678
+ goto __687
}
rc = 6
(*Vdbe)(unsafe.Pointer(p)).FerrorAction = U8(2)
goto abort_due_to_error
- goto __679
-__678:
+ goto __688
+__687:
iDb2 = (*Op)(unsafe.Pointer(pOp)).Fp3
- *(*int32)(unsafe.Pointer(bp + 636 /* iMoved */)) = 0 // Not needed. Only to silence a warning.
- rc = Xsqlite3BtreeDropTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb2)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp1, bp+636 /* &iMoved */)
+ *(*int32)(unsafe.Pointer(bp + 628 /* iMoved */)) = 0 // Not needed. Only to silence a warning.
+ rc = Xsqlite3BtreeDropTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb2)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp1, bp+628 /* &iMoved */)
(*Mem)(unsafe.Pointer(pOut)).Fflags = U16(0x0004)
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 636 /* iMoved */)))
+ *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 628 /* iMoved */)))
if !(rc != 0) {
- goto __680
+ goto __689
}
goto abort_due_to_error
-__680:
+__689:
;
- if !(*(*int32)(unsafe.Pointer(bp + 636 /* iMoved */)) != 0) {
- goto __681
+ if !(*(*int32)(unsafe.Pointer(bp + 628 /* iMoved */)) != 0) {
+ goto __690
}
- Xsqlite3RootPageMoved(tls, db, iDb2, *(*int32)(unsafe.Pointer(bp + 636 /* iMoved */)), (*Op)(unsafe.Pointer(pOp)).Fp1)
+ Xsqlite3RootPageMoved(tls, db, iDb2, uint32(*(*int32)(unsafe.Pointer(bp + 628 /* iMoved */))), uint32((*Op)(unsafe.Pointer(pOp)).Fp1))
// All OP_Destroy operations occur on the same btree
resetSchemaOnFault = (U8(iDb2 + 1))
-__681:
+__690:
;
-__679:
+__688:
;
goto __10
@@ -66346,35 +68882,35 @@ __679:
// also incremented by the number of rows in the table being cleared.
//
// See also: Destroy
-__130:
+__131:
;
- *(*int32)(unsafe.Pointer(bp + 640 /* nChange */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 632 /* nChange */)) = 0
rc = Xsqlite3BtreeClearTable(tls,
- (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp1, func() uintptr {
+ (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*32)).FpBt, int32(U32((*Op)(unsafe.Pointer(pOp)).Fp1)), func() uintptr {
if (*Op)(unsafe.Pointer(pOp)).Fp3 != 0 {
- return bp + 640 /* &nChange */
+ return bp + 632 /* &nChange */
}
return uintptr(0)
}())
if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
- goto __682
+ goto __691
}
- *(*int32)(unsafe.Pointer(p + 60 /* &.nChange */)) += (*(*int32)(unsafe.Pointer(bp + 640 /* nChange */)))
+ *(*int32)(unsafe.Pointer(p + 60 /* &.nChange */)) += (*(*int32)(unsafe.Pointer(bp + 632 /* nChange */)))
if !((*Op)(unsafe.Pointer(pOp)).Fp3 > 0) {
- goto __683
+ goto __692
}
- *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56 /* &.u */ /* &.i */)) += (I64(*(*int32)(unsafe.Pointer(bp + 640 /* nChange */))))
-__683:
+ *(*I64)(unsafe.Pointer(aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56 /* &.u */ /* &.i */)) += (I64(*(*int32)(unsafe.Pointer(bp + 632 /* nChange */))))
+__692:
;
-__682:
+__691:
;
if !(rc != 0) {
- goto __684
+ goto __693
}
goto abort_due_to_error
-__684:
+__693:
;
goto __10
@@ -66385,26 +68921,26 @@ __684:
//
// This opcode only works for cursors used for sorting and
// opened with OP_OpenEphemeral or OP_SorterOpen.
-__131:
+__132:
;
- pC25 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC26 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- if !(int32((*VdbeCursor)(unsafe.Pointer((pC25))).FeCurType) == 1) {
- goto __685
+ if !(int32((*VdbeCursor)(unsafe.Pointer((pC26))).FeCurType) == 1) {
+ goto __694
}
- Xsqlite3VdbeSorterReset(tls, db, *(*uintptr)(unsafe.Pointer(pC25 + 56 /* &.uc */)))
- goto __686
-__685:
+ Xsqlite3VdbeSorterReset(tls, db, *(*uintptr)(unsafe.Pointer(pC26 + 56 /* &.uc */)))
+ goto __695
+__694:
;
- rc = Xsqlite3BtreeClearTableOfCursor(tls, *(*uintptr)(unsafe.Pointer(pC25 + 56 /* &.uc */)))
+ rc = Xsqlite3BtreeClearTableOfCursor(tls, *(*uintptr)(unsafe.Pointer(pC26 + 56 /* &.uc */)))
if !(rc != 0) {
- goto __687
+ goto __696
}
goto abort_due_to_error
-__687:
+__696:
;
-__686:
+__695:
;
goto __10
@@ -66416,48 +68952,48 @@ __686:
// P1>1. The P3 argument must be 1 (BTREE_INTKEY) for a rowid table
// it must be 2 (BTREE_BLOBKEY) for an index or WITHOUT ROWID table.
// The root page number of the new b-tree is stored in register P2.
-__132:
+__133:
;
pOut = out2Prerelease(tls, p, pOp)
- *(*int32)(unsafe.Pointer(bp + 644 /* pgno */)) = 0
+ *(*Pgno)(unsafe.Pointer(bp + 636 /* pgno */)) = Pgno(0)
pDb2 = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)
- rc = Xsqlite3BtreeCreateTable(tls, (*Db)(unsafe.Pointer(pDb2)).FpBt, bp+644 /* &pgno */, (*Op)(unsafe.Pointer(pOp)).Fp3)
+ rc = Xsqlite3BtreeCreateTable(tls, (*Db)(unsafe.Pointer(pDb2)).FpBt, bp+636 /* &pgno */, (*Op)(unsafe.Pointer(pOp)).Fp3)
if !(rc != 0) {
- goto __688
+ goto __697
}
goto abort_due_to_error
-__688:
+__697:
;
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*int32)(unsafe.Pointer(bp + 644 /* pgno */)))
+ *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(*(*Pgno)(unsafe.Pointer(bp + 636 /* pgno */)))
goto __10
// Opcode: SqlExec * * * P4 *
//
// Run the SQL statement or statements specified in the P4 string.
-__133:
+__134:
;
(*Sqlite3)(unsafe.Pointer(db)).FnSqlExec++
rc = Xsqlite3_exec(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), uintptr(0), uintptr(0), uintptr(0))
(*Sqlite3)(unsafe.Pointer(db)).FnSqlExec--
if !(rc != 0) {
- goto __689
+ goto __698
}
goto abort_due_to_error
-__689:
+__698:
;
goto __10
// Opcode: ParseSchema P1 * * P4 *
//
- // Read and parse all entries from the SQLITE_MASTER table of database P1
+ // Read and parse all entries from the schema table of database P1
// that match the WHERE clause P4. If P4 is a NULL pointer, then the
// entire schema for P1 is reparsed.
//
// This opcode invokes the parser to create a new virtual machine,
// then runs the new virtual machine. It is thus a re-entrant opcode.
-__134:
+__135:
// Any prepared statement that invokes this opcode will hold mutexes
// on every btree. This is a prerequisite for invoking
@@ -66466,71 +69002,72 @@ __134:
iDb3 = (*Op)(unsafe.Pointer(pOp)).Fp1
if !(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) == uintptr(0)) {
- goto __690
+ goto __699
}
Xsqlite3SchemaClear(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FpSchema)
- *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (^U32(crt.Int32FromInt32(0x0010)))
+ *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (^U32(libc.Int32FromInt32(0x0010)))
rc = Xsqlite3InitOne(tls, db, iDb3, (p + 168 /* &.zErrMsg */), uint32(0x0001))
*(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(0x0001))
- crt.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3)
- goto __691
-__690:
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3)
+ goto __700
+__699:
- zMaster = ts + 5324 /* "sqlite_master" */
- (*InitData)(unsafe.Pointer(bp + 648 /* &initData */)).Fdb = db
- (*InitData)(unsafe.Pointer(bp + 648 /* &initData */)).FiDb = iDb3
- (*InitData)(unsafe.Pointer(bp + 648 /* &initData */)).FpzErrMsg = (p + 168 /* &.zErrMsg */)
- (*InitData)(unsafe.Pointer(bp + 648 /* &initData */)).FmInitFlags = U32(0)
+ zSchema = ts + 7522 /* "sqlite_master" */
+ (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).Fdb = db
+ (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FiDb = iDb3
+ (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FpzErrMsg = (p + 168 /* &.zErrMsg */)
+ (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FmInitFlags = U32(0)
+ (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FpBt)
zSql = Xsqlite3MPrintf(tls, db,
- ts+5338, /* "SELECT*FROM\"%w\"...." */
- crt.VaList(bp+64, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FzDbSName, zMaster, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
+ ts+7536, /* "SELECT*FROM\"%w\"...." */
+ libc.VaList(bp+64, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb3)*32)).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))))
if !(zSql == uintptr(0)) {
- goto __692
+ goto __701
}
rc = 7
- goto __693
-__692:
+ goto __702
+__701:
;
(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(1)
- (*InitData)(unsafe.Pointer(bp + 648 /* &initData */)).Frc = 0
- (*InitData)(unsafe.Pointer(bp + 648 /* &initData */)).FnInitRow = U32(0)
+ (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).Frc = 0
+ (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).FnInitRow = U32(0)
rc = Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
- }{Xsqlite3InitCallback})), bp+648 /* &initData */, uintptr(0))
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
+ }{Xsqlite3InitCallback})), bp+640 /* &initData */, uintptr(0))
if !(rc == 0) {
- goto __694
+ goto __703
}
- rc = (*InitData)(unsafe.Pointer(bp + 648 /* &initData */)).Frc
-__694:
+ rc = (*InitData)(unsafe.Pointer(bp + 640 /* &initData */)).Frc
+__703:
;
- if !((rc == 0) && ((*InitData)(unsafe.Pointer(bp+648 /* &initData */)).FnInitRow == U32(0))) {
- goto __695
+ if !((rc == 0) && ((*InitData)(unsafe.Pointer(bp+640 /* &initData */)).FnInitRow == U32(0))) {
+ goto __704
}
// The OP_ParseSchema opcode with a non-NULL P4 argument should parse
// at least one SQL statement. Any less than that indicates that
- // the sqlite_master table is corrupt.
- rc = Xsqlite3CorruptError(tls, 91260)
-__695:
+ // the sqlite_schema table is corrupt.
+ rc = Xsqlite3CorruptError(tls, 91475)
+__704:
;
Xsqlite3DbFreeNN(tls, db, zSql)
(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(0)
-__693:
+__702:
;
-__691:
+__700:
;
if !(rc != 0) {
- goto __696
+ goto __705
}
Xsqlite3ResetAllSchemasOfConnection(tls, db)
if !(rc == 7) {
- goto __697
+ goto __706
}
goto no_mem
-__697:
+__706:
;
goto abort_due_to_error
-__696:
+__705:
;
goto __10
@@ -66539,14 +69076,14 @@ __696:
// Read the sqlite_stat1 table for database P1 and load the content
// of that table into the internal index hash table. This will cause
// the analysis to be used when preparing all subsequent queries.
-__135:
+__136:
;
rc = Xsqlite3AnalysisLoad(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1)
if !(rc != 0) {
- goto __698
+ goto __707
}
goto abort_due_to_error
-__698:
+__707:
;
goto __10
@@ -66557,7 +69094,7 @@ __698:
// is dropped from disk (using the Destroy opcode) in order to keep
// the internal representation of the
// schema consistent with what is on disk.
-__136:
+__137:
;
Xsqlite3UnlinkAndDeleteTable(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
goto __10
@@ -66569,7 +69106,7 @@ __136:
// is dropped from disk (using the Destroy opcode)
// in order to keep the internal representation of the
// schema consistent with what is on disk.
-__137:
+__138:
;
Xsqlite3UnlinkAndDeleteIndex(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
goto __10
@@ -66581,7 +69118,7 @@ __137:
// is dropped from disk (using the Destroy opcode) in order to keep
// the internal representation of the
// schema consistent with what is on disk.
-__138:
+__139:
;
Xsqlite3UnlinkAndDeleteTrigger(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
goto __10
@@ -66604,7 +69141,7 @@ __138:
// file, not the main database file.
//
// This opcode is used to implement the integrity_check pragma.
-__139: // Register keeping track of errors remaining
+__140: // Register keeping track of errors remaining
;
nRoot = (*Op)(unsafe.Pointer(pOp)).Fp2
@@ -66618,21 +69155,21 @@ __139: // Register keeping track of errors remaining
(int32(*(*I64)(unsafe.Pointer(pnErr /* &.u */))) + 1), bp+680 /* &nErr */)
Xsqlite3VdbeMemSetNull(tls, pIn1)
if !(*(*int32)(unsafe.Pointer(bp + 680 /* nErr */)) == 0) {
- goto __699
+ goto __708
}
- goto __700
-__699:
+ goto __709
+__708:
if !(z == uintptr(0)) {
- goto __701
+ goto __710
}
goto no_mem
- goto __702
-__701:
+ goto __711
+__710:
*(*I64)(unsafe.Pointer(pnErr /* &.u */ /* &.i */)) -= (I64(*(*int32)(unsafe.Pointer(bp + 680 /* nErr */)) - 1))
- Xsqlite3VdbeMemSetStr(tls, pIn1, z, -1, uint8(1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})))
-__702:
+ Xsqlite3VdbeMemSetStr(tls, pIn1, z, -1, uint8(1), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+__711:
;
-__700:
+__709:
;
updateMaxBlobsize(tls, pIn1)
Xsqlite3VdbeChangeEncoding(tls, pIn1, int32(encoding))
@@ -66645,20 +69182,20 @@ __700:
// held in register P1.
//
// An assertion fails if P2 is not an integer.
-__140: // in1, in2
+__141: // in1, in2
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & 0x0010) == 0) {
- goto __703
+ goto __712
}
if !(Xsqlite3VdbeMemSetRowSet(tls, pIn1) != 0) {
- goto __704
+ goto __713
}
goto no_mem
-__704:
+__713:
;
-__703:
+__712:
;
Xsqlite3RowSetInsert(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, *(*I64)(unsafe.Pointer(pIn2 /* &.u */)))
@@ -66671,24 +69208,24 @@ __703:
// and put that value into register P3.
// Or, if RowSet object P1 is initially empty, leave P3
// unchanged and jump to instruction P2.
-__141:
+__142:
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
if !(((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & 0x0010) == 0) ||
(Xsqlite3RowSetNext(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, bp+688 /* &val */) == 0)) {
- goto __705
+ goto __714
}
// The boolean index is empty
Xsqlite3VdbeMemSetNull(tls, pIn1)
goto jump_to_p2_and_check_for_interrupt
- goto __706
-__705:
+ goto __715
+__714:
// A value was pulled from the index
;
Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56), *(*I64)(unsafe.Pointer(bp + 688 /* val */)))
-__706:
+__715:
;
goto check_for_interrupt
@@ -66714,7 +69251,7 @@ __706:
// inserted, there is no need to search to see if the same value was
// previously inserted as part of set X (only if it was previously
// inserted as part of some other set).
-__142:
+__143:
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
@@ -66723,35 +69260,35 @@ __142:
// If there is anything other than a rowset object in memory cell P1,
// delete it now and initialize P1 with an empty rowset
if !((int32((*Mem)(unsafe.Pointer(pIn1)).Fflags) & 0x0010) == 0) {
- goto __707
+ goto __716
}
if !(Xsqlite3VdbeMemSetRowSet(tls, pIn1) != 0) {
- goto __708
+ goto __717
}
goto no_mem
-__708:
+__717:
;
-__707:
+__716:
;
if !(iSet != 0) {
- goto __709
+ goto __718
}
exists = Xsqlite3RowSetTest(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, iSet, *(*I64)(unsafe.Pointer(pIn3 /* &.u */)))
if !(exists != 0) {
- goto __710
+ goto __719
}
goto jump_to_p2
-__710:
+__719:
;
-__709:
+__718:
;
if !(iSet >= 0) {
- goto __711
+ goto __720
}
Xsqlite3RowSetInsert(tls, (*Mem)(unsafe.Pointer(pIn1)).Fz, *(*I64)(unsafe.Pointer(pIn3 /* &.u */)))
-__711:
+__720:
;
goto __10
@@ -66769,7 +69306,7 @@ __711:
// P4 is a pointer to the VM containing the trigger program.
//
// If P5 is non-zero, then recursive program invocation is enabled.
-__143: // Token identifying trigger
+__144: // Token identifying trigger
pProgram = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
pRt = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
@@ -66786,37 +69323,37 @@ __143: // Token identifying trigger
// single trigger all have the same value for the SubProgram.token
// variable.
if !((*Op)(unsafe.Pointer(pOp)).Fp5 != 0) {
- goto __712
+ goto __721
}
t1 = (*SubProgram)(unsafe.Pointer(pProgram)).Ftoken
pFrame2 = (*Vdbe)(unsafe.Pointer(p)).FpFrame
-__713:
+__722:
if !((pFrame2 != 0) && ((*VdbeFrame)(unsafe.Pointer(pFrame2)).Ftoken != t1)) {
- goto __715
+ goto __724
}
- goto __714
-__714:
+ goto __723
+__723:
pFrame2 = (*VdbeFrame)(unsafe.Pointer(pFrame2)).FpParent
- goto __713
- goto __715
-__715:
+ goto __722
+ goto __724
+__724:
;
if !(pFrame2 != 0) {
- goto __716
+ goto __725
}
goto __10
-__716:
+__725:
;
-__712:
+__721:
;
if !((*Vdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(10)*4))) {
- goto __717
+ goto __726
}
rc = 1
- Xsqlite3VdbeError(tls, p, ts+5381 /* "too many levels ..." */, 0)
+ Xsqlite3VdbeError(tls, p, ts+7579 /* "too many levels ..." */, 0)
goto abort_due_to_error
-__717:
+__726:
;
// Register pRt is used to store the memory required to save the state
@@ -66824,7 +69361,7 @@ __717:
// the trigger program. If this trigger has been fired before, then pRt
// is already allocated. Otherwise, it must be initialized.
if !((int32((*Mem)(unsafe.Pointer(pRt)).Fflags) & 0x0010) == 0) {
- goto __718
+ goto __727
}
// SubProgram.nMem is set to the number of memory cells used by the
// program stored in SubProgram.aOp. As well as these, one memory
@@ -66833,32 +69370,32 @@ __717:
nMem = ((*SubProgram)(unsafe.Pointer(pProgram)).FnMem + (*SubProgram)(unsafe.Pointer(pProgram)).FnCsr)
if !((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0) {
- goto __720
+ goto __729
}
nMem++
-__720:
+__729:
;
- nByte2 = (int32((((((uint64(unsafe.Sizeof(VdbeFrame{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))) +
+ nByte2 = (int32((((((uint64(unsafe.Sizeof(VdbeFrame{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))) +
(uint64(nMem) * uint64(unsafe.Sizeof(Mem{})))) +
(uint64((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr) * uint64(unsafe.Sizeof(uintptr(0))))) +
(uint64(((*SubProgram)(unsafe.Pointer(pProgram)).FnOp + 7) / 8))))
pFrame2 = Xsqlite3DbMallocZero(tls, db, uint64(nByte2))
if !(!(pFrame2 != 0)) {
- goto __721
+ goto __730
}
goto no_mem
-__721:
+__730:
;
Xsqlite3VdbeMemRelease(tls, pRt)
(*Mem)(unsafe.Pointer(pRt)).Fflags = (U16(0x0010 | 0x0400))
(*Mem)(unsafe.Pointer(pRt)).Fz = pFrame2
(*Mem)(unsafe.Pointer(pRt)).Fn = nByte2
- (*Mem)(unsafe.Pointer(pRt)).FxDel = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3VdbeFrameMemDel}))
+ (*Mem)(unsafe.Pointer(pRt)).FxDel = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3VdbeFrameMemDel}))
(*VdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildCsr = (*SubProgram)(unsafe.Pointer(pProgram)).FnCsr
- (*VdbeFrame)(unsafe.Pointer(pFrame2)).Fpc = (int32((int64(pOp) - int64(aOp)) / 24))
+ (*VdbeFrame)(unsafe.Pointer(pFrame2)).Fpc = (int32((int64(pOp) - int64(aOp)) / 32))
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FaMem = (*Vdbe)(unsafe.Pointer(p)).FaMem
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnMem = (*Vdbe)(unsafe.Pointer(p)).FnMem
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FapCsr = (*Vdbe)(unsafe.Pointer(p)).FapCsr
@@ -66867,26 +69404,26 @@ __721:
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FnOp = (*Vdbe)(unsafe.Pointer(p)).FnOp
(*VdbeFrame)(unsafe.Pointer(pFrame2)).Ftoken = (*SubProgram)(unsafe.Pointer(pProgram)).Ftoken
- pEnd = (((pFrame2) + uintptr((((uint64(unsafe.Sizeof(VdbeFrame{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))))) + uintptr((*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem)*56)
- pMem2 = ((pFrame2) + uintptr((((uint64(unsafe.Sizeof(VdbeFrame{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7)))))
-__722:
+ pEnd = (((pFrame2) + uintptr((((uint64(unsafe.Sizeof(VdbeFrame{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))))) + uintptr((*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem)*56)
+ pMem2 = ((pFrame2) + uintptr((((uint64(unsafe.Sizeof(VdbeFrame{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7)))))
+__731:
if !(pMem2 != pEnd) {
- goto __724
+ goto __733
}
(*Mem)(unsafe.Pointer(pMem2)).Fflags = U16(0x0080)
(*Mem)(unsafe.Pointer(pMem2)).Fdb = db
- goto __723
-__723:
+ goto __732
+__732:
pMem2 += 56
- goto __722
- goto __724
-__724:
+ goto __731
+ goto __733
+__733:
;
- goto __719
-__718:
+ goto __728
+__727:
pFrame2 = (*Mem)(unsafe.Pointer(pRt)).Fz
-__719:
+__728:
;
(*Vdbe)(unsafe.Pointer(p)).FnFrame++
@@ -66899,15 +69436,15 @@ __719:
(*Vdbe)(unsafe.Pointer(p)).FpAuxData = uintptr(0)
(*Vdbe)(unsafe.Pointer(p)).FnChange = 0
(*Vdbe)(unsafe.Pointer(p)).FpFrame = pFrame2
- (*Vdbe)(unsafe.Pointer(p)).FaMem = crt.AssignUintptr(&aMem, ((pFrame2) + uintptr((((uint64(unsafe.Sizeof(VdbeFrame{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))))))
+ (*Vdbe)(unsafe.Pointer(p)).FaMem = libc.AssignUintptr(&aMem, ((pFrame2) + uintptr((((uint64(unsafe.Sizeof(VdbeFrame{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))))))
(*Vdbe)(unsafe.Pointer(p)).FnMem = (*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem
(*Vdbe)(unsafe.Pointer(p)).FnCursor = int32(U16((*VdbeFrame)(unsafe.Pointer(pFrame2)).FnChildCsr))
(*Vdbe)(unsafe.Pointer(p)).FapCsr = (aMem + uintptr((*Vdbe)(unsafe.Pointer(p)).FnMem)*56)
(*VdbeFrame)(unsafe.Pointer(pFrame2)).FaOnce = ((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*SubProgram)(unsafe.Pointer(pProgram)).FnCsr)*8)
- crt.Xmemset(tls, (*VdbeFrame)(unsafe.Pointer(pFrame2)).FaOnce, 0, (uint64(((*SubProgram)(unsafe.Pointer(pProgram)).FnOp + 7) / 8)))
- (*Vdbe)(unsafe.Pointer(p)).FaOp = crt.AssignUintptr(&aOp, (*SubProgram)(unsafe.Pointer(pProgram)).FaOp)
+ libc.Xmemset(tls, (*VdbeFrame)(unsafe.Pointer(pFrame2)).FaOnce, 0, (uint64(((*SubProgram)(unsafe.Pointer(pProgram)).FnOp + 7) / 8)))
+ (*Vdbe)(unsafe.Pointer(p)).FaOp = libc.AssignUintptr(&aOp, (*SubProgram)(unsafe.Pointer(pProgram)).FaOp)
(*Vdbe)(unsafe.Pointer(p)).FnOp = (*SubProgram)(unsafe.Pointer(pProgram)).FnOp
- pOp = (aOp + crt.UintptrFromInt32(-1)*24)
+ pOp = (aOp + libc.UintptrFromInt32(-1)*32)
goto check_for_interrupt
// Opcode: Param P1 P2 * * *
@@ -66921,10 +69458,10 @@ __719:
// The address of the cell in the parent frame is determined by adding
// the value of the P1 argument to the value of the P1 argument to the
// calling OP_Program instruction.
-__144:
+__145:
pOut = out2Prerelease(tls, p, pOp)
pFrame3 = (*Vdbe)(unsafe.Pointer(p)).FpFrame
- pIn = ((*VdbeFrame)(unsafe.Pointer(pFrame3)).FaMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1+(*Op)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame3)).FaOp+uintptr((*VdbeFrame)(unsafe.Pointer(pFrame3)).Fpc)*24)).Fp1))*56)
+ pIn = ((*VdbeFrame)(unsafe.Pointer(pFrame3)).FaMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp1+(*Op)(unsafe.Pointer((*VdbeFrame)(unsafe.Pointer(pFrame3)).FaOp+uintptr((*VdbeFrame)(unsafe.Pointer(pFrame3)).Fpc)*32)).Fp1))*56)
Xsqlite3VdbeMemShallowCopy(tls, pOut, pIn, 0x1000)
goto __10
@@ -66935,23 +69472,23 @@ __144:
// If P1 is non-zero, the database constraint counter is incremented
// (deferred foreign key constraints). Otherwise, if P1 is zero, the
// statement counter is incremented (immediate foreign key constraints).
-__145:
+__146:
if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00080000)) != 0) {
- goto __725
+ goto __734
}
- *(*I64)(unsafe.Pointer(db + 720 /* &.nDeferredImmCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2))
- goto __726
-__725:
+ *(*I64)(unsafe.Pointer(db + 744 /* &.nDeferredImmCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2))
+ goto __735
+__734:
if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
- goto __727
+ goto __736
}
- *(*I64)(unsafe.Pointer(db + 712 /* &.nDeferredCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2))
- goto __728
-__727:
+ *(*I64)(unsafe.Pointer(db + 736 /* &.nDeferredCons */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2))
+ goto __737
+__736:
*(*I64)(unsafe.Pointer(p + 80 /* &.nFkConstraint */)) += (I64((*Op)(unsafe.Pointer(pOp)).Fp2))
-__728:
+__737:
;
-__726:
+__735:
;
goto __10
@@ -66966,27 +69503,27 @@ __726:
// is zero (the one that counts deferred constraint violations). If P1 is
// zero, the jump is taken if the statement constraint-counter is zero
// (immediate foreign key constraint violations).
-__146: // jump
+__147: // jump
if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
- goto __729
+ goto __738
}
if !(((*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons == int64(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons == int64(0))) {
- goto __731
+ goto __740
}
goto jump_to_p2
-__731:
+__740:
;
- goto __730
-__729:
+ goto __739
+__738:
;
if !(((*Vdbe)(unsafe.Pointer(p)).FnFkConstraint == int64(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons == int64(0))) {
- goto __732
+ goto __741
}
goto jump_to_p2
-__732:
+__741:
;
-__730:
+__739:
;
goto __10
@@ -67000,37 +69537,37 @@ __730:
//
// This instruction throws an error if the memory cell is not initially
// an integer.
-__147:
+__148:
if !((*Vdbe)(unsafe.Pointer(p)).FpFrame != 0) {
- goto __733
+ goto __742
}
pFrame4 = (*Vdbe)(unsafe.Pointer(p)).FpFrame
-__735:
+__744:
if !((*VdbeFrame)(unsafe.Pointer(pFrame4)).FpParent != 0) {
- goto __737
+ goto __746
}
- goto __736
-__736:
+ goto __745
+__745:
pFrame4 = (*VdbeFrame)(unsafe.Pointer(pFrame4)).FpParent
- goto __735
- goto __737
-__737:
+ goto __744
+ goto __746
+__746:
;
pIn1 = ((*VdbeFrame)(unsafe.Pointer(pFrame4)).FaMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
- goto __734
-__733:
+ goto __743
+__742:
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
-__734:
+__743:
;
Xsqlite3VdbeMemIntegerify(tls, pIn1)
pIn2 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp2)*56)
Xsqlite3VdbeMemIntegerify(tls, pIn2)
if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) < *(*I64)(unsafe.Pointer(pIn2 /* &.u */))) {
- goto __738
+ goto __747
}
*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) = *(*I64)(unsafe.Pointer(pIn2 /* &.u */))
-__738:
+__747:
;
goto __10
@@ -67043,15 +69580,15 @@ __738:
//
// If the initial value of register P1 is less than 1, then the
// value is unchanged and control passes through to the next instruction.
-__148: // jump, in1
+__149: // jump, in1
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) > int64(0)) {
- goto __739
+ goto __748
}
*(*I64)(unsafe.Pointer(pIn1 /* &.u */ /* &.i */)) -= (I64((*Op)(unsafe.Pointer(pOp)).Fp3))
goto jump_to_p2
-__739:
+__748:
;
goto __10
@@ -67072,7 +69609,7 @@ __739:
// and r[P2] is set to -1.
//
// Otherwise, r[P2] is set to the sum of r[P1] and r[P3].
-__149:
+__150:
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
pIn3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
pOut = out2Prerelease(tls, p, pOp)
@@ -67084,7 +69621,7 @@ __149:
}
return int64(0)
}()) != 0)) {
- goto __740
+ goto __749
}
// If the LIMIT is less than or equal to zero, loop forever. This
// is documented. But also, if the LIMIT+OFFSET exceeds 2^63 then
@@ -67094,10 +69631,10 @@ __149:
// it would take nearly 300 years to actually reach the limit. So
// looping forever is a reasonable approximation.
*(*I64)(unsafe.Pointer(pOut /* &.u */)) = int64(-1)
- goto __741
-__740:
+ goto __750
+__749:
*(*I64)(unsafe.Pointer(pOut /* &.u */)) = *(*I64)(unsafe.Pointer(bp + 696 /* x3 */))
-__741:
+__750:
;
goto __10
@@ -67108,20 +69645,20 @@ __741:
// initially greater than zero, then decrement the value in register P1.
// If it is non-zero (negative or positive) and then also jump to P2.
// If register P1 is initially zero, leave it unchanged and fall through.
-__150: // jump, in1
+__151: // jump, in1
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) != 0) {
- goto __742
+ goto __751
}
if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) > int64(0)) {
- goto __743
+ goto __752
}
*(*I64)(unsafe.Pointer(pIn1 /* &.u */))--
-__743:
+__752:
;
goto jump_to_p2
-__742:
+__751:
;
goto __10
@@ -67130,21 +69667,21 @@ __742:
//
// Register P1 must hold an integer. Decrement the value in P1
// and jump to P2 if the new value is exactly zero.
-__151: // jump, in1
+__152: // jump, in1
pIn1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) > ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))) {
- goto __744
+ goto __753
}
*(*I64)(unsafe.Pointer(pIn1 /* &.u */))--
-__744:
+__753:
;
if !(*(*I64)(unsafe.Pointer(pIn1 /* &.u */)) == int64(0)) {
- goto __745
+ goto __754
}
goto jump_to_p2
-__745:
+__754:
;
goto __10
@@ -67184,23 +69721,23 @@ __745:
// the opcode is changed. In this way, the initialization of the
// sqlite3_context only happens once, instead of on each call to the
// step function.
-__152:
__153:
+__154:
;
n4 = int32((*Op)(unsafe.Pointer(pOp)).Fp5)
pCtx = Xsqlite3DbMallocRawNN(tls, db, (uint64((uint64(n4) * uint64(unsafe.Sizeof(uintptr(0)))) + ((uint64(unsafe.Sizeof(Sqlite3_context{})) + uint64(unsafe.Sizeof(Mem{}))) - uint64(unsafe.Sizeof(uintptr(0)))))))
if !(pCtx == uintptr(0)) {
- goto __746
+ goto __755
}
goto no_mem
-__746:
+__755:
;
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpMem = uintptr(0)
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut = ((pCtx + 48 /* &.argv */) + uintptr(n4)*8)
Xsqlite3VdbeMemInit(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, uint16(0x0001))
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp = (int32((int64(pOp) - int64(aOp)) / 24))
+ (*Sqlite3_context)(unsafe.Pointer(pCtx)).FiOp = (int32((int64(pOp) - int64(aOp)) / 32))
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = p
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FskipFlag = U8(0)
(*Sqlite3_context)(unsafe.Pointer(pCtx)).FisError = 0
@@ -67211,7 +69748,7 @@ __746:
// OP_AggInverse must have P1==1 and OP_AggStep must have P1==0
(*Op)(unsafe.Pointer(pOp)).Fopcode = U8(155)
-__154:
+__155:
;
pCtx1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
pMem3 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
@@ -67221,71 +69758,71 @@ __154:
// checks to see if the register array has changed, and if so it
// reinitializes the relavant parts of the sqlite3_context object
if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpMem != pMem3) {
- goto __747
+ goto __756
}
(*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpMem = pMem3
i4 = (int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc) - 1)
-__748:
+__757:
if !(i4 >= 0) {
- goto __750
+ goto __759
}
*(*uintptr)(unsafe.Pointer((pCtx1 + 48 /* &.argv */) + uintptr(i4)*8)) = (aMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2+i4))*56)
- goto __749
-__749:
+ goto __758
+__758:
i4--
- goto __748
- goto __750
-__750:
+ goto __757
+ goto __759
+__759:
;
-__747:
+__756:
;
(*Mem)(unsafe.Pointer(pMem3)).Fn++
if !((*Op)(unsafe.Pointer(pOp)).Fp1 != 0) {
- goto __751
+ goto __760
}
- (*(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc + 48 /* &.xInverse */))))(tls, pCtx1, int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48 /* &.argv */)
- goto __752
-__751:
- (*(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc + 24 /* &.xSFunc */))))(tls, pCtx1, int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48 /* &.argv */)
-__752:
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc + 48 /* &.xInverse */))))(tls, pCtx1, int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48 /* &.argv */)
+ goto __761
+__760:
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc + 24 /* &.xSFunc */))))(tls, pCtx1, int32((*Sqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48 /* &.argv */)
+__761:
; // IMP: R-24505-23230
if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0) {
- goto __753
+ goto __762
}
if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0) {
- goto __754
+ goto __763
}
- Xsqlite3VdbeError(tls, p, ts+696 /* "%s" */, crt.VaList(bp+88, Xsqlite3_value_text(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)))
+ Xsqlite3VdbeError(tls, p, ts+805 /* "%s" */, libc.VaList(bp+88, Xsqlite3_value_text(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)))
rc = (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError
-__754:
+__763:
;
if !((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0) {
- goto __755
+ goto __764
}
- i4 = (*Op)(unsafe.Pointer(pOp + crt.UintptrFromInt32(-1)*24)).Fp1
+ i4 = (*Op)(unsafe.Pointer(pOp + libc.UintptrFromInt32(-1)*32)).Fp1
if !(i4 != 0) {
- goto __756
+ goto __765
}
Xsqlite3VdbeMemSetInt64(tls, (aMem + uintptr(i4)*56), int64(1))
-__756:
+__765:
;
(*Sqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag = U8(0)
-__755:
+__764:
;
Xsqlite3VdbeMemRelease(tls, (*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)
(*Mem)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(pCtx1)).FpOut)).Fflags = U16(0x0001)
(*Sqlite3_context)(unsafe.Pointer(pCtx1)).FisError = 0
if !(rc != 0) {
- goto __757
+ goto __766
}
goto abort_due_to_error
-__757:
+__766:
;
-__753:
+__762:
;
goto __10
@@ -67314,39 +69851,39 @@ __753:
// functions that can take varying numbers of arguments. The
// P4 argument is only needed for the case where
// the step function was not previously called.
-__155:
__156:
+__157:
;
pMem4 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*56)
if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
- goto __758
+ goto __767
}
rc = Xsqlite3VdbeMemAggValue(tls, pMem4, (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56), *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
pMem4 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
- goto __759
-__758:
+ goto __768
+__767:
rc = Xsqlite3VdbeMemFinalize(tls, pMem4, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
-__759:
+__768:
;
if !(rc != 0) {
- goto __760
+ goto __769
}
- Xsqlite3VdbeError(tls, p, ts+696 /* "%s" */, crt.VaList(bp+96, Xsqlite3_value_text(tls, pMem4)))
+ Xsqlite3VdbeError(tls, p, ts+805 /* "%s" */, libc.VaList(bp+96, Xsqlite3_value_text(tls, pMem4)))
goto abort_due_to_error
-__760:
+__769:
;
Xsqlite3VdbeChangeEncoding(tls, pMem4, int32(encoding))
updateMaxBlobsize(tls, pMem4)
if !(Xsqlite3VdbeMemTooBig(tls, pMem4) != 0) {
- goto __761
+ goto __770
}
goto too_big
-__761:
+__770:
;
goto __10
@@ -67360,40 +69897,40 @@ __761:
// in the WAL that have been checkpointed after the checkpoint
// completes into mem[P3+2]. However on an error, mem[P3+1] and
// mem[P3+2] are initialized to -1.
-__157: // Write results here
+__158: // Write results here
;
*(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */ + uintptr(0)*4)) = 0
- *(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */ + uintptr(1)*4)) = crt.AssignPtrInt32(bp+704 /* &aRes */ +uintptr(2)*4, -1)
+ *(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */ + uintptr(1)*4)) = libc.AssignPtrInt32(bp+704 /* &aRes */ +uintptr(2)*4, -1)
rc = Xsqlite3Checkpoint(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, (*Op)(unsafe.Pointer(pOp)).Fp2, (bp + 704 /* &aRes */ + uintptr(1)*4), (bp + 704 /* &aRes */ + uintptr(2)*4))
if !(rc != 0) {
- goto __762
+ goto __771
}
if !(rc != 5) {
- goto __763
+ goto __772
}
goto abort_due_to_error
-__763:
+__772:
;
rc = 0
*(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */ + uintptr(0)*4)) = 1
-__762:
+__771:
;
i5 = 0
pMem5 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
-__764:
+__773:
if !(i5 < 3) {
- goto __766
+ goto __775
}
Xsqlite3VdbeMemSetInt64(tls, pMem5, I64(*(*int32)(unsafe.Pointer(bp + 704 /* &aRes[0] */ + uintptr(i5)*4))))
- goto __765
-__765:
+ goto __774
+__774:
i5++
pMem5 += 56
- goto __764
- goto __766
-__766:
+ goto __773
+ goto __775
+__775:
;
goto __10
@@ -67407,7 +69944,7 @@ __766:
// If changing into or out of WAL mode the procedure is more complicated.
//
// Write a string containing the final journal-mode to register P2.
-__158: // Name of database file for pPager
+__159: // Name of database file for pPager
pOut = out2Prerelease(tls, p, pOp)
eNew = (*Op)(unsafe.Pointer(pOp)).Fp3
@@ -67416,16 +69953,16 @@ __158: // Name of database file for pPager
pPager = Xsqlite3BtreePager(tls, pBt1)
eOld = Xsqlite3PagerGetJournalMode(tls, pPager)
if !(eNew == (-1)) {
- goto __767
+ goto __776
}
eNew = eOld
-__767:
+__776:
;
if !(!(Xsqlite3PagerOkToChangeJournalMode(tls, pPager) != 0)) {
- goto __768
+ goto __777
}
eNew = eOld
-__768:
+__777:
;
zFilename = Xsqlite3PagerFilename(tls, pPager, 1)
@@ -67435,34 +69972,34 @@ __768:
if !((eNew == 5) &&
((Xsqlite3Strlen30(tls, zFilename) == 0) || // Temp file
!(Xsqlite3PagerWalSupported(tls, pPager) != 0))) {
- goto __769
+ goto __778
}
eNew = eOld
-__769:
+__778:
;
if !((eNew != eOld) &&
((eOld == 5) || (eNew == 5))) {
- goto __770
+ goto __779
}
if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FnVdbeRead > 1)) {
- goto __771
+ goto __780
}
rc = 1
Xsqlite3VdbeError(tls, p,
- ts+5418, /* "cannot change %s..." */
- crt.VaList(bp+104, func() uintptr {
+ ts+7616, /* "cannot change %s..." */
+ libc.VaList(bp+104, func() uintptr {
if eNew == 5 {
- return ts + 5470 /* "into" */
+ return ts + 7668 /* "into" */
}
- return ts + 5475 /* "out of" */
+ return ts + 7673 /* "out of" */
}()))
goto abort_due_to_error
- goto __772
-__771:
+ goto __781
+__780:
if !(eOld == 5) {
- goto __773
+ goto __782
}
// If leaving WAL mode, close the log file. If successful, the call
// to PagerCloseWal() checkpoints and deletes the write-ahead-log
@@ -67470,29 +70007,29 @@ __771:
// after a successful return.
rc = Xsqlite3PagerCloseWal(tls, pPager, db)
if !(rc == 0) {
- goto __775
+ goto __784
}
Xsqlite3PagerSetJournalMode(tls, pPager, eNew)
-__775:
+__784:
;
- goto __774
-__773:
+ goto __783
+__782:
if !(eOld == 4) {
- goto __776
+ goto __785
}
// Cannot transition directly from MEMORY to WAL. Use mode OFF
// as an intermediate
Xsqlite3PagerSetJournalMode(tls, pPager, 2)
-__776:
+__785:
;
-__774:
+__783:
;
// Open a transaction on the database file. Regardless of the journal
// mode, this transaction always uses a rollback journal.
if !(rc == 0) {
- goto __777
+ goto __786
}
rc = Xsqlite3BtreeSetVersion(tls, pBt1, func() int32 {
if eNew == 5 {
@@ -67500,18 +70037,18 @@ __774:
}
return 1
}())
-__777:
+__786:
;
-__772:
+__781:
;
-__770:
+__779:
;
if !(rc != 0) {
- goto __778
+ goto __787
}
eNew = eOld
-__778:
+__787:
;
eNew = Xsqlite3PagerSetJournalMode(tls, pPager, eNew)
@@ -67521,10 +70058,10 @@ __778:
(*Mem)(unsafe.Pointer(pOut)).Fenc = U8(1)
Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding))
if !(rc != 0) {
- goto __779
+ goto __788
}
goto abort_due_to_error
-__779:
+__788:
;
goto __10
@@ -67536,7 +70073,7 @@ __779:
// If P2 is not zero, then it is a register holding a string which is
// the file into which the result of vacuum should be written. When
// P2 is zero, the vacuum overwrites the original database.
-__159:
+__160:
;
rc = Xsqlite3RunVacuum(tls, (p + 168 /* &.zErrMsg */), db, (*Op)(unsafe.Pointer(pOp)).Fp1,
func() uintptr {
@@ -67546,10 +70083,10 @@ __159:
return uintptr(0)
}())
if !(rc != 0) {
- goto __780
+ goto __789
}
goto abort_due_to_error
-__780:
+__789:
;
goto __10
@@ -67558,24 +70095,24 @@ __780:
// Perform a single step of the incremental vacuum procedure on
// the P1 database. If the vacuum has finished, jump to instruction
// P2. Otherwise, fall through to the next instruction.
-__160:
+__161:
;
pBt2 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt
rc = Xsqlite3BtreeIncrVacuum(tls, pBt2)
if !(rc != 0) {
- goto __781
+ goto __790
}
if !(rc != 101) {
- goto __782
+ goto __791
}
goto abort_due_to_error
-__782:
+__791:
;
rc = 0
goto jump_to_p2
-__781:
+__790:
;
goto __10
@@ -67594,16 +70131,16 @@ __781:
// The P2==1 case occurs when a CREATE INDEX or similar schema change happens
// that might help the statement run faster but which does not affect the
// correctness of operation.
-__161:
+__162:
;
if !(!((*Op)(unsafe.Pointer(pOp)).Fp1 != 0)) {
- goto __783
+ goto __792
}
Xsqlite3ExpirePreparedStatements(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp2)
- goto __784
-__783:
- crt.SetBitFieldPtr16Uint32(p+200 /* &.expired */, (Bft((*Op)(unsafe.Pointer(pOp)).Fp2 + 1)), 0, 0x3)
-__784:
+ goto __793
+__792:
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, (Bft((*Op)(unsafe.Pointer(pOp)).Fp2 + 1)), 0, 0x3)
+__793:
;
goto __10
@@ -67611,22 +70148,22 @@ __784:
//
// Lock the btree to which cursor P1 is pointing so that the btree cannot be
// written by an other cursor.
-__162:
+__163:
;
- pC26 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC27 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- Xsqlite3BtreeCursorPin(tls, *(*uintptr)(unsafe.Pointer(pC26 + 56 /* &.uc */)))
+ Xsqlite3BtreeCursorPin(tls, *(*uintptr)(unsafe.Pointer(pC27 + 56 /* &.uc */)))
goto __10
// Opcode: CursorUnlock P1 * * * *
//
// Unlock the btree to which cursor P1 is pointing so that it can be
// written by other cursors.
-__163:
+__164:
;
- pC27 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
+ pC28 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
- Xsqlite3BtreeCursorUnpin(tls, *(*uintptr)(unsafe.Pointer(pC27 + 56 /* &.uc */)))
+ Xsqlite3BtreeCursorUnpin(tls, *(*uintptr)(unsafe.Pointer(pC28 + 56 /* &.uc */)))
goto __10
// Opcode: TableLock P1 P2 P3 P4 *
@@ -67643,28 +70180,28 @@ __163:
//
// P4 contains a pointer to the name of the table being locked. This is only
// used to generate an error message if the lock cannot be obtained.
-__164:
+__165:
isWriteLock = U8((*Op)(unsafe.Pointer(pOp)).Fp3)
if !((isWriteLock != 0) || (uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00000400)))) {
- goto __785
+ goto __794
}
p13 = (*Op)(unsafe.Pointer(pOp)).Fp1
rc = Xsqlite3BtreeLockTable(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(p13)*32)).FpBt, (*Op)(unsafe.Pointer(pOp)).Fp2, isWriteLock)
if !(rc != 0) {
- goto __786
+ goto __795
}
if !((rc & 0xFF) == 6) {
- goto __787
+ goto __796
}
z1 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- Xsqlite3VdbeError(tls, p, ts+5482 /* "database table i..." */, crt.VaList(bp+112, z1))
-__787:
+ Xsqlite3VdbeError(tls, p, ts+7680 /* "database table i..." */, libc.VaList(bp+112, z1))
+__796:
;
goto abort_due_to_error
-__786:
+__795:
;
-__785:
+__794:
;
goto __10
@@ -67676,20 +70213,20 @@ __785:
// Also, whether or not P4 is set, check that this is not being called from
// within a callback to a virtual table xSync() method. If it is, the error
// code will be set to SQLITE_LOCKED.
-__165:
+__166:
pVTab = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
rc = Xsqlite3VtabBegin(tls, db, pVTab)
if !(pVTab != 0) {
- goto __788
+ goto __797
}
Xsqlite3VtabImportErrmsg(tls, p, (*VTable)(unsafe.Pointer(pVTab)).FpVtab)
-__788:
+__797:
;
if !(rc != 0) {
- goto __789
+ goto __798
}
goto abort_due_to_error
-__789:
+__798:
;
goto __10
@@ -67697,9 +70234,9 @@ __789:
//
// P2 is a register that holds the name of a virtual table in database
// P1. Call the xCreate method for that table.
-__166: // Name of the virtual table
+__167: // Name of the virtual table
- crt.Xmemset(tls, bp+720 /* &sMem1 */, 0, uint64(unsafe.Sizeof(Mem{})))
+ libc.Xmemset(tls, bp+720 /* &sMem1 */, 0, uint64(unsafe.Sizeof(Mem{})))
(*Mem)(unsafe.Pointer(bp + 720 /* &sMem1 */)).Fdb = db
// Because P2 is always a static string, it is impossible for the
// sqlite3VdbeMemCopy() to fail
@@ -67709,17 +70246,17 @@ __166: // Name of the virtual table
zTab = Xsqlite3_value_text(tls, bp+720 /* &sMem1 */)
if !(zTab != 0) {
- goto __790
+ goto __799
}
rc = Xsqlite3VtabCallCreate(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, zTab, (p + 168 /* &.zErrMsg */))
-__790:
+__799:
;
Xsqlite3VdbeMemRelease(tls, bp+720 /* &sMem1 */)
if !(rc != 0) {
- goto __791
+ goto __800
}
goto abort_due_to_error
-__791:
+__800:
;
goto __10
@@ -67727,16 +70264,16 @@ __791:
//
// P4 is the name of a virtual table in database P1. Call the xDestroy method
// of that table.
-__167:
+__168:
(*Sqlite3)(unsafe.Pointer(db)).FnVDestroy++
rc = Xsqlite3VtabCallDestroy(tls, db, (*Op)(unsafe.Pointer(pOp)).Fp1, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))
(*Sqlite3)(unsafe.Pointer(db)).FnVDestroy--
if !(rc != 0) {
- goto __792
+ goto __801
}
goto abort_due_to_error
-__792:
+__801:
;
goto __10
@@ -67745,26 +70282,26 @@ __792:
// P4 is a pointer to a virtual table object, an sqlite3_vtab structure.
// P1 is a cursor number. This opcode opens a cursor to the virtual
// table and stores that cursor in P1.
-__168:
+__169:
;
pCur1 = uintptr(0)
*(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */)) = uintptr(0)
pVtab1 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab
if !((pVtab1 == uintptr(0)) || ((*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FpModule == uintptr(0))) {
- goto __793
+ goto __802
}
rc = 6
goto abort_due_to_error
-__793:
+__802:
;
pModule1 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FpModule
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pModule1 + 48 /* &.xOpen */))))(tls, pVtab1, bp+776 /* &pVCur */)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pModule1 + 48 /* &.xOpen */))))(tls, pVtab1, bp+776 /* &pVCur */)
Xsqlite3VtabImportErrmsg(tls, p, pVtab1)
if !(rc != 0) {
- goto __794
+ goto __803
}
goto abort_due_to_error
-__794:
+__803:
;
// Initialize sqlite3_vtab_cursor base class
@@ -67773,16 +70310,16 @@ __794:
// Initialize vdbe cursor object
pCur1 = allocateCursor(tls, p, (*Op)(unsafe.Pointer(pOp)).Fp1, 0, -1, uint8(2))
if !(pCur1 != 0) {
- goto __795
+ goto __804
}
*(*uintptr)(unsafe.Pointer(pCur1 + 56 /* &.uc */)) = *(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */))
(*Sqlite3_vtab)(unsafe.Pointer(pVtab1)).FnRef++
- goto __796
-__795:
+ goto __805
+__804:
;
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((pModule1 + 56 /* &.xClose */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */)))
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule1 + 56 /* &.xClose */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 776 /* pVCur */)))
goto no_mem
-__796:
+__805:
;
goto __10
@@ -67804,7 +70341,7 @@ __796:
// xFilter as argv. Register P3+2 becomes argv[0] when passed to xFilter.
//
// A jump is made to P2 if the result set after filtering would be empty.
-__169:
+__170:
pQuery = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
pArgc = (pQuery + uintptr(1)*56)
@@ -67823,34 +70360,34 @@ __169:
res12 = 0
apArg = (*Vdbe)(unsafe.Pointer(p)).FapArg
i6 = 0
-__797:
+__806:
if !(i6 < nArg) {
- goto __799
+ goto __808
}
*(*uintptr)(unsafe.Pointer(apArg + uintptr(i6)*8)) = (pArgc + uintptr((i6+1))*56)
- goto __798
-__798:
+ goto __807
+__807:
i6++
- goto __797
- goto __799
-__799:
+ goto __806
+ goto __808
+__808:
;
- rc = (*(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer((pModule2 + 64 /* &.xFilter */))))(tls, pVCur1, iQuery, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), nArg, apArg)
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer((pModule2 + 64 /* &.xFilter */))))(tls, pVCur1, iQuery, *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)), nArg, apArg)
Xsqlite3VtabImportErrmsg(tls, p, pVtab2)
if !(rc != 0) {
- goto __800
+ goto __809
}
goto abort_due_to_error
-__800:
+__809:
;
- res12 = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((pModule2 + 80 /* &.xEof */))))(tls, pVCur1)
+ res12 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule2 + 80 /* &.xEof */))))(tls, pVCur1)
(*VdbeCursor)(unsafe.Pointer(pCur2)).FnullRow = U8(0)
if !(res12 != 0) {
- goto __801
+ goto __810
}
goto jump_to_p2
-__801:
+__810:
;
goto __10
@@ -67867,60 +70404,60 @@ __801:
// table implementation. The P5 column might also contain other
// bits (OPFLAG_LENGTHARG or OPFLAG_TYPEOFARG) but those bits are
// unused by OP_VColumn.
-__170:
+__171:
pCur3 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
pDest1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
if !((*VdbeCursor)(unsafe.Pointer(pCur3)).FnullRow != 0) {
- goto __802
+ goto __811
}
Xsqlite3VdbeMemSetNull(tls, pDest1)
goto __10
-__802:
+__811:
;
pVtab3 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur3 + 56 /* &.uc */)))).FpVtab
pModule3 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab3)).FpModule
- crt.Xmemset(tls, bp+784 /* &sContext */, 0, uint64(unsafe.Sizeof(Sqlite3_context{})))
+ libc.Xmemset(tls, bp+784 /* &sContext */, 0, uint64(unsafe.Sizeof(Sqlite3_context{})))
(*Sqlite3_context)(unsafe.Pointer(bp + 784 /* &sContext */)).FpOut = pDest1
if !((int32((*Op)(unsafe.Pointer(pOp)).Fp5) & 0x01) != 0) {
- goto __803
+ goto __812
}
Xsqlite3VdbeMemSetNull(tls, pDest1)
(*Mem)(unsafe.Pointer(pDest1)).Fflags = (U16(0x0001 | 0x4000))
*(*int32)(unsafe.Pointer(pDest1 /* &.u */)) = 0
- goto __804
-__803:
- (*Mem)(unsafe.Pointer(pDest1)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pDest1))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0001))
-__804:
+ goto __813
+__812:
+ (*Mem)(unsafe.Pointer(pDest1)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pDest1))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0001))
+__813:
;
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pModule3 + 88 /* &.xColumn */))))(tls, *(*uintptr)(unsafe.Pointer(pCur3 + 56 /* &.uc */)), bp+784 /* &sContext */, (*Op)(unsafe.Pointer(pOp)).Fp2)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pModule3 + 88 /* &.xColumn */))))(tls, *(*uintptr)(unsafe.Pointer(pCur3 + 56 /* &.uc */)), bp+784 /* &sContext */, (*Op)(unsafe.Pointer(pOp)).Fp2)
Xsqlite3VtabImportErrmsg(tls, p, pVtab3)
if !((*Sqlite3_context)(unsafe.Pointer(bp+784 /* &sContext */)).FisError > 0) {
- goto __805
+ goto __814
}
- Xsqlite3VdbeError(tls, p, ts+696 /* "%s" */, crt.VaList(bp+120, Xsqlite3_value_text(tls, pDest1)))
+ Xsqlite3VdbeError(tls, p, ts+805 /* "%s" */, libc.VaList(bp+120, Xsqlite3_value_text(tls, pDest1)))
rc = (*Sqlite3_context)(unsafe.Pointer(bp + 784 /* &sContext */)).FisError
-__805:
+__814:
;
Xsqlite3VdbeChangeEncoding(tls, pDest1, int32(encoding))
updateMaxBlobsize(tls, pDest1)
if !(Xsqlite3VdbeMemTooBig(tls, pDest1) != 0) {
- goto __806
+ goto __815
}
goto too_big
-__806:
+__815:
;
if !(rc != 0) {
- goto __807
+ goto __816
}
goto abort_due_to_error
-__807:
+__816:
;
goto __10
@@ -67929,16 +70466,16 @@ __807:
// Advance virtual table P1 to the next row in its result set and
// jump to instruction P2. Or, if the virtual table has reached
// the end of its result set, then fall through to the next instruction.
-__171:
+__172:
res13 = 0
pCur4 = *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*8))
if !((*VdbeCursor)(unsafe.Pointer(pCur4)).FnullRow != 0) {
- goto __808
+ goto __817
}
goto __10
-__808:
+__817:
;
pVtab4 = (*Sqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */)))).FpVtab
pModule4 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule
@@ -67948,22 +70485,22 @@ __808:
// xNext(). Instead, if an error occurs, true is returned (indicating that
// data is available) and the error code returned when xColumn or
// some other method is next invoked on the save virtual table cursor.
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((pModule4 + 72 /* &.xNext */))))(tls, *(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */)))
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule4 + 72 /* &.xNext */))))(tls, *(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */)))
Xsqlite3VtabImportErrmsg(tls, p, pVtab4)
if !(rc != 0) {
- goto __809
+ goto __818
}
goto abort_due_to_error
-__809:
+__818:
;
- res13 = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((pModule4 + 80 /* &.xEof */))))(tls, *(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */)))
+ res13 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule4 + 80 /* &.xEof */))))(tls, *(*uintptr)(unsafe.Pointer(pCur4 + 56 /* &.uc */)))
if !(!(res13 != 0)) {
- goto __810
+ goto __819
}
// If there is data, jump to P2
goto jump_to_p2_and_check_for_interrupt
-__810:
+__819:
;
goto check_for_interrupt
@@ -67972,7 +70509,7 @@ __810:
// P4 is a pointer to a virtual table object, an sqlite3_vtab structure.
// This opcode invokes the corresponding xRename method. The value
// in register P1 is passed as the zName argument to the xRename method.
-__172:
+__173:
isLegacy = (int32((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x04000000)))
*(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(0x04000000))
@@ -67981,25 +70518,25 @@ __172:
rc = Xsqlite3VdbeChangeEncoding(tls, pName, 1)
if !(rc != 0) {
- goto __811
+ goto __820
}
goto abort_due_to_error
-__811:
+__820:
;
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vtab)(unsafe.Pointer(pVtab5)).FpModule + 152 /* &.xRename */))))(tls, pVtab5, (*Mem)(unsafe.Pointer(pName)).Fz)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vtab)(unsafe.Pointer(pVtab5)).FpModule + 152 /* &.xRename */))))(tls, pVtab5, (*Mem)(unsafe.Pointer(pName)).Fz)
if !(isLegacy == 0) {
- goto __812
+ goto __821
}
- *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(crt.Uint64FromUint64(uint64(0x04000000))))
-__812:
+ *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(libc.Uint64FromUint64(uint64(0x04000000))))
+__821:
;
Xsqlite3VtabImportErrmsg(tls, p, pVtab5)
- crt.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(p+200 /* &.expired */, Bft(0), 0, 0x3)
if !(rc != 0) {
- goto __813
+ goto __822
}
goto abort_due_to_error
-__813:
+__822:
;
goto __10
@@ -68029,95 +70566,95 @@ __813:
//
// P5 is the error actions (OE_Replace, OE_Fail, OE_Ignore, etc) to
// apply in the case of a constraint failure on an insert or update.
-__173:
+__174:
;
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __814
+ goto __823
}
goto no_mem
-__814:
+__823:
;
pVtab6 = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FpVtab
if !((pVtab6 == uintptr(0)) || ((*Sqlite3_vtab)(unsafe.Pointer(pVtab6)).FpModule == uintptr(0))) {
- goto __815
+ goto __824
}
rc = 6
goto abort_due_to_error
-__815:
+__824:
;
pModule5 = (*Sqlite3_vtab)(unsafe.Pointer(pVtab6)).FpModule
nArg1 = (*Op)(unsafe.Pointer(pOp)).Fp2
if !((*Sqlite3_module)(unsafe.Pointer(pModule5)).FxUpdate != 0) {
- goto __816
+ goto __825
}
vtabOnConflict = (*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict
apArg1 = (*Vdbe)(unsafe.Pointer(p)).FapArg
pX1 = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
i7 = 0
-__817:
+__826:
if !(i7 < nArg1) {
- goto __819
+ goto __828
}
*(*uintptr)(unsafe.Pointer(apArg1 + uintptr(i7)*8)) = pX1
pX1 += 56
- goto __818
-__818:
+ goto __827
+__827:
i7++
- goto __817
- goto __819
-__819:
+ goto __826
+ goto __828
+__828:
;
(*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict = U8((*Op)(unsafe.Pointer(pOp)).Fp5)
- rc = (*(*func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pModule5 + 104 /* &.xUpdate */))))(tls, pVtab6, nArg1, apArg1, bp+840 /* &rowid1 */)
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pModule5 + 104 /* &.xUpdate */))))(tls, pVtab6, nArg1, apArg1, bp+840 /* &rowid1 */)
(*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict
Xsqlite3VtabImportErrmsg(tls, p, pVtab6)
if !((rc == 0) && ((*Op)(unsafe.Pointer(pOp)).Fp1 != 0)) {
- goto __820
+ goto __829
}
(*Sqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Sqlite_int64)(unsafe.Pointer(bp + 840 /* rowid1 */))
-__820:
+__829:
;
if !(((rc & 0xff) == 19) && ((*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)))).FbConstraint != 0)) {
- goto __821
+ goto __830
}
if !(int32((*Op)(unsafe.Pointer(pOp)).Fp5) == 4) {
- goto __823
+ goto __832
}
rc = 0
- goto __824
-__823:
+ goto __833
+__832:
(*Vdbe)(unsafe.Pointer(p)).FerrorAction = func() uint8 {
if int32((*Op)(unsafe.Pointer(pOp)).Fp5) == 5 {
return uint8(2)
}
return uint8((*Op)(unsafe.Pointer(pOp)).Fp5)
}()
-__824:
+__833:
;
- goto __822
-__821:
+ goto __831
+__830:
(*Vdbe)(unsafe.Pointer(p)).FnChange++
-__822:
+__831:
;
if !(rc != 0) {
- goto __825
+ goto __834
}
goto abort_due_to_error
-__825:
+__834:
;
-__816:
+__825:
;
goto __10
// Opcode: Pagecount P1 P2 * * *
//
// Write the current number of pages in database P1 to memory cell P2.
-__174: // out2
+__175: // out2
pOut = out2Prerelease(tls, p, pOp)
*(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt))
goto __10
@@ -68129,24 +70666,24 @@ __174: // out2
// do not change the maximum page count value if P3==0.
//
// Store the maximum page count after the change in register P2.
-__175:
+__176:
pOut = out2Prerelease(tls, p, pOp)
pBt3 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Op)(unsafe.Pointer(pOp)).Fp1)*32)).FpBt
newMax = uint32(0)
if !((*Op)(unsafe.Pointer(pOp)).Fp3 != 0) {
- goto __826
+ goto __835
}
newMax = Xsqlite3BtreeLastPage(tls, pBt3)
if !(newMax < uint32((*Op)(unsafe.Pointer(pOp)).Fp3)) {
- goto __827
+ goto __836
}
newMax = uint32((*Op)(unsafe.Pointer(pOp)).Fp3)
-__827:
+__836:
;
-__826:
+__835:
;
- *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(Xsqlite3BtreeMaxPageCount(tls, pBt3, int32(newMax)))
+ *(*I64)(unsafe.Pointer(pOut /* &.u */)) = I64(Xsqlite3BtreeMaxPageCount(tls, pBt3, newMax))
goto __10
// Opcode: Function P1 P2 P3 P4 *
@@ -68193,8 +70730,8 @@ __826:
// if they were, they throw an error.
//
// See also: AggStep, AggFinal, Function
-__176: // group
-__177:
+__177: // group
+__178:
;
pCtx2 = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
@@ -68204,64 +70741,64 @@ __177:
// reinitializes the relavant parts of the sqlite3_context object
pOut = (aMem + uintptr((*Op)(unsafe.Pointer(pOp)).Fp3)*56)
if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpOut != pOut) {
- goto __828
+ goto __837
}
(*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpVdbe = p
(*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpOut = pOut
i8 = (int32((*Sqlite3_context)(unsafe.Pointer(pCtx2)).Fargc) - 1)
-__829:
+__838:
if !(i8 >= 0) {
- goto __831
+ goto __840
}
*(*uintptr)(unsafe.Pointer((pCtx2 + 48 /* &.argv */) + uintptr(i8)*8)) = (aMem + uintptr(((*Op)(unsafe.Pointer(pOp)).Fp2+i8))*56)
- goto __830
-__830:
+ goto __839
+__839:
i8--
- goto __829
- goto __831
-__831:
+ goto __838
+ goto __840
+__840:
;
-__828:
+__837:
;
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0001))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0001))
- (*(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpFunc + 24 /* &.xSFunc */))))(tls, pCtx2, int32((*Sqlite3_context)(unsafe.Pointer(pCtx2)).Fargc), pCtx2+48 /* &.argv */) // IMP: R-24505-23230
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FpFunc + 24 /* &.xSFunc */))))(tls, pCtx2, int32((*Sqlite3_context)(unsafe.Pointer(pCtx2)).Fargc), pCtx2+48 /* &.argv */) // IMP: R-24505-23230
// If the function returned an error, throw an exception
if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0) {
- goto __832
+ goto __841
}
if !((*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0) {
- goto __833
+ goto __842
}
- Xsqlite3VdbeError(tls, p, ts+696 /* "%s" */, crt.VaList(bp+128, Xsqlite3_value_text(tls, pOut)))
+ Xsqlite3VdbeError(tls, p, ts+805 /* "%s" */, libc.VaList(bp+128, Xsqlite3_value_text(tls, pOut)))
rc = (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError
-__833:
+__842:
;
Xsqlite3VdbeDeleteAuxData(tls, db, (p + 288 /* &.pAuxData */), (*Sqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*Op)(unsafe.Pointer(pOp)).Fp1)
(*Sqlite3_context)(unsafe.Pointer(pCtx2)).FisError = 0
if !(rc != 0) {
- goto __834
+ goto __843
}
goto abort_due_to_error
-__834:
+__843:
;
-__832:
+__841:
;
// Copy the result of the function into register P3
if !((int32((*Mem)(unsafe.Pointer(pOut)).Fflags) & (0x0002 | 0x0010)) != 0) {
- goto __835
+ goto __844
}
Xsqlite3VdbeChangeEncoding(tls, pOut, int32(encoding))
if !(Xsqlite3VdbeMemTooBig(tls, pOut) != 0) {
- goto __836
+ goto __845
}
goto too_big
-__836:
+__845:
;
-__835:
+__844:
;
updateMaxBlobsize(tls, pOut)
@@ -68290,8 +70827,8 @@ __835:
//
// If P3 is not zero, then it is an address to jump to if an SQLITE_CORRUPT
// error is encountered.
-__178:
__179:
+__180:
// If the P4 argument is not NULL, then it must be an SQL comment string.
// The "--" string is broken up to prevent false-positives with srcck1.c.
@@ -68307,68 +70844,67 @@ __179:
if !((((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & (0x01 | 0x40)) != 0) &&
!(int32((*Vdbe)(unsafe.Pointer(p)).FdoingRerun) != 0)) &&
- ((crt.AssignUintptr(&zTrace, func() uintptr {
+ ((libc.AssignUintptr(&zTrace, func() uintptr {
if *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) != 0 {
return *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
}
return (*Vdbe)(unsafe.Pointer(p)).FzSql
}())) != uintptr(0))) {
- goto __837
+ goto __846
}
if !((int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & 0x40) != 0) {
- goto __838
+ goto __847
}
- x4 = (*Sqlite3)(unsafe.Pointer(db)).FxTrace
z2 = Xsqlite3VdbeExpandSql(tls, p, zTrace)
- (*(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(&x4)))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, z2)
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((db + 232 /* &.trace */ /* &.xLegacy */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, z2)
Xsqlite3_free(tls, z2)
- goto __839
-__838:
+ goto __848
+__847:
if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec > 1) {
- goto __840
+ goto __849
}
- z3 = Xsqlite3MPrintf(tls, db, ts+5511 /* "-- %s" */, crt.VaList(bp+136, zTrace))
- (*(*func(*crt.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.xTrace */))))(tls, uint32(0x01), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3)
+ z3 = Xsqlite3MPrintf(tls, db, ts+7709 /* "-- %s" */, libc.VaList(bp+136, zTrace))
+ (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(0x01), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3)
Xsqlite3DbFree(tls, db, z3)
- goto __841
-__840:
- (*(*func(*crt.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.xTrace */))))(tls, uint32(0x01), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace)
-__841:
+ goto __850
+__849:
+ (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(0x01), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, p, zTrace)
+__850:
;
-__839:
+__848:
;
-__837:
+__846:
;
if !((*Op)(unsafe.Pointer(pOp)).Fp1 >= Xsqlite3Config.FiOnceResetThreshold) {
- goto __842
+ goto __851
}
if !(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == 170) {
- goto __843
+ goto __852
}
goto __10
-__843:
+__852:
;
i9 = 1
-__844:
+__853:
if !(i9 < (*Vdbe)(unsafe.Pointer(p)).FnOp) {
- goto __846
+ goto __855
}
- if !(int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(i9)*24)).Fopcode) == 17) {
- goto __847
+ if !(int32((*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp+uintptr(i9)*32)).Fopcode) == 17) {
+ goto __856
}
- (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(i9)*24)).Fp1 = 0
-__847:
+ (*Op)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(p)).FaOp + uintptr(i9)*32)).Fp1 = 0
+__856:
;
- goto __845
-__845:
+ goto __854
+__854:
i9++
- goto __844
- goto __846
-__846:
+ goto __853
+ goto __855
+__855:
;
(*Op)(unsafe.Pointer(pOp)).Fp1 = 0
-__842:
+__851:
;
(*Op)(unsafe.Pointer(pOp)).Fp1++
*(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + uintptr(6)*4))++
@@ -68382,7 +70918,7 @@ __842:
// is to say when the EXPLAIN QUERY PLAN syntax is used.)
// This opcode records information from the optimizer. It is the
// the same as a no-op. This opcodesnever appears in a real VM program.
-__180: // This is really OP_Noop, OP_Explain
+__181: // This is really OP_Noop, OP_Explain
;
goto __10
@@ -68390,7 +70926,7 @@ __10:
;
goto __6
__6:
- pOp += 24
+ pOp += 32
goto __5
goto __7
__7:
@@ -68400,57 +70936,57 @@ __7:
// an error of some kind.
abort_due_to_error:
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __848
+ goto __857
}
rc = 7
-__848:
+__857:
;
if !(((*Vdbe)(unsafe.Pointer(p)).FzErrMsg == uintptr(0)) && (rc != (10 | (int32(12) << 8)))) {
- goto __849
+ goto __858
}
- Xsqlite3VdbeError(tls, p, ts+696 /* "%s" */, crt.VaList(bp+144, Xsqlite3ErrStr(tls, rc)))
-__849:
+ Xsqlite3VdbeError(tls, p, ts+805 /* "%s" */, libc.VaList(bp+144, Xsqlite3ErrStr(tls, rc)))
+__858:
;
(*Vdbe)(unsafe.Pointer(p)).Frc = rc
Xsqlite3SystemError(tls, db, rc)
- Xsqlite3_log(tls, rc, ts+5517, /* "statement aborts..." */
- crt.VaList(bp+152, (int32((int64(pOp)-int64(aOp))/24)), (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
+ Xsqlite3_log(tls, rc, ts+7715, /* "statement aborts..." */
+ libc.VaList(bp+152, (int32((int64(pOp)-int64(aOp))/32)), (*Vdbe)(unsafe.Pointer(p)).FzSql, (*Vdbe)(unsafe.Pointer(p)).FzErrMsg))
Xsqlite3VdbeHalt(tls, p)
if !(rc == (10 | (int32(12) << 8))) {
- goto __850
+ goto __859
}
Xsqlite3OomFault(tls, db)
-__850:
+__859:
;
rc = 1
if !(int32(resetSchemaOnFault) > 0) {
- goto __851
+ goto __860
}
Xsqlite3ResetOneSchema(tls, db, (int32(resetSchemaOnFault) - 1))
-__851:
+__860:
;
// This is the only way out of this procedure. We have to
// release the mutexes on btrees that were acquired at the
// top.
vdbe_return:
-__852:
+__861:
if !((nVmStep >= nProgressLimit) && ((*Sqlite3)(unsafe.Pointer(db)).FxProgress != uintptr(0))) {
- goto __853
+ goto __862
}
- nProgressLimit = nProgressLimit + ((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps)
- if !((*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((db + 480 /* &.xProgress */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) {
- goto __854
+ nProgressLimit = nProgressLimit + (U64((*Sqlite3)(unsafe.Pointer(db)).FnProgressOps))
+ if !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((db + 504 /* &.xProgress */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpProgressArg) != 0) {
+ goto __863
}
- nProgressLimit = 0xffffffff
+ nProgressLimit = (uint64(0xffffffff) | (U64((uint64(0xffffffff))) << 32))
rc = 9
goto abort_due_to_error
-__854:
+__863:
;
- goto __852
-__853:
+ goto __861
+__862:
;
*(*U32)(unsafe.Pointer((p + 212 /* &.aCounter */) + uintptr(4)*4)) += (U32(int32(nVmStep)))
Xsqlite3VdbeLeave(tls, p)
@@ -68460,14 +70996,14 @@ __853:
// Jump to here if a string or blob larger than SQLITE_MAX_LENGTH
// is encountered.
too_big:
- Xsqlite3VdbeError(tls, p, ts+4833 /* "string or blob t..." */, 0)
+ Xsqlite3VdbeError(tls, p, ts+7031 /* "string or blob t..." */, 0)
rc = 18
goto abort_due_to_error
// Jump to here if a malloc() fails.
no_mem:
Xsqlite3OomFault(tls, db)
- Xsqlite3VdbeError(tls, p, ts+5549 /* "out of memory" */, 0)
+ Xsqlite3VdbeError(tls, p, ts+7747 /* "out of memory" */, 0)
rc = 7
goto abort_due_to_error
@@ -68475,26 +71011,20 @@ no_mem:
// flag.
abort_due_to_interrupt:
;
- if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
- rc = 7
- } else {
- rc = 9
- }
- (*Vdbe)(unsafe.Pointer(p)).Frc = rc
- Xsqlite3VdbeError(tls, p, ts+696 /* "%s" */, crt.VaList(bp+176, Xsqlite3ErrStr(tls, rc)))
+ rc = 9
goto abort_due_to_error
return int32(0)
}
-var azType = [4]uintptr{ts + 5563 /* "NOT NULL" */, ts + 5572 /* "UNIQUE" */, ts + 5579, /* "CHECK" */
- ts + 5585 /* "FOREIGN KEY" */} /* sqlite3.c:86234:25 */
-var aLTb = [6]uint8{uint8(1), uint8(0), uint8(0), uint8(1), uint8(1), uint8(0)} /* sqlite3.c:87258:32 */
-var aEQb = [6]uint8{uint8(0), uint8(1), uint8(0), uint8(1), uint8(0), uint8(1)} /* sqlite3.c:87261:32 */
-var aGTb = [6]uint8{uint8(1), uint8(0), uint8(1), uint8(0), uint8(0), uint8(1)} /* sqlite3.c:87264:32 */
-var and_logic = [9]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(0), uint8(2), uint8(2)} /* sqlite3.c:87484:32 */
-var or_logic = [9]uint8{uint8(0), uint8(1), uint8(2), uint8(1), uint8(1), uint8(1), uint8(2), uint8(1), uint8(2)} /* sqlite3.c:87487:32 */
-var aFlag1 = [2]U16{U16(0x0010), (U16(0x0002 | 0x0200))} /* sqlite3.c:87937:24 */
-var vfsFlags int32 = ((((0x00000002 | 0x00000004) | 0x00000010) | 0x00000008) | 0x00000400) /* sqlite3.c:89048:20 */
+var azType = [4]uintptr{ts + 7761 /* "NOT NULL" */, ts + 7770 /* "UNIQUE" */, ts + 7777, /* "CHECK" */
+ ts + 7783 /* "FOREIGN KEY" */} /* sqlite3.c:86430:25 */
+var aLTb = [6]uint8{uint8(1), uint8(0), uint8(0), uint8(1), uint8(1), uint8(0)} /* sqlite3.c:87455:32 */
+var aEQb = [6]uint8{uint8(0), uint8(1), uint8(0), uint8(1), uint8(0), uint8(1)} /* sqlite3.c:87458:32 */
+var aGTb = [6]uint8{uint8(1), uint8(0), uint8(1), uint8(0), uint8(0), uint8(1)} /* sqlite3.c:87461:32 */
+var and_logic = [9]uint8{uint8(0), uint8(0), uint8(0), uint8(0), uint8(1), uint8(2), uint8(0), uint8(2), uint8(2)} /* sqlite3.c:87681:32 */
+var or_logic = [9]uint8{uint8(0), uint8(1), uint8(2), uint8(1), uint8(1), uint8(1), uint8(2), uint8(1), uint8(2)} /* sqlite3.c:87684:32 */
+var aFlag1 = [2]U16{U16(0x0010), (U16(0x0002 | 0x0200))} /* sqlite3.c:88134:24 */
+var vfsFlags int32 = ((((0x00000002 | 0x00000004) | 0x00000010) | 0x00000008) | 0x00000400) /* sqlite3.c:89263:20 */
//************* End of vdbe.c ***********************************************
//************* Begin file vdbeblob.c ***************************************
@@ -68545,7 +71075,7 @@ type Incrblob1 = struct {
// #include "vdbeInt.h"
// Valid sqlite3_blob* handles point to Incrblob structures.
-type Incrblob = Incrblob1 /* sqlite3.c:93184:25 */
+type Incrblob = Incrblob1 /* sqlite3.c:93397:25 */
// This function is used by both blob_open() and blob_reopen(). It seeks
// the b-tree cursor associated with blob handle p to point to row iRow.
@@ -68562,7 +71092,7 @@ type Incrblob = Incrblob1 /* sqlite3.c:93184:25 */
// If an error does occur, then the b-tree cursor is closed. All subsequent
// calls to sqlite3_blob_read(), blob_write() or blob_reopen() will
// immediately return SQLITE_ABORT.
-func blobSeekToRow(tls *crt.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) int32 { /* sqlite3.c:93214:12: */
+func blobSeekToRow(tls *libc.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) int32 { /* sqlite3.c:93427:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -68596,16 +71126,16 @@ func blobSeekToRow(tls *crt.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) i
}
if type1 < U32(12) {
- zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+5597, /* "cannot open valu..." */
- crt.VaList(bp, func() uintptr {
+ zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+7795, /* "cannot open valu..." */
+ libc.VaList(bp, func() uintptr {
if type1 == U32(0) {
- return ts + 5626 /* "null" */
+ return ts + 7824 /* "null" */
}
return func() uintptr {
if type1 == U32(7) {
- return ts + 5631 /* "real" */
+ return ts + 7829 /* "real" */
}
- return ts + 5636 /* "integer" */
+ return ts + 7834 /* "integer" */
}()
}()))
rc = 1
@@ -68625,10 +71155,10 @@ func blobSeekToRow(tls *crt.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) i
rc = Xsqlite3_finalize(tls, (*Incrblob)(unsafe.Pointer(p)).FpStmt)
(*Incrblob)(unsafe.Pointer(p)).FpStmt = uintptr(0)
if rc == 0 {
- zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+5644 /* "no such rowid: %..." */, crt.VaList(bp+8, iRow))
+ zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+7842 /* "no such rowid: %..." */, libc.VaList(bp+8, iRow))
rc = 1
} else {
- zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+696 /* "%s" */, crt.VaList(bp+16, Xsqlite3_errmsg(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb)))
+ zErr = Xsqlite3MPrintf(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb, ts+805 /* "%s" */, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*Incrblob)(unsafe.Pointer(p)).Fdb)))
}
}
@@ -68637,7 +71167,7 @@ func blobSeekToRow(tls *crt.TLS, p uintptr, iRow Sqlite3_int64, pzErr uintptr) i
}
// Open a blob handle.
-func Xsqlite3_blob_open(tls *crt.TLS, db uintptr, zDb uintptr, zTable uintptr, zColumn uintptr, iRow Sqlite_int64, wrFlag int32, ppBlob uintptr) int32 { /* sqlite3.c:93279:16: */
+func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, zColumn uintptr, iRow Sqlite_int64, wrFlag int32, ppBlob uintptr) int32 { /* sqlite3.c:93492:16: */
bp := tls.Alloc(480)
defer tls.Free(480)
@@ -68668,13 +71198,13 @@ func Xsqlite3_blob_open(tls *crt.TLS, db uintptr, zDb uintptr, zTable uintptr, z
pBlob = uintptr(0)
*(*uintptr)(unsafe.Pointer(ppBlob)) = uintptr(0)
- wrFlag = crt.BoolInt32(!(!(wrFlag != 0))) // wrFlag = (wrFlag ? 1 : 0);
+ wrFlag = libc.BoolInt32(!(!(wrFlag != 0))) // wrFlag = (wrFlag ? 1 : 0);
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
pBlob = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Incrblob{})))
__1:
- crt.Xmemset(tls, bp+48 /* &sParse */, 0, uint64(unsafe.Sizeof(Parse{})))
+ libc.Xmemset(tls, bp+48 /* &sParse */, 0, uint64(unsafe.Sizeof(Parse{})))
if !(!(pBlob != 0)) {
goto __4
}
@@ -68691,21 +71221,21 @@ __4:
goto __5
}
pTab = uintptr(0)
- Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5664 /* "cannot open virt..." */, crt.VaList(bp, zTable))
+ Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+7862 /* "cannot open virt..." */, libc.VaList(bp, zTable))
__5:
;
if !((pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0))) {
goto __6
}
pTab = uintptr(0)
- Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5694 /* "cannot open tabl..." */, crt.VaList(bp+8, zTable))
+ Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+7892 /* "cannot open tabl..." */, libc.VaList(bp+8, zTable))
__6:
;
if !((pTab != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) {
goto __7
}
pTab = uintptr(0)
- Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+5730 /* "cannot open view..." */, crt.VaList(bp+16, zTable))
+ Xsqlite3ErrorMsg(tls, bp+48 /* &sParse */, ts+7928 /* "cannot open view..." */, libc.VaList(bp+16, zTable))
__7:
;
if !(!(pTab != 0)) {
@@ -68750,7 +71280,7 @@ __12:
goto __14
}
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)))
- *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+5751 /* "no such column: ..." */, crt.VaList(bp+24, zColumn))
+ *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+7949 /* "no such column: ..." */, libc.VaList(bp+24, zColumn))
rc = 1
Xsqlite3BtreeLeaveAll(tls, db)
goto blob_open_out
@@ -68779,7 +71309,7 @@ __20:
if !((*sColMap)(unsafe.Pointer((pFKey+64 /* &.aCol */)+uintptr(j)*16)).FiFrom == iCol) {
goto __23
}
- zFault = ts + 5772 /* "foreign key" */
+ zFault = ts + 7970 /* "foreign key" */
__23:
;
goto __21
@@ -68812,7 +71342,7 @@ __27:
if !((int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == iCol) || (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == (-2))) {
goto __30
}
- zFault = ts + 5784 /* "indexed" */
+ zFault = ts + 7982 /* "indexed" */
__30:
;
goto __28
@@ -68833,7 +71363,7 @@ __26:
goto __31
}
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)))
- *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+5792 /* "cannot open %s c..." */, crt.VaList(bp+32, zFault))
+ *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) = Xsqlite3MPrintf(tls, db, ts+7990 /* "cannot open %s c..." */, libc.VaList(bp+32, zFault))
rc = 1
Xsqlite3BtreeLeaveAll(tls, db)
goto blob_open_out
@@ -68865,9 +71395,9 @@ __15:
}
// Configure the OP_TableLock instruction
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*24)).Fp1 = iDb
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*24)).Fp2 = (*Table)(unsafe.Pointer(pTab)).Ftnum
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*24)).Fp3 = wrFlag
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*32)).Fp1 = iDb
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*32)).Fp2 = int32((*Table)(unsafe.Pointer(pTab)).Ftnum)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*32)).Fp3 = wrFlag
Xsqlite3VdbeChangeP4(tls, v, 2, (*Table)(unsafe.Pointer(pTab)).FzName, 0)
__33:
;
@@ -68880,11 +71410,11 @@ __33:
if !(wrFlag != 0) {
goto __35
}
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(1)*24)).Fopcode = U8(97)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(1)*32)).Fopcode = U8(97)
__35:
;
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(1)*24)).Fp2 = (*Table)(unsafe.Pointer(pTab)).Ftnum
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(1)*24)).Fp3 = iDb
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(1)*32)).Fp2 = int32((*Table)(unsafe.Pointer(pTab)).Ftnum)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(1)*32)).Fp3 = iDb
// Configure the number of columns. Configure the cursor to
// think that the table has one more column than it really
@@ -68892,9 +71422,9 @@ __35:
// always return an SQL NULL. This is useful because it means
// we can invoke OP_Column to fill in the vdbe cursors type
// and offset cache without causing any IO.
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(1)*24)).Fp4type = int8(-3)
- *(*int32)(unsafe.Pointer(aOp + uintptr(1)*24 + 16 /* &.p4 */)) = (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*24)).Fp2 = int32((*Table)(unsafe.Pointer(pTab)).FnCol)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(1)*32)).Fp4type = int8(-3)
+ *(*int32)(unsafe.Pointer(aOp + uintptr(1)*32 + 16 /* &.p4 */)) = (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*32)).Fp2 = int32((*Table)(unsafe.Pointer(pTab)).FnCol)
(*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FnVar = int16(0)
(*Parse)(unsafe.Pointer(bp + 48 /* &sParse */)).FnMem = 1
@@ -68917,7 +71447,7 @@ __36:
rc = blobSeekToRow(tls, pBlob, iRow, bp+472 /* &zErr */)
goto __2
__2:
- if ((crt.PreIncInt32(&nAttempt, 1)) < 50) && (rc == 17) {
+ if ((libc.PreIncInt32(&nAttempt, 1)) < 50) && (rc == 17) {
goto __1
}
goto __3
@@ -68942,10 +71472,10 @@ __38:
;
Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
if *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)) != 0 {
- return ts + 696 /* "%s" */
+ return ts + 805 /* "%s" */
}
return uintptr(0)
- }(), crt.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */))))
+ }(), libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */))))
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* zErr */)))
Xsqlite3ParserReset(tls, bp+48 /* &sParse */)
rc = Xsqlite3ApiExit(tls, db, rc)
@@ -68953,7 +71483,7 @@ __38:
return rc
}
-var iLn int32 = 0 /* sqlite3.c:93422:24 */
+var iLn int32 = 0 /* sqlite3.c:93635:24 */
var openBlob = [6]VdbeOpList{
{Fopcode: U8(161), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)}, // 0: Acquire a read or write lock
{Fopcode: U8(96), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)}, // 1: Open a cursor
@@ -68962,11 +71492,11 @@ var openBlob = [6]VdbeOpList{
{Fopcode: U8(89), Fp1: int8(0), Fp2: int8(0), Fp3: int8(1)}, // 3
{Fopcode: U8(80), Fp1: int8(1), Fp2: int8(0), Fp3: int8(0)}, // 4
{Fopcode: U8(68), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)}, // 5
-} /* sqlite3.c:93423:31 */
+} /* sqlite3.c:93636:31 */
// Close a blob handle that was previously created using
// sqlite3_blob_open().
-func Xsqlite3_blob_close(tls *crt.TLS, pBlob uintptr) int32 { /* sqlite3.c:93512:16: */
+func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:93725:16: */
var p uintptr = pBlob
var rc int32
var db uintptr
@@ -68985,14 +71515,14 @@ func Xsqlite3_blob_close(tls *crt.TLS, pBlob uintptr) int32 { /* sqlite3.c:93512
}
// Perform a read or write operation on a blob
-func blobReadWrite(tls *crt.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) int32 { /* sqlite3.c:93533:12: */
+func blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) int32 { /* sqlite3.c:93746:12: */
var rc int32
var p uintptr = pBlob
var v uintptr
var db uintptr
if p == uintptr(0) {
- return Xsqlite3MisuseError(tls, 93545)
+ return Xsqlite3MisuseError(tls, 93758)
}
db = (*Incrblob)(unsafe.Pointer(p)).Fdb
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -69011,7 +71541,28 @@ func blobReadWrite(tls *crt.TLS, pBlob uintptr, z uintptr, n int32, iOffset int3
Xsqlite3BtreeEnterCursor(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr)
- rc = (*(*func(*crt.TLS, uintptr, U32, U32, uintptr) int32)(unsafe.Pointer(&xCall)))(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr, (uint32(iOffset + (*Incrblob)(unsafe.Pointer(p)).FiOffset)), uint32(n), z)
+ if (xCall == *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, U32, U32, uintptr) int32
+ }{Xsqlite3BtreePutData}))) && ((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0) {
+ // If a pre-update hook is registered and this is a write cursor,
+ // invoke it here.
+ //
+ // TODO: The preupdate-hook is passed SQLITE_DELETE, even though this
+ // operation should really be an SQLITE_UPDATE. This is probably
+ // incorrect, but is convenient because at this point the new.* values
+ // are not easily obtainable. And for the sessions module, an
+ // SQLITE_UPDATE where the PK columns do not change is handled in the
+ // same way as an SQLITE_DELETE (the SQLITE_DELETE code is actually
+ // slightly more efficient). Since you cannot write to a PK column
+ // using the incremental-blob API, this works. For the sessions module
+ // anyhow.
+ var iKey Sqlite3_int64
+ iKey = Xsqlite3BtreeIntegerKey(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr)
+ Xsqlite3VdbePreUpdateHook(tls,
+ v, *(*uintptr)(unsafe.Pointer((*Vdbe)(unsafe.Pointer(v)).FapCsr + uintptr(0)*8)), 9, (*Incrblob)(unsafe.Pointer(p)).FzDb, (*Incrblob)(unsafe.Pointer(p)).FpTab, iKey, -1)
+ }
+
+ rc = (*(*func(*libc.TLS, uintptr, U32, U32, uintptr) int32)(unsafe.Pointer(&xCall)))(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr, (uint32(iOffset + (*Incrblob)(unsafe.Pointer(p)).FiOffset)), uint32(n), z)
Xsqlite3BtreeLeaveCursor(tls, (*Incrblob)(unsafe.Pointer(p)).FpCsr)
if rc == 4 {
Xsqlite3VdbeFinalize(tls, v)
@@ -69027,16 +71578,16 @@ func blobReadWrite(tls *crt.TLS, pBlob uintptr, z uintptr, n int32, iOffset int3
}
// Read data from a blob handle.
-func Xsqlite3_blob_read(tls *crt.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:93606:16: */
+func Xsqlite3_blob_read(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:93819:16: */
return blobReadWrite(tls, pBlob, z, n, iOffset, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, U32, U32, uintptr) int32
+ f func(*libc.TLS, uintptr, U32, U32, uintptr) int32
}{Xsqlite3BtreePayloadChecked})))
}
// Write data to a blob handle.
-func Xsqlite3_blob_write(tls *crt.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:93613:16: */
+func Xsqlite3_blob_write(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32) int32 { /* sqlite3.c:93826:16: */
return blobReadWrite(tls, pBlob, z, n, iOffset, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, U32, U32, uintptr) int32
+ f func(*libc.TLS, uintptr, U32, U32, uintptr) int32
}{Xsqlite3BtreePutData})))
}
@@ -69044,7 +71595,7 @@ func Xsqlite3_blob_write(tls *crt.TLS, pBlob uintptr, z uintptr, n int32, iOffse
//
// The Incrblob.nByte field is fixed for the lifetime of the Incrblob
// so no mutex is required for access.
-func Xsqlite3_blob_bytes(tls *crt.TLS, pBlob uintptr) int32 { /* sqlite3.c:93623:16: */
+func Xsqlite3_blob_bytes(tls *libc.TLS, pBlob uintptr) int32 { /* sqlite3.c:93836:16: */
var p uintptr = pBlob
if (p != 0) && ((*Incrblob)(unsafe.Pointer(p)).FpStmt != 0) {
return (*Incrblob)(unsafe.Pointer(p)).FnByte
@@ -69060,7 +71611,7 @@ func Xsqlite3_blob_bytes(tls *crt.TLS, pBlob uintptr) int32 { /* sqlite3.c:93623
// database handle error code and message set. If this happens, then all
// subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
// immediately return SQLITE_ABORT.
-func Xsqlite3_blob_reopen(tls *crt.TLS, pBlob uintptr, iRow Sqlite3_int64) int32 { /* sqlite3.c:93638:16: */
+func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Sqlite3_int64) int32 { /* sqlite3.c:93851:16: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -69069,7 +71620,7 @@ func Xsqlite3_blob_reopen(tls *crt.TLS, pBlob uintptr, iRow Sqlite3_int64) int32
var db uintptr
if p == uintptr(0) {
- return Xsqlite3MisuseError(tls, 93643)
+ return Xsqlite3MisuseError(tls, 93856)
}
db = (*Incrblob)(unsafe.Pointer(p)).Fdb
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -69085,10 +71636,10 @@ func Xsqlite3_blob_reopen(tls *crt.TLS, pBlob uintptr, iRow Sqlite3_int64) int32
if rc != 0 {
Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
if *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */)) != 0 {
- return ts + 696 /* "%s" */
+ return ts + 805 /* "%s" */
}
return uintptr(0)
- }(), crt.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */))))
+ }(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */))))
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */)))
}
}
@@ -69404,7 +71955,7 @@ type MergeEngine1 = struct {
// overflows. 512MiB.
// Private objects used by the sorter
-type MergeEngine = MergeEngine1 /* sqlite3.c:93831:28 */ // Merge PMAs together
+type MergeEngine = MergeEngine1 /* sqlite3.c:94044:28 */ // Merge PMAs together
type PmaReader1 = struct {
FiReadOff I64
FiEof I64
@@ -69420,7 +71971,7 @@ type PmaReader1 = struct {
}
// Merge PMAs together
-type PmaReader = PmaReader1 /* sqlite3.c:93832:26 */ // Incrementally read one PMA
+type PmaReader = PmaReader1 /* sqlite3.c:94045:26 */ // Incrementally read one PMA
type PmaWriter1 = struct {
FeFWErr int32
FaBuffer uintptr
@@ -69432,14 +71983,14 @@ type PmaWriter1 = struct {
}
// Incrementally read one PMA
-type PmaWriter = PmaWriter1 /* sqlite3.c:93833:26 */ // Incrementally write one PMA
+type PmaWriter = PmaWriter1 /* sqlite3.c:94046:26 */ // Incrementally write one PMA
type SorterRecord1 = struct {
FnVal int32
Fu struct{ FpNext uintptr }
}
// Incrementally write one PMA
-type SorterRecord = SorterRecord1 /* sqlite3.c:93834:29 */ // A record being sorted
+type SorterRecord = SorterRecord1 /* sqlite3.c:94047:29 */ // A record being sorted
type SortSubtask1 = struct {
FpThread uintptr
FbDone int32
@@ -69453,14 +72004,14 @@ type SortSubtask1 = struct {
}
// A record being sorted
-type SortSubtask = SortSubtask1 /* sqlite3.c:93835:28 */ // A sub-task in the sort process
+type SortSubtask = SortSubtask1 /* sqlite3.c:94048:28 */ // A sub-task in the sort process
type SorterFile1 = struct {
FpFd uintptr
FiEof I64
}
// A sub-task in the sort process
-type SorterFile = SorterFile1 /* sqlite3.c:93836:27 */ // Temporary file object wrapper
+type SorterFile = SorterFile1 /* sqlite3.c:94049:27 */ // Temporary file object wrapper
type SorterList1 = struct {
FpList uintptr
FaMemory uintptr
@@ -69469,7 +72020,7 @@ type SorterList1 = struct {
}
// Temporary file object wrapper
-type SorterList = SorterList1 /* sqlite3.c:93837:27 */ // In-memory list of records
+type SorterList = SorterList1 /* sqlite3.c:94050:27 */ // In-memory list of records
type IncrMerger1 = struct {
FpTask uintptr
FpMerger uintptr
@@ -69481,7 +72032,7 @@ type IncrMerger1 = struct {
}
// In-memory list of records
-type IncrMerger = IncrMerger1 /* sqlite3.c:93838:27 */
+type IncrMerger = IncrMerger1 /* sqlite3.c:94051:27 */
// This object represents a single thread of control in a sort operation.
// Exactly VdbeSorter.nTask instances of this object are allocated
@@ -69512,18 +72063,18 @@ type IncrMerger = IncrMerger1 /* sqlite3.c:93838:27 */
// In both cases, the effects of the main thread seeing (bDone==0) even
// after the thread has finished are not dire. So we don't worry about
// memory barriers and such here.
-type SorterCompare = uintptr /* sqlite3.c:93965:13 */
+type SorterCompare = uintptr /* sqlite3.c:94178:13 */
// Free all memory belonging to the PmaReader object passed as the
// argument. All structure fields are set to zero before returning.
-func vdbePmaReaderClear(tls *crt.TLS, pReadr uintptr) { /* sqlite3.c:94140:13: */
+func vdbePmaReaderClear(tls *libc.TLS, pReadr uintptr) { /* sqlite3.c:94353:13: */
Xsqlite3_free(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FaAlloc)
Xsqlite3_free(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FaBuffer)
if (*PmaReader)(unsafe.Pointer(pReadr)).FaMap != 0 {
Xsqlite3OsUnfetch(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FpFd, int64(0), (*PmaReader)(unsafe.Pointer(pReadr)).FaMap)
}
vdbeIncrFree(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr)
- crt.Xmemset(tls, pReadr, 0, uint64(unsafe.Sizeof(PmaReader{})))
+ libc.Xmemset(tls, pReadr, 0, uint64(unsafe.Sizeof(PmaReader{})))
}
// Read the next nByte bytes of data from the PMA p.
@@ -69533,7 +72084,7 @@ func vdbePmaReaderClear(tls *crt.TLS, pReadr uintptr) { /* sqlite3.c:94140:13: *
//
// The buffer returned in *ppOut is only valid until the
// next call to this function.
-func vdbePmaReadBlob(tls *crt.TLS, p uintptr, nByte int32, ppOut uintptr) int32 { /* sqlite3.c:94157:12: */
+func vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) int32 { /* sqlite3.c:94370:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -69604,7 +72155,7 @@ func vdbePmaReadBlob(tls *crt.TLS, p uintptr, nByte int32, ppOut uintptr) int32
// Copy as much data as is available in the buffer into the start of
// p->aAlloc[].
- crt.Xmemcpy(tls, (*PmaReader)(unsafe.Pointer(p)).FaAlloc, ((*PmaReader)(unsafe.Pointer(p)).FaBuffer + uintptr(iBuf)), uint64(nAvail))
+ libc.Xmemcpy(tls, (*PmaReader)(unsafe.Pointer(p)).FaAlloc, ((*PmaReader)(unsafe.Pointer(p)).FaBuffer + uintptr(iBuf)), uint64(nAvail))
*(*I64)(unsafe.Pointer(p /* &.iReadOff */)) += (I64(nAvail))
nRem = (nByte - nAvail)
@@ -69625,7 +72176,7 @@ func vdbePmaReadBlob(tls *crt.TLS, p uintptr, nByte int32, ppOut uintptr) int32
return rc
}
- crt.Xmemcpy(tls, ((*PmaReader)(unsafe.Pointer(p)).FaAlloc + uintptr((nByte - nRem))), *(*uintptr)(unsafe.Pointer(bp /* aNext */)), uint64(nCopy))
+ libc.Xmemcpy(tls, ((*PmaReader)(unsafe.Pointer(p)).FaAlloc + uintptr((nByte - nRem))), *(*uintptr)(unsafe.Pointer(bp /* aNext */)), uint64(nCopy))
nRem = nRem - (nCopy)
}
@@ -69637,7 +72188,7 @@ func vdbePmaReadBlob(tls *crt.TLS, p uintptr, nByte int32, ppOut uintptr) int32
// Read a varint from the stream of data accessed by p. Set *pnOut to
// the value read.
-func vdbePmaReadVarint(tls *crt.TLS, p uintptr, pnOut uintptr) int32 { /* sqlite3.c:94251:12: */
+func vdbePmaReadVarint(tls *libc.TLS, p uintptr, pnOut uintptr) int32 { /* sqlite3.c:94464:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -69661,7 +72212,7 @@ func vdbePmaReadVarint(tls *crt.TLS, p uintptr, pnOut uintptr) int32 { /* sqlite
if rc != 0 {
return rc
}
- *(*U8)(unsafe.Pointer(bp + 8 /* &aVarint[0] */ + uintptr(((crt.PostIncInt32(&i, 1)) & 0xf)))) = *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* a */)) + uintptr(0)))
+ *(*U8)(unsafe.Pointer(bp + 8 /* &aVarint[0] */ + uintptr(((libc.PostIncInt32(&i, 1)) & 0xf)))) = *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* a */)) + uintptr(0)))
}
Xsqlite3GetVarint(tls, bp+8 /* &aVarint[0] */, pnOut)
}
@@ -69677,7 +72228,7 @@ func vdbePmaReadVarint(tls *crt.TLS, p uintptr, pnOut uintptr) int32 { /* sqlite
//
// Or, if an error occurs, return an SQLite error code. The final value of
// *pp is undefined in this case.
-func vdbeSorterMapFile(tls *crt.TLS, pTask uintptr, pFile uintptr, pp uintptr) int32 { /* sqlite3.c:94284:12: */
+func vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) int32 { /* sqlite3.c:94497:12: */
var rc int32 = 0
if (*SorterFile)(unsafe.Pointer(pFile)).FiEof <= (I64((*Sqlite3)(unsafe.Pointer((*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap)) {
var pFd uintptr = (*SorterFile)(unsafe.Pointer(pFile)).FpFd
@@ -69691,7 +72242,7 @@ func vdbeSorterMapFile(tls *crt.TLS, pTask uintptr, pFile uintptr, pp uintptr) i
// Attach PmaReader pReadr to file pFile (if it is not already attached to
// that file) and seek it to offset iOff within the file. Return SQLITE_OK
// if successful, or an SQLite error code if an error occurs.
-func vdbePmaReaderSeek(tls *crt.TLS, pTask uintptr, pReadr uintptr, pFile uintptr, iOff I64) int32 { /* sqlite3.c:94301:12: */
+func vdbePmaReaderSeek(tls *libc.TLS, pTask uintptr, pReadr uintptr, pFile uintptr, iOff I64) int32 { /* sqlite3.c:94514:12: */
var rc int32 = 0
if Xsqlite3FaultSim(tls, 201) != 0 {
@@ -69731,7 +72282,7 @@ func vdbePmaReaderSeek(tls *crt.TLS, pTask uintptr, pReadr uintptr, pFile uintpt
// Advance PmaReader pReadr to the next key in its PMA. Return SQLITE_OK if
// no error occurs, or an SQLite error code if one does.
-func vdbePmaReaderNext(tls *crt.TLS, pReadr uintptr) int32 { /* sqlite3.c:94348:12: */
+func vdbePmaReaderNext(tls *libc.TLS, pReadr uintptr) int32 { /* sqlite3.c:94561:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -69776,7 +72327,7 @@ func vdbePmaReaderNext(tls *crt.TLS, pReadr uintptr) int32 { /* sqlite3.c:94348:
//
// If the pnByte parameter is NULL, then it is assumed that the file
// contains a single PMA, and that that PMA omits the initial length varint.
-func vdbePmaReaderInit(tls *crt.TLS, pTask uintptr, pFile uintptr, iStart I64, pReadr uintptr, pnByte uintptr) int32 { /* sqlite3.c:94395:12: */
+func vdbePmaReaderInit(tls *libc.TLS, pTask uintptr, pFile uintptr, iStart I64, pReadr uintptr, pnByte uintptr) int32 { /* sqlite3.c:94608:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -69799,7 +72350,7 @@ func vdbePmaReaderInit(tls *crt.TLS, pTask uintptr, pFile uintptr, iStart I64, p
// A version of vdbeSorterCompare() that assumes that it has already been
// determined that the first field of key1 is equal to the first field of
// key2.
-func vdbeSorterCompareTail(tls *crt.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94428:12: */
+func vdbeSorterCompareTail(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94641:12: */
var r2 uintptr = (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked
if *(*int32)(unsafe.Pointer(pbKey2Cached)) == 0 {
Xsqlite3VdbeRecordUnpack(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo, nKey2, pKey2, r2)
@@ -69819,7 +72370,7 @@ func vdbeSorterCompareTail(tls *crt.TLS, pTask uintptr, pbKey2Cached uintptr, pK
//
// If an OOM error is encountered, (pTask->pUnpacked->error_rc) is set
// to SQLITE_NOMEM.
-func vdbeSorterCompare(tls *crt.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94455:12: */
+func vdbeSorterCompare(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94668:12: */
var r2 uintptr = (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked
if !(*(*int32)(unsafe.Pointer(pbKey2Cached)) != 0) {
Xsqlite3VdbeRecordUnpack(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo, nKey2, pKey2, r2)
@@ -69831,7 +72382,7 @@ func vdbeSorterCompare(tls *crt.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1
// A specially optimized version of vdbeSorterCompare() that assumes that
// the first field of each key is a TEXT value and that the collation
// sequence to compare them with is BINARY.
-func vdbeSorterCompareText(tls *crt.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94474:12: */
+func vdbeSorterCompareText(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94687:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -69854,7 +72405,7 @@ func vdbeSorterCompareText(tls *crt.TLS, pTask uintptr, pbKey2Cached uintptr, pK
if *(*int32)(unsafe.Pointer(bp + 4 /* n2 */)) >= 0x80 {
Xsqlite3GetVarint32(tls, (p2 + uintptr(1)), bp+4 /* &n2 */)
}
- res = crt.Xmemcmp(tls, v1, v2, (uint64(((func() int32 {
+ res = libc.Xmemcmp(tls, v1, v2, (uint64(((func() int32 {
if (*(*int32)(unsafe.Pointer(bp /* n1 */))) < (*(*int32)(unsafe.Pointer(bp + 4 /* n2 */))) {
return *(*int32)(unsafe.Pointer(bp /* n1 */))
}
@@ -69881,7 +72432,7 @@ func vdbeSorterCompareText(tls *crt.TLS, pTask uintptr, pbKey2Cached uintptr, pK
// A specially optimized version of vdbeSorterCompare() that assumes that
// the first field of each key is an INTEGER value.
-func vdbeSorterCompareInt(tls *crt.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94516:12: */
+func vdbeSorterCompareInt(tls *libc.TLS, pTask uintptr, pbKey2Cached uintptr, pKey1 uintptr, nKey1 int32, pKey2 uintptr, nKey2 int32) int32 { /* sqlite3.c:94729:12: */
var p1 uintptr = pKey1
var p2 uintptr = pKey2
var s1 int32 = int32(*(*U8)(unsafe.Pointer(p1 + uintptr(1)))) // Left hand serial type
@@ -69895,7 +72446,7 @@ func vdbeSorterCompareInt(tls *crt.TLS, pTask uintptr, pbKey2Cached uintptr, pKe
var i int32
res = 0
for i = 0; i < int32(n); i++ {
- if (crt.AssignInt32(&res, (int32(*(*U8)(unsafe.Pointer(v1 + uintptr(i)))) - int32(*(*U8)(unsafe.Pointer(v2 + uintptr(i))))))) != 0 {
+ if (libc.AssignInt32(&res, (int32(*(*U8)(unsafe.Pointer(v1 + uintptr(i)))) - int32(*(*U8)(unsafe.Pointer(v2 + uintptr(i))))))) != 0 {
if ((int32(*(*U8)(unsafe.Pointer(v1 + uintptr(0)))) ^ int32(*(*U8)(unsafe.Pointer(v2 + uintptr(0))))) & 0x80) != 0 {
if (int32(*(*U8)(unsafe.Pointer(v1 + uintptr(0)))) & 0x80) != 0 {
res = -1
@@ -69941,7 +72492,7 @@ func vdbeSorterCompareInt(tls *crt.TLS, pTask uintptr, pbKey2Cached uintptr, pKe
return res
}
-var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0), U8(0)} /* sqlite3.c:94535:21 */
+var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0), U8(0)} /* sqlite3.c:94748:21 */
// Initialize the temporary index cursor just opened as a sorter cursor.
//
@@ -69960,7 +72511,7 @@ var aLen = [10]U8{U8(0), U8(1), U8(2), U8(3), U8(4), U8(6), U8(8), U8(0), U8(0),
// mode, but not in multi-threaded mode.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
-func Xsqlite3VdbeSorterInit(tls *crt.TLS, db uintptr, nField int32, pCsr uintptr) int32 { /* sqlite3.c:94599:20: */
+func Xsqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) int32 { /* sqlite3.c:94812:20: */
var pgsz int32 // Page size of main database
var i int32 // Used to iterate through aTask[]
var pSorter uintptr // The new sorter
@@ -69988,16 +72539,16 @@ func Xsqlite3VdbeSorterInit(tls *crt.TLS, db uintptr, nField int32, pCsr uintptr
if pSorter == uintptr(0) {
rc = 7
} else {
- (*VdbeSorter)(unsafe.Pointer(pSorter)).FpKeyInfo = crt.AssignUintptr(&pKeyInfo, (pSorter + uintptr(sz)))
- crt.Xmemcpy(tls, pKeyInfo, (*VdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo, uint64(szKeyInfo))
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).FpKeyInfo = libc.AssignUintptr(&pKeyInfo, (pSorter + uintptr(sz)))
+ libc.Xmemcpy(tls, pKeyInfo, (*VdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo, uint64(szKeyInfo))
(*KeyInfo)(unsafe.Pointer(pKeyInfo)).Fdb = uintptr(0)
if (nField != 0) && (nWorker == 0) {
(*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField = U16(nField)
}
- (*VdbeSorter)(unsafe.Pointer(pSorter)).Fpgsz = crt.AssignInt32(&pgsz, Xsqlite3BtreeGetPageSize(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(0)*32)).FpBt))
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).Fpgsz = libc.AssignInt32(&pgsz, Xsqlite3BtreeGetPageSize(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(0)*32)).FpBt))
(*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask = (U8(nWorker + 1))
(*VdbeSorter)(unsafe.Pointer(pSorter)).FiPrev = (U8(nWorker - 1))
- (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads = (U8(crt.Bool32(int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) > 1)))
+ (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUseThreads = (U8(libc.Bool32(int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) > 1)))
(*VdbeSorter)(unsafe.Pointer(pSorter)).Fdb = db
for i = 0; i < int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask); i++ {
var pTask uintptr = ((pSorter + 96 /* &.aTask */) + uintptr(i)*104)
@@ -70053,7 +72604,7 @@ func Xsqlite3VdbeSorterInit(tls *crt.TLS, db uintptr, nField int32, pCsr uintptr
}
// Free the list of sorted records starting at pRecord.
-func vdbeSorterRecordFree(tls *crt.TLS, db uintptr, pRecord uintptr) { /* sqlite3.c:94701:13: */
+func vdbeSorterRecordFree(tls *libc.TLS, db uintptr, pRecord uintptr) { /* sqlite3.c:94914:13: */
var p uintptr
var pNext uintptr
for p = pRecord; p != 0; p = pNext {
@@ -70064,7 +72615,7 @@ func vdbeSorterRecordFree(tls *crt.TLS, db uintptr, pRecord uintptr) { /* sqlite
// Free all resources owned by the object indicated by argument pTask. All
// fields of *pTask are zeroed before returning.
-func vdbeSortSubtaskCleanup(tls *crt.TLS, db uintptr, pTask uintptr) { /* sqlite3.c:94714:13: */
+func vdbeSortSubtaskCleanup(tls *libc.TLS, db uintptr, pTask uintptr) { /* sqlite3.c:94927:13: */
Xsqlite3DbFree(tls, db, (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked)
// pTask->list.aMemory can only be non-zero if it was handed memory
// from the main thread. That only occurs SQLITE_MAX_WORKER_THREADS>0
@@ -70080,11 +72631,11 @@ func vdbeSortSubtaskCleanup(tls *crt.TLS, db uintptr, pTask uintptr) { /* sqlite
if (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FpFd != 0 {
Xsqlite3OsCloseFree(tls, (*SortSubtask)(unsafe.Pointer(pTask)).Ffile2.FpFd)
}
- crt.Xmemset(tls, pTask, 0, uint64(unsafe.Sizeof(SortSubtask{})))
+ libc.Xmemset(tls, pTask, 0, uint64(unsafe.Sizeof(SortSubtask{})))
}
// Join thread pTask->thread.
-func vdbeSorterJoinThread(tls *crt.TLS, pTask uintptr) int32 { /* sqlite3.c:94779:12: */
+func vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:94992:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -70103,14 +72654,14 @@ func vdbeSorterJoinThread(tls *crt.TLS, pTask uintptr) int32 { /* sqlite3.c:9477
}
// Launch a background thread to run xTask(pIn).
-func vdbeSorterCreateThread(tls *crt.TLS, pTask uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:94800:12: */
+func vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) int32 { /* sqlite3.c:95013:12: */
return Xsqlite3ThreadCreate(tls, (pTask /* &.pThread */), xTask, pIn)
}
// Join all outstanding threads launched by SorterWrite() to create
// level-0 PMAs.
-func vdbeSorterJoinAll(tls *crt.TLS, pSorter uintptr, rcin int32) int32 { /* sqlite3.c:94813:12: */
+func vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) int32 { /* sqlite3.c:95026:12: */
var rc int32 = rcin
var i int32
@@ -70136,7 +72687,7 @@ func vdbeSorterJoinAll(tls *crt.TLS, pSorter uintptr, rcin int32) int32 { /* sql
//
// nReader is automatically rounded up to the next power of two.
// nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up.
-func vdbeMergeEngineNew(tls *crt.TLS, nReader int32) uintptr { /* sqlite3.c:94843:20: */
+func vdbeMergeEngineNew(tls *libc.TLS, nReader int32) uintptr { /* sqlite3.c:95056:20: */
var N int32 = 2 // Smallest power of two >= nReader
var nByte int32 // Total bytes of space to allocate
var pNew uintptr // Pointer to allocated object to return
@@ -70161,7 +72712,7 @@ func vdbeMergeEngineNew(tls *crt.TLS, nReader int32) uintptr { /* sqlite3.c:9484
}
// Free the MergeEngine object passed as the only argument.
-func vdbeMergeEngineFree(tls *crt.TLS, pMerger uintptr) { /* sqlite3.c:94866:13: */
+func vdbeMergeEngineFree(tls *libc.TLS, pMerger uintptr) { /* sqlite3.c:95079:13: */
var i int32
if pMerger != 0 {
for i = 0; i < (*MergeEngine)(unsafe.Pointer(pMerger)).FnTree; i++ {
@@ -70173,7 +72724,7 @@ func vdbeMergeEngineFree(tls *crt.TLS, pMerger uintptr) { /* sqlite3.c:94866:13:
// Free all resources associated with the IncrMerger object indicated by
// the first argument.
-func vdbeIncrFree(tls *crt.TLS, pIncr uintptr) { /* sqlite3.c:94880:13: */
+func vdbeIncrFree(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:95093:13: */
if pIncr != 0 {
if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 {
vdbeSorterJoinThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask)
@@ -70190,7 +72741,7 @@ func vdbeIncrFree(tls *crt.TLS, pIncr uintptr) { /* sqlite3.c:94880:13: */
}
// Reset a sorting cursor back to its original empty state.
-func Xsqlite3VdbeSorterReset(tls *crt.TLS, db uintptr, pSorter uintptr) { /* sqlite3.c:94897:21: */
+func Xsqlite3VdbeSorterReset(tls *libc.TLS, db uintptr, pSorter uintptr) { /* sqlite3.c:95110:21: */
var i int32
vdbeSorterJoinAll(tls, pSorter, 0)
@@ -70219,7 +72770,7 @@ func Xsqlite3VdbeSorterReset(tls *crt.TLS, db uintptr, pSorter uintptr) { /* sql
}
// Free any cursor components allocated by sqlite3VdbeSorterXXX routines.
-func Xsqlite3VdbeSorterClose(tls *crt.TLS, db uintptr, pCsr uintptr) { /* sqlite3.c:94930:21: */
+func Xsqlite3VdbeSorterClose(tls *libc.TLS, db uintptr, pCsr uintptr) { /* sqlite3.c:95143:21: */
var pSorter uintptr
pSorter = *(*uintptr)(unsafe.Pointer(pCsr + 56 /* &.uc */))
@@ -70238,7 +72789,7 @@ func Xsqlite3VdbeSorterClose(tls *crt.TLS, db uintptr, pCsr uintptr) { /* sqlite
//
// Whether or not the file does end up memory mapped of course depends on
// the specific VFS implementation.
-func vdbeSorterExtendFile(tls *crt.TLS, db uintptr, pFd uintptr, nByte I64) { /* sqlite3.c:94952:13: */
+func vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, nByte I64) { /* sqlite3.c:95165:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
*(*I64)(unsafe.Pointer(bp + 8)) = nByte
@@ -70256,7 +72807,7 @@ func vdbeSorterExtendFile(tls *crt.TLS, db uintptr, pFd uintptr, nByte I64) { /*
// Allocate space for a file-handle and open a temporary file. If successful,
// set *ppFd to point to the malloc'd file-handle and return SQLITE_OK.
// Otherwise, set *ppFd to 0 and return an SQLite error code.
-func vdbeSorterOpenTempFile(tls *crt.TLS, db uintptr, nExtend I64, ppFd uintptr) int32 { /* sqlite3.c:94971:12: */
+func vdbeSorterOpenTempFile(tls *libc.TLS, db uintptr, nExtend I64, ppFd uintptr) int32 { /* sqlite3.c:95184:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -70268,7 +72819,7 @@ func vdbeSorterOpenTempFile(tls *crt.TLS, db uintptr, nExtend I64, ppFd uintptr)
*(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3OsOpenMalloc(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), ppFd,
((((0x00001000 | 0x00000002) | 0x00000004) | 0x00000010) | 0x00000008), bp /* &rc */)
if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
- *(*I64)(unsafe.Pointer(bp + 8 /* max */)) = 8589934592
+ *(*I64)(unsafe.Pointer(bp + 8 /* max */)) = int64(0x7fff0000)
Xsqlite3OsFileControlHint(tls, *(*uintptr)(unsafe.Pointer(ppFd)), 18, bp+8 /* &max */)
if nExtend > int64(0) {
vdbeSorterExtendFile(tls, db, *(*uintptr)(unsafe.Pointer(ppFd)), nExtend)
@@ -70280,7 +72831,7 @@ func vdbeSorterOpenTempFile(tls *crt.TLS, db uintptr, nExtend I64, ppFd uintptr)
// If it has not already been allocated, allocate the UnpackedRecord
// structure at pTask->pUnpacked. Return SQLITE_OK if successful (or
// if no allocation was required), or SQLITE_NOMEM otherwise.
-func vdbeSortAllocUnpacked(tls *crt.TLS, pTask uintptr) int32 { /* sqlite3.c:94998:12: */
+func vdbeSortAllocUnpacked(tls *libc.TLS, pTask uintptr) int32 { /* sqlite3.c:95211:12: */
if (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked == uintptr(0) {
(*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked = Xsqlite3VdbeAllocUnpackedRecord(tls, (*VdbeSorter)(unsafe.Pointer((*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)).FpKeyInfo)
if (*SortSubtask)(unsafe.Pointer(pTask)).FpUnpacked == uintptr(0) {
@@ -70293,7 +72844,7 @@ func vdbeSortAllocUnpacked(tls *crt.TLS, pTask uintptr) int32 { /* sqlite3.c:949
}
// Merge the two sorted lists p1 and p2 into a single list.
-func vdbeSorterMerge(tls *crt.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:95012:21: */
+func vdbeSorterMerge(tls *libc.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:95225:21: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -70303,7 +72854,7 @@ func vdbeSorterMerge(tls *crt.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintpt
for {
var res int32
- res = (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer((pTask + 64 /* &.xCompare */))))(tls,
+ res = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer((pTask + 64 /* &.xCompare */))))(tls,
pTask, bp+8 /* &bCached */, ((p1) + uintptr(1)*16), (*SorterRecord)(unsafe.Pointer(p1)).FnVal, ((p2) + uintptr(1)*16), (*SorterRecord)(unsafe.Pointer(p2)).FnVal)
if res <= 0 {
@@ -70330,25 +72881,25 @@ func vdbeSorterMerge(tls *crt.TLS, pTask uintptr, p1 uintptr, p2 uintptr) uintpt
// Return the SorterCompare function to compare values collected by the
// sorter object passed as the only argument.
-func vdbeSorterGetCompare(tls *crt.TLS, p uintptr) SorterCompare { /* sqlite3.c:95054:22: */
+func vdbeSorterGetCompare(tls *libc.TLS, p uintptr) SorterCompare { /* sqlite3.c:95267:22: */
if int32((*VdbeSorter)(unsafe.Pointer(p)).FtypeMask) == 0x01 {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
}{vdbeSorterCompareInt}))
} else if int32((*VdbeSorter)(unsafe.Pointer(p)).FtypeMask) == 0x02 {
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
}{vdbeSorterCompareText}))
}
return *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32
}{vdbeSorterCompare}))
}
// Sort the linked list of records headed at pTask->pList. Return
// SQLITE_OK if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if
// an error occurs.
-func vdbeSorterSort(tls *crt.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:95068:12: */
+func vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:95281:12: */
bp := tls.Alloc(512)
defer tls.Free(512)
@@ -70364,7 +72915,7 @@ func vdbeSorterSort(tls *crt.TLS, pTask uintptr, pList uintptr) int32 { /* sqlit
p = (*SorterList)(unsafe.Pointer(pList)).FpList
(*SortSubtask)(unsafe.Pointer(pTask)).FxCompare = vdbeSorterGetCompare(tls, (*SortSubtask)(unsafe.Pointer(pTask)).FpSorter)
- crt.Xmemset(tls, bp /* &aSlot[0] */, 0, uint64(unsafe.Sizeof([64]uintptr{})))
+ libc.Xmemset(tls, bp /* &aSlot[0] */, 0, uint64(unsafe.Sizeof([64]uintptr{})))
for p != 0 {
var pNext uintptr
@@ -70405,13 +72956,13 @@ func vdbeSorterSort(tls *crt.TLS, pTask uintptr, pList uintptr) int32 { /* sqlit
}
// Initialize a PMA-writer object.
-func vdbePmaWriterInit(tls *crt.TLS, pFd uintptr, p uintptr, nBuf int32, iStart I64) { /* sqlite3.c:95119:13: */
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PmaWriter{})))
+func vdbePmaWriterInit(tls *libc.TLS, pFd uintptr, p uintptr, nBuf int32, iStart I64) { /* sqlite3.c:95332:13: */
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PmaWriter{})))
(*PmaWriter)(unsafe.Pointer(p)).FaBuffer = Xsqlite3Malloc(tls, uint64(nBuf))
if !(int32((*PmaWriter)(unsafe.Pointer(p)).FaBuffer) != 0) {
(*PmaWriter)(unsafe.Pointer(p)).FeFWErr = 7
} else {
- (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd = crt.AssignPtrInt32(p+20 /* &.iBufStart */, (int32(iStart % I64(nBuf))))
+ (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd = libc.AssignPtrInt32(p+20 /* &.iBufStart */, (int32(iStart % I64(nBuf))))
(*PmaWriter)(unsafe.Pointer(p)).FiWriteOff = (iStart - I64((*PmaWriter)(unsafe.Pointer(p)).FiBufStart))
(*PmaWriter)(unsafe.Pointer(p)).FnBuffer = nBuf
(*PmaWriter)(unsafe.Pointer(p)).FpFd = pFd
@@ -70420,7 +72971,7 @@ func vdbePmaWriterInit(tls *crt.TLS, pFd uintptr, p uintptr, nBuf int32, iStart
// Write nData bytes of data to the PMA. Return SQLITE_OK
// if successful, or an SQLite error code if an error occurs.
-func vdbePmaWriteBlob(tls *crt.TLS, p uintptr, pData uintptr, nData int32) { /* sqlite3.c:95141:13: */
+func vdbePmaWriteBlob(tls *libc.TLS, p uintptr, pData uintptr, nData int32) { /* sqlite3.c:95354:13: */
var nRem int32 = nData
for (nRem > 0) && ((*PmaWriter)(unsafe.Pointer(p)).FeFWErr == 0) {
var nCopy int32 = nRem
@@ -70428,13 +72979,13 @@ func vdbePmaWriteBlob(tls *crt.TLS, p uintptr, pData uintptr, nData int32) { /*
nCopy = ((*PmaWriter)(unsafe.Pointer(p)).FnBuffer - (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd)
}
- crt.Xmemcpy(tls, ((*PmaWriter)(unsafe.Pointer(p)).FaBuffer + uintptr((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd)), (pData + uintptr((nData - nRem))), uint64(nCopy))
+ libc.Xmemcpy(tls, ((*PmaWriter)(unsafe.Pointer(p)).FaBuffer + uintptr((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd)), (pData + uintptr((nData - nRem))), uint64(nCopy))
*(*int32)(unsafe.Pointer(p + 24 /* &.iBufEnd */)) += (nCopy)
if (*PmaWriter)(unsafe.Pointer(p)).FiBufEnd == (*PmaWriter)(unsafe.Pointer(p)).FnBuffer {
(*PmaWriter)(unsafe.Pointer(p)).FeFWErr = Xsqlite3OsWrite(tls, (*PmaWriter)(unsafe.Pointer(p)).FpFd,
((*PmaWriter)(unsafe.Pointer(p)).FaBuffer + uintptr((*PmaWriter)(unsafe.Pointer(p)).FiBufStart)), ((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd - (*PmaWriter)(unsafe.Pointer(p)).FiBufStart),
((*PmaWriter)(unsafe.Pointer(p)).FiWriteOff + I64((*PmaWriter)(unsafe.Pointer(p)).FiBufStart)))
- (*PmaWriter)(unsafe.Pointer(p)).FiBufStart = crt.AssignPtrInt32(p+24 /* &.iBufEnd */, 0)
+ (*PmaWriter)(unsafe.Pointer(p)).FiBufStart = libc.AssignPtrInt32(p+24 /* &.iBufEnd */, 0)
*(*I64)(unsafe.Pointer(p + 32 /* &.iWriteOff */)) += (I64((*PmaWriter)(unsafe.Pointer(p)).FnBuffer))
}
@@ -70449,7 +73000,7 @@ func vdbePmaWriteBlob(tls *crt.TLS, p uintptr, pData uintptr, nData int32) { /*
//
// Before returning, set *piEof to the offset immediately following the
// last byte written to the file.
-func vdbePmaWriterFinish(tls *crt.TLS, p uintptr, piEof uintptr) int32 { /* sqlite3.c:95174:12: */
+func vdbePmaWriterFinish(tls *libc.TLS, p uintptr, piEof uintptr) int32 { /* sqlite3.c:95387:12: */
var rc int32
if (((*PmaWriter)(unsafe.Pointer(p)).FeFWErr == 0) && ((*PmaWriter)(unsafe.Pointer(p)).FaBuffer != 0)) && ((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd > (*PmaWriter)(unsafe.Pointer(p)).FiBufStart) {
(*PmaWriter)(unsafe.Pointer(p)).FeFWErr = Xsqlite3OsWrite(tls, (*PmaWriter)(unsafe.Pointer(p)).FpFd,
@@ -70459,13 +73010,13 @@ func vdbePmaWriterFinish(tls *crt.TLS, p uintptr, piEof uintptr) int32 { /* sqli
*(*I64)(unsafe.Pointer(piEof)) = ((*PmaWriter)(unsafe.Pointer(p)).FiWriteOff + I64((*PmaWriter)(unsafe.Pointer(p)).FiBufEnd))
Xsqlite3_free(tls, (*PmaWriter)(unsafe.Pointer(p)).FaBuffer)
rc = (*PmaWriter)(unsafe.Pointer(p)).FeFWErr
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PmaWriter{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(PmaWriter{})))
return rc
}
// Write value iVal encoded as a varint to the PMA. Return
// SQLITE_OK if successful, or an SQLite error code if an error occurs.
-func vdbePmaWriteVarint(tls *crt.TLS, p uintptr, iVal U64) { /* sqlite3.c:95193:13: */
+func vdbePmaWriteVarint(tls *libc.TLS, p uintptr, iVal U64) { /* sqlite3.c:95406:13: */
bp := tls.Alloc(10)
defer tls.Free(10)
@@ -70488,7 +73039,7 @@ func vdbePmaWriteVarint(tls *crt.TLS, p uintptr, iVal U64) { /* sqlite3.c:95193:
// * One or more records packed end-to-end in order of ascending keys.
// Each record consists of a varint followed by a blob of data (the
// key). The varint is the number of bytes in the blob of data.
-func vdbeSorterListToPMA(tls *crt.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:95214:12: */
+func vdbeSorterListToPMA(tls *libc.TLS, pTask uintptr, pList uintptr) int32 { /* sqlite3.c:95427:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -70497,7 +73048,7 @@ func vdbeSorterListToPMA(tls *crt.TLS, pTask uintptr, pList uintptr) int32 { /*
// var writer PmaWriter at bp, 48
// Object used to write to the file
- crt.Xmemset(tls, bp /* &writer */, 0, uint64(unsafe.Sizeof(PmaWriter{})))
+ libc.Xmemset(tls, bp /* &writer */, 0, uint64(unsafe.Sizeof(PmaWriter{})))
// If the first temporary PMA file has not been opened, open it now.
if (*SortSubtask)(unsafe.Pointer(pTask)).Ffile.FpFd == uintptr(0) {
@@ -70543,7 +73094,7 @@ func vdbeSorterListToPMA(tls *crt.TLS, pTask uintptr, pList uintptr) int32 { /*
// the MergeEngine has reached the end of all its inputs.
//
// Return SQLITE_OK if successful or an error code if an error occurs.
-func vdbeMergeEngineStep(tls *crt.TLS, pMerger uintptr, pbEof uintptr) int32 { /* sqlite3.c:95278:12: */
+func vdbeMergeEngineStep(tls *libc.TLS, pMerger uintptr, pbEof uintptr) int32 { /* sqlite3.c:95491:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70574,7 +73125,7 @@ func vdbeMergeEngineStep(tls *crt.TLS, pMerger uintptr, pbEof uintptr) int32 { /
} else if (*PmaReader)(unsafe.Pointer(pReadr2)).FpFd == uintptr(0) {
iRes = -1
} else {
- iRes = (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer((pTask + 64 /* &.xCompare */))))(tls, pTask, bp, /* &bCached */
+ iRes = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer((pTask + 64 /* &.xCompare */))))(tls, pTask, bp, /* &bCached */
(*PmaReader)(unsafe.Pointer(pReadr1)).FaKey, (*PmaReader)(unsafe.Pointer(pReadr1)).FnKey, (*PmaReader)(unsafe.Pointer(pReadr2)).FaKey, (*PmaReader)(unsafe.Pointer(pReadr2)).FnKey)
}
@@ -70605,7 +73156,7 @@ func vdbeMergeEngineStep(tls *crt.TLS, pMerger uintptr, pbEof uintptr) int32 { /
pReadr1 = ((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr + uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr((i^0x0001))*4)))*80)
}
}
- *(*int32)(unsafe.Pointer(pbEof)) = (crt.Bool32((*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(1)*4)))*80)).FpFd == uintptr(0)))
+ *(*int32)(unsafe.Pointer(pbEof)) = (libc.Bool32((*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaReadr+uintptr(*(*int32)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(pMerger)).FaTree + uintptr(1)*4)))*80)).FpFd == uintptr(0)))
}
return func() int32 {
@@ -70617,7 +73168,7 @@ func vdbeMergeEngineStep(tls *crt.TLS, pMerger uintptr, pbEof uintptr) int32 { /
}
// The main routine for background threads that write level-0 PMAs.
-func vdbeSorterFlushThread(tls *crt.TLS, pCtx uintptr) uintptr { /* sqlite3.c:95349:13: */
+func vdbeSorterFlushThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:95562:13: */
var pTask uintptr = pCtx
var rc int32 // Return code
@@ -70628,7 +73179,7 @@ func vdbeSorterFlushThread(tls *crt.TLS, pCtx uintptr) uintptr { /* sqlite3.c:95
// Flush the current contents of VdbeSorter.list to a new PMA, possibly
// using a background thread.
-func vdbeSorterFlushPMA(tls *crt.TLS, pSorter uintptr) int32 { /* sqlite3.c:95363:12: */
+func vdbeSorterFlushPMA(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:95576:12: */
var rc int32 = 0
var i int32
var pTask uintptr = uintptr(0) // Thread context used to create new PMA
@@ -70683,7 +73234,7 @@ func vdbeSorterFlushPMA(tls *crt.TLS, pSorter uintptr) int32 { /* sqlite3.c:9536
}
rc = vdbeSorterCreateThread(tls, pTask, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) uintptr
+ f func(*libc.TLS, uintptr) uintptr
}{vdbeSorterFlushThread})), pCtx)
}
}
@@ -70692,7 +73243,7 @@ func vdbeSorterFlushPMA(tls *crt.TLS, pSorter uintptr) int32 { /* sqlite3.c:9536
}
// Add a record to the sorter.
-func Xsqlite3VdbeSorterWrite(tls *crt.TLS, pCsr uintptr, pVal uintptr) int32 { /* sqlite3.c:95433:20: */
+func Xsqlite3VdbeSorterWrite(tls *libc.TLS, pCsr uintptr, pVal uintptr) int32 { /* sqlite3.c:95646:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70737,9 +73288,9 @@ func Xsqlite3VdbeSorterWrite(tls *crt.TLS, pCsr uintptr, pVal uintptr) int32 { /
nPMA = ((*Mem)(unsafe.Pointer(pVal)).Fn + Xsqlite3VarintLen(tls, uint64((*Mem)(unsafe.Pointer(pVal)).Fn)))
if (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize != 0 {
if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory != 0 {
- bFlush = (crt.Bool32(((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory != 0) && (((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory + nReq) > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize)))
+ bFlush = (libc.Bool32(((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory != 0) && (((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory + nReq) > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize)))
} else {
- bFlush = (crt.Bool32(((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize) ||
+ bFlush = (libc.Bool32(((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmxPmaSize) ||
(((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FszPMA > (*VdbeSorter)(unsafe.Pointer(pSorter)).FmnPmaSize) && (Xsqlite3HeapNearlyFull(tls) != 0))))
}
if bFlush != 0 {
@@ -70785,7 +73336,7 @@ func Xsqlite3VdbeSorterWrite(tls *crt.TLS, pCsr uintptr, pVal uintptr) int32 { /
}
pNew = ((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory + uintptr((*VdbeSorter)(unsafe.Pointer(pSorter)).FiMemory))
- *(*int32)(unsafe.Pointer(pSorter + 80 /* &.iMemory */)) += (((nReq) + 7) & ^int32(crt.Int32FromInt32(7)))
+ *(*int32)(unsafe.Pointer(pSorter + 80 /* &.iMemory */)) += (((nReq) + 7) & ^int32(libc.Int32FromInt32(7)))
if (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList != 0 {
*(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = (int32((int64(((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList)) - int64((*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FaMemory)) / 1))
}
@@ -70797,7 +73348,7 @@ func Xsqlite3VdbeSorterWrite(tls *crt.TLS, pCsr uintptr, pVal uintptr) int32 { /
*(*uintptr)(unsafe.Pointer(pNew + 8 /* &.u */)) = (*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList
}
- crt.Xmemcpy(tls, ((pNew) + uintptr(1)*16), (*Mem)(unsafe.Pointer(pVal)).Fz, uint64((*Mem)(unsafe.Pointer(pVal)).Fn))
+ libc.Xmemcpy(tls, ((pNew) + uintptr(1)*16), (*Mem)(unsafe.Pointer(pVal)).Fz, uint64((*Mem)(unsafe.Pointer(pVal)).Fn))
(*SorterRecord)(unsafe.Pointer(pNew)).FnVal = (*Mem)(unsafe.Pointer(pVal)).Fn
(*VdbeSorter)(unsafe.Pointer(pSorter)).Flist.FpList = pNew
@@ -70807,7 +73358,7 @@ func Xsqlite3VdbeSorterWrite(tls *crt.TLS, pCsr uintptr, pVal uintptr) int32 { /
// Read keys from pIncr->pMerger and populate pIncr->aFile[1]. The format
// of the data stored in aFile[1] is the same as that used by regular PMAs,
// except that the number-of-bytes varint is omitted from the start.
-func vdbeIncrPopulate(tls *crt.TLS, pIncr uintptr) int32 { /* sqlite3.c:95545:12: */
+func vdbeIncrPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95758:12: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -70853,7 +73404,7 @@ func vdbeIncrPopulate(tls *crt.TLS, pIncr uintptr) int32 { /* sqlite3.c:95545:12
// The main routine for background threads that populate aFile[1] of
// multi-threaded IncrMerger objects.
-func vdbeIncrPopulateThread(tls *crt.TLS, pCtx uintptr) uintptr { /* sqlite3.c:95587:13: */
+func vdbeIncrPopulateThread(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:95800:13: */
var pIncr uintptr = pCtx
var pRet uintptr = uintptr(int64(vdbeIncrPopulate(tls, pIncr)))
(*SortSubtask)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer(pIncr)).FpTask)).FbDone = 1
@@ -70861,11 +73412,11 @@ func vdbeIncrPopulateThread(tls *crt.TLS, pCtx uintptr) uintptr { /* sqlite3.c:9
}
// Launch a background thread to populate aFile[1] of pIncr.
-func vdbeIncrBgPopulate(tls *crt.TLS, pIncr uintptr) int32 { /* sqlite3.c:95597:12: */
+func vdbeIncrBgPopulate(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95810:12: */
var p uintptr = pIncr
return vdbeSorterCreateThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) uintptr
+ f func(*libc.TLS, uintptr) uintptr
}{vdbeIncrPopulateThread})), p)
}
@@ -70884,7 +73435,7 @@ func vdbeIncrBgPopulate(tls *crt.TLS, pIncr uintptr) int32 { /* sqlite3.c:95597:
// to populate the new aFile[1].
//
// SQLITE_OK is returned on success, or an SQLite error code otherwise.
-func vdbeIncrSwap(tls *crt.TLS, pIncr uintptr) int32 { /* sqlite3.c:95621:12: */
+func vdbeIncrSwap(tls *libc.TLS, pIncr uintptr) int32 { /* sqlite3.c:95834:12: */
var rc int32 = 0
if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 {
@@ -70918,9 +73469,9 @@ func vdbeIncrSwap(tls *crt.TLS, pIncr uintptr) int32 { /* sqlite3.c:95621:12: */
//
// If an OOM condition is encountered, return NULL. In this case free the
// pMerger argument before returning.
-func vdbeIncrMergerNew(tls *crt.TLS, pTask uintptr, pMerger uintptr, ppOut uintptr) int32 { /* sqlite3.c:95660:12: */
+func vdbeIncrMergerNew(tls *libc.TLS, pTask uintptr, pMerger uintptr, ppOut uintptr) int32 { /* sqlite3.c:95873:12: */
var rc int32 = 0
- var pIncr uintptr = crt.AssignPtrUintptr(ppOut, func() uintptr {
+ var pIncr uintptr = libc.AssignPtrUintptr(ppOut, func() uintptr {
if Xsqlite3FaultSim(tls, 100) != 0 {
return uintptr(0)
}
@@ -70944,7 +73495,7 @@ func vdbeIncrMergerNew(tls *crt.TLS, pTask uintptr, pMerger uintptr, ppOut uintp
}
// Set the "use-threads" flag on object pIncr.
-func vdbeIncrMergerSetThreads(tls *crt.TLS, pIncr uintptr) { /* sqlite3.c:95684:13: */
+func vdbeIncrMergerSetThreads(tls *libc.TLS, pIncr uintptr) { /* sqlite3.c:95897:13: */
(*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread = 1
*(*I64)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer(pIncr)).FpTask + 88 /* &.file2 */ + 8 /* &.iEof */)) -= (I64((*IncrMerger)(unsafe.Pointer(pIncr)).FmxSz))
}
@@ -70952,7 +73503,7 @@ func vdbeIncrMergerSetThreads(tls *crt.TLS, pIncr uintptr) { /* sqlite3.c:95684:
// Recompute pMerger->aTree[iOut] by comparing the next keys on the
// two PmaReaders that feed that entry. Neither of the PmaReaders
// are advanced. This routine merely does the comparison.
-func vdbeMergeEngineCompare(tls *crt.TLS, pMerger uintptr, iOut int32) { /* sqlite3.c:95697:13: */
+func vdbeMergeEngineCompare(tls *libc.TLS, pMerger uintptr, iOut int32) { /* sqlite3.c:95910:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -70982,7 +73533,7 @@ func vdbeMergeEngineCompare(tls *crt.TLS, pMerger uintptr, iOut int32) { /* sqli
*(*int32)(unsafe.Pointer(bp /* bCached */)) = 0
var res int32
// from vdbeSortSubtaskMain()
- res = (*(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer((pTask + 64 /* &.xCompare */))))(tls,
+ res = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer((pTask + 64 /* &.xCompare */))))(tls,
pTask, bp /* &bCached */, (*PmaReader)(unsafe.Pointer(p1)).FaKey, (*PmaReader)(unsafe.Pointer(p1)).FnKey, (*PmaReader)(unsafe.Pointer(p2)).FaKey, (*PmaReader)(unsafe.Pointer(p2)).FnKey)
if res <= 0 {
iRes = i1
@@ -71010,7 +73561,7 @@ func vdbeMergeEngineCompare(tls *crt.TLS, pMerger uintptr, iOut int32) { /* sqli
// to pMerger.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
-func vdbeMergeEngineInit(tls *crt.TLS, pTask uintptr, pMerger uintptr, eMode int32) int32 { /* sqlite3.c:95779:12: */
+func vdbeMergeEngineInit(tls *libc.TLS, pTask uintptr, pMerger uintptr, eMode int32) int32 { /* sqlite3.c:95992:12: */
var rc int32 = 0 // Return code
var i int32 // For looping over PmaReader objects
var nTree int32 // Number of subtrees to merge
@@ -71080,7 +73631,7 @@ func vdbeMergeEngineInit(tls *crt.TLS, pTask uintptr, pMerger uintptr, eMode int
// the current PmaReader set to point to the first key in its range.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
-func vdbePmaReaderIncrMergeInit(tls *crt.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:95855:12: */
+func vdbePmaReaderIncrMergeInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:96068:12: */
var rc int32 = 0
var pIncr uintptr = (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr
var pTask uintptr = (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask
@@ -71137,7 +73688,7 @@ func vdbePmaReaderIncrMergeInit(tls *crt.TLS, pReadr uintptr, eMode int32) int32
// The main routine for vdbePmaReaderIncrMergeInit() operations run in
// background threads.
-func vdbePmaReaderBgIncrInit(tls *crt.TLS, pCtx uintptr) uintptr { /* sqlite3.c:95922:13: */
+func vdbePmaReaderBgIncrInit(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:96135:13: */
var pReader uintptr = pCtx
var pRet uintptr = uintptr(int64(vdbePmaReaderIncrMergeInit(tls, pReader, 1)))
(*SortSubtask)(unsafe.Pointer((*IncrMerger)(unsafe.Pointer((*PmaReader)(unsafe.Pointer(pReader)).FpIncr)).FpTask)).FbDone = 1
@@ -71153,7 +73704,7 @@ func vdbePmaReaderBgIncrInit(tls *crt.TLS, pCtx uintptr) uintptr { /* sqlite3.c:
// then a background thread is launched to call vdbePmaReaderIncrMergeInit().
// Or, if the IncrMerger is single threaded, the same function is called
// using the current thread.
-func vdbePmaReaderIncrInit(tls *crt.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:95943:12: */
+func vdbePmaReaderIncrInit(tls *libc.TLS, pReadr uintptr, eMode int32) int32 { /* sqlite3.c:96156:12: */
var pIncr uintptr = (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr // Incremental merger
var rc int32 = 0 // Return code
if pIncr != 0 {
@@ -71161,7 +73712,7 @@ func vdbePmaReaderIncrInit(tls *crt.TLS, pReadr uintptr, eMode int32) int32 { /*
if (*IncrMerger)(unsafe.Pointer(pIncr)).FbUseThread != 0 {
var pCtx uintptr = pReadr
rc = vdbeSorterCreateThread(tls, (*IncrMerger)(unsafe.Pointer(pIncr)).FpTask, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) uintptr
+ f func(*libc.TLS, uintptr) uintptr
}{vdbePmaReaderBgIncrInit})), pCtx)
} else {
rc = vdbePmaReaderIncrMergeInit(tls, pReadr, eMode)
@@ -71180,7 +73731,7 @@ func vdbePmaReaderIncrInit(tls *crt.TLS, pReadr uintptr, eMode int32) int32 { /*
// set to the offset immediately following the last byte of the last
// PMA before returning. If an error does occur, then the final value of
// *piOffset is undefined.
-func vdbeMergeEngineLevel0(tls *crt.TLS, pTask uintptr, nPMA int32, piOffset uintptr, ppOut uintptr) int32 { /* sqlite3.c:95973:12: */
+func vdbeMergeEngineLevel0(tls *libc.TLS, pTask uintptr, nPMA int32, piOffset uintptr, ppOut uintptr) int32 { /* sqlite3.c:96186:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -71189,7 +73740,7 @@ func vdbeMergeEngineLevel0(tls *crt.TLS, pTask uintptr, nPMA int32, piOffset uin
var i int32
var rc int32 = 0
- *(*uintptr)(unsafe.Pointer(ppOut)) = crt.AssignUintptr(&pNew, vdbeMergeEngineNew(tls, nPMA))
+ *(*uintptr)(unsafe.Pointer(ppOut)) = libc.AssignUintptr(&pNew, vdbeMergeEngineNew(tls, nPMA))
if pNew == uintptr(0) {
rc = 7
}
@@ -71217,7 +73768,7 @@ func vdbeMergeEngineLevel0(tls *crt.TLS, pTask uintptr, nPMA int32, piOffset uin
// nPMA<=16 -> TreeDepth() == 0
// nPMA<=256 -> TreeDepth() == 1
// nPMA<=65536 -> TreeDepth() == 2
-func vdbeSorterTreeDepth(tls *crt.TLS, nPMA int32) int32 { /* sqlite3.c:96012:12: */
+func vdbeSorterTreeDepth(tls *libc.TLS, nPMA int32) int32 { /* sqlite3.c:96225:12: */
var nDepth int32 = 0
var nDiv I64 = int64(16)
for nDiv < I64(nPMA) {
@@ -71233,7 +73784,7 @@ func vdbeSorterTreeDepth(tls *crt.TLS, nPMA int32) int32 { /* sqlite3.c:96012:12
//
// If successful, SQLITE_OK is returned. If an error occurs, an SQLite error
// code is returned and pLeaf is freed.
-func vdbeSorterAddToTree(tls *crt.TLS, pTask uintptr, nDepth int32, iSeq int32, pRoot uintptr, pLeaf uintptr) int32 { /* sqlite3.c:96030:12: */
+func vdbeSorterAddToTree(tls *libc.TLS, pTask uintptr, nDepth int32, iSeq int32, pRoot uintptr, pLeaf uintptr) int32 { /* sqlite3.c:96243:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -71284,7 +73835,7 @@ func vdbeSorterAddToTree(tls *crt.TLS, pTask uintptr, nDepth int32, iSeq int32,
// MergeEngine object at the root of the tree before returning. Or, if an
// error occurs, an SQLite error code is returned and the final value
// of *ppOut is undefined.
-func vdbeSorterMergeTreeBuild(tls *crt.TLS, pSorter uintptr, ppOut uintptr) int32 { /* sqlite3.c:96086:12: */
+func vdbeSorterMergeTreeBuild(tls *libc.TLS, pSorter uintptr, ppOut uintptr) int32 { /* sqlite3.c:96299:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -71332,7 +73883,7 @@ func vdbeSorterMergeTreeBuild(tls *crt.TLS, pSorter uintptr, ppOut uintptr) int3
}()
rc = vdbeMergeEngineLevel0(tls, pTask, nReader, bp /* &iReadOff */, bp+16 /* &pMerger */)
if rc == 0 {
- rc = vdbeSorterAddToTree(tls, pTask, nDepth, crt.PostIncInt32(&iSeq, 1), *(*uintptr)(unsafe.Pointer(bp + 8 /* pRoot */)), *(*uintptr)(unsafe.Pointer(bp + 16 /* pMerger */)))
+ rc = vdbeSorterAddToTree(tls, pTask, nDepth, libc.PostIncInt32(&iSeq, 1), *(*uintptr)(unsafe.Pointer(bp + 8 /* pRoot */)), *(*uintptr)(unsafe.Pointer(bp + 16 /* pMerger */)))
}
}
}
@@ -71365,7 +73916,7 @@ func vdbeSorterMergeTreeBuild(tls *crt.TLS, pSorter uintptr, ppOut uintptr) int3
// all records stored in the sorter.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
-func vdbeSorterSetupMerge(tls *crt.TLS, pSorter uintptr) int32 { /* sqlite3.c:96165:12: */
+func vdbeSorterSetupMerge(tls *libc.TLS, pSorter uintptr) int32 { /* sqlite3.c:96378:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -71400,7 +73951,7 @@ func vdbeSorterSetupMerge(tls *crt.TLS, pSorter uintptr) int32 { /* sqlite3.c:96
vdbeIncrMergerSetThreads(tls, (*PmaReader)(unsafe.Pointer(pReadr)).FpIncr)
for iTask = 0; iTask < (int32((*VdbeSorter)(unsafe.Pointer(pSorter)).FnTask) - 1); iTask++ {
var pIncr uintptr
- if crt.AssignUintptr(&pIncr, (*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pMain */)))).FaReadr+uintptr(iTask)*80)).FpIncr) != 0 {
+ if libc.AssignUintptr(&pIncr, (*PmaReader)(unsafe.Pointer((*MergeEngine)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pMain */)))).FaReadr+uintptr(iTask)*80)).FpIncr) != 0 {
vdbeIncrMergerSetThreads(tls, pIncr)
}
}
@@ -71439,7 +73990,7 @@ func vdbeSorterSetupMerge(tls *crt.TLS, pSorter uintptr) int32 { /* sqlite3.c:96
// Once the sorter has been populated by calls to sqlite3VdbeSorterWrite,
// this function is called to prepare for iterating through the records
// in sorted order.
-func Xsqlite3VdbeSorterRewind(tls *crt.TLS, pCsr uintptr, pbEof uintptr) int32 { /* sqlite3.c:96247:20: */
+func Xsqlite3VdbeSorterRewind(tls *libc.TLS, pCsr uintptr, pbEof uintptr) int32 { /* sqlite3.c:96460:20: */
var pSorter uintptr
var rc int32 = 0 // Return code
@@ -71484,7 +74035,7 @@ func Xsqlite3VdbeSorterRewind(tls *crt.TLS, pCsr uintptr, pbEof uintptr) int32 {
// SQLITE_OK success
// SQLITE_DONE end of data
// otherwise some kind of error.
-func Xsqlite3VdbeSorterNext(tls *crt.TLS, db uintptr, pCsr uintptr) int32 { /* sqlite3.c:96299:20: */
+func Xsqlite3VdbeSorterNext(tls *libc.TLS, db uintptr, pCsr uintptr) int32 { /* sqlite3.c:96512:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -71526,7 +74077,7 @@ func Xsqlite3VdbeSorterNext(tls *crt.TLS, db uintptr, pCsr uintptr) int32 { /* s
// Return a pointer to a buffer owned by the sorter that contains the
// current key.
-func vdbeSorterRowkey(tls *crt.TLS, pSorter uintptr, pnKey uintptr) uintptr { /* sqlite3.c:96337:13: */
+func vdbeSorterRowkey(tls *libc.TLS, pSorter uintptr, pnKey uintptr) uintptr { /* sqlite3.c:96550:13: */
var pKey uintptr
if (*VdbeSorter)(unsafe.Pointer(pSorter)).FbUsePMA != 0 {
var pReader uintptr
@@ -71545,7 +74096,7 @@ func vdbeSorterRowkey(tls *crt.TLS, pSorter uintptr, pnKey uintptr) uintptr { /*
}
// Copy the current sorter key into the memory cell pOut.
-func Xsqlite3VdbeSorterRowkey(tls *crt.TLS, pCsr uintptr, pOut uintptr) int32 { /* sqlite3.c:96364:20: */
+func Xsqlite3VdbeSorterRowkey(tls *libc.TLS, pCsr uintptr, pOut uintptr) int32 { /* sqlite3.c:96577:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -71560,8 +74111,8 @@ func Xsqlite3VdbeSorterRowkey(tls *crt.TLS, pCsr uintptr, pOut uintptr) int32 {
return 7
}
(*Mem)(unsafe.Pointer(pOut)).Fn = *(*int32)(unsafe.Pointer(bp /* nKey */))
- (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(crt.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0010))
- crt.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pOut)).Fz, pKey, uint64(*(*int32)(unsafe.Pointer(bp /* nKey */))))
+ (*Mem)(unsafe.Pointer(pOut)).Fflags = (U16((int32((*Mem)(unsafe.Pointer((pOut))).Fflags) & ^int32(libc.Int32FromInt32((0xc1bf | 0x4000)))) | 0x0010))
+ libc.Xmemcpy(tls, (*Mem)(unsafe.Pointer(pOut)).Fz, pKey, uint64(*(*int32)(unsafe.Pointer(bp /* nKey */))))
return 0
}
@@ -71580,7 +74131,7 @@ func Xsqlite3VdbeSorterRowkey(tls *crt.TLS, pCsr uintptr, pOut uintptr) int32 {
//
// This routine forms the core of the OP_SorterCompare opcode, which in
// turn is used to verify uniqueness when constructing a UNIQUE INDEX.
-func Xsqlite3VdbeSorterCompare(tls *crt.TLS, pCsr uintptr, pVal uintptr, nKeyCol int32, pRes uintptr) int32 { /* sqlite3.c:96397:20: */
+func Xsqlite3VdbeSorterCompare(tls *libc.TLS, pCsr uintptr, pVal uintptr, nKeyCol int32, pRes uintptr) int32 { /* sqlite3.c:96610:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -71596,7 +74147,7 @@ func Xsqlite3VdbeSorterCompare(tls *crt.TLS, pCsr uintptr, pVal uintptr, nKeyCol
r2 = (*VdbeSorter)(unsafe.Pointer(pSorter)).FpUnpacked
pKeyInfo = (*VdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo
if r2 == uintptr(0) {
- r2 = crt.AssignPtrUintptr(pSorter+48 /* &.pUnpacked */, Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo))
+ r2 = libc.AssignPtrUintptr(pSorter+48 /* &.pUnpacked */, Xsqlite3VdbeAllocUnpackedRecord(tls, pKeyInfo))
if r2 == uintptr(0) {
return 7
}
@@ -71661,7 +74212,7 @@ type bytecodevtab = struct {
// #include "vdbeInt.h"
// An instance of the bytecode() table-valued function.
-type Bytecodevtab = bytecodevtab /* sqlite3.c:96456:29 */
+type Bytecodevtab = bytecodevtab /* sqlite3.c:96669:29 */
// A cursor for scanning through the bytecode
type bytecodevtab_cursor = struct {
@@ -71680,24 +74231,24 @@ type bytecodevtab_cursor = struct {
}
// A cursor for scanning through the bytecode
-type Bytecodevtab_cursor = bytecodevtab_cursor /* sqlite3.c:96465:36 */
+type Bytecodevtab_cursor = bytecodevtab_cursor /* sqlite3.c:96678:36 */
// Create a new bytecode() table-valued function.
-func bytecodevtabConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:96484:12: */
+func bytecodevtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:96697:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
var pNew uintptr
var rc int32
- var isTabUsed int32 = (crt.Bool32(pAux != uintptr(0)))
+ var isTabUsed int32 = (libc.Bool32(pAux != uintptr(0)))
*(*[2]uintptr)(unsafe.Pointer(bp /* azSchema */)) = [2]uintptr{
// bytecode() schema
- ts + 5826, /* "CREATE TABLE x(a..." */
+ ts + 8024, /* "CREATE TABLE x(a..." */
// Tables_used() schema
- ts + 5938, /* "CREATE TABLE x(t..." */
+ ts + 8136, /* "CREATE TABLE x(t..." */
}
rc = Xsqlite3_declare_vtab(tls, db, *(*uintptr)(unsafe.Pointer(bp /* &azSchema[0] */ + uintptr(isTabUsed)*8)))
@@ -71707,7 +74258,7 @@ func bytecodevtabConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, arg
if pNew == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Bytecodevtab{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Bytecodevtab{})))
(*Bytecodevtab)(unsafe.Pointer(pNew)).Fdb = db
(*Bytecodevtab)(unsafe.Pointer(pNew)).FbTablesUsed = (isTabUsed * 2)
}
@@ -71715,28 +74266,28 @@ func bytecodevtabConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, arg
}
// This method is the destructor for bytecodevtab objects.
-func bytecodevtabDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* sqlite3.c:96535:12: */
+func bytecodevtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:96748:12: */
var p uintptr = pVtab
Xsqlite3_free(tls, p)
return 0
}
// Constructor for a new bytecodevtab_cursor object.
-func bytecodevtabOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:96544:12: */
+func bytecodevtabOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:96757:12: */
var pVTab uintptr = p
var pCur uintptr
pCur = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Bytecodevtab_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(Bytecodevtab_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(Bytecodevtab_cursor{})))
Xsqlite3VdbeMemInit(tls, (pCur + 72 /* &.sub */), (*Bytecodevtab)(unsafe.Pointer(pVTab)).Fdb, uint16(1))
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
return 0
}
// Clear all internal content from a bytecodevtab cursor.
-func bytecodevtabCursorClear(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:96558:13: */
+func bytecodevtabCursorClear(tls *libc.TLS, pCur uintptr) { /* sqlite3.c:96771:13: */
Xsqlite3_free(tls, (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzP4)
(*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzP4 = uintptr(0)
Xsqlite3VdbeMemRelease(tls, (pCur + 72 /* &.sub */))
@@ -71752,7 +74303,7 @@ func bytecodevtabCursorClear(tls *crt.TLS, pCur uintptr) { /* sqlite3.c:96558:13
}
// Destructor for a bytecodevtab_cursor.
-func bytecodevtabClose(tls *crt.TLS, cur uintptr) int32 { /* sqlite3.c:96576:12: */
+func bytecodevtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:96789:12: */
var pCur uintptr = cur
bytecodevtabCursorClear(tls, pCur)
Xsqlite3_free(tls, pCur)
@@ -71760,7 +74311,7 @@ func bytecodevtabClose(tls *crt.TLS, cur uintptr) int32 { /* sqlite3.c:96576:12:
}
// Advance a bytecodevtab_cursor to its next row of output.
-func bytecodevtabNext(tls *crt.TLS, cur uintptr) int32 { /* sqlite3.c:96587:12: */
+func bytecodevtabNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:96800:12: */
var pCur uintptr = cur
var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
var rc int32
@@ -71794,17 +74345,17 @@ func bytecodevtabNext(tls *crt.TLS, cur uintptr) int32 { /* sqlite3.c:96587:12:
// Return TRUE if the cursor has been moved off of the last
// row of output.
-func bytecodevtabEof(tls *crt.TLS, cur uintptr) int32 { /* sqlite3.c:96618:12: */
+func bytecodevtabEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:96831:12: */
var pCur uintptr = cur
- return (crt.Bool32((*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FaOp == uintptr(0)))
+ return (libc.Bool32((*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FaOp == uintptr(0)))
}
// Return values of columns for the row at which the bytecodevtab_cursor
// is currently pointing.
-func bytecodevtabColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:96627:12: */
+func bytecodevtabColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:96840:12: */
var pCur uintptr = cur
var pVTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
- var pOp uintptr = ((*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FaOp + uintptr((*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FiAddr)*24)
+ var pOp uintptr = ((*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FaOp + uintptr((*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FiAddr)*32)
if (*Bytecodevtab)(unsafe.Pointer(pVTab)).FbTablesUsed != 0 {
if i == 4 {
i = 8
@@ -71813,7 +74364,7 @@ func bytecodevtabColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 {
var pSchema uintptr
var k uintptr
var iDb int32 = (*Op)(unsafe.Pointer(pOp)).Fp3
- var iRoot int32 = (*Op)(unsafe.Pointer(pOp)).Fp2
+ var iRoot Pgno = Pgno((*Op)(unsafe.Pointer(pOp)).Fp2)
var db uintptr = (*Bytecodevtab)(unsafe.Pointer(pVTab)).Fdb
pSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
(*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
@@ -71821,7 +74372,7 @@ func bytecodevtabColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 {
var pTab uintptr = (*HashElem)(unsafe.Pointer(k)).Fdata
if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) && ((*Table)(unsafe.Pointer(pTab)).Ftnum == iRoot) {
(*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzName = (*Table)(unsafe.Pointer(pTab)).FzName
- (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzType = ts + 6019 /* "table" */
+ (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzType = ts + 8217 /* "table" */
break
}
}
@@ -71830,7 +74381,7 @@ func bytecodevtabColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 {
var pIdx uintptr = (*HashElem)(unsafe.Pointer(k)).Fdata
if (*Index)(unsafe.Pointer(pIdx)).Ftnum == iRoot {
(*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzName = (*Index)(unsafe.Pointer(pIdx)).FzName
- (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzType = ts + 6025 /* "index" */
+ (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzType = ts + 8223 /* "index" */
}
}
}
@@ -71864,6 +74415,8 @@ func bytecodevtabColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 {
if i == 5 {
Xsqlite3_result_text(tls, ctx, (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzP4, -1, uintptr(0))
} else {
+ var zCom uintptr = Xsqlite3VdbeDisplayComment(tls, (*Bytecodevtab)(unsafe.Pointer(pVTab)).Fdb, pOp, (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzP4)
+ Xsqlite3_result_text(tls, ctx, zCom, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
}
break
case 6: // p5
@@ -71875,10 +74428,10 @@ func bytecodevtabColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 {
if (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FiRowid == ((*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FiAddr + 1) {
break
- } else if *(*uintptr)(unsafe.Pointer(aOp + uintptr(0)*24 + 16 /* &.p4 */)) != uintptr(0) {
- Xsqlite3_result_text(tls, ctx, (*(*uintptr)(unsafe.Pointer(aOp + uintptr(0)*24 + 16 /* &.p4 */)) + uintptr(3)), -1, uintptr(0))
+ } else if *(*uintptr)(unsafe.Pointer(aOp + uintptr(0)*32 + 16 /* &.p4 */)) != uintptr(0) {
+ Xsqlite3_result_text(tls, ctx, (*(*uintptr)(unsafe.Pointer(aOp + uintptr(0)*32 + 16 /* &.p4 */)) + uintptr(3)), -1, uintptr(0))
} else {
- Xsqlite3_result_text(tls, ctx, ts+6031 /* "(FK)" */, 4, uintptr(0))
+ Xsqlite3_result_text(tls, ctx, ts+8229 /* "(FK)" */, 4, uintptr(0))
}
break
}
@@ -71892,7 +74445,7 @@ func bytecodevtabColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 {
Xsqlite3_result_text(tls, ctx, (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FzName, -1, uintptr(0))
break
case 13: // tables_used.wr
- Xsqlite3_result_int(tls, ctx, (crt.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == 97)))
+ Xsqlite3_result_int(tls, ctx, (libc.Bool32(int32((*Op)(unsafe.Pointer(pOp)).Fopcode) == 97)))
break
}
return 0
@@ -71900,7 +74453,7 @@ func bytecodevtabColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 {
// Return the rowid for the current row. In this implementation, the
// rowid is the same as the output value.
-func bytecodevtabRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:96735:12: */
+func bytecodevtabRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:96948:12: */
var pCur uintptr = cur
*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Sqlite_int64((*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FiRowid)
return 0
@@ -71910,7 +74463,7 @@ func bytecodevtabRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* sql
//
// idxNum==0 means show all subprograms
// idxNum==1 means show only the main bytecode and omit subprograms.
-func bytecodevtabFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:96747:12: */
+func bytecodevtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:96960:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -71921,7 +74474,7 @@ func bytecodevtabFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr
bytecodevtabCursorClear(tls, pCur)
(*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FiRowid = 0
(*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FiAddr = 0
- (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FshowSubprograms = (crt.Bool32(idxNum == 0))
+ (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FshowSubprograms = (libc.Bool32(idxNum == 0))
if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) == 3 {
var zSql uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
@@ -71932,16 +74485,16 @@ func bytecodevtabFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr
(*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FneedFinalize = 1
}
} else {
- (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FpStmt = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), ts+6036 /* "stmt-pointer" */)
+ (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FpStmt = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), ts+8234 /* "stmt-pointer" */)
}
if (*Bytecodevtab_cursor)(unsafe.Pointer(pCur)).FpStmt == uintptr(0) {
(*Bytecodevtab)(unsafe.Pointer(pVTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
- ts+6049, /* "argument to %s()..." */
- crt.VaList(bp, func() uintptr {
+ ts+8247, /* "argument to %s()..." */
+ libc.VaList(bp, func() uintptr {
if (*Bytecodevtab)(unsafe.Pointer(pVTab)).FbTablesUsed != 0 {
- return ts + 6095 /* "tables_used" */
+ return ts + 8293 /* "tables_used" */
}
- return ts + 6107 /* "bytecode" */
+ return ts + 8305 /* "bytecode" */
}()))
rc = 1
} else {
@@ -71953,7 +74506,7 @@ func bytecodevtabFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr
// We must have a single stmt=? constraint that will be passed through
// into the xFilter method. If there is no valid stmt=? constraint,
// then return an SQLITE_CONSTRAINT error.
-func bytecodevtabBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:96789:12: */
+func bytecodevtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:97002:12: */
var i int32
var rc int32 = 19
var p uintptr
@@ -72025,17 +74578,17 @@ var bytecodevtabModule = Sqlite3_module{FiVersion:
/* xRelease */ uintptr(0), FxRollbackTo:
/* xRollbackTo */ uintptr(0), FxShadowName:
/* xShadowName */ uintptr(0),
-} /* sqlite3.c:96820:23 */
+} /* sqlite3.c:97033:23 */
-func Xsqlite3VdbeBytecodeVtabInit(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:96848:20: */
+func Xsqlite3VdbeBytecodeVtabInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:97061:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = db
var rc int32
- rc = Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+6107 /* "bytecode" */, uintptr(unsafe.Pointer(&bytecodevtabModule)), uintptr(0))
+ rc = Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+8305 /* "bytecode" */, uintptr(unsafe.Pointer(&bytecodevtabModule)), uintptr(0))
if rc == 0 {
- rc = Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+6095 /* "tables_used" */, uintptr(unsafe.Pointer(&bytecodevtabModule)), bp /* &db */)
+ rc = Xsqlite3_create_module(tls, *(*uintptr)(unsafe.Pointer(bp /* db */)), ts+8293 /* "tables_used" */, uintptr(unsafe.Pointer(&bytecodevtabModule)), bp /* &db */)
}
return rc
}
@@ -72109,23 +74662,23 @@ type MemJournal1 = struct {
// #include "sqliteInt.h"
// Forward references to internal structures
-type MemJournal = MemJournal1 /* sqlite3.c:96890:27 */
+type MemJournal = MemJournal1 /* sqlite3.c:97103:27 */
type FilePoint1 = struct {
FiOffset Sqlite3_int64
FpChunk uintptr
}
-type FilePoint = FilePoint1 /* sqlite3.c:96891:26 */
+type FilePoint = FilePoint1 /* sqlite3.c:97104:26 */
type FileChunk1 = struct {
FpNext uintptr
FzChunk [8]U8
}
-type FileChunk = FileChunk1 /* sqlite3.c:96892:26 */
+type FileChunk = FileChunk1 /* sqlite3.c:97105:26 */
// Read data from the in-memory journal file. This is the implementation
// of the sqlite3_vfs.xRead method.
-func memjrnlRead(tls *crt.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:96948:12: */
+func memjrnlRead(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:97161:12: */
var p uintptr = pJfd
var zOut uintptr = zBuf
var nRead int32 = iAmt
@@ -72146,7 +74699,7 @@ func memjrnlRead(tls *crt.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sql
}
iChunkOffset = (int32(iOfst % Sqlite_int64((*MemJournal)(unsafe.Pointer(p)).FnChunkSize)))
- for ok := true; ok; ok = (((nRead >= 0) && ((crt.AssignUintptr(&pChunk, (*FileChunk)(unsafe.Pointer(pChunk)).FpNext)) != uintptr(0))) && (nRead > 0)) {
+ for ok := true; ok; ok = (((nRead >= 0) && ((libc.AssignUintptr(&pChunk, (*FileChunk)(unsafe.Pointer(pChunk)).FpNext)) != uintptr(0))) && (nRead > 0)) {
var iSpace int32 = ((*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset)
var nCopy int32 = func() int32 {
if (nRead) < ((*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset) {
@@ -72154,7 +74707,7 @@ func memjrnlRead(tls *crt.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sql
}
return ((*MemJournal)(unsafe.Pointer(p)).FnChunkSize - iChunkOffset)
}()
- crt.Xmemcpy(tls, zOut, (pChunk + 8 /* &.zChunk */ + uintptr(iChunkOffset)), uint64(nCopy))
+ libc.Xmemcpy(tls, zOut, (pChunk + 8 /* &.zChunk */ + uintptr(iChunkOffset)), uint64(nCopy))
zOut += uintptr(nCopy)
nRead = nRead - (iSpace)
iChunkOffset = 0
@@ -72171,7 +74724,7 @@ func memjrnlRead(tls *crt.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sql
}
// Free the list of FileChunk structures headed at MemJournal.pFirst.
-func memjrnlFreeChunks(tls *crt.TLS, p uintptr) { /* sqlite3.c:96995:13: */
+func memjrnlFreeChunks(tls *libc.TLS, p uintptr) { /* sqlite3.c:97208:13: */
var pIter uintptr
var pNext uintptr
for pIter = (*MemJournal)(unsafe.Pointer(p)).FpFirst; pIter != 0; pIter = pNext {
@@ -72182,7 +74735,7 @@ func memjrnlFreeChunks(tls *crt.TLS, p uintptr) { /* sqlite3.c:96995:13: */
}
// Flush the contents of memory to a real file on disk.
-func memjrnlCreateFile(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:97008:12: */
+func memjrnlCreateFile(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:97221:12: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -72190,7 +74743,7 @@ func memjrnlCreateFile(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:97008:12: *
var pReal uintptr = p
*(*MemJournal)(unsafe.Pointer(bp /* copy */)) = *(*MemJournal)(unsafe.Pointer(p))
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(MemJournal{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(MemJournal{})))
rc = Xsqlite3OsOpen(tls, (*MemJournal)(unsafe.Pointer(bp /* &copy */)).FpVfs, (*MemJournal)(unsafe.Pointer(bp /* &copy */)).FzJournal, pReal, (*MemJournal)(unsafe.Pointer(bp /* &copy */)).Fflags, uintptr(0))
if rc == 0 {
var nChunk int32 = (*MemJournal)(unsafe.Pointer(bp /* &copy */)).FnChunkSize
@@ -72223,7 +74776,7 @@ func memjrnlCreateFile(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:97008:12: *
}
// Write data to the file.
-func memjrnlWrite(tls *crt.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:97047:12: */
+func memjrnlWrite(tls *libc.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:97260:12: */
var p uintptr = pJfd
var nWrite int32 = iAmt
var zWrite uintptr = zBuf
@@ -72237,11 +74790,11 @@ func memjrnlWrite(tls *crt.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sq
}
return rc
} else {
- /* An in-memory journal file should only ever be appended to. Random
- ** access writes are not required. The only exception to this is when
- ** the in-memory journal is being used by a connection using the
- ** atomic-write optimization. In this case the first 28 bytes of the
- ** journal file may be written as part of committing the transaction. */
+ // An in-memory journal file should only ever be appended to. Random
+ // access writes are not required. The only exception to this is when
+ // the in-memory journal is being used by a connection using the
+ // atomic-write optimization. In this case the first 28 bytes of the
+ // journal file may be written as part of committing the transaction.
{
for nWrite > 0 {
@@ -72271,7 +74824,7 @@ func memjrnlWrite(tls *crt.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sq
(*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk = pNew
}
- crt.Xmemcpy(tls, ((*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk + 8 /* &.zChunk */ + uintptr(iChunkOffset)), zWrite, uint64(iSpace))
+ libc.Xmemcpy(tls, ((*MemJournal)(unsafe.Pointer(p)).Fendpoint.FpChunk + 8 /* &.zChunk */ + uintptr(iChunkOffset)), zWrite, uint64(iSpace))
zWrite += uintptr(iSpace)
nWrite = nWrite - (iSpace)
*(*Sqlite3_int64)(unsafe.Pointer(p + 32 /* &.endpoint */ /* &.iOffset */)) += (Sqlite3_int64(iSpace))
@@ -72288,7 +74841,7 @@ func memjrnlWrite(tls *crt.TLS, pJfd uintptr, zBuf uintptr, iAmt int32, iOfst Sq
// If the journal file is already on disk, truncate it there. Or, if it
// is still in main memory but is being truncated to zero bytes in size,
// ignore
-func memjrnlTruncate(tls *crt.TLS, pJfd uintptr, size Sqlite_int64) int32 { /* sqlite3.c:97126:12: */
+func memjrnlTruncate(tls *libc.TLS, pJfd uintptr, size Sqlite_int64) int32 { /* sqlite3.c:97339:12: */
var p uintptr = pJfd
if size == int64(0) {
memjrnlFreeChunks(tls, p)
@@ -72302,7 +74855,7 @@ func memjrnlTruncate(tls *crt.TLS, pJfd uintptr, size Sqlite_int64) int32 { /* s
}
// Close the file.
-func memjrnlClose(tls *crt.TLS, pJfd uintptr) int32 { /* sqlite3.c:97142:12: */
+func memjrnlClose(tls *libc.TLS, pJfd uintptr) int32 { /* sqlite3.c:97355:12: */
var p uintptr = pJfd
memjrnlFreeChunks(tls, p)
return 0
@@ -72312,14 +74865,14 @@ func memjrnlClose(tls *crt.TLS, pJfd uintptr) int32 { /* sqlite3.c:97142:12: */
//
// If the real file has been created, call its xSync method. Otherwise,
// syncing an in-memory journal is a no-op.
-func memjrnlSync(tls *crt.TLS, pJfd uintptr, flags int32) int32 { /* sqlite3.c:97154:12: */
+func memjrnlSync(tls *libc.TLS, pJfd uintptr, flags int32) int32 { /* sqlite3.c:97367:12: */
_ = pJfd
_ = flags
return 0
}
// Query the size of the file in bytes.
-func memjrnlFileSize(tls *crt.TLS, pJfd uintptr, pSize uintptr) int32 { /* sqlite3.c:97162:12: */
+func memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) int32 { /* sqlite3.c:97375:12: */
var p uintptr = pJfd
*(*Sqlite_int64)(unsafe.Pointer(pSize)) = (*MemJournal)(unsafe.Pointer(p)).Fendpoint.FiOffset
return 0
@@ -72345,7 +74898,7 @@ uintptr(0), FxShmUnmap:// xShmBarrier
uintptr(0), FxFetch:// xShmUnmap
uintptr(0), FxUnfetch:// xFetch
uintptr(0), // xUnfetch
-} /* sqlite3.c:97171:40 */
+} /* sqlite3.c:97384:40 */
// Open a journal file.
//
@@ -72357,14 +74910,14 @@ uintptr(0), // xUnfetch
// but may be flushed to disk later on. In this case the journal file is
// flushed to disk either when it grows larger than nSpill bytes in size,
// or when sqlite3JournalCreate() is called.
-func Xsqlite3JournalOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pJfd uintptr, flags int32, nSpill int32) int32 { /* sqlite3.c:97205:20: */
+func Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintptr, flags int32, nSpill int32) int32 { /* sqlite3.c:97418:20: */
var p uintptr = pJfd
// Zero the file-handle object. If nSpill was passed zero, initialize
// it using the sqlite3OsOpen() function of the underlying VFS. In this
// case none of the code in this module is executed as a result of calls
// made on the journal file-handle.
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(MemJournal{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(MemJournal{})))
if nSpill == 0 {
return Xsqlite3OsOpen(tls, pVfs, zName, pJfd, flags, uintptr(0))
}
@@ -72375,7 +74928,7 @@ func Xsqlite3JournalOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pJfd uintptr
(*MemJournal)(unsafe.Pointer(p)).FnChunkSize = (int32((uint64(8 + 1024)) - uint64(unsafe.Sizeof(FileChunk{}))))
}
- (*MemJournal)(unsafe.Pointer(p)).FpMethod = uintptr(unsafe.Pointer(&sMemJournalMethods))
+ (*Sqlite3_file)(unsafe.Pointer(pJfd)).FpMethods = uintptr(unsafe.Pointer(&sMemJournalMethods))
(*MemJournal)(unsafe.Pointer(p)).FnSpill = nSpill
(*MemJournal)(unsafe.Pointer(p)).Fflags = flags
(*MemJournal)(unsafe.Pointer(p)).FzJournal = zName
@@ -72384,20 +74937,20 @@ func Xsqlite3JournalOpen(tls *crt.TLS, pVfs uintptr, zName uintptr, pJfd uintptr
}
// Open an in-memory journal file.
-func Xsqlite3MemJournalOpen(tls *crt.TLS, pJfd uintptr) { /* sqlite3.c:97241:21: */
+func Xsqlite3MemJournalOpen(tls *libc.TLS, pJfd uintptr) { /* sqlite3.c:97454:21: */
Xsqlite3JournalOpen(tls, uintptr(0), uintptr(0), pJfd, 0, -1)
}
// The file-handle passed as the only argument is open on a journal file.
// Return true if this "journal file" is currently stored in heap memory,
// or false otherwise.
-func Xsqlite3JournalIsInMemory(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:97280:20: */
- return (crt.Bool32((*Sqlite3_file)(unsafe.Pointer(p)).FpMethods == uintptr(unsafe.Pointer(&sMemJournalMethods))))
+func Xsqlite3JournalIsInMemory(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:97493:20: */
+ return (libc.Bool32((*Sqlite3_file)(unsafe.Pointer(p)).FpMethods == uintptr(unsafe.Pointer(&sMemJournalMethods))))
}
// Return the number of bytes required to store a JournalFile that uses vfs
// pVfs to create the underlying on-disk files.
-func Xsqlite3JournalSize(tls *crt.TLS, pVfs uintptr) int32 { /* sqlite3.c:97288:20: */
+func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32 { /* sqlite3.c:97501:20: */
return func() int32 {
if ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile) > (int32(unsafe.Sizeof(MemJournal{}))) {
return (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile
@@ -72426,7 +74979,7 @@ func Xsqlite3JournalSize(tls *crt.TLS, pVfs uintptr) int32 { /* sqlite3.c:97288:
// Walk all expressions linked into the list of Window objects passed
// as the second argument.
-func walkWindowList(tls *crt.TLS, pWalker uintptr, pList uintptr) int32 { /* sqlite3.c:97318:12: */
+func walkWindowList(tls *libc.TLS, pWalker uintptr, pList uintptr) int32 { /* sqlite3.c:97531:12: */
var pWin uintptr
for pWin = pList; pWin != 0; pWin = (*Window)(unsafe.Pointer(pWin)).FpNextWin {
var rc int32
@@ -72476,11 +75029,11 @@ func walkWindowList(tls *crt.TLS, pWalker uintptr, pList uintptr) int32 { /* sql
//
// The return value from this routine is WRC_Abort to abandon the tree walk
// and WRC_Continue to continue.
-func walkExpr(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:97361:28: */
+func walkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:97574:28: */
var rc int32
for 1 != 0 {
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pWalker + 8 /* &.xExprCallback */))))(tls, pWalker, pExpr)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pWalker + 8 /* &.xExprCallback */))))(tls, pWalker, pExpr)
if rc != 0 {
return (rc & 2)
}
@@ -72515,7 +75068,7 @@ func walkExpr(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c
}
return 0
}
-func Xsqlite3WalkExpr(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:97393:20: */
+func Xsqlite3WalkExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:97606:20: */
if pExpr != 0 {
return walkExpr(tls, pWalker, pExpr)
}
@@ -72524,7 +75077,7 @@ func Xsqlite3WalkExpr(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
// Call sqlite3WalkExpr() for every expression in list p or until
// an abort request is seen.
-func Xsqlite3WalkExprList(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97401:20: */
+func Xsqlite3WalkExprList(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97614:20: */
var i int32
var pItem uintptr
if p != 0 {
@@ -72554,7 +75107,7 @@ func Xsqlite3WalkExprList(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* s
// not invoke the SELECT callback on p, but do (of course) invoke
// any expr callbacks and SELECT callbacks that come from subqueries.
// Return WRC_Abort or WRC_Continue.
-func Xsqlite3WalkSelectExpr(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97418:20: */
+func Xsqlite3WalkSelectExpr(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97631:20: */
if Xsqlite3WalkExprList(tls, pWalker, (*Select)(unsafe.Pointer(p)).FpEList) != 0 {
return 2
}
@@ -72590,7 +75143,7 @@ func Xsqlite3WalkSelectExpr(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /*
// callback on p, but do invoke it on each FROM clause subquery
// and on any subqueries further down in the tree. Return
// WRC_Abort or WRC_Continue;
-func Xsqlite3WalkSelectFrom(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97446:20: */
+func Xsqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97659:20: */
var pSrc uintptr
var i int32
var pItem uintptr
@@ -72638,7 +75191,7 @@ func Xsqlite3WalkSelectFrom(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /*
//
// If the Walker does not have an xSelectCallback() then this routine
// is a no-op returning WRC_Continue.
-func Xsqlite3WalkSelect(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97484:20: */
+func Xsqlite3WalkSelect(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:97697:20: */
var rc int32
if p == uintptr(0) {
return 0
@@ -72647,7 +75200,7 @@ func Xsqlite3WalkSelect(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sql
return 0
}
for ok := true; ok; ok = (p != uintptr(0)) {
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pWalker + 16 /* &.xSelectCallback */))))(tls, pWalker, p)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pWalker + 16 /* &.xSelectCallback */))))(tls, pWalker, p)
if rc != 0 {
return (rc & 2)
}
@@ -72656,7 +75209,7 @@ func Xsqlite3WalkSelect(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sql
return 2
}
if (*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback2 != 0 {
- (*(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer((pWalker + 24 /* &.xSelectCallback2 */))))(tls, pWalker, p)
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pWalker + 24 /* &.xSelectCallback2 */))))(tls, pWalker, p)
}
p = (*Select)(unsafe.Pointer(p)).FpPrior
}
@@ -72665,12 +75218,12 @@ func Xsqlite3WalkSelect(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sql
// Increase the walkerDepth when entering a subquery, and
// descrease when leaving the subquery.
-func Xsqlite3WalkerDepthIncrease(tls *crt.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:97507:20: */
+func Xsqlite3WalkerDepthIncrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:97720:20: */
_ = pSelect
(*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth++
return 0
}
-func Xsqlite3WalkerDepthDecrease(tls *crt.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:97512:21: */
+func Xsqlite3WalkerDepthDecrease(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:97725:21: */
_ = pSelect
(*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth--
}
@@ -72682,7 +75235,7 @@ func Xsqlite3WalkerDepthDecrease(tls *crt.TLS, pWalker uintptr, pSelect uintptr)
// when this routine is used for Walker.xExprCallback then
// Walker.xSelectCallback is set to do something useful for every
// subquery in the parser tree.
-func Xsqlite3ExprWalkNoop(tls *crt.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:97527:20: */
+func Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:97740:20: */
_ = NotUsed
_ = NotUsed2
return 0
@@ -72690,7 +75243,7 @@ func Xsqlite3ExprWalkNoop(tls *crt.TLS, NotUsed uintptr, NotUsed2 uintptr) int32
// No-op routine for the parse-tree walker for SELECT statements.
// subquery in the parser tree.
-func Xsqlite3SelectWalkNoop(tls *crt.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:97536:20: */
+func Xsqlite3SelectWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32 { /* sqlite3.c:97749:20: */
_ = NotUsed
_ = NotUsed2
return 0
@@ -72714,6 +75267,8 @@ func Xsqlite3SelectWalkNoop(tls *crt.TLS, NotUsed uintptr, NotUsed2 uintptr) int
// table and column.
// #include "sqliteInt.h"
+// Magic table number to mean the EXCLUDED table in an UPSERT statement.
+
// Walk the expression tree pExpr and increase the aggregate function
// depth (the Expr.op2 field) by N on every TK_AGG_FUNCTION node.
// This needs to occur when copying a TK_AGG_FUNCTION node from an
@@ -72723,22 +75278,22 @@ func Xsqlite3SelectWalkNoop(tls *crt.TLS, NotUsed uintptr, NotUsed2 uintptr) int
// is a helper function - a callback for the tree walker.
//
// See also the sqlite3WindowExtraAggFuncDepth() routine in window.c
-func incrAggDepth(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:97572:12: */
+func incrAggDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:97790:12: */
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 165 {
*(*U8)(unsafe.Pointer(pExpr + 2 /* &.op2 */)) += U8((*(*int32)(unsafe.Pointer(pWalker + 40 /* &.u */))))
}
return 0
}
-func incrAggFunctionDepth(tls *crt.TLS, pExpr uintptr, N int32) { /* sqlite3.c:97576:13: */
+func incrAggFunctionDepth(tls *libc.TLS, pExpr uintptr, N int32) { /* sqlite3.c:97794:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
if N > 0 {
// var w Walker at bp, 48
- crt.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{incrAggDepth}))
*(*int32)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = N
Xsqlite3WalkExpr(tls, bp /* &w */, pExpr)
@@ -72762,7 +75317,7 @@ func incrAggFunctionDepth(tls *crt.TLS, pExpr uintptr, N int32) { /* sqlite3.c:9
// zero but it might be more if the alias is contained within a subquery
// of the original expression. The Expr.op2 field of TK_AGG_FUNCTION
// structures must be increased by the nSubquery amount.
-func resolveAlias(tls *crt.TLS, pParse uintptr, pEList uintptr, iCol int32, pExpr uintptr, zType uintptr, nSubquery int32) { /* sqlite3.c:97605:13: */
+func resolveAlias(tls *libc.TLS, pParse uintptr, pEList uintptr, iCol int32, pExpr uintptr, zType uintptr, nSubquery int32) { /* sqlite3.c:97823:13: */
var pOrig uintptr // The iCol-th column of the result set
var pDup uintptr // Copy of pOrig
var db uintptr // The database connection
@@ -72787,7 +75342,7 @@ func resolveAlias(tls *crt.TLS, pParse uintptr, pEList uintptr, iCol int32, pExp
// make a copy of the token before doing the sqlite3DbFree().
*(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(0x8000000))
Xsqlite3ExprDelete(tls, db, pExpr)
- crt.Xmemcpy(tls, pExpr, pDup, uint64(unsafe.Sizeof(Expr{})))
+ libc.Xmemcpy(tls, pExpr, pDup, uint64(unsafe.Sizeof(Expr{})))
if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000400))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) != uintptr(0)) {
*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) = Xsqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))
@@ -72808,7 +75363,7 @@ func resolveAlias(tls *crt.TLS, pParse uintptr, pEList uintptr, iCol int32, pExp
//
// Return FALSE if the USING clause is NULL or if it does not contain
// zCol.
-func nameInUsingClause(tls *crt.TLS, pUsing uintptr, zCol uintptr) int32 { /* sqlite3.c:97662:12: */
+func nameInUsingClause(tls *libc.TLS, pUsing uintptr, zCol uintptr) int32 { /* sqlite3.c:97880:12: */
if pUsing != 0 {
var k int32
for k = 0; k < (*IdList)(unsafe.Pointer(pUsing)).FnId; k++ {
@@ -72825,7 +75380,7 @@ func nameInUsingClause(tls *crt.TLS, pUsing uintptr, zCol uintptr) int32 { /* sq
// Check to see if the zSpan given to this routine matches the zDb, zTab,
// and zCol. If any of zDb, zTab, and zCol are NULL then those fields will
// match anything.
-func Xsqlite3MatchEName(tls *crt.TLS, pItem uintptr, zCol uintptr, zTab uintptr, zDb uintptr) int32 { /* sqlite3.c:97679:20: */
+func Xsqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr, zDb uintptr) int32 { /* sqlite3.c:97897:20: */
var n int32
var zSpan uintptr
if int32(*(*uint8)(unsafe.Pointer(pItem + 20 /* &.eEName */))&0x3>>0) != 2 {
@@ -72851,7 +75406,7 @@ func Xsqlite3MatchEName(tls *crt.TLS, pItem uintptr, zCol uintptr, zTab uintptr,
}
// Return TRUE if the double-quoted string mis-feature should be supported.
-func areDoubleQuotedStringsEnabled(tls *crt.TLS, db uintptr, pTopNC uintptr) int32 { /* sqlite3.c:97708:12: */
+func areDoubleQuotedStringsEnabled(tls *libc.TLS, db uintptr, pTopNC uintptr) int32 { /* sqlite3.c:97926:12: */
if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
return 1
} // Always support for legacy schemas
@@ -72860,17 +75415,17 @@ func areDoubleQuotedStringsEnabled(tls *crt.TLS, db uintptr, pTopNC uintptr) int
if (Xsqlite3WritableSchema(tls, db) != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x40000000)) != uint64(0)) {
return 1
}
- return (crt.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x20000000)) != uint64(0)))
+ return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x20000000)) != uint64(0)))
} else {
// Currently parsing a DML statement
- return (crt.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x40000000)) != uint64(0)))
+ return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x40000000)) != uint64(0)))
}
return int32(0)
}
// The argument is guaranteed to be a non-NULL Expr node of type TK_COLUMN.
// return the appropriate colUsed mask.
-func Xsqlite3ExprColUsed(tls *crt.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:97726:24: */
+func Xsqlite3ExprColUsed(tls *libc.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:97944:24: */
var n int32
var pExTab uintptr
@@ -72881,7 +75436,7 @@ func Xsqlite3ExprColUsed(tls *crt.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:977
((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pExTab)).FaCol+uintptr(n)*32)).FcolFlags) & 0x0060) != 0) {
if int32((*Table)(unsafe.Pointer(pExTab)).FnCol) >= (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))) {
- return crt.Uint64(crt.Uint64FromInt32(-1))
+ return libc.Uint64(libc.Uint64FromInt32(-1))
}
return ((Bitmask((uint64(1))) << (int32((*Table)(unsafe.Pointer(pExTab)).FnCol))) - uint64(1))
} else {
@@ -72919,7 +75474,7 @@ func Xsqlite3ExprColUsed(tls *crt.TLS, pExpr uintptr) Bitmask { /* sqlite3.c:977
//
// If the name cannot be resolved unambiguously, leave an error message
// in pParse and return WRC_Abort. Return WRC_Prune on success.
-func lookupName(tls *crt.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol uintptr, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:97774:12: */
+func lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zCol uintptr, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:97992:12: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -73001,7 +75556,7 @@ __5:
goto __6
__6:
;
- if !((i == (*Sqlite3)(unsafe.Pointer(db)).FnDb) && (Xsqlite3StrICmp(tls, ts+6116 /* "main" */, zDb) == 0)) {
+ if !((i == (*Sqlite3)(unsafe.Pointer(db)).FnDb) && (Xsqlite3StrICmp(tls, ts+8314 /* "main" */, zDb) == 0)) {
goto __8
}
// This branch is taken when the main database has been renamed
@@ -73095,7 +75650,7 @@ __25:
;
__23:
;
- if !(0 == (crt.PostIncInt32(&cntTab, 1))) {
+ if !(0 == (libc.PostIncInt32(&cntTab, 1))) {
goto __26
}
pMatch = pItem
@@ -73190,14 +75745,14 @@ __12:
}
op = int32((*Parse)(unsafe.Pointer(pParse)).FeTriggerOp)
- if !((op != 126) && (Xsqlite3StrICmp(tls, ts+6121 /* "new" */, zTab) == 0)) {
+ if !((op != 126) && (Xsqlite3StrICmp(tls, ts+8319 /* "new" */, zTab) == 0)) {
goto __38
}
(*Expr)(unsafe.Pointer(pExpr)).FiTable = 1
pTab = (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab
goto __39
__38:
- if !((op != 125) && (Xsqlite3StrICmp(tls, ts+6125 /* "old" */, zTab) == 0)) {
+ if !((op != 125) && (Xsqlite3StrICmp(tls, ts+8323 /* "old" */, zTab) == 0)) {
goto __40
}
(*Expr)(unsafe.Pointer(pExpr)).FiTable = 0
@@ -73212,7 +75767,7 @@ __37:
goto __41
}
pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */))
- if !((pUpsert != 0) && (Xsqlite3StrICmp(tls, ts+6129 /* "excluded" */, zTab) == 0)) {
+ if !((pUpsert != 0) && (Xsqlite3StrICmp(tls, ts+8327 /* "excluded" */, zTab) == 0)) {
goto __42
}
pTab = (*SrcList_item)(unsafe.Pointer(((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8 /* &.a */) + uintptr(0)*112)).FpTab
@@ -73277,7 +75832,7 @@ __49:
eNewExprOp = 164
goto __54
__53:
- (*Expr)(unsafe.Pointer(pExpr)).FiTable = ((*Upsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */)))).FregData + iCol)
+ (*Expr)(unsafe.Pointer(pExpr)).FiTable = ((*Upsert)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNC + 16 /* &.uNC */)))).FregData + int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iCol))))
eNewExprOp = 173
*(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(0x400000))
__54:
@@ -73380,7 +75935,7 @@ __61:
if !((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & 0x00001) == 0) && (((*Expr)(unsafe.Pointer((pOrig))).Fflags & (U32(0x000010))) != U32(0))) {
goto __65
}
- Xsqlite3ErrorMsg(tls, pParse, ts+6138 /* "misuse of aliase..." */, crt.VaList(bp, zAs))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8336 /* "misuse of aliase..." */, libc.VaList(bp, zAs))
return 2
__65:
;
@@ -73388,18 +75943,18 @@ __65:
((((*NameContext)(unsafe.Pointer(pNC)).FncFlags & 0x04000) == 0) || (pNC != pTopNC))) {
goto __66
}
- Xsqlite3ErrorMsg(tls, pParse, ts+6169 /* "misuse of aliase..." */, crt.VaList(bp+8, zAs))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8367 /* "misuse of aliase..." */, libc.VaList(bp+8, zAs))
return 2
__66:
;
if !(Xsqlite3ExprVectorSize(tls, pOrig) != 1) {
goto __67
}
- Xsqlite3ErrorMsg(tls, pParse, ts+6206 /* "row value misuse..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+8404 /* "row value misuse..." */, 0)
return 2
__67:
;
- resolveAlias(tls, pParse, pEList, j, pExpr, ts+672 /* "" */, nSubquery)
+ resolveAlias(tls, pParse, pEList, j, pExpr, ts+781 /* "" */, nSubquery)
cnt = 1
pMatch = uintptr(0)
@@ -73471,7 +76026,7 @@ __11:
// a huge amount of legacy SQL that uses it. So for now, we just
// issue a warning.
Xsqlite3_log(tls, 28,
- ts+6224 /* "double-quoted st..." */, crt.VaList(bp+16, zCol))
+ ts+8422 /* "double-quoted st..." */, libc.VaList(bp+16, zCol))
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(115)
*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = uintptr(0)
return 1
@@ -73492,23 +76047,23 @@ __70:
goto __73
}
if cnt == 0 {
- zErr = ts + 6259 /* "no such column" */
+ zErr = ts + 8457 /* "no such column" */
} else {
- zErr = ts + 6274 /* "ambiguous column..." */
+ zErr = ts + 8472 /* "ambiguous column..." */
}
if !(zDb != 0) {
goto __74
}
- Xsqlite3ErrorMsg(tls, pParse, ts+6296 /* "%s: %s.%s.%s" */, crt.VaList(bp+24, zErr, zDb, zTab, zCol))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8494 /* "%s: %s.%s.%s" */, libc.VaList(bp+24, zErr, zDb, zTab, zCol))
goto __75
__74:
if !(zTab != 0) {
goto __76
}
- Xsqlite3ErrorMsg(tls, pParse, ts+6309 /* "%s: %s.%s" */, crt.VaList(bp+56, zErr, zTab, zCol))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8507 /* "%s: %s.%s" */, libc.VaList(bp+56, zErr, zTab, zCol))
goto __77
__76:
- Xsqlite3ErrorMsg(tls, pParse, ts+6319 /* "%s: %s" */, crt.VaList(bp+80, zErr, zCol))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8517 /* "%s: %s" */, libc.VaList(bp+80, zErr, zCol))
__77:
;
__75:
@@ -73585,11 +76140,11 @@ __80:
// Allocate and return a pointer to an expression to load the column iCol
// from datasource iSrc in SrcList pSrc.
-func Xsqlite3CreateColumnExpr(tls *crt.TLS, db uintptr, pSrc uintptr, iSrc int32, iCol int32) uintptr { /* sqlite3.c:98187:21: */
+func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int32, iCol int32) uintptr { /* sqlite3.c:98406:21: */
var p uintptr = Xsqlite3ExprAlloc(tls, db, 164, uintptr(0), 0)
if p != 0 {
var pItem uintptr = ((pSrc + 8 /* &.a */) + uintptr(iSrc)*112)
- var pTab uintptr = crt.AssignPtrUintptr(p+64 /* &.y */ /* &.pTab */, (*SrcList_item)(unsafe.Pointer(pItem)).FpTab)
+ var pTab uintptr = libc.AssignPtrUintptr(p+64 /* &.y */ /* &.pTab */, (*SrcList_item)(unsafe.Pointer(pItem)).FpTab)
(*Expr)(unsafe.Pointer(p)).FiTable = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor
if int32((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FiPKey) == iCol {
(*Expr)(unsafe.Pointer(p)).FiColumn = int16(-1)
@@ -73600,7 +76155,7 @@ func Xsqlite3CreateColumnExpr(tls *crt.TLS, db uintptr, pSrc uintptr, iSrc int32
(*SrcList_item)(unsafe.Pointer(pItem)).FcolUsed = func() uint64 {
if int32((*Table)(unsafe.Pointer(pTab)).FnCol) >= 64 {
- return crt.Uint64(crt.Uint64FromInt32(-1))
+ return libc.Uint64(libc.Uint64FromInt32(-1))
}
return ((Bitmask((uint64(1))) << (int32((*Table)(unsafe.Pointer(pTab)).FnCol))) - uint64(1))
}()
@@ -73632,19 +76187,19 @@ func Xsqlite3CreateColumnExpr(tls *crt.TLS, db uintptr, pSrc uintptr, iSrc int32
// As an optimization, since the conditional is almost always false
// (because errors are rare), the conditional is moved outside of the
// function call using a macro.
-func notValidImpl(tls *crt.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExpr uintptr) { /* sqlite3.c:98229:13: */
+func notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExpr uintptr) { /* sqlite3.c:98448:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
- var zIn uintptr = ts + 6326 /* "partial index WH..." */
+ var zIn uintptr = ts + 8524 /* "partial index WH..." */
if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & 0x00020) != 0 {
- zIn = ts + 6354 /* "index expression..." */
+ zIn = ts + 8552 /* "index expression..." */
} else if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & 0x00004) != 0 {
- zIn = ts + 6372 /* "CHECK constraint..." */
+ zIn = ts + 8570 /* "CHECK constraint..." */
} else if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & 0x00008) != 0 {
- zIn = ts + 6390 /* "generated column..." */
+ zIn = ts + 8588 /* "generated column..." */
}
- Xsqlite3ErrorMsg(tls, pParse, ts+6408 /* "%s prohibited in..." */, crt.VaList(bp, zMsg, zIn))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8606 /* "%s prohibited in..." */, libc.VaList(bp, zMsg, zIn))
if pExpr != 0 {
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(119)
}
@@ -73653,7 +76208,7 @@ func notValidImpl(tls *crt.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pExpr
// Expression p should encode a floating point value between 1.0 and 0.0.
// Return 1024 times this value. Or return -1 if p is not a floating point
// value between 1.0 and 0.0.
-func exprProbability(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:98255:12: */
+func exprProbability(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:98474:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -73678,7 +76233,7 @@ func exprProbability(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:98255:12: */
// This routine also does error checking and name resolution for
// function names. The operator for aggregate functions is changed
// to TK_AGG_FUNCTION.
-func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:98275:12: */
+func resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:98494:12: */
bp := tls.Alloc(96)
defer tls.Free(96)
@@ -73691,6 +76246,24 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
+ // The special operator TK_ROW means use the rowid for the first
+ // column in the FROM clause. This is used by the LIMIT and ORDER BY
+ // clause processing on UPDATE and DELETE statements, and by
+ // UPDATE ... FROM statement processing.
+ case 75:
+ {
+ var pSrcList uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpSrcList
+ var pItem uintptr
+
+ pItem = pSrcList + 8 /* &.a */
+ (*Expr)(unsafe.Pointer(pExpr)).Fop = U8(164)
+ *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab
+ (*Expr)(unsafe.Pointer(pExpr)).FiTable = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor
+ (*Expr)(unsafe.Pointer(pExpr)).FiColumn--
+ (*Expr)(unsafe.Pointer(pExpr)).FaffExpr = int8(0x44)
+ break
+ }
+
// A column name: ID
// Or table name and column name: ID.ID
// Or a database, table and column: ID.ID.ID
@@ -73715,7 +76288,7 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (0x00020 | 0x00008)) != 0 {
- notValidImpl(tls, pParse, pNC, ts+6428 /* "the \".\" operator" */, uintptr(0))
+ notValidImpl(tls, pParse, pNC, ts+8626 /* "the \".\" operator" */, uintptr(0))
}
pRight = (*Expr)(unsafe.Pointer(pExpr)).FpRight
@@ -73773,7 +76346,7 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
wrong_num_args = 1
}
} else {
- is_agg = (crt.Bool32((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0)))
+ is_agg = (libc.Bool32((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0)))
if ((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(0x0400)) != 0 {
*(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(0x040000))
if n == 2 {
@@ -73781,7 +76354,7 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
if (*Expr)(unsafe.Pointer(pExpr)).FiTable < 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+6445 /* "second argument ..." */, 0)
+ ts+8643 /* "second argument ..." */, 0)
(*NameContext)(unsafe.Pointer(pNC)).FnErr++
}
} else {
@@ -73806,8 +76379,8 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
var auth int32 = Xsqlite3AuthCheck(tls, pParse, 31, uintptr(0), (*FuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0))
if auth != 0 {
if auth == 1 {
- Xsqlite3ErrorMsg(tls, pParse, ts+6516, /* "not authorized t..." */
- crt.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8714, /* "not authorized t..." */
+ libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName))
(*NameContext)(unsafe.Pointer(pNC)).FnErr++
}
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(119)
@@ -73829,7 +76402,7 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
// in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all
// all this.
if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & ((0x00020 | 0x00002) | 0x00008)) != 0 {
- notValidImpl(tls, pParse, pNC, ts+6551 /* "non-deterministi..." */, uintptr(0))
+ notValidImpl(tls, pParse, pNC, ts+8749 /* "non-deterministi..." */, uintptr(0))
}
} else {
// Must fit in 8 bits
@@ -73853,35 +76426,35 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
}
}
- if 0 == (crt.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2)) {
+ if 0 == (libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2)) {
if ((pDef != 0) && ((*FuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0))) && (pWin != 0) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+6579 /* "%.*s() may not b..." */, crt.VaList(bp+8, nId, zId))
+ ts+8777 /* "%.*s() may not b..." */, libc.VaList(bp+8, nId, zId))
(*NameContext)(unsafe.Pointer(pNC)).FnErr++
} else if (((is_agg != 0) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & 0x00001) == 0)) ||
(((is_agg != 0) && (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(0x00010000)) != 0)) && !(pWin != 0))) ||
(((is_agg != 0) && (pWin != 0)) && (((*NameContext)(unsafe.Pointer(pNC)).FncFlags & 0x04000) == 0)) {
var zType uintptr
if (((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(0x00010000)) != 0) || (pWin != 0) {
- zType = ts + 6623 /* "window" */
+ zType = ts + 8821 /* "window" */
} else {
- zType = ts + 6630 /* "aggregate" */
+ zType = ts + 8828 /* "aggregate" */
}
- Xsqlite3ErrorMsg(tls, pParse, ts+6640 /* "misuse of %s fun..." */, crt.VaList(bp+24, zType, nId, zId))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8838 /* "misuse of %s fun..." */, libc.VaList(bp+24, zType, nId, zId))
(*NameContext)(unsafe.Pointer(pNC)).FnErr++
is_agg = 0
} else if (no_such_func != 0) && (int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6669 /* "no such function..." */, crt.VaList(bp+48, nId, zId))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8867 /* "no such function..." */, libc.VaList(bp+48, nId, zId))
(*NameContext)(unsafe.Pointer(pNC)).FnErr++
} else if wrong_num_args != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+6692, /* "wrong number of ..." */
- crt.VaList(bp+64, nId, zId))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8890, /* "wrong number of ..." */
+ libc.VaList(bp+64, nId, zId))
(*NameContext)(unsafe.Pointer(pNC)).FnErr++
} else if (is_agg == 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x1000000))) != U32(0)) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+6737, /* "FILTER may not b..." */
- crt.VaList(bp+80, nId, zId))
+ ts+8935, /* "FILTER may not b..." */
+ libc.VaList(bp+80, nId, zId))
(*NameContext)(unsafe.Pointer(pNC)).FnErr++
}
if is_agg != 0 {
@@ -73903,7 +76476,7 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
if pWin != 0 {
var pSel uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpWinSelect
- if (crt.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2)) == 0 {
+ if (libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2)) == 0 {
Xsqlite3WindowUpdate(tls, pParse, func() uintptr {
if pSel != 0 {
return (*Select)(unsafe.Pointer(pSel)).FpWinDefn
@@ -73950,7 +76523,7 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
var nRef int32 = (*NameContext)(unsafe.Pointer(pNC)).FnRef
if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (((0x00004 | 0x00002) | 0x00020) | 0x00008)) != 0 {
- notValidImpl(tls, pParse, pNC, ts+6786 /* "subqueries" */, pExpr)
+ notValidImpl(tls, pParse, pNC, ts+8984 /* "subqueries" */, pExpr)
}
Xsqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))
@@ -73966,7 +76539,7 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
{
if ((*NameContext)(unsafe.Pointer((pNC))).FncFlags & (((0x00004 | 0x00002) | 0x00020) | 0x00008)) != 0 {
- notValidImpl(tls, pParse, pNC, ts+6797 /* "parameters" */, pExpr)
+ notValidImpl(tls, pParse, pNC, ts+8995 /* "parameters" */, pExpr)
}
break
@@ -73990,7 +76563,7 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
return 0
}
}
- // Fall thru
+ /* no break */
}
fallthrough
case 48:
@@ -74025,7 +76598,7 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
}
if nLeft != nRight {
- Xsqlite3ErrorMsg(tls, pParse, ts+6206 /* "row value misuse..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+8404 /* "row value misuse..." */, 0)
}
break
}
@@ -74046,7 +76619,7 @@ func resolveExprStep(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sq
// return 0.
//
// pEList has been resolved. pE has not.
-func resolveAsName(tls *crt.TLS, pParse uintptr, pEList uintptr, pE uintptr) int32 { /* sqlite3.c:98678:12: */
+func resolveAsName(tls *libc.TLS, pParse uintptr, pEList uintptr, pE uintptr) int32 { /* sqlite3.c:98894:12: */
var i int32 // Loop counter
_ = pParse
@@ -74079,7 +76652,7 @@ func resolveAsName(tls *crt.TLS, pParse uintptr, pEList uintptr, pE uintptr) int
// the column.
//
// If there is no match, return 0. Return -1 if an error occurs.
-func resolveOrderByTermToExprList(tls *crt.TLS, pParse uintptr, pSelect uintptr, pE uintptr) int32 { /* sqlite3.c:98718:12: */
+func resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintptr, pE uintptr) int32 { /* sqlite3.c:98934:12: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -74094,7 +76667,7 @@ func resolveOrderByTermToExprList(tls *crt.TLS, pParse uintptr, pSelect uintptr,
pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList
// Resolve all names in the ORDER BY term expression
- crt.Xmemset(tls, bp /* &nc */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp /* &nc */, 0, uint64(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp /* &nc */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp /* &nc */)).FpSrcList = (*Select)(unsafe.Pointer(pSelect)).FpSrc
*(*uintptr)(unsafe.Pointer(bp /* &nc */ + 16 /* &.uNC */)) = pEList
@@ -74102,7 +76675,7 @@ func resolveOrderByTermToExprList(tls *crt.TLS, pParse uintptr, pSelect uintptr,
(*NameContext)(unsafe.Pointer(bp /* &nc */)).FnErr = 0
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
savedSuppErr = (*Sqlite3)(unsafe.Pointer(db)).FsuppressErr
- if (crt.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2)) == 0 {
+ if (libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2)) == 0 {
(*Sqlite3)(unsafe.Pointer(db)).FsuppressErr = U8(1)
}
rc = Xsqlite3ResolveExprNames(tls, bp /* &nc */, pE)
@@ -74125,13 +76698,13 @@ func resolveOrderByTermToExprList(tls *crt.TLS, pParse uintptr, pSelect uintptr,
}
// Generate an ORDER BY or GROUP BY term out-of-range error.
-func resolveOutOfRangeError(tls *crt.TLS, pParse uintptr, zType uintptr, i int32, mx int32) { /* sqlite3.c:98765:13: */
+func resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32) { /* sqlite3.c:98981:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
Xsqlite3ErrorMsg(tls, pParse,
- ts+6808 /* "%r %s BY term ou..." */, crt.VaList(bp, i, zType, mx))
+ ts+9006 /* "%r %s BY term ou..." */, libc.VaList(bp, i, zType, mx))
}
// Analyze the ORDER BY clause in a compound SELECT statement. Modify
@@ -74147,7 +76720,7 @@ func resolveOutOfRangeError(tls *crt.TLS, pParse uintptr, zType uintptr, i int32
// the integer column number.
//
// Return the number of errors seen.
-func resolveCompoundOrderBy(tls *crt.TLS, pParse uintptr, pSelect uintptr) int32 { /* sqlite3.c:98791:12: */
+func resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) int32 { /* sqlite3.c:99007:12: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -74163,11 +76736,11 @@ func resolveCompoundOrderBy(tls *crt.TLS, pParse uintptr, pSelect uintptr) int32
}
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(2)*4)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6864 /* "too many terms i..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+9062 /* "too many terms i..." */, 0)
return 1
}
for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ {
- crt.SetBitFieldPtr8Uint32((pOrderBy+8 /* &.a */)+uintptr(i)*32+20 /* &.done */, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32((pOrderBy+8 /* &.a */)+uintptr(i)*32+20 /* &.done */, uint32(0), 2, 0x4)
}
(*Select)(unsafe.Pointer(pSelect)).FpNext = uintptr(0)
for (*Select)(unsafe.Pointer(pSelect)).FpPrior != 0 {
@@ -74195,7 +76768,7 @@ func resolveCompoundOrderBy(tls *crt.TLS, pParse uintptr, pSelect uintptr) int32
pE = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)
if Xsqlite3ExprIsInteger(tls, pE, bp+8 /* &iCol */) != 0 {
if (*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) <= 0) || (*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)) > (*ExprList)(unsafe.Pointer(pEList)).FnExpr) {
- resolveOutOfRangeError(tls, pParse, ts+6898 /* "ORDER" */, (i + 1), (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
+ resolveOutOfRangeError(tls, pParse, ts+9096 /* "ORDER" */, (i + 1), (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
return 1
}
} else {
@@ -74255,7 +76828,7 @@ func resolveCompoundOrderBy(tls *crt.TLS, pParse uintptr, pSelect uintptr) int32
FiAlias U16
})(unsafe.Pointer(pItem + 24 /* &.u */)).FiOrderByCol = U16(*(*int32)(unsafe.Pointer(bp + 8 /* iCol */)))
}
- crt.SetBitFieldPtr8Uint32(pItem+20 /* &.done */, uint32(1), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pItem+20 /* &.done */, uint32(1), 2, 0x4)
} else {
moreToDo = 1
}
@@ -74273,7 +76846,7 @@ func resolveCompoundOrderBy(tls *crt.TLS, pParse uintptr, pSelect uintptr) int32
for i = 0; i < (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr; i++ {
if int32(*(*uint8)(unsafe.Pointer(((pOrderBy + 8 /* &.a */) + uintptr(i)*32) + 20 /* &.done */))&0x4>>2) == 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+6904 /* "%r ORDER BY term..." */, crt.VaList(bp, (i+1)))
+ ts+9102 /* "%r ORDER BY term..." */, libc.VaList(bp, (i+1)))
return 1
}
}
@@ -74288,7 +76861,7 @@ func resolveCompoundOrderBy(tls *crt.TLS, pParse uintptr, pSelect uintptr) int32
//
// If any errors are detected, add an error message to pParse and
// return non-zero. Return zero if no errors are seen.
-func Xsqlite3ResolveOrderGroupBy(tls *crt.TLS, pParse uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:98908:20: */
+func Xsqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:99124:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -74301,7 +76874,7 @@ func Xsqlite3ResolveOrderGroupBy(tls *crt.TLS, pParse uintptr, pSelect uintptr,
return 0
}
if (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(2)*4)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6965 /* "too many terms i..." */, crt.VaList(bp, zType))
+ Xsqlite3ErrorMsg(tls, pParse, ts+9163 /* "too many terms i..." */, libc.VaList(bp, zType))
return 1
}
pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList
@@ -74343,7 +76916,7 @@ __3:
}
// Walker callback for windowRemoveExprFromSelect().
-func resolveRemoveWindowsCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:98943:12: */
+func resolveRemoveWindowsCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:99159:12: */
_ = pWalker
if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x1000000))) != U32(0) {
var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */))
@@ -74354,16 +76927,16 @@ func resolveRemoveWindowsCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32
// Remove any Window objects owned by the expression pExpr from the
// Select.pWin list of Select object pSelect.
-func windowRemoveExprFromSelect(tls *crt.TLS, pSelect uintptr, pExpr uintptr) { /* sqlite3.c:98956:13: */
+func windowRemoveExprFromSelect(tls *libc.TLS, pSelect uintptr, pExpr uintptr) { /* sqlite3.c:99172:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
if (*Select)(unsafe.Pointer(pSelect)).FpWin != 0 {
// var sWalker Walker at bp, 48
- crt.Xmemset(tls, bp /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{resolveRemoveWindowsCb}))
*(*uintptr)(unsafe.Pointer(bp /* &sWalker */ + 40 /* &.u */)) = pSelect
Xsqlite3WalkExpr(tls, bp /* &sWalker */, pExpr)
@@ -74386,7 +76959,7 @@ func windowRemoveExprFromSelect(tls *crt.TLS, pSelect uintptr, pExpr uintptr) {
// This routine returns the number of errors. If errors occur, then
// an appropriate error message might be left in pParse. (OOM errors
// excepted.)
-func resolveOrderGroupBy(tls *crt.TLS, pNC uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:98987:12: */
+func resolveOrderGroupBy(tls *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy uintptr, zType uintptr) int32 { /* sqlite3.c:99203:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -74474,7 +77047,7 @@ __3:
}
// Resolve names in the SELECT statement p and all of its descendants.
-func resolveSelectStep(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:99049:12: */
+func resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:99265:12: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -74511,7 +77084,7 @@ func resolveSelectStep(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqli
return 1
}
- isCompound = (crt.Bool32((*Select)(unsafe.Pointer(p)).FpPrior != uintptr(0)))
+ isCompound = (libc.Bool32((*Select)(unsafe.Pointer(p)).FpPrior != uintptr(0)))
nCompound = 0
pLeftmost = p
for p != 0 {
@@ -74520,7 +77093,7 @@ func resolveSelectStep(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqli
// Resolve the expressions in the LIMIT and OFFSET clauses. These
// are not allowed to refer to any names, so pass an empty NameContext.
- crt.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpWinSelect = p
if Xsqlite3ResolveExprNames(tls, bp /* &sNC */, (*Select)(unsafe.Pointer(p)).FpLimit) != 0 {
@@ -74570,7 +77143,7 @@ func resolveSelectStep(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqli
nRef = nRef - ((*NameContext)(unsafe.Pointer(pNC)).FnRef)
}
- crt.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isCorrelated */, (uint32(crt.Bool32(nRef != 0))), 3, 0x8)
+ libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isCorrelated */, (uint32(libc.Bool32(nRef != 0))), 3, 0x8)
}
}
@@ -74584,7 +77157,7 @@ func resolveSelectStep(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqli
if Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, (*Select)(unsafe.Pointer(p)).FpEList) != 0 {
return 2
}
- *(*int32)(unsafe.Pointer(bp /* &sNC */ + 40 /* &.ncFlags */)) &= (^int32(crt.Int32FromInt32(0x04000)))
+ *(*int32)(unsafe.Pointer(bp /* &sNC */ + 40 /* &.ncFlags */)) &= (^int32(libc.Int32FromInt32(0x04000)))
// If there are no aggregate functions in the result-set, and no GROUP BY
// expression, do not allow aggregates in any of the other expressions.
@@ -74594,12 +77167,12 @@ func resolveSelectStep(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqli
*(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(0x0000008 | ((*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags & 0x01000)))
} else {
- *(*int32)(unsafe.Pointer(bp /* &sNC */ + 40 /* &.ncFlags */)) &= (^int32(crt.Int32FromInt32(0x00001)))
+ *(*int32)(unsafe.Pointer(bp /* &sNC */ + 40 /* &.ncFlags */)) &= (^int32(libc.Int32FromInt32(0x00001)))
}
// If a HAVING clause is present, then there must be a GROUP BY clause.
if ((*Select)(unsafe.Pointer(p)).FpHaving != 0) && !(pGroupBy != 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6996 /* "a GROUP BY claus..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+9194 /* "a GROUP BY claus..." */, 0)
return 2
}
@@ -74655,20 +77228,20 @@ func resolveSelectStep(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqli
// is not detected until much later, and so we need to go ahead and
// resolve those symbols on the incorrect ORDER BY for consistency.
if (isCompound <= nCompound) && // Defer right-most ORDER BY of a compound
- (resolveOrderGroupBy(tls, bp /* &sNC */, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+6898 /* "ORDER" */) != 0) {
+ (resolveOrderGroupBy(tls, bp /* &sNC */, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+9096 /* "ORDER" */) != 0) {
return 2
}
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return 2
}
- *(*int32)(unsafe.Pointer(bp /* &sNC */ + 40 /* &.ncFlags */)) &= (^int32(crt.Int32FromInt32(0x04000)))
+ *(*int32)(unsafe.Pointer(bp /* &sNC */ + 40 /* &.ncFlags */)) &= (^int32(libc.Int32FromInt32(0x04000)))
// Resolve the GROUP BY clause. At the same time, make sure
// the GROUP BY clause does not contain aggregate functions.
if pGroupBy != 0 {
var pItem uintptr
- if (resolveOrderGroupBy(tls, bp /* &sNC */, p, pGroupBy, ts+7040 /* "GROUP" */) != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ if (resolveOrderGroupBy(tls, bp /* &sNC */, p, pGroupBy, ts+9238 /* "GROUP" */) != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
return 2
}
i = 0
@@ -74680,7 +77253,7 @@ func resolveSelectStep(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqli
{
if ((*Expr)(unsafe.Pointer(((*ExprList_item)(unsafe.Pointer(pItem)).FpExpr))).Fflags & (U32(0x000010))) != U32(0) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+7046 /* "aggregate functi..." */, 0)
+ ts+9244 /* "aggregate functi..." */, 0)
return 2
}
}
@@ -74770,7 +77343,7 @@ func resolveSelectStep(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqli
//
// An error message is left in pParse if anything is amiss. The number
// if errors is returned.
-func Xsqlite3ResolveExprNames(tls *crt.TLS, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:99334:20: */
+func Xsqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) int32 { /* sqlite3.c:99550:20: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -74781,27 +77354,32 @@ func Xsqlite3ResolveExprNames(tls *crt.TLS, pNC uintptr, pExpr uintptr) int32 {
return 0
}
savedHasAgg = ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & ((0x00010 | 0x01000) | 0x08000))
- *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) &= (^int32(crt.Int32FromInt32(((0x00010 | 0x01000) | 0x08000))))
+ *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) &= (^int32(libc.Int32FromInt32(((0x00010 | 0x01000) | 0x08000))))
(*Walker)(unsafe.Pointer(bp /* &w */)).FpParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{resolveExprStep}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{resolveSelectStep}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0)
*(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = pNC
+ *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 292 /* &.nHeight */)) += ((*Expr)(unsafe.Pointer(pExpr)).FnHeight)
+ if Xsqlite3ExprCheckHeight(tls, (*Walker)(unsafe.Pointer(bp /* &w */)).FpParse, (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnHeight) != 0 {
+ return 1
+ }
Xsqlite3WalkExpr(tls, bp /* &w */, pExpr)
+ *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 292 /* &.nHeight */)) -= ((*Expr)(unsafe.Pointer(pExpr)).FnHeight)
*(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (0x00010 | 0x08000)))
*(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) |= (savedHasAgg)
- return (crt.Bool32(((*NameContext)(unsafe.Pointer(pNC)).FnErr > 0) || ((*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnErr > 0)))
+ return (libc.Bool32(((*NameContext)(unsafe.Pointer(pNC)).FnErr > 0) || ((*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnErr > 0)))
}
// Resolve all names for all expression in an expression list. This is
// just like sqlite3ResolveExprNames() except that it works for an expression
// list rather than a single expression.
-func Xsqlite3ResolveExprListNames(tls *crt.TLS, pNC uintptr, pList uintptr) int32 { /* sqlite3.c:99373:20: */
+func Xsqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) int32 { /* sqlite3.c:99589:20: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -74814,26 +77392,31 @@ func Xsqlite3ResolveExprListNames(tls *crt.TLS, pNC uintptr, pList uintptr) int3
}
(*Walker)(unsafe.Pointer(bp /* &w */)).FpParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{resolveExprStep}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{resolveSelectStep}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0)
*(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = pNC
savedHasAgg = ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & ((0x00010 | 0x01000) | 0x08000))
- *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) &= (^int32(crt.Int32FromInt32(((0x00010 | 0x01000) | 0x08000))))
+ *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) &= (^int32(libc.Int32FromInt32(((0x00010 | 0x01000) | 0x08000))))
for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
var pExpr uintptr = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32)).FpExpr
if pExpr == uintptr(0) {
continue
}
+ *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 292 /* &.nHeight */)) += ((*Expr)(unsafe.Pointer(pExpr)).FnHeight)
+ if Xsqlite3ExprCheckHeight(tls, (*Walker)(unsafe.Pointer(bp /* &w */)).FpParse, (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnHeight) != 0 {
+ return 2
+ }
Xsqlite3WalkExpr(tls, bp /* &w */, pExpr)
+ *(*int32)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse + 292 /* &.nHeight */)) -= ((*Expr)(unsafe.Pointer(pExpr)).FnHeight)
if ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & ((0x00010 | 0x01000) | 0x08000)) != 0 {
*(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32((*NameContext)(unsafe.Pointer(pNC)).FncFlags & (0x00010 | 0x08000)))
savedHasAgg = savedHasAgg | ((*NameContext)(unsafe.Pointer(pNC)).FncFlags & ((0x00010 | 0x01000) | 0x08000))
- *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) &= (^int32(crt.Int32FromInt32(((0x00010 | 0x01000) | 0x08000))))
+ *(*int32)(unsafe.Pointer(pNC + 40 /* &.ncFlags */)) &= (^int32(libc.Int32FromInt32(((0x00010 | 0x01000) | 0x08000))))
}
if ((*NameContext)(unsafe.Pointer(pNC)).FnErr > 0) || ((*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(bp /* &w */)).FpParse)).FnErr > 0) {
return 2
@@ -74853,17 +77436,17 @@ func Xsqlite3ResolveExprListNames(tls *crt.TLS, pNC uintptr, pList uintptr) int3
//
// All SELECT statements should have been expanded using
// sqlite3SelectExpand() prior to invoking this routine.
-func Xsqlite3ResolveSelectNames(tls *crt.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:99428:21: */
+func Xsqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:99644:21: */
bp := tls.Alloc(48)
defer tls.Free(48)
// var w Walker at bp, 48
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{resolveExprStep}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{resolveSelectStep}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0)
(*Walker)(unsafe.Pointer(bp /* &w */)).FpParse = pParse
@@ -74887,7 +77470,7 @@ func Xsqlite3ResolveSelectNames(tls *crt.TLS, pParse uintptr, p uintptr, pOuterN
// set to the column number. In case (4), TK_COLUMN nodes cause an error.
//
// Any errors cause an error message to be set in pParse.
-func Xsqlite3ResolveSelfReference(tls *crt.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) int32 { /* sqlite3.c:99462:20: */
+func Xsqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) int32 { /* sqlite3.c:99678:20: */
bp := tls.Alloc(176)
defer tls.Free(176)
@@ -74897,8 +77480,8 @@ func Xsqlite3ResolveSelfReference(tls *crt.TLS, pParse uintptr, pTab uintptr, ty
// Name context for pParse->pNewTable
var rc int32
- crt.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
- crt.Xmemset(tls, bp+56 /* &sSrc */, 0, uint64(unsafe.Sizeof(SrcList{})))
+ libc.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp+56 /* &sSrc */, 0, uint64(unsafe.Sizeof(SrcList{})))
if pTab != 0 {
(*SrcList)(unsafe.Pointer(bp + 56 /* &sSrc */)).FnSrc = 1
(*SrcList_item)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */) + uintptr(0)*112)).FzName = (*Table)(unsafe.Pointer(pTab)).FzName
@@ -74913,7 +77496,7 @@ func Xsqlite3ResolveSelfReference(tls *crt.TLS, pParse uintptr, pTab uintptr, ty
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = bp + 56 /* &sSrc */
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags = (type1 | 0x10000)
- if (crt.AssignInt32(&rc, Xsqlite3ResolveExprNames(tls, bp /* &sNC */, pExpr))) != 0 {
+ if (libc.AssignInt32(&rc, Xsqlite3ResolveExprNames(tls, bp /* &sNC */, pExpr))) != 0 {
return rc
}
if pList != 0 {
@@ -74923,7 +77506,7 @@ func Xsqlite3ResolveSelfReference(tls *crt.TLS, pParse uintptr, pTab uintptr, ty
}
// Return the affinity character for a single column of a table.
-func Xsqlite3TableColumnAffinity(tls *crt.TLS, pTab uintptr, iCol int32) int8 { /* sqlite3.c:99522:21: */
+func Xsqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) int8 { /* sqlite3.c:99738:21: */
if iCol >= 0 {
return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).Faffinity
@@ -74945,7 +77528,7 @@ func Xsqlite3TableColumnAffinity(tls *crt.TLS, pTab uintptr, iCol int32) int8 {
// SELECT * FROM t1 WHERE a;
// SELECT a AS b FROM t1 WHERE b;
// SELECT * FROM t1 WHERE (select a from t1);
-func Xsqlite3ExprAffinity(tls *crt.TLS, pExpr uintptr) int8 { /* sqlite3.c:99543:21: */
+func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:99759:21: */
var op int32
for ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x001000))) != U32(0) {
@@ -74954,11 +77537,7 @@ func Xsqlite3ExprAffinity(tls *crt.TLS, pExpr uintptr) int8 { /* sqlite3.c:99543
op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop)
if op == 136 {
- if ((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) != 0) &&
- ((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList != 0)) &&
- ((*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList+8 /* &.a */)+uintptr(0)*32)).FpExpr != 0) {
- return Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList+8 /* &.a */)+uintptr(0)*32)).FpExpr)
- }
+ return Xsqlite3ExprAffinity(tls, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList+8 /* &.a */)+uintptr(0)*32)).FpExpr)
}
if op == 173 {
op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop2)
@@ -74987,7 +77566,7 @@ func Xsqlite3ExprAffinity(tls *crt.TLS, pExpr uintptr) int8 { /* sqlite3.c:99543
//
// If a memory allocation error occurs, that fact is recorded in pParse->db
// and the pExpr parameter is returned unchanged.
-func Xsqlite3ExprAddCollateToken(tls *crt.TLS, pParse uintptr, pExpr uintptr, pCollName uintptr, dequote int32) uintptr { /* sqlite3.c:99590:21: */
+func Xsqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, pCollName uintptr, dequote int32) uintptr { /* sqlite3.c:99804:21: */
if (*Token)(unsafe.Pointer(pCollName)).Fn > uint32(0) {
var pNew uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 111, pCollName, dequote)
if pNew != 0 {
@@ -74998,7 +77577,7 @@ func Xsqlite3ExprAddCollateToken(tls *crt.TLS, pParse uintptr, pExpr uintptr, pC
}
return pExpr
}
-func Xsqlite3ExprAddCollateString(tls *crt.TLS, pParse uintptr, pExpr uintptr, zC uintptr) uintptr { /* sqlite3.c:99606:21: */
+func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, zC uintptr) uintptr { /* sqlite3.c:99820:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -75009,7 +77588,7 @@ func Xsqlite3ExprAddCollateString(tls *crt.TLS, pParse uintptr, pExpr uintptr, z
}
// Skip over any TK_COLLATE operators.
-func Xsqlite3ExprSkipCollate(tls *crt.TLS, pExpr uintptr) uintptr { /* sqlite3.c:99616:21: */
+func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:99830:21: */
for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x001000))) != U32(0)) {
pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
@@ -75020,7 +77599,7 @@ func Xsqlite3ExprSkipCollate(tls *crt.TLS, pExpr uintptr) uintptr { /* sqlite3.c
// Skip over any TK_COLLATE operators and/or any unlikely()
// or likelihood() or likely() functions at the root of an
// expression.
-func Xsqlite3ExprSkipCollateAndLikely(tls *crt.TLS, pExpr uintptr) uintptr { /* sqlite3.c:99629:21: */
+func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:99843:21: */
for (pExpr != 0) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x001000 | 0x040000))) != U32(0)) {
if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x040000))) != U32(0) {
@@ -75045,7 +77624,7 @@ func Xsqlite3ExprSkipCollateAndLikely(tls *crt.TLS, pExpr uintptr) uintptr { /*
// or by the presence of a column with a defined collating sequence.
// COLLATE operators take first precedence. Left operands take
// precedence over right operands.
-func Xsqlite3ExprCollSeq(tls *crt.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:99658:24: */
+func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:99872:24: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pColl uintptr = uintptr(0)
var p uintptr = pExpr
@@ -75115,7 +77694,7 @@ func Xsqlite3ExprCollSeq(tls *crt.TLS, pParse uintptr, pExpr uintptr) uintptr {
//
// The sqlite3ExprCollSeq() routine works the same except that it
// returns NULL if there is no defined collation.
-func Xsqlite3ExprNNCollSeq(tls *crt.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:99730:24: */
+func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:99944:24: */
var p uintptr = Xsqlite3ExprCollSeq(tls, pParse, pExpr)
if p == uintptr(0) {
p = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl
@@ -75125,16 +77704,16 @@ func Xsqlite3ExprNNCollSeq(tls *crt.TLS, pParse uintptr, pExpr uintptr) uintptr
}
// Return TRUE if the two expressions have equivalent collating sequences.
-func Xsqlite3ExprCollSeqMatch(tls *crt.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr) int32 { /* sqlite3.c:99740:20: */
+func Xsqlite3ExprCollSeqMatch(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr) int32 { /* sqlite3.c:99954:20: */
var pColl1 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, pE1)
var pColl2 uintptr = Xsqlite3ExprNNCollSeq(tls, pParse, pE2)
- return (crt.Bool32(Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl1)).FzName, (*CollSeq)(unsafe.Pointer(pColl2)).FzName) == 0))
+ return (libc.Bool32(Xsqlite3StrICmp(tls, (*CollSeq)(unsafe.Pointer(pColl1)).FzName, (*CollSeq)(unsafe.Pointer(pColl2)).FzName) == 0))
}
// pExpr is an operand of a comparison operator. aff2 is the
// type affinity of the other operand. This routine returns the
// type affinity that should be used for the comparison operator.
-func Xsqlite3CompareAffinity(tls *crt.TLS, pExpr uintptr, aff2 int8) int8 { /* sqlite3.c:99751:21: */
+func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) int8 { /* sqlite3.c:99965:21: */
var aff1 int8 = Xsqlite3ExprAffinity(tls, pExpr)
if (int32(aff1) > 0x40) && (int32(aff2) > 0x40) {
// Both sides of the comparison are columns. If one has numeric
@@ -75159,7 +77738,7 @@ func Xsqlite3CompareAffinity(tls *crt.TLS, pExpr uintptr, aff2 int8) int8 { /* s
// pExpr is a comparison operator. Return the type affinity that should
// be applied to both operands prior to doing the comparison.
-func comparisonAffinity(tls *crt.TLS, pExpr uintptr) int8 { /* sqlite3.c:99773:13: */
+func comparisonAffinity(tls *libc.TLS, pExpr uintptr) int8 { /* sqlite3.c:99987:13: */
var aff int8
aff = Xsqlite3ExprAffinity(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
@@ -75177,20 +77756,20 @@ func comparisonAffinity(tls *crt.TLS, pExpr uintptr) int8 { /* sqlite3.c:99773:1
// idx_affinity is the affinity of an indexed column. Return true
// if the index with affinity idx_affinity may be used to implement
// the comparison in pExpr.
-func Xsqlite3IndexAffinityOk(tls *crt.TLS, pExpr uintptr, idx_affinity int8) int32 { /* sqlite3.c:99796:20: */
+func Xsqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity int8) int32 { /* sqlite3.c:100010:20: */
var aff int8 = comparisonAffinity(tls, pExpr)
if int32(aff) < 0x42 {
return 1
}
if int32(aff) == 0x42 {
- return (crt.Bool32(int32(idx_affinity) == 0x42))
+ return (libc.Bool32(int32(idx_affinity) == 0x42))
}
- return (crt.Bool32((int32(idx_affinity)) >= 0x43))
+ return (libc.Bool32((int32(idx_affinity)) >= 0x43))
}
// Return the P5 value that should be used for a binary comparison
// opcode (OP_Eq, OP_Ge etc.) used to compare pExpr1 and pExpr2.
-func binaryCompareP5(tls *crt.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull int32) U8 { /* sqlite3.c:99811:11: */
+func binaryCompareP5(tls *libc.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull int32) U8 { /* sqlite3.c:100025:11: */
var aff U8 = U8(Xsqlite3ExprAffinity(tls, pExpr2))
aff = (U8(int32(U8(Xsqlite3CompareAffinity(tls, pExpr1, int8(aff)))) | int32(U8(jumpIfNull))))
return aff
@@ -75206,7 +77785,7 @@ func binaryCompareP5(tls *crt.TLS, pExpr1 uintptr, pExpr2 uintptr, jumpIfNull in
//
// Argument pRight (but not pLeft) may be a null pointer. In this case,
// it is not considered.
-func Xsqlite3BinaryCompareCollSeq(tls *crt.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:99833:24: */
+func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100047:24: */
var pColl uintptr
if ((*Expr)(unsafe.Pointer(pLeft)).Fflags & U32(0x000100)) != 0 {
@@ -75229,7 +77808,7 @@ func Xsqlite3BinaryCompareCollSeq(tls *crt.TLS, pParse uintptr, pLeft uintptr, p
// However, if the OP_Commuted flag is set, then the order of the operands
// is reversed in the sqlite3BinaryCompareCollSeq() call so that the
// correct collating sequence is found.
-func Xsqlite3ExprCompareCollSeq(tls *crt.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:99861:24: */
+func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:100075:24: */
if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(0x000200))) != U32(0) {
return Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpRight, (*Expr)(unsafe.Pointer(p)).FpLeft)
} else {
@@ -75239,7 +77818,7 @@ func Xsqlite3ExprCompareCollSeq(tls *crt.TLS, pParse uintptr, p uintptr) uintptr
}
// Generate code for a comparison operator.
-func codeCompare(tls *crt.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, opcode int32, in1 int32, in2 int32, dest int32, jumpIfNull int32, isCommuted int32) int32 { /* sqlite3.c:99872:12: */
+func codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, opcode int32, in1 int32, in2 int32, dest int32, jumpIfNull int32, isCommuted int32) int32 { /* sqlite3.c:100086:12: */
var p5 int32
var addr int32
var p4 uintptr
@@ -75266,15 +77845,15 @@ func codeCompare(tls *crt.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, op
// parser will not generate a TK_VECTOR with fewer than two entries.
// But a TK_SELECT might be either a vector or a scalar. It is only
// considered a vector if it has two or more result columns.
-func Xsqlite3ExprIsVector(tls *crt.TLS, pExpr uintptr) int32 { /* sqlite3.c:99908:20: */
- return (crt.Bool32(Xsqlite3ExprVectorSize(tls, pExpr) > 1))
+func Xsqlite3ExprIsVector(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:100122:20: */
+ return (libc.Bool32(Xsqlite3ExprVectorSize(tls, pExpr) > 1))
}
// If the expression passed as the only argument is of type TK_VECTOR
// return the number of expressions in the vector. Or, if the expression
// is a sub-select, return the number of columns in the sub-select. For
// any other type of expression, return 1.
-func Xsqlite3ExprVectorSize(tls *crt.TLS, pExpr uintptr) int32 { /* sqlite3.c:99918:20: */
+func Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:100132:20: */
var op U8 = (*Expr)(unsafe.Pointer(pExpr)).Fop
if int32(op) == 173 {
op = (*Expr)(unsafe.Pointer(pExpr)).Fop2
@@ -75302,7 +77881,7 @@ func Xsqlite3ExprVectorSize(tls *crt.TLS, pExpr uintptr) int32 { /* sqlite3.c:99
// just the expression for the i-th term of the result set, and may
// not be ready for evaluation because the table cursor has not yet
// been positioned.
-func Xsqlite3VectorFieldSubexpr(tls *crt.TLS, pVector uintptr, i int32) uintptr { /* sqlite3.c:99945:21: */
+func Xsqlite3VectorFieldSubexpr(tls *libc.TLS, pVector uintptr, i int32) uintptr { /* sqlite3.c:100159:21: */
if Xsqlite3ExprIsVector(tls, pVector) != 0 {
@@ -75334,7 +77913,7 @@ func Xsqlite3VectorFieldSubexpr(tls *crt.TLS, pVector uintptr, i int32) uintptr
// A trick to cause a TK_SELECT pVector to be deleted together with
// the returned Expr object is to attach the pVector to the pRight field
// of the returned TK_SELECT_COLUMN Expr object.
-func Xsqlite3ExprForVectorField(tls *crt.TLS, pParse uintptr, pVector uintptr, iField int32) uintptr { /* sqlite3.c:99979:21: */
+func Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32) uintptr { /* sqlite3.c:100193:21: */
var pRet uintptr
if int32((*Expr)(unsafe.Pointer(pVector)).Fop) == 136 {
@@ -75374,7 +77953,7 @@ func Xsqlite3ExprForVectorField(tls *crt.TLS, pParse uintptr, pVector uintptr, i
// of registers in which the result is stored).
//
// If pExpr is not a TK_SELECT expression, return 0.
-func exprCodeSubselect(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:100025:12: */
+func exprCodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:100239:12: */
var reg int32 = 0
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 136 {
reg = Xsqlite3CodeSubselect(tls, pParse, pExpr)
@@ -75398,7 +77977,7 @@ func exprCodeSubselect(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 { /* s
//
// Before returning, output parameter (*ppExpr) is set to point to the
// Expr object corresponding to element iElem of the vector.
-func exprVectorRegister(tls *crt.TLS, pParse uintptr, pVector uintptr, iField int32, regSelect int32, ppExpr uintptr, pRegFree uintptr) int32 { /* sqlite3.c:100053:12: */
+func exprVectorRegister(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32, regSelect int32, ppExpr uintptr, pRegFree uintptr) int32 { /* sqlite3.c:100267:12: */
var op U8 = (*Expr)(unsafe.Pointer(pVector)).Fop
if int32(op) == 173 {
@@ -75422,7 +78001,7 @@ func exprVectorRegister(tls *crt.TLS, pParse uintptr, pVector uintptr, iField in
// if pExpr->op==TK_IS: op==TK_EQ and p5==SQLITE_NULLEQ
// if pExpr->op==TK_ISNOT: op==TK_NE and p5==SQLITE_NULLEQ
// otherwise: op==pExpr->op and p5==0
-func codeVectorCompare(tls *crt.TLS, pParse uintptr, pExpr uintptr, dest int32, op U8, p5 U8) { /* sqlite3.c:100086:13: */
+func codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, op U8, p5 U8) { /* sqlite3.c:100300:13: */
bp := tls.Alloc(28)
defer tls.Free(28)
@@ -75435,13 +78014,13 @@ func codeVectorCompare(tls *crt.TLS, pParse uintptr, pExpr uintptr, dest int32,
var regRight int32 = 0
var opx U8 = op
var addrDone int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
- var isCommuted int32 = (crt.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000200))) != U32(0)))
+ var isCommuted int32 = (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000200))) != U32(0)))
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
return
}
if nLeft != Xsqlite3ExprVectorSize(tls, pRight) {
- Xsqlite3ErrorMsg(tls, pParse, ts+6206 /* "row value misuse..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+8404 /* "row value misuse..." */, 0)
return
}
@@ -75493,12 +78072,105 @@ func codeVectorCompare(tls *crt.TLS, pParse uintptr, pExpr uintptr, dest int32,
Xsqlite3VdbeResolveLabel(tls, v, addrDone)
}
-// Propagate all EP_Propagate flags from the Expr.x.pList into
-// Expr.flags.
-func Xsqlite3ExprSetHeightAndFlags(tls *crt.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:100270:21: */
- if ((p != 0) && (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0)) && !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(0x000800))) != U32(0)) {
+// Check that argument nHeight is less than or equal to the maximum
+// expression depth allowed. If it is not, leave an error message in
+// pParse.
+func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32 { /* sqlite3.c:100385:20: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 = 0
+ var mxHeight int32 = *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + uintptr(3)*4))
+ if nHeight > mxHeight {
+ Xsqlite3ErrorMsg(tls, pParse,
+ ts+9303 /* "Expression tree ..." */, libc.VaList(bp, mxHeight))
+ rc = 1
+ }
+ return rc
+}
+
+// The following three functions, heightOfExpr(), heightOfExprList()
+// and heightOfSelect(), are used to determine the maximum height
+// of any expression tree referenced by the structure passed as the
+// first argument.
+//
+// If this maximum height is greater than the current value pointed
+// to by pnHeight, the second parameter, then set *pnHeight to that
+// value.
+func heightOfExpr(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:100406:13: */
+ if p != 0 {
+ if (*Expr)(unsafe.Pointer(p)).FnHeight > *(*int32)(unsafe.Pointer(pnHeight)) {
+ *(*int32)(unsafe.Pointer(pnHeight)) = (*Expr)(unsafe.Pointer(p)).FnHeight
+ }
+ }
+}
+func heightOfExprList(tls *libc.TLS, p uintptr, pnHeight uintptr) { /* sqlite3.c:100413:13: */
+ if p != 0 {
+ var i int32
+ for i = 0; i < (*ExprList)(unsafe.Pointer(p)).FnExpr; i++ {
+ heightOfExpr(tls, (*ExprList_item)(unsafe.Pointer((p+8 /* &.a */)+uintptr(i)*32)).FpExpr, pnHeight)
+ }
+ }
+}
+func heightOfSelect(tls *libc.TLS, pSelect uintptr, pnHeight uintptr) { /* sqlite3.c:100421:13: */
+ var p uintptr
+ for p = pSelect; p != 0; p = (*Select)(unsafe.Pointer(p)).FpPrior {
+ heightOfExpr(tls, (*Select)(unsafe.Pointer(p)).FpWhere, pnHeight)
+ heightOfExpr(tls, (*Select)(unsafe.Pointer(p)).FpHaving, pnHeight)
+ heightOfExpr(tls, (*Select)(unsafe.Pointer(p)).FpLimit, pnHeight)
+ heightOfExprList(tls, (*Select)(unsafe.Pointer(p)).FpEList, pnHeight)
+ heightOfExprList(tls, (*Select)(unsafe.Pointer(p)).FpGroupBy, pnHeight)
+ heightOfExprList(tls, (*Select)(unsafe.Pointer(p)).FpOrderBy, pnHeight)
+ }
+}
+
+// Set the Expr.nHeight variable in the structure passed as an
+// argument. An expression with no children, Expr.pList or
+// Expr.pSelect member has a height of 1. Any other expression
+// has a height equal to the maximum height of any other
+// referenced Expr plus one.
+//
+// Also propagate EP_Propagate flags up from Expr.x.pList to Expr.flags,
+// if appropriate.
+func exprSetHeight(tls *libc.TLS, p uintptr) { /* sqlite3.c:100443:13: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ *(*int32)(unsafe.Pointer(bp /* nHeight */)) = 0
+ heightOfExpr(tls, (*Expr)(unsafe.Pointer(p)).FpLeft, bp /* &nHeight */)
+ heightOfExpr(tls, (*Expr)(unsafe.Pointer(p)).FpRight, bp /* &nHeight */)
+ if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(0x000800))) != U32(0) {
+ heightOfSelect(tls, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), bp /* &nHeight */)
+ } else if *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0 {
+ heightOfExprList(tls, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)), bp /* &nHeight */)
*(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= ((U32((0x000100 | 0x200000) | 0x000004)) & Xsqlite3ExprListFlags(tls, *(*uintptr)(unsafe.Pointer(p + 32 /* &.x */))))
}
+ (*Expr)(unsafe.Pointer(p)).FnHeight = (*(*int32)(unsafe.Pointer(bp /* nHeight */)) + 1)
+}
+
+// Set the Expr.nHeight variable using the exprSetHeight() function. If
+// the height is greater than the maximum allowed expression depth,
+// leave an error in pParse.
+//
+// Also propagate all EP_Propagate flags from the Expr.x.pList into
+// Expr.flags.
+func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:100464:21: */
+ if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
+ return
+ }
+ exprSetHeight(tls, p)
+ Xsqlite3ExprCheckHeight(tls, pParse, (*Expr)(unsafe.Pointer(p)).FnHeight)
+}
+
+// Return the maximum height of any expression tree referenced
+// by the select statement passed as an argument.
+func Xsqlite3SelectExprHeight(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:100474:20: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ *(*int32)(unsafe.Pointer(bp /* nHeight */)) = 0
+ heightOfSelect(tls, p, bp /* &nHeight */)
+ return *(*int32)(unsafe.Pointer(bp /* nHeight */))
}
// This routine is the core allocator for Expr nodes.
@@ -75519,7 +78191,7 @@ func Xsqlite3ExprSetHeightAndFlags(tls *crt.TLS, pParse uintptr, p uintptr) { /*
// stored in u.zToken. Instead, the integer values is written
// into u.iValue and the EP_IntValue flag is set. No extra storage
// is allocated to hold the integer text and the dequote flag is ignored.
-func Xsqlite3ExprAlloc(tls *crt.TLS, db uintptr, op int32, pToken uintptr, dequote int32) uintptr { /* sqlite3.c:100298:21: */
+func Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequote int32) uintptr { /* sqlite3.c:100512:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -75535,7 +78207,7 @@ func Xsqlite3ExprAlloc(tls *crt.TLS, db uintptr, op int32, pToken uintptr, dequo
}
pNew = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(unsafe.Sizeof(Expr{})) + uint64(nExtra))))
if pNew != 0 {
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Expr{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Expr{})))
(*Expr)(unsafe.Pointer(pNew)).Fop = U8(op)
(*Expr)(unsafe.Pointer(pNew)).FiAgg = int16(-1)
if pToken != 0 {
@@ -75551,7 +78223,7 @@ func Xsqlite3ExprAlloc(tls *crt.TLS, db uintptr, op int32, pToken uintptr, dequo
*(*uintptr)(unsafe.Pointer(pNew + 8 /* &.u */)) = (pNew + uintptr(1)*72)
if (*Token)(unsafe.Pointer(pToken)).Fn != 0 {
- crt.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(pNew + 8 /* &.u */)), (*Token)(unsafe.Pointer(pToken)).Fz, uint64((*Token)(unsafe.Pointer(pToken)).Fn))
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(pNew + 8 /* &.u */)), (*Token)(unsafe.Pointer(pToken)).Fz, uint64((*Token)(unsafe.Pointer(pToken)).Fn))
}
*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 8 /* &.u */)) + uintptr((*Token)(unsafe.Pointer(pToken)).Fn))) = int8(0)
if (dequote != 0) && ((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 8 /* &.u */)) + uintptr(0))))]) & 0x80) != 0) {
@@ -75559,13 +78231,14 @@ func Xsqlite3ExprAlloc(tls *crt.TLS, db uintptr, op int32, pToken uintptr, dequo
}
}
}
+ (*Expr)(unsafe.Pointer(pNew)).FnHeight = 1
}
return pNew
}
// Allocate a new expression node from a zero-terminated token that has
// already been dequoted.
-func Xsqlite3Expr(tls *crt.TLS, db uintptr, op int32, zToken uintptr) uintptr { /* sqlite3.c:100346:21: */
+func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr { /* sqlite3.c:100560:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -75580,7 +78253,7 @@ func Xsqlite3Expr(tls *crt.TLS, db uintptr, op int32, zToken uintptr) uintptr {
//
// If pRoot==NULL that means that a memory allocation error has occurred.
// In that case, delete the subtrees pLeft and pRight.
-func Xsqlite3ExprAttachSubtrees(tls *crt.TLS, db uintptr, pRoot uintptr, pLeft uintptr, pRight uintptr) { /* sqlite3.c:100363:21: */
+func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft uintptr, pRight uintptr) { /* sqlite3.c:100577:21: */
if pRoot == uintptr(0) {
Xsqlite3ExprDelete(tls, db, pLeft)
@@ -75594,6 +78267,7 @@ func Xsqlite3ExprAttachSubtrees(tls *crt.TLS, db uintptr, pRoot uintptr, pLeft u
(*Expr)(unsafe.Pointer(pRoot)).FpLeft = pLeft
*(*U32)(unsafe.Pointer(pRoot + 4 /* &.flags */)) |= ((U32((0x000100 | 0x200000) | 0x000004)) & (*Expr)(unsafe.Pointer(pLeft)).Fflags)
}
+ exprSetHeight(tls, pRoot)
}
}
@@ -75602,14 +78276,15 @@ func Xsqlite3ExprAttachSubtrees(tls *crt.TLS, db uintptr, pRoot uintptr, pLeft u
// One or both of the subtrees can be NULL. Return a pointer to the new
// Expr node. Or, if an OOM error occurs, set pParse->db->mallocFailed,
// free the subtrees and return NULL.
-func Xsqlite3PExpr(tls *crt.TLS, pParse uintptr, op int32, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100393:21: */
+func Xsqlite3PExpr(tls *libc.TLS, pParse uintptr, op int32, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100607:21: */
var p uintptr
p = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Expr{})))
if p != 0 {
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Expr{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Expr{})))
(*Expr)(unsafe.Pointer(p)).Fop = (U8(op & 0xff))
(*Expr)(unsafe.Pointer(p)).FiAgg = int16(-1)
Xsqlite3ExprAttachSubtrees(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p, pLeft, pRight)
+ Xsqlite3ExprCheckHeight(tls, pParse, (*Expr)(unsafe.Pointer(p)).FnHeight)
} else {
Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pLeft)
Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pRight)
@@ -75619,7 +78294,7 @@ func Xsqlite3PExpr(tls *crt.TLS, pParse uintptr, op int32, pLeft uintptr, pRight
// Add pSelect to the Expr.x.pSelect field. Or, if pExpr is NULL (due
// do a memory allocation failure) then delete the pSelect object.
-func Xsqlite3PExprAddSelect(tls *crt.TLS, pParse uintptr, pExpr uintptr, pSelect uintptr) { /* sqlite3.c:100418:21: */
+func Xsqlite3PExprAddSelect(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSelect uintptr) { /* sqlite3.c:100632:21: */
if pExpr != 0 {
*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) = pSelect
*(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(0x000800 | 0x200000))
@@ -75636,7 +78311,7 @@ func Xsqlite3PExprAddSelect(tls *crt.TLS, pParse uintptr, pExpr uintptr, pSelect
// If one side or the other of the AND is known to be false, then instead
// of returning an AND expression, just return a constant expression with
// a value of false.
-func Xsqlite3ExprAnd(tls *crt.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100438:21: */
+func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:100652:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if pLeft == uintptr(0) {
return pRight
@@ -75646,7 +78321,7 @@ func Xsqlite3ExprAnd(tls *crt.TLS, pParse uintptr, pLeft uintptr, pRight uintptr
!(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2) {
Xsqlite3ExprDelete(tls, db, pLeft)
Xsqlite3ExprDelete(tls, db, pRight)
- return Xsqlite3Expr(tls, db, 152, ts+7105 /* "0" */)
+ return Xsqlite3Expr(tls, db, 152, ts+9351 /* "0" */)
} else {
return Xsqlite3PExpr(tls, pParse, 44, pLeft, pRight)
}
@@ -75655,7 +78330,7 @@ func Xsqlite3ExprAnd(tls *crt.TLS, pParse uintptr, pLeft uintptr, pRight uintptr
// Construct a new expression node for a function with multiple
// arguments.
-func Xsqlite3ExprFunction(tls *crt.TLS, pParse uintptr, pList uintptr, pToken uintptr, eDistinct int32) uintptr { /* sqlite3.c:100459:21: */
+func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr, eDistinct int32) uintptr { /* sqlite3.c:100673:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -75668,7 +78343,7 @@ func Xsqlite3ExprFunction(tls *crt.TLS, pParse uintptr, pList uintptr, pToken ui
return uintptr(0)
}
if (pList != 0) && ((*ExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + uintptr(6)*4))) {
- Xsqlite3ErrorMsg(tls, pParse, ts+7107 /* "too many argumen..." */, crt.VaList(bp, pToken))
+ Xsqlite3ErrorMsg(tls, pParse, ts+9353 /* "too many argumen..." */, libc.VaList(bp, pToken))
}
*(*uintptr)(unsafe.Pointer(pNew + 32 /* &.x */)) = pList
*(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(0x000004))
@@ -75689,7 +78364,7 @@ func Xsqlite3ExprFunction(tls *crt.TLS, pParse uintptr, pList uintptr, pToken ui
// top-level SQL
//
// If the function is not usable, create an error.
-func Xsqlite3ExprFunctionUsable(tls *crt.TLS, pParse uintptr, pExpr uintptr, pDef uintptr) { /* sqlite3.c:100495:21: */
+func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pDef uintptr) { /* sqlite3.c:100709:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -75702,7 +78377,7 @@ func Xsqlite3ExprFunctionUsable(tls *crt.TLS, pParse uintptr, pExpr uintptr, pDe
// is tagged with SQLITE_FUNC_UNSAFE) and
// SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning
// that the schema is possibly tainted).
- Xsqlite3ErrorMsg(tls, pParse, ts+7141 /* "unsafe use of %s..." */, crt.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+9387 /* "unsafe use of %s..." */, libc.VaList(bp, (*FuncDef)(unsafe.Pointer(pDef)).FzName))
}
}
}
@@ -75721,7 +78396,7 @@ func Xsqlite3ExprFunctionUsable(tls *crt.TLS, pParse uintptr, pExpr uintptr, pDe
// as the previous instance of the same wildcard. Or if this is the first
// instance of the wildcard, the next sequential variable number is
// assigned.
-func Xsqlite3ExprAssignVarNumber(tls *crt.TLS, pParse uintptr, pExpr uintptr, n U32) { /* sqlite3.c:100534:21: */
+func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n U32) { /* sqlite3.c:100748:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -75738,7 +78413,7 @@ func Xsqlite3ExprAssignVarNumber(tls *crt.TLS, pParse uintptr, pExpr uintptr, n
if int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) == 0 {
// Wildcard of the form "?". Assign the next variable number
- x = crt.PreIncInt16(&(*Parse)(unsafe.Pointer(pParse)).FnVar, 1)
+ x = libc.PreIncInt16(&(*Parse)(unsafe.Pointer(pParse)).FnVar, 1)
} else {
var doAdd int32 = 0
if int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '?' {
@@ -75751,12 +78426,12 @@ func Xsqlite3ExprAssignVarNumber(tls *crt.TLS, pParse uintptr, pExpr uintptr, n
*(*I64)(unsafe.Pointer(bp + 8 /* i */)) = (I64(int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) - '0')) // The common case of ?N for a single digit N
bOk = 1
} else {
- bOk = (crt.Bool32(0 == Xsqlite3Atoi64(tls, (z+uintptr(1)), bp+8 /* &i */, (int32(n-U32(1))), uint8(1))))
+ bOk = (libc.Bool32(0 == Xsqlite3Atoi64(tls, (z+uintptr(1)), bp+8 /* &i */, (int32(n-U32(1))), uint8(1))))
}
if ((bOk == 0) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) < int64(1))) || (*(*I64)(unsafe.Pointer(bp + 8 /* i */)) > I64(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(9)*4)))) {
- Xsqlite3ErrorMsg(tls, pParse, ts+7160, /* "variable number ..." */
- crt.VaList(bp, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(9)*4))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+9406, /* "variable number ..." */
+ libc.VaList(bp, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(9)*4))))
return
}
x = YnVar(*(*I64)(unsafe.Pointer(bp + 8 /* i */)))
@@ -75772,7 +78447,7 @@ func Xsqlite3ExprAssignVarNumber(tls *crt.TLS, pParse uintptr, pExpr uintptr, n
// has never appeared before, reuse the same variable number
x = YnVar(Xsqlite3VListNameToNum(tls, (*Parse)(unsafe.Pointer(pParse)).FpVList, z, int32(n)))
if int32(x) == 0 {
- x = crt.PreIncInt16(&(*Parse)(unsafe.Pointer(pParse)).FnVar, 1)
+ x = libc.PreIncInt16(&(*Parse)(unsafe.Pointer(pParse)).FnVar, 1)
doAdd = 1
}
}
@@ -75782,12 +78457,12 @@ func Xsqlite3ExprAssignVarNumber(tls *crt.TLS, pParse uintptr, pExpr uintptr, n
}
(*Expr)(unsafe.Pointer(pExpr)).FiColumn = x
if int32(x) > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(9)*4)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+7203 /* "too many SQL var..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+9449 /* "too many SQL var..." */, 0)
}
}
// Recursively delete an expression tree.
-func sqlite3ExprDeleteNN(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:100602:29: */
+func sqlite3ExprDeleteNN(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:100816:29: */
// Sanity check: Assert that the IntValue is non-negative if it exists
@@ -75817,7 +78492,7 @@ func sqlite3ExprDeleteNN(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:100
Xsqlite3DbFreeNN(tls, db, p)
}
}
-func Xsqlite3ExprDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:100641:21: */
+func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:100855:21: */
if p != 0 {
sqlite3ExprDeleteNN(tls, db, p)
}
@@ -75825,7 +78500,7 @@ func Xsqlite3ExprDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:1006
// Invoke sqlite3RenameExprUnmap() and sqlite3ExprDelete() on the
// expression.
-func Xsqlite3ExprUnmapAndDelete(tls *crt.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:100648:21: */
+func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:100862:21: */
if p != 0 {
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2 {
Xsqlite3RenameExprUnmap(tls, pParse, p)
@@ -75837,12 +78512,12 @@ func Xsqlite3ExprUnmapAndDelete(tls *crt.TLS, pParse uintptr, p uintptr) { /* sq
// Return the number of bytes allocated for the expression structure
// passed as the first argument. This is always one of EXPR_FULLSIZE,
// EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE.
-func exprStructSize(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:100662:12: */
+func exprStructSize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:100876:12: */
if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(0x004000))) != U32(0) {
return int32((uintptr(0) + 16 /* &.pLeft */))
}
if ((*Expr)(unsafe.Pointer((p))).Fflags & (U32(0x002000))) != U32(0) {
- return int32((uintptr(0) + 40 /* &.iTable */))
+ return int32((uintptr(0) + 44 /* &.iTable */))
}
return int32(unsafe.Sizeof(Expr{}))
}
@@ -75879,7 +78554,7 @@ func exprStructSize(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:100662:12: */
// to reduce a pristine expression tree from the parser. The implementation
// of dupedExprStructSize() contain multiple assert() statements that attempt
// to enforce this constraint.
-func dupedExprStructSize(tls *crt.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100702:12: */
+func dupedExprStructSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100916:12: */
var nSize int32
// Only one flag value allowed
@@ -75889,7 +78564,7 @@ func dupedExprStructSize(tls *crt.TLS, p uintptr, flags int32) int32 { /* sqlite
} else {
if ((*Expr)(unsafe.Pointer(p)).FpLeft != 0) || (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0) {
- nSize = (int32((uint64((uintptr(0) + 40 /* &.iTable */))) | uint64(0x002000)))
+ nSize = (int32((uint64((uintptr(0) + 44 /* &.iTable */))) | uint64(0x002000)))
} else {
nSize = (int32((uint64((uintptr(0) + 16 /* &.pLeft */))) | uint64(0x004000)))
@@ -75901,12 +78576,12 @@ func dupedExprStructSize(tls *crt.TLS, p uintptr, flags int32) int32 { /* sqlite
// This function returns the space in bytes required to store the copy
// of the Expr structure and a copy of the Expr.u.zToken string (if that
// string is defined.)
-func dupedExprNodeSize(tls *crt.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100733:12: */
+func dupedExprNodeSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100947:12: */
var nByte int32 = (dupedExprStructSize(tls, p, flags) & 0xfff)
if !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(0x000400))) != U32(0)) && (*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) != 0) {
- nByte = int32(Size_t(nByte) + ((crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) & uint64(0x3fffffff)) + uint64(1)))
+ nByte = int32(Size_t(nByte) + ((libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */))) & uint64(0x3fffffff)) + uint64(1)))
}
- return (((nByte) + 7) & ^int32(crt.Int32FromInt32(7)))
+ return (((nByte) + 7) & ^int32(libc.Int32FromInt32(7)))
}
// Return the number of bytes required to create a duplicate of the
@@ -75920,7 +78595,7 @@ func dupedExprNodeSize(tls *crt.TLS, p uintptr, flags int32) int32 { /* sqlite3.
// space to duplicate all Expr nodes in the tree formed by Expr.pLeft
// and Expr.pRight variables (but not for any structures pointed to or
// descended from the Expr.x.pList or Expr.x.pSelect variables).
-func dupedExprSize(tls *crt.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100754:12: */
+func dupedExprSize(tls *libc.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:100968:12: */
var nByte int32 = 0
if p != 0 {
nByte = dupedExprNodeSize(tls, p, flags)
@@ -75937,7 +78612,7 @@ func dupedExprSize(tls *crt.TLS, p uintptr, flags int32) int32 { /* sqlite3.c:10
// (if applicable), and the copies of the p->pLeft and p->pRight expressions,
// if any. Before returning, *pzBuffer is set to the first byte past the
// portion of the buffer copied into by this function.
-func exprDup(tls *crt.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uintptr) uintptr { /* sqlite3.c:100773:13: */
+func exprDup(tls *libc.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uintptr) uintptr { /* sqlite3.c:100987:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -75971,17 +78646,17 @@ func exprDup(tls *crt.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uintp
}
if dupFlags != 0 {
- crt.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)), p, uint64(nNewSize))
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)), p, uint64(nNewSize))
} else {
var nSize U32 = U32(exprStructSize(tls, p))
- crt.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)), p, uint64(nSize))
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp /* zAlloc */)), p, uint64(nSize))
if (uint64(nSize) < uint64(unsafe.Sizeof(Expr{}))) {
- crt.Xmemset(tls, (*(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) + uintptr(nSize)), 0, (uint64(unsafe.Sizeof(Expr{})) - uint64(nSize)))
+ libc.Xmemset(tls, (*(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) + uintptr(nSize)), 0, (uint64(unsafe.Sizeof(Expr{})) - uint64(nSize)))
}
}
// Set the EP_Reduced, EP_TokenOnly, and EP_Static flags appropriately.
- *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) &= (^U32(crt.Int32FromInt32((((0x002000 | 0x004000) | 0x8000000) | 0x010000))))
+ *(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) &= (^U32(libc.Int32FromInt32((((0x002000 | 0x004000) | 0x8000000) | 0x010000))))
*(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (nStructSize & (uint32(0x002000 | 0x004000)))
*(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (staticFlag)
@@ -75990,8 +78665,8 @@ func exprDup(tls *crt.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uintp
// Copy the p->u.zToken string, if any.
if nToken != 0 {
- var zToken uintptr = crt.AssignPtrUintptr(pNew+8 /* &.u */ /* &.zToken */, (*(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) + uintptr(nNewSize)))
- crt.Xmemcpy(tls, zToken, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), uint64(nToken))
+ var zToken uintptr = libc.AssignPtrUintptr(pNew+8 /* &.u */ /* &.zToken */, (*(*uintptr)(unsafe.Pointer(bp /* zAlloc */)) + uintptr(nNewSize)))
+ libc.Xmemcpy(tls, zToken, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), uint64(nToken))
}
if U32(0) == (((*Expr)(unsafe.Pointer(p)).Fflags | (*Expr)(unsafe.Pointer(pNew)).Fflags) & (U32(0x004000 | 0x800000))) {
@@ -76044,7 +78719,7 @@ func exprDup(tls *crt.TLS, db uintptr, p uintptr, dupFlags int32, pzBuffer uintp
// Create and return a deep copy of the object passed as the second
// argument. If an OOM condition is encountered, NULL is returned
// and the db->mallocFailed flag set.
-func withDup(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:100882:13: */
+func withDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101096:13: */
var pRet uintptr = uintptr(0)
if p != 0 {
var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(With{})) + (uint64(unsafe.Sizeof(Cte{})) * (uint64((*With)(unsafe.Pointer(p)).FnCte - 1)))))
@@ -76066,7 +78741,7 @@ func withDup(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:100882:
// gatherSelectWindowsCallback() are used to scan all the expressions
// an a newly duplicated SELECT statement and gather all of the Window
// objects found there, assembling them onto the linked list at Select->pWin.
-func gatherSelectWindowsCallback(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:100910:12: */
+func gatherSelectWindowsCallback(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101124:12: */
if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 169) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x1000000))) != U32(0)) {
var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */))
var pWin uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */))
@@ -76075,23 +78750,23 @@ func gatherSelectWindowsCallback(tls *crt.TLS, pWalker uintptr, pExpr uintptr) i
}
return 0
}
-func gatherSelectWindowsSelectCallback(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:100921:12: */
+func gatherSelectWindowsSelectCallback(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:101135:12: */
if p == *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)) {
return 0
}
return 1
}
-func gatherSelectWindows(tls *crt.TLS, p uintptr) { /* sqlite3.c:100924:13: */
+func gatherSelectWindows(tls *libc.TLS, p uintptr) { /* sqlite3.c:101138:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
// var w Walker at bp, 48
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{gatherSelectWindowsCallback}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{gatherSelectWindowsSelectCallback}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0)
(*Walker)(unsafe.Pointer(bp /* &w */)).FpParse = uintptr(0)
@@ -76114,14 +78789,14 @@ func gatherSelectWindows(tls *crt.TLS, p uintptr) { /* sqlite3.c:100924:13: */
// If the EXPRDUP_REDUCE flag is set, then the structure returned is a
// truncated version of the usual Expr structure that will be stored as
// part of the in-memory representation of the database schema.
-func Xsqlite3ExprDup(tls *crt.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:100953:21: */
+func Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:101167:21: */
if p != 0 {
return exprDup(tls, db, p, flags, uintptr(0))
}
return uintptr(0)
}
-func Xsqlite3ExprListDup(tls *crt.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:100957:25: */
+func Xsqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:101171:25: */
var pNew uintptr
var pItem uintptr
var pOldItem uintptr
@@ -76149,11 +78824,11 @@ __1:
(*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = Xsqlite3ExprDup(tls, db, pOldExpr, flags)
if ((pOldExpr != 0) &&
(int32((*Expr)(unsafe.Pointer(pOldExpr)).Fop) == 175)) &&
- ((crt.AssignUintptr(&pNewExpr, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)) != uintptr(0)) {
+ ((libc.AssignUintptr(&pNewExpr, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)) != uintptr(0)) {
if int32((*Expr)(unsafe.Pointer(pNewExpr)).FiColumn) == 0 {
- pPriorSelectCol = crt.AssignPtrUintptr(pNewExpr+16 /* &.pLeft */, (*Expr)(unsafe.Pointer(pNewExpr)).FpRight)
+ pPriorSelectCol = libc.AssignPtrUintptr(pNewExpr+16 /* &.pLeft */, (*Expr)(unsafe.Pointer(pNewExpr)).FpRight)
} else {
(*Expr)(unsafe.Pointer(pNewExpr)).FpLeft = pPriorSelectCol
@@ -76161,10 +78836,10 @@ __1:
}
(*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer(pOldItem)).FzEName)
(*ExprList_item)(unsafe.Pointer(pItem)).FsortFlags = (*ExprList_item)(unsafe.Pointer(pOldItem)).FsortFlags
- crt.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, uint32(int32(*(*uint8)(unsafe.Pointer(pOldItem + 20 /* &.eEName */))&0x3>>0)), 0, 0x3)
- crt.SetBitFieldPtr8Uint32(pItem+20 /* &.done */, uint32(0), 2, 0x4)
- crt.SetBitFieldPtr8Uint32(pItem+20 /* &.bNulls */, uint32(int32(*(*uint8)(unsafe.Pointer(pOldItem + 20 /* &.bNulls */))&0x20>>5)), 5, 0x20)
- crt.SetBitFieldPtr8Uint32(pItem+20 /* &.bSorterRef */, uint32(int32(*(*uint8)(unsafe.Pointer(pOldItem + 20 /* &.bSorterRef */))&0x10>>4)), 4, 0x10)
+ libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, uint32(int32(*(*uint8)(unsafe.Pointer(pOldItem + 20 /* &.eEName */))&0x3>>0)), 0, 0x3)
+ libc.SetBitFieldPtr8Uint32(pItem+20 /* &.done */, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pItem+20 /* &.bNulls */, uint32(int32(*(*uint8)(unsafe.Pointer(pOldItem + 20 /* &.bNulls */))&0x20>>5)), 5, 0x20)
+ libc.SetBitFieldPtr8Uint32(pItem+20 /* &.bSorterRef */, uint32(int32(*(*uint8)(unsafe.Pointer(pOldItem + 20 /* &.bSorterRef */))&0x10>>4)), 4, 0x10)
(*ExprList_item)(unsafe.Pointer(pItem)).Fu = (*ExprList_item)(unsafe.Pointer(pOldItem)).Fu
}
goto __2
@@ -76183,7 +78858,7 @@ __3:
// the build, then none of the following routines, except for
// sqlite3SelectDup(), can be called. sqlite3SelectDup() is sometimes
// called with a NULL argument.
-func Xsqlite3SrcListDup(tls *crt.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:101008:24: */
+func Xsqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr { /* sqlite3.c:101222:24: */
var pNew uintptr
var i int32
var nByte int32
@@ -76201,7 +78876,7 @@ func Xsqlite3SrcListDup(tls *crt.TLS, db uintptr, p uintptr, flags int32) uintpt
if pNew == uintptr(0) {
return uintptr(0)
}
- (*SrcList)(unsafe.Pointer(pNew)).FnSrc = int32(crt.AssignPtrUint32(pNew+4 /* &.nAlloc */, U32((*SrcList)(unsafe.Pointer(p)).FnSrc)))
+ (*SrcList)(unsafe.Pointer(pNew)).FnSrc = int32(libc.AssignPtrUint32(pNew+4 /* &.nAlloc */, U32((*SrcList)(unsafe.Pointer(p)).FnSrc)))
for i = 0; i < (*SrcList)(unsafe.Pointer(p)).FnSrc; i++ {
var pNewItem uintptr = ((pNew + 8 /* &.a */) + uintptr(i)*112)
var pOldItem uintptr = ((p + 8 /* &.a */) + uintptr(i)*112)
@@ -76221,7 +78896,7 @@ func Xsqlite3SrcListDup(tls *crt.TLS, db uintptr, p uintptr, flags int32) uintpt
if uint32(int32(*(*uint8)(unsafe.Pointer(pNewItem + 60 /* &.fg */ + 4 /* &.isTabFunc */))&0x4>>2)) != 0 {
*(*uintptr)(unsafe.Pointer(pNewItem + 96 /* &.u1 */)) = Xsqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 96 /* &.u1 */)), flags)
}
- pTab = crt.AssignPtrUintptr(pNewItem+32 /* &.pTab */, (*SrcList_item)(unsafe.Pointer(pOldItem)).FpTab)
+ pTab = libc.AssignPtrUintptr(pNewItem+32 /* &.pTab */, (*SrcList_item)(unsafe.Pointer(pOldItem)).FpTab)
if pTab != 0 {
(*Table)(unsafe.Pointer(pTab)).FnTabRef++
}
@@ -76232,7 +78907,7 @@ func Xsqlite3SrcListDup(tls *crt.TLS, db uintptr, p uintptr, flags int32) uintpt
}
return pNew
}
-func Xsqlite3IdListDup(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101049:23: */
+func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:101263:23: */
var pNew uintptr
var i int32
@@ -76260,7 +78935,7 @@ func Xsqlite3IdListDup(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3
}
return pNew
}
-func Xsqlite3SelectDup(tls *crt.TLS, db uintptr, pDup uintptr, flags int32) uintptr { /* sqlite3.c:101073:23: */
+func Xsqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) uintptr { /* sqlite3.c:101287:23: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -76286,7 +78961,7 @@ func Xsqlite3SelectDup(tls *crt.TLS, db uintptr, pDup uintptr, flags int32) uint
(*Select)(unsafe.Pointer(pNew)).FpLimit = Xsqlite3ExprDup(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit, flags)
(*Select)(unsafe.Pointer(pNew)).FiLimit = 0
(*Select)(unsafe.Pointer(pNew)).FiOffset = 0
- (*Select)(unsafe.Pointer(pNew)).FselFlags = ((*Select)(unsafe.Pointer(p)).FselFlags & ^U32(crt.Int32FromInt32(0x0000020)))
+ (*Select)(unsafe.Pointer(pNew)).FselFlags = ((*Select)(unsafe.Pointer(p)).FselFlags & ^U32(libc.Int32FromInt32(0x0000020)))
*(*int32)(unsafe.Pointer((pNew + 20 /* &.addrOpenEphm */) + uintptr(0)*4)) = -1
*(*int32)(unsafe.Pointer((pNew + 20 /* &.addrOpenEphm */) + uintptr(1)*4)) = -1
(*Select)(unsafe.Pointer(pNew)).FnSelectRow = (*Select)(unsafe.Pointer(p)).FnSelectRow
@@ -76318,7 +78993,7 @@ func Xsqlite3SelectDup(tls *crt.TLS, db uintptr, pDup uintptr, flags int32) uint
// If a memory allocation error occurs, the entire list is freed and
// NULL is returned. If non-NULL is returned, then it is guaranteed
// that the new entry was successfully appended.
-func Xsqlite3ExprListAppend(tls *crt.TLS, pParse uintptr, pList uintptr, pExpr uintptr) uintptr { /* sqlite3.c:101136:25: */
+func Xsqlite3ExprListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pExpr uintptr) uintptr { /* sqlite3.c:101350:25: */
var pItem uintptr
var db uintptr
var pNew uintptr
@@ -76353,9 +79028,9 @@ __4:
;
__2:
;
- pItem = ((pList + 8 /* &.a */) + uintptr(crt.PostIncInt32(&(*ExprList)(unsafe.Pointer(pList)).FnExpr, 1))*32)
+ pItem = ((pList + 8 /* &.a */) + uintptr(libc.PostIncInt32(&(*ExprList)(unsafe.Pointer(pList)).FnExpr, 1))*32)
- crt.Xmemset(tls, (pItem + 8 /* &.zEName */), 0, (uint64(unsafe.Sizeof(ExprList_item{})) - (uint64((uintptr(0) + 8 /* &.zEName */)))))
+ libc.Xmemset(tls, (pItem + 8 /* &.zEName */), 0, (uint64(unsafe.Sizeof(ExprList_item{})) - (uint64((uintptr(0) + 8 /* &.zEName */)))))
(*ExprList_item)(unsafe.Pointer(pItem)).FpExpr = pExpr
return pList
@@ -76375,7 +79050,7 @@ no_mem:
// For each term of the vector assignment, append new entries to the
// expression list pList. In the case of a subquery on the RHS, append
// TK_SELECT_COLUMN expressions.
-func Xsqlite3ExprListAppendVector(tls *crt.TLS, pParse uintptr, pList uintptr, pColumns uintptr, pExpr uintptr) uintptr { /* sqlite3.c:101184:25: */
+func Xsqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, pColumns uintptr, pExpr uintptr) uintptr { /* sqlite3.c:101398:25: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -76410,11 +79085,11 @@ __2:
// the size of the RHS and LHS match. But if the RHS is a SELECT,
// wildcards ("*") in the result set of the SELECT must be expanded before
// we can do the size check, so defer the size check until code generation.
- if !((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != 136) && ((*IdList)(unsafe.Pointer(pColumns)).FnId != (crt.AssignInt32(&n, Xsqlite3ExprVectorSize(tls, pExpr))))) {
+ if !((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != 136) && ((*IdList)(unsafe.Pointer(pColumns)).FnId != (libc.AssignInt32(&n, Xsqlite3ExprVectorSize(tls, pExpr))))) {
goto __3
}
- Xsqlite3ErrorMsg(tls, pParse, ts+7226, /* "%d columns assig..." */
- crt.VaList(bp, (*IdList)(unsafe.Pointer(pColumns)).FnId, n))
+ Xsqlite3ErrorMsg(tls, pParse, ts+9472, /* "%d columns assig..." */
+ libc.VaList(bp, (*IdList)(unsafe.Pointer(pColumns)).FnId, n))
goto vector_append_error
__3:
;
@@ -76473,7 +79148,7 @@ vector_append_error:
}
// Set the sort order for the last element on the given ExprList.
-func Xsqlite3ExprListSetSortOrder(tls *crt.TLS, p uintptr, iSortOrder int32, eNulls int32) { /* sqlite3.c:101248:21: */
+func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eNulls int32) { /* sqlite3.c:101462:21: */
var pItem uintptr
if p == uintptr(0) {
return
@@ -76487,7 +79162,7 @@ func Xsqlite3ExprListSetSortOrder(tls *crt.TLS, p uintptr, iSortOrder int32, eNu
(*ExprList_item)(unsafe.Pointer(pItem)).FsortFlags = U8(iSortOrder)
if eNulls != -1 {
- crt.SetBitFieldPtr8Uint32(pItem+20 /* &.bNulls */, uint32(1), 5, 0x20)
+ libc.SetBitFieldPtr8Uint32(pItem+20 /* &.bNulls */, uint32(1), 5, 0x20)
if iSortOrder != eNulls {
*(*U8)(unsafe.Pointer(pItem + 16 /* &.sortFlags */)) |= U8((0x02))
}
@@ -76500,7 +79175,7 @@ func Xsqlite3ExprListSetSortOrder(tls *crt.TLS, p uintptr, iSortOrder int32, eNu
// pList might be NULL following an OOM error. But pName should never be
// NULL. If a memory allocation fails, the pParse->db->mallocFailed flag
// is set.
-func Xsqlite3ExprListSetName(tls *crt.TLS, pParse uintptr, pList uintptr, pName uintptr, dequote int32) { /* sqlite3.c:101286:21: */
+func Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName uintptr, dequote int32) { /* sqlite3.c:101500:21: */
if pList != 0 {
var pItem uintptr
@@ -76526,7 +79201,7 @@ func Xsqlite3ExprListSetName(tls *crt.TLS, pParse uintptr, pList uintptr, pName
// pList might be NULL following an OOM error. But pSpan should never be
// NULL. If a memory allocation fails, the pParse->db->mallocFailed flag
// is set.
-func Xsqlite3ExprListSetSpan(tls *crt.TLS, pParse uintptr, pList uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:101321:21: */
+func Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:101535:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if pList != 0 {
@@ -76534,37 +79209,37 @@ func Xsqlite3ExprListSetSpan(tls *crt.TLS, pParse uintptr, pList uintptr, zStart
if (*ExprList_item)(unsafe.Pointer(pItem)).FzEName == uintptr(0) {
(*ExprList_item)(unsafe.Pointer(pItem)).FzEName = Xsqlite3DbSpanDup(tls, db, zStart, zEnd)
- crt.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, uint32(1), 0, 0x3)
+ libc.SetBitFieldPtr8Uint32(pItem+20 /* &.eEName */, uint32(1), 0, 0x3)
}
}
}
// If the expression list pEList contains more than iLimit elements,
// leave an error message in pParse.
-func Xsqlite3ExprListCheckLength(tls *crt.TLS, pParse uintptr, pEList uintptr, zObject uintptr) { /* sqlite3.c:101343:21: */
+func Xsqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, zObject uintptr) { /* sqlite3.c:101557:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
var mx int32 = *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + uintptr(2)*4))
if (pEList != 0) && ((*ExprList)(unsafe.Pointer(pEList)).FnExpr > mx) {
- Xsqlite3ErrorMsg(tls, pParse, ts+7256 /* "too many columns..." */, crt.VaList(bp, zObject))
+ Xsqlite3ErrorMsg(tls, pParse, ts+9502 /* "too many columns..." */, libc.VaList(bp, zObject))
}
}
// Delete an entire expression list.
-func exprListDeleteNN(tls *crt.TLS, db uintptr, pList uintptr) { /* sqlite3.c:101359:29: */
+func exprListDeleteNN(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:101573:29: */
var i int32 = (*ExprList)(unsafe.Pointer(pList)).FnExpr
var pItem uintptr = pList + 8 /* &.a */
- for ok := true; ok; ok = (crt.PreDecInt32(&i, 1) > 0) {
+ for ok := true; ok; ok = (libc.PreDecInt32(&i, 1) > 0) {
Xsqlite3ExprDelete(tls, db, (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr)
Xsqlite3DbFree(tls, db, (*ExprList_item)(unsafe.Pointer(pItem)).FzEName)
pItem += 32
}
Xsqlite3DbFreeNN(tls, db, pList)
}
-func Xsqlite3ExprListDelete(tls *crt.TLS, db uintptr, pList uintptr) { /* sqlite3.c:101370:21: */
+func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:101584:21: */
if pList != 0 {
exprListDeleteNN(tls, db, pList)
}
@@ -76572,7 +79247,7 @@ func Xsqlite3ExprListDelete(tls *crt.TLS, db uintptr, pList uintptr) { /* sqlite
// Return the bitwise-OR of all Expr.flags fields in the given
// ExprList.
-func Xsqlite3ExprListFlags(tls *crt.TLS, pList uintptr) U32 { /* sqlite3.c:101378:20: */
+func Xsqlite3ExprListFlags(tls *libc.TLS, pList uintptr) U32 { /* sqlite3.c:101592:20: */
var i int32
var m U32 = U32(0)
@@ -76589,7 +79264,7 @@ func Xsqlite3ExprListFlags(tls *crt.TLS, pList uintptr) U32 { /* sqlite3.c:10137
// pWalker->eCode to zero and abort.
//
// This callback is used by multiple expression walkers.
-func Xsqlite3SelectWalkFail(tls *crt.TLS, pWalker uintptr, NotUsed uintptr) int32 { /* sqlite3.c:101397:20: */
+func Xsqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) int32 { /* sqlite3.c:101611:20: */
_ = NotUsed
(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
return 2
@@ -76601,11 +79276,11 @@ func Xsqlite3SelectWalkFail(tls *crt.TLS, pWalker uintptr, NotUsed uintptr) int3
// "true" EP_IsTrue
// "false" EP_IsFalse
// anything else 0
-func Xsqlite3IsTrueOrFalse(tls *crt.TLS, zIn uintptr) U32 { /* sqlite3.c:101411:20: */
- if Xsqlite3StrICmp(tls, zIn, ts+7279 /* "true" */) == 0 {
+func Xsqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) U32 { /* sqlite3.c:101625:20: */
+ if Xsqlite3StrICmp(tls, zIn, ts+9525 /* "true" */) == 0 {
return U32(0x10000000)
}
- if Xsqlite3StrICmp(tls, zIn, ts+7284 /* "false" */) == 0 {
+ if Xsqlite3StrICmp(tls, zIn, ts+9530 /* "false" */) == 0 {
return U32(0x20000000)
}
return U32(0)
@@ -76614,11 +79289,11 @@ func Xsqlite3IsTrueOrFalse(tls *crt.TLS, zIn uintptr) U32 { /* sqlite3.c:101411:
// If the input expression is an ID with the name "true" or "false"
// then convert it into an TK_TRUEFALSE term. Return non-zero if
// the conversion happened, and zero if the expression is unaltered.
-func Xsqlite3ExprIdToTrueFalse(tls *crt.TLS, pExpr uintptr) int32 { /* sqlite3.c:101423:20: */
+func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101637:20: */
var v U32
if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x4000000))) != U32(0)) &&
- ((crt.AssignUint32(&v, Xsqlite3IsTrueOrFalse(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))) != U32(0)) {
+ ((libc.AssignUint32(&v, Xsqlite3IsTrueOrFalse(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))) != U32(0)) {
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(167)
*(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (v)
return 1
@@ -76628,10 +79303,10 @@ func Xsqlite3ExprIdToTrueFalse(tls *crt.TLS, pExpr uintptr) int32 { /* sqlite3.c
// The argument must be a TK_TRUEFALSE Expr node. Return 1 if it is TRUE
// and 0 if it is FALSE.
-func Xsqlite3ExprTruthValue(tls *crt.TLS, pExpr uintptr) int32 { /* sqlite3.c:101440:20: */
+func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:101654:20: */
pExpr = Xsqlite3ExprSkipCollate(tls, pExpr)
- return (crt.Bool32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + uintptr(4)))) == 0))
+ return (libc.Bool32(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + uintptr(4)))) == 0))
}
// If pExpr is an AND or OR expression, try to simplify it by eliminating
@@ -76645,7 +79320,7 @@ func Xsqlite3ExprTruthValue(tls *crt.TLS, pExpr uintptr) int32 { /* sqlite3.c:10
// (x<10) AND (y=22 OR false) => (x<10) AND (y=22)
// (x<10) AND (y=22 OR true) => (x<10)
// (y=22) OR true => true
-func Xsqlite3ExprSimplifiedAndOr(tls *crt.TLS, pExpr uintptr) uintptr { /* sqlite3.c:101461:21: */
+func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr { /* sqlite3.c:101675:21: */
if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 44) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 43) {
var pRight uintptr = Xsqlite3ExprSimplifiedAndOr(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
@@ -76684,14 +79359,14 @@ func Xsqlite3ExprSimplifiedAndOr(tls *crt.TLS, pExpr uintptr) uintptr { /* sqlit
//
// The sqlite3ExprIsConstantOrFunction() is used for evaluating DEFAULT
// expressions in a CREATE TABLE statement. The Walker.eCode value is 5
-// when parsing an existing schema out of the sqlite_master table and 4
+// when parsing an existing schema out of the sqlite_schema table and 4
// when processing a new CREATE TABLE statement. A bound parameter raises
// an error for new statements, but is silently converted
-// to NULL for existing schemas. This allows sqlite_master tables that
+// to NULL for existing schemas. This allows sqlite_schema tables that
// contain a bound parameter because they were generated by older versions
// of SQLite to be parsed by newer versions of SQLite without raising a
// malformed schema error.
-func exprNodeIsConstant(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101502:12: */
+func exprNodeIsConstant(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101716:12: */
// If pWalker->eCode is 2 then any term of the expression that comes from
// the ON or USING clauses of a left join disqualifies the expression
@@ -76724,7 +79399,7 @@ func exprNodeIsConstant(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
return 1
}
fallthrough
- // Fall thru
+ /* no break */
case 164:
fallthrough
case 165:
@@ -76738,7 +79413,7 @@ func exprNodeIsConstant(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
return 0
}
fallthrough
- // Fall through
+ /* no break */
case 176:
fallthrough
case 173:
@@ -76751,7 +79426,7 @@ func exprNodeIsConstant(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 5 {
// Silently convert bound parameters that appear inside of CREATE
// statements into a NULL when parsing the CREATE statement text out
- // of the sqlite_master table
+ // of the sqlite_schema table
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(119)
} else if int32((*Walker)(unsafe.Pointer(pWalker)).FeCode) == 4 {
// A bound parameter in a CREATE statement that originates from
@@ -76760,7 +79435,7 @@ func exprNodeIsConstant(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
return 2
}
fallthrough
- // Fall through
+ /* no break */
default:
// sqlite3SelectWalkFail() disallows
// sqlite3SelectWalkFail() disallows
@@ -76768,7 +79443,7 @@ func exprNodeIsConstant(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
}
return int32(0)
}
-func exprIsConst(tls *crt.TLS, p uintptr, initFlag int32, iCur int32) int32 { /* sqlite3.c:101574:12: */
+func exprIsConst(tls *libc.TLS, p uintptr, initFlag int32, iCur int32) int32 { /* sqlite3.c:101788:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -76776,10 +79451,10 @@ func exprIsConst(tls *crt.TLS, p uintptr, initFlag int32, iCur int32) int32 { /*
(*Walker)(unsafe.Pointer(bp /* &w */)).FeCode = U16(initFlag)
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{exprNodeIsConstant}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{Xsqlite3SelectWalkFail}))
*(*int32)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = iCur
Xsqlite3WalkExpr(tls, bp /* &w */, p)
@@ -76792,7 +79467,7 @@ func exprIsConst(tls *crt.TLS, p uintptr, initFlag int32, iCur int32) int32 { /*
// For the purposes of this function, a double-quoted string (ex: "abc")
// is considered a variable but a single-quoted string (ex: 'abc') is
// a constant.
-func Xsqlite3ExprIsConstant(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:101595:20: */
+func Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101809:20: */
return exprIsConst(tls, p, 1, 0)
}
@@ -76807,7 +79482,7 @@ func Xsqlite3ExprIsConstant(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:101595
// When this routine returns true, it indicates that the expression
// can be added to the pParse->pConstExpr list and evaluated once when
// the prepared statement starts up. See sqlite3ExprCodeRunJustOnce().
-func Xsqlite3ExprIsConstantNotJoin(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:101612:20: */
+func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101826:20: */
return exprIsConst(tls, p, 2, 0)
}
@@ -76815,12 +79490,12 @@ func Xsqlite3ExprIsConstantNotJoin(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c
// for any single row of the table with cursor iCur. In other words, the
// expression must not refer to any non-deterministic function nor any
// table other than iCur.
-func Xsqlite3ExprIsTableConstant(tls *crt.TLS, p uintptr, iCur int32) int32 { /* sqlite3.c:101622:20: */
+func Xsqlite3ExprIsTableConstant(tls *libc.TLS, p uintptr, iCur int32) int32 { /* sqlite3.c:101836:20: */
return exprIsConst(tls, p, 3, iCur)
}
// sqlite3WalkExpr() callback used by sqlite3ExprIsConstantOrGroupBy().
-func exprNodeIsConstantOrGroupBy(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101630:12: */
+func exprNodeIsConstantOrGroupBy(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:101844:12: */
var pGroupBy uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */))
var i int32
@@ -76862,7 +79537,7 @@ func exprNodeIsConstantOrGroupBy(tls *crt.TLS, pWalker uintptr, pExpr uintptr) i
// alternative collating sequences are uncommon, and this is only an
// optimization, so we take the easy way out and simply require the
// GROUP BY to use the BINARY collating sequence.
-func Xsqlite3ExprIsConstantOrGroupBy(tls *crt.TLS, pParse uintptr, p uintptr, pGroupBy uintptr) int32 { /* sqlite3.c:101674:20: */
+func Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, pGroupBy uintptr) int32 { /* sqlite3.c:101888:20: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -76870,7 +79545,7 @@ func Xsqlite3ExprIsConstantOrGroupBy(tls *crt.TLS, pParse uintptr, p uintptr, pG
(*Walker)(unsafe.Pointer(bp /* &w */)).FeCode = U16(1)
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{exprNodeIsConstantOrGroupBy}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = uintptr(0)
*(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = pGroupBy
@@ -76885,12 +79560,12 @@ func Xsqlite3ExprIsConstantOrGroupBy(tls *crt.TLS, pParse uintptr, p uintptr, pG
// the expression is constant or a function call with constant arguments.
// Return and 0 if there are any variables.
//
-// isInit is true when parsing from sqlite_master. isInit is false when
+// isInit is true when parsing from sqlite_schema. isInit is false when
// processing a new CREATE TABLE statement. When isInit is true, parameters
// (such as ? or $abc) in the expression are converted into NULL. When
// isInit is false, parameters raise an error. Parameters should not be
// allowed in a CREATE TABLE statement, but some legacy versions of SQLite
-// allowed it, so we need to support it when reading sqlite_master for
+// allowed it, so we need to support it when reading sqlite_schema for
// backwards compatibility.
//
// If isInit is true, set EP_FromDDL on every TK_FUNCTION node.
@@ -76898,7 +79573,7 @@ func Xsqlite3ExprIsConstantOrGroupBy(tls *crt.TLS, pParse uintptr, p uintptr, pG
// For the purposes of this function, a double-quoted string (ex: "abc")
// is considered a variable but a single-quoted string (ex: 'abc') is
// a constant.
-func Xsqlite3ExprIsConstantOrFunction(tls *crt.TLS, p uintptr, isInit U8) int32 { /* sqlite3.c:101706:20: */
+func Xsqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit U8) int32 { /* sqlite3.c:101920:20: */
return exprIsConst(tls, p, (4 + int32(isInit)), 0)
}
@@ -76907,7 +79582,7 @@ func Xsqlite3ExprIsConstantOrFunction(tls *crt.TLS, p uintptr, isInit U8) int32
// to fit in a 32-bit integer, return 1 and put the value of the integer
// in *pValue. If the expression is not an integer or if it is too big
// to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged.
-func Xsqlite3ExprIsInteger(tls *crt.TLS, p uintptr, pValue uintptr) int32 { /* sqlite3.c:101735:20: */
+func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32 { /* sqlite3.c:101949:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -76958,7 +79633,7 @@ func Xsqlite3ExprIsInteger(tls *crt.TLS, p uintptr, pValue uintptr) int32 { /* s
// hand, a false negative (returning FALSE when the result could be NULL)
// will likely result in an incorrect answer. So when in doubt, return
// TRUE.
-func Xsqlite3ExprCanBeNull(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:101781:20: */
+func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:101995:20: */
var op U8
for (int32((*Expr)(unsafe.Pointer(p)).Fop) == 171) || (int32((*Expr)(unsafe.Pointer(p)).Fop) == 170) {
p = (*Expr)(unsafe.Pointer(p)).FpLeft
@@ -76977,7 +79652,7 @@ func Xsqlite3ExprCanBeNull(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:101781:
case 151:
return 0
case 164:
- return (crt.Bool32(((((*Expr)(unsafe.Pointer((p))).Fflags & (U32(0x100000))) != U32(0)) || (*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) == uintptr(0))) || (((int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0) &&
+ return (libc.Bool32(((((*Expr)(unsafe.Pointer((p))).Fflags & (U32(0x100000))) != U32(0)) || (*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) == uintptr(0))) || (((int32((*Expr)(unsafe.Pointer(p)).FiColumn) >= 0) &&
((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FaCol != uintptr(0))) && // Defense against OOM problems
(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)))).FaCol+uintptr((*Expr)(unsafe.Pointer(p)).FiColumn)*32)).FnotNull) == 0))))
default:
@@ -76994,7 +79669,7 @@ func Xsqlite3ExprCanBeNull(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:101781:
// can be omitted. When in doubt return FALSE. A false negative
// is harmless. A false positive, however, can result in the wrong
// answer.
-func Xsqlite3ExprNeedsNoAffinityChange(tls *crt.TLS, p uintptr, aff int8) int32 { /* sqlite3.c:101815:20: */
+func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) int32 { /* sqlite3.c:102029:20: */
var op U8
var unaryMinus int32 = 0
if int32(aff) == 0x41 {
@@ -77013,24 +79688,24 @@ func Xsqlite3ExprNeedsNoAffinityChange(tls *crt.TLS, p uintptr, aff int8) int32
switch int32(op) {
case 152:
{
- return (crt.Bool32(int32(aff) >= 0x43))
+ return (libc.Bool32(int32(aff) >= 0x43))
}
case 150:
{
- return (crt.Bool32(int32(aff) >= 0x43))
+ return (libc.Bool32(int32(aff) >= 0x43))
}
case 115:
{
- return (crt.Bool32(!(unaryMinus != 0) && (int32(aff) == 0x42)))
+ return (libc.Bool32(!(unaryMinus != 0) && (int32(aff) == 0x42)))
}
case 151:
{
- return crt.BoolInt32(!(unaryMinus != 0))
+ return libc.BoolInt32(!(unaryMinus != 0))
}
case 164:
{
// p cannot be part of a CHECK constraint
- return (crt.Bool32((int32(aff) >= 0x43) && (int32((*Expr)(unsafe.Pointer(p)).FiColumn) < 0)))
+ return (libc.Bool32((int32(aff) >= 0x43) && (int32((*Expr)(unsafe.Pointer(p)).FiColumn) < 0)))
}
default:
{
@@ -77041,14 +79716,14 @@ func Xsqlite3ExprNeedsNoAffinityChange(tls *crt.TLS, p uintptr, aff int8) int32
}
// Return TRUE if the given string is a row-id column name.
-func Xsqlite3IsRowid(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:101851:20: */
- if Xsqlite3StrICmp(tls, z, ts+7290 /* "_ROWID_" */) == 0 {
+func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:102065:20: */
+ if Xsqlite3StrICmp(tls, z, ts+9536 /* "_ROWID_" */) == 0 {
return 1
}
- if Xsqlite3StrICmp(tls, z, ts+7298 /* "ROWID" */) == 0 {
+ if Xsqlite3StrICmp(tls, z, ts+9544 /* "ROWID" */) == 0 {
return 1
}
- if Xsqlite3StrICmp(tls, z, ts+7304 /* "OID" */) == 0 {
+ if Xsqlite3StrICmp(tls, z, ts+9550 /* "OID" */) == 0 {
return 1
}
return 0
@@ -77059,7 +79734,7 @@ func Xsqlite3IsRowid(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:101851:20: */
// a pointer to the SELECT statement. If pX is not a SELECT statement,
// or if the SELECT statement needs to be manifested into a transient
// table, then return NULL.
-func isCandidateForInOpt(tls *crt.TLS, pX uintptr) uintptr { /* sqlite3.c:101866:15: */
+func isCandidateForInOpt(tls *libc.TLS, pX uintptr) uintptr { /* sqlite3.c:102080:15: */
var p uintptr
var pSrc uintptr
var pEList uintptr
@@ -77116,19 +79791,22 @@ func isCandidateForInOpt(tls *crt.TLS, pX uintptr) uintptr { /* sqlite3.c:101866
// it contains any NULL entries. Cause the register at regHasNull to be set
// to a non-NULL value if iCur contains no NULLs. Cause register regHasNull
// to be set to NULL if iCur contains one or more NULL values.
-func sqlite3SetHasNullFlag(tls *crt.TLS, v uintptr, iCur int32, regHasNull int32) { /* sqlite3.c:101911:13: */
+func sqlite3SetHasNullFlag(tls *libc.TLS, v uintptr, iCur int32, regHasNull int32) { /* sqlite3.c:102125:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
var addr1 int32
Xsqlite3VdbeAddOp2(tls, v, 69, 0, regHasNull)
addr1 = Xsqlite3VdbeAddOp1(tls, v, 37, iCur)
Xsqlite3VdbeAddOp3(tls, v, 89, iCur, 0, regHasNull)
Xsqlite3VdbeChangeP5(tls, v, uint16(0x80))
-
+ Xsqlite3VdbeComment(tls, v, ts+9554 /* "first_entry_in(%..." */, libc.VaList(bp, iCur))
Xsqlite3VdbeJumpHere(tls, v, addr1)
}
// The argument is an IN operator with a list (not a subquery) on the
// right-hand side. Return TRUE if that list is constant.
-func sqlite3InRhsIsConstant(tls *crt.TLS, pIn uintptr) int32 { /* sqlite3.c:101928:12: */
+func sqlite3InRhsIsConstant(tls *libc.TLS, pIn uintptr) int32 { /* sqlite3.c:102142:12: */
var pLHS uintptr
var res int32
@@ -77217,17 +79895,17 @@ func sqlite3InRhsIsConstant(tls *crt.TLS, pIn uintptr) int32 { /* sqlite3.c:1019
// CREATE INDEX i1 ON t1(b, c, a);
//
// then aiMap[] is populated with {2, 0, 1}.
-func Xsqlite3FindInIndex(tls *crt.TLS, pParse uintptr, pX uintptr, inFlags U32, prRhsHasNull uintptr, aiMap uintptr, piTab uintptr) int32 { /* sqlite3.c:102021:20: */
- bp := tls.Alloc(16)
- defer tls.Free(16)
+func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, prRhsHasNull uintptr, aiMap uintptr, piTab uintptr) int32 { /* sqlite3.c:102235:20: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
- var p uintptr // SELECT to the right of IN operator
- var eType int32 = 0 // Type of RHS table. IN_INDEX_*
- var iTab int32 = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) // Cursor of the RHS table
- var mustBeUnique int32 // True if RHS must be unique
- var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Virtual machine being coded
+ var p uintptr // SELECT to the right of IN operator
+ var eType int32 = 0 // Type of RHS table. IN_INDEX_*
+ var iTab int32 = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) // Cursor of the RHS table
+ var mustBeUnique int32 // True if RHS must be unique
+ var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Virtual machine being coded
- mustBeUnique = (crt.Bool32((inFlags & U32(0x0004)) != U32(0)))
+ mustBeUnique = (libc.Bool32((inFlags & U32(0x0004)) != U32(0)))
// If the RHS of this IN(...) operator is a SELECT, and if it matters
// whether or not the SELECT result contains NULL values, check whether
@@ -77250,10 +79928,10 @@ func Xsqlite3FindInIndex(tls *crt.TLS, pParse uintptr, pX uintptr, inFlags U32,
// Check to see if an existing table or index can be used to
// satisfy the query. This is preferable to generating a new
// ephemeral table.
- if ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0) && ((crt.AssignUintptr(&p, isCandidateForInOpt(tls, pX))) != uintptr(0)) {
+ if ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0) && ((libc.AssignUintptr(&p, isCandidateForInOpt(tls, pX))) != uintptr(0)) {
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database connection
var pTab uintptr // Table <table>.
- var iDb I16 // Database idx for pTab
+ var iDb int32 // Database idx for pTab
var pEList uintptr = (*Select)(unsafe.Pointer(p)).FpEList
var nExpr int32 = (*ExprList)(unsafe.Pointer(pEList)).FnExpr
@@ -77263,18 +79941,19 @@ func Xsqlite3FindInIndex(tls *crt.TLS, pParse uintptr, pX uintptr, inFlags U32,
pTab = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(0)*112)).FpTab
// Code an OP_Transaction and OP_TableLock for <table>.
- iDb = I16(Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema))
- Xsqlite3CodeVerifySchema(tls, pParse, int32(iDb))
- Xsqlite3TableLock(tls, pParse, int32(iDb), (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab)).FzName)
+ iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
+
+ Xsqlite3CodeVerifySchema(tls, pParse, iDb)
+ Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab)).FzName)
// sqlite3GetVdbe() has always been previously called
if (nExpr == 1) && (int32((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(0)*32)).FpExpr)).FiColumn) < 0) {
// The "x IN (SELECT rowid FROM table)" case
var iAddr int32 = Xsqlite3VdbeAddOp0(tls, v, 17)
- Xsqlite3OpenTable(tls, pParse, iTab, int32(iDb), pTab, 96)
+ Xsqlite3OpenTable(tls, pParse, iTab, iDb, pTab, 96)
eType = 1
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+7308 /* "USING ROWID SEAR..." */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9573 /* "USING ROWID SEAR..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
Xsqlite3VdbeJumpHere(tls, v, iAddr)
} else {
var pIdx uintptr // Iterator variable
@@ -77304,7 +79983,7 @@ func Xsqlite3FindInIndex(tls *crt.TLS, pParse uintptr, pX uintptr, inFlags U32,
break
fallthrough
default:
- affinity_ok = (crt.Bool32((int32(idxaff)) >= 0x43))
+ affinity_ok = (libc.Bool32((int32(idxaff)) >= 0x43))
}
}
@@ -77365,14 +80044,15 @@ func Xsqlite3FindInIndex(tls *crt.TLS, pParse uintptr, pX uintptr, inFlags U32,
if colUsed == ((Bitmask((uint64(1))) << (nExpr)) - uint64(1)) {
// If we reach this point, that means the index pIdx is usable
var iAddr int32 = Xsqlite3VdbeAddOp0(tls, v, 17)
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+7355 /* "USING INDEX %s F..." */, crt.VaList(bp+8, (*Index)(unsafe.Pointer(pIdx)).FzName))
- Xsqlite3VdbeAddOp3(tls, v, 96, iTab, (*Index)(unsafe.Pointer(pIdx)).Ftnum, int32(iDb))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9620 /* "USING INDEX %s F..." */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIdx)).FzName))
+ Xsqlite3VdbeAddOp3(tls, v, 96, iTab, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp+16, (*Index)(unsafe.Pointer(pIdx)).FzName))
eType = (3 + int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(0)))))
if prRhsHasNull != 0 {
- *(*int32)(unsafe.Pointer(prRhsHasNull)) = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ *(*int32)(unsafe.Pointer(prRhsHasNull)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
if nExpr == 1 {
sqlite3SetHasNullFlag(tls, v, iTab, *(*int32)(unsafe.Pointer(prRhsHasNull)))
}
@@ -77406,7 +80086,7 @@ func Xsqlite3FindInIndex(tls *crt.TLS, pParse uintptr, pX uintptr, inFlags U32,
if (inFlags & U32(0x0004)) != 0 {
(*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = U32(0)
} else if prRhsHasNull != 0 {
- *(*int32)(unsafe.Pointer(prRhsHasNull)) = crt.AssignInt32(&rMayHaveNull, crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
+ *(*int32)(unsafe.Pointer(prRhsHasNull)) = libc.AssignInt32(&rMayHaveNull, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
}
Xsqlite3CodeRhsOfIN(tls, pParse, pX, iTab)
@@ -77434,7 +80114,7 @@ func Xsqlite3FindInIndex(tls *crt.TLS, pParse uintptr, pX uintptr, inFlags U32,
//
// It is the responsibility of the caller to ensure that the returned
// string is eventually freed using sqlite3DbFree().
-func exprINAffinity(tls *crt.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:102243:13: */
+func exprINAffinity(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:102458:13: */
var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
var nVal int32 = Xsqlite3ExprVectorSize(tls, pLeft)
var pSelect uintptr
@@ -77462,38 +80142,34 @@ func exprINAffinity(tls *crt.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sq
return zRet
}
-/*
-** Load the Parse object passed as the first argument with an error
-** message of the form:
-**
-** "sub-select returns N columns - expected M"
- */
-func Xsqlite3SubselectError(tls *crt.TLS, pParse uintptr, nActual int32, nExpect int32) { /* sqlite3.c:102275:21: */
+// Load the Parse object passed as the first argument with an error
+// message of the form:
+//
+// "sub-select returns N columns - expected M"
+func Xsqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpect int32) { /* sqlite3.c:102490:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
if (*Parse)(unsafe.Pointer(pParse)).FnErr == 0 {
- var zFmt uintptr = ts + 7386 /* "sub-select retur..." */
- Xsqlite3ErrorMsg(tls, pParse, zFmt, crt.VaList(bp, nActual, nExpect))
- }
-}
-
-/*
-** Expression pExpr is a vector that has been used in a context where
-** it is not permitted. If pExpr is a sub-select vector, this routine
-** loads the Parse object with a message of the form:
-**
-** "sub-select returns N columns - expected 1"
-**
-** Or, if it is a regular scalar vector:
-**
-** "row value misused"
- */
-func Xsqlite3VectorErrorMsg(tls *crt.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:102294:21: */
+ var zFmt uintptr = ts + 9651 /* "sub-select retur..." */
+ Xsqlite3ErrorMsg(tls, pParse, zFmt, libc.VaList(bp, nActual, nExpect))
+ }
+}
+
+// Expression pExpr is a vector that has been used in a context where
+// it is not permitted. If pExpr is a sub-select vector, this routine
+// loads the Parse object with a message of the form:
+//
+// "sub-select returns N columns - expected 1"
+//
+// Or, if it is a regular scalar vector:
+//
+// "row value misused"
+func Xsqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:102509:21: */
if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(0x000800)) != 0 {
Xsqlite3SubselectError(tls, pParse, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList)).FnExpr, 1)
} else {
- Xsqlite3ErrorMsg(tls, pParse, ts+6206 /* "row value misuse..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+8404 /* "row value misuse..." */, 0)
}
}
@@ -77517,9 +80193,9 @@ func Xsqlite3VectorErrorMsg(tls *crt.TLS, pParse uintptr, pExpr uintptr) { /* sq
// if either column has NUMERIC or INTEGER affinity. If neither
// 'x' nor the SELECT... statement are columns, then numeric affinity
// is used.
-func Xsqlite3CodeRhsOfIN(tls *crt.TLS, pParse uintptr, pExpr uintptr, iTab int32) { /* sqlite3.c:102328:21: */
- bp := tls.Alloc(57)
- defer tls.Free(57)
+func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int32) { /* sqlite3.c:102543:21: */
+ bp := tls.Alloc(73)
+ defer tls.Free(73)
var addrOnce int32 = 0 // Address of the OP_Once instruction at top
var addr int32 // Address of OP_OpenEphemeral instruction
@@ -77546,7 +80222,7 @@ func Xsqlite3CodeRhsOfIN(tls *crt.TLS, pParse uintptr, pExpr uintptr, iTab int32
if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x2000000))) != U32(0) {
addrOnce = Xsqlite3VdbeAddOp0(tls, v, 17)
if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000800))) != U32(0) {
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+7430 /* "REUSE LIST SUBQU..." */, crt.VaList(bp, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FselId))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9695 /* "REUSE LIST SUBQU..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FselId))
}
Xsqlite3VdbeAddOp2(tls, v, 12, (*struct {
FiAddr int32
@@ -77567,7 +80243,7 @@ func Xsqlite3CodeRhsOfIN(tls *crt.TLS, pParse uintptr, pExpr uintptr, iTab int32
(*struct {
FiAddr int32
FregReturn int32
- })(unsafe.Pointer(pExpr + 64 /* &.y */)).FregReturn = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ })(unsafe.Pointer(pExpr + 64 /* &.y */)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
(*struct {
FiAddr int32
FregReturn int32
@@ -77575,6 +80251,7 @@ func Xsqlite3CodeRhsOfIN(tls *crt.TLS, pParse uintptr, pExpr uintptr, iTab int32
FiAddr int32
FregReturn int32
})(unsafe.Pointer(pExpr+64 /* &.y */)).FregReturn) + 1)
+ Xsqlite3VdbeComment(tls, v, ts+9718 /* "return address" */, 0)
addrOnce = Xsqlite3VdbeAddOp0(tls, v, 17)
}
@@ -77587,6 +80264,11 @@ func Xsqlite3CodeRhsOfIN(tls *crt.TLS, pParse uintptr, pExpr uintptr, iTab int32
// RHS of the IN operator.
(*Expr)(unsafe.Pointer(pExpr)).FiTable = iTab
addr = Xsqlite3VdbeAddOp2(tls, v, 100, (*Expr)(unsafe.Pointer(pExpr)).FiTable, nVal)
+ if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000800))) != U32(0) {
+ Xsqlite3VdbeComment(tls, v, ts+9733 /* "Result of SELECT..." */, libc.VaList(bp+8, (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FselId))
+ } else {
+ Xsqlite3VdbeComment(tls, v, ts+9753 /* "RHS of IN operat..." */, 0)
+ }
pKeyInfo = Xsqlite3KeyInfoAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, nVal, 1)
if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000800))) != U32(0) {
@@ -77597,29 +80279,29 @@ func Xsqlite3CodeRhsOfIN(tls *crt.TLS, pParse uintptr, pExpr uintptr, iTab int32
var pSelect uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))
var pEList uintptr = (*Select)(unsafe.Pointer(pSelect)).FpEList
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+7453 /* "%sLIST SUBQUERY ..." */, crt.VaList(bp+8, func() uintptr {
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+9772 /* "%sLIST SUBQUERY ..." */, libc.VaList(bp+16, func() uintptr {
if addrOnce != 0 {
- return ts + 672 /* "" */
+ return ts + 781 /* "" */
}
- return ts + 7472 /* "CORRELATED " */
+ return ts + 9791 /* "CORRELATED " */
}(), (*Select)(unsafe.Pointer(pSelect)).FselId))
// If the LHS and RHS of the IN operator do not match, that
// error will have been caught long before we reach this point.
if (*ExprList)(unsafe.Pointer(pEList)).FnExpr == nVal {
- // var dest SelectDest at bp+24, 32
+ // var dest SelectDest at bp+32, 40
var i int32
- Xsqlite3SelectDestInit(tls, bp+24 /* &dest */, 11, iTab)
- (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FzAffSdst = exprINAffinity(tls, pParse, pExpr)
+ Xsqlite3SelectDestInit(tls, bp+32 /* &dest */, 11, iTab)
+ (*SelectDest)(unsafe.Pointer(bp + 32 /* &dest */)).FzAffSdst = exprINAffinity(tls, pParse, pExpr)
(*Select)(unsafe.Pointer(pSelect)).FiLimit = 0
// Caused by OOM in sqlite3KeyInfoAlloc()
- if Xsqlite3Select(tls, pParse, pSelect, bp+24 /* &dest */) != 0 {
- Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FzAffSdst)
+ if Xsqlite3Select(tls, pParse, pSelect, bp+32 /* &dest */) != 0 {
+ Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SelectDest)(unsafe.Pointer(bp+32 /* &dest */)).FzAffSdst)
Xsqlite3KeyInfoUnref(tls, pKeyInfo)
return
}
- Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FzAffSdst)
+ Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SelectDest)(unsafe.Pointer(bp+32 /* &dest */)).FzAffSdst)
// OOM will cause exit after sqlite3Select()
for i = 0; i < nVal; i++ {
@@ -77635,18 +80317,18 @@ func Xsqlite3CodeRhsOfIN(tls *crt.TLS, pParse uintptr, pExpr uintptr, iTab int32
// store it in the temporary table. If <expr> is a column, then use
// that columns affinity when building index keys. If <expr> is not
// a column, use numeric affinity.
- // var affinity int8 at bp+56, 1
+ // var affinity int8 at bp+72, 1
// Affinity of the LHS of the IN
var i int32
var pList uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))
var pItem uintptr
var r1 int32
var r2 int32
- *(*int8)(unsafe.Pointer(bp + 56 /* affinity */)) = Xsqlite3ExprAffinity(tls, pLeft)
- if int32(*(*int8)(unsafe.Pointer(bp + 56 /* affinity */))) <= 0x40 {
- *(*int8)(unsafe.Pointer(bp + 56 /* affinity */)) = int8(0x41)
- } else if int32(*(*int8)(unsafe.Pointer(bp + 56 /* affinity */))) == 0x45 {
- *(*int8)(unsafe.Pointer(bp + 56 /* affinity */)) = int8(0x43)
+ *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = Xsqlite3ExprAffinity(tls, pLeft)
+ if int32(*(*int8)(unsafe.Pointer(bp + 72 /* affinity */))) <= 0x40 {
+ *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = int8(0x41)
+ } else if int32(*(*int8)(unsafe.Pointer(bp + 72 /* affinity */))) == 0x45 {
+ *(*int8)(unsafe.Pointer(bp + 72 /* affinity */)) = int8(0x43)
}
if pKeyInfo != 0 {
@@ -77671,13 +80353,13 @@ func Xsqlite3CodeRhsOfIN(tls *crt.TLS, pParse uintptr, pExpr uintptr, iTab int32
// expression we need to rerun this code each time.
if (addrOnce != 0) && !(Xsqlite3ExprIsConstant(tls, pE2) != 0) {
Xsqlite3VdbeChangeToNoop(tls, v, addrOnce)
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (^U32(crt.Int32FromInt32(0x2000000)))
+ *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (^U32(libc.Int32FromInt32(0x2000000)))
addrOnce = 0
}
// Evaluate the expression and insert it into the temp table
Xsqlite3ExprCode(tls, pParse, pE2, r1)
- Xsqlite3VdbeAddOp4(tls, v, 91, r1, 1, r2, bp+56 /* &affinity */, 1)
+ Xsqlite3VdbeAddOp4(tls, v, 91, r1, 1, r2, bp+72 /* &affinity */, 1)
Xsqlite3VdbeAddOp4Int(tls, v, 130, iTab, r2, r1, 1)
}
goto __2
@@ -77721,14 +80403,14 @@ func Xsqlite3CodeRhsOfIN(tls *crt.TLS, pParse uintptr, pExpr uintptr, iTab int32
// the result is stored in a contiguous array of registers and the
// return value is the register of the left-most result column.
// Return 0 if an error occurs.
-func Xsqlite3CodeSubselect(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:102516:20: */
- bp := tls.Alloc(56)
- defer tls.Free(56)
+func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:102731:20: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
var addrOnce int32 = 0 // Address of OP_Once at top of subroutine
var rReg int32 = 0 // Register storing resulting
var pSel uintptr // SELECT statement to encode
- // var dest SelectDest at bp+24, 32
+ // var dest SelectDest at bp+24, 40
// How to deal with SELECT result
var nReg int32 // Registers to allocate
var pLimit uintptr // New limit expression
@@ -77750,7 +80432,7 @@ func Xsqlite3CodeSubselect(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 {
// If this routine has already been coded, then invoke it as a
// subroutine.
if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x2000000))) != U32(0) {
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+7484 /* "REUSE SUBQUERY %..." */, crt.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+9803 /* "REUSE SUBQUERY %..." */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId))
Xsqlite3VdbeAddOp2(tls, v, 12, (*struct {
FiAddr int32
FregReturn int32
@@ -77767,7 +80449,7 @@ func Xsqlite3CodeSubselect(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 {
(*struct {
FiAddr int32
FregReturn int32
- })(unsafe.Pointer(pExpr + 64 /* &.y */)).FregReturn = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ })(unsafe.Pointer(pExpr + 64 /* &.y */)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
(*struct {
FiAddr int32
FregReturn int32
@@ -77775,6 +80457,7 @@ func Xsqlite3CodeSubselect(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 {
FiAddr int32
FregReturn int32
})(unsafe.Pointer(pExpr+64 /* &.y */)).FregReturn) + 1)
+ Xsqlite3VdbeComment(tls, v, ts+9718 /* "return address" */, 0)
addrOnce = Xsqlite3VdbeAddOp0(tls, v, 17)
}
@@ -77788,11 +80471,11 @@ func Xsqlite3CodeSubselect(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 {
//
// In both cases, the query is augmented with "LIMIT 1". Any
// preexisting limit is discarded in place of the new LIMIT 1.
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+7502 /* "%sSCALAR SUBQUER..." */, crt.VaList(bp+8, func() uintptr {
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+9821 /* "%sSCALAR SUBQUER..." */, libc.VaList(bp+8, func() uintptr {
if addrOnce != 0 {
- return ts + 672 /* "" */
+ return ts + 781 /* "" */
}
- return ts + 7472 /* "CORRELATED " */
+ return ts + 9791 /* "CORRELATED " */
}(), (*Select)(unsafe.Pointer(pSel)).FselId))
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 136 {
nReg = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpEList)).FnExpr
@@ -77806,15 +80489,17 @@ func Xsqlite3CodeSubselect(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 {
(*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FiSdst = (*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FiSDParm
(*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FnSdst = nReg
Xsqlite3VdbeAddOp3(tls, v, 72, 0, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm, (((*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm + nReg) - 1))
+ Xsqlite3VdbeComment(tls, v, ts+9842 /* "Init subquery re..." */, 0)
} else {
(*SelectDest)(unsafe.Pointer(bp + 24 /* &dest */)).FeDest = U8(3)
Xsqlite3VdbeAddOp2(tls, v, 69, 0, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm)
+ Xsqlite3VdbeComment(tls, v, ts+9863 /* "Init EXISTS resu..." */, 0)
}
if (*Select)(unsafe.Pointer(pSel)).FpLimit != 0 {
// The subquery already has a limit. If the pre-existing limit is X
// then make the new limit X<>0 so that the new limit is either 1 or 0
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- pLimit = Xsqlite3Expr(tls, db, 152, ts+7105 /* "0" */)
+ pLimit = Xsqlite3Expr(tls, db, 152, ts+9351 /* "0" */)
if pLimit != 0 {
(*Expr)(unsafe.Pointer(pLimit)).FaffExpr = int8(0x43)
pLimit = Xsqlite3PExpr(tls, pParse, 52,
@@ -77824,14 +80509,14 @@ func Xsqlite3CodeSubselect(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 {
(*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit
} else {
// If there is no pre-existing limit add a limit of 1
- pLimit = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 152, ts+7523 /* "1" */)
+ pLimit = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 152, ts+9882 /* "1" */)
(*Select)(unsafe.Pointer(pSel)).FpLimit = Xsqlite3PExpr(tls, pParse, 146, pLimit, uintptr(0))
}
(*Select)(unsafe.Pointer(pSel)).FiLimit = 0
if Xsqlite3Select(tls, pParse, pSel, bp+24 /* &dest */) != 0 {
return 0
}
- (*Expr)(unsafe.Pointer(pExpr)).FiTable = crt.AssignInt32(&rReg, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm)
+ (*Expr)(unsafe.Pointer(pExpr)).FiTable = libc.AssignInt32(&rReg, (*SelectDest)(unsafe.Pointer(bp+24 /* &dest */)).FiSDParm)
if addrOnce != 0 {
Xsqlite3VdbeJumpHere(tls, v, addrOnce)
@@ -77855,7 +80540,7 @@ func Xsqlite3CodeSubselect(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 {
// sub-select on the RHS of the IN() operator has the same number of
// columns as the vector on the LHS. Or, if the RHS of the IN() is not
// a sub-query, that the LHS is a vector of size 1.
-func Xsqlite3ExprCheckIN(tls *crt.TLS, pParse uintptr, pIn uintptr) int32 { /* sqlite3.c:102631:20: */
+func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32 { /* sqlite3.c:102846:20: */
var nVector int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pIn)).FpLeft)
if ((*Expr)(unsafe.Pointer(pIn)).Fflags & U32(0x000800)) != 0 {
if nVector != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pIn + 32 /* &.x */)))).FpEList)).FnExpr {
@@ -77892,7 +80577,7 @@ func Xsqlite3ExprCheckIN(tls *crt.TLS, pParse uintptr, pIn uintptr) int32 { /* s
//
// See the separate in-operator.md documentation file in the canonical
// SQLite source tree for additional information.
-func sqlite3ExprCodeIN(tls *crt.TLS, pParse uintptr, pExpr uintptr, destIfFalse int32, destIfNull int32) { /* sqlite3.c:102672:13: */
+func sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFalse int32, destIfNull int32) { /* sqlite3.c:102887:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -77913,7 +80598,7 @@ func sqlite3ExprCodeIN(tls *crt.TLS, pParse uintptr, pExpr uintptr, destIfFalse
var destStep6 int32 // Start of code for Step 6
var addrTruthOp int32 // Address of opcode that determines the IN is true
var destNotNull int32 // Jump here if a comparison is not true in step 6
- var addrTop int32 /* Top of the step-6 loop */
+ var addrTop int32 // Top of the step-6 loop
// var iTab int32 at bp+4, 4
// Index to use
var okConstFactor U8
@@ -77962,7 +80647,7 @@ __2:
// the RHS has not yet been coded.
v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
// OOM detected prior to this routine
-
+ Xsqlite3VdbeNoopComment(tls, v, ts+9884 /* "begin IN expr" */, 0)
eType = Xsqlite3FindInIndex(tls, pParse, pExpr,
(uint32(0x0002 | 0x0001)),
func() uintptr {
@@ -78114,7 +80799,7 @@ __11:
destStep2 = destIfFalse
goto __21
__20:
- destStep2 = crt.AssignInt32(&destStep6, Xsqlite3VdbeMakeLabel(tls, pParse))
+ destStep2 = libc.AssignInt32(&destStep6, Xsqlite3VdbeMakeLabel(tls, pParse))
__21:
;
if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
@@ -78259,7 +80944,7 @@ sqlite3ExprCodeIN_finished:
Xsqlite3ReleaseTempReg(tls, pParse, rLhs)
__39:
;
-
+ Xsqlite3VdbeComment(tls, v, ts+9898 /* "end IN expr" */, 0)
sqlite3ExprCodeIN_oom_error:
Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, aiMap)
Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, zAff)
@@ -78271,7 +80956,7 @@ sqlite3ExprCodeIN_oom_error:
// The z[] string will probably not be zero-terminated. But the
// z[n] character is guaranteed to be something that does not look
// like the continuation of the number.
-func codeReal(tls *crt.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) { /* sqlite3.c:102928:13: */
+func codeReal(tls *libc.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32) { /* sqlite3.c:103143:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -78291,7 +80976,7 @@ func codeReal(tls *crt.TLS, v uintptr, z uintptr, negateFlag int32, iMem int32)
// text z[0..n-1] into register iMem.
//
// Expr.u.zToken is always UTF8 and zero-terminated.
-func codeInteger(tls *crt.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iMem int32) { /* sqlite3.c:102946:13: */
+func codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iMem int32) { /* sqlite3.c:103161:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -78311,12 +80996,12 @@ func codeInteger(tls *crt.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iMe
c = Xsqlite3DecOrHexToI64(tls, z, bp+16 /* &value */)
if (((c == 3) && !(negFlag != 0)) || (c == 2)) || ((negFlag != 0) && (*(*I64)(unsafe.Pointer(bp + 16 /* value */)) == ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))) {
- if Xsqlite3_strnicmp(tls, z, ts+7525 /* "0x" */, 2) == 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+7528 /* "hex literal too ..." */, crt.VaList(bp, func() uintptr {
+ if Xsqlite3_strnicmp(tls, z, ts+9910 /* "0x" */, 2) == 0 {
+ Xsqlite3ErrorMsg(tls, pParse, ts+9913 /* "hex literal too ..." */, libc.VaList(bp, func() uintptr {
if negFlag != 0 {
- return ts + 4431 /* "-" */
+ return ts + 6566 /* "-" */
}
- return ts + 672 /* "" */
+ return ts + 781 /* "" */
}(), z))
} else {
codeReal(tls, v, z, negFlag, iMem)
@@ -78336,7 +81021,7 @@ func codeInteger(tls *crt.TLS, pParse uintptr, pExpr uintptr, negFlag int32, iMe
// Generate code that will load into register regOut a value that is
// appropriate for the iIdxCol-th column of index pIdx.
-func Xsqlite3ExprCodeLoadIndexColumn(tls *crt.TLS, pParse uintptr, pIdx uintptr, iTabCur int32, iIdxCol int32, regOut int32) { /* sqlite3.c:102983:21: */
+func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr, iTabCur int32, iIdxCol int32, regOut int32) { /* sqlite3.c:103198:21: */
var iTabCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iIdxCol)*2))
if int32(iTabCol) == (-2) {
@@ -78351,7 +81036,7 @@ func Xsqlite3ExprCodeLoadIndexColumn(tls *crt.TLS, pParse uintptr, pIdx uintptr,
// Generate code that will compute the value of generated column pCol
// and store the result in register regOut
-func Xsqlite3ExprCodeGeneratedColumn(tls *crt.TLS, pParse uintptr, pCol uintptr, regOut int32) { /* sqlite3.c:103008:21: */
+func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pCol uintptr, regOut int32) { /* sqlite3.c:103223:21: */
var iAddr int32
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
@@ -78370,7 +81055,7 @@ func Xsqlite3ExprCodeGeneratedColumn(tls *crt.TLS, pParse uintptr, pCol uintptr,
}
// Generate code to extract the value of the iCol-th column of a table.
-func Xsqlite3ExprCodeGetColumnOfTable(tls *crt.TLS, v uintptr, pTab uintptr, iTabCur int32, iCol int32, regOut int32) { /* sqlite3.c:103033:21: */
+func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iTabCur int32, iCol int32, regOut int32) { /* sqlite3.c:103248:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -78388,17 +81073,17 @@ func Xsqlite3ExprCodeGetColumnOfTable(tls *crt.TLS, v uintptr, pTab uintptr, iTa
if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
op = 166
x = iCol
- } else if (int32((*Column)(unsafe.Pointer((crt.AssignUintptr(&pCol, ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32))))).FcolFlags) & 0x0020) != 0 {
+ } else if (int32((*Column)(unsafe.Pointer((libc.AssignUintptr(&pCol, ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32))))).FcolFlags) & 0x0020) != 0 {
var pParse uintptr = Xsqlite3VdbeParser(tls, v)
if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0100) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+7554 /* "generated column..." */, crt.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+9939 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName))
} else {
var savedSelfTab int32 = (*Parse)(unsafe.Pointer(pParse)).FiSelfTab
*(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) |= U16((0x0100))
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = (iTabCur + 1)
Xsqlite3ExprCodeGeneratedColumn(tls, pParse, pCol, regOut)
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = savedSelfTab
- *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0100))))
+ *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0100))))
}
return
} else if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) {
@@ -78420,7 +81105,7 @@ func Xsqlite3ExprCodeGetColumnOfTable(tls *crt.TLS, v uintptr, pTab uintptr, iTa
//
// There must be an open cursor to pTab in iTable when this routine
// is called. If iColumn<0 then code is generated that extracts the rowid.
-func Xsqlite3ExprCodeGetColumn(tls *crt.TLS, pParse uintptr, pTab uintptr, iColumn int32, iTable int32, iReg int32, p5 U8) int32 { /* sqlite3.c:103090:20: */
+func Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iColumn int32, iTable int32, iReg int32, p5 U8) int32 { /* sqlite3.c:103305:20: */
Xsqlite3ExprCodeGetColumnOfTable(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iTable, iColumn, iReg)
if p5 != 0 {
@@ -78434,19 +81119,19 @@ func Xsqlite3ExprCodeGetColumn(tls *crt.TLS, pParse uintptr, pTab uintptr, iColu
// Generate code to move content from registers iFrom...iFrom+nReg-1
// over to iTo..iTo+nReg-1.
-func Xsqlite3ExprCodeMove(tls *crt.TLS, pParse uintptr, iFrom int32, iTo int32, nReg int32) { /* sqlite3.c:103111:21: */
+func Xsqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, nReg int32) { /* sqlite3.c:103326:21: */
Xsqlite3VdbeAddOp3(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, 76, iFrom, iTo, nReg)
}
// Convert a scalar expression node to a TK_REGISTER referencing
// register iReg. The caller must ensure that iReg already contains
// the correct value for the expression.
-func exprToRegister(tls *crt.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:103120:13: */
+func exprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:103335:13: */
var p uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr)
(*Expr)(unsafe.Pointer(p)).Fop2 = (*Expr)(unsafe.Pointer(p)).Fop
(*Expr)(unsafe.Pointer(p)).Fop = U8(173)
(*Expr)(unsafe.Pointer(p)).FiTable = iReg
- *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (^U32(crt.Int32FromInt32(0x001000)))
+ *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (^U32(libc.Int32FromInt32(0x001000)))
}
// Evaluate an expression (either a vector or a scalar expression) and store
@@ -78457,7 +81142,7 @@ func exprToRegister(tls *crt.TLS, pExpr uintptr, iReg int32) { /* sqlite3.c:1031
// that register number into *piFreeable. If the returned result register
// is not a temporary or if the expression is a vector set *piFreeable
// to 0.
-func exprCodeVector(tls *crt.TLS, pParse uintptr, p uintptr, piFreeable uintptr) int32 { /* sqlite3.c:103138:12: */
+func exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintptr) int32 { /* sqlite3.c:103353:12: */
var iResult int32
var nResult int32 = Xsqlite3ExprVectorSize(tls, p)
if nResult == 1 {
@@ -78480,7 +81165,7 @@ func exprCodeVector(tls *crt.TLS, pParse uintptr, p uintptr, piFreeable uintptr)
// If the last opcode is a OP_Copy, then set the do-not-merge flag (p5)
// so that a subsequent copy will not be merged into this one.
-func setDoNotMergeFlagOnCopy(tls *crt.TLS, v uintptr) { /* sqlite3.c:103167:13: */
+func setDoNotMergeFlagOnCopy(tls *libc.TLS, v uintptr) { /* sqlite3.c:103382:13: */
if int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, -1))).Fopcode) == 77 {
Xsqlite3VdbeChangeP5(tls, v, uint16(1))
}
@@ -78488,7 +81173,7 @@ func setDoNotMergeFlagOnCopy(tls *crt.TLS, v uintptr) { /* sqlite3.c:103167:13:
// Generate code to implement special SQL functions that are implemented
// in-line rather than by using the usual callbacks.
-func exprCodeInlineFunction(tls *crt.TLS, pParse uintptr, pFarg uintptr, iFuncId int32, target int32) int32 { /* sqlite3.c:103177:12: */
+func exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFuncId int32, target int32) int32 { /* sqlite3.c:103392:12: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -78520,7 +81205,7 @@ func exprCodeInlineFunction(tls *crt.TLS, pParse uintptr, pFarg uintptr, iFuncId
{
// var caseExpr Expr at bp, 72
- crt.Xmemset(tls, bp /* &caseExpr */, 0, uint64(unsafe.Sizeof(Expr{})))
+ libc.Xmemset(tls, bp /* &caseExpr */, 0, uint64(unsafe.Sizeof(Expr{})))
(*Expr)(unsafe.Pointer(bp /* &caseExpr */)).Fop = U8(154)
*(*uintptr)(unsafe.Pointer(bp /* &caseExpr */ + 32 /* &.x */)) = pFarg
return Xsqlite3ExprCodeTarget(tls, pParse, bp /* &caseExpr */, target)
@@ -78587,20 +81272,20 @@ func exprCodeInlineFunction(tls *crt.TLS, pParse uintptr, pFarg uintptr, iFuncId
// register if it is convenient to do so. The calling function
// must check the return code and move the results to the desired
// register.
-func Xsqlite3ExprCodeTarget(tls *crt.TLS, pParse uintptr, pExpr uintptr, target int32) int32 { /* sqlite3.c:103293:20: */
- bp := tls.Alloc(192)
- defer tls.Free(192)
+func Xsqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) int32 { /* sqlite3.c:103508:20: */
+ bp := tls.Alloc(240)
+ defer tls.Free(240)
var v uintptr // The VM under construction
var op int32 // The opcode being coded
var inReg int32 // Results stored in register inReg
- // var regFree1 int32 at bp+40, 4
+ // var regFree1 int32 at bp+88, 4
// If non-zero free this temporary register
- // var regFree2 int32 at bp+44, 4
+ // var regFree2 int32 at bp+92, 4
// If non-zero free this temporary register
var r1 int32
var r2 int32 // Various register numbers
- // var tempX Expr at bp+48, 72
+ // var tempX Expr at bp+96, 72
// Temporary expression node
var p5 int32
var pTab uintptr
@@ -78634,6 +81319,7 @@ func Xsqlite3ExprCodeTarget(tls *crt.TLS, pParse uintptr, pExpr uintptr, target
var addr int32
var pInfo uintptr
var exprOp U8
+ var pArg uintptr
var pFarg uintptr // List of function arguments
var nFarg int32 // Number of function arguments
var pDef uintptr // The function definition object
@@ -78682,7 +81368,7 @@ func Xsqlite3ExprCodeTarget(tls *crt.TLS, pParse uintptr, pExpr uintptr, target
var i1 int32 // Loop counter
var pEList uintptr // List of WHEN terms
var aListelem uintptr // Array of WHEN terms
- // var opCompare Expr at bp+120, 72
+ // var opCompare Expr at bp+168, 72
// The X==Ei expression
var pX uintptr // The X expression
var pTest uintptr // X==Ei (form A) or just Ei (form B)
@@ -78690,117 +81376,109 @@ func Xsqlite3ExprCodeTarget(tls *crt.TLS, pParse uintptr, pExpr uintptr, target
var db1 uintptr
v = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
inReg = target
- *(*int32)(unsafe.Pointer(bp + 40 /* regFree1 */)) = 0
- *(*int32)(unsafe.Pointer(bp + 44 /* regFree2 */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 88 /* regFree1 */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 92 /* regFree2 */)) = 0
p5 = 0
- if !(v == uintptr(0)) {
- goto __1
- }
-
- return 0
-__1:
- ;
-
expr_code_doover:
if !(pExpr == uintptr(0)) {
- goto __2
+ goto __1
}
op = 119
- goto __3
-__2:
+ goto __2
+__1:
;
op = int32((*Expr)(unsafe.Pointer(pExpr)).Fop)
-__3:
+__2:
;
switch op {
case 166:
- goto __5
+ goto __4
case 164:
- goto __6
+ goto __5
case 152:
- goto __7
+ goto __6
case 167:
- goto __8
+ goto __7
case 150:
- goto __9
+ goto __8
case 115:
- goto __10
+ goto __9
default:
- goto __11
+ goto __10
case 151:
- goto __12
+ goto __11
case 153:
- goto __13
+ goto __12
case 173:
- goto __14
+ goto __13
case 36:
- goto __15
+ goto __14
case 45:
- goto __16
+ goto __15
case 168:
- goto __17
+ goto __16
// fall-through
case 56:
- goto __18
+ goto __17
case 55:
- goto __19
+ goto __18
case 54:
- goto __20
+ goto __19
case 57:
- goto __21
+ goto __20
case 52:
- goto __22
+ goto __21
case 53:
- goto __23
+ goto __22
case 44:
- goto __24
+ goto __23
case 43:
- goto __25
+ goto __24
case 105:
- goto __26
+ goto __25
case 107:
- goto __27
+ goto __26
case 106:
- goto __28
+ goto __27
case 109:
- goto __29
+ goto __28
case 101:
- goto __30
+ goto __29
case 102:
- goto __31
+ goto __30
case 108:
- goto __32
+ goto __31
case 103:
- goto __33
+ goto __32
case 104:
- goto __34
+ goto __33
case 110:
- goto __35
+ goto __34
case 170:
- goto __36
+ goto __35
case 112:
- goto __37
+ goto __36
case 19:
- goto __38
+ goto __37
case 172:
- goto __39
+ goto __38
case 50:
- goto __40
+ goto __39
case 51:
- goto __41
+ goto __40
case 165:
- goto __42
+ goto __41
case 169:
- goto __43
+ goto __42
case 20:
- goto __44
+ goto __43
case 136:
- goto __45
+ goto __44
case 175:
- goto __46
+ goto __45
case 49:
- goto __47
+ goto __46
// x BETWEEN y AND z
//
@@ -78812,19 +81490,19 @@ __3:
// Y is stored in pExpr->pList->a[0].pExpr.
// Z is stored in pExpr->pList->a[1].pExpr.
case 48:
- goto __48
+ goto __47
case 178:
- goto __49
+ goto __48
case 111:
- goto __50
+ goto __49
case 171:
- goto __51
+ goto __50
case 77:
- goto __52
+ goto __51
case 174:
- goto __53
+ goto __52
// TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions
// that derive from the right-hand table of a LEFT JOIN. The
@@ -78832,7 +81510,7 @@ __3:
// The expression is only evaluated if that table is not currently
// on a LEFT JOIN NULL row.
case 176:
- goto __54
+ goto __53
// Form A:
// CASE x WHEN e1 THEN r1 WHEN e2 THEN r2 ... WHEN eN THEN rN ELSE y END
@@ -78854,160 +81532,161 @@ __3:
// or if there is no matching Ei, the ELSE term Y, or if there is
// no ELSE term, NULL.
case 154:
- goto __55
+ goto __54
case 71:
- goto __56
+ goto __55
}
- goto __4
-__5:
+ goto __3
+__4:
pAggInfo = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo
pCol = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiAgg)*32)
if !(!(int32((*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode) != 0)) {
- goto __57
+ goto __56
}
return (*AggInfo_col)(unsafe.Pointer(pCol)).FiMem
- goto __58
-__57:
+ goto __57
+__56:
if !((*AggInfo)(unsafe.Pointer(pAggInfo)).FuseSortingIdx != 0) {
- goto __59
+ goto __58
}
pTab = (*AggInfo_col)(unsafe.Pointer(pCol)).FpTab
Xsqlite3VdbeAddOp3(tls, v, 89, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab,
int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn), target)
if !(int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn) < 0) {
- goto __60
+ goto __59
}
- goto __61
-__60:
- ;
+ Xsqlite3VdbeComment(tls, v, ts+9969 /* "%s.rowid" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ goto __60
+__59:
+ Xsqlite3VdbeComment(tls, v, ts+9978 /* "%s.%s" */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn)*32)).FzName))
if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn)*32)).Faffinity) == 0x45) {
- goto __62
+ goto __61
}
Xsqlite3VdbeAddOp1(tls, v, 83, target)
-__62:
- ;
__61:
;
- return target
-__59:
+__60:
;
+ return target
__58:
;
-__6:
+__57:
+ ;
+__5:
iTab = (*Expr)(unsafe.Pointer(pExpr)).FiTable
if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000008))) != U32(0)) {
- goto __63
+ goto __62
}
iReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, target)
if !(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) != 0) {
- goto __64
+ goto __63
}
aff = int32(Xsqlite3TableColumnAffinity(tls, *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)), int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)))
- goto __65
-__64:
+ goto __64
+__63:
aff = int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr)
-__65:
+__64:
;
if !(aff > 0x41) {
- goto __66
+ goto __65
}
Xsqlite3VdbeAddOp4(tls, v, 90, iReg, 1, 0,
(uintptr(unsafe.Pointer(&zAff)) + uintptr(((aff - 'B') * 2))), -1)
-__66:
+__65:
;
return iReg
-__63:
+__62:
;
if !(iTab < 0) {
- goto __67
+ goto __66
}
if !((*Parse)(unsafe.Pointer(pParse)).FiSelfTab < 0) {
- goto __68
+ goto __67
}
pTab1 = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */))
iCol = int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn)
if !(iCol < 0) {
- goto __70
+ goto __69
}
return (-1 - (*Parse)(unsafe.Pointer(pParse)).FiSelfTab)
-__70:
+__69:
;
pCol1 = ((*Table)(unsafe.Pointer(pTab1)).FaCol + uintptr(iCol)*32)
iSrc = (int32(Xsqlite3TableColumnToStorage(tls, pTab1, int16(iCol))) - (*Parse)(unsafe.Pointer(pParse)).FiSelfTab)
if !((int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags) & 0x0060) != 0) {
- goto __71
+ goto __70
}
if !((int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags) & 0x0100) != 0) {
- goto __73
+ goto __72
}
- Xsqlite3ErrorMsg(tls, pParse, ts+7554, /* "generated column..." */
- crt.VaList(bp, (*Column)(unsafe.Pointer(pCol1)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+9939, /* "generated column..." */
+ libc.VaList(bp+24, (*Column)(unsafe.Pointer(pCol1)).FzName))
return 0
-__73:
+__72:
;
*(*U16)(unsafe.Pointer(pCol1 + 28 /* &.colFlags */)) |= U16((0x0100))
if !((int32((*Column)(unsafe.Pointer(pCol1)).FcolFlags) & 0x0080) != 0) {
- goto __74
+ goto __73
}
Xsqlite3ExprCodeGeneratedColumn(tls, pParse, pCol1, iSrc)
-__74:
+__73:
;
- *(*U16)(unsafe.Pointer(pCol1 + 28 /* &.colFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32((0x0100 | 0x0080)))))
+ *(*U16)(unsafe.Pointer(pCol1 + 28 /* &.colFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32((0x0100 | 0x0080)))))
return iSrc
- goto __72
-__71:
+ goto __71
+__70:
if !(int32((*Column)(unsafe.Pointer(pCol1)).Faffinity) == 0x45) {
- goto __75
+ goto __74
}
Xsqlite3VdbeAddOp2(tls, v, 78, iSrc, target)
Xsqlite3VdbeAddOp1(tls, v, 83, target)
return target
- goto __76
-__75:
+ goto __75
+__74:
return iSrc
-__76:
+__75:
;
-__72:
+__71:
;
- goto __69
-__68:
+ goto __68
+__67:
// Coding an expression that is part of an index where column names
// in the index refer to the table to which the index belongs
iTab = ((*Parse)(unsafe.Pointer(pParse)).FiSelfTab - 1)
-__69:
+__68:
;
-__67:
+__66:
;
iReg = Xsqlite3ExprCodeGetColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)),
int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn), iTab, target,
(*Expr)(unsafe.Pointer(pExpr)).Fop2)
if !((*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) == uintptr(0)) && (int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr) == 0x45)) {
- goto __77
+ goto __76
}
Xsqlite3VdbeAddOp1(tls, v, 83, iReg)
-__77:
+__76:
;
return iReg
-__7:
+__6:
codeInteger(tls, pParse, pExpr, 0, target)
return target
-__8:
+__7:
Xsqlite3VdbeAddOp2(tls, v, 69, Xsqlite3ExprTruthValue(tls, pExpr), target)
return target
-__9:
+__8:
;
codeReal(tls, v, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), 0, target)
return target
-__10:
+__9:
;
Xsqlite3VdbeLoadString(tls, v, target, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)))
return target
-__11:
+__10:
// Make NULL the default case so that if a bug causes an illegal
// Expr node to be passed into this function, it will be handled
// sanely and not crash. But keep the assert() to bring the problem
@@ -79015,7 +81694,7 @@ __11:
;
Xsqlite3VdbeAddOp2(tls, v, 72, 0, target)
return target
-__12:
+__11:
;
z = (*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + uintptr(2))
@@ -79024,37 +81703,37 @@ __12:
zBlob = Xsqlite3HexToBlob(tls, Xsqlite3VdbeDb(tls, v), z, n)
Xsqlite3VdbeAddOp4(tls, v, 74, (n / 2), target, 0, zBlob, -7)
return target
-__13:
+__12:
;
Xsqlite3VdbeAddOp2(tls, v, 75, int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn), target)
if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)) + uintptr(1)))) != 0) {
- goto __78
+ goto __77
}
z1 = Xsqlite3VListNumToName(tls, (*Parse)(unsafe.Pointer(pParse)).FpVList, int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn))
*(*VList)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpVList + uintptr(0)*4)) = 0 // Indicate VList may no longer be enlarged
Xsqlite3VdbeAppendP4(tls, v, z1, -1)
-__78:
+__77:
;
return target
-__14:
+__13:
return (*Expr)(unsafe.Pointer(pExpr)).FiTable
-__15:
+__14:
// Expressions of the form: CAST(pLeft AS token)
inReg = Xsqlite3ExprCodeTarget(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, target)
if !(inReg != target) {
- goto __79
+ goto __78
}
Xsqlite3VdbeAddOp2(tls, v, 78, inReg, target)
inReg = target
-__79:
+__78:
;
Xsqlite3VdbeAddOp2(tls, v, 84, target,
int32(Xsqlite3AffinityType(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), uintptr(0))))
return inReg
+__15:
__16:
-__17:
if op == 45 {
op = 53
} else {
@@ -79062,28 +81741,29 @@ __17:
}
p5 = 0x80
// fall-through
+__17:
__18:
__19:
__20:
__21:
__22:
-__23:
pLeft = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
if !(Xsqlite3ExprIsVector(tls, pLeft) != 0) {
- goto __80
+ goto __79
}
codeVectorCompare(tls, pParse, pExpr, target, uint8(op), uint8(p5))
- goto __81
-__80:
- r1 = Xsqlite3ExprCodeTemp(tls, pParse, pLeft, bp+40 /* &regFree1 */)
- r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+44 /* &regFree2 */)
+ goto __80
+__79:
+ r1 = Xsqlite3ExprCodeTemp(tls, pParse, pLeft, bp+88 /* &regFree1 */)
+ r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+92 /* &regFree2 */)
codeCompare(tls, pParse, pLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op,
r1, r2, inReg, (0x20 | p5),
- (crt.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000200))) != U32(0))))
+ (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000200))) != U32(0))))
-__81:
+__80:
;
- goto __4
+ goto __3
+__23:
__24:
__25:
__26:
@@ -79095,107 +81775,106 @@ __31:
__32:
__33:
__34:
-__35:
;
- r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+40 /* &regFree1 */)
- r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+44 /* &regFree2 */)
+ r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+88 /* &regFree1 */)
+ r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+92 /* &regFree2 */)
Xsqlite3VdbeAddOp3(tls, v, op, r2, r1, target)
- goto __4
-__36:
+ goto __3
+__35:
pLeft1 = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
if !(int32((*Expr)(unsafe.Pointer(pLeft1)).Fop) == 152) {
- goto __82
+ goto __81
}
codeInteger(tls, pParse, pLeft1, 1, target)
return target
- goto __83
-__82:
+ goto __82
+__81:
if !(int32((*Expr)(unsafe.Pointer(pLeft1)).Fop) == 150) {
- goto __84
+ goto __83
}
codeReal(tls, v, *(*uintptr)(unsafe.Pointer(pLeft1 + 8 /* &.u */)), 1, target)
return target
- goto __85
-__84:
- (*Expr)(unsafe.Pointer(bp + 48 /* &tempX */)).Fop = U8(152)
- (*Expr)(unsafe.Pointer(bp + 48 /* &tempX */)).Fflags = (U32(0x000400 | 0x004000))
- *(*int32)(unsafe.Pointer(bp + 48 /* &tempX */ + 8 /* &.u */)) = 0
+ goto __84
+__83:
+ (*Expr)(unsafe.Pointer(bp + 96 /* &tempX */)).Fop = U8(152)
+ (*Expr)(unsafe.Pointer(bp + 96 /* &tempX */)).Fflags = (U32(0x000400 | 0x004000))
+ *(*int32)(unsafe.Pointer(bp + 96 /* &tempX */ + 8 /* &.u */)) = 0
- r1 = Xsqlite3ExprCodeTemp(tls, pParse, bp+48 /* &tempX */, bp+40 /* &regFree1 */)
- r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+44 /* &regFree2 */)
+ r1 = Xsqlite3ExprCodeTemp(tls, pParse, bp+96 /* &tempX */, bp+88 /* &regFree1 */)
+ r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+92 /* &regFree2 */)
Xsqlite3VdbeAddOp3(tls, v, 106, r2, r1, target)
-__85:
+__84:
;
-__83:
+__82:
;
- goto __4
+ goto __3
+__36:
__37:
-__38:
;
- r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+40 /* &regFree1 */)
+ r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+88 /* &regFree1 */)
Xsqlite3VdbeAddOp2(tls, v, op, r1, inReg)
- goto __4
-__39: // IS TRUE or IS FALSE
- r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+40 /* &regFree1 */)
+ goto __3
+__38: // IS TRUE or IS FALSE
+ r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+88 /* &regFree1 */)
isTrue = Xsqlite3ExprTruthValue(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
- bNormal = (crt.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == 45))
+ bNormal = (libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == 45))
- Xsqlite3VdbeAddOp4Int(tls, v, 87, r1, inReg, crt.BoolInt32(!(isTrue != 0)), (isTrue ^ bNormal))
- goto __4
+ Xsqlite3VdbeAddOp4Int(tls, v, 87, r1, inReg, libc.BoolInt32(!(isTrue != 0)), (isTrue ^ bNormal))
+ goto __3
+__39:
__40:
-__41:
;
Xsqlite3VdbeAddOp2(tls, v, 69, 1, target)
- r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+40 /* &regFree1 */)
+ r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp+88 /* &regFree1 */)
addr = Xsqlite3VdbeAddOp1(tls, v, op, r1)
Xsqlite3VdbeAddOp2(tls, v, 69, 0, target)
Xsqlite3VdbeJumpHere(tls, v, addr)
- goto __4
-__42:
+ goto __3
+__41:
pInfo = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo
if !(((pInfo == uintptr(0)) ||
(int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg) < 0)) ||
(int32((*Expr)(unsafe.Pointer(pExpr)).FiAgg) >= (*AggInfo)(unsafe.Pointer(pInfo)).FnFunc)) {
- goto __86
+ goto __85
}
- Xsqlite3ErrorMsg(tls, pParse, ts+7584 /* "misuse of aggreg..." */, crt.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))
- goto __87
-__86:
+ Xsqlite3ErrorMsg(tls, pParse, ts+9984 /* "misuse of aggreg..." */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))))
+ goto __86
+__85:
return (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pInfo)).FaFunc + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiAgg)*24)).FiMem
-__87:
+__86:
;
- goto __4
-__43: // The function name
+ goto __3
+__42: // The function name
constMask = U32(0) // Loop counter
db = (*Parse)(unsafe.Pointer(pParse)).Fdb // The database connection
enc = (*Sqlite3)(unsafe.Pointer(db)).Fenc // The text encoding used by this database
pColl = uintptr(0) // A collating sequence
if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x1000000))) != U32(0)) {
- goto __88
+ goto __87
}
return (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FregResult
-__88:
+__87:
;
if !(((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0) && (Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0)) {
- goto __89
+ goto __88
}
// SQL functions can be expensive. So try to avoid running them
// multiple times if we know they always give the same result
return Xsqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -1)
-__89:
+__88:
;
pFarg = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))
@@ -79208,66 +81887,66 @@ __89:
zId = *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */))
pDef = Xsqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0))
if !((pDef == uintptr(0)) || ((*FuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0))) {
- goto __90
+ goto __89
}
- Xsqlite3ErrorMsg(tls, pParse, ts+7610 /* "unknown function..." */, crt.VaList(bp+16, zId))
- goto __4
-__90:
+ Xsqlite3ErrorMsg(tls, pParse, ts+10010 /* "unknown function..." */, libc.VaList(bp+40, zId))
+ goto __3
+__89:
;
if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(0x00400000)) != 0) {
- goto __91
+ goto __90
}
return exprCodeInlineFunction(tls, pParse, pFarg,
int32((*FuncDef)(unsafe.Pointer(pDef)).FpUserData), target)
- goto __92
-__91:
+ goto __91
+__90:
if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & (U32(0x00080000 | 0x00200000))) != 0) {
- goto __93
+ goto __92
}
Xsqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef)
-__93:
- ;
__92:
;
+__91:
+ ;
i = 0
-__94:
+__93:
if !(i < nFarg) {
- goto __96
+ goto __95
}
if !((i < 32) && (Xsqlite3ExprIsConstant(tls, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+uintptr(i)*32)).FpExpr) != 0)) {
- goto __97
+ goto __96
}
constMask = constMask | (uint32((uint32(1))) << (i))
-__97:
+__96:
;
if !((((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(0x0020)) != U32(0)) && !(pColl != 0)) {
- goto __98
+ goto __97
}
pColl = Xsqlite3ExprCollSeq(tls, pParse, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+uintptr(i)*32)).FpExpr)
-__98:
+__97:
;
+ goto __94
+__94:
+ i++
+ goto __93
goto __95
__95:
- i++
- goto __94
- goto __96
-__96:
;
if !(pFarg != 0) {
- goto __99
+ goto __98
}
if !(constMask != 0) {
- goto __101
+ goto __100
}
r1 = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nFarg)
- goto __102
-__101:
+ goto __101
+__100:
r1 = Xsqlite3GetTempRange(tls, pParse, nFarg)
-__102:
+__101:
;
// For length() and typeof() functions with a column argument,
@@ -79275,26 +81954,26 @@ __102:
// or OPFLAG_TYPEOFARG respectively, to avoid unnecessary data
// loading.
if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & (U32(0x0040 | 0x0080))) != U32(0)) {
- goto __103
+ goto __102
}
exprOp = (*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */) + uintptr(0)*32)).FpExpr)).Fop
if !((int32(exprOp) == 164) || (int32(exprOp) == 166)) {
- goto __104
+ goto __103
}
(*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */) + uintptr(0)*32)).FpExpr)).Fop2 = (U8((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & (U32(0x40 | 0x80))))
-__104:
- ;
__103:
;
+__102:
+ ;
Xsqlite3ExprCodeExprList(tls, pParse, pFarg, r1, 0,
(uint8(0x01 | 0x02)))
- goto __100
-__99:
+ goto __99
+__98:
r1 = 0
-__100:
+__99:
;
// Possibly overload the function if the first argument is
// a virtual table column.
@@ -79308,81 +81987,106 @@ __100:
// "glob(B,A). We want to use the A in "A glob B" to test
// for function overloading. But we use the B term in "glob(B,A)".
if !((nFarg >= 2) && (((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000080))) != U32(0))) {
- goto __105
+ goto __104
}
pDef = Xsqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+uintptr(1)*32)).FpExpr)
- goto __106
-__105:
+ goto __105
+__104:
if !(nFarg > 0) {
- goto __107
+ goto __106
}
pDef = Xsqlite3VtabOverloadFunction(tls, db, pDef, nFarg, (*ExprList_item)(unsafe.Pointer((pFarg+8 /* &.a */)+uintptr(0)*32)).FpExpr)
-__107:
- ;
__106:
;
+__105:
+ ;
if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(0x0020)) != 0) {
- goto __108
+ goto __107
}
if !(!(pColl != 0)) {
- goto __109
+ goto __108
}
pColl = (*Sqlite3)(unsafe.Pointer(db)).FpDfltColl
-__109:
+__108:
;
Xsqlite3VdbeAddOp4(tls, v, 81, 0, 0, 0, pColl, -2)
-__108:
+__107:
+ ;
+ if !(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(0x8000)) != 0) {
+ goto __109
+ }
+ pArg = (*ExprList_item)(unsafe.Pointer((pFarg + 8 /* &.a */) + uintptr(0)*32)).FpExpr
+ if !(int32((*Expr)(unsafe.Pointer(pArg)).Fop) == 164) {
+ goto __111
+ }
+ Xsqlite3VdbeAddOp3(tls, v, 88, (*Expr)(unsafe.Pointer(pArg)).FiTable, int32((*Expr)(unsafe.Pointer(pArg)).FiColumn), target)
+ goto __112
+__111:
+ Xsqlite3VdbeAddOp2(tls, v, 72, 0, target)
+__112:
;
+ goto __110
+__109:
Xsqlite3VdbeAddFunctionCall(tls, pParse, int32(constMask), r1, target, nFarg,
pDef, int32((*Expr)(unsafe.Pointer(pExpr)).Fop2))
+__110:
+ ;
if !(nFarg != 0) {
- goto __110
+ goto __113
}
if !(constMask == U32(0)) {
- goto __111
+ goto __114
}
Xsqlite3ReleaseTempRange(tls, pParse, r1, nFarg)
- goto __112
-__111:
+ goto __115
+__114:
;
-__112:
+__115:
;
-__110:
+__113:
;
return target
+__43:
__44:
-__45:
;
- if !((op == 136) && ((crt.AssignInt32(&nCol, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList)).FnExpr)) != 1)) {
- goto __113
+ if !((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) {
+ goto __116
+ }
+ return 0
+ goto __117
+__116:
+ if !((op == 136) && ((libc.AssignInt32(&nCol, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))).FpEList)).FnExpr)) != 1)) {
+ goto __118
}
Xsqlite3SubselectError(tls, pParse, nCol, 1)
- goto __114
-__113:
+ goto __119
+__118:
return Xsqlite3CodeSubselect(tls, pParse, pExpr)
-__114:
+__119:
;
- goto __4
-__46:
+__117:
+ ;
+ goto __3
+__45:
if !((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiTable == 0) {
- goto __115
+ goto __120
}
(*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiTable = Xsqlite3CodeSubselect(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)
-__115:
+__120:
;
if !(((*Expr)(unsafe.Pointer(pExpr)).FiTable != 0) &&
- ((*Expr)(unsafe.Pointer(pExpr)).FiTable != (crt.AssignInt32(&n1, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))))) {
- goto __116
+ ((*Expr)(unsafe.Pointer(pExpr)).FiTable != (libc.AssignInt32(&n1, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))))) {
+ goto __121
}
- Xsqlite3ErrorMsg(tls, pParse, ts+7226, /* "%d columns assig..." */
- crt.VaList(bp+24, (*Expr)(unsafe.Pointer(pExpr)).FiTable, n1))
-__116:
+ Xsqlite3ErrorMsg(tls, pParse, ts+9472, /* "%d columns assig..." */
+ libc.VaList(bp+48, (*Expr)(unsafe.Pointer(pExpr)).FiTable, n1))
+__121:
;
return ((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiTable + int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn))
-__47:
+__46:
destIfFalse = Xsqlite3VdbeMakeLabel(tls, pParse)
destIfNull = Xsqlite3VdbeMakeLabel(tls, pParse)
Xsqlite3VdbeAddOp2(tls, v, 72, 0, target)
@@ -79402,16 +82106,16 @@ __47:
// X is stored in pExpr->pLeft.
// Y is stored in pExpr->pList->a[0].pExpr.
// Z is stored in pExpr->pList->a[1].pExpr.
-__48:
+__47:
exprCodeBetween(tls, pParse, pExpr, target, uintptr(0), 0)
return target
+__48:
__49:
__50:
-__51:
pExpr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
goto expr_code_doover
-__52:
+__51:
// If the opcode is TK_TRIGGER, then the expression is a reference
// to a column in the new.* or old.* pseudo-tables available to
// trigger programs. In this case Expr.iTable is set to 1 for the
@@ -79442,6 +82146,17 @@ __52:
int32(Xsqlite3TableColumnToStorage(tls, pTab2, int16(iCol1))))
Xsqlite3VdbeAddOp2(tls, v, 148, p1, target)
+ Xsqlite3VdbeComment(tls, v, ts+10033 /* "r[%d]=%s.%s" */, libc.VaList(bp+64, target, func() uintptr {
+ if (*Expr)(unsafe.Pointer(pExpr)).FiTable != 0 {
+ return ts + 8319 /* "new" */
+ }
+ return ts + 8323 /* "old" */
+ }(), func() uintptr {
+ if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) < 0 {
+ return ts + 10045 /* "rowid" */
+ }
+ return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FaCol + uintptr(iCol1)*32)).FzName
+ }()))
// If the column has REAL affinity, it may currently be stored as an
// integer. Use OP_RealAffinity to make sure it is really real.
@@ -79449,23 +82164,23 @@ __52:
// EVIDENCE-OF: R-60985-57662 SQLite will convert the value back to
// floating point when extracting it from the record.
if !((iCol1 >= 0) && (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab2)).FaCol+uintptr(iCol1)*32)).Faffinity) == 0x45)) {
- goto __117
+ goto __122
}
Xsqlite3VdbeAddOp1(tls, v, 83, target)
-__117:
+__122:
;
- goto __4
+ goto __3
-__53:
- Xsqlite3ErrorMsg(tls, pParse, ts+6206 /* "row value misuse..." */, 0)
- goto __4
+__52:
+ Xsqlite3ErrorMsg(tls, pParse, ts+8404 /* "row value misuse..." */, 0)
+ goto __3
// TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions
// that derive from the right-hand table of a LEFT JOIN. The
// Expr.iTable value is the table number for the right-hand table.
// The expression is only evaluated if that table is not currently
// on a LEFT JOIN NULL row.
-__54:
+__53:
okConstFactor = (*Parse)(unsafe.Pointer(pParse)).FokConstFactor
addrINR = Xsqlite3VdbeAddOp1(tls, v, 21, (*Expr)(unsafe.Pointer(pExpr)).FiTable)
// Temporarily disable factoring of constant expressions, since
@@ -79477,7 +82192,7 @@ __54:
(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor
Xsqlite3VdbeJumpHere(tls, v, addrINR)
Xsqlite3VdbeChangeP3(tls, v, addrINR, inReg)
- goto __4
+ goto __3
// Form A:
// CASE x WHEN e1 THEN r1 WHEN e2 THEN r2 ... WHEN eN THEN rN ELSE y END
@@ -79498,7 +82213,7 @@ __54:
// The result of the expression is the Ri for the first matching Ei,
// or if there is no matching Ei, the ELSE term Y, or if there is
// no ELSE term, NULL.
-__55: // The X expression
+__54: // The X expression
pTest = uintptr(0) // X==Ei (form A) or just Ei (form B)
pDel = uintptr(0)
db1 = (*Parse)(unsafe.Pointer(pParse)).Fdb
@@ -79507,45 +82222,45 @@ __55: // The X expression
aListelem = pEList + 8 /* &.a */
nExpr = (*ExprList)(unsafe.Pointer(pEList)).FnExpr
endLabel = Xsqlite3VdbeMakeLabel(tls, pParse)
- if !((crt.AssignUintptr(&pX, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) != uintptr(0)) {
- goto __118
+ if !((libc.AssignUintptr(&pX, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) != uintptr(0)) {
+ goto __123
}
pDel = Xsqlite3ExprDup(tls, db1, pX, 0)
if !((*Sqlite3)(unsafe.Pointer(db1)).FmallocFailed != 0) {
- goto __119
+ goto __124
}
Xsqlite3ExprDelete(tls, db1, pDel)
- goto __4
-__119:
+ goto __3
+__124:
;
- exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+40 /* &regFree1 */))
+ exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+88 /* &regFree1 */))
- crt.Xmemset(tls, bp+120 /* &opCompare */, 0, uint64(unsafe.Sizeof(Expr{})))
- (*Expr)(unsafe.Pointer(bp + 120 /* &opCompare */)).Fop = U8(53)
- (*Expr)(unsafe.Pointer(bp + 120 /* &opCompare */)).FpLeft = pDel
- pTest = bp + 120 /* &opCompare */
+ libc.Xmemset(tls, bp+168 /* &opCompare */, 0, uint64(unsafe.Sizeof(Expr{})))
+ (*Expr)(unsafe.Pointer(bp + 168 /* &opCompare */)).Fop = U8(53)
+ (*Expr)(unsafe.Pointer(bp + 168 /* &opCompare */)).FpLeft = pDel
+ pTest = bp + 168 /* &opCompare */
// Ticket b351d95f9cd5ef17e9d9dbae18f5ca8611190001:
// The value in regFree1 might get SCopy-ed into the file result.
// So make sure that the regFree1 register is not reused for other
// purposes and possibly overwritten.
- *(*int32)(unsafe.Pointer(bp + 40 /* regFree1 */)) = 0
-__118:
+ *(*int32)(unsafe.Pointer(bp + 88 /* regFree1 */)) = 0
+__123:
;
i1 = 0
-__120:
+__125:
if !(i1 < (nExpr - 1)) {
- goto __122
+ goto __127
}
if !(pX != 0) {
- goto __123
+ goto __128
}
- (*Expr)(unsafe.Pointer(bp + 120 /* &opCompare */)).FpRight = (*ExprList_item)(unsafe.Pointer(aListelem + uintptr(i1)*32)).FpExpr
- goto __124
-__123:
+ (*Expr)(unsafe.Pointer(bp + 168 /* &opCompare */)).FpRight = (*ExprList_item)(unsafe.Pointer(aListelem + uintptr(i1)*32)).FpExpr
+ goto __129
+__128:
pTest = (*ExprList_item)(unsafe.Pointer(aListelem + uintptr(i1)*32)).FpExpr
-__124:
+__129:
;
nextCase = Xsqlite3VdbeMakeLabel(tls, pParse)
@@ -79554,50 +82269,50 @@ __124:
Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer(aListelem+uintptr((i1+1))*32)).FpExpr, target)
Xsqlite3VdbeGoto(tls, v, endLabel)
Xsqlite3VdbeResolveLabel(tls, v, nextCase)
- goto __121
-__121:
+ goto __126
+__126:
i1 = (i1 + 2)
- goto __120
- goto __122
-__122:
+ goto __125
+ goto __127
+__127:
;
if !((nExpr & 1) != 0) {
- goto __125
+ goto __130
}
Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr((nExpr-1))*32)).FpExpr, target)
- goto __126
-__125:
+ goto __131
+__130:
Xsqlite3VdbeAddOp2(tls, v, 72, 0, target)
-__126:
+__131:
;
Xsqlite3ExprDelete(tls, db1, pDel)
setDoNotMergeFlagOnCopy(tls, v)
Xsqlite3VdbeResolveLabel(tls, v, endLabel)
- goto __4
-__56:
+ goto __3
+__55:
;
if !(!(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0) && !(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) {
- goto __127
+ goto __132
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+7633 /* "RAISE() may only..." */, 0)
+ ts+10051 /* "RAISE() may only..." */, 0)
return 0
-__127:
+__132:
;
if !(int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr) == 2) {
- goto __128
+ goto __133
}
Xsqlite3MayAbort(tls, pParse)
-__128:
+__133:
;
if !(int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr) == 4) {
- goto __129
+ goto __134
}
Xsqlite3VdbeAddOp4(tls,
v, 68, 0, 4, 0, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), 0)
- goto __130
-__129:
+ goto __135
+__134:
Xsqlite3HaltConstraint(tls, pParse,
func() int32 {
if (*Parse)(unsafe.Pointer(pParse)).FpTriggerTab != 0 {
@@ -79606,18 +82321,18 @@ __129:
return 1
}(),
int32((*Expr)(unsafe.Pointer(pExpr)).FaffExpr), *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), int8(0), uint8(0))
-__130:
+__135:
;
- goto __4
-__4:
+ goto __3
+__3:
;
- Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 40 /* regFree1 */)))
- Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 44 /* regFree2 */)))
+ Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 88 /* regFree1 */)))
+ Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 92 /* regFree2 */)))
return inReg
}
-var zAff = *(*[8]int8)(unsafe.Pointer(ts + 7683 /* "B\x00C\x00D\x00E" */)) /* sqlite3.c:103360:29 */
+var zAff = *(*[8]int8)(unsafe.Pointer(ts + 10101 /* "B\x00C\x00D\x00E" */)) /* sqlite3.c:103573:29 */
// Generate code that will evaluate expression pExpr just one time
// per prepared statement execution.
@@ -79634,7 +82349,7 @@ var zAff = *(*[8]int8)(unsafe.Pointer(ts + 7683 /* "B\x00C\x00D\x00E" */)) /* sq
// code to the same register, if they do not contain function calls and hence
// are factored out into the initialization section at the end of the
// prepared statement.
-func Xsqlite3ExprCodeRunJustOnce(tls *crt.TLS, pParse uintptr, pExpr uintptr, regDest int32) int32 { /* sqlite3.c:104048:20: */
+func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, regDest int32) int32 { /* sqlite3.c:104263:20: */
var p uintptr
p = (*Parse)(unsafe.Pointer(pParse)).FpConstExpr
@@ -79669,7 +82384,7 @@ func Xsqlite3ExprCodeRunJustOnce(tls *crt.TLS, pParse uintptr, pExpr uintptr, re
(*Parse)(unsafe.Pointer(pParse)).FokConstFactor = U8(0)
if !(int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed) != 0) {
if regDest < 0 {
- regDest = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regDest = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
Xsqlite3ExprCode(tls, pParse, pExpr, regDest)
}
@@ -79680,9 +82395,9 @@ func Xsqlite3ExprCodeRunJustOnce(tls *crt.TLS, pParse uintptr, pExpr uintptr, re
p = Xsqlite3ExprListAppend(tls, pParse, p, pExpr)
if p != 0 {
var pItem uintptr = ((p + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(p)).FnExpr-1))*32)
- crt.SetBitFieldPtr8Uint32(pItem+20 /* &.reusable */, (uint32(crt.Bool32(regDest < 0))), 3, 0x8)
+ libc.SetBitFieldPtr8Uint32(pItem+20 /* &.reusable */, (uint32(libc.Bool32(regDest < 0))), 3, 0x8)
if regDest < 0 {
- regDest = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regDest = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
*(*int32)(unsafe.Pointer(pItem + 24 /* &.u */)) = regDest
}
@@ -79702,7 +82417,7 @@ func Xsqlite3ExprCodeRunJustOnce(tls *crt.TLS, pParse uintptr, pExpr uintptr, re
// If pExpr is a constant, then this routine might generate this
// code to fill the register in the initialization section of the
// VDBE program, in order to factor it out of the evaluation loop.
-func Xsqlite3ExprCodeTemp(tls *crt.TLS, pParse uintptr, pExpr uintptr, pReg uintptr) int32 { /* sqlite3.c:104105:20: */
+func Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uintptr) int32 { /* sqlite3.c:104320:20: */
var r2 int32
pExpr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr)
if (((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0) &&
@@ -79726,12 +82441,14 @@ func Xsqlite3ExprCodeTemp(tls *crt.TLS, pParse uintptr, pExpr uintptr, pReg uint
// Generate code that will evaluate expression pExpr and store the
// results in register target. The results are guaranteed to appear
// in register target.
-func Xsqlite3ExprCode(tls *crt.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:104132:21: */
+func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:104347:21: */
var inReg int32
+ if (*Parse)(unsafe.Pointer(pParse)).FpVdbe == uintptr(0) {
+ return
+ }
inReg = Xsqlite3ExprCodeTarget(tls, pParse, pExpr, target)
-
- if (inReg != target) && ((*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0) {
+ if inReg != target {
var op U8
if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x200000))) != U32(0) {
op = U8(77)
@@ -79745,7 +82462,7 @@ func Xsqlite3ExprCode(tls *crt.TLS, pParse uintptr, pExpr uintptr, target int32)
// Make a transient copy of expression pExpr and then code it using
// sqlite3ExprCode(). This routine works just like sqlite3ExprCode()
// except that the input expression is guaranteed to be unchanged.
-func Xsqlite3ExprCodeCopy(tls *crt.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:104155:21: */
+func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:104371:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
pExpr = Xsqlite3ExprDup(tls, db, pExpr, 0)
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) != 0) {
@@ -79758,7 +82475,7 @@ func Xsqlite3ExprCodeCopy(tls *crt.TLS, pParse uintptr, pExpr uintptr, target in
// results in register target. The results are guaranteed to appear
// in register target. If the expression is constant, then this routine
// might choose to code the expression at initialization time.
-func Xsqlite3ExprCodeFactorable(tls *crt.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:104168:21: */
+func Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { /* sqlite3.c:104384:21: */
if ((*Parse)(unsafe.Pointer(pParse)).FokConstFactor != 0) && (Xsqlite3ExprIsConstantNotJoin(tls, pExpr) != 0) {
Xsqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target)
} else {
@@ -79784,7 +82501,7 @@ func Xsqlite3ExprCodeFactorable(tls *crt.TLS, pParse uintptr, pExpr uintptr, tar
// in registers at srcReg, and so the value can be copied from there.
// If SQLITE_ECEL_OMITREF is also set, then the values with u.x.iOrderByCol>0
// are simply omitted rather than being copied from srcReg.
-func Xsqlite3ExprCodeExprList(tls *crt.TLS, pParse uintptr, pList uintptr, target int32, srcReg int32, flags U8) int32 { /* sqlite3.c:104196:20: */
+func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, target int32, srcReg int32, flags U8) int32 { /* sqlite3.c:104412:20: */
var pItem uintptr
var i int32
var j int32
@@ -79800,7 +82517,7 @@ func Xsqlite3ExprCodeExprList(tls *crt.TLS, pParse uintptr, pList uintptr, targe
// Never gets this far otherwise
n = (*ExprList)(unsafe.Pointer(pList)).FnExpr
if !(int32((*Parse)(unsafe.Pointer(pParse)).FokConstFactor) != 0) {
- flags = crt.Uint8FromInt32(int32(flags) & (^int32(crt.Int32FromInt32(0x02))))
+ flags = libc.Uint8FromInt32(int32(flags) & (^int32(libc.Int32FromInt32(0x02))))
}
pItem = pList + 8 /* &.a */
i = 0
@@ -79810,7 +82527,7 @@ __1:
}
{
var pExpr uintptr = (*ExprList_item)(unsafe.Pointer(pItem)).FpExpr
- if ((int32(flags) & 0x04) != 0) && ((crt.AssignInt32(&j, int32((*struct {
+ if ((int32(flags) & 0x04) != 0) && ((libc.AssignInt32(&j, int32((*struct {
FiOrderByCol U16
FiAlias U16
})(unsafe.Pointer(pItem+24 /* &.u */)).FiOrderByCol))) > 0) {
@@ -79828,7 +82545,7 @@ __1:
if inReg != (target + i) {
var pOp uintptr
if ((((int32(copyOp) == 77) &&
- (int32((*VdbeOp)(unsafe.Pointer((crt.AssignUintptr(&pOp, Xsqlite3VdbeGetOp(tls, v, -1))))).Fopcode) == 77)) &&
+ (int32((*VdbeOp)(unsafe.Pointer((libc.AssignUintptr(&pOp, Xsqlite3VdbeGetOp(tls, v, -1))))).Fopcode) == 77)) &&
((((*VdbeOp)(unsafe.Pointer(pOp)).Fp1 + (*VdbeOp)(unsafe.Pointer(pOp)).Fp3) + 1) == inReg)) &&
((((*VdbeOp)(unsafe.Pointer(pOp)).Fp2 + (*VdbeOp)(unsafe.Pointer(pOp)).Fp3) + 1) == (target + i))) &&
(int32((*VdbeOp)(unsafe.Pointer(pOp)).Fp5) == 0) {
@@ -79868,7 +82585,7 @@ __3:
// sqlite3ExprIfFalse: Jump to dest if false
//
// The jumpIfNull parameter is ignored if xJumpIf is NULL.
-func exprCodeBetween(tls *crt.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { /* sqlite3.c:104271:13: */
+func exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { /* sqlite3.c:104487:13: */
bp := tls.Alloc(220)
defer tls.Free(220)
@@ -79882,9 +82599,9 @@ func exprCodeBetween(tls *crt.TLS, pParse uintptr, pExpr uintptr, dest int32, xJ
var pDel uintptr = uintptr(0)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- crt.Xmemset(tls, bp /* &compLeft */, 0, uint64(unsafe.Sizeof(Expr{})))
- crt.Xmemset(tls, bp+72 /* &compRight */, 0, uint64(unsafe.Sizeof(Expr{})))
- crt.Xmemset(tls, bp+144 /* &exprAnd */, 0, uint64(unsafe.Sizeof(Expr{})))
+ libc.Xmemset(tls, bp /* &compLeft */, 0, uint64(unsafe.Sizeof(Expr{})))
+ libc.Xmemset(tls, bp+72 /* &compRight */, 0, uint64(unsafe.Sizeof(Expr{})))
+ libc.Xmemset(tls, bp+144 /* &exprAnd */, 0, uint64(unsafe.Sizeof(Expr{})))
pDel = Xsqlite3ExprDup(tls, db, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, 0)
if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
@@ -79899,7 +82616,7 @@ func exprCodeBetween(tls *crt.TLS, pParse uintptr, pExpr uintptr, dest int32, xJ
(*Expr)(unsafe.Pointer(bp + 72 /* &compRight */)).FpRight = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)) + 8 /* &.a */) + uintptr(1)*32)).FpExpr
exprToRegister(tls, pDel, exprCodeVector(tls, pParse, pDel, bp+216 /* &regFree1 */))
if xJump != 0 {
- (*(*func(*crt.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&xJump)))(tls, pParse, bp+144 /* &exprAnd */, dest, jumpIfNull)
+ (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&xJump)))(tls, pParse, bp+144 /* &exprAnd */, dest, jumpIfNull)
} else {
// Mark the expression is being from the ON or USING clause of a join
// so that the sqlite3ExprCodeTarget() routine will not attempt to move
@@ -79929,7 +82646,7 @@ func exprCodeBetween(tls *crt.TLS, pParse uintptr, pExpr uintptr, dest int32, xJ
// operation. Special comments in vdbe.c and the mkopcodeh.awk script in
// the make process cause these values to align. Assert()s in the code
// below verify that the numbers are aligned correctly.
-func Xsqlite3ExprIfTrue(tls *crt.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:104343:21: */
+func Xsqlite3ExprIfTrue(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:104559:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -79979,7 +82696,7 @@ __2:
goto __8
case 168:
goto __9
- // Fall thru
+ /* no break */
case 56:
goto __10
case 55:
@@ -80038,7 +82755,7 @@ __6:
goto __3
__7: // IS TRUE or IS NOT TRUE
;
- isNot = (crt.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == 168))
+ isNot = (libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == 168))
isTrue = Xsqlite3ExprTruthValue(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
if !((isTrue ^ isNot) != 0) {
@@ -80073,7 +82790,7 @@ __9:
op = 52
}
jumpIfNull = 0x80
- // Fall thru
+ /* no break */
__10:
__11:
__12:
@@ -80090,7 +82807,7 @@ __27:
r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp /* &regFree1 */)
r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4 /* &regFree2 */)
codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op,
- r1, r2, dest, jumpIfNull, (crt.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000200))) != U32(0))))
+ r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000200))) != U32(0))))
goto __3
__16:
@@ -80104,7 +82821,7 @@ __17:
__18:
;
exprCodeBetween(tls, pParse, pExpr, dest, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, int32)
+ f func(*libc.TLS, uintptr, uintptr, int32, int32)
}{Xsqlite3ExprIfTrue})), jumpIfNull)
goto __3
__19:
@@ -80132,7 +82849,7 @@ __28:
goto __31
__30:
r1 = Xsqlite3ExprCodeTemp(tls, pParse, pExpr, bp /* &regFree1 */)
- Xsqlite3VdbeAddOp3(tls, v, 18, r1, dest, (crt.Bool32(jumpIfNull != 0)))
+ Xsqlite3VdbeAddOp3(tls, v, 18, r1, dest, (libc.Bool32(jumpIfNull != 0)))
__31:
;
@@ -80152,7 +82869,7 @@ __3:
// If the expression evaluates to NULL (neither true nor false) then
// jump if jumpIfNull is SQLITE_JUMPIFNULL or fall through if jumpIfNull
// is 0.
-func Xsqlite3ExprIfFalse(tls *crt.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:104485:21: */
+func Xsqlite3ExprIfFalse(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:104701:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -80221,7 +82938,7 @@ __2:
goto __8
case 168:
goto __9
- // Fall thru
+ /* no break */
case 56:
goto __10
case 55:
@@ -80280,7 +82997,7 @@ __6:
goto __3
__7: // IS TRUE or IS NOT TRUE
;
- isNot = (crt.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == 168))
+ isNot = (libc.Bool32(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) == 168))
isTrue = Xsqlite3ExprTruthValue(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight)
if !((isTrue ^ isNot) != 0) {
@@ -80317,7 +83034,7 @@ __9:
op = 53
}
jumpIfNull = 0x80
- // Fall thru
+ /* no break */
__10:
__11:
__12:
@@ -80334,7 +83051,7 @@ __27:
r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, bp /* &regFree1 */)
r2 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+4 /* &regFree2 */)
codeCompare(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight, op,
- r1, r2, dest, jumpIfNull, (crt.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000200))) != U32(0))))
+ r1, r2, dest, jumpIfNull, (libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000200))) != U32(0))))
goto __3
__16:
@@ -80346,7 +83063,7 @@ __17:
__18:
;
exprCodeBetween(tls, pParse, pExpr, dest, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, int32, int32)
+ f func(*libc.TLS, uintptr, uintptr, int32, int32)
}{Xsqlite3ExprIfFalse})), jumpIfNull)
goto __3
__19:
@@ -80376,7 +83093,7 @@ __30:
goto __33
__32:
r1 = Xsqlite3ExprCodeTemp(tls, pParse, pExpr, bp /* &regFree1 */)
- Xsqlite3VdbeAddOp3(tls, v, 20, r1, dest, (crt.Bool32(jumpIfNull != 0)))
+ Xsqlite3VdbeAddOp3(tls, v, 20, r1, dest, (libc.Bool32(jumpIfNull != 0)))
__33:
;
@@ -80392,7 +83109,7 @@ __3:
// Like sqlite3ExprIfFalse() except that a copy is made of pExpr before
// code generation, and that copy is deleted after code generation. This
// ensures that the original pExpr is unchanged.
-func Xsqlite3ExprIfFalseDup(tls *crt.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:104657:21: */
+func Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32) { /* sqlite3.c:104873:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pCopy uintptr = Xsqlite3ExprDup(tls, db, pExpr, 0)
if int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 {
@@ -80412,7 +83129,7 @@ func Xsqlite3ExprIfFalseDup(tls *crt.TLS, pParse uintptr, pExpr uintptr, dest in
// same as that currently bound to variable pVar, non-zero is returned.
// Otherwise, if the values are not the same or if pExpr is not a simple
// SQL value, zero is returned.
-func exprCompareVariable(tls *crt.TLS, pParse uintptr, pVar uintptr, pExpr uintptr) int32 { /* sqlite3.c:104679:12: */
+func exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uintptr) int32 { /* sqlite3.c:104895:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -80430,7 +83147,7 @@ func exprCompareVariable(tls *crt.TLS, pParse uintptr, pVar uintptr, pExpr uintp
if Xsqlite3_value_type(tls, pL) == 3 {
Xsqlite3_value_text(tls, pL)
}
- res = (crt.Bool32(0 == Xsqlite3MemCompare(tls, pL, *(*uintptr)(unsafe.Pointer(bp /* pR */)), uintptr(0))))
+ res = (libc.Bool32(0 == Xsqlite3MemCompare(tls, pL, *(*uintptr)(unsafe.Pointer(bp /* pR */)), uintptr(0))))
}
Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp /* pR */)))
Xsqlite3ValueFree(tls, pL)
@@ -80466,7 +83183,7 @@ func exprCompareVariable(tls *crt.TLS, pParse uintptr, pVar uintptr, pExpr uintp
// If pParse is NULL (the normal case) then any TK_VARIABLE term in
// Argument pParse should normally be NULL. If it is not NULL and pA or
// pB causes a return value of 2.
-func Xsqlite3ExprCompare(tls *crt.TLS, pParse uintptr, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:104731:20: */
+func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:104947:20: */
var combinedFlags U32
if (pA == uintptr(0)) || (pB == uintptr(0)) {
if pB == pA {
@@ -80499,7 +83216,7 @@ func Xsqlite3ExprCompare(tls *crt.TLS, pParse uintptr, pA uintptr, pB uintptr, i
return 2
}
- if (crt.Bool32(((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(0x1000000))) != U32(0))) != (crt.Bool32(((*Expr)(unsafe.Pointer((pB))).Fflags & (U32(0x1000000))) != U32(0))) {
+ if (libc.Bool32(((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(0x1000000))) != U32(0))) != (libc.Bool32(((*Expr)(unsafe.Pointer((pB))).Fflags & (U32(0x1000000))) != U32(0))) {
return 2
}
if ((*Expr)(unsafe.Pointer((pA))).Fflags & (U32(0x1000000))) != U32(0) {
@@ -80513,7 +83230,7 @@ func Xsqlite3ExprCompare(tls *crt.TLS, pParse uintptr, pA uintptr, pB uintptr, i
if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8 /* &.u */)), *(*uintptr)(unsafe.Pointer(pB + 8 /* &.u */))) != 0 {
return 2
}
- } else if (*(*uintptr)(unsafe.Pointer(pB + 8 /* &.u */)) != uintptr(0)) && (crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8 /* &.u */)), *(*uintptr)(unsafe.Pointer(pB + 8 /* &.u */))) != 0) {
+ } else if (*(*uintptr)(unsafe.Pointer(pB + 8 /* &.u */)) != uintptr(0)) && (libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(pA + 8 /* &.u */)), *(*uintptr)(unsafe.Pointer(pB + 8 /* &.u */))) != 0) {
return 2
}
}
@@ -80566,7 +83283,7 @@ func Xsqlite3ExprCompare(tls *crt.TLS, pParse uintptr, pA uintptr, pB uintptr, i
//
// Two NULL pointers are considered to be the same. But a NULL pointer
// always differs from a non-NULL pointer.
-func Xsqlite3ExprListCompare(tls *crt.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:104815:20: */
+func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:105031:20: */
var i int32
if (pA == uintptr(0)) && (pB == uintptr(0)) {
return 0
@@ -80584,7 +83301,7 @@ func Xsqlite3ExprListCompare(tls *crt.TLS, pA uintptr, pB uintptr, iTab int32) i
if int32((*ExprList_item)(unsafe.Pointer((pA+8 /* &.a */)+uintptr(i)*32)).FsortFlags) != int32((*ExprList_item)(unsafe.Pointer((pB+8 /* &.a */)+uintptr(i)*32)).FsortFlags) {
return 1
}
- if crt.AssignInt32(&res, Xsqlite3ExprCompare(tls, uintptr(0), pExprA, pExprB, iTab)) != 0 {
+ if libc.AssignInt32(&res, Xsqlite3ExprCompare(tls, uintptr(0), pExprA, pExprB, iTab)) != 0 {
return res
}
}
@@ -80593,7 +83310,7 @@ func Xsqlite3ExprListCompare(tls *crt.TLS, pA uintptr, pB uintptr, iTab int32) i
// Like sqlite3ExprCompare() except COLLATE operators at the top-level
// are ignored.
-func Xsqlite3ExprCompareSkip(tls *crt.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:104834:20: */
+func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32 { /* sqlite3.c:105050:20: */
return Xsqlite3ExprCompare(tls, uintptr(0),
Xsqlite3ExprSkipCollateAndLikely(tls, pA),
Xsqlite3ExprSkipCollateAndLikely(tls, pB),
@@ -80604,10 +83321,10 @@ func Xsqlite3ExprCompareSkip(tls *crt.TLS, pA uintptr, pB uintptr, iTab int32) i
//
// Or if seenNot is true, return non-zero if Expr p can only be
// non-NULL if pNN is not NULL
-func exprImpliesNotNull(tls *crt.TLS, pParse uintptr, p uintptr, pNN uintptr, iTab int32, seenNot int32) int32 { /* sqlite3.c:104847:12: */
+func exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, iTab int32, seenNot int32) int32 { /* sqlite3.c:105063:12: */
if Xsqlite3ExprCompare(tls, pParse, p, pNN, iTab) == 0 {
- return (crt.Bool32(int32((*Expr)(unsafe.Pointer(pNN)).Fop) != 119))
+ return (libc.Bool32(int32((*Expr)(unsafe.Pointer(pNN)).Fop) != 119))
}
switch int32((*Expr)(unsafe.Pointer(p)).Fop) {
case 49:
@@ -80656,7 +83373,7 @@ func exprImpliesNotNull(tls *crt.TLS, pParse uintptr, p uintptr, pNN uintptr, iT
case 110:
seenNot = 1
fallthrough
- // Fall thru
+ /* no break */
case 107:
fallthrough
case 109:
@@ -80668,7 +83385,7 @@ func exprImpliesNotNull(tls *crt.TLS, pParse uintptr, p uintptr, pNN uintptr, iT
if exprImpliesNotNull(tls, pParse, (*Expr)(unsafe.Pointer(p)).FpRight, pNN, iTab, seenNot) != 0 {
return 1
}
- // Fall thru into the next case
+ /* no break */
}
fallthrough
case 178:
@@ -80724,7 +83441,7 @@ func exprImpliesNotNull(tls *crt.TLS, pParse uintptr, p uintptr, pNN uintptr, iT
// When in doubt, return false. Returning true might give a performance
// improvement. Returning false might cause a performance reduction, but
// it will always give the correct answer and is hence always safe.
-func Xsqlite3ExprImpliesExpr(tls *crt.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr, iTab int32) int32 { /* sqlite3.c:104943:20: */
+func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr, iTab int32) int32 { /* sqlite3.c:105159:20: */
if Xsqlite3ExprCompare(tls, pParse, pE1, pE2, iTab) == 0 {
return 1
}
@@ -80747,7 +83464,7 @@ func Xsqlite3ExprImpliesExpr(tls *crt.TLS, pParse uintptr, pE1 uintptr, pE2 uint
// This routine controls an optimization. False positives (setting
// pWalker->eCode to 1 when it should not be) are deadly, but false-negatives
// (never setting pWalker->eCode) is a harmless missed optimization.
-func impliesNotNullRow(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:104970:12: */
+func impliesNotNullRow(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105186:12: */
if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000001))) != U32(0) {
return 1
@@ -80824,6 +83541,7 @@ func impliesNotNullRow(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
((*Table)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 64 /* &.y */)))).FnModuleArg != 0)) {
return 1
}
+ /* no break */
}
fallthrough
default:
@@ -80852,7 +83570,7 @@ func impliesNotNullRow(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
// clause requires that some column of the right table of the LEFT JOIN
// be non-NULL, then the LEFT JOIN can be safely converted into an
// ordinary join.
-func Xsqlite3ExprImpliesNonNullRow(tls *crt.TLS, p uintptr, iTab int32) int32 { /* sqlite3.c:105074:20: */
+func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32 { /* sqlite3.c:105291:20: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -80873,7 +83591,7 @@ func Xsqlite3ExprImpliesNonNullRow(tls *crt.TLS, p uintptr, iTab int32) int32 {
}
}
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{impliesNotNullRow}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = uintptr(0)
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0)
@@ -80886,7 +83604,7 @@ func Xsqlite3ExprImpliesNonNullRow(tls *crt.TLS, p uintptr, iTab int32) int32 {
// Check to see if there are references to columns in table
// pWalker->u.pIdxCover->iCur can be satisfied using the index
// pWalker->u.pIdxCover->pIdx.
-func exprIdxCover(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105112:12: */
+func exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105329:12: */
if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 164) &&
((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*IdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FiCur)) &&
(int32(Xsqlite3TableColumnToIndex(tls, (*IdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FpIdx, (*Expr)(unsafe.Pointer(pExpr)).FiColumn)) < 0) {
@@ -80904,7 +83622,7 @@ func exprIdxCover(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlit
// An index covering an expression means that the expression can be
// evaluated using only the index and without having to lookup the
// corresponding table entry.
-func Xsqlite3ExprCoveredByIndex(tls *crt.TLS, pExpr uintptr, iCur int32, pIdx uintptr) int32 { /* sqlite3.c:105133:20: */
+func Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx uintptr) int32 { /* sqlite3.c:105350:20: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -80912,22 +83630,22 @@ func Xsqlite3ExprCoveredByIndex(tls *crt.TLS, pExpr uintptr, iCur int32, pIdx ui
// var xcov IdxCover at bp+48, 16
- crt.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
(*IdxCover)(unsafe.Pointer(bp + 48 /* &xcov */)).FiCur = iCur
(*IdxCover)(unsafe.Pointer(bp + 48 /* &xcov */)).FpIdx = pIdx
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{exprIdxCover}))
*(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = bp + 48 /* &xcov */
Xsqlite3WalkExpr(tls, bp /* &w */, pExpr)
- return crt.BoolInt32(!((*Walker)(unsafe.Pointer(bp /* &w */)).FeCode != 0))
+ return libc.BoolInt32(!((*Walker)(unsafe.Pointer(bp /* &w */)).FeCode != 0))
}
// xSelect callback for sqlite3FunctionUsesThisSrc(). If this is the first
// SELECT with a FROM clause encountered during this iteration, set
// SrcCount.iSrcInner to the cursor number of the leftmost object in
// the FROM cause.
-func selectSrcCount(tls *crt.TLS, pWalker uintptr, pSel uintptr) int32 { /* sqlite3.c:105169:12: */
+func selectSrcCount(tls *libc.TLS, pWalker uintptr, pSel uintptr) int32 { /* sqlite3.c:105386:12: */
var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */))
if (((*SrcCount)(unsafe.Pointer(p)).FiSrcInner == 0x7FFFFFFF) && ((*Select)(unsafe.Pointer(pSel)).FpSrc != 0)) && ((*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSel)).FpSrc)).FnSrc != 0) {
(*SrcCount)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FiSrcInner = (*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSel)).FpSrc + 8 /* &.a */) + uintptr(0)*112)).FiCursor
@@ -80936,7 +83654,7 @@ func selectSrcCount(tls *crt.TLS, pWalker uintptr, pSel uintptr) int32 { /* sqli
}
// Count the number of references to columns.
-func exprSrcCount(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105180:12: */
+func exprSrcCount(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105397:12: */
// There was once a NEVER() on the second term on the grounds that
// sqlite3FunctionUsesThisSrc() was always called before
// sqlite3ExprAnalyzeAggregates() and so the TK_COLUMNs have not yet
@@ -80974,7 +83692,7 @@ func exprSrcCount(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlit
// pSrcList. Return true if they do. Also return true if the function
// has no arguments or has only constant arguments. Return false if pExpr
// references columns but not columns of tables found in pSrcList.
-func Xsqlite3FunctionUsesThisSrc(tls *crt.TLS, pExpr uintptr, pSrcList uintptr) int32 { /* sqlite3.c:105213:20: */
+func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) int32 { /* sqlite3.c:105430:20: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -80982,12 +83700,12 @@ func Xsqlite3FunctionUsesThisSrc(tls *crt.TLS, pExpr uintptr, pSrcList uintptr)
// var cnt SrcCount at bp+48, 24
- crt.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{exprSrcCount}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{selectSrcCount}))
*(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = bp + 48 /* &cnt */
(*SrcCount)(unsafe.Pointer(bp + 48 /* &cnt */)).FpSrc = pSrcList
@@ -81003,7 +83721,7 @@ func Xsqlite3FunctionUsesThisSrc(tls *crt.TLS, pExpr uintptr, pSrcList uintptr)
if ((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x1000000))) != U32(0) {
Xsqlite3WalkExpr(tls, bp /* &w */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter)
}
- return (crt.Bool32(((*SrcCount)(unsafe.Pointer(bp+48 /* &cnt */)).FnThis > 0) || ((*SrcCount)(unsafe.Pointer(bp+48 /* &cnt */)).FnOther == 0)))
+ return (libc.Bool32(((*SrcCount)(unsafe.Pointer(bp+48 /* &cnt */)).FnThis > 0) || ((*SrcCount)(unsafe.Pointer(bp+48 /* &cnt */)).FnOther == 0)))
}
// This is a Walker expression node callback.
@@ -81017,7 +83735,7 @@ func Xsqlite3FunctionUsesThisSrc(tls *crt.TLS, pExpr uintptr, pSrcList uintptr)
// This will cause the expression to be deleted automatically when the
// Parse object is destroyed, but the zero register number means that it
// will not generate any code in the preamble.
-func agginfoPersistExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105247:12: */
+func agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105464:12: */
if (!(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x004000 | 0x002000))) != U32(0))) &&
((*Expr)(unsafe.Pointer(pExpr)).FpAggInfo != uintptr(0)) {
var pAggInfo uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpAggInfo
@@ -81027,19 +83745,19 @@ func agginfoPersistExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 {
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 166 {
- if (*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol+uintptr(iAgg)*32)).FpExpr == pExpr {
+ if (*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol+uintptr(iAgg)*32)).FpCExpr == pExpr {
pExpr = Xsqlite3ExprDup(tls, db, pExpr, 0)
if pExpr != 0 {
- (*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32)).FpExpr = pExpr
+ (*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32)).FpCExpr = pExpr
(*Parse)(unsafe.Pointer(pParse)).FpConstExpr = Xsqlite3ExprListAppend(tls, pParse, (*Parse)(unsafe.Pointer(pParse)).FpConstExpr, pExpr)
}
}
} else {
- if (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(iAgg)*24)).FpExpr == pExpr {
+ if (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(iAgg)*24)).FpFExpr == pExpr {
pExpr = Xsqlite3ExprDup(tls, db, pExpr, 0)
if pExpr != 0 {
- (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(iAgg)*24)).FpExpr = pExpr
+ (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(iAgg)*24)).FpFExpr = pExpr
(*Parse)(unsafe.Pointer(pParse)).FpConstExpr = Xsqlite3ExprListAppend(tls, pParse, (*Parse)(unsafe.Pointer(pParse)).FpConstExpr, pExpr)
}
}
@@ -81050,20 +83768,20 @@ func agginfoPersistExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 {
// Initialize a Walker object so that will persist AggInfo entries referenced
// by the tree that is walked.
-func Xsqlite3AggInfoPersistWalkerInit(tls *crt.TLS, pWalker uintptr, pParse uintptr) { /* sqlite3.c:105285:21: */
- crt.Xmemset(tls, pWalker, 0, uint64(unsafe.Sizeof(Walker{})))
+func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uintptr) { /* sqlite3.c:105502:21: */
+ libc.Xmemset(tls, pWalker, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(pWalker)).FpParse = pParse
(*Walker)(unsafe.Pointer(pWalker)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{agginfoPersistExprCb}))
(*Walker)(unsafe.Pointer(pWalker)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{Xsqlite3SelectWalkNoop}))
}
// Add a new element to the pAggInfo->aCol[] array. Return the index of
// the new element. Return a negative number if malloc fails.
-func addAggInfoColumn(tls *crt.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:105296:12: */
+func addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:105513:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -81080,7 +83798,7 @@ func addAggInfoColumn(tls *crt.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite
// Add a new element to the pAggInfo->aFunc[] array. Return the index of
// the new element. Return a negative number if malloc fails.
-func addAggInfoFunc(tls *crt.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:105312:12: */
+func addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.c:105529:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -81098,7 +83816,7 @@ func addAggInfoFunc(tls *crt.TLS, db uintptr, pInfo uintptr) int32 { /* sqlite3.
// This is the xExprCallback for a tree walker. It is used to
// implement sqlite3ExprAnalyzeAggregates(). See sqlite3ExprAnalyzeAggregates
// for additional information.
-func analyzeAggregate(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105329:12: */
+func analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:105546:12: */
var i int32
var pNC uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */))
var pParse uintptr = (*NameContext)(unsafe.Pointer(pNC)).FpParse
@@ -81150,14 +83868,14 @@ func analyzeAggregate(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
__6:
;
if (k >= (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) &&
- ((crt.AssignInt32(&k, addAggInfoColumn(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pAggInfo))) >= 0) {
+ ((libc.AssignInt32(&k, addAggInfoColumn(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pAggInfo))) >= 0) {
pCol = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*32)
(*AggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */))
(*AggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*Expr)(unsafe.Pointer(pExpr)).FiTable
(*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*Expr)(unsafe.Pointer(pExpr)).FiColumn
- (*AggInfo_col)(unsafe.Pointer(pCol)).FiMem = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ (*AggInfo_col)(unsafe.Pointer(pCol)).FiMem = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
(*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-1)
- (*AggInfo_col)(unsafe.Pointer(pCol)).FpExpr = pExpr
+ (*AggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr
if (*AggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 {
var j int32
var n int32
@@ -81185,7 +83903,7 @@ func analyzeAggregate(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
__9:
}
if int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 {
- (*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = I16(crt.PostIncInt32(&(*AggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn, 1))
+ (*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = I16(libc.PostIncInt32(&(*AggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn, 1))
}
}
// There is now an entry for pExpr in pAggInfo->aCol[] (either
@@ -81222,7 +83940,7 @@ func analyzeAggregate(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
goto __12
}
{
- if Xsqlite3ExprCompare(tls, uintptr(0), (*AggInfo_func)(unsafe.Pointer(pItem)).FpExpr, pExpr, -1) == 0 {
+ if Xsqlite3ExprCompare(tls, uintptr(0), (*AggInfo_func)(unsafe.Pointer(pItem)).FpFExpr, pExpr, -1) == 0 {
goto __12
}
}
@@ -81241,8 +83959,8 @@ func analyzeAggregate(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
if i >= 0 {
pItem = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)
- (*AggInfo_func)(unsafe.Pointer(pItem)).FpExpr = pExpr
- (*AggInfo_func)(unsafe.Pointer(pItem)).FiMem = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ (*AggInfo_func)(unsafe.Pointer(pItem)).FpFExpr = pExpr
+ (*AggInfo_func)(unsafe.Pointer(pItem)).FiMem = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
(*AggInfo_func)(unsafe.Pointer(pItem)).FpFunc = Xsqlite3FindFunction(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb,
*(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)),
@@ -81253,7 +83971,7 @@ func analyzeAggregate(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
return 0
}(), enc, uint8(0))
if ((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(0x000002)) != 0 {
- (*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ (*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
} else {
(*AggInfo_func)(unsafe.Pointer(pItem)).FiDistinct = -1
}
@@ -81279,20 +83997,20 @@ func analyzeAggregate(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* s
//
// This routine should only be called after the expression has been
// analyzed by sqlite3ResolveExprNames().
-func Xsqlite3ExprAnalyzeAggregates(tls *crt.TLS, pNC uintptr, pExpr uintptr) { /* sqlite3.c:105465:21: */
+func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr) { /* sqlite3.c:105682:21: */
bp := tls.Alloc(48)
defer tls.Free(48)
// var w Walker at bp, 48
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{analyzeAggregate}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{Xsqlite3WalkerDepthIncrease}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{Xsqlite3WalkerDepthDecrease}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FwalkerDepth = 0
*(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = pNC
@@ -81305,7 +84023,7 @@ func Xsqlite3ExprAnalyzeAggregates(tls *crt.TLS, pNC uintptr, pExpr uintptr) { /
// expression list. Return the number of errors.
//
// If an error is found, the analysis is cut short.
-func Xsqlite3ExprAnalyzeAggList(tls *crt.TLS, pNC uintptr, pList uintptr) { /* sqlite3.c:105483:21: */
+func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr) { /* sqlite3.c:105700:21: */
var pItem uintptr
var i int32
if pList != 0 {
@@ -81329,26 +84047,26 @@ func Xsqlite3ExprAnalyzeAggList(tls *crt.TLS, pNC uintptr, pList uintptr) { /* s
}
// Allocate a single new register for use to hold some intermediate result.
-func Xsqlite3GetTempReg(tls *crt.TLS, pParse uintptr) int32 { /* sqlite3.c:105496:20: */
+func Xsqlite3GetTempReg(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:105713:20: */
if int32((*Parse)(unsafe.Pointer(pParse)).FnTempReg) == 0 {
- return crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ return libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
- return *(*int32)(unsafe.Pointer((pParse + 212 /* &.aTempReg */) + uintptr(crt.PreDecUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4))
+ return *(*int32)(unsafe.Pointer((pParse + 212 /* &.aTempReg */) + uintptr(libc.PreDecUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4))
}
// Deallocate a register, making available for reuse for some other
// purpose.
-func Xsqlite3ReleaseTempReg(tls *crt.TLS, pParse uintptr, iReg int32) { /* sqlite3.c:105507:21: */
+func Xsqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { /* sqlite3.c:105724:21: */
if iReg != 0 {
if int32((*Parse)(unsafe.Pointer(pParse)).FnTempReg) < (int32(uint64(unsafe.Sizeof([8]int32{})) / uint64(unsafe.Sizeof(int32(0))))) {
- *(*int32)(unsafe.Pointer((pParse + 212 /* &.aTempReg */) + uintptr(crt.PostIncUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) = iReg
+ *(*int32)(unsafe.Pointer((pParse + 212 /* &.aTempReg */) + uintptr(libc.PostIncUint8(&(*Parse)(unsafe.Pointer(pParse)).FnTempReg, 1))*4)) = iReg
}
}
}
// Allocate or deallocate a block of nReg consecutive registers.
-func Xsqlite3GetTempRange(tls *crt.TLS, pParse uintptr, nReg int32) int32 { /* sqlite3.c:105519:20: */
+func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32 { /* sqlite3.c:105736:20: */
var i int32
var n int32
if nReg == 1 {
@@ -81365,7 +84083,7 @@ func Xsqlite3GetTempRange(tls *crt.TLS, pParse uintptr, nReg int32) int32 { /* s
}
return i
}
-func Xsqlite3ReleaseTempRange(tls *crt.TLS, pParse uintptr, iReg int32, nReg int32) { /* sqlite3.c:105533:21: */
+func Xsqlite3ReleaseTempRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { /* sqlite3.c:105750:21: */
if nReg == 1 {
Xsqlite3ReleaseTempReg(tls, pParse, iReg)
return
@@ -81383,7 +84101,7 @@ func Xsqlite3ReleaseTempRange(tls *crt.TLS, pParse uintptr, iReg int32, nReg int
// that might be invoked from other parts of the code, to ensure that
// the sub/co-routine does not use registers in common with the code that
// invokes the sub/co-routine.
-func Xsqlite3ClearTempRegCache(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:105553:21: */
+func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:105770:21: */
(*Parse)(unsafe.Pointer(pParse)).FnTempReg = U8(0)
(*Parse)(unsafe.Pointer(pParse)).FnRangeReg = 0
}
@@ -81417,14 +84135,14 @@ func Xsqlite3ClearTempRegCache(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:1055
// in pParse->zErr (system tables may not be altered) and returns non-zero.
//
// Or, if zName is not a system table, zero is returned.
-func isAlterableTable(tls *crt.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:105613:12: */
+func isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:105830:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
- if (0 == Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7691 /* "sqlite_" */, 7)) ||
+ if (0 == Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10109 /* "sqlite_" */, 7)) ||
((((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(0x1000)) != U32(0)) &&
(Xsqlite3ReadOnlyShadowTables(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb) != 0)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+7699 /* "table %s may not..." */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+10117 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
return 1
}
return 0
@@ -81435,27 +84153,27 @@ func isAlterableTable(tls *crt.TLS, pParse uintptr, pTab uintptr) int32 { /* sql
// called at the end of the generation of an ALTER TABLE ... RENAME ...
// statement to ensure that the operation has not rendered any schema
// objects unusable.
-func renameTestSchema(tls *crt.TLS, pParse uintptr, zDb uintptr, bTemp int32) { /* sqlite3.c:105634:13: */
- bp := tls.Alloc(48)
- defer tls.Free(48)
+func renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { /* sqlite3.c:105851:13: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
Xsqlite3NestedParse(tls, pParse,
- ts+7727, /* "SELECT 1 FROM \"%..." */
- crt.VaList(bp, zDb, ts+5324, /* "sqlite_master" */
+ ts+10145, /* "SELECT 1 FROM \"%..." */
+ libc.VaList(bp, zDb,
zDb, bTemp))
if bTemp == 0 {
Xsqlite3NestedParse(tls, pParse,
- ts+7883, /* "SELECT 1 FROM te..." */
- crt.VaList(bp+32, ts+5324 /* "sqlite_master" */, zDb))
+ ts+10312, /* "SELECT 1 FROM te..." */
+ libc.VaList(bp+24, zDb))
}
}
// Generate code to reload the schema for database iDb. And, if iDb!=1, for
// the temp database as well.
-func renameReloadSchema(tls *crt.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:105661:13: */
+func renameReloadSchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:105878:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
if v != 0 {
Xsqlite3ChangeCookie(tls, pParse, iDb)
@@ -81468,14 +84186,14 @@ func renameReloadSchema(tls *crt.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:
// Generate code to implement the "ALTER TABLE xxx RENAME TO yyy"
// command.
-func Xsqlite3AlterRenameTable(tls *crt.TLS, pParse uintptr, pSrc uintptr, pName uintptr) { /* sqlite3.c:105674:21: */
- bp := tls.Alloc(200)
- defer tls.Free(200)
+func Xsqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr) { /* sqlite3.c:105891:21: */
+ bp := tls.Alloc(184)
+ defer tls.Free(184)
var iDb int32 // Database that contains the table
var zDb uintptr // Name of database iDb
var pTab uintptr // Table being renamed
- var zName uintptr /* NULL-terminated version of pName */
+ var zName uintptr // NULL-terminated version of pName
var db uintptr // Database connection
var nTabName int32 // Number of UTF-8 characters in zTabName
var zTabName uintptr // Original name of the table
@@ -81523,7 +84241,7 @@ __3:
goto __4
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+8038 /* "there is already..." */, crt.VaList(bp, zName))
+ ts+10478 /* "there is already..." */, libc.VaList(bp, zName))
goto exit_rename_table
__4:
;
@@ -81536,7 +84254,7 @@ __4:
goto exit_rename_table
__5:
;
- if !(0 != Xsqlite3CheckObjectName(tls, pParse, zName, ts+6019 /* "table" */, zName)) {
+ if !(0 != Xsqlite3CheckObjectName(tls, pParse, zName, ts+8217 /* "table" */, zName)) {
goto __6
}
goto exit_rename_table
@@ -81546,7 +84264,7 @@ __6:
if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) {
goto __7
}
- Xsqlite3ErrorMsg(tls, pParse, ts+8097 /* "view %s may not ..." */, crt.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+10537 /* "view %s may not ..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
goto exit_rename_table
__7:
;
@@ -81599,25 +84317,25 @@ __12:
// the schema to use the new table name.
Xsqlite3NestedParse(tls, pParse,
- ts+8124 /* "UPDATE \"%w\".%s S..." */, crt.VaList(bp+16, zDb, ts+5324 /* "sqlite_master" */, zDb, zTabName, zName, (crt.Bool32(iDb == 1)), zTabName))
+ ts+10564 /* "UPDATE \"%w\".sqli..." */, libc.VaList(bp+16, zDb, zDb, zTabName, zName, (libc.Bool32(iDb == 1)), zTabName))
- // Update the tbl_name and name columns of the sqlite_master table
+ // Update the tbl_name and name columns of the sqlite_schema table
// as required.
Xsqlite3NestedParse(tls, pParse,
- ts+8297, /* "UPDATE %Q.%s SET..." */
- crt.VaList(bp+72, zDb, ts+5324, /* "sqlite_master" */
+ ts+10748, /* "UPDATE %Q.sqlite..." */
+ libc.VaList(bp+64, zDb,
zName, zName, zName,
nTabName, zTabName))
// If the sqlite_sequence table exists in this database, then update
// it with the new table name.
- if !(Xsqlite3FindTable(tls, db, ts+8591 /* "sqlite_sequence" */, zDb) != 0) {
+ if !(Xsqlite3FindTable(tls, db, ts+11053 /* "sqlite_sequence" */, zDb) != 0) {
goto __13
}
Xsqlite3NestedParse(tls, pParse,
- ts+8607, /* "UPDATE \"%w\".sqli..." */
- crt.VaList(bp+128, zDb, zName, (*Table)(unsafe.Pointer(pTab)).FzName))
+ ts+11069, /* "UPDATE \"%w\".sqli..." */
+ libc.VaList(bp+112, zDb, zName, (*Table)(unsafe.Pointer(pTab)).FzName))
__13:
;
@@ -81629,7 +84347,7 @@ __13:
}
Xsqlite3NestedParse(tls, pParse,
- ts+8665 /* "UPDATE sqlite_te..." */, crt.VaList(bp+152, zDb, zTabName, zName, zTabName, zDb, zName))
+ ts+11127 /* "UPDATE sqlite_te..." */, libc.VaList(bp+136, zDb, zTabName, zName, zTabName, zDb, zName))
__14:
;
@@ -81640,14 +84358,14 @@ __14:
if !(pVTab != 0) {
goto __15
}
- i = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ i = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeLoadString(tls, v, i, zName)
Xsqlite3VdbeAddOp4(tls, v, 167, i, 0, 0, pVTab, -12)
__15:
;
renameReloadSchema(tls, pParse, iDb)
- renameTestSchema(tls, pParse, zDb, (crt.Bool32(iDb == 1)))
+ renameTestSchema(tls, pParse, zDb, (libc.Bool32(iDb == 1)))
exit_rename_table:
Xsqlite3SrcListDelete(tls, db, pSrc)
@@ -81657,13 +84375,13 @@ exit_rename_table:
// Write code that will raise an error if the table described by
// zDb and zTab is not empty.
-func sqlite3ErrorIfNotEmpty(tls *crt.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { /* sqlite3.c:105847:13: */
+func sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { /* sqlite3.c:106064:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
Xsqlite3NestedParse(tls, pParse,
- ts+8919, /* "SELECT raise(ABO..." */
- crt.VaList(bp, zErr, zDb, zTab))
+ ts+11381, /* "SELECT raise(ABO..." */
+ libc.VaList(bp, zErr, zDb, zTab))
}
// This function is called after an "ALTER TABLE ... ADD" statement
@@ -81672,9 +84390,9 @@ func sqlite3ErrorIfNotEmpty(tls *crt.TLS, pParse uintptr, zDb uintptr, zTab uint
//
// The Table structure pParse->pNewTable was extended to include
// the new column during parsing.
-func Xsqlite3AlterFinishAddColumn(tls *crt.TLS, pParse uintptr, pColDef uintptr) { /* sqlite3.c:105867:21: */
- bp := tls.Alloc(56)
- defer tls.Free(56)
+func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr) { /* sqlite3.c:106084:21: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
var pNew uintptr // Copy of pParse->pNewTable
var pTab uintptr // Table being altered
@@ -81710,12 +84428,12 @@ func Xsqlite3AlterFinishAddColumn(tls *crt.TLS, pParse uintptr, pColDef uintptr)
// If there is a NOT NULL constraint, then the default value for the
// column must not be NULL.
if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0001) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+8957 /* "Cannot add a PRI..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+11419 /* "Cannot add a PRI..." */, 0)
return
}
if (*Table)(unsafe.Pointer(pNew)).FpIndex != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+8989 /* "Cannot add a UNI..." */, 0)
+ ts+11451 /* "Cannot add a UNI..." */, 0)
return
}
if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0060) == 0 {
@@ -81728,32 +84446,32 @@ func Xsqlite3AlterFinishAddColumn(tls *crt.TLS, pParse uintptr, pColDef uintptr)
}
if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00004000)) != 0) && ((*Table)(unsafe.Pointer(pNew)).FpFKey != 0)) && (pDflt != 0) {
sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab,
- ts+9016 /* "Cannot add a REF..." */)
+ ts+11478 /* "Cannot add a REF..." */)
}
if ((*Column)(unsafe.Pointer(pCol)).FnotNull != 0) && !(pDflt != 0) {
sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab,
- ts+9075 /* "Cannot add a NOT..." */)
+ ts+11537 /* "Cannot add a NOT..." */)
}
// Ensure the default expression is something that sqlite3ValueFromExpr()
// can handle (i.e. not CURRENT_TIME etc.)
if pDflt != 0 {
- *(*uintptr)(unsafe.Pointer(bp + 48 /* pVal */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */)) = uintptr(0)
var rc int32
- rc = Xsqlite3ValueFromExpr(tls, db, pDflt, uint8(1), uint8(0x41), bp+48 /* &pVal */)
+ rc = Xsqlite3ValueFromExpr(tls, db, pDflt, uint8(1), uint8(0x41), bp+40 /* &pVal */)
if rc != 0 {
return
}
- if !(*(*uintptr)(unsafe.Pointer(bp + 48 /* pVal */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */)) != 0) {
sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab,
- ts+9128 /* "Cannot add a col..." */)
+ ts+11590 /* "Cannot add a col..." */)
}
- Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* pVal */)))
+ Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pVal */)))
}
} else if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0040) != 0 {
- sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, ts+9174 /* "cannot add a STO..." */)
+ sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, ts+11636 /* "cannot add a STO..." */)
}
// Modify the CREATE TABLE statement.
@@ -81762,13 +84480,13 @@ func Xsqlite3AlterFinishAddColumn(tls *crt.TLS, pParse uintptr, pColDef uintptr)
var zEnd uintptr = (zCol + uintptr(((*Token)(unsafe.Pointer(pColDef)).Fn - uint32(1))))
var savedDbFlags U32 = (*Sqlite3)(unsafe.Pointer(db)).FmDbFlags
for (zEnd > zCol) && ((int32(*(*int8)(unsafe.Pointer(zEnd))) == ';') || ((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zEnd)))]) & 0x01) != 0)) {
- *(*int8)(unsafe.Pointer(crt.PostDecUintptr(&zEnd, 1))) = int8(0)
+ *(*int8)(unsafe.Pointer(libc.PostDecUintptr(&zEnd, 1))) = int8(0)
}
*(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(0x0002))
Xsqlite3NestedParse(tls, pParse,
- ts+9201, /* "UPDATE \"%w\".%s S..." */
- crt.VaList(bp, zDb, ts+5324 /* "sqlite_master" */, (*Table)(unsafe.Pointer(pNew)).FaddColOffset, zCol, ((*Table)(unsafe.Pointer(pNew)).FaddColOffset+1),
+ ts+11663, /* "UPDATE \"%w\".sqli..." */
+ libc.VaList(bp, zDb, (*Table)(unsafe.Pointer(pNew)).FaddColOffset, zCol, ((*Table)(unsafe.Pointer(pNew)).FaddColOffset+1),
zTab))
Xsqlite3DbFree(tls, db, zCol)
(*Sqlite3)(unsafe.Pointer(db)).FmDbFlags = savedDbFlags
@@ -81806,7 +84524,7 @@ func Xsqlite3AlterFinishAddColumn(tls *crt.TLS, pParse uintptr, pColDef uintptr)
//
// Routine sqlite3AlterFinishAddColumn() will be called to complete
// coding the "ALTER TABLE ... ADD" statement.
-func Xsqlite3AlterBeginAddColumn(tls *crt.TLS, pParse uintptr, pSrc uintptr) { /* sqlite3.c:106012:21: */
+func Xsqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { /* sqlite3.c:106229:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -81838,7 +84556,7 @@ __2:
if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
goto __3
}
- Xsqlite3ErrorMsg(tls, pParse, ts+9310 /* "virtual tables m..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+11783 /* "virtual tables m..." */, 0)
goto exit_begin_add_column
__3:
;
@@ -81847,7 +84565,7 @@ __3:
if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) {
goto __4
}
- Xsqlite3ErrorMsg(tls, pParse, ts+9344 /* "Cannot add a col..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+11817 /* "Cannot add a col..." */, 0)
goto exit_begin_add_column
__4:
;
@@ -81882,7 +84600,7 @@ __6:
nAlloc = ((((int32((*Table)(unsafe.Pointer(pNew)).FnCol) - 1) / 8) * 8) + 8)
(*Table)(unsafe.Pointer(pNew)).FaCol = Xsqlite3DbMallocZero(tls, db, (uint64(uint64(unsafe.Sizeof(Column{})) * uint64(nAlloc))))
- (*Table)(unsafe.Pointer(pNew)).FzName = Xsqlite3MPrintf(tls, db, ts+9374 /* "sqlite_altertab_..." */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ (*Table)(unsafe.Pointer(pNew)).FzName = Xsqlite3MPrintf(tls, db, ts+11847 /* "sqlite_altertab_..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
if !(!(int32((*Table)(unsafe.Pointer(pNew)).FaCol) != 0) || !(int32((*Table)(unsafe.Pointer(pNew)).FzName) != 0)) {
goto __7
}
@@ -81890,7 +84608,7 @@ __6:
goto exit_begin_add_column
__7:
;
- crt.Xmemcpy(tls, (*Table)(unsafe.Pointer(pNew)).FaCol, (*Table)(unsafe.Pointer(pTab)).FaCol, (uint64(unsafe.Sizeof(Column{})) * uint64((*Table)(unsafe.Pointer(pNew)).FnCol)))
+ libc.Xmemcpy(tls, (*Table)(unsafe.Pointer(pNew)).FaCol, (*Table)(unsafe.Pointer(pTab)).FaCol, (uint64(unsafe.Sizeof(Column{})) * uint64((*Table)(unsafe.Pointer(pNew)).FnCol)))
i = 0
__8:
if !(i < int32((*Table)(unsafe.Pointer(pNew)).FnCol)) {
@@ -81923,20 +84641,20 @@ exit_begin_add_column:
// it loads an error message into pParse and returns non-zero.
//
// Or, if pTab is not a view or virtual table, zero is returned.
-func isRealTable(tls *crt.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:106094:12: */
+func isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:106311:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
var zType uintptr = uintptr(0)
if (*Table)(unsafe.Pointer(pTab)).FpSelect != 0 {
- zType = ts + 9393 /* "view" */
+ zType = ts + 11866 /* "view" */
}
if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
- zType = ts + 9398 /* "virtual table" */
+ zType = ts + 11871 /* "virtual table" */
}
if zType != 0 {
Xsqlite3ErrorMsg(tls,
- pParse, ts+9412 /* "cannot rename co..." */, crt.VaList(bp, zType, (*Table)(unsafe.Pointer(pTab)).FzName))
+ pParse, ts+11885 /* "cannot rename co..." */, libc.VaList(bp, zType, (*Table)(unsafe.Pointer(pTab)).FzName))
return 1
}
return 0
@@ -81945,9 +84663,9 @@ func isRealTable(tls *crt.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.
// Handles the following parser reduction:
//
// cmd ::= ALTER TABLE pSrc RENAME COLUMN pOld TO pNew
-func Xsqlite3AlterRenameColumn(tls *crt.TLS, pParse uintptr, pSrc uintptr, pOld uintptr, pNew uintptr) { /* sqlite3.c:106123:21: */
- bp := tls.Alloc(128)
- defer tls.Free(128)
+func Xsqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld uintptr, pNew uintptr) { /* sqlite3.c:106340:21: */
+ bp := tls.Alloc(112)
+ defer tls.Free(112)
var db uintptr // Database connection
var pTab uintptr // Table being updated
@@ -81984,7 +84702,7 @@ __2:
__3:
;
- /* Which schema holds the table to be altered */
+ // Which schema holds the table to be altered
iSchema = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iSchema)*32)).FzDbSName
@@ -82027,14 +84745,14 @@ __8:
if !(iCol == int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
goto __10
}
- Xsqlite3ErrorMsg(tls, pParse, ts+5751 /* "no such column: ..." */, crt.VaList(bp, zOld))
+ Xsqlite3ErrorMsg(tls, pParse, ts+7949 /* "no such column: ..." */, libc.VaList(bp, zOld))
goto exit_rename_column
__10:
;
// Do the rename operation using a recursive UPDATE statement that
// uses the sqlite_rename_column() SQL function to compute the new
- // CREATE statement text for the sqlite_master table.
+ // CREATE statement text for the sqlite_schema table.
Xsqlite3MayAbort(tls, pParse)
zNew = Xsqlite3NameFromToken(tls, db, pNew)
if !(!(zNew != 0)) {
@@ -82047,20 +84765,19 @@ __11:
bQuote = (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(pNew)).Fz + uintptr(0))))]) & 0x80)
Xsqlite3NestedParse(tls, pParse,
- ts+9445, /* "UPDATE \"%w\".%s S..." */
- crt.VaList(bp+8, zDb, ts+5324, /* "sqlite_master" */
- zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, (crt.Bool32(iSchema == 1)),
+ ts+11918, /* "UPDATE \"%w\".sqli..." */
+ libc.VaList(bp+8, zDb,
+ zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, (libc.Bool32(iSchema == 1)),
(*Table)(unsafe.Pointer(pTab)).FzName))
Xsqlite3NestedParse(tls, pParse,
- ts+9652, /* "UPDATE temp.%s S..." */
- crt.VaList(bp+80, ts+5324, /* "sqlite_master" */
- zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote))
+ ts+12136, /* "UPDATE temp.sqli..." */
+ libc.VaList(bp+72, zDb, (*Table)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote))
// Drop and reload the database schema.
renameReloadSchema(tls, pParse, iSchema)
- renameTestSchema(tls, pParse, zDb, (crt.Bool32(iSchema == 1)))
+ renameTestSchema(tls, pParse, zDb, (libc.Bool32(iSchema == 1)))
exit_rename_column:
Xsqlite3SrcListDelete(tls, db, pSrc)
@@ -82071,7 +84788,7 @@ exit_rename_column:
// The context of an ALTER TABLE RENAME COLUMN operation that gets passed
// down into the Walker.
-type RenameCtx = RenameCtx1 /* sqlite3.c:106236:26 */
+type RenameCtx = RenameCtx1 /* sqlite3.c:106452:26 */
// Remember that the parser tree element pPtr was created using
// the token pToken.
@@ -82083,7 +84800,7 @@ type RenameCtx = RenameCtx1 /* sqlite3.c:106236:26 */
// The pPtr argument is returned so that this routine can be used
// with tail recursion in tokenExpr() routine, for a small performance
// improvement.
-func Xsqlite3RenameTokenMap(tls *crt.TLS, pParse uintptr, pPtr uintptr, pToken uintptr) uintptr { /* sqlite3.c:106297:21: */
+func Xsqlite3RenameTokenMap(tls *libc.TLS, pParse uintptr, pPtr uintptr, pToken uintptr) uintptr { /* sqlite3.c:106513:21: */
var pNew uintptr
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) != 3 {
@@ -82102,7 +84819,7 @@ func Xsqlite3RenameTokenMap(tls *crt.TLS, pParse uintptr, pPtr uintptr, pToken u
// It is assumed that there is already a RenameToken object associated
// with parse tree element pFrom. This function remaps the associated token
// to parse tree element pTo.
-func Xsqlite3RenameTokenRemap(tls *crt.TLS, pParse uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:106319:21: */
+func Xsqlite3RenameTokenRemap(tls *libc.TLS, pParse uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:106535:21: */
var p uintptr
for p = (*Parse)(unsafe.Pointer(pParse)).FpRename; p != 0; p = (*RenameToken)(unsafe.Pointer(p)).FpNext {
@@ -82114,7 +84831,7 @@ func Xsqlite3RenameTokenRemap(tls *crt.TLS, pParse uintptr, pTo uintptr, pFrom u
}
// Walker callback used by sqlite3RenameExprUnmap().
-func renameUnmapExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106333:12: */
+func renameUnmapExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106549:12: */
var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
Xsqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr)
return 0
@@ -82122,7 +84839,7 @@ func renameUnmapExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
// Iterate through the Select objects that are part of WITH clauses attached
// to select statement pSelect.
-func renameWalkWith(tls *crt.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:106343:13: */
+func renameWalkWith(tls *libc.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3.c:106559:13: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -82133,7 +84850,7 @@ func renameWalkWith(tls *crt.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3
var p uintptr = (*Cte)(unsafe.Pointer((pWith + 16 /* &.a */) + uintptr(i)*32)).FpSelect
// var sNC NameContext at bp, 56
- crt.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = (*Walker)(unsafe.Pointer(pWalker)).FpParse
Xsqlite3SelectPrep(tls, (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse, p, bp /* &sNC */)
Xsqlite3WalkSelect(tls, pWalker, p)
@@ -82143,7 +84860,7 @@ func renameWalkWith(tls *crt.TLS, pWalker uintptr, pSelect uintptr) { /* sqlite3
}
// Unmap all tokens in the IdList object passed as the second argument.
-func unmapColumnIdlistNames(tls *crt.TLS, pParse uintptr, pIdList uintptr) { /* sqlite3.c:106362:13: */
+func unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) { /* sqlite3.c:106578:13: */
if pIdList != 0 {
var ii int32
for ii = 0; ii < (*IdList)(unsafe.Pointer(pIdList)).FnId; ii++ {
@@ -82153,7 +84870,7 @@ func unmapColumnIdlistNames(tls *crt.TLS, pParse uintptr, pIdList uintptr) { /*
}
// Walker callback used by sqlite3RenameExprUnmap().
-func renameUnmapSelectCb(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:106377:12: */
+func renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:106593:12: */
var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
var i int32
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
@@ -82186,20 +84903,20 @@ func renameUnmapSelectCb(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sq
}
// Remove all nodes that are part of expression pExpr from the rename list.
-func Xsqlite3RenameExprUnmap(tls *crt.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:106406:21: */
+func Xsqlite3RenameExprUnmap(tls *libc.TLS, pParse uintptr, pExpr uintptr) { /* sqlite3.c:106622:21: */
bp := tls.Alloc(48)
defer tls.Free(48)
var eMode U8 = (*Parse)(unsafe.Pointer(pParse)).FeParseMode
// var sWalker Walker at bp, 48
- crt.Xmemset(tls, bp /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FpParse = pParse
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{renameUnmapExprCb}))
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{renameUnmapSelectCb}))
(*Parse)(unsafe.Pointer(pParse)).FeParseMode = U8(3)
Xsqlite3WalkExpr(tls, bp /* &sWalker */, pExpr)
@@ -82208,7 +84925,7 @@ func Xsqlite3RenameExprUnmap(tls *crt.TLS, pParse uintptr, pExpr uintptr) { /* s
// Remove all nodes that are part of expression-list pEList from the
// rename list.
-func Xsqlite3RenameExprlistUnmap(tls *crt.TLS, pParse uintptr, pEList uintptr) { /* sqlite3.c:106422:21: */
+func Xsqlite3RenameExprlistUnmap(tls *libc.TLS, pParse uintptr, pEList uintptr) { /* sqlite3.c:106638:21: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -82216,10 +84933,10 @@ func Xsqlite3RenameExprlistUnmap(tls *crt.TLS, pParse uintptr, pEList uintptr) {
var i int32
// var sWalker Walker at bp, 48
- crt.Xmemset(tls, bp /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FpParse = pParse
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{renameUnmapExprCb}))
Xsqlite3WalkExprList(tls, bp /* &sWalker */, pEList)
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
@@ -82231,7 +84948,7 @@ func Xsqlite3RenameExprlistUnmap(tls *crt.TLS, pParse uintptr, pEList uintptr) {
}
// Free the list of RenameToken objects given in the second argument
-func renameTokenFree(tls *crt.TLS, db uintptr, pToken uintptr) { /* sqlite3.c:106441:13: */
+func renameTokenFree(tls *libc.TLS, db uintptr, pToken uintptr) { /* sqlite3.c:106657:13: */
var pNext uintptr
var p uintptr
for p = pToken; p != 0; p = pNext {
@@ -82244,7 +84961,7 @@ func renameTokenFree(tls *crt.TLS, db uintptr, pToken uintptr) { /* sqlite3.c:10
// object associated with parse tree element pPtr. If found, remove it
// from the Parse object and add it to the list maintained by the
// RenameCtx object passed as the second argument.
-func renameTokenFind(tls *crt.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) { /* sqlite3.c:106456:13: */
+func renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) { /* sqlite3.c:106672:13: */
var pp uintptr
for pp = (pParse + 416 /* &.pRename */); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 24 /* &.pNext */) {
@@ -82262,7 +84979,7 @@ func renameTokenFind(tls *crt.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) {
// This is a Walker select callback. It does nothing. It is only required
// because without a dummy callback, sqlite3WalkExpr() and similar do not
// descend into sub-select statements.
-func renameColumnSelectCb(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:106476:12: */
+func renameColumnSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:106692:12: */
if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0200000)) != 0 {
return 1
}
@@ -82277,7 +84994,7 @@ func renameColumnSelectCb(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* s
// ALTER TABLE statement. If it is, then attach its associated
// RenameToken object to the list of RenameToken objects being
// constructed in RenameCtx object at pWalker->u.pRename.
-func renameColumnExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106491:12: */
+func renameColumnExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:106707:12: */
var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */))
if ((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 77) &&
(int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*RenameCtx)(unsafe.Pointer(p)).FiCol)) &&
@@ -82298,7 +85015,7 @@ func renameColumnExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
// the input SQL is parsed from left to right. Repeated calls to this routine
// return all column name tokens in the order that they are encountered
// in the SQL statement.
-func renameColumnTokenNext(tls *crt.TLS, pCtx uintptr) uintptr { /* sqlite3.c:106516:20: */
+func renameColumnTokenNext(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:106732:20: */
var pBest uintptr = (*RenameCtx)(unsafe.Pointer(pCtx)).FpList
var pToken uintptr
var pp uintptr
@@ -82320,7 +85037,7 @@ func renameColumnTokenNext(tls *crt.TLS, pCtx uintptr) uintptr { /* sqlite3.c:10
// ALTER TABLE RENAME COLUMN program. The error message emitted by the
// sub-routine is currently stored in pParse->zErrMsg. This function
// adds context to the error message and then stores it in pCtx.
-func renameColumnParseError(tls *crt.TLS, pCtx uintptr, bPost int32, pType uintptr, pObject uintptr, pParse uintptr) { /* sqlite3.c:106537:13: */
+func renameColumnParseError(tls *libc.TLS, pCtx uintptr, bPost int32, pType uintptr, pObject uintptr, pParse uintptr) { /* sqlite3.c:106753:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -82328,12 +85045,12 @@ func renameColumnParseError(tls *crt.TLS, pCtx uintptr, bPost int32, pType uintp
var zN uintptr = Xsqlite3_value_text(tls, pObject)
var zErr uintptr
- zErr = Xsqlite3_mprintf(tls, ts+9772, /* "error in %s %s%s..." */
- crt.VaList(bp, zT, zN, func() uintptr {
+ zErr = Xsqlite3_mprintf(tls, ts+12267, /* "error in %s %s%s..." */
+ libc.VaList(bp, zT, zN, func() uintptr {
if bPost != 0 {
- return ts + 9793 /* " after rename" */
+ return ts + 12288 /* " after rename" */
}
- return ts + 672 /* "" */
+ return ts + 781 /* "" */
}(),
(*Parse)(unsafe.Pointer(pParse)).FzErrMsg))
Xsqlite3_result_error(tls, pCtx, zErr, -1)
@@ -82344,7 +85061,7 @@ func renameColumnParseError(tls *crt.TLS, pCtx uintptr, bPost int32, pType uintp
// pEList->a[i].zName) that matches the string in zOld, extract the
// corresponding rename-token from Parse object pParse and add it
// to the RenameCtx pCtx.
-func renameColumnElistNames(tls *crt.TLS, pParse uintptr, pCtx uintptr, pEList uintptr, zOld uintptr) { /* sqlite3.c:106562:13: */
+func renameColumnElistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pEList uintptr, zOld uintptr) { /* sqlite3.c:106778:13: */
if pEList != 0 {
var i int32
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
@@ -82361,7 +85078,7 @@ func renameColumnElistNames(tls *crt.TLS, pParse uintptr, pCtx uintptr, pEList u
// For each name in the the id-list pIdList (i.e. each pIdList->a[i].zName)
// that matches the string in zOld, extract the corresponding rename-token
// from Parse object pParse and add it to the RenameCtx pCtx.
-func renameColumnIdlistNames(tls *crt.TLS, pParse uintptr, pCtx uintptr, pIdList uintptr, zOld uintptr) { /* sqlite3.c:106587:13: */
+func renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdList uintptr, zOld uintptr) { /* sqlite3.c:106803:13: */
if pIdList != 0 {
var i int32
for i = 0; i < (*IdList)(unsafe.Pointer(pIdList)).FnId; i++ {
@@ -82375,7 +85092,7 @@ func renameColumnIdlistNames(tls *crt.TLS, pParse uintptr, pCtx uintptr, pIdList
// Parse the SQL statement zSql using Parse object (*p). The Parse object
// is initialized by this function before it is used.
-func renameParseSql(tls *crt.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) int32 { /* sqlite3.c:106609:12: */
+func renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) int32 { /* sqlite3.c:106825:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -82392,7 +85109,7 @@ func renameParseSql(tls *crt.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintp
// Parse the SQL statement passed as the first argument. If no error
// occurs and the parse does not result in a new table, index or
// trigger object, the database must be corrupt.
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Parse{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Parse{})))
(*Parse)(unsafe.Pointer(p)).FeParseMode = U8(2)
(*Parse)(unsafe.Pointer(p)).Fdb = db
(*Parse)(unsafe.Pointer(p)).FnQueryLoop = U32(1)
@@ -82404,7 +85121,7 @@ func renameParseSql(tls *crt.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintp
}
if (((rc == 0) &&
((*Parse)(unsafe.Pointer(p)).FpNewTable == uintptr(0))) && ((*Parse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0))) && ((*Parse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) {
- rc = Xsqlite3CorruptError(tls, 106636)
+ rc = Xsqlite3CorruptError(tls, 106852)
}
(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(0)
@@ -82418,7 +85135,7 @@ func renameParseSql(tls *crt.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintp
//
// Or, if an error occurs (i.e. an OOM condition), an error is left in
// pCtx and an SQLite error code returned.
-func renameEditSql(tls *crt.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zNew uintptr, bQuote int32) int32 { /* sqlite3.c:106664:12: */
+func renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zNew uintptr, bQuote int32) int32 { /* sqlite3.c:106880:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -82435,7 +85152,7 @@ func renameEditSql(tls *crt.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zN
// ALTER TABLE statement was quoted (bQuote==1), then set zNew to
// point to zQuot so that all substitutions are made using the
// quoted version of the new column name.
- zQuot = Xsqlite3MPrintf(tls, db, ts+9807 /* "\"%w\"" */, crt.VaList(bp, zNew))
+ zQuot = Xsqlite3MPrintf(tls, db, ts+12302 /* "\"%w\"" */, libc.VaList(bp, zNew))
if zQuot == uintptr(0) {
return 7
} else {
@@ -82454,7 +85171,7 @@ func renameEditSql(tls *crt.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zN
zOut = Xsqlite3DbMallocZero(tls, db, (uint64((nSql + ((*RenameCtx)(unsafe.Pointer(pRename)).FnList * nQuot)) + 1)))
if zOut != 0 {
var nOut int32 = nSql
- crt.Xmemcpy(tls, zOut, zSql, uint64(nSql))
+ libc.Xmemcpy(tls, zOut, zSql, uint64(nSql))
for (*RenameCtx)(unsafe.Pointer(pRename)).FpList != 0 {
var iOff int32 // Offset of token to replace in zOut
var pBest uintptr = renameColumnTokenNext(tls, pRename)
@@ -82470,16 +85187,16 @@ func renameEditSql(tls *crt.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zN
iOff = (int32((int64((*RenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) / 1))
if (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace {
- crt.Xmemmove(tls, (zOut + uintptr((U32(iOff) + nReplace))), (zOut + uintptr((uint32(iOff) + (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn))),
+ libc.Xmemmove(tls, (zOut + uintptr((U32(iOff) + nReplace))), (zOut + uintptr((uint32(iOff) + (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn))),
(uint64(uint32(nOut) - (uint32(iOff) + (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn))))
nOut = int32(U32(nOut) + (nReplace - (*RenameToken)(unsafe.Pointer(pBest)).Ft.Fn))
*(*int8)(unsafe.Pointer(zOut + uintptr(nOut))) = int8(0)
}
- crt.Xmemcpy(tls, (zOut + uintptr(iOff)), zReplace, uint64(nReplace))
+ libc.Xmemcpy(tls, (zOut + uintptr(iOff)), zReplace, uint64(nReplace))
Xsqlite3DbFree(tls, db, pBest)
}
- Xsqlite3_result_text(tls, pCtx, zOut, -1, crt.UintptrFromInt32(-1))
+ Xsqlite3_result_text(tls, pCtx, zOut, -1, libc.UintptrFromInt32(-1))
Xsqlite3DbFree(tls, db, zOut)
} else {
rc = 7
@@ -82493,9 +85210,9 @@ func renameEditSql(tls *crt.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, zN
// it was read from the schema of database zDb. Return SQLITE_OK if
// successful. Otherwise, return an SQLite error code and leave an error
// message in the Parse object.
-func renameResolveTrigger(tls *crt.TLS, pParse uintptr, zDb uintptr) int32 { /* sqlite3.c:106746:12: */
- bp := tls.Alloc(176)
- defer tls.Free(176)
+func renameResolveTrigger(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:106962:12: */
+ bp := tls.Alloc(56)
+ defer tls.Free(56)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pNew uintptr = (*Parse)(unsafe.Pointer(pParse)).FpNewTrigger
@@ -82504,7 +85221,7 @@ func renameResolveTrigger(tls *crt.TLS, pParse uintptr, zDb uintptr) int32 { /*
var rc int32 = 0
- crt.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = pParse
(*Parse)(unsafe.Pointer(pParse)).FpTriggerTab = Xsqlite3FindTable(tls, db, (*Trigger)(unsafe.Pointer(pNew)).Ftable,
@@ -82529,18 +85246,22 @@ func renameResolveTrigger(tls *crt.TLS, pParse uintptr, zDb uintptr) int32 { /*
}
}
if (rc == 0) && ((*TriggerStep)(unsafe.Pointer(pStep)).FzTarget != 0) {
- var pTarget uintptr = Xsqlite3LocateTable(tls, pParse, uint32(0), (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget, zDb)
- if pTarget == uintptr(0) {
- rc = 1
- } else if 0 == (crt.AssignInt32(&rc, Xsqlite3ViewGetColumnNames(tls, pParse, pTarget))) {
- // var sSrc SrcList at bp+56, 120
-
- crt.Xmemset(tls, bp+56 /* &sSrc */, 0, uint64(unsafe.Sizeof(SrcList{})))
- (*SrcList)(unsafe.Pointer(bp + 56 /* &sSrc */)).FnSrc = 1
- (*SrcList_item)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */) + uintptr(0)*112)).FzName = (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget
- (*SrcList_item)(unsafe.Pointer((bp + 56 /* &sSrc */ + 8 /* &.a */) + uintptr(0)*112)).FpTab = pTarget
- (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = bp + 56 /* &sSrc */
- if (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere != 0 {
+ var pSrc uintptr = Xsqlite3TriggerStepSrc(tls, pParse, pStep)
+ if pSrc != 0 {
+ var i int32
+ for i = 0; (i < (*SrcList)(unsafe.Pointer(pSrc)).FnSrc) && (rc == 0); i++ {
+ var p uintptr = ((pSrc + 8 /* &.a */) + uintptr(i)*112)
+ (*SrcList_item)(unsafe.Pointer(p)).FpTab = Xsqlite3LocateTableItem(tls, pParse, uint32(0), p)
+ (*SrcList_item)(unsafe.Pointer(p)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ if (*SrcList_item)(unsafe.Pointer(p)).FpTab == uintptr(0) {
+ rc = 1
+ } else {
+ (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(p)).FpTab)).FnTabRef++
+ rc = Xsqlite3ViewGetColumnNames(tls, pParse, (*SrcList_item)(unsafe.Pointer(p)).FpTab)
+ }
+ }
+ (*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = pSrc
+ if (rc == 0) && ((*TriggerStep)(unsafe.Pointer(pStep)).FpWhere != 0) {
rc = Xsqlite3ResolveExprNames(tls, bp /* &sNC */, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere)
}
if rc == 0 {
@@ -82550,7 +85271,7 @@ func renameResolveTrigger(tls *crt.TLS, pParse uintptr, zDb uintptr) int32 { /*
if (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0 {
var pUpsert uintptr = (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert
- (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc = bp + 56 /* &sSrc */
+ (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc = pSrc
*(*uintptr)(unsafe.Pointer(bp /* &sNC */ + 16 /* &.uNC */)) = pUpsert
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags = 0x00200
rc = Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget)
@@ -82567,6 +85288,9 @@ func renameResolveTrigger(tls *crt.TLS, pParse uintptr, zDb uintptr) int32 { /*
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FncFlags = 0
}
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = uintptr(0)
+ Xsqlite3SrcListDelete(tls, db, pSrc)
+ } else {
+ rc = 7
}
}
}
@@ -82575,7 +85299,7 @@ func renameResolveTrigger(tls *crt.TLS, pParse uintptr, zDb uintptr) int32 { /*
// Invoke sqlite3WalkExpr() or sqlite3WalkSelect() on all Select or Expr
// objects that are part of the trigger passed as the second argument.
-func renameWalkTrigger(tls *crt.TLS, pWalker uintptr, pTrigger uintptr) { /* sqlite3.c:106824:13: */
+func renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { /* sqlite3.c:107048:13: */
var pStep uintptr
// Find tokens to edit in WHEN clause
@@ -82598,14 +85322,14 @@ func renameWalkTrigger(tls *crt.TLS, pWalker uintptr, pTrigger uintptr) { /* sql
// Free the contents of Parse object (*pParse). Do not free the memory
// occupied by the Parse object itself.
-func renameParseCleanup(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:106849:13: */
+func renameParseCleanup(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:107073:13: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pIdx uintptr
if (*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0 {
Xsqlite3VdbeFinalize(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe)
}
Xsqlite3DeleteTable(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)
- for (crt.AssignUintptr(&pIdx, (*Parse)(unsafe.Pointer(pParse)).FpNewIndex)) != uintptr(0) {
+ for (libc.AssignUintptr(&pIdx, (*Parse)(unsafe.Pointer(pParse)).FpNewIndex)) != uintptr(0) {
(*Parse)(unsafe.Pointer(pParse)).FpNewIndex = (*Index)(unsafe.Pointer(pIdx)).FpNext
Xsqlite3FreeIndex(tls, db, pIdx)
}
@@ -82636,7 +85360,7 @@ func renameParseCleanup(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:106849:13:
// This function is used internally by the ALTER TABLE RENAME COLUMN command.
// It is only accessible to SQL created using sqlite3NestedParse(). It is
// not reachable from ordinary SQL passed into sqlite3_prepare().
-func renameColumnFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:106889:13: */
+func renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:107113:13: */
bp := tls.Alloc(504)
defer tls.Free(504)
@@ -82713,7 +85437,7 @@ __4:
__5:
;
zOld = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).FzName
- crt.Xmemset(tls, bp /* &sCtx */, 0, uint64(unsafe.Sizeof(RenameCtx{})))
+ libc.Xmemset(tls, bp /* &sCtx */, 0, uint64(unsafe.Sizeof(RenameCtx{})))
(*RenameCtx)(unsafe.Pointer(bp /* &sCtx */)).FiCol = func() int32 {
if iCol == int32((*Table)(unsafe.Pointer(pTab)).FiPKey) {
return -1
@@ -82725,13 +85449,13 @@ __5:
rc = renameParseSql(tls, bp+32 /* &sParse */, zDb, db, zSql, bTemp)
// Find tokens that need to be replaced.
- crt.Xmemset(tls, bp+456 /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp+456 /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp + 456 /* &sWalker */)).FpParse = bp + 32 /* &sParse */
(*Walker)(unsafe.Pointer(bp + 456 /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{renameColumnExprCb}))
(*Walker)(unsafe.Pointer(bp + 456 /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{renameColumnSelectCb}))
*(*uintptr)(unsafe.Pointer(bp + 456 /* &sWalker */ + 40 /* &.u */)) = bp /* &sCtx */
@@ -82749,7 +85473,7 @@ __6:
if !(pSelect != 0) {
goto __9
}
- *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) &= (^U32(crt.Int32FromInt32(0x0200000)))
+ *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) &= (^U32(libc.Int32FromInt32(0x0200000)))
(*Parse)(unsafe.Pointer(bp + 32 /* &sParse */)).Frc = 0
Xsqlite3SelectPrep(tls, bp+32 /* &sParse */, pSelect, uintptr(0))
rc = func() int32 {
@@ -82878,12 +85602,7 @@ __7:
Xsqlite3WalkExpr(tls, bp+456 /* &sWalker */, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp+32 /* &sParse */)).FpNewIndex)).FpPartIdxWhere)
goto __33
__32:
- rc = renameResolveTrigger(tls, bp+32 /* &sParse */, func() uintptr {
- if bTemp != 0 {
- return uintptr(0)
- }
- return zDb
- }())
+ rc = renameResolveTrigger(tls, bp+32 /* &sParse */)
if !(rc != 0) {
goto __34
}
@@ -82964,7 +85683,7 @@ __42:
}
// Walker expression callback used by "RENAME TABLE".
-func renameTableExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107050:12: */
+func renameTableExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:107274:12: */
var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */))
if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 164) && ((*RenameCtx)(unsafe.Pointer(p)).FpTab == *(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */))) {
renameTokenFind(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, p, (pExpr + 64 /* &.y */ /* &.pTab */))
@@ -82973,7 +85692,7 @@ func renameTableExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /*
}
// Walker select callback used by "RENAME TABLE".
-func renameTableSelectCb(tls *crt.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:107061:12: */
+func renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:107285:12: */
var i int32
var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */))
var pSrc uintptr = (*Select)(unsafe.Pointer(pSelect)).FpSrc
@@ -83012,7 +85731,7 @@ func renameTableSelectCb(tls *crt.TLS, pWalker uintptr, pSelect uintptr) int32 {
//
// sqlite_rename_table('main', 'CREATE TABLE t1(a REFERENCES t2)','t2','t3',0)
// -> 'CREATE TABLE t1(a REFERENCES t3)'
-func renameTableFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:107101:13: */
+func renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:107325:13: */
bp := tls.Alloc(560)
defer tls.Free(560)
@@ -83038,15 +85757,15 @@ func renameTableFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr)
Xsqlite3BtreeEnterAll(tls, db)
- crt.Xmemset(tls, bp /* &sCtx */, 0, uint64(unsafe.Sizeof(RenameCtx{})))
+ libc.Xmemset(tls, bp /* &sCtx */, 0, uint64(unsafe.Sizeof(RenameCtx{})))
(*RenameCtx)(unsafe.Pointer(bp /* &sCtx */)).FpTab = Xsqlite3FindTable(tls, db, zOld, zDb)
- crt.Xmemset(tls, bp+32 /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp+32 /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp + 32 /* &sWalker */)).FpParse = bp + 80 /* &sParse */
(*Walker)(unsafe.Pointer(bp + 32 /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{renameTableExprCb}))
(*Walker)(unsafe.Pointer(bp + 32 /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{renameTableSelectCb}))
*(*uintptr)(unsafe.Pointer(bp + 32 /* &sWalker */ + 40 /* &.u */)) = bp /* &sCtx */
@@ -83062,10 +85781,10 @@ func renameTableFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr)
var pSelect uintptr = (*Table)(unsafe.Pointer(pTab)).FpSelect
// var sNC NameContext at bp+504, 56
- crt.Xmemset(tls, bp+504 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp+504 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp + 504 /* &sNC */)).FpParse = bp + 80 /* &sParse */
- *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) &= (^U32(crt.Int32FromInt32(0x0200000)))
+ *(*U32)(unsafe.Pointer(pSelect + 4 /* &.selFlags */)) &= (^U32(libc.Int32FromInt32(0x0200000)))
Xsqlite3SelectPrep(tls, bp+80 /* &sParse */, (*Table)(unsafe.Pointer(pTab)).FpSelect, bp+504 /* &sNC */)
if (*Parse)(unsafe.Pointer(bp+80 /* &sParse */)).FnErr != 0 {
rc = (*Parse)(unsafe.Pointer(bp + 80 /* &sParse */)).Frc
@@ -83109,12 +85828,7 @@ func renameTableFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr)
}
if isLegacy == 0 {
- rc = renameResolveTrigger(tls, bp+80 /* &sParse */, func() uintptr {
- if bTemp != 0 {
- return uintptr(0)
- }
- return zDb
- }())
+ rc = renameResolveTrigger(tls, bp+80 /* &sParse */)
if rc == 0 {
renameWalkTrigger(tls, bp+32 /* &sWalker */, pTrigger)
for pStep = (*Trigger)(unsafe.Pointer(pTrigger)).Fstep_list; pStep != 0; pStep = (*TriggerStep)(unsafe.Pointer(pStep)).FpNext {
@@ -83164,7 +85878,7 @@ func renameTableFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr)
//
// * the SQL argument creates a trigger, and
// * the table that the trigger is attached to is in database zDb.
-func renameTableTest(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:107258:13: */
+func renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:107482:13: */
bp := tls.Alloc(480)
defer tls.Free(480)
@@ -83187,7 +85901,7 @@ func renameTableTest(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr)
if ((isLegacy == 0) && ((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable != 0)) && ((*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpSelect != 0) {
// var sNC NameContext at bp+424, 56
- crt.Xmemset(tls, bp+424 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp+424 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp + 424 /* &sNC */)).FpParse = bp /* &sParse */
Xsqlite3SelectPrep(tls, bp /* &sParse */, (*Table)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTable)).FpSelect, bp+424 /* &sNC */)
if (*Parse)(unsafe.Pointer(bp /* &sParse */)).FnErr != 0 {
@@ -83195,12 +85909,7 @@ func renameTableTest(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr)
}
} else if (*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTrigger != 0 {
if isLegacy == 0 {
- rc = renameResolveTrigger(tls, bp /* &sParse */, func() uintptr {
- if bTemp != 0 {
- return uintptr(0)
- }
- return zDb
- }())
+ rc = renameResolveTrigger(tls, bp /* &sParse */)
}
if rc == 0 {
var i1 int32 = Xsqlite3SchemaToIndex(tls, db, (*Trigger)(unsafe.Pointer((*Parse)(unsafe.Pointer(bp /* &sParse */)).FpNewTrigger)).FpTabSchema)
@@ -83222,15 +85931,15 @@ func renameTableTest(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr)
}
// Register built-in functions used to help implement ALTER TABLE
-func Xsqlite3AlterFunctions(tls *crt.TLS) { /* sqlite3.c:107314:21: */
+func Xsqlite3AlterFunctions(tls *libc.TLS) { /* sqlite3.c:107538:21: */
Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aAlterTableFuncs)), (int32(uint64(unsafe.Sizeof(aAlterTableFuncs)) / uint64(unsafe.Sizeof(FuncDef{})))))
}
var aAlterTableFuncs = [3]FuncDef{
- {FnArg: int8(9), FfuncFlags: (U32((0x00040000 | 1) | 0x0800)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 9812 /* "sqlite_rename_co..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(7), FfuncFlags: (U32((0x00040000 | 1) | 0x0800)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 9833 /* "sqlite_rename_ta..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(5), FfuncFlags: (U32((0x00040000 | 1) | 0x0800)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 9853 /* "sqlite_rename_te..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
-} /* sqlite3.c:107315:18 */
+ {FnArg: int8(9), FfuncFlags: (U32((0x00040000 | 1) | 0x0800)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 12307 /* "sqlite_rename_co..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(7), FfuncFlags: (U32((0x00040000 | 1) | 0x0800)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 12328 /* "sqlite_rename_ta..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(5), FfuncFlags: (U32((0x00040000 | 1) | 0x0800)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 12348 /* "sqlite_rename_te..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+} /* sqlite3.c:107539:18 */
//************* End of alter.c **********************************************
//************* Begin file analyze.c ****************************************
@@ -83386,19 +86095,24 @@ var aAlterTableFuncs = [3]FuncDef{
// or it may be a NULL pointer. If it is not NULL, then all entries in
// the sqlite_statN tables associated with the named table are deleted.
// If zWhere==0, then code is generated to delete all stat table entries.
-func openStatTable(tls *crt.TLS, pParse uintptr, iDb int32, iStatCur int32, zWhere uintptr, zWhereType uintptr) { /* sqlite3.c:107491:13: */
- bp := tls.Alloc(72)
- defer tls.Free(72)
+func openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zWhere uintptr, zWhereType uintptr) { /* sqlite3.c:107715:13: */
+ bp := tls.Alloc(88)
+ defer tls.Free(88)
var i int32
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pDb uintptr
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
- // var aRoot [3]int32 at bp+60, 12
+ // var aRoot [3]U32 at bp+76, 12
- // var aCreateTbl [3]U8 at bp+56, 3
+ // var aCreateTbl [3]U8 at bp+72, 3
- var nToOpen int32 = 1
+ var nToOpen int32
+ if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x0800)) == 0 {
+ nToOpen = 2
+ } else {
+ nToOpen = 1
+ }
if v == uintptr(0) {
return
@@ -83414,31 +86128,33 @@ func openStatTable(tls *crt.TLS, pParse uintptr, iDb int32, iStatCur int32, zWhe
}{})))); i++ {
var zTab uintptr = aTable[i].FzName
var pStat uintptr
- *(*U8)(unsafe.Pointer(bp + 56 /* &aCreateTbl[0] */ + uintptr(i))) = U8(0)
- if (crt.AssignUintptr(&pStat, Xsqlite3FindTable(tls, db, zTab, (*Db)(unsafe.Pointer(pDb)).FzDbSName))) == uintptr(0) {
+ *(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i))) = U8(0)
+ if (libc.AssignUintptr(&pStat, Xsqlite3FindTable(tls, db, zTab, (*Db)(unsafe.Pointer(pDb)).FzDbSName))) == uintptr(0) {
if i < nToOpen {
// The sqlite_statN table does not exist. Create it. Note that a
// side-effect of the CREATE TABLE statement is to leave the rootpage
// of the new table in register pParse->regRoot. This is important
// because the OpenWrite opcode below will be needing it.
Xsqlite3NestedParse(tls, pParse,
- ts+9872 /* "CREATE TABLE %Q...." */, crt.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, aTable[i].FzCols))
- *(*int32)(unsafe.Pointer(bp + 60 /* &aRoot[0] */ + uintptr(i)*4)) = (*Parse)(unsafe.Pointer(pParse)).FregRoot
- *(*U8)(unsafe.Pointer(bp + 56 /* &aCreateTbl[0] */ + uintptr(i))) = U8(0x10)
+ ts+12367 /* "CREATE TABLE %Q...." */, libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, aTable[i].FzCols))
+ *(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4)) = U32((*Parse)(unsafe.Pointer(pParse)).FregRoot)
+ *(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i))) = U8(0x10)
}
} else {
// The table already exists. If zWhere is not NULL, delete all entries
// associated with the table zWhere. If zWhere is NULL, delete the
// entire contents of the table.
- *(*int32)(unsafe.Pointer(bp + 60 /* &aRoot[0] */ + uintptr(i)*4)) = (*Table)(unsafe.Pointer(pStat)).Ftnum
- Xsqlite3TableLock(tls, pParse, iDb, *(*int32)(unsafe.Pointer(bp + 60 /* &aRoot[0] */ + uintptr(i)*4)), uint8(1), zTab)
+ *(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4)) = (*Table)(unsafe.Pointer(pStat)).Ftnum
+ Xsqlite3TableLock(tls, pParse, iDb, *(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4)), uint8(1), zTab)
if zWhere != 0 {
Xsqlite3NestedParse(tls, pParse,
- ts+9895, /* "DELETE FROM %Q.%..." */
- crt.VaList(bp+24, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere))
+ ts+12390, /* "DELETE FROM %Q.%..." */
+ libc.VaList(bp+24, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere))
+ } else if (*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 {
+ Xsqlite3NestedParse(tls, pParse, ts+12420 /* "DELETE FROM %Q.%..." */, libc.VaList(bp+56, (*Db)(unsafe.Pointer(pDb)).FzDbSName, zTab))
} else {
// The sqlite_stat[134] table already exists. Delete all rows.
- Xsqlite3VdbeAddOp2(tls, v, 137, *(*int32)(unsafe.Pointer(bp + 60 /* &aRoot[0] */ + uintptr(i)*4)), iDb)
+ Xsqlite3VdbeAddOp2(tls, v, 137, int32(*(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4))), iDb)
}
}
}
@@ -83446,8 +86162,9 @@ func openStatTable(tls *crt.TLS, pParse uintptr, iDb int32, iStatCur int32, zWhe
// Open the sqlite_stat[134] tables for writing.
for i = 0; i < nToOpen; i++ {
- Xsqlite3VdbeAddOp4Int(tls, v, 97, (iStatCur + i), *(*int32)(unsafe.Pointer(bp + 60 /* &aRoot[0] */ + uintptr(i)*4)), iDb, 3)
- Xsqlite3VdbeChangeP5(tls, v, uint16(*(*U8)(unsafe.Pointer(bp + 56 /* &aCreateTbl[0] */ + uintptr(i)))))
+ Xsqlite3VdbeAddOp4Int(tls, v, 97, (iStatCur + i), int32(*(*U32)(unsafe.Pointer(bp + 76 /* &aRoot[0] */ + uintptr(i)*4))), iDb, 3)
+ Xsqlite3VdbeChangeP5(tls, v, uint16(*(*U8)(unsafe.Pointer(bp + 72 /* &aCreateTbl[0] */ + uintptr(i)))))
+ Xsqlite3VdbeComment(tls, v, aTable[i].FzName, 0)
}
}
@@ -83455,10 +86172,10 @@ var aTable = [3]struct {
FzName uintptr
FzCols uintptr
}{
- {FzName: ts + 9925 /* "sqlite_stat1" */, FzCols: ts + 9938 /* "tbl,idx,stat" */},
- {FzName: ts + 9951 /* "sqlite_stat4" */, FzCols: uintptr(0)},
- {FzName: ts + 9964 /* "sqlite_stat3" */, FzCols: uintptr(0)},
-} /* sqlite3.c:107501:5 */
+ {FzName: ts + 12438 /* "sqlite_stat1" */, FzCols: ts + 12451 /* "tbl,idx,stat" */},
+ {FzName: ts + 12464 /* "sqlite_stat4" */, FzCols: ts + 12477 /* "tbl,idx,neq,nlt,..." */},
+ {FzName: ts + 12505 /* "sqlite_stat3" */, FzCols: uintptr(0)},
+} /* sqlite3.c:107725:5 */
// Recommended number of samples for sqlite_stat4
@@ -83474,6 +86191,15 @@ type StatAccum1 = struct {
FnKeyCol int32
FnSkipAhead U8
Fcurrent StatSample
+ FnPSample TRowcnt
+ FmxSample int32
+ FiPrn U32
+ FaBest uintptr
+ FiMin int32
+ FnSample int32
+ FnMaxEqZero int32
+ FiGet int32
+ Fa uintptr
}
// Recommended number of samples for sqlite_stat4
@@ -83481,25 +86207,82 @@ type StatAccum1 = struct {
// Three SQL functions - stat_init(), stat_push(), and stat_get() -
// share an instance of the following structure to hold their state
// information.
-type StatAccum = StatAccum1 /* sqlite3.c:107589:26 */
+type StatAccum = StatAccum1 /* sqlite3.c:107813:26 */
type StatSample1 = struct {
- FanEq uintptr
- FanDLt uintptr
+ FanEq uintptr
+ FanDLt uintptr
+ FanLt uintptr
+ Fu struct{ FiRowid I64 }
+ FnRowid U32
+ FisPSample U8
+ FiCol int32
+ FiHash U32
}
-type StatSample = StatSample1 /* sqlite3.c:107590:27 */
+type StatSample = StatSample1 /* sqlite3.c:107814:27 */
// Reclaim memory used by a StatSample
+func sampleClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:107855:13: */
+
+ if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 {
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */)))
+ (*StatSample)(unsafe.Pointer(p)).FnRowid = U32(0)
+ }
+}
// Initialize the BLOB value of a ROWID
+func sampleSetRowid(tls *libc.TLS, db uintptr, p uintptr, n int32, pData uintptr) { /* sqlite3.c:107867:13: */
+
+ if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 {
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */)))
+ }
+ *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */)) = Xsqlite3DbMallocRawNN(tls, db, uint64(n))
+ if *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */)) != 0 {
+ (*StatSample)(unsafe.Pointer(p)).FnRowid = U32(n)
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */)), pData, uint64(n))
+ } else {
+ (*StatSample)(unsafe.Pointer(p)).FnRowid = U32(0)
+ }
+}
// Initialize the INTEGER value of a ROWID.
+func sampleSetRowidInt64(tls *libc.TLS, db uintptr, p uintptr, iRowid I64) { /* sqlite3.c:107883:13: */
+
+ if (*StatSample)(unsafe.Pointer(p)).FnRowid != 0 {
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(p + 24 /* &.u */)))
+ }
+ (*StatSample)(unsafe.Pointer(p)).FnRowid = U32(0)
+ *(*I64)(unsafe.Pointer(p + 24 /* &.u */)) = iRowid
+}
// Copy the contents of object (*pFrom) into (*pTo).
+func sampleCopy(tls *libc.TLS, p uintptr, pTo uintptr, pFrom uintptr) { /* sqlite3.c:107896:13: */
+ (*StatSample)(unsafe.Pointer(pTo)).FisPSample = (*StatSample)(unsafe.Pointer(pFrom)).FisPSample
+ (*StatSample)(unsafe.Pointer(pTo)).FiCol = (*StatSample)(unsafe.Pointer(pFrom)).FiCol
+ (*StatSample)(unsafe.Pointer(pTo)).FiHash = (*StatSample)(unsafe.Pointer(pFrom)).FiHash
+ libc.Xmemcpy(tls, (*StatSample)(unsafe.Pointer(pTo)).FanEq, (*StatSample)(unsafe.Pointer(pFrom)).FanEq, (uint64(unsafe.Sizeof(TRowcnt(0))) * uint64((*StatAccum)(unsafe.Pointer(p)).FnCol)))
+ libc.Xmemcpy(tls, (*StatSample)(unsafe.Pointer(pTo)).FanLt, (*StatSample)(unsafe.Pointer(pFrom)).FanLt, (uint64(unsafe.Sizeof(TRowcnt(0))) * uint64((*StatAccum)(unsafe.Pointer(p)).FnCol)))
+ libc.Xmemcpy(tls, (*StatSample)(unsafe.Pointer(pTo)).FanDLt, (*StatSample)(unsafe.Pointer(pFrom)).FanDLt, (uint64(unsafe.Sizeof(TRowcnt(0))) * uint64((*StatAccum)(unsafe.Pointer(p)).FnCol)))
+ if (*StatSample)(unsafe.Pointer(pFrom)).FnRowid != 0 {
+ sampleSetRowid(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, pTo, int32((*StatSample)(unsafe.Pointer(pFrom)).FnRowid), *(*uintptr)(unsafe.Pointer(pFrom + 24 /* &.u */)))
+ } else {
+ sampleSetRowidInt64(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, pTo, *(*I64)(unsafe.Pointer(pFrom + 24 /* &.u */)))
+ }
+}
// Reclaim all memory of a StatAccum structure.
-func statAccumDestructor(tls *crt.TLS, pOld uintptr) { /* sqlite3.c:107690:13: */
+func statAccumDestructor(tls *libc.TLS, pOld uintptr) { /* sqlite3.c:107914:13: */
var p uintptr = pOld
+ if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 {
+ var i int32
+ for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ {
+ sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, ((*StatAccum)(unsafe.Pointer(p)).FaBest + uintptr(i)*48))
+ }
+ for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FmxSample; i++ {
+ sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*48))
+ }
+ sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, (p + 32 /* &.current */))
+ }
Xsqlite3DbFree(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, p)
}
@@ -83523,20 +86306,27 @@ func statAccumDestructor(tls *crt.TLS, pOld uintptr) { /* sqlite3.c:107690:13: *
// value is a pointer to the StatAccum object. The datatype of the
// return value is BLOB, but it is really just a pointer to the StatAccum
// object.
-func statInit(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:107725:13: */
+func statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:107949:13: */
var p uintptr
var nCol int32 // Number of columns in index being sampled
var nKeyCol int32 // Number of key columns
var nColUp int32 // nCol rounded up for alignment
var n int32 // Bytes of space to allocate
var db uintptr = Xsqlite3_context_db_handle(tls, context) // Database connection
+ // Maximum number of samples. 0 if STAT4 data is not collected
+ var mxSample int32
+ if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x0800)) == 0 {
+ mxSample = 24
+ } else {
+ mxSample = 0
+ }
// Decode the three function arguments
_ = argc
nCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
if uint64(unsafe.Sizeof(TRowcnt(0))) < uint64(8) {
- nColUp = ((nCol + 1) & ^int32(crt.Int32FromInt32(1)))
+ nColUp = ((nCol + 1) & ^int32(libc.Int32FromInt32(1)))
} else {
nColUp = nCol
}
@@ -83546,6 +86336,11 @@ func statInit(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
n = (int32((uint64(unsafe.Sizeof(StatAccum{})) +
(uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(nColUp))) + // StatAccum.anEq
(uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(nColUp)))) // StatAccum.anDLt
+ if mxSample != 0 {
+ n = int32(uint64(n) + (((uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(nColUp)) + // StatAccum.anLt
+ (uint64(unsafe.Sizeof(StatSample{})) * (uint64(nCol + mxSample)))) + // StatAccum.aBest[], a[]
+ (((uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(3)) * uint64(nColUp)) * (uint64(nCol + mxSample)))))
+ }
db = Xsqlite3_context_db_handle(tls, context)
p = Xsqlite3DbMallocZero(tls, db, uint64(n))
if p == uintptr(0) {
@@ -83560,14 +86355,47 @@ func statInit(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
(*StatAccum)(unsafe.Pointer(p)).FnCol = nCol
(*StatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol
(*StatAccum)(unsafe.Pointer(p)).FnSkipAhead = U8(0)
- (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt = (p + uintptr(1)*48)
+ (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt = (p + uintptr(1)*128)
(*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq = ((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(nColUp)*4)
+ (*StatAccum)(unsafe.Pointer(p)).FmxSample = func() int32 {
+ if (*StatAccum)(unsafe.Pointer(p)).FnLimit == 0 {
+ return mxSample
+ }
+ return 0
+ }()
+ if mxSample != 0 {
+ var pSpace uintptr // Allocated space not yet assigned
+ var i int32 // Used to iterate through p->aSample[]
+
+ (*StatAccum)(unsafe.Pointer(p)).FiGet = -1
+ (*StatAccum)(unsafe.Pointer(p)).FnPSample = (((*StatAccum)(unsafe.Pointer(p)).FnEst / (TRowcnt((mxSample / 3) + 1))) + TRowcnt(1))
+ (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt = ((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(nColUp)*4)
+ (*StatAccum)(unsafe.Pointer(p)).FiPrn = ((U32(0x689e962d) * U32(nCol)) ^ (0xd0944565 * U32(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))))
+
+ // Set up the StatAccum.a[] and aBest[] arrays
+ (*StatAccum)(unsafe.Pointer(p)).Fa = ((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr(nColUp)*4)
+ (*StatAccum)(unsafe.Pointer(p)).FaBest = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(mxSample)*48)
+ pSpace = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((mxSample+nCol))*48)
+ for i = 0; i < (mxSample + nCol); i++ {
+ (*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*48)).FanEq = pSpace
+ pSpace += (uintptr(uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(nColUp)))
+ (*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*48)).FanLt = pSpace
+ pSpace += (uintptr(uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(nColUp)))
+ (*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*48)).FanDLt = pSpace
+ pSpace += (uintptr(uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(nColUp)))
+ }
+
+ for i = 0; i < nCol; i++ {
+ (*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).FaBest + uintptr(i)*48)).FiCol = i
+ }
+ }
+
// Return a pointer to the allocated object to the caller. Note that
// only the pointer (the 2nd parameter) matters. The size of the object
// (given by the 3rd parameter) is never used and can be any positive
// value.
- Xsqlite3_result_blob(tls, context, p, int32(unsafe.Sizeof(StatAccum{})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{statAccumDestructor})))
+ Xsqlite3_result_blob(tls, context, p, int32(unsafe.Sizeof(StatAccum{})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{statAccumDestructor})))
}
var statInitFuncdef = FuncDef{FnArg: int8(4), FfuncFlags: // nArg
@@ -83577,9 +86405,236 @@ uintptr(0), FxSFunc:// pNext
0, FxFinalize:// xSFunc
uintptr(0), FxValue:// xFinalize
uintptr(0), FxInverse: uintptr(0), FzName: // xValue, xInverse
-ts + 9977, /* "stat_init" */ Fu:// zName
+ts + 12518, /* "stat_init" */ Fu:// zName
struct{ FpHash uintptr }{FpHash: uintptr(0)},
-} /* sqlite3.c:107812:22 */
+} /* sqlite3.c:108036:22 */
+
+// pNew and pOld are both candidate non-periodic samples selected for
+// the same column (pNew->iCol==pOld->iCol). Ignoring this column and
+// considering only any trailing columns and the sample hash value, this
+// function returns true if sample pNew is to be preferred over pOld.
+// In other words, if we assume that the cardinalities of the selected
+// column for pNew and pOld are equal, is pNew to be preferred over pOld.
+//
+// This function assumes that for each argument sample, the contents of
+// the anEq[] array from pSample->anEq[pSample->iCol+1] onwards are valid.
+func sampleIsBetterPost(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:108060:12: */
+ var nCol int32 = (*StatAccum)(unsafe.Pointer(pAccum)).FnCol
+ var i int32
+
+ for i = ((*StatSample)(unsafe.Pointer(pNew)).FiCol + 1); i < nCol; i++ {
+ if *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pNew)).FanEq + uintptr(i)*4)) > *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr(i)*4)) {
+ return 1
+ }
+ if *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pNew)).FanEq + uintptr(i)*4)) < *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr(i)*4)) {
+ return 0
+ }
+ }
+ if (*StatSample)(unsafe.Pointer(pNew)).FiHash > (*StatSample)(unsafe.Pointer(pOld)).FiHash {
+ return 1
+ }
+ return 0
+}
+
+// Return true if pNew is to be preferred over pOld.
+//
+// This function assumes that for each argument sample, the contents of
+// the anEq[] array from pSample->anEq[pSample->iCol] onwards are valid.
+func sampleIsBetter(tls *libc.TLS, pAccum uintptr, pNew uintptr, pOld uintptr) int32 { /* sqlite3.c:108084:12: */
+ var nEqNew TRowcnt = *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pNew)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pNew)).FiCol)*4))
+ var nEqOld TRowcnt = *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pOld)).FiCol)*4))
+
+ if nEqNew > nEqOld {
+ return 1
+ }
+ if nEqNew == nEqOld {
+ if (*StatSample)(unsafe.Pointer(pNew)).FiCol < (*StatSample)(unsafe.Pointer(pOld)).FiCol {
+ return 1
+ }
+ return (libc.Bool32(((*StatSample)(unsafe.Pointer(pNew)).FiCol == (*StatSample)(unsafe.Pointer(pOld)).FiCol) && (sampleIsBetterPost(tls, pAccum, pNew, pOld) != 0)))
+ }
+ return 0
+}
+
+// Copy the contents of sample *pNew into the p->a[] array. If necessary,
+// remove the least desirable sample from p->a[] to make room.
+func sampleInsert(tls *libc.TLS, p uintptr, pNew uintptr, nEqZero int32) { /* sqlite3.c:108107:13: */
+ var pSample uintptr
+ var i int32
+ var pOld uintptr
+ var pUpgrade uintptr
+ var pMin uintptr
+ var anEq uintptr
+ var anLt uintptr
+ var anDLt uintptr
+ var iMin int32
+ pSample = uintptr(0)
+
+ // StatAccum.nMaxEqZero is set to the maximum number of leading 0
+ // values in the anEq[] array of any sample in StatAccum.a[]. In
+ // other words, if nMaxEqZero is n, then it is guaranteed that there
+ // are no samples with StatSample.anEq[m]==0 for (m>=n).
+ if !(nEqZero > (*StatAccum)(unsafe.Pointer(p)).FnMaxEqZero) {
+ goto __1
+ }
+ (*StatAccum)(unsafe.Pointer(p)).FnMaxEqZero = nEqZero
+__1:
+ ;
+ if !(int32((*StatSample)(unsafe.Pointer(pNew)).FisPSample) == 0) {
+ goto __2
+ }
+ pUpgrade = uintptr(0)
+
+ // This sample is being added because the prefix that ends in column
+ // iCol occurs many times in the table. However, if we have already
+ // added a sample that shares this prefix, there is no need to add
+ // this one. Instead, upgrade the priority of the highest priority
+ // existing sample that shares this prefix.
+ i = ((*StatAccum)(unsafe.Pointer(p)).FnSample - 1)
+__3:
+ if !(i >= 0) {
+ goto __5
+ }
+ pOld = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(i)*48)
+ if !(*(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pOld)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pNew)).FiCol)*4)) == TRowcnt(0)) {
+ goto __6
+ }
+ if !((*StatSample)(unsafe.Pointer(pOld)).FisPSample != 0) {
+ goto __7
+ }
+ return
+__7:
+ ;
+
+ if !((pUpgrade == uintptr(0)) || (sampleIsBetter(tls, p, pOld, pUpgrade) != 0)) {
+ goto __8
+ }
+ pUpgrade = pOld
+__8:
+ ;
+__6:
+ ;
+ goto __4
+__4:
+ i--
+ goto __3
+ goto __5
+__5:
+ ;
+ if !(pUpgrade != 0) {
+ goto __9
+ }
+ (*StatSample)(unsafe.Pointer(pUpgrade)).FiCol = (*StatSample)(unsafe.Pointer(pNew)).FiCol
+ *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pUpgrade)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pUpgrade)).FiCol)*4)) = *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pNew)).FanEq + uintptr((*StatSample)(unsafe.Pointer(pUpgrade)).FiCol)*4))
+ goto find_new_min
+__9:
+ ;
+__2:
+ ;
+
+ // If necessary, remove sample iMin to make room for the new sample.
+ if !((*StatAccum)(unsafe.Pointer(p)).FnSample >= (*StatAccum)(unsafe.Pointer(p)).FmxSample) {
+ goto __10
+ }
+ pMin = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiMin)*48)
+ anEq = (*StatSample)(unsafe.Pointer(pMin)).FanEq
+ anLt = (*StatSample)(unsafe.Pointer(pMin)).FanLt
+ anDLt = (*StatSample)(unsafe.Pointer(pMin)).FanDLt
+ sampleClear(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, pMin)
+ libc.Xmemmove(tls, pMin, (pMin + uintptr(1)*48), (uint64(unsafe.Sizeof(StatSample{})) * (uint64(((*StatAccum)(unsafe.Pointer(p)).FnSample - (*StatAccum)(unsafe.Pointer(p)).FiMin) - 1))))
+ pSample = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr(((*StatAccum)(unsafe.Pointer(p)).FnSample-1))*48)
+ (*StatSample)(unsafe.Pointer(pSample)).FnRowid = U32(0)
+ (*StatSample)(unsafe.Pointer(pSample)).FanEq = anEq
+ (*StatSample)(unsafe.Pointer(pSample)).FanDLt = anDLt
+ (*StatSample)(unsafe.Pointer(pSample)).FanLt = anLt
+ (*StatAccum)(unsafe.Pointer(p)).FnSample = ((*StatAccum)(unsafe.Pointer(p)).FmxSample - 1)
+__10:
+ ;
+
+ // The "rows less-than" for the rowid column must be greater than that
+ // for the last sample in the p->a[] array. Otherwise, the samples would
+ // be out of order.
+
+ // Insert the new sample
+ pSample = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FnSample)*48)
+ sampleCopy(tls, p, pSample, pNew)
+ (*StatAccum)(unsafe.Pointer(p)).FnSample++
+
+ // Zero the first nEqZero entries in the anEq[] array.
+ libc.Xmemset(tls, (*StatSample)(unsafe.Pointer(pSample)).FanEq, 0, (uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(nEqZero)))
+
+find_new_min:
+ if !((*StatAccum)(unsafe.Pointer(p)).FnSample >= (*StatAccum)(unsafe.Pointer(p)).FmxSample) {
+ goto __11
+ }
+ iMin = -1
+ i = 0
+__12:
+ if !(i < (*StatAccum)(unsafe.Pointer(p)).FmxSample) {
+ goto __14
+ }
+ if !((*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*48)).FisPSample != 0) {
+ goto __15
+ }
+ goto __13
+__15:
+ ;
+ if !((iMin < 0) || (sampleIsBetter(tls, p, ((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(iMin)*48), ((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*48)) != 0)) {
+ goto __16
+ }
+ iMin = i
+__16:
+ ;
+ goto __13
+__13:
+ i++
+ goto __12
+ goto __14
+__14:
+ ;
+
+ (*StatAccum)(unsafe.Pointer(p)).FiMin = iMin
+__11:
+}
+
+// Field iChng of the index being scanned has changed. So at this point
+// p->current contains a sample that reflects the previous row of the
+// index. The value of anEq[iChng] and subsequent anEq[] elements are
+// correct at this point.
+func samplePushPrevious(tls *libc.TLS, p uintptr, iChng int32) { /* sqlite3.c:108199:13: */
+ var i int32
+
+ // Check if any samples from the aBest[] array should be pushed
+ // into IndexSample.a[] at this point.
+ for i = ((*StatAccum)(unsafe.Pointer(p)).FnCol - 2); i >= iChng; i-- {
+ var pBest uintptr = ((*StatAccum)(unsafe.Pointer(p)).FaBest + uintptr(i)*48)
+ *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer(pBest)).FanEq + uintptr(i)*4)) = *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(i)*4))
+ if ((*StatAccum)(unsafe.Pointer(p)).FnSample < (*StatAccum)(unsafe.Pointer(p)).FmxSample) || (sampleIsBetter(tls, p, pBest, ((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr((*StatAccum)(unsafe.Pointer(p)).FiMin)*48)) != 0) {
+ sampleInsert(tls, p, pBest, i)
+ }
+ }
+
+ // Check that no sample contains an anEq[] entry with an index of
+ // p->nMaxEqZero or greater set to zero.
+ for i = ((*StatAccum)(unsafe.Pointer(p)).FnSample - 1); i >= 0; i-- {
+ var j int32
+ for j = (*StatAccum)(unsafe.Pointer(p)).FnMaxEqZero; j < (*StatAccum)(unsafe.Pointer(p)).FnCol; j++ {
+ }
+ }
+
+ // Update the anEq[] fields of any samples already collected.
+ if iChng < (*StatAccum)(unsafe.Pointer(p)).FnMaxEqZero {
+ for i = ((*StatAccum)(unsafe.Pointer(p)).FnSample - 1); i >= 0; i-- {
+ var j int32
+ for j = iChng; j < (*StatAccum)(unsafe.Pointer(p)).FnCol; j++ {
+ if *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*48)).FanEq + uintptr(j)*4)) == TRowcnt(0) {
+ *(*TRowcnt)(unsafe.Pointer((*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa+uintptr(i)*48)).FanEq + uintptr(j)*4)) = *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(j)*4))
+ }
+ }
+ }
+ (*StatAccum)(unsafe.Pointer(p)).FnMaxEqZero = iChng
+ }
+}
// Implementation of the stat_push SQL function: stat_push(P,C,R)
// Arguments:
@@ -83598,7 +86653,7 @@ struct{ FpHash uintptr }{FpHash: uintptr(0)},
// if it wants the byte-code to do special processing.
//
// The R parameter is only used for STAT4
-func statPush(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:108027:13: */
+func statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:108251:13: */
var i int32
// The three function arguments
@@ -83615,6 +86670,9 @@ func statPush(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
}
} else {
// Second and subsequent calls get processed here
+ if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 {
+ samplePushPrevious(tls, p, iChng)
+ }
// Update anDLt[], anLt[] and anEq[] to reflect the values that apply
// to the current row of the index.
@@ -83623,27 +86681,56 @@ func statPush(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
}
for i = iChng; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ {
*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(i)*4))++
+ if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 {
+ *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr(i)*4)) += (*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(i)*4)))
+ }
*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanEq + uintptr(i)*4)) = TRowcnt(1)
}
}
(*StatAccum)(unsafe.Pointer(p)).FnRow++
- if ((*StatAccum)(unsafe.Pointer(p)).FnLimit != 0) && ((*StatAccum)(unsafe.Pointer(p)).FnRow > (TRowcnt((*StatAccum)(unsafe.Pointer(p)).FnLimit) * (TRowcnt(int32((*StatAccum)(unsafe.Pointer(p)).FnSkipAhead) + 1)))) {
+ if (*StatAccum)(unsafe.Pointer(p)).FmxSample != 0 {
+ var nLt TRowcnt
+ if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))) == 1 {
+ sampleSetRowidInt64(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, (p + 32 /* &.current */), Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ } else {
+ sampleSetRowid(tls, (*StatAccum)(unsafe.Pointer(p)).Fdb, (p + 32 /* &.current */), Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))),
+ Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ }
+ (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FiHash = libc.AssignPtrUint32(p+88 /* &.iPrn */, (((*StatAccum)(unsafe.Pointer(p)).FiPrn * U32(1103515245)) + U32(12345)))
+
+ nLt = *(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanLt + uintptr(((*StatAccum)(unsafe.Pointer(p)).FnCol-1))*4))
+ // Check if this is to be a periodic sample. If so, add it.
+ if (nLt / (*StatAccum)(unsafe.Pointer(p)).FnPSample) != ((nLt + TRowcnt(1)) / (*StatAccum)(unsafe.Pointer(p)).FnPSample) {
+ (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FisPSample = U8(1)
+ (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FiCol = 0
+ sampleInsert(tls, p, (p + 32 /* &.current */), ((*StatAccum)(unsafe.Pointer(p)).FnCol - 1))
+ (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FisPSample = U8(0)
+ }
+
+ // Update the aBest[] array.
+ for i = 0; i < ((*StatAccum)(unsafe.Pointer(p)).FnCol - 1); i++ {
+ (*StatAccum)(unsafe.Pointer(p)).Fcurrent.FiCol = i
+ if (i >= iChng) || (sampleIsBetterPost(tls, p, (p+32 /* &.current */), ((*StatAccum)(unsafe.Pointer(p)).FaBest+uintptr(i)*48)) != 0) {
+ sampleCopy(tls, p, ((*StatAccum)(unsafe.Pointer(p)).FaBest + uintptr(i)*48), (p + 32 /* &.current */))
+ }
+ }
+ } else if ((*StatAccum)(unsafe.Pointer(p)).FnLimit != 0) && ((*StatAccum)(unsafe.Pointer(p)).FnRow > (TRowcnt((*StatAccum)(unsafe.Pointer(p)).FnLimit) * (TRowcnt(int32((*StatAccum)(unsafe.Pointer(p)).FnSkipAhead) + 1)))) {
(*StatAccum)(unsafe.Pointer(p)).FnSkipAhead++
- Xsqlite3_result_int(tls, context, (crt.Bool32(*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(0)*4)) > TRowcnt(0))))
+ Xsqlite3_result_int(tls, context, (libc.Bool32(*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(0)*4)) > TRowcnt(0))))
}
}
-var statPushFuncdef = FuncDef{FnArg: (int8(2 + 0)), FfuncFlags: // nArg
+var statPushFuncdef = FuncDef{FnArg: (int8(2 + 1)), FfuncFlags: // nArg
U32(1), FpUserData:// funcFlags
uintptr(0), FpNext:// pUserData
uintptr(0), FxSFunc:// pNext
0, FxFinalize:// xSFunc
uintptr(0), FxValue:// xFinalize
uintptr(0), FxInverse: uintptr(0), FzName: // xValue, xInverse
-ts + 9987, /* "stat_push" */ Fu:// zName
+ts + 12528, /* "stat_push" */ Fu:// zName
struct{ FpHash uintptr }{FpHash: uintptr(0)},
-} /* sqlite3.c:108102:22 */
+} /* sqlite3.c:108326:22 */
// Implementation of the stat_get(P,J) SQL function. This routine is
// used to query statistical information that has been gathered into
@@ -83662,13 +86749,15 @@ struct{ FpHash uintptr }{FpHash: uintptr(0)},
// STAT_GET_STAT1 and is hence omitted and this routine becomes
// a one-parameter function, stat_get(P), that always returns the
// stat1 table entry information.
-func statGet(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:108139:13: */
- bp := tls.Alloc(16)
- defer tls.Free(16)
+func statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:108363:13: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
var p uintptr = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ // STAT4 has a parameter on this routine.
+ var eCall int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
- {
+ if eCall == 0 {
// Return the value to store in the "stat" column of the sqlite_stat1
// table for this index.
//
@@ -83698,8 +86787,8 @@ func statGet(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlit
return
}
- Xsqlite3_snprintf(tls, 24, zRet, ts+9997, /* "%llu" */
- crt.VaList(bp, func() uint64 {
+ Xsqlite3_snprintf(tls, 24, zRet, ts+12538, /* "%llu" */
+ libc.VaList(bp, func() uint64 {
if (*StatAccum)(unsafe.Pointer(p)).FnSkipAhead != 0 {
return U64((*StatAccum)(unsafe.Pointer(p)).FnEst)
}
@@ -83709,36 +86798,107 @@ func statGet(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlit
for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnKeyCol; i++ {
var nDistinct U64 = (U64(*(*TRowcnt)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fcurrent.FanDLt + uintptr(i)*4)) + TRowcnt(1)))
var iVal U64 = (((U64((*StatAccum)(unsafe.Pointer(p)).FnRow) + nDistinct) - uint64(1)) / nDistinct)
- Xsqlite3_snprintf(tls, 24, z, ts+10002 /* " %llu" */, crt.VaList(bp+8, iVal))
+ Xsqlite3_snprintf(tls, 24, z, ts+12543 /* " %llu" */, libc.VaList(bp+8, iVal))
z += uintptr(Xsqlite3Strlen30(tls, z))
}
- Xsqlite3_result_text(tls, context, zRet, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3_result_text(tls, context, zRet, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ } else if eCall == 1 {
+ if (*StatAccum)(unsafe.Pointer(p)).FiGet < 0 {
+ samplePushPrevious(tls, p, 0)
+ (*StatAccum)(unsafe.Pointer(p)).FiGet = 0
+ }
+ if (*StatAccum)(unsafe.Pointer(p)).FiGet < (*StatAccum)(unsafe.Pointer(p)).FnSample {
+ var pS uintptr = ((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiGet)*48)
+ if (*StatSample)(unsafe.Pointer(pS)).FnRowid == U32(0) {
+ Xsqlite3_result_int64(tls, context, *(*I64)(unsafe.Pointer(pS + 24 /* &.u */)))
+ } else {
+ Xsqlite3_result_blob(tls, context, *(*uintptr)(unsafe.Pointer(pS + 24 /* &.u */)), int32((*StatSample)(unsafe.Pointer(pS)).FnRowid),
+ libc.UintptrFromInt32(-1))
+ }
+ }
+ } else {
+ var aCnt uintptr = uintptr(0)
+
+ switch eCall {
+ case 2:
+ aCnt = (*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiGet)*48)).FanEq
+ break
+ fallthrough
+ case 3:
+ aCnt = (*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiGet)*48)).FanLt
+ break
+ fallthrough
+ default:
+ {
+ aCnt = (*StatSample)(unsafe.Pointer((*StatAccum)(unsafe.Pointer(p)).Fa + uintptr((*StatAccum)(unsafe.Pointer(p)).FiGet)*48)).FanDLt
+ (*StatAccum)(unsafe.Pointer(p)).FiGet++
+ break
+ }
+ }
+
+ {
+ var zRet uintptr = Xsqlite3MallocZero(tls, (uint64((*StatAccum)(unsafe.Pointer(p)).FnCol * 25)))
+ if zRet == uintptr(0) {
+ Xsqlite3_result_error_nomem(tls, context)
+ } else {
+ var i int32
+ var z uintptr = zRet
+ for i = 0; i < (*StatAccum)(unsafe.Pointer(p)).FnCol; i++ {
+ Xsqlite3_snprintf(tls, 24, z, ts+12549 /* "%llu " */, libc.VaList(bp+16, U64(*(*TRowcnt)(unsafe.Pointer(aCnt + uintptr(i)*4)))))
+ z += uintptr(Xsqlite3Strlen30(tls, z))
+ }
+
+ *(*int8)(unsafe.Pointer(z + libc.UintptrFromInt32(-1))) = int8(0)
+ Xsqlite3_result_text(tls, context, zRet, -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ }
+ }
}
_ = argc
}
-var statGetFuncdef = FuncDef{FnArg: (int8(1 + 0)), FfuncFlags: // nArg
+var statGetFuncdef = FuncDef{FnArg: (int8(1 + 1)), FfuncFlags: // nArg
U32(1), FpUserData:// funcFlags
uintptr(0), FpNext:// pUserData
uintptr(0), FxSFunc:// pNext
0, FxFinalize:// xSFunc
uintptr(0), FxValue:// xFinalize
uintptr(0), FxInverse: uintptr(0), FzName: // xValue, xInverse
-ts + 10008, /* "stat_get" */ Fu:// zName
+ts + 12555, /* "stat_get" */ Fu:// zName
struct{ FpHash uintptr }{FpHash: uintptr(0)},
-} /* sqlite3.c:108254:22 */
+} /* sqlite3.c:108478:22 */
-func callStatGet(tls *crt.TLS, pParse uintptr, regStat int32, iParam int32, regOut int32) { /* sqlite3.c:108266:13: */
- _ = iParam
+func callStatGet(tls *libc.TLS, pParse uintptr, regStat int32, iParam int32, regOut int32) { /* sqlite3.c:108490:13: */
+ Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, 69, iParam, (regStat + 1))
- Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, regStat, regOut, (1 + 0),
+ Xsqlite3VdbeAddFunctionCall(tls, pParse, 0, regStat, regOut, (1 + 1),
uintptr(unsafe.Pointer(&statGetFuncdef)), 0)
}
+// Add a comment to the most recent VDBE opcode that is the name
+// of the k-th column of the pIdx index.
+func analyzeVdbeCommentIndexWithColumnName(tls *libc.TLS, v uintptr, pIdx uintptr, k int32) { /* sqlite3.c:108507:13: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
+
+ var i int32 // Index of column in the table
+
+ i = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(k)*2)))
+ if i == (-1) {
+ Xsqlite3VdbeComment(tls, v, ts+9969 /* "%s.rowid" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName))
+ } else if i == (-2) {
+ Xsqlite3VdbeComment(tls, v, ts+12564 /* "%s.expr(%d)" */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIdx)).FzName, k))
+ } else {
+ Xsqlite3VdbeComment(tls, v, ts+9978 /* "%s.%s" */, libc.VaList(bp+24, (*Index)(unsafe.Pointer(pIdx)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol+uintptr(i)*32)).FzName))
+ }
+}
+
// Generate code to do an analysis of all indices associated with
// a single table.
-func analyzeOneTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr, iStatCur int32, iMem int32, iTab int32) { /* sqlite3.c:108283:13: */
+func analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr, iStatCur int32, iMem int32, iTab int32) { /* sqlite3.c:108531:13: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database handle
var pIdx uintptr // An index to being analyzed
var iIdxCur int32 // Cursor open on index being analyzed
@@ -83748,16 +86908,17 @@ func analyzeOneTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintpt
var jZeroRows int32 = -1 // Jump from here if number of rows is zero
var iDb int32 // Index of database containing pTab
var needTableCnt U8 = U8(1) // True to count the table
- var regNewRowid int32 = crt.PostIncInt32(&iMem, 1) // Rowid for the inserted record
- var regStat int32 = crt.PostIncInt32(&iMem, 1) // Register to hold StatAccum object
- var regChng int32 = crt.PostIncInt32(&iMem, 1) // Index of changed index field
- var regRowid int32 = crt.PostIncInt32(&iMem, 1) // Rowid argument passed to stat_push()
- var regTemp int32 = crt.PostIncInt32(&iMem, 1) // Temporary use register
- var regTemp2 int32 = crt.PostIncInt32(&iMem, 1) // Second temporary use register
- var regTabname int32 = crt.PostIncInt32(&iMem, 1) // Register containing table name
- var regIdxname int32 = crt.PostIncInt32(&iMem, 1) // Register containing index name
- var regStat1 int32 = crt.PostIncInt32(&iMem, 1) // Value for the stat column of sqlite_stat1
+ var regNewRowid int32 = libc.PostIncInt32(&iMem, 1) // Rowid for the inserted record
+ var regStat int32 = libc.PostIncInt32(&iMem, 1) // Register to hold StatAccum object
+ var regChng int32 = libc.PostIncInt32(&iMem, 1) // Index of changed index field
+ var regRowid int32 = libc.PostIncInt32(&iMem, 1) // Rowid argument passed to stat_push()
+ var regTemp int32 = libc.PostIncInt32(&iMem, 1) // Temporary use register
+ var regTemp2 int32 = libc.PostIncInt32(&iMem, 1) // Second temporary use register
+ var regTabname int32 = libc.PostIncInt32(&iMem, 1) // Register containing table name
+ var regIdxname int32 = libc.PostIncInt32(&iMem, 1) // Register containing index name
+ var regStat1 int32 = libc.PostIncInt32(&iMem, 1) // Value for the stat column of sqlite_stat1
var regPrev int32 = iMem // MUST BE LAST (see below)
+ var pStat1 uintptr = uintptr(0)
(*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 {
if ((*Parse)(unsafe.Pointer(pParse)).FnMem) > (iMem) {
@@ -83769,11 +86930,11 @@ func analyzeOneTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintpt
if (v == uintptr(0)) || (pTab == uintptr(0)) {
return
}
- if (*Table)(unsafe.Pointer(pTab)).Ftnum == 0 {
+ if (*Table)(unsafe.Pointer(pTab)).Ftnum == Pgno(0) {
// Do not gather statistics on views or virtual tables
return
}
- if Xsqlite3_strlike(tls, ts+10017 /* "sqlite\\_%" */, (*Table)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 {
+ if Xsqlite3_strlike(tls, ts+12576 /* "sqlite\\_%" */, (*Table)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 {
// Do not gather statistics on system tables
return
}
@@ -83785,13 +86946,25 @@ func analyzeOneTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintpt
return
}
+ if (*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 {
+ pStat1 = Xsqlite3DbMallocZero(tls, db, (uint64(unsafe.Sizeof(Table{})) + uint64(13)))
+ if pStat1 == uintptr(0) {
+ return
+ }
+ (*Table)(unsafe.Pointer(pStat1)).FzName = (pStat1 + uintptr(1)*128)
+ libc.Xmemcpy(tls, (*Table)(unsafe.Pointer(pStat1)).FzName, ts+12438 /* "sqlite_stat1" */, uint64(13))
+ (*Table)(unsafe.Pointer(pStat1)).FnCol = int16(3)
+ (*Table)(unsafe.Pointer(pStat1)).FiPKey = int16(-1)
+ Xsqlite3VdbeAddOp4(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, 173, 0, 0, 0, pStat1, -17)
+ }
+
// Establish a read-lock on the table at the shared-cache level.
// Open a read-only cursor on the table. Also allocate a cursor number
// to use for scanning indexes (iIdxCur). No index cursor is opened at
// this time though.
Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab)).FzName)
- iTabCur = crt.PostIncInt32(&iTab, 1)
- iIdxCur = crt.PostIncInt32(&iTab, 1)
+ iTabCur = libc.PostIncInt32(&iTab, 1)
+ iIdxCur = libc.PostIncInt32(&iTab, 1)
(*Parse)(unsafe.Pointer(pParse)).FnTab = func() int32 {
if ((*Parse)(unsafe.Pointer(pParse)).FnTab) > (iTab) {
return (*Parse)(unsafe.Pointer(pParse)).FnTab
@@ -83830,6 +87003,7 @@ func analyzeOneTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintpt
// Populate the register containing the index name.
Xsqlite3VdbeLoadString(tls, v, regIdxname, zIdxName)
+ Xsqlite3VdbeComment(tls, v, ts+12586 /* "Analysis for %s...." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, zIdxName))
// Pseudo-code for loop that calls stat_push():
//
@@ -83874,8 +87048,9 @@ func analyzeOneTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintpt
// Open a read-only cursor on the index being analyzed.
- Xsqlite3VdbeAddOp3(tls, v, 96, iIdxCur, (*Index)(unsafe.Pointer(pIdx)).Ftnum, iDb)
+ Xsqlite3VdbeAddOp3(tls, v, 96, iIdxCur, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp+16, (*Index)(unsafe.Pointer(pIdx)).FzName))
// Invoke the stat_init() function. The arguments are:
//
@@ -83886,7 +87061,10 @@ func analyzeOneTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintpt
Xsqlite3VdbeAddOp2(tls, v, 69, nCol, (regStat + 1))
Xsqlite3VdbeAddOp2(tls, v, 69, int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol), regRowid)
- {
+ if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x0800)) == 0 {
+ Xsqlite3VdbeAddOp2(tls, v, 92, iIdxCur, regTemp)
+ addrRewind = Xsqlite3VdbeAddOp1(tls, v, 37, iIdxCur)
+ } else {
addrRewind = Xsqlite3VdbeAddOp1(tls, v, 37, iIdxCur)
Xsqlite3VdbeAddOp3(tls, v, 92, iIdxCur, regTemp, 1)
@@ -83934,7 +87112,7 @@ func analyzeOneTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintpt
var pColl uintptr = Xsqlite3LocateCollSeq(tls, pParse, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i)*8)))
Xsqlite3VdbeAddOp2(tls, v, 69, i, regChng)
Xsqlite3VdbeAddOp3(tls, v, 89, iIdxCur, i, regTemp)
-
+ analyzeVdbeCommentIndexWithColumnName(tls, v, pIdx, i)
*(*int32)(unsafe.Pointer(aGotoChng + uintptr(i)*4)) = Xsqlite3VdbeAddOp4(tls, v, 52, regTemp, 0, (regPrev + i), pColl, -2)
Xsqlite3VdbeChangeP5(tls, v, uint16(0x80))
}
@@ -83950,6 +87128,7 @@ func analyzeOneTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintpt
for i = 0; i < nColTest; i++ {
Xsqlite3VdbeJumpHere(tls, v, *(*int32)(unsafe.Pointer(aGotoChng + uintptr(i)*4)))
Xsqlite3VdbeAddOp3(tls, v, 89, iIdxCur, i, (regPrev + i))
+ analyzeVdbeCommentIndexWithColumnName(tls, v, pIdx, i)
}
Xsqlite3VdbeResolveLabel(tls, v, endDistinctTest)
Xsqlite3DbFree(tls, db, aGotoChng)
@@ -83960,9 +87139,29 @@ func analyzeOneTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintpt
// stat_push(P, regChng, regRowid) // 3rd parameter STAT4 only
// Next csr
// if !eof(csr) goto next_row;
+ if (int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x0800)) == 0 {
+
+ if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0) {
+ Xsqlite3VdbeAddOp2(tls, v, 134, iIdxCur, regRowid)
+ } else {
+ var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, (*Index)(unsafe.Pointer(pIdx)).FpTable)
+ var j int32
+ var k int32
+ var regKey int32
+ regKey = Xsqlite3GetTempRange(tls, pParse, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
+ for j = 0; j < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); j++ {
+ k = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2))))
+
+ Xsqlite3VdbeAddOp3(tls, v, 89, iIdxCur, k, (regKey + j))
+ analyzeVdbeCommentIndexWithColumnName(tls, v, pIdx, k)
+ }
+ Xsqlite3VdbeAddOp3(tls, v, 91, regKey, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol), regRowid)
+ Xsqlite3ReleaseTempRange(tls, pParse, regKey, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
+ }
+ }
{
- Xsqlite3VdbeAddFunctionCall(tls, pParse, 1, regStat, regTemp, (2 + 0),
+ Xsqlite3VdbeAddFunctionCall(tls, pParse, 1, regStat, regTemp, (2 + 1),
uintptr(unsafe.Pointer(&statPushFuncdef)), 0)
if (*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit != 0 {
var j1 int32
@@ -83984,12 +87183,55 @@ func analyzeOneTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintpt
// Add the entry to the stat1 table.
callStatGet(tls, pParse, regStat, 0, regStat1)
- Xsqlite3VdbeAddOp4(tls, v, 91, regTabname, 3, regTemp, ts+10027 /* "BBB" */, 0)
+ Xsqlite3VdbeAddOp4(tls, v, 91, regTabname, 3, regTemp, ts+12605 /* "BBB" */, 0)
Xsqlite3VdbeAddOp2(tls, v, 120, iStatCur, regNewRowid)
Xsqlite3VdbeAddOp3(tls, v, 121, iStatCur, regTemp, regNewRowid)
+ Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -6)
Xsqlite3VdbeChangeP5(tls, v, uint16(0x08))
// Add the entries to the stat4 table.
+ if ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x0800)) == 0) && ((*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit == 0) {
+ var regEq int32 = regStat1
+ var regLt int32 = (regStat1 + 1)
+ var regDLt int32 = (regStat1 + 2)
+ var regSample int32 = (regStat1 + 3)
+ var regCol int32 = (regStat1 + 4)
+ var regSampleRowid int32 = (regCol + nCol)
+ var addrNext int32
+ var addrIsNull int32
+ var seekOp U8
+ if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0) {
+ seekOp = uint8(32)
+ } else {
+ seekOp = uint8(29)
+ }
+
+ (*Parse)(unsafe.Pointer(pParse)).FnMem = func() int32 {
+ if ((*Parse)(unsafe.Pointer(pParse)).FnMem) > (regCol + nCol) {
+ return (*Parse)(unsafe.Pointer(pParse)).FnMem
+ }
+ return (regCol + nCol)
+ }()
+
+ addrNext = Xsqlite3VdbeCurrentAddr(tls, v)
+ callStatGet(tls, pParse, regStat, 1, regSampleRowid)
+ addrIsNull = Xsqlite3VdbeAddOp1(tls, v, 50, regSampleRowid)
+
+ callStatGet(tls, pParse, regStat, 2, regEq)
+ callStatGet(tls, pParse, regStat, 3, regLt)
+ callStatGet(tls, pParse, regStat, 4, regDLt)
+ Xsqlite3VdbeAddOp4Int(tls, v, int32(seekOp), iTabCur, addrNext, regSampleRowid, 0)
+
+ for i = 0; i < nCol; i++ {
+ Xsqlite3ExprCodeLoadIndexColumn(tls, pParse, pIdx, iTabCur, i, (regCol + i))
+ }
+ Xsqlite3VdbeAddOp3(tls, v, 91, regCol, nCol, regSample)
+ Xsqlite3VdbeAddOp3(tls, v, 91, regTabname, 6, regTemp)
+ Xsqlite3VdbeAddOp2(tls, v, 120, (iStatCur + 1), regNewRowid)
+ Xsqlite3VdbeAddOp3(tls, v, 121, (iStatCur + 1), regTemp, regNewRowid)
+ Xsqlite3VdbeAddOp2(tls, v, 11, 1, addrNext) // P1==1 for end-of-loop
+ Xsqlite3VdbeJumpHere(tls, v, addrIsNull)
+ }
// End of analysis
Xsqlite3VdbeJumpHere(tls, v, addrRewind)
@@ -83998,22 +87240,23 @@ func analyzeOneTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintpt
// Create a single sqlite_stat1 entry containing NULL as the index
// name and the row count as the content.
if (pOnlyIdx == uintptr(0)) && (needTableCnt != 0) {
-
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp+24, (*Table)(unsafe.Pointer(pTab)).FzName))
Xsqlite3VdbeAddOp2(tls, v, 92, iTabCur, regStat1)
jZeroRows = Xsqlite3VdbeAddOp1(tls, v, 20, regStat1)
Xsqlite3VdbeAddOp2(tls, v, 72, 0, regIdxname)
- Xsqlite3VdbeAddOp4(tls, v, 91, regTabname, 3, regTemp, ts+10027 /* "BBB" */, 0)
+ Xsqlite3VdbeAddOp4(tls, v, 91, regTabname, 3, regTemp, ts+12605 /* "BBB" */, 0)
Xsqlite3VdbeAddOp2(tls, v, 120, iStatCur, regNewRowid)
Xsqlite3VdbeAddOp3(tls, v, 121, iStatCur, regTemp, regNewRowid)
Xsqlite3VdbeChangeP5(tls, v, uint16(0x08))
+ Xsqlite3VdbeChangeP4(tls, v, -1, pStat1, -6)
Xsqlite3VdbeJumpHere(tls, v, jZeroRows)
}
}
// Generate code that will cause the most recent index analysis to
// be loaded into internal hash tables where is can be used.
-func loadAnalysis(tls *crt.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:108645:13: */
+func loadAnalysis(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:108893:13: */
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
if v != 0 {
Xsqlite3VdbeAddOp1(tls, v, 142, iDb)
@@ -84021,7 +87264,7 @@ func loadAnalysis(tls *crt.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:108645
}
// Generate code that will do an analysis of an entire database
-func analyzeDatabase(tls *crt.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:108655:13: */
+func analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:108903:13: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema // Schema of database iDb
var k uintptr
@@ -84046,7 +87289,7 @@ func analyzeDatabase(tls *crt.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:108
// Generate code that will do an analysis of a single table in
// a database. If pOnlyIdx is not NULL then it is a single index
// in pTab that should be analyzed.
-func analyzeTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) { /* sqlite3.c:108682:13: */
+func analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr) { /* sqlite3.c:108930:13: */
var iDb int32
var iStatCur int32
@@ -84055,9 +87298,9 @@ func analyzeTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr)
iStatCur = (*Parse)(unsafe.Pointer(pParse)).FnTab
*(*int32)(unsafe.Pointer(pParse + 52 /* &.nTab */)) += (3)
if pOnlyIdx != 0 {
- openStatTable(tls, pParse, iDb, iStatCur, (*Index)(unsafe.Pointer(pOnlyIdx)).FzName, ts+10031 /* "idx" */)
+ openStatTable(tls, pParse, iDb, iStatCur, (*Index)(unsafe.Pointer(pOnlyIdx)).FzName, ts+12609 /* "idx" */)
} else {
- openStatTable(tls, pParse, iDb, iStatCur, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10035 /* "tbl" */)
+ openStatTable(tls, pParse, iDb, iStatCur, (*Table)(unsafe.Pointer(pTab)).FzName, ts+12613 /* "tbl" */)
}
analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1), (*Parse)(unsafe.Pointer(pParse)).FnTab)
loadAnalysis(tls, pParse, iDb)
@@ -84073,7 +87316,7 @@ func analyzeTable(tls *crt.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr)
// Form 1 causes all indices in all attached databases to be analyzed.
// Form 2 analyzes all indices the single database named.
// Form 3 analyzes all indices associated with the named table.
-func Xsqlite3Analyze(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:108713:21: */
+func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:108961:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -84103,7 +87346,7 @@ func Xsqlite3Analyze(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 uintpt
} // Do not analyze the TEMP database
analyzeDatabase(tls, pParse, i)
}
- } else if ((*Token)(unsafe.Pointer(pName2)).Fn == uint32(0)) && ((crt.AssignInt32(&iDb, Xsqlite3FindDb(tls, db, pName1))) >= 0) {
+ } else if ((*Token)(unsafe.Pointer(pName2)).Fn == uint32(0)) && ((libc.AssignInt32(&iDb, Xsqlite3FindDb(tls, db, pName1))) >= 0) {
// Analyze the schema named as the argument
analyzeDatabase(tls, pParse, iDb)
} else {
@@ -84117,16 +87360,16 @@ func Xsqlite3Analyze(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 uintpt
}
z = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp /* pTableName */)))
if z != 0 {
- if (crt.AssignUintptr(&pIdx, Xsqlite3FindIndex(tls, db, z, zDb))) != uintptr(0) {
+ if (libc.AssignUintptr(&pIdx, Xsqlite3FindIndex(tls, db, z, zDb))) != uintptr(0) {
analyzeTable(tls, pParse, (*Index)(unsafe.Pointer(pIdx)).FpTable, pIdx)
- } else if (crt.AssignUintptr(&pTab, Xsqlite3LocateTable(tls, pParse, uint32(0), z, zDb))) != uintptr(0) {
+ } else if (libc.AssignUintptr(&pTab, Xsqlite3LocateTable(tls, pParse, uint32(0), z, zDb))) != uintptr(0) {
analyzeTable(tls, pParse, pTab, uintptr(0))
}
Xsqlite3DbFree(tls, db, z)
}
}
}
- if (int32((*Sqlite3)(unsafe.Pointer(db)).FnSqlExec) == 0) && ((crt.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse))) != uintptr(0)) {
+ if (int32((*Sqlite3)(unsafe.Pointer(db)).FnSqlExec) == 0) && ((libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse))) != uintptr(0)) {
Xsqlite3VdbeAddOp0(tls, v, 158)
}
}
@@ -84140,45 +87383,50 @@ type analysisInfo = struct {
// Used to pass information from the analyzer reader through to the
// callback routine.
-type AnalysisInfo = analysisInfo /* sqlite3.c:108765:29 */
+type AnalysisInfo = analysisInfo /* sqlite3.c:109013:29 */
// The first argument points to a nul-terminated string containing a
// list of space separated integers. Read the first nOut of these into
// the array aOut[].
-func decodeIntArray(tls *crt.TLS, zIntArray uintptr, nOut int32, aOut uintptr, aLog uintptr, pIndex uintptr) { /* sqlite3.c:108776:13: */
+func decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, aLog uintptr, pIndex uintptr) { /* sqlite3.c:109024:13: */
var z uintptr = zIntArray
var c int32
var i int32
var v TRowcnt
+ if z == uintptr(0) {
+ z = ts + 781 /* "" */
+ }
for i = 0; (*(*int8)(unsafe.Pointer(z)) != 0) && (i < nOut); i++ {
v = TRowcnt(0)
- for ((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))))) >= '0') && (c <= '9') {
+ for ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))))) >= '0') && (c <= '9') {
v = (((v * TRowcnt(10)) + TRowcnt(c)) - TRowcnt('0'))
z++
}
-
- _ = aOut
-
- *(*LogEst)(unsafe.Pointer(aLog + uintptr(i)*2)) = Xsqlite3LogEst(tls, uint64(v))
+ if aOut != 0 {
+ *(*TRowcnt)(unsafe.Pointer(aOut + uintptr(i)*4)) = v
+ }
+ if aLog != 0 {
+ *(*LogEst)(unsafe.Pointer(aLog + uintptr(i)*2)) = Xsqlite3LogEst(tls, uint64(v))
+ }
if int32(*(*int8)(unsafe.Pointer(z))) == ' ' {
z++
}
}
- {
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.bUnordered */, uint32(0), 2, 0x4)
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.noSkipScan */, uint32(0), 6, 0x40)
+ if pIndex != 0 {
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.bUnordered */, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.noSkipScan */, uint32(0), 6, 0x40)
for *(*int8)(unsafe.Pointer(z + uintptr(0))) != 0 {
- if Xsqlite3_strglob(tls, ts+10039 /* "unordered*" */, z) == 0 {
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.bUnordered */, uint32(1), 2, 0x4)
- } else if Xsqlite3_strglob(tls, ts+10050 /* "sz=[0-9]*" */, z) == 0 {
+ if Xsqlite3_strglob(tls, ts+12617 /* "unordered*" */, z) == 0 {
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.bUnordered */, uint32(1), 2, 0x4)
+ } else if Xsqlite3_strglob(tls, ts+12628 /* "sz=[0-9]*" */, z) == 0 {
var sz int32 = Xsqlite3Atoi(tls, (z + uintptr(3)))
if sz < 2 {
sz = 2
}
(*Index)(unsafe.Pointer(pIndex)).FszIdxRow = Xsqlite3LogEst(tls, uint64(sz))
- } else if Xsqlite3_strglob(tls, ts+10060 /* "noskipscan*" */, z) == 0 {
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.noSkipScan */, uint32(1), 6, 0x40)
+ } else if Xsqlite3_strglob(tls, ts+12638 /* "noskipscan*" */, z) == 0 {
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.noSkipScan */, uint32(1), 6, 0x40)
}
for (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) != ' ') {
z++
@@ -84199,9 +87447,9 @@ func decodeIntArray(tls *crt.TLS, zIntArray uintptr, nOut int32, aOut uintptr, a
//
// Entries for which argv[1]==NULL simply record the number of rows in
// the table.
-func analysisLoader(tls *crt.TLS, pData uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:108849:12: */
- bp := tls.Alloc(112)
- defer tls.Free(112)
+func analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:109097:12: */
+ bp := tls.Alloc(152)
+ defer tls.Free(152)
var pInfo uintptr = pData
var pIndex uintptr
@@ -84230,15 +87478,25 @@ func analysisLoader(tls *crt.TLS, pData uintptr, argc int32, argv uintptr, NotUs
if pIndex != 0 {
var aiRowEst uintptr = uintptr(0)
var nCol int32 = (int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol) + 1)
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.bUnordered */, uint32(0), 2, 0x4)
+ // Index.aiRowEst may already be set here if there are duplicate
+ // sqlite_stat1 entries for this index. In that case just clobber
+ // the old data with the new instead of allocating a new array.
+ if (*Index)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) {
+ (*Index)(unsafe.Pointer(pIndex)).FaiRowEst = Xsqlite3MallocZero(tls, (uint64(uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(nCol))))
+ if (*Index)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) {
+ Xsqlite3OomFault(tls, (*AnalysisInfo)(unsafe.Pointer(pInfo)).Fdb)
+ }
+ }
+ aiRowEst = (*Index)(unsafe.Pointer(pIndex)).FaiRowEst
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.bUnordered */, uint32(0), 2, 0x4)
decodeIntArray(tls, z, nCol, aiRowEst, (*Index)(unsafe.Pointer(pIndex)).FaiRowLogEst, pIndex)
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.hasStat1 */, uint32(1), 7, 0x80)
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.hasStat1 */, uint32(1), 7, 0x80)
if (*Index)(unsafe.Pointer(pIndex)).FpPartIdxWhere == uintptr(0) {
(*Table)(unsafe.Pointer(pTable)).FnRowLogEst = *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiRowLogEst + uintptr(0)*2))
*(*U32)(unsafe.Pointer(pTable + 64 /* &.tabFlags */)) |= (U32(0x0010))
}
} else {
- // var fakeIdx Index at bp, 112
+ // var fakeIdx Index at bp, 152
(*Index)(unsafe.Pointer(bp /* &fakeIdx */)).FszIdxRow = (*Table)(unsafe.Pointer(pTable)).FszTabRow
decodeIntArray(tls, z, 1, uintptr(0), (pTable + 74 /* &.nRowLogEst */), bp /* &fakeIdx */)
@@ -84251,9 +87509,246 @@ func analysisLoader(tls *crt.TLS, pData uintptr, argc int32, argv uintptr, NotUs
// If the Index.aSample variable is not NULL, delete the aSample[] array
// and its contents.
-func Xsqlite3DeleteIndexSamples(tls *crt.TLS, db uintptr, pIdx uintptr) { /* sqlite3.c:108912:21: */
- _ = db
- _ = pIdx
+func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr) { /* sqlite3.c:109160:21: */
+ if (*Index)(unsafe.Pointer(pIdx)).FaSample != 0 {
+ var j int32
+ for j = 0; j < (*Index)(unsafe.Pointer(pIdx)).FnSample; j++ {
+ var p uintptr = ((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(j)*40)
+ Xsqlite3DbFree(tls, db, (*IndexSample)(unsafe.Pointer(p)).Fp)
+ }
+ Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(pIdx)).FaSample)
+ }
+ if (db != 0) && ((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0)) {
+ (*Index)(unsafe.Pointer(pIdx)).FnSample = 0
+ (*Index)(unsafe.Pointer(pIdx)).FaSample = uintptr(0)
+ }
+}
+
+// Populate the pIdx->aAvgEq[] array based on the samples currently
+// stored in pIdx->aSample[].
+func initAvgEq(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:109185:13: */
+ if pIdx != 0 {
+ var aSample uintptr = (*Index)(unsafe.Pointer(pIdx)).FaSample
+ var pFinal uintptr = (aSample + uintptr(((*Index)(unsafe.Pointer(pIdx)).FnSample-1))*40)
+ var iCol int32
+ var nCol int32 = 1
+ if (*Index)(unsafe.Pointer(pIdx)).FnSampleCol > 1 {
+ // If this is stat4 data, then calculate aAvgEq[] values for all
+ // sample columns except the last. The last is always set to 1, as
+ // once the trailing PK fields are considered all index keys are
+ // unique.
+ nCol = ((*Index)(unsafe.Pointer(pIdx)).FnSampleCol - 1)
+ *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaAvgEq + uintptr(nCol)*4)) = TRowcnt(1)
+ }
+ for iCol = 0; iCol < nCol; iCol++ {
+ var nSample int32 = (*Index)(unsafe.Pointer(pIdx)).FnSample
+ var i int32 // Used to iterate through samples
+ var sumEq TRowcnt = TRowcnt(0) // Sum of the nEq values
+ var avgEq TRowcnt = TRowcnt(0)
+ var nRow TRowcnt // Number of rows in index
+ var nSum100 I64 = int64(0) // Number of terms contributing to sumEq
+ var nDist100 I64 // Number of distinct values in index
+
+ if (!(int32((*Index)(unsafe.Pointer(pIdx)).FaiRowEst) != 0) || (iCol >= int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol))) || (*(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr((iCol+1))*4)) == TRowcnt(0)) {
+ nRow = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(pFinal)).FanLt + uintptr(iCol)*4))
+ nDist100 = (int64(100) * I64(*(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(pFinal)).FanDLt + uintptr(iCol)*4))))
+ nSample--
+ } else {
+ nRow = *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr(0)*4))
+ nDist100 = ((int64(100) * I64(*(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr(0)*4)))) / I64(*(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowEst + uintptr((iCol+1))*4))))
+ }
+ (*Index)(unsafe.Pointer(pIdx)).FnRowEst0 = nRow
+
+ // Set nSum to the number of distinct (iCol+1) field prefixes that
+ // occur in the stat4 table for this index. Set sumEq to the sum of
+ // the nEq values for column iCol for the same set (adding the value
+ // only once where there exist duplicate prefixes).
+ for i = 0; i < nSample; i++ {
+ if (i == ((*Index)(unsafe.Pointer(pIdx)).FnSample - 1)) ||
+ (*(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*40)).FanDLt + uintptr(iCol)*4)) != *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr((i+1))*40)).FanDLt + uintptr(iCol)*4))) {
+ sumEq = sumEq + (*(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*40)).FanEq + uintptr(iCol)*4)))
+ nSum100 = nSum100 + (int64(100))
+ }
+ }
+
+ if (nDist100 > nSum100) && (sumEq < nRow) {
+ avgEq = (TRowcnt((int64(100) * (I64(nRow - sumEq))) / (nDist100 - nSum100)))
+ }
+ if avgEq == TRowcnt(0) {
+ avgEq = TRowcnt(1)
+ }
+ *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaAvgEq + uintptr(iCol)*4)) = avgEq
+ }
+ }
+}
+
+// Look up an index by name. Or, if the name of a WITHOUT ROWID table
+// is supplied instead, find the PRIMARY KEY index for that table.
+func findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:109244:14: */
+ var pIdx uintptr = Xsqlite3FindIndex(tls, db, zName, zDb)
+ if pIdx == uintptr(0) {
+ var pTab uintptr = Xsqlite3FindTable(tls, db, zName, zDb)
+ if (pTab != 0) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) {
+ pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab)
+ }
+ }
+ return pIdx
+}
+
+// Load the content from either the sqlite_stat4
+// into the relevant Index.aSample[] arrays.
+//
+// Arguments zSql1 and zSql2 must point to SQL statements that return
+// data equivalent to the following:
+//
+// zSql1: SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx
+// zSql2: SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4
+//
+// where %Q is replaced with the database name before the SQL is executed.
+func loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb uintptr) int32 { /* sqlite3.c:109269:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var rc int32 // Result codes from subroutines
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)) = uintptr(0) // An SQL statement being run
+ var zSql uintptr // Text of the SQL statement
+ var pPrevIdx uintptr = uintptr(0) // Previous index in the loop
+ var pSample uintptr // A slot in pIdx->aSample[]
+
+ zSql = Xsqlite3MPrintf(tls, db, zSql1, libc.VaList(bp, zDb))
+ if !(zSql != 0) {
+ return 7
+ }
+ rc = Xsqlite3_prepare(tls, db, zSql, -1, bp+16 /* &pStmt */, uintptr(0))
+ Xsqlite3DbFree(tls, db, zSql)
+ if rc != 0 {
+ return rc
+ }
+
+ for Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))) == 100 {
+ var nIdxCol int32 = 1 // Number of columns in stat4 records
+
+ var zIndex uintptr // Index name
+ var pIdx uintptr // Pointer to the index object
+ var nSample int32 // Number of samples
+ var nByte int32 // Bytes of space required
+ var i int32 // Bytes of space required
+ var pSpace uintptr
+
+ zIndex = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 0)
+ if zIndex == uintptr(0) {
+ continue
+ }
+ nSample = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 1)
+ pIdx = findIndexOrPrimaryKey(tls, db, zIndex, zDb)
+
+ if pIdx == uintptr(0) {
+ continue
+ }
+
+ if !(((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(0x0080)) == U32(0)) && (int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */))&0x3>>0) == 2) {
+ nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
+ } else {
+ nIdxCol = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
+ }
+ (*Index)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol
+ nByte = (int32(uint64(unsafe.Sizeof(IndexSample{})) * uint64(nSample)))
+ nByte = int32(uint64(nByte) + (((uint64(unsafe.Sizeof(TRowcnt(0))) * uint64(nIdxCol)) * uint64(3)) * uint64(nSample)))
+ nByte = int32(uint64(nByte) + (uint64(nIdxCol) * uint64(unsafe.Sizeof(TRowcnt(0))))) // Space for Index.aAvgEq[]
+
+ (*Index)(unsafe.Pointer(pIdx)).FaSample = Xsqlite3DbMallocZero(tls, db, uint64(nByte))
+ if (*Index)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) {
+ Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)))
+ return 7
+ }
+ pSpace = ((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(nSample)*40)
+ (*Index)(unsafe.Pointer(pIdx)).FaAvgEq = pSpace
+ pSpace += 4 * (uintptr(nIdxCol))
+ for i = 0; i < nSample; i++ {
+ (*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(i)*40)).FanEq = pSpace
+ pSpace += 4 * (uintptr(nIdxCol))
+ (*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(i)*40)).FanLt = pSpace
+ pSpace += 4 * (uintptr(nIdxCol))
+ (*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr(i)*40)).FanDLt = pSpace
+ pSpace += 4 * (uintptr(nIdxCol))
+ }
+ }
+ rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)))
+ if rc != 0 {
+ return rc
+ }
+
+ zSql = Xsqlite3MPrintf(tls, db, zSql2, libc.VaList(bp+8, zDb))
+ if !(zSql != 0) {
+ return 7
+ }
+ rc = Xsqlite3_prepare(tls, db, zSql, -1, bp+16 /* &pStmt */, uintptr(0))
+ Xsqlite3DbFree(tls, db, zSql)
+ if rc != 0 {
+ return rc
+ }
+
+ for Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))) == 100 {
+ var zIndex uintptr // Index name
+ var pIdx uintptr // Pointer to the index object
+ var nCol int32 = 1 // Number of columns in index
+
+ zIndex = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 0)
+ if zIndex == uintptr(0) {
+ continue
+ }
+ pIdx = findIndexOrPrimaryKey(tls, db, zIndex, zDb)
+ if pIdx == uintptr(0) {
+ continue
+ }
+ // This next condition is true if data has already been loaded from
+ // the sqlite_stat4 table.
+ nCol = (*Index)(unsafe.Pointer(pIdx)).FnSampleCol
+ if pIdx != pPrevIdx {
+ initAvgEq(tls, pPrevIdx)
+ pPrevIdx = pIdx
+ }
+ pSample = ((*Index)(unsafe.Pointer(pIdx)).FaSample + uintptr((*Index)(unsafe.Pointer(pIdx)).FnSample)*40)
+ decodeIntArray(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 1), nCol, (*IndexSample)(unsafe.Pointer(pSample)).FanEq, uintptr(0), uintptr(0))
+ decodeIntArray(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 2), nCol, (*IndexSample)(unsafe.Pointer(pSample)).FanLt, uintptr(0), uintptr(0))
+ decodeIntArray(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 3), nCol, (*IndexSample)(unsafe.Pointer(pSample)).FanDLt, uintptr(0), uintptr(0))
+
+ // Take a copy of the sample. Add two 0x00 bytes the end of the buffer.
+ // This is in case the sample record is corrupted. In that case, the
+ // sqlite3VdbeRecordCompare() may read up to two varints past the
+ // end of the allocated buffer before it realizes it is dealing with
+ // a corrupt record. Adding the two 0x00 bytes prevents this from causing
+ // a buffer overread.
+ (*IndexSample)(unsafe.Pointer(pSample)).Fn = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 4)
+ (*IndexSample)(unsafe.Pointer(pSample)).Fp = Xsqlite3DbMallocZero(tls, db, (uint64((*IndexSample)(unsafe.Pointer(pSample)).Fn + 2)))
+ if (*IndexSample)(unsafe.Pointer(pSample)).Fp == uintptr(0) {
+ Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)))
+ return 7
+ }
+ if (*IndexSample)(unsafe.Pointer(pSample)).Fn != 0 {
+ libc.Xmemcpy(tls, (*IndexSample)(unsafe.Pointer(pSample)).Fp, Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 4), uint64((*IndexSample)(unsafe.Pointer(pSample)).Fn))
+ }
+ (*Index)(unsafe.Pointer(pIdx)).FnSample++
+ }
+ rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)))
+ if rc == 0 {
+ initAvgEq(tls, pPrevIdx)
+ }
+ return rc
+}
+
+// Load content from the sqlite_stat4 table into
+// the Index.aSample[] arrays of all indices.
+func loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:109389:12: */
+ var rc int32 = 0 // Result codes from subroutines
+
+ if Xsqlite3FindTable(tls, db, ts+12464 /* "sqlite_stat4" */, zDb) != 0 {
+ rc = loadStatTbl(tls, db,
+ ts+12650, /* "SELECT idx,count..." */
+ ts+12704, /* "SELECT idx,neq,n..." */
+ zDb)
+ }
+ return rc
}
// Load the content of the sqlite_stat1 and sqlite_stat4 tables. The
@@ -84274,7 +87769,7 @@ func Xsqlite3DeleteIndexSamples(tls *crt.TLS, db uintptr, pIdx uintptr) { /* sql
// If an OOM error occurs, this function always sets db->mallocFailed.
// This means if the caller does not care about other errors, the return
// code may be ignored.
-func Xsqlite3AnalysisLoad(tls *crt.TLS, db uintptr, iDb int32) int32 { /* sqlite3.c:109176:20: */
+func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32 { /* sqlite3.c:109424:20: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -84289,24 +87784,26 @@ func Xsqlite3AnalysisLoad(tls *crt.TLS, db uintptr, iDb int32) int32 { /* sqlite
for i = (*Hash)(unsafe.Pointer((pSchema + 8 /* &.tblHash */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pTab uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
- *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) &= (^U32(crt.Int32FromInt32(0x0010)))
+ *(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) &= (^U32(libc.Int32FromInt32(0x0010)))
}
for i = (*Hash)(unsafe.Pointer((pSchema + 32 /* &.idxHash */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pIdx uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
- crt.SetBitFieldPtr16Uint32(pIdx+100 /* &.hasStat1 */, uint32(0), 7, 0x80)
+ libc.SetBitFieldPtr16Uint32(pIdx+100 /* &.hasStat1 */, uint32(0), 7, 0x80)
+ Xsqlite3DeleteIndexSamples(tls, db, pIdx)
+ (*Index)(unsafe.Pointer(pIdx)).FaSample = uintptr(0)
}
// Load new statistics out of the sqlite_stat1 table
(*AnalysisInfo)(unsafe.Pointer(bp + 8 /* &sInfo */)).Fdb = db
(*AnalysisInfo)(unsafe.Pointer(bp + 8 /* &sInfo */)).FzDatabase = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
- if Xsqlite3FindTable(tls, db, ts+9925 /* "sqlite_stat1" */, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase) != uintptr(0) {
+ if Xsqlite3FindTable(tls, db, ts+12438 /* "sqlite_stat1" */, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase) != uintptr(0) {
zSql = Xsqlite3MPrintf(tls, db,
- ts+10072 /* "SELECT tbl,idx,s..." */, crt.VaList(bp, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase))
+ ts+12756 /* "SELECT tbl,idx,s..." */, libc.VaList(bp, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase))
if zSql == uintptr(0) {
rc = 7
} else {
rc = Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{analysisLoader})), bp+8 /* &sInfo */, uintptr(0))
Xsqlite3DbFree(tls, db, zSql)
}
@@ -84322,6 +87819,23 @@ func Xsqlite3AnalysisLoad(tls *crt.TLS, db uintptr, iDb int32) int32 { /* sqlite
}
// Load the statistics from the sqlite_stat4 table.
+ if rc == 0 {
+ (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++
+ (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
+ rc = loadStat4(tls, db, (*AnalysisInfo)(unsafe.Pointer(bp+8 /* &sInfo */)).FzDatabase)
+ (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable--
+ (*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 {
+ if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 {
+ return uint16(0)
+ }
+ return (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FszTrue
+ }()
+ }
+ for i = (*Hash)(unsafe.Pointer((pSchema + 32 /* &.idxHash */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
+ var pIdx uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
+ Xsqlite3_free(tls, (*Index)(unsafe.Pointer(pIdx)).FaiRowEst)
+ (*Index)(unsafe.Pointer(pIdx)).FaiRowEst = uintptr(0)
+ }
if rc == 7 {
Xsqlite3OomFault(tls, db)
@@ -84360,7 +87874,7 @@ func Xsqlite3AnalysisLoad(tls *crt.TLS, db uintptr, iDb int32) int32 { /* sqlite
// ATTACH DATABASE abc||def AS 'db2'
//
// will fail because neither abc or def can be resolved.
-func resolveAttachExpr(tls *crt.TLS, pName uintptr, pExpr uintptr) int32 { /* sqlite3.c:109281:12: */
+func resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) int32 { /* sqlite3.c:109529:12: */
var rc int32 = 0
if pExpr != 0 {
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != 59 {
@@ -84374,9 +87888,9 @@ func resolveAttachExpr(tls *crt.TLS, pName uintptr, pExpr uintptr) int32 { /* sq
// Return true if zName points to a name that may be used to refer to
// database iDb attached to handle db.
-func Xsqlite3DbIsNamed(tls *crt.TLS, db uintptr, iDb int32, zName uintptr) int32 { /* sqlite3.c:109298:20: */
- return (crt.Bool32((Xsqlite3StrICmp(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zName) == 0) ||
- ((iDb == 0) && (Xsqlite3StrICmp(tls, ts+6116 /* "main" */, zName) == 0))))
+func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int32 { /* sqlite3.c:109546:20: */
+ return (libc.Bool32((Xsqlite3StrICmp(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zName) == 0) ||
+ ((iDb == 0) && (Xsqlite3StrICmp(tls, ts+8314 /* "main" */, zName) == 0))))
}
// An SQL user-function registered to do the work of an ATTACH statement. The
@@ -84392,7 +87906,7 @@ func Xsqlite3DbIsNamed(tls *crt.TLS, db uintptr, iDb int32, zName uintptr) int32
// If the db->init.reopenMemdb flags is set, then instead of attaching a
// new database, close the database on db->init.iDb and reopen it as an
// empty MemDB.
-func attachFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109320:13: */
+func attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109568:13: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -84427,13 +87941,13 @@ func attachFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /*
if !(zFile == uintptr(0)) {
goto __1
}
- zFile = ts + 672 /* "" */
+ zFile = ts + 781 /* "" */
__1:
;
if !(zName == uintptr(0)) {
goto __2
}
- zName = ts + 672 /* "" */
+ zName = ts + 781 /* "" */
__2:
;
@@ -84443,7 +87957,7 @@ __2:
// This is not a real ATTACH. Instead, this routine is being called
// from sqlite3_deserialize() to close database db->init.iDb and
// reopen it as a MemDB
- *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)) = Xsqlite3_vfs_find(tls, ts+3352 /* "memdb" */)
+ *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)) = Xsqlite3_vfs_find(tls, ts+5487 /* "memdb" */)
if !(*(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)) == uintptr(0)) {
goto __5
}
@@ -84459,7 +87973,7 @@ __6:
;
(*Db)(unsafe.Pointer(pNew)).FpBt = uintptr(0)
(*Db)(unsafe.Pointer(pNew)).FpSchema = uintptr(0)
- rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)), ts+10113 /* "x\x00" */, db, (pNew + 8 /* &.pBt */), 0, 0x00000100)
+ rc = Xsqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* pVfs */)), ts+12797 /* "x\x00" */, db, (pNew + 8 /* &.pBt */), 0, 0x00000100)
goto __4
__3:
// This is a real ATTACH
@@ -84472,8 +87986,8 @@ __3:
if !((*Sqlite3)(unsafe.Pointer(db)).FnDb >= (*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(7)*4)) + 2)) {
goto __7
}
- *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+10116, /* "too many attache..." */
- crt.VaList(bp, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(7)*4))))
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+12800, /* "too many attache..." */
+ libc.VaList(bp, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(7)*4))))
goto attach_error
__7:
;
@@ -84486,7 +88000,7 @@ __8:
if !(Xsqlite3DbIsNamed(tls, db, i, zName) != 0) {
goto __11
}
- *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+10153 /* "database %s is a..." */, crt.VaList(bp+8, zName))
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+12837 /* "database %s is a..." */, libc.VaList(bp+8, zName))
goto attach_error
__11:
;
@@ -84500,7 +88014,7 @@ __10:
// Allocate the new entry in the db->aDb[] array and initialize the schema
// hash tables.
- if !((*Sqlite3)(unsafe.Pointer(db)).FaDb == db+624 /* &.aDbStatic */) {
+ if !((*Sqlite3)(unsafe.Pointer(db)).FaDb == db+648 /* &.aDbStatic */) {
goto __12
}
aNew = Xsqlite3DbMallocRawNN(tls, db, (uint64(unsafe.Sizeof(Db{})) * uint64(3)))
@@ -84510,7 +88024,7 @@ __10:
return
__14:
;
- crt.Xmemcpy(tls, aNew, (*Sqlite3)(unsafe.Pointer(db)).FaDb, (uint64(unsafe.Sizeof(Db{})) * uint64(2)))
+ libc.Xmemcpy(tls, aNew, (*Sqlite3)(unsafe.Pointer(db)).FaDb, (uint64(unsafe.Sizeof(Db{})) * uint64(2)))
goto __13
__12:
aNew = Xsqlite3DbRealloc(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaDb, (uint64(uint64(unsafe.Sizeof(Db{})) * (uint64((*Sqlite3)(unsafe.Pointer(db)).FnDb + 1)))))
@@ -84524,7 +88038,7 @@ __13:
;
(*Sqlite3)(unsafe.Pointer(db)).FaDb = aNew
pNew = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Sqlite3)(unsafe.Pointer(db)).FnDb)*32)
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Db{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Db{})))
// Open the database file. If the btree is successfully opened, use
// it to obtain the database schema. At this point the schema may
@@ -84557,7 +88071,7 @@ __4:
goto __18
}
rc = 1
- *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+10183 /* "database is alre..." */, 0)
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+12867 /* "database is alre..." */, 0)
goto __19
__18:
if !(rc == 0) {
@@ -84574,7 +88088,7 @@ __21:
goto __23
}
*(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db,
- ts+10212 /* "attached databas..." */, 0)
+ ts+12896 /* "attached databas..." */, 0)
rc = 1
__23:
;
@@ -84610,7 +88124,7 @@ __24:
}
Xsqlite3BtreeEnterAll(tls, db)
(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(0)
- *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (^U32(crt.Int32FromInt32(0x0010)))
+ *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (^U32(libc.Int32FromInt32(0x0010)))
if !(!(int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.reopenMemdb */))&0x4>>2) != 0)) {
goto __26
}
@@ -84643,13 +88157,13 @@ __29:
}
Xsqlite3OomFault(tls, db)
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)))
- *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+5549 /* "out of memory" */, 0)
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+7747 /* "out of memory" */, 0)
goto __31
__30:
if !(*(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) == uintptr(0)) {
goto __32
}
- *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+10280 /* "unable to open d..." */, crt.VaList(bp+16, zFile))
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* zErrDyn */)) = Xsqlite3MPrintf(tls, db, ts+12964 /* "unable to open d..." */, libc.VaList(bp+16, zFile))
__32:
;
__31:
@@ -84684,7 +88198,7 @@ __34:
// DETACH DATABASE x
//
// SELECT sqlite_detach(x)
-func detachFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109513:13: */
+func detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:109761:13: */
bp := tls.Alloc(152)
defer tls.Free(152)
@@ -84705,7 +88219,7 @@ func detachFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /*
if !(zName == uintptr(0)) {
goto __1
}
- zName = ts + 672 /* "" */
+ zName = ts + 781 /* "" */
__1:
;
i = 0
@@ -84737,21 +88251,21 @@ __4:
if !(i >= (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
goto __7
}
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+10308 /* "no such database..." */, crt.VaList(bp, zName))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+12992 /* "no such database..." */, libc.VaList(bp, zName))
goto detach_error
__7:
;
if !(i < 2) {
goto __8
}
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+10329 /* "cannot detach da..." */, crt.VaList(bp+8, zName))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+13013 /* "cannot detach da..." */, libc.VaList(bp+8, zName))
goto detach_error
__8:
;
if !((Xsqlite3BtreeIsInReadTrans(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0) || (Xsqlite3BtreeIsInBackup(tls, (*Db)(unsafe.Pointer(pDb)).FpBt) != 0)) {
goto __9
}
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+10355 /* "database %s is l..." */, crt.VaList(bp+16, zName))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([128]int8{})), bp+24 /* &zErr[0] */, ts+13039 /* "database %s is l..." */, libc.VaList(bp+16, zName))
goto detach_error
__9:
;
@@ -84788,7 +88302,7 @@ detach_error:
// This procedure generates VDBE code for a single invocation of either the
// sqlite_detach() or sqlite_attach() SQL user functions.
-func codeAttach(tls *crt.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAuthArg uintptr, pFilename uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:109573:13: */
+func codeAttach(tls *libc.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAuthArg uintptr, pFilename uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:109821:13: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -84807,10 +88321,10 @@ func codeAttach(tls *crt.TLS, pParse uintptr, type1 int32, pFunc uintptr, pAuthA
goto attach_end
__1:
;
- crt.Xmemset(tls, bp /* &sName */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp /* &sName */, 0, uint64(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp /* &sName */)).FpParse = pParse
- if !(((0 != (crt.AssignInt32(&rc, resolveAttachExpr(tls, bp /* &sName */, pFilename)))) || (0 != (crt.AssignInt32(&rc, resolveAttachExpr(tls, bp /* &sName */, pDbname))))) || (0 != (crt.AssignInt32(&rc, resolveAttachExpr(tls, bp /* &sName */, pKey))))) {
+ if !(((0 != (libc.AssignInt32(&rc, resolveAttachExpr(tls, bp /* &sName */, pFilename)))) || (0 != (libc.AssignInt32(&rc, resolveAttachExpr(tls, bp /* &sName */, pDbname))))) || (0 != (libc.AssignInt32(&rc, resolveAttachExpr(tls, bp /* &sName */, pKey))))) {
goto __2
}
goto attach_end
@@ -84853,7 +88367,7 @@ __3:
// Code an OP_Expire. For an ATTACH statement, set P1 to true (expire this
// statement only). For DETACH, set it to false (expire all existing
// statements).
- Xsqlite3VdbeAddOp1(tls, v, 158, (crt.Bool32(type1 == 24)))
+ Xsqlite3VdbeAddOp1(tls, v, 158, (libc.Bool32(type1 == 24)))
__7:
;
@@ -84866,7 +88380,7 @@ attach_end:
// Called by the parser to compile a DETACH statement.
//
// DETACH pDbname
-func Xsqlite3Detach(tls *crt.TLS, pParse uintptr, pDbname uintptr) { /* sqlite3.c:109644:21: */
+func Xsqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { /* sqlite3.c:109892:21: */
codeAttach(tls, pParse, 25, uintptr(unsafe.Pointer(&detach_func)), pDbname, uintptr(0), uintptr(0), pDbname)
}
@@ -84877,14 +88391,14 @@ uintptr(0), FxSFunc:// pNext
0, FxFinalize:// xSFunc
uintptr(0), FxValue:// xFinalize
uintptr(0), FxInverse: uintptr(0), FzName: // xValue, xInverse
-ts + 10377, /* "sqlite_detach" */ Fu:// zName
+ts + 13061, /* "sqlite_detach" */ Fu:// zName
struct{ FpHash uintptr }{FpHash: uintptr(0)},
-} /* sqlite3.c:109645:24 */
+} /* sqlite3.c:109893:24 */
// Called by the parser to compile an ATTACH statement.
//
// ATTACH p AS pDbname KEY pKey
-func Xsqlite3Attach(tls *crt.TLS, pParse uintptr, p uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:109664:21: */
+func Xsqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, pKey uintptr) { /* sqlite3.c:109912:21: */
codeAttach(tls, pParse, 24, uintptr(unsafe.Pointer(&attach_func)), p, p, pDbname, pKey)
}
@@ -84895,13 +88409,13 @@ uintptr(0), FxSFunc:// pNext
0, FxFinalize:// xSFunc
uintptr(0), FxValue:// xFinalize
uintptr(0), FxInverse: uintptr(0), FzName: // xValue, xInverse
-ts + 10391, /* "sqlite_attach" */ Fu:// zName
+ts + 13075, /* "sqlite_attach" */ Fu:// zName
struct{ FpHash uintptr }{FpHash: uintptr(0)},
-} /* sqlite3.c:109665:24 */
+} /* sqlite3.c:109913:24 */
// Initialize a DbFixer structure. This routine must be called prior
// to passing the structure to one of the sqliteFixAAAA() routines below.
-func Xsqlite3FixInit(tls *crt.TLS, pFix uintptr, pParse uintptr, iDb int32, zType uintptr, pName uintptr) { /* sqlite3.c:109684:21: */
+func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zType uintptr, pName uintptr) { /* sqlite3.c:109932:21: */
var db uintptr
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
@@ -84911,7 +88425,7 @@ func Xsqlite3FixInit(tls *crt.TLS, pFix uintptr, pParse uintptr, iDb int32, zTyp
(*DbFixer)(unsafe.Pointer(pFix)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
(*DbFixer)(unsafe.Pointer(pFix)).FzType = zType
(*DbFixer)(unsafe.Pointer(pFix)).FpName = pName
- (*DbFixer)(unsafe.Pointer(pFix)).FbTemp = (U8(crt.Bool32(iDb == 1)))
+ (*DbFixer)(unsafe.Pointer(pFix)).FbTemp = (U8(libc.Bool32(iDb == 1)))
}
// The following set of routines walk through the parse tree and assign
@@ -84926,7 +88440,7 @@ func Xsqlite3FixInit(tls *crt.TLS, pFix uintptr, pParse uintptr, iDb int32, zTyp
// to an object in a different database, an error message is added to
// pParse->zErrMsg and these routines return non-zero. If everything
// checks out, these routines return 0.
-func Xsqlite3FixSrcList(tls *crt.TLS, pFix uintptr, pList uintptr) int32 { /* sqlite3.c:109717:20: */
+func Xsqlite3FixSrcList(tls *libc.TLS, pFix uintptr, pList uintptr) int32 { /* sqlite3.c:109965:20: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -84949,14 +88463,14 @@ __1:
if int32((*DbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 {
if ((*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase != 0) && (iDb != Xsqlite3FindDbName(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase)) {
Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse,
- ts+10405, /* "%s %T cannot ref..." */
- crt.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType, (*DbFixer)(unsafe.Pointer(pFix)).FpName, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase))
+ ts+13089, /* "%s %T cannot ref..." */
+ libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType, (*DbFixer)(unsafe.Pointer(pFix)).FpName, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase))
return 1
}
Xsqlite3DbFree(tls, db, (*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase)
(*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0)
(*SrcList_item)(unsafe.Pointer(pItem)).FpSchema = (*DbFixer)(unsafe.Pointer(pFix)).FpSchema
- crt.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.fromDDL */, uint32(1), 6, 0x40)
+ libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.fromDDL */, uint32(1), 6, 0x40)
}
if Xsqlite3FixSelect(tls, pFix, (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect) != 0 {
return 1
@@ -84978,7 +88492,7 @@ __3:
;
return 0
}
-func Xsqlite3FixSelect(tls *crt.TLS, pFix uintptr, pSelect uintptr) int32 { /* sqlite3.c:109752:20: */
+func Xsqlite3FixSelect(tls *libc.TLS, pFix uintptr, pSelect uintptr) int32 { /* sqlite3.c:110000:20: */
for pSelect != 0 {
if Xsqlite3FixExprList(tls, pFix, (*Select)(unsafe.Pointer(pSelect)).FpEList) != 0 {
return 1
@@ -85013,7 +88527,7 @@ func Xsqlite3FixSelect(tls *crt.TLS, pFix uintptr, pSelect uintptr) int32 { /* s
}
return 0
}
-func Xsqlite3FixExpr(tls *crt.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqlite3.c:109790:20: */
+func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqlite3.c:110038:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -85025,7 +88539,7 @@ func Xsqlite3FixExpr(tls *crt.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqlit
if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*DbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit.Fbusy != 0 {
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(119)
} else {
- Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, ts+10451 /* "%s cannot use va..." */, crt.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType))
+ Xsqlite3ErrorMsg(tls, (*DbFixer)(unsafe.Pointer(pFix)).FpParse, ts+13135 /* "%s cannot use va..." */, libc.VaList(bp, (*DbFixer)(unsafe.Pointer(pFix)).FzType))
return 1
}
}
@@ -85048,7 +88562,7 @@ func Xsqlite3FixExpr(tls *crt.TLS, pFix uintptr, pExpr uintptr) int32 { /* sqlit
}
return 0
}
-func Xsqlite3FixExprList(tls *crt.TLS, pFix uintptr, pList uintptr) int32 { /* sqlite3.c:109817:20: */
+func Xsqlite3FixExprList(tls *libc.TLS, pFix uintptr, pList uintptr) int32 { /* sqlite3.c:110065:20: */
var i int32
var pItem uintptr
if pList == uintptr(0) {
@@ -85076,7 +88590,7 @@ __3:
return 0
}
-func Xsqlite3FixTriggerStep(tls *crt.TLS, pFix uintptr, pStep uintptr) int32 { /* sqlite3.c:109834:20: */
+func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32 { /* sqlite3.c:110082:20: */
for pStep != 0 {
if Xsqlite3FixSelect(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect) != 0 {
return 1
@@ -85087,6 +88601,9 @@ func Xsqlite3FixTriggerStep(tls *crt.TLS, pFix uintptr, pStep uintptr) int32 { /
if Xsqlite3FixExprList(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList) != 0 {
return 1
}
+ if ((*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0) && (Xsqlite3FixSrcList(tls, pFix, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom) != 0) {
+ return 1
+ }
if (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert != 0 {
var pUp uintptr = (*TriggerStep)(unsafe.Pointer(pStep)).FpUpsert
if (((Xsqlite3FixExprList(tls, pFix, (*Upsert)(unsafe.Pointer(pUp)).FpUpsertTarget) != 0) ||
@@ -85165,7 +88682,7 @@ func Xsqlite3FixTriggerStep(tls *crt.TLS, pFix uintptr, pStep uintptr) int32 { /
//
// Setting the auth function to NULL disables this hook. The default
// setting of the auth function is NULL.
-func Xsqlite3_set_authorizer(tls *crt.TLS, db uintptr, xAuth uintptr, pArg uintptr) int32 { /* sqlite3.c:109937:16: */
+func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) int32 { /* sqlite3.c:110188:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth
(*Sqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg
@@ -85178,8 +88695,8 @@ func Xsqlite3_set_authorizer(tls *crt.TLS, db uintptr, xAuth uintptr, pArg uintp
// Write an error message into pParse->zErrMsg that explains that the
// user-supplied authorization function returned an illegal value.
-func sqliteAuthBadReturnCode(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:109957:13: */
- Xsqlite3ErrorMsg(tls, pParse, ts+10475 /* "authorizer malfu..." */, 0)
+func sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110208:13: */
+ Xsqlite3ErrorMsg(tls, pParse, ts+13159 /* "authorizer malfu..." */, 0)
(*Parse)(unsafe.Pointer(pParse)).Frc = 1
}
@@ -85190,7 +88707,7 @@ func sqliteAuthBadReturnCode(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:109957
// If SQLITE_IGNORE is returned and pExpr is not NULL, then pExpr is changed
// to an SQL NULL expression. Otherwise, if pExpr is NULL, then SQLITE_IGNORE
// is treated as SQLITE_DENY. In this case an error is left in pParse.
-func Xsqlite3AuthReadCol(tls *crt.TLS, pParse uintptr, zTab uintptr, zCol uintptr, iDb int32) int32 { /* sqlite3.c:109971:20: */
+func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintptr, iDb int32) int32 { /* sqlite3.c:110222:20: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -85201,13 +88718,13 @@ func Xsqlite3AuthReadCol(tls *crt.TLS, pParse uintptr, zTab uintptr, zCol uintpt
if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
return 0
}
- rc = (*(*func(*crt.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 464 /* &.xAuth */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, 20, zTab, zCol, zDb, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext)
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 488 /* &.xAuth */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, 20, zTab, zCol, zDb, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext)
if rc == 1 {
- var z uintptr = Xsqlite3_mprintf(tls, ts+10498 /* "%s.%s" */, crt.VaList(bp, zTab, zCol))
+ var z uintptr = Xsqlite3_mprintf(tls, ts+9978 /* "%s.%s" */, libc.VaList(bp, zTab, zCol))
if ((*Sqlite3)(unsafe.Pointer(db)).FnDb > 2) || (iDb != 0) {
- z = Xsqlite3_mprintf(tls, ts+10504 /* "%s.%z" */, crt.VaList(bp+16, zDb, z))
+ z = Xsqlite3_mprintf(tls, ts+13182 /* "%s.%z" */, libc.VaList(bp+16, zDb, z))
}
- Xsqlite3ErrorMsg(tls, pParse, ts+10510 /* "access to %z is ..." */, crt.VaList(bp+32, z))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13188 /* "access to %z is ..." */, libc.VaList(bp+32, z))
(*Parse)(unsafe.Pointer(pParse)).Frc = 23
} else if (rc != 2) && (rc != 0) {
sqliteAuthBadReturnCode(tls, pParse)
@@ -85222,7 +88739,7 @@ func Xsqlite3AuthReadCol(tls *crt.TLS, pParse uintptr, zTab uintptr, zCol uintpt
// If the auth function returns SQLITE_IGNORE, change the TK_COLUMN
// instruction into a TK_NULL. If the auth function returns SQLITE_DENY,
// then generate an error.
-func Xsqlite3AuthRead(tls *crt.TLS, pParse uintptr, pExpr uintptr, pSchema uintptr, pTabList uintptr) { /* sqlite3.c:110007:21: */
+func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uintptr, pTabList uintptr) { /* sqlite3.c:110258:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pTab uintptr = uintptr(0) // The table being read
var zCol uintptr // Name of the column of the table
@@ -85263,7 +88780,7 @@ func Xsqlite3AuthRead(tls *crt.TLS, pParse uintptr, pExpr uintptr, pSchema uintp
zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*32)).FzName
} else {
- zCol = ts + 7298 /* "ROWID" */
+ zCol = ts + 9544 /* "ROWID" */
}
if 2 == Xsqlite3AuthReadCol(tls, pParse, (*Table)(unsafe.Pointer(pTab)).FzName, zCol, iDb) {
@@ -85275,7 +88792,7 @@ func Xsqlite3AuthRead(tls *crt.TLS, pParse uintptr, pExpr uintptr, pSchema uintp
// either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY
// is returned, then the error count and error message in pParse are
// modified appropriately.
-func Xsqlite3AuthCheck(tls *crt.TLS, pParse uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr) int32 { /* sqlite3.c:110065:20: */
+func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr) int32 { /* sqlite3.c:110316:20: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var rc int32
@@ -85297,9 +88814,9 @@ func Xsqlite3AuthCheck(tls *crt.TLS, pParse uintptr, code int32, zArg1 uintptr,
// The following testcase() macros show that any of the 3rd through 6th
// parameters can be either NULL or a string.
- rc = (*(*func(*crt.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 464 /* &.xAuth */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext)
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 488 /* &.xAuth */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*Parse)(unsafe.Pointer(pParse)).FzAuthContext)
if rc == 1 {
- Xsqlite3ErrorMsg(tls, pParse, ts+10537 /* "not authorized" */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+13215 /* "not authorized" */, 0)
(*Parse)(unsafe.Pointer(pParse)).Frc = 23
} else if (rc != 0) && (rc != 2) {
rc = 1
@@ -85311,7 +88828,7 @@ func Xsqlite3AuthCheck(tls *crt.TLS, pParse uintptr, code int32, zArg1 uintptr,
// Push an authorization context. After this routine is called, the
// zArg3 argument to authorization callbacks will be zContext until
// popped. Or if pParse==0, this routine is a no-op.
-func Xsqlite3AuthContextPush(tls *crt.TLS, pParse uintptr, pContext uintptr, zContext uintptr) { /* sqlite3.c:110118:21: */
+func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zContext uintptr) { /* sqlite3.c:110369:21: */
(*AuthContext)(unsafe.Pointer(pContext)).FpParse = pParse
(*AuthContext)(unsafe.Pointer(pContext)).FzAuthContext = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext
@@ -85320,7 +88837,7 @@ func Xsqlite3AuthContextPush(tls *crt.TLS, pParse uintptr, pContext uintptr, zCo
// Pop an authorization context that was previously pushed
// by sqlite3AuthContextPush
-func Xsqlite3AuthContextPop(tls *crt.TLS, pContext uintptr) { /* sqlite3.c:110133:21: */
+func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { /* sqlite3.c:110384:21: */
if (*AuthContext)(unsafe.Pointer(pContext)).FpParse != 0 {
(*Parse)(unsafe.Pointer((*AuthContext)(unsafe.Pointer(pContext)).FpParse)).FzAuthContext = (*AuthContext)(unsafe.Pointer(pContext)).FzAuthContext
(*AuthContext)(unsafe.Pointer(pContext)).FpParse = uintptr(0)
@@ -85335,7 +88852,7 @@ func Xsqlite3AuthContextPop(tls *crt.TLS, pContext uintptr) { /* sqlite3.c:11013
// This routine just records the fact that the lock is desired. The
// code to make the lock occur is generated by a later call to
// codeTableLocks() which occurs during sqlite3FinishCoding().
-func Xsqlite3TableLock(tls *crt.TLS, pParse uintptr, iDb int32, iTab int32, isWriteLock U8, zName uintptr) { /* sqlite3.c:110192:21: */
+func Xsqlite3TableLock(tls *libc.TLS, pParse uintptr, iDb int32, iTab Pgno, isWriteLock U8, zName uintptr) { /* sqlite3.c:110443:21: */
var pToplevel uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -85355,7 +88872,7 @@ func Xsqlite3TableLock(tls *crt.TLS, pParse uintptr, iDb int32, iTab int32, isWr
for i = 0; i < (*Parse)(unsafe.Pointer(pToplevel)).FnTableLock; i++ {
p = ((*Parse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(i)*24)
if ((*TableLock)(unsafe.Pointer(p)).FiDb == iDb) && ((*TableLock)(unsafe.Pointer(p)).FiTab == iTab) {
- (*TableLock)(unsafe.Pointer(p)).FisWriteLock = (U8(crt.Bool32(((*TableLock)(unsafe.Pointer(p)).FisWriteLock != 0) || (isWriteLock != 0))))
+ (*TableLock)(unsafe.Pointer(p)).FisWriteLock = (U8(libc.Bool32(((*TableLock)(unsafe.Pointer(p)).FisWriteLock != 0) || (isWriteLock != 0))))
return
}
}
@@ -85363,7 +88880,7 @@ func Xsqlite3TableLock(tls *crt.TLS, pParse uintptr, iDb int32, iTab int32, isWr
nBytes = (int32(uint64(unsafe.Sizeof(TableLock{})) * (uint64((*Parse)(unsafe.Pointer(pToplevel)).FnTableLock + 1))))
(*Parse)(unsafe.Pointer(pToplevel)).FaTableLock = Xsqlite3DbReallocOrFree(tls, (*Parse)(unsafe.Pointer(pToplevel)).Fdb, (*Parse)(unsafe.Pointer(pToplevel)).FaTableLock, uint64(nBytes))
if (*Parse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 {
- p = ((*Parse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pToplevel)).FnTableLock, 1))*24)
+ p = ((*Parse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pToplevel)).FnTableLock, 1))*24)
(*TableLock)(unsafe.Pointer(p)).FiDb = iDb
(*TableLock)(unsafe.Pointer(p)).FiTab = iTab
(*TableLock)(unsafe.Pointer(p)).FisWriteLock = isWriteLock
@@ -85376,7 +88893,7 @@ func Xsqlite3TableLock(tls *crt.TLS, pParse uintptr, iDb int32, iTab int32, isWr
// Code an OP_TableLock instruction for each table locked by the
// statement (configured by calls to sqlite3TableLock()).
-func codeTableLocks(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:110234:13: */
+func codeTableLocks(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110485:13: */
var i int32
var pVdbe uintptr
@@ -85386,7 +88903,7 @@ func codeTableLocks(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:110234:13: */
for i = 0; i < (*Parse)(unsafe.Pointer(pParse)).FnTableLock; i++ {
var p uintptr = ((*Parse)(unsafe.Pointer(pParse)).FaTableLock + uintptr(i)*24)
var p1 int32 = (*TableLock)(unsafe.Pointer(p)).FiDb
- Xsqlite3VdbeAddOp4(tls, pVdbe, 161, p1, (*TableLock)(unsafe.Pointer(p)).FiTab, int32((*TableLock)(unsafe.Pointer(p)).FisWriteLock),
+ Xsqlite3VdbeAddOp4(tls, pVdbe, 161, p1, int32((*TableLock)(unsafe.Pointer(p)).FiTab), int32((*TableLock)(unsafe.Pointer(p)).FisWriteLock),
(*TableLock)(unsafe.Pointer(p)).FzLockName, -1)
}
}
@@ -85403,7 +88920,10 @@ func codeTableLocks(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:110234:13: */
//
// Note that if an error occurred, it might be the case that
// no VDBE code was generated.
-func Xsqlite3FinishCoding(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:110275:21: */
+func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:110526:21: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
var db uintptr
var v uintptr
@@ -85438,7 +88958,7 @@ func Xsqlite3FinishCoding(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:110275:21
Xsqlite3VdbeJumpHere(tls, v, 0)
for iDb = 0; iDb < (*Sqlite3)(unsafe.Pointer(db)).FnDb; iDb++ {
var pSchema uintptr
- if (crt.Bool32((((*Parse)(unsafe.Pointer(pParse)).FcookieMask) & (YDbMask((YDbMask(1))) << (iDb))) != YDbMask(0))) == 0 {
+ if (libc.Bool32((((*Parse)(unsafe.Pointer(pParse)).FcookieMask) & (YDbMask((YDbMask(1))) << (iDb))) != YDbMask(0))) == 0 {
continue
}
Xsqlite3VdbeUsesBtree(tls, v, iDb)
@@ -85446,12 +88966,13 @@ func Xsqlite3FinishCoding(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:110275:21
Xsqlite3VdbeAddOp4Int(tls, v,
2, // Opcode
iDb, // P1
- (crt.Bool32((((*Parse)(unsafe.Pointer(pParse)).FwriteMask) & (YDbMask((YDbMask(1))) << (iDb))) != YDbMask(0))), // P2
- (*Schema)(unsafe.Pointer(pSchema)).Fschema_cookie, // P3
+ (libc.Bool32((((*Parse)(unsafe.Pointer(pParse)).FwriteMask) & (YDbMask((YDbMask(1))) << (iDb))) != YDbMask(0))), // P2
+ (*Schema)(unsafe.Pointer(pSchema)).Fschema_cookie, // P3
(*Schema)(unsafe.Pointer(pSchema)).FiGeneration)
if int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0 {
Xsqlite3VdbeChangeP5(tls, v, uint16(1))
}
+ Xsqlite3VdbeComment(tls, v, ts+13230 /* "usesStmtJournal=..." */, libc.VaList(bp, (libc.Bool32(((*Parse)(unsafe.Pointer(pParse)).FmayAbort != 0) && ((*Parse)(unsafe.Pointer(pParse)).FisMultiWrite != 0)))))
}
for i = 0; i < (*Parse)(unsafe.Pointer(pParse)).FnVtabLock; i++ {
var vtab uintptr = Xsqlite3GetVTable(tls, db, *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FapVtabLock + uintptr(i)*8)))
@@ -85509,9 +89030,9 @@ func Xsqlite3FinishCoding(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:110275:21
// outermost parser.
//
// Not everything is nestable. This facility is designed to permit
-// INSERT, UPDATE, and DELETE operations against SQLITE_MASTER. Use
+// INSERT, UPDATE, and DELETE operations against the schema table. Use
// care if you decide to try to use this routine for some other purposes.
-func Xsqlite3NestedParse(tls *crt.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:110402:21: */
+func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:110653:21: */
bp := tls.Alloc(168)
defer tls.Free(168)
@@ -85540,12 +89061,12 @@ func Xsqlite3NestedParse(tls *crt.TLS, pParse uintptr, zFormat uintptr, va uintp
return
}
(*Parse)(unsafe.Pointer(pParse)).Fnested++
- crt.Xmemcpy(tls, bp /* &saveBuf[0] */, ((pParse) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */)))))
- crt.Xmemset(tls, ((pParse) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), 0, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */)))))
+ libc.Xmemcpy(tls, bp /* &saveBuf[0] */, ((pParse) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */)))))
+ libc.Xmemset(tls, ((pParse) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), 0, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */)))))
Xsqlite3RunParser(tls, pParse, zSql, bp+160 /* &zErrMsg */)
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 160 /* zErrMsg */)))
Xsqlite3DbFree(tls, db, zSql)
- crt.Xmemcpy(tls, ((pParse) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), bp /* &saveBuf[0] */, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */)))))
+ libc.Xmemcpy(tls, ((pParse) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), bp /* &saveBuf[0] */, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */)))))
(*Parse)(unsafe.Pointer(pParse)).Fnested--
}
@@ -85559,7 +89080,7 @@ func Xsqlite3NestedParse(tls *crt.TLS, pParse uintptr, zFormat uintptr, va uintp
// auxiliary databases added using the ATTACH command.
//
// See also sqlite3LocateTable().
-func Xsqlite3FindTable(tls *crt.TLS, db uintptr, zName uintptr, zDatabase uintptr) uintptr { /* sqlite3.c:110454:22: */
+func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintptr) uintptr { /* sqlite3.c:110705:22: */
var p uintptr = uintptr(0)
var i int32
@@ -85574,16 +89095,27 @@ func Xsqlite3FindTable(tls *crt.TLS, db uintptr, zName uintptr, zDatabase uintpt
if i >= (*Sqlite3)(unsafe.Pointer(db)).FnDb {
// No match against the official names. But always match "main"
// to schema 0 as a legacy fallback.
- if Xsqlite3StrICmp(tls, zDatabase, ts+6116 /* "main" */) == 0 {
+ if Xsqlite3StrICmp(tls, zDatabase, ts+8314 /* "main" */) == 0 {
i = 0
} else {
return uintptr(0)
}
}
p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema + 8 /* &.tblHash */), zName)
- if ((p == uintptr(0)) && (i == 1)) && (Xsqlite3StrICmp(tls, zName, ts+5324 /* "sqlite_master" */) == 0) {
- // All temp.sqlite_master to be an alias for sqlite_temp_master
- p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(1)*32)).FpSchema + 8 /* &.tblHash */), ts+10552 /* "sqlite_temp_mast..." */)
+ if (p == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+10109 /* "sqlite_" */, 7) == 0) {
+ if i == 1 {
+ if ((Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13249 /* "sqlite_temp_sche..." */ +uintptr(7))) == 0) ||
+ (Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13268 /* "sqlite_schema" */ +uintptr(7))) == 0)) ||
+ (Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+7522 /* "sqlite_master" */ +uintptr(7))) == 0) {
+ p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(1)*32)).FpSchema + 8 /* &.tblHash */),
+ ts+13282 /* "sqlite_temp_mast..." */)
+ }
+ } else {
+ if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13268 /* "sqlite_schema" */ +uintptr(7))) == 0 {
+ p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i)*32)).FpSchema + 8 /* &.tblHash */),
+ ts+7522 /* "sqlite_master" */)
+ }
+ }
}
} else {
// Match against TEMP first
@@ -85604,6 +89136,14 @@ func Xsqlite3FindTable(tls *crt.TLS, db uintptr, zName uintptr, zDatabase uintpt
break
}
}
+ if (p == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+10109 /* "sqlite_" */, 7) == 0) {
+ if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13268 /* "sqlite_schema" */ +uintptr(7))) == 0 {
+ p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(0)*32)).FpSchema + 8 /* &.tblHash */), ts+7522 /* "sqlite_master" */)
+ } else if Xsqlite3StrICmp(tls, (zName+uintptr(7)), (ts+13249 /* "sqlite_temp_sche..." */ +uintptr(7))) == 0 {
+ p = Xsqlite3HashFind(tls, ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(1)*32)).FpSchema + 8 /* &.tblHash */),
+ ts+13282 /* "sqlite_temp_mast..." */)
+ }
+ }
}
return p
}
@@ -85616,7 +89156,7 @@ func Xsqlite3FindTable(tls *crt.TLS, db uintptr, zName uintptr, zDatabase uintpt
// The difference between this routine and sqlite3FindTable() is that this
// routine leaves an error message in pParse->zErrMsg where
// sqlite3FindTable() does not.
-func Xsqlite3LocateTable(tls *crt.TLS, pParse uintptr, flags U32, zName uintptr, zDbase uintptr) uintptr { /* sqlite3.c:110512:22: */
+func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr, zDbase uintptr) uintptr { /* sqlite3.c:110783:22: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -85636,8 +89176,8 @@ func Xsqlite3LocateTable(tls *crt.TLS, pParse uintptr, flags U32, zName uintptr,
// CREATE, then check to see if it is the name of an virtual table that
// can be an eponymous virtual table.
if int32((*Parse)(unsafe.Pointer(pParse)).FdisableVtab) == 0 {
- var pMod uintptr = Xsqlite3HashFind(tls, (db + 504 /* &.aModule */), zName)
- if (pMod == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+10571 /* "pragma_" */, 7) == 0) {
+ var pMod uintptr = Xsqlite3HashFind(tls, (db + 528 /* &.aModule */), zName)
+ if (pMod == uintptr(0)) && (Xsqlite3_strnicmp(tls, zName, ts+13301 /* "pragma_" */, 7) == 0) {
pMod = Xsqlite3PragmaVtabRegister(tls, db, zName)
}
if (pMod != 0) && (Xsqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0) {
@@ -85655,14 +89195,14 @@ func Xsqlite3LocateTable(tls *crt.TLS, pParse uintptr, flags U32, zName uintptr,
if p == uintptr(0) {
var zMsg uintptr
if (flags & U32(0x01)) != 0 {
- zMsg = ts + 10579 /* "no such view" */
+ zMsg = ts + 13309 /* "no such view" */
} else {
- zMsg = ts + 10592 /* "no such table" */
+ zMsg = ts + 13322 /* "no such table" */
}
if zDbase != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+6309 /* "%s: %s.%s" */, crt.VaList(bp, zMsg, zDbase, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8507 /* "%s: %s.%s" */, libc.VaList(bp, zMsg, zDbase, zName))
} else {
- Xsqlite3ErrorMsg(tls, pParse, ts+6319 /* "%s: %s" */, crt.VaList(bp+24, zMsg, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+8517 /* "%s: %s" */, libc.VaList(bp+24, zMsg, zName))
}
}
@@ -85676,7 +89216,7 @@ func Xsqlite3LocateTable(tls *crt.TLS, pParse uintptr, flags U32, zName uintptr,
// the search to schema (p->pSchema) if it is not NULL. p->pSchema may be
// non-NULL if it is part of a view or trigger program definition. See
// sqlite3FixSrcList() for details.
-func Xsqlite3LocateTableItem(tls *crt.TLS, pParse uintptr, flags U32, p uintptr) uintptr { /* sqlite3.c:110572:22: */
+func Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr) uintptr { /* sqlite3.c:110843:22: */
var zDb uintptr
if (*SrcList_item)(unsafe.Pointer(p)).FpSchema != 0 {
@@ -85698,7 +89238,7 @@ func Xsqlite3LocateTableItem(tls *crt.TLS, pParse uintptr, flags U32, p uintptr)
// for duplicate index names is done.) The search order is
// TEMP first, then MAIN, then any auxiliary databases added
// using the ATTACH command.
-func Xsqlite3FindIndex(tls *crt.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:110600:22: */
+func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr { /* sqlite3.c:110871:22: */
var p uintptr = uintptr(0)
var i int32
// All mutexes are required for schema access. Make sure we hold them.
@@ -85725,7 +89265,7 @@ func Xsqlite3FindIndex(tls *crt.TLS, db uintptr, zName uintptr, zDb uintptr) uin
}
// Reclaim the memory used by an index
-func Xsqlite3FreeIndex(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:110620:21: */
+func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:110891:21: */
Xsqlite3DeleteIndexSamples(tls, db, p)
Xsqlite3ExprDelete(tls, db, (*Index)(unsafe.Pointer(p)).FpPartIdxWhere)
Xsqlite3ExprListDelete(tls, db, (*Index)(unsafe.Pointer(p)).FaColExpr)
@@ -85733,6 +89273,7 @@ func Xsqlite3FreeIndex(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:11062
if uint32(int32(*(*uint16)(unsafe.Pointer(p + 100 /* &.isResized */))&0x10>>4)) != 0 {
Xsqlite3DbFree(tls, db, (*Index)(unsafe.Pointer(p)).FazColl)
}
+ Xsqlite3_free(tls, (*Index)(unsafe.Pointer(p)).FaiRowEst)
Xsqlite3DbFree(tls, db, p)
}
@@ -85740,7 +89281,7 @@ func Xsqlite3FreeIndex(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:11062
// unlike that index from its Table then remove the index from
// the index hash table and free all memory structures associated
// with the index.
-func Xsqlite3UnlinkAndDeleteIndex(tls *crt.TLS, db uintptr, iDb int32, zIdxName uintptr) { /* sqlite3.c:110640:21: */
+func Xsqlite3UnlinkAndDeleteIndex(tls *libc.TLS, db uintptr, iDb int32, zIdxName uintptr) { /* sqlite3.c:110911:21: */
var pIndex uintptr
var pHash uintptr
@@ -85772,10 +89313,10 @@ func Xsqlite3UnlinkAndDeleteIndex(tls *crt.TLS, db uintptr, iDb int32, zIdxName
//
// Entry 0 (the "main" database) and entry 1 (the "temp" database)
// are never candidates for being collapsed.
-func Xsqlite3CollapseDatabaseArray(tls *crt.TLS, db uintptr) { /* sqlite3.c:110673:21: */
+func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { /* sqlite3.c:110944:21: */
var i int32
var j int32
- for i = crt.AssignInt32(&j, 2); i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
+ for i = libc.AssignInt32(&j, 2); i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var pDb uintptr = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)
if (*Db1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) {
Xsqlite3DbFree(tls, db, (*Db1)(unsafe.Pointer(pDb)).FzDbSName)
@@ -85788,24 +89329,24 @@ func Xsqlite3CollapseDatabaseArray(tls *crt.TLS, db uintptr) { /* sqlite3.c:1106
j++
}
(*Sqlite3)(unsafe.Pointer(db)).FnDb = j
- if ((*Sqlite3)(unsafe.Pointer(db)).FnDb <= 2) && ((*Sqlite3)(unsafe.Pointer(db)).FaDb != db+624 /* &.aDbStatic */) {
- crt.Xmemcpy(tls, db+624 /* &.aDbStatic */, (*Sqlite3)(unsafe.Pointer(db)).FaDb, (uint64(2) * uint64(unsafe.Sizeof(Db{}))))
+ if ((*Sqlite3)(unsafe.Pointer(db)).FnDb <= 2) && ((*Sqlite3)(unsafe.Pointer(db)).FaDb != db+648 /* &.aDbStatic */) {
+ libc.Xmemcpy(tls, db+648 /* &.aDbStatic */, (*Sqlite3)(unsafe.Pointer(db)).FaDb, (uint64(2) * uint64(unsafe.Sizeof(Db{}))))
Xsqlite3DbFree(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaDb)
- (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 624 /* &.aDbStatic */
+ (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 648 /* &.aDbStatic */
}
}
// Reset the schema for the database at index iDb. Also reset the
// TEMP schema. The reset is deferred if db->nSchemaLock is not zero.
// Deferred resets may be run by calling with iDb<0.
-func Xsqlite3ResetOneSchema(tls *crt.TLS, db uintptr, iDb int32) { /* sqlite3.c:110700:21: */
+func Xsqlite3ResetOneSchema(tls *libc.TLS, db uintptr, iDb int32) { /* sqlite3.c:110971:21: */
var i int32
if iDb >= 0 {
*(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(iDb)*32)).FpSchema + 114 /* &.schemaFlags */)) |= U16((0x0008))
*(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(1)*32)).FpSchema + 114 /* &.schemaFlags */)) |= U16((0x0008))
- *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (^U32(crt.Int32FromInt32(0x0010)))
+ *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (^U32(libc.Int32FromInt32(0x0010)))
}
if (*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock == U32(0) {
@@ -85819,7 +89360,7 @@ func Xsqlite3ResetOneSchema(tls *crt.TLS, db uintptr, iDb int32) { /* sqlite3.c:
// Erase all schema information from all attached databases (including
// "main" and "temp") for a single database connection.
-func Xsqlite3ResetAllSchemasOfConnection(tls *crt.TLS, db uintptr) { /* sqlite3.c:110724:21: */
+func Xsqlite3ResetAllSchemasOfConnection(tls *libc.TLS, db uintptr) { /* sqlite3.c:110995:21: */
var i int32
Xsqlite3BtreeEnterAll(tls, db)
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
@@ -85832,7 +89373,7 @@ func Xsqlite3ResetAllSchemasOfConnection(tls *crt.TLS, db uintptr) { /* sqlite3.
}
}
}
- *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (^U32(crt.Int32FromInt32((0x0001 | 0x0010))))
+ *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (^U32(libc.Int32FromInt32((0x0001 | 0x0010))))
Xsqlite3VtabUnlockList(tls, db)
Xsqlite3BtreeLeaveAll(tls, db)
if (*Sqlite3)(unsafe.Pointer(db)).FnSchemaLock == U32(0) {
@@ -85841,17 +89382,17 @@ func Xsqlite3ResetAllSchemasOfConnection(tls *crt.TLS, db uintptr) { /* sqlite3.
}
// This routine is called when a commit occurs.
-func Xsqlite3CommitInternalChanges(tls *crt.TLS, db uintptr) { /* sqlite3.c:110748:21: */
- *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (^U32(crt.Int32FromInt32(0x0001)))
+func Xsqlite3CommitInternalChanges(tls *libc.TLS, db uintptr) { /* sqlite3.c:111019:21: */
+ *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (^U32(libc.Int32FromInt32(0x0001)))
}
// Delete memory allocated for the column names of a table or view (the
// Table.aCol[] array).
-func Xsqlite3DeleteColumnNames(tls *crt.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:110756:21: */
+func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:111027:21: */
var i int32
var pCol uintptr
- if (crt.AssignUintptr(&pCol, (*Table)(unsafe.Pointer(pTable)).FaCol)) != uintptr(0) {
+ if (libc.AssignUintptr(&pCol, (*Table)(unsafe.Pointer(pTable)).FaCol)) != uintptr(0) {
i = 0
__1:
if !(i < int32((*Table)(unsafe.Pointer(pTable)).FnCol)) {
@@ -85888,7 +89429,7 @@ func Xsqlite3DeleteColumnNames(tls *crt.TLS, db uintptr, pTable uintptr) { /* sq
// lookaside memory, but some ephemeral Table objects do.) Or the
// db parameter can be used with db->pnBytesFreed to measure the memory
// used by the Table object.
-func deleteTable(tls *crt.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:110786:29: */
+func deleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:111057:29: */
var pIndex uintptr
var pNext uintptr
@@ -85920,12 +89461,12 @@ func deleteTable(tls *crt.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:110786
// Verify that no lookaside memory was used by schema tables
}
-func Xsqlite3DeleteTable(tls *crt.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:110837:21: */
+func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr) { /* sqlite3.c:111108:21: */
// Do not delete the table until the reference count reaches zero.
if !(pTable != 0) {
return
}
- if (!(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0))) && ((crt.PreDecUint32(&(*Table)(unsafe.Pointer(pTable)).FnTabRef, 1)) > U32(0)) {
+ if (!(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0))) && ((libc.PreDecUint32(&(*Table)(unsafe.Pointer(pTable)).FnTabRef, 1)) > U32(0)) {
return
}
deleteTable(tls, db, pTable)
@@ -85933,7 +89474,7 @@ func Xsqlite3DeleteTable(tls *crt.TLS, db uintptr, pTable uintptr) { /* sqlite3.
// Unlink the given table from the hash tables and the delete the
// table structure with all its indices and foreign keys.
-func Xsqlite3UnlinkAndDeleteTable(tls *crt.TLS, db uintptr, iDb int32, zTabName uintptr) { /* sqlite3.c:110849:21: */
+func Xsqlite3UnlinkAndDeleteTable(tls *libc.TLS, db uintptr, iDb int32, zTabName uintptr) { /* sqlite3.c:111120:21: */
var p uintptr
var pDb uintptr
@@ -85955,7 +89496,7 @@ func Xsqlite3UnlinkAndDeleteTable(tls *crt.TLS, db uintptr, iDb int32, zTabName
// Tokens are often just pointers into the original SQL text and so
// are not \000 terminated and are not persistent. The returned string
// is \000 terminated and is persistent.
-func Xsqlite3NameFromToken(tls *crt.TLS, db uintptr, pName uintptr) uintptr { /* sqlite3.c:110877:21: */
+func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr { /* sqlite3.c:111148:21: */
var zName uintptr
if pName != 0 {
zName = Xsqlite3DbStrNDup(tls, db, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn))
@@ -85966,11 +89507,11 @@ func Xsqlite3NameFromToken(tls *crt.TLS, db uintptr, pName uintptr) uintptr { /*
return zName
}
-// Open the sqlite_master table stored in database number iDb for
+// Open the sqlite_schema table stored in database number iDb for
// writing. The table is opened using cursor 0.
-func Xsqlite3OpenMasterTable(tls *crt.TLS, p uintptr, iDb int32) { /* sqlite3.c:110892:21: */
+func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { /* sqlite3.c:111163:21: */
var v uintptr = Xsqlite3GetVdbe(tls, p)
- Xsqlite3TableLock(tls, p, iDb, 1, uint8(1), ts+5324 /* "sqlite_master" */)
+ Xsqlite3TableLock(tls, p, iDb, uint32(1), uint8(1), ts+7522 /* "sqlite_master" */)
Xsqlite3VdbeAddOp4Int(tls, v, 97, 0, 1, iDb, 5)
if (*Parse)(unsafe.Pointer(p)).FnTab == 0 {
(*Parse)(unsafe.Pointer(p)).FnTab = 1
@@ -85981,7 +89522,7 @@ func Xsqlite3OpenMasterTable(tls *crt.TLS, p uintptr, iDb int32) { /* sqlite3.c:
// of a database ("main", "temp" or the name of an attached db). This
// function returns the index of the named database in db->aDb[], or
// -1 if the named db cannot be found.
-func Xsqlite3FindDbName(tls *crt.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:110907:20: */
+func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:111178:20: */
var i int32 = -1 // Database number
if zName != 0 {
var pDb uintptr
@@ -85997,7 +89538,7 @@ func Xsqlite3FindDbName(tls *crt.TLS, db uintptr, zName uintptr) int32 { /* sqli
}
// "main" is always an acceptable alias for the primary database
// even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME.
- if (i == 0) && (0 == Xsqlite3_stricmp(tls, ts+6116 /* "main" */, zName)) {
+ if (i == 0) && (0 == Xsqlite3_stricmp(tls, ts+8314 /* "main" */, zName)) {
goto __3
}
}
@@ -86016,7 +89557,7 @@ func Xsqlite3FindDbName(tls *crt.TLS, db uintptr, zName uintptr) int32 { /* sqli
// "temp" or the name of an attached db). This routine returns the
// index of the named database in db->aDb[], or -1 if the named db
// does not exist.
-func Xsqlite3FindDb(tls *crt.TLS, db uintptr, pName uintptr) int32 { /* sqlite3.c:110927:20: */
+func Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32 { /* sqlite3.c:111198:20: */
var i int32 // Database number
var zName uintptr // Name we are searching for
zName = Xsqlite3NameFromToken(tls, db, pName)
@@ -86040,7 +89581,7 @@ func Xsqlite3FindDb(tls *crt.TLS, db uintptr, pName uintptr) int32 { /* sqlite3.
// This routine sets the *ppUnqual pointer to point at the token (pName1 or
// pName2) that stores the unqualified table name. The index of the
// database "xxx" is returned.
-func Xsqlite3TwoPartName(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pUnqual uintptr) int32 { /* sqlite3.c:110952:20: */
+func Xsqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pUnqual uintptr) int32 { /* sqlite3.c:111223:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -86049,13 +89590,13 @@ func Xsqlite3TwoPartName(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 ui
if (*Token)(unsafe.Pointer(pName2)).Fn > uint32(0) {
if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+10606 /* "corrupt database" */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+13336 /* "corrupt database" */, 0)
return -1
}
*(*uintptr)(unsafe.Pointer(pUnqual)) = pName2
iDb = Xsqlite3FindDb(tls, db, pName1)
if iDb < 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+10623 /* "unknown database..." */, crt.VaList(bp, pName1))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13353 /* "unknown database..." */, libc.VaList(bp, pName1))
return -1
}
} else {
@@ -86067,9 +89608,9 @@ func Xsqlite3TwoPartName(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 ui
}
// True if PRAGMA writable_schema is ON
-func Xsqlite3WritableSchema(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:110985:20: */
+func Xsqlite3WritableSchema(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:111256:20: */
- return (crt.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (uint64(0x00000001 | 0x10000000))) == uint64(0x00000001)))
+ return (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (uint64(0x00000001 | 0x10000000))) == uint64(0x00000001)))
}
// This routine is used to check if the UTF-8 string zName is a legal
@@ -86078,15 +89619,17 @@ func Xsqlite3WritableSchema(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:11098
// "sqlite_" (in upper, lower or mixed case). This portion of the namespace
// is reserved for internal use.
//
-// When parsing the sqlite_master table, this routine also checks to
+// When parsing the sqlite_schema table, this routine also checks to
// make sure the "type", "name", and "tbl_name" columns are consistent
// with the SQL.
-func Xsqlite3CheckObjectName(tls *crt.TLS, pParse uintptr, zName uintptr, zType uintptr, zTblName uintptr) int32 { /* sqlite3.c:111007:20: */
+func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType uintptr, zTblName uintptr) int32 { /* sqlite3.c:111278:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if (Xsqlite3WritableSchema(tls, db) != 0) || (uint32(int32(*(*uint8)(unsafe.Pointer((db + 176 /* &.init */) + 8 /* &.imposterTable */))&0x2>>1)) != 0) {
+ if ((Xsqlite3WritableSchema(tls, db) != 0) ||
+ (uint32(int32(*(*uint8)(unsafe.Pointer((db + 176 /* &.init */) + 8 /* &.imposterTable */))&0x2>>1)) != 0)) ||
+ !(int32(Xsqlite3Config.FbExtraSchemaChecks) != 0) {
// Skip these error checks for writable_schema=ON
return 0
}
@@ -86094,16 +89637,14 @@ func Xsqlite3CheckObjectName(tls *crt.TLS, pParse uintptr, zName uintptr, zType
if ((Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit + uintptr(0)*8))) != 0) ||
(Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit + uintptr(1)*8))) != 0)) ||
(Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit + uintptr(2)*8))) != 0) {
- if Xsqlite3Config.FbExtraSchemaChecks != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+672 /* "" */, 0) // corruptSchema() will supply the error
- return 1
- }
+ Xsqlite3ErrorMsg(tls, pParse, ts+781 /* "" */, 0) // corruptSchema() will supply the error
+ return 1
}
} else {
- if ((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && (0 == Xsqlite3_strnicmp(tls, zName, ts+7691 /* "sqlite_" */, 7))) ||
+ if ((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && (0 == Xsqlite3_strnicmp(tls, zName, ts+10109 /* "sqlite_" */, 7))) ||
((Xsqlite3ReadOnlyShadowTables(tls, db) != 0) && (Xsqlite3ShadowTableName(tls, db, zName) != 0)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+10643, /* "object name rese..." */
- crt.VaList(bp, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13373, /* "object name rese..." */
+ libc.VaList(bp, zName))
return 1
}
}
@@ -86111,7 +89652,7 @@ func Xsqlite3CheckObjectName(tls *crt.TLS, pParse uintptr, zName uintptr, zType
}
// Return the PRIMARY KEY index of a table
-func Xsqlite3PrimaryKeyIndex(tls *crt.TLS, pTab uintptr) uintptr { /* sqlite3.c:111044:22: */
+func Xsqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:111316:22: */
var p uintptr
for p = (*Table)(unsafe.Pointer(pTab)).FpIndex; (p != 0) && !(int32(*(*uint16)(unsafe.Pointer((p) + 100 /* &.idxType */))&0x3>>0) == 2); p = (*Index)(unsafe.Pointer(p)).FpNext {
}
@@ -86122,7 +89663,7 @@ func Xsqlite3PrimaryKeyIndex(tls *crt.TLS, pTab uintptr) uintptr { /* sqlite3.c:
// for the column iCol in the table (as defined by the CREATE TABLE statement)
// find the (first) offset of that column in index pIdx. Or return -1
// if column iCol is not used in index pIdx.
-func Xsqlite3TableColumnToIndex(tls *crt.TLS, pIdx uintptr, iCol I16) I16 { /* sqlite3.c:111056:20: */
+func Xsqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol I16) I16 { /* sqlite3.c:111328:20: */
var i int32
for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnColumn); i++ {
if int32(iCol) == int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) {
@@ -86142,7 +89683,7 @@ func Xsqlite3TableColumnToIndex(tls *crt.TLS, pIdx uintptr, iCol I16) I16 { /* s
// and only there are VIRTUAL columns to the left.
//
// If SQLITE_OMIT_GENERATED_COLUMNS, this routine is a no-op macro.
-func Xsqlite3StorageColumnToTable(tls *crt.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:111076:20: */
+func Xsqlite3StorageColumnToTable(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:111348:20: */
if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(0x0020)) != 0 {
var i int32
for i = 0; i <= int32(iCol); i++ {
@@ -86189,7 +89730,7 @@ func Xsqlite3StorageColumnToTable(tls *crt.TLS, pTab uintptr, iCol I16) I16 { /*
// this routine is a no-op macro. If the pTab does not have any virtual
// columns, then this routine is no-op that always return iCol. If iCol
// is negative (indicating the ROWID column) then this routine return iCol.
-func Xsqlite3TableColumnToStorage(tls *crt.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:111124:20: */
+func Xsqlite3TableColumnToStorage(tls *libc.TLS, pTab uintptr, iCol I16) I16 { /* sqlite3.c:111396:20: */
var i int32
var n I16
@@ -86227,7 +89768,7 @@ func Xsqlite3TableColumnToStorage(tls *crt.TLS, pTab uintptr, iCol I16) I16 { /*
// routines will be called to add more information to this record.
// At the end of the CREATE TABLE statement, the sqlite3EndTable() routine
// is called to complete the construction of the new table record.
-func Xsqlite3StartTable(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, isTemp int32, isView int32, isVirtual int32, noErr int32) { /* sqlite3.c:111158:21: */
+func Xsqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, isTemp int32, isView int32, isVirtual int32, noErr int32) { /* sqlite3.c:111430:21: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -86248,16 +89789,16 @@ func Xsqlite3StartTable(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 uin
zName = uintptr(0)
db = (*Parse)(unsafe.Pointer(pParse)).Fdb // Unqualified name of the table to create
- if !(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) && ((*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum == 1)) {
+ if !(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) && ((*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum == Pgno(1))) {
goto __1
}
- // Special case: Parsing the sqlite_master or sqlite_temp_master schema
+ // Special case: Parsing the sqlite_schema or sqlite_temp_schema schema
iDb = int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb)
zName = Xsqlite3DbStrDup(tls, db, func() uintptr {
if (!(0 != 0)) && (iDb == 1) {
- return ts + 10552 /* "sqlite_temp_mast..." */
+ return ts + 13282 /* "sqlite_temp_mast..." */
}
- return ts + 5324 /* "sqlite_master" */
+ return ts + 7522 /* "sqlite_master" */
}())
*(*uintptr)(unsafe.Pointer(bp + 16 /* pName */)) = pName1
goto __2
@@ -86275,7 +89816,7 @@ __3:
}
// If creating a temp table, the name may not be qualified. Unless
// the database name is "temp" anyway.
- Xsqlite3ErrorMsg(tls, pParse, ts+10685 /* "temporary table ..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+13415 /* "temporary table ..." */, 0)
return
__4:
;
@@ -86303,9 +89844,9 @@ __7:
;
if !(Xsqlite3CheckObjectName(tls, pParse, zName, func() uintptr {
if isView != 0 {
- return ts + 9393 /* "view" */
+ return ts + 11866 /* "view" */
}
- return ts + 6019 /* "table" */
+ return ts + 8217 /* "table" */
}(), zName) != 0) {
goto __8
}
@@ -86322,9 +89863,9 @@ __9:
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
if !(Xsqlite3AuthCheck(tls, pParse, 18, func() uintptr {
if (!(0 != 0)) && (isTemp == 1) {
- return ts + 10552 /* "sqlite_temp_mast..." */
+ return ts + 13282 /* "sqlite_temp_mast..." */
}
- return ts + 5324 /* "sqlite_master" */
+ return ts + 7522 /* "sqlite_master" */
}(), uintptr(0), zDb) != 0) {
goto __10
}
@@ -86362,7 +89903,7 @@ __13:
if !(!(noErr != 0)) {
goto __15
}
- Xsqlite3ErrorMsg(tls, pParse, ts+10726 /* "table %T already..." */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 16 /* pName */))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13456 /* "table %T already..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 16 /* pName */))))
goto __16
__15:
;
@@ -86375,7 +89916,7 @@ __14:
if !(Xsqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0)) {
goto __17
}
- Xsqlite3ErrorMsg(tls, pParse, ts+10750 /* "there is already..." */, crt.VaList(bp+8, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13480 /* "there is already..." */, libc.VaList(bp+8, zName))
goto begin_table_error
__17:
;
@@ -86403,7 +89944,7 @@ __18:
// If this is the magic sqlite_sequence table used by autoincrement,
// then record a pointer to this table in the main database structure
// so that INSERT can find the table easily.
- if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) && (crt.Xstrcmp(tls, zName, ts+8591 /* "sqlite_sequence" */) == 0)) {
+ if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) && (libc.Xstrcmp(tls, zName, ts+11053 /* "sqlite_sequence" */) == 0)) {
goto __19
}
@@ -86412,13 +89953,13 @@ __19:
;
// Begin generating the code that will insert the table record into
- // the SQLITE_MASTER table. Note in particular that we must go ahead
+ // the schema table. Note in particular that we must go ahead
// and allocate the record number for the table entry now. Before any
// PRIMARY KEY or UNIQUE keywords are parsed. Those keywords will cause
// indices to be created and the table record must come before the
// indices. Hence, the record number for the table must be allocated
// now.
- if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) && ((crt.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse))) != uintptr(0))) {
+ if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) && ((libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse))) != uintptr(0))) {
goto __20
}
Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb)
@@ -86432,9 +89973,9 @@ __21:
// If the file format and encoding in the database have not been set,
// set them now.
- reg1 = crt.AssignPtrInt32(pParse+120 /* &.regRowid */, crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
- reg2 = crt.AssignPtrInt32(pParse+124 /* &.regRoot */, crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
- reg3 = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ reg1 = libc.AssignPtrInt32(pParse+120 /* &.regRowid */, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
+ reg2 = libc.AssignPtrInt32(pParse+124 /* &.regRoot */, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
+ reg3 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp3(tls, v, 93, iDb, reg3, 2)
Xsqlite3VdbeUsesBtree(tls, v, iDb)
addr1 = Xsqlite3VdbeAddOp1(tls, v, 18, reg3)
@@ -86447,7 +89988,7 @@ __21:
Xsqlite3VdbeAddOp3(tls, v, 94, iDb, 5, int32((*Sqlite3)(unsafe.Pointer(db)).Fenc))
Xsqlite3VdbeJumpHere(tls, v, addr1)
- // This just creates a place-holder record in the sqlite_master table.
+ // This just creates a place-holder record in the sqlite_schema table.
// The record created does not contain anything yet. It will be replaced
// by the real entry in code generated at sqlite3EndTable().
//
@@ -86465,7 +90006,7 @@ __22:
(*Parse)(unsafe.Pointer(pParse)).FaddrCrTab = Xsqlite3VdbeAddOp3(tls, v, 139, iDb, reg2, 1)
__23:
;
- Xsqlite3OpenMasterTable(tls, pParse, iDb)
+ Xsqlite3OpenSchemaTable(tls, pParse, iDb)
Xsqlite3VdbeAddOp2(tls, v, 120, 0, reg1)
Xsqlite3VdbeAddOp4(tls, v, 74, 6, reg3, 0, uintptr(unsafe.Pointer(&nullRow)), -1)
Xsqlite3VdbeAddOp3(tls, v, 121, 0, reg3, reg1)
@@ -86488,8 +90029,8 @@ var aCode = [4]U8{
U8(4),
U8(8),
U8(6),
-} /* sqlite3.c:111205:21 */
-var nullRow = [6]int8{int8(6), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:111293:23 */
+} /* sqlite3.c:111477:21 */
+var nullRow = [6]int8{int8(6), int8(0), int8(0), int8(0), int8(0), int8(0)} /* sqlite3.c:111565:23 */
// Set properties of a table column based on the (magical)
// name of the column.
@@ -86500,7 +90041,7 @@ var nullRow = [6]int8{int8(6), int8(0), int8(0), int8(0), int8(0), int8(0)} /* s
// in a CREATE TABLE statement. sqlite3StartTable() gets called
// first to get things going. Then this routine is called for each
// column.
-func Xsqlite3AddColumn(tls *crt.TLS, pParse uintptr, pName uintptr, pType uintptr) { /* sqlite3.c:111374:21: */
+func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintptr) { /* sqlite3.c:111646:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -86510,11 +90051,11 @@ func Xsqlite3AddColumn(tls *crt.TLS, pParse uintptr, pName uintptr, pType uintpt
var zType uintptr
var pCol uintptr
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if (crt.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0) {
+ if (libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0) {
return
}
if (int32((*Table)(unsafe.Pointer(p)).FnCol) + 1) > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(2)*4)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+10785 /* "too many columns..." */, crt.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13515 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName))
return
}
z = Xsqlite3DbMallocRaw(tls, db, (uint64(((*Token)(unsafe.Pointer(pName)).Fn + (*Token)(unsafe.Pointer(pType)).Fn) + uint32(2))))
@@ -86524,12 +90065,12 @@ func Xsqlite3AddColumn(tls *crt.TLS, pParse uintptr, pName uintptr, pType uintpt
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2 {
Xsqlite3RenameTokenMap(tls, pParse, z, pName)
}
- crt.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn))
+ libc.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn))
*(*int8)(unsafe.Pointer(z + uintptr((*Token)(unsafe.Pointer(pName)).Fn))) = int8(0)
Xsqlite3Dequote(tls, z)
for i = 0; i < int32((*Table)(unsafe.Pointer(p)).FnCol); i++ {
if Xsqlite3_stricmp(tls, z, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(i)*32)).FzName) == 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+10808 /* "duplicate column..." */, crt.VaList(bp+8, z))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13538 /* "duplicate column..." */, libc.VaList(bp+8, z))
Xsqlite3DbFree(tls, db, z)
return
}
@@ -86544,7 +90085,7 @@ func Xsqlite3AddColumn(tls *crt.TLS, pParse uintptr, pName uintptr, pType uintpt
(*Table)(unsafe.Pointer(p)).FaCol = aNew
}
pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((*Table)(unsafe.Pointer(p)).FnCol)*32)
- crt.Xmemset(tls, pCol, 0, uint64(unsafe.Sizeof(Column{})))
+ libc.Xmemset(tls, pCol, 0, uint64(unsafe.Sizeof(Column{})))
(*Column)(unsafe.Pointer(pCol)).FzName = z
(*Column)(unsafe.Pointer(pCol)).FhName = Xsqlite3StrIHash(tls, z)
@@ -86555,7 +90096,7 @@ func Xsqlite3AddColumn(tls *crt.TLS, pParse uintptr, pName uintptr, pType uintpt
(*Column)(unsafe.Pointer(pCol)).FszEst = U8(1)
} else {
zType = ((z + uintptr(Xsqlite3Strlen30(tls, z))) + uintptr(1))
- crt.Xmemcpy(tls, zType, (*Token)(unsafe.Pointer(pType)).Fz, uint64((*Token)(unsafe.Pointer(pType)).Fn))
+ libc.Xmemcpy(tls, zType, (*Token)(unsafe.Pointer(pType)).Fz, uint64((*Token)(unsafe.Pointer(pType)).Fn))
*(*int8)(unsafe.Pointer(zType + uintptr((*Token)(unsafe.Pointer(pType)).Fn))) = int8(0)
Xsqlite3Dequote(tls, zType)
(*Column)(unsafe.Pointer(pCol)).Faffinity = Xsqlite3AffinityType(tls, zType, pCol)
@@ -86570,7 +90111,7 @@ func Xsqlite3AddColumn(tls *crt.TLS, pParse uintptr, pName uintptr, pType uintpt
// parsing a CREATE TABLE statement. A "NOT NULL" constraint has
// been seen on a column. This routine sets the notNull flag on
// the column currently under construction.
-func Xsqlite3AddNotNull(tls *crt.TLS, pParse uintptr, onError int32) { /* sqlite3.c:111443:21: */
+func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32) { /* sqlite3.c:111715:21: */
var p uintptr
var pCol uintptr
p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
@@ -86588,7 +90129,7 @@ func Xsqlite3AddNotNull(tls *crt.TLS, pParse uintptr, onError int32) { /* sqlite
for pIdx = (*Table)(unsafe.Pointer(p)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(0)*2))) == (int32((*Table)(unsafe.Pointer(p)).FnCol) - 1) {
- crt.SetBitFieldPtr16Uint32(pIdx+100 /* &.uniqNotNull */, uint32(1), 3, 0x8)
+ libc.SetBitFieldPtr16Uint32(pIdx+100 /* &.uniqNotNull */, uint32(1), 3, 0x8)
}
}
}
@@ -86617,7 +90158,7 @@ func Xsqlite3AddNotNull(tls *crt.TLS, pParse uintptr, onError int32) { /* sqlite
//
// If none of the substrings in the above table are found,
// SQLITE_AFF_NUMERIC is returned.
-func Xsqlite3AffinityType(tls *crt.TLS, zIn uintptr, pCol uintptr) int8 { /* sqlite3.c:111490:21: */
+func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) int8 { /* sqlite3.c:111762:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -86691,7 +90232,7 @@ func Xsqlite3AffinityType(tls *crt.TLS, zIn uintptr, pCol uintptr) int8 { /* sql
//
// This routine is called by the parser while in the middle of
// parsing a CREATE TABLE statement.
-func Xsqlite3AddDefaultValue(tls *crt.TLS, pParse uintptr, pExpr uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:111567:21: */
+func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStart uintptr, zEnd uintptr) { /* sqlite3.c:111839:21: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -86700,21 +90241,21 @@ func Xsqlite3AddDefaultValue(tls *crt.TLS, pParse uintptr, pExpr uintptr, zStart
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
p = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
if p != uintptr(0) {
- var isInit int32 = (crt.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) != 1)))
+ var isInit int32 = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb) != 1)))
pCol = ((*Table)(unsafe.Pointer(p)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(p)).FnCol)-1))*32)
if !(Xsqlite3ExprIsConstantOrFunction(tls, pExpr, uint8(isInit)) != 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+10834, /* "default value of..." */
- crt.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13564, /* "default value of..." */
+ libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName))
} else if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0060) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+10879 /* "cannot use DEFAU..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+13609 /* "cannot use DEFAU..." */, 0)
} else {
// A copy of pExpr is used instead of the original, as pExpr contains
// tokens that point to volatile memory.
// var x Expr at bp+8, 72
Xsqlite3ExprDelete(tls, db, (*Column)(unsafe.Pointer(pCol)).FpDflt)
- crt.Xmemset(tls, bp+8 /* &x */, 0, uint64(unsafe.Sizeof(Expr{})))
+ libc.Xmemset(tls, bp+8 /* &x */, 0, uint64(unsafe.Sizeof(Expr{})))
(*Expr)(unsafe.Pointer(bp + 8 /* &x */)).Fop = U8(178)
*(*uintptr)(unsafe.Pointer(bp + 8 /* &x */ + 8 /* &.u */)) = Xsqlite3DbSpanDup(tls, db, zStart, zEnd)
(*Expr)(unsafe.Pointer(bp + 8 /* &x */)).FpLeft = pExpr
@@ -86743,7 +90284,7 @@ func Xsqlite3AddDefaultValue(tls *crt.TLS, pParse uintptr, pExpr uintptr, zStart
// if the expression is just a TK_STRING with an optional COLLATE clause.
// If the expression is anything other than TK_STRING, the expression is
// unchanged.
-func sqlite3StringToId(tls *crt.TLS, p uintptr) { /* sqlite3.c:111626:13: */
+func sqlite3StringToId(tls *libc.TLS, p uintptr) { /* sqlite3.c:111898:13: */
if int32((*Expr)(unsafe.Pointer(p)).Fop) == 115 {
(*Expr)(unsafe.Pointer(p)).Fop = U8(59)
} else if (int32((*Expr)(unsafe.Pointer(p)).Fop) == 111) && (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(p)).FpLeft)).Fop) == 115) {
@@ -86752,12 +90293,12 @@ func sqlite3StringToId(tls *crt.TLS, p uintptr) { /* sqlite3.c:111626:13: */
}
// Tag the given column as being part of the PRIMARY KEY
-func makeColumnPartOfPrimaryKey(tls *crt.TLS, pParse uintptr, pCol uintptr) { /* sqlite3.c:111637:13: */
+func makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { /* sqlite3.c:111909:13: */
*(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) |= U16((0x0001))
if (int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0060) != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+10920 /* "generated column..." */, 0)
+ ts+13650 /* "generated column..." */, 0)
}
}
@@ -86777,7 +90318,7 @@ func makeColumnPartOfPrimaryKey(tls *crt.TLS, pParse uintptr, pCol uintptr) { /*
//
// If the key is not an INTEGER PRIMARY KEY, then create a unique
// index for the key. No index is created for INTEGER PRIMARY KEYs.
-func Xsqlite3AddPrimaryKey(tls *crt.TLS, pParse uintptr, pList uintptr, onError int32, autoInc int32, sortOrder int32) { /* sqlite3.c:111667:21: */
+func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError int32, autoInc int32, sortOrder int32) { /* sqlite3.c:111939:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -86802,7 +90343,7 @@ __1:
goto __2
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+10972 /* "table \"%s\" has m..." */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ ts+13702 /* "table \"%s\" has m..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
goto primary_key_exit
__2:
;
@@ -86862,7 +90403,7 @@ __4:
;
if !((((nTerm == 1) &&
(pCol != 0)) &&
- (Xsqlite3StrICmp(tls, Xsqlite3ColumnType(tls, pCol, ts+672 /* "" */), ts+11013 /* "INTEGER" */) == 0)) &&
+ (Xsqlite3StrICmp(tls, Xsqlite3ColumnType(tls, pCol, ts+781 /* "" */), ts+13743 /* "INTEGER" */) == 0)) &&
(sortOrder != 1)) {
goto __13
}
@@ -86890,7 +90431,7 @@ __13:
goto __17
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+11021 /* "AUTOINCREMENT is..." */, 0)
+ ts+13751 /* "AUTOINCREMENT is..." */, 0)
goto __18
__17:
Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0),
@@ -86907,7 +90448,7 @@ primary_key_exit:
}
// Add a new CHECK constraint to the table currently under construction.
-func Xsqlite3AddCheckConstraint(tls *crt.TLS, pParse uintptr, pCheckExpr uintptr) { /* sqlite3.c:111742:21: */
+func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintptr) { /* sqlite3.c:112014:21: */
var pTab uintptr = (*Parse)(unsafe.Pointer(pParse)).FpNewTable
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if ((pTab != 0) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == 1)) &&
@@ -86923,13 +90464,13 @@ func Xsqlite3AddCheckConstraint(tls *crt.TLS, pParse uintptr, pCheckExpr uintptr
// Set the collation function of the most recently parsed table column
// to the CollSeq given.
-func Xsqlite3AddCollateType(tls *crt.TLS, pParse uintptr, pToken uintptr) { /* sqlite3.c:111767:21: */
+func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr) { /* sqlite3.c:112039:21: */
var p uintptr
var i int32
var zColl uintptr // Dequoted name of collation sequence
var db uintptr
- if (crt.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0) {
+ if (libc.AssignUintptr(&p, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0) {
return
}
i = (int32((*Table)(unsafe.Pointer(p)).FnCol) - 1)
@@ -86960,7 +90501,7 @@ func Xsqlite3AddCollateType(tls *crt.TLS, pParse uintptr, pToken uintptr) { /* s
// Change the most recently parsed column to be a GENERATED ALWAYS AS
// column.
-func Xsqlite3AddGenerated(tls *crt.TLS, pParse uintptr, pExpr uintptr, pType uintptr) { /* sqlite3.c:111802:21: */
+func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType uintptr) { /* sqlite3.c:112074:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -86980,7 +90521,7 @@ __1:
if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) == 1) {
goto __2
}
- Xsqlite3ErrorMsg(tls, pParse, ts+11077 /* "virtual tables c..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+13807 /* "virtual tables c..." */, 0)
goto generated_done
__2:
;
@@ -86993,12 +90534,12 @@ __3:
if !(pType != 0) {
goto __4
}
- if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(7)) && (Xsqlite3_strnicmp(tls, ts+11120 /* "virtual" */, (*Token)(unsafe.Pointer(pType)).Fz, 7) == 0)) {
+ if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(7)) && (Xsqlite3_strnicmp(tls, ts+13850 /* "virtual" */, (*Token)(unsafe.Pointer(pType)).Fz, 7) == 0)) {
goto __5
}
goto __6
__5:
- if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(6)) && (Xsqlite3_strnicmp(tls, ts+11128 /* "stored" */, (*Token)(unsafe.Pointer(pType)).Fz, 6) == 0)) {
+ if !(((*Token)(unsafe.Pointer(pType)).Fn == uint32(6)) && (Xsqlite3_strnicmp(tls, ts+13858 /* "stored" */, (*Token)(unsafe.Pointer(pType)).Fz, 6) == 0)) {
goto __7
}
eType = U8(0x0040)
@@ -87031,8 +90572,8 @@ __10:
goto generated_done
generated_error:
- Xsqlite3ErrorMsg(tls, pParse, ts+11135, /* "error in generat..." */
- crt.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13865, /* "error in generat..." */
+ libc.VaList(bp, (*Column)(unsafe.Pointer(pCol)).FzName))
generated_done:
Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
}
@@ -87054,7 +90595,7 @@ generated_done:
//
// IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments
// the schema-version whenever the schema changes.
-func Xsqlite3ChangeCookie(tls *crt.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:111870:21: */
+func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:112142:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
@@ -87068,7 +90609,7 @@ func Xsqlite3ChangeCookie(tls *crt.TLS, pParse uintptr, iDb int32) { /* sqlite3.
//
// The estimate is conservative. It might be larger that what is
// really needed.
-func identLength(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:111886:12: */
+func identLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:112158:12: */
var n int32
n = 0
__1:
@@ -87102,7 +90643,7 @@ __3:
// characters, does not begin with a digit and is not an SQL keyword,
// then it is copied to the output buffer exactly as it is. Otherwise,
// it is quoted using double-quotes.
-func identPut(tls *crt.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /* sqlite3.c:111907:13: */
+func identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /* sqlite3.c:112179:13: */
var zIdent uintptr = zSignedIdent
var i int32
var j int32
@@ -87114,22 +90655,22 @@ func identPut(tls *crt.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /*
break
}
}
- needQuote = (crt.Bool32(((((int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIdent + uintptr(0)))]) & 0x04) != 0) ||
+ needQuote = (libc.Bool32(((((int32(Xsqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIdent + uintptr(0)))]) & 0x04) != 0) ||
(Xsqlite3KeywordCode(tls, zIdent, j) != 59)) ||
(int32(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) != 0)) ||
(j == 0)))
if needQuote != 0 {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&i, 1)))) = int8('"')
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = int8('"')
}
for j = 0; *(*uint8)(unsafe.Pointer(zIdent + uintptr(j))) != 0; j++ {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&i, 1)))) = int8(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j))))
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = int8(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j))))
if int32(*(*uint8)(unsafe.Pointer(zIdent + uintptr(j)))) == '"' {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&i, 1)))) = int8('"')
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = int8('"')
}
}
if needQuote != 0 {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&i, 1)))) = int8('"')
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&i, 1)))) = int8('"')
}
*(*int8)(unsafe.Pointer(z + uintptr(i))) = int8(0)
*(*int32)(unsafe.Pointer(pIdx)) = i
@@ -87138,7 +90679,7 @@ func identPut(tls *crt.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { /*
// Generate a CREATE TABLE statement appropriate for the given
// table. Memory to hold the text of the statement is obtained
// from sqliteMalloc() and must be freed by the calling function.
-func createTableStmt(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:111935:13: */
+func createTableStmt(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:112207:13: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -87171,13 +90712,13 @@ __3:
;
n = n + (identLength(tls, (*Table)(unsafe.Pointer(p)).FzName))
if n < 50 {
- zSep = ts + 672 /* "" */
- zSep2 = ts + 11166 /* "," */
- zEnd = ts + 4456 /* ")" */
+ zSep = ts + 781 /* "" */
+ zSep2 = ts + 13896 /* "," */
+ zEnd = ts + 6652 /* ")" */
} else {
- zSep = ts + 11168 /* "\n " */
- zSep2 = ts + 11172 /* ",\n " */
- zEnd = ts + 11177 /* "\n)" */
+ zSep = ts + 13898 /* "\n " */
+ zSep2 = ts + 13902 /* ",\n " */
+ zEnd = ts + 13907 /* "\n)" */
}
n = n + (35 + (6 * int32((*Table)(unsafe.Pointer(p)).FnCol)))
zStmt = Xsqlite3DbMallocRaw(tls, uintptr(0), uint64(n))
@@ -87185,10 +90726,10 @@ __3:
Xsqlite3OomFault(tls, db)
return uintptr(0)
}
- Xsqlite3_snprintf(tls, n, zStmt, ts+11180 /* "CREATE TABLE " */, 0)
+ Xsqlite3_snprintf(tls, n, zStmt, ts+13910 /* "CREATE TABLE " */, 0)
*(*int32)(unsafe.Pointer(bp + 8 /* k */)) = Xsqlite3Strlen30(tls, zStmt)
identPut(tls, zStmt, bp+8 /* &k */, (*Table)(unsafe.Pointer(p)).FzName)
- *(*int8)(unsafe.Pointer(zStmt + uintptr(crt.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 8 /* k */)), 1)))) = int8('(')
+ *(*int8)(unsafe.Pointer(zStmt + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 8 /* k */)), 1)))) = int8('(')
pCol = (*Table)(unsafe.Pointer(p)).FaCol
i = 0
__4:
@@ -87207,7 +90748,7 @@ __4:
zType = azType1[(int32((*Column)(unsafe.Pointer(pCol)).Faffinity) - 0x41)]
len = Xsqlite3Strlen30(tls, zType)
- crt.Xmemcpy(tls, (zStmt + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* k */)))), zType, uint64(len))
+ libc.Xmemcpy(tls, (zStmt + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* k */)))), zType, uint64(len))
*(*int32)(unsafe.Pointer(bp + 8 /* k */)) += len
}
@@ -87219,21 +90760,21 @@ __5:
goto __6
__6:
;
- Xsqlite3_snprintf(tls, (n - *(*int32)(unsafe.Pointer(bp + 8 /* k */))), (zStmt + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* k */)))), ts+696 /* "%s" */, crt.VaList(bp, zEnd))
+ Xsqlite3_snprintf(tls, (n - *(*int32)(unsafe.Pointer(bp + 8 /* k */))), (zStmt + uintptr(*(*int32)(unsafe.Pointer(bp + 8 /* k */)))), ts+805 /* "%s" */, libc.VaList(bp, zEnd))
return zStmt
}
var azType1 = [5]uintptr{
- /* SQLITE_AFF_BLOB */ ts + 672, /* "" */
- /* SQLITE_AFF_TEXT */ ts + 11194, /* " TEXT" */
- /* SQLITE_AFF_NUMERIC */ ts + 11200, /* " NUM" */
- /* SQLITE_AFF_INTEGER */ ts + 11205, /* " INT" */
- /* SQLITE_AFF_REAL */ ts + 11210, /* " REAL" */
-} /* sqlite3.c:111965:23 */
+ /* SQLITE_AFF_BLOB */ ts + 781, /* "" */
+ /* SQLITE_AFF_TEXT */ ts + 13924, /* " TEXT" */
+ /* SQLITE_AFF_NUMERIC */ ts + 13930, /* " NUM" */
+ /* SQLITE_AFF_INTEGER */ ts + 13935, /* " INT" */
+ /* SQLITE_AFF_REAL */ ts + 13940, /* " REAL" */
+} /* sqlite3.c:112237:23 */
// Resize an Index object to hold N columns total. Return SQLITE_OK
// on success and SQLITE_NOMEM on an OOM error.
-func resizeIndexObject(tls *crt.TLS, db uintptr, pIdx uintptr, N int32) int32 { /* sqlite3.c:112003:12: */
+func resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) int32 { /* sqlite3.c:112275:12: */
var zExtra uintptr
var nByte int32
if int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) >= N {
@@ -87245,21 +90786,21 @@ func resizeIndexObject(tls *crt.TLS, db uintptr, pIdx uintptr, N int32) int32 {
if zExtra == uintptr(0) {
return 7
}
- crt.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FazColl, (uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn)))
+ libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FazColl, (uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn)))
(*Index)(unsafe.Pointer(pIdx)).FazColl = zExtra
zExtra += (uintptr(uint64(unsafe.Sizeof(uintptr(0))) * uint64(N)))
- crt.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaiColumn, (uint64(unsafe.Sizeof(I16(0))) * uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn)))
+ libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaiColumn, (uint64(unsafe.Sizeof(I16(0))) * uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn)))
(*Index)(unsafe.Pointer(pIdx)).FaiColumn = zExtra
zExtra += (uintptr(uint64(unsafe.Sizeof(I16(0))) * uint64(N)))
- crt.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn))
+ libc.Xmemcpy(tls, zExtra, (*Index)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*Index)(unsafe.Pointer(pIdx)).FnColumn))
(*Index)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra
(*Index)(unsafe.Pointer(pIdx)).FnColumn = U16(N)
- crt.SetBitFieldPtr16Uint32(pIdx+100 /* &.isResized */, uint32(1), 4, 0x10)
+ libc.SetBitFieldPtr16Uint32(pIdx+100 /* &.isResized */, uint32(1), 4, 0x10)
return 0
}
// Estimate the total row width for a table.
-func estimateTableWidth(tls *crt.TLS, pTab uintptr) { /* sqlite3.c:112027:13: */
+func estimateTableWidth(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:112299:13: */
var wTable uint32 = uint32(0)
var pTabCol uintptr
var i int32
@@ -87287,7 +90828,7 @@ __3:
}
// Estimate the average size of a row for an index.
-func estimateIndexWidth(tls *crt.TLS, pIdx uintptr) { /* sqlite3.c:112041:13: */
+func estimateIndexWidth(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:112313:13: */
var wIndex uint32 = uint32(0)
var i int32
var aCol uintptr = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol
@@ -87307,10 +90848,10 @@ func estimateIndexWidth(tls *crt.TLS, pIdx uintptr) { /* sqlite3.c:112041:13: */
// Return true if column number x is any of the first nCol entries of aiCol[].
// This is used to determine if the column number x appears in any of the
// first nCol entries of an index.
-func hasColumn(tls *crt.TLS, aiCol uintptr, nCol int32, x int32) int32 { /* sqlite3.c:112057:12: */
- for crt.PostDecInt32(&nCol, 1) > 0 {
+func hasColumn(tls *libc.TLS, aiCol uintptr, nCol int32, x int32) int32 { /* sqlite3.c:112329:12: */
+ for libc.PostDecInt32(&nCol, 1) > 0 {
- if x == int32(*(*I16)(unsafe.Pointer(crt.PostIncUintptr(&aiCol, 2)))) {
+ if x == int32(*(*I16)(unsafe.Pointer(libc.PostIncUintptr(&aiCol, 2)))) {
return 1
}
}
@@ -87328,7 +90869,7 @@ func hasColumn(tls *crt.TLS, aiCol uintptr, nCol int32, x int32) int32 { /* sqli
// This routine differs from hasColumn() in that both the column and the
// collating sequence must match for this routine, but for hasColumn() only
// the column name must match.
-func isDupColumn(tls *crt.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int32) int32 { /* sqlite3.c:112080:12: */
+func isDupColumn(tls *libc.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int32) int32 { /* sqlite3.c:112352:12: */
var i int32
var j int32
@@ -87361,7 +90902,7 @@ func isDupColumn(tls *crt.TLS, pIdx uintptr, nKey int32, pPk uintptr, iCol int32
//
// The colNotIdxed mask is AND-ed with the SrcList.a[].colUsed mask
// to determine if the index is covering index.
-func recomputeColumnsNotIndexed(tls *crt.TLS, pIdx uintptr) { /* sqlite3.c:112119:13: */
+func recomputeColumnsNotIndexed(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:112391:13: */
var m Bitmask = uint64(0)
var j int32
var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable
@@ -87387,9 +90928,9 @@ func recomputeColumnsNotIndexed(tls *crt.TLS, pIdx uintptr) { /* sqlite3.c:11211
// (1) Set all columns of the PRIMARY KEY schema object to be NOT NULL.
// (2) Convert P3 parameter of the OP_CreateBtree from BTREE_INTKEY
// into BTREE_BLOBKEY.
-// (3) Bypass the creation of the sqlite_master table entry
+// (3) Bypass the creation of the sqlite_schema table entry
// for the PRIMARY KEY as the primary key index is now
-// identified by the sqlite_master table entry of the table itself.
+// identified by the sqlite_schema table entry of the table itself.
// (4) Set the Index.tnum of the PRIMARY KEY Index object in the
// schema to the rootpage from the main table.
// (5) Add all table columns to the PRIMARY KEY Index object
@@ -87400,7 +90941,7 @@ func recomputeColumnsNotIndexed(tls *crt.TLS, pIdx uintptr) { /* sqlite3.c:11211
// indices with the PRIMARY KEY columns.
//
// For virtual tables, only (1) is performed.
-func convertToWithoutRowidTable(tls *crt.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:112159:13: */
+func convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:112431:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -87460,32 +91001,32 @@ func convertToWithoutRowidTable(tls *crt.TLS, pParse uintptr, pTab uintptr) { /*
// Remove all redundant columns from the PRIMARY KEY. For example, change
// "PRIMARY KEY(a,b,a,b,c,b,c,d)" into just "PRIMARY KEY(a,b,c,d)". Later
// code assumes the PRIMARY KEY contains no repeated columns.
- for i = crt.AssignInt32(&j, 1); i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); i++ {
+ for i = libc.AssignInt32(&j, 1); i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); i++ {
if isDupColumn(tls, pPk, j, pPk, i) != 0 {
(*Index)(unsafe.Pointer(pPk)).FnColumn--
} else {
*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8))
*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(j))) = *(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i)))
- *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(crt.PostIncInt32(&j, 1))*2)) = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))
+ *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(libc.PostIncInt32(&j, 1))*2)) = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))
}
}
(*Index)(unsafe.Pointer(pPk)).FnKeyCol = U16(j)
}
- crt.SetBitFieldPtr16Uint32(pPk+100 /* &.isCovering */, uint32(1), 5, 0x20)
+ libc.SetBitFieldPtr16Uint32(pPk+100 /* &.isCovering */, uint32(1), 5, 0x20)
if !(int32(*(*uint8)(unsafe.Pointer(db + 176 /* &.init */ + 8 /* &.imposterTable */))&0x2>>1) != 0) {
- crt.SetBitFieldPtr16Uint32(pPk+100 /* &.uniqNotNull */, uint32(1), 3, 0x8)
+ libc.SetBitFieldPtr16Uint32(pPk+100 /* &.uniqNotNull */, uint32(1), 3, 0x8)
}
- nPk = int32(crt.AssignPtrUint16(pPk+96 /* &.nColumn */, (*Index)(unsafe.Pointer(pPk)).FnKeyCol))
+ nPk = int32(libc.AssignPtrUint16(pPk+96 /* &.nColumn */, (*Index)(unsafe.Pointer(pPk)).FnKeyCol))
- // Bypass the creation of the PRIMARY KEY btree and the sqlite_master
+ // Bypass the creation of the PRIMARY KEY btree and the sqlite_schema
// table entry. This is only required if currently generating VDBE
// code for a CREATE TABLE (not when parsing one as part of reading
// a database schema).
- if (v != 0) && ((*Index)(unsafe.Pointer(pPk)).Ftnum > 0) {
+ if (v != 0) && ((*Index)(unsafe.Pointer(pPk)).Ftnum > Pgno(0)) {
- Xsqlite3VdbeChangeOpcode(tls, v, (*Index)(unsafe.Pointer(pPk)).Ftnum, uint8(11))
+ Xsqlite3VdbeChangeOpcode(tls, v, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), uint8(11))
}
// The root page of the PRIMARY KEY is the table root page
@@ -87498,7 +91039,7 @@ func convertToWithoutRowidTable(tls *crt.TLS, pParse uintptr, pTab uintptr) { /*
if int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */))&0x3>>0) == 2 {
continue
}
- for i = crt.AssignInt32(&n, 0); i < nPk; i++ {
+ for i = libc.AssignInt32(&n, 0); i < nPk; i++ {
if !(isDupColumn(tls, pIdx, int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol), pPk, i) != 0) {
n++
@@ -87521,7 +91062,7 @@ func convertToWithoutRowidTable(tls *crt.TLS, pParse uintptr, pTab uintptr) { /*
*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8))
if *(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 {
// See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf
- crt.SetBitFieldPtr16Uint32(pIdx+100 /* &.bAscKeyBug */, uint32(1), 9, 0x200)
+ libc.SetBitFieldPtr16Uint32(pIdx+100 /* &.bAscKeyBug */, uint32(1), 9, 0x200)
}
j++
}
@@ -87557,7 +91098,7 @@ func convertToWithoutRowidTable(tls *crt.TLS, pParse uintptr, pTab uintptr) { /*
// Return true if pTab is a virtual table and zName is a shadow table name
// for that virtual table.
-func Xsqlite3IsShadowTableOf(tls *crt.TLS, db uintptr, pTab uintptr, zName uintptr) int32 { /* sqlite3.c:112309:20: */
+func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uintptr) int32 { /* sqlite3.c:112581:20: */
var nName int32 // Length of zName
var pMod uintptr // Module for the virtual table
@@ -87571,7 +91112,7 @@ func Xsqlite3IsShadowTableOf(tls *crt.TLS, db uintptr, pTab uintptr, zName uintp
if int32(*(*int8)(unsafe.Pointer(zName + uintptr(nName)))) != '_' {
return 0
}
- pMod = Xsqlite3HashFind(tls, (db + 504 /* &.aModule */), *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg + uintptr(0)*8)))
+ pMod = Xsqlite3HashFind(tls, (db + 528 /* &.aModule */), *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg + uintptr(0)*8)))
if pMod == uintptr(0) {
return 0
}
@@ -87581,7 +91122,7 @@ func Xsqlite3IsShadowTableOf(tls *crt.TLS, db uintptr, pTab uintptr, zName uintp
if (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxShadowName == uintptr(0) {
return 0
}
- return (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*Module)(unsafe.Pointer(pMod)).FpModule + 184 /* &.xShadowName */))))(tls, ((zName + uintptr(nName)) + uintptr(1)))
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Module)(unsafe.Pointer(pMod)).FpModule + 184 /* &.xShadowName */))))(tls, ((zName + uintptr(nName)) + uintptr(1)))
}
// Return true if zName is a shadow table name in the current database
@@ -87589,10 +91130,10 @@ func Xsqlite3IsShadowTableOf(tls *crt.TLS, db uintptr, pTab uintptr, zName uintp
//
// zName is temporarily modified while this routine is running, but is
// restored to its original value prior to this routine returning.
-func Xsqlite3ShadowTableName(tls *crt.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:112333:20: */
+func Xsqlite3ShadowTableName(tls *libc.TLS, db uintptr, zName uintptr) int32 { /* sqlite3.c:112605:20: */
var zTail uintptr // Pointer to the last "_" in zName
var pTab uintptr // Table that zName is a shadow of
- zTail = crt.Xstrrchr(tls, zName, '_')
+ zTail = libc.Xstrrchr(tls, zName, '_')
if zTail == uintptr(0) {
return 0
}
@@ -87615,18 +91156,18 @@ func Xsqlite3ShadowTableName(tls *crt.TLS, db uintptr, zName uintptr) int32 { /*
// is added to the internal hash tables, assuming no errors have
// occurred.
//
-// An entry for the table is made in the master table on disk, unless
+// An entry for the table is made in the schema table on disk, unless
// this is a temporary table or db->init.busy==1. When db->init.busy==1
-// it means we are reading the sqlite_master table because we just
-// connected to the database or because the sqlite_master table has
+// it means we are reading the sqlite_schema table because we just
+// connected to the database or because the sqlite_schema table has
// recently changed, so the entry for this table already exists in
-// the sqlite_master table. We do not want to create it again.
+// the sqlite_schema table. We do not want to create it again.
//
// If the pSelect argument is not NULL, it means that this routine
// was called to create a table generated from a
// "CREATE TABLE ... AS SELECT ..." statement. The column names of
// the new table will match the result set of the SELECT.
-func Xsqlite3EndTable(tls *crt.TLS, pParse uintptr, pCons uintptr, pEnd uintptr, tabOpts U8, pSelect uintptr) { /* sqlite3.c:112394:21: */
+func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr, tabOpts U8, pSelect uintptr) { /* sqlite3.c:112666:21: */
bp := tls.Alloc(144)
defer tls.Free(144)
@@ -87649,20 +91190,20 @@ func Xsqlite3EndTable(tls *crt.TLS, pParse uintptr, pCons uintptr, pEnd uintptr,
}
// If the db->init.busy is 1 it means we are reading the SQL off the
- // "sqlite_master" or "sqlite_temp_master" table on the disk.
+ // "sqlite_schema" or "sqlite_temp_schema" table on the disk.
// So do not write to the disk again. Extract the root page number
// for the table from the db->init.newTnum field. (The page number
// should have been put there by the sqliteOpenCb routine.)
//
- // If the root page number is 1, that means this is the sqlite_master
+ // If the root page number is 1, that means this is the sqlite_schema
// table itself. So mark it read-only.
if (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0 {
if pSelect != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+672 /* "" */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+781 /* "" */, 0)
return
}
(*Table)(unsafe.Pointer(p)).Ftnum = (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum
- if (*Table)(unsafe.Pointer(p)).Ftnum == 1 {
+ if (*Table)(unsafe.Pointer(p)).Ftnum == Pgno(1) {
*(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(0x0001))
}
}
@@ -87671,11 +91212,11 @@ func Xsqlite3EndTable(tls *crt.TLS, pParse uintptr, pCons uintptr, pEnd uintptr,
if (int32(tabOpts) & 0x0080) != 0 {
if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(0x0008)) != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+11216 /* "AUTOINCREMENT no..." */, 0)
+ ts+13946 /* "AUTOINCREMENT no..." */, 0)
return
}
if ((*Table)(unsafe.Pointer(p)).FtabFlags & U32(0x0004)) == U32(0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+11266 /* "PRIMARY KEY miss..." */, crt.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13996 /* "PRIMARY KEY miss..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(p)).FzName))
return
}
*(*U32)(unsafe.Pointer(p + 64 /* &.tabFlags */)) |= (U32(0x0080 | 0x0200))
@@ -87718,7 +91259,7 @@ func Xsqlite3EndTable(tls *crt.TLS, pParse uintptr, pCons uintptr, pEnd uintptr,
}
}
if nNG == 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+11298 /* "must have at lea..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+14028 /* "must have at lea..." */, 0)
return
}
}
@@ -87730,7 +91271,7 @@ func Xsqlite3EndTable(tls *crt.TLS, pParse uintptr, pCons uintptr, pEnd uintptr,
}
// If not initializing, then create a record for the new table
- // in the SQLITE_MASTER table of the database.
+ // in the schema table of the database.
//
// If this is a TEMPORARY table, write the entry into the auxiliary
// file instead of into the main database file.
@@ -87751,12 +91292,12 @@ func Xsqlite3EndTable(tls *crt.TLS, pParse uintptr, pCons uintptr, pEnd uintptr,
// Initialize zType for the new view or table.
if (*Table)(unsafe.Pointer(p)).FpSelect == uintptr(0) {
// A regular table
- zType = ts + 6019 /* "table" */
- zType2 = ts + 11342 /* "TABLE" */
+ zType = ts + 8217 /* "table" */
+ zType2 = ts + 14072 /* "TABLE" */
} else {
// A view
- zType = ts + 9393 /* "view" */
- zType2 = ts + 11348 /* "VIEW" */
+ zType = ts + 11866 /* "view" */
+ zType2 = ts + 14078 /* "VIEW" */
}
// If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT
@@ -87772,7 +91313,7 @@ func Xsqlite3EndTable(tls *crt.TLS, pParse uintptr, pCons uintptr, pEnd uintptr,
// a schema-lock excludes all other database users, the write-lock would
// be redundant.
if pSelect != 0 {
- // var dest SelectDest at bp+112, 32
+ // var dest SelectDest at bp+104, 40
// Where the SELECT should store results
var regYield int32 // Register holding co-routine entry-point
var addrTop int32 // Top of the co-routine
@@ -87781,9 +91322,9 @@ func Xsqlite3EndTable(tls *crt.TLS, pParse uintptr, pCons uintptr, pEnd uintptr,
var addrInsLoop int32 // Top of the loop for inserting rows
var pSelTab uintptr // A table that describes the SELECT results
- regYield = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- regRec = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- regRowid = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regYield = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regRec = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3MayAbort(tls, pParse)
Xsqlite3VdbeAddOp3(tls, v, 97, 1, (*Parse)(unsafe.Pointer(pParse)).FregRoot, iDb)
@@ -87799,21 +91340,21 @@ func Xsqlite3EndTable(tls *crt.TLS, pParse uintptr, pCons uintptr, pEnd uintptr,
return
}
- (*Table)(unsafe.Pointer(p)).FnCol = crt.AssignPtrInt16(p+72 /* &.nNVCol */, (*Table)(unsafe.Pointer(pSelTab)).FnCol)
+ (*Table)(unsafe.Pointer(p)).FnCol = libc.AssignPtrInt16(p+72 /* &.nNVCol */, (*Table)(unsafe.Pointer(pSelTab)).FnCol)
(*Table)(unsafe.Pointer(p)).FaCol = (*Table)(unsafe.Pointer(pSelTab)).FaCol
(*Table)(unsafe.Pointer(pSelTab)).FnCol = int16(0)
(*Table)(unsafe.Pointer(pSelTab)).FaCol = uintptr(0)
Xsqlite3DeleteTable(tls, db, pSelTab)
- Xsqlite3SelectDestInit(tls, bp+112 /* &dest */, 13, regYield)
- Xsqlite3Select(tls, pParse, pSelect, bp+112 /* &dest */)
+ Xsqlite3SelectDestInit(tls, bp+104 /* &dest */, 13, regYield)
+ Xsqlite3Select(tls, pParse, pSelect, bp+104 /* &dest */)
if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
return
}
Xsqlite3VdbeEndCoroutine(tls, v, regYield)
Xsqlite3VdbeJumpHere(tls, v, (addrTop - 1))
- addrInsLoop = Xsqlite3VdbeAddOp1(tls, v, 14, (*SelectDest)(unsafe.Pointer(bp+112 /* &dest */)).FiSDParm)
+ addrInsLoop = Xsqlite3VdbeAddOp1(tls, v, 14, (*SelectDest)(unsafe.Pointer(bp+104 /* &dest */)).FiSDParm)
- Xsqlite3VdbeAddOp3(tls, v, 91, (*SelectDest)(unsafe.Pointer(bp+112 /* &dest */)).FiSdst, (*SelectDest)(unsafe.Pointer(bp+112 /* &dest */)).FnSdst, regRec)
+ Xsqlite3VdbeAddOp3(tls, v, 91, (*SelectDest)(unsafe.Pointer(bp+104 /* &dest */)).FiSdst, (*SelectDest)(unsafe.Pointer(bp+104 /* &dest */)).FnSdst, regRec)
Xsqlite3TableAffinity(tls, v, p, 0)
Xsqlite3VdbeAddOp2(tls, v, 120, 1, regRowid)
Xsqlite3VdbeAddOp3(tls, v, 121, 1, regRec, regRowid)
@@ -87837,16 +91378,16 @@ func Xsqlite3EndTable(tls *crt.TLS, pParse uintptr, pCons uintptr, pEnd uintptr,
n = int32(uint32(n) + ((*Token)(unsafe.Pointer(pEnd2)).Fn))
}
zStmt = Xsqlite3MPrintf(tls, db,
- ts+11353 /* "CREATE %s %.*s" */, crt.VaList(bp+8, zType2, n, (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz))
+ ts+14083 /* "CREATE %s %.*s" */, libc.VaList(bp+8, zType2, n, (*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz))
}
// A slot for the record has already been allocated in the
- // SQLITE_MASTER table. We just need to update that slot with all
+ // schema table. We just need to update that slot with all
// the information we've collected.
Xsqlite3NestedParse(tls, pParse,
- ts+11368, /* "UPDATE %Q.%s SET..." */
- crt.VaList(bp+32, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, ts+5324, /* "sqlite_master" */
+ ts+14098, /* "UPDATE %Q.sqlite..." */
+ libc.VaList(bp+32, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName,
zType,
(*Table)(unsafe.Pointer(p)).FzName,
(*Table)(unsafe.Pointer(p)).FzName,
@@ -87863,14 +91404,14 @@ func Xsqlite3EndTable(tls *crt.TLS, pParse uintptr, pCons uintptr, pEnd uintptr,
if (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) {
Xsqlite3NestedParse(tls, pParse,
- ts+11455, /* "CREATE TABLE %Q...." */
- crt.VaList(bp+96, (*Db)(unsafe.Pointer(pDb)).FzDbSName))
+ ts+14196, /* "CREATE TABLE %Q...." */
+ libc.VaList(bp+88, (*Db)(unsafe.Pointer(pDb)).FzDbSName))
}
}
// Reparse everything to update our internal data structures
Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb,
- Xsqlite3MPrintf(tls, db, ts+11497 /* "tbl_name='%q' AN..." */, crt.VaList(bp+104, (*Table)(unsafe.Pointer(p)).FzName)))
+ Xsqlite3MPrintf(tls, db, ts+14238 /* "tbl_name='%q' AN..." */, libc.VaList(bp+96, (*Table)(unsafe.Pointer(p)).FzName)))
}
// Add the table to the in-memory representation of the database.
@@ -87901,7 +91442,7 @@ func Xsqlite3EndTable(tls *crt.TLS, pParse uintptr, pCons uintptr, pEnd uintptr,
}
// The parser calls this routine in order to create a new VIEW
-func Xsqlite3CreateView(tls *crt.TLS, pParse uintptr, pBegin uintptr, pName1 uintptr, pName2 uintptr, pCNames uintptr, pSelect uintptr, isTemp int32, noErr int32) { /* sqlite3.c:112685:21: */
+func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 uintptr, pName2 uintptr, pCNames uintptr, pSelect uintptr, isTemp int32, noErr int32) { /* sqlite3.c:112957:21: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -87922,7 +91463,7 @@ func Xsqlite3CreateView(tls *crt.TLS, pParse uintptr, pBegin uintptr, pName1 uin
if !(int32((*Parse)(unsafe.Pointer(pParse)).FnVar) > 0) {
goto __1
}
- Xsqlite3ErrorMsg(tls, pParse, ts+11531 /* "parameters are n..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+14272 /* "parameters are n..." */, 0)
goto create_view_fail
__1:
;
@@ -87936,7 +91477,7 @@ __2:
;
Xsqlite3TwoPartName(tls, pParse, pName1, pName2, bp /* &pName */)
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(p)).FpSchema)
- Xsqlite3FixInit(tls, bp+8 /* &sFix */, pParse, iDb, ts+9393 /* "view" */, *(*uintptr)(unsafe.Pointer(bp /* pName */)))
+ Xsqlite3FixInit(tls, bp+8 /* &sFix */, pParse, iDb, ts+11866 /* "view" */, *(*uintptr)(unsafe.Pointer(bp /* pName */)))
if !(Xsqlite3FixSelect(tls, bp+8 /* &sFix */, pSelect) != 0) {
goto __3
}
@@ -87992,7 +91533,7 @@ __9:
(*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fz = (z + uintptr((n - 1)))
(*Token)(unsafe.Pointer(bp + 56 /* &sEnd */)).Fn = uint32(1)
- // Use sqlite3EndTable() to add the view to the SQLITE_MASTER table
+ // Use sqlite3EndTable() to add the view to the schema table
Xsqlite3EndTable(tls, pParse, uintptr(0), bp+56 /* &sEnd */, uint8(0), uintptr(0))
create_view_fail:
@@ -88010,7 +91551,7 @@ __10:
// The Table structure pTable is really a VIEW. Fill in the names of
// the columns of the view in the pTable structure. Return the number
// of errors. If an error is seen leave an error message in pParse->zErrMsg.
-func Xsqlite3ViewGetColumnNames(tls *crt.TLS, pParse uintptr, pTable uintptr) int32 { /* sqlite3.c:112766:20: */
+func Xsqlite3ViewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) int32 { /* sqlite3.c:113038:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -88053,7 +91594,7 @@ func Xsqlite3ViewGetColumnNames(tls *crt.TLS, pParse uintptr, pTable uintptr) in
// CREATE TEMP VIEW ex1 AS SELECT a FROM ex1;
// SELECT * FROM temp.ex1;
if int32((*Table)(unsafe.Pointer(pTable)).FnCol) < 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+11567 /* "view %s is circu..." */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+14308 /* "view %s is circu..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName))
return 1
}
@@ -88128,7 +91669,7 @@ func Xsqlite3ViewGetColumnNames(tls *crt.TLS, pParse uintptr, pTable uintptr) in
}
// Clear the column names from every VIEW in database idx.
-func sqliteViewResetAll(tls *crt.TLS, db uintptr, idx int32) { /* sqlite3.c:112900:13: */
+func sqliteViewResetAll(tls *libc.TLS, db uintptr, idx int32) { /* sqlite3.c:113168:13: */
var i uintptr
if !((int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(idx)*32)).FpSchema)).FschemaFlags) & (0x0002)) == (0x0002)) {
@@ -88142,7 +91683,7 @@ func sqliteViewResetAll(tls *crt.TLS, db uintptr, idx int32) { /* sqlite3.c:1129
(*Table)(unsafe.Pointer(pTab)).FnCol = int16(0)
}
}
- *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(idx)*32)).FpSchema + 114 /* &.schemaFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0002))))
+ *(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(idx)*32)).FpSchema + 114 /* &.schemaFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0002))))
}
// This function is called by the VDBE to adjust the internal schema
@@ -88160,7 +91701,7 @@ func sqliteViewResetAll(tls *crt.TLS, db uintptr, idx int32) { /* sqlite3.c:1129
// We must continue looping until all tables and indices with
// rootpage==iFrom have been converted to have a rootpage of iTo
// in order to be certain that we got the right one.
-func Xsqlite3RootPageMoved(tls *crt.TLS, db uintptr, iDb int32, iFrom int32, iTo int32) { /* sqlite3.c:112936:21: */
+func Xsqlite3RootPageMoved(tls *libc.TLS, db uintptr, iDb int32, iFrom Pgno, iTo Pgno) { /* sqlite3.c:113204:21: */
var pElem uintptr
var pHash uintptr
var pDb uintptr
@@ -88182,42 +91723,41 @@ func Xsqlite3RootPageMoved(tls *crt.TLS, db uintptr, iDb int32, iFrom int32, iTo
}
}
-/*
-** Write code to erase the table with root-page iTable from database iDb.
-** Also write code to modify the sqlite_master table and internal schema
-** if a root-page of another table is moved by the btree-layer whilst
-** erasing iTable (this can happen with an auto-vacuum database).
- */
-func destroyRootPage(tls *crt.TLS, pParse uintptr, iTable int32, iDb int32) { /* sqlite3.c:112966:13: */
- bp := tls.Alloc(40)
- defer tls.Free(40)
+// Write code to erase the table with root-page iTable from database iDb.
+// Also write code to modify the sqlite_schema table and internal schema
+// if a root-page of another table is moved by the btree-layer whilst
+// erasing iTable (this can happen with an auto-vacuum database).
+func destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { /* sqlite3.c:113234:13: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
if iTable < 2 {
- Xsqlite3ErrorMsg(tls, pParse, ts+11597 /* "corrupt schema" */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+14338 /* "corrupt schema" */, 0)
}
Xsqlite3VdbeAddOp3(tls, v, 136, iTable, r1, iDb)
Xsqlite3MayAbort(tls, pParse)
// OP_Destroy stores an in integer r1. If this integer
// is non-zero, then it is the root page number of a table moved to
- // location iTable. The following code modifies the sqlite_master table to
+ // location iTable. The following code modifies the sqlite_schema table to
// reflect this.
//
// The "#NNN" in the SQL is a special constant that means whatever value
// is in register NNN. See grammar rules associated with the TK_REGISTER
// token for additional information.
Xsqlite3NestedParse(tls, pParse,
- ts+11612, /* "UPDATE %Q.%s SET..." */
- crt.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+uintptr(iDb)*32)).FzDbSName, ts+5324 /* "sqlite_master" */, iTable, r1, r1))
+
+ ts+14353, /* "UPDATE %Q.sqlite..." */
+ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb+uintptr(iDb)*32)).FzDbSName, iTable, r1, r1))
Xsqlite3ReleaseTempReg(tls, pParse, r1)
}
// Write VDBE code to erase table pTab and all associated indices on disk.
-// Code to update the sqlite_master tables and internal schema definitions
+// Code to update the sqlite_schema tables and internal schema definitions
// in case a root-page belonging to another table is moved by the btree layer
// is also added (this can happen with an auto-vacuum database).
-func destroyTable(tls *crt.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:112995:13: */
+func destroyTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:113264:13: */
// If the database may be auto-vacuum capable (if SQLITE_OMIT_AUTOVACUUM
// is not defined), then it is important to call OP_Destroy on the
// table and index root-pages in order, starting with the numerically
@@ -88233,29 +91773,29 @@ func destroyTable(tls *crt.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:112
// database, then root page 5 would be moved to page 4 by the
// "OP_Destroy 4 0" opcode. The subsequent "OP_Destroy 5 0" would hit
// a free-list page.
- var iTab int32 = (*Table)(unsafe.Pointer(pTab)).Ftnum
- var iDestroyed int32 = 0
+ var iTab Pgno = (*Table)(unsafe.Pointer(pTab)).Ftnum
+ var iDestroyed Pgno = Pgno(0)
for 1 != 0 {
var pIdx uintptr
- var iLargest int32 = 0
+ var iLargest Pgno = Pgno(0)
- if (iDestroyed == 0) || (iTab < iDestroyed) {
+ if (iDestroyed == Pgno(0)) || (iTab < iDestroyed) {
iLargest = iTab
}
for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; pIdx != 0; pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
- var iIdx int32 = (*Index)(unsafe.Pointer(pIdx)).Ftnum
+ var iIdx Pgno = (*Index)(unsafe.Pointer(pIdx)).Ftnum
- if ((iDestroyed == 0) || (iIdx < iDestroyed)) && (iIdx > iLargest) {
+ if ((iDestroyed == Pgno(0)) || (iIdx < iDestroyed)) && (iIdx > iLargest) {
iLargest = iIdx
}
}
- if iLargest == 0 {
+ if iLargest == Pgno(0) {
return
} else {
var iDb int32 = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
- destroyRootPage(tls, pParse, iLargest, iDb)
+ destroyRootPage(tls, pParse, int32(iLargest), iDb)
iDestroyed = iLargest
}
}
@@ -88263,7 +91803,7 @@ func destroyTable(tls *crt.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:112
// Remove entries from the sqlite_statN tables (for N in (1,2,3))
// after a DROP INDEX or DROP TABLE command.
-func sqlite3ClearStatTables(tls *crt.TLS, pParse uintptr, iDb int32, zType uintptr, zName uintptr) { /* sqlite3.c:113044:13: */
+func sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uintptr, zName uintptr) { /* sqlite3.c:113313:13: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -88272,19 +91812,19 @@ func sqlite3ClearStatTables(tls *crt.TLS, pParse uintptr, iDb int32, zType uintp
for i = 1; i <= 4; i++ {
// var zTab [24]int8 at bp+40, 24
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([24]int8{})), bp+40 /* &zTab[0] */, ts+11668 /* "sqlite_stat%d" */, crt.VaList(bp, i))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([24]int8{})), bp+40 /* &zTab[0] */, ts+14420 /* "sqlite_stat%d" */, libc.VaList(bp, i))
if Xsqlite3FindTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, bp+40 /* &zTab[0] */, zDbName) != 0 {
Xsqlite3NestedParse(tls, pParse,
- ts+9895, /* "DELETE FROM %Q.%..." */
- crt.VaList(bp+8, zDbName, bp+40 /* &zTab[0] */, zType, zName))
+ ts+12390, /* "DELETE FROM %Q.%..." */
+ libc.VaList(bp+8, zDbName, bp+40 /* &zTab[0] */, zType, zName))
}
}
}
// Generate code to drop a table.
-func Xsqlite3CodeDropTable(tls *crt.TLS, pParse uintptr, pTab uintptr, iDb int32, isView int32) { /* sqlite3.c:113067:21: */
- bp := tls.Alloc(40)
- defer tls.Free(40)
+func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int32, isView int32) { /* sqlite3.c:113336:21: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
var v uintptr
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
@@ -88300,8 +91840,8 @@ func Xsqlite3CodeDropTable(tls *crt.TLS, pParse uintptr, pTab uintptr, iDb int32
}
// Drop all triggers associated with the table being dropped. Code
- // is generated to remove entries from sqlite_master and/or
- // sqlite_temp_master if required.
+ // is generated to remove entries from sqlite_schema and/or
+ // sqlite_temp_schema if required.
pTrigger = Xsqlite3TriggerList(tls, pParse, pTab)
for pTrigger != 0 {
@@ -88315,19 +91855,20 @@ func Xsqlite3CodeDropTable(tls *crt.TLS, pParse uintptr, pTab uintptr, iDb int32
// move as a result of the drop (can happen in auto-vacuum mode).
if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(0x0008)) != 0 {
Xsqlite3NestedParse(tls, pParse,
- ts+11682, /* "DELETE FROM %Q.s..." */
- crt.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName))
+ ts+14434, /* "DELETE FROM %Q.s..." */
+ libc.VaList(bp, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName))
}
- // Drop all SQLITE_MASTER table and index entries that refer to the
- // table. The program name loops through the master table and deletes
+ // Drop all entries in the schema table that refer to the
+ // table. The program name loops through the schema table and deletes
// every row that refers to a table of the same name as the one being
// dropped. Triggers are handled separately because a trigger can be
// created in the temp database that refers to a table in another
// database.
Xsqlite3NestedParse(tls, pParse,
- ts+11727, /* "DELETE FROM %Q.%..." */
- crt.VaList(bp+16, (*Db)(unsafe.Pointer(pDb)).FzDbSName, ts+5324 /* "sqlite_master" */, (*Table)(unsafe.Pointer(pTab)).FzName))
+
+ ts+14479, /* "DELETE FROM %Q.s..." */
+ libc.VaList(bp+16, (*Db)(unsafe.Pointer(pDb)).FzDbSName, (*Table)(unsafe.Pointer(pTab)).FzName))
if !(isView != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
destroyTable(tls, pParse, pTab)
}
@@ -88345,7 +91886,7 @@ func Xsqlite3CodeDropTable(tls *crt.TLS, pParse uintptr, pTab uintptr, iDb int32
// Return TRUE if shadow tables should be read-only in the current
// context.
-func Xsqlite3ReadOnlyShadowTables(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:113139:20: */
+func Xsqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:113409:20: */
if ((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x10000000)) != uint64(0)) &&
((*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx == uintptr(0))) &&
((*Sqlite3)(unsafe.Pointer(db)).FnVdbeExec == 0) {
@@ -88355,12 +91896,12 @@ func Xsqlite3ReadOnlyShadowTables(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c
}
// Return true if it is not allowed to drop the given table
-func tableMayNotBeDropped(tls *crt.TLS, db uintptr, pTab uintptr) int32 { /* sqlite3.c:113154:12: */
- if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7691 /* "sqlite_" */, 7) == 0 {
- if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+2285 /* "stat" */, 4) == 0 {
+func tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) int32 { /* sqlite3.c:113424:12: */
+ if Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10109 /* "sqlite_" */, 7) == 0 {
+ if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+4420 /* "stat" */, 4) == 0 {
return 0
}
- if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+6797 /* "parameters" */, 10) == 0 {
+ if Xsqlite3_strnicmp(tls, ((*Table)(unsafe.Pointer(pTab)).FzName+uintptr(7)), ts+8995 /* "parameters" */, 10) == 0 {
return 0
}
return 1
@@ -88373,7 +91914,7 @@ func tableMayNotBeDropped(tls *crt.TLS, db uintptr, pTab uintptr) int32 { /* sql
// This routine is called to do the work of a DROP TABLE statement.
// pName is the name of the table to be dropped.
-func Xsqlite3DropTable(tls *crt.TLS, pParse uintptr, pName uintptr, isView int32, noErr int32) { /* sqlite3.c:113170:21: */
+func Xsqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int32, noErr int32) { /* sqlite3.c:113440:21: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -88440,9 +91981,9 @@ __7:
zTab = func() uintptr {
if (!(0 != 0)) && (iDb == 1) {
- return ts + 10552 /* "sqlite_temp_mast..." */
+ return ts + 13282 /* "sqlite_temp_mast..." */
}
- return ts + 5324 /* "sqlite_master" */
+ return ts + 7522 /* "sqlite_master" */
}()
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
zArg2 = uintptr(0)
@@ -88501,7 +92042,7 @@ __18:
if !(tableMayNotBeDropped(tls, db, pTab) != 0) {
goto __19
}
- Xsqlite3ErrorMsg(tls, pParse, ts+11783 /* "table %s may not..." */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+14546 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
goto exit_drop_table
__19:
;
@@ -88511,19 +92052,19 @@ __19:
if !((isView != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0))) {
goto __20
}
- Xsqlite3ErrorMsg(tls, pParse, ts+11811 /* "use DROP TABLE t..." */, crt.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+14574 /* "use DROP TABLE t..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
goto exit_drop_table
__20:
;
if !(!(isView != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) {
goto __21
}
- Xsqlite3ErrorMsg(tls, pParse, ts+11845 /* "use DROP VIEW to..." */, crt.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+14608 /* "use DROP VIEW to..." */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
goto exit_drop_table
__21:
;
- // Generate code to remove the table from the master table
+ // Generate code to remove the table from the schema table
// on disk.
v = Xsqlite3GetVdbe(tls, pParse)
if !(v != 0) {
@@ -88533,7 +92074,7 @@ __21:
if !(!(isView != 0)) {
goto __23
}
- sqlite3ClearStatTables(tls, pParse, iDb, ts+10035 /* "tbl" */, (*Table)(unsafe.Pointer(pTab)).FzName)
+ sqlite3ClearStatTables(tls, pParse, iDb, ts+12613 /* "tbl" */, (*Table)(unsafe.Pointer(pTab)).FzName)
Xsqlite3FkDropTable(tls, pParse, pName, pTab)
__23:
;
@@ -88559,7 +92100,7 @@ exit_drop_table:
//
// The foreign key is set for IMMEDIATE processing. A subsequent call
// to sqlite3DeferForeignKey() might change this to DEFERRED.
-func Xsqlite3CreateForeignKey(tls *crt.TLS, pParse uintptr, pFromCol uintptr, pTo uintptr, pToCol uintptr, flags int32) { /* sqlite3.c:113287:21: */
+func Xsqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, pTo uintptr, pToCol uintptr, flags int32) { /* sqlite3.c:113557:21: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -88598,8 +92139,8 @@ __4:
goto __5
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+11877, /* "foreign key on %..." */
- crt.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(iCol)*32)).FzName, pTo))
+ ts+14640, /* "foreign key on %..." */
+ libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(p)).FaCol+uintptr(iCol)*32)).FzName, pTo))
goto fk_end
__5:
;
@@ -88611,7 +92152,7 @@ __2:
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+11940 /* "number of column..." */, 0)
+ ts+14703 /* "number of column..." */, 0)
goto fk_end
goto __7
__6:
@@ -88656,7 +92197,7 @@ __12:
Xsqlite3RenameTokenMap(tls, pParse, z, pTo)
__13:
;
- crt.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pTo)).Fz, uint64((*Token)(unsafe.Pointer(pTo)).Fn))
+ libc.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pTo)).Fz, uint64((*Token)(unsafe.Pointer(pTo)).Fn))
*(*int8)(unsafe.Pointer(z + uintptr((*Token)(unsafe.Pointer(pTo)).Fn))) = int8(0)
Xsqlite3Dequote(tls, z)
z += (uintptr((*Token)(unsafe.Pointer(pTo)).Fn + uint32(1)))
@@ -88695,8 +92236,8 @@ __21:
goto __23
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+12034, /* "unknown column \"..." */
- crt.VaList(bp+16, (*ExprList_item)(unsafe.Pointer((pFromCol+8 /* &.a */)+uintptr(i)*32)).FzEName))
+ ts+14797, /* "unknown column \"..." */
+ libc.VaList(bp+16, (*ExprList_item)(unsafe.Pointer((pFromCol+8 /* &.a */)+uintptr(i)*32)).FzEName))
goto fk_end
__23:
;
@@ -88731,7 +92272,7 @@ __26:
Xsqlite3RenameTokenRemap(tls, pParse, z, (*ExprList_item)(unsafe.Pointer((pToCol+8 /* &.a */)+uintptr(i)*32)).FzEName)
__29:
;
- crt.Xmemcpy(tls, z, (*ExprList_item)(unsafe.Pointer((pToCol+8 /* &.a */)+uintptr(i)*32)).FzEName, uint64(n))
+ libc.Xmemcpy(tls, z, (*ExprList_item)(unsafe.Pointer((pToCol+8 /* &.a */)+uintptr(i)*32)).FzEName, uint64(n))
*(*int8)(unsafe.Pointer(z + uintptr(n))) = int8(0)
z += (uintptr(n + 1))
goto __27
@@ -88780,10 +92321,10 @@ fk_end:
// parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE.
// The behavior of the most recently created foreign key is adjusted
// accordingly.
-func Xsqlite3DeferForeignKey(tls *crt.TLS, pParse uintptr, isDeferred int32) { /* sqlite3.c:113417:21: */
+func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32) { /* sqlite3.c:113687:21: */
var pTab uintptr
var pFKey uintptr
- if ((crt.AssignUintptr(&pTab, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0)) || ((crt.AssignUintptr(&pFKey, (*Table)(unsafe.Pointer(pTab)).FpFKey)) == uintptr(0)) {
+ if ((libc.AssignUintptr(&pTab, (*Parse)(unsafe.Pointer(pParse)).FpNewTable)) == uintptr(0)) || ((libc.AssignUintptr(&pFKey, (*Table)(unsafe.Pointer(pTab)).FpFKey)) == uintptr(0)) {
return
}
// EV: R-30323-21917
@@ -88799,17 +92340,17 @@ func Xsqlite3DeferForeignKey(tls *crt.TLS, pParse uintptr, isDeferred int32) { /
// root page number of the index. If memRootPage is negative, then
// the index already exists and must be cleared before being refilled and
// the root page number of the index is taken from pIndex->tnum.
-func sqlite3RefillIndex(tls *crt.TLS, pParse uintptr, pIndex uintptr, memRootPage int32) { /* sqlite3.c:113438:13: */
+func sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootPage int32) { /* sqlite3.c:113708:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
- var pTab uintptr = (*Index)(unsafe.Pointer(pIndex)).FpTable // The table that is indexed
- var iTab int32 = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) // Btree cursor used for pTab
- var iIdx int32 = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) // Btree cursor used for pIndex
- var iSorter int32 // Cursor opened by OpenSorter (if in use)
- var addr1 int32 // Address of top of loop
- var addr2 int32 // Address to jump to for next iteration
- var tnum int32 // Root page of index
+ var pTab uintptr = (*Index)(unsafe.Pointer(pIndex)).FpTable // The table that is indexed
+ var iTab int32 = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) // Btree cursor used for pTab
+ var iIdx int32 = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) // Btree cursor used for pIndex
+ var iSorter int32 // Cursor opened by OpenSorter (if in use)
+ var addr1 int32 // Address of top of loop
+ var addr2 int32 // Address to jump to for next iteration
+ var tnum Pgno // Root page of index
// var iPartIdxLabel int32 at bp, 4
// Jump to this label to skip a row
var v uintptr // Generate code into this virtual machine
@@ -88831,14 +92372,14 @@ func sqlite3RefillIndex(tls *crt.TLS, pParse uintptr, pIndex uintptr, memRootPag
return
}
if memRootPage >= 0 {
- tnum = memRootPage
+ tnum = Pgno(memRootPage)
} else {
tnum = (*Index)(unsafe.Pointer(pIndex)).Ftnum
}
pKey = Xsqlite3KeyInfoOfIndex(tls, pParse, pIndex)
// Open the sorter cursor if we are to use one.
- iSorter = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ iSorter = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
Xsqlite3VdbeAddOp4(tls, v, 111, iSorter, 0, int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol), Xsqlite3KeyInfoRef(tls, pKey), -9)
// Open the table. Loop through all rows of the table, inserting index
@@ -88854,9 +92395,9 @@ func sqlite3RefillIndex(tls *crt.TLS, pParse uintptr, pIndex uintptr, memRootPag
Xsqlite3VdbeAddOp2(tls, v, 5, iTab, (addr1 + 1))
Xsqlite3VdbeJumpHere(tls, v, addr1)
if memRootPage < 0 {
- Xsqlite3VdbeAddOp2(tls, v, 137, tnum, iDb)
+ Xsqlite3VdbeAddOp2(tls, v, 137, int32(tnum), iDb)
}
- Xsqlite3VdbeAddOp4(tls, v, 97, iIdx, tnum, iDb,
+ Xsqlite3VdbeAddOp4(tls, v, 97, iIdx, int32(tnum), iDb,
pKey, -9)
Xsqlite3VdbeChangeP5(tls, v, (uint16(0x01 | (func() int32 {
if memRootPage >= 0 {
@@ -88911,16 +92452,16 @@ func sqlite3RefillIndex(tls *crt.TLS, pParse uintptr, pIndex uintptr, memRootPag
// Increase the allocation size to provide an extra nExtra bytes
// of 8-byte aligned space after the Index object and return a
// pointer to this extra space in *ppExtra.
-func Xsqlite3AllocateIndexObject(tls *crt.TLS, db uintptr, nCol I16, nExtra int32, ppExtra uintptr) uintptr { /* sqlite3.c:113544:22: */
+func Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int32, ppExtra uintptr) uintptr { /* sqlite3.c:113814:22: */
var p uintptr // Allocated index object
var nByte int32 // Bytes of space for Index object + arrays
- nByte = (int32(((((uint64(unsafe.Sizeof(Index{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))) + (((uint64(unsafe.Sizeof(uintptr(0))) * uint64(nCol)) + uint64(7)) & ^uint64(crt.Int32FromInt32(7)))) + (((((uint64(unsafe.Sizeof(LogEst(0))) * (uint64(int32(nCol) + 1))) + (uint64(unsafe.Sizeof(I16(0))) * uint64(nCol))) + (uint64(unsafe.Sizeof(U8(0))) * uint64(nCol))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))))) // Index.aSortOrder
+ nByte = (int32(((((uint64(unsafe.Sizeof(Index{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))) + (((uint64(unsafe.Sizeof(uintptr(0))) * uint64(nCol)) + uint64(7)) & ^uint64(libc.Int32FromInt32(7)))) + (((((uint64(unsafe.Sizeof(LogEst(0))) * (uint64(int32(nCol) + 1))) + (uint64(unsafe.Sizeof(I16(0))) * uint64(nCol))) + (uint64(unsafe.Sizeof(U8(0))) * uint64(nCol))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))))) // Index.aSortOrder
p = Xsqlite3DbMallocZero(tls, db, (uint64(nByte + nExtra)))
if p != 0 {
- var pExtra uintptr = ((p) + uintptr((((uint64(unsafe.Sizeof(Index{}))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7)))))
+ var pExtra uintptr = ((p) + uintptr((((uint64(unsafe.Sizeof(Index{}))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7)))))
(*Index)(unsafe.Pointer(p)).FazColl = pExtra
- pExtra += (uintptr(((uint64(unsafe.Sizeof(uintptr(0))) * uint64(nCol)) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))))
+ pExtra += (uintptr(((uint64(unsafe.Sizeof(uintptr(0))) * uint64(nCol)) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))))
(*Index)(unsafe.Pointer(p)).FaiRowLogEst = pExtra
pExtra += (uintptr(uint64(unsafe.Sizeof(LogEst(0))) * (uint64(int32(nCol) + 1))))
(*Index)(unsafe.Pointer(p)).FaiColumn = pExtra
@@ -88936,7 +92477,7 @@ func Xsqlite3AllocateIndexObject(tls *crt.TLS, db uintptr, nCol I16, nExtra int3
// If expression list pList contains an expression that was parsed with
// an explicit "NULLS FIRST" or "NULLS LAST" clause, leave an error in
// pParse and return non-zero. Otherwise, return zero.
-func Xsqlite3HasExplicitNulls(tls *crt.TLS, pParse uintptr, pList uintptr) int32 { /* sqlite3.c:113577:20: */
+func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int32 { /* sqlite3.c:113847:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -88945,12 +92486,12 @@ func Xsqlite3HasExplicitNulls(tls *crt.TLS, pParse uintptr, pList uintptr) int32
for i = 0; i < (*ExprList)(unsafe.Pointer(pList)).FnExpr; i++ {
if uint32(int32(*(*uint8)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32 + 20 /* &.bNulls */))&0x20>>5)) != 0 {
var sf U8 = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32)).FsortFlags
- Xsqlite3ErrorMsg(tls, pParse, ts+12080, /* "unsupported use ..." */
- crt.VaList(bp, func() uintptr {
+ Xsqlite3ErrorMsg(tls, pParse, ts+14843, /* "unsupported use ..." */
+ libc.VaList(bp, func() uintptr {
if (int32(sf) == 0) || (int32(sf) == 3) {
- return ts + 12108 /* "FIRST" */
+ return ts + 14871 /* "FIRST" */
}
- return ts + 12114 /* "LAST" */
+ return ts + 14877 /* "LAST" */
}()))
return 1
}
@@ -88969,9 +92510,9 @@ func Xsqlite3HasExplicitNulls(tls *crt.TLS, pParse uintptr, pList uintptr) int32
// pList is a list of columns to be indexed. pList will be NULL if this
// is a primary key or unique-constraint on the most recent column added
// to the table currently under construction.
-func Xsqlite3CreateIndex(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pTblName uintptr, pList uintptr, onError int32, pStart uintptr, pPIWhere uintptr, sortOrder int32, ifNotExist int32, idxType U8) { /* sqlite3.c:113605:21: */
- bp := tls.Alloc(216)
- defer tls.Free(216)
+func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pTblName uintptr, pList uintptr, onError int32, pStart uintptr, pPIWhere uintptr, sortOrder int32, ifNotExist int32, idxType U8) { /* sqlite3.c:113875:21: */
+ bp := tls.Alloc(208)
+ defer tls.Free(208)
var pTab uintptr // Table to be indexed
var pIndex uintptr // The index to be created
@@ -88979,24 +92520,24 @@ func Xsqlite3CreateIndex(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 ui
var nName int32 // Number of characters in zName
var i int32
var j int32
- // var sFix DbFixer at bp+144, 48
+ // var sFix DbFixer at bp+136, 48
// For assigning database names to pTable
var sortOrderMask int32 // 1 to honor DESC in index. 0 to ignore.
var db uintptr
var pDb uintptr // The specific table containing the indexed database
var iDb int32 // Index of the database that is being written
- // var pName uintptr at bp+136, 8
+ // var pName uintptr at bp+128, 8
// Unqualified name of the index to create
var pListItem uintptr // For looping over pList
var nExtra int32 // Space allocated for zExtra[]
var nExtraCol int32 // Number of extra columns needed
- // var zExtra uintptr at bp+208, 8
+ // var zExtra uintptr at bp+200, 8
// Extra space after the Index object
var pPk uintptr
var n int32
var pLoop uintptr
var zDb uintptr
- // var prevCol Token at bp+192, 16
+ // var prevCol Token at bp+184, 16
var pCol uintptr
var pExpr uintptr
@@ -89041,9 +92582,9 @@ func Xsqlite3CreateIndex(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 ui
pIndex = uintptr(0)
zName = uintptr(0)
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
- *(*uintptr)(unsafe.Pointer(bp + 136 /* pName */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)) = uintptr(0)
nExtra = 0
- *(*uintptr)(unsafe.Pointer(bp + 208 /* zExtra */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) = uintptr(0)
pPk = uintptr(0) // PRIMARY KEY index for WITHOUT ROWID tables
if !(((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) || ((*Parse)(unsafe.Pointer(pParse)).FnErr > 0)) {
@@ -89080,7 +92621,7 @@ __4:
// to search for the table. 'Fix' the table name to this db
// before looking up the table.
- iDb = Xsqlite3TwoPartName(tls, pParse, pName1, pName2, bp+136 /* &pName */)
+ iDb = Xsqlite3TwoPartName(tls, pParse, pName1, pName2, bp+128 /* &pName */)
if !(iDb < 0) {
goto __7
}
@@ -89104,8 +92645,8 @@ __9:
__8:
;
- Xsqlite3FixInit(tls, bp+144 /* &sFix */, pParse, iDb, ts+6025 /* "index" */, *(*uintptr)(unsafe.Pointer(bp + 136 /* pName */)))
- if !(Xsqlite3FixSrcList(tls, bp+144 /* &sFix */, pTblName) != 0) {
+ Xsqlite3FixInit(tls, bp+136 /* &sFix */, pParse, iDb, ts+8223 /* "index" */, *(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))
+ if !(Xsqlite3FixSrcList(tls, bp+136 /* &sFix */, pTblName) != 0) {
goto __10
}
// Because the parser constructs pTblName from a single identifier,
@@ -89124,8 +92665,8 @@ __11:
goto __12
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+12119, /* "cannot create a ..." */
- crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ ts+14882, /* "cannot create a ..." */
+ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
goto exit_create_index
__12:
;
@@ -89151,26 +92692,26 @@ __6:
;
pDb = ((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)
- if !(((Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7691 /* "sqlite_" */, 7) == 0) &&
+ if !(((Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10109 /* "sqlite_" */, 7) == 0) &&
(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0)) &&
(pTblName != uintptr(0))) {
goto __15
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12169 /* "table %s may not..." */, crt.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+14932 /* "table %s may not..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
goto exit_create_index
__15:
;
if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) {
goto __16
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12197 /* "views may not be..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+14960 /* "views may not be..." */, 0)
goto exit_create_index
__16:
;
if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
goto __17
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12222 /* "virtual tables m..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+14985 /* "virtual tables m..." */, 0)
goto exit_create_index
__17:
;
@@ -89179,17 +92720,17 @@ __17:
// index or table with the same name.
//
// Exception: If we are reading the names of permanent indices from the
- // sqlite_master table (because some other process changed the schema) and
+ // sqlite_schema table (because some other process changed the schema) and
// one of the index names collides with the name of a temporary table or
// index, then we will continue to process this index.
//
// If pName==0 it means that we are
// dealing with a primary key or UNIQUE constraint. We have to invent our
// own name.
- if !(*(*uintptr)(unsafe.Pointer(bp + 136 /* pName */)) != 0) {
+ if !(*(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)) != 0) {
goto __18
}
- zName = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp + 136 /* pName */)))
+ zName = Xsqlite3NameFromToken(tls, db, *(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))
if !(zName == uintptr(0)) {
goto __20
}
@@ -89197,7 +92738,7 @@ __17:
__20:
;
- if !(0 != Xsqlite3CheckObjectName(tls, pParse, zName, ts+6025 /* "index" */, (*Table)(unsafe.Pointer(pTab)).FzName)) {
+ if !(0 != Xsqlite3CheckObjectName(tls, pParse, zName, ts+8223 /* "index" */, (*Table)(unsafe.Pointer(pTab)).FzName)) {
goto __21
}
goto exit_create_index
@@ -89212,7 +92753,7 @@ __21:
if !(Xsqlite3FindTable(tls, db, zName, uintptr(0)) != uintptr(0)) {
goto __24
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12256 /* "there is already..." */, crt.VaList(bp+16, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+15019 /* "there is already..." */, libc.VaList(bp+16, zName))
goto exit_create_index
__24:
;
@@ -89224,7 +92765,7 @@ __23:
if !(!(ifNotExist != 0)) {
goto __26
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12290 /* "index %s already..." */, crt.VaList(bp+24, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+15053 /* "index %s already..." */, libc.VaList(bp+24, zName))
goto __27
__26:
;
@@ -89252,7 +92793,7 @@ __29:
goto __30
__30:
;
- zName = Xsqlite3MPrintf(tls, db, ts+12314 /* "sqlite_autoindex..." */, crt.VaList(bp+32, (*Table)(unsafe.Pointer(pTab)).FzName, n))
+ zName = Xsqlite3MPrintf(tls, db, ts+15077 /* "sqlite_autoindex..." */, libc.VaList(bp+32, (*Table)(unsafe.Pointer(pTab)).FzName, n))
if !(zName == uintptr(0)) {
goto __31
}
@@ -89281,9 +92822,9 @@ __19:
zDb = (*Db)(unsafe.Pointer(pDb)).FzDbSName
if !(Xsqlite3AuthCheck(tls, pParse, 18, func() uintptr {
if (!(0 != 0)) && (iDb == 1) {
- return ts + 10552 /* "sqlite_temp_mast..." */
+ return ts + 13282 /* "sqlite_temp_mast..." */
}
- return ts + 5324 /* "sqlite_master" */
+ return ts + 7522 /* "sqlite_master" */
}(), uintptr(0), zDb) != 0) {
goto __34
}
@@ -89314,9 +92855,9 @@ __33:
}
pCol = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr((int32((*Table)(unsafe.Pointer(pTab)).FnCol)-1))*32)
*(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) |= U16((0x0008))
- Xsqlite3TokenInit(tls, bp+192 /* &prevCol */, (*Column)(unsafe.Pointer(pCol)).FzName)
+ Xsqlite3TokenInit(tls, bp+184 /* &prevCol */, (*Column)(unsafe.Pointer(pCol)).FzName)
pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0),
- Xsqlite3ExprAlloc(tls, db, 59, bp+192 /* &prevCol */, 0))
+ Xsqlite3ExprAlloc(tls, db, 59, bp+184 /* &prevCol */, 0))
if !(pList == uintptr(0)) {
goto __39
}
@@ -89327,7 +92868,7 @@ __39:
Xsqlite3ExprListSetSortOrder(tls, pList, sortOrder, -1)
goto __38
__37:
- Xsqlite3ExprListCheckLength(tls, pParse, pList, ts+6025 /* "index" */)
+ Xsqlite3ExprListCheckLength(tls, pParse, pList, ts+8223 /* "index" */)
if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
goto __40
}
@@ -89369,7 +92910,7 @@ __43:
}
pIndex = Xsqlite3AllocateIndexObject(tls, db, (int16((*ExprList)(unsafe.Pointer(pList)).FnExpr + nExtraCol)),
- ((nName + nExtra) + 1), bp+208 /* &zExtra */)
+ ((nName + nExtra) + 1), bp+200 /* &zExtra */)
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __45
}
@@ -89377,13 +92918,13 @@ __43:
__45:
;
- (*Index)(unsafe.Pointer(pIndex)).FzName = *(*uintptr)(unsafe.Pointer(bp + 208 /* zExtra */))
- *(*uintptr)(unsafe.Pointer(bp + 208 /* zExtra */)) += (uintptr(nName + 1))
- crt.Xmemcpy(tls, (*Index)(unsafe.Pointer(pIndex)).FzName, zName, (uint64(nName + 1)))
+ (*Index)(unsafe.Pointer(pIndex)).FzName = *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */))
+ *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) += (uintptr(nName + 1))
+ libc.Xmemcpy(tls, (*Index)(unsafe.Pointer(pIndex)).FzName, zName, (uint64(nName + 1)))
(*Index)(unsafe.Pointer(pIndex)).FpTable = pTab
(*Index)(unsafe.Pointer(pIndex)).FonError = U8(onError)
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.uniqNotNull */, (uint32(crt.Bool32(onError != 0))), 3, 0x8)
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.idxType */, uint32(idxType), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.uniqNotNull */, (uint32(libc.Bool32(onError != 0))), 3, 0x8)
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.idxType */, uint32(idxType), 0, 0x3)
(*Index)(unsafe.Pointer(pIndex)).FpSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
(*Index)(unsafe.Pointer(pIndex)).FnKeyCol = U16((*ExprList)(unsafe.Pointer(pList)).FnExpr)
if !(pPIWhere != 0) {
@@ -89444,7 +92985,7 @@ __53:
goto __56
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+12337 /* "expressions proh..." */, 0)
+ ts+15100 /* "expressions proh..." */, 0)
goto exit_create_index
__56:
;
@@ -89457,7 +92998,7 @@ __57:
;
j = -2
*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-2)
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.uniqNotNull */, uint32(0), 3, 0x8)
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.uniqNotNull */, uint32(0), 3, 0x8)
goto __55
__54:
j = int32((*Expr)(unsafe.Pointer(pCExpr)).FiColumn)
@@ -89471,13 +93012,13 @@ __58:
if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*32)).FnotNull) == 0) {
goto __60
}
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.uniqNotNull */, uint32(0), 3, 0x8)
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.uniqNotNull */, uint32(0), 3, 0x8)
__60:
;
if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*32)).FcolFlags) & 0x0020) != 0) {
goto __61
}
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.bHasVCol */, uint32(1), 10, 0x400)
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.bHasVCol */, uint32(1), 10, 0x400)
__61:
;
__59:
@@ -89492,9 +93033,9 @@ __55:
zColl = *(*uintptr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer(pListItem)).FpExpr + 8 /* &.u */))
nColl = (Xsqlite3Strlen30(tls, zColl) + 1)
- crt.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 208 /* zExtra */)), zColl, uint64(nColl))
- zColl = *(*uintptr)(unsafe.Pointer(bp + 208 /* zExtra */))
- *(*uintptr)(unsafe.Pointer(bp + 208 /* zExtra */)) += uintptr(nColl)
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)), zColl, uint64(nColl))
+ zColl = *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */))
+ *(*uintptr)(unsafe.Pointer(bp + 200 /* zExtra */)) += uintptr(nColl)
nExtra = nExtra - (nColl)
goto __63
__62:
@@ -89584,7 +93125,7 @@ __74:
if !((pTblName != uintptr(0)) && (int32((*Index)(unsafe.Pointer(pIndex)).FnColumn) >= int32((*Table)(unsafe.Pointer(pTab)).FnCol))) {
goto __75
}
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.isCovering */, uint32(1), 5, 0x20)
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.isCovering */, uint32(1), 5, 0x20)
j = 0
__76:
if !(j < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
@@ -89602,7 +93143,7 @@ __79:
goto __77
__80:
;
- crt.SetBitFieldPtr16Uint32(pIndex+100 /* &.isCovering */, uint32(0), 5, 0x20)
+ libc.SetBitFieldPtr16Uint32(pIndex+100 /* &.isCovering */, uint32(0), 5, 0x20)
goto __78
goto __77
__77:
@@ -89672,7 +93213,7 @@ __88:
goto __93
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+12398 /* "conflicting ON C..." */, crt.VaList(bp+48, 0))
+ ts+15161 /* "conflicting ON C..." */, libc.VaList(bp+48, 0))
__93:
;
if !(int32((*Index)(unsafe.Pointer(pIdx)).FonError) == 11) {
@@ -89686,7 +93227,7 @@ __92:
if !(int32(idxType) == 2) {
goto __95
}
- crt.SetBitFieldPtr16Uint32(pIdx+100 /* &.idxType */, uint32(idxType), 0, 0x3)
+ libc.SetBitFieldPtr16Uint32(pIdx+100 /* &.idxType */, uint32(idxType), 0, 0x3)
__95:
;
if !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2) {
@@ -89728,8 +93269,8 @@ __81:
if !(Xsqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0) {
goto __101
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12440 /* "invalid rootpage" */, 0)
- (*Parse)(unsafe.Pointer(pParse)).Frc = Xsqlite3CorruptError(tls, 114060)
+ Xsqlite3ErrorMsg(tls, pParse, ts+15203 /* "invalid rootpage" */, 0)
+ (*Parse)(unsafe.Pointer(pParse)).Frc = Xsqlite3CorruptError(tls, 114327)
goto exit_create_index
__101:
;
@@ -89751,7 +93292,7 @@ __98:
if !((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) || (pTblName != uintptr(0))) {
goto __103
}
- iMem = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iMem = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
v = Xsqlite3GetVdbe(tls, pParse)
if !(v == uintptr(0)) {
@@ -89769,7 +93310,7 @@ __104:
// PRIMARY KEY and the table is actually a WITHOUT ROWID table. In
// that case the convertToWithoutRowidTable() routine will replace
// the Noop with a Goto to jump over the VDBE code generated below.
- (*Index)(unsafe.Pointer(pIndex)).Ftnum = Xsqlite3VdbeAddOp0(tls, v, 173)
+ (*Index)(unsafe.Pointer(pIndex)).Ftnum = Pgno(Xsqlite3VdbeAddOp0(tls, v, 173))
Xsqlite3VdbeAddOp3(tls, v, 139, iDb, iMem, 2)
// Gather the complete text of the CREATE INDEX statement into
@@ -89778,21 +93319,21 @@ __104:
if !(pStart != 0) {
goto __105
}
- n1 = (int32(uint32((int32((int64((*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz) - int64((*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136 /* pName */)))).Fz)) / 1))) + (*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn))
- if !(int32(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136 /* pName */)))).Fz + uintptr((n1 - 1))))) == ';') {
+ n1 = (int32(uint32((int32((int64((*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz) - int64((*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))).Fz)) / 1))) + (*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn))
+ if !(int32(*(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))).Fz + uintptr((n1 - 1))))) == ';') {
goto __107
}
n1--
__107:
;
// A named index with an explicit CREATE INDEX statement
- zStmt = Xsqlite3MPrintf(tls, db, ts+12457, /* "CREATE%s INDEX %..." */
- crt.VaList(bp+56, func() uintptr {
+ zStmt = Xsqlite3MPrintf(tls, db, ts+15220, /* "CREATE%s INDEX %..." */
+ libc.VaList(bp+56, func() uintptr {
if onError == 0 {
- return ts + 672 /* "" */
+ return ts + 781 /* "" */
}
- return ts + 12477 /* " UNIQUE" */
- }(), n1, (*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136 /* pName */)))).Fz))
+ return ts + 15240 /* " UNIQUE" */
+ }(), n1, (*Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128 /* pName */)))).Fz))
goto __106
__105:
// An automatic index created by a PRIMARY KEY or UNIQUE constraint
@@ -89801,10 +93342,10 @@ __105:
__106:
;
- // Add an entry in sqlite_master for this index
+ // Add an entry in sqlite_schema for this index
Xsqlite3NestedParse(tls, pParse,
- ts+12485, /* "INSERT INTO %Q.%..." */
- crt.VaList(bp+80, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, ts+5324, /* "sqlite_master" */
+ ts+15248, /* "INSERT INTO %Q.s..." */
+ libc.VaList(bp+80, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName,
(*Index)(unsafe.Pointer(pIndex)).FzName,
(*Table)(unsafe.Pointer(pTab)).FzName,
iMem,
@@ -89819,12 +93360,12 @@ __106:
sqlite3RefillIndex(tls, pParse, pIndex, iMem)
Xsqlite3ChangeCookie(tls, pParse, iDb)
Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb,
- Xsqlite3MPrintf(tls, db, ts+12533 /* "name='%q' AND ty..." */, crt.VaList(bp+128, (*Index)(unsafe.Pointer(pIndex)).FzName)))
+ Xsqlite3MPrintf(tls, db, ts+15307 /* "name='%q' AND ty..." */, libc.VaList(bp+120, (*Index)(unsafe.Pointer(pIndex)).FzName)))
Xsqlite3VdbeAddOp2(tls, v, 158, 0, 1)
__108:
;
- Xsqlite3VdbeJumpHere(tls, v, (*Index)(unsafe.Pointer(pIndex)).Ftnum)
+ Xsqlite3VdbeJumpHere(tls, v, int32((*Index)(unsafe.Pointer(pIndex)).Ftnum))
__103:
;
__99:
@@ -89864,7 +93405,7 @@ __112:
ppFrom = (pTab + 16 /* &.pIndex */)
ppFrom = (pTab + 16 /* &.pIndex */)
__114:
- if !((crt.AssignUintptr(&pThis, *(*uintptr)(unsafe.Pointer(ppFrom)))) != uintptr(0)) {
+ if !((libc.AssignUintptr(&pThis, *(*uintptr)(unsafe.Pointer(ppFrom)))) != uintptr(0)) {
goto __116
}
if !(int32((*Index)(unsafe.Pointer(pThis)).FonError) != 5) {
@@ -89874,7 +93415,7 @@ __114:
__117:
;
__118:
- if !(((crt.AssignUintptr(&pNext, (*Index)(unsafe.Pointer(pThis)).FpNext)) != uintptr(0)) && (int32((*Index)(unsafe.Pointer(pNext)).FonError) != 5)) {
+ if !(((libc.AssignUintptr(&pNext, (*Index)(unsafe.Pointer(pThis)).FpNext)) != uintptr(0)) && (int32((*Index)(unsafe.Pointer(pNext)).FonError) != 5)) {
goto __119
}
*(*uintptr)(unsafe.Pointer(ppFrom)) = pNext
@@ -89916,16 +93457,12 @@ __113:
// Apart from that, we have little to go on besides intuition as to
// how aiRowEst[] should be initialized. The numbers generated here
// are based on typical values found in actual indices.
-func Xsqlite3DefaultRowEst(tls *crt.TLS, pIdx uintptr) { /* sqlite3.c:114201:21: */
- bp := tls.Alloc(10)
- defer tls.Free(10)
-
- // 10, 9, 8, 7, 6
- *(*[5]LogEst)(unsafe.Pointer(bp /* aVal */)) = [5]LogEst{int16(33), int16(32), int16(30), int16(28), int16(26)}
+func Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr) { /* sqlite3.c:114468:21: */
var a uintptr = (*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst
+ var x LogEst
var nCopy int32 = func() int32 {
- if (int32(uint64(unsafe.Sizeof([5]LogEst{})) / uint64(unsafe.Sizeof(LogEst(0))))) < (int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)) {
- return (int32(uint64(unsafe.Sizeof([5]LogEst{})) / uint64(unsafe.Sizeof(LogEst(0)))))
+ if (int32(uint64(unsafe.Sizeof(aVal)) / uint64(unsafe.Sizeof(LogEst(0))))) < (int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)) {
+ return (int32(uint64(unsafe.Sizeof(aVal)) / uint64(unsafe.Sizeof(LogEst(0)))))
}
return int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
}()
@@ -89935,18 +93472,26 @@ func Xsqlite3DefaultRowEst(tls *crt.TLS, pIdx uintptr) { /* sqlite3.c:114201:21:
// Set the first entry (number of rows in the index) to the estimated
// number of rows in the table, or half the number of rows in the table
- // for a partial index. But do not let the estimate drop below 10.
- *(*LogEst)(unsafe.Pointer(a + uintptr(0)*2)) = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FnRowLogEst
- if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != uintptr(0) {
- *(*LogEst)(unsafe.Pointer(a + uintptr(0)*2)) -= int16((10))
+ // for a partial index.
+ //
+ // 2020-05-27: If some of the stat data is coming from the sqlite_stat1
+ // table but other parts we are having to guess at, then do not let the
+ // estimated number of rows in the table be less than 1000 (LogEst 99).
+ // Failure to do this can cause the indexes for which we do not have
+ // stat1 data to be ignored by the query planner.
+ x = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FnRowLogEst
+
+ if int32(x) < 99 {
+ (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FnRowLogEst = libc.AssignInt16(&x, int16(99))
}
- if int32(*(*LogEst)(unsafe.Pointer(a + uintptr(0)*2))) < 33 {
- *(*LogEst)(unsafe.Pointer(a + uintptr(0)*2)) = int16(33)
+ if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere != uintptr(0) {
+ x = int16(int32(x) - (10))
}
+ *(*LogEst)(unsafe.Pointer(a + uintptr(0)*2)) = 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.
- crt.Xmemcpy(tls, (a + uintptr(1)*2), bp /* &aVal[0] */, (uint64(nCopy) * uint64(unsafe.Sizeof(LogEst(0)))))
+ libc.Xmemcpy(tls, (a + uintptr(1)*2), uintptr(unsafe.Pointer(&aVal)), (uint64(nCopy) * uint64(unsafe.Sizeof(LogEst(0)))))
for i = (nCopy + 1); i <= int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ {
*(*LogEst)(unsafe.Pointer(a + uintptr(i)*2)) = int16(23)
}
@@ -89956,11 +93501,13 @@ func Xsqlite3DefaultRowEst(tls *crt.TLS, pIdx uintptr) { /* sqlite3.c:114201:21:
}
}
+var aVal = [5]LogEst{int16(33), int16(32), int16(30), int16(28), int16(26)} /* sqlite3.c:114470:23 */
+
// This routine will drop an existing named index. This routine
// implements the DROP INDEX statement.
-func Xsqlite3DropIndex(tls *crt.TLS, pParse uintptr, pName uintptr, ifExists int32) { /* sqlite3.c:114233:21: */
- bp := tls.Alloc(48)
- defer tls.Free(48)
+func Xsqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists int32) { /* sqlite3.c:114512:21: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
var pIndex uintptr
var v uintptr
@@ -89993,7 +93540,7 @@ __2:
if !(!(ifExists != 0)) {
goto __4
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12560 /* "no such index: %..." */, crt.VaList(bp, pName, 0))
+ Xsqlite3ErrorMsg(tls, pParse, ts+15334 /* "no such index: %..." */, libc.VaList(bp, pName, 0))
goto __5
__4:
Xsqlite3CodeVerifyNamedSchema(tls, pParse, (*SrcList_item)(unsafe.Pointer((pName+8 /* &.a */)+uintptr(0)*112)).FzDatabase)
@@ -90007,7 +93554,7 @@ __3:
goto __6
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+12578 /* "index associated..." */, crt.VaList(bp+16, 0))
+ ts+15352 /* "index associated..." */, libc.VaList(bp+16, 0))
goto exit_drop_index
__6:
;
@@ -90018,9 +93565,9 @@ __6:
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
zTab = func() uintptr {
if (!(0 != 0)) && (iDb == 1) {
- return ts + 10552 /* "sqlite_temp_mast..." */
+ return ts + 13282 /* "sqlite_temp_mast..." */
}
- return ts + 5324 /* "sqlite_master" */
+ return ts + 7522 /* "sqlite_master" */
}()
if !(Xsqlite3AuthCheck(tls, pParse, 9, zTab, uintptr(0), zDb) != 0) {
goto __7
@@ -90041,18 +93588,18 @@ __8:
__9:
;
- // Generate code to remove the index and from the master table
+ // Generate code to remove the index and from the schema table
v = Xsqlite3GetVdbe(tls, pParse)
if !(v != 0) {
goto __10
}
Xsqlite3BeginWriteOperation(tls, pParse, 1, iDb)
Xsqlite3NestedParse(tls, pParse,
- ts+12651, /* "DELETE FROM %Q.%..." */
- crt.VaList(bp+24, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, ts+5324 /* "sqlite_master" */, (*Index)(unsafe.Pointer(pIndex)).FzName))
- sqlite3ClearStatTables(tls, pParse, iDb, ts+10031 /* "idx" */, (*Index)(unsafe.Pointer(pIndex)).FzName)
+ ts+15425, /* "DELETE FROM %Q.s..." */
+ libc.VaList(bp+24, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Index)(unsafe.Pointer(pIndex)).FzName))
+ sqlite3ClearStatTables(tls, pParse, iDb, ts+12609 /* "idx" */, (*Index)(unsafe.Pointer(pIndex)).FzName)
Xsqlite3ChangeCookie(tls, pParse, iDb)
- destroyRootPage(tls, pParse, (*Index)(unsafe.Pointer(pIndex)).Ftnum, iDb)
+ destroyRootPage(tls, pParse, int32((*Index)(unsafe.Pointer(pIndex)).Ftnum), iDb)
Xsqlite3VdbeAddOp4(tls, v, 144, iDb, 0, 0, (*Index)(unsafe.Pointer(pIndex)).FzName, 0)
__10:
;
@@ -90076,9 +93623,9 @@ exit_drop_index:
//
// Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains
// unchanged and a copy of pArray returned.
-func Xsqlite3ArrayAllocate(tls *crt.TLS, db uintptr, pArray uintptr, szEntry int32, pnEntry uintptr, pIdx uintptr) uintptr { /* sqlite3.c:114314:21: */
+func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry int32, pnEntry uintptr, pIdx uintptr) uintptr { /* sqlite3.c:114593:21: */
var z uintptr
- var n Sqlite3_int64 = Sqlite3_int64(crt.AssignPtrInt32(pIdx, *(*int32)(unsafe.Pointer(pnEntry))))
+ var n Sqlite3_int64 = Sqlite3_int64(libc.AssignPtrInt32(pIdx, *(*int32)(unsafe.Pointer(pnEntry))))
if (n & (n - int64(1))) == int64(0) {
var sz Sqlite3_int64
if n == int64(0) {
@@ -90094,7 +93641,7 @@ func Xsqlite3ArrayAllocate(tls *crt.TLS, db uintptr, pArray uintptr, szEntry int
pArray = pNew
}
z = pArray
- crt.Xmemset(tls, (z + uintptr((n * Sqlite3_int64(szEntry)))), 0, uint64(szEntry))
+ libc.Xmemset(tls, (z + uintptr((n * Sqlite3_int64(szEntry)))), 0, uint64(szEntry))
*(*int32)(unsafe.Pointer(pnEntry))++
return pArray
}
@@ -90103,7 +93650,7 @@ func Xsqlite3ArrayAllocate(tls *crt.TLS, db uintptr, pArray uintptr, szEntry int
// need be.
//
// A new IdList is returned, or NULL if malloc() fails.
-func Xsqlite3IdListAppend(tls *crt.TLS, pParse uintptr, pList uintptr, pToken uintptr) uintptr { /* sqlite3.c:114344:23: */
+func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr) uintptr { /* sqlite3.c:114623:23: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -90134,7 +93681,7 @@ func Xsqlite3IdListAppend(tls *crt.TLS, pParse uintptr, pList uintptr, pToken ui
}
// Delete an IdList.
-func Xsqlite3IdListDelete(tls *crt.TLS, db uintptr, pList uintptr) { /* sqlite3.c:114372:21: */
+func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:114651:21: */
var i int32
if pList == uintptr(0) {
return
@@ -90148,7 +93695,7 @@ func Xsqlite3IdListDelete(tls *crt.TLS, db uintptr, pList uintptr) { /* sqlite3.
// Return the index in pList of the identifier named zId. Return -1
// if not found.
-func Xsqlite3IdListIndex(tls *crt.TLS, pList uintptr, zName uintptr) int32 { /* sqlite3.c:114386:20: */
+func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32 { /* sqlite3.c:114665:20: */
var i int32
if pList == uintptr(0) {
return -1
@@ -90186,7 +93733,7 @@ func Xsqlite3IdListIndex(tls *crt.TLS, pList uintptr, zName uintptr) int32 { /*
// If a memory allocation fails or the SrcList becomes too large, leave
// the original SrcList unchanged, return NULL, and leave an error message
// in pParse.
-func Xsqlite3SrcListEnlarge(tls *crt.TLS, pParse uintptr, pSrc uintptr, nExtra int32, iStart int32) uintptr { /* sqlite3.c:114427:24: */
+func Xsqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra int32, iStart int32) uintptr { /* sqlite3.c:114706:24: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -90201,8 +93748,8 @@ func Xsqlite3SrcListEnlarge(tls *crt.TLS, pParse uintptr, pSrc uintptr, nExtra i
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if ((*SrcList)(unsafe.Pointer(pSrc)).FnSrc + nExtra) >= 200 {
- Xsqlite3ErrorMsg(tls, pParse, ts+12700, /* "too many FROM cl..." */
- crt.VaList(bp, 200))
+ Xsqlite3ErrorMsg(tls, pParse, ts+15485, /* "too many FROM cl..." */
+ libc.VaList(bp, 200))
return uintptr(0)
}
if nAlloc > int64(200) {
@@ -90226,7 +93773,7 @@ func Xsqlite3SrcListEnlarge(tls *crt.TLS, pParse uintptr, pSrc uintptr, nExtra i
*(*int32)(unsafe.Pointer(pSrc /* &.nSrc */)) += (nExtra)
// Zero the newly allocated slots
- crt.Xmemset(tls, ((pSrc + 8 /* &.a */) + uintptr(iStart)*112), 0, (uint64(unsafe.Sizeof(SrcList_item{})) * uint64(nExtra)))
+ libc.Xmemset(tls, ((pSrc + 8 /* &.a */) + uintptr(iStart)*112), 0, (uint64(unsafe.Sizeof(SrcList_item{})) * uint64(nExtra)))
for i = iStart; i < (iStart + nExtra); i++ {
(*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor = -1
}
@@ -90268,7 +93815,7 @@ func Xsqlite3SrcListEnlarge(tls *crt.TLS, pParse uintptr, pSrc uintptr, nExtra i
//
// Both pTable and pDatabase are assumed to be quoted. They are dequoted
// before being added to the SrcList.
-func Xsqlite3SrcListAppend(tls *crt.TLS, pParse uintptr, pList uintptr, pTable uintptr, pDatabase uintptr) uintptr { /* sqlite3.c:114516:24: */
+func Xsqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable uintptr, pDatabase uintptr) uintptr { /* sqlite3.c:114795:24: */
var pItem uintptr
var db uintptr
// Cannot have C without B
@@ -90281,7 +93828,7 @@ func Xsqlite3SrcListAppend(tls *crt.TLS, pParse uintptr, pList uintptr, pTable u
}
(*SrcList)(unsafe.Pointer(pList)).FnAlloc = U32(1)
(*SrcList)(unsafe.Pointer(pList)).FnSrc = 1
- crt.Xmemset(tls, ((pList + 8 /* &.a */) + uintptr(0)*112), 0, uint64(unsafe.Sizeof(SrcList_item{})))
+ libc.Xmemset(tls, ((pList + 8 /* &.a */) + uintptr(0)*112), 0, uint64(unsafe.Sizeof(SrcList_item{})))
(*SrcList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(0)*112)).FiCursor = -1
} else {
var pNew uintptr = Xsqlite3SrcListEnlarge(tls, pParse, pList, 1, (*SrcList)(unsafe.Pointer(pList)).FnSrc)
@@ -90307,7 +93854,7 @@ func Xsqlite3SrcListAppend(tls *crt.TLS, pParse uintptr, pList uintptr, pTable u
}
// Assign VdbeCursor index numbers to all tables in a SrcList
-func Xsqlite3SrcListAssignCursors(tls *crt.TLS, pParse uintptr, pList uintptr) { /* sqlite3.c:114561:21: */
+func Xsqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) { /* sqlite3.c:114840:21: */
var i int32
var pItem uintptr
@@ -90322,7 +93869,7 @@ func Xsqlite3SrcListAssignCursors(tls *crt.TLS, pParse uintptr, pList uintptr) {
if (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor >= 0 {
goto __3
}
- (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
if (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0 {
Xsqlite3SrcListAssignCursors(tls, pParse, (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FpSrc)
}
@@ -90338,7 +93885,7 @@ func Xsqlite3SrcListAssignCursors(tls *crt.TLS, pParse uintptr, pList uintptr) {
}
// Delete an entire SrcList including all its substructure.
-func Xsqlite3SrcListDelete(tls *crt.TLS, db uintptr, pList uintptr) { /* sqlite3.c:114579:21: */
+func Xsqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr) { /* sqlite3.c:114858:21: */
var i int32
var pItem uintptr
if pList == uintptr(0) {
@@ -90390,7 +93937,7 @@ __3:
//
// Return a new SrcList which encodes is the FROM with the new
// term added.
-func Xsqlite3SrcListAppendFromTerm(tls *crt.TLS, pParse uintptr, p uintptr, pTable uintptr, pDatabase uintptr, pAlias uintptr, pSubquery uintptr, pOn uintptr, pUsing uintptr) uintptr { /* sqlite3.c:114613:24: */
+func Xsqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTable uintptr, pDatabase uintptr, pAlias uintptr, pSubquery uintptr, pOn uintptr, pUsing uintptr) uintptr { /* sqlite3.c:114892:24: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -90401,12 +93948,12 @@ func Xsqlite3SrcListAppendFromTerm(tls *crt.TLS, pParse uintptr, p uintptr, pTab
if !(!(p != 0) && ((pOn != 0) || (pUsing != 0))) {
goto __1
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12736, /* "a JOIN clause is..." */
- crt.VaList(bp, func() uintptr {
+ Xsqlite3ErrorMsg(tls, pParse, ts+15521, /* "a JOIN clause is..." */
+ libc.VaList(bp, func() uintptr {
if pOn != 0 {
- return ts + 12772 /* "ON" */
+ return ts + 15557 /* "ON" */
}
- return ts + 12775 /* "USING" */
+ return ts + 15560 /* "USING" */
}()))
goto append_from_error
__1:
@@ -90454,7 +94001,7 @@ append_from_error:
// Add an INDEXED BY or NOT INDEXED clause to the most recently added
// element of the source-list passed as the second argument.
-func Xsqlite3SrcListIndexedBy(tls *crt.TLS, pParse uintptr, p uintptr, pIndexedBy uintptr) { /* sqlite3.c:114664:21: */
+func Xsqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexedBy uintptr) { /* sqlite3.c:114943:21: */
if (p != 0) && ((*Token)(unsafe.Pointer(pIndexedBy)).Fn > uint32(0)) {
var pItem uintptr
@@ -90464,22 +94011,40 @@ func Xsqlite3SrcListIndexedBy(tls *crt.TLS, pParse uintptr, p uintptr, pIndexedB
if ((*Token)(unsafe.Pointer(pIndexedBy)).Fn == uint32(1)) && !(int32((*Token)(unsafe.Pointer(pIndexedBy)).Fz) != 0) {
// A "NOT INDEXED" clause was supplied. See parse.y
// construct "indexed_opt" for details.
- crt.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.notIndexed */, uint32(1), 0, 0x1)
+ libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.notIndexed */, uint32(1), 0, 0x1)
} else {
*(*uintptr)(unsafe.Pointer(pItem + 96 /* &.u1 */)) = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pIndexedBy)
- crt.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isIndexedBy */, uint32(1), 1, 0x2)
+ libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isIndexedBy */, uint32(1), 1, 0x2)
+ }
+ }
+}
+
+// Append the contents of SrcList p2 to SrcList p1 and return the resulting
+// SrcList. Or, if an error occurs, return NULL. In all cases, p1 and p2
+// are deleted by this function.
+func Xsqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr) uintptr { /* sqlite3.c:114968:24: */
+
+ if p2 != 0 {
+ var pNew uintptr = Xsqlite3SrcListEnlarge(tls, pParse, p1, (*SrcList)(unsafe.Pointer(p2)).FnSrc, 1)
+ if pNew == uintptr(0) {
+ Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p2)
+ } else {
+ p1 = pNew
+ libc.Xmemcpy(tls, ((p1 + 8 /* &.a */) + uintptr(1)*112), p2+8 /* &.a */, (uint64((*SrcList)(unsafe.Pointer(p2)).FnSrc) * uint64(unsafe.Sizeof(SrcList_item{}))))
+ Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p2)
}
}
+ return p1
}
// Add the list of function arguments to the SrcList entry for a
// table-valued-function.
-func Xsqlite3SrcListFuncArgs(tls *crt.TLS, pParse uintptr, p uintptr, pList uintptr) { /* sqlite3.c:114688:21: */
+func Xsqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uintptr) { /* sqlite3.c:114987:21: */
if p != 0 {
var pItem uintptr = ((p + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(p)).FnSrc-1))*112)
*(*uintptr)(unsafe.Pointer(pItem + 96 /* &.u1 */)) = pList
- crt.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isTabFunc */, uint32(1), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isTabFunc */, uint32(1), 2, 0x4)
} else {
Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pList)
}
@@ -90498,7 +94063,7 @@ func Xsqlite3SrcListFuncArgs(tls *crt.TLS, pParse uintptr, p uintptr, pList uint
// The operator is "natural cross join". The A and B operands are stored
// in p->a[0] and p->a[1], respectively. The parser initially stores the
// operator with A. This routine shifts that operator over to B.
-func Xsqlite3SrcListShiftJoinType(tls *crt.TLS, p uintptr) { /* sqlite3.c:114716:21: */
+func Xsqlite3SrcListShiftJoinType(tls *libc.TLS, p uintptr) { /* sqlite3.c:115015:21: */
if p != 0 {
var i int32
for i = ((*SrcList)(unsafe.Pointer(p)).FnSrc - 1); i > 0; i-- {
@@ -90509,14 +94074,14 @@ func Xsqlite3SrcListShiftJoinType(tls *crt.TLS, p uintptr) { /* sqlite3.c:114716
}
// Generate VDBE code for a BEGIN statement.
-func Xsqlite3BeginTransaction(tls *crt.TLS, pParse uintptr, type1 int32) { /* sqlite3.c:114729:21: */
+func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { /* sqlite3.c:115028:21: */
var db uintptr
var v uintptr
var i int32
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
- if Xsqlite3AuthCheck(tls, pParse, 22, ts+12781 /* "BEGIN" */, uintptr(0), uintptr(0)) != 0 {
+ if Xsqlite3AuthCheck(tls, pParse, 22, ts+15566 /* "BEGIN" */, uintptr(0), uintptr(0)) != 0 {
return
}
v = Xsqlite3GetVdbe(tls, pParse)
@@ -90525,7 +94090,7 @@ func Xsqlite3BeginTransaction(tls *crt.TLS, pParse uintptr, type1 int32) { /* sq
}
if type1 != 7 {
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
- Xsqlite3VdbeAddOp2(tls, v, 2, i, ((crt.Bool32(type1 == 9)) + 1))
+ Xsqlite3VdbeAddOp2(tls, v, 2, i, ((libc.Bool32(type1 == 9)) + 1))
Xsqlite3VdbeUsesBtree(tls, v, i)
}
}
@@ -90535,17 +94100,17 @@ func Xsqlite3BeginTransaction(tls *crt.TLS, pParse uintptr, type1 int32) { /* sq
// Generate VDBE code for a COMMIT or ROLLBACK statement.
// Code for ROLLBACK is generated if eType==TK_ROLLBACK. Otherwise
// code is generated for a COMMIT.
-func Xsqlite3EndTransaction(tls *crt.TLS, pParse uintptr, eType int32) { /* sqlite3.c:114756:21: */
+func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { /* sqlite3.c:115055:21: */
var v uintptr
var isRollback int32
- isRollback = (crt.Bool32(eType == 12))
+ isRollback = (libc.Bool32(eType == 12))
if Xsqlite3AuthCheck(tls, pParse, 22,
func() uintptr {
if isRollback != 0 {
- return ts + 12787 /* "ROLLBACK" */
+ return ts + 15572 /* "ROLLBACK" */
}
- return ts + 12796 /* "COMMIT" */
+ return ts + 15581 /* "COMMIT" */
}(), uintptr(0), uintptr(0)) != 0 {
return
}
@@ -90557,7 +94122,7 @@ func Xsqlite3EndTransaction(tls *crt.TLS, pParse uintptr, eType int32) { /* sqli
// This function is called by the parser when it parses a command to create,
// release or rollback an SQL savepoint.
-func Xsqlite3Savepoint(tls *crt.TLS, pParse uintptr, op int32, pName uintptr) { /* sqlite3.c:114778:21: */
+func Xsqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { /* sqlite3.c:115077:21: */
var zName uintptr = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pName)
if zName != 0 {
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
@@ -90570,11 +94135,11 @@ func Xsqlite3Savepoint(tls *crt.TLS, pParse uintptr, op int32, pName uintptr) {
}
}
-var az = [3]uintptr{ts + 12781 /* "BEGIN" */, ts + 12803 /* "RELEASE" */, ts + 12787 /* "ROLLBACK" */} /* sqlite3.c:114783:23 */
+var az = [3]uintptr{ts + 15566 /* "BEGIN" */, ts + 15588 /* "RELEASE" */, ts + 15572 /* "ROLLBACK" */} /* sqlite3.c:115082:23 */
// Make sure the TEMP database is open and available for use. Return
// the number of errors. Leave any error messages in the pParse structure.
-func Xsqlite3OpenTempDatabase(tls *crt.TLS, pParse uintptr) int32 { /* sqlite3.c:114798:20: */
+func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:115097:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -90586,7 +94151,7 @@ func Xsqlite3OpenTempDatabase(tls *crt.TLS, pParse uintptr) int32 { /* sqlite3.c
rc = Xsqlite3BtreeOpen(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp /* &pBt */, 0, flags)
if rc != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+12811 /* "unable to open a..." */, 0)
+ ts+15596 /* "unable to open a..." */, 0)
(*Parse)(unsafe.Pointer(pParse)).Frc = rc
return 1
}
@@ -90600,13 +94165,13 @@ func Xsqlite3OpenTempDatabase(tls *crt.TLS, pParse uintptr) int32 { /* sqlite3.c
return 0
}
-var flags int32 = ((((0x00000002 | 0x00000004) | 0x00000010) | 0x00000008) | 0x00000200) /* sqlite3.c:114803:22 */
+var flags int32 = ((((0x00000002 | 0x00000004) | 0x00000010) | 0x00000008) | 0x00000200) /* sqlite3.c:115102:22 */
// Record the fact that the schema cookie will need to be verified
// for database iDb. The code to actually verify the schema cookie
// will occur at the end of the top-level VDBE and will be generated
// later, by sqlite3FinishCoding().
-func Xsqlite3CodeVerifySchema(tls *crt.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:114833:21: */
+func Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32) { /* sqlite3.c:115132:21: */
var pToplevel uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -90614,7 +94179,7 @@ func Xsqlite3CodeVerifySchema(tls *crt.TLS, pParse uintptr, iDb int32) { /* sqli
return pParse
}()
- if (crt.Bool32((((*Parse)(unsafe.Pointer(pToplevel)).FcookieMask) & (YDbMask((YDbMask(1))) << (iDb))) != YDbMask(0))) == 0 {
+ if (libc.Bool32((((*Parse)(unsafe.Pointer(pToplevel)).FcookieMask) & (YDbMask((YDbMask(1))) << (iDb))) != YDbMask(0))) == 0 {
*(*YDbMask)(unsafe.Pointer(pToplevel + 116 /* &.cookieMask */)) |= (YDbMask((YDbMask(1))) << (iDb))
if !(0 != 0) && (iDb == 1) {
Xsqlite3OpenTempDatabase(tls, pToplevel)
@@ -90624,7 +94189,7 @@ func Xsqlite3CodeVerifySchema(tls *crt.TLS, pParse uintptr, iDb int32) { /* sqli
// If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each
// attached database. Otherwise, invoke it for the database named zDb only.
-func Xsqlite3CodeVerifyNamedSchema(tls *crt.TLS, pParse uintptr, zDb uintptr) { /* sqlite3.c:114852:21: */
+func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr) { /* sqlite3.c:115151:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var i int32
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
@@ -90646,7 +94211,7 @@ func Xsqlite3CodeVerifyNamedSchema(tls *crt.TLS, pParse uintptr, zDb uintptr) {
// rollback the whole transaction. For operations where all constraints
// can be checked before any changes are made to the database, it is never
// necessary to undo a write and the checkpoint should not be set.
-func Xsqlite3BeginWriteOperation(tls *crt.TLS, pParse uintptr, setStatement int32, iDb int32) { /* sqlite3.c:114876:21: */
+func Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int32, iDb int32) { /* sqlite3.c:115175:21: */
var pToplevel uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -90663,7 +94228,7 @@ func Xsqlite3BeginWriteOperation(tls *crt.TLS, pParse uintptr, setStatement int3
// inserting multiple rows in a table, or inserting a row and index entries.)
// If an abort occurs after some of these writes have completed, then it will
// be necessary to undo the completed writes.
-func Xsqlite3MultiWrite(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:114890:21: */
+func Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:115189:21: */
var pToplevel uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -90687,7 +94252,7 @@ func Xsqlite3MultiWrite(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:114890:21:
// particular, it prevents us from writing an effective
// implementation of sqlite3AssertMayAbort()) and so we have chosen
// to take the safe route and skip the optimization.
-func Xsqlite3MayAbort(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:114911:21: */
+func Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:115210:21: */
var pToplevel uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -90700,7 +94265,7 @@ func Xsqlite3MayAbort(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:114911:21: */
// Code an OP_Halt that causes the vdbe to return an SQLITE_CONSTRAINT
// error. The onError parameter determines which (if any) of the statement
// and/or current transaction is rolled back.
-func Xsqlite3HaltConstraint(tls *crt.TLS, pParse uintptr, errCode int32, onError int32, p4 uintptr, p4type I8, p5Errmsg U8) { /* sqlite3.c:114921:21: */
+func Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onError int32, p4 uintptr, p4type I8, p5Errmsg U8) { /* sqlite3.c:115220:21: */
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
if onError == 2 {
@@ -90711,7 +94276,7 @@ func Xsqlite3HaltConstraint(tls *crt.TLS, pParse uintptr, errCode int32, onError
}
// Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation.
-func Xsqlite3UniqueConstraint(tls *crt.TLS, pParse uintptr, onError int32, pIdx uintptr) { /* sqlite3.c:114941:21: */
+func Xsqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx uintptr) { /* sqlite3.c:115240:21: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -90724,17 +94289,17 @@ func Xsqlite3UniqueConstraint(tls *crt.TLS, pParse uintptr, onError int32, pIdx
Xsqlite3StrAccumInit(tls, bp+8 /* &errMsg */, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), 0,
*(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + uintptr(0)*4)))
if (*Index)(unsafe.Pointer(pIdx)).FaColExpr != 0 {
- Xsqlite3_str_appendf(tls, bp+8 /* &errMsg */, ts+12881 /* "index '%q'" */, crt.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName))
+ Xsqlite3_str_appendf(tls, bp+8 /* &errMsg */, ts+15666 /* "index '%q'" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName))
} else {
for j = 0; j < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); j++ {
var zCol uintptr
zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)))*32)).FzName
if j != 0 {
- Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+12892 /* ", " */, 2)
+ Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+15677 /* ", " */, 2)
}
Xsqlite3_str_appendall(tls, bp+8 /* &errMsg */, (*Table)(unsafe.Pointer(pTab)).FzName)
- Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+685 /* "." */, 1)
+ Xsqlite3_str_append(tls, bp+8 /* &errMsg */, ts+794 /* "." */, 1)
Xsqlite3_str_appendall(tls, bp+8 /* &errMsg */, zCol)
}
}
@@ -90750,18 +94315,18 @@ func Xsqlite3UniqueConstraint(tls *crt.TLS, pParse uintptr, onError int32, pIdx
}
// Code an OP_Halt due to non-unique rowid.
-func Xsqlite3RowidConstraint(tls *crt.TLS, pParse uintptr, onError int32, pTab uintptr) { /* sqlite3.c:114977:21: */
+func Xsqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab uintptr) { /* sqlite3.c:115276:21: */
bp := tls.Alloc(24)
defer tls.Free(24)
var zMsg uintptr
var rc int32
if int32((*Table)(unsafe.Pointer(pTab)).FiPKey) >= 0 {
- zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+10498 /* "%s.%s" */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
+ zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+9978 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
(*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr((*Table)(unsafe.Pointer(pTab)).FiPKey)*32)).FzName))
rc = (19 | (int32(6) << 8))
} else {
- zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+12895 /* "%s.rowid" */, crt.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
+ zMsg = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+9969 /* "%s.rowid" */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
rc = (19 | (int32(10) << 8))
}
Xsqlite3HaltConstraint(tls, pParse, rc, onError, zMsg, int8(-7),
@@ -90770,7 +94335,7 @@ func Xsqlite3RowidConstraint(tls *crt.TLS, pParse uintptr, onError int32, pTab u
// Check to see if pIndex uses the collating sequence pColl. Return
// true if it does and false if it does not.
-func collationMatch(tls *crt.TLS, zColl uintptr, pIndex uintptr) int32 { /* sqlite3.c:115001:12: */
+func collationMatch(tls *libc.TLS, zColl uintptr, pIndex uintptr) int32 { /* sqlite3.c:115300:12: */
var i int32
for i = 0; i < int32((*Index)(unsafe.Pointer(pIndex)).FnColumn); i++ {
@@ -90785,7 +94350,7 @@ func collationMatch(tls *crt.TLS, zColl uintptr, pIndex uintptr) int32 { /* sqli
// Recompute all indices of pTab that use the collating sequence pColl.
// If pColl==0 then recompute all indices of pTab.
-func reindexTable(tls *crt.TLS, pParse uintptr, pTab uintptr, zColl uintptr) { /* sqlite3.c:115020:13: */
+func reindexTable(tls *libc.TLS, pParse uintptr, pTab uintptr, zColl uintptr) { /* sqlite3.c:115319:13: */
if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
var pIndex uintptr // An index associated with pTab
@@ -90802,7 +94367,7 @@ func reindexTable(tls *crt.TLS, pParse uintptr, pTab uintptr, zColl uintptr) { /
// Recompute all indices of all tables in all databases where the
// indices use the collating sequence pColl. If pColl==0 then recompute
// all indices everywhere.
-func reindexDatabases(tls *crt.TLS, pParse uintptr, zColl uintptr) { /* sqlite3.c:115041:13: */
+func reindexDatabases(tls *libc.TLS, pParse uintptr, zColl uintptr) { /* sqlite3.c:115340:13: */
var pDb uintptr // A single database
var iDb int32 // The database index number
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // The database connection
@@ -90843,7 +94408,7 @@ __3:
// Form 2 rebuilds all indices in all databases that use the named
// collating function. Forms 3 and 4 rebuild the named index or all
// indices associated with the named table.
-func Xsqlite3Reindex(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:115073:21: */
+func Xsqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr) { /* sqlite3.c:115372:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -90903,14 +94468,14 @@ func Xsqlite3Reindex(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 uintpt
sqlite3RefillIndex(tls, pParse, pIndex, -1)
return
}
- Xsqlite3ErrorMsg(tls, pParse, ts+12904 /* "unable to identi..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+15680 /* "unable to identi..." */, 0)
}
// Return a KeyInfo structure that is appropriate for the given Index.
//
// The caller should invoke sqlite3KeyInfoUnref() on the returned object
// when it has finished using it.
-func Xsqlite3KeyInfoOfIndex(tls *crt.TLS, pParse uintptr, pIdx uintptr) uintptr { /* sqlite3.c:115133:24: */
+func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr { /* sqlite3.c:115432:24: */
var i int32
var nCol int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
var nKey int32 = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
@@ -90944,7 +94509,7 @@ func Xsqlite3KeyInfoOfIndex(tls *crt.TLS, pParse uintptr, pIdx uintptr) uintptr
// reactive the index. The application had the chance to register
// the missing index using the collation-needed callback. For
// simplicity, SQLite will not give the application a second chance.
- crt.SetBitFieldPtr16Uint32(pIdx+100 /* &.bNoQuery */, uint32(1), 8, 0x100)
+ libc.SetBitFieldPtr16Uint32(pIdx+100 /* &.bNoQuery */, uint32(1), 8, 0x100)
(*Parse)(unsafe.Pointer(pParse)).Frc = (1 | (int32(2) << 8))
}
Xsqlite3KeyInfoUnref(tls, pKey)
@@ -90956,7 +94521,7 @@ func Xsqlite3KeyInfoOfIndex(tls *crt.TLS, pParse uintptr, pIdx uintptr) uintptr
// This routine is invoked once per CTE by the parser while parsing a
// WITH clause.
-func Xsqlite3WithAdd(tls *crt.TLS, pParse uintptr, pWith uintptr, pName uintptr, pArglist uintptr, pQuery uintptr) uintptr { /* sqlite3.c:115178:21: */
+func Xsqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pName uintptr, pArglist uintptr, pQuery uintptr) uintptr { /* sqlite3.c:115477:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -90971,7 +94536,7 @@ func Xsqlite3WithAdd(tls *crt.TLS, pParse uintptr, pWith uintptr, pName uintptr,
var i int32
for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ {
if Xsqlite3StrICmp(tls, zName, (*Cte)(unsafe.Pointer((pWith+16 /* &.a */)+uintptr(i)*32)).FzName) == 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+12950 /* "duplicate WITH t..." */, crt.VaList(bp, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+15726 /* "duplicate WITH t..." */, libc.VaList(bp, zName))
}
}
}
@@ -91000,7 +94565,7 @@ func Xsqlite3WithAdd(tls *crt.TLS, pParse uintptr, pWith uintptr, pName uintptr,
}
// Free the contents of the With object passed as the second argument.
-func Xsqlite3WithDelete(tls *crt.TLS, db uintptr, pWith uintptr) { /* sqlite3.c:115228:21: */
+func Xsqlite3WithDelete(tls *libc.TLS, db uintptr, pWith uintptr) { /* sqlite3.c:115527:21: */
if pWith != 0 {
var i int32
for i = 0; i < (*With)(unsafe.Pointer(pWith)).FnCte; i++ {
@@ -91033,14 +94598,14 @@ func Xsqlite3WithDelete(tls *crt.TLS, db uintptr, pWith uintptr) { /* sqlite3.c:
// Invoke the 'collation needed' callback to request a collation sequence
// in the encoding enc of name zName, length nName.
-func callCollNeeded(tls *crt.TLS, db uintptr, enc int32, zName uintptr) { /* sqlite3.c:115266:13: */
+func callCollNeeded(tls *libc.TLS, db uintptr, enc int32, zName uintptr) { /* sqlite3.c:115565:13: */
if (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded != 0 {
var zExternal uintptr = Xsqlite3DbStrDup(tls, db, zName)
if !(zExternal != 0) {
return
}
- (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 336 /* &.xCollNeeded */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, enc, zExternal)
+ (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 360 /* &.xCollNeeded */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, enc, zExternal)
Xsqlite3DbFree(tls, db, zExternal)
}
if (*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 != 0 {
@@ -91049,7 +94614,7 @@ func callCollNeeded(tls *crt.TLS, db uintptr, enc int32, zName uintptr) { /* sql
Xsqlite3ValueSetStr(tls, pTmp, -1, zName, uint8(1), uintptr(0))
zExternal = Xsqlite3ValueText(tls, pTmp, uint8(2))
if zExternal != 0 {
- (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 344 /* &.xCollNeeded16 */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, int32((*Sqlite3)(unsafe.Pointer(db)).Fenc), zExternal)
+ (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((db + 368 /* &.xCollNeeded16 */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpCollNeededArg, db, int32((*Sqlite3)(unsafe.Pointer(db)).Fenc), zExternal)
}
Xsqlite3ValueFree(tls, pTmp)
}
@@ -91060,14 +94625,14 @@ func callCollNeeded(tls *crt.TLS, db uintptr, enc int32, zName uintptr) { /* sql
// of this collation function (for other text encodings) available. Use one
// of these instead if they exist. Avoid a UTF-8 <-> UTF-16 conversion if
// possible.
-func synthCollSeq(tls *crt.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c:115295:12: */
+func synthCollSeq(tls *libc.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c:115594:12: */
var pColl2 uintptr
var z uintptr = (*CollSeq)(unsafe.Pointer(pColl)).FzName
var i int32
for i = 0; i < 3; i++ {
pColl2 = Xsqlite3FindCollSeq(tls, db, aEnc[i], z, 0)
if (*CollSeq)(unsafe.Pointer(pColl2)).FxCmp != uintptr(0) {
- crt.Xmemcpy(tls, pColl, pColl2, uint64(unsafe.Sizeof(CollSeq{})))
+ libc.Xmemcpy(tls, pColl, pColl2, uint64(unsafe.Sizeof(CollSeq{})))
(*CollSeq)(unsafe.Pointer(pColl)).FxDel = uintptr(0) // Do not copy the destructor
return 0
}
@@ -91075,7 +94640,7 @@ func synthCollSeq(tls *crt.TLS, db uintptr, pColl uintptr) int32 { /* sqlite3.c:
return 1
}
-var aEnc = [3]U8{U8(3), U8(2), U8(1)} /* sqlite3.c:115299:19 */
+var aEnc = [3]U8{U8(3), U8(2), U8(1)} /* sqlite3.c:115598:19 */
// This routine is called on a collation sequence before it is used to
// check that it is defined. An undefined collation sequence exists when
@@ -91086,7 +94651,7 @@ var aEnc = [3]U8{U8(3), U8(2), U8(1)} /* sqlite3.c:115299:19 */
// request a definition of the collating sequence. If this doesn't work,
// an equivalent collating sequence that uses a text encoding different
// from the main database is substituted, if one is available.
-func Xsqlite3CheckCollSeq(tls *crt.TLS, pParse uintptr, pColl uintptr) int32 { /* sqlite3.c:115322:20: */
+func Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32 { /* sqlite3.c:115621:20: */
if (pColl != 0) && ((*CollSeq)(unsafe.Pointer(pColl)).FxCmp == uintptr(0)) {
var zName uintptr = (*CollSeq)(unsafe.Pointer(pColl)).FzName
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
@@ -91109,9 +94674,9 @@ func Xsqlite3CheckCollSeq(tls *crt.TLS, pParse uintptr, pColl uintptr) int32 { /
// Stored immediately after the three collation sequences is a copy of
// the collation sequence name. A pointer to this string is stored in
// each collation sequence structure.
-func findCollSeqEntry(tls *crt.TLS, db uintptr, zName uintptr, create int32) uintptr { /* sqlite3.c:115350:16: */
+func findCollSeqEntry(tls *libc.TLS, db uintptr, zName uintptr, create int32) uintptr { /* sqlite3.c:115649:16: */
var pColl uintptr
- pColl = Xsqlite3HashFind(tls, (db + 576 /* &.aCollSeq */), zName)
+ pColl = Xsqlite3HashFind(tls, (db + 600 /* &.aCollSeq */), zName)
if (uintptr(0) == pColl) && (create != 0) {
var nName int32 = (Xsqlite3Strlen30(tls, zName) + 1)
@@ -91124,8 +94689,8 @@ func findCollSeqEntry(tls *crt.TLS, db uintptr, zName uintptr, create int32) uin
(*CollSeq)(unsafe.Pointer(pColl + uintptr(1)*40)).Fenc = U8(2)
(*CollSeq)(unsafe.Pointer(pColl + uintptr(2)*40)).FzName = (pColl + uintptr(3)*40)
(*CollSeq)(unsafe.Pointer(pColl + uintptr(2)*40)).Fenc = U8(3)
- crt.Xmemcpy(tls, (*CollSeq)(unsafe.Pointer(pColl+uintptr(0)*40)).FzName, zName, uint64(nName))
- pDel = Xsqlite3HashInsert(tls, (db + 576 /* &.aCollSeq */), (*CollSeq)(unsafe.Pointer(pColl+uintptr(0)*40)).FzName, pColl)
+ libc.Xmemcpy(tls, (*CollSeq)(unsafe.Pointer(pColl+uintptr(0)*40)).FzName, zName, uint64(nName))
+ pDel = Xsqlite3HashInsert(tls, (db + 600 /* &.aCollSeq */), (*CollSeq)(unsafe.Pointer(pColl+uintptr(0)*40)).FzName, pColl)
// If a malloc() failure occurred in sqlite3HashInsert(), it will
// return the pColl pointer to be deleted (because it wasn't added
@@ -91154,7 +94719,7 @@ func findCollSeqEntry(tls *crt.TLS, db uintptr, zName uintptr, create int32) uin
// cannot be found.
//
// See also: sqlite3LocateCollSeq(), sqlite3GetCollSeq()
-func Xsqlite3FindCollSeq(tls *crt.TLS, db uintptr, enc U8, zName uintptr, create int32) uintptr { /* sqlite3.c:115402:24: */
+func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, create int32) uintptr { /* sqlite3.c:115701:24: */
var pColl uintptr
if zName != 0 {
@@ -91170,7 +94735,7 @@ func Xsqlite3FindCollSeq(tls *crt.TLS, db uintptr, enc U8, zName uintptr, create
// Change the text encoding for a database connection. This means that
// the pDfltColl must change as well.
-func Xsqlite3SetTextEncoding(tls *crt.TLS, db uintptr, enc U8) { /* sqlite3.c:115424:21: */
+func Xsqlite3SetTextEncoding(tls *libc.TLS, db uintptr, enc U8) { /* sqlite3.c:115723:21: */
(*Sqlite3)(unsafe.Pointer(db)).Fenc = enc
// EVIDENCE-OF: R-08308-17224 The default collating function for all
@@ -91190,7 +94755,7 @@ func Xsqlite3SetTextEncoding(tls *crt.TLS, db uintptr, enc U8) { /* sqlite3.c:11
// sequence can be found. If no collation is found, leave an error message.
//
// See also: sqlite3LocateCollSeq(), sqlite3FindCollSeq()
-func Xsqlite3GetCollSeq(tls *crt.TLS, pParse uintptr, enc U8, pColl uintptr, zName uintptr) uintptr { /* sqlite3.c:115447:24: */
+func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zName uintptr) uintptr { /* sqlite3.c:115746:24: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -91212,7 +94777,7 @@ func Xsqlite3GetCollSeq(tls *crt.TLS, pParse uintptr, enc U8, pColl uintptr, zNa
}
if p == uintptr(0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+12980 /* "no such collatio..." */, crt.VaList(bp, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+15756 /* "no such collatio..." */, libc.VaList(bp, zName))
(*Parse)(unsafe.Pointer(pParse)).Frc = (1 | (int32(1) << 8))
}
return p
@@ -91236,7 +94801,7 @@ func Xsqlite3GetCollSeq(tls *crt.TLS, pParse uintptr, enc U8, pColl uintptr, zNa
// and generates an error message.
//
// See also: sqlite3FindCollSeq(), sqlite3GetCollSeq()
-func Xsqlite3LocateCollSeq(tls *crt.TLS, pParse uintptr, zName uintptr) uintptr { /* sqlite3.c:115498:24: */
+func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr { /* sqlite3.c:115797:24: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var enc U8 = (*Sqlite3)(unsafe.Pointer(db)).Fenc
var initbusy U8 = (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy
@@ -91277,7 +94842,7 @@ func Xsqlite3LocateCollSeq(tls *crt.TLS, pParse uintptr, zName uintptr) uintptr
// If nArg==(-2) then any function with a non-null xSFunc is
// a perfect match and any function with xSFunc NULL is
// a non-match.
-func matchQuality(tls *crt.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlite3.c:115541:12: */
+func matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlite3.c:115840:12: */
var match int32
// Wrong number of arguments means "no match"
@@ -91313,7 +94878,7 @@ func matchQuality(tls *crt.TLS, p uintptr, nArg int32, enc U8) int32 { /* sqlite
// Search a FuncDefHash for a function with the given name. Return
// a pointer to the matching FuncDef if found, or 0 if there is no match.
-func Xsqlite3FunctionSearch(tls *crt.TLS, h int32, zFunc uintptr) uintptr { /* sqlite3.c:115577:24: */
+func Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr { /* sqlite3.c:115876:24: */
var p uintptr
for p = *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) /* &.a */) + uintptr(h)*8)); p != 0; p = *(*uintptr)(unsafe.Pointer(p + 64 /* &.u */)) {
if Xsqlite3StrICmp(tls, (*FuncDef)(unsafe.Pointer(p)).FzName, zFunc) == 0 {
@@ -91324,7 +94889,7 @@ func Xsqlite3FunctionSearch(tls *crt.TLS, h int32, zFunc uintptr) uintptr { /* s
}
// Insert a new FuncDef into a FuncDefHash hash table.
-func Xsqlite3InsertBuiltinFuncs(tls *crt.TLS, aDef uintptr, nDef int32) { /* sqlite3.c:115593:21: */
+func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32) { /* sqlite3.c:115892:21: */
var i int32
for i = 0; i < nDef; i++ {
var pOther uintptr
@@ -91362,7 +94927,7 @@ func Xsqlite3InsertBuiltinFuncs(tls *crt.TLS, aDef uintptr, nDef int32) { /* sql
// If createFlag is false, then a function with the required name and
// number of arguments may be returned even if the eTextRep flag does not
// match that requested.
-func Xsqlite3FindFunction(tls *crt.TLS, db uintptr, zName uintptr, nArg int32, enc U8, createFlag U8) uintptr { /* sqlite3.c:115638:24: */
+func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, enc U8, createFlag U8) uintptr { /* sqlite3.c:115937:24: */
var p uintptr // Iterator variable
var pBest uintptr = uintptr(0) // Best match found so far
var bestScore int32 = 0 // Score of best match
@@ -91372,7 +94937,7 @@ func Xsqlite3FindFunction(tls *crt.TLS, db uintptr, zName uintptr, nArg int32, e
nName = Xsqlite3Strlen30(tls, zName)
// First search for a match amongst the application-defined functions.
- p = Xsqlite3HashFind(tls, (db + 552 /* &.aFunc */), zName)
+ p = Xsqlite3HashFind(tls, (db + 576 /* &.aFunc */), zName)
for p != 0 {
var score int32 = matchQuality(tls, p, nArg, enc)
if score > bestScore {
@@ -91382,18 +94947,17 @@ func Xsqlite3FindFunction(tls *crt.TLS, db uintptr, zName uintptr, nArg int32, e
p = (*FuncDef)(unsafe.Pointer(p)).FpNext
}
- /* If no match is found, search the built-in functions.
- **
- ** If the DBFLAG_PreferBuiltin flag is set, then search the built-in
- ** functions even if a prior app-defined function was found. And give
- ** priority to built-in functions.
- **
- ** Except, if createFlag is true, that means that we are trying to
- ** install a new function. Whatever FuncDef structure is returned it will
- ** have fields overwritten with new information appropriate for the
- ** new function. But the FuncDefs for built-in functions are read-only.
- ** So we must not search for built-ins when creating a new function.
- */
+ // If no match is found, search the built-in functions.
+ //
+ // If the DBFLAG_PreferBuiltin flag is set, then search the built-in
+ // functions even if a prior app-defined function was found. And give
+ // priority to built-in functions.
+ //
+ // Except, if createFlag is true, that means that we are trying to
+ // install a new function. Whatever FuncDef structure is returned it will
+ // have fields overwritten with new information appropriate for the
+ // new function. But the FuncDefs for built-in functions are read-only.
+ // So we must not search for built-ins when creating a new function.
if !(createFlag != 0) && ((pBest == uintptr(0)) || (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0002)) != U32(0))) {
bestScore = 0
h = (((int32(Xsqlite3UpperToLower[U8(*(*int8)(unsafe.Pointer(zName + uintptr(0))))])) + (nName)) % 23)
@@ -91411,17 +94975,17 @@ func Xsqlite3FindFunction(tls *crt.TLS, db uintptr, zName uintptr, nArg int32, e
// If the createFlag parameter is true and the search did not reveal an
// exact match for the name, number of arguments and encoding, then add a
// new entry to the hash table and return it.
- if ((createFlag != 0) && (bestScore < 6)) && ((crt.AssignUintptr(&pBest, Xsqlite3DbMallocZero(tls, db, (uint64((uint64(unsafe.Sizeof(FuncDef{}))+uint64(nName))+uint64(1)))))) != uintptr(0)) {
+ if ((createFlag != 0) && (bestScore < 6)) && ((libc.AssignUintptr(&pBest, Xsqlite3DbMallocZero(tls, db, (uint64((uint64(unsafe.Sizeof(FuncDef{}))+uint64(nName))+uint64(1)))))) != uintptr(0)) {
var pOther uintptr
var z uintptr
(*FuncDef)(unsafe.Pointer(pBest)).FzName = (pBest + uintptr(1)*72)
(*FuncDef)(unsafe.Pointer(pBest)).FnArg = I8(U16(nArg))
(*FuncDef)(unsafe.Pointer(pBest)).FfuncFlags = U32(enc)
- crt.Xmemcpy(tls, (pBest + uintptr(1)*72), zName, (uint64(nName + 1)))
+ libc.Xmemcpy(tls, (pBest + uintptr(1)*72), zName, (uint64(nName + 1)))
for z = (*FuncDef)(unsafe.Pointer(pBest)).FzName; *(*U8)(unsafe.Pointer(z)) != 0; z++ {
*(*U8)(unsafe.Pointer(z)) = Xsqlite3UpperToLower[*(*U8)(unsafe.Pointer(z))]
}
- pOther = Xsqlite3HashInsert(tls, (db + 552 /* &.aFunc */), (*FuncDef)(unsafe.Pointer(pBest)).FzName, pBest)
+ pOther = Xsqlite3HashInsert(tls, (db + 576 /* &.aFunc */), (*FuncDef)(unsafe.Pointer(pBest)).FzName, pBest)
if pOther == pBest {
Xsqlite3DbFree(tls, db, pBest)
Xsqlite3OomFault(tls, db)
@@ -91443,7 +95007,7 @@ func Xsqlite3FindFunction(tls *crt.TLS, db uintptr, zName uintptr, nArg int32, e
// of the schema hash tables).
//
// The Schema.cache_size variable is not cleared.
-func Xsqlite3SchemaClear(tls *crt.TLS, p uintptr) { /* sqlite3.c:115730:21: */
+func Xsqlite3SchemaClear(tls *libc.TLS, p uintptr) { /* sqlite3.c:116029:21: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -91473,15 +95037,15 @@ func Xsqlite3SchemaClear(tls *crt.TLS, p uintptr) { /* sqlite3.c:115730:21: */
if (int32((*Schema)(unsafe.Pointer(pSchema)).FschemaFlags) & 0x0001) != 0 {
(*Schema)(unsafe.Pointer(pSchema)).FiGeneration++
}
- *(*U16)(unsafe.Pointer(pSchema + 114 /* &.schemaFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32((0x0001 | 0x0008)))))
+ *(*U16)(unsafe.Pointer(pSchema + 114 /* &.schemaFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32((0x0001 | 0x0008)))))
}
// Find and return the schema associated with a BTree. Create
// a new one if necessary.
-func Xsqlite3SchemaGet(tls *crt.TLS, db uintptr, pBt uintptr) uintptr { /* sqlite3.c:115762:23: */
+func Xsqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) uintptr { /* sqlite3.c:116061:23: */
var p uintptr
if pBt != 0 {
- p = Xsqlite3BtreeSchema(tls, pBt, int32(unsafe.Sizeof(Schema{})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3SchemaClear})))
+ p = Xsqlite3BtreeSchema(tls, pBt, int32(unsafe.Sizeof(Schema{})), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3SchemaClear})))
} else {
p = Xsqlite3DbMallocZero(tls, uintptr(0), uint64(unsafe.Sizeof(Schema{})))
}
@@ -91525,7 +95089,7 @@ func Xsqlite3SchemaGet(tls *crt.TLS, db uintptr, pBt uintptr) uintptr { /* sqlit
// pSrc->a[0].pTab Pointer to the Table object
// pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one
//
-func Xsqlite3SrcListLookup(tls *crt.TLS, pParse uintptr, pSrc uintptr) uintptr { /* sqlite3.c:115813:22: */
+func Xsqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) uintptr { /* sqlite3.c:116112:22: */
var pItem uintptr = pSrc + 8 /* &.a */
var pTab uintptr
@@ -91548,24 +95112,24 @@ func Xsqlite3SrcListLookup(tls *crt.TLS, pParse uintptr, pSrc uintptr) uintptr {
// 1) It is a virtual table and no implementation of the xUpdate method
// has been provided
//
-// 2) It is a system table (i.e. sqlite_master), this call is not
+// 2) It is a system table (i.e. sqlite_schema), this call is not
// part of a nested parse and writable_schema pragma has not
// been specified
//
// 3) The table is a shadow table, the database connection is in
// defensive mode, and the current sqlite3_prepare()
// is for a top-level SQL statement.
-func tabIsReadOnly(tls *crt.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:115844:12: */
+func tabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:116143:12: */
var db uintptr
if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
- return (crt.Bool32((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pTab))).FpMod)).FpModule)).FxUpdate == uintptr(0)))
+ return (libc.Bool32((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer((*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pTab))).FpMod)).FpModule)).FxUpdate == uintptr(0)))
}
if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & (U32(0x0001 | 0x1000))) == U32(0) {
return 0
}
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
if ((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(0x0001)) != U32(0) {
- return (crt.Bool32((Xsqlite3WritableSchema(tls, db) == 0) && (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)))
+ return (libc.Bool32((Xsqlite3WritableSchema(tls, db) == 0) && (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)))
}
return Xsqlite3ReadOnlyShadowTables(tls, db)
@@ -91574,16 +95138,16 @@ func tabIsReadOnly(tls *crt.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite
// Check to make sure the given table is writable. If it is not
// writable, generate an error message and return 1. If it is
// writable return 0;
-func Xsqlite3IsReadOnly(tls *crt.TLS, pParse uintptr, pTab uintptr, viewOk int32) int32 { /* sqlite3.c:115863:20: */
+func Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int32) int32 { /* sqlite3.c:116162:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
if tabIsReadOnly(tls, pParse, pTab) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+13011 /* "table %s may not..." */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+15787 /* "table %s may not..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
return 1
}
if !(viewOk != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+13040 /* "cannot modify %s..." */, crt.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+15816 /* "cannot modify %s..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
return 1
}
return 0
@@ -91592,11 +95156,11 @@ func Xsqlite3IsReadOnly(tls *crt.TLS, pParse uintptr, pTab uintptr, viewOk int32
// Evaluate a view and store its result in an ephemeral table. The
// pWhere argument is an optional WHERE clause that restricts the
// set of rows in the view that are to be added to the ephemeral table.
-func Xsqlite3MaterializeView(tls *crt.TLS, pParse uintptr, pView uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr, iCur int32) { /* sqlite3.c:115884:21: */
- bp := tls.Alloc(32)
- defer tls.Free(32)
+func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr, iCur int32) { /* sqlite3.c:116183:21: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
- // var dest SelectDest at bp, 32
+ // var dest SelectDest at bp, 40
var pSel uintptr
var pFrom uintptr
@@ -91624,7 +95188,7 @@ func Xsqlite3MaterializeView(tls *crt.TLS, pParse uintptr, pView uintptr, pWhere
// DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL;
// \________/ \________________/
// pTabList pWhere
-func Xsqlite3DeleteFrom(tls *crt.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:116016:21: */
+func Xsqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:116315:21: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -91682,7 +95246,7 @@ func Xsqlite3DeleteFrom(tls *crt.TLS, pParse uintptr, pTabList uintptr, pWhere u
addrLoop = 0
addrEphOpen = 0 // List of table triggers, if required
- crt.Xmemset(tls, bp /* &sContext */, 0, uint64(unsafe.Sizeof(AuthContext{})))
+ libc.Xmemset(tls, bp /* &sContext */, 0, uint64(unsafe.Sizeof(AuthContext{})))
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
if !(((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) {
goto __1
@@ -91706,8 +95270,8 @@ __2:
// Figure out if we have any triggers and if the table being
// deleted from is a view
pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, 126, uintptr(0), uintptr(0))
- isView = (crt.Bool32((*Table)(unsafe.Pointer(pTab)).FpSelect != uintptr(0)))
- bComplex = (crt.Bool32((pTrigger != 0) || (Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0)))
+ isView = (libc.Bool32((*Table)(unsafe.Pointer(pTab)).FpSelect != uintptr(0)))
+ bComplex = (libc.Bool32((pTrigger != 0) || (Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0)))
// If pTab is really a view, make sure it has been initialized.
if !(Xsqlite3ViewGetColumnNames(tls, pParse, pTab) != 0) {
@@ -91742,7 +95306,7 @@ __5:
// Assign cursor numbers to the table and all its indices.
- iTabCur = crt.AssignPtrInt32((pTabList+8 /* &.a */)+uintptr(0)*112+68 /* &.iCursor */, crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1))
+ iTabCur = libc.AssignPtrInt32((pTabList+8 /* &.a */)+uintptr(0)*112+68 /* &.iCursor */, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1))
nIdx = 0
pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex
__6:
@@ -91790,14 +95354,14 @@ __11:
}
Xsqlite3MaterializeView(tls, pParse, pTab,
pWhere, pOrderBy, pLimit, iTabCur)
- *(*int32)(unsafe.Pointer(bp + 80 /* iDataCur */)) = crt.AssignPtrInt32(bp+84 /* iIdxCur */, iTabCur)
+ *(*int32)(unsafe.Pointer(bp + 80 /* iDataCur */)) = libc.AssignPtrInt32(bp+84 /* iIdxCur */, iTabCur)
pOrderBy = uintptr(0)
pLimit = uintptr(0)
__12:
;
// Resolve the column names in the WHERE clause.
- crt.Xmemset(tls, bp+16 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp+16 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp + 16 /* &sNC */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp + 16 /* &sNC */)).FpSrcList = pTabList
if !(Xsqlite3ResolveExprNames(tls, bp+16 /* &sNC */, pWhere) != 0) {
@@ -91814,7 +95378,7 @@ __13:
!(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) {
goto __14
}
- memCnt = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ memCnt = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 69, 0, memCnt)
__14:
;
@@ -91829,10 +95393,11 @@ __14:
// the callback returns SQLITE_IGNORE then the DELETE operation proceeds but
// the truncate optimization is disabled and all rows are deleted
// individually.
- if !((((rcauth == 0) &&
+ if !(((((rcauth == 0) &&
(pWhere == uintptr(0))) &&
!(bComplex != 0)) &&
- !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) {
+ !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) &&
+ ((*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback == uintptr(0))) {
goto __15
}
@@ -91840,7 +95405,7 @@ __14:
if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) {
goto __17
}
- Xsqlite3VdbeAddOp4(tls, v, 137, (*Table)(unsafe.Pointer(pTab)).Ftnum, iDb, func() int32 {
+ Xsqlite3VdbeAddOp4(tls, v, 137, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, func() int32 {
if memCnt != 0 {
return memCnt
}
@@ -91855,7 +95420,7 @@ __18:
goto __20
}
- Xsqlite3VdbeAddOp2(tls, v, 137, (*Index)(unsafe.Pointer(pIdx)).Ftnum, iDb)
+ Xsqlite3VdbeAddOp2(tls, v, 137, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
goto __19
__19:
pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
@@ -91885,7 +95450,7 @@ __21:
// For a rowid table, initialize the RowSet to an empty set
pPk = uintptr(0)
nPk = int16(1)
- iRowSet = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iRowSet = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 72, 0, iRowSet)
goto __23
__22:
@@ -91896,7 +95461,7 @@ __22:
nPk = I16((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
iPk = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (int32(nPk))
- iEphCur = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ iEphCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
addrEphOpen = Xsqlite3VdbeAddOp2(tls, v, 100, iEphCur, int32(nPk))
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pPk)
__23:
@@ -91955,7 +95520,7 @@ __31:
iKey = iPk
goto __28
__27:
- iKey = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iTabCur, -1, iKey)
__28:
;
@@ -91975,7 +95540,7 @@ __28:
goto delete_from_cleanup
__34:
;
- crt.Xmemset(tls, aToOpen, 1, (uint64(nIdx + 1)))
+ libc.Xmemset(tls, aToOpen, 1, (uint64(nIdx + 1)))
*(*U8)(unsafe.Pointer(aToOpen + uintptr((nIdx + 1)))) = U8(0)
if !(*(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + uintptr(0)*4)) >= 0) {
goto __35
@@ -92001,7 +95566,7 @@ __32:
goto __38
}
// Add the PK key for this row to the temporary table
- iKey = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
nKey = int16(0) // Zero tells OP_Found to use a composite key
Xsqlite3VdbeAddOp4(tls, v, 91, iPk, int32(nPk), iKey,
Xsqlite3IndexAffinityStr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pPk), int32(nPk))
@@ -92117,7 +95682,7 @@ __54:
goto __53
__52:
- count = (crt.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)) // True to count changes
+ count = (libc.Bool32(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0)) // True to count changes
Xsqlite3GenerateRowDelete(tls, pParse, pTab, pTrigger, *(*int32)(unsafe.Pointer(bp + 80 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 84 /* iIdxCur */)),
iKey, nKey, uint8(count), uint8(11), uint8(eOnePass), *(*int32)(unsafe.Pointer(bp + 72 /* &aiCurOnePass[0] */ + uintptr(1)*4)))
__53:
@@ -92165,7 +95730,7 @@ __60:
}
Xsqlite3VdbeAddOp2(tls, v, 80, memCnt, 1)
Xsqlite3VdbeSetNumCols(tls, v, 1)
- Xsqlite3VdbeSetColName(tls, v, 0, 0, ts+13078 /* "rows deleted" */, uintptr(0))
+ Xsqlite3VdbeSetColName(tls, v, 0, 0, ts+15854 /* "rows deleted" */, uintptr(0))
__61:
;
@@ -92220,7 +95785,7 @@ delete_from_cleanup:
// starting at iIdxCur) that already points to the index entry to be deleted.
// Except, this optimization is disabled if there are BEFORE triggers since
// the trigger body might have moved the cursor.
-func Xsqlite3GenerateRowDelete(tls *crt.TLS, pParse uintptr, pTab uintptr, pTrigger uintptr, iDataCur int32, iIdxCur int32, iPk int32, nPk I16, count U8, onconf U8, eMode U8, iIdxNoSeek int32) { /* sqlite3.c:116463:21: */
+func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger uintptr, iDataCur int32, iIdxCur int32, iPk int32, nPk I16, count U8, onconf U8, eMode U8, iIdxNoSeek int32) { /* sqlite3.c:116762:21: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Vdbe
var iOld int32 = 0 // First register in OLD.* array
var iLabel int32 // Label resolved to end of generated code
@@ -92292,16 +95857,15 @@ func Xsqlite3GenerateRowDelete(tls *crt.TLS, pParse uintptr, pTab uintptr, pTrig
Xsqlite3FkCheck(tls, pParse, pTab, iOld, 0, uintptr(0), 0)
}
- /* Delete the index and table entries. Skip this step if pTab is really
- ** a view (in which case the only effect of the DELETE statement is to
- ** fire the INSTEAD OF triggers).
- **
- ** If variable 'count' is non-zero, then this OP_Delete instruction should
- ** invoke the update-hook. The pre-update-hook, on the other hand should
- ** be invoked unless table pTab is a system table. The difference is that
- ** the update-hook is not invoked for rows removed by REPLACE, but the
- ** pre-update-hook is.
- */
+ // Delete the index and table entries. Skip this step if pTab is really
+ // a view (in which case the only effect of the DELETE statement is to
+ // fire the INSTEAD OF triggers).
+ //
+ // If variable 'count' is non-zero, then this OP_Delete instruction should
+ // invoke the update-hook. The pre-update-hook, on the other hand should
+ // be invoked unless table pTab is a system table. The difference is that
+ // the update-hook is not invoked for rows removed by REPLACE, but the
+ // pre-update-hook is.
if (*Table)(unsafe.Pointer(pTab)).FpSelect == uintptr(0) {
var p5 U8 = U8(0)
Xsqlite3GenerateRowIndexDelete(tls, pParse, pTab, iDataCur, iIdxCur, uintptr(0), iIdxNoSeek)
@@ -92311,7 +95875,7 @@ func Xsqlite3GenerateRowDelete(tls *crt.TLS, pParse uintptr, pTab uintptr, pTrig
}
return 0
}())
- if (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) || (0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+9925 /* "sqlite_stat1" */)) {
+ if (int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) || (0 == Xsqlite3_stricmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+12438 /* "sqlite_stat1" */)) {
Xsqlite3VdbeAppendP4(tls, v, pTab, -6)
}
if int32(eMode) != 0 {
@@ -92326,9 +95890,9 @@ func Xsqlite3GenerateRowDelete(tls *crt.TLS, pParse uintptr, pTab uintptr, pTrig
Xsqlite3VdbeChangeP5(tls, v, 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
- ** to the row just deleted. */
+ // Do any ON CASCADE, SET NULL or SET DEFAULT operations required to
+ // handle rows (possibly in other tables) that refer via a foreign key
+ // to the row just deleted.
Xsqlite3FkActions(tls, pParse, pTab, uintptr(0), iOld, uintptr(0), 0)
// Invoke AFTER DELETE trigger programs.
@@ -92358,7 +95922,7 @@ func Xsqlite3GenerateRowDelete(tls *crt.TLS, pParse uintptr, pTab uintptr, pTrig
//
// 3. The "iDataCur" cursor must be already be positioned on the row
// that is to be deleted.
-func Xsqlite3GenerateRowIndexDelete(tls *crt.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, aRegIdx uintptr, iIdxNoSeek int32) { /* sqlite3.c:116615:21: */
+func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, aRegIdx uintptr, iIdxNoSeek int32) { /* sqlite3.c:116914:21: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -92446,7 +96010,7 @@ __3:
// This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK
// on a table with multiple indices, and especially with the ROWID or
// PRIMARY KEY columns of the index.
-func Xsqlite3GenerateIndexKey(tls *crt.TLS, pParse uintptr, pIdx uintptr, iDataCur int32, regOut int32, prefixOnly int32, piPartIdxLabel uintptr, pPrior uintptr, regPrior int32) int32 { /* sqlite3.c:116680:20: */
+func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iDataCur int32, regOut int32, prefixOnly int32, piPartIdxLabel uintptr, pPrior uintptr, regPrior int32) int32 { /* sqlite3.c:116979:20: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var j int32
var regBase int32
@@ -92503,7 +96067,7 @@ func Xsqlite3GenerateIndexKey(tls *crt.TLS, pParse uintptr, pIdx uintptr, iDataC
// If a prior call to sqlite3GenerateIndexKey() generated a jump-over label
// because it was a partial index, then this routine should be called to
// resolve that label.
-func Xsqlite3ResolvePartIdxLabel(tls *crt.TLS, pParse uintptr, iLabel int32) { /* sqlite3.c:116744:21: */
+func Xsqlite3ResolvePartIdxLabel(tls *libc.TLS, pParse uintptr, iLabel int32) { /* sqlite3.c:117043:21: */
if iLabel != 0 {
Xsqlite3VdbeResolveLabel(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, iLabel)
}
@@ -92531,24 +96095,24 @@ func Xsqlite3ResolvePartIdxLabel(tls *crt.TLS, pParse uintptr, iLabel int32) { /
// #include "vdbeInt.h"
// Return the collating function associated with a function.
-func sqlite3GetFuncCollSeq(tls *crt.TLS, context uintptr) uintptr { /* sqlite3.c:116778:16: */
+func sqlite3GetFuncCollSeq(tls *libc.TLS, context uintptr) uintptr { /* sqlite3.c:117077:16: */
var pOp uintptr
- pOp = ((*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(context)).FpVdbe)).FaOp + uintptr(((*Sqlite3_context)(unsafe.Pointer(context)).FiOp-1))*24)
+ pOp = ((*Vdbe)(unsafe.Pointer((*Sqlite3_context)(unsafe.Pointer(context)).FpVdbe)).FaOp + uintptr(((*Sqlite3_context)(unsafe.Pointer(context)).FiOp-1))*32)
return *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
}
// Indicate that the accumulator load should be skipped on this
// iteration of the aggregate loop.
-func sqlite3SkipAccumulatorLoad(tls *crt.TLS, context uintptr) { /* sqlite3.c:116791:13: */
+func sqlite3SkipAccumulatorLoad(tls *libc.TLS, context uintptr) { /* sqlite3.c:117090:13: */
(*Sqlite3_context)(unsafe.Pointer(context)).FisError = -1
(*Sqlite3_context)(unsafe.Pointer(context)).FskipFlag = U8(1)
}
// Implementation of the non-aggregate min() and max() functions
-func minmaxFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:116800:13: */
+func minmaxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117099:13: */
var i int32
var mask int32 // 0 for min() or 0xffffffff for max()
var iBest int32
@@ -92578,7 +96142,7 @@ func minmaxFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sq
}
// Return the type of the argument.
-func typeofFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:116830:13: */
+func typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:117129:13: */
var i int32 = (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) - 1)
_ = NotUsed
@@ -92589,10 +96153,10 @@ func typeofFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /*
Xsqlite3_result_text(tls, context, azType2[i], -1, uintptr(0))
}
-var azType2 = [5]uintptr{ts + 5636 /* "integer" */, ts + 5631 /* "real" */, ts + 13091 /* "text" */, ts + 13096 /* "blob" */, ts + 5626 /* "null" */} /* sqlite3.c:116835:21 */
+var azType2 = [5]uintptr{ts + 7834 /* "integer" */, ts + 7829 /* "real" */, ts + 15867 /* "text" */, ts + 15872 /* "blob" */, ts + 7824 /* "null" */} /* sqlite3.c:117134:21 */
// Implementation of the length() function
-func lengthFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:116855:13: */
+func lengthFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117154:13: */
_ = argc
switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) {
@@ -92614,7 +96178,7 @@ func lengthFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sq
return
}
z0 = z
- for (int32(crt.AssignUint8(&c, *(*uint8)(unsafe.Pointer(z))))) != 0 {
+ for (int32(libc.AssignUint8(&c, *(*uint8)(unsafe.Pointer(z))))) != 0 {
z++
if int32(c) >= 0xc0 {
for (int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80 {
@@ -92638,7 +96202,7 @@ func lengthFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sq
//
// IMP: R-23979-26855 The abs(X) function returns the absolute value of
// the numeric argument X.
-func absFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:116897:13: */
+func absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117196:13: */
_ = argc
switch Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) {
@@ -92650,7 +96214,7 @@ func absFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlit
// IMP: R-31676-45509 If X is the integer -9223372036854775808
// then abs(X) throws an integer overflow error since there is no
// equivalent positive 64-bit two complement value.
- Xsqlite3_result_error(tls, context, ts+13101 /* "integer overflow" */, -1)
+ Xsqlite3_result_error(tls, context, ts+15877 /* "integer overflow" */, -1)
return
}
iVal = -iVal
@@ -92689,7 +96253,7 @@ func absFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlit
// If both haystack and needle are BLOBs, then the result is one more than
// the number of bytes in haystack prior to the first occurrence of needle,
// or 0 if needle never occurs in haystack.
-func instrFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:116946:13: */
+func instrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117245:13: */
var zHaystack uintptr
var zNeedle uintptr
var nHaystack int32
@@ -92767,7 +96331,7 @@ __9:
firstChar = *(*uint8)(unsafe.Pointer(zNeedle + uintptr(0)))
__10:
if !((nNeedle <= nHaystack) &&
- ((int32(*(*uint8)(unsafe.Pointer(zHaystack + uintptr(0)))) != int32(firstChar)) || (crt.Xmemcmp(tls, zHaystack, zNeedle, uint64(nNeedle)) != 0))) {
+ ((int32(*(*uint8)(unsafe.Pointer(zHaystack + uintptr(0)))) != int32(firstChar)) || (libc.Xmemcmp(tls, zHaystack, zNeedle, uint64(nNeedle)) != 0))) {
goto __11
}
N++
@@ -92804,7 +96368,7 @@ endInstrOOM:
}
// Implementation of the printf() function.
-func printfFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117014:13: */
+func printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117313:13: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -92816,16 +96380,16 @@ func printfFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sq
var n int32
var db uintptr = Xsqlite3_context_db_handle(tls, context)
- if (argc >= 1) && ((crt.AssignUintptr(&zFormat, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))) != uintptr(0)) {
+ if (argc >= 1) && ((libc.AssignUintptr(&zFormat, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))) != uintptr(0)) {
(*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FnArg = (argc - 1)
(*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FnUsed = 0
(*PrintfArguments)(unsafe.Pointer(bp + 40 /* &x */)).FapArg = (argv + uintptr(1)*8)
Xsqlite3StrAccumInit(tls, bp+8 /* &str */, db, uintptr(0), 0, *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(0)*4)))
(*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FprintfFlags = U8(0x02)
- Xsqlite3_str_appendf(tls, bp+8 /* &str */, zFormat, crt.VaList(bp, bp+40 /* &x */))
+ Xsqlite3_str_appendf(tls, bp+8 /* &str */, zFormat, libc.VaList(bp, bp+40 /* &x */))
n = int32((*StrAccum)(unsafe.Pointer(bp + 8 /* &str */)).FnChar)
Xsqlite3_result_text(tls, context, Xsqlite3StrAccumFinish(tls, bp+8 /* &str */), n,
- *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{Xsqlite3MallocSize})))
+ *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault})))
}
}
@@ -92839,7 +96403,7 @@ func printfFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sq
// If p1 is negative, then we begin abs(p1) from the end of x[].
//
// If p2 is negative, return the p2 characters preceding p1.
-func substrFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117050:13: */
+func substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117349:13: */
var z uintptr
var z2 uintptr
var len int32
@@ -92869,7 +96433,7 @@ func substrFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sq
if p1 < int64(0) {
for z2 = z; *(*uint8)(unsafe.Pointer(z2)) != 0; len++ {
{
- if (int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z2, 1))))) >= 0xc0 {
+ if (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z2, 1))))) >= 0xc0 {
for (int32(*(*uint8)(unsafe.Pointer(z2))) & 0xc0) == 0x80 {
z2++
}
@@ -92912,7 +96476,7 @@ func substrFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sq
if p0type != 4 {
for (*(*uint8)(unsafe.Pointer(z)) != 0) && (p1 != 0) {
{
- if (int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) >= 0xc0 {
+ if (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) >= 0xc0 {
for (int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80 {
z++
}
@@ -92923,14 +96487,14 @@ func substrFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sq
}
for z2 = z; (*(*uint8)(unsafe.Pointer(z2)) != 0) && (p2 != 0); p2-- {
{
- if (int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z2, 1))))) >= 0xc0 {
+ if (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z2, 1))))) >= 0xc0 {
for (int32(*(*uint8)(unsafe.Pointer(z2))) & 0xc0) == 0x80 {
z2++
}
}
}
}
- Xsqlite3_result_text64(tls, context, z, (uint64((int64(z2) - int64(z)) / 1)), crt.UintptrFromInt32(-1),
+ Xsqlite3_result_text64(tls, context, z, (uint64((int64(z2) - int64(z)) / 1)), libc.UintptrFromInt32(-1),
uint8(1))
} else {
if (p1 + p2) > I64(len) {
@@ -92939,12 +96503,12 @@ func substrFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sq
p2 = int64(0)
}
}
- Xsqlite3_result_blob64(tls, context, (z + uintptr(p1)), U64(p2), crt.UintptrFromInt32(-1))
+ Xsqlite3_result_blob64(tls, context, (z + uintptr(p1)), U64(p2), libc.UintptrFromInt32(-1))
}
}
// Implementation of the round() function
-func roundFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117145:13: */
+func roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117444:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -92981,7 +96545,7 @@ func roundFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sql
return +0.5
}()))))
} else {
- zBuf = Xsqlite3_mprintf(tls, ts+13118 /* "%.*f" */, crt.VaList(bp, n, *(*float64)(unsafe.Pointer(bp + 16 /* r */))))
+ zBuf = Xsqlite3_mprintf(tls, ts+15894 /* "%.*f" */, libc.VaList(bp, n, *(*float64)(unsafe.Pointer(bp + 16 /* r */))))
if zBuf == uintptr(0) {
Xsqlite3_result_error_nomem(tls, context)
return
@@ -92997,7 +96561,7 @@ func roundFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sql
// the database handle that malloc() has failed and return NULL.
// If nByte is larger than the maximum string or blob length, then
// raise an SQLITE_TOOBIG exception and return NULL.
-func contextMalloc(tls *crt.TLS, context uintptr, nByte I64) uintptr { /* sqlite3.c:117186:13: */
+func contextMalloc(tls *libc.TLS, context uintptr, nByte I64) uintptr { /* sqlite3.c:117485:13: */
var z uintptr
var db uintptr = Xsqlite3_context_db_handle(tls, context)
@@ -93014,7 +96578,7 @@ func contextMalloc(tls *crt.TLS, context uintptr, nByte I64) uintptr { /* sqlite
}
// Implementation of the upper() and lower() SQL functions.
-func upperFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117207:13: */
+func upperFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117506:13: */
var z1 uintptr
var z2 uintptr
var i int32
@@ -93030,11 +96594,11 @@ func upperFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sql
for i = 0; i < n; i++ {
*(*int8)(unsafe.Pointer(z1 + uintptr(i))) = (int8((int32(*(*int8)(unsafe.Pointer(z2 + uintptr(i))))) & ^(int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z2 + uintptr(i))))]) & 0x20)))
}
- Xsqlite3_result_text(tls, context, z1, n, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3_result_text(tls, context, z1, n, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
}
}
}
-func lowerFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117226:13: */
+func lowerFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117525:13: */
var z1 uintptr
var z2 uintptr
var i int32
@@ -93050,7 +96614,7 @@ func lowerFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sql
for i = 0; i < n; i++ {
*(*int8)(unsafe.Pointer(z1 + uintptr(i))) = int8(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(z2 + uintptr(i))))])
}
- Xsqlite3_result_text(tls, context, z1, n, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3_result_text(tls, context, z1, n, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
}
}
}
@@ -93063,7 +96627,7 @@ func lowerFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sql
// is. We might as well use the "version()" function as a substitute.
// Implementation of random(). Return a random integer.
-func randomFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117259:13: */
+func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117558:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -93087,7 +96651,7 @@ func randomFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr)
// Implementation of randomblob(N). Return a random blob
// that is N bytes long.
-func randomBlob(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117285:13: */
+func randomBlob(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117584:13: */
var n Sqlite3_int64
var p uintptr
@@ -93099,13 +96663,13 @@ func randomBlob(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sq
p = contextMalloc(tls, context, n)
if p != 0 {
Xsqlite3_randomness(tls, int32(n), p)
- Xsqlite3_result_blob(tls, context, p, int32(n), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3_result_blob(tls, context, p, int32(n), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
}
}
// Implementation of the last_insert_rowid() SQL function. The return
// value is the same as the sqlite3_last_insert_rowid() API function.
-func last_insert_rowid(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117309:13: */
+func last_insert_rowid(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117608:13: */
var db uintptr = Xsqlite3_context_db_handle(tls, context)
_ = NotUsed
_ = NotUsed2
@@ -93120,7 +96684,7 @@ func last_insert_rowid(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 ui
// IMP: R-62073-11209 The changes() SQL function is a wrapper
// around the sqlite3_changes() C/C++ function and hence follows the same
// rules for counting changes.
-func changes(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117329:13: */
+func changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117628:13: */
var db uintptr = Xsqlite3_context_db_handle(tls, context)
_ = NotUsed
_ = NotUsed2
@@ -93129,7 +96693,7 @@ func changes(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /
// Implementation of the total_changes() SQL function. The return value is
// the same as the sqlite3_total_changes() API function.
-func total_changes(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117343:13: */
+func total_changes(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117642:13: */
var db uintptr = Xsqlite3_context_db_handle(tls, context)
_ = NotUsed
_ = NotUsed2
@@ -93151,13 +96715,13 @@ type compareInfo = struct {
// macro for fast reading of the next character in the common case where
// the next character is ASCII.
-var globInfo = compareInfo{FmatchAll: U8('*'), FmatchOne: U8('?'), FmatchSet: U8('['), FnoCase: U8(0)} /* sqlite3.c:117378:33 */
+var globInfo = compareInfo{FmatchAll: U8('*'), FmatchOne: U8('?'), FmatchSet: U8('['), FnoCase: U8(0)} /* sqlite3.c:117677:33 */
// The correct SQL-92 behavior is for the LIKE operator to ignore
// case. Thus 'a' LIKE 'A' would be true.
-var likeInfoNorm = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_'), FmatchSet: U8(0), FnoCase: U8(1)} /* sqlite3.c:117381:33 */
+var likeInfoNorm = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_'), FmatchSet: U8(0), FnoCase: U8(1)} /* sqlite3.c:117680:33 */
// If SQLITE_CASE_SENSITIVE_LIKE is defined, then the LIKE operator
// is case sensitive causing 'a' LIKE 'A' to be false
-var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_'), FmatchSet: U8(0), FnoCase: U8(0)} /* sqlite3.c:117384:33 */
+var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_'), FmatchSet: U8(0), FnoCase: U8(0)} /* sqlite3.c:117683:33 */
// Possible error returns from patternMatch()
@@ -93197,7 +96761,7 @@ var likeInfoAlt = compareInfo{FmatchAll: U8('%'), FmatchOne: U8('_'), FmatchSet:
// The comments within this routine usually assume glob matching.
//
// This routine is usually quick, but can be N**2 in the worst case.
-func patternCompare(tls *crt.TLS, zPattern uintptr, zString uintptr, pInfo uintptr, matchOther U32) int32 { /* sqlite3.c:117431:12: */
+func patternCompare(tls *libc.TLS, zPattern uintptr, zString uintptr, pInfo uintptr, matchOther U32) int32 { /* sqlite3.c:117730:12: */
bp := tls.Alloc(19)
defer tls.Free(19)
*(*uintptr)(unsafe.Pointer(bp)) = zPattern
@@ -93210,9 +96774,9 @@ func patternCompare(tls *crt.TLS, zPattern uintptr, zString uintptr, pInfo uintp
var noCase U8 = (*compareInfo)(unsafe.Pointer(pInfo)).FnoCase // True if uppercase==lowercase
var zEscaped uintptr = uintptr(0) // One past the last escaped input char
- for (crt.AssignUint32(&c, func() uint32 {
+ for (libc.AssignUint32(&c, func() uint32 {
if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zPattern */)) + uintptr(0)))) < 0x80 {
- return uint32(*(*U8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp /* zPattern */)), 1))))
+ return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp /* zPattern */)), 1))))
}
return Xsqlite3Utf8Read(tls, bp /* &zPattern */)
}())) != U32(0) {
@@ -93220,9 +96784,9 @@ func patternCompare(tls *crt.TLS, zPattern uintptr, zString uintptr, pInfo uintp
// Skip over multiple "*" characters in the pattern. If there
// are also "?" characters, skip those as well, but consume a
// single character of the input string for each "?" skipped
- for ((crt.AssignUint32(&c, func() uint32 {
+ for ((libc.AssignUint32(&c, func() uint32 {
if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zPattern */)) + uintptr(0)))) < 0x80 {
- return uint32(*(*U8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp /* zPattern */)), 1))))
+ return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp /* zPattern */)), 1))))
}
return Xsqlite3Utf8Read(tls, bp /* &zPattern */)
}())) == matchAll) || (c == matchOne) {
@@ -93243,12 +96807,12 @@ func patternCompare(tls *crt.TLS, zPattern uintptr, zString uintptr, pInfo uintp
// recursive search in this case, but it is an unusual case.
// '[' is a single-byte character
for *(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)))) != 0 {
- var bMatch int32 = patternCompare(tls, (*(*uintptr)(unsafe.Pointer(bp /* zPattern */)) + crt.UintptrFromInt32(-1)), *(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)), pInfo, matchOther)
+ var bMatch int32 = patternCompare(tls, (*(*uintptr)(unsafe.Pointer(bp /* zPattern */)) + libc.UintptrFromInt32(-1)), *(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)), pInfo, matchOther)
if bMatch != 1 {
return bMatch
}
{
- if (int32(*(*U8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)), 1))))) >= 0xc0 {
+ if (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)), 1))))) >= 0xc0 {
for (int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* zString */))))) & 0xc0) == 0x80 {
*(*uintptr)(unsafe.Pointer(bp + 8 /* zString */))++
}
@@ -93280,7 +96844,7 @@ func patternCompare(tls *crt.TLS, zPattern uintptr, zString uintptr, pInfo uintp
*(*int8)(unsafe.Pointer(bp + 16 /* &zStop[0] */ + uintptr(1))) = int8(0)
}
for 1 != 0 {
- *(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)) += uintptr(crt.Xstrcspn(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)), bp+16 /* &zStop[0] */))
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)) += uintptr(libc.Xstrcspn(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)), bp+16 /* &zStop[0] */))
if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)) + uintptr(0)))) == 0 {
break
}
@@ -93292,9 +96856,9 @@ func patternCompare(tls *crt.TLS, zPattern uintptr, zString uintptr, pInfo uintp
}
} else {
var bMatch int32
- for (crt.AssignUint32(&c2, func() uint32 {
+ for (libc.AssignUint32(&c2, func() uint32 {
if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)) + uintptr(0)))) < 0x80 {
- return uint32(*(*U8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)), 1))))
+ return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)), 1))))
}
return Xsqlite3Utf8Read(tls, bp+8 /* &zString */)
}())) != U32(0) {
@@ -93358,7 +96922,7 @@ func patternCompare(tls *crt.TLS, zPattern uintptr, zString uintptr, pInfo uintp
}
c2 = func() uint32 {
if int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)) + uintptr(0)))) < 0x80 {
- return uint32(*(*U8)(unsafe.Pointer(crt.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)), 1))))
+ return uint32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&*(*uintptr)(unsafe.Pointer(bp + 8 /* zString */)), 1))))
}
return Xsqlite3Utf8Read(tls, bp+8 /* &zString */)
}()
@@ -93381,20 +96945,20 @@ func patternCompare(tls *crt.TLS, zPattern uintptr, zString uintptr, pInfo uintp
// The sqlite3_strglob() interface. Return 0 on a match (like strcmp()) and
// non-zero if there is no match.
-func Xsqlite3_strglob(tls *crt.TLS, zGlobPattern uintptr, zString uintptr) int32 { /* sqlite3.c:117563:16: */
+func Xsqlite3_strglob(tls *libc.TLS, zGlobPattern uintptr, zString uintptr) int32 { /* sqlite3.c:117862:16: */
return patternCompare(tls, zGlobPattern, zString, uintptr(unsafe.Pointer(&globInfo)), uint32('['))
}
// The sqlite3_strlike() interface. Return 0 on a match and non-zero for
// a miss - like strcmp().
-func Xsqlite3_strlike(tls *crt.TLS, zPattern uintptr, zStr uintptr, esc uint32) int32 { /* sqlite3.c:117571:16: */
+func Xsqlite3_strlike(tls *libc.TLS, zPattern uintptr, zStr uintptr, esc uint32) int32 { /* sqlite3.c:117870:16: */
return patternCompare(tls, zPattern, zStr, uintptr(unsafe.Pointer(&likeInfoNorm)), esc)
}
// Count the number of times that the LIKE operator (or GLOB which is
// just a variation of LIKE) gets called. This is used for testing
// only.
-var Xsqlite3_like_count int32 = 0 /* sqlite3.c:117581:16 */
+var Xsqlite3_like_count int32 = 0 /* sqlite3.c:117880:16 */
// Implementation of the like() SQL function. This function implements
// the build-in LIKE operator. The first argument to the function is the
@@ -93406,7 +96970,7 @@ var Xsqlite3_like_count int32 = 0 /* sqlite3.c:117581:16 */
//
// This same function (with a different compareInfo structure) computes
// the GLOB operator.
-func likeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117597:13: */
+func likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117896:13: */
bp := tls.Alloc(12)
defer tls.Free(12)
@@ -93430,7 +96994,7 @@ func likeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
nPat = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
if nPat > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(8)*4)) {
- Xsqlite3_result_error(tls, context, ts+13123 /* "LIKE or GLOB pat..." */, -1)
+ Xsqlite3_result_error(tls, context, ts+15899 /* "LIKE or GLOB pat..." */, -1)
return
}
if argc == 3 {
@@ -93442,12 +97006,12 @@ func likeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
}
if Xsqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp /* zEsc */)), -1) != 1 {
Xsqlite3_result_error(tls, context,
- ts+13156 /* "ESCAPE expressio..." */, -1)
+ ts+15932 /* "ESCAPE expressio..." */, -1)
return
}
escape = Xsqlite3Utf8Read(tls, bp /* &zEsc */)
if (escape == U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchAll)) || (escape == U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchOne)) {
- crt.Xmemcpy(tls, bp+8 /* &backupInfo */, pInfo, uint64(unsafe.Sizeof(compareInfo{})))
+ libc.Xmemcpy(tls, bp+8 /* &backupInfo */, pInfo, uint64(unsafe.Sizeof(compareInfo{})))
pInfo = bp + 8 /* &backupInfo */
if escape == U32((*compareInfo)(unsafe.Pointer(pInfo)).FmatchAll) {
(*compareInfo)(unsafe.Pointer(pInfo)).FmatchAll = U8(0)
@@ -93464,14 +97028,14 @@ func likeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
if (zA != 0) && (zB != 0) {
Xsqlite3_like_count++
Xsqlite3_result_int(tls, context,
- (crt.Bool32(patternCompare(tls, zB, zA, pInfo, escape) == 0)))
+ (libc.Bool32(patternCompare(tls, zB, zA, pInfo, escape) == 0)))
}
}
// Implementation of the NULLIF(x,y) function. The result is the first
// argument if the arguments are different. The result is NULL if the
// arguments are equal to each other.
-func nullifFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:117668:13: */
+func nullifFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:117967:13: */
var pColl uintptr = sqlite3GetFuncCollSeq(tls, context)
_ = NotUsed
if Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), pColl) != 0 {
@@ -93481,7 +97045,7 @@ func nullifFunc(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /*
// Implementation of the sqlite_version() function. The result is the version
// of the SQLite library that is running.
-func versionFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117684:13: */
+func versionFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117983:13: */
_ = NotUsed
_ = NotUsed2
// IMP: R-48699-48617 This function is an SQL wrapper around the
@@ -93492,7 +97056,7 @@ func versionFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr)
// Implementation of the sqlite_source_id() function. The result is a string
// that identifies the particular version of the source code used to build
// SQLite.
-func sourceidFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117700:13: */
+func sourceidFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:117999:13: */
_ = NotUsed
_ = NotUsed2
// IMP: R-24470-31136 This function is an SQL wrapper around the
@@ -93503,26 +97067,26 @@ func sourceidFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr
// Implementation of the sqlite_log() function. This is a wrapper around
// sqlite3_log(). The return value is NULL. The function exists purely for
// its side-effects.
-func errlogFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117716:13: */
+func errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118015:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
_ = argc
_ = context
- Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))), ts+696 /* "%s" */, crt.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))))
+ Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))), ts+805 /* "%s" */, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))))
}
// Implementation of the sqlite_compileoption_used() function.
// The result is an integer that identifies if the compiler option
// was used to build SQLite.
-func compileoptionusedFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117732:13: */
+func compileoptionusedFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118031:13: */
var zOptName uintptr
_ = argc
// IMP: R-39564-36305 The sqlite_compileoption_used() SQL
// function is a wrapper around the sqlite3_compileoption_used() C/C++
// function.
- if (crt.AssignUintptr(&zOptName, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))) != uintptr(0) {
+ if (libc.AssignUintptr(&zOptName, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))) != uintptr(0) {
Xsqlite3_result_int(tls, context, Xsqlite3_compileoption_used(tls, zOptName))
}
}
@@ -93530,7 +97094,7 @@ func compileoptionusedFunc(tls *crt.TLS, context uintptr, argc int32, argv uintp
// Implementation of the sqlite_compileoption_get() function.
// The result is a string that identifies the compiler options
// used to build SQLite.
-func compileoptiongetFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117756:13: */
+func compileoptiongetFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118055:13: */
var n int32
_ = argc
@@ -93545,14 +97109,14 @@ func compileoptiongetFunc(tls *crt.TLS, context uintptr, argc int32, argv uintpt
var hexdigits = [16]int8{
int8('0'), int8('1'), int8('2'), int8('3'), int8('4'), int8('5'), int8('6'), int8('7'),
int8('8'), int8('9'), int8('A'), int8('B'), int8('C'), int8('D'), int8('E'), int8('F'),
-} /* sqlite3.c:117774:19 */
+} /* sqlite3.c:118073:19 */
// Implementation of the QUOTE() function. This function takes a single
// argument. If the argument is numeric, the return value is the same as
// the argument. If the argument is NULL, the return value is the string
// "NULL". Otherwise, the argument is enclosed in single quotes with
// single-quote escapes.
-func quoteFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117786:13: */
+func quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118085:13: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -93566,12 +97130,12 @@ func quoteFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sql
// var zBuf [50]int8 at bp+16, 50
r1 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+4424 /* "%!.15g" */, crt.VaList(bp, r1))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+6559 /* "%!.15g" */, libc.VaList(bp, r1))
Xsqlite3AtoF(tls, bp+16 /* &zBuf[0] */, bp+72 /* &r2 */, 20, uint8(1))
if r1 != *(*float64)(unsafe.Pointer(bp + 72 /* r2 */)) {
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+13201 /* "%!.20e" */, crt.VaList(bp+8, r1))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([50]int8{})), bp+16 /* &zBuf[0] */, ts+15977 /* "%!.20e" */, libc.VaList(bp+8, r1))
}
- Xsqlite3_result_text(tls, context, bp+16 /* &zBuf[0] */, -1, crt.UintptrFromInt32(-1))
+ Xsqlite3_result_text(tls, context, bp+16 /* &zBuf[0] */, -1, libc.UintptrFromInt32(-1))
break
}
case 1:
@@ -93596,7 +97160,7 @@ func quoteFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sql
*(*int8)(unsafe.Pointer(zText + uintptr(((nBlob * 2) + 3)))) = int8(0)
*(*int8)(unsafe.Pointer(zText + uintptr(0))) = int8('X')
*(*int8)(unsafe.Pointer(zText + uintptr(1))) = int8('\'')
- Xsqlite3_result_text(tls, context, zText, -1, crt.UintptrFromInt32(-1))
+ Xsqlite3_result_text(tls, context, zText, -1, libc.UintptrFromInt32(-1))
Xsqlite3_free(tls, zText)
}
break
@@ -93625,21 +97189,21 @@ func quoteFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sql
i = 0
j = 1
for ; *(*uint8)(unsafe.Pointer(zArg + uintptr(i))) != 0; i++ {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = int8(*(*uint8)(unsafe.Pointer(zArg + uintptr(i))))
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = int8(*(*uint8)(unsafe.Pointer(zArg + uintptr(i))))
if int32(*(*uint8)(unsafe.Pointer(zArg + uintptr(i)))) == '\'' {
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = int8('\'')
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = int8('\'')
}
}
- *(*int8)(unsafe.Pointer(z + uintptr(crt.PostIncInt32(&j, 1)))) = int8('\'')
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&j, 1)))) = int8('\'')
*(*int8)(unsafe.Pointer(z + uintptr(j))) = int8(0)
- Xsqlite3_result_text(tls, context, z, j, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3_result_text(tls, context, z, j, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
}
break
}
default:
{
- Xsqlite3_result_text(tls, context, ts+673 /* "NULL" */, 4, uintptr(0))
+ Xsqlite3_result_text(tls, context, ts+782 /* "NULL" */, 4, uintptr(0))
break
}
}
@@ -93647,7 +97211,7 @@ func quoteFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sql
// The unicode() function. Return the integer unicode code-point value
// for the first character of the input string.
-func unicodeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117862:13: */
+func unicodeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118161:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -93661,11 +97225,11 @@ func unicodeFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* s
// The char() function takes zero or more arguments, each of which is
// an integer. It constructs a string where each character of the string
// is the unicode character for the corresponding integer argument.
-func charFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117877:13: */
+func charFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118176:13: */
var z uintptr
var zOut uintptr
var i int32
- zOut = crt.AssignUintptr(&z, Xsqlite3_malloc64(tls, (uint64((argc*4)+1))))
+ zOut = libc.AssignUintptr(&z, Xsqlite3_malloc64(tls, (uint64((argc*4)+1))))
if z == uintptr(0) {
Xsqlite3_result_error_nomem(tls, context)
return
@@ -93679,27 +97243,27 @@ func charFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
}
c = (uint32(x & int64(0x1fffff)))
if c < uint32(0x00080) {
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zOut, 1))) = (U8(c & uint32(0xFF)))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (U8(c & uint32(0xFF)))
} else if c < uint32(0x00800) {
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zOut, 1))) = (uint8(0xC0 + int32((U8((c >> 6) & uint32(0x1F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xC0 + int32((U8((c >> 6) & uint32(0x1F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
} else if c < uint32(0x10000) {
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zOut, 1))) = (uint8(0xE0 + int32((U8((c >> 12) & uint32(0x0F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xE0 + int32((U8((c >> 12) & uint32(0x0F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
} else {
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zOut, 1))) = (uint8(0xF0 + int32((U8((c >> 18) & uint32(0x07))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((c >> 12) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
- *(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0xF0 + int32((U8((c >> 18) & uint32(0x07))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((c >> 12) & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8((c >> 6) & uint32(0x3F))))))
+ *(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (uint8(0x80 + int32((U8(c & uint32(0x3F))))))
}
}
- Xsqlite3_result_text64(tls, context, z, (uint64((int64(zOut) - int64(z)) / 1)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})), uint8(1))
+ Xsqlite3_result_text64(tls, context, z, (uint64((int64(zOut) - int64(z)) / 1)), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})), uint8(1))
}
// The hex() function. Interpret the argument as a blob. Return
// a hexadecimal rendering as text.
-func hexFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117918:13: */
+func hexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118217:13: */
var i int32
var n int32
var pBlob uintptr
@@ -93710,7 +97274,7 @@ func hexFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlit
pBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
// No encoding change
- z = crt.AssignUintptr(&zHex, contextMalloc(tls, context, (((I64(n))*int64(2))+int64(1))))
+ z = libc.AssignUintptr(&zHex, contextMalloc(tls, context, (((I64(n))*int64(2))+int64(1))))
if zHex != 0 {
i = 0
__1:
@@ -93719,8 +97283,8 @@ func hexFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlit
}
{
var c uint8 = *(*uint8)(unsafe.Pointer(pBlob))
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = hexdigits[((int32(c) >> 4) & 0xf)]
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))) = hexdigits[(int32(c) & 0xf)]
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = hexdigits[((int32(c) >> 4) & 0xf)]
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))) = hexdigits[(int32(c) & 0xf)]
}
goto __2
__2:
@@ -93731,12 +97295,12 @@ func hexFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlit
__3:
;
*(*int8)(unsafe.Pointer(z)) = int8(0)
- Xsqlite3_result_text(tls, context, zHex, (n * 2), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3_result_text(tls, context, zHex, (n * 2), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
}
}
// The zeroblob(N) function returns a zero-filled blob of size N bytes.
-func zeroblobFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117946:13: */
+func zeroblobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118245:13: */
var n I64
var rc int32
@@ -93755,7 +97319,7 @@ func zeroblobFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /*
// them A, B, and C. The result is also a string which is derived
// from A by replacing every occurrence of B with C. The match
// must be exact. Collating sequences are not used.
-func replaceFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:117969:13: */
+func replaceFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118268:13: */
var zStr uintptr // The input string A
var zPattern uintptr // The pattern string B
var zRep uintptr // The replacement string C
@@ -93803,9 +97367,9 @@ func replaceFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* s
}
loopLimit = (nStr - nPattern)
cntExpand = uint32(0)
- for i = crt.AssignInt32(&j, 0); i <= loopLimit; i++ {
- if (int32(*(*uint8)(unsafe.Pointer(zStr + uintptr(i)))) != int32(*(*uint8)(unsafe.Pointer(zPattern + uintptr(0))))) || (crt.Xmemcmp(tls, (zStr+uintptr(i)), zPattern, uint64(nPattern)) != 0) {
- *(*uint8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&j, 1)))) = *(*uint8)(unsafe.Pointer(zStr + uintptr(i)))
+ for i = libc.AssignInt32(&j, 0); i <= loopLimit; i++ {
+ if (int32(*(*uint8)(unsafe.Pointer(zStr + uintptr(i)))) != int32(*(*uint8)(unsafe.Pointer(zPattern + uintptr(0))))) || (libc.Xmemcmp(tls, (zStr+uintptr(i)), zPattern, uint64(nPattern)) != 0) {
+ *(*uint8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&j, 1)))) = *(*uint8)(unsafe.Pointer(zStr + uintptr(i)))
} else {
if nRep > nPattern {
nOut = nOut + (I64(nRep - nPattern))
@@ -93829,22 +97393,22 @@ func replaceFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* s
}
}
}
- crt.Xmemcpy(tls, (zOut + uintptr(j)), zRep, uint64(nRep))
+ libc.Xmemcpy(tls, (zOut + uintptr(j)), zRep, uint64(nRep))
j = j + (nRep)
i = i + (nPattern - 1)
}
}
- crt.Xmemcpy(tls, (zOut + uintptr(j)), (zStr + uintptr(i)), (uint64(nStr - i)))
+ libc.Xmemcpy(tls, (zOut + uintptr(j)), (zStr + uintptr(i)), (uint64(nStr - i)))
j = j + (nStr - i)
*(*uint8)(unsafe.Pointer(zOut + uintptr(j))) = uint8(0)
- Xsqlite3_result_text(tls, context, zOut, j, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3_result_text(tls, context, zOut, j, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
}
// Implementation of the TRIM(), LTRIM(), and RTRIM() functions.
// The userdata is 0x1 for left trim, 0x2 for right trim, 0x3 for both.
-func trimFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118062:13: */
+func trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118361:13: */
var zIn uintptr // Input string
var zCharSet uintptr // Set of characters to trim
var nIn int32 // Number of bytes in input
@@ -93868,7 +97432,7 @@ func trimFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
aLen = uintptr(uintptr(unsafe.Pointer(&lenOne)))
azChar = uintptr(uintptr(unsafe.Pointer(&azOne)))
zCharSet = uintptr(0)
- } else if (crt.AssignUintptr(&zCharSet, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))) == uintptr(0) {
+ } else if (libc.AssignUintptr(&zCharSet, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))) == uintptr(0) {
return
} else {
var z uintptr
@@ -93876,7 +97440,7 @@ func trimFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
nChar = 0
for ; *(*uint8)(unsafe.Pointer(z)) != 0; nChar++ {
{
- if (int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) >= 0xc0 {
+ if (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) >= 0xc0 {
for (int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80 {
z++
}
@@ -93894,7 +97458,7 @@ func trimFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
for ; *(*uint8)(unsafe.Pointer(z)) != 0; nChar++ {
*(*uintptr)(unsafe.Pointer(azChar + uintptr(nChar)*8)) = z
{
- if (int32(*(*uint8)(unsafe.Pointer(crt.PostIncUintptr(&z, 1))))) >= 0xc0 {
+ if (int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1))))) >= 0xc0 {
for (int32(*(*uint8)(unsafe.Pointer(z))) & 0xc0) == 0x80 {
z++
}
@@ -93912,7 +97476,7 @@ func trimFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
var len int32 = 0
for i = 0; i < nChar; i++ {
len = int32(*(*uint8)(unsafe.Pointer(aLen + uintptr(i))))
- if (len <= nIn) && (crt.Xmemcmp(tls, zIn, *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*8)), uint64(len)) == 0) {
+ if (len <= nIn) && (libc.Xmemcmp(tls, zIn, *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*8)), uint64(len)) == 0) {
break
}
}
@@ -93928,7 +97492,7 @@ func trimFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
var len int32 = 0
for i = 0; i < nChar; i++ {
len = int32(*(*uint8)(unsafe.Pointer(aLen + uintptr(i))))
- if (len <= nIn) && (crt.Xmemcmp(tls, (zIn+uintptr((nIn-len))), *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*8)), uint64(len)) == 0) {
+ if (len <= nIn) && (libc.Xmemcmp(tls, (zIn+uintptr((nIn-len))), *(*uintptr)(unsafe.Pointer(azChar + uintptr(i)*8)), uint64(len)) == 0) {
break
}
}
@@ -93942,18 +97506,74 @@ func trimFunc(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqli
Xsqlite3_free(tls, azChar)
}
}
- Xsqlite3_result_text(tls, context, zIn, nIn, crt.UintptrFromInt32(-1))
+ Xsqlite3_result_text(tls, context, zIn, nIn, libc.UintptrFromInt32(-1))
}
-var lenOne = [1]uint8{uint8(1)} /* sqlite3.c:118084:32 */
-var azOne = [1]uintptr{uintptr(ts + 13208 /* " " */)} /* sqlite3.c:118085:26 */
+var lenOne = [1]uint8{uint8(1)} /* sqlite3.c:118383:32 */
+var azOne = [1]uintptr{uintptr(ts + 15984 /* " " */)} /* sqlite3.c:118384:26 */
// IMP: R-25361-16150 This function is omitted from SQLite by default. It
// is only available if the SQLITE_SOUNDEX compile-time option is used
// when SQLite is built.
+// Compute the soundex encoding of a word.
+//
+// IMP: R-59782-00072 The soundex(X) function returns a string that is the
+// soundex encoding of the string X.
+func soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118473:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ // var zResult [8]int8 at bp, 8
+
+ var zIn uintptr
+ var i int32
+ var j int32
+
+ zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ if zIn == uintptr(0) {
+ zIn = ts + 781 /* "" */
+ }
+ for i = 0; (*(*U8)(unsafe.Pointer(zIn + uintptr(i))) != 0) && !((int32(Xsqlite3CtypeMap[*(*U8)(unsafe.Pointer(zIn + uintptr(i)))]) & 0x02) != 0); i++ {
+ }
+ if *(*U8)(unsafe.Pointer(zIn + uintptr(i))) != 0 {
+ var prevcode U8 = iCode[(int32(*(*U8)(unsafe.Pointer(zIn + uintptr(i)))) & 0x7f)]
+ *(*int8)(unsafe.Pointer(bp /* &zResult[0] */ + uintptr(0))) = (int8((int32(*(*U8)(unsafe.Pointer(zIn + uintptr(i))))) & ^(int32(Xsqlite3CtypeMap[*(*U8)(unsafe.Pointer(zIn + uintptr(i)))]) & 0x20)))
+ for j = 1; (j < 4) && (*(*U8)(unsafe.Pointer(zIn + uintptr(i))) != 0); i++ {
+ var code int32 = int32(iCode[(int32(*(*U8)(unsafe.Pointer(zIn + uintptr(i)))) & 0x7f)])
+ if code > 0 {
+ if code != int32(prevcode) {
+ prevcode = U8(code)
+ *(*int8)(unsafe.Pointer(bp /* &zResult[0] */ + uintptr(libc.PostIncInt32(&j, 1)))) = (int8(code + '0'))
+ }
+ } else {
+ prevcode = U8(0)
+ }
+ }
+ for j < 4 {
+ *(*int8)(unsafe.Pointer(bp /* &zResult[0] */ + uintptr(libc.PostIncInt32(&j, 1)))) = int8('0')
+ }
+ *(*int8)(unsafe.Pointer(bp /* &zResult[0] */ + uintptr(j))) = int8(0)
+ Xsqlite3_result_text(tls, context, bp /* &zResult[0] */, 4, libc.UintptrFromInt32(-1))
+ } else {
+ // IMP: R-64894-50321 The string "?000" is returned if the argument
+ // is NULL or contains no ASCII alphabetic characters.
+ Xsqlite3_result_text(tls, context, ts+15986 /* "?000" */, 4, uintptr(0))
+ }
+}
+
+var iCode = [128]uint8{
+ uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
+ uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
+ uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
+ uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
+ uint8(0), uint8(0), uint8(1), uint8(2), uint8(3), uint8(0), uint8(1), uint8(2), uint8(0), uint8(0), uint8(2), uint8(2), uint8(4), uint8(5), uint8(5), uint8(0),
+ uint8(1), uint8(2), uint8(6), uint8(2), uint8(3), uint8(0), uint8(1), uint8(0), uint8(2), uint8(0), uint8(2), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
+ uint8(0), uint8(0), uint8(1), uint8(2), uint8(3), uint8(0), uint8(1), uint8(2), uint8(0), uint8(0), uint8(2), uint8(2), uint8(4), uint8(5), uint8(5), uint8(0),
+ uint8(1), uint8(2), uint8(6), uint8(2), uint8(3), uint8(0), uint8(1), uint8(0), uint8(2), uint8(0), uint8(2), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0),
+} /* sqlite3.c:118481:30 */
// A function that loads a shared-library extension then returns NULL.
-func loadExt(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118227:13: */
+func loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118526:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -93965,7 +97585,7 @@ func loadExt(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlit
// Disallow the load_extension() SQL function unless the SQLITE_LoadExtFunc
// flag is set. See the sqlite3_enable_load_extension() API.
if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00020000)) == uint64(0) {
- Xsqlite3_result_error(tls, context, ts+10537 /* "not authorized" */, -1)
+ Xsqlite3_result_error(tls, context, ts+13215 /* "not authorized" */, -1)
return
}
@@ -93993,7 +97613,7 @@ type SumCtx1 = struct {
// An instance of the following structure holds the context of a
// sum() or avg() aggregate computation.
-type SumCtx = SumCtx1 /* sqlite3.c:118258:23 */
+type SumCtx = SumCtx1 /* sqlite3.c:118557:23 */
// Routines used to compute the sum, average, and total.
//
@@ -94003,7 +97623,7 @@ type SumCtx = SumCtx1 /* sqlite3.c:118258:23 */
// SUM might return an integer if it never encounters a floating point
// value. TOTAL never fails, but SUM might through an exception if
// it overflows an integer.
-func sumStep(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118277:13: */
+func sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118576:13: */
var p uintptr
var type1 int32
@@ -94016,7 +97636,7 @@ func sumStep(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlit
var v I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
*(*float64)(unsafe.Pointer(p /* &.rSum */)) += (float64(v))
if ((int32((*SumCtx)(unsafe.Pointer(p)).Fapprox) | int32((*SumCtx)(unsafe.Pointer(p)).Foverflow)) == 0) && (Xsqlite3AddInt64(tls, (p+8 /* &.iSum */), v) != 0) {
- (*SumCtx)(unsafe.Pointer(p)).Fapprox = crt.AssignPtrUint8(p+24 /* &.overflow */, U8(1))
+ (*SumCtx)(unsafe.Pointer(p)).Fapprox = libc.AssignPtrUint8(p+24 /* &.overflow */, U8(1))
}
} else {
*(*float64)(unsafe.Pointer(p /* &.rSum */)) += (Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
@@ -94024,7 +97644,7 @@ func sumStep(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlit
}
}
}
-func sumInverse(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118299:13: */
+func sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118598:13: */
var p uintptr
var type1 int32
@@ -94046,12 +97666,12 @@ func sumInverse(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sq
}
}
}
-func sumFinalize(tls *crt.TLS, context uintptr) { /* sqlite3.c:118324:13: */
+func sumFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118623:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, context, 0)
if (p != 0) && ((*SumCtx)(unsafe.Pointer(p)).Fcnt > int64(0)) {
if (*SumCtx)(unsafe.Pointer(p)).Foverflow != 0 {
- Xsqlite3_result_error(tls, context, ts+13101 /* "integer overflow" */, -1)
+ Xsqlite3_result_error(tls, context, ts+15877 /* "integer overflow" */, -1)
} else if (*SumCtx)(unsafe.Pointer(p)).Fapprox != 0 {
Xsqlite3_result_double(tls, context, (*SumCtx)(unsafe.Pointer(p)).FrSum)
} else {
@@ -94059,14 +97679,14 @@ func sumFinalize(tls *crt.TLS, context uintptr) { /* sqlite3.c:118324:13: */
}
}
}
-func avgFinalize(tls *crt.TLS, context uintptr) { /* sqlite3.c:118337:13: */
+func avgFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118636:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, context, 0)
if (p != 0) && ((*SumCtx)(unsafe.Pointer(p)).Fcnt > int64(0)) {
Xsqlite3_result_double(tls, context, ((*SumCtx)(unsafe.Pointer(p)).FrSum / float64((*SumCtx)(unsafe.Pointer(p)).Fcnt)))
}
}
-func totalFinalize(tls *crt.TLS, context uintptr) { /* sqlite3.c:118344:13: */
+func totalFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118643:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, context, 0)
// (double)0 In case of SQLITE_OMIT_FLOATING_POINT...
@@ -94084,10 +97704,10 @@ type CountCtx1 = struct{ Fn I64 }
// The following structure keeps track of state information for the
// count() aggregate function.
-type CountCtx = CountCtx1 /* sqlite3.c:118355:25 */
+type CountCtx = CountCtx1 /* sqlite3.c:118654:25 */
// Routines to implement the count() aggregate function.
-func countStep(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118366:13: */
+func countStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118665:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(CountCtx{})))
if ((argc == 0) || (5 != Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))) && (p != 0) {
@@ -94100,7 +97720,7 @@ func countStep(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sql
// expressed as a 32-bit integer.
}
-func countFinalize(tls *crt.TLS, context uintptr) { /* sqlite3.c:118382:13: */
+func countFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118681:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, context, 0)
Xsqlite3_result_int64(tls, context, func() int64 {
@@ -94110,7 +97730,7 @@ func countFinalize(tls *crt.TLS, context uintptr) { /* sqlite3.c:118382:13: */
return int64(0)
}())
}
-func countInverse(tls *crt.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:118388:13: */
+func countInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:118687:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(CountCtx{})))
// p is always non-NULL since countStep() will have been called first
@@ -94120,7 +97740,7 @@ func countInverse(tls *crt.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqli
}
// Routines to implement min() and max() aggregate functions.
-func minmaxStep(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:118406:13: */
+func minmaxStep(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { /* sqlite3.c:118705:13: */
var pArg uintptr = *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))
var pBest uintptr
_ = NotUsed
@@ -94145,7 +97765,7 @@ func minmaxStep(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /*
// returns (void *)db, where db is the sqlite3* database pointer.
// Therefore the next statement sets variable 'max' to 1 for the max()
// aggregate, or 0 for min().
- max = (crt.Bool32(Xsqlite3_user_data(tls, context) != uintptr(0)))
+ max = (libc.Bool32(Xsqlite3_user_data(tls, context) != uintptr(0)))
cmp = Xsqlite3MemCompare(tls, pBest, pArg, pColl)
if ((max != 0) && (cmp < 0)) || (!(max != 0) && (cmp > 0)) {
Xsqlite3VdbeMemCopy(tls, pBest, pArg)
@@ -94157,7 +97777,7 @@ func minmaxStep(tls *crt.TLS, context uintptr, NotUsed int32, argv uintptr) { /*
Xsqlite3VdbeMemCopy(tls, pBest, pArg)
}
}
-func minMaxValueFinalize(tls *crt.TLS, context uintptr, bValue int32) { /* sqlite3.c:118444:13: */
+func minMaxValueFinalize(tls *libc.TLS, context uintptr, bValue int32) { /* sqlite3.c:118743:13: */
var pRes uintptr
pRes = Xsqlite3_aggregate_context(tls, context, 0)
if pRes != 0 {
@@ -94169,15 +97789,15 @@ func minMaxValueFinalize(tls *crt.TLS, context uintptr, bValue int32) { /* sqlit
}
}
}
-func minMaxValue(tls *crt.TLS, context uintptr) { /* sqlite3.c:118455:13: */
+func minMaxValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:118754:13: */
minMaxValueFinalize(tls, context, 1)
}
-func minMaxFinalize(tls *crt.TLS, context uintptr) { /* sqlite3.c:118461:13: */
+func minMaxFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118760:13: */
minMaxValueFinalize(tls, context, 0)
}
// group_concat(EXPR, ?SEPARATOR?)
-func groupConcatStep(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118468:13: */
+func groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118767:13: */
var zVal uintptr
var pAccum uintptr
var zSep uintptr
@@ -94191,14 +97811,14 @@ func groupConcatStep(tls *crt.TLS, context uintptr, argc int32, argv uintptr) {
if pAccum != 0 {
var db uintptr = Xsqlite3_context_db_handle(tls, context)
- var firstTerm int32 = (crt.Bool32((*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc == U32(0)))
+ var firstTerm int32 = (libc.Bool32((*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc == U32(0)))
(*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc = U32(*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(0)*4)))
if !(firstTerm != 0) {
if argc == 2 {
zSep = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
nSep = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
} else {
- zSep = ts + 11166 /* "," */
+ zSep = ts + 13896 /* "," */
nSep = 1
}
if zSep != 0 {
@@ -94212,7 +97832,7 @@ func groupConcatStep(tls *crt.TLS, context uintptr, argc int32, argv uintptr) {
}
}
}
-func groupConcatInverse(tls *crt.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118501:13: */
+func groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:118800:13: */
var n int32
var pAccum uintptr
@@ -94233,14 +97853,14 @@ func groupConcatInverse(tls *crt.TLS, context uintptr, argc int32, argv uintptr)
(*StrAccum)(unsafe.Pointer(pAccum)).FnChar = U32(0)
} else {
*(*U32)(unsafe.Pointer(pAccum + 24 /* &.nChar */)) -= (U32(n))
- crt.Xmemmove(tls, (*StrAccum)(unsafe.Pointer(pAccum)).FzText, ((*StrAccum)(unsafe.Pointer(pAccum)).FzText + uintptr(n)), uint64((*StrAccum)(unsafe.Pointer(pAccum)).FnChar))
+ libc.Xmemmove(tls, (*StrAccum)(unsafe.Pointer(pAccum)).FzText, ((*StrAccum)(unsafe.Pointer(pAccum)).FzText + uintptr(n)), uint64((*StrAccum)(unsafe.Pointer(pAccum)).FnChar))
}
if (*StrAccum)(unsafe.Pointer(pAccum)).FnChar == U32(0) {
(*StrAccum)(unsafe.Pointer(pAccum)).FmxAlloc = U32(0)
}
}
}
-func groupConcatFinalize(tls *crt.TLS, context uintptr) { /* sqlite3.c:118532:13: */
+func groupConcatFinalize(tls *libc.TLS, context uintptr) { /* sqlite3.c:118831:13: */
var pAccum uintptr
pAccum = Xsqlite3_aggregate_context(tls, context, 0)
if pAccum != 0 {
@@ -94250,11 +97870,11 @@ func groupConcatFinalize(tls *crt.TLS, context uintptr) { /* sqlite3.c:118532:13
Xsqlite3_result_error_nomem(tls, context)
} else {
Xsqlite3_result_text(tls, context, Xsqlite3StrAccumFinish(tls, pAccum), -1,
- *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})))
+ *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
}
}
}
-func groupConcatValue(tls *crt.TLS, context uintptr) { /* sqlite3.c:118547:13: */
+func groupConcatValue(tls *libc.TLS, context uintptr) { /* sqlite3.c:118846:13: */
var pAccum uintptr
pAccum = Xsqlite3_aggregate_context(tls, context, 0)
if pAccum != 0 {
@@ -94264,7 +97884,7 @@ func groupConcatValue(tls *crt.TLS, context uintptr) { /* sqlite3.c:118547:13: *
Xsqlite3_result_error_nomem(tls, context)
} else {
var zText uintptr = Xsqlite3_str_value(tls, pAccum)
- Xsqlite3_result_text(tls, context, zText, -1, crt.UintptrFromInt32(-1))
+ Xsqlite3_result_text(tls, context, zText, -1, libc.UintptrFromInt32(-1))
}
}
}
@@ -94272,8 +97892,8 @@ func groupConcatValue(tls *crt.TLS, context uintptr) { /* sqlite3.c:118547:13: *
// This routine does per-connection function registration. Most
// of the built-in functions above are part of the global function set.
// This routine only deals with those that are not global.
-func Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *crt.TLS, db uintptr) { /* sqlite3.c:118570:21: */
- var rc int32 = Xsqlite3_overload_function(tls, db, ts+13210 /* "MATCH" */, 2)
+func Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { /* sqlite3.c:118869:21: */
+ var rc int32 = Xsqlite3_overload_function(tls, db, ts+15991 /* "MATCH" */, 2)
if rc == 7 {
Xsqlite3OomFault(tls, db)
@@ -94283,7 +97903,7 @@ func Xsqlite3RegisterPerConnectionBuiltinFunctions(tls *crt.TLS, db uintptr) { /
// Re-register the built-in LIKE functions. The caseSensitive
// parameter determines whether or not the LIKE operator is case
// sensitive.
-func Xsqlite3RegisterLikeFunctions(tls *crt.TLS, db uintptr, caseSensitive int32) { /* sqlite3.c:118583:21: */
+func Xsqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int32) { /* sqlite3.c:118882:21: */
var pInfo uintptr
var flags int32
if caseSensitive != 0 {
@@ -94293,14 +97913,14 @@ func Xsqlite3RegisterLikeFunctions(tls *crt.TLS, db uintptr, caseSensitive int32
pInfo = uintptr(unsafe.Pointer(&likeInfoNorm))
flags = 0x0004
}
- Xsqlite3CreateFunc(tls, db, ts+13216 /* "like" */, 2, 1, pInfo, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ Xsqlite3CreateFunc(tls, db, ts+15997 /* "like" */, 2, 1, pInfo, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{likeFunc})), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
- Xsqlite3CreateFunc(tls, db, ts+13216 /* "like" */, 3, 1, pInfo, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ Xsqlite3CreateFunc(tls, db, ts+15997 /* "like" */, 3, 1, pInfo, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{likeFunc})), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
- *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+13216 /* "like" */, 2, uint8(1), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags))
- *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+13216 /* "like" */, 3, uint8(1), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags))
+ *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+15997 /* "like" */, 2, uint8(1), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags))
+ *(*U32)(unsafe.Pointer(Xsqlite3FindFunction(tls, db, ts+15997 /* "like" */, 3, uint8(1), uint8(0)) + 4 /* &.funcFlags */)) |= (U32(flags))
}
// pExpr points to an expression which implements a function. If
@@ -94318,7 +97938,7 @@ func Xsqlite3RegisterLikeFunctions(tls *crt.TLS, db uintptr, caseSensitive int32
// the function (default for LIKE). If the function makes the distinction
// between uppercase and lowercase (as does GLOB) then *pIsNocase is set to
// false.
-func Xsqlite3IsLikeFunction(tls *crt.TLS, db uintptr, pExpr uintptr, pIsNocase uintptr, aWc uintptr) int32 { /* sqlite3.c:118616:20: */
+func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase uintptr, aWc uintptr) int32 { /* sqlite3.c:118915:20: */
var pDef uintptr
var nExpr int32
if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != 169) || !(int32(*(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))) != 0) {
@@ -94334,7 +97954,7 @@ func Xsqlite3IsLikeFunction(tls *crt.TLS, db uintptr, pExpr uintptr, pIsNocase u
// The memcpy() statement assumes that the wildcard characters are
// the first three statements in the compareInfo structure. The
// asserts() that follow verify that assumption
- crt.Xmemcpy(tls, aWc, (*FuncDef)(unsafe.Pointer(pDef)).FpUserData, uint64(3))
+ libc.Xmemcpy(tls, aWc, (*FuncDef)(unsafe.Pointer(pDef)).FpUserData, uint64(3))
if nExpr < 3 {
*(*int8)(unsafe.Pointer(aWc + uintptr(3))) = int8(0)
@@ -94357,7 +97977,7 @@ func Xsqlite3IsLikeFunction(tls *crt.TLS, db uintptr, pExpr uintptr, pIsNocase u
*(*int8)(unsafe.Pointer(aWc + uintptr(3))) = *(*int8)(unsafe.Pointer(zEscape + uintptr(0)))
}
- *(*int32)(unsafe.Pointer(pIsNocase)) = (crt.Bool32(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(0x0008)) == U32(0)))
+ *(*int32)(unsafe.Pointer(pIsNocase)) = (libc.Bool32(((*FuncDef)(unsafe.Pointer(pDef)).FfuncFlags & U32(0x0008)) == U32(0)))
return 1
}
@@ -94366,7 +97986,7 @@ func Xsqlite3IsLikeFunction(tls *crt.TLS, db uintptr, pExpr uintptr, pIsNocase u
// a consequence of calling sqlite3_initialize()).
//
// After this routine runs
-func Xsqlite3RegisterBuiltinFunctions(tls *crt.TLS) { /* sqlite3.c:118665:21: */
+func Xsqlite3RegisterBuiltinFunctions(tls *libc.TLS) { /* sqlite3.c:118964:21: */
Xsqlite3AlterFunctions(tls)
Xsqlite3WindowFunctions(tls)
Xsqlite3RegisterDateTimeFunctions(tls)
@@ -94374,74 +97994,76 @@ func Xsqlite3RegisterBuiltinFunctions(tls *crt.TLS) { /* sqlite3.c:118665:21: */
}
-var aBuiltinFunc = [63]FuncDef{
+var aBuiltinFunc = [65]FuncDef{
//**** Functions only available with SQLITE_TESTCTRL_INTERNAL_FUNCTIONS ****
- {FnArg: int8(2), FfuncFlags: (U32(((((1 | 0x00040000) | 0x4000) | 0x00400000) | 0x0800) | (0))), FpUserData: uintptr(int64(1)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13221 /* "implies_nonnull_..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32(((((1 | 0x00040000) | 0x4000) | 0x00400000) | 0x0800) | (0))), FpUserData: uintptr(int64(3)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13241 /* "expr_compare" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32(((((1 | 0x00040000) | 0x4000) | 0x00400000) | 0x0800) | (0))), FpUserData: uintptr(int64(2)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13254 /* "expr_implies_exp..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32(((((1 | 0x00040000) | 0x4000) | 0x00400000) | 0x0800) | (0))), FpUserData: uintptr(int64(1)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16002 /* "implies_nonnull_..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32(((((1 | 0x00040000) | 0x4000) | 0x00400000) | 0x0800) | (0))), FpUserData: uintptr(int64(3)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16022 /* "expr_compare" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32(((((1 | 0x00040000) | 0x4000) | 0x00400000) | 0x0800) | (0))), FpUserData: uintptr(int64(2)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16035 /* "expr_implies_exp..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
//**** Regular functions ****
- {FnArg: int8(1), FfuncFlags: (U32((1 | 0x000080000) | 0x00200000)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13272 /* "load_extension" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32((1 | 0x000080000) | 0x00200000)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13272 /* "load_extension" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13287 /* "sqlite_compileop..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13313 /* "sqlite_compileop..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32(((1 | 0x00400000) | 0x0800) | (0x0400))), FpUserData: uintptr(int64(99)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13338 /* "unlikely" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32(((1 | 0x00400000) | 0x0800) | (0x0400))), FpUserData: uintptr(int64(99)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13347 /* "likelihood" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32(((1 | 0x00400000) | 0x0800) | (0x0400))), FpUserData: uintptr(int64(99)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13358 /* "likely" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(1)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13365 /* "ltrim" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(1)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13365 /* "ltrim" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(2)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13371 /* "rtrim" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(2)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13371 /* "rtrim" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(3)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13377 /* "trim" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(3)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13377 /* "trim" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(-1), FfuncFlags: (U32((0x0800 | 1) | (1 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13382 /* "min" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32((0x0800 | 1) | (1 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: uintptr(0), FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13382 /* "min" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((1 | (1 * 0x0020)) | 0x1000)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: uintptr(0), FzName: ts + 13382 /* "min" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(-1), FfuncFlags: (U32((0x0800 | 1) | (1 * 0x0020))), FpUserData: uintptr(int64(1)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13386 /* "max" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32((0x0800 | 1) | (1 * 0x0020))), FpUserData: uintptr(int64(1)), FpNext: uintptr(0), FxSFunc: uintptr(0), FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13386 /* "max" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((1 | (1 * 0x0020)) | 0x1000)), FpUserData: uintptr(int64(1)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: uintptr(0), FzName: ts + 13386 /* "max" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32(((0x0800 | 1) | (0 * 0x0020)) | 0x0080)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13390 /* "typeof" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32(((0x0800 | 1) | (0 * 0x0020)) | 0x0040)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13397 /* "length" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13404 /* "instr" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(-1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13410 /* "printf" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13417 /* "unicode" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(-1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13425 /* "char" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13430 /* "abs" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13434 /* "round" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13434 /* "round" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13440 /* "upper" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13446 /* "lower" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13452 /* "hex" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32(((1 | 0x00400000) | 0x0800) | (0))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13456 /* "ifnull" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32(1 | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13463 /* "random" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32(1 | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13470 /* "randomblob" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (1 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13481 /* "nullif" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13488 /* "sqlite_version" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13503 /* "sqlite_source_id" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13520 /* "sqlite_log" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13531 /* "quote" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32(1 | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13537 /* "last_insert_rowi..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32(1 | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13555 /* "changes" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32(1 | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13563 /* "total_changes" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(3), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13577 /* "replace" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13585 /* "zeroblob" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13594 /* "substr" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(3), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13594 /* "substr" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13601 /* "sum" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13605 /* "total" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13611 /* "avg" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0x0100)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13615 /* "count" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13615 /* "count" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13621 /* "group_concat" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 13621 /* "group_concat" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
-
- {FnArg: int8(2), FfuncFlags: (U32(((0x0800 | 1) | 0x0004) | 0x0008)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13634 /* "glob" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | 0x0004)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13216 /* "like" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(3), FfuncFlags: (U32((0x0800 | 1) | 0x0004)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13216 /* "like" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: uintptr(0), FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13639 /* "coalesce" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(0), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: uintptr(0), FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13639 /* "coalesce" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(-1), FfuncFlags: (U32(((1 | 0x00400000) | 0x0800) | (0))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13639 /* "coalesce" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
- {FnArg: int8(3), FfuncFlags: (U32(((1 | 0x00400000) | 0x0800) | (0))), FpUserData: uintptr(int64(5)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 13648 /* "iif" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
-} /* sqlite3.c:118676:18 */
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16053 /* "soundex" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((1 | 0x000080000) | 0x00200000)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16061 /* "load_extension" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32((1 | 0x000080000) | 0x00200000)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16061 /* "load_extension" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16076 /* "sqlite_compileop..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16102 /* "sqlite_compileop..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32(((1 | 0x00400000) | 0x0800) | (0x0400))), FpUserData: uintptr(int64(99)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16127 /* "unlikely" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32(((1 | 0x00400000) | 0x0800) | (0x0400))), FpUserData: uintptr(int64(99)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16136 /* "likelihood" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32(((1 | 0x00400000) | 0x0800) | (0x0400))), FpUserData: uintptr(int64(99)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16147 /* "likely" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((((0x0800 | 1) | (0 * 0x0020)) | 0x8000) | 0x0080)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16154 /* "sqlite_offset" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(1)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16168 /* "ltrim" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(1)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16168 /* "ltrim" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(2)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16174 /* "rtrim" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(2)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16174 /* "rtrim" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(3)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16180 /* "trim" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(3)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16180 /* "trim" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(-1), FfuncFlags: (U32((0x0800 | 1) | (1 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16185 /* "min" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32((0x0800 | 1) | (1 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: uintptr(0), FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16185 /* "min" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((1 | (1 * 0x0020)) | 0x1000)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: uintptr(0), FzName: ts + 16185 /* "min" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(-1), FfuncFlags: (U32((0x0800 | 1) | (1 * 0x0020))), FpUserData: uintptr(int64(1)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16189 /* "max" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32((0x0800 | 1) | (1 * 0x0020))), FpUserData: uintptr(int64(1)), FpNext: uintptr(0), FxSFunc: uintptr(0), FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16189 /* "max" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((1 | (1 * 0x0020)) | 0x1000)), FpUserData: uintptr(int64(1)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: uintptr(0), FzName: ts + 16189 /* "max" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32(((0x0800 | 1) | (0 * 0x0020)) | 0x0080)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16193 /* "typeof" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32(((0x0800 | 1) | (0 * 0x0020)) | 0x0040)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16200 /* "length" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16207 /* "instr" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(-1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16213 /* "printf" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16220 /* "unicode" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(-1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16228 /* "char" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16233 /* "abs" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16237 /* "round" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16237 /* "round" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16243 /* "upper" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16249 /* "lower" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16255 /* "hex" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32(((1 | 0x00400000) | 0x0800) | (0))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16259 /* "ifnull" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32(1 | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16266 /* "random" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32(1 | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16273 /* "randomblob" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (1 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16284 /* "nullif" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16291 /* "sqlite_version" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32(0x2000 | 1)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16306 /* "sqlite_source_id" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16323 /* "sqlite_log" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16334 /* "quote" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32(1 | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16340 /* "last_insert_rowi..." */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32(1 | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16358 /* "changes" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32(1 | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16366 /* "total_changes" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(3), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16380 /* "replace" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16388 /* "zeroblob" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16397 /* "substr" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(3), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16397 /* "substr" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16404 /* "sum" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16408 /* "total" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16414 /* "avg" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0x0100)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16418 /* "count" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16418 /* "count" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16424 /* "group_concat" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32((1 | (0 * 0x0020)) | 0)), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: ts + 16424 /* "group_concat" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+
+ {FnArg: int8(2), FfuncFlags: (U32(((0x0800 | 1) | 0x0004) | 0x0008)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16437 /* "glob" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(2), FfuncFlags: (U32((0x0800 | 1) | 0x0004)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 15997 /* "like" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(3), FfuncFlags: (U32((0x0800 | 1) | 0x0004)), FpUserData: 0, FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 15997 /* "like" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(1), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: uintptr(0), FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16442 /* "coalesce" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(0), FfuncFlags: (U32((0x0800 | 1) | (0 * 0x0020))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: uintptr(0), FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16442 /* "coalesce" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(-1), FfuncFlags: (U32(((1 | 0x00400000) | 0x0800) | (0))), FpUserData: uintptr(int64(0)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16442 /* "coalesce" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+ {FnArg: int8(3), FfuncFlags: (U32(((1 | 0x00400000) | 0x0800) | (0))), FpUserData: uintptr(int64(5)), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: uintptr(0), FxValue: uintptr(0), FxInverse: uintptr(0), FzName: ts + 16451 /* "iif" */, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
+} /* sqlite3.c:118975:18 */
//************* End of func.c ***********************************************
//************* Begin file fkey.c *******************************************
@@ -94616,7 +98238,7 @@ var aBuiltinFunc = [63]FuncDef{
// then non-zero is returned, and a "foreign key mismatch" error loaded
// into pParse. If an OOM error occurs, non-zero is returned and the
// pParse->db->mallocFailed flag is set.
-func Xsqlite3FkLocateIndex(tls *crt.TLS, pParse uintptr, pParent uintptr, pFKey uintptr, ppIdx uintptr, paiCol uintptr) int32 { /* sqlite3.c:118985:20: */
+func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey uintptr, ppIdx uintptr, paiCol uintptr) int32 { /* sqlite3.c:119284:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -94727,8 +98349,8 @@ func Xsqlite3FkLocateIndex(tls *crt.TLS, pParse uintptr, pParent uintptr, pFKey
if !(pIdx != 0) {
if !(int32((*Parse)(unsafe.Pointer(pParse)).FdisableTriggers) != 0) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+13652, /* "foreign key mism..." */
- crt.VaList(bp, (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*FKey)(unsafe.Pointer(pFKey)).FzTo))
+ ts+16455, /* "foreign key mism..." */
+ libc.VaList(bp, (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*FKey)(unsafe.Pointer(pFKey)).FzTo))
}
Xsqlite3DbFree(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, aiCol)
return 1
@@ -94762,7 +98384,7 @@ func Xsqlite3FkLocateIndex(tls *crt.TLS, pParse uintptr, pParent uintptr, pFKey
//
// These operations are identified in the comment at the top of this file
// (fkey.c) as "I.1" and "D.1".
-func fkLookupParent(tls *crt.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32, isIgnore int32) { /* sqlite3.c:119120:13: */
+func fkLookupParent(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32, isIgnore int32) { /* sqlite3.c:119419:13: */
var i int32 // Iterator variable
var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Vdbe to add code to
var iCur int32 = ((*Parse)(unsafe.Pointer(pParse)).FnTab - 1) // Cursor number to use
@@ -94819,7 +98441,7 @@ func fkLookupParent(tls *crt.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx
var regTemp int32 = Xsqlite3GetTempRange(tls, pParse, nCol)
var regRec int32 = Xsqlite3GetTempReg(tls, pParse)
- Xsqlite3VdbeAddOp3(tls, v, 96, iCur, (*Index)(unsafe.Pointer(pIdx)).Ftnum, iDb)
+ Xsqlite3VdbeAddOp3(tls, v, 96, iCur, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
for i = 0; i < nCol; i++ {
Xsqlite3VdbeAddOp2(tls, v, 77,
@@ -94891,7 +98513,7 @@ func fkLookupParent(tls *crt.TLS, pParse uintptr, iDb int32, pTab uintptr, pIdx
// regBase is the first of an array of register that contains the data
// for pTab. regBase itself holds the rowid. regBase+1 holds the first
// column. regBase+2 holds the second column, and so forth.
-func exprTableRegister(tls *crt.TLS, pParse uintptr, pTab uintptr, regBase int32, iCol I16) uintptr { /* sqlite3.c:119273:13: */
+func exprTableRegister(tls *libc.TLS, pParse uintptr, pTab uintptr, regBase int32, iCol I16) uintptr { /* sqlite3.c:119572:13: */
var pExpr uintptr
var pCol uintptr
var zColl uintptr
@@ -94918,7 +98540,7 @@ func exprTableRegister(tls *crt.TLS, pParse uintptr, pTab uintptr, regBase int32
// Return an Expr object that refers to column iCol of table pTab which
// has cursor iCur.
-func exprTableColumn(tls *crt.TLS, db uintptr, pTab uintptr, iCursor int32, iCol I16) uintptr { /* sqlite3.c:119305:13: */
+func exprTableColumn(tls *libc.TLS, db uintptr, pTab uintptr, iCursor int32, iCol I16) uintptr { /* sqlite3.c:119604:13: */
var pExpr uintptr = Xsqlite3Expr(tls, db, 164, uintptr(0))
if pExpr != 0 {
*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = pTab
@@ -94958,7 +98580,7 @@ func exprTableColumn(tls *crt.TLS, db uintptr, pTab uintptr, iCursor int32, iCol
//
// These operations are identified in the comment at the top of this file
// (fkey.c) as "I.2" and "D.2".
-func fkScanChildren(tls *crt.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32) { /* sqlite3.c:119352:13: */
+func fkScanChildren(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pIdx uintptr, pFKey uintptr, aiCol uintptr, regData int32, nIncr int32) { /* sqlite3.c:119651:13: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -94986,7 +98608,7 @@ func fkScanChildren(tls *crt.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pI
var pLeft uintptr // Value from parent table row
var pRight uintptr // Column ref to child table
var pEq uintptr // Expression (pLeft = pRight)
- var iCol I16 /* Index of column in child table */
+ var iCol I16 // Index of column in child table
var zCol uintptr // Name of column in child table
if pIdx != 0 {
@@ -95046,7 +98668,7 @@ func fkScanChildren(tls *crt.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pI
}
// Resolve the references in the WHERE clause.
- crt.Xmemset(tls, bp /* &sNameContext */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp /* &sNameContext */, 0, uint64(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp /* &sNameContext */)).FpSrcList = pSrc
(*NameContext)(unsafe.Pointer(bp /* &sNameContext */)).FpParse = pParse
Xsqlite3ResolveExprNames(tls, bp /* &sNameContext */, pWhere)
@@ -95081,7 +98703,7 @@ func fkScanChildren(tls *crt.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pI
// "t2". Calling this function with "t2" as the argument would return a
// NULL pointer (as there are no FK constraints for which t2 is the parent
// table).
-func Xsqlite3FkReferences(tls *crt.TLS, pTab uintptr) uintptr { /* sqlite3.c:119481:21: */
+func Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr { /* sqlite3.c:119780:21: */
return Xsqlite3HashFind(tls, ((*Table)(unsafe.Pointer(pTab)).FpSchema + 80 /* &.fkeyHash */), (*Table)(unsafe.Pointer(pTab)).FzName)
}
@@ -95091,7 +98713,7 @@ func Xsqlite3FkReferences(tls *crt.TLS, pTab uintptr) uintptr { /* sqlite3.c:119
//
// The Trigger structure or any of its sub-components may be allocated from
// the lookaside buffer belonging to database handle dbMem.
-func fkTriggerDelete(tls *crt.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:119493:13: */
+func fkTriggerDelete(tls *libc.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:119792:13: */
if p != 0 {
var pStep uintptr = (*Trigger)(unsafe.Pointer(p)).Fstep_list
Xsqlite3ExprDelete(tls, dbMem, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere)
@@ -95117,7 +98739,7 @@ func fkTriggerDelete(tls *crt.TLS, dbMem uintptr, p uintptr) { /* sqlite3.c:1194
// then the equivalent of "DELETE FROM <tbl>" is executed before dropping
// the table from the database. Triggers are disabled while running this
// DELETE, but foreign key actions are not.
-func Xsqlite3FkDropTable(tls *crt.TLS, pParse uintptr, pName uintptr, pTab uintptr) { /* sqlite3.c:119521:21: */
+func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uintptr) { /* sqlite3.c:119820:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00004000)) != 0) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
var iSkip int32 = 0
@@ -95180,7 +98802,7 @@ func Xsqlite3FkDropTable(tls *crt.TLS, pParse uintptr, pName uintptr, pTab uintp
//
// This function returns true if any of the columns that are part of the
// child key for FK constraint *p are modified.
-func fkChildIsModified(tls *crt.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:119584:12: */
+func fkChildIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:119883:12: */
var i int32
for i = 0; i < (*FKey)(unsafe.Pointer(p)).FnCol; i++ {
var iChildKey int32 = (*sColMap)(unsafe.Pointer((p + 64 /* &.aCol */) + uintptr(i)*16)).FiFrom
@@ -95204,7 +98826,7 @@ func fkChildIsModified(tls *crt.TLS, pTab uintptr, p uintptr, aChange uintptr, b
//
// This function returns true if any of the columns that are part of the
// parent key for FK constraint *p are modified.
-func fkParentIsModified(tls *crt.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:119611:12: */
+func fkParentIsModified(tls *libc.TLS, pTab uintptr, p uintptr, aChange uintptr, bChngRowid int32) int32 { /* sqlite3.c:119910:12: */
var i int32
for i = 0; i < (*FKey)(unsafe.Pointer(p)).FnCol; i++ {
var zKey uintptr = (*sColMap)(unsafe.Pointer((p + 64 /* &.aCol */) + uintptr(i)*16)).FzCol
@@ -95228,7 +98850,7 @@ func fkParentIsModified(tls *crt.TLS, pTab uintptr, p uintptr, aChange uintptr,
// Return true if the parser passed as the first argument is being
// used to code a trigger that is really a "SET NULL" action belonging
// to trigger pFKey.
-func isSetNullAction(tls *crt.TLS, pParse uintptr, pFKey uintptr) int32 { /* sqlite3.c:119640:12: */
+func isSetNullAction(tls *libc.TLS, pParse uintptr, pFKey uintptr) int32 { /* sqlite3.c:119939:12: */
var pTop uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -95263,7 +98885,7 @@ func isSetNullAction(tls *crt.TLS, pParse uintptr, pFKey uintptr) int32 { /* sql
// the original record is deleted from the table using the calling convention
// described for DELETE. Then again after the original record is deleted
// but before the new record is inserted using the INSERT convention.
-func Xsqlite3FkCheck(tls *crt.TLS, pParse uintptr, pTab uintptr, regOld int32, regNew int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:119673:21: */
+func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, regNew int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:119972:21: */
bp := tls.Alloc(40)
defer tls.Free(40)
@@ -95359,7 +98981,7 @@ func Xsqlite3FkCheck(tls *crt.TLS, pParse uintptr, pTab uintptr, regOld int32, r
return int32((*Table)(unsafe.Pointer(pTo)).FiPKey)
}())*32)).FzName
rcauth = Xsqlite3AuthReadCol(tls, pParse, (*Table)(unsafe.Pointer(pTo)).FzName, zCol, iDb)
- bIgnore = (crt.Bool32(rcauth == 2))
+ bIgnore = (libc.Bool32(rcauth == 2))
}
}
@@ -95424,13 +99046,13 @@ func Xsqlite3FkCheck(tls *crt.TLS, pParse uintptr, pTab uintptr, regOld int32, r
(*SrcList_item)(unsafe.Pointer(pItem)).FpTab = (*FKey)(unsafe.Pointer(pFKey)).FpFrom
(*SrcList_item)(unsafe.Pointer(pItem)).FzName = (*Table)(unsafe.Pointer((*FKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName
(*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpTab)).FnTabRef++
- (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
if regNew != 0 {
fkScanChildren(tls, pParse, pSrc, pTab, *(*uintptr)(unsafe.Pointer(bp + 24 /* pIdx */)), pFKey, *(*uintptr)(unsafe.Pointer(bp + 32 /* aiCol */)), regNew, -1)
}
if regOld != 0 {
- var eAction int32 = int32(*(*U8)(unsafe.Pointer((pFKey + 45 /* &.aAction */) + uintptr((crt.Bool32(aChange != uintptr(0)))))))
+ var eAction int32 = int32(*(*U8)(unsafe.Pointer((pFKey + 45 /* &.aAction */) + uintptr((libc.Bool32(aChange != uintptr(0)))))))
fkScanChildren(tls, pParse, pSrc, pTab, *(*uintptr)(unsafe.Pointer(bp + 24 /* pIdx */)), pFKey, *(*uintptr)(unsafe.Pointer(bp + 32 /* aiCol */)), regOld, 1)
// If this is a deferred FK constraint, or a CASCADE or SET NULL
// action applies, then any foreign key violations caused by
@@ -95462,7 +99084,7 @@ func Xsqlite3FkCheck(tls *crt.TLS, pParse uintptr, pTab uintptr, regOld int32, r
// This function is called before generating code to update or delete a
// row contained in table pTab.
-func Xsqlite3FkOldmask(tls *crt.TLS, pParse uintptr, pTab uintptr) U32 { /* sqlite3.c:119875:20: */
+func Xsqlite3FkOldmask(tls *libc.TLS, pParse uintptr, pTab uintptr) U32 { /* sqlite3.c:120174:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -95519,14 +99141,14 @@ func Xsqlite3FkOldmask(tls *crt.TLS, pParse uintptr, pTab uintptr) U32 { /* sqli
// not "NO ACTION" (i.e. is CASCADE, SET DEFAULT or SET NULL).
//
// Or, assuming some other foreign key processing is required, 1.
-func Xsqlite3FkRequired(tls *crt.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32 { /* sqlite3.c:119923:20: */
+func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32 { /* sqlite3.c:120222:20: */
var eRet int32 = 0
if ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(0x00004000)) != 0 {
if !(aChange != 0) {
// A DELETE operation. Foreign key processing is required if the
// table in question is either the child or parent table for any
// foreign key constraint.
- eRet = (crt.Bool32((Xsqlite3FkReferences(tls, pTab) != 0) || ((*Table)(unsafe.Pointer(pTab)).FpFKey != 0)))
+ eRet = (libc.Bool32((Xsqlite3FkReferences(tls, pTab) != 0) || ((*Table)(unsafe.Pointer(pTab)).FpFKey != 0)))
} else {
// This is an UPDATE. Foreign key processing is only required if the
// operation modifies one or more child or parent key columns.
@@ -95583,14 +99205,14 @@ func Xsqlite3FkRequired(tls *crt.TLS, pParse uintptr, pTab uintptr, aChange uint
// The returned pointer is cached as part of the foreign key object. It
// is eventually freed along with the rest of the foreign key object by
// sqlite3FkDelete().
-func fkActionTrigger(tls *crt.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, pChanges uintptr) uintptr { /* sqlite3.c:119990:16: */
+func fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr, pChanges uintptr) uintptr { /* sqlite3.c:120289:16: */
bp := tls.Alloc(96)
defer tls.Free(96)
- var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database handle
- var action int32 // One of OE_None, OE_Cascade etc.
- var pTrigger uintptr // Trigger definition to return
- var iAction int32 = (crt.Bool32(pChanges != uintptr(0))) // 1 for UPDATE, 0 for DELETE
+ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database handle
+ var action int32 // One of OE_None, OE_Cascade etc.
+ var pTrigger uintptr // Trigger definition to return
+ var iAction int32 = (libc.Bool32(pChanges != uintptr(0))) // 1 for UPDATE, 0 for DELETE
action = int32(*(*U8)(unsafe.Pointer((pFKey + 45 /* &.aAction */) + uintptr(iAction))))
if (action == 7) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00080000)) != 0) {
@@ -95615,8 +99237,8 @@ func fkActionTrigger(tls *crt.TLS, pParse uintptr, pTab uintptr, pFKey uintptr,
}
for i = 0; i < (*FKey)(unsafe.Pointer(pFKey)).FnCol; i++ {
- *(*Token)(unsafe.Pointer(bp + 48 /* tOld */)) = Token{Fz: ts + 6125 /* "old" */, Fn: uint32(3)} // Literal "old" token
- *(*Token)(unsafe.Pointer(bp + 64 /* tNew */)) = Token{Fz: ts + 6121 /* "new" */, Fn: uint32(3)} // Literal "new" token
+ *(*Token)(unsafe.Pointer(bp + 48 /* tOld */)) = Token{Fz: ts + 8323 /* "old" */, Fn: uint32(3)} // Literal "old" token
+ *(*Token)(unsafe.Pointer(bp + 64 /* tNew */)) = Token{Fz: ts + 8319 /* "new" */, Fn: uint32(3)} // Literal "new" token
// var tFromCol Token at bp+32, 16
// Name of column in child table
// var tToCol Token at bp+16, 16
@@ -95704,7 +99326,7 @@ func fkActionTrigger(tls *crt.TLS, pParse uintptr, pTab uintptr, pFKey uintptr,
(*Token)(unsafe.Pointer(bp + 80 /* &tFrom */)).Fz = zFrom
(*Token)(unsafe.Pointer(bp + 80 /* &tFrom */)).Fn = uint32(nFrom)
- pRaise = Xsqlite3Expr(tls, db, 71, ts+4635 /* "FOREIGN KEY cons..." */)
+ pRaise = Xsqlite3Expr(tls, db, 71, ts+6833 /* "FOREIGN KEY cons..." */)
if pRaise != 0 {
(*Expr)(unsafe.Pointer(pRaise)).FaffExpr = int8(2)
}
@@ -95723,9 +99345,9 @@ func fkActionTrigger(tls *crt.TLS, pParse uintptr, pTab uintptr, pFKey uintptr,
pTrigger = Xsqlite3DbMallocZero(tls, db,
(uint64(((uint64(unsafe.Sizeof(Trigger{})) + uint64(unsafe.Sizeof(TriggerStep{}))) + uint64(nFrom)) + uint64(1))))
if pTrigger != 0 {
- pStep = crt.AssignPtrUintptr(pTrigger+56 /* &.step_list */, (pTrigger + uintptr(1)*72))
- (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget = (pStep + uintptr(1)*88)
- crt.Xmemcpy(tls, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget, zFrom, uint64(nFrom))
+ pStep = libc.AssignPtrUintptr(pTrigger+56 /* &.step_list */, (pTrigger + uintptr(1)*72))
+ (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget = (pStep + uintptr(1)*96)
+ libc.Xmemcpy(tls, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget, zFrom, uint64(nFrom))
(*TriggerStep)(unsafe.Pointer(pStep)).FpWhere = Xsqlite3ExprDup(tls, db, pWhere, 0x0001)
(*TriggerStep)(unsafe.Pointer(pStep)).FpExprList = Xsqlite3ExprListDup(tls, db, pList, 0x0001)
@@ -95765,6 +99387,7 @@ func fkActionTrigger(tls *crt.TLS, pParse uintptr, pTab uintptr, pFKey uintptr,
break
}
fallthrough
+ /* no break */
default:
(*TriggerStep)(unsafe.Pointer(pStep)).Fop = U8(127)
}
@@ -95785,7 +99408,7 @@ func fkActionTrigger(tls *crt.TLS, pParse uintptr, pTab uintptr, pFKey uintptr,
// This function is called when deleting or updating a row to implement
// any required CASCADE, SET NULL or SET DEFAULT actions.
-func Xsqlite3FkActions(tls *crt.TLS, pParse uintptr, pTab uintptr, pChanges uintptr, regOld int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:120181:21: */
+func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uintptr, regOld int32, aChange uintptr, bChngRowid int32) { /* sqlite3.c:120481:21: */
// If foreign-key support is enabled, iterate through all FKs that
// refer to table pTab. If there is an action associated with the FK
// for this operation (either update or delete), invoke the associated
@@ -95806,7 +99429,7 @@ func Xsqlite3FkActions(tls *crt.TLS, pParse uintptr, pTab uintptr, pChanges uint
// Free all memory associated with foreign key definitions attached to
// table pTab. Remove the deleted foreign keys from the Schema.fkeyHash
// hash table.
-func Xsqlite3FkDelete(tls *crt.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:120213:21: */
+func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:120513:21: */
var pFKey uintptr // Iterator variable
var pNext uintptr // Copy of pFKey->pNextFrom
@@ -95866,7 +99489,10 @@ func Xsqlite3FkDelete(tls *crt.TLS, db uintptr, pTab uintptr) { /* sqlite3.c:120
//
// If pTab is a WITHOUT ROWID table, then it is the PRIMARY KEY index
// for that table that is actually opened.
-func Xsqlite3OpenTable(tls *crt.TLS, pParse uintptr, iCur int32, iDb int32, pTab uintptr, opcode int32) { /* sqlite3.c:120279:21: */
+func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTab uintptr, opcode int32) { /* sqlite3.c:120579:21: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
var v uintptr
v = Xsqlite3GetVdbe(tls, pParse)
@@ -95879,12 +99505,14 @@ func Xsqlite3OpenTable(tls *crt.TLS, pParse uintptr, iCur int32, iDb int32, pTab
return uint8(0)
}(), (*Table)(unsafe.Pointer(pTab)).FzName)
if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0) {
- Xsqlite3VdbeAddOp4Int(tls, v, opcode, iCur, (*Table)(unsafe.Pointer(pTab)).Ftnum, iDb, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol))
+ Xsqlite3VdbeAddOp4Int(tls, v, opcode, iCur, int32((*Table)(unsafe.Pointer(pTab)).Ftnum), iDb, int32((*Table)(unsafe.Pointer(pTab)).FnNVCol))
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
} else {
var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, pTab)
- Xsqlite3VdbeAddOp3(tls, v, opcode, iCur, (*Index)(unsafe.Pointer(pPk)).Ftnum, iDb)
+ Xsqlite3VdbeAddOp3(tls, v, opcode, iCur, int32((*Index)(unsafe.Pointer(pPk)).Ftnum), iDb)
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pPk)
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
}
}
@@ -95906,7 +99534,7 @@ func Xsqlite3OpenTable(tls *crt.TLS, pParse uintptr, iCur int32, iDb int32, pTab
// Memory for the buffer containing the column index affinity string
// is managed along with the rest of the Index structure. It will be
// released when sqlite3DeleteIndex() is called.
-func Xsqlite3IndexAffinityStr(tls *crt.TLS, db uintptr, pIdx uintptr) uintptr { /* sqlite3.c:120325:27: */
+func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr { /* sqlite3.c:120625:27: */
if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) {
// The first time a column affinity string for a particular index is
// required, it is allocated and populated here. It is then stored as
@@ -95965,7 +99593,7 @@ func Xsqlite3IndexAffinityStr(tls *crt.TLS, db uintptr, pIdx uintptr) uintptr {
// 'C' NUMERIC
// 'D' INTEGER
// 'E' REAL
-func Xsqlite3TableAffinity(tls *crt.TLS, v uintptr, pTab uintptr, iReg int32) { /* sqlite3.c:120384:21: */
+func Xsqlite3TableAffinity(tls *libc.TLS, v uintptr, pTab uintptr, iReg int32) { /* sqlite3.c:120684:21: */
var i int32
var j int32
var zColAff uintptr = (*Table)(unsafe.Pointer(pTab)).FzColAff
@@ -95977,19 +99605,19 @@ func Xsqlite3TableAffinity(tls *crt.TLS, v uintptr, pTab uintptr, iReg int32) {
return
}
- for i = crt.AssignInt32(&j, 0); i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
+ for i = libc.AssignInt32(&j, 0); i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & 0x0020) == 0 {
- *(*int8)(unsafe.Pointer(zColAff + uintptr(crt.PostIncInt32(&j, 1)))) = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).Faffinity
+ *(*int8)(unsafe.Pointer(zColAff + uintptr(libc.PostIncInt32(&j, 1)))) = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).Faffinity
}
}
for ok := true; ok; ok = ((j >= 0) && (int32(*(*int8)(unsafe.Pointer(zColAff + uintptr(j)))) <= 0x41)) {
- *(*int8)(unsafe.Pointer(zColAff + uintptr(crt.PostDecInt32(&j, 1)))) = int8(0)
+ *(*int8)(unsafe.Pointer(zColAff + uintptr(libc.PostDecInt32(&j, 1)))) = int8(0)
}
(*Table)(unsafe.Pointer(pTab)).FzColAff = zColAff
}
- i = (int32(crt.Xstrlen(tls, zColAff) & uint64(0x3fffffff)))
+ i = (int32(libc.Xstrlen(tls, zColAff) & uint64(0x3fffffff)))
if i != 0 {
if iReg != 0 {
Xsqlite3VdbeAddOp4(tls, v, 90, iReg, i, 0, zColAff, i)
@@ -96003,7 +99631,7 @@ func Xsqlite3TableAffinity(tls *crt.TLS, v uintptr, pTab uintptr, iReg int32) {
// have been opened at any point in the VDBE program. This is used to see if
// a statement of the form "INSERT INTO <iDb, pTab> SELECT ..." can
// run without using a temporary table for the results of the SELECT.
-func readsTable(tls *crt.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:120423:12: */
+func readsTable(tls *libc.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:120723:12: */
var v uintptr = Xsqlite3GetVdbe(tls, p)
var i int32
var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v)
@@ -96019,7 +99647,7 @@ func readsTable(tls *crt.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sql
if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == 96) && ((*VdbeOp)(unsafe.Pointer(pOp)).Fp3 == iDb) {
var pIndex uintptr
- var tnum int32 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp2
+ var tnum Pgno = Pgno((*VdbeOp)(unsafe.Pointer(pOp)).Fp2)
if tnum == (*Table)(unsafe.Pointer(pTab)).Ftnum {
return 1
}
@@ -96039,7 +99667,7 @@ func readsTable(tls *crt.TLS, p uintptr, iDb int32, pTab uintptr) int32 { /* sql
// This walker callback will compute the union of colFlags flags for all
// referenced columns in a CHECK constraint or generated column expression.
-func exprColumnFlagUnion(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:120460:12: */
+func exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:120760:12: */
if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 164) && (int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0) {
*(*U16)(unsafe.Pointer(pWalker + 36 /* &.eCode */)) |= U16((int32((*Column)(unsafe.Pointer((*Table1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */)))).FaCol + uintptr((*Expr)(unsafe.Pointer(pExpr)).FiColumn)*32)).FcolFlags)))
@@ -96052,7 +99680,7 @@ func exprColumnFlagUnion(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /
// or VIRTUAL columns have not yet been initialized. This routine goes
// back and computes the values for those columns based on the previously
// computed normal columns.
-func Xsqlite3ComputeGeneratedColumns(tls *crt.TLS, pParse uintptr, iRegStore int32, pTab uintptr) { /* sqlite3.c:120476:21: */
+func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore int32, pTab uintptr) { /* sqlite3.c:120776:21: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -96067,7 +99695,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *crt.TLS, pParse uintptr, iRegStore int
// that appropriate affinity has been applied to the regular columns
Xsqlite3TableAffinity(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, pTab, iRegStore)
if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(0x0040)) != U32(0)) &&
- (int32((*VdbeOp)(unsafe.Pointer((crt.AssignUintptr(&pOp, Xsqlite3VdbeGetOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, -1))))).Fopcode) == 90) {
+ (int32((*VdbeOp)(unsafe.Pointer((libc.AssignUintptr(&pOp, Xsqlite3VdbeGetOp(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, -1))))).Fopcode) == 90) {
// Change the OP_Affinity argument to '@' (NONE) for all stored
// columns. '@' is the no-op affinity and those columns have not
// yet been computed.
@@ -96075,7 +99703,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *crt.TLS, pParse uintptr, iRegStore int
var jj int32
var zP4 uintptr = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- for ii = crt.AssignInt32(&jj, 0); *(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) != 0; ii++ {
+ for ii = libc.AssignInt32(&jj, 0); *(*int8)(unsafe.Pointer(zP4 + uintptr(jj))) != 0; ii++ {
if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(ii)*32)).FcolFlags) & 0x0020) != 0 {
continue
}
@@ -96098,7 +99726,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *crt.TLS, pParse uintptr, iRegStore int
*(*uintptr)(unsafe.Pointer(bp + 8 /* &w */ + 40 /* &.u */)) = pTab
(*Walker)(unsafe.Pointer(bp + 8 /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{exprColumnFlagUnion}))
(*Walker)(unsafe.Pointer(bp + 8 /* &w */)).FxSelectCallback = uintptr(0)
(*Walker)(unsafe.Pointer(bp + 8 /* &w */)).FxSelectCallback2 = uintptr(0)
@@ -96118,7 +99746,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *crt.TLS, pParse uintptr, iRegStore int
*(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) |= U16((0x0100))
(*Walker)(unsafe.Pointer(bp + 8 /* &w */)).FeCode = U16(0)
Xsqlite3WalkExpr(tls, bp+8 /* &w */, (*Column)(unsafe.Pointer(pCol)).FpDflt)
- *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0100))))
+ *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0100))))
if (int32((*Walker)(unsafe.Pointer(bp+8 /* &w */)).FeCode) & 0x0080) != 0 {
pRedo = pCol
continue
@@ -96127,12 +99755,12 @@ func Xsqlite3ComputeGeneratedColumns(tls *crt.TLS, pParse uintptr, iRegStore int
x = (int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + iRegStore)
Xsqlite3ExprCodeGeneratedColumn(tls, pParse, pCol, x)
- *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0080))))
+ *(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0080))))
}
}
}
if pRedo != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+7554 /* "generated column..." */, crt.VaList(bp, (*Column)(unsafe.Pointer(pRedo)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+9939 /* "generated column..." */, libc.VaList(bp, (*Column)(unsafe.Pointer(pRedo)).FzName))
}
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
}
@@ -96158,7 +99786,7 @@ func Xsqlite3ComputeGeneratedColumns(tls *crt.TLS, pParse uintptr, iRegStore int
//
// The 2nd register is the one that is returned. That is all the
// insert routine needs to know about.
-func autoIncBegin(tls *crt.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:120594:12: */
+func autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 { /* sqlite3.c:120894:12: */
var memId int32 = 0 // Register holding maximum rowid
if (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(0x0008)) != U32(0)) &&
@@ -96197,8 +99825,8 @@ func autoIncBegin(tls *crt.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 {
(*Parse)(unsafe.Pointer(pToplevel)).FpAinc = pInfo
(*AutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab
(*AutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb
- (*Parse)(unsafe.Pointer(pToplevel)).FnMem++ // Register to hold name of table
- (*AutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pToplevel)).FnMem, 1) // Max rowid register
+ (*Parse)(unsafe.Pointer(pToplevel)).FnMem++ // Register to hold name of table
+ (*AutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pToplevel)).FnMem, 1) // Max rowid register
*(*int32)(unsafe.Pointer(pToplevel + 56 /* &.nMem */)) += (2)
}
memId = (*AutoincInfo)(unsafe.Pointer(pInfo)).FregCtr
@@ -96208,7 +99836,7 @@ func autoIncBegin(tls *crt.TLS, pParse uintptr, iDb int32, pTab uintptr) int32 {
// This routine generates code that will initialize all of the
// register used by the autoincrement tracker.
-func Xsqlite3AutoincrementBegin(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:120643:21: */
+func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:120943:21: */
var p uintptr // Information about an AUTOINCREMENT
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // The database connection
var pDb uintptr // Database only autoinc table
@@ -96230,25 +99858,25 @@ func Xsqlite3AutoincrementBegin(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:120
if aOp == uintptr(0) {
break
}
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*24)).Fp2 = memId
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*24)).Fp3 = (memId + 2)
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(2)*24)).Fp3 = memId
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*24)).Fp1 = (memId - 1)
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*24)).Fp3 = memId
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*24)).Fp5 = U16(0x10)
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(4)*24)).Fp2 = (memId + 1)
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(5)*24)).Fp3 = memId
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(6)*24)).Fp1 = memId
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(7)*24)).Fp2 = (memId + 2)
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(7)*24)).Fp1 = memId
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(10)*24)).Fp2 = memId
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*32)).Fp2 = memId
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*32)).Fp3 = (memId + 2)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(2)*32)).Fp3 = memId
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*32)).Fp1 = (memId - 1)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*32)).Fp3 = memId
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*32)).Fp5 = U16(0x10)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(4)*32)).Fp2 = (memId + 1)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(5)*32)).Fp3 = memId
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(6)*32)).Fp1 = memId
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(7)*32)).Fp2 = (memId + 2)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(7)*32)).Fp1 = memId
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(10)*32)).Fp2 = memId
if (*Parse)(unsafe.Pointer(pParse)).FnTab == 0 {
(*Parse)(unsafe.Pointer(pParse)).FnTab = 1
}
}
}
-var iLn1 int32 = 0 /* sqlite3.c:120657:22 */
+var iLn1 int32 = 0 /* sqlite3.c:120957:22 */
var autoInc = [12]VdbeOpList{
/* 0 */ {Fopcode: U8(72), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)},
/* 1 */ {Fopcode: U8(37), Fp1: int8(0), Fp2: int8(10), Fp3: int8(0)},
@@ -96262,7 +99890,7 @@ var autoInc = [12]VdbeOpList{
/* 9 */ {Fopcode: U8(5), Fp1: int8(0), Fp2: int8(2), Fp3: int8(0)},
/* 10 */ {Fopcode: U8(69), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)},
/* 11 */ {Fopcode: U8(116), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)},
-} /* sqlite3.c:120658:29 */
+} /* sqlite3.c:120958:29 */
// Update the maximum rowid for an autoincrement calculation.
//
@@ -96270,7 +99898,7 @@ var autoInc = [12]VdbeOpList{
// new rowid that is about to be inserted. If that new rowid is
// larger than the maximum rowid in the memId memory cell, then the
// memory cell is updated.
-func autoIncStep(tls *crt.TLS, pParse uintptr, memId int32, regRowid int32) { /* sqlite3.c:120704:13: */
+func autoIncStep(tls *libc.TLS, pParse uintptr, memId int32, regRowid int32) { /* sqlite3.c:121004:13: */
if memId > 0 {
Xsqlite3VdbeAddOp2(tls, (*Parse)(unsafe.Pointer(pParse)).FpVdbe, 151, memId, regRowid)
}
@@ -96281,7 +99909,7 @@ func autoIncStep(tls *crt.TLS, pParse uintptr, memId int32, regRowid int32) { /*
// Every statement that might do an INSERT into an autoincrement
// table (either directly or through triggers) needs to call this
// routine just before the "exit" code.
-func autoIncrementEnd(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:120717:29: */
+func autoIncrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:121017:29: */
var p uintptr
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
@@ -96301,26 +99929,26 @@ func autoIncrementEnd(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:120717:29: */
if aOp == uintptr(0) {
break
}
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*24)).Fp1 = (memId + 1)
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(1)*24)).Fp2 = (memId + 1)
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(2)*24)).Fp1 = (memId - 1)
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(2)*24)).Fp3 = iRec
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*24)).Fp2 = iRec
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*24)).Fp3 = (memId + 1)
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*24)).Fp5 = U16(0x08)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*32)).Fp1 = (memId + 1)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(1)*32)).Fp2 = (memId + 1)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(2)*32)).Fp1 = (memId - 1)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(2)*32)).Fp3 = iRec
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*32)).Fp2 = iRec
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*32)).Fp3 = (memId + 1)
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(3)*32)).Fp5 = U16(0x08)
Xsqlite3ReleaseTempReg(tls, pParse, iRec)
}
}
-var iLn2 int32 = 0 /* sqlite3.c:120724:22 */
+var iLn2 int32 = 0 /* sqlite3.c:121024:22 */
var autoIncEnd = [5]VdbeOpList{
/* 0 */ {Fopcode: U8(51), Fp1: int8(0), Fp2: int8(2), Fp3: int8(0)},
/* 1 */ {Fopcode: U8(120), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)},
/* 2 */ {Fopcode: U8(91), Fp1: int8(0), Fp2: int8(2), Fp3: int8(0)},
/* 3 */ {Fopcode: U8(121), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)},
/* 4 */ {Fopcode: U8(116), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)},
-} /* sqlite3.c:120725:29 */
-func Xsqlite3AutoincrementEnd(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:120754:21: */
+} /* sqlite3.c:121025:29 */
+func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:121054:21: */
if (*Parse)(unsafe.Pointer(pParse)).FpAinc != 0 {
autoIncrementEnd(tls, pParse)
}
@@ -96421,9 +100049,9 @@ func Xsqlite3AutoincrementEnd(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:12075
// transfer values form intermediate table into <table>
// end loop
// D: cleanup
-func Xsqlite3Insert(tls *crt.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { /* sqlite3.c:120873:21: */
- bp := tls.Alloc(196)
- defer tls.Free(196)
+func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { /* sqlite3.c:121173:21: */
+ bp := tls.Alloc(204)
+ defer tls.Free(204)
var db uintptr // The main database structure
var pTab uintptr // The table to insert into. aka TABLE
@@ -96433,16 +100061,16 @@ func Xsqlite3Insert(tls *crt.TLS, pParse uintptr, pTabList uintptr, pSelect uint
var pIdx uintptr // For looping over indices of the table
var nColumn int32 // Number of columns in the data
var nHidden int32 // Number of hidden columns if TABLE is virtual
- // var iDataCur int32 at bp+184, 4
+ // var iDataCur int32 at bp+192, 4
// VDBE cursor that is the main data repository
- // var iIdxCur int32 at bp+188, 4
+ // var iIdxCur int32 at bp+196, 4
// First index cursor
var ipkColumn int32 // Column that is the INTEGER PRIMARY KEY
var endOfLoop int32 // Label for the end of the insertion loop
var srcTab int32 // Data comes from this temporary cursor if >=0
var addrInsTop int32 // Jump to label "D"
var addrCont int32 // Top of insert loop. Label "C" in templates 3 and 4
- // var dest SelectDest at bp+96, 32
+ // var dest SelectDest at bp+96, 40
// Destination for SELECT on rhs of INSERT
var iDb int32 // Index of database holding TABLE
var useTempTable U8 // Store SELECT results in intermediate table
@@ -96484,7 +100112,7 @@ func Xsqlite3Insert(tls *crt.TLS, pParse uintptr, pTabList uintptr, pSelect uint
var rc int32
// This is the case if the data for the INSERT is coming from a
// single-row VALUES clause
- // var sNC NameContext at bp+128, 56
+ // var sNC NameContext at bp+136, 56
var nIdx int32
var k int32
@@ -96494,12 +100122,12 @@ func Xsqlite3Insert(tls *crt.TLS, pParse uintptr, pTabList uintptr, pSelect uint
var pIpk uintptr
var addr11 int32
var pVTab uintptr
- // var isReplace int32 at bp+192, 4
+ // var isReplace int32 at bp+200, 4
// Set to true if constraints may cause a replace
var bUseSeek int32
nHidden = 0
- *(*int32)(unsafe.Pointer(bp + 184 /* iDataCur */)) = 0
- *(*int32)(unsafe.Pointer(bp + 188 /* iIdxCur */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 196 /* iIdxCur */)) = 0
ipkColumn = -1
srcTab = 0
addrInsTop = 0
@@ -96552,12 +100180,12 @@ __3:
goto insert_cleanup
__4:
;
- withoutRowid = crt.BoolUint8(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)))
+ withoutRowid = libc.BoolUint8(!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)))
// Figure out if we have any triggers and if the table being
// inserted into is a view
pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, 125, uintptr(0), bp+88 /* &tmask */)
- isView = (crt.Bool32((*Table)(unsafe.Pointer(pTab)).FpSelect != uintptr(0)))
+ isView = (libc.Bool32((*Table)(unsafe.Pointer(pTab)).FpSelect != uintptr(0)))
// If pTab is really a view, make sure it has been initialized.
// ViewGetColumnNames() is a no-op if pTab is not a view.
@@ -96590,7 +100218,7 @@ __7:
Xsqlite3VdbeCountChanges(tls, v)
__8:
;
- Xsqlite3BeginWriteOperation(tls, pParse, (crt.Bool32((pSelect != 0) || (pTrigger != 0))), iDb)
+ Xsqlite3BeginWriteOperation(tls, pParse, (libc.Bool32((pSelect != 0) || (pTrigger != 0))), iDb)
// If the statement is of the form
//
@@ -96614,7 +100242,7 @@ __9:
// Allocate a block registers to hold the rowid and the values
// for all columns of the new row.
- regRowid = crt.AssignInt32(&regIns, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1))
+ regRowid = libc.AssignInt32(&regIns, ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1))
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)
if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
goto __10
@@ -96643,7 +100271,7 @@ __10:
// order. This enables an optimization that avoids shuffling the
// columns into storage order. False negatives are harmless,
// but false positives will cause database corruption.
- bIdListInOrder = (U8(crt.Bool32(((*Table)(unsafe.Pointer(pTab)).FtabFlags & (U32(0x0400 | 0x0040))) == U32(0))))
+ bIdListInOrder = (U8(libc.Bool32(((*Table)(unsafe.Pointer(pTab)).FtabFlags & (U32(0x0400 | 0x0040))) == U32(0))))
if !(pColumn != 0) {
goto __11
}
@@ -96690,8 +100318,8 @@ __23:
goto __24
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+13697, /* "cannot INSERT in..." */
- crt.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*32)).FzName))
+ ts+16500, /* "cannot INSERT in..." */
+ libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*32)).FzName))
goto insert_cleanup
__24:
;
@@ -96715,8 +100343,8 @@ __20:
bIdListInOrder = U8(0)
goto __27
__26:
- Xsqlite3ErrorMsg(tls, pParse, ts+13738, /* "table %S has no ..." */
- crt.VaList(bp+8, pTabList, 0, (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(i)*16)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+16541, /* "table %S has no ..." */
+ libc.VaList(bp+8, pTabList, 0, (*IdList_item)(unsafe.Pointer((*IdList)(unsafe.Pointer(pColumn)).Fa+uintptr(i)*16)).FzName))
(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
goto insert_cleanup
__27:
@@ -96741,7 +100369,7 @@ __11:
goto __28
} // Result code
- regYield = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regYield = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
addrTop = (Xsqlite3VdbeCurrentAddr(tls, v) + 1)
Xsqlite3VdbeAddOp3(tls, v, 13, regYield, 0, addrTop)
Xsqlite3SelectDestInit(tls, bp+96 /* &dest */, 13, regYield)
@@ -96784,7 +100412,7 @@ __31:
goto __32
} // Label "L"
- srcTab = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ srcTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
regRec = Xsqlite3GetTempReg(tls, pParse)
regTempRowid = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3VdbeAddOp2(tls, v, 100, srcTab, nColumn)
@@ -96800,15 +100428,15 @@ __32:
;
goto __29
__28:
- crt.Xmemset(tls, bp+128 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
- (*NameContext)(unsafe.Pointer(bp + 128 /* &sNC */)).FpParse = pParse
+ libc.Xmemset(tls, bp+136 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ (*NameContext)(unsafe.Pointer(bp + 136 /* &sNC */)).FpParse = pParse
srcTab = -1
if !(pList != 0) {
goto __33
}
nColumn = (*ExprList)(unsafe.Pointer(pList)).FnExpr
- if !(Xsqlite3ResolveExprListNames(tls, bp+128 /* &sNC */, pList) != 0) {
+ if !(Xsqlite3ResolveExprListNames(tls, bp+136 /* &sNC */, pList) != 0) {
goto __35
}
goto insert_cleanup
@@ -96881,15 +100509,15 @@ __44:
goto __46
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+13770, /* "table %S has %d ..." */
- crt.VaList(bp+32, pTabList, 0, (int32((*Table)(unsafe.Pointer(pTab)).FnCol)-nHidden), nColumn))
+ ts+16573, /* "table %S has %d ..." */
+ libc.VaList(bp+32, pTabList, 0, (int32((*Table)(unsafe.Pointer(pTab)).FnCol)-nHidden), nColumn))
goto insert_cleanup
__46:
;
if !((pColumn != uintptr(0)) && (nColumn != (*IdList)(unsafe.Pointer(pColumn)).FnId)) {
goto __47
}
- Xsqlite3ErrorMsg(tls, pParse, ts+13822 /* "%d values for %d..." */, crt.VaList(bp+64, nColumn, (*IdList)(unsafe.Pointer(pColumn)).FnId))
+ Xsqlite3ErrorMsg(tls, pParse, ts+16625 /* "%d values for %d..." */, libc.VaList(bp+64, nColumn, (*IdList)(unsafe.Pointer(pColumn)).FnId))
goto insert_cleanup
__47:
;
@@ -96900,7 +100528,7 @@ __47:
!(int32((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab) != 0)) {
goto __48
}
- regRowCount = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regRowCount = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 69, 0, regRowCount)
__48:
;
@@ -96910,7 +100538,7 @@ __48:
goto __49
}
nIdx = Xsqlite3OpenTableAndIndices(tls, pParse, pTab, 97, uint8(0), -1, uintptr(0),
- bp+184 /* &iDataCur */, bp+188 /* &iIdxCur */)
+ bp+192 /* &iDataCur */, bp+196 /* &iIdxCur */)
aRegIdx = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(unsafe.Sizeof(int32(0))) * (uint64(nIdx + 2)))))
if !(aRegIdx == uintptr(0)) {
goto __50
@@ -96925,7 +100553,7 @@ __51:
goto __53
}
- *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn))
goto __52
__52:
@@ -96935,7 +100563,7 @@ __52:
goto __53
__53:
;
- *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
__49:
;
if !(pUpsert != 0) {
@@ -96944,15 +100572,15 @@ __49:
if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
goto __55
}
- Xsqlite3ErrorMsg(tls, pParse, ts+13847, /* "UPSERT not imple..." */
- crt.VaList(bp+80, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+16650, /* "UPSERT not imple..." */
+ libc.VaList(bp+80, (*Table)(unsafe.Pointer(pTab)).FzName))
goto insert_cleanup
__55:
;
if !((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) {
goto __56
}
- Xsqlite3ErrorMsg(tls, pParse, ts+13893 /* "cannot UPSERT a ..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+16696 /* "cannot UPSERT a ..." */, 0)
goto insert_cleanup
__56:
;
@@ -96962,11 +100590,11 @@ __56:
goto insert_cleanup
__57:
;
- (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(0)*112)).FiCursor = *(*int32)(unsafe.Pointer(bp + 184 /* iDataCur */))
+ (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(0)*112)).FiCursor = *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */))
(*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc = pTabList
(*Upsert)(unsafe.Pointer(pUpsert)).FregData = regData
- (*Upsert)(unsafe.Pointer(pUpsert)).FiDataCur = *(*int32)(unsafe.Pointer(bp + 184 /* iDataCur */))
- (*Upsert)(unsafe.Pointer(pUpsert)).FiIdxCur = *(*int32)(unsafe.Pointer(bp + 188 /* iIdxCur */))
+ (*Upsert)(unsafe.Pointer(pUpsert)).FiDataCur = *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */))
+ (*Upsert)(unsafe.Pointer(pUpsert)).FiIdxCur = *(*int32)(unsafe.Pointer(bp + 196 /* iIdxCur */))
if !((*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget != 0) {
goto __58
}
@@ -97003,7 +100631,7 @@ __59:
// goto C
// D: ...
- addrInsTop = crt.AssignInt32(&addrCont, Xsqlite3VdbeAddOp1(tls, v, 14, (*SelectDest)(unsafe.Pointer(bp+96 /* &dest */)).FiSDParm))
+ addrInsTop = libc.AssignInt32(&addrCont, Xsqlite3VdbeAddOp1(tls, v, 14, (*SelectDest)(unsafe.Pointer(bp+96 /* &dest */)).FiSDParm))
if !(ipkColumn >= 0) {
goto __62
@@ -97044,7 +100672,7 @@ __63:
goto __64
__66:
;
- if !(((crt.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags))) & U32(0x0062)) != U32(0)) {
+ if !(((libc.AssignUint32(&colFlags, U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags))) & U32(0x0062)) != U32(0)) {
goto __67
}
nHidden++
@@ -97264,7 +100892,7 @@ __100:
if !((int32((*Expr)(unsafe.Pointer(pIpk)).Fop) == 119) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) {
goto __102
}
- Xsqlite3VdbeAddOp3(tls, v, 120, *(*int32)(unsafe.Pointer(bp + 184 /* iDataCur */)), regRowid, regAutoinc)
+ Xsqlite3VdbeAddOp3(tls, v, 120, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), regRowid, regAutoinc)
appendFlag = U8(1)
goto __103
__102:
@@ -97284,7 +100912,7 @@ __99:
goto __105
}
addr11 = Xsqlite3VdbeAddOp1(tls, v, 51, regRowid)
- Xsqlite3VdbeAddOp3(tls, v, 120, *(*int32)(unsafe.Pointer(bp + 184 /* iDataCur */)), regRowid, regAutoinc)
+ Xsqlite3VdbeAddOp3(tls, v, 120, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), regRowid, regAutoinc)
Xsqlite3VdbeJumpHere(tls, v, addr11)
goto __106
__105:
@@ -97303,7 +100931,7 @@ __96:
Xsqlite3VdbeAddOp2(tls, v, 72, 0, regRowid)
goto __108
__107:
- Xsqlite3VdbeAddOp3(tls, v, 120, *(*int32)(unsafe.Pointer(bp + 184 /* iDataCur */)), regRowid, regAutoinc)
+ Xsqlite3VdbeAddOp3(tls, v, 120, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), regRowid, regAutoinc)
appendFlag = U8(1)
__108:
;
@@ -97340,8 +100968,8 @@ __109:
goto __111
__110:
// True to use OPFLAG_SEEKRESULT
- Xsqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, *(*int32)(unsafe.Pointer(bp + 184 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 188 /* iIdxCur */)),
- regIns, 0, (uint8(crt.Bool32(ipkColumn >= 0))), uint8(onError), endOfLoop, bp+192 /* &isReplace */, uintptr(0), pUpsert)
+ Xsqlite3GenerateConstraintChecks(tls, pParse, pTab, aRegIdx, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 196 /* iIdxCur */)),
+ regIns, 0, (uint8(libc.Bool32(ipkColumn >= 0))), uint8(onError), endOfLoop, bp+200 /* &isReplace */, uintptr(0), pUpsert)
Xsqlite3FkCheck(tls, pParse, pTab, 0, regIns, uintptr(0), 0)
// Set the OPFLAG_USESEEKRESULT flag if either (a) there are no REPLACE
@@ -97352,8 +100980,8 @@ __110:
// cursor that is disturbed. And these instructions both clear the
// VdbeCursor.seekResult variable, disabling the OPFLAG_USESEEKRESULT
// functionality.
- bUseSeek = (crt.Bool32((*(*int32)(unsafe.Pointer(bp + 192 /* isReplace */)) == 0) || !(Xsqlite3VdbeHasSubProgram(tls, v) != 0)))
- Xsqlite3CompleteInsertion(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp + 184 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 188 /* iIdxCur */)),
+ bUseSeek = (libc.Bool32((*(*int32)(unsafe.Pointer(bp + 200 /* isReplace */)) == 0) || !(Xsqlite3VdbeHasSubProgram(tls, v) != 0)))
+ Xsqlite3CompleteInsertion(tls, pParse, pTab, *(*int32)(unsafe.Pointer(bp + 192 /* iDataCur */)), *(*int32)(unsafe.Pointer(bp + 196 /* iIdxCur */)),
regIns, aRegIdx, 0, int32(appendFlag), bUseSeek)
__111:
;
@@ -97417,7 +101045,7 @@ __117:
}
Xsqlite3VdbeAddOp2(tls, v, 80, regRowCount, 1)
Xsqlite3VdbeSetNumCols(tls, v, 1)
- Xsqlite3VdbeSetColName(tls, v, 0, 0, ts+13914 /* "rows inserted" */, uintptr(0))
+ Xsqlite3VdbeSetColName(tls, v, 0, 0, ts+16717 /* "rows inserted" */, uintptr(0))
__118:
;
@@ -97441,7 +101069,7 @@ insert_cleanup:
// Set bit 0x01 of pWalker->eCode if pWalker->eCode to 0 and if this
// expression node references any of the
// columns that are being modifed by an UPDATE statement.
-func checkConstraintExprNode(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:121603:12: */
+func checkConstraintExprNode(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:121903:12: */
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 164 {
if int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 {
@@ -97468,25 +101096,25 @@ func checkConstraintExprNode(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32
// The operation of this routine is the same - return true if an only if
// the expression uses one or more of columns identified by the second and
// third arguments.
-func Xsqlite3ExprReferencesUpdatedColumn(tls *crt.TLS, pExpr uintptr, aiChng uintptr, chngRowid int32) int32 { /* sqlite3.c:121632:20: */
+func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng uintptr, chngRowid int32) int32 { /* sqlite3.c:121932:20: */
bp := tls.Alloc(48)
defer tls.Free(48)
// var w Walker at bp, 48
- crt.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp /* &w */)).FeCode = U16(0)
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{checkConstraintExprNode}))
*(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = aiChng
Xsqlite3WalkExpr(tls, bp /* &w */, pExpr)
if !(chngRowid != 0) {
- *(*U16)(unsafe.Pointer(bp /* &w */ + 36 /* &.eCode */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x02))))
+ *(*U16)(unsafe.Pointer(bp /* &w */ + 36 /* &.eCode */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x02))))
}
- return (crt.Bool32(int32((*Walker)(unsafe.Pointer(bp /* &w */)).FeCode) != 0))
+ return (libc.Bool32(int32((*Walker)(unsafe.Pointer(bp /* &w */)).FeCode) != 0))
}
// Generate code to do constraint checks prior to an INSERT or an UPDATE
@@ -97578,9 +101206,9 @@ func Xsqlite3ExprReferencesUpdatedColumn(tls *crt.TLS, pExpr uintptr, aiChng uin
// Or if overrideError==OE_Default, then the pParse->onError parameter
// is used. Or if pParse->onError==OE_Default then the onError value
// for the constraint is used.
-func Xsqlite3GenerateConstraintChecks(tls *crt.TLS, pParse uintptr, pTab uintptr, aRegIdx uintptr, iDataCur int32, iIdxCur int32, regNewData int32, regOldData int32, pkChng U8, overrideError U8, ignoreDest int32, pbMayReplace uintptr, aiChng uintptr, pUpsert uintptr) { /* sqlite3.c:121745:21: */
- bp := tls.Alloc(40)
- defer tls.Free(40)
+func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintptr, aRegIdx uintptr, iDataCur int32, iIdxCur int32, regNewData int32, regOldData int32, pkChng U8, overrideError U8, ignoreDest int32, pbMayReplace uintptr, aiChng uintptr, pUpsert uintptr) { /* sqlite3.c:122045:21: */
+ bp := tls.Alloc(104)
+ defer tls.Free(104)
var v uintptr // VDBE under constrution
var pIdx uintptr // Pointer to one of the indices
@@ -97607,7 +101235,7 @@ func Xsqlite3GenerateConstraintChecks(tls *crt.TLS, pParse uintptr, pTab uintptr
var pTrigger uintptr // List of DELETE triggers on the table pTab
var nReplaceTrig int32 = 0 // Number of replace triggers coded
- isUpdate = (U8(crt.Bool32(regOldData != 0)))
+ isUpdate = (U8(libc.Bool32(regOldData != 0)))
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
v = Xsqlite3GetVdbe(tls, pParse)
@@ -97685,12 +101313,12 @@ func Xsqlite3GenerateConstraintChecks(tls *crt.TLS, pParse uintptr, pTab uintptr
case 2:
Xsqlite3MayAbort(tls, pParse)
fallthrough
- // Fall through
+ /* no break */
case 1:
fallthrough
case 3:
{
- var zMsg uintptr = Xsqlite3MPrintf(tls, db, ts+10498 /* "%s.%s" */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
+ var zMsg uintptr = Xsqlite3MPrintf(tls, db, ts+9978 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
(*Column)(unsafe.Pointer(pCol)).FzName))
Xsqlite3VdbeAddOp3(tls, v, 67, (19 | (int32(5) << 8)),
onError, iReg)
@@ -97812,10 +101440,11 @@ func Xsqlite3GenerateConstraintChecks(tls *crt.TLS, pParse uintptr, pTab uintptr
overrideError = U8(4)
pUpsert = uintptr(0)
- } else if (crt.AssignUintptr(&pUpIdx, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx)) != uintptr(0) {
+ } else if (libc.AssignUintptr(&pUpIdx, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertIdx)) != uintptr(0) {
// If the constraint-target uniqueness check must be run first.
// Jump to that uniqueness check now
upsertJump = Xsqlite3VdbeAddOp0(tls, v, 11)
+ Xsqlite3VdbeComment(tls, v, ts+16731 /* "UPSERT constrain..." */, 0)
}
}
@@ -97846,7 +101475,7 @@ func Xsqlite3GenerateConstraintChecks(tls *crt.TLS, pParse uintptr, pTab uintptr
} else {
if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00002000)) != 0 {
pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, 126, uintptr(0), uintptr(0))
- regTrigCnt = (crt.Bool32((pTrigger != uintptr(0)) || (Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0)))
+ regTrigCnt = (libc.Bool32((pTrigger != uintptr(0)) || (Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0) != 0)))
} else {
pTrigger = uintptr(0)
regTrigCnt = Xsqlite3FkRequired(tls, pParse, pTab, uintptr(0), 0)
@@ -97854,9 +101483,9 @@ func Xsqlite3GenerateConstraintChecks(tls *crt.TLS, pParse uintptr, pTab uintptr
if regTrigCnt != 0 {
// Replace triggers might exist. Allocate the counter and
// initialize it to zero.
- regTrigCnt = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regTrigCnt = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 69, 0, regTrigCnt)
-
+ Xsqlite3VdbeComment(tls, v, ts+16760 /* "trigger count" */, 0)
lblRecheckOk = Xsqlite3VdbeMakeLabel(tls, pParse)
addrRecheck = lblRecheckOk
}
@@ -97892,6 +101521,7 @@ func Xsqlite3GenerateConstraintChecks(tls *crt.TLS, pParse uintptr, pTab uintptr
(onError != int32(overrideError))) && // Rules for other contraints are different
((*Table)(unsafe.Pointer(pTab)).FpIndex != 0) {
ipkTop = (Xsqlite3VdbeAddOp0(tls, v, 11) + 1)
+ Xsqlite3VdbeComment(tls, v, ts+16774 /* "defer IPK REPLAC..." */, 0)
}
if isUpdate != 0 {
@@ -97904,6 +101534,7 @@ func Xsqlite3GenerateConstraintChecks(tls *crt.TLS, pParse uintptr, pTab uintptr
// Check to see if the new rowid already exists in the table. Skip
// the following conflict logic if it does not.
+ Xsqlite3VdbeNoopComment(tls, v, ts+16803 /* "uniqueness check..." */, 0)
Xsqlite3VdbeAddOp3(tls, v, 32, iDataCur, addrRowidOk, regNewData)
@@ -97911,7 +101542,7 @@ func Xsqlite3GenerateConstraintChecks(tls *crt.TLS, pParse uintptr, pTab uintptr
default:
{
onError = 2
- // Fall thru into the next case
+ /* no break */
}
fallthrough
case 1:
@@ -97955,6 +101586,13 @@ func Xsqlite3GenerateConstraintChecks(tls *crt.TLS, pParse uintptr, pTab uintptr
Xsqlite3VdbeAddOp2(tls, v, 82, regTrigCnt, 1) // incr trigger cnt
nReplaceTrig++
} else {
+
+ // This OP_Delete opcode fires the pre-update-hook only. It does
+ // not modify the b-tree. It is more efficient to let the coming
+ // OP_Insert replace the existing entry than it is to delete the
+ // existing entry and then insert a new one.
+ Xsqlite3VdbeAddOp2(tls, v, 122, iDataCur, 0x40)
+ Xsqlite3VdbeAppendP4(tls, v, pTab, -6)
if (*Table)(unsafe.Pointer(pTab)).FpIndex != 0 {
Xsqlite3MultiWrite(tls, pParse)
Xsqlite3GenerateRowIndexDelete(tls, pParse, pTab, iDataCur, iIdxCur, uintptr(0), -1)
@@ -97967,7 +101605,7 @@ func Xsqlite3GenerateConstraintChecks(tls *crt.TLS, pParse uintptr, pTab uintptr
case 6:
{
Xsqlite3UpsertDoUpdate(tls, pParse, pUpsert, pTab, uintptr(0), iDataCur)
- // Fall through
+ /* no break */
}
fallthrough
case 4:
@@ -98009,7 +101647,7 @@ __1:
if pUpIdx == pIdx {
addrUniqueOk = (upsertJump + 1)
upsertBypass = Xsqlite3VdbeGoto(tls, v, 0)
-
+ Xsqlite3VdbeComment(tls, v, ts+16830 /* "Skip upsert subr..." */, 0)
Xsqlite3VdbeJumpHere(tls, v, upsertJump)
} else {
addrUniqueOk = Xsqlite3VdbeMakeLabel(tls, pParse)
@@ -98018,7 +101656,7 @@ __1:
Xsqlite3TableAffinity(tls, v, pTab, (regNewData + 1))
bAffinityDone = U8(1)
}
-
+ Xsqlite3VdbeNoopComment(tls, v, ts+16853 /* "prep index %s" */, libc.VaList(bp+16, (*Index)(unsafe.Pointer(pIdx)).FzName))
iThisCur = (iIdxCur + ix)
// Skip partial indices for which the WHERE clause is not true
@@ -98040,16 +101678,20 @@ __1:
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = -(regNewData + 1)
Xsqlite3ExprCodeCopy(tls, pParse, (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8 /* &.a */)+uintptr(i)*32)).FpExpr, (regIdx + i))
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
+ Xsqlite3VdbeComment(tls, v, ts+16867 /* "%s column %d" */, libc.VaList(bp+24, (*Index)(unsafe.Pointer(pIdx)).FzName, i))
} else if (iField == (-1)) || (iField == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
x = regNewData
Xsqlite3VdbeAddOp2(tls, v, 79, x, (regIdx + i))
+ Xsqlite3VdbeComment(tls, v, ts+10045 /* "rowid" */, 0)
} else {
x = ((int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(iField))) + regNewData) + 1)
Xsqlite3VdbeAddOp2(tls, v, 78, x, (regIdx + i))
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp+40, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iField)*32)).FzName))
}
}
Xsqlite3VdbeAddOp3(tls, v, 91, regIdx, int32((*Index)(unsafe.Pointer(pIdx)).FnColumn), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(ix)*4)))
+ Xsqlite3VdbeComment(tls, v, ts+16880 /* "for %s" */, libc.VaList(bp+48, (*Index)(unsafe.Pointer(pIdx)).FzName))
// In an UPDATE operation, if this index is the PRIMARY KEY index
// of a WITHOUT ROWID table and there has been no change the
@@ -98081,24 +101723,16 @@ __1:
}
}
- /* Collision detection may be omitted if all of the following are true:
- ** (1) The conflict resolution algorithm is REPLACE
- ** (2) The table is a WITHOUT ROWID table
- ** (3) There are no secondary indexes on the table
- ** (4) No delete triggers need to be fired if there is a conflict
- ** (5) No FK constraint counters need to be updated if a conflict occurs.
- **
- ** This is not possible for ENABLE_PREUPDATE_HOOK builds, as the row
- ** must be explicitly deleted in order to ensure any pre-update hook
- ** is invoked. */
- if (((((ix == 0) && ((*Index)(unsafe.Pointer(pIdx)).FpNext == uintptr(0))) && // Condition 3
- (pPk == pIdx)) && // Condition 2
- (onError == 5)) && // Condition 1
- ((uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00002000))) || (uintptr(0) == Xsqlite3TriggersExist(tls, pParse, pTab, 126, uintptr(0), uintptr(0))))) &&
- ((uint64(0) == ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00004000))) || ((uintptr(0) == (*Table)(unsafe.Pointer(pTab)).FpFKey) && (uintptr(0) == Xsqlite3FkReferences(tls, pTab)))) {
- Xsqlite3VdbeResolveLabel(tls, v, addrUniqueOk)
- goto __2
- }
+ // Collision detection may be omitted if all of the following are true:
+ // (1) The conflict resolution algorithm is REPLACE
+ // (2) The table is a WITHOUT ROWID table
+ // (3) There are no secondary indexes on the table
+ // (4) No delete triggers need to be fired if there is a conflict
+ // (5) No FK constraint counters need to be updated if a conflict occurs.
+ //
+ // This is not possible for ENABLE_PREUPDATE_HOOK builds, as the row
+ // must be explicitly deleted in order to ensure any pre-update hook
+ // is invoked.
// Check to see if the new index entry will be unique
@@ -98129,6 +101763,7 @@ __1:
x = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))))
Xsqlite3VdbeAddOp3(tls, v, 89, iThisCur, x, (regR + i))
+ Xsqlite3VdbeComment(tls, v, ts+9978 /* "%s.%s" */, libc.VaList(bp+56, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))*32)).FzName))
}
}
if isUpdate != 0 {
@@ -98182,7 +101817,7 @@ __1:
case 6:
{
Xsqlite3UpsertDoUpdate(tls, pParse, pUpsert, pTab, pIdx, (iIdxCur + ix))
- // Fall through
+ /* no break */
}
fallthrough
case 4:
@@ -98220,6 +101855,7 @@ __1:
Xsqlite3VdbeAddOp2(tls, v, 82, regTrigCnt, 1) // incr trigger cnt
addrBypass = Xsqlite3VdbeAddOp0(tls, v, 11) // Bypass recheck
+ Xsqlite3VdbeComment(tls, v, ts+16887 /* "bypass recheck" */, 0)
// Here we insert code that will be invoked after all constraint
// checks have run, if and only if one or more replace triggers
@@ -98235,27 +101871,27 @@ __1:
// the constraint-ok jump destination to be the address of
// the next retest block
for nConflictCk > 0 {
- // var x VdbeOp at bp+16, 24
+ // var x VdbeOp at bp+72, 32
// Conflict check opcode to copy
// The sqlite3VdbeAddOp4() call might reallocate the opcode array.
// Hence, make a complete copy of the opcode, rather than using
// a pointer to the opcode.
- *(*VdbeOp)(unsafe.Pointer(bp + 16 /* x */)) = *(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, addrConflictCk)))
- if int32((*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fopcode) != 134 {
+ *(*VdbeOp)(unsafe.Pointer(bp + 72 /* x */)) = *(*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, addrConflictCk)))
+ if int32((*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fopcode) != 134 {
var p2 int32 // New P2 value for copied conflict check opcode
var zP4 uintptr
- if (int32(Xsqlite3OpcodeProperty[(*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fopcode]) & 0x01) != 0 {
+ if (int32(Xsqlite3OpcodeProperty[(*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fopcode]) & 0x01) != 0 {
p2 = lblRecheckOk
} else {
- p2 = (*VdbeOp)(unsafe.Pointer(bp + 16 /* &x */)).Fp2
+ p2 = (*VdbeOp)(unsafe.Pointer(bp + 72 /* &x */)).Fp2
}
- if int32((*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fp4type) == (-3) {
- zP4 = uintptr(int64(*(*int32)(unsafe.Pointer(bp + 16 /* &x */ + 16 /* &.p4 */))))
+ if int32((*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fp4type) == (-3) {
+ zP4 = uintptr(int64(*(*int32)(unsafe.Pointer(bp + 72 /* &x */ + 16 /* &.p4 */))))
} else {
- zP4 = *(*uintptr)(unsafe.Pointer(bp + 16 /* &x */ + 16 /* &.p4 */))
+ zP4 = *(*uintptr)(unsafe.Pointer(bp + 72 /* &x */ + 16 /* &.p4 */))
}
- Xsqlite3VdbeAddOp4(tls, v, int32((*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fopcode), (*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fp1, p2, (*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fp3, zP4, int32((*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fp4type))
- Xsqlite3VdbeChangeP5(tls, v, (*VdbeOp)(unsafe.Pointer(bp+16 /* &x */)).Fp5)
+ Xsqlite3VdbeAddOp4(tls, v, int32((*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fopcode), (*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fp1, p2, (*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fp3, zP4, int32((*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fp4type))
+ Xsqlite3VdbeChangeP5(tls, v, (*VdbeOp)(unsafe.Pointer(bp+72 /* &x */)).Fp5)
}
nConflictCk--
addrConflictCk++
@@ -98291,7 +101927,7 @@ __3:
// If the IPK constraint is a REPLACE, run it last
if ipkTop != 0 {
Xsqlite3VdbeGoto(tls, v, ipkTop)
-
+ Xsqlite3VdbeComment(tls, v, ts+16902 /* "Do IPK REPLACE" */, 0)
Xsqlite3VdbeJumpHere(tls, v, ipkBottom)
}
@@ -98335,7 +101971,7 @@ __3:
//
// The arguments to this routine should be the same as the first six
// arguments to sqlite3GenerateConstraintChecks.
-func Xsqlite3CompleteInsertion(tls *crt.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, regNewData int32, aRegIdx uintptr, update_flags int32, appendBias int32, useSeekResult int32) { /* sqlite3.c:122539:21: */
+func Xsqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, regNewData int32, aRegIdx uintptr, update_flags int32, appendBias int32, useSeekResult int32) { /* sqlite3.c:122839:21: */
var v uintptr // Prepared statements under construction
var pIdx uintptr // An index being inserted or updated
var pik_flags U8 // flag values passed to the btree insert
@@ -98369,6 +102005,14 @@ __1:
pik_flags = U8(int32(pik_flags) | (0x01))
pik_flags = U8(int32(pik_flags) | (update_flags & 0x02))
+ if update_flags == 0 {
+ var r int32 = Xsqlite3GetTempReg(tls, pParse)
+ Xsqlite3VdbeAddOp2(tls, v, 69, 0, r)
+ Xsqlite3VdbeAddOp4(tls, v, 121,
+ (iIdxCur + i), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)), r, pTab, -6)
+ Xsqlite3VdbeChangeP5(tls, v, uint16(0x40))
+ Xsqlite3ReleaseTempReg(tls, pParse, r)
+ }
}
Xsqlite3VdbeAddOp4Int(tls, v, 130, (iIdxCur + i), *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)),
(*(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) + 1),
@@ -98434,7 +102078,10 @@ __3:
//
// If pTab is a virtual table, then this routine is a no-op and the
// *piDataCur and *piIdxCur values are left uninitialized.
-func Xsqlite3OpenTableAndIndices(tls *crt.TLS, pParse uintptr, pTab uintptr, op int32, p5 U8, iBase int32, aToOpen uintptr, piDataCur uintptr, piIdxCur uintptr) int32 { /* sqlite3.c:122636:20: */
+func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, p5 U8, iBase int32, aToOpen uintptr, piDataCur uintptr, piIdxCur uintptr) int32 { /* sqlite3.c:122936:20: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
var i int32
var iDb int32
var iDataCur int32
@@ -98453,14 +102100,14 @@ func Xsqlite3OpenTableAndIndices(tls *crt.TLS, pParse uintptr, pTab uintptr, op
if iBase < 0 {
iBase = (*Parse)(unsafe.Pointer(pParse)).FnTab
}
- iDataCur = crt.PostIncInt32(&iBase, 1)
+ iDataCur = libc.PostIncInt32(&iBase, 1)
if piDataCur != 0 {
*(*int32)(unsafe.Pointer(piDataCur)) = iDataCur
}
if (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) && ((aToOpen == uintptr(0)) || (*(*U8)(unsafe.Pointer(aToOpen + uintptr(0))) != 0)) {
Xsqlite3OpenTable(tls, pParse, iDataCur, iDb, pTab, op)
} else {
- Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, (uint8(crt.Bool32(op == 97))), (*Table)(unsafe.Pointer(pTab)).FzName)
+ Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, (uint8(libc.Bool32(op == 97))), (*Table)(unsafe.Pointer(pTab)).FzName)
}
if piIdxCur != 0 {
*(*int32)(unsafe.Pointer(piIdxCur)) = iBase
@@ -98472,7 +102119,7 @@ __1:
goto __3
}
{
- var iIdxCur int32 = crt.PostIncInt32(&iBase, 1)
+ var iIdxCur int32 = libc.PostIncInt32(&iBase, 1)
if (int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */))&0x3>>0) == 2) && !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) {
if piDataCur != 0 {
@@ -98481,9 +102128,10 @@ __1:
p5 = U8(0)
}
if (aToOpen == uintptr(0)) || (*(*U8)(unsafe.Pointer(aToOpen + uintptr((i + 1)))) != 0) {
- Xsqlite3VdbeAddOp3(tls, v, op, iIdxCur, (*Index)(unsafe.Pointer(pIdx)).Ftnum, iDb)
+ Xsqlite3VdbeAddOp3(tls, v, op, iIdxCur, int32((*Index)(unsafe.Pointer(pIdx)).Ftnum), iDb)
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
Xsqlite3VdbeChangeP5(tls, v, uint16(p5))
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName))
}
}
goto __2
@@ -98504,7 +102152,7 @@ __3:
// transfer optimization is used. This is used for testing
// purposes only - to make sure the transfer optimization really
// is happening when it is supposed to.
-var Xsqlite3_xferopt_count int32 /* sqlite3.c:122698:16: */
+var Xsqlite3_xferopt_count int32 /* sqlite3.c:122998:16: */
// Check to see if index pSrc is compatible as a source of data
// for index pDest in an insert transfer optimization. The rules
@@ -98515,7 +102163,7 @@ var Xsqlite3_xferopt_count int32 /* sqlite3.c:122698:16: */
// * The same onError processing (OE_Abort, OE_Ignore, etc)
// * The same collating sequence on each column
// * The index has the exact same WHERE clause
-func xferCompatibleIndex(tls *crt.TLS, pDest uintptr, pSrc uintptr) int32 { /* sqlite3.c:122714:12: */
+func xferCompatibleIndex(tls *libc.TLS, pDest uintptr, pSrc uintptr) int32 { /* sqlite3.c:123014:12: */
var i int32
if (int32((*Index)(unsafe.Pointer(pDest)).FnKeyCol) != int32((*Index)(unsafe.Pointer(pSrc)).FnKeyCol)) || (int32((*Index)(unsafe.Pointer(pDest)).FnColumn) != int32((*Index)(unsafe.Pointer(pSrc)).FnColumn)) {
@@ -98573,7 +102221,10 @@ func xferCompatibleIndex(tls *crt.TLS, pDest uintptr, pSrc uintptr) int32 { /* s
// is no chance that the xfer optimization can be applied.
//
// This optimization is particularly useful at making VACUUM run faster.
-func xferOptimization(tls *crt.TLS, pParse uintptr, pDest uintptr, pSelect uintptr, onError int32, iDbDest int32) int32 { /* sqlite3.c:122775:12: */
+func xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uintptr, onError int32, iDbDest int32) int32 { /* sqlite3.c:123075:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pEList uintptr // The result set of the SELECT
var pSrc uintptr // The table in the FROM clause of SELECT
@@ -98663,10 +102314,10 @@ func xferOptimization(tls *crt.TLS, pParse uintptr, pDest uintptr, pSelect uintp
return 0
}
if ((*Table)(unsafe.Pointer(pSrc)).Ftnum == (*Table)(unsafe.Pointer(pDest)).Ftnum) && ((*Table)(unsafe.Pointer(pSrc)).FpSchema == (*Table)(unsafe.Pointer(pDest)).FpSchema) {
- // Possible due to bad sqlite_master.rootpage
+ // Possible due to bad sqlite_schema.rootpage
return 0
}
- if (crt.Bool32(((*Table)(unsafe.Pointer((pDest))).FtabFlags & U32(0x0080)) == U32(0))) != (crt.Bool32(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(0x0080)) == U32(0))) {
+ if (libc.Bool32(((*Table)(unsafe.Pointer((pDest))).FtabFlags & U32(0x0080)) == U32(0))) != (libc.Bool32(((*Table)(unsafe.Pointer((pSrc))).FtabFlags & U32(0x0080)) == U32(0))) {
return 0
}
if (*Table)(unsafe.Pointer(pSrc)).FnModuleArg != 0 {
@@ -98723,8 +102374,8 @@ func xferOptimization(tls *crt.TLS, pParse uintptr, pDest uintptr, pSelect uintp
// Default values for second and subsequent columns need to match.
if ((int32((*Column)(unsafe.Pointer(pDestCol)).FcolFlags) & 0x0060) == 0) && (i > 0) {
- if ((crt.Bool32((*Column)(unsafe.Pointer(pDestCol)).FpDflt == uintptr(0))) != (crt.Bool32((*Column)(unsafe.Pointer(pSrcCol)).FpDflt == uintptr(0)))) ||
- (((*Column)(unsafe.Pointer(pDestCol)).FpDflt != 0) && (crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer((*Column)(unsafe.Pointer(pDestCol)).FpDflt + 8 /* &.u */)),
+ if ((libc.Bool32((*Column)(unsafe.Pointer(pDestCol)).FpDflt == uintptr(0))) != (libc.Bool32((*Column)(unsafe.Pointer(pSrcCol)).FpDflt == uintptr(0)))) ||
+ (((*Column)(unsafe.Pointer(pDestCol)).FpDflt != 0) && (libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer((*Column)(unsafe.Pointer(pDestCol)).FpDflt + 8 /* &.u */)),
*(*uintptr)(unsafe.Pointer((*Column)(unsafe.Pointer(pSrcCol)).FpDflt + 8 /* &.u */))) != 0)) {
return 0
}
@@ -98773,8 +102424,8 @@ func xferOptimization(tls *crt.TLS, pParse uintptr, pDest uintptr, pSelect uintp
iDbSrc = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pSrc)).FpSchema)
v = Xsqlite3GetVdbe(tls, pParse)
Xsqlite3CodeVerifySchema(tls, pParse, iDbSrc)
- iSrc = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
- iDest = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ iSrc = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ iDest = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
regAutoinc = autoIncBegin(tls, pParse, iDbDest, pDest)
regData = Xsqlite3GetTempReg(tls, pParse)
regRowid = Xsqlite3GetTempReg(tls, pParse)
@@ -98845,13 +102496,13 @@ func xferOptimization(tls *crt.TLS, pParse uintptr, pDest uintptr, pSelect uintp
}
}
- Xsqlite3VdbeAddOp3(tls, v, 96, iSrc, (*Index)(unsafe.Pointer(pSrcIdx)).Ftnum, iDbSrc)
+ Xsqlite3VdbeAddOp3(tls, v, 96, iSrc, int32((*Index)(unsafe.Pointer(pSrcIdx)).Ftnum), iDbSrc)
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pSrcIdx)
-
- Xsqlite3VdbeAddOp3(tls, v, 97, iDest, (*Index)(unsafe.Pointer(pDestIdx)).Ftnum, iDbDest)
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pSrcIdx)).FzName))
+ Xsqlite3VdbeAddOp3(tls, v, 97, iDest, int32((*Index)(unsafe.Pointer(pDestIdx)).Ftnum), iDbDest)
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pDestIdx)
Xsqlite3VdbeChangeP5(tls, v, uint16(0x01))
-
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pDestIdx)).FzName))
addr1 = Xsqlite3VdbeAddOp2(tls, v, 37, iSrc, 0)
if ((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0004)) != 0 {
// This INSERT command is part of a VACUUM operation, which guarantees
@@ -98933,7 +102584,7 @@ func xferOptimization(tls *crt.TLS, pParse uintptr, pDest uintptr, pSelect uintp
// the xCallback() function is called. pArg becomes the first
// argument to xCallback(). If xCallback=NULL then no callback
// is invoked, even for queries.
-func Xsqlite3_exec(tls *crt.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_callback, pArg uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:123161:16: */
+func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_callback, pArg uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:123461:16: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -98954,13 +102605,13 @@ func Xsqlite3_exec(tls *crt.TLS, db uintptr, zSql uintptr, xCallback Sqlite3_cal
if !(!(Xsqlite3SafetyCheckOk(tls, db) != 0)) {
goto __1
}
- return Xsqlite3MisuseError(tls, 123174)
+ return Xsqlite3MisuseError(tls, 123474)
__1:
;
if !(zSql == uintptr(0)) {
goto __2
}
- zSql = ts + 672 /* "" */
+ zSql = ts + 781 /* "" */
__2:
;
@@ -99059,7 +102710,7 @@ __18:
*(*uintptr)(unsafe.Pointer(azVals + uintptr(i)*8)) = uintptr(0)
__15:
;
- if !((*(*func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&xCallback)))(tls, pArg, nCol, azVals, azCols) != 0) {
+ if !((*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&xCallback)))(tls, pArg, nCol, azVals, azCols) != 0) {
goto __20
}
// EVIDENCE-OF: R-38229-40159 If the callback function to
@@ -99140,7 +102791,7 @@ __26:
// This is the function signature used for all extension entry points. It
// is also defined in the file "loadext.c".
-type Sqlite3_loadext_entry = uintptr /* sqlite3.c:123639:13 */
+type Sqlite3_loadext_entry = uintptr /* sqlite3.c:123939:13 */
// The following macros redefine the API routines so that they are
// redirected through the global sqlite3_api structure.
@@ -99176,8 +102827,8 @@ type Sqlite3_loadext_entry = uintptr /* sqlite3.c:123639:13 */
// intend to use is supported by the library. Extensions should
// also check to make sure that the pointer to the function is
// not NULL before calling it.
-var sqlite3Apis = Sqlite3_api_routines{Faggregate_context: 0, Faggregate_count: 0, Fbind_blob: 0, Fbind_double: 0, Fbind_int: 0, Fbind_int64: 0, Fbind_null: 0, Fbind_parameter_count: 0, Fbind_parameter_index: 0, Fbind_parameter_name: 0, Fbind_text: 0, Fbind_text16: 0, Fbind_value: 0, Fbusy_handler: 0, Fbusy_timeout: 0, Fchanges: 0, Fclose: 0, Fcollation_needed: 0, Fcollation_needed16: 0, Fcolumn_blob: 0, Fcolumn_bytes: 0, Fcolumn_bytes16: 0, Fcolumn_count: 0, Fcolumn_database_name: uintptr(0), Fcolumn_database_name16: uintptr(0), Fcolumn_decltype: 0, Fcolumn_decltype16: 0, Fcolumn_double: 0, Fcolumn_int: 0, Fcolumn_int64: 0, Fcolumn_name: 0, Fcolumn_name16: 0, Fcolumn_origin_name: uintptr(0), Fcolumn_origin_name16: uintptr(0), Fcolumn_table_name: uintptr(0), Fcolumn_table_name16: uintptr(0), Fcolumn_text: 0, Fcolumn_text16: 0, Fcolumn_type: 0, Fcolumn_value: 0, Fcommit_hook: 0, Fcomplete: 0, Fcomplete16: 0, Fcreate_collation: 0, Fcreate_collation16: 0, Fcreate_function: 0, Fcreate_function16: 0, Fcreate_module: 0, Fdata_count: 0, Fdb_handle: 0, Fdeclare_vtab: 0, Fenable_shared_cache: 0, Ferrcode: 0, Ferrmsg: 0, Ferrmsg16: 0, Fexec: 0, Fexpired: 0, Ffinalize: 0, Ffree: 0, Ffree_table: 0, Fget_autocommit: 0, Fget_auxdata: 0, Fget_table: 0, Fglobal_recover: uintptr(0), Finterruptx: // Was sqlite3_global_recover(), but that function is deprecated
-0, Flast_insert_rowid: 0, Flibversion: 0, Flibversion_number: 0, Fmalloc: 0, Fmprintf: 0, Fopen64: 0, Fopen16: 0, Fprepare: 0, Fprepare16: 0, Fprofile: 0, Fprogress_handler: 0, Frealloc: 0, Freset: 0, Fresult_blob: 0, Fresult_double: 0, Fresult_error: 0, Fresult_error16: 0, Fresult_int: 0, Fresult_int64: 0, Fresult_null: 0, Fresult_text: 0, Fresult_text16: 0, Fresult_text16be: 0, Fresult_text16le: 0, Fresult_value: 0, Frollback_hook: 0, Fset_authorizer: 0, Fset_auxdata: 0, Fxsnprintf: 0, Fstep: 0, Ftable_column_metadata: 0, Fthread_cleanup: 0, Ftotal_changes: 0, Ftrace: 0, Ftransfer_bindings: 0, Fupdate_hook: 0, Fuser_data: 0, Fvalue_blob: 0, Fvalue_bytes: 0, Fvalue_bytes16: 0, Fvalue_double: 0, Fvalue_int: 0, Fvalue_int64: 0, Fvalue_numeric_type: 0, Fvalue_text: 0, Fvalue_text16: 0, Fvalue_text16be: 0, Fvalue_text16le: 0, Fvalue_type: 0, Fvmprintf: 0, Foverload_function:
+var sqlite3Apis = Sqlite3_api_routines{Faggregate_context: 0, Faggregate_count: 0, Fbind_blob: 0, Fbind_double: 0, Fbind_int: 0, Fbind_int64: 0, Fbind_null: 0, Fbind_parameter_count: 0, Fbind_parameter_index: 0, Fbind_parameter_name: 0, Fbind_text: 0, Fbind_text16: 0, Fbind_value: 0, Fbusy_handler: 0, Fbusy_timeout: 0, Fchanges: 0, Fclose: 0, Fcollation_needed: 0, Fcollation_needed16: 0, Fcolumn_blob: 0, Fcolumn_bytes: 0, Fcolumn_bytes16: 0, Fcolumn_count: 0, Fcolumn_database_name: 0, Fcolumn_database_name16: 0, Fcolumn_decltype: 0, Fcolumn_decltype16: 0, Fcolumn_double: 0, Fcolumn_int: 0, Fcolumn_int64: 0, Fcolumn_name: 0, Fcolumn_name16: 0, Fcolumn_origin_name: 0, Fcolumn_origin_name16: 0, Fcolumn_table_name: 0, Fcolumn_table_name16: 0, Fcolumn_text: 0, Fcolumn_text16: 0, Fcolumn_type: 0, Fcolumn_value: 0, Fcommit_hook: 0, Fcomplete: 0, Fcomplete16: 0, Fcreate_collation: 0, Fcreate_collation16: 0, Fcreate_function: 0, Fcreate_function16: 0, Fcreate_module: 0, Fdata_count: 0, Fdb_handle: 0, Fdeclare_vtab: 0, Fenable_shared_cache: 0, Ferrcode: 0, Ferrmsg: 0, Ferrmsg16: 0, Fexec: 0, Fexpired: 0, Ffinalize: 0, Ffree: 0, Ffree_table: 0, Fget_autocommit: 0, Fget_auxdata: 0, Fget_table: 0, Fglobal_recover: uintptr(0), Finterruptx: // Was sqlite3_global_recover(), but that function is deprecated
+0, Flast_insert_rowid: 0, Flibversion: 0, Flibversion_number: 0, Fmalloc: 0, Fmprintf: 0, Fopen64: 0, Fopen16: 0, Fprepare: 0, Fprepare16: 0, Fprofile: 0, Fprogress_handler: 0, Frealloc: 0, Freset: 0, Fresult_blob: 0, Fresult_double: 0, Fresult_error: 0, Fresult_error16: 0, Fresult_int: 0, Fresult_int64: 0, Fresult_null: 0, Fresult_text: 0, Fresult_text16: 0, Fresult_text16be: 0, Fresult_text16le: 0, Fresult_value: 0, Frollback_hook: 0, Fset_authorizer: 0, Fset_auxdata: 0, Fxsnprintf: 0, Fstep: 0, Ftable_column_metadata: 0, Fthread_cleanup: 0, Ftotal_changes: 0, Ftrace: 0, Ftransfer_bindings: 0, Fupdate_hook: 0, Fuser_data: 0, Fvalue_blob: 0, Fvalue_bytes: 0, Fvalue_bytes16: 0, Fvalue_double: 0, Fvalue_int: 0, Fvalue_int64: 0, Fvalue_numeric_type: 0, Fvalue_text: 0, Fvalue_text16: 0, Fvalue_text16be: 0, Fvalue_text16le: 0, Fvalue_type: 0, Fvmprintf: 0, Foverload_function:
// The original API set ends here. All extensions can call any
// of the APIs above provided that the pointer is not NULL. But
// before calling APIs that follow, extension should check the
@@ -99235,7 +102886,7 @@ uintptr(0), Fstmt_isexplain:
0, Furi_key: 0, Ffilename_database: 0, Ffilename_journal: 0, Ffilename_wal: 0, Fcreate_filename:
// Version 3.32.0 and later
0, Ffree_filename: 0, Fdatabase_file_object: 0,
-} /* sqlite3.c:124071:35 */
+} /* sqlite3.c:124371:35 */
// True if x is the directory separator character
@@ -99249,7 +102900,7 @@ uintptr(0), Fstmt_isexplain:
// If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with
// error message text. The calling function should free this memory
// by calling sqlite3DbFree(db, ).
-func sqlite3LoadExtension(tls *crt.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:124441:12: */
+func sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:124741:12: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -99276,7 +102927,7 @@ func sqlite3LoadExtension(tls *crt.TLS, db uintptr, zFile uintptr, zProc uintptr
// to turn on extension loading.
if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00010000)) == uint64(0) {
if pzErrMsg != 0 {
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+10537 /* "not authorized" */, 0)
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+13215 /* "not authorized" */, 0)
}
return 1
}
@@ -99284,12 +102935,12 @@ func sqlite3LoadExtension(tls *crt.TLS, db uintptr, zFile uintptr, zProc uintptr
if zProc != 0 {
zEntry = zProc
} else {
- zEntry = ts + 13928 /* "sqlite3_extensio..." */
+ zEntry = ts + 16917 /* "sqlite3_extensio..." */
}
handle = Xsqlite3OsDlOpen(tls, pVfs, zFile)
for ii = 0; (ii < (int32(uint64(unsafe.Sizeof(azEndings)) / uint64(unsafe.Sizeof(uintptr(0)))))) && (handle == uintptr(0)); ii++ {
- var zAltFile uintptr = Xsqlite3_mprintf(tls, ts+10498 /* "%s.%s" */, crt.VaList(bp, zFile, azEndings[ii]))
+ var zAltFile uintptr = Xsqlite3_mprintf(tls, ts+9978 /* "%s.%s" */, libc.VaList(bp, zFile, azEndings[ii]))
if zAltFile == uintptr(0) {
return 7
}
@@ -99298,10 +102949,10 @@ func sqlite3LoadExtension(tls *crt.TLS, db uintptr, zFile uintptr, zProc uintptr
}
if handle == uintptr(0) {
if pzErrMsg != 0 {
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = crt.AssignPtrUintptr(bp+48 /* zErrmsg */, Xsqlite3_malloc64(tls, nMsg))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = libc.AssignPtrUintptr(bp+48 /* zErrmsg */, Xsqlite3_malloc64(tls, nMsg))
if *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)) != 0 {
Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)),
- ts+13951 /* "unable to open s..." */, crt.VaList(bp+16, zFile))
+ ts+16940 /* "unable to open s..." */, libc.VaList(bp+16, zFile))
Xsqlite3OsDlError(tls, pVfs, (int32(nMsg - uint64(1))), *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)))
}
}
@@ -99329,29 +102980,29 @@ func sqlite3LoadExtension(tls *crt.TLS, db uintptr, zFile uintptr, zProc uintptr
Xsqlite3OsDlClose(tls, pVfs, handle)
return 7
}
- crt.Xmemcpy(tls, zAltEntry, ts+13986 /* "sqlite3_" */, uint64(8))
+ libc.Xmemcpy(tls, zAltEntry, ts+16975 /* "sqlite3_" */, uint64(8))
for iFile = (ncFile - 1); (iFile >= 0) && !((int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile))))) == '/'); iFile-- {
}
iFile++
- if Xsqlite3_strnicmp(tls, (zFile+uintptr(iFile)), ts+13995 /* "lib" */, 3) == 0 {
+ if Xsqlite3_strnicmp(tls, (zFile+uintptr(iFile)), ts+16984 /* "lib" */, 3) == 0 {
iFile = iFile + (3)
}
- for iEntry = 8; ((crt.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))))) != 0) && (c != '.'); iFile++ {
+ for iEntry = 8; ((libc.AssignInt32(&c, int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))))) != 0) && (c != '.'); iFile++ {
if (int32(Xsqlite3CtypeMap[uint8(c)]) & 0x02) != 0 {
- *(*int8)(unsafe.Pointer(zAltEntry + uintptr(crt.PostIncInt32(&iEntry, 1)))) = int8(Xsqlite3UpperToLower[uint32(c)])
+ *(*int8)(unsafe.Pointer(zAltEntry + uintptr(libc.PostIncInt32(&iEntry, 1)))) = int8(Xsqlite3UpperToLower[uint32(c)])
}
}
- crt.Xmemcpy(tls, (zAltEntry + uintptr(iEntry)), ts+13999 /* "_init" */, uint64(6))
+ libc.Xmemcpy(tls, (zAltEntry + uintptr(iEntry)), ts+16988 /* "_init" */, uint64(6))
zEntry = zAltEntry
xInit = Xsqlite3OsDlSym(tls, pVfs, handle, zEntry)
}
if xInit == uintptr(0) {
if pzErrMsg != 0 {
nMsg = nMsg + (U64(Xsqlite3Strlen30(tls, zEntry)))
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = crt.AssignPtrUintptr(bp+48 /* zErrmsg */, Xsqlite3_malloc64(tls, nMsg))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = libc.AssignPtrUintptr(bp+48 /* zErrmsg */, Xsqlite3_malloc64(tls, nMsg))
if *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)) != 0 {
Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)),
- ts+14005 /* "no entry point [..." */, crt.VaList(bp+24, zEntry, zFile))
+ ts+16994 /* "no entry point [..." */, libc.VaList(bp+24, zEntry, zFile))
Xsqlite3OsDlError(tls, pVfs, (int32(nMsg - uint64(1))), *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)))
}
}
@@ -99360,13 +103011,13 @@ func sqlite3LoadExtension(tls *crt.TLS, db uintptr, zFile uintptr, zProc uintptr
return 1
}
Xsqlite3_free(tls, zAltEntry)
- rc = (*(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&xInit)))(tls, db, bp+48 /* &zErrmsg */, uintptr(unsafe.Pointer(&sqlite3Apis)))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&xInit)))(tls, db, bp+48 /* &zErrmsg */, uintptr(unsafe.Pointer(&sqlite3Apis)))
if rc != 0 {
if rc == (0 | (int32(1) << 8)) {
return 0
}
if pzErrMsg != 0 {
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+14048 /* "error during ini..." */, crt.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */))))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+17037 /* "error during ini..." */, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */))))
}
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* zErrmsg */)))
Xsqlite3OsDlClose(tls, pVfs, handle)
@@ -99379,19 +103030,19 @@ func sqlite3LoadExtension(tls *crt.TLS, db uintptr, zFile uintptr, zProc uintptr
return 7
}
if (*Sqlite3)(unsafe.Pointer(db)).FnExtension > 0 {
- crt.Xmemcpy(tls, aHandle, (*Sqlite3)(unsafe.Pointer(db)).FaExtension, (uint64(unsafe.Sizeof(handle)) * uint64((*Sqlite3)(unsafe.Pointer(db)).FnExtension)))
+ libc.Xmemcpy(tls, aHandle, (*Sqlite3)(unsafe.Pointer(db)).FaExtension, (uint64(unsafe.Sizeof(handle)) * uint64((*Sqlite3)(unsafe.Pointer(db)).FnExtension)))
}
Xsqlite3DbFree(tls, db, (*Sqlite3)(unsafe.Pointer(db)).FaExtension)
(*Sqlite3)(unsafe.Pointer(db)).FaExtension = aHandle
- *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaExtension + uintptr(crt.PostIncInt32(&(*Sqlite3)(unsafe.Pointer(db)).FnExtension, 1))*8)) = handle
+ *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaExtension + uintptr(libc.PostIncInt32(&(*Sqlite3)(unsafe.Pointer(db)).FnExtension, 1))*8)) = handle
return 0
}
var azEndings = [1]uintptr{
- ts + 14080, /* "so" */
-} /* sqlite3.c:124459:21 */
-func Xsqlite3_load_extension(tls *crt.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:124582:16: */
+ ts + 17069, /* "so" */
+} /* sqlite3.c:124759:21 */
+func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:124882:16: */
var rc int32
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
rc = sqlite3LoadExtension(tls, db, zFile, zProc, pzErrMsg)
@@ -99402,7 +103053,7 @@ func Xsqlite3_load_extension(tls *crt.TLS, db uintptr, zFile uintptr, zProc uint
// Call this routine when the database connection is closing in order
// to clean up loaded extensions
-func Xsqlite3CloseExtensions(tls *crt.TLS, db uintptr) { /* sqlite3.c:124600:21: */
+func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:124900:21: */
var i int32
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnExtension; i++ {
@@ -99413,12 +103064,12 @@ func Xsqlite3CloseExtensions(tls *crt.TLS, db uintptr) { /* sqlite3.c:124600:21:
// Enable or disable extension loading. Extension loading is disabled by
// default so as not to open security holes in older applications.
-func Xsqlite3_enable_load_extension(tls *crt.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:124613:16: */
+func Xsqlite3_enable_load_extension(tls *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:124913:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if onoff != 0 {
*(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(0x00010000 | 0x00020000))
} else {
- *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(crt.Uint64FromUint64((uint64(0x00010000 | 0x00020000)))))
+ *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(libc.Uint64FromUint64((uint64(0x00010000 | 0x00020000)))))
}
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return 0
@@ -99427,7 +103078,7 @@ func Xsqlite3_enable_load_extension(tls *crt.TLS, db uintptr, onoff int32) int32
// The following object holds the list of automatically loaded
// extensions.
//
-// This list is shared across threads. The SQLITE_MUTEX_STATIC_MASTER
+// This list is shared across threads. The SQLITE_MUTEX_STATIC_MAIN
// mutex must be held while accessing this list.
type sqlite3AutoExtList = struct {
FnExt U32
@@ -99437,10 +103088,10 @@ type sqlite3AutoExtList = struct {
// The following object holds the list of automatically loaded
// extensions.
//
-// This list is shared across threads. The SQLITE_MUTEX_STATIC_MASTER
+// This list is shared across threads. The SQLITE_MUTEX_STATIC_MAIN
// mutex must be held while accessing this list.
-type Sqlite3AutoExtList = sqlite3AutoExtList /* sqlite3.c:124633:35 */
-var sqlite3Autoext = sqlite3AutoExtList{FnExt: U32(0), FaExt: uintptr(0)} /* sqlite3.c:124637:3 */
+type Sqlite3AutoExtList = sqlite3AutoExtList /* sqlite3.c:124933:35 */
+var sqlite3Autoext = sqlite3AutoExtList{FnExt: U32(0), FaExt: uintptr(0)} /* sqlite3.c:124937:3 */
// The "wsdAutoext" macro will resolve to the autoextension
// state vector. If writable static data is unsupported on the target,
@@ -99450,7 +103101,7 @@ var sqlite3Autoext = sqlite3AutoExtList{FnExt: U32(0), FaExt: uintptr(0)} /* sql
// Register a statically linked extension that is automatically
// loaded by every new database connection.
-func Xsqlite3_auto_extension(tls *crt.TLS, xInit uintptr) int32 { /* sqlite3.c:124659:16: */
+func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:124959:16: */
var rc int32 = 0
rc = Xsqlite3_initialize(tls)
if rc != 0 {
@@ -99491,7 +103142,7 @@ func Xsqlite3_auto_extension(tls *crt.TLS, xInit uintptr) int32 { /* sqlite3.c:1
//
// Return 1 if xInit was found on the list and removed. Return 0 if xInit
// was not on the list.
-func Xsqlite3_cancel_auto_extension(tls *crt.TLS, xInit uintptr) int32 { /* sqlite3.c:124706:16: */
+func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) int32 { /* sqlite3.c:125006:16: */
var mutex uintptr = Xsqlite3MutexAlloc(tls, 2)
var i int32
var n int32 = 0
@@ -99510,7 +103161,7 @@ func Xsqlite3_cancel_auto_extension(tls *crt.TLS, xInit uintptr) int32 { /* sqli
}
// Reset the automatic extension loading mechanism.
-func Xsqlite3_reset_auto_extension(tls *crt.TLS) { /* sqlite3.c:124731:17: */
+func Xsqlite3_reset_auto_extension(tls *libc.TLS) { /* sqlite3.c:125031:17: */
if Xsqlite3_initialize(tls) == 0 {
var mutex uintptr = Xsqlite3MutexAlloc(tls, 2)
@@ -99525,7 +103176,7 @@ func Xsqlite3_reset_auto_extension(tls *crt.TLS) { /* sqlite3.c:124731:17: */
// Load all automatic extensions.
//
// If anything goes wrong, set an error in the database connection.
-func Xsqlite3AutoLoadExtensions(tls *crt.TLS, db uintptr) { /* sqlite3.c:124753:21: */
+func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { /* sqlite3.c:125053:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -99552,9 +103203,9 @@ func Xsqlite3AutoLoadExtensions(tls *crt.TLS, db uintptr) { /* sqlite3.c:124753:
}
Xsqlite3_mutex_leave(tls, mutex)
*(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */)) = uintptr(0)
- if (xInit != 0) && ((crt.AssignInt32(&rc, (*(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&xInit)))(tls, db, bp+8 /* &zErrmsg */, pThunk))) != 0) {
+ if (xInit != 0) && ((libc.AssignInt32(&rc, (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&xInit)))(tls, db, bp+8 /* &zErrmsg */, pThunk))) != 0) {
Xsqlite3ErrorWithMsg(tls, db, rc,
- ts+14083 /* "automatic extens..." */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */))))
+ ts+17072 /* "automatic extens..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */))))
go1 = 0
}
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErrmsg */)))
@@ -99599,62 +103250,62 @@ func Xsqlite3AutoLoadExtensions(tls *crt.TLS, db uintptr) { /* sqlite3.c:124753:
// or that return single-column results where the name of the
// result column is different from the name of the pragma
var pragCName = [51]uintptr{
- /* 0 */ ts + 4556, /* "id" */ // Used by: foreign_key_list
- /* 1 */ ts + 14122, /* "seq" */
- /* 2 */ ts + 6019, /* "table" */
- /* 3 */ ts + 14126, /* "from" */
- /* 4 */ ts + 14131, /* "to" */
- /* 5 */ ts + 14134, /* "on_update" */
- /* 6 */ ts + 14144, /* "on_delete" */
- /* 7 */ ts + 14154, /* "match" */
- /* 8 */ ts + 14160, /* "cid" */ // Used by: table_xinfo
- /* 9 */ ts + 14164, /* "name" */
- /* 10 */ ts + 14169, /* "type" */
- /* 11 */ ts + 14174, /* "notnull" */
- /* 12 */ ts + 14182, /* "dflt_value" */
- /* 13 */ ts + 14193, /* "pk" */
- /* 14 */ ts + 14196, /* "hidden" */
+ /* 0 */ ts + 6754, /* "id" */ // Used by: foreign_key_list
+ /* 1 */ ts + 17111, /* "seq" */
+ /* 2 */ ts + 8217, /* "table" */
+ /* 3 */ ts + 17115, /* "from" */
+ /* 4 */ ts + 17120, /* "to" */
+ /* 5 */ ts + 17123, /* "on_update" */
+ /* 6 */ ts + 17133, /* "on_delete" */
+ /* 7 */ ts + 17143, /* "match" */
+ /* 8 */ ts + 17149, /* "cid" */ // Used by: table_xinfo
+ /* 9 */ ts + 17153, /* "name" */
+ /* 10 */ ts + 17158, /* "type" */
+ /* 11 */ ts + 17163, /* "notnull" */
+ /* 12 */ ts + 17171, /* "dflt_value" */
+ /* 13 */ ts + 17182, /* "pk" */
+ /* 14 */ ts + 17185, /* "hidden" */
// table_info reuses 8
- /* 15 */ ts + 14203, /* "seqno" */ // Used by: index_xinfo
- /* 16 */ ts + 14160, /* "cid" */
- /* 17 */ ts + 14164, /* "name" */
- /* 18 */ ts + 14209, /* "desc" */
- /* 19 */ ts + 14214, /* "coll" */
- /* 20 */ ts + 14219, /* "key" */
- /* 21 */ ts + 14164, /* "name" */ // Used by: function_list
- /* 22 */ ts + 14223, /* "builtin" */
- /* 23 */ ts + 14169, /* "type" */
- /* 24 */ ts + 14231, /* "enc" */
- /* 25 */ ts + 14235, /* "narg" */
- /* 26 */ ts + 14240, /* "flags" */
- /* 27 */ ts + 10035, /* "tbl" */ // Used by: stats
- /* 28 */ ts + 10031, /* "idx" */
- /* 29 */ ts + 14246, /* "wdth" */
- /* 30 */ ts + 14251, /* "hght" */
- /* 31 */ ts + 14256, /* "flgs" */
- /* 32 */ ts + 14122, /* "seq" */ // Used by: index_list
- /* 33 */ ts + 14164, /* "name" */
- /* 34 */ ts + 14261, /* "unique" */
- /* 35 */ ts + 14268, /* "origin" */
- /* 36 */ ts + 14275, /* "partial" */
- /* 37 */ ts + 6019, /* "table" */ // Used by: foreign_key_check
- /* 38 */ ts + 14283, /* "rowid" */
- /* 39 */ ts + 4559, /* "parent" */
- /* 40 */ ts + 14289, /* "fkid" */
+ /* 15 */ ts + 17192, /* "seqno" */ // Used by: index_xinfo
+ /* 16 */ ts + 17149, /* "cid" */
+ /* 17 */ ts + 17153, /* "name" */
+ /* 18 */ ts + 17198, /* "desc" */
+ /* 19 */ ts + 17203, /* "coll" */
+ /* 20 */ ts + 17208, /* "key" */
+ /* 21 */ ts + 17153, /* "name" */ // Used by: function_list
+ /* 22 */ ts + 17212, /* "builtin" */
+ /* 23 */ ts + 17158, /* "type" */
+ /* 24 */ ts + 17220, /* "enc" */
+ /* 25 */ ts + 17224, /* "narg" */
+ /* 26 */ ts + 17229, /* "flags" */
+ /* 27 */ ts + 12613, /* "tbl" */ // Used by: stats
+ /* 28 */ ts + 12609, /* "idx" */
+ /* 29 */ ts + 17235, /* "wdth" */
+ /* 30 */ ts + 17240, /* "hght" */
+ /* 31 */ ts + 17245, /* "flgs" */
+ /* 32 */ ts + 17111, /* "seq" */ // Used by: index_list
+ /* 33 */ ts + 17153, /* "name" */
+ /* 34 */ ts + 17250, /* "unique" */
+ /* 35 */ ts + 17257, /* "origin" */
+ /* 36 */ ts + 17264, /* "partial" */
+ /* 37 */ ts + 8217, /* "table" */ // Used by: foreign_key_check
+ /* 38 */ ts + 10045, /* "rowid" */
+ /* 39 */ ts + 6757, /* "parent" */
+ /* 40 */ ts + 17272, /* "fkid" */
// index_info reuses 15
- /* 41 */ ts + 14122, /* "seq" */ // Used by: database_list
- /* 42 */ ts + 14164, /* "name" */
- /* 43 */ ts + 14294, /* "file" */
- /* 44 */ ts + 14299, /* "busy" */ // Used by: wal_checkpoint
- /* 45 */ ts + 14304, /* "log" */
- /* 46 */ ts + 14308, /* "checkpointed" */
+ /* 41 */ ts + 17111, /* "seq" */ // Used by: database_list
+ /* 42 */ ts + 17153, /* "name" */
+ /* 43 */ ts + 17277, /* "file" */
+ /* 44 */ ts + 17282, /* "busy" */ // Used by: wal_checkpoint
+ /* 45 */ ts + 17287, /* "log" */
+ /* 46 */ ts + 17291, /* "checkpointed" */
// collation_list reuses 32
- /* 47 */ ts + 14321, /* "database" */ // Used by: lock_status
- /* 48 */ ts + 14330, /* "status" */
- /* 49 */ ts + 14337, /* "cache_size" */ // Used by: default_cache_size
+ /* 47 */ ts + 17304, /* "database" */ // Used by: lock_status
+ /* 48 */ ts + 17313, /* "status" */
+ /* 49 */ ts + 17320, /* "cache_size" */ // Used by: default_cache_size
// module_list pragma_list reuses 9
- /* 50 */ ts + 14348, /* "timeout" */ // Used by: busy_timeout
-} /* sqlite3.c:124893:19 */
+ /* 50 */ ts + 17331, /* "timeout" */ // Used by: busy_timeout
+} /* sqlite3.c:125193:19 */
// Definitions of all built-in pragmas
type PragmaName1 = struct {
@@ -99667,339 +103318,339 @@ type PragmaName1 = struct {
}
// Definitions of all built-in pragmas
-type PragmaName = PragmaName1 /* sqlite3.c:124959:3 */
+type PragmaName = PragmaName1 /* sqlite3.c:125259:3 */
var aPragmaName = [66]PragmaName{
- {FzName: /* zName: */ ts + 14356 /* "analysis_limit" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17339 /* "analysis_limit" */, FePragTyp:
/* ePragTyp: */ U8(1), FmPragFlg:
/* ePragFlg: */ U8(0x10), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14371 /* "application_id" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17354 /* "application_id" */, FePragTyp:
/* ePragTyp: */ U8(2), FmPragFlg:
/* ePragFlg: */ (U8(0x04 | 0x10)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(8)},
- {FzName: /* zName: */ ts + 14386 /* "auto_vacuum" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17369 /* "auto_vacuum" */, FePragTyp:
/* ePragTyp: */ U8(3), FmPragFlg:
/* ePragFlg: */ (U8(((0x01 | 0x10) | 0x80) | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14398 /* "automatic_index" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17381 /* "automatic_index" */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00008000)},
- {FzName: /* zName: */ ts + 14414 /* "busy_timeout" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17397 /* "busy_timeout" */, FePragTyp:
/* ePragTyp: */ U8(5), FmPragFlg:
/* ePragFlg: */ U8(0x10), FiPragCName:
/* ColNames: */ U8(50), FnPragCName: U8(1), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14337 /* "cache_size" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17320 /* "cache_size" */, FePragTyp:
/* ePragTyp: */ U8(6), FmPragFlg:
/* ePragFlg: */ (U8(((0x01 | 0x10) | 0x80) | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14427 /* "cache_spill" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17410 /* "cache_spill" */, FePragTyp:
/* ePragTyp: */ U8(7), FmPragFlg:
/* ePragFlg: */ (U8((0x10 | 0x80) | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14439 /* "case_sensitive_l..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 17422 /* "case_sensitive_l..." */, FePragTyp:
/* ePragTyp: */ U8(8), FmPragFlg:
/* ePragFlg: */ U8(0x02), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14459 /* "cell_size_check" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17442 /* "cell_size_check" */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00200000)},
- {FzName: /* zName: */ ts + 14475 /* "checkpoint_fullf..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 17458 /* "checkpoint_fullf..." */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00000010)},
- {FzName: /* zName: */ ts + 14496 /* "collation_list" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17479 /* "collation_list" */, FePragTyp:
/* ePragTyp: */ U8(9), FmPragFlg:
/* ePragFlg: */ U8(0x10), FiPragCName:
/* ColNames: */ U8(32), FnPragCName: U8(2), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14511 /* "compile_options" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17494 /* "compile_options" */, FePragTyp:
/* ePragTyp: */ U8(10), FmPragFlg:
/* ePragFlg: */ U8(0x10), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14527 /* "count_changes" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17510 /* "count_changes" */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ (U64((uint64(0x00001))) << 32)},
- {FzName: /* zName: */ ts + 14541 /* "data_version" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17524 /* "data_version" */, FePragTyp:
/* ePragTyp: */ U8(2), FmPragFlg:
/* ePragFlg: */ (U8(0x08 | 0x10)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(15)},
- {FzName: /* zName: */ ts + 14554 /* "database_list" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17537 /* "database_list" */, FePragTyp:
/* ePragTyp: */ U8(12), FmPragFlg:
/* ePragFlg: */ (U8(0x01 | 0x10)), FiPragCName:
/* ColNames: */ U8(41), FnPragCName: U8(3), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14568 /* "default_cache_si..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 17551 /* "default_cache_si..." */, FePragTyp:
/* ePragTyp: */ U8(13), FmPragFlg:
/* ePragFlg: */ (U8(((0x01 | 0x10) | 0x80) | 0x04)), FiPragCName:
/* ColNames: */ U8(49), FnPragCName: U8(1), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14587 /* "defer_foreign_ke..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 17570 /* "defer_foreign_ke..." */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00080000)},
- {FzName: /* zName: */ ts + 14606 /* "empty_result_cal..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 17589 /* "empty_result_cal..." */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00000100)},
- {FzName: /* zName: */ ts + 14629 /* "encoding" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17612 /* "encoding" */, FePragTyp:
/* ePragTyp: */ U8(14), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14638 /* "foreign_key_chec..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 17621 /* "foreign_key_chec..." */, FePragTyp:
/* ePragTyp: */ U8(15), FmPragFlg:
- /* ePragFlg: */ (U8(0x01 | 0x10)), FiPragCName:
+ /* ePragFlg: */ (U8(((0x01 | 0x10) | 0x20) | 0x40)), FiPragCName:
/* ColNames: */ U8(37), FnPragCName: U8(4), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14656 /* "foreign_key_list" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17639 /* "foreign_key_list" */, FePragTyp:
/* ePragTyp: */ U8(16), FmPragFlg:
/* ePragFlg: */ (U8((0x01 | 0x20) | 0x40)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(8), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14673 /* "foreign_keys" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17656 /* "foreign_keys" */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00004000)},
- {FzName: /* zName: */ ts + 14686 /* "freelist_count" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17669 /* "freelist_count" */, FePragTyp:
/* ePragTyp: */ U8(2), FmPragFlg:
/* ePragFlg: */ (U8(0x08 | 0x10)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14701 /* "full_column_name..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 17684 /* "full_column_name..." */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00000004)},
- {FzName: /* zName: */ ts + 14719 /* "fullfsync" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17702 /* "fullfsync" */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00000008)},
- {FzName: /* zName: */ ts + 14729 /* "function_list" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17712 /* "function_list" */, FePragTyp:
/* ePragTyp: */ U8(17), FmPragFlg:
/* ePragFlg: */ U8(0x10), FiPragCName:
/* ColNames: */ U8(21), FnPragCName: U8(6), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14743 /* "hard_heap_limit" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17726 /* "hard_heap_limit" */, FePragTyp:
/* ePragTyp: */ U8(18), FmPragFlg:
/* ePragFlg: */ U8(0x10), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14759 /* "ignore_check_con..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 17742 /* "ignore_check_con..." */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00000200)},
- {FzName: /* zName: */ ts + 14784 /* "incremental_vacu..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 17767 /* "incremental_vacu..." */, FePragTyp:
/* ePragTyp: */ U8(19), FmPragFlg:
/* ePragFlg: */ (U8(0x01 | 0x02)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14803 /* "index_info" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17786 /* "index_info" */, FePragTyp:
/* ePragTyp: */ U8(20), FmPragFlg:
/* ePragFlg: */ (U8((0x01 | 0x20) | 0x40)), FiPragCName:
/* ColNames: */ U8(15), FnPragCName: U8(3), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14814 /* "index_list" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17797 /* "index_list" */, FePragTyp:
/* ePragTyp: */ U8(21), FmPragFlg:
/* ePragFlg: */ (U8((0x01 | 0x20) | 0x40)), FiPragCName:
/* ColNames: */ U8(32), FnPragCName: U8(5), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14825 /* "index_xinfo" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17808 /* "index_xinfo" */, FePragTyp:
/* ePragTyp: */ U8(20), FmPragFlg:
/* ePragFlg: */ (U8((0x01 | 0x20) | 0x40)), FiPragCName:
/* ColNames: */ U8(15), FnPragCName: U8(6), FiArg:
/* iArg: */ uint64(1)},
- {FzName: /* zName: */ ts + 14837 /* "integrity_check" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17820 /* "integrity_check" */, FePragTyp:
/* ePragTyp: */ U8(22), FmPragFlg:
/* ePragFlg: */ (U8((0x01 | 0x10) | 0x20)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14853 /* "journal_mode" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17836 /* "journal_mode" */, FePragTyp:
/* ePragTyp: */ U8(23), FmPragFlg:
/* ePragFlg: */ (U8((0x01 | 0x10) | 0x80)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14866 /* "journal_size_lim..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 17849 /* "journal_size_lim..." */, FePragTyp:
/* ePragTyp: */ U8(24), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x80)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14885 /* "legacy_alter_tab..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 17868 /* "legacy_alter_tab..." */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x04000000)},
- {FzName: /* zName: */ ts + 14904 /* "lock_status" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17887 /* "lock_status" */, FePragTyp:
/* ePragTyp: */ U8(43), FmPragFlg:
/* ePragFlg: */ U8(0x10), FiPragCName:
/* ColNames: */ U8(47), FnPragCName: U8(2), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14916 /* "locking_mode" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17899 /* "locking_mode" */, FePragTyp:
/* ePragTyp: */ U8(26), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x80)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14929 /* "max_page_count" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17912 /* "max_page_count" */, FePragTyp:
/* ePragTyp: */ U8(27), FmPragFlg:
/* ePragFlg: */ (U8((0x01 | 0x10) | 0x80)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14944 /* "mmap_size" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17927 /* "mmap_size" */, FePragTyp:
/* ePragTyp: */ U8(28), FmPragFlg:
/* ePragFlg: */ U8(0), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14954 /* "module_list" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17937 /* "module_list" */, FePragTyp:
/* ePragTyp: */ U8(29), FmPragFlg:
/* ePragFlg: */ U8(0x10), FiPragCName:
/* ColNames: */ U8(9), FnPragCName: U8(1), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14966 /* "optimize" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17949 /* "optimize" */, FePragTyp:
/* ePragTyp: */ U8(30), FmPragFlg:
/* ePragFlg: */ (U8(0x20 | 0x01)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14975 /* "page_count" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17958 /* "page_count" */, FePragTyp:
/* ePragTyp: */ U8(27), FmPragFlg:
/* ePragFlg: */ (U8((0x01 | 0x10) | 0x80)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14986 /* "page_size" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17969 /* "page_size" */, FePragTyp:
/* ePragTyp: */ U8(31), FmPragFlg:
/* ePragFlg: */ (U8((0x10 | 0x80) | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 14996 /* "pragma_list" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17979 /* "pragma_list" */, FePragTyp:
/* ePragTyp: */ U8(32), FmPragFlg:
/* ePragFlg: */ U8(0x10), FiPragCName:
/* ColNames: */ U8(9), FnPragCName: U8(1), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 15008 /* "query_only" */, FePragTyp:
+ {FzName: /* zName: */ ts + 17991 /* "query_only" */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00100000)},
- {FzName: /* zName: */ ts + 15019 /* "quick_check" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18002 /* "quick_check" */, FePragTyp:
/* ePragTyp: */ U8(22), FmPragFlg:
/* ePragFlg: */ (U8((0x01 | 0x10) | 0x20)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 15031 /* "read_uncommitted" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18014 /* "read_uncommitted" */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00000400)},
- {FzName: /* zName: */ ts + 15048 /* "recursive_trigge..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 18031 /* "recursive_trigge..." */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00002000)},
- {FzName: /* zName: */ ts + 15067 /* "reverse_unordere..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 18050 /* "reverse_unordere..." */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00001000)},
- {FzName: /* zName: */ ts + 15093 /* "schema_version" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18076 /* "schema_version" */, FePragTyp:
/* ePragTyp: */ U8(2), FmPragFlg:
/* ePragFlg: */ (U8(0x04 | 0x10)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(1)},
- {FzName: /* zName: */ ts + 15108 /* "secure_delete" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18091 /* "secure_delete" */, FePragTyp:
/* ePragTyp: */ U8(33), FmPragFlg:
/* ePragFlg: */ U8(0x10), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 15122 /* "short_column_nam..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 18105 /* "short_column_nam..." */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00000040)},
- {FzName: /* zName: */ ts + 15141 /* "shrink_memory" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18124 /* "shrink_memory" */, FePragTyp:
/* ePragTyp: */ U8(34), FmPragFlg:
/* ePragFlg: */ U8(0x02), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 15155 /* "soft_heap_limit" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18138 /* "soft_heap_limit" */, FePragTyp:
/* ePragTyp: */ U8(35), FmPragFlg:
/* ePragFlg: */ U8(0x10), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 15171 /* "synchronous" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18154 /* "synchronous" */, FePragTyp:
/* ePragTyp: */ U8(36), FmPragFlg:
/* ePragFlg: */ (U8(((0x01 | 0x10) | 0x80) | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 15183 /* "table_info" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18166 /* "table_info" */, FePragTyp:
/* ePragTyp: */ U8(37), FmPragFlg:
/* ePragFlg: */ (U8((0x01 | 0x20) | 0x40)), FiPragCName:
/* ColNames: */ U8(8), FnPragCName: U8(6), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 15194 /* "table_xinfo" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18177 /* "table_xinfo" */, FePragTyp:
/* ePragTyp: */ U8(37), FmPragFlg:
/* ePragFlg: */ (U8((0x01 | 0x20) | 0x40)), FiPragCName:
/* ColNames: */ U8(8), FnPragCName: U8(7), FiArg:
/* iArg: */ uint64(1)},
- {FzName: /* zName: */ ts + 15206 /* "temp_store" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18189 /* "temp_store" */, FePragTyp:
/* ePragTyp: */ U8(38), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 15217 /* "temp_store_direc..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 18200 /* "temp_store_direc..." */, FePragTyp:
/* ePragTyp: */ U8(39), FmPragFlg:
/* ePragFlg: */ U8(0x04), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 15238 /* "threads" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18221 /* "threads" */, FePragTyp:
/* ePragTyp: */ U8(40), FmPragFlg:
/* ePragFlg: */ U8(0x10), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 15246 /* "trusted_schema" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18229 /* "trusted_schema" */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0x00000080)},
- {FzName: /* zName: */ ts + 15261 /* "user_version" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18244 /* "user_version" */, FePragTyp:
/* ePragTyp: */ U8(2), FmPragFlg:
/* ePragFlg: */ (U8(0x04 | 0x10)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(6)},
- {FzName: /* zName: */ ts + 15274 /* "wal_autocheckpoi..." */, FePragTyp:
+ {FzName: /* zName: */ ts + 18257 /* "wal_autocheckpoi..." */, FePragTyp:
/* ePragTyp: */ U8(41), FmPragFlg:
/* ePragFlg: */ U8(0), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 15293 /* "wal_checkpoint" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18276 /* "wal_checkpoint" */, FePragTyp:
/* ePragTyp: */ U8(42), FmPragFlg:
/* ePragFlg: */ U8(0x01), FiPragCName:
/* ColNames: */ U8(44), FnPragCName: U8(3), FiArg:
/* iArg: */ uint64(0)},
- {FzName: /* zName: */ ts + 15308 /* "writable_schema" */, FePragTyp:
+ {FzName: /* zName: */ ts + 18291 /* "writable_schema" */, FePragTyp:
/* ePragTyp: */ U8(4), FmPragFlg:
/* ePragFlg: */ (U8(0x10 | 0x04)), FiPragCName:
/* ColNames: */ U8(0), FnPragCName: U8(0), FiArg:
/* iArg: */ (uint64(0x00000001 | 0x08000000))},
-} /* sqlite3.c:124960:25 */
+} /* sqlite3.c:125260:25 */
// Number of pragmas: 67 on by default, 77 total.
//************* End of pragma.h *********************************************
@@ -100014,7 +103665,7 @@ var aPragmaName = [66]PragmaName{
// should be passed into sqlite3BtreeSetSafetyLevel(). The is done
// to support legacy SQL code. The safety level used to be boolean
// and older scripts may have used numbers 0 for OFF and 1 for ON.
-func getSafetyLevel(tls *crt.TLS, z uintptr, omitFull int32, dflt U8) U8 { /* sqlite3.c:125489:11: */
+func getSafetyLevel(tls *libc.TLS, z uintptr, omitFull int32, dflt U8) U8 { /* sqlite3.c:125789:11: */
// on no off false yes true extra full
var i int32
var n int32
@@ -100031,14 +103682,14 @@ func getSafetyLevel(tls *crt.TLS, z uintptr, omitFull int32, dflt U8) U8 { /* sq
return dflt
}
-var zText = *(*[25]int8)(unsafe.Pointer(ts + 15324 /* "onoffalseyestrue..." */)) /* sqlite3.c:125491:21 */
-var iOffset = [8]U8{U8(0), U8(1), U8(2), U8(4), U8(9), U8(12), U8(15), U8(20)} /* sqlite3.c:125492:19 */
-var iLength = [8]U8{U8(2), U8(2), U8(3), U8(5), U8(3), U8(4), U8(5), U8(4)} /* sqlite3.c:125493:19 */
-var iValue = [8]U8{U8(1), U8(0), U8(0), U8(0), U8(1), U8(1), U8(3), U8(2)} /* sqlite3.c:125494:19 */
+var zText = *(*[25]int8)(unsafe.Pointer(ts + 18307 /* "onoffalseyestrue..." */)) /* sqlite3.c:125791:21 */
+var iOffset = [8]U8{U8(0), U8(1), U8(2), U8(4), U8(9), U8(12), U8(15), U8(20)} /* sqlite3.c:125792:19 */
+var iLength = [8]U8{U8(2), U8(2), U8(3), U8(5), U8(3), U8(4), U8(5), U8(4)} /* sqlite3.c:125793:19 */
+var iValue = [8]U8{U8(1), U8(0), U8(0), U8(0), U8(1), U8(1), U8(3), U8(2)} /* sqlite3.c:125794:19 */
// Interpret the given string as a boolean value.
-func Xsqlite3GetBoolean(tls *crt.TLS, z uintptr, dflt U8) U8 { /* sqlite3.c:125514:19: */
- return (U8(crt.Bool32(int32(getSafetyLevel(tls, z, 1, dflt)) != 0)))
+func Xsqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt U8) U8 { /* sqlite3.c:125814:19: */
+ return (U8(libc.Bool32(int32(getSafetyLevel(tls, z, 1, dflt)) != 0)))
}
// The sqlite3GetBoolean() function is used by other modules but the
@@ -100046,12 +103697,12 @@ func Xsqlite3GetBoolean(tls *crt.TLS, z uintptr, dflt U8) U8 { /* sqlite3.c:1255
// the rest of the file if PRAGMAs are omitted from the build.
// Interpret the given string as a locking mode value.
-func getLockingMode(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:125527:12: */
+func getLockingMode(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125827:12: */
if z != 0 {
- if 0 == Xsqlite3StrICmp(tls, z, ts+15349 /* "exclusive" */) {
+ if 0 == Xsqlite3StrICmp(tls, z, ts+18332 /* "exclusive" */) {
return 1
}
- if 0 == Xsqlite3StrICmp(tls, z, ts+15359 /* "normal" */) {
+ if 0 == Xsqlite3StrICmp(tls, z, ts+18342 /* "normal" */) {
return 0
}
}
@@ -100062,15 +103713,15 @@ func getLockingMode(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:125527:12: */
//
// The following strings, "none", "full" and "incremental" are
// acceptable, as are their numeric equivalents: 0, 1 and 2 respectively.
-func getAutoVacuum(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:125542:12: */
+func getAutoVacuum(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125842:12: */
var i int32
- if 0 == Xsqlite3StrICmp(tls, z, ts+15366 /* "none" */) {
+ if 0 == Xsqlite3StrICmp(tls, z, ts+18349 /* "none" */) {
return 0
}
- if 0 == Xsqlite3StrICmp(tls, z, ts+15371 /* "full" */) {
+ if 0 == Xsqlite3StrICmp(tls, z, ts+18354 /* "full" */) {
return 1
}
- if 0 == Xsqlite3StrICmp(tls, z, ts+15376 /* "incremental" */) {
+ if 0 == Xsqlite3StrICmp(tls, z, ts+18359 /* "incremental" */) {
return 2
}
i = Xsqlite3Atoi(tls, z)
@@ -100085,12 +103736,12 @@ func getAutoVacuum(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:125542:12: */
// Interpret the given string as a temp db location. Return 1 for file
// backed temporary databases, 2 for the Red-Black tree in memory database
// and 0 to use the compile-time default.
-func getTempStore(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:125558:12: */
+func getTempStore(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:125858:12: */
if (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) <= '2') {
return (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) - '0')
- } else if Xsqlite3StrICmp(tls, z, ts+14294 /* "file" */) == 0 {
+ } else if Xsqlite3StrICmp(tls, z, ts+17277 /* "file" */) == 0 {
return 1
- } else if Xsqlite3StrICmp(tls, z, ts+15388 /* "memory" */) == 0 {
+ } else if Xsqlite3StrICmp(tls, z, ts+18371 /* "memory" */) == 0 {
return 2
} else {
return 0
@@ -100100,12 +103751,12 @@ func getTempStore(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:125558:12: */
// Invalidate temp storage, either when the temp storage is changed
// from default, or when 'file' and the temp_store_directory has changed
-func invalidateTempStorage(tls *crt.TLS, pParse uintptr) int32 { /* sqlite3.c:125576:12: */
+func invalidateTempStorage(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:125876:12: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(1)*32)).FpBt != uintptr(0) {
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0) || (Xsqlite3BtreeIsInReadTrans(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(1)*32)).FpBt) != 0) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+15395 /* "temporary storag..." */, 0)
+ ts+18378 /* "temporary storag..." */, 0)
return 1
}
Xsqlite3BtreeClose(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(1)*32)).FpBt)
@@ -100118,7 +103769,7 @@ func invalidateTempStorage(tls *crt.TLS, pParse uintptr) int32 { /* sqlite3.c:12
// If the TEMP database is open, close it and mark the database schema
// as needing reloading. This must be done when using the SQLITE_TEMP_STORE
// or DEFAULT_TEMP_STORE pragmas.
-func changeTempStorage(tls *crt.TLS, pParse uintptr, zStorageType uintptr) int32 { /* sqlite3.c:125598:12: */
+func changeTempStorage(tls *libc.TLS, pParse uintptr, zStorageType uintptr) int32 { /* sqlite3.c:125898:12: */
var ts int32 = getTempStore(tls, zStorageType)
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == ts {
@@ -100132,7 +103783,7 @@ func changeTempStorage(tls *crt.TLS, pParse uintptr, zStorageType uintptr) int32
}
// Set result column names for a pragma.
-func setPragmaResultColumnNames(tls *crt.TLS, v uintptr, pPragma uintptr) { /* sqlite3.c:125613:13: */
+func setPragmaResultColumnNames(tls *libc.TLS, v uintptr, pPragma uintptr) { /* sqlite3.c:125913:13: */
var n U8 = (*PragmaName)(unsafe.Pointer(pPragma)).FnPragCName
Xsqlite3VdbeSetNumCols(tls, v, func() int32 {
if int32(n) == 0 {
@@ -100165,7 +103816,7 @@ func setPragmaResultColumnNames(tls *crt.TLS, v uintptr, pPragma uintptr) { /* s
}
// Generate code to return a single integer value.
-func returnSingleInt(tls *crt.TLS, v uintptr, value I64) { /* sqlite3.c:125632:13: */
+func returnSingleInt(tls *libc.TLS, v uintptr, value I64) { /* sqlite3.c:125932:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*I64)(unsafe.Pointer(bp)) = value
@@ -100175,7 +103826,7 @@ func returnSingleInt(tls *crt.TLS, v uintptr, value I64) { /* sqlite3.c:125632:1
}
// Generate code to return a single text value.
-func returnSingleText(tls *crt.TLS, v uintptr, zValue uintptr) { /* sqlite3.c:125640:13: */
+func returnSingleText(tls *libc.TLS, v uintptr, zValue uintptr) { /* sqlite3.c:125940:13: */
if zValue != 0 {
Xsqlite3VdbeLoadString(tls, v, 1, zValue)
Xsqlite3VdbeAddOp2(tls, v, 80, 1, 1)
@@ -100184,12 +103835,12 @@ func returnSingleText(tls *crt.TLS, v uintptr, zValue uintptr) { /* sqlite3.c:12
// Set the safety_level and pager flags for pager iDb. Or if iDb<0
// set these values for all pagers.
-func setAllPagerFlags(tls *crt.TLS, db uintptr) { /* sqlite3.c:125656:13: */
+func setAllPagerFlags(tls *libc.TLS, db uintptr) { /* sqlite3.c:125956:13: */
if (*Sqlite3)(unsafe.Pointer(db)).FautoCommit != 0 {
var pDb uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaDb
var n int32 = (*Sqlite3)(unsafe.Pointer(db)).FnDb
- for (crt.PostDecInt32(&n, 1)) > 0 {
+ for (libc.PostDecInt32(&n, 1)) > 0 {
if (*Db)(unsafe.Pointer(pDb)).FpBt != 0 {
Xsqlite3BtreeSetPagerFlags(tls, (*Db)(unsafe.Pointer(pDb)).FpBt,
(uint32(U64((*Db)(unsafe.Pointer(pDb)).Fsafety_level) | ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x38)))))
@@ -100200,23 +103851,23 @@ func setAllPagerFlags(tls *crt.TLS, db uintptr) { /* sqlite3.c:125656:13: */
}
// Return a human-readable name for a constraint resolution action.
-func actionName(tls *crt.TLS, action U8) uintptr { /* sqlite3.c:125684:19: */
+func actionName(tls *libc.TLS, action U8) uintptr { /* sqlite3.c:125984:19: */
var zName uintptr
switch int32(action) {
case 8:
- zName = ts + 15457 /* "SET NULL" */
+ zName = ts + 18440 /* "SET NULL" */
break
case 9:
- zName = ts + 15466 /* "SET DEFAULT" */
+ zName = ts + 18449 /* "SET DEFAULT" */
break
case 10:
- zName = ts + 15478 /* "CASCADE" */
+ zName = ts + 18461 /* "CASCADE" */
break
case 7:
- zName = ts + 15486 /* "RESTRICT" */
+ zName = ts + 18469 /* "RESTRICT" */
break
default:
- zName = ts + 15495 /* "NO ACTION" */
+ zName = ts + 18478 /* "NO ACTION" */
break
}
return zName
@@ -100225,7 +103876,7 @@ func actionName(tls *crt.TLS, action U8) uintptr { /* sqlite3.c:125684:19: */
// Parameter eMode must be one of the PAGER_JOURNALMODE_XXX constants
// defined in pager.h. This function returns the associated lowercase
// journal-mode name.
-func Xsqlite3JournalModename(tls *crt.TLS, eMode int32) uintptr { /* sqlite3.c:125704:27: */
+func Xsqlite3JournalModename(tls *libc.TLS, eMode int32) uintptr { /* sqlite3.c:126004:27: */
if eMode == (int32(uint64(unsafe.Sizeof(azModeName)) / uint64(unsafe.Sizeof(uintptr(0))))) {
return uintptr(0)
@@ -100234,11 +103885,11 @@ func Xsqlite3JournalModename(tls *crt.TLS, eMode int32) uintptr { /* sqlite3.c:1
}
var azModeName = [6]uintptr{
- ts + 15505 /* "delete" */, ts + 15512 /* "persist" */, ts + 15520 /* "off" */, ts + 15524 /* "truncate" */, ts + 15388 /* "memory" */, ts + 15533, /* "wal" */
-} /* sqlite3.c:125705:15 */
+ ts + 18488 /* "delete" */, ts + 18495 /* "persist" */, ts + 18503 /* "off" */, ts + 18507 /* "truncate" */, ts + 18371 /* "memory" */, ts + 18516, /* "wal" */
+} /* sqlite3.c:126005:15 */
// Locate a pragma in the aPragmaName[] array.
-func pragmaLocate(tls *crt.TLS, zName uintptr) uintptr { /* sqlite3.c:125726:25: */
+func pragmaLocate(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:126026:25: */
var upr int32
var lwr int32
var mid int32 = 0
@@ -100265,7 +103916,7 @@ func pragmaLocate(tls *crt.TLS, zName uintptr) uintptr { /* sqlite3.c:125726:25:
// Create zero or more entries in the output for the SQL functions
// defined by FuncDef p.
-func pragmaFunclistLine(tls *crt.TLS, v uintptr, p uintptr, isBuiltin int32, showInternFuncs int32) { /* sqlite3.c:125747:13: */
+func pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, showInternFuncs int32) { /* sqlite3.c:126047:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -100280,29 +103931,29 @@ func pragmaFunclistLine(tls *crt.TLS, v uintptr, p uintptr, isBuiltin int32, sho
continue
}
if (*FuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) {
- zType = ts + 15537 /* "w" */
+ zType = ts + 18520 /* "w" */
} else if (*FuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) {
- zType = ts + 15539 /* "a" */
+ zType = ts + 18522 /* "a" */
} else {
- zType = ts + 15541 /* "s" */
+ zType = ts + 18524 /* "s" */
}
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15543, /* "sissii" */
- crt.VaList(bp, (*FuncDef)(unsafe.Pointer(p)).FzName, isBuiltin,
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18526, /* "sissii" */
+ libc.VaList(bp, (*FuncDef)(unsafe.Pointer(p)).FzName, isBuiltin,
zType, azEnc[((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&U32(0x0003))],
int32((*FuncDef)(unsafe.Pointer(p)).FnArg),
(((*FuncDef)(unsafe.Pointer(p)).FfuncFlags&mask)^U32(0x000200000))))
}
}
-var mask U32 = (U32((((0x000000800 | 0x000080000) | 0x000100000) | 0x000200000) | 0x00040000)) /* sqlite3.c:125755:22 */
-var azEnc = [4]uintptr{uintptr(0), ts + 15550 /* "utf8" */, ts + 15555 /* "utf16le" */, ts + 15563 /* "utf16be" */} /* sqlite3.c:125762:23 */
+var mask U32 = (U32((((0x000000800 | 0x000080000) | 0x000100000) | 0x000200000) | 0x00040000)) /* sqlite3.c:126055:22 */
+var azEnc = [4]uintptr{uintptr(0), ts + 18533 /* "utf8" */, ts + 18538 /* "utf16le" */, ts + 18546 /* "utf16be" */} /* sqlite3.c:126062:23 */
// Helper subroutine for PRAGMA integrity_check:
//
// Generate code to output a single-column result row with a value of the
// string held in register 3. Decrement the result count in register 1
// and halt if the maximum number of result rows have been issued.
-func integrityCheckResultRow(tls *crt.TLS, v uintptr) int32 { /* sqlite3.c:125799:12: */
+func integrityCheckResultRow(tls *libc.TLS, v uintptr) int32 { /* sqlite3.c:126099:12: */
var addr int32
Xsqlite3VdbeAddOp2(tls, v, 80, 3, 1)
addr = Xsqlite3VdbeAddOp3(tls, v, 48, 1, (Xsqlite3VdbeCurrentAddr(tls, v) + 2), 1)
@@ -100324,9 +103975,9 @@ func integrityCheckResultRow(tls *crt.TLS, v uintptr) int32 { /* sqlite3.c:12579
// If the left side is "database.id" then pId1 is the database name
// and pId2 is the id. If the left side is just "id" then pId1 is the
// id and pId2 is any empty string.
-func Xsqlite3Pragma(tls *crt.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pValue uintptr, minusFlag int32) { /* sqlite3.c:125823:21: */
- bp := tls.Alloc(540)
- defer tls.Free(540)
+func Xsqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pValue uintptr, minusFlag int32) { /* sqlite3.c:126123:21: */
+ bp := tls.Alloc(548)
+ defer tls.Free(548)
var zLeft uintptr // Nul-terminated UTF-8 string <id>
var zRight uintptr // Nul-terminated UTF-8 string <value>, or NULL
@@ -100349,6 +104000,8 @@ func Xsqlite3Pragma(tls *crt.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pV
var pBt1 uintptr
var b int32
var iReg int32
+ // var x I64 at bp+416, 8
+
// This indicates that no database name was specified as part
// of the PRAGMA command. In this case the locking-mode must be
// set on all attached databases, as well as the main db file.
@@ -100365,27 +104018,26 @@ func Xsqlite3Pragma(tls *crt.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pV
var eMode1 int32 // One of the PAGER_JOURNALMODE_XXX symbols
var ii2 int32
var pPager1 uintptr
- // var iLimit I64 at bp+416, 8
+ // var iLimit I64 at bp+424, 8
var aOp1 uintptr
var iAddr int32
var eAuto int32
var pBt2 uintptr
- // var iLimit1 int32 at bp+424, 4
+ // var iLimit1 int32 at bp+432, 4
var addr int32
var size2 int32
- // var size3 int32 at bp+428, 4
+ // var size3 int32 at bp+436, 4
var ii3 int32
- // var sz Sqlite3_int64 at bp+432, 8
+ // var sz Sqlite3_int64 at bp+440, 8
- // var res int32 at bp+440, 4
+ // var res int32 at bp+448, 4
var iLevel int32
var mask U64
var isHidden int32
- var iTabDb int32
var i int32
var k int32
var nHidden int32
@@ -100398,9 +104050,9 @@ func Xsqlite3Pragma(tls *crt.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pV
var mx int32
var pIdx uintptr
var pTab1 uintptr
- // var azOrigin [3]uintptr at bp+448, 24
+ // var azOrigin [3]uintptr at bp+456, 24
- var iTabDb1 int32
+ var iTabDb int32
var pIdx1 uintptr
var pTab2 uintptr
var i2 int32
@@ -100416,28 +104068,27 @@ func Xsqlite3Pragma(tls *crt.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pV
var j1 uintptr
var i6 int32
var j2 int32
- var iTabDb2 int32
+ var iTabDb1 int32
var i7 int32
var pFK uintptr
var pTab3 uintptr
var iCol int32
var jmp int32
- var iTabDb3 int32
var pFK1 uintptr // A foreign key constraint
var pTab4 uintptr // Child table contain "REFERENCES" keyword
var pParent uintptr // Parent table that child points to
- // var pIdx2 uintptr at bp+472, 8
+ // var pIdx2 uintptr at bp+480, 8
// Index in the parent table
var i8 int32 // Loop counter: Foreign key number for pTab
var j3 int32 // Loop counter: Field of the foreign key
var k1 uintptr // Loop counter: Next table in schema
- var x int32 // result variable
+ var x1 int32 // result variable
var regResult int32 // 3 registers to hold a result row
var regKey int32 // Register to hold key for checking the FK
var regRow int32 // Registers to hold a row from pTab
var addrTop int32 // Top of a loop checking foreign keys
var addrOk int32 // Jump here if the key is OK
- // var aiCols uintptr at bp+480, 8
+ // var aiCols uintptr at bp+488, 8
var pTab5 uintptr // Current table
var pIdx3 uintptr // An index on pTab
@@ -100456,7 +104107,7 @@ func Xsqlite3Pragma(tls *crt.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pV
var jmp6 int32
var kk int32
var jmp21 int32
- // var jmp3 int32 at bp+500, 4
+ // var jmp3 int32 at bp+508, 4
var jmp4 int32
var jmp5 int32
@@ -100466,12 +104117,12 @@ func Xsqlite3Pragma(tls *crt.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pV
var pPk1 uintptr
var pPrior uintptr
var loopTop int32
- // var iDataCur int32 at bp+492, 4
+ // var iDataCur int32 at bp+500, 4
- // var iIdxCur int32 at bp+496, 4
+ // var iIdxCur int32 at bp+504, 4
var r1 int32
- var x1 uintptr // For looping over tables in the schema
+ var x2 uintptr // For looping over tables in the schema
var pTbls uintptr // Set of all tables in the schema
var aRoot uintptr // Array of root page numbers of all btrees
var cnt int32 // Number of entries in aRoot[]
@@ -100480,7 +104131,9 @@ func Xsqlite3Pragma(tls *crt.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pV
var i9 int32
var j4 int32
var addr1 int32
- // var mxErr int32 at bp+488, 4
+ // var mxErr int32 at bp+496, 4
+
+ var pObjTab uintptr // Check only this one table, if not NULL
var isQuick int32
var enc U8
@@ -100502,18 +104155,18 @@ func Xsqlite3Pragma(tls *crt.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, pV
var szThreshold LogEst // Size threshold above which reanalysis is needd
var zSubSql uintptr // SQL statement for the OP_SqlExec opcode
var opMask U32
- // var N Sqlite3_int64 at bp+504, 8
+ // var N Sqlite3_int64 at bp+512, 8
var iPrior Sqlite3_int64
- // var N1 Sqlite3_int64 at bp+512, 8
+ // var N1 Sqlite3_int64 at bp+520, 8
- // var N2 Sqlite3_int64 at bp+520, 8
+ // var N2 Sqlite3_int64 at bp+528, 8
- // var N3 Sqlite3_int64 at bp+528, 8
+ // var N3 Sqlite3_int64 at bp+536, 8
var pBt3 uintptr
var zState uintptr
- // var j5 int32 at bp+536, 4
+ // var j5 int32 at bp+544, 4
var i11 int32
zLeft = uintptr(0)
@@ -100561,7 +104214,7 @@ __4:
if !(minusFlag != 0) {
goto __5
}
- zRight = Xsqlite3MPrintf(tls, db, ts+15571 /* "-%T" */, crt.VaList(bp, pValue))
+ zRight = Xsqlite3MPrintf(tls, db, ts+18554 /* "-%T" */, libc.VaList(bp, pValue))
goto __6
__5:
zRight = Xsqlite3NameFromToken(tls, db, pValue)
@@ -100604,7 +104257,7 @@ __7:
goto __8
}
Xsqlite3VdbeSetNumCols(tls, v, 1)
- Xsqlite3VdbeSetColName(tls, v, 0, 0, *(*uintptr)(unsafe.Pointer(bp + 384 /* &aFcntl[0] */ + uintptr(0)*8)), crt.UintptrFromInt32(-1))
+ Xsqlite3VdbeSetColName(tls, v, 0, 0, *(*uintptr)(unsafe.Pointer(bp + 384 /* &aFcntl[0] */ + uintptr(0)*8)), libc.UintptrFromInt32(-1))
returnSingleText(tls, v, *(*uintptr)(unsafe.Pointer(bp + 384 /* &aFcntl[0] */ + uintptr(0)*8)))
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 384 /* &aFcntl[0] */ + uintptr(0)*8)))
goto pragma_out
@@ -100616,7 +104269,7 @@ __8:
if !(*(*uintptr)(unsafe.Pointer(bp + 384 /* &aFcntl[0] */ + uintptr(0)*8)) != 0) {
goto __10
}
- Xsqlite3ErrorMsg(tls, pParse, ts+696 /* "%s" */, crt.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 384 /* &aFcntl[0] */ + uintptr(0)*8))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+805 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 384 /* &aFcntl[0] */ + uintptr(0)*8))))
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 384 /* &aFcntl[0] */ + uintptr(0)*8)))
__10:
;
@@ -100889,6 +104542,18 @@ __14:
// integrity_check designed to detect most database corruption
// without the overhead of cross-checking indexes. Quick_check
// is linear time wherease integrity_check is O(NlogN).
+ //
+ // The maximum nubmer of errors is 100 by default. A different default
+ // can be specified using a numeric parameter N.
+ //
+ // Or, the parameter N can be the name of a table. In that case, only
+ // the one table named is verified. The freelist is only verified if
+ // the named table is "sqlite_schema" (or one of its aliases).
+ //
+ // All schemas are checked by default. To check just a single
+ // schema, use the form:
+ //
+ // PRAGMA schema.integrity_check;
case 22:
goto __43
@@ -101118,9 +104783,9 @@ __16:
goto __15
__59:
;
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*24)).Fp1 = iDb
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(1)*24)).Fp1 = iDb
- (*VdbeOp)(unsafe.Pointer(aOp + uintptr(6)*24)).Fp1 = -2000
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(0)*32)).Fp1 = iDb
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(1)*32)).Fp1 = iDb
+ (*VdbeOp)(unsafe.Pointer(aOp + uintptr(6)*32)).Fp1 = -2000
goto __58
__57:
size = Xsqlite3AbsInt32(tls, Xsqlite3Atoi(tls, zRight))
@@ -101180,7 +104845,7 @@ __18:
if !(zRight != 0) {
goto __63
}
- if !(Xsqlite3_stricmp(tls, zRight, ts+15575 /* "fast" */) == 0) {
+ if !(Xsqlite3_stricmp(tls, zRight, ts+18558 /* "fast" */) == 0) {
goto __64
}
b = 2
@@ -101229,16 +104894,38 @@ __66:
//
// Return the number of pages in the specified database.
__19:
+ *(*I64)(unsafe.Pointer(bp + 416 /* x */)) = int64(0)
Xsqlite3CodeVerifySchema(tls, pParse, iDb)
- iReg = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
if !((int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(zLeft + uintptr(0))))])) == 'p') {
goto __70
}
Xsqlite3VdbeAddOp2(tls, v, 168, iDb, iReg)
goto __71
__70:
- Xsqlite3VdbeAddOp3(tls, v, 169, iDb, iReg,
- Xsqlite3AbsInt32(tls, Xsqlite3Atoi(tls, zRight)))
+ if !((zRight != 0) && (Xsqlite3DecOrHexToI64(tls, zRight, bp+416 /* &x */) == 0)) {
+ goto __72
+ }
+ if !(*(*I64)(unsafe.Pointer(bp + 416 /* x */)) < int64(0)) {
+ goto __74
+ }
+ *(*I64)(unsafe.Pointer(bp + 416 /* x */)) = int64(0)
+ goto __75
+__74:
+ if !(*(*I64)(unsafe.Pointer(bp + 416 /* x */)) > int64(0xfffffffe)) {
+ goto __76
+ }
+ *(*I64)(unsafe.Pointer(bp + 416 /* x */)) = int64(0xfffffffe)
+__76:
+ ;
+__75:
+ ;
+ goto __73
+__72:
+ *(*I64)(unsafe.Pointer(bp + 416 /* x */)) = int64(0)
+__73:
+ ;
+ Xsqlite3VdbeAddOp3(tls, v, 169, iDb, iReg, int32(*(*I64)(unsafe.Pointer(bp + 416 /* x */))))
__71:
;
Xsqlite3VdbeAddOp2(tls, v, 80, iReg, 1)
@@ -101247,49 +104934,49 @@ __71:
// PRAGMA [schema.]locking_mode
// PRAGMA [schema.]locking_mode = (normal|exclusive)
__20:
- zRet = ts + 15359 /* "normal" */
+ zRet = ts + 18342 /* "normal" */
eMode = getLockingMode(tls, zRight)
if !(((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) && (eMode == -1)) {
- goto __72
+ goto __77
}
// Simple "PRAGMA locking_mode;" statement. This is a query for
// the current default locking mode (which may be different to
// the locking-mode of the main database).
eMode = int32((*Sqlite3)(unsafe.Pointer(db)).FdfltLockMode)
- goto __73
-__72:
+ goto __78
+__77:
if !((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) {
- goto __74
+ goto __79
}
ii1 = 2
-__75:
+__80:
if !(ii1 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
- goto __77
+ goto __82
}
pPager = Xsqlite3BtreePager(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii1)*32)).FpBt)
Xsqlite3PagerLockingMode(tls, pPager, eMode)
- goto __76
-__76:
+ goto __81
+__81:
ii1++
- goto __75
- goto __77
-__77:
+ goto __80
+ goto __82
+__82:
;
(*Sqlite3)(unsafe.Pointer(db)).FdfltLockMode = U8(eMode)
-__74:
+__79:
;
pPager = Xsqlite3BtreePager(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
eMode = Xsqlite3PagerLockingMode(tls, pPager, eMode)
-__73:
+__78:
;
if !(eMode == 1) {
- goto __78
+ goto __83
}
- zRet = ts + 15349 /* "exclusive" */
-__78:
+ zRet = ts + 18332 /* "exclusive" */
+__83:
;
returnSingleText(tls, v, zRet)
goto __15
@@ -101300,76 +104987,76 @@ __78:
__21: // Loop counter
if !(zRight == uintptr(0)) {
- goto __79
+ goto __84
}
// If there is no "=MODE" part of the pragma, do a query for the
// current mode
eMode1 = -1
- goto __80
-__79:
+ goto __85
+__84:
n = Xsqlite3Strlen30(tls, zRight)
eMode1 = 0
-__81:
- if !((crt.AssignUintptr(&zMode, Xsqlite3JournalModename(tls, eMode1))) != uintptr(0)) {
- goto __83
+__86:
+ if !((libc.AssignUintptr(&zMode, Xsqlite3JournalModename(tls, eMode1))) != uintptr(0)) {
+ goto __88
}
if !(Xsqlite3_strnicmp(tls, zRight, zMode, n) == 0) {
- goto __84
+ goto __89
}
- goto __83
-__84:
+ goto __88
+__89:
;
- goto __82
-__82:
+ goto __87
+__87:
eMode1++
- goto __81
- goto __83
-__83:
+ goto __86
+ goto __88
+__88:
;
if !(!(zMode != 0)) {
- goto __85
+ goto __90
}
// If the "=MODE" part does not match any known journal mode,
// then do a query
eMode1 = -1
-__85:
+__90:
;
if !((eMode1 == 2) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x10000000)) != uint64(0))) {
- goto __86
+ goto __91
}
// Do not allow journal-mode "OFF" in defensive since the database
// can become corrupted using ordinary SQL when the journal is off
eMode1 = -1
-__86:
+__91:
;
-__80:
+__85:
;
if !((eMode1 == (-1)) && ((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0))) {
- goto __87
+ goto __92
}
// Convert "PRAGMA journal_mode" into "PRAGMA main.journal_mode"
iDb = 0
(*Token)(unsafe.Pointer(pId2)).Fn = uint32(1)
-__87:
+__92:
;
ii2 = ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1)
-__88:
+__93:
if !(ii2 >= 0) {
- goto __90
+ goto __95
}
if !(((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii2)*32)).FpBt != 0) && ((ii2 == iDb) || ((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)))) {
- goto __91
+ goto __96
}
Xsqlite3VdbeUsesBtree(tls, v, ii2)
Xsqlite3VdbeAddOp3(tls, v, 7, ii2, 1, eMode1)
-__91:
+__96:
;
- goto __89
-__89:
+ goto __94
+__94:
ii2--
- goto __88
- goto __90
-__90:
+ goto __93
+ goto __95
+__95:
;
Xsqlite3VdbeAddOp2(tls, v, 80, 1, 1)
goto __15
@@ -101380,21 +105067,21 @@ __90:
// Get or set the size limit on rollback journal files.
__22:
pPager1 = Xsqlite3BtreePager(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
- *(*I64)(unsafe.Pointer(bp + 416 /* iLimit */)) = int64(-2)
+ *(*I64)(unsafe.Pointer(bp + 424 /* iLimit */)) = int64(-2)
if !(zRight != 0) {
- goto __92
+ goto __97
}
- Xsqlite3DecOrHexToI64(tls, zRight, bp+416 /* &iLimit */)
- if !(*(*I64)(unsafe.Pointer(bp + 416 /* iLimit */)) < int64(-1)) {
- goto __93
+ Xsqlite3DecOrHexToI64(tls, zRight, bp+424 /* &iLimit */)
+ if !(*(*I64)(unsafe.Pointer(bp + 424 /* iLimit */)) < int64(-1)) {
+ goto __98
}
- *(*I64)(unsafe.Pointer(bp + 416 /* iLimit */)) = int64(-1)
-__93:
+ *(*I64)(unsafe.Pointer(bp + 424 /* iLimit */)) = int64(-1)
+__98:
;
-__92:
+__97:
;
- *(*I64)(unsafe.Pointer(bp + 416 /* iLimit */)) = Xsqlite3PagerJournalSizeLimit(tls, pPager1, *(*I64)(unsafe.Pointer(bp + 416 /* iLimit */)))
- returnSingleInt(tls, v, *(*I64)(unsafe.Pointer(bp + 416 /* iLimit */)))
+ *(*I64)(unsafe.Pointer(bp + 424 /* iLimit */)) = Xsqlite3PagerJournalSizeLimit(tls, pPager1, *(*I64)(unsafe.Pointer(bp + 424 /* iLimit */)))
+ returnSingleInt(tls, v, *(*I64)(unsafe.Pointer(bp + 424 /* iLimit */)))
goto __15
// PRAGMA [schema.]auto_vacuum
@@ -101406,11 +105093,11 @@ __23:
pBt2 = (*Db)(unsafe.Pointer(pDb)).FpBt
if !(!(zRight != 0)) {
- goto __94
+ goto __99
}
returnSingleInt(tls, v, int64(Xsqlite3BtreeGetAutoVacuum(tls, pBt2)))
- goto __95
-__94:
+ goto __100
+__99:
eAuto = getAutoVacuum(tls, zRight)
(*Sqlite3)(unsafe.Pointer(db)).FnextAutovac = int8(U8(eAuto))
@@ -101420,26 +105107,26 @@ __94:
// as an auto-vacuum capable db.
rc = Xsqlite3BtreeSetAutoVacuum(tls, pBt2, eAuto)
if !((rc == 0) && ((eAuto == 1) || (eAuto == 2))) {
- goto __96
+ goto __101
}
iAddr = Xsqlite3VdbeCurrentAddr(tls, v)
aOp1 = Xsqlite3VdbeAddOpList(tls, v, (int32(uint64(unsafe.Sizeof(setMeta6)) / uint64(unsafe.Sizeof(VdbeOpList{})))), uintptr(unsafe.Pointer(&setMeta6)), iLn4)
if !(0 != 0) {
- goto __97
+ goto __102
}
goto __15
-__97:
+__102:
;
- (*VdbeOp)(unsafe.Pointer(aOp1 + uintptr(0)*24)).Fp1 = iDb
- (*VdbeOp)(unsafe.Pointer(aOp1 + uintptr(1)*24)).Fp1 = iDb
- (*VdbeOp)(unsafe.Pointer(aOp1 + uintptr(2)*24)).Fp2 = (iAddr + 4)
- (*VdbeOp)(unsafe.Pointer(aOp1 + uintptr(4)*24)).Fp1 = iDb
- (*VdbeOp)(unsafe.Pointer(aOp1 + uintptr(4)*24)).Fp3 = (eAuto - 1)
+ (*VdbeOp)(unsafe.Pointer(aOp1 + uintptr(0)*32)).Fp1 = iDb
+ (*VdbeOp)(unsafe.Pointer(aOp1 + uintptr(1)*32)).Fp1 = iDb
+ (*VdbeOp)(unsafe.Pointer(aOp1 + uintptr(2)*32)).Fp2 = (iAddr + 4)
+ (*VdbeOp)(unsafe.Pointer(aOp1 + uintptr(4)*32)).Fp1 = iDb
+ (*VdbeOp)(unsafe.Pointer(aOp1 + uintptr(4)*32)).Fp3 = (eAuto - 1)
Xsqlite3VdbeUsesBtree(tls, v, iDb)
-__96:
+__101:
;
-__95:
+__100:
;
goto __15
@@ -101447,14 +105134,14 @@ __95:
//
// Do N steps of incremental vacuuming on a database.
__24:
- if !(((zRight == uintptr(0)) || !(Xsqlite3GetInt32(tls, zRight, bp+424 /* &iLimit1 */) != 0)) || (*(*int32)(unsafe.Pointer(bp + 424 /* iLimit1 */)) <= 0)) {
- goto __98
+ if !(((zRight == uintptr(0)) || !(Xsqlite3GetInt32(tls, zRight, bp+432 /* &iLimit1 */) != 0)) || (*(*int32)(unsafe.Pointer(bp + 432 /* iLimit1 */)) <= 0)) {
+ goto __103
}
- *(*int32)(unsafe.Pointer(bp + 424 /* iLimit1 */)) = 0x7fffffff
-__98:
+ *(*int32)(unsafe.Pointer(bp + 432 /* iLimit1 */)) = 0x7fffffff
+__103:
;
Xsqlite3BeginWriteOperation(tls, pParse, 0, iDb)
- Xsqlite3VdbeAddOp2(tls, v, 69, *(*int32)(unsafe.Pointer(bp + 424 /* iLimit1 */)), 1)
+ Xsqlite3VdbeAddOp2(tls, v, 69, *(*int32)(unsafe.Pointer(bp + 432 /* iLimit1 */)), 1)
addr = Xsqlite3VdbeAddOp1(tls, v, 60, iDb)
Xsqlite3VdbeAddOp1(tls, v, 80, 1)
Xsqlite3VdbeAddOp2(tls, v, 82, 1, -1)
@@ -101474,15 +105161,15 @@ __98:
__25:
;
if !(!(zRight != 0)) {
- goto __99
+ goto __104
}
returnSingleInt(tls, v, int64((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size))
- goto __100
-__99:
+ goto __105
+__104:
size2 = Xsqlite3Atoi(tls, zRight)
(*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size = size2
Xsqlite3BtreeSetCacheSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size)
-__100:
+__105:
;
goto __15
@@ -101509,7 +105196,7 @@ __100:
__26:
;
if !(!(zRight != 0)) {
- goto __101
+ goto __106
}
returnSingleInt(tls, v,
func() int64 {
@@ -101518,26 +105205,26 @@ __26:
}
return int64(Xsqlite3BtreeSetSpillSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, 0))
}())
- goto __102
-__101:
- *(*int32)(unsafe.Pointer(bp + 428 /* size3 */)) = 1
- if !(Xsqlite3GetInt32(tls, zRight, bp+428 /* &size3 */) != 0) {
- goto __103
+ goto __107
+__106:
+ *(*int32)(unsafe.Pointer(bp + 436 /* size3 */)) = 1
+ if !(Xsqlite3GetInt32(tls, zRight, bp+436 /* &size3 */) != 0) {
+ goto __108
}
- Xsqlite3BtreeSetSpillSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, *(*int32)(unsafe.Pointer(bp + 428 /* size3 */)))
-__103:
+ Xsqlite3BtreeSetSpillSize(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, *(*int32)(unsafe.Pointer(bp + 436 /* size3 */)))
+__108:
;
- if !(Xsqlite3GetBoolean(tls, zRight, (uint8(crt.Bool32(*(*int32)(unsafe.Pointer(bp + 428 /* size3 */)) != 0)))) != 0) {
- goto __104
+ if !(Xsqlite3GetBoolean(tls, zRight, (uint8(libc.Bool32(*(*int32)(unsafe.Pointer(bp + 436 /* size3 */)) != 0)))) != 0) {
+ goto __109
}
*(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(0x00000020))
- goto __105
-__104:
- *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(crt.Uint64FromUint64(uint64(0x00000020))))
-__105:
+ goto __110
+__109:
+ *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(libc.Uint64FromUint64(uint64(0x00000020))))
+__110:
;
setAllPagerFlags(tls, db)
-__102:
+__107:
;
goto __15
@@ -101556,57 +105243,57 @@ __102:
__27:
;
if !(zRight != 0) {
- goto __106
+ goto __111
}
- Xsqlite3DecOrHexToI64(tls, zRight, bp+432 /* &sz */)
- if !(*(*Sqlite3_int64)(unsafe.Pointer(bp + 432 /* sz */)) < int64(0)) {
- goto __107
+ Xsqlite3DecOrHexToI64(tls, zRight, bp+440 /* &sz */)
+ if !(*(*Sqlite3_int64)(unsafe.Pointer(bp + 440 /* sz */)) < int64(0)) {
+ goto __112
}
- *(*Sqlite3_int64)(unsafe.Pointer(bp + 432 /* sz */)) = Xsqlite3Config.FszMmap
-__107:
+ *(*Sqlite3_int64)(unsafe.Pointer(bp + 440 /* sz */)) = Xsqlite3Config.FszMmap
+__112:
;
if !((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)) {
- goto __108
+ goto __113
}
- (*Sqlite3)(unsafe.Pointer(db)).FszMmap = *(*Sqlite3_int64)(unsafe.Pointer(bp + 432 /* sz */))
-__108:
+ (*Sqlite3)(unsafe.Pointer(db)).FszMmap = *(*Sqlite3_int64)(unsafe.Pointer(bp + 440 /* sz */))
+__113:
;
ii3 = ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1)
-__109:
+__114:
if !(ii3 >= 0) {
- goto __111
+ goto __116
}
if !(((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii3)*32)).FpBt != 0) && ((ii3 == iDb) || ((*Token)(unsafe.Pointer(pId2)).Fn == uint32(0)))) {
- goto __112
+ goto __117
}
- Xsqlite3BtreeSetMmapLimit(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii3)*32)).FpBt, *(*Sqlite3_int64)(unsafe.Pointer(bp + 432 /* sz */)))
-__112:
+ Xsqlite3BtreeSetMmapLimit(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(ii3)*32)).FpBt, *(*Sqlite3_int64)(unsafe.Pointer(bp + 440 /* sz */)))
+__117:
;
- goto __110
-__110:
+ goto __115
+__115:
ii3--
- goto __109
- goto __111
-__111:
+ goto __114
+ goto __116
+__116:
;
-__106:
+__111:
;
- *(*Sqlite3_int64)(unsafe.Pointer(bp + 432 /* sz */)) = int64(-1)
- rc = Xsqlite3_file_control(tls, db, zDb, 18, bp+432 /* &sz */)
+ *(*Sqlite3_int64)(unsafe.Pointer(bp + 440 /* sz */)) = int64(-1)
+ rc = Xsqlite3_file_control(tls, db, zDb, 18, bp+440 /* &sz */)
if !(rc == 0) {
- goto __113
+ goto __118
}
- returnSingleInt(tls, v, *(*Sqlite3_int64)(unsafe.Pointer(bp + 432 /* sz */)))
- goto __114
-__113:
+ returnSingleInt(tls, v, *(*Sqlite3_int64)(unsafe.Pointer(bp + 440 /* sz */)))
+ goto __119
+__118:
if !(rc != 12) {
- goto __115
+ goto __120
}
(*Parse)(unsafe.Pointer(pParse)).FnErr++
(*Parse)(unsafe.Pointer(pParse)).Frc = rc
-__115:
+__120:
;
-__114:
+__119:
;
goto __15
@@ -101621,13 +105308,13 @@ __114:
// override this setting
__28:
if !(!(zRight != 0)) {
- goto __116
+ goto __121
}
returnSingleInt(tls, v, int64((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store))
- goto __117
-__116:
+ goto __122
+__121:
changeTempStorage(tls, pParse, zRight)
-__117:
+__122:
;
goto __15
@@ -101641,43 +105328,43 @@ __117:
//
__29:
if !(!(zRight != 0)) {
- goto __118
+ goto __123
}
returnSingleText(tls, v, Xsqlite3_temp_directory)
- goto __119
-__118:
+ goto __124
+__123:
if !(*(*int8)(unsafe.Pointer(zRight + uintptr(0))) != 0) {
- goto __120
+ goto __125
}
- rc = Xsqlite3OsAccess(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, zRight, 1, bp+440 /* &res */)
- if !((rc != 0) || (*(*int32)(unsafe.Pointer(bp + 440 /* res */)) == 0)) {
- goto __121
+ rc = Xsqlite3OsAccess(tls, (*Sqlite3)(unsafe.Pointer(db)).FpVfs, zRight, 1, bp+448 /* &res */)
+ if !((rc != 0) || (*(*int32)(unsafe.Pointer(bp + 448 /* res */)) == 0)) {
+ goto __126
}
- Xsqlite3ErrorMsg(tls, pParse, ts+15580 /* "not a writable d..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+18563 /* "not a writable d..." */, 0)
goto pragma_out
-__121:
+__126:
;
-__120:
+__125:
;
if !(((1 == 0) ||
((1 == 1) && (int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) <= 1))) ||
((1 == 2) && (int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == 1))) {
- goto __122
+ goto __127
}
invalidateTempStorage(tls, pParse)
-__122:
+__127:
;
Xsqlite3_free(tls, Xsqlite3_temp_directory)
if !(*(*int8)(unsafe.Pointer(zRight + uintptr(0))) != 0) {
- goto __123
+ goto __128
}
- Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, ts+696 /* "%s" */, crt.VaList(bp+16, zRight))
- goto __124
-__123:
+ Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+16, zRight))
+ goto __129
+__128:
Xsqlite3_temp_directory = uintptr(0)
-__124:
+__129:
;
-__119:
+__124:
;
goto __15
@@ -101690,71 +105377,71 @@ __119:
// opened.
__30:
if !(!(zRight != 0)) {
- goto __125
+ goto __130
}
returnSingleInt(tls, v, (int64(int32((*Db)(unsafe.Pointer(pDb)).Fsafety_level) - 1)))
- goto __126
-__125:
+ goto __131
+__130:
if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) {
- goto __127
+ goto __132
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+15605 /* "Safety level may..." */, 0)
- goto __128
-__127:
+ ts+18588 /* "Safety level may..." */, 0)
+ goto __133
+__132:
if !(iDb != 1) {
- goto __129
+ goto __134
}
iLevel = ((int32(getSafetyLevel(tls, zRight, 0, uint8(1))) + 1) & 0x07)
if !(iLevel == 0) {
- goto __130
+ goto __135
}
iLevel = 1
-__130:
+__135:
;
(*Db)(unsafe.Pointer(pDb)).Fsafety_level = U8(iLevel)
(*Db)(unsafe.Pointer(pDb)).FbSyncSet = U8(1)
setAllPagerFlags(tls, db)
-__129:
+__134:
;
-__128:
+__133:
;
-__126:
+__131:
;
goto __15
__31:
if !(zRight == uintptr(0)) {
- goto __131
+ goto __136
}
setPragmaResultColumnNames(tls, v, pPragma)
- returnSingleInt(tls, v, (int64(crt.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (*PragmaName)(unsafe.Pointer(pPragma)).FiArg) != uint64(0)))))
- goto __132
-__131:
+ returnSingleInt(tls, v, (int64(libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & (*PragmaName)(unsafe.Pointer(pPragma)).FiArg) != uint64(0)))))
+ goto __137
+__136:
mask = (*PragmaName)(unsafe.Pointer(pPragma)).FiArg // Mask of bits to set or clear.
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0) {
- goto __133
+ goto __138
}
// Foreign key support may not be enabled or disabled while not
// in auto-commit mode.
- mask = mask & (^uint64(crt.Int32FromInt32(0x00004000)))
-__133:
+ mask = mask & (^uint64(libc.Int32FromInt32(0x00004000)))
+__138:
;
if !(Xsqlite3GetBoolean(tls, zRight, uint8(0)) != 0) {
- goto __134
+ goto __139
}
*(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (mask)
- goto __135
-__134:
+ goto __140
+__139:
*(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^mask)
if !(mask == uint64(0x00080000)) {
- goto __136
+ goto __141
}
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0)
-__136:
+__141:
;
-__135:
+__140:
;
// Many of the flag-pragmas modify the code generated by the SQL
@@ -101762,7 +105449,7 @@ __135:
// compiled SQL statements after modifying a pragma value.
Xsqlite3VdbeAddOp0(tls, v, 158)
setAllPagerFlags(tls, db)
-__132:
+__137:
;
goto __15
@@ -101779,93 +105466,92 @@ __132:
// pk: Non-zero for PK fields.
__32:
if !(zRight != 0) {
- goto __137
+ goto __142
}
+ Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb)
pTab = Xsqlite3LocateTable(tls, pParse, uint32(0x02), zRight, zDb)
if !(pTab != 0) {
- goto __138
+ goto __143
}
- iTabDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
nHidden = 0
pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
(*Parse)(unsafe.Pointer(pParse)).FnMem = 7
- Xsqlite3CodeVerifySchema(tls, pParse, iTabDb)
Xsqlite3ViewGetColumnNames(tls, pParse, pTab)
i = 0
pCol = (*Table)(unsafe.Pointer(pTab)).FaCol
-__139:
+__144:
if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
- goto __141
+ goto __146
}
isHidden = 0
if !((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0062) != 0) {
- goto __142
+ goto __147
}
if !((*PragmaName)(unsafe.Pointer(pPragma)).FiArg == uint64(0)) {
- goto __143
+ goto __148
}
nHidden++
- goto __140
-__143:
+ goto __145
+__148:
;
if !((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0020) != 0) {
- goto __144
+ goto __149
}
isHidden = 2
- goto __145
-__144:
+ goto __150
+__149:
if !((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0040) != 0) {
- goto __146
+ goto __151
}
isHidden = 3
- goto __147
-__146:
+ goto __152
+__151:
;
isHidden = 1
-__147:
+__152:
;
-__145:
+__150:
;
-__142:
+__147:
;
if !((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0001) == 0) {
- goto __148
+ goto __153
}
k = 0
- goto __149
-__148:
+ goto __154
+__153:
if !(pPk == uintptr(0)) {
- goto __150
+ goto __155
}
k = 1
- goto __151
-__150:
+ goto __156
+__155:
k = 1
-__152:
+__157:
if !((k <= int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && (int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr((k-1))*2))) != i)) {
- goto __154
+ goto __159
}
- goto __153
-__153:
+ goto __158
+__158:
k++
- goto __152
- goto __154
-__154:
+ goto __157
+ goto __159
+__159:
;
-__151:
+__156:
;
-__149:
+__154:
;
Xsqlite3VdbeMultiLoad(tls, v, 1, func() uintptr {
if (*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 {
- return ts + 15658 /* "issisii" */
+ return ts + 18641 /* "issisii" */
}
- return ts + 15666 /* "issisi" */
+ return ts + 18649 /* "issisi" */
}(),
- crt.VaList(bp+24, (i-nHidden),
+ libc.VaList(bp+24, (i-nHidden),
(*Column)(unsafe.Pointer(pCol)).FzName,
- Xsqlite3ColumnType(tls, pCol, ts+672 /* "" */),
+ Xsqlite3ColumnType(tls, pCol, ts+781 /* "" */),
func() int32 {
if (*Column)(unsafe.Pointer(pCol)).FnotNull != 0 {
return 1
@@ -101880,67 +105566,67 @@ __149:
}(),
k,
isHidden))
- goto __140
-__140:
+ goto __145
+__145:
i++
pCol += 32
- goto __139
- goto __141
-__141:
+ goto __144
+ goto __146
+__146:
;
-__138:
+__143:
;
-__137:
+__142:
;
goto __15
__33:
if !(zRight != 0) {
- goto __155
+ goto __160
}
pIdx = Xsqlite3FindIndex(tls, db, zRight, zDb)
if !(pIdx == uintptr(0)) {
- goto __156
+ goto __161
}
// If there is no index named zRight, check to see if there is a
// WITHOUT ROWID table named zRight, and if there is, show the
// structure of the PRIMARY KEY index for that table.
pTab1 = Xsqlite3LocateTable(tls, pParse, uint32(0x02), zRight, zDb)
if !((pTab1 != 0) && !(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(0x0080)) == U32(0))) {
- goto __157
+ goto __162
}
pIdx = Xsqlite3PrimaryKeyIndex(tls, pTab1)
-__157:
+__162:
;
-__156:
+__161:
;
if !(pIdx != 0) {
- goto __158
+ goto __163
}
iIdxDb = Xsqlite3SchemaToIndex(tls, db, (*Index)(unsafe.Pointer(pIdx)).FpSchema)
if !((*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0) {
- goto __159
+ goto __164
}
// PRAGMA index_xinfo (newer version with more rows and columns)
mx = int32((*Index)(unsafe.Pointer(pIdx)).FnColumn)
(*Parse)(unsafe.Pointer(pParse)).FnMem = 6
- goto __160
-__159:
+ goto __165
+__164:
// PRAGMA index_info (legacy version)
mx = int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)
(*Parse)(unsafe.Pointer(pParse)).FnMem = 3
-__160:
+__165:
;
pTab1 = (*Index)(unsafe.Pointer(pIdx)).FpTable
Xsqlite3CodeVerifySchema(tls, pParse, iIdxDb)
i1 = 0
-__161:
+__166:
if !(i1 < mx) {
- goto __163
+ goto __168
}
cnum = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i1)*2))
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15673 /* "iisX" */, crt.VaList(bp+80, i1, int32(cnum),
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18656 /* "iisX" */, libc.VaList(bp+80, i1, int32(cnum),
func() uintptr {
if int32(cnum) < 0 {
return uintptr(0)
@@ -101948,241 +105634,241 @@ __161:
return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab1)).FaCol + uintptr(cnum)*32)).FzName
}()))
if !((*PragmaName)(unsafe.Pointer(pPragma)).FiArg != 0) {
- goto __164
+ goto __169
}
- Xsqlite3VdbeMultiLoad(tls, v, 4, ts+15678, /* "isiX" */
- crt.VaList(bp+104, int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))),
+ Xsqlite3VdbeMultiLoad(tls, v, 4, ts+18661, /* "isiX" */
+ libc.VaList(bp+104, int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))),
*(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)),
- (crt.Bool32(i1 < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)))))
-__164:
+ (libc.Bool32(i1 < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)))))
+__169:
;
Xsqlite3VdbeAddOp2(tls, v, 80, 1, (*Parse)(unsafe.Pointer(pParse)).FnMem)
- goto __162
-__162:
+ goto __167
+__167:
i1++
- goto __161
- goto __163
-__163:
+ goto __166
+ goto __168
+__168:
;
-__158:
+__163:
;
-__155:
+__160:
;
goto __15
__34:
if !(zRight != 0) {
- goto __165
+ goto __170
}
pTab2 = Xsqlite3FindTable(tls, db, zRight, zDb)
if !(pTab2 != 0) {
- goto __166
+ goto __171
}
- iTabDb1 = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab2)).FpSchema)
+ iTabDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab2)).FpSchema)
(*Parse)(unsafe.Pointer(pParse)).FnMem = 5
- Xsqlite3CodeVerifySchema(tls, pParse, iTabDb1)
+ Xsqlite3CodeVerifySchema(tls, pParse, iTabDb)
pIdx1 = (*Table)(unsafe.Pointer(pTab2)).FpIndex
i2 = 0
-__167:
+__172:
if !(pIdx1 != 0) {
- goto __169
+ goto __174
}
- *(*[3]uintptr)(unsafe.Pointer(bp + 448 /* azOrigin */)) = [3]uintptr{ts + 15683 /* "c" */, ts + 15685 /* "u" */, ts + 14193 /* "pk" */}
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15687, /* "isisi" */
- crt.VaList(bp+128, i2,
+ *(*[3]uintptr)(unsafe.Pointer(bp + 456 /* azOrigin */)) = [3]uintptr{ts + 18666 /* "c" */, ts + 18668 /* "u" */, ts + 17182 /* "pk" */}
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18670, /* "isisi" */
+ libc.VaList(bp+128, i2,
(*Index)(unsafe.Pointer(pIdx1)).FzName,
- (crt.Bool32(int32((*Index)(unsafe.Pointer((pIdx1))).FonError) != 0)),
- *(*uintptr)(unsafe.Pointer(bp + 448 /* &azOrigin[0] */ + uintptr(uint32(int32(*(*uint16)(unsafe.Pointer(pIdx1 + 100 /* &.idxType */))&0x3>>0)))*8)),
- (crt.Bool32((*Index)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))))
- goto __168
-__168:
+ (libc.Bool32(int32((*Index)(unsafe.Pointer((pIdx1))).FonError) != 0)),
+ *(*uintptr)(unsafe.Pointer(bp + 456 /* &azOrigin[0] */ + uintptr(uint32(int32(*(*uint16)(unsafe.Pointer(pIdx1 + 100 /* &.idxType */))&0x3>>0)))*8)),
+ (libc.Bool32((*Index)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))))
+ goto __173
+__173:
pIdx1 = (*Index)(unsafe.Pointer(pIdx1)).FpNext
i2++
- goto __167
- goto __169
-__169:
+ goto __172
+ goto __174
+__174:
;
-__166:
+__171:
;
-__165:
+__170:
;
goto __15
__35:
(*Parse)(unsafe.Pointer(pParse)).FnMem = 3
i3 = 0
-__170:
+__175:
if !(i3 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
- goto __172
+ goto __177
}
if !((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*32)).FpBt == uintptr(0)) {
- goto __173
+ goto __178
}
- goto __171
-__173:
+ goto __176
+__178:
;
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15693, /* "iss" */
- crt.VaList(bp+168, i3,
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18676, /* "iss" */
+ libc.VaList(bp+168, i3,
(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*32)).FzDbSName,
Xsqlite3BtreeGetFilename(tls, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i3)*32)).FpBt)))
- goto __171
-__171:
+ goto __176
+__176:
i3++
- goto __170
- goto __172
-__172:
+ goto __175
+ goto __177
+__177:
;
goto __15
__36:
i4 = 0
(*Parse)(unsafe.Pointer(pParse)).FnMem = 2
- p = (*Hash)(unsafe.Pointer((db + 576 /* &.aCollSeq */))).Ffirst
-__174:
+ p = (*Hash)(unsafe.Pointer((db + 600 /* &.aCollSeq */))).Ffirst
+__179:
if !(p != 0) {
- goto __176
+ goto __181
}
pColl = (*HashElem)(unsafe.Pointer(p)).Fdata
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15697 /* "is" */, crt.VaList(bp+192, crt.PostIncInt32(&i4, 1), (*CollSeq)(unsafe.Pointer(pColl)).FzName))
- goto __175
-__175:
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18680 /* "is" */, libc.VaList(bp+192, libc.PostIncInt32(&i4, 1), (*CollSeq)(unsafe.Pointer(pColl)).FzName))
+ goto __180
+__180:
p = (*HashElem)(unsafe.Pointer(p)).Fnext
- goto __174
- goto __176
-__176:
+ goto __179
+ goto __181
+__181:
;
goto __15
__37:
- showInternFunc = (crt.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0020)) != U32(0)))
+ showInternFunc = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0020)) != U32(0)))
(*Parse)(unsafe.Pointer(pParse)).FnMem = 6
i5 = 0
-__177:
+__182:
if !(i5 < 23) {
- goto __179
+ goto __184
}
p1 = *(*uintptr)(unsafe.Pointer((uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)) /* &.a */) + uintptr(i5)*8))
-__180:
+__185:
if !(p1 != 0) {
- goto __182
+ goto __187
}
pragmaFunclistLine(tls, v, p1, 1, showInternFunc)
- goto __181
-__181:
+ goto __186
+__186:
p1 = *(*uintptr)(unsafe.Pointer(p1 + 64 /* &.u */))
- goto __180
- goto __182
-__182:
+ goto __185
+ goto __187
+__187:
;
- goto __178
-__178:
+ goto __183
+__183:
i5++
- goto __177
- goto __179
-__179:
+ goto __182
+ goto __184
+__184:
;
- j = (*Hash)(unsafe.Pointer((db + 552 /* &.aFunc */))).Ffirst
-__183:
+ j = (*Hash)(unsafe.Pointer((db + 576 /* &.aFunc */))).Ffirst
+__188:
if !(j != 0) {
- goto __185
+ goto __190
}
p1 = (*HashElem)(unsafe.Pointer(j)).Fdata
pragmaFunclistLine(tls, v, p1, 0, showInternFunc)
- goto __184
-__184:
+ goto __189
+__189:
j = (*HashElem)(unsafe.Pointer(j)).Fnext
- goto __183
- goto __185
-__185:
+ goto __188
+ goto __190
+__190:
;
goto __15
__38:
(*Parse)(unsafe.Pointer(pParse)).FnMem = 1
- j1 = (*Hash)(unsafe.Pointer((db + 504 /* &.aModule */))).Ffirst
-__186:
+ j1 = (*Hash)(unsafe.Pointer((db + 528 /* &.aModule */))).Ffirst
+__191:
if !(j1 != 0) {
- goto __188
+ goto __193
}
pMod = (*HashElem)(unsafe.Pointer(j1)).Fdata
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15541 /* "s" */, crt.VaList(bp+208, (*Module)(unsafe.Pointer(pMod)).FzName))
- goto __187
-__187:
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18524 /* "s" */, libc.VaList(bp+208, (*Module)(unsafe.Pointer(pMod)).FzName))
+ goto __192
+__192:
j1 = (*HashElem)(unsafe.Pointer(j1)).Fnext
- goto __186
- goto __188
-__188:
+ goto __191
+ goto __193
+__193:
;
goto __15
__39:
i6 = 0
-__189:
+__194:
if !(i6 < (int32(uint64(unsafe.Sizeof(aPragmaName)) / uint64(unsafe.Sizeof(PragmaName{}))))) {
- goto __191
+ goto __196
}
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15541 /* "s" */, crt.VaList(bp+216, aPragmaName[i6].FzName))
- goto __190
-__190:
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18524 /* "s" */, libc.VaList(bp+216, aPragmaName[i6].FzName))
+ goto __195
+__195:
i6++
- goto __189
- goto __191
-__191:
+ goto __194
+ goto __196
+__196:
;
goto __15
__40:
if !(zRight != 0) {
- goto __192
+ goto __197
}
pTab3 = Xsqlite3FindTable(tls, db, zRight, zDb)
if !(pTab3 != 0) {
- goto __193
+ goto __198
}
pFK = (*Table)(unsafe.Pointer(pTab3)).FpFKey
if !(pFK != 0) {
- goto __194
+ goto __199
}
- iTabDb2 = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab3)).FpSchema)
+ iTabDb1 = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab3)).FpSchema)
i7 = 0
(*Parse)(unsafe.Pointer(pParse)).FnMem = 8
- Xsqlite3CodeVerifySchema(tls, pParse, iTabDb2)
-__195:
+ Xsqlite3CodeVerifySchema(tls, pParse, iTabDb1)
+__200:
if !(pFK != 0) {
- goto __196
+ goto __201
}
j2 = 0
-__197:
+__202:
if !(j2 < (*FKey)(unsafe.Pointer(pFK)).FnCol) {
- goto __199
+ goto __204
}
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15700, /* "iissssss" */
- crt.VaList(bp+224, i7,
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18683, /* "iissssss" */
+ libc.VaList(bp+224, i7,
j2,
(*FKey)(unsafe.Pointer(pFK)).FzTo,
(*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab3)).FaCol+uintptr((*sColMap)(unsafe.Pointer((pFK+64 /* &.aCol */)+uintptr(j2)*16)).FiFrom)*32)).FzName,
(*sColMap)(unsafe.Pointer((pFK+64 /* &.aCol */)+uintptr(j2)*16)).FzCol,
actionName(tls, *(*U8)(unsafe.Pointer((pFK + 45 /* &.aAction */) + uintptr(1)))), // ON UPDATE
actionName(tls, *(*U8)(unsafe.Pointer((pFK + 45 /* &.aAction */) + uintptr(0)))), // ON DELETE
- ts+2523 /* "NONE" */))
- goto __198
-__198:
+ ts+4658 /* "NONE" */))
+ goto __203
+__203:
j2++
- goto __197
- goto __199
-__199:
+ goto __202
+ goto __204
+__204:
;
i7++
pFK = (*FKey)(unsafe.Pointer(pFK)).FpNextFrom
- goto __195
-__196:
+ goto __200
+__201:
;
-__194:
+__199:
;
-__193:
+__198:
;
-__192:
+__197:
;
goto __15
@@ -102190,112 +105876,113 @@ __41: // child to parent column mapping
regResult = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (4)
- regKey = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- regRow = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regRow = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
k1 = (*Hash)(unsafe.Pointer(((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FpSchema + 8 /* &.tblHash */))).Ffirst
-__200:
+__205:
if !(k1 != 0) {
- goto __201
+ goto __206
}
if !(zRight != 0) {
- goto __202
+ goto __207
}
pTab4 = Xsqlite3LocateTable(tls, pParse, uint32(0), zRight, zDb)
k1 = uintptr(0)
- goto __203
-__202:
+ goto __208
+__207:
pTab4 = (*HashElem)(unsafe.Pointer(k1)).Fdata
k1 = (*HashElem)(unsafe.Pointer(k1)).Fnext
-__203:
+__208:
;
if !((pTab4 == uintptr(0)) || ((*Table)(unsafe.Pointer(pTab4)).FpFKey == uintptr(0))) {
- goto __204
+ goto __209
}
- goto __200
-__204:
+ goto __205
+__209:
;
- iTabDb3 = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab4)).FpSchema)
- Xsqlite3CodeVerifySchema(tls, pParse, iTabDb3)
- Xsqlite3TableLock(tls, pParse, iTabDb3, (*Table)(unsafe.Pointer(pTab4)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab4)).FzName)
+ iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab4)).FpSchema)
+ zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
+ Xsqlite3CodeVerifySchema(tls, pParse, iDb)
+ Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab4)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab4)).FzName)
if !((int32((*Table)(unsafe.Pointer(pTab4)).FnCol) + regRow) > (*Parse)(unsafe.Pointer(pParse)).FnMem) {
- goto __205
+ goto __210
}
(*Parse)(unsafe.Pointer(pParse)).FnMem = (int32((*Table)(unsafe.Pointer(pTab4)).FnCol) + regRow)
-__205:
+__210:
;
- Xsqlite3OpenTable(tls, pParse, 0, iTabDb3, pTab4, 96)
+ Xsqlite3OpenTable(tls, pParse, 0, iDb, pTab4, 96)
Xsqlite3VdbeLoadString(tls, v, regResult, (*Table)(unsafe.Pointer(pTab4)).FzName)
i8 = 1
pFK1 = (*Table)(unsafe.Pointer(pTab4)).FpFKey
-__206:
+__211:
if !(pFK1 != 0) {
- goto __208
+ goto __213
}
pParent = Xsqlite3FindTable(tls, db, (*FKey)(unsafe.Pointer(pFK1)).FzTo, zDb)
if !(pParent == uintptr(0)) {
- goto __209
+ goto __214
}
- goto __207
-__209:
+ goto __212
+__214:
;
- *(*uintptr)(unsafe.Pointer(bp + 472 /* pIdx2 */)) = uintptr(0)
- Xsqlite3TableLock(tls, pParse, iTabDb3, (*Table)(unsafe.Pointer(pParent)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pParent)).FzName)
- x = Xsqlite3FkLocateIndex(tls, pParse, pParent, pFK1, bp+472 /* &pIdx2 */, uintptr(0))
- if !(x == 0) {
- goto __210
+ *(*uintptr)(unsafe.Pointer(bp + 480 /* pIdx2 */)) = uintptr(0)
+ Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pParent)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pParent)).FzName)
+ x1 = Xsqlite3FkLocateIndex(tls, pParse, pParent, pFK1, bp+480 /* &pIdx2 */, uintptr(0))
+ if !(x1 == 0) {
+ goto __215
}
- if !(*(*uintptr)(unsafe.Pointer(bp + 472 /* pIdx2 */)) == uintptr(0)) {
- goto __212
+ if !(*(*uintptr)(unsafe.Pointer(bp + 480 /* pIdx2 */)) == uintptr(0)) {
+ goto __217
}
- Xsqlite3OpenTable(tls, pParse, i8, iTabDb3, pParent, 96)
- goto __213
-__212:
- Xsqlite3VdbeAddOp3(tls, v, 96, i8, (*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 472 /* pIdx2 */)))).Ftnum, iTabDb3)
- Xsqlite3VdbeSetP4KeyInfo(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 472 /* pIdx2 */)))
-__213:
+ Xsqlite3OpenTable(tls, pParse, i8, iDb, pParent, 96)
+ goto __218
+__217:
+ Xsqlite3VdbeAddOp3(tls, v, 96, i8, int32((*Index)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 480 /* pIdx2 */)))).Ftnum), iDb)
+ Xsqlite3VdbeSetP4KeyInfo(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 480 /* pIdx2 */)))
+__218:
;
- goto __211
-__210:
+ goto __216
+__215:
k1 = uintptr(0)
- goto __208
-__211:
+ goto __213
+__216:
;
- goto __207
-__207:
+ goto __212
+__212:
i8++
pFK1 = (*FKey)(unsafe.Pointer(pFK1)).FpNextFrom
- goto __206
- goto __208
-__208:
+ goto __211
+ goto __213
+__213:
;
if !(pFK1 != 0) {
- goto __214
+ goto __219
}
- goto __201
-__214:
+ goto __206
+__219:
;
if !((*Parse)(unsafe.Pointer(pParse)).FnTab < i8) {
- goto __215
+ goto __220
}
(*Parse)(unsafe.Pointer(pParse)).FnTab = i8
-__215:
+__220:
;
addrTop = Xsqlite3VdbeAddOp1(tls, v, 37, 0)
i8 = 1
pFK1 = (*Table)(unsafe.Pointer(pTab4)).FpFKey
-__216:
+__221:
if !(pFK1 != 0) {
- goto __218
+ goto __223
}
pParent = Xsqlite3FindTable(tls, db, (*FKey)(unsafe.Pointer(pFK1)).FzTo, zDb)
- *(*uintptr)(unsafe.Pointer(bp + 472 /* pIdx2 */)) = uintptr(0)
- *(*uintptr)(unsafe.Pointer(bp + 480 /* aiCols */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 480 /* pIdx2 */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 488 /* aiCols */)) = uintptr(0)
if !(pParent != 0) {
- goto __219
+ goto __224
}
- x = Xsqlite3FkLocateIndex(tls, pParse, pParent, pFK1, bp+472 /* &pIdx2 */, bp+480 /* &aiCols */)
-__219:
+ x1 = Xsqlite3FkLocateIndex(tls, pParse, pParent, pFK1, bp+480 /* &pIdx2 */, bp+488 /* &aiCols */)
+__224:
;
addrOk = Xsqlite3VdbeMakeLabel(tls, pParse)
@@ -102304,72 +105991,72 @@ __219:
// row cannot cause an FK violation. Jump directly to addrOk in
// this case.
j3 = 0
-__220:
+__225:
if !(j3 < (*FKey)(unsafe.Pointer(pFK1)).FnCol) {
- goto __222
+ goto __227
}
- if *(*uintptr)(unsafe.Pointer(bp + 480 /* aiCols */)) != 0 {
- iCol = *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 480 /* aiCols */)) + uintptr(j3)*4))
+ if *(*uintptr)(unsafe.Pointer(bp + 488 /* aiCols */)) != 0 {
+ iCol = *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 488 /* aiCols */)) + uintptr(j3)*4))
} else {
iCol = (*sColMap)(unsafe.Pointer((pFK1 + 64 /* &.aCol */) + uintptr(j3)*16)).FiFrom
}
Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab4, 0, iCol, (regRow + j3))
Xsqlite3VdbeAddOp2(tls, v, 50, (regRow + j3), addrOk)
- goto __221
-__221:
+ goto __226
+__226:
j3++
- goto __220
- goto __222
-__222:
+ goto __225
+ goto __227
+__227:
;
// Generate code to query the parent index for a matching parent
// key. If a match is found, jump to addrOk.
- if !(*(*uintptr)(unsafe.Pointer(bp + 472 /* pIdx2 */)) != 0) {
- goto __223
+ if !(*(*uintptr)(unsafe.Pointer(bp + 480 /* pIdx2 */)) != 0) {
+ goto __228
}
Xsqlite3VdbeAddOp4(tls, v, 91, regRow, (*FKey)(unsafe.Pointer(pFK1)).FnCol, regKey,
- Xsqlite3IndexAffinityStr(tls, db, *(*uintptr)(unsafe.Pointer(bp + 472 /* pIdx2 */))), (*FKey)(unsafe.Pointer(pFK1)).FnCol)
+ Xsqlite3IndexAffinityStr(tls, db, *(*uintptr)(unsafe.Pointer(bp + 480 /* pIdx2 */))), (*FKey)(unsafe.Pointer(pFK1)).FnCol)
Xsqlite3VdbeAddOp4Int(tls, v, 30, i8, addrOk, regKey, 0)
- goto __224
-__223:
+ goto __229
+__228:
if !(pParent != 0) {
- goto __225
+ goto __230
}
jmp = (Xsqlite3VdbeCurrentAddr(tls, v) + 2)
Xsqlite3VdbeAddOp3(tls, v, 31, i8, jmp, regRow)
Xsqlite3VdbeGoto(tls, v, addrOk)
-__225:
+__230:
;
-__224:
+__229:
;
// Generate code to report an FK violation to the caller.
if !(((*Table)(unsafe.Pointer((pTab4))).FtabFlags & U32(0x0080)) == U32(0)) {
- goto __226
+ goto __231
}
Xsqlite3VdbeAddOp2(tls, v, 127, 0, (regResult + 1))
- goto __227
-__226:
+ goto __232
+__231:
Xsqlite3VdbeAddOp2(tls, v, 72, 0, (regResult + 1))
-__227:
+__232:
;
- Xsqlite3VdbeMultiLoad(tls, v, (regResult + 2), ts+15709 /* "siX" */, crt.VaList(bp+288, (*FKey)(unsafe.Pointer(pFK1)).FzTo, (i8-1)))
+ Xsqlite3VdbeMultiLoad(tls, v, (regResult + 2), ts+18692 /* "siX" */, libc.VaList(bp+288, (*FKey)(unsafe.Pointer(pFK1)).FzTo, (i8-1)))
Xsqlite3VdbeAddOp2(tls, v, 80, regResult, 4)
Xsqlite3VdbeResolveLabel(tls, v, addrOk)
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 480 /* aiCols */)))
- goto __217
-__217:
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 488 /* aiCols */)))
+ goto __222
+__222:
i8++
pFK1 = (*FKey)(unsafe.Pointer(pFK1)).FpNextFrom
- goto __216
- goto __218
-__218:
+ goto __221
+ goto __223
+__223:
;
Xsqlite3VdbeAddOp2(tls, v, 5, 0, (addrTop + 1))
Xsqlite3VdbeJumpHere(tls, v, addrTop)
- goto __200
-__201:
+ goto __205
+__206:
;
goto __15
@@ -102377,10 +106064,10 @@ __201:
// used will be case sensitive or not depending on the RHS.
__42:
if !(zRight != 0) {
- goto __228
+ goto __233
}
Xsqlite3RegisterLikeFunctions(tls, db, int32(Xsqlite3GetBoolean(tls, zRight, uint8(0))))
-__228:
+__233:
;
goto __15
@@ -102395,9 +106082,22 @@ __228:
// integrity_check designed to detect most database corruption
// without the overhead of cross-checking indexes. Quick_check
// is linear time wherease integrity_check is O(NlogN).
+ //
+ // The maximum nubmer of errors is 100 by default. A different default
+ // can be specified using a numeric parameter N.
+ //
+ // Or, the parameter N can be the name of a table. In that case, only
+ // the one table named is verified. The freelist is only verified if
+ // the named table is "sqlite_schema" (or one of its aliases).
+ //
+ // All schemas are checked by default. To check just a single
+ // schema, use the form:
+ //
+ // PRAGMA schema.integrity_check;
__43:
+ pObjTab = uintptr(0) // Check only this one table, if not NULL
- isQuick = (crt.Bool32((int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(zLeft + uintptr(0))))])) == 'q'))
+ isQuick = (libc.Bool32((int32(Xsqlite3UpperToLower[uint8(*(*int8)(unsafe.Pointer(zLeft + uintptr(0))))])) == 'q'))
// If the PRAGMA command was of the form "PRAGMA <db>.integrity_check",
// then iDb is set to the index of the database identified by <db>.
@@ -102410,51 +106110,64 @@ __43:
// of all attached databases.
if !((*Token)(unsafe.Pointer(pId2)).Fz == uintptr(0)) {
- goto __229
+ goto __234
}
iDb = -1
-__229:
+__234:
;
// Initialize the VDBE program
(*Parse)(unsafe.Pointer(pParse)).FnMem = 6
// Set the maximum error count
- *(*int32)(unsafe.Pointer(bp + 488 /* mxErr */)) = 100
+ *(*int32)(unsafe.Pointer(bp + 496 /* mxErr */)) = 100
if !(zRight != 0) {
- goto __230
+ goto __235
}
- Xsqlite3GetInt32(tls, zRight, bp+488 /* &mxErr */)
- if !(*(*int32)(unsafe.Pointer(bp + 488 /* mxErr */)) <= 0) {
- goto __231
+ if !(Xsqlite3GetInt32(tls, zRight, bp+496 /* &mxErr */) != 0) {
+ goto __236
}
- *(*int32)(unsafe.Pointer(bp + 488 /* mxErr */)) = 100
-__231:
+ if !(*(*int32)(unsafe.Pointer(bp + 496 /* mxErr */)) <= 0) {
+ goto __238
+ }
+ *(*int32)(unsafe.Pointer(bp + 496 /* mxErr */)) = 100
+__238:
;
-__230:
+ goto __237
+__236:
+ pObjTab = Xsqlite3LocateTable(tls, pParse, uint32(0), zRight,
+ func() uintptr {
+ if iDb >= 0 {
+ return (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
+ }
+ return uintptr(0)
+ }())
+__237:
;
- Xsqlite3VdbeAddOp2(tls, v, 69, (*(*int32)(unsafe.Pointer(bp + 488 /* mxErr */)) - 1), 1) // reg[1] holds errors left
+__235:
+ ;
+ Xsqlite3VdbeAddOp2(tls, v, 69, (*(*int32)(unsafe.Pointer(bp + 496 /* mxErr */)) - 1), 1) // reg[1] holds errors left
// Do an integrity check on each database file
i9 = 0
-__232:
+__239:
if !(i9 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
- goto __234
+ goto __241
} // Array of root page numbers of all btrees
cnt = 0 // Number of entries in aRoot[]
mxIdx = 0 // Maximum number of indexes for any table
if !((0 != 0) && (i9 == 1)) {
- goto __235
+ goto __242
}
- goto __233
-__235:
+ goto __240
+__242:
;
if !((iDb >= 0) && (i9 != iDb)) {
- goto __236
+ goto __243
}
- goto __233
-__236:
+ goto __240
+__243:
;
Xsqlite3CodeVerifySchema(tls, pParse, i9)
@@ -102466,85 +106179,115 @@ __236:
pTbls = ((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*32)).FpSchema + 8 /* &.tblHash */)
cnt = 0
- x1 = (*Hash)(unsafe.Pointer(pTbls)).Ffirst
-__237:
- if !(x1 != 0) {
- goto __239
+ x2 = (*Hash)(unsafe.Pointer(pTbls)).Ffirst
+__244:
+ if !(x2 != 0) {
+ goto __246
+ }
+ pTab5 = (*HashElem)(unsafe.Pointer(x2)).Fdata // Number of indexes on pTab
+ if !((pObjTab != 0) && (pObjTab != pTab5)) {
+ goto __247
}
- pTab5 = (*HashElem)(unsafe.Pointer(x1)).Fdata // Number of indexes on pTab
+ goto __245
+__247:
+ ;
if !(((*Table)(unsafe.Pointer((pTab5))).FtabFlags & U32(0x0080)) == U32(0)) {
- goto __240
+ goto __248
}
cnt++
-__240:
+__248:
;
nIdx = 0
pIdx3 = (*Table)(unsafe.Pointer(pTab5)).FpIndex
-__241:
+__249:
if !(pIdx3 != 0) {
- goto __243
+ goto __251
}
cnt++
- goto __242
-__242:
+ goto __250
+__250:
pIdx3 = (*Index)(unsafe.Pointer(pIdx3)).FpNext
nIdx++
- goto __241
- goto __243
-__243:
+ goto __249
+ goto __251
+__251:
;
if !(nIdx > mxIdx) {
- goto __244
+ goto __252
}
mxIdx = nIdx
-__244:
+__252:
;
- goto __238
-__238:
- x1 = (*HashElem)(unsafe.Pointer(x1)).Fnext
- goto __237
- goto __239
-__239:
+ goto __245
+__245:
+ x2 = (*HashElem)(unsafe.Pointer(x2)).Fnext
+ goto __244
+ goto __246
+__246:
+ ;
+ if !(cnt == 0) {
+ goto __253
+ }
+ goto __240
+__253:
+ ;
+ if !(pObjTab != 0) {
+ goto __254
+ }
+ cnt++
+__254:
;
aRoot = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(unsafe.Sizeof(int32(0))) * (uint64(cnt + 1)))))
if !(aRoot == uintptr(0)) {
- goto __245
+ goto __255
}
- goto __234
-__245:
+ goto __241
+__255:
;
cnt = 0
- x1 = (*Hash)(unsafe.Pointer(pTbls)).Ffirst
-__246:
- if !(x1 != 0) {
- goto __248
+ if !(pObjTab != 0) {
+ goto __256
+ }
+ *(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = 0
+__256:
+ ;
+ x2 = (*Hash)(unsafe.Pointer(pTbls)).Ffirst
+__257:
+ if !(x2 != 0) {
+ goto __259
+ }
+ pTab6 = (*HashElem)(unsafe.Pointer(x2)).Fdata
+ if !((pObjTab != 0) && (pObjTab != pTab6)) {
+ goto __260
}
- pTab6 = (*HashElem)(unsafe.Pointer(x1)).Fdata
+ goto __258
+__260:
+ ;
if !(((*Table)(unsafe.Pointer((pTab6))).FtabFlags & U32(0x0080)) == U32(0)) {
- goto __249
+ goto __261
}
- *(*int32)(unsafe.Pointer(aRoot + uintptr(crt.PreIncInt32(&cnt, 1))*4)) = (*Table)(unsafe.Pointer(pTab6)).Ftnum
-__249:
+ *(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = int32((*Table)(unsafe.Pointer(pTab6)).Ftnum)
+__261:
;
pIdx4 = (*Table)(unsafe.Pointer(pTab6)).FpIndex
-__250:
+__262:
if !(pIdx4 != 0) {
- goto __252
+ goto __264
}
- *(*int32)(unsafe.Pointer(aRoot + uintptr(crt.PreIncInt32(&cnt, 1))*4)) = (*Index)(unsafe.Pointer(pIdx4)).Ftnum
- goto __251
-__251:
+ *(*int32)(unsafe.Pointer(aRoot + uintptr(libc.PreIncInt32(&cnt, 1))*4)) = int32((*Index)(unsafe.Pointer(pIdx4)).Ftnum)
+ goto __263
+__263:
pIdx4 = (*Index)(unsafe.Pointer(pIdx4)).FpNext
- goto __250
- goto __252
-__252:
+ goto __262
+ goto __264
+__264:
;
- goto __247
-__247:
- x1 = (*HashElem)(unsafe.Pointer(x1)).Fnext
- goto __246
- goto __248
-__248:
+ goto __258
+__258:
+ x2 = (*HashElem)(unsafe.Pointer(x2)).Fnext
+ goto __257
+ goto __259
+__259:
;
*(*int32)(unsafe.Pointer(aRoot + uintptr(0)*4)) = cnt
@@ -102562,167 +106305,173 @@ __248:
Xsqlite3VdbeChangeP5(tls, v, uint16(U8(i9)))
addr1 = Xsqlite3VdbeAddOp1(tls, v, 50, 2)
Xsqlite3VdbeAddOp4(tls, v, 115, 0, 3, 0,
- Xsqlite3MPrintf(tls, db, ts+15713 /* "*** in database ..." */, crt.VaList(bp+304, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*32)).FzDbSName)),
+ Xsqlite3MPrintf(tls, db, ts+18696 /* "*** in database ..." */, libc.VaList(bp+304, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i9)*32)).FzDbSName)),
-7)
Xsqlite3VdbeAddOp3(tls, v, 110, 2, 3, 3)
integrityCheckResultRow(tls, v)
Xsqlite3VdbeJumpHere(tls, v, addr1)
// Make sure all the indices are constructed correctly.
- x1 = (*Hash)(unsafe.Pointer(pTbls)).Ffirst
-__253:
- if !(x1 != 0) {
- goto __255
+ x2 = (*Hash)(unsafe.Pointer(pTbls)).Ffirst
+__265:
+ if !(x2 != 0) {
+ goto __267
}
- pTab7 = (*HashElem)(unsafe.Pointer(x1)).Fdata
+ pTab7 = (*HashElem)(unsafe.Pointer(x2)).Fdata
pPrior = uintptr(0)
r1 = -1
- if !((*Table)(unsafe.Pointer(pTab7)).Ftnum < 1) {
- goto __256
+ if !((*Table)(unsafe.Pointer(pTab7)).Ftnum < Pgno(1)) {
+ goto __268
}
- goto __254
-__256:
+ goto __266
+__268:
; // Skip VIEWs or VIRTUAL TABLEs
+ if !((pObjTab != 0) && (pObjTab != pTab7)) {
+ goto __269
+ }
+ goto __266
+__269:
+ ;
if ((*Table)(unsafe.Pointer((pTab7))).FtabFlags & U32(0x0080)) == U32(0) {
pPk1 = uintptr(0)
} else {
pPk1 = Xsqlite3PrimaryKeyIndex(tls, pTab7)
}
Xsqlite3OpenTableAndIndices(tls, pParse, pTab7, 96, uint8(0),
- 1, uintptr(0), bp+492 /* &iDataCur */, bp+496 /* &iIdxCur */)
+ 1, uintptr(0), bp+500 /* &iDataCur */, bp+504 /* &iIdxCur */)
// reg[7] counts the number of entries in the table.
// reg[8+i] counts the number of entries in the i-th index
Xsqlite3VdbeAddOp2(tls, v, 69, 0, 7)
j4 = 0
pIdx5 = (*Table)(unsafe.Pointer(pTab7)).FpIndex
-__257:
+__270:
if !(pIdx5 != 0) {
- goto __259
+ goto __272
}
Xsqlite3VdbeAddOp2(tls, v, 69, 0, (8 + j4))
- goto __258
-__258:
+ goto __271
+__271:
pIdx5 = (*Index)(unsafe.Pointer(pIdx5)).FpNext
j4++
- goto __257
- goto __259
-__259:
+ goto __270
+ goto __272
+__272:
;
- Xsqlite3VdbeAddOp2(tls, v, 37, *(*int32)(unsafe.Pointer(bp + 492 /* iDataCur */)), 0)
+ Xsqlite3VdbeAddOp2(tls, v, 37, *(*int32)(unsafe.Pointer(bp + 500 /* iDataCur */)), 0)
loopTop = Xsqlite3VdbeAddOp2(tls, v, 82, 7, 1)
if !(!(isQuick != 0)) {
- goto __260
+ goto __273
}
// Sanity check on record header decoding
- Xsqlite3VdbeAddOp3(tls, v, 89, *(*int32)(unsafe.Pointer(bp + 492 /* iDataCur */)), (int32((*Table)(unsafe.Pointer(pTab7)).FnNVCol) - 1), 3)
+ Xsqlite3VdbeAddOp3(tls, v, 89, *(*int32)(unsafe.Pointer(bp + 500 /* iDataCur */)), (int32((*Table)(unsafe.Pointer(pTab7)).FnNVCol) - 1), 3)
Xsqlite3VdbeChangeP5(tls, v, uint16(0x80))
-__260:
+__273:
;
// Verify that all NOT NULL columns really are NOT NULL
j4 = 0
-__261:
+__274:
if !(j4 < int32((*Table)(unsafe.Pointer(pTab7)).FnCol)) {
- goto __263
+ goto __276
}
if !(j4 == int32((*Table)(unsafe.Pointer(pTab7)).FiPKey)) {
- goto __264
+ goto __277
}
- goto __262
-__264:
+ goto __275
+__277:
;
if !(int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab7)).FaCol+uintptr(j4)*32)).FnotNull) == 0) {
- goto __265
+ goto __278
}
- goto __262
-__265:
+ goto __275
+__278:
;
- Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab7, *(*int32)(unsafe.Pointer(bp + 492 /* iDataCur */)), j4, 3)
+ Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab7, *(*int32)(unsafe.Pointer(bp + 500 /* iDataCur */)), j4, 3)
if !(int32((*VdbeOp)(unsafe.Pointer(Xsqlite3VdbeGetOp(tls, v, -1))).Fopcode) == 89) {
- goto __266
+ goto __279
}
Xsqlite3VdbeChangeP5(tls, v, uint16(0x80))
-__266:
+__279:
;
jmp2 = Xsqlite3VdbeAddOp1(tls, v, 51, 3)
- zErr = Xsqlite3MPrintf(tls, db, ts+15737 /* "NULL value in %s..." */, crt.VaList(bp+312, (*Table)(unsafe.Pointer(pTab7)).FzName,
+ zErr = Xsqlite3MPrintf(tls, db, ts+18720 /* "NULL value in %s..." */, libc.VaList(bp+312, (*Table)(unsafe.Pointer(pTab7)).FzName,
(*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab7)).FaCol+uintptr(j4)*32)).FzName))
Xsqlite3VdbeAddOp4(tls, v, 115, 0, 3, 0, zErr, -7)
integrityCheckResultRow(tls, v)
Xsqlite3VdbeJumpHere(tls, v, jmp2)
- goto __262
-__262:
+ goto __275
+__275:
j4++
- goto __261
- goto __263
-__263:
+ goto __274
+ goto __276
+__276:
;
// Verify CHECK constraints
if !(((*Table)(unsafe.Pointer(pTab7)).FpCheck != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00000200)) == uint64(0))) {
- goto __267
+ goto __280
}
pCheck = Xsqlite3ExprListDup(tls, db, (*Table)(unsafe.Pointer(pTab7)).FpCheck, 0)
if !(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) {
- goto __268
+ goto __281
}
addrCkFault = Xsqlite3VdbeMakeLabel(tls, pParse)
addrCkOk = Xsqlite3VdbeMakeLabel(tls, pParse)
- (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = (*(*int32)(unsafe.Pointer(bp + 492 /* iDataCur */)) + 1)
+ (*Parse)(unsafe.Pointer(pParse)).FiSelfTab = (*(*int32)(unsafe.Pointer(bp + 500 /* iDataCur */)) + 1)
k2 = ((*ExprList)(unsafe.Pointer(pCheck)).FnExpr - 1)
-__269:
+__282:
if !(k2 > 0) {
- goto __271
+ goto __284
}
Xsqlite3ExprIfFalse(tls, pParse, (*ExprList_item)(unsafe.Pointer((pCheck+8 /* &.a */)+uintptr(k2)*32)).FpExpr, addrCkFault, 0)
- goto __270
-__270:
+ goto __283
+__283:
k2--
- goto __269
- goto __271
-__271:
+ goto __282
+ goto __284
+__284:
;
Xsqlite3ExprIfTrue(tls, pParse, (*ExprList_item)(unsafe.Pointer((pCheck+8 /* &.a */)+uintptr(0)*32)).FpExpr, addrCkOk,
0x10)
Xsqlite3VdbeResolveLabel(tls, v, addrCkFault)
(*Parse)(unsafe.Pointer(pParse)).FiSelfTab = 0
- zErr1 = Xsqlite3MPrintf(tls, db, ts+15757, /* "CHECK constraint..." */
- crt.VaList(bp+328, (*Table)(unsafe.Pointer(pTab7)).FzName))
+ zErr1 = Xsqlite3MPrintf(tls, db, ts+18740, /* "CHECK constraint..." */
+ libc.VaList(bp+328, (*Table)(unsafe.Pointer(pTab7)).FzName))
Xsqlite3VdbeAddOp4(tls, v, 115, 0, 3, 0, zErr1, -7)
integrityCheckResultRow(tls, v)
Xsqlite3VdbeResolveLabel(tls, v, addrCkOk)
-__268:
+__281:
;
Xsqlite3ExprListDelete(tls, db, pCheck)
-__267:
+__280:
;
if !(!(isQuick != 0)) {
- goto __272
+ goto __285
} // Omit the remaining tests for quick_check
// Validate index entries for the current row
j4 = 0
pIdx5 = (*Table)(unsafe.Pointer(pTab7)).FpIndex
-__273:
+__286:
if !(pIdx5 != 0) {
- goto __275
+ goto __288
}
ckUniq = Xsqlite3VdbeMakeLabel(tls, pParse)
if !(pPk1 == pIdx5) {
- goto __276
+ goto __289
}
- goto __274
-__276:
+ goto __287
+__289:
;
- r1 = Xsqlite3GenerateIndexKey(tls, pParse, pIdx5, *(*int32)(unsafe.Pointer(bp + 492 /* iDataCur */)), 0, 0, bp+500, /* &jmp3 */
+ r1 = Xsqlite3GenerateIndexKey(tls, pParse, pIdx5, *(*int32)(unsafe.Pointer(bp + 500 /* iDataCur */)), 0, 0, bp+508, /* &jmp3 */
pPrior, r1)
pPrior = pIdx5
Xsqlite3VdbeAddOp2(tls, v, 82, (8 + j4), 1) // increment entry count
// Verify that an index entry exists for the current table row
- jmp21 = Xsqlite3VdbeAddOp4Int(tls, v, 30, (*(*int32)(unsafe.Pointer(bp + 496 /* iIdxCur */)) + j4), ckUniq, r1,
+ jmp21 = Xsqlite3VdbeAddOp4Int(tls, v, 30, (*(*int32)(unsafe.Pointer(bp + 504 /* iIdxCur */)) + j4), ckUniq, r1,
int32((*Index)(unsafe.Pointer(pIdx5)).FnColumn))
- Xsqlite3VdbeLoadString(tls, v, 3, ts+15787 /* "row " */)
+ Xsqlite3VdbeLoadString(tls, v, 3, ts+18770 /* "row " */)
Xsqlite3VdbeAddOp3(tls, v, 110, 7, 3, 3)
- Xsqlite3VdbeLoadString(tls, v, 4, ts+15792 /* " missing from in..." */)
+ Xsqlite3VdbeLoadString(tls, v, 4, ts+18775 /* " missing from in..." */)
Xsqlite3VdbeAddOp3(tls, v, 110, 4, 3, 3)
jmp5 = Xsqlite3VdbeLoadString(tls, v, 4, (*Index)(unsafe.Pointer(pIdx5)).FzName)
Xsqlite3VdbeAddOp3(tls, v, 110, 4, 3, 3)
@@ -102732,112 +106481,112 @@ __276:
// current key. The entry is unique if (1) any column is NULL
// or (2) the next entry has a different key
if !(int32((*Index)(unsafe.Pointer((pIdx5))).FonError) != 0) {
- goto __277
+ goto __290
}
uniqOk = Xsqlite3VdbeMakeLabel(tls, pParse)
kk = 0
-__278:
+__291:
if !(kk < int32((*Index)(unsafe.Pointer(pIdx5)).FnKeyCol)) {
- goto __280
+ goto __293
}
iCol1 = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx5)).FaiColumn + uintptr(kk)*2)))
if !((iCol1 >= 0) && ((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab7)).FaCol+uintptr(iCol1)*32)).FnotNull != 0)) {
- goto __281
+ goto __294
}
- goto __279
-__281:
+ goto __292
+__294:
;
Xsqlite3VdbeAddOp2(tls, v, 50, (r1 + kk), uniqOk)
- goto __279
-__279:
+ goto __292
+__292:
kk++
- goto __278
- goto __280
-__280:
+ goto __291
+ goto __293
+__293:
;
- jmp6 = Xsqlite3VdbeAddOp1(tls, v, 5, (*(*int32)(unsafe.Pointer(bp + 496 /* iIdxCur */)) + j4))
+ jmp6 = Xsqlite3VdbeAddOp1(tls, v, 5, (*(*int32)(unsafe.Pointer(bp + 504 /* iIdxCur */)) + j4))
Xsqlite3VdbeGoto(tls, v, uniqOk)
Xsqlite3VdbeJumpHere(tls, v, jmp6)
- Xsqlite3VdbeAddOp4Int(tls, v, 39, (*(*int32)(unsafe.Pointer(bp + 496 /* iIdxCur */)) + j4), uniqOk, r1,
+ Xsqlite3VdbeAddOp4Int(tls, v, 39, (*(*int32)(unsafe.Pointer(bp + 504 /* iIdxCur */)) + j4), uniqOk, r1,
int32((*Index)(unsafe.Pointer(pIdx5)).FnKeyCol))
- Xsqlite3VdbeLoadString(tls, v, 3, ts+15813 /* "non-unique entry..." */)
+ Xsqlite3VdbeLoadString(tls, v, 3, ts+18796 /* "non-unique entry..." */)
Xsqlite3VdbeGoto(tls, v, jmp5)
Xsqlite3VdbeResolveLabel(tls, v, uniqOk)
-__277:
+__290:
;
Xsqlite3VdbeJumpHere(tls, v, jmp4)
- Xsqlite3ResolvePartIdxLabel(tls, pParse, *(*int32)(unsafe.Pointer(bp + 500 /* jmp3 */)))
- goto __274
-__274:
+ Xsqlite3ResolvePartIdxLabel(tls, pParse, *(*int32)(unsafe.Pointer(bp + 508 /* jmp3 */)))
+ goto __287
+__287:
pIdx5 = (*Index)(unsafe.Pointer(pIdx5)).FpNext
j4++
- goto __273
- goto __275
-__275:
+ goto __286
+ goto __288
+__288:
;
-__272:
+__285:
;
- Xsqlite3VdbeAddOp2(tls, v, 5, *(*int32)(unsafe.Pointer(bp + 492 /* iDataCur */)), loopTop)
+ Xsqlite3VdbeAddOp2(tls, v, 5, *(*int32)(unsafe.Pointer(bp + 500 /* iDataCur */)), loopTop)
Xsqlite3VdbeJumpHere(tls, v, (loopTop - 1))
if !(!(isQuick != 0)) {
- goto __282
+ goto __295
}
- Xsqlite3VdbeLoadString(tls, v, 2, ts+15840 /* "wrong # of entri..." */)
+ Xsqlite3VdbeLoadString(tls, v, 2, ts+18823 /* "wrong # of entri..." */)
j4 = 0
pIdx5 = (*Table)(unsafe.Pointer(pTab7)).FpIndex
-__283:
+__296:
if !(pIdx5 != 0) {
- goto __285
+ goto __298
}
if !(pPk1 == pIdx5) {
- goto __286
+ goto __299
}
- goto __284
-__286:
+ goto __297
+__299:
;
- Xsqlite3VdbeAddOp2(tls, v, 92, (*(*int32)(unsafe.Pointer(bp + 496 /* iIdxCur */)) + j4), 3)
+ Xsqlite3VdbeAddOp2(tls, v, 92, (*(*int32)(unsafe.Pointer(bp + 504 /* iIdxCur */)) + j4), 3)
addr1 = Xsqlite3VdbeAddOp3(tls, v, 53, (8 + j4), 0, 3)
Xsqlite3VdbeChangeP5(tls, v, uint16(0x90))
Xsqlite3VdbeLoadString(tls, v, 4, (*Index)(unsafe.Pointer(pIdx5)).FzName)
Xsqlite3VdbeAddOp3(tls, v, 110, 4, 2, 3)
integrityCheckResultRow(tls, v)
Xsqlite3VdbeJumpHere(tls, v, addr1)
- goto __284
-__284:
+ goto __297
+__297:
pIdx5 = (*Index)(unsafe.Pointer(pIdx5)).FpNext
j4++
- goto __283
- goto __285
-__285:
+ goto __296
+ goto __298
+__298:
;
-__282:
+__295:
;
- goto __254
-__254:
- x1 = (*HashElem)(unsafe.Pointer(x1)).Fnext
- goto __253
- goto __255
-__255:
+ goto __266
+__266:
+ x2 = (*HashElem)(unsafe.Pointer(x2)).Fnext
+ goto __265
+ goto __267
+__267:
;
- goto __233
-__233:
+ goto __240
+__240:
i9++
- goto __232
- goto __234
-__234:
+ goto __239
+ goto __241
+__241:
;
aOp2 = Xsqlite3VdbeAddOpList(tls, v, (int32(uint64(unsafe.Sizeof(endCode)) / uint64(unsafe.Sizeof(VdbeOpList{})))), uintptr(unsafe.Pointer(&endCode)), iLn5)
if !(aOp2 != 0) {
- goto __287
+ goto __300
}
- (*VdbeOp)(unsafe.Pointer(aOp2 + uintptr(0)*24)).Fp2 = (1 - *(*int32)(unsafe.Pointer(bp + 488 /* mxErr */)))
- (*VdbeOp)(unsafe.Pointer(aOp2 + uintptr(2)*24)).Fp4type = int8(-1)
- *(*uintptr)(unsafe.Pointer(aOp2 + uintptr(2)*24 + 16 /* &.p4 */)) = ts + 2845 /* "ok" */
- (*VdbeOp)(unsafe.Pointer(aOp2 + uintptr(5)*24)).Fp4type = int8(-1)
- *(*uintptr)(unsafe.Pointer(aOp2 + uintptr(5)*24 + 16 /* &.p4 */)) = Xsqlite3ErrStr(tls, 11)
-__287:
+ (*VdbeOp)(unsafe.Pointer(aOp2 + uintptr(0)*32)).Fp2 = (1 - *(*int32)(unsafe.Pointer(bp + 496 /* mxErr */)))
+ (*VdbeOp)(unsafe.Pointer(aOp2 + uintptr(2)*32)).Fp4type = int8(-1)
+ *(*uintptr)(unsafe.Pointer(aOp2 + uintptr(2)*32 + 16 /* &.p4 */)) = ts + 4980 /* "ok" */
+ (*VdbeOp)(unsafe.Pointer(aOp2 + uintptr(5)*32)).Fp4type = int8(-1)
+ *(*uintptr)(unsafe.Pointer(aOp2 + uintptr(5)*32 + 16 /* &.p4 */)) = Xsqlite3ErrStr(tls, 11)
+__300:
;
Xsqlite3VdbeChangeP3(tls, v, 0, (Xsqlite3VdbeCurrentAddr(tls, v) - 2))
goto __15
@@ -102864,32 +106613,32 @@ __287:
// useful if invoked immediately after the main database i
__44:
if !(!(zRight != 0)) {
- goto __288
+ goto __301
} // "PRAGMA encoding"
if !(Xsqlite3ReadSchema(tls, pParse) != 0) {
- goto __290
+ goto __303
}
goto pragma_out
-__290:
+__303:
;
returnSingleText(tls, v, encnames1[(*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fenc].FzName)
- goto __289
-__288: // "PRAGMA encoding = XXX"
+ goto __302
+__301: // "PRAGMA encoding = XXX"
// Only change the value of sqlite.enc if the database handle is not
// initialized. If the main database exists, the new sqlite.enc value
// will be overwritten when the schema is next loaded. If it does not
// already exists, it will be created to use the new encoding value.
if !(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0040)) == U32(0)) {
- goto __291
+ goto __304
}
pEnc = (uintptr(unsafe.Pointer(&encnames1)) + uintptr(0)*16)
-__292:
+__305:
if !((*EncName)(unsafe.Pointer(pEnc)).FzName != 0) {
- goto __294
+ goto __307
}
if !(0 == Xsqlite3StrICmp(tls, zRight, (*EncName)(unsafe.Pointer(pEnc)).FzName)) {
- goto __295
+ goto __308
}
if (*EncName)(unsafe.Pointer(pEnc)).Fenc != 0 {
enc = (*EncName)(unsafe.Pointer(pEnc)).Fenc
@@ -102898,25 +106647,25 @@ __292:
}
((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb + uintptr(0)*32)).FpSchema)).Fenc) = enc
Xsqlite3SetTextEncoding(tls, db, enc)
- goto __294
-__295:
+ goto __307
+__308:
;
- goto __293
-__293:
+ goto __306
+__306:
pEnc += 16
- goto __292
- goto __294
-__294:
+ goto __305
+ goto __307
+__307:
;
if !(!(int32((*EncName)(unsafe.Pointer(pEnc)).FzName) != 0)) {
- goto __296
+ goto __309
}
- Xsqlite3ErrorMsg(tls, pParse, ts+15869 /* "unsupported enco..." */, crt.VaList(bp+336, zRight))
-__296:
+ Xsqlite3ErrorMsg(tls, pParse, ts+18852 /* "unsupported enco..." */, libc.VaList(bp+336, zRight))
+__309:
;
-__291:
+__304:
;
-__289:
+__302:
;
goto __15
@@ -102954,35 +106703,36 @@ __45:
iCookie = int32((*PragmaName)(unsafe.Pointer(pPragma)).FiArg) // Which cookie to read or write
Xsqlite3VdbeUsesBtree(tls, v, iDb)
if !((zRight != 0) && ((int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & 0x08) == 0)) {
- goto __297
+ goto __310
}
aOp3 = Xsqlite3VdbeAddOpList(tls, v, (int32(uint64(unsafe.Sizeof(setCookie)) / uint64(unsafe.Sizeof(VdbeOpList{})))), uintptr(unsafe.Pointer(&setCookie)), 0)
if !(0 != 0) {
- goto __299
+ goto __312
}
goto __15
-__299:
+__312:
;
- (*VdbeOp)(unsafe.Pointer(aOp3 + uintptr(0)*24)).Fp1 = iDb
- (*VdbeOp)(unsafe.Pointer(aOp3 + uintptr(1)*24)).Fp1 = iDb
- (*VdbeOp)(unsafe.Pointer(aOp3 + uintptr(1)*24)).Fp2 = iCookie
- (*VdbeOp)(unsafe.Pointer(aOp3 + uintptr(1)*24)).Fp3 = Xsqlite3Atoi(tls, zRight)
- goto __298
-__297:
+ (*VdbeOp)(unsafe.Pointer(aOp3 + uintptr(0)*32)).Fp1 = iDb
+ (*VdbeOp)(unsafe.Pointer(aOp3 + uintptr(1)*32)).Fp1 = iDb
+ (*VdbeOp)(unsafe.Pointer(aOp3 + uintptr(1)*32)).Fp2 = iCookie
+ (*VdbeOp)(unsafe.Pointer(aOp3 + uintptr(1)*32)).Fp3 = Xsqlite3Atoi(tls, zRight)
+ (*VdbeOp)(unsafe.Pointer(aOp3 + uintptr(1)*32)).Fp5 = U16(1)
+ goto __311
+__310:
;
aOp4 = Xsqlite3VdbeAddOpList(tls, v, (int32(uint64(unsafe.Sizeof(readCookie)) / uint64(unsafe.Sizeof(VdbeOpList{})))), uintptr(unsafe.Pointer(&readCookie)), 0)
if !(0 != 0) {
- goto __300
+ goto __313
}
goto __15
-__300:
+__313:
;
- (*VdbeOp)(unsafe.Pointer(aOp4 + uintptr(0)*24)).Fp1 = iDb
- (*VdbeOp)(unsafe.Pointer(aOp4 + uintptr(1)*24)).Fp1 = iDb
- (*VdbeOp)(unsafe.Pointer(aOp4 + uintptr(1)*24)).Fp3 = iCookie
+ (*VdbeOp)(unsafe.Pointer(aOp4 + uintptr(0)*32)).Fp1 = iDb
+ (*VdbeOp)(unsafe.Pointer(aOp4 + uintptr(1)*32)).Fp1 = iDb
+ (*VdbeOp)(unsafe.Pointer(aOp4 + uintptr(1)*32)).Fp3 = iCookie
Xsqlite3VdbeReusable(tls, v)
-__298:
+__311:
;
goto __15
@@ -102993,14 +106743,14 @@ __298:
__46:
i10 = 0
(*Parse)(unsafe.Pointer(pParse)).FnMem = 1
-__301:
- if !((crt.AssignUintptr(&zOpt, Xsqlite3_compileoption_get(tls, crt.PostIncInt32(&i10, 1)))) != uintptr(0)) {
- goto __302
+__314:
+ if !((libc.AssignUintptr(&zOpt, Xsqlite3_compileoption_get(tls, libc.PostIncInt32(&i10, 1)))) != uintptr(0)) {
+ goto __315
}
Xsqlite3VdbeLoadString(tls, v, 1, zOpt)
Xsqlite3VdbeAddOp2(tls, v, 80, 1, 1)
- goto __301
-__302:
+ goto __314
+__315:
;
Xsqlite3VdbeReusable(tls, v)
goto __15
@@ -103017,31 +106767,31 @@ __47:
}()
eMode2 = 0
if !(zRight != 0) {
- goto __303
+ goto __316
}
- if !(Xsqlite3StrICmp(tls, zRight, ts+15371 /* "full" */) == 0) {
- goto __304
+ if !(Xsqlite3StrICmp(tls, zRight, ts+18354 /* "full" */) == 0) {
+ goto __317
}
eMode2 = 1
- goto __305
-__304:
- if !(Xsqlite3StrICmp(tls, zRight, ts+15894 /* "restart" */) == 0) {
- goto __306
+ goto __318
+__317:
+ if !(Xsqlite3StrICmp(tls, zRight, ts+18877 /* "restart" */) == 0) {
+ goto __319
}
eMode2 = 2
- goto __307
-__306:
- if !(Xsqlite3StrICmp(tls, zRight, ts+15524 /* "truncate" */) == 0) {
- goto __308
+ goto __320
+__319:
+ if !(Xsqlite3StrICmp(tls, zRight, ts+18507 /* "truncate" */) == 0) {
+ goto __321
}
eMode2 = 3
-__308:
+__321:
;
-__307:
+__320:
;
-__305:
+__318:
;
-__303:
+__316:
;
(*Parse)(unsafe.Pointer(pParse)).FnMem = 3
Xsqlite3VdbeAddOp3(tls, v, 6, iBt, eMode2, 1)
@@ -103056,15 +106806,15 @@ __303:
// of N.
__48:
if !(zRight != 0) {
- goto __309
+ goto __322
}
Xsqlite3_wal_autocheckpoint(tls, db, Xsqlite3Atoi(tls, zRight))
-__309:
+__322:
;
returnSingleInt(tls, v,
func() int64 {
if (*Sqlite3)(unsafe.Pointer(db)).FxWalCallback == *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32
}{Xsqlite3WalDefaultHook})) {
return int64(int32((*Sqlite3)(unsafe.Pointer(db)).FpWalArg))
}
@@ -103136,43 +106886,43 @@ __49:
__50: // Mask of operations to perform
if !(zRight != 0) {
- goto __310
+ goto __323
}
opMask = U32(Xsqlite3Atoi(tls, zRight))
if !((opMask & U32(0x02)) == U32(0)) {
- goto __312
+ goto __325
}
goto __15
-__312:
+__325:
;
- goto __311
-__310:
+ goto __324
+__323:
opMask = U32(0xfffe)
-__311:
+__324:
;
- iTabCur = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ iTabCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
iDbLast = func() int32 {
if zDb != 0 {
return iDb
}
return ((*Sqlite3)(unsafe.Pointer(db)).FnDb - 1)
}()
-__313:
+__326:
if !(iDb <= iDbLast) {
- goto __315
+ goto __328
}
if !(iDb == 1) {
- goto __316
+ goto __329
}
- goto __314
-__316:
+ goto __327
+__329:
;
Xsqlite3CodeVerifySchema(tls, pParse, iDb)
pSchema = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpSchema
k3 = (*Hash)(unsafe.Pointer((pSchema + 8 /* &.tblHash */))).Ffirst
-__317:
+__330:
if !(k3 != 0) {
- goto __319
+ goto __332
}
pTab8 = (*HashElem)(unsafe.Pointer(k3)).Fdata
@@ -103180,67 +106930,67 @@ __317:
// having analysis statistics during the current session, then skip it.
// This also has the effect of skipping virtual tables and views
if !(((*Table)(unsafe.Pointer(pTab8)).FtabFlags & U32(0x0100)) == U32(0)) {
- goto __320
+ goto __333
}
- goto __318
-__320:
+ goto __331
+__333:
;
// Reanalyze if the table is 25 times larger than the last analysis
szThreshold = (LogEst(int32((*Table)(unsafe.Pointer(pTab8)).FnRowLogEst) + 46))
pIdx6 = (*Table)(unsafe.Pointer(pTab8)).FpIndex
-__321:
+__334:
if !(pIdx6 != 0) {
- goto __323
+ goto __336
}
if !(!(int32(*(*uint16)(unsafe.Pointer(pIdx6 + 100 /* &.hasStat1 */))&0x80>>7) != 0)) {
- goto __324
+ goto __337
}
szThreshold = int16(0) // Always analyze if any index lacks statistics
- goto __323
-__324:
+ goto __336
+__337:
;
- goto __322
-__322:
+ goto __335
+__335:
pIdx6 = (*Index)(unsafe.Pointer(pIdx6)).FpNext
- goto __321
- goto __323
-__323:
+ goto __334
+ goto __336
+__336:
;
if !(szThreshold != 0) {
- goto __325
+ goto __338
}
Xsqlite3OpenTable(tls, pParse, iTabCur, iDb, pTab8, 96)
Xsqlite3VdbeAddOp3(tls, v, 34, iTabCur,
(int32((U32(Xsqlite3VdbeCurrentAddr(tls, v) + 2)) + (opMask & U32(1)))), int32(szThreshold))
-__325:
+__338:
;
- zSubSql = Xsqlite3MPrintf(tls, db, ts+15902, /* "ANALYZE \"%w\".\"%w..." */
- crt.VaList(bp+344, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Table)(unsafe.Pointer(pTab8)).FzName))
+ zSubSql = Xsqlite3MPrintf(tls, db, ts+18885, /* "ANALYZE \"%w\".\"%w..." */
+ libc.VaList(bp+344, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Table)(unsafe.Pointer(pTab8)).FzName))
if !((opMask & U32(0x01)) != 0) {
- goto __326
+ goto __339
}
r11 = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3VdbeAddOp4(tls, v, 115, 0, r11, 0, zSubSql, -7)
Xsqlite3VdbeAddOp2(tls, v, 80, r11, 1)
- goto __327
-__326:
+ goto __340
+__339:
Xsqlite3VdbeAddOp4(tls, v, 140, 0, 0, 0, zSubSql, -7)
-__327:
+__340:
;
- goto __318
-__318:
+ goto __331
+__331:
k3 = (*HashElem)(unsafe.Pointer(k3)).Fnext
- goto __317
- goto __319
-__319:
+ goto __330
+ goto __332
+__332:
;
- goto __314
-__314:
+ goto __327
+__327:
iDb++
- goto __313
- goto __315
-__315:
+ goto __326
+ goto __328
+__328:
;
Xsqlite3VdbeAddOp0(tls, v, 158)
goto __15
@@ -103256,10 +107006,10 @@ __315:
__51:
;
if !(zRight != 0) {
- goto __328
+ goto __341
}
Xsqlite3_busy_timeout(tls, db, Xsqlite3Atoi(tls, zRight))
-__328:
+__341:
;
returnSingleInt(tls, v, int64((*Sqlite3)(unsafe.Pointer(db)).FbusyTimeout))
goto __15
@@ -103274,11 +107024,11 @@ __328:
// returns the same integer that would be returned by the
// sqlite3_soft_heap_limit64(-1) C-language function.
__52:
- if !((zRight != 0) && (Xsqlite3DecOrHexToI64(tls, zRight, bp+504 /* &N */) == 0)) {
- goto __329
+ if !((zRight != 0) && (Xsqlite3DecOrHexToI64(tls, zRight, bp+512 /* &N */) == 0)) {
+ goto __342
}
- Xsqlite3_soft_heap_limit64(tls, *(*Sqlite3_int64)(unsafe.Pointer(bp + 504 /* N */)))
-__329:
+ Xsqlite3_soft_heap_limit64(tls, *(*Sqlite3_int64)(unsafe.Pointer(bp + 512 /* N */)))
+__342:
;
returnSingleInt(tls, v, Xsqlite3_soft_heap_limit64(tls, int64(-1)))
goto __15
@@ -103293,17 +107043,17 @@ __329:
// the hard heap limit. This allows an application to set a heap limit
// constraint that cannot be relaxed by an untrusted SQL script.
__53:
- if !((zRight != 0) && (Xsqlite3DecOrHexToI64(tls, zRight, bp+512 /* &N1 */) == 0)) {
- goto __330
+ if !((zRight != 0) && (Xsqlite3DecOrHexToI64(tls, zRight, bp+520 /* &N1 */) == 0)) {
+ goto __343
}
iPrior = Xsqlite3_hard_heap_limit64(tls, int64(-1))
- if !((*(*Sqlite3_int64)(unsafe.Pointer(bp + 512 /* N1 */)) > int64(0)) && ((iPrior == int64(0)) || (iPrior > *(*Sqlite3_int64)(unsafe.Pointer(bp + 512 /* N1 */))))) {
- goto __331
+ if !((*(*Sqlite3_int64)(unsafe.Pointer(bp + 520 /* N1 */)) > int64(0)) && ((iPrior == int64(0)) || (iPrior > *(*Sqlite3_int64)(unsafe.Pointer(bp + 520 /* N1 */))))) {
+ goto __344
}
- Xsqlite3_hard_heap_limit64(tls, *(*Sqlite3_int64)(unsafe.Pointer(bp + 512 /* N1 */)))
-__331:
+ Xsqlite3_hard_heap_limit64(tls, *(*Sqlite3_int64)(unsafe.Pointer(bp + 520 /* N1 */)))
+__344:
;
-__330:
+__343:
;
returnSingleInt(tls, v, Xsqlite3_hard_heap_limit64(tls, int64(-1)))
goto __15
@@ -103315,12 +107065,12 @@ __330:
// maximum, which might be less than requested.
__54:
if !(((zRight != 0) &&
- (Xsqlite3DecOrHexToI64(tls, zRight, bp+520 /* &N2 */) == 0)) &&
- (*(*Sqlite3_int64)(unsafe.Pointer(bp + 520 /* N2 */)) >= int64(0))) {
- goto __332
+ (Xsqlite3DecOrHexToI64(tls, zRight, bp+528 /* &N2 */) == 0)) &&
+ (*(*Sqlite3_int64)(unsafe.Pointer(bp + 528 /* N2 */)) >= int64(0))) {
+ goto __345
}
- Xsqlite3_limit(tls, db, 11, (int32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 520 /* N2 */)) & int64(0x7fffffff))))
-__332:
+ Xsqlite3_limit(tls, db, 11, (int32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 528 /* N2 */)) & int64(0x7fffffff))))
+__345:
;
returnSingleInt(tls, v, int64(Xsqlite3_limit(tls, db, 11, -1)))
goto __15
@@ -103332,12 +107082,12 @@ __332:
// in each index that it looks at. Return the new limit.
__55:
if !(((zRight != 0) &&
- (Xsqlite3DecOrHexToI64(tls, zRight, bp+528 /* &N3 */) == 0)) &&
- (*(*Sqlite3_int64)(unsafe.Pointer(bp + 528 /* N3 */)) >= int64(0))) {
- goto __333
+ (Xsqlite3DecOrHexToI64(tls, zRight, bp+536 /* &N3 */) == 0)) &&
+ (*(*Sqlite3_int64)(unsafe.Pointer(bp + 536 /* N3 */)) >= int64(0))) {
+ goto __346
}
- (*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = (int32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 528 /* N3 */)) & int64(0x7fffffff)))
-__333:
+ (*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = (int32(*(*Sqlite3_int64)(unsafe.Pointer(bp + 536 /* N3 */)) & int64(0x7fffffff)))
+__346:
;
returnSingleInt(tls, v, int64((*Sqlite3)(unsafe.Pointer(db)).FnAnalysisLimit))
goto __15
@@ -103346,45 +107096,45 @@ __333:
__56:
(*Parse)(unsafe.Pointer(pParse)).FnMem = 2
i11 = 0
-__334:
+__347:
if !(i11 < (*Sqlite3)(unsafe.Pointer(db)).FnDb) {
- goto __336
+ goto __349
}
- zState = ts + 15920 /* "unknown" */
+ zState = ts + 18903 /* "unknown" */
if !((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i11)*32)).FzDbSName == uintptr(0)) {
- goto __337
+ goto __350
}
- goto __335
-__337:
+ goto __348
+__350:
;
pBt3 = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i11)*32)).FpBt
if !((pBt3 == uintptr(0)) || (Xsqlite3BtreePager(tls, pBt3) == uintptr(0))) {
- goto __338
+ goto __351
}
- zState = ts + 15928 /* "closed" */
- goto __339
-__338:
+ zState = ts + 18911 /* "closed" */
+ goto __352
+__351:
if !(Xsqlite3_file_control(tls, db, func() uintptr {
if i11 != 0 {
return (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i11)*32)).FzDbSName
}
return uintptr(0)
}(),
- 1, bp+536 /* &j5 */) == 0) {
- goto __340
+ 1, bp+544 /* &j5 */) == 0) {
+ goto __353
}
- zState = azLockName[*(*int32)(unsafe.Pointer(bp + 536 /* j5 */))]
-__340:
+ zState = azLockName[*(*int32)(unsafe.Pointer(bp + 544 /* j5 */))]
+__353:
;
-__339:
+__352:
;
- Xsqlite3VdbeMultiLoad(tls, v, 1, ts+15935 /* "ss" */, crt.VaList(bp+360, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i11)*32)).FzDbSName, zState))
- goto __335
-__335:
+ Xsqlite3VdbeMultiLoad(tls, v, 1, ts+18918 /* "ss" */, libc.VaList(bp+360, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(i11)*32)).FzDbSName, zState))
+ goto __348
+__348:
i11++
- goto __334
- goto __336
-__336:
+ goto __347
+ goto __349
+__349:
;
goto __15
__15:
@@ -103396,9 +107146,9 @@ __15:
// to the PRAGMA, the implementation has not added any OP_ResultRow
// instructions to the VM.
if !(((int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & 0x04) != 0) && (zRight != 0)) {
- goto __341
+ goto __354
}
-__341:
+__354:
;
pragma_out:
@@ -103412,7 +107162,7 @@ type EncName = struct {
_ [7]byte
}
-var iLn3 int32 = 0 /* sqlite3.c:125948:22 */
+var iLn3 int32 = 0 /* sqlite3.c:126248:22 */
var getCacheSize = [9]VdbeOpList{
{Fopcode: U8(2), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)}, // 0
{Fopcode: U8(93), Fp1: int8(0), Fp2: int8(1), Fp3: int8(3)}, // 1
@@ -103423,16 +107173,16 @@ var getCacheSize = [9]VdbeOpList{
{Fopcode: U8(69), Fp1: int8(0), Fp2: int8(1), Fp3: int8(0)}, // 6
{Fopcode: U8(173), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)},
{Fopcode: U8(80), Fp1: int8(1), Fp2: int8(1), Fp3: int8(0)},
-} /* sqlite3.c:125949:29 */
-var iLn4 int32 = 0 /* sqlite3.c:126211:26 */
+} /* sqlite3.c:126249:29 */
+var iLn4 int32 = 0 /* sqlite3.c:126517:26 */
var setMeta6 = [5]VdbeOpList{
{Fopcode: U8(2), Fp1: int8(0), Fp2: int8(1), Fp3: int8(0)}, // 0
{Fopcode: U8(93), Fp1: int8(0), Fp2: int8(1), Fp3: int8(4)},
{Fopcode: U8(18), Fp1: int8(1), Fp2: int8(0), Fp3: int8(0)}, // 2
{Fopcode: U8(68), Fp1: int8(0), Fp2: int8(2), Fp3: int8(0)}, // 3
{Fopcode: U8(94), Fp1: int8(0), Fp2: int8(7), Fp3: int8(0)}, // 4
-} /* sqlite3.c:126212:33 */
-var iLn5 int32 = 0 /* sqlite3.c:127193:24 */
+} /* sqlite3.c:126518:33 */
+var iLn5 int32 = 0 /* sqlite3.c:127522:24 */
var endCode = [7]VdbeOpList{
{Fopcode: U8(82), Fp1: int8(1), Fp2: int8(0), Fp3: int8(0)}, // 0
{Fopcode: U8(49), Fp1: int8(1), Fp2: int8(4), Fp3: int8(0)}, // 1
@@ -103441,30 +107191,30 @@ var endCode = [7]VdbeOpList{
{Fopcode: U8(68), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)}, // 4
{Fopcode: U8(115), Fp1: int8(0), Fp2: int8(3), Fp3: int8(0)}, // 5
{Fopcode: U8(11), Fp1: int8(0), Fp2: int8(3), Fp3: int8(0)}, // 6
-} /* sqlite3.c:127194:31 */
+} /* sqlite3.c:127523:31 */
var encnames1 = [9]EncName{
- {FzName: ts + 15938 /* "UTF8" */, Fenc: U8(1)},
- {FzName: ts + 15943 /* "UTF-8" */, Fenc: U8(1)}, // Must be element [1]
- {FzName: ts + 15949 /* "UTF-16le" */, Fenc: U8(2)}, // Must be element [2]
- {FzName: ts + 15958 /* "UTF-16be" */, Fenc: U8(3)}, // Must be element [3]
- {FzName: ts + 15967 /* "UTF16le" */, Fenc: U8(2)},
- {FzName: ts + 15975 /* "UTF16be" */, Fenc: U8(3)},
- {FzName: ts + 15983 /* "UTF-16" */, Fenc: U8(0)}, // SQLITE_UTF16NATIVE
- {FzName: ts + 15990 /* "UTF16" */, Fenc: U8(0)}, // SQLITE_UTF16NATIVE
+ {FzName: ts + 18921 /* "UTF8" */, Fenc: U8(1)},
+ {FzName: ts + 18926 /* "UTF-8" */, Fenc: U8(1)}, // Must be element [1]
+ {FzName: ts + 18932 /* "UTF-16le" */, Fenc: U8(2)}, // Must be element [2]
+ {FzName: ts + 18941 /* "UTF-16be" */, Fenc: U8(3)}, // Must be element [3]
+ {FzName: ts + 18950 /* "UTF16le" */, Fenc: U8(2)},
+ {FzName: ts + 18958 /* "UTF16be" */, Fenc: U8(3)},
+ {FzName: ts + 18966 /* "UTF-16" */, Fenc: U8(0)}, // SQLITE_UTF16NATIVE
+ {FzName: ts + 18973 /* "UTF16" */, Fenc: U8(0)}, // SQLITE_UTF16NATIVE
{FzName: uintptr(0), Fenc: U8(0)},
-} /* sqlite3.c:127246:7 */
+} /* sqlite3.c:127575:7 */
var setCookie = [2]VdbeOpList{
{Fopcode: U8(2), Fp1: int8(0), Fp2: int8(1), Fp3: int8(0)}, // 0
{Fopcode: U8(94), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)}, // 1
-} /* sqlite3.c:127326:31 */
+} /* sqlite3.c:127655:31 */
var readCookie = [3]VdbeOpList{
{Fopcode: U8(2), Fp1: int8(0), Fp2: int8(0), Fp3: int8(0)}, // 0
{Fopcode: U8(93), Fp1: int8(0), Fp2: int8(1), Fp3: int8(0)}, // 1
{Fopcode: U8(80), Fp1: int8(1), Fp2: int8(1), Fp3: int8(0)},
-} /* sqlite3.c:127340:31 */
+} /* sqlite3.c:127670:31 */
var azLockName = [5]uintptr{
- ts + 15996 /* "unlocked" */, ts + 16005 /* "shared" */, ts + 16012 /* "reserved" */, ts + 16021 /* "pending" */, ts + 15349, /* "exclusive" */
-} /* sqlite3.c:127648:23 */
+ ts + 18979 /* "unlocked" */, ts + 18988 /* "shared" */, ts + 18995 /* "reserved" */, ts + 19004 /* "pending" */, ts + 18332, /* "exclusive" */
+} /* sqlite3.c:127978:23 */
// ****************************************************************************
//
// Implementation of an eponymous virtual table that runs a pragma.
@@ -103482,7 +107232,7 @@ type PragmaVtab1 = struct {
//
// Implementation of an eponymous virtual table that runs a pragma.
//
-type PragmaVtab = PragmaVtab1 /* sqlite3.c:127700:27 */
+type PragmaVtab = PragmaVtab1 /* sqlite3.c:128030:27 */
type PragmaVtabCursor1 = struct {
Fbase Sqlite3_vtab_cursor
FpPragma uintptr
@@ -103490,10 +107240,10 @@ type PragmaVtabCursor1 = struct {
FazArg [2]uintptr
}
-type PragmaVtabCursor = PragmaVtabCursor1 /* sqlite3.c:127701:33 */
+type PragmaVtabCursor = PragmaVtabCursor1 /* sqlite3.c:128031:33 */
// Pragma virtual table module xConnect method.
-func pragmaVtabConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:127719:12: */
+func pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:128049:12: */
bp := tls.Alloc(264)
defer tls.Free(264)
@@ -103510,7 +107260,7 @@ func pragmaVtabConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv
_ = argc
_ = argv
Xsqlite3StrAccumInit(tls, bp+32 /* &acc */, uintptr(0), bp+64 /* &zBuf[0] */, int32(unsafe.Sizeof([200]int8{})), 0)
- Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+16029 /* "CREATE TABLE x" */)
+ Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+19012 /* "CREATE TABLE x" */)
i = 0
j = int32((*PragmaName)(unsafe.Pointer(pPragma)).FiPragCName)
__1:
@@ -103518,7 +107268,7 @@ __1:
goto __3
}
{
- Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+16044 /* "%c\"%s\"" */, crt.VaList(bp, int32(cSep), pragCName[j]))
+ Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+19027 /* "%c\"%s\"" */, libc.VaList(bp, int32(cSep), pragCName[j]))
cSep = int8(',')
}
goto __2
@@ -103530,19 +107280,19 @@ __2:
__3:
;
if i == 0 {
- Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+16051 /* "(\"%s\"" */, crt.VaList(bp+16, (*PragmaName)(unsafe.Pointer(pPragma)).FzName))
+ Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+19034 /* "(\"%s\"" */, libc.VaList(bp+16, (*PragmaName)(unsafe.Pointer(pPragma)).FzName))
i++
}
j = 0
if (int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & 0x20) != 0 {
- Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+16057 /* ",arg HIDDEN" */)
+ Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+19040 /* ",arg HIDDEN" */)
j++
}
if (int32((*PragmaName)(unsafe.Pointer(pPragma)).FmPragFlg) & (0x40 | 0x80)) != 0 {
- Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+16069 /* ",schema HIDDEN" */)
+ Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+19052 /* ",schema HIDDEN" */)
j++
}
- Xsqlite3_str_append(tls, bp+32 /* &acc */, ts+4456 /* ")" */, 1)
+ Xsqlite3_str_append(tls, bp+32 /* &acc */, ts+6652 /* ")" */, 1)
Xsqlite3StrAccumFinish(tls, bp+32 /* &acc */)
rc = Xsqlite3_declare_vtab(tls, db, bp+64 /* &zBuf[0] */)
@@ -103551,14 +107301,14 @@ __3:
if pTab == uintptr(0) {
rc = 7
} else {
- crt.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(PragmaVtab{})))
+ libc.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(PragmaVtab{})))
(*PragmaVtab)(unsafe.Pointer(pTab)).FpName = pPragma
(*PragmaVtab)(unsafe.Pointer(pTab)).Fdb = db
(*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden = U8(i)
(*PragmaVtab)(unsafe.Pointer(pTab)).FnHidden = U8(j)
}
} else {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+696 /* "%s" */, crt.VaList(bp+24, Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, db)))
}
*(*uintptr)(unsafe.Pointer(ppVtab)) = pTab
@@ -103566,7 +107316,7 @@ __3:
}
// Pragma virtual table module xDisconnect method.
-func pragmaVtabDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* sqlite3.c:127781:12: */
+func pragmaVtabDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:128111:12: */
var pTab uintptr = pVtab
Xsqlite3_free(tls, pTab)
return 0
@@ -103578,7 +107328,7 @@ func pragmaVtabDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* sqlite3.c:1277
// query planner to give == constraints on as many hidden parameters as
// possible, and especially on the first hidden parameter. So return a
// high cost if hidden parameters are unconstrained.
-func pragmaVtabBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:127794:12: */
+func pragmaVtabBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:128124:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -103642,20 +107392,20 @@ __3:
}
// Create a new cursor for the pragma virtual table
-func pragmaVtabOpen(tls *crt.TLS, pVtab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:127831:12: */
+func pragmaVtabOpen(tls *libc.TLS, pVtab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:128161:12: */
var pCsr uintptr
pCsr = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(PragmaVtabCursor{})))
if pCsr == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(PragmaVtabCursor{})))
+ libc.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(PragmaVtabCursor{})))
(*PragmaVtabCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab = pVtab
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCsr /* &.base */)
return 0
}
// Clear all content from pragma virtual table cursor.
-func pragmaVtabCursorClear(tls *crt.TLS, pCsr uintptr) { /* sqlite3.c:127842:13: */
+func pragmaVtabCursorClear(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:128172:13: */
var i int32
Xsqlite3_finalize(tls, (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma)
(*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma = uintptr(0)
@@ -103666,7 +107416,7 @@ func pragmaVtabCursorClear(tls *crt.TLS, pCsr uintptr) { /* sqlite3.c:127842:13:
}
// Close a pragma virtual table cursor
-func pragmaVtabClose(tls *crt.TLS, cur uintptr) int32 { /* sqlite3.c:127853:12: */
+func pragmaVtabClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:128183:12: */
var pCsr uintptr = cur
pragmaVtabCursorClear(tls, pCsr)
Xsqlite3_free(tls, pCsr)
@@ -103674,7 +107424,7 @@ func pragmaVtabClose(tls *crt.TLS, cur uintptr) int32 { /* sqlite3.c:127853:12:
}
// Advance the pragma virtual table cursor to the next row
-func pragmaVtabNext(tls *crt.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:127861:12: */
+func pragmaVtabNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:128191:12: */
var pCsr uintptr = pVtabCursor
var rc int32 = 0
@@ -103690,7 +107440,7 @@ func pragmaVtabNext(tls *crt.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:1278
}
// Pragma virtual table module xFilter method.
-func pragmaVtabFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:127879:12: */
+func pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:128209:12: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -103720,7 +107470,7 @@ __1:
var zText uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
if zText != 0 {
- *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr(j)*8)) = Xsqlite3_mprintf(tls, ts+696 /* "%s" */, crt.VaList(bp, zText))
+ *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr(j)*8)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp, zText))
if *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr(j)*8)) == uintptr(0) {
return 7
}
@@ -103735,13 +107485,13 @@ __2:
__3:
;
Xsqlite3StrAccumInit(tls, bp+32 /* &acc */, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer(((*PragmaVtab)(unsafe.Pointer(pTab)).Fdb + 124 /* &.aLimit */) + uintptr(1)*4)))
- Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+16084 /* "PRAGMA " */)
+ Xsqlite3_str_appendall(tls, bp+32 /* &acc */, ts+19067 /* "PRAGMA " */)
if *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr(1)*8)) != 0 {
- Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+16092 /* "%Q." */, crt.VaList(bp+8, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr(1)*8))))
+ Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+19075 /* "%Q." */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr(1)*8))))
}
Xsqlite3_str_appendall(tls, bp+32 /* &acc */, (*PragmaName)(unsafe.Pointer((*PragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName)
if *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr(0)*8)) != 0 {
- Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+16096 /* "=%Q" */, crt.VaList(bp+16, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr(0)*8))))
+ Xsqlite3_str_appendf(tls, bp+32 /* &acc */, ts+19079 /* "=%Q" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr(0)*8))))
}
zSql = Xsqlite3StrAccumFinish(tls, bp+32 /* &acc */)
if zSql == uintptr(0) {
@@ -103750,33 +107500,33 @@ __3:
rc = Xsqlite3_prepare_v2(tls, (*PragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -1, (pCsr + 8 /* &.pPragma */), uintptr(0))
Xsqlite3_free(tls, zSql)
if rc != 0 {
- (*PragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+696 /* "%s" */, crt.VaList(bp+24, Xsqlite3_errmsg(tls, (*PragmaVtab)(unsafe.Pointer(pTab)).Fdb)))
+ (*PragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, (*PragmaVtab)(unsafe.Pointer(pTab)).Fdb)))
return rc
}
return pragmaVtabNext(tls, pVtabCursor)
}
// Pragma virtual table module xEof method.
-func pragmaVtabEof(tls *crt.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:127929:12: */
+func pragmaVtabEof(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:128259:12: */
var pCsr uintptr = pVtabCursor
- return (crt.Bool32((*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma == uintptr(0)))
+ return (libc.Bool32((*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma == uintptr(0)))
}
// The xColumn method simply returns the corresponding column from
// the PRAGMA.
-func pragmaVtabColumn(tls *crt.TLS, pVtabCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:127937:12: */
+func pragmaVtabColumn(tls *libc.TLS, pVtabCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:128267:12: */
var pCsr uintptr = pVtabCursor
var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab
if i < int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden) {
Xsqlite3_result_value(tls, ctx, Xsqlite3_column_value(tls, (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FpPragma, i))
} else {
- Xsqlite3_result_text(tls, ctx, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr((i-int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden)))*8)), -1, crt.UintptrFromInt32(-1))
+ Xsqlite3_result_text(tls, ctx, *(*uintptr)(unsafe.Pointer((pCsr + 24 /* &.azArg */) + uintptr((i-int32((*PragmaVtab)(unsafe.Pointer(pTab)).FiHidden)))*8)), -1, libc.UintptrFromInt32(-1))
}
return 0
}
// Pragma virtual table module xRowid method.
-func pragmaVtabRowid(tls *crt.TLS, pVtabCursor uintptr, p uintptr) int32 { /* sqlite3.c:127955:12: */
+func pragmaVtabRowid(tls *libc.TLS, pVtabCursor uintptr, p uintptr) int32 { /* sqlite3.c:128285:12: */
var pCsr uintptr = pVtabCursor
*(*Sqlite_int64)(unsafe.Pointer(p)) = (*PragmaVtabCursor)(unsafe.Pointer(pCsr)).FiRowid
return 0
@@ -103807,12 +107557,12 @@ uintptr(0), FxRelease:// xSavepoint
uintptr(0), FxRollbackTo:// xRelease
uintptr(0), FxShadowName:// xRollbackTo
uintptr(0), // xShadowName
-} /* sqlite3.c:127962:29 */
+} /* sqlite3.c:128292:29 */
// Check to see if zTabName is really the name of a pragma. If it is,
// then register an eponymous virtual table for that pragma and return
// a pointer to the Module object for the new virtual table.
-func Xsqlite3PragmaVtabRegister(tls *crt.TLS, db uintptr, zName uintptr) uintptr { /* sqlite3.c:127994:23: */
+func Xsqlite3PragmaVtabRegister(tls *libc.TLS, db uintptr, zName uintptr) uintptr { /* sqlite3.c:128324:23: */
var pName uintptr
pName = pragmaLocate(tls, (zName + uintptr(7)))
@@ -103845,7 +107595,7 @@ func Xsqlite3PragmaVtabRegister(tls *crt.TLS, db uintptr, zName uintptr) uintptr
// Fill the InitData structure with an error message that indicates
// that the database is corrupt.
-func corruptSchema(tls *crt.TLS, pData uintptr, zObj uintptr, zExtra uintptr) { /* sqlite3.c:128031:13: */
+func corruptSchema(tls *libc.TLS, pData uintptr, zObj uintptr, zExtra uintptr) { /* sqlite3.c:128361:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -103857,25 +107607,25 @@ func corruptSchema(tls *crt.TLS, pData uintptr, zObj uintptr, zExtra uintptr) {
*(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = Xsqlite3DbStrDup(tls, db, zExtra)
(*InitData)(unsafe.Pointer(pData)).Frc = 1
} else if ((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00000001)) != 0 {
- (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 128045)
+ (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 128375)
} else {
var z uintptr
if zObj == uintptr(0) {
- zObj = ts + 4507 /* "?" */
+ zObj = ts + 6705 /* "?" */
}
- z = Xsqlite3MPrintf(tls, db, ts+16100 /* "malformed databa..." */, crt.VaList(bp, zObj))
+ z = Xsqlite3MPrintf(tls, db, ts+19083 /* "malformed databa..." */, libc.VaList(bp, zObj))
if (zExtra != 0) && (*(*int8)(unsafe.Pointer(zExtra + uintptr(0))) != 0) {
- z = Xsqlite3MPrintf(tls, db, ts+16131 /* "%z - %s" */, crt.VaList(bp+8, z, zExtra))
+ z = Xsqlite3MPrintf(tls, db, ts+19114 /* "%z - %s" */, libc.VaList(bp+8, z, zExtra))
}
*(*uintptr)(unsafe.Pointer((*InitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z
- (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 128052)
+ (*InitData)(unsafe.Pointer(pData)).Frc = Xsqlite3CorruptError(tls, 128382)
}
}
// Check to see if any sibling index (another index on the same table)
// of pIndex has the same root page number, and if it does, return true.
// This would indicate a corrupt schema.
-func Xsqlite3IndexHasDuplicateRootPage(tls *crt.TLS, pIndex uintptr) int32 { /* sqlite3.c:128061:20: */
+func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32 { /* sqlite3.c:128391:20: */
var p uintptr
for p = (*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FpTable)).FpIndex; p != 0; p = (*Index)(unsafe.Pointer(p)).FpNext {
if ((*Index)(unsafe.Pointer(p)).Ftnum == (*Index)(unsafe.Pointer(pIndex)).Ftnum) && (p != pIndex) {
@@ -103897,7 +107647,7 @@ func Xsqlite3IndexHasDuplicateRootPage(tls *crt.TLS, pIndex uintptr) int32 { /*
// argv[3] = root page number for table or index. 0 for trigger or view.
// argv[4] = SQL text for the CREATE statement.
//
-func Xsqlite3InitCallback(tls *crt.TLS, pInit uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:128095:20: */
+func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr, NotUsed uintptr) int32 { /* sqlite3.c:128425:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -103920,7 +107670,7 @@ func Xsqlite3InitCallback(tls *crt.TLS, pInit uintptr, argc int32, argv uintptr,
} // Might happen if EMPTY_RESULT_CALLBACKS are on
if *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)) == uintptr(0) {
corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), uintptr(0))
- } else if Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), ts+16139 /* "create " */, 7) == 0 {
+ } else if Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), ts+19122 /* "create " */, 7) == 0 {
// Call the parser to process a CREATE TABLE, INDEX or VIEW.
// But because db->init.busy is set to 1, no VDBE code is generated
// or executed. All the parser does is build the internal data
@@ -103932,8 +107682,13 @@ func Xsqlite3InitCallback(tls *crt.TLS, pInit uintptr, argc int32, argv uintptr,
// Return code from sqlite3_prepare()
(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(iDb)
- (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum = Xsqlite3Atoi(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)))
- crt.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.orphanTrigger */, uint32(0), 0, 0x1)
+ if (Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)), (db+176 /* &.init */ /* &.newTnum */)) == 0) ||
+ (((*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > (*InitData)(unsafe.Pointer(pData)).FmxPage) && ((*InitData)(unsafe.Pointer(pData)).FmxPage > Pgno(0))) {
+ if Xsqlite3Config.FbExtraSchemaChecks != 0 {
+ corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+15203 /* "invalid rootpage" */)
+ }
+ }
+ libc.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.orphanTrigger */, uint32(0), 0, 0x1)
(*Sqlite3)(unsafe.Pointer(db)).Finit.FazInit = argv
*(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0)
sqlite3Prepare(tls, db, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)), -1, uint32(0), uintptr(0), bp /* &pStmt */, uintptr(0))
@@ -103965,16 +107720,15 @@ func Xsqlite3InitCallback(tls *crt.TLS, pInit uintptr, argc int32, argv uintptr,
// to do here is record the root page number for that index.
var pIndex uintptr
pIndex = Xsqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName)
- if (((pIndex == uintptr(0)) ||
- (Xsqlite3GetInt32(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)), (pIndex+88 /* &.tnum */)) == 0)) ||
- ((*Index)(unsafe.Pointer(pIndex)).Ftnum < 2)) ||
+ if pIndex == uintptr(0) {
+ corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+19130 /* "orphan index" */)
+ } else if (((Xsqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)), (pIndex+88 /* &.tnum */)) == 0) ||
+ ((*Index)(unsafe.Pointer(pIndex)).Ftnum < Pgno(2))) ||
+ ((*Index)(unsafe.Pointer(pIndex)).Ftnum > (*InitData)(unsafe.Pointer(pData)).FmxPage)) ||
(Xsqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0) {
- corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), func() uintptr {
- if pIndex != 0 {
- return ts + 12440 /* "invalid rootpage" */
- }
- return ts + 16147 /* "orphan index" */
- }())
+ if Xsqlite3Config.FbExtraSchemaChecks != 0 {
+ corruptSchema(tls, pData, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), ts+15203 /* "invalid rootpage" */)
+ }
}
}
return 0
@@ -103986,9 +107740,9 @@ func Xsqlite3InitCallback(tls *crt.TLS, pInit uintptr, argc int32, argv uintptr,
// database. iDb==1 should never be used. iDb>=2 is used for
// auxiliary databases. Return one of the SQLITE_ error codes to
// indicate success or failure.
-func Xsqlite3InitOne(tls *crt.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFlags U32) int32 { /* sqlite3.c:128179:20: */
- bp := tls.Alloc(116)
- defer tls.Free(116)
+func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFlags U32) int32 { /* sqlite3.c:128520:20: */
+ bp := tls.Alloc(124)
+ defer tls.Free(124)
var rc int32
var i int32
@@ -103996,36 +107750,36 @@ func Xsqlite3InitOne(tls *crt.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFla
var pDb uintptr
// var azArg [6]uintptr at bp+16, 48
- // var meta [5]int32 at bp+96, 20
+ // var meta [5]int32 at bp+104, 20
- // var initData InitData at bp+64, 32
+ // var initData InitData at bp+64, 40
- var zMasterName uintptr
+ var zSchemaTabName uintptr
var openedTransaction int32
var mask int32
var encoding U8
var xAuth Sqlite3_xauth
var zSql uintptr
openedTransaction = 0
- mask = (int32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0040)) | ^U32(crt.Int32FromInt32(0x0040))))
+ mask = (int32(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0040)) | ^U32(libc.Int32FromInt32(0x0040))))
(*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(1)
- // Construct the in-memory representation schema tables (sqlite_master or
- // sqlite_temp_master) by invoking the parser directly. The appropriate
+ // Construct the in-memory representation schema tables (sqlite_schema or
+ // sqlite_temp_schema) by invoking the parser directly. The appropriate
// table name will be inserted automatically by the parser so we can just
// use the abbreviation "x" here. The parser will also automatically tag
// the schema table as read-only.
- *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + uintptr(0)*8)) = ts + 6019 /* "table" */
- *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + uintptr(1)*8)) = crt.AssignUintptr(&zMasterName, func() uintptr {
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + uintptr(0)*8)) = ts + 8217 /* "table" */
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + uintptr(1)*8)) = libc.AssignUintptr(&zSchemaTabName, func() uintptr {
if (!(0 != 0)) && (iDb == 1) {
- return ts + 10552 /* "sqlite_temp_mast..." */
+ return ts + 13282 /* "sqlite_temp_mast..." */
}
- return ts + 5324 /* "sqlite_master" */
+ return ts + 7522 /* "sqlite_master" */
}())
*(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + uintptr(2)*8)) = *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + uintptr(1)*8))
- *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + uintptr(3)*8)) = ts + 7523 /* "1" */
- *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + uintptr(4)*8)) = ts + 16160 /* "CREATE TABLE x(t..." */
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + uintptr(3)*8)) = ts + 9882 /* "1" */
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + uintptr(4)*8)) = ts + 19143 /* "CREATE TABLE x(t..." */
*(*uintptr)(unsafe.Pointer(bp + 16 /* &azArg[0] */ + uintptr(5)*8)) = uintptr(0)
(*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).Fdb = db
(*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).FiDb = iDb
@@ -104033,6 +107787,7 @@ func Xsqlite3InitOne(tls *crt.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFla
(*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).FpzErrMsg = pzErrMsg
(*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).FmInitFlags = mFlags
(*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).FnInitRow = U32(0)
+ (*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).FmxPage = Pgno(0)
Xsqlite3InitCallback(tls, bp+64 /* &initData */, 5, bp+16 /* azArg */, uintptr(0))
*(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (U32(mask))
if !((*InitData)(unsafe.Pointer(bp+64 /* &initData */)).Frc != 0) {
@@ -104095,7 +107850,7 @@ __5:
if !(i < (int32(uint64(unsafe.Sizeof([5]int32{})) / uint64(unsafe.Sizeof(int32(0)))))) {
goto __7
}
- Xsqlite3BtreeGetMeta(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (i + 1), (bp + 96 /* &meta */ + uintptr(i)*4))
+ Xsqlite3BtreeGetMeta(tls, (*Db)(unsafe.Pointer(pDb)).FpBt, (i + 1), (bp + 104 /* &meta */ + uintptr(i)*4))
goto __6
__6:
i++
@@ -104106,23 +107861,23 @@ __7:
if !(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x02000000)) != uint64(0)) {
goto __8
}
- crt.Xmemset(tls, bp+96 /* &meta[0] */, 0, uint64(unsafe.Sizeof([5]int32{})))
+ libc.Xmemset(tls, bp+104 /* &meta[0] */, 0, uint64(unsafe.Sizeof([5]int32{})))
__8:
;
- (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fschema_cookie = *(*int32)(unsafe.Pointer(bp + 96 /* &meta[0] */ + uintptr((1-1))*4))
+ (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fschema_cookie = *(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + uintptr((1-1))*4))
// If opening a non-empty database, check the text encoding. For the
// main database, set sqlite3.enc to the encoding of the main database.
// For an attached db, it is an error if the encoding is not the same
// as sqlite3.enc.
- if !(*(*int32)(unsafe.Pointer(bp + 96 /* &meta[0] */ + uintptr((5-1))*4)) != 0) {
+ if !(*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + uintptr((5-1))*4)) != 0) {
goto __9
} // text encoding
if !((iDb == 0) && (((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0040)) == U32(0))) {
goto __10
}
// If opening the main database, set ENC(db).
- encoding = (U8(int32(U8(*(*int32)(unsafe.Pointer(bp + 96 /* &meta[0] */ + uintptr((5-1))*4)))) & 3))
+ encoding = (U8(int32(U8(*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + uintptr((5-1))*4)))) & 3))
if !(int32(encoding) == 0) {
goto __12
}
@@ -104133,11 +107888,11 @@ __12:
goto __11
__10:
// If opening an attached database, the encoding much match ENC(db)
- if !((*(*int32)(unsafe.Pointer(bp + 96 /* &meta[0] */ + uintptr((5-1))*4)) & 3) != (int32((*Sqlite3)(unsafe.Pointer(db)).Fenc))) {
+ if !((*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + uintptr((5-1))*4)) & 3) != (int32((*Sqlite3)(unsafe.Pointer(db)).Fenc))) {
goto __13
}
Xsqlite3SetString(tls, pzErrMsg, db,
- ts+10212 /* "attached databas..." */)
+ ts+12896 /* "attached databas..." */)
rc = 1
goto initone_error_out
__13:
@@ -104151,7 +107906,7 @@ __9:
if !((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Fcache_size == 0) {
goto __14
}
- size = Xsqlite3AbsInt32(tls, *(*int32)(unsafe.Pointer(bp + 96 /* &meta[0] */ + uintptr((3-1))*4)))
+ size = Xsqlite3AbsInt32(tls, *(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + uintptr((3-1))*4)))
if !(size == 0) {
goto __15
}
@@ -104167,7 +107922,7 @@ __14:
// file_format==2 Version 3.1.3. // ALTER TABLE ADD COLUMN
// file_format==3 Version 3.1.4. // ditto but with non-NULL defaults
// file_format==4 Version 3.3.0. // DESC indices. Boolean constants
- (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = U8(*(*int32)(unsafe.Pointer(bp + 96 /* &meta[0] */ + uintptr((2-1))*4)))
+ (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = U8(*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + uintptr((2-1))*4)))
if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) == 0) {
goto __16
}
@@ -104177,7 +107932,7 @@ __16:
if !(int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > 4) {
goto __17
}
- Xsqlite3SetString(tls, pzErrMsg, db, ts+16232 /* "unsupported file..." */)
+ Xsqlite3SetString(tls, pzErrMsg, db, ts+19215 /* "unsupported file..." */)
rc = 1
goto initone_error_out
__17:
@@ -104187,23 +107942,25 @@ __17:
// clear the legacy_file_format pragma flag so that a VACUUM will
// not downgrade the database and thus invalidate any descending
// indices that the user might have created.
- if !((iDb == 0) && (*(*int32)(unsafe.Pointer(bp + 96 /* &meta[0] */ + uintptr((2-1))*4)) >= 4)) {
+ if !((iDb == 0) && (*(*int32)(unsafe.Pointer(bp + 104 /* &meta[0] */ + uintptr((2-1))*4)) >= 4)) {
goto __18
}
- *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(crt.Uint64FromUint64(uint64(0x00000002))))
+ *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(libc.Uint64FromUint64(uint64(0x00000002))))
__18:
;
// Read the schema information out of the schema tables
+ (*InitData)(unsafe.Pointer(bp + 64 /* &initData */)).FmxPage = Xsqlite3BtreeLastPage(tls, (*Db)(unsafe.Pointer(pDb)).FpBt)
+
zSql = Xsqlite3MPrintf(tls, db,
- ts+16256, /* "SELECT*FROM\"%w\"...." */
- crt.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zMasterName))
+ ts+19239, /* "SELECT*FROM\"%w\"...." */
+ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zSchemaTabName))
xAuth = (*Sqlite3)(unsafe.Pointer(db)).FxAuth
(*Sqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0)
rc = Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{Xsqlite3InitCallback})), bp+64 /* &initData */, uintptr(0))
(*Sqlite3)(unsafe.Pointer(db)).FxAuth = xAuth
if !(rc == 0) {
@@ -104234,7 +107991,7 @@ __21:
// current sqlite3_prepare() operation will fail, but the following one
// will attempt to compile the supplied statement against whatever subset
// of the schema was loaded before the error occurred. The primary
- // purpose of this is to allow access to the sqlite_master table
+ // purpose of this is to allow access to the sqlite_schema table
// even when its contents have been corrupted.
*(*U16)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb+uintptr(iDb)*32)).FpSchema + 114 /* &.schemaFlags */)) |= U16((0x0001))
rc = 0
@@ -104277,10 +108034,10 @@ __24:
//
// After a database is initialized, the DB_SchemaLoaded bit is set
// bit is set in the flags field of the Db structure.
-func Xsqlite3Init(tls *crt.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:128412:20: */
+func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:128755:20: */
var i int32
var rc int32
- var commit_internal int32 = crt.BoolInt32(!(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0001)) != 0))
+ var commit_internal int32 = libc.BoolInt32(!(((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0001)) != 0))
((*Sqlite3)(unsafe.Pointer(db)).Fenc) = (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((db))).FaDb + uintptr(0)*32)).FpSchema)).Fenc
@@ -104309,7 +108066,7 @@ func Xsqlite3Init(tls *crt.TLS, db uintptr, pzErrMsg uintptr) int32 { /* sqlite3
// This routine is a no-op if the database schema is already initialized.
// Otherwise, the schema is loaded. An error code is returned.
-func Xsqlite3ReadSchema(tls *crt.TLS, pParse uintptr) int32 { /* sqlite3.c:128444:20: */
+func Xsqlite3ReadSchema(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:128787:20: */
var rc int32 = 0
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
@@ -104328,7 +108085,7 @@ func Xsqlite3ReadSchema(tls *crt.TLS, pParse uintptr) int32 { /* sqlite3.c:12844
// Check schema cookies in all databases. If any cookie is out
// of date set pParse->rc to SQLITE_SCHEMA. If all schema cookies
// make no changes to pParse->rc.
-func schemaIsValid(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:128466:13: */
+func schemaIsValid(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:128809:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -104380,18 +108137,19 @@ func schemaIsValid(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:128466:13: */
//
// If the same database is attached more than once, the first
// attached database is returned.
-func Xsqlite3SchemaToIndex(tls *crt.TLS, db uintptr, pSchema uintptr) int32 { /* sqlite3.c:128515:20: */
- var i int32 = -1000000
+func Xsqlite3SchemaToIndex(tls *libc.TLS, db uintptr, pSchema uintptr) int32 { /* sqlite3.c:128858:20: */
+ var i int32 = -32768
- // If pSchema is NULL, then return -1000000. This happens when code in
+ // If pSchema is NULL, then return -32768. This happens when code in
// expr.c is trying to resolve a reference to a transient table (i.e. one
// created by a sub-select). In this case the return value of this
// function should never be used.
//
- // We return -1000000 instead of the more usual -1 simply because using
- // -1000000 as the incorrect index into db->aDb[] is much
+ // We return -32768 instead of the more usual -1 simply because using
+ // -32768 as the incorrect index into db->aDb[] is much
// more likely to cause a segfault than -1 (of course there are assert()
- // statements too, but it never hurts to play the odds).
+ // statements too, but it never hurts to play the odds) and
+ // -32768 will still fit into a 16-bit signed integer.
if pSchema != 0 {
for i = 0; 1 != 0; i++ {
@@ -104405,14 +108163,14 @@ func Xsqlite3SchemaToIndex(tls *crt.TLS, db uintptr, pSchema uintptr) int32 { /*
}
// Deallocate a single AggInfo object
-func agginfoFree(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:128544:13: */
+func agginfoFree(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:128888:13: */
Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaCol)
Xsqlite3DbFree(tls, db, (*AggInfo)(unsafe.Pointer(p)).FaFunc)
Xsqlite3DbFree(tls, db, p)
}
// Free all memory allocations in the pParse object
-func Xsqlite3ParserReset(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:128553:21: */
+func Xsqlite3ParserReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:128897:21: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pThis uintptr = (*Parse)(unsafe.Pointer(pParse)).FpAggList
for pThis != 0 {
@@ -104424,7 +108182,7 @@ func Xsqlite3ParserReset(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:128553:21:
Xsqlite3ExprListDelete(tls, db, (*Parse)(unsafe.Pointer(pParse)).FpConstExpr)
if db != 0 {
- *(*U32)(unsafe.Pointer(db + 376 /* &.lookaside */ /* &.bDisable */)) -= (U32((*Parse)(unsafe.Pointer(pParse)).FdisableLookaside))
+ *(*U32)(unsafe.Pointer(db + 400 /* &.lookaside */ /* &.bDisable */)) -= (U32((*Parse)(unsafe.Pointer(pParse)).FdisableLookaside))
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = func() uint16 {
if (*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable != 0 {
return uint16(0)
@@ -104436,7 +108194,7 @@ func Xsqlite3ParserReset(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:128553:21:
}
// Compile the UTF-8 encoded SQL statement zSql into a statement handle.
-func sqlite3Prepare(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pReprepare uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:128574:12: */
+func sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pReprepare uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:128918:12: */
bp := tls.Alloc(448)
defer tls.Free(448)
@@ -104454,8 +108212,8 @@ func sqlite3Prepare(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, prepFl
*(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */)) = uintptr(0)
rc = 0 // Parsing context
- crt.Xmemset(tls, bp+16 /* &sParse */, 0, uint64((uintptr(0) + 212 /* &.aTempReg */)))
- crt.Xmemset(tls, ((bp + 16 /* &sParse */) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), 0, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */)))))
+ libc.Xmemset(tls, bp+16 /* &sParse */, 0, uint64((uintptr(0) + 212 /* &.aTempReg */)))
+ libc.Xmemset(tls, ((bp + 16 /* &sParse */) + uintptr((uint64((uintptr(0) + 264 /* &.sLastToken */))))), 0, (uint64(unsafe.Sizeof(Parse{})) - (uint64((uintptr(0) + 264 /* &.sLastToken */)))))
(*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FpReprepare = pReprepare
// assert( !db->mallocFailed ); // not true with SQLITE_USE_ALLOCA
@@ -104470,7 +108228,7 @@ func sqlite3Prepare(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, prepFl
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
__1:
;
- (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FdisableVtab = (U8(crt.Bool32((prepFlags & U32(0x04)) != U32(0))))
+ (*Parse)(unsafe.Pointer(bp + 16 /* &sParse */)).FdisableVtab = (U8(libc.Bool32((prepFlags & U32(0x04)) != U32(0))))
// Check to verify that it is possible to get a read lock on all
// database schemas. The inability to get a read lock indicates that
@@ -104512,7 +108270,7 @@ __3:
goto __7
}
zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FzDbSName
- Xsqlite3ErrorWithMsg(tls, db, rc, ts+16290 /* "database schema ..." */, crt.VaList(bp, zDb))
+ Xsqlite3ErrorWithMsg(tls, db, rc, ts+19273 /* "database schema ..." */, libc.VaList(bp, zDb))
goto end_prepare
__7:
@@ -104540,7 +108298,7 @@ __2:
if !(nBytes > mxLen) {
goto __10
}
- Xsqlite3ErrorWithMsg(tls, db, 18, ts+16320 /* "statement too lo..." */, 0)
+ Xsqlite3ErrorWithMsg(tls, db, 18, ts+19303 /* "statement too lo..." */, 0)
rc = Xsqlite3ApiExit(tls, db, 18)
goto end_prepare
__10:
@@ -104613,7 +108371,7 @@ __19:
if !(*(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */)) != 0) {
goto __21
}
- Xsqlite3ErrorWithMsg(tls, db, rc, ts+696 /* "%s" */, crt.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */))))
+ Xsqlite3ErrorWithMsg(tls, db, rc, ts+805 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */))))
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 440 /* zErrMsg */)))
goto __22
__21:
@@ -104638,18 +108396,18 @@ end_prepare:
Xsqlite3ParserReset(tls, bp+16 /* &sParse */)
return rc
}
-func sqlite3LockAndPrepare(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pOld uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:128712:12: */
+func sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, pOld uintptr, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129056:12: */
var rc int32
var cnt int32 = 0
*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
if !(Xsqlite3SafetyCheckOk(tls, db) != 0) || (zSql == uintptr(0)) {
- return Xsqlite3MisuseError(tls, 128729)
+ return Xsqlite3MisuseError(tls, 129073)
}
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
Xsqlite3BtreeEnterAll(tls, db)
for ok := true; ok; ok = ((rc == (1 | (int32(2) << 8))) ||
- ((rc == 17) && ((func() int32 { Xsqlite3ResetOneSchema(tls, db, -1); return crt.PostIncInt32(&cnt, 1) }()) == 0))) {
+ ((rc == 17) && ((func() int32 { Xsqlite3ResetOneSchema(tls, db, -1); return libc.PostIncInt32(&cnt, 1) }()) == 0))) {
// Make multiple attempts to compile the SQL, until it either succeeds
// or encounters a permanent error. A schema problem after one schema
// reset is considered a permanent error.
@@ -104666,9 +108424,9 @@ func sqlite3LockAndPrepare(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32,
//
// If the statement is successfully recompiled, return SQLITE_OK. Otherwise,
// if the statement cannot be recompiled because another connection has
-// locked the sqlite3_master table, return SQLITE_LOCKED. If any other error
+// locked the sqlite3_schema table, return SQLITE_LOCKED. If any other error
// occurs, return SQLITE_SCHEMA.
-func Xsqlite3Reprepare(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:128757:20: */
+func Xsqlite3Reprepare(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:129101:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -104706,13 +108464,13 @@ func Xsqlite3Reprepare(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:128757:20:
// sqlite3_step(). In the new version, the original SQL text is retained
// and the statement is automatically recompiled if an schema change
// occurs.
-func Xsqlite3_prepare(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:128796:16: */
+func Xsqlite3_prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129140:16: */
var rc int32
rc = sqlite3LockAndPrepare(tls, db, zSql, nBytes, uint32(0), uintptr(0), ppStmt, pzTail)
// VERIFY: F13021
return rc
}
-func Xsqlite3_prepare_v2(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:128808:16: */
+func Xsqlite3_prepare_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129152:16: */
var rc int32
// EVIDENCE-OF: R-37923-12173 The sqlite3_prepare_v2() interface works
// exactly the same as sqlite3_prepare_v3() with a zero prepFlags
@@ -104724,7 +108482,7 @@ func Xsqlite3_prepare_v2(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, p
return rc
}
-func Xsqlite3_prepare_v3(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:128826:16: */
+func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129170:16: */
var rc int32
// EVIDENCE-OF: R-56861-42673 sqlite3_prepare_v3() differs from
// sqlite3_prepare_v2() only in having the extra prepFlags parameter,
@@ -104741,7 +108499,7 @@ func Xsqlite3_prepare_v3(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, p
}
// Compile the UTF-16 encoded SQL statement zSql into a statement handle.
-func sqlite3Prepare16(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:128854:12: */
+func sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags U32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129198:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -104754,7 +108512,7 @@ func sqlite3Prepare16(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, prep
*(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
if !(Xsqlite3SafetyCheckOk(tls, db) != 0) || (zSql == uintptr(0)) {
- return Xsqlite3MisuseError(tls, 128875)
+ return Xsqlite3MisuseError(tls, 129219)
}
if nBytes >= 0 {
var sz int32
@@ -104789,19 +108547,19 @@ func sqlite3Prepare16(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, prep
// sqlite3_step(). In the new version, the original SQL text is retained
// and the statement is automatically recompiled if an schema change
// occurs.
-func Xsqlite3_prepare16(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:128912:16: */
+func Xsqlite3_prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129256:16: */
var rc int32
rc = sqlite3Prepare16(tls, db, zSql, nBytes, uint32(0), ppStmt, pzTail)
// VERIFY: F13021
return rc
}
-func Xsqlite3_prepare16_v2(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:128924:16: */
+func Xsqlite3_prepare16_v2(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129268:16: */
var rc int32
rc = sqlite3Prepare16(tls, db, zSql, nBytes, uint32(0x80), ppStmt, pzTail)
// VERIFY: F13021
return rc
}
-func Xsqlite3_prepare16_v3(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:128936:16: */
+func Xsqlite3_prepare16_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags uint32, ppStmt uintptr, pzTail uintptr) int32 { /* sqlite3.c:129280:16: */
var rc int32
rc = sqlite3Prepare16(tls, db, zSql, nBytes,
(uint32(0x80) | (prepFlags & uint32(0x0f))),
@@ -104826,8 +108584,6 @@ func Xsqlite3_prepare16_v3(tls *crt.TLS, db uintptr, zSql uintptr, nBytes int32,
// to handle SELECT statements in SQLite.
// #include "sqliteInt.h"
-// Trace output macros
-
// An instance of the following object is used to record information about
// how to process the DISTINCT keyword, to simplify passing that information
// into the selectInnerLoop() routine.
@@ -104854,12 +108610,10 @@ type DistinctCtx1 = struct {
// to handle SELECT statements in SQLite.
// #include "sqliteInt.h"
-// Trace output macros
-
// An instance of the following object is used to record information about
// how to process the DISTINCT keyword, to simplify passing that information
// into the selectInnerLoop() routine.
-type DistinctCtx = DistinctCtx1 /* sqlite3.c:128991:28 */
+type DistinctCtx = DistinctCtx1 /* sqlite3.c:129321:28 */
// An instance of the following object is used to record information about
// the ORDER BY (or GROUP BY) clause of query is being coded.
@@ -104906,7 +108660,7 @@ type SortCtx1 = struct {
// When the sorter-reference optimization is used, there is one entry in the
// aDefer[] array for each database table that may be read as values are
// extracted from the sorter.
-type SortCtx = SortCtx1 /* sqlite3.c:129017:24 */
+type SortCtx = SortCtx1 /* sqlite3.c:129347:24 */
type RowLoadInfo1 = struct {
FregResult int32
FecelFlags U8
@@ -104918,7 +108672,7 @@ type RowLoadInfo1 = struct {
//
// If bFree==1, call sqlite3DbFree() on the p object.
// If bFree==0, Leave the first Select object unfreed
-func clearSelect(tls *crt.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3.c:129047:13: */
+func clearSelect(tls *libc.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3.c:129377:13: */
for p != 0 {
var pPrior uintptr = (*Select)(unsafe.Pointer(p)).FpPrior
Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpEList)
@@ -104943,9 +108697,10 @@ func clearSelect(tls *crt.TLS, db uintptr, p uintptr, bFree int32) { /* sqlite3.
}
// Initialize a SelectDest structure.
-func Xsqlite3SelectDestInit(tls *crt.TLS, pDest uintptr, eDest int32, iParm int32) { /* sqlite3.c:129072:21: */
+func Xsqlite3SelectDestInit(tls *libc.TLS, pDest uintptr, eDest int32, iParm int32) { /* sqlite3.c:129402:21: */
(*SelectDest)(unsafe.Pointer(pDest)).FeDest = U8(eDest)
(*SelectDest)(unsafe.Pointer(pDest)).FiSDParm = iParm
+ (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = 0
(*SelectDest)(unsafe.Pointer(pDest)).FzAffSdst = uintptr(0)
(*SelectDest)(unsafe.Pointer(pDest)).FiSdst = 0
(*SelectDest)(unsafe.Pointer(pDest)).FnSdst = 0
@@ -104953,14 +108708,15 @@ func Xsqlite3SelectDestInit(tls *crt.TLS, pDest uintptr, eDest int32, iParm int3
// Allocate a new Select structure and return a pointer to that
// structure.
-func Xsqlite3SelectNew(tls *crt.TLS, pParse uintptr, pEList uintptr, pSrc uintptr, pWhere uintptr, pGroupBy uintptr, pHaving uintptr, pOrderBy uintptr, selFlags U32, pLimit uintptr) uintptr { /* sqlite3.c:129085:23: */
+func Xsqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintptr, pWhere uintptr, pGroupBy uintptr, pHaving uintptr, pOrderBy uintptr, selFlags U32, pLimit uintptr) uintptr { /* sqlite3.c:129416:23: */
bp := tls.Alloc(128)
defer tls.Free(128)
var pNew uintptr
+ var pAllocated uintptr
// var standin Select at bp, 128
- pNew = Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Select{})))
+ pAllocated = libc.AssignUintptr(&pNew, Xsqlite3DbMallocRawNN(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Select{}))))
if pNew == uintptr(0) {
pNew = bp /* &standin */
@@ -104974,7 +108730,7 @@ func Xsqlite3SelectNew(tls *crt.TLS, pParse uintptr, pEList uintptr, pSrc uintpt
(*Select)(unsafe.Pointer(pNew)).FselFlags = selFlags
(*Select)(unsafe.Pointer(pNew)).FiLimit = 0
(*Select)(unsafe.Pointer(pNew)).FiOffset = 0
- (*Select)(unsafe.Pointer(pNew)).FselId = U32(crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnSelect, 1))
+ (*Select)(unsafe.Pointer(pNew)).FselId = U32(libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnSelect, 1))
*(*int32)(unsafe.Pointer((pNew + 20 /* &.addrOpenEphm */) + uintptr(0)*4)) = -1
*(*int32)(unsafe.Pointer((pNew + 20 /* &.addrOpenEphm */) + uintptr(1)*4)) = -1
(*Select)(unsafe.Pointer(pNew)).FnSelectRow = int16(0)
@@ -104993,36 +108749,22 @@ func Xsqlite3SelectNew(tls *crt.TLS, pParse uintptr, pEList uintptr, pSrc uintpt
(*Select)(unsafe.Pointer(pNew)).FpWin = uintptr(0)
(*Select)(unsafe.Pointer(pNew)).FpWinDefn = uintptr(0)
if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
- clearSelect(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew, (crt.Bool32(pNew != bp /* &standin */)))
- pNew = uintptr(0)
+ clearSelect(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pNew, (libc.Bool32(pNew != bp /* &standin */)))
+ pAllocated = uintptr(0)
} else {
}
-
- return pNew
+ return pAllocated
}
// Delete the given Select structure and all of its substructures.
-func Xsqlite3SelectDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:129144:21: */
+func Xsqlite3SelectDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:129474:21: */
if p != 0 {
clearSelect(tls, db, p, 1)
}
}
-// Delete all the substructure for p, but keep p allocated. Redefine
-// p to be a single SELECT where every column of the result set has a
-// value of NULL.
-func Xsqlite3SelectReset(tls *crt.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:129153:21: */
- if p != 0 {
- clearSelect(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, p, 0)
- crt.Xmemset(tls, (p + 8 /* &.iLimit */), 0, (uint64(unsafe.Sizeof(Select{})) - (uint64((uintptr(0) + 8 /* &.iLimit */)))))
- (*Select)(unsafe.Pointer(p)).FpEList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0),
- Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 119, uintptr(0), 0))
- (*Select)(unsafe.Pointer(p)).FpSrc = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(SrcList{})))
- }
-}
-
// Return a pointer to the right-most SELECT statement in a compound.
-func findRightmost(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:129166:15: */
+func findRightmost(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:129481:15: */
for (*Select)(unsafe.Pointer(p)).FpNext != 0 {
p = (*Select)(unsafe.Pointer(p)).FpNext
}
@@ -105044,7 +108786,7 @@ func findRightmost(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:129166:15: */
//
// If an illegal or unsupported join type is seen, then still return
// a join type, but put an error in the pParse structure.
-func Xsqlite3JoinType(tls *crt.TLS, pParse uintptr, pA uintptr, pB uintptr, pC uintptr) int32 { /* sqlite3.c:129188:20: */
+func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC uintptr) int32 { /* sqlite3.c:129503:20: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -105081,24 +108823,24 @@ func Xsqlite3JoinType(tls *crt.TLS, pParse uintptr, pA uintptr, pB uintptr, pC u
}
}
if ((jointype & (0x0001 | 0x0020)) == (0x0001 | 0x0020)) || ((jointype & 0x0040) != 0) {
- var zSp uintptr = ts + 13208 /* " " */
+ var zSp uintptr = ts + 15984 /* " " */
if pC == uintptr(0) {
zSp++
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+16339 /* "unknown or unsup..." */, crt.VaList(bp, pA, pB, zSp, pC))
+ ts+19322 /* "unknown or unsup..." */, libc.VaList(bp, pA, pB, zSp, pC))
jointype = 0x0001
} else if ((jointype & 0x0020) != 0) &&
((jointype & (0x0008 | 0x0010)) != 0x0008) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+16383 /* "RIGHT and FULL O..." */, 0)
+ ts+19366 /* "RIGHT and FULL O..." */, 0)
jointype = 0x0001
}
return jointype
}
-var zKeyText = *(*[34]int8)(unsafe.Pointer(ts + 16438 /* "naturaleftouteri..." */)) /* sqlite3.c:129193:21 */
+var zKeyText = *(*[34]int8)(unsafe.Pointer(ts + 19421 /* "naturaleftouteri..." */)) /* sqlite3.c:129508:21 */
var aKeyword = [7]struct {
Fi U8
FnChar U8
@@ -105111,17 +108853,33 @@ var aKeyword = [7]struct {
/* full */ {Fi: U8(19), FnChar: U8(4), Fcode: (U8((0x0008 | 0x0010) | 0x0020))},
/* inner */ {Fi: U8(23), FnChar: U8(5), Fcode: U8(0x0001)},
/* cross */ {Fi: U8(28), FnChar: U8(5), Fcode: (U8(0x0001 | 0x0002))},
-} /* sqlite3.c:129198:5 */
+} /* sqlite3.c:129513:5 */
// Return the index of a column in a table. Return -1 if the column
// is not contained in the table.
-func columnIndex(tls *crt.TLS, pTab uintptr, zCol uintptr) int32 { /* sqlite3.c:129249:12: */
+func columnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) int32 { /* sqlite3.c:129564:12: */
var i int32
- for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
- if Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FzName, zCol) == 0 {
+ var h U8 = Xsqlite3StrIHash(tls, zCol)
+ var pCol uintptr
+ pCol = (*Table)(unsafe.Pointer(pTab)).FaCol
+ i = 0
+__1:
+ if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
+ goto __3
+ }
+ {
+ if (int32((*Column)(unsafe.Pointer(pCol)).FhName) == int32(h)) && (Xsqlite3StrICmp(tls, (*Column)(unsafe.Pointer(pCol)).FzName, zCol) == 0) {
return i
}
}
+ goto __2
+__2:
+ pCol += 32
+ i++
+ goto __1
+ goto __3
+__3:
+ ;
return -1
}
@@ -105132,7 +108890,7 @@ func columnIndex(tls *crt.TLS, pTab uintptr, zCol uintptr) int32 { /* sqlite3.c:
// of the matching column and return TRUE.
//
// If not found, return FALSE.
-func tableAndColumnIndex(tls *crt.TLS, pSrc uintptr, N int32, zCol uintptr, piTab uintptr, piCol uintptr, bIgnoreHidden int32) int32 { /* sqlite3.c:129266:12: */
+func tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, N int32, zCol uintptr, piTab uintptr, piCol uintptr, bIgnoreHidden int32) int32 { /* sqlite3.c:129583:12: */
var i int32 // For looping over tables in pSrc
var iCol int32 // Index of column matching zCol
@@ -105140,7 +108898,7 @@ func tableAndColumnIndex(tls *crt.TLS, pSrc uintptr, N int32, zCol uintptr, piTa
for i = 0; i < N; i++ {
iCol = columnIndex(tls, (*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpTab, zCol)
if (iCol >= 0) &&
- ((bIgnoreHidden == 0) || ((crt.Bool32((int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpTab)).FaCol + uintptr(iCol)*32))).FcolFlags) & 0x0002) != 0)) == 0)) {
+ ((bIgnoreHidden == 0) || ((libc.Bool32((int32((*Column)(unsafe.Pointer(((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(i)*112)).FpTab)).FaCol + uintptr(iCol)*32))).FcolFlags) & 0x0002) != 0)) == 0)) {
if piTab != 0 {
*(*int32)(unsafe.Pointer(piTab)) = i
*(*int32)(unsafe.Pointer(piCol)) = iCol
@@ -105160,7 +108918,7 @@ func tableAndColumnIndex(tls *crt.TLS, pSrc uintptr, N int32, zCol uintptr, piTa
// where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the
// (iSrc+1)'th. Column col1 is column iColLeft of tab1, and col2 is
// column iColRight of tab2.
-func addWhereTerm(tls *crt.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iColLeft int32, iRight int32, iColRight int32, isOuterJoin int32, ppWhere uintptr) { /* sqlite3.c:129304:13: */
+func addWhereTerm(tls *libc.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iColLeft int32, iRight int32, iColRight int32, isOuterJoin int32, ppWhere uintptr) { /* sqlite3.c:129621:13: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pE1 uintptr
var pE2 uintptr
@@ -105202,7 +108960,7 @@ func addWhereTerm(tls *crt.TLS, pParse uintptr, pSrc uintptr, iLeft int32, iColL
// defer the handling of t1.x=5, it will be processed immediately
// after the t1 loop and rows with t1.x!=5 will never appear in
// the output, which is incorrect.
-func Xsqlite3SetJoinExpr(tls *crt.TLS, p uintptr, iTable int32) { /* sqlite3.c:129363:21: */
+func Xsqlite3SetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:129680:21: */
for p != 0 {
*(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) |= (U32(0x000001))
@@ -105223,11 +108981,11 @@ func Xsqlite3SetJoinExpr(tls *crt.TLS, p uintptr, iTable int32) { /* sqlite3.c:1
// an ordinary term that omits the EP_FromJoin mark.
//
// This happens when a LEFT JOIN is simplified into an ordinary JOIN.
-func unsetJoinExpr(tls *crt.TLS, p uintptr, iTable int32) { /* sqlite3.c:129386:13: */
+func unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32) { /* sqlite3.c:129703:13: */
for p != 0 {
if (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(0x000001))) != U32(0)) &&
((iTable < 0) || (int32((*Expr)(unsafe.Pointer(p)).FiRightJoinTable) == iTable)) {
- *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (^U32(crt.Int32FromInt32(0x000001)))
+ *(*U32)(unsafe.Pointer(p + 4 /* &.flags */)) &= (^U32(libc.Int32FromInt32(0x000001)))
}
if (int32((*Expr)(unsafe.Pointer(p)).Fop) == 169) && (*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) != 0) {
var i int32
@@ -105252,7 +109010,7 @@ func unsetJoinExpr(tls *crt.TLS, p uintptr, iTable int32) { /* sqlite3.c:129386:
// also attached to the left entry.
//
// This routine returns the number of errors encountered.
-func sqliteProcessJoin(tls *crt.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:129417:12: */
+func sqliteProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:129734:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -105277,14 +109035,14 @@ __1:
if ((*SrcList_item)(unsafe.Pointer(pLeft)).FpTab == uintptr(0)) || (pRightTab == uintptr(0)) {
goto __2
}
- isOuter = (crt.Bool32((int32((*SrcList_item)(unsafe.Pointer(pRight)).Ffg.Fjointype) & 0x0020) != 0))
+ isOuter = (libc.Bool32((int32((*SrcList_item)(unsafe.Pointer(pRight)).Ffg.Fjointype) & 0x0020) != 0))
// When the NATURAL keyword is present, add WHERE clause terms for
// every column that the two tables have in common.
if (int32((*SrcList_item)(unsafe.Pointer(pRight)).Ffg.Fjointype) & 0x0004) != 0 {
if ((*SrcList_item)(unsafe.Pointer(pRight)).FpOn != 0) || ((*SrcList_item)(unsafe.Pointer(pRight)).FpUsing != 0) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+16472 /* "a NATURAL join m..." */, crt.VaList(bp, 0))
+ ts+19455 /* "a NATURAL join m..." */, libc.VaList(bp, 0))
return 1
}
for j = 0; j < int32((*Table)(unsafe.Pointer(pRightTab)).FnCol); j++ {
@@ -105308,7 +109066,7 @@ __1:
// Disallow both ON and USING clauses in the same join
if ((*SrcList_item)(unsafe.Pointer(pRight)).FpOn != 0) && ((*SrcList_item)(unsafe.Pointer(pRight)).FpUsing != 0) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+16522 /* "cannot have both..." */, 0)
+ ts+19505 /* "cannot have both..." */, 0)
return 1
}
@@ -105343,7 +109101,7 @@ __1:
if (iRightCol < 0) ||
!(tableAndColumnIndex(tls, pSrc, (i+1), zName, bp+24 /* &iLeft */, bp+28 /* &iLeftCol */, 0) != 0) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+16577 /* "cannot join usin..." */, crt.VaList(bp+8, zName))
+ ts+19560 /* "cannot join usin..." */, libc.VaList(bp+8, zName))
return 1
}
addWhereTerm(tls, pParse, pSrc, *(*int32)(unsafe.Pointer(bp + 24 /* iLeft */)), *(*int32)(unsafe.Pointer(bp + 28 /* iLeftCol */)), (i + 1), iRightCol,
@@ -105365,11 +109123,11 @@ __3:
// An instance of this object holds information (beyond pParse and pSelect)
// needed to load the next result row that is to be added to the sorter.
-type RowLoadInfo = RowLoadInfo1 /* sqlite3.c:129509:28 */
+type RowLoadInfo = RowLoadInfo1 /* sqlite3.c:129826:28 */
// This routine does the work of loading query data into an array of
// registers so that it can be added to the sorter.
-func innerLoopLoadRow(tls *crt.TLS, pParse uintptr, pSelect uintptr, pInfo uintptr) { /* sqlite3.c:129523:13: */
+func innerLoopLoadRow(tls *libc.TLS, pParse uintptr, pSelect uintptr, pInfo uintptr) { /* sqlite3.c:129840:13: */
Xsqlite3ExprCodeExprList(tls, pParse, (*Select)(unsafe.Pointer(pSelect)).FpEList, (*RowLoadInfo)(unsafe.Pointer(pInfo)).FregResult,
0, (*RowLoadInfo)(unsafe.Pointer(pInfo)).FecelFlags)
}
@@ -105378,10 +109136,10 @@ func innerLoopLoadRow(tls *crt.TLS, pParse uintptr, pSelect uintptr, pInfo uintp
// added into the sorter.
//
// Return the register in which the result is stored.
-func makeSorterRecord(tls *crt.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regBase int32, nBase int32) int32 { /* sqlite3.c:129544:12: */
+func makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regBase int32, nBase int32) int32 { /* sqlite3.c:129861:12: */
var nOBSat int32 = (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
- var regOut int32 = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ var regOut int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
if (*SortCtx)(unsafe.Pointer(pSort)).FpDeferredRowLoad != 0 {
innerLoopLoadRow(tls, pParse, pSelect, (*SortCtx)(unsafe.Pointer(pSort)).FpDeferredRowLoad)
}
@@ -105391,9 +109149,9 @@ func makeSorterRecord(tls *crt.TLS, pParse uintptr, pSort uintptr, pSelect uintp
// Generate code that will push the record in registers regData
// through regData+nData-1 onto the sorter.
-func pushOntoSorter(tls *crt.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regData int32, regOrigData int32, nData int32, nPrefixReg int32) { /* sqlite3.c:129565:13: */
+func pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintptr, regData int32, regOrigData int32, nData int32, nPrefixReg int32) { /* sqlite3.c:129882:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Stmt under construction
- var bSeq int32 = (crt.Bool32((int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags) & 0x01) == 0))
+ var bSeq int32 = (libc.Bool32((int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags) & 0x01) == 0))
var nExpr int32 = (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr // No. of ORDER BY terms
var nBase int32 = ((nExpr + bSeq) + nData) // Fields in sorter record
var regBase int32 // Regs for sorter record
@@ -105468,7 +109226,7 @@ func pushOntoSorter(tls *crt.TLS, pParse uintptr, pSort uintptr, pSelect uintptr
}
(*VdbeOp)(unsafe.Pointer(pOp)).Fp2 = (nKey + nData)
pKI = *(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */))
- crt.Xmemset(tls, (*KeyInfo)(unsafe.Pointer(pKI)).FaSortFlags, 0, uint64((*KeyInfo)(unsafe.Pointer(pKI)).FnKeyField)) // Makes OP_Jump testable
+ libc.Xmemset(tls, (*KeyInfo)(unsafe.Pointer(pKI)).FaSortFlags, 0, uint64((*KeyInfo)(unsafe.Pointer(pKI)).FnKeyField)) // Makes OP_Jump testable
Xsqlite3VdbeChangeP4(tls, v, -1, pKI, -9)
*(*uintptr)(unsafe.Pointer(pOp + 16 /* &.p4 */)) = Xsqlite3KeyInfoFromExprList(tls, pParse, (*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy, nOBSat,
@@ -105477,7 +109235,7 @@ func pushOntoSorter(tls *crt.TLS, pParse uintptr, pSort uintptr, pSelect uintptr
addrJmp = Xsqlite3VdbeCurrentAddr(tls, v)
Xsqlite3VdbeAddOp3(tls, v, 16, (addrJmp + 1), 0, (addrJmp + 1))
(*SortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = Xsqlite3VdbeMakeLabel(tls, pParse)
- (*SortCtx)(unsafe.Pointer(pSort)).FregReturn = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ (*SortCtx)(unsafe.Pointer(pSort)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 12, (*SortCtx)(unsafe.Pointer(pSort)).FregReturn, (*SortCtx)(unsafe.Pointer(pSort)).FlabelBkOut)
Xsqlite3VdbeAddOp1(tls, v, 138, (*SortCtx)(unsafe.Pointer(pSort)).FiECursor)
if iLimit != 0 {
@@ -105533,9 +109291,10 @@ func pushOntoSorter(tls *crt.TLS, pParse uintptr, pSort uintptr, pSelect uintptr
}
// Add code to implement the OFFSET
-func codeOffset(tls *crt.TLS, v uintptr, iOffset int32, iContinue int32) { /* sqlite3.c:129707:13: */
+func codeOffset(tls *libc.TLS, v uintptr, iOffset int32, iContinue int32) { /* sqlite3.c:130024:13: */
if iOffset > 0 {
Xsqlite3VdbeAddOp3(tls, v, 48, iOffset, iContinue, 1)
+ Xsqlite3VdbeComment(tls, v, ts+19624 /* "OFFSET" */, 0)
}
}
@@ -105546,7 +109305,7 @@ func codeOffset(tls *crt.TLS, v uintptr, iOffset int32, iContinue int32) { /* sq
//
// A jump to addrRepeat is made and the N+1 values are popped from the
// stack if the top N elements are not distinct.
-func codeDistinct(tls *crt.TLS, pParse uintptr, iTab int32, addrRepeat int32, N int32, iMem int32) { /* sqlite3.c:129727:13: */
+func codeDistinct(tls *libc.TLS, pParse uintptr, iTab int32, addrRepeat int32, N int32, iMem int32) { /* sqlite3.c:130044:13: */
var v uintptr
var r1 int32
@@ -105566,9 +109325,9 @@ func codeDistinct(tls *crt.TLS, pParse uintptr, iTab int32, addrRepeat int32, N
// are evaluated in order to get the data for this row. If srcTab is
// zero or more, then data is pulled from srcTab and p->pEList is used only
// to get the number of columns and the collation sequence for each column.
-func selectInnerLoop(tls *crt.TLS, pParse uintptr, p uintptr, srcTab int32, pSort uintptr, pDistinct uintptr, pDest uintptr, iContinue int32, iBreak int32) { /* sqlite3.c:129836:13: */
- bp := tls.Alloc(8)
- defer tls.Free(8)
+func selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pSort uintptr, pDistinct uintptr, pDest uintptr, iContinue int32, iBreak int32) { /* sqlite3.c:130153:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var i int32
@@ -105577,7 +109336,7 @@ func selectInnerLoop(tls *crt.TLS, pParse uintptr, p uintptr, srcTab int32, pSor
var iParm int32 = (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm // First argument to disposal method
var nResultCol int32 // Number of result columns
var nPrefixReg int32 = 0 // Number of extra registers before regResult
- // var sRowLoadInfo RowLoadInfo at bp, 8
+ // var sRowLoadInfo RowLoadInfo at bp+8, 8
// Info for deferred row loading
// Usually, regResult is the first cell in an array of memory cells
@@ -105623,10 +109382,11 @@ func selectInnerLoop(tls *crt.TLS, pParse uintptr, p uintptr, srcTab int32, pSor
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nResultCol)
}
(*SelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol
- regOrig = crt.AssignInt32(&regResult, (*SelectDest)(unsafe.Pointer(pDest)).FiSdst)
+ regOrig = libc.AssignInt32(&regResult, (*SelectDest)(unsafe.Pointer(pDest)).FiSdst)
if srcTab >= 0 {
for i = 0; i < nResultCol; i++ {
Xsqlite3VdbeAddOp3(tls, v, 89, srcTab, i, (regResult + i))
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpEList+8 /* &.a */)+uintptr(i)*32)).FzEName))
}
} else if eDest != 3 {
// If the destination is an EXISTS(...) expression, the actual
@@ -105649,7 +109409,7 @@ func selectInnerLoop(tls *crt.TLS, pParse uintptr, p uintptr, srcTab int32, pSor
for i = (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat; i < (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy)).FnExpr; i++ {
var j int32
- if (crt.AssignInt32(&j, int32((*struct {
+ if (libc.AssignInt32(&j, int32((*struct {
FiOrderByCol U16
FiAlias U16
})(unsafe.Pointer(((*SortCtx)(unsafe.Pointer(pSort)).FpOrderBy+8 /* &.a */)+uintptr(i)*32+24 /* &.u */)).FiOrderByCol))) > 0 {
@@ -105674,16 +109434,16 @@ func selectInnerLoop(tls *crt.TLS, pParse uintptr, p uintptr, srcTab int32, pSor
}
}
- (*RowLoadInfo)(unsafe.Pointer(bp /* &sRowLoadInfo */)).FregResult = regResult
- (*RowLoadInfo)(unsafe.Pointer(bp /* &sRowLoadInfo */)).FecelFlags = ecelFlags
+ (*RowLoadInfo)(unsafe.Pointer(bp + 8 /* &sRowLoadInfo */)).FregResult = regResult
+ (*RowLoadInfo)(unsafe.Pointer(bp + 8 /* &sRowLoadInfo */)).FecelFlags = ecelFlags
if (((*Select)(unsafe.Pointer(p)).FiLimit != 0) &&
((int32(ecelFlags) & 0x08) != 0)) &&
(nPrefixReg > 0) {
- (*SortCtx)(unsafe.Pointer(pSort)).FpDeferredRowLoad = bp /* &sRowLoadInfo */
+ (*SortCtx)(unsafe.Pointer(pSort)).FpDeferredRowLoad = bp + 8 /* &sRowLoadInfo */
regOrig = 0
} else {
- innerLoopLoadRow(tls, pParse, p, bp /* &sRowLoadInfo */)
+ innerLoopLoadRow(tls, pParse, p, bp+8 /* &sRowLoadInfo */)
}
}
@@ -105810,6 +109570,31 @@ func selectInnerLoop(tls *crt.TLS, pParse uintptr, p uintptr, srcTab int32, pSor
break
}
+ case 15:
+ {
+ if pSort != 0 {
+ pushOntoSorter(tls,
+ pParse, pSort, p, regResult, regOrig, nResultCol, nPrefixReg)
+ } else {
+ var i2 int32 = (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm2
+ var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
+
+ // If the UPDATE FROM join is an aggregate that matches no rows, it
+ // might still be trying to return one row, because that is what
+ // aggregates do. Don't record that empty row in the output table.
+ Xsqlite3VdbeAddOp2(tls, v, 50, regResult, iBreak)
+
+ Xsqlite3VdbeAddOp3(tls, v, 91,
+ (regResult + (libc.Bool32(i2 < 0))), (nResultCol - (libc.Bool32(i2 < 0))), r1)
+ if i2 < 0 {
+ Xsqlite3VdbeAddOp3(tls, v, 121, iParm, r1, regResult)
+ } else {
+ Xsqlite3VdbeAddOp4Int(tls, v, 130, iParm, r1, regResult, i2)
+ }
+ }
+ break
+ }
+
// If we are creating a set for an "expr IN (SELECT ...)" construct,
// then there should be a single item on the stack. Write this
// item into the set table with bogus data.
@@ -105945,7 +109730,7 @@ func selectInnerLoop(tls *crt.TLS, pParse uintptr, p uintptr, srcTab int32, pSor
// Allocate a KeyInfo object sufficient for an index of N key columns and
// X extra columns.
-func Xsqlite3KeyInfoAlloc(tls *crt.TLS, db uintptr, N int32, X int32) uintptr { /* sqlite3.c:130252:24: */
+func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr { /* sqlite3.c:130595:24: */
var nExtra int32 = (int32(((uint64(N + X)) * (uint64(unsafe.Sizeof(uintptr(0))) + uint64(1))) - uint64(unsafe.Sizeof(uintptr(0)))))
var p uintptr = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(unsafe.Sizeof(KeyInfo{})) + uint64(nExtra))))
if p != 0 {
@@ -105955,7 +109740,7 @@ func Xsqlite3KeyInfoAlloc(tls *crt.TLS, db uintptr, N int32, X int32) uintptr {
(*KeyInfo)(unsafe.Pointer(p)).Fenc = (*Sqlite3)(unsafe.Pointer(db)).Fenc
(*KeyInfo)(unsafe.Pointer(p)).Fdb = db
(*KeyInfo)(unsafe.Pointer(p)).FnRef = U32(1)
- crt.Xmemset(tls, (p + uintptr(1)*40), 0, uint64(nExtra))
+ libc.Xmemset(tls, (p + uintptr(1)*40), 0, uint64(nExtra))
} else {
Xsqlite3OomFault(tls, db)
}
@@ -105963,7 +109748,7 @@ func Xsqlite3KeyInfoAlloc(tls *crt.TLS, db uintptr, N int32, X int32) uintptr {
}
// Deallocate a KeyInfo object
-func Xsqlite3KeyInfoUnref(tls *crt.TLS, p uintptr) { /* sqlite3.c:130272:21: */
+func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr) { /* sqlite3.c:130615:21: */
if p != 0 {
(*KeyInfo)(unsafe.Pointer(p)).FnRef--
@@ -105974,7 +109759,7 @@ func Xsqlite3KeyInfoUnref(tls *crt.TLS, p uintptr) { /* sqlite3.c:130272:21: */
}
// Make a new pointer to a KeyInfo object
-func Xsqlite3KeyInfoRef(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:130283:24: */
+func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:130626:24: */
if p != 0 {
(*KeyInfo)(unsafe.Pointer(p)).FnRef++
@@ -105994,7 +109779,7 @@ func Xsqlite3KeyInfoRef(tls *crt.TLS, p uintptr) uintptr { /* sqlite3.c:130283:2
// Space to hold the KeyInfo structure is obtained from malloc. The calling
// function is responsible for seeing that this structure is eventually
// freed.
-func Xsqlite3KeyInfoFromExprList(tls *crt.TLS, pParse uintptr, pList uintptr, iStart int32, nExtra int32) uintptr { /* sqlite3.c:130315:24: */
+func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, iStart int32, nExtra int32) uintptr { /* sqlite3.c:130658:24: */
var nExpr int32
var pInfo uintptr
var pItem uintptr
@@ -106027,20 +109812,20 @@ func Xsqlite3KeyInfoFromExprList(tls *crt.TLS, pParse uintptr, pList uintptr, iS
}
// Name of the connection operator, used for error messages.
-func selectOpName(tls *crt.TLS, id int32) uintptr { /* sqlite3.c:130342:19: */
+func selectOpName(tls *libc.TLS, id int32) uintptr { /* sqlite3.c:130685:19: */
var z uintptr
switch id {
case 133:
- z = ts + 16641 /* "UNION ALL" */
+ z = ts + 19631 /* "UNION ALL" */
break
case 135:
- z = ts + 16651 /* "INTERSECT" */
+ z = ts + 19641 /* "INTERSECT" */
break
case 134:
- z = ts + 16661 /* "EXCEPT" */
+ z = ts + 19651 /* "EXCEPT" */
break
default:
- z = ts + 16668 /* "UNION" */
+ z = ts + 19658 /* "UNION" */
break
}
return z
@@ -106054,11 +109839,11 @@ func selectOpName(tls *crt.TLS, id int32) uintptr { /* sqlite3.c:130342:19: */
//
// where xxx is one of "DISTINCT", "ORDER BY" or "GROUP BY". Exactly which
// is determined by the zUsage argument.
-func explainTempTable(tls *crt.TLS, pParse uintptr, zUsage uintptr) { /* sqlite3.c:130364:13: */
+func explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { /* sqlite3.c:130707:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+16674 /* "USE TEMP B-TREE ..." */, crt.VaList(bp, zUsage))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+19664 /* "USE TEMP B-TREE ..." */, libc.VaList(bp, zUsage))
}
// Assign expression b to lvalue a. A second, no-op, version of this macro
@@ -106071,7 +109856,10 @@ func explainTempTable(tls *crt.TLS, pParse uintptr, zUsage uintptr) { /* sqlite3
// then the results were placed in a sorter. After the loop is terminated
// we need to run the sorter and output the results. The following
// routine generates the code needed to do that.
-func generateSortTail(tls *crt.TLS, pParse uintptr, p uintptr, pSort uintptr, nColumn int32, pDest uintptr) { /* sqlite3.c:130390:13: */
+func generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nColumn int32, pDest uintptr) { /* sqlite3.c:130733:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // The prepared statement
var addrBreak int32 = (*SortCtx)(unsafe.Pointer(pSort)).FlabelDone // Jump here to exit loop
var addrContinue int32 = Xsqlite3VdbeMakeLabel(tls, pParse) // Jump here for next cycle
@@ -106112,8 +109900,8 @@ func generateSortTail(tls *crt.TLS, pParse uintptr, p uintptr, pSort uintptr, nC
}
nKey = ((*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*SortCtx)(unsafe.Pointer(pSort)).FnOBSat)
if (int32((*SortCtx)(unsafe.Pointer(pSort)).FsortFlags) & 0x01) != 0 {
- var regSortOut int32 = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- iSortTab = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ var regSortOut int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iSortTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
if (*SortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 {
addrOnce = Xsqlite3VdbeAddOp0(tls, v, 17)
}
@@ -106155,10 +109943,10 @@ func generateSortTail(tls *crt.TLS, pParse uintptr, p uintptr, pSort uintptr, nC
FiAlias U16
})(unsafe.Pointer(aOutEx+uintptr(i)*32+24 /* &.u */)).FiOrderByCol) - 1)
} else {
- iRead = crt.PostDecInt32(&iCol, 1)
+ iRead = libc.PostDecInt32(&iCol, 1)
}
Xsqlite3VdbeAddOp3(tls, v, 89, iSortTab, iRead, (regRow + i))
-
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp, (*ExprList_item)(unsafe.Pointer(aOutEx+uintptr(i)*32)).FzEName))
}
}
switch eDest {
@@ -106185,6 +109973,18 @@ func generateSortTail(tls *crt.TLS, pParse uintptr, p uintptr, pSort uintptr, nC
// The LIMIT clause will terminate the loop for us
break
}
+ case 15:
+ {
+ var i2 int32 = (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm2
+ var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
+ Xsqlite3VdbeAddOp3(tls, v, 91, (regRow + (libc.Bool32(i2 < 0))), (nColumn - (libc.Bool32(i2 < 0))), r1)
+ if i2 < 0 {
+ Xsqlite3VdbeAddOp3(tls, v, 121, iParm, r1, regRow)
+ } else {
+ Xsqlite3VdbeAddOp4Int(tls, v, 130, iParm, r1, regRow, i2)
+ }
+ break
+ }
default:
{
@@ -106239,12 +110039,15 @@ func generateSortTail(tls *crt.TLS, pParse uintptr, p uintptr, pSort uintptr, nC
//
// This routine has either 3 or 6 parameters depending on whether or not
// the SQLITE_ENABLE_COLUMN_METADATA compile-time option is used.
-func columnTypeImpl(tls *crt.TLS, pNC uintptr, pExpr uintptr) uintptr { /* sqlite3.c:130604:19: */
- bp := tls.Alloc(112)
- defer tls.Free(112)
+func columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr, pzOrigTab uintptr, pzOrigCol uintptr) uintptr { /* sqlite3.c:130958:19: */
+ bp := tls.Alloc(136)
+ defer tls.Free(136)
var zType uintptr = uintptr(0)
var j int32
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* zOrigDb */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 64 /* zOrigTab */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 72 /* zOrigCol */)) = uintptr(0)
switch int32((*Expr)(unsafe.Pointer(pExpr)).Fop) {
case 164:
@@ -106302,16 +110105,27 @@ func columnTypeImpl(tls *crt.TLS, pNC uintptr, pExpr uintptr) uintptr { /* sqlit
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = (*Select)(unsafe.Pointer(pS)).FpSrc
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpNext = pNC
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
- zType = columnTypeImpl(tls, bp /* &sNC */, p)
+ zType = columnTypeImpl(tls, bp /* &sNC */, p, bp+56 /* &zOrigDb */, bp+64 /* &zOrigTab */, bp+72 /* &zOrigCol */)
}
} else {
// A real table or a CTE table
if iCol < 0 {
- zType = ts + 11013 /* "INTEGER" */
+ iCol = int32((*Table)(unsafe.Pointer(pTab)).FiPKey)
+ }
+
+ if iCol < 0 {
+ zType = ts + 13743 /* "INTEGER" */
+ *(*uintptr)(unsafe.Pointer(bp + 72 /* zOrigCol */)) = ts + 10045 /* "rowid" */
} else {
+ *(*uintptr)(unsafe.Pointer(bp + 72 /* zOrigCol */)) = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).FzName
zType = Xsqlite3ColumnType(tls, ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32), uintptr(0))
}
+ *(*uintptr)(unsafe.Pointer(bp + 64 /* zOrigTab */)) = (*Table)(unsafe.Pointer(pTab)).FzName
+ if ((*NameContext)(unsafe.Pointer(pNC)).FpParse != 0) && ((*Table)(unsafe.Pointer(pTab)).FpSchema != 0) {
+ var iDb int32 = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer((*NameContext)(unsafe.Pointer(pNC)).FpParse)).Fdb, (*Table)(unsafe.Pointer(pTab)).FpSchema)
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* zOrigDb */)) = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer((*NameContext)(unsafe.Pointer(pNC)).FpParse)).Fdb)).FaDb + uintptr(iDb)*32)).FzDbSName
+ }
}
break
}
@@ -106320,27 +110134,33 @@ func columnTypeImpl(tls *crt.TLS, pNC uintptr, pExpr uintptr) uintptr { /* sqlit
// The expression is a sub-select. Return the declaration type and
// origin info for the single column in the result set of the SELECT
// statement.
- // var sNC NameContext at bp+56, 56
+ // var sNC NameContext at bp+80, 56
var pS uintptr = *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */))
var p uintptr = (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pS)).FpEList + 8 /* &.a */) + uintptr(0)*32)).FpExpr
- (*NameContext)(unsafe.Pointer(bp + 56 /* &sNC */)).FpSrcList = (*Select)(unsafe.Pointer(pS)).FpSrc
- (*NameContext)(unsafe.Pointer(bp + 56 /* &sNC */)).FpNext = pNC
- (*NameContext)(unsafe.Pointer(bp + 56 /* &sNC */)).FpParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
- zType = columnTypeImpl(tls, bp+56 /* &sNC */, p)
+ (*NameContext)(unsafe.Pointer(bp + 80 /* &sNC */)).FpSrcList = (*Select)(unsafe.Pointer(pS)).FpSrc
+ (*NameContext)(unsafe.Pointer(bp + 80 /* &sNC */)).FpNext = pNC
+ (*NameContext)(unsafe.Pointer(bp + 80 /* &sNC */)).FpParse = (*NameContext)(unsafe.Pointer(pNC)).FpParse
+ zType = columnTypeImpl(tls, bp+80 /* &sNC */, p, bp+56 /* &zOrigDb */, bp+64 /* &zOrigTab */, bp+72 /* &zOrigCol */)
break
}
}
+ if pzOrigDb != 0 {
+
+ *(*uintptr)(unsafe.Pointer(pzOrigDb)) = *(*uintptr)(unsafe.Pointer(bp + 56 /* zOrigDb */))
+ *(*uintptr)(unsafe.Pointer(pzOrigTab)) = *(*uintptr)(unsafe.Pointer(bp + 64 /* zOrigTab */))
+ *(*uintptr)(unsafe.Pointer(pzOrigCol)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* zOrigCol */))
+ }
return zType
}
// Generate code that will tell the VDBE the declaration types of columns
// in the result set.
-func generateColumnTypes(tls *crt.TLS, pParse uintptr, pTabList uintptr, pEList uintptr) { /* sqlite3.c:130747:13: */
- bp := tls.Alloc(56)
- defer tls.Free(56)
+func generateColumnTypes(tls *libc.TLS, pParse uintptr, pTabList uintptr, pEList uintptr) { /* sqlite3.c:131101:13: */
+ bp := tls.Alloc(80)
+ defer tls.Free(80)
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var i int32
@@ -106352,8 +110172,18 @@ func generateColumnTypes(tls *crt.TLS, pParse uintptr, pTabList uintptr, pEList
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
var p uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*32)).FpExpr
var zType uintptr
- zType = columnTypeImpl(tls, bp /* &sNC */, p)
- Xsqlite3VdbeSetColName(tls, v, i, 1, zType, crt.UintptrFromInt32(-1))
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* zOrigDb */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 64 /* zOrigTab */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 72 /* zOrigCol */)) = uintptr(0)
+ zType = columnTypeImpl(tls, bp /* &sNC */, p, bp+56 /* &zOrigDb */, bp+64 /* &zOrigTab */, bp+72 /* &zOrigCol */)
+
+ // The vdbe must make its own copy of the column-type and other
+ // column specific strings, in case the schema is reset before this
+ // virtual machine is deleted.
+ Xsqlite3VdbeSetColName(tls, v, i, 2, *(*uintptr)(unsafe.Pointer(bp + 56 /* zOrigDb */)), libc.UintptrFromInt32(-1))
+ Xsqlite3VdbeSetColName(tls, v, i, 3, *(*uintptr)(unsafe.Pointer(bp + 64 /* zOrigTab */)), libc.UintptrFromInt32(-1))
+ Xsqlite3VdbeSetColName(tls, v, i, 4, *(*uintptr)(unsafe.Pointer(bp + 72 /* zOrigCol */)), libc.UintptrFromInt32(-1))
+ Xsqlite3VdbeSetColName(tls, v, i, 1, zType, libc.UintptrFromInt32(-1))
}
}
@@ -106385,7 +110215,7 @@ func generateColumnTypes(tls *crt.TLS, pParse uintptr, pTabList uintptr, pEList
// full=ON, short=ANY: If the result refers directly to a table column,
// then the result column name with the table name
// prefix, ex: TABLE.COLUMN. Otherwise use zSpan.
-func generateColumnNames(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:130814:13: */
+func generateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:131168:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -106415,8 +110245,8 @@ func generateColumnNames(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /* sql
pEList = (*Select)(unsafe.Pointer(pSelect)).FpEList
(*Parse)(unsafe.Pointer(pParse)).FcolNamesSet = U8(1)
- fullName = (crt.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00000004)) != uint64(0)))
- srcName = (crt.Bool32((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00000040)) != uint64(0)) || (fullName != 0)))
+ fullName = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00000004)) != uint64(0)))
+ srcName = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00000040)) != uint64(0)) || (fullName != 0)))
Xsqlite3VdbeSetNumCols(tls, v, (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
for i = 0; i < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; i++ {
var p uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*32)).FpExpr
@@ -106426,7 +110256,7 @@ func generateColumnNames(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /* sql
if ((*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*32)).FzEName != 0) && (int32(*(*uint8)(unsafe.Pointer(((pEList + 8 /* &.a */) + uintptr(i)*32) + 20 /* &.eEName */))&0x3>>0) == 0) {
// An AS clause always takes first priority
var zName uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*32)).FzEName
- Xsqlite3VdbeSetColName(tls, v, i, 0, zName, crt.UintptrFromInt32(-1))
+ Xsqlite3VdbeSetColName(tls, v, i, 0, zName, libc.UintptrFromInt32(-1))
} else if (srcName != 0) && (int32((*Expr)(unsafe.Pointer(p)).Fop) == 164) {
var zCol uintptr
var iCol int32 = int32((*Expr)(unsafe.Pointer(p)).FiColumn)
@@ -106437,25 +110267,25 @@ func generateColumnNames(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /* sql
}
if iCol < 0 {
- zCol = ts + 14283 /* "rowid" */
+ zCol = ts + 10045 /* "rowid" */
} else {
zCol = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).FzName
}
if fullName != 0 {
var zName uintptr = uintptr(0)
- zName = Xsqlite3MPrintf(tls, db, ts+10498 /* "%s.%s" */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, zCol))
- Xsqlite3VdbeSetColName(tls, v, i, 0, zName, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{Xsqlite3MallocSize})))
+ zName = Xsqlite3MPrintf(tls, db, ts+9978 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, zCol))
+ Xsqlite3VdbeSetColName(tls, v, i, 0, zName, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault})))
} else {
- Xsqlite3VdbeSetColName(tls, v, i, 0, zCol, crt.UintptrFromInt32(-1))
+ Xsqlite3VdbeSetColName(tls, v, i, 0, zCol, libc.UintptrFromInt32(-1))
}
} else {
var z uintptr = (*ExprList_item)(unsafe.Pointer((pEList + 8 /* &.a */) + uintptr(i)*32)).FzEName
if z == uintptr(0) {
- z = Xsqlite3MPrintf(tls, db, ts+16697 /* "column%d" */, crt.VaList(bp+16, (i+1)))
+ z = Xsqlite3MPrintf(tls, db, ts+19687 /* "column%d" */, libc.VaList(bp+16, (i+1)))
} else {
z = Xsqlite3DbStrDup(tls, db, z)
}
- Xsqlite3VdbeSetColName(tls, v, i, 0, z, *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{Xsqlite3MallocSize})))
+ Xsqlite3VdbeSetColName(tls, v, i, 0, z, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3OomFault})))
}
}
generateColumnTypes(tls, pParse, pTabList, pEList)
@@ -106481,7 +110311,7 @@ func generateColumnNames(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /* sql
// when modifying this routine to avoid breaking legacy.
//
// See Also: generateColumnNames()
-func Xsqlite3ColumnsFromExprList(tls *crt.TLS, pParse uintptr, pEList uintptr, pnCol uintptr, paCol uintptr) int32 { /* sqlite3.c:130906:20: */
+func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, pnCol uintptr, paCol uintptr) int32 { /* sqlite3.c:131260:20: */
bp := tls.Alloc(60)
defer tls.Free(60)
@@ -106522,7 +110352,7 @@ __1:
}
{
// Get an appropriate name for the column
- if ((crt.AssignUintptr(&zName, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*32)).FzEName)) != uintptr(0)) && (int32(*(*uint8)(unsafe.Pointer(((pEList + 8 /* &.a */) + uintptr(i)*32) + 20 /* &.eEName */))&0x3>>0) == 0) {
+ if ((libc.AssignUintptr(&zName, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*32)).FzEName)) != uintptr(0)) && (int32(*(*uint8)(unsafe.Pointer(((pEList + 8 /* &.a */) + uintptr(i)*32) + 20 /* &.eEName */))&0x3>>0) == 0) {
} else {
var pColExpr uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(i)*32)).FpExpr)
for int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == 139 {
@@ -106539,7 +110369,7 @@ __1:
if iCol >= 0 {
zName = (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32)).FzName
} else {
- zName = ts + 14283 /* "rowid" */
+ zName = ts + 10045 /* "rowid" */
}
} else if int32((*Expr)(unsafe.Pointer(pColExpr)).Fop) == 59 {
@@ -106552,7 +110382,7 @@ __1:
if (zName != 0) && !(Xsqlite3IsTrueOrFalse(tls, zName) != 0) {
zName = Xsqlite3DbStrDup(tls, db, zName)
} else {
- zName = Xsqlite3MPrintf(tls, db, ts+16697 /* "column%d" */, crt.VaList(bp, (i+1)))
+ zName = Xsqlite3MPrintf(tls, db, ts+19687 /* "column%d" */, libc.VaList(bp, (i+1)))
}
// Make sure the column name is unique. If the name is not unique,
@@ -106567,7 +110397,7 @@ __1:
nName = j
}
}
- zName = Xsqlite3MPrintf(tls, db, ts+16706 /* "%.*z:%u" */, crt.VaList(bp+8, nName, zName, crt.PreIncUint32(&*(*U32)(unsafe.Pointer(bp + 56 /* cnt */)), 1)))
+ zName = Xsqlite3MPrintf(tls, db, ts+19696 /* "%.*z:%u" */, libc.VaList(bp+8, nName, zName, libc.PreIncUint32(&*(*U32)(unsafe.Pointer(bp + 56 /* cnt */)), 1)))
if *(*U32)(unsafe.Pointer(bp + 56 /* cnt */)) > U32(3) {
Xsqlite3_randomness(tls, int32(unsafe.Sizeof(U32(0))), bp+56 /* &cnt */)
}
@@ -106609,7 +110439,7 @@ __3:
//
// This routine requires that all identifiers in the SELECT
// statement be resolved.
-func Xsqlite3SelectAddColumnTypeAndCollation(tls *crt.TLS, pParse uintptr, pTab uintptr, pSelect uintptr, aff int8) { /* sqlite3.c:131011:21: */
+func Xsqlite3SelectAddColumnTypeAndCollation(tls *libc.TLS, pParse uintptr, pTab uintptr, pSelect uintptr, aff int8) { /* sqlite3.c:131365:21: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -106625,7 +110455,7 @@ func Xsqlite3SelectAddColumnTypeAndCollation(tls *crt.TLS, pParse uintptr, pTab
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
return
}
- crt.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = (*Select)(unsafe.Pointer(pSelect)).FpSrc
a = (*Select)(unsafe.Pointer(pSelect)).FpEList + 8 /* &.a */
i = 0
@@ -106639,7 +110469,7 @@ __1:
var n int32
var m int32
p = (*ExprList_item)(unsafe.Pointer(a + uintptr(i)*32)).FpExpr
- zType = columnTypeImpl(tls, bp /* &sNC */, p)
+ zType = columnTypeImpl(tls, bp /* &sNC */, p, uintptr(0), uintptr(0), uintptr(0))
// pCol->szEst = ... // Column size est for SELECT tables never used
(*Column)(unsafe.Pointer(pCol)).Faffinity = Xsqlite3ExprAffinity(tls, p)
if zType != 0 {
@@ -106647,7 +110477,7 @@ __1:
n = Xsqlite3Strlen30(tls, (*Column)(unsafe.Pointer(pCol)).FzName)
(*Column)(unsafe.Pointer(pCol)).FzName = Xsqlite3DbReallocOrFree(tls, db, (*Column)(unsafe.Pointer(pCol)).FzName, (uint64((n + m) + 2)))
if (*Column)(unsafe.Pointer(pCol)).FzName != 0 {
- crt.Xmemcpy(tls, ((*Column)(unsafe.Pointer(pCol)).FzName + uintptr((n + 1))), zType, (uint64(m + 1)))
+ libc.Xmemcpy(tls, ((*Column)(unsafe.Pointer(pCol)).FzName + uintptr((n + 1))), zType, (uint64(m + 1)))
*(*U16)(unsafe.Pointer(pCol + 28 /* &.colFlags */)) |= U16((0x0004))
}
}
@@ -106672,13 +110502,13 @@ __3:
// Given a SELECT statement, generate a Table structure that describes
// the result set of that SELECT.
-func Xsqlite3ResultSetOfSelect(tls *crt.TLS, pParse uintptr, pSelect uintptr, aff int8) uintptr { /* sqlite3.c:131061:22: */
+func Xsqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, aff int8) uintptr { /* sqlite3.c:131415:22: */
var pTab uintptr
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var savedFlags U64
savedFlags = (*Sqlite3)(unsafe.Pointer(db)).Fflags
- *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(crt.Uint64FromUint64(uint64(0x00000004))))
+ *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(libc.Uint64FromUint64(uint64(0x00000004))))
*(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(0x00000040))
Xsqlite3SelectPrep(tls, pParse, pSelect, uintptr(0))
(*Sqlite3)(unsafe.Pointer(db)).Fflags = savedFlags
@@ -106707,7 +110537,7 @@ func Xsqlite3ResultSetOfSelect(tls *crt.TLS, pParse uintptr, pSelect uintptr, af
// Get a VDBE for the given parser context. Create a new one if necessary.
// If an error occurs, return NULL and leave a message in pParse.
-func Xsqlite3GetVdbe(tls *crt.TLS, pParse uintptr) uintptr { /* sqlite3.c:131094:21: */
+func Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr { /* sqlite3.c:131448:21: */
if (*Parse)(unsafe.Pointer(pParse)).FpVdbe != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpVdbe
}
@@ -106739,7 +110569,7 @@ func Xsqlite3GetVdbe(tls *crt.TLS, pParse uintptr) uintptr { /* sqlite3.c:131094
// redefined. The UNION ALL operator uses this property to force
// the reuse of the same limit and offset registers across multiple
// SELECT statements.
-func computeLimitRegisters(tls *crt.TLS, pParse uintptr, p uintptr, iBreak int32) { /* sqlite3.c:131130:13: */
+func computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int32) { /* sqlite3.c:131484:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -106760,12 +110590,12 @@ func computeLimitRegisters(tls *crt.TLS, pParse uintptr, p uintptr, iBreak int32
// no rows.
if pLimit != 0 {
- (*Select)(unsafe.Pointer(p)).FiLimit = crt.AssignInt32(&iLimit, crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
+ (*Select)(unsafe.Pointer(p)).FiLimit = libc.AssignInt32(&iLimit, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
v = Xsqlite3GetVdbe(tls, pParse)
if Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer(pLimit)).FpLeft, bp /* &n */) != 0 {
Xsqlite3VdbeAddOp2(tls, v, 69, *(*int32)(unsafe.Pointer(bp /* n */)), iLimit)
-
+ Xsqlite3VdbeComment(tls, v, ts+19704 /* "LIMIT counter" */, 0)
if *(*int32)(unsafe.Pointer(bp /* n */)) == 0 {
Xsqlite3VdbeGoto(tls, v, iBreak)
} else if (*(*int32)(unsafe.Pointer(bp /* n */)) >= 0) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp /* n */)))))) {
@@ -106775,16 +110605,17 @@ func computeLimitRegisters(tls *crt.TLS, pParse uintptr, p uintptr, iBreak int32
} else {
Xsqlite3ExprCode(tls, pParse, (*Expr)(unsafe.Pointer(pLimit)).FpLeft, iLimit)
Xsqlite3VdbeAddOp1(tls, v, 15, iLimit)
-
+ Xsqlite3VdbeComment(tls, v, ts+19704 /* "LIMIT counter" */, 0)
Xsqlite3VdbeAddOp2(tls, v, 20, iLimit, iBreak)
}
if (*Expr)(unsafe.Pointer(pLimit)).FpRight != 0 {
- (*Select)(unsafe.Pointer(p)).FiOffset = crt.AssignInt32(&iOffset, crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
+ (*Select)(unsafe.Pointer(p)).FiOffset = libc.AssignInt32(&iOffset, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
(*Parse)(unsafe.Pointer(pParse)).FnMem++ // Allocate an extra register for limit+offset
Xsqlite3ExprCode(tls, pParse, (*Expr)(unsafe.Pointer(pLimit)).FpRight, iOffset)
Xsqlite3VdbeAddOp1(tls, v, 15, iOffset)
-
+ Xsqlite3VdbeComment(tls, v, ts+19718 /* "OFFSET counter" */, 0)
Xsqlite3VdbeAddOp3(tls, v, 152, iLimit, (iOffset + 1), iOffset)
+ Xsqlite3VdbeComment(tls, v, ts+19733 /* "LIMIT+OFFSET" */, 0)
}
}
}
@@ -106795,7 +110626,7 @@ func computeLimitRegisters(tls *crt.TLS, pParse uintptr, p uintptr, iBreak int32
//
// The collating sequence for the compound select is taken from the
// left-most term of the select that has a collating sequence.
-func multiSelectCollSeq(tls *crt.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:131187:16: */
+func multiSelectCollSeq(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:131541:16: */
var pRet uintptr
if (*Select)(unsafe.Pointer(p)).FpPrior != 0 {
pRet = multiSelectCollSeq(tls, pParse, (*Select)(unsafe.Pointer(p)).FpPrior, iCol)
@@ -106819,7 +110650,7 @@ func multiSelectCollSeq(tls *crt.TLS, pParse uintptr, p uintptr, iCol int32) uin
// Space to hold the KeyInfo structure is obtained from malloc. The calling
// function is responsible for ensuring that this structure is eventually
// freed.
-func multiSelectOrderByKeyInfo(tls *crt.TLS, pParse uintptr, p uintptr, nExtra int32) uintptr { /* sqlite3.c:131213:16: */
+func multiSelectOrderByKeyInfo(tls *libc.TLS, pParse uintptr, p uintptr, nExtra int32) uintptr { /* sqlite3.c:131567:16: */
var pOrderBy uintptr = (*Select)(unsafe.Pointer(p)).FpOrderBy
var nOrderBy int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpOrderBy)).FnExpr
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
@@ -106886,9 +110717,9 @@ func multiSelectOrderByKeyInfo(tls *crt.TLS, pParse uintptr, p uintptr, nExtra i
// with a positive value, then the first OFFSET outputs are discarded rather
// than being sent to pDest. The LIMIT count does not begin until after OFFSET
// rows have been skipped.
-func generateWithRecursiveQuery(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) { /* sqlite3.c:131279:13: */
- bp := tls.Alloc(32)
- defer tls.Free(32)
+func generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) { /* sqlite3.c:131633:13: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
var pSrc uintptr // The FROM clause of the recursive query
var nCol int32 // Number of columns in the recursive table
@@ -106902,7 +110733,7 @@ func generateWithRecursiveQuery(tls *crt.TLS, pParse uintptr, p uintptr, pDest u
var iQueue int32 // The Queue table
var iDistinct int32 // To ensure unique results if UNION
var eDest int32 // How to write to Queue
- // var destQueue SelectDest at bp, 32
+ // var destQueue SelectDest at bp, 40
// SelectDest targetting the Queue table
var i int32 // Loop counter
var rc int32 // Result code
@@ -106922,7 +110753,7 @@ func generateWithRecursiveQuery(tls *crt.TLS, pParse uintptr, p uintptr, pDest u
if !((*Select)(unsafe.Pointer(p)).FpWin != 0) {
goto __1
}
- Xsqlite3ErrorMsg(tls, pParse, ts+16714 /* "cannot use windo..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+19746 /* "cannot use windo..." */, 0)
return
__1:
;
@@ -106943,7 +110774,7 @@ __2:
regLimit = (*Select)(unsafe.Pointer(p)).FiLimit
regOffset = (*Select)(unsafe.Pointer(p)).FiOffset
(*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0)
- (*Select)(unsafe.Pointer(p)).FiLimit = crt.AssignPtrInt32(p+12 /* &.iOffset */, 0)
+ (*Select)(unsafe.Pointer(p)).FiLimit = libc.AssignPtrInt32(p+12 /* &.iOffset */, 0)
pOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
// Locate the cursor number of the Current table
@@ -106970,7 +110801,7 @@ __5:
// Allocate cursors numbers for Queue and Distinct. The cursor number for
// the Distinct table must be exactly one greater than Queue in order
// for the SRT_DistFifo and SRT_DistQueue destinations to work.
- iQueue = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ iQueue = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
if !(int32((*Select)(unsafe.Pointer(p)).Fop) == 132) {
goto __7
}
@@ -106979,7 +110810,7 @@ __5:
} else {
eDest = 6
}
- iDistinct = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ iDistinct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
goto __8
__7:
if pOrderBy != 0 {
@@ -106992,7 +110823,7 @@ __8:
Xsqlite3SelectDestInit(tls, bp /* &destQueue */, eDest, iQueue)
// Allocate cursors for Current, Queue, and Distinct.
- regCurrent = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regCurrent = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp3(tls, v, 114, iCurrent, regCurrent, nCol)
if !(pOrderBy != 0) {
goto __9
@@ -107006,7 +110837,7 @@ __9:
Xsqlite3VdbeAddOp2(tls, v, 100, iQueue, nCol)
__10:
;
-
+ Xsqlite3VdbeComment(tls, v, ts+19795 /* "Queue table" */, 0)
if !(iDistinct != 0) {
goto __11
}
@@ -107020,7 +110851,7 @@ __11:
// Store the results of the setup-query in Queue.
(*Select)(unsafe.Pointer(pSetup)).FpNext = uintptr(0)
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16763 /* "SETUP" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19807 /* "SETUP" */, 0)
rc = Xsqlite3Select(tls, pParse, pSetup, bp /* &destQueue */)
(*Select)(unsafe.Pointer(pSetup)).FpNext = p
if !(rc != 0) {
@@ -107064,11 +110895,11 @@ __15:
if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0000008)) != 0) {
goto __16
}
- Xsqlite3ErrorMsg(tls, pParse, ts+16769 /* "recursive aggreg..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+19813 /* "recursive aggreg..." */, 0)
goto __17
__16:
(*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0)
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16811 /* "RECURSIVE STEP" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19855 /* "RECURSIVE STEP" */, 0)
Xsqlite3Select(tls, pParse, p, bp /* &destQueue */)
(*Select)(unsafe.Pointer(p)).FpPrior = pSetup
@@ -107100,13 +110931,13 @@ end_of_recursive_query:
// clause occurs within scalar expression (ex: "SELECT (VALUES(1),(2),(3))").
// The sqlite3CodeSubselect will have added the LIMIT 1 clause in tht case.
// Since the limit is exactly 1, we only need to evalutes the left-most VALUES.
-func multiSelectValues(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:131441:12: */
+func multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:131795:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
var nRow int32 = 1
var rc int32 = 0
- var bShowAll int32 = (crt.Bool32((*Select)(unsafe.Pointer(p)).FpLimit == uintptr(0)))
+ var bShowAll int32 = (libc.Bool32((*Select)(unsafe.Pointer(p)).FpLimit == uintptr(0)))
for ok := true; ok; ok = 1 != 0 {
@@ -107120,11 +110951,11 @@ func multiSelectValues(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) i
p = (*Select)(unsafe.Pointer(p)).FpPrior
nRow = nRow + (bShowAll)
}
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+16826 /* "SCAN %d CONSTANT..." */, crt.VaList(bp, nRow, func() uintptr {
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+19870 /* "SCAN %d CONSTANT..." */, libc.VaList(bp, nRow, func() uintptr {
if nRow == 1 {
- return ts + 672 /* "" */
+ return ts + 781 /* "" */
}
- return ts + 16849 /* "S" */
+ return ts + 19893 /* "S" */
}()))
for p != 0 {
selectInnerLoop(tls, pParse, p, -1, uintptr(0), uintptr(0), pDest, 1, 1)
@@ -107166,19 +110997,19 @@ func multiSelectValues(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) i
//
// Notice that because of the way SQLite parses compound SELECTs, the
// individual selects always group from left to right.
-func multiSelect(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:131504:12: */
- bp := tls.Alloc(136)
- defer tls.Free(136)
+func multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:131858:12: */
+ bp := tls.Alloc(160)
+ defer tls.Free(160)
var rc int32 // Success code from a subroutine
var pPrior uintptr // Another SELECT immediately to our left
var v uintptr // Generate code to this VDBE
- // var dest SelectDest at bp+32, 32
+ // var dest SelectDest at bp+32, 40
// Alternative data destination
var pDelete uintptr // Chain of simple selects to delete
var db uintptr
var addr int32
- // var nLimit int32 at bp+64, 4
+ // var nLimit int32 at bp+72, 4
var iCont int32
var iBreak int32
@@ -107188,7 +111019,7 @@ func multiSelect(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 {
var priorOp int32 // The SRT_ operation to apply to prior selects
var pLimit uintptr // Saved values of p->nLimit
var addr1 int32
- // var uniondest SelectDest at bp+72, 32
+ // var uniondest SelectDest at bp+80, 40
var tab1 int32
var tab2 int32
@@ -107197,7 +111028,7 @@ func multiSelect(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 {
var iStart1 int32
var pLimit1 uintptr
var addr2 int32
- // var intersectdest SelectDest at bp+104, 32
+ // var intersectdest SelectDest at bp+120, 40
var r1 int32
var addr3 int32
@@ -107219,12 +111050,12 @@ func multiSelect(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 {
if !(((*Select)(unsafe.Pointer(pPrior)).FpOrderBy != 0) || ((*Select)(unsafe.Pointer(pPrior)).FpLimit != 0)) {
goto __1
}
- Xsqlite3ErrorMsg(tls, pParse, ts+16851, /* "%s clause should..." */
- crt.VaList(bp, func() uintptr {
+ Xsqlite3ErrorMsg(tls, pParse, ts+19895, /* "%s clause should..." */
+ libc.VaList(bp, func() uintptr {
if (*Select)(unsafe.Pointer(pPrior)).FpOrderBy != uintptr(0) {
- return ts + 16893 /* "ORDER BY" */
+ return ts + 19937 /* "ORDER BY" */
}
- return ts + 16902 /* "LIMIT" */
+ return ts + 19946 /* "LIMIT" */
}(), selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
rc = 1
goto multi_select_end
@@ -107280,8 +111111,8 @@ __7:
if !((*Select)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0)) {
goto __9
}
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16908 /* "COMPOUND QUERY" */, 0)
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16923 /* "LEFT-MOST SUBQUE..." */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19952 /* "COMPOUND QUERY" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19967 /* "LEFT-MOST SUBQUE..." */, 0)
__9:
;
@@ -107318,7 +111149,7 @@ __15:
goto __16
}
addr = Xsqlite3VdbeAddOp1(tls, v, 20, (*Select)(unsafe.Pointer(p)).FiLimit)
-
+ Xsqlite3VdbeComment(tls, v, ts+19986 /* "Jump ahead if LI..." */, 0)
if !((*Select)(unsafe.Pointer(p)).FiOffset != 0) {
goto __17
}
@@ -107328,18 +111159,18 @@ __17:
;
__16:
;
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16641 /* "UNION ALL" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19631 /* "UNION ALL" */, 0)
rc = Xsqlite3Select(tls, pParse, p, bp+32 /* &dest */)
pDelete = (*Select)(unsafe.Pointer(p)).FpPrior
(*Select)(unsafe.Pointer(p)).FpPrior = pPrior
(*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEstAdd(tls, (*Select)(unsafe.Pointer(p)).FnSelectRow, (*Select)(unsafe.Pointer(pPrior)).FnSelectRow)
if !(((((*Select)(unsafe.Pointer(pPrior)).FpLimit != 0) &&
- (Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pPrior)).FpLimit)).FpLeft, bp+64 /* &nLimit */) != 0)) &&
- (*(*int32)(unsafe.Pointer(bp + 64 /* nLimit */)) > 0)) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 64 /* nLimit */))))))) {
+ (Xsqlite3ExprIsInteger(tls, (*Expr)(unsafe.Pointer((*Select)(unsafe.Pointer(pPrior)).FpLimit)).FpLeft, bp+72 /* &nLimit */) != 0)) &&
+ (*(*int32)(unsafe.Pointer(bp + 72 /* nLimit */)) > 0)) && (int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > int32(Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 72 /* nLimit */))))))) {
goto __18
}
- (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 64 /* nLimit */))))
+ (*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3LogEst(tls, U64(*(*int32)(unsafe.Pointer(bp + 72 /* nLimit */))))
__18:
;
if !(addr != 0) {
@@ -107365,7 +111196,7 @@ __13: // Cursor number of the temp table holding result
__20:
// We will need to create our own temporary table to hold the
// intermediate results.
- unionTab = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ unionTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
addr1 = Xsqlite3VdbeAddOp2(tls, v, 100, unionTab, 0)
@@ -107376,8 +111207,8 @@ __21:
// Code the SELECT statements to our left
- Xsqlite3SelectDestInit(tls, bp+72 /* &uniondest */, priorOp, unionTab)
- rc = Xsqlite3Select(tls, pParse, pPrior, bp+72 /* &uniondest */)
+ Xsqlite3SelectDestInit(tls, bp+80 /* &uniondest */, priorOp, unionTab)
+ rc = Xsqlite3Select(tls, pParse, pPrior, bp+80 /* &uniondest */)
if !(rc != 0) {
goto __22
}
@@ -107399,9 +111230,9 @@ __24:
(*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0)
pLimit = (*Select)(unsafe.Pointer(p)).FpLimit
(*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0)
- (*SelectDest)(unsafe.Pointer(bp + 72 /* &uniondest */)).FeDest = op
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16942 /* "%s USING TEMP B-..." */, crt.VaList(bp+16, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
- rc = Xsqlite3Select(tls, pParse, p, bp+72 /* &uniondest */)
+ (*SelectDest)(unsafe.Pointer(bp + 80 /* &uniondest */)).FeDest = op
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20014 /* "%s USING TEMP B-..." */, libc.VaList(bp+16, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
+ rc = Xsqlite3Select(tls, pParse, p, bp+80 /* &uniondest */)
pDelete = (*Select)(unsafe.Pointer(p)).FpPrior
(*Select)(unsafe.Pointer(p)).FpPrior = pPrior
@@ -107443,8 +111274,8 @@ __14:
// INTERSECT is different from the others since it requires
// two temporary tables. Hence it has its own case. Begin
// by allocating the tables we will need.
- tab1 = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
- tab2 = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ tab1 = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ tab2 = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
addr2 = Xsqlite3VdbeAddOp2(tls, v, 100, tab1, 0)
@@ -107452,8 +111283,8 @@ __14:
*(*U32)(unsafe.Pointer(findRightmost(tls, p) + 4 /* &.selFlags */)) |= (U32(0x0000020))
// Code the SELECTs to our left into temporary table "tab1".
- Xsqlite3SelectDestInit(tls, bp+104 /* &intersectdest */, 1, tab1)
- rc = Xsqlite3Select(tls, pParse, pPrior, bp+104 /* &intersectdest */)
+ Xsqlite3SelectDestInit(tls, bp+120 /* &intersectdest */, 1, tab1)
+ rc = Xsqlite3Select(tls, pParse, pPrior, bp+120 /* &intersectdest */)
if !(rc != 0) {
goto __27
}
@@ -107468,9 +111299,9 @@ __27:
(*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0)
pLimit1 = (*Select)(unsafe.Pointer(p)).FpLimit
(*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0)
- (*SelectDest)(unsafe.Pointer(bp + 104 /* &intersectdest */)).FiSDParm = tab2
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+16942 /* "%s USING TEMP B-..." */, crt.VaList(bp+24, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
- rc = Xsqlite3Select(tls, pParse, p, bp+104 /* &intersectdest */)
+ (*SelectDest)(unsafe.Pointer(bp + 120 /* &intersectdest */)).FiSDParm = tab2
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20014 /* "%s USING TEMP B-..." */, libc.VaList(bp+24, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
+ rc = Xsqlite3Select(tls, pParse, p, bp+120 /* &intersectdest */)
pDelete = (*Select)(unsafe.Pointer(p)).FpPrior
(*Select)(unsafe.Pointer(p)).FpPrior = pPrior
@@ -107623,15 +111454,15 @@ multi_select_end:
// Error message for when two or more terms of a compound select have different
// size result sets.
-func Xsqlite3SelectWrongNumTermsError(tls *crt.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:131852:21: */
+func Xsqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:132206:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
if ((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0000200)) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+16963 /* "all VALUES must ..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+20035 /* "all VALUES must ..." */, 0)
} else {
Xsqlite3ErrorMsg(tls, pParse,
- ts+17009 /* "SELECTs to the l..." */, crt.VaList(bp, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
+ ts+20081 /* "SELECTs to the l..." */, libc.VaList(bp, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
}
}
@@ -107653,7 +111484,7 @@ func Xsqlite3SelectWrongNumTermsError(tls *crt.TLS, pParse uintptr, p uintptr) {
//
// If the LIMIT found in p->iLimit is reached, jump immediately to
// iBreak.
-func generateOutputSubroutine(tls *crt.TLS, pParse uintptr, p uintptr, pIn uintptr, pDest uintptr, regReturn int32, regPrev int32, pKeyInfo uintptr, iBreak int32) int32 { /* sqlite3.c:131881:12: */
+func generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uintptr, pDest uintptr, regReturn int32, regPrev int32, pKeyInfo uintptr, iBreak int32) int32 { /* sqlite3.c:132235:12: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var iContinue int32
var addr int32
@@ -107846,17 +111677,17 @@ func generateOutputSubroutine(tls *crt.TLS, pParse uintptr, p uintptr, pIn uintp
// actually called using Gosub and they do not Return. EofA and EofB loop
// until all data is exhausted then jump to the "end" labe. AltB, AeqB,
// and AgtB jump to either L2 or to one of EofA or EofB.
-func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:132091:12: */
- bp := tls.Alloc(72)
- defer tls.Free(72)
+func multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:132445:12: */
+ bp := tls.Alloc(88)
+ defer tls.Free(88)
var i int32
var j int32 // Loop counters
var pPrior uintptr // Another SELECT immediately to our left
var v uintptr // Generate code to this VDBE
- // var destA SelectDest at bp+8, 32
+ // var destA SelectDest at bp+8, 40
// Destination for coroutine A
- // var destB SelectDest at bp+40, 32
+ // var destB SelectDest at bp+48, 40
// Destination for coroutine B
var regAddrA int32 // Address register for select-A coroutine
var regAddrB int32 // Address register for select-B coroutine
@@ -107939,12 +111770,12 @@ func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr)
}
*(*U32)(unsafe.Pointer(pNew + 4 /* &.flags */)) |= (U32(0x000400))
*(*int32)(unsafe.Pointer(pNew + 8 /* &.u */)) = i
- (*Select)(unsafe.Pointer(p)).FpOrderBy = crt.AssignUintptr(&pOrderBy, Xsqlite3ExprListAppend(tls, pParse, pOrderBy, pNew))
+ (*Select)(unsafe.Pointer(p)).FpOrderBy = libc.AssignUintptr(&pOrderBy, Xsqlite3ExprListAppend(tls, pParse, pOrderBy, pNew))
if pOrderBy != 0 {
(*struct {
FiOrderByCol U16
FiAlias U16
- })(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(crt.PostIncInt32(&nOrderBy, 1))*32 + 24 /* &.u */)).FiOrderByCol = U16(i)
+ })(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(libc.PostIncInt32(&nOrderBy, 1))*32 + 24 /* &.u */)).FiOrderByCol = U16(i)
}
}
}
@@ -107956,10 +111787,10 @@ func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr)
// collations to the ORDER BY clause terms so that when the subqueries
// to the right and the left are evaluated, they use the correct
// collation.
- aPermute = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(unsafe.Sizeof(int32(0))) * (uint64(nOrderBy + 1)))))
+ aPermute = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(unsafe.Sizeof(U32(0))) * (uint64(nOrderBy + 1)))))
if aPermute != 0 {
var pItem uintptr
- *(*int32)(unsafe.Pointer(aPermute + uintptr(0)*4)) = nOrderBy
+ *(*U32)(unsafe.Pointer(aPermute + uintptr(0)*4)) = U32(nOrderBy)
i = 1
pItem = pOrderBy + 8 /* &.a */
__4:
@@ -107968,10 +111799,10 @@ func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr)
}
{
- *(*int32)(unsafe.Pointer(aPermute + uintptr(i)*4)) = (int32((*struct {
+ *(*U32)(unsafe.Pointer(aPermute + uintptr(i)*4)) = (U32(int32((*struct {
FiOrderByCol U16
FiAlias U16
- })(unsafe.Pointer(pItem+24 /* &.u */)).FiOrderByCol) - 1)
+ })(unsafe.Pointer(pItem+24 /* &.u */)).FiOrderByCol) - 1))
}
goto __5
__5:
@@ -108014,16 +111845,16 @@ func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr)
// Separate the left and the right query from one another
(*Select)(unsafe.Pointer(p)).FpPrior = uintptr(0)
(*Select)(unsafe.Pointer(pPrior)).FpNext = uintptr(0)
- Xsqlite3ResolveOrderGroupBy(tls, pParse, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+6898 /* "ORDER" */)
+ Xsqlite3ResolveOrderGroupBy(tls, pParse, p, (*Select)(unsafe.Pointer(p)).FpOrderBy, ts+9096 /* "ORDER" */)
if (*Select)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) {
- Xsqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*Select)(unsafe.Pointer(pPrior)).FpOrderBy, ts+6898 /* "ORDER" */)
+ Xsqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*Select)(unsafe.Pointer(pPrior)).FpOrderBy, ts+9096 /* "ORDER" */)
}
// Compute the limit registers
computeLimitRegisters(tls, pParse, p, labelEnd)
if ((*Select)(unsafe.Pointer(p)).FiLimit != 0) && (op == 133) {
- regLimitA = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- regLimitB = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regLimitA = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regLimitB = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 77, func() int32 {
if (*Select)(unsafe.Pointer(p)).FiOffset != 0 {
return ((*Select)(unsafe.Pointer(p)).FiOffset + 1)
@@ -108033,27 +111864,27 @@ func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr)
regLimitA)
Xsqlite3VdbeAddOp2(tls, v, 77, regLimitA, regLimitB)
} else {
- regLimitA = crt.AssignInt32(&regLimitB, 0)
+ regLimitA = libc.AssignInt32(&regLimitB, 0)
}
Xsqlite3ExprDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpLimit)
(*Select)(unsafe.Pointer(p)).FpLimit = uintptr(0)
- regAddrA = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- regAddrB = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- regOutA = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- regOutB = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regAddrA = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regAddrB = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regOutA = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regOutB = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3SelectDestInit(tls, bp+8 /* &destA */, 13, regAddrA)
- Xsqlite3SelectDestInit(tls, bp+40 /* &destB */, 13, regAddrB)
+ Xsqlite3SelectDestInit(tls, bp+48 /* &destB */, 13, regAddrB)
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17091 /* "MERGE (%s)" */, crt.VaList(bp, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20163 /* "MERGE (%s)" */, libc.VaList(bp, selectOpName(tls, int32((*Select)(unsafe.Pointer(p)).Fop))))
// Generate a coroutine to evaluate the SELECT statement to the
// left of the compound operator - the "A" select.
addrSelectA = (Xsqlite3VdbeCurrentAddr(tls, v) + 1)
addr1 = Xsqlite3VdbeAddOp3(tls, v, 13, regAddrA, 0, addrSelectA)
-
+ Xsqlite3VdbeComment(tls, v, ts+20174 /* "left SELECT" */, 0)
(*Select)(unsafe.Pointer(pPrior)).FiLimit = regLimitA
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17102 /* "LEFT" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20186 /* "LEFT" */, 0)
Xsqlite3Select(tls, pParse, pPrior, bp+8 /* &destA */)
Xsqlite3VdbeEndCoroutine(tls, v, regAddrA)
Xsqlite3VdbeJumpHere(tls, v, addr1)
@@ -108062,20 +111893,20 @@ func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr)
// the right - the "B" select
addrSelectB = (Xsqlite3VdbeCurrentAddr(tls, v) + 1)
addr1 = Xsqlite3VdbeAddOp3(tls, v, 13, regAddrB, 0, addrSelectB)
-
+ Xsqlite3VdbeComment(tls, v, ts+20191 /* "right SELECT" */, 0)
savedLimit = (*Select)(unsafe.Pointer(p)).FiLimit
savedOffset = (*Select)(unsafe.Pointer(p)).FiOffset
(*Select)(unsafe.Pointer(p)).FiLimit = regLimitB
(*Select)(unsafe.Pointer(p)).FiOffset = 0
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17107 /* "RIGHT" */, 0)
- Xsqlite3Select(tls, pParse, p, bp+40 /* &destB */)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20204 /* "RIGHT" */, 0)
+ Xsqlite3Select(tls, pParse, p, bp+48 /* &destB */)
(*Select)(unsafe.Pointer(p)).FiLimit = savedLimit
(*Select)(unsafe.Pointer(p)).FiOffset = savedOffset
Xsqlite3VdbeEndCoroutine(tls, v, regAddrB)
// Generate a subroutine that outputs the current row of the A
// select as the next output row of the compound select.
-
+ Xsqlite3VdbeNoopComment(tls, v, ts+20210 /* "Output routine f..." */, 0)
addrOutA = generateOutputSubroutine(tls, pParse,
p, bp+8 /* &destA */, pDest, regOutA,
regPrev, pKeyDup, labelEnd)
@@ -108083,9 +111914,9 @@ func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr)
// Generate a subroutine that outputs the current row of the B
// select as the next output row of the compound select.
if (op == 133) || (op == 132) {
-
+ Xsqlite3VdbeNoopComment(tls, v, ts+20231 /* "Output routine f..." */, 0)
addrOutB = generateOutputSubroutine(tls, pParse,
- p, bp+40 /* &destB */, pDest, regOutB,
+ p, bp+48 /* &destB */, pDest, regOutB,
regPrev, pKeyDup, labelEnd)
}
Xsqlite3KeyInfoUnref(tls, pKeyDup)
@@ -108093,9 +111924,9 @@ func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr)
// Generate a subroutine to run when the results from select A
// are exhausted and only data in select B remains.
if (op == 134) || (op == 135) {
- addrEofA_noB = crt.AssignInt32(&addrEofA, labelEnd)
+ addrEofA_noB = libc.AssignInt32(&addrEofA, labelEnd)
} else {
-
+ Xsqlite3VdbeNoopComment(tls, v, ts+20252 /* "eof-A subroutine" */, 0)
addrEofA = Xsqlite3VdbeAddOp2(tls, v, 12, regOutB, addrOutB)
addrEofA_noB = Xsqlite3VdbeAddOp2(tls, v, 14, regAddrB, labelEnd)
@@ -108111,14 +111942,14 @@ func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr)
(*Select)(unsafe.Pointer(p)).FnSelectRow = (*Select)(unsafe.Pointer(pPrior)).FnSelectRow
}
} else {
-
+ Xsqlite3VdbeNoopComment(tls, v, ts+20269 /* "eof-B subroutine" */, 0)
addrEofB = Xsqlite3VdbeAddOp2(tls, v, 12, regOutA, addrOutA)
Xsqlite3VdbeAddOp2(tls, v, 14, regAddrA, labelEnd)
Xsqlite3VdbeGoto(tls, v, addrEofB)
}
// Generate code to handle the case of A<B
-
+ Xsqlite3VdbeNoopComment(tls, v, ts+20286 /* "A-lt-B subroutin..." */, 0)
addrAltB = Xsqlite3VdbeAddOp2(tls, v, 12, regOutA, addrOutA)
Xsqlite3VdbeAddOp2(tls, v, 14, regAddrA, addrEofA)
Xsqlite3VdbeGoto(tls, v, labelCmpr)
@@ -108130,13 +111961,13 @@ func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr)
addrAeqB = addrAltB
addrAltB++
} else {
-
+ Xsqlite3VdbeNoopComment(tls, v, ts+20304 /* "A-eq-B subroutin..." */, 0)
addrAeqB = Xsqlite3VdbeAddOp2(tls, v, 14, regAddrA, addrEofA)
Xsqlite3VdbeGoto(tls, v, labelCmpr)
}
// Generate code to handle the case of A>B
-
+ Xsqlite3VdbeNoopComment(tls, v, ts+20322 /* "A-gt-B subroutin..." */, 0)
addrAgtB = Xsqlite3VdbeCurrentAddr(tls, v)
if (op == 133) || (op == 132) {
Xsqlite3VdbeAddOp2(tls, v, 12, regOutB, addrOutB)
@@ -108152,7 +111983,7 @@ func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr)
// Implement the main merge loop
Xsqlite3VdbeResolveLabel(tls, v, labelCmpr)
Xsqlite3VdbeAddOp4(tls, v, 85, 0, 0, 0, aPermute, -15)
- Xsqlite3VdbeAddOp4(tls, v, 86, (*SelectDest)(unsafe.Pointer(bp+8 /* &destA */)).FiSdst, (*SelectDest)(unsafe.Pointer(bp+40 /* &destB */)).FiSdst, nOrderBy,
+ Xsqlite3VdbeAddOp4(tls, v, 86, (*SelectDest)(unsafe.Pointer(bp+8 /* &destA */)).FiSdst, (*SelectDest)(unsafe.Pointer(bp+48 /* &destB */)).FiSdst, nOrderBy,
pKeyMerge, -9)
Xsqlite3VdbeChangeP5(tls, v, uint16(0x01))
Xsqlite3VdbeAddOp3(tls, v, 16, addrAltB, addrAeqB, addrAgtB)
@@ -108171,7 +112002,7 @@ func multiSelectOrderBy(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr)
// ** TBD: Insert subroutine calls to close cursors on incomplete
// subqueries ***
Xsqlite3VdbeExplainPop(tls, pParse)
- return (crt.Bool32((*Parse)(unsafe.Pointer(pParse)).FnErr != 0))
+ return (libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FnErr != 0))
}
// An instance of the SubstContext object describes an substitution edit
@@ -108192,7 +112023,7 @@ type SubstContext1 = struct {
//
// All references to columns in table iTable are to be replaced by corresponding
// expressions in pEList.
-type SubstContext = SubstContext1 /* sqlite3.c:132404:3 */
+type SubstContext = SubstContext1 /* sqlite3.c:132758:3 */
// Scan through the expression pExpr. Replace every reference to
// a column in table number iTable with a copy of the iColumn-th
@@ -108205,7 +112036,7 @@ type SubstContext = SubstContext1 /* sqlite3.c:132404:3 */
// FORM clause entry is iTable. This routine makes the necessary
// changes to pExpr so that it refers directly to the source table
// of the subquery rather the result set of the subquery.
-func substExpr(tls *crt.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite3.c:132423:13: */
+func substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite3.c:132777:13: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -108231,7 +112062,7 @@ func substExpr(tls *crt.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite3
} else {
var db uintptr = (*Parse)(unsafe.Pointer((*SubstContext)(unsafe.Pointer(pSubst)).FpParse)).Fdb
if ((*SubstContext)(unsafe.Pointer(pSubst)).FisLeftJoin != 0) && (int32((*Expr)(unsafe.Pointer(pCopy)).Fop) != 164) {
- crt.Xmemset(tls, bp /* &ifNullRow */, 0, uint64(unsafe.Sizeof(Expr{})))
+ libc.Xmemset(tls, bp /* &ifNullRow */, 0, uint64(unsafe.Sizeof(Expr{})))
(*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).Fop = U8(176)
(*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).FpLeft = pCopy
(*Expr)(unsafe.Pointer(bp /* &ifNullRow */)).FiTable = (*SubstContext)(unsafe.Pointer(pSubst)).FiNewTable
@@ -108260,10 +112091,10 @@ func substExpr(tls *crt.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite3
if pColl != 0 {
return (*CollSeq)(unsafe.Pointer(pColl)).FzName
}
- return ts + 230 /* "BINARY" */
+ return ts + 344 /* "BINARY" */
}())
}
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (^U32(crt.Int32FromInt32(0x000100)))
+ *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (^U32(libc.Int32FromInt32(0x000100)))
}
}
}
@@ -108287,7 +112118,7 @@ func substExpr(tls *crt.TLS, pSubst uintptr, pExpr uintptr) uintptr { /* sqlite3
}
return pExpr
}
-func substExprList(tls *crt.TLS, pSubst uintptr, pList uintptr) { /* sqlite3.c:132504:13: */
+func substExprList(tls *libc.TLS, pSubst uintptr, pList uintptr) { /* sqlite3.c:132858:13: */
var i int32
if pList == uintptr(0) {
return
@@ -108296,14 +112127,14 @@ func substExprList(tls *crt.TLS, pSubst uintptr, pList uintptr) { /* sqlite3.c:1
(*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(i)*32)).FpExpr = substExpr(tls, pSubst, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FpExpr)
}
}
-func substSelect(tls *crt.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* sqlite3.c:132514:13: */
+func substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* sqlite3.c:132868:13: */
var pSrc uintptr
var pItem uintptr
var i int32
if !(p != 0) {
return
}
- for ok := true; ok; ok = ((doPrior != 0) && ((crt.AssignUintptr(&p, (*Select)(unsafe.Pointer(p)).FpPrior)) != uintptr(0))) {
+ for ok := true; ok; ok = ((doPrior != 0) && ((libc.AssignUintptr(&p, (*Select)(unsafe.Pointer(p)).FpPrior)) != uintptr(0))) {
substExprList(tls, pSubst, (*Select)(unsafe.Pointer(p)).FpEList)
substExprList(tls, pSubst, (*Select)(unsafe.Pointer(p)).FpGroupBy)
substExprList(tls, pSubst, (*Select)(unsafe.Pointer(p)).FpOrderBy)
@@ -108338,7 +112169,7 @@ func substSelect(tls *crt.TLS, pSubst uintptr, p uintptr, doPrior int32) { /* sq
//
// This routine scans the entire SELECT statement and recomputes the
// pSrcItem->colUsed mask.
-func recomputeColumnsUsedExpr(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:132549:12: */
+func recomputeColumnsUsedExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:132903:12: */
var pItem uintptr
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != 164 {
return 0
@@ -108353,7 +112184,7 @@ func recomputeColumnsUsedExpr(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int3
*(*Bitmask)(unsafe.Pointer(pItem + 88 /* &.colUsed */)) |= (Xsqlite3ExprColUsed(tls, pExpr))
return 0
}
-func recomputeColumnsUsed(tls *crt.TLS, pSelect uintptr, pSrcItem uintptr) { /* sqlite3.c:132558:13: */
+func recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { /* sqlite3.c:132912:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -108362,12 +112193,12 @@ func recomputeColumnsUsed(tls *crt.TLS, pSelect uintptr, pSrcItem uintptr) { /*
if (*SrcList_item)(unsafe.Pointer(pSrcItem)).FpTab == uintptr(0) {
return
}
- crt.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{recomputeColumnsUsedExpr}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{Xsqlite3SelectWalkNoop}))
*(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = pSrcItem
(*SrcList_item)(unsafe.Pointer(pSrcItem)).FcolUsed = uint64(0)
@@ -108527,7 +112358,7 @@ func recomputeColumnsUsed(tls *crt.TLS, pSelect uintptr, pSrcItem uintptr) { /*
//
// All of the expression analysis must occur on both the outer query and
// the subquery before this routine runs.
-func flattenSubquery(tls *crt.TLS, pParse uintptr, p uintptr, iFrom int32, isAgg int32) int32 { /* sqlite3.c:132729:12: */
+func flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isAgg int32) int32 { /* sqlite3.c:133083:12: */
bp := tls.Alloc(80)
defer tls.Free(80)
@@ -108539,7 +112370,7 @@ func flattenSubquery(tls *crt.TLS, pParse uintptr, p uintptr, iFrom int32, isAgg
var pSubSrc uintptr // The FROM clause of the subquery
var iParent int32 // VDBE cursor number of the pSub result set temp table
var iNewParent int32 = -1 // Replacement table for iParent
- var isLeftJoin int32 = 0 /* True if pSub is the right side of a LEFT JOIN */
+ var isLeftJoin int32 = 0 // True if pSub is the right side of a LEFT JOIN
var i int32 // Loop counter
var pWhere uintptr // The WHERE clause
var pSubitem uintptr // The subquery
@@ -108743,7 +112574,7 @@ func flattenSubquery(tls *crt.TLS, pParse uintptr, p uintptr, iFrom int32, isAgg
// Begin flattening the iFrom-th entry of the FROM clause
// in the outer query.
- pSub = crt.AssignUintptr(&pSub1, (*SrcList_item)(unsafe.Pointer(pSubitem)).FpSelect)
+ pSub = libc.AssignUintptr(&pSub1, (*SrcList_item)(unsafe.Pointer(pSubitem)).FpSelect)
// Delete the transient table structure associated with the
// subquery
@@ -108844,7 +112675,7 @@ __1:
*(*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr((i+iFrom))*112)) = *(*SrcList_item)(unsafe.Pointer((pSubSrc + 8 /* &.a */) + uintptr(i)*112))
iNewParent = (*SrcList_item)(unsafe.Pointer((pSubSrc + 8 /* &.a */) + uintptr(i)*112)).FiCursor
- crt.Xmemset(tls, ((pSubSrc + 8 /* &.a */) + uintptr(i)*112), 0, uint64(unsafe.Sizeof(SrcList_item{})))
+ libc.Xmemset(tls, ((pSubSrc + 8 /* &.a */) + uintptr(i)*112), 0, uint64(unsafe.Sizeof(SrcList_item{})))
}
(*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(iFrom)*112)).Ffg.Fjointype = jointype
@@ -108944,7 +112775,7 @@ __3:
// A structure to keep track of all of the column values that are fixed to
// a known value due to WHERE clause constraints of the form COLUMN=VALUE.
-type WhereConst = WhereConst1 /* sqlite3.c:133148:27 */
+type WhereConst = WhereConst1 /* sqlite3.c:133502:27 */
// Add a new entry to the pConst object. Except, do not add duplicate
// pColumn entires. Also, do not add if doing so would not be appropriate.
@@ -108952,7 +112783,7 @@ type WhereConst = WhereConst1 /* sqlite3.c:133148:27 */
// The caller guarantees the pColumn is a column and pValue is a constant.
// This routine has to do some additional checks before completing the
// insert.
-func constInsert(tls *crt.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, pExpr uintptr) { /* sqlite3.c:133164:13: */
+func constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr, pExpr uintptr) { /* sqlite3.c:133518:13: */
var i int32
if ((*Expr)(unsafe.Pointer((pColumn))).Fflags & (U32(0x000008))) != U32(0) {
@@ -108991,7 +112822,7 @@ func constInsert(tls *crt.TLS, pConst uintptr, pColumn uintptr, pValue uintptr,
// is a constant expression and where the term must be true because it
// is part of the AND-connected terms of the expression. For each term
// found, add it to the pConst structure.
-func findConstInWhere(tls *crt.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3.c:133209:13: */
+func findConstInWhere(tls *libc.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3.c:133563:13: */
var pRight uintptr
var pLeft uintptr
if pExpr == uintptr(0) {
@@ -109023,7 +112854,7 @@ func findConstInWhere(tls *crt.TLS, pConst uintptr, pExpr uintptr) { /* sqlite3.
// to be replaced by a value. If pExpr is equivalent to one of the
// columns named in pWalker->u.pConst, then overwrite it with its
// corresponding value.
-func propagateConstantExprRewrite(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:133237:12: */
+func propagateConstantExprRewrite(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:133591:12: */
var i int32
var pConst uintptr
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != 164 {
@@ -109047,7 +112878,7 @@ func propagateConstantExprRewrite(tls *crt.TLS, pWalker uintptr, pExpr uintptr)
}
// A match is found. Add the EP_FixedCol property
(*WhereConst)(unsafe.Pointer(pConst)).FnChng++
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (^U32(crt.Int32FromInt32(0x800000)))
+ *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (^U32(libc.Int32FromInt32(0x800000)))
*(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(0x000008))
(*Expr)(unsafe.Pointer(pExpr)).FpLeft = Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*WhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(((i*2)+1))*8)), 0)
@@ -109090,7 +112921,7 @@ func propagateConstantExprRewrite(tls *crt.TLS, pWalker uintptr, pExpr uintptr)
// routines know to generate the constant "123" instead of looking up the
// column value. Also, to avoid collation problems, this optimization is
// only attempted if the "a=123" term uses the default BINARY collation.
-func propagateConstants(tls *crt.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:133299:12: */
+func propagateConstants(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:133653:12: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -109106,13 +112937,13 @@ func propagateConstants(tls *crt.TLS, pParse uintptr, p uintptr) int32 { /* sqli
(*WhereConst)(unsafe.Pointer(bp /* &x */)).FapExpr = uintptr(0)
findConstInWhere(tls, bp /* &x */, (*Select)(unsafe.Pointer(p)).FpWhere)
if (*WhereConst)(unsafe.Pointer(bp /* &x */)).FnConst != 0 {
- crt.Xmemset(tls, bp+24 /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp+24 /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp + 24 /* &w */)).FpParse = pParse
(*Walker)(unsafe.Pointer(bp + 24 /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{propagateConstantExprRewrite}))
(*Walker)(unsafe.Pointer(bp + 24 /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{Xsqlite3SelectWalkNoop}))
(*Walker)(unsafe.Pointer(bp + 24 /* &w */)).FxSelectCallback2 = uintptr(0)
(*Walker)(unsafe.Pointer(bp + 24 /* &w */)).FwalkerDepth = 0
@@ -109176,7 +113007,7 @@ func propagateConstants(tls *crt.TLS, pParse uintptr, p uintptr) int32 { /* sqli
//
// Return 0 if no changes are made and non-zero if one or more WHERE clause
// terms are duplicated into the subquery.
-func pushDownWhereTerms(tls *crt.TLS, pParse uintptr, pSubq uintptr, pWhere uintptr, iCursor int32, isLeftJoin int32) int32 { /* sqlite3.c:133382:12: */
+func pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere uintptr, iCursor int32, isLeftJoin int32) int32 { /* sqlite3.c:133736:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -109205,7 +113036,7 @@ func pushDownWhereTerms(tls *crt.TLS, pParse uintptr, pSubq uintptr, pWhere uint
pWhere = (*Expr)(unsafe.Pointer(pWhere)).FpLeft
}
if (isLeftJoin != 0) &&
- (((crt.Bool32(((*Expr)(unsafe.Pointer((pWhere))).Fflags & (U32(0x000001))) != U32(0))) == 0) ||
+ (((libc.Bool32(((*Expr)(unsafe.Pointer((pWhere))).Fflags & (U32(0x000001))) != U32(0))) == 0) ||
(int32((*Expr)(unsafe.Pointer(pWhere)).FiRightJoinTable) != iCursor)) {
return 0
}
@@ -109250,7 +113081,7 @@ func pushDownWhereTerms(tls *crt.TLS, pParse uintptr, pSubq uintptr, pWhere uint
// This routine must be called after aggregate functions have been
// located but before their arguments have been subjected to aggregate
// analysis.
-func minMaxQuery(tls *crt.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 { /* sqlite3.c:133471:11: */
+func minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 { /* sqlite3.c:133825:11: */
var eRet int32 = 0x0000 // Return value
var pEList uintptr = *(*uintptr)(unsafe.Pointer(pFunc + 32 /* &.x */)) // Arguments to agg function
var zFunc uintptr // Name of aggregate function pFunc
@@ -109261,18 +113092,18 @@ func minMaxQuery(tls *crt.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 {
return U8(eRet)
}
zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8 /* &.u */))
- if Xsqlite3StrICmp(tls, zFunc, ts+13382 /* "min" */) == 0 {
+ if Xsqlite3StrICmp(tls, zFunc, ts+16185 /* "min" */) == 0 {
eRet = 0x0001
if Xsqlite3ExprCanBeNull(tls, (*ExprList_item)(unsafe.Pointer((pEList+8 /* &.a */)+uintptr(0)*32)).FpExpr) != 0 {
sortFlags = U8(0x02)
}
- } else if Xsqlite3StrICmp(tls, zFunc, ts+13386 /* "max" */) == 0 {
+ } else if Xsqlite3StrICmp(tls, zFunc, ts+16189 /* "max" */) == 0 {
eRet = 0x0002
sortFlags = U8(0x01)
} else {
return U8(eRet)
}
- *(*uintptr)(unsafe.Pointer(ppMinMax)) = crt.AssignUintptr(&pOrderBy, Xsqlite3ExprListDup(tls, db, pEList, 0))
+ *(*uintptr)(unsafe.Pointer(ppMinMax)) = libc.AssignUintptr(&pOrderBy, Xsqlite3ExprListDup(tls, db, pEList, 0))
if pOrderBy != 0 {
(*ExprList_item)(unsafe.Pointer((pOrderBy + 8 /* &.a */) + uintptr(0)*32)).FsortFlags = sortFlags
@@ -109289,7 +113120,7 @@ func minMaxQuery(tls *crt.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) U8 {
// where table is a database table, not a sub-select or view. If the query
// does match this pattern, then a pointer to the Table object representing
// <tbl> is returned. Otherwise, 0 is returned.
-func isSimpleCount(tls *crt.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqlite3.c:133513:14: */
+func isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqlite3.c:133867:14: */
var pTab uintptr
var pExpr uintptr
@@ -109324,7 +113155,7 @@ func isSimpleCount(tls *crt.TLS, p uintptr, pAggInfo uintptr) uintptr { /* sqlit
// was such a clause and the named index cannot be found, return
// SQLITE_ERROR and leave an error in pParse. Otherwise, populate
// pFrom->pIndex and return SQLITE_OK.
-func Xsqlite3IndexedByLookup(tls *crt.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:133544:20: */
+func Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:133898:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -109335,7 +113166,7 @@ func Xsqlite3IndexedByLookup(tls *crt.TLS, pParse uintptr, pFrom uintptr) int32
for pIdx = (*Table)(unsafe.Pointer(pTab)).FpIndex; (pIdx != 0) && (Xsqlite3StrICmp(tls, (*Index)(unsafe.Pointer(pIdx)).FzName, zIndexedBy) != 0); pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext {
}
if !(pIdx != 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+17113 /* "no such index: %..." */, crt.VaList(bp, zIndexedBy, 0))
+ Xsqlite3ErrorMsg(tls, pParse, ts+20340 /* "no such index: %..." */, libc.VaList(bp, zIndexedBy, 0))
(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
return 1
}
@@ -109363,7 +113194,7 @@ func Xsqlite3IndexedByLookup(tls *crt.TLS, pParse uintptr, pFrom uintptr) int32
// This transformation is only needed for EXCEPT, INTERSECT, and UNION.
// The UNION ALL operator works fine with multiSelectOrderBy() even when
// there are COLLATE terms in the ORDER BY.
-func convertCompoundSelectToSubquery(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:133583:12: */
+func convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:133937:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -109416,7 +113247,7 @@ func convertCompoundSelectToSubquery(tls *crt.TLS, pWalker uintptr, p uintptr) i
if pNew == uintptr(0) {
return 2
}
- crt.Xmemset(tls, bp /* &dummy */, 0, uint64(unsafe.Sizeof(Token{})))
+ libc.Xmemset(tls, bp /* &dummy */, 0, uint64(unsafe.Sizeof(Token{})))
pNewSrc = Xsqlite3SrcListAppendFromTerm(tls, pParse, uintptr(0), uintptr(0), uintptr(0), bp /* &dummy */, pNew, uintptr(0), uintptr(0))
if pNewSrc == uintptr(0) {
return 2
@@ -109433,7 +113264,7 @@ func convertCompoundSelectToSubquery(tls *crt.TLS, pWalker uintptr, p uintptr) i
(*Select)(unsafe.Pointer(p)).FpNext = uintptr(0)
(*Select)(unsafe.Pointer(p)).FpWith = uintptr(0)
(*Select)(unsafe.Pointer(p)).FpWinDefn = uintptr(0)
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (^U32(crt.Int32FromInt32(0x0000100)))
+ *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (^U32(libc.Int32FromInt32(0x0000100)))
*(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(0x0010000))
@@ -109445,12 +113276,12 @@ func convertCompoundSelectToSubquery(tls *crt.TLS, pWalker uintptr, p uintptr) i
// Check to see if the FROM clause term pFrom has table-valued function
// arguments. If it does, leave an error message in pParse and return
// non-zero, since pFrom is not allowed to be a table-valued function.
-func cannotBeFunction(tls *crt.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:133648:12: */
+func cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:134002:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
if uint32(int32(*(*uint8)(unsafe.Pointer(pFrom + 60 /* &.fg */ + 4 /* &.isTabFunc */))&0x4>>2)) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+17131 /* "'%s' is not a fu..." */, crt.VaList(bp, (*SrcList_item)(unsafe.Pointer(pFrom)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+20358 /* "'%s' is not a fu..." */, libc.VaList(bp, (*SrcList_item)(unsafe.Pointer(pFrom)).FzName))
return 1
}
return 0
@@ -109464,9 +113295,9 @@ func cannotBeFunction(tls *crt.TLS, pParse uintptr, pFrom uintptr) int32 { /* sq
//
// If a non-NULL value is returned, set *ppContext to point to the With
// object that the returned CTE belongs to.
-func searchWith(tls *crt.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) uintptr { /* sqlite3.c:133667:19: */
+func searchWith(tls *libc.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) uintptr { /* sqlite3.c:134021:19: */
var zName uintptr
- if ((*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase == uintptr(0)) && ((crt.AssignUintptr(&zName, (*SrcList_item)(unsafe.Pointer(pItem)).FzName)) != uintptr(0)) {
+ if ((*SrcList_item)(unsafe.Pointer(pItem)).FzDatabase == uintptr(0)) && ((libc.AssignUintptr(&zName, (*SrcList_item)(unsafe.Pointer(pItem)).FzName)) != uintptr(0)) {
var p uintptr
for p = pWith; p != 0; p = (*With)(unsafe.Pointer(p)).FpOuter {
var i int32
@@ -109490,7 +113321,7 @@ func searchWith(tls *crt.TLS, pWith uintptr, pItem uintptr, ppContext uintptr) u
// should be freed along with the Parse object. In other cases, when
// bFree==0, the With object will be freed along with the SELECT
// statement with which it is associated.
-func Xsqlite3WithPush(tls *crt.TLS, pParse uintptr, pWith uintptr, bFree U8) { /* sqlite3.c:133698:21: */
+func Xsqlite3WithPush(tls *libc.TLS, pParse uintptr, pWith uintptr, bFree U8) { /* sqlite3.c:134052:21: */
if pWith != 0 {
@@ -109515,7 +113346,7 @@ func Xsqlite3WithPush(tls *crt.TLS, pParse uintptr, pWith uintptr, bFree U8) { /
// Whether or not a match is found, SQLITE_OK is returned if no error
// occurs. If an error does occur, an error message is stored in the
// parser and some error code other than SQLITE_OK returned.
-func withExpand(tls *crt.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3.c:133723:12: */
+func withExpand(tls *libc.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3.c:134077:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -109543,14 +113374,14 @@ func withExpand(tls *crt.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3
// early. If pCte->zCteErr is NULL, then this is not a recursive reference.
// In this case, proceed.
if (*Cte)(unsafe.Pointer(pCte)).FzCteErr != 0 {
- Xsqlite3ErrorMsg(tls, pParse, (*Cte)(unsafe.Pointer(pCte)).FzCteErr, crt.VaList(bp, (*Cte)(unsafe.Pointer(pCte)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, (*Cte)(unsafe.Pointer(pCte)).FzCteErr, libc.VaList(bp, (*Cte)(unsafe.Pointer(pCte)).FzName))
return 1
}
if cannotBeFunction(tls, pParse, pFrom) != 0 {
return 1
}
- (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = crt.AssignUintptr(&pTab, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{}))))
+ (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Table{}))))
if pTab == uintptr(0) {
return 2
}
@@ -109566,7 +113397,7 @@ func withExpand(tls *crt.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3
// Check if this is a recursive CTE.
pSel = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect
- bMayRecursive = (crt.Bool32((int32((*Select)(unsafe.Pointer(pSel)).Fop) == 133) || (int32((*Select)(unsafe.Pointer(pSel)).Fop) == 132)))
+ bMayRecursive = (libc.Bool32((int32((*Select)(unsafe.Pointer(pSel)).Fop) == 133) || (int32((*Select)(unsafe.Pointer(pSel)).Fop) == 132)))
if bMayRecursive != 0 {
var i int32
var pSrc uintptr = (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect)).FpSrc
@@ -109576,21 +113407,21 @@ func withExpand(tls *crt.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3
((*SrcList_item)(unsafe.Pointer(pItem)).FzName != uintptr(0))) &&
(0 == Xsqlite3StrICmp(tls, (*SrcList_item)(unsafe.Pointer(pItem)).FzName, (*Cte)(unsafe.Pointer(pCte)).FzName)) {
(*SrcList_item)(unsafe.Pointer(pItem)).FpTab = pTab
- crt.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isRecursive */, uint32(1), 5, 0x20)
+ libc.SetBitFieldPtr8Uint32(pItem+60 /* &.fg */ +4 /* &.isRecursive */, uint32(1), 5, 0x20)
(*Table)(unsafe.Pointer(pTab)).FnTabRef++
*(*U32)(unsafe.Pointer(pSel + 4 /* &.selFlags */)) |= (U32(0x0002000))
}
}
}
- /* Only one recursive reference is permitted. */
+ // Only one recursive reference is permitted.
if (*Table)(unsafe.Pointer(pTab)).FnTabRef > U32(2) {
Xsqlite3ErrorMsg(tls,
- pParse, ts+17154 /* "multiple referen..." */, crt.VaList(bp+8, (*Cte)(unsafe.Pointer(pCte)).FzName))
+ pParse, ts+20381 /* "multiple referen..." */, libc.VaList(bp+8, (*Cte)(unsafe.Pointer(pCte)).FzName))
return 1
}
- (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 17197 /* "circular referen..." */
+ (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 20424 /* "circular referen..." */
pSavedWith = (*Parse)(unsafe.Pointer(pParse)).FpWith
(*Parse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp + 40 /* pWith */))
if bMayRecursive != 0 {
@@ -109609,8 +113440,8 @@ func withExpand(tls *crt.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3
pEList = (*Select)(unsafe.Pointer(pLeft)).FpEList
if (*Cte)(unsafe.Pointer(pCte)).FpCols != 0 {
if (pEList != 0) && ((*ExprList)(unsafe.Pointer(pEList)).FnExpr != (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr) {
- Xsqlite3ErrorMsg(tls, pParse, ts+17220, /* "table %s has %d ..." */
- crt.VaList(bp+16, (*Cte)(unsafe.Pointer(pCte)).FzName, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr))
+ Xsqlite3ErrorMsg(tls, pParse, ts+20447, /* "table %s has %d ..." */
+ libc.VaList(bp+16, (*Cte)(unsafe.Pointer(pCte)).FzName, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, (*ExprList)(unsafe.Pointer((*Cte)(unsafe.Pointer(pCte)).FpCols)).FnExpr))
(*Parse)(unsafe.Pointer(pParse)).FpWith = pSavedWith
return 1
}
@@ -109620,9 +113451,9 @@ func withExpand(tls *crt.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3
Xsqlite3ColumnsFromExprList(tls, pParse, pEList, (pTab + 70 /* &.nCol */), (pTab + 8 /* &.aCol */))
if bMayRecursive != 0 {
if ((*Select)(unsafe.Pointer(pSel)).FselFlags & U32(0x0002000)) != 0 {
- (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 17258 /* "multiple recursi..." */
+ (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 20485 /* "multiple recursi..." */
} else {
- (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 17292 /* "recursive refere..." */
+ (*Cte)(unsafe.Pointer(pCte)).FzCteErr = ts + 20519 /* "recursive refere..." */
}
Xsqlite3WalkSelect(tls, pWalker, pSel)
}
@@ -109639,7 +113470,7 @@ func withExpand(tls *crt.TLS, pWalker uintptr, pFrom uintptr) int32 { /* sqlite3
// This function is used as the xSelectCallback2() callback by
// sqlite3SelectExpand() when walking a SELECT tree to resolve table
// names and other FROM clause elements.
-func selectPopWith(tls *crt.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:133851:13: */
+func selectPopWith(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:134205:13: */
var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
if ((*Parse)(unsafe.Pointer(pParse)).FpWith != 0) && ((*Select)(unsafe.Pointer(p)).FpPrior == uintptr(0)) {
var pWith uintptr = (*Select)(unsafe.Pointer(findRightmost(tls, p))).FpWith
@@ -109655,14 +113486,14 @@ func selectPopWith(tls *crt.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:1338
// allocates and populates the SrcList_item.pTab object. If successful,
// SQLITE_OK is returned. Otherwise, if an OOM error is encountered,
// SQLITE_NOMEM.
-func Xsqlite3ExpandSubquery(tls *crt.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:133872:20: */
+func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32 { /* sqlite3.c:134226:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
var pSel uintptr = (*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect
var pTab uintptr
- (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = crt.AssignUintptr(&pTab, Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Table{}))))
+ (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Table{}))))
if pTab == uintptr(0) {
return 7
}
@@ -109670,7 +113501,7 @@ func Xsqlite3ExpandSubquery(tls *crt.TLS, pParse uintptr, pFrom uintptr) int32 {
if (*SrcList_item)(unsafe.Pointer(pFrom)).FzAlias != 0 {
(*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3DbStrDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*SrcList_item)(unsafe.Pointer(pFrom)).FzAlias)
} else {
- (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+17330 /* "subquery_%u" */, crt.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId))
+ (*Table)(unsafe.Pointer(pTab)).FzName = Xsqlite3MPrintf(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, ts+20557 /* "subquery_%u" */, libc.VaList(bp, (*Select)(unsafe.Pointer(pSel)).FselId))
}
for (*Select)(unsafe.Pointer(pSel)).FpPrior != 0 {
pSel = (*Select)(unsafe.Pointer(pSel)).FpPrior
@@ -109708,7 +113539,7 @@ func Xsqlite3ExpandSubquery(tls *crt.TLS, pParse uintptr, pFrom uintptr) int32 {
// If found, expand each "*" to be every column in every table
// and TABLE.* to be every column in TABLE.
//
-func selectExpander(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:133918:12: */
+func selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3.c:134272:12: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -109736,7 +113567,7 @@ func selectExpander(tls *crt.TLS, pWalker uintptr, p uintptr) int32 { /* sqlite3
}
if (*Walker)(unsafe.Pointer(pWalker)).FeCode != 0 {
// Renumber selId because it has been copied from a view
- (*Select)(unsafe.Pointer(p)).FselId = U32(crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnSelect, 1))
+ (*Select)(unsafe.Pointer(p)).FselId = U32(libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnSelect, 1))
}
pTabList = (*Select)(unsafe.Pointer(p)).FpSrc
pEList = (*Select)(unsafe.Pointer(p)).FpEList
@@ -109758,7 +113589,7 @@ __1:
{
var pTab uintptr
- if uint32(int32(*(*uint8)(unsafe.Pointer(pFrom + 60 /* &.fg */ + 4 /* &.isRecursive */))&0x20>>5)) != 0 {
+ if (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab != 0 {
goto __2
}
@@ -109779,13 +113610,13 @@ __1:
} else {
// An ordinary table or view name in the FROM clause
- (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = crt.AssignUintptr(&pTab, Xsqlite3LocateTableItem(tls, pParse, uint32(0), pFrom))
+ (*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = libc.AssignUintptr(&pTab, Xsqlite3LocateTableItem(tls, pParse, uint32(0), pFrom))
if pTab == uintptr(0) {
return 2
}
if (*Table)(unsafe.Pointer(pTab)).FnTabRef >= U32(0xffff) {
- Xsqlite3ErrorMsg(tls, pParse, ts+17342, /* "too many referen..." */
- crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+20569, /* "too many referen..." */
+ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
(*SrcList_item)(unsafe.Pointer(pFrom)).FpTab = uintptr(0)
return 2
}
@@ -109801,15 +113632,15 @@ __1:
}
if ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x80000000)) == uint64(0)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+17381, /* "access to view \"..." */
- crt.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+20608, /* "access to view \"..." */
+ libc.VaList(bp+8, (*Table)(unsafe.Pointer(pTab)).FzName))
}
if ((((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) &&
(uint32(int32(*(*uint8)(unsafe.Pointer((pFrom + 60 /* &.fg */) + 4 /* &.fromDDL */))&0x40>>6)) != 0)) &&
((*Table)(unsafe.Pointer(pTab)).FpVTable != uintptr(0))) &&
- (int32((*VTable)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpVTable)).FeVtabRisk) > (crt.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00000080)) != uint64(0)))) {
- Xsqlite3ErrorMsg(tls, pParse, ts+17412, /* "unsafe use of vi..." */
- crt.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
+ (int32((*VTable)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FpVTable)).FeVtabRisk) > (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00000080)) != uint64(0)))) {
+ Xsqlite3ErrorMsg(tls, pParse, ts+20639, /* "unsafe use of vi..." */
+ libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTab)).FzName))
}
(*SrcList_item)(unsafe.Pointer(pFrom)).FpSelect = Xsqlite3SelectDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSelect, 0)
nCol = (*Table)(unsafe.Pointer(pTab)).FnCol
@@ -109868,7 +113699,7 @@ __3:
var a uintptr = pEList + 8 /* &.a */
var pNew uintptr = uintptr(0)
var flags int32 = int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags)
- var longNames int32 = (crt.Bool32(((flags & 0x00000004) != 0) &&
+ var longNames int32 = (libc.Bool32(((flags & 0x00000004) != 0) &&
((flags & 0x00000040) == 0)))
for k = 0; k < (*ExprList)(unsafe.Pointer(pEList)).FnExpr; k++ {
@@ -109882,7 +113713,7 @@ __3:
pNew = Xsqlite3ExprListAppend(tls, pParse, pNew, (*ExprList_item)(unsafe.Pointer(a+uintptr(k)*32)).FpExpr)
if pNew != 0 {
(*ExprList_item)(unsafe.Pointer((pNew + 8 /* &.a */) + uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*32)).FzEName = (*ExprList_item)(unsafe.Pointer(a + uintptr(k)*32)).FzEName
- crt.SetBitFieldPtr8Uint32((pNew+8 /* &.a */)+uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*32+20 /* &.eEName */, uint32(int32(*(*uint8)(unsafe.Pointer(a + uintptr(k)*32 + 20 /* &.eEName */))&0x3>>0)), 0, 0x3)
+ libc.SetBitFieldPtr8Uint32((pNew+8 /* &.a */)+uintptr(((*ExprList)(unsafe.Pointer(pNew)).FnExpr-1))*32+20 /* &.eEName */, uint32(int32(*(*uint8)(unsafe.Pointer(a + uintptr(k)*32 + 20 /* &.eEName */))&0x3>>0)), 0, 0x3)
(*ExprList_item)(unsafe.Pointer(a + uintptr(k)*32)).FzEName = uintptr(0)
}
(*ExprList_item)(unsafe.Pointer(a + uintptr(k)*32)).FpExpr = uintptr(0)
@@ -109922,7 +113753,7 @@ __3:
if iDb >= 0 {
zSchemaName = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
} else {
- zSchemaName = ts + 17445 /* "*" */
+ zSchemaName = ts + 20672 /* "*" */
}
}
for j = 0; j < int32((*Table)(unsafe.Pointer(pTab)).FnCol); j++ {
@@ -109971,7 +113802,7 @@ __3:
pExpr = Xsqlite3PExpr(tls, pParse, 139, pLeft, pExpr)
}
if longNames != 0 {
- zColname = Xsqlite3MPrintf(tls, db, ts+10498 /* "%s.%s" */, crt.VaList(bp+24, zTabName, zName))
+ zColname = Xsqlite3MPrintf(tls, db, ts+9978 /* "%s.%s" */, libc.VaList(bp+24, zTabName, zName))
zToFree = zColname
}
} else {
@@ -109986,10 +113817,10 @@ __3:
if pSub != 0 {
(*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3DbStrDup(tls, db, (*ExprList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSub)).FpEList+8 /* &.a */)+uintptr(j)*32)).FzEName)
} else {
- (*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3MPrintf(tls, db, ts+17447, /* "%s.%s.%s" */
- crt.VaList(bp+40, zSchemaName, zTabName, zColname))
+ (*ExprList_item)(unsafe.Pointer(pX)).FzEName = Xsqlite3MPrintf(tls, db, ts+20674, /* "%s.%s.%s" */
+ libc.VaList(bp+40, zSchemaName, zTabName, zColname))
}
- crt.SetBitFieldPtr8Uint32(pX+20 /* &.eEName */, uint32(2), 0, 0x3)
+ libc.SetBitFieldPtr8Uint32(pX+20 /* &.eEName */, uint32(2), 0, 0x3)
}
Xsqlite3DbFree(tls, db, zToFree)
}
@@ -110004,9 +113835,9 @@ __3:
;
if !(tableSeen != 0) {
if zTName != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+17456 /* "no such table: %..." */, crt.VaList(bp+64, zTName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+20683 /* "no such table: %..." */, libc.VaList(bp+64, zTName))
} else {
- Xsqlite3ErrorMsg(tls, pParse, ts+17474 /* "no tables specif..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+20701 /* "no tables specif..." */, 0)
}
}
}
@@ -110016,7 +113847,7 @@ __3:
}
if (*Select)(unsafe.Pointer(p)).FpEList != 0 {
if (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(2)*4)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+17494 /* "too many columns..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+20721 /* "too many columns..." */, 0)
return 2
}
if (elistFlags & (U32(0x000004 | 0x200000))) != U32(0) {
@@ -110037,28 +113868,28 @@ __3:
// If anything goes wrong, an error message is written into pParse.
// The calling function can detect the problem by looking at pParse->nErr
// and/or pParse->db->mallocFailed.
-func sqlite3SelectExpand(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:134228:13: */
+func sqlite3SelectExpand(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:134582:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
// var w Walker at bp, 48
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{Xsqlite3ExprWalkNoop}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FpParse = pParse
if (*Parse)(unsafe.Pointer(pParse)).FhasCompound != 0 {
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{convertCompoundSelectToSubquery}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = uintptr(0)
Xsqlite3WalkSelect(tls, bp /* &w */, pSelect)
}
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{selectExpander}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{selectPopWith}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FeCode = U16(0)
Xsqlite3WalkSelect(tls, bp /* &w */, pSelect)
@@ -110075,7 +113906,7 @@ func sqlite3SelectExpand(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /* sql
// by selectExpander() but the type and collation information was omitted
// at that point because identifiers had not yet been resolved. This
// routine is called after identifier resolution.
-func selectAddSubqueryTypeInfo(tls *crt.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:134258:13: */
+func selectAddSubqueryTypeInfo(tls *libc.TLS, pWalker uintptr, p uintptr) { /* sqlite3.c:134612:13: */
var pParse uintptr
var i int32
var pTabList uintptr
@@ -110122,20 +113953,20 @@ __3:
// SELECT statement.
//
// Use this routine after name resolution.
-func sqlite3SelectAddTypeInfo(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:134293:13: */
+func sqlite3SelectAddTypeInfo(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:134647:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
// var w Walker at bp, 48
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{Xsqlite3SelectWalkNoop}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{selectAddSubqueryTypeInfo}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{Xsqlite3ExprWalkNoop}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FpParse = pParse
Xsqlite3WalkSelect(tls, bp /* &w */, pSelect)
@@ -110151,7 +113982,7 @@ func sqlite3SelectAddTypeInfo(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /
// * Identifiers in expression are matched to tables.
//
// This routine acts recursively on all subqueries within the SELECT.
-func Xsqlite3SelectPrep(tls *crt.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:134317:21: */
+func Xsqlite3SelectPrep(tls *libc.TLS, pParse uintptr, p uintptr, pOuterNC uintptr) { /* sqlite3.c:134671:21: */
if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
return
@@ -110176,7 +114007,7 @@ func Xsqlite3SelectPrep(tls *crt.TLS, pParse uintptr, p uintptr, pOuterNC uintpt
// intermediate results while calculating an aggregate. This
// routine generates code that stores NULLs in all of those memory
// cells.
-func resetAccumulator(tls *crt.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:134340:13: */
+func resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:134694:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var i int32
var pFunc uintptr
@@ -110184,7 +114015,7 @@ func resetAccumulator(tls *crt.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlit
if nReg == 0 {
return
}
- if (*Parse)(unsafe.Pointer(pParse)).FnErr != 0 {
+ if ((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) {
return
}
Xsqlite3VdbeAddOp3(tls, v, 72, 0, (*AggInfo)(unsafe.Pointer(pAggInfo)).FmnReg, (*AggInfo)(unsafe.Pointer(pAggInfo)).FmxReg)
@@ -110196,11 +114027,11 @@ __1:
}
{
if (*AggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 {
- var pE uintptr = (*AggInfo_func)(unsafe.Pointer(pFunc)).FpExpr
+ var pE uintptr = (*AggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr
if (*(*uintptr)(unsafe.Pointer(pE + 32 /* &.x */)) == uintptr(0)) || ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32 /* &.x */)))).FnExpr != 1) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+17525 /* "DISTINCT aggrega..." */, 0)
+ ts+20752 /* "DISTINCT aggrega..." */, 0)
(*AggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -1
} else {
var pKeyInfo uintptr = Xsqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32 /* &.x */)), 0, 0)
@@ -110220,7 +114051,7 @@ __3:
// Invoke the OP_AggFinalize opcode for every aggregate function
// in the AggInfo structure.
-func finalizeAggFunctions(tls *crt.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:134382:13: */
+func finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { /* sqlite3.c:134736:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var i int32
var pF uintptr
@@ -110231,7 +114062,7 @@ __1:
goto __3
}
{
- var pList uintptr = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpExpr + 32 /* &.x */))
+ var pList uintptr = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 32 /* &.x */))
Xsqlite3VdbeAddOp2(tls, v, 157, (*AggInfo_func)(unsafe.Pointer(pF)).FiMem, func() int32 {
if pList != 0 {
@@ -110257,7 +114088,7 @@ __3:
// in pAggInfo, then only populate the pAggInfo->nAccumulator accumulator
// registers if register regAcc contains 0. The caller will take care
// of setting and clearing regAcc.
-func updateAccumulator(tls *crt.TLS, pParse uintptr, regAcc int32, pAggInfo uintptr) { /* sqlite3.c:134404:13: */
+func updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo uintptr) { /* sqlite3.c:134758:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var i int32
var regHit int32 = 0
@@ -110276,22 +114107,26 @@ __1:
var nArg int32
var addrNext int32 = 0
var regAgg int32
- var pList uintptr = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpExpr + 32 /* &.x */))
-
- if ((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer(pF)).FpExpr))).Fflags & (U32(0x1000000))) != U32(0) {
- var pFilter uintptr = (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpExpr + 64 /* &.y */)))).FpFilter
- if ((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) &&
- (((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & U32(0x0020)) != 0) {
+ var pList uintptr = *(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 32 /* &.x */))
+
+ if ((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr))).Fflags & (U32(0x1000000))) != U32(0) {
+ var pFilter uintptr = (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 64 /* &.y */)))).FpFilter
+ if (((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) &&
+ (((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer(pF)).FpFunc)).FfuncFlags & U32(0x0020)) != 0)) &&
+ (regAcc != 0) {
+ // If regAcc==0, there there exists some min() or max() function
+ // without a FILTER clause that will ensure the magnet registers
+ // are populated.
if regHit == 0 {
- regHit = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regHit = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
- // If this is the first row of the group (regAcc==0), clear the
+ // If this is the first row of the group (regAcc contains 0), clear the
// "magnet" register regHit so that the accumulator registers
// are populated if the FILTER clause jumps over the the
// invocation of min() or max() altogether. Or, if this is not
- // the first row (regAcc==1), set the magnet register so that the
- // accumulators are not populated unless the min()/max() is invoked and
- // indicates that they should be.
+ // the first row (regAcc contains 1), set the magnet register so that
+ // the accumulators are not populated unless the min()/max() is invoked
+ // and indicates that they should be.
Xsqlite3VdbeAddOp2(tls, v, 77, regAcc, regHit)
}
addrNext = Xsqlite3VdbeMakeLabel(tls, pParse)
@@ -110339,7 +114174,7 @@ __1:
pColl = (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl
}
if (regHit == 0) && ((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) {
- regHit = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regHit = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
Xsqlite3VdbeAddOp4(tls, v, 81, regHit, 0, 0, pColl, -2)
}
@@ -110372,7 +114207,7 @@ __7:
goto __9
}
{
- Xsqlite3ExprCode(tls, pParse, (*AggInfo_col)(unsafe.Pointer(pC)).FpExpr, (*AggInfo_col)(unsafe.Pointer(pC)).FiMem)
+ Xsqlite3ExprCode(tls, pParse, (*AggInfo_col)(unsafe.Pointer(pC)).FpCExpr, (*AggInfo_col)(unsafe.Pointer(pC)).FiMem)
}
goto __8
__8:
@@ -110391,25 +114226,25 @@ __9:
// Add a single OP_Explain instruction to the VDBE to explain a simple
// count(*) query ("SELECT count(*) FROM pTab").
-func explainSimpleCount(tls *crt.TLS, pParse uintptr, pTab uintptr, pIdx uintptr) { /* sqlite3.c:134497:13: */
+func explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintptr) { /* sqlite3.c:134855:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
if int32((*Parse)(unsafe.Pointer(pParse)).Fexplain) == 2 {
- var bCover int32 = (crt.Bool32((pIdx != uintptr(0)) && ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) || !(int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */))&0x3>>0) == 2))))
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+17576, /* "SCAN TABLE %s%s%..." */
- crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
+ var bCover int32 = (libc.Bool32((pIdx != uintptr(0)) && ((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) || !(int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */))&0x3>>0) == 2))))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+20803, /* "SCAN TABLE %s%s%..." */
+ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName,
func() uintptr {
if bCover != 0 {
- return ts + 17594 /* " USING COVERING ..." */
+ return ts + 20821 /* " USING COVERING ..." */
}
- return ts + 672 /* "" */
+ return ts + 781 /* "" */
}(),
func() uintptr {
if bCover != 0 {
return (*Index)(unsafe.Pointer(pIdx)).FzName
}
- return ts + 672 /* "" */
+ return ts + 781 /* "" */
}()))
}
}
@@ -110423,12 +114258,12 @@ func explainSimpleCount(tls *crt.TLS, pParse uintptr, pTab uintptr, pIdx uintptr
// sub-expression matches the criteria for being moved to the WHERE
// clause. If so, add it to the WHERE clause and replace the sub-expression
// within the HAVING expression with a constant "1".
-func havingToWhereExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:134526:12: */
+func havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:134884:12: */
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) != 44 {
var pS uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */))
if Xsqlite3ExprIsConstantOrGroupBy(tls, (*Walker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*Select)(unsafe.Pointer(pS)).FpGroupBy) != 0 {
var db uintptr = (*Parse)(unsafe.Pointer((*Walker)(unsafe.Pointer(pWalker)).FpParse)).Fdb
- var pNew uintptr = Xsqlite3Expr(tls, db, 152, ts+7523 /* "1" */)
+ var pNew uintptr = Xsqlite3Expr(tls, db, 152, ts+9882 /* "1" */)
if pNew != 0 {
var pWhere uintptr = (*Select)(unsafe.Pointer(pS)).FpWhere
{
@@ -110460,16 +114295,16 @@ func havingToWhereExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /
// A term of the HAVING expression is eligible for transfer if it consists
// entirely of constants and expressions that are also GROUP BY terms that
// use the "BINARY" collation sequence.
-func havingToWhere(tls *crt.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:134560:13: */
+func havingToWhere(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:134918:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
// var sWalker Walker at bp, 48
- crt.Xmemset(tls, bp /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FpParse = pParse
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{havingToWhereExprCb}))
*(*uintptr)(unsafe.Pointer(bp /* &sWalker */ + 40 /* &.u */)) = p
Xsqlite3WalkExpr(tls, bp /* &sWalker */, (*Select)(unsafe.Pointer(p)).FpHaving)
@@ -110478,7 +114313,7 @@ func havingToWhere(tls *crt.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:13456
// Check to see if the pThis entry of pTabList is a self-join of a prior view.
// If it is, then return the SrcList_item for the prior view. If it is not,
// then return 0.
-func isSelfJoinView(tls *crt.TLS, pTabList uintptr, pThis uintptr) uintptr { /* sqlite3.c:134580:28: */
+func isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr) uintptr { /* sqlite3.c:134938:28: */
var pItem uintptr
for pItem = pTabList + 8; /* &.a */ pItem < pThis; pItem += 112 {
var pS1 uintptr
@@ -110526,9 +114361,9 @@ func isSelfJoinView(tls *crt.TLS, pTabList uintptr, pThis uintptr) uintptr { /*
//
// This routine does NOT free the Select structure passed in. The
// calling function needs to do that.
-func Xsqlite3Select(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:134712:20: */
- bp := tls.Alloc(200)
- defer tls.Free(200)
+func Xsqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) int32 { /* sqlite3.c:135070:20: */
+ bp := tls.Alloc(248)
+ defer tls.Free(248)
var i int32
var j int32 // Loop counters
@@ -110542,15 +114377,17 @@ func Xsqlite3Select(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) int3
var pHaving uintptr // The HAVING clause. May be NULL
var pAggInfo uintptr // Aggregate information
var rc int32 // Value to return from this function
- // var sDistinct DistinctCtx at bp+120, 12
+ // var sDistinct DistinctCtx at bp+168, 12
// Info on how to code the DISTINCT keyword
- // var sSort SortCtx at bp+40, 48
+ // var sSort SortCtx at bp+80, 48
// Info on how to code the ORDER BY clause
var iEnd int32 // Address of the end of the query
var db uintptr // The database connection
- // var pMinMaxOrderBy uintptr at bp+192, 8
+ // var pMinMaxOrderBy uintptr at bp+240, 8
// Added ORDER BY for min/max queries
var minMaxFlag U8
+ var p1 uintptr
+ var p0 uintptr
var pItem uintptr
var pSub uintptr
var pTab uintptr
@@ -110566,7 +114403,7 @@ func Xsqlite3Select(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) int3
var retAddr int32
var pPrior uintptr
var pItem1 uintptr
- // var dest SelectDest at bp+88, 32
+ // var dest SelectDest at bp+128, 40
var pSub1 uintptr
var zSavedAuthContext uintptr
@@ -110619,12 +114456,13 @@ func Xsqlite3Select(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) int3
var pIdx uintptr // Iterator variable
var pKeyInfo2 uintptr // Keyinfo for scanned index
var pBest uintptr // Best index found so far
- var iRoot int32
- var regAcc int32
+ var iRoot Pgno
+ var regAcc int32 // "populate accumulators" flag
+ var addrSkip int32
var pTab1 uintptr
// This case when there exist aggregate functions or a GROUP BY clause
// or both
- // var sNC NameContext at bp+136, 56
+ // var sNC NameContext at bp+184, 56
// Name context for processing aggregate information
var iAMem int32 // First Mem address for storing current GROUP BY
var iBMem int32 // First Mem address for previous GROUP BY
@@ -110640,7 +114478,7 @@ func Xsqlite3Select(tls *crt.TLS, pParse uintptr, p uintptr, pDest uintptr) int3
pEList = uintptr(0)
pAggInfo = uintptr(0)
rc = 1
- *(*uintptr)(unsafe.Pointer(bp + 192 /* pMinMaxOrderBy */)) = uintptr(0) // Flag for min/max queries
+ *(*uintptr)(unsafe.Pointer(bp + 240 /* pMinMaxOrderBy */)) = uintptr(0) // Flag for min/max queries
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
v = Xsqlite3GetVdbe(tls, pParse)
@@ -110665,7 +114503,7 @@ __2:
// DISTINCT so it can be removed too.
Xsqlite3ExprListDelete(tls, db, (*Select)(unsafe.Pointer(p)).FpOrderBy)
(*Select)(unsafe.Pointer(p)).FpOrderBy = uintptr(0)
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (^U32(crt.Int32FromInt32(0x0000001)))
+ *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (^U32(libc.Int32FromInt32(0x0000001)))
*(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(0x0400000))
__3:
;
@@ -110677,67 +114515,109 @@ __3:
__4:
;
- if !(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) == 9) {
+ // If the SF_UpdateFrom flag is set, then this function is being called
+ // as part of populating the temp table for an UPDATE...FROM statement.
+ // In this case, it is an error if the target object (pSrc->a[0]) name
+ // or alias is duplicated within FROM clause (pSrc->a[1..n]).
+ if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0800000)) != 0) {
goto __5
}
- generateColumnNames(tls, pParse, p)
+ p0 = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(0)*112)
+ i = 1
+__6:
+ if !(i < (*SrcList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpSrc)).FnSrc) {
+ goto __8
+ }
+ p1 = (((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(i)*112)
+ if !(((*SrcList_item)(unsafe.Pointer(p0)).FpTab == (*SrcList_item)(unsafe.Pointer(p1)).FpTab) && (0 == Xsqlite3_stricmp(tls, (*SrcList_item)(unsafe.Pointer(p0)).FzAlias, (*SrcList_item)(unsafe.Pointer(p1)).FzAlias))) {
+ goto __9
+ }
+ Xsqlite3ErrorMsg(tls, pParse,
+ ts+20844, /* "target object/al..." */
+ libc.VaList(bp, func() uintptr {
+ if (*SrcList_item)(unsafe.Pointer(p0)).FzAlias != 0 {
+ return (*SrcList_item)(unsafe.Pointer(p0)).FzAlias
+ }
+ return (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(p0)).FpTab)).FzName
+ }()))
+ goto select_end
+__9:
+ ;
+ goto __7
+__7:
+ i++
+ goto __6
+ goto __8
+__8:
+ ;
__5:
;
+ if !(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) == 9) {
+ goto __10
+ }
+ generateColumnNames(tls, pParse, p)
+__10:
+ ;
+
rc = Xsqlite3WindowRewrite(tls, pParse, p)
if !(rc != 0) {
- goto __6
+ goto __11
}
goto select_end
-__6:
+__11:
;
pTabList = (*Select)(unsafe.Pointer(p)).FpSrc
- isAgg = (crt.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0000008)) != U32(0)))
- crt.Xmemset(tls, bp+40 /* &sSort */, 0, uint64(unsafe.Sizeof(SortCtx{})))
- (*SortCtx)(unsafe.Pointer(bp + 40 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
+ isAgg = (libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0000008)) != U32(0)))
+ libc.Xmemset(tls, bp+80 /* &sSort */, 0, uint64(unsafe.Sizeof(SortCtx{})))
+ (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
- // Try to various optimizations (flattening subqueries, and strength
+ // Try to do various optimizations (flattening subqueries, and strength
// reduction of join operators) in the FROM clause up into the main query
i = 0
-__7:
+__12:
if !(!(int32((*Select)(unsafe.Pointer(p)).FpPrior) != 0) && (i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc)) {
- goto __9
+ goto __14
}
pItem = ((pTabList + 8 /* &.a */) + uintptr(i)*112)
pSub = (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect
pTab = (*SrcList_item)(unsafe.Pointer(pItem)).FpTab
+ // The expander should have already created transient Table objects
+ // even for FROM clause elements such as subqueries that do not correspond
+ // to a real table
+
// Convert LEFT JOIN into JOIN if there are terms of the right table
// of the LEFT JOIN used in the WHERE clause.
if !((((int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & 0x0008) != 0) &&
(Xsqlite3ExprImpliesNonNullRow(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor) != 0)) &&
((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x2000)) == 0)) {
- goto __10
+ goto __15
}
- *(*U8)(unsafe.Pointer(pItem + 60 /* &.fg */ /* &.jointype */)) &= crt.Uint8FromInt32((^int32(crt.Int32FromInt32((0x0008 | 0x0020)))))
+ *(*U8)(unsafe.Pointer(pItem + 60 /* &.fg */ /* &.jointype */)) &= libc.Uint8FromInt32((^int32(libc.Int32FromInt32((0x0008 | 0x0020)))))
unsetJoinExpr(tls, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor)
-__10:
+__15:
;
// No futher action if this term of the FROM clause is no a subquery
if !(pSub == uintptr(0)) {
- goto __11
+ goto __16
}
- goto __8
-__11:
+ goto __13
+__16:
;
// Catch mismatch in the declared columns of a view and the number of
// columns in the SELECT on the RHS
if !(int32((*Table)(unsafe.Pointer(pTab)).FnCol) != (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpEList)).FnExpr) {
- goto __12
+ goto __17
}
- Xsqlite3ErrorMsg(tls, pParse, ts+17617, /* "expected %d colu..." */
- crt.VaList(bp, int32((*Table)(unsafe.Pointer(pTab)).FnCol), (*Table)(unsafe.Pointer(pTab)).FzName, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpEList)).FnExpr))
+ Xsqlite3ErrorMsg(tls, pParse, ts+20898, /* "expected %d colu..." */
+ libc.VaList(bp+8, int32((*Table)(unsafe.Pointer(pTab)).FnCol), (*Table)(unsafe.Pointer(pTab)).FzName, (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(pSub)).FpEList)).FnExpr))
goto select_end
-__12:
+__17:
;
// Do not try to flatten an aggregate subquery.
@@ -110747,10 +114627,10 @@ __12:
// will be implemented as a co-routine and there is no advantage to
// flattening in that case.
if !(((*Select)(unsafe.Pointer(pSub)).FselFlags & U32(0x0000008)) != U32(0)) {
- goto __13
+ goto __18
}
- goto __8
-__13:
+ goto __13
+__18:
;
// If the outer query contains a "complex" result set (that is,
@@ -110775,60 +114655,60 @@ __13:
(((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0040000)) != U32(0))) &&
(((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1) ||
((int32((*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(1)*112)).Ffg.Fjointype) & (0x0008 | 0x0002)) != 0))) {
- goto __14
+ goto __19
}
- goto __8
-__14:
+ goto __13
+__19:
;
if !(flattenSubquery(tls, pParse, p, i, isAgg) != 0) {
- goto __15
+ goto __20
}
if !((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) {
- goto __16
+ goto __21
}
goto select_end
-__16:
+__21:
;
// This subquery can be absorbed into its parent.
i = -1
-__15:
+__20:
;
pTabList = (*Select)(unsafe.Pointer(p)).FpSrc
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __17
+ goto __22
}
goto select_end
-__17:
+__22:
;
if !(!((int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest)) <= 8)) {
- goto __18
+ goto __23
}
- (*SortCtx)(unsafe.Pointer(bp + 40 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
-__18:
+ (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FpOrderBy = (*Select)(unsafe.Pointer(p)).FpOrderBy
+__23:
;
- goto __8
-__8:
+ goto __13
+__13:
i++
- goto __7
- goto __9
-__9:
+ goto __12
+ goto __14
+__14:
;
// Handle compound SELECT statements using the separate multiSelect()
// procedure.
if !((*Select)(unsafe.Pointer(p)).FpPrior != 0) {
- goto __19
+ goto __24
}
rc = multiSelect(tls, pParse, p, pDest)
if !((*Select)(unsafe.Pointer(p)).FpNext == uintptr(0)) {
- goto __20
+ goto __25
}
Xsqlite3VdbeExplainPop(tls, pParse)
-__20:
+__25:
;
return rc
-__19:
+__24:
;
// Do the WHERE-clause constant propagation optimization if this is
@@ -110838,21 +114718,21 @@ __19:
if !((((*SrcList)(unsafe.Pointer(pTabList)).FnSrc > 1) &&
((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x8000)) == 0)) &&
(propagateConstants(tls, pParse, p) != 0)) {
- goto __21
+ goto __26
}
- goto __22
-__21:
+ goto __27
+__26:
;
-__22:
+__27:
;
// For each term in the FROM clause, do two things:
// (1) Authorized unreferenced tables
// (2) Generate code for all sub-queries
i = 0
-__23:
+__28:
if !(i < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc) {
- goto __25
+ goto __30
}
pItem1 = ((pTabList + 8 /* &.a */) + uintptr(i)*112)
@@ -110872,19 +114752,19 @@ __23:
// assume the column name is non-NULL and segfault. The use of an empty
// string for the fake column name seems safer.
if !(((*SrcList_item)(unsafe.Pointer(pItem1)).FcolUsed == uint64(0)) && ((*SrcList_item)(unsafe.Pointer(pItem1)).FzName != uintptr(0))) {
- goto __26
+ goto __31
}
- Xsqlite3AuthCheck(tls, pParse, 20, (*SrcList_item)(unsafe.Pointer(pItem1)).FzName, ts+672 /* "" */, (*SrcList_item)(unsafe.Pointer(pItem1)).FzDatabase)
-__26:
+ Xsqlite3AuthCheck(tls, pParse, 20, (*SrcList_item)(unsafe.Pointer(pItem1)).FzName, ts+781 /* "" */, (*SrcList_item)(unsafe.Pointer(pItem1)).FzDatabase)
+__31:
;
// Generate code for all sub-queries in the FROM clause
pSub1 = (*SrcList_item)(unsafe.Pointer(pItem1)).FpSelect
if !(pSub1 == uintptr(0)) {
- goto __27
+ goto __32
}
- goto __24
-__27:
+ goto __29
+__32:
;
// The code for a subquery should only be generated once, though it is
@@ -110905,19 +114785,19 @@ __27:
// (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit
// more conservative than necessary, but much easier than enforcing
// an exact limit.
- *(*int32)(unsafe.Pointer(pParse + 292 /* &.nHeight */)) += (0)
+ *(*int32)(unsafe.Pointer(pParse + 292 /* &.nHeight */)) += (Xsqlite3SelectExprHeight(tls, p))
// Make copies of constant WHERE-clause terms in the outer query down
// inside the subquery. This can help the subquery to run more efficiently.
if !(((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x1000)) == 0) &&
(pushDownWhereTerms(tls, pParse, pSub1, (*Select)(unsafe.Pointer(p)).FpWhere, (*SrcList_item)(unsafe.Pointer(pItem1)).FiCursor,
- (crt.Bool32((int32((*SrcList_item)(unsafe.Pointer(pItem1)).Ffg.Fjointype)&0x0020) != 0))) != 0)) {
- goto __28
+ (libc.Bool32((int32((*SrcList_item)(unsafe.Pointer(pItem1)).Ffg.Fjointype)&0x0020) != 0))) != 0)) {
+ goto __33
}
- goto __29
-__28:
+ goto __34
+__33:
;
-__29:
+__34:
;
zSavedAuthContext = (*Parse)(unsafe.Pointer(pParse)).FzAuthContext
@@ -110934,86 +114814,87 @@ __29:
if !((i == 0) &&
(((*SrcList)(unsafe.Pointer(pTabList)).FnSrc == 1) ||
((int32((*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(1)*112)).Ffg.Fjointype) & (0x0008 | 0x0002)) != 0))) {
- goto __30
+ goto __35
}
// Implement a co-routine that will return a single row of the result
// set on each invocation.
addrTop = (Xsqlite3VdbeCurrentAddr(tls, v) + 1)
- (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp3(tls, v, 13, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn, 0, addrTop)
-
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp+32, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FzName))
(*SrcList_item)(unsafe.Pointer(pItem1)).FaddrFillSub = addrTop
- Xsqlite3SelectDestInit(tls, bp+88 /* &dest */, 13, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn)
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17657 /* "CO-ROUTINE %u" */, crt.VaList(bp+24, (*Select)(unsafe.Pointer(pSub1)).FselId))
- Xsqlite3Select(tls, pParse, pSub1, bp+88 /* &dest */)
+ Xsqlite3SelectDestInit(tls, bp+128 /* &dest */, 13, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20938 /* "CO-ROUTINE %u" */, libc.VaList(bp+40, (*Select)(unsafe.Pointer(pSub1)).FselId))
+ Xsqlite3Select(tls, pParse, pSub1, bp+128 /* &dest */)
(*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow
- crt.SetBitFieldPtr8Uint32(pItem1+60 /* &.fg */ +4 /* &.viaCoroutine */, uint32(1), 4, 0x10)
- (*SrcList_item)(unsafe.Pointer(pItem1)).FregResult = (*SelectDest)(unsafe.Pointer(bp + 88 /* &dest */)).FiSdst
+ libc.SetBitFieldPtr8Uint32(pItem1+60 /* &.fg */ +4 /* &.viaCoroutine */, uint32(1), 4, 0x10)
+ (*SrcList_item)(unsafe.Pointer(pItem1)).FregResult = (*SelectDest)(unsafe.Pointer(bp + 128 /* &dest */)).FiSdst
Xsqlite3VdbeEndCoroutine(tls, v, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn)
Xsqlite3VdbeJumpHere(tls, v, (addrTop - 1))
Xsqlite3ClearTempRegCache(tls, pParse)
- goto __31
-__30:
+ goto __36
+__35:
onceAddr = 0
// Ticket c52b09c7f38903b1311
- (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
topAddr = Xsqlite3VdbeAddOp2(tls, v, 69, 0, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn)
(*SrcList_item)(unsafe.Pointer(pItem1)).FaddrFillSub = (topAddr + 1)
if !(int32(*(*uint8)(unsafe.Pointer((pItem1 + 60 /* &.fg */) + 4 /* &.isCorrelated */))&0x8>>3) == 0) {
- goto __32
+ goto __37
}
// If the subquery is not correlated and if we are not inside of
// a trigger, then we only need to compute the value of the subquery
// once.
onceAddr = Xsqlite3VdbeAddOp0(tls, v, 17)
- goto __33
-__32:
- ;
-__33:
+ Xsqlite3VdbeComment(tls, v, ts+20952 /* "materialize \"%s\"" */, libc.VaList(bp+48, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FzName))
+ goto __38
+__37:
+ Xsqlite3VdbeNoopComment(tls, v, ts+20952 /* "materialize \"%s\"" */, libc.VaList(bp+56, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FzName))
+__38:
;
pPrior = isSelfJoinView(tls, pTabList, pItem1)
if !(pPrior != 0) {
- goto __34
+ goto __39
}
Xsqlite3VdbeAddOp2(tls, v, 98, (*SrcList_item)(unsafe.Pointer(pItem1)).FiCursor, (*SrcList_item)(unsafe.Pointer(pPrior)).FiCursor)
(*Select)(unsafe.Pointer(pSub1)).FnSelectRow = (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pPrior)).FpSelect)).FnSelectRow
- goto __35
-__34:
- Xsqlite3SelectDestInit(tls, bp+88 /* &dest */, 12, (*SrcList_item)(unsafe.Pointer(pItem1)).FiCursor)
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+17671 /* "MATERIALIZE %u" */, crt.VaList(bp+32, (*Select)(unsafe.Pointer(pSub1)).FselId))
- Xsqlite3Select(tls, pParse, pSub1, bp+88 /* &dest */)
-__35:
+ goto __40
+__39:
+ Xsqlite3SelectDestInit(tls, bp+128 /* &dest */, 12, (*SrcList_item)(unsafe.Pointer(pItem1)).FiCursor)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+20969 /* "MATERIALIZE %u" */, libc.VaList(bp+64, (*Select)(unsafe.Pointer(pSub1)).FselId))
+ Xsqlite3Select(tls, pParse, pSub1, bp+128 /* &dest */)
+__40:
;
(*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*Select)(unsafe.Pointer(pSub1)).FnSelectRow
if !(onceAddr != 0) {
- goto __36
+ goto __41
}
Xsqlite3VdbeJumpHere(tls, v, onceAddr)
-__36:
+__41:
;
retAddr = Xsqlite3VdbeAddOp1(tls, v, 65, (*SrcList_item)(unsafe.Pointer(pItem1)).FregReturn)
-
+ Xsqlite3VdbeComment(tls, v, ts+20984 /* "end %s" */, libc.VaList(bp+72, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem1)).FpTab)).FzName))
Xsqlite3VdbeChangeP1(tls, v, topAddr, retAddr)
Xsqlite3ClearTempRegCache(tls, pParse)
-__31:
+__36:
;
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __37
+ goto __42
}
goto select_end
-__37:
+__42:
;
- *(*int32)(unsafe.Pointer(pParse + 292 /* &.nHeight */)) -= (0)
+ *(*int32)(unsafe.Pointer(pParse + 292 /* &.nHeight */)) -= (Xsqlite3SelectExprHeight(tls, p))
(*Parse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext
- goto __24
-__24:
+ goto __29
+__29:
i++
- goto __23
- goto __25
-__25:
+ goto __28
+ goto __30
+__30:
;
// Various elements of the SELECT copied into local variables for
@@ -111022,7 +114903,7 @@ __25:
pWhere = (*Select)(unsafe.Pointer(p)).FpWhere
pGroupBy = (*Select)(unsafe.Pointer(p)).FpGroupBy
pHaving = (*Select)(unsafe.Pointer(p)).FpHaving
- (*DistinctCtx)(unsafe.Pointer(bp + 120 /* &sDistinct */)).FisTnct = (U8(crt.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0000001)) != U32(0))))
+ (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FisTnct = (U8(libc.Bool32(((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0000001)) != U32(0))))
// If the query is DISTINCT with an ORDER BY but is not an aggregate, and
// if the select-list is the same as the ORDER BY list, then this query
@@ -111039,17 +114920,17 @@ __25:
// written the query must use a temp-table for at least one of the ORDER
// BY and DISTINCT, and an index or separate temp-table for the other.
if !(((((*Select)(unsafe.Pointer(p)).FselFlags & (U32(0x0000001 | 0x0000008))) == U32(0x0000001)) &&
- (Xsqlite3ExprListCompare(tls, (*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy, pEList, -1) == 0)) &&
+ (Xsqlite3ExprListCompare(tls, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy, pEList, -1) == 0)) &&
((*Select)(unsafe.Pointer(p)).FpWin == uintptr(0))) {
- goto __38
+ goto __43
}
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (^U32(crt.Int32FromInt32(0x0000001)))
- pGroupBy = crt.AssignPtrUintptr(p+56 /* &.pGroupBy */, Xsqlite3ExprListDup(tls, db, pEList, 0))
+ *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (^U32(libc.Int32FromInt32(0x0000001)))
+ pGroupBy = libc.AssignPtrUintptr(p+56 /* &.pGroupBy */, Xsqlite3ExprListDup(tls, db, pEList, 0))
*(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(0x0000008))
// Notice that even thought SF_Distinct has been cleared from p->selFlags,
// the sDistinct.isTnct is still set. Hence, isTnct represents the
// original setting of the SF_Distinct flag, not the current setting
-__38:
+__43:
;
// If there is an ORDER BY clause, then create an ephemeral index to
@@ -111059,161 +114940,161 @@ __38:
// changed to an OP_Noop once we figure out that the sorting index is
// not needed. The sSort.addrSortIndex variable is used to facilitate
// that change.
- if !((*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy != 0) {
- goto __39
+ if !((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy != 0) {
+ goto __44
}
pKeyInfo = Xsqlite3KeyInfoFromExprList(tls,
- pParse, (*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy, 0, (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
- (*SortCtx)(unsafe.Pointer(bp + 40 /* &sSort */)).FiECursor = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
- (*SortCtx)(unsafe.Pointer(bp + 40 /* &sSort */)).FaddrSortIndex = Xsqlite3VdbeAddOp4(tls, v, 100,
- (*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FiECursor, (((*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy)).FnExpr + 1) + (*ExprList)(unsafe.Pointer(pEList)).FnExpr), 0,
+ pParse, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy, 0, (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
+ (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FiECursor = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FaddrSortIndex = Xsqlite3VdbeAddOp4(tls, v, 100,
+ (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FiECursor, (((*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy)).FnExpr + 1) + (*ExprList)(unsafe.Pointer(pEList)).FnExpr), 0,
pKeyInfo, -9)
- goto __40
-__39:
- (*SortCtx)(unsafe.Pointer(bp + 40 /* &sSort */)).FaddrSortIndex = -1
-__40:
+ goto __45
+__44:
+ (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FaddrSortIndex = -1
+__45:
;
// If the output is destined for a temporary table, open that table.
if !(int32((*SelectDest)(unsafe.Pointer(pDest)).FeDest) == 12) {
- goto __41
+ goto __46
}
Xsqlite3VdbeAddOp2(tls, v, 100, (*SelectDest)(unsafe.Pointer(pDest)).FiSDParm, (*ExprList)(unsafe.Pointer(pEList)).FnExpr)
-__41:
+__46:
;
// Set the limiter.
iEnd = Xsqlite3VdbeMakeLabel(tls, pParse)
if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0004000)) == U32(0)) {
- goto __42
+ goto __47
}
(*Select)(unsafe.Pointer(p)).FnSelectRow = int16(320)
-__42:
+__47:
;
computeLimitRegisters(tls, pParse, p, iEnd)
- if !(((*Select)(unsafe.Pointer(p)).FiLimit == 0) && ((*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FaddrSortIndex >= 0)) {
- goto __43
+ if !(((*Select)(unsafe.Pointer(p)).FiLimit == 0) && ((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex >= 0)) {
+ goto __48
}
- Xsqlite3VdbeChangeOpcode(tls, v, (*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FaddrSortIndex, uint8(111))
- *(*U8)(unsafe.Pointer(bp + 40 /* &sSort */ + 36 /* &.sortFlags */)) |= U8((0x01))
-__43:
+ Xsqlite3VdbeChangeOpcode(tls, v, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex, uint8(111))
+ *(*U8)(unsafe.Pointer(bp + 80 /* &sSort */ + 36 /* &.sortFlags */)) |= U8((0x01))
+__48:
;
// Open an ephemeral index to use for the distinct set.
if !(((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0000001)) != 0) {
- goto __44
+ goto __49
}
- (*DistinctCtx)(unsafe.Pointer(bp + 120 /* &sDistinct */)).FtabTnct = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
- (*DistinctCtx)(unsafe.Pointer(bp + 120 /* &sDistinct */)).FaddrTnct = Xsqlite3VdbeAddOp4(tls, v, 100,
- (*DistinctCtx)(unsafe.Pointer(bp+120 /* &sDistinct */)).FtabTnct, 0, 0,
+ (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FtabTnct = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FaddrTnct = Xsqlite3VdbeAddOp4(tls, v, 100,
+ (*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FtabTnct, 0, 0,
Xsqlite3KeyInfoFromExprList(tls, pParse, (*Select)(unsafe.Pointer(p)).FpEList, 0, 0),
-9)
Xsqlite3VdbeChangeP5(tls, v, uint16(8))
- (*DistinctCtx)(unsafe.Pointer(bp + 120 /* &sDistinct */)).FeTnctType = U8(3)
- goto __45
-__44:
- (*DistinctCtx)(unsafe.Pointer(bp + 120 /* &sDistinct */)).FeTnctType = U8(0)
-__45:
+ (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FeTnctType = U8(3)
+ goto __50
+__49:
+ (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FeTnctType = U8(0)
+__50:
;
if !(!(isAgg != 0) && (pGroupBy == uintptr(0))) {
- goto __46
+ goto __51
}
// No aggregate functions and no GROUP BY clause
wctrlFlags = (U16((func() uint32 {
- if (*DistinctCtx)(unsafe.Pointer(bp+120 /* &sDistinct */)).FisTnct != 0 {
+ if (*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FisTnct != 0 {
return uint32(0x0100)
}
return uint32(0)
}()) |
((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0004000))))
- pWin = (*Select)(unsafe.Pointer(p)).FpWin // Master window object (or NULL)
+ pWin = (*Select)(unsafe.Pointer(p)).FpWin // Main window object (or NULL)
if !(pWin != 0) {
- goto __48
+ goto __53
}
Xsqlite3WindowCodeInit(tls, pParse, p)
-__48:
+__53:
;
// Begin the database scan.
- pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, (*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy,
+ pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy,
(*Select)(unsafe.Pointer(p)).FpEList, wctrlFlags, int32((*Select)(unsafe.Pointer(p)).FnSelectRow))
if !(pWInfo == uintptr(0)) {
- goto __49
+ goto __54
}
goto select_end
-__49:
+__54:
;
if !(int32(Xsqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*Select)(unsafe.Pointer(p)).FnSelectRow)) {
- goto __50
+ goto __55
}
(*Select)(unsafe.Pointer(p)).FnSelectRow = Xsqlite3WhereOutputRowCount(tls, pWInfo)
-__50:
+__55:
;
- if !(((*DistinctCtx)(unsafe.Pointer(bp+120 /* &sDistinct */)).FisTnct != 0) && (Xsqlite3WhereIsDistinct(tls, pWInfo) != 0)) {
- goto __51
+ if !(((*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FisTnct != 0) && (Xsqlite3WhereIsDistinct(tls, pWInfo) != 0)) {
+ goto __56
}
- (*DistinctCtx)(unsafe.Pointer(bp + 120 /* &sDistinct */)).FeTnctType = U8(Xsqlite3WhereIsDistinct(tls, pWInfo))
-__51:
+ (*DistinctCtx)(unsafe.Pointer(bp + 168 /* &sDistinct */)).FeTnctType = U8(Xsqlite3WhereIsDistinct(tls, pWInfo))
+__56:
;
- if !((*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy != 0) {
- goto __52
+ if !((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy != 0) {
+ goto __57
}
- (*SortCtx)(unsafe.Pointer(bp + 40 /* &sSort */)).FnOBSat = Xsqlite3WhereIsOrdered(tls, pWInfo)
- (*SortCtx)(unsafe.Pointer(bp + 40 /* &sSort */)).FlabelOBLopt = Xsqlite3WhereOrderByLimitOptLabel(tls, pWInfo)
- if !((*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FnOBSat == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy)).FnExpr) {
- goto __53
+ (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FnOBSat = Xsqlite3WhereIsOrdered(tls, pWInfo)
+ (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FlabelOBLopt = Xsqlite3WhereOrderByLimitOptLabel(tls, pWInfo)
+ if !((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FnOBSat == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy)).FnExpr) {
+ goto __58
}
- (*SortCtx)(unsafe.Pointer(bp + 40 /* &sSort */)).FpOrderBy = uintptr(0)
-__53:
+ (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FpOrderBy = uintptr(0)
+__58:
;
-__52:
+__57:
;
// If sorting index that was created by a prior OP_OpenEphemeral
// instruction ended up not being needed, then change the OP_OpenEphemeral
// into an OP_Noop.
- if !(((*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FaddrSortIndex >= 0) && ((*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy == uintptr(0))) {
- goto __54
+ if !(((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex >= 0) && ((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy == uintptr(0))) {
+ goto __59
}
- Xsqlite3VdbeChangeToNoop(tls, v, (*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FaddrSortIndex)
-__54:
+ Xsqlite3VdbeChangeToNoop(tls, v, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex)
+__59:
;
if !(pWin != 0) {
- goto __55
+ goto __60
}
addrGosub = Xsqlite3VdbeMakeLabel(tls, pParse)
iCont = Xsqlite3VdbeMakeLabel(tls, pParse)
iBreak = Xsqlite3VdbeMakeLabel(tls, pParse)
- regGosub = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regGosub = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub)
Xsqlite3VdbeAddOp2(tls, v, 11, 0, iBreak)
Xsqlite3VdbeResolveLabel(tls, v, addrGosub)
-
- (*SortCtx)(unsafe.Pointer(bp + 40 /* &sSort */)).FlabelOBLopt = 0
- selectInnerLoop(tls, pParse, p, -1, bp+40 /* &sSort */, bp+120 /* &sDistinct */, pDest, iCont, iBreak)
+ Xsqlite3VdbeNoopComment(tls, v, ts+20991 /* "inner-loop subro..." */, 0)
+ (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FlabelOBLopt = 0
+ selectInnerLoop(tls, pParse, p, -1, bp+80 /* &sSort */, bp+168 /* &sDistinct */, pDest, iCont, iBreak)
Xsqlite3VdbeResolveLabel(tls, v, iCont)
Xsqlite3VdbeAddOp1(tls, v, 65, regGosub)
-
+ Xsqlite3VdbeComment(tls, v, ts+21013 /* "end inner-loop s..." */, 0)
Xsqlite3VdbeResolveLabel(tls, v, iBreak)
- goto __56
-__55:
+ goto __61
+__60:
// Use the standard inner loop.
- selectInnerLoop(tls, pParse, p, -1, bp+40 /* &sSort */, bp+120 /* &sDistinct */, pDest,
+ selectInnerLoop(tls, pParse, p, -1, bp+80 /* &sSort */, bp+168 /* &sDistinct */, pDest,
Xsqlite3WhereContinueLabel(tls, pWInfo),
Xsqlite3WhereBreakLabel(tls, pWInfo))
// End the database scan loop.
Xsqlite3WhereEnd(tls, pWInfo)
-__56:
+__61:
;
- goto __47
-__46: // End of processing for this SELECT
+ goto __52
+__51: // End of processing for this SELECT
sortPTab = 0 // Pseudotable used to decode sorting results
sortOut = 0 // Output register from the sorter
orderByGrp = 0 // True if the GROUP BY and ORDER BY are the same
@@ -111221,51 +115102,51 @@ __46: // End of processing for this SELECT
// Remove any and all aliases between the result set and the
// GROUP BY clause.
if !(pGroupBy != 0) {
- goto __57
+ goto __62
} // For looping over expression in a list
k = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer(p)).FpEList)).FnExpr
pItem2 = (*Select)(unsafe.Pointer(p)).FpEList + 8 /* &.a */
-__59:
+__64:
if !(k > 0) {
- goto __61
+ goto __66
}
(*struct {
FiOrderByCol U16
FiAlias U16
})(unsafe.Pointer(pItem2 + 24 /* &.u */)).FiAlias = U16(0)
- goto __60
-__60:
+ goto __65
+__65:
k--
pItem2 += 32
- goto __59
- goto __61
-__61:
+ goto __64
+ goto __66
+__66:
;
k = (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr
pItem2 = pGroupBy + 8 /* &.a */
-__62:
+__67:
if !(k > 0) {
- goto __64
+ goto __69
}
(*struct {
FiOrderByCol U16
FiAlias U16
})(unsafe.Pointer(pItem2 + 24 /* &.u */)).FiAlias = U16(0)
- goto __63
-__63:
+ goto __68
+__68:
k--
pItem2 += 32
- goto __62
- goto __64
-__64:
+ goto __67
+ goto __69
+__69:
;
if !(int32((*Select)(unsafe.Pointer(p)).FnSelectRow) > 66) {
- goto __65
+ goto __70
}
(*Select)(unsafe.Pointer(p)).FnSelectRow = int16(66)
-__65:
+__70:
;
// If there is both a GROUP BY and an ORDER BY clause and they are
@@ -111276,8 +115157,8 @@ __65:
// but not actually sorted. Either way, record the fact that the
// ORDER BY and GROUP BY clauses are the same by setting the orderByGrp
// variable.
- if !(((*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy != 0) && ((*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy)).FnExpr)) {
- goto __66
+ if !(((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy != 0) && ((*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr == (*ExprList)(unsafe.Pointer((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy)).FnExpr)) {
+ goto __71
}
// The GROUP BY processing doesn't care whether rows are delivered in
// ASC or DESC order - only that each group is returned contiguously.
@@ -111285,32 +115166,32 @@ __65:
// ORDER BY to maximize the chances of rows being delivered in an
// order that makes the ORDER BY redundant.
ii = 0
-__67:
+__72:
if !(ii < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) {
- goto __69
+ goto __74
}
- sortFlags = (U8(int32((*ExprList_item)(unsafe.Pointer(((*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy+8 /* &.a */)+uintptr(ii)*32)).FsortFlags) & 0x01))
+ sortFlags = (U8(int32((*ExprList_item)(unsafe.Pointer(((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy+8 /* &.a */)+uintptr(ii)*32)).FsortFlags) & 0x01))
(*ExprList_item)(unsafe.Pointer((pGroupBy + 8 /* &.a */) + uintptr(ii)*32)).FsortFlags = sortFlags
- goto __68
-__68:
+ goto __73
+__73:
ii++
- goto __67
- goto __69
-__69:
+ goto __72
+ goto __74
+__74:
;
- if !(Xsqlite3ExprListCompare(tls, pGroupBy, (*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy, -1) == 0) {
- goto __70
+ if !(Xsqlite3ExprListCompare(tls, pGroupBy, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy, -1) == 0) {
+ goto __75
}
orderByGrp = 1
-__70:
+__75:
;
-__66:
+__71:
;
- goto __58
-__57:
+ goto __63
+__62:
;
(*Select)(unsafe.Pointer(p)).FnSelectRow = int16(0)
-__58:
+__63:
;
// Create a label to jump to when we want to abort the query
@@ -111321,17 +115202,18 @@ __58:
// SELECT statement.
pAggInfo = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(AggInfo{})))
if !(pAggInfo == uintptr(0)) {
- goto __71
+ goto __76
}
goto select_end
-__71:
+__76:
;
(*AggInfo)(unsafe.Pointer(pAggInfo)).FpNext = (*Parse)(unsafe.Pointer(pParse)).FpAggList
(*Parse)(unsafe.Pointer(pParse)).FpAggList = pAggInfo
- crt.Xmemset(tls, bp+136 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
- (*NameContext)(unsafe.Pointer(bp + 136 /* &sNC */)).FpParse = pParse
- (*NameContext)(unsafe.Pointer(bp + 136 /* &sNC */)).FpSrcList = pTabList
- *(*uintptr)(unsafe.Pointer(bp + 136 /* &sNC */ + 16 /* &.uNC */)) = pAggInfo
+ (*AggInfo)(unsafe.Pointer(pAggInfo)).FselId = (*Select)(unsafe.Pointer(p)).FselId
+ libc.Xmemset(tls, bp+184 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ (*NameContext)(unsafe.Pointer(bp + 184 /* &sNC */)).FpParse = pParse
+ (*NameContext)(unsafe.Pointer(bp + 184 /* &sNC */)).FpSrcList = pTabList
+ *(*uintptr)(unsafe.Pointer(bp + 184 /* &sNC */ + 16 /* &.uNC */)) = pAggInfo
(*AggInfo)(unsafe.Pointer(pAggInfo)).FmnReg = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
(*AggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = func() int32 {
@@ -111341,75 +115223,75 @@ __71:
return 0
}()
(*AggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy
- Xsqlite3ExprAnalyzeAggList(tls, bp+136 /* &sNC */, pEList)
- Xsqlite3ExprAnalyzeAggList(tls, bp+136 /* &sNC */, (*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy)
+ Xsqlite3ExprAnalyzeAggList(tls, bp+184 /* &sNC */, pEList)
+ Xsqlite3ExprAnalyzeAggList(tls, bp+184 /* &sNC */, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy)
if !(pHaving != 0) {
- goto __72
+ goto __77
}
if !(pGroupBy != 0) {
- goto __73
+ goto __78
}
havingToWhere(tls, pParse, p)
pWhere = (*Select)(unsafe.Pointer(p)).FpWhere
-__73:
+__78:
;
- Xsqlite3ExprAnalyzeAggregates(tls, bp+136 /* &sNC */, pHaving)
-__72:
+ Xsqlite3ExprAnalyzeAggregates(tls, bp+184 /* &sNC */, pHaving)
+__77:
;
(*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator = (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn
if !((((*Select)(unsafe.Pointer(p)).FpGroupBy == uintptr(0)) && ((*Select)(unsafe.Pointer(p)).FpHaving == uintptr(0))) && ((*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == 1)) {
- goto __74
+ goto __79
}
- minMaxFlag = minMaxQuery(tls, db, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(0)*24)).FpExpr, bp+192 /* &pMinMaxOrderBy */)
- goto __75
-__74:
+ minMaxFlag = minMaxQuery(tls, db, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(0)*24)).FpFExpr, bp+240 /* &pMinMaxOrderBy */)
+ goto __80
+__79:
minMaxFlag = U8(0x0000)
-__75:
+__80:
;
i = 0
-__76:
+__81:
if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) {
- goto __78
+ goto __83
}
- pExpr = (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpExpr
+ pExpr = (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr
- *(*int32)(unsafe.Pointer(bp + 136 /* &sNC */ + 40 /* &.ncFlags */)) |= (0x20000)
- Xsqlite3ExprAnalyzeAggList(tls, bp+136 /* &sNC */, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))
+ *(*int32)(unsafe.Pointer(bp + 184 /* &sNC */ + 40 /* &.ncFlags */)) |= (0x20000)
+ Xsqlite3ExprAnalyzeAggList(tls, bp+184 /* &sNC */, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)))
if !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x1000000))) != U32(0)) {
- goto __79
+ goto __84
}
- Xsqlite3ExprAnalyzeAggregates(tls, bp+136 /* &sNC */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter)
-__79:
+ Xsqlite3ExprAnalyzeAggregates(tls, bp+184 /* &sNC */, (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)))).FpFilter)
+__84:
;
- *(*int32)(unsafe.Pointer(bp + 136 /* &sNC */ + 40 /* &.ncFlags */)) &= (^int32(crt.Int32FromInt32(0x20000)))
- goto __77
-__77:
+ *(*int32)(unsafe.Pointer(bp + 184 /* &sNC */ + 40 /* &.ncFlags */)) &= (^int32(libc.Int32FromInt32(0x20000)))
+ goto __82
+__82:
i++
- goto __76
- goto __78
-__78:
+ goto __81
+ goto __83
+__83:
;
(*AggInfo)(unsafe.Pointer(pAggInfo)).FmxReg = (*Parse)(unsafe.Pointer(pParse)).FnMem
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __80
+ goto __85
}
goto select_end
-__80:
+__85:
;
// Processing for aggregates with GROUP BY is very different and
// much more complex than aggregates without a GROUP BY.
if !(pGroupBy != 0) {
- goto __81
+ goto __86
} // Return address register for reset subroutine
// If there is a GROUP BY clause we might need a sorting index to
// implement it. Allocate that sorting index now. If it turns out
// that we do not need it after all, the OP_SorterOpen instruction
// will be converted into a Noop.
- (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
pKeyInfo1 = Xsqlite3KeyInfoFromExprList(tls, pParse, pGroupBy,
0, (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn)
addrSortingIdx = Xsqlite3VdbeAddOp4(tls, v, 111,
@@ -111417,18 +115299,18 @@ __80:
0, pKeyInfo1, -9)
// Initialize memory locations used by GROUP BY aggregate processing
- iUseFlag = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- iAbortFlag = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- regOutputRow = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iUseFlag = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iAbortFlag = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regOutputRow = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
addrOutputRow = Xsqlite3VdbeMakeLabel(tls, pParse)
- regReset = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regReset = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
addrReset = Xsqlite3VdbeMakeLabel(tls, pParse)
iAMem = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += ((*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr)
iBMem = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += ((*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr)
Xsqlite3VdbeAddOp2(tls, v, 69, 0, iAbortFlag)
-
+ Xsqlite3VdbeComment(tls, v, ts+21039 /* "clear abort flag" */, 0)
Xsqlite3VdbeAddOp3(tls, v, 72, 0, iAMem, ((iAMem + (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) - 1))
// Begin a loop that will extract all source rows in GROUP BY order.
@@ -111445,27 +115327,27 @@ __80:
return 0
}()))), 0)
if !(pWInfo == uintptr(0)) {
- goto __83
+ goto __88
}
goto select_end
-__83:
+__88:
;
if !(Xsqlite3WhereIsOrdered(tls, pWInfo) == (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) {
- goto __84
+ goto __89
}
// The optimizer is able to deliver rows in group by order so
// we do not have to sort. The OP_OpenEphemeral table will be
// cancelled later because we still need to use the pKeyInfo
groupBySort = 0
- goto __85
-__84:
+ goto __90
+__89:
explainTempTable(tls, pParse,
func() uintptr {
- if ((*DistinctCtx)(unsafe.Pointer(bp+120 /* &sDistinct */)).FisTnct != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0000001)) == U32(0)) {
- return ts + 17686 /* "DISTINCT" */
+ if ((*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FisTnct != 0) && (((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0000001)) == U32(0)) {
+ return ts + 21056 /* "DISTINCT" */
}
- return ts + 17695 /* "GROUP BY" */
+ return ts + 21065 /* "GROUP BY" */
}())
groupBySort = 1
@@ -111473,48 +115355,48 @@ __84:
nCol = nGroupBy
j = nGroupBy
i = 0
-__86:
+__91:
if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) {
- goto __88
+ goto __93
}
if !(int32((*AggInfo_col)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol+uintptr(i)*32)).FiSorterColumn) >= j) {
- goto __89
+ goto __94
}
nCol++
j++
-__89:
+__94:
;
- goto __87
-__87:
+ goto __92
+__92:
i++
- goto __86
- goto __88
-__88:
+ goto __91
+ goto __93
+__93:
;
regBase = Xsqlite3GetTempRange(tls, pParse, nCol)
Xsqlite3ExprCodeExprList(tls, pParse, pGroupBy, regBase, 0, uint8(0))
j = nGroupBy
i = 0
-__90:
+__95:
if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) {
- goto __92
+ goto __97
}
pCol = ((*AggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32)
if !(int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j) {
- goto __93
+ goto __98
}
r1 = (j + regBase)
Xsqlite3ExprCodeGetColumnOfTable(tls, v,
(*AggInfo_col)(unsafe.Pointer(pCol)).FpTab, (*AggInfo_col)(unsafe.Pointer(pCol)).FiTable, int32((*AggInfo_col)(unsafe.Pointer(pCol)).FiColumn), r1)
j++
-__93:
+__98:
;
- goto __91
-__91:
+ goto __96
+__96:
i++
- goto __90
- goto __92
-__92:
+ goto __95
+ goto __97
+__97:
;
regRecord = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3VdbeAddOp3(tls, v, 91, regBase, nCol, regRecord)
@@ -111522,13 +115404,13 @@ __92:
Xsqlite3ReleaseTempReg(tls, pParse, regRecord)
Xsqlite3ReleaseTempRange(tls, pParse, regBase, nCol)
Xsqlite3WhereEnd(tls, pWInfo)
- (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = crt.AssignInt32(&sortPTab, crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1))
+ (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = libc.AssignInt32(&sortPTab, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1))
sortOut = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3VdbeAddOp3(tls, v, 114, sortPTab, sortOut, nCol)
Xsqlite3VdbeAddOp2(tls, v, 35, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd)
-
+ Xsqlite3VdbeComment(tls, v, ts+21074 /* "GROUP BY sort" */, 0)
(*AggInfo)(unsafe.Pointer(pAggInfo)).FuseSortingIdx = U8(1)
-__85:
+__90:
;
// If the index or temporary table used by the GROUP BY sort
@@ -111540,11 +115422,11 @@ __85:
// disable this optimization for testing purposes.
if !(((orderByGrp != 0) && ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x0004)) == 0)) &&
((groupBySort != 0) || (Xsqlite3WhereIsSorted(tls, pWInfo) != 0))) {
- goto __94
+ goto __99
}
- (*SortCtx)(unsafe.Pointer(bp + 40 /* &sSort */)).FpOrderBy = uintptr(0)
- Xsqlite3VdbeChangeToNoop(tls, v, (*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FaddrSortIndex)
-__94:
+ (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FpOrderBy = uintptr(0)
+ Xsqlite3VdbeChangeToNoop(tls, v, (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FaddrSortIndex)
+__99:
;
// Evaluate the current GROUP BY terms and store in b0, b1, b2...
@@ -111553,33 +115435,33 @@ __94:
// from the previous row currently stored in a0, a1, a2...
addrTopOfLoop = Xsqlite3VdbeCurrentAddr(tls, v)
if !(groupBySort != 0) {
- goto __95
+ goto __100
}
Xsqlite3VdbeAddOp3(tls, v, 125, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx,
sortOut, sortPTab)
-__95:
+__100:
;
j = 0
-__96:
+__101:
if !(j < (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr) {
- goto __98
+ goto __103
}
if !(groupBySort != 0) {
- goto __99
+ goto __104
}
Xsqlite3VdbeAddOp3(tls, v, 89, sortPTab, j, (iBMem + j))
- goto __100
-__99:
+ goto __105
+__104:
(*AggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = U8(1)
Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pGroupBy+8 /* &.a */)+uintptr(j)*32)).FpExpr, (iBMem + j))
-__100:
+__105:
;
- goto __97
-__97:
+ goto __102
+__102:
j++
- goto __96
- goto __98
-__98:
+ goto __101
+ goto __103
+__103:
;
Xsqlite3VdbeAddOp4(tls, v, 86, iAMem, iBMem, (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr,
Xsqlite3KeyInfoRef(tls, pKeyInfo1), -9)
@@ -111596,31 +115478,34 @@ __98:
// for the next GROUP BY batch.
Xsqlite3ExprCodeMove(tls, pParse, iBMem, iAMem, (*ExprList)(unsafe.Pointer(pGroupBy)).FnExpr)
Xsqlite3VdbeAddOp2(tls, v, 12, regOutputRow, addrOutputRow)
-
+ Xsqlite3VdbeComment(tls, v, ts+21088 /* "output one row" */, 0)
Xsqlite3VdbeAddOp2(tls, v, 48, iAbortFlag, addrEnd)
-
+ Xsqlite3VdbeComment(tls, v, ts+21103 /* "check abort flag" */, 0)
Xsqlite3VdbeAddOp2(tls, v, 12, regReset, addrReset)
+ Xsqlite3VdbeComment(tls, v, ts+21120 /* "reset accumulato..." */, 0)
// Update the aggregate accumulators based on the content of
// the current row
Xsqlite3VdbeJumpHere(tls, v, addr1)
updateAccumulator(tls, pParse, iUseFlag, pAggInfo)
Xsqlite3VdbeAddOp2(tls, v, 69, 1, iUseFlag)
+ Xsqlite3VdbeComment(tls, v, ts+21138 /* "indicate data in..." */, 0)
// End of the loop
if !(groupBySort != 0) {
- goto __101
+ goto __106
}
Xsqlite3VdbeAddOp2(tls, v, 3, (*AggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrTopOfLoop)
- goto __102
-__101:
+ goto __107
+__106:
Xsqlite3WhereEnd(tls, pWInfo)
Xsqlite3VdbeChangeToNoop(tls, v, addrSortingIdx)
-__102:
+__107:
;
// Output the final row of result
Xsqlite3VdbeAddOp2(tls, v, 12, regOutputRow, addrOutputRow)
+ Xsqlite3VdbeComment(tls, v, ts+21167 /* "output final row" */, 0)
// Jump over the subroutines
Xsqlite3VdbeGoto(tls, v, addrEnd)
@@ -111633,30 +115518,32 @@ __102:
// order to signal the caller to abort.
addrSetAbort = Xsqlite3VdbeCurrentAddr(tls, v)
Xsqlite3VdbeAddOp2(tls, v, 69, 1, iAbortFlag)
-
+ Xsqlite3VdbeComment(tls, v, ts+21184 /* "set abort flag" */, 0)
Xsqlite3VdbeAddOp1(tls, v, 65, regOutputRow)
Xsqlite3VdbeResolveLabel(tls, v, addrOutputRow)
addrOutputRow = Xsqlite3VdbeCurrentAddr(tls, v)
Xsqlite3VdbeAddOp2(tls, v, 48, iUseFlag, (addrOutputRow + 2))
+ Xsqlite3VdbeComment(tls, v, ts+21199 /* "Groupby result g..." */, 0)
Xsqlite3VdbeAddOp1(tls, v, 65, regOutputRow)
finalizeAggFunctions(tls, pParse, pAggInfo)
Xsqlite3ExprIfFalse(tls, pParse, pHaving, (addrOutputRow + 1), 0x10)
- selectInnerLoop(tls, pParse, p, -1, bp+40, /* &sSort */
- bp+120 /* &sDistinct */, pDest,
+ selectInnerLoop(tls, pParse, p, -1, bp+80, /* &sSort */
+ bp+168 /* &sDistinct */, pDest,
(addrOutputRow + 1), addrSetAbort)
Xsqlite3VdbeAddOp1(tls, v, 65, regOutputRow)
+ Xsqlite3VdbeComment(tls, v, ts+21236 /* "end groupby resu..." */, 0)
// Generate a subroutine that will reset the group-by accumulator
Xsqlite3VdbeResolveLabel(tls, v, addrReset)
resetAccumulator(tls, pParse, pAggInfo)
Xsqlite3VdbeAddOp2(tls, v, 69, 0, iUseFlag)
-
+ Xsqlite3VdbeComment(tls, v, ts+21265 /* "indicate accumul..." */, 0)
Xsqlite3VdbeAddOp1(tls, v, 65, regReset)
- goto __82
-__81:
- if !((crt.AssignUintptr(&pTab1, isSimpleCount(tls, p, pAggInfo))) != uintptr(0)) {
- goto __103
+ goto __87
+__86:
+ if !((libc.AssignUintptr(&pTab1, isSimpleCount(tls, p, pAggInfo))) != uintptr(0)) {
+ goto __108
}
// If isSimpleCount() returns a pointer to a Table structure, then
// the SQL statement is of the form:
@@ -111671,10 +115558,10 @@ __81:
// is better to execute the op on an index, as indexes are almost
// always spread across less pages than their corresponding tables.
iDb = Xsqlite3SchemaToIndex(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Table)(unsafe.Pointer(pTab1)).FpSchema)
- iCsr = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) // Iterator variable
- pKeyInfo2 = uintptr(0) // Keyinfo for scanned index
- pBest = uintptr(0) // Best index found so far
- iRoot = (*Table)(unsafe.Pointer(pTab1)).Ftnum // Root page of scanned b-tree
+ iCsr = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) // Iterator variable
+ pKeyInfo2 = uintptr(0) // Keyinfo for scanned index
+ pBest = uintptr(0) // Best index found so far
+ iRoot = (*Table)(unsafe.Pointer(pTab1)).Ftnum // Root page of scanned b-tree
Xsqlite3CodeVerifySchema(tls, pParse, iDb)
Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab1)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab1)).FzName)
@@ -111688,59 +115575,59 @@ __81:
// In practice the KeyInfo structure will not be used. It is only
// passed to keep OP_OpenRead happy.
if !(!(((*Table)(unsafe.Pointer((pTab1))).FtabFlags & U32(0x0080)) == U32(0))) {
- goto __105
+ goto __110
}
pBest = Xsqlite3PrimaryKeyIndex(tls, pTab1)
-__105:
+__110:
;
if !(!(int32(*(*uint8)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(0)*112 + 60 /* &.fg */ + 4 /* &.notIndexed */))&0x1>>0) != 0)) {
- goto __106
+ goto __111
}
pIdx = (*Table)(unsafe.Pointer(pTab1)).FpIndex
-__107:
+__112:
if !(pIdx != 0) {
- goto __109
+ goto __114
}
if !((((int32(*(*uint16)(unsafe.Pointer(pIdx + 100 /* &.bUnordered */))&0x4>>2) == 0) &&
(int32((*Index)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*Table)(unsafe.Pointer(pTab1)).FszTabRow))) &&
((*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0))) &&
(!(pBest != 0) || (int32((*Index)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*Index)(unsafe.Pointer(pBest)).FszIdxRow)))) {
- goto __110
+ goto __115
}
pBest = pIdx
-__110:
+__115:
;
- goto __108
-__108:
+ goto __113
+__113:
pIdx = (*Index)(unsafe.Pointer(pIdx)).FpNext
- goto __107
- goto __109
-__109:
+ goto __112
+ goto __114
+__114:
;
-__106:
+__111:
;
if !(pBest != 0) {
- goto __111
+ goto __116
}
iRoot = (*Index)(unsafe.Pointer(pBest)).Ftnum
pKeyInfo2 = Xsqlite3KeyInfoOfIndex(tls, pParse, pBest)
-__111:
+__116:
;
// Open a read-only cursor, execute the OP_Count, close the cursor.
- Xsqlite3VdbeAddOp4Int(tls, v, 96, iCsr, iRoot, iDb, 1)
+ Xsqlite3VdbeAddOp4Int(tls, v, 96, iCsr, int32(iRoot), iDb, 1)
if !(pKeyInfo2 != 0) {
- goto __112
+ goto __117
}
Xsqlite3VdbeChangeP4(tls, v, -1, pKeyInfo2, -9)
-__112:
+__117:
;
Xsqlite3VdbeAddOp2(tls, v, 92, iCsr, (*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(0)*24)).FiMem)
Xsqlite3VdbeAddOp1(tls, v, 116, iCsr)
explainSimpleCount(tls, pParse, pTab1, pBest)
- goto __104
-__103:
- regAcc = 0 // "populate accumulators" flag
+ goto __109
+__108:
+ regAcc = 0
// If there are accumulator registers but no min() or max() functions
// without FILTER clauses, allocate register regAcc. Register regAcc
@@ -111752,40 +115639,40 @@ __103:
// least once even if the FILTER clause means the min() or max()
// function visits zero rows.
if !((*AggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0) {
- goto __113
+ goto __118
}
i = 0
-__114:
+__119:
if !(i < (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) {
- goto __116
+ goto __121
}
- if !(((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpExpr))).Fflags & (U32(0x1000000))) != U32(0)) {
- goto __117
+ if !(((*Expr)(unsafe.Pointer(((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24)).FpFExpr))).Fflags & (U32(0x1000000))) != U32(0)) {
+ goto __122
}
- goto __115
-__117:
+ goto __120
+__122:
;
if !(((*FuncDef)(unsafe.Pointer((*AggInfo_func)(unsafe.Pointer((*AggInfo)(unsafe.Pointer(pAggInfo)).FaFunc+uintptr(i)*24)).FpFunc)).FfuncFlags & U32(0x0020)) != 0) {
- goto __118
+ goto __123
}
- goto __116
-__118:
+ goto __121
+__123:
;
- goto __115
-__115:
+ goto __120
+__120:
i++
- goto __114
- goto __116
-__116:
+ goto __119
+ goto __121
+__121:
;
if !(i == (*AggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) {
- goto __119
+ goto __124
}
- regAcc = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regAcc = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 69, 0, regAcc)
-__119:
+__124:
;
-__113:
+__118:
;
// This case runs if the aggregate has no GROUP BY clause. The
@@ -111799,64 +115686,65 @@ __113:
// WHERE_ORDERBY_MIN or WHERE_ORDERBY_MAX and pMinMaxOrderBy will
// be an appropriate ORDER BY expression for the optimization.
- pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, *(*uintptr)(unsafe.Pointer(bp + 192 /* pMinMaxOrderBy */)),
+ pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, *(*uintptr)(unsafe.Pointer(bp + 240 /* pMinMaxOrderBy */)),
uintptr(0), uint16(minMaxFlag), 0)
if !(pWInfo == uintptr(0)) {
- goto __120
+ goto __125
}
goto select_end
-__120:
+__125:
;
updateAccumulator(tls, pParse, regAcc, pAggInfo)
if !(regAcc != 0) {
- goto __121
+ goto __126
}
Xsqlite3VdbeAddOp2(tls, v, 69, 1, regAcc)
-__121:
+__126:
;
- if !(Xsqlite3WhereIsOrdered(tls, pWInfo) > 0) {
- goto __122
+ addrSkip = Xsqlite3WhereOrderByLimitOptLabel(tls, pWInfo)
+ if !(addrSkip != Xsqlite3WhereContinueLabel(tls, pWInfo)) {
+ goto __127
}
- Xsqlite3VdbeGoto(tls, v, Xsqlite3WhereBreakLabel(tls, pWInfo))
-__122:
+ Xsqlite3VdbeGoto(tls, v, addrSkip)
+__127:
;
Xsqlite3WhereEnd(tls, pWInfo)
finalizeAggFunctions(tls, pParse, pAggInfo)
-__104:
+__109:
;
- (*SortCtx)(unsafe.Pointer(bp + 40 /* &sSort */)).FpOrderBy = uintptr(0)
+ (*SortCtx)(unsafe.Pointer(bp + 80 /* &sSort */)).FpOrderBy = uintptr(0)
Xsqlite3ExprIfFalse(tls, pParse, pHaving, addrEnd, 0x10)
selectInnerLoop(tls, pParse, p, -1, uintptr(0), uintptr(0),
pDest, addrEnd, addrEnd)
-__82:
+__87:
;
Xsqlite3VdbeResolveLabel(tls, v, addrEnd)
-__47:
+__52:
; // endif aggregate query
- if !(int32((*DistinctCtx)(unsafe.Pointer(bp+120 /* &sDistinct */)).FeTnctType) == 3) {
- goto __123
+ if !(int32((*DistinctCtx)(unsafe.Pointer(bp+168 /* &sDistinct */)).FeTnctType) == 3) {
+ goto __128
}
- explainTempTable(tls, pParse, ts+17686 /* "DISTINCT" */)
-__123:
+ explainTempTable(tls, pParse, ts+21056 /* "DISTINCT" */)
+__128:
;
// If there is an ORDER BY clause, then we need to sort the results
// and send them to the callback one by one.
- if !((*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FpOrderBy != 0) {
- goto __124
+ if !((*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FpOrderBy != 0) {
+ goto __129
}
explainTempTable(tls, pParse,
func() uintptr {
- if (*SortCtx)(unsafe.Pointer(bp+40 /* &sSort */)).FnOBSat > 0 {
- return ts + 17704 /* "RIGHT PART OF OR..." */
+ if (*SortCtx)(unsafe.Pointer(bp+80 /* &sSort */)).FnOBSat > 0 {
+ return ts + 21292 /* "RIGHT PART OF OR..." */
}
- return ts + 16893 /* "ORDER BY" */
+ return ts + 19937 /* "ORDER BY" */
}())
- generateSortTail(tls, pParse, p, bp+40 /* &sSort */, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, pDest)
-__124:
+ generateSortTail(tls, pParse, p, bp+80 /* &sSort */, (*ExprList)(unsafe.Pointer(pEList)).FnExpr, pDest)
+__129:
;
// Jump here to skip this query
@@ -111864,12 +115752,12 @@ __124:
// The SELECT has been coded. If there is an error in the Parse structure,
// set the return code to 1. Otherwise 0.
- rc = (crt.Bool32((*Parse)(unsafe.Pointer(pParse)).FnErr > 0))
+ rc = (libc.Bool32((*Parse)(unsafe.Pointer(pParse)).FnErr > 0))
// Control jumps to here if an error is encountered above, or upon
// successful coding of the SELECT.
select_end:
- Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp + 192 /* pMinMaxOrderBy */)))
+ Xsqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp + 240 /* pMinMaxOrderBy */)))
Xsqlite3VdbeExplainPop(tls, pParse)
return rc
@@ -111930,12 +115818,12 @@ type TabResult1 = struct {
// This structure is used to pass data from sqlite3_get_table() through
// to the callback function is uses to build the result.
-type TabResult = TabResult1 /* sqlite3.c:135842:3 */
+type TabResult = TabResult1 /* sqlite3.c:136224:3 */
// This routine is called once for each row in the result table. Its job
// is to fill in the TabResult structure appropriately, allocating new
// memory as necessary.
-func sqlite3_get_table_cb(tls *crt.TLS, pArg uintptr, nCol int32, argv uintptr, colv uintptr) int32 { /* sqlite3.c:135849:12: */
+func sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr, colv uintptr) int32 { /* sqlite3.c:136231:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -111984,14 +115872,14 @@ __7:
if !(i < nCol) {
goto __9
}
- z = Xsqlite3_mprintf(tls, ts+696 /* "%s" */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8))))
+ z = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8))))
if !(z == uintptr(0)) {
goto __10
}
goto malloc_failed
__10:
;
- *(*uintptr)(unsafe.Pointer((*TabResult)(unsafe.Pointer(p)).FazResult + uintptr(crt.PostIncUint32(&(*TabResult)(unsafe.Pointer(p)).FnData, 1))*8)) = z
+ *(*uintptr)(unsafe.Pointer((*TabResult)(unsafe.Pointer(p)).FazResult + uintptr(libc.PostIncUint32(&(*TabResult)(unsafe.Pointer(p)).FnData, 1))*8)) = z
goto __8
__8:
i++
@@ -112006,7 +115894,7 @@ __5:
}
Xsqlite3_free(tls, (*TabResult)(unsafe.Pointer(p)).FzErrMsg)
(*TabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls,
- ts+17727 /* "sqlite3_get_tabl..." */, 0)
+ ts+21315 /* "sqlite3_get_tabl..." */, 0)
(*TabResult)(unsafe.Pointer(p)).Frc = 1
return 1
__11:
@@ -112037,10 +115925,10 @@ __16:
goto malloc_failed
__18:
;
- crt.Xmemcpy(tls, z, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), uint64(n))
+ libc.Xmemcpy(tls, z, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), uint64(n))
__17:
;
- *(*uintptr)(unsafe.Pointer((*TabResult)(unsafe.Pointer(p)).FazResult + uintptr(crt.PostIncUint32(&(*TabResult)(unsafe.Pointer(p)).FnData, 1))*8)) = z
+ *(*uintptr)(unsafe.Pointer((*TabResult)(unsafe.Pointer(p)).FazResult + uintptr(libc.PostIncUint32(&(*TabResult)(unsafe.Pointer(p)).FnData, 1))*8)) = z
goto __14
__14:
i++
@@ -112066,7 +115954,7 @@ malloc_failed:
// from malloc(). But the caller cannot free this memory directly.
// Instead, the entire table should be passed to sqlite3_free_table() when
// the calling procedure is finished using it.
-func Xsqlite3_get_table(tls *crt.TLS, db uintptr, zSql uintptr, pazResult uintptr, pnRow uintptr, pnColumn uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:135923:16: */
+func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintptr, pnRow uintptr, pnColumn uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:136305:16: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -112096,7 +115984,7 @@ func Xsqlite3_get_table(tls *crt.TLS, db uintptr, zSql uintptr, pazResult uintpt
}
*(*uintptr)(unsafe.Pointer((*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FazResult + uintptr(0)*8)) = uintptr(0)
rc = Xsqlite3_exec(tls, db, zSql, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{sqlite3_get_table_cb})), bp+8 /* &res */, pzErrMsg)
*(*uintptr)(unsafe.Pointer((*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FazResult + uintptr(0)*8)) = uintptr(int64((*TabResult)(unsafe.Pointer(bp + 8 /* &res */)).FnData))
@@ -112105,7 +115993,7 @@ func Xsqlite3_get_table(tls *crt.TLS, db uintptr, zSql uintptr, pazResult uintpt
if (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg != 0 {
if pzErrMsg != 0 {
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg)))
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+696 /* "%s" */, crt.VaList(bp, (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp, (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg))
}
Xsqlite3_free(tls, (*TabResult)(unsafe.Pointer(bp+8 /* &res */)).FzErrMsg)
}
@@ -112138,7 +116026,7 @@ func Xsqlite3_get_table(tls *crt.TLS, db uintptr, zSql uintptr, pazResult uintpt
}
// This routine frees the space the sqlite3_get_table() malloced.
-func Xsqlite3_free_table(tls *crt.TLS, azResult uintptr) { /* sqlite3.c:135992:17: */
+func Xsqlite3_free_table(tls *libc.TLS, azResult uintptr) { /* sqlite3.c:136374:17: */
if azResult != 0 {
var i int32
var n int32
@@ -112169,7 +116057,7 @@ func Xsqlite3_free_table(tls *crt.TLS, azResult uintptr) { /* sqlite3.c:135992:1
// #include "sqliteInt.h"
// Delete a linked list of TriggerStep structures.
-func Xsqlite3DeleteTriggerStep(tls *crt.TLS, db uintptr, pTriggerStep uintptr) { /* sqlite3.c:136027:21: */
+func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr) { /* sqlite3.c:136409:21: */
for pTriggerStep != 0 {
var pTmp uintptr = pTriggerStep
pTriggerStep = (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpNext
@@ -112179,6 +116067,7 @@ func Xsqlite3DeleteTriggerStep(tls *crt.TLS, db uintptr, pTriggerStep uintptr) {
Xsqlite3SelectDelete(tls, db, (*TriggerStep)(unsafe.Pointer(pTmp)).FpSelect)
Xsqlite3IdListDelete(tls, db, (*TriggerStep)(unsafe.Pointer(pTmp)).FpIdList)
Xsqlite3UpsertDelete(tls, db, (*TriggerStep)(unsafe.Pointer(pTmp)).FpUpsert)
+ Xsqlite3SrcListDelete(tls, db, (*TriggerStep)(unsafe.Pointer(pTmp)).FpFrom)
Xsqlite3DbFree(tls, db, (*TriggerStep)(unsafe.Pointer(pTmp)).FzSpan)
Xsqlite3DbFree(tls, db, pTmp)
@@ -112197,7 +116086,7 @@ func Xsqlite3DeleteTriggerStep(tls *crt.TLS, db uintptr, pTriggerStep uintptr) {
// To state it another way: This routine returns a list of all triggers
// that fire off of pTab. The list will include any TEMP triggers on
// pTab as well as the triggers lised in pTab->pTrigger.
-func Xsqlite3TriggerList(tls *crt.TLS, pParse uintptr, pTab uintptr) uintptr { /* sqlite3.c:136057:24: */
+func Xsqlite3TriggerList(tls *libc.TLS, pParse uintptr, pTab uintptr) uintptr { /* sqlite3.c:136440:24: */
var pTmpSchema uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(1)*32)).FpSchema
var pList uintptr = uintptr(0) // List of triggers to return
@@ -112237,7 +116126,7 @@ func Xsqlite3TriggerList(tls *crt.TLS, pParse uintptr, pTab uintptr) uintptr { /
// in pParse->pNewTrigger. After the trigger actions have been parsed, the
// sqlite3FinishTrigger() function is called to complete the trigger
// construction process.
-func Xsqlite3BeginTrigger(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, tr_tm int32, op int32, pColumns uintptr, pTableName uintptr, pWhen uintptr, isTemp int32, noErr int32) { /* sqlite3.c:136090:21: */
+func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, tr_tm int32, op int32, pColumns uintptr, pTableName uintptr, pWhen uintptr, isTemp int32, noErr int32) { /* sqlite3.c:136473:21: */
bp := tls.Alloc(104)
defer tls.Free(104)
@@ -112267,7 +116156,7 @@ func Xsqlite3BeginTrigger(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 u
if !((*Token)(unsafe.Pointer(pName2)).Fn > uint32(0)) {
goto __3
}
- Xsqlite3ErrorMsg(tls, pParse, ts+17792 /* "temporary trigge..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+21380 /* "temporary trigge..." */, 0)
goto trigger_cleanup
__3:
;
@@ -112298,7 +116187,7 @@ __5:
// ^^^^^^^^
//
// To maintain backwards compatibility, ignore the database
- // name on pTableName if we are reparsing out of SQLITE_MASTER.
+ // name on pTableName if we are reparsing out of the schema table
if !(((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy != 0) && (iDb != 1)) {
goto __6
}
@@ -112328,7 +116217,7 @@ __7:
__8:
;
- Xsqlite3FixInit(tls, bp+56 /* &sFix */, pParse, iDb, ts+17838 /* "trigger" */, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */)))
+ Xsqlite3FixInit(tls, bp+56 /* &sFix */, pParse, iDb, ts+21426 /* "trigger" */, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */)))
if !(Xsqlite3FixSrcList(tls, bp+56 /* &sFix */, pTableName) != 0) {
goto __9
}
@@ -112350,7 +116239,7 @@ __9:
// trigger is not visible to the database connection that does the
// drop so the trigger cannot be dropped. This results in an
// "orphaned trigger" - a trigger whose associated table is missing.
- crt.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.orphanTrigger */, uint32(1), 0, 0x1)
+ libc.SetBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.orphanTrigger */, uint32(1), 0, 0x1)
__11:
;
goto trigger_cleanup
@@ -112359,7 +116248,7 @@ __10:
if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
goto __12
}
- Xsqlite3ErrorMsg(tls, pParse, ts+17846 /* "cannot create tr..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+21434 /* "cannot create tr..." */, 0)
goto trigger_cleanup
__12:
;
@@ -112374,7 +116263,7 @@ __12:
goto trigger_cleanup
__13:
;
- if !(Xsqlite3CheckObjectName(tls, pParse, zName, ts+17838 /* "trigger" */, (*Table)(unsafe.Pointer(pTab)).FzName) != 0) {
+ if !(Xsqlite3CheckObjectName(tls, pParse, zName, ts+21426 /* "trigger" */, (*Table)(unsafe.Pointer(pTab)).FzName) != 0) {
goto __14
}
goto trigger_cleanup
@@ -112390,7 +116279,7 @@ __14:
if !(!(noErr != 0)) {
goto __17
}
- Xsqlite3ErrorMsg(tls, pParse, ts+17887 /* "trigger %T alrea..." */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+21475 /* "trigger %T alrea..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 48 /* pName */))))
goto __18
__17:
;
@@ -112404,10 +116293,10 @@ __15:
;
// Do not create a trigger on a system table
- if !(Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+7691 /* "sqlite_" */, 7) == 0) {
+ if !(Xsqlite3_strnicmp(tls, (*Table)(unsafe.Pointer(pTab)).FzName, ts+10109 /* "sqlite_" */, 7) == 0) {
goto __19
}
- Xsqlite3ErrorMsg(tls, pParse, ts+17913 /* "cannot create tr..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+21501 /* "cannot create tr..." */, 0)
goto trigger_cleanup
__19:
;
@@ -112417,12 +116306,12 @@ __19:
if !(((*Table)(unsafe.Pointer(pTab)).FpSelect != 0) && (tr_tm != 65)) {
goto __20
}
- Xsqlite3ErrorMsg(tls, pParse, ts+17951, /* "cannot create %s..." */
- crt.VaList(bp+8, func() uintptr {
+ Xsqlite3ErrorMsg(tls, pParse, ts+21539, /* "cannot create %s..." */
+ libc.VaList(bp+8, func() uintptr {
if tr_tm == 33 {
- return ts + 17988 /* "BEFORE" */
+ return ts + 21576 /* "BEFORE" */
}
- return ts + 17995 /* "AFTER" */
+ return ts + 21583 /* "AFTER" */
}(), pTableName, 0))
goto trigger_cleanup
__20:
@@ -112431,7 +116320,7 @@ __20:
goto __21
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+18001 /* "cannot create IN..." */, crt.VaList(bp+32, pTableName, 0))
+ ts+21589 /* "cannot create IN..." */, libc.VaList(bp+32, pTableName, 0))
goto trigger_cleanup
__21:
;
@@ -112461,9 +116350,9 @@ __24:
;
if !(Xsqlite3AuthCheck(tls, pParse, 18, func() uintptr {
if (!(0 != 0)) && (iTabDb == 1) {
- return ts + 10552 /* "sqlite_temp_mast..." */
+ return ts + 13282 /* "sqlite_temp_mast..." */
}
- return ts + 5324 /* "sqlite_master" */
+ return ts + 7522 /* "sqlite_master" */
}(), uintptr(0), zDb) != 0) {
goto __25
}
@@ -112537,17 +116426,17 @@ __31:
// This routine is called after all of the trigger actions have been parsed
// in order to complete the process of building the trigger.
-func Xsqlite3FinishTrigger(tls *crt.TLS, pParse uintptr, pStepList uintptr, pAll uintptr) { /* sqlite3.c:136291:21: */
- bp := tls.Alloc(112)
- defer tls.Free(112)
+func Xsqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAll uintptr) { /* sqlite3.c:136674:21: */
+ bp := tls.Alloc(104)
+ defer tls.Free(104)
var pTrig uintptr // Trigger being finished
var zName uintptr // Name of trigger
var db uintptr // The database
- // var sFix DbFixer at bp+64, 48
+ // var sFix DbFixer at bp+56, 48
// Fixer object
var iDb int32 // Database containing the trigger
- // var nameToken Token at bp+48, 16
+ // var nameToken Token at bp+40, 16
var v uintptr
var z uintptr
@@ -112576,10 +116465,10 @@ __2:
goto __2
__3:
;
- Xsqlite3TokenInit(tls, bp+48 /* &nameToken */, (*Trigger)(unsafe.Pointer(pTrig)).FzName)
- Xsqlite3FixInit(tls, bp+64 /* &sFix */, pParse, iDb, ts+17838 /* "trigger" */, bp+48 /* &nameToken */)
- if !((Xsqlite3FixTriggerStep(tls, bp+64 /* &sFix */, (*Trigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0) ||
- (Xsqlite3FixExpr(tls, bp+64 /* &sFix */, (*Trigger)(unsafe.Pointer(pTrig)).FpWhen) != 0)) {
+ Xsqlite3TokenInit(tls, bp+40 /* &nameToken */, (*Trigger)(unsafe.Pointer(pTrig)).FzName)
+ Xsqlite3FixInit(tls, bp+56 /* &sFix */, pParse, iDb, ts+21426 /* "trigger" */, bp+40 /* &nameToken */)
+ if !((Xsqlite3FixTriggerStep(tls, bp+56 /* &sFix */, (*Trigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0) ||
+ (Xsqlite3FixExpr(tls, bp+56 /* &sFix */, (*Trigger)(unsafe.Pointer(pTrig)).FpWhen) != 0)) {
goto __4
}
goto triggerfinish_cleanup
@@ -112596,12 +116485,12 @@ __4:
__5:
// if we are not initializing,
- // build the sqlite_master entry
+ // build the sqlite_schema entry
if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0)) {
goto __7
}
- // Make an entry in the sqlite_master table
+ // Make an entry in the sqlite_schema table
v = Xsqlite3GetVdbe(tls, pParse)
if !(v == uintptr(0)) {
goto __8
@@ -112613,13 +116502,14 @@ __8:
z = Xsqlite3DbStrNDup(tls, db, (*Token)(unsafe.Pointer(pAll)).Fz, uint64((*Token)(unsafe.Pointer(pAll)).Fn))
Xsqlite3NestedParse(tls, pParse,
- ts+18047, /* "INSERT INTO %Q.%..." */
- crt.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, ts+5324 /* "sqlite_master" */, zName,
+
+ ts+21635, /* "INSERT INTO %Q.s..." */
+ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, zName,
(*Trigger)(unsafe.Pointer(pTrig)).Ftable, z))
Xsqlite3DbFree(tls, db, z)
Xsqlite3ChangeCookie(tls, pParse, iDb)
Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb,
- Xsqlite3MPrintf(tls, db, ts+18111 /* "type='trigger' A..." */, crt.VaList(bp+40, zName)))
+ Xsqlite3MPrintf(tls, db, ts+21710 /* "type='trigger' A..." */, libc.VaList(bp+32, zName)))
__7:
;
__6:
@@ -112660,7 +116550,7 @@ triggerfinish_cleanup:
// Duplicate a range of text from an SQL statement, then convert all
// whitespace characters into ordinary space characters.
-func triggerSpanDup(tls *crt.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136378:13: */
+func triggerSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136762:13: */
var z uintptr = Xsqlite3DbSpanDup(tls, db, zStart, zEnd)
var i int32
if z != 0 {
@@ -112678,7 +116568,7 @@ func triggerSpanDup(tls *crt.TLS, db uintptr, zStart uintptr, zEnd uintptr) uint
//
// The parser calls this routine when it finds a SELECT statement in
// body of a TRIGGER.
-func Xsqlite3TriggerSelectStep(tls *crt.TLS, db uintptr, pSelect uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136392:28: */
+func Xsqlite3TriggerSelectStep(tls *libc.TLS, db uintptr, pSelect uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136776:28: */
var pTriggerStep uintptr = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(TriggerStep{})))
if pTriggerStep == uintptr(0) {
Xsqlite3SelectDelete(tls, db, pSelect)
@@ -112695,14 +116585,14 @@ func Xsqlite3TriggerSelectStep(tls *crt.TLS, db uintptr, pSelect uintptr, zStart
// holds both the TriggerStep object and the TriggerStep.target.z string.
//
// If an OOM error occurs, NULL is returned and db->mallocFailed is set.
-func triggerStepAllocate(tls *crt.TLS, pParse uintptr, op U8, pName uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136416:20: */
+func triggerStepAllocate(tls *libc.TLS, pParse uintptr, op U8, pName uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136800:20: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pTriggerStep uintptr
pTriggerStep = Xsqlite3DbMallocZero(tls, db, (uint64((uint64(unsafe.Sizeof(TriggerStep{})) + uint64((*Token)(unsafe.Pointer(pName)).Fn)) + uint64(1))))
if pTriggerStep != 0 {
- var z uintptr = (pTriggerStep + uintptr(1)*88)
- crt.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn))
+ var z uintptr = (pTriggerStep + uintptr(1)*96)
+ libc.Xmemcpy(tls, z, (*Token)(unsafe.Pointer(pName)).Fz, uint64((*Token)(unsafe.Pointer(pName)).Fn))
Xsqlite3Dequote(tls, z)
(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FzTarget = z
(*TriggerStep)(unsafe.Pointer(pTriggerStep)).Fop = op
@@ -112719,7 +116609,7 @@ func triggerStepAllocate(tls *crt.TLS, pParse uintptr, op U8, pName uintptr, zSt
//
// The parser calls this routine when it sees an INSERT inside the
// body of a trigger.
-func Xsqlite3TriggerInsertStep(tls *crt.TLS, pParse uintptr, pTableName uintptr, pColumn uintptr, pSelect uintptr, orconf U8, pUpsert uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136448:28: */
+func Xsqlite3TriggerInsertStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pColumn uintptr, pSelect uintptr, orconf U8, pUpsert uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136832:28: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pTriggerStep uintptr
@@ -112751,7 +116641,7 @@ func Xsqlite3TriggerInsertStep(tls *crt.TLS, pParse uintptr, pTableName uintptr,
// Construct a trigger step that implements an UPDATE statement and return
// a pointer to that trigger step. The parser calls this routine when it
// sees an UPDATE statement inside the body of a CREATE TRIGGER.
-func Xsqlite3TriggerUpdateStep(tls *crt.TLS, pParse uintptr, pTableName uintptr, pEList uintptr, pWhere uintptr, orconf U8, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136493:28: */
+func Xsqlite3TriggerUpdateStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pFrom uintptr, pEList uintptr, pWhere uintptr, orconf U8, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136877:28: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pTriggerStep uintptr
@@ -112760,23 +116650,27 @@ func Xsqlite3TriggerUpdateStep(tls *crt.TLS, pParse uintptr, pTableName uintptr,
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2 {
(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpExprList = pEList
(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = pWhere
+ (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpFrom = pFrom
pEList = uintptr(0)
pWhere = uintptr(0)
+ pFrom = uintptr(0)
} else {
(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpExprList = Xsqlite3ExprListDup(tls, db, pEList, 0x0001)
(*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpWhere = Xsqlite3ExprDup(tls, db, pWhere, 0x0001)
+ (*TriggerStep)(unsafe.Pointer(pTriggerStep)).FpFrom = Xsqlite3SrcListDup(tls, db, pFrom, 0x0001)
}
(*TriggerStep)(unsafe.Pointer(pTriggerStep)).Forconf = orconf
}
Xsqlite3ExprListDelete(tls, db, pEList)
Xsqlite3ExprDelete(tls, db, pWhere)
+ Xsqlite3SrcListDelete(tls, db, pFrom)
return pTriggerStep
}
// Construct a trigger step that implements a DELETE statement and return
// a pointer to that trigger step. The parser calls this routine when it
// sees a DELETE statement inside the body of a CREATE TRIGGER.
-func Xsqlite3TriggerDeleteStep(tls *crt.TLS, pParse uintptr, pTableName uintptr, pWhere uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136528:28: */
+func Xsqlite3TriggerDeleteStep(tls *libc.TLS, pParse uintptr, pTableName uintptr, pWhere uintptr, zStart uintptr, zEnd uintptr) uintptr { /* sqlite3.c:136917:28: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pTriggerStep uintptr
@@ -112795,7 +116689,7 @@ func Xsqlite3TriggerDeleteStep(tls *crt.TLS, pParse uintptr, pTableName uintptr,
}
// Recursively delete a Trigger structure
-func Xsqlite3DeleteTrigger(tls *crt.TLS, db uintptr, pTrigger uintptr) { /* sqlite3.c:136555:21: */
+func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr) { /* sqlite3.c:136944:21: */
if pTrigger == uintptr(0) {
return
}
@@ -112815,7 +116709,7 @@ func Xsqlite3DeleteTrigger(tls *crt.TLS, db uintptr, pTrigger uintptr) { /* sqli
// same job as this routine except it takes a pointer to the trigger
// instead of the trigger name.
//
-func Xsqlite3DropTrigger(tls *crt.TLS, pParse uintptr, pName uintptr, noErr int32) { /* sqlite3.c:136573:21: */
+func Xsqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int32) { /* sqlite3.c:136962:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -112881,7 +116775,7 @@ __5:
if !(!(noErr != 0)) {
goto __9
}
- Xsqlite3ErrorMsg(tls, pParse, ts+18140 /* "no such trigger:..." */, crt.VaList(bp, pName, 0))
+ Xsqlite3ErrorMsg(tls, pParse, ts+21739 /* "no such trigger:..." */, libc.VaList(bp, pName, 0))
goto __10
__9:
Xsqlite3CodeVerifyNamedSchema(tls, pParse, zDb)
@@ -112899,14 +116793,14 @@ drop_trigger_cleanup:
// Return a pointer to the Table structure for the table that a trigger
// is set on.
-func tableOfTrigger(tls *crt.TLS, pTrigger uintptr) uintptr { /* sqlite3.c:136615:14: */
+func tableOfTrigger(tls *libc.TLS, pTrigger uintptr) uintptr { /* sqlite3.c:137004:14: */
return Xsqlite3HashFind(tls, ((*Trigger)(unsafe.Pointer(pTrigger)).FpTabSchema + 8 /* &.tblHash */), (*Trigger)(unsafe.Pointer(pTrigger)).Ftable)
}
// Drop a trigger given a pointer to that trigger.
-func Xsqlite3DropTriggerPtr(tls *crt.TLS, pParse uintptr, pTrigger uintptr) { /* sqlite3.c:136623:21: */
- bp := tls.Alloc(24)
- defer tls.Free(24)
+func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { /* sqlite3.c:137012:21: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
var pTable uintptr
var v uintptr
@@ -112922,9 +116816,9 @@ func Xsqlite3DropTriggerPtr(tls *crt.TLS, pParse uintptr, pTrigger uintptr) { /*
var zDb uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
var zTab uintptr = func() uintptr {
if (!(0 != 0)) && (iDb == 1) {
- return ts + 10552 /* "sqlite_temp_mast..." */
+ return ts + 13282 /* "sqlite_temp_mast..." */
}
- return ts + 5324 /* "sqlite_master" */
+ return ts + 7522 /* "sqlite_master" */
}()
if iDb == 1 {
code = 14
@@ -112935,17 +116829,17 @@ func Xsqlite3DropTriggerPtr(tls *crt.TLS, pParse uintptr, pTrigger uintptr) { /*
}
// Generate code to destroy the database record of the trigger.
- if (crt.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse))) != uintptr(0) {
+ if (libc.AssignUintptr(&v, Xsqlite3GetVdbe(tls, pParse))) != uintptr(0) {
Xsqlite3NestedParse(tls, pParse,
- ts+18160, /* "DELETE FROM %Q.%..." */
- crt.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, ts+5324 /* "sqlite_master" */, (*Trigger)(unsafe.Pointer(pTrigger)).FzName))
+ ts+21759, /* "DELETE FROM %Q.s..." */
+ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, (*Trigger)(unsafe.Pointer(pTrigger)).FzName))
Xsqlite3ChangeCookie(tls, pParse, iDb)
Xsqlite3VdbeAddOp4(tls, v, 145, iDb, 0, 0, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, 0)
}
}
// Remove a trigger from the hash tables of the sqlite* pointer.
-func Xsqlite3UnlinkAndDeleteTrigger(tls *crt.TLS, db uintptr, iDb int32, zName uintptr) { /* sqlite3.c:136661:21: */
+func Xsqlite3UnlinkAndDeleteTrigger(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) { /* sqlite3.c:137050:21: */
var pTrigger uintptr
var pHash uintptr
@@ -112976,7 +116870,7 @@ func Xsqlite3UnlinkAndDeleteTrigger(tls *crt.TLS, db uintptr, iDb int32, zName u
// wildcard that matches anything. Likewise if pEList==NULL then
// it matches anything so always return true. Return false only
// if there is no match.
-func checkColumnOverlap(tls *crt.TLS, pIdList uintptr, pEList uintptr) int32 { /* sqlite3.c:136695:12: */
+func checkColumnOverlap(tls *libc.TLS, pIdList uintptr, pEList uintptr) int32 { /* sqlite3.c:137084:12: */
var e int32
if (pIdList == uintptr(0)) || (pEList == uintptr(0)) {
return 1
@@ -112993,7 +116887,7 @@ func checkColumnOverlap(tls *crt.TLS, pIdList uintptr, pEList uintptr) int32 { /
// one trigger that must be fired when an operation of type 'op' is
// performed on the table, and, if that operation is an UPDATE, if at
// least one of the columns in pChanges is being modified.
-func Xsqlite3TriggersExist(tls *crt.TLS, pParse uintptr, pTab uintptr, op int32, pChanges uintptr, pMask uintptr) uintptr { /* sqlite3.c:136710:24: */
+func Xsqlite3TriggersExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, pChanges uintptr, pMask uintptr) uintptr { /* sqlite3.c:137099:24: */
var mask int32 = 0
var pList uintptr = uintptr(0)
var p uintptr
@@ -113026,31 +116920,33 @@ func Xsqlite3TriggersExist(tls *crt.TLS, pParse uintptr, pTab uintptr, op int32,
// referring to a target in another database. An exception is when the
// trigger is in TEMP in which case it can refer to any other database it
// wants.
-func targetSrcList(tls *crt.TLS, pParse uintptr, pStep uintptr) uintptr { /* sqlite3.c:136746:16: */
+func Xsqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) uintptr { /* sqlite3.c:137135:24: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
- var iDb int32 // Index of the database to use
var pSrc uintptr // SrcList to be returned
-
+ var zName uintptr = Xsqlite3DbStrDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget)
pSrc = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0))
- if pSrc != 0 {
-
- (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(pSrc)).FnSrc-1))*112)).FzName = Xsqlite3DbStrDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FzTarget)
- iDb = Xsqlite3SchemaToIndex(tls, db, (*Trigger)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpTrig)).FpSchema)
- if (iDb == 0) || (iDb >= 2) {
- var zDb uintptr
- zDb = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FzDbSName
- (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(pSrc)).FnSrc-1))*112)).FzDatabase = Xsqlite3DbStrDup(tls, db, zDb)
+ if pSrc != 0 {
+ var pSchema uintptr = (*Trigger)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(pStep)).FpTrig)).FpSchema
+ (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(0)*112)).FzName = zName
+ if pSchema != (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(1)*32)).FpSchema {
+ (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(0)*112)).FpSchema = pSchema
+ }
+ if (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 {
+ var pDup uintptr = Xsqlite3SrcListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpFrom, 0)
+ pSrc = Xsqlite3SrcListAppendList(tls, pParse, pSrc, pDup)
}
+ } else {
+ Xsqlite3DbFree(tls, db, zName)
}
return pSrc
}
// Generate VDBE code for the statements inside the body of a single
// trigger.
-func codeTriggerProgram(tls *crt.TLS, pParse uintptr, pStepList uintptr, orconf int32) int32 { /* sqlite3.c:136773:12: */
- bp := tls.Alloc(40)
- defer tls.Free(40)
+func codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orconf int32) int32 { /* sqlite3.c:137165:12: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
var pStep uintptr
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
@@ -113078,7 +116974,7 @@ func codeTriggerProgram(tls *crt.TLS, pParse uintptr, pStepList uintptr, orconf
if (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 {
Xsqlite3VdbeAddOp4(tls, v, 170, 0x7fffffff, 1, 0,
- Xsqlite3MPrintf(tls, db, ts+5511 /* "-- %s" */, crt.VaList(bp, (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan)),
+ Xsqlite3MPrintf(tls, db, ts+7709 /* "-- %s" */, libc.VaList(bp, (*TriggerStep)(unsafe.Pointer(pStep)).FzSpan)),
-7)
}
@@ -113086,7 +116982,7 @@ func codeTriggerProgram(tls *crt.TLS, pParse uintptr, pStepList uintptr, orconf
case 127:
{
Xsqlite3Update(tls, pParse,
- targetSrcList(tls, pParse, pStep),
+ Xsqlite3TriggerStepSrc(tls, pParse, pStep),
Xsqlite3ExprListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpExprList, 0),
Xsqlite3ExprDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere, 0),
int32((*Parse)(unsafe.Pointer(pParse)).FeOrconf), uintptr(0), uintptr(0), uintptr(0))
@@ -113095,7 +116991,7 @@ func codeTriggerProgram(tls *crt.TLS, pParse uintptr, pStepList uintptr, orconf
case 125:
{
Xsqlite3Insert(tls, pParse,
- targetSrcList(tls, pParse, pStep),
+ Xsqlite3TriggerStepSrc(tls, pParse, pStep),
Xsqlite3SelectDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect, 0),
Xsqlite3IdListDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpIdList),
int32((*Parse)(unsafe.Pointer(pParse)).FeOrconf),
@@ -113105,13 +117001,13 @@ func codeTriggerProgram(tls *crt.TLS, pParse uintptr, pStepList uintptr, orconf
case 126:
{
Xsqlite3DeleteFrom(tls, pParse,
- targetSrcList(tls, pParse, pStep),
+ Xsqlite3TriggerStepSrc(tls, pParse, pStep),
Xsqlite3ExprDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpWhere, 0), uintptr(0), uintptr(0))
break
}
default:
{
- // var sDest SelectDest at bp+8, 32
+ // var sDest SelectDest at bp+8, 40
var pSelect uintptr = Xsqlite3SelectDup(tls, db, (*TriggerStep)(unsafe.Pointer(pStep)).FpSelect, 0)
Xsqlite3SelectDestInit(tls, bp+8 /* &sDest */, 4, 0)
@@ -113128,10 +117024,30 @@ func codeTriggerProgram(tls *crt.TLS, pParse uintptr, pStepList uintptr, orconf
return 0
}
+// This function is used to add VdbeComment() annotations to a VDBE
+// program. It is not used in production code, only for debugging.
+func onErrorText(tls *libc.TLS, onError int32) uintptr { /* sqlite3.c:137251:19: */
+ switch onError {
+ case 2:
+ return ts + 21821 /* "abort" */
+ case 1:
+ return ts + 21827 /* "rollback" */
+ case 3:
+ return ts + 21836 /* "fail" */
+ case 5:
+ return ts + 16380 /* "replace" */
+ case 4:
+ return ts + 21841 /* "ignore" */
+ case 11:
+ return ts + 21848 /* "default" */
+ }
+ return ts + 21856 /* "n/a" */
+}
+
// Parse context structure pFrom has just been used to create a sub-vdbe
// (trigger program). If an error has occurred, transfer error information
// from pFrom to pTo.
-func transferParseError(tls *crt.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:136877:13: */
+func transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c:137269:13: */
if (*Parse)(unsafe.Pointer(pTo)).FnErr == 0 {
(*Parse)(unsafe.Pointer(pTo)).FzErrMsg = (*Parse)(unsafe.Pointer(pFrom)).FzErrMsg
@@ -113144,9 +117060,9 @@ func transferParseError(tls *crt.TLS, pTo uintptr, pFrom uintptr) { /* sqlite3.c
// Create and populate a new TriggerPrg object with a sub-program
// implementing trigger pTrigger with ON CONFLICT policy orconf.
-func codeRowTrigger(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:136893:19: */
- bp := tls.Alloc(64)
- defer tls.Free(64)
+func codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:137285:19: */
+ bp := tls.Alloc(136)
+ defer tls.Free(136)
var pTop uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
@@ -113158,7 +117074,7 @@ func codeRowTrigger(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr
var pPrg uintptr // Value to return
var pWhen uintptr = uintptr(0) // Duplicate of trigger WHEN expression
var v uintptr // Temporary VM
- // var sNC NameContext at bp+8, 56
+ // var sNC NameContext at bp+80, 56
// Name context for sub-vdbe
var pProgram uintptr = uintptr(0) // Sub-vdbe for trigger program
var pSubParse uintptr // Parse context for sub-vdbe
@@ -113173,7 +117089,7 @@ func codeRowTrigger(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr
}
(*TriggerPrg)(unsafe.Pointer(pPrg)).FpNext = (*Parse)(unsafe.Pointer(pTop)).FpTriggerPrg
(*Parse)(unsafe.Pointer(pTop)).FpTriggerPrg = pPrg
- (*TriggerPrg)(unsafe.Pointer(pPrg)).FpProgram = crt.AssignUintptr(&pProgram, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(SubProgram{}))))
+ (*TriggerPrg)(unsafe.Pointer(pPrg)).FpProgram = libc.AssignUintptr(&pProgram, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(SubProgram{}))))
if !(pProgram != 0) {
return uintptr(0)
}
@@ -113189,8 +117105,8 @@ func codeRowTrigger(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr
if !(pSubParse != 0) {
return uintptr(0)
}
- crt.Xmemset(tls, bp+8 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
- (*NameContext)(unsafe.Pointer(bp + 8 /* &sNC */)).FpParse = pSubParse
+ libc.Xmemset(tls, bp+80 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ (*NameContext)(unsafe.Pointer(bp + 80 /* &sNC */)).FpParse = pSubParse
(*Parse)(unsafe.Pointer(pSubParse)).Fdb = db
(*Parse)(unsafe.Pointer(pSubParse)).FpTriggerTab = pTab
(*Parse)(unsafe.Pointer(pSubParse)).FpToplevel = pTop
@@ -113201,10 +117117,30 @@ func codeRowTrigger(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr
v = Xsqlite3GetVdbe(tls, pSubParse)
if v != 0 {
-
+ Xsqlite3VdbeComment(tls, v, ts+21860 /* "Start: %s.%s (%s..." */, libc.VaList(bp, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, onErrorText(tls, orconf), func() uintptr {
+ if int32((*Trigger)(unsafe.Pointer(pTrigger)).Ftr_tm) == 1 {
+ return ts + 21576 /* "BEFORE" */
+ }
+ return ts + 21583 /* "AFTER" */
+ }(), func() uintptr {
+ if int32((*Trigger)(unsafe.Pointer(pTrigger)).Fop) == 127 {
+ return ts + 21891 /* "UPDATE" */
+ }
+ return ts + 781 /* "" */
+ }(), func() uintptr {
+ if int32((*Trigger)(unsafe.Pointer(pTrigger)).Fop) == 125 {
+ return ts + 21898 /* "INSERT" */
+ }
+ return ts + 781 /* "" */
+ }(), func() uintptr {
+ if int32((*Trigger)(unsafe.Pointer(pTrigger)).Fop) == 126 {
+ return ts + 21905 /* "DELETE" */
+ }
+ return ts + 781 /* "" */
+ }(), (*Table)(unsafe.Pointer(pTab)).FzName))
if (*Trigger)(unsafe.Pointer(pTrigger)).FzName != 0 {
Xsqlite3VdbeChangeP4(tls, v, -1,
- Xsqlite3MPrintf(tls, db, ts+18211 /* "-- TRIGGER %s" */, crt.VaList(bp, (*Trigger)(unsafe.Pointer(pTrigger)).FzName)), -7)
+ Xsqlite3MPrintf(tls, db, ts+21912 /* "-- TRIGGER %s" */, libc.VaList(bp+56, (*Trigger)(unsafe.Pointer(pTrigger)).FzName)), -7)
}
// If one was specified, code the WHEN clause. If it evaluates to false
@@ -113212,7 +117148,7 @@ func codeRowTrigger(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr
// OP_Halt inserted at the end of the program.
if (*Trigger)(unsafe.Pointer(pTrigger)).FpWhen != 0 {
pWhen = Xsqlite3ExprDup(tls, db, (*Trigger)(unsafe.Pointer(pTrigger)).FpWhen, 0)
- if (0 == Xsqlite3ResolveExprNames(tls, bp+8 /* &sNC */, pWhen)) &&
+ if (0 == Xsqlite3ResolveExprNames(tls, bp+80 /* &sNC */, pWhen)) &&
(int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) {
iEndTrigger = Xsqlite3VdbeMakeLabel(tls, pSubParse)
Xsqlite3ExprIfFalse(tls, pSubParse, pWhen, iEndTrigger, 0x10)
@@ -113228,6 +117164,7 @@ func codeRowTrigger(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr
Xsqlite3VdbeResolveLabel(tls, v, iEndTrigger)
}
Xsqlite3VdbeAddOp0(tls, v, 68)
+ Xsqlite3VdbeComment(tls, v, ts+21926 /* "End: %s.%s" */, libc.VaList(bp+64, (*Trigger)(unsafe.Pointer(pTrigger)).FzName, onErrorText(tls, orconf)))
transferParseError(tls, pParse, pSubParse)
if (int32((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FnErr == 0) {
@@ -113251,7 +117188,7 @@ func codeRowTrigger(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr
// trigger pTrigger with default ON CONFLICT algorithm orconf. If no such
// TriggerPrg object exists, a new object is allocated and populated before
// being returned.
-func getRowTrigger(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:137009:19: */
+func getRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) uintptr { /* sqlite3.c:137401:19: */
var pRoot uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -113279,7 +117216,10 @@ func getRowTrigger(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr,
// table pTab. The reg, orconf and ignoreJump parameters passed to this
// function are the same as those described in the header function for
// sqlite3CodeRowTrigger()
-func Xsqlite3CodeRowTriggerDirect(tls *crt.TLS, pParse uintptr, p uintptr, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:137043:21: */
+func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:137435:21: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
var v uintptr = Xsqlite3GetVdbe(tls, pParse) // Main VM
var pPrg uintptr
pPrg = getRowTrigger(tls, pParse, p, pTab, orconf)
@@ -113287,10 +117227,16 @@ func Xsqlite3CodeRowTriggerDirect(tls *crt.TLS, pParse uintptr, p uintptr, pTab
// Code the OP_Program opcode in the parent VDBE. P4 of the OP_Program
// is a pointer to the sub-vdbe containing the trigger program.
if pPrg != 0 {
- var bRecursive int32 = (crt.Bool32(((*Trigger)(unsafe.Pointer(p)).FzName != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(0x00002000)))))
+ var bRecursive int32 = (libc.Bool32(((*Trigger)(unsafe.Pointer(p)).FzName != 0) && (uint64(0) == ((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Fflags & uint64(0x00002000)))))
- Xsqlite3VdbeAddOp4(tls, v, 46, reg, ignoreJump, crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1),
+ Xsqlite3VdbeAddOp4(tls, v, 46, reg, ignoreJump, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1),
(*TriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -4)
+ Xsqlite3VdbeComment(tls, v, ts+21937 /* "Call: %s.%s" */, libc.VaList(bp, func() uintptr {
+ if (*Trigger)(unsafe.Pointer(p)).FzName != 0 {
+ return (*Trigger)(unsafe.Pointer(p)).FzName
+ }
+ return ts + 21949 /* "fkey" */
+ }(), onErrorText(tls, orconf)))
// Set the P5 operand of the OP_Program instruction to non-zero if
// recursive invocation of this trigger program is disallowed. Recursive
@@ -113339,7 +117285,7 @@ func Xsqlite3CodeRowTriggerDirect(tls *crt.TLS, pParse uintptr, p uintptr, pTab
// trigger program to use (REPLACE, IGNORE etc.). Parameter ignoreJump
// is the instruction that control should jump to if a trigger program
// raises an IGNORE exception.
-func Xsqlite3CodeRowTrigger(tls *crt.TLS, pParse uintptr, pTrigger uintptr, op int32, pChanges uintptr, tr_tm int32, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:137115:21: */
+func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op int32, pChanges uintptr, tr_tm int32, pTab uintptr, reg int32, orconf int32, ignoreJump int32) { /* sqlite3.c:137507:21: */
var p uintptr // Used to iterate through pTrigger list
for p = pTrigger; p != 0; p = (*Trigger)(unsafe.Pointer(p)).FpNext {
@@ -113380,7 +117326,7 @@ func Xsqlite3CodeRowTrigger(tls *crt.TLS, pParse uintptr, pTrigger uintptr, op i
// included in the returned mask if the TRIGGER_BEFORE bit is set in the
// tr_tm parameter. Similarly, values accessed by AFTER triggers are only
// included in the returned mask if the TRIGGER_AFTER bit is set in tr_tm.
-func Xsqlite3TriggerColmask(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pChanges uintptr, isNew int32, tr_tm int32, pTab uintptr, orconf int32) U32 { /* sqlite3.c:137177:20: */
+func Xsqlite3TriggerColmask(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pChanges uintptr, isNew int32, tr_tm int32, pTab uintptr, orconf int32) U32 { /* sqlite3.c:137569:20: */
var op int32
if pChanges != 0 {
op = 127
@@ -113421,7 +117367,7 @@ func Xsqlite3TriggerColmask(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pCha
// literal default values specified: a number, null or a string. (If a more
// complicated default expression value was provided, it is evaluated
// when the ALTER TABLE is executed and one of the literal values written
-// into the sqlite_master table.)
+// into the sqlite_schema table.)
//
// Therefore, the P4 parameter is only required if the default value for
// the column is a literal number, string or null. The sqlite3ValueFromExpr()
@@ -113432,19 +117378,20 @@ func Xsqlite3TriggerColmask(tls *crt.TLS, pParse uintptr, pTrigger uintptr, pCha
// (not a virtual table) then the value might have been stored as an
// integer. In that case, add an OP_RealAffinity opcode to make sure
// it has been converted into REAL.
-func Xsqlite3ColumnDefault(tls *crt.TLS, v uintptr, pTab uintptr, i int32, iReg int32) { /* sqlite3.c:137270:21: */
- bp := tls.Alloc(8)
- defer tls.Free(8)
+func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg int32) { /* sqlite3.c:137662:21: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
if !(int32((*Table)(unsafe.Pointer(pTab)).FpSelect) != 0) {
- *(*uintptr)(unsafe.Pointer(bp /* pValue */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* pValue */)) = uintptr(0)
var enc U8 = (*Sqlite3)(unsafe.Pointer(Xsqlite3VdbeDb(tls, v))).Fenc
var pCol uintptr = ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)
+ Xsqlite3VdbeComment(tls, v, ts+9978 /* "%s.%s" */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, (*Column)(unsafe.Pointer(pCol)).FzName))
Xsqlite3ValueFromExpr(tls, Xsqlite3VdbeDb(tls, v), (*Column)(unsafe.Pointer(pCol)).FpDflt, enc,
- uint8((*Column)(unsafe.Pointer(pCol)).Faffinity), bp /* &pValue */)
- if *(*uintptr)(unsafe.Pointer(bp /* pValue */)) != 0 {
- Xsqlite3VdbeAppendP4(tls, v, *(*uintptr)(unsafe.Pointer(bp /* pValue */)), -11)
+ uint8((*Column)(unsafe.Pointer(pCol)).Faffinity), bp+16 /* &pValue */)
+ if *(*uintptr)(unsafe.Pointer(bp + 16 /* pValue */)) != 0 {
+ Xsqlite3VdbeAppendP4(tls, v, *(*uintptr)(unsafe.Pointer(bp + 16 /* pValue */)), -11)
}
}
if (int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).Faffinity) == 0x45) && !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
@@ -113461,11 +117408,11 @@ func Xsqlite3ColumnDefault(tls *crt.TLS, v uintptr, pTab uintptr, i int32, iReg
// aXRef[j] will be non-negative if column j of the original table is
// being updated. chngRowid will be true if the rowid of the table is
// being updated.
-func indexColumnIsBeingUpdated(tls *crt.TLS, pIdx uintptr, iCol int32, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:137302:12: */
+func indexColumnIsBeingUpdated(tls *libc.TLS, pIdx uintptr, iCol int32, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:137694:12: */
var iIdxCol I16 = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2))
// Cannot index rowid
if int32(iIdxCol) >= 0 {
- return (crt.Bool32(*(*int32)(unsafe.Pointer(aXRef + uintptr(iIdxCol)*4)) >= 0))
+ return (libc.Bool32(*(*int32)(unsafe.Pointer(aXRef + uintptr(iIdxCol)*4)) >= 0))
}
return Xsqlite3ExprReferencesUpdatedColumn(tls, (*ExprList_item)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FaColExpr+8 /* &.a */)+uintptr(iCol)*32)).FpExpr,
@@ -113482,7 +117429,7 @@ func indexColumnIsBeingUpdated(tls *crt.TLS, pIdx uintptr, iCol int32, aXRef uin
// aXRef[j] will be non-negative if column j of the original table is
// being updated. chngRowid will be true if the rowid of the table is
// being updated.
-func indexWhereClauseMightChange(tls *crt.TLS, pIdx uintptr, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:137332:12: */
+func indexWhereClauseMightChange(tls *libc.TLS, pIdx uintptr, aXRef uintptr, chngRowid int32) int32 { /* sqlite3.c:137724:12: */
if (*Index)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) {
return 0
}
@@ -113490,12 +117437,129 @@ func indexWhereClauseMightChange(tls *crt.TLS, pIdx uintptr, aXRef uintptr, chng
aXRef, chngRowid)
}
+// Allocate and return a pointer to an expression of type TK_ROW with
+// Expr.iColumn set to value (iCol+1). The resolver will modify the
+// expression to be a TK_COLUMN reading column iCol of the first
+// table in the source-list (pSrc->a[0]).
+func exprRowColumn(tls *libc.TLS, pParse uintptr, iCol int32) uintptr { /* sqlite3.c:137740:13: */
+ var pRet uintptr = Xsqlite3PExpr(tls, pParse, 75, uintptr(0), uintptr(0))
+ if pRet != 0 {
+ (*Expr)(unsafe.Pointer(pRet)).FiColumn = (YnVar(iCol + 1))
+ }
+ return pRet
+}
+
+// Assuming both the pLimit and pOrderBy parameters are NULL, this function
+// generates VM code to run the query:
+//
+// SELECT <other-columns>, pChanges FROM pTabList WHERE pWhere
+//
+// and write the results to the ephemeral table already opened as cursor
+// iEph. None of pChanges, pTabList or pWhere are modified or consumed by
+// this function, they must be deleted by the caller.
+//
+// Or, if pLimit and pOrderBy are not NULL, and pTab is not a view:
+//
+// SELECT <other-columns>, pChanges FROM pTabList
+// WHERE pWhere
+// GROUP BY <other-columns>
+// ORDER BY pOrderBy LIMIT pLimit
+//
+// If pTab is a view, the GROUP BY clause is omitted.
+//
+// Exactly how results are written to table iEph, and exactly what
+// the <other-columns> in the query above are is determined by the type
+// of table pTabList->a[0].pTab.
+//
+// If the table is a WITHOUT ROWID table, then argument pPk must be its
+// PRIMARY KEY. In this case <other-columns> are the primary key columns
+// of the table, in order. The results of the query are written to ephemeral
+// table iEph as index keys, using OP_IdxInsert.
+//
+// If the table is actually a view, then <other-columns> are all columns of
+// the view. The results are written to the ephemeral table iEph as records
+// with automatically assigned integer keys.
+//
+// If the table is a virtual or ordinary intkey table, then <other-columns>
+// is its rowid. For a virtual table, the results are written to iEph as
+// records with automatically assigned integer keys For intkey tables, the
+// rowid value in <other-columns> is used as the integer key, and the
+// remaining fields make up the table record.
+func updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, pChanges uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr) { /* sqlite3.c:137784:13: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
+
+ var i int32
+ // var dest SelectDest at bp, 40
+
+ var pSelect uintptr = uintptr(0)
+ var pList uintptr = uintptr(0)
+ var pGrp uintptr = uintptr(0)
+ var pLimit2 uintptr = uintptr(0)
+ var pOrderBy2 uintptr = uintptr(0)
+ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
+ var pTab uintptr = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(0)*112)).FpTab
+ var pSrc uintptr
+ var pWhere2 uintptr
+ var eDest int32
+
+ _ = pOrderBy
+ _ = pLimit
+
+ pSrc = Xsqlite3SrcListDup(tls, db, pTabList, 0)
+ pWhere2 = Xsqlite3ExprDup(tls, db, pWhere, 0)
+
+ if pSrc != 0 {
+ (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(0)*112)).FiCursor = -1
+ (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pSrc+8 /* &.a */)+uintptr(0)*112)).FpTab)).FnTabRef--
+ (*SrcList_item)(unsafe.Pointer((pSrc + 8 /* &.a */) + uintptr(0)*112)).FpTab = uintptr(0)
+ }
+ if pPk != 0 {
+ for i = 0; i < int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol); i++ {
+ var pNew uintptr = exprRowColumn(tls, pParse, int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))))
+ pList = Xsqlite3ExprListAppend(tls, pParse, pList, pNew)
+ }
+ eDest = 15
+ } else if (*Table)(unsafe.Pointer(pTab)).FpSelect != 0 {
+ for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
+ pList = Xsqlite3ExprListAppend(tls, pParse, pList, exprRowColumn(tls, pParse, i))
+ }
+ eDest = 14
+ } else {
+ if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
+ eDest = 14
+ } else {
+ eDest = 15
+ }
+ pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), Xsqlite3PExpr(tls, pParse, 75, uintptr(0), uintptr(0)))
+ }
+ if pChanges != 0 {
+ for i = 0; i < (*ExprList)(unsafe.Pointer(pChanges)).FnExpr; i++ {
+ pList = Xsqlite3ExprListAppend(tls, pParse, pList,
+ Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*32)).FpExpr, 0))
+ }
+ }
+ pSelect = Xsqlite3SelectNew(tls, pParse, pList,
+ pSrc, pWhere2, pGrp, uintptr(0), pOrderBy2, (uint32(0x0800000 | 0x0020000)), pLimit2)
+ Xsqlite3SelectDestInit(tls, bp /* &dest */, eDest, iEph)
+ (*SelectDest)(unsafe.Pointer(bp /* &dest */)).FiSDParm2 = func() int32 {
+ if pPk != 0 {
+ return int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
+ }
+ return -1
+ }()
+ Xsqlite3Select(tls, pParse, pSelect, bp /* &dest */)
+ Xsqlite3SelectDelete(tls, db, pSelect)
+}
+
// Process an UPDATE statement.
//
-// UPDATE OR IGNORE table_wxyz SET a=b, c=d WHERE e<5 AND f NOT NULL;
-// \_______/ \________/ \______/ \________________/
-// onError pTabList pChanges pWhere
-func Xsqlite3Update(tls *crt.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { /* sqlite3.c:137349:21: */
+// UPDATE OR IGNORE tbl SET a=b, c=d FROM tbl2... WHERE e<5 AND f NOT NULL;
+// \_______/ \_/ \______/ \_____/ \________________/
+// onError | pChanges | pWhere
+// \_______________________/
+// pTabList
+func Xsqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { /* sqlite3.c:137878:21: */
bp := tls.Alloc(108)
defer tls.Free(108)
@@ -113523,6 +117587,7 @@ func Xsqlite3Update(tls *crt.TLS, pParse uintptr, pTabList uintptr, pChanges uin
var chngRowid U8 // Rowid changed in a normal table
var chngKey U8 // Either chngPk or chngRowid
var pRowidExpr uintptr // Expression defining the new record number
+ var iRowidExpr int32 // Index of "rowid=" (or IPK) assignment in pChanges
// var sContext AuthContext at bp+16, 16
// The authorization context
// var sNC NameContext at bp+40, 56
@@ -113549,6 +117614,7 @@ func Xsqlite3Update(tls *crt.TLS, pParse uintptr, pTabList uintptr, pChanges uin
// var bReplace int32 at bp+104, 4
// True if REPLACE conflict resolution might happen
var bFinishSeek int32 // The OP_FinishSeek opcode is needed
+ var nChangeFrom int32 // If there is a FROM, pChanges->nExpr, else 0
// Register Allocations
var regRowCount int32 // A count of rows changed
@@ -113561,14 +117627,19 @@ func Xsqlite3Update(tls *crt.TLS, pParse uintptr, pTabList uintptr, pChanges uin
var rc int32
var bProgress int32
var reg int32
+ var pKeyInfo uintptr
+ var nEphCol int32
var iCur int32
var addrOnce int32
var colFlags U32
var oldmask U32
+ var nOff int32
addrTop = 0
+ pWInfo = uintptr(0)
aRegIdx = uintptr(0)
aXRef = uintptr(0)
pRowidExpr = uintptr(0)
+ iRowidExpr = -1
iEph = 0
nKey = 0
addrOpen = 0
@@ -113576,6 +117647,7 @@ func Xsqlite3Update(tls *crt.TLS, pParse uintptr, pTabList uintptr, pChanges uin
nPk = int16(0)
*(*int32)(unsafe.Pointer(bp + 104 /* bReplace */)) = 0
bFinishSeek = 1
+ nChangeFrom = 0
regRowCount = 0
regOldRowid = 0
regNewRowid = 0
@@ -113584,7 +117656,7 @@ func Xsqlite3Update(tls *crt.TLS, pParse uintptr, pTabList uintptr, pChanges uin
regRowSet = 0
regKey = 0 // composite PRIMARY KEY value
- crt.Xmemset(tls, bp+16 /* &sContext */, 0, uint64(unsafe.Sizeof(AuthContext{})))
+ libc.Xmemset(tls, bp+16 /* &sContext */, 0, uint64(unsafe.Sizeof(AuthContext{})))
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
if !(((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) {
goto __1
@@ -113606,7 +117678,17 @@ __2:
// Figure out if we have any triggers and if the table being
// updated is a view.
pTrigger = Xsqlite3TriggersExist(tls, pParse, pTab, 127, pChanges, bp+32 /* &tmask */)
- isView = (crt.Bool32((*Table)(unsafe.Pointer(pTab)).FpSelect != uintptr(0)))
+ isView = (libc.Bool32((*Table)(unsafe.Pointer(pTab)).FpSelect != uintptr(0)))
+
+ // If there was a FROM clause, set nChangeFrom to the number of expressions
+ // in the change-list. Otherwise, set it to 0. There cannot be a FROM
+ // clause if this function is being called to generate code for part of
+ // an UPSERT statement.
+ if (*SrcList)(unsafe.Pointer(pTabList)).FnSrc > 1 {
+ nChangeFrom = (*ExprList)(unsafe.Pointer(pChanges)).FnExpr
+ } else {
+ nChangeFrom = 0
+ }
if !(Xsqlite3ViewGetColumnNames(tls, pParse, pTab) != 0) {
goto __3
@@ -113625,7 +117707,7 @@ __4:
// The index cursors might not be used, but if they are used they
// need to occur right after the database cursor. So go ahead and
// allocate enough space, just in case.
- iBaseCur = crt.AssignInt32(&iDataCur, crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1))
+ iBaseCur = libc.AssignInt32(&iDataCur, libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1))
iIdxCur = (iDataCur + 1)
if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0) {
pPk = uintptr(0)
@@ -113676,7 +117758,7 @@ __10:
;
aRegIdx = (aXRef + uintptr((*Table)(unsafe.Pointer(pTab)).FnCol)*4)
aToOpen = ((aRegIdx + uintptr(nIdx)*4) + uintptr(1)*4)
- crt.Xmemset(tls, aToOpen, 1, (uint64(nIdx + 1)))
+ libc.Xmemset(tls, aToOpen, 1, (uint64(nIdx + 1)))
*(*U8)(unsafe.Pointer(aToOpen + uintptr((nIdx + 1)))) = U8(0)
i = 0
__11:
@@ -113693,7 +117775,7 @@ __13:
;
// Initialize the name-context
- crt.Xmemset(tls, bp+40 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp+40 /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp + 40 /* &sNC */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp + 40 /* &sNC */)).FpSrcList = pTabList
*(*uintptr)(unsafe.Pointer(bp + 40 /* &sNC */ + 16 /* &.uNC */)) = pUpsert
@@ -113713,13 +117795,15 @@ __14:
// for each column to be updated in the pChanges array. For each
// column to be updated, make sure we have authorization to change
// that column.
- chngRowid = crt.AssignUint8(&chngPk, U8(0))
+ chngRowid = libc.AssignUint8(&chngPk, U8(0))
i = 0
__15:
if !(i < (*ExprList)(unsafe.Pointer(pChanges)).FnExpr) {
goto __17
}
- if !(Xsqlite3ResolveExprNames(tls, bp+40 /* &sNC */, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*32)).FpExpr) != 0) {
+ // If this is an UPDATE with a FROM clause, do not resolve expressions
+ // here. The call to sqlite3Select() below will do that.
+ if !((nChangeFrom == 0) && (Xsqlite3ResolveExprNames(tls, bp+40 /* &sNC */, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*32)).FpExpr) != 0)) {
goto __18
}
goto update_cleanup
@@ -113738,6 +117822,7 @@ __19:
}
chngRowid = U8(1)
pRowidExpr = (*ExprList_item)(unsafe.Pointer((pChanges + 8 /* &.a */) + uintptr(i)*32)).FpExpr
+ iRowidExpr = i
goto __24
__23:
if !((pPk != 0) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*32)).FcolFlags) & 0x0001) != 0)) {
@@ -113751,8 +117836,8 @@ __25:
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+18225, /* "cannot UPDATE ge..." */
- crt.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*32)).FzName))
+ ts+21954, /* "cannot UPDATE ge..." */
+ libc.VaList(bp, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(j)*32)).FzName))
goto update_cleanup
__27:
;
@@ -113780,9 +117865,10 @@ __21:
j = -1
chngRowid = U8(1)
pRowidExpr = (*ExprList_item)(unsafe.Pointer((pChanges + 8 /* &.a */) + uintptr(i)*32)).FpExpr
+ iRowidExpr = i
goto __30
__29:
- Xsqlite3ErrorMsg(tls, pParse, ts+18261 /* "no such column: ..." */, crt.VaList(bp+8, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*32)).FzEName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+21990 /* "no such column: ..." */, libc.VaList(bp+8, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(i)*32)).FzEName))
(*Parse)(unsafe.Pointer(pParse)).FcheckSchema = U8(1)
goto update_cleanup
__30:
@@ -113793,7 +117879,7 @@ __28:
rc = Xsqlite3AuthCheck(tls, pParse, 23, (*Table)(unsafe.Pointer(pTab)).FzName,
func() uintptr {
if j < 0 {
- return ts + 7298 /* "ROWID" */
+ return ts + 9544 /* "ROWID" */
}
return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*32)).FzName
}(),
@@ -113883,7 +117969,7 @@ __34:
// table implementation makes all columns available).
(*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(0)*112)).FcolUsed = func() uint64 {
if (*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0 {
- return crt.Uint64(crt.Uint64FromInt32(-1))
+ return libc.Uint64(libc.Uint64FromInt32(-1))
}
return uint64(0)
}()
@@ -113909,7 +117995,7 @@ __45:
(indexWhereClauseMightChange(tls, pIdx, aXRef, int32(chngRowid)) != 0)) {
goto __48
}
- reg = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ reg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn))
goto __49
__48:
@@ -113922,7 +118008,7 @@ __50:
if !(indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, int32(chngRowid)) != 0) {
goto __53
}
- reg = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ reg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn))
if !((onError == 11) && (int32((*Index)(unsafe.Pointer(pIdx)).FonError) == 5)) {
goto __54
@@ -113957,13 +118043,13 @@ __46:
goto __47
__47:
;
- *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Register storing the table record
+ *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Register storing the table record
if !(*(*int32)(unsafe.Pointer(bp + 104 /* bReplace */)) != 0) {
goto __56
}
// If REPLACE conflict resolution might be invoked, open cursors on all
// indexes in case they are needed to delete records.
- crt.Xmemset(tls, aToOpen, 1, (uint64(nIdx + 1)))
+ libc.Xmemset(tls, aToOpen, 1, (uint64(nIdx + 1)))
__56:
;
@@ -113973,7 +118059,7 @@ __56:
Xsqlite3VdbeCountChanges(tls, v)
__57:
;
- Xsqlite3BeginWriteOperation(tls, pParse, (crt.Bool32((pTrigger != 0) || (hasFK != 0))), iDb)
+ Xsqlite3BeginWriteOperation(tls, pParse, (libc.Bool32((pTrigger != 0) || (hasFK != 0))), iDb)
// Allocate required registers.
if !(!((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0)) {
@@ -113986,7 +118072,7 @@ __57:
// two-pass update algorithm.
regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4))
- regOldRowid = crt.AssignInt32(&regNewRowid, crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
+ regOldRowid = libc.AssignInt32(&regNewRowid, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
if !(((chngPk != 0) || (pTrigger != 0)) || (hasFK != 0)) {
goto __59
}
@@ -113997,7 +118083,7 @@ __59:
if !(((chngKey != 0) || (pTrigger != 0)) || (hasFK != 0)) {
goto __60
}
- regNewRowid = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regNewRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
__60:
;
regNew = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
@@ -114015,7 +118101,7 @@ __61:
// If we are trying to update a view, realize that view into
// an ephemeral table.
- if !(isView != 0) {
+ if !((nChangeFrom == 0) && (isView != 0)) {
goto __62
}
Xsqlite3MaterializeView(tls, pParse, pTab,
@@ -114027,7 +118113,7 @@ __62:
// Resolve the column names in all the expressions in the
// WHERE clause.
- if !(Xsqlite3ResolveExprNames(tls, bp+40 /* &sNC */, pWhere) != 0) {
+ if !((nChangeFrom == 0) && (Xsqlite3ResolveExprNames(tls, bp+40 /* &sNC */, pWhere) != 0)) {
goto __63
}
goto update_cleanup
@@ -114045,7 +118131,7 @@ __64:
;
// Jump to labelBreak to abandon further processing of this UPDATE
- labelContinue = crt.AssignInt32(&labelBreak, Xsqlite3VdbeMakeLabel(tls, pParse))
+ labelContinue = libc.AssignInt32(&labelBreak, Xsqlite3VdbeMakeLabel(tls, pParse))
// Not an UPSERT. Normal processing. Begin by
// initialize the count of updated rows
@@ -114055,36 +118141,86 @@ __64:
(pUpsert == uintptr(0))) {
goto __65
}
- regRowCount = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regRowCount = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 69, 0, regRowCount)
__65:
;
- if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) {
+ if !((nChangeFrom == 0) && (((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0))) {
goto __66
}
Xsqlite3VdbeAddOp3(tls, v, 72, 0, regRowSet, regOldRowid)
goto __67
__66:
;
- nPk = I16((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
+ if pPk != 0 {
+ nPk = int16((*Index)(unsafe.Pointer(pPk)).FnKeyCol)
+ } else {
+ nPk = int16(0)
+ }
iPk = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (int32(nPk))
- regKey = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ *(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nChangeFrom)
+ regKey = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
if !(pUpsert == uintptr(0)) {
goto __68
}
- iEph = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ nEphCol = ((int32(nPk) + nChangeFrom) + (func() int32 {
+ if isView != 0 {
+ return int32((*Table)(unsafe.Pointer(pTab)).FnCol)
+ }
+ return 0
+ }()))
+ iEph = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ if !(pPk != 0) {
+ goto __69
+ }
Xsqlite3VdbeAddOp3(tls, v, 72, 0, iPk, ((iPk + int32(nPk)) - 1))
- addrOpen = Xsqlite3VdbeAddOp2(tls, v, 100, iEph, int32(nPk))
- Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pPk)
+__69:
+ ;
+ addrOpen = Xsqlite3VdbeAddOp2(tls, v, 100, iEph, nEphCol)
+ if !(pPk != 0) {
+ goto __70
+ }
+ pKeyInfo = Xsqlite3KeyInfoOfIndex(tls, pParse, pPk)
+ if !(pKeyInfo != 0) {
+ goto __71
+ }
+ (*KeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField = U16(nEphCol)
+ Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -9)
+__71:
+ ;
+__70:
+ ;
+ if !(nChangeFrom != 0) {
+ goto __72
+ }
+ updateFromSelect(tls,
+ pParse, iEph, pPk, pChanges, pTabList, pWhere, pOrderBy, pLimit)
+ if !(isView != 0) {
+ goto __73
+ }
+ iDataCur = iEph
+__73:
+ ;
+__72:
+ ;
__68:
;
__67:
;
+ if !(nChangeFrom != 0) {
+ goto __74
+ }
+ Xsqlite3MultiWrite(tls, pParse)
+ eOnePass = 0
+ nKey = int32(nPk)
+ regKey = iPk
+ goto __75
+__74:
if !(pUpsert != 0) {
- goto __69
+ goto __76
}
// If this is an UPSERT, then all cursors have already been opened by
// the outer INSERT and the data cursor should be pointing at the row
@@ -114094,8 +118230,8 @@ __67:
eOnePass = 1
Xsqlite3ExprIfFalse(tls, pParse, pWhere, labelBreak, 0x10)
bFinishSeek = 0
- goto __70
-__69:
+ goto __77
+__76:
// Begin the database scan.
//
// Do not consider a single-pass strategy for a multi-row update if
@@ -114105,17 +118241,17 @@ __69:
// or index, causing a single-pass approach to malfunction.
flags = (0x0004 | 0x1000)
if !((((!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0) && !(pTrigger != 0)) && !(hasFK != 0)) && !(chngKey != 0)) && !(*(*int32)(unsafe.Pointer(bp + 104 /* bReplace */)) != 0)) {
- goto __71
+ goto __78
}
flags = flags | (0x0008)
-__71:
+__78:
;
pWInfo = Xsqlite3WhereBegin(tls, pParse, pTabList, pWhere, uintptr(0), uintptr(0), uint16(flags), iIdxCur)
if !(pWInfo == uintptr(0)) {
- goto __72
+ goto __79
}
goto update_cleanup
-__72:
+__79:
;
// A one-pass strategy that might update more than one row may not
@@ -114131,151 +118267,153 @@ __72:
eOnePass = Xsqlite3WhereOkOnePass(tls, pWInfo, bp+96 /* &aiCurOnePass[0] */)
bFinishSeek = Xsqlite3WhereUsesDeferredSeek(tls, pWInfo)
if !(eOnePass != 1) {
- goto __73
+ goto __80
}
Xsqlite3MultiWrite(tls, pParse)
if !(eOnePass == 2) {
- goto __74
+ goto __81
}
iCur = *(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + uintptr(1)*4))
if !(((iCur >= 0) && (iCur != iDataCur)) && (*(*U8)(unsafe.Pointer(aToOpen + uintptr((iCur - iBaseCur)))) != 0)) {
- goto __75
+ goto __82
}
eOnePass = 0
-__75:
+__82:
;
-__74:
+__81:
;
-__73:
+__80:
;
-__70:
+__77:
;
if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) {
- goto __76
+ goto __83
}
// Read the rowid of the current row of the WHERE scan. In ONEPASS_OFF
// mode, write the rowid into the FIFO. In either of the one-pass modes,
// leave it in register regOldRowid.
Xsqlite3VdbeAddOp2(tls, v, 127, iDataCur, regOldRowid)
if !(eOnePass == 0) {
- goto __78
+ goto __85
}
// We need to use regRowSet, so reallocate aRegIdx[nAllIdx]
- *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 147, regRowSet, regOldRowid)
-__78:
+__85:
;
- goto __77
-__76:
+ goto __84
+__83:
// Read the PK of the current row into an array of registers. In
// ONEPASS_OFF mode, serialize the array into a record and store it in
// the ephemeral table. Or, in ONEPASS_SINGLE or MULTI mode, change
// the OP_OpenEphemeral instruction to a Noop (the ephemeral table
// is not required) and leave the PK fields in the array of registers.
i = 0
-__79:
+__86:
if !(i < int32(nPk)) {
- goto __81
+ goto __88
}
Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur,
int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))), (iPk + i))
- goto __80
-__80:
+ goto __87
+__87:
i++
- goto __79
- goto __81
-__81:
+ goto __86
+ goto __88
+__88:
;
if !(eOnePass != 0) {
- goto __82
+ goto __89
}
if !(addrOpen != 0) {
- goto __84
+ goto __91
}
Xsqlite3VdbeChangeToNoop(tls, v, addrOpen)
-__84:
+__91:
;
nKey = int32(nPk)
regKey = iPk
- goto __83
-__82:
+ goto __90
+__89:
Xsqlite3VdbeAddOp4(tls, v, 91, iPk, int32(nPk), regKey,
Xsqlite3IndexAffinityStr(tls, db, pPk), int32(nPk))
Xsqlite3VdbeAddOp4Int(tls, v, 130, iEph, regKey, iPk, int32(nPk))
-__83:
+__90:
;
-__77:
+__84:
+ ;
+__75:
;
if !(pUpsert == uintptr(0)) {
- goto __85
+ goto __92
}
- if !(eOnePass != 2) {
- goto __86
+ if !((nChangeFrom == 0) && (eOnePass != 2)) {
+ goto __93
}
Xsqlite3WhereEnd(tls, pWInfo)
-__86:
+__93:
;
if !(!(isView != 0)) {
- goto __87
+ goto __94
}
addrOnce = 0
// Open every index that needs updating.
if !(eOnePass != 0) {
- goto __88
+ goto __95
}
if !(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + uintptr(0)*4)) >= 0) {
- goto __89
+ goto __96
}
*(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + uintptr(0)*4)) - iBaseCur)))) = U8(0)
-__89:
+__96:
;
if !(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + uintptr(1)*4)) >= 0) {
- goto __90
+ goto __97
}
*(*U8)(unsafe.Pointer(aToOpen + uintptr((*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + uintptr(1)*4)) - iBaseCur)))) = U8(0)
-__90:
+__97:
;
-__88:
+__95:
;
- if !((eOnePass == 2) && ((nIdx - (crt.Bool32(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + uintptr(1)*4)) >= 0))) > 0)) {
- goto __91
+ if !((eOnePass == 2) && ((nIdx - (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + uintptr(1)*4)) >= 0))) > 0)) {
+ goto __98
}
addrOnce = Xsqlite3VdbeAddOp0(tls, v, 17)
-__91:
+__98:
;
Xsqlite3OpenTableAndIndices(tls, pParse, pTab, 97, uint8(0), iBaseCur,
aToOpen, uintptr(0), uintptr(0))
if !(addrOnce != 0) {
- goto __92
+ goto __99
}
Xsqlite3VdbeJumpHereOrPopInst(tls, v, addrOnce)
-__92:
+__99:
;
-__87:
+__94:
;
// Top of the update loop
if !(eOnePass != 0) {
- goto __93
+ goto __100
}
if !((!(isView != 0) && (*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + uintptr(0)*4)) != iDataCur)) && (*(*int32)(unsafe.Pointer(bp + 96 /* &aiCurOnePass[0] */ + uintptr(1)*4)) != iDataCur)) {
- goto __95
+ goto __102
}
Xsqlite3VdbeAddOp4Int(tls, v, 29, iDataCur, labelBreak, regKey, nKey)
-__95:
+__102:
;
if !(eOnePass != 1) {
- goto __96
+ goto __103
}
labelContinue = Xsqlite3VdbeMakeLabel(tls, pParse)
-__96:
+__103:
;
Xsqlite3VdbeAddOp2(tls, v, 50, func() int32 {
if pPk != 0 {
@@ -114284,26 +118422,64 @@ __96:
return regOldRowid
}(), labelBreak)
- goto __94
-__93:
- if !(pPk != 0) {
- goto __97
+ goto __101
+__100:
+ if !((pPk != 0) || (nChangeFrom != 0)) {
+ goto __104
}
labelContinue = Xsqlite3VdbeMakeLabel(tls, pParse)
Xsqlite3VdbeAddOp2(tls, v, 37, iEph, labelBreak)
- addrTop = Xsqlite3VdbeAddOp2(tls, v, 126, iEph, regKey)
+ addrTop = Xsqlite3VdbeCurrentAddr(tls, v)
+ if !(nChangeFrom != 0) {
+ goto __106
+ }
+ if !(!(isView != 0)) {
+ goto __108
+ }
+ if !(pPk != 0) {
+ goto __109
+ }
+ i = 0
+__111:
+ if !(i < int32(nPk)) {
+ goto __113
+ }
+ Xsqlite3VdbeAddOp3(tls, v, 89, iEph, i, (iPk + i))
+ goto __112
+__112:
+ i++
+ goto __111
+ goto __113
+__113:
+ ;
+ Xsqlite3VdbeAddOp4Int(tls,
+ v, 29, iDataCur, labelContinue, iPk, int32(nPk))
+ goto __110
+__109:
+ Xsqlite3VdbeAddOp2(tls, v, 127, iEph, regOldRowid)
+ Xsqlite3VdbeAddOp3(tls,
+ v, 32, iDataCur, labelContinue, regOldRowid)
+__110:
+ ;
+__108:
+ ;
+ goto __107
+__106:
+ Xsqlite3VdbeAddOp2(tls, v, 126, iEph, regKey)
Xsqlite3VdbeAddOp4Int(tls, v, 29, iDataCur, labelContinue, regKey, 0)
- goto __98
-__97:
+__107:
+ ;
+ goto __105
+__104:
labelContinue = Xsqlite3VdbeAddOp3(tls, v, 42, regRowSet, labelBreak,
regOldRowid)
Xsqlite3VdbeAddOp3(tls, v, 32, iDataCur, labelContinue, regOldRowid)
-__98:
+__105:
;
-__94:
+__101:
;
-__85:
+__92:
;
// If the rowid value will change, set register regNewRowid to
@@ -114312,17 +118488,26 @@ __85:
// already populated.
if !(chngRowid != 0) {
- goto __99
+ goto __114
+ }
+
+ if !(nChangeFrom == 0) {
+ goto __115
}
Xsqlite3ExprCode(tls, pParse, pRowidExpr, regNewRowid)
+ goto __116
+__115:
+ Xsqlite3VdbeAddOp3(tls, v, 89, iEph, iRowidExpr, regNewRowid)
+__116:
+ ;
Xsqlite3VdbeAddOp1(tls, v, 15, regNewRowid)
-__99:
+__114:
;
// Compute the old pre-UPDATE content of the row being changed, if that
// information is needed
if !(((chngPk != 0) || (hasFK != 0)) || (pTrigger != 0)) {
- goto __100
+ goto __117
}
oldmask = func() uint32 {
if hasFK != 0 {
@@ -114333,38 +118518,38 @@ __99:
oldmask = oldmask | (Xsqlite3TriggerColmask(tls, pParse,
pTrigger, pChanges, 0, (1 | 2), pTab, onError))
i = 0
-__101:
+__118:
if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
- goto __103
+ goto __120
}
colFlags = U32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*32)).FcolFlags)
k = (int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(i))) + regOld)
if !(((oldmask == 0xffffffff) ||
((i < 32) && ((oldmask & (uint32((uint32(1))) << (i))) != U32(0)))) ||
((colFlags & U32(0x0001)) != U32(0))) {
- goto __104
+ goto __121
}
Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k)
- goto __105
-__104:
+ goto __122
+__121:
Xsqlite3VdbeAddOp2(tls, v, 72, 0, k)
-__105:
+__122:
;
- goto __102
-__102:
+ goto __119
+__119:
i++
- goto __101
- goto __103
-__103:
+ goto __118
+ goto __120
+__120:
;
if !((int32(chngRowid) == 0) && (pPk == uintptr(0))) {
- goto __106
+ goto __123
}
Xsqlite3VdbeAddOp2(tls, v, 77, regOldRowid, regNewRowid)
-__106:
+__123:
;
-__100:
+__117:
;
// Populate the array of registers beginning at regNew with the new
@@ -114383,36 +118568,51 @@ __100:
pParse, pTrigger, pChanges, 1, 1, pTab, onError))
i = 0
k = regNew
-__107:
+__124:
if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
- goto __109
+ goto __126
}
if !(i == int32((*Table)(unsafe.Pointer(pTab)).FiPKey)) {
- goto __110
+ goto __127
}
Xsqlite3VdbeAddOp2(tls, v, 72, 0, k)
- goto __111
-__110:
+ goto __128
+__127:
if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & 0x0060) != 0) {
- goto __112
+ goto __129
}
if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & 0x0020) != 0) {
- goto __114
+ goto __131
}
k--
-__114:
+__131:
;
- goto __113
-__112:
+ goto __130
+__129:
j = *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4))
if !(j >= 0) {
- goto __115
+ goto __132
+ }
+ if !(nChangeFrom != 0) {
+ goto __134
}
+ nOff = func() int32 {
+ if isView != 0 {
+ return int32((*Table)(unsafe.Pointer(pTab)).FnCol)
+ }
+ return int32(nPk)
+ }()
+
+ Xsqlite3VdbeAddOp3(tls, v, 89, iEph, (nOff + j), k)
+ goto __135
+__134:
Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(j)*32)).FpExpr, k)
- goto __116
-__115:
+__135:
+ ;
+ goto __133
+__132:
if !(((0 == (*(*int32)(unsafe.Pointer(bp + 32 /* tmask */)) & 1)) || (i > 31)) || ((uint32(newmask) & (uint32((uint32(1))) << (i))) != 0)) {
- goto __117
+ goto __136
}
// This branch loads the value of a column that will not be changed
// into a register. This is done if there are no BEFORE triggers, or
@@ -114421,55 +118621,58 @@ __115:
Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k)
bFinishSeek = 0
- goto __118
-__117:
+ goto __137
+__136:
Xsqlite3VdbeAddOp2(tls, v, 72, 0, k)
-__118:
+__137:
;
-__116:
+__133:
;
-__113:
+__130:
;
-__111:
+__128:
;
- goto __108
-__108:
+ goto __125
+__125:
i++
k++
- goto __107
- goto __109
-__109:
+ goto __124
+ goto __126
+__126:
;
if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(0x0060)) != 0) {
- goto __119
+ goto __138
}
Xsqlite3ComputeGeneratedColumns(tls, pParse, regNew, pTab)
-__119:
+__138:
;
// Fire any BEFORE UPDATE triggers. This happens before constraints are
// verified. One could argue that this is wrong.
if !((*(*int32)(unsafe.Pointer(bp + 32 /* tmask */)) & 1) != 0) {
- goto __120
+ goto __139
}
Xsqlite3TableAffinity(tls, v, pTab, regNew)
Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, 127, pChanges,
1, pTab, regOldRowid, onError, labelContinue)
+ if !(!(isView != 0)) {
+ goto __140
+ }
// The row-trigger may have deleted the row being updated. In this
// case, jump to the next row. No updates or AFTER triggers are
// required. This behavior - what happens when the row being updated
// is deleted or renamed by a BEFORE trigger - is left undefined in the
// documentation.
if !(pPk != 0) {
- goto __121
+ goto __141
}
Xsqlite3VdbeAddOp4Int(tls, v, 29, iDataCur, labelContinue, regKey, nKey)
- goto __122
-__121:
+ goto __142
+__141:
Xsqlite3VdbeAddOp3(tls, v, 32, iDataCur, labelContinue, regOldRowid)
-__122:
+__142:
;
// After-BEFORE-trigger-reload-loop:
@@ -114482,49 +118685,51 @@ __122:
// for an example.
i = 0
k = regNew
-__123:
+__143:
if !(i < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) {
- goto __125
+ goto __145
}
if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & 0x0060) != 0) {
- goto __126
+ goto __146
}
if !((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*32)).FcolFlags) & 0x0020) != 0) {
- goto __128
+ goto __148
}
k--
-__128:
+__148:
;
- goto __127
-__126:
+ goto __147
+__146:
if !((*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) < 0) && (i != int32((*Table)(unsafe.Pointer(pTab)).FiPKey))) {
- goto __129
+ goto __149
}
Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k)
-__129:
+__149:
;
-__127:
+__147:
;
- goto __124
-__124:
+ goto __144
+__144:
i++
k++
- goto __123
- goto __125
-__125:
+ goto __143
+ goto __145
+__145:
;
if !(((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(0x0060)) != 0) {
- goto __130
+ goto __150
}
Xsqlite3ComputeGeneratedColumns(tls, pParse, regNew, pTab)
-__130:
+__150:
;
-__120:
+__140:
+ ;
+__139:
;
if !(!(isView != 0)) {
- goto __131
+ goto __151
}
// Do constraint checks.
@@ -114536,26 +118741,26 @@ __120:
// row is changing, then the GenerateConstraintChecks() above may have
// moved cursor iDataCur. Reseek it.
if !((*(*int32)(unsafe.Pointer(bp + 104 /* bReplace */)) != 0) || (chngKey != 0)) {
- goto __132
+ goto __152
}
if !(pPk != 0) {
- goto __133
+ goto __153
}
Xsqlite3VdbeAddOp4Int(tls, v, 29, iDataCur, labelContinue, regKey, nKey)
- goto __134
-__133:
+ goto __154
+__153:
Xsqlite3VdbeAddOp3(tls, v, 32, iDataCur, labelContinue, regOldRowid)
-__134:
+__154:
;
-__132:
+__152:
;
// Do FK constraint checks.
if !(hasFK != 0) {
- goto __135
+ goto __155
}
Xsqlite3FkCheck(tls, pParse, pTab, regOldRowid, 0, aXRef, int32(chngKey))
-__135:
+__155:
;
// Delete the index entries associated with the current record.
@@ -114567,10 +118772,10 @@ __135:
// we want to avoid the OP_FinishSeek if possible, as running it
// costs CPU cycles.
if !(bFinishSeek != 0) {
- goto __136
+ goto __156
}
Xsqlite3VdbeAddOp1(tls, v, 135, iDataCur)
-__136:
+__156:
;
// If changing the rowid value, or if there are foreign key constraints
@@ -114582,18 +118787,33 @@ __136:
// value is copied from memory cell (regNewRowid+1+iCol), where iCol
// is the column index supplied by the user.
- if !((hasFK > 1) || (chngKey != 0)) {
- goto __137
+ Xsqlite3VdbeAddOp3(tls, v, 122, iDataCur,
+ (0x04 | (func() int32 {
+ if (hasFK > 1) || (chngKey != 0) {
+ return 0
+ }
+ return 0x40
+ }())),
+ regNewRowid)
+ if !(eOnePass == 2) {
+ goto __157
}
- Xsqlite3VdbeAddOp2(tls, v, 122, iDataCur, 0)
-__137:
+
+ Xsqlite3VdbeChangeP5(tls, v, uint16(0x02))
+__157:
+ ;
+ if !(!(int32((*Parse)(unsafe.Pointer(pParse)).Fnested) != 0)) {
+ goto __158
+ }
+ Xsqlite3VdbeAppendP4(tls, v, pTab, -6)
+__158:
;
if !(hasFK != 0) {
- goto __138
+ goto __159
}
Xsqlite3FkCheck(tls, pParse, pTab, 0, regNewRowid, aXRef, int32(chngKey))
-__138:
+__159:
;
// Insert the new index entries and the new record.
@@ -114607,24 +118827,24 @@ __138:
}())),
0, 0)
- /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to
- ** handle rows (possibly in other tables) that refer via a foreign key
- ** to the row just updated. */
+ // Do any ON CASCADE, SET NULL or SET DEFAULT operations required to
+ // handle rows (possibly in other tables) that refer via a foreign key
+ // to the row just updated.
if !(hasFK != 0) {
- goto __139
+ goto __160
}
Xsqlite3FkActions(tls, pParse, pTab, pChanges, regOldRowid, aXRef, int32(chngKey))
-__139:
+__160:
;
-__131:
+__151:
;
// Increment the row counter
if !(regRowCount != 0) {
- goto __140
+ goto __161
}
Xsqlite3VdbeAddOp2(tls, v, 82, regRowCount, 1)
-__140:
+__161:
;
Xsqlite3CodeRowTrigger(tls, pParse, pTrigger, 127, pChanges,
@@ -114633,30 +118853,30 @@ __140:
// Repeat the above with the next record to be updated, until
// all record selected by the WHERE clause have been updated.
if !(eOnePass == 1) {
- goto __141
+ goto __162
}
- goto __142
-__141:
+ goto __163
+__162:
if !(eOnePass == 2) {
- goto __143
+ goto __164
}
Xsqlite3VdbeResolveLabel(tls, v, labelContinue)
Xsqlite3WhereEnd(tls, pWInfo)
- goto __144
-__143:
- if !(pPk != 0) {
- goto __145
+ goto __165
+__164:
+ if !((pPk != 0) || (nChangeFrom != 0)) {
+ goto __166
}
Xsqlite3VdbeResolveLabel(tls, v, labelContinue)
Xsqlite3VdbeAddOp2(tls, v, 5, iEph, addrTop)
- goto __146
-__145:
+ goto __167
+__166:
Xsqlite3VdbeGoto(tls, v, labelContinue)
-__146:
+__167:
;
-__144:
+__165:
;
-__142:
+__163:
;
Xsqlite3VdbeResolveLabel(tls, v, labelBreak)
@@ -114664,21 +118884,21 @@ __142:
// maximum rowid counter values recorded while inserting into
// autoincrement tables.
if !(((int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0) && ((*Parse)(unsafe.Pointer(pParse)).FpTriggerTab == uintptr(0))) && (pUpsert == uintptr(0))) {
- goto __147
+ goto __168
}
Xsqlite3AutoincrementEnd(tls, pParse)
-__147:
+__168:
;
// Return the number of rows that were changed, if we are tracking
// that information.
if !(regRowCount != 0) {
- goto __148
+ goto __169
}
Xsqlite3VdbeAddOp2(tls, v, 80, regRowCount, 1)
Xsqlite3VdbeSetNumCols(tls, v, 1)
- Xsqlite3VdbeSetColName(tls, v, 0, 0, ts+18280 /* "rows updated" */, uintptr(0))
-__148:
+ Xsqlite3VdbeSetColName(tls, v, 0, 0, ts+22009 /* "rows updated" */, uintptr(0))
+__169:
;
update_cleanup:
@@ -114713,7 +118933,7 @@ update_cleanup:
// The "onepass" strategy does not use an ephemeral table. Instead, it
// stores the same values (A, B and C above) in a register array and
// makes a single invocation of VUpdate.
-func updateVirtualTable(tls *crt.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pChanges uintptr, pRowid uintptr, aXRef uintptr, pWhere uintptr, onError int32) { /* sqlite3.c:138161:13: */
+func updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintptr, pChanges uintptr, pRowid uintptr, aXRef uintptr, pWhere uintptr, onError int32) { /* sqlite3.c:138757:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -114722,7 +118942,7 @@ func updateVirtualTable(tls *crt.TLS, pParse uintptr, pSrc uintptr, pTab uintptr
var i int32 // Loop counter
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database connection
var pVTab uintptr = Xsqlite3GetVTable(tls, db, pTab)
- var pWInfo uintptr
+ var pWInfo uintptr = uintptr(0)
var nArg int32 = (2 + int32((*Table)(unsafe.Pointer(pTab)).FnCol)) // Number of arguments to VUpdate
var regArg int32 // First register in VUpdate arg array
var regRec int32 // Register in which to assemble record
@@ -114737,67 +118957,93 @@ func updateVirtualTable(tls *crt.TLS, pParse uintptr, pSrc uintptr, pTab uintptr
// create and open the ephemeral table in which the records created from
// these arguments will be temporarily stored.
- ephemTab = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ ephemTab = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
addr = Xsqlite3VdbeAddOp2(tls, v, 100, ephemTab, nArg)
regArg = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nArg)
- regRec = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- regRowid = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc > 1 {
+ var pRow uintptr
+ var pList uintptr
+ if pRowid != 0 {
+ pRow = Xsqlite3ExprDup(tls, db, pRowid, 0)
+ } else {
+ pRow = Xsqlite3PExpr(tls, pParse, 75, uintptr(0), uintptr(0))
+ }
+ pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), pRow)
- // Start scanning the virtual table
- pWInfo = Xsqlite3WhereBegin(tls, pParse, pSrc, pWhere, uintptr(0), uintptr(0), uint16(0x0004), 0)
- if pWInfo == uintptr(0) {
- return
- }
+ for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
+ if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 {
+ pList = Xsqlite3ExprListAppend(tls, pParse, pList,
+ Xsqlite3ExprDup(tls, db, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*32)).FpExpr, 0))
+ } else {
+ pList = Xsqlite3ExprListAppend(tls, pParse, pList, exprRowColumn(tls, pParse, i))
+ }
+ }
- // Populate the argument registers.
- for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
+ updateFromSelect(tls, pParse, ephemTab, uintptr(0), pList, pSrc, pWhere, uintptr(0), uintptr(0))
+ Xsqlite3ExprListDelete(tls, db, pList)
+ eOnePass = 0
+ } else {
+ regRec = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 {
- Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*32)).FpExpr, ((regArg + 2) + i))
- } else {
- Xsqlite3VdbeAddOp3(tls, v, 166, iCsr, i, ((regArg + 2) + i))
- Xsqlite3VdbeChangeP5(tls, v, uint16(0x01))
+ // Start scanning the virtual table
+ pWInfo = Xsqlite3WhereBegin(tls, pParse, pSrc, pWhere, uintptr(0), uintptr(0), uint16(0x0004), 0)
+ if pWInfo == uintptr(0) {
+ return
}
- }
- if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0) {
- Xsqlite3VdbeAddOp2(tls, v, 127, iCsr, regArg)
- if pRowid != 0 {
- Xsqlite3ExprCode(tls, pParse, pRowid, (regArg + 1))
- } else {
- Xsqlite3VdbeAddOp2(tls, v, 127, iCsr, (regArg + 1))
+
+ // Populate the argument registers.
+ for i = 0; i < int32((*Table)(unsafe.Pointer(pTab)).FnCol); i++ {
+
+ if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 {
+ Xsqlite3ExprCode(tls, pParse, (*ExprList_item)(unsafe.Pointer((pChanges+8 /* &.a */)+uintptr(*(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)))*32)).FpExpr, ((regArg + 2) + i))
+ } else {
+ Xsqlite3VdbeAddOp3(tls, v, 166, iCsr, i, ((regArg + 2) + i))
+ Xsqlite3VdbeChangeP5(tls, v, uint16(0x01))
+ }
}
- } else {
- var pPk uintptr // PRIMARY KEY index
- var iPk I16 // PRIMARY KEY column
- pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
+ if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0) {
+ Xsqlite3VdbeAddOp2(tls, v, 127, iCsr, regArg)
+ if pRowid != 0 {
+ Xsqlite3ExprCode(tls, pParse, pRowid, (regArg + 1))
+ } else {
+ Xsqlite3VdbeAddOp2(tls, v, 127, iCsr, (regArg + 1))
+ }
+ } else {
+ var pPk uintptr // PRIMARY KEY index
+ var iPk I16 // PRIMARY KEY column
+ pPk = Xsqlite3PrimaryKeyIndex(tls, pTab)
- iPk = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(0)*2))
- Xsqlite3VdbeAddOp3(tls, v, 166, iCsr, int32(iPk), regArg)
- Xsqlite3VdbeAddOp2(tls, v, 78, ((regArg + 2) + int32(iPk)), (regArg + 1))
- }
+ iPk = *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(0)*2))
+ Xsqlite3VdbeAddOp3(tls, v, 166, iCsr, int32(iPk), regArg)
+ Xsqlite3VdbeAddOp2(tls, v, 78, ((regArg + 2) + int32(iPk)), (regArg + 1))
+ }
- eOnePass = Xsqlite3WhereOkOnePass(tls, pWInfo, bp /* &aDummy[0] */)
+ eOnePass = Xsqlite3WhereOkOnePass(tls, pWInfo, bp /* &aDummy[0] */)
- // There is no ONEPASS_MULTI on virtual tables
+ // There is no ONEPASS_MULTI on virtual tables
- if eOnePass != 0 {
- // If using the onepass strategy, no-op out the OP_OpenEphemeral coded
- // above.
- Xsqlite3VdbeChangeToNoop(tls, v, addr)
- Xsqlite3VdbeAddOp1(tls, v, 116, iCsr)
- } else {
- // Create a record from the argument register contents and insert it into
- // the ephemeral table.
- Xsqlite3MultiWrite(tls, pParse)
- Xsqlite3VdbeAddOp3(tls, v, 91, regArg, nArg, regRec)
- Xsqlite3VdbeAddOp2(tls, v, 120, ephemTab, regRowid)
- Xsqlite3VdbeAddOp3(tls, v, 121, ephemTab, regRec, regRowid)
+ if eOnePass != 0 {
+ // If using the onepass strategy, no-op out the OP_OpenEphemeral coded
+ // above.
+ Xsqlite3VdbeChangeToNoop(tls, v, addr)
+ Xsqlite3VdbeAddOp1(tls, v, 116, iCsr)
+ } else {
+ // Create a record from the argument register contents and insert it into
+ // the ephemeral table.
+ Xsqlite3MultiWrite(tls, pParse)
+ Xsqlite3VdbeAddOp3(tls, v, 91, regArg, nArg, regRec)
+ Xsqlite3VdbeAddOp2(tls, v, 120, ephemTab, regRowid)
+ Xsqlite3VdbeAddOp3(tls, v, 121, ephemTab, regRec, regRowid)
+ }
}
if eOnePass == 0 {
// End the virtual table scan
- Xsqlite3WhereEnd(tls, pWInfo)
+ if (*SrcList)(unsafe.Pointer(pSrc)).FnSrc == 1 {
+ Xsqlite3WhereEnd(tls, pWInfo)
+ }
// Begin scannning through the ephemeral table.
addr = Xsqlite3VdbeAddOp1(tls, v, 37, ephemTab)
@@ -114846,7 +119092,7 @@ func updateVirtualTable(tls *crt.TLS, pParse uintptr, pSrc uintptr, pTab uintptr
// #include "sqliteInt.h"
// Free a list of Upsert objects
-func Xsqlite3UpsertDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:138306:21: */
+func Xsqlite3UpsertDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:138929:21: */
if p != 0 {
Xsqlite3ExprListDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTarget)
Xsqlite3ExprDelete(tls, db, (*Upsert)(unsafe.Pointer(p)).FpUpsertTargetWhere)
@@ -114857,7 +119103,7 @@ func Xsqlite3UpsertDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:13
}
// Duplicate an Upsert object.
-func Xsqlite3UpsertDup(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:138319:23: */
+func Xsqlite3UpsertDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:138942:23: */
if p == uintptr(0) {
return uintptr(0)
}
@@ -114869,7 +119115,7 @@ func Xsqlite3UpsertDup(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3
}
// Create a new Upsert object.
-func Xsqlite3UpsertNew(tls *crt.TLS, db uintptr, pTarget uintptr, pTargetWhere uintptr, pSet uintptr, pWhere uintptr) uintptr { /* sqlite3.c:138332:23: */
+func Xsqlite3UpsertNew(tls *libc.TLS, db uintptr, pTarget uintptr, pTargetWhere uintptr, pSet uintptr, pWhere uintptr) uintptr { /* sqlite3.c:138955:23: */
var pNew uintptr
pNew = Xsqlite3DbMallocRaw(tls, db, uint64(unsafe.Sizeof(Upsert{})))
if pNew == uintptr(0) {
@@ -114893,7 +119139,7 @@ func Xsqlite3UpsertNew(tls *crt.TLS, db uintptr, pTarget uintptr, pTargetWhere u
//
// Return SQLITE_OK if everything works, or an error code is something
// is wrong.
-func Xsqlite3UpsertAnalyzeTarget(tls *crt.TLS, pParse uintptr, pTabList uintptr, pUpsert uintptr) int32 { /* sqlite3.c:138364:20: */
+func Xsqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr, pUpsert uintptr) int32 { /* sqlite3.c:138987:20: */
bp := tls.Alloc(200)
defer tls.Free(200)
@@ -114911,7 +119157,7 @@ func Xsqlite3UpsertAnalyzeTarget(tls *crt.TLS, pParse uintptr, pTabList uintptr,
// Resolve all symbolic names in the conflict-target clause, which
// includes both the list of columns and the optional partial-index
// WHERE clause.
- crt.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
+ libc.Xmemset(tls, bp /* &sNC */, 0, uint64(unsafe.Sizeof(NameContext{})))
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpParse = pParse
(*NameContext)(unsafe.Pointer(bp /* &sNC */)).FpSrcList = pTabList
rc = Xsqlite3ResolveExprListNames(tls, bp /* &sNC */, (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget)
@@ -114923,13 +119169,13 @@ func Xsqlite3UpsertAnalyzeTarget(tls *crt.TLS, pParse uintptr, pTabList uintptr,
return rc
}
- /* Check to see if the conflict target matches the rowid. */
+ // Check to see if the conflict target matches the rowid.
pTab = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(0)*112)).FpTab
pTarget = (*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget
iCursor = (*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(0)*112)).FiCursor
if (((((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) &&
((*ExprList)(unsafe.Pointer(pTarget)).FnExpr == 1)) &&
- (int32((*Expr)(unsafe.Pointer((crt.AssignUintptr(&pTerm, (*ExprList_item)(unsafe.Pointer((pTarget+8 /* &.a */)+uintptr(0)*32)).FpExpr)))).Fop) == 164)) &&
+ (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pTerm, (*ExprList_item)(unsafe.Pointer((pTarget+8 /* &.a */)+uintptr(0)*32)).FpExpr)))).Fop) == 164)) &&
(int32((*Expr)(unsafe.Pointer(pTerm)).FiColumn) == (-1)) {
// The conflict-target is the rowid of the primary table
@@ -114941,7 +119187,7 @@ func Xsqlite3UpsertAnalyzeTarget(tls *crt.TLS, pParse uintptr, pTabList uintptr,
// operator and sCol[1] will be the TK_COLUMN operator. Code below
// will populate the specific collation and column number values
// prior to comparing against the conflict-target expression.
- crt.Xmemset(tls, bp+56 /* &sCol[0] */, 0, uint64(unsafe.Sizeof([2]Expr{})))
+ libc.Xmemset(tls, bp+56 /* &sCol[0] */, 0, uint64(unsafe.Sizeof([2]Expr{})))
(*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + uintptr(0)*72)).Fop = U8(111)
(*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + uintptr(0)*72)).FpLeft = (bp + 56 /* &sCol */ + uintptr(1)*72)
(*Expr)(unsafe.Pointer(bp + 56 /* &sCol */ + uintptr(1)*72)).Fop = U8(164)
@@ -115002,7 +119248,7 @@ func Xsqlite3UpsertAnalyzeTarget(tls *crt.TLS, pParse uintptr, pTabList uintptr,
return 0
}
Xsqlite3ErrorMsg(tls, pParse,
- ts+18293 /* "ON CONFLICT clau..." */, 0)
+ ts+22022 /* "ON CONFLICT clau..." */, 0)
return 1
}
@@ -115013,13 +119259,17 @@ func Xsqlite3UpsertAnalyzeTarget(tls *crt.TLS, pParse uintptr, pTabList uintptr,
// currently points to the conflicting table row. Otherwise, if pIdx
// is not NULL, then pIdx is the constraint that failed and iCur is a
// cursor points to the conflicting row.
-func Xsqlite3UpsertDoUpdate(tls *crt.TLS, pParse uintptr, pUpsert uintptr, pTab uintptr, pIdx uintptr, iCur int32) { /* sqlite3.c:138482:21: */
+func Xsqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab uintptr, pIdx uintptr, iCur int32) { /* sqlite3.c:139105:21: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pSrc uintptr // FROM clause for the UPDATE
var iDataCur int32
var i int32
+ Xsqlite3VdbeNoopComment(tls, v, ts+22093 /* "Begin DO UPDATE ..." */, 0)
iDataCur = (*Upsert)(unsafe.Pointer(pUpsert)).FiDataCur
if (pIdx != 0) && (iCur != iDataCur) {
if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0) {
@@ -115038,12 +119288,13 @@ func Xsqlite3UpsertDoUpdate(tls *crt.TLS, pParse uintptr, pUpsert uintptr, pTab
k = int32(Xsqlite3TableColumnToIndex(tls, pIdx, *(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))))
Xsqlite3VdbeAddOp3(tls, v, 89, iCur, k, (iPk + i))
+ Xsqlite3VdbeComment(tls, v, ts+9978 /* "%s.%s" */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName, (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))*32)).FzName))
}
i = Xsqlite3VdbeAddOp4Int(tls, v, 30, iDataCur, 0, iPk, nPk)
Xsqlite3VdbeAddOp4(tls, v, 68, 11, 2, 0,
- ts+10606 /* "corrupt database" */, -1)
+ ts+13336 /* "corrupt database" */, -1)
Xsqlite3MayAbort(tls, pParse)
Xsqlite3VdbeJumpHere(tls, v, i)
}
@@ -115061,7 +119312,7 @@ func Xsqlite3UpsertDoUpdate(tls *crt.TLS, pParse uintptr, pUpsert uintptr, pTab
(*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere, 2, uintptr(0), uintptr(0), pUpsert)
(*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertSet = uintptr(0) // Will have been deleted by sqlite3Update()
(*Upsert)(unsafe.Pointer(pUpsert)).FpUpsertWhere = uintptr(0) // Will have been deleted by sqlite3Update()
-
+ Xsqlite3VdbeNoopComment(tls, v, ts+22119 /* "End DO UPDATE of..." */, 0)
}
//************* End of upsert.c *********************************************
@@ -115091,7 +119342,7 @@ func Xsqlite3UpsertDoUpdate(tls *crt.TLS, pParse uintptr, pUpsert uintptr, pTab
//
// The execSqlF() routine does the same thing, except it accepts
// a format string as its third argument
-func execSql(tls *crt.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { /* sqlite3.c:138579:12: */
+func execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { /* sqlite3.c:139202:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -115104,16 +119355,16 @@ func execSql(tls *crt.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { /
if rc != 0 {
return rc
}
- for 100 == (crt.AssignInt32(&rc, Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))))) {
+ for 100 == (libc.AssignInt32(&rc, Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))))) {
var zSubSql uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 0)
// The secondary SQL must be one of CREATE TABLE, CREATE INDEX,
// or INSERT. Historically there have been attacks that first
- // corrupt the sqlite_master.sql field with other kinds of statements
+ // corrupt the sqlite_schema.sql field with other kinds of statements
// then run VACUUM to get those statements to execute at inappropriate
// times.
if (zSubSql != 0) &&
- ((crt.Xstrncmp(tls, zSubSql, ts+18364 /* "CRE" */, uint64(3)) == 0) || (crt.Xstrncmp(tls, zSubSql, ts+18368 /* "INS" */, uint64(3)) == 0)) {
+ ((libc.Xstrncmp(tls, zSubSql, ts+22143 /* "CRE" */, uint64(3)) == 0) || (libc.Xstrncmp(tls, zSubSql, ts+22147 /* "INS" */, uint64(3)) == 0)) {
rc = execSql(tls, db, pzErrMsg, zSubSql)
if rc != 0 {
break
@@ -115130,7 +119381,7 @@ func execSql(tls *crt.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) int32 { /
Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
return rc
}
-func execSqlF(tls *crt.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uintptr) int32 { /* sqlite3.c:138609:12: */
+func execSqlF(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uintptr) int32 { /* sqlite3.c:139232:12: */
var z uintptr
var ap Va_list
_ = ap
@@ -115174,7 +119425,7 @@ func execSqlF(tls *crt.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr, va uintp
// And a power loss in between deleting the original and renaming the
// transient would cause the database file to appear to be deleted
// following reboot.
-func Xsqlite3Vacuum(tls *crt.TLS, pParse uintptr, pNm uintptr, pInto uintptr) { /* sqlite3.c:138652:21: */
+func Xsqlite3Vacuum(tls *libc.TLS, pParse uintptr, pNm uintptr, pInto uintptr) { /* sqlite3.c:139275:21: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = pNm
@@ -115217,7 +119468,7 @@ __3:
if !((pInto != 0) && (Xsqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0)) {
goto __6
}
- iIntoReg = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iIntoReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3ExprCode(tls, pParse, pInto, iIntoReg)
__6:
;
@@ -115231,7 +119482,7 @@ build_vacuum_end:
}
// This routine implements the OP_Vacuum opcode of the VDBE.
-func Xsqlite3RunVacuum(tls *crt.TLS, pzErrMsg uintptr, db uintptr, iDb int32, pOut uintptr) int32 { /* sqlite3.c:138690:36: */
+func Xsqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, pOut uintptr) int32 { /* sqlite3.c:139313:36: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -115262,14 +119513,14 @@ func Xsqlite3RunVacuum(tls *crt.TLS, pzErrMsg uintptr, db uintptr, iDb int32, pO
if !(!(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) {
goto __1
}
- Xsqlite3SetString(tls, pzErrMsg, db, ts+18372 /* "cannot VACUUM fr..." */)
+ Xsqlite3SetString(tls, pzErrMsg, db, ts+22151 /* "cannot VACUUM fr..." */)
return 1
__1:
;
if !((*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive > 1) {
goto __2
}
- Xsqlite3SetString(tls, pzErrMsg, db, ts+18412 /* "cannot VACUUM - ..." */)
+ Xsqlite3SetString(tls, pzErrMsg, db, ts+22191 /* "cannot VACUUM - ..." */)
return 1
__2:
;
@@ -115280,16 +119531,16 @@ __2:
if !(Xsqlite3_value_type(tls, pOut) != 3) {
goto __5
}
- Xsqlite3SetString(tls, pzErrMsg, db, ts+18455 /* "non-text filenam..." */)
+ Xsqlite3SetString(tls, pzErrMsg, db, ts+22234 /* "non-text filenam..." */)
return 1
__5:
;
zOut = Xsqlite3_value_text(tls, pOut)
- *(*uint32)(unsafe.Pointer(db + 76 /* &.openFlags */)) &= (^uint32(crt.Int32FromInt32(0x00000001)))
+ *(*uint32)(unsafe.Pointer(db + 76 /* &.openFlags */)) &= (^uint32(libc.Int32FromInt32(0x00000001)))
*(*uint32)(unsafe.Pointer(db + 76 /* &.openFlags */)) |= (uint32(0x00000004 | 0x00000002))
goto __4
__3:
- zOut = ts + 672 /* "" */
+ zOut = ts + 781 /* "" */
__4:
;
@@ -115303,7 +119554,7 @@ __4:
saved_mTrace = (*Sqlite3)(unsafe.Pointer(db)).FmTrace
*(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(0x00000001 | 0x00000200))
*(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) |= (U32(0x0002 | 0x0004))
- *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(crt.Uint64FromUint64(((uint64((0x00004000 | 0x00001000) |
+ *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(libc.Uint64FromUint64(((uint64((0x00004000 | 0x00001000) |
0x10000000)) | (U64((uint64(0x00001))) << 32)))))
(*Sqlite3)(unsafe.Pointer(db)).FmTrace = U8(0)
@@ -115325,7 +119576,7 @@ __4:
// time to parse and run the PRAGMA to turn journalling off than it does
// to write the journal header file.
nDb = (*Sqlite3)(unsafe.Pointer(db)).FnDb
- rc = execSqlF(tls, db, pzErrMsg, ts+18473 /* "ATTACH %Q AS vac..." */, crt.VaList(bp, zOut))
+ rc = execSqlF(tls, db, pzErrMsg, ts+22252 /* "ATTACH %Q AS vac..." */, libc.VaList(bp, zOut))
(*Sqlite3)(unsafe.Pointer(db)).FopenFlags = saved_openFlags
if !(rc != 0) {
goto __6
@@ -115346,7 +119597,7 @@ __6:
goto __8
}
rc = 1
- Xsqlite3SetString(tls, pzErrMsg, db, ts+18496 /* "output file alre..." */)
+ Xsqlite3SetString(tls, pzErrMsg, db, ts+22275 /* "output file alre..." */)
goto end_of_vacuum
__8:
;
@@ -115362,7 +119613,7 @@ __7:
// Begin a transaction and take an exclusive lock on the main database
// file. This is done before the sqlite3BtreeGetPageSize(pMain) call below,
// to ensure that we do not try to change the page-size on a WAL database.
- rc = execSql(tls, db, pzErrMsg, ts+12781 /* "BEGIN" */)
+ rc = execSql(tls, db, pzErrMsg, ts+15566 /* "BEGIN" */)
if !(rc != 0) {
goto __9
}
@@ -115413,8 +119664,8 @@ __12:
(*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(nDb) // force new CREATE statements into vacuum_db
rc = execSqlF(tls, db, pzErrMsg,
- ts+18523, /* "SELECT sql FROM ..." */
- crt.VaList(bp+8, zDbMain))
+ ts+22302, /* "SELECT sql FROM ..." */
+ libc.VaList(bp+8, zDbMain))
if !(rc != 0) {
goto __13
}
@@ -115423,8 +119674,8 @@ __13:
;
rc = execSqlF(tls, db, pzErrMsg,
- ts+18631, /* "SELECT sql FROM ..." */
- crt.VaList(bp+16, zDbMain))
+ ts+22410, /* "SELECT sql FROM ..." */
+ libc.VaList(bp+16, zDbMain))
if !(rc != 0) {
goto __14
}
@@ -115438,10 +119689,10 @@ __14:
// the contents to the temporary database.
rc = execSqlF(tls, db, pzErrMsg,
- ts+18685, /* "SELECT'INSERT IN..." */
- crt.VaList(bp+24, zDbMain))
+ ts+22464, /* "SELECT'INSERT IN..." */
+ libc.VaList(bp+24, zDbMain))
- *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (^U32(crt.Int32FromInt32(0x0004)))
+ *(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) &= (^U32(libc.Int32FromInt32(0x0004)))
if !(rc != 0) {
goto __15
}
@@ -115452,11 +119703,11 @@ __15:
// Copy the triggers, views, and virtual tables from the main database
// over to the temporary database. None of these objects has any
// associated storage, so all we have to do is copy their entries
- // from the SQLITE_MASTER table.
+ // from the schema table.
rc = execSqlF(tls, db, pzErrMsg,
- ts+18836, /* "INSERT INTO vacu..." */
- crt.VaList(bp+32, zDbMain))
+ ts+22615, /* "INSERT INTO vacu..." */
+ libc.VaList(bp+32, zDbMain))
if !(rc != 0) {
goto __16
}
@@ -115555,8 +119806,8 @@ end_of_vacuum:
__26:
;
- /* This both clears the schemas and reduces the size of the db->aDb[]
- ** array. */
+ // This both clears the schemas and reduces the size of the db->aDb[]
+ // array.
Xsqlite3ResetAllSchemasOfConnection(tls, db)
return rc
@@ -115568,7 +119819,7 @@ var aCopy = [10]uint8{
uint8(5), uint8(0), // Preserve the text encoding
uint8(6), uint8(0), // Preserve the user version
uint8(8), uint8(0), // Preserve the application id
-} /* sqlite3.c:138881:32 */
+} /* sqlite3.c:139504:32 */
// Construct and install a Module object for a virtual table. When this
// routine is called, it is guaranteed that all appropriate locks are held
@@ -115576,7 +119827,7 @@ var aCopy = [10]uint8{
//
// If there already exists a module with zName, replace it with the new one.
// If pModule==0, then delete the module zName if it exists.
-func Xsqlite3VtabCreateModule(tls *crt.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) uintptr { /* sqlite3.c:138993:23: */
+func Xsqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) uintptr { /* sqlite3.c:139616:23: */
var pMod uintptr
var pDel uintptr
var zCopy uintptr
@@ -115591,7 +119842,7 @@ func Xsqlite3VtabCreateModule(tls *crt.TLS, db uintptr, zName uintptr, pModule u
return uintptr(0)
}
zCopy = (pMod + uintptr(1)*48)
- crt.Xmemcpy(tls, zCopy, zName, (uint64(nName + 1)))
+ libc.Xmemcpy(tls, zCopy, zName, (uint64(nName + 1)))
(*Module)(unsafe.Pointer(pMod)).FzName = zCopy
(*Module)(unsafe.Pointer(pMod)).FpModule = pModule
(*Module)(unsafe.Pointer(pMod)).FpAux = pAux
@@ -115599,7 +119850,7 @@ func Xsqlite3VtabCreateModule(tls *crt.TLS, db uintptr, zName uintptr, pModule u
(*Module)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0)
(*Module)(unsafe.Pointer(pMod)).FnRefModule = 1
}
- pDel = Xsqlite3HashInsert(tls, (db + 504 /* &.aModule */), zCopy, pMod)
+ pDel = Xsqlite3HashInsert(tls, (db + 528 /* &.aModule */), zCopy, pMod)
if pDel != 0 {
if pDel == pMod {
Xsqlite3OomFault(tls, db)
@@ -115616,40 +119867,40 @@ func Xsqlite3VtabCreateModule(tls *crt.TLS, db uintptr, zName uintptr, pModule u
// The actual function that does the work of creating a new module.
// This function implements the sqlite3_create_module() and
// sqlite3_create_module_v2() interfaces.
-func createModule(tls *crt.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:139041:12: */
+func createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:139664:12: */
var rc int32 = 0
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
Xsqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy)
rc = Xsqlite3ApiExit(tls, db, rc)
if (rc != 0) && (xDestroy != 0) {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer(&xDestroy)))(tls, pAux)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&xDestroy)))(tls, pAux)
}
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return rc
}
// External API function used to create a new virtual-table module.
-func Xsqlite3_create_module(tls *crt.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr) int32 { /* sqlite3.c:139062:16: */
+func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr) int32 { /* sqlite3.c:139685:16: */
return createModule(tls, db, zName, pModule, pAux, uintptr(0))
}
// External API function used to create a new virtual-table module.
-func Xsqlite3_create_module_v2(tls *crt.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:139077:16: */
+func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) int32 { /* sqlite3.c:139700:16: */
return createModule(tls, db, zName, pModule, pAux, xDestroy)
}
// External API to drop all virtual-table modules, except those named
// on the azNames list.
-func Xsqlite3_drop_modules(tls *crt.TLS, db uintptr, azNames uintptr) int32 { /* sqlite3.c:139094:16: */
+func Xsqlite3_drop_modules(tls *libc.TLS, db uintptr, azNames uintptr) int32 { /* sqlite3.c:139717:16: */
var pThis uintptr
var pNext uintptr
- for pThis = (*Hash)(unsafe.Pointer((db + 504 /* &.aModule */))).Ffirst; pThis != 0; pThis = pNext {
+ for pThis = (*Hash)(unsafe.Pointer((db + 528 /* &.aModule */))).Ffirst; pThis != 0; pThis = pNext {
var pMod uintptr = (*HashElem)(unsafe.Pointer(pThis)).Fdata
pNext = (*HashElem)(unsafe.Pointer(pThis)).Fnext
if azNames != 0 {
var ii int32
- for ii = 0; (*(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*8)) != uintptr(0)) && (crt.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*8)), (*Module)(unsafe.Pointer(pMod)).FzName) != 0); ii++ {
+ for ii = 0; (*(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*8)) != uintptr(0)) && (libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*8)), (*Module)(unsafe.Pointer(pMod)).FzName) != 0); ii++ {
}
if *(*uintptr)(unsafe.Pointer(azNames + uintptr(ii)*8)) != uintptr(0) {
continue
@@ -115662,12 +119913,12 @@ func Xsqlite3_drop_modules(tls *crt.TLS, db uintptr, azNames uintptr) int32 { /*
// Decrement the reference count on a Module object. Destroy the
// module when the reference count reaches zero.
-func Xsqlite3VtabModuleUnref(tls *crt.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:139116:21: */
+func Xsqlite3VtabModuleUnref(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:139739:21: */
(*Module)(unsafe.Pointer(pMod)).FnRefModule--
if (*Module)(unsafe.Pointer(pMod)).FnRefModule == 0 {
if (*Module)(unsafe.Pointer(pMod)).FxDestroy != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pMod + 32 /* &.xDestroy */))))(tls, (*Module)(unsafe.Pointer(pMod)).FpAux)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pMod + 32 /* &.xDestroy */))))(tls, (*Module)(unsafe.Pointer(pMod)).FpAux)
}
Xsqlite3DbFree(tls, db, pMod)
@@ -115680,14 +119931,14 @@ func Xsqlite3VtabModuleUnref(tls *crt.TLS, db uintptr, pMod uintptr) { /* sqlite
//
// If a disconnect is attempted while a virtual table is locked,
// the disconnect is deferred until all locks have been removed.
-func Xsqlite3VtabLock(tls *crt.TLS, pVTab uintptr) { /* sqlite3.c:139136:21: */
+func Xsqlite3VtabLock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:139759:21: */
(*VTable)(unsafe.Pointer(pVTab)).FnRef++
}
// pTab is a pointer to a Table structure representing a virtual-table.
// Return a pointer to the VTable object used by connection db to access
// this virtual-table, if one has been created, or NULL otherwise.
-func Xsqlite3GetVTable(tls *crt.TLS, db uintptr, pTab uintptr) uintptr { /* sqlite3.c:139146:23: */
+func Xsqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) uintptr { /* sqlite3.c:139769:23: */
var pVtab uintptr
for pVtab = (*Table)(unsafe.Pointer(pTab)).FpVTable; (pVtab != 0) && ((*VTable)(unsafe.Pointer(pVtab)).Fdb != db); pVtab = (*VTable)(unsafe.Pointer(pVtab)).FpNext {
@@ -115697,7 +119948,7 @@ func Xsqlite3GetVTable(tls *crt.TLS, db uintptr, pTab uintptr) uintptr { /* sqli
// Decrement the ref-count on a virtual table object. When the ref-count
// reaches zero, call the xDisconnect() method to delete the object.
-func Xsqlite3VtabUnlock(tls *crt.TLS, pVTab uintptr) { /* sqlite3.c:139157:21: */
+func Xsqlite3VtabUnlock(tls *libc.TLS, pVTab uintptr) { /* sqlite3.c:139780:21: */
var db uintptr = (*VTable)(unsafe.Pointer(pVTab)).Fdb
(*VTable)(unsafe.Pointer(pVTab)).FnRef--
@@ -115705,7 +119956,7 @@ func Xsqlite3VtabUnlock(tls *crt.TLS, pVTab uintptr) { /* sqlite3.c:139157:21: *
var p uintptr = (*VTable)(unsafe.Pointer(pVTab)).FpVtab
Xsqlite3VtabModuleUnref(tls, (*VTable)(unsafe.Pointer(pVTab)).Fdb, (*VTable)(unsafe.Pointer(pVTab)).FpMod)
if p != 0 {
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vtab)(unsafe.Pointer(p)).FpModule + 32 /* &.xDisconnect */))))(tls, p)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vtab)(unsafe.Pointer(p)).FpModule + 32 /* &.xDisconnect */))))(tls, p)
}
Xsqlite3DbFree(tls, db, pVTab)
}
@@ -115716,7 +119967,7 @@ func Xsqlite3VtabUnlock(tls *crt.TLS, pVTab uintptr) { /* sqlite3.c:139157:21: *
// database connections to be disconnected at the next opportunity.
// Except, if argument db is not NULL, then the entry associated with
// connection db is left in the p->pVTable list.
-func vtabDisconnectAll(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:139182:15: */
+func vtabDisconnectAll(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:139805:15: */
var pRet uintptr = uintptr(0)
var pVTable uintptr = (*Table)(unsafe.Pointer(p)).FpVTable
(*Table)(unsafe.Pointer(p)).FpVTable = uintptr(0)
@@ -115751,7 +120002,7 @@ func vtabDisconnectAll(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3
// used when closing database connection db to free all of its VTable
// objects without disturbing the rest of the Schema object (which may
// be being used by other shared-cache connections).
-func Xsqlite3VtabDisconnect(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:139222:21: */
+func Xsqlite3VtabDisconnect(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:139845:21: */
var ppVTab uintptr
for ppVTab = (p + 96 /* &.pVTable */); *(*uintptr)(unsafe.Pointer(ppVTab)) != 0; ppVTab = (*(*uintptr)(unsafe.Pointer(ppVTab)) + 40 /* &.pNext */) {
@@ -115782,7 +120033,7 @@ func Xsqlite3VtabDisconnect(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:
//
// As a result, a sqlite3.pDisconnect cannot be accessed simultaneously
// by multiple threads. It is thread-safe.
-func Xsqlite3VtabUnlockList(tls *crt.TLS, db uintptr) { /* sqlite3.c:139260:21: */
+func Xsqlite3VtabUnlockList(tls *libc.TLS, db uintptr) { /* sqlite3.c:139883:21: */
var p uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpDisconnect
if p != 0 {
@@ -115808,7 +120059,7 @@ func Xsqlite3VtabUnlockList(tls *crt.TLS, db uintptr) { /* sqlite3.c:139260:21:
// structure being xDisconnected and free). Any other VTable structures
// in the list are moved to the sqlite3.pDisconnect list of the associated
// database connection.
-func Xsqlite3VtabClear(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:139291:21: */
+func Xsqlite3VtabClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:139914:21: */
if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0)) {
vtabDisconnectAll(tls, uintptr(0), p)
}
@@ -115827,7 +120078,7 @@ func Xsqlite3VtabClear(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:13929
// The string is not copied - the pointer is stored. The
// string will be freed automatically when the table is
// deleted.
-func addModuleArgument(tls *crt.TLS, pParse uintptr, pTable uintptr, zArg uintptr) { /* sqlite3.c:139308:13: */
+func addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uintptr) { /* sqlite3.c:139931:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -115835,13 +120086,13 @@ func addModuleArgument(tls *crt.TLS, pParse uintptr, pTable uintptr, zArg uintpt
var azModuleArg uintptr
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if ((*Table)(unsafe.Pointer(pTable)).FnModuleArg + 3) >= *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(2)*4)) {
- Xsqlite3ErrorMsg(tls, pParse, ts+10785 /* "too many columns..." */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+13515 /* "too many columns..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName))
}
azModuleArg = Xsqlite3DbRealloc(tls, db, (*Table)(unsafe.Pointer(pTable)).FazModuleArg, uint64(nBytes))
if azModuleArg == uintptr(0) {
Xsqlite3DbFree(tls, db, zArg)
} else {
- var i int32 = crt.PostIncInt32(&(*Table)(unsafe.Pointer(pTable)).FnModuleArg, 1)
+ var i int32 = libc.PostIncInt32(&(*Table)(unsafe.Pointer(pTable)).FnModuleArg, 1)
*(*uintptr)(unsafe.Pointer(azModuleArg + uintptr(i)*8)) = zArg
*(*uintptr)(unsafe.Pointer(azModuleArg + uintptr((i+1))*8)) = uintptr(0)
(*Table)(unsafe.Pointer(pTable)).FazModuleArg = azModuleArg
@@ -115851,7 +120102,7 @@ func addModuleArgument(tls *crt.TLS, pParse uintptr, pTable uintptr, zArg uintpt
// The parser calls this routine when it first sees a CREATE VIRTUAL TABLE
// statement. The module name has been parsed, but the optional list
// of parameters that follow the module name are still pending.
-func Xsqlite3VtabBeginParse(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pModuleName uintptr, ifNotExists int32) { /* sqlite3.c:139331:21: */
+func Xsqlite3VtabBeginParse(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pModuleName uintptr, ifNotExists int32) { /* sqlite3.c:139954:21: */
var pTable uintptr // The new virtual table
var db uintptr // Database connection
@@ -115871,7 +120122,7 @@ func Xsqlite3VtabBeginParse(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2
// Creating a virtual table invokes the authorization callback twice.
// The first invocation, to obtain permission to INSERT a row into the
- // sqlite_master table, has already been made by sqlite3StartTable().
+ // sqlite_schema table, has already been made by sqlite3StartTable().
// The second call, to obtain permission to create the table, is made now.
if (*Table)(unsafe.Pointer(pTable)).FazModuleArg != 0 {
var iDb int32 = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTable)).FpSchema)
@@ -115884,7 +120135,7 @@ func Xsqlite3VtabBeginParse(tls *crt.TLS, pParse uintptr, pName1 uintptr, pName2
// This routine takes the module argument that has been accumulating
// in pParse->zArg[] and appends it to the list of arguments on the
// virtual table currently under construction in pParse->pTable.
-func addArgumentToVtab(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:139379:13: */
+func addArgumentToVtab(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:140002:13: */
if ((*Parse)(unsafe.Pointer(pParse)).FsArg.Fz != 0) && ((*Parse)(unsafe.Pointer(pParse)).FpNewTable != 0) {
var z uintptr = (*Parse)(unsafe.Pointer(pParse)).FsArg.Fz
var n int32 = int32((*Parse)(unsafe.Pointer(pParse)).FsArg.Fn)
@@ -115895,9 +120146,9 @@ func addArgumentToVtab(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:139379:13: *
// The parser calls this routine after the CREATE VIRTUAL TABLE statement
// has been completely parsed.
-func Xsqlite3VtabFinishParse(tls *crt.TLS, pParse uintptr, pEnd uintptr) { /* sqlite3.c:139392:21: */
- bp := tls.Alloc(72)
- defer tls.Free(72)
+func Xsqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { /* sqlite3.c:140015:21: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
var pTab uintptr = (*Parse)(unsafe.Pointer(pParse)).FpNewTable // The table being constructed
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // The database connection
@@ -115913,9 +120164,9 @@ func Xsqlite3VtabFinishParse(tls *crt.TLS, pParse uintptr, pEnd uintptr) { /* sq
// If the CREATE VIRTUAL TABLE statement is being entered for the
// first time (in other words if the virtual table is actually being
- // created now instead of just being read out of sqlite_master) then
+ // created now instead of just being read out of sqlite_schema) then
// do additional initialization work and store the statement text
- // in the sqlite_master table.
+ // in the sqlite_schema table.
if !(int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) != 0) {
var zStmt uintptr
var zWhere uintptr
@@ -115929,20 +120180,20 @@ func Xsqlite3VtabFinishParse(tls *crt.TLS, pParse uintptr, pEnd uintptr) { /* sq
if pEnd != 0 {
(*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fn = (uint32((int32((int64((*Token)(unsafe.Pointer(pEnd)).Fz) - int64((*Parse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) / 1))) + (*Token)(unsafe.Pointer(pEnd)).Fn)
}
- zStmt = Xsqlite3MPrintf(tls, db, ts+18966 /* "CREATE VIRTUAL T..." */, crt.VaList(bp, (pParse+248 /* &.sNameToken */)))
+ zStmt = Xsqlite3MPrintf(tls, db, ts+22745 /* "CREATE VIRTUAL T..." */, libc.VaList(bp, (pParse+248 /* &.sNameToken */)))
// A slot for the record has already been allocated in the
- // SQLITE_MASTER table. We just need to update that slot with all
+ // schema table. We just need to update that slot with all
// the information we've collected.
//
// The VM register number pParse->regRowid holds the rowid of an
- // entry in the sqlite_master table tht was created for this vtab
+ // entry in the sqlite_schema table tht was created for this vtab
// by sqlite3StartTable().
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
Xsqlite3NestedParse(tls, pParse,
- ts+18990, /* "UPDATE %Q.%s SET..." */
- crt.VaList(bp+8, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName, ts+5324, /* "sqlite_master" */
+ ts+22769, /* "UPDATE %Q.sqlite..." */
+ libc.VaList(bp+8, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(iDb)*32)).FzDbSName,
(*Table)(unsafe.Pointer(pTab)).FzName,
(*Table)(unsafe.Pointer(pTab)).FzName,
zStmt,
@@ -115951,11 +120202,11 @@ func Xsqlite3VtabFinishParse(tls *crt.TLS, pParse uintptr, pEnd uintptr) { /* sq
Xsqlite3ChangeCookie(tls, pParse, iDb)
Xsqlite3VdbeAddOp0(tls, v, 158)
- zWhere = Xsqlite3MPrintf(tls, db, ts+19078 /* "name=%Q AND sql=..." */, crt.VaList(bp+56, (*Table)(unsafe.Pointer(pTab)).FzName, zStmt))
+ zWhere = Xsqlite3MPrintf(tls, db, ts+22868 /* "name=%Q AND sql=..." */, libc.VaList(bp+48, (*Table)(unsafe.Pointer(pTab)).FzName, zStmt))
Xsqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere)
Xsqlite3DbFree(tls, db, zStmt)
- iReg = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeLoadString(tls, v, iReg, (*Table)(unsafe.Pointer(pTab)).FzName)
Xsqlite3VdbeAddOp2(tls, v, 163, iDb, iReg)
} else {
@@ -115975,7 +120226,7 @@ func Xsqlite3VtabFinishParse(tls *crt.TLS, pParse uintptr, pEnd uintptr) { /* sq
// The parser calls this routine when it sees the first token
// of an argument to the module name in a CREATE VIRTUAL TABLE statement.
-func Xsqlite3VtabArgInit(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:139478:21: */
+func Xsqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:140101:21: */
addArgumentToVtab(tls, pParse)
(*Parse)(unsafe.Pointer(pParse)).FsArg.Fz = uintptr(0)
(*Parse)(unsafe.Pointer(pParse)).FsArg.Fn = uint32(0)
@@ -115983,7 +120234,7 @@ func Xsqlite3VtabArgInit(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:139478:21:
// The parser calls this routine for each token after the first token
// in an argument to the module name in a CREATE VIRTUAL TABLE statement.
-func Xsqlite3VtabArgExtend(tls *crt.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:139488:21: */
+func Xsqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:140111:21: */
var pArg uintptr = (pParse + 360 /* &.sArg */)
if (*Token)(unsafe.Pointer(pArg)).Fz == uintptr(0) {
(*Token)(unsafe.Pointer(pArg)).Fz = (*Token)(unsafe.Pointer(p)).Fz
@@ -115997,7 +120248,7 @@ func Xsqlite3VtabArgExtend(tls *crt.TLS, pParse uintptr, p uintptr) { /* sqlite3
// Invoke a virtual table constructor (either xCreate or xConnect). The
// pointer to the function to invoke is passed as the fourth parameter
// to this procedure.
-func vtabCallConstructor(tls *crt.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) int32 { /* sqlite3.c:139504:12: */
+func vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) int32 { /* sqlite3.c:140127:12: */
bp := tls.Alloc(72)
defer tls.Free(72)
@@ -116016,7 +120267,7 @@ func vtabCallConstructor(tls *crt.TLS, db uintptr, pTab uintptr, pMod uintptr, x
for pCtx = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx; pCtx != 0; pCtx = (*VtabCtx)(unsafe.Pointer(pCtx)).FpPrior {
if (*VtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab {
*(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db,
- ts+19097 /* "vtable construct..." */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
+ ts+22887 /* "vtable construct..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName))
return 6
}
}
@@ -116046,7 +120297,7 @@ func vtabCallConstructor(tls *crt.TLS, db uintptr, pTab uintptr, pMod uintptr, x
(*VtabCtx)(unsafe.Pointer(bp + 32 /* &sCtx */)).FpPrior = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx
(*VtabCtx)(unsafe.Pointer(bp + 32 /* &sCtx */)).FbDeclared = 0
(*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp + 32 /* &sCtx */
- rc = (*(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&xConstruct)))(tls, db, (*Module)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, (pVTable + 16 /* &.pVtab */), bp+64 /* &zErr */)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&xConstruct)))(tls, db, (*Module)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, (pVTable + 16 /* &.pVtab */), bp+64 /* &zErr */)
(*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*VtabCtx)(unsafe.Pointer(bp + 32 /* &sCtx */)).FpPrior
if rc == 7 {
Xsqlite3OomFault(tls, db)
@@ -116054,22 +120305,22 @@ func vtabCallConstructor(tls *crt.TLS, db uintptr, pTab uintptr, pMod uintptr, x
if 0 != rc {
if *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)) == uintptr(0) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+19139 /* "vtable construct..." */, crt.VaList(bp+8, zModuleName))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+22929 /* "vtable construct..." */, libc.VaList(bp+8, zModuleName))
} else {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+696 /* "%s" */, crt.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+805 /* "%s" */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */))))
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)))
}
Xsqlite3DbFree(tls, db, pVTable)
} else if (*VTable)(unsafe.Pointer(pVTable)).FpVtab != 0 {
// Justification of ALWAYS(): A correct vtab constructor must allocate
// the sqlite3_vtab object if successful.
- crt.Xmemset(tls, (*VTable)(unsafe.Pointer(pVTable)).FpVtab, 0, uint64(unsafe.Sizeof(Sqlite3_vtab{})))
+ libc.Xmemset(tls, (*VTable)(unsafe.Pointer(pVTable)).FpVtab, 0, uint64(unsafe.Sizeof(Sqlite3_vtab{})))
(*Sqlite3_vtab)(unsafe.Pointer((*VTable)(unsafe.Pointer(pVTable)).FpVtab)).FpModule = (*Module)(unsafe.Pointer(pMod)).FpModule
(*Module)(unsafe.Pointer(pMod)).FnRefModule++
(*VTable)(unsafe.Pointer(pVTable)).FnRef = 1
if (*VtabCtx)(unsafe.Pointer(bp+32 /* &sCtx */)).FbDeclared == 0 {
- var zFormat uintptr = ts + 19169 /* "vtable construct..." */
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, zFormat, crt.VaList(bp+24, (*Table)(unsafe.Pointer(pTab)).FzName))
+ var zFormat uintptr = ts + 22959 /* "vtable construct..." */
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+24, (*Table)(unsafe.Pointer(pTab)).FzName))
Xsqlite3VtabUnlock(tls, pVTable)
rc = 1
} else {
@@ -116084,12 +120335,12 @@ func vtabCallConstructor(tls *crt.TLS, db uintptr, pTab uintptr, pMod uintptr, x
(*Table)(unsafe.Pointer(pTab)).FpVTable = pVTable
for iCol = 0; iCol < int32((*Table)(unsafe.Pointer(pTab)).FnCol); iCol++ {
- var zType uintptr = Xsqlite3ColumnType(tls, ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32), ts+672 /* "" */)
+ var zType uintptr = Xsqlite3ColumnType(tls, ((*Table)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*32), ts+781 /* "" */)
var nType int32
var i int32 = 0
nType = Xsqlite3Strlen30(tls, zType)
for i = 0; i < nType; i++ {
- if ((0 == Xsqlite3_strnicmp(tls, ts+14196 /* "hidden" */, (zType+uintptr(i)), 6)) &&
+ if ((0 == Xsqlite3_strnicmp(tls, ts+17185 /* "hidden" */, (zType+uintptr(i)), 6)) &&
((i == 0) || (int32(*(*int8)(unsafe.Pointer(zType + uintptr((i - 1))))) == ' '))) &&
((int32(*(*int8)(unsafe.Pointer(zType + uintptr((i + 6))))) == 0) || (int32(*(*int8)(unsafe.Pointer(zType + uintptr((i + 6))))) == ' ')) {
break
@@ -116128,7 +120379,7 @@ func vtabCallConstructor(tls *crt.TLS, db uintptr, pTab uintptr, pMod uintptr, x
// and an error left in pParse.
//
// This call is a no-op if table pTab is not a virtual table.
-func Xsqlite3VtabCallConnect(tls *crt.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:139636:20: */
+func Xsqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) int32 { /* sqlite3.c:140259:20: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -116143,17 +120394,17 @@ func Xsqlite3VtabCallConnect(tls *crt.TLS, pParse uintptr, pTab uintptr) int32 {
// Locate the required virtual table module
zMod = *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg + uintptr(0)*8))
- pMod = Xsqlite3HashFind(tls, (db + 504 /* &.aModule */), zMod)
+ pMod = Xsqlite3HashFind(tls, (db + 528 /* &.aModule */), zMod)
if !(pMod != 0) {
var zModule uintptr = *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg + uintptr(0)*8))
- Xsqlite3ErrorMsg(tls, pParse, ts+19215 /* "no such module: ..." */, crt.VaList(bp, zModule))
+ Xsqlite3ErrorMsg(tls, pParse, ts+23005 /* "no such module: ..." */, libc.VaList(bp, zModule))
rc = 1
} else {
*(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)) = uintptr(0)
rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp+16 /* &zErr */)
if rc != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+696 /* "%s" */, crt.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+805 /* "%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */))))
(*Parse)(unsafe.Pointer(pParse)).Frc = rc
}
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)))
@@ -116164,7 +120415,7 @@ func Xsqlite3VtabCallConnect(tls *crt.TLS, pParse uintptr, pTab uintptr) int32 {
// Grow the db->aVTrans[] array so that there is room for at least one
// more v-table. Return SQLITE_NOMEM if a malloc fails, or SQLITE_OK otherwise.
-func growVTrans(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:139671:12: */
+func growVTrans(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140294:12: */
var ARRAY_INCR int32 = 5
// Grow the sqlite3.aVTrans array if required
@@ -116175,7 +120426,7 @@ func growVTrans(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:139671:12: */
if !(aVTrans != 0) {
return 7
}
- crt.Xmemset(tls, (aVTrans + uintptr((*Sqlite3)(unsafe.Pointer(db)).FnVTrans)*8), 0, (uint64(unsafe.Sizeof(uintptr(0))) * uint64(ARRAY_INCR)))
+ libc.Xmemset(tls, (aVTrans + uintptr((*Sqlite3)(unsafe.Pointer(db)).FnVTrans)*8), 0, (uint64(unsafe.Sizeof(uintptr(0))) * uint64(ARRAY_INCR)))
(*Sqlite3)(unsafe.Pointer(db)).FaVTrans = aVTrans
}
@@ -116184,9 +120435,9 @@ func growVTrans(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:139671:12: */
// Add the virtual table pVTab to the array sqlite3.aVTrans[]. Space should
// have already been reserved using growVTrans().
-func addToVTrans(tls *crt.TLS, db uintptr, pVTab uintptr) { /* sqlite3.c:139694:13: */
+func addToVTrans(tls *libc.TLS, db uintptr, pVTab uintptr) { /* sqlite3.c:140317:13: */
// Add pVtab to the end of sqlite3.aVTrans
- *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaVTrans + uintptr(crt.PostIncInt32(&(*Sqlite3)(unsafe.Pointer(db)).FnVTrans, 1))*8)) = pVTab
+ *(*uintptr)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaVTrans + uintptr(libc.PostIncInt32(&(*Sqlite3)(unsafe.Pointer(db)).FnVTrans, 1))*8)) = pVTab
Xsqlite3VtabLock(tls, pVTab)
}
@@ -116196,7 +120447,7 @@ func addToVTrans(tls *crt.TLS, db uintptr, pVTab uintptr) { /* sqlite3.c:139694:
// If an error occurs, *pzErr is set to point to an English language
// description of the error and an SQLITE_XXX error code is returned.
// In this case the caller must call sqlite3DbFree(db, ) on *pzErr.
-func Xsqlite3VtabCallCreate(tls *crt.TLS, db uintptr, iDb int32, zTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:139708:20: */
+func Xsqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:140331:20: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -116209,13 +120460,13 @@ func Xsqlite3VtabCallCreate(tls *crt.TLS, db uintptr, iDb int32, zTab uintptr, p
// Locate the required virtual table module
zMod = *(*uintptr)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FazModuleArg + uintptr(0)*8))
- pMod = Xsqlite3HashFind(tls, (db + 504 /* &.aModule */), zMod)
+ pMod = Xsqlite3HashFind(tls, (db + 528 /* &.aModule */), zMod)
// If the module has been registered and includes a Create method,
// invoke it now. If the module has not been registered, return an
// error. Otherwise, do nothing.
if ((pMod == uintptr(0)) || ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0))) || ((*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0)) {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+19215 /* "no such module: ..." */, crt.VaList(bp, zMod))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3MPrintf(tls, db, ts+23005 /* "no such module: ..." */, libc.VaList(bp, zMod))
rc = 1
} else {
rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer((*Module)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr)
@@ -116236,7 +120487,7 @@ func Xsqlite3VtabCallCreate(tls *crt.TLS, db uintptr, iDb int32, zTab uintptr, p
// This function is used to set the schema of a virtual table. It is only
// valid to call this function from within the xCreate() or xConnect() of a
// virtual table module.
-func Xsqlite3_declare_vtab(tls *crt.TLS, db uintptr, zCreateTable uintptr) int32 { /* sqlite3.c:139749:16: */
+func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) int32 { /* sqlite3.c:140372:16: */
bp := tls.Alloc(440)
defer tls.Free(440)
@@ -116251,11 +120502,11 @@ func Xsqlite3_declare_vtab(tls *crt.TLS, db uintptr, zCreateTable uintptr) int32
if !(pCtx != 0) || ((*VtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0) {
Xsqlite3Error(tls, db, 21)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
- return Xsqlite3MisuseError(tls, 139766)
+ return Xsqlite3MisuseError(tls, 140389)
}
pTab = (*VtabCtx)(unsafe.Pointer(pCtx)).FpTab
- crt.Xmemset(tls, bp+8 /* &sParse */, 0, uint64(unsafe.Sizeof(Parse{})))
+ libc.Xmemset(tls, bp+8 /* &sParse */, 0, uint64(unsafe.Sizeof(Parse{})))
(*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FeParseMode = U8(1)
(*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).Fdb = db
(*Parse)(unsafe.Pointer(bp + 8 /* &sParse */)).FnQueryLoop = U32(1)
@@ -116292,10 +120543,10 @@ func Xsqlite3_declare_vtab(tls *crt.TLS, db uintptr, zCreateTable uintptr) int32
} else {
Xsqlite3ErrorWithMsg(tls, db, 1, func() uintptr {
if *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */)) != 0 {
- return ts + 696 /* "%s" */
+ return ts + 805 /* "%s" */
}
return uintptr(0)
- }(), crt.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */))))
+ }(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */))))
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 432 /* zErr */)))
rc = 1
}
@@ -116317,7 +120568,7 @@ func Xsqlite3_declare_vtab(tls *crt.TLS, db uintptr, zCreateTable uintptr) int32
// when a DROP TABLE is mentioned.
//
// This call is a no-op if zTab is not a virtual table.
-func Xsqlite3VtabCallDestroy(tls *crt.TLS, db uintptr, iDb int32, zTab uintptr) int32 { /* sqlite3.c:139834:20: */
+func Xsqlite3VtabCallDestroy(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr) int32 { /* sqlite3.c:140457:20: */
var rc int32 = 0
var pTab uintptr
@@ -116338,7 +120589,7 @@ func Xsqlite3VtabCallDestroy(tls *crt.TLS, db uintptr, iDb int32, zTab uintptr)
}
(*Table)(unsafe.Pointer(pTab)).FnTabRef++
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(&xDestroy)))(tls, (*VTable)(unsafe.Pointer(p)).FpVtab)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&xDestroy)))(tls, (*VTable)(unsafe.Pointer(p)).FpVtab)
// Remove the sqlite3_vtab* from the aVTrans[] array, if applicable
if rc == 0 {
@@ -116358,7 +120609,7 @@ func Xsqlite3VtabCallDestroy(tls *crt.TLS, db uintptr, iDb int32, zTab uintptr)
// the offset of the method to call in the sqlite3_module structure.
//
// The array is cleared after invoking the callbacks.
-func callFinaliser(tls *crt.TLS, db uintptr, offset int32) { /* sqlite3.c:139875:13: */
+func callFinaliser(tls *libc.TLS, db uintptr, offset int32) { /* sqlite3.c:140498:13: */
var i int32
if (*Sqlite3)(unsafe.Pointer(db)).FaVTrans != 0 {
var aVTrans uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaVTrans
@@ -116370,7 +120621,7 @@ func callFinaliser(tls *crt.TLS, db uintptr, offset int32) { /* sqlite3.c:139875
var x uintptr
x = *(*uintptr)(unsafe.Pointer(((*Sqlite3_vtab)(unsafe.Pointer(p)).FpModule + uintptr(offset))))
if x != 0 {
- (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(&x)))(tls, p)
+ (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&x)))(tls, p)
}
}
(*VTable)(unsafe.Pointer(pVTab)).FiSavepoint = 0
@@ -116386,7 +120637,7 @@ func callFinaliser(tls *crt.TLS, db uintptr, offset int32) { /* sqlite3.c:139875
// SQLITE_OK if all xSync operations are successful.
//
// If an error message is available, leave it in p->zErrMsg.
-func Xsqlite3VtabSync(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:139903:20: */
+func Xsqlite3VtabSync(tls *libc.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:140526:20: */
var i int32
var rc int32 = 0
var aVTrans uintptr = (*Sqlite3)(unsafe.Pointer(db)).FaVTrans
@@ -116395,8 +120646,8 @@ func Xsqlite3VtabSync(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:
for i = 0; (rc == 0) && (i < (*Sqlite3)(unsafe.Pointer(db)).FnVTrans); i++ {
var x uintptr
var pVtab uintptr = (*VTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aVTrans + uintptr(i)*8)))).FpVtab
- if (pVtab != 0) && ((crt.AssignUintptr(&x, (*Sqlite3_module)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule)).FxSync)) != uintptr(0)) {
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(&x)))(tls, pVtab)
+ if (pVtab != 0) && ((libc.AssignUintptr(&x, (*Sqlite3_module)(unsafe.Pointer((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule)).FxSync)) != uintptr(0)) {
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&x)))(tls, pVtab)
Xsqlite3VtabImportErrmsg(tls, p, pVtab)
}
}
@@ -116406,14 +120657,14 @@ func Xsqlite3VtabSync(tls *crt.TLS, db uintptr, p uintptr) int32 { /* sqlite3.c:
// Invoke the xRollback method of all virtual tables in the
// sqlite3.aVTrans array. Then clear the array itself.
-func Xsqlite3VtabRollback(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:139925:20: */
+func Xsqlite3VtabRollback(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140548:20: */
callFinaliser(tls, db, int32((uintptr(0) + 136 /* &.xRollback */)))
return 0
}
// Invoke the xCommit method of all virtual tables in the
// sqlite3.aVTrans array. Then clear the array itself.
-func Xsqlite3VtabCommit(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:139934:20: */
+func Xsqlite3VtabCommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140557:20: */
callFinaliser(tls, db, int32((uintptr(0) + 128 /* &.xCommit */)))
return 0
}
@@ -116424,7 +120675,7 @@ func Xsqlite3VtabCommit(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:139934:20
//
// If the xBegin call is successful, place the sqlite3_vtab pointer
// in the sqlite3.aVTrans array.
-func Xsqlite3VtabBegin(tls *crt.TLS, db uintptr, pVTab uintptr) int32 { /* sqlite3.c:139947:20: */
+func Xsqlite3VtabBegin(tls *libc.TLS, db uintptr, pVTab uintptr) int32 { /* sqlite3.c:140570:20: */
var rc int32 = 0
var pModule uintptr
@@ -116454,13 +120705,13 @@ func Xsqlite3VtabBegin(tls *crt.TLS, db uintptr, pVTab uintptr) int32 { /* sqlit
// sqlite3.aVTrans[] array.
rc = growVTrans(tls, db)
if rc == 0 {
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((pModule + 112 /* &.xBegin */))))(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pModule + 112 /* &.xBegin */))))(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab)
if rc == 0 {
var iSvpt int32 = ((*Sqlite3)(unsafe.Pointer(db)).FnStatement + (*Sqlite3)(unsafe.Pointer(db)).FnSavepoint)
addToVTrans(tls, db, pVTab)
if (iSvpt != 0) && ((*Sqlite3_module)(unsafe.Pointer(pModule)).FxSavepoint != 0) {
(*VTable)(unsafe.Pointer(pVTab)).FiSavepoint = iSvpt
- rc = (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((pModule + 160 /* &.xSavepoint */))))(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab, (iSvpt - 1))
+ rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pModule + 160 /* &.xSavepoint */))))(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab, (iSvpt - 1))
}
}
}
@@ -116481,7 +120732,7 @@ func Xsqlite3VtabBegin(tls *crt.TLS, db uintptr, pVTab uintptr) int32 { /* sqlit
// processing is abandoned and the error returned to the caller of this
// function immediately. If all calls to virtual table methods are successful,
// SQLITE_OK is returned.
-func Xsqlite3VtabSavepoint(tls *crt.TLS, db uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:140007:20: */
+func Xsqlite3VtabSavepoint(tls *libc.TLS, db uintptr, op int32, iSavepoint int32) int32 { /* sqlite3.c:140630:20: */
var rc int32 = 0
if (*Sqlite3)(unsafe.Pointer(db)).FaVTrans != 0 {
@@ -116507,7 +120758,7 @@ func Xsqlite3VtabSavepoint(tls *crt.TLS, db uintptr, op int32, iSavepoint int32)
break
}
if (xMethod != 0) && ((*VTable)(unsafe.Pointer(pVTab)).FiSavepoint > iSavepoint) {
- rc = (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(&xMethod)))(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab, iSavepoint)
+ rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&xMethod)))(tls, (*VTable)(unsafe.Pointer(pVTab)).FpVtab, iSavepoint)
}
Xsqlite3VtabUnlock(tls, pVTab)
}
@@ -116527,7 +120778,7 @@ func Xsqlite3VtabSavepoint(tls *crt.TLS, db uintptr, op int32, iSavepoint int32)
// Return either the pDef argument (indicating no change) or a
// new FuncDef structure that is marked as ephemeral using the
// SQLITE_FUNC_EPHEM flag.
-func Xsqlite3VtabOverloadFunction(tls *crt.TLS, db uintptr, pDef uintptr, nArg int32, pExpr uintptr) uintptr { /* sqlite3.c:140055:24: */
+func Xsqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg int32, pExpr uintptr) uintptr { /* sqlite3.c:140678:24: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -116566,7 +120817,7 @@ func Xsqlite3VtabOverloadFunction(tls *crt.TLS, db uintptr, pDef uintptr, nArg i
// Though undocumented, we have historically always invoked xFindFunction
// with an all lower-case function name. Continue in this tradition to
// avoid any chance of an incompatibility.
- rc = (*(*func(*crt.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pMod + 144 /* &.xFindFunction */))))(tls, pVtab, nArg, (*FuncDef)(unsafe.Pointer(pDef)).FzName, bp /* &xSFunc */, bp+8 /* &pArg */)
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pMod + 144 /* &.xFindFunction */))))(tls, pVtab, nArg, (*FuncDef)(unsafe.Pointer(pDef)).FzName, bp /* &xSFunc */, bp+8 /* &pArg */)
if rc == 0 {
return pDef
}
@@ -116580,7 +120831,7 @@ func Xsqlite3VtabOverloadFunction(tls *crt.TLS, db uintptr, pDef uintptr, nArg i
}
*(*FuncDef)(unsafe.Pointer(pNew)) = *(*FuncDef)(unsafe.Pointer(pDef))
(*FuncDef)(unsafe.Pointer(pNew)).FzName = (pNew + uintptr(1)*72)
- crt.Xmemcpy(tls, (pNew + uintptr(1)*72), (*FuncDef)(unsafe.Pointer(pDef)).FzName, (uint64(Xsqlite3Strlen30(tls, (*FuncDef)(unsafe.Pointer(pDef)).FzName) + 1)))
+ libc.Xmemcpy(tls, (pNew + uintptr(1)*72), (*FuncDef)(unsafe.Pointer(pDef)).FzName, (uint64(Xsqlite3Strlen30(tls, (*FuncDef)(unsafe.Pointer(pDef)).FzName) + 1)))
(*FuncDef)(unsafe.Pointer(pNew)).FxSFunc = *(*uintptr)(unsafe.Pointer(bp /* xSFunc */))
(*FuncDef)(unsafe.Pointer(pNew)).FpUserData = *(*uintptr)(unsafe.Pointer(bp + 8 /* pArg */))
*(*U32)(unsafe.Pointer(pNew + 4 /* &.funcFlags */)) |= (U32(0x0010))
@@ -116591,7 +120842,7 @@ func Xsqlite3VtabOverloadFunction(tls *crt.TLS, db uintptr, pDef uintptr, nArg i
// array so that an OP_VBegin will get generated for it. Add pTab to the
// array if it is missing. If pTab is already in the array, this routine
// is a no-op.
-func Xsqlite3VtabMakeWritable(tls *crt.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:140124:21: */
+func Xsqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* sqlite3.c:140747:21: */
var pToplevel uintptr = func() uintptr {
if (*Parse)(unsafe.Pointer(pParse)).FpToplevel != 0 {
return (*Parse)(unsafe.Pointer(pParse)).FpToplevel
@@ -116611,7 +120862,7 @@ func Xsqlite3VtabMakeWritable(tls *crt.TLS, pParse uintptr, pTab uintptr) { /* s
apVtabLock = Xsqlite3Realloc(tls, (*Parse)(unsafe.Pointer(pToplevel)).FapVtabLock, uint64(n))
if apVtabLock != 0 {
(*Parse)(unsafe.Pointer(pToplevel)).FapVtabLock = apVtabLock
- *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(pToplevel)).FapVtabLock + uintptr(crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pToplevel)).FnVtabLock, 1))*8)) = pTab
+ *(*uintptr)(unsafe.Pointer((*Parse)(unsafe.Pointer(pToplevel)).FapVtabLock + uintptr(libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pToplevel)).FnVtabLock, 1))*8)) = pTab
} else {
Xsqlite3OomFault(tls, (*Parse)(unsafe.Pointer(pToplevel)).Fdb)
}
@@ -116629,7 +120880,7 @@ func Xsqlite3VtabMakeWritable(tls *crt.TLS, pParse uintptr, pTab uintptr) { /* s
//
// Any virtual table module for which xConnect and xCreate are the same
// method can have an eponymous virtual table instance.
-func Xsqlite3VtabEponymousTableInit(tls *crt.TLS, pParse uintptr, pMod uintptr) int32 { /* sqlite3.c:140157:20: */
+func Xsqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) int32 { /* sqlite3.c:140780:20: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -116663,7 +120914,7 @@ func Xsqlite3VtabEponymousTableInit(tls *crt.TLS, pParse uintptr, pMod uintptr)
addModuleArgument(tls, pParse, pTab, Xsqlite3DbStrDup(tls, db, (*Table)(unsafe.Pointer(pTab)).FzName))
rc = vtabCallConstructor(tls, db, pTab, pMod, (*Sqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp+8 /* &zErr */)
if rc != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+696 /* "%s" */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+805 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */))))
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 /* zErr */)))
Xsqlite3VtabEponymousTableClear(tls, db, pMod)
return 0
@@ -116673,7 +120924,7 @@ func Xsqlite3VtabEponymousTableInit(tls *crt.TLS, pParse uintptr, pMod uintptr)
// Erase the eponymous virtual table instance associated with
// virtual table module pMod, if it exists.
-func Xsqlite3VtabEponymousTableClear(tls *crt.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:140194:21: */
+func Xsqlite3VtabEponymousTableClear(tls *libc.TLS, db uintptr, pMod uintptr) { /* sqlite3.c:140817:21: */
var pTab uintptr = (*Module)(unsafe.Pointer(pMod)).FpEpoTab
if pTab != uintptr(0) {
// Mark the table as Ephemeral prior to deleting it, so that the
@@ -116690,19 +120941,19 @@ func Xsqlite3VtabEponymousTableClear(tls *crt.TLS, db uintptr, pMod uintptr) { /
//
// The results of this routine are undefined unless it is called from
// within an xUpdate method.
-func Xsqlite3_vtab_on_conflict(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:140213:16: */
+func Xsqlite3_vtab_on_conflict(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:140836:16: */
return int32(aMap[(int32((*Sqlite3)(unsafe.Pointer(db)).FvtabOnConflict) - 1)])
}
var aMap = [5]uint8{
uint8(1), uint8(4), uint8(3), uint8(2), uint8(5),
-} /* sqlite3.c:140214:30 */
+} /* sqlite3.c:140837:30 */
// Call from within the xCreate() or xConnect() methods to provide
// the SQLite core with additional information about the behavior
// of the virtual table being implemented.
-func Xsqlite3_vtab_config(tls *crt.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:140231:16: */
+func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:140854:16: */
var ap Va_list
_ = ap
var rc int32 = 0
@@ -116711,14 +120962,14 @@ func Xsqlite3_vtab_config(tls *crt.TLS, db uintptr, op int32, va uintptr) int32
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
p = (*Sqlite3)(unsafe.Pointer(db)).FpVtabCtx
if !(p != 0) {
- rc = Xsqlite3MisuseError(tls, 140242)
+ rc = Xsqlite3MisuseError(tls, 140865)
} else {
ap = va
switch op {
case 1:
{
- (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FbConstraint = U8(crt.VaInt32(&ap))
+ (*VTable)(unsafe.Pointer((*VtabCtx)(unsafe.Pointer(p)).FpVTable)).FbConstraint = U8(libc.VaInt32(&ap))
break
}
fallthrough
@@ -116736,7 +120987,7 @@ func Xsqlite3_vtab_config(tls *crt.TLS, db uintptr, op int32, va uintptr) int32
fallthrough
default:
{
- rc = Xsqlite3MisuseError(tls, 140260)
+ rc = Xsqlite3MisuseError(tls, 140883)
break
}
}
@@ -116763,23 +121014,23 @@ type WhereClause1 = struct {
}
// Forward references
-type WhereClause = WhereClause1 /* sqlite3.c:140333:28 */
+type WhereClause = WhereClause1 /* sqlite3.c:140956:28 */
type WhereMaskSet1 = struct {
FbVarSelect int32
Fn int32
Fix [64]int32
}
-type WhereMaskSet = WhereMaskSet1 /* sqlite3.c:140334:29 */
+type WhereMaskSet = WhereMaskSet1 /* sqlite3.c:140957:29 */
type WhereOrInfo1 = struct {
Fwc WhereClause
Findexable Bitmask
}
-type WhereOrInfo = WhereOrInfo1 /* sqlite3.c:140335:28 */
+type WhereOrInfo = WhereOrInfo1 /* sqlite3.c:140958:28 */
type WhereAndInfo1 = struct{ Fwc WhereClause }
-type WhereAndInfo = WhereAndInfo1 /* sqlite3.c:140336:29 */
+type WhereAndInfo = WhereAndInfo1 /* sqlite3.c:140959:29 */
type WhereLevel1 = struct {
FiLeftJoin int32
FiTabCur int32
@@ -116808,7 +121059,7 @@ type WhereLevel1 = struct {
FnotReady Bitmask
}
-type WhereLevel = WhereLevel1 /* sqlite3.c:140337:27 */
+type WhereLevel = WhereLevel1 /* sqlite3.c:140960:27 */
type WhereLoop1 = struct {
Fprereq Bitmask
FmaskSelf Bitmask
@@ -116835,7 +121086,7 @@ type WhereLoop1 = struct {
FaLTermSpace [3]uintptr
}
-type WhereLoop = WhereLoop1 /* sqlite3.c:140338:26 */
+type WhereLoop = WhereLoop1 /* sqlite3.c:140961:26 */
type WherePath1 = struct {
FmaskLoop Bitmask
FrevLoop Bitmask
@@ -116846,7 +121097,7 @@ type WherePath1 = struct {
FaLoop uintptr
}
-type WherePath = WherePath1 /* sqlite3.c:140339:26 */
+type WherePath = WherePath1 /* sqlite3.c:140962:26 */
type WhereTerm1 = struct {
FpExpr uintptr
FpWC uintptr
@@ -116867,19 +121118,22 @@ type WhereTerm1 = struct {
FprereqAll Bitmask
}
-type WhereTerm = WhereTerm1 /* sqlite3.c:140340:26 */
+type WhereTerm = WhereTerm1 /* sqlite3.c:140963:26 */
type WhereLoopBuilder1 = struct {
FpWInfo uintptr
FpWC uintptr
FpOrderBy uintptr
FpNew uintptr
FpOrSet uintptr
+ FpRec uintptr
+ FnRecValid int32
FbldFlags1 uint8
FbldFlags2 uint8
FiPlanLimit uint32
+ _ [4]byte
}
-type WhereLoopBuilder = WhereLoopBuilder1 /* sqlite3.c:140341:33 */
+type WhereLoopBuilder = WhereLoopBuilder1 /* sqlite3.c:140964:33 */
type WhereScan1 = struct {
FpOrigWC uintptr
FpWC uintptr
@@ -116895,7 +121149,7 @@ type WhereScan1 = struct {
_ [2]byte
}
-type WhereScan = WhereScan1 /* sqlite3.c:140342:26 */
+type WhereScan = WhereScan1 /* sqlite3.c:140965:26 */
type WhereOrCost1 = struct {
Fprereq Bitmask
FrRun LogEst
@@ -116903,13 +121157,13 @@ type WhereOrCost1 = struct {
_ [4]byte
}
-type WhereOrCost = WhereOrCost1 /* sqlite3.c:140343:28 */
+type WhereOrCost = WhereOrCost1 /* sqlite3.c:140966:28 */
type WhereOrSet1 = struct {
Fn U16
Fa [3]WhereOrCost
}
-type WhereOrSet = WhereOrSet1 /* sqlite3.c:140344:27 */
+type WhereOrSet = WhereOrSet1 /* sqlite3.c:140967:27 */
// This object contains information needed to implement a single nested
// loop in WHERE clause.
@@ -116979,7 +121233,7 @@ type WhereExprMod1 = struct {
// of an index rather than an expression or a virtual column. All
// such transformations need to be undone at the end of WHERE clause
// processing.
-type WhereExprMod = WhereExprMod1 /* sqlite3.c:140749:29 */
+type WhereExprMod = WhereExprMod1 /* sqlite3.c:141372:29 */
// Bitmasks for the operators on WhereTerm objects. These are all
// operators that are of interest to the query planner. An
@@ -117001,13 +121255,13 @@ type WhereExprMod = WhereExprMod1 /* sqlite3.c:140749:29 */
//************* Continuing where we left off in wherecode.c *****************
// Return the name of the i-th column of the pIdx index.
-func explainIndexColumnName(tls *crt.TLS, pIdx uintptr, i int32) uintptr { /* sqlite3.c:140927:19: */
+func explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) uintptr { /* sqlite3.c:141550:19: */
i = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2)))
if i == (-2) {
- return ts + 19234 /* "<expr>" */
+ return ts + 23024 /* "<expr>" */
}
if i == (-1) {
- return ts + 14283 /* "rowid" */
+ return ts + 10045 /* "rowid" */
}
return (*Column)(unsafe.Pointer((*Table)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*32)).FzName
}
@@ -117018,39 +121272,39 @@ func explainIndexColumnName(tls *crt.TLS, pIdx uintptr, i int32) uintptr { /* sq
// at a time. This routine adds a new term to the end of the expression.
// Terms are separated by AND so add the "AND" text for second and subsequent
// terms only.
-func explainAppendTerm(tls *crt.TLS, pStr uintptr, pIdx uintptr, nTerm int32, iTerm int32, bAnd int32, zOp uintptr) { /* sqlite3.c:140942:13: */
+func explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, iTerm int32, bAnd int32, zOp uintptr) { /* sqlite3.c:141565:13: */
var i int32
if bAnd != 0 {
- Xsqlite3_str_append(tls, pStr, ts+19241 /* " AND " */, 5)
+ Xsqlite3_str_append(tls, pStr, ts+23031 /* " AND " */, 5)
}
if nTerm > 1 {
- Xsqlite3_str_append(tls, pStr, ts+19247 /* "(" */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+23037 /* "(" */, 1)
}
for i = 0; i < nTerm; i++ {
if i != 0 {
- Xsqlite3_str_append(tls, pStr, ts+11166 /* "," */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+13896 /* "," */, 1)
}
Xsqlite3_str_appendall(tls, pStr, explainIndexColumnName(tls, pIdx, (iTerm+i)))
}
if nTerm > 1 {
- Xsqlite3_str_append(tls, pStr, ts+4456 /* ")" */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+6652 /* ")" */, 1)
}
Xsqlite3_str_append(tls, pStr, zOp, 1)
if nTerm > 1 {
- Xsqlite3_str_append(tls, pStr, ts+19247 /* "(" */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+23037 /* "(" */, 1)
}
for i = 0; i < nTerm; i++ {
if i != 0 {
- Xsqlite3_str_append(tls, pStr, ts+11166 /* "," */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+13896 /* "," */, 1)
}
- Xsqlite3_str_append(tls, pStr, ts+4507 /* "?" */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+6705 /* "?" */, 1)
}
if nTerm > 1 {
- Xsqlite3_str_append(tls, pStr, ts+4456 /* ")" */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+6652 /* ")" */, 1)
}
}
@@ -117066,7 +121320,7 @@ func explainAppendTerm(tls *crt.TLS, pStr uintptr, pIdx uintptr, nTerm int32, iT
// string similar to:
//
// "a=? AND b>?"
-func explainIndexRange(tls *crt.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.c:140986:13: */
+func explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.c:141609:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -117091,18 +121345,18 @@ func explainIndexRange(tls *crt.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.c
if (int32(nEq) == 0) && (((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(0x00000020 | 0x00000010))) == U32(0)) {
return
}
- Xsqlite3_str_append(tls, pStr, ts+19249 /* " (" */, 2)
+ Xsqlite3_str_append(tls, pStr, ts+23039 /* " (" */, 2)
for i = 0; i < int32(nEq); i++ {
var z uintptr = explainIndexColumnName(tls, pIndex, i)
if i != 0 {
- Xsqlite3_str_append(tls, pStr, ts+19241 /* " AND " */, 5)
+ Xsqlite3_str_append(tls, pStr, ts+23031 /* " AND " */, 5)
}
Xsqlite3_str_appendf(tls, pStr, func() uintptr {
if i >= int32(nSkip) {
- return ts + 19252 /* "%s=?" */
+ return ts + 23042 /* "%s=?" */
}
- return ts + 19257 /* "ANY(%s)" */
- }(), crt.VaList(bp, z))
+ return ts + 23047 /* "ANY(%s)" */
+ }(), libc.VaList(bp, z))
}
j = i
@@ -117113,7 +121367,7 @@ func explainIndexRange(tls *crt.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.c
FnTop U16
FnDistinctCol U16
FpIndex uintptr
- })(unsafe.Pointer(pLoop+24 /* &.u */)).FnBtm), j, i, ts+19265 /* ">" */)
+ })(unsafe.Pointer(pLoop+24 /* &.u */)).FnBtm), j, i, ts+23055 /* ">" */)
i = 1
}
if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000010)) != 0 {
@@ -117123,9 +121377,9 @@ func explainIndexRange(tls *crt.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.c
FnTop U16
FnDistinctCol U16
FpIndex uintptr
- })(unsafe.Pointer(pLoop+24 /* &.u */)).FnTop), j, i, ts+19267 /* "<" */)
+ })(unsafe.Pointer(pLoop+24 /* &.u */)).FnTop), j, i, ts+23057 /* "<" */)
}
- Xsqlite3_str_append(tls, pStr, ts+4456 /* ")" */, 1)
+ Xsqlite3_str_append(tls, pStr, ts+6652 /* ")" */, 1)
}
// This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
@@ -117135,7 +121389,7 @@ func explainIndexRange(tls *crt.TLS, pStr uintptr, pLoop uintptr) { /* sqlite3.c
//
// If an OP_Explain opcode is added to the VM, its address is returned.
// Otherwise, if no OP_Explain is coded, zero is returned.
-func Xsqlite3WhereExplainOneScan(tls *crt.TLS, pParse uintptr, pTabList uintptr, pLevel uintptr, wctrlFlags U16) int32 { /* sqlite3.c:141020:20: */
+func Xsqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr, pLevel uintptr, wctrlFlags U16) int32 { /* sqlite3.c:141643:20: */
bp := tls.Alloc(188)
defer tls.Free(188)
@@ -117164,7 +121418,7 @@ func Xsqlite3WhereExplainOneScan(tls *crt.TLS, pParse uintptr, pTabList uintptr,
return 0
}
- isSearch = (crt.Bool32((((flags & (U32(0x00000020 | 0x00000010))) != U32(0)) ||
+ isSearch = (libc.Bool32((((flags & (U32(0x00000020 | 0x00000010))) != U32(0)) ||
(((flags & U32(0x00000400)) == U32(0)) && (int32((*struct {
FnEq U16
FnBtm U16
@@ -117177,18 +121431,18 @@ func Xsqlite3WhereExplainOneScan(tls *crt.TLS, pParse uintptr, pTabList uintptr,
Xsqlite3StrAccumInit(tls, bp+56 /* &str */, db, bp+88 /* &zBuf[0] */, int32(unsafe.Sizeof([100]int8{})), 1000000000)
Xsqlite3_str_appendall(tls, bp+56 /* &str */, func() uintptr {
if isSearch != 0 {
- return ts + 19269 /* "SEARCH" */
+ return ts + 23059 /* "SEARCH" */
}
- return ts + 19276 /* "SCAN" */
+ return ts + 23066 /* "SCAN" */
}())
if (*SrcList_item)(unsafe.Pointer(pItem)).FpSelect != 0 {
- Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+19281 /* " SUBQUERY %u" */, crt.VaList(bp, (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselId))
+ Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+23071 /* " SUBQUERY %u" */, libc.VaList(bp, (*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpSelect)).FselId))
} else {
- Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+19294 /* " TABLE %s" */, crt.VaList(bp+8, (*SrcList_item)(unsafe.Pointer(pItem)).FzName))
+ Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+23084 /* " TABLE %s" */, libc.VaList(bp+8, (*SrcList_item)(unsafe.Pointer(pItem)).FzName))
}
if (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias != 0 {
- Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+19304 /* " AS %s" */, crt.VaList(bp+16, (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias))
+ Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+23094 /* " AS %s" */, libc.VaList(bp+16, (*SrcList_item)(unsafe.Pointer(pItem)).FzAlias))
}
if (flags & (U32(0x00000100 | 0x00000400))) == U32(0) {
var zFmt uintptr = uintptr(0)
@@ -117204,39 +121458,39 @@ func Xsqlite3WhereExplainOneScan(tls *crt.TLS, pParse uintptr, pTabList uintptr,
if !(((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer(pItem)).FpTab))).FtabFlags & U32(0x0080)) == U32(0)) && (int32(*(*uint16)(unsafe.Pointer((pIdx) + 100 /* &.idxType */))&0x3>>0) == 2) {
if isSearch != 0 {
- zFmt = ts + 19311 /* "PRIMARY KEY" */
+ zFmt = ts + 23101 /* "PRIMARY KEY" */
}
} else if (flags & U32(0x00020000)) != 0 {
- zFmt = ts + 19323 /* "AUTOMATIC PARTIA..." */
+ zFmt = ts + 23113 /* "AUTOMATIC PARTIA..." */
} else if (flags & U32(0x00004000)) != 0 {
- zFmt = ts + 19356 /* "AUTOMATIC COVERI..." */
+ zFmt = ts + 23146 /* "AUTOMATIC COVERI..." */
} else if (flags & U32(0x00000040)) != 0 {
- zFmt = ts + 19381 /* "COVERING INDEX %..." */
+ zFmt = ts + 23171 /* "COVERING INDEX %..." */
} else {
- zFmt = ts + 19399 /* "INDEX %s" */
+ zFmt = ts + 23189 /* "INDEX %s" */
}
if zFmt != 0 {
- Xsqlite3_str_append(tls, bp+56 /* &str */, ts+19408 /* " USING " */, 7)
- Xsqlite3_str_appendf(tls, bp+56 /* &str */, zFmt, crt.VaList(bp+24, (*Index)(unsafe.Pointer(pIdx)).FzName))
+ Xsqlite3_str_append(tls, bp+56 /* &str */, ts+23198 /* " USING " */, 7)
+ Xsqlite3_str_appendf(tls, bp+56 /* &str */, zFmt, libc.VaList(bp+24, (*Index)(unsafe.Pointer(pIdx)).FzName))
explainIndexRange(tls, bp+56 /* &str */, pLoop)
}
} else if ((flags & U32(0x00000100)) != U32(0)) && ((flags & U32(0x0000000f)) != U32(0)) {
var zRangeOp uintptr
if (flags & (U32(0x00000001 | 0x00000004))) != 0 {
- zRangeOp = ts + 19416 /* "=" */
+ zRangeOp = ts + 23206 /* "=" */
} else if (flags & U32(0x00000030)) == U32(0x00000030) {
- zRangeOp = ts + 19418 /* ">? AND rowid<" */
+ zRangeOp = ts + 23208 /* ">? AND rowid<" */
} else if (flags & U32(0x00000020)) != 0 {
- zRangeOp = ts + 19265 /* ">" */
+ zRangeOp = ts + 23055 /* ">" */
} else {
- zRangeOp = ts + 19267 /* "<" */
+ zRangeOp = ts + 23057 /* "<" */
}
Xsqlite3_str_appendf(tls, bp+56, /* &str */
- ts+19432 /* " USING INTEGER P..." */, crt.VaList(bp+32, zRangeOp))
+ ts+23222 /* " USING INTEGER P..." */, libc.VaList(bp+32, zRangeOp))
} else if (flags & U32(0x00000400)) != U32(0) {
- Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+19470, /* " VIRTUAL TABLE I..." */
- crt.VaList(bp+40, (*struct {
+ Xsqlite3_str_appendf(tls, bp+56 /* &str */, ts+23260, /* " VIRTUAL TABLE I..." */
+ libc.VaList(bp+40, (*struct {
FidxNum int32
FneedFree U8
FisOrdered I8
@@ -117298,7 +121552,7 @@ func Xsqlite3WhereExplainOneScan(tls *crt.TLS, pParse uintptr, pTabList uintptr,
// The TERM_LIKECOND marking indicates that the term should be coded inside
// a conditional such that is only evaluated on the second pass of a
// LIKE-optimization loop, when scanning BLOBs instead of strings.
-func disableTerm(tls *crt.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:141195:13: */
+func disableTerm(tls *libc.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:141818:13: */
var nLoop int32 = 0
for (((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & 0x0004) == 0) &&
@@ -117331,7 +121585,7 @@ func disableTerm(tls *crt.TLS, pLevel uintptr, pTerm uintptr) { /* sqlite3.c:141
//
// This routine makes its own copy of zAff so that the caller is free
// to modify zAff after this routine returns.
-func codeApplyAffinity(tls *crt.TLS, pParse uintptr, base int32, n int32, zAff uintptr) { /* sqlite3.c:141227:13: */
+func codeApplyAffinity(tls *libc.TLS, pParse uintptr, base int32, n int32, zAff uintptr) { /* sqlite3.c:141850:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
if zAff == uintptr(0) {
@@ -117364,7 +121618,7 @@ func codeApplyAffinity(tls *crt.TLS, pParse uintptr, base int32, n int32, zAff u
//
// * the comparison will be performed with no affinity, or
// * the affinity change in zAff is guaranteed not to change the value.
-func updateRangeAffinityStr(tls *crt.TLS, pRight uintptr, n int32, zAff uintptr) { /* sqlite3.c:141264:13: */
+func updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintptr) { /* sqlite3.c:141887:13: */
var i int32
for i = 0; i < n; i++ {
var p uintptr = Xsqlite3VectorFieldSubexpr(tls, pRight, i)
@@ -117402,7 +121656,7 @@ func updateRangeAffinityStr(tls *crt.TLS, pRight uintptr, n int32, zAff uintptr)
// The reduced pX is different from the original (obviously) and thus is
// only used for indexing, to improve performance. The original unaltered
// IN expression must also be run on each output row for correctness.
-func removeUnindexableInClauseTerms(tls *crt.TLS, pParse uintptr, iEq int32, pLoop uintptr, pX uintptr) uintptr { /* sqlite3.c:141310:13: */
+func removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, pLoop uintptr, pX uintptr) uintptr { /* sqlite3.c:141933:13: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
var pNew uintptr
pNew = Xsqlite3ExprDup(tls, db, pX, 0)
@@ -117474,7 +121728,7 @@ func removeUnindexableInClauseTerms(tls *crt.TLS, pParse uintptr, iEq int32, pLo
// For a constraint of the form X=expr, the expression is evaluated in
// straight-line code. For constraints of the form X IN (...)
// this routine sets up a loop that will iterate over all values of X.
-func codeEqualityTerm(tls *crt.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) int32 { /* sqlite3.c:141392:12: */
+func codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) int32 { /* sqlite3.c:142015:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -117513,7 +121767,7 @@ func codeEqualityTerm(tls *crt.TLS, pParse uintptr, pTerm uintptr, pLevel uintpt
FpIndex uintptr
})(unsafe.Pointer(pLoop+24 /* &.u */)).FpIndex)).FaSortOrder + uintptr(iEq))) != 0) {
- bRev = crt.BoolInt32(!(bRev != 0))
+ bRev = libc.BoolInt32(!(bRev != 0))
}
iReg = iTarget
@@ -117549,7 +121803,7 @@ func codeEqualityTerm(tls *crt.TLS, pParse uintptr, pTerm uintptr, pLevel uintpt
if eType == 4 {
- bRev = crt.BoolInt32(!(bRev != 0))
+ bRev = libc.BoolInt32(!(bRev != 0))
}
Xsqlite3VdbeAddOp2(tls, v, func() int32 {
if bRev != 0 {
@@ -117597,7 +121851,7 @@ func codeEqualityTerm(tls *crt.TLS, pParse uintptr, pTerm uintptr, pLevel uintpt
} else {
var iCol int32
if aiMap != 0 {
- iCol = *(*int32)(unsafe.Pointer(aiMap + uintptr(crt.PostIncInt32(&iMap, 1))*4))
+ iCol = *(*int32)(unsafe.Pointer(aiMap + uintptr(libc.PostIncInt32(&iMap, 1))*4))
} else {
iCol = 0
}
@@ -117680,7 +121934,10 @@ func codeEqualityTerm(tls *crt.TLS, pParse uintptr, pTerm uintptr, pLevel uintpt
// no conversion should be attempted before using a t2.b value as part of
// a key to search the index. Hence the first byte in the returned affinity
// string in this example would be set to SQLITE_AFF_BLOB.
-func codeAllEqualityTerms(tls *crt.TLS, pParse uintptr, pLevel uintptr, bRev int32, nExtraReg int32, pzAff uintptr) int32 { /* sqlite3.c:141563:12: */
+func codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev int32, nExtraReg int32, pzAff uintptr) int32 { /* sqlite3.c:142186:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
var nEq U16 // The number of == or IN constraints to code
var nSkip U16 // Number of left-most columns to skip
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // The vm under construction
@@ -117733,6 +121990,7 @@ func codeAllEqualityTerms(tls *crt.TLS, pParse uintptr, pLevel uintptr, bRev int
return 37
}(), iIdxCur)
+ Xsqlite3VdbeComment(tls, v, ts+23287 /* "begin skip-scan ..." */, libc.VaList(bp, (*Index)(unsafe.Pointer(pIdx)).FzName))
j = Xsqlite3VdbeAddOp0(tls, v, 11)
(*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip = Xsqlite3VdbeAddOp4Int(tls, v, func() int32 {
if bRev != 0 {
@@ -117746,6 +122004,7 @@ func codeAllEqualityTerms(tls *crt.TLS, pParse uintptr, pLevel uintptr, bRev int
for j = 0; j < int32(nSkip); j++ {
Xsqlite3VdbeAddOp3(tls, v, 89, iIdxCur, j, (regBase + j))
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp+8, explainIndexColumnName(tls, pIdx, j)))
}
}
@@ -117812,11 +122071,11 @@ func codeAllEqualityTerms(tls *crt.TLS, pParse uintptr, pLevel uintptr, bRev int
// on. For each table column, if the column is the i'th column of the
// index, then the corresponding array entry is set to (i+1). If the column
// does not appear in the index at all, the array entry is set to 0.
-func codeDeferredSeek(tls *crt.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, iIdxCur int32) { /* sqlite3.c:141935:13: */
+func codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, iIdxCur int32) { /* sqlite3.c:142558:13: */
var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse // Parse context
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe // Vdbe to generate code within
- crt.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bDeferredSeek */, uint32(1), 0, 0x1)
+ libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bDeferredSeek */, uint32(1), 0, 0x1)
Xsqlite3VdbeAddOp3(tls, v, 133, iIdxCur, 0, iCur)
if ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & 0x0020) != 0) &&
(((*Parse)(unsafe.Pointer(func() uintptr {
@@ -117827,9 +122086,9 @@ func codeDeferredSeek(tls *crt.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, iI
}())).FwriteMask) == YDbMask(0)) {
var i int32
var pTab uintptr = (*Index)(unsafe.Pointer(pIdx)).FpTable
- var ai uintptr = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64(uint64(unsafe.Sizeof(int32(0))) * (uint64(int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)))))
+ var ai uintptr = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (uint64(uint64(unsafe.Sizeof(U32(0))) * (uint64(int32((*Table)(unsafe.Pointer(pTab)).FnCol) + 1)))))
if ai != 0 {
- *(*int32)(unsafe.Pointer(ai + uintptr(0)*4)) = int32((*Table)(unsafe.Pointer(pTab)).FnCol)
+ *(*U32)(unsafe.Pointer(ai + uintptr(0)*4)) = U32((*Table)(unsafe.Pointer(pTab)).FnCol)
for i = 0; i < (int32((*Index)(unsafe.Pointer(pIdx)).FnColumn) - 1); i++ {
var x1 int32
var x2 int32
@@ -117838,7 +122097,7 @@ func codeDeferredSeek(tls *crt.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, iI
x2 = int32(Xsqlite3TableColumnToStorage(tls, pTab, int16(x1)))
if x1 >= 0 {
- *(*int32)(unsafe.Pointer(ai + uintptr((x2+1))*4)) = (i + 1)
+ *(*U32)(unsafe.Pointer(ai + uintptr((x2+1))*4)) = (U32(i + 1))
}
}
Xsqlite3VdbeChangeP4(tls, v, -1, ai, -15)
@@ -117853,7 +122112,7 @@ func codeDeferredSeek(tls *crt.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, iI
// If the expression is not a vector, then nReg must be passed 1. In
// this case, generate code to evaluate the expression and leave the
// result in register iReg.
-func codeExprOrVector(tls *crt.TLS, pParse uintptr, p uintptr, iReg int32, nReg int32) { /* sqlite3.c:141979:13: */
+func codeExprOrVector(tls *libc.TLS, pParse uintptr, p uintptr, iReg int32, nReg int32) { /* sqlite3.c:142602:13: */
if (p != 0) && (Xsqlite3ExprIsVector(tls, p) != 0) {
if ((*Expr)(unsafe.Pointer(p)).Fflags & U32(0x000800)) != 0 {
@@ -117879,10 +122138,10 @@ func codeExprOrVector(tls *crt.TLS, pParse uintptr, p uintptr, iReg int32, nReg
// An instance of the IdxExprTrans object carries information about a
// mapping from an expression on table columns into a column in an index
// down through the Walker.
-type IdxExprTrans = IdxExprTrans1 /* sqlite3.c:142017:3 */
+type IdxExprTrans = IdxExprTrans1 /* sqlite3.c:142640:3 */
// Preserve pExpr on the WhereETrans list of the WhereInfo.
-func preserveExpr(tls *crt.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:142022:13: */
+func preserveExpr(tls *libc.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:142645:13: */
var pNew uintptr
pNew = Xsqlite3DbMallocRaw(tls, (*IdxExprTrans)(unsafe.Pointer(pTrans)).Fdb, uint64(unsafe.Sizeof(WhereExprMod{})))
if pNew == uintptr(0) {
@@ -117891,7 +122150,7 @@ func preserveExpr(tls *crt.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:14
(*WhereExprMod)(unsafe.Pointer(pNew)).FpNext = (*WhereInfo)(unsafe.Pointer((*IdxExprTrans)(unsafe.Pointer(pTrans)).FpWInfo)).FpExprMods
(*WhereInfo)(unsafe.Pointer((*IdxExprTrans)(unsafe.Pointer(pTrans)).FpWInfo)).FpExprMods = pNew
(*WhereExprMod)(unsafe.Pointer(pNew)).FpExpr = pExpr
- crt.Xmemcpy(tls, (pNew + 16 /* &.orig */), pExpr, uint64(unsafe.Sizeof(Expr{})))
+ libc.Xmemcpy(tls, (pNew + 16 /* &.orig */), pExpr, uint64(unsafe.Sizeof(Expr{})))
}
// The walker node callback used to transform matching expressions into
@@ -117899,7 +122158,7 @@ func preserveExpr(tls *crt.TLS, pTrans uintptr, pExpr uintptr) { /* sqlite3.c:14
//
// If pExpr matches, then transform it into a reference to the index column
// that contains the value of pExpr.
-func whereIndexExprTransNode(tls *crt.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:142038:12: */
+func whereIndexExprTransNode(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:142661:12: */
var pX uintptr = *(*uintptr)(unsafe.Pointer(p + 40 /* &.u */))
if Xsqlite3ExprCompare(tls, uintptr(0), pExpr, (*IdxExprTrans)(unsafe.Pointer(pX)).FpIdxExpr, (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCur) == 0 {
preserveExpr(tls, pX, pExpr)
@@ -117909,7 +122168,7 @@ func whereIndexExprTransNode(tls *crt.TLS, p uintptr, pExpr uintptr) int32 { /*
(*Expr)(unsafe.Pointer(pExpr)).FiColumn = YnVar((*IdxExprTrans)(unsafe.Pointer(pX)).FiIdxCol)
*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = uintptr(0)
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (^U32(crt.Int32FromInt32((0x001000 | 0x040000))))
+ *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (^U32(libc.Int32FromInt32((0x001000 | 0x040000))))
return 1
} else {
return 0
@@ -117919,7 +122178,7 @@ func whereIndexExprTransNode(tls *crt.TLS, p uintptr, pExpr uintptr) int32 { /*
// A walker node callback that translates a column reference to a table
// into a corresponding column reference of an index.
-func whereIndexExprTransColumn(tls *crt.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:142060:12: */
+func whereIndexExprTransColumn(tls *libc.TLS, p uintptr, pExpr uintptr) int32 { /* sqlite3.c:142683:12: */
if int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 164 {
var pX uintptr = *(*uintptr)(unsafe.Pointer(p + 40 /* &.u */))
if ((*Expr)(unsafe.Pointer(pExpr)).FiTable == (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCur) && (int32((*Expr)(unsafe.Pointer(pExpr)).FiColumn) == (*IdxExprTrans)(unsafe.Pointer(pX)).FiTabCol) {
@@ -117941,7 +122200,7 @@ func whereIndexExprTransColumn(tls *crt.TLS, p uintptr, pExpr uintptr) int32 { /
// 2019-10-24: Updated to also translate references to a VIRTUAL column in
// the table into references to the corresponding (stored) column of the
// index.
-func whereIndexExprTrans(tls *crt.TLS, pIdx uintptr, iTabCur int32, iIdxCur int32, pWInfo uintptr) { /* sqlite3.c:142085:13: */
+func whereIndexExprTrans(tls *libc.TLS, pIdx uintptr, iTabCur int32, iIdxCur int32, pWInfo uintptr) { /* sqlite3.c:142708:13: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -117959,7 +122218,7 @@ func whereIndexExprTrans(tls *crt.TLS, pIdx uintptr, iTabCur int32, iIdxCur int3
return
}
pTab = (*Index)(unsafe.Pointer(pIdx)).FpTable
- crt.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
*(*uintptr)(unsafe.Pointer(bp /* &w */ + 40 /* &.u */)) = bp + 48 /* &x */
(*IdxExprTrans)(unsafe.Pointer(bp + 48 /* &x */)).FiTabCur = iTabCur
(*IdxExprTrans)(unsafe.Pointer(bp + 48 /* &x */)).FiIdxCur = iIdxCur
@@ -117974,7 +122233,7 @@ func whereIndexExprTrans(tls *crt.TLS, pIdx uintptr, iTabCur int32, iIdxCur int3
continue
}
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{whereIndexExprTransNode}))
} else if ((int32(iRef) >= 0) &&
((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(iRef)*32)).FcolFlags) & 0x0020) != 0)) &&
@@ -117988,7 +122247,7 @@ func whereIndexExprTrans(tls *crt.TLS, pIdx uintptr, iTabCur int32, iIdxCur int3
// the column is non-standard
(*IdxExprTrans)(unsafe.Pointer(bp + 48 /* &x */)).FiTabCol = int32(iRef)
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{whereIndexExprTransColumn}))
} else {
continue
@@ -118005,7 +122264,7 @@ func whereIndexExprTrans(tls *crt.TLS, pIdx uintptr, iTabCur int32, iIdxCur int3
// WHERE clause terms on the query, and if any of those terms must be
// true because pTruth is true, then mark those WHERE clause terms as
// coded.
-func whereApplyPartialIndexConstraints(tls *crt.TLS, pTruth uintptr, iTabCur int32, pWC uintptr) { /* sqlite3.c:142148:13: */
+func whereApplyPartialIndexConstraints(tls *libc.TLS, pTruth uintptr, iTabCur int32, pWC uintptr) { /* sqlite3.c:142771:13: */
var i int32
var pTerm uintptr
for int32((*Expr)(unsafe.Pointer(pTruth)).Fop) == 44 {
@@ -118039,9 +122298,9 @@ __3:
// Generate code for the start of the iLevel-th loop in the WHERE clause
// implementation described by pWInfo.
-func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWInfo uintptr, iLevel int32, pLevel uintptr, notReady Bitmask) Bitmask { /* sqlite3.c:142173:24: */
- bp := tls.Alloc(96)
- defer tls.Free(96)
+func Xsqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWInfo uintptr, iLevel int32, pLevel uintptr, notReady Bitmask) Bitmask { /* sqlite3.c:142796:24: */
+ bp := tls.Alloc(104)
+ defer tls.Free(104)
var j int32
var k int32 // Loop counters
@@ -118078,16 +122337,17 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
// means to continue with the next IN value combination. When
// there are no IN operators in the constraints, the "addrNxt" label
// is the same as "addrBrk".
- addrBrk = crt.AssignPtrInt32(pLevel+12 /* &.addrBrk */, crt.AssignPtrInt32(pLevel+16 /* &.addrNxt */, Xsqlite3VdbeMakeLabel(tls, pParse)))
- addrCont = crt.AssignPtrInt32(pLevel+24 /* &.addrCont */, Xsqlite3VdbeMakeLabel(tls, pParse))
+ addrBrk = libc.AssignPtrInt32(pLevel+12 /* &.addrBrk */, libc.AssignPtrInt32(pLevel+16 /* &.addrNxt */, Xsqlite3VdbeMakeLabel(tls, pParse)))
+ addrCont = libc.AssignPtrInt32(pLevel+24 /* &.addrCont */, Xsqlite3VdbeMakeLabel(tls, pParse))
// If this is the right table of a LEFT OUTER JOIN, allocate and
// initialize a memory cell that records if this table matches any
// row of the left table of the join.
if (int32((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0) && ((int32((*SrcList_item)(unsafe.Pointer(pTabItem+uintptr(0)*112)).Ffg.Fjointype) & 0x0008) != 0) {
- (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 69, 0, (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin)
+ Xsqlite3VdbeComment(tls, v, ts+23309 /* "init LEFT JOIN n..." */, 0)
}
// Compute a safe address to jump to if we discover that the table for
@@ -118102,6 +122362,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
Xsqlite3VdbeAddOp3(tls, v, 13, regYield, 0, (*SrcList_item)(unsafe.Pointer(pTabItem)).FaddrFillSub)
(*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = Xsqlite3VdbeAddOp2(tls, v, 14, regYield, addrBrk)
+ Xsqlite3VdbeComment(tls, v, ts+23338 /* "next row of %s" */, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab)).FzName))
(*WhereLevel)(unsafe.Pointer(pLevel)).Fop = U8(11)
} else if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000400)) != U32(0) {
// Case 1: The table is a virtual-table. Use the VFilter and VNext
@@ -118215,7 +122476,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
if pCompare != 0 {
(*Expr)(unsafe.Pointer(pCompare)).FpLeft = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft
- (*Expr)(unsafe.Pointer(pCompare)).FpRight = crt.AssignUintptr(&pRight, Xsqlite3Expr(tls, db, 173, uintptr(0)))
+ (*Expr)(unsafe.Pointer(pCompare)).FpRight = libc.AssignUintptr(&pRight, Xsqlite3Expr(tls, db, 173, uintptr(0)))
if pRight != 0 {
(*Expr)(unsafe.Pointer(pRight)).FiTable = ((iReg + j) + 2)
Xsqlite3ExprIfFalse(tls,
@@ -118235,7 +122496,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(0)*8))
- iReleaseReg = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iReleaseReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
iRowidReg = codeEqualityTerm(tls, pParse, pTerm, pLevel, 0, bRev, iReleaseReg)
if iRowidReg != iReleaseReg {
Xsqlite3ReleaseTempReg(tls, pParse, iReleaseReg)
@@ -118257,12 +122518,12 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
var pEnd uintptr
j = 0
- pStart = crt.AssignUintptr(&pEnd, uintptr(0))
+ pStart = libc.AssignUintptr(&pEnd, uintptr(0))
if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000020)) != 0 {
- pStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(crt.PostIncInt32(&j, 1))*8))
+ pStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8))
}
if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000010)) != 0 {
- pEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(crt.PostIncInt32(&j, 1))*8))
+ pEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8))
}
if bRev != 0 {
@@ -118274,13 +122535,13 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
if pStart != 0 {
var pX uintptr // The expression that defines the start bound
var r1 int32
- // var rTemp int32 at bp+12, 4
+ // var rTemp int32 at bp+20, 4
// Registers for holding the start boundary
var op int32 // Cursor seek operation
// The following constant maps TK_xx codes into corresponding
// seek opcodes. It depends on a particular ordering of TK_xx
- *(*[4]U8)(unsafe.Pointer(bp + 8 /* aMoveOp */)) = [4]U8{
+ *(*[4]U8)(unsafe.Pointer(bp + 16 /* aMoveOp */)) = [4]U8{
/* TK_GT */ U8(25),
/* TK_LE */ U8(23),
/* TK_LT */ U8(22),
@@ -118294,19 +122555,20 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
// transitive constraints
if Xsqlite3ExprIsVector(tls, (*Expr)(unsafe.Pointer(pX)).FpRight) != 0 {
- r1 = crt.AssignPtrInt32(bp+12 /* rTemp */, Xsqlite3GetTempReg(tls, pParse))
+ r1 = libc.AssignPtrInt32(bp+20 /* rTemp */, Xsqlite3GetTempReg(tls, pParse))
codeExprOrVector(tls, pParse, (*Expr)(unsafe.Pointer(pX)).FpRight, r1, 1)
- op = int32(*(*U8)(unsafe.Pointer(bp + 8 /* &aMoveOp[0] */ + uintptr(((((int32((*Expr)(unsafe.Pointer(pX)).Fop) - 54) - 1) & 0x3) | 0x1)))))
+ op = int32(*(*U8)(unsafe.Pointer(bp + 16 /* &aMoveOp[0] */ + uintptr(((((int32((*Expr)(unsafe.Pointer(pX)).Fop) - 54) - 1) & 0x3) | 0x1)))))
} else {
- r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pX)).FpRight, bp+12 /* &rTemp */)
+ r1 = Xsqlite3ExprCodeTemp(tls, pParse, (*Expr)(unsafe.Pointer(pX)).FpRight, bp+20 /* &rTemp */)
disableTerm(tls, pLevel, pStart)
- op = int32(*(*U8)(unsafe.Pointer(bp + 8 /* &aMoveOp[0] */ + uintptr((int32((*Expr)(unsafe.Pointer(pX)).Fop) - 54)))))
+ op = int32(*(*U8)(unsafe.Pointer(bp + 16 /* &aMoveOp[0] */ + uintptr((int32((*Expr)(unsafe.Pointer(pX)).Fop) - 54)))))
}
Xsqlite3VdbeAddOp3(tls, v, op, iCur, addrBrk, r1)
+ Xsqlite3VdbeComment(tls, v, ts+17182 /* "pk" */, 0)
- Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 12 /* rTemp */)))
+ Xsqlite3ReleaseTempReg(tls, pParse, *(*int32)(unsafe.Pointer(bp + 20 /* rTemp */)))
} else {
Xsqlite3VdbeAddOp2(tls, v, func() int32 {
if bRev != 0 {
@@ -118322,7 +122584,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
// Transitive constraints
- memEndValue = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ memEndValue = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
codeExprOrVector(tls, pParse, (*Expr)(unsafe.Pointer(pX)).FpRight, memEndValue, 1)
if (0 == Xsqlite3ExprIsVector(tls, (*Expr)(unsafe.Pointer(pX)).FpRight)) &&
((int32((*Expr)(unsafe.Pointer(pX)).Fop) == 56) || (int32((*Expr)(unsafe.Pointer(pX)).Fop) == 54)) {
@@ -118353,7 +122615,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
(*WhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start
if testOp != 173 {
- iRowidReg = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iRowidReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 127, iCur, iRowidReg)
Xsqlite3VdbeAddOp3(tls, v, testOp, memEndValue, addrBrk, iRowidReg)
@@ -118391,7 +122653,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
var iIdxCur int32 // The VDBE cursor for the index
var nExtraReg int32 = 0 // Number of extra registers needed
var op int32 // Instruction opcode
- // var zStartAff uintptr at bp+16, 8
+ // var zStartAff uintptr at bp+24, 8
// Affinity for start of range constraint
var zEndAff uintptr = uintptr(0) // Affinity for end of range constraint
var bSeekPastNull U8 = U8(0) // True to seek past initial nulls
@@ -118412,7 +122674,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
// of the range.
j = int32(nEq)
if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000020)) != 0 {
- pRangeStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(crt.PostIncInt32(&j, 1))*8))
+ pRangeStart = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8))
nExtraReg = func() int32 {
if (nExtraReg) > (int32((*struct {
FnEq U16
@@ -118434,7 +122696,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
// Like optimization range constraints always occur in pairs
}
if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000010)) != 0 {
- pRangeEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(crt.PostIncInt32(&j, 1))*8))
+ pRangeEnd = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&j, 1))*8))
nExtraReg = func() int32 {
if (nExtraReg) > (int32((*struct {
FnEq U16
@@ -118472,7 +122734,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
nExtraReg = 1
bSeekPastNull = U8(1)
- (*WhereLevel)(unsafe.Pointer(pLevel)).FregBignull = crt.AssignInt32(&regBignull, crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
+ (*WhereLevel)(unsafe.Pointer(pLevel)).FregBignull = libc.AssignInt32(&regBignull, libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1))
if (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0 {
Xsqlite3VdbeAddOp2(tls, v, 69, 0, regBignull)
}
@@ -118482,7 +122744,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
// If we are doing a reverse order scan on an ascending index, or
// a forward order scan on a descending index, interchange the
// start and end terms (pRangeStart and pRangeEnd).
- if ((int32(nEq) < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)) && (bRev == (crt.Bool32(int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) == 0)))) ||
+ if ((int32(nEq) < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol)) && (bRev == (libc.Bool32(int32(*(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(nEq)))) == 0)))) ||
((bRev != 0) && (int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol) == int32(nEq))) {
{
var t uintptr = pRangeEnd
@@ -118507,10 +122769,10 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
// and store the values of those terms in an array of registers
// starting at regBase.
- regBase = codeAllEqualityTerms(tls, pParse, pLevel, bRev, nExtraReg, bp+16 /* &zStartAff */)
+ regBase = codeAllEqualityTerms(tls, pParse, pLevel, bRev, nExtraReg, bp+24 /* &zStartAff */)
- if (*(*uintptr)(unsafe.Pointer(bp + 16 /* zStartAff */)) != 0) && (nTop != 0) {
- zEndAff = Xsqlite3DbStrDup(tls, db, (*(*uintptr)(unsafe.Pointer(bp + 16 /* zStartAff */)) + uintptr(nEq)))
+ if (*(*uintptr)(unsafe.Pointer(bp + 24 /* zStartAff */)) != 0) && (nTop != 0) {
+ zEndAff = Xsqlite3DbStrDup(tls, db, (*(*uintptr)(unsafe.Pointer(bp + 24 /* zStartAff */)) + uintptr(nEq)))
}
addrNxt = func() int32 {
if regBignull != 0 {
@@ -118519,9 +122781,9 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
return (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt
}()
- startEq = (crt.Bool32(!(pRangeStart != 0) || ((int32((*WhereTerm)(unsafe.Pointer(pRangeStart)).FeOperator) & ((int32(0x0002) << (55 - 53)) | (int32(0x0002) << (57 - 53)))) != 0)))
- endEq = (crt.Bool32(!(pRangeEnd != 0) || ((int32((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FeOperator) & ((int32(0x0002) << (55 - 53)) | (int32(0x0002) << (57 - 53)))) != 0)))
- start_constraints = (crt.Bool32((pRangeStart != 0) || (int32(nEq) > 0)))
+ startEq = (libc.Bool32(!(pRangeStart != 0) || ((int32((*WhereTerm)(unsafe.Pointer(pRangeStart)).FeOperator) & ((int32(0x0002) << (55 - 53)) | (int32(0x0002) << (57 - 53)))) != 0)))
+ endEq = (libc.Bool32(!(pRangeEnd != 0) || ((int32((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FeOperator) & ((int32(0x0002) << (55 - 53)) | (int32(0x0002) << (57 - 53)))) != 0)))
+ start_constraints = (libc.Bool32((pRangeStart != 0) || (int32(nEq) > 0)))
// Seek the index cursor to the start of the range.
nConstraint = int32(nEq)
@@ -118529,12 +122791,12 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
var pRight uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pRangeStart)).FpExpr)).FpRight
codeExprOrVector(tls, pParse, pRight, (regBase + int32(nEq)), int32(nBtm))
- if ((int32((*WhereTerm)(unsafe.Pointer(pRangeStart)).FwtFlags) & 0x0000) == 0) &&
+ if ((int32((*WhereTerm)(unsafe.Pointer(pRangeStart)).FwtFlags) & 0x0080) == 0) &&
(Xsqlite3ExprCanBeNull(tls, pRight) != 0) {
Xsqlite3VdbeAddOp2(tls, v, 50, (regBase + int32(nEq)), addrNxt)
}
- if *(*uintptr)(unsafe.Pointer(bp + 16 /* zStartAff */)) != 0 {
- updateRangeAffinityStr(tls, pRight, int32(nBtm), (*(*uintptr)(unsafe.Pointer(bp + 16 /* zStartAff */)) + uintptr(nEq)))
+ if *(*uintptr)(unsafe.Pointer(bp + 24 /* zStartAff */)) != 0 {
+ updateRangeAffinityStr(tls, pRight, int32(nBtm), (*(*uintptr)(unsafe.Pointer(bp + 24 /* zStartAff */)) + uintptr(nEq)))
}
nConstraint = nConstraint + (int32(nBtm))
@@ -118554,7 +122816,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
start_constraints = 1
nConstraint++
}
- codeApplyAffinity(tls, pParse, regBase, (nConstraint - int32(bSeekPastNull)), *(*uintptr)(unsafe.Pointer(bp + 16 /* zStartAff */)))
+ codeApplyAffinity(tls, pParse, regBase, (nConstraint - int32(bSeekPastNull)), *(*uintptr)(unsafe.Pointer(bp + 24 /* zStartAff */)))
if (int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip) > 0) && (nConstraint == int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnSkip)) {
} else {
if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00040000)) != 0 {
@@ -118562,6 +122824,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
}
if regBignull != 0 {
Xsqlite3VdbeAddOp2(tls, v, 69, 1, regBignull)
+ Xsqlite3VdbeComment(tls, v, ts+23353 /* "NULL-scan pass c..." */, 0)
}
op = int32(aStartOp[(((start_constraints << 2) + (startEq << 1)) + bRev)])
@@ -118571,7 +122834,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
if regBignull != 0 {
Xsqlite3VdbeAddOp2(tls, v, 11, 0, (Xsqlite3VdbeCurrentAddr(tls, v) + 2))
- op = int32(aStartOp[((((crt.Bool32(nConstraint > 1)) * 4) + 2) + bRev)])
+ op = int32(aStartOp[((((libc.Bool32(nConstraint > 1)) * 4) + 2) + bRev)])
Xsqlite3VdbeAddOp4Int(tls, v, op, iIdxCur, addrNxt, regBase,
(nConstraint - startEq))
@@ -118585,7 +122848,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
var pRight uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FpExpr)).FpRight
codeExprOrVector(tls, pParse, pRight, (regBase + int32(nEq)), int32(nTop))
- if ((int32((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FwtFlags) & 0x0000) == 0) &&
+ if ((int32((*WhereTerm)(unsafe.Pointer(pRangeEnd)).FwtFlags) & 0x0080) == 0) &&
(Xsqlite3ExprCanBeNull(tls, pRight) != 0) {
Xsqlite3VdbeAddOp2(tls, v, 50, (regBase + int32(nEq)), addrNxt)
}
@@ -118608,7 +122871,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
}
nConstraint++
}
- Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 16 /* zStartAff */)))
+ Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 24 /* zStartAff */)))
Xsqlite3DbFree(tls, db, zEndAff)
// Top of the loop body
@@ -118619,7 +122882,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
if regBignull != 0 {
// Except, skip the end-of-range check while doing the NULL-scan
Xsqlite3VdbeAddOp2(tls, v, 20, regBignull, (Xsqlite3VdbeCurrentAddr(tls, v) + 3))
-
+ Xsqlite3VdbeComment(tls, v, ts+23372 /* "If NULL-scan 2nd..." */, 0)
}
op = int32(aEndOp[((bRev * 2) + endEq)])
Xsqlite3VdbeAddOp4Int(tls, v, op, iIdxCur, addrNxt, regBase, nConstraint)
@@ -118630,6 +122893,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
// the NULLs
Xsqlite3VdbeAddOp2(tls, v, 18, regBignull, (Xsqlite3VdbeCurrentAddr(tls, v) + 2))
+ Xsqlite3VdbeComment(tls, v, ts+23394 /* "If NULL-scan 1st..." */, 0)
op = int32(aEndOp[((bRev * 2) + int32(bSeekPastNull))])
Xsqlite3VdbeAddOp4Int(tls, v, op, iIdxCur, addrNxt, regBase,
@@ -118642,14 +122906,14 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
}
// Seek the table cursor, if required
- omitTable = (crt.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000040)) != U32(0)) &&
+ omitTable = (libc.Bool32((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000040)) != U32(0)) &&
((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & 0x0020) == 0)))
if omitTable != 0 {
} else if ((*Table)(unsafe.Pointer(((*Index)(unsafe.Pointer(pIdx)).FpTable))).FtabFlags & U32(0x0080)) == U32(0) {
if ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & 0x0400) != 0) ||
(((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & 0x1000) != 0) &&
((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == 1) || (int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnLTerm) == 0))) {
- iRowidReg = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ iRowidReg = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 134, iIdxCur, iRowidReg)
Xsqlite3VdbeAddOp3(tls, v, 32, iCur, 0, iRowidReg)
} else {
@@ -118768,20 +123032,20 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
// use an ephemeral index instead of a RowSet to record the primary
// keys of the rows we have already seen.
//
- var pOrWc uintptr // The OR-clause broken out into subterms
- var pOrTab uintptr // Shortened table list or OR-clause generation
- var pCov uintptr = uintptr(0) // Potential covering index (or NULL)
- var iCovCur int32 = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) // Cursor used for index scans (if any)
-
- var regReturn int32 = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Register used with OP_Gosub
- var regRowset int32 = 0 // Register for RowSet object
- var regRowid int32 = 0 // Register holding rowid
- var iLoopBody int32 = Xsqlite3VdbeMakeLabel(tls, pParse) // Start of loop body
- var iRetInit int32 // Address of regReturn init
- var untestedTerms int32 = 0 // Some terms not completely tested
- var ii int32 // Loop counter
- var wctrlFlags U16 // Flags for sub-WHERE clause
- var pAndExpr uintptr = uintptr(0) // An ".. AND (...)" expression
+ var pOrWc uintptr // The OR-clause broken out into subterms
+ var pOrTab uintptr // Shortened table list or OR-clause generation
+ var pCov uintptr = uintptr(0) // Potential covering index (or NULL)
+ var iCovCur int32 = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1) // Cursor used for index scans (if any)
+
+ var regReturn int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Register used with OP_Gosub
+ var regRowset int32 = 0 // Register for RowSet object
+ var regRowid int32 = 0 // Register holding rowid
+ var iLoopBody int32 = Xsqlite3VdbeMakeLabel(tls, pParse) // Start of loop body
+ var iRetInit int32 // Address of regReturn init
+ var untestedTerms int32 = 0 // Some terms not completely tested
+ var ii int32 // Loop counter
+ var wctrlFlags U16 // Flags for sub-WHERE clause
+ var pAndExpr uintptr = uintptr(0) // An ".. AND (...)" expression
var pTab uintptr = (*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab
pTerm = *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(0)*8))
@@ -118803,10 +123067,10 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
}
(*SrcList)(unsafe.Pointer(pOrTab)).FnAlloc = U32((U8(nNotReady + 1)))
(*SrcList)(unsafe.Pointer(pOrTab)).FnSrc = int32((*SrcList)(unsafe.Pointer(pOrTab)).FnAlloc)
- crt.Xmemcpy(tls, pOrTab+8 /* &.a */, pTabItem, uint64(unsafe.Sizeof(SrcList_item{})))
+ libc.Xmemcpy(tls, pOrTab+8 /* &.a */, pTabItem, uint64(unsafe.Sizeof(SrcList_item{})))
origSrc = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */
for k = 1; k <= nNotReady; k++ {
- crt.Xmemcpy(tls, ((pOrTab + 8 /* &.a */) + uintptr(k)*112), (origSrc + uintptr((*WhereLevel)(unsafe.Pointer(pLevel+uintptr(k)*88)).FiFrom)*112), uint64(unsafe.Sizeof(SrcList_item{})))
+ libc.Xmemcpy(tls, ((pOrTab + 8 /* &.a */) + uintptr(k)*112), (origSrc + uintptr((*WhereLevel)(unsafe.Pointer(pLevel+uintptr(k)*88)).FiFrom)*112), uint64(unsafe.Sizeof(SrcList_item{})))
}
} else {
pOrTab = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList
@@ -118825,15 +123089,15 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
// called on an uninitialized cursor.
if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & 0x0010) == 0 {
if ((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0) {
- regRowset = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regRowset = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 72, 0, regRowset)
} else {
var pPk uintptr = Xsqlite3PrimaryKeyIndex(tls, pTab)
- regRowset = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ regRowset = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
Xsqlite3VdbeAddOp2(tls, v, 100, regRowset, int32((*Index)(unsafe.Pointer(pPk)).FnKeyCol))
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pPk)
}
- regRowid = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
iRetInit = Xsqlite3VdbeAddOp2(tls, v, 69, 0, regReturn)
@@ -118882,7 +123146,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
// eliminating duplicates from other WHERE clauses, the action for each
// sub-WHERE clause is to to invoke the main loop body as a subroutine.
wctrlFlags = (U16(0x0020 | (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & 0x0400)))
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19497 /* "MULTI-INDEX OR" */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+23416 /* "MULTI-INDEX OR" */, 0)
for ii = 0; ii < (*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm; ii++ {
var pOrTerm uintptr = ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa + uintptr(ii)*64)
if ((*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCur) || ((int32((*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator) & 0x0400) != 0) {
@@ -118895,7 +123159,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
pOrExpr = pAndExpr
}
// Loop through table entries that match term pOrTerm.
- Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+19512 /* "INDEX %d" */, crt.VaList(bp, (ii+1)))
+ Xsqlite3VdbeExplain(tls, pParse, uint8(1), ts+23431 /* "INDEX %d" */, libc.VaList(bp+8, (ii+1)))
pSubWInfo = Xsqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0),
wctrlFlags, iCovCur)
@@ -118935,17 +123199,17 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
Xsqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, iCol, (r + iPk))
}
- /* Check if the temp table already contains this key. If so,
- ** the row has already been included in the result set and
- ** can be ignored (by jumping past the Gosub below). Otherwise,
- ** insert the key into the temp table and proceed with processing
- ** the row.
- **
- ** Use some of the same optimizations as OP_RowSetTest: If iSet
- ** is zero, assume that the key cannot already be present in
- ** the temp table. And if iSet is -1, assume that there is no
- ** need to insert the key into the temp table, as it will never
- ** be tested for. */
+ // Check if the temp table already contains this key. If so,
+ // the row has already been included in the result set and
+ // can be ignored (by jumping past the Gosub below). Otherwise,
+ // insert the key into the temp table and proceed with processing
+ // the row.
+ //
+ // Use some of the same optimizations as OP_RowSetTest: If iSet
+ // is zero, assume that the key cannot already be present in
+ // the temp table. And if iSet is -1, assume that there is no
+ // need to insert the key into the temp table, as it will never
+ // be tested for.
if iSet != 0 {
jmp1 = Xsqlite3VdbeAddOp4Int(tls, v, 30, regRowset, 0, r, nPk)
}
@@ -119097,7 +123361,7 @@ func Xsqlite3WhereCodeOneLoopStart(tls *crt.TLS, pParse uintptr, v uintptr, pWIn
}
if ((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLevel)(unsafe.Pointer(pLevel)).FnotReady) != uint64(0) {
- crt.SetBitFieldPtr8Uint32(pWInfo+68 /* &.untestedTerms */, uint32(1), 1, 0x2)
+ libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.untestedTerms */, uint32(1), 1, 0x2)
goto __2
}
pE = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
@@ -119157,7 +123421,7 @@ __4:
}
{
var pE uintptr
- // var sEAlt Expr at bp+24, 72
+ // var sEAlt Expr at bp+32, 72
var pAlt uintptr
if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & (0x0002 | 0x0004)) != 0 {
@@ -119191,9 +123455,9 @@ __4:
goto __5
}
- *(*Expr)(unsafe.Pointer(bp + 24 /* sEAlt */)) = *(*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr))
- (*Expr)(unsafe.Pointer(bp + 24 /* &sEAlt */)).FpLeft = (*Expr)(unsafe.Pointer(pE)).FpLeft
- Xsqlite3ExprIfFalse(tls, pParse, bp+24 /* &sEAlt */, addrCont, 0x10)
+ *(*Expr)(unsafe.Pointer(bp + 32 /* sEAlt */)) = *(*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pAlt)).FpExpr))
+ (*Expr)(unsafe.Pointer(bp + 32 /* &sEAlt */)).FpLeft = (*Expr)(unsafe.Pointer(pE)).FpLeft
+ Xsqlite3ExprIfFalse(tls, pParse, bp+32 /* &sEAlt */, addrCont, 0x10)
}
goto __5
__5:
@@ -119209,7 +123473,7 @@ __6:
if (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin != 0 {
(*WhereLevel)(unsafe.Pointer(pLevel)).FaddrFirst = Xsqlite3VdbeCurrentAddr(tls, v)
Xsqlite3VdbeAddOp2(tls, v, 69, 1, (*WhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin)
-
+ Xsqlite3VdbeComment(tls, v, ts+23440 /* "record LEFT JOIN..." */, 0)
pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
j = 0
__7:
@@ -119250,24 +123514,24 @@ var aStartOp = [8]U8{
U8(22), // 5: (start_constraints && !startEq && bRev)
U8(24), // 6: (start_constraints && startEq && !bRev)
U8(23), // 7: (start_constraints && startEq && bRev)
-} /* sqlite3.c:142517:21 */
+} /* sqlite3.c:143140:21 */
var aEndOp = [4]U8{
U8(41), // 0: (end_constraints && !bRev && !endEq)
U8(39), // 1: (end_constraints && !bRev && endEq)
U8(38), // 2: (end_constraints && bRev && !endEq)
U8(40), // 3: (end_constraints && bRev && endEq)
-} /* sqlite3.c:142527:21 */
-var aStep = [2]U8{U8(5), U8(4)} /* sqlite3.c:143193:21 */
-var aStart = [2]U8{U8(37), U8(33)} /* sqlite3.c:143194:21 */
+} /* sqlite3.c:143150:21 */
+var aStep = [2]U8{U8(5), U8(4)} /* sqlite3.c:143816:21 */
+var aStart = [2]U8{U8(37), U8(33)} /* sqlite3.c:143817:21 */
// Deallocate all memory associated with a WhereOrInfo object.
-func whereOrInfoDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:143401:13: */
+func whereOrInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:144024:13: */
Xsqlite3WhereClauseClear(tls, (p /* &.wc */))
Xsqlite3DbFree(tls, db, p)
}
// Deallocate all memory associated with a WhereAndInfo object.
-func whereAndInfoDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:143409:13: */
+func whereAndInfoDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:144032:13: */
Xsqlite3WhereClauseClear(tls, (p /* &.wc */))
Xsqlite3DbFree(tls, db, p)
}
@@ -119289,7 +123553,7 @@ func whereAndInfoDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:1434
// WhereTerms. All pointers to WhereTerms should be invalidated after
// calling this routine. Such pointers may be reinitialized by referencing
// the pWC->a[] array.
-func whereClauseInsert(tls *crt.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 { /* sqlite3.c:143433:12: */
+func whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags U16) int32 { /* sqlite3.c:144056:12: */
var pTerm uintptr
var idx int32
@@ -119304,13 +123568,13 @@ func whereClauseInsert(tls *crt.TLS, pWC uintptr, p uintptr, wtFlags U16) int32
(*WhereClause)(unsafe.Pointer(pWC)).Fa = pOld
return 0
}
- crt.Xmemcpy(tls, (*WhereClause)(unsafe.Pointer(pWC)).Fa, pOld, (uint64(unsafe.Sizeof(WhereTerm{})) * uint64((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)))
+ libc.Xmemcpy(tls, (*WhereClause)(unsafe.Pointer(pWC)).Fa, pOld, (uint64(unsafe.Sizeof(WhereTerm{})) * uint64((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)))
if pOld != pWC+40 /* &.aStatic */ {
Xsqlite3DbFree(tls, db, pOld)
}
(*WhereClause)(unsafe.Pointer(pWC)).FnSlot = (int32(uint64(Xsqlite3DbMallocSize(tls, db, (*WhereClause)(unsafe.Pointer(pWC)).Fa)) / uint64(unsafe.Sizeof(WhereTerm{}))))
}
- pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(crt.AssignInt32(&idx, crt.PostIncInt32(&(*WhereClause)(unsafe.Pointer(pWC)).FnTerm, 1)))*64)
+ pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(libc.AssignInt32(&idx, libc.PostIncInt32(&(*WhereClause)(unsafe.Pointer(pWC)).FnTerm, 1)))*64)
if (p != 0) && (((*Expr)(unsafe.Pointer((p))).Fflags & (U32(0x040000))) != U32(0)) {
(*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb = (LogEst(int32(Xsqlite3LogEst(tls, uint64((*Expr)(unsafe.Pointer(p)).FiTable))) - 270))
} else {
@@ -119320,7 +123584,7 @@ func whereClauseInsert(tls *crt.TLS, pWC uintptr, p uintptr, wtFlags U16) int32
(*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags = wtFlags
(*WhereTerm)(unsafe.Pointer(pTerm)).FpWC = pWC
(*WhereTerm)(unsafe.Pointer(pTerm)).FiParent = -1
- crt.Xmemset(tls, (pTerm + 20 /* &.eOperator */), 0,
+ libc.Xmemset(tls, (pTerm + 20 /* &.eOperator */), 0,
(uint64(unsafe.Sizeof(WhereTerm{})) - (uint64((uintptr(0) + 20 /* &.eOperator */)))))
return idx
}
@@ -119328,14 +123592,14 @@ func whereClauseInsert(tls *crt.TLS, pWC uintptr, p uintptr, wtFlags U16) int32
// Return TRUE if the given operator is one of the operators that is
// allowed for an indexable WHERE clause term. The allowed operators are
// "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL"
-func allowedOp(tls *crt.TLS, op int32) int32 { /* sqlite3.c:143474:12: */
+func allowedOp(tls *libc.TLS, op int32) int32 { /* sqlite3.c:144097:12: */
- return (crt.Bool32((((op == 49) || ((op >= 53) && (op <= 57))) || (op == 50)) || (op == 45)))
+ return (libc.Bool32((((op == 49) || ((op >= 53) && (op <= 57))) || (op == 50)) || (op == 45)))
}
// Commute a comparison operator. Expressions of the form "X op Y"
// are converted into "Y op X".
-func exprCommute(tls *crt.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3.c:143486:12: */
+func exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3.c:144109:12: */
if ((int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == 174) ||
(int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fop) == 174)) ||
(Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpLeft, (*Expr)(unsafe.Pointer(pExpr)).FpRight) != Xsqlite3BinaryCompareCollSeq(tls, pParse, (*Expr)(unsafe.Pointer(pExpr)).FpRight, (*Expr)(unsafe.Pointer(pExpr)).FpLeft)) {
@@ -119355,7 +123619,7 @@ func exprCommute(tls *crt.TLS, pParse uintptr, pExpr uintptr) U16 { /* sqlite3.c
}
// Translate from TK_xx operator to WO_xx bitmask.
-func operatorMask(tls *crt.TLS, op int32) U16 { /* sqlite3.c:143509:12: */
+func operatorMask(tls *libc.TLS, op int32) U16 { /* sqlite3.c:144132:12: */
var c U16
if op == 49 {
@@ -119382,7 +123646,7 @@ func operatorMask(tls *crt.TLS, op int32) U16 { /* sqlite3.c:143509:12: */
// that virtual tables cannot participate in the LIKE optimization.) The
// collating sequence for the column on the LHS must be appropriate for
// the operator.
-func isLikeOrGlob(tls *crt.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr, pisComplete uintptr, pnoCase uintptr) int32 { /* sqlite3.c:143547:12: */
+func isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr, pisComplete uintptr, pnoCase uintptr) int32 { /* sqlite3.c:144170:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -119422,7 +123686,7 @@ func isLikeOrGlob(tls *crt.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr,
// Count the number of prefix characters prior to the first wildcard
cnt = 0
- for ((((int32(crt.AssignUint8(&c, *(*U8)(unsafe.Pointer(z + uintptr(cnt)))))) != 0) && (int32(c) != int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + uintptr(0)))))) && (int32(c) != int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + uintptr(1)))))) && (int32(c) != int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + uintptr(2))))) {
+ for ((((int32(libc.AssignUint8(&c, *(*U8)(unsafe.Pointer(z + uintptr(cnt)))))) != 0) && (int32(c) != int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + uintptr(0)))))) && (int32(c) != int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + uintptr(1)))))) && (int32(c) != int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + uintptr(2))))) {
cnt++
if (int32(c) == int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + uintptr(3))))) && (int32(*(*U8)(unsafe.Pointer(z + uintptr(cnt)))) != 0) {
cnt++
@@ -119441,7 +123705,7 @@ func isLikeOrGlob(tls *crt.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr,
var pPrefix uintptr
// A "complete" match if the pattern ends with "*" or "%"
- *(*int32)(unsafe.Pointer(pisComplete)) = (crt.Bool32((int32(c) == int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + uintptr(0))))) && (int32(*(*U8)(unsafe.Pointer(z + uintptr((cnt + 1))))) == 0)))
+ *(*int32)(unsafe.Pointer(pisComplete)) = (libc.Bool32((int32(c) == int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + uintptr(0))))) && (int32(*(*U8)(unsafe.Pointer(z + uintptr((cnt + 1))))) == 0)))
// Get the pattern prefix. Remove all escapes from the prefix.
pPrefix = Xsqlite3Expr(tls, db, 115, z)
@@ -119450,11 +123714,11 @@ func isLikeOrGlob(tls *crt.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr,
var iTo int32
var zNew uintptr = *(*uintptr)(unsafe.Pointer(pPrefix + 8 /* &.u */))
*(*int8)(unsafe.Pointer(zNew + uintptr(cnt))) = int8(0)
- for iFrom = crt.AssignInt32(&iTo, 0); iFrom < cnt; iFrom++ {
+ for iFrom = libc.AssignInt32(&iTo, 0); iFrom < cnt; iFrom++ {
if int32(*(*int8)(unsafe.Pointer(zNew + uintptr(iFrom)))) == int32(*(*U8)(unsafe.Pointer(bp /* &wc[0] */ + uintptr(3)))) {
iFrom++
}
- *(*int8)(unsafe.Pointer(zNew + uintptr(crt.PostIncInt32(&iTo, 1)))) = *(*int8)(unsafe.Pointer(zNew + uintptr(iFrom)))
+ *(*int8)(unsafe.Pointer(zNew + uintptr(libc.PostIncInt32(&iTo, 1)))) = *(*int8)(unsafe.Pointer(zNew + uintptr(iFrom)))
}
*(*int8)(unsafe.Pointer(zNew + uintptr(iTo))) = int8(0)
@@ -119501,12 +123765,11 @@ func isLikeOrGlob(tls *crt.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr,
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
Xsqlite3VdbeSetVarmask(tls, v, int32((*Expr)(unsafe.Pointer(pRight)).FiColumn))
if (*(*int32)(unsafe.Pointer(pisComplete)) != 0) && (*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 8 /* &.u */)) + uintptr(1))) != 0) {
- /* If the rhs of the LIKE expression is a variable, and the current
- ** value of the variable means there is no need to invoke the LIKE
- ** function, then no OP_Variable will be added to the program.
- ** This causes problems for the sqlite3_bind_parameter_name()
- ** API. To work around them, add a dummy OP_Variable here.
- */
+ // If the rhs of the LIKE expression is a variable, and the current
+ // value of the variable means there is no need to invoke the LIKE
+ // function, then no OP_Variable will be added to the program.
+ // This causes problems for the sqlite3_bind_parameter_name()
+ // API. To work around them, add a dummy OP_Variable here.
var r1 int32 = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3ExprCodeTarget(tls, pParse, pRight, r1)
Xsqlite3VdbeChangeP3(tls, v, (Xsqlite3VdbeCurrentAddr(tls, v) - 1), 0)
@@ -119518,7 +123781,7 @@ func isLikeOrGlob(tls *crt.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr,
}
}
- rc = (crt.Bool32(z != uintptr(0)))
+ rc = (libc.Bool32(z != uintptr(0)))
Xsqlite3ValueFree(tls, pVal)
return rc
}
@@ -119547,7 +123810,7 @@ func isLikeOrGlob(tls *crt.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr,
// of virtual table in forms (5) or (7) then return 2.
//
// If the expression matches none of the patterns above, return 0.
-func isAuxiliaryVtabOperator(tls *crt.TLS, db uintptr, pExpr uintptr, peOp2 uintptr, ppLeft uintptr, ppRight uintptr) int32 { /* sqlite3.c:143719:12: */
+func isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 uintptr, ppLeft uintptr, ppRight uintptr) int32 { /* sqlite3.c:144342:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -119602,7 +123865,7 @@ func isAuxiliaryVtabOperator(tls *crt.TLS, db uintptr, pExpr uintptr, peOp2 uint
pMod = (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule
if (*Sqlite3_module)(unsafe.Pointer(pMod)).FxFindFunction != uintptr(0) {
- i = (*(*func(*crt.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pMod + 144 /* &.xFindFunction */))))(tls, pVtab, 2, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), bp /* &xNotUsed */, bp+8 /* &pNotUsed */)
+ i = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pMod + 144 /* &.xFindFunction */))))(tls, pVtab, 2, *(*uintptr)(unsafe.Pointer(pExpr + 8 /* &.u */)), bp /* &xNotUsed */, bp+8 /* &pNotUsed */)
if i >= 150 {
*(*uint8)(unsafe.Pointer(peOp2)) = uint8(i)
*(*uintptr)(unsafe.Pointer(ppRight)) = (*ExprList_item)(unsafe.Pointer((pList + 8 /* &.a */) + uintptr(1)*32)).FpExpr
@@ -119651,15 +123914,15 @@ type Op2 = struct {
}
var aOp = [4]Op2{
- {FzOp: ts + 14154 /* "match" */, FeOp2: uint8(64)},
- {FzOp: ts + 13634 /* "glob" */, FeOp2: uint8(66)},
- {FzOp: ts + 13216 /* "like" */, FeOp2: uint8(65)},
- {FzOp: ts + 19521 /* "regexp" */, FeOp2: uint8(67)},
-} /* sqlite3.c:143730:7 */
+ {FzOp: ts + 17143 /* "match" */, FeOp2: uint8(64)},
+ {FzOp: ts + 16437 /* "glob" */, FeOp2: uint8(66)},
+ {FzOp: ts + 15997 /* "like" */, FeOp2: uint8(65)},
+ {FzOp: ts + 23461 /* "regexp" */, FeOp2: uint8(67)},
+} /* sqlite3.c:144353:7 */
// If the pBase expression originated in the ON or USING clause of
// a join, then transfer the appropriate markings over to derived.
-func transferJoinMarkings(tls *crt.TLS, pDerived uintptr, pBase uintptr) { /* sqlite3.c:143824:13: */
+func transferJoinMarkings(tls *libc.TLS, pDerived uintptr, pBase uintptr) { /* sqlite3.c:144447:13: */
if pDerived != 0 {
*(*U32)(unsafe.Pointer(pDerived + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer(pBase)).Fflags & U32(0x000001))
(*Expr)(unsafe.Pointer(pDerived)).FiRightJoinTable = (*Expr)(unsafe.Pointer(pBase)).FiRightJoinTable
@@ -119667,7 +123930,7 @@ func transferJoinMarkings(tls *crt.TLS, pDerived uintptr, pBase uintptr) { /* sq
}
// Mark term iChild as being a child of term iParent
-func markTermAsChild(tls *crt.TLS, pWC uintptr, iChild int32, iParent int32) { /* sqlite3.c:143834:13: */
+func markTermAsChild(tls *libc.TLS, pWC uintptr, iChild int32, iParent int32) { /* sqlite3.c:144457:13: */
(*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*64)).FiParent = iParent
(*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iChild)*64)).FtruthProb = (*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(iParent)*64)).FtruthProb
(*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr(iParent)*64)).FnChild++
@@ -119676,7 +123939,7 @@ func markTermAsChild(tls *crt.TLS, pWC uintptr, iChild int32, iParent int32) { /
// Return the N-th AND-connected subterm of pTerm. Or if pTerm is not
// a conjunction, then return just pTerm when N==0. If N is exceeds
// the number of available subterms, return NULL.
-func whereNthSubterm(tls *crt.TLS, pTerm uintptr, N int32) uintptr { /* sqlite3.c:143845:18: */
+func whereNthSubterm(tls *libc.TLS, pTerm uintptr, N int32) uintptr { /* sqlite3.c:144468:18: */
if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) != 0x0400 {
if N == 0 {
return pTerm
@@ -119707,7 +123970,7 @@ func whereNthSubterm(tls *crt.TLS, pTerm uintptr, N int32) uintptr { /* sqlite3.
// The following is NOT generated:
//
// x<y OR x>y --> x!=y
-func whereCombineDisjuncts(tls *crt.TLS, pSrc uintptr, pWC uintptr, pOne uintptr, pTwo uintptr) { /* sqlite3.c:143875:13: */
+func whereCombineDisjuncts(tls *libc.TLS, pSrc uintptr, pWC uintptr, pOne uintptr, pTwo uintptr) { /* sqlite3.c:144498:13: */
var eOp U16 = (U16(int32((*WhereTerm)(unsafe.Pointer(pOne)).FeOperator) | int32((*WhereTerm)(unsafe.Pointer(pTwo)).FeOperator)))
var db uintptr // Database connection (for malloc)
var pNew uintptr // New virtual expression
@@ -119837,7 +124100,7 @@ func whereCombineDisjuncts(tls *crt.TLS, pSrc uintptr, pWC uintptr, pOne uintptr
//
// If none of cases 1, 2, or 3 apply, then leave the eOperator set to
// zero. This term is not useful for search.
-func exprAnalyzeOrTerm(tls *crt.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:144001:13: */
+func exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:144624:13: */
var pWInfo uintptr = (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo // WHERE clause processing context
var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse // Parser context
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb // Database connection
@@ -119854,13 +124117,13 @@ func exprAnalyzeOrTerm(tls *crt.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) {
// stored in a WhereClause structure containing within the WhereOrInfo
// object that is attached to the original OR clause term.
- *(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)) = crt.AssignUintptr(&pOrInfo, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(WhereOrInfo{}))))
+ *(*uintptr)(unsafe.Pointer(pTerm + 40 /* &.u */)) = libc.AssignUintptr(&pOrInfo, Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(WhereOrInfo{}))))
if pOrInfo == uintptr(0) {
return
}
*(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((0x0010))
pOrWc = (pOrInfo /* &.wc */)
- crt.Xmemset(tls, pOrWc+40 /* &.aStatic */, 0, uint64(unsafe.Sizeof([8]WhereTerm{})))
+ libc.Xmemset(tls, pOrWc+40 /* &.aStatic */, 0, uint64(unsafe.Sizeof([8]WhereTerm{})))
Xsqlite3WhereClauseInit(tls, pOrWc, pWInfo)
Xsqlite3WhereSplit(tls, pOrWc, pExpr, uint8(43))
Xsqlite3WhereExprAnalyze(tls, pSrc, pOrWc)
@@ -119869,8 +124132,8 @@ func exprAnalyzeOrTerm(tls *crt.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) {
}
// Compute the set of tables that might satisfy cases 1 or 3.
- indexable = ^uint64(crt.Uint64FromUint64(uint64(0)))
- chngToIN = ^uint64(crt.Uint64FromUint64(uint64(0)))
+ indexable = ^uint64(libc.Uint64FromUint64(uint64(0)))
+ chngToIN = ^uint64(libc.Uint64FromUint64(uint64(0)))
i = ((*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm - 1)
pOrTerm = (*WhereClause)(unsafe.Pointer(pOrWc)).Fa
__1:
@@ -119892,7 +124155,7 @@ __1:
*(*U16)(unsafe.Pointer(pOrTerm + 18 /* &.wtFlags */)) |= U16((0x0020))
(*WhereTerm)(unsafe.Pointer(pOrTerm)).FeOperator = U16(0x0400)
pAndWC = (pAndInfo /* &.wc */)
- crt.Xmemset(tls, pAndWC+40 /* &.aStatic */, 0, uint64(unsafe.Sizeof([8]WhereTerm{})))
+ libc.Xmemset(tls, pAndWC+40 /* &.aStatic */, 0, uint64(unsafe.Sizeof([8]WhereTerm{})))
Xsqlite3WhereClauseInit(tls, pAndWC, (*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)
Xsqlite3WhereSplit(tls, pAndWC, (*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr, uint8(44))
Xsqlite3WhereExprAnalyze(tls, pSrc, pAndWC)
@@ -119960,10 +124223,10 @@ __3:
if (indexable != 0) && ((*WhereClause)(unsafe.Pointer(pOrWc)).FnTerm == 2) {
var iOne int32 = 0
var pOne uintptr
- for (crt.AssignUintptr(&pOne, whereNthSubterm(tls, ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa+uintptr(0)*64), crt.PostIncInt32(&iOne, 1)))) != uintptr(0) {
+ for (libc.AssignUintptr(&pOne, whereNthSubterm(tls, ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa+uintptr(0)*64), libc.PostIncInt32(&iOne, 1)))) != uintptr(0) {
var iTwo int32 = 0
var pTwo uintptr
- for (crt.AssignUintptr(&pTwo, whereNthSubterm(tls, ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa+uintptr(1)*64), crt.PostIncInt32(&iTwo, 1)))) != uintptr(0) {
+ for (libc.AssignUintptr(&pTwo, whereNthSubterm(tls, ((*WhereClause)(unsafe.Pointer(pOrWc)).Fa+uintptr(1)*64), libc.PostIncInt32(&iTwo, 1)))) != uintptr(0) {
whereCombineDisjuncts(tls, pSrc, pWC, pOne, pTwo)
}
}
@@ -120009,7 +124272,7 @@ __3:
}
{
- *(*U16)(unsafe.Pointer(pOrTerm + 18 /* &.wtFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0040))))
+ *(*U16)(unsafe.Pointer(pOrTerm + 18 /* &.wtFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0040))))
if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor == iCursor {
// This is the 2-bit case and we are on the second iteration and
// current term is from the first iteration. So skip this term.
@@ -120055,7 +124318,7 @@ __3:
{
if (*WhereTerm)(unsafe.Pointer(pOrTerm)).FleftCursor != iCursor {
- *(*U16)(unsafe.Pointer(pOrTerm + 18 /* &.wtFlags */)) &= crt.Uint16FromInt32((^int32(crt.Int32FromInt32(0x0040))))
+ *(*U16)(unsafe.Pointer(pOrTerm + 18 /* &.wtFlags */)) &= libc.Uint16FromInt32((^int32(libc.Int32FromInt32(0x0040))))
} else if (*(*int32)(unsafe.Pointer(pOrTerm + 40 /* &.u */)) != iColumn) || ((iColumn == (-2)) &&
(Xsqlite3ExprCompare(tls, pParse, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pOrTerm)).FpExpr)).FpLeft, pLeft, -1) != 0)) {
okToChngToIN = 0
@@ -120148,7 +124411,7 @@ __3:
// for the LHS anyplace else in the WHERE clause where the LHS column occurs.
// This is an optimization. No harm comes from returning 0. But if 1 is
// returned when it should not be, then incorrect answers might result.
-func termIsEquivalence(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:144272:12: */
+func termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:144895:12: */
var aff1 int8
var aff2 int8
var pColl uintptr
@@ -120177,7 +124440,7 @@ func termIsEquivalence(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 { /* s
// Recursively walk the expressions of a SELECT statement and generate
// a bitmask indicating which tables are used in that expression
// tree.
-func exprSelectUsage(tls *crt.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* sqlite3.c:144295:16: */
+func exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* sqlite3.c:144918:16: */
var mask Bitmask = uint64(0)
for pS != 0 {
var pSrc uintptr = (*Select)(unsafe.Pointer(pS)).FpSrc
@@ -120212,7 +124475,7 @@ func exprSelectUsage(tls *crt.TLS, pMaskSet uintptr, pS uintptr) Bitmask { /* sq
// If pExpr is a TK_COLUMN column reference, then this routine always returns
// true even if that particular column is not indexed, because the column
// might be added to an automatic index later.
-func exprMightBeIndexed2(tls *crt.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr) int32 { /* sqlite3.c:144332:28: */
+func exprMightBeIndexed2(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr) int32 { /* sqlite3.c:144955:28: */
var pIdx uintptr
var i int32
var iCur int32
@@ -120249,7 +124512,7 @@ __3:
}
return 0
}
-func exprMightBeIndexed(tls *crt.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr, op int32) int32 { /* sqlite3.c:144356:12: */
+func exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol uintptr, pExpr uintptr, op int32) int32 { /* sqlite3.c:144979:12: */
// If this expression is a vector to the left or right of a
// inequality constraint (>, <, >= or <=), perform the processing
// on the first element of the vector.
@@ -120288,7 +124551,7 @@ func exprMightBeIndexed(tls *crt.TLS, pFrom uintptr, mPrereq Bitmask, aiCurCol u
// needs to be freed with the WhereClause) and TERM_VIRTUAL (because it
// is a commuted copy of a prior term.) The original term has nChild=1
// and the copy has idxParent set to the index of the original term.
-func exprAnalyze(tls *crt.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:144401:13: */
+func exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sqlite3.c:145024:13: */
bp := tls.Alloc(48)
defer tls.Free(48)
@@ -120343,7 +124606,7 @@ func exprAnalyze(tls *crt.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sq
extraRight = (x - uint64(1)) // ON clause terms may not be used with an index
// on left table of a LEFT JOIN. Ticket #3015
if (prereqAll >> 1) >= x {
- Xsqlite3ErrorMsg(tls, pParse, ts+19528 /* "ON clause refere..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+23468 /* "ON clause refere..." */, 0)
return
}
}
@@ -120473,7 +124736,7 @@ func exprAnalyze(tls *crt.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sq
var i int32
var c int8
*(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((0x0400))
- for i = 0; (int32(crt.AssignInt8(&c, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pStr1 */)) + 8 /* &.u */)) + uintptr(i)))))) != 0; i++ {
+ for i = 0; (int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pStr1 */)) + 8 /* &.u */)) + uintptr(i)))))) != 0; i++ {
*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pStr1 */)) + 8 /* &.u */)) + uintptr(i))) = (int8((int32(c)) & ^(int32(Xsqlite3CtypeMap[uint8(c)]) & 0x20)))
*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pStr2 + 8 /* &.u */)) + uintptr(i))) = int8(Xsqlite3UpperToLower[uint8(c)])
}
@@ -120499,7 +124762,7 @@ func exprAnalyze(tls *crt.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sq
}
zCollSeqName = func() uintptr {
if *(*int32)(unsafe.Pointer(bp + 20 /* noCase */)) != 0 {
- return ts + 19569 /* "NOCASE" */
+ return ts + 23509 /* "NOCASE" */
}
return uintptr(unsafe.Pointer(&Xsqlite3StrBINARY))
}()
@@ -120538,7 +124801,7 @@ func exprAnalyze(tls *crt.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sq
*(*uintptr)(unsafe.Pointer(bp + 40 /* pRight */)) = uintptr(0)
*(*uintptr)(unsafe.Pointer(bp + 32 /* pLeft */)) = uintptr(0)
var res int32 = isAuxiliaryVtabOperator(tls, db, pExpr, bp+24 /* &eOp2 */, bp+32 /* &pLeft */, bp+40 /* &pRight */)
- for crt.PostDecInt32(&res, 1) > 0 {
+ for libc.PostDecInt32(&res, 1) > 0 {
var idxNew int32
var pNewTerm uintptr
var prereqColumn Bitmask
@@ -120584,7 +124847,7 @@ func exprAnalyze(tls *crt.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sq
// is not a sub-select.
if ((((int32((*WhereClause)(unsafe.Pointer(pWC)).Fop) == 44) &&
((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 53) || (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 45))) &&
- ((crt.AssignInt32(&nLeft, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))) > 1)) &&
+ ((libc.AssignInt32(&nLeft, Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpLeft))) > 1)) &&
(Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer(pExpr)).FpRight) == nLeft)) &&
((((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fflags & U32(0x000800)) == U32(0)) ||
(((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpRight)).Fflags & U32(0x000800)) == U32(0))) {
@@ -120627,6 +124890,41 @@ func exprAnalyze(tls *crt.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sq
}
}
+ // When sqlite_stat4 histogram data is available an operator of the
+ // form "x IS NOT NULL" can sometimes be evaluated more efficiently
+ // as "x>NULL" if x is not an INTEGER PRIMARY KEY. So construct a
+ // virtual term of that form.
+ //
+ // Note that the virtual term must be tagged with TERM_VNULL.
+ if ((((int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 51) &&
+ (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).Fop) == 164)) &&
+ (int32((*Expr)(unsafe.Pointer((*Expr)(unsafe.Pointer(pExpr)).FpLeft)).FiColumn) >= 0)) &&
+ !(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x000001))) != U32(0))) &&
+ ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x0800)) == 0) {
+ var pNewExpr uintptr
+ var pLeft uintptr = (*Expr)(unsafe.Pointer(pExpr)).FpLeft
+ var idxNew int32
+ var pNewTerm uintptr
+
+ pNewExpr = Xsqlite3PExpr(tls, pParse, 54,
+ Xsqlite3ExprDup(tls, db, pLeft, 0),
+ Xsqlite3ExprAlloc(tls, db, 119, uintptr(0), 0))
+
+ idxNew = whereClauseInsert(tls, pWC, pNewExpr,
+ (uint16((0x0002 | 0x0001) | 0x0080)))
+ if idxNew != 0 {
+ pNewTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxNew)*64)
+ (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqRight = uint64(0)
+ (*WhereTerm)(unsafe.Pointer(pNewTerm)).FleftCursor = (*Expr)(unsafe.Pointer(pLeft)).FiTable
+ *(*int32)(unsafe.Pointer(pNewTerm + 40 /* &.u */)) = int32((*Expr)(unsafe.Pointer(pLeft)).FiColumn)
+ (*WhereTerm)(unsafe.Pointer(pNewTerm)).FeOperator = (U16(int32(0x0002) << (54 - 53)))
+ markTermAsChild(tls, pWC, idxNew, idxTerm)
+ pTerm = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*64)
+ *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((0x0008))
+ (*WhereTerm)(unsafe.Pointer(pNewTerm)).FprereqAll = (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll
+ }
+ }
+
// Prevent ON clause terms of a LEFT JOIN from being used to drive
// an index for tables to the left of the join.
@@ -120634,7 +124932,7 @@ func exprAnalyze(tls *crt.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { /* sq
*(*Bitmask)(unsafe.Pointer(pTerm + 48 /* &.prereqRight */)) |= (extraRight)
}
-var ops = [2]U8{U8(57), U8(55)} /* sqlite3.c:144538:21 */
+var ops = [2]U8{U8(57), U8(55)} /* sqlite3.c:145161:21 */
// **************************************************************************
//
@@ -120657,7 +124955,7 @@ var ops = [2]U8{U8(57), U8(55)} /* sqlite3.c:144538:21 */
// In the previous sentence and in the diagram, "slot[]" refers to
// the WhereClause.a[] array. The slot[] array grows as needed to contain
// all terms of the WHERE clause.
-func Xsqlite3WhereSplit(tls *crt.TLS, pWC uintptr, pExpr uintptr, op U8) { /* sqlite3.c:144824:21: */
+func Xsqlite3WhereSplit(tls *libc.TLS, pWC uintptr, pExpr uintptr, op U8) { /* sqlite3.c:145447:21: */
var pE2 uintptr = Xsqlite3ExprSkipCollateAndLikely(tls, pExpr)
(*WhereClause)(unsafe.Pointer(pWC)).Fop = op
if pE2 == uintptr(0) {
@@ -120672,7 +124970,7 @@ func Xsqlite3WhereSplit(tls *crt.TLS, pWC uintptr, pExpr uintptr, op U8) { /* sq
}
// Initialize a preallocated WhereClause structure.
-func Xsqlite3WhereClauseInit(tls *crt.TLS, pWC uintptr, pWInfo uintptr) { /* sqlite3.c:144839:21: */
+func Xsqlite3WhereClauseInit(tls *libc.TLS, pWC uintptr, pWInfo uintptr) { /* sqlite3.c:145462:21: */
(*WhereClause)(unsafe.Pointer(pWC)).FpWInfo = pWInfo
(*WhereClause)(unsafe.Pointer(pWC)).FhasOr = U8(0)
(*WhereClause)(unsafe.Pointer(pWC)).FpOuter = uintptr(0)
@@ -120684,7 +124982,7 @@ func Xsqlite3WhereClauseInit(tls *crt.TLS, pWC uintptr, pWInfo uintptr) { /* sql
// Deallocate a WhereClause structure. The WhereClause structure
// itself is not freed. This routine is the inverse of
// sqlite3WhereClauseInit().
-func Xsqlite3WhereClauseClear(tls *crt.TLS, pWC uintptr) { /* sqlite3.c:144856:21: */
+func Xsqlite3WhereClauseClear(tls *libc.TLS, pWC uintptr) { /* sqlite3.c:145479:21: */
var i int32
var a uintptr
var db uintptr = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb
@@ -120720,7 +125018,7 @@ __3:
// These routines walk (recursively) an expression tree and generate
// a bitmask indicating which tables are used in that expression
// tree.
-func Xsqlite3WhereExprUsageNN(tls *crt.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:144881:24: */
+func Xsqlite3WhereExprUsageNN(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:145504:24: */
var mask Bitmask
if (int32((*Expr)(unsafe.Pointer(p)).Fop) == 164) && !(((*Expr)(unsafe.Pointer((p))).Fflags & (U32(0x000008))) != U32(0)) {
return Xsqlite3WhereGetMask(tls, pMaskSet, (*Expr)(unsafe.Pointer(p)).FiTable)
@@ -120753,13 +125051,13 @@ func Xsqlite3WhereExprUsageNN(tls *crt.TLS, pMaskSet uintptr, p uintptr) Bitmask
}
return mask
}
-func Xsqlite3WhereExprUsage(tls *crt.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:144909:24: */
+func Xsqlite3WhereExprUsage(tls *libc.TLS, pMaskSet uintptr, p uintptr) Bitmask { /* sqlite3.c:145532:24: */
if p != 0 {
return Xsqlite3WhereExprUsageNN(tls, pMaskSet, p)
}
return uint64(0)
}
-func Xsqlite3WhereExprListUsage(tls *crt.TLS, pMaskSet uintptr, pList uintptr) Bitmask { /* sqlite3.c:144912:24: */
+func Xsqlite3WhereExprListUsage(tls *libc.TLS, pMaskSet uintptr, pList uintptr) Bitmask { /* sqlite3.c:145535:24: */
var i int32
var mask Bitmask = uint64(0)
if pList != 0 {
@@ -120776,7 +125074,7 @@ func Xsqlite3WhereExprListUsage(tls *crt.TLS, pMaskSet uintptr, pList uintptr) B
// end of the WHERE clause. We do not want to analyze these new
// virtual terms, so start analyzing at the end and work forward
// so that the added virtual terms are never processed.
-func Xsqlite3WhereExprAnalyze(tls *crt.TLS, pTabList uintptr, pWC uintptr) { /* sqlite3.c:144932:21: */
+func Xsqlite3WhereExprAnalyze(tls *libc.TLS, pTabList uintptr, pWC uintptr) { /* sqlite3.c:145555:21: */
var i int32
for i = ((*WhereClause)(unsafe.Pointer(pWC)).FnTerm - 1); i >= 0; i-- {
exprAnalyze(tls, pTabList, pWC, i)
@@ -120788,7 +125086,7 @@ func Xsqlite3WhereExprAnalyze(tls *crt.TLS, pTabList uintptr, pWC uintptr) { /*
//
// Each function argument translates into an equality constraint against
// a HIDDEN column in the table.
-func Xsqlite3WhereTabFuncArgs(tls *crt.TLS, pParse uintptr, pItem uintptr, pWC uintptr) { /* sqlite3.c:144949:21: */
+func Xsqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC uintptr) { /* sqlite3.c:145572:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -120807,14 +125105,14 @@ func Xsqlite3WhereTabFuncArgs(tls *crt.TLS, pParse uintptr, pItem uintptr, pWC u
if pArgs == uintptr(0) {
return
}
- for j = crt.AssignInt32(&k, 0); j < (*ExprList)(unsafe.Pointer(pArgs)).FnExpr; j++ {
+ for j = libc.AssignInt32(&k, 0); j < (*ExprList)(unsafe.Pointer(pArgs)).FnExpr; j++ {
var pRhs uintptr
for (k < int32((*Table)(unsafe.Pointer(pTab)).FnCol)) && ((int32((*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTab)).FaCol+uintptr(k)*32)).FcolFlags) & 0x0002) == 0) {
k++
}
if k >= int32((*Table)(unsafe.Pointer(pTab)).FnCol) {
- Xsqlite3ErrorMsg(tls, pParse, ts+19576, /* "too many argumen..." */
- crt.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, j))
+ Xsqlite3ErrorMsg(tls, pParse, ts+23516, /* "too many argumen..." */
+ libc.VaList(bp, (*Table)(unsafe.Pointer(pTab)).FzName, j))
return
}
pColRef = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 164, uintptr(0), 0)
@@ -120822,7 +125120,7 @@ func Xsqlite3WhereTabFuncArgs(tls *crt.TLS, pParse uintptr, pItem uintptr, pWC u
return
}
(*Expr)(unsafe.Pointer(pColRef)).FiTable = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor
- (*Expr)(unsafe.Pointer(pColRef)).FiColumn = YnVar(crt.PostIncInt32(&k, 1))
+ (*Expr)(unsafe.Pointer(pColRef)).FiColumn = YnVar(libc.PostIncInt32(&k, 1))
*(*uintptr)(unsafe.Pointer(pColRef + 64 /* &.y */)) = pTab
pRhs = Xsqlite3PExpr(tls, pParse, 171,
Xsqlite3ExprDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*ExprList_item)(unsafe.Pointer((pArgs+8 /* &.a */)+uintptr(j)*32)).FpExpr, 0), uintptr(0))
@@ -120895,26 +125193,30 @@ type HiddenIndexInfo1 = struct {
// This object is not an API and can be changed from one release to the
// next. As long as allocateIndexInfo() and sqlite3_vtab_collation()
// agree on the structure, all will be well.
-type HiddenIndexInfo = HiddenIndexInfo1 /* sqlite3.c:145019:32 */
+type HiddenIndexInfo = HiddenIndexInfo1 /* sqlite3.c:145642:32 */
// Test variable that can be set to enable WHERE tracing
/***/
-var Xsqlite3WhereTrace int32 = 0 /* sqlite3.c:145030:11 */
+var Xsqlite3WhereTrace int32 = 0 /* sqlite3.c:145653:11 */
// Return the estimated number of output rows from a WHERE clause
-func Xsqlite3WhereOutputRowCount(tls *crt.TLS, pWInfo uintptr) LogEst { /* sqlite3.c:145037:23: */
+func Xsqlite3WhereOutputRowCount(tls *libc.TLS, pWInfo uintptr) LogEst { /* sqlite3.c:145660:23: */
return (*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut
}
// Return one of the WHERE_DISTINCT_xxxxx values to indicate how this
// WHERE clause returns outputs for DISTINCT processing.
-func Xsqlite3WhereIsDistinct(tls *crt.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145045:20: */
+func Xsqlite3WhereIsDistinct(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145668:20: */
return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct)
}
-// Return TRUE if the WHERE clause returns rows in ORDER BY order.
-// Return FALSE if the output needs to be sorted.
-func Xsqlite3WhereIsOrdered(tls *crt.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145053:20: */
+// Return the number of ORDER BY terms that are satisfied by the
+// WHERE clause. A return of 0 means that the output must be
+// completely sorted. A return equal to the number of ORDER BY
+// terms means that no sorting is needed at all. A return that
+// is positive but less than the number of ORDER BY terms means that
+// block sorting is required.
+func Xsqlite3WhereIsOrdered(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145680:20: */
return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat)
}
@@ -120939,7 +125241,7 @@ func Xsqlite3WhereIsOrdered(tls *crt.TLS, pWInfo uintptr) int32 { /* sqlite3.c:1
// Returning the continuation the second inner loop is an optimization
// that might make the code run a little faster, but should not change
// the final answer.
-func Xsqlite3WhereOrderByLimitOptLabel(tls *crt.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145080:20: */
+func Xsqlite3WhereOrderByLimitOptLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145707:20: */
var pInner uintptr
if !(int32(*(*uint8)(unsafe.Pointer(pWInfo + 68 /* &.bOrderedInnerLoop */))&0x4>>2) != 0) {
// The ORDER BY LIMIT optimization does not apply. Jump to the
@@ -120953,14 +125255,14 @@ func Xsqlite3WhereOrderByLimitOptLabel(tls *crt.TLS, pWInfo uintptr) int32 { /*
// Return the VDBE address or label to jump to in order to continue
// immediately with the next row of a WHERE clause.
-func Xsqlite3WhereContinueLabel(tls *crt.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145096:20: */
+func Xsqlite3WhereContinueLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145723:20: */
return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue
}
// Return the VDBE address or label to jump to in order to break
// out of a WHERE loop.
-func Xsqlite3WhereBreakLabel(tls *crt.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145105:20: */
+func Xsqlite3WhereBreakLabel(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145732:20: */
return (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak
}
@@ -120979,21 +125281,21 @@ func Xsqlite3WhereBreakLabel(tls *crt.TLS, pWInfo uintptr) int32 { /* sqlite3.c:
//
// aiCur[0] and aiCur[1] both get -1 if the where-clause logic is
// unable to use the ONEPASS optimization.
-func Xsqlite3WhereOkOnePass(tls *crt.TLS, pWInfo uintptr, aiCur uintptr) int32 { /* sqlite3.c:145126:20: */
- crt.Xmemcpy(tls, aiCur, pWInfo+40 /* &.aiCurOnePass */, (uint64(unsafe.Sizeof(int32(0))) * uint64(2)))
+func Xsqlite3WhereOkOnePass(tls *libc.TLS, pWInfo uintptr, aiCur uintptr) int32 { /* sqlite3.c:145753:20: */
+ libc.Xmemcpy(tls, aiCur, pWInfo+40 /* &.aiCurOnePass */, (uint64(unsafe.Sizeof(int32(0))) * uint64(2)))
return int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass)
}
// Return TRUE if the WHERE loop uses the OP_DeferredSeek opcode to move
// the data cursor to the row selected by the index cursor.
-func Xsqlite3WhereUsesDeferredSeek(tls *crt.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145142:20: */
+func Xsqlite3WhereUsesDeferredSeek(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:145769:20: */
return int32(*(*uint8)(unsafe.Pointer(pWInfo + 68 /* &.bDeferredSeek */)) & 0x1 >> 0)
}
// Move the content of pSrc into pDest
-func whereOrMove(tls *crt.TLS, pDest uintptr, pSrc uintptr) { /* sqlite3.c:145149:13: */
+func whereOrMove(tls *libc.TLS, pDest uintptr, pSrc uintptr) { /* sqlite3.c:145776:13: */
(*WhereOrSet)(unsafe.Pointer(pDest)).Fn = (*WhereOrSet)(unsafe.Pointer(pSrc)).Fn
- crt.Xmemcpy(tls, pDest+8 /* &.a */, pSrc+8 /* &.a */, (uint64((*WhereOrSet)(unsafe.Pointer(pDest)).Fn) * uint64(unsafe.Sizeof(WhereOrCost{}))))
+ libc.Xmemcpy(tls, pDest+8 /* &.a */, pSrc+8 /* &.a */, (uint64((*WhereOrSet)(unsafe.Pointer(pDest)).Fn) * uint64(unsafe.Sizeof(WhereOrCost{}))))
}
// Try to insert a new prerequisite/cost entry into the WhereOrSet pSet.
@@ -121001,7 +125303,7 @@ func whereOrMove(tls *crt.TLS, pDest uintptr, pSrc uintptr) { /* sqlite3.c:14514
// The new entry might overwrite an existing entry, or it might be
// appended, or it might be discarded. Do whatever is the right thing
// so that pSet keeps the N_OR_COST best entries seen so far.
-func whereOrInsert(tls *crt.TLS, pSet uintptr, prereq Bitmask, rRun LogEst, nOut LogEst) int32 { /* sqlite3.c:145161:12: */
+func whereOrInsert(tls *libc.TLS, pSet uintptr, prereq Bitmask, rRun LogEst, nOut LogEst) int32 { /* sqlite3.c:145788:12: */
var i U16
var p uintptr
i = (*WhereOrSet)(unsafe.Pointer(pSet)).Fn
@@ -121033,7 +125335,7 @@ __3:
if !(int32((*WhereOrSet)(unsafe.Pointer(pSet)).Fn) < 3) {
goto __6
}
- p = ((pSet + 8 /* &.a */) + uintptr(crt.PostIncUint16(&(*WhereOrSet)(unsafe.Pointer(pSet)).Fn, 1))*16)
+ p = ((pSet + 8 /* &.a */) + uintptr(libc.PostIncUint16(&(*WhereOrSet)(unsafe.Pointer(pSet)).Fn, 1))*16)
(*WhereOrCost)(unsafe.Pointer(p)).FnOut = nOut
goto __7
__6:
@@ -121078,7 +125380,7 @@ __13:
// Return the bitmask for the given cursor number. Return 0 if
// iCursor is not in the set.
-func Xsqlite3WhereGetMask(tls *crt.TLS, pMaskSet uintptr, iCursor int32) Bitmask { /* sqlite3.c:145198:24: */
+func Xsqlite3WhereGetMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) Bitmask { /* sqlite3.c:145825:24: */
var i int32
for i = 0; i < (*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn; i++ {
@@ -121095,15 +125397,15 @@ func Xsqlite3WhereGetMask(tls *crt.TLS, pMaskSet uintptr, iCursor int32) Bitmask
// tables in the FROM clause is limited by a test early in the
// sqlite3WhereBegin() routine. So we know that the pMaskSet->ix[]
// array will never overflow.
-func createMask(tls *crt.TLS, pMaskSet uintptr, iCursor int32) { /* sqlite3.c:145217:13: */
+func createMask(tls *libc.TLS, pMaskSet uintptr, iCursor int32) { /* sqlite3.c:145844:13: */
- *(*int32)(unsafe.Pointer((pMaskSet + 8 /* &.ix */) + uintptr(crt.PostIncInt32(&(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn, 1))*4)) = iCursor
+ *(*int32)(unsafe.Pointer((pMaskSet + 8 /* &.ix */) + uintptr(libc.PostIncInt32(&(*WhereMaskSet)(unsafe.Pointer(pMaskSet)).Fn, 1))*4)) = iCursor
}
// Advance to the next WhereTerm that matches according to the criteria
// established when the pScan object was initialized by whereScanInit().
// Return NULL if there are no more matching WhereTerms.
-func whereScanNext(tls *crt.TLS, pScan uintptr) uintptr { /* sqlite3.c:145227:18: */
+func whereScanNext(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145854:18: */
var iCur int32 // The cursor on the LHS of the term
var iColumn I16 // The column on the LHS of the term. -1 for IPK
var pX uintptr // An expression being tested
@@ -121131,7 +125433,7 @@ func whereScanNext(tls *crt.TLS, pScan uintptr) uintptr { /* sqlite3.c:145227:18
((int32((*WhereScan)(unsafe.Pointer(pScan)).FiEquiv) <= 1) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(0x000001))) != U32(0))) {
if (((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & 0x0800) != 0) &&
(int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv) < (int32(uint64(unsafe.Sizeof([11]int32{})) / uint64(unsafe.Sizeof(int32(0))))))) &&
- (int32((*Expr)(unsafe.Pointer((crt.AssignUintptr(&pX, Xsqlite3ExprSkipCollateAndLikely(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight))))).Fop) ==
+ (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pX, Xsqlite3ExprSkipCollateAndLikely(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight))))).Fop) ==
164) {
var j int32
for j = 0; j < int32((*WhereScan)(unsafe.Pointer(pScan)).FnEquiv); j++ {
@@ -121165,7 +125467,7 @@ func whereScanNext(tls *crt.TLS, pScan uintptr) uintptr { /* sqlite3.c:145227:18
}
}
if ((((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & (0x0002 | 0x0080)) != 0) &&
- (int32((*Expr)(unsafe.Pointer((crt.AssignUintptr(&pX, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight)))).Fop) == 164)) &&
+ (int32((*Expr)(unsafe.Pointer((libc.AssignUintptr(&pX, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight)))).Fop) == 164)) &&
((*Expr)(unsafe.Pointer(pX)).FiTable == *(*int32)(unsafe.Pointer((pScan + 44 /* &.aiCur */) + uintptr(0)*4)))) &&
(int32((*Expr)(unsafe.Pointer(pX)).FiColumn) == int32(*(*I16)(unsafe.Pointer((pScan + 88 /* &.aiColumn */) + uintptr(0)*2)))) {
@@ -121202,7 +125504,7 @@ func whereScanNext(tls *crt.TLS, pScan uintptr) uintptr { /* sqlite3.c:145227:18
// It is factored out into a separate tail-recursion subroutine so that
// the normal whereScanInit() routine, which is a high-runner, does not
// need to push registers onto the stack as part of its prologue.
-func whereScanInitIndexExpr(tls *crt.TLS, pScan uintptr) uintptr { /* sqlite3.c:145315:34: */
+func whereScanInitIndexExpr(tls *libc.TLS, pScan uintptr) uintptr { /* sqlite3.c:145942:34: */
(*WhereScan)(unsafe.Pointer(pScan)).Fidxaff = Xsqlite3ExprAffinity(tls, (*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr)
return whereScanNext(tls, pScan)
}
@@ -121224,7 +125526,7 @@ func whereScanInitIndexExpr(tls *crt.TLS, pScan uintptr) uintptr { /* sqlite3.c:
//
// If X is not the INTEGER PRIMARY KEY then X must be compatible with
// index pIdx.
-func whereScanInit(tls *crt.TLS, pScan uintptr, pWC uintptr, iCur int32, iColumn int32, opMask U32, pIdx uintptr) uintptr { /* sqlite3.c:145339:18: */
+func whereScanInit(tls *libc.TLS, pScan uintptr, pWC uintptr, iCur int32, iColumn int32, opMask U32, pIdx uintptr) uintptr { /* sqlite3.c:145966:18: */
(*WhereScan)(unsafe.Pointer(pScan)).FpOrigWC = pWC
(*WhereScan)(unsafe.Pointer(pScan)).FpWC = pWC
(*WhereScan)(unsafe.Pointer(pScan)).FpIdxExpr = uintptr(0)
@@ -121279,7 +125581,7 @@ func whereScanInit(tls *crt.TLS, pScan uintptr, pWC uintptr, iCur int32, iColumn
// the form "X <op> Y" where Y is a column in another table if no terms of
// the form "X <op> <const-expr>" exist. If no terms with a constant RHS
// exist, try to return a term that does not use WO_EQUIV.
-func Xsqlite3WhereFindTerm(tls *crt.TLS, pWC uintptr, iCur int32, iColumn int32, notReady Bitmask, op U32, pIdx uintptr) uintptr { /* sqlite3.c:145403:26: */
+func Xsqlite3WhereFindTerm(tls *libc.TLS, pWC uintptr, iCur int32, iColumn int32, notReady Bitmask, op U32, pIdx uintptr) uintptr { /* sqlite3.c:146030:26: */
bp := tls.Alloc(112)
defer tls.Free(112)
@@ -121309,7 +125611,7 @@ func Xsqlite3WhereFindTerm(tls *crt.TLS, pWC uintptr, iCur int32, iColumn int32,
//
// If such an expression is found, its index in pList->a[] is returned. If
// no expression is found, -1 is returned.
-func findIndexCol(tls *crt.TLS, pParse uintptr, pList uintptr, iBase int32, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:145437:12: */
+func findIndexCol(tls *libc.TLS, pParse uintptr, pList uintptr, iBase int32, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:146064:12: */
var i int32
var zColl uintptr = *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FazColl + uintptr(iCol)*8))
@@ -121329,7 +125631,7 @@ func findIndexCol(tls *crt.TLS, pParse uintptr, pList uintptr, iBase int32, pIdx
}
// Return TRUE if the iCol-th column of index pIdx is NOT NULL
-func indexColumnNotNull(tls *crt.TLS, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:145466:12: */
+func indexColumnNotNull(tls *libc.TLS, pIdx uintptr, iCol int32) int32 { /* sqlite3.c:146093:12: */
var j int32
j = int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(iCol)*2)))
@@ -121349,7 +125651,7 @@ func indexColumnNotNull(tls *crt.TLS, pIdx uintptr, iCol int32) int32 { /* sqlit
//
// A DISTINCT list is redundant if any subset of the columns in the
// DISTINCT list are collectively unique and individually non-null.
-func isDistinctRedundant(tls *crt.TLS, pParse uintptr, pTabList uintptr, pWC uintptr, pDistinct uintptr) int32 { /* sqlite3.c:145489:12: */
+func isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC uintptr, pDistinct uintptr) int32 { /* sqlite3.c:146116:12: */
var pTab uintptr
var pIdx uintptr
var i int32
@@ -121391,7 +125693,7 @@ func isDistinctRedundant(tls *crt.TLS, pParse uintptr, pTabList uintptr, pWC uin
continue
}
for i = 0; i < int32((*Index)(unsafe.Pointer(pIdx)).FnKeyCol); i++ {
- if uintptr(0) == Xsqlite3WhereFindTerm(tls, pWC, iBase, i, ^uint64(crt.Uint64FromUint64(uint64(0))), uint32(0x0002), pIdx) {
+ if uintptr(0) == Xsqlite3WhereFindTerm(tls, pWC, iBase, i, ^uint64(libc.Uint64FromUint64(uint64(0))), uint32(0x0002), pIdx) {
if findIndexCol(tls, pParse, pDistinct, iBase, pIdx, i) < 0 {
break
}
@@ -121410,7 +125712,7 @@ func isDistinctRedundant(tls *crt.TLS, pParse uintptr, pTabList uintptr, pWC uin
}
// Estimate the logarithm of the input value to base 2.
-func estLog(tls *crt.TLS, N LogEst) LogEst { /* sqlite3.c:145550:15: */
+func estLog(tls *libc.TLS, N LogEst) LogEst { /* sqlite3.c:146177:15: */
if int32(N) <= 10 {
return int16(0)
}
@@ -121427,7 +125729,7 @@ func estLog(tls *crt.TLS, N LogEst) LogEst { /* sqlite3.c:145550:15: */
// cursor iTabCur are transformed into OP_Sequence opcode for the
// iAutoidxCur cursor, in order to generate unique rowids for the
// automatic index being generated.
-func translateColumnToCopy(tls *crt.TLS, pParse uintptr, iStart int32, iTabCur int32, iRegister int32, iAutoidxCur int32) { /* sqlite3.c:145566:13: */
+func translateColumnToCopy(tls *libc.TLS, pParse uintptr, iStart int32, iTabCur int32, iRegister int32, iAutoidxCur int32) { /* sqlite3.c:146193:13: */
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var pOp uintptr = Xsqlite3VdbeGetOp(tls, v, iStart)
var iEnd int32 = Xsqlite3VdbeCurrentAddr(tls, v)
@@ -121461,7 +125763,7 @@ __1:
goto __2
__2:
iStart++
- pOp += 24
+ pOp += 32
goto __1
goto __3
__3:
@@ -121475,7 +125777,7 @@ __3:
// Return TRUE if the WHERE clause term pTerm is of a form where it
// could be used with an index to access pSrc, assuming an appropriate
// index existed.
-func termCanDriveIndex(tls *crt.TLS, pTerm uintptr, pSrc uintptr, notReady Bitmask) int32 { /* sqlite3.c:145648:12: */
+func termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady Bitmask) int32 { /* sqlite3.c:146275:12: */
var aff int8
if (*WhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor {
return 0
@@ -121508,9 +125810,9 @@ func termCanDriveIndex(tls *crt.TLS, pTerm uintptr, pSrc uintptr, notReady Bitma
// Generate code to construct the Index object for an automatic index
// and to set up the WhereLevel object pLevel so that the code generator
// makes use of the automatic index.
-func constructAutomaticIndex(tls *crt.TLS, pParse uintptr, pWC uintptr, pSrc uintptr, notReady Bitmask, pLevel uintptr) { /* sqlite3.c:145681:13: */
- bp := tls.Alloc(24)
- defer tls.Free(24)
+func constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, pSrc uintptr, notReady Bitmask, pLevel uintptr) { /* sqlite3.c:146308:13: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
var nKeyCol int32 // Number of columns in the constructed index
var pTerm uintptr // A single term of the WHERE clause
@@ -121526,7 +125828,7 @@ func constructAutomaticIndex(tls *crt.TLS, pParse uintptr, pWC uintptr, pSrc uin
var mxBitCol int32 // Maximum column in pSrc->colUsed
var pColl uintptr // Collating sequence to on a column
var pLoop uintptr // The Loop object
- // var zNotUsed uintptr at bp+16, 8
+ // var zNotUsed uintptr at bp+32, 8
// Extra space on the end of pIdx
var idxCols Bitmask // Bitmap of columns used for indexing
var extraCols Bitmask // Bitmap of additional columns
@@ -121592,7 +125894,7 @@ __4:
goto __6
}
Xsqlite3_log(tls, (28 | (int32(1) << 8)),
- ts+19612 /* "automatic index ..." */, crt.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName,
+ ts+23552 /* "automatic index ..." */, libc.VaList(bp, (*Table)(unsafe.Pointer(pTable)).FzName,
(*Column)(unsafe.Pointer((*Table)(unsafe.Pointer(pTable)).FaCol+uintptr(iCol)*32)).FzName))
sentWarning = U8(1)
__6:
@@ -121606,7 +125908,7 @@ __6:
goto end_auto_index_create
__8:
;
- *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(crt.PostIncInt32(&nKeyCol, 1))*8)) = pTerm
+ *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(libc.PostIncInt32(&nKeyCol, 1))*8)) = pTerm
idxCols = idxCols | (cMask)
__7:
;
@@ -121626,7 +125928,7 @@ __3:
FnTop U16
FnDistinctCol U16
FpIndex uintptr
- })(unsafe.Pointer(pLoop + 24 /* &.u */)).FnEq = crt.AssignPtrUint16(pLoop+44 /* &.nLTerm */, U16(nKeyCol))
+ })(unsafe.Pointer(pLoop + 24 /* &.u */)).FnEq = libc.AssignPtrUint16(pLoop+44 /* &.nLTerm */, U16(nKeyCol))
(*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = (U32(((0x00000001 | 0x00000040) | 0x00000200) |
0x00004000))
@@ -121671,7 +125973,7 @@ __13:
;
// Construct the Index object to describe this index
- pIdx = Xsqlite3AllocateIndexObject(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (int16(nKeyCol + 1)), 0, bp+16 /* &zNotUsed */)
+ pIdx = Xsqlite3AllocateIndexObject(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (int16(nKeyCol + 1)), 0, bp+32 /* &zNotUsed */)
if !(pIdx == uintptr(0)) {
goto __14
}
@@ -121685,7 +125987,7 @@ __14:
FnDistinctCol U16
FpIndex uintptr
})(unsafe.Pointer(pLoop + 24 /* &.u */)).FpIndex = pIdx
- (*Index)(unsafe.Pointer(pIdx)).FzName = ts + 19638 /* "auto-index" */
+ (*Index)(unsafe.Pointer(pIdx)).FzName = ts + 23578 /* "auto-index" */
(*Index)(unsafe.Pointer(pIdx)).FpTable = pTable
n = 0
idxCols = uint64(0)
@@ -121779,9 +126081,10 @@ __24:
// Create the automatic index
- (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
Xsqlite3VdbeAddOp2(tls, v, 99, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, (nKeyCol + 1))
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx)
+ Xsqlite3VdbeComment(tls, v, ts+16880 /* "for %s" */, libc.VaList(bp+16, (*Table)(unsafe.Pointer(pTable)).FzName))
// Fill the automatic index with content
pTabItem = (((*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112)
@@ -121793,6 +126096,7 @@ __24:
Xsqlite3VdbeAddOp3(tls, v, 13, regYield, 0, (*SrcList_item)(unsafe.Pointer(pTabItem)).FaddrFillSub)
addrTop = Xsqlite3VdbeAddOp1(tls, v, 14, regYield)
+ Xsqlite3VdbeComment(tls, v, ts+23338 /* "next row of %s" */, libc.VaList(bp+24, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab)).FzName))
goto __29
__28:
addrTop = Xsqlite3VdbeAddOp1(tls, v, 37, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur)
@@ -121825,7 +126129,7 @@ __31:
translateColumnToCopy(tls, pParse, addrTop, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur,
(*SrcList_item)(unsafe.Pointer(pTabItem)).FregResult, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur)
Xsqlite3VdbeGoto(tls, v, addrTop)
- crt.SetBitFieldPtr8Uint32(pTabItem+60 /* &.fg */ +4 /* &.viaCoroutine */, uint32(0), 4, 0x10)
+ libc.SetBitFieldPtr8Uint32(pTabItem+60 /* &.fg */ +4 /* &.viaCoroutine */, uint32(0), 4, 0x10)
goto __33
__32:
Xsqlite3VdbeAddOp2(tls, v, 5, (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, (addrTop + 1))
@@ -121845,7 +126149,7 @@ end_auto_index_create:
// Allocate and populate an sqlite3_index_info structure. It is the
// responsibility of the caller to eventually release the structure
// by passing the pointer returned by this function to sqlite3_free().
-func allocateIndexInfo(tls *crt.TLS, pParse uintptr, pWC uintptr, mUnusable Bitmask, pSrc uintptr, pOrderBy uintptr, pmNoOmit uintptr) uintptr { /* sqlite3.c:145888:27: */
+func allocateIndexInfo(tls *libc.TLS, pParse uintptr, pWC uintptr, mUnusable Bitmask, pSrc uintptr, pOrderBy uintptr, pmNoOmit uintptr) uintptr { /* sqlite3.c:146515:27: */
var i int32
var j int32
var nTerm int32
@@ -121860,7 +126164,7 @@ func allocateIndexInfo(tls *crt.TLS, pParse uintptr, pWC uintptr, mUnusable Bitm
// Count the number of possible WHERE clause constraints referring
// to this virtual table
- i = crt.AssignInt32(&nTerm, 0)
+ i = libc.AssignInt32(&nTerm, 0)
pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
__1:
if !(i < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm) {
@@ -121874,10 +126178,10 @@ __1:
goto __2
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & ^int32(crt.Int32FromInt32(0x0800))) == 0 {
+ if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & ^int32(libc.Int32FromInt32(0x0800))) == 0 {
goto __2
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & 0x0000) != 0 {
+ if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & 0x0080) != 0 {
goto __2
}
@@ -121917,7 +126221,7 @@ __3:
((uint64(unsafe.Sizeof(sqlite3_index_constraint{})) + uint64(unsafe.Sizeof(sqlite3_index_constraint_usage{}))) * uint64(nTerm))) +
(uint64(unsafe.Sizeof(sqlite3_index_orderby{})) * uint64(nOrderBy))) + uint64(unsafe.Sizeof(HiddenIndexInfo1{})))))
if pIdxInfo == uintptr(0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+5549 /* "out of memory" */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+7747 /* "out of memory" */, 0)
return uintptr(0)
}
pHidden = (pIdxInfo + uintptr(1)*96)
@@ -121930,7 +126234,7 @@ __3:
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage = pUsage
(*HiddenIndexInfo1)(unsafe.Pointer(pHidden)).FpWC = pWC
(*HiddenIndexInfo1)(unsafe.Pointer(pHidden)).FpParse = pParse
- i = crt.AssignInt32(&j, 0)
+ i = libc.AssignInt32(&j, 0)
pTerm = (*WhereClause)(unsafe.Pointer(pWC)).Fa
__4:
if !(i < (*WhereClause)(unsafe.Pointer(pWC)).FnTerm) {
@@ -121945,10 +126249,10 @@ __4:
goto __5
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & ^int32(crt.Int32FromInt32(0x0800))) == 0 {
+ if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & ^int32(libc.Int32FromInt32(0x0800))) == 0 {
goto __5
}
- if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & 0x0000) != 0 {
+ if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & 0x0080) != 0 {
goto __5
}
@@ -122030,22 +126334,22 @@ __6:
// Whether or not an error is returned, it is the responsibility of the
// caller to eventually free p->idxStr if p->needToFreeIdxStr indicates
// that this is required.
-func vtabBestIndex(tls *crt.TLS, pParse uintptr, pTab uintptr, p uintptr) int32 { /* sqlite3.c:146043:12: */
+func vtabBestIndex(tls *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) int32 { /* sqlite3.c:146670:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
var pVtab uintptr = (*VTable)(unsafe.Pointer(Xsqlite3GetVTable(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pTab))).FpVtab
var rc int32
- rc = (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule + 24 /* &.xBestIndex */))))(tls, pVtab, p)
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FpModule + 24 /* &.xBestIndex */))))(tls, pVtab, p)
if (rc != 0) && (rc != 19) {
if rc == 7 {
Xsqlite3OomFault(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb)
} else if !(int32((*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg) != 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+696 /* "%s" */, crt.VaList(bp, Xsqlite3ErrStr(tls, rc)))
+ Xsqlite3ErrorMsg(tls, pParse, ts+805 /* "%s" */, libc.VaList(bp, Xsqlite3ErrStr(tls, rc)))
} else {
- Xsqlite3ErrorMsg(tls, pParse, ts+696 /* "%s" */, crt.VaList(bp+8, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg))
+ Xsqlite3ErrorMsg(tls, pParse, ts+805 /* "%s" */, libc.VaList(bp+8, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg))
}
}
Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg)
@@ -122053,6 +126357,147 @@ func vtabBestIndex(tls *crt.TLS, pParse uintptr, pTab uintptr, p uintptr) int32
return rc
}
+// Estimate the location of a particular key among all keys in an
+// index. Store the results in aStat as follows:
+//
+// aStat[0] Est. number of rows less than pRec
+// aStat[1] Est. number of rows equal to pRec
+//
+// Return the index of the sample that is the smallest sample that
+// is greater than or equal to pRec. Note that this index is not an index
+// into the aSample[] array - it is an index into a virtual set of samples
+// based on the contents of aSample[] and the number of fields in record
+// pRec.
+func whereKeyStats(tls *libc.TLS, pParse uintptr, pIdx uintptr, pRec uintptr, roundUp int32, aStat uintptr) int32 { /* sqlite3.c:146707:12: */
+ var aSample uintptr = (*Index)(unsafe.Pointer(pIdx)).FaSample
+ var iCol int32 // Index of required stats in anEq[] etc.
+ var i int32 // Index of first sample >= pRec
+ var iSample int32 // Smallest sample larger than or equal to pRec
+ var iMin int32 = 0 // Smallest sample not yet tested
+ var iTest int32 // Next sample to test
+ var res int32 // Result of comparison operation
+ var nField int32 // Number of fields in pRec
+ var iLower TRowcnt = TRowcnt(0) // anLt[] + anEq[] of largest sample pRec is >
+
+ _ = pParse
+
+ // Do a binary search to find the first sample greater than or equal
+ // to pRec. If pRec contains a single field, the set of samples to search
+ // is simply the aSample[] array. If the samples in aSample[] contain more
+ // than one fields, all fields following the first are ignored.
+ //
+ // If pRec contains N fields, where N is more than one, then as well as the
+ // samples in aSample[] (truncated to N fields), the search also has to
+ // consider prefixes of those samples. For example, if the set of samples
+ // in aSample is:
+ //
+ // aSample[0] = (a, 5)
+ // aSample[1] = (a, 10)
+ // aSample[2] = (b, 5)
+ // aSample[3] = (c, 100)
+ // aSample[4] = (c, 105)
+ //
+ // Then the search space should ideally be the samples above and the
+ // unique prefixes [a], [b] and [c]. But since that is hard to organize,
+ // the code actually searches this set:
+ //
+ // 0: (a)
+ // 1: (a, 5)
+ // 2: (a, 10)
+ // 3: (a, 10)
+ // 4: (b)
+ // 5: (b, 5)
+ // 6: (c)
+ // 7: (c, 100)
+ // 8: (c, 105)
+ // 9: (c, 105)
+ //
+ // For each sample in the aSample[] array, N samples are present in the
+ // effective sample array. In the above, samples 0 and 1 are based on
+ // sample aSample[0]. Samples 2 and 3 on aSample[1] etc.
+ //
+ // Often, sample i of each block of N effective samples has (i+1) fields.
+ // Except, each sample may be extended to ensure that it is greater than or
+ // equal to the previous sample in the array. For example, in the above,
+ // sample 2 is the first sample of a block of N samples, so at first it
+ // appears that it should be 1 field in size. However, that would make it
+ // smaller than sample 1, so the binary search would not work. As a result,
+ // it is extended to two fields. The duplicates that this creates do not
+ // cause any problems.
+ nField = int32((*UnpackedRecord)(unsafe.Pointer(pRec)).FnField)
+ iCol = 0
+ iSample = ((*Index)(unsafe.Pointer(pIdx)).FnSample * nField)
+ for ok := true; ok; ok = ((res != 0) && (iMin < iSample)) {
+ var iSamp int32 // Index in aSample[] of test sample
+ var n int32 // Number of fields in test sample
+
+ iTest = ((iMin + iSample) / 2)
+ iSamp = (iTest / nField)
+ if iSamp > 0 {
+ // The proposed effective sample is a prefix of sample aSample[iSamp].
+ // Specifically, the shortest prefix of at least (1 + iTest%nField)
+ // fields that is greater than the previous effective sample.
+ for n = ((iTest % nField) + 1); n < nField; n++ {
+ if *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr((iSamp-1))*40)).FanLt + uintptr((n-1))*4)) != *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*40)).FanLt + uintptr((n-1))*4)) {
+ break
+ }
+ }
+ } else {
+ n = (iTest + 1)
+ }
+
+ (*UnpackedRecord)(unsafe.Pointer(pRec)).FnField = U16(n)
+ res = Xsqlite3VdbeRecordCompare(tls, (*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*40)).Fn, (*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*40)).Fp, pRec)
+ if res < 0 {
+ iLower = (*(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*40)).FanLt + uintptr((n-1))*4)) + *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*40)).FanEq + uintptr((n-1))*4)))
+ iMin = (iTest + 1)
+ } else if (res == 0) && (n < nField) {
+ iLower = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(iSamp)*40)).FanLt + uintptr((n-1))*4))
+ iMin = (iTest + 1)
+ res = -1
+ } else {
+ iSample = iTest
+ iCol = (n - 1)
+ }
+ }
+ i = (iSample / nField)
+
+ if res == 0 {
+ // Record pRec is equal to sample i
+
+ *(*TRowcnt)(unsafe.Pointer(aStat + uintptr(0)*4)) = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*40)).FanLt + uintptr(iCol)*4))
+ *(*TRowcnt)(unsafe.Pointer(aStat + uintptr(1)*4)) = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*40)).FanEq + uintptr(iCol)*4))
+ } else {
+ // At this point, the (iCol+1) field prefix of aSample[i] is the first
+ // sample that is greater than pRec. Or, if i==pIdx->nSample then pRec
+ // is larger than all samples in the array.
+ var iUpper TRowcnt
+ var iGap TRowcnt
+ if i >= (*Index)(unsafe.Pointer(pIdx)).FnSample {
+ iUpper = TRowcnt(Xsqlite3LogEstToInt(tls, *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaiRowLogEst + uintptr(0)*2))))
+ } else {
+ iUpper = *(*TRowcnt)(unsafe.Pointer((*IndexSample)(unsafe.Pointer(aSample+uintptr(i)*40)).FanLt + uintptr(iCol)*4))
+ }
+
+ if iLower >= iUpper {
+ iGap = TRowcnt(0)
+ } else {
+ iGap = (iUpper - iLower)
+ }
+ if roundUp != 0 {
+ iGap = ((iGap * TRowcnt(2)) / TRowcnt(3))
+ } else {
+ iGap = (iGap / TRowcnt(3))
+ }
+ *(*TRowcnt)(unsafe.Pointer(aStat + uintptr(0)*4)) = (iLower + iGap)
+ *(*TRowcnt)(unsafe.Pointer(aStat + uintptr(1)*4)) = *(*TRowcnt)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FaAvgEq + uintptr((nField-1))*4))
+ }
+
+ // Restore the pRec->nField value before returning.
+ (*UnpackedRecord)(unsafe.Pointer(pRec)).FnField = U16(nField)
+ return i
+}
+
// If it is not NULL, pTerm is a term that provides an upper or lower
// bound on a range scan. Without considering pTerm, it is estimated
// that the scan will visit nNew rows. This function returns the number
@@ -122062,18 +126507,149 @@ func vtabBestIndex(tls *crt.TLS, pParse uintptr, pTab uintptr, p uintptr) int32
// then the return value is the likelihood multiplied by the number of
// input rows. Otherwise, this function assumes that an "IS NOT NULL" term
// has a likelihood of 0.50, and any other term a likelihood of 0.25.
-func whereRangeAdjust(tls *crt.TLS, pTerm uintptr, nNew LogEst) LogEst { /* sqlite3.c:146272:15: */
+func whereRangeAdjust(tls *libc.TLS, pTerm uintptr, nNew LogEst) LogEst { /* sqlite3.c:146899:15: */
var nRet LogEst = nNew
if pTerm != 0 {
if int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb) <= 0 {
nRet = LogEst(int32(nRet) + (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb)))
- } else if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & 0x0000) == 0 {
+ } else if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & 0x0080) == 0 {
nRet = int16(int32(nRet) - (20))
}
}
return nRet
}
+// Return the affinity for a single column of an index.
+func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol int32) int8 { /* sqlite3.c:146916:21: */
+
+ if !(int32((*Index)(unsafe.Pointer(pIdx)).FzColAff) != 0) {
+ if Xsqlite3IndexAffinityStr(tls, db, pIdx) == uintptr(0) {
+ return int8(0x41)
+ }
+ }
+
+ return *(*int8)(unsafe.Pointer((*Index)(unsafe.Pointer(pIdx)).FzColAff + uintptr(iCol)))
+}
+
+// This function is called to estimate the number of rows visited by a
+// range-scan on a skip-scan index. For example:
+//
+// CREATE INDEX i1 ON t1(a, b, c);
+// SELECT * FROM t1 WHERE a=? AND c BETWEEN ? AND ?;
+//
+// Value pLoop->nOut is currently set to the estimated number of rows
+// visited for scanning (a=? AND b=?). This function reduces that estimate
+// by some factor to account for the (c BETWEEN ? AND ?) expression based
+// on the stat4 data for the index. this scan will be peformed multiple
+// times (once for each (a,b) combination that matches a=?) is dealt with
+// by the caller.
+//
+// It does this by scanning through all stat4 samples, comparing values
+// extracted from pLower and pUpper with the corresponding column in each
+// sample. If L and U are the number of samples found to be less than or
+// equal to the values extracted from pLower and pUpper respectively, and
+// N is the total number of samples, the pLoop->nOut value is adjusted
+// as follows:
+//
+// nOut = nOut * ( min(U - L, 1) / N )
+//
+// If pLower is NULL, or a value cannot be extracted from the term, L is
+// set to zero. If pUpper is NULL, or a value cannot be extracted from it,
+// U is set to N.
+//
+// Normally, this function sets *pbDone to 1 before returning. However,
+// if no value can be extracted from either pLower or pUpper (and so the
+// estimate of the number of rows delivered remains unchanged), *pbDone
+// is left as is.
+//
+// If an error occurs, an SQLite error code is returned. Otherwise,
+// SQLITE_OK.
+func whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr, pbDone uintptr) int32 { /* sqlite3.c:146963:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var p uintptr = (*struct {
+ FnEq U16
+ FnBtm U16
+ FnTop U16
+ FnDistinctCol U16
+ FpIndex uintptr
+ })(unsafe.Pointer(pLoop + 24 /* &.u */)).FpIndex
+ var nEq int32 = int32((*struct {
+ FnEq U16
+ FnBtm U16
+ FnTop U16
+ FnDistinctCol U16
+ FpIndex uintptr
+ })(unsafe.Pointer(pLoop + 24 /* &.u */)).FnEq)
+ var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
+ var nLower int32 = -1
+ var nUpper int32 = ((*Index)(unsafe.Pointer(p)).FnSample + 1)
+ var rc int32 = 0
+ var aff U8 = U8(Xsqlite3IndexColumnAffinity(tls, db, p, nEq))
+ var pColl uintptr
+
+ *(*uintptr)(unsafe.Pointer(bp /* p1 */)) = uintptr(0) // Value extracted from pLower
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* p2 */)) = uintptr(0) // Value extracted from pUpper
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)) = uintptr(0) // Value extracted from record
+
+ pColl = Xsqlite3LocateCollSeq(tls, pParse, *(*uintptr)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FazColl + uintptr(nEq)*8)))
+ if pLower != 0 {
+ rc = Xsqlite3Stat4ValueFromExpr(tls, pParse, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pLower)).FpExpr)).FpRight, aff, bp /* &p1 */)
+ nLower = 0
+ }
+ if (pUpper != 0) && (rc == 0) {
+ rc = Xsqlite3Stat4ValueFromExpr(tls, pParse, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pUpper)).FpExpr)).FpRight, aff, bp+8 /* &p2 */)
+ if *(*uintptr)(unsafe.Pointer(bp + 8 /* p2 */)) != 0 {
+ nUpper = 0
+ } else {
+ nUpper = (*Index)(unsafe.Pointer(p)).FnSample
+ }
+ }
+
+ if (*(*uintptr)(unsafe.Pointer(bp /* p1 */)) != 0) || (*(*uintptr)(unsafe.Pointer(bp + 8 /* p2 */)) != 0) {
+ var i int32
+ var nDiff int32
+ for i = 0; (rc == 0) && (i < (*Index)(unsafe.Pointer(p)).FnSample); i++ {
+ rc = Xsqlite3Stat4Column(tls, db, (*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FaSample+uintptr(i)*40)).Fp, (*IndexSample)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FaSample+uintptr(i)*40)).Fn, nEq, bp+16 /* &pVal */)
+ if (rc == 0) && (*(*uintptr)(unsafe.Pointer(bp /* p1 */)) != 0) {
+ var res int32 = Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(bp /* p1 */)), *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), pColl)
+ if res >= 0 {
+ nLower++
+ }
+ }
+ if (rc == 0) && (*(*uintptr)(unsafe.Pointer(bp + 8 /* p2 */)) != 0) {
+ var res int32 = Xsqlite3MemCompare(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p2 */)), *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)), pColl)
+ if res >= 0 {
+ nUpper++
+ }
+ }
+ }
+ nDiff = (nUpper - nLower)
+ if nDiff <= 0 {
+ nDiff = 1
+ }
+
+ // If there is both an upper and lower bound specified, and the
+ // comparisons indicate that they are close together, use the fallback
+ // method (assume that the scan visits 1/64 of the rows) for estimating
+ // the number of rows visited. Otherwise, estimate the number of rows
+ // using the method described in the header comment for this function.
+ if ((nDiff != 1) || (pUpper == uintptr(0))) || (pLower == uintptr(0)) {
+ var nAdjust int32 = (int32(Xsqlite3LogEst(tls, uint64((*Index)(unsafe.Pointer(p)).FnSample))) - int32(Xsqlite3LogEst(tls, uint64(nDiff))))
+ *(*LogEst)(unsafe.Pointer(pLoop + 22 /* &.nOut */)) -= LogEst((nAdjust))
+ *(*int32)(unsafe.Pointer(pbDone)) = 1
+ }
+ } else {
+ }
+
+ Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp /* p1 */)))
+ Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* p2 */)))
+ Xsqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pVal */)))
+
+ return rc
+}
+
// This function is used to estimate the number of rows that will be visited
// by scanning an index for a range of values. The range may have an upper
// bound, a lower bound, or both. The WHERE clause terms that set the upper
@@ -122112,28 +126688,199 @@ func whereRangeAdjust(tls *crt.TLS, pTerm uintptr, nNew LogEst) LogEst { /* sqli
// used, a single range inequality reduces the search space by a factor of 4.
// and a pair of constraints (x>? AND x<?) reduces the expected number of
// rows visited by a factor of 64.
-func whereRangeScanEst(tls *crt.TLS, pParse uintptr, pBuilder uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr) int32 { /* sqlite3.c:146448:12: */
+func whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower uintptr, pUpper uintptr, pLoop uintptr) int32 { /* sqlite3.c:147075:12: */
+ bp := tls.Alloc(28)
+ defer tls.Free(28)
+
var rc int32 = 0
var nOut int32 = int32((*WhereLoop)(unsafe.Pointer(pLoop)).FnOut)
var nNew LogEst
- _ = pParse
- _ = pBuilder
+ var p uintptr = (*struct {
+ FnEq U16
+ FnBtm U16
+ FnTop U16
+ FnDistinctCol U16
+ FpIndex uintptr
+ })(unsafe.Pointer(pLoop + 24 /* &.u */)).FpIndex
+ var nEq int32 = int32((*struct {
+ FnEq U16
+ FnBtm U16
+ FnTop U16
+ FnDistinctCol U16
+ FpIndex uintptr
+ })(unsafe.Pointer(pLoop + 24 /* &.u */)).FnEq)
+
+ if (((*Index)(unsafe.Pointer(p)).FnSample > 0) && (nEq < (*Index)(unsafe.Pointer(p)).FnSampleCol)) &&
+ ((int32((*Sqlite3)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb))).FdbOptFlags) & (0x0800)) == 0) {
+ if nEq == (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid {
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)) = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec
+ // var a [2]TRowcnt at bp, 8
+
+ var nBtm int32 = int32((*struct {
+ FnEq U16
+ FnBtm U16
+ FnTop U16
+ FnDistinctCol U16
+ FpIndex uintptr
+ })(unsafe.Pointer(pLoop + 24 /* &.u */)).FnBtm)
+ var nTop int32 = int32((*struct {
+ FnEq U16
+ FnBtm U16
+ FnTop U16
+ FnDistinctCol U16
+ FpIndex uintptr
+ })(unsafe.Pointer(pLoop + 24 /* &.u */)).FnTop)
+
+ // Variable iLower will be set to the estimate of the number of rows in
+ // the index that are less than the lower bound of the range query. The
+ // lower bound being the concatenation of $P and $L, where $P is the
+ // key-prefix formed by the nEq values matched against the nEq left-most
+ // columns of the index, and $L is the value in pLower.
+ //
+ // Or, if pLower is NULL or $L cannot be extracted from it (because it
+ // is not a simple variable or literal value), the lower bound of the
+ // range is $P. Due to a quirk in the way whereKeyStats() works, even
+ // if $L is available, whereKeyStats() is called for both ($P) and
+ // ($P:$L) and the larger of the two returned values is used.
+ //
+ // Similarly, iUpper is to be set to the estimate of the number of rows
+ // less than the upper bound of the range query. Where the upper bound
+ // is either ($P) or ($P:$U). Again, even if $U is available, both values
+ // of iUpper are requested of whereKeyStats() and the smaller used.
+ //
+ // The number of rows between the two bounds is then just iUpper-iLower.
+ var iLower TRowcnt // Rows less than the lower bound
+ var iUpper TRowcnt // Rows less than the upper bound
+ var iLwrIdx int32 = -2 // aSample[] for the lower bound
+ var iUprIdx int32 = -1 // aSample[] for the upper bound
+
+ if *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)) != 0 {
+
+ (*UnpackedRecord)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)))).FnField = U16((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid)
+ }
+ // Determine iLower and iUpper using ($P) only.
+ if nEq == 0 {
+ iLower = TRowcnt(0)
+ iUpper = (*Index)(unsafe.Pointer(p)).FnRowEst0
+ } else {
+ // Note: this call could be optimized away - since the same values must
+ // have been requested when testing key $P in whereEqualScanEst().
+ whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)), 0, bp /* &a[0] */)
+ iLower = *(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */ + uintptr(0)*4))
+ iUpper = (*(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */ + uintptr(0)*4)) + *(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */ + uintptr(1)*4)))
+ }
+
+ if *(*U8)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FaSortOrder + uintptr(nEq))) != 0 {
+ /* The roles of pLower and pUpper are swapped for a DESC index */
+ {
+ var t uintptr = pLower
+ pLower = pUpper
+ pUpper = t
+ }
+
+ {
+ var t int32 = nBtm
+ nBtm = nTop
+ nTop = t
+ }
+ }
+
+ // If possible, improve on the iLower estimate using ($P:$L).
+ if pLower != 0 {
+ // var n int32 at bp+16, 4
+ // Values extracted from pExpr
+ var pExpr uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pLower)).FpExpr)).FpRight
+ rc = Xsqlite3Stat4ProbeSetValue(tls, pParse, p, bp+8 /* &pRec */, pExpr, nBtm, nEq, bp+16 /* &n */)
+ if (rc == 0) && (*(*int32)(unsafe.Pointer(bp + 16 /* n */)) != 0) {
+ var iNew TRowcnt
+ var mask U16 = (U16((int32(0x0002) << (54 - 53)) | (int32(0x0002) << (55 - 53))))
+ if Xsqlite3ExprVectorSize(tls, pExpr) > *(*int32)(unsafe.Pointer(bp + 16 /* n */)) {
+ mask = (U16((int32(0x0002) << (55 - 53)) | (int32(0x0002) << (56 - 53))))
+ }
+ iLwrIdx = whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)), 0, bp /* &a[0] */)
+ iNew = (*(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */ + uintptr(0)*4)) + (func() uint32 {
+ if (int32((*WhereTerm)(unsafe.Pointer(pLower)).FeOperator) & int32(mask)) != 0 {
+ return *(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */ + uintptr(1)*4))
+ }
+ return uint32(0)
+ }()))
+ if iNew > iLower {
+ iLower = iNew
+ }
+ nOut--
+ pLower = uintptr(0)
+ }
+ }
+
+ // If possible, improve on the iUpper estimate using ($P:$U).
+ if pUpper != 0 {
+ // var n int32 at bp+20, 4
+ // Values extracted from pExpr
+ var pExpr uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pUpper)).FpExpr)).FpRight
+ rc = Xsqlite3Stat4ProbeSetValue(tls, pParse, p, bp+8 /* &pRec */, pExpr, nTop, nEq, bp+20 /* &n */)
+ if (rc == 0) && (*(*int32)(unsafe.Pointer(bp + 20 /* n */)) != 0) {
+ var iNew TRowcnt
+ var mask U16 = (U16((int32(0x0002) << (54 - 53)) | (int32(0x0002) << (55 - 53))))
+ if Xsqlite3ExprVectorSize(tls, pExpr) > *(*int32)(unsafe.Pointer(bp + 20 /* n */)) {
+ mask = (U16((int32(0x0002) << (55 - 53)) | (int32(0x0002) << (56 - 53))))
+ }
+ iUprIdx = whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */)), 1, bp /* &a[0] */)
+ iNew = (*(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */ + uintptr(0)*4)) + (func() uint32 {
+ if (int32((*WhereTerm)(unsafe.Pointer(pUpper)).FeOperator) & int32(mask)) != 0 {
+ return *(*TRowcnt)(unsafe.Pointer(bp /* &a[0] */ + uintptr(1)*4))
+ }
+ return uint32(0)
+ }()))
+ if iNew < iUpper {
+ iUpper = iNew
+ }
+ nOut--
+ pUpper = uintptr(0)
+ }
+ }
+
+ (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec = *(*uintptr)(unsafe.Pointer(bp + 8 /* pRec */))
+ if rc == 0 {
+ if iUpper > iLower {
+ nNew = Xsqlite3LogEst(tls, (uint64(iUpper - iLower)))
+ // TUNING: If both iUpper and iLower are derived from the same
+ // sample, then assume they are 4x more selective. This brings
+ // the estimated selectivity more in line with what it would be
+ // if estimated without the use of STAT4 tables.
+ if iLwrIdx == iUprIdx {
+ nNew = int16(int32(nNew) - (20))
+ }
+ } else {
+ nNew = int16(10)
+ }
+ if int32(nNew) < nOut {
+ nOut = int32(nNew)
+ }
+ }
+ } else {
+ *(*int32)(unsafe.Pointer(bp + 24 /* bDone */)) = 0
+ rc = whereRangeSkipScanEst(tls, pParse, pLower, pUpper, pLoop, bp+24 /* &bDone */)
+ if *(*int32)(unsafe.Pointer(bp + 24 /* bDone */)) != 0 {
+ return rc
+ }
+ }
+ }
nNew = whereRangeAdjust(tls, pLower, 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
- ** reduced by an additional 75%. This means that, by default, an open-ended
- ** range query (e.g. col > ?) is assumed to match 1/4 of the rows in the
- ** index. While a closed range (e.g. col BETWEEN ? AND ?) is estimated to
- ** match 1/64 of the index. */
+ // TUNING: If there is both an upper and lower limit and neither limit
+ // has an application-defined likelihood(), assume the range is
+ // reduced by an additional 75%. This means that, by default, an open-ended
+ // range query (e.g. col > ?) is assumed to match 1/4 of the rows in the
+ // index. While a closed range (e.g. col BETWEEN ? AND ?) is estimated to
+ // match 1/64 of the index.
if (((pLower != 0) && (int32((*WhereTerm)(unsafe.Pointer(pLower)).FtruthProb) > 0)) && (pUpper != 0)) && (int32((*WhereTerm)(unsafe.Pointer(pUpper)).FtruthProb) > 0) {
nNew = int16(int32(nNew) - (20))
}
- nOut = nOut - ((crt.Bool32(pLower != uintptr(0))) + (crt.Bool32(pUpper != uintptr(0))))
+ nOut = nOut - ((libc.Bool32(pLower != uintptr(0))) + (libc.Bool32(pUpper != uintptr(0))))
if int32(nNew) < 10 {
nNew = int16(10)
}
@@ -122144,9 +126891,128 @@ func whereRangeScanEst(tls *crt.TLS, pParse uintptr, pBuilder uintptr, pLower ui
return rc
}
+// Estimate the number of rows that will be returned based on
+// an equality constraint x=VALUE and where that VALUE occurs in
+// the histogram data. This only works when x is the left-most
+// column of an index and sqlite_stat4 histogram data is available
+// for that index. When pExpr==NULL that means the constraint is
+// "x IS NULL" instead of "x=VALUE".
+//
+// Write the estimated row count into *pnRow and return SQLITE_OK.
+// If unable to make an estimate, leave *pnRow unchanged and return
+// non-zero.
+//
+// This routine can fail if it is unable to load a collating sequence
+// required for string comparison, or if unable to allocate memory
+// for a UTF conversion required for comparison. The error is stored
+// in the pParse structure.
+func whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr uintptr, pnRow uintptr) int32 { /* sqlite3.c:147256:12: */
+ bp := tls.Alloc(20)
+ defer tls.Free(20)
+
+ var p uintptr = (*struct {
+ FnEq U16
+ FnBtm U16
+ FnTop U16
+ FnDistinctCol U16
+ FpIndex uintptr
+ })(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24 /* &.u */)).FpIndex
+ var nEq int32 = int32((*struct {
+ FnEq U16
+ FnBtm U16
+ FnTop U16
+ FnDistinctCol U16
+ FpIndex uintptr
+ })(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24 /* &.u */)).FnEq)
+ *(*uintptr)(unsafe.Pointer(bp /* pRec */)) = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec
+ var rc int32 // Subfunction return code
+ // var a [2]TRowcnt at bp+12, 8
+ // Statistics
+ // var bOk int32 at bp+8, 4
+
+ // If values are not available for all fields of the index to the left
+ // of this one, no estimate can be made. Return SQLITE_NOTFOUND.
+ if (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid < (nEq - 1) {
+ return 12
+ }
+
+ // This is an optimization only. The call to sqlite3Stat4ProbeSetValue()
+ // below would return the same value.
+ if nEq >= int32((*Index)(unsafe.Pointer(p)).FnColumn) {
+ *(*TRowcnt)(unsafe.Pointer(pnRow)) = TRowcnt(1)
+ return 0
+ }
+
+ rc = Xsqlite3Stat4ProbeSetValue(tls, pParse, p, bp /* &pRec */, pExpr, 1, (nEq - 1), bp+8 /* &bOk */)
+ (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec = *(*uintptr)(unsafe.Pointer(bp /* pRec */))
+ if rc != 0 {
+ return rc
+ }
+ if *(*int32)(unsafe.Pointer(bp + 8 /* bOk */)) == 0 {
+ return 12
+ }
+ (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = nEq
+
+ whereKeyStats(tls, pParse, p, *(*uintptr)(unsafe.Pointer(bp /* pRec */)), 0, bp+12 /* &a[0] */)
+
+ *(*TRowcnt)(unsafe.Pointer(pnRow)) = *(*TRowcnt)(unsafe.Pointer(bp + 12 /* &a[0] */ + uintptr(1)*4))
+
+ return rc
+}
+
+// Estimate the number of rows that will be returned based on
+// an IN constraint where the right-hand side of the IN operator
+// is a list of values. Example:
+//
+// WHERE x IN (1,2,3,4)
+//
+// Write the estimated row count into *pnRow and return SQLITE_OK.
+// If unable to make an estimate, leave *pnRow unchanged and return
+// non-zero.
+//
+// This routine can fail if it is unable to load a collating sequence
+// required for string comparison, or if unable to allocate memory
+// for a UTF conversion required for comparison. The error is stored
+// in the pParse structure.
+func whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uintptr, pnRow uintptr) int32 { /* sqlite3.c:147320:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var p uintptr = (*struct {
+ FnEq U16
+ FnBtm U16
+ FnTop U16
+ FnDistinctCol U16
+ FpIndex uintptr
+ })(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24 /* &.u */)).FpIndex
+ var nRow0 I64 = I64(Xsqlite3LogEstToInt(tls, *(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(p)).FaiRowLogEst + uintptr(0)*2))))
+ var nRecValid int32 = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid
+ var rc int32 = 0 // Subfunction return code
+ // var nEst TRowcnt at bp, 4
+ // Number of rows for a single term
+ var nRowEst TRowcnt = TRowcnt(0) // New estimate of the number of rows
+ var i int32 // Loop counter
+
+ for i = 0; (rc == 0) && (i < (*ExprList)(unsafe.Pointer(pList)).FnExpr); i++ {
+ *(*TRowcnt)(unsafe.Pointer(bp /* nEst */)) = TRowcnt(nRow0)
+ rc = whereEqualScanEst(tls, pParse, pBuilder, (*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(i)*32)).FpExpr, bp /* &nEst */)
+ nRowEst = nRowEst + (*(*TRowcnt)(unsafe.Pointer(bp /* nEst */)))
+ (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = nRecValid
+ }
+
+ if rc == 0 {
+ if I64(nRowEst) > nRow0 {
+ nRowEst = TRowcnt(nRow0)
+ }
+ *(*TRowcnt)(unsafe.Pointer(pnRow)) = nRowEst
+ }
+
+ return rc
+}
+
// Convert bulk memory into a valid WhereLoop that can be passed
// to whereLoopClear harmlessly.
-func whereLoopInit(tls *crt.TLS, p uintptr) { /* sqlite3.c:146839:13: */
+func whereLoopInit(tls *libc.TLS, p uintptr) { /* sqlite3.c:147466:13: */
(*WhereLoop)(unsafe.Pointer(p)).FaLTerm = p + 72 /* &.aLTermSpace */
(*WhereLoop)(unsafe.Pointer(p)).FnLTerm = U16(0)
(*WhereLoop)(unsafe.Pointer(p)).FnLSlot = U16((int32(uint64(unsafe.Sizeof([3]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0))))))
@@ -122154,7 +127020,7 @@ func whereLoopInit(tls *crt.TLS, p uintptr) { /* sqlite3.c:146839:13: */
}
// Clear the WhereLoop.u union. Leave WhereLoop.pLTerm intact.
-func whereLoopClearUnion(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:146849:13: */
+func whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147476:13: */
if ((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & (U32(0x00000400 | 0x00004000))) != 0 {
if (((*WhereLoop)(unsafe.Pointer(p)).FwsFlags & U32(0x00000400)) != U32(0)) && ((*struct {
FidxNum int32
@@ -122217,7 +127083,7 @@ func whereLoopClearUnion(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:146
}
// Deallocate internal memory used by a WhereLoop object
-func whereLoopClear(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:146866:13: */
+func whereLoopClear(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147493:13: */
if (*WhereLoop)(unsafe.Pointer(p)).FaLTerm != p+72 /* &.aLTermSpace */ {
Xsqlite3DbFreeNN(tls, db, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm)
}
@@ -122226,17 +127092,17 @@ func whereLoopClear(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:146866:1
}
// Increase the memory allocation for pLoop->aLTerm[] to be at least n.
-func whereLoopResize(tls *crt.TLS, db uintptr, p uintptr, n int32) int32 { /* sqlite3.c:146875:12: */
+func whereLoopResize(tls *libc.TLS, db uintptr, p uintptr, n int32) int32 { /* sqlite3.c:147502:12: */
var paNew uintptr
if int32((*WhereLoop)(unsafe.Pointer(p)).FnLSlot) >= n {
return 0
}
- n = ((n + 7) & ^int32(crt.Int32FromInt32(7)))
+ n = ((n + 7) & ^int32(libc.Int32FromInt32(7)))
paNew = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(unsafe.Sizeof(uintptr(0))) * uint64(n))))
if paNew == uintptr(0) {
return 7
}
- crt.Xmemcpy(tls, paNew, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm, (uint64(unsafe.Sizeof(uintptr(0))) * uint64((*WhereLoop)(unsafe.Pointer(p)).FnLSlot)))
+ libc.Xmemcpy(tls, paNew, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm, (uint64(unsafe.Sizeof(uintptr(0))) * uint64((*WhereLoop)(unsafe.Pointer(p)).FnLSlot)))
if (*WhereLoop)(unsafe.Pointer(p)).FaLTerm != p+72 /* &.aLTermSpace */ {
Xsqlite3DbFreeNN(tls, db, (*WhereLoop)(unsafe.Pointer(p)).FaLTerm)
}
@@ -122246,10 +127112,10 @@ func whereLoopResize(tls *crt.TLS, db uintptr, p uintptr, n int32) int32 { /* sq
}
// Transfer content from the second pLoop into the first.
-func whereLoopXfer(tls *crt.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:146891:12: */
+func whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 { /* sqlite3.c:147518:12: */
whereLoopClearUnion(tls, db, pTo)
if whereLoopResize(tls, db, pTo, int32((*WhereLoop)(unsafe.Pointer(pFrom)).FnLTerm)) != 0 {
- crt.Xmemset(tls, (pTo + 24 /* &.u */), 0, uint64(unsafe.Sizeof(struct {
+ libc.Xmemset(tls, (pTo + 24 /* &.u */), 0, uint64(unsafe.Sizeof(struct {
Fbtree struct {
FnEq U16
FnBtm U16
@@ -122260,8 +127126,8 @@ func whereLoopXfer(tls *crt.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 {
}{})))
return 7
}
- crt.Xmemcpy(tls, pTo, pFrom, uint64((uintptr(0) + 48 /* &.nLSlot */)))
- crt.Xmemcpy(tls, (*WhereLoop)(unsafe.Pointer(pTo)).FaLTerm, (*WhereLoop)(unsafe.Pointer(pFrom)).FaLTerm, (uint64((*WhereLoop)(unsafe.Pointer(pTo)).FnLTerm) * uint64(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemcpy(tls, pTo, pFrom, uint64((uintptr(0) + 48 /* &.nLSlot */)))
+ libc.Xmemcpy(tls, (*WhereLoop)(unsafe.Pointer(pTo)).FaLTerm, (*WhereLoop)(unsafe.Pointer(pFrom)).FaLTerm, (uint64((*WhereLoop)(unsafe.Pointer(pTo)).FnLTerm) * uint64(unsafe.Sizeof(uintptr(0)))))
if ((*WhereLoop)(unsafe.Pointer(pFrom)).FwsFlags & U32(0x00000400)) != 0 {
(*struct {
FidxNum int32
@@ -122283,13 +127149,13 @@ func whereLoopXfer(tls *crt.TLS, db uintptr, pTo uintptr, pFrom uintptr) int32 {
}
// Delete a WhereLoop object
-func whereLoopDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:146910:13: */
+func whereLoopDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:147537:13: */
whereLoopClear(tls, db, p)
Xsqlite3DbFreeNN(tls, db, p)
}
// Free a WhereInfo structure
-func whereInfoFree(tls *crt.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:146918:13: */
+func whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:147545:13: */
var i int32
for i = 0; i < int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel); i++ {
@@ -122327,7 +127193,7 @@ func whereInfoFree(tls *crt.TLS, db uintptr, pWInfo uintptr) { /* sqlite3.c:1469
// deserve a lower cost even if it is a proper subset of Y. Constraint (5)
// was added because a covering index probably deserves to have a lower cost
// than a non-covering index even if it is a proper subset.
-func whereLoopCheaperProperSubset(tls *crt.TLS, pX uintptr, pY uintptr) int32 { /* sqlite3.c:146955:12: */
+func whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) int32 { /* sqlite3.c:147582:12: */
var i int32
var j int32
if (int32((*WhereLoop)(unsafe.Pointer(pX)).FnLTerm) - int32((*WhereLoop)(unsafe.Pointer(pX)).FnSkip)) >= (int32((*WhereLoop)(unsafe.Pointer(pY)).FnLTerm) - int32((*WhereLoop)(unsafe.Pointer(pY)).FnSkip)) {
@@ -122376,7 +127242,7 @@ func whereLoopCheaperProperSubset(tls *crt.TLS, pX uintptr, pY uintptr) int32 {
// To say "WhereLoop X is a proper subset of Y" means that X uses fewer
// WHERE clause terms than Y and that every WHERE clause term used by X is
// also used by Y.
-func whereLoopAdjustCost(tls *crt.TLS, p uintptr, pTemplate uintptr) { /* sqlite3.c:146996:13: */
+func whereLoopAdjustCost(tls *libc.TLS, p uintptr, pTemplate uintptr) { /* sqlite3.c:147623:13: */
if ((*WhereLoop)(unsafe.Pointer(pTemplate)).FwsFlags & U32(0x00000200)) == U32(0) {
return
}
@@ -122415,7 +127281,7 @@ func whereLoopAdjustCost(tls *crt.TLS, p uintptr, pTemplate uintptr) { /* sqlite
// If pTemplate cannot replace any existing element of the list but needs
// to be added to the list as a new entry, then return a pointer to the
// tail of the list.
-func whereLoopFindLesser(tls *crt.TLS, ppPrev uintptr, pTemplate uintptr) uintptr { /* sqlite3.c:147033:18: */
+func whereLoopFindLesser(tls *libc.TLS, ppPrev uintptr, pTemplate uintptr) uintptr { /* sqlite3.c:147660:18: */
var p uintptr
p = *(*uintptr)(unsafe.Pointer(ppPrev))
__1:
@@ -122503,7 +127369,7 @@ __3:
// (2) They have the same iSortIdx.
// (3) The template has same or fewer dependencies than the current loop
// (4) The template has the same or lower cost than the current loop
-func whereLoopInsert(tls *crt.TLS, pBuilder uintptr, pTemplate uintptr) int32 { /* sqlite3.c:147121:12: */
+func whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) int32 { /* sqlite3.c:147748:12: */
var ppPrev uintptr
var p uintptr
var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
@@ -122548,7 +127414,7 @@ func whereLoopInsert(tls *crt.TLS, pBuilder uintptr, pTemplate uintptr) int32 {
// WhereLoop and insert it.
if p == uintptr(0) {
// Allocate a new WhereLoop to add to the end of the list
- *(*uintptr)(unsafe.Pointer(ppPrev)) = crt.AssignUintptr(&p, Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(WhereLoop{}))))
+ *(*uintptr)(unsafe.Pointer(ppPrev)) = libc.AssignUintptr(&p, Xsqlite3DbMallocRawNN(tls, db, uint64(unsafe.Sizeof(WhereLoop{}))))
if p == uintptr(0) {
return 7
}
@@ -122622,7 +127488,7 @@ func whereLoopInsert(tls *crt.TLS, pBuilder uintptr, pTemplate uintptr) int32 {
// "x" column is boolean or else -1 or 0 or 1 is a common default value
// on the "x" column and so in that case only cap the output row estimate
// at 1/2 instead of 1/4.
-func whereLoopOutputAdjust(tls *crt.TLS, pWC uintptr, pLoop uintptr, nRow LogEst) { /* sqlite3.c:147258:13: */
+func whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow LogEst) { /* sqlite3.c:147885:13: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -122672,7 +127538,7 @@ __1:
// guess a reasonable truth probability.
(*WhereLoop)(unsafe.Pointer(pLoop)).FnOut--
if ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & (0x0002 | 0x0080)) != 0) &&
- ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & 0) == 0) {
+ ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & 0x4000) == 0) {
var pRight uintptr = (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight
*(*int32)(unsafe.Pointer(bp /* k */)) = 0
@@ -122717,7 +127583,7 @@ __3:
//
// then this function would be invoked with nEq=1. The value returned in
// this case is 3.
-func whereRangeVectorLen(tls *crt.TLS, pParse uintptr, iCur int32, pIdx uintptr, nEq int32, pTerm uintptr) int32 { /* sqlite3.c:147328:12: */
+func whereRangeVectorLen(tls *libc.TLS, pParse uintptr, iCur int32, pIdx uintptr, nEq int32, pTerm uintptr) int32 { /* sqlite3.c:147955:12: */
var nCmp int32 = Xsqlite3ExprVectorSize(tls, (*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpLeft)
var i int32
@@ -122782,9 +127648,9 @@ func whereRangeVectorLen(tls *crt.TLS, pParse uintptr, iCur int32, pIdx uintptr,
//
// If pProbe->idxType==SQLITE_IDXTYPE_IPK, that means pIndex is
// a fake index used for the INTEGER PRIMARY KEY.
-func whereLoopAddBtreeIndex(tls *crt.TLS, pBuilder uintptr, pSrc uintptr, pProbe uintptr, nInMul LogEst) int32 { /* sqlite3.c:147399:12: */
- bp := tls.Alloc(112)
- defer tls.Free(112)
+func whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pProbe uintptr, nInMul LogEst) int32 { /* sqlite3.c:148026:12: */
+ bp := tls.Alloc(116)
+ defer tls.Free(116)
var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo // WHERE analyse context
var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse // Parsing context
@@ -122820,7 +127686,7 @@ func whereLoopAddBtreeIndex(tls *crt.TLS, pBuilder uintptr, pSrc uintptr, pProbe
opMask = (((((((0x0002 | 0x0001) | (int32(0x0002) << (54 - 53))) | (int32(0x0002) << (57 - 53))) | (int32(0x0002) << (56 - 53))) | (int32(0x0002) << (55 - 53))) | 0x0100) | 0x0080)
}
if uint32(int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.bUnordered */))&0x4>>2)) != 0 {
- opMask = opMask & (^int32(crt.Int32FromInt32(((((int32(0x0002) << (54 - 53)) | (int32(0x0002) << (57 - 53))) | (int32(0x0002) << (56 - 53))) | (int32(0x0002) << (55 - 53))))))
+ opMask = opMask & (^int32(libc.Int32FromInt32(((((int32(0x0002) << (54 - 53)) | (int32(0x0002) << (57 - 53))) | (int32(0x0002) << (56 - 53))) | (int32(0x0002) << (55 - 53))))))
}
saved_nEq = (*struct {
@@ -122859,7 +127725,8 @@ func whereLoopAddBtreeIndex(tls *crt.TLS, pBuilder uintptr, pSrc uintptr, pProbe
var rCostIdx LogEst
var nOutUnadjusted LogEst // nOut before IN() and WHERE adjustments
var nIn int32 = 0
- if ((int32(eOp) == 0x0100) || ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & 0x0000) != 0)) &&
+ var nRecValid int32 = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid
+ if ((int32(eOp) == 0x0100) || ((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & 0x0080) != 0)) &&
(indexColumnNotNull(tls, pProbe, int32(saved_nEq)) != 0) {
continue
}
@@ -122882,9 +127749,9 @@ func whereLoopAddBtreeIndex(tls *crt.TLS, pBuilder uintptr, pSrc uintptr, pProbe
}
if (int32((*Index)(unsafe.Pointer((pProbe))).FonError) != 0) && (int32(saved_nEq) == (int32((*Index)(unsafe.Pointer(pProbe)).FnKeyCol) - 1)) {
- *(*uint8)(unsafe.Pointer(pBuilder + 40 /* &.bldFlags1 */)) |= uint8((0x0002))
+ *(*uint8)(unsafe.Pointer(pBuilder + 52 /* &.bldFlags1 */)) |= uint8((0x0002))
} else {
- *(*uint8)(unsafe.Pointer(pBuilder + 40 /* &.bldFlags1 */)) |= uint8((0x0001))
+ *(*uint8)(unsafe.Pointer(pBuilder + 52 /* &.bldFlags1 */)) |= uint8((0x0001))
}
(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = saved_wsFlags
(*struct {
@@ -122912,7 +127779,7 @@ func whereLoopAddBtreeIndex(tls *crt.TLS, pBuilder uintptr, pSrc uintptr, pProbe
if whereLoopResize(tls, db, pNew, (int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)) != 0 {
break
} // OOM
- *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(crt.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = pTerm
+ *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = pTerm
(*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = ((saved_prereq | (*WhereTerm)(unsafe.Pointer(pTerm)).FprereqRight) & ^(*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf)
if (int32(eOp) & 0x0001) != 0 {
@@ -123004,7 +127871,7 @@ func whereLoopAddBtreeIndex(tls *crt.TLS, pBuilder uintptr, pSrc uintptr, pProbe
if whereLoopResize(tls, db, pNew, (int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)) != 0 {
break
} // OOM
- *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(crt.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = pTop
+ *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = pTop
*(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(0x00000010))
(*struct {
FnEq U16
@@ -123044,7 +127911,7 @@ func whereLoopAddBtreeIndex(tls *crt.TLS, pBuilder uintptr, pSrc uintptr, pProbe
// data, using some other estimate.
whereRangeScanEst(tls, pParse, pBuilder, pBtm, pTop, pNew)
} else {
- var nEq int32 = int32(crt.PreIncUint16(&(*struct {
+ var nEq int32 = int32(libc.PreIncUint16(&(*struct {
FnEq U16
FnBtm U16
FnTop U16
@@ -123057,7 +127924,53 @@ func whereLoopAddBtreeIndex(tls *crt.TLS, pBuilder uintptr, pSrc uintptr, pProbe
*(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) += LogEst((int32((*WhereTerm)(unsafe.Pointer(pTerm)).FtruthProb)))
*(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) -= LogEst((nIn))
} else {
- {
+ *(*TRowcnt)(unsafe.Pointer(bp + 112 /* nOut */)) = TRowcnt(0)
+ if ((((int32(nInMul) == 0) &&
+ ((*Index)(unsafe.Pointer(pProbe)).FnSample != 0)) &&
+ (int32((*struct {
+ FnEq U16
+ FnBtm U16
+ FnTop U16
+ FnDistinctCol U16
+ FpIndex uintptr
+ })(unsafe.Pointer(pNew+24 /* &.u */)).FnEq) <= (*Index)(unsafe.Pointer(pProbe)).FnSampleCol)) &&
+ (((int32(eOp) & 0x0001) == 0) || !(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(0x000800))) != U32(0)))) &&
+ ((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x0800)) == 0) {
+ var pExpr uintptr = (*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr
+ if (int32(eOp) & ((0x0002 | 0x0100) | 0x0080)) != 0 {
+
+ rc = whereEqualScanEst(tls, pParse, pBuilder, (*Expr)(unsafe.Pointer(pExpr)).FpRight, bp+112 /* &nOut */)
+ } else {
+ rc = whereInScanEst(tls, pParse, pBuilder, *(*uintptr)(unsafe.Pointer(pExpr + 32 /* &.x */)), bp+112 /* &nOut */)
+ }
+ if rc == 12 {
+ rc = 0
+ }
+ if rc != 0 {
+ break
+ } // Jump out of the pTerm loop
+ if *(*TRowcnt)(unsafe.Pointer(bp + 112 /* nOut */)) != 0 {
+ (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = Xsqlite3LogEst(tls, uint64(*(*TRowcnt)(unsafe.Pointer(bp + 112 /* nOut */))))
+ if (nEq == 1) &&
+ // TUNING: Mark terms as "low selectivity" if they seem likely
+ // to be true for half or more of the rows in the table.
+ // See tag-202002240-1
+ ((int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) + 10) > int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(0)*2)))) {
+ *(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((0x4000))
+ if (int32((*WhereTerm)(unsafe.Pointer(pTerm)).FwtFlags) & 0x2000) != 0 {
+ // If the term has previously been used with an assumption of
+ // higher selectivity, then set the flag to rerun the
+ // loop computations.
+ *(*uint8)(unsafe.Pointer(pBuilder + 53 /* &.bldFlags2 */)) |= uint8((0x0004))
+ }
+ }
+ if int32((*WhereLoop)(unsafe.Pointer(pNew)).FnOut) > int32(saved_nOut) {
+ (*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut
+ }
+ *(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) -= LogEst((nIn))
+ }
+ }
+ if *(*TRowcnt)(unsafe.Pointer(bp + 112 /* nOut */)) == TRowcnt(0) {
*(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) += LogEst((int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(nEq)*2))) - int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr((nEq-1))*2)))))
if (int32(eOp) & 0x0100) != 0 {
// TUNING: If there is no likelihood() value, assume that a
@@ -123103,6 +128016,7 @@ func whereLoopAddBtreeIndex(tls *crt.TLS, pBuilder uintptr, pSrc uintptr, pProbe
whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, (int16(int32(nInMul) + nIn)))
}
(*WhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut
+ (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = nRecValid
}
(*WhereLoop)(unsafe.Pointer(pNew)).Fprereq = saved_prereq
(*struct {
@@ -123149,7 +128063,7 @@ func whereLoopAddBtreeIndex(tls *crt.TLS, pBuilder uintptr, pSrc uintptr, pProbe
(int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.hasStat1 */))&0x80>>7) != 0)) &&
((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x4000)) == 0)) &&
(int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr((int32(saved_nEq)+1))*2))) >= 42)) && // TUNING: Minimum for skip-scan
- ((crt.AssignInt32(&rc, whereLoopResize(tls, db, pNew, (int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)))) == 0) {
+ ((libc.AssignInt32(&rc, whereLoopResize(tls, db, pNew, (int32((*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+1)))) == 0) {
var nIter LogEst
(*struct {
FnEq U16
@@ -123159,7 +128073,7 @@ func whereLoopAddBtreeIndex(tls *crt.TLS, pBuilder uintptr, pSrc uintptr, pProbe
FpIndex uintptr
})(unsafe.Pointer(pNew+24 /* &.u */)).FnEq++
(*WhereLoop)(unsafe.Pointer(pNew)).FnSkip++
- *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(crt.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.PostIncUint16(&(*WhereLoop)(unsafe.Pointer(pNew)).FnLTerm, 1))*8)) = uintptr(0)
*(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(0x00008000))
nIter = (LogEst(int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr(saved_nEq)*2))) - int32(*(*LogEst)(unsafe.Pointer((*Index)(unsafe.Pointer(pProbe)).FaiRowLogEst + uintptr((int32(saved_nEq)+1))*2)))))
*(*LogEst)(unsafe.Pointer(pNew + 22 /* &.nOut */)) -= LogEst((int32(nIter)))
@@ -123188,7 +128102,7 @@ func whereLoopAddBtreeIndex(tls *crt.TLS, pBuilder uintptr, pSrc uintptr, pProbe
// Return False if pBuilder does not contain an ORDER BY clause or
// if there is no way for pIndex to be useful in implementing that
// ORDER BY clause.
-func indexMightHelpWithOrderBy(tls *crt.TLS, pBuilder uintptr, pIndex uintptr, iCursor int32) int32 { /* sqlite3.c:147784:12: */
+func indexMightHelpWithOrderBy(tls *libc.TLS, pBuilder uintptr, pIndex uintptr, iCursor int32) int32 { /* sqlite3.c:148411:12: */
var pOB uintptr
var aColExpr uintptr
var ii int32
@@ -123197,7 +128111,7 @@ func indexMightHelpWithOrderBy(tls *crt.TLS, pBuilder uintptr, pIndex uintptr, i
if uint32(int32(*(*uint16)(unsafe.Pointer(pIndex + 100 /* &.bUnordered */))&0x4>>2)) != 0 {
return 0
}
- if (crt.AssignUintptr(&pOB, (*WhereInfo)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpOrderBy)) == uintptr(0) {
+ if (libc.AssignUintptr(&pOB, (*WhereInfo)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpOrderBy)) == uintptr(0) {
return 0
}
for ii = 0; ii < (*ExprList)(unsafe.Pointer(pOB)).FnExpr; ii++ {
@@ -123211,7 +128125,7 @@ func indexMightHelpWithOrderBy(tls *crt.TLS, pBuilder uintptr, pIndex uintptr, i
return 1
}
}
- } else if (crt.AssignUintptr(&aColExpr, (*Index)(unsafe.Pointer(pIndex)).FaColExpr)) != uintptr(0) {
+ } else if (libc.AssignUintptr(&aColExpr, (*Index)(unsafe.Pointer(pIndex)).FaColExpr)) != uintptr(0) {
for jj = 0; jj < int32((*Index)(unsafe.Pointer(pIndex)).FnKeyCol); jj++ {
if int32(*(*I16)(unsafe.Pointer((*Index)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(jj)*2))) != (-2) {
continue
@@ -123227,7 +128141,7 @@ func indexMightHelpWithOrderBy(tls *crt.TLS, pBuilder uintptr, pIndex uintptr, i
// Check to see if a partial index with pPartIndexWhere can be used
// in the current query. Return true if it can be and false if not.
-func whereUsablePartialIndex(tls *crt.TLS, iTab int32, isLeft int32, pWC uintptr, pWhere uintptr) int32 { /* sqlite3.c:147817:12: */
+func whereUsablePartialIndex(tls *libc.TLS, iTab int32, isLeft int32, pWC uintptr, pWhere uintptr) int32 { /* sqlite3.c:148444:12: */
var i int32
var pTerm uintptr
var pParse uintptr = (*WhereInfo)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse
@@ -123300,17 +128214,17 @@ __3:
// bias the scoring in favor of using an index, since the worst-case
// performance of using an index is far better than the worst-case performance
// of a full table scan.
-func whereLoopAddBtree(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { /* sqlite3.c:147880:12: */
- bp := tls.Alloc(118)
- defer tls.Free(118)
+func whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask) int32 { /* sqlite3.c:148507:12: */
+ bp := tls.Alloc(158)
+ defer tls.Free(158)
var pWInfo uintptr // WHERE analysis context
var pProbe uintptr // An index we are evaluating
- // var sPk Index at bp, 112
+ // var sPk Index at bp, 152
// A fake index object for the primary key
- // var aiRowEstPk [2]LogEst at bp+114, 4
+ // var aiRowEstPk [2]LogEst at bp+154, 4
// The aiRowLogEst[] value for the sPk index
- *(*I16)(unsafe.Pointer(bp + 112 /* aiColumnPk */)) = int16(-1) // The aColumn[] value for the sPk index
+ *(*I16)(unsafe.Pointer(bp + 152 /* aiColumnPk */)) = int16(-1) // The aColumn[] value for the sPk index
var pTabList uintptr // The FROM clause
var pSrc uintptr // The FROM clause btree term to add
var pNew uintptr // Template WhereLoop object
@@ -123340,17 +128254,17 @@ func whereLoopAddBtree(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask) int32 {
// fake index the first in a chain of Index objects with all of the real
// indices to follow
var pFirst uintptr // First of real indices on the table
- crt.Xmemset(tls, bp /* &sPk */, 0, uint64(unsafe.Sizeof(Index{})))
+ libc.Xmemset(tls, bp /* &sPk */, 0, uint64(unsafe.Sizeof(Index{})))
(*Index)(unsafe.Pointer(bp /* &sPk */)).FnKeyCol = U16(1)
(*Index)(unsafe.Pointer(bp /* &sPk */)).FnColumn = U16(1)
- (*Index)(unsafe.Pointer(bp /* &sPk */)).FaiColumn = bp + 112 /* &aiColumnPk */
- (*Index)(unsafe.Pointer(bp /* &sPk */)).FaiRowLogEst = bp + 114 /* &aiRowEstPk[0] */
+ (*Index)(unsafe.Pointer(bp /* &sPk */)).FaiColumn = bp + 152 /* &aiColumnPk */
+ (*Index)(unsafe.Pointer(bp /* &sPk */)).FaiRowLogEst = bp + 154 /* &aiRowEstPk[0] */
(*Index)(unsafe.Pointer(bp /* &sPk */)).FonError = U8(5)
(*Index)(unsafe.Pointer(bp /* &sPk */)).FpTable = pTab
(*Index)(unsafe.Pointer(bp /* &sPk */)).FszIdxRow = (*Table)(unsafe.Pointer(pTab)).FszTabRow
- crt.SetBitFieldPtr16Uint32(bp /* &sPk */ +100 /* &.idxType */, uint32(3), 0, 0x3)
- *(*LogEst)(unsafe.Pointer(bp + 114 /* &aiRowEstPk[0] */ + uintptr(0)*2)) = (*Table)(unsafe.Pointer(pTab)).FnRowLogEst
- *(*LogEst)(unsafe.Pointer(bp + 114 /* &aiRowEstPk[0] */ + uintptr(1)*2)) = int16(0)
+ libc.SetBitFieldPtr16Uint32(bp /* &sPk */ +100 /* &.idxType */, uint32(3), 0, 0x3)
+ *(*LogEst)(unsafe.Pointer(bp + 154 /* &aiRowEstPk[0] */ + uintptr(0)*2)) = (*Table)(unsafe.Pointer(pTab)).FnRowLogEst
+ *(*LogEst)(unsafe.Pointer(bp + 154 /* &aiRowEstPk[0] */ + uintptr(1)*2)) = int16(0)
pFirst = (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FpIndex
if int32(*(*uint8)(unsafe.Pointer((pSrc + 60 /* &.fg */) + 4 /* &.notIndexed */))&0x1>>0) == 0 {
// The real indices of the table are only considered if the
@@ -123434,7 +128348,7 @@ __1:
goto __3
}
{
- var isLeft int32 = (crt.Bool32((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & 0x0020) != 0))
+ var isLeft int32 = (libc.Bool32((int32((*SrcList_item)(unsafe.Pointer(pSrc)).Ffg.Fjointype) & 0x0020) != 0))
if ((*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0)) &&
!(whereUsablePartialIndex(tls, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor, isLeft, pWC,
(*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere) != 0) {
@@ -123480,6 +128394,7 @@ __1:
FpIndex uintptr
})(unsafe.Pointer(pNew + 24 /* &.u */)).FpIndex = pProbe
b = indexMightHelpWithOrderBy(tls, pBuilder, pProbe, (*SrcList_item)(unsafe.Pointer(pSrc)).FiCursor)
+
// The ONEPASS_DESIRED flags never occurs together with ORDER BY
if int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.idxType */))&0x3>>0) == 3 {
@@ -123518,9 +128433,10 @@ __1:
}
// Full scan via index
- if (((b != 0) ||
+ if ((((b != 0) ||
!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0))) ||
((*Index)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0))) ||
+ (uint32(int32(*(*uint8)(unsafe.Pointer((pSrc + 60 /* &.fg */) + 4 /* &.isIndexedBy */))&0x2>>1)) != 0)) ||
((((((m == uint64(0)) &&
(int32(*(*uint16)(unsafe.Pointer(pProbe + 100 /* &.bUnordered */))&0x4>>2) == 0)) &&
(int32((*Index)(unsafe.Pointer(pProbe)).FszIdxRow) < int32((*Table)(unsafe.Pointer(pTab)).FszTabRow))) &&
@@ -123586,6 +128502,9 @@ __1:
// plan
*(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(0x0100))
}
+ Xsqlite3Stat4ProbeFree(tls, (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec)
+ (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid = 0
+ (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec = uintptr(0)
}
goto __2
__2:
@@ -123621,7 +128540,7 @@ __3:
//
// Output parameter *pbIn is set to true if the plan added to pBuilder
// uses one or more WO_IN terms, or false otherwise.
-func whereLoopAddVirtualOne(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUsable Bitmask, mExclude U16, pIdxInfo uintptr, mNoOmit U16, pbIn uintptr) int32 { /* sqlite3.c:148137:12: */
+func whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUsable Bitmask, mExclude U16, pIdxInfo uintptr, mNoOmit U16, pbIn uintptr) int32 { /* sqlite3.c:148766:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -123665,7 +128584,7 @@ __3:
;
// Initialize the output fields of the sqlite3_index_info structure
- crt.Xmemset(tls, pUsage, 0, (uint64(unsafe.Sizeof(sqlite3_index_constraint_usage{})) * uint64(nConstraint)))
+ libc.Xmemset(tls, pUsage, 0, (uint64(unsafe.Sizeof(sqlite3_index_constraint_usage{})) * uint64(nConstraint)))
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = uintptr(0)
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 0
@@ -123708,7 +128627,7 @@ __4:
}
{
var iTerm int32
- if (crt.AssignInt32(&iTerm, ((*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage+uintptr(i)*8)).FargvIndex - 1))) >= 0 {
+ if (libc.AssignInt32(&iTerm, ((*sqlite3_index_constraint_usage)(unsafe.Pointer(pUsage+uintptr(i)*8)).FargvIndex - 1))) >= 0 {
var pTerm uintptr
var j int32 = (*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset
if ((((iTerm >= nConstraint) ||
@@ -123716,7 +128635,7 @@ __4:
(j >= (*WhereClause)(unsafe.Pointer(pWC)).FnTerm)) ||
(*(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0))) ||
(int32((*sqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+19649 /* "%s.xBestIndex ma..." */, crt.VaList(bp, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+23589 /* "%s.xBestIndex ma..." */, libc.VaList(bp, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FzName))
return 1
}
@@ -123743,7 +128662,7 @@ __4:
// (2) Multiple outputs from a single IN value will not merge
// together.
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = 0
- *(*int32)(unsafe.Pointer(pIdxInfo + 80 /* &.idxFlags */)) &= (^int32(crt.Int32FromInt32(1)))
+ *(*int32)(unsafe.Pointer(pIdxInfo + 80 /* &.idxFlags */)) &= (^int32(libc.Int32FromInt32(1)))
*(*int32)(unsafe.Pointer(pbIn)) = 1
}
}
@@ -123762,7 +128681,7 @@ __6:
if *(*uintptr)(unsafe.Pointer((*WhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) {
// The non-zero argvIdx values must be contiguous. Raise an
// error if they are not
- Xsqlite3ErrorMsg(tls, pParse, ts+19649 /* "%s.xBestIndex ma..." */, crt.VaList(bp+8, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FzName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+23589 /* "%s.xBestIndex ma..." */, libc.VaList(bp+8, (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pSrc)).FpTab)).FzName))
return 1
}
@@ -123811,7 +128730,7 @@ __6:
if ((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags & 1) != 0 {
*(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) |= (U32(0x00001000))
} else {
- *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) &= (^U32(crt.Int32FromInt32(0x00001000)))
+ *(*U32)(unsafe.Pointer(pNew + 40 /* &.wsFlags */)) &= (^U32(libc.Int32FromInt32(0x00001000)))
}
rc = whereLoopInsert(tls, pBuilder, pNew)
if (*struct {
@@ -123845,7 +128764,7 @@ __6:
// sequence associated with element iCons of the sqlite3_index_info.aConstraint
// array. Or, if iCons is out of range or there is no active xBestIndex
// call, return NULL.
-func Xsqlite3_vtab_collation(tls *crt.TLS, pIdxInfo uintptr, iCons int32) uintptr { /* sqlite3.c:148297:23: */
+func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) uintptr { /* sqlite3.c:148926:23: */
var pHidden uintptr = (pIdxInfo + uintptr(1)*96)
var zRet uintptr = uintptr(0)
if (iCons >= 0) && (iCons < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) {
@@ -123888,7 +128807,7 @@ func Xsqlite3_vtab_collation(tls *crt.TLS, pIdxInfo uintptr, iCons int32) uintpt
// Conversely, all tables in mUnusable must be scanned after the current
// virtual table, so any terms for which the prerequisites overlap with
// mUnusable should always be configured as "not-usable" for xBestIndex.
-func whereLoopAddVirtual(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:148337:12: */
+func whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:148966:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -123934,14 +128853,14 @@ func whereLoopAddVirtual(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusa
// First call xBestIndex() with all constraints usable.
- rc = whereLoopAddVirtualOne(tls, pBuilder, mPrereq, crt.Uint64(crt.Uint64FromInt32(-1)), uint16(0), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */)
+ rc = whereLoopAddVirtualOne(tls, pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), uint16(0), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */)
// If the call to xBestIndex() with all terms enabled produced a plan
// that does not require any source tables (IOW: a plan with mBest==0)
// and does not use an IN(...) operator, then there is no point in making
// any further calls to xBestIndex() since they will all return the same
// result (if the xBestIndex() implementation is sane).
- if (rc == 0) && (((crt.AssignUint64(&mBest, ((*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq))) != uint64(0)) || (*(*int32)(unsafe.Pointer(bp + 4 /* bIn */)) != 0)) {
+ if (rc == 0) && (((libc.AssignUint64(&mBest, ((*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq))) != uint64(0)) || (*(*int32)(unsafe.Pointer(bp + 4 /* bIn */)) != 0)) {
var seenZero int32 = 0 // True if a plan with no prereqs seen
var seenZeroNoIN int32 = 0 // Plan with no prereqs and no IN(...) seen
var mPrev Bitmask = uint64(0)
@@ -123952,7 +128871,7 @@ func whereLoopAddVirtual(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusa
if *(*int32)(unsafe.Pointer(bp + 4 /* bIn */)) != 0 {
rc = whereLoopAddVirtualOne(tls,
- pBuilder, mPrereq, crt.Uint64(crt.Uint64FromInt32(-1)), uint16(0x0001), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */)
+ pBuilder, mPrereq, libc.Uint64(libc.Uint64FromInt32(-1)), uint16(0x0001), p, *(*U16)(unsafe.Pointer(bp /* mNoOmit */)), bp+4 /* &bIn */)
mBestNoIn = ((*WhereLoop)(unsafe.Pointer(pNew)).Fprereq & ^mPrereq)
if mBestNoIn == uint64(0) {
@@ -123965,7 +128884,7 @@ func whereLoopAddVirtual(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusa
// in the set of terms that apply to the current virtual table.
for rc == 0 {
var i int32
- var mNext Bitmask = crt.Uint64(crt.Uint64FromInt32(-1))
+ var mNext Bitmask = libc.Uint64(libc.Uint64FromInt32(-1))
for i = 0; i < nConstraint; i++ {
var mThis Bitmask = ((*WhereTerm)(unsafe.Pointer((*WhereClause)(unsafe.Pointer(pWC)).Fa+uintptr((*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(p)).FaConstraint+uintptr(i)*12)).FiTermOffset)*64)).FprereqRight & ^mPrereq)
@@ -123974,7 +128893,7 @@ func whereLoopAddVirtual(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusa
}
}
mPrev = mNext
- if mNext == (crt.Uint64(crt.Uint64FromInt32(-1))) {
+ if mNext == (libc.Uint64(libc.Uint64FromInt32(-1))) {
break
}
if (mNext == mBest) || (mNext == mBestNoIn) {
@@ -124023,9 +128942,9 @@ func whereLoopAddVirtual(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusa
// Add WhereLoop entries to handle OR terms. This works for either
// btrees or virtual tables.
-func whereLoopAddOr(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:148460:12: */
- bp := tls.Alloc(768)
- defer tls.Free(768)
+func whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable Bitmask) int32 { /* sqlite3.c:149089:12: */
+ bp := tls.Alloc(784)
+ defer tls.Free(784)
var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
var pWC uintptr
@@ -124036,7 +128955,7 @@ func whereLoopAddOr(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable B
var iCur int32
// var tempWC WhereClause at bp+112, 552
- // var sSubBuild WhereLoopBuilder at bp+664, 48
+ // var sSubBuild WhereLoopBuilder at bp+664, 64
// var sSum WhereOrSet at bp, 56
@@ -124047,7 +128966,7 @@ func whereLoopAddOr(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable B
pWC = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC
pWCEnd = ((*WhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer(pWC)).FnTerm)*64)
pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
- crt.Xmemset(tls, bp /* &sSum */, 0, uint64(unsafe.Sizeof(WhereOrSet{})))
+ libc.Xmemset(tls, bp /* &sSum */, 0, uint64(unsafe.Sizeof(WhereOrSet{})))
pItem = (((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pNew)).FiTab)*112)
iCur = (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor
@@ -124095,15 +129014,15 @@ func whereLoopAddOr(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable B
whereOrMove(tls, bp /* &sSum */, bp+56 /* &sCur */)
once = 0
} else {
- // var sPrev WhereOrSet at bp+712, 56
+ // var sPrev WhereOrSet at bp+728, 56
- whereOrMove(tls, bp+712 /* &sPrev */, bp /* &sSum */)
+ whereOrMove(tls, bp+728 /* &sPrev */, bp /* &sSum */)
(*WhereOrSet)(unsafe.Pointer(bp /* &sSum */)).Fn = U16(0)
- for i = 0; i < int32((*WhereOrSet)(unsafe.Pointer(bp+712 /* &sPrev */)).Fn); i++ {
+ for i = 0; i < int32((*WhereOrSet)(unsafe.Pointer(bp+728 /* &sPrev */)).Fn); i++ {
for j = 0; j < int32((*WhereOrSet)(unsafe.Pointer(bp+56 /* &sCur */)).Fn); j++ {
- whereOrInsert(tls, bp /* &sSum */, ((*WhereOrCost)(unsafe.Pointer((bp+712 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).Fprereq | (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).Fprereq),
- Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+712 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FrRun, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FrRun),
- Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+712 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FnOut, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FnOut))
+ whereOrInsert(tls, bp /* &sSum */, ((*WhereOrCost)(unsafe.Pointer((bp+728 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).Fprereq | (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).Fprereq),
+ Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+728 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FrRun, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FrRun),
+ Xsqlite3LogEstAdd(tls, (*WhereOrCost)(unsafe.Pointer((bp+728 /* &sPrev */ +8 /* &.a */)+uintptr(i)*16)).FnOut, (*WhereOrCost)(unsafe.Pointer((bp+56 /* &sCur */ +8 /* &.a */)+uintptr(j)*16)).FnOut))
}
}
}
@@ -124113,7 +129032,7 @@ func whereLoopAddOr(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable B
(*WhereLoop)(unsafe.Pointer(pNew)).FwsFlags = U32(0x00002000)
(*WhereLoop)(unsafe.Pointer(pNew)).FrSetup = int16(0)
(*WhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = U8(0)
- crt.Xmemset(tls, (pNew + 24 /* &.u */), 0, uint64(unsafe.Sizeof(struct {
+ libc.Xmemset(tls, (pNew + 24 /* &.u */), 0, uint64(unsafe.Sizeof(struct {
Fbtree struct {
FnEq U16
FnBtm U16
@@ -124146,7 +129065,7 @@ func whereLoopAddOr(tls *crt.TLS, pBuilder uintptr, mPrereq Bitmask, mUnusable B
}
// Add all WhereLoop objects for all tables
-func whereLoopAddAll(tls *crt.TLS, pBuilder uintptr) int32 { /* sqlite3.c:148584:12: */
+func whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:149213:12: */
var pWInfo uintptr = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo
var mPrereq Bitmask = uint64(0)
var mPrior Bitmask = uint64(0)
@@ -124157,7 +129076,6 @@ func whereLoopAddAll(tls *crt.TLS, pBuilder uintptr) int32 { /* sqlite3.c:148584
var db uintptr = (*Parse)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb
var rc int32 = 0
var pNew uintptr
- var priorJointype U8 = U8(0)
// Loop over the tables in the join, from left to right
pNew = (*WhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew
@@ -124172,14 +129090,15 @@ __1:
{
var mUnusable Bitmask = uint64(0)
(*WhereLoop)(unsafe.Pointer(pNew)).FiTab = U8(iTab)
- *(*uint32)(unsafe.Pointer(pBuilder + 44 /* &.iPlanLimit */)) += (uint32(1000))
+ *(*uint32)(unsafe.Pointer(pBuilder + 56 /* &.iPlanLimit */)) += (uint32(1000))
(*WhereLoop)(unsafe.Pointer(pNew)).FmaskSelf = Xsqlite3WhereGetMask(tls, (pWInfo + 656 /* &.sMaskSet */), (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor)
- if ((int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) | int32(priorJointype)) & (0x0008 | 0x0002)) != 0 {
+ if (int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & (0x0008 | 0x0002)) != 0 {
// This condition is true when pItem is the FROM clause term on the
// right-hand-side of a LEFT or CROSS JOIN.
mPrereq = mPrior
+ } else {
+ mPrereq = uint64(0)
}
- priorJointype = (*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype
if (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pItem)).FpTab)).FnModuleArg != 0 {
var p uintptr
for p = (pItem + uintptr(1)*112); p < pEnd; p += 112 {
@@ -124198,7 +129117,7 @@ __1:
if (rc != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
if rc == 101 {
// We hit the query planner search limit set by iPlanLimit
- Xsqlite3_log(tls, 28, ts+19675 /* "abbreviated quer..." */, 0)
+ Xsqlite3_log(tls, 28, ts+23615 /* "abbreviated quer..." */, 0)
rc = 0
} else {
goto __3
@@ -124233,7 +129152,7 @@ __3:
// as equivalent rows are grouped together. Thus for GROUP BY and DISTINCT
// the pOrderBy terms can be matched in any order. With ORDER BY, the
// pOrderBy terms must be matched in strict left-to-right order.
-func wherePathSatisfiesOrderBy(tls *crt.TLS, pWInfo uintptr, pOrderBy uintptr, pPath uintptr, wctrlFlags U16, nLoop U16, pLast uintptr, pRevMask uintptr) I8 { /* sqlite3.c:148662:11: */
+func wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, pPath uintptr, wctrlFlags U16, nLoop U16, pLast uintptr, pRevMask uintptr) I8 { /* sqlite3.c:149291:11: */
var revSet U8 // True if rev is known
var rev U8 // Composite sort order
var revIdx U8 // Index sort order
@@ -124294,7 +129213,7 @@ func wherePathSatisfiesOrderBy(tls *crt.TLS, pWInfo uintptr, pOrderBy uintptr, p
orderDistinctMask = uint64(0)
ready = uint64(0)
eqOpMask = (U16((0x0002 | 0x0080) | 0x0100))
- if (int32(wctrlFlags) & 0x0800) != 0 {
+ if (int32(wctrlFlags) & ((0x0800 | 0x0002) | 0x0001)) != 0 {
eqOpMask = U16(int32(eqOpMask) | (0x0001))
}
for iLoop = 0; ((isOrderDistinct != 0) && (obSat < obDone)) && (iLoop <= int32(nLoop)); iLoop++ {
@@ -124379,7 +129298,7 @@ func wherePathSatisfiesOrderBy(tls *crt.TLS, pWInfo uintptr, pOrderBy uintptr, p
pIndex = uintptr(0)
nKeyCol = U16(0)
nColumn = U16(1)
- } else if ((crt.AssignUintptr(&pIndex, (*struct {
+ } else if ((libc.AssignUintptr(&pIndex, (*struct {
FnEq U16
FnBtm U16
FnTop U16
@@ -124391,13 +129310,13 @@ func wherePathSatisfiesOrderBy(tls *crt.TLS, pWInfo uintptr, pOrderBy uintptr, p
nKeyCol = (*Index)(unsafe.Pointer(pIndex)).FnKeyCol
nColumn = (*Index)(unsafe.Pointer(pIndex)).FnColumn
- isOrderDistinct = (U8(crt.Bool32((int32((*Index)(unsafe.Pointer((pIndex))).FonError) != 0) &&
+ isOrderDistinct = (U8(libc.Bool32((int32((*Index)(unsafe.Pointer((pIndex))).FonError) != 0) &&
(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00008000)) == U32(0)))))
}
// Loop through all columns of the index and deal with the ones
// that are not constrained by == or IN.
- rev = crt.AssignUint8(&revSet, U8(0))
+ rev = libc.AssignUint8(&revSet, U8(0))
distinctColumns = U8(0)
for j = 0; j < int32(nColumn); j++ {
var bOnce U8 = U8(1) // True to run the ORDER BY search loop
@@ -124629,7 +129548,7 @@ func wherePathSatisfiesOrderBy(tls *crt.TLS, pWInfo uintptr, pOrderBy uintptr, p
//
// SELECT * FROM t1 GROUP BY x,y ORDER BY x,y; -- IsSorted()==1
// SELECT * FROM t1 GROUP BY y,x ORDER BY y,x; -- IsSorted()==0
-func Xsqlite3WhereIsSorted(tls *crt.TLS, pWInfo uintptr) int32 { /* sqlite3.c:148994:20: */
+func Xsqlite3WhereIsSorted(tls *libc.TLS, pWInfo uintptr) int32 { /* sqlite3.c:149626:20: */
return int32(*(*uint8)(unsafe.Pointer(pWInfo + 68 /* &.sorted */)) & 0x8 >> 3)
}
@@ -124637,7 +129556,7 @@ func Xsqlite3WhereIsSorted(tls *crt.TLS, pWInfo uintptr) int32 { /* sqlite3.c:14
// Return the cost of sorting nRow rows, assuming that the keys have
// nOrderby columns and that the first nSorted columns are already in
// order.
-func whereSortingCost(tls *crt.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32, nSorted int32) LogEst { /* sqlite3.c:149017:15: */
+func whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32, nSorted int32) LogEst { /* sqlite3.c:149649:15: */
// TUNING: Estimated cost of a full external sort, where N is
// the number of rows to sort is:
//
@@ -124676,7 +129595,7 @@ func whereSortingCost(tls *crt.TLS, pWInfo uintptr, nRow LogEst, nOrderBy int32,
//
// Return SQLITE_OK on success or SQLITE_NOMEM of a memory allocation
// error occurs.
-func wherePathSolver(tls *crt.TLS, pWInfo uintptr, nRowEst LogEst) int32 { /* sqlite3.c:149062:12: */
+func wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst LogEst) int32 { /* sqlite3.c:149694:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -124740,7 +129659,7 @@ func wherePathSolver(tls *crt.TLS, pWInfo uintptr, nRowEst LogEst) int32 { /* sq
}
aTo = pSpace
aFrom = (aTo + uintptr(mxChoice)*32)
- crt.Xmemset(tls, aFrom, 0, uint64(unsafe.Sizeof(WherePath{})))
+ libc.Xmemset(tls, aFrom, 0, uint64(unsafe.Sizeof(WherePath{})))
pX = (aFrom + uintptr(mxChoice)*32)
ii = (mxChoice * 2)
pFrom = aTo
@@ -124768,7 +129687,7 @@ __3:
// the ORDER BY clause are already in order, where X is the array
// index.
aSortCost = pX
- crt.Xmemset(tls, aSortCost, 0, (uint64(unsafe.Sizeof(LogEst(0))) * uint64(nOrderBy)))
+ libc.Xmemset(tls, aSortCost, 0, (uint64(unsafe.Sizeof(LogEst(0))) * uint64(nOrderBy)))
}
// Seed the search with a single WherePath containing zero WhereLoops.
@@ -124907,7 +129826,7 @@ __3:
// needs to be added to the set of best-so-far paths.
if nTo < mxChoice {
// Increase the size of the aTo set by one
- jj = crt.PostIncInt32(&nTo, 1)
+ jj = libc.PostIncInt32(&nTo, 1)
} else {
// New path replaces the prior worst to keep count below mxChoice
jj = mxI
@@ -124937,7 +129856,7 @@ __3:
(*WherePath)(unsafe.Pointer(pTo)).FrCost = rCost
(*WherePath)(unsafe.Pointer(pTo)).FrUnsorted = rUnsorted
(*WherePath)(unsafe.Pointer(pTo)).FisOrdered = isOrdered
- crt.Xmemcpy(tls, (*WherePath)(unsafe.Pointer(pTo)).FaLoop, (*WherePath)(unsafe.Pointer(pFrom)).FaLoop, (uint64(unsafe.Sizeof(uintptr(0))) * uint64(iLoop)))
+ libc.Xmemcpy(tls, (*WherePath)(unsafe.Pointer(pTo)).FaLoop, (*WherePath)(unsafe.Pointer(pFrom)).FaLoop, (uint64(unsafe.Sizeof(uintptr(0))) * uint64(iLoop)))
*(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pTo)).FaLoop + uintptr(iLoop)*8)) = pWLoop
if nTo >= mxChoice {
mxI = 0
@@ -124984,7 +129903,7 @@ __3:
}
if nFrom == 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+19710 /* "no query solutio..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+23650 /* "no query solutio..." */, 0)
Xsqlite3DbFreeNN(tls, db, pSpace)
return 1
}
@@ -125000,7 +129919,7 @@ __3:
// Load the lowest cost path into pWInfo
for iLoop = 0; iLoop < nLoop; iLoop++ {
var pLevel uintptr = ((pWInfo + 920 /* &.a */) + uintptr(iLoop)*88)
- (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop = crt.AssignUintptr(&pWLoop, *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(iLoop)*8)))
+ (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop = libc.AssignUintptr(&pWLoop, *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(iLoop)*8)))
(*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom = (*WhereLoop)(unsafe.Pointer(pWLoop)).FiTab
(*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur = (*SrcList_item)(unsafe.Pointer(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112)).FiCursor
}
@@ -125016,7 +129935,7 @@ __3:
(*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(2)
}
}
- crt.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(0), 2, 0x4)
if (*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 {
if (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & 0x0080) != 0 {
if int32((*WherePath)(unsafe.Pointer(pFrom)).FisOrdered) == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr {
@@ -125036,11 +129955,15 @@ __3:
uint16(0x0800), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+16 /* &m */))
if rc == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr {
- crt.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(1), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(1), 2, 0x4)
(*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = *(*Bitmask)(unsafe.Pointer(bp + 16 /* m */))
}
}
}
+ } else if ((nLoop != 0) &&
+ (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat) == 1)) &&
+ ((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & (0x0001 | 0x0002)) != 0) {
+ libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.bOrderedInnerLoop */, uint32(1), 2, 0x4)
}
}
if (((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & 0x0200) != 0) &&
@@ -125050,7 +129973,7 @@ __3:
pFrom, uint16(0), (uint16(nLoop - 1)), *(*uintptr)(unsafe.Pointer((*WherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr((nLoop-1))*8)), bp+24 /* &revMask */))
if nOrder == (*ExprList)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy)).FnExpr {
- crt.SetBitFieldPtr8Uint32(pWInfo+68 /* &.sorted */, uint32(1), 3, 0x8)
+ libc.SetBitFieldPtr8Uint32(pWInfo+68 /* &.sorted */, uint32(1), 3, 0x8)
(*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = *(*Bitmask)(unsafe.Pointer(bp + 24 /* revMask */))
}
}
@@ -125072,7 +129995,7 @@ __3:
// Return non-zero on success, if this query can be handled by this
// no-frills query planner. Return zero if this query needs the
// general-purpose query planner.
-func whereShortCut(tls *crt.TLS, pBuilder uintptr) int32 { /* sqlite3.c:149449:12: */
+func whereShortCut(tls *libc.TLS, pBuilder uintptr) int32 { /* sqlite3.c:150086:12: */
var pWInfo uintptr
var pItem uintptr
var pWC uintptr
@@ -125184,8 +130107,8 @@ func whereShortCut(tls *crt.TLS, pBuilder uintptr) int32 { /* sqlite3.c:149449:1
}
// Helper function for exprIsDeterministic().
-func exprNodeIsDeterministic(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:149531:12: */
- if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 169) && ((crt.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x080000))) != U32(0))) == 0) {
+func exprNodeIsDeterministic(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:150168:12: */
+ if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 169) && ((libc.Bool32(((*Expr)(unsafe.Pointer((pExpr))).Fflags & (U32(0x080000))) != U32(0))) == 0) {
(*Walker)(unsafe.Pointer(pWalker)).FeCode = U16(0)
return 2
}
@@ -125195,19 +130118,19 @@ func exprNodeIsDeterministic(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32
// Return true if the expression contains no non-deterministic SQL
// functions. Do not consider non-deterministic SQL functions that are
// part of sub-select statements.
-func exprIsDeterministic(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:149544:12: */
+func exprIsDeterministic(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:150181:12: */
bp := tls.Alloc(48)
defer tls.Free(48)
// var w Walker at bp, 48
- crt.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp /* &w */)).FeCode = U16(1)
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{exprNodeIsDeterministic}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{Xsqlite3SelectWalkFail}))
Xsqlite3WalkExpr(tls, bp /* &w */, p)
return int32((*Walker)(unsafe.Pointer(bp /* &w */)).FeCode)
@@ -125299,16 +130222,16 @@ func exprIsDeterministic(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:149544:12
// the first cursor in an array of cursors for all indices. iIdxCur should
// be used to compute the appropriate cursor depending on which index is
// used.
-func Xsqlite3WhereBegin(tls *crt.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pResultSet uintptr, wctrlFlags U16, iAuxArg int32) uintptr { /* sqlite3.c:149664:26: */
- bp := tls.Alloc(56)
- defer tls.Free(56)
+func Xsqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pResultSet uintptr, wctrlFlags U16, iAuxArg int32) uintptr { /* sqlite3.c:150301:26: */
+ bp := tls.Alloc(80)
+ defer tls.Free(80)
var nByteWInfo int32 // Num. bytes allocated for WhereInfo struct
var nTabList int32 // Number of elements in pTabList
var pWInfo uintptr // Will become the return value of this function
var v uintptr // The virtual database engine
var notReady Bitmask // Cursors that are not yet positioned
- // var sWLB WhereLoopBuilder at bp+8, 48
+ // var sWLB WhereLoopBuilder at bp+16, 64
// The WhereLoop builder
var pMaskSet uintptr // The expression mask set
var pLevel uintptr // A single level in pWInfo->a[]
@@ -125318,6 +130241,7 @@ func Xsqlite3WhereBegin(tls *crt.TLS, pParse uintptr, pTabList uintptr, pWhere u
var rc int32 // Return code
var bFordelete U8
var pT uintptr
+ var p uintptr
var nByte int32
var pTerm uintptr
var pEnd uintptr
@@ -125351,7 +130275,7 @@ func Xsqlite3WhereBegin(tls *crt.TLS, pParse uintptr, pTabList uintptr, pWhere u
// Variable initialization
db = (*Parse)(unsafe.Pointer(pParse)).Fdb
- crt.Xmemset(tls, bp+8 /* &sWLB */, 0, uint64(unsafe.Sizeof(WhereLoopBuilder{})))
+ libc.Xmemset(tls, bp+16 /* &sWLB */, 0, uint64(unsafe.Sizeof(WhereLoopBuilder{})))
// An ORDER/GROUP BY clause of more than 63 terms cannot be optimized
@@ -125361,14 +130285,14 @@ func Xsqlite3WhereBegin(tls *crt.TLS, pParse uintptr, pTabList uintptr, pWhere u
pOrderBy = uintptr(0)
__1:
;
- (*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpOrderBy = pOrderBy
+ (*WhereLoopBuilder)(unsafe.Pointer(bp + 16 /* &sWLB */)).FpOrderBy = pOrderBy
// Disable the DISTINCT optimization if SQLITE_DistinctOpt is set via
// sqlite3_test_ctrl(SQLITE_TESTCTRL_OPTIMIZATIONS,...)
if !((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x0010)) != 0) {
goto __2
}
- wctrlFlags = crt.Uint16FromInt32(int32(wctrlFlags) & (^int32(crt.Int32FromInt32(0x0100))))
+ wctrlFlags = libc.Uint16FromInt32(int32(wctrlFlags) & (^int32(libc.Int32FromInt32(0x0100))))
__2:
;
@@ -125378,7 +130302,7 @@ __2:
if !((*SrcList)(unsafe.Pointer(pTabList)).FnSrc > (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8)))) {
goto __3
}
- Xsqlite3ErrorMsg(tls, pParse, ts+19728 /* "at most %d table..." */, crt.VaList(bp, (int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)))))
+ Xsqlite3ErrorMsg(tls, pParse, ts+23668 /* "at most %d table..." */, libc.VaList(bp, (int32(uint64(unsafe.Sizeof(Bitmask(0)))*uint64(8)))))
return uintptr(0)
__3:
;
@@ -125399,7 +130323,7 @@ __3:
// and the WhereMaskSet structure. Since WhereClause contains an 8-byte
// field (type Bitmask) it must be aligned on an 8-byte boundary on
// some architectures. Hence the ROUND8() below.
- nByteWInfo = (int32(((uint64(unsafe.Sizeof(WhereInfo{})) + ((uint64(nTabList - 1)) * uint64(unsafe.Sizeof(WhereLevel{})))) + uint64(7)) & ^uint64(crt.Int32FromInt32(7))))
+ nByteWInfo = (int32(((uint64(unsafe.Sizeof(WhereInfo{})) + ((uint64(nTabList - 1)) * uint64(unsafe.Sizeof(WhereLevel{})))) + uint64(7)) & ^uint64(libc.Int32FromInt32(7))))
pWInfo = Xsqlite3DbMallocRawNN(tls, db, (uint64(uint64(nByteWInfo) + uint64(unsafe.Sizeof(WhereLoop{})))))
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __4
@@ -125414,22 +130338,22 @@ __4:
(*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy = pOrderBy
(*WhereInfo)(unsafe.Pointer(pWInfo)).FpWhere = pWhere
(*WhereInfo)(unsafe.Pointer(pWInfo)).FpResultSet = pResultSet
- *(*int32)(unsafe.Pointer((pWInfo + 40 /* &.aiCurOnePass */) + uintptr(0)*4)) = crt.AssignPtrInt32((pWInfo+40 /* &.aiCurOnePass */)+uintptr(1)*4, -1)
+ *(*int32)(unsafe.Pointer((pWInfo + 40 /* &.aiCurOnePass */) + uintptr(0)*4)) = libc.AssignPtrInt32((pWInfo+40 /* &.aiCurOnePass */)+uintptr(1)*4, -1)
(*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel = U8(nTabList)
- (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak = crt.AssignPtrInt32(pWInfo+48 /* &.iContinue */, Xsqlite3VdbeMakeLabel(tls, pParse))
+ (*WhereInfo)(unsafe.Pointer(pWInfo)).FiBreak = libc.AssignPtrInt32(pWInfo+48 /* &.iContinue */, Xsqlite3VdbeMakeLabel(tls, pParse))
(*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags = wctrlFlags
(*WhereInfo)(unsafe.Pointer(pWInfo)).FiLimit = LogEst(iAuxArg)
(*WhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop = int32((*Parse)(unsafe.Pointer(pParse)).FnQueryLoop)
- crt.Xmemset(tls, (pWInfo + 65 /* &.nOBSat */), 0,
+ libc.Xmemset(tls, (pWInfo + 65 /* &.nOBSat */), 0,
((uint64((uintptr(0) + 104 /* &.sWC */))) - (uint64((uintptr(0) + 65 /* &.nOBSat */)))))
- crt.Xmemset(tls, ((pWInfo + 920 /* &.a */) + uintptr(0)*88), 0, (uint64(unsafe.Sizeof(WhereLoop{})) + (uint64(nTabList) * uint64(unsafe.Sizeof(WhereLevel{})))))
+ libc.Xmemset(tls, ((pWInfo + 920 /* &.a */) + uintptr(0)*88), 0, (uint64(unsafe.Sizeof(WhereLoop{})) + (uint64(nTabList) * uint64(unsafe.Sizeof(WhereLevel{})))))
// ONEPASS defaults to OFF
pMaskSet = (pWInfo + 656 /* &.sMaskSet */)
- (*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpWInfo = pWInfo
- (*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpWC = (pWInfo + 104 /* &.sWC */)
- (*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpNew = ((pWInfo) + uintptr(nByteWInfo))
+ (*WhereLoopBuilder)(unsafe.Pointer(bp + 16 /* &sWLB */)).FpWInfo = pWInfo
+ (*WhereLoopBuilder)(unsafe.Pointer(bp + 16 /* &sWLB */)).FpWC = (pWInfo + 104 /* &.sWC */)
+ (*WhereLoopBuilder)(unsafe.Pointer(bp + 16 /* &sWLB */)).FpNew = ((pWInfo) + uintptr(nByteWInfo))
- whereLoopInit(tls, (*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpNew)
+ whereLoopInit(tls, (*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpNew)
// Split the WHERE clause into separate subexpressions where each
// subexpression is separated by an AND operator.
@@ -125453,7 +130377,7 @@ __7:
(*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = U8(1)
__8:
;
- Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+19756 /* "SCAN CONSTANT RO..." */, 0)
+ Xsqlite3VdbeExplain(tls, pParse, uint8(0), ts+23696 /* "SCAN CONSTANT RO..." */, 0)
goto __6
__5:
// Assign a bit from the bitmask to every term in the FROM clause.
@@ -125475,7 +130399,7 @@ __9:
Xsqlite3WhereTabFuncArgs(tls, pParse, ((pTabList + 8 /* &.a */) + uintptr(ii)*112), (pWInfo + 104 /* &.sWC */))
goto __10
__10:
- if (crt.PreIncInt32(&ii, 1)) < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc {
+ if (libc.PreIncInt32(&ii, 1)) < (*SrcList)(unsafe.Pointer(pTabList)).FnSrc {
goto __9
}
goto __11
@@ -125505,10 +130429,10 @@ __12:
// FROM ... WHERE (SELECT random())>0; -- eval random() once overall
ii = 0
__13:
- if !(ii < (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).FnTerm) {
+ if !(ii < (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpWC)).FnTerm) {
goto __15
}
- pT = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).Fa + uintptr(ii)*64)
+ pT = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpWC)).Fa + uintptr(ii)*64)
if !((int32((*WhereTerm)(unsafe.Pointer(pT)).FwtFlags) & 0x0002) != 0) {
goto __16
}
@@ -125555,10 +130479,10 @@ __18:
// Construct the WhereLoop objects
- if !((nTabList != 1) || (whereShortCut(tls, bp+8 /* &sWLB */) == 0)) {
+ if !((nTabList != 1) || (whereShortCut(tls, bp+16 /* &sWLB */) == 0)) {
goto __22
}
- rc = whereLoopAddAll(tls, bp+8 /* &sWLB */)
+ rc = whereLoopAddAll(tls, bp+16 /* &sWLB */)
if !(rc != 0) {
goto __23
}
@@ -125566,38 +130490,67 @@ __18:
__23:
;
- wherePathSolver(tls, pWInfo, int16(0))
- if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ // If one or more WhereTerm.truthProb values were used in estimating
+ // loop parameters, but then those truthProb values were subsequently
+ // changed based on STAT4 information while computing subsequent loops,
+ // then we need to rerun the whole loop building process so that all
+ // loops will be built using the revised truthProb values.
+ if !((int32((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FbldFlags2) & 0x0004) != 0) {
goto __24
}
+
+__25:
+ if !((*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops != 0) {
+ goto __26
+ }
+ p = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops
+ (*WhereInfo)(unsafe.Pointer(pWInfo)).FpLoops = (*WhereLoop)(unsafe.Pointer(p)).FpNextLoop
+ whereLoopDelete(tls, db, p)
+ goto __25
+__26:
+ ;
+ rc = whereLoopAddAll(tls, bp+16 /* &sWLB */)
+ if !(rc != 0) {
+ goto __27
+ }
goto whereBeginError
+__27:
+ ;
__24:
;
+
+ wherePathSolver(tls, pWInfo, int16(0))
+ if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
+ goto __28
+ }
+ goto whereBeginError
+__28:
+ ;
if !((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0) {
- goto __25
+ goto __29
}
wherePathSolver(tls, pWInfo, (int16(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut) + 1)))
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __26
+ goto __30
}
goto whereBeginError
-__26:
+__30:
;
-__25:
+__29:
;
__22:
;
if !(((*WhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0)) && (((*Sqlite3)(unsafe.Pointer(db)).Fflags & uint64(0x00001000)) != uint64(0))) {
- goto __27
+ goto __31
}
- (*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = crt.Uint64(crt.Uint64FromInt32(-1))
-__27:
+ (*WhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = libc.Uint64(libc.Uint64FromInt32(-1))
+__31:
;
if !(((*Parse)(unsafe.Pointer(pParse)).FnErr != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0)) {
- goto __28
+ goto __32
}
goto whereBeginError
-__28:
+__32:
;
// Attempt to omit tables from the join that do not affect the result.
@@ -125628,113 +130581,113 @@ __28:
// SELECT DISTINCT v1, v3 FROM t1
// LEFT JOIN t2
// LEFT JOIN t3 ON (t1.ipk=t3.ipk)
- notReady = ^uint64(crt.Uint64FromUint64(uint64(0)))
+ notReady = ^uint64(libc.Uint64FromUint64(uint64(0)))
if !(((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= 2) &&
(pResultSet != uintptr(0))) && // guarantees condition (1) above
((int32((*Sqlite3)(unsafe.Pointer((db))).FdbOptFlags) & (0x0100)) == 0)) {
- goto __29
+ goto __33
}
tabUsed = Xsqlite3WhereExprListUsage(tls, pMaskSet, pResultSet)
- if !((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpOrderBy != 0) {
- goto __30
+ if !((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpOrderBy != 0) {
+ goto __34
}
- tabUsed = tabUsed | (Xsqlite3WhereExprListUsage(tls, pMaskSet, (*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpOrderBy))
-__30:
+ tabUsed = tabUsed | (Xsqlite3WhereExprListUsage(tls, pMaskSet, (*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpOrderBy))
+__34:
;
i = (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1)
-__31:
+__35:
if !(i >= 1) {
- goto __33
+ goto __37
}
pLoop = (*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */) + uintptr(i)*88)).FpWLoop
pItem = (((*WhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 /* &.a */) + uintptr((*WhereLoop)(unsafe.Pointer(pLoop)).FiTab)*112)
if !((int32((*SrcList_item)(unsafe.Pointer(pItem)).Ffg.Fjointype) & 0x0008) == 0) {
- goto __34
+ goto __38
}
- goto __32
-__34:
+ goto __36
+__38:
;
if !(((int32(wctrlFlags) & 0x0100) == 0) &&
(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00001000)) == U32(0))) {
- goto __35
+ goto __39
}
- goto __32
-__35:
+ goto __36
+__39:
;
if !((tabUsed & (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf) != uint64(0)) {
- goto __36
+ goto __40
}
- goto __32
-__36:
+ goto __36
+__40:
;
- pEnd = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+8 /* &sWLB */)).FpWC)).FnTerm)*64)
- pTerm = (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpWC)).Fa
-__37:
+ pEnd = ((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpWC)).Fa + uintptr((*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp+16 /* &sWLB */)).FpWC)).FnTerm)*64)
+ pTerm = (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp + 16 /* &sWLB */)).FpWC)).Fa
+__41:
if !(pTerm < pEnd) {
- goto __39
+ goto __43
}
if !(((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf) != uint64(0)) {
- goto __40
+ goto __44
}
if !(!(((*Expr)(unsafe.Pointer(((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr))).Fflags & (U32(0x000001))) != U32(0)) ||
(int32((*Expr)(unsafe.Pointer((*WhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FiRightJoinTable) != (*SrcList_item)(unsafe.Pointer(pItem)).FiCursor)) {
- goto __41
+ goto __45
}
- goto __39
-__41:
+ goto __43
+__45:
;
-__40:
+__44:
;
- goto __38
-__38:
+ goto __42
+__42:
pTerm += 64
- goto __37
- goto __39
-__39:
+ goto __41
+ goto __43
+__43:
;
if !(pTerm < pEnd) {
- goto __42
+ goto __46
}
- goto __32
-__42:
+ goto __36
+__46:
;
notReady = notReady & (^(*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf)
- pTerm = (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp + 8 /* &sWLB */)).FpWC)).Fa
-__43:
+ pTerm = (*WhereClause)(unsafe.Pointer((*WhereLoopBuilder)(unsafe.Pointer(bp + 16 /* &sWLB */)).FpWC)).Fa
+__47:
if !(pTerm < pEnd) {
- goto __45
+ goto __49
}
if !(((*WhereTerm)(unsafe.Pointer(pTerm)).FprereqAll & (*WhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf) != uint64(0)) {
- goto __46
+ goto __50
}
*(*U16)(unsafe.Pointer(pTerm + 18 /* &.wtFlags */)) |= U16((0x0004))
-__46:
+__50:
;
- goto __44
-__44:
+ goto __48
+__48:
pTerm += 64
- goto __43
- goto __45
-__45:
+ goto __47
+ goto __49
+__49:
;
if !(i != (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1)) {
- goto __47
+ goto __51
}
nByte = (int32((uint64((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1) - i)) * uint64(unsafe.Sizeof(WhereLevel{}))))
- crt.Xmemmove(tls, ((pWInfo + 920 /* &.a */) + uintptr(i)*88), ((pWInfo + 920 /* &.a */) + uintptr((i+1))*88), uint64(nByte))
-__47:
+ libc.Xmemmove(tls, ((pWInfo + 920 /* &.a */) + uintptr(i)*88), ((pWInfo + 920 /* &.a */) + uintptr((i+1))*88), uint64(nByte))
+__51:
;
(*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel--
nTabList--
- goto __32
-__32:
+ goto __36
+__36:
i--
- goto __31
- goto __33
-__33:
+ goto __35
+ goto __37
+__37:
;
-__29:
+__33:
;
*(*U32)(unsafe.Pointer((*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 196 /* &.nQueryLoop */)) += (U32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut))
@@ -125758,15 +130711,15 @@ __29:
// that use the OR optimization.
if !((int32(wctrlFlags) & 0x0004) != 0) {
- goto __48
+ goto __52
}
wsFlags = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */) + uintptr(0)*88)).FpWLoop)).FwsFlags)
- bOnerow = (crt.Bool32((wsFlags & 0x00001000) != 0))
+ bOnerow = (libc.Bool32((wsFlags & 0x00001000) != 0))
if !((bOnerow != 0) || (((0 != (int32(wctrlFlags) & 0x0008)) &&
!((*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer((pTabList+8 /* &.a */)+uintptr(0)*112)).FpTab)).FnModuleArg != 0)) &&
((0 == (wsFlags & 0x00002000)) || ((int32(wctrlFlags) & 0x0010) != 0)))) {
- goto __49
+ goto __53
}
(*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass = func() uint8 {
if bOnerow != 0 {
@@ -125775,29 +130728,29 @@ __29:
return uint8(2)
}()
if !((((*Table)(unsafe.Pointer(((*SrcList_item)(unsafe.Pointer((pTabList + 8 /* &.a */) + uintptr(0)*112)).FpTab))).FtabFlags & U32(0x0080)) == U32(0)) && ((wsFlags & 0x00000040) != 0)) {
- goto __50
+ goto __54
}
if !((int32(wctrlFlags) & 0x0008) != 0) {
- goto __51
+ goto __55
}
bFordelete = U8(0x08)
-__51:
+__55:
;
- (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */) + uintptr(0)*88)).FpWLoop)).FwsFlags = (U32(wsFlags & ^int32(crt.Int32FromInt32(0x00000040))))
-__50:
+ (*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer((pWInfo + 920 /* &.a */) + uintptr(0)*88)).FpWLoop)).FwsFlags = (U32(wsFlags & ^int32(libc.Int32FromInt32(0x00000040))))
+__54:
;
-__49:
+__53:
;
-__48:
+__52:
;
// Open all tables in the pTabList and any indices selected for
// searching those tables.
ii = 0
pLevel = pWInfo + 920 /* &.a */
-__52:
+__56:
if !(ii < nTabList) {
- goto __54
+ goto __58
}
pTabItem = ((pTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112)
@@ -125805,34 +130758,34 @@ __52:
iDb = Xsqlite3SchemaToIndex(tls, db, (*Table)(unsafe.Pointer(pTab)).FpSchema)
pLoop = (*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop
if !((((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(0x0002)) != U32(0)) || ((*Table)(unsafe.Pointer(pTab)).FpSelect != 0)) {
- goto __55
+ goto __59
}
- goto __56
-__55:
+ goto __60
+__59:
if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000400)) != U32(0)) {
- goto __57
+ goto __61
}
pVTab = Xsqlite3GetVTable(tls, db, pTab)
iCur = (*SrcList_item)(unsafe.Pointer(pTabItem)).FiCursor
Xsqlite3VdbeAddOp4(tls, v, 165, iCur, 0, 0, pVTab, -12)
- goto __58
-__57:
+ goto __62
+__61:
if !((*Table)(unsafe.Pointer(pTab)).FnModuleArg != 0) {
- goto __59
+ goto __63
}
- goto __60
-__59:
+ goto __64
+__63:
if !((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000040)) == U32(0)) &&
((int32(wctrlFlags) & 0x0020) == 0)) {
- goto __61
+ goto __65
}
op = 96
if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) != 0) {
- goto __63
+ goto __67
}
op = 97
*(*int32)(unsafe.Pointer((pWInfo + 40 /* &.aiCurOnePass */) + uintptr(0)*4)) = (*SrcList_item)(unsafe.Pointer(pTabItem)).FiCursor
-__63:
+__67:
;
Xsqlite3OpenTable(tls, pParse, (*SrcList_item)(unsafe.Pointer(pTabItem)).FiCursor, iDb, pTab, op)
@@ -125840,43 +130793,43 @@ __63:
if !(((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) == 0) &&
(int32((*Table)(unsafe.Pointer(pTab)).FnCol) < (int32(uint64(unsafe.Sizeof(Bitmask(0))) * uint64(8))))) &&
(((*Table)(unsafe.Pointer(pTab)).FtabFlags & (U32(0x0060 | 0x0080))) == U32(0))) {
- goto __64
+ goto __68
}
// If we know that only a prefix of the record will be used,
// it is advantageous to reduce the "column count" field in
// the P4 operand of the OP_OpenRead/Write opcode.
b = (*SrcList_item)(unsafe.Pointer(pTabItem)).FcolUsed
n = 0
-__65:
+__69:
if !(b != 0) {
- goto __67
+ goto __71
}
- goto __66
-__66:
+ goto __70
+__70:
b = (b >> 1)
n++
- goto __65
- goto __67
-__67:
+ goto __69
+ goto __71
+__71:
;
Xsqlite3VdbeChangeP4(tls, v, -1, uintptr(int64(n)), -3)
-__64:
+__68:
;
Xsqlite3VdbeChangeP5(tls, v, uint16(bFordelete))
- goto __62
-__61:
+ goto __66
+__65:
Xsqlite3TableLock(tls, pParse, iDb, (*Table)(unsafe.Pointer(pTab)).Ftnum, uint8(0), (*Table)(unsafe.Pointer(pTab)).FzName)
-__62:
+__66:
;
-__60:
+__64:
;
-__58:
+__62:
;
-__56:
+__60:
;
if !(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000200)) != 0) {
- goto __68
+ goto __72
}
pIx = (*struct {
FnEq U16
@@ -125890,112 +130843,113 @@ __56:
if !((!(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) && (int32(*(*uint16)(unsafe.Pointer((pIx) + 100 /* &.idxType */))&0x3>>0) == 2)) &&
((int32(wctrlFlags) & 0x0020) != 0)) {
- goto __69
+ goto __73
}
// This is one term of an OR-optimization using the PRIMARY KEY of a
// WITHOUT ROWID table. No need for a separate index
iIndexCur = (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur
op1 = 0
- goto __70
-__69:
+ goto __74
+__73:
if !(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) != 0) {
- goto __71
+ goto __75
}
pJ = (*Table)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(pTabItem)).FpTab)).FpIndex
iIndexCur = iAuxArg
-__73:
+__77:
if !((pJ != 0) && (pJ != pIx)) {
- goto __74
+ goto __78
}
iIndexCur++
pJ = (*Index)(unsafe.Pointer(pJ)).FpNext
- goto __73
-__74:
+ goto __77
+__78:
;
op1 = 97
*(*int32)(unsafe.Pointer((pWInfo + 40 /* &.aiCurOnePass */) + uintptr(1)*4)) = iIndexCur
- goto __72
-__71:
+ goto __76
+__75:
if !((iAuxArg != 0) && ((int32(wctrlFlags) & 0x0020) != 0)) {
- goto __75
+ goto __79
}
iIndexCur = iAuxArg
op1 = 95
- goto __76
-__75:
- iIndexCur = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
-__76:
+ goto __80
+__79:
+ iIndexCur = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+__80:
;
-__72:
+__76:
;
-__70:
+__74:
;
(*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = iIndexCur
if !(op1 != 0) {
- goto __77
+ goto __81
}
- Xsqlite3VdbeAddOp3(tls, v, op1, iIndexCur, (*Index)(unsafe.Pointer(pIx)).Ftnum, iDb)
+ Xsqlite3VdbeAddOp3(tls, v, op1, iIndexCur, int32((*Index)(unsafe.Pointer(pIx)).Ftnum), iDb)
Xsqlite3VdbeSetP4KeyInfo(tls, pParse, pIx)
if !(((((((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x0000000f)) != U32(0)) &&
(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & (U32(0x00000002 | 0x00008000))) == U32(0))) &&
(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00080000)) == U32(0))) &&
((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) & 0x0001) == 0)) &&
(int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) != 2)) {
- goto __78
+ goto __82
}
Xsqlite3VdbeChangeP5(tls, v, uint16(0x02))
-__78:
+__82:
;
-__77:
+ Xsqlite3VdbeComment(tls, v, ts+805 /* "%s" */, libc.VaList(bp+8, (*Index)(unsafe.Pointer(pIx)).FzName))
+__81:
;
-__68:
+__72:
;
if !(iDb >= 0) {
- goto __79
+ goto __83
}
Xsqlite3CodeVerifySchema(tls, pParse, iDb)
-__79:
+__83:
;
- goto __53
-__53:
+ goto __57
+__57:
ii++
pLevel += 88
- goto __52
- goto __54
-__54:
+ goto __56
+ goto __58
+__58:
;
(*WhereInfo)(unsafe.Pointer(pWInfo)).FiTop = Xsqlite3VdbeCurrentAddr(tls, v)
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __80
+ goto __84
}
goto whereBeginError
-__80:
+__84:
;
// Generate the code to do the search. Each iteration of the for
// loop below generates code for a single nested loop of the VM
// program.
ii = 0
-__81:
+__85:
if !(ii < nTabList) {
- goto __83
+ goto __87
}
pLevel = ((pWInfo + 920 /* &.a */) + uintptr(ii)*88)
wsFlags1 = int32((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags)
if !(((*WhereLoop1)(unsafe.Pointer((*WhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags & U32(0x00004000)) != U32(0)) {
- goto __84
+ goto __88
}
constructAutomaticIndex(tls, pParse, (pWInfo + 104 /* &.sWC */),
((pTabList + 8 /* &.a */) + uintptr((*WhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*112), notReady, pLevel)
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
- goto __85
+ goto __89
}
goto whereBeginError
-__85:
+__89:
;
-__84:
+__88:
;
addrExplain = Xsqlite3WhereExplainOneScan(tls,
pParse, pTabList, pLevel, wctrlFlags)
@@ -126003,17 +130957,17 @@ __84:
notReady = Xsqlite3WhereCodeOneLoopStart(tls, pParse, v, pWInfo, ii, pLevel, notReady)
(*WhereInfo)(unsafe.Pointer(pWInfo)).FiContinue = (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrCont
if !(((wsFlags1 & 0x00002000) == 0) && ((int32(wctrlFlags) & 0x0020) == 0)) {
- goto __86
+ goto __90
}
_ = addrExplain
-__86:
+__90:
;
- goto __82
-__82:
+ goto __86
+__86:
ii++
- goto __81
- goto __83
-__83:
+ goto __85
+ goto __87
+__87:
;
// Done.
@@ -126023,11 +130977,11 @@ __83:
// Jump here if malloc fails
whereBeginError:
if !(pWInfo != 0) {
- goto __87
+ goto __91
}
(*Parse)(unsafe.Pointer(pParse)).FnQueryLoop = U32((*WhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop)
whereInfoFree(tls, db, pWInfo)
-__87:
+__91:
;
return uintptr(0)
}
@@ -126039,7 +130993,10 @@ __87:
// Generate the end of the WHERE loop. See comments on
// sqlite3WhereBegin() for additional information.
-func Xsqlite3WhereEnd(tls *crt.TLS, pWInfo uintptr) { /* sqlite3.c:150258:21: */
+func Xsqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* sqlite3.c:150895:21: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
var pParse uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpParse
var v uintptr = (*Parse)(unsafe.Pointer(pParse)).FpVdbe
var i int32
@@ -126061,14 +131018,14 @@ func Xsqlite3WhereEnd(tls *crt.TLS, pWInfo uintptr) { /* sqlite3.c:150258:21: */
if (((((int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == 2) &&
(i == (int32((*WhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - 1))) && // Ticket [ef9318757b152e3] 2017-10-21
(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000200)) != U32(0))) &&
- (uint32(int32(*(*uint16)(unsafe.Pointer((crt.AssignUintptr(&pIdx, (*struct {
+ (uint32(int32(*(*uint16)(unsafe.Pointer((libc.AssignUintptr(&pIdx, (*struct {
FnEq U16
FnBtm U16
FnTop U16
FnDistinctCol U16
FpIndex uintptr
})(unsafe.Pointer(pLoop+24 /* &.u */)).FpIndex)) + 100 /* &.hasStat1 */))&0x80>>7)) != 0)) &&
- ((crt.AssignInt32(&n, int32((*struct {
+ ((libc.AssignInt32(&n, int32((*struct {
FnEq U16
FnBtm U16
FnTop U16
@@ -126141,7 +131098,7 @@ func Xsqlite3WhereEnd(tls *crt.TLS, pWInfo uintptr) { /* sqlite3.c:150258:21: */
// jump over the OP_Next or OP_Prev instruction about to
// be coded.
Xsqlite3VdbeAddOp2(tls, v, 26, (*InLoop)(unsafe.Pointer(pIn)).FiCur,
- ((Xsqlite3VdbeCurrentAddr(tls, v) + 2) + (crt.Bool32(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000400)) == U32(0)))))
+ ((Xsqlite3VdbeCurrentAddr(tls, v) + 2) + (libc.Bool32(((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000400)) == U32(0)))))
}
if ((*WhereLoop)(unsafe.Pointer(pLoop)).FwsFlags & U32(0x00000400)) == U32(0) {
Xsqlite3VdbeAddOp4Int(tls, v, 27, (*WhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur,
@@ -126165,7 +131122,13 @@ func Xsqlite3WhereEnd(tls *crt.TLS, pWInfo uintptr) { /* sqlite3.c:150258:21: */
Xsqlite3VdbeResolveLabel(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrBrk)
if (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip != 0 {
Xsqlite3VdbeGoto(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip)
-
+ Xsqlite3VdbeComment(tls, v, ts+23714 /* "next skip-scan o..." */, libc.VaList(bp, (*Index)(unsafe.Pointer((*struct {
+ FnEq U16
+ FnBtm U16
+ FnTop U16
+ FnDistinctCol U16
+ FpIndex uintptr
+ })(unsafe.Pointer(pLoop+24 /* &.u */)).FpIndex)).FzName))
Xsqlite3VdbeJumpHere(tls, v, (*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip)
Xsqlite3VdbeJumpHere(tls, v, ((*WhereLevel)(unsafe.Pointer(pLevel)).FaddrSkip - 2))
}
@@ -126255,7 +131218,8 @@ __4:
if (*VdbeOp)(unsafe.Pointer(pOp)).Fp1 != (*WhereLevel)(unsafe.Pointer(pLevel)).FiTabCur {
goto __8
}
- if int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == 89 {
+ if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == 89) ||
+ (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == 88) {
var x int32 = (*VdbeOp)(unsafe.Pointer(pOp)).Fp2
if !(((*Table)(unsafe.Pointer((pTab))).FtabFlags & U32(0x0080)) == U32(0)) {
@@ -126280,7 +131244,7 @@ __4:
goto __8
__8:
k++
- pOp += 24
+ pOp += 32
goto __7
goto __9
__9:
@@ -126299,7 +131263,7 @@ __6:
for (*WhereInfo)(unsafe.Pointer(pWInfo)).FpExprMods != 0 {
var p uintptr = (*WhereInfo)(unsafe.Pointer(pWInfo)).FpExprMods
(*WhereInfo)(unsafe.Pointer(pWInfo)).FpExprMods = (*WhereExprMod)(unsafe.Pointer(p)).FpNext
- crt.Xmemcpy(tls, (*WhereExprMod)(unsafe.Pointer(p)).FpExpr, (p + 16 /* &.orig */), uint64(unsafe.Sizeof(Expr{})))
+ libc.Xmemcpy(tls, (*WhereExprMod)(unsafe.Pointer(p)).FpExpr, (p + 16 /* &.orig */), uint64(unsafe.Sizeof(Expr{})))
Xsqlite3DbFree(tls, db, p)
}
@@ -126449,7 +131413,7 @@ __6:
// window frame has been coerced to:
//
// ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-func row_numberStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:150675:13: */
+func row_numberStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151312:13: */
var p uintptr = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(I64(0))))
if p != 0 {
(*(*I64)(unsafe.Pointer(p)))++
@@ -126457,7 +131421,7 @@ func row_numberStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
_ = nArg
_ = apArg
}
-func row_numberValueFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:150685:13: */
+func row_numberValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151322:13: */
var p uintptr = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(I64(0))))
Xsqlite3_result_int64(tls, pCtx, func() int64 {
if p != 0 {
@@ -126479,7 +131443,7 @@ type CallCount = struct {
// the window frame has been set to:
//
// RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-func dense_rankStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:150706:13: */
+func dense_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151343:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
if p != 0 {
@@ -126488,7 +131452,7 @@ func dense_rankStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
_ = nArg
_ = apArg
}
-func dense_rankValueFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:150717:13: */
+func dense_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151354:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
if p != 0 {
@@ -126508,7 +131472,7 @@ type NthValueCtx = struct {
FpValue uintptr
}
-func nth_valueStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:150738:13: */
+func nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151375:13: */
var p uintptr
var fVal float64
var iVal I64
@@ -126570,9 +131534,9 @@ __1:
error_out:
Xsqlite3_result_error(tls,
- pCtx, ts+19774 /* "second argument ..." */, -1)
+ pCtx, ts+23735 /* "second argument ..." */, -1)
}
-func nth_valueFinalizeFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:150779:13: */
+func nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151416:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, 0)
if (p != 0) && ((*NthValueCtx)(unsafe.Pointer(p)).FpValue != 0) {
@@ -126582,7 +131546,7 @@ func nth_valueFinalizeFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:150779:13:
}
}
-func first_valueStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:150791:13: */
+func first_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151428:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NthValueCtx{})))
if (p != 0) && ((*NthValueCtx)(unsafe.Pointer(p)).FpValue == uintptr(0)) {
@@ -126594,7 +131558,7 @@ func first_valueStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr)
_ = nArg
_ = apArg
}
-func first_valueFinalizeFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:150807:13: */
+func first_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151444:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NthValueCtx{})))
if (p != 0) && ((*NthValueCtx)(unsafe.Pointer(p)).FpValue != 0) {
@@ -126608,7 +131572,7 @@ func first_valueFinalizeFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:150807:1
// the window frame has been set to:
//
// RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-func rankStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:150825:13: */
+func rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151462:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
if p != 0 {
@@ -126620,7 +131584,7 @@ func rankStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sq
_ = nArg
_ = apArg
}
-func rankValueFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:150841:13: */
+func rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151478:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
if p != 0 {
@@ -126633,7 +131597,7 @@ func rankValueFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:150841:13: */
// the window frame has been set to:
//
// GROUPS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING
-func percent_rankStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:150856:13: */
+func percent_rankStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151493:13: */
var p uintptr
_ = nArg
_ = apArg
@@ -126642,14 +131606,14 @@ func percent_rankStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr)
(*CallCount)(unsafe.Pointer(p)).FnTotal++
}
}
-func percent_rankInvFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:150869:13: */
+func percent_rankInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151506:13: */
var p uintptr
_ = nArg
_ = apArg
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
(*CallCount)(unsafe.Pointer(p)).FnStep++
}
-func percent_rankValueFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:150880:13: */
+func percent_rankValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151517:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
if p != 0 {
@@ -126667,7 +131631,7 @@ func percent_rankValueFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:150880:13:
// the window frame has been set to:
//
// GROUPS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING
-func cume_distStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:150901:13: */
+func cume_distStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151538:13: */
var p uintptr
_ = nArg
_ = apArg
@@ -126676,14 +131640,14 @@ func cume_distStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
(*CallCount)(unsafe.Pointer(p)).FnTotal++
}
}
-func cume_distInvFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:150914:13: */
+func cume_distInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151551:13: */
var p uintptr
_ = nArg
_ = apArg
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(CallCount{})))
(*CallCount)(unsafe.Pointer(p)).FnStep++
}
-func cume_distValueFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:150925:13: */
+func cume_distValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151562:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, 0)
if p != 0 {
@@ -126703,7 +131667,7 @@ type NtileCtx = struct {
// been coerced to:
//
// ROWS CURRENT ROW AND UNBOUNDED FOLLOWING
-func ntileStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:150950:13: */
+func ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151587:13: */
var p uintptr
_ = nArg
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NtileCtx{})))
@@ -126712,20 +131676,20 @@ func ntileStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* s
(*NtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(0)*8)))
if (*NtileCtx)(unsafe.Pointer(p)).FnParam <= int64(0) {
Xsqlite3_result_error(tls,
- pCtx, ts+19830 /* "argument of ntil..." */, -1)
+ pCtx, ts+23791 /* "argument of ntil..." */, -1)
}
}
(*NtileCtx)(unsafe.Pointer(p)).FnTotal++
}
}
-func ntileInvFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:150970:13: */
+func ntileInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151607:13: */
var p uintptr
_ = nArg
_ = apArg
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NtileCtx{})))
(*NtileCtx)(unsafe.Pointer(p)).FiRow++
}
-func ntileValueFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:150981:13: */
+func ntileValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151618:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(NtileCtx{})))
if (p != 0) && ((*NtileCtx)(unsafe.Pointer(p)).FnParam > int64(0)) {
@@ -126754,7 +131718,7 @@ type LastValueCtx = struct {
}
// Implementation of last_value().
-func last_valueStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151016:13: */
+func last_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151653:13: */
var p uintptr
_ = nArg
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(LastValueCtx{})))
@@ -126768,7 +131732,7 @@ func last_valueStepFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
}
}
}
-func last_valueInvFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151034:13: */
+func last_valueInvFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:151671:13: */
var p uintptr
_ = nArg
_ = apArg
@@ -126781,14 +131745,14 @@ func last_valueInvFunc(tls *crt.TLS, pCtx uintptr, nArg int32, apArg uintptr) {
}
}
}
-func last_valueValueFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:151051:13: */
+func last_valueValueFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151688:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, 0)
if (p != 0) && ((*LastValueCtx)(unsafe.Pointer(p)).FpVal != 0) {
Xsqlite3_result_value(tls, pCtx, (*LastValueCtx)(unsafe.Pointer(p)).FpVal)
}
}
-func last_valueFinalizeFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:151058:13: */
+func last_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:151695:13: */
var p uintptr
p = Xsqlite3_aggregate_context(tls, pCtx, int32(unsafe.Sizeof(LastValueCtx{})))
if (p != 0) && ((*LastValueCtx)(unsafe.Pointer(p)).FpVal != 0) {
@@ -126804,17 +131768,17 @@ func last_valueFinalizeFunc(tls *crt.TLS, pCtx uintptr) { /* sqlite3.c:151058:13
// comparison of the zName pointer. Example:
//
// if( pFuncDef->zName==row_valueName ){ ... }
-var row_numberName = *(*[11]int8)(unsafe.Pointer(ts + 19875 /* "row_number" */)) /* sqlite3.c:151076:19 */
-var dense_rankName = *(*[11]int8)(unsafe.Pointer(ts + 19886 /* "dense_rank" */)) /* sqlite3.c:151077:19 */
-var rankName = *(*[5]int8)(unsafe.Pointer(ts + 19897 /* "rank" */)) /* sqlite3.c:151078:19 */
-var percent_rankName = *(*[13]int8)(unsafe.Pointer(ts + 19902 /* "percent_rank" */)) /* sqlite3.c:151079:19 */
-var cume_distName = *(*[10]int8)(unsafe.Pointer(ts + 19915 /* "cume_dist" */)) /* sqlite3.c:151080:19 */
-var ntileName = *(*[6]int8)(unsafe.Pointer(ts + 19925 /* "ntile" */)) /* sqlite3.c:151081:19 */
-var last_valueName = *(*[11]int8)(unsafe.Pointer(ts + 19931 /* "last_value" */)) /* sqlite3.c:151082:19 */
-var nth_valueName = *(*[10]int8)(unsafe.Pointer(ts + 19942 /* "nth_value" */)) /* sqlite3.c:151083:19 */
-var first_valueName = *(*[12]int8)(unsafe.Pointer(ts + 19952 /* "first_value" */)) /* sqlite3.c:151084:19 */
-var leadName = *(*[5]int8)(unsafe.Pointer(ts + 19964 /* "lead" */)) /* sqlite3.c:151085:19 */
-var lagName = *(*[4]int8)(unsafe.Pointer(ts + 19969 /* "lag" */)) /* sqlite3.c:151086:19 */
+var row_numberName = *(*[11]int8)(unsafe.Pointer(ts + 23836 /* "row_number" */)) /* sqlite3.c:151713:19 */
+var dense_rankName = *(*[11]int8)(unsafe.Pointer(ts + 23847 /* "dense_rank" */)) /* sqlite3.c:151714:19 */
+var rankName = *(*[5]int8)(unsafe.Pointer(ts + 23858 /* "rank" */)) /* sqlite3.c:151715:19 */
+var percent_rankName = *(*[13]int8)(unsafe.Pointer(ts + 23863 /* "percent_rank" */)) /* sqlite3.c:151716:19 */
+var cume_distName = *(*[10]int8)(unsafe.Pointer(ts + 23876 /* "cume_dist" */)) /* sqlite3.c:151717:19 */
+var ntileName = *(*[6]int8)(unsafe.Pointer(ts + 23886 /* "ntile" */)) /* sqlite3.c:151718:19 */
+var last_valueName = *(*[11]int8)(unsafe.Pointer(ts + 23892 /* "last_value" */)) /* sqlite3.c:151719:19 */
+var nth_valueName = *(*[10]int8)(unsafe.Pointer(ts + 23903 /* "nth_value" */)) /* sqlite3.c:151720:19 */
+var first_valueName = *(*[12]int8)(unsafe.Pointer(ts + 23913 /* "first_value" */)) /* sqlite3.c:151721:19 */
+var leadName = *(*[5]int8)(unsafe.Pointer(ts + 23925 /* "lead" */)) /* sqlite3.c:151722:19 */
+var lagName = *(*[4]int8)(unsafe.Pointer(ts + 23930 /* "lag" */)) /* sqlite3.c:151723:19 */
// No-op implementations of xStep() and xFinalize(). Used as place-holders
// for built-in window functions that never call those interfaces.
@@ -126823,13 +131787,13 @@ var lagName = *(*[4]int8)(unsafe.Pointer(ts + 19969 /* "lag" */))
// noopStepFunc() is never called, and so it is marked with NO_TEST to
// let the test coverage routine know not to expect this function to be
// invoked.
-func noopStepFunc(tls *crt.TLS, p uintptr, n int32, a uintptr) { /* sqlite3.c:151097:13: */ //NO_TEST
+func noopStepFunc(tls *libc.TLS, p uintptr, n int32, a uintptr) { /* sqlite3.c:151734:13: */ //NO_TEST
_ = p //NO_TEST
_ = n //NO_TEST
_ = a //NO_TEST
//NO_TEST
-} //NO_TEST
-func noopValueFunc(tls *crt.TLS, p uintptr) { /* sqlite3.c:151107:13: */ _ = p /*no-op*/ }
+} //NO_TEST
+func noopValueFunc(tls *libc.TLS, p uintptr) { /* sqlite3.c:151744:13: */ _ = p /*no-op*/ }
// Window functions that use all window interfaces: xStep, xFinal,
// xValue, and xInverse
@@ -126842,7 +131806,7 @@ func noopValueFunc(tls *crt.TLS, p uintptr) { /* sqlite3.c:151107:13: */ _ = p /
// xInverse.
// Register those built-in window functions that are not also aggregates.
-func Xsqlite3WindowFunctions(tls *crt.TLS) { /* sqlite3.c:151138:21: */
+func Xsqlite3WindowFunctions(tls *libc.TLS) { /* sqlite3.c:151775:21: */
Xsqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&aWindowFuncs)), (int32(uint64(unsafe.Sizeof(aWindowFuncs)) / uint64(unsafe.Sizeof(FuncDef{})))))
}
@@ -126862,9 +131826,9 @@ var aWindowFuncs = [15]FuncDef{
{FnArg: int8(1), FfuncFlags: (U32((1 | 0x00010000) | 0)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
{FnArg: int8(2), FfuncFlags: (U32((1 | 0x00010000) | 0)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
{FnArg: int8(3), FfuncFlags: (U32((1 | 0x00010000) | 0)), FpUserData: uintptr(0), FpNext: uintptr(0), FxSFunc: 0, FxFinalize: 0, FxValue: 0, FxInverse: 0, FzName: 0, Fu: struct{ FpHash uintptr }{FpHash: uintptr(0)}},
-} /* sqlite3.c:151139:18 */
+} /* sqlite3.c:151776:18 */
-func windowFind(tls *crt.TLS, pParse uintptr, pList uintptr, zName uintptr) uintptr { /* sqlite3.c:151159:15: */
+func windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) uintptr { /* sqlite3.c:151796:15: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -126875,7 +131839,7 @@ func windowFind(tls *crt.TLS, pParse uintptr, pList uintptr, zName uintptr) uint
}
}
if p == uintptr(0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+19973 /* "no such window: ..." */, crt.VaList(bp, zName))
+ Xsqlite3ErrorMsg(tls, pParse, ts+23934 /* "no such window: ..." */, libc.VaList(bp, zName))
}
return p
}
@@ -126895,7 +131859,7 @@ func windowFind(tls *crt.TLS, pParse uintptr, pList uintptr, zName uintptr) uint
// * If the function is a built-in window function that requires the
// window to be coerced (see "BUILT-IN WINDOW FUNCTIONS" at the top
// of this file), pWin is updated here.
-func Xsqlite3WindowUpdate(tls *crt.TLS, pParse uintptr, pList uintptr, pWin uintptr, pFunc uintptr) { /* sqlite3.c:151187:21: */
+func Xsqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uintptr, pFunc uintptr) { /* sqlite3.c:151824:21: */
bp := tls.Alloc(192)
defer tls.Free(192)
@@ -126919,12 +131883,12 @@ func Xsqlite3WindowUpdate(tls *crt.TLS, pParse uintptr, pList uintptr, pWin uint
(((*Window)(unsafe.Pointer(pWin)).FpStart != 0) || ((*Window)(unsafe.Pointer(pWin)).FpEnd != 0))) &&
(((*Window)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0)) || ((*ExprList)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != 1)) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+19992 /* "RANGE with offse..." */, 0)
+ ts+23953 /* "RANGE with offse..." */, 0)
} else if ((*FuncDef)(unsafe.Pointer(pFunc)).FfuncFlags & U32(0x00010000)) != 0 {
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if (*Window)(unsafe.Pointer(pWin)).FpFilter != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+20063 /* "FILTER clause ma..." */, 0)
+ ts+24024 /* "FILTER clause ma..." */, 0)
} else {
*(*[8]WindowUpdate)(unsafe.Pointer(bp /* aUp */)) = [8]WindowUpdate{
{FzFunc: uintptr(unsafe.Pointer(&row_numberName)), FeFrmType: 76, FeStart: 90, FeEnd: 85},
@@ -126941,13 +131905,13 @@ func Xsqlite3WindowUpdate(tls *crt.TLS, pParse uintptr, pList uintptr, pWin uint
if (*FuncDef)(unsafe.Pointer(pFunc)).FzName == (*WindowUpdate)(unsafe.Pointer(bp /* &aUp */ +uintptr(i)*24)).FzFunc {
Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(pWin)).FpStart)
Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(pWin)).FpEnd)
- (*Window)(unsafe.Pointer(pWin)).FpEnd = crt.AssignPtrUintptr(pWin+40 /* &.pStart */, uintptr(0))
+ (*Window)(unsafe.Pointer(pWin)).FpEnd = libc.AssignPtrUintptr(pWin+40 /* &.pStart */, uintptr(0))
(*Window)(unsafe.Pointer(pWin)).FeFrmType = U8((*WindowUpdate)(unsafe.Pointer(bp /* &aUp */ + uintptr(i)*24)).FeFrmType)
(*Window)(unsafe.Pointer(pWin)).FeStart = U8((*WindowUpdate)(unsafe.Pointer(bp /* &aUp */ + uintptr(i)*24)).FeStart)
(*Window)(unsafe.Pointer(pWin)).FeEnd = U8((*WindowUpdate)(unsafe.Pointer(bp /* &aUp */ + uintptr(i)*24)).FeEnd)
(*Window)(unsafe.Pointer(pWin)).FeExclude = U8(0)
if int32((*Window)(unsafe.Pointer(pWin)).FeStart) == 86 {
- (*Window)(unsafe.Pointer(pWin)).FpStart = Xsqlite3Expr(tls, db, 152, ts+7523 /* "1" */)
+ (*Window)(unsafe.Pointer(pWin)).FpStart = Xsqlite3Expr(tls, db, 152, ts+9882 /* "1" */)
}
break
}
@@ -126967,12 +131931,12 @@ type WindowUpdate = struct {
// Context object passed through sqlite3WalkExprList() to
// selectWindowRewriteExprCb() by selectWindowRewriteEList().
-type WindowRewrite = WindowRewrite1 /* sqlite3.c:151262:30 */
+type WindowRewrite = WindowRewrite1 /* sqlite3.c:151899:30 */
// Callback function used by selectWindowRewriteEList(). If necessary,
// this function appends to the output expression-list and updates
// expression (*ppExpr) in place.
-func selectWindowRewriteExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:151276:12: */
+func selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:151913:12: */
var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */))
var pParse uintptr = (*Walker)(unsafe.Pointer(pWalker)).FpParse
@@ -127013,7 +131977,7 @@ func selectWindowRewriteExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int
}
}
fallthrough
- // Fall through.
+ /* no break */
case 165:
fallthrough
@@ -127037,11 +132001,12 @@ func selectWindowRewriteExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int
(*WindowRewrite1)(unsafe.Pointer(p)).FpSub = Xsqlite3ExprListAppend(tls, pParse, (*WindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup)
}
if (*WindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 {
+ var f int32 = (int32((*Expr)(unsafe.Pointer(pExpr)).Fflags & U32(0x000100)))
*(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) |= (U32(0x8000000))
Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pExpr)
- *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (^U32(crt.Int32FromInt32(0x8000000)))
- crt.Xmemset(tls, pExpr, 0, uint64(unsafe.Sizeof(Expr{})))
+ *(*U32)(unsafe.Pointer(pExpr + 4 /* &.flags */)) &= (^U32(libc.Int32FromInt32(0x8000000)))
+ libc.Xmemset(tls, pExpr, 0, uint64(unsafe.Sizeof(Expr{})))
(*Expr)(unsafe.Pointer(pExpr)).Fop = U8(164)
(*Expr)(unsafe.Pointer(pExpr)).FiColumn = func() int16 {
@@ -127052,6 +132017,7 @@ func selectWindowRewriteExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int
}()
(*Expr)(unsafe.Pointer(pExpr)).FiTable = (*Window)(unsafe.Pointer((*WindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr
*(*uintptr)(unsafe.Pointer(pExpr + 64 /* &.y */)) = (*WindowRewrite1)(unsafe.Pointer(p)).FpTab
+ (*Expr)(unsafe.Pointer(pExpr)).Fflags = U32(f)
}
if (*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 {
return 2
@@ -127065,7 +132031,7 @@ func selectWindowRewriteExprCb(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int
return 0
}
-func selectWindowRewriteSelectCb(tls *crt.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:151355:12: */
+func selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) int32 { /* sqlite3.c:151994:12: */
var p uintptr = *(*uintptr)(unsafe.Pointer(pWalker + 40 /* &.u */))
var pSave uintptr = (*WindowRewrite1)(unsafe.Pointer(p)).FpSubSelect
if pSave == pSelect {
@@ -127089,7 +132055,7 @@ func selectWindowRewriteSelectCb(tls *crt.TLS, pWalker uintptr, pSelect uintptr)
// with a TK_COLUMN that reads the (N-1)th element of table
// pWin->iEphCsr, where N is the number of elements in (*ppSub) after
// appending the new one.
-func selectWindowRewriteEList(tls *crt.TLS, pParse uintptr, pWin uintptr, pSrc uintptr, pEList uintptr, pTab uintptr, ppSub uintptr) { /* sqlite3.c:151382:13: */
+func selectWindowRewriteEList(tls *libc.TLS, pParse uintptr, pWin uintptr, pSrc uintptr, pEList uintptr, pTab uintptr, ppSub uintptr) { /* sqlite3.c:152021:13: */
bp := tls.Alloc(88)
defer tls.Free(88)
@@ -127097,8 +132063,8 @@ func selectWindowRewriteEList(tls *crt.TLS, pParse uintptr, pWin uintptr, pSrc u
// var sRewrite WindowRewrite at bp+48, 40
- crt.Xmemset(tls, bp /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
- crt.Xmemset(tls, bp+48 /* &sRewrite */, 0, uint64(unsafe.Sizeof(WindowRewrite{})))
+ libc.Xmemset(tls, bp /* &sWalker */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp+48 /* &sRewrite */, 0, uint64(unsafe.Sizeof(WindowRewrite{})))
(*WindowRewrite)(unsafe.Pointer(bp + 48 /* &sRewrite */)).FpSub = *(*uintptr)(unsafe.Pointer(ppSub))
(*WindowRewrite)(unsafe.Pointer(bp + 48 /* &sRewrite */)).FpWin = pWin
@@ -127107,10 +132073,10 @@ func selectWindowRewriteEList(tls *crt.TLS, pParse uintptr, pWin uintptr, pSrc u
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FpParse = pParse
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{selectWindowRewriteExprCb}))
(*Walker)(unsafe.Pointer(bp /* &sWalker */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{selectWindowRewriteSelectCb}))
*(*uintptr)(unsafe.Pointer(bp /* &sWalker */ + 40 /* &.u */)) = bp + 48 /* &sRewrite */
@@ -127121,7 +132087,7 @@ func selectWindowRewriteEList(tls *crt.TLS, pParse uintptr, pWin uintptr, pSrc u
// Append a copy of each expression in expression-list pAppend to
// expression list pList. Return a pointer to the result list.
-func exprListAppendList(tls *crt.TLS, pParse uintptr, pList uintptr, pAppend uintptr, bIntToNull int32) uintptr { /* sqlite3.c:151416:17: */
+func exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend uintptr, bIntToNull int32) uintptr { /* sqlite3.c:152055:17: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -127144,7 +132110,7 @@ func exprListAppendList(tls *crt.TLS, pParse uintptr, pList uintptr, pAppend uin
}
if Xsqlite3ExprIsInteger(tls, pSub, bp /* &iDummy */) != 0 {
(*Expr)(unsafe.Pointer(pSub)).Fop = U8(119)
- *(*U32)(unsafe.Pointer(pSub + 4 /* &.flags */)) &= (^U32(crt.Int32FromInt32(((0x000400 | 0x10000000) | 0x20000000))))
+ *(*U32)(unsafe.Pointer(pSub + 4 /* &.flags */)) &= (^U32(libc.Int32FromInt32(((0x000400 | 0x10000000) | 0x20000000))))
*(*uintptr)(unsafe.Pointer(pSub + 8 /* &.u */)) = uintptr(0)
}
}
@@ -127163,7 +132129,7 @@ func exprListAppendList(tls *crt.TLS, pParse uintptr, pList uintptr, pAppend uin
// due to the extra subquery layer that was added.
//
// See also the incrAggDepth() routine in resolve.c
-func sqlite3WindowExtraAggFuncDepth(tls *crt.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:151455:12: */
+func sqlite3WindowExtraAggFuncDepth(tls *libc.TLS, pWalker uintptr, pExpr uintptr) int32 { /* sqlite3.c:152094:12: */
if (int32((*Expr)(unsafe.Pointer(pExpr)).Fop) == 165) &&
(int32((*Expr)(unsafe.Pointer(pExpr)).Fop2) >= (*Walker)(unsafe.Pointer(pWalker)).FwalkerDepth) {
(*Expr)(unsafe.Pointer(pExpr)).Fop2++
@@ -127176,7 +132142,7 @@ func sqlite3WindowExtraAggFuncDepth(tls *crt.TLS, pWalker uintptr, pExpr uintptr
// rewrites the SELECT statement so that window function xStep functions
// are invoked in the correct order as described under "SELECT REWRITING"
// at the top of this file.
-func Xsqlite3WindowRewrite(tls *crt.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:151471:20: */
+func Xsqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) int32 { /* sqlite3.c:152110:20: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -127192,7 +132158,7 @@ func Xsqlite3WindowRewrite(tls *crt.TLS, pParse uintptr, p uintptr) int32 { /* s
var pSort uintptr = uintptr(0)
*(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)) = uintptr(0) // Expression list for sub-query
- var pMWin uintptr = (*Select)(unsafe.Pointer(p)).FpWin // Master window object
+ var pMWin uintptr = (*Select)(unsafe.Pointer(p)).FpWin // Main window object
var pWin uintptr // Window object iterator
var pTab uintptr
// var w Walker at bp, 48
@@ -127210,7 +132176,7 @@ func Xsqlite3WindowRewrite(tls *crt.TLS, pParse uintptr, p uintptr) int32 { /* s
(*Select)(unsafe.Pointer(p)).FpWhere = uintptr(0)
(*Select)(unsafe.Pointer(p)).FpGroupBy = uintptr(0)
(*Select)(unsafe.Pointer(p)).FpHaving = uintptr(0)
- *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (^U32(crt.Int32FromInt32(0x0000008)))
+ *(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) &= (^U32(libc.Int32FromInt32(0x0000008)))
*(*U32)(unsafe.Pointer(p + 4 /* &.selFlags */)) |= (U32(0x0100000))
// Create the ORDER BY clause for the sub-select. This is the concatenation
@@ -127231,7 +132197,7 @@ func Xsqlite3WindowRewrite(tls *crt.TLS, pParse uintptr, p uintptr) int32 { /* s
// Assign a cursor number for the ephemeral table used to buffer rows.
// The OpenEphemeral instruction is coded later, after it is known how
// many columns the table will have.
- (*Window)(unsafe.Pointer(pMWin)).FiEphCsr = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ (*Window)(unsafe.Pointer(pMWin)).FiEphCsr = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
*(*int32)(unsafe.Pointer(pParse + 52 /* &.nTab */)) += (3)
selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*Select)(unsafe.Pointer(p)).FpEList, pTab, bp+48 /* &pSublist */)
@@ -127277,8 +132243,8 @@ func Xsqlite3WindowRewrite(tls *crt.TLS, pParse uintptr, p uintptr) int32 { /* s
var pFilter uintptr = Xsqlite3ExprDup(tls, db, (*Window)(unsafe.Pointer(pWin)).FpFilter, 0)
*(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)), pFilter)
}
- (*Window)(unsafe.Pointer(pWin)).FregAccum = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- (*Window)(unsafe.Pointer(pWin)).FregResult = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ (*Window)(unsafe.Pointer(pWin)).FregAccum = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ (*Window)(unsafe.Pointer(pWin)).FregResult = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 72, 0, (*Window)(unsafe.Pointer(pWin)).FregAccum)
}
@@ -127289,11 +132255,12 @@ func Xsqlite3WindowRewrite(tls *crt.TLS, pParse uintptr, p uintptr) int32 { /* s
// keep everything legal in this case.
if *(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)) == uintptr(0) {
*(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0),
- Xsqlite3Expr(tls, db, 152, ts+7105 /* "0" */))
+ Xsqlite3Expr(tls, db, 152, ts+9351 /* "0" */))
}
pSub = Xsqlite3SelectNew(tls,
pParse, *(*uintptr)(unsafe.Pointer(bp + 48 /* pSublist */)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0))
+
(*Select)(unsafe.Pointer(p)).FpSrc = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0))
if (*Select)(unsafe.Pointer(p)).FpSrc != 0 {
var pTab2 uintptr
@@ -127308,19 +132275,19 @@ func Xsqlite3WindowRewrite(tls *crt.TLS, pParse uintptr, p uintptr) int32 { /* s
// the correct error message regardless.
rc = 7
} else {
- crt.Xmemcpy(tls, pTab, pTab2, uint64(unsafe.Sizeof(Table{})))
+ libc.Xmemcpy(tls, pTab, pTab2, uint64(unsafe.Sizeof(Table{})))
*(*U32)(unsafe.Pointer(pTab + 64 /* &.tabFlags */)) |= (U32(0x0002))
(*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(p)).FpSrc + 8 /* &.a */) + uintptr(0)*112)).FpTab = pTab
pTab = pTab2
- crt.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
+ libc.Xmemset(tls, bp /* &w */, 0, uint64(unsafe.Sizeof(Walker{})))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxExprCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{sqlite3WindowExtraAggFuncDepth}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
+ f func(*libc.TLS, uintptr, uintptr) int32
}{Xsqlite3WalkerDepthIncrease}))
(*Walker)(unsafe.Pointer(bp /* &w */)).FxSelectCallback2 = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{Xsqlite3WalkerDepthDecrease}))
Xsqlite3WalkSelect(tls, bp /* &w */, pSub)
}
@@ -127338,14 +132305,13 @@ func Xsqlite3WindowRewrite(tls *crt.TLS, pParse uintptr, p uintptr) int32 { /* s
Xsqlite3ErrorToParser(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 7)
}
- Xsqlite3SelectReset(tls, pParse, p)
}
return rc
}
// Unlink the Window object from the Select to which it is attached,
// if it is attached.
-func Xsqlite3WindowUnlinkFromSelect(tls *crt.TLS, p uintptr) { /* sqlite3.c:151619:21: */
+func Xsqlite3WindowUnlinkFromSelect(tls *libc.TLS, p uintptr) { /* sqlite3.c:152260:21: */
if (*Window)(unsafe.Pointer(p)).FppThis != 0 {
*(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(p)).FppThis)) = (*Window)(unsafe.Pointer(p)).FpNextWin
if (*Window)(unsafe.Pointer(p)).FpNextWin != 0 {
@@ -127356,7 +132322,7 @@ func Xsqlite3WindowUnlinkFromSelect(tls *crt.TLS, p uintptr) { /* sqlite3.c:1516
}
// Free the Window object passed as the second argument.
-func Xsqlite3WindowDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:151630:21: */
+func Xsqlite3WindowDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:152271:21: */
if p != 0 {
Xsqlite3WindowUnlinkFromSelect(tls, p)
Xsqlite3ExprDelete(tls, db, (*Window)(unsafe.Pointer(p)).FpFilter)
@@ -127371,7 +132337,7 @@ func Xsqlite3WindowDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:15
}
// Free the linked list of Window objects starting at the second argument.
-func Xsqlite3WindowListDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:151647:21: */
+func Xsqlite3WindowListDelete(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:152288:21: */
for p != 0 {
var pNext uintptr = (*Window)(unsafe.Pointer(p)).FpNextWin
Xsqlite3WindowDelete(tls, db, p)
@@ -127384,7 +132350,7 @@ func Xsqlite3WindowListDelete(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.
// constant, change it to NULL. The fact that it is then a non-negative
// integer will be caught later. But it is important not to leave
// variable values in the expression tree.
-func sqlite3WindowOffsetExpr(tls *crt.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:151662:13: */
+func sqlite3WindowOffsetExpr(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr { /* sqlite3.c:152303:13: */
if 0 == Xsqlite3ExprIsConstant(tls, pExpr) {
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2 {
Xsqlite3RenameExprUnmap(tls, pParse, pExpr)
@@ -127396,7 +132362,7 @@ func sqlite3WindowOffsetExpr(tls *crt.TLS, pParse uintptr, pExpr uintptr) uintpt
}
// Allocate and return a new Window object describing a Window Definition.
-func Xsqlite3WindowAlloc(tls *crt.TLS, pParse uintptr, eType int32, eStart int32, pStart uintptr, eEnd int32, pEnd uintptr, eExclude U8) uintptr { /* sqlite3.c:151674:23: */
+func Xsqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int32, pStart uintptr, eEnd int32, pEnd uintptr, eExclude U8) uintptr { /* sqlite3.c:152315:23: */
var pWin uintptr
var bImplicitFrame int32
pWin = uintptr(0)
@@ -127429,7 +132395,7 @@ __1:
((eStart == 86) && ((eEnd == 88) || (eEnd == 85)))) {
goto __2
}
- Xsqlite3ErrorMsg(tls, pParse, ts+20126 /* "unsupported fram..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+24087 /* "unsupported fram..." */, 0)
goto windowAllocErr
__2:
;
@@ -127465,7 +132431,7 @@ windowAllocErr:
// Attach PARTITION and ORDER BY clauses pPartition and pOrderBy to window
// pWin. Also, if parameter pBase is not NULL, set pWin->zBase to the
// equivalent nul-terminated string.
-func Xsqlite3WindowAssemble(tls *crt.TLS, pParse uintptr, pWin uintptr, pPartition uintptr, pOrderBy uintptr, pBase uintptr) uintptr { /* sqlite3.c:151746:23: */
+func Xsqlite3WindowAssemble(tls *libc.TLS, pParse uintptr, pWin uintptr, pPartition uintptr, pOrderBy uintptr, pBase uintptr) uintptr { /* sqlite3.c:152387:23: */
if pWin != 0 {
(*Window)(unsafe.Pointer(pWin)).FpPartition = pPartition
(*Window)(unsafe.Pointer(pWin)).FpOrderBy = pOrderBy
@@ -127484,7 +132450,7 @@ func Xsqlite3WindowAssemble(tls *crt.TLS, pParse uintptr, pWin uintptr, pPartiti
// stored in the linked list starting at pWin->pNextWin. This function
// either updates *pWin according to the base specification, or else
// leaves an error in pParse.
-func Xsqlite3WindowChain(tls *crt.TLS, pParse uintptr, pWin uintptr, pList uintptr) { /* sqlite3.c:151773:21: */
+func Xsqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uintptr) { /* sqlite3.c:152414:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -127495,15 +132461,15 @@ func Xsqlite3WindowChain(tls *crt.TLS, pParse uintptr, pWin uintptr, pList uintp
var zErr uintptr = uintptr(0)
// Check for errors
if (*Window)(unsafe.Pointer(pWin)).FpPartition != 0 {
- zErr = ts + 20158 /* "PARTITION clause" */
+ zErr = ts + 24119 /* "PARTITION clause" */
} else if ((*Window)(unsafe.Pointer(pExist)).FpOrderBy != 0) && ((*Window)(unsafe.Pointer(pWin)).FpOrderBy != 0) {
- zErr = ts + 20175 /* "ORDER BY clause" */
+ zErr = ts + 24136 /* "ORDER BY clause" */
} else if int32((*Window)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 {
- zErr = ts + 20191 /* "frame specificat..." */
+ zErr = ts + 24152 /* "frame specificat..." */
}
if zErr != 0 {
Xsqlite3ErrorMsg(tls, pParse,
- ts+20211 /* "cannot override ..." */, crt.VaList(bp, zErr, (*Window)(unsafe.Pointer(pWin)).FzBase))
+ ts+24172 /* "cannot override ..." */, libc.VaList(bp, zErr, (*Window)(unsafe.Pointer(pWin)).FzBase))
} else {
(*Window)(unsafe.Pointer(pWin)).FpPartition = Xsqlite3ExprListDup(tls, db, (*Window)(unsafe.Pointer(pExist)).FpPartition, 0)
if (*Window)(unsafe.Pointer(pExist)).FpOrderBy != 0 {
@@ -127518,7 +132484,7 @@ func Xsqlite3WindowChain(tls *crt.TLS, pParse uintptr, pWin uintptr, pList uintp
}
// Attach window object pWin to expression p.
-func Xsqlite3WindowAttach(tls *crt.TLS, pParse uintptr, p uintptr, pWin uintptr) { /* sqlite3.c:151807:21: */
+func Xsqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr) { /* sqlite3.c:152448:21: */
if p != 0 {
*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) = pWin
@@ -127526,7 +132492,7 @@ func Xsqlite3WindowAttach(tls *crt.TLS, pParse uintptr, p uintptr, pWin uintptr)
(*Window)(unsafe.Pointer(pWin)).FpOwner = p
if (((*Expr)(unsafe.Pointer(p)).Fflags & U32(0x000002)) != 0) && (int32((*Window)(unsafe.Pointer(pWin)).FeFrmType) != 163) {
Xsqlite3ErrorMsg(tls, pParse,
- ts+20244 /* "DISTINCT is not ..." */, 0)
+ ts+24205 /* "DISTINCT is not ..." */, 0)
}
} else {
Xsqlite3WindowDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pWin)
@@ -127537,7 +132503,7 @@ func Xsqlite3WindowAttach(tls *crt.TLS, pParse uintptr, p uintptr, pWin uintptr)
// to be processed as part of SELECT statement pSel). The window is linked
// in if either (a) there are no other windows already linked to this
// SELECT, or (b) the windows already linked use a compatible window frame.
-func Xsqlite3WindowLink(tls *crt.TLS, pSel uintptr, pWin uintptr) { /* sqlite3.c:151830:21: */
+func Xsqlite3WindowLink(tls *libc.TLS, pSel uintptr, pWin uintptr) { /* sqlite3.c:152471:21: */
if (pSel != uintptr(0)) &&
((uintptr(0) == (*Select)(unsafe.Pointer(pSel)).FpWin) || (0 == Xsqlite3WindowCompare(tls, uintptr(0), (*Select)(unsafe.Pointer(pSel)).FpWin, pWin, 0))) {
(*Window)(unsafe.Pointer(pWin)).FpNextWin = (*Select)(unsafe.Pointer(pSel)).FpWin
@@ -127552,7 +132518,7 @@ func Xsqlite3WindowLink(tls *crt.TLS, pSel uintptr, pWin uintptr) { /* sqlite3.c
// Return 0 if the two window objects are identical, 1 if they are
// different, or 2 if it cannot be determined if the objects are identical
// or not. Identical window objects can be processed in a single scan.
-func Xsqlite3WindowCompare(tls *crt.TLS, pParse uintptr, p1 uintptr, p2 uintptr, bFilter int32) int32 { /* sqlite3.c:151848:20: */
+func Xsqlite3WindowCompare(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uintptr, bFilter int32) int32 { /* sqlite3.c:152489:20: */
var res int32
if (p1 == uintptr(0)) || (p2 == uintptr(0)) {
return 1
@@ -127575,14 +132541,14 @@ func Xsqlite3WindowCompare(tls *crt.TLS, pParse uintptr, p1 uintptr, p2 uintptr,
if Xsqlite3ExprCompare(tls, pParse, (*Window)(unsafe.Pointer(p1)).FpEnd, (*Window)(unsafe.Pointer(p2)).FpEnd, -1) != 0 {
return 1
}
- if crt.AssignInt32(&res, Xsqlite3ExprListCompare(tls, (*Window)(unsafe.Pointer(p1)).FpPartition, (*Window)(unsafe.Pointer(p2)).FpPartition, -1)) != 0 {
+ if libc.AssignInt32(&res, Xsqlite3ExprListCompare(tls, (*Window)(unsafe.Pointer(p1)).FpPartition, (*Window)(unsafe.Pointer(p2)).FpPartition, -1)) != 0 {
return res
}
- if crt.AssignInt32(&res, Xsqlite3ExprListCompare(tls, (*Window)(unsafe.Pointer(p1)).FpOrderBy, (*Window)(unsafe.Pointer(p2)).FpOrderBy, -1)) != 0 {
+ if libc.AssignInt32(&res, Xsqlite3ExprListCompare(tls, (*Window)(unsafe.Pointer(p1)).FpOrderBy, (*Window)(unsafe.Pointer(p2)).FpOrderBy, -1)) != 0 {
return res
}
if bFilter != 0 {
- if crt.AssignInt32(&res, Xsqlite3ExprCompare(tls, pParse, (*Window)(unsafe.Pointer(p1)).FpFilter, (*Window)(unsafe.Pointer(p2)).FpFilter, -1)) != 0 {
+ if libc.AssignInt32(&res, Xsqlite3ExprCompare(tls, pParse, (*Window)(unsafe.Pointer(p1)).FpFilter, (*Window)(unsafe.Pointer(p2)).FpFilter, -1)) != 0 {
return res
}
}
@@ -127592,7 +132558,7 @@ func Xsqlite3WindowCompare(tls *crt.TLS, pParse uintptr, p1 uintptr, p2 uintptr,
// This is called by code in select.c before it calls sqlite3WhereBegin()
// to begin iterating through the sub-query results. It is used to allocate
// and initialize registers and cursors used by sqlite3WindowCodeStep().
-func Xsqlite3WindowCodeInit(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:151877:21: */
+func Xsqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* sqlite3.c:152518:21: */
var nEphExpr int32 = (*ExprList)(unsafe.Pointer((*Select)(unsafe.Pointer((*SrcList_item)(unsafe.Pointer(((*Select)(unsafe.Pointer(pSelect)).FpSrc + 8 /* &.a */) + uintptr(0)*112)).FpSelect)).FpEList)).FnExpr
var pMWin uintptr = (*Select)(unsafe.Pointer(pSelect)).FpWin
var pWin uintptr
@@ -127612,13 +132578,13 @@ func Xsqlite3WindowCodeInit(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /*
Xsqlite3VdbeAddOp3(tls, v, 72, 0, (*Window)(unsafe.Pointer(pMWin)).FregPart, (((*Window)(unsafe.Pointer(pMWin)).FregPart + nExpr) - 1))
}
- (*Window)(unsafe.Pointer(pMWin)).FregOne = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ (*Window)(unsafe.Pointer(pMWin)).FregOne = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
Xsqlite3VdbeAddOp2(tls, v, 69, 1, (*Window)(unsafe.Pointer(pMWin)).FregOne)
if (*Window)(unsafe.Pointer(pMWin)).FeExclude != 0 {
- (*Window)(unsafe.Pointer(pMWin)).FregStartRowid = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- (*Window)(unsafe.Pointer(pMWin)).FregEndRowid = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- (*Window)(unsafe.Pointer(pMWin)).FcsrApp = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ (*Window)(unsafe.Pointer(pMWin)).FregStartRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ (*Window)(unsafe.Pointer(pMWin)).FregEndRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ (*Window)(unsafe.Pointer(pMWin)).FcsrApp = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
Xsqlite3VdbeAddOp2(tls, v, 69, 1, (*Window)(unsafe.Pointer(pMWin)).FregStartRowid)
Xsqlite3VdbeAddOp2(tls, v, 69, 0, (*Window)(unsafe.Pointer(pMWin)).FregEndRowid)
Xsqlite3VdbeAddOp2(tls, v, 98, (*Window)(unsafe.Pointer(pMWin)).FcsrApp, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
@@ -127636,7 +132602,7 @@ func Xsqlite3WindowCodeInit(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /*
// regApp+2: output of MakeRecord
var pList uintptr = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */))
var pKeyInfo uintptr = Xsqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0)
- (*Window)(unsafe.Pointer(pWin)).FcsrApp = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ (*Window)(unsafe.Pointer(pWin)).FcsrApp = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
(*Window)(unsafe.Pointer(pWin)).FregApp = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (3)
if (pKeyInfo != 0) && (int32(*(*int8)(unsafe.Pointer((*FuncDef)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpFunc)).FzName + uintptr(1)))) == 'i') {
@@ -127650,11 +132616,11 @@ func Xsqlite3WindowCodeInit(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /*
// Allocate two registers at pWin->regApp. These will be used to
// store the start and end index of the current frame.
(*Window)(unsafe.Pointer(pWin)).FregApp = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
- (*Window)(unsafe.Pointer(pWin)).FcsrApp = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ (*Window)(unsafe.Pointer(pWin)).FcsrApp = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (2)
Xsqlite3VdbeAddOp2(tls, v, 98, (*Window)(unsafe.Pointer(pWin)).FcsrApp, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
} else if ((*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&leadName))) || ((*FuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&lagName))) {
- (*Window)(unsafe.Pointer(pWin)).FcsrApp = crt.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
+ (*Window)(unsafe.Pointer(pWin)).FcsrApp = libc.PostIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnTab, 1)
Xsqlite3VdbeAddOp2(tls, v, 98, (*Window)(unsafe.Pointer(pWin)).FcsrApp, (*Window)(unsafe.Pointer(pMWin)).FiEphCsr)
}
}
@@ -127665,14 +132631,14 @@ func Xsqlite3WindowCodeInit(tls *crt.TLS, pParse uintptr, pSelect uintptr) { /*
// evaluated and the result left in register reg. This function generates VM
// code to check that the value is a non-negative integer and throws an
// exception if it is not.
-func windowCheckValue(tls *crt.TLS, pParse uintptr, reg int32, eCond int32) { /* sqlite3.c:151961:13: */
+func windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { /* sqlite3.c:152602:13: */
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
var regZero int32 = Xsqlite3GetTempReg(tls, pParse)
Xsqlite3VdbeAddOp2(tls, v, 69, 0, regZero)
if eCond >= 3 {
var regString int32 = Xsqlite3GetTempReg(tls, pParse)
- Xsqlite3VdbeAddOp4(tls, v, 115, 0, regString, 0, ts+672 /* "" */, -1)
+ Xsqlite3VdbeAddOp4(tls, v, 115, 0, regString, 0, ts+781 /* "" */, -1)
Xsqlite3VdbeAddOp3(tls, v, 57, regString, (Xsqlite3VdbeCurrentAddr(tls, v) + 2), reg)
Xsqlite3VdbeChangeP5(tls, v, (uint16(0x43 | 0x10)))
@@ -127693,17 +132659,17 @@ func windowCheckValue(tls *crt.TLS, pParse uintptr, reg int32, eCond int32) { /*
}
var azErr = [5]uintptr{
- ts + 20291, /* "frame starting o..." */
- ts + 20344, /* "frame ending off..." */
- ts + 19774, /* "second argument ..." */
- ts + 20395, /* "frame starting o..." */
- ts + 20447, /* "frame ending off..." */
-} /* sqlite3.c:151962:21 */
-var aOp1 = [5]int32{57, 57, 54, 57, 57} /* sqlite3.c:151969:14 */
+ ts + 24252, /* "frame starting o..." */
+ ts + 24305, /* "frame ending off..." */
+ ts + 23735, /* "second argument ..." */
+ ts + 24356, /* "frame starting o..." */
+ ts + 24408, /* "frame ending off..." */
+} /* sqlite3.c:152603:21 */
+var aOp1 = [5]int32{57, 57, 54, 57, 57} /* sqlite3.c:152610:14 */
// Return the number of arguments passed to the window-function associated
// with the object passed as the only argument to this function.
-func windowArgCount(tls *crt.TLS, pWin uintptr) int32 { /* sqlite3.c:152007:12: */
+func windowArgCount(tls *libc.TLS, pWin uintptr) int32 { /* sqlite3.c:152648:12: */
var pList uintptr = *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */))
return func() int32 {
if pList != 0 {
@@ -127726,17 +132692,17 @@ type WindowCodeArg1 = struct {
Fend WindowCsrAndReg
}
-type WindowCodeArg = WindowCodeArg1 /* sqlite3.c:152012:30 */
+type WindowCodeArg = WindowCodeArg1 /* sqlite3.c:152653:30 */
type WindowCsrAndReg1 = struct {
Fcsr int32
Freg int32
}
-type WindowCsrAndReg = WindowCsrAndReg1 /* sqlite3.c:152013:32 */
+type WindowCsrAndReg = WindowCsrAndReg1 /* sqlite3.c:152654:32 */
// Generate VM code to read the window frames peer values from cursor csr into
// an array of registers starting at reg.
-func windowReadPeerValues(tls *crt.TLS, p uintptr, csr int32, reg int32) { /* sqlite3.c:152096:13: */
+func windowReadPeerValues(tls *libc.TLS, p uintptr, csr int32, reg int32) { /* sqlite3.c:152737:13: */
var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
var pOrderBy uintptr = (*Window)(unsafe.Pointer(pMWin)).FpOrderBy
if pOrderBy != 0 {
@@ -127772,7 +132738,7 @@ func windowReadPeerValues(tls *crt.TLS, p uintptr, csr int32, reg int32) { /* sq
//
// If argument regPartSize is non-zero, then it is a register containing the
// number of rows in the current partition.
-func windowAggStep(tls *crt.TLS, p uintptr, pMWin uintptr, csr int32, bInverse int32, reg int32) { /* sqlite3.c:152133:13: */
+func windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse int32, reg int32) { /* sqlite3.c:152774:13: */
var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
var pWin uintptr
@@ -127820,7 +132786,7 @@ func windowAggStep(tls *crt.TLS, p uintptr, pMWin uintptr, csr int32, bInverse i
Xsqlite3VdbeAddOp2(tls, v, 82, (((*Window)(unsafe.Pointer(pWin)).FregApp + 1) - bInverse), 1)
} else if (*FuncDef)(unsafe.Pointer(pFunc)).FxSFunc != *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{noopStepFunc})) {
var addrIf int32 = 0
if (*Window)(unsafe.Pointer(pWin)).FpFilter != 0 {
@@ -127843,7 +132809,7 @@ func windowAggStep(tls *crt.TLS, p uintptr, pMWin uintptr, csr int32, bInverse i
Xsqlite3ExprCodeExprList(tls, pParse, *(*uintptr)(unsafe.Pointer((*Window)(unsafe.Pointer(pWin)).FpOwner + 32 /* &.x */)), regArg, 0, uint8(0))
pEnd = Xsqlite3VdbeGetOp(tls, v, -1)
- for pOp = Xsqlite3VdbeGetOp(tls, v, iStart); pOp <= pEnd; pOp += 24 {
+ for pOp = Xsqlite3VdbeGetOp(tls, v, iStart); pOp <= pEnd; pOp += 32 {
if (int32((*VdbeOp)(unsafe.Pointer(pOp)).Fopcode) == 89) && ((*VdbeOp)(unsafe.Pointer(pOp)).Fp1 == (*Window)(unsafe.Pointer(pWin)).FiEphCsr) {
(*VdbeOp)(unsafe.Pointer(pOp)).Fp1 = csr
}
@@ -127880,7 +132846,7 @@ func windowAggStep(tls *crt.TLS, p uintptr, pMWin uintptr, csr int32, bInverse i
// (bFin==1) for each window function in the linked list starting at
// pMWin. Or, for built-in window-functions that do not use the standard
// API, generate the equivalent VM code.
-func windowAggFinal(tls *crt.TLS, p uintptr, bFin int32) { /* sqlite3.c:152247:13: */
+func windowAggFinal(tls *libc.TLS, p uintptr, bFin int32) { /* sqlite3.c:152888:13: */
var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
@@ -127915,7 +132881,7 @@ func windowAggFinal(tls *crt.TLS, p uintptr, bFin int32) { /* sqlite3.c:152247:1
// p->pMWin list by doing a full scan of the current window frame. Store the
// results in the Window.regResult registers, ready to return the upper
// layer.
-func windowFullScan(tls *crt.TLS, p uintptr) { /* sqlite3.c:152286:13: */
+func windowFullScan(tls *libc.TLS, p uintptr) { /* sqlite3.c:152927:13: */
var pWin uintptr
var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
@@ -128019,7 +132985,7 @@ func windowFullScan(tls *crt.TLS, p uintptr) { /* sqlite3.c:152286:13: */
// first_value()
// lag()
// lead()
-func windowReturnOneRow(tls *crt.TLS, p uintptr) { /* sqlite3.c:152392:13: */
+func windowReturnOneRow(tls *libc.TLS, p uintptr) { /* sqlite3.c:153033:13: */
var pMWin uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpMWin
var v uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpVdbe
@@ -128101,7 +133067,7 @@ func windowReturnOneRow(tls *crt.TLS, p uintptr) { /* sqlite3.c:152392:13: */
// in the linked list passed as the second argument to NULL. And perform
// any equivalent initialization required by any built-in window functions
// in the list.
-func windowInitAccum(tls *crt.TLS, pParse uintptr, pMWin uintptr) int32 { /* sqlite3.c:152468:12: */
+func windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) int32 { /* sqlite3.c:153109:12: */
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
var regArg int32
var nArg int32 = 0
@@ -128136,7 +133102,7 @@ func windowInitAccum(tls *crt.TLS, pParse uintptr, pMWin uintptr) int32 { /* sql
// Return true if the current frame should be cached in the ephemeral table,
// even if there are no xInverse() calls required.
-func windowCacheFrame(tls *crt.TLS, pMWin uintptr) int32 { /* sqlite3.c:152500:12: */
+func windowCacheFrame(tls *libc.TLS, pMWin uintptr) int32 { /* sqlite3.c:153141:12: */
var pWin uintptr
if (*Window)(unsafe.Pointer(pMWin)).FregStartRowid != 0 {
return 1
@@ -128161,7 +133127,7 @@ func windowCacheFrame(tls *crt.TLS, pMWin uintptr) int32 { /* sqlite3.c:152500:1
// If the two arrays are not equal, the contents of regNew is copied to
// regOld and control falls through. Otherwise, if the contents of the arrays
// are equal, an OP_Goto is executed. The address of the OP_Goto is returned.
-func windowIfNewPeer(tls *crt.TLS, pParse uintptr, pOrderBy uintptr, regNew int32, regOld int32, addr int32) { /* sqlite3.c:152526:13: */
+func windowIfNewPeer(tls *libc.TLS, pParse uintptr, pOrderBy uintptr, regNew int32, regOld int32, addr int32) { /* sqlite3.c:153167:13: */
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
if pOrderBy != 0 {
var nVal int32 = (*ExprList)(unsafe.Pointer(pOrderBy)).FnExpr
@@ -128198,13 +133164,13 @@ func windowIfNewPeer(tls *crt.TLS, pParse uintptr, pOrderBy uintptr, regNew int3
// A special type of arithmetic is used such that if csr1.peerVal is not
// a numeric type (real or integer), then the result of the addition addition
// or subtraction is a a copy of csr1.peerVal.
-func windowCodeRangeTest(tls *crt.TLS, p uintptr, op int32, csr1 int32, regVal int32, csr2 int32, lbl int32) { /* sqlite3.c:152572:13: */
+func windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal int32, csr2 int32, lbl int32) { /* sqlite3.c:153213:13: */
var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
var v uintptr = Xsqlite3GetVdbe(tls, pParse)
var pOrderBy uintptr = (*Window)(unsafe.Pointer((*WindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy // ORDER BY clause for window
var reg1 int32 = Xsqlite3GetTempReg(tls, pParse) // Reg. for csr1.peerVal+regVal
var reg2 int32 = Xsqlite3GetTempReg(tls, pParse) // Reg. for csr2.peerVal
- var regString int32 = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Reg. for constant value ''
+ var regString int32 = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1) // Reg. for constant value ''
var arith int32 = 105 // OP_Add or OP_Subtract
var addrGe int32 // Jump destination
@@ -128242,7 +133208,7 @@ func windowCodeRangeTest(tls *crt.TLS, p uintptr, op int32, csr1 int32, regVal i
// the add/subtract is skipped for these, as required. If reg1 is a NULL,
// then the arithmetic is performed, but since adding or subtracting from
// NULL is always NULL anyway, this case is handled as required too.
- Xsqlite3VdbeAddOp4(tls, v, 115, 0, regString, 0, ts+672 /* "" */, -1)
+ Xsqlite3VdbeAddOp4(tls, v, 115, 0, regString, 0, ts+781 /* "" */, -1)
addrGe = Xsqlite3VdbeAddOp3(tls, v, 57, regString, 0, reg1)
Xsqlite3VdbeAddOp3(tls, v, arith, regVal, reg1, reg1)
@@ -128313,7 +133279,7 @@ func windowCodeRangeTest(tls *crt.TLS, p uintptr, op int32, csr1 int32, regVal i
// generates VM code for a single RETURN_ROW, AGGSTEP or AGGINVERSE
// operation. Refer to the header comment for sqlite3WindowCodeStep() for
// details.
-func windowCodeOp(tls *crt.TLS, p uintptr, op int32, regCountdown int32, jumpOnEof int32) int32 { /* sqlite3.c:152697:12: */
+func windowCodeOp(tls *libc.TLS, p uintptr, op int32, regCountdown int32, jumpOnEof int32) int32 { /* sqlite3.c:153338:12: */
var csr int32
var reg int32
var pParse uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpParse
@@ -128321,7 +133287,7 @@ func windowCodeOp(tls *crt.TLS, p uintptr, op int32, regCountdown int32, jumpOnE
var ret int32 = 0
var v uintptr = (*WindowCodeArg)(unsafe.Pointer(p)).FpVdbe
var addrContinue int32 = 0
- var bPeer int32 = (crt.Bool32(int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != 76))
+ var bPeer int32 = (libc.Bool32(int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) != 76))
var lblDone int32 = Xsqlite3VdbeMakeLabel(tls, pParse)
var addrNextRange int32 = 0
@@ -128451,7 +133417,7 @@ func windowCodeOp(tls *crt.TLS, p uintptr, op int32, regCountdown int32, jumpOnE
// Allocate and return a duplicate of the Window object indicated by the
// third argument. Set the Window.pOwner field of the new object to
// pOwner.
-func Xsqlite3WindowDup(tls *crt.TLS, db uintptr, pOwner uintptr, p uintptr) uintptr { /* sqlite3.c:152838:23: */
+func Xsqlite3WindowDup(tls *libc.TLS, db uintptr, pOwner uintptr, p uintptr) uintptr { /* sqlite3.c:153479:23: */
var pNew uintptr = uintptr(0)
if p != 0 {
pNew = Xsqlite3DbMallocZero(tls, db, uint64(unsafe.Sizeof(Window{})))
@@ -128482,7 +133448,7 @@ func Xsqlite3WindowDup(tls *crt.TLS, db uintptr, pOwner uintptr, p uintptr) uint
// Return a copy of the linked list of Window objects passed as the
// second argument.
-func Xsqlite3WindowListDup(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:152871:23: */
+func Xsqlite3WindowListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr { /* sqlite3.c:153512:23: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -128507,7 +133473,7 @@ func Xsqlite3WindowListDup(tls *crt.TLS, db uintptr, p uintptr) uintptr { /* sql
//
// If an OOM error occurs, this function sets the Parse.db.mallocFailed
// flag and returns zero.
-func windowExprGtZero(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:152893:12: */
+func windowExprGtZero(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32 { /* sqlite3.c:153534:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -128855,7 +133821,7 @@ func windowExprGtZero(tls *crt.TLS, pParse uintptr, pExpr uintptr) int32 { /* sq
//
// The text above leaves out many details. Refer to the code and comments
// below for a more complete picture.
-func Xsqlite3WindowCodeStep(tls *crt.TLS, pParse uintptr, p uintptr, pWInfo uintptr, regGosub int32, addrGosub int32) { /* sqlite3.c:153240:21: */
+func Xsqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uintptr, regGosub int32, addrGosub int32) { /* sqlite3.c:153881:21: */
bp := tls.Alloc(64)
defer tls.Free(64)
@@ -128885,7 +133851,7 @@ func Xsqlite3WindowCodeStep(tls *crt.TLS, pParse uintptr, p uintptr, pWInfo uint
lblWhereEnd = Xsqlite3VdbeMakeLabel(tls, pParse)
// Fill in the context object
- crt.Xmemset(tls, bp /* &s */, 0, uint64(unsafe.Sizeof(WindowCodeArg{})))
+ libc.Xmemset(tls, bp /* &s */, 0, uint64(unsafe.Sizeof(WindowCodeArg{})))
(*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).FpParse = pParse
(*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).FpMWin = pMWin
(*WindowCodeArg)(unsafe.Pointer(bp /* &s */)).FpVdbe = v
@@ -128931,17 +133897,17 @@ func Xsqlite3WindowCodeStep(tls *crt.TLS, pParse uintptr, p uintptr, pWInfo uint
// into the ephemeral table.
regNew = ((*Parse)(unsafe.Pointer(pParse)).FnMem + 1)
*(*int32)(unsafe.Pointer(pParse + 56 /* &.nMem */)) += (nInput)
- regRecord = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
- regRowid = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regRecord = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regRowid = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
// If the window frame contains an "<expr> PRECEDING" or "<expr> FOLLOWING"
// clause, allocate registers to store the results of evaluating each
// <expr>.
if (int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == 88) || (int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == 86) {
- regStart = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regStart = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
if (int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == 88) || (int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == 86) {
- regEnd = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regEnd = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
}
// If this is not a "ROWS BETWEEN ..." frame, then allocate arrays of
@@ -128988,13 +133954,13 @@ func Xsqlite3WindowCodeStep(tls *crt.TLS, pParse uintptr, p uintptr, pWInfo uint
var regNewPart int32 = (regNew + (*Window)(unsafe.Pointer(pMWin)).FnBufferCol)
var pKeyInfo uintptr = Xsqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0)
- regFlushPart = crt.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
+ regFlushPart = libc.PreIncInt32(&(*Parse)(unsafe.Pointer(pParse)).FnMem, 1)
addr = Xsqlite3VdbeAddOp3(tls, v, 86, regNewPart, (*Window)(unsafe.Pointer(pMWin)).FregPart, nPart)
Xsqlite3VdbeAppendP4(tls, v, pKeyInfo, -9)
Xsqlite3VdbeAddOp3(tls, v, 16, (addr + 2), (addr + 4), (addr + 2))
addrGosubFlush = Xsqlite3VdbeAddOp1(tls, v, 12, regFlushPart)
-
+ Xsqlite3VdbeComment(tls, v, ts+24458 /* "call flush_parti..." */, 0)
Xsqlite3VdbeAddOp3(tls, v, 77, regNewPart, (*Window)(unsafe.Pointer(pMWin)).FregPart, (nPart - 1))
}
@@ -129087,7 +134053,7 @@ func Xsqlite3WindowCodeStep(tls *crt.TLS, pParse uintptr, p uintptr, pWInfo uint
}
}
} else if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == 88 {
- var bRPS int32 = (crt.Bool32((int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == 88) && (int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == 89)))
+ var bRPS int32 = (libc.Bool32((int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == 88) && (int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == 89)))
windowCodeOp(tls, bp /* &s */, 3, regEnd, 0)
if bRPS != 0 {
windowCodeOp(tls, bp /* &s */, 2, regStart, 0)
@@ -129139,7 +134105,7 @@ func Xsqlite3WindowCodeStep(tls *crt.TLS, pParse uintptr, p uintptr, pWInfo uint
addrEmpty = Xsqlite3VdbeAddOp1(tls, v, 37, csrWrite)
if int32((*Window)(unsafe.Pointer(pMWin)).FeEnd) == 88 {
- var bRPS int32 = (crt.Bool32((int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == 88) && (int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == 89)))
+ var bRPS int32 = (libc.Bool32((int32((*Window)(unsafe.Pointer(pMWin)).FeStart) == 88) && (int32((*Window)(unsafe.Pointer(pMWin)).FeFrmType) == 89)))
windowCodeOp(tls, bp /* &s */, 3, regEnd, 0)
if bRPS != 0 {
windowCodeOp(tls, bp /* &s */, 2, regStart, 0)
@@ -129263,7 +134229,7 @@ type FrameBound = struct {
// Disable lookaside memory allocation for objects that might be
// shared across database connections.
-func disableLookaside(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:153653:13: */
+func disableLookaside(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:154294:13: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
(*Parse)(unsafe.Pointer(pParse)).FdisableLookaside++
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++
@@ -129273,7 +134239,7 @@ func disableLookaside(tls *crt.TLS, pParse uintptr) { /* sqlite3.c:153653:13: */
// For a compound SELECT statement, make sure p->pPrior->pNext==p for
// all elements in the list. And make sure list length does not exceed
// SQLITE_LIMIT_COMPOUND_SELECT.
-func parserDoubleLinkSelect(tls *crt.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:153665:15: */
+func parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:154327:15: */
if (*Select)(unsafe.Pointer(p)).FpPrior != 0 {
var pNext uintptr = uintptr(0)
@@ -129298,8 +134264,8 @@ func parserDoubleLinkSelect(tls *crt.TLS, pParse uintptr, p uintptr) { /* sqlite
goto __3
__3:
;
- if ((((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0000400)) == U32(0)) && ((crt.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + uintptr(4)*4)))) > 0)) && (cnt > mxSelect) {
- Xsqlite3ErrorMsg(tls, pParse, ts+20497 /* "too many terms i..." */, 0)
+ if ((((*Select)(unsafe.Pointer(p)).FselFlags & U32(0x0000400)) == U32(0)) && ((libc.AssignInt32(&mxSelect, *(*int32)(unsafe.Pointer(((*Parse)(unsafe.Pointer(pParse)).Fdb + 124 /* &.aLimit */) + uintptr(4)*4)))) > 0)) && (cnt > mxSelect) {
+ Xsqlite3ErrorMsg(tls, pParse, ts+24479 /* "too many terms i..." */, 0)
}
}
}
@@ -129307,7 +134273,7 @@ func parserDoubleLinkSelect(tls *crt.TLS, pParse uintptr, p uintptr) { /* sqlite
// Construct a new Expr object from a single identifier. Use the
// new Expr to populate pOut. Set the span of pOut to be the identifier
// that created the expression.
-func tokenExpr(tls *crt.TLS, pParse uintptr, op int32, t Token) uintptr { /* sqlite3.c:153688:15: */
+func tokenExpr(tls *libc.TLS, pParse uintptr, op int32, t Token) uintptr { /* sqlite3.c:154350:15: */
bp := tls.Alloc(16)
defer tls.Free(16)
*(*Token)(unsafe.Pointer(bp)) = t
@@ -129320,7 +134286,7 @@ func tokenExpr(tls *crt.TLS, pParse uintptr, op int32, t Token) uintptr { /* sql
(*Expr)(unsafe.Pointer(p)).Fflags = U32(0x800000)
(*Expr)(unsafe.Pointer(p)).FiAgg = int16(-1)
- (*Expr)(unsafe.Pointer(p)).FpLeft = crt.AssignPtrUintptr(p+24 /* &.pRight */, uintptr(0))
+ (*Expr)(unsafe.Pointer(p)).FpLeft = libc.AssignPtrUintptr(p+24 /* &.pRight */, uintptr(0))
*(*uintptr)(unsafe.Pointer(p + 32 /* &.x */)) = uintptr(0)
(*Expr)(unsafe.Pointer(p)).FpAggInfo = uintptr(0)
*(*uintptr)(unsafe.Pointer(p + 64 /* &.y */)) = uintptr(0)
@@ -129328,11 +134294,12 @@ func tokenExpr(tls *crt.TLS, pParse uintptr, op int32, t Token) uintptr { /* sql
(*Expr)(unsafe.Pointer(p)).FiTable = 0
(*Expr)(unsafe.Pointer(p)).FiColumn = int16(0)
*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) = (p + uintptr(1)*72)
- crt.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), (*Token)(unsafe.Pointer(bp /* &t */)).Fz, uint64((*Token)(unsafe.Pointer(bp /* &t */)).Fn))
+ libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)), (*Token)(unsafe.Pointer(bp /* &t */)).Fz, uint64((*Token)(unsafe.Pointer(bp /* &t */)).Fn))
*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) + uintptr((*Token)(unsafe.Pointer(bp /* &t */)).Fn))) = int8(0)
if (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) + uintptr(0))))]) & 0x80) != 0 {
Xsqlite3DequoteExpr(tls, p)
}
+ (*Expr)(unsafe.Pointer(p)).FnHeight = 1
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2 {
return Xsqlite3RenameTokenMap(tls, pParse, p, bp /* &t */)
}
@@ -129342,7 +134309,7 @@ func tokenExpr(tls *crt.TLS, pParse uintptr, op int32, t Token) uintptr { /* sql
// A routine to convert a binary TK_IS or TK_ISNOT expression into a
// unary TK_ISNULL or TK_NOTNULL expression.
-func binaryToUnaryIfNull(tls *crt.TLS, pParse uintptr, pY uintptr, pA uintptr, op int32) { /* sqlite3.c:153723:15: */
+func binaryToUnaryIfNull(tls *libc.TLS, pParse uintptr, pY uintptr, pA uintptr, op int32) { /* sqlite3.c:154385:15: */
var db uintptr = (*Parse)(unsafe.Pointer(pParse)).Fdb
if (((pA != 0) && (pY != 0)) && (int32((*Expr)(unsafe.Pointer(pY)).Fop) == 119)) && !(int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2) {
(*Expr)(unsafe.Pointer(pA)).Fop = U8(op)
@@ -129355,15 +134322,15 @@ func binaryToUnaryIfNull(tls *crt.TLS, pParse uintptr, pY uintptr, pA uintptr, o
// list of identifiers. Report an error if the ID list contains
// a COLLATE clause or an ASC or DESC keyword, except ignore the
// error while parsing a legacy schema.
-func parserAddExprIdListTerm(tls *crt.TLS, pParse uintptr, pPrior uintptr, pIdToken uintptr, hasCollate int32, sortOrder int32) uintptr { /* sqlite3.c:153737:19: */
+func parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pIdToken uintptr, hasCollate int32, sortOrder int32) uintptr { /* sqlite3.c:154399:19: */
bp := tls.Alloc(16)
defer tls.Free(16)
var p uintptr = Xsqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0))
if ((hasCollate != 0) || (sortOrder != -1)) &&
(int32((*Sqlite3)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).Fdb)).Finit.Fbusy) == 0) {
- Xsqlite3ErrorMsg(tls, pParse, ts+20531, /* "syntax error aft..." */
- crt.VaList(bp, (*Token)(unsafe.Pointer(pIdToken)).Fn, (*Token)(unsafe.Pointer(pIdToken)).Fz))
+ Xsqlite3ErrorMsg(tls, pParse, ts+24513, /* "syntax error aft..." */
+ libc.VaList(bp, (*Token)(unsafe.Pointer(pIdToken)).Fn, (*Token)(unsafe.Pointer(pIdToken)).Fz))
}
Xsqlite3ExprListSetName(tls, pParse, p, pIdToken, 1)
return p
@@ -129431,7 +134398,7 @@ type YYMINORTYPE = struct {
_ [0]uint64
Fyyinit int32
_ [12]byte
-} /* sqlite3.c:153843:3 */
+} /* sqlite3.c:154505:3 */
//************ End control #defines ******************************************
// Define the yytestcase() macro to be a no-op if is not already defined
@@ -129492,205 +134459,206 @@ type YYMINORTYPE = struct {
// yy_default[] Default action for each state.
//
// Begin parsing tables *********************************************
-var yy_action = [1958]uint16{
- /* 0 */ uint16(544), uint16(1220), uint16(544), uint16(449), uint16(1258), uint16(544), uint16(1237), uint16(544), uint16(114), uint16(111),
- /* 10 */ uint16(211), uint16(544), uint16(1535), uint16(544), uint16(1258), uint16(521), uint16(114), uint16(111), uint16(211), uint16(390),
- /* 20 */ uint16(1230), uint16(342), uint16(42), uint16(42), uint16(42), uint16(42), uint16(1223), uint16(42), uint16(42), uint16(71),
- /* 30 */ uint16(71), uint16(935), uint16(1222), uint16(71), uint16(71), uint16(71), uint16(71), uint16(1460), uint16(1491), uint16(936),
- /* 40 */ uint16(818), uint16(451), uint16(6), uint16(121), uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007),
- /* 50 */ uint16(997), uint16(997), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(1541), uint16(390),
- /* 60 */ uint16(1356), uint16(1515), uint16(550), uint16(2), uint16(1191), uint16(194), uint16(526), uint16(434), uint16(143), uint16(291),
- /* 70 */ uint16(526), uint16(136), uint16(526), uint16(369), uint16(261), uint16(502), uint16(272), uint16(383), uint16(1271), uint16(525),
- /* 80 */ uint16(501), uint16(491), uint16(164), uint16(121), uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007),
- /* 90 */ uint16(997), uint16(997), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(1356), uint16(440),
- /* 100 */ uint16(1512), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116),
- /* 110 */ uint16(115), uint16(422), uint16(266), uint16(266), uint16(266), uint16(266), uint16(1496), uint16(356), uint16(1498), uint16(433),
- /* 120 */ uint16(355), uint16(1496), uint16(515), uint16(522), uint16(1483), uint16(541), uint16(1112), uint16(541), uint16(1112), uint16(390),
- /* 130 */ uint16(403), uint16(241), uint16(208), uint16(114), uint16(111), uint16(211), uint16(98), uint16(290), uint16(535), uint16(221),
- /* 140 */ uint16(1027), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116),
- /* 150 */ uint16(115), uint16(422), uint16(1140), uint16(121), uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007),
- /* 160 */ uint16(997), uint16(997), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(404), uint16(426),
- /* 170 */ uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(422), uint16(1416), uint16(466), uint16(123),
+var yy_action = [1962]uint16{
+ /* 0 */ uint16(546), uint16(1222), uint16(546), uint16(451), uint16(1260), uint16(546), uint16(1239), uint16(546), uint16(114), uint16(111),
+ /* 10 */ uint16(211), uint16(546), uint16(1537), uint16(546), uint16(1260), uint16(523), uint16(114), uint16(111), uint16(211), uint16(392),
+ /* 20 */ uint16(1232), uint16(344), uint16(42), uint16(42), uint16(42), uint16(42), uint16(1225), uint16(42), uint16(42), uint16(71),
+ /* 30 */ uint16(71), uint16(937), uint16(1224), uint16(71), uint16(71), uint16(71), uint16(71), uint16(1462), uint16(1493), uint16(938),
+ /* 40 */ uint16(820), uint16(453), uint16(6), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009),
+ /* 50 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(1543), uint16(392),
+ /* 60 */ uint16(1358), uint16(1517), uint16(552), uint16(2), uint16(1193), uint16(194), uint16(528), uint16(436), uint16(143), uint16(291),
+ /* 70 */ uint16(528), uint16(136), uint16(528), uint16(371), uint16(261), uint16(504), uint16(272), uint16(385), uint16(1273), uint16(527),
+ /* 80 */ uint16(503), uint16(493), uint16(164), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009),
+ /* 90 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(1358), uint16(442),
+ /* 100 */ uint16(1514), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116),
+ /* 110 */ uint16(115), uint16(424), uint16(266), uint16(266), uint16(266), uint16(266), uint16(1498), uint16(358), uint16(1500), uint16(435),
+ /* 120 */ uint16(357), uint16(1498), uint16(517), uint16(524), uint16(1485), uint16(543), uint16(1114), uint16(543), uint16(1114), uint16(392),
+ /* 130 */ uint16(405), uint16(241), uint16(208), uint16(114), uint16(111), uint16(211), uint16(98), uint16(290), uint16(537), uint16(221),
+ /* 140 */ uint16(1029), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116),
+ /* 150 */ uint16(115), uint16(424), uint16(1142), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009),
+ /* 160 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(406), uint16(428),
+ /* 170 */ uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(1418), uint16(468), uint16(123),
/* 180 */ uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115),
- /* 190 */ uint16(422), uint16(116), uint16(116), uint16(116), uint16(115), uint16(422), uint16(538), uint16(538), uint16(538), uint16(390),
- /* 200 */ uint16(503), uint16(120), uint16(120), uint16(120), uint16(120), uint16(113), uint16(1049), uint16(1140), uint16(1141), uint16(1142),
- /* 210 */ uint16(1049), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116),
- /* 220 */ uint16(115), uint16(422), uint16(1459), uint16(121), uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007),
- /* 230 */ uint16(997), uint16(997), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(390), uint16(442),
- /* 240 */ uint16(314), uint16(83), uint16(461), uint16(81), uint16(357), uint16(380), uint16(1140), uint16(80), uint16(118), uint16(118),
- /* 250 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(422), uint16(179),
- /* 260 */ uint16(432), uint16(422), uint16(121), uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007), uint16(997),
- /* 270 */ uint16(997), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(432), uint16(431), uint16(266),
+ /* 190 */ uint16(424), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(540), uint16(540), uint16(540), uint16(392),
+ /* 200 */ uint16(505), uint16(120), uint16(120), uint16(120), uint16(120), uint16(113), uint16(1051), uint16(1142), uint16(1143), uint16(1144),
+ /* 210 */ uint16(1051), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116),
+ /* 220 */ uint16(115), uint16(424), uint16(1461), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009),
+ /* 230 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(392), uint16(444),
+ /* 240 */ uint16(316), uint16(83), uint16(463), uint16(81), uint16(359), uint16(382), uint16(1142), uint16(80), uint16(118), uint16(118),
+ /* 250 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(179),
+ /* 260 */ uint16(434), uint16(424), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999),
+ /* 270 */ uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(434), uint16(433), uint16(266),
/* 280 */ uint16(266), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116),
- /* 290 */ uint16(115), uint16(422), uint16(541), uint16(1107), uint16(901), uint16(504), uint16(1140), uint16(114), uint16(111), uint16(211),
- /* 300 */ uint16(1429), uint16(1140), uint16(1141), uint16(1142), uint16(206), uint16(489), uint16(1107), uint16(390), uint16(447), uint16(1107),
- /* 310 */ uint16(543), uint16(328), uint16(120), uint16(120), uint16(120), uint16(120), uint16(298), uint16(1429), uint16(1431), uint16(17),
+ /* 290 */ uint16(115), uint16(424), uint16(543), uint16(1109), uint16(903), uint16(506), uint16(1142), uint16(114), uint16(111), uint16(211),
+ /* 300 */ uint16(1431), uint16(1142), uint16(1143), uint16(1144), uint16(206), uint16(491), uint16(1109), uint16(392), uint16(449), uint16(1109),
+ /* 310 */ uint16(545), uint16(330), uint16(120), uint16(120), uint16(120), uint16(120), uint16(298), uint16(1431), uint16(1433), uint16(17),
/* 320 */ uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115),
- /* 330 */ uint16(422), uint16(121), uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007), uint16(997), uint16(997),
- /* 340 */ uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(390), uint16(1356), uint16(432), uint16(1140),
- /* 350 */ uint16(480), uint16(1140), uint16(1141), uint16(1142), uint16(994), uint16(994), uint16(1005), uint16(1008), uint16(443), uint16(118),
- /* 360 */ uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(422),
- /* 370 */ uint16(121), uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007), uint16(997), uint16(997), uint16(119),
- /* 380 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(1052), uint16(1052), uint16(463), uint16(1429), uint16(118),
- /* 390 */ uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(422),
- /* 400 */ uint16(1140), uint16(449), uint16(544), uint16(1424), uint16(1140), uint16(1141), uint16(1142), uint16(233), uint16(964), uint16(1140),
- /* 410 */ uint16(479), uint16(476), uint16(475), uint16(171), uint16(358), uint16(390), uint16(164), uint16(405), uint16(412), uint16(840),
- /* 420 */ uint16(474), uint16(164), uint16(185), uint16(332), uint16(71), uint16(71), uint16(1241), uint16(998), uint16(118), uint16(118),
- /* 430 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(422), uint16(121),
- /* 440 */ uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007), uint16(997), uint16(997), uint16(119), uint16(119),
- /* 450 */ uint16(120), uint16(120), uint16(120), uint16(120), uint16(390), uint16(1140), uint16(1141), uint16(1142), uint16(833), uint16(12),
- /* 460 */ uint16(313), uint16(507), uint16(163), uint16(354), uint16(1140), uint16(1141), uint16(1142), uint16(114), uint16(111), uint16(211),
- /* 470 */ uint16(506), uint16(290), uint16(535), uint16(544), uint16(276), uint16(180), uint16(290), uint16(535), uint16(121), uint16(122),
- /* 480 */ uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007), uint16(997), uint16(997), uint16(119), uint16(119), uint16(120),
- /* 490 */ uint16(120), uint16(120), uint16(120), uint16(343), uint16(482), uint16(71), uint16(71), uint16(118), uint16(118), uint16(118),
- /* 500 */ uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(422), uint16(1140), uint16(209),
- /* 510 */ uint16(409), uint16(521), uint16(1140), uint16(1107), uint16(1569), uint16(376), uint16(252), uint16(269), uint16(340), uint16(485),
- /* 520 */ uint16(335), uint16(484), uint16(238), uint16(390), uint16(511), uint16(362), uint16(1107), uint16(1125), uint16(331), uint16(1107),
- /* 530 */ uint16(191), uint16(407), uint16(286), uint16(32), uint16(455), uint16(441), uint16(118), uint16(118), uint16(118), uint16(118),
- /* 540 */ uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(422), uint16(121), uint16(122), uint16(112),
- /* 550 */ uint16(1163), uint16(1163), uint16(1004), uint16(1007), uint16(997), uint16(997), uint16(119), uint16(119), uint16(120), uint16(120),
- /* 560 */ uint16(120), uint16(120), uint16(390), uint16(1140), uint16(1141), uint16(1142), uint16(985), uint16(1140), uint16(1141), uint16(1142),
- /* 570 */ uint16(1140), uint16(233), uint16(490), uint16(1490), uint16(479), uint16(476), uint16(475), uint16(6), uint16(163), uint16(544),
- /* 580 */ uint16(510), uint16(544), uint16(115), uint16(422), uint16(474), uint16(5), uint16(121), uint16(122), uint16(112), uint16(1163),
- /* 590 */ uint16(1163), uint16(1004), uint16(1007), uint16(997), uint16(997), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120),
+ /* 330 */ uint16(424), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999),
+ /* 340 */ uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(392), uint16(1358), uint16(434), uint16(1142),
+ /* 350 */ uint16(482), uint16(1142), uint16(1143), uint16(1144), uint16(996), uint16(996), uint16(1007), uint16(1010), uint16(445), uint16(118),
+ /* 360 */ uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424),
+ /* 370 */ uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119),
+ /* 380 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(1054), uint16(1054), uint16(465), uint16(1431), uint16(118),
+ /* 390 */ uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424),
+ /* 400 */ uint16(1142), uint16(451), uint16(546), uint16(1426), uint16(1142), uint16(1143), uint16(1144), uint16(233), uint16(966), uint16(1142),
+ /* 410 */ uint16(481), uint16(478), uint16(477), uint16(171), uint16(360), uint16(392), uint16(164), uint16(407), uint16(414), uint16(842),
+ /* 420 */ uint16(476), uint16(164), uint16(185), uint16(334), uint16(71), uint16(71), uint16(1243), uint16(1000), uint16(118), uint16(118),
+ /* 430 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(121),
+ /* 440 */ uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119),
+ /* 450 */ uint16(120), uint16(120), uint16(120), uint16(120), uint16(392), uint16(1142), uint16(1143), uint16(1144), uint16(835), uint16(12),
+ /* 460 */ uint16(314), uint16(509), uint16(163), uint16(356), uint16(1142), uint16(1143), uint16(1144), uint16(114), uint16(111), uint16(211),
+ /* 470 */ uint16(508), uint16(290), uint16(537), uint16(546), uint16(276), uint16(180), uint16(290), uint16(537), uint16(121), uint16(122),
+ /* 480 */ uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120),
+ /* 490 */ uint16(120), uint16(120), uint16(120), uint16(345), uint16(484), uint16(71), uint16(71), uint16(118), uint16(118), uint16(118),
+ /* 500 */ uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(1142), uint16(209),
+ /* 510 */ uint16(411), uint16(523), uint16(1142), uint16(1109), uint16(1571), uint16(378), uint16(252), uint16(269), uint16(342), uint16(487),
+ /* 520 */ uint16(337), uint16(486), uint16(238), uint16(392), uint16(513), uint16(364), uint16(1109), uint16(1127), uint16(333), uint16(1109),
+ /* 530 */ uint16(191), uint16(409), uint16(286), uint16(32), uint16(457), uint16(443), uint16(118), uint16(118), uint16(118), uint16(118),
+ /* 540 */ uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(121), uint16(122), uint16(112),
+ /* 550 */ uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120),
+ /* 560 */ uint16(120), uint16(120), uint16(392), uint16(1142), uint16(1143), uint16(1144), uint16(987), uint16(1142), uint16(1143), uint16(1144),
+ /* 570 */ uint16(1142), uint16(233), uint16(492), uint16(1492), uint16(481), uint16(478), uint16(477), uint16(6), uint16(163), uint16(546),
+ /* 580 */ uint16(512), uint16(546), uint16(115), uint16(424), uint16(476), uint16(5), uint16(121), uint16(122), uint16(112), uint16(1165),
+ /* 590 */ uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120),
/* 600 */ uint16(120), uint16(13), uint16(13), uint16(13), uint16(13), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117),
- /* 610 */ uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(422), uint16(401), uint16(500), uint16(406), uint16(544),
- /* 620 */ uint16(1484), uint16(542), uint16(1140), uint16(890), uint16(890), uint16(1140), uint16(1141), uint16(1142), uint16(1471), uint16(1140),
- /* 630 */ uint16(275), uint16(390), uint16(806), uint16(807), uint16(808), uint16(969), uint16(420), uint16(420), uint16(420), uint16(16),
- /* 640 */ uint16(16), uint16(55), uint16(55), uint16(1240), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117),
- /* 650 */ uint16(116), uint16(116), uint16(116), uint16(115), uint16(422), uint16(121), uint16(122), uint16(112), uint16(1163), uint16(1163),
- /* 660 */ uint16(1004), uint16(1007), uint16(997), uint16(997), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120),
- /* 670 */ uint16(390), uint16(1187), uint16(1), uint16(1), uint16(550), uint16(2), uint16(1191), uint16(1140), uint16(1141), uint16(1142),
- /* 680 */ uint16(194), uint16(291), uint16(896), uint16(136), uint16(1140), uint16(1141), uint16(1142), uint16(895), uint16(519), uint16(1490),
- /* 690 */ uint16(1271), uint16(3), uint16(378), uint16(6), uint16(121), uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004),
- /* 700 */ uint16(1007), uint16(997), uint16(997), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(856),
- /* 710 */ uint16(544), uint16(922), uint16(544), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116),
- /* 720 */ uint16(116), uint16(116), uint16(115), uint16(422), uint16(266), uint16(266), uint16(1090), uint16(1567), uint16(1140), uint16(549),
- /* 730 */ uint16(1567), uint16(1191), uint16(13), uint16(13), uint16(13), uint16(13), uint16(291), uint16(541), uint16(136), uint16(390),
- /* 740 */ uint16(483), uint16(419), uint16(418), uint16(964), uint16(342), uint16(1271), uint16(466), uint16(408), uint16(857), uint16(279),
+ /* 610 */ uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(403), uint16(502), uint16(408), uint16(546),
+ /* 620 */ uint16(1486), uint16(544), uint16(1142), uint16(892), uint16(892), uint16(1142), uint16(1143), uint16(1144), uint16(1473), uint16(1142),
+ /* 630 */ uint16(275), uint16(392), uint16(808), uint16(809), uint16(810), uint16(971), uint16(422), uint16(422), uint16(422), uint16(16),
+ /* 640 */ uint16(16), uint16(55), uint16(55), uint16(1242), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117),
+ /* 650 */ uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165),
+ /* 660 */ uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120),
+ /* 670 */ uint16(392), uint16(1189), uint16(1), uint16(1), uint16(552), uint16(2), uint16(1193), uint16(1142), uint16(1143), uint16(1144),
+ /* 680 */ uint16(194), uint16(291), uint16(898), uint16(136), uint16(1142), uint16(1143), uint16(1144), uint16(897), uint16(521), uint16(1492),
+ /* 690 */ uint16(1273), uint16(3), uint16(380), uint16(6), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006),
+ /* 700 */ uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(858),
+ /* 710 */ uint16(546), uint16(924), uint16(546), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116),
+ /* 720 */ uint16(116), uint16(116), uint16(115), uint16(424), uint16(266), uint16(266), uint16(1092), uint16(1569), uint16(1142), uint16(551),
+ /* 730 */ uint16(1569), uint16(1193), uint16(13), uint16(13), uint16(13), uint16(13), uint16(291), uint16(543), uint16(136), uint16(392),
+ /* 740 */ uint16(485), uint16(421), uint16(420), uint16(966), uint16(344), uint16(1273), uint16(468), uint16(410), uint16(859), uint16(279),
/* 750 */ uint16(140), uint16(221), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116),
- /* 760 */ uint16(116), uint16(115), uint16(422), uint16(121), uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007),
- /* 770 */ uint16(997), uint16(997), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(544), uint16(266),
- /* 780 */ uint16(266), uint16(426), uint16(390), uint16(1140), uint16(1141), uint16(1142), uint16(1170), uint16(828), uint16(1170), uint16(466),
- /* 790 */ uint16(429), uint16(145), uint16(541), uint16(1144), uint16(399), uint16(313), uint16(437), uint16(301), uint16(836), uint16(1488),
- /* 800 */ uint16(71), uint16(71), uint16(410), uint16(6), uint16(1088), uint16(471), uint16(221), uint16(100), uint16(112), uint16(1163),
- /* 810 */ uint16(1163), uint16(1004), uint16(1007), uint16(997), uint16(997), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120),
+ /* 760 */ uint16(116), uint16(115), uint16(424), uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009),
+ /* 770 */ uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(546), uint16(266),
+ /* 780 */ uint16(266), uint16(428), uint16(392), uint16(1142), uint16(1143), uint16(1144), uint16(1172), uint16(830), uint16(1172), uint16(468),
+ /* 790 */ uint16(431), uint16(145), uint16(543), uint16(1146), uint16(401), uint16(314), uint16(439), uint16(302), uint16(838), uint16(1490),
+ /* 800 */ uint16(71), uint16(71), uint16(412), uint16(6), uint16(1090), uint16(473), uint16(221), uint16(100), uint16(112), uint16(1165),
+ /* 810 */ uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120),
/* 820 */ uint16(120), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116),
- /* 830 */ uint16(115), uint16(422), uint16(237), uint16(1423), uint16(544), uint16(449), uint16(426), uint16(287), uint16(984), uint16(544),
- /* 840 */ uint16(236), uint16(235), uint16(234), uint16(828), uint16(97), uint16(527), uint16(427), uint16(1263), uint16(1263), uint16(1144),
- /* 850 */ uint16(492), uint16(306), uint16(428), uint16(836), uint16(975), uint16(544), uint16(71), uint16(71), uint16(974), uint16(1239),
- /* 860 */ uint16(544), uint16(51), uint16(51), uint16(300), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117),
- /* 870 */ uint16(116), uint16(116), uint16(116), uint16(115), uint16(422), uint16(194), uint16(103), uint16(70), uint16(70), uint16(266),
- /* 880 */ uint16(266), uint16(544), uint16(71), uint16(71), uint16(266), uint16(266), uint16(30), uint16(389), uint16(342), uint16(974),
- /* 890 */ uint16(974), uint16(976), uint16(541), uint16(526), uint16(1107), uint16(326), uint16(390), uint16(541), uint16(493), uint16(395),
- /* 900 */ uint16(1468), uint16(195), uint16(528), uint16(13), uint16(13), uint16(1356), uint16(240), uint16(1107), uint16(277), uint16(280),
- /* 910 */ uint16(1107), uint16(280), uint16(303), uint16(455), uint16(305), uint16(331), uint16(390), uint16(31), uint16(188), uint16(417),
- /* 920 */ uint16(121), uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007), uint16(997), uint16(997), uint16(119),
- /* 930 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(142), uint16(390), uint16(363), uint16(455), uint16(984),
- /* 940 */ uint16(121), uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007), uint16(997), uint16(997), uint16(119),
- /* 950 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(975), uint16(321), uint16(1140), uint16(324), uint16(974),
- /* 960 */ uint16(121), uint16(110), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007), uint16(997), uint16(997), uint16(119),
- /* 970 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(462), uint16(375), uint16(1183), uint16(118), uint16(118),
- /* 980 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(422), uint16(1140),
- /* 990 */ uint16(974), uint16(974), uint16(976), uint16(304), uint16(9), uint16(364), uint16(244), uint16(360), uint16(118), uint16(118),
- /* 1000 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(422), uint16(312),
- /* 1010 */ uint16(544), uint16(342), uint16(1140), uint16(1141), uint16(1142), uint16(299), uint16(290), uint16(535), uint16(118), uint16(118),
- /* 1020 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(422), uint16(1261),
- /* 1030 */ uint16(1261), uint16(1161), uint16(13), uint16(13), uint16(278), uint16(419), uint16(418), uint16(466), uint16(390), uint16(921),
- /* 1040 */ uint16(260), uint16(260), uint16(289), uint16(1167), uint16(1140), uint16(1141), uint16(1142), uint16(189), uint16(1169), uint16(266),
- /* 1050 */ uint16(266), uint16(466), uint16(388), uint16(541), uint16(1184), uint16(544), uint16(1168), uint16(263), uint16(144), uint16(487),
- /* 1060 */ uint16(920), uint16(544), uint16(541), uint16(122), uint16(112), uint16(1163), uint16(1163), uint16(1004), uint16(1007), uint16(997),
- /* 1070 */ uint16(997), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(71), uint16(71), uint16(1140),
- /* 1080 */ uint16(1170), uint16(1270), uint16(1170), uint16(13), uint16(13), uint16(896), uint16(1068), uint16(1161), uint16(544), uint16(466),
- /* 1090 */ uint16(895), uint16(107), uint16(536), uint16(1489), uint16(4), uint16(1266), uint16(1107), uint16(6), uint16(523), uint16(1047),
- /* 1100 */ uint16(12), uint16(1069), uint16(1090), uint16(1568), uint16(311), uint16(453), uint16(1568), uint16(518), uint16(539), uint16(1107),
- /* 1110 */ uint16(56), uint16(56), uint16(1107), uint16(1487), uint16(421), uint16(1356), uint16(1070), uint16(6), uint16(343), uint16(285),
+ /* 830 */ uint16(115), uint16(424), uint16(237), uint16(1425), uint16(546), uint16(451), uint16(428), uint16(287), uint16(986), uint16(546),
+ /* 840 */ uint16(236), uint16(235), uint16(234), uint16(830), uint16(97), uint16(529), uint16(429), uint16(1265), uint16(1265), uint16(1146),
+ /* 850 */ uint16(494), uint16(307), uint16(430), uint16(838), uint16(977), uint16(546), uint16(71), uint16(71), uint16(976), uint16(1241),
+ /* 860 */ uint16(546), uint16(51), uint16(51), uint16(300), uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117),
+ /* 870 */ uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(194), uint16(103), uint16(70), uint16(70), uint16(266),
+ /* 880 */ uint16(266), uint16(546), uint16(71), uint16(71), uint16(266), uint16(266), uint16(30), uint16(391), uint16(344), uint16(976),
+ /* 890 */ uint16(976), uint16(978), uint16(543), uint16(528), uint16(1109), uint16(328), uint16(392), uint16(543), uint16(495), uint16(397),
+ /* 900 */ uint16(1470), uint16(195), uint16(530), uint16(13), uint16(13), uint16(1358), uint16(240), uint16(1109), uint16(277), uint16(280),
+ /* 910 */ uint16(1109), uint16(280), uint16(304), uint16(457), uint16(306), uint16(333), uint16(392), uint16(31), uint16(188), uint16(419),
+ /* 920 */ uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119),
+ /* 930 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(142), uint16(392), uint16(365), uint16(457), uint16(986),
+ /* 940 */ uint16(121), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119),
+ /* 950 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(977), uint16(323), uint16(1142), uint16(326), uint16(976),
+ /* 960 */ uint16(121), uint16(110), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999), uint16(999), uint16(119),
+ /* 970 */ uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(464), uint16(377), uint16(1185), uint16(118), uint16(118),
+ /* 980 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(1142),
+ /* 990 */ uint16(976), uint16(976), uint16(978), uint16(305), uint16(9), uint16(366), uint16(244), uint16(362), uint16(118), uint16(118),
+ /* 1000 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(313),
+ /* 1010 */ uint16(546), uint16(344), uint16(1142), uint16(1143), uint16(1144), uint16(299), uint16(290), uint16(537), uint16(118), uint16(118),
+ /* 1020 */ uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115), uint16(424), uint16(1263),
+ /* 1030 */ uint16(1263), uint16(1163), uint16(13), uint16(13), uint16(278), uint16(421), uint16(420), uint16(468), uint16(392), uint16(923),
+ /* 1040 */ uint16(260), uint16(260), uint16(289), uint16(1169), uint16(1142), uint16(1143), uint16(1144), uint16(189), uint16(1171), uint16(266),
+ /* 1050 */ uint16(266), uint16(468), uint16(390), uint16(543), uint16(1186), uint16(546), uint16(1170), uint16(263), uint16(144), uint16(489),
+ /* 1060 */ uint16(922), uint16(546), uint16(543), uint16(122), uint16(112), uint16(1165), uint16(1165), uint16(1006), uint16(1009), uint16(999),
+ /* 1070 */ uint16(999), uint16(119), uint16(119), uint16(120), uint16(120), uint16(120), uint16(120), uint16(71), uint16(71), uint16(1142),
+ /* 1080 */ uint16(1172), uint16(1272), uint16(1172), uint16(13), uint16(13), uint16(898), uint16(1070), uint16(1163), uint16(546), uint16(468),
+ /* 1090 */ uint16(897), uint16(107), uint16(538), uint16(1491), uint16(4), uint16(1268), uint16(1109), uint16(6), uint16(525), uint16(1049),
+ /* 1100 */ uint16(12), uint16(1071), uint16(1092), uint16(1570), uint16(312), uint16(455), uint16(1570), uint16(520), uint16(541), uint16(1109),
+ /* 1110 */ uint16(56), uint16(56), uint16(1109), uint16(1489), uint16(423), uint16(1358), uint16(1072), uint16(6), uint16(345), uint16(285),
/* 1120 */ uint16(118), uint16(118), uint16(118), uint16(118), uint16(117), uint16(117), uint16(116), uint16(116), uint16(116), uint16(115),
- /* 1130 */ uint16(422), uint16(423), uint16(1269), uint16(319), uint16(1140), uint16(1141), uint16(1142), uint16(876), uint16(266), uint16(266),
- /* 1140 */ uint16(1275), uint16(107), uint16(536), uint16(533), uint16(4), uint16(1486), uint16(293), uint16(877), uint16(1209), uint16(6),
- /* 1150 */ uint16(210), uint16(541), uint16(541), uint16(164), uint16(1540), uint16(494), uint16(414), uint16(865), uint16(539), uint16(267),
- /* 1160 */ uint16(267), uint16(1212), uint16(396), uint16(509), uint16(497), uint16(204), uint16(266), uint16(266), uint16(394), uint16(529),
- /* 1170 */ uint16(8), uint16(984), uint16(541), uint16(517), uint16(544), uint16(920), uint16(456), uint16(105), uint16(105), uint16(541),
- /* 1180 */ uint16(1088), uint16(423), uint16(266), uint16(266), uint16(106), uint16(415), uint16(423), uint16(546), uint16(545), uint16(266),
- /* 1190 */ uint16(266), uint16(974), uint16(516), uint16(533), uint16(1371), uint16(541), uint16(15), uint16(15), uint16(266), uint16(266),
- /* 1200 */ uint16(454), uint16(1118), uint16(541), uint16(266), uint16(266), uint16(1068), uint16(1370), uint16(513), uint16(290), uint16(535),
- /* 1210 */ uint16(544), uint16(541), uint16(512), uint16(97), uint16(442), uint16(314), uint16(541), uint16(544), uint16(920), uint16(125),
- /* 1220 */ uint16(1069), uint16(984), uint16(974), uint16(974), uint16(976), uint16(977), uint16(27), uint16(105), uint16(105), uint16(399),
- /* 1230 */ uint16(341), uint16(1509), uint16(44), uint16(44), uint16(106), uint16(1070), uint16(423), uint16(546), uint16(545), uint16(57),
- /* 1240 */ uint16(57), uint16(974), uint16(341), uint16(1509), uint16(107), uint16(536), uint16(544), uint16(4), uint16(460), uint16(399),
- /* 1250 */ uint16(214), uint16(1118), uint16(457), uint16(294), uint16(375), uint16(1089), uint16(532), uint16(297), uint16(544), uint16(537),
- /* 1260 */ uint16(396), uint16(539), uint16(290), uint16(535), uint16(104), uint16(244), uint16(102), uint16(524), uint16(58), uint16(58),
- /* 1270 */ uint16(544), uint16(109), uint16(974), uint16(974), uint16(976), uint16(977), uint16(27), uint16(1514), uint16(1129), uint16(425),
- /* 1280 */ uint16(59), uint16(59), uint16(270), uint16(237), uint16(423), uint16(138), uint16(95), uint16(373), uint16(373), uint16(372),
- /* 1290 */ uint16(255), uint16(370), uint16(60), uint16(60), uint16(815), uint16(1178), uint16(533), uint16(544), uint16(273), uint16(544),
- /* 1300 */ uint16(1161), uint16(843), uint16(387), uint16(386), uint16(544), uint16(1307), uint16(544), uint16(215), uint16(210), uint16(296),
- /* 1310 */ uint16(513), uint16(847), uint16(544), uint16(265), uint16(208), uint16(514), uint16(1306), uint16(295), uint16(274), uint16(61),
- /* 1320 */ uint16(61), uint16(62), uint16(62), uint16(436), uint16(984), uint16(1160), uint16(45), uint16(45), uint16(46), uint16(46),
- /* 1330 */ uint16(105), uint16(105), uint16(1184), uint16(920), uint16(47), uint16(47), uint16(1474), uint16(106), uint16(544), uint16(423),
- /* 1340 */ uint16(546), uint16(545), uint16(218), uint16(544), uint16(974), uint16(935), uint16(1085), uint16(217), uint16(544), uint16(377),
- /* 1350 */ uint16(395), uint16(107), uint16(536), uint16(936), uint16(4), uint16(156), uint16(1161), uint16(843), uint16(158), uint16(544),
- /* 1360 */ uint16(49), uint16(49), uint16(141), uint16(544), uint16(38), uint16(50), uint16(50), uint16(544), uint16(539), uint16(307),
- /* 1370 */ uint16(63), uint16(63), uint16(544), uint16(1448), uint16(216), uint16(974), uint16(974), uint16(976), uint16(977), uint16(27),
- /* 1380 */ uint16(444), uint16(64), uint16(64), uint16(544), uint16(1447), uint16(65), uint16(65), uint16(544), uint16(524), uint16(14),
- /* 1390 */ uint16(14), uint16(423), uint16(458), uint16(544), uint16(66), uint16(66), uint16(310), uint16(544), uint16(316), uint16(97),
- /* 1400 */ uint16(1034), uint16(544), uint16(961), uint16(533), uint16(268), uint16(127), uint16(127), uint16(544), uint16(391), uint16(67),
- /* 1410 */ uint16(67), uint16(544), uint16(978), uint16(290), uint16(535), uint16(52), uint16(52), uint16(513), uint16(544), uint16(68),
- /* 1420 */ uint16(68), uint16(1294), uint16(512), uint16(69), uint16(69), uint16(397), uint16(165), uint16(855), uint16(854), uint16(53),
- /* 1430 */ uint16(53), uint16(984), uint16(966), uint16(151), uint16(151), uint16(243), uint16(430), uint16(105), uint16(105), uint16(199),
- /* 1440 */ uint16(152), uint16(152), uint16(448), uint16(1303), uint16(106), uint16(243), uint16(423), uint16(546), uint16(545), uint16(1129),
- /* 1450 */ uint16(425), uint16(974), uint16(320), uint16(270), uint16(862), uint16(863), uint16(1034), uint16(220), uint16(373), uint16(373),
- /* 1460 */ uint16(372), uint16(255), uint16(370), uint16(450), uint16(323), uint16(815), uint16(243), uint16(544), uint16(978), uint16(544),
- /* 1470 */ uint16(107), uint16(536), uint16(544), uint16(4), uint16(544), uint16(938), uint16(939), uint16(325), uint16(215), uint16(1046),
- /* 1480 */ uint16(296), uint16(1046), uint16(974), uint16(974), uint16(976), uint16(977), uint16(27), uint16(539), uint16(295), uint16(76),
- /* 1490 */ uint16(76), uint16(54), uint16(54), uint16(327), uint16(72), uint16(72), uint16(128), uint16(128), uint16(1503), uint16(1254),
- /* 1500 */ uint16(107), uint16(536), uint16(544), uint16(4), uint16(1045), uint16(544), uint16(1045), uint16(531), uint16(1238), uint16(544),
- /* 1510 */ uint16(423), uint16(544), uint16(315), uint16(334), uint16(544), uint16(97), uint16(544), uint16(539), uint16(217), uint16(544),
- /* 1520 */ uint16(472), uint16(1528), uint16(533), uint16(239), uint16(73), uint16(73), uint16(156), uint16(129), uint16(129), uint16(158),
- /* 1530 */ uint16(467), uint16(130), uint16(130), uint16(126), uint16(126), uint16(344), uint16(150), uint16(150), uint16(149), uint16(149),
- /* 1540 */ uint16(423), uint16(134), uint16(134), uint16(329), uint16(1030), uint16(216), uint16(97), uint16(239), uint16(929), uint16(345),
- /* 1550 */ uint16(984), uint16(243), uint16(533), uint16(1315), uint16(339), uint16(544), uint16(105), uint16(105), uint16(900), uint16(1355),
- /* 1560 */ uint16(544), uint16(1290), uint16(258), uint16(106), uint16(338), uint16(423), uint16(546), uint16(545), uint16(544), uint16(1301),
- /* 1570 */ uint16(974), uint16(893), uint16(99), uint16(536), uint16(109), uint16(4), uint16(544), uint16(133), uint16(133), uint16(391),
- /* 1580 */ uint16(984), uint16(197), uint16(131), uint16(131), uint16(290), uint16(535), uint16(105), uint16(105), uint16(530), uint16(539),
- /* 1590 */ uint16(132), uint16(132), uint16(1361), uint16(106), uint16(1219), uint16(423), uint16(546), uint16(545), uint16(75), uint16(75),
- /* 1600 */ uint16(974), uint16(974), uint16(974), uint16(976), uint16(977), uint16(27), uint16(544), uint16(430), uint16(826), uint16(1211),
- /* 1610 */ uint16(894), uint16(139), uint16(423), uint16(109), uint16(544), uint16(1200), uint16(1199), uint16(1201), uint16(1522), uint16(544),
- /* 1620 */ uint16(201), uint16(544), uint16(11), uint16(374), uint16(533), uint16(1287), uint16(347), uint16(349), uint16(77), uint16(77),
- /* 1630 */ uint16(1340), uint16(974), uint16(974), uint16(976), uint16(977), uint16(27), uint16(74), uint16(74), uint16(351), uint16(213),
- /* 1640 */ uint16(435), uint16(43), uint16(43), uint16(48), uint16(48), uint16(302), uint16(477), uint16(309), uint16(1348), uint16(382),
- /* 1650 */ uint16(353), uint16(452), uint16(984), uint16(337), uint16(1237), uint16(1420), uint16(1419), uint16(205), uint16(105), uint16(105),
- /* 1660 */ uint16(192), uint16(367), uint16(193), uint16(534), uint16(1525), uint16(106), uint16(1178), uint16(423), uint16(546), uint16(545),
- /* 1670 */ uint16(247), uint16(167), uint16(974), uint16(270), uint16(1467), uint16(200), uint16(1465), uint16(1175), uint16(373), uint16(373),
- /* 1680 */ uint16(372), uint16(255), uint16(370), uint16(398), uint16(79), uint16(815), uint16(83), uint16(82), uint16(1425), uint16(446),
- /* 1690 */ uint16(161), uint16(177), uint16(169), uint16(95), uint16(1337), uint16(438), uint16(172), uint16(173), uint16(215), uint16(174),
- /* 1700 */ uint16(296), uint16(175), uint16(35), uint16(974), uint16(974), uint16(976), uint16(977), uint16(27), uint16(295), uint16(1345),
- /* 1710 */ uint16(439), uint16(470), uint16(223), uint16(36), uint16(379), uint16(445), uint16(1414), uint16(381), uint16(459), uint16(1351),
- /* 1720 */ uint16(181), uint16(227), uint16(88), uint16(465), uint16(259), uint16(229), uint16(1436), uint16(318), uint16(186), uint16(468),
- /* 1730 */ uint16(322), uint16(230), uint16(384), uint16(1202), uint16(231), uint16(486), uint16(1257), uint16(1256), uint16(217), uint16(411),
- /* 1740 */ uint16(1255), uint16(1248), uint16(90), uint16(847), uint16(206), uint16(413), uint16(156), uint16(505), uint16(1539), uint16(158),
- /* 1750 */ uint16(1226), uint16(1538), uint16(283), uint16(1508), uint16(1227), uint16(336), uint16(385), uint16(284), uint16(1225), uint16(496),
- /* 1760 */ uint16(1537), uint16(1298), uint16(94), uint16(346), uint16(348), uint16(216), uint16(1247), uint16(499), uint16(1299), uint16(245),
- /* 1770 */ uint16(246), uint16(1297), uint16(416), uint16(350), uint16(1494), uint16(124), uint16(1493), uint16(10), uint16(524), uint16(361),
- /* 1780 */ uint16(1400), uint16(101), uint16(96), uint16(288), uint16(508), uint16(253), uint16(1135), uint16(1208), uint16(34), uint16(1296),
- /* 1790 */ uint16(547), uint16(254), uint16(256), uint16(257), uint16(392), uint16(548), uint16(1197), uint16(1192), uint16(359), uint16(391),
- /* 1800 */ uint16(1280), uint16(1279), uint16(196), uint16(365), uint16(290), uint16(535), uint16(366), uint16(352), uint16(1452), uint16(1322),
- /* 1810 */ uint16(1321), uint16(1453), uint16(153), uint16(137), uint16(281), uint16(154), uint16(802), uint16(424), uint16(155), uint16(1451),
- /* 1820 */ uint16(1450), uint16(198), uint16(292), uint16(202), uint16(203), uint16(78), uint16(212), uint16(430), uint16(271), uint16(135),
- /* 1830 */ uint16(1044), uint16(1042), uint16(958), uint16(168), uint16(219), uint16(157), uint16(170), uint16(879), uint16(308), uint16(222),
- /* 1840 */ uint16(1058), uint16(176), uint16(159), uint16(962), uint16(400), uint16(84), uint16(402), uint16(178), uint16(85), uint16(86),
- /* 1850 */ uint16(87), uint16(166), uint16(160), uint16(393), uint16(1061), uint16(224), uint16(225), uint16(1057), uint16(146), uint16(18),
- /* 1860 */ uint16(226), uint16(317), uint16(1050), uint16(1172), uint16(243), uint16(464), uint16(182), uint16(228), uint16(37), uint16(183),
- /* 1870 */ uint16(817), uint16(469), uint16(338), uint16(232), uint16(330), uint16(481), uint16(184), uint16(89), uint16(845), uint16(19),
- /* 1880 */ uint16(20), uint16(92), uint16(473), uint16(478), uint16(333), uint16(91), uint16(162), uint16(858), uint16(147), uint16(488),
- /* 1890 */ uint16(282), uint16(1123), uint16(148), uint16(1010), uint16(928), uint16(1093), uint16(39), uint16(93), uint16(40), uint16(495),
- /* 1900 */ uint16(1094), uint16(187), uint16(498), uint16(207), uint16(262), uint16(264), uint16(923), uint16(242), uint16(1109), uint16(109),
- /* 1910 */ uint16(1113), uint16(1111), uint16(1097), uint16(33), uint16(21), uint16(1117), uint16(520), uint16(1025), uint16(22), uint16(23),
- /* 1920 */ uint16(24), uint16(1116), uint16(25), uint16(190), uint16(97), uint16(1011), uint16(1009), uint16(26), uint16(1013), uint16(1067),
- /* 1930 */ uint16(248), uint16(7), uint16(1066), uint16(249), uint16(1014), uint16(28), uint16(41), uint16(889), uint16(979), uint16(827),
- /* 1940 */ uint16(108), uint16(29), uint16(250), uint16(540), uint16(251), uint16(1530), uint16(371), uint16(368), uint16(1131), uint16(1130),
- /* 1950 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1529),
-} /* sqlite3.c:153937:27 */
-var yy_lookahead = [2139]uint16{
+ /* 1130 */ uint16(424), uint16(425), uint16(1271), uint16(321), uint16(1142), uint16(1143), uint16(1144), uint16(878), uint16(266), uint16(266),
+ /* 1140 */ uint16(1277), uint16(107), uint16(538), uint16(535), uint16(4), uint16(1488), uint16(293), uint16(879), uint16(1211), uint16(6),
+ /* 1150 */ uint16(210), uint16(543), uint16(543), uint16(164), uint16(294), uint16(496), uint16(416), uint16(204), uint16(541), uint16(267),
+ /* 1160 */ uint16(267), uint16(1214), uint16(398), uint16(511), uint16(499), uint16(204), uint16(266), uint16(266), uint16(396), uint16(531),
+ /* 1170 */ uint16(8), uint16(986), uint16(543), uint16(519), uint16(546), uint16(922), uint16(458), uint16(105), uint16(105), uint16(543),
+ /* 1180 */ uint16(1090), uint16(425), uint16(266), uint16(266), uint16(106), uint16(417), uint16(425), uint16(548), uint16(547), uint16(266),
+ /* 1190 */ uint16(266), uint16(976), uint16(518), uint16(535), uint16(1373), uint16(543), uint16(15), uint16(15), uint16(266), uint16(266),
+ /* 1200 */ uint16(456), uint16(1120), uint16(543), uint16(266), uint16(266), uint16(1070), uint16(1372), uint16(515), uint16(290), uint16(537),
+ /* 1210 */ uint16(546), uint16(543), uint16(514), uint16(97), uint16(444), uint16(316), uint16(543), uint16(546), uint16(922), uint16(125),
+ /* 1220 */ uint16(1071), uint16(986), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(105), uint16(105), uint16(401),
+ /* 1230 */ uint16(343), uint16(1511), uint16(44), uint16(44), uint16(106), uint16(1072), uint16(425), uint16(548), uint16(547), uint16(57),
+ /* 1240 */ uint16(57), uint16(976), uint16(343), uint16(1511), uint16(107), uint16(538), uint16(546), uint16(4), uint16(462), uint16(401),
+ /* 1250 */ uint16(214), uint16(1120), uint16(459), uint16(297), uint16(377), uint16(1091), uint16(534), uint16(1309), uint16(546), uint16(539),
+ /* 1260 */ uint16(398), uint16(541), uint16(290), uint16(537), uint16(104), uint16(244), uint16(102), uint16(526), uint16(58), uint16(58),
+ /* 1270 */ uint16(546), uint16(199), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(1516), uint16(1131), uint16(427),
+ /* 1280 */ uint16(59), uint16(59), uint16(270), uint16(237), uint16(425), uint16(138), uint16(95), uint16(375), uint16(375), uint16(374),
+ /* 1290 */ uint16(255), uint16(372), uint16(60), uint16(60), uint16(817), uint16(1180), uint16(535), uint16(546), uint16(273), uint16(546),
+ /* 1300 */ uint16(1163), uint16(1308), uint16(389), uint16(388), uint16(546), uint16(438), uint16(546), uint16(215), uint16(210), uint16(296),
+ /* 1310 */ uint16(515), uint16(849), uint16(546), uint16(265), uint16(208), uint16(516), uint16(1476), uint16(295), uint16(274), uint16(61),
+ /* 1320 */ uint16(61), uint16(62), uint16(62), uint16(308), uint16(986), uint16(109), uint16(45), uint16(45), uint16(46), uint16(46),
+ /* 1330 */ uint16(105), uint16(105), uint16(1186), uint16(922), uint16(47), uint16(47), uint16(341), uint16(106), uint16(546), uint16(425),
+ /* 1340 */ uint16(548), uint16(547), uint16(1542), uint16(546), uint16(976), uint16(867), uint16(340), uint16(217), uint16(546), uint16(937),
+ /* 1350 */ uint16(397), uint16(107), uint16(538), uint16(218), uint16(4), uint16(156), uint16(1163), uint16(938), uint16(158), uint16(546),
+ /* 1360 */ uint16(49), uint16(49), uint16(1162), uint16(546), uint16(268), uint16(50), uint16(50), uint16(546), uint16(541), uint16(1450),
+ /* 1370 */ uint16(63), uint16(63), uint16(546), uint16(1449), uint16(216), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27),
+ /* 1380 */ uint16(446), uint16(64), uint16(64), uint16(546), uint16(460), uint16(65), uint16(65), uint16(546), uint16(318), uint16(14),
+ /* 1390 */ uint16(14), uint16(425), uint16(1305), uint16(546), uint16(66), uint16(66), uint16(1087), uint16(546), uint16(141), uint16(379),
+ /* 1400 */ uint16(38), uint16(546), uint16(963), uint16(535), uint16(322), uint16(127), uint16(127), uint16(546), uint16(393), uint16(67),
+ /* 1410 */ uint16(67), uint16(546), uint16(325), uint16(290), uint16(537), uint16(52), uint16(52), uint16(515), uint16(546), uint16(68),
+ /* 1420 */ uint16(68), uint16(845), uint16(514), uint16(69), uint16(69), uint16(399), uint16(165), uint16(857), uint16(856), uint16(53),
+ /* 1430 */ uint16(53), uint16(986), uint16(311), uint16(151), uint16(151), uint16(97), uint16(432), uint16(105), uint16(105), uint16(327),
+ /* 1440 */ uint16(152), uint16(152), uint16(526), uint16(1048), uint16(106), uint16(1048), uint16(425), uint16(548), uint16(547), uint16(1131),
+ /* 1450 */ uint16(427), uint16(976), uint16(1032), uint16(270), uint16(968), uint16(239), uint16(329), uint16(243), uint16(375), uint16(375),
+ /* 1460 */ uint16(374), uint16(255), uint16(372), uint16(940), uint16(941), uint16(817), uint16(1296), uint16(546), uint16(220), uint16(546),
+ /* 1470 */ uint16(107), uint16(538), uint16(546), uint16(4), uint16(546), uint16(1256), uint16(199), uint16(845), uint16(215), uint16(1036),
+ /* 1480 */ uint16(296), uint16(1530), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(541), uint16(295), uint16(76),
+ /* 1490 */ uint16(76), uint16(54), uint16(54), uint16(980), uint16(72), uint16(72), uint16(128), uint16(128), uint16(864), uint16(865),
+ /* 1500 */ uint16(107), uint16(538), uint16(546), uint16(4), uint16(1047), uint16(546), uint16(1047), uint16(533), uint16(469), uint16(546),
+ /* 1510 */ uint16(425), uint16(546), uint16(450), uint16(1240), uint16(546), uint16(243), uint16(546), uint16(541), uint16(217), uint16(546),
+ /* 1520 */ uint16(452), uint16(197), uint16(535), uint16(243), uint16(73), uint16(73), uint16(156), uint16(129), uint16(129), uint16(158),
+ /* 1530 */ uint16(336), uint16(130), uint16(130), uint16(126), uint16(126), uint16(1036), uint16(150), uint16(150), uint16(149), uint16(149),
+ /* 1540 */ uint16(425), uint16(134), uint16(134), uint16(317), uint16(474), uint16(216), uint16(97), uint16(239), uint16(331), uint16(980),
+ /* 1550 */ uint16(986), uint16(97), uint16(535), uint16(346), uint16(347), uint16(546), uint16(105), uint16(105), uint16(902), uint16(931),
+ /* 1560 */ uint16(546), uint16(895), uint16(243), uint16(106), uint16(109), uint16(425), uint16(548), uint16(547), uint16(546), uint16(1505),
+ /* 1570 */ uint16(976), uint16(828), uint16(99), uint16(538), uint16(139), uint16(4), uint16(546), uint16(133), uint16(133), uint16(393),
+ /* 1580 */ uint16(986), uint16(1317), uint16(131), uint16(131), uint16(290), uint16(537), uint16(105), uint16(105), uint16(1357), uint16(541),
+ /* 1590 */ uint16(132), uint16(132), uint16(1292), uint16(106), uint16(1303), uint16(425), uint16(548), uint16(547), uint16(75), uint16(75),
+ /* 1600 */ uint16(976), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(546), uint16(432), uint16(896), uint16(1289),
+ /* 1610 */ uint16(532), uint16(109), uint16(425), uint16(1363), uint16(546), uint16(1221), uint16(1213), uint16(1202), uint16(258), uint16(546),
+ /* 1620 */ uint16(349), uint16(546), uint16(1201), uint16(11), uint16(535), uint16(1203), uint16(1524), uint16(351), uint16(77), uint16(77),
+ /* 1630 */ uint16(376), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(74), uint16(74), uint16(353), uint16(213),
+ /* 1640 */ uint16(301), uint16(43), uint16(43), uint16(48), uint16(48), uint16(437), uint16(310), uint16(201), uint16(303), uint16(1350),
+ /* 1650 */ uint16(315), uint16(355), uint16(986), uint16(454), uint16(479), uint16(1239), uint16(339), uint16(192), uint16(105), uint16(105),
+ /* 1660 */ uint16(1422), uint16(1421), uint16(193), uint16(536), uint16(205), uint16(106), uint16(1527), uint16(425), uint16(548), uint16(547),
+ /* 1670 */ uint16(1180), uint16(167), uint16(976), uint16(270), uint16(247), uint16(1469), uint16(1467), uint16(1177), uint16(375), uint16(375),
+ /* 1680 */ uint16(374), uint16(255), uint16(372), uint16(200), uint16(369), uint16(817), uint16(400), uint16(83), uint16(79), uint16(82),
+ /* 1690 */ uint16(1427), uint16(448), uint16(177), uint16(95), uint16(1342), uint16(161), uint16(169), uint16(1339), uint16(215), uint16(440),
+ /* 1700 */ uint16(296), uint16(172), uint16(173), uint16(976), uint16(976), uint16(978), uint16(979), uint16(27), uint16(295), uint16(174),
+ /* 1710 */ uint16(175), uint16(441), uint16(472), uint16(223), uint16(1347), uint16(383), uint16(35), uint16(381), uint16(36), uint16(461),
+ /* 1720 */ uint16(88), uint16(1353), uint16(181), uint16(447), uint16(384), uint16(1416), uint16(227), uint16(467), uint16(259), uint16(229),
+ /* 1730 */ uint16(186), uint16(488), uint16(470), uint16(324), uint16(1250), uint16(230), uint16(231), uint16(320), uint16(217), uint16(1204),
+ /* 1740 */ uint16(1438), uint16(1259), uint16(386), uint16(1258), uint16(413), uint16(90), uint16(156), uint16(849), uint16(1541), uint16(158),
+ /* 1750 */ uint16(206), uint16(415), uint16(1540), uint16(507), uint16(1300), uint16(1257), uint16(94), uint16(348), uint16(1229), uint16(1301),
+ /* 1760 */ uint16(387), uint16(1510), uint16(1228), uint16(338), uint16(1227), uint16(216), uint16(350), uint16(1539), uint16(498), uint16(283),
+ /* 1770 */ uint16(284), uint16(1249), uint16(501), uint16(1299), uint16(352), uint16(245), uint16(246), uint16(418), uint16(1298), uint16(354),
+ /* 1780 */ uint16(1496), uint16(1495), uint16(124), uint16(10), uint16(526), uint16(363), uint16(101), uint16(1324), uint16(253), uint16(96),
+ /* 1790 */ uint16(510), uint16(1210), uint16(34), uint16(549), uint16(1137), uint16(254), uint16(256), uint16(257), uint16(166), uint16(393),
+ /* 1800 */ uint16(550), uint16(1199), uint16(1282), uint16(361), uint16(290), uint16(537), uint16(1281), uint16(196), uint16(367), uint16(368),
+ /* 1810 */ uint16(1194), uint16(153), uint16(1454), uint16(137), uint16(281), uint16(1323), uint16(1455), uint16(804), uint16(154), uint16(426),
+ /* 1820 */ uint16(198), uint16(155), uint16(1453), uint16(1452), uint16(292), uint16(212), uint16(202), uint16(432), uint16(1402), uint16(203),
+ /* 1830 */ uint16(271), uint16(135), uint16(288), uint16(78), uint16(1046), uint16(1044), uint16(960), uint16(168), uint16(157), uint16(881),
+ /* 1840 */ uint16(170), uint16(219), uint16(309), uint16(222), uint16(1060), uint16(176), uint16(964), uint16(159), uint16(402), uint16(84),
+ /* 1850 */ uint16(178), uint16(404), uint16(85), uint16(86), uint16(87), uint16(160), uint16(1063), uint16(224), uint16(394), uint16(395),
+ /* 1860 */ uint16(225), uint16(1059), uint16(146), uint16(18), uint16(226), uint16(319), uint16(243), uint16(1174), uint16(466), uint16(228),
+ /* 1870 */ uint16(1052), uint16(182), uint16(183), uint16(37), uint16(819), uint16(471), uint16(340), uint16(232), uint16(332), uint16(483),
+ /* 1880 */ uint16(184), uint16(89), uint16(162), uint16(19), uint16(20), uint16(475), uint16(91), uint16(480), uint16(847), uint16(335),
+ /* 1890 */ uint16(147), uint16(860), uint16(282), uint16(92), uint16(490), uint16(93), uint16(1125), uint16(148), uint16(1012), uint16(1095),
+ /* 1900 */ uint16(39), uint16(497), uint16(1096), uint16(40), uint16(500), uint16(262), uint16(207), uint16(264), uint16(930), uint16(187),
+ /* 1910 */ uint16(925), uint16(109), uint16(1111), uint16(1115), uint16(1113), uint16(7), uint16(1099), uint16(242), uint16(33), uint16(1119),
+ /* 1920 */ uint16(21), uint16(522), uint16(22), uint16(23), uint16(24), uint16(1118), uint16(25), uint16(190), uint16(97), uint16(26),
+ /* 1930 */ uint16(1027), uint16(1013), uint16(1011), uint16(1015), uint16(1069), uint16(1016), uint16(1068), uint16(249), uint16(248), uint16(28),
+ /* 1940 */ uint16(41), uint16(891), uint16(981), uint16(829), uint16(108), uint16(29), uint16(250), uint16(542), uint16(251), uint16(370),
+ /* 1950 */ uint16(373), uint16(1133), uint16(1132), uint16(1190), uint16(1190), uint16(1190), uint16(1190), uint16(1190), uint16(1190), uint16(1190),
+ /* 1960 */ uint16(1532), uint16(1531),
+} /* sqlite3.c:154599:27 */
+var yy_lookahead = [2143]uint16{
/* 0 */ uint16(189), uint16(211), uint16(189), uint16(189), uint16(218), uint16(189), uint16(220), uint16(189), uint16(267), uint16(268),
/* 10 */ uint16(269), uint16(189), uint16(210), uint16(189), uint16(228), uint16(189), uint16(267), uint16(268), uint16(269), uint16(19),
/* 20 */ uint16(218), uint16(189), uint16(211), uint16(212), uint16(211), uint16(212), uint16(211), uint16(211), uint16(212), uint16(211),
@@ -129806,7 +134774,7 @@ var yy_lookahead = [2139]uint16{
/* 1120 */ uint16(101), uint16(102), uint16(103), uint16(104), uint16(105), uint16(106), uint16(107), uint16(108), uint16(109), uint16(110),
/* 1130 */ uint16(111), uint16(59), uint16(200), uint16(233), uint16(114), uint16(115), uint16(116), uint16(63), uint16(234), uint16(235),
/* 1140 */ uint16(235), uint16(19), uint16(20), uint16(71), uint16(22), uint16(300), uint16(189), uint16(73), uint16(200), uint16(304),
- /* 1150 */ uint16(116), uint16(247), uint16(247), uint16(81), uint16(23), uint16(200), uint16(227), uint16(26), uint16(36), uint16(234),
+ /* 1150 */ uint16(116), uint16(247), uint16(247), uint16(81), uint16(189), uint16(200), uint16(227), uint16(26), uint16(36), uint16(234),
/* 1160 */ uint16(235), uint16(203), uint16(204), uint16(143), uint16(200), uint16(26), uint16(234), uint16(235), uint16(194), uint16(200),
/* 1170 */ uint16(48), uint16(99), uint16(247), uint16(66), uint16(189), uint16(141), uint16(284), uint16(105), uint16(106), uint16(247),
/* 1180 */ uint16(100), uint16(59), uint16(234), uint16(235), uint16(112), uint16(259), uint16(114), uint16(115), uint16(116), uint16(234),
@@ -129818,76 +134786,76 @@ var yy_lookahead = [2139]uint16{
/* 1240 */ uint16(212), uint16(119), uint16(302), uint16(303), uint16(19), uint16(20), uint16(189), uint16(22), uint16(274), uint16(189),
/* 1250 */ uint16(15), uint16(144), uint16(278), uint16(189), uint16(22), uint16(23), uint16(63), uint16(189), uint16(189), uint16(203),
/* 1260 */ uint16(204), uint16(36), uint16(136), uint16(137), uint16(155), uint16(24), uint16(157), uint16(143), uint16(211), uint16(212),
- /* 1270 */ uint16(189), uint16(26), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(0), uint16(1), uint16(2),
+ /* 1270 */ uint16(189), uint16(140), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(0), uint16(1), uint16(2),
/* 1280 */ uint16(211), uint16(212), uint16(5), uint16(46), uint16(59), uint16(161), uint16(147), uint16(10), uint16(11), uint16(12),
/* 1290 */ uint16(13), uint16(14), uint16(211), uint16(212), uint16(17), uint16(60), uint16(71), uint16(189), uint16(258), uint16(189),
- /* 1300 */ uint16(59), uint16(59), uint16(105), uint16(106), uint16(189), uint16(189), uint16(189), uint16(30), uint16(116), uint16(32),
+ /* 1300 */ uint16(59), uint16(189), uint16(105), uint16(106), uint16(189), uint16(189), uint16(189), uint16(30), uint16(116), uint16(32),
/* 1310 */ uint16(85), uint16(124), uint16(189), uint16(251), uint16(252), uint16(90), uint16(189), uint16(40), uint16(258), uint16(211),
/* 1320 */ uint16(212), uint16(211), uint16(212), uint16(189), uint16(99), uint16(26), uint16(211), uint16(212), uint16(211), uint16(212),
- /* 1330 */ uint16(105), uint16(106), uint16(100), uint16(141), uint16(211), uint16(212), uint16(189), uint16(112), uint16(189), uint16(114),
- /* 1340 */ uint16(115), uint16(116), uint16(24), uint16(189), uint16(119), uint16(31), uint16(23), uint16(70), uint16(189), uint16(26),
- /* 1350 */ uint16(113), uint16(19), uint16(20), uint16(39), uint16(22), uint16(78), uint16(115), uint16(115), uint16(81), uint16(189),
- /* 1360 */ uint16(211), uint16(212), uint16(22), uint16(189), uint16(24), uint16(211), uint16(212), uint16(189), uint16(36), uint16(189),
+ /* 1330 */ uint16(105), uint16(106), uint16(100), uint16(141), uint16(211), uint16(212), uint16(119), uint16(112), uint16(189), uint16(114),
+ /* 1340 */ uint16(115), uint16(116), uint16(23), uint16(189), uint16(119), uint16(26), uint16(129), uint16(70), uint16(189), uint16(31),
+ /* 1350 */ uint16(113), uint16(19), uint16(20), uint16(24), uint16(22), uint16(78), uint16(115), uint16(39), uint16(81), uint16(189),
+ /* 1360 */ uint16(211), uint16(212), uint16(26), uint16(189), uint16(22), uint16(211), uint16(212), uint16(189), uint16(36), uint16(189),
/* 1370 */ uint16(211), uint16(212), uint16(189), uint16(189), uint16(97), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154),
- /* 1380 */ uint16(127), uint16(211), uint16(212), uint16(189), uint16(189), uint16(211), uint16(212), uint16(189), uint16(143), uint16(211),
- /* 1390 */ uint16(212), uint16(59), uint16(189), uint16(189), uint16(211), uint16(212), uint16(23), uint16(189), uint16(189), uint16(26),
- /* 1400 */ uint16(59), uint16(189), uint16(149), uint16(71), uint16(22), uint16(211), uint16(212), uint16(189), uint16(131), uint16(211),
- /* 1410 */ uint16(212), uint16(189), uint16(59), uint16(136), uint16(137), uint16(211), uint16(212), uint16(85), uint16(189), uint16(211),
- /* 1420 */ uint16(212), uint16(253), uint16(90), uint16(211), uint16(212), uint16(292), uint16(293), uint16(118), uint16(119), uint16(211),
- /* 1430 */ uint16(212), uint16(99), uint16(23), uint16(211), uint16(212), uint16(26), uint16(159), uint16(105), uint16(106), uint16(140),
- /* 1440 */ uint16(211), uint16(212), uint16(23), uint16(189), uint16(112), uint16(26), uint16(114), uint16(115), uint16(116), uint16(1),
- /* 1450 */ uint16(2), uint16(119), uint16(189), uint16(5), uint16(7), uint16(8), uint16(115), uint16(139), uint16(10), uint16(11),
- /* 1460 */ uint16(12), uint16(13), uint16(14), uint16(23), uint16(189), uint16(17), uint16(26), uint16(189), uint16(115), uint16(189),
- /* 1470 */ uint16(19), uint16(20), uint16(189), uint16(22), uint16(189), uint16(83), uint16(84), uint16(189), uint16(30), uint16(150),
- /* 1480 */ uint16(32), uint16(152), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(36), uint16(40), uint16(211),
- /* 1490 */ uint16(212), uint16(211), uint16(212), uint16(189), uint16(211), uint16(212), uint16(211), uint16(212), uint16(309), uint16(189),
- /* 1500 */ uint16(19), uint16(20), uint16(189), uint16(22), uint16(150), uint16(189), uint16(152), uint16(231), uint16(189), uint16(189),
+ /* 1380 */ uint16(127), uint16(211), uint16(212), uint16(189), uint16(189), uint16(211), uint16(212), uint16(189), uint16(189), uint16(211),
+ /* 1390 */ uint16(212), uint16(59), uint16(189), uint16(189), uint16(211), uint16(212), uint16(23), uint16(189), uint16(22), uint16(26),
+ /* 1400 */ uint16(24), uint16(189), uint16(149), uint16(71), uint16(189), uint16(211), uint16(212), uint16(189), uint16(131), uint16(211),
+ /* 1410 */ uint16(212), uint16(189), uint16(189), uint16(136), uint16(137), uint16(211), uint16(212), uint16(85), uint16(189), uint16(211),
+ /* 1420 */ uint16(212), uint16(59), uint16(90), uint16(211), uint16(212), uint16(292), uint16(293), uint16(118), uint16(119), uint16(211),
+ /* 1430 */ uint16(212), uint16(99), uint16(23), uint16(211), uint16(212), uint16(26), uint16(159), uint16(105), uint16(106), uint16(189),
+ /* 1440 */ uint16(211), uint16(212), uint16(143), uint16(150), uint16(112), uint16(152), uint16(114), uint16(115), uint16(116), uint16(1),
+ /* 1450 */ uint16(2), uint16(119), uint16(23), uint16(5), uint16(23), uint16(26), uint16(189), uint16(26), uint16(10), uint16(11),
+ /* 1460 */ uint16(12), uint16(13), uint16(14), uint16(83), uint16(84), uint16(17), uint16(253), uint16(189), uint16(139), uint16(189),
+ /* 1470 */ uint16(19), uint16(20), uint16(189), uint16(22), uint16(189), uint16(189), uint16(140), uint16(115), uint16(30), uint16(59),
+ /* 1480 */ uint16(32), uint16(139), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(36), uint16(40), uint16(211),
+ /* 1490 */ uint16(212), uint16(211), uint16(212), uint16(59), uint16(211), uint16(212), uint16(211), uint16(212), uint16(7), uint16(8),
+ /* 1500 */ uint16(19), uint16(20), uint16(189), uint16(22), uint16(150), uint16(189), uint16(152), uint16(231), uint16(281), uint16(189),
/* 1510 */ uint16(59), uint16(189), uint16(23), uint16(189), uint16(189), uint16(26), uint16(189), uint16(36), uint16(70), uint16(189),
- /* 1520 */ uint16(23), uint16(139), uint16(71), uint16(26), uint16(211), uint16(212), uint16(78), uint16(211), uint16(212), uint16(81),
- /* 1530 */ uint16(281), uint16(211), uint16(212), uint16(211), uint16(212), uint16(189), uint16(211), uint16(212), uint16(211), uint16(212),
- /* 1540 */ uint16(59), uint16(211), uint16(212), uint16(23), uint16(23), uint16(97), uint16(26), uint16(26), uint16(23), uint16(189),
- /* 1550 */ uint16(99), uint16(26), uint16(71), uint16(189), uint16(119), uint16(189), uint16(105), uint16(106), uint16(107), uint16(189),
- /* 1560 */ uint16(189), uint16(189), uint16(280), uint16(112), uint16(129), uint16(114), uint16(115), uint16(116), uint16(189), uint16(189),
+ /* 1520 */ uint16(23), uint16(237), uint16(71), uint16(26), uint16(211), uint16(212), uint16(78), uint16(211), uint16(212), uint16(81),
+ /* 1530 */ uint16(189), uint16(211), uint16(212), uint16(211), uint16(212), uint16(115), uint16(211), uint16(212), uint16(211), uint16(212),
+ /* 1540 */ uint16(59), uint16(211), uint16(212), uint16(23), uint16(23), uint16(97), uint16(26), uint16(26), uint16(23), uint16(115),
+ /* 1550 */ uint16(99), uint16(26), uint16(71), uint16(189), uint16(189), uint16(189), uint16(105), uint16(106), uint16(107), uint16(23),
+ /* 1560 */ uint16(189), uint16(23), uint16(26), uint16(112), uint16(26), uint16(114), uint16(115), uint16(116), uint16(189), uint16(309),
/* 1570 */ uint16(119), uint16(23), uint16(19), uint16(20), uint16(26), uint16(22), uint16(189), uint16(211), uint16(212), uint16(131),
- /* 1580 */ uint16(99), uint16(237), uint16(211), uint16(212), uint16(136), uint16(137), uint16(105), uint16(106), uint16(189), uint16(36),
+ /* 1580 */ uint16(99), uint16(189), uint16(211), uint16(212), uint16(136), uint16(137), uint16(105), uint16(106), uint16(189), uint16(36),
/* 1590 */ uint16(211), uint16(212), uint16(189), uint16(112), uint16(189), uint16(114), uint16(115), uint16(116), uint16(211), uint16(212),
- /* 1600 */ uint16(119), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(189), uint16(159), uint16(23), uint16(189),
- /* 1610 */ uint16(23), uint16(26), uint16(59), uint16(26), uint16(189), uint16(189), uint16(189), uint16(189), uint16(189), uint16(189),
- /* 1620 */ uint16(209), uint16(189), uint16(238), uint16(187), uint16(71), uint16(250), uint16(250), uint16(250), uint16(211), uint16(212),
- /* 1630 */ uint16(241), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(211), uint16(212), uint16(250), uint16(290),
- /* 1640 */ uint16(254), uint16(211), uint16(212), uint16(211), uint16(212), uint16(254), uint16(215), uint16(286), uint16(241), uint16(241),
- /* 1650 */ uint16(254), uint16(286), uint16(99), uint16(214), uint16(220), uint16(214), uint16(214), uint16(224), uint16(105), uint16(106),
- /* 1660 */ uint16(244), uint16(240), uint16(244), uint16(273), uint16(192), uint16(112), uint16(60), uint16(114), uint16(115), uint16(116),
- /* 1670 */ uint16(139), uint16(290), uint16(119), uint16(5), uint16(196), uint16(238), uint16(196), uint16(38), uint16(10), uint16(11),
- /* 1680 */ uint16(12), uint16(13), uint16(14), uint16(196), uint16(287), uint16(17), uint16(148), uint16(287), uint16(276), uint16(113),
- /* 1690 */ uint16(43), uint16(22), uint16(229), uint16(147), uint16(241), uint16(18), uint16(232), uint16(232), uint16(30), uint16(232),
- /* 1700 */ uint16(32), uint16(232), uint16(264), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(40), uint16(265),
- /* 1710 */ uint16(196), uint16(18), uint16(195), uint16(264), uint16(241), uint16(241), uint16(241), uint16(265), uint16(196), uint16(229),
- /* 1720 */ uint16(229), uint16(195), uint16(155), uint16(62), uint16(196), uint16(195), uint16(283), uint16(282), uint16(22), uint16(216),
- /* 1730 */ uint16(196), uint16(195), uint16(216), uint16(196), uint16(195), uint16(113), uint16(213), uint16(213), uint16(70), uint16(64),
- /* 1740 */ uint16(213), uint16(222), uint16(22), uint16(124), uint16(162), uint16(111), uint16(78), uint16(142), uint16(219), uint16(81),
- /* 1750 */ uint16(215), uint16(219), uint16(275), uint16(303), uint16(213), uint16(213), uint16(216), uint16(275), uint16(213), uint16(216),
- /* 1760 */ uint16(213), uint16(256), uint16(113), uint16(255), uint16(255), uint16(97), uint16(222), uint16(216), uint16(256), uint16(196),
- /* 1770 */ uint16(91), uint16(256), uint16(82), uint16(255), uint16(308), uint16(146), uint16(308), uint16(22), uint16(143), uint16(196),
- /* 1780 */ uint16(270), uint16(155), uint16(145), uint16(272), uint16(144), uint16(25), uint16(13), uint16(199), uint16(26), uint16(256),
- /* 1790 */ uint16(198), uint16(190), uint16(190), uint16(6), uint16(296), uint16(188), uint16(188), uint16(188), uint16(244), uint16(131),
- /* 1800 */ uint16(245), uint16(245), uint16(243), uint16(242), uint16(136), uint16(137), uint16(241), uint16(255), uint16(208), uint16(260),
- /* 1810 */ uint16(260), uint16(208), uint16(202), uint16(217), uint16(217), uint16(202), uint16(4), uint16(3), uint16(202), uint16(208),
- /* 1820 */ uint16(208), uint16(22), uint16(160), uint16(209), uint16(209), uint16(208), uint16(15), uint16(159), uint16(98), uint16(16),
- /* 1830 */ uint16(23), uint16(23), uint16(137), uint16(148), uint16(24), uint16(128), uint16(140), uint16(20), uint16(16), uint16(142),
- /* 1840 */ uint16(1), uint16(140), uint16(128), uint16(149), uint16(61), uint16(53), uint16(37), uint16(148), uint16(53), uint16(53),
- /* 1850 */ uint16(53), uint16(293), uint16(128), uint16(296), uint16(114), uint16(34), uint16(139), uint16(1), uint16(5), uint16(22),
- /* 1860 */ uint16(113), uint16(158), uint16(68), uint16(75), uint16(26), uint16(41), uint16(68), uint16(139), uint16(24), uint16(113),
- /* 1870 */ uint16(20), uint16(19), uint16(129), uint16(123), uint16(23), uint16(96), uint16(22), uint16(22), uint16(59), uint16(22),
- /* 1880 */ uint16(22), uint16(147), uint16(67), uint16(67), uint16(24), uint16(22), uint16(37), uint16(28), uint16(23), uint16(22),
- /* 1890 */ uint16(67), uint16(23), uint16(23), uint16(23), uint16(114), uint16(23), uint16(22), uint16(26), uint16(22), uint16(24),
- /* 1900 */ uint16(23), uint16(22), uint16(24), uint16(139), uint16(23), uint16(23), uint16(141), uint16(34), uint16(88), uint16(26),
- /* 1910 */ uint16(75), uint16(86), uint16(23), uint16(22), uint16(34), uint16(75), uint16(24), uint16(23), uint16(34), uint16(34),
- /* 1920 */ uint16(34), uint16(93), uint16(34), uint16(26), uint16(26), uint16(23), uint16(23), uint16(34), uint16(23), uint16(23),
- /* 1930 */ uint16(26), uint16(44), uint16(23), uint16(22), uint16(11), uint16(22), uint16(22), uint16(133), uint16(23), uint16(23),
- /* 1940 */ uint16(22), uint16(22), uint16(139), uint16(26), uint16(139), uint16(139), uint16(15), uint16(23), uint16(1), uint16(1),
- /* 1950 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(139), uint16(310), uint16(310),
- /* 1960 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310),
+ /* 1600 */ uint16(119), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(189), uint16(159), uint16(23), uint16(250),
+ /* 1610 */ uint16(189), uint16(26), uint16(59), uint16(189), uint16(189), uint16(189), uint16(189), uint16(189), uint16(280), uint16(189),
+ /* 1620 */ uint16(250), uint16(189), uint16(189), uint16(238), uint16(71), uint16(189), uint16(189), uint16(250), uint16(211), uint16(212),
+ /* 1630 */ uint16(187), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(211), uint16(212), uint16(250), uint16(290),
+ /* 1640 */ uint16(240), uint16(211), uint16(212), uint16(211), uint16(212), uint16(254), uint16(286), uint16(209), uint16(254), uint16(241),
+ /* 1650 */ uint16(240), uint16(254), uint16(99), uint16(286), uint16(215), uint16(220), uint16(214), uint16(244), uint16(105), uint16(106),
+ /* 1660 */ uint16(214), uint16(214), uint16(244), uint16(273), uint16(224), uint16(112), uint16(192), uint16(114), uint16(115), uint16(116),
+ /* 1670 */ uint16(60), uint16(290), uint16(119), uint16(5), uint16(139), uint16(196), uint16(196), uint16(38), uint16(10), uint16(11),
+ /* 1680 */ uint16(12), uint16(13), uint16(14), uint16(238), uint16(240), uint16(17), uint16(196), uint16(148), uint16(287), uint16(287),
+ /* 1690 */ uint16(276), uint16(113), uint16(22), uint16(147), uint16(241), uint16(43), uint16(229), uint16(241), uint16(30), uint16(18),
+ /* 1700 */ uint16(32), uint16(232), uint16(232), uint16(150), uint16(151), uint16(152), uint16(153), uint16(154), uint16(40), uint16(232),
+ /* 1710 */ uint16(232), uint16(196), uint16(18), uint16(195), uint16(265), uint16(265), uint16(264), uint16(241), uint16(264), uint16(196),
+ /* 1720 */ uint16(155), uint16(229), uint16(229), uint16(241), uint16(241), uint16(241), uint16(195), uint16(62), uint16(196), uint16(195),
+ /* 1730 */ uint16(22), uint16(113), uint16(216), uint16(196), uint16(222), uint16(195), uint16(195), uint16(282), uint16(70), uint16(196),
+ /* 1740 */ uint16(283), uint16(213), uint16(216), uint16(213), uint16(64), uint16(22), uint16(78), uint16(124), uint16(219), uint16(81),
+ /* 1750 */ uint16(162), uint16(111), uint16(219), uint16(142), uint16(256), uint16(213), uint16(113), uint16(255), uint16(213), uint16(256),
+ /* 1760 */ uint16(216), uint16(303), uint16(215), uint16(213), uint16(213), uint16(97), uint16(255), uint16(213), uint16(216), uint16(275),
+ /* 1770 */ uint16(275), uint16(222), uint16(216), uint16(256), uint16(255), uint16(196), uint16(91), uint16(82), uint16(256), uint16(255),
+ /* 1780 */ uint16(308), uint16(308), uint16(146), uint16(22), uint16(143), uint16(196), uint16(155), uint16(260), uint16(25), uint16(145),
+ /* 1790 */ uint16(144), uint16(199), uint16(26), uint16(198), uint16(13), uint16(190), uint16(190), uint16(6), uint16(293), uint16(131),
+ /* 1800 */ uint16(188), uint16(188), uint16(245), uint16(244), uint16(136), uint16(137), uint16(245), uint16(243), uint16(242), uint16(241),
+ /* 1810 */ uint16(188), uint16(202), uint16(208), uint16(217), uint16(217), uint16(260), uint16(208), uint16(4), uint16(202), uint16(3),
+ /* 1820 */ uint16(22), uint16(202), uint16(208), uint16(208), uint16(160), uint16(15), uint16(209), uint16(159), uint16(270), uint16(209),
+ /* 1830 */ uint16(98), uint16(16), uint16(272), uint16(208), uint16(23), uint16(23), uint16(137), uint16(148), uint16(128), uint16(20),
+ /* 1840 */ uint16(140), uint16(24), uint16(16), uint16(142), uint16(1), uint16(140), uint16(149), uint16(128), uint16(61), uint16(53),
+ /* 1850 */ uint16(148), uint16(37), uint16(53), uint16(53), uint16(53), uint16(128), uint16(114), uint16(34), uint16(296), uint16(296),
+ /* 1860 */ uint16(139), uint16(1), uint16(5), uint16(22), uint16(113), uint16(158), uint16(26), uint16(75), uint16(41), uint16(139),
+ /* 1870 */ uint16(68), uint16(68), uint16(113), uint16(24), uint16(20), uint16(19), uint16(129), uint16(123), uint16(23), uint16(96),
+ /* 1880 */ uint16(22), uint16(22), uint16(37), uint16(22), uint16(22), uint16(67), uint16(22), uint16(67), uint16(59), uint16(24),
+ /* 1890 */ uint16(23), uint16(28), uint16(67), uint16(147), uint16(22), uint16(26), uint16(23), uint16(23), uint16(23), uint16(23),
+ /* 1900 */ uint16(22), uint16(24), uint16(23), uint16(22), uint16(24), uint16(23), uint16(139), uint16(23), uint16(114), uint16(22),
+ /* 1910 */ uint16(141), uint16(26), uint16(88), uint16(75), uint16(86), uint16(44), uint16(23), uint16(34), uint16(22), uint16(75),
+ /* 1920 */ uint16(34), uint16(24), uint16(34), uint16(34), uint16(34), uint16(93), uint16(34), uint16(26), uint16(26), uint16(34),
+ /* 1930 */ uint16(23), uint16(23), uint16(23), uint16(23), uint16(23), uint16(11), uint16(23), uint16(22), uint16(26), uint16(22),
+ /* 1940 */ uint16(22), uint16(133), uint16(23), uint16(23), uint16(22), uint16(22), uint16(139), uint16(26), uint16(139), uint16(23),
+ /* 1950 */ uint16(15), uint16(1), uint16(1), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310),
+ /* 1960 */ uint16(139), uint16(139), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310),
/* 1970 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310),
/* 1980 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310),
/* 1990 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310),
@@ -129904,9 +134872,10 @@ var yy_lookahead = [2139]uint16{
/* 2100 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310),
/* 2110 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310),
/* 2120 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310),
- /* 2130 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310),
-} /* sqlite3.c:154135:25 */
-var yy_shift_ofst = [551]uint16{
+ /* 2130 */ uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310), uint16(310),
+ /* 2140 */ uint16(310), uint16(310), uint16(310),
+} /* sqlite3.c:154798:25 */
+var yy_shift_ofst = [553]uint16{
/* 0 */ uint16(1448), uint16(1277), uint16(1668), uint16(1072), uint16(1072), uint16(340), uint16(1122), uint16(1225), uint16(1332), uint16(1481),
/* 10 */ uint16(1481), uint16(1481), uint16(335), uint16(0), uint16(0), uint16(180), uint16(897), uint16(1481), uint16(1481), uint16(1481),
/* 20 */ uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481),
@@ -129922,49 +134891,49 @@ var yy_shift_ofst = [551]uint16{
/* 120 */ uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(1481), uint16(147), uint16(258), uint16(258), uint16(258),
/* 130 */ uint16(258), uint16(258), uint16(79), uint16(65), uint16(84), uint16(449), uint16(19), uint16(786), uint16(449), uint16(636),
/* 140 */ uint16(636), uint16(449), uint16(880), uint16(880), uint16(880), uint16(880), uint16(113), uint16(142), uint16(142), uint16(472),
- /* 150 */ uint16(150), uint16(1958), uint16(1958), uint16(399), uint16(399), uint16(399), uint16(93), uint16(237), uint16(341), uint16(237),
+ /* 150 */ uint16(150), uint16(1962), uint16(1962), uint16(399), uint16(399), uint16(399), uint16(93), uint16(237), uint16(341), uint16(237),
/* 160 */ uint16(237), uint16(1074), uint16(1074), uint16(437), uint16(350), uint16(704), uint16(1080), uint16(449), uint16(449), uint16(449),
/* 170 */ uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449),
/* 180 */ uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(818), uint16(818),
- /* 190 */ uint16(449), uint16(1088), uint16(217), uint16(217), uint16(734), uint16(734), uint16(1124), uint16(1126), uint16(1958), uint16(1958),
- /* 200 */ uint16(1958), uint16(739), uint16(840), uint16(840), uint16(453), uint16(454), uint16(511), uint16(187), uint16(563), uint16(570),
+ /* 190 */ uint16(449), uint16(1088), uint16(217), uint16(217), uint16(734), uint16(734), uint16(1124), uint16(1126), uint16(1962), uint16(1962),
+ /* 200 */ uint16(1962), uint16(739), uint16(840), uint16(840), uint16(453), uint16(454), uint16(511), uint16(187), uint16(563), uint16(570),
/* 210 */ uint16(898), uint16(669), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449),
/* 220 */ uint16(449), uint16(670), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449),
/* 230 */ uint16(449), uint16(449), uint16(449), uint16(449), uint16(674), uint16(674), uint16(674), uint16(449), uint16(449), uint16(449),
/* 240 */ uint16(449), uint16(1034), uint16(449), uint16(449), uint16(449), uint16(972), uint16(1107), uint16(449), uint16(449), uint16(1193),
/* 250 */ uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(449), uint16(260), uint16(177),
/* 260 */ uint16(489), uint16(1241), uint16(1241), uint16(1241), uint16(1241), uint16(1192), uint16(489), uint16(489), uint16(952), uint16(1197),
- /* 270 */ uint16(625), uint16(1235), uint16(1139), uint16(181), uint16(181), uint16(1086), uint16(1139), uint16(1139), uint16(1086), uint16(1187),
- /* 280 */ uint16(1131), uint16(1237), uint16(1314), uint16(1314), uint16(1314), uint16(181), uint16(1245), uint16(1245), uint16(1109), uint16(1299),
- /* 290 */ uint16(549), uint16(1340), uint16(1606), uint16(1531), uint16(1531), uint16(1639), uint16(1639), uint16(1531), uint16(1538), uint16(1576),
- /* 300 */ uint16(1669), uint16(1647), uint16(1546), uint16(1677), uint16(1677), uint16(1677), uint16(1677), uint16(1531), uint16(1693), uint16(1546),
- /* 310 */ uint16(1546), uint16(1576), uint16(1669), uint16(1647), uint16(1647), uint16(1546), uint16(1531), uint16(1693), uint16(1567), uint16(1661),
- /* 320 */ uint16(1531), uint16(1693), uint16(1706), uint16(1531), uint16(1693), uint16(1531), uint16(1693), uint16(1706), uint16(1622), uint16(1622),
- /* 330 */ uint16(1622), uint16(1675), uint16(1720), uint16(1720), uint16(1706), uint16(1622), uint16(1619), uint16(1622), uint16(1675), uint16(1622),
- /* 340 */ uint16(1622), uint16(1582), uint16(1706), uint16(1634), uint16(1634), uint16(1706), uint16(1605), uint16(1649), uint16(1605), uint16(1649),
- /* 350 */ uint16(1605), uint16(1649), uint16(1605), uint16(1649), uint16(1531), uint16(1679), uint16(1679), uint16(1690), uint16(1690), uint16(1629),
- /* 360 */ uint16(1635), uint16(1755), uint16(1531), uint16(1626), uint16(1629), uint16(1637), uint16(1640), uint16(1546), uint16(1760), uint16(1762),
- /* 370 */ uint16(1773), uint16(1773), uint16(1787), uint16(1787), uint16(1787), uint16(1958), uint16(1958), uint16(1958), uint16(1958), uint16(1958),
- /* 380 */ uint16(1958), uint16(1958), uint16(1958), uint16(1958), uint16(1958), uint16(1958), uint16(1958), uint16(1958), uint16(1958), uint16(1958),
- /* 390 */ uint16(308), uint16(835), uint16(954), uint16(1232), uint16(879), uint16(715), uint16(728), uint16(1323), uint16(864), uint16(1318),
- /* 400 */ uint16(1253), uint16(1373), uint16(297), uint16(1409), uint16(1419), uint16(1440), uint16(1489), uint16(1497), uint16(1520), uint16(1242),
- /* 410 */ uint16(1309), uint16(1447), uint16(1435), uint16(1341), uint16(1521), uint16(1525), uint16(1392), uint16(1548), uint16(1329), uint16(1354),
- /* 420 */ uint16(1585), uint16(1587), uint16(1353), uint16(1382), uint16(1812), uint16(1814), uint16(1799), uint16(1662), uint16(1811), uint16(1730),
- /* 430 */ uint16(1813), uint16(1807), uint16(1808), uint16(1695), uint16(1685), uint16(1707), uint16(1810), uint16(1696), uint16(1817), uint16(1697),
- /* 440 */ uint16(1822), uint16(1839), uint16(1701), uint16(1694), uint16(1714), uint16(1783), uint16(1809), uint16(1699), uint16(1792), uint16(1795),
- /* 450 */ uint16(1796), uint16(1797), uint16(1724), uint16(1740), uint16(1821), uint16(1717), uint16(1856), uint16(1853), uint16(1837), uint16(1747),
- /* 460 */ uint16(1703), uint16(1794), uint16(1838), uint16(1798), uint16(1788), uint16(1824), uint16(1728), uint16(1756), uint16(1844), uint16(1850),
- /* 470 */ uint16(1852), uint16(1743), uint16(1750), uint16(1854), uint16(1815), uint16(1855), uint16(1857), uint16(1851), uint16(1858), uint16(1816),
- /* 480 */ uint16(1819), uint16(1860), uint16(1779), uint16(1859), uint16(1863), uint16(1823), uint16(1849), uint16(1865), uint16(1734), uint16(1867),
- /* 490 */ uint16(1868), uint16(1869), uint16(1870), uint16(1871), uint16(1872), uint16(1874), uint16(1875), uint16(1877), uint16(1876), uint16(1878),
- /* 500 */ uint16(1764), uint16(1881), uint16(1882), uint16(1780), uint16(1873), uint16(1879), uint16(1765), uint16(1883), uint16(1880), uint16(1884),
- /* 510 */ uint16(1885), uint16(1886), uint16(1820), uint16(1835), uint16(1825), uint16(1887), uint16(1840), uint16(1828), uint16(1888), uint16(1889),
- /* 520 */ uint16(1891), uint16(1892), uint16(1897), uint16(1898), uint16(1893), uint16(1894), uint16(1883), uint16(1902), uint16(1903), uint16(1905),
- /* 530 */ uint16(1906), uint16(1904), uint16(1909), uint16(1911), uint16(1923), uint16(1913), uint16(1914), uint16(1915), uint16(1916), uint16(1918),
- /* 540 */ uint16(1919), uint16(1917), uint16(1804), uint16(1803), uint16(1805), uint16(1806), uint16(1818), uint16(1924), uint16(1931), uint16(1947),
- /* 550 */ uint16(1948),
-} /* sqlite3.c:154354:33 */
-var yy_reduce_ofst = [390]int16{
+ /* 270 */ uint16(625), uint16(1235), uint16(1131), uint16(181), uint16(181), uint16(1086), uint16(1139), uint16(1131), uint16(1086), uint16(1187),
+ /* 280 */ uint16(1319), uint16(1237), uint16(1318), uint16(1318), uint16(1318), uint16(181), uint16(1299), uint16(1299), uint16(1109), uint16(1336),
+ /* 290 */ uint16(549), uint16(1376), uint16(1610), uint16(1535), uint16(1535), uint16(1639), uint16(1639), uint16(1535), uint16(1539), uint16(1578),
+ /* 300 */ uint16(1670), uint16(1546), uint16(1652), uint16(1546), uint16(1681), uint16(1681), uint16(1681), uint16(1681), uint16(1535), uint16(1694),
+ /* 310 */ uint16(1546), uint16(1546), uint16(1578), uint16(1670), uint16(1652), uint16(1546), uint16(1652), uint16(1546), uint16(1535), uint16(1694),
+ /* 320 */ uint16(1565), uint16(1665), uint16(1535), uint16(1694), uint16(1708), uint16(1535), uint16(1694), uint16(1535), uint16(1694), uint16(1708),
+ /* 330 */ uint16(1618), uint16(1618), uint16(1618), uint16(1680), uint16(1723), uint16(1723), uint16(1708), uint16(1618), uint16(1623), uint16(1618),
+ /* 340 */ uint16(1680), uint16(1618), uint16(1618), uint16(1588), uint16(1708), uint16(1640), uint16(1640), uint16(1708), uint16(1611), uint16(1643),
+ /* 350 */ uint16(1611), uint16(1643), uint16(1611), uint16(1643), uint16(1611), uint16(1643), uint16(1535), uint16(1685), uint16(1685), uint16(1695),
+ /* 360 */ uint16(1695), uint16(1636), uint16(1641), uint16(1761), uint16(1535), uint16(1631), uint16(1636), uint16(1644), uint16(1646), uint16(1546),
+ /* 370 */ uint16(1763), uint16(1766), uint16(1781), uint16(1781), uint16(1791), uint16(1791), uint16(1791), uint16(1962), uint16(1962), uint16(1962),
+ /* 380 */ uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962), uint16(1962),
+ /* 390 */ uint16(1962), uint16(1962), uint16(308), uint16(835), uint16(954), uint16(1232), uint16(879), uint16(715), uint16(728), uint16(1373),
+ /* 400 */ uint16(864), uint16(1329), uint16(1253), uint16(1409), uint16(297), uint16(1431), uint16(1489), uint16(1497), uint16(1520), uint16(1521),
+ /* 410 */ uint16(1525), uint16(1362), uint16(1309), uint16(1491), uint16(1217), uint16(1420), uint16(1429), uint16(1536), uint16(1380), uint16(1538),
+ /* 420 */ uint16(1293), uint16(1354), uint16(1548), uint16(1585), uint16(1434), uint16(1342), uint16(1813), uint16(1816), uint16(1798), uint16(1664),
+ /* 430 */ uint16(1810), uint16(1732), uint16(1815), uint16(1811), uint16(1812), uint16(1699), uint16(1689), uint16(1710), uint16(1817), uint16(1700),
+ /* 440 */ uint16(1819), uint16(1701), uint16(1826), uint16(1843), uint16(1705), uint16(1697), uint16(1719), uint16(1787), uint16(1814), uint16(1702),
+ /* 450 */ uint16(1796), uint16(1799), uint16(1800), uint16(1801), uint16(1727), uint16(1742), uint16(1823), uint16(1721), uint16(1860), uint16(1857),
+ /* 460 */ uint16(1841), uint16(1751), uint16(1707), uint16(1802), uint16(1840), uint16(1803), uint16(1792), uint16(1827), uint16(1730), uint16(1759),
+ /* 470 */ uint16(1849), uint16(1854), uint16(1856), uint16(1747), uint16(1754), uint16(1858), uint16(1818), uint16(1859), uint16(1861), uint16(1855),
+ /* 480 */ uint16(1862), uint16(1820), uint16(1829), uint16(1865), uint16(1783), uint16(1863), uint16(1864), uint16(1825), uint16(1845), uint16(1867),
+ /* 490 */ uint16(1746), uint16(1872), uint16(1873), uint16(1874), uint16(1875), uint16(1869), uint16(1876), uint16(1878), uint16(1877), uint16(1879),
+ /* 500 */ uint16(1881), uint16(1880), uint16(1767), uint16(1882), uint16(1884), uint16(1794), uint16(1883), uint16(1887), uint16(1769), uint16(1885),
+ /* 510 */ uint16(1886), uint16(1888), uint16(1889), uint16(1890), uint16(1824), uint16(1838), uint16(1828), uint16(1871), uint16(1844), uint16(1832),
+ /* 520 */ uint16(1892), uint16(1893), uint16(1896), uint16(1897), uint16(1901), uint16(1902), uint16(1895), uint16(1907), uint16(1885), uint16(1908),
+ /* 530 */ uint16(1909), uint16(1910), uint16(1911), uint16(1912), uint16(1913), uint16(1915), uint16(1924), uint16(1917), uint16(1918), uint16(1919),
+ /* 540 */ uint16(1920), uint16(1922), uint16(1923), uint16(1921), uint16(1808), uint16(1807), uint16(1809), uint16(1821), uint16(1822), uint16(1926),
+ /* 550 */ uint16(1935), uint16(1950), uint16(1951),
+} /* sqlite3.c:155018:33 */
+var yy_reduce_ofst = [392]int16{
/* 0 */ int16(490), int16(-122), int16(545), int16(645), int16(650), int16(-120), int16(-189), int16(-187), int16(-184), int16(-182),
/* 10 */ int16(-178), int16(-176), int16(45), int16(30), int16(200), int16(-251), int16(-134), int16(390), int16(392), int16(521),
/* 20 */ int16(523), int16(213), int16(692), int16(821), int16(284), int16(589), int16(872), int16(666), int16(671), int16(866),
@@ -129986,83 +134955,84 @@ var yy_reduce_ofst = [390]int16{
/* 180 */ int16(158), int16(749), int16(716), int16(900), int16(304), int16(822), int16(929), int16(926), int16(499), int16(793),
/* 190 */ int16(322), int16(892), int16(813), int16(845), int16(958), int16(1056), int16(751), int16(905), int16(1133), int16(1062),
/* 200 */ int16(803), int16(-210), int16(-185), int16(-179), int16(-148), int16(-167), int16(-89), int16(121), int16(274), int16(281),
- /* 210 */ int16(320), int16(336), int16(439), int16(663), int16(711), int16(957), int16(1064), int16(1068), int16(1116), int16(1127),
- /* 220 */ int16(1134), int16(-196), int16(1147), int16(1180), int16(1184), int16(1195), int16(1203), int16(1209), int16(1254), int16(1263),
- /* 230 */ int16(1275), int16(1288), int16(1304), int16(1310), int16(205), int16(422), int16(638), int16(1319), int16(1324), int16(1346),
- /* 240 */ int16(1360), int16(1168), int16(1364), int16(1370), int16(1372), int16(869), int16(1189), int16(1380), int16(1399), int16(1276),
- /* 250 */ int16(1403), int16(121), int16(1405), int16(1420), int16(1426), int16(1427), int16(1428), int16(1429), int16(1249), int16(1282),
- /* 260 */ int16(1344), int16(1375), int16(1376), int16(1377), int16(1388), int16(1168), int16(1344), int16(1344), int16(1384), int16(1411),
- /* 270 */ int16(1436), int16(1349), int16(1389), int16(1386), int16(1391), int16(1361), int16(1407), int16(1408), int16(1365), int16(1431),
- /* 280 */ int16(1433), int16(1434), int16(1439), int16(1441), int16(1442), int16(1396), int16(1416), int16(1418), int16(1390), int16(1421),
- /* 290 */ int16(1437), int16(1472), int16(1381), int16(1478), int16(1480), int16(1397), int16(1400), int16(1487), int16(1412), int16(1444),
- /* 300 */ int16(1438), int16(1463), int16(1453), int16(1464), int16(1465), int16(1467), int16(1469), int16(1514), int16(1517), int16(1473),
- /* 310 */ int16(1474), int16(1452), int16(1449), int16(1490), int16(1491), int16(1475), int16(1522), int16(1526), int16(1443), int16(1445),
- /* 320 */ int16(1528), int16(1530), int16(1513), int16(1534), int16(1536), int16(1537), int16(1539), int16(1516), int16(1523), int16(1524),
- /* 330 */ int16(1527), int16(1519), int16(1529), int16(1532), int16(1540), int16(1541), int16(1535), int16(1542), int16(1544), int16(1545),
- /* 340 */ int16(1547), int16(1450), int16(1543), int16(1477), int16(1482), int16(1551), int16(1505), int16(1508), int16(1512), int16(1509),
- /* 350 */ int16(1515), int16(1518), int16(1533), int16(1552), int16(1573), int16(1466), int16(1468), int16(1549), int16(1550), int16(1555),
- /* 360 */ int16(1554), int16(1510), int16(1583), int16(1511), int16(1556), int16(1559), int16(1561), int16(1565), int16(1588), int16(1592),
- /* 370 */ int16(1601), int16(1602), int16(1607), int16(1608), int16(1609), int16(1498), int16(1557), int16(1558), int16(1610), int16(1600),
- /* 380 */ int16(1603), int16(1611), int16(1612), int16(1613), int16(1596), int16(1597), int16(1614), int16(1615), int16(1617), int16(1616),
-} /* sqlite3.c:154415:20 */
-var yy_default = [551]uint16{
- /* 0 */ uint16(1573), uint16(1573), uint16(1573), uint16(1409), uint16(1186), uint16(1295), uint16(1186), uint16(1186), uint16(1186), uint16(1409),
- /* 10 */ uint16(1409), uint16(1409), uint16(1186), uint16(1325), uint16(1325), uint16(1462), uint16(1217), uint16(1186), uint16(1186), uint16(1186),
- /* 20 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1408), uint16(1186), uint16(1186),
- /* 30 */ uint16(1186), uint16(1186), uint16(1492), uint16(1492), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 40 */ uint16(1186), uint16(1186), uint16(1186), uint16(1334), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 50 */ uint16(1410), uint16(1411), uint16(1186), uint16(1186), uint16(1186), uint16(1461), uint16(1463), uint16(1426), uint16(1344), uint16(1343),
- /* 60 */ uint16(1342), uint16(1341), uint16(1444), uint16(1312), uint16(1339), uint16(1332), uint16(1336), uint16(1404), uint16(1405), uint16(1403),
- /* 70 */ uint16(1407), uint16(1411), uint16(1410), uint16(1186), uint16(1335), uint16(1375), uint16(1389), uint16(1374), uint16(1186), uint16(1186),
- /* 80 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 90 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 100 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 110 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 120 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1383), uint16(1388), uint16(1394), uint16(1387),
- /* 130 */ uint16(1384), uint16(1377), uint16(1376), uint16(1378), uint16(1379), uint16(1186), uint16(1207), uint16(1259), uint16(1186), uint16(1186),
- /* 140 */ uint16(1186), uint16(1186), uint16(1480), uint16(1479), uint16(1186), uint16(1186), uint16(1217), uint16(1369), uint16(1368), uint16(1380),
- /* 150 */ uint16(1381), uint16(1391), uint16(1390), uint16(1469), uint16(1527), uint16(1526), uint16(1427), uint16(1186), uint16(1186), uint16(1186),
- /* 160 */ uint16(1186), uint16(1186), uint16(1186), uint16(1492), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 170 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 180 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1492), uint16(1492),
- /* 190 */ uint16(1186), uint16(1217), uint16(1492), uint16(1492), uint16(1213), uint16(1213), uint16(1319), uint16(1186), uint16(1475), uint16(1295),
- /* 200 */ uint16(1286), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 210 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1466), uint16(1464), uint16(1186), uint16(1186), uint16(1186),
- /* 220 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 230 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 240 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1291), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 250 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1521), uint16(1186), uint16(1439),
- /* 260 */ uint16(1273), uint16(1291), uint16(1291), uint16(1291), uint16(1291), uint16(1293), uint16(1274), uint16(1272), uint16(1285), uint16(1218),
- /* 270 */ uint16(1193), uint16(1565), uint16(1338), uint16(1314), uint16(1314), uint16(1562), uint16(1338), uint16(1338), uint16(1562), uint16(1234),
- /* 280 */ uint16(1543), uint16(1229), uint16(1325), uint16(1325), uint16(1325), uint16(1314), uint16(1319), uint16(1319), uint16(1406), uint16(1292),
- /* 290 */ uint16(1285), uint16(1186), uint16(1565), uint16(1300), uint16(1300), uint16(1564), uint16(1564), uint16(1300), uint16(1427), uint16(1347),
- /* 300 */ uint16(1353), uint16(1262), uint16(1338), uint16(1268), uint16(1268), uint16(1268), uint16(1268), uint16(1300), uint16(1204), uint16(1338),
- /* 310 */ uint16(1338), uint16(1347), uint16(1353), uint16(1262), uint16(1262), uint16(1338), uint16(1300), uint16(1204), uint16(1443), uint16(1559),
- /* 320 */ uint16(1300), uint16(1204), uint16(1417), uint16(1300), uint16(1204), uint16(1300), uint16(1204), uint16(1417), uint16(1260), uint16(1260),
- /* 330 */ uint16(1260), uint16(1249), uint16(1186), uint16(1186), uint16(1417), uint16(1260), uint16(1234), uint16(1260), uint16(1249), uint16(1260),
- /* 340 */ uint16(1260), uint16(1510), uint16(1417), uint16(1421), uint16(1421), uint16(1417), uint16(1318), uint16(1313), uint16(1318), uint16(1313),
- /* 350 */ uint16(1318), uint16(1313), uint16(1318), uint16(1313), uint16(1300), uint16(1502), uint16(1502), uint16(1328), uint16(1328), uint16(1333),
- /* 360 */ uint16(1319), uint16(1412), uint16(1300), uint16(1186), uint16(1333), uint16(1331), uint16(1329), uint16(1338), uint16(1210), uint16(1252),
- /* 370 */ uint16(1524), uint16(1524), uint16(1520), uint16(1520), uint16(1520), uint16(1570), uint16(1570), uint16(1475), uint16(1536), uint16(1217),
- /* 380 */ uint16(1217), uint16(1217), uint16(1217), uint16(1536), uint16(1236), uint16(1236), uint16(1218), uint16(1218), uint16(1217), uint16(1536),
- /* 390 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1531), uint16(1186), uint16(1428), uint16(1304),
- /* 400 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 410 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 420 */ uint16(1186), uint16(1186), uint16(1186), uint16(1358), uint16(1186), uint16(1189), uint16(1472), uint16(1186), uint16(1186), uint16(1470),
- /* 430 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1305), uint16(1186), uint16(1186), uint16(1186),
- /* 440 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 450 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1561), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 460 */ uint16(1186), uint16(1186), uint16(1442), uint16(1441), uint16(1186), uint16(1186), uint16(1302), uint16(1186), uint16(1186), uint16(1186),
- /* 470 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 480 */ uint16(1232), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 490 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 500 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1330), uint16(1186), uint16(1186),
- /* 510 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 520 */ uint16(1186), uint16(1186), uint16(1507), uint16(1320), uint16(1186), uint16(1186), uint16(1552), uint16(1186), uint16(1186), uint16(1186),
- /* 530 */ uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186), uint16(1186),
- /* 540 */ uint16(1186), uint16(1547), uint16(1276), uint16(1360), uint16(1186), uint16(1359), uint16(1363), uint16(1186), uint16(1198), uint16(1186),
- /* 550 */ uint16(1186),
-} /* sqlite3.c:154456:27 */
+ /* 210 */ int16(320), int16(336), int16(439), int16(663), int16(711), int16(957), int16(965), int16(1064), int16(1068), int16(1112),
+ /* 220 */ int16(1116), int16(-196), int16(1127), int16(1134), int16(1180), int16(1184), int16(1195), int16(1199), int16(1203), int16(1215),
+ /* 230 */ int16(1223), int16(1250), int16(1267), int16(1286), int16(205), int16(422), int16(638), int16(1324), int16(1341), int16(1364),
+ /* 240 */ int16(1365), int16(1213), int16(1392), int16(1399), int16(1403), int16(869), int16(1260), int16(1405), int16(1421), int16(1276),
+ /* 250 */ int16(1424), int16(121), int16(1426), int16(1427), int16(1428), int16(1433), int16(1436), int16(1437), int16(1227), int16(1338),
+ /* 260 */ int16(1284), int16(1359), int16(1370), int16(1377), int16(1388), int16(1213), int16(1284), int16(1284), int16(1385), int16(1438),
+ /* 270 */ int16(1443), int16(1349), int16(1400), int16(1391), int16(1394), int16(1360), int16(1408), int16(1410), int16(1367), int16(1439),
+ /* 280 */ int16(1440), int16(1435), int16(1442), int16(1446), int16(1447), int16(1397), int16(1413), int16(1418), int16(1390), int16(1444),
+ /* 290 */ int16(1445), int16(1474), int16(1381), int16(1479), int16(1480), int16(1401), int16(1402), int16(1490), int16(1414), int16(1449),
+ /* 300 */ int16(1452), int16(1453), int16(1467), int16(1456), int16(1469), int16(1470), int16(1477), int16(1478), int16(1515), int16(1518),
+ /* 310 */ int16(1476), int16(1482), int16(1450), int16(1454), int16(1492), int16(1483), int16(1493), int16(1484), int16(1523), int16(1531),
+ /* 320 */ int16(1457), int16(1455), int16(1532), int16(1534), int16(1516), int16(1537), int16(1540), int16(1543), int16(1541), int16(1526),
+ /* 330 */ int16(1528), int16(1530), int16(1542), int16(1512), int16(1529), int16(1533), int16(1544), int16(1545), int16(1547), int16(1550),
+ /* 340 */ int16(1549), int16(1551), int16(1554), int16(1458), int16(1552), int16(1494), int16(1495), int16(1556), int16(1498), int16(1502),
+ /* 350 */ int16(1503), int16(1511), int16(1517), int16(1519), int16(1522), int16(1524), int16(1579), int16(1472), int16(1473), int16(1527),
+ /* 360 */ int16(1555), int16(1557), int16(1559), int16(1558), int16(1589), int16(1560), int16(1561), int16(1564), int16(1566), int16(1568),
+ /* 370 */ int16(1592), int16(1595), int16(1605), int16(1606), int16(1612), int16(1613), int16(1622), int16(1562), int16(1563), int16(1505),
+ /* 380 */ int16(1609), int16(1604), int16(1608), int16(1614), int16(1615), int16(1616), int16(1596), int16(1597), int16(1617), int16(1620),
+ /* 390 */ int16(1625), int16(1619),
+} /* sqlite3.c:155079:20 */
+var yy_default = [553]uint16{
+ /* 0 */ uint16(1575), uint16(1575), uint16(1575), uint16(1411), uint16(1188), uint16(1297), uint16(1188), uint16(1188), uint16(1188), uint16(1411),
+ /* 10 */ uint16(1411), uint16(1411), uint16(1188), uint16(1327), uint16(1327), uint16(1464), uint16(1219), uint16(1188), uint16(1188), uint16(1188),
+ /* 20 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1410), uint16(1188), uint16(1188),
+ /* 30 */ uint16(1188), uint16(1188), uint16(1494), uint16(1494), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 40 */ uint16(1188), uint16(1188), uint16(1188), uint16(1336), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 50 */ uint16(1412), uint16(1413), uint16(1188), uint16(1188), uint16(1188), uint16(1463), uint16(1465), uint16(1428), uint16(1346), uint16(1345),
+ /* 60 */ uint16(1344), uint16(1343), uint16(1446), uint16(1314), uint16(1341), uint16(1334), uint16(1338), uint16(1406), uint16(1407), uint16(1405),
+ /* 70 */ uint16(1409), uint16(1413), uint16(1412), uint16(1188), uint16(1337), uint16(1377), uint16(1391), uint16(1376), uint16(1188), uint16(1188),
+ /* 80 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 90 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 100 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 110 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 120 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1385), uint16(1390), uint16(1396), uint16(1389),
+ /* 130 */ uint16(1386), uint16(1379), uint16(1378), uint16(1380), uint16(1381), uint16(1188), uint16(1209), uint16(1261), uint16(1188), uint16(1188),
+ /* 140 */ uint16(1188), uint16(1188), uint16(1482), uint16(1481), uint16(1188), uint16(1188), uint16(1219), uint16(1371), uint16(1370), uint16(1382),
+ /* 150 */ uint16(1383), uint16(1393), uint16(1392), uint16(1471), uint16(1529), uint16(1528), uint16(1429), uint16(1188), uint16(1188), uint16(1188),
+ /* 160 */ uint16(1188), uint16(1188), uint16(1188), uint16(1494), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 170 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 180 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1494), uint16(1494),
+ /* 190 */ uint16(1188), uint16(1219), uint16(1494), uint16(1494), uint16(1215), uint16(1215), uint16(1321), uint16(1188), uint16(1477), uint16(1297),
+ /* 200 */ uint16(1288), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 210 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1468), uint16(1466), uint16(1188), uint16(1188), uint16(1188),
+ /* 220 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 230 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 240 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1293), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 250 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1523), uint16(1188), uint16(1441),
+ /* 260 */ uint16(1275), uint16(1293), uint16(1293), uint16(1293), uint16(1293), uint16(1295), uint16(1276), uint16(1274), uint16(1287), uint16(1220),
+ /* 270 */ uint16(1195), uint16(1567), uint16(1294), uint16(1316), uint16(1316), uint16(1564), uint16(1340), uint16(1294), uint16(1564), uint16(1236),
+ /* 280 */ uint16(1545), uint16(1231), uint16(1327), uint16(1327), uint16(1327), uint16(1316), uint16(1321), uint16(1321), uint16(1408), uint16(1294),
+ /* 290 */ uint16(1287), uint16(1188), uint16(1567), uint16(1302), uint16(1302), uint16(1566), uint16(1566), uint16(1302), uint16(1429), uint16(1349),
+ /* 300 */ uint16(1355), uint16(1340), uint16(1264), uint16(1340), uint16(1270), uint16(1270), uint16(1270), uint16(1270), uint16(1302), uint16(1206),
+ /* 310 */ uint16(1340), uint16(1340), uint16(1349), uint16(1355), uint16(1264), uint16(1340), uint16(1264), uint16(1340), uint16(1302), uint16(1206),
+ /* 320 */ uint16(1445), uint16(1561), uint16(1302), uint16(1206), uint16(1419), uint16(1302), uint16(1206), uint16(1302), uint16(1206), uint16(1419),
+ /* 330 */ uint16(1262), uint16(1262), uint16(1262), uint16(1251), uint16(1188), uint16(1188), uint16(1419), uint16(1262), uint16(1236), uint16(1262),
+ /* 340 */ uint16(1251), uint16(1262), uint16(1262), uint16(1512), uint16(1419), uint16(1423), uint16(1423), uint16(1419), uint16(1320), uint16(1315),
+ /* 350 */ uint16(1320), uint16(1315), uint16(1320), uint16(1315), uint16(1320), uint16(1315), uint16(1302), uint16(1504), uint16(1504), uint16(1330),
+ /* 360 */ uint16(1330), uint16(1335), uint16(1321), uint16(1414), uint16(1302), uint16(1188), uint16(1335), uint16(1333), uint16(1331), uint16(1340),
+ /* 370 */ uint16(1212), uint16(1254), uint16(1526), uint16(1526), uint16(1522), uint16(1522), uint16(1522), uint16(1572), uint16(1572), uint16(1477),
+ /* 380 */ uint16(1538), uint16(1219), uint16(1219), uint16(1219), uint16(1219), uint16(1538), uint16(1238), uint16(1238), uint16(1220), uint16(1220),
+ /* 390 */ uint16(1219), uint16(1538), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1533), uint16(1188),
+ /* 400 */ uint16(1430), uint16(1306), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 410 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 420 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1360), uint16(1188), uint16(1191), uint16(1474), uint16(1188),
+ /* 430 */ uint16(1188), uint16(1472), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1307), uint16(1188),
+ /* 440 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 450 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1563), uint16(1188), uint16(1188),
+ /* 460 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1444), uint16(1443), uint16(1188), uint16(1188), uint16(1304), uint16(1188),
+ /* 470 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 480 */ uint16(1188), uint16(1188), uint16(1234), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 490 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 500 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1332),
+ /* 510 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 520 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1509), uint16(1322), uint16(1188), uint16(1188), uint16(1554), uint16(1188),
+ /* 530 */ uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188), uint16(1188),
+ /* 540 */ uint16(1188), uint16(1188), uint16(1188), uint16(1549), uint16(1278), uint16(1362), uint16(1188), uint16(1361), uint16(1365), uint16(1188),
+ /* 550 */ uint16(1200), uint16(1188), uint16(1188),
+} /* sqlite3.c:155121:27 */
//********* End of lemon-generated parsing tables ****************************
// The next table maps tokens (terminal symbols) into fallback tokens.
@@ -130260,7 +135230,7 @@ var yyFallback = [181]uint16{
uint16(0), // SPAN => nothing
uint16(0), // SPACE => nothing
uint16(0), // ILLEGAL => nothing
-} /* sqlite3.c:154531:25 */
+} /* sqlite3.c:155196:25 */
// The following structure represents a single element of the
// parser's stack. Information stored includes:
@@ -130283,7 +135253,7 @@ type yyStackEntry = struct {
Fminor YYMINORTYPE
}
-type YyStackEntry = yyStackEntry /* sqlite3.c:154739:29 */
+type YyStackEntry = yyStackEntry /* sqlite3.c:155404:29 */
// The state of the parser is completely contained in an instance of
// the following structure
@@ -130294,7 +135264,7 @@ type yyParser = struct {
FyystackEnd uintptr
}
-type YyParser = yyParser /* sqlite3.c:154762:25 */
+type YyParser = yyParser /* sqlite3.c:155427:25 */
// Datatype of the argument to the memory allocated passed as the
// second argument to sqlite3ParserAlloc() below. This can be changed by
@@ -130302,7 +135272,7 @@ type YyParser = yyParser /* sqlite3.c:154762:25 */
// grammar.
// Initialize a new parser that has already been allocated.
-func Xsqlite3ParserInit(tls *crt.TLS, yypRawParser uintptr, pParse uintptr) { /* sqlite3.c:155550:21: */
+func Xsqlite3ParserInit(tls *libc.TLS, yypRawParser uintptr, pParse uintptr) { /* sqlite3.c:156215:21: */
var yypParser uintptr = yypRawParser
(*YyParser)(unsafe.Pointer(yypParser)).FpParse = pParse
(*YyParser)(unsafe.Pointer(yypParser)).Fyytos = yypParser + 16 /* &.yystack */
@@ -130317,7 +135287,7 @@ func Xsqlite3ParserInit(tls *crt.TLS, yypRawParser uintptr, pParse uintptr) { /*
// a pointer to the value to be deleted. The code used to do the
// deletions is derived from the %destructor and/or %token_destructor
// directives of the input grammar.
-func yy_destructor(tls *crt.TLS, yypParser uintptr, yymajor uint16, yypminor uintptr) { /* sqlite3.c:155608:13: */
+func yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor uintptr) { /* sqlite3.c:156273:13: */
var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse
switch int32(yymajor) {
@@ -130474,15 +135444,15 @@ func yy_destructor(tls *crt.TLS, yypParser uintptr, yymajor uint16, yypminor uin
//
// If there is a destructor routine associated with the token which
// is popped from the stack, then call it.
-func yy_pop_parser_stack(tls *crt.TLS, pParser uintptr) { /* sqlite3.c:155732:13: */
+func yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:156397:13: */
var yytos uintptr
- yytos = crt.PostDecUintptr(&(*YyParser)(unsafe.Pointer(pParser)).Fyytos, 24)
+ yytos = libc.PostDecUintptr(&(*YyParser)(unsafe.Pointer(pParser)).Fyytos, 24)
yy_destructor(tls, pParser, (*YyStackEntry)(unsafe.Pointer(yytos)).Fmajor, (yytos + 8 /* &.minor */))
}
// Clear all secondary memory allocations from the parser
-func Xsqlite3ParserFinalize(tls *crt.TLS, p uintptr) { /* sqlite3.c:155750:21: */
+func Xsqlite3ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:156415:21: */
var pParser uintptr = p
for (*YyParser)(unsafe.Pointer(pParser)).Fyytos > pParser+16 /* &.yystack */ {
yy_pop_parser_stack(tls, pParser)
@@ -130505,10 +135475,10 @@ func Xsqlite3ParserFinalize(tls *crt.TLS, p uintptr) { /* sqlite3.c:155750:21: *
// Find the appropriate action for a parser given the terminal
// look-ahead token iLookAhead.
-func yy_find_shift_action(tls *crt.TLS, iLookAhead uint16, stateno uint16) uint16 { /* sqlite3.c:155830:21: */
+func yy_find_shift_action(tls *libc.TLS, iLookAhead uint16, stateno uint16) uint16 { /* sqlite3.c:156495:21: */
var i int32
- if int32(stateno) > 550 {
+ if int32(stateno) > 552 {
return stateno
}
@@ -130544,7 +135514,7 @@ func yy_find_shift_action(tls *crt.TLS, iLookAhead uint16, stateno uint16) uint1
// Find the appropriate action for a parser given the non-terminal
// look-ahead token iLookAhead.
-func yy_find_reduce_action(tls *crt.TLS, stateno uint16, iLookAhead uint16) uint16 { /* sqlite3.c:155895:21: */
+func yy_find_reduce_action(tls *libc.TLS, stateno uint16, iLookAhead uint16) uint16 { /* sqlite3.c:156560:21: */
var i int32
i = int32(yy_reduce_ofst[stateno])
@@ -130555,7 +135525,7 @@ func yy_find_reduce_action(tls *crt.TLS, stateno uint16, iLookAhead uint16) uint
}
// The following routine is called if the stack overflows.
-func yyStackOverflow(tls *crt.TLS, yypParser uintptr) { /* sqlite3.c:155924:13: */
+func yyStackOverflow(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:156589:13: */
var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse
for (*YyParser)(unsafe.Pointer(yypParser)).Fyytos > yypParser+16 /* &.yystack */ {
@@ -130565,7 +135535,7 @@ func yyStackOverflow(tls *crt.TLS, yypParser uintptr) { /* sqlite3.c:155924:13:
// stack every overflows
//******* Begin %stack_overflow code *****************************************
- Xsqlite3ErrorMsg(tls, pParse, ts+20569 /* "parser stack ove..." */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+24551 /* "parser stack ove..." */, 0)
//******* End %stack_overflow code *******************************************
(*YyParser)(unsafe.Pointer(yypParser)).FpParse = pParse
@@ -130574,7 +135544,7 @@ func yyStackOverflow(tls *crt.TLS, yypParser uintptr) { /* sqlite3.c:155924:13:
// Print tracing information for a SHIFT action
// Perform a shift action.
-func yy_shift(tls *crt.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint16, yyMinor Token) { /* sqlite3.c:155967:13: */
+func yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint16, yyMinor Token) { /* sqlite3.c:156632:13: */
var yytos uintptr
(*YyParser)(unsafe.Pointer(yypParser)).Fyytos += 24
if (*YyParser)(unsafe.Pointer(yypParser)).Fyytos > (*YyParser)(unsafe.Pointer(yypParser)).FyystackEnd {
@@ -130582,8 +135552,8 @@ func yy_shift(tls *crt.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint16
yyStackOverflow(tls, yypParser)
return
}
- if int32(yyNewState) > 550 {
- yyNewState = uint16(int32(yyNewState) + (1189 - 801))
+ if int32(yyNewState) > 552 {
+ yyNewState = uint16(int32(yyNewState) + (1191 - 803))
}
yytos = (*YyParser)(unsafe.Pointer(yypParser)).Fyytos
(*YyStackEntry)(unsafe.Pointer(yytos)).Fstateno = yyNewState
@@ -130746,7 +135716,7 @@ var yyRuleInfoLhs = [385]uint16{
uint16(186), // (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt
uint16(241), // (149) where_opt ::=
uint16(241), // (150) where_opt ::= WHERE expr
- uint16(186), // (151) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt
+ uint16(186), // (151) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt
uint16(262), // (152) setlist ::= setlist COMMA nm EQ expr
uint16(262), // (153) setlist ::= setlist COMMA LP idlist RP EQ expr
uint16(262), // (154) setlist ::= nm EQ expr
@@ -130856,7 +135826,7 @@ var yyRuleInfoLhs = [385]uint16{
uint16(285), // (258) trnm ::= nm DOT nm
uint16(286), // (259) tridxby ::= INDEXED BY nm
uint16(286), // (260) tridxby ::= NOT INDEXED
- uint16(284), // (261) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt
+ uint16(284), // (261) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt
uint16(284), // (262) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt
uint16(284), // (263) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt
uint16(284), // (264) trigger_cmd ::= scanpt select scanpt
@@ -130980,7 +135950,7 @@ var yyRuleInfoLhs = [385]uint16{
uint16(296), // (382) anylist ::= anylist LP anylist RP
uint16(296), // (383) anylist ::= anylist ANY
uint16(261), // (384) with ::=
-} /* sqlite3.c:156008:25 */
+} /* sqlite3.c:156673:25 */
// For rule J, yyRuleInfoNRhs[J] contains the negative of the number
// of symbols on the right-hand side of that rule.
@@ -131136,7 +136106,7 @@ var yyRuleInfoNRhs = [385]int8{
int8(-6), // (148) cmd ::= with DELETE FROM xfullname indexed_opt where_opt
int8(0), // (149) where_opt ::=
int8(-2), // (150) where_opt ::= WHERE expr
- int8(-8), // (151) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt
+ int8(-9), // (151) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt
int8(-5), // (152) setlist ::= setlist COMMA nm EQ expr
int8(-7), // (153) setlist ::= setlist COMMA LP idlist RP EQ expr
int8(-3), // (154) setlist ::= nm EQ expr
@@ -131246,7 +136216,7 @@ var yyRuleInfoNRhs = [385]int8{
int8(-3), // (258) trnm ::= nm DOT nm
int8(-3), // (259) tridxby ::= INDEXED BY nm
int8(-2), // (260) tridxby ::= NOT INDEXED
- int8(-8), // (261) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt
+ int8(-9), // (261) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt
int8(-8), // (262) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt
int8(-6), // (263) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt
int8(-3), // (264) trigger_cmd ::= scanpt select scanpt
@@ -131370,7 +136340,7 @@ var yyRuleInfoNRhs = [385]int8{
int8(-4), // (382) anylist ::= anylist LP anylist RP
int8(-2), // (383) anylist ::= anylist ANY
int8(0), // (384) with ::=
-} /* sqlite3.c:156398:26 */ // Forward Declaration
+} /* sqlite3.c:157063:26 */ // Forward Declaration
// Perform a reduce action and the shift that must immediately
// follow the reduce.
@@ -131380,9 +136350,9 @@ var yyRuleInfoNRhs = [385]int8{
// if the lookahead token has already been consumed. As this procedure is
// only called from one place, optimizing compilers will in-line it, which
// means that the extra parameters have no performance impact.
-func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken Token, pParse uintptr) uint16 { /* sqlite3.c:156798:21: */
- bp := tls.Alloc(120)
- defer tls.Free(120)
+func yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken Token, pParse uintptr) uint16 { /* sqlite3.c:157463:21: */
+ bp := tls.Alloc(128)
+ defer tls.Free(128)
var yygoto int32 // The next state
var yyact uint16 // The next action
@@ -131415,7 +136385,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
// #line <lineno> <thisfile>
// break;
//********* Begin reduce actions *********************************************
- // var yylhsminor YYMINORTYPE at bp+72, 16
+ // var yylhsminor YYMINORTYPE at bp+80, 16
case uint32(0): /* explain ::= EXPLAIN */
{
@@ -131434,7 +136404,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(3): /* cmd ::= BEGIN transtype trans_opt */
{
- Xsqlite3BeginTransaction(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3BeginTransaction(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
break
case uint32(4): /* transtype ::= */
@@ -131457,7 +136427,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
fallthrough // cmd ::= COMMIT|END trans_opt
case uint32(9): /* cmd ::= ROLLBACK trans_opt */
{
- Xsqlite3EndTransaction(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24)).Fmajor))
+ Xsqlite3EndTransaction(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor))
}
break
case uint32(10): /* cmd ::= SAVEPOINT nm */
@@ -131477,7 +136447,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(13): /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
{
- Xsqlite3StartTable(tls, pParse, (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), 0, 0, *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ Xsqlite3StartTable(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), 0, 0, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
}
break
case uint32(14): /* createkw ::= CREATE */
@@ -131508,7 +136478,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(16): /* ifnotexists ::= IF NOT EXISTS */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = 1
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = 1
}
break
case uint32(17):
@@ -131520,7 +136490,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(19): /* create_table_args ::= LP columnlist conslist_opt RP table_options */
{
- Xsqlite3EndTable(tls, pParse, (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), uint8(*(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))), uintptr(0))
+ Xsqlite3EndTable(tls, pParse, (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), uint8(*(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))), uintptr(0))
}
break
case uint32(20): /* create_table_args ::= AS select */
@@ -131531,17 +136501,17 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(22): /* table_options ::= WITHOUT nm */
{
- if ((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn == uint32(5)) && (Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz, ts+14283 /* "rowid" */, 5) == 0) {
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = (0x0080 | 0x0200)
+ if ((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn == uint32(5)) && (Xsqlite3_strnicmp(tls, (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz, ts+10045 /* "rowid" */, 5) == 0) {
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = (0x0080 | 0x0200)
} else {
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 0
- Xsqlite3ErrorMsg(tls, pParse, ts+20591 /* "unknown table op..." */, crt.VaList(bp, (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn, (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz))
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 0
+ Xsqlite3ErrorMsg(tls, pParse, ts+24573 /* "unknown table op..." */, libc.VaList(bp, (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn, (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz))
}
}
break
case uint32(23): /* columnname ::= nm typetoken */
{
- Xsqlite3AddColumn(tls, pParse, (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
+ Xsqlite3AddColumn(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
}
break
case uint32(24):
@@ -131556,17 +136526,17 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(25): /* typetoken ::= typename LP signed RP */
{
- (*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)).Fn = uint32((int32((int64(((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn))) - int64((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-3)*24+8 /* &.minor */)).Fz)) / 1)))
+ (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)).Fn = uint32((int32((int64(((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn))) - int64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).Fz)) / 1)))
}
break
case uint32(26): /* typetoken ::= typename LP signed COMMA signed RP */
{
- (*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)).Fn = uint32((int32((int64(((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn))) - int64((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-5)*24+8 /* &.minor */)).Fz)) / 1)))
+ (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)).Fn = uint32((int32((int64(((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn))) - int64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-5)*24+8 /* &.minor */)).Fz)) / 1)))
}
break
case uint32(27): /* typename ::= typename ID|STRING */
{
- (*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fn = ((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn + uint32((int32((int64((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz) - int64((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz)) / 1))))
+ (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fn = ((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn + uint32((int32((int64((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz) - int64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz)) / 1))))
}
break
case uint32(28): /* scanpt ::= */
@@ -131590,23 +136560,23 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(31): /* ccons ::= DEFAULT scantok term */
{
- Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz, ((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fn)))
+ Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz, ((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fn)))
}
break
case uint32(32): /* ccons ::= DEFAULT LP expr RP */
{
- Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), ((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-2)*24+8 /* &.minor */)).Fz + uintptr(1)), (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz)
+ Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), ((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*24+8 /* &.minor */)).Fz + uintptr(1)), (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz)
}
break
case uint32(33): /* ccons ::= DEFAULT PLUS scantok term */
{
- Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-2)*24+8 /* &.minor */)).Fz, ((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fn)))
+ Xsqlite3AddDefaultValue(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*24+8 /* &.minor */)).Fz, ((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fn)))
}
break
case uint32(34): /* ccons ::= DEFAULT MINUS scantok term */
{
var p uintptr = Xsqlite3PExpr(tls, pParse, 170, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0))
- Xsqlite3AddDefaultValue(tls, pParse, p, (*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-2)*24+8 /* &.minor */)).Fz, ((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fn)))
+ Xsqlite3AddDefaultValue(tls, pParse, p, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*24+8 /* &.minor */)).Fz, ((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz + uintptr((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fn)))
}
break
case uint32(35): /* ccons ::= DEFAULT scantok ID|INDEXED */
@@ -131625,7 +136595,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(37): /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
{
- Xsqlite3AddPrimaryKey(tls, pParse, uintptr(0), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ Xsqlite3AddPrimaryKey(tls, pParse, uintptr(0), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
}
break
case uint32(38): /* ccons ::= UNIQUE onconf */
@@ -131636,12 +136606,12 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(39): /* ccons ::= CHECK LP expr RP */
{
- Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
break
case uint32(40): /* ccons ::= REFERENCES nm eidlist_opt refargs */
{
- Xsqlite3CreateForeignKey(tls, pParse, uintptr(0), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ Xsqlite3CreateForeignKey(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(41): /* ccons ::= defer_subclause */
@@ -131656,12 +136626,12 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(43): /* generated ::= LP expr RP */
{
- Xsqlite3AddGenerated(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0))
+ Xsqlite3AddGenerated(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0))
}
break
case uint32(44): /* generated ::= LP expr RP ID */
{
- Xsqlite3AddGenerated(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
+ Xsqlite3AddGenerated(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
}
break
case uint32(47): /* refargs ::= */
@@ -131671,7 +136641,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(48): /* refargs ::= refargs refarg */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = ((*(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) & ^(*struct {
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = ((*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) & ^(*struct {
Fvalue int32
Fmask int32
})(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fmask) | (*struct {
@@ -131685,11 +136655,11 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
(*struct {
Fvalue int32
Fmask int32
- })(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fvalue = 0
+ })(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fvalue = 0
(*struct {
Fvalue int32
Fmask int32
- })(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fmask = 0x000000
+ })(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fmask = 0x000000
}
break
case uint32(50): /* refarg ::= ON INSERT refact */
@@ -131697,11 +136667,11 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
(*struct {
Fvalue int32
Fmask int32
- })(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fvalue = 0
+ })(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fvalue = 0
(*struct {
Fvalue int32
Fmask int32
- })(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fmask = 0x000000
+ })(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fmask = 0x000000
}
break
case uint32(51): /* refarg ::= ON DELETE refact */
@@ -131709,11 +136679,11 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
(*struct {
Fvalue int32
Fmask int32
- })(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fvalue = *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ })(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fvalue = *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
(*struct {
Fvalue int32
Fmask int32
- })(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fmask = 0x0000ff
+ })(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fmask = 0x0000ff
}
break
case uint32(52): /* refarg ::= ON UPDATE refact */
@@ -131721,21 +136691,21 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
(*struct {
Fvalue int32
Fmask int32
- })(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fvalue = (*(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) << 8)
+ })(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fvalue = (*(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) << 8)
(*struct {
Fvalue int32
Fmask int32
- })(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fmask = 0x00ff00
+ })(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fmask = 0x00ff00
}
break
case uint32(53): /* refact ::= SET NULL */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 8 /* EV: R-33326-45252 */
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 8 /* EV: R-33326-45252 */
}
break
case uint32(54): /* refact ::= SET DEFAULT */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 9 /* EV: R-33326-45252 */
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 9 /* EV: R-33326-45252 */
}
break
case uint32(55): /* refact ::= CASCADE */
@@ -131750,12 +136720,12 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(57): /* refact ::= NO ACTION */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 0 /* EV: R-33326-45252 */
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 0 /* EV: R-33326-45252 */
}
break
case uint32(58): /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = 0
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = 0
}
break
case uint32(59):
@@ -131764,7 +136734,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
fallthrough
case uint32(162): /* insert_cmd ::= INSERT orconf */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
break
case uint32(61):
@@ -131777,12 +136747,12 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
fallthrough
case uint32(233): /* collate ::= COLLATE ID|STRING */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 1
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 1
}
break
case uint32(62): /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 0
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 0
}
break
case uint32(64): /* tconscomma ::= COMMA */
@@ -131792,23 +136762,23 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(66): /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
{
- Xsqlite3AddPrimaryKey(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), 0)
+ Xsqlite3AddPrimaryKey(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), 0)
}
break
case uint32(67): /* tcons ::= UNIQUE LP sortlist RP onconf */
{
- Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), 0, 0,
+ Xsqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), 0, 0,
uint8(1))
}
break
case uint32(68): /* tcons ::= CHECK LP expr RP onconf */
{
- Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ Xsqlite3AddCheckConstraint(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
}
break
case uint32(69): /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
{
- Xsqlite3CreateForeignKey(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3CreateForeignKey(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
Xsqlite3DeferForeignKey(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
@@ -131821,7 +136791,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(72): /* onconf ::= ON CONFLICT resolvetype */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
break
case uint32(75): /* resolvetype ::= IGNORE */
@@ -131838,22 +136808,22 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(77): /* cmd ::= DROP TABLE ifexists fullname */
{
- Xsqlite3DropTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), 0, *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3DropTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), 0, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
break
case uint32(80): /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
{
- Xsqlite3CreateView(tls, pParse, (yymsp + crt.UintptrFromInt32(-8)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)))
+ Xsqlite3CreateView(tls, pParse, (yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)))
}
break
case uint32(81): /* cmd ::= DROP VIEW ifexists fullname */
{
- Xsqlite3DropTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), 1, *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3DropTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), 1, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
break
case uint32(82): /* cmd ::= select */
{
- *(*SelectDest)(unsafe.Pointer(bp + 24 /* dest */)) = SelectDest{FeDest: U8(9), FiSDParm: 0, FiSdst: 0, FnSdst: 0, FzAffSdst: uintptr(0), FpOrderBy: uintptr(0)}
+ *(*SelectDest)(unsafe.Pointer(bp + 24 /* dest */)) = SelectDest{FeDest: U8(9), FiSDParm: 0, FiSDParm2: 0, FiSdst: 0, FnSdst: 0, FzAffSdst: uintptr(0), FpOrderBy: uintptr(0)}
Xsqlite3Select(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), bp+24 /* &dest */)
Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
@@ -131862,24 +136832,24 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
{
var p uintptr = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
if p != 0 {
- (*Select)(unsafe.Pointer(p)).FpWith = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ (*Select)(unsafe.Pointer(p)).FpWith = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
parserDoubleLinkSelect(tls, pParse, p)
} else {
- Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = p
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = p
}
break
case uint32(84): /* select ::= WITH RECURSIVE wqlist selectnowith */
{
var p uintptr = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
if p != 0 {
- (*Select)(unsafe.Pointer(p)).FpWith = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ (*Select)(unsafe.Pointer(p)).FpWith = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
parserDoubleLinkSelect(tls, pParse, p)
} else {
- Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3WithDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = p
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = p
}
break
case uint32(85): /* select ::= selectnowith */
@@ -131894,30 +136864,30 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
case uint32(86): /* selectnowith ::= selectnowith multiselect_op oneselect */
{
var pRhs uintptr = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
- var pLhs uintptr = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */))
+ var pLhs uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))
if (pRhs != 0) && ((*Select)(unsafe.Pointer(pRhs)).FpPrior != 0) {
var pFrom uintptr
- // var x Token at bp+56, 16
+ // var x Token at bp+64, 16
- (*Token)(unsafe.Pointer(bp + 56 /* &x */)).Fn = uint32(0)
+ (*Token)(unsafe.Pointer(bp + 64 /* &x */)).Fn = uint32(0)
parserDoubleLinkSelect(tls, pParse, pRhs)
- pFrom = Xsqlite3SrcListAppendFromTerm(tls, pParse, uintptr(0), uintptr(0), uintptr(0), bp+56 /* &x */, pRhs, uintptr(0), uintptr(0))
+ pFrom = Xsqlite3SrcListAppendFromTerm(tls, pParse, uintptr(0), uintptr(0), uintptr(0), bp+64 /* &x */, pRhs, uintptr(0), uintptr(0))
pRhs = Xsqlite3SelectNew(tls, pParse, uintptr(0), pFrom, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0))
}
if pRhs != 0 {
- (*Select)(unsafe.Pointer(pRhs)).Fop = U8(*(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ (*Select)(unsafe.Pointer(pRhs)).Fop = U8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
(*Select)(unsafe.Pointer(pRhs)).FpPrior = pLhs
if pLhs != 0 {
- *(*U32)(unsafe.Pointer(pLhs + 4 /* &.selFlags */)) &= (^U32(crt.Int32FromInt32(0x0000400)))
+ *(*U32)(unsafe.Pointer(pLhs + 4 /* &.selFlags */)) &= (^U32(libc.Int32FromInt32(0x0000400)))
}
- *(*U32)(unsafe.Pointer(pRhs + 4 /* &.selFlags */)) &= (^U32(crt.Int32FromInt32(0x0000400)))
- if *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 133 {
+ *(*U32)(unsafe.Pointer(pRhs + 4 /* &.selFlags */)) &= (^U32(libc.Int32FromInt32(0x0000400)))
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 133 {
(*Parse)(unsafe.Pointer(pParse)).FhasCompound = U8(1)
}
} else {
Xsqlite3SelectDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pLhs)
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = pRhs
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = pRhs
}
break
case uint32(87):
@@ -131929,43 +136899,43 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(88): /* multiselect_op ::= UNION ALL */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 133
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 133
}
break
case uint32(90): /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-8)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uint32(*(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uint32(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(91): /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-9)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uint32(*(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-8)*24 + 8 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-9)*24 + 8 /* &.minor */)) != 0 {
- (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-9)*24 + 8 /* &.minor */)))).FpWinDefn = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-9)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uint32(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-9)*24 + 8 /* &.minor */)) != 0 {
+ (*Select)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-9)*24 + 8 /* &.minor */)))).FpWinDefn = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))
} else {
- Xsqlite3WindowListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ Xsqlite3WindowListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
}
}
break
case uint32(92): /* values ::= VALUES LP nexprlist RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0x0000200), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0x0000200), uintptr(0))
}
break
case uint32(93): /* values ::= values COMMA LP nexprlist RP */
{
var pRight uintptr
- var pLeft uintptr = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */))
- pRight = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), (uint32(0x0000200 | 0x0000400)), uintptr(0))
+ var pLeft uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */))
+ pRight = Xsqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), (uint32(0x0000200 | 0x0000400)), uintptr(0))
if pLeft != 0 {
- *(*U32)(unsafe.Pointer(pLeft + 4 /* &.selFlags */)) &= (^U32(crt.Int32FromInt32(0x0000400)))
+ *(*U32)(unsafe.Pointer(pLeft + 4 /* &.selFlags */)) &= (^U32(libc.Int32FromInt32(0x0000400)))
}
if pRight != 0 {
(*Select)(unsafe.Pointer(pRight)).Fop = U8(133)
(*Select)(unsafe.Pointer(pRight)).FpPrior = pLeft
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = pRight
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = pRight
} else {
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = pLeft
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = pLeft
}
}
break
@@ -131996,25 +136966,25 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(98): /* selcollist ::= sclp scanpt expr scanpt as */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
if (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn > uint32(0) {
- Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
}
- Xsqlite3ExprListSetSpan(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3ExprListSetSpan(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
break
case uint32(99): /* selcollist ::= sclp scanpt STAR */
{
var p uintptr = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 177, uintptr(0))
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), p)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), p)
}
break
case uint32(100): /* selcollist ::= sclp scanpt nm DOT STAR */
{
var pRight uintptr = Xsqlite3PExpr(tls, pParse, 177, uintptr(0), uintptr(0))
- var pLeft uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 59, (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ var pLeft uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 59, (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
var pDot uintptr = Xsqlite3PExpr(tls, pParse, 139, pLeft, pRight)
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), pDot)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), pDot)
}
break
case uint32(101):
@@ -132025,76 +136995,73 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
fallthrough
case uint32(245): /* minus_num ::= MINUS INTEGER|FLOAT */
{
- *(*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
break
- case uint32(103): /* from ::= */
+ case uint32(103):
+ fallthrough // from ::=
+ case uint32(106): /* stl_prefix ::= */
{
- *(*uintptr)(unsafe.Pointer(yymsp + uintptr(1)*24 + 8 /* &.minor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(SrcList{})))
+ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(1)*24 + 8 /* &.minor */)) = uintptr(0)
}
break
case uint32(104): /* from ::= FROM seltablist */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
- Xsqlite3SrcListShiftJoinType(tls, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ Xsqlite3SrcListShiftJoinType(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
break
case uint32(105): /* stl_prefix ::= seltablist joinop */
{
- if (*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0) && ((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnSrc > 0) {
- (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnSrc-1))*112)).Ffg.Fjointype = U8(*(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ if (*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0) && ((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnSrc > 0) {
+ (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnSrc-1))*112)).Ffg.Fjointype = U8(*(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
}
break
- case uint32(106): /* stl_prefix ::= */
- {
- *(*uintptr)(unsafe.Pointer(yymsp + uintptr(1)*24 + 8 /* &.minor */)) = uintptr(0)
- }
- break
case uint32(107): /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
- Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */))
}
break
case uint32(108): /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-8)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
- Xsqlite3SrcListFuncArgs(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ Xsqlite3SrcListFuncArgs(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
}
break
case uint32(109): /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(110): /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
{
- if (((*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) == uintptr(0)) && ((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-2)*24+8 /* &.minor */)).Fn == uint32(0))) && (*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) == uintptr(0))) && (*(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) == uintptr(0)) {
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */))
- } else if (*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))).FnSrc == 1 {
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) != 0 {
- var pNew uintptr = ((*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)))).FnSrc-1))*112)
- var pOld uintptr = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 8 /* &.a */
+ if (((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) == uintptr(0)) && ((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-2)*24+8 /* &.minor */)).Fn == uint32(0))) && (*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) == uintptr(0))) && (*(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) == uintptr(0)) {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */))
+ } else if (*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))).FnSrc == 1 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) != 0 {
+ var pNew uintptr = ((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(((*SrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)))).FnSrc-1))*112)
+ var pOld uintptr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 8 /* &.a */
(*SrcList_item)(unsafe.Pointer(pNew)).FzName = (*SrcList_item)(unsafe.Pointer(pOld)).FzName
(*SrcList_item)(unsafe.Pointer(pNew)).FzDatabase = (*SrcList_item)(unsafe.Pointer(pOld)).FzDatabase
(*SrcList_item)(unsafe.Pointer(pNew)).FpSelect = (*SrcList_item)(unsafe.Pointer(pOld)).FpSelect
if uint32(int32(*(*uint8)(unsafe.Pointer(pOld + 60 /* &.fg */ + 4 /* &.isTabFunc */))&0x4>>2)) != 0 {
*(*uintptr)(unsafe.Pointer(pNew + 96 /* &.u1 */)) = *(*uintptr)(unsafe.Pointer(pOld + 96 /* &.u1 */))
*(*uintptr)(unsafe.Pointer(pOld + 96 /* &.u1 */)) = uintptr(0)
- crt.SetBitFieldPtr8Uint32(pOld+60 /* &.fg */ +4 /* &.isTabFunc */, uint32(0), 2, 0x4)
- crt.SetBitFieldPtr8Uint32(pNew+60 /* &.fg */ +4 /* &.isTabFunc */, uint32(1), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pOld+60 /* &.fg */ +4 /* &.isTabFunc */, uint32(0), 2, 0x4)
+ libc.SetBitFieldPtr8Uint32(pNew+60 /* &.fg */ +4 /* &.isTabFunc */, uint32(1), 2, 0x4)
}
- (*SrcList_item)(unsafe.Pointer(pOld)).FzName = crt.AssignPtrUintptr(pOld+8 /* &.zDatabase */, uintptr(0))
+ (*SrcList_item)(unsafe.Pointer(pOld)).FzName = libc.AssignPtrUintptr(pOld+8 /* &.zDatabase */, uintptr(0))
(*SrcList_item)(unsafe.Pointer(pOld)).FpSelect = uintptr(0)
}
- Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
+ Xsqlite3SrcListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
} else {
var pSubquery uintptr
- Xsqlite3SrcListShiftJoinType(tls, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
- pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0x0000800), uintptr(0))
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), pSubquery, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ Xsqlite3SrcListShiftJoinType(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
+ pSubquery = Xsqlite3SelectNew(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0x0000800), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), pSubquery, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
}
break
@@ -132108,21 +137075,21 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(113): /* fullname ::= nm */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0))
- if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2) && (*(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) != 0) {
- Xsqlite3RenameTokenMap(tls, pParse, (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))+8 /* &.a */)+uintptr(0)*112)).FzName, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0))
+ if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2) && (*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) != 0) {
+ Xsqlite3RenameTokenMap(tls, pParse, (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))+8 /* &.a */)+uintptr(0)*112)).FzName, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
}
}
- *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(114): /* fullname ::= nm DOT nm */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
- if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2) && (*(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) != 0) {
- Xsqlite3RenameTokenMap(tls, pParse, (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))+8 /* &.a */)+uintptr(0)*112)).FzName, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
+ if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2) && (*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) != 0) {
+ Xsqlite3RenameTokenMap(tls, pParse, (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))+8 /* &.a */)+uintptr(0)*112)).FzName, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
}
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(115): /* xfullname ::= nm */
{
@@ -132131,22 +137098,22 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(116): /* xfullname ::= nm DOT nm */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */)) /*A-overwrites-X*/
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */)) /*A-overwrites-X*/
}
break
case uint32(117): /* xfullname ::= nm DOT nm AS nm */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */)) //A-overwrites-X
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 {
- (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(0)*112)).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */)) //A-overwrites-X
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 {
+ (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(0)*112)).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
}
}
break
case uint32(118): /* xfullname ::= nm AS nm */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0)) //A-overwrites-X
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) != 0 {
- (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(0)*112)).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0)) //A-overwrites-X
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) != 0 {
+ (*SrcList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(0)*112)).FzAlias = Xsqlite3NameFromToken(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
}
}
break
@@ -132157,17 +137124,17 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(120): /* joinop ::= JOIN_KW JOIN */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3JoinType(tls, pParse, (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0), uintptr(0)) /*X-overwrites-A*/
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3JoinType(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0), uintptr(0)) /*X-overwrites-A*/
}
break
case uint32(121): /* joinop ::= JOIN_KW nm JOIN */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3JoinType(tls, pParse, (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0)) /*X-overwrites-A*/
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3JoinType(tls, pParse, (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0)) /*X-overwrites-A*/
}
break
case uint32(122): /* joinop ::= JOIN_KW nm nm JOIN */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3JoinType(tls, pParse, (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */)) /*X-overwrites-A*/
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3JoinType(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */)) /*X-overwrites-A*/
}
break
case uint32(123):
@@ -132180,7 +137147,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
fallthrough
case uint32(237): /* vinto ::= INTO expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
break
case uint32(124):
@@ -132202,18 +137169,18 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(126): /* indexed_opt ::= INDEXED BY nm */
{
- *(*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
break
case uint32(127): /* indexed_opt ::= NOT INDEXED */
{
- (*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fz = uintptr(0)
- (*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fn = uint32(1)
+ (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fz = uintptr(0)
+ (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fn = uint32(1)
}
break
case uint32(128): /* using_opt ::= USING LP idlist RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
}
break
case uint32(129):
@@ -132227,19 +137194,19 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
fallthrough // orderby_opt ::= ORDER BY sortlist
case uint32(141): /* groupby_opt ::= GROUP BY nexprlist */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
break
case uint32(132): /* sortlist ::= sortlist COMMA expr sortorder nulls */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
- Xsqlite3ExprListSetSortOrder(tls, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ Xsqlite3ExprListSetSortOrder(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(133): /* sortlist ::= expr sortorder nulls */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) //A-overwrites-Y
- Xsqlite3ExprListSetSortOrder(tls, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))) //A-overwrites-Y
+ Xsqlite3ExprListSetSortOrder(tls, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(134): /* sortorder ::= ASC */
@@ -132261,73 +137228,74 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(137): /* nulls ::= NULLS FIRST */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 0
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 0
}
break
case uint32(138): /* nulls ::= NULLS LAST */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 1
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 1
}
break
case uint32(145): /* limit_opt ::= LIMIT expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 146, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 146, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0))
}
break
case uint32(146): /* limit_opt ::= LIMIT expr OFFSET expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 146, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 146, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(147): /* limit_opt ::= LIMIT expr COMMA expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 146, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 146, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
}
break
case uint32(148): /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt */
{
- Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */))
- Xsqlite3DeleteFrom(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0))
+ Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */))
+ Xsqlite3DeleteFrom(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0))
}
break
- case uint32(151): /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */
+ case uint32(151): /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt */
{
- Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */))
- Xsqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), ts+20618 /* "set list" */)
- Xsqlite3Update(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0))
+ Xsqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */))
+ Xsqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), ts+24600 /* "set list" */)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3SrcListAppendList(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3Update(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), uintptr(0))
}
break
case uint32(152): /* setlist ::= setlist COMMA nm EQ expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
- Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
}
break
case uint32(153): /* setlist ::= setlist COMMA LP idlist RP EQ expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppendVector(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppendVector(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(154): /* setlist ::= nm EQ expr */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
- Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ Xsqlite3ExprListSetName(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(155): /* setlist ::= LP idlist RP EQ expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppendVector(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppendVector(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(156): /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
{
- Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(157): /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
{
- Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), uintptr(0))
+ Xsqlite3Insert(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), uintptr(0))
}
break
case uint32(158): /* upsert ::= */
@@ -132337,27 +137305,27 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(159): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-10)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(160): /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0))
}
break
case uint32(161): /* upsert ::= ON CONFLICT DO NOTHING */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), uintptr(0), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3UpsertNew(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), uintptr(0), uintptr(0), uintptr(0))
}
break
case uint32(165): /* idlist_opt ::= LP idlist RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
}
break
case uint32(166): /* idlist ::= idlist COMMA nm */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3IdListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3IdListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
}
break
case uint32(167): /* idlist ::= nm */
@@ -132367,7 +137335,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(168): /* expr ::= LP expr RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
}
break
case uint32(169):
@@ -132379,29 +137347,29 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(171): /* expr ::= nm DOT nm */
{
- var temp1 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 59, (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ var temp1 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 59, (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
var temp2 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 59, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2 {
Xsqlite3RenameTokenMap(tls, pParse, temp2, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
- Xsqlite3RenameTokenMap(tls, pParse, temp1, (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */))
+ Xsqlite3RenameTokenMap(tls, pParse, temp1, (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */))
}
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3PExpr(tls, pParse, 139, temp1, temp2)
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3PExpr(tls, pParse, 139, temp1, temp2)
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(172): /* expr ::= nm DOT nm DOT nm */
{
- var temp1 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 59, (yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
- var temp2 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 59, (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ var temp1 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 59, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ var temp2 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 59, (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
var temp3 uintptr = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 59, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
var temp4 uintptr = Xsqlite3PExpr(tls, pParse, 139, temp2, temp3)
if int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2 {
Xsqlite3RenameTokenMap(tls, pParse, temp3, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
- Xsqlite3RenameTokenMap(tls, pParse, temp2, (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */))
+ Xsqlite3RenameTokenMap(tls, pParse, temp2, (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */))
}
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3PExpr(tls, pParse, 139, temp1, temp4)
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3PExpr(tls, pParse, 139, temp1, temp4)
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(173):
fallthrough // term ::= NULL|FLOAT|BLOB
@@ -132412,9 +137380,9 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(175): /* term ::= INTEGER */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 152, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 152, (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
}
- *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(176): /* expr ::= VARIABLE */
{
@@ -132426,15 +137394,15 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
// When doing a nested parse, one can include terms in an expression
// that look like this: #1 #2 ... These terms refer to registers
// in the virtual machine. #N is the N-th register.
- *(*Token)(unsafe.Pointer(bp + 88 /* t */)) = *(*Token)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) //A-overwrites-X
+ *(*Token)(unsafe.Pointer(bp + 96 /* t */)) = *(*Token)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) //A-overwrites-X
if int32((*Parse)(unsafe.Pointer(pParse)).Fnested) == 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+20627 /* "near \"%T\": synta..." */, crt.VaList(bp+16, bp+88 /* &t */))
+ Xsqlite3ErrorMsg(tls, pParse, ts+24609 /* "near \"%T\": synta..." */, libc.VaList(bp+16, bp+96 /* &t */))
*(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = uintptr(0)
} else {
*(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 173, uintptr(0), uintptr(0))
if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) != 0 {
- Xsqlite3GetInt32(tls, ((*Token)(unsafe.Pointer(bp+88 /* &t */)).Fz + uintptr(1)), (*(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) + 40 /* &.iTable */))
+ Xsqlite3GetInt32(tls, ((*Token)(unsafe.Pointer(bp+96 /* &t */)).Fz + uintptr(1)), (*(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) + 44 /* &.iTable */))
}
}
}
@@ -132442,55 +137410,55 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(177): /* expr ::= expr COLLATE ID|STRING */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprAddCollateToken(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprAddCollateToken(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
}
break
case uint32(178): /* expr ::= CAST LP expr AS typetoken RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 36, (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
- Xsqlite3ExprAttachSubtrees(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 36, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ Xsqlite3ExprAttachSubtrees(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0))
}
break
case uint32(179): /* expr ::= ID|INDEXED LP distinct exprlist RP */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(180): /* expr ::= ID|INDEXED LP STAR RP */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(181): /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))
- Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))
+ Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(182): /* expr ::= ID|INDEXED LP STAR RP filter_over */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
- Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
+ Xsqlite3WindowAttach(tls, pParse, *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(183): /* term ::= CTIME_KW */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3ExprFunction(tls, pParse, uintptr(0), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
}
- *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(184): /* expr ::= LP nexprlist COMMA expr RP */
{
- var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 174, uintptr(0), uintptr(0))
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 32 /* &.x */)) = pList
+ var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 174, uintptr(0), uintptr(0))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 {
+ *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 32 /* &.x */)) = pList
if (*ExprList)(unsafe.Pointer(pList)).FnExpr != 0 {
- *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(0)*32)).FpExpr)).Fflags & (U32((0x000100 | 0x200000) | 0x000004)))
+ *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= ((*Expr)(unsafe.Pointer((*ExprList_item)(unsafe.Pointer((pList+8 /* &.a */)+uintptr(0)*32)).FpExpr)).Fflags & (U32((0x000100 | 0x200000) | 0x000004)))
}
} else {
Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pList)
@@ -132499,7 +137467,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(185): /* expr ::= expr AND expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(186):
@@ -132516,81 +137484,81 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
fallthrough
case uint32(192): /* expr ::= expr CONCAT expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(193): /* likeop ::= NOT LIKE_KW|MATCH */
{
- *(*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
- *(*uint32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */ + 8 /* &.n */)) |= (0x80000000) /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/
+ *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */ + 8 /* &.n */)) |= (0x80000000) /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/
}
break
case uint32(194): /* expr ::= expr likeop expr */
{
var pList uintptr
- var bNot int32 = (int32((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fn & 0x80000000))
- *(*uint32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */ + 8 /* &.n */)) &= (uint32(0x7fffffff))
+ var bNot int32 = (int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fn & 0x80000000))
+ *(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */ + 8 /* &.n */)) &= (uint32(0x7fffffff))
pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
- pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprFunction(tls, pParse, pList, (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
+ pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprFunction(tls, pParse, pList, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
if bNot != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0))
}
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) != 0 {
- *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (U32(0x000080))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) != 0 {
+ *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (U32(0x000080))
}
}
break
case uint32(195): /* expr ::= expr likeop expr ESCAPE expr */
{
var pList uintptr
- var bNot int32 = (int32((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-3)*24+8 /* &.minor */)).Fn & 0x80000000))
- *(*uint32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */ + 8 /* &.n */)) &= (uint32(0x7fffffff))
- pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
- pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
+ var bNot int32 = (int32((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).Fn & 0x80000000))
+ *(*uint32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */ + 8 /* &.n */)) &= (uint32(0x7fffffff))
+ pList = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprFunction(tls, pParse, pList, (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprFunction(tls, pParse, pList, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
if bNot != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
}
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 {
- *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (U32(0x000080))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 {
+ *(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 4 /* &.flags */)) |= (U32(0x000080))
}
}
break
case uint32(196): /* expr ::= expr ISNULL|NOTNULL */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+uintptr(0)*24)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+uintptr(0)*24)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0))
}
break
case uint32(197): /* expr ::= expr NOT NULL */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 51, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 51, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uintptr(0))
}
break
case uint32(198): /* expr ::= expr IS expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 45, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
- binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), 50)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 45, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), 50)
}
break
case uint32(199): /* expr ::= expr IS NOT expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 168, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
- binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), 51)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 168, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ binaryToUnaryIfNull(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), 51)
}
break
case uint32(200):
fallthrough // expr ::= NOT expr
case uint32(201): /* expr ::= BITNOT expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0)) /*A-overwrites-B*/
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0)) /*A-overwrites-B*/
}
break
case uint32(202): /* expr ::= PLUS|MINUS expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, func() int32 {
- if int32((*YyStackEntry)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24)).Fmajor) == 105 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, func() int32 {
+ if int32((*YyStackEntry)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24)).Fmajor) == 105 {
return 171
}
return 170
@@ -132607,22 +137575,22 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(205): /* expr ::= expr between_op expr AND expr */
{
- var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ var pList uintptr = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
pList = Xsqlite3ExprListAppend(tls, pParse, pList, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 48, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 32 /* &.x */)) = pList
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 48, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 {
+ *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 32 /* &.x */)) = pList
} else {
Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, pList)
}
- if *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
}
}
break
case uint32(208): /* expr ::= expr in_op LP exprlist RP */
{
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) == uintptr(0) {
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) == uintptr(0) {
// Expressions of the form
//
// expr1 IN ()
@@ -132630,54 +137598,54 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
//
// simplify to constants 0 (false) and 1 (true), respectively,
// regardless of the value of expr1.
- Xsqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 152, func() uintptr {
- if *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
- return ts + 7523 /* "1" */
+ Xsqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3Expr(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 152, func() uintptr {
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
+ return ts + 9882 /* "1" */
}
- return ts + 7105 /* "0" */
+ return ts + 9351 /* "0" */
}())
- } else if ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnExpr == 1) && (Xsqlite3ExprIsConstant(tls, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))+8 /* &.a */)+uintptr(0)*32)).FpExpr) != 0) {
- var pRHS uintptr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(0)*32)).FpExpr
- (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(0)*32)).FpExpr = uintptr(0)
- Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ } else if ((*ExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FnExpr == 1) && (Xsqlite3ExprIsConstant(tls, (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))+8 /* &.a */)+uintptr(0)*32)).FpExpr) != 0) {
+ var pRHS uintptr = (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(0)*32)).FpExpr
+ (*ExprList_item)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) + 8 /* &.a */) + uintptr(0)*32)).FpExpr = uintptr(0)
+ Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
pRHS = Xsqlite3PExpr(tls, pParse, 171, pRHS, uintptr(0))
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 53, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), pRHS)
- if *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 53, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), pRHS)
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
}
} else {
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 49, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 32 /* &.x */)) = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
- Xsqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 49, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 {
+ *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 32 /* &.x */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ Xsqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
} else {
- Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
- if *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
}
}
}
break
case uint32(209): /* expr ::= LP select RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 136, uintptr(0), uintptr(0))
- Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 136, uintptr(0), uintptr(0))
+ Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
break
case uint32(210): /* expr ::= expr in_op LP select RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 49, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
- Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
- if *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 49, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
+ Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
}
}
break
case uint32(211): /* expr ::= expr in_op nm dbnm paren_exprlist */
{
- var pSrc uintptr = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */))
+ var pSrc uintptr = Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */))
var pSelect uintptr = Xsqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0))
if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) != 0 {
Xsqlite3SrcListFuncArgs(tls, pParse, func() uintptr {
@@ -132687,47 +137655,47 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
return uintptr(0)
}(), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 49, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
- Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), pSelect)
- if *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 49, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
+ Xsqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), pSelect)
+ if *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 19, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), uintptr(0))
}
}
break
case uint32(212): /* expr ::= EXISTS LP select RP */
{
var p uintptr
- p = crt.AssignPtrUintptr(yymsp+crt.UintptrFromInt32(-3)*24+8 /* &.minor */ /* &.yy202 */, Xsqlite3PExpr(tls, pParse, 20, uintptr(0), uintptr(0)))
- Xsqlite3PExprAddSelect(tls, pParse, p, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ p = libc.AssignPtrUintptr(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */ /* &.yy202 */, Xsqlite3PExpr(tls, pParse, 20, uintptr(0), uintptr(0)))
+ Xsqlite3PExprAddSelect(tls, pParse, p, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
break
case uint32(213): /* expr ::= CASE case_operand case_exprlist case_else END */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 154, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0))
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 {
- *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 32 /* &.x */)) = func() uintptr {
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0 {
- return Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 154, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), uintptr(0))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) != 0 {
+ *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) + 32 /* &.x */)) = func() uintptr {
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0 {
+ return Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
- return *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */))
+ return *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))
}()
- Xsqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
+ Xsqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
} else {
- Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
- Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3ExprListDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
}
break
case uint32(214): /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(215): /* case_exprlist ::= WHEN expr THEN expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(218): /* case_operand ::= expr */
@@ -132737,7 +137705,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(221): /* nexprlist ::= nexprlist COMMA expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = Xsqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(222): /* nexprlist ::= expr */
@@ -132749,16 +137717,16 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
fallthrough // paren_exprlist ::= LP exprlist RP
case uint32(229): /* eidlist_opt ::= LP eidlist RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
}
break
case uint32(225): /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
{
- Xsqlite3CreateIndex(tls, pParse, (yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */),
- Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp+crt.UintptrFromInt32(-4)*24+8 /* &.minor */ /* &.yy0 */), uintptr(0)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-10)*24 + 8 /* &.minor */)),
- (yymsp + crt.UintptrFromInt32(-11)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), 0, *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), uint8(0))
+ Xsqlite3CreateIndex(tls, pParse, (yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */),
+ Xsqlite3SrcListAppend(tls, pParse, uintptr(0), (yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */ /* &.yy0 */), uintptr(0)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)),
+ (yymsp + libc.UintptrFromInt32(-11)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), 0, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)), uint8(0))
if (int32((*Parse)(unsafe.Pointer(pParse)).FeParseMode) >= 2) && ((*Parse)(unsafe.Pointer(pParse)).FpNewIndex != 0) {
- Xsqlite3RenameTokenMap(tls, pParse, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpNewIndex)).FzName, (yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */))
+ Xsqlite3RenameTokenMap(tls, pParse, (*Index)(unsafe.Pointer((*Parse)(unsafe.Pointer(pParse)).FpNewIndex)).FzName, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */))
}
}
break
@@ -132776,17 +137744,17 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(230): /* eidlist ::= eidlist COMMA nm collate sortorder */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = parserAddExprIdListTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = parserAddExprIdListTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(231): /* eidlist ::= nm collate sortorder */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = parserAddExprIdListTerm(tls, pParse, uintptr(0), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))) //A-overwrites-Y
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = parserAddExprIdListTerm(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))) //A-overwrites-Y
}
break
case uint32(234): /* cmd ::= DROP INDEX ifexists fullname */
{
- Xsqlite3DropIndex(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3DropIndex(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
break
case uint32(235): /* cmd ::= VACUUM vinto */
@@ -132796,51 +137764,51 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(236): /* cmd ::= VACUUM nm vinto */
{
- Xsqlite3Vacuum(tls, pParse, (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ Xsqlite3Vacuum(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(239): /* cmd ::= PRAGMA nm dbnm */
{
- Xsqlite3Pragma(tls, pParse, (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0), 0)
+ Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), uintptr(0), 0)
}
break
case uint32(240): /* cmd ::= PRAGMA nm dbnm EQ nmnum */
{
- Xsqlite3Pragma(tls, pParse, (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
+ Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
}
break
case uint32(241): /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
{
- Xsqlite3Pragma(tls, pParse, (yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
+ Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 0)
}
break
case uint32(242): /* cmd ::= PRAGMA nm dbnm EQ minus_num */
{
- Xsqlite3Pragma(tls, pParse, (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
}
break
case uint32(243): /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
{
- Xsqlite3Pragma(tls, pParse, (yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ Xsqlite3Pragma(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
}
break
case uint32(246): /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
{
- // var all Token at bp+104, 16
+ // var all Token at bp+112, 16
- (*Token)(unsafe.Pointer(bp + 104 /* &all */)).Fz = (*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)).Fz
- (*Token)(unsafe.Pointer(bp + 104 /* &all */)).Fn = (uint32((int32((int64((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz) - int64((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-3)*24+8 /* &.minor */)).Fz)) / 1))) + (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn)
- Xsqlite3FinishTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), bp+104 /* &all */)
+ (*Token)(unsafe.Pointer(bp + 112 /* &all */)).Fz = (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)).Fz
+ (*Token)(unsafe.Pointer(bp + 112 /* &all */)).Fn = (uint32((int32((int64((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz) - int64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).Fz)) / 1))) + (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn)
+ Xsqlite3FinishTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), bp+112 /* &all */)
}
break
case uint32(247): /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
{
- Xsqlite3BeginTrigger(tls, pParse, (yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (*TrigEvent)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fa, (*TrigEvent)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-10)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-8)*24 + 8 /* &.minor */)))
- *(*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-10)*24 + 8 /* &.minor */)) = func() Token1 {
- if (*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-6)*24+8 /* &.minor */)).Fn == uint32(0) {
- return *(*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */))
+ Xsqlite3BeginTrigger(tls, pParse, (yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (*TrigEvent)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fa, (*TrigEvent)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)))
+ *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-10)*24 + 8 /* &.minor */)) = func() Token1 {
+ if (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-6)*24+8 /* &.minor */)).Fn == uint32(0) {
+ return *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */))
}
- return *(*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */))
+ return *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */))
}() //A-overwrites-T
}
break
@@ -132851,7 +137819,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(249): /* trigger_time ::= INSTEAD OF */
{
- *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 65
+ *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = 65
}
break
case uint32(250): /* trigger_time ::= */
@@ -132869,8 +137837,8 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(253): /* trigger_event ::= UPDATE OF idlist */
{
- (*TrigEvent)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fa = 127
- (*TrigEvent)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fb = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ (*TrigEvent)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fa = 127
+ (*TrigEvent)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)).Fb = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
break
case uint32(254):
@@ -132884,81 +137852,81 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
fallthrough // when_clause ::= WHEN expr
case uint32(274): /* key_opt ::= KEY expr */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
break
case uint32(256): /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
{
- (*TriggerStep)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))).FpLast)).FpNext = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
- (*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ (*TriggerStep)(unsafe.Pointer((*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))).FpLast)).FpNext = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ (*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
}
break
case uint32(257): /* trigger_cmd_list ::= trigger_cmd SEMI */
{
- (*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ (*TriggerStep)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FpLast = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
}
break
case uint32(258): /* trnm ::= nm DOT nm */
{
- *(*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*Token)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
Xsqlite3ErrorMsg(tls, pParse,
- ts+20651 /* "qualified table ..." */, 0)
+ ts+24633 /* "qualified table ..." */, 0)
}
break
case uint32(259): /* tridxby ::= INDEXED BY nm */
{
Xsqlite3ErrorMsg(tls, pParse,
- ts+20746 /* "the INDEXED BY c..." */, 0)
+ ts+24728 /* "the INDEXED BY c..." */, 0)
}
break
case uint32(260): /* tridxby ::= NOT INDEXED */
{
Xsqlite3ErrorMsg(tls, pParse,
- ts+20830 /* "the NOT INDEXED ..." */, 0)
+ ts+24812 /* "the NOT INDEXED ..." */, 0)
}
break
- case uint32(261): /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
+ case uint32(261): /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3TriggerUpdateStep(tls, pParse, (yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uint8(*(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */))), (*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-7)*24+8 /* &.minor */)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerUpdateStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */))), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-8)*24+8 /* &.minor */)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-8)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(262): /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3TriggerInsertStep(tls, pParse, (yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uint8(*(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-6)*24 + 8 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))) //yylhsminor.yy447-overwrites-yymsp[-6].minor.yy192
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerInsertStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), uint8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-6)*24 + 8 /* &.minor */))), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))) //yylhsminor.yy447-overwrites-yymsp[-6].minor.yy192
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(263): /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3TriggerDeleteStep(tls, pParse, (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-5)*24+8 /* &.minor */)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerDeleteStep(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-5)*24+8 /* &.minor */)).Fz, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(264): /* trigger_cmd ::= scanpt select scanpt */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3TriggerSelectStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))) /*yylhsminor.yy447-overwrites-yymsp[-1].minor.yy539*/
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3TriggerSelectStep(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))) /*yylhsminor.yy447-overwrites-yymsp[-1].minor.yy539*/
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(265): /* expr ::= RAISE LP IGNORE RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 71, uintptr(0), uintptr(0))
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
- (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))).FaffExpr = int8(4)
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3PExpr(tls, pParse, 71, uintptr(0), uintptr(0))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) != 0 {
+ (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))).FaffExpr = int8(4)
}
}
break
case uint32(266): /* expr ::= RAISE LP raisetype COMMA nm RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 71, (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) != 0 {
- (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)))).FaffExpr = int8(*(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3ExprAlloc(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, 71, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), 1)
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) != 0 {
+ (*Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)))).FaffExpr = int8(*(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)))
}
}
break
@@ -132974,12 +137942,12 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(270): /* cmd ::= DROP TRIGGER ifexists fullname */
{
- Xsqlite3DropTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ Xsqlite3DropTrigger(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
break
case uint32(271): /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
{
- Xsqlite3Attach(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ Xsqlite3Attach(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
break
case uint32(272): /* cmd ::= DETACH database_kw_opt expr */
@@ -132994,7 +137962,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(276): /* cmd ::= REINDEX nm dbnm */
{
- Xsqlite3Reindex(tls, pParse, (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
+ Xsqlite3Reindex(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
}
break
case uint32(277): /* cmd ::= ANALYZE */
@@ -133004,18 +137972,18 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(278): /* cmd ::= ANALYZE nm dbnm */
{
- Xsqlite3Analyze(tls, pParse, (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
+ Xsqlite3Analyze(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
}
break
case uint32(279): /* cmd ::= ALTER TABLE fullname RENAME TO nm */
{
- Xsqlite3AlterRenameTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
+ Xsqlite3AlterRenameTable(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
}
break
case uint32(280): /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
{
- (*Token)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fn = (uint32((int32((int64((*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz) - int64((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz)) / 1))) + (*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn)
- Xsqlite3AlterFinishAddColumn(tls, pParse, (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */))
+ (*Token)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)).Fn = (uint32((int32((int64((*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fz) - int64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).Fz)) / 1))) + (*Parse)(unsafe.Pointer(pParse)).FsLastToken.Fn)
+ Xsqlite3AlterFinishAddColumn(tls, pParse, (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */))
}
break
case uint32(281): /* add_column_fullname ::= fullname */
@@ -133026,7 +137994,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(282): /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
{
- Xsqlite3AlterRenameColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
+ Xsqlite3AlterRenameColumn(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */))
}
break
case uint32(283): /* cmd ::= create_vtab */
@@ -133041,7 +138009,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(285): /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
{
- Xsqlite3VtabBeginParse(tls, pParse, (yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
+ Xsqlite3VtabBeginParse(tls, pParse, (yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */ /* &.yy0 */), (yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.yy0 */), *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
}
break
case uint32(286): /* vtabarg ::= */
@@ -133067,73 +138035,73 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(292): /* wqlist ::= nm eidlist_opt AS LP select RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, uintptr(0), (yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) //A-overwrites-X
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, uintptr(0), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))) //A-overwrites-X
}
break
case uint32(293): /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)) = Xsqlite3WithAdd(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-7)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
}
break
case uint32(294): /* windowdefn_list ::= windowdefn */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
- *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(295): /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
{
- Xsqlite3WindowChain(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))).FpNextWin = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */))
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ Xsqlite3WindowChain(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))).FpNextWin = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(296): /* windowdefn ::= nm AS LP window RP */
{
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0 {
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FzName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fz, uint64((*Token)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fn))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0 {
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FzName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fz, uint64((*Token)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-4)*24+8 /* &.minor */)).Fn))
}
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(297): /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0))
}
break
case uint32(298): /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */ /* &.yy0 */))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(299): /* window ::= ORDER BY sortlist frame_opt */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), uintptr(0))
}
break
case uint32(300): /* window ::= nm ORDER BY sortlist frame_opt */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0), *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.yy0 */))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(301):
fallthrough // window ::= frame_opt
case uint32(320): /* filter_over ::= over_clause */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
- *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(302): /* window ::= nm frame_opt */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAssemble(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0), uintptr(0), (yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.yy0 */))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(303): /* frame_opt ::= */
{
@@ -133142,23 +138110,23 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(304): /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (*FrameBound)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).FpExpr, 85, uintptr(0), *(*U8)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).FpExpr, 85, uintptr(0), *(*U8)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(305): /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (*FrameBound)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-3)*24+8 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-3)*24+8 /* &.minor */)).FpExpr, (*FrameBound)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+crt.UintptrFromInt32(-1)*24+8 /* &.minor */)).FpExpr, *(*U8)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3WindowAlloc(tls, pParse, *(*int32)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)), (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-3)*24+8 /* &.minor */)).FpExpr, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).FeType, (*FrameBound)(unsafe.Pointer(yymsp+libc.UintptrFromInt32(-1)*24+8 /* &.minor */)).FpExpr, *(*U8)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-5)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(307):
fallthrough // frame_bound_s ::= frame_bound
case uint32(309): /* frame_bound_e ::= frame_bound */
{
- *(*FrameBound)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = *(*FrameBound)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*FrameBound)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
- *(*FrameBound)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*FrameBound)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(308):
fallthrough // frame_bound_s ::= UNBOUNDED PRECEDING
@@ -133166,17 +138134,17 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
fallthrough
case uint32(312): /* frame_bound ::= CURRENT ROW */
{
- (*FrameBound)(unsafe.Pointer(bp + 72 /* &yylhsminor */)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24)).Fmajor)
- (*FrameBound)(unsafe.Pointer(bp + 72 /* &yylhsminor */)).FpExpr = uintptr(0)
+ (*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24)).Fmajor)
+ (*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)).FpExpr = uintptr(0)
}
- *(*FrameBound)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*FrameBound)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(311): /* frame_bound ::= expr PRECEDING|FOLLOWING */
{
- (*FrameBound)(unsafe.Pointer(bp + 72 /* &yylhsminor */)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp + uintptr(0)*24)).Fmajor)
- (*FrameBound)(unsafe.Pointer(bp + 72 /* &yylhsminor */)).FpExpr = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ (*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)).FeType = int32((*YyStackEntry)(unsafe.Pointer(yymsp + uintptr(0)*24)).Fmajor)
+ (*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */)).FpExpr = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
}
- *(*FrameBound)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*FrameBound)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*FrameBound)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(313): /* frame_exclude_opt ::= */
{
@@ -133185,14 +138153,14 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(314): /* frame_exclude_opt ::= EXCLUDE frame_exclude */
{
- *(*U8)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*U8)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*U8)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
break
case uint32(315):
fallthrough // frame_exclude ::= NO OTHERS
case uint32(316): /* frame_exclude ::= CURRENT ROW */
{
- *(*U8)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = U8((*YyStackEntry)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24)).Fmajor) /*A-overwrites-X*/
+ *(*U8)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = U8((*YyStackEntry)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24)).Fmajor) /*A-overwrites-X*/
}
break
case uint32(317): /* frame_exclude ::= GROUP|TIES */
@@ -133202,45 +138170,45 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
break
case uint32(318): /* window_clause ::= WINDOW windowdefn_list */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
break
case uint32(319): /* filter_over ::= filter_clause over_clause */
{
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
}
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(321): /* filter_over ::= filter_clause */
{
- *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{})))
- if *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)) != 0 {
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)))).FeFrmType = U8(163)
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{})))
+ if *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)) != 0 {
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FeFrmType = U8(163)
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */)))).FpFilter = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */))
} else {
Xsqlite3ExprDelete(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)))
}
}
- *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 72 /* &yylhsminor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp + 80 /* &yylhsminor */))
break
case uint32(322): /* over_clause ::= OVER LP window RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
}
break
case uint32(323): /* over_clause ::= OVER nm */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{})))
- if *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0 {
- (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FzName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz, uint64((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = Xsqlite3DbMallocZero(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, uint64(unsafe.Sizeof(Window{})))
+ if *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) != 0 {
+ (*Window)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))).FzName = Xsqlite3DbStrNDup(tls, (*Parse)(unsafe.Pointer(pParse)).Fdb, (*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fz, uint64((*Token)(unsafe.Pointer(yymsp+uintptr(0)*24+8 /* &.minor */)).Fn))
}
}
break
case uint32(324): /* filter_clause ::= FILTER LP WHERE expr RP */
{
- *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + crt.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
}
break
default:
@@ -133327,7 +138295,7 @@ func yy_reduce(tls *crt.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int
// The following code executes when the parse fails
// The following code executes when a syntax error first occurs.
-func yy_syntax_error(tls *crt.TLS, yypParser uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:158348:13: */
+func yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:159012:13: */
bp := tls.Alloc(24)
defer tls.Free(24)
*(*Token)(unsafe.Pointer(bp + 8)) = yyminor
@@ -133337,9 +138305,9 @@ func yy_syntax_error(tls *crt.TLS, yypParser uintptr, yymajor int32, yyminor Tok
_ = yymajor // Silence some compiler warnings
if *(*int8)(unsafe.Pointer((*Token)(unsafe.Pointer(bp+8 /* &yyminor */)).Fz + uintptr(0))) != 0 {
- Xsqlite3ErrorMsg(tls, pParse, ts+20627 /* "near \"%T\": synta..." */, crt.VaList(bp, bp+8 /* &yyminor */))
+ Xsqlite3ErrorMsg(tls, pParse, ts+24609 /* "near \"%T\": synta..." */, libc.VaList(bp, bp+8 /* &yyminor */))
} else {
- Xsqlite3ErrorMsg(tls, pParse, ts+20915 /* "incomplete input" */, 0)
+ Xsqlite3ErrorMsg(tls, pParse, ts+24897 /* "incomplete input" */, 0)
}
//*********** End %syntax_error code *****************************************
@@ -133347,7 +138315,7 @@ func yy_syntax_error(tls *crt.TLS, yypParser uintptr, yymajor int32, yyminor Tok
}
// The following is executed when the parser accepts
-func yy_accept(tls *crt.TLS, yypParser uintptr) { /* sqlite3.c:158372:13: */
+func yy_accept(tls *libc.TLS, yypParser uintptr) { /* sqlite3.c:159036:13: */
var pParse uintptr = (*YyParser)(unsafe.Pointer(yypParser)).FpParse
@@ -133377,7 +138345,7 @@ func yy_accept(tls *crt.TLS, yypParser uintptr) { /* sqlite3.c:158372:13: */
//
// Outputs:
// None.
-func Xsqlite3Parser(tls *crt.TLS, yyp uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:158413:21: */
+func Xsqlite3Parser(tls *libc.TLS, yyp uintptr, yymajor int32, yyminor Token) { /* sqlite3.c:159077:21: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -133392,13 +138360,13 @@ func Xsqlite3Parser(tls *crt.TLS, yyp uintptr, yymajor int32, yyminor Token) { /
for ok := true; ok; ok = ((*YyParser)(unsafe.Pointer(yypParser)).Fyytos > yypParser+16 /* &.yystack */) {
yyact = yy_find_shift_action(tls, uint16(yymajor), yyact)
- if int32(yyact) >= 1189 {
- yyact = yy_reduce(tls, yypParser, (uint32(int32(yyact) - 1189)), yymajor,
+ if int32(yyact) >= 1191 {
+ yyact = yy_reduce(tls, yypParser, (uint32(int32(yyact) - 1191)), yymajor,
yyminor, pParse)
- } else if int32(yyact) <= 1185 {
+ } else if int32(yyact) <= 1187 {
yy_shift(tls, yypParser, yyact, uint16(yymajor), yyminor)
break
- } else if int32(yyact) == 1187 {
+ } else if int32(yyact) == 1189 {
(*YyParser)(unsafe.Pointer(yypParser)).Fyytos -= 24
yy_accept(tls, yypParser)
return
@@ -133421,7 +138389,7 @@ func Xsqlite3Parser(tls *crt.TLS, yyp uintptr, yymajor int32, yyminor Token) { /
// Return the fallback token corresponding to canonical token iToken, or
// 0 if iToken has no fallback.
-func Xsqlite3ParserFallback(tls *crt.TLS, iToken int32) int32 { /* sqlite3.c:158587:20: */
+func Xsqlite3ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:159251:20: */
return int32(yyFallback[iToken])
}
@@ -133472,7 +138440,7 @@ var aiClass = [256]uint8{
/* Dx */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2),
/* Ex */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2),
/* Fx */ uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2), uint8(2),
-} /* sqlite3.c:158657:28 */
+} /* sqlite3.c:159321:28 */
// The charMap() macro maps alphabetic characters (only) into their
// lower-case ASCII equivalent. On ASCII machines, this is just
@@ -133556,7 +138524,7 @@ var zKWText = [647]int8{
int8('S'), int8('U'), int8('N'), int8('B'), int8('O'), int8('U'), int8('N'), int8('D'), int8('E'), int8('D'), int8('U'), int8('N'), int8('I'), int8('O'), int8('N'), int8('U'), int8('S'), int8('I'),
int8('N'), int8('G'), int8('V'), int8('A'), int8('C'), int8('U'), int8('U'), int8('M'), int8('V'), int8('I'), int8('E'), int8('W'), int8('I'), int8('N'), int8('D'), int8('O'), int8('W'), int8('B'),
int8('Y'), int8('I'), int8('N'), int8('I'), int8('T'), int8('I'), int8('A'), int8('L'), int8('L'), int8('Y'), int8('P'), int8('R'), int8('I'), int8('M'), int8('A'), int8('R'), int8('Y'),
-} /* sqlite3.c:158772:19 */
+} /* sqlite3.c:159436:19 */
// aKWHash[i] is the hash value for the i-th keyword
var aKWHash = [127]uint8{
uint8(84), uint8(102), uint8(132), uint8(82), uint8(114), uint8(29), uint8(0), uint8(0), uint8(91), uint8(0), uint8(85), uint8(72), uint8(0),
@@ -133569,7 +138537,7 @@ var aKWHash = [127]uint8{
uint8(50), uint8(123), uint8(0), uint8(89), uint8(0), uint8(18), uint8(120), uint8(142), uint8(56), uint8(129), uint8(137), uint8(88), uint8(83),
uint8(37), uint8(30), uint8(125), uint8(0), uint8(0), uint8(105), uint8(51), uint8(130), uint8(127), uint8(0), uint8(34), uint8(0), uint8(0),
uint8(44), uint8(0), uint8(95), uint8(38), uint8(39), uint8(0), uint8(20), uint8(45), uint8(116), uint8(90),
-} /* sqlite3.c:158811:28 */
+} /* sqlite3.c:159475:28 */
// aKWNext[] forms the hash collision chain. If aKWHash[i]==0
// then the i-th keyword has no more hash collisions. Otherwise,
// the next keyword with the same hash is aKWHash[i]-1.
@@ -133586,7 +138554,7 @@ var aKWNext = [145]uint8{
uint8(21), uint8(7), uint8(67), uint8(0), uint8(79), uint8(93), uint8(117), uint8(0), uint8(0), uint8(68), uint8(0), uint8(0), uint8(96),
uint8(0), uint8(55), uint8(0), uint8(76), uint8(0), uint8(92), uint8(32), uint8(33), uint8(57), uint8(25), uint8(0), uint8(98), uint8(0),
uint8(0), uint8(87),
-} /* sqlite3.c:158826:28 */
+} /* sqlite3.c:159490:28 */
// aKWLen[i] is the length (in bytes) of the i-th keyword
var aKWLen = [145]uint8{
uint8(7), uint8(7), uint8(5), uint8(4), uint8(6), uint8(4), uint8(5), uint8(3), uint8(6), uint8(7), uint8(3), uint8(6), uint8(6),
@@ -133601,7 +138569,7 @@ var aKWLen = [145]uint8{
uint8(4), uint8(6), uint8(7), uint8(5), uint8(9), uint8(4), uint8(4), uint8(5), uint8(2), uint8(5), uint8(8), uint8(6), uint8(4),
uint8(5), uint8(8), uint8(4), uint8(3), uint8(9), uint8(5), uint8(5), uint8(6), uint8(4), uint8(6), uint8(2), uint8(2), uint8(9),
uint8(3), uint8(7),
-} /* sqlite3.c:158841:28 */
+} /* sqlite3.c:159505:28 */
// aKWOffset[i] is the index into zKWText[] of the start of
// the text for the i-th keyword.
var aKWOffset = [145]uint16{
@@ -133617,7 +138585,7 @@ var aKWOffset = [145]uint16{
uint16(513), uint16(517), uint16(522), uint16(529), uint16(534), uint16(543), uint16(547), uint16(550), uint16(555), uint16(557), uint16(561), uint16(569), uint16(575),
uint16(578), uint16(583), uint16(591), uint16(591), uint16(595), uint16(604), uint16(609), uint16(614), uint16(620), uint16(623), uint16(626), uint16(629), uint16(631),
uint16(636), uint16(640),
-} /* sqlite3.c:158857:33 */
+} /* sqlite3.c:159521:33 */
// aKWCode[i] is the parser symbol code for the i-th keyword
var aKWCode = [145]uint8{
uint8(97), uint8(114), uint8(158), uint8(39), uint8(58),
@@ -133649,7 +138617,7 @@ var aKWCode = [145]uint8{
uint8(116), uint8(12), uint8(76), uint8(75), uint8(90),
uint8(132), uint8(142), uint8(78), uint8(79), uint8(161),
uint8(61), uint8(34), uint8(64), uint8(133), uint8(120),
-} /* sqlite3.c:158872:28 */
+} /* sqlite3.c:159536:28 */
// Hash table decoded:
// 0: INSERT
// 1: IS
@@ -133781,7 +138749,7 @@ var aKWCode = [145]uint8{
// Check to see if z[0..n-1] is a keyword. If it is, write the
// parser symbol code for that keyword into *pType. Always
// return the integer n (the length of the token).
-func keywordCode(tls *crt.TLS, z uintptr, n int32, pType uintptr) int32 { /* sqlite3.c:159035:12: */
+func keywordCode(tls *libc.TLS, z uintptr, n int32, pType uintptr) int32 { /* sqlite3.c:159699:12: */
var i int32
var j int32
var zKW uintptr
@@ -133792,14 +138760,14 @@ func keywordCode(tls *crt.TLS, z uintptr, n int32, pType uintptr) int32 { /* sql
continue
}
zKW = (uintptr(unsafe.Pointer(&zKWText)) + uintptr(aKWOffset[i]))
- if (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) & ^int32(crt.Int32FromInt32(0x20))) != int32(*(*int8)(unsafe.Pointer(zKW + uintptr(0)))) {
+ if (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) & ^int32(libc.Int32FromInt32(0x20))) != int32(*(*int8)(unsafe.Pointer(zKW + uintptr(0)))) {
continue
}
- if (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) & ^int32(crt.Int32FromInt32(0x20))) != int32(*(*int8)(unsafe.Pointer(zKW + uintptr(1)))) {
+ if (int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))) & ^int32(libc.Int32FromInt32(0x20))) != int32(*(*int8)(unsafe.Pointer(zKW + uintptr(1)))) {
continue
}
j = 2
- for (j < n) && ((int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) & ^int32(crt.Int32FromInt32(0x20))) == int32(*(*int8)(unsafe.Pointer(zKW + uintptr(j))))) {
+ for (j < n) && ((int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) & ^int32(libc.Int32FromInt32(0x20))) == int32(*(*int8)(unsafe.Pointer(zKW + uintptr(j))))) {
j++
}
if j < n {
@@ -133956,7 +138924,7 @@ func keywordCode(tls *crt.TLS, z uintptr, n int32, pType uintptr) int32 { /* sql
}
return n
}
-func Xsqlite3KeywordCode(tls *crt.TLS, z uintptr, n int32) int32 { /* sqlite3.c:159207:20: */
+func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32 { /* sqlite3.c:159871:20: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -133964,7 +138932,7 @@ func Xsqlite3KeywordCode(tls *crt.TLS, z uintptr, n int32) int32 { /* sqlite3.c:
keywordCode(tls, z, n, bp /* &id */)
return *(*int32)(unsafe.Pointer(bp /* id */))
}
-func Xsqlite3_keyword_name(tls *crt.TLS, i int32, pzName uintptr, pnName uintptr) int32 { /* sqlite3.c:159213:16: */
+func Xsqlite3_keyword_name(tls *libc.TLS, i int32, pzName uintptr, pnName uintptr) int32 { /* sqlite3.c:159877:16: */
if (i < 0) || (i >= 145) {
return 1
}
@@ -133972,9 +138940,9 @@ func Xsqlite3_keyword_name(tls *crt.TLS, i int32, pzName uintptr, pnName uintptr
*(*int32)(unsafe.Pointer(pnName)) = int32(aKWLen[i])
return 0
}
-func Xsqlite3_keyword_count(tls *crt.TLS) int32 { /* sqlite3.c:159219:16: */ return 145 }
-func Xsqlite3_keyword_check(tls *crt.TLS, zName uintptr, nName int32) int32 { /* sqlite3.c:159220:16: */
- return (crt.Bool32(59 != Xsqlite3KeywordCode(tls, zName, nName)))
+func Xsqlite3_keyword_count(tls *libc.TLS) int32 { /* sqlite3.c:159883:16: */ return 145 }
+func Xsqlite3_keyword_check(tls *libc.TLS, zName uintptr, nName int32) int32 { /* sqlite3.c:159884:16: */
+ return (libc.Bool32(59 != Xsqlite3KeywordCode(tls, zName, nName)))
}
//************* End of keywordhash.h ****************************************
@@ -133996,13 +138964,13 @@ func Xsqlite3_keyword_check(tls *crt.TLS, zName uintptr, nName int32) int32 { /*
// But the feature is undocumented.
// Make the IdChar function accessible from ctime.c and alter.c
-func Xsqlite3IsIdChar(tls *crt.TLS, c U8) int32 { /* sqlite3.c:159267:20: */
- return (crt.Bool32((int32(Xsqlite3CtypeMap[c]) & 0x46) != 0))
+func Xsqlite3IsIdChar(tls *libc.TLS, c U8) int32 { /* sqlite3.c:159931:20: */
+ return (libc.Bool32((int32(Xsqlite3CtypeMap[c]) & 0x46) != 0))
}
// Return the id of the next token in string (*pz). Before returning, set
// (*pz) to point to the byte following the parsed token.
-func getToken(tls *crt.TLS, pz uintptr) int32 { /* sqlite3.c:159274:12: */
+func getToken(tls *libc.TLS, pz uintptr) int32 { /* sqlite3.c:159938:12: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -134052,7 +139020,7 @@ func getToken(tls *crt.TLS, pz uintptr) int32 { /* sqlite3.c:159274:12: */
//
// * the previous token was TK_RP, and
// * the next token is TK_LP.
-func analyzeWindowKeyword(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:159323:12: */
+func analyzeWindowKeyword(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:159987:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = z
@@ -134068,7 +139036,7 @@ func analyzeWindowKeyword(tls *crt.TLS, z uintptr) int32 { /* sqlite3.c:159323:1
}
return 161
}
-func analyzeOverKeyword(tls *crt.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:159331:12: */
+func analyzeOverKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:159995:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = z
@@ -134081,7 +139049,7 @@ func analyzeOverKeyword(tls *crt.TLS, z uintptr, lastToken int32) int32 { /* sql
}
return 59
}
-func analyzeFilterKeyword(tls *crt.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:159338:12: */
+func analyzeFilterKeyword(tls *libc.TLS, z uintptr, lastToken int32) int32 { /* sqlite3.c:160002:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = z
@@ -134094,7 +139062,7 @@ func analyzeFilterKeyword(tls *crt.TLS, z uintptr, lastToken int32) int32 { /* s
// Return the length (in bytes) of the token that begins at z[0].
// Store the token type in *tokenType before returning.
-func Xsqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* sqlite3.c:159350:20: */
+func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32 { /* sqlite3.c:160014:20: */
var i int32
var c int32
switch int32(aiClass[*(*uint8)(unsafe.Pointer(z))]) { // Switch on the character-class of the first byte
@@ -134111,7 +139079,7 @@ func Xsqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* sql
case 11:
{
if int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))) == '-' {
- for i = 2; ((crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0) && (c != '\n'); i++ {
+ for i = 2; ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0) && (c != '\n'); i++ {
}
*(*int32)(unsafe.Pointer(tokenType)) = 179 // IMP: R-22934-25134
return i
@@ -134152,7 +139120,7 @@ func Xsqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* sql
}
i = 3
c = int32(*(*uint8)(unsafe.Pointer(z + uintptr(2))))
- for ; ((c != '*') || (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '/')) && ((crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0); i++ {
+ for ; ((c != '*') || (int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) != '/')) && ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0); i++ {
}
if c != 0 {
i++
@@ -134168,11 +139136,11 @@ func Xsqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* sql
case 14:
{
*(*int32)(unsafe.Pointer(tokenType)) = 53
- return (1 + (crt.Bool32(int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))) == '=')))
+ return (1 + (libc.Bool32(int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))) == '=')))
}
case 12:
{
- if (crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))))) == '=' {
+ if (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))))) == '=' {
*(*int32)(unsafe.Pointer(tokenType)) = 55
return 2
} else if c == '>' {
@@ -134189,7 +139157,7 @@ func Xsqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* sql
fallthrough
case 13:
{
- if (crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))))) == '=' {
+ if (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(1)))))) == '=' {
*(*int32)(unsafe.Pointer(tokenType)) = 57
return 2
} else if c == '>' {
@@ -134242,7 +139210,7 @@ func Xsqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* sql
{
var delim int32 = int32(*(*uint8)(unsafe.Pointer(z + uintptr(0))))
- for i = 1; (crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0; i++ {
+ for i = 1; (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0; i++ {
if c == delim {
if int32(*(*uint8)(unsafe.Pointer(z + uintptr((i + 1))))) == delim {
i++
@@ -134271,6 +139239,7 @@ func Xsqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* sql
}
// If the next character is a digit, this is a floating point
// number that begins with ".". Fall thru into the next case
+ /* no break */
}
fallthrough
case 3:
@@ -134309,7 +139278,7 @@ func Xsqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* sql
{
i = 1
c = int32(*(*uint8)(unsafe.Pointer(z + uintptr(0))))
- for ; (c != ']') && ((crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0); i++ {
+ for ; (c != ']') && ((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0); i++ {
}
*(*int32)(unsafe.Pointer(tokenType)) = func() int32 {
if c == ']' {
@@ -134333,11 +139302,11 @@ func Xsqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* sql
var n int32 = 0
*(*int32)(unsafe.Pointer(tokenType)) = 153
- for i = 1; (crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0; i++ {
+ for i = 1; (libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0; i++ {
if (int32(Xsqlite3CtypeMap[uint8(c)]) & 0x46) != 0 {
n++
} else if (c == '(') && (n > 0) {
- for ok := true; ok; ok = ((((crt.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0) && !((int32(Xsqlite3CtypeMap[uint8(c)]) & 0x01) != 0)) && (c != ')')) {
+ for ok := true; ok; ok = ((((libc.AssignInt32(&c, int32(*(*uint8)(unsafe.Pointer(z + uintptr(i)))))) != 0) && !((int32(Xsqlite3CtypeMap[uint8(c)]) & 0x01) != 0)) && (c != ')')) {
i++
}
if c == ')' {
@@ -134391,6 +139360,7 @@ func Xsqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* sql
}
// If it is not a BLOB literal, then it must be an ID, since no
// SQL keywords start with the letter 'x'. Fall through
+ /* no break */
}
fallthrough
case 2:
@@ -134421,7 +139391,7 @@ func Xsqlite3GetToken(tls *crt.TLS, z uintptr, tokenType uintptr) int32 { /* sql
// then an and attempt is made to write an error message into
// memory obtained from sqlite3_malloc() and to make *pzErrMsg point to that
// error message.
-func Xsqlite3RunParser(tls *crt.TLS, pParse uintptr, zSql uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:159634:20: */
+func Xsqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:160300:20: */
bp := tls.Alloc(2468)
defer tls.Free(2468)
@@ -134438,7 +139408,7 @@ func Xsqlite3RunParser(tls *crt.TLS, pParse uintptr, zSql uintptr, pzErrMsg uint
mxSqlLen = *(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(1)*4))
if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 {
- *(*int32)(unsafe.Pointer((db + 368 /* &.u1 */ /* &.isInterrupted */))) = 0
+ *(*int32)(unsafe.Pointer((db + 392 /* &.u1 */ /* &.isInterrupted */))) = 0
}
(*Parse)(unsafe.Pointer(pParse)).Frc = 0
(*Parse)(unsafe.Pointer(pParse)).FzTail = zSql
@@ -134457,7 +139427,7 @@ func Xsqlite3RunParser(tls *crt.TLS, pParse uintptr, zSql uintptr, pzErrMsg uint
}
if *(*int32)(unsafe.Pointer(bp + 2464 /* tokenType */)) >= 161 {
- if *(*int32)(unsafe.Pointer((db + 368 /* &.u1 */ /* &.isInterrupted */))) != 0 {
+ if *(*int32)(unsafe.Pointer((db + 392 /* &.u1 */ /* &.isInterrupted */))) != 0 {
(*Parse)(unsafe.Pointer(pParse)).Frc = 9
break
}
@@ -134486,7 +139456,7 @@ func Xsqlite3RunParser(tls *crt.TLS, pParse uintptr, zSql uintptr, pzErrMsg uint
*(*int32)(unsafe.Pointer(bp + 2464 /* tokenType */)) = analyzeFilterKeyword(tls, (zSql + uintptr(6)), lastTokenParsed)
} else {
- Xsqlite3ErrorMsg(tls, pParse, ts+20932 /* "unrecognized tok..." */, crt.VaList(bp, n, zSql))
+ Xsqlite3ErrorMsg(tls, pParse, ts+24914 /* "unrecognized tok..." */, libc.VaList(bp, n, zSql))
break
}
}
@@ -134506,13 +139476,13 @@ func Xsqlite3RunParser(tls *crt.TLS, pParse uintptr, zSql uintptr, pzErrMsg uint
(*Parse)(unsafe.Pointer(pParse)).Frc = 7
}
if (((*Parse)(unsafe.Pointer(pParse)).Frc != 0) && ((*Parse)(unsafe.Pointer(pParse)).Frc != 101)) && ((*Parse)(unsafe.Pointer(pParse)).FzErrMsg == uintptr(0)) {
- (*Parse)(unsafe.Pointer(pParse)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+696 /* "%s" */, crt.VaList(bp+16, Xsqlite3ErrStr(tls, (*Parse)(unsafe.Pointer(pParse)).Frc)))
+ (*Parse)(unsafe.Pointer(pParse)).FzErrMsg = Xsqlite3MPrintf(tls, db, ts+805 /* "%s" */, libc.VaList(bp+16, Xsqlite3ErrStr(tls, (*Parse)(unsafe.Pointer(pParse)).Frc)))
}
if (*Parse)(unsafe.Pointer(pParse)).FzErrMsg != 0 {
*(*uintptr)(unsafe.Pointer(pzErrMsg)) = (*Parse)(unsafe.Pointer(pParse)).FzErrMsg
- Xsqlite3_log(tls, (*Parse)(unsafe.Pointer(pParse)).Frc, ts+20959, /* "%s in \"%s\"" */
- crt.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pzErrMsg)), (*Parse)(unsafe.Pointer(pParse)).FzTail))
+ Xsqlite3_log(tls, (*Parse)(unsafe.Pointer(pParse)).Frc, ts+24941, /* "%s in \"%s\"" */
+ libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(pzErrMsg)), (*Parse)(unsafe.Pointer(pParse)).FzTail))
(*Parse)(unsafe.Pointer(pParse)).FzErrMsg = uintptr(0)
nErr++
}
@@ -134634,7 +139604,7 @@ func Xsqlite3RunParser(tls *crt.TLS, pParse uintptr, zSql uintptr, pzErrMsg uint
// If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
// to recognize the end of a trigger can be omitted. All we have to do
// is look for a semicolon that is not part of an string or comment.
-func Xsqlite3_complete(tls *crt.TLS, zSql uintptr) int32 { /* sqlite3.c:160050:16: */
+func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160716:16: */
var state U8 = U8(0) // Current state, using numbers defined in header comment
var token U8
@@ -134685,7 +139655,7 @@ func Xsqlite3_complete(tls *crt.TLS, zSql uintptr) int32 { /* sqlite3.c:160050:1
zSql++
}
if int32(*(*int8)(unsafe.Pointer(zSql))) == 0 {
- return (crt.Bool32(int32(state) == 1))
+ return (libc.Bool32(int32(state) == 1))
}
token = U8(1)
break
@@ -134731,7 +139701,7 @@ func Xsqlite3_complete(tls *crt.TLS, zSql uintptr) int32 { /* sqlite3.c:160050:1
fallthrough
case 'C':
{
- if (nId == 6) && (Xsqlite3_strnicmp(tls, zSql, ts+20970 /* "create" */, 6) == 0) {
+ if (nId == 6) && (Xsqlite3_strnicmp(tls, zSql, ts+24952 /* "create" */, 6) == 0) {
token = U8(4)
} else {
token = U8(2)
@@ -134743,11 +139713,11 @@ func Xsqlite3_complete(tls *crt.TLS, zSql uintptr) int32 { /* sqlite3.c:160050:1
fallthrough
case 'T':
{
- if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+17838 /* "trigger" */, 7) == 0) {
+ if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+21426 /* "trigger" */, 7) == 0) {
token = U8(6)
- } else if (nId == 4) && (Xsqlite3_strnicmp(tls, zSql, ts+20977 /* "temp" */, 4) == 0) {
+ } else if (nId == 4) && (Xsqlite3_strnicmp(tls, zSql, ts+24959 /* "temp" */, 4) == 0) {
token = U8(5)
- } else if (nId == 9) && (Xsqlite3_strnicmp(tls, zSql, ts+20982 /* "temporary" */, 9) == 0) {
+ } else if (nId == 9) && (Xsqlite3_strnicmp(tls, zSql, ts+24964 /* "temporary" */, 9) == 0) {
token = U8(5)
} else {
token = U8(2)
@@ -134759,9 +139729,9 @@ func Xsqlite3_complete(tls *crt.TLS, zSql uintptr) int32 { /* sqlite3.c:160050:1
fallthrough
case 'E':
{
- if (nId == 3) && (Xsqlite3_strnicmp(tls, zSql, ts+20992 /* "end" */, 3) == 0) {
+ if (nId == 3) && (Xsqlite3_strnicmp(tls, zSql, ts+24974 /* "end" */, 3) == 0) {
token = U8(7)
- } else if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+20996 /* "explain" */, 7) == 0) {
+ } else if (nId == 7) && (Xsqlite3_strnicmp(tls, zSql, ts+24978 /* "explain" */, 7) == 0) {
token = U8(3)
} else {
token = U8(2)
@@ -134786,7 +139756,7 @@ func Xsqlite3_complete(tls *crt.TLS, zSql uintptr) int32 { /* sqlite3.c:160050:1
state = *(*U8)(unsafe.Pointer((uintptr(unsafe.Pointer(&trans)) + uintptr(state)*8) + uintptr(token)))
zSql++
}
- return (crt.Bool32(int32(state) == 1))
+ return (libc.Bool32(int32(state) == 1))
}
var trans = [8][8]U8{
@@ -134800,12 +139770,12 @@ var trans = [8][8]U8{
/* 5 TRIGGER: */ {U8(6), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5)},
/* 6 SEMI: */ {U8(6), U8(6), U8(5), U8(5), U8(5), U8(5), U8(5), U8(7)},
/* 7 END: */ {U8(1), U8(7), U8(5), U8(5), U8(5), U8(5), U8(5), U8(5)},
-} /* sqlite3.c:160058:19 */
+} /* sqlite3.c:160724:19 */
// This routine is the same as the sqlite3_complete() routine described
// above, except that the parameter is required to be UTF-16 encoded, not
// UTF-8.
-func Xsqlite3_complete16(tls *crt.TLS, zSql uintptr) int32 { /* sqlite3.c:160215:16: */
+func Xsqlite3_complete16(tls *libc.TLS, zSql uintptr) int32 { /* sqlite3.c:160881:16: */
var pVal uintptr
var zSql8 uintptr
var rc int32
@@ -134826,44 +139796,33 @@ func Xsqlite3_complete16(tls *crt.TLS, zSql uintptr) int32 { /* sqlite3.c:160215
return (rc & 0xff)
}
-//************* End of complete.c *******************************************
-//************* Begin file main.c *******************************************
-// 2001 September 15
-//
-// The author disclaims copyright to this source code. In place of
-// a legal notice, here is a blessing:
-//
-// May you do good and not evil.
-// May you find forgiveness for yourself and forgive others.
-// May you share freely, never taking more than you give.
-//
-//
-// Main file for the SQLite library. The routines in this file
-// implement the programmer interface to the library. Routines in
-// other files are for internal use by SQLite and should not be
-// accessed by users of the library.
-// #include "sqliteInt.h"
+//************* End of rtree.h **********************************************
+//************* Continuing where we left off in main.c **********************
// This is an extension initializer that is a no-op and always
// succeeds, except that it fails if the fault-simulation is set
// to 500.
-func sqlite3TestExtInit(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:160368:12: */
+func sqlite3TestExtInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:161033:12: */
_ = db
return Xsqlite3FaultSim(tls, 500)
}
// An array of pointers to extension initializer functions for
// built-in extensions.
-var sqlite3BuiltinExtensions = [4]uintptr{
+var sqlite3BuiltinExtensions = [8]uintptr{
+ 0,
0,
0,
0,
0,
-} /* sqlite3.c:160398:12 */
+ 0,
+ 0,
+ 0,
+} /* sqlite3.c:161063:12 */
// IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
// a pointer to the to the sqlite3_version[] string constant.
-func Xsqlite3_libversion(tls *crt.TLS) uintptr { /* sqlite3.c:160445:23: */
+func Xsqlite3_libversion(tls *libc.TLS) uintptr { /* sqlite3.c:161110:23: */
return uintptr(unsafe.Pointer(&Xsqlite3_version))
}
@@ -134876,31 +139835,31 @@ func Xsqlite3_libversion(tls *crt.TLS) uintptr { /* sqlite3.c:160445:23: */
// IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
// returns an integer equal to SQLITE_VERSION_NUMBER.
-func Xsqlite3_libversion_number(tls *crt.TLS) int32 { /* sqlite3.c:160458:16: */ return 3032003 }
+func Xsqlite3_libversion_number(tls *libc.TLS) int32 { /* sqlite3.c:161123:16: */ return 3033000 }
// IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
// zero if and only if SQLite was compiled with mutexing code omitted due to
// the SQLITE_THREADSAFE compile-time option being set to 0.
-func Xsqlite3_threadsafe(tls *crt.TLS) int32 { /* sqlite3.c:160464:16: */ return 1 }
+func Xsqlite3_threadsafe(tls *libc.TLS) int32 { /* sqlite3.c:161129:16: */ return 1 }
// When compiling the test fixture or with debugging enabled (on Win32),
// this variable being set to non-zero will cause OSTRACE macros to emit
// extra diagnostic information.
-var Xsqlite3OSTrace int32 = 0 /* sqlite3.c:160475:7 */
+var Xsqlite3OSTrace int32 = 0 /* sqlite3.c:161140:7 */
// If the following global variable points to a string which is the
// name of a directory, then that directory will be used to store
// temporary files.
//
// See also the "PRAGMA temp_store_directory" SQL command.
-var Xsqlite3_temp_directory uintptr = uintptr(0) /* sqlite3.c:160495:17 */
+var Xsqlite3_temp_directory uintptr = uintptr(0) /* sqlite3.c:161160:17 */
// If the following global variable points to a string which is the
// name of a directory, then that directory will be used to store
// all database files specified with a relative pathname.
//
// See also the "PRAGMA data_store_directory" SQL command.
-var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:160504:17 */
+var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:161169:17 */
// Initialize SQLite.
//
@@ -134931,9 +139890,9 @@ var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:160504:17 */
//
// * Recursive calls to this routine from thread X return immediately
// without blocking.
-func Xsqlite3_initialize(tls *crt.TLS) int32 { /* sqlite3.c:160537:16: */
- var pMaster uintptr // The main static mutex
- var rc int32 // Result code
+func Xsqlite3_initialize(tls *libc.TLS) int32 { /* sqlite3.c:161202:16: */
+ var pMainMtx uintptr // The main static mutex
+ var rc int32 // Result code
// If the following assert() fails on some obscure processor/compiler
// combination, the work-around is to set the correct pointer
@@ -134961,12 +139920,12 @@ func Xsqlite3_initialize(tls *crt.TLS) int32 { /* sqlite3.c:160537:16: */
}
// Initialize the malloc() system and the recursive pInitMutex mutex.
- // This operation is protected by the STATIC_MASTER mutex. Note that
+ // This operation is protected by the STATIC_MAIN mutex. Note that
// MutexAlloc() is called for a static mutex prior to initializing the
// malloc subsystem - this implies that the allocation of a static
// mutex must not require support from the malloc subsystem.
- pMaster = Xsqlite3MutexAlloc(tls, 2)
- Xsqlite3_mutex_enter(tls, pMaster)
+ pMainMtx = Xsqlite3MutexAlloc(tls, 2)
+ Xsqlite3_mutex_enter(tls, pMainMtx)
Xsqlite3Config.FisMutexInit = 1
if !(Xsqlite3Config.FisMallocInit != 0) {
rc = Xsqlite3MallocInit(tls)
@@ -134983,7 +139942,7 @@ func Xsqlite3_initialize(tls *crt.TLS) int32 { /* sqlite3.c:160537:16: */
if rc == 0 {
Xsqlite3Config.FnRefInitMutex++
}
- Xsqlite3_mutex_leave(tls, pMaster)
+ Xsqlite3_mutex_leave(tls, pMainMtx)
// If rc is not SQLITE_OK at this point, then either the malloc
// subsystem could not be initialized or the system failed to allocate
@@ -135007,7 +139966,7 @@ func Xsqlite3_initialize(tls *crt.TLS) int32 { /* sqlite3.c:160537:16: */
Xsqlite3_mutex_enter(tls, Xsqlite3Config.FpInitMutex)
if (Xsqlite3Config.FisInit == 0) && (Xsqlite3Config.FinProgress == 0) {
Xsqlite3Config.FinProgress = 1
- crt.Xmemset(tls, uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)), 0, uint64(unsafe.Sizeof(Xsqlite3BuiltinFunctions)))
+ libc.Xmemset(tls, uintptr(unsafe.Pointer(&Xsqlite3BuiltinFunctions)), 0, uint64(unsafe.Sizeof(Xsqlite3BuiltinFunctions)))
Xsqlite3RegisterBuiltinFunctions(tls)
if Xsqlite3Config.FisPCacheInit == 0 {
rc = Xsqlite3PcacheInitialize(tls)
@@ -135031,14 +139990,14 @@ func Xsqlite3_initialize(tls *crt.TLS) int32 { /* sqlite3.c:160537:16: */
// Go back under the static mutex and clean up the recursive
// mutex to prevent a resource leak.
- Xsqlite3_mutex_enter(tls, pMaster)
+ Xsqlite3_mutex_enter(tls, pMainMtx)
Xsqlite3Config.FnRefInitMutex--
if Xsqlite3Config.FnRefInitMutex <= 0 {
Xsqlite3_mutex_free(tls, Xsqlite3Config.FpInitMutex)
Xsqlite3Config.FpInitMutex = uintptr(0)
}
- Xsqlite3_mutex_leave(tls, pMaster)
+ Xsqlite3_mutex_leave(tls, pMainMtx)
// The following is just a sanity check to make sure SQLite has
// been compiled correctly. It is important to run this code, but
@@ -135057,7 +140016,7 @@ func Xsqlite3_initialize(tls *crt.TLS) int32 { /* sqlite3.c:160537:16: */
// routine is not threadsafe. But it is safe to invoke this routine
// on when SQLite is already shut down. If SQLite is already shut down
// when this routine is invoked, then this routine is a harmless no-op.
-func Xsqlite3_shutdown(tls *crt.TLS) int32 { /* sqlite3.c:160712:16: */
+func Xsqlite3_shutdown(tls *libc.TLS) int32 { /* sqlite3.c:161377:16: */
if Xsqlite3Config.FisInit != 0 {
Xsqlite3_os_end(tls)
@@ -135096,7 +140055,7 @@ func Xsqlite3_shutdown(tls *crt.TLS) int32 { /* sqlite3.c:160712:16: */
// database connections or memory allocations. This routine is not
// threadsafe. Failure to heed these warnings can lead to unpredictable
// behavior.
-func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:160766:16: */
+func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:161431:16: */
var ap Va_list
_ = ap
var rc int32 = 0
@@ -135104,7 +140063,7 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
// sqlite3_config() shall return SQLITE_MISUSE if it is invoked while
// the SQLite library is in use.
if Xsqlite3Config.FisInit != 0 {
- return Xsqlite3MisuseError(tls, 160772)
+ return Xsqlite3MisuseError(tls, 161437)
}
ap = va
@@ -135139,13 +140098,13 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
case 10:
{
// Specify an alternative mutex implementation
- Xsqlite3Config.Fmutex = *(*Sqlite3_mutex_methods)(unsafe.Pointer(crt.VaUintptr(&ap)))
+ Xsqlite3Config.Fmutex = *(*Sqlite3_mutex_methods)(unsafe.Pointer(libc.VaUintptr(&ap)))
break
}
case 11:
{
// Retrieve the current mutex implementation
- *(*Sqlite3_mutex_methods)(unsafe.Pointer(crt.VaUintptr(&ap))) = Xsqlite3Config.Fmutex
+ *(*Sqlite3_mutex_methods)(unsafe.Pointer(libc.VaUintptr(&ap))) = Xsqlite3Config.Fmutex
break
}
@@ -135156,7 +140115,7 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
// sqlite3_mem_methods structure. The argument specifies alternative
// low-level memory allocation routines to be used in place of the memory
// allocation routines built into SQLite.
- Xsqlite3Config.Fm = *(*Sqlite3_mem_methods)(unsafe.Pointer(crt.VaUintptr(&ap)))
+ Xsqlite3Config.Fm = *(*Sqlite3_mem_methods)(unsafe.Pointer(libc.VaUintptr(&ap)))
break
}
case 5:
@@ -135168,7 +140127,7 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
if Xsqlite3Config.Fm.FxMalloc == uintptr(0) {
Xsqlite3MemSetDefault(tls)
}
- *(*Sqlite3_mem_methods)(unsafe.Pointer(crt.VaUintptr(&ap))) = Xsqlite3Config.Fm
+ *(*Sqlite3_mem_methods)(unsafe.Pointer(libc.VaUintptr(&ap))) = Xsqlite3Config.Fm
break
}
case 9:
@@ -135176,12 +140135,12 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
// EVIDENCE-OF: R-61275-35157 The SQLITE_CONFIG_MEMSTATUS option takes
// single argument of type int, interpreted as a boolean, which enables
// or disables the collection of memory allocation statistics.
- Xsqlite3Config.FbMemstat = int32(crt.VaInt32(&ap))
+ Xsqlite3Config.FbMemstat = int32(libc.VaInt32(&ap))
break
}
case 27:
{
- Xsqlite3Config.FbSmallMalloc = U8(crt.VaInt32(&ap))
+ Xsqlite3Config.FbSmallMalloc = U8(libc.VaInt32(&ap))
break
}
case 7:
@@ -135190,9 +140149,9 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
// SQLITE_CONFIG_PAGECACHE: A pointer to 8-byte aligned memory (pMem),
// the size of each page cache line (sz), and the number of cache lines
// (N).
- Xsqlite3Config.FpPage = crt.VaUintptr(&ap)
- Xsqlite3Config.FszPage = int32(crt.VaInt32(&ap))
- Xsqlite3Config.FnPage = int32(crt.VaInt32(&ap))
+ Xsqlite3Config.FpPage = libc.VaUintptr(&ap)
+ Xsqlite3Config.FszPage = int32(libc.VaInt32(&ap))
+ Xsqlite3Config.FnPage = int32(libc.VaInt32(&ap))
break
}
case 24:
@@ -135201,7 +140160,7 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
// a single parameter which is a pointer to an integer and writes into
// that integer the number of extra bytes per page required for each page
// in SQLITE_CONFIG_PAGECACHE.
- *(*int32)(unsafe.Pointer(crt.VaUintptr(&ap))) = ((Xsqlite3HeaderSizeBtree(tls) + Xsqlite3HeaderSizePcache(tls)) + Xsqlite3HeaderSizePcache1(tls))
+ *(*int32)(unsafe.Pointer(libc.VaUintptr(&ap))) = ((Xsqlite3HeaderSizeBtree(tls) + Xsqlite3HeaderSizePcache(tls)) + Xsqlite3HeaderSizePcache1(tls))
break
}
@@ -135223,7 +140182,7 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
// single argument which is a pointer to an sqlite3_pcache_methods2
// object. This object specifies the interface to a custom page cache
// implementation.
- Xsqlite3Config.Fpcache2 = *(*Sqlite3_pcache_methods2)(unsafe.Pointer(crt.VaUintptr(&ap)))
+ Xsqlite3Config.Fpcache2 = *(*Sqlite3_pcache_methods2)(unsafe.Pointer(libc.VaUintptr(&ap)))
break
}
case 19:
@@ -135235,7 +140194,7 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
if Xsqlite3Config.Fpcache2.FxInit == uintptr(0) {
Xsqlite3PCacheSetDefault(tls)
}
- *(*Sqlite3_pcache_methods2)(unsafe.Pointer(crt.VaUintptr(&ap))) = Xsqlite3Config.Fpcache2
+ *(*Sqlite3_pcache_methods2)(unsafe.Pointer(libc.VaUintptr(&ap))) = Xsqlite3Config.Fpcache2
break
}
@@ -135245,8 +140204,8 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
case 13:
{
- Xsqlite3Config.FszLookaside = int32(crt.VaInt32(&ap))
- Xsqlite3Config.FnLookaside = int32(crt.VaInt32(&ap))
+ Xsqlite3Config.FszLookaside = int32(libc.VaInt32(&ap))
+ Xsqlite3Config.FnLookaside = int32(libc.VaInt32(&ap))
break
}
@@ -135255,8 +140214,8 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
// NULL.
case 16:
{
- Xsqlite3Config.FxLog = crt.VaUintptr(&ap)
- Xsqlite3Config.FpLogArg = crt.VaUintptr(&ap)
+ Xsqlite3Config.FxLog = libc.VaUintptr(&ap)
+ Xsqlite3Config.FpLogArg = libc.VaUintptr(&ap)
break
}
@@ -135270,7 +140229,7 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
// argument of type int. If non-zero, then URI handling is globally
// enabled. If the parameter is zero, then URI handling is globally
// disabled.
- Xsqlite3Config.FbOpenUri = U8(crt.VaInt32(&ap))
+ Xsqlite3Config.FbOpenUri = U8(libc.VaInt32(&ap))
break
}
@@ -135280,7 +140239,7 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
// option takes a single integer argument which is interpreted as a
// boolean in order to enable or disable the use of covering indices for
// full table scans in the query optimizer.
- Xsqlite3Config.FbUseCis = U8(crt.VaInt32(&ap))
+ Xsqlite3Config.FbUseCis = U8(libc.VaInt32(&ap))
break
}
@@ -135290,8 +140249,8 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
// integer (sqlite3_int64) values that are the default mmap size limit
// (the default setting for PRAGMA mmap_size) and the maximum allowed
// mmap size limit.
- var szMmap Sqlite3_int64 = Sqlite3_int64(crt.VaInt64(&ap))
- var mxMmap Sqlite3_int64 = Sqlite3_int64(crt.VaInt64(&ap))
+ var szMmap Sqlite3_int64 = Sqlite3_int64(libc.VaInt64(&ap))
+ var mxMmap Sqlite3_int64 = Sqlite3_int64(libc.VaInt64(&ap))
// EVIDENCE-OF: R-53367-43190 If either argument to this option is
// negative, then that argument is changed to its compile-time default.
//
@@ -135299,8 +140258,8 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
// silently truncated if necessary so that it does not exceed the
// compile-time maximum mmap size set by the SQLITE_MAX_MMAP_SIZE
// compile-time option.
- if (mxMmap < int64(0)) || (mxMmap > 8589934592) {
- mxMmap = 8589934592
+ if (mxMmap < int64(0)) || (mxMmap > int64(0x7fff0000)) {
+ mxMmap = int64(0x7fff0000)
}
if szMmap < int64(0) {
szMmap = int64(0)
@@ -135315,19 +140274,19 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
case 25:
{
- Xsqlite3Config.FszPma = U32(crt.VaUint32(&ap))
+ Xsqlite3Config.FszPma = U32(libc.VaUint32(&ap))
break
}
case 26:
{
- Xsqlite3Config.FnStmtSpill = int32(crt.VaInt32(&ap))
+ Xsqlite3Config.FnStmtSpill = int32(libc.VaInt32(&ap))
break
}
case 29:
{
- Xsqlite3Config.FmxMemdbSize = Sqlite3_int64(crt.VaInt64(&ap))
+ Xsqlite3Config.FmxMemdbSize = Sqlite3_int64(libc.VaInt64(&ap))
break
}
@@ -135350,7 +140309,7 @@ func Xsqlite3_config(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:16
// space for the lookaside memory is obtained from sqlite3_malloc().
// If pStart is not NULL then it is sz*cnt bytes of memory to use for
// the lookaside memory.
-func setupLookaside(tls *crt.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32) int32 { /* sqlite3.c:161084:12: */
+func setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32) int32 { /* sqlite3.c:161749:12: */
var pStart uintptr
var szAlloc Sqlite3_int64 = (Sqlite3_int64(sz) * Sqlite3_int64(cnt))
var nBig int32 // Number of full-size slots
@@ -135367,7 +140326,7 @@ func setupLookaside(tls *crt.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32)
}
// The size of a lookaside slot after ROUNDDOWN8 needs to be larger
// than a pointer to be useful.
- sz = ((sz) & ^int32(crt.Int32FromInt32(7))) // IMP: R-33038-09382
+ sz = ((sz) & ^int32(libc.Int32FromInt32(7))) // IMP: R-33038-09382
if sz <= int32(unsafe.Sizeof(uintptr(0))) {
sz = 0
}
@@ -135397,7 +140356,7 @@ func setupLookaside(tls *crt.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32)
nBig = (int32(szAlloc / Sqlite3_int64(sz)))
nSm = 0
} else {
- nBig = crt.AssignInt32(&nSm, 0)
+ nBig = libc.AssignInt32(&nSm, 0)
}
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpStart = pStart
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FpInit = uintptr(0)
@@ -135448,13 +140407,13 @@ func setupLookaside(tls *crt.TLS, db uintptr, pBuf uintptr, sz int32, cnt int32)
}
// Return the mutex associated with a database connection.
-func Xsqlite3_db_mutex(tls *crt.TLS, db uintptr) uintptr { /* sqlite3.c:161184:26: */
+func Xsqlite3_db_mutex(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:161849:26: */
return (*Sqlite3)(unsafe.Pointer(db)).Fmutex
}
// Free up as much memory as we can from the given database
// connection.
-func Xsqlite3_db_release_memory(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:161198:16: */
+func Xsqlite3_db_release_memory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:161863:16: */
var i int32
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -135473,7 +140432,7 @@ func Xsqlite3_db_release_memory(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:1
// Flush any dirty pages in the pager-cache for any attached database
// to disk.
-func Xsqlite3_db_cacheflush(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:161222:16: */
+func Xsqlite3_db_cacheflush(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:161887:16: */
var i int32
var rc int32 = 0
var bSeenBusy int32 = 0
@@ -135502,7 +140461,7 @@ func Xsqlite3_db_cacheflush(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:16122
}
// Configuration settings for an individual database connection
-func Xsqlite3_db_config(tls *crt.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:161251:16: */
+func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) int32 { /* sqlite3.c:161916:16: */
var ap Va_list
_ = ap
var rc int32
@@ -135512,15 +140471,15 @@ func Xsqlite3_db_config(tls *crt.TLS, db uintptr, op int32, va uintptr) int32 {
{
// IMP: R-06824-28531
// IMP: R-36257-52125
- (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(0)*32)).FzDbSName = crt.VaUintptr(&ap)
+ (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(0)*32)).FzDbSName = libc.VaUintptr(&ap)
rc = 0
break
}
case 1001:
{
- var pBuf uintptr = crt.VaUintptr(&ap) // IMP: R-26835-10964
- var sz int32 = int32(crt.VaInt32(&ap)) // IMP: R-47871-25994
- var cnt int32 = int32(crt.VaInt32(&ap)) // IMP: R-04460-53386
+ var pBuf uintptr = libc.VaUintptr(&ap) // IMP: R-26835-10964
+ var sz int32 = int32(libc.VaInt32(&ap)) // IMP: R-47871-25994
+ var cnt int32 = int32(libc.VaInt32(&ap)) // IMP: R-04460-53386
rc = setupLookaside(tls, db, pBuf, sz, cnt)
break
}
@@ -135533,8 +140492,8 @@ func Xsqlite3_db_config(tls *crt.TLS, db uintptr, op int32, va uintptr) int32 {
Fmask U32
}{})))))); i++ {
if aFlagOp[i].Fop == op {
- var onoff int32 = int32(crt.VaInt32(&ap))
- var pRes uintptr = crt.VaUintptr(&ap)
+ var onoff int32 = int32(libc.VaInt32(&ap))
+ var pRes uintptr = libc.VaUintptr(&ap)
var oldFlags U64 = (*Sqlite3)(unsafe.Pointer(db)).Fflags
if onoff > 0 {
*(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (U64(aFlagOp[i].Fmask))
@@ -135545,7 +140504,7 @@ func Xsqlite3_db_config(tls *crt.TLS, db uintptr, op int32, va uintptr) int32 {
Xsqlite3ExpirePreparedStatements(tls, db, 0)
}
if pRes != 0 {
- *(*int32)(unsafe.Pointer(pRes)) = (crt.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & U64(aFlagOp[i].Fmask)) != uint64(0)))
+ *(*int32)(unsafe.Pointer(pRes)) = (libc.Bool32(((*Sqlite3)(unsafe.Pointer(db)).Fflags & U64(aFlagOp[i].Fmask)) != uint64(0)))
}
rc = 0
break
@@ -135578,11 +140537,11 @@ var aFlagOp = [16]struct {
{Fop: 1013, Fmask: U32(0x40000000)},
{Fop: 1016, Fmask: U32(0x00000002)},
{Fop: 1017, Fmask: U32(0x00000080)},
-} /* sqlite3.c:161274:9 */
+} /* sqlite3.c:161939:9 */
// This is the default collating function named "BINARY" which is always
// available.
-func binCollFunc(tls *crt.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:161326:12: */
+func binCollFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:161991:12: */
var rc int32
var n int32
_ = NotUsed
@@ -135595,7 +140554,7 @@ func binCollFunc(tls *crt.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey
// strings byte by byte using the memcmp() function from the standard C
// library.
- rc = crt.Xmemcmp(tls, pKey1, pKey2, uint64(n))
+ rc = libc.Xmemcmp(tls, pKey1, pKey2, uint64(n))
if rc == 0 {
rc = (nKey1 - nKey2)
}
@@ -135604,7 +140563,7 @@ func binCollFunc(tls *crt.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey
// This is the collating function named "RTRIM" which is always
// available. Ignore trailing spaces.
-func rtrimCollFunc(tls *crt.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:161349:12: */
+func rtrimCollFunc(tls *libc.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:162014:12: */
var pK1 uintptr = pKey1
var pK2 uintptr = pKey2
for (nKey1 != 0) && (int32(*(*U8)(unsafe.Pointer(pK1 + uintptr((nKey1 - 1))))) == ' ') {
@@ -135617,10 +140576,10 @@ func rtrimCollFunc(tls *crt.TLS, pUser uintptr, nKey1 int32, pKey1 uintptr, nKey
}
// Return true if CollSeq is the default built-in BINARY.
-func Xsqlite3IsBinary(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:161364:20: */
+func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:162029:20: */
- return (crt.Bool32((p == uintptr(0)) || ((*CollSeq)(unsafe.Pointer(p)).FxCmp == *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ return (libc.Bool32((p == uintptr(0)) || ((*CollSeq)(unsafe.Pointer(p)).FxCmp == *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{binCollFunc})))))
}
@@ -135631,7 +140590,7 @@ func Xsqlite3IsBinary(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:161364:20: *
// extends only to the 26 characters used in the English language.
//
// At the moment there is only a UTF-8 implementation.
-func nocaseCollatingFunc(tls *crt.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:161378:12: */
+func nocaseCollatingFunc(tls *libc.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintptr, nKey2 int32, pKey2 uintptr) int32 { /* sqlite3.c:162043:12: */
var r int32 = Xsqlite3_strnicmp(tls,
pKey1, pKey2, func() int32 {
if nKey1 < nKey2 {
@@ -135647,31 +140606,31 @@ func nocaseCollatingFunc(tls *crt.TLS, NotUsed uintptr, nKey1 int32, pKey1 uintp
}
// Return the ROWID of the most recent insert
-func Xsqlite3_last_insert_rowid(tls *crt.TLS, db uintptr) Sqlite_int64 { /* sqlite3.c:161395:25: */
+func Xsqlite3_last_insert_rowid(tls *libc.TLS, db uintptr) Sqlite_int64 { /* sqlite3.c:162060:25: */
return (*Sqlite3)(unsafe.Pointer(db)).FlastRowid
}
// Set the value returned by the sqlite3_last_insert_rowid() API function.
-func Xsqlite3_set_last_insert_rowid(tls *crt.TLS, db uintptr, iRowid Sqlite3_int64) { /* sqlite3.c:161408:17: */
+func Xsqlite3_set_last_insert_rowid(tls *libc.TLS, db uintptr, iRowid Sqlite3_int64) { /* sqlite3.c:162073:17: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).FlastRowid = iRowid
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
}
// Return the number of changes in the most recent call to sqlite3_exec().
-func Xsqlite3_changes(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:161423:16: */
+func Xsqlite3_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162088:16: */
return (*Sqlite3)(unsafe.Pointer(db)).FnChange
}
// Return the number of changes since the database handle was opened.
-func Xsqlite3_total_changes(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:161436:16: */
+func Xsqlite3_total_changes(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162101:16: */
return (*Sqlite3)(unsafe.Pointer(db)).FnTotalChange
}
// Close all open savepoints. This function only manipulates fields of the
// database handle object, it does not close any savepoints that may be open
// at the b-tree/pager level.
-func Xsqlite3CloseSavepoints(tls *crt.TLS, db uintptr) { /* sqlite3.c:161451:21: */
+func Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr) { /* sqlite3.c:162116:21: */
for (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint != 0 {
var pTmp uintptr = (*Sqlite3)(unsafe.Pointer(db)).FpSavepoint
(*Sqlite3)(unsafe.Pointer(db)).FpSavepoint = (*Savepoint)(unsafe.Pointer(pTmp)).FpNext
@@ -135686,12 +140645,12 @@ func Xsqlite3CloseSavepoints(tls *crt.TLS, db uintptr) { /* sqlite3.c:161451:21:
// if this is not the last copy of the function, do not invoke it. Multiple
// copies of a single function are created when create_function() is called
// with SQLITE_ANY as the encoding.
-func functionDestroy(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:161468:13: */
+func functionDestroy(tls *libc.TLS, db uintptr, p uintptr) { /* sqlite3.c:162133:13: */
var pDestructor uintptr = *(*uintptr)(unsafe.Pointer(p + 64 /* &.u */))
if pDestructor != 0 {
(*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef--
if (*FuncDestructor)(unsafe.Pointer(pDestructor)).FnRef == 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pDestructor + 8 /* &.xDestroy */))))(tls, (*FuncDestructor)(unsafe.Pointer(pDestructor)).FpUserData)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pDestructor + 8 /* &.xDestroy */))))(tls, (*FuncDestructor)(unsafe.Pointer(pDestructor)).FpUserData)
Xsqlite3DbFree(tls, db, pDestructor)
}
}
@@ -135699,7 +140658,7 @@ func functionDestroy(tls *crt.TLS, db uintptr, p uintptr) { /* sqlite3.c:161468:
// Disconnect all sqlite3_vtab objects that belong to database connection
// db. This is called when db is being closed.
-func disconnectAllVtab(tls *crt.TLS, db uintptr) { /* sqlite3.c:161483:13: */
+func disconnectAllVtab(tls *libc.TLS, db uintptr) { /* sqlite3.c:162148:13: */
var i int32
var p uintptr
Xsqlite3BtreeEnterAll(tls, db)
@@ -135714,7 +140673,7 @@ func disconnectAllVtab(tls *crt.TLS, db uintptr) { /* sqlite3.c:161483:13: */
}
}
}
- for p = (*Hash)(unsafe.Pointer((db + 504 /* &.aModule */))).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
+ for p = (*Hash)(unsafe.Pointer((db + 528 /* &.aModule */))).Ffirst; p != 0; p = (*HashElem)(unsafe.Pointer(p)).Fnext {
var pMod uintptr = (*HashElem)(unsafe.Pointer(p)).Fdata
if (*Module)(unsafe.Pointer(pMod)).FpEpoTab != 0 {
Xsqlite3VtabDisconnect(tls, db, (*Module)(unsafe.Pointer(pMod)).FpEpoTab)
@@ -135726,7 +140685,7 @@ func disconnectAllVtab(tls *crt.TLS, db uintptr) { /* sqlite3.c:161483:13: */
// Return TRUE if database connection db has unfinalized prepared
// statements or unfinished sqlite3_backup objects.
-func connectionIsBusy(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:161514:12: */
+func connectionIsBusy(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162179:12: */
var j int32
if (*Sqlite3)(unsafe.Pointer(db)).FpVdbe != 0 {
@@ -135742,18 +140701,18 @@ func connectionIsBusy(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:161514:12:
}
// Close an existing SQLite database
-func sqlite3Close(tls *crt.TLS, db uintptr, forceZombie int32) int32 { /* sqlite3.c:161528:12: */
+func sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) int32 { /* sqlite3.c:162193:12: */
if !(db != 0) {
// EVIDENCE-OF: R-63257-11740 Calling sqlite3_close() or
// sqlite3_close_v2() with a NULL pointer argument is a harmless no-op.
return 0
}
if !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
- return Xsqlite3MisuseError(tls, 161535)
+ return Xsqlite3MisuseError(tls, 162200)
}
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if (int32((*Sqlite3)(unsafe.Pointer(db)).FmTrace) & 0x08) != 0 {
- (*(*func(*crt.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.xTrace */))))(tls, uint32(0x08), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0))
+ (*(*func(*libc.TLS, U32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((db + 232 /* &.trace */ /* &.xV2 */))))(tls, uint32(0x08), (*Sqlite3)(unsafe.Pointer(db)).FpTraceArg, db, uintptr(0))
}
// Force xDisconnect calls on all virtual tables
@@ -135771,7 +140730,7 @@ func sqlite3Close(tls *crt.TLS, db uintptr, forceZombie int32) int32 { /* sqlite
// SQLITE_BUSY if the connection can not be closed immediately.
if !(forceZombie != 0) && (connectionIsBusy(tls, db) != 0) {
Xsqlite3ErrorWithMsg(tls, db, 5,
- ts+21004 /* "unable to close ..." */, 0)
+ ts+24986 /* "unable to close ..." */, 0)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return 5
}
@@ -135789,10 +140748,10 @@ func sqlite3Close(tls *crt.TLS, db uintptr, forceZombie int32) int32 { /* sqlite
// version forces the connection to become a zombie if there are
// unclosed resources, and arranges for deallocation when the last
// prepare statement or sqlite3_backup closes.
-func Xsqlite3_close(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:161587:16: */
+func Xsqlite3_close(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162252:16: */
return sqlite3Close(tls, db, 0)
}
-func Xsqlite3_close_v2(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:161588:16: */
+func Xsqlite3_close_v2(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:162253:16: */
return sqlite3Close(tls, db, 1)
}
@@ -135802,7 +140761,7 @@ func Xsqlite3_close_v2(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:161588:16:
// has been a prior call to sqlite3_close(db) or sqlite3_close_v2(db)) and
// every sqlite3_stmt has now been finalized and every sqlite3_backup has
// finished, then free all resources.
-func Xsqlite3LeaveMutexAndCloseZombie(tls *crt.TLS, db uintptr) { /* sqlite3.c:161599:21: */
+func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { /* sqlite3.c:162264:21: */
var i uintptr // Hash table iterator
var j int32
@@ -135852,7 +140811,7 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *crt.TLS, db uintptr) { /* sqlite3.c:1
// locks and does not require any further unlock-notify callbacks.
Xsqlite3ConnectionClosed(tls, db)
- for i = (*Hash)(unsafe.Pointer((db + 552 /* &.aFunc */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
+ for i = (*Hash)(unsafe.Pointer((db + 576 /* &.aFunc */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pNext uintptr
var p uintptr
p = (*HashElem)(unsafe.Pointer(i)).Fdata
@@ -135863,24 +140822,24 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *crt.TLS, db uintptr) { /* sqlite3.c:1
p = pNext
}
}
- Xsqlite3HashClear(tls, (db + 552 /* &.aFunc */))
- for i = (*Hash)(unsafe.Pointer((db + 576 /* &.aCollSeq */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
+ Xsqlite3HashClear(tls, (db + 576 /* &.aFunc */))
+ for i = (*Hash)(unsafe.Pointer((db + 600 /* &.aCollSeq */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pColl uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
// Invoke any destructors registered for collation sequence user data.
for j = 0; j < 3; j++ {
if (*CollSeq)(unsafe.Pointer(pColl+uintptr(j)*40)).FxDel != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((pColl + uintptr(j)*40 + 32 /* &.xDel */))))(tls, (*CollSeq)(unsafe.Pointer(pColl+uintptr(j)*40)).FpUser)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pColl + uintptr(j)*40 + 32 /* &.xDel */))))(tls, (*CollSeq)(unsafe.Pointer(pColl+uintptr(j)*40)).FpUser)
}
}
Xsqlite3DbFree(tls, db, pColl)
}
- Xsqlite3HashClear(tls, (db + 576 /* &.aCollSeq */))
- for i = (*Hash)(unsafe.Pointer((db + 504 /* &.aModule */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
+ Xsqlite3HashClear(tls, (db + 600 /* &.aCollSeq */))
+ for i = (*Hash)(unsafe.Pointer((db + 528 /* &.aModule */))).Ffirst; i != 0; i = (*HashElem)(unsafe.Pointer(i)).Fnext {
var pMod uintptr = (*HashElem)(unsafe.Pointer(i)).Fdata
Xsqlite3VtabEponymousTableClear(tls, db, pMod)
Xsqlite3VtabModuleUnref(tls, db, pMod)
}
- Xsqlite3HashClear(tls, (db + 504 /* &.aModule */))
+ Xsqlite3HashClear(tls, (db + 528 /* &.aModule */))
Xsqlite3Error(tls, db, 0) // Deallocates any cached error strings.
Xsqlite3ValueFree(tls, (*Sqlite3)(unsafe.Pointer(db)).FpErr)
@@ -135909,7 +140868,7 @@ func Xsqlite3LeaveMutexAndCloseZombie(tls *crt.TLS, db uintptr) { /* sqlite3.c:1
// breaker") and made to return tripCode if there are any further
// attempts to use that cursor. Read cursors remain open and valid
// but are "saved" in case the table pages are moved around.
-func Xsqlite3RollbackAll(tls *crt.TLS, db uintptr, tripCode int32) { /* sqlite3.c:161719:21: */
+func Xsqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { /* sqlite3.c:162384:21: */
var i int32
var inTrans int32 = 0
var schemaChange int32
@@ -135923,7 +140882,7 @@ func Xsqlite3RollbackAll(tls *crt.TLS, db uintptr, tripCode int32) { /* sqlite3.
// the database rollback and schema reset, which can cause false
// corruption reports in some cases.
Xsqlite3BtreeEnterAll(tls, db)
- schemaChange = (crt.Bool32((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0001)) != U32(0)) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0)))
+ schemaChange = (libc.Bool32((((*Sqlite3)(unsafe.Pointer(db)).FmDbFlags & U32(0x0001)) != U32(0)) && (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0)))
for i = 0; i < (*Sqlite3)(unsafe.Pointer(db)).FnDb; i++ {
var p uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32)).FpBt
@@ -135931,7 +140890,7 @@ func Xsqlite3RollbackAll(tls *crt.TLS, db uintptr, tripCode int32) { /* sqlite3.
if Xsqlite3BtreeIsInTrans(tls, p) != 0 {
inTrans = 1
}
- Xsqlite3BtreeRollback(tls, p, tripCode, crt.BoolInt32(!(schemaChange != 0)))
+ Xsqlite3BtreeRollback(tls, p, tripCode, libc.BoolInt32(!(schemaChange != 0)))
}
}
Xsqlite3VtabRollback(tls, db)
@@ -135946,17 +140905,17 @@ func Xsqlite3RollbackAll(tls *crt.TLS, db uintptr, tripCode int32) { /* sqlite3.
// Any deferred constraint violations have now been resolved.
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredCons = int64(0)
(*Sqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = int64(0)
- *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(crt.Uint64FromUint64(uint64(0x00080000))))
+ *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) &= (^uint64(libc.Uint64FromUint64(uint64(0x00080000))))
// If one has been configured, invoke the rollback-hook callback
if ((*Sqlite3)(unsafe.Pointer(db)).FxRollbackCallback != 0) && ((inTrans != 0) || !(int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) != 0)) {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((db + 288 /* &.xRollbackCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpRollbackArg)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((db + 288 /* &.xRollbackCallback */))))(tls, (*Sqlite3)(unsafe.Pointer(db)).FpRollbackArg)
}
}
// Return a static string containing the name corresponding to the error code
// specified in the argument.
-func Xsqlite3ErrName(tls *crt.TLS, rc int32) uintptr { /* sqlite3.c:161769:27: */
+func Xsqlite3ErrName(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:162434:27: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -135971,259 +140930,259 @@ __1:
{
switch rc {
case 0:
- zName = ts + 21072 /* "SQLITE_OK" */
+ zName = ts + 25054 /* "SQLITE_OK" */
break
case 1:
- zName = ts + 21082 /* "SQLITE_ERROR" */
+ zName = ts + 25064 /* "SQLITE_ERROR" */
break
case (1 | (int32(3) << 8)):
- zName = ts + 21095 /* "SQLITE_ERROR_SNA..." */
+ zName = ts + 25077 /* "SQLITE_ERROR_SNA..." */
break
case 2:
- zName = ts + 21117 /* "SQLITE_INTERNAL" */
+ zName = ts + 25099 /* "SQLITE_INTERNAL" */
break
case 3:
- zName = ts + 21133 /* "SQLITE_PERM" */
+ zName = ts + 25115 /* "SQLITE_PERM" */
break
case 4:
- zName = ts + 21145 /* "SQLITE_ABORT" */
+ zName = ts + 25127 /* "SQLITE_ABORT" */
break
case (4 | (int32(2) << 8)):
- zName = ts + 21158 /* "SQLITE_ABORT_ROL..." */
+ zName = ts + 25140 /* "SQLITE_ABORT_ROL..." */
break
case 5:
- zName = ts + 21180 /* "SQLITE_BUSY" */
+ zName = ts + 25162 /* "SQLITE_BUSY" */
break
case (5 | (int32(1) << 8)):
- zName = ts + 21192 /* "SQLITE_BUSY_RECO..." */
+ zName = ts + 25174 /* "SQLITE_BUSY_RECO..." */
break
case (5 | (int32(2) << 8)):
- zName = ts + 21213 /* "SQLITE_BUSY_SNAP..." */
+ zName = ts + 25195 /* "SQLITE_BUSY_SNAP..." */
break
case 6:
- zName = ts + 21234 /* "SQLITE_LOCKED" */
+ zName = ts + 25216 /* "SQLITE_LOCKED" */
break
case (6 | (int32(1) << 8)):
- zName = ts + 21248 /* "SQLITE_LOCKED_SH..." */
+ zName = ts + 25230 /* "SQLITE_LOCKED_SH..." */
break
case 7:
- zName = ts + 21274 /* "SQLITE_NOMEM" */
+ zName = ts + 25256 /* "SQLITE_NOMEM" */
break
case 8:
- zName = ts + 21287 /* "SQLITE_READONLY" */
+ zName = ts + 25269 /* "SQLITE_READONLY" */
break
case (8 | (int32(1) << 8)):
- zName = ts + 21303 /* "SQLITE_READONLY_..." */
+ zName = ts + 25285 /* "SQLITE_READONLY_..." */
break
case (8 | (int32(5) << 8)):
- zName = ts + 21328 /* "SQLITE_READONLY_..." */
+ zName = ts + 25310 /* "SQLITE_READONLY_..." */
break
case (8 | (int32(3) << 8)):
- zName = ts + 21353 /* "SQLITE_READONLY_..." */
+ zName = ts + 25335 /* "SQLITE_READONLY_..." */
break
case (8 | (int32(4) << 8)):
- zName = ts + 21378 /* "SQLITE_READONLY_..." */
+ zName = ts + 25360 /* "SQLITE_READONLY_..." */
break
case (8 | (int32(6) << 8)):
- zName = ts + 21402 /* "SQLITE_READONLY_..." */
+ zName = ts + 25384 /* "SQLITE_READONLY_..." */
break
case 9:
- zName = ts + 21428 /* "SQLITE_INTERRUPT" */
+ zName = ts + 25410 /* "SQLITE_INTERRUPT" */
break
case 10:
- zName = ts + 21445 /* "SQLITE_IOERR" */
+ zName = ts + 25427 /* "SQLITE_IOERR" */
break
case (10 | (int32(1) << 8)):
- zName = ts + 21458 /* "SQLITE_IOERR_REA..." */
+ zName = ts + 25440 /* "SQLITE_IOERR_REA..." */
break
case (10 | (int32(2) << 8)):
- zName = ts + 21476 /* "SQLITE_IOERR_SHO..." */
+ zName = ts + 25458 /* "SQLITE_IOERR_SHO..." */
break
case (10 | (int32(3) << 8)):
- zName = ts + 21500 /* "SQLITE_IOERR_WRI..." */
+ zName = ts + 25482 /* "SQLITE_IOERR_WRI..." */
break
case (10 | (int32(4) << 8)):
- zName = ts + 21519 /* "SQLITE_IOERR_FSY..." */
+ zName = ts + 25501 /* "SQLITE_IOERR_FSY..." */
break
case (10 | (int32(5) << 8)):
- zName = ts + 21538 /* "SQLITE_IOERR_DIR..." */
+ zName = ts + 25520 /* "SQLITE_IOERR_DIR..." */
break
case (10 | (int32(6) << 8)):
- zName = ts + 21561 /* "SQLITE_IOERR_TRU..." */
+ zName = ts + 25543 /* "SQLITE_IOERR_TRU..." */
break
case (10 | (int32(7) << 8)):
- zName = ts + 21583 /* "SQLITE_IOERR_FST..." */
+ zName = ts + 25565 /* "SQLITE_IOERR_FST..." */
break
case (10 | (int32(8) << 8)):
- zName = ts + 21602 /* "SQLITE_IOERR_UNL..." */
+ zName = ts + 25584 /* "SQLITE_IOERR_UNL..." */
break
case (10 | (int32(9) << 8)):
- zName = ts + 21622 /* "SQLITE_IOERR_RDL..." */
+ zName = ts + 25604 /* "SQLITE_IOERR_RDL..." */
break
case (10 | (int32(10) << 8)):
- zName = ts + 21642 /* "SQLITE_IOERR_DEL..." */
+ zName = ts + 25624 /* "SQLITE_IOERR_DEL..." */
break
case (10 | (int32(12) << 8)):
- zName = ts + 21662 /* "SQLITE_IOERR_NOM..." */
+ zName = ts + 25644 /* "SQLITE_IOERR_NOM..." */
break
case (10 | (int32(13) << 8)):
- zName = ts + 21681 /* "SQLITE_IOERR_ACC..." */
+ zName = ts + 25663 /* "SQLITE_IOERR_ACC..." */
break
case (10 | (int32(14) << 8)):
- zName = ts + 21701 /* "SQLITE_IOERR_CHE..." */
+ zName = ts + 25683 /* "SQLITE_IOERR_CHE..." */
break
case (10 | (int32(15) << 8)):
- zName = ts + 21732 /* "SQLITE_IOERR_LOC..." */
+ zName = ts + 25714 /* "SQLITE_IOERR_LOC..." */
break
case (10 | (int32(16) << 8)):
- zName = ts + 21750 /* "SQLITE_IOERR_CLO..." */
+ zName = ts + 25732 /* "SQLITE_IOERR_CLO..." */
break
case (10 | (int32(17) << 8)):
- zName = ts + 21769 /* "SQLITE_IOERR_DIR..." */
+ zName = ts + 25751 /* "SQLITE_IOERR_DIR..." */
break
case (10 | (int32(18) << 8)):
- zName = ts + 21792 /* "SQLITE_IOERR_SHM..." */
+ zName = ts + 25774 /* "SQLITE_IOERR_SHM..." */
break
case (10 | (int32(19) << 8)):
- zName = ts + 21813 /* "SQLITE_IOERR_SHM..." */
+ zName = ts + 25795 /* "SQLITE_IOERR_SHM..." */
break
case (10 | (int32(20) << 8)):
- zName = ts + 21834 /* "SQLITE_IOERR_SHM..." */
+ zName = ts + 25816 /* "SQLITE_IOERR_SHM..." */
break
case (10 | (int32(21) << 8)):
- zName = ts + 21855 /* "SQLITE_IOERR_SHM..." */
+ zName = ts + 25837 /* "SQLITE_IOERR_SHM..." */
break
case (10 | (int32(22) << 8)):
- zName = ts + 21875 /* "SQLITE_IOERR_SEE..." */
+ zName = ts + 25857 /* "SQLITE_IOERR_SEE..." */
break
case (10 | (int32(23) << 8)):
- zName = ts + 21893 /* "SQLITE_IOERR_DEL..." */
+ zName = ts + 25875 /* "SQLITE_IOERR_DEL..." */
break
case (10 | (int32(24) << 8)):
- zName = ts + 21919 /* "SQLITE_IOERR_MMA..." */
+ zName = ts + 25901 /* "SQLITE_IOERR_MMA..." */
break
case (10 | (int32(25) << 8)):
- zName = ts + 21937 /* "SQLITE_IOERR_GET..." */
+ zName = ts + 25919 /* "SQLITE_IOERR_GET..." */
break
case (10 | (int32(26) << 8)):
- zName = ts + 21962 /* "SQLITE_IOERR_CON..." */
+ zName = ts + 25944 /* "SQLITE_IOERR_CON..." */
break
case 11:
- zName = ts + 21984 /* "SQLITE_CORRUPT" */
+ zName = ts + 25966 /* "SQLITE_CORRUPT" */
break
case (11 | (int32(1) << 8)):
- zName = ts + 21999 /* "SQLITE_CORRUPT_V..." */
+ zName = ts + 25981 /* "SQLITE_CORRUPT_V..." */
break
case 12:
- zName = ts + 22019 /* "SQLITE_NOTFOUND" */
+ zName = ts + 26001 /* "SQLITE_NOTFOUND" */
break
case 13:
- zName = ts + 22035 /* "SQLITE_FULL" */
+ zName = ts + 26017 /* "SQLITE_FULL" */
break
case 14:
- zName = ts + 22047 /* "SQLITE_CANTOPEN" */
+ zName = ts + 26029 /* "SQLITE_CANTOPEN" */
break
case (14 | (int32(1) << 8)):
- zName = ts + 22063 /* "SQLITE_CANTOPEN_..." */
+ zName = ts + 26045 /* "SQLITE_CANTOPEN_..." */
break
case (14 | (int32(2) << 8)):
- zName = ts + 22089 /* "SQLITE_CANTOPEN_..." */
+ zName = ts + 26071 /* "SQLITE_CANTOPEN_..." */
break
case (14 | (int32(3) << 8)):
- zName = ts + 22111 /* "SQLITE_CANTOPEN_..." */
+ zName = ts + 26093 /* "SQLITE_CANTOPEN_..." */
break
case (14 | (int32(4) << 8)):
- zName = ts + 22136 /* "SQLITE_CANTOPEN_..." */
+ zName = ts + 26118 /* "SQLITE_CANTOPEN_..." */
break
case (14 | (int32(6) << 8)):
- zName = ts + 22161 /* "SQLITE_CANTOPEN_..." */
+ zName = ts + 26143 /* "SQLITE_CANTOPEN_..." */
break
case 15:
- zName = ts + 22185 /* "SQLITE_PROTOCOL" */
+ zName = ts + 26167 /* "SQLITE_PROTOCOL" */
break
case 16:
- zName = ts + 22201 /* "SQLITE_EMPTY" */
+ zName = ts + 26183 /* "SQLITE_EMPTY" */
break
case 17:
- zName = ts + 22214 /* "SQLITE_SCHEMA" */
+ zName = ts + 26196 /* "SQLITE_SCHEMA" */
break
case 18:
- zName = ts + 22228 /* "SQLITE_TOOBIG" */
+ zName = ts + 26210 /* "SQLITE_TOOBIG" */
break
case 19:
- zName = ts + 22242 /* "SQLITE_CONSTRAIN..." */
+ zName = ts + 26224 /* "SQLITE_CONSTRAIN..." */
break
case (19 | (int32(8) << 8)):
- zName = ts + 22260 /* "SQLITE_CONSTRAIN..." */
+ zName = ts + 26242 /* "SQLITE_CONSTRAIN..." */
break
case (19 | (int32(7) << 8)):
- zName = ts + 22285 /* "SQLITE_CONSTRAIN..." */
+ zName = ts + 26267 /* "SQLITE_CONSTRAIN..." */
break
case (19 | (int32(3) << 8)):
- zName = ts + 22311 /* "SQLITE_CONSTRAIN..." */
+ zName = ts + 26293 /* "SQLITE_CONSTRAIN..." */
break
case (19 | (int32(1) << 8)):
- zName = ts + 22340 /* "SQLITE_CONSTRAIN..." */
+ zName = ts + 26322 /* "SQLITE_CONSTRAIN..." */
break
case (19 | (int32(6) << 8)):
- zName = ts + 22364 /* "SQLITE_CONSTRAIN..." */
+ zName = ts + 26346 /* "SQLITE_CONSTRAIN..." */
break
case (19 | (int32(5) << 8)):
- zName = ts + 22393 /* "SQLITE_CONSTRAIN..." */
+ zName = ts + 26375 /* "SQLITE_CONSTRAIN..." */
break
case (19 | (int32(2) << 8)):
- zName = ts + 22419 /* "SQLITE_CONSTRAIN..." */
+ zName = ts + 26401 /* "SQLITE_CONSTRAIN..." */
break
case (19 | (int32(9) << 8)):
- zName = ts + 22448 /* "SQLITE_CONSTRAIN..." */
+ zName = ts + 26430 /* "SQLITE_CONSTRAIN..." */
break
case (19 | (int32(4) << 8)):
- zName = ts + 22471 /* "SQLITE_CONSTRAIN..." */
+ zName = ts + 26453 /* "SQLITE_CONSTRAIN..." */
break
case (19 | (int32(10) << 8)):
- zName = ts + 22498 /* "SQLITE_CONSTRAIN..." */
+ zName = ts + 26480 /* "SQLITE_CONSTRAIN..." */
break
case 20:
- zName = ts + 22522 /* "SQLITE_MISMATCH" */
+ zName = ts + 26504 /* "SQLITE_MISMATCH" */
break
case 21:
- zName = ts + 22538 /* "SQLITE_MISUSE" */
+ zName = ts + 26520 /* "SQLITE_MISUSE" */
break
case 22:
- zName = ts + 22552 /* "SQLITE_NOLFS" */
+ zName = ts + 26534 /* "SQLITE_NOLFS" */
break
case 23:
- zName = ts + 22565 /* "SQLITE_AUTH" */
+ zName = ts + 26547 /* "SQLITE_AUTH" */
break
case 24:
- zName = ts + 22577 /* "SQLITE_FORMAT" */
+ zName = ts + 26559 /* "SQLITE_FORMAT" */
break
case 25:
- zName = ts + 22591 /* "SQLITE_RANGE" */
+ zName = ts + 26573 /* "SQLITE_RANGE" */
break
case 26:
- zName = ts + 22604 /* "SQLITE_NOTADB" */
+ zName = ts + 26586 /* "SQLITE_NOTADB" */
break
case 100:
- zName = ts + 22618 /* "SQLITE_ROW" */
+ zName = ts + 26600 /* "SQLITE_ROW" */
break
case 27:
- zName = ts + 22629 /* "SQLITE_NOTICE" */
+ zName = ts + 26611 /* "SQLITE_NOTICE" */
break
case (27 | (int32(1) << 8)):
- zName = ts + 22643 /* "SQLITE_NOTICE_RE..." */
+ zName = ts + 26625 /* "SQLITE_NOTICE_RE..." */
break
case (27 | (int32(2) << 8)):
- zName = ts + 22669 /* "SQLITE_NOTICE_RE..." */
+ zName = ts + 26651 /* "SQLITE_NOTICE_RE..." */
break
case 28:
- zName = ts + 22700 /* "SQLITE_WARNING" */
+ zName = ts + 26682 /* "SQLITE_WARNING" */
break
case (28 | (int32(1) << 8)):
- zName = ts + 22715 /* "SQLITE_WARNING_A..." */
+ zName = ts + 26697 /* "SQLITE_WARNING_A..." */
break
case 101:
- zName = ts + 22740 /* "SQLITE_DONE" */
+ zName = ts + 26722 /* "SQLITE_DONE" */
break
}
}
@@ -136236,32 +141195,32 @@ __2:
__3:
;
if zName == uintptr(0) {
- Xsqlite3_snprintf(tls, int32(unsafe.Sizeof(zBuf)), uintptr(unsafe.Pointer(&zBuf)), ts+22752 /* "SQLITE_UNKNOWN(%..." */, crt.VaList(bp, origRc))
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof(zBuf)), uintptr(unsafe.Pointer(&zBuf)), ts+26734 /* "SQLITE_UNKNOWN(%..." */, libc.VaList(bp, origRc))
zName = uintptr(unsafe.Pointer(&zBuf))
}
return zName
}
-var zBuf [50]int8 /* sqlite3.c:161868:17: */
+var zBuf [50]int8 /* sqlite3.c:162533:17: */
// Return a static string that describes the kind of error specified in the
// argument.
-func Xsqlite3ErrStr(tls *crt.TLS, rc int32) uintptr { /* sqlite3.c:161880:27: */
- var zErr uintptr = ts + 22771 /* "unknown error" */
+func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:162545:27: */
+ var zErr uintptr = ts + 26753 /* "unknown error" */
switch rc {
case (4 | (int32(2) << 8)):
{
- zErr = ts + 22785 /* "abort due to ROL..." */
+ zErr = ts + 26767 /* "abort due to ROL..." */
break
}
case 100:
{
- zErr = ts + 22807 /* "another row avai..." */
+ zErr = ts + 26789 /* "another row avai..." */
break
}
case 101:
{
- zErr = ts + 22829 /* "no more rows ava..." */
+ zErr = ts + 26811 /* "no more rows ava..." */
break
}
default:
@@ -136277,36 +141236,36 @@ func Xsqlite3ErrStr(tls *crt.TLS, rc int32) uintptr { /* sqlite3.c:161880:27: */
}
var aMsg = [29]uintptr{
- /* SQLITE_OK */ ts + 22852, /* "not an error" */
- /* SQLITE_ERROR */ ts + 22865, /* "SQL logic error" */
+ /* SQLITE_OK */ ts + 26834, /* "not an error" */
+ /* SQLITE_ERROR */ ts + 26847, /* "SQL logic error" */
/* SQLITE_INTERNAL */ uintptr(0),
- /* SQLITE_PERM */ ts + 22881, /* "access permissio..." */
- /* SQLITE_ABORT */ ts + 22906, /* "query aborted" */
- /* SQLITE_BUSY */ ts + 22920, /* "database is lock..." */
- /* SQLITE_LOCKED */ ts + 22939, /* "database table i..." */
- /* SQLITE_NOMEM */ ts + 5549, /* "out of memory" */
- /* SQLITE_READONLY */ ts + 22964, /* "attempt to write..." */
- /* SQLITE_INTERRUPT */ ts + 23001, /* "interrupted" */
- /* SQLITE_IOERR */ ts + 23013, /* "disk I/O error" */
- /* SQLITE_CORRUPT */ ts + 23028, /* "database disk im..." */
- /* SQLITE_NOTFOUND */ ts + 23061, /* "unknown operatio..." */
- /* SQLITE_FULL */ ts + 23079, /* "database or disk..." */
- /* SQLITE_CANTOPEN */ ts + 23104, /* "unable to open d..." */
- /* SQLITE_PROTOCOL */ ts + 23133, /* "locking protocol" */
+ /* SQLITE_PERM */ ts + 26863, /* "access permissio..." */
+ /* SQLITE_ABORT */ ts + 26888, /* "query aborted" */
+ /* SQLITE_BUSY */ ts + 26902, /* "database is lock..." */
+ /* SQLITE_LOCKED */ ts + 26921, /* "database table i..." */
+ /* SQLITE_NOMEM */ ts + 7747, /* "out of memory" */
+ /* SQLITE_READONLY */ ts + 26946, /* "attempt to write..." */
+ /* SQLITE_INTERRUPT */ ts + 26983, /* "interrupted" */
+ /* SQLITE_IOERR */ ts + 26995, /* "disk I/O error" */
+ /* SQLITE_CORRUPT */ ts + 27010, /* "database disk im..." */
+ /* SQLITE_NOTFOUND */ ts + 27043, /* "unknown operatio..." */
+ /* SQLITE_FULL */ ts + 27061, /* "database or disk..." */
+ /* SQLITE_CANTOPEN */ ts + 27086, /* "unable to open d..." */
+ /* SQLITE_PROTOCOL */ ts + 27115, /* "locking protocol" */
/* SQLITE_EMPTY */ uintptr(0),
- /* SQLITE_SCHEMA */ ts + 5296, /* "database schema ..." */
- /* SQLITE_TOOBIG */ ts + 4833, /* "string or blob t..." */
- /* SQLITE_CONSTRAINT */ ts + 23150, /* "constraint faile..." */
- /* SQLITE_MISMATCH */ ts + 23168, /* "datatype mismatc..." */
- /* SQLITE_MISUSE */ ts + 23186, /* "bad parameter or..." */
+ /* SQLITE_SCHEMA */ ts + 7494, /* "database schema ..." */
+ /* SQLITE_TOOBIG */ ts + 7031, /* "string or blob t..." */
+ /* SQLITE_CONSTRAINT */ ts + 27132, /* "constraint faile..." */
+ /* SQLITE_MISMATCH */ ts + 27150, /* "datatype mismatc..." */
+ /* SQLITE_MISUSE */ ts + 27168, /* "bad parameter or..." */
/* SQLITE_NOLFS */ uintptr(0),
- /* SQLITE_AUTH */ ts + 23220, /* "authorization de..." */
+ /* SQLITE_AUTH */ ts + 27202, /* "authorization de..." */
/* SQLITE_FORMAT */ uintptr(0),
- /* SQLITE_RANGE */ ts + 23241, /* "column index out..." */
- /* SQLITE_NOTADB */ ts + 23267, /* "file is not a da..." */
- /* SQLITE_NOTICE */ ts + 23290, /* "notification mes..." */
- /* SQLITE_WARNING */ ts + 23311, /* "warning message" */
-} /* sqlite3.c:161881:20 */
+ /* SQLITE_RANGE */ ts + 27223, /* "column index out..." */
+ /* SQLITE_NOTADB */ ts + 27249, /* "file is not a da..." */
+ /* SQLITE_NOTICE */ ts + 27272, /* "notification mes..." */
+ /* SQLITE_WARNING */ ts + 27293, /* "warning message" */
+} /* sqlite3.c:162546:20 */
// This routine implements a busy callback that sleeps and tries
// again until a timeout value is reached. The timeout value is
@@ -136315,7 +141274,7 @@ var aMsg = [29]uintptr{
//
// Return non-zero to retry the lock. Return zero to stop trying
// and cause SQLite to return SQLITE_BUSY.
-func sqliteDefaultBusyCallback(tls *crt.TLS, ptr uintptr, count int32) int32 { /* sqlite3.c:161950:12: */
+func sqliteDefaultBusyCallback(tls *libc.TLS, ptr uintptr, count int32) int32 { /* sqlite3.c:162615:12: */
var db uintptr = ptr
var tmout int32 = (*Sqlite3)(unsafe.Pointer(db)).FbusyTimeout
var delay int32
@@ -136338,8 +141297,8 @@ func sqliteDefaultBusyCallback(tls *crt.TLS, ptr uintptr, count int32) int32 { /
return 1
}
-var delays = [12]U8{U8(1), U8(2), U8(5), U8(10), U8(15), U8(20), U8(25), U8(25), U8(25), U8(50), U8(50), U8(100)} /* sqlite3.c:161957:19 */
-var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78), U8(103), U8(128), U8(178), U8(228)} /* sqlite3.c:161959:19 */
+var delays = [12]U8{U8(1), U8(2), U8(5), U8(10), U8(15), U8(20), U8(25), U8(25), U8(25), U8(50), U8(50), U8(100)} /* sqlite3.c:162622:19 */
+var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78), U8(103), U8(128), U8(178), U8(228)} /* sqlite3.c:162624:19 */
// Invoke the given busy handler.
//
@@ -136348,12 +141307,12 @@ var totals = [12]U8{U8(0), U8(1), U8(3), U8(8), U8(18), U8(33), U8(53), U8(78),
//
// If this routine returns non-zero, the lock is retried. If it
// returns 0, the operation aborts with an SQLITE_BUSY error.
-func Xsqlite3InvokeBusyHandler(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:162002:20: */
+func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:162667:20: */
var rc int32
if ((*BusyHandler)(unsafe.Pointer(p)).FxBusyHandler == uintptr(0)) || ((*BusyHandler)(unsafe.Pointer(p)).FnBusy < 0) {
return 0
}
- rc = (*(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer((p /* &.xBusyHandler */))))(tls, (*BusyHandler)(unsafe.Pointer(p)).FpBusyArg, (*BusyHandler)(unsafe.Pointer(p)).FnBusy)
+ rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((p /* &.xBusyHandler */))))(tls, (*BusyHandler)(unsafe.Pointer(p)).FpBusyArg, (*BusyHandler)(unsafe.Pointer(p)).FnBusy)
if rc == 0 {
(*BusyHandler)(unsafe.Pointer(p)).FnBusy = -1
} else {
@@ -136364,7 +141323,7 @@ func Xsqlite3InvokeBusyHandler(tls *crt.TLS, p uintptr) int32 { /* sqlite3.c:162
// This routine sets the busy callback for an Sqlite database to the
// given callback function with the given argument.
-func Xsqlite3_busy_handler(tls *crt.TLS, db uintptr, xBusy uintptr, pArg uintptr) int32 { /* sqlite3.c:162018:16: */
+func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) int32 { /* sqlite3.c:162683:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy
(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg
@@ -136377,7 +141336,7 @@ func Xsqlite3_busy_handler(tls *crt.TLS, db uintptr, xBusy uintptr, pArg uintptr
// This routine sets the progress callback for an Sqlite database to the
// given callback function with the given argument. The progress callback will
// be invoked every nOps opcodes.
-func Xsqlite3_progress_handler(tls *crt.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { /* sqlite3.c:162041:17: */
+func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { /* sqlite3.c:162706:17: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if nOps > 0 {
(*Sqlite3)(unsafe.Pointer(db)).FxProgress = xProgress
@@ -136393,10 +141352,10 @@ func Xsqlite3_progress_handler(tls *crt.TLS, db uintptr, nOps int32, xProgress u
// This routine installs a default busy handler that waits for the
// specified number of milliseconds before returning 0.
-func Xsqlite3_busy_timeout(tls *crt.TLS, db uintptr, ms int32) int32 { /* sqlite3.c:162072:16: */
+func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) int32 { /* sqlite3.c:162737:16: */
if ms > 0 {
Xsqlite3_busy_handler(tls, db, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, int32) int32
}{sqliteDefaultBusyCallback})),
db)
(*Sqlite3)(unsafe.Pointer(db)).FbusyTimeout = ms
@@ -136407,15 +141366,15 @@ func Xsqlite3_busy_timeout(tls *crt.TLS, db uintptr, ms int32) int32 { /* sqlite
}
// Cause any pending operation to stop at its earliest opportunity.
-func Xsqlite3_interrupt(tls *crt.TLS, db uintptr) { /* sqlite3.c:162089:17: */
- *(*int32)(unsafe.Pointer((db + 368 /* &.u1 */ /* &.isInterrupted */))) = 1
+func Xsqlite3_interrupt(tls *libc.TLS, db uintptr) { /* sqlite3.c:162754:17: */
+ *(*int32)(unsafe.Pointer((db + 392 /* &.u1 */ /* &.isInterrupted */))) = 1
}
// This function is exactly the same as sqlite3_create_function(), except
// that it is designed to be called by internal code. The difference is
// that if a malloc() fails in sqlite3_create_function(), an error code
// is returned and the mallocFailed flag cleared.
-func Xsqlite3CreateFunc(tls *crt.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) int32 { /* sqlite3.c:162106:20: */
+func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) int32 { /* sqlite3.c:162771:20: */
var p uintptr
var nName int32
_ = nName
@@ -136423,11 +141382,11 @@ func Xsqlite3CreateFunc(tls *crt.TLS, db uintptr, zFunctionName uintptr, nArg in
if (((((zFunctionName == uintptr(0)) || // Must have a valid name
((xSFunc != uintptr(0)) && (xFinal != uintptr(0)))) || // Not both xSFunc and xFinal
- ((crt.Bool32(xFinal == uintptr(0))) != (crt.Bool32(xStep == uintptr(0))))) || // Both or neither of xFinal and xStep
- ((crt.Bool32(xValue == uintptr(0))) != (crt.Bool32(xInverse == uintptr(0))))) || // Both or neither of xValue, xInverse
+ ((libc.Bool32(xFinal == uintptr(0))) != (libc.Bool32(xStep == uintptr(0))))) || // Both or neither of xFinal and xStep
+ ((libc.Bool32(xValue == uintptr(0))) != (libc.Bool32(xInverse == uintptr(0))))) || // Both or neither of xValue, xInverse
((nArg < -1) || (nArg > 127))) ||
- (255 < (crt.AssignInt32(&nName, Xsqlite3Strlen30(tls, zFunctionName)))) {
- return Xsqlite3MisuseError(tls, 162132)
+ (255 < (libc.AssignInt32(&nName, Xsqlite3Strlen30(tls, zFunctionName)))) {
+ return Xsqlite3MisuseError(tls, 162797)
}
extraFlags = (enc & (((0x000000800 | 0x000080000) | 0x000100000) | 0x000200000))
@@ -136470,7 +141429,7 @@ func Xsqlite3CreateFunc(tls *crt.TLS, db uintptr, zFunctionName uintptr, nArg in
if ((p != 0) && (((*FuncDef)(unsafe.Pointer(p)).FfuncFlags & U32(0x0003)) == U32(enc))) && (int32((*FuncDef)(unsafe.Pointer(p)).FnArg) == nArg) {
if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 {
Xsqlite3ErrorWithMsg(tls, db, 5,
- ts+23327 /* "unable to delete..." */, 0)
+ ts+27309 /* "unable to delete..." */, 0)
return 5
} else {
@@ -136513,7 +141472,7 @@ func Xsqlite3CreateFunc(tls *crt.TLS, db uintptr, zFunctionName uintptr, nArg in
// sqlite3_create_function()
// sqlite3_create_function_v2()
// sqlite3_create_window_function()
-func createFunctionApi(tls *crt.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:162226:12: */
+func createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:162891:12: */
var rc int32
var pArg uintptr
rc = 1
@@ -136528,7 +141487,7 @@ func createFunctionApi(tls *crt.TLS, db uintptr, zFunc uintptr, nArg int32, enc
goto __2
}
Xsqlite3OomFault(tls, db)
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer(&xDestroy)))(tls, p)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&xDestroy)))(tls, p)
goto out
__2:
;
@@ -136543,7 +141502,7 @@ __1:
goto __3
}
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer(&xDestroy)))(tls, p)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&xDestroy)))(tls, p)
Xsqlite3_free(tls, pArg)
__3:
;
@@ -136555,20 +141514,20 @@ out:
}
// Create new user functions.
-func Xsqlite3_create_function(tls *crt.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:162277:16: */
+func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:162942:16: */
return createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep,
xFinal, uintptr(0), uintptr(0), uintptr(0))
}
-func Xsqlite3_create_function_v2(tls *crt.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) int32 { /* sqlite3.c:162290:16: */
+func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) int32 { /* sqlite3.c:162955:16: */
return createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep,
xFinal, uintptr(0), uintptr(0), xDestroy)
}
-func Xsqlite3_create_window_function(tls *crt.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:162304:16: */
+func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) int32 { /* sqlite3.c:162969:16: */
return createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep,
xFinal, xValue, xInverse, xDestroy)
}
-func Xsqlite3_create_function16(tls *crt.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:162321:16: */
+func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) int32 { /* sqlite3.c:162986:16: */
var rc int32
var zFunc8 uintptr
@@ -136588,7 +141547,7 @@ func Xsqlite3_create_function16(tls *crt.TLS, db uintptr, zFunctionName uintptr,
// SQL function that use this routine so that the functions will exist
// for name resolution but are actually overloaded by the xFindFunction
// method of virtual tables.
-func sqlite3InvalidFunction(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:162357:13: */
+func sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* sqlite3.c:163022:13: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -136597,7 +141556,7 @@ func sqlite3InvalidFunction(tls *crt.TLS, context uintptr, NotUsed int32, NotUse
_ = NotUsed
_ = NotUsed2
zErr = Xsqlite3_mprintf(tls,
- ts+23390 /* "unable to use fu..." */, crt.VaList(bp, zName))
+ ts+27372 /* "unable to use fu..." */, libc.VaList(bp, zName))
Xsqlite3_result_error(tls, context, zErr, -1)
Xsqlite3_free(tls, zErr)
}
@@ -136612,12 +141571,12 @@ func sqlite3InvalidFunction(tls *crt.TLS, context uintptr, NotUsed int32, NotUse
// should call this routine to make sure the global function exists.
// A global function must exist in order for name resolution to work
// properly.
-func Xsqlite3_overload_function(tls *crt.TLS, db uintptr, zName uintptr, nArg int32) int32 { /* sqlite3.c:162383:16: */
+func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg int32) int32 { /* sqlite3.c:163048:16: */
var rc int32
var zCopy uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
- rc = (crt.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, uint8(1), uint8(0)) != uintptr(0)))
+ rc = (libc.Bool32(Xsqlite3FindFunction(tls, db, zName, nArg, uint8(1), uint8(0)) != uintptr(0)))
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if rc != 0 {
return 0
@@ -136628,8 +141587,8 @@ func Xsqlite3_overload_function(tls *crt.TLS, db uintptr, zName uintptr, nArg in
}
return Xsqlite3_create_function_v2(tls, db, zName, nArg, 1,
zCopy, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
- }{sqlite3InvalidFunction})), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{Xsqlite3_free})))
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{sqlite3InvalidFunction})), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
}
// Register a trace function. The pArg from the previously registered trace
@@ -136638,7 +141597,7 @@ func Xsqlite3_overload_function(tls *crt.TLS, db uintptr, zName uintptr, nArg in
// A NULL trace function means that no tracing is executes. A non-NULL
// trace is a pointer to a function that is invoked at the start of each
// SQL statement.
-func Xsqlite3_trace(tls *crt.TLS, db uintptr, xTrace uintptr, pArg uintptr) uintptr { /* sqlite3.c:162416:17: */
+func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) uintptr { /* sqlite3.c:163081:17: */
var pOld uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -136649,14 +141608,14 @@ func Xsqlite3_trace(tls *crt.TLS, db uintptr, xTrace uintptr, pArg uintptr) uint
}
return uint8(0)
}()
- (*Sqlite3)(unsafe.Pointer(db)).FxTrace = xTrace
+ *(*uintptr)(unsafe.Pointer(db + 232 /* &.trace */)) = xTrace
(*Sqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return pOld
}
// Register a trace callback using the version-2 interface.
-func Xsqlite3_trace_v2(tls *crt.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) int32 { /* sqlite3.c:162437:16: */
+func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) int32 { /* sqlite3.c:163102:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if mTrace == uint32(0) {
xTrace = uintptr(0)
@@ -136665,7 +141624,7 @@ func Xsqlite3_trace_v2(tls *crt.TLS, db uintptr, mTrace uint32, xTrace uintptr,
mTrace = uint32(0)
}
(*Sqlite3)(unsafe.Pointer(db)).FmTrace = U8(mTrace)
- (*Sqlite3)(unsafe.Pointer(db)).FxTrace = xTrace
+ *(*uintptr)(unsafe.Pointer(db + 232 /* &.trace */)) = xTrace
(*Sqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
return 0
@@ -136677,7 +141636,7 @@ func Xsqlite3_trace_v2(tls *crt.TLS, db uintptr, mTrace uint32, xTrace uintptr,
// A NULL profile function means that no profiling is executes. A non-NULL
// profile is a pointer to a function that is invoked at the conclusion of
// each SQL statement that is run.
-func Xsqlite3_profile(tls *crt.TLS, db uintptr, xProfile uintptr, pArg uintptr) uintptr { /* sqlite3.c:162467:17: */
+func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) uintptr { /* sqlite3.c:163132:17: */
var pOld uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -136695,7 +141654,7 @@ func Xsqlite3_profile(tls *crt.TLS, db uintptr, xProfile uintptr, pArg uintptr)
// Register a function to be invoked when a transaction commits.
// If the invoked function returns non-zero, then the commit becomes a
// rollback.
-func Xsqlite3_commit_hook(tls *crt.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:162497:17: */
+func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163162:17: */
var pOld uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -136708,7 +141667,7 @@ func Xsqlite3_commit_hook(tls *crt.TLS, db uintptr, xCallback uintptr, pArg uint
// Register a callback to be invoked each time a row is updated,
// inserted or deleted using this database connection.
-func Xsqlite3_update_hook(tls *crt.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:162522:17: */
+func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163187:17: */
var pRet uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -136721,7 +141680,7 @@ func Xsqlite3_update_hook(tls *crt.TLS, db uintptr, xCallback uintptr, pArg uint
// Register a callback to be invoked each time a transaction is rolled
// back by this database connection.
-func Xsqlite3_rollback_hook(tls *crt.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:162547:17: */
+func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163212:17: */
var pRet uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -136732,13 +141691,23 @@ func Xsqlite3_rollback_hook(tls *crt.TLS, db uintptr, xCallback uintptr, pArg ui
return pRet
}
-/*
-** The sqlite3_wal_hook() callback registered by sqlite3_wal_autocheckpoint().
-** Invoke sqlite3_wal_checkpoint if the number of frames in the log file
-** is greater than sqlite3.pWalArg cast to an integer (the value configured by
-** wal_autocheckpoint()).
- */
-func Xsqlite3WalDefaultHook(tls *crt.TLS, pClientData uintptr, db uintptr, zDb uintptr, nFrame int32) int32 { /* sqlite3.c:162596:20: */
+// Register a callback to be invoked each time a row is updated,
+// inserted or deleted using this database connection.
+func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163238:17: */
+ var pRet uintptr
+ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
+ pRet = (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg
+ (*Sqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback
+ (*Sqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg
+ Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
+ return pRet
+}
+
+// The sqlite3_wal_hook() callback registered by sqlite3_wal_autocheckpoint().
+// Invoke sqlite3_wal_checkpoint if the number of frames in the log file
+// is greater than sqlite3.pWalArg cast to an integer (the value configured by
+// wal_autocheckpoint()).
+func Xsqlite3WalDefaultHook(tls *libc.TLS, pClientData uintptr, db uintptr, zDb uintptr, nFrame int32) int32 { /* sqlite3.c:163261:20: */
if nFrame >= (int32(pClientData)) {
Xsqlite3BeginBenignMalloc(tls)
Xsqlite3_wal_checkpoint(tls, db, zDb)
@@ -136756,10 +141725,10 @@ func Xsqlite3WalDefaultHook(tls *crt.TLS, pClientData uintptr, db uintptr, zDb u
// registered using sqlite3_wal_hook(). Likewise, registering a callback
// using sqlite3_wal_hook() disables the automatic checkpoint mechanism
// configured by this function.
-func Xsqlite3_wal_autocheckpoint(tls *crt.TLS, db uintptr, nFrame int32) int32 { /* sqlite3.c:162622:16: */
+func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) int32 { /* sqlite3.c:163287:16: */
if nFrame > 0 {
Xsqlite3_wal_hook(tls, db, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, uintptr, int32) int32
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32
}{Xsqlite3WalDefaultHook})), uintptr(int64(nFrame)))
} else {
Xsqlite3_wal_hook(tls, db, uintptr(0), uintptr(0))
@@ -136769,7 +141738,7 @@ func Xsqlite3_wal_autocheckpoint(tls *crt.TLS, db uintptr, nFrame int32) int32 {
// Register a callback to be invoked each time a transaction is written
// into the write-ahead-log by this database connection.
-func Xsqlite3_wal_hook(tls *crt.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:162643:17: */
+func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) uintptr { /* sqlite3.c:163308:17: */
var pRet uintptr
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
pRet = (*Sqlite3)(unsafe.Pointer(db)).FpWalArg
@@ -136780,7 +141749,7 @@ func Xsqlite3_wal_hook(tls *crt.TLS, db uintptr, xCallback uintptr, pArg uintptr
}
// Checkpoint database zDb.
-func Xsqlite3_wal_checkpoint_v2(tls *crt.TLS, db uintptr, zDb uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:162670:16: */
+func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:163335:16: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -136807,7 +141776,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *crt.TLS, db uintptr, zDb uintptr, eMode int
}
if iDb < 0 {
rc = 1
- Xsqlite3ErrorWithMsg(tls, db, 1, ts+23441 /* "unknown database..." */, crt.VaList(bp, zDb))
+ Xsqlite3ErrorWithMsg(tls, db, 1, ts+27423 /* "unknown database..." */, libc.VaList(bp, zDb))
} else {
(*Sqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0
rc = Xsqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt)
@@ -136818,7 +141787,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *crt.TLS, db uintptr, zDb uintptr, eMode int
// If there are no active statements, clear the interrupt flag at this
// point.
if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 {
- *(*int32)(unsafe.Pointer((db + 368 /* &.u1 */ /* &.isInterrupted */))) = 0
+ *(*int32)(unsafe.Pointer((db + 392 /* &.u1 */ /* &.isInterrupted */))) = 0
}
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -136828,7 +141797,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *crt.TLS, db uintptr, zDb uintptr, eMode int
// Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
// to contains a zero-length string, all attached databases are
// checkpointed.
-func Xsqlite3_wal_checkpoint(tls *crt.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:162732:16: */
+func Xsqlite3_wal_checkpoint(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:163397:16: */
// EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
// sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0).
return Xsqlite3_wal_checkpoint_v2(tls, db, zDb, 0, uintptr(0), uintptr(0))
@@ -136852,7 +141821,7 @@ func Xsqlite3_wal_checkpoint(tls *crt.TLS, db uintptr, zDb uintptr) int32 { /* s
//
// Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL, RESTART
// or TRUNCATE.
-func Xsqlite3Checkpoint(tls *crt.TLS, db uintptr, iDb int32, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:162759:20: */
+func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog uintptr, pnCkpt uintptr) int32 { /* sqlite3.c:163424:20: */
var rc int32 = 0 // Return code
var i int32 // Used to iterate through attached dbs
var bBusy int32 = 0 // True if SQLITE_BUSY has been encountered
@@ -136892,19 +141861,19 @@ func Xsqlite3Checkpoint(tls *crt.TLS, db uintptr, iDb int32, eMode int32, pnLog
// 2 2 memory (return 1)
// 2 0 memory (return 1)
// 3 any memory (return 1)
-func Xsqlite3TempInMemory(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:162803:20: */
- return (crt.Bool32(int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == 2))
+func Xsqlite3TempInMemory(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163468:20: */
+ return (libc.Bool32(int32((*Sqlite3)(unsafe.Pointer(db)).Ftemp_store) == 2))
}
// Return UTF-8 encoded English language explanation of the most recent
// error.
-func Xsqlite3_errmsg(tls *crt.TLS, db uintptr) uintptr { /* sqlite3.c:162824:23: */
+func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:163489:23: */
var z uintptr
if !(db != 0) {
return Xsqlite3ErrStr(tls, 7)
}
if !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
- return Xsqlite3ErrStr(tls, Xsqlite3MisuseError(tls, 162830))
+ return Xsqlite3ErrStr(tls, Xsqlite3MisuseError(tls, 163495))
}
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
if (*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 {
@@ -136927,7 +141896,7 @@ func Xsqlite3_errmsg(tls *crt.TLS, db uintptr) uintptr { /* sqlite3.c:162824:23:
// Return UTF-16 encoded English language explanation of the most recent
// error.
-func Xsqlite3_errmsg16(tls *crt.TLS, db uintptr) uintptr { /* sqlite3.c:162852:23: */
+func Xsqlite3_errmsg16(tls *libc.TLS, db uintptr) uintptr { /* sqlite3.c:163517:23: */
var z uintptr
if !(db != 0) {
return uintptr(uintptr(unsafe.Pointer(&outOfMem)))
@@ -136956,34 +141925,34 @@ func Xsqlite3_errmsg16(tls *crt.TLS, db uintptr) uintptr { /* sqlite3.c:162852:2
var outOfMem = [14]U16{
U16('o'), U16('u'), U16('t'), U16(' '), U16('o'), U16('f'), U16(' '), U16('m'), U16('e'), U16('m'), U16('o'), U16('r'), U16('y'), U16(0),
-} /* sqlite3.c:162853:20 */
+} /* sqlite3.c:163518:20 */
var misuse = [34]U16{
U16('b'), U16('a'), U16('d'), U16(' '), U16('p'), U16('a'), U16('r'), U16('a'), U16('m'), U16('e'), U16('t'), U16('e'), U16('r'), U16(' '),
U16('o'), U16('r'), U16(' '), U16('o'), U16('t'), U16('h'), U16('e'), U16('r'), U16(' '), U16('A'), U16('P'), U16('I'), U16(' '),
U16('m'), U16('i'), U16('s'), U16('u'), U16('s'), U16('e'), U16(0),
-} /* sqlite3.c:162856:20 */
+} /* sqlite3.c:163521:20 */
// Return the most recent error code generated by an SQLite routine. If NULL is
// passed to this function, we assume a malloc() failed during sqlite3_open().
-func Xsqlite3_errcode(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:162894:16: */
+func Xsqlite3_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163559:16: */
if (db != 0) && !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
- return Xsqlite3MisuseError(tls, 162896)
+ return Xsqlite3MisuseError(tls, 163561)
}
if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
return 7
}
return ((*Sqlite3)(unsafe.Pointer(db)).FerrCode & (*Sqlite3)(unsafe.Pointer(db)).FerrMask)
}
-func Xsqlite3_extended_errcode(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:162903:16: */
+func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163568:16: */
if (db != 0) && !(Xsqlite3SafetyCheckSickOrOk(tls, db) != 0) {
- return Xsqlite3MisuseError(tls, 162905)
+ return Xsqlite3MisuseError(tls, 163570)
}
if !(db != 0) || ((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
return 7
}
return (*Sqlite3)(unsafe.Pointer(db)).FerrCode
}
-func Xsqlite3_system_errno(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:162912:16: */
+func Xsqlite3_system_errno(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:163577:16: */
if db != 0 {
return (*Sqlite3)(unsafe.Pointer(db)).FiSysErrno
}
@@ -136993,13 +141962,13 @@ func Xsqlite3_system_errno(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:162912
// Return a string that describes the kind of error specified in the
// argument. For now, this simply calls the internal sqlite3ErrStr()
// function.
-func Xsqlite3_errstr(tls *crt.TLS, rc int32) uintptr { /* sqlite3.c:162921:23: */
+func Xsqlite3_errstr(tls *libc.TLS, rc int32) uintptr { /* sqlite3.c:163586:23: */
return Xsqlite3ErrStr(tls, rc)
}
// Create a new collating function for database "db". The name is zName
// and the encoding is enc.
-func createCollation(tls *crt.TLS, db uintptr, zName uintptr, enc U8, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:162929:12: */
+func createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc U8, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:163594:12: */
var pColl uintptr
var enc2 int32
@@ -137012,7 +141981,7 @@ func createCollation(tls *crt.TLS, db uintptr, zName uintptr, enc U8, pCtx uintp
enc2 = 2
}
if (enc2 < 1) || (enc2 > 3) {
- return Xsqlite3MisuseError(tls, 162953)
+ return Xsqlite3MisuseError(tls, 163618)
}
// Check if this call is removing or replacing an existing collation
@@ -137022,25 +141991,24 @@ func createCollation(tls *crt.TLS, db uintptr, zName uintptr, enc U8, pCtx uintp
if (pColl != 0) && ((*CollSeq)(unsafe.Pointer(pColl)).FxCmp != 0) {
if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 {
Xsqlite3ErrorWithMsg(tls, db, 5,
- ts+23462 /* "unable to delete..." */, 0)
+ ts+27444 /* "unable to delete..." */, 0)
return 5
}
Xsqlite3ExpirePreparedStatements(tls, db, 0)
- /* If collation sequence pColl was created directly by a call to
- ** sqlite3_create_collation, and not generated by synthCollSeq(),
- ** then any copies made by synthCollSeq() need to be invalidated.
- ** Also, collation destructor - CollSeq.xDel() - function may need
- ** to be called.
- */
- if (int32((*CollSeq)(unsafe.Pointer(pColl)).Fenc) & ^int32(crt.Int32FromInt32(8))) == enc2 {
- var aColl uintptr = Xsqlite3HashFind(tls, (db + 576 /* &.aCollSeq */), zName)
+ // If collation sequence pColl was created directly by a call to
+ // sqlite3_create_collation, and not generated by synthCollSeq(),
+ // then any copies made by synthCollSeq() need to be invalidated.
+ // Also, collation destructor - CollSeq.xDel() - function may need
+ // to be called.
+ if (int32((*CollSeq)(unsafe.Pointer(pColl)).Fenc) & ^int32(libc.Int32FromInt32(8))) == enc2 {
+ var aColl uintptr = Xsqlite3HashFind(tls, (db + 600 /* &.aCollSeq */), zName)
var j int32
for j = 0; j < 3; j++ {
var p uintptr = (aColl + uintptr(j)*40)
if int32((*CollSeq)(unsafe.Pointer(p)).Fenc) == int32((*CollSeq)(unsafe.Pointer(pColl)).Fenc) {
if (*CollSeq)(unsafe.Pointer(p)).FxDel != 0 {
- (*(*func(*crt.TLS, uintptr))(unsafe.Pointer((p + 32 /* &.xDel */))))(tls, (*CollSeq)(unsafe.Pointer(p)).FpUser)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((p + 32 /* &.xDel */))))(tls, (*CollSeq)(unsafe.Pointer(p)).FpUser)
}
(*CollSeq)(unsafe.Pointer(p)).FxCmp = uintptr(0)
}
@@ -137067,7 +142035,7 @@ var aHardLimit = [12]int32{
1000000000,
1000000000,
2000,
- 0,
+ 1000,
500,
250000000,
127,
@@ -137076,7 +142044,7 @@ var aHardLimit = [12]int32{
32766, // IMP: R-38091-32352
1000,
8,
-} /* sqlite3.c:163006:18 */
+} /* sqlite3.c:163671:18 */
// Make sure the hard limits are set to reasonable values
@@ -137088,7 +142056,7 @@ var aHardLimit = [12]int32{
// A new lower limit does not shrink existing constructs.
// It merely prevents new constructs that exceed the limit
// from forming.
-func Xsqlite3_limit(tls *crt.TLS, db uintptr, limitId int32, newLimit int32) int32 { /* sqlite3.c:163069:16: */
+func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) int32 { /* sqlite3.c:163734:16: */
var oldLimit int32
// EVIDENCE-OF: R-30189-54097 For each limit category SQLITE_LIMIT_NAME
@@ -137133,7 +142101,7 @@ func Xsqlite3_limit(tls *crt.TLS, db uintptr, limitId int32, newLimit int32) int
// may be set to point to a buffer containing an English language error
// message. It is the responsibility of the caller to eventually release
// this buffer by calling sqlite3_free().
-func Xsqlite3ParseUri(tls *crt.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags uintptr, ppVfs uintptr, pzFile uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:163139:20: */
+func Xsqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags uintptr, ppVfs uintptr, pzFile uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:163804:20: */
bp := tls.Alloc(56)
defer tls.Free(56)
@@ -137166,7 +142134,7 @@ func Xsqlite3ParseUri(tls *crt.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags ui
if !(((((flags & uint32(0x00000040)) != 0) || // IMP: R-48725-32206
(Xsqlite3Config.FbOpenUri != 0)) && // IMP: R-51689-46548
- (nUri >= 5)) && (crt.Xmemcmp(tls, zUri, ts+23530 /* "file:" */, uint64(5)) == 0)) {
+ (nUri >= 5)) && (libc.Xmemcmp(tls, zUri, ts+27512 /* "file:" */, uint64(5)) == 0)) {
goto __1
} // Input character index
iOut = 0 // Output character index
@@ -137181,7 +142149,7 @@ __3:
if !(iIn < nUri) {
goto __5
}
- nByte = nByte + (U64(crt.Bool32(int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) == '&')))
+ nByte = nByte + (U64(libc.Bool32(int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) == '&')))
goto __4
__4:
iIn++
@@ -137197,7 +142165,7 @@ __5:
__6:
;
- crt.Xmemset(tls, zFile, 0, uint64(4)) // 4-byte of 0x00 is the start of DB name marker
+ libc.Xmemset(tls, zFile, 0, uint64(4)) // 4-byte of 0x00 is the start of DB name marker
zFile += uintptr(4)
iIn = 5
@@ -137214,11 +142182,11 @@ __8:
goto __8
__9:
;
- if !((iIn != 7) && ((iIn != 16) || (crt.Xmemcmp(tls, ts+23536 /* "localhost" */, (zUri+uintptr(7)), uint64(9)) != 0))) {
+ if !((iIn != 7) && ((iIn != 16) || (libc.Xmemcmp(tls, ts+27518 /* "localhost" */, (zUri+uintptr(7)), uint64(9)) != 0))) {
goto __10
}
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+23546, /* "invalid uri auth..." */
- crt.VaList(bp, (iIn-7), (zUri+uintptr(7))))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+27528, /* "invalid uri auth..." */
+ libc.VaList(bp, (iIn-7), (zUri+uintptr(7))))
rc = 1
goto parse_uri_out
__10:
@@ -137237,7 +142205,7 @@ __7:
// 2: Parsing value section of a name=value query parameter.
eState = 0
__11:
- if !(((int32(crt.AssignInt8(&c, *(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))))) != 0) && (int32(c) != '#')) {
+ if !(((int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))))) != 0) && (int32(c) != '#')) {
goto __12
}
iIn++
@@ -137246,8 +142214,8 @@ __11:
((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zUri + uintptr((iIn + 1)))))]) & 0x08) != 0)) {
goto __13
}
- octet = (int32(Xsqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zUri + uintptr(crt.PostIncInt32(&iIn, 1))))))) << 4)
- octet = octet + (int32(Xsqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zUri + uintptr(crt.PostIncInt32(&iIn, 1))))))))
+ octet = (int32(Xsqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zUri + uintptr(libc.PostIncInt32(&iIn, 1))))))) << 4)
+ octet = octet + (int32(Xsqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(zUri + uintptr(libc.PostIncInt32(&iIn, 1))))))))
if !(octet == 0) {
goto __15
@@ -137257,7 +142225,7 @@ __11:
// value currently being parsed. So ignore the current character
// and skip to the next "?", "=" or "&", as appropriate.
__16:
- if !((((((int32(crt.AssignInt8(&c, *(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))))) != 0) && (int32(c) != '#')) &&
+ if !((((((int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))))) != 0) && (int32(c) != '#')) &&
((eState != 0) || (int32(c) != '?'))) &&
((eState != 1) || ((int32(c) != '=') && (int32(c) != '&')))) &&
((eState != 2) || (int32(c) != '&'))) {
@@ -137294,7 +142262,7 @@ __20:
if !(int32(c) == '&') {
goto __23
}
- *(*int8)(unsafe.Pointer(zFile + uintptr(crt.PostIncInt32(&iOut, 1)))) = int8(0)
+ *(*int8)(unsafe.Pointer(zFile + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8(0)
goto __24
__23:
eState = 2
@@ -137314,17 +142282,17 @@ __19:
;
__14:
;
- *(*int8)(unsafe.Pointer(zFile + uintptr(crt.PostIncInt32(&iOut, 1)))) = c
+ *(*int8)(unsafe.Pointer(zFile + uintptr(libc.PostIncInt32(&iOut, 1)))) = c
goto __11
__12:
;
if !(eState == 1) {
goto __26
}
- *(*int8)(unsafe.Pointer(zFile + uintptr(crt.PostIncInt32(&iOut, 1)))) = int8(0)
+ *(*int8)(unsafe.Pointer(zFile + uintptr(libc.PostIncInt32(&iOut, 1)))) = int8(0)
__26:
;
- crt.Xmemset(tls, (zFile + uintptr(iOut)), 0, uint64(4)) // end-of-options + empty journal filenames
+ libc.Xmemset(tls, (zFile + uintptr(iOut)), 0, uint64(4)) // end-of-options + empty journal filenames
// Check if there were any options specified that should be interpreted
// here. Options that are interpreted here include "vfs" and those that
@@ -137339,7 +142307,7 @@ __27:
zVal = (zOpt + uintptr((nOpt + 1)))
nVal = Xsqlite3Strlen30(tls, zVal)
- if !((nOpt == 3) && (crt.Xmemcmp(tls, ts+23574 /* "vfs" */, zOpt, uint64(3)) == 0)) {
+ if !((nOpt == 3) && (libc.Xmemcmp(tls, ts+27556 /* "vfs" */, zOpt, uint64(3)) == 0)) {
goto __29
}
zVfs = zVal
@@ -137350,17 +142318,17 @@ __29:
mask = 0
limit = 0
- if !((nOpt == 5) && (crt.Xmemcmp(tls, ts+23578 /* "cache" */, zOpt, uint64(5)) == 0)) {
+ if !((nOpt == 5) && (libc.Xmemcmp(tls, ts+27560 /* "cache" */, zOpt, uint64(5)) == 0)) {
goto __31
}
mask = (0x00020000 | 0x00040000)
aMode = uintptr(unsafe.Pointer(&aCacheMode))
limit = mask
- zModeType = ts + 23578 /* "cache" */
+ zModeType = ts + 27560 /* "cache" */
__31:
;
- if !((nOpt == 4) && (crt.Xmemcmp(tls, ts+23584 /* "mode" */, zOpt, uint64(4)) == 0)) {
+ if !((nOpt == 4) && (libc.Xmemcmp(tls, ts+27566 /* "mode" */, zOpt, uint64(4)) == 0)) {
goto __32
}
@@ -137368,7 +142336,7 @@ __31:
0x00000004) | 0x00000080)
aMode = uintptr(unsafe.Pointer(&aOpenMode))
limit = (int32(uint32(mask) & flags))
- zModeType = ts + 2271 /* "access" */
+ zModeType = ts + 4406 /* "access" */
__32:
;
@@ -137382,7 +142350,7 @@ __34:
goto __36
}
z = (*OpenMode)(unsafe.Pointer(aMode + uintptr(i)*16)).Fz
- if !((nVal == Xsqlite3Strlen30(tls, z)) && (0 == crt.Xmemcmp(tls, zVal, z, uint64(nVal)))) {
+ if !((nVal == Xsqlite3Strlen30(tls, z)) && (0 == libc.Xmemcmp(tls, zVal, z, uint64(nVal)))) {
goto __37
}
mode = (*OpenMode)(unsafe.Pointer(aMode + uintptr(i)*16)).Fmode
@@ -137399,16 +142367,16 @@ __36:
if !(mode == 0) {
goto __38
}
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+23589 /* "no such %s mode:..." */, crt.VaList(bp+16, zModeType, zVal))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+27571 /* "no such %s mode:..." */, libc.VaList(bp+16, zModeType, zVal))
rc = 1
goto parse_uri_out
__38:
;
- if !((mode & ^int32(crt.Int32FromInt32(0x00000080))) > limit) {
+ if !((mode & ^int32(libc.Int32FromInt32(0x00000080))) > limit) {
goto __39
}
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+23609, /* "%s mode not allo..." */
- crt.VaList(bp+32, zModeType, zVal))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+27591, /* "%s mode not allo..." */
+ libc.VaList(bp+32, zModeType, zVal))
rc = 3
goto parse_uri_out
__39:
@@ -137432,16 +142400,16 @@ __1:
return 7
__40:
;
- crt.Xmemset(tls, zFile, 0, uint64(4))
+ libc.Xmemset(tls, zFile, 0, uint64(4))
zFile += uintptr(4)
if !(nUri != 0) {
goto __41
}
- crt.Xmemcpy(tls, zFile, zUri, uint64(nUri))
+ libc.Xmemcpy(tls, zFile, zUri, uint64(nUri))
__41:
;
- crt.Xmemset(tls, (zFile + uintptr(nUri)), 0, uint64(4))
- flags = flags & (^uint32(crt.Int32FromInt32(0x00000040)))
+ libc.Xmemset(tls, (zFile + uintptr(nUri)), 0, uint64(4))
+ flags = flags & (^uint32(libc.Int32FromInt32(0x00000040)))
__2:
;
@@ -137449,7 +142417,7 @@ __2:
if !(*(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0)) {
goto __42
}
- *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+23633 /* "no such vfs: %s" */, crt.VaList(bp+48, zVfs))
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+27615 /* "no such vfs: %s" */, libc.VaList(bp+48, zVfs))
rc = 1
__42:
;
@@ -137473,24 +142441,24 @@ type OpenMode = struct {
}
var aCacheMode = [3]OpenMode{
- {Fz: ts + 16005 /* "shared" */, Fmode: 0x00020000},
- {Fz: ts + 23649 /* "private" */, Fmode: 0x00040000},
+ {Fz: ts + 18988 /* "shared" */, Fmode: 0x00020000},
+ {Fz: ts + 27631 /* "private" */, Fmode: 0x00040000},
{Fz: uintptr(0), Fmode: 0},
-} /* sqlite3.c:163290:34 */
+} /* sqlite3.c:163955:34 */
var aOpenMode = [5]OpenMode{
- {Fz: ts + 23657 /* "ro" */, Fmode: 0x00000001},
- {Fz: ts + 23660 /* "rw" */, Fmode: 0x00000002},
- {Fz: ts + 23663 /* "rwc" */, Fmode: (0x00000002 | 0x00000004)},
- {Fz: ts + 15388 /* "memory" */, Fmode: 0x00000080},
+ {Fz: ts + 27639 /* "ro" */, Fmode: 0x00000001},
+ {Fz: ts + 27642 /* "rw" */, Fmode: 0x00000002},
+ {Fz: ts + 27645 /* "rwc" */, Fmode: (0x00000002 | 0x00000004)},
+ {Fz: ts + 18371 /* "memory" */, Fmode: 0x00000080},
{Fz: uintptr(0), Fmode: 0},
-} /* sqlite3.c:163302:34 */
+} /* sqlite3.c:163967:34 */
// This routine does the core work of extracting URI parameters from a
// database filename for the sqlite3_uri_parameter() interface.
-func uriParameter(tls *crt.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:163376:19: */
+func uriParameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:164041:19: */
zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
for *(*int8)(unsafe.Pointer(zFilename + uintptr(0))) != 0 {
- var x int32 = crt.Xstrcmp(tls, zFilename, zParam)
+ var x int32 = libc.Xstrcmp(tls, zFilename, zParam)
zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
if x == 0 {
return zFilename
@@ -137503,7 +142471,7 @@ func uriParameter(tls *crt.TLS, zFilename uintptr, zParam uintptr) uintptr { /*
// This routine does the work of opening a database on behalf of
// sqlite3_open() and sqlite3_open16(). The database filename "zFilename"
// is UTF-8 encoded.
-func openDatabase(tls *crt.TLS, zFilename uintptr, ppDb uintptr, flags uint32, zVfs uintptr) int32 { /* sqlite3.c:163394:12: */
+func openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, flags uint32, zVfs uintptr) int32 { /* sqlite3.c:164059:12: */
bp := tls.Alloc(32)
defer tls.Free(32)
*(*uint32)(unsafe.Pointer(bp + 8)) = flags
@@ -137557,7 +142525,7 @@ __3:
if !((*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(0x00040000)) != 0) {
goto __8
}
- *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) &= ^uint32(crt.Int32FromInt32(0x00020000))
+ *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) &= ^uint32(libc.Int32FromInt32(0x00020000))
goto __9
__8:
if !(Xsqlite3Config.FsharedCacheEnabled != 0) {
@@ -137577,7 +142545,7 @@ __9:
// SQLITE_OPEN_READWRITE, SQLITE_OPEN_CREATE, SQLITE_OPEN_SHAREDCACHE,
// SQLITE_OPEN_PRIVATECACHE, and some reserved bits. Silently mask
// off all other flags.
- *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) &= ^uint32(crt.Int32FromInt32((((((((((((0x00000008 | 0x00000010) | 0x00000100) | 0x00000200) | 0x00000400) | 0x00000800) | 0x00001000) | 0x00002000) | 0x00004000) | 0x00008000) | 0x00010000) | 0x00080000)))
+ *(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) &= ^uint32(libc.Int32FromInt32((((((((((((0x00000008 | 0x00000010) | 0x00000100) | 0x00000200) | 0x00000400) | 0x00000800) | 0x00001000) | 0x00002000) | 0x00004000) | 0x00008000) | 0x00010000) | 0x00080000)))
// Allocate the sqlite data structure
db = Xsqlite3MallocZero(tls, uint64(unsafe.Sizeof(Sqlite3{})))
@@ -137610,18 +142578,18 @@ __12:
(*Sqlite3)(unsafe.Pointer(db)).FerrMask = 0xff
(*Sqlite3)(unsafe.Pointer(db)).FnDb = 2
(*Sqlite3)(unsafe.Pointer(db)).Fmagic = 0xf03b7906
- (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 624 /* &.aDbStatic */
+ (*Sqlite3)(unsafe.Pointer(db)).FaDb = db + 648 /* &.aDbStatic */
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable = U32(1)
(*Sqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = U16(0)
- crt.Xmemcpy(tls, db+124 /* &.aLimit */, uintptr(unsafe.Pointer(&aHardLimit)), uint64(unsafe.Sizeof([12]int32{})))
+ libc.Xmemcpy(tls, db+124 /* &.aLimit */, uintptr(unsafe.Pointer(&aHardLimit)), uint64(unsafe.Sizeof([12]int32{})))
*(*int32)(unsafe.Pointer((db + 124 /* &.aLimit */) + uintptr(11)*4)) = 0
(*Sqlite3)(unsafe.Pointer(db)).FautoCommit = U8(1)
(*Sqlite3)(unsafe.Pointer(db)).FnextAutovac = int8(-1)
(*Sqlite3)(unsafe.Pointer(db)).FszMmap = Xsqlite3Config.FszMmap
(*Sqlite3)(unsafe.Pointer(db)).FnextPagesize = 0
(*Sqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap = 0x7FFFFFFF
- *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(((((uint32(0x00000040 |
+ *(*U64)(unsafe.Pointer(db + 48 /* &.flags */)) |= (uint64(((((((uint32(0x00000040 |
0x00040000)) |
0x80000000) |
uint32(0x00000020)) |
@@ -137640,10 +142608,12 @@ __12:
// Legacy behavior is 3 (double-quoted string literals are allowed anywhere)
// and so that is the default. But developers are encouranged to use
// -DSQLITE_DQS=0 (best) or -DSQLITE_DQS=1 (second choice) if possible.
+ uint32(0x40000000)) |
+ uint32(0x20000000)) |
uint32(0x00008000)))
- Xsqlite3HashInit(tls, (db + 576 /* &.aCollSeq */))
- Xsqlite3HashInit(tls, (db + 504 /* &.aModule */))
+ Xsqlite3HashInit(tls, (db + 600 /* &.aCollSeq */))
+ Xsqlite3HashInit(tls, (db + 528 /* &.aModule */))
// Add the default collation sequence BINARY. BINARY works for both UTF-8
// and UTF-16, so add a version for each to avoid any unnecessary
@@ -137652,19 +142622,19 @@ __12:
// EVIDENCE-OF: R-52786-44878 SQLite defines three built-in collating
// functions:
createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(1), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{binCollFunc})), uintptr(0))
createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(3), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{binCollFunc})), uintptr(0))
createCollation(tls, db, uintptr(unsafe.Pointer(&Xsqlite3StrBINARY)), uint8(2), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{binCollFunc})), uintptr(0))
- createCollation(tls, db, ts+19569 /* "NOCASE" */, uint8(1), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ createCollation(tls, db, ts+23509 /* "NOCASE" */, uint8(1), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{nocaseCollatingFunc})), uintptr(0))
- createCollation(tls, db, ts+23667 /* "RTRIM" */, uint8(1), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32
+ createCollation(tls, db, ts+27649 /* "RTRIM" */, uint8(1), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32
}{rtrimCollFunc})), uintptr(0))
if !((*Sqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) {
goto __15
@@ -137692,7 +142662,7 @@ __15:
if !(((int32(1) << (*(*uint32)(unsafe.Pointer(bp + 8 /* flags */)) & uint32(7))) & 0x46) == 0) {
goto __16
}
- rc = Xsqlite3MisuseError(tls, 163599)
+ rc = Xsqlite3MisuseError(tls, 164264)
goto __17
__16:
rc = Xsqlite3ParseUri(tls, zVfs, zFilename, bp+8 /* &flags */, (db /* &.pVfs */), bp+16 /* &zOpen */, bp+24 /* &zErrMsg */)
@@ -137709,10 +142679,10 @@ __19:
;
Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
if *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) != 0 {
- return ts + 696 /* "%s" */
+ return ts + 805 /* "%s" */
}
return uintptr(0)
- }(), crt.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */))))
+ }(), libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */))))
Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)))
goto opendb_out
__18:
@@ -137747,9 +142717,9 @@ __22:
// The default safety_level for the main database is FULL; for the temp
// database it is OFF. This matches the pager layer defaults.
- (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(0)*32)).FzDbSName = ts + 6116 /* "main" */
+ (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(0)*32)).FzDbSName = ts + 8314 /* "main" */
(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(0)*32)).Fsafety_level = (U8(2 + 1))
- (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(1)*32)).FzDbSName = ts + 20977 /* "temp" */
+ (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(1)*32)).FzDbSName = ts + 24959 /* "temp" */
(*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(1)*32)).Fsafety_level = U8(0x01)
(*Sqlite3)(unsafe.Pointer(db)).Fmagic = 0xa029a697
@@ -137773,7 +142743,7 @@ __24:
if !((rc == 0) && (i < (int32(uint64(unsafe.Sizeof(sqlite3BuiltinExtensions)) / uint64(unsafe.Sizeof(uintptr(0))))))) {
goto __26
}
- rc = (*(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + uintptr(i)*8))))(tls, db)
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + uintptr(i)*8))))(tls, db)
goto __25
__25:
i++
@@ -137846,16 +142816,16 @@ __32:
}
// Open a new database handle.
-func Xsqlite3_open(tls *crt.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:163721:16: */
+func Xsqlite3_open(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:164386:16: */
return openDatabase(tls, zFilename, ppDb,
(uint32(0x00000002 | 0x00000004)), uintptr(0))
}
-func Xsqlite3_open_v2(tls *crt.TLS, filename uintptr, ppDb uintptr, flags int32, zVfs uintptr) int32 { /* sqlite3.c:163728:16: */
+func Xsqlite3_open_v2(tls *libc.TLS, filename uintptr, ppDb uintptr, flags int32, zVfs uintptr) int32 { /* sqlite3.c:164393:16: */
return openDatabase(tls, filename, ppDb, uint32(flags), zVfs)
}
// Open a new database handle.
-func Xsqlite3_open16(tls *crt.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:163741:16: */
+func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) int32 { /* sqlite3.c:164406:16: */
var zFilename8 uintptr // zFilename encoded in UTF-8 instead of UTF-16
var pVal uintptr
var rc int32
@@ -137866,7 +142836,7 @@ func Xsqlite3_open16(tls *crt.TLS, zFilename uintptr, ppDb uintptr) int32 { /* s
return rc
}
if zFilename == uintptr(0) {
- zFilename = ts + 23673 /* "\x00\x00" */
+ zFilename = ts + 27655 /* "\x00\x00" */
}
pVal = Xsqlite3ValueNew(tls, uintptr(0))
Xsqlite3ValueSetStr(tls, pVal, -1, zFilename, uint8(2), uintptr(0))
@@ -137876,7 +142846,7 @@ func Xsqlite3_open16(tls *crt.TLS, zFilename uintptr, ppDb uintptr) int32 { /* s
(uint32(0x00000002 | 0x00000004)), uintptr(0))
if (rc == 0) && !((int32((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb+uintptr(0)*32)).FpSchema)).FschemaFlags) & (0x0001)) == (0x0001)) {
- ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb + uintptr(0)*32)).FpSchema)).Fenc) = crt.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+94 /* &.enc */, U8(2))
+ ((*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(ppDb))))).FaDb + uintptr(0)*32)).FpSchema)).Fenc) = libc.AssignPtrUint8(*(*uintptr)(unsafe.Pointer(ppDb))+94 /* &.enc */, U8(2))
}
} else {
rc = 7
@@ -137887,12 +142857,12 @@ func Xsqlite3_open16(tls *crt.TLS, zFilename uintptr, ppDb uintptr) int32 { /* s
}
// Register a new collation sequence with the database handle db.
-func Xsqlite3_create_collation(tls *crt.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:163780:16: */
+func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:164445:16: */
return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0))
}
// Register a new collation sequence with the database handle db.
-func Xsqlite3_create_collation_v2(tls *crt.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:163793:16: */
+func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) int32 { /* sqlite3.c:164458:16: */
var rc int32
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -137904,7 +142874,7 @@ func Xsqlite3_create_collation_v2(tls *crt.TLS, db uintptr, zName uintptr, enc i
}
// Register a new collation sequence with the database handle db.
-func Xsqlite3_create_collation16(tls *crt.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:163818:16: */
+func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) int32 { /* sqlite3.c:164483:16: */
var rc int32 = 0
var zName8 uintptr
@@ -137922,7 +142892,7 @@ func Xsqlite3_create_collation16(tls *crt.TLS, db uintptr, zName uintptr, enc in
// Register a collation sequence factory callback with the database handle
// db. Replace any previously installed collation sequence factory.
-func Xsqlite3_collation_needed(tls *crt.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) int32 { /* sqlite3.c:163848:16: */
+func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) int32 { /* sqlite3.c:164513:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded
(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0)
@@ -137933,7 +142903,7 @@ func Xsqlite3_collation_needed(tls *crt.TLS, db uintptr, pCollNeededArg uintptr,
// Register a collation sequence factory callback with the database handle
// db. Replace any previously installed collation sequence factory.
-func Xsqlite3_collation_needed16(tls *crt.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) int32 { /* sqlite3.c:163869:16: */
+func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) int32 { /* sqlite3.c:164534:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0)
(*Sqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16
@@ -137944,7 +142914,7 @@ func Xsqlite3_collation_needed16(tls *crt.TLS, db uintptr, pCollNeededArg uintpt
// This function is now an anachronism. It used to be used to recover from a
// malloc() failure, but SQLite now does this automatically.
-func Xsqlite3_global_recover(tls *crt.TLS) int32 { /* sqlite3.c:163891:16: */
+func Xsqlite3_global_recover(tls *libc.TLS) int32 { /* sqlite3.c:164556:16: */
return 0
}
@@ -137952,7 +142922,7 @@ func Xsqlite3_global_recover(tls *crt.TLS) int32 { /* sqlite3.c:163891:16: */
// mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
// by default. Autocommit is disabled by a BEGIN statement and reenabled
// by the next COMMIT or ROLLBACK.
-func Xsqlite3_get_autocommit(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:163902:16: */
+func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:164567:16: */
return int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit)
}
@@ -137965,25 +142935,25 @@ func Xsqlite3_get_autocommit(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:1639
//
// 2. Invoke sqlite3_log() to provide the source code location where
// a low-level error is first detected.
-func Xsqlite3ReportError(tls *crt.TLS, iErr int32, lineno int32, zType uintptr) int32 { /* sqlite3.c:163923:20: */
+func Xsqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) int32 { /* sqlite3.c:164588:20: */
bp := tls.Alloc(24)
defer tls.Free(24)
- Xsqlite3_log(tls, iErr, ts+23676, /* "%s at line %d of..." */
- crt.VaList(bp, zType, lineno, (uintptr(20)+Xsqlite3_sourceid(tls))))
+ Xsqlite3_log(tls, iErr, ts+27658, /* "%s at line %d of..." */
+ libc.VaList(bp, zType, lineno, (uintptr(20)+Xsqlite3_sourceid(tls))))
return iErr
}
-func Xsqlite3CorruptError(tls *crt.TLS, lineno int32) int32 { /* sqlite3.c:163928:20: */
+func Xsqlite3CorruptError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:164593:20: */
- return Xsqlite3ReportError(tls, 11, lineno, ts+23701 /* "database corrupt..." */)
+ return Xsqlite3ReportError(tls, 11, lineno, ts+27683 /* "database corrupt..." */)
}
-func Xsqlite3MisuseError(tls *crt.TLS, lineno int32) int32 { /* sqlite3.c:163932:20: */
+func Xsqlite3MisuseError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:164597:20: */
- return Xsqlite3ReportError(tls, 21, lineno, ts+23721 /* "misuse" */)
+ return Xsqlite3ReportError(tls, 21, lineno, ts+27703 /* "misuse" */)
}
-func Xsqlite3CantopenError(tls *crt.TLS, lineno int32) int32 { /* sqlite3.c:163936:20: */
+func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32 { /* sqlite3.c:164601:20: */
- return Xsqlite3ReportError(tls, 14, lineno, ts+23728 /* "cannot open file" */)
+ return Xsqlite3ReportError(tls, 14, lineno, ts+27710 /* "cannot open file" */)
}
// This is a convenience routine that makes sure that all thread-specific
@@ -137991,12 +142961,12 @@ func Xsqlite3CantopenError(tls *crt.TLS, lineno int32) int32 { /* sqlite3.c:1639
//
// SQLite no longer uses thread-specific data so this routine is now a
// no-op. It is retained for historical compatibility.
-func Xsqlite3_thread_cleanup(tls *crt.TLS) { /* sqlite3.c:163967:17: */
+func Xsqlite3_thread_cleanup(tls *libc.TLS) { /* sqlite3.c:164632:17: */
}
// Return meta information about a specific column of a database table.
// See comment in sqlite3.h (sqlite.h.in) for details.
-func Xsqlite3_table_column_metadata(tls *crt.TLS, db uintptr, zDbName uintptr, zTableName uintptr, zColumnName uintptr, pzDataType uintptr, pzCollSeq uintptr, pNotNull uintptr, pPrimaryKey uintptr, pAutoinc uintptr) int32 { /* sqlite3.c:163975:16: */
+func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, zTableName uintptr, zColumnName uintptr, pzDataType uintptr, pzCollSeq uintptr, pNotNull uintptr, pPrimaryKey uintptr, pAutoinc uintptr) int32 { /* sqlite3.c:164640:16: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -138090,27 +143060,26 @@ __9:
__4:
;
- /* The following block stores the meta information that will be returned
- ** to the caller in local variables zDataType, zCollSeq, notnull, primarykey
- ** and autoinc. At this point there are two possibilities:
- **
- ** 1. The specified column name was rowid", "oid" or "_rowid_"
- ** and there is no explicitly declared IPK column.
- **
- ** 2. The table is not a view and the column name identified an
- ** explicitly declared column. Copy meta information from *pCol.
- */
+ // The following block stores the meta information that will be returned
+ // to the caller in local variables zDataType, zCollSeq, notnull, primarykey
+ // and autoinc. At this point there are two possibilities:
+ //
+ // 1. The specified column name was rowid", "oid" or "_rowid_"
+ // and there is no explicitly declared IPK column.
+ //
+ // 2. The table is not a view and the column name identified an
+ // explicitly declared column. Copy meta information from *pCol.
if !(pCol != 0) {
goto __12
}
zDataType = Xsqlite3ColumnType(tls, pCol, uintptr(0))
zCollSeq = (*Column)(unsafe.Pointer(pCol)).FzColl
- notnull = (crt.Bool32(int32((*Column)(unsafe.Pointer(pCol)).FnotNull) != 0))
- primarykey = (crt.Bool32((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0001) != 0))
- autoinc = (crt.Bool32((int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(0x0008)) != U32(0))))
+ notnull = (libc.Bool32(int32((*Column)(unsafe.Pointer(pCol)).FnotNull) != 0))
+ primarykey = (libc.Bool32((int32((*Column)(unsafe.Pointer(pCol)).FcolFlags) & 0x0001) != 0))
+ autoinc = (libc.Bool32((int32((*Table)(unsafe.Pointer(pTab)).FiPKey) == iCol) && (((*Table)(unsafe.Pointer(pTab)).FtabFlags & U32(0x0008)) != U32(0))))
goto __13
__12:
- zDataType = ts + 11013 /* "INTEGER" */
+ zDataType = ts + 13743 /* "INTEGER" */
primarykey = 1
__13:
;
@@ -138162,17 +143131,17 @@ __19:
goto __20
}
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)))
- *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) = Xsqlite3MPrintf(tls, db, ts+23745 /* "no such table co..." */, crt.VaList(bp, zTableName,
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) = Xsqlite3MPrintf(tls, db, ts+27727 /* "no such table co..." */, libc.VaList(bp, zTableName,
zColumnName))
rc = 1
__20:
;
Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
if *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) != 0 {
- return ts + 696 /* "%s" */
+ return ts + 805 /* "%s" */
}
return uintptr(0)
- }(), crt.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */))))
+ }(), libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */))))
Xsqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)))
rc = Xsqlite3ApiExit(tls, db, rc)
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -138180,7 +143149,7 @@ __20:
}
// Sleep for a little while. Return the amount of time slept.
-func Xsqlite3_sleep(tls *crt.TLS, ms int32) int32 { /* sqlite3.c:164093:16: */
+func Xsqlite3_sleep(tls *libc.TLS, ms int32) int32 { /* sqlite3.c:164758:16: */
var pVfs uintptr
var rc int32
pVfs = Xsqlite3_vfs_find(tls, uintptr(0))
@@ -138195,11 +143164,11 @@ func Xsqlite3_sleep(tls *crt.TLS, ms int32) int32 { /* sqlite3.c:164093:16: */
}
// Enable or disable the extended result codes.
-func Xsqlite3_extended_result_codes(tls *crt.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:164109:16: */
+func Xsqlite3_extended_result_codes(tls *libc.TLS, db uintptr, onoff int32) int32 { /* sqlite3.c:164774:16: */
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
(*Sqlite3)(unsafe.Pointer(db)).FerrMask = func() int32 {
if onoff != 0 {
- return crt.Int32FromUint32(0xffffffff)
+ return libc.Int32FromUint32(0xffffffff)
}
return 0xff
}()
@@ -138208,7 +143177,7 @@ func Xsqlite3_extended_result_codes(tls *crt.TLS, db uintptr, onoff int32) int32
}
// Invoke the xFileControl method on a particular database.
-func Xsqlite3_file_control(tls *crt.TLS, db uintptr, zDbName uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:164122:16: */
+func Xsqlite3_file_control(tls *libc.TLS, db uintptr, zDbName uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:164787:16: */
var rc int32 = 1
var pBtree uintptr
@@ -138251,7 +143220,7 @@ func Xsqlite3_file_control(tls *crt.TLS, db uintptr, zDbName uintptr, op int32,
}
// Interface to the testing logic.
-func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite3.c:164170:16: */
+func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) int32 { /* sqlite3.c:164835:16: */
var rc int32 = 0
var ap Va_list
_ = ap
@@ -138295,11 +143264,11 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// be used for the next call to sqlite3_randomness().
case 28:
{
- var x int32 = int32(crt.VaInt32(&ap))
+ var x int32 = int32(libc.VaInt32(&ap))
var y int32
- var db uintptr = crt.VaUintptr(&ap)
+ var db uintptr = libc.VaUintptr(&ap)
- if (db != 0) && ((crt.AssignInt32(&y, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(0)*32)).FpSchema)).Fschema_cookie)) != 0) {
+ if (db != 0) && ((libc.AssignInt32(&y, (*Schema)(unsafe.Pointer((*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb+uintptr(0)*32)).FpSchema)).Fschema_cookie)) != 0) {
x = y
}
Xsqlite3Config.FiPrngSeed = uint32(x)
@@ -138315,8 +143284,8 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// See the sqlite3BitvecBuiltinTest() for additional information.
case 8:
{
- var sz int32 = int32(crt.VaInt32(&ap))
- var aProg uintptr = crt.VaUintptr(&ap)
+ var sz int32 = int32(libc.VaInt32(&ap))
+ var aProg uintptr = libc.VaUintptr(&ap)
rc = Xsqlite3BitvecBuiltinTest(tls, sz, aProg)
break
}
@@ -138332,7 +143301,7 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// sqlite3_test_control().
case 9:
{
- Xsqlite3Config.FxTestCallback = crt.VaUintptr(&ap)
+ Xsqlite3Config.FxTestCallback = libc.VaUintptr(&ap)
rc = Xsqlite3FaultSim(tls, 0)
break
}
@@ -138345,8 +143314,8 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
{
var xBenignBegin uintptr
var xBenignEnd uintptr
- xBenignBegin = crt.VaUintptr(&ap)
- xBenignEnd = crt.VaUintptr(&ap)
+ xBenignBegin = libc.VaUintptr(&ap)
+ xBenignEnd = libc.VaUintptr(&ap)
Xsqlite3BenignMallocHooks(tls, xBenignBegin, xBenignEnd)
break
}
@@ -138365,7 +143334,7 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
{
rc = Xsqlite3PendingByte
{
- var newVal uint32 = uint32(crt.VaUint32(&ap))
+ var newVal uint32 = uint32(libc.VaUint32(&ap))
if newVal != 0 {
Xsqlite3PendingByte = int32(newVal)
}
@@ -138417,7 +143386,7 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// }
case 13:
{
- var x int32 = int32(crt.VaInt32(&ap))
+ var x int32 = int32(libc.VaInt32(&ap))
if x != 0 {
rc = x
} else {
@@ -138426,17 +143395,15 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
break
}
- /*
- ** sqlite3_test_control(SQLITE_TESTCTRL_BYTEORDER);
- **
- ** The integer returned reveals the byte-order of the computer on which
- ** SQLite is running:
- **
- ** 1 big-endian, determined at run-time
- ** 10 little-endian, determined at run-time
- ** 432101 big-endian, determined at compile-time
- ** 123410 little-endian, determined at compile-time
- */
+ // sqlite3_test_control(SQLITE_TESTCTRL_BYTEORDER);
+ //
+ // The integer returned reveals the byte-order of the computer on which
+ // SQLite is running:
+ //
+ // 1 big-endian, determined at run-time
+ // 10 little-endian, determined at run-time
+ // 432101 big-endian, determined at compile-time
+ // 123410 little-endian, determined at compile-time
case 22:
{
rc = (((1234 * 100) + (1 * 10)) + 0)
@@ -138453,8 +143420,8 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// is obtained in every case.
case 15:
{
- var db uintptr = crt.VaUintptr(&ap)
- (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags = (U16(int32(crt.VaInt32(&ap)) & 0xffff))
+ var db uintptr = libc.VaUintptr(&ap)
+ (*Sqlite3)(unsafe.Pointer(db)).FdbOptFlags = (U16(int32(libc.VaInt32(&ap)) & 0xffff))
break
}
@@ -138464,7 +143431,7 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// and its variants fail. If onoff is zero, undo this setting.
case 18:
{
- Xsqlite3Config.FbLocaltimeFault = int32(crt.VaInt32(&ap))
+ Xsqlite3Config.FbLocaltimeFault = int32(libc.VaInt32(&ap))
break
}
@@ -138474,7 +143441,7 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// the database connection given in the argument.
case 17:
{
- var db uintptr = crt.VaUintptr(&ap)
+ var db uintptr = libc.VaUintptr(&ap)
*(*U32)(unsafe.Pointer(db + 44 /* &.mDbFlags */)) ^= (U32(0x0020))
break
}
@@ -138488,18 +143455,24 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// that demonstrat invariants on well-formed database files.
case 20:
{
- Xsqlite3Config.FneverCorrupt = int32(crt.VaInt32(&ap))
+ Xsqlite3Config.FneverCorrupt = int32(libc.VaInt32(&ap))
break
}
// sqlite3_test_control(SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS, int);
//
// Set or clear a flag that causes SQLite to verify that type, name,
- // and tbl_name fields of the sqlite_master table. This is normally
+ // and tbl_name fields of the sqlite_schema table. This is normally
// on, but it is sometimes useful to turn it off for testing.
+ //
+ // 2020-07-22: Disabling EXTRA_SCHEMA_CHECKS also disables the
+ // verification of rootpage numbers when parsing the schema. This
+ // is useful to make it easier to reach strange internal error states
+ // during testing. The EXTRA_SCHEMA_CHECKS setting is always enabled
+ // in production.
case 29:
{
- Xsqlite3Config.FbExtraSchemaChecks = U8(crt.VaInt32(&ap))
+ Xsqlite3Config.FbExtraSchemaChecks = U8(libc.VaInt32(&ap))
break
}
@@ -138509,7 +143482,7 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// provided to set a small and easily reachable reset value.
case 19:
{
- Xsqlite3Config.FiOnceResetThreshold = int32(crt.VaInt32(&ap))
+ Xsqlite3Config.FiOnceResetThreshold = int32(libc.VaInt32(&ap))
break
}
@@ -138525,8 +143498,8 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// sqlite3_test_control(SQLITE_TESTCTRL_SORTER_MMAP, db, nMax);
case 24:
{
- var db uintptr = crt.VaUintptr(&ap)
- (*Sqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap = int32(crt.VaInt32(&ap))
+ var db uintptr = libc.VaUintptr(&ap)
+ (*Sqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap = int32(libc.VaInt32(&ap))
break
}
@@ -138559,12 +143532,12 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// effect of erasing all imposter tables.
case 25:
{
- var db uintptr = crt.VaUintptr(&ap)
+ var db uintptr = libc.VaUintptr(&ap)
Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
- (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(Xsqlite3FindDbName(tls, db, crt.VaUintptr(&ap)))
- (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(crt.AssignBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.imposterTable */, uint32(crt.VaInt32(&ap)), 1, 1, 0x2))
- (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum = int32(crt.VaInt32(&ap))
- if (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0) && ((*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > 0) {
+ (*Sqlite3)(unsafe.Pointer(db)).Finit.FiDb = U8(Xsqlite3FindDbName(tls, db, libc.VaUintptr(&ap)))
+ (*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy = U8(libc.AssignBitFieldPtr8Uint32(db+176 /* &.init */ +8 /* &.imposterTable */, uint32(libc.VaInt32(&ap)), 1, 1, 0x2))
+ (*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum = Pgno(libc.VaInt32(&ap))
+ if (int32((*Sqlite3)(unsafe.Pointer(db)).Finit.Fbusy) == 0) && ((*Sqlite3)(unsafe.Pointer(db)).Finit.FnewTnum > Pgno(0)) {
Xsqlite3ResetAllSchemasOfConnection(tls, db)
}
Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
@@ -138582,7 +143555,7 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// for testing purposes.
case 27:
{
- var pCtx uintptr = crt.VaUintptr(&ap)
+ var pCtx uintptr = libc.VaUintptr(&ap)
Xsqlite3ResultIntReal(tls, pCtx)
break
}
@@ -138597,8 +143570,8 @@ func Xsqlite3_test_control(tls *crt.TLS, op int32, va uintptr) int32 { /* sqlite
// backwards for the first byte following four consecutive zero bytes.
//
// This only works if the filename passed in was obtained from the Pager.
-func databaseName(tls *crt.TLS, zName uintptr) uintptr { /* sqlite3.c:164550:19: */
- for (((int32(*(*int8)(unsafe.Pointer(zName + crt.UintptrFromInt32(-1)))) != 0) || (int32(*(*int8)(unsafe.Pointer(zName + crt.UintptrFromInt32(-2)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + crt.UintptrFromInt32(-3)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + crt.UintptrFromInt32(-4)))) != 0) {
+func databaseName(tls *libc.TLS, zName uintptr) uintptr { /* sqlite3.c:165221:19: */
+ for (((int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-1)))) != 0) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-2)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-3)))) != 0)) || (int32(*(*int8)(unsafe.Pointer(zName + libc.UintptrFromInt32(-4)))) != 0) {
zName--
}
return zName
@@ -138606,9 +143579,9 @@ func databaseName(tls *crt.TLS, zName uintptr) uintptr { /* sqlite3.c:164550:19:
// Append text z[] to the end of p[]. Return a pointer to the first
// character after then zero terminator on the new text in p[].
-func appendText(tls *crt.TLS, p uintptr, z uintptr) uintptr { /* sqlite3.c:164561:13: */
- var n Size_t = crt.Xstrlen(tls, z)
- crt.Xmemcpy(tls, p, z, (n + uint64(1)))
+func appendText(tls *libc.TLS, p uintptr, z uintptr) uintptr { /* sqlite3.c:165232:13: */
+ var n Size_t = libc.Xstrlen(tls, z)
+ libc.Xmemcpy(tls, p, z, (n + uint64(1)))
return ((p + uintptr(n)) + uintptr(1))
}
@@ -138619,30 +143592,30 @@ func appendText(tls *crt.TLS, p uintptr, z uintptr) uintptr { /* sqlite3.c:16456
//
// Memory layout must be compatible with that generated by the pager
// and expected by sqlite3_uri_parameter() and databaseName().
-func Xsqlite3_create_filename(tls *crt.TLS, zDatabase uintptr, zJournal uintptr, zWal uintptr, nParam int32, azParam uintptr) uintptr { /* sqlite3.c:164576:17: */
+func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr, zWal uintptr, nParam int32, azParam uintptr) uintptr { /* sqlite3.c:165247:17: */
var nByte Sqlite3_int64
var i int32
var pResult uintptr
var p uintptr
- nByte = (Sqlite3_int64(((crt.Xstrlen(tls, zDatabase) + crt.Xstrlen(tls, zJournal)) + crt.Xstrlen(tls, zWal)) + uint64(10)))
+ nByte = (Sqlite3_int64(((libc.Xstrlen(tls, zDatabase) + libc.Xstrlen(tls, zJournal)) + libc.Xstrlen(tls, zWal)) + uint64(10)))
for i = 0; i < (nParam * 2); i++ {
- nByte = Sqlite3_int64(uint64(nByte) + (uint64(crt.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + uint64(1))))
+ nByte = Sqlite3_int64(uint64(nByte) + (uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + uint64(1))))
}
- pResult = crt.AssignUintptr(&p, Xsqlite3_malloc64(tls, uint64(nByte)))
+ pResult = libc.AssignUintptr(&p, Xsqlite3_malloc64(tls, uint64(nByte)))
if p == uintptr(0) {
return uintptr(0)
}
- crt.Xmemset(tls, p, 0, uint64(4))
+ libc.Xmemset(tls, p, 0, uint64(4))
p += uintptr(4)
p = appendText(tls, p, zDatabase)
for i = 0; i < (nParam * 2); i++ {
p = appendText(tls, p, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))
}
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&p, 1))) = int8(0)
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8(0)
p = appendText(tls, p, zJournal)
p = appendText(tls, p, zWal)
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&p, 1))) = int8(0)
- *(*int8)(unsafe.Pointer(crt.PostIncUintptr(&p, 1))) = int8(0)
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8(0)
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))) = int8(0)
return (pResult + uintptr(4))
}
@@ -138650,7 +143623,7 @@ func Xsqlite3_create_filename(tls *crt.TLS, zDatabase uintptr, zJournal uintptr,
// Free memory obtained from sqlite3_create_filename(). It is a severe
// error to call this routine with any parameter other than a pointer
// previously obtained from sqlite3_create_filename() or a NULL pointer.
-func Xsqlite3_free_filename(tls *crt.TLS, p uintptr) { /* sqlite3.c:164612:17: */
+func Xsqlite3_free_filename(tls *libc.TLS, p uintptr) { /* sqlite3.c:165283:17: */
if p == uintptr(0) {
return
}
@@ -138667,7 +143640,7 @@ func Xsqlite3_free_filename(tls *crt.TLS, p uintptr) { /* sqlite3.c:164612:17: *
// query parameter we seek. This routine returns the value of the zParam
// parameter if it exists. If the parameter does not exist, this routine
// returns a NULL pointer.
-func Xsqlite3_uri_parameter(tls *crt.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:164630:23: */
+func Xsqlite3_uri_parameter(tls *libc.TLS, zFilename uintptr, zParam uintptr) uintptr { /* sqlite3.c:165301:23: */
if (zFilename == uintptr(0)) || (zParam == uintptr(0)) {
return uintptr(0)
}
@@ -138676,13 +143649,13 @@ func Xsqlite3_uri_parameter(tls *crt.TLS, zFilename uintptr, zParam uintptr) uin
}
// Return a pointer to the name of Nth query parameter of the filename.
-func Xsqlite3_uri_key(tls *crt.TLS, zFilename uintptr, N int32) uintptr { /* sqlite3.c:164639:23: */
+func Xsqlite3_uri_key(tls *libc.TLS, zFilename uintptr, N int32) uintptr { /* sqlite3.c:165310:23: */
if (zFilename == uintptr(0)) || (N < 0) {
return uintptr(0)
}
zFilename = databaseName(tls, zFilename)
zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
- for (*(*int8)(unsafe.Pointer(zFilename + uintptr(0))) != 0) && ((crt.PostDecInt32(&N, 1)) > 0) {
+ for (*(*int8)(unsafe.Pointer(zFilename + uintptr(0))) != 0) && ((libc.PostDecInt32(&N, 1)) > 0) {
zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
}
@@ -138693,9 +143666,9 @@ func Xsqlite3_uri_key(tls *crt.TLS, zFilename uintptr, N int32) uintptr { /* sql
}
// Return a boolean value for a query parameter.
-func Xsqlite3_uri_boolean(tls *crt.TLS, zFilename uintptr, zParam uintptr, bDflt int32) int32 { /* sqlite3.c:164653:16: */
+func Xsqlite3_uri_boolean(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt int32) int32 { /* sqlite3.c:165324:16: */
var z uintptr = Xsqlite3_uri_parameter(tls, zFilename, zParam)
- bDflt = (crt.Bool32(bDflt != 0))
+ bDflt = (libc.Bool32(bDflt != 0))
if z != 0 {
return int32(Xsqlite3GetBoolean(tls, z, uint8(bDflt)))
}
@@ -138703,7 +143676,7 @@ func Xsqlite3_uri_boolean(tls *crt.TLS, zFilename uintptr, zParam uintptr, bDflt
}
// Return a 64-bit integer value for a query parameter.
-func Xsqlite3_uri_int64(tls *crt.TLS, zFilename uintptr, zParam uintptr, bDflt Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:164662:26: */
+func Xsqlite3_uri_int64(tls *libc.TLS, zFilename uintptr, zParam uintptr, bDflt Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:165333:26: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -138724,10 +143697,10 @@ func Xsqlite3_uri_int64(tls *crt.TLS, zFilename uintptr, zParam uintptr, bDflt S
// passing free() a pointer that was not obtained from malloc() - it is
// an error that we cannot easily detect but that will likely cause memory
// corruption.
-func Xsqlite3_filename_database(tls *crt.TLS, zFilename uintptr) uintptr { /* sqlite3.c:164685:23: */
+func Xsqlite3_filename_database(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:165356:23: */
return databaseName(tls, zFilename)
}
-func Xsqlite3_filename_journal(tls *crt.TLS, zFilename uintptr) uintptr { /* sqlite3.c:164688:23: */
+func Xsqlite3_filename_journal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:165359:23: */
zFilename = databaseName(tls, zFilename)
zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
for *(*int8)(unsafe.Pointer(zFilename + uintptr(0))) != 0 {
@@ -138736,14 +143709,14 @@ func Xsqlite3_filename_journal(tls *crt.TLS, zFilename uintptr) uintptr { /* sql
}
return (zFilename + uintptr(1))
}
-func Xsqlite3_filename_wal(tls *crt.TLS, zFilename uintptr) uintptr { /* sqlite3.c:164697:23: */
+func Xsqlite3_filename_wal(tls *libc.TLS, zFilename uintptr) uintptr { /* sqlite3.c:165368:23: */
zFilename = Xsqlite3_filename_journal(tls, zFilename)
zFilename += (uintptr(Xsqlite3Strlen30(tls, zFilename) + 1))
return zFilename
}
// Return the Btree pointer identified by zDbName. Return NULL if not found.
-func Xsqlite3DbNameToBtree(tls *crt.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:164710:22: */
+func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:165381:22: */
var iDb int32
if zDbName != 0 {
iDb = Xsqlite3FindDbName(tls, db, zDbName)
@@ -138758,7 +143731,7 @@ func Xsqlite3DbNameToBtree(tls *crt.TLS, db uintptr, zDbName uintptr) uintptr {
// Return the filename of the database associated with a database
// connection.
-func Xsqlite3_db_filename(tls *crt.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:164719:23: */
+func Xsqlite3_db_filename(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr { /* sqlite3.c:165390:23: */
var pBt uintptr
pBt = Xsqlite3DbNameToBtree(tls, db, zDbName)
if pBt != 0 {
@@ -138769,7 +143742,7 @@ func Xsqlite3_db_filename(tls *crt.TLS, db uintptr, zDbName uintptr) uintptr { /
// Return 1 if database is read-only or 0 if read/write. Return -1 if
// no such database exists.
-func Xsqlite3_db_readonly(tls *crt.TLS, db uintptr, zDbName uintptr) int32 { /* sqlite3.c:164735:16: */
+func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) int32 { /* sqlite3.c:165406:16: */
var pBt uintptr
pBt = Xsqlite3DbNameToBtree(tls, db, zDbName)
if pBt != 0 {
@@ -138778,12 +143751,105 @@ func Xsqlite3_db_readonly(tls *crt.TLS, db uintptr, zDbName uintptr) int32 { /*
return -1
}
+// Obtain a snapshot handle for the snapshot of database zDb currently
+// being read by handle db.
+func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot uintptr) int32 { /* sqlite3.c:165423:16: */
+ var rc int32 = 1
+
+ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
+
+ if int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 {
+ var iDb int32 = Xsqlite3FindDbName(tls, db, zDb)
+ if (iDb == 0) || (iDb > 1) {
+ var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
+ if 0 == Xsqlite3BtreeIsInTrans(tls, pBt) {
+ rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0))
+ if rc == 0 {
+ rc = Xsqlite3PagerSnapshotGet(tls, Xsqlite3BtreePager(tls, pBt), ppSnapshot)
+ }
+ }
+ }
+ }
+
+ Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
+ return rc
+}
+
+// Open a read-transaction on the snapshot idendified by pSnapshot.
+func Xsqlite3_snapshot_open(tls *libc.TLS, db uintptr, zDb uintptr, pSnapshot uintptr) int32 { /* sqlite3.c:165459:16: */
+ var rc int32 = 1
+
+ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
+ if int32((*Sqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 {
+ var iDb int32
+ iDb = Xsqlite3FindDbName(tls, db, zDb)
+ if (iDb == 0) || (iDb > 1) {
+ var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
+ if Xsqlite3BtreeIsInTrans(tls, pBt) == 0 {
+ var pPager uintptr = Xsqlite3BtreePager(tls, pBt)
+ var bUnlock int32 = 0
+ if Xsqlite3BtreeIsInReadTrans(tls, pBt) != 0 {
+ if (*Sqlite3)(unsafe.Pointer(db)).FnVdbeActive == 0 {
+ rc = Xsqlite3PagerSnapshotCheck(tls, pPager, pSnapshot)
+ if rc == 0 {
+ bUnlock = 1
+ rc = Xsqlite3BtreeCommit(tls, pBt)
+ }
+ }
+ } else {
+ rc = 0
+ }
+ if rc == 0 {
+ rc = Xsqlite3PagerSnapshotOpen(tls, pPager, pSnapshot)
+ }
+ if rc == 0 {
+ rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0))
+ Xsqlite3PagerSnapshotOpen(tls, pPager, uintptr(0))
+ }
+ if bUnlock != 0 {
+ Xsqlite3PagerSnapshotUnlock(tls, pPager)
+ }
+ }
+ }
+ }
+
+ Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
+ return rc
+}
+
+// Recover as many snapshots as possible from the wal file associated with
+// schema zDb of database db.
+func Xsqlite3_snapshot_recover(tls *libc.TLS, db uintptr, zDb uintptr) int32 { /* sqlite3.c:165515:16: */
+ var rc int32 = 1
+ var iDb int32
+
+ Xsqlite3_mutex_enter(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
+ iDb = Xsqlite3FindDbName(tls, db, zDb)
+ if (iDb == 0) || (iDb > 1) {
+ var pBt uintptr = (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32)).FpBt
+ if 0 == Xsqlite3BtreeIsInReadTrans(tls, pBt) {
+ rc = Xsqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0))
+ if rc == 0 {
+ rc = Xsqlite3PagerSnapshotRecover(tls, Xsqlite3BtreePager(tls, pBt))
+ Xsqlite3BtreeCommit(tls, pBt)
+ }
+ }
+ }
+ Xsqlite3_mutex_leave(tls, (*Sqlite3)(unsafe.Pointer(db)).Fmutex)
+ return rc
+}
+
+// Free a snapshot handle obtained from sqlite3_snapshot_get().
+func Xsqlite3_snapshot_free(tls *libc.TLS, pSnapshot uintptr) { /* sqlite3.c:165546:17: */
+ Xsqlite3_free(tls, pSnapshot)
+}
+
// Given the name of a compile-time option, return true if that option
// was used and false if not.
//
// The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
// is not required for a match.
-func Xsqlite3_compileoption_used(tls *crt.TLS, zOptName uintptr) int32 { /* sqlite3.c:164888:16: */
+func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) int32 { /* sqlite3.c:165559:16: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -138795,7 +143861,7 @@ func Xsqlite3_compileoption_used(tls *crt.TLS, zOptName uintptr) int32 { /* sqli
azCompileOpt = Xsqlite3CompileOptions(tls, bp /* &nOpt */)
- if Xsqlite3_strnicmp(tls, zOptName, ts+23773 /* "SQLITE_" */, 7) == 0 {
+ if Xsqlite3_strnicmp(tls, zOptName, ts+27755 /* "SQLITE_" */, 7) == 0 {
zOptName += uintptr(7)
}
n = Xsqlite3Strlen30(tls, zOptName)
@@ -138813,7 +143879,7 @@ func Xsqlite3_compileoption_used(tls *crt.TLS, zOptName uintptr) int32 { /* sqli
// Return the N-th compile-time option string. If N is out of range,
// return a NULL pointer.
-func Xsqlite3_compileoption_get(tls *crt.TLS, N int32) uintptr { /* sqlite3.c:164921:23: */
+func Xsqlite3_compileoption_get(tls *libc.TLS, N int32) uintptr { /* sqlite3.c:165592:23: */
bp := tls.Alloc(4)
defer tls.Free(4)
@@ -138856,16 +143922,16 @@ func Xsqlite3_compileoption_get(tls *crt.TLS, N int32) uintptr { /* sqlite3.c:16
// Head of a linked list of all sqlite3 objects created by this process
// for which either sqlite3.pBlockingConnection or sqlite3.pUnlockConnection
-// is not NULL. This variable may only accessed while the STATIC_MASTER
+// is not NULL. This variable may only accessed while the STATIC_MAIN
// mutex is held.
-var sqlite3BlockedList uintptr = uintptr(0) /* sqlite3.c:164973:16 */
+var sqlite3BlockedList uintptr = uintptr(0) /* sqlite3.c:165644:16 */
// Remove connection db from the blocked connections list. If connection
// db is not currently a part of the list, this function is a no-op.
-func removeFromBlockedList(tls *crt.TLS, db uintptr) { /* sqlite3.c:165016:13: */
+func removeFromBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:165687:13: */
var pp uintptr
- for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 768 /* &.pNextBlocked */) {
+ for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 792 /* &.pNextBlocked */) {
if *(*uintptr)(unsafe.Pointer(pp)) == db {
*(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pp)))).FpNextBlocked
break
@@ -138875,23 +143941,23 @@ func removeFromBlockedList(tls *crt.TLS, db uintptr) { /* sqlite3.c:165016:13: *
// Add connection db to the blocked connections list. It is assumed
// that it is not already a part of the list.
-func addToBlockedList(tls *crt.TLS, db uintptr) { /* sqlite3.c:165031:13: */
+func addToBlockedList(tls *libc.TLS, db uintptr) { /* sqlite3.c:165702:13: */
var pp uintptr
- for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).FxUnlockNotify != (*Sqlite3)(unsafe.Pointer(db)).FxUnlockNotify); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 768 /* &.pNextBlocked */) {
+ for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && ((*Sqlite3)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(pp))))).FxUnlockNotify != (*Sqlite3)(unsafe.Pointer(db)).FxUnlockNotify); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 792 /* &.pNextBlocked */) {
}
(*Sqlite3)(unsafe.Pointer(db)).FpNextBlocked = *(*uintptr)(unsafe.Pointer(pp))
*(*uintptr)(unsafe.Pointer(pp)) = db
}
-// Obtain the STATIC_MASTER mutex.
-func enterMutex(tls *crt.TLS) { /* sqlite3.c:165046:13: */
+// Obtain the STATIC_MAIN mutex.
+func enterMutex(tls *libc.TLS) { /* sqlite3.c:165717:13: */
Xsqlite3_mutex_enter(tls, Xsqlite3MutexAlloc(tls, 2))
}
-// Release the STATIC_MASTER mutex.
-func leaveMutex(tls *crt.TLS) { /* sqlite3.c:165054:13: */
+// Release the STATIC_MAIN mutex.
+func leaveMutex(tls *libc.TLS) { /* sqlite3.c:165725:13: */
Xsqlite3_mutex_leave(tls, Xsqlite3MutexAlloc(tls, 2))
}
@@ -138915,7 +143981,7 @@ func leaveMutex(tls *crt.TLS) { /* sqlite3.c:165054:13: */
// Each call to this routine overrides any prior callbacks registered
// on the same "db". If xNotify==0 then any prior callbacks are immediately
// cancelled.
-func Xsqlite3_unlock_notify(tls *crt.TLS, db uintptr, xNotify uintptr, pArg uintptr) int32 { /* sqlite3.c:165081:16: */
+func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, pArg uintptr) int32 { /* sqlite3.c:165752:16: */
bp := tls.Alloc(8)
defer tls.Free(8)
*(*uintptr)(unsafe.Pointer(bp)) = pArg
@@ -138935,7 +144001,7 @@ func Xsqlite3_unlock_notify(tls *crt.TLS, db uintptr, xNotify uintptr, pArg uint
// The blocking transaction has been concluded. Or there never was a
// blocking transaction. In either case, invoke the notify callback
// immediately.
- (*(*func(*crt.TLS, uintptr, int32))(unsafe.Pointer(&xNotify)))(tls, bp /* &pArg */, 1)
+ (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&xNotify)))(tls, bp /* &pArg */, 1)
} else {
var p uintptr
@@ -138956,7 +144022,7 @@ func Xsqlite3_unlock_notify(tls *crt.TLS, db uintptr, xNotify uintptr, pArg uint
Xsqlite3ErrorWithMsg(tls, db, rc, func() uintptr {
if rc != 0 {
- return ts + 23781 /* "database is dead..." */
+ return ts + 27763 /* "database is dead..." */
}
return uintptr(0)
}(), 0)
@@ -138968,7 +144034,7 @@ func Xsqlite3_unlock_notify(tls *crt.TLS, db uintptr, xNotify uintptr, pArg uint
// associated with connection db. The operation will return SQLITE_LOCKED
// to the user because it requires a lock that will not be available
// until connection pBlocker concludes its current transaction.
-func Xsqlite3ConnectionBlocked(tls *crt.TLS, db uintptr, pBlocker uintptr) { /* sqlite3.c:165131:21: */
+func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr) { /* sqlite3.c:165802:21: */
enterMutex(tls)
if ((*Sqlite3)(unsafe.Pointer(db)).FpBlockingConnection == uintptr(0)) && ((*Sqlite3)(unsafe.Pointer(db)).FpUnlockConnection == uintptr(0)) {
addToBlockedList(tls, db)
@@ -138994,7 +144060,7 @@ func Xsqlite3ConnectionBlocked(tls *crt.TLS, db uintptr, pBlocker uintptr) { /*
// 3) If the two steps above mean that pBlockingConnection==0 and
// pUnlockConnection==0, remove the entry from the blocked connections
// list.
-func Xsqlite3ConnectionUnlocked(tls *crt.TLS, db uintptr) { /* sqlite3.c:165159:21: */
+func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { /* sqlite3.c:165830:21: */
bp := tls.Alloc(128)
defer tls.Free(128)
@@ -139007,7 +144073,7 @@ func Xsqlite3ConnectionUnlocked(tls *crt.TLS, db uintptr) { /* sqlite3.c:165159:
// Starter space for aArg[]. No malloc required
aArg = bp /* &aStatic[0] */
- enterMutex(tls) // Enter STATIC_MASTER mutex
+ enterMutex(tls) // Enter STATIC_MAIN mutex
// This loop runs once for each entry in the blocked-connections list.
for pp = uintptr(unsafe.Pointer(&sqlite3BlockedList)); *(*uintptr)(unsafe.Pointer(pp)) != 0; {
@@ -139022,7 +144088,7 @@ func Xsqlite3ConnectionUnlocked(tls *crt.TLS, db uintptr) { /* sqlite3.c:165159:
if (*Sqlite3)(unsafe.Pointer(p)).FpUnlockConnection == db {
if ((*Sqlite3)(unsafe.Pointer(p)).FxUnlockNotify != xUnlockNotify) && (nArg != 0) {
- (*(*func(*crt.TLS, uintptr, int32))(unsafe.Pointer(&xUnlockNotify)))(tls, aArg, nArg)
+ (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&xUnlockNotify)))(tls, aArg, nArg)
nArg = 0
}
@@ -139033,9 +144099,9 @@ func Xsqlite3ConnectionUnlocked(tls *crt.TLS, db uintptr) { /* sqlite3.c:165159:
// The aArg[] array needs to grow.
var pNew uintptr = Xsqlite3Malloc(tls, (uint64((uint64(nArg) * uint64(unsafe.Sizeof(uintptr(0)))) * uint64(2))))
if pNew != 0 {
- crt.Xmemcpy(tls, pNew, aArg, (uint64(nArg) * uint64(unsafe.Sizeof(uintptr(0)))))
+ libc.Xmemcpy(tls, pNew, aArg, (uint64(nArg) * uint64(unsafe.Sizeof(uintptr(0)))))
Xsqlite3_free(tls, aDyn)
- aDyn = crt.AssignUintptr(&aArg, pNew)
+ aDyn = libc.AssignUintptr(&aArg, pNew)
} else {
// This occurs when the array of context pointers that need to
// be passed to the unlock-notify callback is larger than the
@@ -139060,13 +144126,13 @@ func Xsqlite3ConnectionUnlocked(tls *crt.TLS, db uintptr) { /* sqlite3.c:165159:
// reduce the applications ability to prioritize multiple
// connections. But it is the best that can be done under the
// circumstances.
- (*(*func(*crt.TLS, uintptr, int32))(unsafe.Pointer(&xUnlockNotify)))(tls, aArg, nArg)
+ (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&xUnlockNotify)))(tls, aArg, nArg)
nArg = 0
}
}
Xsqlite3EndBenignMalloc(tls)
- *(*uintptr)(unsafe.Pointer(aArg + uintptr(crt.PostIncInt32(&nArg, 1))*8)) = (*Sqlite3)(unsafe.Pointer(p)).FpUnlockArg
+ *(*uintptr)(unsafe.Pointer(aArg + uintptr(libc.PostIncInt32(&nArg, 1))*8)) = (*Sqlite3)(unsafe.Pointer(p)).FpUnlockArg
xUnlockNotify = (*Sqlite3)(unsafe.Pointer(p)).FxUnlockNotify
(*Sqlite3)(unsafe.Pointer(p)).FpUnlockConnection = uintptr(0)
(*Sqlite3)(unsafe.Pointer(p)).FxUnlockNotify = uintptr(0)
@@ -139079,20 +144145,20 @@ func Xsqlite3ConnectionUnlocked(tls *crt.TLS, db uintptr) { /* sqlite3.c:165159:
*(*uintptr)(unsafe.Pointer(pp)) = (*Sqlite3)(unsafe.Pointer(p)).FpNextBlocked
(*Sqlite3)(unsafe.Pointer(p)).FpNextBlocked = uintptr(0)
} else {
- pp = (p + 768 /* &.pNextBlocked */)
+ pp = (p + 792 /* &.pNextBlocked */)
}
}
if nArg != 0 {
- (*(*func(*crt.TLS, uintptr, int32))(unsafe.Pointer(&xUnlockNotify)))(tls, aArg, nArg)
+ (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&xUnlockNotify)))(tls, aArg, nArg)
}
Xsqlite3_free(tls, aDyn)
- leaveMutex(tls) // Leave STATIC_MASTER mutex
+ leaveMutex(tls) // Leave STATIC_MAIN mutex
}
// This is called when the database connection passed as an argument is
// being closed. The connection is removed from the blocked list.
-func Xsqlite3ConnectionClosed(tls *crt.TLS, db uintptr) { /* sqlite3.c:165258:21: */
+func Xsqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { /* sqlite3.c:165929:21: */
Xsqlite3ConnectionUnlocked(tls, db)
enterMutex(tls)
removeFromBlockedList(tls, db)
@@ -139676,9 +144742,7086 @@ func Xsqlite3ConnectionClosed(tls *crt.TLS, db uintptr) { /* sqlite3.c:165258:21
// This implementation parses JSON text at 250 MB/s, so it is hard to see
// how JSONB might improve on that.)
-//************* End of json1.c **********************************************
-//************* Begin file rtree.c ******************************************
-// 2001 September 15
+// #include <assert.h>
+// #include <string.h>
+// #include <stdlib.h>
+// #include <stdarg.h>
+
+// Mark a function parameter as unused, to suppress nuisance compiler
+// warnings.
+
+// Versions of isspace(), isalnum() and isdigit() to which it is safe
+// to pass signed char values.
+// Use the SQLite core versions if this routine is part of the
+// SQLite amalgamation
+
+// Growing our own isspace() routine this way is twice as fast as
+// the library isspace() function, resulting in a 7% overall performance
+// increase for the parser. (Ubuntu14.10 gcc 4.8.4 x64 with -Os).
+var jsonIsSpace = [256]int8{
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(1), int8(1), int8(0), int8(0), int8(1), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(1), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+} /* sqlite3.c:185497:19 */
+
+// Objects
+type JsonString1 = struct {
+ FpCtx uintptr
+ FzBuf uintptr
+ FnAlloc U64
+ FnUsed U64
+ FbStatic U8
+ FbErr U8
+ FzSpace [100]int8
+ _ [2]byte
+}
+
+// Objects
+type JsonString = JsonString1 /* sqlite3.c:185527:27 */
+type JsonNode1 = struct {
+ FeType U8
+ FjnFlags U8
+ Fn U32
+ Fu struct{ FzJContent uintptr }
+}
+
+type JsonNode = JsonNode1 /* sqlite3.c:185528:25 */
+type JsonParse1 = struct {
+ FnNode U32
+ FnAlloc U32
+ FaNode uintptr
+ FzJson uintptr
+ FaUp uintptr
+ Foom U8
+ FnErr U8
+ FiDepth U16
+ FnJson int32
+ FiHold U32
+ _ [4]byte
+}
+
+type JsonParse = JsonParse1 /* sqlite3.c:185529:26 */
+
+// JSON type values
+
+// The "subtype" set for JSON values
+
+// Names of the various JSON types:
+var jsonType = [8]uintptr{
+ ts + 7824 /* "null" */, ts + 9525 /* "true" */, ts + 9530 /* "false" */, ts + 7834 /* "integer" */, ts + 7829 /* "real" */, ts + 15867 /* "text" */, ts + 27786 /* "array" */, ts + 27792, /* "object" */
+} /* sqlite3.c:185562:19 */
+
+// Maximum nesting depth of JSON for this implementation.
+//
+// This limit is needed to avoid a stack overflow in the recursive
+// descent parser. A depth of 2000 is far deeper than any sane JSON
+// should go.
+
+// *************************************************************************
+//
+// Utility routines for dealing with JsonString objects
+//
+
+// Set the JsonString object to an empty string
+func jsonZero(tls *libc.TLS, p uintptr) { /* sqlite3.c:185622:13: */
+ (*JsonString)(unsafe.Pointer(p)).FzBuf = p + 34 /* &.zSpace */
+ (*JsonString)(unsafe.Pointer(p)).FnAlloc = U64(unsafe.Sizeof([100]int8{}))
+ (*JsonString)(unsafe.Pointer(p)).FnUsed = uint64(0)
+ (*JsonString)(unsafe.Pointer(p)).FbStatic = U8(1)
+}
+
+// Initialize the JsonString object
+func jsonInit(tls *libc.TLS, p uintptr, pCtx uintptr) { /* sqlite3.c:185631:13: */
+ (*JsonString)(unsafe.Pointer(p)).FpCtx = pCtx
+ (*JsonString)(unsafe.Pointer(p)).FbErr = U8(0)
+ jsonZero(tls, p)
+}
+
+// Free all allocated memory and reset the JsonString object back to its
+// initial state.
+func jsonReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:185641:13: */
+ if !(int32((*JsonString)(unsafe.Pointer(p)).FbStatic) != 0) {
+ Xsqlite3_free(tls, (*JsonString)(unsafe.Pointer(p)).FzBuf)
+ }
+ jsonZero(tls, p)
+}
+
+// Report an out-of-memory (OOM) condition
+func jsonOom(tls *libc.TLS, p uintptr) { /* sqlite3.c:185649:13: */
+ (*JsonString)(unsafe.Pointer(p)).FbErr = U8(1)
+ Xsqlite3_result_error_nomem(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx)
+ jsonReset(tls, p)
+}
+
+// Enlarge pJson->zBuf so that it can hold at least N more bytes.
+// Return zero on success. Return non-zero on an OOM error
+func jsonGrow(tls *libc.TLS, p uintptr, N U32) int32 { /* sqlite3.c:185658:12: */
+ var nTotal U64
+ if U64(N) < (*JsonString)(unsafe.Pointer(p)).FnAlloc {
+ nTotal = ((*JsonString)(unsafe.Pointer(p)).FnAlloc * uint64(2))
+ } else {
+ nTotal = (((*JsonString)(unsafe.Pointer(p)).FnAlloc + U64(N)) + uint64(10))
+ }
+ var zNew uintptr
+ if (*JsonString)(unsafe.Pointer(p)).FbStatic != 0 {
+ if (*JsonString)(unsafe.Pointer(p)).FbErr != 0 {
+ return 1
+ }
+ zNew = Xsqlite3_malloc64(tls, nTotal)
+ if zNew == uintptr(0) {
+ jsonOom(tls, p)
+ return 7
+ }
+ libc.Xmemcpy(tls, zNew, (*JsonString)(unsafe.Pointer(p)).FzBuf, Size_t((*JsonString)(unsafe.Pointer(p)).FnUsed))
+ (*JsonString)(unsafe.Pointer(p)).FzBuf = zNew
+ (*JsonString)(unsafe.Pointer(p)).FbStatic = U8(0)
+ } else {
+ zNew = Xsqlite3_realloc64(tls, (*JsonString)(unsafe.Pointer(p)).FzBuf, nTotal)
+ if zNew == uintptr(0) {
+ jsonOom(tls, p)
+ return 7
+ }
+ (*JsonString)(unsafe.Pointer(p)).FzBuf = zNew
+ }
+ (*JsonString)(unsafe.Pointer(p)).FnAlloc = nTotal
+ return 0
+}
+
+// Append N bytes from zIn onto the end of the JsonString string.
+func jsonAppendRaw(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:185685:13: */
+ if N == U32(0) {
+ return
+ }
+ if ((U64(N) + (*JsonString)(unsafe.Pointer(p)).FnUsed) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, N) != 0) {
+ return
+ }
+ libc.Xmemcpy(tls, ((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed)), zIn, uint64(N))
+ *(*U64)(unsafe.Pointer(p + 24 /* &.nUsed */)) += (U64(N))
+}
+
+// Append formatted text (not to exceed N bytes) to the JsonString.
+func jsonPrintf(tls *libc.TLS, N int32, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:185694:13: */
+ var ap Va_list
+ _ = ap
+ if (((*JsonString)(unsafe.Pointer(p)).FnUsed + U64(N)) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, uint32(N)) != 0) {
+ return
+ }
+ ap = va
+ Xsqlite3_vsnprintf(tls, N, ((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed)), zFormat, ap)
+ _ = ap
+ *(*U64)(unsafe.Pointer(p + 24 /* &.nUsed */)) += (U64(int32(libc.Xstrlen(tls, ((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*JsonString)(unsafe.Pointer(p)).FnUsed))))))
+}
+
+// Append a single character
+func jsonAppendChar(tls *libc.TLS, p uintptr, c int8) { /* sqlite3.c:185705:13: */
+ if ((*JsonString)(unsafe.Pointer(p)).FnUsed >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, uint32(1)) != 0) {
+ return
+ }
+ *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = c
+}
+
+// Append a comma separator to the output buffer, if the previous
+// character is not '[' or '{'.
+func jsonAppendSeparator(tls *libc.TLS, p uintptr) { /* sqlite3.c:185713:13: */
+ var c int8
+ if (*JsonString)(unsafe.Pointer(p)).FnUsed == uint64(0) {
+ return
+ }
+ c = *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(((*JsonString)(unsafe.Pointer(p)).FnUsed - uint64(1)))))
+ if (int32(c) != '[') && (int32(c) != '{') {
+ jsonAppendChar(tls, p, int8(','))
+ }
+}
+
+// Append the N-byte string in zIn to the end of the JsonString string
+// under construction. Enclose the string in "..." and escape
+// any double-quotes or backslash characters contained within the
+// string.
+func jsonAppendString(tls *libc.TLS, p uintptr, zIn uintptr, N U32) { /* sqlite3.c:185725:13: */
+ var i U32
+ var c uint8
+ if !((((U64(N) + (*JsonString)(unsafe.Pointer(p)).FnUsed) + uint64(2)) >= (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, (N+U32(2))) != 0)) {
+ goto __1
+ }
+ return
+__1:
+ ;
+ *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('"')
+ i = U32(0)
+__2:
+ if !(i < N) {
+ goto __4
+ }
+ c = *(*uint8)(unsafe.Pointer((zIn) + uintptr(i)))
+ if !((int32(c) == '"') || (int32(c) == '\\')) {
+ goto __5
+ }
+json_simple_escape:
+ if !((((((*JsonString)(unsafe.Pointer(p)).FnUsed + U64(N)) + uint64(3)) - U64(i)) > (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, ((N+U32(3))-i)) != 0)) {
+ goto __7
+ }
+ return
+__7:
+ ;
+ *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('\\')
+ goto __6
+__5:
+ if !(int32(c) <= 0x1f) {
+ goto __8
+ }
+
+ if !(aSpecial[c] != 0) {
+ goto __9
+ }
+ c = uint8(aSpecial[c])
+ goto json_simple_escape
+__9:
+ ;
+ if !((((((*JsonString)(unsafe.Pointer(p)).FnUsed + U64(N)) + uint64(7)) + U64(i)) > (*JsonString)(unsafe.Pointer(p)).FnAlloc) && (jsonGrow(tls, p, ((N+U32(7))-i)) != 0)) {
+ goto __10
+ }
+ return
+__10:
+ ;
+ *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('\\')
+ *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('u')
+ *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('0')
+ *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('0')
+ *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = (int8('0' + (int32(c) >> 4)))
+ c = uint8(*(*int8)(unsafe.Pointer(ts + 27799 /* "0123456789abcdef" */ + uintptr((int32(c) & 0xf)))))
+__8:
+ ;
+__6:
+ ;
+ *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8(c)
+ goto __3
+__3:
+ i++
+ goto __2
+ goto __4
+__4:
+ ;
+ *(*int8)(unsafe.Pointer((*JsonString)(unsafe.Pointer(p)).FzBuf + uintptr(libc.PostIncUint64(&(*JsonString)(unsafe.Pointer(p)).FnUsed, 1)))) = int8('"')
+
+}
+
+var aSpecial = [32]int8{
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8('b'), int8('t'), int8('n'), int8(0), int8('f'), int8('r'), int8(0), int8(0),
+ int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0), int8(0),
+} /* sqlite3.c:185736:25 */
+
+// Append a function parameter value to the JSON string under
+// construction.
+func jsonAppendValue(tls *libc.TLS, p uintptr, pValue uintptr) { /* sqlite3.c:185768:13: */
+ switch Xsqlite3_value_type(tls, pValue) {
+ case 5:
+ {
+ jsonAppendRaw(tls, p, ts+7824 /* "null" */, uint32(4))
+ break
+ }
+ case 1:
+ fallthrough
+ case 2:
+ {
+ var z uintptr = Xsqlite3_value_text(tls, pValue)
+ var n U32 = U32(Xsqlite3_value_bytes(tls, pValue))
+ jsonAppendRaw(tls, p, z, n)
+ break
+ }
+ case 3:
+ {
+ var z uintptr = Xsqlite3_value_text(tls, pValue)
+ var n U32 = U32(Xsqlite3_value_bytes(tls, pValue))
+ if Xsqlite3_value_subtype(tls, pValue) == uint32(74) {
+ jsonAppendRaw(tls, p, z, n)
+ } else {
+ jsonAppendString(tls, p, z, n)
+ }
+ break
+ }
+ default:
+ {
+ if int32((*JsonString)(unsafe.Pointer(p)).FbErr) == 0 {
+ Xsqlite3_result_error(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, ts+27816 /* "JSON cannot hold..." */, -1)
+ (*JsonString)(unsafe.Pointer(p)).FbErr = U8(2)
+ jsonReset(tls, p)
+ }
+ break
+ }
+ }
+}
+
+// Make the JSON in p the result of the SQL function.
+func jsonResult(tls *libc.TLS, p uintptr) { /* sqlite3.c:185808:13: */
+ if int32((*JsonString)(unsafe.Pointer(p)).FbErr) == 0 {
+ Xsqlite3_result_text64(tls, (*JsonString)(unsafe.Pointer(p)).FpCtx, (*JsonString)(unsafe.Pointer(p)).FzBuf, (*JsonString)(unsafe.Pointer(p)).FnUsed,
+ func() uintptr {
+ if (*JsonString)(unsafe.Pointer(p)).FbStatic != 0 {
+ return libc.UintptrFromInt32(-1)
+ }
+ return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))
+ }(),
+ uint8(1))
+ jsonZero(tls, p)
+ }
+
+}
+
+// *************************************************************************
+//
+// Utility routines for dealing with JsonNode and JsonParse objects
+//
+
+// Return the number of consecutive JsonNode slots need to represent
+// the parsed JSON at pNode. The minimum answer is 1. For ARRAY and
+// OBJECT types, the number might be larger.
+//
+// Appended elements are not counted. The value returned is the number
+// by which the JsonNode counter should increment in order to go to the
+// next peer value.
+func jsonNodeSize(tls *libc.TLS, pNode uintptr) U32 { /* sqlite3.c:185831:12: */
+ if int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) >= 6 {
+ return ((*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1))
+ }
+ return uint32(1)
+}
+
+// Reclaim all memory allocated by a JsonParse object. But do not
+// delete the JsonParse object itself.
+func jsonParseReset(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:185839:13: */
+ Xsqlite3_free(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaNode)
+ (*JsonParse)(unsafe.Pointer(pParse)).FaNode = uintptr(0)
+ (*JsonParse)(unsafe.Pointer(pParse)).FnNode = U32(0)
+ (*JsonParse)(unsafe.Pointer(pParse)).FnAlloc = U32(0)
+ Xsqlite3_free(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaUp)
+ (*JsonParse)(unsafe.Pointer(pParse)).FaUp = uintptr(0)
+}
+
+// Free a JsonParse object that was obtained from sqlite3_malloc().
+func jsonParseFree(tls *libc.TLS, pParse uintptr) { /* sqlite3.c:185851:13: */
+ jsonParseReset(tls, pParse)
+ Xsqlite3_free(tls, pParse)
+}
+
+// Convert the JsonNode pNode into a pure JSON string and
+// append to pOut. Subsubstructure is also included. Return
+// the number of JsonNode objects that are encoded.
+func jsonRenderNode(tls *libc.TLS, pNode uintptr, pOut uintptr, aReplace uintptr) { /* sqlite3.c:185861:13: */
+ if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & (0x08 | 0x10)) != 0 {
+ if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & 0x08) != 0 {
+ jsonAppendValue(tls, pOut, *(*uintptr)(unsafe.Pointer(aReplace + uintptr(*(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)))*8)))
+ return
+ }
+ pNode = *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))
+ }
+ switch int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) {
+ default:
+ {
+
+ jsonAppendRaw(tls, pOut, ts+7824 /* "null" */, uint32(4))
+ break
+ }
+ case 1:
+ {
+ jsonAppendRaw(tls, pOut, ts+9525 /* "true" */, uint32(4))
+ break
+ }
+ case 2:
+ {
+ jsonAppendRaw(tls, pOut, ts+9530 /* "false" */, uint32(5))
+ break
+ }
+ case 5:
+ {
+ if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & 0x01) != 0 {
+ jsonAppendString(tls, pOut, *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)), (*JsonNode)(unsafe.Pointer(pNode)).Fn)
+ break
+ }
+ /* no break */
+ }
+ fallthrough
+ case 4:
+ fallthrough
+ case 3:
+ {
+ jsonAppendRaw(tls, pOut, *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)), (*JsonNode)(unsafe.Pointer(pNode)).Fn)
+ break
+ }
+ case 6:
+ {
+ var j U32 = U32(1)
+ jsonAppendChar(tls, pOut, int8('['))
+ for {
+ for j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn {
+ if (int32((*JsonNode)(unsafe.Pointer(pNode+uintptr(j)*16)).FjnFlags) & 0x04) == 0 {
+ jsonAppendSeparator(tls, pOut)
+ jsonRenderNode(tls, (pNode + uintptr(j)*16), pOut, aReplace)
+ }
+ j = j + (jsonNodeSize(tls, (pNode + uintptr(j)*16)))
+ }
+ if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & 0x20) == 0 {
+ break
+ }
+ pNode = (pNode + uintptr(*(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)))*16)
+ j = U32(1)
+ }
+ jsonAppendChar(tls, pOut, int8(']'))
+ break
+ }
+ case 7:
+ {
+ var j U32 = U32(1)
+ jsonAppendChar(tls, pOut, int8('{'))
+ for {
+ for j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn {
+ if (int32((*JsonNode)(unsafe.Pointer(pNode+uintptr((j+U32(1)))*16)).FjnFlags) & 0x04) == 0 {
+ jsonAppendSeparator(tls, pOut)
+ jsonRenderNode(tls, (pNode + uintptr(j)*16), pOut, aReplace)
+ jsonAppendChar(tls, pOut, int8(':'))
+ jsonRenderNode(tls, (pNode + uintptr((j+U32(1)))*16), pOut, aReplace)
+ }
+ j = j + (U32(1) + jsonNodeSize(tls, (pNode+uintptr((j+U32(1)))*16)))
+ }
+ if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & 0x20) == 0 {
+ break
+ }
+ pNode = (pNode + uintptr(*(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)))*16)
+ j = U32(1)
+ }
+ jsonAppendChar(tls, pOut, int8('}'))
+ break
+ }
+ }
+}
+
+// Return a JsonNode and all its descendents as a JSON string.
+func jsonReturnJson(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:185943:13: */
+ bp := tls.Alloc(136)
+ defer tls.Free(136)
+
+ // var s JsonString at bp, 136
+
+ jsonInit(tls, bp /* &s */, pCtx)
+ jsonRenderNode(tls, pNode, bp /* &s */, aReplace)
+ jsonResult(tls, bp /* &s */)
+ Xsqlite3_result_subtype(tls, pCtx, uint32(74))
+}
+
+// Translate a single byte of Hex into an integer.
+// This routine only works if h really is a valid hexadecimal
+// character: 0..9a..fA..F
+func jsonHexToInt(tls *libc.TLS, h int32) U8 { /* sqlite3.c:185960:11: */
+
+ h = h + (9 * (1 & (h >> 6)))
+ return (U8(h & 0xf))
+}
+
+// Convert a 4-byte hex string into an integer
+func jsonHexToInt4(tls *libc.TLS, z uintptr) U32 { /* sqlite3.c:185973:12: */
+ var v U32
+
+ v = (U32((((int32(jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))))) << 12) +
+ (int32(jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(1)))))) << 8)) +
+ (int32(jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(2)))))) << 4)) +
+ int32(jsonHexToInt(tls, int32(*(*int8)(unsafe.Pointer(z + uintptr(3))))))))
+ return v
+}
+
+// Make the JsonNode the return value of the function.
+func jsonReturn(tls *libc.TLS, pNode uintptr, pCtx uintptr, aReplace uintptr) { /* sqlite3.c:185989:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var v uint32
+ var i Sqlite3_int64
+ var z uintptr
+ // var r float64 at bp, 8
+
+ var z1 uintptr
+ var vlo U32
+ var v1 U32
+ var c int8
+ // Translate JSON formatted string into raw text
+ var i1 U32
+ var n U32
+ var z2 uintptr
+ var zOut uintptr
+ var j U32
+ switch int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) {
+ default:
+ goto __2
+ case 1:
+ goto __3
+ case 2:
+ goto __4
+ case 3:
+ goto __5
+ case 4:
+ goto __6
+ case 5:
+ goto __7
+ case 6:
+ goto __8
+ case 7:
+ goto __9
+ }
+ goto __1
+__2:
+ ;
+ Xsqlite3_result_null(tls, pCtx)
+ goto __1
+__3:
+ Xsqlite3_result_int(tls, pCtx, 1)
+ goto __1
+__4:
+ Xsqlite3_result_int(tls, pCtx, 0)
+ goto __1
+__5:
+ i = int64(0)
+ z = *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))
+ if !(int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '-') {
+ goto __10
+ }
+ z++
+__10:
+ ;
+__11:
+ if !((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) <= '9')) {
+ goto __12
+ }
+ v = (uint32(int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))) - '0'))
+ if !(i >= ((int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) / int64(10))) {
+ goto __13
+ }
+ if !(i > ((int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)) / int64(10))) {
+ goto __14
+ }
+ goto int_as_real
+__14:
+ ;
+ if !((int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) <= '9')) {
+ goto __15
+ }
+ goto int_as_real
+__15:
+ ;
+ if !(v == uint32(9)) {
+ goto __16
+ }
+ goto int_as_real
+__16:
+ ;
+ if !(v == uint32(8)) {
+ goto __17
+ }
+ if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)) + uintptr(0)))) == '-') {
+ goto __18
+ }
+ Xsqlite3_result_int64(tls, pCtx, ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))
+ goto int_done
+ goto __19
+__18:
+ goto int_as_real
+__19:
+ ;
+__17:
+ ;
+__13:
+ ;
+ i = ((i * int64(10)) + Sqlite3_int64(v))
+ goto __11
+__12:
+ ;
+ if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)) + uintptr(0)))) == '-') {
+ goto __20
+ }
+ i = -i
+__20:
+ ;
+ Xsqlite3_result_int64(tls, pCtx, i)
+int_done:
+ goto __1
+int_as_real:
+ i = int64(0)
+__6:
+ z1 = *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))
+ Xsqlite3AtoF(tls, z1, bp /* &r */, Xsqlite3Strlen30(tls, z1), uint8(1))
+ Xsqlite3_result_double(tls, pCtx, *(*float64)(unsafe.Pointer(bp /* r */)))
+ goto __1
+__7:
+ ;
+ if !((int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & 0x02) == 0) {
+ goto __21
+ }
+ // JSON formatted without any backslash-escapes
+ Xsqlite3_result_text(tls, pCtx, (*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)) + uintptr(1)), (int32((*JsonNode)(unsafe.Pointer(pNode)).Fn - U32(2))),
+ libc.UintptrFromInt32(-1))
+ goto __22
+__21:
+ n = (*JsonNode)(unsafe.Pointer(pNode)).Fn
+ z2 = *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))
+ zOut = Xsqlite3_malloc(tls, (int32(n + U32(1))))
+ if !(zOut == uintptr(0)) {
+ goto __23
+ }
+ Xsqlite3_result_error_nomem(tls, pCtx)
+ goto __1
+__23:
+ ;
+ i1 = U32(1)
+ j = U32(0)
+__24:
+ if !(i1 < (n - U32(1))) {
+ goto __26
+ }
+ c = *(*int8)(unsafe.Pointer(z2 + uintptr(i1)))
+ if !(int32(c) != '\\') {
+ goto __27
+ }
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = c
+ goto __28
+__27:
+ c = *(*int8)(unsafe.Pointer(z2 + uintptr(libc.PreIncUint32(&i1, 1))))
+ if !(int32(c) == 'u') {
+ goto __29
+ }
+ v1 = jsonHexToInt4(tls, ((z2 + uintptr(i1)) + uintptr(1)))
+ i1 = i1 + (U32(4))
+ if !(v1 == U32(0)) {
+ goto __31
+ }
+ goto __26
+__31:
+ ;
+ if !(v1 <= U32(0x7f)) {
+ goto __32
+ }
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = int8(v1)
+ goto __33
+__32:
+ if !(v1 <= U32(0x7ff)) {
+ goto __34
+ }
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (int8(U32(0xc0) | (v1 >> 6)))
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (int8(U32(0x80) | (v1 & U32(0x3f))))
+ goto __35
+__34:
+ if !((((((v1 & U32(0xfc00)) == U32(0xd800)) &&
+ (i1 < (n - U32(6)))) &&
+ (int32(*(*int8)(unsafe.Pointer(z2 + uintptr((i1 + U32(1)))))) == '\\')) &&
+ (int32(*(*int8)(unsafe.Pointer(z2 + uintptr((i1 + U32(2)))))) == 'u')) &&
+ (((libc.AssignUint32(&vlo, jsonHexToInt4(tls, ((z2+uintptr(i1))+uintptr(3))))) & U32(0xfc00)) == U32(0xdc00))) {
+ goto __36
+ }
+ // We have a surrogate pair
+ v1 = ((((v1 & U32(0x3ff)) << 10) + (vlo & U32(0x3ff))) + U32(0x10000))
+ i1 = i1 + (U32(6))
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (int8(U32(0xf0) | (v1 >> 18)))
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (int8(U32(0x80) | ((v1 >> 12) & U32(0x3f))))
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (int8(U32(0x80) | ((v1 >> 6) & U32(0x3f))))
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (int8(U32(0x80) | (v1 & U32(0x3f))))
+ goto __37
+__36:
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (int8(U32(0xe0) | (v1 >> 12)))
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (int8(U32(0x80) | ((v1 >> 6) & U32(0x3f))))
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = (int8(U32(0x80) | (v1 & U32(0x3f))))
+__37:
+ ;
+__35:
+ ;
+__33:
+ ;
+ goto __30
+__29:
+ if !(int32(c) == 'b') {
+ goto __38
+ }
+ c = int8('\b')
+ goto __39
+__38:
+ if !(int32(c) == 'f') {
+ goto __40
+ }
+ c = int8('\f')
+ goto __41
+__40:
+ if !(int32(c) == 'n') {
+ goto __42
+ }
+ c = int8('\n')
+ goto __43
+__42:
+ if !(int32(c) == 'r') {
+ goto __44
+ }
+ c = int8('\r')
+ goto __45
+__44:
+ if !(int32(c) == 't') {
+ goto __46
+ }
+ c = int8('\t')
+__46:
+ ;
+__45:
+ ;
+__43:
+ ;
+__41:
+ ;
+__39:
+ ;
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncUint32(&j, 1)))) = c
+__30:
+ ;
+__28:
+ ;
+ goto __25
+__25:
+ i1++
+ goto __24
+ goto __26
+__26:
+ ;
+ *(*int8)(unsafe.Pointer(zOut + uintptr(j))) = int8(0)
+ Xsqlite3_result_text(tls, pCtx, zOut, int32(j), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+__22:
+ ;
+ goto __1
+__8:
+__9:
+ jsonReturnJson(tls, pNode, pCtx, aReplace)
+ goto __1
+__1:
+}
+
+// A macro to hint to the compiler that a function should not be
+// inlined.
+
+func jsonParseAddNodeExpand(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:186153:26: */
+ var nNew U32
+ var pNew uintptr
+
+ if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
+ return -1
+ }
+ nNew = (((*JsonParse)(unsafe.Pointer(pParse)).FnAlloc * U32(2)) + U32(10))
+ pNew = Xsqlite3_realloc64(tls, (*JsonParse)(unsafe.Pointer(pParse)).FaNode, (uint64(uint64(unsafe.Sizeof(JsonNode{})) * uint64(nNew))))
+ if pNew == uintptr(0) {
+ (*JsonParse)(unsafe.Pointer(pParse)).Foom = U8(1)
+ return -1
+ }
+ (*JsonParse)(unsafe.Pointer(pParse)).FnAlloc = nNew
+ (*JsonParse)(unsafe.Pointer(pParse)).FaNode = pNew
+
+ return jsonParseAddNode(tls, pParse, eType, n, zContent)
+}
+
+// Create a new JsonNode instance based on the arguments and append that
+// instance to the JsonParse. Return the index in pParse->aNode[] of the
+// new node, or -1 if a memory allocation fails.
+func jsonParseAddNode(tls *libc.TLS, pParse uintptr, eType U32, n U32, zContent uintptr) int32 { /* sqlite3.c:186180:12: */
+ var p uintptr
+ if (*JsonParse)(unsafe.Pointer(pParse)).FnNode >= (*JsonParse)(unsafe.Pointer(pParse)).FnAlloc {
+ return jsonParseAddNodeExpand(tls, pParse, eType, n, zContent)
+ }
+ p = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr((*JsonParse)(unsafe.Pointer(pParse)).FnNode)*16)
+ (*JsonNode)(unsafe.Pointer(p)).FeType = U8(eType)
+ (*JsonNode)(unsafe.Pointer(p)).FjnFlags = U8(0)
+ (*JsonNode)(unsafe.Pointer(p)).Fn = n
+ *(*uintptr)(unsafe.Pointer(p + 8 /* &.u */)) = zContent
+ return int32(libc.PostIncUint32(&(*JsonParse)(unsafe.Pointer(pParse)).FnNode, 1))
+}
+
+// Return true if z[] begins with 4 (or more) hexadecimal digits
+func jsonIs4Hex(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:186201:12: */
+ var i int32
+ for i = 0; i < 4; i++ {
+ if !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))]) & 0x08) != 0) {
+ return 0
+ }
+ }
+ return 1
+}
+
+// Parse a single JSON value which begins at pParse->zJson[i]. Return the
+// index of the first character past the end of the value parsed.
+//
+// Return negative for a syntax error. Special cases: return -2 if the
+// first non-whitespace character is '}' and return -3 if the first
+// non-whitespace character is ']'.
+func jsonParseValue(tls *libc.TLS, pParse uintptr, i U32) int32 { /* sqlite3.c:186215:12: */
+ var c int8
+ var j U32
+ var iThis int32
+ var x int32
+ var pNode uintptr
+ var z uintptr = (*JsonParse)(unsafe.Pointer(pParse)).FzJson
+ for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))] != 0 {
+ i++
+ }
+ if (int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(z + uintptr(i)))))) == '{' {
+ // Parse object
+ iThis = jsonParseAddNode(tls, pParse, uint32(7), uint32(0), uintptr(0))
+ if iThis < 0 {
+ return -1
+ }
+ for j = (i + U32(1)); ; j++ {
+ for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
+ j++
+ }
+ if int32(libc.PreIncUint16(&(*JsonParse)(unsafe.Pointer(pParse)).FiDepth, 1)) > 2000 {
+ return -1
+ }
+ x = jsonParseValue(tls, pParse, j)
+ if x < 0 {
+ (*JsonParse)(unsafe.Pointer(pParse)).FiDepth--
+ if (x == (-2)) && ((*JsonParse)(unsafe.Pointer(pParse)).FnNode == (U32(iThis) + U32(1))) {
+ return (int32(j + U32(1)))
+ }
+ return -1
+ }
+ if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
+ return -1
+ }
+ pNode = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*16)
+ if int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) != 5 {
+ return -1
+ }
+ *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((0x40))
+ j = U32(x)
+ for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
+ j++
+ }
+ if int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) != ':' {
+ return -1
+ }
+ j++
+ x = jsonParseValue(tls, pParse, j)
+ (*JsonParse)(unsafe.Pointer(pParse)).FiDepth--
+ if x < 0 {
+ return -1
+ }
+ j = U32(x)
+ for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
+ j++
+ }
+ c = *(*int8)(unsafe.Pointer(z + uintptr(j)))
+ if int32(c) == ',' {
+ continue
+ }
+ if int32(c) != '}' {
+ return -1
+ }
+ break
+ }
+ (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iThis)*16)).Fn = (((*JsonParse)(unsafe.Pointer(pParse)).FnNode - U32(iThis)) - U32(1))
+ return (int32(j + U32(1)))
+ } else if int32(c) == '[' {
+ // Parse array
+ iThis = jsonParseAddNode(tls, pParse, uint32(6), uint32(0), uintptr(0))
+ if iThis < 0 {
+ return -1
+ }
+ for j = (i + U32(1)); ; j++ {
+ for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
+ j++
+ }
+ if int32(libc.PreIncUint16(&(*JsonParse)(unsafe.Pointer(pParse)).FiDepth, 1)) > 2000 {
+ return -1
+ }
+ x = jsonParseValue(tls, pParse, j)
+ (*JsonParse)(unsafe.Pointer(pParse)).FiDepth--
+ if x < 0 {
+ if (x == (-3)) && ((*JsonParse)(unsafe.Pointer(pParse)).FnNode == (U32(iThis) + U32(1))) {
+ return (int32(j + U32(1)))
+ }
+ return -1
+ }
+ j = U32(x)
+ for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j))))] != 0 {
+ j++
+ }
+ c = *(*int8)(unsafe.Pointer(z + uintptr(j)))
+ if int32(c) == ',' {
+ continue
+ }
+ if int32(c) != ']' {
+ return -1
+ }
+ break
+ }
+ (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iThis)*16)).Fn = (((*JsonParse)(unsafe.Pointer(pParse)).FnNode - U32(iThis)) - U32(1))
+ return (int32(j + U32(1)))
+ } else if int32(c) == '"' {
+ // Parse string
+ var jnFlags U8 = U8(0)
+ j = (i + U32(1))
+ for {
+ c = *(*int8)(unsafe.Pointer(z + uintptr(j)))
+ if (int32(c) & ^int32(libc.Int32FromInt32(0x1f))) == 0 {
+ // Control characters are not allowed in strings
+ return -1
+ }
+ if int32(c) == '\\' {
+ c = *(*int8)(unsafe.Pointer(z + uintptr(libc.PreIncUint32(&j, 1))))
+ if ((((((((int32(c) == '"') || (int32(c) == '\\')) || (int32(c) == '/')) || (int32(c) == 'b')) || (int32(c) == 'f')) ||
+ (int32(c) == 'n')) || (int32(c) == 'r')) || (int32(c) == 't')) ||
+ ((int32(c) == 'u') && (jsonIs4Hex(tls, ((z+uintptr(j))+uintptr(1))) != 0)) {
+ jnFlags = U8(0x02)
+ } else {
+ return -1
+ }
+ } else if int32(c) == '"' {
+ break
+ }
+ j++
+ }
+ jsonParseAddNode(tls, pParse, uint32(5), ((j + U32(1)) - i), (z + uintptr(i)))
+ if !(int32((*JsonParse)(unsafe.Pointer(pParse)).Foom) != 0) {
+ (*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*16)).FjnFlags = jnFlags
+ }
+ return (int32(j + U32(1)))
+ } else if ((int32(c) == 'n') &&
+ (libc.Xstrncmp(tls, (z+uintptr(i)), ts+7824 /* "null" */, uint64(4)) == 0)) &&
+ !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(4))))))]) & 0x06) != 0) {
+ jsonParseAddNode(tls, pParse, uint32(0), uint32(0), uintptr(0))
+ return (int32(i + U32(4)))
+ } else if ((int32(c) == 't') &&
+ (libc.Xstrncmp(tls, (z+uintptr(i)), ts+9525 /* "true" */, uint64(4)) == 0)) &&
+ !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(4))))))]) & 0x06) != 0) {
+ jsonParseAddNode(tls, pParse, uint32(1), uint32(0), uintptr(0))
+ return (int32(i + U32(4)))
+ } else if ((int32(c) == 'f') &&
+ (libc.Xstrncmp(tls, (z+uintptr(i)), ts+9530 /* "false" */, uint64(5)) == 0)) &&
+ !((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr((i + U32(5))))))]) & 0x06) != 0) {
+ jsonParseAddNode(tls, pParse, uint32(2), uint32(0), uintptr(0))
+ return (int32(i + U32(5)))
+ } else if (int32(c) == '-') || ((int32(c) >= '0') && (int32(c) <= '9')) {
+ // Parse number
+ var seenDP U8 = U8(0)
+ var seenE U8 = U8(0)
+
+ if int32(c) <= '0' {
+ if int32(c) == '-' {
+ j = (i + U32(1))
+ } else {
+ j = i
+ }
+ if ((int32(*(*int8)(unsafe.Pointer(z + uintptr(j)))) == '0') && (int32(*(*int8)(unsafe.Pointer(z + uintptr((j + U32(1)))))) >= '0')) && (int32(*(*int8)(unsafe.Pointer(z + uintptr((j + U32(1)))))) <= '9') {
+ return -1
+ }
+ }
+ j = (i + U32(1))
+ for ; ; j++ {
+ c = *(*int8)(unsafe.Pointer(z + uintptr(j)))
+ if (int32(c) >= '0') && (int32(c) <= '9') {
+ continue
+ }
+ if int32(c) == '.' {
+ if int32(*(*int8)(unsafe.Pointer(z + uintptr((j - U32(1)))))) == '-' {
+ return -1
+ }
+ if seenDP != 0 {
+ return -1
+ }
+ seenDP = U8(1)
+ continue
+ }
+ if (int32(c) == 'e') || (int32(c) == 'E') {
+ if int32(*(*int8)(unsafe.Pointer(z + uintptr((j - U32(1)))))) < '0' {
+ return -1
+ }
+ if seenE != 0 {
+ return -1
+ }
+ seenDP = libc.AssignUint8(&seenE, U8(1))
+ c = *(*int8)(unsafe.Pointer(z + uintptr((j + U32(1)))))
+ if (int32(c) == '+') || (int32(c) == '-') {
+ j++
+ c = *(*int8)(unsafe.Pointer(z + uintptr((j + U32(1)))))
+ }
+ if (int32(c) < '0') || (int32(c) > '9') {
+ return -1
+ }
+ continue
+ }
+ break
+ }
+ if int32(*(*int8)(unsafe.Pointer(z + uintptr((j - U32(1)))))) < '0' {
+ return -1
+ }
+ jsonParseAddNode(tls, pParse, func() uint32 {
+ if seenDP != 0 {
+ return uint32(4)
+ }
+ return uint32(3)
+ }(),
+ (j - i), (z + uintptr(i)))
+ return int32(j)
+ } else if int32(c) == '}' {
+ return -2
+ } else if int32(c) == ']' {
+ return -3
+ } else if int32(c) == 0 {
+ return 0
+ } else {
+ return -1
+ }
+ return int32(0)
+}
+
+// Parse a complete JSON string. Return 0 on success or non-zero if there
+// are any errors. If an error occurs, free all memory associated with
+// pParse.
+//
+// pParse is uninitialized when this routine is called.
+func jsonParse(tls *libc.TLS, pParse uintptr, pCtx uintptr, zJson uintptr) int32 { /* sqlite3.c:186375:12: */
+ var i int32
+ libc.Xmemset(tls, pParse, 0, uint64(unsafe.Sizeof(JsonParse{})))
+ if zJson == uintptr(0) {
+ return 1
+ }
+ (*JsonParse)(unsafe.Pointer(pParse)).FzJson = zJson
+ i = jsonParseValue(tls, pParse, uint32(0))
+ if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
+ i = -1
+ }
+ if i > 0 {
+
+ for jsonIsSpace[uint8(*(*int8)(unsafe.Pointer(zJson + uintptr(i))))] != 0 {
+ i++
+ }
+ if *(*int8)(unsafe.Pointer(zJson + uintptr(i))) != 0 {
+ i = -1
+ }
+ }
+ if i <= 0 {
+ if pCtx != uintptr(0) {
+ if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
+ Xsqlite3_result_error_nomem(tls, pCtx)
+ } else {
+ Xsqlite3_result_error(tls, pCtx, ts+27845 /* "malformed JSON" */, -1)
+ }
+ }
+ jsonParseReset(tls, pParse)
+ return 1
+ }
+ return 0
+}
+
+// Mark node i of pParse as being a child of iParent. Call recursively
+// to fill in all the descendants of node i.
+func jsonParseFillInParentage(tls *libc.TLS, pParse uintptr, i U32, iParent U32) { /* sqlite3.c:186408:13: */
+ var pNode uintptr = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(i)*16)
+ var j U32
+ *(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaUp + uintptr(i)*4)) = iParent
+ switch int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) {
+ case 6:
+ {
+ for j = U32(1); j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn; j = j + (jsonNodeSize(tls, (pNode + uintptr(j)*16))) {
+ jsonParseFillInParentage(tls, pParse, (i + j), i)
+ }
+ break
+ }
+ case 7:
+ {
+ for j = U32(1); j <= (*JsonNode)(unsafe.Pointer(pNode)).Fn; j = j + (jsonNodeSize(tls, ((pNode+uintptr(j)*16)+uintptr(1)*16)) + U32(1)) {
+ *(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaUp + uintptr((i+j))*4)) = i
+ jsonParseFillInParentage(tls, pParse, ((i + j) + U32(1)), i)
+ }
+ break
+ }
+ default:
+ {
+ break
+ }
+ }
+}
+
+// Compute the parentage of all nodes in a completed parse.
+func jsonParseFindParents(tls *libc.TLS, pParse uintptr) int32 { /* sqlite3.c:186435:12: */
+ var aUp uintptr
+
+ aUp = libc.AssignPtrUintptr(pParse+24 /* &.aUp */, Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(U32(0)))*uint64((*JsonParse)(unsafe.Pointer(pParse)).FnNode)))))
+ if aUp == uintptr(0) {
+ (*JsonParse)(unsafe.Pointer(pParse)).Foom = U8(1)
+ return 7
+ }
+ jsonParseFillInParentage(tls, pParse, uint32(0), uint32(0))
+ return 0
+}
+
+// Magic number used for the JSON parse cache in sqlite3_get_auxdata()
+
+// Obtain a complete parse of the JSON found in the first argument
+// of the argv array. Use the sqlite3_get_auxdata() cache for this
+// parse if it is available. If the cache is not available or if it
+// is no longer valid, parse the JSON again and return the new parse,
+// and also register the new parse so that it will be available for
+// future sqlite3_get_auxdata() calls.
+func jsonParseCached(tls *libc.TLS, pCtx uintptr, argv uintptr, pErrCtx uintptr) uintptr { /* sqlite3.c:186461:18: */
+ var zJson uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ var nJson int32 = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ var p uintptr
+ var pMatch uintptr = uintptr(0)
+ var iKey int32
+ var iMinKey int32 = 0
+ var iMinHold U32 = 0xffffffff
+ var iMaxHold U32 = U32(0)
+ if zJson == uintptr(0) {
+ return uintptr(0)
+ }
+ for iKey = 0; iKey < 4; iKey++ {
+ p = Xsqlite3_get_auxdata(tls, pCtx, ((-429938) + iKey))
+ if p == uintptr(0) {
+ iMinKey = iKey
+ break
+ }
+ if ((pMatch == uintptr(0)) &&
+ ((*JsonParse)(unsafe.Pointer(p)).FnJson == nJson)) &&
+ (libc.Xmemcmp(tls, (*JsonParse)(unsafe.Pointer(p)).FzJson, zJson, uint64(nJson)) == 0) {
+ (*JsonParse)(unsafe.Pointer(p)).FnErr = U8(0)
+ pMatch = p
+ } else if (*JsonParse)(unsafe.Pointer(p)).FiHold < iMinHold {
+ iMinHold = (*JsonParse)(unsafe.Pointer(p)).FiHold
+ iMinKey = iKey
+ }
+ if (*JsonParse)(unsafe.Pointer(p)).FiHold > iMaxHold {
+ iMaxHold = (*JsonParse)(unsafe.Pointer(p)).FiHold
+ }
+ }
+ if pMatch != 0 {
+ (*JsonParse)(unsafe.Pointer(pMatch)).FnErr = U8(0)
+ (*JsonParse)(unsafe.Pointer(pMatch)).FiHold = (iMaxHold + U32(1))
+ return pMatch
+ }
+ p = Xsqlite3_malloc64(tls, (uint64((uint64(unsafe.Sizeof(JsonParse{})) + uint64(nJson)) + uint64(1))))
+ if p == uintptr(0) {
+ Xsqlite3_result_error_nomem(tls, pCtx)
+ return uintptr(0)
+ }
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(JsonParse{})))
+ (*JsonParse)(unsafe.Pointer(p)).FzJson = (p + uintptr(1)*48)
+ libc.Xmemcpy(tls, (*JsonParse)(unsafe.Pointer(p)).FzJson, zJson, (uint64(nJson + 1)))
+ if jsonParse(tls, p, pErrCtx, (*JsonParse)(unsafe.Pointer(p)).FzJson) != 0 {
+ Xsqlite3_free(tls, p)
+ return uintptr(0)
+ }
+ (*JsonParse)(unsafe.Pointer(p)).FnJson = nJson
+ (*JsonParse)(unsafe.Pointer(p)).FiHold = (iMaxHold + U32(1))
+ Xsqlite3_set_auxdata(tls, pCtx, ((-429938) + iMinKey), p,
+ *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{jsonParseFree})))
+ return Xsqlite3_get_auxdata(tls, pCtx, ((-429938) + iMinKey))
+}
+
+// Compare the OBJECT label at pNode against zKey,nKey. Return true on
+// a match.
+func jsonLabelCompare(tls *libc.TLS, pNode uintptr, zKey uintptr, nKey U32) int32 { /* sqlite3.c:186523:12: */
+ if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & 0x01) != 0 {
+ if (*JsonNode)(unsafe.Pointer(pNode)).Fn != nKey {
+ return 0
+ }
+ return (libc.Bool32(libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */)), zKey, uint64(nKey)) == 0))
+ } else {
+ if (*JsonNode)(unsafe.Pointer(pNode)).Fn != (nKey + U32(2)) {
+ return 0
+ }
+ return (libc.Bool32(libc.Xstrncmp(tls, (*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))+uintptr(1)), zKey, uint64(nKey)) == 0))
+ }
+ return int32(0)
+}
+
+// Search along zPath to find the node specified. Return a pointer
+// to that node, or NULL if zPath is malformed or if there is no such
+// node.
+//
+// If pApnd!=0, then try to append new nodes to complete zPath if it is
+// possible to do so and if no existing node corresponds to zPath. If
+// new nodes are appended *pApnd is set to 1.
+func jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot U32, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:186545:17: */
+ var i U32
+ var j U32
+ var nKey U32
+ var zKey uintptr
+ var pRoot uintptr = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16)
+ if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(0)))) == 0 {
+ return pRoot
+ }
+ if (int32((*JsonNode)(unsafe.Pointer(pRoot)).FjnFlags) & 0x08) != 0 {
+ return uintptr(0)
+ }
+ if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(0)))) == '.' {
+ if int32((*JsonNode)(unsafe.Pointer(pRoot)).FeType) != 7 {
+ return uintptr(0)
+ }
+ zPath++
+ if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(0)))) == '"' {
+ zKey = (zPath + uintptr(1))
+ for i = U32(1); (*(*int8)(unsafe.Pointer(zPath + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(zPath + uintptr(i)))) != '"'); i++ {
+ }
+ nKey = (i - U32(1))
+ if *(*int8)(unsafe.Pointer(zPath + uintptr(i))) != 0 {
+ i++
+ } else {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = zPath
+ return uintptr(0)
+ }
+ } else {
+ zKey = zPath
+ for i = U32(0); ((*(*int8)(unsafe.Pointer(zPath + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(zPath + uintptr(i)))) != '.')) && (int32(*(*int8)(unsafe.Pointer(zPath + uintptr(i)))) != '['); i++ {
+ }
+ nKey = i
+ }
+ if nKey == U32(0) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = zPath
+ return uintptr(0)
+ }
+ j = U32(1)
+ for {
+ for j <= (*JsonNode)(unsafe.Pointer(pRoot)).Fn {
+ if jsonLabelCompare(tls, (pRoot+uintptr(j)*16), zKey, nKey) != 0 {
+ return jsonLookupStep(tls, pParse, ((iRoot + j) + U32(1)), (zPath + uintptr(i)), pApnd, pzErr)
+ }
+ j++
+ j = j + (jsonNodeSize(tls, (pRoot + uintptr(j)*16)))
+ }
+ if (int32((*JsonNode)(unsafe.Pointer(pRoot)).FjnFlags) & 0x20) == 0 {
+ break
+ }
+ iRoot = iRoot + (*(*U32)(unsafe.Pointer(pRoot + 8 /* &.u */)))
+ pRoot = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16)
+ j = U32(1)
+ }
+ if pApnd != 0 {
+ var iStart U32
+ var iLabel U32
+ var pNode uintptr
+ iStart = U32(jsonParseAddNode(tls, pParse, uint32(7), uint32(2), uintptr(0)))
+ iLabel = U32(jsonParseAddNode(tls, pParse, uint32(5), nKey, zKey))
+ zPath += uintptr(i)
+ pNode = jsonLookupAppend(tls, pParse, zPath, pApnd, pzErr)
+ if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
+ return uintptr(0)
+ }
+ if pNode != 0 {
+ pRoot = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16)
+ *(*U32)(unsafe.Pointer(pRoot + 8 /* &.u */)) = (iStart - iRoot)
+ *(*U8)(unsafe.Pointer(pRoot + 1 /* &.jnFlags */)) |= U8((0x20))
+ *(*U8)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iLabel)*16 + 1 /* &.jnFlags */)) |= U8((0x01))
+ }
+ return pNode
+ }
+ } else if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(0)))) == '[' {
+ i = U32(0)
+ j = U32(1)
+ for (int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zPath + uintptr(j))))]) & 0x04) != 0 {
+ i = (((i * U32(10)) + U32(*(*int8)(unsafe.Pointer(zPath + uintptr(j))))) - U32('0'))
+ j++
+ }
+ if (j < U32(2)) || (int32(*(*int8)(unsafe.Pointer(zPath + uintptr(j)))) != ']') {
+ if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(1)))) == '#' {
+ var pBase uintptr = pRoot
+ var iBase int32 = int32(iRoot)
+ if int32((*JsonNode)(unsafe.Pointer(pRoot)).FeType) != 6 {
+ return uintptr(0)
+ }
+ for {
+ for j <= (*JsonNode)(unsafe.Pointer(pBase)).Fn {
+ if (int32((*JsonNode)(unsafe.Pointer(pBase+uintptr(j)*16)).FjnFlags) & 0x04) == 0 {
+ i++
+ }
+ j = j + (jsonNodeSize(tls, (pBase + uintptr(j)*16)))
+ }
+ if (int32((*JsonNode)(unsafe.Pointer(pBase)).FjnFlags) & 0x20) == 0 {
+ break
+ }
+ iBase = int32(U32(iBase) + (*(*U32)(unsafe.Pointer(pBase + 8 /* &.u */))))
+ pBase = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iBase)*16)
+ j = U32(1)
+ }
+ j = U32(2)
+ if (int32(*(*int8)(unsafe.Pointer(zPath + uintptr(2)))) == '-') && ((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zPath + uintptr(3))))]) & 0x04) != 0) {
+ var x uint32 = uint32(0)
+ j = U32(3)
+ for ok := true; ok; ok = ((int32(Xsqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zPath + uintptr(j))))]) & 0x04) != 0) {
+ x = (((x * uint32(10)) + uint32(*(*int8)(unsafe.Pointer(zPath + uintptr(j))))) - uint32('0'))
+ j++
+ }
+ if x > i {
+ return uintptr(0)
+ }
+ i = i - (x)
+ }
+ if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(j)))) != ']' {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = zPath
+ return uintptr(0)
+ }
+ } else {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = zPath
+ return uintptr(0)
+ }
+ }
+ if int32((*JsonNode)(unsafe.Pointer(pRoot)).FeType) != 6 {
+ return uintptr(0)
+ }
+ zPath += (uintptr(j + U32(1)))
+ j = U32(1)
+ for {
+ for (j <= (*JsonNode)(unsafe.Pointer(pRoot)).Fn) && ((i > U32(0)) || ((int32((*JsonNode)(unsafe.Pointer(pRoot+uintptr(j)*16)).FjnFlags) & 0x04) != 0)) {
+ if (int32((*JsonNode)(unsafe.Pointer(pRoot+uintptr(j)*16)).FjnFlags) & 0x04) == 0 {
+ i--
+ }
+ j = j + (jsonNodeSize(tls, (pRoot + uintptr(j)*16)))
+ }
+ if (int32((*JsonNode)(unsafe.Pointer(pRoot)).FjnFlags) & 0x20) == 0 {
+ break
+ }
+ iRoot = iRoot + (*(*U32)(unsafe.Pointer(pRoot + 8 /* &.u */)))
+ pRoot = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16)
+ j = U32(1)
+ }
+ if j <= (*JsonNode)(unsafe.Pointer(pRoot)).Fn {
+ return jsonLookupStep(tls, pParse, (iRoot + j), zPath, pApnd, pzErr)
+ }
+ if (i == U32(0)) && (pApnd != 0) {
+ var iStart U32
+ var pNode uintptr
+ iStart = U32(jsonParseAddNode(tls, pParse, uint32(6), uint32(1), uintptr(0)))
+ pNode = jsonLookupAppend(tls, pParse, zPath, pApnd, pzErr)
+ if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
+ return uintptr(0)
+ }
+ if pNode != 0 {
+ pRoot = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16)
+ *(*U32)(unsafe.Pointer(pRoot + 8 /* &.u */)) = (iStart - iRoot)
+ *(*U8)(unsafe.Pointer(pRoot + 1 /* &.jnFlags */)) |= U8((0x20))
+ }
+ return pNode
+ }
+ } else {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = zPath
+ }
+ return uintptr(0)
+}
+
+// Append content to pParse that will complete zPath. Return a pointer
+// to the inserted node, or return NULL if the append fails.
+func jsonLookupAppend(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pzErr uintptr) uintptr { /* sqlite3.c:186690:17: */
+ *(*int32)(unsafe.Pointer(pApnd)) = 1
+ if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(0)))) == 0 {
+ jsonParseAddNode(tls, pParse, uint32(0), uint32(0), uintptr(0))
+ if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
+ return uintptr(0)
+ }
+ return ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(((*JsonParse)(unsafe.Pointer(pParse)).FnNode-U32(1)))*16)
+ }
+ if int32(*(*int8)(unsafe.Pointer(zPath + uintptr(0)))) == '.' {
+ jsonParseAddNode(tls, pParse, uint32(7), uint32(0), uintptr(0))
+ } else if libc.Xstrncmp(tls, zPath, ts+27860 /* "[0]" */, uint64(3)) == 0 {
+ jsonParseAddNode(tls, pParse, uint32(6), uint32(0), uintptr(0))
+ } else {
+ return uintptr(0)
+ }
+ if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
+ return uintptr(0)
+ }
+ return jsonLookupStep(tls, pParse, ((*JsonParse)(unsafe.Pointer(pParse)).FnNode - U32(1)), zPath, pApnd, pzErr)
+}
+
+// Return the text of a syntax error message on a JSON path. Space is
+// obtained from sqlite3_malloc().
+func jsonPathSyntaxError(tls *libc.TLS, zErr uintptr) uintptr { /* sqlite3.c:186716:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ return Xsqlite3_mprintf(tls, ts+27864 /* "JSON path error ..." */, libc.VaList(bp, zErr))
+}
+
+// Do a node lookup using zPath. Return a pointer to the node on success.
+// Return NULL if not found or if there is an error.
+//
+// On an error, write an error message into pCtx and increment the
+// pParse->nErr counter.
+//
+// If pApnd!=NULL then try to append missing nodes and set *pApnd = 1 if
+// nodes are appended.
+func jsonLookup(tls *libc.TLS, pParse uintptr, zPath uintptr, pApnd uintptr, pCtx uintptr) uintptr { /* sqlite3.c:186730:17: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ // var zErr uintptr at bp, 8
+
+ var pNode uintptr
+ var zMsg uintptr
+ *(*uintptr)(unsafe.Pointer(bp /* zErr */)) = uintptr(0)
+ pNode = uintptr(0)
+
+ if !(zPath == uintptr(0)) {
+ goto __1
+ }
+ return uintptr(0)
+__1:
+ ;
+ if !(int32(*(*int8)(unsafe.Pointer(zPath + uintptr(0)))) != '$') {
+ goto __2
+ }
+ *(*uintptr)(unsafe.Pointer(bp /* zErr */)) = zPath
+ goto lookup_err
+__2:
+ ;
+ zPath++
+ pNode = jsonLookupStep(tls, pParse, uint32(0), zPath, pApnd, bp /* &zErr */)
+ if !(*(*uintptr)(unsafe.Pointer(bp /* zErr */)) == uintptr(0)) {
+ goto __3
+ }
+ return pNode
+__3:
+ ;
+
+lookup_err:
+ (*JsonParse)(unsafe.Pointer(pParse)).FnErr++
+
+ zMsg = jsonPathSyntaxError(tls, *(*uintptr)(unsafe.Pointer(bp /* zErr */)))
+ if !(zMsg != 0) {
+ goto __4
+ }
+ Xsqlite3_result_error(tls, pCtx, zMsg, -1)
+ Xsqlite3_free(tls, zMsg)
+ goto __5
+__4:
+ Xsqlite3_result_error_nomem(tls, pCtx)
+__5:
+ ;
+ return uintptr(0)
+}
+
+// Report the wrong number of arguments for json_insert(), json_replace()
+// or json_set().
+func jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { /* sqlite3.c:186767:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var zMsg uintptr = Xsqlite3_mprintf(tls, ts+27890, /* "json_%s() needs ..." */
+ libc.VaList(bp, zFuncName))
+ Xsqlite3_result_error(tls, pCtx, zMsg, -1)
+ Xsqlite3_free(tls, zMsg)
+}
+
+// Mark all NULL entries in the Object passed in as JNODE_REMOVE.
+func jsonRemoveAllNulls(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:186780:13: */
+ var i int32
+ var n int32
+
+ n = int32((*JsonNode)(unsafe.Pointer(pNode)).Fn)
+ for i = 2; i <= n; i = int32(U32(i) + (jsonNodeSize(tls, (pNode+uintptr(i)*16)) + U32(1))) {
+ switch int32((*JsonNode)(unsafe.Pointer(pNode + uintptr(i)*16)).FeType) {
+ case 0:
+ *(*U8)(unsafe.Pointer(pNode + uintptr(i)*16 + 1 /* &.jnFlags */)) |= U8((0x04))
+ break
+ case 7:
+ jsonRemoveAllNulls(tls, (pNode + uintptr(i)*16))
+ break
+ }
+ }
+}
+
+// ***************************************************************************
+//
+// SQL functions used for testing and debugging
+//
+
+// ***************************************************************************
+//
+// Scalar SQL function implementations
+//
+
+// Implementation of the json_QUOTE(VALUE) function. Return a JSON value
+// corresponding to the SQL value input. Mostly this means putting
+// double-quotes around strings and returning the unquoted string "null"
+// when given a NULL input.
+func jsonQuoteFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:186865:13: */
+ bp := tls.Alloc(136)
+ defer tls.Free(136)
+
+ // var jx JsonString at bp, 136
+
+ _ = argc
+
+ jsonInit(tls, bp /* &jx */, ctx)
+ jsonAppendValue(tls, bp /* &jx */, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ jsonResult(tls, bp /* &jx */)
+ Xsqlite3_result_subtype(tls, ctx, uint32(74))
+}
+
+// Implementation of the json_array(VALUE,...) function. Return a JSON
+// array that contains all values given in arguments. Or if any argument
+// is a BLOB, throw an error.
+func jsonArrayFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:186884:13: */
+ bp := tls.Alloc(136)
+ defer tls.Free(136)
+
+ var i int32
+ // var jx JsonString at bp, 136
+
+ jsonInit(tls, bp /* &jx */, ctx)
+ jsonAppendChar(tls, bp /* &jx */, int8('['))
+ for i = 0; i < argc; i++ {
+ jsonAppendSeparator(tls, bp /* &jx */)
+ jsonAppendValue(tls, bp /* &jx */, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ }
+ jsonAppendChar(tls, bp /* &jx */, int8(']'))
+ jsonResult(tls, bp /* &jx */)
+ Xsqlite3_result_subtype(tls, ctx, uint32(74))
+}
+
+// json_array_length(JSON)
+// json_array_length(JSON, PATH)
+//
+// Return the number of elements in the top-level JSON array.
+// Return 0 if the input is not a well-formed JSON array.
+func jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:186911:13: */
+ var p uintptr // The parse
+ var n Sqlite3_int64 = int64(0)
+ var i U32
+ var pNode uintptr
+
+ p = jsonParseCached(tls, ctx, argv, ctx)
+ if p == uintptr(0) {
+ return
+ }
+
+ if argc == 2 {
+ var zPath uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
+ pNode = jsonLookup(tls, p, zPath, uintptr(0), ctx)
+ } else {
+ pNode = (*JsonParse)(unsafe.Pointer(p)).FaNode
+ }
+ if pNode == uintptr(0) {
+ return
+ }
+ if int32((*JsonNode)(unsafe.Pointer(pNode)).FeType) == 6 {
+
+ for i = U32(1); i <= (*JsonNode)(unsafe.Pointer(pNode)).Fn; n++ {
+ i = i + (jsonNodeSize(tls, (pNode + uintptr(i)*16)))
+ }
+ }
+ Xsqlite3_result_int64(tls, ctx, n)
+}
+
+// json_extract(JSON, PATH, ...)
+//
+// Return the element described by PATH. Return NULL if there is no
+// PATH element. If there are multiple PATHs, then return a JSON array
+// with the result from each path. Throw an error if the JSON or any PATH
+// is malformed.
+func jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:186950:13: */
+ bp := tls.Alloc(136)
+ defer tls.Free(136)
+
+ var p uintptr // The parse
+ var pNode uintptr
+ var zPath uintptr
+ // var jx JsonString at bp, 136
+
+ var i int32
+
+ if argc < 2 {
+ return
+ }
+ p = jsonParseCached(tls, ctx, argv, ctx)
+ if p == uintptr(0) {
+ return
+ }
+ jsonInit(tls, bp /* &jx */, ctx)
+ jsonAppendChar(tls, bp /* &jx */, int8('['))
+ for i = 1; i < argc; i++ {
+ zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ pNode = jsonLookup(tls, p, zPath, uintptr(0), ctx)
+ if (*JsonParse)(unsafe.Pointer(p)).FnErr != 0 {
+ break
+ }
+ if argc > 2 {
+ jsonAppendSeparator(tls, bp /* &jx */)
+ if pNode != 0 {
+ jsonRenderNode(tls, pNode, bp /* &jx */, uintptr(0))
+ } else {
+ jsonAppendRaw(tls, bp /* &jx */, ts+7824 /* "null" */, uint32(4))
+ }
+ } else if pNode != 0 {
+ jsonReturn(tls, pNode, ctx, uintptr(0))
+ }
+ }
+ if (argc > 2) && (i == argc) {
+ jsonAppendChar(tls, bp /* &jx */, int8(']'))
+ jsonResult(tls, bp /* &jx */)
+ Xsqlite3_result_subtype(tls, ctx, uint32(74))
+ }
+ jsonReset(tls, bp /* &jx */)
+}
+
+// This is the RFC 7396 MergePatch algorithm.
+func jsonMergePatch(tls *libc.TLS, pParse uintptr, iTarget U32, pPatch uintptr) uintptr { /* sqlite3.c:186991:17: */
+ var i U32
+ var j U32
+ var iRoot U32
+ var pTarget uintptr
+ if int32((*JsonNode)(unsafe.Pointer(pPatch)).FeType) != 7 {
+ return pPatch
+ }
+
+ pTarget = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iTarget)*16)
+
+ if int32((*JsonNode)(unsafe.Pointer(pTarget)).FeType) != 7 {
+ jsonRemoveAllNulls(tls, pPatch)
+ return pPatch
+ }
+ iRoot = iTarget
+ for i = U32(1); i < (*JsonNode)(unsafe.Pointer(pPatch)).Fn; i = i + (jsonNodeSize(tls, (pPatch+uintptr((i+U32(1)))*16)) + U32(1)) {
+ var nKey U32
+ var zKey uintptr
+
+ nKey = (*JsonNode)(unsafe.Pointer(pPatch + uintptr(i)*16)).Fn
+ zKey = *(*uintptr)(unsafe.Pointer(pPatch + uintptr(i)*16 + 8 /* &.u */))
+
+ for j = U32(1); j < (*JsonNode)(unsafe.Pointer(pTarget)).Fn; j = j + (jsonNodeSize(tls, (pTarget+uintptr((j+U32(1)))*16)) + U32(1)) {
+
+ if ((*JsonNode)(unsafe.Pointer(pTarget+uintptr(j)*16)).Fn == nKey) && (libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(pTarget + uintptr(j)*16 + 8 /* &.u */)), zKey, uint64(nKey)) == 0) {
+ if (int32((*JsonNode)(unsafe.Pointer(pTarget+uintptr((j+U32(1)))*16)).FjnFlags) & (0x04 | 0x10)) != 0 {
+ break
+ }
+ if int32((*JsonNode)(unsafe.Pointer(pPatch+uintptr((i+U32(1)))*16)).FeType) == 0 {
+ *(*U8)(unsafe.Pointer(pTarget + uintptr((j+U32(1)))*16 + 1 /* &.jnFlags */)) |= U8((0x04))
+ } else {
+ var pNew uintptr = jsonMergePatch(tls, pParse, ((iTarget + j) + U32(1)), (pPatch + uintptr((i+U32(1)))*16))
+ if pNew == uintptr(0) {
+ return uintptr(0)
+ }
+ pTarget = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iTarget)*16)
+ if pNew != (pTarget + uintptr((j+U32(1)))*16) {
+ *(*uintptr)(unsafe.Pointer(pTarget + uintptr((j+U32(1)))*16 + 8 /* &.u */)) = pNew
+ *(*U8)(unsafe.Pointer(pTarget + uintptr((j+U32(1)))*16 + 1 /* &.jnFlags */)) |= U8((0x10))
+ }
+ }
+ break
+ }
+ }
+ if (j >= (*JsonNode)(unsafe.Pointer(pTarget)).Fn) && (int32((*JsonNode)(unsafe.Pointer(pPatch+uintptr((i+U32(1)))*16)).FeType) != 0) {
+ var iStart int32
+ var iPatch int32
+ iStart = jsonParseAddNode(tls, pParse, uint32(7), uint32(2), uintptr(0))
+ jsonParseAddNode(tls, pParse, uint32(5), nKey, zKey)
+ iPatch = jsonParseAddNode(tls, pParse, uint32(1), uint32(0), uintptr(0))
+ if (*JsonParse)(unsafe.Pointer(pParse)).Foom != 0 {
+ return uintptr(0)
+ }
+ jsonRemoveAllNulls(tls, pPatch)
+ pTarget = ((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iTarget)*16)
+ *(*U8)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16 + 1 /* &.jnFlags */)) |= U8((0x20))
+ *(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iRoot)*16 + 8 /* &.u */)) = (U32(iStart) - iRoot)
+ iRoot = U32(iStart)
+ *(*U8)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iPatch)*16 + 1 /* &.jnFlags */)) |= U8((0x10))
+ *(*uintptr)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(pParse)).FaNode + uintptr(iPatch)*16 + 8 /* &.u */)) = (pPatch + uintptr((i+U32(1)))*16)
+ }
+ }
+ return pTarget
+}
+
+// Implementation of the json_mergepatch(JSON1,JSON2) function. Return a JSON
+// object that is the result of running the RFC 7396 MergePatch() algorithm
+// on the two arguments.
+func jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187061:13: */
+ bp := tls.Alloc(96)
+ defer tls.Free(96)
+
+ // var x JsonParse at bp, 48
+ // The JSON that is being patched
+ // var y JsonParse at bp+48, 48
+ // The patch
+ var pResult uintptr // The result of the merge
+
+ _ = argc
+ if jsonParse(tls, bp /* &x */, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))) != 0 {
+ return
+ }
+ if jsonParse(tls, bp+48 /* &y */, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))) != 0 {
+ jsonParseReset(tls, bp /* &x */)
+ return
+ }
+ pResult = jsonMergePatch(tls, bp /* &x */, uint32(0), (*JsonParse)(unsafe.Pointer(bp+48 /* &y */)).FaNode)
+
+ if pResult != 0 {
+ jsonReturnJson(tls, pResult, ctx, uintptr(0))
+ } else {
+ Xsqlite3_result_error_nomem(tls, ctx)
+ }
+ jsonParseReset(tls, bp /* &x */)
+ jsonParseReset(tls, bp+48 /* &y */)
+}
+
+// Implementation of the json_object(NAME,VALUE,...) function. Return a JSON
+// object that contains all name/value given in arguments. Or if any name
+// is not a string or if any value is a BLOB, throw an error.
+func jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187093:13: */
+ bp := tls.Alloc(136)
+ defer tls.Free(136)
+
+ var i int32
+ // var jx JsonString at bp, 136
+
+ var z uintptr
+ var n U32
+
+ if (argc & 1) != 0 {
+ Xsqlite3_result_error(tls, ctx,
+ ts+27933 /* "json_object() re..." */, -1)
+ return
+ }
+ jsonInit(tls, bp /* &jx */, ctx)
+ jsonAppendChar(tls, bp /* &jx */, int8('{'))
+ for i = 0; i < argc; i = i + (2) {
+ if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != 3 {
+ Xsqlite3_result_error(tls, ctx, ts+27984 /* "json_object() la..." */, -1)
+ jsonReset(tls, bp /* &jx */)
+ return
+ }
+ jsonAppendSeparator(tls, bp /* &jx */)
+ z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ n = U32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ jsonAppendString(tls, bp /* &jx */, z, n)
+ jsonAppendChar(tls, bp /* &jx */, int8(':'))
+ jsonAppendValue(tls, bp /* &jx */, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8)))
+ }
+ jsonAppendChar(tls, bp /* &jx */, int8('}'))
+ jsonResult(tls, bp /* &jx */)
+ Xsqlite3_result_subtype(tls, ctx, uint32(74))
+}
+
+// json_remove(JSON, PATH, ...)
+//
+// Remove the named elements from JSON and return the result. malformed
+// JSON or PATH arguments result in an error.
+func jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187135:13: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ // var x JsonParse at bp, 48
+ // The parse
+ var pNode uintptr
+ var zPath uintptr
+ var i U32
+
+ if !(argc < 1) {
+ goto __1
+ }
+ return
+__1:
+ ;
+ if !(jsonParse(tls, bp /* &x */, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))) != 0) {
+ goto __2
+ }
+ return
+__2:
+ ;
+
+ i = U32(1)
+__3:
+ if !(i < U32(argc)) {
+ goto __5
+ }
+ zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ if !(zPath == uintptr(0)) {
+ goto __6
+ }
+ goto remove_done
+__6:
+ ;
+ pNode = jsonLookup(tls, bp /* &x */, zPath, uintptr(0), ctx)
+ if !((*JsonParse)(unsafe.Pointer(bp /* &x */)).FnErr != 0) {
+ goto __7
+ }
+ goto remove_done
+__7:
+ ;
+ if !(pNode != 0) {
+ goto __8
+ }
+ *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((0x04))
+__8:
+ ;
+ goto __4
+__4:
+ i++
+ goto __3
+ goto __5
+__5:
+ ;
+ if !((int32((*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode+uintptr(0)*16)).FjnFlags) & 0x04) == 0) {
+ goto __9
+ }
+ jsonReturnJson(tls, (*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode, ctx, uintptr(0))
+__9:
+ ;
+remove_done:
+ jsonParseReset(tls, bp /* &x */)
+}
+
+// json_replace(JSON, PATH, VALUE, ...)
+//
+// Replace the value at PATH with VALUE. If PATH does not already exist,
+// this routine is a no-op. If JSON or PATH is malformed, throw an error.
+func jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187168:13: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ // var x JsonParse at bp, 48
+ // The parse
+ var pNode uintptr
+ var zPath uintptr
+ var i U32
+
+ if !(argc < 1) {
+ goto __1
+ }
+ return
+__1:
+ ;
+ if !((argc & 1) == 0) {
+ goto __2
+ }
+ jsonWrongNumArgs(tls, ctx, ts+16380 /* "replace" */)
+ return
+__2:
+ ;
+ if !(jsonParse(tls, bp /* &x */, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))) != 0) {
+ goto __3
+ }
+ return
+__3:
+ ;
+
+ i = U32(1)
+__4:
+ if !(i < U32(argc)) {
+ goto __6
+ }
+ zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ pNode = jsonLookup(tls, bp /* &x */, zPath, uintptr(0), ctx)
+ if !((*JsonParse)(unsafe.Pointer(bp /* &x */)).FnErr != 0) {
+ goto __7
+ }
+ goto replace_err
+__7:
+ ;
+ if !(pNode != 0) {
+ goto __8
+ }
+ *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(U8(0x08))))
+ *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = (i + U32(1))
+__8:
+ ;
+ goto __5
+__5:
+ i = i + (U32(2))
+ goto __4
+ goto __6
+__6:
+ ;
+ if !((int32((*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode+uintptr(0)*16)).FjnFlags) & 0x08) != 0) {
+ goto __9
+ }
+ Xsqlite3_result_value(tls, ctx, *(*uintptr)(unsafe.Pointer(argv + uintptr(*(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode + uintptr(0)*16 + 8 /* &.u */)))*8)))
+ goto __10
+__9:
+ jsonReturnJson(tls, (*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode, ctx, argv)
+__10:
+ ;
+replace_err:
+ jsonParseReset(tls, bp /* &x */)
+}
+
+// json_set(JSON, PATH, VALUE, ...)
+//
+// Set the value at PATH to VALUE. Create the PATH if it does not already
+// exist. Overwrite existing values that do exist.
+// If JSON or PATH is malformed, throw an error.
+//
+// json_insert(JSON, PATH, VALUE, ...)
+//
+// Create PATH and initialize it to VALUE. If PATH already exists, this
+// routine is a no-op. If JSON or PATH is malformed, throw an error.
+func jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187215:13: */
+ bp := tls.Alloc(52)
+ defer tls.Free(52)
+
+ // var x JsonParse at bp, 48
+ // The parse
+ var pNode uintptr
+ var zPath uintptr
+ var i U32
+ // var bApnd int32 at bp+48, 4
+
+ var bIsSet int32
+ bIsSet = *(*int32)(unsafe.Pointer(Xsqlite3_user_data(tls, ctx)))
+
+ if !(argc < 1) {
+ goto __1
+ }
+ return
+__1:
+ ;
+ if !((argc & 1) == 0) {
+ goto __2
+ }
+ jsonWrongNumArgs(tls, ctx, func() uintptr {
+ if bIsSet != 0 {
+ return ts + 28018 /* "set" */
+ }
+ return ts + 28022 /* "insert" */
+ }())
+ return
+__2:
+ ;
+ if !(jsonParse(tls, bp /* &x */, ctx, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))) != 0) {
+ goto __3
+ }
+ return
+__3:
+ ;
+
+ i = U32(1)
+__4:
+ if !(i < U32(argc)) {
+ goto __6
+ }
+ zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ *(*int32)(unsafe.Pointer(bp + 48 /* bApnd */)) = 0
+ pNode = jsonLookup(tls, bp /* &x */, zPath, bp+48 /* &bApnd */, ctx)
+ if !((*JsonParse)(unsafe.Pointer(bp /* &x */)).Foom != 0) {
+ goto __7
+ }
+ Xsqlite3_result_error_nomem(tls, ctx)
+ goto jsonSetDone
+ goto __8
+__7:
+ if !((*JsonParse)(unsafe.Pointer(bp /* &x */)).FnErr != 0) {
+ goto __9
+ }
+ goto jsonSetDone
+ goto __10
+__9:
+ if !((pNode != 0) && ((*(*int32)(unsafe.Pointer(bp + 48 /* bApnd */)) != 0) || (bIsSet != 0))) {
+ goto __11
+ }
+ *(*U8)(unsafe.Pointer(pNode + 1 /* &.jnFlags */)) |= U8((int32(U8(0x08))))
+ *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = (i + U32(1))
+__11:
+ ;
+__10:
+ ;
+__8:
+ ;
+ goto __5
+__5:
+ i = i + (U32(2))
+ goto __4
+ goto __6
+__6:
+ ;
+ if !((int32((*JsonNode)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode+uintptr(0)*16)).FjnFlags) & 0x08) != 0) {
+ goto __12
+ }
+ Xsqlite3_result_value(tls, ctx, *(*uintptr)(unsafe.Pointer(argv + uintptr(*(*U32)(unsafe.Pointer((*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode + uintptr(0)*16 + 8 /* &.u */)))*8)))
+ goto __13
+__12:
+ jsonReturnJson(tls, (*JsonParse)(unsafe.Pointer(bp /* &x */)).FaNode, ctx, argv)
+__13:
+ ;
+jsonSetDone:
+ jsonParseReset(tls, bp /* &x */)
+}
+
+// json_type(JSON)
+// json_type(JSON, PATH)
+//
+// Return the top-level "type" of a JSON string. Throw an error if
+// either the JSON or PATH inputs are not well-formed.
+func jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187264:13: */
+ var p uintptr // The parse
+ var zPath uintptr
+ var pNode uintptr
+
+ p = jsonParseCached(tls, ctx, argv, ctx)
+ if p == uintptr(0) {
+ return
+ }
+ if argc == 2 {
+ zPath = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
+ pNode = jsonLookup(tls, p, zPath, uintptr(0), ctx)
+ } else {
+ pNode = (*JsonParse)(unsafe.Pointer(p)).FaNode
+ }
+ if pNode != 0 {
+ Xsqlite3_result_text(tls, ctx, jsonType[(*JsonNode)(unsafe.Pointer(pNode)).FeType], -1, uintptr(0))
+ }
+}
+
+// json_valid(JSON)
+//
+// Return 1 if JSON is a well-formed JSON string according to RFC-7159.
+// Return 0 otherwise.
+func jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187292:13: */
+ var p uintptr // The parse
+ _ = argc
+ p = jsonParseCached(tls, ctx, argv, uintptr(0))
+ Xsqlite3_result_int(tls, ctx, (libc.Bool32(p != uintptr(0))))
+}
+
+// ***************************************************************************
+//
+// Aggregate SQL function implementations
+//
+// json_group_array(VALUE)
+//
+// Return a JSON array composed of all values in the aggregate.
+func jsonArrayStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187312:13: */
+ var pStr uintptr
+ _ = argc
+ pStr = Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(JsonString{})))
+ if pStr != 0 {
+ if (*JsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) {
+ jsonInit(tls, pStr, ctx)
+ jsonAppendChar(tls, pStr, int8('['))
+ } else if (*JsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) {
+ jsonAppendChar(tls, pStr, int8(','))
+ (*JsonString)(unsafe.Pointer(pStr)).FpCtx = ctx
+ }
+ jsonAppendValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ }
+}
+func jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:187331:13: */
+ var pStr uintptr
+ pStr = Xsqlite3_aggregate_context(tls, ctx, 0)
+ if pStr != 0 {
+ (*JsonString)(unsafe.Pointer(pStr)).FpCtx = ctx
+ jsonAppendChar(tls, pStr, int8(']'))
+ if (*JsonString)(unsafe.Pointer(pStr)).FbErr != 0 {
+ if int32((*JsonString)(unsafe.Pointer(pStr)).FbErr) == 1 {
+ Xsqlite3_result_error_nomem(tls, ctx)
+ }
+ } else if isFinal != 0 {
+ Xsqlite3_result_text(tls, ctx, (*JsonString)(unsafe.Pointer(pStr)).FzBuf, int32((*JsonString)(unsafe.Pointer(pStr)).FnUsed),
+ func() uintptr {
+ if (*JsonString)(unsafe.Pointer(pStr)).FbStatic != 0 {
+ return libc.UintptrFromInt32(-1)
+ }
+ return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))
+ }())
+ (*JsonString)(unsafe.Pointer(pStr)).FbStatic = U8(1)
+ } else {
+ Xsqlite3_result_text(tls, ctx, (*JsonString)(unsafe.Pointer(pStr)).FzBuf, int32((*JsonString)(unsafe.Pointer(pStr)).FnUsed), libc.UintptrFromInt32(-1))
+ (*JsonString)(unsafe.Pointer(pStr)).FnUsed--
+ }
+ } else {
+ Xsqlite3_result_text(tls, ctx, ts+28029 /* "[]" */, 2, uintptr(0))
+ }
+ Xsqlite3_result_subtype(tls, ctx, uint32(74))
+}
+func jsonArrayValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187353:13: */
+ jsonArrayCompute(tls, ctx, 0)
+}
+func jsonArrayFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187356:13: */
+ jsonArrayCompute(tls, ctx, 1)
+}
+
+// This method works for both json_group_array() and json_group_object().
+// It works by removing the first element of the group by searching forward
+// to the first comma (",") that is not within a string and deleting all
+// text through that comma.
+func jsonGroupInverse(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187367:13: */
+ var i uint32
+ var inStr int32 = 0
+ var nNest int32 = 0
+ var z uintptr
+ var c int8
+ var pStr uintptr
+ _ = argc
+ _ = argv
+ pStr = Xsqlite3_aggregate_context(tls, ctx, 0)
+ // pStr is always non-NULL since jsonArrayStep() or jsonObjectStep() will
+ // always have been called to initalize it
+ if !(pStr != 0) {
+ return
+ }
+ z = (*JsonString)(unsafe.Pointer(pStr)).FzBuf
+ for i = uint32(1); (((int32(libc.AssignInt8(&c, *(*int8)(unsafe.Pointer(z + uintptr(i)))))) != ',') || (inStr != 0)) || (nNest != 0); i++ {
+ if U64(i) >= (*JsonString)(unsafe.Pointer(pStr)).FnUsed {
+ (*JsonString)(unsafe.Pointer(pStr)).FnUsed = uint64(1)
+ return
+ }
+ if int32(c) == '"' {
+ inStr = libc.BoolInt32(!(inStr != 0))
+ } else if int32(c) == '\\' {
+ i++
+ } else if !(inStr != 0) {
+ if (int32(c) == '{') || (int32(c) == '[') {
+ nNest++
+ }
+ if (int32(c) == '}') || (int32(c) == ']') {
+ nNest--
+ }
+ }
+ }
+ *(*U64)(unsafe.Pointer(pStr + 24 /* &.nUsed */)) -= (U64(i))
+ libc.Xmemmove(tls, (z + uintptr(1)), (z + uintptr((i + uint32(1)))), (Size_t((*JsonString)(unsafe.Pointer(pStr)).FnUsed) - uint64(1)))
+}
+
+// json_group_obj(NAME,VALUE)
+//
+// Return a JSON object composed of all names and values in the aggregate.
+func jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { /* sqlite3.c:187414:13: */
+ var pStr uintptr
+ var z uintptr
+ var n U32
+ _ = argc
+ pStr = Xsqlite3_aggregate_context(tls, ctx, int32(unsafe.Sizeof(JsonString{})))
+ if pStr != 0 {
+ if (*JsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) {
+ jsonInit(tls, pStr, ctx)
+ jsonAppendChar(tls, pStr, int8('{'))
+ } else if (*JsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) {
+ jsonAppendChar(tls, pStr, int8(','))
+ (*JsonString)(unsafe.Pointer(pStr)).FpCtx = ctx
+ }
+ z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ n = U32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
+ jsonAppendString(tls, pStr, z, n)
+ jsonAppendChar(tls, pStr, int8(':'))
+ jsonAppendValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
+ }
+}
+func jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { /* sqlite3.c:187439:13: */
+ var pStr uintptr
+ pStr = Xsqlite3_aggregate_context(tls, ctx, 0)
+ if pStr != 0 {
+ jsonAppendChar(tls, pStr, int8('}'))
+ if (*JsonString)(unsafe.Pointer(pStr)).FbErr != 0 {
+ if int32((*JsonString)(unsafe.Pointer(pStr)).FbErr) == 1 {
+ Xsqlite3_result_error_nomem(tls, ctx)
+ }
+ } else if isFinal != 0 {
+ Xsqlite3_result_text(tls, ctx, (*JsonString)(unsafe.Pointer(pStr)).FzBuf, int32((*JsonString)(unsafe.Pointer(pStr)).FnUsed),
+ func() uintptr {
+ if (*JsonString)(unsafe.Pointer(pStr)).FbStatic != 0 {
+ return libc.UintptrFromInt32(-1)
+ }
+ return *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free}))
+ }())
+ (*JsonString)(unsafe.Pointer(pStr)).FbStatic = U8(1)
+ } else {
+ Xsqlite3_result_text(tls, ctx, (*JsonString)(unsafe.Pointer(pStr)).FzBuf, int32((*JsonString)(unsafe.Pointer(pStr)).FnUsed), libc.UintptrFromInt32(-1))
+ (*JsonString)(unsafe.Pointer(pStr)).FnUsed--
+ }
+ } else {
+ Xsqlite3_result_text(tls, ctx, ts+28032 /* "{}" */, 2, uintptr(0))
+ }
+ Xsqlite3_result_subtype(tls, ctx, uint32(74))
+}
+func jsonObjectValue(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187460:13: */
+ jsonObjectCompute(tls, ctx, 0)
+}
+func jsonObjectFinal(tls *libc.TLS, ctx uintptr) { /* sqlite3.c:187463:13: */
+ jsonObjectCompute(tls, ctx, 1)
+}
+
+// ***************************************************************************
+//
+// The json_each virtual table
+//
+type JsonEachCursor1 = struct {
+ Fbase Sqlite3_vtab_cursor
+ FiRowid U32
+ FiBegin U32
+ Fi U32
+ FiEnd U32
+ FeType U8
+ FbRecursive U8
+ FzJson uintptr
+ FzRoot uintptr
+ FsParse JsonParse
+}
+
+// ***************************************************************************
+//
+// The json_each virtual table
+//
+type JsonEachCursor = JsonEachCursor1 /* sqlite3.c:187473:31 */
+
+// Constructor for the json_each virtual table
+func jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:187488:12: */
+ var pNew uintptr
+ var rc int32
+
+ // Column numbers
+ // The xBestIndex method assumes that the JSON and ROOT columns are
+ // the last two columns in the table. Should this ever changes, be
+ // sure to update the xBestIndex method.
+
+ _ = pzErr
+ _ = argv
+ _ = argc
+ _ = pAux
+ rc = Xsqlite3_declare_vtab(tls, db,
+
+ ts+28035 /* "CREATE TABLE x(k..." */)
+ if rc == 0 {
+ pNew = libc.AssignPtrUintptr(ppVtab, Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Sqlite3_vtab{}))))
+ if pNew == uintptr(0) {
+ return 7
+ }
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Sqlite3_vtab{})))
+ Xsqlite3_vtab_config(tls, db, 2, 0)
+ }
+ return rc
+}
+
+// destructor for json_each virtual table
+func jsonEachDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:187530:12: */
+ Xsqlite3_free(tls, pVtab)
+ return 0
+}
+
+// constructor for a JsonEachCursor object for json_each().
+func jsonEachOpenEach(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:187536:12: */
+ var pCur uintptr
+
+ _ = p
+ pCur = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(JsonEachCursor{})))
+ if pCur == uintptr(0) {
+ return 7
+ }
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(JsonEachCursor{})))
+ *(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
+ return 0
+}
+
+// constructor for a JsonEachCursor object for json_tree().
+func jsonEachOpenTree(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:187548:12: */
+ var rc int32 = jsonEachOpenEach(tls, p, ppCursor)
+ if rc == 0 {
+ var pCur uintptr = *(*uintptr)(unsafe.Pointer(ppCursor))
+ (*JsonEachCursor)(unsafe.Pointer(pCur)).FbRecursive = U8(1)
+ }
+ return rc
+}
+
+// Reset a JsonEachCursor back to its original state. Free any memory
+// held.
+func jsonEachCursorReset(tls *libc.TLS, p uintptr) { /* sqlite3.c:187559:13: */
+ Xsqlite3_free(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzJson)
+ Xsqlite3_free(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot)
+ jsonParseReset(tls, (p + 48 /* &.sParse */))
+ (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid = U32(0)
+ (*JsonEachCursor)(unsafe.Pointer(p)).Fi = U32(0)
+ (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd = U32(0)
+ (*JsonEachCursor)(unsafe.Pointer(p)).FeType = U8(0)
+ (*JsonEachCursor)(unsafe.Pointer(p)).FzJson = uintptr(0)
+ (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot = uintptr(0)
+}
+
+// Destructor for a jsonEachCursor object
+func jsonEachClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187572:12: */
+ var p uintptr = cur
+ jsonEachCursorReset(tls, p)
+ Xsqlite3_free(tls, cur)
+ return 0
+}
+
+// Return TRUE if the jsonEachCursor object has been advanced off the end
+// of the JSON object
+func jsonEachEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187581:12: */
+ var p uintptr = cur
+ return (libc.Bool32((*JsonEachCursor)(unsafe.Pointer(p)).Fi >= (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd))
+}
+
+// Advance the cursor to the next element for json_tree()
+func jsonEachNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:187587:12: */
+ var p uintptr = cur
+ if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
+ if (int32((*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*16)).FjnFlags) & 0x40) != 0 {
+ (*JsonEachCursor)(unsafe.Pointer(p)).Fi++
+ }
+ (*JsonEachCursor)(unsafe.Pointer(p)).Fi++
+ (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid++
+ if (*JsonEachCursor)(unsafe.Pointer(p)).Fi < (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd {
+ var iUp U32 = *(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4))
+ var pUp uintptr = ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(iUp)*16)
+ (*JsonEachCursor)(unsafe.Pointer(p)).FeType = (*JsonNode)(unsafe.Pointer(pUp)).FeType
+ if int32((*JsonNode)(unsafe.Pointer(pUp)).FeType) == 6 {
+ if iUp == ((*JsonEachCursor)(unsafe.Pointer(p)).Fi - U32(1)) {
+ *(*U32)(unsafe.Pointer(pUp + 8 /* &.u */)) = U32(0)
+ } else {
+ *(*U32)(unsafe.Pointer(pUp + 8 /* &.u */))++
+ }
+ }
+ }
+ } else {
+ switch int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) {
+ case 6:
+ {
+ *(*U32)(unsafe.Pointer(p + 16 /* &.i */)) += (jsonNodeSize(tls, ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*16)))
+ (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid++
+ break
+ }
+ fallthrough
+ case 7:
+ {
+ *(*U32)(unsafe.Pointer(p + 16 /* &.i */)) += (U32(1) + jsonNodeSize(tls, ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr(((*JsonEachCursor)(unsafe.Pointer(p)).Fi+U32(1)))*16)))
+ (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid++
+ break
+ }
+ fallthrough
+ default:
+ {
+ (*JsonEachCursor)(unsafe.Pointer(p)).Fi = (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd
+ break
+ }
+ }
+ }
+ return 0
+}
+
+// Append the name of the path for element i to pStr
+func jsonEachComputePath(tls *libc.TLS, p uintptr, pStr uintptr, i U32) { /* sqlite3.c:187628:13: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var pNode uintptr
+ var pUp uintptr
+ var iUp U32
+ if i == U32(0) {
+ jsonAppendChar(tls, pStr, int8('$'))
+ return
+ }
+ iUp = *(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr(i)*4))
+ jsonEachComputePath(tls, p, pStr, iUp)
+ pNode = ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(i)*16)
+ pUp = ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(iUp)*16)
+ if int32((*JsonNode)(unsafe.Pointer(pUp)).FeType) == 6 {
+ jsonPrintf(tls, 30, pStr, ts+28118 /* "[%d]" */, libc.VaList(bp, *(*U32)(unsafe.Pointer(pUp + 8 /* &.u */))))
+ } else {
+
+ if (int32((*JsonNode)(unsafe.Pointer(pNode)).FjnFlags) & 0x40) == 0 {
+ pNode -= 16
+ }
+
+ jsonPrintf(tls, (int32((*JsonNode)(unsafe.Pointer(pNode)).Fn + U32(1))), pStr, ts+28123 /* ".%.*s" */, libc.VaList(bp+8, ((*JsonNode)(unsafe.Pointer(pNode)).Fn-U32(2)), (*(*uintptr)(unsafe.Pointer(pNode + 8 /* &.u */))+uintptr(1))))
+ }
+}
+
+// Return the value of a column
+func jsonEachColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:187655:12: */
+ bp := tls.Alloc(296)
+ defer tls.Free(296)
+
+ var p uintptr = cur
+ var pThis uintptr = ((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*16)
+ switch i {
+ case 0:
+ {
+ if (*JsonEachCursor)(unsafe.Pointer(p)).Fi == U32(0) {
+ break
+ }
+ if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == 7 {
+ jsonReturn(tls, pThis, ctx, uintptr(0))
+ } else if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == 6 {
+ var iKey U32
+ if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
+ if (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid == U32(0) {
+ break
+ }
+ iKey = *(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(*(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4)))*16 + 8 /* &.u */))
+ } else {
+ iKey = (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid
+ }
+ Xsqlite3_result_int64(tls, ctx, Sqlite3_int64(iKey))
+ }
+ break
+ }
+ case 1:
+ {
+ if (int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags) & 0x40) != 0 {
+ pThis += 16
+ }
+ jsonReturn(tls, pThis, ctx, uintptr(0))
+ break
+ }
+ case 2:
+ {
+ if (int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags) & 0x40) != 0 {
+ pThis += 16
+ }
+ Xsqlite3_result_text(tls, ctx, jsonType[(*JsonNode)(unsafe.Pointer(pThis)).FeType], -1, uintptr(0))
+ break
+ }
+ case 3:
+ {
+ if (int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags) & 0x40) != 0 {
+ pThis += 16
+ }
+ if int32((*JsonNode)(unsafe.Pointer(pThis)).FeType) >= 6 {
+ break
+ }
+ jsonReturn(tls, pThis, ctx, uintptr(0))
+ break
+ }
+ case 4:
+ {
+ Xsqlite3_result_int64(tls, ctx,
+ (Sqlite3_int64((*JsonEachCursor)(unsafe.Pointer(p)).Fi) + (Sqlite3_int64(libc.Bool32((int32((*JsonNode)(unsafe.Pointer(pThis)).FjnFlags) & 0x40) != 0)))))
+ break
+ }
+ case 5:
+ {
+ if ((*JsonEachCursor)(unsafe.Pointer(p)).Fi > (*JsonEachCursor)(unsafe.Pointer(p)).FiBegin) && ((*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0) {
+ Xsqlite3_result_int64(tls, ctx, Sqlite3_int64(*(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4))))
+ }
+ break
+ }
+ case 6:
+ {
+ // var x JsonString at bp+24, 136
+
+ jsonInit(tls, bp+24 /* &x */, ctx)
+ if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
+ jsonEachComputePath(tls, p, bp+24 /* &x */, (*JsonEachCursor)(unsafe.Pointer(p)).Fi)
+ } else {
+ if (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot != 0 {
+ jsonAppendRaw(tls, bp+24 /* &x */, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot, uint32(int32(libc.Xstrlen(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot))))
+ } else {
+ jsonAppendChar(tls, bp+24 /* &x */, int8('$'))
+ }
+ if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == 6 {
+ jsonPrintf(tls, 30, bp+24 /* &x */, ts+28118 /* "[%d]" */, libc.VaList(bp, (*JsonEachCursor)(unsafe.Pointer(p)).FiRowid))
+ } else if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) == 7 {
+ jsonPrintf(tls, int32((*JsonNode)(unsafe.Pointer(pThis)).Fn), bp+24 /* &x */, ts+28123 /* ".%.*s" */, libc.VaList(bp+8, ((*JsonNode)(unsafe.Pointer(pThis)).Fn-U32(2)), (*(*uintptr)(unsafe.Pointer(pThis + 8 /* &.u */))+uintptr(1))))
+ }
+ }
+ jsonResult(tls, bp+24 /* &x */)
+ break
+ }
+ case 7:
+ {
+ if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
+ // var x JsonString at bp+160, 136
+
+ jsonInit(tls, bp+160 /* &x */, ctx)
+ jsonEachComputePath(tls, p, bp+160 /* &x */, *(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4)))
+ jsonResult(tls, bp+160 /* &x */)
+ break
+ }
+ // For json_each() path and root are the same so fall through
+ // into the root case
+ /* no break */
+ }
+ fallthrough
+ default:
+ {
+ var zRoot uintptr = (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot
+ if zRoot == uintptr(0) {
+ zRoot = ts + 28129 /* "$" */
+ }
+ Xsqlite3_result_text(tls, ctx, zRoot, -1, uintptr(0))
+ break
+ }
+ case 8:
+ {
+
+ Xsqlite3_result_text(tls, ctx, (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson, -1, uintptr(0))
+ break
+ }
+ }
+ return 0
+}
+
+// Return the current rowid value
+func jsonEachRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:187754:12: */
+ var p uintptr = cur
+ *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Sqlite_int64((*JsonEachCursor)(unsafe.Pointer(p)).FiRowid)
+ return 0
+}
+
+// The query strategy is to look for an equality constraint on the json
+// column. Without such a constraint, the table cannot operate. idxNum is
+// 1 if the constraint is found, 3 if the constraint and zRoot are found,
+// and 0 otherwise.
+func jsonEachBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:187765:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var i int32 // Loop counter or computed array index
+ // var aIdx [2]int32 at bp, 8
+ // Index of constraints for JSON and ROOT
+ var unusableMask int32 = 0 // Mask of unusable JSON and ROOT constraints
+ var idxMask int32 = 0 // Mask of usable == constraints JSON and ROOT
+ var pConstraint uintptr
+
+ // This implementation assumes that JSON and ROOT are the last two
+ // columns in the table
+
+ _ = tab
+ *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + uintptr(0)*4)) = libc.AssignPtrInt32(bp /* &aIdx */ +uintptr(1)*4, -1)
+ pConstraint = (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint
+ i = 0
+__1:
+ if !(i < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) {
+ goto __3
+ }
+ {
+ var iCol int32
+ var iMask int32
+ if (*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn < 8 {
+ goto __2
+ }
+ iCol = ((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).FiColumn - 8)
+
+ iMask = (int32(1) << iCol)
+ if int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fusable) == 0 {
+ unusableMask = unusableMask | (iMask)
+ } else if int32((*sqlite3_index_constraint)(unsafe.Pointer(pConstraint)).Fop) == 2 {
+ *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + uintptr(iCol)*4)) = i
+ idxMask = idxMask | (iMask)
+ }
+ }
+ goto __2
+__2:
+ i++
+ pConstraint += 12
+ goto __1
+ goto __3
+__3:
+ ;
+ if (unusableMask & ^idxMask) != 0 {
+ // If there are any unusable constraints on JSON or ROOT, then reject
+ // this entire plan
+ return 19
+ }
+ if *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + uintptr(0)*4)) < 0 {
+ // No JSON input. Leave estimatedCost at the huge value that it was
+ // initialized to to discourage the query planner from selecting this
+ // plan.
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 0
+ } else {
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 1.0
+ i = *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + uintptr(0)*4))
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = 1
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1)
+ if *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + uintptr(1)*4)) < 0 {
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 1
+ } else {
+ i = *(*int32)(unsafe.Pointer(bp /* &aIdx[0] */ + uintptr(1)*4))
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = 2
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1)
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 3
+ }
+ }
+ return 0
+}
+
+// Start a search on a new JSON string
+func jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:187823:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var p uintptr = cur
+ var z uintptr
+ var zRoot uintptr = uintptr(0)
+ var n Sqlite3_int64
+
+ _ = idxStr
+ _ = argc
+ jsonEachCursorReset(tls, p)
+ if idxNum == 0 {
+ return 0
+ }
+ z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ if z == uintptr(0) {
+ return 0
+ }
+ n = Sqlite3_int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
+ (*JsonEachCursor)(unsafe.Pointer(p)).FzJson = Xsqlite3_malloc64(tls, (uint64(n + int64(1))))
+ if (*JsonEachCursor)(unsafe.Pointer(p)).FzJson == uintptr(0) {
+ return 7
+ }
+ libc.Xmemcpy(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzJson, z, (Size_t(n) + uint64(1)))
+ if jsonParse(tls, (p+48 /* &.sParse */), uintptr(0), (*JsonEachCursor)(unsafe.Pointer(p)).FzJson) != 0 {
+ var rc int32 = 7
+ if int32((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.Foom) == 0 {
+ Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg)
+ (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+27845 /* "malformed JSON" */, 0)
+ if (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 {
+ rc = 1
+ }
+ }
+ jsonEachCursorReset(tls, p)
+ return rc
+ } else if ((*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0) && (jsonParseFindParents(tls, (p+48 /* &.sParse */)) != 0) {
+ jsonEachCursorReset(tls, p)
+ return 7
+ } else {
+ var pNode uintptr = uintptr(0)
+ if idxNum == 3 {
+ *(*uintptr)(unsafe.Pointer(bp /* zErr */)) = uintptr(0)
+ zRoot = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
+ if zRoot == uintptr(0) {
+ return 0
+ }
+ n = Sqlite3_int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
+ (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot = Xsqlite3_malloc64(tls, (uint64(n + int64(1))))
+ if (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot == uintptr(0) {
+ return 7
+ }
+ libc.Xmemcpy(tls, (*JsonEachCursor)(unsafe.Pointer(p)).FzRoot, zRoot, (Size_t(n) + uint64(1)))
+ if int32(*(*int8)(unsafe.Pointer(zRoot + uintptr(0)))) != '$' {
+ *(*uintptr)(unsafe.Pointer(bp /* zErr */)) = zRoot
+ } else {
+ pNode = jsonLookupStep(tls, (p + 48 /* &.sParse */), uint32(0), ((*JsonEachCursor)(unsafe.Pointer(p)).FzRoot + uintptr(1)), uintptr(0), bp /* &zErr */)
+ }
+ if *(*uintptr)(unsafe.Pointer(bp /* zErr */)) != 0 {
+ Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg)
+ (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = jsonPathSyntaxError(tls, *(*uintptr)(unsafe.Pointer(bp /* zErr */)))
+ jsonEachCursorReset(tls, p)
+ if (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 {
+ return 1
+ }
+ return 7
+ } else if pNode == uintptr(0) {
+ return 0
+ }
+ } else {
+ pNode = (*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode
+ }
+ (*JsonEachCursor)(unsafe.Pointer(p)).FiBegin = libc.AssignPtrUint32(p+16 /* &.i */, U32((int32((int64(pNode) - int64((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode)) / 16))))
+ (*JsonEachCursor)(unsafe.Pointer(p)).FeType = (*JsonNode)(unsafe.Pointer(pNode)).FeType
+ if int32((*JsonEachCursor)(unsafe.Pointer(p)).FeType) >= 6 {
+ *(*U32)(unsafe.Pointer(pNode + 8 /* &.u */)) = U32(0)
+ (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd = (((*JsonEachCursor)(unsafe.Pointer(p)).Fi + (*JsonNode)(unsafe.Pointer(pNode)).Fn) + U32(1))
+ if (*JsonEachCursor)(unsafe.Pointer(p)).FbRecursive != 0 {
+ (*JsonEachCursor)(unsafe.Pointer(p)).FeType = (*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode + uintptr(*(*U32)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaUp + uintptr((*JsonEachCursor)(unsafe.Pointer(p)).Fi)*4)))*16)).FeType
+ if ((*JsonEachCursor)(unsafe.Pointer(p)).Fi > U32(0)) && ((int32((*JsonNode)(unsafe.Pointer((*JsonEachCursor)(unsafe.Pointer(p)).FsParse.FaNode+uintptr(((*JsonEachCursor)(unsafe.Pointer(p)).Fi-U32(1)))*16)).FjnFlags) & 0x40) != 0) {
+ (*JsonEachCursor)(unsafe.Pointer(p)).Fi--
+ }
+ } else {
+ (*JsonEachCursor)(unsafe.Pointer(p)).Fi++
+ }
+ } else {
+ (*JsonEachCursor)(unsafe.Pointer(p)).FiEnd = ((*JsonEachCursor)(unsafe.Pointer(p)).Fi + U32(1))
+ }
+ }
+ return 0
+}
+
+// The methods of the json_each virtual table
+var jsonEachModule = Sqlite3_module{FiVersion: 0, FxCreate: // iVersion
+uintptr(0), FxConnect:// xCreate
+0, FxBestIndex:// xConnect
+0, FxDisconnect:// xBestIndex
+0, FxDestroy:// xDisconnect
+uintptr(0), FxOpen:// xDestroy
+0, FxClose:// xOpen - open a cursor
+0, FxFilter:// xClose - close a cursor
+0, FxNext:// xFilter - configure scan constraints
+0, FxEof:// xNext - advance a cursor
+0, FxColumn:// xEof - check for end of scan
+0, FxRowid:// xColumn - read data
+0, FxUpdate:// xRowid - read data
+uintptr(0), FxBegin:// xUpdate
+uintptr(0), FxSync:// xBegin
+uintptr(0), FxCommit:// xSync
+uintptr(0), FxRollback:// xCommit
+uintptr(0), FxFindFunction:// xRollback
+uintptr(0), FxRename:// xFindMethod
+uintptr(0), FxSavepoint:// xRename
+uintptr(0), FxRelease:// xSavepoint
+uintptr(0), FxRollbackTo:// xRelease
+uintptr(0), FxShadowName:// xRollbackTo
+uintptr(0), // xShadowName
+} /* sqlite3.c:187902:23 */
+
+// The methods of the json_tree virtual table.
+var jsonTreeModule = Sqlite3_module{FiVersion: 0, FxCreate: // iVersion
+uintptr(0), FxConnect:// xCreate
+0, FxBestIndex:// xConnect
+0, FxDisconnect:// xBestIndex
+0, FxDestroy:// xDisconnect
+uintptr(0), FxOpen:// xDestroy
+0, FxClose:// xOpen - open a cursor
+0, FxFilter:// xClose - close a cursor
+0, FxNext:// xFilter - configure scan constraints
+0, FxEof:// xNext - advance a cursor
+0, FxColumn:// xEof - check for end of scan
+0, FxRowid:// xColumn - read data
+0, FxUpdate:// xRowid - read data
+uintptr(0), FxBegin:// xUpdate
+uintptr(0), FxSync:// xBegin
+uintptr(0), FxCommit:// xSync
+uintptr(0), FxRollback:// xCommit
+uintptr(0), FxFindFunction:// xRollback
+uintptr(0), FxRename:// xFindMethod
+uintptr(0), FxSavepoint:// xRename
+uintptr(0), FxRelease:// xSavepoint
+uintptr(0), FxRollbackTo:// xRelease
+uintptr(0), FxShadowName:// xRollbackTo
+uintptr(0), // xShadowName
+} /* sqlite3.c:187930:23 */
+
+// ***************************************************************************
+//
+// The following routines are the only publically visible identifiers in this
+// file. Call the following routines in order to register the various SQL
+// functions and the virtual table implemented by this file.
+//
+
+func Xsqlite3Json1Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:187964:20: */
+ var rc int32 = 0
+ var i uint32
+ for i = uint32(0); (uint64(i) < (uint64(unsafe.Sizeof(aFunc)) / uint64(unsafe.Sizeof(struct {
+ FzName uintptr
+ FnArg int32
+ Fflag int32
+ FxFunc uintptr
+ }{})))) && (rc == 0); i++ {
+ rc = Xsqlite3_create_function(tls, db, aFunc[i].FzName, aFunc[i].FnArg, enc,
+ (uintptr(unsafe.Pointer(&aFunc)) + uintptr(i)*24 + 12 /* &.flag */),
+ aFunc[i].FxFunc, uintptr(0), uintptr(0))
+ }
+ for i = uint32(0); (uint64(i) < (uint64(unsafe.Sizeof(aAgg)) / uint64(unsafe.Sizeof(struct {
+ FzName uintptr
+ FnArg int32
+ FxStep uintptr
+ FxFinal uintptr
+ FxValue uintptr
+ }{})))) && (rc == 0); i++ {
+ rc = Xsqlite3_create_window_function(tls, db, aAgg[i].FzName, aAgg[i].FnArg,
+ (0x000100000 | enc), uintptr(0),
+ aAgg[i].FxStep, aAgg[i].FxFinal,
+ aAgg[i].FxValue, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{jsonGroupInverse})), uintptr(0))
+ }
+ for i = uint32(0); (uint64(i) < (uint64(unsafe.Sizeof(aMod)) / uint64(unsafe.Sizeof(struct {
+ FzName uintptr
+ FpModule uintptr
+ }{})))) && (rc == 0); i++ {
+ rc = Xsqlite3_create_module(tls, db, aMod[i].FzName, aMod[i].FpModule, uintptr(0))
+ }
+ return rc
+}
+
+var aFunc = [15]struct {
+ FzName uintptr
+ FnArg int32
+ Fflag int32
+ FxFunc uintptr
+}{
+ {FzName: ts + 28131 /* "json" */, FnArg: 1, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28136 /* "json_array" */, FnArg: -1, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28147 /* "json_array_lengt..." */, FnArg: 1, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28147 /* "json_array_lengt..." */, FnArg: 2, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28165 /* "json_extract" */, FnArg: -1, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28178 /* "json_insert" */, FnArg: -1, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28190 /* "json_object" */, FnArg: -1, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28202 /* "json_patch" */, FnArg: 2, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28213 /* "json_quote" */, FnArg: 1, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28224 /* "json_remove" */, FnArg: -1, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28236 /* "json_replace" */, FnArg: -1, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28249 /* "json_set" */, FnArg: -1, Fflag: 1, FxFunc: 0},
+ {FzName: ts + 28258 /* "json_type" */, FnArg: 1, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28258 /* "json_type" */, FnArg: 2, Fflag: 0, FxFunc: 0},
+ {FzName: ts + 28268 /* "json_valid" */, FnArg: 1, Fflag: 0, FxFunc: 0},
+} /* sqlite3.c:187972:5 */
+var aAgg = [2]struct {
+ FzName uintptr
+ FnArg int32
+ FxStep uintptr
+ FxFinal uintptr
+ FxValue uintptr
+}{
+ {FzName: ts + 28279 /* "json_group_array" */, FnArg: 1, FxStep: 0, FxFinal: 0, FxValue: 0},
+ {FzName: ts + 28296 /* "json_group_objec..." */, FnArg: 2, FxStep: 0, FxFinal: 0, FxValue: 0},
+} /* sqlite3.c:188001:5 */
+var aMod = [2]struct {
+ FzName uintptr
+ FpModule uintptr
+}{
+ {FzName: ts + 28314 /* "json_each" */, FpModule: 0},
+ {FzName: ts + 28324 /* "json_tree" */, FpModule: 0},
+} /* sqlite3.c:188011:5 */
+var enc int32 = ((1 | 0x000000800) | 0x000200000) /* sqlite3.c:188016:20 */ // In the SQLite core
+
+// #include <string.h>
+// #include <stdio.h>
+// #include <assert.h>
+// #include <stdlib.h>
+
+// The following macro is used to suppress compiler warnings.
+
+type Rtree1 = struct {
+ Fbase Sqlite3_vtab
+ Fdb uintptr
+ FiNodeSize int32
+ FnDim U8
+ FnDim2 U8
+ FeCoordType U8
+ FnBytesPerCell U8
+ FinWrTrans U8
+ FnAux U8
+ FnAuxNotNull U8
+ FiDepth int32
+ FzDb uintptr
+ FzName uintptr
+ FnBusy U32
+ FnRowEst I64
+ FnCursor U32
+ FnNodeRef U32
+ FzReadAuxSql uintptr
+ FpDeleted uintptr
+ FiReinsertHeight int32
+ FpNodeBlob uintptr
+ FpWriteNode uintptr
+ FpDeleteNode uintptr
+ FpReadRowid uintptr
+ FpWriteRowid uintptr
+ FpDeleteRowid uintptr
+ FpReadParent uintptr
+ FpWriteParent uintptr
+ FpDeleteParent uintptr
+ FpWriteAux uintptr
+ FaHash [97]uintptr
+}
+
+// In the SQLite core
+
+// #include <string.h>
+// #include <stdio.h>
+// #include <assert.h>
+// #include <stdlib.h>
+
+// The following macro is used to suppress compiler warnings.
+
+type Rtree = Rtree1 /* sqlite3.c:188152:22 */
+type RtreeCursor1 = struct {
+ Fbase Sqlite3_vtab_cursor
+ FatEOF U8
+ FbPoint U8
+ FbAuxValid U8
+ FiStrategy int32
+ FnConstraint int32
+ FaConstraint uintptr
+ FnPointAlloc int32
+ FnPoint int32
+ FmxLevel int32
+ FaPoint uintptr
+ FpReadAux uintptr
+ FsPoint RtreeSearchPoint
+ FaNode [5]uintptr
+ FanQueue [41]U32
+ _ [4]byte
+}
+
+type RtreeCursor = RtreeCursor1 /* sqlite3.c:188153:28 */
+type RtreeNode1 = struct {
+ FpParent uintptr
+ FiNode I64
+ FnRef int32
+ FisDirty int32
+ FzData uintptr
+ FpNext uintptr
+}
+
+type RtreeNode = RtreeNode1 /* sqlite3.c:188154:26 */
+type RtreeCell1 = struct {
+ FiRowid I64
+ FaCoord [10]RtreeCoord
+}
+
+type RtreeCell = RtreeCell1 /* sqlite3.c:188155:26 */
+type RtreeConstraint1 = struct {
+ FiCoord int32
+ Fop int32
+ Fu struct{ FrValue RtreeDValue }
+ FpInfo uintptr
+}
+
+type RtreeConstraint = RtreeConstraint1 /* sqlite3.c:188156:32 */
+type RtreeMatchArg1 = struct {
+ FiSize U32
+ Fcb RtreeGeomCallback
+ FnParam int32
+ FapSqlParam uintptr
+ FaParam [1]RtreeDValue
+}
+
+type RtreeMatchArg = RtreeMatchArg1 /* sqlite3.c:188157:30 */
+type RtreeGeomCallback1 = struct {
+ FxGeom uintptr
+ FxQueryFunc uintptr
+ FxDestructor uintptr
+ FpContext uintptr
+}
+
+type RtreeGeomCallback = RtreeGeomCallback1 /* sqlite3.c:188158:34 */
+type RtreeCoord1 = struct{ Ff RtreeValue }
+
+type RtreeCoord = RtreeCoord1 /* sqlite3.c:188159:26 */
+type RtreeSearchPoint1 = struct {
+ FrScore RtreeDValue
+ Fid Sqlite3_int64
+ FiLevel U8
+ FeWithin U8
+ FiCell U8
+ _ [5]byte
+}
+
+type RtreeSearchPoint = RtreeSearchPoint1 /* sqlite3.c:188160:33 */
+
+// Possible values for Rtree.eCoordType:
+
+// If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will
+// only deal with integer coordinates. No floating point operations
+// will be done.
+type RtreeDValue = float64 /* sqlite3.c:188255:18 */ // High accuracy coordinate
+type RtreeValue = float32 /* sqlite3.c:188256:17 */
+
+// What version of GCC is being used. 0 means GCC is not being used .
+// Note that the GCC_VERSION macro will also be set correctly when using
+// clang, since clang works hard to be gcc compatible. So the gcc
+// optimizations will also work when compiling with clang.
+
+// The testcase() macro should already be defined in the amalgamation. If
+// it is not, make it a no-op.
+
+// Make sure that the compiler intrinsics we desire are enabled when
+// compiling with an appropriate version of MSVC unless prevented by
+// the SQLITE_DISABLE_INTRINSIC define.
+
+// Macros to determine whether the machine is big or little endian,
+// and whether or not that determination is run-time or compile-time.
+//
+// For best performance, an attempt is made to guess at the byte-order
+// using C-preprocessor macros. If that is unsuccessful, or if
+// -DSQLITE_RUNTIME_BYTEORDER=1 is set, then byte-order is determined
+// at run-time.
+
+// What version of MSVC is being used. 0 means MSVC is not being used
+
+// Functions to deserialize a 16 bit integer, 32 bit real number and
+// 64 bit integer. The deserialized value is returned.
+func readInt16(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:188535:12: */
+ return ((int32(*(*U8)(unsafe.Pointer(p + uintptr(0)))) << 8) + int32(*(*U8)(unsafe.Pointer(p + uintptr(1)))))
+}
+func readCoord(tls *libc.TLS, p uintptr, pCoord uintptr) { /* sqlite3.c:188538:13: */
+ // p is always 4-byte aligned
+ (*(*U32)(unsafe.Pointer(pCoord /* .Fu */))) = (((((U32(*(*U8)(unsafe.Pointer(p + uintptr(0))))) << 24) + ((U32(*(*U8)(unsafe.Pointer(p + uintptr(1))))) << 16)) + ((U32(*(*U8)(unsafe.Pointer(p + uintptr(2))))) << 8)) + ((U32(*(*U8)(unsafe.Pointer(p + uintptr(3))))) << 0))
+}
+func readInt64(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:188555:12: */
+ return (I64(((((((((U64(*(*U8)(unsafe.Pointer(p + uintptr(0))))) << 56) + ((U64(*(*U8)(unsafe.Pointer(p + uintptr(1))))) << 48)) + ((U64(*(*U8)(unsafe.Pointer(p + uintptr(2))))) << 40)) + ((U64(*(*U8)(unsafe.Pointer(p + uintptr(3))))) << 32)) + ((U64(*(*U8)(unsafe.Pointer(p + uintptr(4))))) << 24)) + ((U64(*(*U8)(unsafe.Pointer(p + uintptr(5))))) << 16)) + ((U64(*(*U8)(unsafe.Pointer(p + uintptr(6))))) << 8)) + ((U64(*(*U8)(unsafe.Pointer(p + uintptr(7))))) << 0)))
+}
+
+// Functions to serialize a 16 bit integer, 32 bit real number and
+// 64 bit integer. The value returned is the number of bytes written
+// to the argument buffer (always 2, 4 and 8 respectively).
+func writeInt16(tls *libc.TLS, p uintptr, i int32) { /* sqlite3.c:188587:13: */
+ *(*U8)(unsafe.Pointer(p + uintptr(0))) = (U8((i >> 8) & 0xFF))
+ *(*U8)(unsafe.Pointer(p + uintptr(1))) = (U8((i >> 0) & 0xFF))
+}
+func writeCoord(tls *libc.TLS, p uintptr, pCoord uintptr) int32 { /* sqlite3.c:188591:12: */
+ var i U32
+ // p is always 4-byte aligned
+
+ i = *(*U32)(unsafe.Pointer(pCoord /* .Fu */))
+ *(*U8)(unsafe.Pointer(p + uintptr(0))) = (U8((i >> 24) & U32(0xFF)))
+ *(*U8)(unsafe.Pointer(p + uintptr(1))) = (U8((i >> 16) & U32(0xFF)))
+ *(*U8)(unsafe.Pointer(p + uintptr(2))) = (U8((i >> 8) & U32(0xFF)))
+ *(*U8)(unsafe.Pointer(p + uintptr(3))) = (U8((i >> 0) & U32(0xFF)))
+ return 4
+}
+func writeInt64(tls *libc.TLS, p uintptr, i I64) int32 { /* sqlite3.c:188614:12: */
+ *(*U8)(unsafe.Pointer(p + uintptr(0))) = (U8((i >> 56) & int64(0xFF)))
+ *(*U8)(unsafe.Pointer(p + uintptr(1))) = (U8((i >> 48) & int64(0xFF)))
+ *(*U8)(unsafe.Pointer(p + uintptr(2))) = (U8((i >> 40) & int64(0xFF)))
+ *(*U8)(unsafe.Pointer(p + uintptr(3))) = (U8((i >> 32) & int64(0xFF)))
+ *(*U8)(unsafe.Pointer(p + uintptr(4))) = (U8((i >> 24) & int64(0xFF)))
+ *(*U8)(unsafe.Pointer(p + uintptr(5))) = (U8((i >> 16) & int64(0xFF)))
+ *(*U8)(unsafe.Pointer(p + uintptr(6))) = (U8((i >> 8) & int64(0xFF)))
+ *(*U8)(unsafe.Pointer(p + uintptr(7))) = (U8((i >> 0) & int64(0xFF)))
+ return 8
+}
+
+// Increment the reference count of node p.
+func nodeReference(tls *libc.TLS, p uintptr) { /* sqlite3.c:188639:13: */
+ if p != 0 {
+
+ (*RtreeNode)(unsafe.Pointer(p)).FnRef++
+ }
+}
+
+// Clear the content of node p (set all bytes to 0x00).
+func nodeZero(tls *libc.TLS, pRtree uintptr, p uintptr) { /* sqlite3.c:188649:13: */
+ libc.Xmemset(tls, ((*RtreeNode)(unsafe.Pointer(p)).FzData + uintptr(2)), 0, (uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize - 2)))
+ (*RtreeNode)(unsafe.Pointer(p)).FisDirty = 1
+}
+
+// Given a node number iNode, return the corresponding key to use
+// in the Rtree.aHash table.
+func nodeHash(tls *libc.TLS, iNode I64) uint32 { /* sqlite3.c:188658:21: */
+ return ((uint32(iNode)) % uint32(97))
+}
+
+// Search the node hash table for node iNode. If found, return a pointer
+// to it. Otherwise, return 0.
+func nodeHashLookup(tls *libc.TLS, pRtree uintptr, iNode I64) uintptr { /* sqlite3.c:188666:18: */
+ var p uintptr
+ for p = *(*uintptr)(unsafe.Pointer((pRtree + 192 /* &.aHash */) + uintptr(nodeHash(tls, iNode))*8)); (p != 0) && ((*RtreeNode)(unsafe.Pointer(p)).FiNode != iNode); p = (*RtreeNode)(unsafe.Pointer(p)).FpNext {
+ }
+ return p
+}
+
+// Add node pNode to the node hash table.
+func nodeHashInsert(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:188675:13: */
+ var iHash int32
+
+ iHash = int32(nodeHash(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode))
+ (*RtreeNode)(unsafe.Pointer(pNode)).FpNext = *(*uintptr)(unsafe.Pointer((pRtree + 192 /* &.aHash */) + uintptr(iHash)*8))
+ *(*uintptr)(unsafe.Pointer((pRtree + 192 /* &.aHash */) + uintptr(iHash)*8)) = pNode
+}
+
+// Remove node pNode from the node hash table.
+func nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { /* sqlite3.c:188686:13: */
+ var pp uintptr
+ if (*RtreeNode)(unsafe.Pointer(pNode)).FiNode != int64(0) {
+ pp = ((pRtree + 192 /* &.aHash */) + uintptr(nodeHash(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode))*8)
+ for ; (*(*uintptr)(unsafe.Pointer(pp))) != pNode; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 32 /* &.pNext */) {
+ }
+ *(*uintptr)(unsafe.Pointer(pp)) = (*RtreeNode)(unsafe.Pointer(pNode)).FpNext
+ (*RtreeNode)(unsafe.Pointer(pNode)).FpNext = uintptr(0)
+ }
+}
+
+// Allocate and return new r-tree node. Initially, (RtreeNode.iNode==0),
+// indicating that node has not yet been assigned a node number. It is
+// assigned a node number when nodeWrite() is called to write the
+// node contents out to the database.
+func nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) uintptr { /* sqlite3.c:188702:18: */
+ var pNode uintptr
+ pNode = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(RtreeNode{})) + uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))))
+ if pNode != 0 {
+ libc.Xmemset(tls, pNode, 0, (uint64(unsafe.Sizeof(RtreeNode{})) + uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize)))
+ (*RtreeNode)(unsafe.Pointer(pNode)).FzData = (pNode + uintptr(1)*40)
+ (*RtreeNode)(unsafe.Pointer(pNode)).FnRef = 1
+ (*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef++
+ (*RtreeNode)(unsafe.Pointer(pNode)).FpParent = pParent
+ (*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
+ nodeReference(tls, pParent)
+ }
+ return pNode
+}
+
+// Clear the Rtree.pNodeBlob object
+func nodeBlobReset(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:188720:13: */
+ if (((*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob != 0) && (int32((*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans) == 0)) && ((*Rtree)(unsafe.Pointer(pRtree)).FnCursor == U32(0)) {
+ var pBlob uintptr = (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob
+ (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob = uintptr(0)
+ Xsqlite3_blob_close(tls, pBlob)
+ }
+}
+
+// Check to see if pNode is the same as pParent or any of the parents
+// of pParent.
+func nodeInParentChain(tls *libc.TLS, pNode uintptr, pParent uintptr) int32 { /* sqlite3.c:188732:12: */
+ for ok := true; ok; ok = pParent != 0 {
+ if pNode == pParent {
+ return 1
+ }
+ pParent = (*RtreeNode)(unsafe.Pointer(pParent)).FpParent
+ }
+ return 0
+}
+
+// Obtain a reference to an r-tree node.
+func nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode I64, pParent uintptr, ppNode uintptr) int32 { /* sqlite3.c:188743:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 = 0
+ var pNode uintptr = uintptr(0)
+
+ // Check if the requested node is already in the hash table. If so,
+ // increase its reference count and return it.
+ if (libc.AssignUintptr(&pNode, nodeHashLookup(tls, pRtree, iNode))) != uintptr(0) {
+ if (pParent != 0) && !(int32((*RtreeNode)(unsafe.Pointer(pNode)).FpParent) != 0) {
+ if nodeInParentChain(tls, pNode, pParent) != 0 {
+
+ return (11 | (int32(1) << 8))
+ }
+ (*RtreeNode)(unsafe.Pointer(pParent)).FnRef++
+ (*RtreeNode)(unsafe.Pointer(pNode)).FpParent = pParent
+ } else if ((pParent != 0) && ((*RtreeNode)(unsafe.Pointer(pNode)).FpParent != 0)) && (pParent != (*RtreeNode)(unsafe.Pointer(pNode)).FpParent) {
+
+ return (11 | (int32(1) << 8))
+ }
+ (*RtreeNode)(unsafe.Pointer(pNode)).FnRef++
+ *(*uintptr)(unsafe.Pointer(ppNode)) = pNode
+ return 0
+ }
+
+ if (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob != 0 {
+ var pBlob uintptr = (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob
+ (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob = uintptr(0)
+ rc = Xsqlite3_blob_reopen(tls, pBlob, iNode)
+ (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob = pBlob
+ if rc != 0 {
+ nodeBlobReset(tls, pRtree)
+ if rc == 7 {
+ return 7
+ }
+ }
+ }
+ if (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) {
+ var zTab uintptr = Xsqlite3_mprintf(tls, ts+28334 /* "%s_node" */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
+ if zTab == uintptr(0) {
+ return 7
+ }
+ rc = Xsqlite3_blob_open(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, zTab, ts+28342 /* "data" */, iNode, 0,
+ (pRtree + 112 /* &.pNodeBlob */))
+ Xsqlite3_free(tls, zTab)
+ }
+ if rc != 0 {
+ nodeBlobReset(tls, pRtree)
+ *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0)
+ // If unable to open an sqlite3_blob on the desired row, that can only
+ // be because the shadow tables hold erroneous data.
+ if rc == 1 {
+ rc = (11 | (int32(1) << 8))
+ }
+ } else if (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob) {
+ pNode = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(RtreeNode{})) + uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))))
+ if !(pNode != 0) {
+ rc = 7
+ } else {
+ (*RtreeNode)(unsafe.Pointer(pNode)).FpParent = pParent
+ (*RtreeNode)(unsafe.Pointer(pNode)).FzData = (pNode + uintptr(1)*40)
+ (*RtreeNode)(unsafe.Pointer(pNode)).FnRef = 1
+ (*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef++
+ (*RtreeNode)(unsafe.Pointer(pNode)).FiNode = iNode
+ (*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 0
+ (*RtreeNode)(unsafe.Pointer(pNode)).FpNext = uintptr(0)
+ rc = Xsqlite3_blob_read(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpNodeBlob, (*RtreeNode)(unsafe.Pointer(pNode)).FzData,
+ (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize, 0)
+ }
+ }
+
+ // If the root node was just loaded, set pRtree->iDepth to the height
+ // of the r-tree structure. A height of zero means all data is stored on
+ // the root node. A height of one means the children of the root node
+ // are the leaves, and so on. If the depth as specified on the root node
+ // is greater than RTREE_MAX_DEPTH, the r-tree structure must be corrupt.
+ if (pNode != 0) && (iNode == int64(1)) {
+ (*Rtree)(unsafe.Pointer(pRtree)).FiDepth = readInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData)
+ if (*Rtree)(unsafe.Pointer(pRtree)).FiDepth > 40 {
+ rc = (11 | (int32(1) << 8))
+ }
+ }
+
+ // If no error has occurred so far, check if the "number of entries"
+ // field on the node is too large. If so, set the return code to
+ // SQLITE_CORRUPT_VTAB.
+ if (pNode != 0) && (rc == 0) {
+ if readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+uintptr(2))) > (((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)) {
+ rc = (11 | (int32(1) << 8))
+ }
+ }
+
+ if rc == 0 {
+ if pNode != uintptr(0) {
+ nodeReference(tls, pParent)
+ nodeHashInsert(tls, pRtree, pNode)
+ } else {
+ rc = (11 | (int32(1) << 8))
+ }
+ *(*uintptr)(unsafe.Pointer(ppNode)) = pNode
+ } else {
+ if pNode != 0 {
+ (*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef--
+ Xsqlite3_free(tls, pNode)
+ }
+ *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0)
+ }
+
+ return rc
+}
+
+// Overwrite cell iCell of node pNode with the contents of pCell.
+func nodeOverwriteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iCell int32) { /* sqlite3.c:188863:13: */
+ var ii int32
+ var p uintptr = ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell))))
+ p += uintptr(writeInt64(tls, p, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid))
+ for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); ii++ {
+ p += uintptr(writeCoord(tls, p, ((pCell + 8 /* &.aCoord */) + uintptr(ii)*4)))
+ }
+ (*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
+}
+
+// Remove the cell with index iCell from node pNode.
+func nodeDeleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) { /* sqlite3.c:188881:13: */
+ var pDst uintptr = ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell))))
+ var pSrc uintptr = (pDst + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell))
+ var nByte int32 = (((readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+uintptr(2))) - iCell) - 1) * int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell))
+ libc.Xmemmove(tls, pDst, pSrc, uint64(nByte))
+ writeInt16(tls, ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(2)), (readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+uintptr(2))) - 1))
+ (*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
+}
+
+// Insert the contents of cell pCell into node pNode. If the insert
+// is successful, return SQLITE_OK.
+//
+// If there is not enough free space in pNode, return SQLITE_FULL.
+func nodeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:188896:12: */
+ var nCell int32 // Current number of cells in pNode
+ var nMaxCell int32 // Maximum number of cells for pNode
+
+ nMaxCell = (((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell))
+ nCell = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + uintptr(2)))
+
+ if nCell < nMaxCell {
+ nodeOverwriteCell(tls, pRtree, pNode, pCell, nCell)
+ writeInt16(tls, ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(2)), (nCell + 1))
+ (*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
+ }
+
+ return (libc.Bool32(nCell == nMaxCell))
+}
+
+// If the node is dirty, write it out to the database.
+func nodeWrite(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:188920:12: */
+ var rc int32 = 0
+ if (*RtreeNode)(unsafe.Pointer(pNode)).FisDirty != 0 {
+ var p uintptr = (*Rtree)(unsafe.Pointer(pRtree)).FpWriteNode
+ if (*RtreeNode)(unsafe.Pointer(pNode)).FiNode != 0 {
+ Xsqlite3_bind_int64(tls, p, 1, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
+ } else {
+ Xsqlite3_bind_null(tls, p, 1)
+ }
+ Xsqlite3_bind_blob(tls, p, 2, (*RtreeNode)(unsafe.Pointer(pNode)).FzData, (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize, uintptr(0))
+ Xsqlite3_step(tls, p)
+ (*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 0
+ rc = Xsqlite3_reset(tls, p)
+ Xsqlite3_bind_null(tls, p, 2)
+ if ((*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(0)) && (rc == 0) {
+ (*RtreeNode)(unsafe.Pointer(pNode)).FiNode = Xsqlite3_last_insert_rowid(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb)
+ nodeHashInsert(tls, pRtree, pNode)
+ }
+ }
+ return rc
+}
+
+// Release a reference to a node. If the node is dirty and the reference
+// count drops to zero, the node data is written to the database.
+func nodeRelease(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:188946:12: */
+ var rc int32 = 0
+ if pNode != 0 {
+
+ (*RtreeNode)(unsafe.Pointer(pNode)).FnRef--
+ if (*RtreeNode)(unsafe.Pointer(pNode)).FnRef == 0 {
+ (*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef--
+ if (*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1) {
+ (*Rtree)(unsafe.Pointer(pRtree)).FiDepth = -1
+ }
+ if (*RtreeNode)(unsafe.Pointer(pNode)).FpParent != 0 {
+ rc = nodeRelease(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pNode)).FpParent)
+ }
+ if rc == 0 {
+ rc = nodeWrite(tls, pRtree, pNode)
+ }
+ nodeHashDelete(tls, pRtree, pNode)
+ Xsqlite3_free(tls, pNode)
+ }
+ }
+ return rc
+}
+
+// Return the 64-bit integer value associated with cell iCell of
+// node pNode. If pNode is a leaf node, this is a rowid. If it is
+// an internal node, then the 64-bit integer is a child page number.
+func nodeGetRowid(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32) I64 { /* sqlite3.c:188975:12: */
+
+ return readInt64(tls, ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell)))))
+}
+
+// Return coordinate iCoord from cell iCell in node pNode.
+func nodeGetCoord(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iCoord int32, pCoord uintptr) { /* sqlite3.c:188987:13: */
+ readCoord(tls, ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr(((12 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell)) + (4 * iCoord)))), pCoord)
+}
+
+// Deserialize cell iCell of node pNode. Populate the structure pointed
+// to by pCell with the results.
+func nodeGetCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, pCell uintptr) { /* sqlite3.c:189001:13: */
+ var pData uintptr
+ var pCoord uintptr
+ var ii int32 = 0
+ (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid = nodeGetRowid(tls, pRtree, pNode, iCell)
+ pData = ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((12 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * iCell))))
+ pCoord = pCell + 8 /* &.aCoord */
+ for ok := true; ok; ok = (ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)) {
+ readCoord(tls, pData, (pCoord + uintptr(ii)*4))
+ readCoord(tls, (pData + uintptr(4)), (pCoord + uintptr((ii+1))*4))
+ pData += uintptr(8)
+ ii = ii + (2)
+ }
+}
+
+// Rtree virtual table module xCreate method.
+func rtreeCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:189032:12: */
+ return rtreeInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 1)
+}
+
+// Rtree virtual table module xConnect method.
+func rtreeConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:189045:12: */
+ return rtreeInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 0)
+}
+
+// Increment the r-tree reference count.
+func rtreeReference(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:189058:13: */
+ (*Rtree)(unsafe.Pointer(pRtree)).FnBusy++
+}
+
+// Decrement the r-tree reference count. When the reference count reaches
+// zero the structure is deleted.
+func rtreeRelease(tls *libc.TLS, pRtree uintptr) { /* sqlite3.c:189066:13: */
+ (*Rtree)(unsafe.Pointer(pRtree)).FnBusy--
+ if (*Rtree)(unsafe.Pointer(pRtree)).FnBusy == U32(0) {
+ (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = U8(0)
+
+ nodeBlobReset(tls, pRtree)
+
+ Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteNode)
+ Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteNode)
+ Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
+ Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid)
+ Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteRowid)
+ Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent)
+ Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent)
+ Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteParent)
+ Xsqlite3_finalize(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteAux)
+ Xsqlite3_free(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql)
+ Xsqlite3_free(tls, pRtree)
+ }
+}
+
+// Rtree virtual table module xDisconnect method.
+func rtreeDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:189090:12: */
+ rtreeRelease(tls, pVtab)
+ return 0
+}
+
+// Rtree virtual table module xDestroy method.
+func rtreeDestroy(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:189098:12: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ var pRtree uintptr = pVtab
+ var rc int32
+ var zCreate uintptr = Xsqlite3_mprintf(tls,
+
+ ts+28347, /* "DROP TABLE '%q'...." */
+ libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName,
+ (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName,
+ (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
+ if !(zCreate != 0) {
+ rc = 7
+ } else {
+ nodeBlobReset(tls, pRtree)
+ rc = Xsqlite3_exec(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, zCreate, uintptr(0), uintptr(0), uintptr(0))
+ Xsqlite3_free(tls, zCreate)
+ }
+ if rc == 0 {
+ rtreeRelease(tls, pRtree)
+ }
+
+ return rc
+}
+
+// Rtree virtual table module xOpen method.
+func rtreeOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:189126:12: */
+ var rc int32 = 7
+ var pRtree uintptr = pVTab
+ var pCsr uintptr
+
+ pCsr = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(RtreeCursor{})))
+ if pCsr != 0 {
+ libc.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(RtreeCursor{})))
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab = pVTab
+ rc = 0
+ (*Rtree)(unsafe.Pointer(pRtree)).FnCursor++
+ }
+ *(*uintptr)(unsafe.Pointer(ppCursor)) = pCsr
+
+ return rc
+}
+
+// Reset a cursor back to its initial state.
+func resetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:189147:13: */
+ var pRtree uintptr = (*RtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
+ var ii int32
+ var pStmt uintptr
+ if (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0 {
+ var i int32 // Used to iterate through constraint array
+ for i = 0; i < (*RtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint; i++ {
+ var pInfo uintptr = (*RtreeConstraint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint + uintptr(i)*24)).FpInfo
+ if pInfo != 0 {
+ if (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FxDelUser != 0 {
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pInfo + 32 /* &.xDelUser */))))(tls, (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FpUser)
+ }
+ Xsqlite3_free(tls, pInfo)
+ }
+ }
+ Xsqlite3_free(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint)
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = uintptr(0)
+ }
+ for ii = 0; ii < 5; ii++ {
+ nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */) + uintptr(ii)*8)))
+ }
+ Xsqlite3_free(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaPoint)
+ pStmt = (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux
+ libc.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(RtreeCursor{})))
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab = pRtree
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux = pStmt
+
+}
+
+// Rtree virtual table module xClose method.
+func rtreeClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:189175:12: */
+ var pRtree uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
+ var pCsr uintptr = cur
+
+ resetCursor(tls, pCsr)
+ Xsqlite3_finalize(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
+ Xsqlite3_free(tls, pCsr)
+ (*Rtree)(unsafe.Pointer(pRtree)).FnCursor--
+ nodeBlobReset(tls, pRtree)
+ return 0
+}
+
+// Rtree virtual table module xEof method.
+//
+// Return non-zero if the cursor does not currently point to a valid
+// record (i.e if the scan has finished), or zero otherwise.
+func rtreeEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:189193:12: */
+ var pCsr uintptr = cur
+ return int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FatEOF)
+}
+
+// Convert raw bits from the on-disk RTree record into a coordinate value.
+// The on-disk format is big-endian and needs to be converted for little-
+// endian platforms. The on-disk record stores integer coordinates if
+// eInt is true and it stores 32-bit floating point records if eInt is
+// false. a[] is the four bytes of the on-disk record to be decoded.
+// Store the results in "r".
+//
+// There are five versions of this macro. The last one is generic. The
+// other four are various architectures-specific optimizations.
+
+// Check the RTree node or entry given by pCellData and p against the MATCH
+// constraint pConstraint.
+func rtreeCallbackConstraint(tls *libc.TLS, pConstraint uintptr, eInt int32, pCellData uintptr, pSearch uintptr, prScore uintptr, peWithin uintptr) int32 { /* sqlite3.c:189248:12: */
+ bp := tls.Alloc(92)
+ defer tls.Free(92)
+
+ var pInfo uintptr = (*RtreeConstraint)(unsafe.Pointer(pConstraint)).FpInfo // Callback info
+ var nCoord int32 = (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FnCoord // No. of coordinates
+ var rc int32 // Callback return code
+ // var c RtreeCoord at bp, 4
+ // Translator union
+ // var aCoord [10]Sqlite3_rtree_dbl at bp+8, 80
+ // Decoded coordinates
+
+ if ((*RtreeConstraint)(unsafe.Pointer(pConstraint)).Fop == 0x47) && (int32((*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FiLevel) == 1) {
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FiRowid = readInt64(tls, pCellData)
+ }
+ pCellData += uintptr(8)
+ if eInt == 0 {
+ switch nCoord {
+ case 10:
+ readCoord(tls, (pCellData + uintptr(36)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(9)*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
+ readCoord(tls, (pCellData + uintptr(32)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(8)*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
+ fallthrough
+ case 8:
+ readCoord(tls, (pCellData + uintptr(28)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(7)*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
+ readCoord(tls, (pCellData + uintptr(24)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(6)*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
+ fallthrough
+ case 6:
+ readCoord(tls, (pCellData + uintptr(20)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(5)*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
+ readCoord(tls, (pCellData + uintptr(16)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(4)*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
+ fallthrough
+ case 4:
+ readCoord(tls, (pCellData + uintptr(12)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(3)*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
+ readCoord(tls, (pCellData + uintptr(8)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(2)*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
+ fallthrough
+ default:
+ readCoord(tls, (pCellData + uintptr(4)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(1)*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
+ readCoord(tls, pCellData, bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(0)*8)) = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
+ }
+ } else {
+ switch nCoord {
+ case 10:
+ readCoord(tls, (pCellData + uintptr(36)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(9)*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
+ readCoord(tls, (pCellData + uintptr(32)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(8)*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
+ fallthrough
+ case 8:
+ readCoord(tls, (pCellData + uintptr(28)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(7)*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
+ readCoord(tls, (pCellData + uintptr(24)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(6)*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
+ fallthrough
+ case 6:
+ readCoord(tls, (pCellData + uintptr(20)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(5)*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
+ readCoord(tls, (pCellData + uintptr(16)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(4)*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
+ fallthrough
+ case 4:
+ readCoord(tls, (pCellData + uintptr(12)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(3)*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
+ readCoord(tls, (pCellData + uintptr(8)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(2)*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
+ fallthrough
+ default:
+ readCoord(tls, (pCellData + uintptr(4)), bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(1)*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
+ readCoord(tls, pCellData, bp /* &c */)
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* &aCoord[0] */ + uintptr(0)*8)) = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
+ }
+ }
+ if (*RtreeConstraint)(unsafe.Pointer(pConstraint)).Fop == 0x46 {
+ *(*int32)(unsafe.Pointer(bp + 88 /* eWithin */)) = 0
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pConstraint + 8 /* &.u */ /* &.xGeom */))))(tls, pInfo,
+ nCoord, bp+8 /* &aCoord[0] */, bp+88 /* &eWithin */)
+ if *(*int32)(unsafe.Pointer(bp + 88 /* eWithin */)) == 0 {
+ *(*int32)(unsafe.Pointer(peWithin)) = 0
+ }
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore)) = 0.0
+ } else {
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FaCoord = bp + 8 /* &aCoord[0] */
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FiLevel = (int32((*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FiLevel) - 1)
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrScore = libc.AssignPtrFloat64(pInfo+80 /* &.rParentScore */, (*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FrScore)
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FeWithin = libc.AssignPtrInt32(pInfo+88 /* &.eParentWithin */, int32((*RtreeSearchPoint)(unsafe.Pointer(pSearch)).FeWithin))
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pConstraint + 8 /* &.u */ /* &.xQueryFunc */))))(tls, pInfo)
+ if (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FeWithin < *(*int32)(unsafe.Pointer(peWithin)) {
+ *(*int32)(unsafe.Pointer(peWithin)) = (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FeWithin
+ }
+ if ((*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrScore < *(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore))) || (*(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore)) < 0.0) {
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(prScore)) = (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FrScore
+ }
+ }
+ return rc
+}
+
+// Check the internal RTree node given by pCellData against constraint p.
+// If this constraint cannot be satisfied by any child within the node,
+// set *peWithin to NOT_WITHIN.
+func rtreeNonleafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:189324:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var val Sqlite3_rtree_dbl // Coordinate value convert to a double
+
+ // p->iCoord might point to either a lower or upper bound coordinate
+ // in a coordinate pair. But make pCellData point to the lower bound.
+ pCellData += (uintptr(8 + (4 * ((*RtreeConstraint)(unsafe.Pointer(p)).FiCoord & 0xfe))))
+
+ // 4-byte aligned
+ switch (*RtreeConstraint)(unsafe.Pointer(p)).Fop {
+ case 0x3f:
+ return // Always satisfied
+ case 0x40:
+ break // Never satisfied
+ case 0x42:
+ fallthrough
+ case 0x43:
+ fallthrough
+ case 0x41:
+ {
+ // var c RtreeCoord at bp, 4
+ /* Coordinate decoded */
+ libc.Xmemcpy(tls, (bp /* &c */ /* &.u */), pCellData, uint64(4))
+ *(*U32)(unsafe.Pointer(bp /* &c */)) = (((((*(*U32)(unsafe.Pointer(bp /* &c */)) >> 24) & U32(0xff)) | ((*(*U32)(unsafe.Pointer(bp /* &c */)) >> 8) & U32(0xff00))) | ((*(*U32)(unsafe.Pointer(bp /* &c */)) & U32(0xff)) << 24)) | ((*(*U32)(unsafe.Pointer(bp /* &c */)) & U32(0xff00)) << 8))
+ if eInt != 0 {
+ val = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
+ } else {
+ val = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
+ }
+ }
+
+ // val now holds the lower bound of the coordinate pair
+ if *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) >= val {
+ return
+ }
+ if (*RtreeConstraint)(unsafe.Pointer(p)).Fop != 0x41 {
+ break
+ }
+ fallthrough // RTREE_LE and RTREE_LT end here
+ // Fall through for the RTREE_EQ case
+
+ default: // RTREE_GT or RTREE_GE, or fallthrough of RTREE_EQ
+ pCellData += uintptr(4)
+ {
+ // var c RtreeCoord at bp+4, 4
+ /* Coordinate decoded */
+ libc.Xmemcpy(tls, (bp + 4 /* &c */ /* &.u */), pCellData, uint64(4))
+ *(*U32)(unsafe.Pointer(bp + 4 /* &c */)) = (((((*(*U32)(unsafe.Pointer(bp + 4 /* &c */)) >> 24) & U32(0xff)) | ((*(*U32)(unsafe.Pointer(bp + 4 /* &c */)) >> 8) & U32(0xff00))) | ((*(*U32)(unsafe.Pointer(bp + 4 /* &c */)) & U32(0xff)) << 24)) | ((*(*U32)(unsafe.Pointer(bp + 4 /* &c */)) & U32(0xff00)) << 8))
+ if eInt != 0 {
+ val = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp + 4 /* &c */)))
+ } else {
+ val = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp + 4 /* &c */)))
+ }
+ }
+
+ // val now holds the upper bound of the coordinate pair
+ if *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) <= val {
+ return
+ }
+ }
+ *(*int32)(unsafe.Pointer(peWithin)) = 0
+}
+
+// Check the leaf RTree cell given by pCellData against constraint p.
+// If this constraint is not satisfied, set *peWithin to NOT_WITHIN.
+// If the constraint is satisfied, leave *peWithin unchanged.
+//
+// The constraint is of the form: xN op $val
+//
+// The op is given by p->op. The xN is p->iCoord-th coordinate in
+// pCellData. $val is given by p->u.rValue.
+func rtreeLeafConstraint(tls *libc.TLS, p uintptr, eInt int32, pCellData uintptr, peWithin uintptr) { /* sqlite3.c:189372:13: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var xN RtreeDValue // Coordinate value converted to a double
+
+ pCellData += (uintptr(8 + ((*RtreeConstraint)(unsafe.Pointer(p)).FiCoord * 4)))
+ /* 4-byte aligned */
+ {
+ // var c RtreeCoord at bp, 4
+ /* Coordinate decoded */
+ libc.Xmemcpy(tls, (bp /* &c */ /* &.u */), pCellData, uint64(4))
+ *(*U32)(unsafe.Pointer(bp /* &c */)) = (((((*(*U32)(unsafe.Pointer(bp /* &c */)) >> 24) & U32(0xff)) | ((*(*U32)(unsafe.Pointer(bp /* &c */)) >> 8) & U32(0xff00))) | ((*(*U32)(unsafe.Pointer(bp /* &c */)) & U32(0xff)) << 24)) | ((*(*U32)(unsafe.Pointer(bp /* &c */)) & U32(0xff00)) << 8))
+ if eInt != 0 {
+ xN = Sqlite3_rtree_dbl(*(*int32)(unsafe.Pointer(bp /* &c */)))
+ } else {
+ xN = Sqlite3_rtree_dbl(*(*RtreeValue)(unsafe.Pointer(bp /* &c */)))
+ }
+ }
+
+ switch (*RtreeConstraint)(unsafe.Pointer(p)).Fop {
+ case 0x3f:
+ return // Always satisfied
+ case 0x40:
+ break // Never satisfied
+ case 0x42:
+ if xN <= *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) {
+ return
+ }
+ break
+ case 0x43:
+ if xN < *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) {
+ return
+ }
+ break
+ case 0x44:
+ if xN >= *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) {
+ return
+ }
+ break
+ case 0x45:
+ if xN > *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) {
+ return
+ }
+ break
+ default:
+ if xN == *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) {
+ return
+ }
+ break
+ }
+ *(*int32)(unsafe.Pointer(peWithin)) = 0
+}
+
+// One of the cells in node pNode is guaranteed to have a 64-bit
+// integer value equal to iRowid. Return the index of this cell.
+func nodeRowidIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, iRowid I64, piIndex uintptr) int32 { /* sqlite3.c:189402:12: */
+ var ii int32
+ var nCell int32 = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + uintptr(2)))
+
+ for ii = 0; ii < nCell; ii++ {
+ if nodeGetRowid(tls, pRtree, pNode, ii) == iRowid {
+ *(*int32)(unsafe.Pointer(piIndex)) = ii
+ return 0
+ }
+ }
+
+ return (11 | (int32(1) << 8))
+}
+
+// Return the index of the cell containing a pointer to node pNode
+// in its parent. If pNode is the root node, return -1.
+func nodeParentIndex(tls *libc.TLS, pRtree uintptr, pNode uintptr, piIndex uintptr) int32 { /* sqlite3.c:189425:12: */
+ var pParent uintptr = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent
+ if pParent != 0 {
+ return nodeRowidIndex(tls, pRtree, pParent, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode, piIndex)
+ }
+ *(*int32)(unsafe.Pointer(piIndex)) = -1
+ return 0
+}
+
+// Compare two search points. Return negative, zero, or positive if the first
+// is less than, equal to, or greater than the second.
+//
+// The rScore is the primary key. Smaller rScore values come first.
+// If the rScore is a tie, then use iLevel as the tie breaker with smaller
+// iLevel values coming first. In this way, if rScore is the same for all
+// SearchPoints, then iLevel becomes the deciding factor and the result
+// is a depth-first search, which is the desired default behavior.
+func rtreeSearchPointCompare(tls *libc.TLS, pA uintptr, pB uintptr) int32 { /* sqlite3.c:189444:12: */
+ if (*RtreeSearchPoint)(unsafe.Pointer(pA)).FrScore < (*RtreeSearchPoint)(unsafe.Pointer(pB)).FrScore {
+ return -1
+ }
+ if (*RtreeSearchPoint)(unsafe.Pointer(pA)).FrScore > (*RtreeSearchPoint)(unsafe.Pointer(pB)).FrScore {
+ return +1
+ }
+ if int32((*RtreeSearchPoint)(unsafe.Pointer(pA)).FiLevel) < int32((*RtreeSearchPoint)(unsafe.Pointer(pB)).FiLevel) {
+ return -1
+ }
+ if int32((*RtreeSearchPoint)(unsafe.Pointer(pA)).FiLevel) > int32((*RtreeSearchPoint)(unsafe.Pointer(pB)).FiLevel) {
+ return +1
+ }
+ return 0
+}
+
+// Interchange two search points in a cursor.
+func rtreeSearchPointSwap(tls *libc.TLS, p uintptr, i int32, j int32) { /* sqlite3.c:189458:13: */
+ var t = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(i)*24))
+
+ *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(i)*24)) = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(j)*24))
+ *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(j)*24)) = t
+ i++
+ j++
+ if i < 5 {
+ if j >= 5 {
+ nodeRelease(tls, (*RtreeCursor)(unsafe.Pointer((p))).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer((p + 88 /* &.aNode */) + uintptr(i)*8)))
+ *(*uintptr)(unsafe.Pointer((p + 88 /* &.aNode */) + uintptr(i)*8)) = uintptr(0)
+ } else {
+ var pTemp uintptr = *(*uintptr)(unsafe.Pointer((p + 88 /* &.aNode */) + uintptr(i)*8))
+ *(*uintptr)(unsafe.Pointer((p + 88 /* &.aNode */) + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((p + 88 /* &.aNode */) + uintptr(j)*8))
+ *(*uintptr)(unsafe.Pointer((p + 88 /* &.aNode */) + uintptr(j)*8)) = pTemp
+ }
+ }
+}
+
+// Return the search point with the lowest current score.
+func rtreeSearchPointFirst(tls *libc.TLS, pCur uintptr) uintptr { /* sqlite3.c:189479:25: */
+ if (*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint != 0 {
+ return (pCur + 64 /* &.sPoint */)
+ }
+ if (*RtreeCursor)(unsafe.Pointer(pCur)).FnPoint != 0 {
+ return (*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint
+ }
+ return uintptr(0)
+}
+
+// Get the RtreeNode for the search point with the lowest score.
+func rtreeNodeOfFirstSearchPoint(tls *libc.TLS, pCur uintptr, pRC uintptr) uintptr { /* sqlite3.c:189486:18: */
+ var id Sqlite3_int64
+ var ii int32 = (1 - int32((*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint))
+
+ if *(*uintptr)(unsafe.Pointer((pCur + 88 /* &.aNode */) + uintptr(ii)*8)) == uintptr(0) {
+
+ if ii != 0 {
+ id = (*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint + uintptr(0)*24)).Fid
+ } else {
+ id = (*RtreeCursor)(unsafe.Pointer(pCur)).FsPoint.Fid
+ }
+ *(*int32)(unsafe.Pointer(pRC)) = nodeAcquire(tls, (*RtreeCursor)(unsafe.Pointer((pCur))).Fbase.FpVtab, id, uintptr(0), ((pCur + 88 /* &.aNode */) + uintptr(ii)*8))
+ }
+ return *(*uintptr)(unsafe.Pointer((pCur + 88 /* &.aNode */) + uintptr(ii)*8))
+}
+
+// Push a new element onto the priority queue
+func rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:189502:25: */
+ var i int32
+ var j int32
+ var pNew uintptr
+ if (*RtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*RtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc {
+ var nNew int32 = (((*RtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc * 2) + 8)
+ pNew = Xsqlite3_realloc64(tls, (*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint, (uint64(uint64(nNew) * uint64(unsafe.Sizeof(RtreeSearchPoint{})))))
+ if pNew == uintptr(0) {
+ return uintptr(0)
+ }
+ (*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint = pNew
+ (*RtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc = nNew
+ }
+ i = libc.PostIncInt32(&(*RtreeCursor)(unsafe.Pointer(pCur)).FnPoint, 1)
+ pNew = ((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint + uintptr(i)*24)
+ (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FrScore = rScore
+ (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiLevel = iLevel
+
+ for i > 0 {
+ var pParent uintptr
+ j = ((i - 1) / 2)
+ pParent = ((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint + uintptr(j)*24)
+ if rtreeSearchPointCompare(tls, pNew, pParent) >= 0 {
+ break
+ }
+ rtreeSearchPointSwap(tls, pCur, j, i)
+ i = j
+ pNew = pParent
+ }
+ return pNew
+}
+
+// Allocate a new RtreeSearchPoint and return a pointer to it. Return
+// NULL if malloc fails.
+func rtreeSearchPointNew(tls *libc.TLS, pCur uintptr, rScore RtreeDValue, iLevel U8) uintptr { /* sqlite3.c:189537:25: */
+ var pNew uintptr
+ var pFirst uintptr
+ pFirst = rtreeSearchPointFirst(tls, pCur)
+ *(*U32)(unsafe.Pointer((pCur + 128 /* &.anQueue */) + uintptr(iLevel)*4))++
+ if ((pFirst == uintptr(0)) ||
+ ((*RtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore > rScore)) ||
+ (((*RtreeSearchPoint)(unsafe.Pointer(pFirst)).FrScore == rScore) && (int32((*RtreeSearchPoint)(unsafe.Pointer(pFirst)).FiLevel) > int32(iLevel))) {
+ if (*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint != 0 {
+ var ii int32
+ pNew = rtreeEnqueue(tls, pCur, rScore, iLevel)
+ if pNew == uintptr(0) {
+ return uintptr(0)
+ }
+ ii = ((int32((int64(pNew) - int64((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint)) / 24)) + 1)
+ if ii < 5 {
+
+ *(*uintptr)(unsafe.Pointer((pCur + 88 /* &.aNode */) + uintptr(ii)*8)) = *(*uintptr)(unsafe.Pointer((pCur + 88 /* &.aNode */) + uintptr(0)*8))
+ } else {
+ nodeRelease(tls, (*RtreeCursor)(unsafe.Pointer((pCur))).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer((pCur + 88 /* &.aNode */) + uintptr(0)*8)))
+ }
+ *(*uintptr)(unsafe.Pointer((pCur + 88 /* &.aNode */) + uintptr(0)*8)) = uintptr(0)
+ *(*RtreeSearchPoint)(unsafe.Pointer(pNew)) = (*RtreeCursor)(unsafe.Pointer(pCur)).FsPoint
+ }
+ (*RtreeCursor)(unsafe.Pointer(pCur)).FsPoint.FrScore = rScore
+ (*RtreeCursor)(unsafe.Pointer(pCur)).FsPoint.FiLevel = iLevel
+ (*RtreeCursor)(unsafe.Pointer(pCur)).FbPoint = U8(1)
+ return (pCur + 64 /* &.sPoint */)
+ } else {
+ return rtreeEnqueue(tls, pCur, rScore, iLevel)
+ }
+ return uintptr(0)
+}
+
+// Remove the search point with the lowest current score.
+func rtreeSearchPointPop(tls *libc.TLS, p uintptr) { /* sqlite3.c:189604:13: */
+ var i int32
+ var j int32
+ var k int32
+ var n int32
+ i = (1 - int32((*RtreeCursor)(unsafe.Pointer(p)).FbPoint))
+
+ if *(*uintptr)(unsafe.Pointer((p + 88 /* &.aNode */) + uintptr(i)*8)) != 0 {
+ nodeRelease(tls, (*RtreeCursor)(unsafe.Pointer((p))).Fbase.FpVtab, *(*uintptr)(unsafe.Pointer((p + 88 /* &.aNode */) + uintptr(i)*8)))
+ *(*uintptr)(unsafe.Pointer((p + 88 /* &.aNode */) + uintptr(i)*8)) = uintptr(0)
+ }
+ if (*RtreeCursor)(unsafe.Pointer(p)).FbPoint != 0 {
+ *(*U32)(unsafe.Pointer((p + 128 /* &.anQueue */) + uintptr((*RtreeCursor)(unsafe.Pointer(p)).FsPoint.FiLevel)*4))--
+ (*RtreeCursor)(unsafe.Pointer(p)).FbPoint = U8(0)
+ } else if (*RtreeCursor)(unsafe.Pointer(p)).FnPoint != 0 {
+ *(*U32)(unsafe.Pointer((p + 128 /* &.anQueue */) + uintptr((*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(0)*24)).FiLevel)*4))--
+ n = libc.PreDecInt32(&(*RtreeCursor)(unsafe.Pointer(p)).FnPoint, 1)
+ *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(0)*24)) = *(*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(p)).FaPoint + uintptr(n)*24))
+ if n < (5 - 1) {
+ *(*uintptr)(unsafe.Pointer((p + 88 /* &.aNode */) + uintptr(1)*8)) = *(*uintptr)(unsafe.Pointer((p + 88 /* &.aNode */) + uintptr((n+1))*8))
+ *(*uintptr)(unsafe.Pointer((p + 88 /* &.aNode */) + uintptr((n+1))*8)) = uintptr(0)
+ }
+ i = 0
+ for (libc.AssignInt32(&j, ((i * 2) + 1))) < n {
+ k = (j + 1)
+ if (k < n) && (rtreeSearchPointCompare(tls, ((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(k)*24), ((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(j)*24)) < 0) {
+ if rtreeSearchPointCompare(tls, ((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(k)*24), ((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(i)*24)) < 0 {
+ rtreeSearchPointSwap(tls, p, i, k)
+ i = k
+ } else {
+ break
+ }
+ } else {
+ if rtreeSearchPointCompare(tls, ((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(j)*24), ((*RtreeCursor)(unsafe.Pointer(p)).FaPoint+uintptr(i)*24)) < 0 {
+ rtreeSearchPointSwap(tls, p, i, j)
+ i = j
+ } else {
+ break
+ }
+ }
+ }
+ }
+}
+
+// Continue the search on cursor pCur until the front of the queue
+// contains an entry suitable for returning as a result-set row,
+// or until the RtreeSearchPoint queue is empty, indicating that the
+// query has completed.
+func rtreeStepToLeaf(tls *libc.TLS, pCur uintptr) int32 { /* sqlite3.c:189652:12: */
+ bp := tls.Alloc(20)
+ defer tls.Free(20)
+
+ var p uintptr
+ var pRtree uintptr = (*RtreeCursor)(unsafe.Pointer((pCur))).Fbase.FpVtab
+ var pNode uintptr
+ // var eWithin int32 at bp+16, 4
+
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ var nCell int32
+ var nConstraint int32 = (*RtreeCursor)(unsafe.Pointer(pCur)).FnConstraint
+ var ii int32
+ var eInt int32
+ var x RtreeSearchPoint
+
+ eInt = (libc.Bool32(int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 1))
+ for ((libc.AssignUintptr(&p, rtreeSearchPointFirst(tls, pCur))) != uintptr(0)) && (int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) > 0) {
+ var pCellData uintptr
+ pNode = rtreeNodeOfFirstSearchPoint(tls, pCur, bp /* &rc */)
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+ }
+ nCell = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + uintptr(2)))
+
+ pCellData = ((*RtreeNode)(unsafe.Pointer(pNode)).FzData + uintptr((4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell)))))
+ for int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell) < nCell {
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* rScore */)) = Sqlite3_rtree_dbl(-1)
+ *(*int32)(unsafe.Pointer(bp + 16 /* eWithin */)) = 2
+ for ii = 0; ii < nConstraint; ii++ {
+ var pConstraint uintptr = ((*RtreeCursor)(unsafe.Pointer(pCur)).FaConstraint + uintptr(ii)*24)
+ if (*RtreeConstraint)(unsafe.Pointer(pConstraint)).Fop >= 0x46 {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = rtreeCallbackConstraint(tls, pConstraint, eInt, pCellData, p,
+ bp+8 /* &rScore */, bp+16 /* &eWithin */)
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+ }
+ } else if int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) == 1 {
+ rtreeLeafConstraint(tls, pConstraint, eInt, pCellData, bp+16 /* &eWithin */)
+ } else {
+ rtreeNonleafConstraint(tls, pConstraint, eInt, pCellData, bp+16 /* &eWithin */)
+ }
+ if *(*int32)(unsafe.Pointer(bp + 16 /* eWithin */)) == 0 {
+ (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell++
+ pCellData += uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)
+ break
+ }
+ }
+ if *(*int32)(unsafe.Pointer(bp + 16 /* eWithin */)) == 0 {
+ continue
+ }
+ (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell++
+ x.FiLevel = (U8(int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiLevel) - 1))
+ if x.FiLevel != 0 {
+ x.Fid = readInt64(tls, pCellData)
+ for ii = 0; ii < (*RtreeCursor)(unsafe.Pointer(pCur)).FnPoint; ii++ {
+ if (*RtreeSearchPoint)(unsafe.Pointer((*RtreeCursor)(unsafe.Pointer(pCur)).FaPoint+uintptr(ii)*24)).Fid == x.Fid {
+
+ return (11 | (int32(1) << 8))
+ }
+ }
+ x.FiCell = U8(0)
+ } else {
+ x.Fid = (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid
+ x.FiCell = (U8(int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell) - 1))
+ }
+ if int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= nCell {
+
+ rtreeSearchPointPop(tls, pCur)
+ }
+ if *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* rScore */)) < 0.0 {
+ *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* rScore */)) = 0.0
+ }
+ p = rtreeSearchPointNew(tls, pCur, *(*Sqlite3_rtree_dbl)(unsafe.Pointer(bp + 8 /* rScore */)), x.FiLevel)
+ if p == uintptr(0) {
+ return 7
+ }
+ (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(*(*int32)(unsafe.Pointer(bp + 16 /* eWithin */)))
+ (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = x.Fid
+ (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = x.FiCell
+
+ break
+ }
+ if int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell) >= nCell {
+
+ rtreeSearchPointPop(tls, pCur)
+ }
+ }
+ (*RtreeCursor)(unsafe.Pointer(pCur)).FatEOF = (U8(libc.Bool32(p == uintptr(0))))
+ return 0
+}
+
+// Rtree virtual table module xNext method.
+func rtreeNext(tls *libc.TLS, pVtabCursor uintptr) int32 { /* sqlite3.c:189733:12: */
+ var pCsr uintptr = pVtabCursor
+ var rc int32 = 0
+
+ // Move to the next entry that matches the configured constraints.
+
+ if (*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid != 0 {
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid = U8(0)
+ Xsqlite3_reset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
+ }
+ rtreeSearchPointPop(tls, pCsr)
+ rc = rtreeStepToLeaf(tls, pCsr)
+ return rc
+}
+
+// Rtree virtual table module xRowid method.
+func rtreeRowid(tls *libc.TLS, pVtabCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:189751:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var pCsr uintptr = pVtabCursor
+ var p uintptr = rtreeSearchPointFirst(tls, pCsr)
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ var pNode uintptr = rtreeNodeOfFirstSearchPoint(tls, pCsr, bp /* &rc */)
+ if (*(*int32)(unsafe.Pointer(bp /* rc */)) == 0) && (p != 0) {
+ *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = nodeGetRowid(tls, (*RtreeCursor)(unsafe.Pointer((pCsr))).Fbase.FpVtab, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell))
+ }
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+}
+
+// Rtree virtual table module xColumn method.
+func rtreeColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:189765:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pRtree uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
+ var pCsr uintptr = cur
+ var p uintptr = rtreeSearchPointFirst(tls, pCsr)
+ // var c RtreeCoord at bp+4, 4
+
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ var pNode uintptr = rtreeNodeOfFirstSearchPoint(tls, pCsr, bp /* &rc */)
+
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+ }
+ if p == uintptr(0) {
+ return 0
+ }
+ if i == 0 {
+ Xsqlite3_result_int64(tls, ctx, nodeGetRowid(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell)))
+ } else if i <= int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) {
+ nodeGetCoord(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell), (i - 1), bp+4 /* &c */)
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ Xsqlite3_result_double(tls, ctx, float64(*(*RtreeValue)(unsafe.Pointer(bp + 4 /* &c */))))
+ } else {
+
+ Xsqlite3_result_int(tls, ctx, *(*int32)(unsafe.Pointer(bp + 4 /* &c */)))
+ }
+ } else {
+ if !(int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid) != 0) {
+ if (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux == uintptr(0) {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3_prepare_v3(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql, -1, uint32(0),
+ (pCsr + 56 /* &.pReadAux */), uintptr(0))
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+ }
+ }
+ Xsqlite3_bind_int64(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, 1,
+ nodeGetRowid(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell)))
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3_step(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 100 {
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid = U8(1)
+ } else {
+ Xsqlite3_reset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 101 {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ }
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+ }
+ }
+ Xsqlite3_result_value(tls, ctx,
+ Xsqlite3_column_value(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, ((i-int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2))+1)))
+ }
+ return 0
+}
+
+// Use nodeAcquire() to obtain the leaf node containing the record with
+// rowid iRowid. If successful, set *ppLeaf to point to the node and
+// return SQLITE_OK. If there is no such record in the table, set
+// *ppLeaf to 0 and return SQLITE_OK. If an error occurs, set *ppLeaf
+// to zero and return an SQLite error code.
+func findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid I64, ppLeaf uintptr, piNode uintptr) int32 { /* sqlite3.c:189819:12: */
+ var rc int32
+ *(*uintptr)(unsafe.Pointer(ppLeaf)) = uintptr(0)
+ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 1, iRowid)
+ if Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid) == 100 {
+ var iNode I64 = Xsqlite3_column_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 0)
+ if piNode != 0 {
+ *(*Sqlite3_int64)(unsafe.Pointer(piNode)) = iNode
+ }
+ rc = nodeAcquire(tls, pRtree, iNode, uintptr(0), ppLeaf)
+ Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
+ } else {
+ rc = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
+ }
+ return rc
+}
+
+// This function is called to configure the RtreeConstraint object passed
+// as the second argument for a MATCH constraint. The value passed as the
+// first argument to this function is the right-hand operand to the MATCH
+// operator.
+func deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) int32 { /* sqlite3.c:189845:12: */
+ var pBlob uintptr
+ var pSrc uintptr // BLOB returned by geometry function
+ var pInfo uintptr // Callback information
+
+ pSrc = Xsqlite3_value_pointer(tls, pValue, ts+28429 /* "RtreeMatchArg" */)
+ if pSrc == uintptr(0) {
+ return 1
+ }
+ pInfo = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(Sqlite3_rtree_query_info{})) + uint64((*RtreeMatchArg)(unsafe.Pointer(pSrc)).FiSize))))
+ if !(pInfo != 0) {
+ return 7
+ }
+ libc.Xmemset(tls, pInfo, 0, uint64(unsafe.Sizeof(Sqlite3_rtree_query_info{})))
+ pBlob = (pInfo + uintptr(1)*112)
+ libc.Xmemcpy(tls, pBlob, pSrc, uint64((*RtreeMatchArg)(unsafe.Pointer(pSrc)).FiSize))
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FpContext = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FpContext
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FnParam = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).FnParam
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FaParam = pBlob + 56 /* &.aParam */
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer(pInfo)).FapSqlParam = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam
+
+ if (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FxGeom != 0 {
+ *(*uintptr)(unsafe.Pointer(pCons + 8 /* &.u */)) = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FxGeom
+ } else {
+ (*RtreeConstraint)(unsafe.Pointer(pCons)).Fop = 0x47
+ *(*uintptr)(unsafe.Pointer(pCons + 8 /* &.u */)) = (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb.FxQueryFunc
+ }
+ (*RtreeConstraint)(unsafe.Pointer(pCons)).FpInfo = pInfo
+ return 0
+}
+
+// Rtree virtual table module xFilter method.
+func rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:189875:12: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ var pRtree uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab
+ var pCsr uintptr = pVtabCursor
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) = uintptr(0)
+ var ii int32
+ var rc int32 = 0
+ *(*int32)(unsafe.Pointer(bp + 16 /* iCell */)) = 0
+
+ rtreeReference(tls, pRtree)
+
+ // Reset the cursor to the same state as rtreeOpen() leaves it in.
+ resetCursor(tls, pCsr)
+
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FiStrategy = idxNum
+ if idxNum == 1 {
+ // Special case - lookup by rowid.
+ // var pLeaf uintptr at bp, 8
+ // Leaf on which the required cell resides
+ var p uintptr // Search point for the leaf
+ var iRowid I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ *(*I64)(unsafe.Pointer(bp + 8 /* iNode */)) = int64(0)
+ var eType int32 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ if (eType == 1) ||
+ ((eType == 2) && (Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))) == float64(iRowid))) {
+ rc = findLeafNode(tls, pRtree, iRowid, bp /* &pLeaf */, bp+8 /* &iNode */)
+ } else {
+ rc = 0
+ *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) = uintptr(0)
+ }
+ if (rc == 0) && (*(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) != uintptr(0)) {
+ p = rtreeSearchPointNew(tls, pCsr, 0.0, uint8(0))
+ // Always returns pCsr->sPoint
+ *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */) + uintptr(0)*8)) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */))
+ (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8 /* iNode */))
+ (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(1)
+ rc = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)), iRowid, bp+16 /* &iCell */)
+ (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = U8(*(*int32)(unsafe.Pointer(bp + 16 /* iCell */)))
+ } else {
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FatEOF = U8(1)
+ }
+ } else {
+ // Normal case - r-tree scan. Set up the RtreeCursor.aConstraint array
+ // with the configured constraints.
+ rc = nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp+24 /* &pRoot */)
+ if (rc == 0) && (argc > 0) {
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(RtreeConstraint{})) * uint64(argc))))
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc
+ if !(int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint) != 0) {
+ rc = 7
+ } else {
+ libc.Xmemset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, (uint64(unsafe.Sizeof(RtreeConstraint{})) * uint64(argc)))
+ libc.Xmemset(tls, pCsr+128 /* &.anQueue */, 0, (uint64(unsafe.Sizeof(U32(0))) * (uint64((*Rtree)(unsafe.Pointer(pRtree)).FiDepth + 1))))
+
+ for ii = 0; ii < argc; ii++ {
+ var p uintptr = ((*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint + uintptr(ii)*24)
+ var eType int32 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))
+ (*RtreeConstraint)(unsafe.Pointer(p)).Fop = int32(*(*int8)(unsafe.Pointer(idxStr + uintptr((ii * 2)))))
+ (*RtreeConstraint)(unsafe.Pointer(p)).FiCoord = (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(((ii * 2) + 1))))) - '0')
+ if (*RtreeConstraint)(unsafe.Pointer(p)).Fop >= 0x46 {
+ // A MATCH operator. The right-hand-side must be a blob that
+ // can be cast into an RtreeMatchArg object. One created using
+ // an sqlite3_rtree_geometry_callback() SQL user function.
+ rc = deserializeGeometry(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)), p)
+ if rc != 0 {
+ break
+ }
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer((*RtreeConstraint)(unsafe.Pointer(p)).FpInfo)).FnCoord = int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer((*RtreeConstraint)(unsafe.Pointer(p)).FpInfo)).FanQueue = pCsr + 128 /* &.anQueue */
+ (*Sqlite3_rtree_query_info)(unsafe.Pointer((*RtreeConstraint)(unsafe.Pointer(p)).FpInfo)).FmxLevel = ((*Rtree)(unsafe.Pointer(pRtree)).FiDepth + 1)
+ } else if (eType == 1) || (eType == 2) {
+ *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))
+ } else {
+ *(*RtreeDValue)(unsafe.Pointer(p + 8 /* &.u */)) = 0.0
+ if eType == 5 {
+ (*RtreeConstraint)(unsafe.Pointer(p)).Fop = 0x40
+ } else if ((*RtreeConstraint)(unsafe.Pointer(p)).Fop == 0x43) || ((*RtreeConstraint)(unsafe.Pointer(p)).Fop == 0x42) {
+ (*RtreeConstraint)(unsafe.Pointer(p)).Fop = 0x3f
+ } else {
+ (*RtreeConstraint)(unsafe.Pointer(p)).Fop = 0x40
+ }
+ }
+ }
+ }
+ }
+ if rc == 0 {
+ var pNew uintptr
+ pNew = rtreeSearchPointNew(tls, pCsr, 0.0, (U8((*Rtree)(unsafe.Pointer(pRtree)).FiDepth + 1)))
+ if pNew == uintptr(0) {
+ return 7
+ }
+ (*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1)
+ (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0)
+ (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(1)
+
+ *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */) + uintptr(0)*8)) = *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */))
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) = uintptr(0)
+
+ rc = rtreeStepToLeaf(tls, pCsr)
+ }
+ }
+
+ nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)))
+ rtreeRelease(tls, pRtree)
+ return rc
+}
+
+// Rtree virtual table module xBestIndex method. There are three
+// table scan strategies to choose from (in order from most to
+// least desirable):
+//
+// idxNum idxStr Strategy
+// ------------------------------------------------
+// 1 Unused Direct lookup by rowid.
+// 2 See below R-tree query or full-table scan.
+// ------------------------------------------------
+//
+// If strategy 1 is used, then idxStr is not meaningful. If strategy
+// 2 is used, idxStr is formatted to contain 2 bytes for each
+// constraint used. The first two bytes of idxStr correspond to
+// the constraint in sqlite3_index_info.aConstraintUsage[] with
+// (argvIndex==1) etc.
+//
+// The first of each pair of bytes in idxStr identifies the constraint
+// operator as follows:
+//
+// Operator Byte Value
+// ----------------------
+// = 0x41 ('A')
+// <= 0x42 ('B')
+// < 0x43 ('C')
+// >= 0x44 ('D')
+// > 0x45 ('E')
+// MATCH 0x46 ('F')
+// ----------------------
+//
+// The second of each pair of bytes identifies the coordinate column
+// to which the constraint applies. The leftmost coordinate column
+// is 'a', the second from the left 'b' etc.
+func rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:190025:12: */
+ bp := tls.Alloc(49)
+ defer tls.Free(49)
+
+ var pRtree uintptr = tab
+ var rc int32 = 0
+ var ii int32
+ var bMatch int32 = 0 // True if there exists a MATCH constraint
+ var nRow I64 // Estimated rows returned by this scan
+
+ var iIdx int32 = 0
+ // var zIdxStr [41]int8 at bp+8, 41
+
+ libc.Xmemset(tls, bp+8 /* &zIdxStr[0] */, 0, uint64(unsafe.Sizeof([41]int8{})))
+
+ // Check if there exists a MATCH constraint - even an unusable one. If there
+ // is, do not consider the lookup-by-rowid plan as using such a plan would
+ // require the VDBE to evaluate the MATCH constraint, which is not currently
+ // possible.
+ for ii = 0; ii < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint; ii++ {
+ if int32((*sqlite3_index_constraint)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint+uintptr(ii)*12)).Fop) == 64 {
+ bMatch = 1
+ }
+ }
+
+ for ii = 0; (ii < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint) && (iIdx < (int32(uint64(unsafe.Sizeof([41]int8{})) - uint64(1)))); ii++ {
+ var p uintptr = ((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12)
+
+ if (((bMatch == 0) && ((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0)) &&
+ ((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn == 0)) && (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == 2) {
+ // We have an equality constraint on the rowid. Use strategy 1.
+ var jj int32
+ for jj = 0; jj < ii; jj++ {
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(jj)*8)).FargvIndex = 0
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(jj)*8)).Fomit = uint8(0)
+ }
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 1
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ii)*8)).FargvIndex = 1
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(jj)*8)).Fomit = uint8(1)
+
+ // This strategy involves a two rowid lookups on an B-Tree structures
+ // and then a linear search of an R-Tree node. This should be
+ // considered almost as quick as a direct rowid lookup (for which
+ // sqlite uses an internal cost of 0.0). It is expected to return
+ // a single row.
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 30.0
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(1)
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags = 1
+ return 0
+ }
+
+ if ((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0) &&
+ ((((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn > 0) && ((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn <= int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2))) ||
+ (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == 64)) {
+ var op U8
+ switch int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) {
+ case 2:
+ op = U8(0x41)
+ break
+ fallthrough
+ case 4:
+ op = U8(0x45)
+ break
+ fallthrough
+ case 8:
+ op = U8(0x42)
+ break
+ fallthrough
+ case 16:
+ op = U8(0x43)
+ break
+ fallthrough
+ case 32:
+ op = U8(0x44)
+ break
+ fallthrough
+ case 64:
+ op = U8(0x46)
+ break
+ fallthrough
+ default:
+ op = U8(0)
+ break
+ }
+ if op != 0 {
+ *(*int8)(unsafe.Pointer(bp + 8 /* &zIdxStr[0] */ + uintptr(libc.PostIncInt32(&iIdx, 1)))) = int8(op)
+ *(*int8)(unsafe.Pointer(bp + 8 /* &zIdxStr[0] */ + uintptr(libc.PostIncInt32(&iIdx, 1)))) = (int8(((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn - 1) + '0'))
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ii)*8)).FargvIndex = (iIdx / 2)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(ii)*8)).Fomit = uint8(1)
+ }
+ }
+ }
+
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 2
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr = 1
+ if (iIdx > 0) && (uintptr(0) == (libc.AssignPtrUintptr(pIdxInfo+48 /* &.idxStr */, Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp, bp+8 /* &zIdxStr[0] */))))) {
+ return 7
+ }
+
+ nRow = ((*Rtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / 2))
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = (6.0 * float64(nRow))
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow
+
+ return rc
+}
+
+// Return the N-dimensional volumn of the cell stored in *p.
+func cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:190114:20: */
+ var area RtreeDValue = RtreeDValue(1)
+
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ switch int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim) {
+ case 5:
+ area = (RtreeDValue(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(9)*4)) - *(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(8)*4))))
+ fallthrough
+ case 4:
+ area = area * (float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(7)*4)) - *(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(6)*4))))
+ fallthrough
+ case 3:
+ area = area * (float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(5)*4)) - *(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(4)*4))))
+ fallthrough
+ case 2:
+ area = area * (float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(3)*4)) - *(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(2)*4))))
+ fallthrough
+ default:
+ area = area * (float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(1)*4)) - *(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(0)*4))))
+ }
+ } else {
+ switch int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim) {
+ case 5:
+ area = (RtreeDValue(I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(9)*4))) - I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(8)*4)))))
+ fallthrough
+ case 4:
+ area = area * (float64(I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(7)*4))) - I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(6)*4)))))
+ fallthrough
+ case 3:
+ area = area * (float64(I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(5)*4))) - I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(4)*4)))))
+ fallthrough
+ case 2:
+ area = area * (float64(I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(3)*4))) - I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(2)*4)))))
+ fallthrough
+ default:
+ area = area * (float64(I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(1)*4))) - I64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(0)*4)))))
+ }
+ }
+ return area
+}
+
+// Return the margin length of cell p. The margin length is the sum
+// of the objects size in each dimension.
+func cellMargin(tls *libc.TLS, pRtree uintptr, p uintptr) RtreeDValue { /* sqlite3.c:190144:20: */
+ var margin RtreeDValue = RtreeDValue(0)
+ var ii int32 = (int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) - 2)
+ for ok := true; ok; ok = (ii >= 0) {
+ margin = margin + ((func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr((ii+1))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr((ii+1))*4)))
+ }()) - (func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(ii)*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(ii)*4)))
+ }()))
+ ii = ii - (2)
+ }
+ return margin
+}
+
+// Store the union of cells p1 and p2 in p1.
+func cellUnion(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:190157:13: */
+ var ii int32 = 0
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ for ok := true; ok; ok = (ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)) {
+ *(*RtreeValue)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr(ii)*4)) = func() float32 {
+ if (*(*RtreeValue)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr(ii)*4))) < (*(*RtreeValue)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr(ii)*4))) {
+ return *(*RtreeValue)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr(ii)*4))
+ }
+ return *(*RtreeValue)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr(ii)*4))
+ }()
+ *(*RtreeValue)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr((ii+1))*4)) = func() float32 {
+ if (*(*RtreeValue)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr((ii+1))*4))) > (*(*RtreeValue)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr((ii+1))*4))) {
+ return *(*RtreeValue)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr((ii+1))*4))
+ }
+ return *(*RtreeValue)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr((ii+1))*4))
+ }()
+ ii = ii + (2)
+ }
+ } else {
+ for ok1 := true; ok1; ok1 = (ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)) {
+ *(*int32)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr(ii)*4)) = func() int32 {
+ if (*(*int32)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr(ii)*4))) < (*(*int32)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr(ii)*4))) {
+ return *(*int32)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr(ii)*4))
+ }
+ return *(*int32)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr(ii)*4))
+ }()
+ *(*int32)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr((ii+1))*4)) = func() int32 {
+ if (*(*int32)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr((ii+1))*4))) > (*(*int32)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr((ii+1))*4))) {
+ return *(*int32)(unsafe.Pointer((p1 + 8 /* &.aCoord */) + uintptr((ii+1))*4))
+ }
+ return *(*int32)(unsafe.Pointer((p2 + 8 /* &.aCoord */) + uintptr((ii+1))*4))
+ }()
+ ii = ii + (2)
+ }
+ }
+}
+
+// Return true if the area covered by p2 is a subset of the area covered
+// by p1. False otherwise.
+func cellContains(tls *libc.TLS, pRtree uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:190178:12: */
+ var ii int32
+ var isInt int32 = (libc.Bool32(int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 1))
+ for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); ii = ii + (2) {
+ var a1 uintptr = ((p1 + 8 /* &.aCoord */) + uintptr(ii)*4)
+ var a2 uintptr = ((p2 + 8 /* &.aCoord */) + uintptr(ii)*4)
+ if (!(isInt != 0) && ((*(*RtreeValue)(unsafe.Pointer(a2 + uintptr(0)*4)) < *(*RtreeValue)(unsafe.Pointer(a1 + uintptr(0)*4))) || (*(*RtreeValue)(unsafe.Pointer(a2 + uintptr(1)*4)) > *(*RtreeValue)(unsafe.Pointer(a1 + uintptr(1)*4))))) ||
+ ((isInt != 0) && ((*(*int32)(unsafe.Pointer(a2 + uintptr(0)*4)) < *(*int32)(unsafe.Pointer(a1 + uintptr(0)*4))) || (*(*int32)(unsafe.Pointer(a2 + uintptr(1)*4)) > *(*int32)(unsafe.Pointer(a1 + uintptr(1)*4))))) {
+ return 0
+ }
+ }
+ return 1
+}
+
+// Return the amount cell p would grow by if it were unioned with pCell.
+func cellGrowth(tls *libc.TLS, pRtree uintptr, p uintptr, pCell uintptr) RtreeDValue { /* sqlite3.c:190196:20: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ var area RtreeDValue
+ // var cell RtreeCell at bp, 48
+
+ libc.Xmemcpy(tls, bp /* &cell */, p, uint64(unsafe.Sizeof(RtreeCell{})))
+ area = cellArea(tls, pRtree, bp /* &cell */)
+ cellUnion(tls, pRtree, bp /* &cell */, pCell)
+ return (cellArea(tls, pRtree, bp /* &cell */) - area)
+}
+
+func cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell int32) RtreeDValue { /* sqlite3.c:190205:20: */
+ var ii int32
+ var overlap RtreeDValue = 0.0
+ for ii = 0; ii < nCell; ii++ {
+ var jj int32
+ var o RtreeDValue = RtreeDValue(1)
+ for jj = 0; jj < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2); jj = jj + (2) {
+ var x1 RtreeDValue
+ var x2 RtreeDValue
+ x1 = func() float64 {
+ if (func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ }()) > (func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ }()) {
+ return func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ }()
+ }
+ return func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(jj)*4)))
+ }()
+ }()
+ x2 = func() float64 {
+ if (func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ }()) < (func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ }()) {
+ return func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((p + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ }()
+ }
+ return func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((jj+1))*4)))
+ }()
+ }()
+ if x2 < x1 {
+ o = RtreeDValue(0)
+ break
+ } else {
+ o = (o * (x2 - x1))
+ }
+ }
+ overlap = overlap + (o)
+ }
+ return overlap
+}
+
+// This function implements the ChooseLeaf algorithm from Gutman[84].
+// ChooseSubTree in r*tree terminology.
+func sChooseLeaf(tls *libc.TLS, pRtree uintptr, pCell uintptr, iHeight int32, ppLeaf uintptr) int32 { /* sqlite3.c:190237:12: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ var rc int32
+ var ii int32
+ *(*uintptr)(unsafe.Pointer(bp /* pNode */)) = uintptr(0)
+ rc = nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp /* &pNode */)
+
+ for ii = 0; (rc == 0) && (ii < ((*Rtree)(unsafe.Pointer(pRtree)).FiDepth - iHeight)); ii++ {
+ var iCell int32
+ var iBest Sqlite3_int64 = int64(0)
+
+ var fMinGrowth RtreeDValue = 0.0
+ var fMinArea RtreeDValue = 0.0
+
+ var nCell int32 = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pNode */))))).FzData + uintptr(2)))
+ // var cell RtreeCell at bp+8, 48
+
+ // var pChild uintptr at bp+56, 8
+
+ var aCell uintptr = uintptr(0)
+
+ // Select the child node which will be enlarged the least if pCell
+ // is inserted into it. Resolve ties by choosing the entry with
+ // the smallest area.
+ for iCell = 0; iCell < nCell; iCell++ {
+ var bBest int32 = 0
+ var growth RtreeDValue
+ var area RtreeDValue
+ nodeGetCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pNode */)), iCell, bp+8 /* &cell */)
+ growth = cellGrowth(tls, pRtree, bp+8 /* &cell */, pCell)
+ area = cellArea(tls, pRtree, bp+8 /* &cell */)
+ if ((iCell == 0) || (growth < fMinGrowth)) || ((growth == fMinGrowth) && (area < fMinArea)) {
+ bBest = 1
+ }
+ if bBest != 0 {
+ fMinGrowth = growth
+ fMinArea = area
+ iBest = (*RtreeCell)(unsafe.Pointer(bp + 8 /* &cell */)).FiRowid
+ }
+ }
+
+ Xsqlite3_free(tls, aCell)
+ rc = nodeAcquire(tls, pRtree, iBest, *(*uintptr)(unsafe.Pointer(bp /* pNode */)), bp+56 /* &pChild */)
+ nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pNode */)))
+ *(*uintptr)(unsafe.Pointer(bp /* pNode */)) = *(*uintptr)(unsafe.Pointer(bp + 56 /* pChild */))
+ }
+
+ *(*uintptr)(unsafe.Pointer(ppLeaf)) = *(*uintptr)(unsafe.Pointer(bp /* pNode */))
+ return rc
+}
+
+// A cell with the same content as pCell has just been inserted into
+// the node pNode. This function updates the bounding box cells in
+// all ancestor elements.
+func sAdjustTree(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr) int32 { /* sqlite3.c:190297:12: */
+ bp := tls.Alloc(56)
+ defer tls.Free(56)
+
+ var p uintptr = pNode
+ var cnt int32 = 0
+ for (*RtreeNode)(unsafe.Pointer(p)).FpParent != 0 {
+ var pParent uintptr = (*RtreeNode)(unsafe.Pointer(p)).FpParent
+ // var cell RtreeCell at bp+8, 48
+
+ // var iCell int32 at bp, 4
+
+ if ((libc.PreIncInt32(&cnt, 1)) > 1000) || (nodeParentIndex(tls, pRtree, p, bp /* &iCell */) != 0) {
+
+ return (11 | (int32(1) << 8))
+ }
+
+ nodeGetCell(tls, pRtree, pParent, *(*int32)(unsafe.Pointer(bp /* iCell */)), bp+8 /* &cell */)
+ if !(cellContains(tls, pRtree, bp+8 /* &cell */, pCell) != 0) {
+ cellUnion(tls, pRtree, bp+8 /* &cell */, pCell)
+ nodeOverwriteCell(tls, pRtree, pParent, bp+8 /* &cell */, *(*int32)(unsafe.Pointer(bp /* iCell */)))
+ }
+
+ p = pParent
+ }
+ return 0
+}
+
+// Write mapping (iRowid->iNode) to the <rtree>_rowid table.
+func rowidWrite(tls *libc.TLS, pRtree uintptr, iRowid Sqlite3_int64, iNode Sqlite3_int64) int32 { /* sqlite3.c:190328:12: */
+ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 1, iRowid)
+ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 2, iNode)
+ Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid)
+ return Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid)
+}
+
+// Write mapping (iNode->iPar) to the <rtree>_parent table.
+func parentWrite(tls *libc.TLS, pRtree uintptr, iNode Sqlite3_int64, iPar Sqlite3_int64) int32 { /* sqlite3.c:190338:12: */
+ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent, 1, iNode)
+ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent, 2, iPar)
+ Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent)
+ return Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteParent)
+}
+
+// Arguments aIdx, aDistance and aSpare all point to arrays of size
+// nIdx. The aIdx array contains the set of integers from 0 to
+// (nIdx-1) in no particular order. This function sorts the values
+// in aIdx according to the indexed values in aDistance. For
+// example, assuming the inputs:
+//
+// aIdx = { 0, 1, 2, 3 }
+// aDistance = { 5.0, 2.0, 7.0, 6.0 }
+//
+// this function sets the aIdx array to contain:
+//
+// aIdx = { 0, 1, 2, 3 }
+//
+// The aSpare array is used as temporary working space by the
+// sorting algorithm.
+func sSortByDistance(tls *libc.TLS, aIdx uintptr, nIdx int32, aDistance uintptr, aSpare uintptr) { /* sqlite3.c:190365:13: */
+ if nIdx > 1 {
+ var iLeft int32 = 0
+ var iRight int32 = 0
+
+ var nLeft int32 = (nIdx / 2)
+ var nRight int32 = (nIdx - nLeft)
+ var aLeft uintptr = aIdx
+ var aRight uintptr = (aIdx + uintptr(nLeft)*4)
+
+ sSortByDistance(tls, aLeft, nLeft, aDistance, aSpare)
+ sSortByDistance(tls, aRight, nRight, aDistance, aSpare)
+
+ libc.Xmemcpy(tls, aSpare, aLeft, (uint64(unsafe.Sizeof(int32(0))) * uint64(nLeft)))
+ aLeft = aSpare
+
+ for (iLeft < nLeft) || (iRight < nRight) {
+ if iLeft == nLeft {
+ *(*int32)(unsafe.Pointer(aIdx + uintptr((iLeft+iRight))*4)) = *(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4))
+ iRight++
+ } else if iRight == nRight {
+ *(*int32)(unsafe.Pointer(aIdx + uintptr((iLeft+iRight))*4)) = *(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4))
+ iLeft++
+ } else {
+ var fLeft RtreeDValue = *(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*8))
+ var fRight RtreeDValue = *(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*8))
+ if fLeft < fRight {
+ *(*int32)(unsafe.Pointer(aIdx + uintptr((iLeft+iRight))*4)) = *(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4))
+ iLeft++
+ } else {
+ *(*int32)(unsafe.Pointer(aIdx + uintptr((iLeft+iRight))*4)) = *(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4))
+ iRight++
+ }
+ }
+ }
+ }
+}
+
+// Arguments aIdx, aCell and aSpare all point to arrays of size
+// nIdx. The aIdx array contains the set of integers from 0 to
+// (nIdx-1) in no particular order. This function sorts the values
+// in aIdx according to dimension iDim of the cells in aCell. The
+// minimum value of dimension iDim is considered first, the
+// maximum used to break ties.
+//
+// The aSpare array is used as temporary working space by the
+// sorting algorithm.
+func sSortByDimension(tls *libc.TLS, pRtree uintptr, aIdx uintptr, nIdx int32, iDim int32, aCell uintptr, aSpare uintptr) { /* sqlite3.c:190431:13: */
+ if nIdx > 1 {
+
+ var iLeft int32 = 0
+ var iRight int32 = 0
+
+ var nLeft int32 = (nIdx / 2)
+ var nRight int32 = (nIdx - nLeft)
+ var aLeft uintptr = aIdx
+ var aRight uintptr = (aIdx + uintptr(nLeft)*4)
+
+ sSortByDimension(tls, pRtree, aLeft, nLeft, iDim, aCell, aSpare)
+ sSortByDimension(tls, pRtree, aRight, nRight, iDim, aCell, aSpare)
+
+ libc.Xmemcpy(tls, aSpare, aLeft, (uint64(unsafe.Sizeof(int32(0))) * uint64(nLeft)))
+ aLeft = aSpare
+ for (iLeft < nLeft) || (iRight < nRight) {
+ var xleft1 RtreeDValue = func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ }()
+ var xleft2 RtreeDValue = func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4)))*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ }()
+ var xright1 RtreeDValue = func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ }()
+ var xright2 RtreeDValue = func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(*(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4)))*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ }()
+ if (iLeft != nLeft) && (((iRight == nRight) ||
+ (xleft1 < xright1)) ||
+ ((xleft1 == xright1) && (xleft2 < xright2))) {
+ *(*int32)(unsafe.Pointer(aIdx + uintptr((iLeft+iRight))*4)) = *(*int32)(unsafe.Pointer(aLeft + uintptr(iLeft)*4))
+ iLeft++
+ } else {
+ *(*int32)(unsafe.Pointer(aIdx + uintptr((iLeft+iRight))*4)) = *(*int32)(unsafe.Pointer(aRight + uintptr(iRight)*4))
+ iRight++
+ }
+ }
+ }
+}
+
+// Implementation of the R*-tree variant of SplitNode from Beckman[1990].
+func splitNodeStartree(tls *libc.TLS, pRtree uintptr, aCell uintptr, nCell int32, pLeft uintptr, pRight uintptr, pBboxLeft uintptr, pBboxRight uintptr) int32 { /* sqlite3.c:190490:12: */
+ bp := tls.Alloc(96)
+ defer tls.Free(96)
+
+ var aaSorted uintptr
+ var aSpare uintptr
+ var ii int32
+
+ var iBestDim int32 = 0
+ var iBestSplit int32 = 0
+ var fBestMargin RtreeDValue = 0.0
+
+ var nByte Sqlite3_int64 = (Sqlite3_int64((uint64(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim) + 1)) * (uint64(unsafe.Sizeof(uintptr(0))) + (uint64(nCell) * uint64(unsafe.Sizeof(int32(0)))))))
+
+ aaSorted = Xsqlite3_malloc64(tls, uint64(nByte))
+ if !(aaSorted != 0) {
+ return 7
+ }
+
+ aSpare = ((aaSorted + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnDim)*8) + uintptr((int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim)*nCell))*4)
+ libc.Xmemset(tls, aaSorted, 0, uint64(nByte))
+ for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); ii++ {
+ var jj int32
+ *(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)) = ((aaSorted + uintptr((*Rtree)(unsafe.Pointer(pRtree)).FnDim)*8) + uintptr((ii*nCell))*4)
+ for jj = 0; jj < nCell; jj++ {
+ *(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)) + uintptr(jj)*4)) = jj
+ }
+ sSortByDimension(tls, pRtree, *(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)), nCell, ii, aCell, aSpare)
+ }
+
+ for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); ii++ {
+ var margin RtreeDValue = 0.0
+ var fBestOverlap RtreeDValue = 0.0
+ var fBestArea RtreeDValue = 0.0
+ var iBestLeft int32 = 0
+ var nLeft int32
+
+ for nLeft = ((((*Rtree)(unsafe.Pointer((pRtree))).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer((pRtree))).FnBytesPerCell)) / 3); nLeft <= (nCell - ((((*Rtree)(unsafe.Pointer((pRtree))).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer((pRtree))).FnBytesPerCell)) / 3)); nLeft++ {
+ // var left RtreeCell at bp, 48
+
+ // var right RtreeCell at bp+48, 48
+
+ var kk int32
+ var overlap RtreeDValue
+ var area RtreeDValue
+
+ libc.Xmemcpy(tls, bp /* &left */, (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)) + uintptr(0)*4)))*48), uint64(unsafe.Sizeof(RtreeCell{})))
+ libc.Xmemcpy(tls, bp+48 /* &right */, (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)) + uintptr((nCell-1))*4)))*48), uint64(unsafe.Sizeof(RtreeCell{})))
+ for kk = 1; kk < (nCell - 1); kk++ {
+ if kk < nLeft {
+ cellUnion(tls, pRtree, bp /* &left */, (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)) + uintptr(kk)*4)))*48))
+ } else {
+ cellUnion(tls, pRtree, bp+48 /* &right */, (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(ii)*8)) + uintptr(kk)*4)))*48))
+ }
+ }
+ margin = margin + (cellMargin(tls, pRtree, bp /* &left */))
+ margin = margin + (cellMargin(tls, pRtree, bp+48 /* &right */))
+ overlap = cellOverlap(tls, pRtree, bp /* &left */, bp+48 /* &right */, 1)
+ area = (cellArea(tls, pRtree, bp /* &left */) + cellArea(tls, pRtree, bp+48 /* &right */))
+ if ((nLeft == ((((*Rtree)(unsafe.Pointer((pRtree))).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer((pRtree))).FnBytesPerCell)) / 3)) ||
+ (overlap < fBestOverlap)) ||
+ ((overlap == fBestOverlap) && (area < fBestArea)) {
+ iBestLeft = nLeft
+ fBestOverlap = overlap
+ fBestArea = area
+ }
+ }
+
+ if (ii == 0) || (margin < fBestMargin) {
+ iBestDim = ii
+ fBestMargin = margin
+ iBestSplit = iBestLeft
+ }
+ }
+
+ libc.Xmemcpy(tls, pBboxLeft, (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(iBestDim)*8)) + uintptr(0)*4)))*48), uint64(unsafe.Sizeof(RtreeCell{})))
+ libc.Xmemcpy(tls, pBboxRight, (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(iBestDim)*8)) + uintptr(iBestSplit)*4)))*48), uint64(unsafe.Sizeof(RtreeCell{})))
+ for ii = 0; ii < nCell; ii++ {
+ var pTarget uintptr
+ if ii < iBestSplit {
+ pTarget = pLeft
+ } else {
+ pTarget = pRight
+ }
+ var pBbox uintptr
+ if ii < iBestSplit {
+ pBbox = pBboxLeft
+ } else {
+ pBbox = pBboxRight
+ }
+ var pCell uintptr = (aCell + uintptr(*(*int32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aaSorted + uintptr(iBestDim)*8)) + uintptr(ii)*4)))*48)
+ nodeInsertCell(tls, pRtree, pTarget, pCell)
+ cellUnion(tls, pRtree, pBbox, pCell)
+ }
+
+ Xsqlite3_free(tls, aaSorted)
+ return 0
+}
+
+func updateMapping(tls *libc.TLS, pRtree uintptr, iRowid I64, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:190588:12: */
+ var xSetMapping uintptr
+ xSetMapping = func() uintptr {
+ if iHeight == 0 {
+ return *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, Sqlite3_int64, Sqlite3_int64) int32
+ }{rowidWrite}))
+ }
+ return *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, Sqlite3_int64, Sqlite3_int64) int32
+ }{parentWrite}))
+ }()
+ if iHeight > 0 {
+ var pChild uintptr = nodeHashLookup(tls, pRtree, iRowid)
+ if pChild != 0 {
+ nodeRelease(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pChild)).FpParent)
+ nodeReference(tls, pNode)
+ (*RtreeNode)(unsafe.Pointer(pChild)).FpParent = pNode
+ }
+ }
+ return (*(*func(*libc.TLS, uintptr, Sqlite3_int64, Sqlite3_int64) int32)(unsafe.Pointer(&xSetMapping)))(tls, pRtree, iRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
+}
+
+func sSplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:190607:12: */
+ bp := tls.Alloc(100)
+ defer tls.Free(100)
+
+ var i int32
+ var newCellIsRight int32
+ var rc int32
+ var nCell int32
+ var aCell uintptr
+ var aiUsed uintptr
+ var pLeft uintptr
+ var pRight uintptr
+ // var leftbbox RtreeCell at bp, 48
+
+ // var rightbbox RtreeCell at bp+48, 48
+
+ var pParent uintptr
+ // var iCell int32 at bp+96, 4
+
+ var iRowid I64
+ var iRowid1 I64
+ newCellIsRight = 0
+ rc = 0
+ nCell = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + uintptr(2)))
+ pLeft = uintptr(0)
+ pRight = uintptr(0)
+
+ // Allocate an array and populate it with a copy of pCell and
+ // all cells from node pLeft. Then zero the original node.
+ aCell = Xsqlite3_malloc64(tls, (uint64((uint64(unsafe.Sizeof(RtreeCell{})) + uint64(unsafe.Sizeof(int32(0)))) * (uint64(nCell + 1)))))
+ if !(!(aCell != 0)) {
+ goto __1
+ }
+ rc = 7
+ goto splitnode_out
+__1:
+ ;
+ aiUsed = (aCell + uintptr((nCell+1))*48)
+ libc.Xmemset(tls, aiUsed, 0, (uint64(unsafe.Sizeof(int32(0))) * (uint64(nCell + 1))))
+ i = 0
+__2:
+ if !(i < nCell) {
+ goto __4
+ }
+ nodeGetCell(tls, pRtree, pNode, i, (aCell + uintptr(i)*48))
+ goto __3
+__3:
+ i++
+ goto __2
+ goto __4
+__4:
+ ;
+ nodeZero(tls, pRtree, pNode)
+ libc.Xmemcpy(tls, (aCell + uintptr(nCell)*48), pCell, uint64(unsafe.Sizeof(RtreeCell{})))
+ nCell++
+
+ if !((*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1)) {
+ goto __5
+ }
+ pRight = nodeNew(tls, pRtree, pNode)
+ pLeft = nodeNew(tls, pRtree, pNode)
+ (*Rtree)(unsafe.Pointer(pRtree)).FiDepth++
+ (*RtreeNode)(unsafe.Pointer(pNode)).FisDirty = 1
+ writeInt16(tls, (*RtreeNode)(unsafe.Pointer(pNode)).FzData, (*Rtree)(unsafe.Pointer(pRtree)).FiDepth)
+ goto __6
+__5:
+ pLeft = pNode
+ pRight = nodeNew(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pLeft)).FpParent)
+ (*RtreeNode)(unsafe.Pointer(pLeft)).FnRef++
+__6:
+ ;
+
+ if !(!(pLeft != 0) || !(pRight != 0)) {
+ goto __7
+ }
+ rc = 7
+ goto splitnode_out
+__7:
+ ;
+
+ libc.Xmemset(tls, (*RtreeNode)(unsafe.Pointer(pLeft)).FzData, 0, uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))
+ libc.Xmemset(tls, (*RtreeNode)(unsafe.Pointer(pRight)).FzData, 0, uint64((*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))
+
+ rc = splitNodeStartree(tls, pRtree, aCell, nCell, pLeft, pRight,
+ bp /* &leftbbox */, bp+48 /* &rightbbox */)
+ if !(rc != 0) {
+ goto __8
+ }
+ goto splitnode_out
+__8:
+ ;
+
+ // Ensure both child nodes have node numbers assigned to them by calling
+ // nodeWrite(). Node pRight always needs a node number, as it was created
+ // by nodeNew() above. But node pLeft sometimes already has a node number.
+ // In this case avoid the all to nodeWrite().
+ if !((0 != (libc.AssignInt32(&rc, nodeWrite(tls, pRtree, pRight)))) ||
+ ((int64(0) == (*RtreeNode)(unsafe.Pointer(pLeft)).FiNode) && (0 != (libc.AssignInt32(&rc, nodeWrite(tls, pRtree, pLeft)))))) {
+ goto __9
+ }
+ goto splitnode_out
+__9:
+ ;
+
+ (*RtreeCell)(unsafe.Pointer(bp + 48 /* &rightbbox */)).FiRowid = (*RtreeNode)(unsafe.Pointer(pRight)).FiNode
+ (*RtreeCell)(unsafe.Pointer(bp /* &leftbbox */)).FiRowid = (*RtreeNode)(unsafe.Pointer(pLeft)).FiNode
+
+ if !((*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1)) {
+ goto __10
+ }
+ rc = rtreeInsertCell(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pLeft)).FpParent, bp /* &leftbbox */, (iHeight + 1))
+ if !(rc != 0) {
+ goto __12
+ }
+ goto splitnode_out
+__12:
+ ;
+ goto __11
+__10:
+ pParent = (*RtreeNode)(unsafe.Pointer(pLeft)).FpParent
+ rc = nodeParentIndex(tls, pRtree, pLeft, bp+96 /* &iCell */)
+ if !(rc == 0) {
+ goto __13
+ }
+ nodeOverwriteCell(tls, pRtree, pParent, bp /* &leftbbox */, *(*int32)(unsafe.Pointer(bp + 96 /* iCell */)))
+ rc = sAdjustTree(tls, pRtree, pParent, bp /* &leftbbox */)
+__13:
+ ;
+ if !(rc != 0) {
+ goto __14
+ }
+ goto splitnode_out
+__14:
+ ;
+__11:
+ ;
+ if !(libc.AssignInt32(&rc, rtreeInsertCell(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pRight)).FpParent, bp+48 /* &rightbbox */, (iHeight+1))) != 0) {
+ goto __15
+ }
+ goto splitnode_out
+__15:
+ ;
+
+ i = 0
+__16:
+ if !(i < readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pRight))).FzData+uintptr(2)))) {
+ goto __18
+ }
+ iRowid = nodeGetRowid(tls, pRtree, pRight, i)
+ rc = updateMapping(tls, pRtree, iRowid, pRight, iHeight)
+ if !(iRowid == (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid) {
+ goto __19
+ }
+ newCellIsRight = 1
+__19:
+ ;
+ if !(rc != 0) {
+ goto __20
+ }
+ goto splitnode_out
+__20:
+ ;
+ goto __17
+__17:
+ i++
+ goto __16
+ goto __18
+__18:
+ ;
+ if !((*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1)) {
+ goto __21
+ }
+ i = 0
+__23:
+ if !(i < readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pLeft))).FzData+uintptr(2)))) {
+ goto __25
+ }
+ iRowid1 = nodeGetRowid(tls, pRtree, pLeft, i)
+ rc = updateMapping(tls, pRtree, iRowid1, pLeft, iHeight)
+ if !(rc != 0) {
+ goto __26
+ }
+ goto splitnode_out
+__26:
+ ;
+ goto __24
+__24:
+ i++
+ goto __23
+ goto __25
+__25:
+ ;
+ goto __22
+__21:
+ if !(newCellIsRight == 0) {
+ goto __27
+ }
+ rc = updateMapping(tls, pRtree, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid, pLeft, iHeight)
+__27:
+ ;
+__22:
+ ;
+
+ if !(rc == 0) {
+ goto __28
+ }
+ rc = nodeRelease(tls, pRtree, pRight)
+ pRight = uintptr(0)
+__28:
+ ;
+ if !(rc == 0) {
+ goto __29
+ }
+ rc = nodeRelease(tls, pRtree, pLeft)
+ pLeft = uintptr(0)
+__29:
+ ;
+
+splitnode_out:
+ nodeRelease(tls, pRtree, pRight)
+ nodeRelease(tls, pRtree, pLeft)
+ Xsqlite3_free(tls, aCell)
+ return rc
+}
+
+// If node pLeaf is not the root of the r-tree and its pParent pointer is
+// still NULL, load all ancestor nodes of pLeaf into memory and populate
+// the pLeaf->pParent chain all the way up to the root node.
+//
+// This operation is required when a row is deleted (or updated - an update
+// is implemented as a delete followed by an insert). SQLite provides the
+// rowid of the row to delete, which can be used to find the leaf on which
+// the entry resides (argument pLeaf). Once the leaf is located, this
+// function is called to determine its ancestry.
+func fixLeafParent(tls *libc.TLS, pRtree uintptr, pLeaf uintptr) int32 { /* sqlite3.c:190754:12: */
+ var rc int32 = 0
+ var pChild uintptr = pLeaf
+ for ((rc == 0) && ((*RtreeNode)(unsafe.Pointer(pChild)).FiNode != int64(1))) && ((*RtreeNode)(unsafe.Pointer(pChild)).FpParent == uintptr(0)) {
+ var rc2 int32 = 0 // sqlite3_reset() return code
+ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent, 1, (*RtreeNode)(unsafe.Pointer(pChild)).FiNode)
+ rc = Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent)
+ if rc == 100 {
+ var pTest uintptr // Used to test for reference loops
+ var iNode I64 // Node number of parent node
+
+ // Before setting pChild->pParent, test that we are not creating a
+ // loop of references (as we would if, say, pChild==pParent). We don't
+ // want to do this as it leads to a memory leak when trying to delete
+ // the referenced counted node structures.
+ iNode = Xsqlite3_column_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent, 0)
+ for pTest = pLeaf; (pTest != 0) && ((*RtreeNode)(unsafe.Pointer(pTest)).FiNode != iNode); pTest = (*RtreeNode)(unsafe.Pointer(pTest)).FpParent {
+ }
+ if !(pTest != 0) {
+ rc2 = nodeAcquire(tls, pRtree, iNode, uintptr(0), (pChild /* &.pParent */))
+ }
+ }
+ rc = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadParent)
+ if rc == 0 {
+ rc = rc2
+ }
+ if (rc == 0) && !(int32((*RtreeNode)(unsafe.Pointer(pChild)).FpParent) != 0) {
+
+ rc = (11 | (int32(1) << 8))
+ }
+ pChild = (*RtreeNode)(unsafe.Pointer(pChild)).FpParent
+ }
+ return rc
+}
+
+func removeNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, iHeight int32) int32 { /* sqlite3.c:190789:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var rc int32
+ var rc2 int32
+ var pParent uintptr = uintptr(0)
+ // var iCell int32 at bp, 4
+
+ // Remove the entry in the parent cell.
+ rc = nodeParentIndex(tls, pRtree, pNode, bp /* &iCell */)
+ if rc == 0 {
+ pParent = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent
+ (*RtreeNode)(unsafe.Pointer(pNode)).FpParent = uintptr(0)
+ rc = deleteCell(tls, pRtree, pParent, *(*int32)(unsafe.Pointer(bp /* iCell */)), (iHeight + 1))
+ }
+ rc2 = nodeRelease(tls, pRtree, pParent)
+ if rc == 0 {
+ rc = rc2
+ }
+ if rc != 0 {
+ return rc
+ }
+
+ // Remove the xxx_node entry.
+ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteNode, 1, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
+ Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteNode)
+ if 0 != (libc.AssignInt32(&rc, Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteNode))) {
+ return rc
+ }
+
+ // Remove the xxx_parent entry.
+ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteParent, 1, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
+ Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteParent)
+ if 0 != (libc.AssignInt32(&rc, Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteParent))) {
+ return rc
+ }
+
+ // Remove the node from the in-memory hash table and link it into
+ // the Rtree.pDeleted list. Its contents will be re-inserted later on.
+ nodeHashDelete(tls, pRtree, pNode)
+ (*RtreeNode)(unsafe.Pointer(pNode)).FiNode = I64(iHeight)
+ (*RtreeNode)(unsafe.Pointer(pNode)).FpNext = (*Rtree)(unsafe.Pointer(pRtree)).FpDeleted
+ (*RtreeNode)(unsafe.Pointer(pNode)).FnRef++
+ (*Rtree)(unsafe.Pointer(pRtree)).FpDeleted = pNode
+
+ return 0
+}
+
+func fixBoundingBox(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:190838:12: */
+ bp := tls.Alloc(100)
+ defer tls.Free(100)
+
+ var pParent uintptr = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent
+ var rc int32 = 0
+ if pParent != 0 {
+ // var ii int32 at bp+96, 4
+
+ var nCell int32 = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + uintptr(2)))
+ // var box RtreeCell at bp, 48
+ // Bounding box for pNode
+ nodeGetCell(tls, pRtree, pNode, 0, bp /* &box */)
+ for *(*int32)(unsafe.Pointer(bp + 96 /* ii */)) = 1; *(*int32)(unsafe.Pointer(bp + 96 /* ii */)) < nCell; *(*int32)(unsafe.Pointer(bp + 96 /* ii */))++ {
+ // var cell RtreeCell at bp+48, 48
+
+ nodeGetCell(tls, pRtree, pNode, *(*int32)(unsafe.Pointer(bp + 96 /* ii */)), bp+48 /* &cell */)
+ cellUnion(tls, pRtree, bp /* &box */, bp+48 /* &cell */)
+ }
+ (*RtreeCell)(unsafe.Pointer(bp /* &box */)).FiRowid = (*RtreeNode)(unsafe.Pointer(pNode)).FiNode
+ rc = nodeParentIndex(tls, pRtree, pNode, bp+96 /* &ii */)
+ if rc == 0 {
+ nodeOverwriteCell(tls, pRtree, pParent, bp /* &box */, *(*int32)(unsafe.Pointer(bp + 96 /* ii */)))
+ rc = fixBoundingBox(tls, pRtree, pParent)
+ }
+ }
+ return rc
+}
+
+// Delete the cell at index iCell of node pNode. After removing the
+// cell, adjust the r-tree data structure if required.
+func deleteCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, iCell int32, iHeight int32) int32 { /* sqlite3.c:190865:12: */
+ var pParent uintptr
+ var rc int32
+
+ if 0 != (libc.AssignInt32(&rc, fixLeafParent(tls, pRtree, pNode))) {
+ return rc
+ }
+
+ // Remove the cell from the node. This call just moves bytes around
+ // the in-memory node image, so it cannot fail.
+ nodeDeleteCell(tls, pRtree, pNode, iCell)
+
+ // If the node is not the tree root and now has less than the minimum
+ // number of cells, remove it from the tree. Otherwise, update the
+ // cell in the parent node so that it tightly contains the updated
+ // node.
+ pParent = (*RtreeNode)(unsafe.Pointer(pNode)).FpParent
+
+ if pParent != 0 {
+ if readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+uintptr(2))) < ((((*Rtree)(unsafe.Pointer((pRtree))).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer((pRtree))).FnBytesPerCell)) / 3) {
+ rc = removeNode(tls, pRtree, pNode, iHeight)
+ } else {
+ rc = fixBoundingBox(tls, pRtree, pNode)
+ }
+ }
+
+ return rc
+}
+
+func sReinsert(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:190896:12: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ var aOrder uintptr
+ var aSpare uintptr
+ var aCell uintptr
+ var aDistance uintptr
+ var nCell int32
+ // var aCenterCoord [5]RtreeDValue at bp, 40
+
+ var iDim int32
+ var ii int32
+ var rc int32 = 0
+ var n int32
+
+ libc.Xmemset(tls, bp /* &aCenterCoord[0] */, 0, (uint64(unsafe.Sizeof(RtreeDValue(0))) * uint64(5)))
+
+ nCell = (readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData+uintptr(2))) + 1)
+ n = ((nCell + 1) & (^int32(libc.Int32FromInt32(1))))
+
+ // Allocate the buffers used by this operation. The allocation is
+ // relinquished before this function returns.
+ aCell = Xsqlite3_malloc64(tls, (uint64(uint64(n) * (((uint64(unsafe.Sizeof(RtreeCell{})) + uint64(unsafe.Sizeof(int32(0)))) + uint64(unsafe.Sizeof(int32(0)))) + uint64(unsafe.Sizeof(RtreeDValue(0)))))))
+ if !(aCell != 0) {
+ return 7
+ }
+ aOrder = (aCell + uintptr(n)*48)
+ aSpare = (aOrder + uintptr(n)*4)
+ aDistance = (aSpare + uintptr(n)*4)
+
+ for ii = 0; ii < nCell; ii++ {
+ if ii == (nCell - 1) {
+ libc.Xmemcpy(tls, (aCell + uintptr(ii)*48), pCell, uint64(unsafe.Sizeof(RtreeCell{})))
+ } else {
+ nodeGetCell(tls, pRtree, pNode, ii, (aCell + uintptr(ii)*48))
+ }
+ *(*int32)(unsafe.Pointer(aOrder + uintptr(ii)*4)) = ii
+ for iDim = 0; iDim < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); iDim++ {
+ *(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord */ + uintptr(iDim)*8)) += (func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ }())
+ *(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord */ + uintptr(iDim)*8)) += (func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ }())
+ }
+ }
+ for iDim = 0; iDim < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); iDim++ {
+ *(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord[0] */ + uintptr(iDim)*8)) = (*(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord[0] */ + uintptr(iDim)*8)) / (float64(nCell) * RtreeDValue(2)))
+ }
+
+ for ii = 0; ii < nCell; ii++ {
+ *(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(ii)*8)) = 0.0
+ for iDim = 0; iDim < int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim); iDim++ {
+ var coord RtreeDValue = ((func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr(((iDim*2)+1))*4)))
+ }()) - (func() float64 {
+ if int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0 {
+ return float64(*(*RtreeValue)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ }
+ return float64(*(*int32)(unsafe.Pointer((aCell + uintptr(ii)*48 + 8 /* &.aCoord */) + uintptr((iDim*2))*4)))
+ }()))
+ *(*RtreeDValue)(unsafe.Pointer(aDistance + uintptr(ii)*8)) += ((coord - *(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord[0] */ + uintptr(iDim)*8))) * (coord - *(*RtreeDValue)(unsafe.Pointer(bp /* &aCenterCoord[0] */ + uintptr(iDim)*8))))
+ }
+ }
+
+ sSortByDistance(tls, aOrder, nCell, aDistance, aSpare)
+ nodeZero(tls, pRtree, pNode)
+
+ for ii = 0; (rc == 0) && (ii < (nCell - (((((*Rtree)(unsafe.Pointer((pRtree))).FiNodeSize - 4) / int32((*Rtree)(unsafe.Pointer((pRtree))).FnBytesPerCell)) / 3) + 1))); ii++ {
+ var p uintptr = (aCell + uintptr(*(*int32)(unsafe.Pointer(aOrder + uintptr(ii)*4)))*48)
+ nodeInsertCell(tls, pRtree, pNode, p)
+ if (*RtreeCell)(unsafe.Pointer(p)).FiRowid == (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid {
+ if iHeight == 0 {
+ rc = rowidWrite(tls, pRtree, (*RtreeCell)(unsafe.Pointer(p)).FiRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
+ } else {
+ rc = parentWrite(tls, pRtree, (*RtreeCell)(unsafe.Pointer(p)).FiRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
+ }
+ }
+ }
+ if rc == 0 {
+ rc = fixBoundingBox(tls, pRtree, pNode)
+ }
+ for ; (rc == 0) && (ii < nCell); ii++ {
+ // Find a node to store this cell in. pNode->iNode currently contains
+ // the height of the sub-tree headed by the cell.
+ // var pInsert uintptr at bp+40, 8
+
+ var p uintptr = (aCell + uintptr(*(*int32)(unsafe.Pointer(aOrder + uintptr(ii)*4)))*48)
+ rc = sChooseLeaf(tls, pRtree, p, iHeight, bp+40 /* &pInsert */)
+ if rc == 0 {
+ var rc2 int32
+ rc = rtreeInsertCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 40 /* pInsert */)), p, iHeight)
+ rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 40 /* pInsert */)))
+ if rc == 0 {
+ rc = rc2
+ }
+ }
+ }
+
+ Xsqlite3_free(tls, aCell)
+ return rc
+}
+
+// Insert cell pCell into node pNode. Node pNode is the head of a
+// subtree iHeight high (leaf nodes have iHeight==0).
+func rtreeInsertCell(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHeight int32) int32 { /* sqlite3.c:191001:12: */
+ var rc int32 = 0
+ if iHeight > 0 {
+ var pChild uintptr = nodeHashLookup(tls, pRtree, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid)
+ if pChild != 0 {
+ nodeRelease(tls, pRtree, (*RtreeNode)(unsafe.Pointer(pChild)).FpParent)
+ nodeReference(tls, pNode)
+ (*RtreeNode)(unsafe.Pointer(pChild)).FpParent = pNode
+ }
+ }
+ if nodeInsertCell(tls, pRtree, pNode, pCell) != 0 {
+ if (iHeight <= (*Rtree)(unsafe.Pointer(pRtree)).FiReinsertHeight) || ((*RtreeNode)(unsafe.Pointer(pNode)).FiNode == int64(1)) {
+ rc = sSplitNode(tls, pRtree, pNode, pCell, iHeight)
+ } else {
+ (*Rtree)(unsafe.Pointer(pRtree)).FiReinsertHeight = iHeight
+ rc = sReinsert(tls, pRtree, pNode, pCell, iHeight)
+ }
+ } else {
+ rc = sAdjustTree(tls, pRtree, pNode, pCell)
+ if rc == 0 {
+ if iHeight == 0 {
+ rc = rowidWrite(tls, pRtree, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
+ } else {
+ rc = parentWrite(tls, pRtree, (*RtreeCell)(unsafe.Pointer(pCell)).FiRowid, (*RtreeNode)(unsafe.Pointer(pNode)).FiNode)
+ }
+ }
+ }
+ return rc
+}
+
+func reinsertNodeContent(tls *libc.TLS, pRtree uintptr, pNode uintptr) int32 { /* sqlite3.c:191036:12: */
+ bp := tls.Alloc(56)
+ defer tls.Free(56)
+
+ var ii int32
+ var rc int32 = 0
+ var nCell int32 = readInt16(tls, ((*RtreeNode)(unsafe.Pointer((pNode))).FzData + uintptr(2)))
+
+ for ii = 0; (rc == 0) && (ii < nCell); ii++ {
+ // var pInsert uintptr at bp+48, 8
+
+ // var cell RtreeCell at bp, 48
+
+ nodeGetCell(tls, pRtree, pNode, ii, bp /* &cell */)
+
+ // Find a node to store this cell in. pNode->iNode currently contains
+ // the height of the sub-tree headed by the cell.
+ rc = sChooseLeaf(tls, pRtree, bp /* &cell */, int32((*RtreeNode)(unsafe.Pointer(pNode)).FiNode), bp+48 /* &pInsert */)
+ if rc == 0 {
+ var rc2 int32
+ rc = rtreeInsertCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 48 /* pInsert */)), bp /* &cell */, int32((*RtreeNode)(unsafe.Pointer(pNode)).FiNode))
+ rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 48 /* pInsert */)))
+ if rc == 0 {
+ rc = rc2
+ }
+ }
+ }
+ return rc
+}
+
+// Select a currently unused rowid for a new r-tree record.
+func rtreeNewRowid(tls *libc.TLS, pRtree uintptr, piRowid uintptr) int32 { /* sqlite3.c:191065:12: */
+ var rc int32
+ Xsqlite3_bind_null(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 1)
+ Xsqlite3_bind_null(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid, 2)
+ Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid)
+ rc = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpWriteRowid)
+ *(*I64)(unsafe.Pointer(piRowid)) = Xsqlite3_last_insert_rowid(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb)
+ return rc
+}
+
+// Remove the entry with rowid=iDelete from the r-tree structure.
+func rtreeDeleteRowid(tls *libc.TLS, pRtree uintptr, iDelete Sqlite3_int64) int32 { /* sqlite3.c:191078:12: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ var rc int32 // Return code
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pLeaf */)) = uintptr(0) // Leaf node containing record iDelete
+ // var iCell int32 at bp+16, 4
+ // Index of iDelete cell in pLeaf
+ *(*uintptr)(unsafe.Pointer(bp /* pRoot */)) = uintptr(0) // Root node of rtree structure
+
+ // Obtain a reference to the root node to initialize Rtree.iDepth
+ rc = nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp /* &pRoot */)
+
+ // Obtain a reference to the leaf node that contains the entry
+ // about to be deleted.
+ if rc == 0 {
+ rc = findLeafNode(tls, pRtree, iDelete, bp+8 /* &pLeaf */, uintptr(0))
+ }
+
+ // Delete the cell in question from the leaf node.
+ if (rc == 0) && (*(*uintptr)(unsafe.Pointer(bp + 8 /* pLeaf */)) != 0) {
+ var rc2 int32
+ rc = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 8 /* pLeaf */)), iDelete, bp+16 /* &iCell */)
+ if rc == 0 {
+ rc = deleteCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 8 /* pLeaf */)), *(*int32)(unsafe.Pointer(bp + 16 /* iCell */)), 0)
+ }
+ rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 8 /* pLeaf */)))
+ if rc == 0 {
+ rc = rc2
+ }
+ }
+
+ // Delete the corresponding entry in the <rtree>_rowid table.
+ if rc == 0 {
+ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteRowid, 1, iDelete)
+ Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteRowid)
+ rc = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpDeleteRowid)
+ }
+
+ // Check if the root node now has exactly one child. If so, remove
+ // it, schedule the contents of the child for reinsertion and
+ // reduce the tree height by one.
+ //
+ // This is equivalent to copying the contents of the child into
+ // the root node (the operation that Gutman's paper says to perform
+ // in this scenario).
+ if ((rc == 0) && ((*Rtree)(unsafe.Pointer(pRtree)).FiDepth > 0)) && (readInt16(tls, ((*RtreeNode)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pRoot */))))).FzData+uintptr(2))) == 1) {
+ var rc2 int32
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pChild */)) = uintptr(0)
+ var iChild I64 = nodeGetRowid(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pRoot */)), 0)
+ rc = nodeAcquire(tls, pRtree, iChild, *(*uintptr)(unsafe.Pointer(bp /* pRoot */)), bp+24 /* &pChild */)
+ if rc == 0 {
+ rc = removeNode(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 24 /* pChild */)), ((*Rtree)(unsafe.Pointer(pRtree)).FiDepth - 1))
+ }
+ rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 24 /* pChild */)))
+ if rc == 0 {
+ rc = rc2
+ }
+ if rc == 0 {
+ (*Rtree)(unsafe.Pointer(pRtree)).FiDepth--
+ writeInt16(tls, (*RtreeNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pRoot */)))).FzData, (*Rtree)(unsafe.Pointer(pRtree)).FiDepth)
+ (*RtreeNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pRoot */)))).FisDirty = 1
+ }
+ }
+
+ // Re-insert the contents of any underfull nodes removed from the tree.
+ for *(*uintptr)(unsafe.Pointer(bp + 8 /* pLeaf */)) = (*Rtree)(unsafe.Pointer(pRtree)).FpDeleted; *(*uintptr)(unsafe.Pointer(bp + 8 /* pLeaf */)) != 0; *(*uintptr)(unsafe.Pointer(bp + 8 /* pLeaf */)) = (*Rtree)(unsafe.Pointer(pRtree)).FpDeleted {
+ if rc == 0 {
+ rc = reinsertNodeContent(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 8 /* pLeaf */)))
+ }
+ (*Rtree)(unsafe.Pointer(pRtree)).FpDeleted = (*RtreeNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pLeaf */)))).FpNext
+ (*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef--
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pLeaf */)))
+ }
+
+ // Release the reference to the root node.
+ if rc == 0 {
+ rc = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pRoot */)))
+ } else {
+ nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pRoot */)))
+ }
+
+ return rc
+}
+
+// Rounding constants for float->double conversion.
+
+// Convert an sqlite3_value into an RtreeValue (presumably a float)
+// while taking care to round toward negative or positive, respectively.
+func rtreeValueDown(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:191175:19: */
+ var d float64 = Xsqlite3_value_double(tls, v)
+ var f float32 = float32(d)
+ if float64(f) > d {
+ f = (float32(d * (func() float64 {
+ if d < float64(0) {
+ return (float64(1.0) + (float64(1.0) / 8388608.0))
+ }
+ return (float64(1.0) - (float64(1.0) / 8388608.0))
+ }())))
+ }
+ return f
+}
+func rtreeValueUp(tls *libc.TLS, v uintptr) RtreeValue { /* sqlite3.c:191183:19: */
+ var d float64 = Xsqlite3_value_double(tls, v)
+ var f float32 = float32(d)
+ if float64(f) < d {
+ f = (float32(d * (func() float64 {
+ if d < float64(0) {
+ return (float64(1.0) - (float64(1.0) / 8388608.0))
+ }
+ return (float64(1.0) + (float64(1.0) / 8388608.0))
+ }())))
+ }
+ return f
+}
+
+// A constraint has failed while inserting a row into an rtree table.
+// Assuming no OOM error occurs, this function sets the error message
+// (at pRtree->base.zErrMsg) to an appropriate value and returns
+// SQLITE_CONSTRAINT.
+//
+// Parameter iCol is the index of the leftmost column involved in the
+// constraint failure. If it is 0, then the constraint that failed is
+// the unique constraint on the id column. Otherwise, it is the rtree
+// (c1<=c2) constraint on columns iCol and iCol+1 that has failed.
+//
+// If an OOM occurs, SQLITE_NOMEM is returned instead of SQLITE_CONSTRAINT.
+func rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) int32 { /* sqlite3.c:191206:12: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)) = uintptr(0)
+ var zSql uintptr
+ var rc int32
+
+ zSql = Xsqlite3_mprintf(tls, ts+28443 /* "SELECT * FROM %Q..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
+ if zSql != 0 {
+ rc = Xsqlite3_prepare_v2(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -1, bp+56 /* &pStmt */, uintptr(0))
+ } else {
+ rc = 7
+ }
+ Xsqlite3_free(tls, zSql)
+
+ if rc == 0 {
+ if iCol == 0 {
+ var zCol uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), 0)
+ (*Rtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
+ ts+28463 /* "UNIQUE constrain..." */, libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol))
+ } else {
+ var zCol1 uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), iCol)
+ var zCol2 uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)), (iCol + 1))
+ (*Rtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
+ ts+28495 /* "rtree constraint..." */, libc.VaList(bp+32, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2))
+ }
+ }
+
+ Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pStmt */)))
+ return func() int32 {
+ if rc == 0 {
+ return 19
+ }
+ return rc
+ }()
+}
+
+// The xUpdate method for rtree module virtual tables.
+func rtreeUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:191244:12: */
+ bp := tls.Alloc(56)
+ defer tls.Free(56)
+
+ var pRtree uintptr
+ var rc int32
+ // var cell RtreeCell at bp, 48
+ // New cell to insert if nData>1
+ var bHaveRowid int32
+ var steprc int32
+ var ii int32
+ var nn int32
+ var rc2 int32
+ var pUp uintptr
+ var jj int32
+ // Insert the new record into the r-tree
+ // var pLeaf uintptr at bp+48, 8
+ pRtree = pVtab
+ rc = 0
+ bHaveRowid = 0 // Set to 1 after new rowid is determined
+
+ if !((*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef != 0) {
+ goto __1
+ }
+ // Unable to write to the btree while another cursor is reading from it,
+ // since the write might do a rebalance which would disrupt the read
+ // cursor.
+ return (6 | (int32(2) << 8))
+__1:
+ ;
+ rtreeReference(tls, pRtree)
+
+ (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid = int64(0) // Used only to suppress a compiler warning
+
+ // Constraint handling. A write operation on an r-tree table may return
+ // SQLITE_CONSTRAINT for two reasons:
+ //
+ // 1. A duplicate rowid value, or
+ // 2. The supplied data violates the "x2>=x1" constraint.
+ //
+ // In the first case, if the conflict-handling mode is REPLACE, then
+ // the conflicting row can be removed before proceeding. In the second
+ // case, SQLITE_CONSTRAINT must be returned regardless of the
+ // conflict-handling mode specified by the user.
+ if !(nData > 1) {
+ goto __2
+ }
+ nn = (nData - 4)
+
+ if !(nn > int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)) {
+ goto __3
+ }
+ nn = int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)
+__3:
+ ;
+ // Populate the cell.aCoord[] array. The first coordinate is aData[3].
+ //
+ // NB: nData can only be less than nDim*2+3 if the rtree is mis-declared
+ // with "column" that are interpreted as table constraints.
+ // Example: CREATE VIRTUAL TABLE bad USING rtree(x,y,CHECK(y>5));
+ // This problem was discovered after years of use, so we silently ignore
+ // these kinds of misdeclared tables to avoid breaking any legacy.
+
+ if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FeCoordType) == 0) {
+ goto __4
+ }
+ ii = 0
+__6:
+ if !(ii < nn) {
+ goto __8
+ }
+ *(*RtreeValue)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr(ii)*4)) = rtreeValueDown(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr((ii+3))*8)))
+ *(*RtreeValue)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr((ii+1))*4)) = rtreeValueUp(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr((ii+4))*8)))
+ if !(*(*RtreeValue)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr(ii)*4)) > *(*RtreeValue)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr((ii+1))*4))) {
+ goto __9
+ }
+ rc = rtreeConstraintError(tls, pRtree, (ii + 1))
+ goto constraint
+__9:
+ ;
+ goto __7
+__7:
+ ii = ii + (2)
+ goto __6
+ goto __8
+__8:
+ ;
+ goto __5
+__4:
+
+ ii = 0
+__10:
+ if !(ii < nn) {
+ goto __12
+ }
+ *(*int32)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr(ii)*4)) = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr((ii+3))*8)))
+ *(*int32)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr((ii+1))*4)) = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr((ii+4))*8)))
+ if !(*(*int32)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr(ii)*4)) > *(*int32)(unsafe.Pointer((bp /* &cell */ + 8 /* &.aCoord */) + uintptr((ii+1))*4))) {
+ goto __13
+ }
+ rc = rtreeConstraintError(tls, pRtree, (ii + 1))
+ goto constraint
+__13:
+ ;
+ goto __11
+__11:
+ ii = ii + (2)
+ goto __10
+ goto __12
+__12:
+ ;
+__5:
+ ;
+
+ // If a rowid value was supplied, check if it is already present in
+ // the table. If so, the constraint has failed.
+ if !(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(2)*8))) != 5) {
+ goto __14
+ }
+ (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(2)*8)))
+ if !((Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(0)*8))) == 5) ||
+ (Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(0)*8))) != (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid)) {
+ goto __15
+ }
+ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 1, (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid)
+ steprc = Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
+ rc = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
+ if !(100 == steprc) {
+ goto __16
+ }
+ if !(Xsqlite3_vtab_on_conflict(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb) == 5) {
+ goto __17
+ }
+ rc = rtreeDeleteRowid(tls, pRtree, (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid)
+ goto __18
+__17:
+ rc = rtreeConstraintError(tls, pRtree, 0)
+ goto constraint
+__18:
+ ;
+__16:
+ ;
+__15:
+ ;
+ bHaveRowid = 1
+__14:
+ ;
+__2:
+ ;
+
+ // If aData[0] is not an SQL NULL value, it is the rowid of a
+ // record to delete from the r-tree table. The following block does
+ // just that.
+ if !(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(0)*8))) != 5) {
+ goto __19
+ }
+ rc = rtreeDeleteRowid(tls, pRtree, Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(0)*8))))
+__19:
+ ;
+
+ // If the aData[] array contains more than one element, elements
+ // (aData[2]..aData[argc-1]) contain a new record to insert into
+ // the r-tree structure.
+ if !((rc == 0) && (nData > 1)) {
+ goto __20
+ }
+ // Insert the new record into the r-tree
+ *(*uintptr)(unsafe.Pointer(bp + 48 /* pLeaf */)) = uintptr(0)
+
+ // Figure out the rowid of the new row.
+ if !(bHaveRowid == 0) {
+ goto __21
+ }
+ rc = rtreeNewRowid(tls, pRtree, (bp /* &cell */ /* &.iRowid */))
+__21:
+ ;
+ *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid
+
+ if !(rc == 0) {
+ goto __22
+ }
+ rc = sChooseLeaf(tls, pRtree, bp /* &cell */, 0, bp+48 /* &pLeaf */)
+__22:
+ ;
+ if !(rc == 0) {
+ goto __23
+ }
+ (*Rtree)(unsafe.Pointer(pRtree)).FiReinsertHeight = -1
+ rc = rtreeInsertCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 48 /* pLeaf */)), bp /* &cell */, 0)
+ rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 48 /* pLeaf */)))
+ if !(rc == 0) {
+ goto __24
+ }
+ rc = rc2
+__24:
+ ;
+__23:
+ ;
+ if !((rc == 0) && ((*Rtree)(unsafe.Pointer(pRtree)).FnAux != 0)) {
+ goto __25
+ }
+ pUp = (*Rtree)(unsafe.Pointer(pRtree)).FpWriteAux
+ Xsqlite3_bind_int64(tls, pUp, 1, *(*Sqlite_int64)(unsafe.Pointer(pRowid)))
+ jj = 0
+__26:
+ if !(jj < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux)) {
+ goto __28
+ }
+ Xsqlite3_bind_value(tls, pUp, (jj + 2), *(*uintptr)(unsafe.Pointer(aData + uintptr(((int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2)+3)+jj))*8)))
+ goto __27
+__27:
+ jj++
+ goto __26
+ goto __28
+__28:
+ ;
+ Xsqlite3_step(tls, pUp)
+ rc = Xsqlite3_reset(tls, pUp)
+__25:
+ ;
+__20:
+ ;
+
+constraint:
+ rtreeRelease(tls, pRtree)
+ return rc
+}
+
+// Called when a transaction starts.
+func rtreeBeginTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:191392:12: */
+ var pRtree uintptr = pVtab
+
+ (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans++
+ return 0
+}
+
+// Called when a transaction completes (either by COMMIT or ROLLBACK).
+// The sqlite3_blob object should be released at this point.
+func rtreeEndTransaction(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:191403:12: */
+ var pRtree uintptr = pVtab
+ (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = U8(0)
+ nodeBlobReset(tls, pRtree)
+ return 0
+}
+
+// The xRename method for rtree module virtual tables.
+func rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) int32 { /* sqlite3.c:191413:12: */
+ bp := tls.Alloc(72)
+ defer tls.Free(72)
+
+ var pRtree uintptr = pVtab
+ var rc int32 = 7
+ var zSql uintptr = Xsqlite3_mprintf(tls,
+
+ ts+28532 /* "ALTER TABLE %Q.'..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName, zNewName))
+ if zSql != 0 {
+ nodeBlobReset(tls, pRtree)
+ rc = Xsqlite3_exec(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0))
+ Xsqlite3_free(tls, zSql)
+ }
+ return rc
+}
+
+// The xSavepoint method.
+//
+// This module does not need to do anything to support savepoints. However,
+// it uses this hook to close any open blob handle. This is done because a
+// DROP TABLE command - which fortunately always opens a savepoint - cannot
+// succeed if there are any open blob handles. i.e. if the blob handle were
+// not closed here, the following would fail:
+//
+// BEGIN;
+// INSERT INTO rtree...
+// DROP TABLE <tablename>; -- Would fail with SQLITE_LOCKED
+// COMMIT;
+func rtreeSavepoint(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:191446:12: */
+ var pRtree uintptr = pVtab
+ var iwt U8 = (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans
+ _ = iSavepoint
+ (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = U8(0)
+ nodeBlobReset(tls, pRtree)
+ (*Rtree)(unsafe.Pointer(pRtree)).FinWrTrans = iwt
+ return 0
+}
+
+// This function populates the pRtree->nRowEst variable with an estimate
+// of the number of rows in the virtual table. If possible, this is based
+// on sqlite_stat1 data. Otherwise, use RTREE_DEFAULT_ROWEST.
+func rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) int32 { /* sqlite3.c:191461:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var zFmt uintptr = ts + 28677 /* "SELECT stat FROM..." */
+ var zSql uintptr
+ // var p uintptr at bp+16, 8
+
+ var rc int32
+ var nRow I64 = int64(0)
+
+ rc = Xsqlite3_table_column_metadata(tls,
+ db, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, ts+12438 /* "sqlite_stat1" */, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0))
+ if rc != 0 {
+ (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(1048576)
+ if rc == 1 {
+ return 0
+ }
+ return rc
+ }
+ zSql = Xsqlite3_mprintf(tls, zFmt, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
+ if zSql == uintptr(0) {
+ rc = 7
+ } else {
+ rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp+16 /* &p */, uintptr(0))
+ if rc == 0 {
+ if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */))) == 100 {
+ nRow = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */)), 0)
+ }
+ rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p */)))
+ } else if rc != 7 {
+ rc = 0
+ }
+
+ if rc == 0 {
+ if nRow == int64(0) {
+ (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(1048576)
+ } else {
+ (*Rtree)(unsafe.Pointer(pRtree)).FnRowEst = func() int64 {
+ if (nRow) > (int64(100)) {
+ return nRow
+ }
+ return int64(100)
+ }()
+ }
+ }
+ Xsqlite3_free(tls, zSql)
+ }
+
+ return rc
+}
+
+// Return true if zName is the extension on one of the shadow tables used
+// by this module.
+func rtreeShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:191505:12: */
+ var i uint32
+ for i = uint32(0); uint64(i) < (uint64(unsafe.Sizeof(azName1)) / uint64(unsafe.Sizeof(uintptr(0)))); i++ {
+ if Xsqlite3_stricmp(tls, zName, azName1[i]) == 0 {
+ return 1
+ }
+ }
+ return 0
+}
+
+var azName1 = [3]uintptr{
+ ts + 28733 /* "node" */, ts + 6757 /* "parent" */, ts + 10045, /* "rowid" */
+} /* sqlite3.c:191506:21 */
+
+var rtreeModule = Sqlite3_module{FiVersion: 3, FxCreate: // iVersion
+0, FxConnect:// xCreate - create a table
+0, FxBestIndex:// xConnect - connect to an existing table
+0, FxDisconnect:// xBestIndex - Determine search strategy
+0, FxDestroy:// xDisconnect - Disconnect from a table
+0, FxOpen:// xDestroy - Drop a table
+0, FxClose:// xOpen - open a cursor
+0, FxFilter:// xClose - close a cursor
+0, FxNext:// xFilter - configure scan constraints
+0, FxEof:// xNext - advance a cursor
+0, FxColumn:// xEof
+0, FxRowid:// xColumn - read data
+0, FxUpdate:// xRowid - read data
+0, FxBegin:// xUpdate - write data
+0, FxSync:// xBegin - begin transaction
+0, FxCommit:// xSync - sync transaction
+0, FxRollback:// xCommit - commit transaction
+0, FxFindFunction:// xRollback - rollback transaction
+uintptr(0), FxRename:// xFindFunction - function overloading
+0, FxSavepoint:// xRename - rename the table
+0, FxRelease:// xSavepoint
+uintptr(0), FxRollbackTo:// xRelease
+uintptr(0), FxShadowName:// xRollbackTo
+0, // xShadowName
+} /* sqlite3.c:191516:23 */
+
+func rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPrefix uintptr, isCreate int32) int32 { /* sqlite3.c:191543:12: */
+ bp := tls.Alloc(232)
+ defer tls.Free(232)
+
+ var rc int32 = 0
+ // var appStmt [8]uintptr at bp+168, 64
+
+ var i int32
+ var f int32 = (0x01 | 0x04)
+
+ (*Rtree)(unsafe.Pointer(pRtree)).Fdb = db
+
+ if isCreate != 0 {
+ var zCreate uintptr
+ var p uintptr = Xsqlite3_str_new(tls, db)
+ var ii int32
+ Xsqlite3_str_appendf(tls, p,
+ ts+28738, /* "CREATE TABLE \"%w..." */
+ libc.VaList(bp, zDb, zPrefix))
+ for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux); ii++ {
+ Xsqlite3_str_appendf(tls, p, ts+28800 /* ",a%d" */, libc.VaList(bp+16, ii))
+ }
+ Xsqlite3_str_appendf(tls, p,
+ ts+28805, /* ");CREATE TABLE \"..." */
+ libc.VaList(bp+24, zDb, zPrefix))
+ Xsqlite3_str_appendf(tls, p,
+ ts+28869, /* "CREATE TABLE \"%w..." */
+ libc.VaList(bp+40, zDb, zPrefix))
+ Xsqlite3_str_appendf(tls, p,
+ ts+28939, /* "INSERT INTO \"%w\"..." */
+ libc.VaList(bp+56, zDb, zPrefix, (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize))
+ zCreate = Xsqlite3_str_finish(tls, p)
+ if !(zCreate != 0) {
+ return 7
+ }
+ rc = Xsqlite3_exec(tls, db, zCreate, uintptr(0), uintptr(0), uintptr(0))
+ Xsqlite3_free(tls, zCreate)
+ if rc != 0 {
+ return rc
+ }
+ }
+
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + uintptr(0)*8)) = (pRtree + 120 /* &.pWriteNode */)
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + uintptr(1)*8)) = (pRtree + 128 /* &.pDeleteNode */)
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + uintptr(2)*8)) = (pRtree + 136 /* &.pReadRowid */)
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + uintptr(3)*8)) = (pRtree + 144 /* &.pWriteRowid */)
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + uintptr(4)*8)) = (pRtree + 152 /* &.pDeleteRowid */)
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + uintptr(5)*8)) = (pRtree + 160 /* &.pReadParent */)
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + uintptr(6)*8)) = (pRtree + 168 /* &.pWriteParent */)
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + uintptr(7)*8)) = (pRtree + 176 /* &.pDeleteParent */)
+
+ rc = rtreeQueryStat1(tls, db, pRtree)
+ for i = 0; (i < 8) && (rc == 0); i++ {
+ var zSql uintptr
+ var zFormat uintptr
+ if (i != 3) || (int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux) == 0) {
+ zFormat = azSql[i]
+ } else {
+ // An UPSERT is very slightly slower than REPLACE, but it is needed
+ // if there are auxiliary columns
+ zFormat = ts + 28988 /* "INSERT INTO\"%w\"...." */
+ }
+ zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+80, zDb, zPrefix))
+ if zSql != 0 {
+ rc = Xsqlite3_prepare_v3(tls, db, zSql, -1, uint32(f), *(*uintptr)(unsafe.Pointer(bp + 168 /* &appStmt[0] */ + uintptr(i)*8)), uintptr(0))
+ } else {
+ rc = 7
+ }
+ Xsqlite3_free(tls, zSql)
+ }
+ if (*Rtree)(unsafe.Pointer(pRtree)).FnAux != 0 {
+ (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls,
+ ts+29096, /* "SELECT * FROM \"%..." */
+ libc.VaList(bp+96, zDb, zPrefix))
+ if (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) {
+ rc = 7
+ } else {
+ var p uintptr = Xsqlite3_str_new(tls, db)
+ var ii int32
+ var zSql uintptr
+ Xsqlite3_str_appendf(tls, p, ts+29141 /* "UPDATE \"%w\".\"%w_..." */, libc.VaList(bp+112, zDb, zPrefix))
+ for ii = 0; ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux); ii++ {
+ if ii != 0 {
+ Xsqlite3_str_append(tls, p, ts+13896 /* "," */, 1)
+ }
+ if ii < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) {
+ Xsqlite3_str_appendf(tls, p, ts+29168 /* "a%d=coalesce(?%d..." */, libc.VaList(bp+128, ii, (ii+2), ii))
+ } else {
+ Xsqlite3_str_appendf(tls, p, ts+29190 /* "a%d=?%d" */, libc.VaList(bp+152, ii, (ii+2)))
+ }
+ }
+ Xsqlite3_str_appendf(tls, p, ts+29198 /* " WHERE rowid=?1" */, 0)
+ zSql = Xsqlite3_str_finish(tls, p)
+ if zSql == uintptr(0) {
+ rc = 7
+ } else {
+ rc = Xsqlite3_prepare_v3(tls, db, zSql, -1, uint32(f), (pRtree + 184 /* &.pWriteAux */), uintptr(0))
+ Xsqlite3_free(tls, zSql)
+ }
+ }
+ }
+
+ return rc
+}
+
+var azSql = [8]uintptr{
+ // Write the xxx_node table
+ ts + 29214, /* "INSERT OR REPLAC..." */
+ ts + 29267, /* "DELETE FROM '%q'..." */
+
+ // Read and write the xxx_rowid table
+ ts + 29312, /* "SELECT nodeno FR..." */
+ ts + 29364, /* "INSERT OR REPLAC..." */
+ ts + 29418, /* "DELETE FROM '%q'..." */
+
+ // Read and write the xxx_parent table
+ ts + 29463, /* "SELECT parentnod..." */
+ ts + 29521, /* "INSERT OR REPLAC..." */
+ ts + 29576, /* "DELETE FROM '%q'..." */
+} /* sqlite3.c:191553:21 */
+
+// The second argument to this function contains the text of an SQL statement
+// that returns a single integer value. The statement is compiled and executed
+// using database connection db. If successful, the integer value returned
+// is written to *piVal and SQLITE_OK returned. Otherwise, an SQLite error
+// code is returned and the value of *piVal after returning is not defined.
+func getIntFromStmt(tls *libc.TLS, db uintptr, zSql uintptr, piVal uintptr) int32 { /* sqlite3.c:191673:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 = 7
+ if zSql != 0 {
+ *(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0)
+ rc = Xsqlite3_prepare_v2(tls, db, zSql, -1, bp /* &pStmt */, uintptr(0))
+ if rc == 0 {
+ if 100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) {
+ *(*int32)(unsafe.Pointer(piVal)) = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 0)
+ }
+ rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
+ }
+ }
+ return rc
+}
+
+// This function is called from within the xConnect() or xCreate() method to
+// determine the node-size used by the rtree table being created or connected
+// to. If successful, pRtree->iNodeSize is populated and SQLITE_OK returned.
+// Otherwise, an SQLite error code is returned.
+//
+// If this function is being called as part of an xConnect(), then the rtree
+// table already exists. In this case the node-size is determined by inspecting
+// the root node of the tree.
+//
+// Otherwise, for an xCreate(), use 64 bytes less than the database page-size.
+// This ensures that each node is stored on a single database page. If the
+// database page-size is so large that more than RTREE_MAXCELLS entries
+// would fit in a single node, use a smaller node-size.
+func getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzErr uintptr) int32 { /* sqlite3.c:191703:12: */
+ bp := tls.Alloc(52)
+ defer tls.Free(52)
+
+ var rc int32
+ var zSql uintptr
+ if isCreate != 0 {
+ *(*int32)(unsafe.Pointer(bp + 48 /* iPageSize */)) = 0
+ zSql = Xsqlite3_mprintf(tls, ts+29623 /* "PRAGMA %Q.page_s..." */, libc.VaList(bp, (*Rtree)(unsafe.Pointer(pRtree)).FzDb))
+ rc = getIntFromStmt(tls, db, zSql, bp+48 /* &iPageSize */)
+ if rc == 0 {
+ (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize = (*(*int32)(unsafe.Pointer(bp + 48 /* iPageSize */)) - 64)
+ if (4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * 51)) < (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize {
+ (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize = (4 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell) * 51))
+ }
+ } else {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db)))
+ }
+ } else {
+ zSql = Xsqlite3_mprintf(tls,
+ ts+29643, /* "SELECT length(da..." */
+ libc.VaList(bp+16, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
+ rc = getIntFromStmt(tls, db, zSql, (pRtree + 32 /* &.iNodeSize */))
+ if rc != 0 {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+32, Xsqlite3_errmsg(tls, db)))
+ } else if (*Rtree)(unsafe.Pointer(pRtree)).FiNodeSize < (512 - 64) {
+ rc = (11 | (int32(1) << 8))
+
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+29700, /* "undersize RTree ..." */
+ libc.VaList(bp+40, (*Rtree)(unsafe.Pointer(pRtree)).FzName))
+ }
+ }
+
+ Xsqlite3_free(tls, zSql)
+ return rc
+}
+
+// Return the length of a token
+func rtreeTokenLength(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:191746:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ *(*int32)(unsafe.Pointer(bp /* dummy */)) = 0
+ return Xsqlite3GetToken(tls, z, bp /* &dummy */)
+}
+
+// This function is the implementation of both the xConnect and xCreate
+// methods of the r-tree virtual table.
+//
+// argv[0] -> module name
+// argv[1] -> database name
+// argv[2] -> table name
+// argv[...] -> column names...
+func rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:191760:12: */
+ bp := tls.Alloc(136)
+ defer tls.Free(136)
+
+ var rc int32
+ var pRtree uintptr
+ var nDb int32 // Length of string argv[1]
+ var nName int32 // Length of string argv[2]
+ var eCoordType int32
+ var pSql uintptr
+ var zSql uintptr
+ var ii int32
+ var iErr int32
+ // var aErrMsg [5]uintptr at bp+96, 40
+
+ var zArg uintptr
+ rc = 0
+ eCoordType = func() int32 {
+ if pAux != 0 {
+ return 1
+ }
+ return 0
+ }()
+ ii = 4
+ *(*[5]uintptr)(unsafe.Pointer(bp + 96 /* aErrMsg */)) = [5]uintptr{
+ uintptr(0), // 0
+ ts + 29735, /* "Wrong number of ..." */ // 1
+ ts + 29778, /* "Too few columns ..." */ // 2
+ ts + 29813, /* "Too many columns..." */ // 3
+ ts + 29849, /* "Auxiliary rtree ..." */ // 4
+ }
+
+ // Aux columns counted by a u8
+ if !((argc < 6) || (argc > (100 + 3))) {
+ goto __1
+ }
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + uintptr((2+(libc.Bool32(argc >= 6))))*8))))
+ return 1
+__1:
+ ;
+
+ Xsqlite3_vtab_config(tls, db, 1, libc.VaList(bp+8, 1))
+
+ // Allocate the sqlite3_vtab structure
+ nDb = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
+ nName = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ pRtree = Xsqlite3_malloc64(tls, (uint64(((uint64(unsafe.Sizeof(Rtree{})) + uint64(nDb)) + uint64(nName)) + uint64(2))))
+ if !(!(pRtree != 0)) {
+ goto __2
+ }
+ return 7
+__2:
+ ;
+ libc.Xmemset(tls, pRtree, 0, (((uint64(unsafe.Sizeof(Rtree{})) + uint64(nDb)) + uint64(nName)) + uint64(2)))
+ (*Rtree)(unsafe.Pointer(pRtree)).FnBusy = U32(1)
+ (*Rtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&rtreeModule))
+ (*Rtree)(unsafe.Pointer(pRtree)).FzDb = (pRtree + uintptr(1)*968)
+ (*Rtree)(unsafe.Pointer(pRtree)).FzName = ((*Rtree)(unsafe.Pointer(pRtree)).FzDb + uintptr((nDb + 1)))
+ (*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = U8(eCoordType)
+ libc.Xmemcpy(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), uint64(nDb))
+ libc.Xmemcpy(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), uint64(nName))
+
+ // Create/Connect to the underlying relational database schema. If
+ // that is successful, call sqlite3_declare_vtab() to configure
+ // the r-tree table schema.
+ pSql = Xsqlite3_str_new(tls, db)
+ Xsqlite3_str_appendf(tls, pSql, ts+29886, /* "CREATE TABLE x(%..." */
+ libc.VaList(bp+16, rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))), *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))
+ ii = 4
+__3:
+ if !(ii < argc) {
+ goto __5
+ }
+ zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8))
+ if !(int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) == '+') {
+ goto __6
+ }
+ (*Rtree)(unsafe.Pointer(pRtree)).FnAux++
+ Xsqlite3_str_appendf(tls, pSql, ts+29910 /* ",%.*s" */, libc.VaList(bp+32, rtreeTokenLength(tls, (zArg+uintptr(1))), (zArg+uintptr(1))))
+ goto __7
+__6:
+ if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux) > 0) {
+ goto __8
+ }
+ goto __5
+ goto __9
+__8:
+ (*Rtree)(unsafe.Pointer(pRtree)).FnDim2++
+ Xsqlite3_str_appendf(tls, pSql, azFormat[eCoordType],
+ libc.VaList(bp+48, rtreeTokenLength(tls, zArg), zArg))
+__9:
+ ;
+__7:
+ ;
+ goto __4
+__4:
+ ii++
+ goto __3
+ goto __5
+__5:
+ ;
+ Xsqlite3_str_appendf(tls, pSql, ts+29916 /* ");" */, 0)
+ zSql = Xsqlite3_str_finish(tls, pSql)
+ if !(!(zSql != 0)) {
+ goto __10
+ }
+ rc = 7
+ goto __11
+__10:
+ if !(ii < argc) {
+ goto __12
+ }
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + uintptr(4)*8))))
+ rc = 1
+ goto __13
+__12:
+ if !(0 != (libc.AssignInt32(&rc, Xsqlite3_declare_vtab(tls, db, zSql)))) {
+ goto __14
+ }
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+72, Xsqlite3_errmsg(tls, db)))
+__14:
+ ;
+__13:
+ ;
+__11:
+ ;
+ Xsqlite3_free(tls, zSql)
+ if !(rc != 0) {
+ goto __15
+ }
+ goto rtreeInit_fail
+__15:
+ ;
+ (*Rtree)(unsafe.Pointer(pRtree)).FnDim = (U8(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) / 2))
+ if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim) < 1) {
+ goto __16
+ }
+ iErr = 2
+ goto __17
+__16:
+ if !(int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) > (5 * 2)) {
+ goto __18
+ }
+ iErr = 3
+ goto __19
+__18:
+ if !((int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) % 2) != 0) {
+ goto __20
+ }
+ iErr = 1
+ goto __21
+__20:
+ iErr = 0
+__21:
+ ;
+__19:
+ ;
+__17:
+ ;
+ if !(iErr != 0) {
+ goto __22
+ }
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+80, *(*uintptr)(unsafe.Pointer(bp + 96 /* &aErrMsg[0] */ + uintptr(iErr)*8))))
+ goto rtreeInit_fail
+__22:
+ ;
+ (*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = (U8(8 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) * 4)))
+
+ // Figure out the node size to use.
+ rc = getNodeSize(tls, db, pRtree, isCreate, pzErr)
+ if !(rc != 0) {
+ goto __23
+ }
+ goto rtreeInit_fail
+__23:
+ ;
+ rc = rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), isCreate)
+ if !(rc != 0) {
+ goto __24
+ }
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+88, Xsqlite3_errmsg(tls, db)))
+ goto rtreeInit_fail
+__24:
+ ;
+
+ *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree
+ return 0
+
+rtreeInit_fail:
+ if !(rc == 0) {
+ goto __25
+ }
+ rc = 1
+__25:
+ ;
+
+ rtreeRelease(tls, pRtree)
+ return rc
+}
+
+var azFormat = [2]uintptr{ts + 29919 /* ",%.*s REAL" */, ts + 29930 /* ",%.*s INT" */} /* sqlite3.c:191826:25 */
+
+// Implementation of a scalar function that decodes r-tree nodes to
+// human readable strings. This can be used for debugging and analysis.
+//
+// The scalar function takes two arguments: (1) the number of dimensions
+// to the rtree (between 1 and 5, inclusive) and (2) a blob of data containing
+// an r-tree node. For a two-dimensional r-tree structure called "rt", to
+// deserialize all nodes, a statement like:
+//
+// SELECT rtreenode(2, data) FROM rt_node;
+//
+// The human readable string takes the form of a Tcl list with one
+// entry for each cell in the r-tree node. Each entry is itself a
+// list, containing the 8-byte rowid/pageno followed by the
+// <num-dimension>*2 coordinates.
+func rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:191897:13: */
+ bp := tls.Alloc(1072)
+ defer tls.Free(1072)
+
+ // var node RtreeNode at bp+16, 40
+
+ // var tree Rtree at bp+56, 968
+
+ var ii int32
+ var nData int32
+ var errCode int32
+ var pOut uintptr
+
+ _ = nArg
+ libc.Xmemset(tls, bp+16 /* &node */, 0, uint64(unsafe.Sizeof(RtreeNode{})))
+ libc.Xmemset(tls, bp+56 /* &tree */, 0, uint64(unsafe.Sizeof(Rtree{})))
+ (*Rtree)(unsafe.Pointer(bp + 56 /* &tree */)).FnDim = U8(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(0)*8))))
+ if (int32((*Rtree)(unsafe.Pointer(bp+56 /* &tree */)).FnDim) < 1) || (int32((*Rtree)(unsafe.Pointer(bp+56 /* &tree */)).FnDim) > 5) {
+ return
+ }
+ (*Rtree)(unsafe.Pointer(bp + 56 /* &tree */)).FnDim2 = (U8(int32((*Rtree)(unsafe.Pointer(bp+56 /* &tree */)).FnDim) * 2))
+ (*Rtree)(unsafe.Pointer(bp + 56 /* &tree */)).FnBytesPerCell = (U8(8 + (8 * int32((*Rtree)(unsafe.Pointer(bp+56 /* &tree */)).FnDim))))
+ (*RtreeNode)(unsafe.Pointer(bp + 16 /* &node */)).FzData = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(1)*8)))
+ nData = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(1)*8)))
+ if nData < 4 {
+ return
+ }
+ if nData < (readInt16(tls, ((*RtreeNode)(unsafe.Pointer((bp+16 /* &node */))).FzData+uintptr(2))) * int32((*Rtree)(unsafe.Pointer(bp+56 /* &tree */)).FnBytesPerCell)) {
+ return
+ }
+
+ pOut = Xsqlite3_str_new(tls, uintptr(0))
+ for ii = 0; ii < readInt16(tls, ((*RtreeNode)(unsafe.Pointer((bp+16 /* &node */))).FzData+uintptr(2))); ii++ {
+ // var cell RtreeCell at bp+1024, 48
+
+ var jj int32
+
+ nodeGetCell(tls, bp+56 /* &tree */, bp+16 /* &node */, ii, bp+1024 /* &cell */)
+ if ii > 0 {
+ Xsqlite3_str_append(tls, pOut, ts+15984 /* " " */, 1)
+ }
+ Xsqlite3_str_appendf(tls, pOut, ts+29940 /* "{%lld" */, libc.VaList(bp, (*RtreeCell)(unsafe.Pointer(bp+1024 /* &cell */)).FiRowid))
+ for jj = 0; jj < int32((*Rtree)(unsafe.Pointer(bp+56 /* &tree */)).FnDim2); jj++ {
+ Xsqlite3_str_appendf(tls, pOut, ts+29946 /* " %g" */, libc.VaList(bp+8, float64(*(*RtreeValue)(unsafe.Pointer((bp + 1024 /* &cell */ + 8 /* &.aCoord */) + uintptr(jj)*4)))))
+ }
+ Xsqlite3_str_append(tls, pOut, ts+29950 /* "}" */, 1)
+ }
+ errCode = Xsqlite3_str_errcode(tls, pOut)
+ Xsqlite3_result_text(tls, ctx, Xsqlite3_str_finish(tls, pOut), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3_result_error_code(tls, ctx, errCode)
+}
+
+// This routine implements an SQL function that returns the "depth" parameter
+// from the front of a blob that is an r-tree node. For example:
+//
+// SELECT rtreedepth(data) FROM rt_node WHERE nodeno=1;
+//
+// The depth value is 0 for all nodes other than the root node, and the root
+// node always has nodeno=1, so the example above is the primary use for this
+// routine. This routine is intended for testing and analysis only.
+func rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:191948:13: */
+ _ = nArg
+ if (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(0)*8))) != 4) ||
+ (Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(0)*8))) < 2) {
+ Xsqlite3_result_error(tls, ctx, ts+29952 /* "Invalid argument..." */, -1)
+ } else {
+ var zBlob uintptr = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(0)*8)))
+ Xsqlite3_result_int(tls, ctx, readInt16(tls, zBlob))
+ }
+}
+
+// Context object passed between the various routines that make up the
+// implementation of integrity-check function rtreecheck().
+type RtreeCheck1 = struct {
+ Fdb uintptr
+ FzDb uintptr
+ FzTab uintptr
+ FbInt int32
+ FnDim int32
+ FpGetNode uintptr
+ FaCheckMapping [2]uintptr
+ FnLeaf int32
+ FnNonLeaf int32
+ Frc int32
+ FzReport uintptr
+ FnErr int32
+ _ [4]byte
+}
+
+// Context object passed between the various routines that make up the
+// implementation of integrity-check function rtreecheck().
+type RtreeCheck = RtreeCheck1 /* sqlite3.c:191964:27 */
+
+// Reset SQL statement pStmt. If the sqlite3_reset() call returns an error,
+// and RtreeCheck.rc==SQLITE_OK, set RtreeCheck.rc to the error code.
+func rtreeCheckReset(tls *libc.TLS, pCheck uintptr, pStmt uintptr) { /* sqlite3.c:191986:13: */
+ var rc int32 = Xsqlite3_reset(tls, pStmt)
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == 0 {
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = rc
+ }
+}
+
+// The second and subsequent arguments to this function are a format string
+// and printf style arguments. This function formats the string and attempts
+// to compile it as an SQL statement.
+//
+// If successful, a pointer to the new SQL statement is returned. Otherwise,
+// NULL is returned and an error code left in RtreeCheck.rc.
+func rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:191999:21: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var ap Va_list
+ _ = ap
+ var z uintptr
+ *(*uintptr)(unsafe.Pointer(bp /* pRet */)) = uintptr(0)
+
+ ap = va
+ z = Xsqlite3_vmprintf(tls, zFmt, ap)
+
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == 0 {
+ if z == uintptr(0) {
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = 7
+ } else {
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_prepare_v2(tls, (*RtreeCheck)(unsafe.Pointer(pCheck)).Fdb, z, -1, bp /* &pRet */, uintptr(0))
+ }
+ }
+
+ Xsqlite3_free(tls, z)
+ _ = ap
+ return *(*uintptr)(unsafe.Pointer(bp /* pRet */))
+}
+
+// The second and subsequent arguments to this function are a printf()
+// style format string and arguments. This function formats the string and
+// appends it to the report being accumuated in pCheck.
+func rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:192028:13: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var ap Va_list
+ _ = ap
+ ap = va
+ if ((*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == 0) && ((*RtreeCheck)(unsafe.Pointer(pCheck)).FnErr < 100) {
+ var z uintptr = Xsqlite3_vmprintf(tls, zFmt, ap)
+ if z == uintptr(0) {
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = 7
+ } else {
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, ts+29985, /* "%z%s%z" */
+ libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport, func() uintptr {
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 {
+ return ts + 5696 /* "\n" */
+ }
+ return ts + 781 /* "" */
+ }(), z))
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) {
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = 7
+ }
+ }
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).FnErr++
+ }
+ _ = ap
+}
+
+// This function is a no-op if there is already an error code stored
+// in the RtreeCheck object indicated by the first argument. NULL is
+// returned in this case.
+//
+// Otherwise, the contents of rtree table node iNode are loaded from
+// the database and copied into a buffer obtained from sqlite3_malloc().
+// If no error occurs, a pointer to the buffer is returned and (*pnNode)
+// is set to the size of the buffer in bytes.
+//
+// Or, if an error does occur, NULL is returned and an error code left
+// in the RtreeCheck object. The final value of *pnNode is undefined in
+// this case.
+func rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode I64, pnNode uintptr) uintptr { /* sqlite3.c:192062:11: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var pRet uintptr = uintptr(0) // Return value
+
+ if ((*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == 0) && ((*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0)) {
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = rtreeCheckPrepare(tls, pCheck,
+ ts+29992, /* "SELECT data FROM..." */
+ libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab))
+ }
+
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == 0 {
+ Xsqlite3_bind_int64(tls, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, 1, iNode)
+ if Xsqlite3_step(tls, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) == 100 {
+ var nNode int32 = Xsqlite3_column_bytes(tls, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, 0)
+ var pNode uintptr = Xsqlite3_column_blob(tls, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, 0)
+ pRet = Xsqlite3_malloc64(tls, uint64(nNode))
+ if pRet == uintptr(0) {
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = 7
+ } else {
+ libc.Xmemcpy(tls, pRet, pNode, uint64(nNode))
+ *(*int32)(unsafe.Pointer(pnNode)) = nNode
+ }
+ }
+ rtreeCheckReset(tls, pCheck, (*RtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode)
+ if ((*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == 0) && (pRet == uintptr(0)) {
+ rtreeCheckAppendMsg(tls, pCheck, ts+30037 /* "Node %lld missin..." */, libc.VaList(bp+16, iNode))
+ }
+ }
+
+ return pRet
+}
+
+// This function is used to check that the %_parent (if bLeaf==0) or %_rowid
+// (if bLeaf==1) table contains a specified entry. The schemas of the
+// two tables are:
+//
+// CREATE TABLE %_parent(nodeno INTEGER PRIMARY KEY, parentnode INTEGER)
+// CREATE TABLE %_rowid(rowid INTEGER PRIMARY KEY, nodeno INTEGER, ...)
+//
+// In both cases, this function checks that there exists an entry with
+// IPK value iKey and the second column set to iVal.
+//
+func rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey I64, iVal I64) { /* sqlite3.c:192106:13: */
+ bp := tls.Alloc(96)
+ defer tls.Free(96)
+
+ var rc int32
+ var pStmt uintptr
+ *(*[2]uintptr)(unsafe.Pointer(bp + 80 /* azSql */)) = [2]uintptr{
+ ts + 30069, /* "SELECT parentnod..." */
+ ts + 30123, /* "SELECT nodeno FR..." */
+ }
+
+ if *(*uintptr)(unsafe.Pointer((pCheck + 40 /* &.aCheckMapping */) + uintptr(bLeaf)*8)) == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer((pCheck + 40 /* &.aCheckMapping */) + uintptr(bLeaf)*8)) = rtreeCheckPrepare(tls, pCheck,
+ *(*uintptr)(unsafe.Pointer(bp + 80 /* &azSql[0] */ + uintptr(bLeaf)*8)), libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab))
+ }
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc != 0 {
+ return
+ }
+
+ pStmt = *(*uintptr)(unsafe.Pointer((pCheck + 40 /* &.aCheckMapping */) + uintptr(bLeaf)*8))
+ Xsqlite3_bind_int64(tls, pStmt, 1, iKey)
+ rc = Xsqlite3_step(tls, pStmt)
+ if rc == 101 {
+ rtreeCheckAppendMsg(tls, pCheck, ts+30171, /* "Mapping (%lld ->..." */
+ libc.VaList(bp+16, iKey, iVal, func() uintptr {
+ if bLeaf != 0 {
+ return ts + 30216 /* "%_rowid" */
+ }
+ return ts + 30224 /* "%_parent" */
+ }()))
+ } else if rc == 100 {
+ var ii I64 = Xsqlite3_column_int64(tls, pStmt, 0)
+ if ii != iVal {
+ rtreeCheckAppendMsg(tls, pCheck,
+ ts+30233, /* "Found (%lld -> %..." */
+ libc.VaList(bp+40, iKey, ii, func() uintptr {
+ if bLeaf != 0 {
+ return ts + 30216 /* "%_rowid" */
+ }
+ return ts + 30224 /* "%_parent" */
+ }(), iKey, iVal))
+ }
+ }
+ rtreeCheckReset(tls, pCheck, pStmt)
+}
+
+// Argument pCell points to an array of coordinates stored on an rtree page.
+// This function checks that the coordinates are internally consistent (no
+// x1>x2 conditions) and adds an error message to the RtreeCheck object
+// if they are not.
+//
+// Additionally, if pParent is not NULL, then it is assumed to point to
+// the array of coordinates on the parent page that bound the page
+// containing pCell. In this case it is also verified that the two
+// sets of coordinates are mutually consistent and an error message added
+// to the RtreeCheck object if they are not.
+func rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode I64, iCell int32, pCell uintptr, pParent uintptr) { /* sqlite3.c:192158:13: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ // var c1 RtreeCoord at bp+48, 4
+
+ // var c2 RtreeCoord at bp+52, 4
+
+ // var p1 RtreeCoord at bp+56, 4
+
+ // var p2 RtreeCoord at bp+60, 4
+
+ var i int32
+
+ for i = 0; i < (*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim; i++ {
+ readCoord(tls, (pCell + uintptr(((4 * 2) * i))), bp+48 /* &c1 */)
+ readCoord(tls, (pCell + uintptr((4 * ((2 * i) + 1)))), bp+52 /* &c2 */)
+
+ // printf("%e, %e\n", c1.u.f, c2.u.f);
+ if func() int32 {
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).FbInt != 0 {
+ return (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 48 /* &c1 */)) > *(*int32)(unsafe.Pointer(bp + 52 /* &c2 */))))
+ }
+ return (libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 48 /* &c1 */)) > *(*RtreeValue)(unsafe.Pointer(bp + 52 /* &c2 */))))
+ }() != 0 {
+ rtreeCheckAppendMsg(tls, pCheck,
+ ts+30291 /* "Dimension %d of ..." */, libc.VaList(bp, i, iCell, iNode))
+ }
+
+ if pParent != 0 {
+ readCoord(tls, (pParent + uintptr(((4 * 2) * i))), bp+56 /* &p1 */)
+ readCoord(tls, (pParent + uintptr((4 * ((2 * i) + 1)))), bp+60 /* &p2 */)
+
+ if (func() int32 {
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).FbInt != 0 {
+ return (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 48 /* &c1 */)) < *(*int32)(unsafe.Pointer(bp + 56 /* &p1 */))))
+ }
+ return (libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 48 /* &c1 */)) < *(*RtreeValue)(unsafe.Pointer(bp + 56 /* &p1 */))))
+ }() != 0) ||
+ (func() int32 {
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).FbInt != 0 {
+ return (libc.Bool32(*(*int32)(unsafe.Pointer(bp + 52 /* &c2 */)) > *(*int32)(unsafe.Pointer(bp + 60 /* &p2 */))))
+ }
+ return (libc.Bool32(*(*RtreeValue)(unsafe.Pointer(bp + 52 /* &c2 */)) > *(*RtreeValue)(unsafe.Pointer(bp + 60 /* &p2 */))))
+ }() != 0) {
+ rtreeCheckAppendMsg(tls, pCheck,
+ ts+30339 /* "Dimension %d of ..." */, libc.VaList(bp+24, i, iCell, iNode))
+ }
+ }
+ }
+}
+
+// Run rtreecheck() checks on node iNode, which is at depth iDepth within
+// the r-tree structure. Argument aParent points to the array of coordinates
+// that bound node iNode on the parent node.
+//
+// If any problems are discovered, an error message is appended to the
+// report accumulated in the RtreeCheck object.
+func rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintptr, iNode I64) { /* sqlite3.c:192204:13: */
+ bp := tls.Alloc(52)
+ defer tls.Free(52)
+
+ var aNode uintptr = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)) = 0
+
+ aNode = rtreeCheckGetNode(tls, pCheck, iNode, bp+48 /* &nNode */)
+ if aNode != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)) < 4 {
+ rtreeCheckAppendMsg(tls, pCheck,
+ ts+30406 /* "Node %lld is too..." */, libc.VaList(bp, iNode, *(*int32)(unsafe.Pointer(bp + 48 /* nNode */))))
+ } else {
+ var nCell int32 // Number of cells on page
+ var i int32 // Used to iterate through cells
+ if aParent == uintptr(0) {
+ iDepth = readInt16(tls, aNode)
+ if iDepth > 40 {
+ rtreeCheckAppendMsg(tls, pCheck, ts+30440 /* "Rtree depth out ..." */, libc.VaList(bp+16, iDepth))
+ Xsqlite3_free(tls, aNode)
+ return
+ }
+ }
+ nCell = readInt16(tls, (aNode + uintptr(2)))
+ if (4 + (nCell * (8 + (((*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim * 2) * 4)))) > *(*int32)(unsafe.Pointer(bp + 48 /* nNode */)) {
+ rtreeCheckAppendMsg(tls, pCheck,
+ ts+30470, /* "Node %lld is too..." */
+ libc.VaList(bp+24, iNode, nCell, *(*int32)(unsafe.Pointer(bp + 48 /* nNode */))))
+ } else {
+ for i = 0; i < nCell; i++ {
+ var pCell uintptr = (aNode + uintptr((4 + (i * (8 + (((*RtreeCheck)(unsafe.Pointer(pCheck)).FnDim * 2) * 4))))))
+ var iVal I64 = readInt64(tls, pCell)
+ rtreeCheckCellCoord(tls, pCheck, iNode, i, (pCell + uintptr(8)), aParent)
+
+ if iDepth > 0 {
+ rtreeCheckMapping(tls, pCheck, 0, iVal, iNode)
+ rtreeCheckNode(tls, pCheck, (iDepth - 1), (pCell + uintptr(8)), iVal)
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).FnNonLeaf++
+ } else {
+ rtreeCheckMapping(tls, pCheck, 1, iVal, iNode)
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).FnLeaf++
+ }
+ }
+ }
+ }
+ Xsqlite3_free(tls, aNode)
+ }
+}
+
+// The second argument to this function must be either "_rowid" or
+// "_parent". This function checks that the number of entries in the
+// %_rowid or %_parent table is exactly nExpect. If not, it adds
+// an error message to the report in the RtreeCheck object indicated
+// by the first argument.
+func rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect I64) { /* sqlite3.c:192267:13: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ if (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc == 0 {
+ var pCount uintptr
+ pCount = rtreeCheckPrepare(tls, pCheck, ts+30525, /* "SELECT count(*) ..." */
+ libc.VaList(bp, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*RtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl))
+ if pCount != 0 {
+ if Xsqlite3_step(tls, pCount) == 100 {
+ var nActual I64 = Xsqlite3_column_int64(tls, pCount, 0)
+ if nActual != nExpect {
+ rtreeCheckAppendMsg(tls, pCheck,
+ ts+30556 /* "Wrong number of ..." */, libc.VaList(bp+24, zTbl, nExpect, nActual))
+ }
+ }
+ (*RtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount)
+ }
+ }
+}
+
+// This function does the bulk of the work for the rtree integrity-check.
+// It is called by rtreecheck(), which is the SQL function implementation.
+func rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzReport uintptr) int32 { /* sqlite3.c:192291:12: */
+ bp := tls.Alloc(120)
+ defer tls.Free(120)
+
+ // var check RtreeCheck at bp+32, 88
+ // Common context for various routines
+ var pStmt uintptr = uintptr(0) // Used to find column count of rtree table
+ var bEnd int32 = 0 // True if transaction should be closed
+ var nAux int32 = 0 // Number of extra columns.
+
+ // Initialize the context object
+ libc.Xmemset(tls, bp+32 /* &check */, 0, uint64(unsafe.Sizeof(RtreeCheck{})))
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Fdb = db
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FzDb = zDb
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FzTab = zTab
+
+ // If there is not already an open transaction, open one now. This is
+ // to ensure that the queries run as part of this integrity-check operate
+ // on a consistent snapshot.
+ if Xsqlite3_get_autocommit(tls, db) != 0 {
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = Xsqlite3_exec(tls, db, ts+15566 /* "BEGIN" */, uintptr(0), uintptr(0), uintptr(0))
+ bEnd = 1
+ }
+
+ // Find the number of auxiliary columns
+ if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).Frc == 0 {
+ pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+30623 /* "SELECT * FROM %Q..." */, libc.VaList(bp, zDb, zTab))
+ if pStmt != 0 {
+ nAux = (Xsqlite3_column_count(tls, pStmt) - 2)
+ Xsqlite3_finalize(tls, pStmt)
+ }
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = 0
+ }
+
+ // Find number of dimensions in the rtree table.
+ pStmt = rtreeCheckPrepare(tls, bp+32 /* &check */, ts+28443 /* "SELECT * FROM %Q..." */, libc.VaList(bp+16, zDb, zTab))
+ if pStmt != 0 {
+ var rc int32
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FnDim = (((Xsqlite3_column_count(tls, pStmt) - 1) - nAux) / 2)
+ if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnDim < 1 {
+ rtreeCheckAppendMsg(tls, bp+32 /* &check */, ts+30651 /* "Schema corrupt o..." */, 0)
+ } else if 100 == Xsqlite3_step(tls, pStmt) {
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FbInt = (libc.Bool32(Xsqlite3_column_type(tls, pStmt, 1) == 1))
+ }
+ rc = Xsqlite3_finalize(tls, pStmt)
+ if rc != 11 {
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = rc
+ }
+ }
+
+ // Do the actual integrity-check
+ if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnDim >= 1 {
+ if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).Frc == 0 {
+ rtreeCheckNode(tls, bp+32 /* &check */, 0, uintptr(0), int64(1))
+ }
+ rtreeCheckCount(tls, bp+32 /* &check */, ts+30682 /* "_rowid" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnLeaf))
+ rtreeCheckCount(tls, bp+32 /* &check */, ts+30689 /* "_parent" */, int64((*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FnNonLeaf))
+ }
+
+ // Finalize SQL statements used by the integrity-check
+ Xsqlite3_finalize(tls, (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).FpGetNode)
+ Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer((bp + 32 /* &check */ + 40 /* &.aCheckMapping */) + uintptr(0)*8)))
+ Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer((bp + 32 /* &check */ + 40 /* &.aCheckMapping */) + uintptr(1)*8)))
+
+ // If one was opened, close the transaction
+ if bEnd != 0 {
+ var rc int32 = Xsqlite3_exec(tls, db, ts+30697 /* "END" */, uintptr(0), uintptr(0), uintptr(0))
+ if (*RtreeCheck)(unsafe.Pointer(bp+32 /* &check */)).Frc == 0 {
+ (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc = rc
+ }
+ }
+ *(*uintptr)(unsafe.Pointer(pzReport)) = (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).FzReport
+ return (*RtreeCheck)(unsafe.Pointer(bp + 32 /* &check */)).Frc
+}
+
+// Usage:
+//
+// rtreecheck(<rtree-table>);
+// rtreecheck(<database>, <rtree-table>);
+//
+// Invoking this SQL function runs an integrity-check on the named rtree
+// table. The integrity-check verifies the following:
+//
+// 1. For each cell in the r-tree structure (%_node table), that:
+//
+// a) for each dimension, (coord1 <= coord2).
+//
+// b) unless the cell is on the root node, that the cell is bounded
+// by the parent cell on the parent node.
+//
+// c) for leaf nodes, that there is an entry in the %_rowid
+// table corresponding to the cell's rowid value that
+// points to the correct node.
+//
+// d) for cells on non-leaf nodes, that there is an entry in the
+// %_parent table mapping from the cell's child node to the
+// node that it resides on.
+//
+// 2. That there are the same number of entries in the %_rowid table
+// as there are leaf cells in the r-tree structure, and that there
+// is a leaf cell that corresponds to each entry in the %_rowid table.
+//
+// 3. That there are the same number of entries in the %_parent table
+// as there are non-leaf cells in the r-tree structure, and that
+// there is a non-leaf cell that corresponds to each entry in the
+// %_parent table.
+func rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:192396:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ if (nArg != 1) && (nArg != 2) {
+ Xsqlite3_result_error(tls, ctx,
+ ts+30701 /* "wrong number of ..." */, -1)
+ } else {
+ var rc int32
+ *(*uintptr)(unsafe.Pointer(bp /* zReport */)) = uintptr(0)
+ var zDb uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(0)*8)))
+ var zTab uintptr
+ if nArg == 1 {
+ zTab = zDb
+ zDb = ts + 8314 /* "main" */
+ } else {
+ zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(1)*8)))
+ }
+ rc = rtreeCheckTable(tls, Xsqlite3_context_db_handle(tls, ctx), zDb, zTab, bp /* &zReport */)
+ if rc == 0 {
+ Xsqlite3_result_text(tls, ctx, func() uintptr {
+ if *(*uintptr)(unsafe.Pointer(bp /* zReport */)) != 0 {
+ return *(*uintptr)(unsafe.Pointer(bp /* zReport */))
+ }
+ return ts + 4980 /* "ok" */
+ }(), -1, libc.UintptrFromInt32(-1))
+ } else {
+ Xsqlite3_result_error_code(tls, ctx, rc)
+ }
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp /* zReport */)))
+ }
+}
+
+// Conditionally include the geopoly code
+//************* Include geopoly.c in the middle of rtree.c ******************
+//************* Begin file geopoly.c ****************************************
+// 2018-05-25
//
// The author disclaims copyright to this source code. In place of
// a legal notice, here is a blessing:
@@ -139688,46 +151831,2728 @@ func Xsqlite3ConnectionClosed(tls *crt.TLS, db uintptr) { /* sqlite3.c:165258:21
// May you share freely, never taking more than you give.
//
//
-// This file contains code for implementations of the r-tree and r*-tree
-// algorithms packaged as an SQLite virtual table module.
+//
+// This file implements an alternative R-Tree virtual table that
+// uses polygons to express the boundaries of 2-dimensional objects.
+//
+// This file is #include-ed onto the end of "rtree.c" so that it has
+// access to all of the R-Tree internals.
+// #include <stdlib.h>
-// Database Format of R-Tree Tables
-// --------------------------------
+// Enable -DGEOPOLY_ENABLE_DEBUG for debugging facilities
+
+// Compiler and version
+
+// Datatype for coordinates
+type GeoCoord = float32 /* sqlite3.c:192520:15 */
+
+// Internal representation of a polygon.
//
-// The data structure for a single virtual r-tree table is stored in three
-// native SQLite tables declared as follows. In each case, the '%' character
-// in the table name is replaced with the user-supplied name of the r-tree
-// table.
+// The polygon consists of a sequence of vertexes. There is a line
+// segment between each pair of vertexes, and one final segment from
+// the last vertex back to the first. (This differs from the GeoJSON
+// standard in which the final vertex is a repeat of the first.)
//
-// CREATE TABLE %_node(nodeno INTEGER PRIMARY KEY, data BLOB)
-// CREATE TABLE %_parent(nodeno INTEGER PRIMARY KEY, parentnode INTEGER)
-// CREATE TABLE %_rowid(rowid INTEGER PRIMARY KEY, nodeno INTEGER, ...)
+// The polygon follows the right-hand rule. The area to the right of
+// each segment is "outside" and the area to the left is "inside".
//
-// The data for each node of the r-tree structure is stored in the %_node
-// table. For each node that is not the root node of the r-tree, there is
-// an entry in the %_parent table associating the node with its parent.
-// And for each row of data in the table, there is an entry in the %_rowid
-// table that maps from the entries rowid to the id of the node that it
-// is stored on. If the r-tree contains auxiliary columns, those are stored
-// on the end of the %_rowid table.
+// The on-disk representation consists of a 4-byte header followed by
+// the values. The 4-byte header is:
//
-// The root node of an r-tree always exists, even if the r-tree table is
-// empty. The nodeno of the root node is always 1. All other nodes in the
-// table must be the same size as the root node. The content of each node
-// is formatted as follows:
+// encoding (1 byte) 0=big-endian, 1=little-endian
+// nvertex (3 bytes) Number of vertexes as a big-endian integer
//
-// 1. If the node is the root node (node 1), then the first 2 bytes
-// of the node contain the tree depth as a big-endian integer.
-// For non-root nodes, the first 2 bytes are left unused.
+// Enough space is allocated for 4 coordinates, to work around over-zealous
+// warnings coming from some compiler (notably, clang). In reality, the size
+// of each GeoPoly memory allocate is adjusted as necessary so that the
+// GeoPoly.a[] array at the end is the appropriate size.
+type GeoPoly1 = struct {
+ FnVertex int32
+ Fhdr [4]uint8
+ Fa [8]GeoCoord
+}
+
+// Internal representation of a polygon.
+//
+// The polygon consists of a sequence of vertexes. There is a line
+// segment between each pair of vertexes, and one final segment from
+// the last vertex back to the first. (This differs from the GeoJSON
+// standard in which the final vertex is a repeat of the first.)
+//
+// The polygon follows the right-hand rule. The area to the right of
+// each segment is "outside" and the area to the left is "inside".
+//
+// The on-disk representation consists of a 4-byte header followed by
+// the values. The 4-byte header is:
+//
+// encoding (1 byte) 0=big-endian, 1=little-endian
+// nvertex (3 bytes) Number of vertexes as a big-endian integer
//
-// 2. The next 2 bytes contain the number of entries currently
-// stored in the node.
+// Enough space is allocated for 4 coordinates, to work around over-zealous
+// warnings coming from some compiler (notably, clang). In reality, the size
+// of each GeoPoly memory allocate is adjusted as necessary so that the
+// GeoPoly.a[] array at the end is the appropriate size.
+type GeoPoly = GeoPoly1 /* sqlite3.c:192544:24 */
+
+// The size of a memory allocation needed for a GeoPoly object sufficient
+// to hold N coordinate pairs.
+
+// Macros to access coordinates of a GeoPoly.
+// We have to use these macros, rather than just say p->a[i] in order
+// to silence (incorrect) UBSAN warnings if the array index is too large.
+
+// State of a parse of a GeoJSON input.
+type GeoParse1 = struct {
+ Fz uintptr
+ FnVertex int32
+ FnAlloc int32
+ FnErr int32
+ Fa uintptr
+}
+
+// The size of a memory allocation needed for a GeoPoly object sufficient
+// to hold N coordinate pairs.
+
+// Macros to access coordinates of a GeoPoly.
+// We have to use these macros, rather than just say p->a[i] in order
+// to silence (incorrect) UBSAN warnings if the array index is too large.
+
+// State of a parse of a GeoJSON input.
+type GeoParse = GeoParse1 /* sqlite3.c:192567:25 */
+
+// Do a 4-byte byte swap
+func geopolySwab32(tls *libc.TLS, a uintptr) { /* sqlite3.c:192577:13: */
+ var t uint8 = *(*uint8)(unsafe.Pointer(a + uintptr(0)))
+ *(*uint8)(unsafe.Pointer(a + uintptr(0))) = *(*uint8)(unsafe.Pointer(a + uintptr(3)))
+ *(*uint8)(unsafe.Pointer(a + uintptr(3))) = t
+ t = *(*uint8)(unsafe.Pointer(a + uintptr(1)))
+ *(*uint8)(unsafe.Pointer(a + uintptr(1))) = *(*uint8)(unsafe.Pointer(a + uintptr(2)))
+ *(*uint8)(unsafe.Pointer(a + uintptr(2))) = t
+}
+
+// Skip whitespace. Return the next non-whitespace character.
+func geopolySkipSpace(tls *libc.TLS, p uintptr) int8 { /* sqlite3.c:192587:13: */
+ for jsonIsSpace[*(*uint8)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(p)).Fz + uintptr(0)))] != 0 {
+ (*GeoParse)(unsafe.Pointer(p)).Fz++
+ }
+ return int8(*(*uint8)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(p)).Fz + uintptr(0))))
+}
+
+// Parse out a number. Write the value into *pVal if pVal!=0.
+// return non-zero on success and zero if the next token is not a number.
+func geopolyParseNumber(tls *libc.TLS, p uintptr, pVal uintptr) int32 { /* sqlite3.c:192595:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var c int8 = geopolySkipSpace(tls, p)
+ var z uintptr = (*GeoParse)(unsafe.Pointer(p)).Fz
+ var j int32 = 0
+ var seenDP int32 = 0
+ var seenE int32 = 0
+ if int32(c) == '-' {
+ j = 1
+ c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j))))
+ }
+ if ((int32(c) == '0') && (int32(*(*uint8)(unsafe.Pointer(z + uintptr((j + 1))))) >= '0')) && (int32(*(*uint8)(unsafe.Pointer(z + uintptr((j + 1))))) <= '9') {
+ return 0
+ }
+ for ; ; j++ {
+ c = int8(*(*uint8)(unsafe.Pointer(z + uintptr(j))))
+ if (int32(Xsqlite3CtypeMap[uint8(c)]) & 0x04) != 0 {
+ continue
+ }
+ if int32(c) == '.' {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr((j - 1))))) == '-' {
+ return 0
+ }
+ if seenDP != 0 {
+ return 0
+ }
+ seenDP = 1
+ continue
+ }
+ if (int32(c) == 'e') || (int32(c) == 'E') {
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr((j - 1))))) < '0' {
+ return 0
+ }
+ if seenE != 0 {
+ return -1
+ }
+ seenDP = libc.AssignInt32(&seenE, 1)
+ c = int8(*(*uint8)(unsafe.Pointer(z + uintptr((j + 1)))))
+ if (int32(c) == '+') || (int32(c) == '-') {
+ j++
+ c = int8(*(*uint8)(unsafe.Pointer(z + uintptr((j + 1)))))
+ }
+ if (int32(c) < '0') || (int32(c) > '9') {
+ return 0
+ }
+ continue
+ }
+ break
+ }
+ if int32(*(*uint8)(unsafe.Pointer(z + uintptr((j - 1))))) < '0' {
+ return 0
+ }
+ if pVal != 0 {
+ // The sqlite3AtoF() routine is much much faster than atof(), if it
+ // is available
+ // var r float64 at bp, 8
+
+ Xsqlite3AtoF(tls, (*GeoParse)(unsafe.Pointer(p)).Fz, bp /* &r */, j, uint8(1))
+ *(*GeoCoord)(unsafe.Pointer(pVal)) = GeoCoord(*(*float64)(unsafe.Pointer(bp /* r */)))
+ }
+ *(*uintptr)(unsafe.Pointer(p /* &.z */)) += (uintptr(j))
+ return 1
+}
+
+// If the input is a well-formed JSON array of coordinates with at least
+// four coordinates and where each coordinate is itself a two-value array,
+// then convert the JSON into a GeoPoly object and return a pointer to
+// that object.
//
-// 3. The remainder of the node contains the node entries. Each entry
-// consists of a single 8-byte integer followed by an even number
-// of 4-byte coordinates. For leaf nodes the integer is the rowid
-// of a record. For internal nodes it is the node number of a
-// child page.
+// If any error occurs, return NULL.
+func geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) uintptr { /* sqlite3.c:192653:16: */
+ bp := tls.Alloc(36)
+ defer tls.Free(36)
+
+ // var s GeoParse at bp, 32
+
+ var rc int32
+ var aNew uintptr
+ var ii int32
+ var c int8
+ var pOut uintptr
+ // var x int32 at bp+32, 4
+ rc = 0
+ libc.Xmemset(tls, bp /* &s */, 0, uint64(unsafe.Sizeof(GeoParse{})))
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fz = z
+ if !(int32(geopolySkipSpace(tls, bp /* &s */)) == '[') {
+ goto __1
+ }
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fz++
+__2:
+ if !(int32(geopolySkipSpace(tls, bp /* &s */)) == '[') {
+ goto __3
+ }
+ ii = 0
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fz++
+ if !((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex >= (*GeoParse)(unsafe.Pointer(bp /* &s */)).FnAlloc) {
+ goto __4
+ }
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).FnAlloc = (((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnAlloc * 2) + 16)
+ aNew = Xsqlite3_realloc64(tls, (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa, (uint64((uint64((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnAlloc) * uint64(unsafe.Sizeof(GeoCoord(0)))) * uint64(2))))
+ if !(aNew == uintptr(0)) {
+ goto __5
+ }
+ rc = 7
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).FnErr++
+ goto __3
+__5:
+ ;
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa = aNew
+__4:
+ ;
+__6:
+ if !(geopolyParseNumber(tls, bp /* &s */, func() uintptr {
+ if ii <= 1 {
+ return ((*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa + uintptr((((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex*2)+ii))*4)
+ }
+ return uintptr(0)
+ }()) != 0) {
+ goto __7
+ }
+ ii++
+ if !(ii == 2) {
+ goto __8
+ }
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex++
+__8:
+ ;
+ c = geopolySkipSpace(tls, bp /* &s */)
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fz++
+ if !(int32(c) == ',') {
+ goto __9
+ }
+ goto __6
+__9:
+ ;
+ if !((int32(c) == ']') && (ii >= 2)) {
+ goto __10
+ }
+ goto __7
+__10:
+ ;
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).FnErr++
+ rc = 1
+ goto parse_json_err
+ goto __6
+__7:
+ ;
+ if !(int32(geopolySkipSpace(tls, bp /* &s */)) == ',') {
+ goto __11
+ }
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fz++
+ goto __2
+__11:
+ ;
+ goto __3
+ goto __2
+__3:
+ ;
+ if !(((((int32(geopolySkipSpace(tls, bp /* &s */)) == ']') &&
+ ((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex >= 4)) &&
+ (*(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa + uintptr(0)*4)) == *(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa + uintptr((((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex*2)-2))*4)))) &&
+ (*(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa + uintptr(1)*4)) == *(*GeoCoord)(unsafe.Pointer((*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa + uintptr((((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex*2)-1))*4)))) &&
+ (func() bool {
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fz++
+ return (int32(geopolySkipSpace(tls, bp /* &s */)) == 0)
+ }())) {
+ goto __12
+ }
+ *(*int32)(unsafe.Pointer(bp + 32 /* x */)) = 1
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex-- // Remove the redundant vertex at the end
+ pOut = Xsqlite3_malloc64(tls, (uint64(unsafe.Sizeof(GeoPoly{})) + ((uint64(unsafe.Sizeof(GeoCoord(0))) * uint64(2)) * (uint64((Sqlite3_int64((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex)) - int64(4))))))
+ *(*int32)(unsafe.Pointer(bp + 32 /* x */)) = 1
+ if !(pOut == uintptr(0)) {
+ goto __14
+ }
+ goto parse_json_err
+__14:
+ ;
+ (*GeoPoly)(unsafe.Pointer(pOut)).FnVertex = (*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex
+ libc.Xmemcpy(tls, pOut+8 /* &.a */, (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa, ((uint64((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex * 2)) * uint64(unsafe.Sizeof(GeoCoord(0)))))
+ *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + uintptr(0))) = *(*uint8)(unsafe.Pointer(bp + 32 /* &x */))
+ *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + uintptr(1))) = (uint8(((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex >> 16) & 0xff))
+ *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + uintptr(2))) = (uint8(((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex >> 8) & 0xff))
+ *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + uintptr(3))) = (uint8((*GeoParse)(unsafe.Pointer(bp /* &s */)).FnVertex & 0xff))
+ Xsqlite3_free(tls, (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa)
+ if !(pRc != 0) {
+ goto __15
+ }
+ *(*int32)(unsafe.Pointer(pRc)) = 0
+__15:
+ ;
+ return pOut
+ goto __13
+__12:
+ (*GeoParse)(unsafe.Pointer(bp /* &s */)).FnErr++
+ rc = 1
+__13:
+ ;
+__1:
+ ;
+parse_json_err:
+ if !(pRc != 0) {
+ goto __16
+ }
+ *(*int32)(unsafe.Pointer(pRc)) = rc
+__16:
+ ;
+ Xsqlite3_free(tls, (*GeoParse)(unsafe.Pointer(bp /* &s */)).Fa)
+ return uintptr(0)
+}
+
+// Given a function parameter, try to interpret it as a polygon, either
+// in the binary format or JSON text. Compute a GeoPoly object and
+// return a pointer to that object. Or if the input is not a well-formed
+// polygon, put an error message in sqlite3_context and return NULL.
+func geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) uintptr { /* sqlite3.c:192730:16: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var p uintptr = uintptr(0)
+ var nByte int32
+ if (Xsqlite3_value_type(tls, pVal) == 4) &&
+ ((uint64(libc.AssignInt32(&nByte, Xsqlite3_value_bytes(tls, pVal)))) >= (uint64(4) + (uint64(6) * uint64(unsafe.Sizeof(GeoCoord(0)))))) {
+ var a uintptr = Xsqlite3_value_blob(tls, pVal)
+ var nVertex int32
+ nVertex = (((int32(*(*uint8)(unsafe.Pointer(a + uintptr(1)))) << 16) + (int32(*(*uint8)(unsafe.Pointer(a + uintptr(2)))) << 8)) + int32(*(*uint8)(unsafe.Pointer(a + uintptr(3)))))
+ if ((int32(*(*uint8)(unsafe.Pointer(a + uintptr(0)))) == 0) || (int32(*(*uint8)(unsafe.Pointer(a + uintptr(0)))) == 1)) &&
+ ((((uint64(nVertex * 2)) * uint64(unsafe.Sizeof(GeoCoord(0)))) + uint64(4)) == uint64(uint32(nByte))) {
+ p = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(GeoPoly{})) + ((uint64((nVertex - 1) * 2)) * uint64(unsafe.Sizeof(GeoCoord(0)))))))
+ if p == uintptr(0) {
+ if pRc != 0 {
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+ }
+ if pCtx != 0 {
+ Xsqlite3_result_error_nomem(tls, pCtx)
+ }
+ } else {
+ *(*int32)(unsafe.Pointer(bp /* x */)) = 1
+ (*GeoPoly)(unsafe.Pointer(p)).FnVertex = nVertex
+ libc.Xmemcpy(tls, p+4 /* &.hdr */, a, uint64(nByte))
+ if int32(*(*uint8)(unsafe.Pointer(a + uintptr(0)))) != int32(*(*uint8)(unsafe.Pointer(bp /* &x */))) {
+ var ii int32
+ for ii = 0; ii < nVertex; ii++ {
+ geopolySwab32(tls, ((p + 8 /* &.a */) + uintptr(((ii)*2))*4))
+ geopolySwab32(tls, ((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))
+ }
+ *(*uint8)(unsafe.Pointer((p + 4 /* &.hdr */) + uintptr(0))) ^= uint8((1))
+ }
+ }
+ }
+ if pRc != 0 {
+ *(*int32)(unsafe.Pointer(pRc)) = 0
+ }
+ return p
+ } else if Xsqlite3_value_type(tls, pVal) == 3 {
+ var zJson uintptr = Xsqlite3_value_text(tls, pVal)
+ if zJson == uintptr(0) {
+ if pRc != 0 {
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+ }
+ return uintptr(0)
+ }
+ return geopolyParseJson(tls, zJson, pRc)
+ } else {
+ if pRc != 0 {
+ *(*int32)(unsafe.Pointer(pRc)) = 1
+ }
+ return uintptr(0)
+ }
+ return uintptr(0)
+}
+
+// Implementation of the geopoly_blob(X) function.
+//
+// If the input is a well-formed Geopoly BLOB or JSON string
+// then return the BLOB representation of the polygon. Otherwise
+// return NULL.
+func geopolyBlobFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192786:13: */
+ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), uintptr(0))
+ if p != 0 {
+ Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */
+ (4 + (8 * (*GeoPoly)(unsafe.Pointer(p)).FnVertex)), libc.UintptrFromInt32(-1))
+ Xsqlite3_free(tls, p)
+ }
+}
+
+// SQL function: geopoly_json(X)
+//
+// Interpret X as a polygon and render it as a JSON array
+// of coordinates. Or, if X is not a valid polygon, return NULL.
+func geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192805:13: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), uintptr(0))
+ if p != 0 {
+ var db uintptr = Xsqlite3_context_db_handle(tls, context)
+ var x uintptr = Xsqlite3_str_new(tls, db)
+ var i int32
+ Xsqlite3_str_append(tls, x, ts+30752 /* "[" */, 1)
+ for i = 0; i < (*GeoPoly)(unsafe.Pointer(p)).FnVertex; i++ {
+ Xsqlite3_str_appendf(tls, x, ts+30754 /* "[%!g,%!g]," */, libc.VaList(bp, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((i)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((i)*2)+1))*4)))))
+ }
+ Xsqlite3_str_appendf(tls, x, ts+30765 /* "[%!g,%!g]]" */, libc.VaList(bp+16, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((0)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((0)*2)+1))*4)))))
+ Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3_free(tls, p)
+ }
+}
+
+// SQL function: geopoly_svg(X, ....)
+//
+// Interpret X as a polygon and render it as a SVG <polyline>.
+// Additional arguments are added as attributes to the <polyline>.
+func geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192831:13: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ var p uintptr
+ if argc < 1 {
+ return
+ }
+ p = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), uintptr(0))
+ if p != 0 {
+ var db uintptr = Xsqlite3_context_db_handle(tls, context)
+ var x uintptr = Xsqlite3_str_new(tls, db)
+ var i int32
+ var cSep int8 = int8('\'')
+ Xsqlite3_str_appendf(tls, x, ts+30776 /* "<polyline points..." */, 0)
+ for i = 0; i < (*GeoPoly)(unsafe.Pointer(p)).FnVertex; i++ {
+ Xsqlite3_str_appendf(tls, x, ts+30794 /* "%c%g,%g" */, libc.VaList(bp, int32(cSep), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((i)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((i)*2)+1))*4)))))
+ cSep = int8(' ')
+ }
+ Xsqlite3_str_appendf(tls, x, ts+30802 /* " %g,%g'" */, libc.VaList(bp+24, float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((0)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((0)*2)+1))*4)))))
+ for i = 1; i < argc; i++ {
+ var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
+ if (z != 0) && (*(*int8)(unsafe.Pointer(z + uintptr(0))) != 0) {
+ Xsqlite3_str_appendf(tls, x, ts+30810 /* " %s" */, libc.VaList(bp+40, z))
+ }
+ }
+ Xsqlite3_str_appendf(tls, x, ts+30814 /* "></polyline>" */, 0)
+ Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -1, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ Xsqlite3_free(tls, p)
+ }
+}
+
+// SQL Function: geopoly_xform(poly, A, B, C, D, E, F)
+//
+// Transform and/or translate a polygon as follows:
+//
+// x1 = A*x0 + B*y0 + E
+// y1 = C*x0 + D*y0 + F
+//
+// For a translation:
+//
+// geopoly_xform(poly, 1, 0, 0, 1, x-offset, y-offset)
+//
+// Rotate by R around the point (0,0):
+//
+// geopoly_xform(poly, cos(R), sin(R), -sin(R), cos(R), 0, 0)
+func geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192878:13: */
+ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), uintptr(0))
+ var A float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
+ var B float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)))
+ var C float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)))
+ var D float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8)))
+ var E float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(5)*8)))
+ var F float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(6)*8)))
+ var x1 GeoCoord
+ var y1 GeoCoord
+ var x0 GeoCoord
+ var y0 GeoCoord
+ var ii int32
+ if p != 0 {
+ for ii = 0; ii < (*GeoPoly)(unsafe.Pointer(p)).FnVertex; ii++ {
+ x0 = *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii)*2))*4))
+ y0 = *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))
+ x1 = (GeoCoord(((A * float64(x0)) + (B * float64(y0))) + E))
+ y1 = (GeoCoord(((C * float64(x0)) + (D * float64(y0))) + F))
+ (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii)*2))*4))) = x1
+ (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))) = y1
+ }
+ Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */
+ (4 + (8 * (*GeoPoly)(unsafe.Pointer(p)).FnVertex)), libc.UintptrFromInt32(-1))
+ Xsqlite3_free(tls, p)
+ }
+}
+
+// Compute the area enclosed by the polygon.
+//
+// This routine can also be used to detect polygons that rotate in
+// the wrong direction. Polygons are suppose to be counter-clockwise (CCW).
+// This routine returns a negative value for clockwise (CW) polygons.
+func geopolyArea(tls *libc.TLS, p uintptr) float64 { /* sqlite3.c:192914:15: */
+ var rArea float64 = 0.0
+ var ii int32
+ for ii = 0; ii < ((*GeoPoly)(unsafe.Pointer(p)).FnVertex - 1); ii++ {
+ rArea = rArea + ((float64(((*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii)*2))*4))) - (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii+1)*2))*4)))) * // (x0 - x1)
+ ((*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))) + (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii+1)*2)+1))*4)))))) * // (y0 + y1)
+ 0.5)
+ }
+ rArea = rArea + ((float64(((*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii)*2))*4))) - (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((0)*2))*4)))) * // (xN - x0)
+ ((*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))) + (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((0)*2)+1))*4)))))) * // (yN + y0)
+ 0.5)
+ return rArea
+}
+
+// Implementation of the geopoly_area(X) function.
+//
+// If the input is a well-formed Geopoly BLOB then return the area
+// enclosed by the polygon. If the polygon circulates clockwise instead
+// of counterclockwise (as it should) then return the negative of the
+// enclosed area. Otherwise return NULL.
+func geopolyAreaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192936:13: */
+ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), uintptr(0))
+ if p != 0 {
+ Xsqlite3_result_double(tls, context, geopolyArea(tls, p))
+ Xsqlite3_free(tls, p)
+ }
+}
+
+// Implementation of the geopoly_ccw(X) function.
+//
+// If the rotation of polygon X is clockwise (incorrect) instead of
+// counter-clockwise (the correct winding order according to RFC7946)
+// then reverse the order of the vertexes in polygon X.
+//
+// In other words, this routine returns a CCW polygon regardless of the
+// winding order of its input.
+//
+// Use this routine to sanitize historical inputs that that sometimes
+// contain polygons that wind in the wrong direction.
+func geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:192961:13: */
+ var p uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), uintptr(0))
+ if p != 0 {
+ if geopolyArea(tls, p) < 0.0 {
+ var ii int32
+ var jj int32
+ ii = 1
+ jj = ((*GeoPoly)(unsafe.Pointer(p)).FnVertex - 1)
+ __1:
+ if !(ii < jj) {
+ goto __3
+ }
+ {
+ var t GeoCoord = *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii)*2))*4))
+ (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((ii)*2))*4))) = *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((jj)*2))*4))
+ (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((jj)*2))*4))) = t
+ t = *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))
+ (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))) = *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((jj)*2)+1))*4))
+ (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((jj)*2)+1))*4))) = t
+ }
+ goto __2
+ __2:
+ ii++
+ jj--
+ goto __1
+ goto __3
+ __3:
+ }
+ Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */
+ (4 + (8 * (*GeoPoly)(unsafe.Pointer(p)).FnVertex)), libc.UintptrFromInt32(-1))
+ Xsqlite3_free(tls, p)
+ }
+}
+
+// Fast approximation for sine(X) for X between -0.5*pi and 2*pi
+func geopolySine(tls *libc.TLS, r float64) float64 { /* sqlite3.c:192989:15: */
+
+ if r >= (float64(1.5) * 3.1415926535897932385) {
+ r = r - (float64(2.0) * 3.1415926535897932385)
+ }
+ if r >= (float64(0.5) * 3.1415926535897932385) {
+ return -geopolySine(tls, (r - 3.1415926535897932385))
+ } else {
+ var r2 float64 = (r * r)
+ var r3 float64 = (r2 * r)
+ var r5 float64 = (r3 * r2)
+ return (((0.9996949 * r) - (0.1656700 * r3)) + (0.0075134 * r5))
+ }
+ return float64(0)
+}
+
+// Function: geopoly_regular(X,Y,R,N)
+//
+// Construct a simple, convex, regular polygon centered at X, Y
+// with circumradius R and with N sides.
+func geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193010:13: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var x float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ var y float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
+ var r float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)))
+ var n int32 = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)))
+ // var i int32 at bp, 4
+
+ var p uintptr
+
+ if (n < 3) || (r <= 0.0) {
+ return
+ }
+ if n > 1000 {
+ n = 1000
+ }
+ p = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(GeoPoly{})) + ((uint64((n - 1) * 2)) * uint64(unsafe.Sizeof(GeoCoord(0)))))))
+ if p == uintptr(0) {
+ Xsqlite3_result_error_nomem(tls, context)
+ return
+ }
+ *(*int32)(unsafe.Pointer(bp /* i */)) = 1
+ *(*uint8)(unsafe.Pointer((p + 4 /* &.hdr */) + uintptr(0))) = *(*uint8)(unsafe.Pointer(bp /* &i */))
+ *(*uint8)(unsafe.Pointer((p + 4 /* &.hdr */) + uintptr(1))) = uint8(0)
+ *(*uint8)(unsafe.Pointer((p + 4 /* &.hdr */) + uintptr(2))) = (uint8((n >> 8) & 0xff))
+ *(*uint8)(unsafe.Pointer((p + 4 /* &.hdr */) + uintptr(3))) = (uint8(n & 0xff))
+ for *(*int32)(unsafe.Pointer(bp /* i */)) = 0; *(*int32)(unsafe.Pointer(bp /* i */)) < n; *(*int32)(unsafe.Pointer(bp /* i */))++ {
+ var rAngle float64 = (((float64(2.0) * 3.1415926535897932385) * float64(*(*int32)(unsafe.Pointer(bp /* i */)))) / float64(n))
+ (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((*(*int32)(unsafe.Pointer(bp /* i */)))*2))*4))) = (GeoCoord(x - (r * geopolySine(tls, (rAngle-(float64(0.5)*3.1415926535897932385))))))
+ (*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((*(*int32)(unsafe.Pointer(bp /* i */)))*2)+1))*4))) = (GeoCoord(y + (r * geopolySine(tls, rAngle))))
+ }
+ Xsqlite3_result_blob(tls, context, p+4 /* &.hdr */, (4 + (8 * n)), libc.UintptrFromInt32(-1))
+ Xsqlite3_free(tls, p)
+}
+
+// If pPoly is a polygon, compute its bounding box. Then:
+//
+// (1) if aCoord!=0 store the bounding box in aCoord, returning NULL
+// (2) otherwise, compute a GeoPoly for the bounding box and return the
+// new GeoPoly
+//
+// If pPoly is NULL but aCoord is not NULL, then compute a new GeoPoly from
+// the bounding box in aCoord and return a pointer to that GeoPoly.
+func geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, pRc uintptr) uintptr { /* sqlite3.c:193053:16: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var pOut uintptr
+ var p uintptr
+ var mnX float32
+ var mxX float32
+ var mnY float32
+ var mxY float32
+ var r float64
+ // var ii int32 at bp, 4
+ pOut = uintptr(0)
+ if !((pPoly == uintptr(0)) && (aCoord != uintptr(0))) {
+ goto __1
+ }
+ p = uintptr(0)
+ mnX = *(*RtreeValue)(unsafe.Pointer(aCoord + uintptr(0)*4))
+ mxX = *(*RtreeValue)(unsafe.Pointer(aCoord + uintptr(1)*4))
+ mnY = *(*RtreeValue)(unsafe.Pointer(aCoord + uintptr(2)*4))
+ mxY = *(*RtreeValue)(unsafe.Pointer(aCoord + uintptr(3)*4))
+ goto geopolyBboxFill
+ goto __2
+__1:
+ p = geopolyFuncParam(tls, context, pPoly, pRc)
+__2:
+ ;
+ if !(p != 0) {
+ goto __3
+ }
+ mnX = libc.AssignFloat32(&mxX, *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((0)*2))*4)))
+ mnY = libc.AssignFloat32(&mxY, *(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((0)*2)+1))*4)))
+ *(*int32)(unsafe.Pointer(bp /* ii */)) = 1
+__5:
+ if !(*(*int32)(unsafe.Pointer(bp /* ii */)) < (*GeoPoly)(unsafe.Pointer(p)).FnVertex) {
+ goto __7
+ }
+ r = float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr(((*(*int32)(unsafe.Pointer(bp /* ii */)))*2))*4)))
+ if !(r < float64(mnX)) {
+ goto __8
+ }
+ mnX = float32(r)
+ goto __9
+__8:
+ if !(r > float64(mxX)) {
+ goto __10
+ }
+ mxX = float32(r)
+__10:
+ ;
+__9:
+ ;
+ r = float64(*(*GeoCoord)(unsafe.Pointer((p + 8 /* &.a */) + uintptr((((*(*int32)(unsafe.Pointer(bp /* ii */)))*2)+1))*4)))
+ if !(r < float64(mnY)) {
+ goto __11
+ }
+ mnY = float32(r)
+ goto __12
+__11:
+ if !(r > float64(mxY)) {
+ goto __13
+ }
+ mxY = float32(r)
+__13:
+ ;
+__12:
+ ;
+ goto __6
+__6:
+ *(*int32)(unsafe.Pointer(bp /* ii */))++
+ goto __5
+ goto __7
+__7:
+ ;
+ if !(pRc != 0) {
+ goto __14
+ }
+ *(*int32)(unsafe.Pointer(pRc)) = 0
+__14:
+ ;
+ if !(aCoord == uintptr(0)) {
+ goto __15
+ }
+geopolyBboxFill:
+ pOut = Xsqlite3_realloc64(tls, p, (uint64(unsafe.Sizeof(GeoPoly{})) + ((uint64(unsafe.Sizeof(GeoCoord(0))) * uint64(2)) * (uint64((4) - 4)))))
+ if !(pOut == uintptr(0)) {
+ goto __17
+ }
+ Xsqlite3_free(tls, p)
+ if !(context != 0) {
+ goto __18
+ }
+ Xsqlite3_result_error_nomem(tls, context)
+__18:
+ ;
+ if !(pRc != 0) {
+ goto __19
+ }
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+__19:
+ ;
+ return uintptr(0)
+__17:
+ ;
+ (*GeoPoly)(unsafe.Pointer(pOut)).FnVertex = 4
+ *(*int32)(unsafe.Pointer(bp /* ii */)) = 1
+ *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + uintptr(0))) = *(*uint8)(unsafe.Pointer(bp /* &ii */))
+ *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + uintptr(1))) = uint8(0)
+ *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + uintptr(2))) = uint8(0)
+ *(*uint8)(unsafe.Pointer((pOut + 4 /* &.hdr */) + uintptr(3))) = uint8(4)
+ (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + uintptr(((0)*2))*4))) = mnX
+ (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + uintptr((((0)*2)+1))*4))) = mnY
+ (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + uintptr(((1)*2))*4))) = mxX
+ (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + uintptr((((1)*2)+1))*4))) = mnY
+ (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + uintptr(((2)*2))*4))) = mxX
+ (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + uintptr((((2)*2)+1))*4))) = mxY
+ (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + uintptr(((3)*2))*4))) = mnX
+ (*(*GeoCoord)(unsafe.Pointer((pOut + 8 /* &.a */) + uintptr((((3)*2)+1))*4))) = mxY
+ goto __16
+__15:
+ Xsqlite3_free(tls, p)
+ *(*RtreeValue)(unsafe.Pointer(aCoord + uintptr(0)*4)) = mnX
+ *(*RtreeValue)(unsafe.Pointer(aCoord + uintptr(1)*4)) = mxX
+ *(*RtreeValue)(unsafe.Pointer(aCoord + uintptr(2)*4)) = mnY
+ *(*RtreeValue)(unsafe.Pointer(aCoord + uintptr(3)*4)) = mxY
+__16:
+ ;
+ goto __4
+__3:
+ libc.Xmemset(tls, aCoord, 0, (uint64(unsafe.Sizeof(RtreeCoord{})) * uint64(4)))
+__4:
+ ;
+ return pOut
+}
+
+// Implementation of the geopoly_bbox(X) SQL function.
+func geopolyBBoxFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193124:13: */
+ var p uintptr = geopolyBBox(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), uintptr(0), uintptr(0))
+ if p != 0 {
+ Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */
+ (4 + (8 * (*GeoPoly)(unsafe.Pointer(p)).FnVertex)), libc.UintptrFromInt32(-1))
+ Xsqlite3_free(tls, p)
+ }
+}
+
+// State vector for the geopoly_group_bbox() aggregate function.
+type GeoBBox1 = struct {
+ FisInit int32
+ Fa [4]RtreeCoord
+}
+
+// State vector for the geopoly_group_bbox() aggregate function.
+type GeoBBox = GeoBBox1 /* sqlite3.c:193140:24 */
+
+// Implementation of the geopoly_group_bbox(X) aggregate SQL function.
+func geopolyBBoxStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193150:13: */
+ bp := tls.Alloc(20)
+ defer tls.Free(20)
+
+ // var a [4]RtreeCoord at bp, 16
+
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = 0
+ geopolyBBox(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), bp /* &a[0] */, bp+16 /* &rc */)
+ if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
+ var pBBox uintptr
+ pBBox = Xsqlite3_aggregate_context(tls, context, int32(unsafe.Sizeof(GeoBBox{})))
+ if pBBox == uintptr(0) {
+ return
+ }
+ if (*GeoBBox)(unsafe.Pointer(pBBox)).FisInit == 0 {
+ (*GeoBBox)(unsafe.Pointer(pBBox)).FisInit = 1
+ libc.Xmemcpy(tls, pBBox+4 /* &.a */, bp /* &a[0] */, (uint64(unsafe.Sizeof(RtreeCoord{})) * uint64(4)))
+ } else {
+ if *(*RtreeValue)(unsafe.Pointer(bp /* &a */ + uintptr(0)*4)) < *(*RtreeValue)(unsafe.Pointer((pBBox + 4 /* &.a */) + uintptr(0)*4)) {
+ *(*RtreeCoord)(unsafe.Pointer((pBBox + 4 /* &.a */) + uintptr(0)*4)) = *(*RtreeCoord)(unsafe.Pointer(bp /* &a[0] */ + uintptr(0)*4))
+ }
+ if *(*RtreeValue)(unsafe.Pointer(bp /* &a */ + uintptr(1)*4)) > *(*RtreeValue)(unsafe.Pointer((pBBox + 4 /* &.a */) + uintptr(1)*4)) {
+ *(*RtreeCoord)(unsafe.Pointer((pBBox + 4 /* &.a */) + uintptr(1)*4)) = *(*RtreeCoord)(unsafe.Pointer(bp /* &a[0] */ + uintptr(1)*4))
+ }
+ if *(*RtreeValue)(unsafe.Pointer(bp /* &a */ + uintptr(2)*4)) < *(*RtreeValue)(unsafe.Pointer((pBBox + 4 /* &.a */) + uintptr(2)*4)) {
+ *(*RtreeCoord)(unsafe.Pointer((pBBox + 4 /* &.a */) + uintptr(2)*4)) = *(*RtreeCoord)(unsafe.Pointer(bp /* &a[0] */ + uintptr(2)*4))
+ }
+ if *(*RtreeValue)(unsafe.Pointer(bp /* &a */ + uintptr(3)*4)) > *(*RtreeValue)(unsafe.Pointer((pBBox + 4 /* &.a */) + uintptr(3)*4)) {
+ *(*RtreeCoord)(unsafe.Pointer((pBBox + 4 /* &.a */) + uintptr(3)*4)) = *(*RtreeCoord)(unsafe.Pointer(bp /* &a[0] */ + uintptr(3)*4))
+ }
+ }
+ }
+}
+func geopolyBBoxFinal(tls *libc.TLS, context uintptr) { /* sqlite3.c:193173:13: */
+ var p uintptr
+ var pBBox uintptr
+ pBBox = Xsqlite3_aggregate_context(tls, context, 0)
+ if pBBox == uintptr(0) {
+ return
+ }
+ p = geopolyBBox(tls, context, uintptr(0), pBBox+4 /* &.a */, uintptr(0))
+ if p != 0 {
+ Xsqlite3_result_blob(tls, context, p+4, /* &.hdr */
+ (4 + (8 * (*GeoPoly)(unsafe.Pointer(p)).FnVertex)), libc.UintptrFromInt32(-1))
+ Xsqlite3_free(tls, p)
+ }
+}
+
+// Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2).
+// Returns:
+//
+// +2 x0,y0 is on the line segement
+//
+// +1 x0,y0 is beneath line segment
+//
+// 0 x0,y0 is not on or beneath the line segment or the line segment
+// is vertical and x0,y0 is not on the line segment
+//
+// The left-most coordinate min(x1,x2) is not considered to be part of
+// the line segment for the purposes of this analysis.
+func pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64) int32 { /* sqlite3.c:193203:12: */
+ var y float64
+ if (x0 == x1) && (y0 == y1) {
+ return 2
+ }
+ if x1 < x2 {
+ if (x0 <= x1) || (x0 > x2) {
+ return 0
+ }
+ } else if x1 > x2 {
+ if (x0 <= x2) || (x0 > x1) {
+ return 0
+ }
+ } else {
+ // Vertical line segment
+ if x0 != x1 {
+ return 0
+ }
+ if (y0 < y1) && (y0 < y2) {
+ return 0
+ }
+ if (y0 > y1) && (y0 > y2) {
+ return 0
+ }
+ return 2
+ }
+ y = (y1 + (((y2 - y1) * (x0 - x1)) / (x2 - x1)))
+ if y0 == y {
+ return 2
+ }
+ if y0 < y {
+ return 1
+ }
+ return 0
+}
+
+// SQL function: geopoly_contains_point(P,X,Y)
+//
+// Return +2 if point X,Y is within polygon P.
+// Return +1 if point X,Y is on the polygon boundary.
+// Return 0 if point X,Y is outside the polygon
+func geopolyContainsPointFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193234:13: */
+ var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), uintptr(0))
+ var x0 float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
+ var y0 float64 = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)))
+ var v int32 = 0
+ var cnt int32 = 0
+ var ii int32
+ if p1 == uintptr(0) {
+ return
+ }
+ for ii = 0; ii < ((*GeoPoly)(unsafe.Pointer(p1)).FnVertex - 1); ii++ {
+ v = pointBeneathLine(tls, x0, y0, float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr(((ii)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))),
+ float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr(((ii+1)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr((((ii+1)*2)+1))*4))))
+ if v == 2 {
+ break
+ }
+ cnt = cnt + (v)
+ }
+ if v != 2 {
+ v = pointBeneathLine(tls, x0, y0, float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr(((ii)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr((((ii)*2)+1))*4))),
+ float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr(((0)*2))*4))), float64(*(*GeoCoord)(unsafe.Pointer((p1 + 8 /* &.a */) + uintptr((((0)*2)+1))*4))))
+ }
+ if v == 2 {
+ Xsqlite3_result_int(tls, context, 1)
+ } else if ((v + cnt) & 1) == 0 {
+ Xsqlite3_result_int(tls, context, 0)
+ } else {
+ Xsqlite3_result_int(tls, context, 2)
+ }
+ Xsqlite3_free(tls, p1)
+}
+
+// SQL function: geopoly_within(P1,P2)
+//
+// Return +2 if P1 and P2 are the same polygon
+// Return +1 if P2 is contained within P1
+// Return 0 if any part of P2 is on the outside of P1
+//
+func geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193277:13: */
+ var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), uintptr(0))
+ var p2 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), uintptr(0))
+ if (p1 != 0) && (p2 != 0) {
+ var x int32 = geopolyOverlap(tls, p1, p2)
+ if x < 0 {
+ Xsqlite3_result_error_nomem(tls, context)
+ } else {
+ Xsqlite3_result_int(tls, context, func() int32 {
+ if x == 2 {
+ return 1
+ }
+ return func() int32 {
+ if x == 4 {
+ return 2
+ }
+ return 0
+ }()
+ }())
+ }
+ }
+ Xsqlite3_free(tls, p1)
+ Xsqlite3_free(tls, p2)
+}
+
+// Objects used by the overlap algorihm.
+type GeoEvent1 = struct {
+ Fx float64
+ FeType int32
+ FpSeg uintptr
+ FpNext uintptr
+}
+
+// Objects used by the overlap algorihm.
+type GeoEvent = GeoEvent1 /* sqlite3.c:193297:25 */
+type GeoSegment1 = struct {
+ FC float64
+ FB float64
+ Fy float64
+ Fy0 float32
+ Fside uint8
+ Fidx uint32
+ FpNext uintptr
+}
+
+type GeoSegment = GeoSegment1 /* sqlite3.c:193298:27 */
+type GeoOverlap1 = struct {
+ FaEvent uintptr
+ FaSegment uintptr
+ FnEvent int32
+ FnSegment int32
+}
+
+type GeoOverlap = GeoOverlap1 /* sqlite3.c:193299:27 */
+
+// Add a single segment and its associated events.
+func geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 GeoCoord, y0 GeoCoord, x1 GeoCoord, y1 GeoCoord, side uint8, idx uint32) { /* sqlite3.c:193324:13: */
+ var pSeg uintptr
+ var pEvent uintptr
+ if x0 == x1 {
+ return
+ } // Ignore vertical segments
+ if x0 > x1 {
+ var t GeoCoord = x0
+ x0 = x1
+ x1 = t
+ t = y0
+ y0 = y1
+ y1 = t
+ }
+ pSeg = ((*GeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*GeoOverlap)(unsafe.Pointer(p)).FnSegment)*48)
+ (*GeoOverlap)(unsafe.Pointer(p)).FnSegment++
+ (*GeoSegment)(unsafe.Pointer(pSeg)).FC = (float64((y1 - y0) / (x1 - x0)))
+ (*GeoSegment)(unsafe.Pointer(pSeg)).FB = (float64(y1) - (float64(x1) * (*GeoSegment)(unsafe.Pointer(pSeg)).FC))
+ (*GeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0
+ (*GeoSegment)(unsafe.Pointer(pSeg)).Fside = side
+ (*GeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx
+ pEvent = ((*GeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr((*GeoOverlap)(unsafe.Pointer(p)).FnEvent)*32)
+ (*GeoOverlap)(unsafe.Pointer(p)).FnEvent++
+ (*GeoEvent)(unsafe.Pointer(pEvent)).Fx = float64(x0)
+ (*GeoEvent)(unsafe.Pointer(pEvent)).FeType = 0
+ (*GeoEvent)(unsafe.Pointer(pEvent)).FpSeg = pSeg
+ pEvent = ((*GeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr((*GeoOverlap)(unsafe.Pointer(p)).FnEvent)*32)
+ (*GeoOverlap)(unsafe.Pointer(p)).FnEvent++
+ (*GeoEvent)(unsafe.Pointer(pEvent)).Fx = float64(x1)
+ (*GeoEvent)(unsafe.Pointer(pEvent)).FeType = 1
+ (*GeoEvent)(unsafe.Pointer(pEvent)).FpSeg = pSeg
+}
+
+// Insert all segments and events for polygon pPoly.
+func geopolyAddSegments(tls *libc.TLS, p uintptr, pPoly uintptr, side uint8) { /* sqlite3.c:193368:13: */
+ var i uint32
+ var x uintptr
+ for i = uint32(0); i < (uint32((*GeoPoly)(unsafe.Pointer(pPoly)).FnVertex) - uint32(1)); i++ {
+ x = ((pPoly + 8 /* &.a */) + uintptr(((i)*uint32(2)))*4)
+ geopolyAddOneSegment(tls, p, *(*GeoCoord)(unsafe.Pointer(x + uintptr(0)*4)), *(*GeoCoord)(unsafe.Pointer(x + uintptr(1)*4)), *(*GeoCoord)(unsafe.Pointer(x + uintptr(2)*4)), *(*GeoCoord)(unsafe.Pointer(x + uintptr(3)*4)), side, i)
+ }
+ x = ((pPoly + 8 /* &.a */) + uintptr(((i)*uint32(2)))*4)
+ geopolyAddOneSegment(tls, p, *(*GeoCoord)(unsafe.Pointer(x + uintptr(0)*4)), *(*GeoCoord)(unsafe.Pointer(x + uintptr(1)*4)), *(*GeoCoord)(unsafe.Pointer((pPoly + 8 /* &.a */) + uintptr(0)*4)), *(*GeoCoord)(unsafe.Pointer((pPoly + 8 /* &.a */) + uintptr(1)*4)), side, i)
+}
+
+// Merge two lists of sorted events by X coordinate
+func geopolyEventMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:193386:17: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ // var head GeoEvent at bp, 32
+
+ var pLast uintptr
+ (*GeoEvent)(unsafe.Pointer(bp /* &head */)).FpNext = uintptr(0)
+ pLast = bp /* &head */
+ for (pRight != 0) && (pLeft != 0) {
+ if (*GeoEvent)(unsafe.Pointer(pRight)).Fx <= (*GeoEvent)(unsafe.Pointer(pLeft)).Fx {
+ (*GeoEvent)(unsafe.Pointer(pLast)).FpNext = pRight
+ pLast = pRight
+ pRight = (*GeoEvent)(unsafe.Pointer(pRight)).FpNext
+ } else {
+ (*GeoEvent)(unsafe.Pointer(pLast)).FpNext = pLeft
+ pLast = pLeft
+ pLeft = (*GeoEvent)(unsafe.Pointer(pLeft)).FpNext
+ }
+ }
+ (*GeoEvent)(unsafe.Pointer(pLast)).FpNext = func() uintptr {
+ if pRight != 0 {
+ return pRight
+ }
+ return pLeft
+ }()
+ return (*GeoEvent)(unsafe.Pointer(bp /* &head */)).FpNext
+}
+
+// Sort an array of nEvent event objects into a list.
+func geopolySortEventsByX(tls *libc.TLS, aEvent uintptr, nEvent int32) uintptr { /* sqlite3.c:193408:17: */
+ bp := tls.Alloc(400)
+ defer tls.Free(400)
+
+ var mx int32 = 0
+ var i int32
+ var j int32
+ var p uintptr
+ // var a [50]uintptr at bp, 400
+
+ for i = 0; i < nEvent; i++ {
+ p = (aEvent + uintptr(i)*32)
+ (*GeoEvent)(unsafe.Pointer(p)).FpNext = uintptr(0)
+ for j = 0; (j < mx) && (*(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(j)*8)) != 0); j++ {
+ p = geopolyEventMerge(tls, *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(j)*8)), p)
+ *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(j)*8)) = uintptr(0)
+ }
+ *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(j)*8)) = p
+ if j >= mx {
+ mx = (j + 1)
+ }
+ }
+ p = uintptr(0)
+ for i = 0; i < mx; i++ {
+ p = geopolyEventMerge(tls, *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*8)), p)
+ }
+ return p
+}
+
+// Merge two lists of sorted segments by Y, and then by C.
+func geopolySegmentMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:193433:19: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ // var head GeoSegment at bp, 48
+
+ var pLast uintptr
+ (*GeoSegment)(unsafe.Pointer(bp /* &head */)).FpNext = uintptr(0)
+ pLast = bp /* &head */
+ for (pRight != 0) && (pLeft != 0) {
+ var r float64 = ((*GeoSegment)(unsafe.Pointer(pRight)).Fy - (*GeoSegment)(unsafe.Pointer(pLeft)).Fy)
+ if r == 0.0 {
+ r = ((*GeoSegment)(unsafe.Pointer(pRight)).FC - (*GeoSegment)(unsafe.Pointer(pLeft)).FC)
+ }
+ if r < 0.0 {
+ (*GeoSegment)(unsafe.Pointer(pLast)).FpNext = pRight
+ pLast = pRight
+ pRight = (*GeoSegment)(unsafe.Pointer(pRight)).FpNext
+ } else {
+ (*GeoSegment)(unsafe.Pointer(pLast)).FpNext = pLeft
+ pLast = pLeft
+ pLeft = (*GeoSegment)(unsafe.Pointer(pLeft)).FpNext
+ }
+ }
+ (*GeoSegment)(unsafe.Pointer(pLast)).FpNext = func() uintptr {
+ if pRight != 0 {
+ return pRight
+ }
+ return pLeft
+ }()
+ return (*GeoSegment)(unsafe.Pointer(bp /* &head */)).FpNext
+}
+
+// Sort a list of GeoSegments in order of increasing Y and in the event of
+// a tie, increasing C (slope).
+func geopolySortSegmentsByYAndC(tls *libc.TLS, pList uintptr) uintptr { /* sqlite3.c:193458:19: */
+ bp := tls.Alloc(400)
+ defer tls.Free(400)
+
+ var mx int32 = 0
+ var i int32
+ var p uintptr
+ // var a [50]uintptr at bp, 400
+
+ for pList != 0 {
+ p = pList
+ pList = (*GeoSegment)(unsafe.Pointer(pList)).FpNext
+ (*GeoSegment)(unsafe.Pointer(p)).FpNext = uintptr(0)
+ for i = 0; (i < mx) && (*(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*8)) != 0); i++ {
+ p = geopolySegmentMerge(tls, *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*8)), p)
+ *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*8)) = uintptr(0)
+ }
+ *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*8)) = p
+ if i >= mx {
+ mx = (i + 1)
+ }
+ }
+ p = uintptr(0)
+ for i = 0; i < mx; i++ {
+ p = geopolySegmentMerge(tls, *(*uintptr)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*8)), p)
+ }
+ return p
+}
+
+// Determine the overlap between two polygons
+func geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:193484:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var nVertex Sqlite3_int64
+ var p uintptr
+ var nByte Sqlite3_int64
+ var pThisEvent uintptr
+ var rX float64
+ var rc int32
+ var needSort int32
+ var pActive uintptr
+ var pSeg uintptr
+ // var aOverlap [4]uint8 at bp, 4
+
+ var y float64
+ var pPrev uintptr
+ var iMask int32
+ nVertex = (Sqlite3_int64(((*GeoPoly)(unsafe.Pointer(p1)).FnVertex + (*GeoPoly)(unsafe.Pointer(p2)).FnVertex) + 2))
+ rc = 0
+ needSort = 0
+ pActive = uintptr(0)
+
+ nByte = (Sqlite3_int64((((uint64(unsafe.Sizeof(GeoEvent{})) * uint64(nVertex)) * uint64(2)) +
+ (uint64(unsafe.Sizeof(GeoSegment{})) * uint64(nVertex))) +
+ uint64(unsafe.Sizeof(GeoOverlap{}))))
+ p = Xsqlite3_malloc64(tls, uint64(nByte))
+ if !(p == uintptr(0)) {
+ goto __1
+ }
+ return -1
+__1:
+ ;
+ (*GeoOverlap)(unsafe.Pointer(p)).FaEvent = (p + uintptr(1)*24)
+ (*GeoOverlap)(unsafe.Pointer(p)).FaSegment = ((*GeoOverlap)(unsafe.Pointer(p)).FaEvent + uintptr((nVertex*int64(2)))*32)
+ (*GeoOverlap)(unsafe.Pointer(p)).FnEvent = libc.AssignPtrInt32(p+20 /* &.nSegment */, 0)
+ geopolyAddSegments(tls, p, p1, uint8(1))
+ geopolyAddSegments(tls, p, p2, uint8(2))
+ pThisEvent = geopolySortEventsByX(tls, (*GeoOverlap)(unsafe.Pointer(p)).FaEvent, (*GeoOverlap)(unsafe.Pointer(p)).FnEvent)
+ if (*GeoEvent)(unsafe.Pointer(pThisEvent)).Fx == 0.0 {
+ rX = -1.0
+ } else {
+ rX = 0.0
+ }
+ libc.Xmemset(tls, bp /* &aOverlap[0] */, 0, uint64(unsafe.Sizeof([4]uint8{})))
+__2:
+ if !(pThisEvent != 0) {
+ goto __3
+ }
+ if !((*GeoEvent)(unsafe.Pointer(pThisEvent)).Fx != rX) {
+ goto __4
+ }
+ pPrev = uintptr(0)
+ iMask = 0
+
+ rX = (*GeoEvent)(unsafe.Pointer(pThisEvent)).Fx
+ if !(needSort != 0) {
+ goto __5
+ }
+
+ pActive = geopolySortSegmentsByYAndC(tls, pActive)
+ needSort = 0
+__5:
+ ;
+ pSeg = pActive
+__6:
+ if !(pSeg != 0) {
+ goto __8
+ }
+ if !(pPrev != 0) {
+ goto __9
+ }
+ if !((*GeoSegment)(unsafe.Pointer(pPrev)).Fy != (*GeoSegment)(unsafe.Pointer(pSeg)).Fy) {
+ goto __10
+ }
+
+ *(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + uintptr(iMask))) = uint8(1)
+__10:
+ ;
+__9:
+ ;
+ iMask = iMask ^ (int32((*GeoSegment)(unsafe.Pointer(pSeg)).Fside))
+ pPrev = pSeg
+ goto __7
+__7:
+ pSeg = (*GeoSegment)(unsafe.Pointer(pSeg)).FpNext
+ goto __6
+ goto __8
+__8:
+ ;
+ pPrev = uintptr(0)
+ pSeg = pActive
+__11:
+ if !(pSeg != 0) {
+ goto __13
+ }
+ y = (((*GeoSegment)(unsafe.Pointer(pSeg)).FC * rX) + (*GeoSegment)(unsafe.Pointer(pSeg)).FB)
+
+ (*GeoSegment)(unsafe.Pointer(pSeg)).Fy = y
+ if !(pPrev != 0) {
+ goto __14
+ }
+ if !(((*GeoSegment)(unsafe.Pointer(pPrev)).Fy > (*GeoSegment)(unsafe.Pointer(pSeg)).Fy) && (int32((*GeoSegment)(unsafe.Pointer(pPrev)).Fside) != int32((*GeoSegment)(unsafe.Pointer(pSeg)).Fside))) {
+ goto __15
+ }
+ rc = 1
+
+ goto geopolyOverlapDone
+ goto __16
+__15:
+ if !((*GeoSegment)(unsafe.Pointer(pPrev)).Fy != (*GeoSegment)(unsafe.Pointer(pSeg)).Fy) {
+ goto __17
+ }
+
+ *(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + uintptr(iMask))) = uint8(1)
+__17:
+ ;
+__16:
+ ;
+__14:
+ ;
+ iMask = iMask ^ (int32((*GeoSegment)(unsafe.Pointer(pSeg)).Fside))
+ pPrev = pSeg
+ goto __12
+__12:
+ pSeg = (*GeoSegment)(unsafe.Pointer(pSeg)).FpNext
+ goto __11
+ goto __13
+__13:
+ ;
+__4:
+ ;
+
+ if !((*GeoEvent)(unsafe.Pointer(pThisEvent)).FeType == 0) {
+ goto __18
+ }
+ // Add a segment
+ pSeg = (*GeoEvent)(unsafe.Pointer(pThisEvent)).FpSeg
+ (*GeoSegment)(unsafe.Pointer(pSeg)).Fy = float64((*GeoSegment)(unsafe.Pointer(pSeg)).Fy0)
+ (*GeoSegment)(unsafe.Pointer(pSeg)).FpNext = pActive
+ pActive = pSeg
+ needSort = 1
+ goto __19
+__18:
+ // Remove a segment
+ if !(pActive == (*GeoEvent)(unsafe.Pointer(pThisEvent)).FpSeg) {
+ goto __20
+ }
+ pActive = (*GeoSegment)(unsafe.Pointer(pActive)).FpNext
+ goto __21
+__20:
+ pSeg = pActive
+__22:
+ if !(pSeg != 0) {
+ goto __24
+ }
+ if !((*GeoSegment)(unsafe.Pointer(pSeg)).FpNext == (*GeoEvent)(unsafe.Pointer(pThisEvent)).FpSeg) {
+ goto __25
+ }
+ (*GeoSegment)(unsafe.Pointer(pSeg)).FpNext = (*GeoSegment)(unsafe.Pointer((*GeoSegment)(unsafe.Pointer(pSeg)).FpNext)).FpNext
+ goto __24
+__25:
+ ;
+ goto __23
+__23:
+ pSeg = (*GeoSegment)(unsafe.Pointer(pSeg)).FpNext
+ goto __22
+ goto __24
+__24:
+ ;
+__21:
+ ;
+__19:
+ ;
+ pThisEvent = (*GeoEvent)(unsafe.Pointer(pThisEvent)).FpNext
+ goto __2
+__3:
+ ;
+ if !(int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + uintptr(3)))) == 0) {
+ goto __26
+ }
+ rc = 0
+ goto __27
+__26:
+ if !((int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + uintptr(1)))) != 0) && (int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + uintptr(2)))) == 0)) {
+ goto __28
+ }
+ rc = 3
+ goto __29
+__28:
+ if !((int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + uintptr(1)))) == 0) && (int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + uintptr(2)))) != 0)) {
+ goto __30
+ }
+ rc = 2
+ goto __31
+__30:
+ if !((int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + uintptr(1)))) == 0) && (int32(*(*uint8)(unsafe.Pointer(bp /* &aOverlap[0] */ + uintptr(2)))) == 0)) {
+ goto __32
+ }
+ rc = 4
+ goto __33
+__32:
+ rc = 1
+__33:
+ ;
+__31:
+ ;
+__29:
+ ;
+__27:
+ ;
+
+geopolyOverlapDone:
+ Xsqlite3_free(tls, p)
+ return rc
+}
+
+// SQL function: geopoly_overlap(P1,P2)
+//
+// Determine whether or not P1 and P2 overlap. Return value:
+//
+// 0 The two polygons are disjoint
+// 1 They overlap
+// 2 P1 is completely contained within P2
+// 3 P2 is completely contained within P1
+// 4 P1 and P2 are the same polygon
+// NULL Either P1 or P2 or both are not valid polygons
+func geopolyOverlapFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193607:13: */
+ var p1 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), uintptr(0))
+ var p2 uintptr = geopolyFuncParam(tls, context, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), uintptr(0))
+ if (p1 != 0) && (p2 != 0) {
+ var x int32 = geopolyOverlap(tls, p1, p2)
+ if x < 0 {
+ Xsqlite3_result_error_nomem(tls, context)
+ } else {
+ Xsqlite3_result_int(tls, context, x)
+ }
+ }
+ Xsqlite3_free(tls, p1)
+ Xsqlite3_free(tls, p2)
+}
+
+// Enable or disable debugging output
+func geopolyDebugFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:193629:13: */
+}
+
+// This function is the implementation of both the xConnect and xCreate
+// methods of the geopoly virtual table.
+//
+// argv[0] -> module name
+// argv[1] -> database name
+// argv[2] -> table name
+// argv[...] -> column names...
+func geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr, isCreate int32) int32 { /* sqlite3.c:193648:12: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ var rc int32
+ var pRtree uintptr
+ var nDb Sqlite3_int64 // Length of string argv[1]
+ var nName Sqlite3_int64 // Length of string argv[2]
+ var pSql uintptr
+ var zSql uintptr
+ var ii int32
+ rc = 0
+
+ Xsqlite3_vtab_config(tls, db, 1, libc.VaList(bp, 1))
+
+ // Allocate the sqlite3_vtab structure
+ nDb = Sqlite3_int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))))
+ nName = Sqlite3_int64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8))))
+ pRtree = Xsqlite3_malloc64(tls, (((uint64(unsafe.Sizeof(Rtree{})) + uint64(nDb)) + uint64(nName)) + uint64(2)))
+ if !(!(pRtree != 0)) {
+ goto __1
+ }
+ return 7
+__1:
+ ;
+ libc.Xmemset(tls, pRtree, 0, (uint64(((uint64(unsafe.Sizeof(Rtree{})) + uint64(nDb)) + uint64(nName)) + uint64(2))))
+ (*Rtree)(unsafe.Pointer(pRtree)).FnBusy = U32(1)
+ (*Rtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&rtreeModule))
+ (*Rtree)(unsafe.Pointer(pRtree)).FzDb = (pRtree + uintptr(1)*968)
+ (*Rtree)(unsafe.Pointer(pRtree)).FzName = ((*Rtree)(unsafe.Pointer(pRtree)).FzDb + uintptr((nDb + int64(1))))
+ (*Rtree)(unsafe.Pointer(pRtree)).FeCoordType = U8(0)
+ (*Rtree)(unsafe.Pointer(pRtree)).FnDim = U8(2)
+ (*Rtree)(unsafe.Pointer(pRtree)).FnDim2 = U8(4)
+ libc.Xmemcpy(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), uint64(nDb))
+ libc.Xmemcpy(tls, (*Rtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), uint64(nName))
+
+ // Create/Connect to the underlying relational database schema. If
+ // that is successful, call sqlite3_declare_vtab() to configure
+ // the r-tree table schema.
+ pSql = Xsqlite3_str_new(tls, db)
+ Xsqlite3_str_appendf(tls, pSql, ts+30827 /* "CREATE TABLE x(_..." */, 0)
+ (*Rtree)(unsafe.Pointer(pRtree)).FnAux = U8(1) // Add one for _shape
+ (*Rtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = U8(1) // The _shape column is always not-null
+ ii = 3
+__2:
+ if !(ii < argc) {
+ goto __4
+ }
+ (*Rtree)(unsafe.Pointer(pRtree)).FnAux++
+ Xsqlite3_str_appendf(tls, pSql, ts+30849 /* ",%s" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8))))
+ goto __3
+__3:
+ ii++
+ goto __2
+ goto __4
+__4:
+ ;
+ Xsqlite3_str_appendf(tls, pSql, ts+29916 /* ");" */, 0)
+ zSql = Xsqlite3_str_finish(tls, pSql)
+ if !(!(zSql != 0)) {
+ goto __5
+ }
+ rc = 7
+ goto __6
+__5:
+ if !(0 != (libc.AssignInt32(&rc, Xsqlite3_declare_vtab(tls, db, zSql)))) {
+ goto __7
+ }
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db)))
+__7:
+ ;
+__6:
+ ;
+ Xsqlite3_free(tls, zSql)
+ if !(rc != 0) {
+ goto __8
+ }
+ goto geopolyInit_fail
+__8:
+ ;
+ (*Rtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = (U8(8 + (int32((*Rtree)(unsafe.Pointer(pRtree)).FnDim2) * 4)))
+
+ // Figure out the node size to use.
+ rc = getNodeSize(tls, db, pRtree, isCreate, pzErr)
+ if !(rc != 0) {
+ goto __9
+ }
+ goto geopolyInit_fail
+__9:
+ ;
+ rc = rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(2)*8)), isCreate)
+ if !(rc != 0) {
+ goto __10
+ }
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+24, Xsqlite3_errmsg(tls, db)))
+ goto geopolyInit_fail
+__10:
+ ;
+
+ *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree
+ return 0
+
+geopolyInit_fail:
+ if !(rc == 0) {
+ goto __11
+ }
+ rc = 1
+__11:
+ ;
+
+ rtreeRelease(tls, pRtree)
+ return rc
+}
+
+// GEOPOLY virtual table module xCreate method.
+func geopolyCreate(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:193732:12: */
+ return geopolyInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 1)
+}
+
+// GEOPOLY virtual table module xConnect method.
+func geopolyConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:193745:12: */
+ return geopolyInit(tls, db, pAux, argc, argv, ppVtab, pzErr, 0)
+}
+
+// GEOPOLY virtual table module xFilter method.
+//
+// Query plans:
+//
+// 1 rowid lookup
+// 2 search for objects overlapping the same bounding box
+// that contains polygon argv[0]
+// 3 search for objects overlapping the same bounding box
+// that contains polygon argv[0]
+// 4 full table scan
+func geopolyFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:193768:12: */
+ bp := tls.Alloc(52)
+ defer tls.Free(52)
+
+ var pRtree uintptr
+ var pCsr uintptr
+ // var pRoot uintptr at bp+24, 8
+
+ // var rc int32 at bp+48, 4
+
+ // var iCell int32 at bp+16, 4
+
+ // Special case - lookup by rowid.
+ // var pLeaf uintptr at bp, 8
+ // Leaf on which the required cell resides
+ var p uintptr // Search point for the leaf
+ var iRowid I64
+ // var iNode I64 at bp+8, 8
+
+ // var bbox [4]RtreeCoord at bp+32, 16
+
+ var p1 uintptr
+ var pNew uintptr
+ pRtree = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pVtabCursor)).FpVtab
+ pCsr = pVtabCursor
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 16 /* iCell */)) = 0
+
+ rtreeReference(tls, pRtree)
+
+ // Reset the cursor to the same state as rtreeOpen() leaves it in.
+ resetCursor(tls, pCsr)
+
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FiStrategy = idxNum
+ if !(idxNum == 1) {
+ goto __1
+ } // Search point for the leaf
+ iRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ *(*I64)(unsafe.Pointer(bp + 8 /* iNode */)) = int64(0)
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = findLeafNode(tls, pRtree, iRowid, bp /* &pLeaf */, bp+8 /* &iNode */)
+ if !((*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == 0) && (*(*uintptr)(unsafe.Pointer(bp /* pLeaf */)) != uintptr(0))) {
+ goto __3
+ }
+ p = rtreeSearchPointNew(tls, pCsr, 0.0, uint8(0))
+ // Always returns pCsr->sPoint
+ *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */) + uintptr(0)*8)) = *(*uintptr)(unsafe.Pointer(bp /* pLeaf */))
+ (*RtreeSearchPoint)(unsafe.Pointer(p)).Fid = *(*I64)(unsafe.Pointer(bp + 8 /* iNode */))
+ (*RtreeSearchPoint)(unsafe.Pointer(p)).FeWithin = U8(1)
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = nodeRowidIndex(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp /* pLeaf */)), iRowid, bp+16 /* &iCell */)
+ (*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell = U8(*(*int32)(unsafe.Pointer(bp + 16 /* iCell */)))
+ goto __4
+__3:
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FatEOF = U8(1)
+__4:
+ ;
+ goto __2
+__1:
+ // Normal case - r-tree scan. Set up the RtreeCursor.aConstraint array
+ // with the configured constraints.
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp+24 /* &pRoot */)
+ if !((*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == 0) && (idxNum <= 3)) {
+ goto __5
+ }
+
+ geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)), bp+32 /* &bbox[0] */, bp+48 /* &rc */)
+ if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) != 0) {
+ goto __6
+ }
+ goto geopoly_filter_end
+__6:
+ ;
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = libc.AssignUintptr(&p1, Xsqlite3_malloc(tls, (int32(uint64(unsafe.Sizeof(RtreeConstraint{}))*uint64(4)))))
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = 4
+ if !(p1 == uintptr(0)) {
+ goto __7
+ }
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = 7
+ goto __8
+__7:
+ libc.Xmemset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint, 0, (uint64(unsafe.Sizeof(RtreeConstraint{})) * uint64(4)))
+ libc.Xmemset(tls, pCsr+128 /* &.anQueue */, 0, (uint64(unsafe.Sizeof(U32(0))) * (uint64((*Rtree)(unsafe.Pointer(pRtree)).FiDepth + 1))))
+ if !(idxNum == 2) {
+ goto __9
+ }
+ // Overlap query
+ (*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'B'
+ (*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 0
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 /* &bbox */ + uintptr(1)*4)))
+ p1 += 24
+ (*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'D'
+ (*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 1
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 /* &bbox */ + uintptr(0)*4)))
+ p1 += 24
+ (*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'B'
+ (*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 2
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 /* &bbox */ + uintptr(3)*4)))
+ p1 += 24
+ (*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'D'
+ (*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 3
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 /* &bbox */ + uintptr(2)*4)))
+ goto __10
+__9:
+ // Within query
+ (*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'D'
+ (*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 0
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 /* &bbox */ + uintptr(0)*4)))
+ p1 += 24
+ (*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'B'
+ (*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 1
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 /* &bbox */ + uintptr(1)*4)))
+ p1 += 24
+ (*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'D'
+ (*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 2
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 /* &bbox */ + uintptr(2)*4)))
+ p1 += 24
+ (*RtreeConstraint)(unsafe.Pointer(p1)).Fop = 'B'
+ (*RtreeConstraint)(unsafe.Pointer(p1)).FiCoord = 3
+ *(*RtreeDValue)(unsafe.Pointer(p1 + 8 /* &.u */)) = RtreeDValue(*(*RtreeValue)(unsafe.Pointer(bp + 32 /* &bbox */ + uintptr(3)*4)))
+__10:
+ ;
+__8:
+ ;
+__5:
+ ;
+ if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == 0) {
+ goto __11
+ }
+ pNew = rtreeSearchPointNew(tls, pCsr, 0.0, (U8((*Rtree)(unsafe.Pointer(pRtree)).FiDepth + 1)))
+ if !(pNew == uintptr(0)) {
+ goto __12
+ }
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = 7
+ goto geopoly_filter_end
+__12:
+ ;
+ (*RtreeSearchPoint)(unsafe.Pointer(pNew)).Fid = int64(1)
+ (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FiCell = U8(0)
+ (*RtreeSearchPoint)(unsafe.Pointer(pNew)).FeWithin = U8(1)
+
+ *(*uintptr)(unsafe.Pointer((pCsr + 88 /* &.aNode */) + uintptr(0)*8)) = *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */))
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)) = uintptr(0)
+
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = rtreeStepToLeaf(tls, pCsr)
+__11:
+ ;
+__2:
+ ;
+
+geopoly_filter_end:
+ nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 24 /* pRoot */)))
+ rtreeRelease(tls, pRtree)
+ return *(*int32)(unsafe.Pointer(bp + 48 /* rc */))
+}
+
+// Rtree virtual table module xBestIndex method. There are three
+// table scan strategies to choose from (in order from most to
+// least desirable):
+//
+// idxNum idxStr Strategy
+// ------------------------------------------------
+// 1 "rowid" Direct lookup by rowid.
+// 2 "rtree" R-tree overlap query using geopoly_overlap()
+// 3 "rtree" R-tree within query using geopoly_within()
+// 4 "fullscan" full-table scan.
+// ------------------------------------------------
+func geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:193899:12: */
+ var ii int32
+ var iRowidTerm int32 = -1
+ var iFuncTerm int32 = -1
+ var idxNum int32 = 0
+
+ for ii = 0; ii < (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint; ii++ {
+ var p uintptr = ((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(ii)*12)
+ if !(int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) != 0) {
+ continue
+ }
+ if ((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn < 0) && (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == 2) {
+ iRowidTerm = ii
+ break
+ }
+ if ((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn == 0) && (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) >= 150) {
+ // p->op==SQLITE_INDEX_CONSTRAINT_FUNCTION for geopoly_overlap()
+ // p->op==(SQLITE_INDEX_CONTRAINT_FUNCTION+1) for geopoly_within().
+ // See geopolyFindFunction()
+ iFuncTerm = ii
+ idxNum = ((int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) - 150) + 2)
+ }
+ }
+
+ if iRowidTerm >= 0 {
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 1
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 10045 /* "rowid" */
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8)).FargvIndex = 1
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8)).Fomit = uint8(1)
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 30.0
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(1)
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags = 1
+ return 0
+ }
+ if iFuncTerm >= 0 {
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 30853 /* "rtree" */
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8)).FargvIndex = 1
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8)).Fomit = uint8(0)
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 300.0
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(10)
+ return 0
+ }
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = 4
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = ts + 30859 /* "fullscan" */
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 3000000.0
+ (*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000)
+ return 0
+}
+
+// GEOPOLY virtual table module xColumn method.
+func geopolyColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:193951:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var pRtree uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab
+ var pCsr uintptr = cur
+ var p uintptr = rtreeSearchPointFirst(tls, pCsr)
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ var pNode uintptr = rtreeNodeOfFirstSearchPoint(tls, pCsr, bp /* &rc */)
+
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+ }
+ if p == uintptr(0) {
+ return 0
+ }
+ if (i == 0) && (Xsqlite3_vtab_nochange(tls, ctx) != 0) {
+ return 0
+ }
+ if i <= int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux) {
+ if !(int32((*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid) != 0) {
+ if (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux == uintptr(0) {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3_prepare_v3(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb, (*Rtree)(unsafe.Pointer(pRtree)).FzReadAuxSql, -1, uint32(0),
+ (pCsr + 56 /* &.pReadAux */), uintptr(0))
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+ }
+ }
+ Xsqlite3_bind_int64(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, 1,
+ nodeGetRowid(tls, pRtree, pNode, int32((*RtreeSearchPoint)(unsafe.Pointer(p)).FiCell)))
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = Xsqlite3_step(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 100 {
+ (*RtreeCursor)(unsafe.Pointer(pCsr)).FbAuxValid = U8(1)
+ } else {
+ Xsqlite3_reset(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux)
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 101 {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ }
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+ }
+ }
+ Xsqlite3_result_value(tls, ctx, Xsqlite3_column_value(tls, (*RtreeCursor)(unsafe.Pointer(pCsr)).FpReadAux, (i+2)))
+ }
+ return 0
+}
+
+// The xUpdate method for GEOPOLY module virtual tables.
+//
+// For DELETE:
+//
+// argv[0] = the rowid to be deleted
+//
+// For INSERT:
+//
+// argv[0] = SQL NULL
+// argv[1] = rowid to insert, or an SQL NULL to select automatically
+// argv[2] = _shape column
+// argv[3] = first application-defined column....
+//
+// For UPDATE:
+//
+// argv[0] = rowid to modify. Never NULL
+// argv[1] = rowid after the change. Never NULL
+// argv[2] = new value for _shape
+// argv[3] = new value for first application-defined column....
+func geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pRowid uintptr) int32 { /* sqlite3.c:194006:12: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ var pRtree uintptr
+ // var rc int32 at bp+48, 4
+
+ // var cell RtreeCell at bp, 48
+ // New cell to insert if nData>1
+ var oldRowid I64 // The old rowid
+ var oldRowidValid int32 // True if oldRowid is valid
+ var newRowid I64 // The new rowid
+ var newRowidValid int32 // True if newRowid is valid
+ var coordChange int32
+ var steprc int32
+ var rc2 int32
+ // Insert the new record into the r-tree
+ // var pLeaf uintptr at bp+56, 8
+
+ var p uintptr
+ var pUp uintptr
+ var jj int32
+ var nChange int32
+ pRtree = pVtab
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = 0
+ coordChange = 0 // Change in coordinates
+
+ if !((*Rtree)(unsafe.Pointer(pRtree)).FnNodeRef != 0) {
+ goto __1
+ }
+ // Unable to write to the btree while another cursor is reading from it,
+ // since the write might do a rebalance which would disrupt the read
+ // cursor.
+ return (6 | (int32(2) << 8))
+__1:
+ ;
+ rtreeReference(tls, pRtree)
+
+ oldRowidValid = (libc.Bool32(Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(0)*8))) != 5))
+
+ if oldRowidValid != 0 {
+ oldRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(0)*8)))
+ } else {
+ oldRowid = int64(0)
+ }
+ newRowidValid = (libc.Bool32((nData > 1) && (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(1)*8))) != 5)))
+ if newRowidValid != 0 {
+ newRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(1)*8)))
+ } else {
+ newRowid = int64(0)
+ }
+ (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid = newRowid
+
+ if !((nData > 1) && // not a DELETE
+ ((!(oldRowidValid != 0) || // INSERT
+ !(Xsqlite3_value_nochange(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(2)*8))) != 0)) || // UPDATE _shape
+ (oldRowid != newRowid))) {
+ goto __2
+ }
+ geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + uintptr(2)*8)), bp /* &cell */ +8 /* &.aCoord */, bp+48 /* &rc */)
+ if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) != 0) {
+ goto __3
+ }
+ if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == 1) {
+ goto __4
+ }
+ (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+30868 /* "_shape does not ..." */, 0)
+__4:
+ ;
+ goto geopoly_update_end
+__3:
+ ;
+ coordChange = 1
+
+ // If a rowid value was supplied, check if it is already present in
+ // the table. If so, the constraint has failed.
+ if !((newRowidValid != 0) && (!(oldRowidValid != 0) || (oldRowid != newRowid))) {
+ goto __5
+ }
+ Xsqlite3_bind_int64(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid, 1, (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid)
+ steprc = Xsqlite3_step(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3_reset(tls, (*Rtree)(unsafe.Pointer(pRtree)).FpReadRowid)
+ if !(100 == steprc) {
+ goto __6
+ }
+ if !(Xsqlite3_vtab_on_conflict(tls, (*Rtree)(unsafe.Pointer(pRtree)).Fdb) == 5) {
+ goto __7
+ }
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = rtreeDeleteRowid(tls, pRtree, (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid)
+ goto __8
+__7:
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = rtreeConstraintError(tls, pRtree, 0)
+__8:
+ ;
+__6:
+ ;
+__5:
+ ;
+__2:
+ ;
+
+ // If aData[0] is not an SQL NULL value, it is the rowid of a
+ // record to delete from the r-tree table. The following block does
+ // just that.
+ if !((*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == 0) && ((nData == 1) || ((coordChange != 0) && (oldRowidValid != 0)))) {
+ goto __9
+ }
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = rtreeDeleteRowid(tls, pRtree, oldRowid)
+__9:
+ ;
+
+ // If the aData[] array contains more than one element, elements
+ // (aData[2]..aData[argc-1]) contain a new record to insert into
+ // the r-tree structure.
+ if !(((*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == 0) && (nData > 1)) && (coordChange != 0)) {
+ goto __10
+ }
+ // Insert the new record into the r-tree
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* pLeaf */)) = uintptr(0)
+ if !(!(newRowidValid != 0)) {
+ goto __11
+ }
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = rtreeNewRowid(tls, pRtree, (bp /* &cell */ /* &.iRowid */))
+__11:
+ ;
+ *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid
+ if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == 0) {
+ goto __12
+ }
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = sChooseLeaf(tls, pRtree, bp /* &cell */, 0, bp+56 /* &pLeaf */)
+__12:
+ ;
+ if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == 0) {
+ goto __13
+ }
+ (*Rtree)(unsafe.Pointer(pRtree)).FiReinsertHeight = -1
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = rtreeInsertCell(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 56 /* pLeaf */)), bp /* &cell */, 0)
+ rc2 = nodeRelease(tls, pRtree, *(*uintptr)(unsafe.Pointer(bp + 56 /* pLeaf */)))
+ if !(*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == 0) {
+ goto __14
+ }
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = rc2
+__14:
+ ;
+__13:
+ ;
+__10:
+ ;
+
+ // Change the data
+ if !((*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == 0) && (nData > 1)) {
+ goto __15
+ }
+ pUp = (*Rtree)(unsafe.Pointer(pRtree)).FpWriteAux
+ nChange = 0
+ Xsqlite3_bind_int64(tls, pUp, 1, (*RtreeCell)(unsafe.Pointer(bp /* &cell */)).FiRowid)
+
+ if !(Xsqlite3_value_nochange(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(2)*8))) != 0) {
+ goto __16
+ }
+ Xsqlite3_bind_null(tls, pUp, 2)
+ goto __17
+__16:
+ p = uintptr(0)
+ if !(((Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(aData + uintptr(2)*8))) == 3) &&
+ ((libc.AssignUintptr(&p, geopolyFuncParam(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + uintptr(2)*8)), bp+48 /* &rc */))) != uintptr(0))) &&
+ (*(*int32)(unsafe.Pointer(bp + 48 /* rc */)) == 0)) {
+ goto __18
+ }
+ Xsqlite3_bind_blob(tls, pUp, 2, p+4 /* &.hdr */, (4 + (8 * (*GeoPoly)(unsafe.Pointer(p)).FnVertex)), libc.UintptrFromInt32(-1))
+ goto __19
+__18:
+ Xsqlite3_bind_value(tls, pUp, 2, *(*uintptr)(unsafe.Pointer(aData + uintptr(2)*8)))
+__19:
+ ;
+ Xsqlite3_free(tls, p)
+ nChange = 1
+__17:
+ ;
+ jj = 1
+__20:
+ if !(jj < int32((*Rtree)(unsafe.Pointer(pRtree)).FnAux)) {
+ goto __22
+ }
+ nChange++
+ Xsqlite3_bind_value(tls, pUp, (jj + 2), *(*uintptr)(unsafe.Pointer(aData + uintptr((jj+2))*8)))
+ goto __21
+__21:
+ jj++
+ goto __20
+ goto __22
+__22:
+ ;
+ if !(nChange != 0) {
+ goto __23
+ }
+ Xsqlite3_step(tls, pUp)
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3_reset(tls, pUp)
+__23:
+ ;
+__15:
+ ;
+
+geopoly_update_end:
+ rtreeRelease(tls, pRtree)
+ return *(*int32)(unsafe.Pointer(bp + 48 /* rc */))
+}
+
+// Report that geopoly_overlap() is an overloaded function suitable
+// for use in xBestIndex.
+func geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:194142:12: */
+ if Xsqlite3_stricmp(tls, zName, ts+30908 /* "geopoly_overlap" */) == 0 {
+ *(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{geopolyOverlapFunc}))
+ *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0)
+ return 150
+ }
+ if Xsqlite3_stricmp(tls, zName, ts+30924 /* "geopoly_within" */) == 0 {
+ *(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{geopolyWithinFunc}))
+ *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0)
+ return (150 + 1)
+ }
+ return 0
+}
+
+var geopolyModule = Sqlite3_module{FiVersion: 3, FxCreate: // iVersion
+0, FxConnect:// xCreate - create a table
+0, FxBestIndex:// xConnect - connect to an existing table
+0, FxDisconnect:// xBestIndex - Determine search strategy
+0, FxDestroy:// xDisconnect - Disconnect from a table
+0, FxOpen:// xDestroy - Drop a table
+0, FxClose:// xOpen - open a cursor
+0, FxFilter:// xClose - close a cursor
+0, FxNext:// xFilter - configure scan constraints
+0, FxEof:// xNext - advance a cursor
+0, FxColumn:// xEof
+0, FxRowid:// xColumn - read data
+0, FxUpdate:// xRowid - read data
+0, FxBegin:// xUpdate - write data
+0, FxSync:// xBegin - begin transaction
+0, FxCommit:// xSync - sync transaction
+0, FxRollback:// xCommit - commit transaction
+0, FxFindFunction:// xRollback - rollback transaction
+0, FxRename:// xFindFunction - function overloading
+0, FxSavepoint:// xRename - rename the table
+0, FxRelease:// xSavepoint
+uintptr(0), FxRollbackTo:// xRelease
+uintptr(0), FxShadowName:// xRollbackTo
+0, // xShadowName
+} /* sqlite3.c:194163:23 */
+
+func sqlite3_geopoly_init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:194190:12: */
+ var rc int32 = 0
+ var i int32
+ for i = 0; (uint64(i) < (uint64(unsafe.Sizeof(aFunc1)) / uint64(unsafe.Sizeof(struct {
+ FxFunc uintptr
+ FnArg int8
+ FbPure uint8
+ FzName uintptr
+ }{})))) && (rc == 0); i++ {
+ var enc int32
+ if aFunc1[i].FbPure != 0 {
+ enc = ((1 | 0x000000800) | 0x000200000)
+ } else {
+ enc = (1 | 0x000080000)
+ }
+ rc = Xsqlite3_create_function(tls, db, aFunc1[i].FzName, int32(aFunc1[i].FnArg),
+ enc, uintptr(0),
+ aFunc1[i].FxFunc, uintptr(0), uintptr(0))
+ }
+ for i = 0; (uint64(i) < (uint64(unsafe.Sizeof(aAgg1)) / uint64(unsafe.Sizeof(struct {
+ FxStep uintptr
+ FxFinal uintptr
+ FzName uintptr
+ }{})))) && (rc == 0); i++ {
+ rc = Xsqlite3_create_function(tls, db, aAgg1[i].FzName, 1,
+ ((1 | 0x000000800) | 0x000200000), uintptr(0),
+ uintptr(0), aAgg1[i].FxStep, aAgg1[i].FxFinal)
+ }
+ if rc == 0 {
+ rc = Xsqlite3_create_module_v2(tls, db, ts+30939 /* "geopoly" */, uintptr(unsafe.Pointer(&geopolyModule)), uintptr(0), uintptr(0))
+ }
+ return rc
+}
+
+var aFunc1 = [12]struct {
+ FxFunc uintptr
+ FnArg int8
+ FbPure uint8
+ FzName uintptr
+}{
+ {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 30947 /* "geopoly_area" */},
+ {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 30960 /* "geopoly_blob" */},
+ {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 30973 /* "geopoly_json" */},
+ {FxFunc: 0, FnArg: int8(-1), FbPure: uint8(1), FzName: ts + 30986 /* "geopoly_svg" */},
+ {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 30924 /* "geopoly_within" */},
+ {FxFunc: 0, FnArg: int8(3), FbPure: uint8(1), FzName: ts + 30998 /* "geopoly_contains..." */},
+ {FxFunc: 0, FnArg: int8(2), FbPure: uint8(1), FzName: ts + 30908 /* "geopoly_overlap" */},
+ {FxFunc: 0, FnArg: int8(1), FbPure: uint8(0), FzName: ts + 31021 /* "geopoly_debug" */},
+ {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 31035 /* "geopoly_bbox" */},
+ {FxFunc: 0, FnArg: int8(7), FbPure: uint8(1), FzName: ts + 31048 /* "geopoly_xform" */},
+ {FxFunc: 0, FnArg: int8(4), FbPure: uint8(1), FzName: ts + 31062 /* "geopoly_regular" */},
+ {FxFunc: 0, FnArg: int8(1), FbPure: uint8(1), FzName: ts + 31078 /* "geopoly_ccw" */},
+} /* sqlite3.c:194197:5 */
+var aAgg1 = [1]struct {
+ FxStep uintptr
+ FxFinal uintptr
+ FzName uintptr
+}{
+ {FxStep: 0, FxFinal: 0, FzName: ts + 31090 /* "geopoly_group_bb..." */},
+} /* sqlite3.c:194215:5 */
+
+//************* End of geopoly.c ********************************************
+//************* Continuing where we left off in rtree.c *********************
+
+// Register the r-tree module with database handle db. This creates the
+// virtual table module "rtree" and the debugging/analysis scalar
+// function "rtreenode".
+func Xsqlite3RtreeInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:194250:20: */
+ var utf8 int32 = 1
+ var rc int32
+
+ rc = Xsqlite3_create_function(tls, db, ts+31109 /* "rtreenode" */, 2, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{rtreenode})), uintptr(0), uintptr(0))
+ if rc == 0 {
+ rc = Xsqlite3_create_function(tls, db, ts+31119 /* "rtreedepth" */, 1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{rtreedepth})), uintptr(0), uintptr(0))
+ }
+ if rc == 0 {
+ rc = Xsqlite3_create_function(tls, db, ts+31130 /* "rtreecheck" */, -1, utf8, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{rtreecheck})), uintptr(0), uintptr(0))
+ }
+ if rc == 0 {
+ var c uintptr = uintptr(0)
+ rc = Xsqlite3_create_module_v2(tls, db, ts+30853 /* "rtree" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0))
+ }
+ if rc == 0 {
+ var c uintptr = uintptr(1)
+ rc = Xsqlite3_create_module_v2(tls, db, ts+31141 /* "rtree_i32" */, uintptr(unsafe.Pointer(&rtreeModule)), c, uintptr(0))
+ }
+ if rc == 0 {
+ rc = sqlite3_geopoly_init(tls, db)
+ }
+
+ return rc
+}
+
+// This routine deletes the RtreeGeomCallback object that was attached
+// one of the SQL functions create by sqlite3_rtree_geometry_callback()
+// or sqlite3_rtree_query_callback(). In other words, this routine is the
+// destructor for an RtreeGeomCallback objecct. This routine is called when
+// the corresponding SQL function is deleted.
+func rtreeFreeCallback(tls *libc.TLS, p uintptr) { /* sqlite3.c:194289:13: */
+ var pInfo uintptr = p
+ if (*RtreeGeomCallback)(unsafe.Pointer(pInfo)).FxDestructor != 0 {
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pInfo + 16 /* &.xDestructor */))))(tls, (*RtreeGeomCallback)(unsafe.Pointer(pInfo)).FpContext)
+ }
+ Xsqlite3_free(tls, p)
+}
+
+// This routine frees the BLOB that is returned by geomCallback().
+func rtreeMatchArgFree(tls *libc.TLS, pArg uintptr) { /* sqlite3.c:194298:13: */
+ var i int32
+ var p uintptr = pArg
+ for i = 0; i < (*RtreeMatchArg)(unsafe.Pointer(p)).FnParam; i++ {
+ Xsqlite3_value_free(tls, *(*uintptr)(unsafe.Pointer((*RtreeMatchArg)(unsafe.Pointer(p)).FapSqlParam + uintptr(i)*8)))
+ }
+ Xsqlite3_free(tls, p)
+}
+
+// Each call to sqlite3_rtree_geometry_callback() or
+// sqlite3_rtree_query_callback() creates an ordinary SQLite
+// scalar function that is implemented by this routine.
+//
+// All this function does is construct an RtreeMatchArg object that
+// contains the geometry-checking callback routines and a list of
+// parameters to this function, then return that RtreeMatchArg object
+// as a BLOB.
+//
+// The R-Tree MATCH operator will read the returned BLOB, deserialize
+// the RtreeMatchArg object, and use the RtreeMatchArg object to figure
+// out which elements of the R-Tree should be returned by the query.
+func geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { /* sqlite3.c:194321:13: */
+ var pGeomCtx uintptr = Xsqlite3_user_data(tls, ctx)
+ var pBlob uintptr
+ var nBlob Sqlite3_int64
+ var memErr int32 = 0
+
+ nBlob = (Sqlite3_int64((uint64(unsafe.Sizeof(RtreeMatchArg{})) + ((uint64(nArg - 1)) * uint64(unsafe.Sizeof(RtreeDValue(0))))) +
+ (uint64(nArg) * uint64(unsafe.Sizeof(uintptr(0))))))
+ pBlob = Xsqlite3_malloc64(tls, uint64(nBlob))
+ if !(pBlob != 0) {
+ Xsqlite3_result_error_nomem(tls, ctx)
+ } else {
+ var i int32
+ (*RtreeMatchArg)(unsafe.Pointer(pBlob)).FiSize = U32(nBlob)
+ (*RtreeMatchArg)(unsafe.Pointer(pBlob)).Fcb = *(*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx + uintptr(0)*32))
+ (*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam = ((pBlob + 56 /* &.aParam */) + uintptr(nArg)*8)
+ (*RtreeMatchArg)(unsafe.Pointer(pBlob)).FnParam = nArg
+ for i = 0; i < nArg; i++ {
+ *(*uintptr)(unsafe.Pointer((*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam + uintptr(i)*8)) = Xsqlite3_value_dup(tls, *(*uintptr)(unsafe.Pointer(aArg + uintptr(i)*8)))
+ if *(*uintptr)(unsafe.Pointer((*RtreeMatchArg)(unsafe.Pointer(pBlob)).FapSqlParam + uintptr(i)*8)) == uintptr(0) {
+ memErr = 1
+ }
+ *(*RtreeDValue)(unsafe.Pointer((pBlob + 56 /* &.aParam */) + uintptr(i)*8)) = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(aArg + uintptr(i)*8)))
+ }
+ if memErr != 0 {
+ Xsqlite3_result_error_nomem(tls, ctx)
+ rtreeMatchArgFree(tls, pBlob)
+ } else {
+ Xsqlite3_result_pointer(tls, ctx, pBlob, ts+28429 /* "RtreeMatchArg" */, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{rtreeMatchArgFree})))
+ }
+ }
+}
+
+// Register a new geometry function for use with the r-tree MATCH operator.
+func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) int32 { /* sqlite3.c:194359:16: */
+ var pGeomCtx uintptr // Context object for new user-function
+
+ // Allocate and populate the context object.
+ pGeomCtx = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(RtreeGeomCallback{})))
+ if !(pGeomCtx != 0) {
+ return 7
+ }
+ (*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom
+ (*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0)
+ (*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0)
+ (*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext
+ return Xsqlite3_create_function_v2(tls, db, zGeom, -1, 5,
+ pGeomCtx, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{geomCallback})), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{rtreeFreeCallback})))
+}
+
+// Register a new 2nd-generation geometry function for use with the
+// r-tree MATCH operator.
+func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) int32 { /* sqlite3.c:194383:16: */
+ var pGeomCtx uintptr // Context object for new user-function
+
+ // Allocate and populate the context object.
+ pGeomCtx = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(RtreeGeomCallback{})))
+ if !(pGeomCtx != 0) {
+ return 7
+ }
+ (*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0)
+ (*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc
+ (*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor
+ (*RtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext
+ return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -1, 5,
+ pGeomCtx, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{geomCallback})), uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{rtreeFreeCallback})))
+}
+
+//************* End of rtree.c **********************************************
+//************* Begin file icu.c ********************************************
+// 2007 May 6
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+// $Id: icu.c,v 1.7 2007/12/13 21:54:11 drh Exp $
+//
+// This file implements an integration between the ICU library
+// ("International Components for Unicode", an open-source library
+// for handling unicode data) and SQLite. The integration uses
+// ICU to provide the following to SQLite:
+//
+// * An implementation of the SQL regexp() function (and hence REGEXP
+// operator) using the ICU uregex_XX() APIs.
+//
+// * Implementations of the SQL scalar upper() and lower() functions
+// for case mapping.
+//
+// * Integration of ICU and SQLite collation sequences.
+//
+// * An implementation of the LIKE operator that uses ICU to
+// provide case-independent matching.
+
+//************* End of icu.c ************************************************
+//************* Begin file fts3_icu.c ***************************************
+// 2007 June 22
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+// This file implements a tokenizer for fts3 based on the ICU library.
+// #include "fts3Int.h"
+
+//************* End of fts3_icu.c *******************************************
+//************* Begin file sqlite3rbu.c *************************************
+// 2014 August 30
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+//
+// OVERVIEW
+//
+// The RBU extension requires that the RBU update be packaged as an
+// SQLite database. The tables it expects to find are described in
+// sqlite3rbu.h. Essentially, for each table xyz in the target database
+// that the user wishes to write to, a corresponding data_xyz table is
+// created in the RBU database and populated with one row for each row to
+// update, insert or delete from the target table.
+//
+// The update proceeds in three stages:
+//
+// 1) The database is updated. The modified database pages are written
+// to a *-oal file. A *-oal file is just like a *-wal file, except
+// that it is named "<database>-oal" instead of "<database>-wal".
+// Because regular SQLite clients do not look for file named
+// "<database>-oal", they go on using the original database in
+// rollback mode while the *-oal file is being generated.
+//
+// During this stage RBU does not update the database by writing
+// directly to the target tables. Instead it creates "imposter"
+// tables using the SQLITE_TESTCTRL_IMPOSTER interface that it uses
+// to update each b-tree individually. All updates required by each
+// b-tree are completed before moving on to the next, and all
+// updates are done in sorted key order.
+//
+// 2) The "<database>-oal" file is moved to the equivalent "<database>-wal"
+// location using a call to rename(2). Before doing this the RBU
+// module takes an EXCLUSIVE lock on the database file, ensuring
+// that there are no other active readers.
+//
+// Once the EXCLUSIVE lock is released, any other database readers
+// detect the new *-wal file and read the database in wal mode. At
+// this point they see the new version of the database - including
+// the updates made as part of the RBU update.
+//
+// 3) The new *-wal file is checkpointed. This proceeds in the same way
+// as a regular database checkpoint, except that a single frame is
+// checkpointed each time sqlite3rbu_step() is called. If the RBU
+// handle is closed before the entire *-wal file is checkpointed,
+// the checkpoint progress is saved in the RBU database and the
+// checkpoint can be resumed by another RBU client at some point in
+// the future.
+//
+// POTENTIAL PROBLEMS
+//
+// The rename() call might not be portable. And RBU is not currently
+// syncing the directory after renaming the file.
+//
+// When state is saved, any commit to the *-oal file and the commit to
+// the RBU update database are not atomic. So if the power fails at the
+// wrong moment they might get out of sync. As the main database will be
+// committed before the RBU update database this will likely either just
+// pass unnoticed, or result in SQLITE_CONSTRAINT errors (due to UNIQUE
+// constraint violations).
+//
+// If some client does modify the target database mid RBU update, or some
+// other error occurs, the RBU extension will keep throwing errors. It's
+// not really clear how to get out of this state. The system could just
+// by delete the RBU update database and *-oal file and have the device
+// download the update again and start over.
+//
+// At present, for an UPDATE, both the new.* and old.* records are
+// collected in the rbu_xyz table. And for both UPDATEs and DELETEs all
+// fields are collected. This means we're probably writing a lot more
+// data to disk when saving the state of an ongoing update to the RBU
+// update database than is strictly necessary.
+//
+
+// #include <assert.h>
+// #include <string.h>
+// #include <stdio.h>
+
+// #include "sqlite3.h"
+
+//************* Include sqlite3rbu.h in the middle of sqlite3rbu.c **********
+//************* Begin file sqlite3rbu.h *************************************
+// 2014 August 30
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// This file contains the public interface for the RBU extension.
+
+// SUMMARY
+//
+// Writing a transaction containing a large number of operations on
+// b-tree indexes that are collectively larger than the available cache
+// memory can be very inefficient.
+//
+// The problem is that in order to update a b-tree, the leaf page (at least)
+// containing the entry being inserted or deleted must be modified. If the
+// working set of leaves is larger than the available cache memory, then a
+// single leaf that is modified more than once as part of the transaction
+// may be loaded from or written to the persistent media multiple times.
+// Additionally, because the index updates are likely to be applied in
+// random order, access to pages within the database is also likely to be in
+// random order, which is itself quite inefficient.
+//
+// One way to improve the situation is to sort the operations on each index
+// by index key before applying them to the b-tree. This leads to an IO
+// pattern that resembles a single linear scan through the index b-tree,
+// and all but guarantees each modified leaf page is loaded and stored
+// exactly once. SQLite uses this trick to improve the performance of
+// CREATE INDEX commands. This extension allows it to be used to improve
+// the performance of large transactions on existing databases.
+//
+// Additionally, this extension allows the work involved in writing the
+// large transaction to be broken down into sub-transactions performed
+// sequentially by separate processes. This is useful if the system cannot
+// guarantee that a single update process will run for long enough to apply
+// the entire update, for example because the update is being applied on a
+// mobile device that is frequently rebooted. Even after the writer process
+// has committed one or more sub-transactions, other database clients continue
+// to read from the original database snapshot. In other words, partially
+// applied transactions are not visible to other clients.
+//
+// "RBU" stands for "Resumable Bulk Update". As in a large database update
+// transmitted via a wireless network to a mobile device. A transaction
+// applied using this extension is hence refered to as an "RBU update".
+//
+//
+// LIMITATIONS
+//
+// An "RBU update" transaction is subject to the following limitations:
+//
+// * The transaction must consist of INSERT, UPDATE and DELETE operations
+// only.
+//
+// * INSERT statements may not use any default values.
+//
+// * UPDATE and DELETE statements must identify their target rows by
+// non-NULL PRIMARY KEY values. Rows with NULL values stored in PRIMARY
+// KEY fields may not be updated or deleted. If the table being written
+// has no PRIMARY KEY, affected rows must be identified by rowid.
+//
+// * UPDATE statements may not modify PRIMARY KEY columns.
+//
+// * No triggers will be fired.
+//
+// * No foreign key violations are detected or reported.
+//
+// * CHECK constraints are not enforced.
+//
+// * No constraint handling mode except for "OR ROLLBACK" is supported.
+//
+//
+// PREPARATION
+//
+// An "RBU update" is stored as a separate SQLite database. A database
+// containing an RBU update is an "RBU database". For each table in the
+// target database to be updated, the RBU database should contain a table
+// named "data_<target name>" containing the same set of columns as the
+// target table, and one more - "rbu_control". The data_% table should
+// have no PRIMARY KEY or UNIQUE constraints, but each column should have
+// the same type as the corresponding column in the target database.
+// The "rbu_control" column should have no type at all. For example, if
+// the target database contains:
+//
+// CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c UNIQUE);
+//
+// Then the RBU database should contain:
+//
+// CREATE TABLE data_t1(a INTEGER, b TEXT, c, rbu_control);
+//
+// The order of the columns in the data_% table does not matter.
+//
+// Instead of a regular table, the RBU database may also contain virtual
+// tables or view named using the data_<target> naming scheme.
+//
+// Instead of the plain data_<target> naming scheme, RBU database tables
+// may also be named data<integer>_<target>, where <integer> is any sequence
+// of zero or more numeric characters (0-9). This can be significant because
+// tables within the RBU database are always processed in order sorted by
+// name. By judicious selection of the <integer> portion of the names
+// of the RBU tables the user can therefore control the order in which they
+// are processed. This can be useful, for example, to ensure that "external
+// content" FTS4 tables are updated before their underlying content tables.
+//
+// If the target database table is a virtual table or a table that has no
+// PRIMARY KEY declaration, the data_% table must also contain a column
+// named "rbu_rowid". This column is mapped to the tables implicit primary
+// key column - "rowid". Virtual tables for which the "rowid" column does
+// not function like a primary key value cannot be updated using RBU. For
+// example, if the target db contains either of the following:
+//
+// CREATE VIRTUAL TABLE x1 USING fts3(a, b);
+// CREATE TABLE x1(a, b)
+//
+// then the RBU database should contain:
+//
+// CREATE TABLE data_x1(a, b, rbu_rowid, rbu_control);
+//
+// All non-hidden columns (i.e. all columns matched by "SELECT *") of the
+// target table must be present in the input table. For virtual tables,
+// hidden columns are optional - they are updated by RBU if present in
+// the input table, or not otherwise. For example, to write to an fts4
+// table with a hidden languageid column such as:
+//
+// CREATE VIRTUAL TABLE ft1 USING fts4(a, b, languageid='langid');
+//
+// Either of the following input table schemas may be used:
+//
+// CREATE TABLE data_ft1(a, b, langid, rbu_rowid, rbu_control);
+// CREATE TABLE data_ft1(a, b, rbu_rowid, rbu_control);
+//
+// For each row to INSERT into the target database as part of the RBU
+// update, the corresponding data_% table should contain a single record
+// with the "rbu_control" column set to contain integer value 0. The
+// other columns should be set to the values that make up the new record
+// to insert.
+//
+// If the target database table has an INTEGER PRIMARY KEY, it is not
+// possible to insert a NULL value into the IPK column. Attempting to
+// do so results in an SQLITE_MISMATCH error.
+//
+// For each row to DELETE from the target database as part of the RBU
+// update, the corresponding data_% table should contain a single record
+// with the "rbu_control" column set to contain integer value 1. The
+// real primary key values of the row to delete should be stored in the
+// corresponding columns of the data_% table. The values stored in the
+// other columns are not used.
+//
+// For each row to UPDATE from the target database as part of the RBU
+// update, the corresponding data_% table should contain a single record
+// with the "rbu_control" column set to contain a value of type text.
+// The real primary key values identifying the row to update should be
+// stored in the corresponding columns of the data_% table row, as should
+// the new values of all columns being update. The text value in the
+// "rbu_control" column must contain the same number of characters as
+// there are columns in the target database table, and must consist entirely
+// of 'x' and '.' characters (or in some special cases 'd' - see below). For
+// each column that is being updated, the corresponding character is set to
+// 'x'. For those that remain as they are, the corresponding character of the
+// rbu_control value should be set to '.'. For example, given the tables
+// above, the update statement:
+//
+// UPDATE t1 SET c = 'usa' WHERE a = 4;
+//
+// is represented by the data_t1 row created by:
+//
+// INSERT INTO data_t1(a, b, c, rbu_control) VALUES(4, NULL, 'usa', '..x');
+//
+// Instead of an 'x' character, characters of the rbu_control value specified
+// for UPDATEs may also be set to 'd'. In this case, instead of updating the
+// target table with the value stored in the corresponding data_% column, the
+// user-defined SQL function "rbu_delta()" is invoked and the result stored in
+// the target table column. rbu_delta() is invoked with two arguments - the
+// original value currently stored in the target table column and the
+// value specified in the data_xxx table.
+//
+// For example, this row:
+//
+// INSERT INTO data_t1(a, b, c, rbu_control) VALUES(4, NULL, 'usa', '..d');
+//
+// is similar to an UPDATE statement such as:
+//
+// UPDATE t1 SET c = rbu_delta(c, 'usa') WHERE a = 4;
+//
+// Finally, if an 'f' character appears in place of a 'd' or 's' in an
+// ota_control string, the contents of the data_xxx table column is assumed
+// to be a "fossil delta" - a patch to be applied to a blob value in the
+// format used by the fossil source-code management system. In this case
+// the existing value within the target database table must be of type BLOB.
+// It is replaced by the result of applying the specified fossil delta to
+// itself.
+//
+// If the target database table is a virtual table or a table with no PRIMARY
+// KEY, the rbu_control value should not include a character corresponding
+// to the rbu_rowid value. For example, this:
+//
+// INSERT INTO data_ft1(a, b, rbu_rowid, rbu_control)
+// VALUES(NULL, 'usa', 12, '.x');
+//
+// causes a result similar to:
+//
+// UPDATE ft1 SET b = 'usa' WHERE rowid = 12;
+//
+// The data_xxx tables themselves should have no PRIMARY KEY declarations.
+// However, RBU is more efficient if reading the rows in from each data_xxx
+// table in "rowid" order is roughly the same as reading them sorted by
+// the PRIMARY KEY of the corresponding target database table. In other
+// words, rows should be sorted using the destination table PRIMARY KEY
+// fields before they are inserted into the data_xxx tables.
+//
+// USAGE
+//
+// The API declared below allows an application to apply an RBU update
+// stored on disk to an existing target database. Essentially, the
+// application:
+//
+// 1) Opens an RBU handle using the sqlite3rbu_open() function.
+//
+// 2) Registers any required virtual table modules with the database
+// handle returned by sqlite3rbu_db(). Also, if required, register
+// the rbu_delta() implementation.
+//
+// 3) Calls the sqlite3rbu_step() function one or more times on
+// the new handle. Each call to sqlite3rbu_step() performs a single
+// b-tree operation, so thousands of calls may be required to apply
+// a complete update.
+//
+// 4) Calls sqlite3rbu_close() to close the RBU update handle. If
+// sqlite3rbu_step() has been called enough times to completely
+// apply the update to the target database, then the RBU database
+// is marked as fully applied. Otherwise, the state of the RBU
+// update application is saved in the RBU database for later
+// resumption.
+//
+// See comments below for more detail on APIs.
+//
+// If an update is only partially applied to the target database by the
+// time sqlite3rbu_close() is called, various state information is saved
+// within the RBU database. This allows subsequent processes to automatically
+// resume the RBU update from where it left off.
+//
+// To remove all RBU extension state information, returning an RBU database
+// to its original contents, it is sufficient to drop all tables that begin
+// with the prefix "rbu_"
+//
+// DATABASE LOCKING
+//
+// An RBU update may not be applied to a database in WAL mode. Attempting
+// to do so is an error (SQLITE_ERROR).
+//
+// While an RBU handle is open, a SHARED lock may be held on the target
+// database file. This means it is possible for other clients to read the
+// database, but not to write it.
+//
+// If an RBU update is started and then suspended before it is completed,
+// then an external client writes to the database, then attempting to resume
+// the suspended RBU update is also an error (SQLITE_BUSY).
+
+// #include "sqlite3.h" ** Required for error code definitions **
+
+type sqlite3rbu = struct {
+ FeStage int32
+ FdbMain uintptr
+ FdbRbu uintptr
+ FzTarget uintptr
+ FzRbu uintptr
+ FzState uintptr
+ FzStateDb [5]int8
+ Frc int32
+ FzErrmsg uintptr
+ FnStep int32
+ FnProgress int32
+ Fobjiter RbuObjIter
+ FzVfsName uintptr
+ FpTargetFd uintptr
+ FnPagePerSector int32
+ FiOalSz I64
+ FnPhaseOneStep I64
+ FiMaxFrame U32
+ FmLock U32
+ FnFrame int32
+ FnFrameAlloc int32
+ FaFrame uintptr
+ Fpgsz int32
+ FaBuf uintptr
+ FiWalCksum I64
+ FszTemp I64
+ FszTempLimit I64
+ FnRbu int32
+ FpRbuFd uintptr
+}
//************* End of rtree.c **********************************************
//************* Begin file icu.c ********************************************
@@ -139862,6 +154687,5170 @@ func Xsqlite3ConnectionClosed(tls *crt.TLS, db uintptr) { /* sqlite3.c:165258:21
// #include "sqlite3.h"
+//************* Include sqlite3rbu.h in the middle of sqlite3rbu.c **********
+//************* Begin file sqlite3rbu.h *************************************
+// 2014 August 30
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// This file contains the public interface for the RBU extension.
+
+// SUMMARY
+//
+// Writing a transaction containing a large number of operations on
+// b-tree indexes that are collectively larger than the available cache
+// memory can be very inefficient.
+//
+// The problem is that in order to update a b-tree, the leaf page (at least)
+// containing the entry being inserted or deleted must be modified. If the
+// working set of leaves is larger than the available cache memory, then a
+// single leaf that is modified more than once as part of the transaction
+// may be loaded from or written to the persistent media multiple times.
+// Additionally, because the index updates are likely to be applied in
+// random order, access to pages within the database is also likely to be in
+// random order, which is itself quite inefficient.
+//
+// One way to improve the situation is to sort the operations on each index
+// by index key before applying them to the b-tree. This leads to an IO
+// pattern that resembles a single linear scan through the index b-tree,
+// and all but guarantees each modified leaf page is loaded and stored
+// exactly once. SQLite uses this trick to improve the performance of
+// CREATE INDEX commands. This extension allows it to be used to improve
+// the performance of large transactions on existing databases.
+//
+// Additionally, this extension allows the work involved in writing the
+// large transaction to be broken down into sub-transactions performed
+// sequentially by separate processes. This is useful if the system cannot
+// guarantee that a single update process will run for long enough to apply
+// the entire update, for example because the update is being applied on a
+// mobile device that is frequently rebooted. Even after the writer process
+// has committed one or more sub-transactions, other database clients continue
+// to read from the original database snapshot. In other words, partially
+// applied transactions are not visible to other clients.
+//
+// "RBU" stands for "Resumable Bulk Update". As in a large database update
+// transmitted via a wireless network to a mobile device. A transaction
+// applied using this extension is hence refered to as an "RBU update".
+//
+//
+// LIMITATIONS
+//
+// An "RBU update" transaction is subject to the following limitations:
+//
+// * The transaction must consist of INSERT, UPDATE and DELETE operations
+// only.
+//
+// * INSERT statements may not use any default values.
+//
+// * UPDATE and DELETE statements must identify their target rows by
+// non-NULL PRIMARY KEY values. Rows with NULL values stored in PRIMARY
+// KEY fields may not be updated or deleted. If the table being written
+// has no PRIMARY KEY, affected rows must be identified by rowid.
+//
+// * UPDATE statements may not modify PRIMARY KEY columns.
+//
+// * No triggers will be fired.
+//
+// * No foreign key violations are detected or reported.
+//
+// * CHECK constraints are not enforced.
+//
+// * No constraint handling mode except for "OR ROLLBACK" is supported.
+//
+//
+// PREPARATION
+//
+// An "RBU update" is stored as a separate SQLite database. A database
+// containing an RBU update is an "RBU database". For each table in the
+// target database to be updated, the RBU database should contain a table
+// named "data_<target name>" containing the same set of columns as the
+// target table, and one more - "rbu_control". The data_% table should
+// have no PRIMARY KEY or UNIQUE constraints, but each column should have
+// the same type as the corresponding column in the target database.
+// The "rbu_control" column should have no type at all. For example, if
+// the target database contains:
+//
+// CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c UNIQUE);
+//
+// Then the RBU database should contain:
+//
+// CREATE TABLE data_t1(a INTEGER, b TEXT, c, rbu_control);
+//
+// The order of the columns in the data_% table does not matter.
+//
+// Instead of a regular table, the RBU database may also contain virtual
+// tables or view named using the data_<target> naming scheme.
+//
+// Instead of the plain data_<target> naming scheme, RBU database tables
+// may also be named data<integer>_<target>, where <integer> is any sequence
+// of zero or more numeric characters (0-9). This can be significant because
+// tables within the RBU database are always processed in order sorted by
+// name. By judicious selection of the <integer> portion of the names
+// of the RBU tables the user can therefore control the order in which they
+// are processed. This can be useful, for example, to ensure that "external
+// content" FTS4 tables are updated before their underlying content tables.
+//
+// If the target database table is a virtual table or a table that has no
+// PRIMARY KEY declaration, the data_% table must also contain a column
+// named "rbu_rowid". This column is mapped to the tables implicit primary
+// key column - "rowid". Virtual tables for which the "rowid" column does
+// not function like a primary key value cannot be updated using RBU. For
+// example, if the target db contains either of the following:
+//
+// CREATE VIRTUAL TABLE x1 USING fts3(a, b);
+// CREATE TABLE x1(a, b)
+//
+// then the RBU database should contain:
+//
+// CREATE TABLE data_x1(a, b, rbu_rowid, rbu_control);
+//
+// All non-hidden columns (i.e. all columns matched by "SELECT *") of the
+// target table must be present in the input table. For virtual tables,
+// hidden columns are optional - they are updated by RBU if present in
+// the input table, or not otherwise. For example, to write to an fts4
+// table with a hidden languageid column such as:
+//
+// CREATE VIRTUAL TABLE ft1 USING fts4(a, b, languageid='langid');
+//
+// Either of the following input table schemas may be used:
+//
+// CREATE TABLE data_ft1(a, b, langid, rbu_rowid, rbu_control);
+// CREATE TABLE data_ft1(a, b, rbu_rowid, rbu_control);
+//
+// For each row to INSERT into the target database as part of the RBU
+// update, the corresponding data_% table should contain a single record
+// with the "rbu_control" column set to contain integer value 0. The
+// other columns should be set to the values that make up the new record
+// to insert.
+//
+// If the target database table has an INTEGER PRIMARY KEY, it is not
+// possible to insert a NULL value into the IPK column. Attempting to
+// do so results in an SQLITE_MISMATCH error.
+//
+// For each row to DELETE from the target database as part of the RBU
+// update, the corresponding data_% table should contain a single record
+// with the "rbu_control" column set to contain integer value 1. The
+// real primary key values of the row to delete should be stored in the
+// corresponding columns of the data_% table. The values stored in the
+// other columns are not used.
+//
+// For each row to UPDATE from the target database as part of the RBU
+// update, the corresponding data_% table should contain a single record
+// with the "rbu_control" column set to contain a value of type text.
+// The real primary key values identifying the row to update should be
+// stored in the corresponding columns of the data_% table row, as should
+// the new values of all columns being update. The text value in the
+// "rbu_control" column must contain the same number of characters as
+// there are columns in the target database table, and must consist entirely
+// of 'x' and '.' characters (or in some special cases 'd' - see below). For
+// each column that is being updated, the corresponding character is set to
+// 'x'. For those that remain as they are, the corresponding character of the
+// rbu_control value should be set to '.'. For example, given the tables
+// above, the update statement:
+//
+// UPDATE t1 SET c = 'usa' WHERE a = 4;
+//
+// is represented by the data_t1 row created by:
+//
+// INSERT INTO data_t1(a, b, c, rbu_control) VALUES(4, NULL, 'usa', '..x');
+//
+// Instead of an 'x' character, characters of the rbu_control value specified
+// for UPDATEs may also be set to 'd'. In this case, instead of updating the
+// target table with the value stored in the corresponding data_% column, the
+// user-defined SQL function "rbu_delta()" is invoked and the result stored in
+// the target table column. rbu_delta() is invoked with two arguments - the
+// original value currently stored in the target table column and the
+// value specified in the data_xxx table.
+//
+// For example, this row:
+//
+// INSERT INTO data_t1(a, b, c, rbu_control) VALUES(4, NULL, 'usa', '..d');
+//
+// is similar to an UPDATE statement such as:
+//
+// UPDATE t1 SET c = rbu_delta(c, 'usa') WHERE a = 4;
+//
+// Finally, if an 'f' character appears in place of a 'd' or 's' in an
+// ota_control string, the contents of the data_xxx table column is assumed
+// to be a "fossil delta" - a patch to be applied to a blob value in the
+// format used by the fossil source-code management system. In this case
+// the existing value within the target database table must be of type BLOB.
+// It is replaced by the result of applying the specified fossil delta to
+// itself.
+//
+// If the target database table is a virtual table or a table with no PRIMARY
+// KEY, the rbu_control value should not include a character corresponding
+// to the rbu_rowid value. For example, this:
+//
+// INSERT INTO data_ft1(a, b, rbu_rowid, rbu_control)
+// VALUES(NULL, 'usa', 12, '.x');
+//
+// causes a result similar to:
+//
+// UPDATE ft1 SET b = 'usa' WHERE rowid = 12;
+//
+// The data_xxx tables themselves should have no PRIMARY KEY declarations.
+// However, RBU is more efficient if reading the rows in from each data_xxx
+// table in "rowid" order is roughly the same as reading them sorted by
+// the PRIMARY KEY of the corresponding target database table. In other
+// words, rows should be sorted using the destination table PRIMARY KEY
+// fields before they are inserted into the data_xxx tables.
+//
+// USAGE
+//
+// The API declared below allows an application to apply an RBU update
+// stored on disk to an existing target database. Essentially, the
+// application:
+//
+// 1) Opens an RBU handle using the sqlite3rbu_open() function.
+//
+// 2) Registers any required virtual table modules with the database
+// handle returned by sqlite3rbu_db(). Also, if required, register
+// the rbu_delta() implementation.
+//
+// 3) Calls the sqlite3rbu_step() function one or more times on
+// the new handle. Each call to sqlite3rbu_step() performs a single
+// b-tree operation, so thousands of calls may be required to apply
+// a complete update.
+//
+// 4) Calls sqlite3rbu_close() to close the RBU update handle. If
+// sqlite3rbu_step() has been called enough times to completely
+// apply the update to the target database, then the RBU database
+// is marked as fully applied. Otherwise, the state of the RBU
+// update application is saved in the RBU database for later
+// resumption.
+//
+// See comments below for more detail on APIs.
+//
+// If an update is only partially applied to the target database by the
+// time sqlite3rbu_close() is called, various state information is saved
+// within the RBU database. This allows subsequent processes to automatically
+// resume the RBU update from where it left off.
+//
+// To remove all RBU extension state information, returning an RBU database
+// to its original contents, it is sufficient to drop all tables that begin
+// with the prefix "rbu_"
+//
+// DATABASE LOCKING
+//
+// An RBU update may not be applied to a database in WAL mode. Attempting
+// to do so is an error (SQLITE_ERROR).
+//
+// While an RBU handle is open, a SHARED lock may be held on the target
+// database file. This means it is possible for other clients to read the
+// database, but not to write it.
+//
+// If an RBU update is started and then suspended before it is completed,
+// then an external client writes to the database, then attempting to resume
+// the suspended RBU update is also an error (SQLITE_BUSY).
+
+// #include "sqlite3.h" ** Required for error code definitions **
+
+type Sqlite3rbu = sqlite3rbu /* sqlite3.c:195610:27 */
+
+//************* End of sqlite3rbu.h *****************************************
+//************* Continuing where we left off in sqlite3rbu.c ****************
+
+// Maximum number of prepared UPDATE statements held by this module
+
+// Delta checksums disabled by default. Compile with -DRBU_ENABLE_DELTA_CKSUM
+// to enable checksum verification.
+
+// Swap two objects of type TYPE.
+
+// The rbu_state table is used to save the state of a partially applied
+// update so that it can be resumed later. The table consists of integer
+// keys mapped to values as follows:
+//
+// RBU_STATE_STAGE:
+// May be set to integer values 1, 2, 4 or 5. As follows:
+// 1: the *-rbu file is currently under construction.
+// 2: the *-rbu file has been constructed, but not yet moved
+// to the *-wal path.
+// 4: the checkpoint is underway.
+// 5: the rbu update has been checkpointed.
+//
+// RBU_STATE_TBL:
+// Only valid if STAGE==1. The target database name of the table
+// currently being written.
+//
+// RBU_STATE_IDX:
+// Only valid if STAGE==1. The target database name of the index
+// currently being written, or NULL if the main table is currently being
+// updated.
+//
+// RBU_STATE_ROW:
+// Only valid if STAGE==1. Number of rows already processed for the current
+// table/index.
+//
+// RBU_STATE_PROGRESS:
+// Trbul number of sqlite3rbu_step() calls made so far as part of this
+// rbu update.
+//
+// RBU_STATE_CKPT:
+// Valid if STAGE==4. The 64-bit checksum associated with the wal-index
+// header created by recovering the *-wal file. This is used to detect
+// cases when another client appends frames to the *-wal file in the
+// middle of an incremental checkpoint (an incremental checkpoint cannot
+// be continued if this happens).
+//
+// RBU_STATE_COOKIE:
+// Valid if STAGE==1. The current change-counter cookie value in the
+// target db file.
+//
+// RBU_STATE_OALSZ:
+// Valid if STAGE==1. The size in bytes of the *-oal file.
+//
+// RBU_STATE_DATATBL:
+// Only valid if STAGE==1. The RBU database name of the table
+// currently being read.
+
+type RbuFrame1 = struct {
+ FiDbPage U32
+ FiWalFrame U32
+}
+
+//************* End of sqlite3rbu.h *****************************************
+//************* Continuing where we left off in sqlite3rbu.c ****************
+
+// Maximum number of prepared UPDATE statements held by this module
+
+// Delta checksums disabled by default. Compile with -DRBU_ENABLE_DELTA_CKSUM
+// to enable checksum verification.
+
+// Swap two objects of type TYPE.
+
+// The rbu_state table is used to save the state of a partially applied
+// update so that it can be resumed later. The table consists of integer
+// keys mapped to values as follows:
+//
+// RBU_STATE_STAGE:
+// May be set to integer values 1, 2, 4 or 5. As follows:
+// 1: the *-rbu file is currently under construction.
+// 2: the *-rbu file has been constructed, but not yet moved
+// to the *-wal path.
+// 4: the checkpoint is underway.
+// 5: the rbu update has been checkpointed.
+//
+// RBU_STATE_TBL:
+// Only valid if STAGE==1. The target database name of the table
+// currently being written.
+//
+// RBU_STATE_IDX:
+// Only valid if STAGE==1. The target database name of the index
+// currently being written, or NULL if the main table is currently being
+// updated.
+//
+// RBU_STATE_ROW:
+// Only valid if STAGE==1. Number of rows already processed for the current
+// table/index.
+//
+// RBU_STATE_PROGRESS:
+// Trbul number of sqlite3rbu_step() calls made so far as part of this
+// rbu update.
+//
+// RBU_STATE_CKPT:
+// Valid if STAGE==4. The 64-bit checksum associated with the wal-index
+// header created by recovering the *-wal file. This is used to detect
+// cases when another client appends frames to the *-wal file in the
+// middle of an incremental checkpoint (an incremental checkpoint cannot
+// be continued if this happens).
+//
+// RBU_STATE_COOKIE:
+// Valid if STAGE==1. The current change-counter cookie value in the
+// target db file.
+//
+// RBU_STATE_OALSZ:
+// Valid if STAGE==1. The size in bytes of the *-oal file.
+//
+// RBU_STATE_DATATBL:
+// Only valid if STAGE==1. The RBU database name of the table
+// currently being read.
+
+type RbuFrame = RbuFrame1 /* sqlite3.c:196034:25 */
+type RbuObjIter1 = struct {
+ FpTblIter uintptr
+ FpIdxIter uintptr
+ FnTblCol int32
+ FazTblCol uintptr
+ FazTblType uintptr
+ FaiSrcOrder uintptr
+ FabTblPk uintptr
+ FabNotNull uintptr
+ FabIndexed uintptr
+ FeType int32
+ FbCleanup int32
+ FzTbl uintptr
+ FzDataTbl uintptr
+ FzIdx uintptr
+ FiTnum int32
+ FiPkTnum int32
+ FbUnique int32
+ FnIndex int32
+ FnCol int32
+ FpSelect uintptr
+ FpInsert uintptr
+ FpDelete uintptr
+ FpTmpInsert uintptr
+ FnIdxCol int32
+ FaIdxCol uintptr
+ FzIdxSql uintptr
+ FpRbuUpdate uintptr
+}
+
+type RbuObjIter = RbuObjIter1 /* sqlite3.c:196035:27 */
+type RbuState1 = struct {
+ FeStage int32
+ FzTbl uintptr
+ FzDataTbl uintptr
+ FzIdx uintptr
+ FiWalCksum I64
+ FnRow int32
+ FnProgress I64
+ FiCookie U32
+ FiOalSz I64
+ FnPhaseOneStep I64
+}
+
+type RbuState = RbuState1 /* sqlite3.c:196036:25 */
+type RbuSpan1 = struct {
+ FzSpan uintptr
+ FnSpan int32
+ _ [4]byte
+}
+
+type RbuSpan = RbuSpan1 /* sqlite3.c:196037:24 */
+type rbu_vfs = struct {
+ Fbase Sqlite3_vfs
+ FpRealVfs uintptr
+ Fmutex uintptr
+ FpRbu uintptr
+ FpMain uintptr
+ FpMainRbu uintptr
+}
+
+type Rbu_vfs = rbu_vfs /* sqlite3.c:196038:24 */
+type rbu_file = struct {
+ Fbase Sqlite3_file
+ FpReal uintptr
+ FpRbuVfs uintptr
+ FpRbu uintptr
+ Fsz I64
+ FopenFlags int32
+ FiCookie U32
+ FiWriteVer U8
+ FbNolock U8
+ FnShm int32
+ FapShm uintptr
+ FzDel uintptr
+ FzWal uintptr
+ FpWalFd uintptr
+ FpMainNext uintptr
+ FpMainRbuNext uintptr
+}
+
+type Rbu_file = rbu_file /* sqlite3.c:196039:25 */
+type RbuUpdateStmt1 = struct {
+ FzMask uintptr
+ FpUpdate uintptr
+ FpNext uintptr
+}
+
+type RbuUpdateStmt = RbuUpdateStmt1 /* sqlite3.c:196040:30 */
+
+// True for an RBU vacuum handle, or false otherwise.
+
+// ************************************************************************
+//
+// The following three functions, found below:
+//
+// rbuDeltaGetInt()
+// rbuDeltaChecksum()
+// rbuDeltaApply()
+//
+// are lifted from the fossil source code (http://fossil-scm.org). They
+// are used to implement the scalar SQL function rbu_fossil_delta().
+
+// Read bytes from *pz and convert them into a positive integer. When
+// finished, leave *pz pointing to the first character past the end of
+// the integer. The *pLen parameter holds the length of the string
+// in *pz and is decremented once for each character in the integer.
+func rbuDeltaGetInt(tls *libc.TLS, pz uintptr, pLen uintptr) uint32 { /* sqlite3.c:196330:21: */
+ var v uint32 = uint32(0)
+ var c int32
+ var z uintptr = *(*uintptr)(unsafe.Pointer(pz))
+ var zStart uintptr = z
+ for (libc.AssignInt32(&c, int32(zValue[(0x7f&int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&z, 1)))))]))) >= 0 {
+ v = ((v << 6) + uint32(c))
+ }
+ z--
+ *(*int32)(unsafe.Pointer(pLen)) -= int32(((int64(z) - int64(zStart)) / 1))
+ *(*uintptr)(unsafe.Pointer(pz)) = z
+ return v
+}
+
+var zValue = [128]int8{
+ int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1),
+ int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1),
+ int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1),
+ int8(0), int8(1), int8(2), int8(3), int8(4), int8(5), int8(6), int8(7), int8(8), int8(9), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1), int8(-1),
+ int8(-1), int8(10), int8(11), int8(12), int8(13), int8(14), int8(15), int8(16), int8(17), int8(18), int8(19), int8(20), int8(21), int8(22), int8(23), int8(24),
+ int8(25), int8(26), int8(27), int8(28), int8(29), int8(30), int8(31), int8(32), int8(33), int8(34), int8(35), int8(-1), int8(-1), int8(-1), int8(-1), int8(36),
+ int8(-1), int8(37), int8(38), int8(39), int8(40), int8(41), int8(42), int8(43), int8(44), int8(45), int8(46), int8(47), int8(48), int8(49), int8(50), int8(51),
+ int8(52), int8(53), int8(54), int8(55), int8(56), int8(57), int8(58), int8(59), int8(60), int8(61), int8(62), int8(-1), int8(-1), int8(-1), int8(63), int8(-1),
+} /* sqlite3.c:196331:28 */
+
+// Apply a delta.
+//
+// The output buffer should be big enough to hold the whole output
+// file and a NUL terminator at the end. The delta_output_size()
+// routine will determine this size for you.
+//
+// The delta string should be null-terminated. But the delta string
+// may contain embedded NUL characters (if the input and output are
+// binary files) so we also have to pass in the length of the delta in
+// the lenDelta parameter.
+//
+// This function returns the size of the output file in bytes (excluding
+// the final NUL terminator character). Except, if the delta string is
+// malformed or intended for use with a source file other than zSrc,
+// then this routine returns -1.
+//
+// Refer to the delta_create() documentation above for a description
+// of the delta file format.
+func rbuDeltaApply(tls *libc.TLS, zSrc uintptr, lenSrc int32, zDelta uintptr, lenDelta int32, zOut uintptr) int32 { /* sqlite3.c:196411:12: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+ *(*uintptr)(unsafe.Pointer(bp)) = zDelta
+ *(*int32)(unsafe.Pointer(bp + 8)) = lenDelta
+
+ var limit uint32
+ var total uint32 = uint32(0)
+
+ limit = rbuDeltaGetInt(tls, bp /* &zDelta */, bp+8 /* &lenDelta */)
+ if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zDelta */))))) != '\n' {
+ // ERROR: size integer not terminated by "\n"
+ return -1
+ }
+ *(*uintptr)(unsafe.Pointer(bp /* zDelta */))++
+ *(*int32)(unsafe.Pointer(bp + 8 /* lenDelta */))--
+ for (*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zDelta */)))) != 0) && (*(*int32)(unsafe.Pointer(bp + 8 /* lenDelta */)) > 0) {
+ var cnt uint32
+ var ofst uint32
+ cnt = rbuDeltaGetInt(tls, bp /* &zDelta */, bp+8 /* &lenDelta */)
+ switch int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zDelta */)) + uintptr(0)))) {
+ case '@':
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* zDelta */))++
+ *(*int32)(unsafe.Pointer(bp + 8 /* lenDelta */))--
+ ofst = rbuDeltaGetInt(tls, bp /* &zDelta */, bp+8 /* &lenDelta */)
+ if (*(*int32)(unsafe.Pointer(bp + 8 /* lenDelta */)) > 0) && (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zDelta */)) + uintptr(0)))) != ',') {
+ // ERROR: copy command not terminated by ','
+ return -1
+ }
+ *(*uintptr)(unsafe.Pointer(bp /* zDelta */))++
+ *(*int32)(unsafe.Pointer(bp + 8 /* lenDelta */))--
+ total = total + (cnt)
+ if total > limit {
+ // ERROR: copy exceeds output file size
+ return -1
+ }
+ if (int32(ofst + cnt)) > lenSrc {
+ // ERROR: copy extends past end of input
+ return -1
+ }
+ libc.Xmemcpy(tls, zOut, (zSrc + uintptr(ofst)), uint64(cnt))
+ zOut += uintptr(cnt)
+ break
+ }
+ case ':':
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* zDelta */))++
+ *(*int32)(unsafe.Pointer(bp + 8 /* lenDelta */))--
+ total = total + (cnt)
+ if total > limit {
+ // ERROR: insert command gives an output larger than predicted
+ return -1
+ }
+ if int32(cnt) > *(*int32)(unsafe.Pointer(bp + 8 /* lenDelta */)) {
+ // ERROR: insert count exceeds size of delta
+ return -1
+ }
+ libc.Xmemcpy(tls, zOut, *(*uintptr)(unsafe.Pointer(bp /* zDelta */)), uint64(cnt))
+ zOut += uintptr(cnt)
+ *(*uintptr)(unsafe.Pointer(bp /* zDelta */)) += uintptr(cnt)
+ *(*int32)(unsafe.Pointer(bp + 8 /* lenDelta */)) -= int32(cnt)
+ break
+ }
+ case ';':
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* zDelta */))++
+ *(*int32)(unsafe.Pointer(bp + 8 /* lenDelta */))--
+ *(*int8)(unsafe.Pointer(zOut + uintptr(0))) = int8(0)
+ if total != limit {
+ // ERROR: generated size does not match predicted size
+ return -1
+ }
+ return int32(total)
+ }
+ default:
+ {
+ // ERROR: unknown delta operator
+ return -1
+ }
+ }
+ }
+ // ERROR: unterminated delta
+ return -1
+}
+
+func rbuDeltaOutputSize(tls *libc.TLS, zDelta uintptr, lenDelta int32) int32 { /* sqlite3.c:196497:12: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+ *(*uintptr)(unsafe.Pointer(bp)) = zDelta
+ *(*int32)(unsafe.Pointer(bp + 8)) = lenDelta
+
+ var size int32
+ size = int32(rbuDeltaGetInt(tls, bp /* &zDelta */, bp+8 /* &lenDelta */))
+ if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zDelta */))))) != '\n' {
+ // ERROR: size integer not terminated by "\n"
+ return -1
+ }
+ return size
+}
+
+//
+// End of code taken from fossil.
+//
+
+// Implementation of SQL scalar function rbu_fossil_delta().
+//
+// This function applies a fossil delta patch to a blob. Exactly two
+// arguments must be passed to this function. The first is the blob to
+// patch and the second the patch to apply. If no error occurs, this
+// function returns the patched blob.
+func rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:196519:13: */
+ var aDelta uintptr
+ var nDelta int32
+ var aOrig uintptr
+ var nOrig int32
+ var nOut int32
+ var nOut2 int32
+ var aOut uintptr
+
+ nOrig = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ aOrig = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ nDelta = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
+ aDelta = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))
+
+ // Figure out the size of the output
+ nOut = rbuDeltaOutputSize(tls, aDelta, nDelta)
+ if nOut < 0 {
+ Xsqlite3_result_error(tls, context, ts+31151 /* "corrupt fossil d..." */, -1)
+ return
+ }
+
+ aOut = Xsqlite3_malloc(tls, (nOut + 1))
+ if aOut == uintptr(0) {
+ Xsqlite3_result_error_nomem(tls, context)
+ } else {
+ nOut2 = rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut)
+ if nOut2 != nOut {
+ Xsqlite3_free(tls, aOut)
+ Xsqlite3_result_error(tls, context, ts+31151 /* "corrupt fossil d..." */, -1)
+ } else {
+ Xsqlite3_result_blob(tls, context, aOut, nOut, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ }
+ }
+}
+
+// Prepare the SQL statement in buffer zSql against database handle db.
+// If successful, set *ppStmt to point to the new statement and return
+// SQLITE_OK.
+//
+// Otherwise, if an error does occur, set *ppStmt to NULL and return
+// an SQLite error code. Additionally, set output variable *pzErrmsg to
+// point to a buffer containing an error message. It is the responsibility
+// of the caller to (eventually) free this buffer using sqlite3_free().
+func prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:196572:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 = Xsqlite3_prepare_v2(tls, db, zSql, -1, ppStmt, uintptr(0))
+ if rc != 0 {
+ *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, db)))
+ *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
+ }
+ return rc
+}
+
+// Reset the SQL statement passed as the first argument. Return a copy
+// of the value returned by sqlite3_reset().
+//
+// If an error has occurred, then set *pzErrmsg to point to a buffer
+// containing an error message. It is the responsibility of the caller
+// to eventually free this buffer using sqlite3_free().
+func resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:196594:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 = Xsqlite3_reset(tls, pStmt)
+ if rc != 0 {
+ *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt))))
+ }
+ return rc
+}
+
+// Unless it is NULL, argument zSql points to a buffer allocated using
+// sqlite3_malloc containing an SQL statement. This function prepares the SQL
+// statement against database db and frees the buffer. If statement
+// compilation is successful, *ppStmt is set to point to the new statement
+// handle and SQLITE_OK is returned.
+//
+// Otherwise, if an error occurs, *ppStmt is set to NULL and an error code
+// returned. In this case, *pzErrmsg may also be set to point to an error
+// message. It is the responsibility of the caller to free this error message
+// buffer using sqlite3_free().
+//
+// If argument zSql is NULL, this function assumes that an OOM has occurred.
+// In this case SQLITE_NOMEM is returned and *ppStmt set to NULL.
+func prepareFreeAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg uintptr, zSql uintptr) int32 { /* sqlite3.c:196617:12: */
+ var rc int32
+
+ if zSql == uintptr(0) {
+ rc = 7
+ *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
+ } else {
+ rc = prepareAndCollectError(tls, db, ppStmt, pzErrmsg, zSql)
+ Xsqlite3_free(tls, zSql)
+ }
+ return rc
+}
+
+// Free the RbuObjIter.azTblCol[] and RbuObjIter.abTblPk[] arrays allocated
+// by an earlier call to rbuObjIterCacheTableInfo().
+func rbuObjIterFreeCols(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196639:13: */
+ var i int32
+ for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)))
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(i)*8)))
+ }
+ Xsqlite3_free(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol = uintptr(0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType = uintptr(0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder = uintptr(0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk = uintptr(0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull = uintptr(0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol = 0
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FeType = 0 // Invalid value
+}
+
+// Finalize all statements and free all allocations that are specific to
+// the current object (table/index pair).
+func rbuObjIterClearStatements(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196659:13: */
+ var pUp uintptr
+
+ Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect)
+ Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpInsert)
+ Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpDelete)
+ Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTmpInsert)
+ pUp = (*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate
+ for pUp != 0 {
+ var pTmp uintptr = (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext
+ Xsqlite3_finalize(tls, (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate)
+ Xsqlite3_free(tls, pUp)
+ pUp = pTmp
+ }
+ Xsqlite3_free(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol)
+ Xsqlite3_free(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdxSql)
+
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect = uintptr(0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FpInsert = uintptr(0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FpDelete = uintptr(0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = uintptr(0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FpTmpInsert = uintptr(0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol = 0
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FnIdxCol = 0
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol = uintptr(0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdxSql = uintptr(0)
+}
+
+// Clean up any resources allocated as part of the iterator object passed
+// as the only argument.
+func rbuObjIterFinalize(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:196691:13: */
+ rbuObjIterClearStatements(tls, pIter)
+ Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter)
+ Xsqlite3_finalize(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter)
+ rbuObjIterFreeCols(tls, pIter)
+ libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(RbuObjIter{})))
+}
+
+// Advance the iterator to the next position.
+//
+// If no error occurs, SQLITE_OK is returned and the iterator is left
+// pointing to the next entry. Otherwise, an error code and message is
+// left in the RBU handle passed as the first argument. A copy of the
+// error code is returned.
+func rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:196707:12: */
+ var rc int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
+ if rc == 0 {
+
+ // Free any SQLite statements used while processing the previous object
+ rbuObjIterClearStatements(tls, pIter)
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
+ rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
+
+ ts+31172 /* "DROP TRIGGER IF ..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */))
+ }
+
+ if rc == 0 {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 {
+ rbuObjIterFreeCols(tls, pIter)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = 0
+ rc = Xsqlite3_step(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter)
+ if rc != 100 {
+ rc = resetAndCollectError(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter, (p + 64 /* &.zErrmsg */))
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl = uintptr(0)
+ } else {
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl = Xsqlite3_column_text(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter, 0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl = Xsqlite3_column_text(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpTblIter, 1)
+ if ((*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl != 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) {
+ rc = 0
+ } else {
+ rc = 7
+ }
+ }
+ } else {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
+ var pIdx uintptr = (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter
+ rc = Xsqlite3_bind_text(tls, pIdx, 1, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, -1, uintptr(0))
+ }
+ if rc == 0 {
+ rc = Xsqlite3_step(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter)
+ if rc != 100 {
+ rc = resetAndCollectError(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter, (p + 64 /* &.zErrmsg */))
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = 1
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx = uintptr(0)
+ } else {
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx = Xsqlite3_column_text(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter, 0)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FiTnum = Xsqlite3_column_int(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter, 1)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FbUnique = Xsqlite3_column_int(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpIdxIter, 2)
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx != 0 {
+ rc = 0
+ } else {
+ rc = 7
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if rc != 0 {
+ rbuObjIterFinalize(tls, pIter)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
+ }
+ return rc
+}
+
+// The implementation of the rbu_target_name() SQL function. This function
+// accepts one or two arguments. The first argument is the name of a table -
+// the name of a table in the RBU database. The second, if it is present, is 1
+// for a view or 0 for a table.
+//
+// For a non-vacuum RBU handle, if the table name matches the pattern:
+//
+// data[0-9]_<name>
+//
+// where <name> is any sequence of 1 or more characters, <name> is returned.
+// Otherwise, if the only argument does not match the above pattern, an SQL
+// NULL is returned.
+//
+// "data_t1" -> "t1"
+// "data0123_t2" -> "t2"
+// "dataAB_t3" -> NULL
+//
+// For an rbu vacuum handle, a copy of the first argument is returned if
+// the second argument is either missing or 0 (not a view).
+func rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { /* sqlite3.c:196787:13: */
+ var p uintptr = Xsqlite3_user_data(tls, pCtx)
+ var zIn uintptr
+
+ zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+ if zIn != 0 {
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+
+ if (argc == 1) || (0 == Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))) {
+ Xsqlite3_result_text(tls, pCtx, zIn, -1, uintptr(0))
+ }
+ } else {
+ if (libc.Xstrlen(tls, zIn) > uint64(4)) && (libc.Xmemcmp(tls, ts+28342 /* "data" */, zIn, uint64(4)) == 0) {
+ var i int32
+ for i = 4; (int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= '9'); i++ {
+ }
+ if (int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) == '_') && (*(*int8)(unsafe.Pointer(zIn + uintptr((i + 1)))) != 0) {
+ Xsqlite3_result_text(tls, pCtx, (zIn + uintptr((i + 1))), -1, uintptr(0))
+ }
+ }
+ }
+ }
+}
+
+// Initialize the iterator structure passed as the second argument.
+//
+// If no error occurs, SQLITE_OK is returned and the iterator is left
+// pointing to the first entry. Otherwise, an error code and message is
+// left in the RBU handle passed as the first argument. A copy of the
+// error code is returned.
+func rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:196823:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32
+ libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(RbuObjIter{})))
+
+ rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter /* &.pTblIter */), (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls,
+
+ ts+31343 /* "SELECT rbu_targe..." */, libc.VaList(bp, func() uintptr {
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ return ts + 31493 /* "AND rootpage!=0 ..." */
+ }
+ return ts + 781 /* "" */
+ }())))
+
+ if rc == 0 {
+ rc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 8 /* &.pIdxIter */), (p + 64 /* &.zErrmsg */),
+
+ ts+31534 /* "SELECT name, roo..." */)
+ }
+
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = 1
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
+ return rbuObjIterNext(tls, p, pIter)
+}
+
+// This is a wrapper around "sqlite3_mprintf(zFmt, ...)". If an OOM occurs,
+// an error code is stored in the RBU handle passed as the first argument.
+//
+// If an error has already occurred (p->rc is already set to something other
+// than SQLITE_OK), then this function returns NULL without modifying the
+// stored error code. In this case it still calls sqlite3_free() on any
+// printf() parameters associated with %z conversions.
+func rbuMPrintf(tls *libc.TLS, p uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:196858:13: */
+ var zSql uintptr = uintptr(0)
+ var ap Va_list
+ _ = ap
+ ap = va
+ zSql = Xsqlite3_vmprintf(tls, zFmt, ap)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ if zSql == uintptr(0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 7
+ }
+ } else {
+ Xsqlite3_free(tls, zSql)
+ zSql = uintptr(0)
+ }
+ _ = ap
+ return zSql
+}
+
+// Argument zFmt is a sqlite3_mprintf() style format string. The trailing
+// arguments are the usual subsitution values. This function performs
+// the printf() style substitutions and executes the result as an SQL
+// statement on the RBU handles database.
+//
+// If an error occurs, an error code and error message is stored in the
+// RBU handle. If an error has already occurred when this function is
+// called, it is a no-op.
+func rbuMPrintfExec(tls *libc.TLS, p uintptr, db uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:196883:12: */
+ var ap Va_list
+ _ = ap
+ var zSql uintptr
+ ap = va
+ zSql = Xsqlite3_vmprintf(tls, zFmt, ap)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ if zSql == uintptr(0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 7
+ } else {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, zSql, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */))
+ }
+ }
+ Xsqlite3_free(tls, zSql)
+ _ = ap
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
+}
+
+// Attempt to allocate and return a pointer to a zeroed block of nByte
+// bytes.
+//
+// If an error (i.e. an OOM condition) occurs, return NULL and leave an
+// error code in the rbu handle passed as the first argument. Or, if an
+// error has already occurred when this function is called, return NULL
+// immediately without attempting the allocation or modifying the stored
+// error code.
+func rbuMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:196910:13: */
+ var pRet uintptr = uintptr(0)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+
+ pRet = Xsqlite3_malloc64(tls, uint64(nByte))
+ if pRet == uintptr(0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 7
+ } else {
+ libc.Xmemset(tls, pRet, 0, uint64(nByte))
+ }
+ }
+ return pRet
+}
+
+// Allocate and zero the pIter->azTblCol[] and abTblPk[] arrays so that
+// there is room for at least nCol elements. If an OOM occurs, store an
+// error code in the RBU handle passed as the first argument.
+func rbuAllocateIterArrays(tls *libc.TLS, p uintptr, pIter uintptr, nCol int32) { /* sqlite3.c:196930:13: */
+ var nByte Sqlite3_int64 = (Sqlite3_int64((((uint64(2) * uint64(unsafe.Sizeof(uintptr(0)))) + uint64(unsafe.Sizeof(int32(0)))) + (uint64(3) * uint64(unsafe.Sizeof(U8(0))))) * uint64(nCol)))
+ var azNew uintptr
+
+ azNew = rbuMalloc(tls, p, nByte)
+ if azNew != 0 {
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol = azNew
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType = (azNew + uintptr(nCol)*8)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder = ((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(nCol)*8)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk = ((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(nCol)*4)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull = ((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(nCol))
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed = ((*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(nCol))
+ }
+}
+
+// The first argument must be a nul-terminated string. This function
+// returns a copy of the string in memory obtained from sqlite3_malloc().
+// It is the responsibility of the caller to eventually free this memory
+// using sqlite3_free().
+//
+// If an OOM condition is encountered when attempting to allocate memory,
+// output variable (*pRc) is set to SQLITE_NOMEM before returning. Otherwise,
+// if the allocation succeeds, (*pRc) is left unchanged.
+func rbuStrndup(tls *libc.TLS, zStr uintptr, pRc uintptr) uintptr { /* sqlite3.c:196955:13: */
+ var zRet uintptr = uintptr(0)
+
+ if *(*int32)(unsafe.Pointer(pRc)) == 0 {
+ if zStr != 0 {
+ var nCopy Size_t = (libc.Xstrlen(tls, zStr) + uint64(1))
+ zRet = Xsqlite3_malloc64(tls, uint64(nCopy))
+ if zRet != 0 {
+ libc.Xmemcpy(tls, zRet, zStr, nCopy)
+ } else {
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+ }
+ }
+ }
+
+ return zRet
+}
+
+// Finalize the statement passed as the second argument.
+//
+// If the sqlite3_finalize() call indicates that an error occurs, and the
+// rbu handle error code is not already set, set the error code and error
+// message accordingly.
+func rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { /* sqlite3.c:196980:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var db uintptr = Xsqlite3_db_handle(tls, pStmt)
+ var rc int32 = Xsqlite3_finalize(tls, pStmt)
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (rc != 0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, db)))
+ }
+}
+
+// Determine the type of a table.
+//
+// peType is of type (int*), a pointer to an output parameter of type
+// (int). This call sets the output parameter as follows, depending
+// on the type of the table specified by parameters dbName and zTbl.
+//
+// RBU_PK_NOTABLE: No such table.
+// RBU_PK_NONE: Table has an implicit rowid.
+// RBU_PK_IPK: Table has an explicit IPK column.
+// RBU_PK_EXTERNAL: Table has an external PK index.
+// RBU_PK_WITHOUT_ROWID: Table is WITHOUT ROWID.
+// RBU_PK_VTAB: Table is a virtual table.
+//
+// Argument *piPk is also of type (int*), and also points to an output
+// parameter. Unless the table has an external primary key index
+// (i.e. unless *peType is set to 3), then *piPk is set to zero. Or,
+// if the table does have an external primary key index, then *piPk
+// is set to the root page number of the primary key index before
+// returning.
+//
+// ALGORITHM:
+//
+// if( no entry exists in sqlite_schema ){
+// return RBU_PK_NOTABLE
+// }else if( sql for the entry starts with "CREATE VIRTUAL" ){
+// return RBU_PK_VTAB
+// }else if( "PRAGMA index_list()" for the table contains a "pk" index ){
+// if( the index that is the pk exists in sqlite_schema ){
+// *piPK = rootpage of that index.
+// return RBU_PK_EXTERNAL
+// }else{
+// return RBU_PK_WITHOUT_ROWID
+// }
+// }else if( "PRAGMA table_info()" lists one or more "pk" columns ){
+// return RBU_PK_IPK
+// }else{
+// return RBU_PK_NONE
+// }
+func rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnum uintptr, piPk uintptr) { /* sqlite3.c:197028:13: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ // 0) SELECT count(*) FROM sqlite_schema where name=%Q AND IsVirtual(%Q)
+ // 1) PRAGMA index_list = ?
+ // 2) SELECT count(*) FROM sqlite_schema where name=%Q
+ // 3) PRAGMA table_info = ?
+ // var aStmt [4]uintptr at bp+32, 32
+
+ var zOrig uintptr
+ var zIdx uintptr
+ var i uint32
+ *(*[4]uintptr)(unsafe.Pointer(bp + 32 /* aStmt */)) = [4]uintptr{uintptr(0), uintptr(0), uintptr(0), uintptr(0)}
+
+ *(*int32)(unsafe.Pointer(peType)) = 0
+ *(*int32)(unsafe.Pointer(piPk)) = 0
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + uintptr(0)*8), (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls,
+
+ ts+31659 /* "SELECT (sql LIKE..." */, libc.VaList(bp, zTab)))
+ if !(((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0) || (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + uintptr(0)*8))) != 100)) {
+ goto __1
+ }
+ // Either an error, or no such table.
+ goto rbuTableType_end
+__1:
+ ;
+ if !(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + uintptr(0)*8)), 0) != 0) {
+ goto __2
+ }
+ *(*int32)(unsafe.Pointer(peType)) = 5 // virtual table
+ goto rbuTableType_end
+__2:
+ ;
+ *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + uintptr(0)*8)), 1)
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + uintptr(1)*8), (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+31740 /* "PRAGMA index_lis..." */, libc.VaList(bp+8, zTab)))
+ if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0) {
+ goto __3
+ }
+ goto rbuTableType_end
+__3:
+ ;
+__4:
+ if !(Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + uintptr(1)*8))) == 100) {
+ goto __5
+ }
+ zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + uintptr(1)*8)), 3)
+ zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + uintptr(1)*8)), 1)
+ if !(((zOrig != 0) && (zIdx != 0)) && (int32(*(*U8)(unsafe.Pointer(zOrig + uintptr(0)))) == 'p')) {
+ goto __6
+ }
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + uintptr(2)*8), (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls,
+ ts+31761 /* "SELECT rootpage ..." */, libc.VaList(bp+16, zIdx)))
+ if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) {
+ goto __7
+ }
+ if !(Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + uintptr(2)*8))) == 100) {
+ goto __8
+ }
+ *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + uintptr(2)*8)), 0)
+ *(*int32)(unsafe.Pointer(peType)) = 3
+ goto __9
+__8:
+ *(*int32)(unsafe.Pointer(peType)) = 4
+__9:
+ ;
+__7:
+ ;
+ goto rbuTableType_end
+__6:
+ ;
+ goto __4
+__5:
+ ;
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (bp + 32 /* &aStmt */ + uintptr(3)*8), (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+31812 /* "PRAGMA table_inf..." */, libc.VaList(bp+24, zTab)))
+ if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) {
+ goto __10
+ }
+__11:
+ if !(Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + uintptr(3)*8))) == 100) {
+ goto __12
+ }
+ if !(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + uintptr(3)*8)), 5) > 0) {
+ goto __13
+ }
+ *(*int32)(unsafe.Pointer(peType)) = 2 // explicit IPK column
+ goto rbuTableType_end
+__13:
+ ;
+ goto __11
+__12:
+ ;
+ *(*int32)(unsafe.Pointer(peType)) = 1
+__10:
+ ;
+
+rbuTableType_end:
+ i = uint32(0)
+__14:
+ if !(uint64(i) < (uint64(unsafe.Sizeof([4]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0))))) {
+ goto __16
+ }
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 32 /* &aStmt[0] */ + uintptr(i)*8)))
+ goto __15
+__15:
+ i++
+ goto __14
+ goto __16
+__16:
+}
+
+// This is a helper function for rbuObjIterCacheTableInfo(). It populates
+// the pIter->abIndexed[] array.
+func rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:197112:13: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* pList */)) = uintptr(0)
+ var bIndex int32 = 0
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ libc.Xmemcpy(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, (uint64(unsafe.Sizeof(U8(0))) * uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+16 /* &pList */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+31833 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
+ }
+
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0
+ for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pList */)))) {
+ var zIdx uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pList */)), 1)
+ var bPartial int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pList */)), 4)
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pXInfo */)) = uintptr(0)
+ if zIdx == uintptr(0) {
+ break
+ }
+ if bPartial != 0 {
+ libc.Xmemset(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, 0x01, (uint64(unsafe.Sizeof(U8(0))) * uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)))
+ }
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+24 /* &pXInfo */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+31861 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx)))
+ for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pXInfo */)))) {
+ var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pXInfo */)), 1)
+ if iCid >= 0 {
+ *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(iCid))) = U8(1)
+ }
+ if iCid == -2 {
+ libc.Xmemset(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, 0x01, (uint64(unsafe.Sizeof(U8(0))) * uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)))
+ }
+ }
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 24 /* pXInfo */)))
+ bIndex = 1
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FnIndex++
+ }
+
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 4 {
+ // "PRAGMA index_list" includes the main PK b-tree
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FnIndex--
+ }
+
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* pList */)))
+ if bIndex == 0 {
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed = uintptr(0)
+ }
+}
+
+// If they are not already populated, populate the pIter->azTblCol[],
+// pIter->abTblPk[], pIter->nTblCol and pIter->bRowid variables according to
+// the table (not index) that the iterator currently points to.
+//
+// Return SQLITE_OK if successful, or an SQLite error code otherwise. If
+// an error does occur, an error code and error message are also left in
+// the RBU handle.
+func rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:197166:12: */
+ bp := tls.Alloc(72)
+ defer tls.Free(72)
+
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)) = uintptr(0)
+ var nCol int32 = 0
+ var i int32 // for() loop iterator variable
+ var bRbuRowid int32 = 0 // If input table has column "rbu_rowid"
+ var iOrder int32 = 0
+ *(*int32)(unsafe.Pointer(bp + 56 /* iTnum */)) = 0
+
+ // Figure out the type of table this step will deal with.
+
+ rbuTableType(tls, p, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, (pIter + 72 /* &.eType */), bp+56 /* &iTnum */, (pIter + 108 /* &.iPkTnum */))
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 1
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+20683 /* "no such table: %..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl))
+ }
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 {
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
+ }
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FiTnum = *(*int32)(unsafe.Pointer(bp + 56 /* iTnum */))
+ }
+
+ // Populate the azTblCol[] and nTblCol variables based on the columns
+ // of the input table. Ignore any input table columns that begin with
+ // "rbu_".
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+64 /* &pStmt */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+31890 /* "SELECT * FROM '%..." */, libc.VaList(bp+8, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)))
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)))
+ rbuAllocateIterArrays(tls, p, pIter, nCol)
+ }
+ for i = 0; ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (i < nCol); i++ {
+ var zName uintptr = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)), i)
+ if Xsqlite3_strnicmp(tls, ts+31909 /* "rbu_" */, zName, 4) != 0 {
+ var zCopy uintptr = rbuStrndup(tls, zName, (p + 56 /* &.rc */))
+ *(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol
+ *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(libc.PostIncInt32(&(*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol, 1))*8)) = zCopy
+ } else if 0 == Xsqlite3_stricmp(tls, ts+31914 /* "rbu_rowid" */, zName) {
+ bRbuRowid = 1
+ }
+ }
+ Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)))
+ *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)) = uintptr(0)
+
+ if (((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) &&
+ ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0)) &&
+ (bRbuRowid != (libc.Bool32(((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 5) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 1)))) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 1
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls,
+ ts+31924 /* "table %q %s rbu_..." */, libc.VaList(bp+16, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
+ func() uintptr {
+ if bRbuRowid != 0 {
+ return ts + 31953 /* "may not have" */
+ }
+ return ts + 31966 /* "requires" */
+ }()))
+ }
+
+ // Check that all non-HIDDEN columns in the destination table are also
+ // present in the input table. Populate the abTblPk[], azTblType[] and
+ // aiTblOrder[] arrays at the same time.
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+64 /* &pStmt */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+31975 /* "PRAGMA table_inf..." */, libc.VaList(bp+32, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
+ }
+ for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)))) {
+ var zName uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)), 1)
+ if zName == uintptr(0) {
+ break
+ } // An OOM - finalize() below returns S_NOMEM
+ for i = iOrder; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
+ if 0 == libc.Xstrcmp(tls, zName, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))) {
+ break
+ }
+ }
+ if i == (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 1
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+31997, /* "column missing f..." */
+ libc.VaList(bp+40, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName))
+ } else {
+ var iPk int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)), 5)
+ var bNotNull int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)), 3)
+ var zType uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)), 2)
+
+ if i != iOrder {
+ {
+ var t int32 = *(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))
+ *(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4)) = *(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(iOrder)*4))
+ *(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(iOrder)*4)) = t
+ }
+
+ {
+ var t uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
+ *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iOrder)*8))
+ *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iOrder)*8)) = t
+ }
+ }
+
+ *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iOrder)*8)) = rbuStrndup(tls, zType, (p + 56 /* &.rc */))
+
+ *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iOrder))) = U8(iPk)
+ *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iOrder))) = (U8(libc.Bool32((U8(bNotNull) != 0) || (iPk != 0))))
+ iOrder++
+ }
+ }
+
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 64 /* pStmt */)))
+ rbuObjIterCacheIndexedCols(tls, p, pIter)
+
+ }
+
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
+}
+
+// This function constructs and returns a pointer to a nul-terminated
+// string containing some SQL clause or list based on one or more of the
+// column names currently stored in the pIter->azTblCol[] array.
+func rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:197276:13: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var zList uintptr = uintptr(0)
+ var zSep uintptr = ts + 781 /* "" */
+ var i int32
+ for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
+ var z uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
+ zList = rbuMPrintf(tls, p, ts+32024 /* "%z%s\"%w\"" */, libc.VaList(bp, zList, zSep, z))
+ zSep = ts + 15677 /* ", " */
+ }
+ return zList
+}
+
+// Return a comma separated list of the quoted PRIMARY KEY column names,
+// in order, for the current table. Before each column name, add the text
+// zPre. After each column name, add the zPost text. Use zSeparator as
+// the separator text (usually ", ").
+func rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, zSeparator uintptr, zPost uintptr) uintptr { /* sqlite3.c:197297:13: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
+
+ var iPk int32 = 1
+ var zRet uintptr = uintptr(0)
+ var zSep uintptr = ts + 781 /* "" */
+ for 1 != 0 {
+ var i int32
+ for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
+ if int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk {
+ var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
+ zRet = rbuMPrintf(tls, p, ts+32033 /* "%z%s%s\"%w\"%s" */, libc.VaList(bp, zRet, zSep, zPre, zCol, zPost))
+ zSep = zSeparator
+ break
+ }
+ }
+ if i == (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol {
+ break
+ }
+ iPk++
+ }
+ return zRet
+}
+
+// This function is called as part of restarting an RBU vacuum within
+// stage 1 of the process (while the *-oal file is being built) while
+// updating a table (not an index). The table may be a rowid table or
+// a WITHOUT ROWID table. It queries the target database to find the
+// largest key that has already been written to the target table and
+// constructs a WHERE clause that can be used to extract the remaining
+// rows from the source table. For a rowid table, the WHERE clause
+// is of the form:
+//
+// "WHERE _rowid_ > ?"
+//
+// and for WITHOUT ROWID tables:
+//
+// "WHERE (key1, key2) > (?, ?)"
+//
+// Instead of "?" placeholders, the actual WHERE clauses created by
+// this function contain literal SQL values.
+func rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, zWrite uintptr) uintptr { /* sqlite3.c:197342:13: */
+ bp := tls.Alloc(80)
+ defer tls.Free(80)
+
+ *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)) = uintptr(0)
+ var zRet uintptr = uintptr(0)
+ if bRowid != 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+72 /* &pMax */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls,
+ ts+32046 /* "SELECT max(_rowi..." */, libc.VaList(bp, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)))) {
+ var iMax Sqlite3_int64 = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)), 0)
+ zRet = rbuMPrintf(tls, p, ts+32078 /* " WHERE _rowid_ >..." */, libc.VaList(bp+16, iMax))
+ }
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)))
+ } else {
+ var zOrder uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+781 /* "" */, ts+15677 /* ", " */, ts+32101 /* " DESC" */)
+ var zSelect uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+32107 /* "quote(" */, ts+32114 /* "||','||" */, ts+6652 /* ")" */)
+ var zList uintptr = rbuObjIterGetPkList(tls, p, pIter, ts+781 /* "" */, ts+15677 /* ", " */, ts+781 /* "" */)
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+72 /* &pMax */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls,
+ ts+32122, /* "SELECT %s FROM \"..." */
+ libc.VaList(bp+24, zSelect, zWrite, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder)))
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)))) {
+ var zVal uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)), 0)
+ zRet = rbuMPrintf(tls, p, ts+32164 /* " WHERE (%s) > (%..." */, libc.VaList(bp+56, zList, zVal))
+ }
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 72 /* pMax */)))
+ }
+
+ Xsqlite3_free(tls, zOrder)
+ Xsqlite3_free(tls, zSelect)
+ Xsqlite3_free(tls, zList)
+ }
+ return zRet
+}
+
+// This function is called as part of restating an RBU vacuum when the
+// current operation is writing content to an index. If possible, it
+// queries the target index b-tree for the largest key already written to
+// it, then composes and returns an expression that can be used in a WHERE
+// clause to select the remaining required rows from the source table.
+// It is only possible to return such an expression if:
+//
+// * The index contains no DESC columns, and
+// * The last key written to the index before the operation was
+// suspended does not contain any NULL values.
+//
+// The expression is of the form:
+//
+// (index-field1, index-field2, ...) > (?, ?, ...)
+//
+// except that the "?" placeholders are replaced with literal values.
+//
+// If the expression cannot be created, NULL is returned. In this case,
+// the caller has to use an OFFSET clause to extract only the required
+// rows from the sourct table, just as it does for an RBU update operation.
+func XrbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:197409:6: */
+ bp := tls.Alloc(192)
+ defer tls.Free(192)
+
+ var zOrder uintptr
+ var zLhs uintptr
+ var zSelect uintptr
+ var zVector uintptr
+ var zRet uintptr
+ var bFailed int32
+ var zSep uintptr
+ var iCol int32
+ // var pXInfo uintptr at bp+176, 8
+
+ var i int32
+ var iCid int32
+ var zCollate uintptr
+ var zCol uintptr
+ var zQuoted uintptr
+ // var pSel uintptr at bp+184, 8
+ zOrder = uintptr(0)
+ zLhs = uintptr(0)
+ zSelect = uintptr(0)
+ zVector = uintptr(0)
+ zRet = uintptr(0)
+ bFailed = 0
+ zSep = ts + 781 /* "" */
+ iCol = 0
+ *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)) = uintptr(0)
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+176 /* &pXInfo */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+31861 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx)))
+__1:
+ if !(((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */))))) {
+ goto __2
+ }
+ iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 1)
+ zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 4)
+ if !(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 3) != 0) {
+ goto __3
+ }
+ bFailed = 1
+ goto __2
+__3:
+ ;
+
+ if !(iCid < 0) {
+ goto __4
+ }
+ if !((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 2) {
+ goto __6
+ }
+ i = 0
+__8:
+ if !(int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0) {
+ goto __10
+ }
+ goto __9
+__9:
+ i++
+ goto __8
+ goto __10
+__10:
+ ;
+
+ zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
+ goto __7
+__6:
+ zCol = ts + 32184 /* "_rowid_" */
+__7:
+ ;
+ goto __5
+__4:
+ zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8))
+__5:
+ ;
+
+ zLhs = rbuMPrintf(tls, p, ts+32192, /* "%z%s \"%w\" COLLAT..." */
+ libc.VaList(bp+8, zLhs, zSep, zCol, zCollate))
+ zOrder = rbuMPrintf(tls, p, ts+32213, /* "%z%s \"rbu_imp_%d..." */
+ libc.VaList(bp+40, zOrder, zSep, iCol, zCol, zCollate))
+ zSelect = rbuMPrintf(tls, p, ts+32249, /* "%z%s quote(\"rbu_..." */
+ libc.VaList(bp+80, zSelect, zSep, iCol, zCol))
+ zSep = ts + 15677 /* ", " */
+ iCol++
+ goto __1
+__2:
+ ;
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)))
+ if !(bFailed != 0) {
+ goto __11
+ }
+ goto index_start_out
+__11:
+ ;
+
+ if !((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) {
+ goto __12
+ }
+ *(*uintptr)(unsafe.Pointer(bp + 184 /* pSel */)) = uintptr(0)
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+184 /* &pSel */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+32276, /* "SELECT %s FROM \"..." */
+ libc.VaList(bp+112, zSelect, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder)))
+ if !(((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 184 /* pSel */))))) {
+ goto __13
+ }
+ zSep = ts + 781 /* "" */
+ iCol = 0
+__14:
+ if !(iCol < (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol) {
+ goto __16
+ }
+ zQuoted = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 184 /* pSel */)), iCol)
+ if !(int32(*(*int8)(unsafe.Pointer(zQuoted + uintptr(0)))) == 'N') {
+ goto __17
+ }
+ bFailed = 1
+ goto __16
+__17:
+ ;
+ zVector = rbuMPrintf(tls, p, ts+32324 /* "%z%s%s" */, libc.VaList(bp+136, zVector, zSep, zQuoted))
+ zSep = ts + 15677 /* ", " */
+ goto __15
+__15:
+ iCol++
+ goto __14
+ goto __16
+__16:
+ ;
+
+ if !(!(bFailed != 0)) {
+ goto __18
+ }
+ zRet = rbuMPrintf(tls, p, ts+32331 /* "(%s) > (%s)" */, libc.VaList(bp+160, zLhs, zVector))
+__18:
+ ;
+__13:
+ ;
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 184 /* pSel */)))
+__12:
+ ;
+
+index_start_out:
+ Xsqlite3_free(tls, zOrder)
+ Xsqlite3_free(tls, zSelect)
+ Xsqlite3_free(tls, zVector)
+ Xsqlite3_free(tls, zLhs)
+ return zRet
+}
+
+// This function is used to create a SELECT list (the list of SQL
+// expressions that follows a SELECT keyword) for a SELECT statement
+// used to read from an data_xxx or rbu_tmp_xxx table while updating the
+// index object currently indicated by the iterator object passed as the
+// second argument. A "PRAGMA index_xinfo = <idxname>" statement is used
+// to obtain the required information.
+//
+// If the index is of the following form:
+//
+// CREATE INDEX i1 ON t1(c, b COLLATE nocase);
+//
+// and "t1" is a table with an explicit INTEGER PRIMARY KEY column
+// "ipk", the returned string is:
+//
+// "`c` COLLATE 'BINARY', `b` COLLATE 'NOCASE', `ipk` COLLATE 'BINARY'"
+//
+// As well as the returned string, three other malloc'd strings are
+// returned via output parameters. As follows:
+//
+// pzImposterCols: ...
+// pzImposterPk: ...
+// pzWhere: ...
+func rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposterCols uintptr, pzImposterPk uintptr, pzWhere uintptr, pnBind uintptr) uintptr { /* sqlite3.c:197522:13: */
+ bp := tls.Alloc(208)
+ defer tls.Free(208)
+
+ var rc int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc // Error code
+ var rc2 int32 // sqlite3_finalize() return code
+ var zRet uintptr = uintptr(0) // String to return
+ var zImpCols uintptr = uintptr(0) // String to return via *pzImposterCols
+ var zImpPK uintptr = uintptr(0) // String to return via *pzImposterPK
+ var zWhere uintptr = uintptr(0) // String to return via *pzWhere
+ var nBind int32 = 0 // Value to return via *pnBind
+ var zCom uintptr = ts + 781 /* "" */ // Set to ", " later on
+ var zAnd uintptr = ts + 781 /* "" */ // Set to " AND " later on
+ *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)) = uintptr(0) // PRAGMA index_xinfo = ?
+
+ if rc == 0 {
+
+ rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+200 /* &pXInfo */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+31861 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx)))
+ }
+
+ for (rc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)))) {
+ var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 1)
+ var bDesc int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 3)
+ var zCollate uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 4)
+ var zCol uintptr = uintptr(0)
+ var zType uintptr
+
+ if iCid == -2 {
+ var iSeq int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 0)
+ zRet = Xsqlite3_mprintf(tls, ts+32343 /* "%z%s(%.*s) COLLA..." */, libc.VaList(bp+8, zRet, zCom,
+ (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iSeq)*16)).FnSpan, (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iSeq)*16)).FzSpan, zCollate))
+ zType = ts + 781 /* "" */
+ } else {
+ if iCid < 0 {
+ // An integer primary key. If the table has an explicit IPK, use
+ // its name. Otherwise, use "rbu_rowid".
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 2 {
+ var i int32
+ for i = 0; int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0; i++ {
+ }
+
+ zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
+ } else if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ zCol = ts + 32184 /* "_rowid_" */
+ } else {
+ zCol = ts + 31914 /* "rbu_rowid" */
+ }
+ zType = ts + 13743 /* "INTEGER" */
+ } else {
+ zCol = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8))
+ zType = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8))
+ }
+ zRet = Xsqlite3_mprintf(tls, ts+32365 /* "%z%s\"%w\" COLLATE..." */, libc.VaList(bp+48, zRet, zCom, zCol, zCollate))
+ }
+
+ if ((*RbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0) || (Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)), 5) != 0) {
+ var zOrder uintptr = func() uintptr {
+ if bDesc != 0 {
+ return ts + 32101 /* " DESC" */
+ }
+ return ts + 781 /* "" */
+ }()
+ zImpPK = Xsqlite3_mprintf(tls, ts+32385, /* "%z%s\"rbu_imp_%d%..." */
+ libc.VaList(bp+80, zImpPK, zCom, nBind, zCol, zOrder))
+ }
+ zImpCols = Xsqlite3_mprintf(tls, ts+32406, /* "%z%s\"rbu_imp_%d%..." */
+ libc.VaList(bp+120, zImpCols, zCom, nBind, zCol, zType, zCollate))
+ zWhere = Xsqlite3_mprintf(tls,
+ ts+32439 /* "%z%s\"rbu_imp_%d%..." */, libc.VaList(bp+168, zWhere, zAnd, nBind, zCol))
+ if (((zRet == uintptr(0)) || (zImpPK == uintptr(0))) || (zImpCols == uintptr(0))) || (zWhere == uintptr(0)) {
+ rc = 7
+ }
+ zCom = ts + 15677 /* ", " */
+ zAnd = ts + 23031 /* " AND " */
+ nBind++
+ }
+
+ rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 200 /* pXInfo */)))
+ if rc == 0 {
+ rc = rc2
+ }
+
+ if rc != 0 {
+ Xsqlite3_free(tls, zRet)
+ Xsqlite3_free(tls, zImpCols)
+ Xsqlite3_free(tls, zImpPK)
+ Xsqlite3_free(tls, zWhere)
+ zRet = uintptr(0)
+ zImpCols = uintptr(0)
+ zImpPK = uintptr(0)
+ zWhere = uintptr(0)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
+ }
+
+ *(*uintptr)(unsafe.Pointer(pzImposterCols)) = zImpCols
+ *(*uintptr)(unsafe.Pointer(pzImposterPk)) = zImpPK
+ *(*uintptr)(unsafe.Pointer(pzWhere)) = zWhere
+ *(*int32)(unsafe.Pointer(pnBind)) = nBind
+ return zRet
+}
+
+// Assuming the current table columns are "a", "b" and "c", and the zObj
+// paramter is passed "old", return a string of the form:
+//
+// "old.a, old.b, old.b"
+//
+// With the column names escaped.
+//
+// For tables with implicit rowids - RBU_PK_EXTERNAL and RBU_PK_NONE, append
+// the text ", old._rowid_" to the returned value.
+func rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr) uintptr { /* sqlite3.c:197634:13: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ var zList uintptr = uintptr(0)
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0) {
+ var zS uintptr = ts + 781 /* "" */
+ var i int32
+ for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
+ if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 {
+ var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
+ zList = Xsqlite3_mprintf(tls, ts+32463 /* "%z%s%s.\"%w\"" */, libc.VaList(bp, zList, zS, zObj, zCol))
+ } else {
+ zList = Xsqlite3_mprintf(tls, ts+32475 /* "%z%sNULL" */, libc.VaList(bp+32, zList, zS))
+ }
+ zS = ts + 15677 /* ", " */
+ if zList == uintptr(0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 7
+ break
+ }
+ }
+
+ // For a table with implicit rowids, append "old._rowid_" to the list.
+ if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 3) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 1) {
+ zList = rbuMPrintf(tls, p, ts+32484 /* "%z, %s._rowid_" */, libc.VaList(bp+48, zList, zObj))
+ }
+ }
+ return zList
+}
+
+// Return an expression that can be used in a WHERE clause to match the
+// primary key of the current table. For example, if the table is:
+//
+// CREATE TABLE t1(a, b, c, PRIMARY KEY(b, c));
+//
+// Return the string:
+//
+// "b = ?1 AND c = ?2"
+func rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:197675:13: */
+ bp := tls.Alloc(80)
+ defer tls.Free(80)
+
+ var zList uintptr = uintptr(0)
+ if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 5) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 1) {
+ zList = rbuMPrintf(tls, p, ts+32499 /* "_rowid_ = ?%d" */, libc.VaList(bp, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+1)))
+ } else if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 3 {
+ var zSep uintptr = ts + 781 /* "" */
+ var i int32
+ for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
+ if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 {
+ zList = rbuMPrintf(tls, p, ts+32513 /* "%z%sc%d=?%d" */, libc.VaList(bp+8, zList, zSep, i, (i+1)))
+ zSep = ts + 23031 /* " AND " */
+ }
+ }
+ zList = rbuMPrintf(tls, p,
+ ts+32525 /* "_rowid_ = (SELEC..." */, libc.VaList(bp+40, zList))
+ } else {
+ var zSep uintptr = ts + 781 /* "" */
+ var i int32
+ for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
+ if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 {
+ var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8))
+ zList = rbuMPrintf(tls, p, ts+32575 /* "%z%s\"%w\"=?%d" */, libc.VaList(bp+48, zList, zSep, zCol, (i+1)))
+ zSep = ts + 23031 /* " AND " */
+ }
+ }
+ }
+ return zList
+}
+
+// The SELECT statement iterating through the keys for the current object
+// (p->objiter.pSelect) currently points to a valid row. However, there
+// is something wrong with the rbu_control value in the rbu_control value
+// stored in the (p->nCol+1)'th column. Set the error code and error message
+// of the RBU handle to something reflecting this.
+func rbuBadControlError(tls *libc.TLS, p uintptr) { /* sqlite3.c:197716:13: */
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 1
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+32588 /* "invalid rbu_cont..." */, 0)
+}
+
+// Return a nul-terminated string containing the comma separated list of
+// assignments that should be included following the "SET" keyword of
+// an UPDATE statement used to update the table object that the iterator
+// passed as the second argument currently points to if the rbu_control
+// column of the data_xxx table entry is set to zMask.
+//
+// The memory for the returned string is obtained from sqlite3_malloc().
+// It is the responsibility of the caller to eventually free it using
+// sqlite3_free().
+//
+// If an OOM error is encountered when allocating space for the new
+// string, an error code is left in the rbu handle passed as the first
+// argument and NULL is returned. Or, if an error has already occurred
+// when this function is called, NULL is returned immediately, without
+// attempting the allocation or modifying the stored error code.
+func rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr) uintptr { /* sqlite3.c:197739:13: */
+ bp := tls.Alloc(112)
+ defer tls.Free(112)
+
+ var zList uintptr = uintptr(0)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ var i int32
+
+ if int32(libc.Xstrlen(tls, zMask)) != (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol {
+ rbuBadControlError(tls, p)
+ } else {
+ var zSep uintptr = ts + 781 /* "" */
+ for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol; i++ {
+ var c int8 = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4)))))
+ if int32(c) == 'x' {
+ zList = rbuMPrintf(tls, p, ts+32575, /* "%z%s\"%w\"=?%d" */
+ libc.VaList(bp, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), (i+1)))
+ zSep = ts + 15677 /* ", " */
+ } else if int32(c) == 'd' {
+ zList = rbuMPrintf(tls, p, ts+32614, /* "%z%s\"%w\"=rbu_del..." */
+ libc.VaList(bp+32, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), (i+1)))
+ zSep = ts + 15677 /* ", " */
+ } else if int32(c) == 'f' {
+ zList = rbuMPrintf(tls, p, ts+32644, /* "%z%s\"%w\"=rbu_fos..." */
+ libc.VaList(bp+72, zList, zSep, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), (i+1)))
+ zSep = ts + 15677 /* ", " */
+ }
+ }
+ }
+ }
+ return zList
+}
+
+// Return a nul-terminated string consisting of nByte comma separated
+// "?" expressions. For example, if nByte is 3, return a pointer to
+// a buffer containing the string "?,?,?".
+//
+// The memory for the returned string is obtained from sqlite3_malloc().
+// It is the responsibility of the caller to eventually free it using
+// sqlite3_free().
+//
+// If an OOM error is encountered when allocating space for the new
+// string, an error code is left in the rbu handle passed as the first
+// argument and NULL is returned. Or, if an error has already occurred
+// when this function is called, NULL is returned immediately, without
+// attempting the allocation or modifying the stored error code.
+func rbuObjIterGetBindlist(tls *libc.TLS, p uintptr, nBind int32) uintptr { /* sqlite3.c:197793:13: */
+ var zRet uintptr = uintptr(0)
+ var nByte Sqlite3_int64 = ((int64(2) * Sqlite3_int64(nBind)) + int64(1))
+
+ zRet = rbuMalloc(tls, p, nByte)
+ if zRet != 0 {
+ var i int32
+ for i = 0; i < nBind; i++ {
+ *(*int8)(unsafe.Pointer(zRet + uintptr((i * 2)))) = int8('?')
+ *(*int8)(unsafe.Pointer(zRet + uintptr(((i * 2) + 1)))) = func() int8 {
+ if (i + 1) == nBind {
+ return int8(0)
+ }
+ return int8(',')
+ }()
+ }
+ }
+ return zRet
+}
+
+// The iterator currently points to a table (not index) of type
+// RBU_PK_WITHOUT_ROWID. This function creates the PRIMARY KEY
+// declaration for the corresponding imposter table. For example,
+// if the iterator points to a table created as:
+//
+// CREATE TABLE t1(a, b, c, PRIMARY KEY(b, a DESC)) WITHOUT ROWID
+//
+// this function returns:
+//
+// PRIMARY KEY("b", "a" DESC)
+func rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:197820:13: */
+ bp := tls.Alloc(72)
+ defer tls.Free(72)
+
+ var z uintptr = uintptr(0)
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ var zSep uintptr = ts + 32681 /* "PRIMARY KEY(" */
+ *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)) = uintptr(0) // PRAGMA index_list = (pIter->zTbl)
+ *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */)) = uintptr(0) // PRAGMA index_xinfo = <pk-index>
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+56 /* &pXList */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+31833 /* "PRAGMA main.inde..." */, libc.VaList(bp, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl)))
+ for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)))) {
+ var zOrig uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)), 3)
+ if (zOrig != 0) && (libc.Xstrcmp(tls, zOrig, ts+17182 /* "pk" */) == 0) {
+ var zIdx uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)), 1)
+ if zIdx != 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+64 /* &pXInfo */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+31861 /* "PRAGMA main.inde..." */, libc.VaList(bp+8, zIdx)))
+ }
+ break
+ }
+ }
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 56 /* pXList */)))
+
+ for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */)))) {
+ if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */)), 5) != 0 {
+ // int iCid = sqlite3_column_int(pXInfo, 0);
+ var zCol uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */)), 2)
+ var zDesc uintptr
+ if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */)), 3) != 0 {
+ zDesc = ts + 32101 /* " DESC" */
+ } else {
+ zDesc = ts + 781 /* "" */
+ }
+ z = rbuMPrintf(tls, p, ts+32694 /* "%z%s\"%w\"%s" */, libc.VaList(bp+16, z, zSep, zCol, zDesc))
+ zSep = ts + 15677 /* ", " */
+ }
+ }
+ z = rbuMPrintf(tls, p, ts+32705 /* "%z)" */, libc.VaList(bp+48, z))
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 64 /* pXInfo */)))
+ }
+ return z
+}
+
+// This function creates the second imposter table used when writing to
+// a table b-tree where the table has an external primary key. If the
+// iterator passed as the second argument does not currently point to
+// a table (not index) with an external primary key, this function is a
+// no-op.
+//
+// Assuming the iterator does point to a table with an external PK, this
+// function creates a WITHOUT ROWID imposter table named "rbu_imposter2"
+// used to access that PK index. For example, if the target table is
+// declared as follows:
+//
+// CREATE TABLE t1(a, b TEXT, c REAL, PRIMARY KEY(b, c));
+//
+// then the imposter table schema is:
+//
+// CREATE TABLE rbu_imposter2(c1 TEXT, c2 REAL, id INTEGER) WITHOUT ROWID;
+//
+func rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:197879:13: */
+ bp := tls.Alloc(184)
+ defer tls.Free(184)
+
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 3) {
+ var tnum int32 = (*RbuObjIter)(unsafe.Pointer(pIter)).FiPkTnum // Root page of PK index
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */)) = uintptr(0) // SELECT name ... WHERE rootpage = $tnum
+ var zIdx uintptr = uintptr(0) // Name of PK index
+ *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)) = uintptr(0) // PRAGMA main.index_xinfo = $zIdx
+ var zComma uintptr = ts + 781 /* "" */
+ var zCols uintptr = uintptr(0) // Used to build up list of table cols
+ var zPk uintptr = uintptr(0) // Used to build up table PK declaration
+
+ // Figure out the name of the primary key index for the current table.
+ // This is needed for the argument to "PRAGMA index_xinfo". Set
+ // zIdx to point to a nul-terminated string containing this name.
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+168 /* &pQuery */, (p + 64 /* &.zErrmsg */),
+ ts+32709 /* "SELECT name FROM..." */)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */)), 1, tnum)
+ if 100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */))) {
+ zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */)), 0)
+ }
+ }
+ if zIdx != 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+176 /* &pXInfo */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+31861 /* "PRAGMA main.inde..." */, libc.VaList(bp, zIdx)))
+ }
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 168 /* pQuery */)))
+
+ for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)))) {
+ var bKey int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 5)
+ if bKey != 0 {
+ var iCid int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 1)
+ var bDesc int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 3)
+ var zCollate uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)), 4)
+ zCols = rbuMPrintf(tls, p, ts+32759 /* "%z%sc%d %s COLLA..." */, libc.VaList(bp+8, zCols, zComma,
+ iCid, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate))
+ zPk = rbuMPrintf(tls, p, ts+32781 /* "%z%sc%d%s" */, libc.VaList(bp+48, zPk, zComma, iCid, func() uintptr {
+ if bDesc != 0 {
+ return ts + 32101 /* " DESC" */
+ }
+ return ts + 781 /* "" */
+ }()))
+ zComma = ts + 15677 /* ", " */
+ }
+ }
+ zCols = rbuMPrintf(tls, p, ts+32791 /* "%z, id INTEGER" */, libc.VaList(bp+80, zCols))
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 176 /* pXInfo */)))
+
+ Xsqlite3_test_control(tls, 25, libc.VaList(bp+88, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8314 /* "main" */, 1, tnum))
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
+ ts+32806, /* "CREATE TABLE rbu..." */
+ libc.VaList(bp+120, zCols, zPk))
+ Xsqlite3_test_control(tls, 25, libc.VaList(bp+136, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8314 /* "main" */, 0, 0))
+ }
+}
+
+// If an error has already occurred when this function is called, it
+// immediately returns zero (without doing any work). Or, if an error
+// occurs during the execution of this function, it sets the error code
+// in the sqlite3rbu object indicated by the first argument and returns
+// zero.
+//
+// The iterator passed as the second argument is guaranteed to point to
+// a table (not an index) when this function is called. This function
+// attempts to create any imposter table required to write to the main
+// table b-tree of the table before returning. Non-zero is returned if
+// an imposter table are created, or zero otherwise.
+//
+// An imposter table is required in all cases except RBU_PK_VTAB. Only
+// virtual tables are written to directly. The imposter table has the
+// same schema as the actual target table (less any UNIQUE constraints).
+// More precisely, the "same schema" means the same columns, types,
+// collation sequences. For tables that do not have an external PRIMARY
+// KEY, it also means the same PRIMARY KEY declaration.
+func rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:197953:13: */
+ bp := tls.Alloc(200)
+ defer tls.Free(200)
+
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType != 5) {
+ var tnum int32 = (*RbuObjIter)(unsafe.Pointer(pIter)).FiTnum
+ var zComma uintptr = ts + 781 /* "" */
+ var zSql uintptr = uintptr(0)
+ var iCol int32
+ Xsqlite3_test_control(tls, 25, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8314 /* "main" */, 0, 1))
+
+ for iCol = 0; ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (iCol < (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol); iCol++ {
+ var zPk uintptr = ts + 781 /* "" */
+ var zCol uintptr = *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8))
+ *(*uintptr)(unsafe.Pointer(bp + 192 /* zColl */)) = uintptr(0)
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls,
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8314 /* "main" */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp+192 /* &zColl */, uintptr(0), uintptr(0), uintptr(0))
+
+ if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 2) && (*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0) {
+ // If the target table column is an "INTEGER PRIMARY KEY", add
+ // "PRIMARY KEY" to the imposter table column declaration.
+ zPk = ts + 32868 /* "PRIMARY KEY " */
+ }
+ zSql = rbuMPrintf(tls, p, ts+32881, /* "%z%s\"%w\" %s %sCO..." */
+ libc.VaList(bp+32, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp + 192 /* zColl */)),
+ func() uintptr {
+ if *(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 {
+ return ts + 32908 /* " NOT NULL" */
+ }
+ return ts + 781 /* "" */
+ }()))
+ zComma = ts + 15677 /* ", " */
+ }
+
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 4 {
+ var zPk uintptr = rbuWithoutRowidPK(tls, p, pIter)
+ if zPk != 0 {
+ zSql = rbuMPrintf(tls, p, ts+32918 /* "%z, %z" */, libc.VaList(bp+88, zSql, zPk))
+ }
+ }
+
+ Xsqlite3_test_control(tls, 25, libc.VaList(bp+104, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8314 /* "main" */, 1, tnum))
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+32925, /* "CREATE TABLE \"rb..." */
+ libc.VaList(bp+136, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql,
+ func() uintptr {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 4 {
+ return ts + 32957 /* " WITHOUT ROWID" */
+ }
+ return ts + 781 /* "" */
+ }()))
+ Xsqlite3_test_control(tls, 25, libc.VaList(bp+160, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8314 /* "main" */, 0, 0))
+ }
+}
+
+// Prepare a statement used to insert rows into the "rbu_tmp_xxx" table.
+// Specifically a statement of the form:
+//
+// INSERT INTO rbu_tmp_xxx VALUES(?, ?, ? ...);
+//
+// The number of bound variables is equal to the number of columns in
+// the target table, plus one (for the rbu_control column), plus one more
+// (for the rbu_rowid column) if the target table is an implicit IPK or
+// virtual table.
+func rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zCollist uintptr, zRbuRowid uintptr) { /* sqlite3.c:198009:13: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
+
+ var bRbuRowid int32 = (libc.Bool32(((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 3) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 1)))
+ var zBind uintptr = rbuObjIterGetBindlist(tls, p, (((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol + 1) + bRbuRowid))
+ if zBind != 0 {
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls,
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter + 152 /* &.pTmpInsert */), (p + 64 /* &.zErrmsg */), Xsqlite3_mprintf(tls,
+ ts+32972, /* "INSERT INTO %s.'..." */
+ libc.VaList(bp, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind)))
+ }
+}
+
+func rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:198027:13: */
+ var p uintptr = Xsqlite3_user_data(tls, pCtx)
+ var rc int32 = 0
+ var i int32
+
+ if Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8))) != 0 {
+ *(*I64)(unsafe.Pointer(p + 304 /* &.nPhaseOneStep */)) += (I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex))
+ }
+
+ for i = 0; (rc == 0) && (i < nVal); i++ {
+ rc = Xsqlite3_bind_value(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpTmpInsert, (i + 1), *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)))
+ }
+ if rc == 0 {
+ Xsqlite3_step(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpTmpInsert)
+ rc = Xsqlite3_reset(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpTmpInsert)
+ }
+
+ if rc != 0 {
+ Xsqlite3_result_error_code(tls, pCtx, rc)
+ }
+}
+
+func rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) uintptr { /* sqlite3.c:198057:13: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ *(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
+ var zRet uintptr = uintptr(0)
+
+ if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp /* &pStmt */, (p + 64 /* &.zErrmsg */),
+ ts+33029 /* "SELECT trim(sql)..." */)
+ }
+ if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0 {
+ var rc2 int32
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 1, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -1, uintptr(0))
+ if (*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))) {
+ var zSql uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 0)
+ if zSql != 0 {
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdxSql = libc.AssignUintptr(&zSql, rbuStrndup(tls, zSql, bp+8 /* &rc */))
+ }
+ if zSql != 0 {
+ var nParen int32 = 0 // Number of open parenthesis
+ var i int32
+ var iIdxCol int32 = 0
+ var nIdxAlloc int32 = 0
+ for i = 0; *(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0; i++ {
+ var c int8 = *(*int8)(unsafe.Pointer(zSql + uintptr(i)))
+
+ // If necessary, grow the pIter->aIdxCol[] array
+ if iIdxCol == nIdxAlloc {
+ var aIdxCol uintptr = Xsqlite3_realloc(tls,
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol, (int32((uint64(nIdxAlloc + 16)) * uint64(unsafe.Sizeof(RbuSpan{})))))
+ if aIdxCol == uintptr(0) {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = 7
+ break
+ }
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol = aIdxCol
+ nIdxAlloc = nIdxAlloc + (16)
+ }
+
+ if int32(c) == '(' {
+ if nParen == 0 {
+
+ (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(0)*16)).FzSpan = (zSql + uintptr((i + 1)))
+ }
+ nParen++
+ } else if int32(c) == ')' {
+ nParen--
+ if nParen == 0 {
+ var nSpan int32 = (int32((int64((zSql + uintptr(i))) - int64((*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iIdxCol)*16)).FzSpan)) / 1))
+ (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(libc.PostIncInt32(&iIdxCol, 1))*16)).FnSpan = nSpan
+ i++
+ break
+ }
+ } else if (int32(c) == ',') && (nParen == 1) {
+ var nSpan int32 = (int32((int64((zSql + uintptr(i))) - int64((*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol+uintptr(iIdxCol)*16)).FzSpan)) / 1))
+ (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(libc.PostIncInt32(&iIdxCol, 1))*16)).FnSpan = nSpan
+ (*RbuSpan)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iIdxCol)*16)).FzSpan = (zSql + uintptr((i + 1)))
+ } else if ((int32(c) == '"') || (int32(c) == '\'')) || (int32(c) == '`') {
+ for i++; 1 != 0; i++ {
+ if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) == int32(c) {
+ if int32(*(*int8)(unsafe.Pointer(zSql + uintptr((i + 1))))) != int32(c) {
+ break
+ }
+ i++
+ }
+ }
+ } else if int32(c) == '[' {
+ for i++; 1 != 0; i++ {
+ if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) == ']' {
+ break
+ }
+ }
+ } else if (int32(c) == '-') && (int32(*(*int8)(unsafe.Pointer(zSql + uintptr((i + 1))))) == '-') {
+ for i = (i + 2); (*(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0) && (int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) != '\n'); i++ {
+ }
+ if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) == 0 {
+ break
+ }
+ } else if (int32(c) == '/') && (int32(*(*int8)(unsafe.Pointer(zSql + uintptr((i + 1))))) == '*') {
+ for i = (i + 2); (*(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0) && ((int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) != '*') || (int32(*(*int8)(unsafe.Pointer(zSql + uintptr((i + 1))))) != '/')); i++ {
+ }
+ if int32(*(*int8)(unsafe.Pointer(zSql + uintptr(i)))) == 0 {
+ break
+ }
+ i++
+ }
+ }
+ if *(*int8)(unsafe.Pointer(zSql + uintptr(i))) != 0 {
+ zRet = rbuStrndup(tls, (zSql + uintptr(i)), bp+8 /* &rc */)
+ }
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FnIdxCol = iIdxCol
+ }
+ }
+
+ rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
+ if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = rc2
+ }
+ }
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
+ return zRet
+}
+
+// Ensure that the SQLite statement handles required to update the
+// target database object currently indicated by the iterator passed
+// as the second argument are available.
+func rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int32) int32 { /* sqlite3.c:198157:12: */
+ bp := tls.Alloc(628)
+ defer tls.Free(628)
+
+ if ((*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect == uintptr(0)) && (rbuObjIterCacheTableInfo(tls, p, pIter) == 0) {
+ var tnum int32 = (*RbuObjIter)(unsafe.Pointer(pIter)).FiTnum
+ var zCollist uintptr = uintptr(0) // List of indexed columns
+ var pz uintptr = (p + 64 /* &.zErrmsg */)
+ var zIdx uintptr = (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx
+ var zLimit uintptr = uintptr(0)
+
+ if nOffset != 0 {
+ zLimit = Xsqlite3_mprintf(tls, ts+33095 /* " LIMIT -1 OFFSET..." */, libc.VaList(bp, nOffset))
+ if !(zLimit != 0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 7
+ }
+ }
+
+ if zIdx != 0 {
+ var zTbl uintptr = (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl
+ *(*uintptr)(unsafe.Pointer(bp + 600 /* zImposterCols */)) = uintptr(0) // Columns for imposter table
+ *(*uintptr)(unsafe.Pointer(bp + 608 /* zImposterPK */)) = uintptr(0) // Primary key declaration for imposter
+ *(*uintptr)(unsafe.Pointer(bp + 616 /* zWhere */)) = uintptr(0) // WHERE clause on PK columns
+ var zBind uintptr = uintptr(0)
+ var zPart uintptr = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 624 /* nBind */)) = 0
+
+ zPart = rbuObjIterGetIndexWhere(tls, p, pIter)
+ zCollist = rbuObjIterGetIndexCols(tls,
+ p, pIter, bp+600 /* &zImposterCols */, bp+608 /* &zImposterPK */, bp+616 /* &zWhere */, bp+624 /* &nBind */)
+ zBind = rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 624 /* nBind */)))
+
+ // Create the imposter table used to write to this index.
+ Xsqlite3_test_control(tls, 25, libc.VaList(bp+8, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8314 /* "main" */, 0, 1))
+ Xsqlite3_test_control(tls, 25, libc.VaList(bp+40, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8314 /* "main" */, 1, tnum))
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
+ ts+33115, /* "CREATE TABLE \"rb..." */
+ libc.VaList(bp+72, zTbl, *(*uintptr)(unsafe.Pointer(bp + 600 /* zImposterCols */)), *(*uintptr)(unsafe.Pointer(bp + 608 /* zImposterPK */))))
+ Xsqlite3_test_control(tls, 25, libc.VaList(bp+96, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8314 /* "main" */, 0, 0))
+
+ // Create the statement to insert index entries
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 624 /* nBind */))
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls,
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 136 /* &.pInsert */), (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+33180 /* "INSERT INTO \"rbu..." */, libc.VaList(bp+128, zTbl, zBind)))
+ }
+
+ // And to delete index entries
+ if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls,
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 144 /* &.pDelete */), (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+33216 /* "DELETE FROM \"rbu..." */, libc.VaList(bp+144, zTbl, *(*uintptr)(unsafe.Pointer(bp + 616 /* zWhere */)))))
+ }
+
+ // Create the SELECT statement to read keys in sorted order
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ var zSql uintptr
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ var zStart uintptr = uintptr(0)
+ if nOffset != 0 {
+ zStart = XrbuVacuumIndexStart(tls, p, pIter)
+ if zStart != 0 {
+ Xsqlite3_free(tls, zLimit)
+ zLimit = uintptr(0)
+ }
+ }
+
+ zSql = Xsqlite3_mprintf(tls,
+ ts+33250, /* "SELECT %s, 0 AS ..." */
+ libc.VaList(bp+160, zCollist,
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
+ zPart,
+ func() uintptr {
+ if zStart != 0 {
+ return func() uintptr {
+ if zPart != 0 {
+ return ts + 33311 /* "AND" */
+ }
+ return ts + 33315 /* "WHERE" */
+ }()
+ }
+ return ts + 781 /* "" */
+ }(), zStart,
+ zCollist, zLimit))
+ Xsqlite3_free(tls, zStart)
+ } else if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 3) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 1) {
+ zSql = Xsqlite3_mprintf(tls,
+ ts+33321, /* "SELECT %s, rbu_c..." */
+ libc.VaList(bp+216, zCollist, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
+ zPart, zCollist, zLimit))
+ } else {
+ zSql = Xsqlite3_mprintf(tls,
+
+ ts+33382, /* "SELECT %s, rbu_c..." */
+ libc.VaList(bp+264, zCollist, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart,
+ zCollist, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl,
+ zPart,
+ func() uintptr {
+ if zPart != 0 {
+ return ts + 33311 /* "AND" */
+ }
+ return ts + 33315 /* "WHERE" */
+ }(),
+ zCollist, zLimit))
+ }
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter + 128 /* &.pSelect */), pz, zSql)
+ } else {
+ Xsqlite3_free(tls, zSql)
+ }
+ }
+
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 600 /* zImposterCols */)))
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 608 /* zImposterPK */)))
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 616 /* zWhere */)))
+ Xsqlite3_free(tls, zBind)
+ Xsqlite3_free(tls, zPart)
+ } else {
+ var bRbuRowid int32 = (libc.Bool32((((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 5) ||
+ ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 1)) ||
+ (((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 3) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)))))
+ var zTbl uintptr = (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl // Table this step applies to
+ var zWrite uintptr // Imposter table name
+
+ var zBindings uintptr = rbuObjIterGetBindlist(tls, p, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol + bRbuRowid))
+ var zWhere uintptr = rbuObjIterGetWhere(tls, p, pIter)
+ var zOldlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+8323 /* "old" */)
+ var zNewlist uintptr = rbuObjIterGetOldlist(tls, p, pIter, ts+8319 /* "new" */)
+
+ zCollist = rbuObjIterGetCollist(tls, p, pIter)
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol
+
+ // Create the imposter table or tables (if required).
+ rbuCreateImposterTable(tls, p, pIter)
+ rbuCreateImposterTable2(tls, p, pIter)
+ zWrite = func() uintptr {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 5 {
+ return ts + 781 /* "" */
+ }
+ return ts + 33541 /* "rbu_imp_" */
+ }()
+
+ // Create the INSERT statement to write to the target PK b-tree
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 136 /* &.pInsert */), pz,
+ Xsqlite3_mprintf(tls,
+ ts+33550, /* "INSERT INTO \"%s%..." */
+ libc.VaList(bp+344, zWrite, zTbl, zCollist, func() uintptr {
+ if bRbuRowid != 0 {
+ return ts + 33586 /* ", _rowid_" */
+ }
+ return ts + 781 /* "" */
+ }(), zBindings)))
+ }
+
+ // Create the DELETE statement to write to the target PK b-tree.
+ // Because it only performs INSERT operations, this is not required for
+ // an rbu vacuum handle.
+ if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pIter + 144 /* &.pDelete */), pz,
+ Xsqlite3_mprintf(tls,
+ ts+33596 /* "DELETE FROM \"%s%..." */, libc.VaList(bp+384, zWrite, zTbl, zWhere)))
+ }
+
+ if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0) {
+ var zRbuRowid uintptr = ts + 781 /* "" */
+ if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 3) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 1) {
+ zRbuRowid = ts + 33624 /* ", rbu_rowid" */
+ }
+
+ // Create the rbu_tmp_xxx table and the triggers to populate it.
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu,
+
+ ts+33636 /* "CREATE TABLE IF ..." */, libc.VaList(bp+408, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 3 {
+ return ts + 33712 /* ", 0 AS rbu_rowid" */
+ }
+ return ts + 781 /* "" */
+ }(), (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))
+
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
+
+ ts+33729, /* "CREATE TEMP TRIG..." */
+ libc.VaList(bp+440, zWrite, zTbl, zOldlist,
+ zWrite, zTbl, zOldlist,
+ zWrite, zTbl, zNewlist))
+
+ if ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 3) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 1) {
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
+
+ ts+34028, /* "CREATE TEMP TRIG..." */
+ libc.VaList(bp+512, zWrite, zTbl, zNewlist))
+ }
+
+ rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid)
+ }
+
+ // Create the SELECT statement to read keys from data_xxx
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ var zRbuRowid uintptr = ts + 781 /* "" */
+ var zStart uintptr = uintptr(0)
+ var zOrder uintptr = uintptr(0)
+ if bRbuRowid != 0 {
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ zRbuRowid = ts + 34127 /* ",_rowid_ " */
+ } else {
+ zRbuRowid = ts + 34137 /* ",rbu_rowid" */
+ }
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ if nOffset != 0 {
+ zStart = rbuVacuumTableStart(tls, p, pIter, bRbuRowid, zWrite)
+ if zStart != 0 {
+ Xsqlite3_free(tls, zLimit)
+ zLimit = uintptr(0)
+ }
+ }
+ if bRbuRowid != 0 {
+ zOrder = rbuMPrintf(tls, p, ts+32184 /* "_rowid_" */, 0)
+ } else {
+ zOrder = rbuObjIterGetPkList(tls, p, pIter, ts+781 /* "" */, ts+15677 /* ", " */, ts+781 /* "" */)
+ }
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, (pIter + 128 /* &.pSelect */), pz,
+ Xsqlite3_mprintf(tls,
+ ts+34148, /* "SELECT %s,%s rbu..." */
+ libc.VaList(bp+536, zCollist,
+ func() uintptr {
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ return ts + 34196 /* "0 AS " */
+ }
+ return ts + 781 /* "" */
+ }(),
+ zRbuRowid,
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, func() uintptr {
+ if zStart != 0 {
+ return zStart
+ }
+ return ts + 781 /* "" */
+ }(),
+ func() uintptr {
+ if zOrder != 0 {
+ return ts + 19937 /* "ORDER BY" */
+ }
+ return ts + 781 /* "" */
+ }(), zOrder,
+ zLimit)))
+ }
+ Xsqlite3_free(tls, zStart)
+ Xsqlite3_free(tls, zOrder)
+ }
+
+ Xsqlite3_free(tls, zWhere)
+ Xsqlite3_free(tls, zOldlist)
+ Xsqlite3_free(tls, zNewlist)
+ Xsqlite3_free(tls, zBindings)
+ }
+ Xsqlite3_free(tls, zCollist)
+ Xsqlite3_free(tls, zLimit)
+ }
+
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
+}
+
+// Set output variable *ppStmt to point to an UPDATE statement that may
+// be used to update the imposter table for the main table b-tree of the
+// table object that pIter currently points to, assuming that the
+// rbu_control column of the data_xyz table contains zMask.
+//
+// If the zMask string does not specify any columns to update, then this
+// is not an error. Output variable *ppStmt is set to NULL in this case.
+func rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, ppStmt uintptr) int32 { /* sqlite3.c:198424:12: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ var pp uintptr
+ var pUp uintptr = uintptr(0)
+ var nUp int32 = 0
+
+ // In case an error occurs
+ *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0)
+
+ // Search for an existing statement. If one is found, shift it to the front
+ // of the LRU queue and return immediately. Otherwise, leave nUp pointing
+ // to the number of statements currently in the cache and pUp to the
+ // last object in the list.
+ for pp = (pIter + 184 /* &.pRbuUpdate */); *(*uintptr)(unsafe.Pointer(pp)) != 0; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 16 /* &.pNext */) {
+ pUp = *(*uintptr)(unsafe.Pointer(pp))
+ if libc.Xstrcmp(tls, (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask, zMask) == 0 {
+ *(*uintptr)(unsafe.Pointer(pp)) = (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext
+ (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp
+ *(*uintptr)(unsafe.Pointer(ppStmt)) = (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate
+ return 0
+ }
+ nUp++
+ }
+
+ if nUp >= 16 {
+ for pp = (pIter + 184 /* &.pRbuUpdate */); *(*uintptr)(unsafe.Pointer(pp)) != pUp; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 16 /* &.pNext */) {
+ }
+ *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
+ Xsqlite3_finalize(tls, (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate)
+ (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate = uintptr(0)
+ } else {
+ pUp = rbuMalloc(tls, p, (int64((uint64(unsafe.Sizeof(RbuUpdateStmt{})) + uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) + uint64(1))))
+ }
+
+ if pUp != 0 {
+ var zWhere uintptr = rbuObjIterGetWhere(tls, p, pIter)
+ var zSet uintptr = rbuObjIterGetSetlist(tls, p, pIter, zMask)
+ var zUpdate uintptr = uintptr(0)
+
+ (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask = (pUp + uintptr(1)*24)
+ libc.Xmemcpy(tls, (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FzMask, zMask, uint64((*RbuObjIter)(unsafe.Pointer(pIter)).FnTblCol))
+ (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate
+ (*RbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp
+
+ if zSet != 0 {
+ var zPrefix uintptr = ts + 781 /* "" */
+
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FeType != 5 {
+ zPrefix = ts + 33541 /* "rbu_imp_" */
+ }
+ zUpdate = Xsqlite3_mprintf(tls, ts+34202, /* "UPDATE \"%s%w\" SE..." */
+ libc.VaList(bp, zPrefix, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls,
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, (pUp + 8 /* &.pUpdate */), (p + 64 /* &.zErrmsg */), zUpdate)
+ *(*uintptr)(unsafe.Pointer(ppStmt)) = (*RbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate
+ }
+ Xsqlite3_free(tls, zWhere)
+ Xsqlite3_free(tls, zSet)
+ }
+
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
+}
+
+func rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) uintptr { /* sqlite3.c:198492:16: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* db */)) = uintptr(0)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ var flags int32 = ((0x00000002 | 0x00000004) | 0x00000040)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp+8 /* &db */, flags, func() uintptr {
+ if bUseVfs != 0 {
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName
+ }
+ return uintptr(0)
+ }())
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* db */)))))
+ Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* db */)))
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* db */)) = uintptr(0)
+ }
+ }
+ return *(*uintptr)(unsafe.Pointer(bp + 8 /* db */))
+}
+
+// Free an RbuState object allocated by rbuLoadState().
+func rbuFreeState(tls *libc.TLS, p uintptr) { /* sqlite3.c:198513:13: */
+ if p != 0 {
+ Xsqlite3_free(tls, (*RbuState)(unsafe.Pointer(p)).FzTbl)
+ Xsqlite3_free(tls, (*RbuState)(unsafe.Pointer(p)).FzDataTbl)
+ Xsqlite3_free(tls, (*RbuState)(unsafe.Pointer(p)).FzIdx)
+ Xsqlite3_free(tls, p)
+ }
+}
+
+// Allocate an RbuState object and load the contents of the rbu_state
+// table into it. Return a pointer to the new object. It is the
+// responsibility of the caller to eventually free the object using
+// sqlite3_free().
+//
+// If an error occurs, leave an error code and message in the rbu handle
+// and return NULL.
+func rbuLoadState(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:198531:17: */
+ bp := tls.Alloc(20)
+ defer tls.Free(20)
+
+ var pRet uintptr = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)) = uintptr(0)
+ // var rc int32 at bp+16, 4
+
+ var rc2 int32
+
+ pRet = rbuMalloc(tls, p, int64(unsafe.Sizeof(RbuState{})))
+ if pRet == uintptr(0) {
+ return uintptr(0)
+ }
+
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+8 /* &pStmt */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+34232 /* "SELECT k, v FROM..." */, libc.VaList(bp, p+48 /* &.zStateDb */)))
+ for (*(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))) {
+ switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 0) {
+ case 1:
+ (*RbuState)(unsafe.Pointer(pRet)).FeStage = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1)
+ if (((*RbuState)(unsafe.Pointer(pRet)).FeStage != 1) &&
+ ((*RbuState)(unsafe.Pointer(pRet)).FeStage != 2)) &&
+ ((*RbuState)(unsafe.Pointer(pRet)).FeStage != 4) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 11
+ }
+ break
+
+ case 2:
+ (*RbuState)(unsafe.Pointer(pRet)).FzTbl = rbuStrndup(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1), bp+16 /* &rc */)
+ break
+
+ case 3:
+ (*RbuState)(unsafe.Pointer(pRet)).FzIdx = rbuStrndup(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1), bp+16 /* &rc */)
+ break
+
+ case 4:
+ (*RbuState)(unsafe.Pointer(pRet)).FnRow = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1)
+ break
+
+ case 5:
+ (*RbuState)(unsafe.Pointer(pRet)).FnProgress = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1)
+ break
+
+ case 6:
+ (*RbuState)(unsafe.Pointer(pRet)).FiWalCksum = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1)
+ break
+
+ case 7:
+ (*RbuState)(unsafe.Pointer(pRet)).FiCookie = U32(Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1))
+ break
+
+ case 8:
+ (*RbuState)(unsafe.Pointer(pRet)).FiOalSz = I64(U32(Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1)))
+ break
+
+ case 9:
+ (*RbuState)(unsafe.Pointer(pRet)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1)
+ break
+
+ case 10:
+ (*RbuState)(unsafe.Pointer(pRet)).FzDataTbl = rbuStrndup(tls, Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 1), bp+16 /* &rc */)
+ break
+
+ default:
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = 11
+ break
+ }
+ }
+ rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))
+ if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = rc2
+ }
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = *(*int32)(unsafe.Pointer(bp + 16 /* rc */))
+ return pRet
+}
+
+// Open the database handle and attach the RBU database as "rbu". If an
+// error occurs, leave an error code and message in the RBU handle.
+func rbuOpenDatabase(tls *libc.TLS, p uintptr, pbRetry uintptr) { /* sqlite3.c:198608:13: */
+ bp := tls.Alloc(56)
+ defer tls.Free(56)
+
+ // Open the RBU database
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, 1)
+
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) {
+ Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8314 /* "main" */, 5149216, p)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) {
+ var zFile uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8314 /* "main" */)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+34262 /* "file://%s-vacuum..." */, libc.VaList(bp, zFile, zFile))
+ }
+ }
+
+ // If using separate RBU and state databases, attach the state database to
+ // the RBU db handle now.
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzState != 0 {
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+34289 /* "ATTACH %Q AS sta..." */, libc.VaList(bp+16, (*Sqlite3rbu)(unsafe.Pointer(p)).FzState))
+ libc.Xmemcpy(tls, p+48 /* &.zStateDb */, ts+4420 /* "stat" */, uint64(4))
+ } else {
+ libc.Xmemcpy(tls, p+48 /* &.zStateDb */, ts+8314 /* "main" */, uint64(4))
+ }
+
+ // If it has not already been created, create the rbu_state table
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+34307 /* "CREATE TABLE IF ..." */, libc.VaList(bp+24, p+48 /* &.zStateDb */))
+
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) {
+ var bOpen int32 = 0
+ var rc int32
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0)
+ rc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8314 /* "main" */, 5149216, p)
+ if rc != 12 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
+ }
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage >= 2 {
+ bOpen = 1
+ } else {
+ var pState uintptr = rbuLoadState(tls, p)
+ if pState != 0 {
+ bOpen = (libc.Bool32((*RbuState)(unsafe.Pointer(pState)).FeStage >= 2))
+ rbuFreeState(tls, pState)
+ }
+ }
+ if bOpen != 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, (libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu <= 1)))
+ }
+ }
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 0
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain == uintptr(0)) {
+ if !((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = rbuOpenDbhandle(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget, 1)
+ } else if (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd)).FpWalFd != 0 {
+ if pbRetry != 0 {
+ (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd)).FbNolock = U8(0)
+ Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu)
+ Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = uintptr(0)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu = uintptr(0)
+ *(*int32)(unsafe.Pointer(pbRetry)) = 1
+ return
+ }
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 1
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+34373 /* "cannot vacuum wa..." */, 0)
+ } else {
+ var zTarget uintptr
+ var zExtra uintptr = uintptr(0)
+ if (libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5)) && (0 == libc.Xmemcmp(tls, ts+27512 /* "file:" */, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5))) {
+ zExtra = ((*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu + uintptr(5))
+ for *(*int8)(unsafe.Pointer(zExtra)) != 0 {
+ if int32(*(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zExtra, 1)))) == '?' {
+ break
+ }
+ }
+ if int32(*(*int8)(unsafe.Pointer(zExtra))) == 0 {
+ zExtra = uintptr(0)
+ }
+ }
+
+ zTarget = Xsqlite3_mprintf(tls, ts+34405, /* "file:%s-vactmp?r..." */
+ libc.VaList(bp+32, Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8314 /* "main" */),
+ func() uintptr {
+ if zExtra == uintptr(0) {
+ return ts + 781 /* "" */
+ }
+ return ts + 34437 /* "&" */
+ }(), func() uintptr {
+ if zExtra == uintptr(0) {
+ return ts + 781 /* "" */
+ }
+ return zExtra
+ }()))
+
+ if zTarget == uintptr(0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 7
+ return
+ }
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = rbuOpenDbhandle(tls, p, zTarget, (libc.Bool32((*Sqlite3rbu)(unsafe.Pointer(p)).FnRbu <= 1)))
+ Xsqlite3_free(tls, zTarget)
+ }
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
+ ts+34439 /* "rbu_tmp_insert" */, -1, 1, p, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{rbuTmpInsertFunc})), uintptr(0), uintptr(0))
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain,
+ ts+34454 /* "rbu_fossil_delta" */, 2, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{rbuFossilDeltaFunc})), uintptr(0), uintptr(0))
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu,
+ ts+34471 /* "rbu_target_name" */, -1, 1, p, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{rbuTargetNameFunc})), uintptr(0), uintptr(0))
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8314 /* "main" */, 26, p)
+ }
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+34487 /* "SELECT * FROM sq..." */, 0)
+
+ // Mark the database file just opened as an RBU target database. If
+ // this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use.
+ // This is an error.
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8314 /* "main" */, 26, p)
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 12 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 1
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+34515 /* "rbu vfs not foun..." */, 0)
+ }
+}
+
+// This routine is a copy of the sqlite3FileSuffix3() routine from the core.
+// It is a no-op unless SQLITE_ENABLE_8_3_NAMES is defined.
+//
+// If SQLITE_ENABLE_8_3_NAMES is set at compile-time and if the database
+// filename in zBaseFilename is a URI with the "8_3_names=1" parameter and
+// if filename in z[] has a suffix (a.k.a. "extension") that is longer than
+// three characters, then shorten the suffix on z[] to be the last three
+// characters of the original suffix.
+//
+// If SQLITE_ENABLE_8_3_NAMES is set to 2 at compile-time, then always
+// do the suffix shortening regardless of URI parameter.
+//
+// Examples:
+//
+// test.db-journal => test.nal
+// test.db-wal => test.wal
+// test.db-shm => test.shm
+// test.db-mj7f3319fa => test.9fa
+func rbuFileSuffix3(tls *libc.TLS, zBase uintptr, z uintptr) { /* sqlite3.c:198787:13: */
+}
+
+// Return the current wal-index header checksum for the target database
+// as a 64-bit integer.
+//
+// The checksum is store in the first page of xShmMap memory as an 8-byte
+// blob starting at byte offset 40.
+func rbuShmChecksum(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:198808:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var iRet I64 = int64(0)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
+ // var ptr uintptr at bp, 8
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods + 104 /* &.xShmMap */))))(tls, pDb, 0, (32 * 1024), 0, bp /* &ptr */)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ iRet = ((I64(*(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* ptr */)) + uintptr(10)*4))) << 32) + I64(*(*U32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* ptr */)) + uintptr(11)*4))))
+ }
+ }
+ return iRet
+}
+
+// This function is called as part of initializing or reinitializing an
+// incremental checkpoint.
+//
+// It populates the sqlite3rbu.aFrame[] array with the set of
+// (wal frame -> db page) copy operations required to checkpoint the
+// current wal file, and obtains the set of shm locks required to safely
+// perform the copy operations directly on the file-system.
+//
+// If argument pState is not NULL, then the incremental checkpoint is
+// being resumed. In this case, if the checksum of the wal-index-header
+// following recovery is not the same as the checksum saved in the RbuState
+// object, then the rbu handle is set to DONE state. This occurs if some
+// other client appends a transaction to the wal file in the middle of
+// an incremental checkpoint.
+func rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:198837:13: */
+
+ // If pState is NULL, then the wal file may not have been opened and
+ // recovered. Running a read-statement here to ensure that doing so
+ // does not interfere with the "capture" process below.
+ if pState == uintptr(0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 0
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+34487 /* "SELECT * FROM sq..." */, uintptr(0), uintptr(0), uintptr(0))
+ }
+ }
+
+ // Assuming no error has occurred, run a "restart" checkpoint with the
+ // sqlite3rbu.eStage variable set to CAPTURE. This turns on the following
+ // special behaviour in the rbu VFS:
+ //
+ // * If the exclusive shm WRITER or READ0 lock cannot be obtained,
+ // the checkpoint fails with SQLITE_BUSY (normally SQLite would
+ // proceed with running a passive checkpoint instead of failing).
+ //
+ // * Attempts to read from the *-wal file or write to the database file
+ // do not perform any IO. Instead, the frame/page combinations that
+ // would be read/written are recorded in the sqlite3rbu.aFrame[]
+ // array.
+ //
+ // * Calls to xShmLock(UNLOCK) to release the exclusive shm WRITER,
+ // READ0 and CHECKPOINT locks taken as part of the checkpoint are
+ // no-ops. These locks will not be released until the connection
+ // is closed.
+ //
+ // * Attempting to xSync() the database file causes an SQLITE_INTERNAL
+ // error.
+ //
+ // As a result, unless an error (i.e. OOM or SQLITE_BUSY) occurs, the
+ // checkpoint below fails with SQLITE_INTERNAL, and leaves the aFrame[]
+ // array populated with a set of (frame -> page) mappings. Because the
+ // WRITER, CHECKPOINT and READ0 locks are still held, it is safe to copy
+ // data from the wal file into the database file according to the
+ // contents of aFrame[].
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ var rc2 int32
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 3
+ rc2 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+34533 /* "PRAGMA main.wal_..." */, uintptr(0), uintptr(0), uintptr(0))
+ if rc2 != 2 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc2
+ }
+ }
+
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame > 0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 4
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = func() int32 {
+ if pState != 0 {
+ return (*RbuState)(unsafe.Pointer(pState)).FnRow
+ }
+ return 0
+ }()
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FaBuf = rbuMalloc(tls, p, int64((*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FiWalCksum = rbuShmChecksum(tls, p)
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame == 0) || ((pState != 0) && ((*RbuState)(unsafe.Pointer(pState)).FiWalCksum != (*Sqlite3rbu)(unsafe.Pointer(p)).FiWalCksum)) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 101
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 5
+ } else {
+ var nSectorSize int32
+ var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
+ var pWal uintptr = (*Rbu_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal
+
+ nSectorSize = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods + 88 /* &.xSectorSize */))))(tls, pDb)
+ if nSectorSize > (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = (nSectorSize / (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz)
+ } else {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = 1
+ }
+
+ // Call xSync() on the wal file. This causes SQLite to sync the
+ // directory in which the target database and the wal file reside, in
+ // case it has not been synced since the rename() call in
+ // rbuMoveOalFile().
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pWal)).FpMethods + 40 /* &.xSync */))))(tls, pWal, 0x00002)
+ }
+ }
+}
+
+// Called when iAmt bytes are read from offset iOff of the wal file while
+// the rbu object is in capture mode. Record the frame number of the frame
+// being read in the aFrame[] array.
+func rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff I64, iAmt int32) int32 { /* sqlite3.c:198921:12: */
+ var mReq U32 = (U32(((int32(1) << 0) | (int32(1) << 1)) | (int32(1) << 3)))
+ var iFrame U32
+
+ if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FmLock != mReq {
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).Frc = 5
+ return 2
+ }
+
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).Fpgsz = iAmt
+ if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame == (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc {
+ var nNew int32 = ((func() int32 {
+ if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc != 0 {
+ return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc
+ }
+ return 64
+ }()) * 2)
+ var aNew uintptr
+ aNew = Xsqlite3_realloc64(tls, (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, (uint64(uint64(nNew) * uint64(unsafe.Sizeof(RbuFrame{})))))
+ if aNew == uintptr(0) {
+ return 7
+ }
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame = aNew
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrameAlloc = nNew
+ }
+
+ iFrame = ((U32((iOff - int64(32)) / (I64(iAmt + 24)))) + U32(1))
+ if (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiMaxFrame < iFrame {
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiMaxFrame = iFrame
+ }
+ (*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame + uintptr((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame)*8)).FiWalFrame = iFrame
+ (*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame + uintptr((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame)*8)).FiDbPage = U32(0)
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame++
+ return 0
+}
+
+// Called when a page of data is written to offset iOff of the database
+// file while the rbu handle is in capture mode. Record the page number
+// of the page being written in the aFrame[] array.
+func rbuCaptureDbWrite(tls *libc.TLS, pRbu uintptr, iOff I64) int32 { /* sqlite3.c:198953:12: */
+ (*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame + uintptr(((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnFrame-1))*8)).FiDbPage = ((U32(iOff / I64((*Sqlite3rbu)(unsafe.Pointer(pRbu)).Fpgsz))) + U32(1))
+ return 0
+}
+
+// This is called as part of an incremental checkpoint operation. Copy
+// a single frame of data from the wal file into the database file, as
+// indicated by the RbuFrame object.
+func rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { /* sqlite3.c:198963:13: */
+ var pWal uintptr = (*Rbu_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal
+ var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
+ var iOff I64
+
+ iOff = ((((I64((*RbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame - U32(1))) * (I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz + 24))) + int64(32)) + int64(24))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pWal)).FpMethods + 16 /* &.xRead */))))(tls, pWal, (*Sqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 {
+ return
+ }
+
+ iOff = ((I64((*RbuFrame)(unsafe.Pointer(pFrame)).FiDbPage - U32(1))) * I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods + 24 /* &.xWrite */))))(tls, pDb, (*Sqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Sqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff)
+}
+
+// Take an EXCLUSIVE lock on the database file.
+func rbuLockDatabase(tls *libc.TLS, p uintptr) { /* sqlite3.c:198981:13: */
+ var pReal uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pReal)).FpMethods + 56 /* &.xLock */))))(tls, pReal, 1)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pReal)).FpMethods + 56 /* &.xLock */))))(tls, pReal, 4)
+ }
+}
+
+// The RBU handle is currently in RBU_STAGE_OAL state, with a SHARED lock
+// on the database file. This proc moves the *-oal file to the *-wal path,
+// then reopens the database file (this time in vanilla, non-oal, WAL mode).
+// If an error occurs, leave an error code and error message in the rbu
+// handle.
+func rbuMoveOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:199021:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var zBase uintptr = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+8314 /* "main" */)
+ var zMove uintptr = zBase
+ var zOal uintptr
+ var zWal uintptr
+
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ zMove = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+8314 /* "main" */)
+ }
+ zOal = Xsqlite3_mprintf(tls, ts+34568 /* "%s-oal" */, libc.VaList(bp, zMove))
+ zWal = Xsqlite3_mprintf(tls, ts+34575 /* "%s-wal" */, libc.VaList(bp+8, zMove))
+
+ if (zWal == uintptr(0)) || (zOal == uintptr(0)) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 7
+ } else {
+ // Move the *-oal file to *-wal. At this point connection p->db is
+ // holding a SHARED lock on the target database file (because it is
+ // in WAL mode). So no other connection may be writing the db.
+ //
+ // In order to ensure that there are no database readers, an EXCLUSIVE
+ // lock is obtained here before the *-oal is moved to *-wal.
+ rbuLockDatabase(tls, p)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ rbuFileSuffix3(tls, zBase, zWal)
+ rbuFileSuffix3(tls, zBase, zOal)
+
+ // Re-open the databases.
+ rbuObjIterFinalize(tls, (p + 80 /* &.objiter */))
+ Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu)
+ Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain = uintptr(0)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu = uintptr(0)
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = func() int32 {
+ if libc.Xrename(tls, zOal, zWal) != 0 {
+ return 10
+ }
+ return 0
+ }()
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ rbuOpenDatabase(tls, p, uintptr(0))
+ rbuSetupCheckpoint(tls, p, uintptr(0))
+ }
+ }
+ }
+
+ Xsqlite3_free(tls, zWal)
+ Xsqlite3_free(tls, zOal)
+}
+
+// The SELECT statement iterating through the keys for the current object
+// (p->objiter.pSelect) currently points to a valid row. This function
+// determines the type of operation requested by this row and returns
+// one of the following values to indicate the result:
+//
+// * RBU_INSERT
+// * RBU_DELETE
+// * RBU_IDX_DELETE
+// * RBU_UPDATE
+//
+// If RBU_UPDATE is returned, then output variable *pzMask is set to
+// point to the text value indicating the columns to update.
+//
+// If the rbu_control field contains an invalid value, an error code and
+// message are left in the RBU handle and zero returned.
+func rbuStepType(tls *libc.TLS, p uintptr, pzMask uintptr) int32 { /* sqlite3.c:199112:12: */
+ var iCol int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnCol // Index of rbu_control column
+ var res int32 = 0 // Return value
+
+ switch Xsqlite3_column_type(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpSelect, iCol) {
+ case 1:
+ {
+ var iVal int32 = Xsqlite3_column_int(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpSelect, iCol)
+ switch iVal {
+ case 0:
+ res = 1
+ break
+ case 1:
+ res = 2
+ break
+ case 2:
+ res = 3
+ break
+ case 3:
+ res = 4
+ break
+ case 4:
+ res = 5
+ break
+ }
+ break
+ }
+
+ case 3:
+ {
+ var z uintptr = Xsqlite3_column_text(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FpSelect, iCol)
+ if z == uintptr(0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 7
+ } else {
+ *(*uintptr)(unsafe.Pointer(pzMask)) = z
+ }
+ res = 6
+
+ break
+ }
+
+ default:
+ break
+ }
+
+ if res == 0 {
+ rbuBadControlError(tls, p)
+ }
+ return res
+}
+
+// Argument eType must be one of RBU_INSERT, RBU_DELETE, RBU_IDX_INSERT or
+// RBU_IDX_DELETE. This function performs the work of a single
+// sqlite3rbu_step() call for the type of operation specified by eType.
+func rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { /* sqlite3.c:199168:13: */
+ var pIter uintptr = (p + 80 /* &.objiter */)
+ var pVal uintptr
+ var pWriter uintptr
+ var i int32
+
+ // If this is a delete, decrement nPhaseOneStep by nIndex. If the DELETE
+ // statement below does actually delete a row, nPhaseOneStep will be
+ // incremented by the same amount when SQL function rbu_tmp_insert()
+ // is invoked by the trigger.
+ if eType == 2 {
+ *(*I64)(unsafe.Pointer(p + 304 /* &.nPhaseOneStep */)) -= (I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex))
+ }
+
+ if (eType == 4) || (eType == 2) {
+ pWriter = (*RbuObjIter)(unsafe.Pointer(pIter)).FpDelete
+ } else {
+ pWriter = (*RbuObjIter)(unsafe.Pointer(pIter)).FpInsert
+ }
+
+ for i = 0; i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol; i++ {
+ // If this is an INSERT into a table b-tree and the table has an
+ // explicit INTEGER PRIMARY KEY, check that this is not an attempt
+ // to write a NULL into the IPK column. That is not permitted.
+ if ((((eType == 1) &&
+ ((*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0))) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 2)) && (*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0)) &&
+ (Xsqlite3_column_type(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == 5) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 20
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+27150 /* "datatype mismatc..." */, 0)
+ return
+ }
+
+ if (eType == 2) && (int32(*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0) {
+ continue
+ }
+
+ pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, pWriter, (i + 1), pVal)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 {
+ return
+ }
+ }
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
+ if (((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 5) ||
+ ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 1)) ||
+ (((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 3) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) {
+ // For a virtual table, or a table with no primary key, the
+ // SELECT statement is:
+ //
+ // SELECT <cols>, rbu_control, rbu_rowid FROM ....
+ //
+ // Hence column_value(pIter->nCol+1).
+
+ pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnCol + 1))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, pWriter, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnCol + 1), pVal)
+ }
+ }
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ Xsqlite3_step(tls, pWriter)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = resetAndCollectError(tls, pWriter, (p + 64 /* &.zErrmsg */))
+ }
+}
+
+// This function does the work for an sqlite3rbu_step() call.
+//
+// The object-iterator (p->objiter) currently points to a valid object,
+// and the input cursor (p->objiter.pSelect) currently points to a valid
+// input row. Perform whatever processing is required and return.
+//
+// If no error occurs, SQLITE_OK is returned. Otherwise, an error code
+// and message is left in the RBU handle and a copy of the error code
+// returned.
+func rbuStep(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199251:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var pIter uintptr = (p + 80 /* &.objiter */)
+ *(*uintptr)(unsafe.Pointer(bp /* zMask */)) = uintptr(0)
+ var eType int32 = rbuStepType(tls, p, bp /* &zMask */)
+
+ if eType != 0 {
+
+ if ((*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0)) && ((eType == 4) || (eType == 5)) {
+ rbuBadControlError(tls, p)
+ } else if eType == 3 {
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) {
+ *(*I64)(unsafe.Pointer(p + 304 /* &.nPhaseOneStep */)) += (I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex))
+ rbuStepOneOp(tls, p, 2)
+ }
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ rbuStepOneOp(tls, p, 1)
+ }
+ } else if eType != 6 {
+ rbuStepOneOp(tls, p, eType)
+ } else {
+ var pVal uintptr
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pUpdate */)) = uintptr(0)
+
+ *(*I64)(unsafe.Pointer(p + 304 /* &.nPhaseOneStep */)) -= (I64((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex))
+ rbuGetUpdateStmt(tls, p, pIter, *(*uintptr)(unsafe.Pointer(bp /* zMask */)), bp+8 /* &pUpdate */)
+ if *(*uintptr)(unsafe.Pointer(bp + 8 /* pUpdate */)) != 0 {
+ var i int32
+ for i = 0; ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (i < (*RbuObjIter)(unsafe.Pointer(pIter)).FnCol); i++ {
+ var c int8 = *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* zMask */)) + uintptr(*(*int32)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4)))))
+ pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i)
+ if (*(*U8)(unsafe.Pointer((*RbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0) || (int32(c) != '.') {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pUpdate */)), (i + 1), pVal)
+ }
+ }
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) &&
+ (((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 5) || ((*RbuObjIter)(unsafe.Pointer(pIter)).FeType == 1)) {
+ // Bind the rbu_rowid value to column _rowid_
+
+ pVal = Xsqlite3_column_value(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect, ((*RbuObjIter)(unsafe.Pointer(pIter)).FnCol + 1))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pUpdate */)), ((*RbuObjIter)(unsafe.Pointer(pIter)).FnCol + 1), pVal)
+ }
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pUpdate */)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = resetAndCollectError(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pUpdate */)), (p + 64 /* &.zErrmsg */))
+ }
+ }
+ }
+ }
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
+}
+
+// Increment the schema cookie of the main database opened by p->dbMain.
+//
+// Or, if this is an RBU vacuum, set the schema cookie of the main db
+// opened by p->dbMain to one more than the schema cookie of the main
+// db opened by p->dbRbu.
+func rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { /* sqlite3.c:199316:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ var dbread uintptr = func() uintptr {
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu
+ }
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain
+ }()
+ var iCookie int32 = 1000000
+ // var pStmt uintptr at bp+8, 8
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, dbread, bp+8 /* &pStmt */, (p + 64 /* &.zErrmsg */),
+ ts+34582 /* "PRAGMA schema_ve..." */)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ // Coverage: it may be that this sqlite3_step() cannot fail. There
+ // is already a transaction open, so the prepared statement cannot
+ // throw an SQLITE_SCHEMA exception. The only database page the
+ // statement reads is page 1, which is guaranteed to be in the cache.
+ // And no memory allocations are required.
+ if 100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */))) {
+ iCookie = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 0)
+ }
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))
+ }
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+34604 /* "PRAGMA schema_ve..." */, libc.VaList(bp, (iCookie+1)))
+ }
+ }
+}
+
+// Update the contents of the rbu_state table within the rbu database. The
+// value stored in the RBU_STATE_STAGE column is eStage. All other values
+// are determined by inspecting the rbu handle passed as the first argument.
+func rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { /* sqlite3.c:199347:13: */
+ bp := tls.Alloc(176)
+ defer tls.Free(176)
+
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) || ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 101) {
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* pInsert */)) = uintptr(0)
+ var pFd uintptr = func() uintptr {
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd
+ }
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd
+ }()
+ var rc int32
+
+ rc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+168 /* &pInsert */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls,
+
+ ts+34631, /* "INSERT OR REPLAC..." */
+ libc.VaList(bp, p+48, /* &.zStateDb */
+ 1, eStage,
+ 2, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl,
+ 3, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx,
+ 4, (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep,
+ 5, (*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress,
+ 6, (*Sqlite3rbu)(unsafe.Pointer(p)).FiWalCksum,
+ 7, I64((*Rbu_file)(unsafe.Pointer(pFd)).FiCookie),
+ 8, (*Sqlite3rbu)(unsafe.Pointer(p)).FiOalSz,
+ 9, (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep,
+ 10, (*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl)))
+
+ if rc == 0 {
+ Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pInsert */)))
+ rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pInsert */)))
+ }
+ if rc != 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
+ }
+ }
+}
+
+// The second argument passed to this function is the name of a PRAGMA
+// setting - "page_size", "auto_vacuum", "user_version" or "application_id".
+// This function executes the following on sqlite3rbu.dbRbu:
+//
+// "PRAGMA main.$zPragma"
+//
+// where $zPragma is the string passed as the second argument, then
+// on sqlite3rbu.dbMain:
+//
+// "PRAGMA main.$zPragma = $val"
+//
+// where $val is the value returned by the first PRAGMA invocation.
+//
+// In short, it copies the value of the specified PRAGMA setting from
+// dbRbu to dbMain.
+func rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { /* sqlite3.c:199408:13: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)) = uintptr(0)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareFreeAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp+24 /* &pPragma */, (p + 64 /* &.zErrmsg */),
+ Xsqlite3_mprintf(tls, ts+34789 /* "PRAGMA main.%s" */, libc.VaList(bp, zPragma)))
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)))) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+34804, /* "PRAGMA main.%s =..." */
+ libc.VaList(bp+8, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)), 0)))
+ }
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 24 /* pPragma */)))
+ }
+}
+
+// The RBU handle passed as the only argument has just been opened and
+// the state database is empty. If this RBU handle was opened for an
+// RBU vacuum operation, create the schema in the target db.
+func rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { /* sqlite3.c:199428:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ *(*uintptr)(unsafe.Pointer(bp /* pSql */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pInsert */)) = uintptr(0)
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+34824 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */))
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pSql */, (p + 64 /* &.zErrmsg */),
+
+ ts+34849 /* "SELECT sql FROM ..." */)
+ }
+
+ for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */))) == 100) {
+ var zSql uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */)), 0)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, zSql, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */))
+ }
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pSql */)))
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0 {
+ return
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pSql */, (p + 64 /* &.zErrmsg */),
+ ts+34957 /* "SELECT * FROM sq..." */)
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8 /* &pInsert */, (p + 64 /* &.zErrmsg */),
+ ts+35022 /* "INSERT INTO sqli..." */)
+ }
+
+ for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */))) == 100) {
+ var i int32
+ for i = 0; i < 5; i++ {
+ Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pInsert */)), (i + 1), Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp /* pSql */)), i))
+ }
+ Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pInsert */)))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pInsert */)))
+ }
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+35066 /* "PRAGMA writable_..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */))
+ }
+
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pSql */)))
+ rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pInsert */)))
+}
+
+// Step the RBU object.
+func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:199480:16: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ if p != 0 {
+ switch (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage {
+ case 1:
+ {
+ var pIter uintptr = (p + 80 /* &.objiter */)
+
+ // If this is an RBU vacuum operation and the state table was empty
+ // when this handle was opened, create the target database schema.
+ if (((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) {
+ rbuCreateTargetSchema(tls, p)
+ rbuCopyPragma(tls, p, ts+18244 /* "user_version" */)
+ rbuCopyPragma(tls, p, ts+17354 /* "application_id" */)
+ }
+
+ for ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) {
+
+ if (*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 {
+ // Clean up the rbu_tmp_xxx table for the previous table. It
+ // cannot be dropped as there are currently active SQL statements.
+ // But the contents can be deleted.
+ if ((libc.Bool32((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0))) == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0) {
+ rbuMPrintfExec(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu,
+ ts+35091 /* "DELETE FROM %s.'..." */, libc.VaList(bp, p+48 /* &.zStateDb */, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))
+ }
+ } else {
+ rbuObjIterPrepareAll(tls, p, pIter, 0)
+
+ // Advance to the next row to process.
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ var rc int32 = Xsqlite3_step(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect)
+ if rc == 100 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress++
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep++
+ return rbuStep(tls, p)
+ }
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FpSelect)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = 0
+ }
+ }
+
+ rbuObjIterNext(tls, p, pIter)
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+
+ rbuSaveState(tls, p, 2)
+ rbuIncrSchemaCookie(tls, p)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+15581 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */))
+ }
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+15581 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */))
+ }
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 2
+ }
+ break
+ }
+ fallthrough
+
+ case 2:
+ {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ rbuMoveOalFile(tls, p)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress++
+ }
+ break
+ }
+ fallthrough
+
+ case 4:
+ {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame {
+ var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
+
+ // Sync the db file
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods + 40 /* &.xSync */))))(tls, pDb, 0x00002)
+
+ // Update nBackfill
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ // var ptr uintptr at bp+16, 8
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods + 104 /* &.xShmMap */))))(tls, pDb, 0, (32 * 1024), 0, bp+16 /* &ptr */)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ *(*U32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 16 /* ptr */))) + uintptr(24)*4)) = (*Sqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame
+ }
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 5
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 101
+ }
+ } else {
+ // At one point the following block copied a single frame from the
+ // wal file to the database file. So that one call to sqlite3rbu_step()
+ // checkpointed a single frame.
+ //
+ // However, if the sector-size is larger than the page-size, and the
+ // application calls sqlite3rbu_savestate() or close() immediately
+ // after this step, then rbu_step() again, then a power failure occurs,
+ // then the database page written here may be damaged. Work around
+ // this by checkpointing frames until the next page in the aFrame[]
+ // lies on a different disk sector to the current one.
+ var iSector U32
+ for ok := true; ok; ok = ((((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep < (*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame) &&
+ (iSector == (((*RbuFrame)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FaFrame+uintptr((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)*8)).FiDbPage - U32(1)) / U32((*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector)))) &&
+ ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0)) {
+ var pFrame uintptr = ((*Sqlite3rbu)(unsafe.Pointer(p)).FaFrame + uintptr((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)*8)
+ iSector = (((*RbuFrame)(unsafe.Pointer(pFrame)).FiDbPage - U32(1)) / U32((*Sqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector))
+ rbuCheckpointFrame(tls, p, pFrame)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep++
+ }
+ }
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress++
+ }
+ break
+ }
+ fallthrough
+
+ default:
+ break
+ }
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
+ } else {
+ return 7
+ }
+ return int32(0)
+}
+
+// Compare strings z1 and z2, returning 0 if they are identical, or non-zero
+// otherwise. Either or both argument may be NULL. Two NULL values are
+// considered equal, and NULL is considered distinct from all other values.
+func rbuStrCompare(tls *libc.TLS, z1 uintptr, z2 uintptr) int32 { /* sqlite3.c:199609:12: */
+ if (z1 == uintptr(0)) && (z2 == uintptr(0)) {
+ return 0
+ }
+ if (z1 == uintptr(0)) || (z2 == uintptr(0)) {
+ return 1
+ }
+ return (libc.Bool32(Xsqlite3_stricmp(tls, z1, z2) != 0))
+}
+
+// This function is called as part of sqlite3rbu_open() when initializing
+// an rbu handle in OAL stage. If the rbu update has not started (i.e.
+// the rbu_state table was empty) it is a no-op. Otherwise, it arranges
+// things so that the next call to sqlite3rbu_step() continues on from
+// where the previous rbu handle left off.
+//
+// If an error occurs, an error code and error message are left in the
+// rbu handle passed as the first argument.
+func rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { /* sqlite3.c:199625:13: */
+
+ if (*RbuState)(unsafe.Pointer(pState)).FzTbl != 0 {
+ var pIter uintptr = (p + 80 /* &.objiter */)
+ var rc int32 = 0
+
+ for ((rc == 0) && ((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0)) && (((((*RbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0) ||
+ (rbuStrCompare(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzIdx, (*RbuState)(unsafe.Pointer(pState)).FzIdx) != 0)) ||
+ (((*RbuState)(unsafe.Pointer(pState)).FzDataTbl == uintptr(0)) && (rbuStrCompare(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl, (*RbuState)(unsafe.Pointer(pState)).FzTbl) != 0))) ||
+ (((*RbuState)(unsafe.Pointer(pState)).FzDataTbl != 0) && (rbuStrCompare(tls, (*RbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, (*RbuState)(unsafe.Pointer(pState)).FzDataTbl) != 0))) {
+ rc = rbuObjIterNext(tls, p, pIter)
+ }
+
+ if (rc == 0) && !(int32((*RbuObjIter)(unsafe.Pointer(pIter)).FzTbl) != 0) {
+ rc = 1
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+35119 /* "rbu_state mismat..." */, 0)
+ }
+
+ if rc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = (*RbuState)(unsafe.Pointer(pState)).FnRow
+ rc = rbuObjIterPrepareAll(tls, p, (p + 80 /* &.objiter */), (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)
+ }
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
+ }
+}
+
+// If there is a "*-oal" file in the file-system corresponding to the
+// target database in the file-system, delete it. If an error occurs,
+// leave an error code and error message in the rbu handle.
+func rbuDeleteOalFile(tls *libc.TLS, p uintptr) { /* sqlite3.c:199658:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var zOal uintptr = rbuMPrintf(tls, p, ts+34568 /* "%s-oal" */, libc.VaList(bp, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget))
+ if zOal != 0 {
+ var pVfs uintptr = Xsqlite3_vfs_find(tls, uintptr(0))
+
+ (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pVfs + 48 /* &.xDelete */))))(tls, pVfs, zOal, 0)
+ Xsqlite3_free(tls, zOal)
+ }
+}
+
+// Allocate a private rbu VFS for the rbu handle passed as the only
+// argument. This VFS will be used unless the call to sqlite3rbu_open()
+// specified a URI with a vfs=? option in place of a target database
+// file name.
+func rbuCreateVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:199674:13: */
+ bp := tls.Alloc(76)
+ defer tls.Free(76)
+
+ // var rnd int32 at bp+8, 4
+
+ // var zRnd [64]int8 at bp+12, 64
+
+ Xsqlite3_randomness(tls, int32(unsafe.Sizeof(int32(0))), bp+8 /* &rnd */)
+ Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([64]int8{})), bp+12 /* &zRnd[0] */, ts+35144 /* "rbu_vfs_%d" */, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* rnd */))))
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+12 /* &zRnd[0] */, uintptr(0))
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ var pVfs uintptr = Xsqlite3_vfs_find(tls, bp+12 /* &zRnd[0] */)
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName = (*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FzName
+ (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRbu = p
+ }
+}
+
+// Destroy the private VFS created for the rbu handle passed as the only
+// argument by an earlier call to rbuCreateVfs().
+func rbuDeleteVfs(tls *libc.TLS, p uintptr) { /* sqlite3.c:199694:13: */
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName != 0 {
+ Xsqlite3rbu_destroy_vfs(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzVfsName = uintptr(0)
+ }
+}
+
+// This user-defined SQL function is invoked with a single argument - the
+// name of a table expected to appear in the target database. It returns
+// the number of auxilliary indexes on the table.
+func rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:199706:13: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var p uintptr = Xsqlite3_user_data(tls, pCtx)
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrmsg */)) = uintptr(0)
+ var rc int32
+ var db uintptr = func() uintptr {
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu
+ }
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain
+ }()
+
+ rc = prepareFreeAndCollectError(tls, db, bp+8 /* &pStmt */, bp+16, /* &zErrmsg */
+ Xsqlite3_mprintf(tls,
+ ts+35155 /* "SELECT count(*) ..." */, libc.VaList(bp, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8))))))
+ if rc != 0 {
+ Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrmsg */)), -1)
+ } else {
+ var nIndex int32 = 0
+ if 100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */))) {
+ nIndex = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)), 0)
+ }
+ rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pStmt */)))
+ if rc == 0 {
+ Xsqlite3_result_int(tls, pCtx, nIndex)
+ } else {
+ Xsqlite3_result_error(tls, pCtx, Xsqlite3_errmsg(tls, db), -1)
+ }
+ }
+
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErrmsg */)))
+}
+
+// If the RBU database contains the rbu_count table, use it to initialize
+// the sqlite3rbu.nPhaseOneStep variable. The schema of the rbu_count table
+// is assumed to contain the same columns as:
+//
+// CREATE TABLE rbu_count(tbl TEXT PRIMARY KEY, cnt INTEGER) WITHOUT ROWID;
+//
+// There should be one row in the table for each data_xxx table in the
+// database. The 'tbl' column should contain the name of a data_xxx table,
+// and the cnt column the number of rows it contains.
+//
+// sqlite3rbu.nPhaseOneStep is initialized to the sum of (1 + nIndex) * cnt
+// for all rows in the rbu_count table, where nIndex is the number of
+// indexes on the corresponding target database table.
+func rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { /* sqlite3.c:199756:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ *(*uintptr)(unsafe.Pointer(bp /* pStmt */)) = uintptr(0)
+ var bExists int32 = 0 // True if rbu_count exists
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-1)
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu,
+ ts+35227 /* "rbu_index_cnt" */, 1, 1, p, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{rbuIndexCntFunc})), uintptr(0), uintptr(0))
+
+ // Check for the rbu_count table. If it does not exist, or if an error
+ // occurs, nPhaseOneStep will be left set to -1.
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pStmt */, (p + 64 /* &.zErrmsg */),
+ ts+35241 /* "SELECT 1 FROM sq..." */)
+ }
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ if 100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) {
+ bExists = 1
+ }
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
+ }
+
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && (bExists != 0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = prepareAndCollectError(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp /* &pStmt */, (p + 64 /* &.zErrmsg */),
+
+ ts+35298 /* "SELECT sum(cnt *..." */)
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ if 100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */))) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)), 0)
+ }
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp /* pStmt */)))
+ }
+ }
+ }
+}
+
+func openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:199797:19: */
+ bp := tls.Alloc(20)
+ defer tls.Free(20)
+
+ var p uintptr
+ var nTarget Size_t
+ if zTarget != 0 {
+ nTarget = libc.Xstrlen(tls, zTarget)
+ } else {
+ nTarget = uint64(0)
+ }
+ var nRbu Size_t = libc.Xstrlen(tls, zRbu)
+ var nByte Size_t = ((((uint64(unsafe.Sizeof(Sqlite3rbu{})) + nTarget) + uint64(1)) + nRbu) + uint64(1))
+
+ p = Xsqlite3_malloc64(tls, uint64(nByte))
+ if p != 0 {
+ var pState uintptr = uintptr(0)
+
+ // Create the custom VFS.
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Sqlite3rbu{})))
+ rbuCreateVfs(tls, p)
+
+ // Open the target, RBU and state databases
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ var pCsr uintptr = (p + uintptr(1)*392)
+ *(*int32)(unsafe.Pointer(bp + 16 /* bRetry */)) = 0
+ if zTarget != 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget = pCsr
+ libc.Xmemcpy(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzTarget, zTarget, (nTarget + uint64(1)))
+ pCsr += (uintptr(nTarget + uint64(1)))
+ }
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu = pCsr
+ libc.Xmemcpy(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, (nRbu + uint64(1)))
+ pCsr += (uintptr(nRbu + uint64(1)))
+ if zState != 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzState = rbuMPrintf(tls, p, ts+805 /* "%s" */, libc.VaList(bp, zState))
+ }
+
+ // If the first attempt to open the database file fails and the bRetry
+ // flag it set, this means that the db was not opened because it seemed
+ // to be a wal-mode db. But, this may have happened due to an earlier
+ // RBU vacuum operation leaving an old wal file in the directory.
+ // If this is the case, it will have been checkpointed and deleted
+ // when the handle was closed and a second attempt to open the
+ // database may succeed.
+ rbuOpenDatabase(tls, p, bp+16 /* &bRetry */)
+ if *(*int32)(unsafe.Pointer(bp + 16 /* bRetry */)) != 0 {
+ rbuOpenDatabase(tls, p, uintptr(0))
+ }
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ pState = rbuLoadState(tls, p)
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+
+ if (*RbuState)(unsafe.Pointer(pState)).FeStage == 0 {
+ rbuDeleteOalFile(tls, p)
+ rbuInitPhaseOneSteps(tls, p)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 1
+ } else {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = (*RbuState)(unsafe.Pointer(pState)).FeStage
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = (*RbuState)(unsafe.Pointer(pState)).FnPhaseOneStep
+ }
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress = int32((*RbuState)(unsafe.Pointer(pState)).FnProgress)
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FiOalSz = (*RbuState)(unsafe.Pointer(pState)).FiOalSz
+ }
+ }
+
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0) {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 1 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 1
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+35372 /* "cannot update wa..." */, 0)
+ } else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 2 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 4
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FnStep = 0
+ }
+ }
+
+ if (((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) &&
+ (((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 1) || ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 2))) &&
+ ((*RbuState)(unsafe.Pointer(pState)).FeStage != 0) {
+ var pFd uintptr = func() uintptr {
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).FpRbuFd
+ }
+ return (*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd
+ }()
+ if (*Rbu_file)(unsafe.Pointer(pFd)).FiCookie != (*RbuState)(unsafe.Pointer(pState)).FiCookie {
+ // At this point (pTargetFd->iCookie) contains the value of the
+ // change-counter cookie (the thing that gets incremented when a
+ // transaction is committed in rollback mode) currently stored on
+ // page 1 of the database file.
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 5
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, ts+35404, /* "database modifie..." */
+ libc.VaList(bp+8, func() uintptr {
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ return ts + 35436 /* "vacuum" */
+ }
+ return ts + 35443 /* "update" */
+ }()))
+ }
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 1 {
+ var db uintptr = (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+15566 /* "BEGIN" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */))
+
+ // Point the object iterator at the first object
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rbuObjIterFirst(tls, p, (p + 80 /* &.objiter */))
+ }
+
+ // If the RBU database contains no data_xxx tables, declare the RBU
+ // update finished.
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl == uintptr(0)) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 101
+ (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage = 5
+ } else {
+ if (((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*RbuState)(unsafe.Pointer(pState)).FeStage == 0)) && ((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) {
+ rbuCopyPragma(tls, p, ts+17969 /* "page_size" */)
+ rbuCopyPragma(tls, p, ts+17369 /* "auto_vacuum" */)
+ }
+
+ // Open transactions both databases. The *-oal file is opened or
+ // created at this point.
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, ts+35450 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */))
+ }
+
+ // Check if the main database is a zipvfs db. If it is, set the upper
+ // level pager to use "journal_mode=off". This prevents it from
+ // generating a large journal using a temp file.
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ var frc int32 = Xsqlite3_file_control(tls, db, ts+8314 /* "main" */, 25, uintptr(0))
+ if frc == 0 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls,
+ db, ts+35466 /* "PRAGMA journal_m..." */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */))
+ }
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0 {
+ rbuSetupOal(tls, p, pState)
+ }
+ }
+ } else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 2 {
+ } else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 4 {
+ rbuSetupCheckpoint(tls, p, pState)
+ } else if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 5 {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 101
+ } else {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = 11
+ }
+ }
+
+ rbuFreeState(tls, pState)
+ }
+
+ return p
+}
+
+// Allocate and return an RBU handle with all fields zeroed except for the
+// error code, which is set to SQLITE_MISUSE.
+func rbuMisuseError(tls *libc.TLS) uintptr { /* sqlite3.c:199953:19: */
+ var pRet uintptr
+ pRet = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(Sqlite3rbu{})))
+ if pRet != 0 {
+ libc.Xmemset(tls, pRet, 0, uint64(unsafe.Sizeof(Sqlite3rbu{})))
+ (*Sqlite3rbu)(unsafe.Pointer(pRet)).Frc = 21
+ }
+ return pRet
+}
+
+// Open and return a new RBU handle.
+func Xsqlite3rbu_open(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr) uintptr { /* sqlite3.c:199966:23: */
+ if (zTarget == uintptr(0)) || (zRbu == uintptr(0)) {
+ return rbuMisuseError(tls)
+ }
+ // TODO: Check that zTarget and zRbu are non-NULL
+ return openRbuHandle(tls, zTarget, zRbu, zState)
+}
+
+// Open a handle to begin or resume an RBU VACUUM operation.
+func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) uintptr { /* sqlite3.c:199979:23: */
+ if zTarget == uintptr(0) {
+ return rbuMisuseError(tls)
+ }
+ if zState != 0 {
+ var n int32 = int32(libc.Xstrlen(tls, zState))
+ if (n >= 7) && (0 == libc.Xmemcmp(tls, ts+35490 /* "-vactmp" */, (zState+uintptr((n-7))), uint64(7))) {
+ return rbuMisuseError(tls)
+ }
+ }
+ // TODO: Check that both arguments are non-NULL
+ return openRbuHandle(tls, uintptr(0), zTarget, zState)
+}
+
+// Return the database handle used by pRbu.
+func Xsqlite3rbu_db(tls *libc.TLS, pRbu uintptr, bRbu int32) uintptr { /* sqlite3.c:199997:20: */
+ var db uintptr = uintptr(0)
+ if pRbu != 0 {
+ db = func() uintptr {
+ if bRbu != 0 {
+ return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FdbRbu
+ }
+ return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FdbMain
+ }()
+ }
+ return db
+}
+
+// If the error code currently stored in the RBU handle is SQLITE_CONSTRAINT,
+// then edit any error message string so as to remove all occurrences of
+// the pattern "rbu_imp_[0-9]*".
+func rbuEditErrmsg(tls *libc.TLS, p uintptr) { /* sqlite3.c:200011:13: */
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 19) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg != 0) {
+ var i uint32
+ var nErrmsg Size_t = libc.Xstrlen(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg)
+ for i = uint32(0); Size_t(i) < (nErrmsg - uint64(8)); i++ {
+ if libc.Xmemcmp(tls, ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i)), ts+33541 /* "rbu_imp_" */, uint64(8)) == 0 {
+ var nDel int32 = 8
+ for (int32(*(*int8)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr((i + uint32(nDel)))))) >= '0') && (int32(*(*int8)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr((i + uint32(nDel)))))) <= '9') {
+ nDel++
+ }
+ libc.Xmemmove(tls, ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i)), ((*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr((i + uint32(nDel)))), (((nErrmsg + uint64(1)) - Size_t(i)) - Size_t(nDel)))
+ nErrmsg = nErrmsg - (Size_t(nDel))
+ }
+ }
+ }
+}
+
+// Close the RBU handle.
+func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) int32 { /* sqlite3.c:200029:16: */
+ var rc int32
+ if p != 0 {
+
+ // Commit the transaction to the *-oal file.
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 1) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+15581 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */))
+ }
+
+ // Sync the db file if currently doing an incremental checkpoint
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 4) {
+ var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods + 40 /* &.xSync */))))(tls, pDb, 0x00002)
+ }
+
+ rbuSaveState(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage)
+
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 1) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+15581 /* "COMMIT" */, uintptr(0), uintptr(0), (p + 64 /* &.zErrmsg */))
+ }
+
+ // Close any open statement handles.
+ rbuObjIterFinalize(tls, (p + 80 /* &.objiter */))
+
+ // If this is an RBU vacuum handle and the vacuum has either finished
+ // successfully or encountered an error, delete the contents of the
+ // state table. This causes the next call to sqlite3rbu_vacuum()
+ // specifying the current target and state databases to start a new
+ // vacuum from scratch.
+ if (((*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0)) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0) {
+ var rc2 int32 = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+35498 /* "DELETE FROM stat..." */, uintptr(0), uintptr(0), uintptr(0))
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc == 101) && (rc2 != 0) {
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc2
+ }
+ }
+
+ // Close the open database handle and VFS object.
+ Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu)
+ Xsqlite3_close(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain)
+
+ rbuDeleteVfs(tls, p)
+ Xsqlite3_free(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FaBuf)
+ Xsqlite3_free(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FaFrame)
+
+ rbuEditErrmsg(tls, p)
+ rc = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
+ if pzErrmsg != 0 {
+ *(*uintptr)(unsafe.Pointer(pzErrmsg)) = (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg
+ } else {
+ Xsqlite3_free(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzErrmsg)
+ }
+ Xsqlite3_free(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FzState)
+ Xsqlite3_free(tls, p)
+ } else {
+ rc = 7
+ *(*uintptr)(unsafe.Pointer(pzErrmsg)) = uintptr(0)
+ }
+ return rc
+}
+
+// Return the total number of key-value operations (inserts, deletes or
+// updates) that have been performed on the target database since the
+// current RBU update was started.
+func Xsqlite3rbu_progress(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:200092:26: */
+ return Sqlite3_int64((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnProgress)
+}
+
+// Return permyriadage progress indications for the two main stages of
+// an RBU update.
+func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uintptr) { /* sqlite3.c:200100:17: */
+ var MAX_PROGRESS int32 = 10000
+ switch (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage {
+ case 1:
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep > int64(0) {
+ *(*int32)(unsafe.Pointer(pnOne)) = (int32((I64(MAX_PROGRESS) * I64((*Sqlite3rbu)(unsafe.Pointer(p)).FnProgress)) / (*Sqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep))
+ } else {
+ *(*int32)(unsafe.Pointer(pnOne)) = -1
+ }
+ *(*int32)(unsafe.Pointer(pnTwo)) = 0
+ break
+
+ case 2:
+ *(*int32)(unsafe.Pointer(pnOne)) = MAX_PROGRESS
+ *(*int32)(unsafe.Pointer(pnTwo)) = 0
+ break
+
+ case 4:
+ *(*int32)(unsafe.Pointer(pnOne)) = MAX_PROGRESS
+ *(*int32)(unsafe.Pointer(pnTwo)) = (int32((I64(MAX_PROGRESS) * I64((*Sqlite3rbu)(unsafe.Pointer(p)).FnStep)) / I64((*Sqlite3rbu)(unsafe.Pointer(p)).FnFrame)))
+ break
+
+ case 5:
+ *(*int32)(unsafe.Pointer(pnOne)) = MAX_PROGRESS
+ *(*int32)(unsafe.Pointer(pnTwo)) = MAX_PROGRESS
+ break
+
+ default:
+ }
+}
+
+// Return the current state of the RBU vacuum or update operation.
+func Xsqlite3rbu_state(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200135:16: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ *(*[6]int32)(unsafe.Pointer(bp /* aRes */)) = [6]int32{
+ 0, 1, 2,
+ 0, 3, 4,
+ }
+
+ if ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).Frc != 101) {
+ return 5
+ } else {
+
+ return *(*int32)(unsafe.Pointer(bp /* &aRes[0] */ + uintptr((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage)*4))
+ }
+ return int32(0)
+}
+
+func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:200163:16: */
+ var rc int32 = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
+ if rc == 101 {
+ return 0
+ }
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 1 {
+
+ if rc == 0 {
+ rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+15581 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0))
+ }
+ }
+
+ // Sync the db file
+ if (rc == 0) && ((*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 4) {
+ var pDb uintptr = (*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal
+ rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pDb)).FpMethods + 40 /* &.xSync */))))(tls, pDb, 0x00002)
+ }
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
+ rbuSaveState(tls, p, (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage)
+ rc = (*Sqlite3rbu)(unsafe.Pointer(p)).Frc
+
+ if (*Sqlite3rbu)(unsafe.Pointer(p)).FeStage == 1 {
+
+ if rc == 0 {
+ rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, ts+15581 /* "COMMIT" */, uintptr(0), uintptr(0), uintptr(0))
+ }
+ if rc == 0 {
+ var zBegin uintptr
+ if (*Sqlite3rbu)(unsafe.Pointer((p))).FzTarget == uintptr(0) {
+ zBegin = ts + 15566 /* "BEGIN" */
+ } else {
+ zBegin = ts + 35450 /* "BEGIN IMMEDIATE" */
+ }
+ rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0))
+ }
+ if rc == 0 {
+ rc = Xsqlite3_exec(tls, (*Sqlite3rbu)(unsafe.Pointer(p)).FdbMain, ts+35450 /* "BEGIN IMMEDIATE" */, uintptr(0), uintptr(0), uintptr(0))
+ }
+ }
+
+ (*Sqlite3rbu)(unsafe.Pointer(p)).Frc = rc
+ return rc
+}
+
+// *************************************************************************
+//
+// Beginning of RBU VFS shim methods. The VFS shim modifies the behaviour
+// of a standard VFS in the following ways:
+//
+// 1. Whenever the first page of a main database file is read or
+// written, the value of the change-counter cookie is stored in
+// rbu_file.iCookie. Similarly, the value of the "write-version"
+// database header field is stored in rbu_file.iWriteVer. This ensures
+// that the values are always trustworthy within an open transaction.
+//
+// 2. Whenever an SQLITE_OPEN_WAL file is opened, the (rbu_file.pWalFd)
+// member variable of the associated database file descriptor is set
+// to point to the new file. A mutex protected linked list of all main
+// db fds opened using a particular RBU VFS is maintained at
+// rbu_vfs.pMain to facilitate this.
+//
+// 3. Using a new file-control "SQLITE_FCNTL_RBU", a main db rbu_file
+// object can be marked as the target database of an RBU update. This
+// turns on the following extra special behaviour:
+//
+// 3a. If xAccess() is called to check if there exists a *-wal file
+// associated with an RBU target database currently in RBU_STAGE_OAL
+// stage (preparing the *-oal file), the following special handling
+// applies:
+//
+// * if the *-wal file does exist, return SQLITE_CANTOPEN. An RBU
+// target database may not be in wal mode already.
+//
+// * if the *-wal file does not exist, set the output parameter to
+// non-zero (to tell SQLite that it does exist) anyway.
+//
+// Then, when xOpen() is called to open the *-wal file associated with
+// the RBU target in RBU_STAGE_OAL stage, instead of opening the *-wal
+// file, the rbu vfs opens the corresponding *-oal file instead.
+//
+// 3b. The *-shm pages returned by xShmMap() for a target db file in
+// RBU_STAGE_OAL mode are actually stored in heap memory. This is to
+// avoid creating a *-shm file on disk. Additionally, xShmLock() calls
+// are no-ops on target database files in RBU_STAGE_OAL mode. This is
+// because assert() statements in some VFS implementations fail if
+// xShmLock() is called before xShmMap().
+//
+// 3c. If an EXCLUSIVE lock is attempted on a target database file in any
+// mode except RBU_STAGE_DONE (all work completed and checkpointed), it
+// fails with an SQLITE_BUSY error. This is to stop RBU connections
+// from automatically checkpointing a *-wal (or *-oal) file from within
+// sqlite3_close().
+//
+// 3d. In RBU_STAGE_CAPTURE mode, all xRead() calls on the wal file, and
+// all xWrite() calls on the target database file perform no IO.
+// Instead the frame and page numbers that would be read and written
+// are recorded. Additionally, successful attempts to obtain exclusive
+// xShmLock() WRITER, CHECKPOINTER and READ0 locks on the target
+// database file are recorded. xShmLock() calls to unlock the same
+// locks are no-ops (so that once obtained, these locks are never
+// relinquished). Finally, calls to xSync() on the target database
+// file fail with SQLITE_INTERNAL errors.
+
+func rbuUnlockShm(tls *libc.TLS, p uintptr) { /* sqlite3.c:200256:13: */
+
+ if (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 {
+ var xShmLock uintptr = (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock
+ var i int32
+ for i = 0; i < 8; i++ {
+ if ((U32(int32(1) << i)) & (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FmLock) != 0 {
+ (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&xShmLock)))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, i, 1, (1 | 8))
+ }
+ }
+ (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FmLock = U32(0)
+ }
+}
+
+//
+func rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Sqlite3_int64) int32 { /* sqlite3.c:200272:12: */
+ var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(pFd)).FpRbu
+ var nDiff I64 = (nNew - (*Rbu_file)(unsafe.Pointer(pFd)).Fsz)
+ *(*I64)(unsafe.Pointer(pRbu + 360 /* &.szTemp */)) += (nDiff)
+ (*Rbu_file)(unsafe.Pointer(pFd)).Fsz = nNew
+
+ if ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTemp > (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit) {
+ return 13
+ }
+ return 0
+}
+
+// Add an item to the main-db lists, if it is not already present.
+//
+// There are two main-db lists. One for all file descriptors, and one
+// for all file descriptors with rbu_file.pDb!=0. If the argument has
+// rbu_file.pDb!=0, then it is assumed to already be present on the
+// main list and is only added to the pDb!=0 list.
+func rbuMainlistAdd(tls *libc.TLS, p uintptr) { /* sqlite3.c:200290:13: */
+ var pRbuVfs uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs
+ var pIter uintptr
+
+ Xsqlite3_mutex_enter(tls, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex)
+ if (*Rbu_file)(unsafe.Pointer(p)).FpRbu == uintptr(0) {
+ for pIter = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain; pIter != 0; pIter = (*Rbu_file)(unsafe.Pointer(pIter)).FpMainNext {
+ }
+ (*Rbu_file)(unsafe.Pointer(p)).FpMainNext = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain
+ (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain = p
+ } else {
+ for pIter = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu; (pIter != 0) && (pIter != p); pIter = (*Rbu_file)(unsafe.Pointer(pIter)).FpMainRbuNext {
+ }
+ if pIter == uintptr(0) {
+ (*Rbu_file)(unsafe.Pointer(p)).FpMainRbuNext = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu
+ (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu = p
+ }
+ }
+ Xsqlite3_mutex_leave(tls, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex)
+}
+
+// Remove an item from the main-db lists.
+func rbuMainlistRemove(tls *libc.TLS, p uintptr) { /* sqlite3.c:200312:13: */
+ var pp uintptr
+ Xsqlite3_mutex_enter(tls, (*Rbu_vfs)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs)).Fmutex)
+ for pp = ((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs + 192 /* &.pMain */); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && (*(*uintptr)(unsafe.Pointer(pp)) != p); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 88 /* &.pMainNext */) {
+ }
+ if *(*uintptr)(unsafe.Pointer(pp)) != 0 {
+ *(*uintptr)(unsafe.Pointer(pp)) = (*Rbu_file)(unsafe.Pointer(p)).FpMainNext
+ }
+ (*Rbu_file)(unsafe.Pointer(p)).FpMainNext = uintptr(0)
+ for pp = ((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs + 200 /* &.pMainRbu */); (*(*uintptr)(unsafe.Pointer(pp)) != 0) && (*(*uintptr)(unsafe.Pointer(pp)) != p); pp = (*(*uintptr)(unsafe.Pointer(pp)) + 96 /* &.pMainRbuNext */) {
+ }
+ if *(*uintptr)(unsafe.Pointer(pp)) != 0 {
+ *(*uintptr)(unsafe.Pointer(pp)) = (*Rbu_file)(unsafe.Pointer(p)).FpMainRbuNext
+ }
+ (*Rbu_file)(unsafe.Pointer(p)).FpMainRbuNext = uintptr(0)
+ Xsqlite3_mutex_leave(tls, (*Rbu_vfs)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs)).Fmutex)
+}
+
+// Given that zWal points to a buffer containing a wal file name passed to
+// either the xOpen() or xAccess() VFS method, search the main-db list for
+// a file-handle opened by the same database connection on the corresponding
+// database file.
+//
+// If parameter bRbu is true, only search for file-descriptors with
+// rbu_file.pDb!=0.
+func rbuFindMaindb(tls *libc.TLS, pRbuVfs uintptr, zWal uintptr, bRbu int32) uintptr { /* sqlite3.c:200333:17: */
+ var pDb uintptr
+ Xsqlite3_mutex_enter(tls, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex)
+ if bRbu != 0 {
+ for pDb = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMainRbu; (pDb != 0) && ((*Rbu_file)(unsafe.Pointer(pDb)).FzWal != zWal); pDb = (*Rbu_file)(unsafe.Pointer(pDb)).FpMainRbuNext {
+ }
+ } else {
+ for pDb = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpMain; (pDb != 0) && ((*Rbu_file)(unsafe.Pointer(pDb)).FzWal != zWal); pDb = (*Rbu_file)(unsafe.Pointer(pDb)).FpMainNext {
+ }
+ }
+ Xsqlite3_mutex_leave(tls, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fmutex)
+ return pDb
+}
+
+// Close an rbu file.
+func rbuVfsClose(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:200348:12: */
+ var p uintptr = pFile
+ var rc int32
+ var i int32
+
+ // Free the contents of the apShm[] array. And the array itself.
+ for i = 0; i < (*Rbu_file)(unsafe.Pointer(p)).FnShm; i++ {
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FapShm + uintptr(i)*8)))
+ }
+ Xsqlite3_free(tls, (*Rbu_file)(unsafe.Pointer(p)).FapShm)
+ (*Rbu_file)(unsafe.Pointer(p)).FapShm = uintptr(0)
+ Xsqlite3_free(tls, (*Rbu_file)(unsafe.Pointer(p)).FzDel)
+
+ if ((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & 0x00000100) != 0 {
+ rbuMainlistRemove(tls, p)
+ rbuUnlockShm(tls, p)
+ (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 128 /* &.xShmUnmap */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, 0)
+ } else if (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & 0x00000008) != 0) && ((*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0) {
+ rbuUpdateTempSize(tls, p, int64(0))
+ }
+
+ // Close the underlying file handle
+ rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 8 /* &.xClose */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal)
+ return rc
+}
+
+// Read and return an unsigned 32-bit big-endian integer from the buffer
+// passed as the only argument.
+func rbuGetU32(tls *libc.TLS, aBuf uintptr) U32 { /* sqlite3.c:200381:12: */
+ return ((((U32(*(*U8)(unsafe.Pointer(aBuf + uintptr(0)))) << 24) +
+ (U32(*(*U8)(unsafe.Pointer(aBuf + uintptr(1)))) << 16)) +
+ (U32(*(*U8)(unsafe.Pointer(aBuf + uintptr(2)))) << 8)) +
+ (U32(*(*U8)(unsafe.Pointer(aBuf + uintptr(3))))))
+}
+
+// Write an unsigned 32-bit value in big-endian format to the supplied
+// buffer.
+func rbuPutU32(tls *libc.TLS, aBuf uintptr, iVal U32) { /* sqlite3.c:200392:13: */
+ *(*U8)(unsafe.Pointer(aBuf + uintptr(0))) = (U8((iVal >> 24) & U32(0xFF)))
+ *(*U8)(unsafe.Pointer(aBuf + uintptr(1))) = (U8((iVal >> 16) & U32(0xFF)))
+ *(*U8)(unsafe.Pointer(aBuf + uintptr(2))) = (U8((iVal >> 8) & U32(0xFF)))
+ *(*U8)(unsafe.Pointer(aBuf + uintptr(3))) = (U8((iVal >> 0) & U32(0xFF)))
+}
+
+func rbuPutU16(tls *libc.TLS, aBuf uintptr, iVal U16) { /* sqlite3.c:200399:13: */
+ *(*U8)(unsafe.Pointer(aBuf + uintptr(0))) = (U8((int32(iVal) >> 8) & 0xFF))
+ *(*U8)(unsafe.Pointer(aBuf + uintptr(1))) = (U8((int32(iVal) >> 0) & 0xFF))
+}
+
+// Read data from an rbuVfs-file.
+func rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:200407:12: */
+ var p uintptr = pFile
+ var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu
+ var rc int32
+
+ if (pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == 3) {
+
+ rc = rbuCaptureWalRead(tls, (*Rbu_file)(unsafe.Pointer(p)).FpRbu, iOfst, iAmt)
+ } else {
+ if (((pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == 1)) &&
+ (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & 0x00080000) != 0)) &&
+ (iOfst >= (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz) {
+ rc = 0
+ libc.Xmemset(tls, zBuf, 0, uint64(iAmt))
+ } else {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 16 /* &.xRead */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst)
+ // If this is being called to read the first page of the target
+ // database as part of an rbu vacuum operation, synthesize the
+ // contents of the first page if it does not yet exist. Otherwise,
+ // SQLite will not check for a *-wal file.
+ if (((((pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer((pRbu))).FzTarget == uintptr(0))) &&
+ (rc == (10 | (int32(2) << 8)))) && (iOfst == int64(0))) &&
+ (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & 0x00000100) != 0)) &&
+ ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).Frc == 0) {
+ var pFd uintptr = (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpRbuFd
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer(pFd)).FpMethods + 16 /* &.xRead */))))(tls, pFd, zBuf, iAmt, iOfst)
+ if rc == 0 {
+ var aBuf uintptr = zBuf
+ var iRoot U32
+ if rbuGetU32(tls, (aBuf+uintptr(52))) != 0 {
+ iRoot = uint32(1)
+ } else {
+ iRoot = uint32(0)
+ }
+ rbuPutU32(tls, (aBuf + uintptr(52)), iRoot) // largest root page number
+ rbuPutU32(tls, (aBuf + uintptr(36)), uint32(0)) // number of free pages
+ rbuPutU32(tls, (aBuf + uintptr(32)), uint32(0)) // first page on free list trunk
+ rbuPutU32(tls, (aBuf + uintptr(28)), uint32(1)) // size of db file in pages
+ rbuPutU32(tls, (aBuf + uintptr(24)), ((*Rbu_file)(unsafe.Pointer((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpRbuFd)).FiCookie + U32(1))) // Change counter
+
+ if iAmt > 100 {
+ libc.Xmemset(tls, (aBuf + uintptr(100)), 0, (uint64(iAmt - 100)))
+ rbuPutU16(tls, (aBuf + uintptr(105)), (uint16(iAmt & 0xFFFF)))
+ *(*U8)(unsafe.Pointer(aBuf + uintptr(100))) = U8(0x0D)
+ }
+ }
+ }
+ }
+ if ((rc == 0) && (iOfst == int64(0))) && (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & 0x00000100) != 0) {
+ // These look like magic numbers. But they are stable, as they are part
+ // of the definition of the SQLite file format, which may not change.
+ var pBuf uintptr = zBuf
+ (*Rbu_file)(unsafe.Pointer(p)).FiCookie = rbuGetU32(tls, (pBuf + uintptr(24)))
+ (*Rbu_file)(unsafe.Pointer(p)).FiWriteVer = *(*U8)(unsafe.Pointer(pBuf + uintptr(19)))
+ }
+ }
+ return rc
+}
+
+// Write data to an rbuVfs-file.
+func rbuVfsWrite(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst Sqlite_int64) int32 { /* sqlite3.c:200473:12: */
+ var p uintptr = pFile
+ var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu
+ var rc int32
+
+ if (pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == 3) {
+
+ rc = rbuCaptureDbWrite(tls, (*Rbu_file)(unsafe.Pointer(p)).FpRbu, iOfst)
+ } else {
+ if pRbu != 0 {
+ if (((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == 1) &&
+ (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & 0x00080000) != 0)) &&
+ (iOfst >= (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz) {
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FiOalSz = (Sqlite_int64(iAmt) + iOfst)
+ } else if ((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & 0x00000008) != 0 {
+ var szNew I64 = (Sqlite_int64(iAmt) + iOfst)
+ if szNew > (*Rbu_file)(unsafe.Pointer(p)).Fsz {
+ rc = rbuUpdateTempSize(tls, p, szNew)
+ if rc != 0 {
+ return rc
+ }
+ }
+ }
+ }
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 24 /* &.xWrite */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst)
+ if ((rc == 0) && (iOfst == int64(0))) && (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & 0x00000100) != 0) {
+ // These look like magic numbers. But they are stable, as they are part
+ // of the definition of the SQLite file format, which may not change.
+ var pBuf uintptr = zBuf
+ (*Rbu_file)(unsafe.Pointer(p)).FiCookie = rbuGetU32(tls, (pBuf + uintptr(24)))
+ (*Rbu_file)(unsafe.Pointer(p)).FiWriteVer = *(*U8)(unsafe.Pointer(pBuf + uintptr(19)))
+ }
+ }
+ return rc
+}
+
+// Truncate an rbuVfs-file.
+func rbuVfsTruncate(tls *libc.TLS, pFile uintptr, size Sqlite_int64) int32 { /* sqlite3.c:200516:12: */
+ var p uintptr = pFile
+ if (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & 0x00000008) != 0) && ((*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0) {
+ var rc int32 = rbuUpdateTempSize(tls, p, size)
+ if rc != 0 {
+ return rc
+ }
+ }
+ return (*(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 32 /* &.xTruncate */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, size)
+}
+
+// Sync an rbuVfs-file.
+func rbuVfsSync(tls *libc.TLS, pFile uintptr, flags int32) int32 { /* sqlite3.c:200528:12: */
+ var p uintptr = pFile
+ if ((*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FeStage == 3) {
+ if ((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & 0x00000100) != 0 {
+ return 2
+ }
+ return 0
+ }
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 40 /* &.xSync */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, flags)
+}
+
+// Return the current file-size of an rbuVfs-file.
+func rbuVfsFileSize(tls *libc.TLS, pFile uintptr, pSize uintptr) int32 { /* sqlite3.c:200542:12: */
+ var p uintptr = pFile
+ var rc int32
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 48 /* &.xFileSize */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, pSize)
+
+ // If this is an RBU vacuum operation and this is the target database,
+ // pretend that it has at least one page. Otherwise, SQLite will not
+ // check for the existance of a *-wal file. rbuVfsRead() contains
+ // similar logic.
+ if ((((rc == 0) && (*(*Sqlite_int64)(unsafe.Pointer(pSize)) == int64(0))) &&
+ ((*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0)) && ((*Sqlite3rbu)(unsafe.Pointer(((*Rbu_file)(unsafe.Pointer(p)).FpRbu))).FzTarget == uintptr(0))) &&
+ (((*Rbu_file)(unsafe.Pointer(p)).FopenFlags & 0x00000100) != 0) {
+ *(*Sqlite_int64)(unsafe.Pointer(pSize)) = int64(1024)
+ }
+ return rc
+}
+
+// Lock an rbuVfs-file.
+func rbuVfsLock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:200563:12: */
+ var p uintptr = pFile
+ var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu
+ var rc int32 = 0
+
+ if (eLock == 4) &&
+ (((*Rbu_file)(unsafe.Pointer(p)).FbNolock != 0) || ((pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage != 5))) {
+ // Do not allow EXCLUSIVE locks. Preventing SQLite from taking this
+ // prevents it from checkpointing the database from sqlite3_close().
+ rc = 5
+ } else {
+ rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 56 /* &.xLock */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, eLock)
+ }
+
+ return rc
+}
+
+// Unlock an rbuVfs-file.
+func rbuVfsUnlock(tls *libc.TLS, pFile uintptr, eLock int32) int32 { /* sqlite3.c:200585:12: */
+ var p uintptr = pFile
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 64 /* &.xUnlock */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, eLock)
+}
+
+// Check if another file-handle holds a RESERVED lock on an rbuVfs-file.
+func rbuVfsCheckReservedLock(tls *libc.TLS, pFile uintptr, pResOut uintptr) int32 { /* sqlite3.c:200593:12: */
+ var p uintptr = pFile
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 72 /* &.xCheckReservedLock */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, pResOut)
+}
+
+// File control method. For custom operations on an rbuVfs-file.
+func rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) int32 { /* sqlite3.c:200601:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var p uintptr = pFile
+ var xControl uintptr = (*sqlite3_io_methods)(unsafe.Pointer((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxFileControl
+ var rc int32
+
+ if op == 26 {
+ var pRbu uintptr = pArg
+
+ // First try to find another RBU vfs lower down in the vfs stack. If
+ // one is found, this vfs will operate in pass-through mode. The lower
+ // level vfs will do the special RBU handling.
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&xControl)))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, op, pArg)
+
+ if rc == 12 {
+ // Now search for a zipvfs instance lower down in the VFS stack. If
+ // one is found, this is an error.
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* dummy */)) = uintptr(0)
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&xControl)))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, 25, bp+16 /* &dummy */)
+ if rc == 0 {
+ rc = 1
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, ts+35525 /* "rbu/zipvfs setup..." */, 0)
+ } else if rc == 12 {
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p
+ (*Rbu_file)(unsafe.Pointer(p)).FpRbu = pRbu
+ rbuMainlistAdd(tls, p)
+ if (*Rbu_file)(unsafe.Pointer(p)).FpWalFd != 0 {
+ (*Rbu_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpWalFd)).FpRbu = pRbu
+ }
+ rc = 0
+ }
+ }
+ return rc
+ } else if op == 5149216 {
+ var pRbu uintptr = pArg
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FnRbu++
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FpRbuFd = p
+ (*Rbu_file)(unsafe.Pointer(p)).FbNolock = U8(1)
+ }
+
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&xControl)))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, op, pArg)
+ if (rc == 0) && (op == 12) {
+ var pRbuVfs uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbuVfs
+ var zIn uintptr = *(*uintptr)(unsafe.Pointer(pArg))
+ var zOut uintptr = Xsqlite3_mprintf(tls, ts+35548 /* "rbu(%s)/%z" */, libc.VaList(bp, (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn))
+ *(*uintptr)(unsafe.Pointer(pArg)) = zOut
+ if zOut == uintptr(0) {
+ rc = 7
+ }
+ }
+
+ return rc
+}
+
+// Return the sector-size in bytes for an rbuVfs-file.
+func rbuVfsSectorSize(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:200657:12: */
+ var p uintptr = pFile
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 88 /* &.xSectorSize */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal)
+}
+
+// Return the device characteristic flags supported by an rbuVfs-file.
+func rbuVfsDeviceCharacteristics(tls *libc.TLS, pFile uintptr) int32 { /* sqlite3.c:200665:12: */
+ var p uintptr = pFile
+ return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 96 /* &.xDeviceCharacteristics */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal)
+}
+
+// Take or release a shared-memory lock.
+func rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int32) int32 { /* sqlite3.c:200673:12: */
+ var p uintptr = pFile
+ var pRbu uintptr = (*Rbu_file)(unsafe.Pointer(p)).FpRbu
+ var rc int32 = 0
+
+ if (pRbu != 0) && (((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == 1) || ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == 2)) {
+ // Magic number 1 is the WAL_CKPT_LOCK lock. Preventing SQLite from
+ // taking this lock also prevents any checkpoints from occurring.
+ // todo: really, it's not clear why this might occur, as
+ // wal_autocheckpoint ought to be turned off.
+ if (ofst == 1) && (n == 1) {
+ rc = 5
+ }
+ } else {
+ var bCapture int32 = 0
+ if (pRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer(pRbu)).FeStage == 3) {
+ bCapture = 1
+ }
+
+ if (bCapture == 0) || (0 == (flags & 1)) {
+ rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 112 /* &.xShmLock */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, ofst, n, flags)
+ if (bCapture != 0) && (rc == 0) {
+ *(*U32)(unsafe.Pointer(pRbu + 316 /* &.mLock */)) |= (U32(int32(1) << ofst))
+ }
+ }
+ }
+
+ return rc
+}
+
+// Obtain a pointer to a mapping of a single 32KiB page of the *-shm file.
+func rbuVfsShmMap(tls *libc.TLS, pFile uintptr, iRegion int32, szRegion int32, isWrite int32, pp uintptr) int32 { /* sqlite3.c:200709:12: */
+ var p uintptr = pFile
+ var rc int32 = 0
+ var eStage int32 = func() int32 {
+ if (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 {
+ return (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FeStage
+ }
+ return 0
+ }()
+
+ // If not in RBU_STAGE_OAL, allow this call to pass through. Or, if this
+ // rbu is in the RBU_STAGE_OAL state, use heap memory for *-shm space
+ // instead of a file on disk.
+
+ if eStage == 1 {
+ var nByte Sqlite3_int64 = (Sqlite3_int64((uint64(iRegion + 1)) * uint64(unsafe.Sizeof(uintptr(0)))))
+ var apNew uintptr = Xsqlite3_realloc64(tls, (*Rbu_file)(unsafe.Pointer(p)).FapShm, uint64(nByte))
+
+ // This is an RBU connection that uses its own heap memory for the
+ // pages of the *-shm file. Since no other process can have run
+ // recovery, the connection must request *-shm pages in order
+ // from start to finish.
+
+ if apNew == uintptr(0) {
+ rc = 7
+ } else {
+ libc.Xmemset(tls, (apNew + uintptr((*Rbu_file)(unsafe.Pointer(p)).FnShm)*8), 0, (uint64(unsafe.Sizeof(uintptr(0))) * (uint64((1 + iRegion) - (*Rbu_file)(unsafe.Pointer(p)).FnShm))))
+ (*Rbu_file)(unsafe.Pointer(p)).FapShm = apNew
+ (*Rbu_file)(unsafe.Pointer(p)).FnShm = (iRegion + 1)
+ }
+
+ if rc == 0 {
+ var pNew uintptr = Xsqlite3_malloc64(tls, uint64(szRegion))
+ if pNew == uintptr(0) {
+ rc = 7
+ } else {
+ libc.Xmemset(tls, pNew, 0, uint64(szRegion))
+ *(*uintptr)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FapShm + uintptr(iRegion)*8)) = pNew
+ }
+ }
+
+ if rc == 0 {
+ *(*uintptr)(unsafe.Pointer(pp)) = *(*uintptr)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FapShm + uintptr(iRegion)*8))
+ } else {
+ *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
+ }
+ } else {
+
+ rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 104 /* &.xShmMap */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, iRegion, szRegion, isWrite, pp)
+ }
+
+ return rc
+}
+
+// Memory barrier.
+func rbuVfsShmBarrier(tls *libc.TLS, pFile uintptr) { /* sqlite3.c:200767:13: */
+ var p uintptr = pFile
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 120 /* &.xShmBarrier */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal)
+}
+
+// The xShmUnmap method.
+func rbuVfsShmUnmap(tls *libc.TLS, pFile uintptr, delFlag int32) int32 { /* sqlite3.c:200775:12: */
+ var p uintptr = pFile
+ var rc int32 = 0
+ var eStage int32 = func() int32 {
+ if (*Rbu_file)(unsafe.Pointer(p)).FpRbu != 0 {
+ return (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpRbu)).FeStage
+ }
+ return 0
+ }()
+
+ if (eStage == 1) || (eStage == 2) {
+ } else {
+ // Release the checkpointer and writer locks
+ rbuUnlockShm(tls, p)
+ rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods + 128 /* &.xShmUnmap */))))(tls, (*Rbu_file)(unsafe.Pointer(p)).FpReal, delFlag)
+ }
+ return rc
+}
+
+// Open an rbu file handle.
+func rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flags int32, pOutFlags uintptr) int32 { /* sqlite3.c:200794:12: */
+ var pRbuVfs uintptr = pVfs
+ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRealVfs
+ var pFd uintptr = pFile
+ var rc int32 = 0
+ var zOpen uintptr = zName
+ var oflags int32 = flags
+
+ libc.Xmemset(tls, pFd, 0, uint64(unsafe.Sizeof(Rbu_file{})))
+ (*Rbu_file)(unsafe.Pointer(pFd)).FpReal = (pFd + uintptr(1)*104)
+ (*Rbu_file)(unsafe.Pointer(pFd)).FpRbuVfs = pRbuVfs
+ (*Rbu_file)(unsafe.Pointer(pFd)).FopenFlags = flags
+ if zName != 0 {
+ if (flags & 0x00000100) != 0 {
+ // A main database has just been opened. The following block sets
+ // (pFd->zWal) to point to a buffer owned by SQLite that contains
+ // the name of the *-wal file this db connection will use. SQLite
+ // happens to pass a pointer to this buffer when using xAccess()
+ // or xOpen() to operate on the *-wal file.
+ (*Rbu_file)(unsafe.Pointer(pFd)).FzWal = Xsqlite3_filename_wal(tls, zName)
+ } else if (flags & 0x00080000) != 0 {
+ var pDb uintptr = rbuFindMaindb(tls, pRbuVfs, zName, 0)
+ if pDb != 0 {
+ if ((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu != 0) && ((*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == 1) {
+ // This call is to open a *-wal file. Intead, open the *-oal. This
+ // code ensures that the string passed to xOpen() is terminated by a
+ // pair of '\0' bytes in case the VFS attempts to extract a URI
+ // parameter from it.
+ var zBase uintptr = zName
+ var nCopy Size_t
+ var zCopy uintptr
+ if (*Sqlite3rbu)(unsafe.Pointer(((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu))).FzTarget == uintptr(0) {
+ zBase = Xsqlite3_db_filename(tls, (*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, ts+8314 /* "main" */)
+ zBase = Xsqlite3_filename_wal(tls, zBase)
+ }
+ nCopy = libc.Xstrlen(tls, zBase)
+ zCopy = Xsqlite3_malloc64(tls, (uint64(nCopy + uint64(2))))
+ if zCopy != 0 {
+ libc.Xmemcpy(tls, zCopy, zBase, nCopy)
+ *(*int8)(unsafe.Pointer(zCopy + uintptr((nCopy - uint64(3))))) = int8('o')
+ *(*int8)(unsafe.Pointer(zCopy + uintptr(nCopy))) = int8(0)
+ *(*int8)(unsafe.Pointer(zCopy + uintptr((nCopy + uint64(1))))) = int8(0)
+ zOpen = libc.AssignPtrUintptr(pFd+64 /* &.zDel */, zCopy)
+ } else {
+ rc = 7
+ }
+ (*Rbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Rbu_file)(unsafe.Pointer(pDb)).FpRbu
+ }
+ (*Rbu_file)(unsafe.Pointer(pDb)).FpWalFd = pFd
+ }
+ }
+ } else {
+ (*Rbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu
+ }
+
+ if ((oflags & 0x00000100) != 0) &&
+ (Xsqlite3_uri_boolean(tls, zName, ts+35559 /* "rbu_memory" */, 0) != 0) {
+
+ oflags = ((((0x00000200 | 0x00000002) | 0x00000004) | 0x00000010) | 0x00000008)
+ zOpen = uintptr(0)
+ }
+
+ if rc == 0 {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pRealVfs + 40 /* &.xOpen */))))(tls, pRealVfs, zOpen, (*Rbu_file)(unsafe.Pointer(pFd)).FpReal, oflags, pOutFlags)
+ }
+ if (*Sqlite3_file)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pFd)).FpReal)).FpMethods != 0 {
+ // The xOpen() operation has succeeded. Set the sqlite3_file.pMethods
+ // pointer and, if the file is a main database file, link it into the
+ // mutex protected linked list of all such files.
+ (*Sqlite3_file)(unsafe.Pointer(pFile)).FpMethods = uintptr(unsafe.Pointer(&rbuvfs_io_methods))
+ if (flags & 0x00000100) != 0 {
+ rbuMainlistAdd(tls, pFd)
+ }
+ } else {
+ Xsqlite3_free(tls, (*Rbu_file)(unsafe.Pointer(pFd)).FzDel)
+ }
+
+ return rc
+}
+
+var rbuvfs_io_methods = Sqlite3_io_methods{FiVersion: 2, FxClose: // iVersion
+0, FxRead:// xClose
+0, FxWrite:// xRead
+0, FxTruncate:// xWrite
+0, FxSync:// xTruncate
+0, FxFileSize:// xSync
+0, FxLock:// xFileSize
+0, FxUnlock:// xLock
+0, FxCheckReservedLock:// xUnlock
+0, FxFileControl:// xCheckReservedLock
+0, FxSectorSize:// xFileControl
+0, FxDeviceCharacteristics:// xSectorSize
+0, FxShmMap:// xDeviceCharacteristics
+0, FxShmLock:// xShmMap
+0, FxShmBarrier:// xShmLock
+0, FxShmUnmap:// xShmBarrier
+0, FxFetch:// xShmUnmap
+uintptr(0), FxUnfetch: uintptr(0), // xFetch, xUnfetch
+} /* sqlite3.c:200801:29 */
+
+// Delete the file located at zPath.
+func rbuVfsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32 { /* sqlite3.c:200906:12: */
+ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer((pRealVfs + 48 /* &.xDelete */))))(tls, pRealVfs, zPath, dirSync)
+}
+
+// Test for access permissions. Return true if the requested permission
+// is available, or false otherwise.
+func rbuVfsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32 { /* sqlite3.c:200915:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pRbuVfs uintptr = pVfs
+ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRealVfs
+ var rc int32
+
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pRealVfs + 56 /* &.xAccess */))))(tls, pRealVfs, zPath, flags, pResOut)
+
+ // If this call is to check if a *-wal file associated with an RBU target
+ // database connection exists, and the RBU update is in RBU_STAGE_OAL,
+ // the following special handling is activated:
+ //
+ // a) if the *-wal file does exist, return SQLITE_CANTOPEN. This
+ // ensures that the RBU extension never tries to update a database
+ // in wal mode, even if the first page of the database file has
+ // been damaged.
+ //
+ // b) if the *-wal file does not exist, claim that it does anyway,
+ // causing SQLite to call xOpen() to open it. This call will also
+ // be intercepted (see the rbuVfsOpen() function) and the *-oal
+ // file opened instead.
+ if (rc == 0) && (flags == 0) {
+ var pDb uintptr = rbuFindMaindb(tls, pRbuVfs, zPath, 1)
+ if (pDb != 0) && ((*Sqlite3rbu)(unsafe.Pointer((*Rbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == 1) {
+
+ if *(*int32)(unsafe.Pointer(pResOut)) != 0 {
+ rc = 14
+ } else {
+ *(*Sqlite3_int64)(unsafe.Pointer(bp /* sz */)) = int64(0)
+ rc = rbuVfsFileSize(tls, (pDb /* &.base */), bp /* &sz */)
+ *(*int32)(unsafe.Pointer(pResOut)) = (libc.Bool32(*(*Sqlite3_int64)(unsafe.Pointer(bp /* sz */)) > int64(0)))
+ }
+ }
+ }
+
+ return rc
+}
+
+// Populate buffer zOut with the full canonical pathname corresponding
+// to the pathname in zPath. zOut is guaranteed to point to a buffer
+// of at least (DEVSYM_MAX_PATHNAME+1) bytes.
+func rbuVfsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, zOut uintptr) int32 { /* sqlite3.c:200963:12: */
+ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pRealVfs + 64 /* &.xFullPathname */))))(tls, pRealVfs, zPath, nOut, zOut)
+}
+
+// Open the dynamic library located at zPath and return a handle.
+func rbuVfsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr { /* sqlite3.c:200977:13: */
+ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
+ return (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer((pRealVfs + 72 /* &.xDlOpen */))))(tls, pRealVfs, zPath)
+}
+
+// Populate the buffer zErrMsg (size nByte bytes) with a human readable
+// utf-8 string describing the most recent error encountered associated
+// with dynamic libraries.
+func rbuVfsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zErrMsg uintptr) { /* sqlite3.c:200987:13: */
+ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
+ (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer((pRealVfs + 80 /* &.xDlError */))))(tls, pRealVfs, nByte, zErrMsg)
+}
+
+// Return a pointer to the symbol zSymbol in the dynamic library pHandle.
+func rbuVfsDlSym(tls *libc.TLS, pVfs uintptr, pArg uintptr, zSym uintptr) uintptr { /* sqlite3.c:200995:13: */
+ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
+ return (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer((pRealVfs + 88 /* &.xDlSym */))))(tls, pRealVfs, pArg, zSym)
+}
+
+// Close the dynamic library handle pHandle.
+func rbuVfsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr) { /* sqlite3.c:201007:13: */
+ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pRealVfs + 96 /* &.xDlClose */))))(tls, pRealVfs, pHandle)
+}
+
+// Populate the buffer pointed to by zBufOut with nByte bytes of
+// random data.
+func rbuVfsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32 { /* sqlite3.c:201017:12: */
+ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pRealVfs + 104 /* &.xRandomness */))))(tls, pRealVfs, nByte, zBufOut)
+}
+
+// Sleep for nMicro microseconds. Return the number of microseconds
+// actually slept.
+func rbuVfsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32 { /* sqlite3.c:201026:12: */
+ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
+ return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pRealVfs + 112 /* &.xSleep */))))(tls, pRealVfs, nMicro)
+}
+
+// Return the current time as a Julian Day number in *pTimeOut.
+func rbuVfsCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32 { /* sqlite3.c:201034:12: */
+ var pRealVfs uintptr = (*Rbu_vfs)(unsafe.Pointer(pVfs)).FpRealVfs
+ return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pRealVfs + 120 /* &.xCurrentTime */))))(tls, pRealVfs, pTimeOut)
+}
+
+// No-op.
+func rbuVfsGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) int32 { /* sqlite3.c:201042:12: */
+ return 0
+}
+
+// Deregister and destroy an RBU vfs created by an earlier call to
+// sqlite3rbu_create_vfs().
+func Xsqlite3rbu_destroy_vfs(tls *libc.TLS, zName uintptr) { /* sqlite3.c:201050:17: */
+ var pVfs uintptr = Xsqlite3_vfs_find(tls, zName)
+ if (pVfs != 0) && ((*Sqlite3_vfs)(unsafe.Pointer(pVfs)).FxOpen == *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32
+ }{rbuVfsOpen}))) {
+ Xsqlite3_mutex_free(tls, (*Rbu_vfs)(unsafe.Pointer(pVfs)).Fmutex)
+ Xsqlite3_vfs_unregister(tls, pVfs)
+ Xsqlite3_free(tls, pVfs)
+ }
+}
+
+// Create an RBU VFS named zName that accesses the underlying file-system
+// via existing VFS zParent. The new object is registered as a non-default
+// VFS with SQLite before returning.
+func Xsqlite3rbu_create_vfs(tls *libc.TLS, zName uintptr, zParent uintptr) int32 { /* sqlite3.c:201064:16: */
+
+ var pNew uintptr = uintptr(0) // Newly allocated VFS
+ var rc int32 = 0
+ var nName Size_t
+ var nByte Size_t
+
+ nName = libc.Xstrlen(tls, zName)
+ nByte = ((uint64(unsafe.Sizeof(Rbu_vfs{})) + nName) + uint64(1))
+ pNew = Xsqlite3_malloc64(tls, uint64(nByte))
+ if pNew == uintptr(0) {
+ rc = 7
+ } else {
+ var pParent uintptr // Parent VFS
+ libc.Xmemset(tls, pNew, 0, nByte)
+ pParent = Xsqlite3_vfs_find(tls, zParent)
+ if pParent == uintptr(0) {
+ rc = 12
+ } else {
+ var zSpace uintptr
+ libc.Xmemcpy(tls, (pNew /* &.base */), uintptr(unsafe.Pointer(&vfs_template)), uint64(unsafe.Sizeof(Sqlite3_vfs{})))
+ (*Rbu_vfs)(unsafe.Pointer(pNew)).Fbase.FmxPathname = (*Sqlite3_vfs)(unsafe.Pointer(pParent)).FmxPathname
+ (*Rbu_vfs)(unsafe.Pointer(pNew)).Fbase.FszOsFile = (int32(uint64(unsafe.Sizeof(Rbu_file{})) + uint64((*Sqlite3_vfs)(unsafe.Pointer(pParent)).FszOsFile)))
+ (*Rbu_vfs)(unsafe.Pointer(pNew)).FpRealVfs = pParent
+ (*Rbu_vfs)(unsafe.Pointer(pNew)).Fbase.FzName = libc.AssignUintptr(&zSpace, (pNew + uintptr(1)*208))
+ libc.Xmemcpy(tls, zSpace, zName, nName)
+
+ // Allocate the mutex and register the new VFS (not as the default)
+ (*Rbu_vfs)(unsafe.Pointer(pNew)).Fmutex = Xsqlite3_mutex_alloc(tls, 1)
+ if (*Rbu_vfs)(unsafe.Pointer(pNew)).Fmutex == uintptr(0) {
+ rc = 7
+ } else {
+ rc = Xsqlite3_vfs_register(tls, (pNew /* &.base */), 0)
+ }
+ }
+
+ if rc != 0 {
+ Xsqlite3_mutex_free(tls, (*Rbu_vfs)(unsafe.Pointer(pNew)).Fmutex)
+ Xsqlite3_free(tls, pNew)
+ }
+ }
+
+ return rc
+}
+
+var vfs_template = Sqlite3_vfs{FiVersion: 1, FszOsFile: // iVersion
+0, FmxPathname:// szOsFile
+0, FpNext:// mxPathname
+uintptr(0), FzName:// pNext
+uintptr(0), FpAppData:// zName
+uintptr(0), FxOpen:// pAppData
+0, FxDelete:// xOpen
+0, FxAccess:// xDelete
+0, FxFullPathname:// xAccess
+0, FxDlOpen:// xFullPathname
+
+0, FxDlError:// xDlOpen
+0, FxDlSym:// xDlError
+0, FxDlClose:// xDlSym
+0, FxRandomness:// xDlClose
+
+0, FxSleep:// xRandomness
+0, FxCurrentTime:// xSleep
+0, FxGetLastError:// xCurrentTime
+0, FxCurrentTimeInt64:// xGetLastError
+uintptr(0), FxSetSystemCall:// xCurrentTimeInt64 (version 2)
+uintptr(0), FxGetSystemCall: uintptr(0), FxNextSystemCall: uintptr(0), // Unimplemented version 3 methods
+} /* sqlite3.c:201067:22 */
+
+// Configure the aggregate temp file size limit for this RBU handle.
+func Xsqlite3rbu_temp_size_limit(tls *libc.TLS, pRbu uintptr, n Sqlite3_int64) Sqlite3_int64 { /* sqlite3.c:201142:26: */
+ if n >= int64(0) {
+ (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit = n
+ }
+ return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit
+}
+
+func Xsqlite3rbu_temp_size(tls *libc.TLS, pRbu uintptr) Sqlite3_int64 { /* sqlite3.c:201149:26: */
+ return (*Sqlite3rbu)(unsafe.Pointer(pRbu)).FszTemp
+}
+
+//************************************************************************
+
//************* End of sqlite3rbu.c *****************************************
//************* Begin file dbstat.c *****************************************
// 2010 July 12
@@ -139916,7 +159905,7 @@ func Xsqlite3ConnectionClosed(tls *crt.TLS, db uintptr) { /* sqlite3.c:165258:21
// sort-order than its child page:
//
// '/1c2/000/' // Left-most child of 451st child of root
-var zDbstatSchema = *(*[258]int8)(unsafe.Pointer(ts + 23804 /* "CREATE TABLE x( ..." */)) /* sqlite3.c:200497:19 */
+var zDbstatSchema = *(*[258]int8)(unsafe.Pointer(ts + 35570 /* "CREATE TABLE x( ..." */)) /* sqlite3.c:201218:19 */
// Forward reference to data structured used in this module
type StatTable1 = struct {
@@ -139927,7 +159916,7 @@ type StatTable1 = struct {
}
// Forward reference to data structured used in this module
-type StatTable = StatTable1 /* sqlite3.c:200515:26 */
+type StatTable = StatTable1 /* sqlite3.c:201236:26 */
type StatCursor1 = struct {
Fbase Sqlite3_vtab_cursor
FpStmt uintptr
@@ -139949,7 +159938,7 @@ type StatCursor1 = struct {
FszPage I64
}
-type StatCursor = StatCursor1 /* sqlite3.c:200516:27 */
+type StatCursor = StatCursor1 /* sqlite3.c:201237:27 */
type StatPage1 = struct {
FiPgno U32
FpPg uintptr
@@ -139963,7 +159952,7 @@ type StatPage1 = struct {
FnMxPayload int32
}
-type StatPage = StatPage1 /* sqlite3.c:200517:25 */
+type StatPage = StatPage1 /* sqlite3.c:201238:25 */
type StatCell1 = struct {
FnLocal int32
FiChildPg U32
@@ -139973,10 +159962,10 @@ type StatCell1 = struct {
FiOvfl int32
}
-type StatCell = StatCell1 /* sqlite3.c:200518:25 */
+type StatCell = StatCell1 /* sqlite3.c:201239:25 */
// Connect to or create a new DBSTAT virtual table.
-func statConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:200586:12: */
+func statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:201307:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -139990,7 +159979,7 @@ func statConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt
Xsqlite3TokenInit(tls, bp+8 /* &nm */, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8)))
iDb = Xsqlite3FindDb(tls, db, bp+8 /* &nm */)
if iDb < 0 {
- *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+10308 /* "no such database..." */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+12992 /* "no such database..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))))
return 1
}
} else {
@@ -140006,7 +159995,7 @@ func statConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt
}
if rc == 0 {
- crt.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(StatTable{})))
+ libc.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(StatTable{})))
(*StatTable)(unsafe.Pointer(pTab)).Fdb = db
(*StatTable)(unsafe.Pointer(pTab)).FiDb = iDb
}
@@ -140016,7 +160005,7 @@ func statConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt
}
// Disconnect from or destroy the DBSTAT virtual table.
-func statDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* sqlite3.c:200629:12: */
+func statDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:201350:12: */
Xsqlite3_free(tls, pVtab)
return 0
}
@@ -140029,7 +160018,7 @@ func statDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* sqlite3.c:200629:12:
// 0x02 There is a name=? term in the WHERE clause
// 0x04 There is an aggregate=? term in the WHERE clause
// 0x08 Output should be ordered by name and path
-func statBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:200644:12: */
+func statBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:201365:12: */
var i int32
var iSchema int32 = -1
var iName int32 = -1
@@ -140067,16 +160056,16 @@ func statBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlit
}
i = 0
if iSchema >= 0 {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iSchema)*8)).FargvIndex = crt.PreIncInt32(&i, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iSchema)*8)).FargvIndex = libc.PreIncInt32(&i, 1)
(*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iSchema)*8)).Fomit = uint8(1)
*(*int32)(unsafe.Pointer(pIdxInfo + 40 /* &.idxNum */)) |= (0x01)
}
if iName >= 0 {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iName)*8)).FargvIndex = crt.PreIncInt32(&i, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iName)*8)).FargvIndex = libc.PreIncInt32(&i, 1)
*(*int32)(unsafe.Pointer(pIdxInfo + 40 /* &.idxNum */)) |= (0x02)
}
if iAgg >= 0 {
- (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iAgg)*8)).FargvIndex = crt.PreIncInt32(&i, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iAgg)*8)).FargvIndex = libc.PreIncInt32(&i, 1)
*(*int32)(unsafe.Pointer(pIdxInfo + 40 /* &.idxNum */)) |= (0x04)
}
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = 1.0
@@ -140099,7 +160088,7 @@ func statBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlit
}
// Open a new DBSTAT cursor.
-func statOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:200717:12: */
+func statOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:201438:12: */
var pTab uintptr = pVTab
var pCsr uintptr
@@ -140107,7 +160096,7 @@ func statOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.
if pCsr == uintptr(0) {
return 7
} else {
- crt.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(StatCursor{})))
+ libc.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(StatCursor{})))
(*StatCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab = pVTab
(*StatCursor)(unsafe.Pointer(pCsr)).FiDb = (*StatTable)(unsafe.Pointer(pTab)).FiDb
}
@@ -140116,7 +160105,7 @@ func statOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.
return 0
}
-func statClearCells(tls *crt.TLS, p uintptr) { /* sqlite3.c:200734:13: */
+func statClearCells(tls *libc.TLS, p uintptr) { /* sqlite3.c:201455:13: */
var i int32
if (*StatPage)(unsafe.Pointer(p)).FaCell != 0 {
for i = 0; i < (*StatPage)(unsafe.Pointer(p)).FnCell; i++ {
@@ -140128,14 +160117,14 @@ func statClearCells(tls *crt.TLS, p uintptr) { /* sqlite3.c:200734:13: */
(*StatPage)(unsafe.Pointer(p)).FaCell = uintptr(0)
}
-func statClearPage(tls *crt.TLS, p uintptr) { /* sqlite3.c:200746:13: */
+func statClearPage(tls *libc.TLS, p uintptr) { /* sqlite3.c:201467:13: */
statClearCells(tls, p)
Xsqlite3PagerUnref(tls, (*StatPage)(unsafe.Pointer(p)).FpPg)
Xsqlite3_free(tls, (*StatPage)(unsafe.Pointer(p)).FzPath)
- crt.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(StatPage{})))
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(StatPage{})))
}
-func statResetCsr(tls *crt.TLS, pCsr uintptr) { /* sqlite3.c:200753:13: */
+func statResetCsr(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:201474:13: */
var i int32
Xsqlite3_reset(tls, (*StatCursor)(unsafe.Pointer(pCsr)).FpStmt)
for i = 0; i < (int32(uint64(unsafe.Sizeof([32]StatPage{})) / uint64(unsafe.Sizeof(StatPage{})))); i++ {
@@ -140148,7 +160137,7 @@ func statResetCsr(tls *crt.TLS, pCsr uintptr) { /* sqlite3.c:200753:13: */
}
// Resize the space-used counters inside of the cursor
-func statResetCounts(tls *crt.TLS, pCsr uintptr) { /* sqlite3.c:200766:13: */
+func statResetCounts(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:201487:13: */
(*StatCursor)(unsafe.Pointer(pCsr)).FnCell = 0
(*StatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = 0
(*StatCursor)(unsafe.Pointer(pCsr)).FnUnused = int64(0)
@@ -140158,7 +160147,7 @@ func statResetCounts(tls *crt.TLS, pCsr uintptr) { /* sqlite3.c:200766:13: */
}
// Close a DBSTAT cursor.
-func statClose(tls *crt.TLS, pCursor uintptr) int32 { /* sqlite3.c:200778:12: */
+func statClose(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:201499:12: */
var pCsr uintptr = pCursor
statResetCsr(tls, pCsr)
Xsqlite3_finalize(tls, (*StatCursor)(unsafe.Pointer(pCsr)).FpStmt)
@@ -140169,7 +160158,7 @@ func statClose(tls *crt.TLS, pCursor uintptr) int32 { /* sqlite3.c:200778:12: */
// For a single cell on a btree page, compute the number of bytes of
// content (payload) stored on that page. That is to say, compute the
// number of bytes of content not found on overflow pages.
-func getLocalPayload(tls *crt.TLS, nUsable int32, flags U8, nTotal int32) int32 { /* sqlite3.c:200791:12: */
+func getLocalPayload(tls *libc.TLS, nUsable int32, flags U8, nTotal int32) int32 { /* sqlite3.c:201512:12: */
var nLocal int32
var nMinLocal int32
var nMaxLocal int32
@@ -140191,7 +160180,7 @@ func getLocalPayload(tls *crt.TLS, nUsable int32, flags U8, nTotal int32) int32
// Populate the StatPage object with information about the all
// cells found on the page currently under analysis.
-func statDecodePage(tls *crt.TLS, pBt uintptr, p uintptr) int32 { /* sqlite3.c:200816:12: */
+func statDecodePage(tls *libc.TLS, pBt uintptr, p uintptr) int32 { /* sqlite3.c:201537:12: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -140302,7 +160291,7 @@ __7:
return 7
__11:
;
- crt.Xmemset(tls, (*StatPage)(unsafe.Pointer(p)).FaCell, 0, ((uint64((*StatPage)(unsafe.Pointer(p)).FnCell + 1)) * uint64(unsafe.Sizeof(StatCell{}))))
+ libc.Xmemset(tls, (*StatPage)(unsafe.Pointer(p)).FaCell, 0, ((uint64((*StatPage)(unsafe.Pointer(p)).FnCell + 1)) * uint64(unsafe.Sizeof(StatCell{}))))
i = 0
__12:
@@ -140428,7 +160417,7 @@ statPageIsCorrupt:
// Populate the pCsr->iOffset and pCsr->szPage member variables. Based on
// the current value of pCsr->iPageno.
-func statSizeAndOffset(tls *crt.TLS, pCsr uintptr) { /* sqlite3.c:200931:13: */
+func statSizeAndOffset(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:201652:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -140455,7 +160444,7 @@ func statSizeAndOffset(tls *crt.TLS, pCsr uintptr) { /* sqlite3.c:200931:13: */
// Move a DBSTAT cursor to the next entry. Normally, the next
// entry will be the next page, but in aggregated mode (pCsr->isAgg!=0),
// the next entry is the next btree.
-func statNext(tls *crt.TLS, pCursor uintptr) int32 { /* sqlite3.c:200958:12: */
+func statNext(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:201679:12: */
bp := tls.Alloc(52)
defer tls.Free(52)
@@ -140509,7 +160498,7 @@ __5:
if !(!(int32((*StatCursor)(unsafe.Pointer(pCsr)).FisAgg) != 0)) {
goto __6
}
- (*StatPage)(unsafe.Pointer((pCsr + 24 /* &.aPage */) + uintptr(0)*64)).FzPath = crt.AssignUintptr(&z, Xsqlite3_mprintf(tls, ts+24062 /* "/" */, 0))
+ (*StatPage)(unsafe.Pointer((pCsr + 24 /* &.aPage */) + uintptr(0)*64)).FzPath = libc.AssignUintptr(&z, Xsqlite3_mprintf(tls, ts+35828 /* "/" */, 0))
if !(z == uintptr(0)) {
goto __7
}
@@ -140567,9 +160556,9 @@ __14:
}
(*StatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*StatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0)
(*StatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*U32)(unsafe.Pointer((*StatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4))
- (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 24064 /* "overflow" */
- (*StatCursor)(unsafe.Pointer(pCsr)).FzPath = crt.AssignUintptr(&z, Xsqlite3_mprintf(tls,
- ts+24073 /* "%s%.3x+%.6x" */, crt.VaList(bp, (*StatPage)(unsafe.Pointer(p)).FzPath, (*StatPage)(unsafe.Pointer(p)).FiCell, iOvfl)))
+ (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 35830 /* "overflow" */
+ (*StatCursor)(unsafe.Pointer(pCsr)).FzPath = libc.AssignUintptr(&z, Xsqlite3_mprintf(tls,
+ ts+35839 /* "%s%.3x+%.6x" */, libc.VaList(bp, (*StatPage)(unsafe.Pointer(p)).FzPath, (*StatPage)(unsafe.Pointer(p)).FiCell, iOvfl)))
if z == uintptr(0) {
return 7
}
@@ -140618,7 +160607,7 @@ __17:
goto __21
}
statResetCsr(tls, pCsr)
- return Xsqlite3CorruptError(tls, 201046)
+ return Xsqlite3CorruptError(tls, 201767)
__21:
;
@@ -140637,7 +160626,7 @@ __23:
if !(!(int32((*StatCursor)(unsafe.Pointer(pCsr)).FisAgg) != 0)) {
goto __24
}
- (*StatPage)(unsafe.Pointer(p + uintptr(1)*64)).FzPath = crt.AssignUintptr(&z, Xsqlite3_mprintf(tls, ts+24085 /* "%s%.3x/" */, crt.VaList(bp+24, (*StatPage)(unsafe.Pointer(p)).FzPath, (*StatPage)(unsafe.Pointer(p)).FiCell)))
+ (*StatPage)(unsafe.Pointer(p + uintptr(1)*64)).FzPath = libc.AssignUintptr(&z, Xsqlite3_mprintf(tls, ts+35851 /* "%s%.3x/" */, libc.VaList(bp+24, (*StatPage)(unsafe.Pointer(p)).FzPath, (*StatPage)(unsafe.Pointer(p)).FiCell)))
if !(z == uintptr(0)) {
goto __25
}
@@ -140680,14 +160669,14 @@ __2:
goto __28
__29: // table internal
__30: // index internal
- (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 24093 /* "internal" */
+ (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 35859 /* "internal" */
goto __28
__31: // table leaf
__32: // index leaf
- (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 24102 /* "leaf" */
+ (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 35868 /* "leaf" */
goto __28
__33:
- (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 24107 /* "corrupted" */
+ (*StatCursor)(unsafe.Pointer(pCsr)).FzPagetype = ts + 35873 /* "corrupted" */
goto __28
__28:
;
@@ -140702,7 +160691,7 @@ __34:
if !(!(int32((*StatCursor)(unsafe.Pointer(pCsr)).FisAgg) != 0)) {
goto __35
}
- (*StatCursor)(unsafe.Pointer(pCsr)).FzPath = crt.AssignUintptr(&z, Xsqlite3_mprintf(tls, ts+696 /* "%s" */, crt.VaList(bp+40, (*StatPage)(unsafe.Pointer(p1)).FzPath)))
+ (*StatCursor)(unsafe.Pointer(pCsr)).FzPath = libc.AssignUintptr(&z, Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+40, (*StatPage)(unsafe.Pointer(p1)).FzPath)))
if !(z == uintptr(0)) {
goto __36
}
@@ -140743,7 +160732,7 @@ __26:
return rc
}
-func statEof(tls *crt.TLS, pCursor uintptr) int32 { /* sqlite3.c:201115:12: */
+func statEof(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:201836:12: */
var pCsr uintptr = pCursor
return int32((*StatCursor)(unsafe.Pointer(pCsr)).FisEof)
}
@@ -140751,7 +160740,7 @@ func statEof(tls *crt.TLS, pCursor uintptr) int32 { /* sqlite3.c:201115:12: */
// Initialize a cursor according to the query plan idxNum using the
// arguments in argv[0]. See statBestIndex() for a description of the
// meaning of the bits in idxNum.
-func statFilter(tls *crt.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:201124:12: */
+func statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:201845:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -140768,7 +160757,7 @@ func statFilter(tls *crt.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, arg
(*StatCursor)(unsafe.Pointer(pCsr)).FpStmt = uintptr(0)
if (idxNum & 0x01) != 0 {
// schema=? constraint is present. Get its value
- var zDbase uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PostIncInt32(&iArg, 1))*8)))
+ var zDbase uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PostIncInt32(&iArg, 1))*8)))
(*StatCursor)(unsafe.Pointer(pCsr)).FiDb = Xsqlite3FindDbName(tls, (*StatTable)(unsafe.Pointer(pTab)).Fdb, zDbase)
if (*StatCursor)(unsafe.Pointer(pCsr)).FiDb < 0 {
(*StatCursor)(unsafe.Pointer(pCsr)).FiDb = 0
@@ -140780,24 +160769,24 @@ func statFilter(tls *crt.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, arg
}
if (idxNum & 0x02) != 0 {
// name=? constraint is present
- zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PostIncInt32(&iArg, 1))*8)))
+ zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PostIncInt32(&iArg, 1))*8)))
}
if (idxNum & 0x04) != 0 {
// aggregate=? constraint is present
- (*StatCursor)(unsafe.Pointer(pCsr)).FisAgg = (U8(crt.Bool32(Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PostIncInt32(&iArg, 1))*8))) != 0.0)))
+ (*StatCursor)(unsafe.Pointer(pCsr)).FisAgg = (U8(libc.Bool32(Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PostIncInt32(&iArg, 1))*8))) != 0.0)))
} else {
(*StatCursor)(unsafe.Pointer(pCsr)).FisAgg = U8(0)
}
pSql = Xsqlite3_str_new(tls, (*StatTable)(unsafe.Pointer(pTab)).Fdb)
Xsqlite3_str_appendf(tls, pSql,
- ts+24117, /* "SELECT * FROM (S..." */
- crt.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*StatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb+uintptr((*StatCursor)(unsafe.Pointer(pCsr)).FiDb)*32)).FzDbSName))
+ ts+35883, /* "SELECT * FROM (S..." */
+ libc.VaList(bp, (*Db)(unsafe.Pointer((*Sqlite3)(unsafe.Pointer((*StatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb+uintptr((*StatCursor)(unsafe.Pointer(pCsr)).FiDb)*32)).FzDbSName))
if zName != 0 {
- Xsqlite3_str_appendf(tls, pSql, ts+24272 /* "WHERE name=%Q" */, crt.VaList(bp+8, zName))
+ Xsqlite3_str_appendf(tls, pSql, ts+36038 /* "WHERE name=%Q" */, libc.VaList(bp+8, zName))
}
if (idxNum & 0x08) != 0 {
- Xsqlite3_str_appendf(tls, pSql, ts+24286 /* " ORDER BY name" */, 0)
+ Xsqlite3_str_appendf(tls, pSql, ts+36052 /* " ORDER BY name" */, 0)
}
zSql = Xsqlite3_str_finish(tls, pSql)
if zSql == uintptr(0) {
@@ -140813,15 +160802,15 @@ func statFilter(tls *crt.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, arg
return rc
}
-func statColumn(tls *crt.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:201190:12: */
+func statColumn(tls *libc.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:201911:12: */
var pCsr uintptr = pCursor
switch i {
case 0: // name
- Xsqlite3_result_text(tls, ctx, (*StatCursor)(unsafe.Pointer(pCsr)).FzName, -1, crt.UintptrFromInt32(-1))
+ Xsqlite3_result_text(tls, ctx, (*StatCursor)(unsafe.Pointer(pCsr)).FzName, -1, libc.UintptrFromInt32(-1))
break
case 1: // path
if !(int32((*StatCursor)(unsafe.Pointer(pCsr)).FisAgg) != 0) {
- Xsqlite3_result_text(tls, ctx, (*StatCursor)(unsafe.Pointer(pCsr)).FzPath, -1, crt.UintptrFromInt32(-1))
+ Xsqlite3_result_text(tls, ctx, (*StatCursor)(unsafe.Pointer(pCsr)).FzPath, -1, libc.UintptrFromInt32(-1))
}
break
case 2: // pageno
@@ -140872,15 +160861,15 @@ func statColumn(tls *crt.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /*
return 0
}
-func statRowid(tls *crt.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:201251:12: */
+func statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:201972:12: */
var pCsr uintptr = pCursor
*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Sqlite_int64((*StatCursor)(unsafe.Pointer(pCsr)).FiPageno)
return 0
}
// Invoke this routine to register the "dbstat" virtual table module
-func Xsqlite3DbstatRegister(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:201260:20: */
- return Xsqlite3_create_module(tls, db, ts+24301 /* "dbstat" */, uintptr(unsafe.Pointer(&dbstat_module)), uintptr(0))
+func Xsqlite3DbstatRegister(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:201981:20: */
+ return Xsqlite3_create_module(tls, db, ts+36067 /* "dbstat" */, uintptr(unsafe.Pointer(&dbstat_module)), uintptr(0))
}
var dbstat_module = Sqlite3_module{FiVersion: 0, FxCreate: // iVersion
@@ -140907,7 +160896,7 @@ uintptr(0), FxRelease:// xSavepoint
uintptr(0), FxRollbackTo:// xRelease
uintptr(0), FxShadowName:// xRollbackTo
uintptr(0), // xShadowName
-} /* sqlite3.c:201261:25 */
+} /* sqlite3.c:201982:25 */
//************* End of dbstat.c *********************************************
//************* Begin file dbpage.c *****************************************
@@ -140984,7 +160973,7 @@ type DbpageTable1 = struct {
// #include "sqliteInt.h" ** Requires access to internal data structures **
-type DbpageTable = DbpageTable1 /* sqlite3.c:201332:28 */
+type DbpageTable = DbpageTable1 /* sqlite3.c:202053:28 */
type DbpageCursor1 = struct {
Fbase Sqlite3_vtab_cursor
Fpgno int32
@@ -140995,18 +160984,18 @@ type DbpageCursor1 = struct {
FszPage int32
}
-type DbpageCursor = DbpageCursor1 /* sqlite3.c:201333:29 */
+type DbpageCursor = DbpageCursor1 /* sqlite3.c:202054:29 */
// Columns
// Connect to or create a dbpagevfs virtual table.
-func dbpageConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:201360:12: */
+func dbpageConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:202081:12: */
var pTab uintptr = uintptr(0)
var rc int32 = 0
Xsqlite3_vtab_config(tls, db, 3, 0)
rc = Xsqlite3_declare_vtab(tls, db,
- ts+24308 /* "CREATE TABLE x(p..." */)
+ ts+36074 /* "CREATE TABLE x(p..." */)
if rc == 0 {
pTab = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(DbpageTable{})))
if pTab == uintptr(0) {
@@ -141015,7 +161004,7 @@ func dbpageConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uint
}
if rc == 0 {
- crt.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(DbpageTable{})))
+ libc.Xmemset(tls, pTab, 0, uint64(unsafe.Sizeof(DbpageTable{})))
(*DbpageTable)(unsafe.Pointer(pTab)).Fdb = db
}
@@ -141024,7 +161013,7 @@ func dbpageConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uint
}
// Disconnect from or destroy a dbpagevfs virtual table.
-func dbpageDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* sqlite3.c:201391:12: */
+func dbpageDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:202112:12: */
Xsqlite3_free(tls, pVtab)
return 0
}
@@ -141035,7 +161024,7 @@ func dbpageDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* sqlite3.c:201391:1
// 1 schema=main, pgno=?1
// 2 schema=?1, full table scan
// 3 schema=?1, pgno=?2
-func dbpageBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:201404:12: */
+func dbpageBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:202125:12: */
var i int32
var iPlan int32 = 0
@@ -141094,14 +161083,14 @@ func dbpageBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sql
}
// Open a new dbpagevfs cursor.
-func dbpageOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:201459:12: */
+func dbpageOpen(tls *libc.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite3.c:202180:12: */
var pCsr uintptr
pCsr = Xsqlite3_malloc64(tls, uint64(unsafe.Sizeof(DbpageCursor{})))
if pCsr == uintptr(0) {
return 7
} else {
- crt.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(DbpageCursor{})))
+ libc.Xmemset(tls, pCsr, 0, uint64(unsafe.Sizeof(DbpageCursor{})))
(*DbpageCursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab = pVTab
(*DbpageCursor)(unsafe.Pointer(pCsr)).Fpgno = -1
}
@@ -141111,7 +161100,7 @@ func dbpageOpen(tls *crt.TLS, pVTab uintptr, ppCursor uintptr) int32 { /* sqlite
}
// Close a dbpagevfs cursor.
-func dbpageClose(tls *crt.TLS, pCursor uintptr) int32 { /* sqlite3.c:201478:12: */
+func dbpageClose(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:202199:12: */
var pCsr uintptr = pCursor
if (*DbpageCursor)(unsafe.Pointer(pCsr)).FpPage1 != 0 {
Xsqlite3PagerUnrefPageOne(tls, (*DbpageCursor)(unsafe.Pointer(pCsr)).FpPage1)
@@ -141121,16 +161110,16 @@ func dbpageClose(tls *crt.TLS, pCursor uintptr) int32 { /* sqlite3.c:201478:12:
}
// Move a dbpagevfs cursor to the next entry in the file.
-func dbpageNext(tls *crt.TLS, pCursor uintptr) int32 { /* sqlite3.c:201488:12: */
+func dbpageNext(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:202209:12: */
var rc int32 = 0
var pCsr uintptr = pCursor
(*DbpageCursor)(unsafe.Pointer(pCsr)).Fpgno++
return rc
}
-func dbpageEof(tls *crt.TLS, pCursor uintptr) int32 { /* sqlite3.c:201495:12: */
+func dbpageEof(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:202216:12: */
var pCsr uintptr = pCursor
- return (crt.Bool32((*DbpageCursor)(unsafe.Pointer(pCsr)).Fpgno > (*DbpageCursor)(unsafe.Pointer(pCsr)).FmxPgno))
+ return (libc.Bool32((*DbpageCursor)(unsafe.Pointer(pCsr)).Fpgno > (*DbpageCursor)(unsafe.Pointer(pCsr)).FmxPgno))
}
// idxNum:
@@ -141141,7 +161130,7 @@ func dbpageEof(tls *crt.TLS, pCursor uintptr) int32 { /* sqlite3.c:201495:12: */
// 3 schema=?1, pgno=?2
//
// idxStr is not used
-func dbpageFilter(tls *crt.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:201510:12: */
+func dbpageFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:202231:12: */
var pCsr uintptr = pCursor
var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
var rc int32
@@ -141188,7 +161177,7 @@ func dbpageFilter(tls *crt.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a
return rc
}
-func dbpageColumn(tls *crt.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:201556:12: */
+func dbpageColumn(tls *libc.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:202277:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -141206,7 +161195,7 @@ func dbpageColumn(tls *crt.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /
rc = Xsqlite3PagerGet(tls, (*DbpageCursor)(unsafe.Pointer(pCsr)).FpPager, uint32((*DbpageCursor)(unsafe.Pointer(pCsr)).Fpgno), bp /* &pDbPage */, 0)
if rc == 0 {
Xsqlite3_result_blob(tls, ctx, Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */))), (*DbpageCursor)(unsafe.Pointer(pCsr)).FszPage,
- crt.UintptrFromInt32(-1))
+ libc.UintptrFromInt32(-1))
}
Xsqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp /* pDbPage */)))
break
@@ -141221,13 +161210,13 @@ func dbpageColumn(tls *crt.TLS, pCursor uintptr, ctx uintptr, i int32) int32 { /
return 0
}
-func dbpageRowid(tls *crt.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:201587:12: */
+func dbpageRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:202308:12: */
var pCsr uintptr = pCursor
*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Sqlite_int64((*DbpageCursor)(unsafe.Pointer(pCsr)).Fpgno)
return 0
}
-func dbpageUpdate(tls *crt.TLS, pVtab uintptr, argc int32, argv uintptr, pRowid uintptr) int32 { /* sqlite3.c:201593:12: */
+func dbpageUpdate(tls *libc.TLS, pVtab uintptr, argc int32, argv uintptr, pRowid uintptr) int32 { /* sqlite3.c:202314:12: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -141250,14 +161239,14 @@ func dbpageUpdate(tls *crt.TLS, pVtab uintptr, argc int32, argv uintptr, pRowid
if !(((*Sqlite3)(unsafe.Pointer((*DbpageTable)(unsafe.Pointer(pTab)).Fdb)).Fflags & uint64(0x10000000)) != 0) {
goto __1
}
- zErr = ts + 24375 /* "read-only" */
+ zErr = ts + 36141 /* "read-only" */
goto update_fail
__1:
;
if !(argc == 1) {
goto __2
}
- zErr = ts + 24385 /* "cannot delete" */
+ zErr = ts + 36151 /* "cannot delete" */
goto update_fail
__2:
;
@@ -141265,7 +161254,7 @@ __2:
if !(Pgno(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)))) != pgno) {
goto __3
}
- zErr = ts + 24399 /* "cannot insert" */
+ zErr = ts + 36165 /* "cannot insert" */
goto update_fail
__3:
;
@@ -141278,7 +161267,7 @@ __3:
if !(iDb < 0) {
goto __4
}
- zErr = ts + 24413 /* "no such schema" */
+ zErr = ts + 36179 /* "no such schema" */
goto update_fail
__4:
;
@@ -141286,7 +161275,7 @@ __4:
if !(((pgno < Pgno(1)) || (pBt == uintptr(0))) || (pgno > Pgno(int32(Xsqlite3BtreeLastPage(tls, pBt))))) {
goto __5
}
- zErr = ts + 24428 /* "bad page number" */
+ zErr = ts + 36194 /* "bad page number" */
goto update_fail
__5:
;
@@ -141295,7 +161284,7 @@ __5:
(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))) != szPage)) {
goto __6
}
- zErr = ts + 24444 /* "bad page value" */
+ zErr = ts + 36210 /* "bad page value" */
goto update_fail
__6:
;
@@ -141308,7 +161297,7 @@ __6:
if !(rc == 0) {
goto __8
}
- crt.Xmemcpy(tls, Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pDbPage */))),
+ libc.Xmemcpy(tls, Xsqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pDbPage */))),
Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))),
uint64(szPage))
__8:
@@ -141320,14 +161309,14 @@ __7:
update_fail:
Xsqlite3_free(tls, (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg)
- (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+696 /* "%s" */, crt.VaList(bp, zErr))
+ (*Sqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp, zErr))
return 1
}
// Since we do not know in advance which database files will be
// written by the sqlite_dbpage virtual table, start a write transaction
// on them all.
-func dbpageBegin(tls *crt.TLS, pVtab uintptr) int32 { /* sqlite3.c:201664:12: */
+func dbpageBegin(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:202385:12: */
var pTab uintptr = pVtab
var db uintptr = (*DbpageTable)(unsafe.Pointer(pTab)).Fdb
var i int32
@@ -141341,8 +161330,8 @@ func dbpageBegin(tls *crt.TLS, pVtab uintptr) int32 { /* sqlite3.c:201664:12: */
}
// Invoke this routine to register the "dbpage" virtual table module
-func Xsqlite3DbpageRegister(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:201679:20: */
- return Xsqlite3_create_module(tls, db, ts+24459 /* "sqlite_dbpage" */, uintptr(unsafe.Pointer(&dbpage_module)), uintptr(0))
+func Xsqlite3DbpageRegister(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:202400:20: */
+ return Xsqlite3_create_module(tls, db, ts+36225 /* "sqlite_dbpage" */, uintptr(unsafe.Pointer(&dbpage_module)), uintptr(0))
}
var dbpage_module = Sqlite3_module{FiVersion: 0, FxCreate: // iVersion
@@ -141369,7 +161358,7 @@ uintptr(0), FxRelease:// xSavepoint
uintptr(0), FxRollbackTo:// xRelease
uintptr(0), FxShadowName:// xRollbackTo
uintptr(0), // xShadowName
-} /* sqlite3.c:201680:25 */
+} /* sqlite3.c:202401:25 */
//************* End of dbpage.c *********************************************
//************* Begin file sqlite3session.c *********************************
@@ -141377,6 +161366,20702 @@ uintptr(0), // xShadowName
//************* End of sqlite3session.c *************************************
//************* Begin file fts5.c *******************************************
+// 2014 May 31
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// Interfaces to extend FTS5. Using the interfaces defined in this file,
+// FTS5 may be extended with:
+//
+// * custom tokenizers, and
+// * custom auxiliary functions.
+
+// 2014 May 31
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+
+// #include "fts5.h"
+// #include "sqlite3ext.h"
+
+// #include <string.h>
+// #include <assert.h>
+
+// Truncate very long tokens to this many bytes. Hard limit is
+// (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset
+// field that occurs at the start of each leaf page (see fts5_index.c).
+
+// Maximum number of prefix indexes on single FTS5 table. This must be
+// less than 32. If it is set to anything large than that, an #error
+// directive in fts5_index.c will cause the build to fail.
+
+// Maximum segments permitted in a single index
+
+// Name of rank and rowid columns
+
+// The assert_nc() macro is similar to the assert() macro, except that it
+// is used for assert() conditions that are true only if it can be
+// guranteed that the database is not corrupt.
+
+// A version of memcmp() that does not cause asan errors if one of the pointer
+// parameters is NULL and the number of bytes to compare is zero.
+
+// Mark a function parameter as unused, to suppress nuisance compiler
+// warnings.
+
+type Fts5Global1 = struct {
+ Fapi Fts5_api
+ Fdb uintptr
+ FiNextId I64
+ FpAux uintptr
+ FpTok uintptr
+ FpDfltTok uintptr
+ FpCsr uintptr
+}
+
+//************* End of dbpage.c *********************************************
+//************* Begin file sqlite3session.c *********************************
+
+//************* End of sqlite3session.c *************************************
+//************* Begin file fts5.c *******************************************
+
+// 2014 May 31
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// Interfaces to extend FTS5. Using the interfaces defined in this file,
+// FTS5 may be extended with:
+//
+// * custom tokenizers, and
+// * custom auxiliary functions.
+
+// 2014 May 31
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+
+// #include "fts5.h"
+// #include "sqlite3ext.h"
+
+// #include <string.h>
+// #include <assert.h>
+
+// Truncate very long tokens to this many bytes. Hard limit is
+// (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset
+// field that occurs at the start of each leaf page (see fts5_index.c).
+
+// Maximum number of prefix indexes on single FTS5 table. This must be
+// less than 32. If it is set to anything large than that, an #error
+// directive in fts5_index.c will cause the build to fail.
+
+// Maximum segments permitted in a single index
+
+// Name of rank and rowid columns
+
+// The assert_nc() macro is similar to the assert() macro, except that it
+// is used for assert() conditions that are true only if it can be
+// guranteed that the database is not corrupt.
+
+// A version of memcmp() that does not cause asan errors if one of the pointer
+// parameters is NULL and the number of bytes to compare is zero.
+
+// Mark a function parameter as unused, to suppress nuisance compiler
+// warnings.
+
+type Fts5Global = Fts5Global1 /* sqlite3.c:208614:27 */
+type Fts5Colset1 = struct {
+ FnCol int32
+ FaiCol [1]int32
+}
+
+type Fts5Colset = Fts5Colset1 /* sqlite3.c:208615:27 */
+
+// *************************************************************************
+//
+// Interface to code in fts5_config.c. fts5_config.c contains contains code
+// to parse the arguments passed to the CREATE VIRTUAL TABLE statement.
+
+type Fts5Config1 = struct {
+ Fdb uintptr
+ FzDb uintptr
+ FzName uintptr
+ FnCol int32
+ FazCol uintptr
+ FabUnindexed uintptr
+ FnPrefix int32
+ FaPrefix uintptr
+ FeContent int32
+ FzContent uintptr
+ FzContentRowid uintptr
+ FbColumnsize int32
+ FeDetail int32
+ FzContentExprlist uintptr
+ FpTok uintptr
+ FpTokApi uintptr
+ FbLock int32
+ FiCookie int32
+ Fpgsz int32
+ FnAutomerge int32
+ FnCrisisMerge int32
+ FnUsermerge int32
+ FnHashSize int32
+ FzRank uintptr
+ FzRankArgs uintptr
+ FpzErrmsg uintptr
+}
+
+// *************************************************************************
+//
+// Interface to code in fts5_config.c. fts5_config.c contains contains code
+// to parse the arguments passed to the CREATE VIRTUAL TABLE statement.
+
+type Fts5Config = Fts5Config1 /* sqlite3.c:208635:27 */
+
+//
+// End of interface to code in fts5_config.c.
+//
+
+// *************************************************************************
+//
+// Interface to code in fts5_buffer.c.
+
+// Buffer object for the incremental building of string data.
+type Fts5Buffer1 = struct {
+ Fp uintptr
+ Fn int32
+ FnSpace int32
+}
+
+//
+// End of interface to code in fts5_config.c.
+//
+
+// *************************************************************************
+//
+// Interface to code in fts5_buffer.c.
+
+// Buffer object for the incremental building of string data.
+type Fts5Buffer = Fts5Buffer1 /* sqlite3.c:208758:27 */
+
+type Fts5PoslistReader1 = struct {
+ Fa uintptr
+ Fn int32
+ Fi int32
+ FbFlag U8
+ FbEof U8
+ FiPos I64
+}
+
+type Fts5PoslistReader = Fts5PoslistReader1 /* sqlite3.c:208794:34 */
+
+type Fts5PoslistWriter1 = struct{ FiPrev I64 }
+
+type Fts5PoslistWriter = Fts5PoslistWriter1 /* sqlite3.c:208813:34 */
+
+// Bucket of terms object used by the integrity-check in offsets=0 mode.
+type Fts5Termset1 = struct{ FapHash [512]uintptr }
+
+// Bucket of terms object used by the integrity-check in offsets=0 mode.
+type Fts5Termset = Fts5Termset1 /* sqlite3.c:208835:28 */
+
+//
+// End of interface to code in fts5_buffer.c.
+//
+
+// *************************************************************************
+//
+// Interface to code in fts5_index.c. fts5_index.c contains contains code
+// to access the data stored in the %_data table.
+
+type Fts5Index1 = struct {
+ FpConfig uintptr
+ FzDataTbl uintptr
+ FnWorkUnit int32
+ FpHash uintptr
+ FnPendingData int32
+ FiWriteRowid I64
+ FbDelete int32
+ Frc int32
+ FpReader uintptr
+ FpWriter uintptr
+ FpDeleter uintptr
+ FpIdxWriter uintptr
+ FpIdxDeleter uintptr
+ FpIdxSelect uintptr
+ FnRead int32
+ FpDataVersion uintptr
+ FiStructVersion I64
+ FpStruct uintptr
+}
+
+//
+// End of interface to code in fts5_buffer.c.
+//
+
+// *************************************************************************
+//
+// Interface to code in fts5_index.c. fts5_index.c contains contains code
+// to access the data stored in the %_data table.
+
+type Fts5Index = Fts5Index1 /* sqlite3.c:208849:26 */
+type Fts5IndexIter1 = struct {
+ FiRowid I64
+ FpData uintptr
+ FnData int32
+ FbEof U8
+ _ [3]byte
+}
+
+type Fts5IndexIter = Fts5IndexIter1 /* sqlite3.c:208850:30 */
+
+//
+// End of interface to code in fts5_varint.c.
+//
+
+// *************************************************************************
+//
+// Interface to code in fts5_main.c.
+
+// Virtual-table object.
+type Fts5Table1 = struct {
+ Fbase Sqlite3_vtab
+ FpConfig uintptr
+ FpIndex uintptr
+}
+
+//
+// End of interface to code in fts5_varint.c.
+//
+
+// *************************************************************************
+//
+// Interface to code in fts5_main.c.
+
+// Virtual-table object.
+type Fts5Table = Fts5Table1 /* sqlite3.c:209049:26 */
+
+//
+// End of interface to code in fts5.c.
+//
+
+// *************************************************************************
+//
+// Interface to code in fts5_hash.c.
+type Fts5Hash1 = struct {
+ FeDetail int32
+ FpnByte uintptr
+ FnEntry int32
+ FnSlot int32
+ FpScan uintptr
+ FaSlot uintptr
+}
+
+//
+// End of interface to code in fts5.c.
+//
+
+// *************************************************************************
+//
+// Interface to code in fts5_hash.c.
+type Fts5Hash = Fts5Hash1 /* sqlite3.c:209076:25 */
+
+//
+// End of interface to code in fts5_hash.c.
+//
+
+// *************************************************************************
+//
+// Interface to code in fts5_storage.c. fts5_storage.c contains contains
+// code to access the data stored in the %_content and %_docsize tables.
+
+type Fts5Storage1 = struct {
+ FpConfig uintptr
+ FpIndex uintptr
+ FbTotalsValid int32
+ FnTotalRow I64
+ FaTotalSize uintptr
+ FaStmt [11]uintptr
+}
+
+//
+// End of interface to code in fts5_hash.c.
+//
+
+// *************************************************************************
+//
+// Interface to code in fts5_storage.c. fts5_storage.c contains contains
+// code to access the data stored in the %_content and %_docsize tables.
+
+type Fts5Storage = Fts5Storage1 /* sqlite3.c:209132:28 */
+
+//
+// End of interface to code in fts5_storage.c.
+//
+
+// *************************************************************************
+//
+// Interface to code in fts5_expr.c.
+type Fts5Expr1 = struct {
+ FpIndex uintptr
+ FpConfig uintptr
+ FpRoot uintptr
+ FbDesc int32
+ FnPhrase int32
+ FapExprPhrase uintptr
+}
+
+//
+// End of interface to code in fts5_storage.c.
+//
+
+// *************************************************************************
+//
+// Interface to code in fts5_expr.c.
+type Fts5Expr = Fts5Expr1 /* sqlite3.c:209175:25 */
+type Fts5ExprNode1 = struct {
+ FeType int32
+ FbEof int32
+ FbNomatch int32
+ FxNext uintptr
+ FiRowid I64
+ FpNear uintptr
+ FnChild int32
+ FapChild [1]uintptr
+}
+
+type Fts5ExprNode = Fts5ExprNode1 /* sqlite3.c:209176:29 */
+type Fts5Parse1 = struct {
+ FpConfig uintptr
+ FzErr uintptr
+ Frc int32
+ FnPhrase int32
+ FapPhrase uintptr
+ FpExpr uintptr
+}
+
+type Fts5Parse = Fts5Parse1 /* sqlite3.c:209177:26 */
+type Fts5Token1 = struct {
+ Fp uintptr
+ Fn int32
+ _ [4]byte
+}
+
+type Fts5Token = Fts5Token1 /* sqlite3.c:209178:26 */
+type Fts5ExprPhrase1 = struct {
+ FpNode uintptr
+ Fposlist Fts5Buffer
+ FnTerm int32
+ FaTerm [1]Fts5ExprTerm
+}
+
+type Fts5ExprPhrase = Fts5ExprPhrase1 /* sqlite3.c:209179:31 */
+type Fts5ExprNearset1 = struct {
+ FnNear int32
+ FpColset uintptr
+ FnPhrase int32
+ FapPhrase [1]uintptr
+}
+
+type Fts5ExprNearset = Fts5ExprNearset1 /* sqlite3.c:209180:32 */
+
+type Fts5PoslistPopulator1 = struct {
+ Fwriter Fts5PoslistWriter
+ FbOk int32
+ FbMiss int32
+}
+
+type Fts5PoslistPopulator = Fts5PoslistPopulator1 /* sqlite3.c:209220:37 */
+//
+// End of interface to code in fts5_unicode2.c.
+//
+
+// 2000-05-29
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+// Driver template for the LEMON parser generator.
+//
+// The "lemon" program processes an LALR(1) input grammar file, then uses
+// this template to construct a parser. The "lemon" program inserts text
+// at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the
+// interstitial "-" characters) contained in this template is changed into
+// the value of the %name directive from the grammar. Otherwise, the content
+// of this template is copied straight through into the generate parser
+// source file.
+//
+// The following is the concatenation of all %include directives from the
+// input grammar file:
+// #include <stdio.h>
+// #include <assert.h>
+//*********** Begin %include sections from the grammar ***********************
+
+// #include "fts5Int.h"
+// #include "fts5parse.h"
+
+// Disable all error recovery processing in the parser push-down
+// automaton.
+
+// Make fts5yytestcase() the same as testcase()
+
+// Indicate that sqlite3ParserFree() will never be called with a null
+// pointer.
+
+// Alternative datatype for the argument to the malloc() routine passed
+// into sqlite3ParserAlloc(). The default is size_t.
+
+//*************** End of %include directives *********************************
+// These constants specify the various numeric values for terminal symbols
+// in a format understandable to "makeheaders". This section is blank unless
+// "lemon" is run with the "-m" command-line option.
+// Begin makeheaders token definitions ************************
+//*************** End makeheaders token definitions **************************
+
+// The next sections is a series of control #defines.
+// various aspects of the generated parser.
+// fts5YYCODETYPE is the data type used to store the integer codes
+// that represent terminal and non-terminal symbols.
+// "unsigned char" is used if there are fewer than
+// 256 symbols. Larger types otherwise.
+// fts5YYNOCODE is a number of type fts5YYCODETYPE that is not used for
+// any terminal or nonterminal symbol.
+// fts5YYFALLBACK If defined, this indicates that one or more tokens
+// (also known as: "terminal symbols") have fall-back
+// values which should be used if the original symbol
+// would not parse. This permits keywords to sometimes
+// be used as identifiers, for example.
+// fts5YYACTIONTYPE is the data type used for "action codes" - numbers
+// that indicate what to do in response to the next
+// token.
+// sqlite3Fts5ParserFTS5TOKENTYPE is the data type used for minor type for terminal
+// symbols. Background: A "minor type" is a semantic
+// value associated with a terminal or non-terminal
+// symbols. For example, for an "ID" terminal symbol,
+// the minor type might be the name of the identifier.
+// Each non-terminal can have a different minor type.
+// Terminal symbols all have the same minor type, though.
+// This macros defines the minor type for terminal
+// symbols.
+// fts5YYMINORTYPE is the data type used for all minor types.
+// This is typically a union of many types, one of
+// which is sqlite3Fts5ParserFTS5TOKENTYPE. The entry in the union
+// for terminal symbols is called "fts5yy0".
+// fts5YYSTACKDEPTH is the maximum depth of the parser's stack. If
+// zero the stack is dynamically sized using realloc()
+// sqlite3Fts5ParserARG_SDECL A static variable declaration for the %extra_argument
+// sqlite3Fts5ParserARG_PDECL A parameter declaration for the %extra_argument
+// sqlite3Fts5ParserARG_PARAM Code to pass %extra_argument as a subroutine parameter
+// sqlite3Fts5ParserARG_STORE Code to store %extra_argument into fts5yypParser
+// sqlite3Fts5ParserARG_FETCH Code to extract %extra_argument from fts5yypParser
+// sqlite3Fts5ParserCTX_* As sqlite3Fts5ParserARG_ except for %extra_context
+// fts5YYERRORSYMBOL is the code number of the error symbol. If not
+// defined, then do no error processing.
+// fts5YYNSTATE the combined number of states.
+// fts5YYNRULE the number of rules in the grammar
+// fts5YYNFTS5TOKEN Number of terminal symbols
+// fts5YY_MAX_SHIFT Maximum value for shift actions
+// fts5YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
+// fts5YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
+// fts5YY_ERROR_ACTION The fts5yy_action[] code for syntax error
+// fts5YY_ACCEPT_ACTION The fts5yy_action[] code for accept
+// fts5YY_NO_ACTION The fts5yy_action[] code for no-op
+// fts5YY_MIN_REDUCE Minimum value for reduce actions
+// fts5YY_MAX_REDUCE Maximum value for reduce actions
+//************ Begin control #defines ****************************************
+type Fts5YYMINORTYPE = struct {
+ _ [0]uint64
+ Ffts5yyinit int32
+ _ [12]byte
+} /* sqlite3.c:209477:3 */
+//************ End control #defines ******************************************
+
+// Define the fts5yytestcase() macro to be a no-op if is not already defined
+// otherwise.
+//
+// Applications can choose to define fts5yytestcase() in the %include section
+// to a macro that can assist in verifying code coverage. For production
+// code the fts5yytestcase() macro should be turned off. But it is useful
+// for testing.
+
+// Next are the tables used to determine what action to take based on the
+// current state and lookahead token. These tables are used to implement
+// functions that take a state number and lookahead value and return an
+// action integer.
+//
+// Suppose the action integer is N. Then the action is determined as
+// follows
+//
+// 0 <= N <= fts5YY_MAX_SHIFT Shift N. That is, push the lookahead
+// token onto the stack and goto state N.
+//
+// N between fts5YY_MIN_SHIFTREDUCE Shift to an arbitrary state then
+// and fts5YY_MAX_SHIFTREDUCE reduce by rule N-fts5YY_MIN_SHIFTREDUCE.
+//
+// N == fts5YY_ERROR_ACTION A syntax error has occurred.
+//
+// N == fts5YY_ACCEPT_ACTION The parser accepts its input.
+//
+// N == fts5YY_NO_ACTION No such action. Denotes unused
+// slots in the fts5yy_action[] table.
+//
+// N between fts5YY_MIN_REDUCE Reduce by rule N-fts5YY_MIN_REDUCE
+// and fts5YY_MAX_REDUCE
+//
+// The action table is constructed as a single large table named fts5yy_action[].
+// Given state S and lookahead X, the action is computed as either:
+//
+// (A) N = fts5yy_action[ fts5yy_shift_ofst[S] + X ]
+// (B) N = fts5yy_default[S]
+//
+// The (A) formula is preferred. The B formula is used instead if
+// fts5yy_lookahead[fts5yy_shift_ofst[S]+X] is not equal to X.
+//
+// The formulas above are for computing the action when the lookahead is
+// a terminal symbol. If the lookahead is a non-terminal (as occurs after
+// a reduce action) then the fts5yy_reduce_ofst[] array is used in place of
+// the fts5yy_shift_ofst[] array.
+//
+// The following are the tables generated in this section:
+//
+// fts5yy_action[] A single table containing all actions.
+// fts5yy_lookahead[] A table containing the lookahead for each entry in
+// fts5yy_action. Used to detect hash collisions.
+// fts5yy_shift_ofst[] For each state, the offset into fts5yy_action for
+// shifting terminals.
+// fts5yy_reduce_ofst[] For each state, the offset into fts5yy_action for
+// shifting non-terminals after a reduce.
+// fts5yy_default[] Default action for each state.
+//
+// Begin parsing tables *********************************************
+var fts5yy_action = [105]uint8{
+ /* 0 */ uint8(81), uint8(20), uint8(96), uint8(6), uint8(28), uint8(99), uint8(98), uint8(26), uint8(26), uint8(18),
+ /* 10 */ uint8(96), uint8(6), uint8(28), uint8(17), uint8(98), uint8(56), uint8(26), uint8(19), uint8(96), uint8(6),
+ /* 20 */ uint8(28), uint8(14), uint8(98), uint8(14), uint8(26), uint8(31), uint8(92), uint8(96), uint8(6), uint8(28),
+ /* 30 */ uint8(108), uint8(98), uint8(25), uint8(26), uint8(21), uint8(96), uint8(6), uint8(28), uint8(78), uint8(98),
+ /* 40 */ uint8(58), uint8(26), uint8(29), uint8(96), uint8(6), uint8(28), uint8(107), uint8(98), uint8(22), uint8(26),
+ /* 50 */ uint8(24), uint8(16), uint8(12), uint8(11), uint8(1), uint8(13), uint8(13), uint8(24), uint8(16), uint8(23),
+ /* 60 */ uint8(11), uint8(33), uint8(34), uint8(13), uint8(97), uint8(8), uint8(27), uint8(32), uint8(98), uint8(7),
+ /* 70 */ uint8(26), uint8(3), uint8(4), uint8(5), uint8(3), uint8(4), uint8(5), uint8(3), uint8(83), uint8(4),
+ /* 80 */ uint8(5), uint8(3), uint8(63), uint8(5), uint8(3), uint8(62), uint8(12), uint8(2), uint8(86), uint8(13),
+ /* 90 */ uint8(9), uint8(30), uint8(10), uint8(10), uint8(54), uint8(57), uint8(75), uint8(78), uint8(78), uint8(53),
+ /* 100 */ uint8(57), uint8(15), uint8(82), uint8(82), uint8(71),
+} /* sqlite3.c:209570:31 */
+var fts5yy_lookahead = [121]uint8{
+ /* 0 */ uint8(16), uint8(17), uint8(18), uint8(19), uint8(20), uint8(22), uint8(22), uint8(24), uint8(24), uint8(17),
+ /* 10 */ uint8(18), uint8(19), uint8(20), uint8(7), uint8(22), uint8(9), uint8(24), uint8(17), uint8(18), uint8(19),
+ /* 20 */ uint8(20), uint8(9), uint8(22), uint8(9), uint8(24), uint8(13), uint8(17), uint8(18), uint8(19), uint8(20),
+ /* 30 */ uint8(26), uint8(22), uint8(24), uint8(24), uint8(17), uint8(18), uint8(19), uint8(20), uint8(15), uint8(22),
+ /* 40 */ uint8(9), uint8(24), uint8(17), uint8(18), uint8(19), uint8(20), uint8(26), uint8(22), uint8(21), uint8(24),
+ /* 50 */ uint8(6), uint8(7), uint8(9), uint8(9), uint8(10), uint8(12), uint8(12), uint8(6), uint8(7), uint8(21),
+ /* 60 */ uint8(9), uint8(24), uint8(25), uint8(12), uint8(18), uint8(5), uint8(20), uint8(14), uint8(22), uint8(5),
+ /* 70 */ uint8(24), uint8(3), uint8(1), uint8(2), uint8(3), uint8(1), uint8(2), uint8(3), uint8(0), uint8(1),
+ /* 80 */ uint8(2), uint8(3), uint8(11), uint8(2), uint8(3), uint8(11), uint8(9), uint8(10), uint8(5), uint8(12),
+ /* 90 */ uint8(23), uint8(24), uint8(10), uint8(10), uint8(8), uint8(9), uint8(9), uint8(15), uint8(15), uint8(8),
+ /* 100 */ uint8(9), uint8(9), uint8(27), uint8(27), uint8(11), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
+ /* 110 */ uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27), uint8(27),
+ /* 120 */ uint8(27),
+} /* sqlite3.c:209583:29 */
+var fts5yy_shift_ofst = [35]uint8{
+ /* 0 */ uint8(44), uint8(44), uint8(44), uint8(44), uint8(44), uint8(44), uint8(51), uint8(77), uint8(43), uint8(12),
+ /* 10 */ uint8(14), uint8(83), uint8(82), uint8(14), uint8(23), uint8(23), uint8(31), uint8(31), uint8(71), uint8(74),
+ /* 20 */ uint8(78), uint8(81), uint8(86), uint8(91), uint8(6), uint8(53), uint8(53), uint8(60), uint8(64), uint8(68),
+ /* 30 */ uint8(53), uint8(87), uint8(92), uint8(53), uint8(93),
+} /* sqlite3.c:209601:28 */
+var fts5yy_reduce_ofst = [18]int8{
+ /* 0 */ int8(-16), int8(-8), int8(0), int8(9), int8(17), int8(25), int8(46), int8(-17), int8(-17), int8(37),
+ /* 10 */ int8(67), int8(4), int8(4), int8(8), int8(4), int8(20), int8(27), int8(38),
+} /* sqlite3.c:209610:26 */
+var fts5yy_default = [35]uint8{
+ /* 0 */ uint8(80), uint8(80), uint8(80), uint8(80), uint8(80), uint8(80), uint8(95), uint8(80), uint8(80), uint8(105),
+ /* 10 */ uint8(80), uint8(110), uint8(110), uint8(80), uint8(110), uint8(110), uint8(80), uint8(80), uint8(80), uint8(80),
+ /* 20 */ uint8(80), uint8(91), uint8(80), uint8(80), uint8(80), uint8(101), uint8(100), uint8(80), uint8(80), uint8(90),
+ /* 30 */ uint8(103), uint8(80), uint8(80), uint8(104), uint8(80),
+} /* sqlite3.c:209614:31 */
+//********* End of lemon-generated parsing tables ****************************
+
+// The next table maps tokens (terminal symbols) into fallback tokens.
+// If a construct like the following:
+//
+// %fallback ID X Y Z.
+//
+// appears in the grammar, then ID becomes a fallback token for X, Y,
+// and Z. Whenever one of the tokens X, Y, or Z is input to the parser
+// but it does not parse, the type of the token is changed to ID and
+// the parse is retried before an error is thrown.
+//
+// This feature can be used, for example, to cause some keywords in a language
+// to revert to identifiers if they keyword does not apply in the context where
+// it appears.
+
+// The following structure represents a single element of the
+// parser's stack. Information stored includes:
+//
+// + The state number for the parser at this level of the stack.
+//
+// + The value of the token stored at this level of the stack.
+// (In other words, the "major" token.)
+//
+// + The semantic value stored at this level of the stack. This is
+// the information used by the action routines in the grammar.
+// It is sometimes called the "minor" token.
+//
+// After the "shift" half of a SHIFTREDUCE action, the stateno field
+// actually contains the reduce action for the second half of the
+// SHIFTREDUCE.
+type fts5yyStackEntry = struct {
+ Fstateno uint8
+ Fmajor uint8
+ Fminor Fts5YYMINORTYPE
+}
+
+type Fts5yyStackEntry = fts5yyStackEntry /* sqlite3.c:209664:33 */
+
+// The state of the parser is completely contained in an instance of
+// the following structure
+type fts5yyParser = struct {
+ Ffts5yytos uintptr
+ FpParse uintptr
+ Ffts5yystack [100]Fts5yyStackEntry
+ Ffts5yystackEnd uintptr
+}
+
+type Fts5yyParser = fts5yyParser /* sqlite3.c:209687:29 */
+
+// Datatype of the argument to the memory allocated passed as the
+// second argument to sqlite3Fts5ParserAlloc() below. This can be changed by
+// putting an appropriate #define in the %include section of the input
+// grammar.
+
+// Initialize a new parser that has already been allocated.
+func sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { /* sqlite3.c:209835:13: */
+ var fts5yypParser uintptr = fts5yypRawParser
+
+ (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos = fts5yypParser + 16 /* &.fts5yystack */
+ (*Fts5yyStackEntry)(unsafe.Pointer((fts5yypParser + 16 /* &.fts5yystack */) + uintptr(0)*24)).Fstateno = uint8(0)
+ (*Fts5yyStackEntry)(unsafe.Pointer((fts5yypParser + 16 /* &.fts5yystack */) + uintptr(0)*24)).Fmajor = uint8(0)
+ (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd = ((fts5yypParser + 16 /* &.fts5yystack */) + uintptr((100-1))*24)
+}
+
+// This function allocates a new parser.
+// The only argument is a pointer to a function which works like
+// malloc.
+//
+// Inputs:
+// A pointer to the function used to allocate memory.
+//
+// Outputs:
+// A pointer to a parser. This pointer is used in subsequent calls
+// to sqlite3Fts5Parser and sqlite3Fts5ParserFree.
+func sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) uintptr { /* sqlite3.c:209874:13: */
+ var fts5yypParser uintptr
+ fts5yypParser = (*(*func(*libc.TLS, U64) uintptr)(unsafe.Pointer(&mallocProc)))(tls, U64(unsafe.Sizeof(Fts5yyParser{})))
+ if fts5yypParser != 0 {
+
+ sqlite3Fts5ParserInit(tls, fts5yypParser)
+ }
+ return fts5yypParser
+}
+
+// The following function deletes the "minor type" or semantic value
+// associated with a symbol. The symbol can be either a terminal
+// or nonterminal. "fts5yymajor" is the symbol code, and "fts5yypminor" is
+// a pointer to the value to be deleted. The code used to do the
+// deletions is derived from the %destructor and/or %token_destructor
+// directives of the input grammar.
+func fts5yy_destructor(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor uint8, fts5yypminor uintptr) { /* sqlite3.c:209893:13: */
+ var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
+ _ = pParse
+
+ switch 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
+ // reduce or during error processing or when a parser is
+ // being destroyed before it is finished parsing.
+ //
+ // Note: during a reduce, the only symbols destroyed are those
+ // which appear on the RHS of the rule, but which are *not* used
+ // inside the C code.
+ //******** Begin destructor definitions **************************************
+ case 16: /* input */
+ {
+ _ = pParse
+ }
+ break
+ case 17:
+ fallthrough // expr
+ case 18:
+ fallthrough // cnearset
+ case 19: /* exprlist */
+ {
+ sqlite3Fts5ParseNodeFree(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor /* .Ffts5yy24 */)))
+ }
+ break
+ case 20:
+ fallthrough // colset
+ case 21: /* colsetlist */
+ {
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor /* .Ffts5yy11 */)))
+ }
+ break
+ case 22:
+ fallthrough // nearset
+ case 23: /* nearphrases */
+ {
+ sqlite3Fts5ParseNearsetFree(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor /* .Ffts5yy46 */)))
+ }
+ break
+ case 24: /* phrase */
+ {
+ sqlite3Fts5ParsePhraseFree(tls, *(*uintptr)(unsafe.Pointer(fts5yypminor /* .Ffts5yy53 */)))
+ }
+ break
+ //******** End destructor definitions ****************************************
+ default:
+ break
+ }
+}
+
+// Pop the parser's stack once.
+//
+// If there is a destructor routine associated with the token which
+// is popped from the stack, then call it.
+func fts5yy_pop_parser_stack(tls *libc.TLS, pParser uintptr) { /* sqlite3.c:209952:13: */
+ var fts5yytos uintptr
+
+ fts5yytos = libc.PostDecUintptr(&(*Fts5yyParser)(unsafe.Pointer(pParser)).Ffts5yytos, 24)
+ fts5yy_destructor(tls, pParser, (*Fts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fmajor, (fts5yytos + 8 /* &.minor */))
+}
+
+// Clear all secondary memory allocations from the parser
+func sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { /* sqlite3.c:209970:13: */
+ var pParser uintptr = p
+ for (*Fts5yyParser)(unsafe.Pointer(pParser)).Ffts5yytos > pParser+16 /* &.fts5yystack */ {
+ fts5yy_pop_parser_stack(tls, pParser)
+ }
+}
+
+// Deallocate and destroy a parser. Destructors are called for
+// all stack elements before shutting the parser down.
+//
+// If the fts5YYPARSEFREENEVERNULL macro exists (for example because it
+// is defined in a %include section of the input grammar) then it is
+// assumed that the input pointer is never NULL.
+func sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { /* sqlite3.c:209987:13: */
+ if p == uintptr(0) {
+ return
+ }
+ sqlite3Fts5ParserFinalize(tls, p)
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&freeProc)))(tls, p)
+}
+
+// Return the peak depth of the stack for a parser.
+
+// This array of booleans keeps track of the parser statement
+// coverage. The element fts5yycoverage[X][Y] is set when the parser
+// is in state X and has a lookahead token Y. In a well-tested
+// systems, every element of this matrix should end up being set.
+
+// Write into out a description of every state/lookahead combination that
+//
+// (1) has not been used by the parser, and
+// (2) is not a syntax error.
+//
+// Return the number of missed state/lookahead combinations.
+
+// Find the appropriate action for a parser given the terminal
+// look-ahead token iLookAhead.
+func fts5yy_find_shift_action(tls *libc.TLS, iLookAhead uint8, stateno uint8) uint8 { /* sqlite3.c:210050:25: */
+ var i int32
+
+ if int32(stateno) > 34 {
+ return stateno
+ }
+
+ for ok := true; ok; ok = 1 != 0 {
+ i = int32(fts5yy_shift_ofst[stateno])
+
+ i = i + (int32(iLookAhead))
+
+ if int32(fts5yy_lookahead[i]) != int32(iLookAhead) {
+ return fts5yy_default[stateno]
+ } else {
+
+ return fts5yy_action[i]
+ }
+ }
+ return uint8(0)
+}
+
+// Find the appropriate action for a parser given the non-terminal
+// look-ahead token iLookAhead.
+func fts5yy_find_reduce_action(tls *libc.TLS, stateno uint8, iLookAhead uint8) uint8 { /* sqlite3.c:210115:25: */
+ var i int32
+
+ i = int32(fts5yy_reduce_ofst[stateno])
+
+ i = i + (int32(iLookAhead))
+
+ return fts5yy_action[i]
+}
+
+// The following routine is called if the stack overflows.
+func fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:210144:13: */
+ var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
+
+ for (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > fts5yypParser+16 /* &.fts5yystack */ {
+ fts5yy_pop_parser_stack(tls, fts5yypParser)
+ }
+ // Here code is inserted which will execute if the parser
+ // stack every overflows
+ //******* Begin %stack_overflow code *****************************************
+
+ sqlite3Fts5ParseError(tls, pParse, ts+36239 /* "fts5: parser sta..." */, 0)
+ //******* End %stack_overflow code *******************************************
+ (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse // Suppress warning about unused %extra_argument var
+
+}
+
+// Print tracing information for a SHIFT action
+
+// Perform a shift action.
+func fts5yy_shift(tls *libc.TLS, fts5yypParser uintptr, fts5yyNewState uint8, fts5yyMajor uint8, fts5yyMinor Fts5Token) { /* sqlite3.c:210187:13: */
+ var fts5yytos uintptr
+ (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos += 24
+ if (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd {
+ (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos -= 24
+ fts5yyStackOverflow(tls, fts5yypParser)
+ return
+ }
+ if int32(fts5yyNewState) > 34 {
+ fts5yyNewState = uint8(int32(fts5yyNewState) + (83 - 52))
+ }
+ fts5yytos = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos
+ (*Fts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fstateno = fts5yyNewState
+ (*Fts5yyStackEntry)(unsafe.Pointer(fts5yytos)).Fmajor = fts5yyMajor
+ *(*Fts5Token)(unsafe.Pointer(fts5yytos + 8 /* &.minor */)) = fts5yyMinor
+
+}
+
+// For rule J, fts5yyRuleInfoLhs[J] contains the symbol on the left-hand side
+// of that rule
+var fts5yyRuleInfoLhs = [28]uint8{
+ uint8(16), // (0) input ::= expr
+ uint8(20), // (1) colset ::= MINUS LCP colsetlist RCP
+ uint8(20), // (2) colset ::= LCP colsetlist RCP
+ uint8(20), // (3) colset ::= STRING
+ uint8(20), // (4) colset ::= MINUS STRING
+ uint8(21), // (5) colsetlist ::= colsetlist STRING
+ uint8(21), // (6) colsetlist ::= STRING
+ uint8(17), // (7) expr ::= expr AND expr
+ uint8(17), // (8) expr ::= expr OR expr
+ uint8(17), // (9) expr ::= expr NOT expr
+ uint8(17), // (10) expr ::= colset COLON LP expr RP
+ uint8(17), // (11) expr ::= LP expr RP
+ uint8(17), // (12) expr ::= exprlist
+ uint8(19), // (13) exprlist ::= cnearset
+ uint8(19), // (14) exprlist ::= exprlist cnearset
+ uint8(18), // (15) cnearset ::= nearset
+ uint8(18), // (16) cnearset ::= colset COLON nearset
+ uint8(22), // (17) nearset ::= phrase
+ uint8(22), // (18) nearset ::= CARET phrase
+ uint8(22), // (19) nearset ::= STRING LP nearphrases neardist_opt RP
+ uint8(23), // (20) nearphrases ::= phrase
+ uint8(23), // (21) nearphrases ::= nearphrases phrase
+ uint8(25), // (22) neardist_opt ::=
+ uint8(25), // (23) neardist_opt ::= COMMA STRING
+ uint8(24), // (24) phrase ::= phrase PLUS STRING star_opt
+ uint8(24), // (25) phrase ::= STRING star_opt
+ uint8(26), // (26) star_opt ::= STAR
+ uint8(26), // (27) star_opt ::=
+} /* sqlite3.c:210228:29 */
+
+// For rule J, fts5yyRuleInfoNRhs[J] contains the negative of the number
+// of symbols on the right-hand side of that rule.
+var fts5yyRuleInfoNRhs = [28]int8{
+ int8(-1), // (0) input ::= expr
+ int8(-4), // (1) colset ::= MINUS LCP colsetlist RCP
+ int8(-3), // (2) colset ::= LCP colsetlist RCP
+ int8(-1), // (3) colset ::= STRING
+ int8(-2), // (4) colset ::= MINUS STRING
+ int8(-2), // (5) colsetlist ::= colsetlist STRING
+ int8(-1), // (6) colsetlist ::= STRING
+ int8(-3), // (7) expr ::= expr AND expr
+ int8(-3), // (8) expr ::= expr OR expr
+ int8(-3), // (9) expr ::= expr NOT expr
+ int8(-5), // (10) expr ::= colset COLON LP expr RP
+ int8(-3), // (11) expr ::= LP expr RP
+ int8(-1), // (12) expr ::= exprlist
+ int8(-1), // (13) exprlist ::= cnearset
+ int8(-2), // (14) exprlist ::= exprlist cnearset
+ int8(-1), // (15) cnearset ::= nearset
+ int8(-3), // (16) cnearset ::= colset COLON nearset
+ int8(-1), // (17) nearset ::= phrase
+ int8(-2), // (18) nearset ::= CARET phrase
+ int8(-5), // (19) nearset ::= STRING LP nearphrases neardist_opt RP
+ int8(-1), // (20) nearphrases ::= phrase
+ int8(-2), // (21) nearphrases ::= nearphrases phrase
+ int8(0), // (22) neardist_opt ::=
+ int8(-2), // (23) neardist_opt ::= COMMA STRING
+ int8(-4), // (24) phrase ::= phrase PLUS STRING star_opt
+ int8(-2), // (25) phrase ::= STRING star_opt
+ int8(-1), // (26) star_opt ::= STAR
+ int8(0), // (27) star_opt ::=
+} /* sqlite3.c:210261:26 */ // Forward Declaration
+
+// Perform a reduce action and the shift that must immediately
+// follow the reduce.
+//
+// The fts5yyLookahead and fts5yyLookaheadToken parameters provide reduce actions
+// access to the lookahead token (if any). The fts5yyLookahead will be fts5YYNOCODE
+// if the lookahead token has already been consumed. As this procedure is
+// only called from one place, optimizing compilers will in-line it, which
+// means that the extra parameters have no performance impact.
+func fts5yy_reduce(tls *libc.TLS, fts5yypParser uintptr, fts5yyruleno uint32, fts5yyLookahead int32, fts5yyLookaheadToken Fts5Token) uint8 { /* sqlite3.c:210304:25: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var fts5yygoto int32 // The next state
+ var fts5yyact uint8 // The next action
+ var fts5yymsp uintptr // The top of the parser's stack
+ var fts5yysize int32 // Amount to pop the stack
+ var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
+ _ = fts5yyLookahead
+ _ = fts5yyLookaheadToken
+ fts5yymsp = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos
+
+ // Check that the stack is large enough to grow by a single entry
+ // if the RHS of the rule is empty. This ensures that there is room
+ // enough on the stack to push the LHS value
+ if int32(fts5yyRuleInfoNRhs[fts5yyruleno]) == 0 {
+ if (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos >= (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yystackEnd {
+ fts5yyStackOverflow(tls, fts5yypParser)
+ // The call to fts5yyStackOverflow() above pops the stack until it is
+ // empty, causing the main parser loop to exit. So the return value
+ // is never used and does not matter.
+ return uint8(0)
+ }
+ }
+
+ switch fts5yyruleno {
+ // Beginning here are the reduction cases. A typical example
+ // follows:
+ // case 0:
+ // #line <lineno> <grammarfile>
+ // { ... } // User supplied code
+ // #line <lineno> <thisfile>
+ // break;
+ //********* Begin reduce actions *********************************************
+ // var fts5yylhsminor Fts5YYMINORTYPE at bp, 16
+
+ case uint32(0): /* input ::= expr */
+ {
+ sqlite3Fts5ParseFinished(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ }
+ break
+ case uint32(1): /* colset ::= MINUS LCP colsetlist RCP */
+ {
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = sqlite3Fts5ParseColsetInvert(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ }
+ break
+ case uint32(2): /* colset ::= LCP colsetlist RCP */
+ {
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ }
+ break
+ case uint32(3): /* colset ::= STRING */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseColset(tls, pParse, uintptr(0), (fts5yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.fts5yy0 */))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(4): /* colset ::= MINUS STRING */
+ {
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = sqlite3Fts5ParseColset(tls, pParse, uintptr(0), (fts5yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.fts5yy0 */))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = sqlite3Fts5ParseColsetInvert(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)))
+ }
+ break
+ case uint32(5): /* colsetlist ::= colsetlist STRING */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseColset(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), (fts5yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.fts5yy0 */))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(6): /* colsetlist ::= STRING */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseColset(tls, pParse, uintptr(0), (fts5yymsp + uintptr(0)*24 + 8 /* &.minor */ /* &.fts5yy0 */))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(7): /* expr ::= expr AND expr */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, 2, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(8): /* expr ::= expr OR expr */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, 1, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(9): /* expr ::= expr NOT expr */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, 3, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)), uintptr(0))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(10): /* expr ::= colset COLON LP expr RP */
+ {
+ sqlite3Fts5ParseSetColset(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(11): /* expr ::= LP expr RP */
+ {
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */))
+ }
+ break
+ case uint32(12):
+ fallthrough // expr ::= exprlist
+ case uint32(13): /* exprlist ::= cnearset */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(14): /* exprlist ::= exprlist cnearset */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseImplicitAnd(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(15): /* cnearset ::= nearset */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, 9, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(16): /* cnearset ::= colset COLON nearset */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNode(tls, pParse, 9, uintptr(0), uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ sqlite3Fts5ParseSetColset(tls, pParse, *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(17): /* nearset ::= phrase */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(18): /* nearset ::= CARET phrase */
+ {
+ sqlite3Fts5ParseSetCaret(tls, *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ }
+ break
+ case uint32(19): /* nearset ::= STRING LP nearphrases neardist_opt RP */
+ {
+ sqlite3Fts5ParseNear(tls, pParse, (fts5yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */ /* &.fts5yy0 */))
+ sqlite3Fts5ParseSetDistance(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */)), (fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.fts5yy0 */))
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-2)*24 + 8 /* &.minor */))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-4)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(20): /* nearphrases ::= phrase */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNearset(tls, pParse, uintptr(0), *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(21): /* nearphrases ::= nearphrases phrase */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseNearset(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)), *(*uintptr)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(22): /* neardist_opt ::= */
+ {
+ (*Fts5Token)(unsafe.Pointer(fts5yymsp + uintptr(1)*24 + 8 /* &.minor */)).Fp = uintptr(0)
+ (*Fts5Token)(unsafe.Pointer(fts5yymsp + uintptr(1)*24 + 8 /* &.minor */)).Fn = 0
+ }
+ break
+ case uint32(23): /* neardist_opt ::= COMMA STRING */
+ {
+ *(*Fts5Token)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*Fts5Token)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */))
+ }
+ break
+ case uint32(24): /* phrase ::= phrase PLUS STRING star_opt */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)), (fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.fts5yy0 */), *(*int32)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-3)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(25): /* phrase ::= STRING star_opt */
+ {
+ *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */)) = sqlite3Fts5ParseTerm(tls, pParse, uintptr(0), (fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */ /* &.fts5yy0 */), *(*int32)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)))
+ }
+ *(*uintptr)(unsafe.Pointer(fts5yymsp + libc.UintptrFromInt32(-1)*24 + 8 /* &.minor */)) = *(*uintptr)(unsafe.Pointer(bp /* &fts5yylhsminor */))
+ break
+ case uint32(26): /* star_opt ::= STAR */
+ {
+ *(*int32)(unsafe.Pointer(fts5yymsp + uintptr(0)*24 + 8 /* &.minor */)) = 1
+ }
+ break
+ case uint32(27): /* star_opt ::= */
+ {
+ *(*int32)(unsafe.Pointer(fts5yymsp + uintptr(1)*24 + 8 /* &.minor */)) = 0
+ }
+ break
+ default:
+ break
+ }
+
+ fts5yygoto = int32(fts5yyRuleInfoLhs[fts5yyruleno])
+ fts5yysize = int32(fts5yyRuleInfoNRhs[fts5yyruleno])
+ fts5yyact = fts5yy_find_reduce_action(tls, (*Fts5yyStackEntry)(unsafe.Pointer(fts5yymsp+uintptr(fts5yysize)*24)).Fstateno, 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 += 24 * (uintptr(fts5yysize + 1))
+ (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos = fts5yymsp
+ (*Fts5yyStackEntry)(unsafe.Pointer(fts5yymsp)).Fstateno = fts5yyact
+ (*Fts5yyStackEntry)(unsafe.Pointer(fts5yymsp)).Fmajor = uint8(fts5yygoto)
+
+ return fts5yyact
+}
+
+// The following code executes when the parse fails
+
+// The following code executes when a syntax error first occurs.
+func fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int32, fts5yyminor Fts5Token) { /* sqlite3.c:210570:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
+
+ //*********** Begin %syntax_error code ***************************************
+
+ _ = fts5yymajor // Silence a compiler warning
+ sqlite3Fts5ParseError(tls,
+ pParse, ts+36267 /* "fts5: syntax err..." */, libc.VaList(bp, fts5yyminor.Fn, fts5yyminor.Fp))
+ //*********** End %syntax_error code *****************************************
+ (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse // Suppress warning about unused %extra_argument variable
+
+}
+
+// The following is executed when the parser accepts
+func fts5yy_accept(tls *libc.TLS, fts5yypParser uintptr) { /* sqlite3.c:210592:13: */
+ var pParse uintptr = (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse
+
+ // Here code is inserted which will be executed whenever the
+ // parser accepts
+ //********** Begin %parse_accept code ****************************************
+ //********** End %parse_accept code ******************************************
+ (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse // Suppress warning about unused %extra_argument variable
+
+}
+
+// The main parser program.
+// The first argument is a pointer to a structure obtained from
+// "sqlite3Fts5ParserAlloc" which describes the current state of the parser.
+// The second argument is the major token number. The third is
+// the minor token. The fourth optional argument is whatever the
+// user wants (and specified in the grammar) and is available for
+// use by the action routines.
+//
+// Inputs:
+// <ul>
+// <li> A pointer to the parser (an opaque structure.)
+// <li> The major token number.
+// <li> The minor token number.
+// <li> An option argument of a grammar-specified type.
+// </ul>
+//
+// Outputs:
+// None.
+func sqlite3Fts5Parser(tls *libc.TLS, fts5yyp uintptr, fts5yymajor int32, fts5yyminor Fts5Token, pParse uintptr) { /* sqlite3.c:210633:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ // var fts5yyminorunion Fts5YYMINORTYPE at bp, 16
+
+ var fts5yyact uint8 // The parser action.
+ var fts5yypParser uintptr = fts5yyp // The parser
+
+ (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse
+
+ fts5yyact = (*Fts5yyStackEntry)(unsafe.Pointer((*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos)).Fstateno
+
+ for ok := true; ok; ok = ((*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos > fts5yypParser+16 /* &.fts5yystack */) {
+
+ fts5yyact = fts5yy_find_shift_action(tls, uint8(fts5yymajor), fts5yyact)
+ if int32(fts5yyact) >= 83 {
+ fts5yyact = fts5yy_reduce(tls, fts5yypParser, (uint32(int32(fts5yyact) - 83)), fts5yymajor,
+ fts5yyminor)
+ } else if int32(fts5yyact) <= 79 {
+ fts5yy_shift(tls, fts5yypParser, fts5yyact, uint8(fts5yymajor), fts5yyminor)
+ break
+ } else if int32(fts5yyact) == 81 {
+ (*Fts5yyParser)(unsafe.Pointer(fts5yypParser)).Ffts5yytos -= 24
+ fts5yy_accept(tls, fts5yypParser)
+ return
+ } else {
+
+ *(*Fts5Token)(unsafe.Pointer(bp /* &fts5yyminorunion */)) = fts5yyminor
+ // If the fts5YYNOERRORRECOVERY macro is defined, then do not attempt to
+ // do any kind of error recovery. Instead, simply invoke the syntax
+ // error routine and continue going as if nothing had happened.
+ //
+ // Applications can set this macro (for example inside %include) if
+ // 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 /* &fts5yyminorunion */)
+ break
+ }
+ }
+ return
+}
+
+// Return the fallback token corresponding to canonical token iToken, or
+// 0 if iToken has no fallback.
+func sqlite3Fts5ParserFallback(tls *libc.TLS, iToken int32) int32 { /* sqlite3.c:210807:12: */
+ _ = iToken
+ return 0
+}
+
+// 2014 May 31
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+
+// #include "fts5Int.h"
+// Declarations for math functions.
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// ISO C99 Standard: 7.12 Mathematics <math.h>
+
+// Object used to iterate through all "coalesced phrase instances" in
+// a single column of the current row. If the phrase instances in the
+// column being considered do not overlap, this object simply iterates
+// through them. Or, if they do overlap (share one or more tokens in
+// common), each set of overlapping instances is treated as a single
+// match. See documentation for the highlight() auxiliary function for
+// details.
+//
+// Usage is:
+//
+// for(rc = fts5CInstIterNext(pApi, pFts, iCol, &iter);
+// (rc==SQLITE_OK && 0==fts5CInstIterEof(&iter);
+// rc = fts5CInstIterNext(&iter)
+// ){
+// printf("instance starts at %d, ends at %d\n", iter.iStart, iter.iEnd);
+// }
+//
+type CInstIter1 = struct {
+ FpApi uintptr
+ FpFts uintptr
+ FiCol int32
+ FiInst int32
+ FnInst int32
+ FiStart int32
+ FiEnd int32
+ _ [4]byte
+}
+
+// 2014 May 31
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+
+// #include "fts5Int.h"
+// Declarations for math functions.
+// Copyright (C) 1991-2018 Free Software Foundation, Inc.
+// This file is part of the GNU C Library.
+//
+// The GNU C Library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// The GNU C Library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with the GNU C Library; if not, see
+// <http://www.gnu.org/licenses/>.
+
+// ISO C99 Standard: 7.12 Mathematics <math.h>
+
+// Object used to iterate through all "coalesced phrase instances" in
+// a single column of the current row. If the phrase instances in the
+// column being considered do not overlap, this object simply iterates
+// through them. Or, if they do overlap (share one or more tokens in
+// common), each set of overlapping instances is treated as a single
+// match. See documentation for the highlight() auxiliary function for
+// details.
+//
+// Usage is:
+//
+// for(rc = fts5CInstIterNext(pApi, pFts, iCol, &iter);
+// (rc==SQLITE_OK && 0==fts5CInstIterEof(&iter);
+// rc = fts5CInstIterNext(&iter)
+// ){
+// printf("instance starts at %d, ends at %d\n", iter.iStart, iter.iEnd);
+// }
+//
+type CInstIter = CInstIter1 /* sqlite3.c:210853:26 */
+
+// Advance the iterator to the next coalesced phrase instance. Return
+// an SQLite error code if an error occurs, or SQLITE_OK otherwise.
+func fts5CInstIterNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:210870:12: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ var rc int32 = 0
+ (*CInstIter)(unsafe.Pointer(pIter)).FiStart = -1
+ (*CInstIter)(unsafe.Pointer(pIter)).FiEnd = -1
+
+ for (rc == 0) && ((*CInstIter)(unsafe.Pointer(pIter)).FiInst < (*CInstIter)(unsafe.Pointer(pIter)).FnInst) {
+ // var ip int32 at bp, 4
+
+ // var ic int32 at bp+4, 4
+
+ // var io int32 at bp+8, 4
+
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(((*CInstIter)(unsafe.Pointer(pIter)).FpApi + 72 /* &.xInst */))))(tls, (*CInstIter)(unsafe.Pointer(pIter)).FpFts, (*CInstIter)(unsafe.Pointer(pIter)).FiInst, bp /* &ip */, bp+4 /* &ic */, bp+8 /* &io */)
+ if rc == 0 {
+ if *(*int32)(unsafe.Pointer(bp + 4 /* ic */)) == (*CInstIter)(unsafe.Pointer(pIter)).FiCol {
+ var iEnd int32 = ((*(*int32)(unsafe.Pointer(bp + 8 /* io */)) - 1) + (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(((*CInstIter)(unsafe.Pointer(pIter)).FpApi + 56 /* &.xPhraseSize */))))(tls, (*CInstIter)(unsafe.Pointer(pIter)).FpFts, *(*int32)(unsafe.Pointer(bp /* ip */))))
+ if (*CInstIter)(unsafe.Pointer(pIter)).FiStart < 0 {
+ (*CInstIter)(unsafe.Pointer(pIter)).FiStart = *(*int32)(unsafe.Pointer(bp + 8 /* io */))
+ (*CInstIter)(unsafe.Pointer(pIter)).FiEnd = iEnd
+ } else if *(*int32)(unsafe.Pointer(bp + 8 /* io */)) <= (*CInstIter)(unsafe.Pointer(pIter)).FiEnd {
+ if iEnd > (*CInstIter)(unsafe.Pointer(pIter)).FiEnd {
+ (*CInstIter)(unsafe.Pointer(pIter)).FiEnd = iEnd
+ }
+ } else {
+ break
+ }
+ }
+ (*CInstIter)(unsafe.Pointer(pIter)).FiInst++
+ }
+ }
+
+ return rc
+}
+
+// Initialize the iterator object indicated by the final parameter to
+// iterate through coalesced phrase instances in column iCol.
+func fts5CInstIterInit(tls *libc.TLS, pApi uintptr, pFts uintptr, iCol int32, pIter uintptr) int32 { /* sqlite3.c:210901:12: */
+ var rc int32
+
+ libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(CInstIter{})))
+ (*CInstIter)(unsafe.Pointer(pIter)).FpApi = pApi
+ (*CInstIter)(unsafe.Pointer(pIter)).FpFts = pFts
+ (*CInstIter)(unsafe.Pointer(pIter)).FiCol = iCol
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 64 /* &.xInstCount */))))(tls, pFts, (pIter + 24 /* &.nInst */))
+
+ if rc == 0 {
+ rc = fts5CInstIterNext(tls, pIter)
+ }
+
+ return rc
+}
+
+// ************************************************************************
+//
+// Start of highlight() implementation.
+type HighlightContext1 = struct {
+ Fiter CInstIter
+ FiPos int32
+ FiRangeStart int32
+ FiRangeEnd int32
+ FzOpen uintptr
+ FzClose uintptr
+ FzIn uintptr
+ FnIn int32
+ FiOff int32
+ FzOut uintptr
+}
+
+// ************************************************************************
+//
+// Start of highlight() implementation.
+type HighlightContext = HighlightContext1 /* sqlite3.c:210927:33 */
+
+// Append text to the HighlightContext output string - p->zOut. Argument
+// z points to a buffer containing n bytes of text to append. If n is
+// negative, everything up until the first '\0' is appended to the output.
+//
+// If *pRc is set to any value other than SQLITE_OK when this function is
+// called, it is a no-op. If an error (i.e. an OOM condition) is encountered,
+// *pRc is set to an error code before returning.
+func fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n int32) { /* sqlite3.c:210950:13: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ if (*(*int32)(unsafe.Pointer(pRc)) == 0) && (z != 0) {
+ if n < 0 {
+ n = int32(libc.Xstrlen(tls, z))
+ }
+ (*HighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, ts+36298 /* "%z%.*s" */, libc.VaList(bp, (*HighlightContext)(unsafe.Pointer(p)).FzOut, n, z))
+ if (*HighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) {
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+ }
+ }
+}
+
+// Tokenizer callback used by implementation of highlight() function.
+func fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:210965:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var p uintptr = pContext
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ var iPos int32
+
+ _ = pToken
+ _ = nToken
+
+ if (tflags & 0x0001) != 0 {
+ return 0
+ }
+ iPos = libc.PostIncInt32(&(*HighlightContext)(unsafe.Pointer(p)).FiPos, 1)
+
+ if (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd > 0 {
+ if (iPos < (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart) || (iPos > (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd) {
+ return 0
+ }
+ if ((*HighlightContext)(unsafe.Pointer(p)).FiRangeStart != 0) && (iPos == (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart) {
+ (*HighlightContext)(unsafe.Pointer(p)).FiOff = iStartOff
+ }
+ }
+
+ if iPos == (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiStart {
+ fts5HighlightAppend(tls, bp /* &rc */, p, ((*HighlightContext)(unsafe.Pointer(p)).FzIn + uintptr((*HighlightContext)(unsafe.Pointer(p)).FiOff)), (iStartOff - (*HighlightContext)(unsafe.Pointer(p)).FiOff))
+ fts5HighlightAppend(tls, bp /* &rc */, p, (*HighlightContext)(unsafe.Pointer(p)).FzOpen, -1)
+ (*HighlightContext)(unsafe.Pointer(p)).FiOff = iStartOff
+ }
+
+ if iPos == (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiEnd {
+ if ((*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd != 0) && ((*HighlightContext)(unsafe.Pointer(p)).Fiter.FiStart < (*HighlightContext)(unsafe.Pointer(p)).FiRangeStart) {
+ fts5HighlightAppend(tls, bp /* &rc */, p, (*HighlightContext)(unsafe.Pointer(p)).FzOpen, -1)
+ }
+ fts5HighlightAppend(tls, bp /* &rc */, p, ((*HighlightContext)(unsafe.Pointer(p)).FzIn + uintptr((*HighlightContext)(unsafe.Pointer(p)).FiOff)), (iEndOff - (*HighlightContext)(unsafe.Pointer(p)).FiOff))
+ fts5HighlightAppend(tls, bp /* &rc */, p, (*HighlightContext)(unsafe.Pointer(p)).FzClose, -1)
+ (*HighlightContext)(unsafe.Pointer(p)).FiOff = iEndOff
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = fts5CInstIterNext(tls, (p /* &.iter */))
+ }
+ }
+
+ if ((*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd > 0) && (iPos == (*HighlightContext)(unsafe.Pointer(p)).FiRangeEnd) {
+ fts5HighlightAppend(tls, bp /* &rc */, p, ((*HighlightContext)(unsafe.Pointer(p)).FzIn + uintptr((*HighlightContext)(unsafe.Pointer(p)).FiOff)), (iEndOff - (*HighlightContext)(unsafe.Pointer(p)).FiOff))
+ (*HighlightContext)(unsafe.Pointer(p)).FiOff = iEndOff
+ if (iPos >= (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiStart) && (iPos < (*HighlightContext)(unsafe.Pointer(p)).Fiter.FiEnd) {
+ fts5HighlightAppend(tls, bp /* &rc */, p, (*HighlightContext)(unsafe.Pointer(p)).FzClose, -1)
+ }
+ }
+
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+}
+
+// Implementation of highlight() function.
+func fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:211019:13: */
+ bp := tls.Alloc(100)
+ defer tls.Free(100)
+
+ // var ctx HighlightContext at bp, 96
+
+ // var rc int32 at bp+96, 4
+
+ var iCol int32
+
+ if nVal != 3 {
+ var zErr uintptr = ts + 36305 /* "wrong number of ..." */
+ Xsqlite3_result_error(tls, pCtx, zErr, -1)
+ return
+ }
+
+ iCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
+ libc.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(HighlightContext{})))
+ (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzOpen = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8)))
+ (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzClose = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(2)*8)))
+ *(*int32)(unsafe.Pointer(bp + 96 /* rc */)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 88 /* &.xColumnText */))))(tls, pFts, iCol, (bp /* &ctx */ + 72 /* &.zIn */), (bp /* &ctx */ + 80 /* &.nIn */))
+
+ if (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzIn != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 96 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 96 /* rc */)) = fts5CInstIterInit(tls, pApi, pFts, iCol, (bp /* &ctx */ /* &.iter */))
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 96 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 96 /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 40 /* &.xTokenize */))))(tls, pFts, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzIn, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FnIn, bp /* &ctx */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{fts5HighlightCb})))
+ }
+ fts5HighlightAppend(tls, bp+96 /* &rc */, bp /* &ctx */, ((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzIn + uintptr((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiOff)), ((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FnIn - (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiOff))
+
+ if *(*int32)(unsafe.Pointer(bp + 96 /* rc */)) == 0 {
+ Xsqlite3_result_text(tls, pCtx, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzOut, -1, libc.UintptrFromInt32(-1))
+ }
+ Xsqlite3_free(tls, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzOut)
+ }
+ if *(*int32)(unsafe.Pointer(bp + 96 /* rc */)) != 0 {
+ Xsqlite3_result_error_code(tls, pCtx, *(*int32)(unsafe.Pointer(bp + 96 /* rc */)))
+ }
+}
+
+//
+// End of highlight() implementation.
+//
+
+// Context object passed to the fts5SentenceFinderCb() function.
+type Fts5SFinder1 = struct {
+ FiPos int32
+ FnFirstAlloc int32
+ FnFirst int32
+ FaFirst uintptr
+ FzDoc uintptr
+}
+
+//
+// End of highlight() implementation.
+//
+
+// Context object passed to the fts5SentenceFinderCb() function.
+type Fts5SFinder = Fts5SFinder1 /* sqlite3.c:211068:28 */
+
+// Add an entry to the Fts5SFinder.aFirst[] array. Grow the array if
+// necessary. Return SQLITE_OK if successful, or SQLITE_NOMEM if an
+// error occurs.
+func fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) int32 { /* sqlite3.c:211082:12: */
+ if (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc == (*Fts5SFinder)(unsafe.Pointer(p)).FnFirst {
+ var nNew int32
+ if (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc != 0 {
+ nNew = ((*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc * 2)
+ } else {
+ nNew = 64
+ }
+ var aNew uintptr
+
+ aNew = Xsqlite3_realloc64(tls, (*Fts5SFinder)(unsafe.Pointer(p)).FaFirst, (uint64(uint64(nNew) * uint64(unsafe.Sizeof(int32(0))))))
+ if aNew == uintptr(0) {
+ return 7
+ }
+ (*Fts5SFinder)(unsafe.Pointer(p)).FaFirst = aNew
+ (*Fts5SFinder)(unsafe.Pointer(p)).FnFirstAlloc = nNew
+ }
+ *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(p)).FaFirst + uintptr(libc.PostIncInt32(&(*Fts5SFinder)(unsafe.Pointer(p)).FnFirst, 1))*4)) = iAdd
+ return 0
+}
+
+// This function is an xTokenize() callback used by the auxiliary snippet()
+// function. Its job is to identify tokens that are the first in a sentence.
+// For each such token, an entry is added to the SFinder.aFirst[] array.
+func fts5SentenceFinderCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iStartOff int32, iEndOff int32) int32 { /* sqlite3.c:211101:12: */
+ var rc int32 = 0
+
+ _ = pToken
+ _ = nToken
+ _ = iEndOff
+
+ if (tflags & 0x0001) == 0 {
+ var p uintptr = pContext
+ if (*Fts5SFinder)(unsafe.Pointer(p)).FiPos > 0 {
+ var i int32
+ var c int8 = int8(0)
+ for i = (iStartOff - 1); i >= 0; i-- {
+ c = *(*int8)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(p)).FzDoc + uintptr(i)))
+ if (((int32(c) != ' ') && (int32(c) != '\t')) && (int32(c) != '\n')) && (int32(c) != '\r') {
+ break
+ }
+ }
+ if (i != (iStartOff - 1)) && ((int32(c) == '.') || (int32(c) == ':')) {
+ rc = fts5SentenceFinderAdd(tls, p, (*Fts5SFinder)(unsafe.Pointer(p)).FiPos)
+ }
+ } else {
+ rc = fts5SentenceFinderAdd(tls, p, 0)
+ }
+ (*Fts5SFinder)(unsafe.Pointer(p)).FiPos++
+ }
+ return rc
+}
+
+func fts5SnippetScore(tls *libc.TLS, pApi uintptr, pFts uintptr, nDocsize int32, aSeen uintptr, iCol int32, iPos int32, nToken int32, pnScore uintptr, piPos uintptr) int32 { /* sqlite3.c:211134:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var rc int32
+ var i int32
+ *(*int32)(unsafe.Pointer(bp + 4 /* ip */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 8 /* ic */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) = 0
+ var iFirst int32 = -1
+ // var nInst int32 at bp, 4
+
+ var nScore int32 = 0
+ var iLast int32 = 0
+ var iEnd Sqlite3_int64 = (Sqlite3_int64(iPos) + Sqlite3_int64(nToken))
+
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 64 /* &.xInstCount */))))(tls, pFts, bp /* &nInst */)
+ for i = 0; (i < *(*int32)(unsafe.Pointer(bp /* nInst */))) && (rc == 0); i++ {
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 72 /* &.xInst */))))(tls, pFts, i, bp+4 /* &ip */, bp+8 /* &ic */, bp+12 /* &iOff */)
+ if (((rc == 0) && (*(*int32)(unsafe.Pointer(bp + 8 /* ic */)) == iCol)) && (*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) >= iPos)) && (Sqlite3_int64(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */))) < iEnd) {
+ nScore = nScore + (func() int32 {
+ if *(*uint8)(unsafe.Pointer(aSeen + uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* ip */))))) != 0 {
+ return 1
+ }
+ return 1000
+ }())
+ *(*uint8)(unsafe.Pointer(aSeen + uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* ip */))))) = uint8(1)
+ if iFirst < 0 {
+ iFirst = *(*int32)(unsafe.Pointer(bp + 12 /* iOff */))
+ }
+ iLast = (*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) + (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer((pApi + 56 /* &.xPhraseSize */))))(tls, pFts, *(*int32)(unsafe.Pointer(bp + 4 /* ip */))))
+ }
+ }
+
+ *(*int32)(unsafe.Pointer(pnScore)) = nScore
+ if piPos != 0 {
+ var iAdj Sqlite3_int64 = (Sqlite3_int64(iFirst - ((nToken - (iLast - iFirst)) / 2)))
+ if (iAdj + Sqlite3_int64(nToken)) > Sqlite3_int64(nDocsize) {
+ iAdj = (Sqlite3_int64(nDocsize - nToken))
+ }
+ if iAdj < int64(0) {
+ iAdj = int64(0)
+ }
+ *(*int32)(unsafe.Pointer(piPos)) = int32(iAdj)
+ }
+
+ return rc
+}
+
+// Return the value in pVal interpreted as utf-8 text. Except, if pVal
+// contains a NULL value, return a pointer to a static string zero
+// bytes in length instead of a NULL pointer.
+func fts5ValueToText(tls *libc.TLS, pVal uintptr) uintptr { /* sqlite3.c:211183:19: */
+ var zRet uintptr = Xsqlite3_value_text(tls, pVal)
+ if zRet != 0 {
+ return zRet
+ }
+ return ts + 781 /* "" */
+}
+
+// Implementation of snippet() function.
+func fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:211191:13: */
+ bp := tls.Alloc(172)
+ defer tls.Free(172)
+
+ // var ctx HighlightContext at bp, 96
+
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = 0 // Return code
+ var iCol int32 // 1st argument to snippet()
+ var zEllips uintptr // 4th argument to snippet()
+ var nToken int32 // 5th argument to snippet()
+ *(*int32)(unsafe.Pointer(bp + 96 /* nInst */)) = 0 // Number of instance matches this row
+ var i int32 // Used to iterate through instances
+ var nPhrase int32 // Number of phrases in query
+ var aSeen uintptr // Array of "seen instance" flags
+ var iBestCol int32 // Column containing best snippet
+ var iBestStart int32 = 0 // First token of best snippet
+ var nBestScore int32 = 0 // Score of best snippet
+ *(*int32)(unsafe.Pointer(bp + 164 /* nColSize */)) = 0 // Total size of iBestCol in tokens
+ // var sFinder Fts5SFinder at bp+104, 32
+ // Used to find the beginnings of sentences
+ var nCol int32
+
+ if nVal != 5 {
+ var zErr uintptr = ts + 36355 /* "wrong number of ..." */
+ Xsqlite3_result_error(tls, pCtx, zErr, -1)
+ return
+ }
+
+ nCol = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pApi + 16 /* &.xColumnCount */))))(tls, pFts)
+ libc.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(HighlightContext{})))
+ iCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
+ (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzOpen = fts5ValueToText(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8)))
+ (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzClose = fts5ValueToText(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(2)*8)))
+ zEllips = fts5ValueToText(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(3)*8)))
+ nToken = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(4)*8)))
+
+ iBestCol = func() int32 {
+ if iCol >= 0 {
+ return iCol
+ }
+ return 0
+ }()
+ nPhrase = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pApi + 48 /* &.xPhraseCount */))))(tls, pFts)
+ aSeen = Xsqlite3_malloc(tls, nPhrase)
+ if aSeen == uintptr(0) {
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = 7
+ }
+ if *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 64 /* &.xInstCount */))))(tls, pFts, bp+96 /* &nInst */)
+ }
+
+ libc.Xmemset(tls, bp+104 /* &sFinder */, 0, uint64(unsafe.Sizeof(Fts5SFinder{})))
+ for i = 0; i < nCol; i++ {
+ if (iCol < 0) || (iCol == i) {
+ // var nDoc int32 at bp+136, 4
+
+ // var nDocsize int32 at bp+140, 4
+
+ var ii int32
+ (*Fts5SFinder)(unsafe.Pointer(bp + 104 /* &sFinder */)).FiPos = 0
+ (*Fts5SFinder)(unsafe.Pointer(bp + 104 /* &sFinder */)).FnFirst = 0
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 88 /* &.xColumnText */))))(tls, pFts, i, (bp + 104 /* &sFinder */ + 24 /* &.zDoc */), bp+136 /* &nDoc */)
+ if *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) != 0 {
+ break
+ }
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 40 /* &.xTokenize */))))(tls, pFts,
+ (*Fts5SFinder)(unsafe.Pointer(bp+104 /* &sFinder */)).FzDoc, *(*int32)(unsafe.Pointer(bp + 136 /* nDoc */)), bp+104 /* &sFinder */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{fts5SentenceFinderCb})))
+ if *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) != 0 {
+ break
+ }
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pApi + 96 /* &.xColumnSize */))))(tls, pFts, i, bp+140 /* &nDocsize */)
+ if *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) != 0 {
+ break
+ }
+
+ for ii = 0; (*(*int32)(unsafe.Pointer(bp + 168 /* rc */)) == 0) && (ii < *(*int32)(unsafe.Pointer(bp + 96 /* nInst */))); ii++ {
+ // var ip int32 at bp+144, 4
+
+ // var ic int32 at bp+148, 4
+
+ // var io int32 at bp+152, 4
+
+ // var iAdj int32 at bp+160, 4
+
+ // var nScore int32 at bp+156, 4
+
+ var jj int32
+
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 72 /* &.xInst */))))(tls, pFts, ii, bp+144 /* &ip */, bp+148 /* &ic */, bp+152 /* &io */)
+ if *(*int32)(unsafe.Pointer(bp + 148 /* ic */)) != i {
+ continue
+ }
+ if *(*int32)(unsafe.Pointer(bp + 152 /* io */)) > *(*int32)(unsafe.Pointer(bp + 140 /* nDocsize */)) {
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = (11 | (int32(1) << 8))
+ }
+ if *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) != 0 {
+ continue
+ }
+ libc.Xmemset(tls, aSeen, 0, uint64(nPhrase))
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 140 /* nDocsize */)), aSeen, i,
+ *(*int32)(unsafe.Pointer(bp + 152 /* io */)), nToken, bp+156 /* &nScore */, bp+160 /* &iAdj */)
+ if (*(*int32)(unsafe.Pointer(bp + 168 /* rc */)) == 0) && (*(*int32)(unsafe.Pointer(bp + 156 /* nScore */)) > nBestScore) {
+ nBestScore = *(*int32)(unsafe.Pointer(bp + 156 /* nScore */))
+ iBestCol = i
+ iBestStart = *(*int32)(unsafe.Pointer(bp + 160 /* iAdj */))
+ *(*int32)(unsafe.Pointer(bp + 164 /* nColSize */)) = *(*int32)(unsafe.Pointer(bp + 140 /* nDocsize */))
+ }
+
+ if ((*(*int32)(unsafe.Pointer(bp + 168 /* rc */)) == 0) && ((*Fts5SFinder)(unsafe.Pointer(bp+104 /* &sFinder */)).FnFirst != 0)) && (*(*int32)(unsafe.Pointer(bp + 140 /* nDocsize */)) > nToken) {
+ for jj = 0; jj < ((*Fts5SFinder)(unsafe.Pointer(bp+104 /* &sFinder */)).FnFirst - 1); jj++ {
+ if *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+104 /* &sFinder */)).FaFirst + uintptr((jj+1))*4)) > *(*int32)(unsafe.Pointer(bp + 152 /* io */)) {
+ break
+ }
+ }
+
+ if *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+104 /* &sFinder */)).FaFirst + uintptr(jj)*4)) < *(*int32)(unsafe.Pointer(bp + 152 /* io */)) {
+ libc.Xmemset(tls, aSeen, 0, uint64(nPhrase))
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 140 /* nDocsize */)), aSeen, i,
+ *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+104 /* &sFinder */)).FaFirst + uintptr(jj)*4)), nToken, bp+156 /* &nScore */, uintptr(0))
+
+ *(*int32)(unsafe.Pointer(bp + 156 /* nScore */)) += func() int32 {
+ if *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+104 /* &sFinder */)).FaFirst + uintptr(jj)*4)) == 0 {
+ return 120
+ }
+ return 100
+ }()
+ if (*(*int32)(unsafe.Pointer(bp + 168 /* rc */)) == 0) && (*(*int32)(unsafe.Pointer(bp + 156 /* nScore */)) > nBestScore) {
+ nBestScore = *(*int32)(unsafe.Pointer(bp + 156 /* nScore */))
+ iBestCol = i
+ iBestStart = *(*int32)(unsafe.Pointer((*Fts5SFinder)(unsafe.Pointer(bp+104 /* &sFinder */)).FaFirst + uintptr(jj)*4))
+ *(*int32)(unsafe.Pointer(bp + 164 /* nColSize */)) = *(*int32)(unsafe.Pointer(bp + 140 /* nDocsize */))
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 88 /* &.xColumnText */))))(tls, pFts, iBestCol, (bp /* &ctx */ + 72 /* &.zIn */), (bp /* &ctx */ + 80 /* &.nIn */))
+ }
+ if (*(*int32)(unsafe.Pointer(bp + 168 /* rc */)) == 0) && (*(*int32)(unsafe.Pointer(bp + 164 /* nColSize */)) == 0) {
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pApi + 96 /* &.xColumnSize */))))(tls, pFts, iBestCol, bp+164 /* &nColSize */)
+ }
+ if (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzIn != 0 {
+ if *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = fts5CInstIterInit(tls, pApi, pFts, iBestCol, (bp /* &ctx */ /* &.iter */))
+ }
+
+ (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiRangeStart = iBestStart
+ (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiRangeEnd = ((iBestStart + nToken) - 1)
+
+ if iBestStart > 0 {
+ fts5HighlightAppend(tls, bp+168 /* &rc */, bp /* &ctx */, zEllips, -1)
+ }
+
+ // Advance iterator ctx.iter so that it points to the first coalesced
+ // phrase instance at or following position iBestStart.
+ for (((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).Fiter.FiStart >= 0) && ((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).Fiter.FiStart < iBestStart)) && (*(*int32)(unsafe.Pointer(bp + 168 /* rc */)) == 0) {
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = fts5CInstIterNext(tls, (bp /* &ctx */ /* &.iter */))
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 40 /* &.xTokenize */))))(tls, pFts, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzIn, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FnIn, bp /* &ctx */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{fts5HighlightCb})))
+ }
+ if (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiRangeEnd >= (*(*int32)(unsafe.Pointer(bp + 164 /* nColSize */)) - 1) {
+ fts5HighlightAppend(tls, bp+168 /* &rc */, bp /* &ctx */, ((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzIn + uintptr((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiOff)), ((*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FnIn - (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FiOff))
+ } else {
+ fts5HighlightAppend(tls, bp+168 /* &rc */, bp /* &ctx */, zEllips, -1)
+ }
+ }
+ if *(*int32)(unsafe.Pointer(bp + 168 /* rc */)) == 0 {
+ Xsqlite3_result_text(tls, pCtx, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzOut, -1, libc.UintptrFromInt32(-1))
+ } else {
+ Xsqlite3_result_error_code(tls, pCtx, *(*int32)(unsafe.Pointer(bp + 168 /* rc */)))
+ }
+ Xsqlite3_free(tls, (*HighlightContext)(unsafe.Pointer(bp /* &ctx */)).FzOut)
+ Xsqlite3_free(tls, aSeen)
+ Xsqlite3_free(tls, (*Fts5SFinder)(unsafe.Pointer(bp+104 /* &sFinder */)).FaFirst)
+}
+
+//**********************************************************************
+
+// The first time the bm25() function is called for a query, an instance
+// of the following structure is allocated and populated.
+type Fts5Bm25Data1 = struct {
+ FnPhrase int32
+ Favgdl float64
+ FaIDF uintptr
+ FaFreq uintptr
+}
+
+//**********************************************************************
+
+// The first time the bm25() function is called for a query, an instance
+// of the following structure is allocated and populated.
+type Fts5Bm25Data = Fts5Bm25Data1 /* sqlite3.c:211349:29 */
+
+// Callback used by fts5Bm25GetData() to count the number of rows in the
+// table matched by each individual phrase within the query.
+func fts5CountCb(tls *libc.TLS, pApi uintptr, pFts uintptr, pUserData uintptr) int32 { /* sqlite3.c:211361:12: */
+ var pn uintptr = pUserData
+ _ = pApi
+ _ = pFts
+ (*(*Sqlite3_int64)(unsafe.Pointer(pn)))++
+ return 0
+}
+
+// Set *ppData to point to the Fts5Bm25Data object for the current query.
+// If the object has not already been allocated, allocate and populate it
+// now.
+func fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) int32 { /* sqlite3.c:211377:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var rc int32 = 0 // Return code
+ var p uintptr // Object to return
+
+ p = (*(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer((pApi + 120 /* &.xGetAuxdata */))))(tls, pFts, 0)
+ if p == uintptr(0) {
+ var nPhrase int32 // Number of phrases in query
+ *(*Sqlite3_int64)(unsafe.Pointer(bp /* nRow */)) = int64(0) // Number of rows in table
+ *(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* nToken */)) = int64(0) // Number of tokens in table
+ var nByte Sqlite3_int64 // Bytes of space to allocate
+ var i int32
+
+ // Allocate the Fts5Bm25Data object
+ nPhrase = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer((pApi + 48 /* &.xPhraseCount */))))(tls, pFts)
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Bm25Data{})) + ((uint64(nPhrase * 2)) * uint64(unsafe.Sizeof(float64(0))))))
+ p = Xsqlite3_malloc64(tls, uint64(nByte))
+ if p == uintptr(0) {
+ rc = 7
+ } else {
+ libc.Xmemset(tls, p, 0, Size_t(nByte))
+ (*Fts5Bm25Data)(unsafe.Pointer(p)).FnPhrase = nPhrase
+ (*Fts5Bm25Data)(unsafe.Pointer(p)).FaIDF = (p + uintptr(1)*32)
+ (*Fts5Bm25Data)(unsafe.Pointer(p)).FaFreq = ((*Fts5Bm25Data)(unsafe.Pointer(p)).FaIDF + uintptr(nPhrase)*8)
+ }
+
+ // Calculate the average document length for this FTS5 table
+ if rc == 0 {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 24 /* &.xRowCount */))))(tls, pFts, bp /* &nRow */)
+ }
+
+ if rc == 0 {
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pApi + 32 /* &.xColumnTotalSize */))))(tls, pFts, -1, bp+8 /* &nToken */)
+ }
+ if rc == 0 {
+ (*Fts5Bm25Data)(unsafe.Pointer(p)).Favgdl = (float64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 8 /* nToken */))) / float64(*(*Sqlite3_int64)(unsafe.Pointer(bp /* nRow */))))
+ }
+
+ // Calculate an IDF for each phrase in the query
+ for i = 0; (rc == 0) && (i < nPhrase); i++ {
+ *(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* nHit */)) = int64(0)
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 104 /* &.xQueryPhrase */))))(tls, pFts, i, bp+16 /* &nHit */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr) int32
+ }{fts5CountCb})))
+ if rc == 0 {
+ // Calculate the IDF (Inverse Document Frequency) for phrase i.
+ // This is done using the standard BM25 formula as found on wikipedia:
+ //
+ // IDF = log( (N - nHit + 0.5) / (nHit + 0.5) )
+ //
+ // where "N" is the total number of documents in the set and nHit
+ // is the number that contain at least one instance of the phrase
+ // under consideration.
+ //
+ // The problem with this is that if (N < 2*nHit), the IDF is
+ // negative. Which is undesirable. So the mimimum allowable IDF is
+ // (1e-6) - roughly the same as a term that appears in just over
+ // half of set of 5,000,000 documents.
+ var idf float64 = libc.Xlog(tls, (((float64(*(*Sqlite3_int64)(unsafe.Pointer(bp /* nRow */)) - *(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* nHit */)))) + 0.5) / (float64(*(*Sqlite3_int64)(unsafe.Pointer(bp + 16 /* nHit */))) + 0.5)))
+ if idf <= 0.0 {
+ idf = 1e-6
+ }
+ *(*float64)(unsafe.Pointer((*Fts5Bm25Data)(unsafe.Pointer(p)).FaIDF + uintptr(i)*8)) = idf
+ }
+ }
+
+ if rc != 0 {
+ Xsqlite3_free(tls, p)
+ } else {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 112 /* &.xSetAuxdata */))))(tls, pFts, p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ }
+ if rc != 0 {
+ p = uintptr(0)
+ }
+ }
+ *(*uintptr)(unsafe.Pointer(ppData)) = p
+ return rc
+}
+
+// Implementation of bm25() function.
+func fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { /* sqlite3.c:211450:13: */
+ bp := tls.Alloc(28)
+ defer tls.Free(28)
+
+ var k1 float64 = 1.2 // Constant "k1" from BM25 formula
+ var b float64 = 0.75 // Constant "b" from BM25 formula
+ var rc int32 = 0 // Error code
+ var score float64 = 0.0 // SQL function return value
+ // var pData uintptr at bp, 8
+ // Values allocated/calculated once only
+ var i int32 // Iterator variable
+ *(*int32)(unsafe.Pointer(bp + 8 /* nInst */)) = 0 // Value returned by xInstCount()
+ var D float64 = 0.0 // Total number of tokens in row
+ var aFreq uintptr = uintptr(0) // Array of phrase freq. for current row
+
+ // Calculate the phrase frequency (symbol "f(qi,D)" in the documentation)
+ // for each phrase in the query for the current row.
+ rc = fts5Bm25GetData(tls, pApi, pFts, bp /* &pData */)
+ if rc == 0 {
+ aFreq = (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FaFreq
+ libc.Xmemset(tls, aFreq, 0, (uint64(unsafe.Sizeof(float64(0))) * uint64((*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FnPhrase)))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 64 /* &.xInstCount */))))(tls, pFts, bp+8 /* &nInst */)
+ }
+ for i = 0; (rc == 0) && (i < *(*int32)(unsafe.Pointer(bp + 8 /* nInst */))); i++ {
+ // var ip int32 at bp+12, 4
+
+ // var ic int32 at bp+16, 4
+
+ // var io int32 at bp+20, 4
+
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 72 /* &.xInst */))))(tls, pFts, i, bp+12 /* &ip */, bp+16 /* &ic */, bp+20 /* &io */)
+ if rc == 0 {
+ var w float64
+ if nVal > *(*int32)(unsafe.Pointer(bp + 16 /* ic */)) {
+ w = Xsqlite3_value_double(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(*(*int32)(unsafe.Pointer(bp + 16 /* ic */)))*8)))
+ } else {
+ w = 1.0
+ }
+ *(*float64)(unsafe.Pointer(aFreq + uintptr(*(*int32)(unsafe.Pointer(bp + 12 /* ip */)))*8)) += (w)
+ }
+ }
+
+ // Figure out the total size of the current row in tokens.
+ if rc == 0 {
+ // var nTok int32 at bp+24, 4
+
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer((pApi + 96 /* &.xColumnSize */))))(tls, pFts, -1, bp+24 /* &nTok */)
+ D = float64(*(*int32)(unsafe.Pointer(bp + 24 /* nTok */)))
+ }
+
+ // Determine the BM25 score for the current row.
+ for i = 0; (rc == 0) && (i < (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FnPhrase); i++ {
+ score = score + (*(*float64)(unsafe.Pointer((*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).FaIDF + uintptr(i)*8)) * ((*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + 1.0)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + (k1 * ((float64(1) - b) + ((b * D) / (*Fts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pData */)))).Favgdl))))))
+ }
+
+ // If no error has occurred, return the calculated score. Otherwise,
+ // throw an SQL exception.
+ if rc == 0 {
+ Xsqlite3_result_double(tls, pCtx, (-1.0 * score))
+ } else {
+ Xsqlite3_result_error_code(tls, pCtx, rc)
+ }
+}
+
+func sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:211508:12: */
+ bp := tls.Alloc(96)
+ defer tls.Free(96)
+
+ *(*[3]Builtin)(unsafe.Pointer(bp /* aBuiltin */)) = [3]Builtin{
+ {FzFunc: ts + 36403 /* "snippet" */, FpUserData: uintptr(0), FxFunc: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr)
+ }{fts5SnippetFunction})), FxDestroy: uintptr(0)},
+ {FzFunc: ts + 36411 /* "highlight" */, FpUserData: uintptr(0), FxFunc: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr)
+ }{fts5HighlightFunction})), FxDestroy: uintptr(0)},
+ {FzFunc: ts + 36421 /* "bm25" */, FpUserData: uintptr(0), FxFunc: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr)
+ }{fts5Bm25Function})), FxDestroy: uintptr(0)},
+ }
+ var rc int32 = 0 // Return code
+ var i int32 // To iterate through builtin functions
+
+ for i = 0; (rc == 0) && (i < (int32(uint64(unsafe.Sizeof([3]Builtin{})) / uint64(unsafe.Sizeof(Builtin{}))))); i++ {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, Fts5_extension_function, uintptr) int32)(unsafe.Pointer((pApi + 24 /* &.xCreateFunction */))))(tls, pApi,
+ (*Builtin)(unsafe.Pointer(bp /* &aBuiltin */ +uintptr(i)*32)).FzFunc,
+ (*Builtin)(unsafe.Pointer(bp /* &aBuiltin */ +uintptr(i)*32)).FpUserData,
+ (*Builtin)(unsafe.Pointer(bp /* &aBuiltin */ +uintptr(i)*32)).FxFunc,
+ (*Builtin)(unsafe.Pointer(bp /* &aBuiltin */ +uintptr(i)*32)).FxDestroy)
+ }
+
+ return rc
+}
+
+type Builtin = struct {
+ FzFunc uintptr
+ FpUserData uintptr
+ FxFunc Fts5_extension_function
+ FxDestroy uintptr
+}
+
+// 2014 May 31
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+
+// #include "fts5Int.h"
+
+func sqlite3Fts5BufferSize(tls *libc.TLS, pRc uintptr, pBuf uintptr, nByte U32) int32 { /* sqlite3.c:211551:12: */
+ if U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace) < nByte {
+ var nNew U64
+ if (*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace != 0 {
+ nNew = uint64((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)
+ } else {
+ nNew = uint64(64)
+ }
+ var pNew uintptr
+ for nNew < U64(nByte) {
+ nNew = (nNew * uint64(2))
+ }
+ pNew = Xsqlite3_realloc64(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp, nNew)
+ if pNew == uintptr(0) {
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+ return 1
+ } else {
+ (*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace = int32(nNew)
+ (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp = pNew
+ }
+ }
+ return 0
+}
+
+// Encode value iVal as an SQLite varint and append it to the buffer object
+// pBuf. If an OOM error occurs, set the error code in p.
+func sqlite3Fts5BufferAppendVarint(tls *libc.TLS, pRc uintptr, pBuf uintptr, iVal I64) { /* sqlite3.c:211575:13: */
+ if func() int32 {
+ if ((U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + (U32(9))) <= (U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)) {
+ return 0
+ }
+ return sqlite3Fts5BufferSize(tls, pRc, pBuf, (uint32((9) + (*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)))
+ }() != 0 {
+ return
+ }
+ *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), uint64(iVal)))
+}
+
+func sqlite3Fts5Put32(tls *libc.TLS, aBuf uintptr, iVal int32) { /* sqlite3.c:211580:13: */
+ *(*U8)(unsafe.Pointer(aBuf + uintptr(0))) = (U8((iVal >> 24) & 0x00FF))
+ *(*U8)(unsafe.Pointer(aBuf + uintptr(1))) = (U8((iVal >> 16) & 0x00FF))
+ *(*U8)(unsafe.Pointer(aBuf + uintptr(2))) = (U8((iVal >> 8) & 0x00FF))
+ *(*U8)(unsafe.Pointer(aBuf + uintptr(3))) = (U8((iVal >> 0) & 0x00FF))
+}
+
+func sqlite3Fts5Get32(tls *libc.TLS, aBuf uintptr) int32 { /* sqlite3.c:211587:12: */
+ return (int32(((((U32(*(*U8)(unsafe.Pointer(aBuf + uintptr(0))))) << 24) + (U32(int32(*(*U8)(unsafe.Pointer(aBuf + uintptr(1)))) << 16))) + (U32(int32(*(*U8)(unsafe.Pointer(aBuf + uintptr(2)))) << 8))) + U32(*(*U8)(unsafe.Pointer(aBuf + uintptr(3))))))
+}
+
+// Append buffer nData/pData to buffer pBuf. If an OOM error occurs, set
+// the error code in p. If an error has already occurred when this function
+// is called, it is a no-op.
+func sqlite3Fts5BufferAppendBlob(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData U32, pData uintptr) { /* sqlite3.c:211596:13: */
+
+ if nData != 0 {
+ if func() int32 {
+ if ((U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + (nData)) <= (U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)) {
+ return 0
+ }
+ return sqlite3Fts5BufferSize(tls, pRc, pBuf, ((nData) + U32((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)))
+ }() != 0 {
+ return
+ }
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), pData, uint64(nData))
+ *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += int32((nData))
+ }
+}
+
+// Append the nul-terminated string zStr to the buffer pBuf. This function
+// ensures that the byte following the buffer data is set to 0x00, even
+// though this byte is not included in the pBuf->n count.
+func sqlite3Fts5BufferAppendString(tls *libc.TLS, pRc uintptr, pBuf uintptr, zStr uintptr) { /* sqlite3.c:211615:13: */
+ var nStr int32 = int32(libc.Xstrlen(tls, zStr))
+ sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, (uint32(nStr + 1)), zStr)
+ (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn--
+}
+
+// Argument zFmt is a printf() style format string. This function performs
+// the printf() style processing, then appends the results to buffer pBuf.
+//
+// Like sqlite3Fts5BufferAppendString(), this function ensures that the byte
+// following the buffer data is set to 0x00, even though this byte is not
+// included in the pBuf->n count.
+func sqlite3Fts5BufferAppendPrintf(tls *libc.TLS, pRc uintptr, pBuf uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:211633:13: */
+ if *(*int32)(unsafe.Pointer(pRc)) == 0 {
+ var zTmp uintptr
+ var ap Va_list
+ _ = ap
+ ap = va
+ zTmp = Xsqlite3_vmprintf(tls, zFmt, ap)
+ _ = ap
+
+ if zTmp == uintptr(0) {
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+ } else {
+ sqlite3Fts5BufferAppendString(tls, pRc, pBuf, zTmp)
+ Xsqlite3_free(tls, zTmp)
+ }
+ }
+}
+
+func sqlite3Fts5Mprintf(tls *libc.TLS, pRc uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:211654:13: */
+ var zRet uintptr = uintptr(0)
+ if *(*int32)(unsafe.Pointer(pRc)) == 0 {
+ var ap Va_list
+ _ = ap
+ ap = va
+ zRet = Xsqlite3_vmprintf(tls, zFmt, ap)
+ _ = ap
+ if zRet == uintptr(0) {
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+ }
+ }
+ return zRet
+}
+
+// Free any buffer allocated by pBuf. Zero the structure before returning.
+func sqlite3Fts5BufferFree(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:211672:13: */
+ Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp)
+ libc.Xmemset(tls, pBuf, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
+}
+
+// Zero the contents of the buffer object. But do not free the associated
+// memory allocation.
+func sqlite3Fts5BufferZero(tls *libc.TLS, pBuf uintptr) { /* sqlite3.c:211681:13: */
+ (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0
+}
+
+// Set the buffer to contain nData/pData. If an OOM error occurs, leave an
+// the error code in p. If an error has already occurred when this function
+// is called, it is a no-op.
+func sqlite3Fts5BufferSet(tls *libc.TLS, pRc uintptr, pBuf uintptr, nData int32, pData uintptr) { /* sqlite3.c:211690:13: */
+ (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0
+ sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nData), pData)
+}
+
+func sqlite3Fts5PoslistNext64(tls *libc.TLS, a uintptr, n int32, pi uintptr, piOff uintptr) int32 { /* sqlite3.c:211700:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var i int32 = *(*int32)(unsafe.Pointer(pi))
+ if i >= n {
+ // EOF
+ *(*I64)(unsafe.Pointer(piOff)) = int64(-1)
+ return 1
+ } else {
+ var iOff I64 = *(*I64)(unsafe.Pointer(piOff))
+ // var iVal int32 at bp, 4
+
+ {
+ *(*int32)(unsafe.Pointer(bp /* iVal */)) = int32(*(*U8)(unsafe.Pointer((a) + uintptr(libc.PostIncInt32(&i, 1)))))
+ if (*(*int32)(unsafe.Pointer(bp /* iVal */)) & 0x80) != 0 {
+ i--
+ i = i + (sqlite3Fts5GetVarint32(tls, ((a) + uintptr(i)), bp /* &iVal */))
+ }
+ }
+
+ if *(*int32)(unsafe.Pointer(bp /* iVal */)) <= 1 {
+ if *(*int32)(unsafe.Pointer(bp /* iVal */)) == 0 {
+ *(*int32)(unsafe.Pointer(pi)) = i
+ return 0
+ }
+ {
+ *(*int32)(unsafe.Pointer(bp /* iVal */)) = int32(*(*U8)(unsafe.Pointer((a) + uintptr(libc.PostIncInt32(&i, 1)))))
+ if (*(*int32)(unsafe.Pointer(bp /* iVal */)) & 0x80) != 0 {
+ i--
+ i = i + (sqlite3Fts5GetVarint32(tls, ((a) + uintptr(i)), bp /* &iVal */))
+ }
+ }
+
+ iOff = ((I64(*(*int32)(unsafe.Pointer(bp /* iVal */)))) << 32)
+ {
+ *(*int32)(unsafe.Pointer(bp /* iVal */)) = int32(*(*U8)(unsafe.Pointer((a) + uintptr(libc.PostIncInt32(&i, 1)))))
+ if (*(*int32)(unsafe.Pointer(bp /* iVal */)) & 0x80) != 0 {
+ i--
+ i = i + (sqlite3Fts5GetVarint32(tls, ((a) + uintptr(i)), bp /* &iVal */))
+ }
+ }
+
+ if *(*int32)(unsafe.Pointer(bp /* iVal */)) < 2 {
+ // This is a corrupt record. So stop parsing it here.
+ *(*I64)(unsafe.Pointer(piOff)) = int64(-1)
+ return 1
+ }
+ }
+ *(*I64)(unsafe.Pointer(piOff)) = (iOff + (I64((*(*int32)(unsafe.Pointer(bp /* iVal */)) - 2) & 0x7FFFFFFF)))
+ *(*int32)(unsafe.Pointer(pi)) = i
+ return 0
+ }
+ return int32(0)
+}
+
+// Advance the iterator object passed as the only argument. Return true
+// if the iterator reaches EOF, or false otherwise.
+func sqlite3Fts5PoslistReaderNext(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:211739:12: */
+ if sqlite3Fts5PoslistNext64(tls, (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fa, (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fn, (pIter+12 /* &.i */), (pIter+24 /* &.iPos */)) != 0 {
+ (*Fts5PoslistReader)(unsafe.Pointer(pIter)).FbEof = U8(1)
+ }
+ return int32((*Fts5PoslistReader)(unsafe.Pointer(pIter)).FbEof)
+}
+
+func sqlite3Fts5PoslistReaderInit(tls *libc.TLS, a uintptr, n int32, pIter uintptr) int32 { /* sqlite3.c:211746:12: */
+ libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5PoslistReader{})))
+ (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fa = a
+ (*Fts5PoslistReader)(unsafe.Pointer(pIter)).Fn = n
+ sqlite3Fts5PoslistReaderNext(tls, pIter)
+ return int32((*Fts5PoslistReader)(unsafe.Pointer(pIter)).FbEof)
+}
+
+// Append position iPos to the position list being accumulated in buffer
+// pBuf, which must be already be large enough to hold the new data.
+// The previous position written to this list is *piPrev. *piPrev is set
+// to iPos before returning.
+func sqlite3Fts5PoslistSafeAppend(tls *libc.TLS, pBuf uintptr, piPrev uintptr, iPos I64) { /* sqlite3.c:211763:13: */
+ if (iPos & colmask) != (*(*I64)(unsafe.Pointer(piPrev)) & colmask) {
+ *(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(libc.PostIncInt32(&(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, 1)))) = U8(1)
+ *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), (uint64(iPos >> 32))))
+ *(*I64)(unsafe.Pointer(piPrev)) = (iPos & colmask)
+ }
+ *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), (uint64((iPos - *(*I64)(unsafe.Pointer(piPrev))) + int64(2)))))
+ *(*I64)(unsafe.Pointer(piPrev)) = iPos
+}
+
+var colmask I64 = (I64((int64(0x7FFFFFFF))) << 32) /* sqlite3.c:211768:20 */
+
+func sqlite3Fts5PoslistWriterAppend(tls *libc.TLS, pBuf uintptr, pWriter uintptr, iPos I64) int32 { /* sqlite3.c:211778:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0 // Initialized only to suppress erroneous warning from Clang
+ if func() int32 {
+ if ((U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + (U32((5 + 5) + 5))) <= (U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)) {
+ return 0
+ }
+ return sqlite3Fts5BufferSize(tls, bp /* &rc */, pBuf, (uint32(((5 + 5) + 5) + (*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)))
+ }() != 0 {
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+ }
+ sqlite3Fts5PoslistSafeAppend(tls, pBuf, (pWriter /* &.iPrev */), iPos)
+ return 0
+}
+
+func sqlite3Fts5MallocZero(tls *libc.TLS, pRc uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:211789:13: */
+ var pRet uintptr = uintptr(0)
+ if *(*int32)(unsafe.Pointer(pRc)) == 0 {
+ pRet = Xsqlite3_malloc64(tls, uint64(nByte))
+ if pRet == uintptr(0) {
+ if nByte > int64(0) {
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+ }
+ } else {
+ libc.Xmemset(tls, pRet, 0, Size_t(nByte))
+ }
+ }
+ return pRet
+}
+
+// Return a nul-terminated copy of the string indicated by pIn. If nIn
+// is non-negative, then it is the length of the string in bytes. Otherwise,
+// the length of the string is determined using strlen().
+//
+// It is the responsibility of the caller to eventually free the returned
+// buffer using sqlite3_free(). If an OOM error occurs, NULL is returned.
+func sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) uintptr { /* sqlite3.c:211810:13: */
+ var zRet uintptr = uintptr(0)
+ if *(*int32)(unsafe.Pointer(pRc)) == 0 {
+ if nIn < 0 {
+ nIn = int32(libc.Xstrlen(tls, pIn))
+ }
+ zRet = Xsqlite3_malloc(tls, (nIn + 1))
+ if zRet != 0 {
+ libc.Xmemcpy(tls, zRet, pIn, uint64(nIn))
+ *(*int8)(unsafe.Pointer(zRet + uintptr(nIn))) = int8(0)
+ } else {
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+ }
+ }
+ return zRet
+}
+
+// Return true if character 't' may be part of an FTS5 bareword, or false
+// otherwise. Characters that may be part of barewords:
+//
+// * All non-ASCII characters,
+// * The 52 upper and lower case ASCII characters, and
+// * The 10 integer ASCII characters.
+// * The underscore character "_" (0x5F).
+// * The unicode "subsitute" character (0x1A).
+func sqlite3Fts5IsBareword(tls *libc.TLS, t int8) int32 { /* sqlite3.c:211838:12: */
+ bp := tls.Alloc(128)
+ defer tls.Free(128)
+
+ *(*[128]U8)(unsafe.Pointer(bp /* aBareword */)) = [128]U8{
+ U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), // 0x00 .. 0x0F
+ U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(1), U8(0), U8(0), U8(0), U8(0), U8(0), // 0x10 .. 0x1F
+ U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), // 0x20 .. 0x2F
+ U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), // 0x30 .. 0x3F
+ U8(0), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), // 0x40 .. 0x4F
+ U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(0), U8(0), U8(0), U8(0), U8(1), // 0x50 .. 0x5F
+ U8(0), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), // 0x60 .. 0x6F
+ U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(1), U8(0), U8(0), U8(0), U8(0), U8(0), // 0x70 .. 0x7F
+ }
+
+ return (libc.Bool32(((int32(t) & 0x80) != 0) || (*(*U8)(unsafe.Pointer(bp /* &aBareword[0] */ + uintptr(int32(t)))) != 0)))
+}
+
+// ************************************************************************
+//
+type Fts5TermsetEntry1 = struct {
+ FpTerm uintptr
+ FnTerm int32
+ FiIdx int32
+ FpNext uintptr
+}
+
+// ************************************************************************
+//
+type Fts5TermsetEntry = Fts5TermsetEntry1 /* sqlite3.c:211856:33 */
+
+func sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) int32 { /* sqlite3.c:211868:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ *(*uintptr)(unsafe.Pointer(pp)) = sqlite3Fts5MallocZero(tls, bp /* &rc */, int64(unsafe.Sizeof(Fts5Termset{})))
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+}
+
+func sqlite3Fts5TermsetAdd(tls *libc.TLS, p uintptr, iIdx int32, pTerm uintptr, nTerm int32, pbPresent uintptr) int32 { /* sqlite3.c:211874:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ *(*int32)(unsafe.Pointer(pbPresent)) = 0
+ if p != 0 {
+ var i int32
+ var hash U32 = U32(13)
+ var pEntry uintptr
+
+ // Calculate a hash value for this term. This is the same hash checksum
+ // used by the fts5_hash.c module. This is not important for correct
+ // operation of the module, but is necessary to ensure that some tests
+ // designed to produce hash table collisions really do work.
+ for i = (nTerm - 1); i >= 0; i-- {
+ hash = (((hash << 3) ^ hash) ^ U32(*(*int8)(unsafe.Pointer(pTerm + uintptr(i)))))
+ }
+ hash = (((hash << 3) ^ hash) ^ U32(iIdx))
+ hash = (hash % (U32((int32(uint64(unsafe.Sizeof([512]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0))))))))
+
+ for pEntry = *(*uintptr)(unsafe.Pointer((p /* &.apHash */) + uintptr(hash)*8)); pEntry != 0; pEntry = (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext {
+ if (((*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FiIdx == iIdx) &&
+ ((*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FnTerm == nTerm)) &&
+ (libc.Xmemcmp(tls, (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm, pTerm, uint64(nTerm)) == 0) {
+ *(*int32)(unsafe.Pointer(pbPresent)) = 1
+ break
+ }
+ }
+
+ if pEntry == uintptr(0) {
+ pEntry = sqlite3Fts5MallocZero(tls, bp /* &rc */, (int64(uint64(unsafe.Sizeof(Fts5TermsetEntry{})) + uint64(nTerm))))
+ if pEntry != 0 {
+ (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm = (pEntry + uintptr(1)*24)
+ (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FnTerm = nTerm
+ (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FiIdx = iIdx
+ libc.Xmemcpy(tls, (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpTerm, pTerm, uint64(nTerm))
+ (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext = *(*uintptr)(unsafe.Pointer((p /* &.apHash */) + uintptr(hash)*8))
+ *(*uintptr)(unsafe.Pointer((p /* &.apHash */) + uintptr(hash)*8)) = pEntry
+ }
+ }
+ }
+
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+}
+
+func sqlite3Fts5TermsetFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:211923:13: */
+ if p != 0 {
+ var i U32
+ for i = U32(0); i < (U32((int32(uint64(unsafe.Sizeof([512]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0))))))); i++ {
+ var pEntry uintptr = *(*uintptr)(unsafe.Pointer((p /* &.apHash */) + uintptr(i)*8))
+ for pEntry != 0 {
+ var pDel uintptr = pEntry
+ pEntry = (*Fts5TermsetEntry)(unsafe.Pointer(pEntry)).FpNext
+ Xsqlite3_free(tls, pDel)
+ }
+ }
+ Xsqlite3_free(tls, p)
+ }
+}
+
+// 2014 Jun 09
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// This is an SQLite module implementing full-text search.
+
+// #include "fts5Int.h"
+
+// Maximum allowed page size
+
+func fts5_iswhitespace(tls *libc.TLS, x int8) int32 { /* sqlite3.c:211965:12: */
+ return (libc.Bool32(int32(x) == ' '))
+}
+
+func fts5_isopenquote(tls *libc.TLS, x int8) int32 { /* sqlite3.c:211969:12: */
+ return (libc.Bool32((((int32(x) == '"') || (int32(x) == '\'')) || (int32(x) == '[')) || (int32(x) == '`')))
+}
+
+// Argument pIn points to a character that is part of a nul-terminated
+// string. Return a pointer to the first character following *pIn in
+// the string that is not a white-space character.
+func fts5ConfigSkipWhitespace(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:211978:19: */
+ var p uintptr = pIn
+ if p != 0 {
+ for fts5_iswhitespace(tls, *(*int8)(unsafe.Pointer(p))) != 0 {
+ p++
+ }
+ }
+ return p
+}
+
+// Argument pIn points to a character that is part of a nul-terminated
+// string. Return a pointer to the first character following *pIn in
+// the string that is not a "bareword" character.
+func fts5ConfigSkipBareword(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:211991:19: */
+ var p uintptr = pIn
+ for sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(p))) != 0 {
+ p++
+ }
+ if p == pIn {
+ p = uintptr(0)
+ }
+ return p
+}
+
+func fts5_isdigit(tls *libc.TLS, a int8) int32 { /* sqlite3.c:211998:12: */
+ return (libc.Bool32((int32(a) >= '0') && (int32(a) <= '9')))
+}
+
+func fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:212004:19: */
+ var p uintptr = pIn
+ switch int32(*(*int8)(unsafe.Pointer(p))) {
+ case 'n':
+ fallthrough
+ case 'N':
+ if Xsqlite3_strnicmp(tls, ts+7824 /* "null" */, p, 4) == 0 {
+ p = (p + uintptr(4))
+ } else {
+ p = uintptr(0)
+ }
+ break
+
+ case 'x':
+ fallthrough
+ case 'X':
+ p++
+ if int32(*(*int8)(unsafe.Pointer(p))) == '\'' {
+ p++
+ for (((int32(*(*int8)(unsafe.Pointer(p))) >= 'a') && (int32(*(*int8)(unsafe.Pointer(p))) <= 'f')) ||
+ ((int32(*(*int8)(unsafe.Pointer(p))) >= 'A') && (int32(*(*int8)(unsafe.Pointer(p))) <= 'F'))) ||
+ ((int32(*(*int8)(unsafe.Pointer(p))) >= '0') && (int32(*(*int8)(unsafe.Pointer(p))) <= '9')) {
+ p++
+ }
+ if (int32(*(*int8)(unsafe.Pointer(p))) == '\'') && (int64(0) == (((int64(p) - int64(pIn)) / 1) % int64(2))) {
+ p++
+ } else {
+ p = uintptr(0)
+ }
+ } else {
+ p = uintptr(0)
+ }
+ break
+
+ case '\'':
+ p++
+ for p != 0 {
+ if int32(*(*int8)(unsafe.Pointer(p))) == '\'' {
+ p++
+ if int32(*(*int8)(unsafe.Pointer(p))) != '\'' {
+ break
+ }
+ }
+ p++
+ if int32(*(*int8)(unsafe.Pointer(p))) == 0 {
+ p = uintptr(0)
+ }
+ }
+ break
+
+ default:
+ // maybe a number
+ if (int32(*(*int8)(unsafe.Pointer(p))) == '+') || (int32(*(*int8)(unsafe.Pointer(p))) == '-') {
+ p++
+ }
+ for fts5_isdigit(tls, *(*int8)(unsafe.Pointer(p))) != 0 {
+ p++
+ }
+
+ // At this point, if the literal was an integer, the parse is
+ // finished. Or, if it is a floating point value, it may continue
+ // with either a decimal point or an 'E' character.
+ if (int32(*(*int8)(unsafe.Pointer(p))) == '.') && (fts5_isdigit(tls, *(*int8)(unsafe.Pointer(p + uintptr(1)))) != 0) {
+ p += uintptr(2)
+ for fts5_isdigit(tls, *(*int8)(unsafe.Pointer(p))) != 0 {
+ p++
+ }
+ }
+ if p == pIn {
+ p = uintptr(0)
+ }
+
+ break
+ }
+
+ return p
+}
+
+// The first character of the string pointed to by argument z is guaranteed
+// to be an open-quote character (see function fts5_isopenquote()).
+//
+// This function searches for the corresponding close-quote character within
+// the string and, if found, dequotes the string in place and adds a new
+// nul-terminator byte.
+//
+// If the close-quote is found, the value returned is the byte offset of
+// the character immediately following it. Or, if the close-quote is not
+// found, -1 is returned. If -1 is returned, the buffer is left in an
+// undefined state.
+func fts5Dequote(tls *libc.TLS, z uintptr) int32 { /* sqlite3.c:212080:12: */
+ var q int8
+ var iIn int32 = 1
+ var iOut int32 = 0
+ q = *(*int8)(unsafe.Pointer(z + uintptr(0)))
+
+ // Set stack variable q to the close-quote character
+
+ if int32(q) == '[' {
+ 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 + 1))))) != int32(q) {
+ // Character iIn was the close quote.
+ iIn++
+ break
+ } else {
+ // Character iIn and iIn+1 form an escaped quote character. Skip
+ // the input cursor past both and copy a single quote character
+ // to the output buffer.
+ iIn = iIn + (2)
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = q
+ }
+ } else {
+ *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iOut, 1)))) = *(*int8)(unsafe.Pointer(z + uintptr(libc.PostIncInt32(&iIn, 1))))
+ }
+ }
+
+ *(*int8)(unsafe.Pointer(z + uintptr(iOut))) = int8(0)
+ return iIn
+}
+
+// Convert an SQL-style quoted string into a normal string by removing
+// the quote characters. The conversion is done in-place. If the
+// input does not begin with a quote character, then this routine
+// is a no-op.
+//
+// Examples:
+//
+// "abc" becomes abc
+// 'xyz' becomes xyz
+// [pqr] becomes pqr
+// `mno` becomes mno
+func sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { /* sqlite3.c:212125:13: */
+ var quote int8 // Quote character (if any )
+
+ quote = *(*int8)(unsafe.Pointer(z + uintptr(0)))
+ if (((int32(quote) == '[') || (int32(quote) == '\'')) || (int32(quote) == '"')) || (int32(quote) == '`') {
+ fts5Dequote(tls, z)
+ }
+}
+
+type Fts5Enum1 = struct {
+ FzName uintptr
+ FeVal int32
+ _ [4]byte
+}
+
+type Fts5Enum = Fts5Enum1 /* sqlite3.c:212140:25 */
+
+func fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintptr) int32 { /* sqlite3.c:212142:12: */
+ var nEnum int32 = int32(libc.Xstrlen(tls, zEnum))
+ var i int32
+ var iVal int32 = -1
+
+ for i = 0; (*Fts5Enum)(unsafe.Pointer(aEnum+uintptr(i)*16)).FzName != 0; i++ {
+ if Xsqlite3_strnicmp(tls, (*Fts5Enum)(unsafe.Pointer(aEnum+uintptr(i)*16)).FzName, zEnum, nEnum) == 0 {
+ if iVal >= 0 {
+ return 1
+ }
+ iVal = (*Fts5Enum)(unsafe.Pointer(aEnum + uintptr(i)*16)).FeVal
+ }
+ }
+
+ *(*int32)(unsafe.Pointer(peVal)) = iVal
+ if iVal < 0 {
+ return 1
+ }
+ return 0
+}
+
+// Parse a "special" CREATE VIRTUAL TABLE directive and update
+// configuration object pConfig as appropriate.
+//
+// If successful, object pConfig is updated and SQLITE_OK returned. If
+// an error occurs, an SQLite error code is returned and an error message
+// may be left in *pzErr. It is the responsibility of the caller to
+// eventually free any such error message using sqlite3_free().
+func fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zCmd uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:212171:12: */
+ bp := tls.Alloc(112)
+ defer tls.Free(112)
+
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 0
+ var nCmd int32 = int32(libc.Xstrlen(tls, zCmd))
+ if Xsqlite3_strnicmp(tls, ts+36426 /* "prefix" */, zCmd, nCmd) == 0 {
+ var nByte int32 = (int32(uint64(unsafe.Sizeof(int32(0))) * uint64(31)))
+ var p uintptr
+ var bFirst int32 = 1
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) {
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix = sqlite3Fts5MallocZero(tls, bp+40 /* &rc */, int64(nByte))
+ if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != 0 {
+ return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
+ }
+ }
+
+ p = zArg
+ for 1 != 0 {
+ var nPre int32 = 0
+
+ for int32(*(*int8)(unsafe.Pointer(p + uintptr(0)))) == ' ' {
+ p++
+ }
+ if (bFirst == 0) && (int32(*(*int8)(unsafe.Pointer(p + uintptr(0)))) == ',') {
+ p++
+ for int32(*(*int8)(unsafe.Pointer(p + uintptr(0)))) == ' ' {
+ p++
+ }
+ } else if int32(*(*int8)(unsafe.Pointer(p + uintptr(0)))) == 0 {
+ break
+ }
+ if (int32(*(*int8)(unsafe.Pointer(p + uintptr(0)))) < '0') || (int32(*(*int8)(unsafe.Pointer(p + uintptr(0)))) > '9') {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36433 /* "malformed prefix..." */, 0)
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
+ break
+ }
+
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix == 31 {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls,
+ ts+36464 /* "too many prefix ..." */, libc.VaList(bp, 31))
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
+ break
+ }
+
+ for ((int32(*(*int8)(unsafe.Pointer(p + uintptr(0)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(p + uintptr(0)))) <= '9')) && (nPre < 1000) {
+ nPre = ((nPre * 10) + (int32(*(*int8)(unsafe.Pointer(p + uintptr(0)))) - '0'))
+ p++
+ }
+
+ if (nPre <= 0) || (nPre >= 1000) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36497 /* "prefix length ou..." */, 0)
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
+ break
+ }
+
+ *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr((*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix)*4)) = nPre
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix++
+ bFirst = 0
+ }
+
+ return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
+ }
+
+ if Xsqlite3_strnicmp(tls, ts+36534 /* "tokenize" */, zCmd, nCmd) == 0 {
+ var p uintptr = zArg
+ var nArg Sqlite3_int64 = (Sqlite3_int64(libc.Xstrlen(tls, zArg) + uint64(1)))
+ var azArg uintptr = sqlite3Fts5MallocZero(tls, bp+40 /* &rc */, (int64(uint64(unsafe.Sizeof(uintptr(0))) * uint64(nArg))))
+ var pDel uintptr = sqlite3Fts5MallocZero(tls, bp+40 /* &rc */, (nArg * int64(2)))
+ var pSpace uintptr = pDel
+
+ if (azArg != 0) && (pSpace != 0) {
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36543 /* "multiple tokeniz..." */, 0)
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
+ } else {
+ for nArg = int64(0); (p != 0) && (*(*int8)(unsafe.Pointer(p)) != 0); nArg++ {
+ var p2 uintptr = fts5ConfigSkipWhitespace(tls, p)
+ if int32(*(*int8)(unsafe.Pointer(p2))) == '\'' {
+ p = fts5ConfigSkipLiteral(tls, p2)
+ } else {
+ p = fts5ConfigSkipBareword(tls, p2)
+ }
+ if p != 0 {
+ libc.Xmemcpy(tls, pSpace, p2, (uint64((int64(p) - int64(p2)) / 1)))
+ *(*uintptr)(unsafe.Pointer(azArg + uintptr(nArg)*8)) = pSpace
+ sqlite3Fts5Dequote(tls, pSpace)
+ pSpace += (uintptr(((int64(p) - int64(p2)) / 1) + int64(1)))
+ p = fts5ConfigSkipWhitespace(tls, p)
+ }
+ }
+ if p == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36576 /* "parse error in t..." */, 0)
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
+ } else {
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = sqlite3Fts5GetTokenizer(tls, pGlobal,
+ azArg, int32(nArg), (pConfig + 104 /* &.pTok */), (pConfig + 112 /* &.pTokApi */),
+ pzErr)
+ }
+ }
+ }
+
+ Xsqlite3_free(tls, azArg)
+ Xsqlite3_free(tls, pDel)
+ return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
+ }
+
+ if Xsqlite3_strnicmp(tls, ts+36610 /* "content" */, zCmd, nCmd) == 0 {
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != 0 {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36618 /* "multiple content..." */, 0)
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
+ } else {
+ if *(*int8)(unsafe.Pointer(zArg + uintptr(0))) != 0 {
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent = 2
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FzContent = sqlite3Fts5Mprintf(tls, bp+40 /* &rc */, ts+36650 /* "%Q.%Q" */, libc.VaList(bp+8, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg))
+ } else {
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent = 1
+ }
+ }
+ return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
+ }
+
+ if Xsqlite3_strnicmp(tls, ts+36656 /* "content_rowid" */, zCmd, nCmd) == 0 {
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36670 /* "multiple content..." */, 0)
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
+ } else {
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, zArg, -1)
+ }
+ return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
+ }
+
+ if Xsqlite3_strnicmp(tls, ts+36708 /* "columnsize" */, zCmd, nCmd) == 0 {
+ if ((int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) != '0') && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) != '1')) || (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(1)))) != 0) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36719 /* "malformed column..." */, 0)
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
+ } else {
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = (libc.Bool32(int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) == '1'))
+ }
+ return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
+ }
+
+ if Xsqlite3_strnicmp(tls, ts+6772 /* "detail" */, zCmd, nCmd) == 0 {
+ *(*[4]Fts5Enum)(unsafe.Pointer(bp + 48 /* aDetail */)) = [4]Fts5Enum{
+ {FzName: ts + 18349 /* "none" */, FeVal: 1},
+ {FzName: ts + 18354 /* "full" */, FeVal: 0},
+ {FzName: ts + 36754 /* "columns" */, FeVal: 2},
+ {FzName: uintptr(0), FeVal: 0},
+ }
+
+ if libc.AssignPtrInt32(bp+40 /* rc */, fts5ConfigSetEnum(tls, bp+48 /* &aDetail[0] */, zArg, (pConfig+92 /* &.eDetail */))) != 0 {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36762 /* "malformed detail..." */, 0)
+ }
+ return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
+ }
+
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36793 /* "unrecognized opt..." */, libc.VaList(bp+24, nCmd, zCmd))
+ return 1
+}
+
+// Allocate an instance of the default tokenizer ("simple") at
+// Fts5Config.pTokenizer. Return SQLITE_OK if successful, or an SQLite error
+// code if an error occurs.
+func fts5ConfigDefaultTokenizer(tls *libc.TLS, pGlobal uintptr, pConfig uintptr) int32 { /* sqlite3.c:212335:12: */
+
+ return sqlite3Fts5GetTokenizer(tls,
+ pGlobal, uintptr(0), 0, (pConfig + 104 /* &.pTok */), (pConfig + 112 /* &.pTokApi */), uintptr(0))
+}
+
+// Gobble up the first bareword or quoted word from the input buffer zIn.
+// Return a pointer to the character immediately following the last in
+// the gobbled word if successful, or a NULL pointer otherwise (failed
+// to find close-quote character).
+//
+// Before returning, set pzOut to point to a new buffer containing a
+// nul-terminated, dequoted copy of the gobbled word. If the word was
+// quoted, *pbQuoted is also set to 1 before returning.
+//
+// If *pRc is other than SQLITE_OK when this function is called, it is
+// a no-op (NULL is returned). Otherwise, if an OOM occurs within this
+// function, *pRc is set to SQLITE_NOMEM before returning. *pRc is *not*
+// set if a parse error (failed to find close quote) occurs.
+func fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintptr, pbQuoted uintptr) uintptr { /* sqlite3.c:212357:19: */
+ var zRet uintptr = uintptr(0)
+
+ var nIn Sqlite3_int64 = Sqlite3_int64(libc.Xstrlen(tls, zIn))
+ var zOut uintptr = Xsqlite3_malloc64(tls, (uint64(nIn + int64(1))))
+
+ *(*int32)(unsafe.Pointer(pbQuoted)) = 0
+ *(*uintptr)(unsafe.Pointer(pzOut)) = uintptr(0)
+
+ if zOut == uintptr(0) {
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+ } else {
+ libc.Xmemcpy(tls, zOut, zIn, (Size_t(nIn + int64(1))))
+ if fts5_isopenquote(tls, *(*int8)(unsafe.Pointer(zOut + uintptr(0)))) != 0 {
+ var ii int32 = fts5Dequote(tls, zOut)
+ zRet = (zIn + uintptr(ii))
+ *(*int32)(unsafe.Pointer(pbQuoted)) = 1
+ } else {
+ zRet = fts5ConfigSkipBareword(tls, zIn)
+ if zRet != 0 {
+ *(*int8)(unsafe.Pointer(zOut + uintptr(((int64(zRet) - int64(zIn)) / 1)))) = int8(0)
+ }
+ }
+ }
+
+ if zRet == uintptr(0) {
+ Xsqlite3_free(tls, zOut)
+ } else {
+ *(*uintptr)(unsafe.Pointer(pzOut)) = zOut
+ }
+
+ return zRet
+}
+
+func fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr, pzErr uintptr) int32 { /* sqlite3.c:212397:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var rc int32 = 0
+ if (0 == Xsqlite3_stricmp(tls, zCol, ts+23858 /* "rank" */)) ||
+ (0 == Xsqlite3_stricmp(tls, zCol, ts+10045 /* "rowid" */)) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36821 /* "reserved fts5 co..." */, libc.VaList(bp, zCol))
+ rc = 1
+ } else if zArg != 0 {
+ if 0 == Xsqlite3_stricmp(tls, zArg, ts+36851 /* "unindexed" */) {
+ *(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*Fts5Config)(unsafe.Pointer(p)).FnCol))) = U8(1)
+ } else {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36861 /* "unrecognized col..." */, libc.VaList(bp+8, zArg))
+ rc = 1
+ }
+ }
+
+ *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FazCol + uintptr(libc.PostIncInt32(&(*Fts5Config)(unsafe.Pointer(p)).FnCol, 1))*8)) = zCol
+ return rc
+}
+
+// Populate the Fts5Config.zContentExprlist string.
+func fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:212425:12: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ var i int32
+ *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = 0
+ *(*Fts5Buffer)(unsafe.Pointer(bp + 32 /* buf */)) = Fts5Buffer{Fp: uintptr(0), Fn: 0, FnSpace: 0}
+
+ sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+36892 /* "T.%Q" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(p)).FzContentRowid))
+ if (*Fts5Config)(unsafe.Pointer(p)).FeContent != 1 {
+ for i = 0; i < (*Fts5Config)(unsafe.Pointer(p)).FnCol; i++ {
+ if (*Fts5Config)(unsafe.Pointer(p)).FeContent == 2 {
+ sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+36897 /* ", T.%Q" */, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8))))
+ } else {
+ sqlite3Fts5BufferAppendPrintf(tls, bp+24 /* &rc */, bp+32 /* &buf */, ts+36904 /* ", T.c%d" */, libc.VaList(bp+16, i))
+ }
+ }
+ }
+
+ (*Fts5Config)(unsafe.Pointer(p)).FzContentExprlist = (*Fts5Buffer)(unsafe.Pointer(bp + 32 /* &buf */)).Fp
+ return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
+}
+
+// Arguments nArg/azArg contain the string arguments passed to the xCreate
+// or xConnect method of the virtual table. This function attempts to
+// allocate an instance of Fts5Config containing the results of parsing
+// those arguments.
+//
+// If successful, SQLITE_OK is returned and *ppOut is set to point to the
+// new Fts5Config object. If an error occurs, an SQLite error code is
+// returned, *ppOut is set to NULL and an error message may be left in
+// *pzErr. It is the responsibility of the caller to eventually free any
+// such error message using sqlite3_free().
+func sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg int32, azArg uintptr, ppOut uintptr, pzErr uintptr) int32 { /* sqlite3.c:212458:12: */
+ bp := tls.Alloc(76)
+ defer tls.Free(76)
+
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 0 // Return code
+ var pRet uintptr // New object to return
+ var i int32
+ var nByte Sqlite3_int64
+
+ *(*uintptr)(unsafe.Pointer(ppOut)) = libc.AssignUintptr(&pRet, Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Fts5Config{}))))
+ if pRet == uintptr(0) {
+ return 7
+ }
+ libc.Xmemset(tls, pRet, 0, uint64(unsafe.Sizeof(Fts5Config{})))
+ (*Fts5Config)(unsafe.Pointer(pRet)).Fdb = db
+ (*Fts5Config)(unsafe.Pointer(pRet)).FiCookie = -1
+
+ nByte = (Sqlite3_int64(uint64(nArg) * (uint64(unsafe.Sizeof(uintptr(0))) + uint64(unsafe.Sizeof(U8(0))))))
+ (*Fts5Config)(unsafe.Pointer(pRet)).FazCol = sqlite3Fts5MallocZero(tls, bp+40 /* &rc */, nByte)
+ (*Fts5Config)(unsafe.Pointer(pRet)).FabUnindexed = ((*Fts5Config)(unsafe.Pointer(pRet)).FazCol + uintptr(nArg)*8)
+ (*Fts5Config)(unsafe.Pointer(pRet)).FzDb = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, *(*uintptr)(unsafe.Pointer(azArg + uintptr(1)*8)), -1)
+ (*Fts5Config)(unsafe.Pointer(pRet)).FzName = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, *(*uintptr)(unsafe.Pointer(azArg + uintptr(2)*8)), -1)
+ (*Fts5Config)(unsafe.Pointer(pRet)).FbColumnsize = 1
+ (*Fts5Config)(unsafe.Pointer(pRet)).FeDetail = 0
+ if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0) && (Xsqlite3_stricmp(tls, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, ts+23858 /* "rank" */) == 0) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36912 /* "reserved fts5 ta..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pRet)).FzName))
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
+ }
+
+ for i = 3; (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0) && (i < nArg); i++ {
+ var zOrig uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8))
+ var z uintptr
+ *(*uintptr)(unsafe.Pointer(bp + 48 /* zOne */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 64 /* zTwo */)) = uintptr(0)
+ var bOption int32 = 0
+ *(*int32)(unsafe.Pointer(bp + 56 /* bMustBeCol */)) = 0
+
+ z = fts5ConfigGobbleWord(tls, bp+40 /* &rc */, zOrig, bp+48 /* &zOne */, bp+56 /* &bMustBeCol */)
+ z = fts5ConfigSkipWhitespace(tls, z)
+ if (z != 0) && (int32(*(*int8)(unsafe.Pointer(z))) == '=') {
+ bOption = 1
+ z++
+ if *(*int32)(unsafe.Pointer(bp + 56 /* bMustBeCol */)) != 0 {
+ z = uintptr(0)
+ }
+ }
+ z = fts5ConfigSkipWhitespace(tls, z)
+ if (z != 0) && (*(*int8)(unsafe.Pointer(z + uintptr(0))) != 0) {
+ // var bDummy int32 at bp+72, 4
+
+ z = fts5ConfigGobbleWord(tls, bp+40 /* &rc */, z, bp+64 /* &zTwo */, bp+72 /* &bDummy */)
+ if (z != 0) && (*(*int8)(unsafe.Pointer(z + uintptr(0))) != 0) {
+ z = uintptr(0)
+ }
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0 {
+ if z == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+36941 /* "parse error in \"..." */, libc.VaList(bp+8, zOrig))
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = 1
+ } else {
+ if bOption != 0 {
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5ConfigParseSpecial(tls, pGlobal, pRet, *(*uintptr)(unsafe.Pointer(bp + 48 /* zOne */)), func() uintptr {
+ if *(*uintptr)(unsafe.Pointer(bp + 64 /* zTwo */)) != 0 {
+ return *(*uintptr)(unsafe.Pointer(bp + 64 /* zTwo */))
+ }
+ return ts + 781 /* "" */
+ }(), pzErr)
+ } else {
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5ConfigParseColumn(tls, pRet, *(*uintptr)(unsafe.Pointer(bp + 48 /* zOne */)), *(*uintptr)(unsafe.Pointer(bp + 64 /* zTwo */)), pzErr)
+ *(*uintptr)(unsafe.Pointer(bp + 48 /* zOne */)) = uintptr(0)
+ }
+ }
+ }
+
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 48 /* zOne */)))
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* zTwo */)))
+ }
+
+ // If a tokenizer= option was successfully parsed, the tokenizer has
+ // already been allocated. Otherwise, allocate an instance of the default
+ // tokenizer (unicode61) now.
+ if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0) && ((*Fts5Config)(unsafe.Pointer(pRet)).FpTok == uintptr(0)) {
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5ConfigDefaultTokenizer(tls, pGlobal, pRet)
+ }
+
+ // If no zContent option was specified, fill in the default values.
+ if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0) && ((*Fts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0)) {
+ var zTail uintptr = uintptr(0)
+
+ if (*Fts5Config)(unsafe.Pointer(pRet)).FeContent == 0 {
+ zTail = ts + 36610 /* "content" */
+ } else if (*Fts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 {
+ zTail = ts + 36961 /* "docsize" */
+ }
+
+ if zTail != 0 {
+ (*Fts5Config)(unsafe.Pointer(pRet)).FzContent = sqlite3Fts5Mprintf(tls,
+ bp+40 /* &rc */, ts+36969 /* "%Q.'%q_%s'" */, libc.VaList(bp+16, (*Fts5Config)(unsafe.Pointer(pRet)).FzDb, (*Fts5Config)(unsafe.Pointer(pRet)).FzName, zTail))
+ }
+ }
+
+ if (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0) && ((*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0)) {
+ (*Fts5Config)(unsafe.Pointer(pRet)).FzContentRowid = sqlite3Fts5Strndup(tls, bp+40 /* &rc */, ts+10045 /* "rowid" */, -1)
+ }
+
+ // Formulate the zContentExprlist text
+ if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5ConfigMakeExprlist(tls, pRet)
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) != 0 {
+ sqlite3Fts5ConfigFree(tls, pRet)
+ *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
+ }
+ return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
+}
+
+// Free the configuration object passed as the only argument.
+func sqlite3Fts5ConfigFree(tls *libc.TLS, pConfig uintptr) { /* sqlite3.c:212577:13: */
+ if pConfig != 0 {
+ var i int32
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 {
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(((*Fts5Config)(unsafe.Pointer(pConfig)).FpTokApi + 8 /* &.xDelete */))))(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok)
+ }
+ Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb)
+ Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)
+ for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))
+ }
+ Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FazCol)
+ Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix)
+ Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank)
+ Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzRankArgs)
+ Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzContent)
+ Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzContentRowid)
+ Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzContentExprlist)
+ Xsqlite3_free(tls, pConfig)
+ }
+}
+
+// Call sqlite3_declare_vtab() based on the contents of the configuration
+// object passed as the only argument. Return SQLITE_OK if successful, or
+// an SQLite error code if an error occurs.
+func sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:212604:12: */
+ bp := tls.Alloc(52)
+ defer tls.Free(52)
+
+ var i int32
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = 0
+ var zSql uintptr
+
+ zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+36980 /* "CREATE TABLE x(" */, 0)
+ for i = 0; (zSql != 0) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ {
+ var zSep uintptr = func() uintptr {
+ if i == 0 {
+ return ts + 781 /* "" */
+ }
+ return ts + 15677 /* ", " */
+ }()
+ zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+36996 /* "%z%s%Q" */, libc.VaList(bp, zSql, zSep, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8))))
+ }
+ zSql = sqlite3Fts5Mprintf(tls, bp+48 /* &rc */, ts+37003, /* "%z, %Q HIDDEN, %..." */
+ libc.VaList(bp+24, zSql, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, ts+23858 /* "rank" */))
+
+ if zSql != 0 {
+ *(*int32)(unsafe.Pointer(bp + 48 /* rc */)) = Xsqlite3_declare_vtab(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql)
+ Xsqlite3_free(tls, zSql)
+ }
+
+ return *(*int32)(unsafe.Pointer(bp + 48 /* rc */))
+}
+
+// Tokenize the text passed via the second and third arguments.
+//
+// The callback is invoked once for each token in the input text. The
+// arguments passed to it are, in order:
+//
+// void *pCtx // Copy of 4th argument to sqlite3Fts5Tokenize()
+// const char *pToken // Pointer to buffer containing token
+// int nToken // Size of token in bytes
+// int iStart // Byte offset of start of token within input text
+// int iEnd // Byte offset of end of token within input text
+// int iPos // Position of token in input (first token is 0)
+//
+// If the callback returns a non-zero value the tokenization is abandoned
+// and no further callbacks are issued.
+//
+// This function returns SQLITE_OK if successful or an SQLite error code
+// if an error occurs. If the tokenization was abandoned early because
+// the callback returned SQLITE_DONE, this is not an error and this function
+// still returns SQLITE_OK. Or, if the tokenization was abandoned early
+// because the callback returned another non-zero value, it is assumed
+// to be an SQLite error code and returned to the caller.
+func sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) int32 { /* sqlite3.c:212650:12: */
+ if pText == uintptr(0) {
+ return 0
+ }
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(((*Fts5Config)(unsafe.Pointer(pConfig)).FpTokApi + 16 /* &.xTokenize */))))(tls,
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FpTok, pCtx, flags, pText, nText, xToken)
+}
+
+// Argument pIn points to the first character in what is expected to be
+// a comma-separated list of SQL literals followed by a ')' character.
+// If it actually is this, return a pointer to the ')'. Otherwise, return
+// NULL to indicate a parse error.
+func fts5ConfigSkipArgs(tls *libc.TLS, pIn uintptr) uintptr { /* sqlite3.c:212669:19: */
+ var p uintptr = pIn
+
+ for 1 != 0 {
+ p = fts5ConfigSkipWhitespace(tls, p)
+ p = fts5ConfigSkipLiteral(tls, p)
+ p = fts5ConfigSkipWhitespace(tls, p)
+ if (p == uintptr(0)) || (int32(*(*int8)(unsafe.Pointer(p))) == ')') {
+ break
+ }
+ if int32(*(*int8)(unsafe.Pointer(p))) != ',' {
+ p = uintptr(0)
+ break
+ }
+ p++
+ }
+
+ return p
+}
+
+// Parameter zIn contains a rank() function specification. The format of
+// this is:
+//
+// + Bareword (function name)
+// + Open parenthesis - "("
+// + Zero or more SQL literals in a comma separated list
+// + Close parenthesis - ")"
+func sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzRankArgs uintptr) int32 { /* sqlite3.c:212696:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var p uintptr = zIn
+ var pRank uintptr
+ var zRank uintptr = uintptr(0)
+ var zRankArgs uintptr = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+
+ *(*uintptr)(unsafe.Pointer(pzRank)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pzRankArgs)) = uintptr(0)
+
+ if p == uintptr(0) {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 1
+ } else {
+ p = fts5ConfigSkipWhitespace(tls, p)
+ pRank = p
+ p = fts5ConfigSkipBareword(tls, p)
+
+ if p != 0 {
+ zRank = sqlite3Fts5MallocZero(tls, bp /* &rc */, (int64(((int64(uintptr(1) + p)) - int64(pRank)) / 1)))
+ if zRank != 0 {
+ libc.Xmemcpy(tls, zRank, pRank, (uint64((int64(p) - int64(pRank)) / 1)))
+ }
+ } else {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 1
+ }
+
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ p = fts5ConfigSkipWhitespace(tls, p)
+ if int32(*(*int8)(unsafe.Pointer(p))) != '(' {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 1
+ }
+ p++
+ }
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ var pArgs uintptr
+ p = fts5ConfigSkipWhitespace(tls, p)
+ pArgs = p
+ if int32(*(*int8)(unsafe.Pointer(p))) != ')' {
+ p = fts5ConfigSkipArgs(tls, p)
+ if p == uintptr(0) {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 1
+ } else {
+ zRankArgs = sqlite3Fts5MallocZero(tls, bp /* &rc */, (int64(((int64(uintptr(1) + p)) - int64(pArgs)) / 1)))
+ if zRankArgs != 0 {
+ libc.Xmemcpy(tls, zRankArgs, pArgs, (uint64((int64(p) - int64(pArgs)) / 1)))
+ }
+ }
+ }
+ }
+ }
+
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ Xsqlite3_free(tls, zRank)
+ } else {
+ *(*uintptr)(unsafe.Pointer(pzRank)) = zRank
+ *(*uintptr)(unsafe.Pointer(pzRankArgs)) = zRankArgs
+ }
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+}
+
+func sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVal uintptr, pbBadkey uintptr) int32 { /* sqlite3.c:212755:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var rc int32 = 0
+
+ if 0 == Xsqlite3_stricmp(tls, zKey, ts+37029 /* "pgsz" */) {
+ var pgsz int32 = 0
+ if 1 == Xsqlite3_value_numeric_type(tls, pVal) {
+ pgsz = Xsqlite3_value_int(tls, pVal)
+ }
+ if (pgsz < 32) || (pgsz > (64 * 1024)) {
+ *(*int32)(unsafe.Pointer(pbBadkey)) = 1
+ } else {
+ (*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz
+ }
+ } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+37034 /* "hashsize" */) {
+ var nHashSize int32 = -1
+ if 1 == Xsqlite3_value_numeric_type(tls, pVal) {
+ nHashSize = Xsqlite3_value_int(tls, pVal)
+ }
+ if nHashSize <= 0 {
+ *(*int32)(unsafe.Pointer(pbBadkey)) = 1
+ } else {
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize
+ }
+ } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+37043 /* "automerge" */) {
+ var nAutomerge int32 = -1
+ if 1 == Xsqlite3_value_numeric_type(tls, pVal) {
+ nAutomerge = Xsqlite3_value_int(tls, pVal)
+ }
+ if (nAutomerge < 0) || (nAutomerge > 64) {
+ *(*int32)(unsafe.Pointer(pbBadkey)) = 1
+ } else {
+ if nAutomerge == 1 {
+ nAutomerge = 4
+ }
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge
+ }
+ } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+37053 /* "usermerge" */) {
+ var nUsermerge int32 = -1
+ if 1 == Xsqlite3_value_numeric_type(tls, pVal) {
+ nUsermerge = Xsqlite3_value_int(tls, pVal)
+ }
+ if (nUsermerge < 2) || (nUsermerge > 16) {
+ *(*int32)(unsafe.Pointer(pbBadkey)) = 1
+ } else {
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge
+ }
+ } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+37063 /* "crisismerge" */) {
+ var nCrisisMerge int32 = -1
+ if 1 == Xsqlite3_value_numeric_type(tls, pVal) {
+ nCrisisMerge = Xsqlite3_value_int(tls, pVal)
+ }
+ if nCrisisMerge < 0 {
+ *(*int32)(unsafe.Pointer(pbBadkey)) = 1
+ } else {
+ if nCrisisMerge <= 1 {
+ nCrisisMerge = 16
+ }
+ if nCrisisMerge >= 2000 {
+ nCrisisMerge = (2000 - 1)
+ }
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge
+ }
+ } else if 0 == Xsqlite3_stricmp(tls, zKey, ts+23858 /* "rank" */) {
+ var zIn uintptr = Xsqlite3_value_text(tls, pVal)
+ // var zRank uintptr at bp, 8
+
+ // var zRankArgs uintptr at bp+8, 8
+
+ rc = sqlite3Fts5ConfigParseRank(tls, zIn, bp /* &zRank */, bp+8 /* &zRankArgs */)
+ if rc == 0 {
+ Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank)
+ Xsqlite3_free(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).FzRankArgs)
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank = *(*uintptr)(unsafe.Pointer(bp /* zRank */))
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FzRankArgs = *(*uintptr)(unsafe.Pointer(bp + 8 /* zRankArgs */))
+ } else if rc == 1 {
+ rc = 0
+ *(*int32)(unsafe.Pointer(pbBadkey)) = 1
+ }
+ } else {
+ *(*int32)(unsafe.Pointer(pbBadkey)) = 1
+ }
+ return rc
+}
+
+// Load the contents of the %_config table into memory.
+func sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) int32 { /* sqlite3.c:212849:12: */
+ bp := tls.Alloc(52)
+ defer tls.Free(52)
+
+ var zSelect uintptr = ts + 37075 /* "SELECT k, v FROM..." */
+ var zSql uintptr
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* p */)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = 0
+ var iVersion int32 = 0
+
+ // Set default values
+ (*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz = 4050
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = 4
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = 4
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = 16
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FnHashSize = (1024 * 1024)
+
+ zSql = sqlite3Fts5Mprintf(tls, bp+32 /* &rc */, zSelect, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
+ if zSql != 0 {
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3_prepare_v2(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, bp+40 /* &p */, uintptr(0))
+ Xsqlite3_free(tls, zSql)
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == 0 {
+ for 100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* p */))) {
+ var zK uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* p */)), 0)
+ var pVal uintptr = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* p */)), 1)
+ if 0 == Xsqlite3_stricmp(tls, zK, ts+37107 /* "version" */) {
+ iVersion = Xsqlite3_value_int(tls, pVal)
+ } else {
+ *(*int32)(unsafe.Pointer(bp + 48 /* bDummy */)) = 0
+ sqlite3Fts5ConfigSetValue(tls, pConfig, zK, pVal, bp+48 /* &bDummy */)
+ }
+ }
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* p */)))
+ }
+
+ if (*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == 0) && (iVersion != 4) {
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = 1
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg != 0 {
+
+ *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls,
+ ts+37115, /* "invalid fts5 fil..." */
+ libc.VaList(bp+16, iVersion, 4))
+ }
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == 0 {
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FiCookie = iCookie
+ }
+ return *(*int32)(unsafe.Pointer(bp + 32 /* rc */))
+}
+
+// 2014 May 31
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+
+// #include "fts5Int.h"
+// #include "fts5parse.h"
+
+// All token types in the generated fts5parse.h file are greater than 0.
+
+type Fts5ExprTerm1 = struct {
+ FbPrefix U8
+ FbFirst U8
+ FzTerm uintptr
+ FpIter uintptr
+ FpSynonym uintptr
+}
+
+// 2014 May 31
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+
+// #include "fts5Int.h"
+// #include "fts5parse.h"
+
+// All token types in the generated fts5parse.h file are greater than 0.
+
+type Fts5ExprTerm = Fts5ExprTerm1 /* sqlite3.c:212927:29 */
+
+func sqlite3Fts5ParseError(tls *libc.TLS, pParse uintptr, zFmt uintptr, va uintptr) { /* sqlite3.c:213033:13: */
+ var ap Va_list
+ _ = ap
+ ap = va
+ if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == 0 {
+ (*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_vmprintf(tls, zFmt, ap)
+ (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = 1
+ }
+ _ = ap
+}
+
+func fts5ExprIsspace(tls *libc.TLS, t int8) int32 { /* sqlite3.c:213043:12: */
+ return (libc.Bool32((((int32(t) == ' ') || (int32(t) == '\t')) || (int32(t) == '\n')) || (int32(t) == '\r')))
+}
+
+// Read the first token from the nul-terminated string at *pz.
+func fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr) int32 { /* sqlite3.c:213050:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var z uintptr = *(*uintptr)(unsafe.Pointer(pz))
+ var tok int32
+
+ // Skip past any whitespace
+ for fts5ExprIsspace(tls, *(*int8)(unsafe.Pointer(z))) != 0 {
+ z++
+ }
+
+ (*Fts5Token)(unsafe.Pointer(pToken)).Fp = z
+ (*Fts5Token)(unsafe.Pointer(pToken)).Fn = 1
+ switch int32(*(*int8)(unsafe.Pointer(z))) {
+ case '(':
+ tok = 10
+ break
+ case ')':
+ tok = 11
+ break
+ case '{':
+ tok = 7
+ break
+ case '}':
+ tok = 8
+ break
+ case ':':
+ tok = 5
+ break
+ case ',':
+ tok = 13
+ break
+ case '+':
+ tok = 14
+ break
+ case '*':
+ tok = 15
+ break
+ case '-':
+ tok = 6
+ break
+ case '^':
+ tok = 12
+ break
+ case 0:
+ tok = 0
+ break
+
+ case '"':
+ {
+ var z2 uintptr
+ tok = 9
+
+ for z2 = (z + uintptr(1)); 1 != 0; z2++ {
+ if int32(*(*int8)(unsafe.Pointer(z2 + uintptr(0)))) == '"' {
+ z2++
+ if int32(*(*int8)(unsafe.Pointer(z2 + uintptr(0)))) != '"' {
+ break
+ }
+ }
+ if int32(*(*int8)(unsafe.Pointer(z2 + uintptr(0)))) == 0 {
+ sqlite3Fts5ParseError(tls, pParse, ts+37180 /* "unterminated str..." */, 0)
+ return 0
+ }
+ }
+ (*Fts5Token)(unsafe.Pointer(pToken)).Fn = (int32((int64(z2) - int64(z)) / 1))
+ break
+ }
+
+ default:
+ {
+ var z2 uintptr
+ if sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z + uintptr(0)))) == 0 {
+ sqlite3Fts5ParseError(tls, pParse, ts+37200 /* "fts5: syntax err..." */, libc.VaList(bp, z))
+ return 0
+ }
+ tok = 9
+ for z2 = (z + uintptr(1)); sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z2))) != 0; z2++ {
+ }
+ (*Fts5Token)(unsafe.Pointer(pToken)).Fn = (int32((int64(z2) - int64(z)) / 1))
+ if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 2) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+37231 /* "OR" */, uint64(2)) == 0) {
+ tok = 1
+ }
+ if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+37234 /* "NOT" */, uint64(3)) == 0) {
+ tok = 3
+ }
+ if ((*Fts5Token)(unsafe.Pointer(pToken)).Fn == 3) && (libc.Xmemcmp(tls, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, ts+33311 /* "AND" */, uint64(3)) == 0) {
+ tok = 2
+ }
+ break
+ }
+ }
+
+ *(*uintptr)(unsafe.Pointer(pz)) = ((*Fts5Token)(unsafe.Pointer(pToken)).Fp + uintptr((*Fts5Token)(unsafe.Pointer(pToken)).Fn))
+ return tok
+}
+
+func fts5ParseAlloc(tls *libc.TLS, t U64) uintptr { /* sqlite3.c:213114:13: */
+ return Xsqlite3_malloc64(tls, uint64(Sqlite3_int64(t)))
+}
+func fts5ParseFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213115:13: */ Xsqlite3_free(tls, p) }
+
+func sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, iCol int32, zExpr uintptr, ppNew uintptr, pzErr uintptr) int32 { /* sqlite3.c:213117:12: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ // var sParse Fts5Parse at bp, 40
+
+ // var token Fts5Token at bp+48, 16
+
+ *(*uintptr)(unsafe.Pointer(bp + 40 /* z */)) = zExpr
+ var t int32 // Next token type
+ var pEngine uintptr
+ var pNew uintptr
+
+ *(*uintptr)(unsafe.Pointer(ppNew)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = uintptr(0)
+ libc.Xmemset(tls, bp /* &sParse */, 0, uint64(unsafe.Sizeof(Fts5Parse{})))
+ pEngine = sqlite3Fts5ParserAlloc(tls, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, U64) uintptr }{fts5ParseAlloc})))
+ if pEngine == uintptr(0) {
+ return 7
+ }
+ (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpConfig = pConfig
+
+ for ok := true; ok; ok = (((*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc == 0) && (t != 0)) {
+ t = fts5ExprGetToken(tls, bp /* &sParse */, bp+40 /* &z */, bp+48 /* &token */)
+ sqlite3Fts5Parser(tls, pEngine, t, *(*Fts5Token)(unsafe.Pointer(bp + 48 /* token */)), bp /* &sParse */)
+ }
+ sqlite3Fts5ParserFree(tls, pEngine, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5ParseFree})))
+
+ // If the LHS of the MATCH expression was a user column, apply the
+ // implicit column-filter.
+ if ((iCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) && ((*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpExpr != 0)) && ((*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc == 0) {
+ var n int32 = int32(unsafe.Sizeof(Fts5Colset{}))
+ var pColset uintptr = sqlite3Fts5MallocZero(tls, (bp /* &sParse */ + 16 /* &.rc */), int64(n))
+ if pColset != 0 {
+ (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol = 1
+ *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(0)*4)) = iCol
+ sqlite3Fts5ParseSetColset(tls, bp /* &sParse */, (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpExpr, pColset)
+ }
+ }
+
+ if (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc == 0 {
+ *(*uintptr)(unsafe.Pointer(ppNew)) = libc.AssignUintptr(&pNew, Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Fts5Expr{}))))
+ if pNew == uintptr(0) {
+ (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc = 7
+ sqlite3Fts5ParseNodeFree(tls, (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpExpr)
+ } else {
+ if !(int32((*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpExpr) != 0) {
+ var nByte int32 = int32(unsafe.Sizeof(Fts5ExprNode{}))
+ (*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot = sqlite3Fts5MallocZero(tls, (bp /* &sParse */ + 16 /* &.rc */), int64(nByte))
+ if (*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot != 0 {
+ (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FbEof = 1
+ }
+ } else {
+ (*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot = (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpExpr
+ }
+ (*Fts5Expr)(unsafe.Pointer(pNew)).FpIndex = uintptr(0)
+ (*Fts5Expr)(unsafe.Pointer(pNew)).FpConfig = pConfig
+ (*Fts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FapPhrase
+ (*Fts5Expr)(unsafe.Pointer(pNew)).FnPhrase = (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FnPhrase
+ (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FapPhrase = uintptr(0)
+ }
+ } else {
+ sqlite3Fts5ParseNodeFree(tls, (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FpExpr)
+ }
+
+ Xsqlite3_free(tls, (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FapPhrase)
+ *(*uintptr)(unsafe.Pointer(pzErr)) = (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).FzErr
+ return (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc
+}
+
+// Free the expression node object passed as the only argument.
+func sqlite3Fts5ParseNodeFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213190:13: */
+ if p != 0 {
+ var i int32
+ for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(p)).FnChild; i++ {
+ sqlite3Fts5ParseNodeFree(tls, *(*uintptr)(unsafe.Pointer((p + 48 /* &.apChild */) + uintptr(i)*8)))
+ }
+ sqlite3Fts5ParseNearsetFree(tls, (*Fts5ExprNode)(unsafe.Pointer(p)).FpNear)
+ Xsqlite3_free(tls, p)
+ }
+}
+
+// Free the expression object passed as the only argument.
+func sqlite3Fts5ExprFree(tls *libc.TLS, p uintptr) { /* sqlite3.c:213204:13: */
+ if p != 0 {
+ sqlite3Fts5ParseNodeFree(tls, (*Fts5Expr)(unsafe.Pointer(p)).FpRoot)
+ Xsqlite3_free(tls, (*Fts5Expr)(unsafe.Pointer(p)).FapExprPhrase)
+ Xsqlite3_free(tls, p)
+ }
+}
+
+func sqlite3Fts5ExprAnd(tls *libc.TLS, pp1 uintptr, p2 uintptr) int32 { /* sqlite3.c:213212:12: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
+
+ // var sParse Fts5Parse at bp, 40
+
+ libc.Xmemset(tls, bp /* &sParse */, 0, uint64(unsafe.Sizeof(Fts5Parse{})))
+
+ if *(*uintptr)(unsafe.Pointer(pp1)) != 0 {
+ var p1 uintptr = *(*uintptr)(unsafe.Pointer(pp1))
+ var nPhrase int32 = ((*Fts5Expr)(unsafe.Pointer(p1)).FnPhrase + (*Fts5Expr)(unsafe.Pointer(p2)).FnPhrase)
+
+ (*Fts5Expr)(unsafe.Pointer(p1)).FpRoot = sqlite3Fts5ParseNode(tls, bp /* &sParse */, 2, (*Fts5Expr)(unsafe.Pointer(p1)).FpRoot, (*Fts5Expr)(unsafe.Pointer(p2)).FpRoot, uintptr(0))
+ (*Fts5Expr)(unsafe.Pointer(p2)).FpRoot = uintptr(0)
+
+ if (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc == 0 {
+ var ap uintptr = Xsqlite3_realloc(tls,
+ (*Fts5Expr)(unsafe.Pointer(p1)).FapExprPhrase, (int32(uint64(nPhrase) * uint64(unsafe.Sizeof(uintptr(0))))))
+ if ap == uintptr(0) {
+ (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc = 7
+ } else {
+ var i int32
+ libc.Xmemmove(tls, (ap + uintptr((*Fts5Expr)(unsafe.Pointer(p2)).FnPhrase)*8), ap, (uint64((*Fts5Expr)(unsafe.Pointer(p1)).FnPhrase) * uint64(unsafe.Sizeof(uintptr(0)))))
+ for i = 0; i < (*Fts5Expr)(unsafe.Pointer(p2)).FnPhrase; i++ {
+ *(*uintptr)(unsafe.Pointer(ap + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p2)).FapExprPhrase + uintptr(i)*8))
+ }
+ (*Fts5Expr)(unsafe.Pointer(p1)).FnPhrase = nPhrase
+ (*Fts5Expr)(unsafe.Pointer(p1)).FapExprPhrase = ap
+ }
+ }
+ Xsqlite3_free(tls, (*Fts5Expr)(unsafe.Pointer(p2)).FapExprPhrase)
+ Xsqlite3_free(tls, p2)
+ } else {
+ *(*uintptr)(unsafe.Pointer(pp1)) = p2
+ }
+
+ return (*Fts5Parse)(unsafe.Pointer(bp /* &sParse */)).Frc
+}
+
+// Argument pTerm must be a synonym iterator. Return the current rowid
+// that it points to.
+func fts5ExprSynonymRowid(tls *libc.TLS, pTerm uintptr, bDesc int32, pbEof uintptr) I64 { /* sqlite3.c:213252:12: */
+ var iRet I64 = int64(0)
+ var bRetValid int32 = 0
+ var p uintptr
+
+ for p = pTerm; p != 0; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
+ if 0 == (int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof)) {
+ var iRowid I64 = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FiRowid
+ if (bRetValid == 0) || (bDesc != (libc.Bool32(iRowid < iRet))) {
+ iRet = iRowid
+ bRetValid = 1
+ }
+ }
+ }
+
+ if (pbEof != 0) && (bRetValid == 0) {
+ *(*int32)(unsafe.Pointer(pbEof)) = 1
+ }
+ return iRet
+}
+
+// Argument pTerm must be a synonym iterator.
+func fts5ExprSynonymList(tls *libc.TLS, pTerm uintptr, iRowid I64, pBuf uintptr, pa uintptr, pn uintptr) int32 { /* sqlite3.c:213276:12: */
+ bp := tls.Alloc(136)
+ defer tls.Free(136)
+
+ // var aStatic [4]Fts5PoslistReader at bp, 128
+
+ var aIter uintptr
+ var nIter int32
+ var nAlloc int32
+ var rc int32
+ var p uintptr
+ var nByte Sqlite3_int64
+ var aNew uintptr
+ var pIter uintptr
+ var i int32
+ var iMin I64
+ // var writer Fts5PoslistWriter at bp+128, 8
+
+ var iPrev I64
+ aIter = bp /* aStatic */
+ nIter = 0
+ nAlloc = 4
+ rc = 0
+
+ p = pTerm
+__1:
+ if !(p != 0) {
+ goto __3
+ }
+ pIter = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter
+ if !(((int32((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof)) == 0) && ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == iRowid)) {
+ goto __4
+ }
+ if !((*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData == 0) {
+ goto __5
+ }
+ goto __2
+__5:
+ ;
+ if !(nIter == nAlloc) {
+ goto __6
+ }
+ nByte = (Sqlite3_int64((uint64(unsafe.Sizeof(Fts5PoslistReader{})) * uint64(nAlloc)) * uint64(2)))
+ aNew = Xsqlite3_malloc64(tls, uint64(nByte))
+ if !(aNew == uintptr(0)) {
+ goto __7
+ }
+ rc = 7
+ goto synonym_poslist_out
+__7:
+ ;
+ libc.Xmemcpy(tls, aNew, aIter, (uint64(unsafe.Sizeof(Fts5PoslistReader{})) * uint64(nIter)))
+ nAlloc = (nAlloc * 2)
+ if !(aIter != bp /* aStatic */) {
+ goto __8
+ }
+ Xsqlite3_free(tls, aIter)
+__8:
+ ;
+ aIter = aNew
+__6:
+ ;
+ sqlite3Fts5PoslistReaderInit(tls, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData, (aIter + uintptr(nIter)*32))
+
+ nIter++
+__4:
+ ;
+ goto __2
+__2:
+ p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym
+ goto __1
+ goto __3
+__3:
+ ;
+
+ if !(nIter == 1) {
+ goto __9
+ }
+ *(*uintptr)(unsafe.Pointer(pa)) = (*Fts5PoslistReader)(unsafe.Pointer(aIter + uintptr(0)*32)).Fa
+ *(*int32)(unsafe.Pointer(pn)) = (*Fts5PoslistReader)(unsafe.Pointer(aIter + uintptr(0)*32)).Fn
+ goto __10
+__9:
+ *(*Fts5PoslistWriter)(unsafe.Pointer(bp + 128 /* writer */)) = Fts5PoslistWriter{FiPrev: int64(0)}
+ iPrev = int64(-1)
+ sqlite3Fts5BufferZero(tls, pBuf)
+__11:
+ if !(1 != 0) {
+ goto __12
+ }
+ iMin = (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))
+ i = 0
+__13:
+ if !(i < nIter) {
+ goto __15
+ }
+ if !(int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FbEof) == 0) {
+ goto __16
+ }
+ if !((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FiPos == iPrev) {
+ goto __17
+ }
+ if !(sqlite3Fts5PoslistReaderNext(tls, (aIter+uintptr(i)*32)) != 0) {
+ goto __18
+ }
+ goto __14
+__18:
+ ;
+__17:
+ ;
+ if !((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FiPos < iMin) {
+ goto __19
+ }
+ iMin = (*Fts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*32)).FiPos
+__19:
+ ;
+__16:
+ ;
+ goto __14
+__14:
+ i++
+ goto __13
+ goto __15
+__15:
+ ;
+ if !((iMin == (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))) || (rc != 0)) {
+ goto __20
+ }
+ goto __12
+__20:
+ ;
+ rc = sqlite3Fts5PoslistWriterAppend(tls, pBuf, bp+128 /* &writer */, iMin)
+ iPrev = iMin
+ goto __11
+__12:
+ ;
+ if !(rc == 0) {
+ goto __21
+ }
+ *(*uintptr)(unsafe.Pointer(pa)) = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp
+ *(*int32)(unsafe.Pointer(pn)) = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn
+__21:
+ ;
+__10:
+ ;
+
+synonym_poslist_out:
+ if !(aIter != bp /* aStatic */) {
+ goto __22
+ }
+ Xsqlite3_free(tls, aIter)
+__22:
+ ;
+ return rc
+}
+
+// All individual term iterators in pPhrase are guaranteed to be valid and
+// pointing to the same rowid when this function is called. This function
+// checks if the current rowid really is a match, and if so populates
+// the pPhrase->poslist buffer accordingly. Output parameter *pbMatch
+// is set to true if this is really a match, or false otherwise.
+//
+// SQLITE_OK is returned if an error occurs, or an SQLite error code
+// otherwise. It is not considered an error code if the current rowid is
+// not a match.
+func fts5ExprPhraseIsMatch(tls *libc.TLS, pNode uintptr, pPhrase uintptr, pbMatch uintptr) int32 { /* sqlite3.c:213359:12: */
+ bp := tls.Alloc(168)
+ defer tls.Free(168)
+
+ // var writer Fts5PoslistWriter at bp+160, 8
+
+ // var aStatic [4]Fts5PoslistReader at bp, 128
+
+ var aIter uintptr
+ var i int32
+ var rc int32
+ var bFirst int32
+ var nByte Sqlite3_int64
+ // var buf Fts5Buffer at bp+128, 16
+
+ var pTerm uintptr
+ // var n int32 at bp+152, 4
+
+ var bFlag int32
+ // var a uintptr at bp+144, 8
+
+ var pPos uintptr
+ var iAdj I64
+ var bMatch int32
+ var iPos I64
+ *(*Fts5PoslistWriter)(unsafe.Pointer(bp + 160 /* writer */)) = Fts5PoslistWriter{FiPrev: int64(0)}
+ aIter = bp /* aStatic */
+ rc = 0
+ bFirst = int32((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */) + uintptr(0)*32)).FbFirst)
+
+ sqlite3Fts5BufferZero(tls, (pPhrase + 8 /* &.poslist */))
+
+ // If the aStatic[] array is not large enough, allocate a large array
+ // using sqlite3_malloc(). This approach could be improved upon.
+ if !((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > (int32(uint64(unsafe.Sizeof([4]Fts5PoslistReader{})) / uint64(unsafe.Sizeof(Fts5PoslistReader{}))))) {
+ goto __1
+ }
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5PoslistReader{})) * uint64((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm)))
+ aIter = Xsqlite3_malloc64(tls, uint64(nByte))
+ if !(!(aIter != 0)) {
+ goto __2
+ }
+ return 7
+__2:
+ ;
+__1:
+ ;
+ libc.Xmemset(tls, aIter, 0, (uint64(unsafe.Sizeof(Fts5PoslistReader{})) * uint64((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm)))
+
+ // Initialize a term iterator for each term in the phrase
+ i = 0
+__3:
+ if !(i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm) {
+ goto __5
+ }
+ pTerm = ((pPhrase + 32 /* &.aTerm */) + uintptr(i)*32)
+ *(*int32)(unsafe.Pointer(bp + 152 /* n */)) = 0
+ bFlag = 0
+ *(*uintptr)(unsafe.Pointer(bp + 144 /* a */)) = uintptr(0)
+ if !((*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym != 0) {
+ goto __6
+ }
+ *(*Fts5Buffer)(unsafe.Pointer(bp + 128 /* buf */)) = Fts5Buffer{Fp: uintptr(0), Fn: 0, FnSpace: 0}
+ rc = fts5ExprSynonymList(tls, pTerm, (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid, bp+128 /* &buf */, bp+144 /* &a */, bp+152 /* &n */)
+ if !(rc != 0) {
+ goto __8
+ }
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 144 /* a */)))
+ goto ismatch_out
+__8:
+ ;
+ if !(*(*uintptr)(unsafe.Pointer(bp + 144 /* a */)) == (*Fts5Buffer)(unsafe.Pointer(bp+128 /* &buf */)).Fp) {
+ goto __9
+ }
+ bFlag = 1
+__9:
+ ;
+ goto __7
+__6:
+ *(*uintptr)(unsafe.Pointer(bp + 144 /* a */)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter)).FpData
+ *(*int32)(unsafe.Pointer(bp + 152 /* n */)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter)).FnData
+__7:
+ ;
+ sqlite3Fts5PoslistReaderInit(tls, *(*uintptr)(unsafe.Pointer(bp + 144 /* a */)), *(*int32)(unsafe.Pointer(bp + 152 /* n */)), (aIter + uintptr(i)*32))
+ (*Fts5PoslistReader)(unsafe.Pointer(aIter + uintptr(i)*32)).FbFlag = U8(bFlag)
+ if !((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FbEof != 0) {
+ goto __10
+ }
+ goto ismatch_out
+__10:
+ ;
+ goto __4
+__4:
+ i++
+ goto __3
+ goto __5
+__5:
+ ;
+
+__11:
+ if !(1 != 0) {
+ goto __12
+ }
+ iPos = (*Fts5PoslistReader)(unsafe.Pointer(aIter + uintptr(0)*32)).FiPos
+__13:
+ bMatch = 1
+ i = 0
+__16:
+ if !(i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm) {
+ goto __18
+ }
+ pPos = (aIter + uintptr(i)*32)
+ iAdj = (iPos + I64(i))
+ if !((*Fts5PoslistReader)(unsafe.Pointer(pPos)).FiPos != iAdj) {
+ goto __19
+ }
+ bMatch = 0
+__20:
+ if !((*Fts5PoslistReader)(unsafe.Pointer(pPos)).FiPos < iAdj) {
+ goto __21
+ }
+ if !(sqlite3Fts5PoslistReaderNext(tls, pPos) != 0) {
+ goto __22
+ }
+ goto ismatch_out
+__22:
+ ;
+ goto __20
+__21:
+ ;
+ if !((*Fts5PoslistReader)(unsafe.Pointer(pPos)).FiPos > iAdj) {
+ goto __23
+ }
+ iPos = ((*Fts5PoslistReader)(unsafe.Pointer(pPos)).FiPos - I64(i))
+__23:
+ ;
+__19:
+ ;
+ goto __17
+__17:
+ i++
+ goto __16
+ goto __18
+__18:
+ ;
+ goto __14
+__14:
+ if bMatch == 0 {
+ goto __13
+ }
+ goto __15
+__15:
+ ;
+
+ // Append position iPos to the output
+ if !((bFirst == 0) || ((int32(iPos & int64(0x7FFFFFFF))) == 0)) {
+ goto __24
+ }
+ rc = sqlite3Fts5PoslistWriterAppend(tls, (pPhrase + 8 /* &.poslist */), bp+160 /* &writer */, iPos)
+ if !(rc != 0) {
+ goto __25
+ }
+ goto ismatch_out
+__25:
+ ;
+__24:
+ ;
+
+ i = 0
+__26:
+ if !(i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm) {
+ goto __28
+ }
+ if !(sqlite3Fts5PoslistReaderNext(tls, (aIter+uintptr(i)*32)) != 0) {
+ goto __29
+ }
+ goto ismatch_out
+__29:
+ ;
+ goto __27
+__27:
+ i++
+ goto __26
+ goto __28
+__28:
+ ;
+ goto __11
+__12:
+ ;
+
+ismatch_out:
+ *(*int32)(unsafe.Pointer(pbMatch)) = (libc.Bool32((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0))
+ i = 0
+__30:
+ if !(i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm) {
+ goto __32
+ }
+ if !((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FbFlag != 0) {
+ goto __33
+ }
+ Xsqlite3_free(tls, (*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).Fa)
+__33:
+ ;
+ goto __31
+__31:
+ i++
+ goto __30
+ goto __32
+__32:
+ ;
+ if !(aIter != bp /* aStatic */) {
+ goto __34
+ }
+ Xsqlite3_free(tls, aIter)
+__34:
+ ;
+ return rc
+}
+
+type Fts5LookaheadReader1 = struct {
+ Fa uintptr
+ Fn int32
+ Fi int32
+ FiPos I64
+ FiLookahead I64
+}
+
+type Fts5LookaheadReader = Fts5LookaheadReader1 /* sqlite3.c:213443:36 */
+
+func fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:213454:12: */
+ (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead
+ if sqlite3Fts5PoslistNext64(tls, (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fn, (p+12 /* &.i */), (p+24 /* &.iLookahead */)) != 0 {
+ (*Fts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead = (I64((int64(1))) << 62)
+ }
+ return (libc.Bool32((*Fts5LookaheadReader)(unsafe.Pointer(p)).FiPos == (I64((int64(1))) << 62)))
+}
+
+func fts5LookaheadReaderInit(tls *libc.TLS, a uintptr, n int32, p uintptr) int32 { /* sqlite3.c:213462:12: */
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Fts5LookaheadReader{})))
+ (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fa = a
+ (*Fts5LookaheadReader)(unsafe.Pointer(p)).Fn = n
+ fts5LookaheadReaderNext(tls, p)
+ return fts5LookaheadReaderNext(tls, p)
+}
+
+type Fts5NearTrimmer1 = struct {
+ Freader Fts5LookaheadReader
+ Fwriter Fts5PoslistWriter
+ FpOut uintptr
+}
+
+type Fts5NearTrimmer = Fts5NearTrimmer1 /* sqlite3.c:213473:32 */
+
+// The near-set object passed as the first argument contains more than
+// one phrase. All phrases currently point to the same row. The
+// Fts5ExprPhrase.poslist buffers are populated accordingly. This function
+// tests if the current row contains instances of each phrase sufficiently
+// close together to meet the NEAR constraint. Non-zero is returned if it
+// does, or zero otherwise.
+//
+// If in/out parameter (*pRc) is set to other than SQLITE_OK when this
+// function is called, it is a no-op. Or, if an error (e.g. SQLITE_NOMEM)
+// occurs within this function (*pRc) is set accordingly before returning.
+// The return value is undefined in both these cases.
+//
+// If no error occurs and non-zero (a match) is returned, the position-list
+// of each phrase object is edited to contain only those entries that
+// meet the constraint before returning.
+func fts5ExprNearIsMatch(tls *libc.TLS, pRc uintptr, pNear uintptr) int32 { /* sqlite3.c:213497:12: */
+ bp := tls.Alloc(196)
+ defer tls.Free(196)
+
+ // var aStatic [4]Fts5NearTrimmer at bp, 192
+
+ var a uintptr
+ var apPhrase uintptr
+ var i int32
+ // var rc int32 at bp+192, 4
+
+ var bMatch int32
+ var nByte Sqlite3_int64
+ var pPoslist uintptr
+ var pPos uintptr
+ var iPos I64
+ var pWriter uintptr
+ var iAdv int32
+ var iMin I64
+ var iMax I64
+ var bRet int32
+ a = bp /* aStatic */
+ apPhrase = pNear + 24 /* &.apPhrase */
+ *(*int32)(unsafe.Pointer(bp + 192 /* rc */)) = *(*int32)(unsafe.Pointer(pRc))
+
+ // If the aStatic[] array is not large enough, allocate a large array
+ // using sqlite3_malloc(). This approach could be improved upon.
+ if !((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > (int32(uint64(unsafe.Sizeof([4]Fts5NearTrimmer{})) / uint64(unsafe.Sizeof(Fts5NearTrimmer{}))))) {
+ goto __1
+ }
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5NearTrimmer{})) * uint64((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase)))
+ a = sqlite3Fts5MallocZero(tls, bp+192 /* &rc */, nByte)
+ goto __2
+__1:
+ libc.Xmemset(tls, bp /* &aStatic[0] */, 0, uint64(unsafe.Sizeof([4]Fts5NearTrimmer{})))
+__2:
+ ;
+ if !(*(*int32)(unsafe.Pointer(bp + 192 /* rc */)) != 0) {
+ goto __3
+ }
+ *(*int32)(unsafe.Pointer(pRc)) = *(*int32)(unsafe.Pointer(bp + 192 /* rc */))
+ return 0
+__3:
+ ;
+
+ // Initialize a lookahead iterator for each phrase. After passing the
+ // buffer and buffer size to the lookaside-reader init function, zero
+ // the phrase poslist buffer. The new poslist for the phrase (containing
+ // the same entries as the original with some entries removed on account
+ // of the NEAR constraint) is written over the original even as it is
+ // being read. This is safe as the entries for the new poslist are a
+ // subset of the old, so it is not possible for data yet to be read to
+ // be overwritten.
+ i = 0
+__4:
+ if !(i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) {
+ goto __6
+ }
+ pPoslist = (*(*uintptr)(unsafe.Pointer(apPhrase + uintptr(i)*8)) + 8 /* &.poslist */)
+ fts5LookaheadReaderInit(tls, (*Fts5Buffer)(unsafe.Pointer(pPoslist)).Fp, (*Fts5Buffer)(unsafe.Pointer(pPoslist)).Fn, (a + uintptr(i)*48 /* &.reader */))
+ (*Fts5Buffer)(unsafe.Pointer(pPoslist)).Fn = 0
+ (*Fts5NearTrimmer)(unsafe.Pointer(a + uintptr(i)*48)).FpOut = pPoslist
+ goto __5
+__5:
+ i++
+ goto __4
+ goto __6
+__6:
+ ;
+
+__7:
+ if !(1 != 0) {
+ goto __8
+ }
+
+ // This block advances the phrase iterators until they point to a set of
+ // entries that together comprise a match.
+ iMax = (*Fts5NearTrimmer)(unsafe.Pointer(a + uintptr(0)*48)).Freader.FiPos
+__9:
+ bMatch = 1
+ i = 0
+__12:
+ if !(i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) {
+ goto __14
+ }
+ pPos = (a + uintptr(i)*48 /* &.reader */)
+ iMin = ((iMax - I64((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(i)*8)))).FnTerm)) - I64((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear))
+ if !(((*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos < iMin) || ((*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos > iMax)) {
+ goto __15
+ }
+ bMatch = 0
+__16:
+ if !((*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos < iMin) {
+ goto __17
+ }
+ if !(fts5LookaheadReaderNext(tls, pPos) != 0) {
+ goto __18
+ }
+ goto ismatch_out
+__18:
+ ;
+ goto __16
+__17:
+ ;
+ if !((*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos > iMax) {
+ goto __19
+ }
+ iMax = (*Fts5LookaheadReader)(unsafe.Pointer(pPos)).FiPos
+__19:
+ ;
+__15:
+ ;
+ goto __13
+__13:
+ i++
+ goto __12
+ goto __14
+__14:
+ ;
+ goto __10
+__10:
+ if bMatch == 0 {
+ goto __9
+ }
+ goto __11
+__11:
+ ;
+
+ // Add an entry to each output position list
+ i = 0
+__20:
+ if !(i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) {
+ goto __22
+ }
+ iPos = (*Fts5NearTrimmer)(unsafe.Pointer(a + uintptr(i)*48)).Freader.FiPos
+ pWriter = (a + uintptr(i)*48 + 32 /* &.writer */)
+ if !(((*Fts5Buffer)(unsafe.Pointer((*Fts5NearTrimmer)(unsafe.Pointer(a+uintptr(i)*48)).FpOut)).Fn == 0) || (iPos != (*Fts5PoslistWriter)(unsafe.Pointer(pWriter)).FiPrev)) {
+ goto __23
+ }
+ sqlite3Fts5PoslistWriterAppend(tls, (*Fts5NearTrimmer)(unsafe.Pointer(a+uintptr(i)*48)).FpOut, pWriter, iPos)
+__23:
+ ;
+ goto __21
+__21:
+ i++
+ goto __20
+ goto __22
+__22:
+ ;
+
+ iAdv = 0
+ iMin = (*Fts5NearTrimmer)(unsafe.Pointer(a + uintptr(0)*48)).Freader.FiLookahead
+ i = 0
+__24:
+ if !(i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) {
+ goto __26
+ }
+ if !((*Fts5NearTrimmer)(unsafe.Pointer(a+uintptr(i)*48)).Freader.FiLookahead < iMin) {
+ goto __27
+ }
+ iMin = (*Fts5NearTrimmer)(unsafe.Pointer(a + uintptr(i)*48)).Freader.FiLookahead
+ iAdv = i
+__27:
+ ;
+ goto __25
+__25:
+ i++
+ goto __24
+ goto __26
+__26:
+ ;
+ if !(fts5LookaheadReaderNext(tls, (a+uintptr(iAdv)*48 /* &.reader */)) != 0) {
+ goto __28
+ }
+ goto ismatch_out
+__28:
+ ;
+ goto __7
+__8:
+ ;
+
+ismatch_out:
+ bRet = (libc.Bool32((*Fts5Buffer)(unsafe.Pointer((*Fts5NearTrimmer)(unsafe.Pointer(a+uintptr(0)*48)).FpOut)).Fn > 0))
+ *(*int32)(unsafe.Pointer(pRc)) = *(*int32)(unsafe.Pointer(bp + 192 /* rc */))
+ if !(a != bp /* aStatic */) {
+ goto __29
+ }
+ Xsqlite3_free(tls, a)
+__29:
+ ;
+ return bRet
+ return int32(0)
+}
+
+// Advance iterator pIter until it points to a value equal to or laster
+// than the initial value of *piLast. If this means the iterator points
+// to a value laster than *piLast, update *piLast to the new lastest value.
+//
+// If the iterator reaches EOF, set *pbEof to true before returning. If
+// an error occurs, set *pRc to an error code. If either *pbEof or *pRc
+// are set, return a non-zero value. Otherwise, return zero.
+func fts5ExprAdvanceto(tls *libc.TLS, pIter uintptr, bDesc int32, piLast uintptr, pRc uintptr, pbEof uintptr) int32 { /* sqlite3.c:213596:12: */
+ var iLast I64 = *(*I64)(unsafe.Pointer(piLast))
+ var iRowid I64
+
+ iRowid = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid
+ if ((bDesc == 0) && (iLast > iRowid)) || ((bDesc != 0) && (iLast < iRowid)) {
+ var rc int32 = sqlite3Fts5IterNextFrom(tls, pIter, iLast)
+ if (rc != 0) || ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0) {
+ *(*int32)(unsafe.Pointer(pRc)) = rc
+ *(*int32)(unsafe.Pointer(pbEof)) = 1
+ return 1
+ }
+ iRowid = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid
+ }
+ *(*I64)(unsafe.Pointer(piLast)) = iRowid
+
+ return 0
+}
+
+func fts5ExprSynonymAdvanceto(tls *libc.TLS, pTerm uintptr, bDesc int32, piLast uintptr, pRc uintptr) int32 { /* sqlite3.c:213622:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var rc int32 = 0
+ var iLast I64 = *(*I64)(unsafe.Pointer(piLast))
+ var p uintptr
+ *(*int32)(unsafe.Pointer(bp /* bEof */)) = 0
+
+ for p = pTerm; (rc == 0) && (p != 0); p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
+ if (int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof)) == 0 {
+ var iRowid I64 = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FiRowid
+ if ((bDesc == 0) && (iLast > iRowid)) || ((bDesc != 0) && (iLast < iRowid)) {
+ rc = sqlite3Fts5IterNextFrom(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter, iLast)
+ }
+ }
+ }
+
+ if rc != 0 {
+ *(*int32)(unsafe.Pointer(pRc)) = rc
+ *(*int32)(unsafe.Pointer(bp /* bEof */)) = 1
+ } else {
+ *(*I64)(unsafe.Pointer(piLast)) = fts5ExprSynonymRowid(tls, pTerm, bDesc, bp /* &bEof */)
+ }
+ return *(*int32)(unsafe.Pointer(bp /* bEof */))
+}
+
+func fts5ExprNearTest(tls *libc.TLS, pRc uintptr, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:213652:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = *(*int32)(unsafe.Pointer(pRc))
+
+ if (*Fts5Config)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FeDetail != 0 {
+ var pTerm uintptr
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(0)*8))
+ (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = 0
+ for pTerm = ((pPhrase + 32 /* &.aTerm */) + uintptr(0)*32); pTerm != 0; pTerm = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym {
+ var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter
+ if (int32((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof)) == 0 {
+ if ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid) && ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData > 0) {
+ (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = 1
+ }
+ }
+ }
+ return (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn
+ } else {
+ var i int32
+
+ // Check that each phrase in the nearset matches the current row.
+ // Populate the pPhrase->poslist buffers at the same time. If any
+ // phrase is not a match, break out of the loop early.
+ for i = 0; (*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == 0) && (i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase); i++ {
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(i)*8))
+ if ((((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 1) || ((*Fts5ExprTerm)(unsafe.Pointer((pPhrase+32 /* &.aTerm */)+uintptr(0)*32)).FpSynonym != 0)) ||
+ ((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset != 0)) || ((*Fts5ExprTerm)(unsafe.Pointer((pPhrase+32 /* &.aTerm */)+uintptr(0)*32)).FbFirst != 0) {
+ *(*int32)(unsafe.Pointer(bp /* bMatch */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = fts5ExprPhraseIsMatch(tls, pNode, pPhrase, bp /* &bMatch */)
+ if *(*int32)(unsafe.Pointer(bp /* bMatch */)) == 0 {
+ break
+ }
+ } else {
+ var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */) + uintptr(0)*32)).FpIter
+ sqlite3Fts5BufferSet(tls, bp+4 /* &rc */, (pPhrase + 8 /* &.poslist */), (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData)
+ }
+ }
+
+ *(*int32)(unsafe.Pointer(pRc)) = *(*int32)(unsafe.Pointer(bp + 4 /* rc */))
+ if (i == (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase) && ((i == 1) || (fts5ExprNearIsMatch(tls, pRc, pNear) != 0)) {
+ return 1
+ }
+ return 0
+ }
+ return int32(0)
+}
+
+// Initialize all term iterators in the pNear object. If any term is found
+// to match no documents at all, return immediately without initializing any
+// further iterators.
+//
+// If an error occurs, return an SQLite error code. Otherwise, return
+// SQLITE_OK. It is not considered an error if some term matches zero
+// documents.
+func fts5ExprNearInitAll(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:213711:12: */
+ var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
+ var i int32
+
+ for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(i)*8))
+ if (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm == 0 {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
+ return 0
+ } else {
+ var j int32
+ for j = 0; j < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; j++ {
+ var pTerm uintptr = ((pPhrase + 32 /* &.aTerm */) + uintptr(j)*32)
+ var p uintptr
+ var bHit int32 = 0
+
+ for p = pTerm; p != 0; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
+ var rc int32
+ if (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter != 0 {
+ sqlite3Fts5IterClose(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)
+ (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter = uintptr(0)
+ }
+ rc = sqlite3Fts5IndexQuery(tls,
+ (*Fts5Expr)(unsafe.Pointer(pExpr)).FpIndex, (*Fts5ExprTerm)(unsafe.Pointer(p)).FzTerm, int32(libc.Xstrlen(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FzTerm)),
+ ((func() int32 {
+ if (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FbPrefix != 0 {
+ return 0x0001
+ }
+ return 0
+ }()) | (func() int32 {
+ if (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc != 0 {
+ return 0x0002
+ }
+ return 0
+ }())),
+ (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset,
+ (p + 16 /* &.pIter */))
+
+ if rc != 0 {
+ return rc
+ }
+ if 0 == (int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof)) {
+ bHit = 1
+ }
+ }
+
+ if bHit == 0 {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
+ return 0
+ }
+ }
+ }
+ }
+
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0
+ return 0
+}
+
+// If pExpr is an ASC iterator, this function returns a value with the
+// same sign as:
+//
+// (iLhs - iRhs)
+//
+// Otherwise, if this is a DESC iterator, the opposite is returned:
+//
+// (iRhs - iLhs)
+func fts5RowidCmp(tls *libc.TLS, pExpr uintptr, iLhs I64, iRhs I64) int32 { /* sqlite3.c:213773:12: */
+
+ if (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc == 0 {
+ if iLhs < iRhs {
+ return -1
+ }
+ return (libc.Bool32(iLhs > iRhs))
+ } else {
+ if iLhs > iRhs {
+ return -1
+ }
+ return (libc.Bool32(iLhs < iRhs))
+ }
+ return int32(0)
+}
+
+func fts5ExprSetEof(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:213788:13: */
+ var i int32
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
+ for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
+ fts5ExprSetEof(tls, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(i)*8)))
+ }
+}
+
+func fts5ExprNodeZeroPoslist(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:213797:13: */
+ if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == 9) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == 4) {
+ var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
+ var i int32
+ for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(i)*8))
+ (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = 0
+ }
+ } else {
+ var i int32
+ for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
+ fts5ExprNodeZeroPoslist(tls, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(i)*8)))
+ }
+ }
+}
+
+// Compare the values currently indicated by the two nodes as follows:
+//
+// res = (*p1) - (*p2)
+//
+// Nodes that point to values that come later in the iteration order are
+// considered to be larger. Nodes at EOF are the largest of all.
+//
+// This means that if the iteration order is ASC, then numerically larger
+// rowids are considered larger. Or if it is the default DESC, numerically
+// smaller rowids are larger.
+func fts5NodeCompare(tls *libc.TLS, pExpr uintptr, p1 uintptr, p2 uintptr) int32 { /* sqlite3.c:213827:12: */
+ if (*Fts5ExprNode)(unsafe.Pointer(p2)).FbEof != 0 {
+ return -1
+ }
+ if (*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof != 0 {
+ return +1
+ }
+ return fts5RowidCmp(tls, pExpr, (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid, (*Fts5ExprNode)(unsafe.Pointer(p2)).FiRowid)
+}
+
+// All individual term iterators in pNear are guaranteed to be valid when
+// this function is called. This function checks if all term iterators
+// point to the same rowid, and if not, advances them until they do.
+// If an EOF is reached before this happens, *pbEof is set to true before
+// returning.
+//
+// SQLITE_OK is returned if an error occurs, or an SQLite error code
+// otherwise. It is not considered an error code if an iterator reaches
+// EOF.
+func fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:213848:12: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
+ var pLeft uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(0)*8))
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = 0
+ // var iLast I64 at bp, 8
+ // Lastest rowid any iterator points to
+ var i int32
+ var j int32 // Phrase and token index, respectively
+ var bMatch int32 // True if all terms are at the same rowid
+ var bDesc int32 = (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc
+
+ // Check that this node should not be FTS5_TERM
+
+ // Initialize iLast, the "lastest" rowid any iterator points to. If the
+ // iterator skips through rowids in the default ascending order, this means
+ // the maximum rowid. Or, if the iterator is "ORDER BY rowid DESC", then it
+ // means the minimum rowid.
+ if (*Fts5ExprTerm)(unsafe.Pointer((pLeft+32 /* &.aTerm */)+uintptr(0)*32)).FpSynonym != 0 {
+ *(*I64)(unsafe.Pointer(bp /* iLast */)) = fts5ExprSynonymRowid(tls, ((pLeft + 32 /* &.aTerm */) + uintptr(0)*32), bDesc, uintptr(0))
+ } else {
+ *(*I64)(unsafe.Pointer(bp /* iLast */)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer((pLeft + 32 /* &.aTerm */) + uintptr(0)*32)).FpIter)).FiRowid
+ }
+
+ for ok := true; ok; ok = (bMatch == 0) {
+ bMatch = 1
+ for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(i)*8))
+ for j = 0; j < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; j++ {
+ var pTerm uintptr = ((pPhrase + 32 /* &.aTerm */) + uintptr(j)*32)
+ if (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym != 0 {
+ var iRowid I64 = fts5ExprSynonymRowid(tls, pTerm, bDesc, uintptr(0))
+ if iRowid == *(*I64)(unsafe.Pointer(bp /* iLast */)) {
+ continue
+ }
+ bMatch = 0
+ if fts5ExprSynonymAdvanceto(tls, pTerm, bDesc, bp /* &iLast */, bp+8 /* &rc */) != 0 {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
+ return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
+ }
+ } else {
+ var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */) + uintptr(j)*32)).FpIter
+ if ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == *(*I64)(unsafe.Pointer(bp /* iLast */))) || ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0) {
+ continue
+ }
+ bMatch = 0
+ if fts5ExprAdvanceto(tls, pIter, bDesc, bp /* &iLast */, bp+8 /* &rc */, (pNode+4 /* &.bEof */)) != 0 {
+ return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
+ }
+ }
+ }
+ }
+ }
+
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = *(*I64)(unsafe.Pointer(bp /* iLast */))
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = (libc.Bool32((0 == fts5ExprNearTest(tls, bp+8 /* &rc */, pExpr, pNode)) && (*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0)))
+
+ return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
+}
+
+// Advance the first term iterator in the first phrase of pNear. Set output
+// variable *pbEof to true if it reaches EOF or if an error occurs.
+//
+// Return SQLITE_OK if successful, or an SQLite error code if an error
+// occurs.
+func fts5ExprNodeNext_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:213918:12: */
+ var pTerm uintptr = ((*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24 /* &.apPhrase */) + uintptr(0)*8)) + 32 /* &.aTerm */) + uintptr(0)*32)
+ var rc int32 = 0
+
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
+ if (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym != 0 {
+ var bEof int32 = 1
+ var p uintptr
+
+ // Find the firstest rowid any synonym points to.
+ var iRowid I64 = fts5ExprSynonymRowid(tls, pTerm, (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc, uintptr(0))
+
+ // Advance each iterator that currently points to iRowid. Or, if iFrom
+ // is valid - each iterator that points to a rowid before iFrom.
+ for p = pTerm; p != 0; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
+ if (int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof)) == 0 {
+ var ii I64 = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FiRowid
+ if (ii == iRowid) ||
+ (((bFromValid != 0) && (ii != iFrom)) && ((libc.Bool32(ii > iFrom)) == (*Fts5Expr)(unsafe.Pointer(pExpr)).FbDesc)) {
+ if bFromValid != 0 {
+ rc = sqlite3Fts5IterNextFrom(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter, iFrom)
+ } else {
+ rc = sqlite3Fts5IterNext(tls, (*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)
+ }
+ if rc != 0 {
+ break
+ }
+ if (int32((*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer(p)).FpIter)).FbEof)) == 0 {
+ bEof = 0
+ }
+ } else {
+ bEof = 0
+ }
+ }
+ }
+
+ // Set the EOF flag if either all synonym iterators are at EOF or an
+ // error has occurred.
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (libc.Bool32((rc != 0) || (bEof != 0)))
+ } else {
+ var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter
+
+ if bFromValid != 0 {
+ rc = sqlite3Fts5IterNextFrom(tls, pIter, iFrom)
+ } else {
+ rc = sqlite3Fts5IterNext(tls, pIter)
+ }
+
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (libc.Bool32((rc != 0) || ((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0)))
+ }
+
+ if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 {
+
+ rc = fts5ExprNodeTest_STRING(tls, pExpr, pNode)
+ }
+
+ return rc
+}
+
+func fts5ExprNodeTest_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:213983:12: */
+ // As this "NEAR" object is actually a single phrase that consists
+ // of a single term only, grab pointers into the poslist managed by the
+ // fts5_index.c iterator object. This is much faster than synthesizing
+ // a new poslist the way we have to for more complicated phrase or NEAR
+ // expressions.
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24 /* &.apPhrase */) + uintptr(0)*8))
+ var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */) + uintptr(0)*32)).FpIter
+
+ (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData
+ if (*Fts5Config)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FeDetail == 0 {
+ (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fp = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData
+ }
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = (*Fts5IndexIter)(unsafe.Pointer(pIter)).FiRowid
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = (libc.Bool32((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn == 0))
+ return 0
+}
+
+// xNext() method for a node of type FTS5_TERM.
+func fts5ExprNodeNext_TERM(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:214011:12: */
+ var rc int32
+ var pIter uintptr = (*Fts5ExprTerm)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24 /* &.apPhrase */) + uintptr(0)*8)) + 32 /* &.aTerm */) + uintptr(0)*32)).FpIter
+
+ if bFromValid != 0 {
+ rc = sqlite3Fts5IterNextFrom(tls, pIter, iFrom)
+ } else {
+ rc = sqlite3Fts5IterNext(tls, pIter)
+ }
+ if (rc == 0) && ((int32((*Fts5IndexIter)(unsafe.Pointer(pIter)).FbEof)) == 0) {
+ rc = fts5ExprNodeTest_TERM(tls, pExpr, pNode)
+ } else {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
+ }
+ return rc
+}
+
+func fts5ExprNodeTest_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr) { /* sqlite3.c:214035:13: */
+ var pNext uintptr = *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(0)*8))
+ var i int32
+
+ for i = 1; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
+ var pChild uintptr = *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(i)*8))
+ var cmp int32 = fts5NodeCompare(tls, pExpr, pNext, pChild)
+ if (cmp > 0) || ((cmp == 0) && ((*Fts5ExprNode)(unsafe.Pointer(pChild)).FbNomatch == 0)) {
+ pNext = pChild
+ }
+ }
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = (*Fts5ExprNode)(unsafe.Pointer(pNext)).FiRowid
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (*Fts5ExprNode)(unsafe.Pointer(pNext)).FbEof
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = (*Fts5ExprNode)(unsafe.Pointer(pNext)).FbNomatch
+}
+
+func fts5ExprNodeNext_OR(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:214054:12: */
+ var i int32
+ var iLast I64 = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid
+
+ for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
+ var p1 uintptr = *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(i)*8))
+
+ if (*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof == 0 {
+ if ((*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid == iLast) ||
+ ((bFromValid != 0) && (fts5RowidCmp(tls, pExpr, (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid, iFrom) < 0)) {
+ var rc int32 = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((p1 + 16 /* &.xNext */))))(tls, pExpr, p1, bFromValid, iFrom)
+ if rc != 0 {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
+ return rc
+ }
+ }
+ }
+ }
+
+ fts5ExprNodeTest_OR(tls, pExpr, pNode)
+ return 0
+}
+
+// Argument pNode is an FTS5_AND node.
+func fts5ExprNodeTest_AND(tls *libc.TLS, pExpr uintptr, pAnd uintptr) int32 { /* sqlite3.c:214086:12: */
+ var iChild int32
+ var iLast I64 = (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FiRowid
+ var rc int32 = 0
+ var bMatch int32
+
+ for ok := true; ok; ok = (bMatch == 0) {
+ (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch = 0
+ bMatch = 1
+ for iChild = 0; iChild < (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FnChild; iChild++ {
+ var pChild uintptr = *(*uintptr)(unsafe.Pointer((pAnd + 48 /* &.apChild */) + uintptr(iChild)*8))
+ var cmp int32 = fts5RowidCmp(tls, pExpr, iLast, (*Fts5ExprNode)(unsafe.Pointer(pChild)).FiRowid)
+ if cmp > 0 {
+ // Advance pChild until it points to iLast or laster
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((pChild + 16 /* &.xNext */))))(tls, pExpr, pChild, 1, iLast)
+ if rc != 0 {
+ (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch = 0
+ return rc
+ }
+ }
+
+ // If the child node is now at EOF, so is the parent AND node. Otherwise,
+ // the child node is guaranteed to have advanced at least as far as
+ // rowid iLast. So if it is not at exactly iLast, pChild->iRowid is the
+ // new lastest rowid seen so far.
+
+ if (*Fts5ExprNode)(unsafe.Pointer(pChild)).FbEof != 0 {
+ fts5ExprSetEof(tls, pAnd)
+ bMatch = 1
+ break
+ } else if iLast != (*Fts5ExprNode)(unsafe.Pointer(pChild)).FiRowid {
+ bMatch = 0
+ iLast = (*Fts5ExprNode)(unsafe.Pointer(pChild)).FiRowid
+ }
+
+ if (*Fts5ExprNode)(unsafe.Pointer(pChild)).FbNomatch != 0 {
+ (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch = 1
+ }
+ }
+ }
+
+ if ((*Fts5ExprNode)(unsafe.Pointer(pAnd)).FbNomatch != 0) && (pAnd != (*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot) {
+ fts5ExprNodeZeroPoslist(tls, pAnd)
+ }
+ (*Fts5ExprNode)(unsafe.Pointer(pAnd)).FiRowid = iLast
+ return 0
+}
+
+func fts5ExprNodeNext_AND(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:214138:12: */
+ var rc int32 = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(0)*8)) + 16 /* &.xNext */))))(tls, pExpr, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(0)*8)), bFromValid, iFrom)
+ if rc == 0 {
+ rc = fts5ExprNodeTest_AND(tls, pExpr, pNode)
+ } else {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
+ }
+ return rc
+}
+
+func fts5ExprNodeTest_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:214153:12: */
+ var rc int32 = 0
+ var p1 uintptr = *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(0)*8))
+ var p2 uintptr = *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(1)*8))
+
+ for (rc == 0) && ((*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof == 0) {
+ var cmp int32 = fts5NodeCompare(tls, pExpr, p1, p2)
+ if cmp > 0 {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((p2 + 16 /* &.xNext */))))(tls, pExpr, p2, 1, (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid)
+ cmp = fts5NodeCompare(tls, pExpr, p1, p2)
+ }
+
+ if (cmp != 0) || ((*Fts5ExprNode)(unsafe.Pointer(p2)).FbNomatch != 0) {
+ break
+ }
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((p1 + 16 /* &.xNext */))))(tls, pExpr, p1, 0, int64(0))
+ }
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = (*Fts5ExprNode)(unsafe.Pointer(p1)).FbNomatch
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = (*Fts5ExprNode)(unsafe.Pointer(p1)).FiRowid
+ if (*Fts5ExprNode)(unsafe.Pointer(p1)).FbEof != 0 {
+ fts5ExprNodeZeroPoslist(tls, p2)
+ }
+ return rc
+}
+
+func fts5ExprNodeNext_NOT(tls *libc.TLS, pExpr uintptr, pNode uintptr, bFromValid int32, iFrom I64) int32 { /* sqlite3.c:214181:12: */
+ var rc int32 = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(0)*8)) + 16 /* &.xNext */))))(tls, pExpr, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(0)*8)), bFromValid, iFrom)
+ if rc == 0 {
+ rc = fts5ExprNodeTest_NOT(tls, pExpr, pNode)
+ }
+ if rc != 0 {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
+ }
+ return rc
+}
+
+// If pNode currently points to a match, this function returns SQLITE_OK
+// without modifying it. Otherwise, pNode is advanced until it does point
+// to a match or EOF is reached.
+func fts5ExprNodeTest(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:214202:12: */
+ var rc int32 = 0
+ if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0 {
+ switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType {
+
+ case 9:
+ {
+ rc = fts5ExprNodeTest_STRING(tls, pExpr, pNode)
+ break
+ }
+ fallthrough
+
+ case 4:
+ {
+ rc = fts5ExprNodeTest_TERM(tls, pExpr, pNode)
+ break
+ }
+ fallthrough
+
+ case 2:
+ {
+ rc = fts5ExprNodeTest_AND(tls, pExpr, pNode)
+ break
+ }
+ fallthrough
+
+ case 1:
+ {
+ fts5ExprNodeTest_OR(tls, pExpr, pNode)
+ break
+ }
+ fallthrough
+
+ default:
+ {
+ rc = fts5ExprNodeTest_NOT(tls, pExpr, pNode)
+ break
+ }
+ }
+ }
+ return rc
+}
+
+// Set node pNode, which is part of expression pExpr, to point to the first
+// match. If there are no matches, set the Node.bEof flag to indicate EOF.
+//
+// Return an SQLite error code if an error occurs, or SQLITE_OK otherwise.
+// It is not an error if there are no matches.
+func fts5ExprNodeFirst(tls *libc.TLS, pExpr uintptr, pNode uintptr) int32 { /* sqlite3.c:214247:12: */
+ var rc int32 = 0
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbNomatch = 0
+
+ if ((*Fts5ExprNode)(unsafe.Pointer((pNode))).FeType == 4) || ((*Fts5ExprNode)(unsafe.Pointer((pNode))).FeType == 9) {
+ // Initialize all term iterators in the NEAR object.
+ rc = fts5ExprNearInitAll(tls, pExpr, pNode)
+ } else if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext == uintptr(0) {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 1
+ } else {
+ var i int32
+ var nEof int32 = 0
+ for i = 0; (i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild) && (rc == 0); i++ {
+ var pChild uintptr = *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(i)*8))
+ rc = fts5ExprNodeFirst(tls, pExpr, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(i)*8)))
+
+ nEof = nEof + ((*Fts5ExprNode)(unsafe.Pointer(pChild)).FbEof)
+ }
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = (*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(0)*8)))).FiRowid
+
+ switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType {
+ case 2:
+ if nEof > 0 {
+ fts5ExprSetEof(tls, pNode)
+ }
+ break
+ fallthrough
+
+ case 1:
+ if (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild == nEof {
+ fts5ExprSetEof(tls, pNode)
+ }
+ break
+ fallthrough
+
+ default:
+
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = (*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(0)*8)))).FbEof
+ break
+ }
+ }
+
+ if rc == 0 {
+ rc = fts5ExprNodeTest(tls, pExpr, pNode)
+ }
+ return rc
+}
+
+// Begin iterating through the set of documents in index pIdx matched by
+// the MATCH expression passed as the first argument. If the "bDesc"
+// parameter is passed a non-zero value, iteration is in descending rowid
+// order. Or, if it is zero, in ascending order.
+//
+// If iterating in ascending rowid order (bDesc==0), the first document
+// visited is that with the smallest rowid that is larger than or equal
+// to parameter iFirst. Or, if iterating in ascending order (bDesc==1),
+// then the first document visited must have a rowid smaller than or
+// equal to iFirst.
+//
+// Return SQLITE_OK if successful, or an SQLite error code otherwise. It
+// is not considered an error if the query does not match any documents.
+func sqlite3Fts5ExprFirst(tls *libc.TLS, p uintptr, pIdx uintptr, iFirst I64, bDesc int32) int32 { /* sqlite3.c:214306:12: */
+ var pRoot uintptr = (*Fts5Expr)(unsafe.Pointer(p)).FpRoot
+ var rc int32 // Return code
+
+ (*Fts5Expr)(unsafe.Pointer(p)).FpIndex = pIdx
+ (*Fts5Expr)(unsafe.Pointer(p)).FbDesc = bDesc
+ rc = fts5ExprNodeFirst(tls, p, pRoot)
+
+ // If not at EOF but the current rowid occurs earlier than iFirst in
+ // the iteration order, move to document iFirst or later.
+ if ((rc == 0) &&
+ (0 == (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbEof)) &&
+ (fts5RowidCmp(tls, p, (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FiRowid, iFirst) < 0) {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((pRoot + 16 /* &.xNext */))))(tls, p, pRoot, 1, iFirst)
+ }
+
+ // If the iterator is not at a real match, skip forward until it is.
+ for (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0 {
+
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((pRoot + 16 /* &.xNext */))))(tls, p, pRoot, 0, int64(0))
+ }
+ return rc
+}
+
+// Move to the next document
+//
+// Return SQLITE_OK if successful, or an SQLite error code otherwise. It
+// is not considered an error if the query does not match any documents.
+func sqlite3Fts5ExprNext(tls *libc.TLS, p uintptr, iLast I64) int32 { /* sqlite3.c:214337:12: */
+ var rc int32
+ var pRoot uintptr = (*Fts5Expr)(unsafe.Pointer(p)).FpRoot
+
+ for ok := true; ok; ok = (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbNomatch != 0 {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, I64) int32)(unsafe.Pointer((pRoot + 16 /* &.xNext */))))(tls, p, pRoot, 0, int64(0))
+ }
+ if fts5RowidCmp(tls, p, (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FiRowid, iLast) > 0 {
+ (*Fts5ExprNode)(unsafe.Pointer(pRoot)).FbEof = 1
+ }
+ return rc
+}
+
+func sqlite3Fts5ExprEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:214351:12: */
+ return (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p)).FpRoot)).FbEof
+}
+
+func sqlite3Fts5ExprRowid(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:214355:12: */
+ return (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(p)).FpRoot)).FiRowid
+}
+
+func fts5ParseStringFromToken(tls *libc.TLS, pToken uintptr, pz uintptr) int32 { /* sqlite3.c:214359:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ *(*uintptr)(unsafe.Pointer(pz)) = sqlite3Fts5Strndup(tls, bp /* &rc */, (*Fts5Token)(unsafe.Pointer(pToken)).Fp, (*Fts5Token)(unsafe.Pointer(pToken)).Fn)
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+}
+
+// Free the phrase object passed as the only argument.
+func fts5ExprPhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214368:13: */
+ if pPhrase != 0 {
+ var i int32
+ for i = 0; i < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; i++ {
+ var pSyn uintptr
+ var pNext uintptr
+ var pTerm uintptr = ((pPhrase + 32 /* &.aTerm */) + uintptr(i)*32)
+ Xsqlite3_free(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm)
+ sqlite3Fts5IterClose(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter)
+ for pSyn = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym; pSyn != 0; pSyn = pNext {
+ pNext = (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FpSynonym
+ sqlite3Fts5IterClose(tls, (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FpIter)
+ sqlite3Fts5BufferFree(tls, (pSyn + uintptr(1)*32))
+ Xsqlite3_free(tls, pSyn)
+ }
+ }
+ if (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.FnSpace > 0 {
+ sqlite3Fts5BufferFree(tls, (pPhrase + 8 /* &.poslist */))
+ }
+ Xsqlite3_free(tls, pPhrase)
+ }
+}
+
+// Set the "bFirst" flag on the first token of the phrase passed as the
+// only argument.
+func sqlite3Fts5ParseSetCaret(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214393:13: */
+ if (pPhrase != 0) && ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm != 0) {
+ (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */) + uintptr(0)*32)).FbFirst = U8(1)
+ }
+}
+
+// If argument pNear is NULL, then a new Fts5ExprNearset object is allocated
+// and populated with pPhrase. Or, if pNear is not NULL, phrase pPhrase is
+// appended to it and the results returned.
+//
+// If an OOM error occurs, both the pNear and pPhrase objects are freed and
+// NULL returned.
+func sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhrase uintptr) uintptr { /* sqlite3.c:214407:24: */
+ var SZALLOC int32 = 8
+ var pRet uintptr = uintptr(0)
+
+ if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == 0 {
+ if pPhrase == uintptr(0) {
+ return pNear
+ }
+ if pNear == uintptr(0) {
+ var nByte Sqlite3_int64
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5ExprNearset{})) + (uint64(SZALLOC) * uint64(unsafe.Sizeof(uintptr(0))))))
+ pRet = Xsqlite3_malloc64(tls, uint64(nByte))
+ if pRet == uintptr(0) {
+ (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = 7
+ } else {
+ libc.Xmemset(tls, pRet, 0, Size_t(nByte))
+ }
+ } else if ((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase % SZALLOC) == 0 {
+ var nNew int32 = ((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC)
+ var nByte Sqlite3_int64
+
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5ExprNearset{})) + (uint64(nNew) * uint64(unsafe.Sizeof(uintptr(0))))))
+ pRet = Xsqlite3_realloc64(tls, pNear, uint64(nByte))
+ if pRet == uintptr(0) {
+ (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = 7
+ }
+ } else {
+ pRet = pNear
+ }
+ }
+
+ if pRet == uintptr(0) {
+
+ sqlite3Fts5ParseNearsetFree(tls, pNear)
+ sqlite3Fts5ParsePhraseFree(tls, pPhrase)
+ } else {
+ if (*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase > 0 {
+ var pLast uintptr = *(*uintptr)(unsafe.Pointer((pRet + 24 /* &.apPhrase */) + uintptr(((*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase-1))*8))
+
+ if (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm == 0 {
+ fts5ExprPhraseFree(tls, pPhrase)
+ (*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase--
+ (*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase--
+ pPhrase = pLast
+ } else if (*Fts5ExprPhrase)(unsafe.Pointer(pLast)).FnTerm == 0 {
+ fts5ExprPhraseFree(tls, pLast)
+ *(*uintptr)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr(((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-2))*8)) = pPhrase
+ (*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase--
+ (*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase--
+ }
+ }
+ *(*uintptr)(unsafe.Pointer((pRet + 24 /* &.apPhrase */) + uintptr(libc.PostIncInt32(&(*Fts5ExprNearset)(unsafe.Pointer(pRet)).FnPhrase, 1))*8)) = pPhrase
+ }
+ return pRet
+}
+
+type TokenCtx1 = struct {
+ FpPhrase uintptr
+ Frc int32
+ _ [4]byte
+}
+
+type TokenCtx = TokenCtx1 /* sqlite3.c:214467:25 */
+
+// Callback for tokenizing terms used by ParseTerm().
+func fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:214476:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ var SZALLOC int32 = 8
+ var pCtx uintptr = pContext
+ var pPhrase uintptr = (*TokenCtx)(unsafe.Pointer(pCtx)).FpPhrase
+
+ _ = iUnused1
+ _ = iUnused2
+
+ // If an error has already occurred, this is a no-op
+ if (*TokenCtx)(unsafe.Pointer(pCtx)).Frc != 0 {
+ return (*TokenCtx)(unsafe.Pointer(pCtx)).Frc
+ }
+ if nToken > 32768 {
+ nToken = 32768
+ }
+
+ if ((pPhrase != 0) && ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0)) && ((tflags & 0x0001) != 0) {
+ var pSyn uintptr
+ var nByte Sqlite3_int64 = (Sqlite3_int64(((uint64(unsafe.Sizeof(Fts5ExprTerm{})) + uint64(unsafe.Sizeof(Fts5Buffer{}))) + uint64(nToken)) + uint64(1)))
+ pSyn = Xsqlite3_malloc64(tls, uint64(nByte))
+ if pSyn == uintptr(0) {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 7
+ } else {
+ libc.Xmemset(tls, pSyn, 0, Size_t(nByte))
+ (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FzTerm = (((pSyn) + uintptr(uint64(unsafe.Sizeof(Fts5ExprTerm{})))) + uintptr(uint64(unsafe.Sizeof(Fts5Buffer{}))))
+ libc.Xmemcpy(tls, (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FzTerm, pToken, uint64(nToken))
+ (*Fts5ExprTerm)(unsafe.Pointer(pSyn)).FpSynonym = (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */) + uintptr(((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm-1))*32)).FpSynonym
+ (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */) + uintptr(((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm-1))*32)).FpSynonym = pSyn
+ }
+ } else {
+ var pTerm uintptr
+ if (pPhrase == uintptr(0)) || (((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm % SZALLOC) == 0) {
+ var pNew uintptr
+ var nNew int32 = (SZALLOC + (func() int32 {
+ if pPhrase != 0 {
+ return (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm
+ }
+ return 0
+ }()))
+
+ pNew = Xsqlite3_realloc64(tls, pPhrase,
+ (uint64(uint64(unsafe.Sizeof(Fts5ExprPhrase{})) + (uint64(unsafe.Sizeof(Fts5ExprTerm{})) * uint64(nNew)))))
+ if pNew == uintptr(0) {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 7
+ } else {
+ if pPhrase == uintptr(0) {
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Fts5ExprPhrase{})))
+ }
+ (*TokenCtx)(unsafe.Pointer(pCtx)).FpPhrase = libc.AssignUintptr(&pPhrase, pNew)
+ (*Fts5ExprPhrase)(unsafe.Pointer(pNew)).FnTerm = (nNew - SZALLOC)
+ }
+ }
+
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ pTerm = ((pPhrase + 32 /* &.aTerm */) + uintptr(libc.PostIncInt32(&(*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm, 1))*32)
+ libc.Xmemset(tls, pTerm, 0, uint64(unsafe.Sizeof(Fts5ExprTerm{})))
+ (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm = sqlite3Fts5Strndup(tls, bp /* &rc */, pToken, nToken)
+ }
+ }
+
+ (*TokenCtx)(unsafe.Pointer(pCtx)).Frc = *(*int32)(unsafe.Pointer(bp /* rc */))
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+}
+
+// Free the phrase object passed as the only argument.
+func sqlite3Fts5ParsePhraseFree(tls *libc.TLS, pPhrase uintptr) { /* sqlite3.c:214541:13: */
+ fts5ExprPhraseFree(tls, pPhrase)
+}
+
+// Free the phrase object passed as the second argument.
+func sqlite3Fts5ParseNearsetFree(tls *libc.TLS, pNear uintptr) { /* sqlite3.c:214548:13: */
+ if pNear != 0 {
+ var i int32
+ for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
+ fts5ExprPhraseFree(tls, *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(i)*8)))
+ }
+ Xsqlite3_free(tls, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset)
+ Xsqlite3_free(tls, pNear)
+ }
+}
+
+func sqlite3Fts5ParseFinished(tls *libc.TLS, pParse uintptr, p uintptr) { /* sqlite3.c:214559:13: */
+
+ (*Fts5Parse)(unsafe.Pointer(pParse)).FpExpr = p
+}
+
+// This function is called by the parser to process a string token. The
+// string may or may not be quoted. In any case it is tokenized and a
+// phrase object consisting of all tokens returned.
+func sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToken uintptr, bPrefix int32) uintptr { /* sqlite3.c:214569:23: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var pConfig uintptr = (*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig
+ // var sCtx TokenCtx at bp, 16
+ // Context object passed to callback
+ var rc int32 // Tokenize return code
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* z */)) = uintptr(0)
+
+ libc.Xmemset(tls, bp /* &sCtx */, 0, uint64(unsafe.Sizeof(TokenCtx{})))
+ (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase = pAppend
+
+ rc = fts5ParseStringFromToken(tls, pToken, bp+16 /* &z */)
+ if rc == 0 {
+ var flags int32 = (0x0001 | (func() int32 {
+ if bPrefix != 0 {
+ return 0x0002
+ }
+ return 0
+ }()))
+ var n int32
+ sqlite3Fts5Dequote(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* z */)))
+ n = int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* z */))))
+ rc = sqlite3Fts5Tokenize(tls, pConfig, flags, *(*uintptr)(unsafe.Pointer(bp + 16 /* z */)), n, bp /* &sCtx */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{fts5ParseTokenize})))
+ }
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* z */)))
+ if (rc != 0) || (libc.AssignInt32(&rc, (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).Frc) != 0) {
+ (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = rc
+ fts5ExprPhraseFree(tls, (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase)
+ (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase = uintptr(0)
+ } else {
+
+ if pAppend == uintptr(0) {
+ if ((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase % 8) == 0 {
+ var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * (uint64((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase + 8))))
+ var apNew uintptr
+ apNew = Xsqlite3_realloc64(tls, (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase, uint64(nByte))
+ if apNew == uintptr(0) {
+ (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = 7
+ fts5ExprPhraseFree(tls, (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase)
+ return uintptr(0)
+ }
+ (*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase = apNew
+ }
+ (*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase++
+ }
+
+ if (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase == uintptr(0) {
+ // This happens when parsing a token or quoted phrase that contains
+ // no token characters at all. (e.g ... MATCH '""').
+ (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase = sqlite3Fts5MallocZero(tls, (pParse + 16 /* &.rc */), int64(unsafe.Sizeof(Fts5ExprPhrase{})))
+ } else if (*Fts5ExprPhrase)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase)).FnTerm != 0 {
+ (*Fts5ExprTerm)(unsafe.Pointer(((*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase + 32 /* &.aTerm */) + uintptr(((*Fts5ExprPhrase)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase)).FnTerm-1))*32)).FbPrefix = U8(bPrefix)
+ }
+ *(*uintptr)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr(((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-1))*8)) = (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase
+ }
+
+ return (*TokenCtx)(unsafe.Pointer(bp /* &sCtx */)).FpPhrase
+}
+
+// Create a new FTS5 expression by cloning phrase iPhrase of the
+// expression passed as the second argument.
+func sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppNew uintptr) int32 { /* sqlite3.c:214630:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0 // Return code
+ var pOrig uintptr // The phrase extracted from pExpr
+ var pNew uintptr = uintptr(0) // Expression to return via *ppNew
+ *(*TokenCtx)(unsafe.Pointer(bp + 8 /* sCtx */)) = TokenCtx{FpPhrase: uintptr(0), Frc: 0} // Context object for fts5ParseTokenize
+
+ pOrig = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8))
+ pNew = sqlite3Fts5MallocZero(tls, bp /* &rc */, int64(unsafe.Sizeof(Fts5Expr{})))
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ (*Fts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = sqlite3Fts5MallocZero(tls, bp, /* &rc */
+ int64(unsafe.Sizeof(uintptr(0))))
+ }
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ (*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot = sqlite3Fts5MallocZero(tls, bp, /* &rc */
+ int64(unsafe.Sizeof(Fts5ExprNode{})))
+ }
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = sqlite3Fts5MallocZero(tls, bp, /* &rc */
+ (int64(uint64(unsafe.Sizeof(Fts5ExprNearset{})) + uint64(unsafe.Sizeof(uintptr(0))))))
+ }
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ var pColsetOrig uintptr = (*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer((*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset
+ if pColsetOrig != 0 {
+ var nByte Sqlite3_int64
+ var pColset uintptr
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Colset{})) + ((uint64((*Fts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol - 1)) * uint64(unsafe.Sizeof(int32(0))))))
+ pColset = sqlite3Fts5MallocZero(tls, bp /* &rc */, nByte)
+ if pColset != 0 {
+ libc.Xmemcpy(tls, pColset, pColsetOrig, Size_t(nByte))
+ }
+ (*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear)).FpColset = pColset
+ }
+ }
+
+ if (*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm != 0 {
+ var i int32 // Used to iterate through phrase terms
+ for i = 0; (*(*int32)(unsafe.Pointer(bp /* rc */)) == 0) && (i < (*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm); i++ {
+ var tflags int32 = 0
+ var p uintptr
+ for p = ((pOrig + 32 /* &.aTerm */) + uintptr(i)*32); (p != 0) && (*(*int32)(unsafe.Pointer(bp /* rc */)) == 0); p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
+ var zTerm uintptr = (*Fts5ExprTerm)(unsafe.Pointer(p)).FzTerm
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = fts5ParseTokenize(tls, bp+8 /* &sCtx */, tflags, zTerm, int32(libc.Xstrlen(tls, zTerm)),
+ 0, 0)
+ tflags = 0x0001
+ }
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ (*Fts5ExprTerm)(unsafe.Pointer(((*TokenCtx)(unsafe.Pointer(bp+8 /* &sCtx */)).FpPhrase + 32 /* &.aTerm */) + uintptr(i)*32)).FbPrefix = (*Fts5ExprTerm)(unsafe.Pointer((pOrig + 32 /* &.aTerm */) + uintptr(i)*32)).FbPrefix
+ (*Fts5ExprTerm)(unsafe.Pointer(((*TokenCtx)(unsafe.Pointer(bp+8 /* &sCtx */)).FpPhrase + 32 /* &.aTerm */) + uintptr(i)*32)).FbFirst = (*Fts5ExprTerm)(unsafe.Pointer((pOrig + 32 /* &.aTerm */) + uintptr(i)*32)).FbFirst
+ }
+ }
+ } else {
+ // This happens when parsing a token or quoted phrase that contains
+ // no token characters at all. (e.g ... MATCH '""').
+ (*TokenCtx)(unsafe.Pointer(bp + 8 /* &sCtx */)).FpPhrase = sqlite3Fts5MallocZero(tls, bp /* &rc */, int64(unsafe.Sizeof(Fts5ExprPhrase{})))
+ }
+
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ // All the allocations succeeded. Put the expression object together.
+ (*Fts5Expr)(unsafe.Pointer(pNew)).FpIndex = (*Fts5Expr)(unsafe.Pointer(pExpr)).FpIndex
+ (*Fts5Expr)(unsafe.Pointer(pNew)).FpConfig = (*Fts5Expr)(unsafe.Pointer(pExpr)).FpConfig
+ (*Fts5Expr)(unsafe.Pointer(pNew)).FnPhrase = 1
+ *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase + uintptr(0)*8)) = (*TokenCtx)(unsafe.Pointer(bp + 8 /* &sCtx */)).FpPhrase
+ *(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear + 24 /* &.apPhrase */) + uintptr(0)*8)) = (*TokenCtx)(unsafe.Pointer(bp + 8 /* &sCtx */)).FpPhrase
+ (*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear)).FnPhrase = 1
+ (*Fts5ExprPhrase)(unsafe.Pointer((*TokenCtx)(unsafe.Pointer(bp + 8 /* &sCtx */)).FpPhrase)).FpNode = (*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot
+
+ if (((*Fts5ExprPhrase)(unsafe.Pointer(pOrig)).FnTerm == 1) &&
+ ((*Fts5ExprTerm)(unsafe.Pointer((pOrig+32 /* &.aTerm */)+uintptr(0)*32)).FpSynonym == uintptr(0))) &&
+ (int32((*Fts5ExprTerm)(unsafe.Pointer((pOrig+32 /* &.aTerm */)+uintptr(0)*32)).FbFirst) == 0) {
+ (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FeType = 4
+ (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
+ }{fts5ExprNodeNext_TERM}))
+ } else {
+ (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FeType = 9
+ (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
+ }{fts5ExprNodeNext_STRING}))
+ }
+ } else {
+ sqlite3Fts5ExprFree(tls, pNew)
+ fts5ExprPhraseFree(tls, (*TokenCtx)(unsafe.Pointer(bp+8 /* &sCtx */)).FpPhrase)
+ pNew = uintptr(0)
+ }
+
+ *(*uintptr)(unsafe.Pointer(ppNew)) = pNew
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+}
+
+// Token pTok has appeared in a MATCH expression where the NEAR operator
+// is expected. If token pTok does not contain "NEAR", store an error
+// in the pParse object.
+func sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { /* sqlite3.c:214726:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ if ((*Fts5Token)(unsafe.Pointer(pTok)).Fn != 4) || (libc.Xmemcmp(tls, ts+37238 /* "NEAR" */, (*Fts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0) {
+ sqlite3Fts5ParseError(tls,
+ pParse, ts+36267 /* "fts5: syntax err..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(pTok)).Fn, (*Fts5Token)(unsafe.Pointer(pTok)).Fp))
+ }
+}
+
+func sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, p uintptr) { /* sqlite3.c:214734:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ if pNear != 0 {
+ var nNear int32 = 0
+ var i int32
+ if (*Fts5Token)(unsafe.Pointer(p)).Fn != 0 {
+ for i = 0; i < (*Fts5Token)(unsafe.Pointer(p)).Fn; i++ {
+ var c int8 = *(*int8)(unsafe.Pointer((*Fts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))
+ if (int32(c) < '0') || (int32(c) > '9') {
+ sqlite3Fts5ParseError(tls,
+ pParse, ts+37243 /* "expected integer..." */, libc.VaList(bp, (*Fts5Token)(unsafe.Pointer(p)).Fn, (*Fts5Token)(unsafe.Pointer(p)).Fp))
+ return
+ }
+ nNear = ((nNear * 10) + (int32(*(*int8)(unsafe.Pointer((*Fts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - '0'))
+ }
+ } else {
+ nNear = 10
+ }
+ (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear = nNear
+ }
+}
+
+// The second argument passed to this function may be NULL, or it may be
+// an existing Fts5Colset object. This function returns a pointer to
+// a new colset object containing the contents of (p) with new value column
+// number iCol appended.
+//
+// If an OOM error occurs, store an error code in pParse and return NULL.
+// The old colset object (if any) is not freed in this case.
+func fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) uintptr { /* sqlite3.c:214769:19: */
+ var nCol int32
+ if p != 0 {
+ nCol = (*Fts5Colset)(unsafe.Pointer(p)).FnCol
+ } else {
+ nCol = 0
+ } // Num. columns already in colset object
+ var pNew uintptr // New colset object to return
+
+ pNew = Xsqlite3_realloc64(tls, p, (uint64(uint64(unsafe.Sizeof(Fts5Colset{})) + (uint64(unsafe.Sizeof(int32(0))) * uint64(nCol)))))
+ if pNew == uintptr(0) {
+ (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = 7
+ } else {
+ var aiCol uintptr = pNew + 4 /* &.aiCol */
+ var i int32
+ var j int32
+ for i = 0; i < nCol; i++ {
+ if *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) == iCol {
+ return pNew
+ }
+ if *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) > iCol {
+ break
+ }
+ }
+ for j = nCol; j > i; j-- {
+ *(*int32)(unsafe.Pointer(aiCol + uintptr(j)*4)) = *(*int32)(unsafe.Pointer(aiCol + uintptr((j-1))*4))
+ }
+ *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4)) = iCol
+ (*Fts5Colset)(unsafe.Pointer(pNew)).FnCol = (nCol + 1)
+ }
+
+ return pNew
+}
+
+// Allocate and return an Fts5Colset object specifying the inverse of
+// the colset passed as the second argument. Free the colset passed
+// as the second argument before returning.
+func sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) uintptr { /* sqlite3.c:214810:19: */
+ var pRet uintptr
+ var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol
+
+ pRet = sqlite3Fts5MallocZero(tls, (pParse + 16 /* &.rc */),
+ (int64(uint64(unsafe.Sizeof(Fts5Colset{})) + (uint64(unsafe.Sizeof(int32(0))) * uint64(nCol)))))
+ if pRet != 0 {
+ var i int32
+ var iOld int32 = 0
+ for i = 0; i < nCol; i++ {
+ if (iOld >= (*Fts5Colset)(unsafe.Pointer(p)).FnCol) || (*(*int32)(unsafe.Pointer((p + 4 /* &.aiCol */) + uintptr(iOld)*4)) != i) {
+ *(*int32)(unsafe.Pointer((pRet + 4 /* &.aiCol */) + uintptr(libc.PostIncInt32(&(*Fts5Colset)(unsafe.Pointer(pRet)).FnCol, 1))*4)) = i
+ } else {
+ iOld++
+ }
+ }
+ }
+
+ Xsqlite3_free(tls, p)
+ return pRet
+}
+
+func sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p uintptr) uintptr { /* sqlite3.c:214833:19: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pRet uintptr = uintptr(0)
+ var iCol int32
+ var z uintptr // Dequoted copy of token p
+
+ z = sqlite3Fts5Strndup(tls, (pParse + 16 /* &.rc */), (*Fts5Token)(unsafe.Pointer(p)).Fp, (*Fts5Token)(unsafe.Pointer(p)).Fn)
+ if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == 0 {
+ var pConfig uintptr = (*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig
+ sqlite3Fts5Dequote(tls, z)
+ for iCol = 0; iCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; iCol++ {
+ if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(iCol)*8)), z) {
+ break
+ }
+ }
+ if iCol == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol {
+ sqlite3Fts5ParseError(tls, pParse, ts+21990 /* "no such column: ..." */, libc.VaList(bp, z))
+ } else {
+ pRet = fts5ParseColset(tls, pParse, pColset, iCol)
+ }
+ Xsqlite3_free(tls, z)
+ }
+
+ if pRet == uintptr(0) {
+
+ Xsqlite3_free(tls, pColset)
+ }
+
+ return pRet
+}
+
+// If argument pOrig is NULL, or if (*pRc) is set to anything other than
+// SQLITE_OK when this function is called, NULL is returned.
+//
+// Otherwise, a copy of (*pOrig) is made into memory obtained from
+// sqlite3Fts5MallocZero() and a pointer to it returned. If the allocation
+// fails, (*pRc) is set to SQLITE_NOMEM and NULL is returned.
+func fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) uintptr { /* sqlite3.c:214873:19: */
+ var pRet uintptr
+ if pOrig != 0 {
+ var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Colset{})) + ((uint64((*Fts5Colset)(unsafe.Pointer(pOrig)).FnCol - 1)) * uint64(unsafe.Sizeof(int32(0))))))
+ pRet = sqlite3Fts5MallocZero(tls, pRc, nByte)
+ if pRet != 0 {
+ libc.Xmemcpy(tls, pRet, pOrig, Size_t(nByte))
+ }
+ } else {
+ pRet = uintptr(0)
+ }
+ return pRet
+}
+
+// Remove from colset pColset any columns that are not also in colset pMerge.
+func fts5MergeColset(tls *libc.TLS, pColset uintptr, pMerge uintptr) { /* sqlite3.c:214890:13: */
+ var iIn int32 = 0 // Next input in pColset
+ var iMerge int32 = 0 // Next input in pMerge
+ var iOut int32 = 0 // Next output slot in pColset
+
+ for (iIn < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol) && (iMerge < (*Fts5Colset)(unsafe.Pointer(pMerge)).FnCol) {
+ var iDiff int32 = (*(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(iIn)*4)) - *(*int32)(unsafe.Pointer((pMerge + 4 /* &.aiCol */) + uintptr(iMerge)*4)))
+ if iDiff == 0 {
+ *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(libc.PostIncInt32(&iOut, 1))*4)) = *(*int32)(unsafe.Pointer((pMerge + 4 /* &.aiCol */) + uintptr(iMerge)*4))
+ iMerge++
+ iIn++
+ } else if iDiff > 0 {
+ iMerge++
+ } else {
+ iIn++
+ }
+ }
+ (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol = iOut
+}
+
+// Recursively apply colset pColset to expression node pNode and all of
+// its decendents. If (*ppFree) is not NULL, it contains a spare copy
+// of pColset. This function may use the spare copy and set (*ppFree) to
+// zero, or it may create copies of pColset using fts5CloneColset().
+func fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pNode uintptr, pColset uintptr, ppFree uintptr) { /* sqlite3.c:214916:13: */
+ if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == 0 {
+
+ if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == 9) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == 4) {
+ var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
+ if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset != 0 {
+ fts5MergeColset(tls, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset, pColset)
+ if (*Fts5Colset)(unsafe.Pointer((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset)).FnCol == 0 {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType = 0
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = uintptr(0)
+ }
+ } else if *(*uintptr)(unsafe.Pointer(ppFree)) != 0 {
+ (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset = pColset
+ *(*uintptr)(unsafe.Pointer(ppFree)) = uintptr(0)
+ } else {
+ (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset = fts5CloneColset(tls, (pParse + 16 /* &.rc */), pColset)
+ }
+ } else {
+ var i int32
+
+ for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
+ fts5ParseSetColset(tls, pParse, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(i)*8)), pColset, ppFree)
+ }
+ }
+ }
+}
+
+// Apply colset pColset to expression node pExpr and all of its descendents.
+func sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pColset uintptr) { /* sqlite3.c:214954:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ *(*uintptr)(unsafe.Pointer(bp /* pFree */)) = pColset
+ if (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == 1 {
+ (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = 1
+ (*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_mprintf(tls,
+ ts+37272 /* "fts5: column que..." */, 0)
+ } else {
+ fts5ParseSetColset(tls, pParse, pExpr, pColset, bp /* &pFree */)
+ }
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp /* pFree */)))
+}
+
+func fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:214971:13: */
+ switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType {
+ case 9:
+ {
+ var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear
+ if ((((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == 1) && ((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(0)*8)))).FnTerm == 1)) &&
+ ((*Fts5ExprTerm)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(0)*8))+32 /* &.aTerm */)+uintptr(0)*32)).FpSynonym == uintptr(0))) &&
+ (int32((*Fts5ExprTerm)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(0)*8))+32 /* &.aTerm */)+uintptr(0)*32)).FbFirst) == 0) {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType = 4
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
+ }{fts5ExprNodeNext_TERM}))
+ } else {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
+ }{fts5ExprNodeNext_STRING}))
+ }
+ break
+ }
+
+ case 1:
+ {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
+ }{fts5ExprNodeNext_OR}))
+ break
+ }
+
+ case 2:
+ {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
+ }{fts5ExprNodeNext_AND}))
+ break
+ }
+
+ default:
+ {
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, I64) int32
+ }{fts5ExprNodeNext_NOT}))
+ break
+ }
+ }
+}
+
+func fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { /* sqlite3.c:215004:13: */
+ if ((*Fts5ExprNode)(unsafe.Pointer(p)).FeType != 3) && ((*Fts5ExprNode)(unsafe.Pointer(pSub)).FeType == (*Fts5ExprNode)(unsafe.Pointer(p)).FeType) {
+ var nByte int32 = (int32(uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Fts5ExprNode)(unsafe.Pointer(pSub)).FnChild)))
+ libc.Xmemcpy(tls, ((p + 48 /* &.apChild */) + uintptr((*Fts5ExprNode)(unsafe.Pointer(p)).FnChild)*8), pSub+48 /* &.apChild */, uint64(nByte))
+ *(*int32)(unsafe.Pointer(p + 40 /* &.nChild */)) += ((*Fts5ExprNode)(unsafe.Pointer(pSub)).FnChild)
+ Xsqlite3_free(tls, pSub)
+ } else {
+ *(*uintptr)(unsafe.Pointer((p + 48 /* &.apChild */) + uintptr(libc.PostIncInt32(&(*Fts5ExprNode)(unsafe.Pointer(p)).FnChild, 1))*8)) = pSub
+ }
+}
+
+// Allocate and return a new expression object. If anything goes wrong (i.e.
+// OOM error), leave an error code in pParse and return NULL.
+func sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uintptr, pRight uintptr, pNear uintptr) uintptr { /* sqlite3.c:215019:21: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pRet uintptr = uintptr(0)
+
+ if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc == 0 {
+ var nChild int32 = 0 // Number of children of returned node
+ var nByte Sqlite3_int64 // Bytes of space to allocate for this node
+
+ if (eType == 9) && (pNear == uintptr(0)) {
+ return uintptr(0)
+ }
+ if (eType != 9) && (pLeft == uintptr(0)) {
+ return pRight
+ }
+ if (eType != 9) && (pRight == uintptr(0)) {
+ return pLeft
+ }
+
+ if eType == 3 {
+ nChild = 2
+ } else if (eType == 2) || (eType == 1) {
+ nChild = 2
+ if (*Fts5ExprNode)(unsafe.Pointer(pLeft)).FeType == eType {
+ nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild - 1)
+ }
+ if (*Fts5ExprNode)(unsafe.Pointer(pRight)).FeType == eType {
+ nChild = nChild + ((*Fts5ExprNode)(unsafe.Pointer(pRight)).FnChild - 1)
+ }
+ }
+
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5ExprNode{})) + (uint64(unsafe.Sizeof(uintptr(0))) * (uint64(nChild - 1)))))
+ pRet = sqlite3Fts5MallocZero(tls, (pParse + 16 /* &.rc */), nByte)
+
+ if pRet != 0 {
+ (*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType
+ (*Fts5ExprNode)(unsafe.Pointer(pRet)).FpNear = pNear
+ fts5ExprAssignXNext(tls, pRet)
+ if eType == 9 {
+ var iPhrase int32
+ for iPhrase = 0; iPhrase < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; iPhrase++ {
+ (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(iPhrase)*8)))).FpNode = pRet
+ if (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(iPhrase)*8)))).FnTerm == 0 {
+ (*Fts5ExprNode)(unsafe.Pointer(pRet)).FxNext = uintptr(0)
+ (*Fts5ExprNode)(unsafe.Pointer(pRet)).FeType = 0
+ }
+ }
+
+ if (*Fts5Config)(unsafe.Pointer((*Fts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail != 0 {
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(0)*8))
+ if (((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != 1) ||
+ ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 1)) ||
+ (((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0) && ((*Fts5ExprTerm)(unsafe.Pointer((pPhrase+32 /* &.aTerm */)+uintptr(0)*32)).FbFirst != 0)) {
+
+ (*Fts5Parse)(unsafe.Pointer(pParse)).Frc = 1
+
+ (*Fts5Parse)(unsafe.Pointer(pParse)).FzErr = Xsqlite3_mprintf(tls,
+ ts+37325, /* "fts5: %s queries..." */
+ libc.VaList(bp, func() uintptr {
+ if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == 1 {
+ return ts + 37375 /* "phrase" */
+ }
+ return ts + 37238 /* "NEAR" */
+ }()))
+ Xsqlite3_free(tls, pRet)
+ pRet = uintptr(0)
+ }
+ }
+ } else {
+ fts5ExprAddChildren(tls, pRet, pLeft)
+ fts5ExprAddChildren(tls, pRet, pRight)
+ }
+ }
+ }
+
+ if pRet == uintptr(0) {
+
+ sqlite3Fts5ParseNodeFree(tls, pLeft)
+ sqlite3Fts5ParseNodeFree(tls, pRight)
+ sqlite3Fts5ParseNearsetFree(tls, pNear)
+ }
+ return pRet
+}
+
+func sqlite3Fts5ParseImplicitAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:215097:21: */
+ var pRet uintptr = uintptr(0)
+ var pPrev uintptr
+
+ if (*Fts5Parse)(unsafe.Pointer(pParse)).Frc != 0 {
+ sqlite3Fts5ParseNodeFree(tls, pLeft)
+ sqlite3Fts5ParseNodeFree(tls, pRight)
+ } else {
+
+ if (*Fts5ExprNode)(unsafe.Pointer(pLeft)).FeType == 2 {
+ pPrev = *(*uintptr)(unsafe.Pointer((pLeft + 48 /* &.apChild */) + uintptr(((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild-1))*8))
+ } else {
+ pPrev = pLeft
+ }
+
+ if (*Fts5ExprNode)(unsafe.Pointer(pRight)).FeType == 0 {
+
+ sqlite3Fts5ParseNodeFree(tls, pRight)
+ pRet = pLeft
+ (*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase--
+ } else if (*Fts5ExprNode)(unsafe.Pointer(pPrev)).FeType == 0 {
+ var ap uintptr
+
+ if pPrev == pLeft {
+ pRet = pRight
+ } else {
+ *(*uintptr)(unsafe.Pointer((pLeft + 48 /* &.apChild */) + uintptr(((*Fts5ExprNode)(unsafe.Pointer(pLeft)).FnChild-1))*8)) = pRight
+ pRet = pLeft
+ }
+
+ ap = ((*Fts5Parse)(unsafe.Pointer(pParse)).FapPhrase + uintptr((((*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase-1)-(*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pRight)).FpNear)).FnPhrase))*8)
+
+ libc.Xmemmove(tls, ap, (ap + uintptr(1)*8), (uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pRight)).FpNear)).FnPhrase)))
+ (*Fts5Parse)(unsafe.Pointer(pParse)).FnPhrase--
+
+ sqlite3Fts5ParseNodeFree(tls, pPrev)
+ } else {
+ pRet = sqlite3Fts5ParseNode(tls, pParse, 2, pLeft, pRight, uintptr(0))
+ }
+ }
+
+ return pRet
+}
+
+func fts5ExprTermPrint(tls *libc.TLS, pTerm uintptr) uintptr { /* sqlite3.c:215161:13: */
+ var nByte Sqlite3_int64 = int64(0)
+ var p uintptr
+ var zQuoted uintptr
+
+ // Determine the maximum amount of space required.
+ for p = pTerm; p != 0; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
+ nByte = nByte + (Sqlite3_int64(((int32(libc.Xstrlen(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm)) * 2) + 3) + 2))
+ }
+ zQuoted = Xsqlite3_malloc64(tls, uint64(nByte))
+
+ if zQuoted != 0 {
+ var i int32 = 0
+ for p = pTerm; p != 0; p = (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym {
+ var zIn uintptr = (*Fts5ExprTerm)(unsafe.Pointer(p)).FzTerm
+ *(*int8)(unsafe.Pointer(zQuoted + uintptr(libc.PostIncInt32(&i, 1)))) = int8('"')
+ for *(*int8)(unsafe.Pointer(zIn)) != 0 {
+ if int32(*(*int8)(unsafe.Pointer(zIn))) == '"' {
+ *(*int8)(unsafe.Pointer(zQuoted + uintptr(libc.PostIncInt32(&i, 1)))) = int8('"')
+ }
+ *(*int8)(unsafe.Pointer(zQuoted + uintptr(libc.PostIncInt32(&i, 1)))) = *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zIn, 1)))
+ }
+ *(*int8)(unsafe.Pointer(zQuoted + uintptr(libc.PostIncInt32(&i, 1)))) = int8('"')
+ if (*Fts5ExprTerm)(unsafe.Pointer(p)).FpSynonym != 0 {
+ *(*int8)(unsafe.Pointer(zQuoted + uintptr(libc.PostIncInt32(&i, 1)))) = int8('|')
+ }
+ }
+ if (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FbPrefix != 0 {
+ *(*int8)(unsafe.Pointer(zQuoted + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ')
+ *(*int8)(unsafe.Pointer(zQuoted + uintptr(libc.PostIncInt32(&i, 1)))) = int8('*')
+ }
+ *(*int8)(unsafe.Pointer(zQuoted + uintptr(libc.PostIncInt32(&i, 1)))) = int8(0)
+ }
+ return zQuoted
+}
+
+func fts5PrintfAppend(tls *libc.TLS, zApp uintptr, zFmt uintptr, va uintptr) uintptr { /* sqlite3.c:215193:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var zNew uintptr
+ var ap Va_list
+ _ = ap
+ ap = va
+ zNew = Xsqlite3_vmprintf(tls, zFmt, ap)
+ _ = ap
+ if (zApp != 0) && (zNew != 0) {
+ var zNew2 uintptr = Xsqlite3_mprintf(tls, ts+6568 /* "%s%s" */, libc.VaList(bp, zApp, zNew))
+ Xsqlite3_free(tls, zNew)
+ zNew = zNew2
+ }
+ Xsqlite3_free(tls, zApp)
+ return zNew
+}
+
+// Compose a tcl-readable representation of expression pExpr. Return a
+// pointer to a buffer containing that representation. It is the
+// responsibility of the caller to at some point free the buffer using
+// sqlite3_free().
+func fts5ExprPrintTcl(tls *libc.TLS, pConfig uintptr, zNearsetCmd uintptr, pExpr uintptr) uintptr { /* sqlite3.c:215214:13: */
+ bp := tls.Alloc(72)
+ defer tls.Free(72)
+
+ var zRet uintptr = uintptr(0)
+ if ((*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType == 9) || ((*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType == 4) {
+ var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FpNear
+ var i int32
+ var iTerm int32
+
+ zRet = fts5PrintfAppend(tls, zRet, ts+37382 /* "%s " */, libc.VaList(bp, zNearsetCmd))
+ if zRet == uintptr(0) {
+ return uintptr(0)
+ }
+ if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset != 0 {
+ var aiCol uintptr = (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset + 4 /* &.aiCol */
+ var nCol int32 = (*Fts5Colset)(unsafe.Pointer((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset)).FnCol
+ if nCol == 1 {
+ zRet = fts5PrintfAppend(tls, zRet, ts+37386 /* "-col %d " */, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(aiCol + uintptr(0)*4))))
+ } else {
+ zRet = fts5PrintfAppend(tls, zRet, ts+37395 /* "-col {%d" */, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(aiCol + uintptr(0)*4))))
+ for i = 1; i < (*Fts5Colset)(unsafe.Pointer((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset)).FnCol; i++ {
+ zRet = fts5PrintfAppend(tls, zRet, ts+37404 /* " %d" */, libc.VaList(bp+24, *(*int32)(unsafe.Pointer(aiCol + uintptr(i)*4))))
+ }
+ zRet = fts5PrintfAppend(tls, zRet, ts+37408 /* "} " */, 0)
+ }
+ if zRet == uintptr(0) {
+ return uintptr(0)
+ }
+ }
+
+ if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > 1 {
+ zRet = fts5PrintfAppend(tls, zRet, ts+37411 /* "-near %d " */, libc.VaList(bp+32, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear))
+ if zRet == uintptr(0) {
+ return uintptr(0)
+ }
+ }
+
+ zRet = fts5PrintfAppend(tls, zRet, ts+37421 /* "--" */, 0)
+ if zRet == uintptr(0) {
+ return uintptr(0)
+ }
+
+ for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(i)*8))
+
+ zRet = fts5PrintfAppend(tls, zRet, ts+37424 /* " {" */, 0)
+ for iTerm = 0; (zRet != 0) && (iTerm < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm); iTerm++ {
+ var zTerm uintptr = (*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */) + uintptr(iTerm)*32)).FzTerm
+ zRet = fts5PrintfAppend(tls, zRet, ts+6568 /* "%s%s" */, libc.VaList(bp+40, func() uintptr {
+ if iTerm == 0 {
+ return ts + 781 /* "" */
+ }
+ return ts + 15984 /* " " */
+ }(), zTerm))
+ if (*Fts5ExprTerm)(unsafe.Pointer((pPhrase+32 /* &.aTerm */)+uintptr(iTerm)*32)).FbPrefix != 0 {
+ zRet = fts5PrintfAppend(tls, zRet, ts+20672 /* "*" */, 0)
+ }
+ }
+
+ if zRet != 0 {
+ zRet = fts5PrintfAppend(tls, zRet, ts+29950 /* "}" */, 0)
+ }
+ if zRet == uintptr(0) {
+ return uintptr(0)
+ }
+ }
+ } else {
+ var zOp uintptr = uintptr(0)
+ var i int32
+ switch (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType {
+ case 2:
+ zOp = ts + 33311 /* "AND" */
+ break
+ fallthrough
+ case 3:
+ zOp = ts + 37234 /* "NOT" */
+ break
+ fallthrough
+ default:
+
+ zOp = ts + 37231 /* "OR" */
+ break
+ }
+
+ zRet = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+56, zOp))
+ for i = 0; (zRet != 0) && (i < (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FnChild); i++ {
+ var z uintptr = fts5ExprPrintTcl(tls, pConfig, zNearsetCmd, *(*uintptr)(unsafe.Pointer((pExpr + 48 /* &.apChild */) + uintptr(i)*8)))
+ if !(z != 0) {
+ Xsqlite3_free(tls, zRet)
+ zRet = uintptr(0)
+ } else {
+ zRet = fts5PrintfAppend(tls, zRet, ts+37427 /* " [%z]" */, libc.VaList(bp+64, z))
+ }
+ }
+ }
+
+ return zRet
+}
+
+func fts5ExprPrint(tls *libc.TLS, pConfig uintptr, pExpr uintptr) uintptr { /* sqlite3.c:215293:13: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ var zRet uintptr = uintptr(0)
+ if (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType == 0 {
+ return Xsqlite3_mprintf(tls, ts+37433 /* "\"\"" */, 0)
+ } else if ((*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType == 9) || ((*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType == 4) {
+ var pNear uintptr = (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FpNear
+ var i int32
+ var iTerm int32
+
+ if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset != 0 {
+ var iCol int32 = *(*int32)(unsafe.Pointer(((*Fts5ExprNearset)(unsafe.Pointer(pNear)).FpColset + 4 /* &.aiCol */) + uintptr(0)*4))
+ zRet = fts5PrintfAppend(tls, zRet, ts+37436 /* "%s : " */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(iCol)*8))))
+ if zRet == uintptr(0) {
+ return uintptr(0)
+ }
+ }
+
+ if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > 1 {
+ zRet = fts5PrintfAppend(tls, zRet, ts+37442 /* "NEAR(" */, 0)
+ if zRet == uintptr(0) {
+ return uintptr(0)
+ }
+ }
+
+ for i = 0; i < (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase; i++ {
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((pNear + 24 /* &.apPhrase */) + uintptr(i)*8))
+ if i != 0 {
+ zRet = fts5PrintfAppend(tls, zRet, ts+15984 /* " " */, 0)
+ if zRet == uintptr(0) {
+ return uintptr(0)
+ }
+ }
+ for iTerm = 0; iTerm < (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm; iTerm++ {
+ var zTerm uintptr = fts5ExprTermPrint(tls, ((pPhrase + 32 /* &.aTerm */) + uintptr(iTerm)*32))
+ if zTerm != 0 {
+ zRet = fts5PrintfAppend(tls, zRet, ts+6568 /* "%s%s" */, libc.VaList(bp+8, func() uintptr {
+ if iTerm == 0 {
+ return ts + 781 /* "" */
+ }
+ return ts + 37448 /* " + " */
+ }(), zTerm))
+ Xsqlite3_free(tls, zTerm)
+ }
+ if (zTerm == uintptr(0)) || (zRet == uintptr(0)) {
+ Xsqlite3_free(tls, zRet)
+ return uintptr(0)
+ }
+ }
+ }
+
+ if (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase > 1 {
+ zRet = fts5PrintfAppend(tls, zRet, ts+37452 /* ", %d)" */, libc.VaList(bp+24, (*Fts5ExprNearset)(unsafe.Pointer(pNear)).FnNear))
+ if zRet == uintptr(0) {
+ return uintptr(0)
+ }
+ }
+ } else {
+ var zOp uintptr = uintptr(0)
+ var i int32
+
+ switch (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FeType {
+ case 2:
+ zOp = ts + 23031 /* " AND " */
+ break
+ fallthrough
+ case 3:
+ zOp = ts + 37458 /* " NOT " */
+ break
+ fallthrough
+ default:
+
+ zOp = ts + 37464 /* " OR " */
+ break
+ }
+
+ for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pExpr)).FnChild; i++ {
+ var z uintptr = fts5ExprPrint(tls, pConfig, *(*uintptr)(unsafe.Pointer((pExpr + 48 /* &.apChild */) + uintptr(i)*8)))
+ if z == uintptr(0) {
+ Xsqlite3_free(tls, zRet)
+ zRet = uintptr(0)
+ } else {
+ var e int32 = (*Fts5ExprNode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((pExpr + 48 /* &.apChild */) + uintptr(i)*8)))).FeType
+ var b int32 = (libc.Bool32(((e != 9) && (e != 4)) && (e != 0)))
+ zRet = fts5PrintfAppend(tls, zRet, ts+37469, /* "%s%s%z%s" */
+ libc.VaList(bp+32, func() uintptr {
+ if i == 0 {
+ return ts + 781 /* "" */
+ }
+ return zOp
+ }(),
+ func() uintptr {
+ if b != 0 {
+ return ts + 23037 /* "(" */
+ }
+ return ts + 781 /* "" */
+ }(), z, func() uintptr {
+ if b != 0 {
+ return ts + 6652 /* ")" */
+ }
+ return ts + 781 /* "" */
+ }()))
+ }
+ if zRet == uintptr(0) {
+ break
+ }
+ }
+ }
+
+ return zRet
+}
+
+// The implementation of user-defined scalar functions fts5_expr() (bTcl==0)
+// and fts5_expr_tcl() (bTcl!=0).
+func fts5ExprFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr, bTcl int32) { /* sqlite3.c:215375:13: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ var pGlobal uintptr = Xsqlite3_user_data(tls, pCtx)
+ var db uintptr = Xsqlite3_context_db_handle(tls, pCtx)
+ var zExpr uintptr = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pExpr */)) = uintptr(0)
+ var rc int32
+ var i int32
+ var azConfig uintptr // Array of arguments for Fts5Config
+ var zNearsetCmd uintptr = ts + 37478 /* "nearset" */
+ var nConfig int32 // Size of azConfig[]
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)) = uintptr(0)
+ var iArg int32 = 1
+
+ if nArg < 1 {
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)) = Xsqlite3_mprintf(tls, ts+37486, /* "wrong number of ..." */
+ libc.VaList(bp, func() uintptr {
+ if bTcl != 0 {
+ return ts + 37527 /* "fts5_expr_tcl" */
+ }
+ return ts + 37541 /* "fts5_expr" */
+ }()))
+ Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)), -1)
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)))
+ return
+ }
+
+ if (bTcl != 0) && (nArg > 1) {
+ zNearsetCmd = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8)))
+ iArg = 2
+ }
+
+ nConfig = (3 + (nArg - iArg))
+ azConfig = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(uintptr(0))) * uint64(nConfig))))
+ if azConfig == uintptr(0) {
+ Xsqlite3_result_error_nomem(tls, pCtx)
+ return
+ }
+ *(*uintptr)(unsafe.Pointer(azConfig + uintptr(0)*8)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(azConfig + uintptr(1)*8)) = ts + 8314 /* "main" */
+ *(*uintptr)(unsafe.Pointer(azConfig + uintptr(2)*8)) = ts + 12613 /* "tbl" */
+ for i = 3; iArg < nArg; iArg++ {
+ var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(iArg)*8)))
+ *(*uintptr)(unsafe.Pointer(azConfig + uintptr(libc.PostIncInt32(&i, 1))*8)) = func() uintptr {
+ if z != 0 {
+ return z
+ }
+ return ts + 781 /* "" */
+ }()
+ }
+
+ zExpr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
+ if zExpr == uintptr(0) {
+ zExpr = ts + 781 /* "" */
+ }
+
+ rc = sqlite3Fts5ConfigParse(tls, pGlobal, db, nConfig, azConfig, bp+8 /* &pConfig */, bp+16 /* &zErr */)
+ if rc == 0 {
+ rc = sqlite3Fts5ExprNew(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)), (*Fts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)))).FnCol, zExpr, bp+24 /* &pExpr */, bp+16 /* &zErr */)
+ }
+ if rc == 0 {
+ var zText uintptr
+ if (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pExpr */)))).FpRoot)).FxNext == uintptr(0) {
+ zText = Xsqlite3_mprintf(tls, ts+781 /* "" */, 0)
+ } else if bTcl != 0 {
+ zText = fts5ExprPrintTcl(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)), zNearsetCmd, (*Fts5Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pExpr */)))).FpRoot)
+ } else {
+ zText = fts5ExprPrint(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)), (*Fts5Expr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pExpr */)))).FpRoot)
+ }
+ if zText == uintptr(0) {
+ rc = 7
+ } else {
+ Xsqlite3_result_text(tls, pCtx, zText, -1, libc.UintptrFromInt32(-1))
+ Xsqlite3_free(tls, zText)
+ }
+ }
+
+ if rc != 0 {
+ if *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)) != 0 {
+ Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)), -1)
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zErr */)))
+ } else {
+ Xsqlite3_result_error_code(tls, pCtx, rc)
+ }
+ }
+ Xsqlite3_free(tls, azConfig)
+ sqlite3Fts5ConfigFree(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)))
+ sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pExpr */)))
+}
+
+func fts5ExprFunctionHr(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:215460:13: */
+ fts5ExprFunction(tls, pCtx, nArg, apVal, 0)
+}
+func fts5ExprFunctionTcl(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:215467:13: */
+ fts5ExprFunction(tls, pCtx, nArg, apVal, 1)
+}
+
+// The implementation of an SQLite user-defined-function that accepts a
+// single integer as an argument. If the integer is an alpha-numeric
+// unicode code point, 1 is returned. Otherwise 0.
+func fts5ExprIsAlnum(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:215480:13: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ var iCode int32
+ // var aArr [32]U8 at bp, 32
+
+ if nArg != 1 {
+ Xsqlite3_result_error(tls, pCtx,
+ ts+37551 /* "wrong number of ..." */, -1)
+ return
+ }
+ libc.Xmemset(tls, bp /* &aArr[0] */, 0, uint64(unsafe.Sizeof([32]U8{})))
+ sqlite3Fts5UnicodeCatParse(tls, ts+37602 /* "L*" */, bp /* &aArr[0] */)
+ sqlite3Fts5UnicodeCatParse(tls, ts+37605 /* "N*" */, bp /* &aArr[0] */)
+ sqlite3Fts5UnicodeCatParse(tls, ts+37608 /* "Co" */, bp /* &aArr[0] */)
+ iCode = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
+ Xsqlite3_result_int(tls, pCtx, int32(*(*U8)(unsafe.Pointer(bp /* &aArr[0] */ + uintptr(sqlite3Fts5UnicodeCategory(tls, U32(iCode)))))))
+}
+
+func fts5ExprFold(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:215501:13: */
+ if (nArg != 1) && (nArg != 2) {
+ Xsqlite3_result_error(tls, pCtx,
+ ts+37611 /* "wrong number of ..." */, -1)
+ } else {
+ var iCode int32
+ var bRemoveDiacritics int32 = 0
+ iCode = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
+ if nArg == 2 {
+ bRemoveDiacritics = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8)))
+ }
+ Xsqlite3_result_int(tls, pCtx, sqlite3Fts5UnicodeFold(tls, iCode, bRemoveDiacritics))
+ }
+}
+
+// This is called during initialization to register the fts5_expr() scalar
+// UDF with the SQLite handle passed as the only argument.
+func sqlite3Fts5ExprInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:215523:12: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ *(*[4]Fts5ExprFunc)(unsafe.Pointer(bp /* aFunc */)) = [4]Fts5ExprFunc{
+ {Fz: ts + 37541 /* "fts5_expr" */, Fx: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{fts5ExprFunctionHr}))},
+ {Fz: ts + 37527 /* "fts5_expr_tcl" */, Fx: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{fts5ExprFunctionTcl}))},
+ {Fz: ts + 37659 /* "fts5_isalnum" */, Fx: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{fts5ExprIsAlnum}))},
+ {Fz: ts + 37672 /* "fts5_fold" */, Fx: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{fts5ExprFold}))},
+ }
+ var i int32
+ var rc int32 = 0
+ var pCtx uintptr = pGlobal
+
+ for i = 0; (rc == 0) && (i < (int32(uint64(unsafe.Sizeof([4]Fts5ExprFunc{})) / uint64(unsafe.Sizeof(Fts5ExprFunc{}))))); i++ {
+ var p uintptr = (bp /* &aFunc */ + uintptr(i)*16)
+ rc = Xsqlite3_create_function(tls, db, (*Fts5ExprFunc)(unsafe.Pointer(p)).Fz, -1, 1, pCtx, (*Fts5ExprFunc)(unsafe.Pointer(p)).Fx, uintptr(0), uintptr(0))
+ }
+
+ // Avoid warnings indicating that sqlite3Fts5ParserTrace() and
+ // sqlite3Fts5ParserFallback() are unused
+ _ = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{sqlite3Fts5ParserFallback}))
+
+ return rc
+}
+
+type Fts5ExprFunc = struct {
+ Fz uintptr
+ Fx uintptr
+}
+
+// Return the number of phrases in expression pExpr.
+func sqlite3Fts5ExprPhraseCount(tls *libc.TLS, pExpr uintptr) int32 { /* sqlite3.c:215555:12: */
+ return func() int32 {
+ if pExpr != 0 {
+ return (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase
+ }
+ return 0
+ }()
+}
+
+// Return the number of terms in the iPhrase'th phrase in pExpr.
+func sqlite3Fts5ExprPhraseSize(tls *libc.TLS, pExpr uintptr, iPhrase int32) int32 { /* sqlite3.c:215562:12: */
+ if (iPhrase < 0) || (iPhrase >= (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase) {
+ return 0
+ }
+ return (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8)))).FnTerm
+}
+
+// This function is used to access the current position list for phrase
+// iPhrase.
+func sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uintptr) int32 { /* sqlite3.c:215571:12: */
+ var nRet int32
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8))
+ var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FpNode
+ if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0) && ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid == (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid) {
+ *(*uintptr)(unsafe.Pointer(pa)) = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fp
+ nRet = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn
+ } else {
+ *(*uintptr)(unsafe.Pointer(pa)) = uintptr(0)
+ nRet = 0
+ }
+ return nRet
+}
+
+func sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) uintptr { /* sqlite3.c:215591:29: */
+ var pRet uintptr
+ pRet = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(Fts5PoslistPopulator{})) * uint64((*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))))
+ if pRet != 0 {
+ var i int32
+ libc.Xmemset(tls, pRet, 0, (uint64(unsafe.Sizeof(Fts5PoslistPopulator{})) * uint64((*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)))
+ for i = 0; i < (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase; i++ {
+ var pBuf uintptr = (*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*8)) + 8 /* &.poslist */)
+ var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*8)))).FpNode
+
+ if (bLive != 0) && ((((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn == 0) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid != (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid)) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof != 0)) {
+ (*Fts5PoslistPopulator)(unsafe.Pointer(pRet + uintptr(i)*16)).FbMiss = 1
+ } else {
+ (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn = 0
+ }
+ }
+ }
+ return pRet
+}
+
+type Fts5ExprCtx1 = struct {
+ FpExpr uintptr
+ FaPopulator uintptr
+ FiOff I64
+}
+
+type Fts5ExprCtx = Fts5ExprCtx1 /* sqlite3.c:215618:28 */
+
+// TODO: Make this more efficient!
+func fts5ExprColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:215623:12: */
+ var i int32
+ for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ {
+ if *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) == iCol {
+ return 1
+ }
+ }
+ return 0
+}
+
+func fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:215631:12: */
+ var p uintptr = pCtx
+ var pExpr uintptr = (*Fts5ExprCtx)(unsafe.Pointer(p)).FpExpr
+ var i int32
+
+ _ = iUnused1
+ _ = iUnused2
+
+ if nToken > 32768 {
+ nToken = 32768
+ }
+ if (tflags & 0x0001) == 0 {
+ (*Fts5ExprCtx)(unsafe.Pointer(p)).FiOff++
+ }
+ for i = 0; i < (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase; i++ {
+ var pTerm uintptr
+ if (*Fts5PoslistPopulator)(unsafe.Pointer((*Fts5ExprCtx)(unsafe.Pointer(p)).FaPopulator+uintptr(i)*16)).FbOk == 0 {
+ continue
+ }
+ for pTerm = ((*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*8)) + 32 /* &.aTerm */) + uintptr(0)*32); pTerm != 0; pTerm = (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym {
+ var nTerm int32 = int32(libc.Xstrlen(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm))
+ if ((nTerm == nToken) || ((nTerm < nToken) && ((*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FbPrefix != 0))) &&
+ (libc.Xmemcmp(tls, (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FzTerm, pToken, uint64(nTerm)) == 0) {
+ var rc int32 = sqlite3Fts5PoslistWriterAppend(tls,
+ (*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*8)) + 8 /* &.poslist */), ((*Fts5ExprCtx)(unsafe.Pointer(p)).FaPopulator + uintptr(i)*16 /* &.writer */), (*Fts5ExprCtx)(unsafe.Pointer(p)).FiOff)
+ if rc != 0 {
+ return rc
+ }
+ break
+ }
+ }
+ }
+ return 0
+}
+
+func sqlite3Fts5ExprPopulatePoslists(tls *libc.TLS, pConfig uintptr, pExpr uintptr, aPopulator uintptr, iCol int32, z uintptr, n int32) int32 { /* sqlite3.c:215666:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var i int32
+ // var sCtx Fts5ExprCtx at bp, 24
+
+ (*Fts5ExprCtx)(unsafe.Pointer(bp /* &sCtx */)).FpExpr = pExpr
+ (*Fts5ExprCtx)(unsafe.Pointer(bp /* &sCtx */)).FaPopulator = aPopulator
+ (*Fts5ExprCtx)(unsafe.Pointer(bp /* &sCtx */)).FiOff = (((I64(iCol)) << 32) - int64(1))
+
+ for i = 0; i < (*Fts5Expr)(unsafe.Pointer(pExpr)).FnPhrase; i++ {
+ var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*8)))).FpNode
+ var pColset uintptr = (*Fts5ExprNearset)(unsafe.Pointer((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear)).FpColset
+ if ((pColset != 0) && (0 == fts5ExprColsetTest(tls, pColset, iCol))) ||
+ ((*Fts5PoslistPopulator)(unsafe.Pointer(aPopulator+uintptr(i)*16)).FbMiss != 0) {
+ (*Fts5PoslistPopulator)(unsafe.Pointer(aPopulator + uintptr(i)*16)).FbOk = 0
+ } else {
+ (*Fts5PoslistPopulator)(unsafe.Pointer(aPopulator + uintptr(i)*16)).FbOk = 1
+ }
+ }
+
+ return sqlite3Fts5Tokenize(tls, pConfig,
+ 0x0004, z, n, bp /* &sCtx */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{fts5ExprPopulatePoslistsCb})))
+}
+
+func fts5ExprClearPoslists(tls *libc.TLS, pNode uintptr) { /* sqlite3.c:215696:13: */
+ if ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == 4) || ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType == 9) {
+ (*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24 /* &.apPhrase */) + uintptr(0)*8)))).Fposlist.Fn = 0
+ } else {
+ var i int32
+ for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
+ fts5ExprClearPoslists(tls, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(i)*8)))
+ }
+ }
+}
+
+func fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid I64) int32 { /* sqlite3.c:215707:12: */
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = iRowid
+ (*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0
+ switch (*Fts5ExprNode)(unsafe.Pointer(pNode)).FeType {
+ case 4:
+ fallthrough
+ case 9:
+ return (libc.Bool32((*Fts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(((*Fts5ExprNode)(unsafe.Pointer(pNode)).FpNear + 24 /* &.apPhrase */) + uintptr(0)*8)))).Fposlist.Fn > 0))
+
+ case 2:
+ {
+ var i int32
+ for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
+ if fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(i)*8)), iRowid) == 0 {
+ fts5ExprClearPoslists(tls, pNode)
+ return 0
+ }
+ }
+ break
+ }
+
+ case 1:
+ {
+ var i int32
+ var bRet int32 = 0
+ for i = 0; i < (*Fts5ExprNode)(unsafe.Pointer(pNode)).FnChild; i++ {
+ if fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(i)*8)), iRowid) != 0 {
+ bRet = 1
+ }
+ }
+ return bRet
+ }
+
+ default:
+ {
+
+ if (0 == fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(0)*8)), iRowid)) ||
+ (0 != fts5ExprCheckPoslists(tls, *(*uintptr)(unsafe.Pointer((pNode + 48 /* &.apChild */) + uintptr(1)*8)), iRowid)) {
+ fts5ExprClearPoslists(tls, pNode)
+ return 0
+ }
+ break
+ }
+ }
+ return 1
+}
+
+func sqlite3Fts5ExprCheckPoslists(tls *libc.TLS, pExpr uintptr, iRowid I64) { /* sqlite3.c:215751:13: */
+ fts5ExprCheckPoslists(tls, (*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot, iRowid)
+}
+
+// This function is only called for detail=columns tables.
+func sqlite3Fts5ExprPhraseCollist(tls *libc.TLS, pExpr uintptr, iPhrase int32, ppCollist uintptr, pnCollist uintptr) int32 { /* sqlite3.c:215758:12: */
+ var pPhrase uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8))
+ var pNode uintptr = (*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).FpNode
+ var rc int32 = 0
+
+ if (((*Fts5ExprNode)(unsafe.Pointer(pNode)).FbEof == 0) &&
+ ((*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid == (*Fts5ExprNode)(unsafe.Pointer((*Fts5Expr)(unsafe.Pointer(pExpr)).FpRoot)).FiRowid)) &&
+ ((*Fts5ExprPhrase)(unsafe.Pointer(pPhrase)).Fposlist.Fn > 0) {
+ var pTerm uintptr = ((pPhrase + 32 /* &.aTerm */) + uintptr(0)*32)
+ if (*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym != 0 {
+ var pBuf uintptr = ((*Fts5ExprTerm)(unsafe.Pointer(pTerm)).FpSynonym + uintptr(1)*32)
+ rc = fts5ExprSynonymList(tls,
+ pTerm, (*Fts5ExprNode)(unsafe.Pointer(pNode)).FiRowid, pBuf, ppCollist, pnCollist)
+ } else {
+ *(*uintptr)(unsafe.Pointer(ppCollist)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */) + uintptr(0)*32)).FpIter)).FpData
+ *(*int32)(unsafe.Pointer(pnCollist)) = (*Fts5IndexIter)(unsafe.Pointer((*Fts5ExprTerm)(unsafe.Pointer((pPhrase + 32 /* &.aTerm */) + uintptr(0)*32)).FpIter)).FnData
+ }
+ } else {
+ *(*uintptr)(unsafe.Pointer(ppCollist)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(pnCollist)) = 0
+ }
+
+ return rc
+}
+
+// 2014 August 11
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+
+// #include "fts5Int.h"
+
+type Fts5HashEntry1 = struct {
+ FpHashNext uintptr
+ FpScanNext uintptr
+ FnAlloc int32
+ FiSzPoslist int32
+ FnData int32
+ FnKey int32
+ FbDel U8
+ FbContent U8
+ FiCol I16
+ FiPos int32
+ FiRowid I64
+}
+
+// 2014 August 11
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+
+// #include "fts5Int.h"
+
+type Fts5HashEntry = Fts5HashEntry1 /* sqlite3.c:215811:30 */
+
+// Eqivalent to:
+//
+// char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; }
+
+// Allocate a new hash table.
+func sqlite3Fts5HashNew(tls *libc.TLS, pConfig uintptr, ppNew uintptr, pnByte uintptr) int32 { /* sqlite3.c:215877:12: */
+ var rc int32 = 0
+ var pNew uintptr
+
+ *(*uintptr)(unsafe.Pointer(ppNew)) = libc.AssignUintptr(&pNew, Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Fts5Hash{}))))
+ if pNew == uintptr(0) {
+ rc = 7
+ } else {
+ var nByte Sqlite3_int64
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Fts5Hash{})))
+ (*Fts5Hash)(unsafe.Pointer(pNew)).FpnByte = pnByte
+ (*Fts5Hash)(unsafe.Pointer(pNew)).FeDetail = (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail
+
+ (*Fts5Hash)(unsafe.Pointer(pNew)).FnSlot = 1024
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Fts5Hash)(unsafe.Pointer(pNew)).FnSlot)))
+ (*Fts5Hash)(unsafe.Pointer(pNew)).FaSlot = Xsqlite3_malloc64(tls, uint64(nByte))
+ if (*Fts5Hash)(unsafe.Pointer(pNew)).FaSlot == uintptr(0) {
+ Xsqlite3_free(tls, pNew)
+ *(*uintptr)(unsafe.Pointer(ppNew)) = uintptr(0)
+ rc = 7
+ } else {
+ libc.Xmemset(tls, (*Fts5Hash)(unsafe.Pointer(pNew)).FaSlot, 0, Size_t(nByte))
+ }
+ }
+ return rc
+}
+
+// Free a hash table object.
+func sqlite3Fts5HashFree(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:215907:13: */
+ if pHash != 0 {
+ sqlite3Fts5HashClear(tls, pHash)
+ Xsqlite3_free(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot)
+ Xsqlite3_free(tls, pHash)
+ }
+}
+
+// Empty (but do not delete) a hash table.
+func sqlite3Fts5HashClear(tls *libc.TLS, pHash uintptr) { /* sqlite3.c:215918:13: */
+ var i int32
+ for i = 0; i < (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot; i++ {
+ var pNext uintptr
+ var pSlot uintptr
+ for pSlot = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(i)*8)); pSlot != 0; pSlot = pNext {
+ pNext = (*Fts5HashEntry)(unsafe.Pointer(pSlot)).FpHashNext
+ Xsqlite3_free(tls, pSlot)
+ }
+ }
+ libc.Xmemset(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot, 0, (uint64((*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot) * uint64(unsafe.Sizeof(uintptr(0)))))
+ (*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry = 0
+}
+
+func fts5HashKey(tls *libc.TLS, nSlot int32, p uintptr, n int32) uint32 { /* sqlite3.c:215932:21: */
+ var i int32
+ var h uint32 = uint32(13)
+ for i = (n - 1); i >= 0; i-- {
+ h = (((h << 3) ^ h) ^ uint32(*(*U8)(unsafe.Pointer(p + uintptr(i)))))
+ }
+ return (h % uint32(nSlot))
+}
+
+func fts5HashKey2(tls *libc.TLS, nSlot int32, b U8, p uintptr, n int32) uint32 { /* sqlite3.c:215941:21: */
+ var i int32
+ var h uint32 = uint32(13)
+ for i = (n - 1); i >= 0; i-- {
+ h = (((h << 3) ^ h) ^ uint32(*(*U8)(unsafe.Pointer(p + uintptr(i)))))
+ }
+ h = (((h << 3) ^ h) ^ uint32(b))
+ return (h % uint32(nSlot))
+}
+
+// Resize the hash table by doubling the number of slots.
+func fts5HashResize(tls *libc.TLS, pHash uintptr) int32 { /* sqlite3.c:215954:12: */
+ var nNew int32 = ((*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot * 2)
+ var i int32
+ var apNew uintptr
+ var apOld uintptr = (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot
+
+ apNew = Xsqlite3_malloc64(tls, (uint64(uint64(nNew) * uint64(unsafe.Sizeof(uintptr(0))))))
+ if !(apNew != 0) {
+ return 7
+ }
+ libc.Xmemset(tls, apNew, 0, (uint64(nNew) * uint64(unsafe.Sizeof(uintptr(0)))))
+
+ for i = 0; i < (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot; i++ {
+ for *(*uintptr)(unsafe.Pointer(apOld + uintptr(i)*8)) != 0 {
+ var iHash uint32
+ var p uintptr = *(*uintptr)(unsafe.Pointer(apOld + uintptr(i)*8))
+ *(*uintptr)(unsafe.Pointer(apOld + uintptr(i)*8)) = (*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext
+ iHash = fts5HashKey(tls, nNew, ((p) + uintptr(1)*48),
+ int32(libc.Xstrlen(tls, ((p)+uintptr(1)*48))))
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*8))
+ *(*uintptr)(unsafe.Pointer(apNew + uintptr(iHash)*8)) = p
+ }
+ }
+
+ Xsqlite3_free(tls, apOld)
+ (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot = nNew
+ (*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot = apNew
+ return 0
+}
+
+func fts5HashAddPoslistSize(tls *libc.TLS, pHash uintptr, p uintptr, p2 uintptr) int32 { /* sqlite3.c:215982:12: */
+ var nRet int32 = 0
+ if (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist != 0 {
+ var pPtr uintptr
+ if p2 != 0 {
+ pPtr = p2
+ } else {
+ pPtr = p
+ }
+ var nData int32 = (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
+ if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == 1 {
+
+ if (*Fts5HashEntry)(unsafe.Pointer(p)).FbDel != 0 {
+ *(*U8)(unsafe.Pointer(pPtr + uintptr(libc.PostIncInt32(&nData, 1)))) = U8(0x00)
+ if (*Fts5HashEntry)(unsafe.Pointer(p)).FbContent != 0 {
+ *(*U8)(unsafe.Pointer(pPtr + uintptr(libc.PostIncInt32(&nData, 1)))) = U8(0x00)
+ }
+ }
+ } else {
+ var nSz int32 = ((nData - (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist) - 1) // Size in bytes
+ var nPos int32 = ((nSz * 2) + int32((*Fts5HashEntry)(unsafe.Pointer(p)).FbDel)) // Value of nPos field
+
+ if nPos <= 127 {
+ *(*U8)(unsafe.Pointer(pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist))) = U8(nPos)
+ } else {
+ var nByte int32 = sqlite3Fts5GetVarintLen(tls, U32(nPos))
+ libc.Xmemmove(tls, (pPtr + uintptr(((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist + nByte))), (pPtr + uintptr(((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist + 1))), uint64(nSz))
+ sqlite3Fts5PutVarint(tls, (pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist)), uint64(nPos))
+ nData = nData + (nByte - 1)
+ }
+ }
+
+ nRet = (nData - (*Fts5HashEntry)(unsafe.Pointer(p)).FnData)
+ if p2 == uintptr(0) {
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist = 0
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FbDel = U8(0)
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FbContent = U8(0)
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FnData = nData
+ }
+ }
+ return nRet
+}
+
+// Add an entry to the in-memory hash table. The key is the concatenation
+// of bByte and (pToken/nToken). The value is (iRowid/iCol/iPos).
+//
+// (bByte || pToken) -> (iRowid,iCol,iPos)
+//
+// Or, if iCol is negative, then the value is a delete marker.
+func sqlite3Fts5HashWrite(tls *libc.TLS, pHash uintptr, iRowid I64, iCol int32, iPos int32, bByte int8, pToken uintptr, nToken int32) int32 { /* sqlite3.c:216033:12: */
+ var iHash uint32
+ var p uintptr
+ var pPtr uintptr
+ var nIncr int32 = 0 // Amount to increment (*pHash->pnByte) by
+ var bNew int32 // If non-delete entry should be written
+
+ bNew = (libc.Bool32((*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == 0))
+
+ // Attempt to locate an existing hash entry
+ iHash = fts5HashKey2(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot, U8(bByte), pToken, nToken)
+ for p = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*8)); p != 0; p = (*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext {
+ var zKey uintptr = ((p) + uintptr(1)*48)
+ if ((int32(*(*int8)(unsafe.Pointer(zKey + uintptr(0)))) == int32(bByte)) &&
+ ((*Fts5HashEntry)(unsafe.Pointer(p)).FnKey == nToken)) &&
+ (libc.Xmemcmp(tls, (zKey+uintptr(1)), pToken, uint64(nToken)) == 0) {
+ break
+ }
+ }
+
+ // If an existing hash entry cannot be found, create a new one.
+ if p == uintptr(0) {
+ // Figure out how much space to allocate
+ var zKey uintptr
+ var nByte Sqlite3_int64 = (Sqlite3_int64(((uint64(unsafe.Sizeof(Fts5HashEntry{})) + (uint64(nToken + 1))) + uint64(1)) + uint64(64)))
+ if nByte < int64(128) {
+ nByte = int64(128)
+ }
+
+ // Grow the Fts5Hash.aSlot[] array if necessary.
+ if ((*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry * 2) >= (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot {
+ var rc int32 = fts5HashResize(tls, pHash)
+ if rc != 0 {
+ return rc
+ }
+ iHash = fts5HashKey2(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot, U8(bByte), pToken, nToken)
+ }
+
+ // Allocate new Fts5HashEntry and add it to the hash table.
+ p = Xsqlite3_malloc64(tls, uint64(nByte))
+ if !(p != 0) {
+ return 7
+ }
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Fts5HashEntry{})))
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FnAlloc = int32(nByte)
+ zKey = ((p) + uintptr(1)*48)
+ *(*int8)(unsafe.Pointer(zKey + uintptr(0))) = bByte
+ libc.Xmemcpy(tls, (zKey + uintptr(1)), pToken, uint64(nToken))
+
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FnKey = nToken
+ *(*int8)(unsafe.Pointer(zKey + uintptr((nToken + 1)))) = int8(0)
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FnData = (int32((uint64((nToken + 1) + 1)) + uint64(unsafe.Sizeof(Fts5HashEntry{}))))
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*8))
+ *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*8)) = p
+ (*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry++
+
+ // Add the first rowid field to the hash-entry
+ *(*int32)(unsafe.Pointer(p + 24 /* &.nData */)) += (sqlite3Fts5PutVarint(tls, ((p) + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)), uint64(iRowid)))
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid = iRowid
+
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist = (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
+ if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail != 1 {
+ *(*int32)(unsafe.Pointer(p + 24 /* &.nData */)) += (1)
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FiCol = func() int16 {
+ if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == 0 {
+ return int16(0)
+ }
+ return int16(-1)
+ }()
+ }
+
+ nIncr = nIncr + ((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)
+ } else {
+
+ // Appending to an existing hash-entry. Check that there is enough
+ // space to append the largest possible new entry. Worst case scenario
+ // is:
+ //
+ // + 9 bytes for a new rowid,
+ // + 4 byte reserved for the "poslist size" varint.
+ // + 1 byte for a "new column" byte,
+ // + 3 bytes for a new column number (16-bit max) as a varint,
+ // + 5 bytes for the new position offset (32-bit max).
+ if ((*Fts5HashEntry)(unsafe.Pointer(p)).FnAlloc - (*Fts5HashEntry)(unsafe.Pointer(p)).FnData) < ((((9 + 4) + 1) + 3) + 5) {
+ var nNew Sqlite3_int64 = (Sqlite3_int64((*Fts5HashEntry)(unsafe.Pointer(p)).FnAlloc * 2))
+ var pNew uintptr
+ var pp uintptr
+ pNew = Xsqlite3_realloc64(tls, p, uint64(nNew))
+ if pNew == uintptr(0) {
+ return 7
+ }
+ (*Fts5HashEntry)(unsafe.Pointer(pNew)).FnAlloc = int32(nNew)
+ for pp = ((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*8); *(*uintptr)(unsafe.Pointer(pp)) != p; pp = (*(*uintptr)(unsafe.Pointer(pp)) /* &.pHashNext */) {
+ }
+ *(*uintptr)(unsafe.Pointer(pp)) = pNew
+ p = pNew
+ }
+ nIncr = nIncr - ((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)
+ }
+
+ pPtr = p
+
+ // If this is a new rowid, append the 4-byte size field for the previous
+ // entry, and the new rowid for this entry.
+ if iRowid != (*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid {
+ fts5HashAddPoslistSize(tls, pHash, p, uintptr(0))
+ *(*int32)(unsafe.Pointer(p + 24 /* &.nData */)) += (sqlite3Fts5PutVarint(tls, (pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)), (uint64(iRowid - (*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid))))
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FiRowid = iRowid
+ bNew = 1
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FiSzPoslist = (*Fts5HashEntry)(unsafe.Pointer(p)).FnData
+ if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail != 1 {
+ *(*int32)(unsafe.Pointer(p + 24 /* &.nData */)) += (1)
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FiCol = func() int16 {
+ if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == 0 {
+ return int16(0)
+ }
+ return int16(-1)
+ }()
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FiPos = 0
+ }
+ }
+
+ if iCol >= 0 {
+ if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == 1 {
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FbContent = U8(1)
+ } else {
+ // Append a new column value, if necessary
+
+ if iCol != int32((*Fts5HashEntry)(unsafe.Pointer(p)).FiCol) {
+ if (*Fts5Hash)(unsafe.Pointer(pHash)).FeDetail == 0 {
+ *(*U8)(unsafe.Pointer(pPtr + uintptr(libc.PostIncInt32(&(*Fts5HashEntry)(unsafe.Pointer(p)).FnData, 1)))) = U8(0x01)
+ *(*int32)(unsafe.Pointer(p + 24 /* &.nData */)) += (sqlite3Fts5PutVarint(tls, (pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)), uint64(iCol)))
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FiCol = I16(iCol)
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FiPos = 0
+ } else {
+ bNew = 1
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FiCol = I16(libc.AssignInt32(&iPos, iCol))
+ }
+ }
+
+ // Append the new position offset, if necessary
+ if bNew != 0 {
+ *(*int32)(unsafe.Pointer(p + 24 /* &.nData */)) += (sqlite3Fts5PutVarint(tls, (pPtr + uintptr((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)), (uint64((iPos - (*Fts5HashEntry)(unsafe.Pointer(p)).FiPos) + 2))))
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FiPos = iPos
+ }
+ }
+ } else {
+ // This is a delete. Set the delete flag.
+ (*Fts5HashEntry)(unsafe.Pointer(p)).FbDel = U8(1)
+ }
+
+ nIncr = nIncr + ((*Fts5HashEntry)(unsafe.Pointer(p)).FnData)
+ *(*int32)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FpnByte)) += (nIncr)
+ return 0
+}
+
+// Arguments pLeft and pRight point to linked-lists of hash-entry objects,
+// each sorted in key order. This function merges the two lists into a
+// single list and returns a pointer to its first element.
+func fts5HashEntryMerge(tls *libc.TLS, pLeft uintptr, pRight uintptr) uintptr { /* sqlite3.c:216186:22: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var p1 uintptr = pLeft
+ var p2 uintptr = pRight
+ *(*uintptr)(unsafe.Pointer(bp /* pRet */)) = uintptr(0)
+ var ppOut uintptr = bp /* &pRet */
+
+ for (p1 != 0) || (p2 != 0) {
+ if p1 == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(ppOut)) = p2
+ p2 = uintptr(0)
+ } else if p2 == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(ppOut)) = p1
+ p1 = uintptr(0)
+ } else {
+ var i int32 = 0
+ var zKey1 uintptr = ((p1) + uintptr(1)*48)
+ var zKey2 uintptr = ((p2) + uintptr(1)*48)
+ for int32(*(*int8)(unsafe.Pointer(zKey1 + uintptr(i)))) == int32(*(*int8)(unsafe.Pointer(zKey2 + uintptr(i)))) {
+ i++
+ }
+
+ if (int32(U8(*(*int8)(unsafe.Pointer(zKey1 + uintptr(i)))))) > (int32(U8(*(*int8)(unsafe.Pointer(zKey2 + uintptr(i)))))) {
+ // p2 is smaller
+ *(*uintptr)(unsafe.Pointer(ppOut)) = p2
+ ppOut = (p2 + 8 /* &.pScanNext */)
+ p2 = (*Fts5HashEntry)(unsafe.Pointer(p2)).FpScanNext
+ } else {
+ // p1 is smaller
+ *(*uintptr)(unsafe.Pointer(ppOut)) = p1
+ ppOut = (p1 + 8 /* &.pScanNext */)
+ p1 = (*Fts5HashEntry)(unsafe.Pointer(p1)).FpScanNext
+ }
+ *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
+ }
+ }
+
+ return *(*uintptr)(unsafe.Pointer(bp /* pRet */))
+}
+
+// Extract all tokens from hash table iHash and link them into a list
+// in sorted order. The hash table is cleared before returning. It is
+// the responsibility of the caller to free the elements of the returned
+// list.
+func fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32, ppSorted uintptr) int32 { /* sqlite3.c:216232:12: */
+ var nMergeSlot int32 = 32
+ var ap uintptr
+ var pList uintptr
+ var iSlot int32
+ var i int32
+
+ *(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0)
+ ap = Xsqlite3_malloc64(tls, (uint64(uint64(unsafe.Sizeof(uintptr(0))) * uint64(nMergeSlot))))
+ if !(ap != 0) {
+ return 7
+ }
+ libc.Xmemset(tls, ap, 0, (uint64(unsafe.Sizeof(uintptr(0))) * uint64(nMergeSlot)))
+
+ for iSlot = 0; iSlot < (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot; iSlot++ {
+ var pIter uintptr
+ for pIter = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iSlot)*8)); pIter != 0; pIter = (*Fts5HashEntry)(unsafe.Pointer(pIter)).FpHashNext {
+ if (pTerm == uintptr(0)) ||
+ ((((*Fts5HashEntry)(unsafe.Pointer(pIter)).FnKey + 1) >= nTerm) && (0 == libc.Xmemcmp(tls, ((pIter)+uintptr(1)*48), pTerm, uint64(nTerm)))) {
+ var pEntry uintptr = pIter
+ (*Fts5HashEntry)(unsafe.Pointer(pEntry)).FpScanNext = uintptr(0)
+ for i = 0; *(*uintptr)(unsafe.Pointer(ap + uintptr(i)*8)) != 0; i++ {
+ pEntry = fts5HashEntryMerge(tls, pEntry, *(*uintptr)(unsafe.Pointer(ap + uintptr(i)*8)))
+ *(*uintptr)(unsafe.Pointer(ap + uintptr(i)*8)) = uintptr(0)
+ }
+ *(*uintptr)(unsafe.Pointer(ap + uintptr(i)*8)) = pEntry
+ }
+ }
+ }
+
+ pList = uintptr(0)
+ for i = 0; i < nMergeSlot; i++ {
+ pList = fts5HashEntryMerge(tls, pList, *(*uintptr)(unsafe.Pointer(ap + uintptr(i)*8)))
+ }
+
+ (*Fts5Hash)(unsafe.Pointer(pHash)).FnEntry = 0
+ Xsqlite3_free(tls, ap)
+ *(*uintptr)(unsafe.Pointer(ppSorted)) = pList
+ return 0
+}
+
+// Query the hash table for a doclist associated with term pTerm/nTerm.
+func sqlite3Fts5HashQuery(tls *libc.TLS, pHash uintptr, nPre int32, pTerm uintptr, nTerm int32, ppOut uintptr, pnDoclist uintptr) int32 { /* sqlite3.c:216279:12: */
+ var iHash uint32 = fts5HashKey(tls, (*Fts5Hash)(unsafe.Pointer(pHash)).FnSlot, pTerm, nTerm)
+ var zKey uintptr = uintptr(0)
+ var p uintptr
+
+ for p = *(*uintptr)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(pHash)).FaSlot + uintptr(iHash)*8)); p != 0; p = (*Fts5HashEntry)(unsafe.Pointer(p)).FpHashNext {
+ zKey = ((p) + uintptr(1)*48)
+
+ if (nTerm == ((*Fts5HashEntry)(unsafe.Pointer(p)).FnKey + 1)) && (libc.Xmemcmp(tls, zKey, pTerm, uint64(nTerm)) == 0) {
+ break
+ }
+ }
+
+ if p != 0 {
+ var nHashPre int32 = (int32((uint64(unsafe.Sizeof(Fts5HashEntry{})) + uint64(nTerm)) + uint64(1)))
+ var nList int32 = ((*Fts5HashEntry)(unsafe.Pointer(p)).FnData - nHashPre)
+ var pRet uintptr = libc.AssignPtrUintptr(ppOut, Xsqlite3_malloc64(tls, (uint64((nPre+nList)+10))))
+ if pRet != 0 {
+ var pFaux uintptr = (pRet + uintptr((nPre - nHashPre)))
+ libc.Xmemcpy(tls, (pRet + uintptr(nPre)), ((p) + uintptr(nHashPre)), uint64(nList))
+ nList = nList + (fts5HashAddPoslistSize(tls, pHash, p, pFaux))
+ *(*int32)(unsafe.Pointer(pnDoclist)) = nList
+ } else {
+ *(*int32)(unsafe.Pointer(pnDoclist)) = 0
+ return 7
+ }
+ } else {
+ *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(pnDoclist)) = 0
+ }
+
+ return 0
+}
+
+func sqlite3Fts5HashScanInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32) int32 { /* sqlite3.c:216317:12: */
+ return fts5HashEntrySort(tls, p, pTerm, nTerm, (p + 24 /* &.pScan */))
+}
+
+func sqlite3Fts5HashScanNext(tls *libc.TLS, p uintptr) { /* sqlite3.c:216324:13: */
+
+ (*Fts5Hash)(unsafe.Pointer(p)).FpScan = (*Fts5HashEntry)(unsafe.Pointer((*Fts5Hash)(unsafe.Pointer(p)).FpScan)).FpScanNext
+}
+
+func sqlite3Fts5HashScanEof(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:216329:12: */
+ return (libc.Bool32((*Fts5Hash)(unsafe.Pointer(p)).FpScan == uintptr(0)))
+}
+
+func sqlite3Fts5HashScanEntry(tls *libc.TLS, pHash uintptr, pzTerm uintptr, ppDoclist uintptr, pnDoclist uintptr) { /* sqlite3.c:216333:13: */
+ var p uintptr
+ if libc.AssignUintptr(&p, (*Fts5Hash)(unsafe.Pointer(pHash)).FpScan) != 0 {
+ var zKey uintptr = ((p) + uintptr(1)*48)
+ var nTerm int32 = int32(libc.Xstrlen(tls, zKey))
+ fts5HashAddPoslistSize(tls, pHash, p, uintptr(0))
+ *(*uintptr)(unsafe.Pointer(pzTerm)) = zKey
+ *(*uintptr)(unsafe.Pointer(ppDoclist)) = (zKey + uintptr((nTerm + 1)))
+ *(*int32)(unsafe.Pointer(pnDoclist)) = (int32(uint64((*Fts5HashEntry)(unsafe.Pointer(p)).FnData) - ((uint64(unsafe.Sizeof(Fts5HashEntry{})) + uint64(nTerm)) + uint64(1))))
+ } else {
+ *(*uintptr)(unsafe.Pointer(pzTerm)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(ppDoclist)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(pnDoclist)) = 0
+ }
+}
+
+// 2014 May 31
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// Low level access to the FTS index stored in the database file. The
+// routines in this file file implement all read and write access to the
+// %_data table. Other parts of the system access this functionality via
+// the interface defined in fts5Int.h.
+
+// #include "fts5Int.h"
+
+// Overview:
+//
+// The %_data table contains all the FTS indexes for an FTS5 virtual table.
+// As well as the main term index, there may be up to 31 prefix indexes.
+// The format is similar to FTS3/4, except that:
+//
+// * all segment b-tree leaf data is stored in fixed size page records
+// (e.g. 1000 bytes). A single doclist may span multiple pages. Care is
+// taken to ensure it is possible to iterate in either direction through
+// the entries in a doclist, or to seek to a specific entry within a
+// doclist, without loading it into memory.
+//
+// * large doclists that span many pages have associated "doclist index"
+// records that contain a copy of the first rowid on each page spanned by
+// the doclist. This is used to speed up seek operations, and merges of
+// large doclists with very small doclists.
+//
+// * extra fields in the "structure record" record the state of ongoing
+// incremental merge operations.
+//
+
+// Details:
+//
+// The %_data table managed by this module,
+//
+// CREATE TABLE %_data(id INTEGER PRIMARY KEY, block BLOB);
+//
+// , contains the following 5 types of records. See the comments surrounding
+// the FTS5_*_ROWID macros below for a description of how %_data rowids are
+// assigned to each fo them.
+//
+// 1. Structure Records:
+//
+// The set of segments that make up an index - the index structure - are
+// recorded in a single record within the %_data table. The record consists
+// of a single 32-bit configuration cookie value followed by a list of
+// SQLite varints. If the FTS table features more than one index (because
+// there are one or more prefix indexes), it is guaranteed that all share
+// the same cookie value.
+//
+// Immediately following the configuration cookie, the record begins with
+// three varints:
+//
+// + number of levels,
+// + total number of segments on all levels,
+// + value of write counter.
+//
+// Then, for each level from 0 to nMax:
+//
+// + number of input segments in ongoing merge.
+// + total number of segments in level.
+// + for each segment from oldest to newest:
+// + segment id (always > 0)
+// + first leaf page number (often 1, always greater than 0)
+// + final leaf page number
+//
+// 2. The Averages Record:
+//
+// A single record within the %_data table. The data is a list of varints.
+// The first value is the number of rows in the index. Then, for each column
+// from left to right, the total number of tokens in the column for all
+// rows of the table.
+//
+// 3. Segment leaves:
+//
+// TERM/DOCLIST FORMAT:
+//
+// Most of each segment leaf is taken up by term/doclist data. The
+// general format of term/doclist, starting with the first term
+// on the leaf page, is:
+//
+// varint : size of first term
+// blob: first term data
+// doclist: first doclist
+// zero-or-more {
+// varint: number of bytes in common with previous term
+// varint: number of bytes of new term data (nNew)
+// blob: nNew bytes of new term data
+// doclist: next doclist
+// }
+//
+// doclist format:
+//
+// varint: first rowid
+// poslist: first poslist
+// zero-or-more {
+// varint: rowid delta (always > 0)
+// poslist: next poslist
+// }
+//
+// poslist format:
+//
+// varint: size of poslist in bytes multiplied by 2, not including
+// this field. Plus 1 if this entry carries the "delete" flag.
+// collist: collist for column 0
+// zero-or-more {
+// 0x01 byte
+// varint: column number (I)
+// collist: collist for column I
+// }
+//
+// collist format:
+//
+// varint: first offset + 2
+// zero-or-more {
+// varint: offset delta + 2
+// }
+//
+// PAGE FORMAT
+//
+// Each leaf page begins with a 4-byte header containing 2 16-bit
+// unsigned integer fields in big-endian format. They are:
+//
+// * The byte offset of the first rowid on the page, if it exists
+// and occurs before the first term (otherwise 0).
+//
+// * The byte offset of the start of the page footer. If the page
+// footer is 0 bytes in size, then this field is the same as the
+// size of the leaf page in bytes.
+//
+// The page footer consists of a single varint for each term located
+// on the page. Each varint is the byte offset of the current term
+// within the page, delta-compressed against the previous value. In
+// other words, the first varint in the footer is the byte offset of
+// the first term, the second is the byte offset of the second less that
+// of the first, and so on.
+//
+// The term/doclist format described above is accurate if the entire
+// term/doclist data fits on a single leaf page. If this is not the case,
+// the format is changed in two ways:
+//
+// + if the first rowid on a page occurs before the first term, it
+// is stored as a literal value:
+//
+// varint: first rowid
+//
+// + the first term on each page is stored in the same way as the
+// very first term of the segment:
+//
+// varint : size of first term
+// blob: first term data
+//
+// 5. Segment doclist indexes:
+//
+// Doclist indexes are themselves b-trees, however they usually consist of
+// a single leaf record only. The format of each doclist index leaf page
+// is:
+//
+// * Flags byte. Bits are:
+// 0x01: Clear if leaf is also the root page, otherwise set.
+//
+// * Page number of fts index leaf page. As a varint.
+//
+// * First rowid on page indicated by previous field. As a varint.
+//
+// * A list of varints, one for each subsequent termless page. A
+// positive delta if the termless page contains at least one rowid,
+// or an 0x00 byte otherwise.
+//
+// Internal doclist index nodes are:
+//
+// * Flags byte. Bits are:
+// 0x01: Clear for root page, otherwise set.
+//
+// * Page number of first child page. As a varint.
+//
+// * Copy of first rowid on page indicated by previous field. As a varint.
+//
+// * A list of delta-encoded varints - the first rowid on each subsequent
+// child page.
+//
+
+// Rowids for the averages and structure records in the %_data table.
+
+// Macros determining the rowids used by segment leaves and dlidx leaves
+// and nodes. All nodes and leaves are stored in the %_data table with large
+// positive rowids.
+//
+// Each segment has a unique non-zero 16-bit id.
+//
+// The rowid for each segment leaf is found by passing the segment id and
+// the leaf page number to the FTS5_SEGMENT_ROWID macro. Leaves are numbered
+// sequentially starting from 1.
+
+// Each time a blob is read from the %_data table, it is padded with this
+// many zero bytes. This makes it easier to decode the various record formats
+// without overreading if the records are corrupt.
+
+type Fts5Data1 = struct {
+ Fp uintptr
+ Fnn int32
+ FszLeaf int32
+}
+
+// 2014 May 31
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// Low level access to the FTS index stored in the database file. The
+// routines in this file file implement all read and write access to the
+// %_data table. Other parts of the system access this functionality via
+// the interface defined in fts5Int.h.
+
+// #include "fts5Int.h"
+
+// Overview:
+//
+// The %_data table contains all the FTS indexes for an FTS5 virtual table.
+// As well as the main term index, there may be up to 31 prefix indexes.
+// The format is similar to FTS3/4, except that:
+//
+// * all segment b-tree leaf data is stored in fixed size page records
+// (e.g. 1000 bytes). A single doclist may span multiple pages. Care is
+// taken to ensure it is possible to iterate in either direction through
+// the entries in a doclist, or to seek to a specific entry within a
+// doclist, without loading it into memory.
+//
+// * large doclists that span many pages have associated "doclist index"
+// records that contain a copy of the first rowid on each page spanned by
+// the doclist. This is used to speed up seek operations, and merges of
+// large doclists with very small doclists.
+//
+// * extra fields in the "structure record" record the state of ongoing
+// incremental merge operations.
+//
+
+// Details:
+//
+// The %_data table managed by this module,
+//
+// CREATE TABLE %_data(id INTEGER PRIMARY KEY, block BLOB);
+//
+// , contains the following 5 types of records. See the comments surrounding
+// the FTS5_*_ROWID macros below for a description of how %_data rowids are
+// assigned to each fo them.
+//
+// 1. Structure Records:
+//
+// The set of segments that make up an index - the index structure - are
+// recorded in a single record within the %_data table. The record consists
+// of a single 32-bit configuration cookie value followed by a list of
+// SQLite varints. If the FTS table features more than one index (because
+// there are one or more prefix indexes), it is guaranteed that all share
+// the same cookie value.
+//
+// Immediately following the configuration cookie, the record begins with
+// three varints:
+//
+// + number of levels,
+// + total number of segments on all levels,
+// + value of write counter.
+//
+// Then, for each level from 0 to nMax:
+//
+// + number of input segments in ongoing merge.
+// + total number of segments in level.
+// + for each segment from oldest to newest:
+// + segment id (always > 0)
+// + first leaf page number (often 1, always greater than 0)
+// + final leaf page number
+//
+// 2. The Averages Record:
+//
+// A single record within the %_data table. The data is a list of varints.
+// The first value is the number of rows in the index. Then, for each column
+// from left to right, the total number of tokens in the column for all
+// rows of the table.
+//
+// 3. Segment leaves:
+//
+// TERM/DOCLIST FORMAT:
+//
+// Most of each segment leaf is taken up by term/doclist data. The
+// general format of term/doclist, starting with the first term
+// on the leaf page, is:
+//
+// varint : size of first term
+// blob: first term data
+// doclist: first doclist
+// zero-or-more {
+// varint: number of bytes in common with previous term
+// varint: number of bytes of new term data (nNew)
+// blob: nNew bytes of new term data
+// doclist: next doclist
+// }
+//
+// doclist format:
+//
+// varint: first rowid
+// poslist: first poslist
+// zero-or-more {
+// varint: rowid delta (always > 0)
+// poslist: next poslist
+// }
+//
+// poslist format:
+//
+// varint: size of poslist in bytes multiplied by 2, not including
+// this field. Plus 1 if this entry carries the "delete" flag.
+// collist: collist for column 0
+// zero-or-more {
+// 0x01 byte
+// varint: column number (I)
+// collist: collist for column I
+// }
+//
+// collist format:
+//
+// varint: first offset + 2
+// zero-or-more {
+// varint: offset delta + 2
+// }
+//
+// PAGE FORMAT
+//
+// Each leaf page begins with a 4-byte header containing 2 16-bit
+// unsigned integer fields in big-endian format. They are:
+//
+// * The byte offset of the first rowid on the page, if it exists
+// and occurs before the first term (otherwise 0).
+//
+// * The byte offset of the start of the page footer. If the page
+// footer is 0 bytes in size, then this field is the same as the
+// size of the leaf page in bytes.
+//
+// The page footer consists of a single varint for each term located
+// on the page. Each varint is the byte offset of the current term
+// within the page, delta-compressed against the previous value. In
+// other words, the first varint in the footer is the byte offset of
+// the first term, the second is the byte offset of the second less that
+// of the first, and so on.
+//
+// The term/doclist format described above is accurate if the entire
+// term/doclist data fits on a single leaf page. If this is not the case,
+// the format is changed in two ways:
+//
+// + if the first rowid on a page occurs before the first term, it
+// is stored as a literal value:
+//
+// varint: first rowid
+//
+// + the first term on each page is stored in the same way as the
+// very first term of the segment:
+//
+// varint : size of first term
+// blob: first term data
+//
+// 5. Segment doclist indexes:
+//
+// Doclist indexes are themselves b-trees, however they usually consist of
+// a single leaf record only. The format of each doclist index leaf page
+// is:
+//
+// * Flags byte. Bits are:
+// 0x01: Clear if leaf is also the root page, otherwise set.
+//
+// * Page number of fts index leaf page. As a varint.
+//
+// * First rowid on page indicated by previous field. As a varint.
+//
+// * A list of varints, one for each subsequent termless page. A
+// positive delta if the termless page contains at least one rowid,
+// or an 0x00 byte otherwise.
+//
+// Internal doclist index nodes are:
+//
+// * Flags byte. Bits are:
+// 0x01: Clear for root page, otherwise set.
+//
+// * Page number of first child page. As a varint.
+//
+// * Copy of first rowid on page indicated by previous field. As a varint.
+//
+// * A list of delta-encoded varints - the first rowid on each subsequent
+// child page.
+//
+
+// Rowids for the averages and structure records in the %_data table.
+
+// Macros determining the rowids used by segment leaves and dlidx leaves
+// and nodes. All nodes and leaves are stored in the %_data table with large
+// positive rowids.
+//
+// Each segment has a unique non-zero 16-bit id.
+//
+// The rowid for each segment leaf is found by passing the segment id and
+// the leaf page number to the FTS5_SEGMENT_ROWID macro. Leaves are numbered
+// sequentially starting from 1.
+
+// Each time a blob is read from the %_data table, it is padded with this
+// many zero bytes. This makes it easier to decode the various record formats
+// without overreading if the records are corrupt.
+
+type Fts5Data = Fts5Data1 /* sqlite3.c:216608:25 */
+type Fts5DlidxIter1 = struct {
+ FnLvl int32
+ FiSegid int32
+ FaLvl [1]Fts5DlidxLvl
+}
+
+type Fts5DlidxIter = Fts5DlidxIter1 /* sqlite3.c:216609:30 */
+type Fts5DlidxLvl1 = struct {
+ FpData uintptr
+ FiOff int32
+ FbEof int32
+ FiFirstOff int32
+ FiLeafPgno int32
+ FiRowid I64
+}
+
+type Fts5DlidxLvl = Fts5DlidxLvl1 /* sqlite3.c:216610:29 */
+type Fts5DlidxWriter1 = struct {
+ Fpgno int32
+ FbPrevValid int32
+ FiPrev I64
+ Fbuf Fts5Buffer
+}
+
+type Fts5DlidxWriter = Fts5DlidxWriter1 /* sqlite3.c:216611:32 */
+type Fts5Iter1 = struct {
+ Fbase Fts5IndexIter
+ FpIndex uintptr
+ Fposlist Fts5Buffer
+ FpColset uintptr
+ FxSetOutputs uintptr
+ FnSeg int32
+ FbRev int32
+ FbSkipEmpty U8
+ FiSwitchRowid I64
+ FaFirst uintptr
+ FaSeg [1]Fts5SegIter
+}
+
+type Fts5Iter = Fts5Iter1 /* sqlite3.c:216612:25 */
+type Fts5PageWriter1 = struct {
+ Fpgno int32
+ FiPrevPgidx int32
+ Fbuf Fts5Buffer
+ Fpgidx Fts5Buffer
+ Fterm Fts5Buffer
+}
+
+type Fts5PageWriter = Fts5PageWriter1 /* sqlite3.c:216613:31 */
+type Fts5SegIter1 = struct {
+ FpSeg uintptr
+ Fflags int32
+ FiLeafPgno int32
+ FpLeaf uintptr
+ FpNextLeaf uintptr
+ FiLeafOffset int32
+ FxNext uintptr
+ FiTermLeafPgno int32
+ FiTermLeafOffset int32
+ FiPgidxOff int32
+ FiEndofDoclist int32
+ FiRowidOffset int32
+ FnRowidOffset int32
+ FaRowidOffset uintptr
+ FpDlidx uintptr
+ Fterm Fts5Buffer
+ FiRowid I64
+ FnPos int32
+ FbDel U8
+ _ [3]byte
+}
+
+type Fts5SegIter = Fts5SegIter1 /* sqlite3.c:216614:28 */
+type Fts5DoclistIter1 = struct {
+ FaEof uintptr
+ FiRowid I64
+ FaPoslist uintptr
+ FnPoslist int32
+ FnSize int32
+}
+
+type Fts5DoclistIter = Fts5DoclistIter1 /* sqlite3.c:216615:32 */
+type Fts5SegWriter1 = struct {
+ FiSegid int32
+ Fwriter Fts5PageWriter
+ FiPrevRowid I64
+ FbFirstRowidInDoclist U8
+ FbFirstRowidInPage U8
+ FbFirstTermInPage U8
+ FnLeafWritten int32
+ FnEmpty int32
+ FnDlidx int32
+ FaDlidx uintptr
+ Fbtterm Fts5Buffer
+ FiBtPage int32
+ _ [4]byte
+}
+
+type Fts5SegWriter = Fts5SegWriter1 /* sqlite3.c:216616:30 */
+type Fts5Structure1 = struct {
+ FnRef int32
+ FnWriteCounter U64
+ FnSegment int32
+ FnLevel int32
+ FaLevel [1]Fts5StructureLevel
+}
+
+type Fts5Structure = Fts5Structure1 /* sqlite3.c:216617:30 */
+type Fts5StructureLevel1 = struct {
+ FnMerge int32
+ FnSeg int32
+ FaSeg uintptr
+}
+
+type Fts5StructureLevel = Fts5StructureLevel1 /* sqlite3.c:216618:35 */
+type Fts5StructureSegment1 = struct {
+ FiSegid int32
+ FpgnoFirst int32
+ FpgnoLast int32
+}
+
+type Fts5StructureSegment = Fts5StructureSegment1 /* sqlite3.c:216619:37 */
+
+type Fts5CResult1 = struct {
+ FiFirst U16
+ FbTermEq U8
+ _ [1]byte
+}
+
+type Fts5CResult = Fts5CResult1 /* sqlite3.c:216729:28 */
+
+func fts5PutU16(tls *libc.TLS, aOut uintptr, iVal U16) { /* sqlite3.c:216908:13: */
+ *(*U8)(unsafe.Pointer(aOut + uintptr(0))) = (U8(int32(iVal) >> 8))
+ *(*U8)(unsafe.Pointer(aOut + uintptr(1))) = (U8(int32(iVal) & 0xFF))
+}
+
+func fts5GetU16(tls *libc.TLS, aIn uintptr) U16 { /* sqlite3.c:216913:12: */
+ return (U16((int32(U16(*(*U8)(unsafe.Pointer(aIn + uintptr(0))))) << 8) + int32(*(*U8)(unsafe.Pointer(aIn + uintptr(1))))))
+}
+
+// Allocate and return a buffer at least nByte bytes in size.
+//
+// If an OOM error is encountered, return NULL and set the error code in
+// the Fts5Index handle passed as the first argument.
+func fts5IdxMalloc(tls *libc.TLS, p uintptr, nByte Sqlite3_int64) uintptr { /* sqlite3.c:216923:13: */
+ return sqlite3Fts5MallocZero(tls, (p + 52 /* &.rc */), nByte)
+}
+
+// Compare the contents of the pLeft buffer with the pRight/nRight blob.
+//
+// Return -ve if pLeft is smaller than pRight, 0 if they are equal or
+// +ve if pRight is smaller than pLeft. In other words:
+//
+// res = *pLeft - *pRight
+
+// Compare the contents of the two buffers using memcmp(). If one buffer
+// is a prefix of the other, it is considered the lesser.
+//
+// Return -ve if pLeft is smaller than pRight, 0 if they are equal or
+// +ve if pRight is smaller than pLeft. In other words:
+//
+// res = *pLeft - *pRight
+func fts5BufferCompare(tls *libc.TLS, pLeft uintptr, pRight uintptr) int32 { /* sqlite3.c:216955:12: */
+ var nCmp int32 = func() int32 {
+ if ((*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn) < ((*Fts5Buffer)(unsafe.Pointer(pRight)).Fn) {
+ return (*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn
+ }
+ return (*Fts5Buffer)(unsafe.Pointer(pRight)).Fn
+ }()
+ var res int32 = func() int32 {
+ if (nCmp) == 0 {
+ return 0
+ }
+ return libc.Xmemcmp(tls, (*Fts5Buffer)(unsafe.Pointer(pLeft)).Fp, (*Fts5Buffer)(unsafe.Pointer(pRight)).Fp, uint64(nCmp))
+ }()
+ return func() int32 {
+ if res == 0 {
+ return ((*Fts5Buffer)(unsafe.Pointer(pLeft)).Fn - (*Fts5Buffer)(unsafe.Pointer(pRight)).Fn)
+ }
+ return res
+ }()
+}
+
+func fts5LeafFirstTermOff(tls *libc.TLS, pLeaf uintptr) int32 { /* sqlite3.c:216961:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ // var ret int32 at bp, 4
+
+ sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf)), bp /* &ret */)
+ return *(*int32)(unsafe.Pointer(bp /* ret */))
+}
+
+// Close the read-only blob handle, if it is open.
+func sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { /* sqlite3.c:216970:13: */
+ if (*Fts5Index)(unsafe.Pointer(p)).FpReader != 0 {
+ var pReader uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpReader
+ (*Fts5Index)(unsafe.Pointer(p)).FpReader = uintptr(0)
+ Xsqlite3_blob_close(tls, pReader)
+ }
+}
+
+// Retrieve a record from the %_data table.
+//
+// If an error occurs, NULL is returned and an error left in the
+// Fts5Index object.
+func fts5DataRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:216984:17: */
+ var pRet uintptr = uintptr(0)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ var rc int32 = 0
+
+ if (*Fts5Index)(unsafe.Pointer(p)).FpReader != 0 {
+ // This call may return SQLITE_ABORT if there has been a savepoint
+ // rollback since it was last used. In this case a new blob handle
+ // is required.
+ var pBlob uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpReader
+ (*Fts5Index)(unsafe.Pointer(p)).FpReader = uintptr(0)
+ rc = Xsqlite3_blob_reopen(tls, pBlob, iRowid)
+
+ (*Fts5Index)(unsafe.Pointer(p)).FpReader = pBlob
+ if rc != 0 {
+ sqlite3Fts5IndexCloseReader(tls, p)
+ }
+ if rc == 4 {
+ rc = 0
+ }
+ }
+
+ // If the blob handle is not open at this point, open it and seek
+ // to the requested entry.
+ if ((*Fts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0)) && (rc == 0) {
+ var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
+ rc = Xsqlite3_blob_open(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb,
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl, ts+37682 /* "block" */, iRowid, 0, (p + 56 /* &.pReader */))
+ }
+
+ // If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls
+ // above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead.
+ // All the reasons those functions might return SQLITE_ERROR - missing
+ // table, missing row, non-blob/text in block column - indicate
+ // backing store corruption.
+ if rc == 1 {
+ rc = (11 | (int32(1) << 8))
+ }
+
+ if rc == 0 {
+ var aOut uintptr = uintptr(0) // Read blob data into this buffer
+ var nByte int32 = Xsqlite3_blob_bytes(tls, (*Fts5Index)(unsafe.Pointer(p)).FpReader)
+ var nAlloc Sqlite3_int64 = (Sqlite3_int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64(nByte)) + uint64(20)))
+ pRet = Xsqlite3_malloc64(tls, uint64(nAlloc))
+ if pRet != 0 {
+ (*Fts5Data)(unsafe.Pointer(pRet)).Fnn = nByte
+ aOut = libc.AssignPtrUintptr(pRet /* &.p */, (pRet + uintptr(1)*16))
+ } else {
+ rc = 7
+ }
+
+ if rc == 0 {
+ rc = Xsqlite3_blob_read(tls, (*Fts5Index)(unsafe.Pointer(p)).FpReader, aOut, nByte, 0)
+ }
+ if rc != 0 {
+ Xsqlite3_free(tls, pRet)
+ pRet = uintptr(0)
+ } else {
+ // TODO1: Fix this
+ *(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pRet)).Fp + uintptr(nByte))) = U8(0x00)
+ *(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pRet)).Fp + uintptr((nByte + 1)))) = U8(0x00)
+ (*Fts5Data)(unsafe.Pointer(pRet)).FszLeaf = int32(fts5GetU16(tls, ((*Fts5Data)(unsafe.Pointer(pRet)).Fp + uintptr(2))))
+ }
+ }
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = rc
+ (*Fts5Index)(unsafe.Pointer(p)).FnRead++
+ }
+
+ return pRet
+}
+
+// Release a reference to data record returned by an earlier call to
+// fts5DataRead().
+func fts5DataRelease(tls *libc.TLS, pData uintptr) { /* sqlite3.c:217057:13: */
+ Xsqlite3_free(tls, pData)
+}
+
+func fts5LeafRead(tls *libc.TLS, p uintptr, iRowid I64) uintptr { /* sqlite3.c:217061:17: */
+ var pRet uintptr = fts5DataRead(tls, p, iRowid)
+ if pRet != 0 {
+ if ((*Fts5Data)(unsafe.Pointer(pRet)).Fnn < 4) || ((*Fts5Data)(unsafe.Pointer(pRet)).FszLeaf > (*Fts5Data)(unsafe.Pointer(pRet)).Fnn) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ fts5DataRelease(tls, pRet)
+ pRet = uintptr(0)
+ }
+ }
+ return pRet
+}
+
+func fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr) int32 { /* sqlite3.c:217073:12: */
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ if zSql != 0 {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fdb, zSql, -1,
+ (uint32(0x01 | 0x04)),
+ ppStmt, uintptr(0))
+ } else {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = 7
+ }
+ }
+ Xsqlite3_free(tls, zSql)
+ return (*Fts5Index)(unsafe.Pointer(p)).Frc
+}
+
+// INSERT OR REPLACE a record into the %_data table.
+func fts5DataWrite(tls *libc.TLS, p uintptr, iRowid I64, pData uintptr, nData int32) { /* sqlite3.c:217095:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ return
+ }
+
+ if (*Fts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) {
+ var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
+ fts5IndexPrepareStmt(tls, p, (p + 64 /* &.pWriter */), Xsqlite3_mprintf(tls,
+ ts+37688, /* "REPLACE INTO '%q..." */
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ return
+ }
+ }
+
+ Xsqlite3_bind_int64(tls, (*Fts5Index)(unsafe.Pointer(p)).FpWriter, 1, iRowid)
+ Xsqlite3_bind_blob(tls, (*Fts5Index)(unsafe.Pointer(p)).FpWriter, 2, pData, nData, uintptr(0))
+ Xsqlite3_step(tls, (*Fts5Index)(unsafe.Pointer(p)).FpWriter)
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*Fts5Index)(unsafe.Pointer(p)).FpWriter)
+ Xsqlite3_bind_null(tls, (*Fts5Index)(unsafe.Pointer(p)).FpWriter, 2)
+}
+
+// Execute the following SQL:
+//
+// DELETE FROM %_data WHERE id BETWEEN $iFirst AND $iLast
+func fts5DataDelete(tls *libc.TLS, p uintptr, iFirst I64, iLast I64) { /* sqlite3.c:217119:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ return
+ }
+
+ if (*Fts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) {
+ var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
+ var zSql uintptr = Xsqlite3_mprintf(tls,
+ ts+37739, /* "DELETE FROM '%q'..." */
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
+ if fts5IndexPrepareStmt(tls, p, (p+72 /* &.pDeleter */), zSql) != 0 {
+ return
+ }
+ }
+
+ Xsqlite3_bind_int64(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDeleter, 1, iFirst)
+ Xsqlite3_bind_int64(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDeleter, 2, iLast)
+ Xsqlite3_step(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDeleter)
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDeleter)
+}
+
+// Remove all records associated with segment iSegid.
+func fts5DataRemoveSegment(tls *libc.TLS, p uintptr, iSegid int32) { /* sqlite3.c:217140:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var iFirst I64 = (((((I64(iSegid)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (int64(0)))
+ var iLast I64 = ((((((I64(iSegid + 1)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (int64(0))) - int64(1))
+ fts5DataDelete(tls, p, iFirst, iLast)
+ if (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) {
+ var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
+ fts5IndexPrepareStmt(tls, p, (p + 88 /* &.pIdxDeleter */), Xsqlite3_mprintf(tls,
+ ts+37788, /* "DELETE FROM '%q'..." */
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)))
+ }
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ Xsqlite3_bind_int(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter, 1, iSegid)
+ Xsqlite3_step(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter)
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter)
+ }
+}
+
+// Release a reference to an Fts5Structure object returned by an earlier
+// call to fts5StructureRead() or fts5StructureDecode().
+func fts5StructureRelease(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:217162:13: */
+ if (pStruct != 0) && (0 >= (libc.PreDecInt32(&(*Fts5Structure)(unsafe.Pointer(pStruct)).FnRef, 1))) {
+ var i int32
+
+ for i = 0; i < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; i++ {
+ Xsqlite3_free(tls, (*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(i)*16)).FaSeg)
+ }
+ Xsqlite3_free(tls, pStruct)
+ }
+}
+
+func fts5StructureRef(tls *libc.TLS, pStruct uintptr) { /* sqlite3.c:217173:13: */
+ (*Fts5Structure)(unsafe.Pointer(pStruct)).FnRef++
+}
+
+// Deserialize and return the structure record currently stored in serialized
+// form within buffer pData/nData.
+//
+// The Fts5Structure.aLevel[] and each Fts5StructureLevel.aSeg[] array
+// are over-allocated by one slot. This allows the structure contents
+// to be more easily edited.
+//
+// If an error occurs, *ppOut is set to NULL and an SQLite error code
+// returned. Otherwise, *ppOut is set to point to the new object and
+// SQLITE_OK returned.
+func fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie uintptr, ppOut uintptr) int32 { /* sqlite3.c:217189:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = 0
+ var i int32 = 0
+ var iLvl int32
+ *(*int32)(unsafe.Pointer(bp /* nLevel */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 4 /* nSegment */)) = 0
+ var nByte Sqlite3_int64 // Bytes of space to allocate at pRet
+ var pRet uintptr = uintptr(0) // Structure object to return
+
+ // Grab the cookie value
+ if piCookie != 0 {
+ *(*int32)(unsafe.Pointer(piCookie)) = sqlite3Fts5Get32(tls, pData)
+ }
+ i = 4
+
+ // Read the total number of levels and segments from the start of the
+ // structure record.
+ i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), bp /* &nLevel */))
+ i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), bp+4 /* &nSegment */))
+ if (((*(*int32)(unsafe.Pointer(bp /* nLevel */)) > 2000) || (*(*int32)(unsafe.Pointer(bp /* nLevel */)) < 0)) ||
+ (*(*int32)(unsafe.Pointer(bp + 4 /* nSegment */)) > 2000)) || (*(*int32)(unsafe.Pointer(bp + 4 /* nSegment */)) < 0) {
+ return (11 | (int32(1) << 8))
+ }
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Structure{})) + (uint64(unsafe.Sizeof(Fts5StructureLevel{})) * (uint64(*(*int32)(unsafe.Pointer(bp /* nLevel */)) - 1)))))
+ pRet = sqlite3Fts5MallocZero(tls, bp+8 /* &rc */, nByte)
+
+ if pRet != 0 {
+ (*Fts5Structure)(unsafe.Pointer(pRet)).FnRef = 1
+ (*Fts5Structure)(unsafe.Pointer(pRet)).FnLevel = *(*int32)(unsafe.Pointer(bp /* nLevel */))
+ (*Fts5Structure)(unsafe.Pointer(pRet)).FnSegment = *(*int32)(unsafe.Pointer(bp + 4 /* nSegment */))
+ i = i + (int32(sqlite3Fts5GetVarint(tls, (pData + uintptr(i)), (pRet + 8 /* &.nWriteCounter */))))
+
+ for iLvl = 0; (*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0) && (iLvl < *(*int32)(unsafe.Pointer(bp /* nLevel */))); iLvl++ {
+ var pLvl uintptr = ((pRet + 24 /* &.aLevel */) + uintptr(iLvl)*16)
+ *(*int32)(unsafe.Pointer(bp + 12 /* nTotal */)) = 0
+ var iSeg int32
+
+ if i >= nData {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (11 | (int32(1) << 8))
+ } else {
+ i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), (pLvl /* &.nMerge */)))
+ i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), bp+12 /* &nTotal */))
+ if *(*int32)(unsafe.Pointer(bp + 12 /* nTotal */)) < (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (11 | (int32(1) << 8))
+ }
+ (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = sqlite3Fts5MallocZero(tls, bp+8, /* &rc */
+ (int64(uint64(*(*int32)(unsafe.Pointer(bp + 12 /* nTotal */))) * uint64(unsafe.Sizeof(Fts5StructureSegment{})))))
+ *(*int32)(unsafe.Pointer(bp + 4 /* nSegment */)) -= *(*int32)(unsafe.Pointer(bp + 12 /* nTotal */))
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0 {
+ (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg = *(*int32)(unsafe.Pointer(bp + 12 /* nTotal */))
+ for iSeg = 0; iSeg < *(*int32)(unsafe.Pointer(bp + 12 /* nTotal */)); iSeg++ {
+ var pSeg uintptr = ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12)
+ if i >= nData {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (11 | (int32(1) << 8))
+ break
+ }
+ i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), (pSeg /* &.iSegid */)))
+ i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), (pSeg + 4 /* &.pgnoFirst */)))
+ i = i + (sqlite3Fts5GetVarint32(tls, (pData + uintptr(i)), (pSeg + 8 /* &.pgnoLast */)))
+ if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast < (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (11 | (int32(1) << 8))
+ break
+ }
+ }
+ if ((iLvl > 0) && ((*Fts5StructureLevel)(unsafe.Pointer(pLvl+libc.UintptrFromInt32(-1)*16)).FnMerge != 0)) && (*(*int32)(unsafe.Pointer(bp + 12 /* nTotal */)) == 0) {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (11 | (int32(1) << 8))
+ }
+ if (iLvl == (*(*int32)(unsafe.Pointer(bp /* nLevel */)) - 1)) && ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0) {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (11 | (int32(1) << 8))
+ }
+ }
+ }
+ if (*(*int32)(unsafe.Pointer(bp + 4 /* nSegment */)) != 0) && (*(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0) {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = (11 | (int32(1) << 8))
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0 {
+ fts5StructureRelease(tls, pRet)
+ pRet = uintptr(0)
+ }
+ }
+
+ *(*uintptr)(unsafe.Pointer(ppOut)) = pRet
+ return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
+}
+
+//
+func fts5StructureAddLevel(tls *libc.TLS, pRc uintptr, ppStruct uintptr) { /* sqlite3.c:217280:13: */
+ if *(*int32)(unsafe.Pointer(pRc)) == 0 {
+ var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct))
+ var nLevel int32 = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel
+ var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Structure{})) + (uint64(unsafe.Sizeof(Fts5StructureLevel{})) * (uint64(nLevel + 1)))))
+
+ pStruct = Xsqlite3_realloc64(tls, pStruct, uint64(nByte))
+ if pStruct != 0 {
+ libc.Xmemset(tls, ((pStruct + 24 /* &.aLevel */) + uintptr(nLevel)*16), 0, uint64(unsafe.Sizeof(Fts5StructureLevel{})))
+ (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel++
+ *(*uintptr)(unsafe.Pointer(ppStruct)) = pStruct
+ } else {
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+ }
+ }
+}
+
+// Extend level iLvl so that there is room for at least nExtra more
+// segments.
+func fts5StructureExtendLevel(tls *libc.TLS, pRc uintptr, pStruct uintptr, iLvl int32, nExtra int32, bInsert int32) { /* sqlite3.c:217304:13: */
+ if *(*int32)(unsafe.Pointer(pRc)) == 0 {
+ var pLvl uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iLvl)*16)
+ var aNew uintptr
+ var nByte Sqlite3_int64
+
+ nByte = (Sqlite3_int64((uint64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg + nExtra)) * uint64(unsafe.Sizeof(Fts5StructureSegment{}))))
+ aNew = Xsqlite3_realloc64(tls, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, uint64(nByte))
+ if aNew != 0 {
+ if bInsert == 0 {
+ libc.Xmemset(tls, (aNew + uintptr((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg)*12), 0, (uint64(unsafe.Sizeof(Fts5StructureSegment{})) * uint64(nExtra)))
+ } else {
+ var nMove int32 = (int32(uint64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg) * uint64(unsafe.Sizeof(Fts5StructureSegment{}))))
+ libc.Xmemmove(tls, (aNew + uintptr(nExtra)*12), aNew, uint64(nMove))
+ libc.Xmemset(tls, aNew, 0, (uint64(unsafe.Sizeof(Fts5StructureSegment{})) * uint64(nExtra)))
+ }
+ (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = aNew
+ } else {
+ *(*int32)(unsafe.Pointer(pRc)) = 7
+ }
+ }
+}
+
+func fts5StructureReadUncached(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:217333:22: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pRet */)) = uintptr(0)
+ var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
+ // var iCookie int32 at bp, 4
+ // Configuration cookie
+ var pData uintptr
+
+ pData = fts5DataRead(tls, p, int64(10))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ // TODO: Do we need this if the leaf-index is appended? Probably...
+ libc.Xmemset(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5Data)(unsafe.Pointer(pData)).Fnn)), 0, uint64(20))
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = fts5StructureDecode(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, (*Fts5Data)(unsafe.Pointer(pData)).Fnn, bp /* &iCookie */, bp+8 /* &pRet */)
+ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (((*Fts5Config)(unsafe.Pointer(pConfig)).Fpgsz == 0) || ((*Fts5Config)(unsafe.Pointer(pConfig)).FiCookie != *(*int32)(unsafe.Pointer(bp /* iCookie */)))) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5ConfigLoad(tls, pConfig, *(*int32)(unsafe.Pointer(bp /* iCookie */)))
+ }
+ fts5DataRelease(tls, pData)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ fts5StructureRelease(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pRet */)))
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pRet */)) = uintptr(0)
+ }
+ }
+
+ return *(*uintptr)(unsafe.Pointer(bp + 8 /* pRet */))
+}
+
+func fts5IndexDataVersion(tls *libc.TLS, p uintptr) I64 { /* sqlite3.c:217357:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var iVersion I64 = int64(0)
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ if (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion == uintptr(0) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = fts5IndexPrepareStmt(tls, p, (p + 112 /* &.pDataVersion */),
+ Xsqlite3_mprintf(tls, ts+37828 /* "PRAGMA %Q.data_v..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb)))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ return int64(0)
+ }
+ }
+
+ if 100 == Xsqlite3_step(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion) {
+ iVersion = Xsqlite3_column_int64(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion, 0)
+ }
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion)
+ }
+
+ return iVersion
+}
+
+// Read, deserialize and return the structure record.
+//
+// The Fts5Structure.aLevel[] and each Fts5StructureLevel.aSeg[] array
+// are over-allocated as described for function fts5StructureDecode()
+// above.
+//
+// If an error occurs, NULL is returned and an error code left in the
+// Fts5Index handle. If an error has already occurred when this function
+// is called, it is a no-op.
+func fts5StructureRead(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:217388:22: */
+
+ if (*Fts5Index)(unsafe.Pointer(p)).FpStruct == uintptr(0) {
+ (*Fts5Index)(unsafe.Pointer(p)).FiStructVersion = fts5IndexDataVersion(tls, p)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ (*Fts5Index)(unsafe.Pointer(p)).FpStruct = fts5StructureReadUncached(tls, p)
+ }
+ }
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ return uintptr(0)
+ }
+
+ fts5StructureRef(tls, (*Fts5Index)(unsafe.Pointer(p)).FpStruct)
+ return (*Fts5Index)(unsafe.Pointer(p)).FpStruct
+}
+
+func fts5StructureInvalidate(tls *libc.TLS, p uintptr) { /* sqlite3.c:217427:13: */
+ if (*Fts5Index)(unsafe.Pointer(p)).FpStruct != 0 {
+ fts5StructureRelease(tls, (*Fts5Index)(unsafe.Pointer(p)).FpStruct)
+ (*Fts5Index)(unsafe.Pointer(p)).FpStruct = uintptr(0)
+ }
+}
+
+// Return the total number of segments in index structure pStruct. This
+// function is only ever used as part of assert() conditions.
+
+// Serialize and store the "structure" record.
+//
+// If an error occurs, leave an error code in the Fts5Index object. If an
+// error has already occurred, this function is a no-op.
+func fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { /* sqlite3.c:217470:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ // var buf Fts5Buffer at bp, 16
+ // Buffer to serialize record into
+ var iLvl int32 // Used to iterate through levels
+ var iCookie int32 // Cookie value to store
+
+ libc.Xmemset(tls, bp /* &buf */, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
+
+ // Append the current configuration cookie
+ iCookie = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FiCookie
+ if iCookie < 0 {
+ iCookie = 0
+ }
+
+ if 0 == sqlite3Fts5BufferSize(tls, (p+52 /* &.rc */), bp /* &buf */, (uint32(((4+9)+9)+9))) {
+ sqlite3Fts5Put32(tls, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, iCookie)
+ (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn = 4
+ {
+ *(*int32)(unsafe.Pointer(bp /* &buf */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fn)), uint64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel)))
+ }
+
+ {
+ *(*int32)(unsafe.Pointer(bp /* &buf */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fn)), uint64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment)))
+ }
+
+ {
+ *(*int32)(unsafe.Pointer(bp /* &buf */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fn)), uint64(I64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter))))
+ }
+ }
+
+ for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; iLvl++ {
+ var iSeg int32 // Used to iterate through segments
+ var pLvl uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iLvl)*16)
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), bp /* &buf */, int64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge))
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), bp /* &buf */, int64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg))
+
+ for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg; iSeg++ {
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), bp /* &buf */, int64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12)).FiSegid))
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), bp /* &buf */, int64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12)).FpgnoFirst))
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), bp /* &buf */, int64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(iSeg)*12)).FpgnoLast))
+ }
+ }
+
+ fts5DataWrite(tls, p, int64(10), (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn)
+ sqlite3Fts5BufferFree(tls, bp /* &buf */)
+ }
+}
+
+func fts5SegmentSize(tls *libc.TLS, pSeg uintptr) int32 { /* sqlite3.c:217525:12: */
+ return ((1 + (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast) - (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst)
+}
+
+// Return a copy of index structure pStruct. Except, promote as many
+// segments as possible to level iPromote. If an OOM occurs, NULL is
+// returned.
+func fts5StructurePromoteTo(tls *libc.TLS, p uintptr, iPromote int32, szPromote int32, pStruct uintptr) { /* sqlite3.c:217534:13: */
+ var il int32
+ var is int32
+ var pOut uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iPromote)*16)
+
+ if (*Fts5StructureLevel)(unsafe.Pointer(pOut)).FnMerge == 0 {
+ for il = (iPromote + 1); il < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; il++ {
+ var pLvl uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(il)*16)
+ if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 {
+ return
+ }
+ for is = ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg - 1); is >= 0; is-- {
+ var sz int32 = fts5SegmentSize(tls, ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(is)*12))
+ if sz > szPromote {
+ return
+ }
+ fts5StructureExtendLevel(tls, (p + 52 /* &.rc */), pStruct, iPromote, 1, 1)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ return
+ }
+ libc.Xmemcpy(tls, (*Fts5StructureLevel)(unsafe.Pointer(pOut)).FaSeg, ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(is)*12), uint64(unsafe.Sizeof(Fts5StructureSegment{})))
+ (*Fts5StructureLevel)(unsafe.Pointer(pOut)).FnSeg++
+ (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg--
+ }
+ }
+ }
+}
+
+// A new segment has just been written to level iLvl of index structure
+// pStruct. This function determines if any segments should be promoted
+// as a result. Segments are promoted in two scenarios:
+//
+// a) If the segment just written is smaller than one or more segments
+// within the previous populated level, it is promoted to the previous
+// populated level.
+//
+// b) If the segment just written is larger than the newest segment on
+// the next populated level, then that segment, and any other adjacent
+// segments that are also smaller than the one just written, are
+// promoted.
+//
+// If one or more segments are promoted, the structure object is updated
+// to reflect this.
+func fts5StructurePromote(tls *libc.TLS, p uintptr, iLvl int32, pStruct uintptr) { /* sqlite3.c:217577:13: */
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ var iTst int32
+ var iPromote int32 = -1
+ var szPromote int32 = 0 // Promote anything this size or smaller
+ var pSeg uintptr // Segment just written
+ var szSeg int32 // Size of segment just written
+ var nSeg int32 = (*Fts5StructureLevel)(unsafe.Pointer((pStruct + 24 /* &.aLevel */) + uintptr(iLvl)*16)).FnSeg
+
+ if nSeg == 0 {
+ return
+ }
+ pSeg = ((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*16)).FaSeg + uintptr(((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*16)).FnSeg-1))*12)
+ szSeg = ((1 + (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast) - (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst)
+
+ // Check for condition (a)
+ for iTst = (iLvl - 1); (iTst >= 0) && ((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iTst)*16)).FnSeg == 0); iTst-- {
+ }
+ if iTst >= 0 {
+ var i int32
+ var szMax int32 = 0
+ var pTst uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iTst)*16)
+
+ for i = 0; i < (*Fts5StructureLevel)(unsafe.Pointer(pTst)).FnSeg; i++ {
+ var sz int32 = (((*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pTst)).FaSeg+uintptr(i)*12)).FpgnoLast - (*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pTst)).FaSeg+uintptr(i)*12)).FpgnoFirst) + 1)
+ if sz > szMax {
+ szMax = sz
+ }
+ }
+ if szMax >= szSeg {
+ // Condition (a) is true. Promote the newest segment on level
+ // iLvl to level iTst.
+ iPromote = iTst
+ szPromote = szMax
+ }
+ }
+
+ // If condition (a) is not met, assume (b) is true. StructurePromoteTo()
+ // is a no-op if it is not.
+ if iPromote < 0 {
+ iPromote = iLvl
+ szPromote = szSeg
+ }
+ fts5StructurePromoteTo(tls, p, iPromote, szPromote, pStruct)
+ }
+}
+
+// Advance the iterator passed as the only argument. If the end of the
+// doclist-index page is reached, return non-zero.
+func fts5DlidxLvlNext(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:217628:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pData uintptr = (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData
+
+ if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff == 0 {
+
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff = 1
+ *(*int32)(unsafe.Pointer(pLvl + 8 /* &.iOff */)) += (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr(1)), (pLvl + 20 /* &.iLeafPgno */)))
+ *(*int32)(unsafe.Pointer(pLvl + 8 /* &.iOff */)) += (int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff)), (pLvl + 24 /* &.iRowid */))))
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff = (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff
+ } else {
+ var iOff int32
+ for iOff = (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff; iOff < (*Fts5Data)(unsafe.Pointer(pData)).Fnn; iOff++ {
+ if *(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr(iOff))) != 0 {
+ break
+ }
+ }
+
+ if iOff < (*Fts5Data)(unsafe.Pointer(pData)).Fnn {
+ // var iVal I64 at bp, 8
+
+ *(*int32)(unsafe.Pointer(pLvl + 20 /* &.iLeafPgno */)) += ((iOff - (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff) + 1)
+ iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr(iOff)), bp /* &iVal */)))
+ *(*I64)(unsafe.Pointer(pLvl + 24 /* &.iRowid */)) += (*(*I64)(unsafe.Pointer(bp /* iVal */)))
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff = iOff
+ } else {
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof = 1
+ }
+ }
+
+ return (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof
+}
+
+// Advance the iterator passed as the only argument.
+func fts5DlidxIterNextR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:217660:12: */
+ var pLvl uintptr = ((pIter + 8 /* &.aLvl */) + uintptr(iLvl)*32)
+
+ if fts5DlidxLvlNext(tls, pLvl) != 0 {
+ if (iLvl + 1) < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl {
+ fts5DlidxIterNextR(tls, p, pIter, (iLvl + 1))
+ if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl+uintptr(1)*32)).FbEof == 0 {
+ fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)
+ libc.Xmemset(tls, pLvl, 0, uint64(unsafe.Sizeof(Fts5DlidxLvl{})))
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData = fts5DataRead(tls, p,
+ (((((I64((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid)) << ((31 + 5) + 1)) + (I64((int64(1))) << (31 + 5))) + ((I64(iLvl)) << (31))) + (I64((*Fts5DlidxLvl)(unsafe.Pointer(pLvl + uintptr(1)*32)).FiLeafPgno))))
+ if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData != 0 {
+ fts5DlidxLvlNext(tls, pLvl)
+ }
+ }
+ }
+ }
+
+ return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */) + uintptr(0)*32)).FbEof
+}
+func fts5DlidxIterNext(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:217680:12: */
+ return fts5DlidxIterNextR(tls, p, pIter, 0)
+}
+
+// The iterator passed as the first argument has the following fields set
+// as follows. This function sets up the rest of the iterator so that it
+// points to the first rowid in the doclist-index.
+//
+// pData:
+// pointer to doclist-index record,
+//
+// When this function is called pIter->iLeafPgno is the page number the
+// doclist is associated with (the one featuring the term).
+func fts5DlidxIterFirst(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:217695:12: */
+ var i int32
+ for i = 0; i < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl; i++ {
+ fts5DlidxLvlNext(tls, ((pIter + 8 /* &.aLvl */) + uintptr(i)*32))
+ }
+ return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */) + uintptr(0)*32)).FbEof
+}
+
+func fts5DlidxIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:217704:12: */
+ return (libc.Bool32(((*Fts5Index)(unsafe.Pointer(p)).Frc != 0) || ((*Fts5DlidxLvl)(unsafe.Pointer((pIter+8 /* &.aLvl */)+uintptr(0)*32)).FbEof != 0)))
+}
+
+func fts5DlidxIterLast(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:217708:13: */
+ var i int32
+
+ // Advance each level to the last entry on the last page
+ for i = ((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl - 1); ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (i >= 0); i-- {
+ var pLvl uintptr = ((pIter + 8 /* &.aLvl */) + uintptr(i)*32)
+ for fts5DlidxLvlNext(tls, pLvl) == 0 {
+ }
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof = 0
+
+ if i > 0 {
+ var pChild uintptr = (pLvl + libc.UintptrFromInt32(-1)*32)
+ fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer(pChild)).FpData)
+ libc.Xmemset(tls, pChild, 0, uint64(unsafe.Sizeof(Fts5DlidxLvl{})))
+ (*Fts5DlidxLvl)(unsafe.Pointer(pChild)).FpData = fts5DataRead(tls, p,
+ (((((I64((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid)) << ((31 + 5) + 1)) + (I64((int64(1))) << (31 + 5))) + ((I64(i - 1)) << (31))) + (I64((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiLeafPgno))))
+ }
+ }
+}
+
+// Move the iterator passed as the only argument to the previous entry.
+func fts5DlidxLvlPrev(tls *libc.TLS, pLvl uintptr) int32 { /* sqlite3.c:217731:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var iOff int32 = (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff
+
+ if iOff <= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff {
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof = 1
+ } else {
+ var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)).Fp
+ // var iVal I64 at bp, 8
+
+ var iLimit int32
+ var ii int32
+ var nZero int32 = 0
+
+ // Currently iOff points to the first byte of a varint. This block
+ // decrements iOff until it points to the first byte of the previous
+ // varint. Taking care not to read any memory locations that occur
+ // before the buffer in memory.
+ iLimit = func() int32 {
+ if iOff > 9 {
+ return (iOff - 9)
+ }
+ return 0
+ }()
+ for iOff--; iOff > iLimit; iOff-- {
+ if (int32(*(*U8)(unsafe.Pointer(a + uintptr((iOff - 1))))) & 0x80) == 0 {
+ break
+ }
+ }
+
+ sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), bp /* &iVal */)
+ *(*I64)(unsafe.Pointer(pLvl + 24 /* &.iRowid */)) -= (*(*I64)(unsafe.Pointer(bp /* iVal */)))
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiLeafPgno--
+
+ // Skip backwards past any 0x00 varints.
+ for ii = (iOff - 1); (ii >= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff) && (int32(*(*U8)(unsafe.Pointer(a + uintptr(ii)))) == 0x00); ii-- {
+ nZero++
+ }
+ if (ii >= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff) && ((int32(*(*U8)(unsafe.Pointer(a + uintptr(ii)))) & 0x80) != 0) {
+ // The byte immediately before the last 0x00 byte has the 0x80 bit
+ // set. So the last 0x00 is only a varint 0 if there are 8 more 0x80
+ // bytes before a[ii].
+ var bZero int32 = 0 // True if last 0x00 counts
+ if (ii - 8) >= (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiFirstOff {
+ var j int32
+ for j = 1; (j <= 8) && ((int32(*(*U8)(unsafe.Pointer(a + uintptr((ii - j))))) & 0x80) != 0); j++ {
+ }
+ bZero = (libc.Bool32(j > 8))
+ }
+ if bZero == 0 {
+ nZero--
+ }
+ }
+ *(*int32)(unsafe.Pointer(pLvl + 20 /* &.iLeafPgno */)) -= (nZero)
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FiOff = (iOff - nZero)
+ }
+
+ return (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof
+}
+
+func fts5DlidxIterPrevR(tls *libc.TLS, p uintptr, pIter uintptr, iLvl int32) int32 { /* sqlite3.c:217780:12: */
+ var pLvl uintptr = ((pIter + 8 /* &.aLvl */) + uintptr(iLvl)*32)
+
+ if fts5DlidxLvlPrev(tls, pLvl) != 0 {
+ if (iLvl + 1) < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl {
+ fts5DlidxIterPrevR(tls, p, pIter, (iLvl + 1))
+ if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl+uintptr(1)*32)).FbEof == 0 {
+ fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)
+ libc.Xmemset(tls, pLvl, 0, uint64(unsafe.Sizeof(Fts5DlidxLvl{})))
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData = fts5DataRead(tls, p,
+ (((((I64((*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid)) << ((31 + 5) + 1)) + (I64((int64(1))) << (31 + 5))) + ((I64(iLvl)) << (31))) + (I64((*Fts5DlidxLvl)(unsafe.Pointer(pLvl + uintptr(1)*32)).FiLeafPgno))))
+ if (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData != 0 {
+ for fts5DlidxLvlNext(tls, pLvl) == 0 {
+ }
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FbEof = 0
+ }
+ }
+ }
+ }
+
+ return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */) + uintptr(0)*32)).FbEof
+}
+func fts5DlidxIterPrev(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:217803:12: */
+ return fts5DlidxIterPrevR(tls, p, pIter, 0)
+}
+
+// Free a doclist-index iterator object allocated by fts5DlidxIterInit().
+func fts5DlidxIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:217810:13: */
+ if pIter != 0 {
+ var i int32
+ for i = 0; i < (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl; i++ {
+ fts5DataRelease(tls, (*Fts5DlidxLvl)(unsafe.Pointer((pIter+8 /* &.aLvl */)+uintptr(i)*32)).FpData)
+ }
+ Xsqlite3_free(tls, pIter)
+ }
+}
+
+func fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLeafPg int32) uintptr { /* sqlite3.c:217820:22: */
+ var pIter uintptr = uintptr(0)
+ var i int32
+ var bDone int32 = 0
+
+ for i = 0; ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (bDone == 0); i++ {
+ var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5DlidxIter{})) + (uint64(i) * uint64(unsafe.Sizeof(Fts5DlidxLvl{})))))
+ var pNew uintptr
+
+ pNew = Xsqlite3_realloc64(tls, pIter, uint64(nByte))
+ if pNew == uintptr(0) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = 7
+ } else {
+ var iRowid I64 = (((((I64(iSegid)) << ((31 + 5) + 1)) + (I64((int64(1))) << (31 + 5))) + ((I64(i)) << (31))) + (I64(iLeafPg)))
+ var pLvl uintptr = ((pNew + 8 /* &.aLvl */) + uintptr(i)*32)
+ pIter = pNew
+ libc.Xmemset(tls, pLvl, 0, uint64(unsafe.Sizeof(Fts5DlidxLvl{})))
+ (*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData = fts5DataRead(tls, p, iRowid)
+ if ((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData != 0) && ((int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5DlidxLvl)(unsafe.Pointer(pLvl)).FpData)).Fp + uintptr(0)))) & 0x0001) == 0) {
+ bDone = 1
+ }
+ (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FnLvl = (i + 1)
+ }
+ }
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ (*Fts5DlidxIter)(unsafe.Pointer(pIter)).FiSegid = iSegid
+ if bRev == 0 {
+ fts5DlidxIterFirst(tls, pIter)
+ } else {
+ fts5DlidxIterLast(tls, p, pIter)
+ }
+ }
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ fts5DlidxIterFree(tls, pIter)
+ pIter = uintptr(0)
+ }
+
+ return pIter
+}
+
+func fts5DlidxIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:217867:12: */
+ return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */) + uintptr(0)*32)).FiRowid
+}
+func fts5DlidxIterPgno(tls *libc.TLS, pIter uintptr) int32 { /* sqlite3.c:217870:12: */
+ return (*Fts5DlidxLvl)(unsafe.Pointer((pIter + 8 /* &.aLvl */) + uintptr(0)*32)).FiLeafPgno
+}
+
+// Load the next leaf page into the segment iterator.
+func fts5SegIterNextPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:217877:13: */
+ var pLeaf uintptr
+ var pSeg uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg
+ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno++
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf != 0 {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf = uintptr(0)
+ } else if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno <= (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = fts5LeafRead(tls, p,
+ (((((I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (I64((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno))))
+ } else {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
+ }
+ pLeaf = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf
+
+ if pLeaf != 0 {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf
+ if (*Fts5Data)(unsafe.Pointer((pLeaf))).FszLeaf >= (*Fts5Data)(unsafe.Pointer((pLeaf))).Fnn {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn + 1)
+ } else {
+ *(*int32)(unsafe.Pointer(pIter + 56 /* &.iPgidxOff */)) += (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff)), (pIter + 60 /* &.iEndofDoclist */)))
+ }
+ }
+}
+
+// Argument p points to a buffer containing a varint to be interpreted as a
+// position list size field. Read the varint and return the number of bytes
+// read. Before returning, set *pnSz to the number of bytes in the position
+// list, and *pbDel to true if the delete flag is set, or false otherwise.
+func fts5GetPoslistSize(tls *libc.TLS, p uintptr, pnSz uintptr, pbDel uintptr) int32 { /* sqlite3.c:217915:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ // var nSz int32 at bp, 4
+
+ var n int32 = 0
+ {
+ *(*int32)(unsafe.Pointer(bp /* nSz */)) = int32(*(*U8)(unsafe.Pointer((p) + uintptr(libc.PostIncInt32(&n, 1)))))
+ if (*(*int32)(unsafe.Pointer(bp /* nSz */)) & 0x80) != 0 {
+ n--
+ n = n + (sqlite3Fts5GetVarint32(tls, ((p) + uintptr(n)), bp /* &nSz */))
+ }
+ }
+
+ *(*int32)(unsafe.Pointer(pnSz)) = (*(*int32)(unsafe.Pointer(bp /* nSz */)) / 2)
+ *(*int32)(unsafe.Pointer(pbDel)) = (*(*int32)(unsafe.Pointer(bp /* nSz */)) & 0x0001)
+ return n
+}
+
+// Fts5SegIter.iLeafOffset currently points to the first byte of a
+// position-list size field. Read the value of the field and store it
+// in the following variables:
+//
+// Fts5SegIter.nPos
+// Fts5SegIter.bDel
+//
+// Leave Fts5SegIter.iLeafOffset pointing to the first byte of the
+// position list content (if any).
+func fts5SegIterLoadNPos(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:217936:13: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ var iOff int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset // Offset to read at
+
+ if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == 1 {
+ var iEod int32 = func() int32 {
+ if ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist) < ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) {
+ return (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist
+ }
+ return (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf
+ }()
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = U8(0)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = 1
+ if (iOff < iEod) && (int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)))) == 0) {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = U8(1)
+ iOff++
+ if (iOff < iEod) && (int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)))) == 0) {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = 1
+ iOff++
+ } else {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = 0
+ }
+ }
+ } else {
+ // var nSz int32 at bp, 4
+
+ {
+ *(*int32)(unsafe.Pointer(bp /* nSz */)) = int32(*(*U8)(unsafe.Pointer(((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp) + uintptr(libc.PostIncInt32(&iOff, 1)))))
+ if (*(*int32)(unsafe.Pointer(bp /* nSz */)) & 0x80) != 0 {
+ iOff--
+ iOff = iOff + (sqlite3Fts5GetVarint32(tls, (((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp) + uintptr(iOff)), bp /* &nSz */))
+ }
+ }
+
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = (U8(*(*int32)(unsafe.Pointer(bp /* nSz */)) & 0x0001))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = (*(*int32)(unsafe.Pointer(bp /* nSz */)) >> 1)
+ }
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff
+ }
+}
+
+func fts5SegIterLoadRowid(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:217965:13: */
+ var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp // Buffer to read data from
+ var iOff int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset
+
+ if iOff >= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf {
+ fts5SegIterNextPage(tls, p, pIter)
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0) {
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ }
+ return
+ }
+ iOff = 4
+ a = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
+ }
+ iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), (pIter + 104 /* &.iRowid */))))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff
+}
+
+// Fts5SegIter.iLeafOffset currently points to the first byte of the
+// "nSuffix" field of a term. Function parameter nKeep contains the value
+// of the "nPrefix" field (if there was one - it is passed 0 if this is
+// the first term in the segment).
+//
+// This function populates:
+//
+// Fts5SegIter.term
+// Fts5SegIter.rowid
+//
+// accordingly and leaves (Fts5SegIter.iLeafOffset) set to the content of
+// the first position list. The position list belonging to document
+// (Fts5SegIter.iRowid).
+func fts5SegIterLoadTerm(tls *libc.TLS, p uintptr, pIter uintptr, nKeep int32) { /* sqlite3.c:217998:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp // Buffer to read data from
+ var iOff int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset // Offset to read at
+ // var nNew int32 at bp, 4
+ // Bytes of new data
+
+ iOff = iOff + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iOff)), bp /* &nNew */))
+ if (((iOff + *(*int32)(unsafe.Pointer(bp /* nNew */))) > (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf) || (nKeep > (*Fts5SegIter)(unsafe.Pointer(pIter)).Fterm.Fn)) || (*(*int32)(unsafe.Pointer(bp /* nNew */)) == 0) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ return
+ }
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).Fterm.Fn = nKeep
+ sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), (pIter + 88 /* &.term */), uint32(*(*int32)(unsafe.Pointer(bp /* nNew */))), (a + uintptr(iOff)))
+
+ iOff = iOff + (*(*int32)(unsafe.Pointer(bp /* nNew */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset = iOff
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff
+
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff >= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + 1)
+ } else {
+ // var nExtra int32 at bp+4, 4
+
+ *(*int32)(unsafe.Pointer(pIter + 56 /* &.iPgidxOff */)) += (sqlite3Fts5GetVarint32(tls, (a + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff)), bp+4 /* &nExtra */))
+ *(*int32)(unsafe.Pointer(pIter + 60 /* &.iEndofDoclist */)) += (*(*int32)(unsafe.Pointer(bp + 4 /* nExtra */)))
+ }
+
+ fts5SegIterLoadRowid(tls, p, pIter)
+}
+
+func fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218031:13: */
+ if ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & 0x02) != 0 {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr)
+ }{fts5SegIterNext_Reverse}))
+ } else if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == 1 {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr)
+ }{fts5SegIterNext_None}))
+ } else {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FxNext = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr)
+ }{fts5SegIterNext}))
+ }
+}
+
+// Initialize the iterator object pIter to iterate through the entries in
+// segment pSeg. The iterator is left pointing to the first entry when
+// this function returns.
+//
+// If an error occurs, Fts5Index.rc is set to an appropriate error code. If
+// an error has already occurred when this function is called, it is a no-op.
+func fts5SegIterInit(tls *libc.TLS, p uintptr, pSeg uintptr, pIter uintptr) { /* sqlite3.c:218049:13: */
+ if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 {
+ // This happens if the segment is being used as an input to an incremental
+ // merge and all data has already been "trimmed". See function
+ // fts5TrimSegments() for details. In this case leave the iterator empty.
+ // The caller will see the (pIter->pLeaf==0) and assume the iterator is
+ // at EOF already.
+
+ return
+ }
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5SegIter{})))
+ fts5SegIterSetNext(tls, p, pIter)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg = pSeg
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = ((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst - 1)
+ fts5SegIterNextPage(tls, p, pIter)
+ }
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = 4
+
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf + 1)
+ fts5SegIterLoadTerm(tls, p, pIter, 0)
+ fts5SegIterLoadNPos(tls, p, pIter)
+ }
+}
+
+// This function is only ever called on iterators created by calls to
+// Fts5IndexQuery() with the FTS5INDEX_QUERY_DESC flag set.
+//
+// The iterator is in an unusual state when this function is called: the
+// Fts5SegIter.iLeafOffset variable is set to the offset of the start of
+// the position-list size field for the first relevant rowid on the page.
+// Fts5SegIter.rowid is set, but nPos and bDel are not.
+//
+// This function advances the iterator so that it points to the last
+// relevant rowid on the page and, if necessary, initializes the
+// aRowidOffset[] and iRowidOffset variables. At this point the iterator
+// is in its regular state - Fts5SegIter.iLeafOffset points to the first
+// byte of the position list content associated with said rowid.
+func fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218097:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail
+ var n int32 = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf
+ var i int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset
+ var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
+ var iRowidOffset int32 = 0
+
+ if n > (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist {
+ n = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist
+ }
+
+ for 1 != 0 {
+ *(*I64)(unsafe.Pointer(bp + 8 /* iDelta */)) = int64(0)
+
+ if eDetail == 1 {
+ // todo
+ if (i < n) && (int32(*(*U8)(unsafe.Pointer(a + uintptr(i)))) == 0) {
+ i++
+ if (i < n) && (int32(*(*U8)(unsafe.Pointer(a + uintptr(i)))) == 0) {
+ i++
+ }
+ }
+ } else {
+ // var nPos int32 at bp, 4
+
+ // var bDummy int32 at bp+4, 4
+
+ i = i + (fts5GetPoslistSize(tls, (a + uintptr(i)), bp /* &nPos */, bp+4 /* &bDummy */))
+ i = i + (*(*int32)(unsafe.Pointer(bp /* nPos */)))
+ }
+ if i >= n {
+ break
+ }
+ i = i + (int32(sqlite3Fts5GetVarint(tls, (a + uintptr(i)), bp+8 /* &iDelta */)))
+ *(*I64)(unsafe.Pointer(pIter + 104 /* &.iRowid */)) += (*(*I64)(unsafe.Pointer(bp + 8 /* iDelta */)))
+
+ // If necessary, grow the pIter->aRowidOffset[] array.
+ if iRowidOffset >= (*Fts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset {
+ var nNew int32 = ((*Fts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + 8)
+ var aNew uintptr = Xsqlite3_realloc64(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, (uint64(uint64(nNew) * uint64(unsafe.Sizeof(int32(0))))))
+ if aNew == uintptr(0) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = 7
+ break
+ }
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset = aNew
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset = nNew
+ }
+
+ *(*int32)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset + uintptr(libc.PostIncInt32(&iRowidOffset, 1))*4)) = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = i
+ }
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset = iRowidOffset
+ fts5SegIterLoadNPos(tls, p, pIter)
+}
+
+//
+func fts5SegIterReverseNewPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218150:13: */
+
+ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
+ for ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno > (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno) {
+ var pNew uintptr
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno--
+ pNew = fts5DataRead(tls, p, (((((I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (I64((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno))))
+ if pNew != 0 {
+ // iTermLeafOffset may be equal to szLeaf if the term is the last
+ // thing on the page - i.e. the first rowid is on the following page.
+ // In this case leave pIter->pLeaf==0, this iterator is at EOF.
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno == (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno {
+
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset < (*Fts5Data)(unsafe.Pointer(pNew)).FszLeaf {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pNew
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset
+ }
+ } else {
+ var iRowidOff int32
+ iRowidOff = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pNew)).Fp))
+ if iRowidOff != 0 {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pNew
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iRowidOff
+ }
+ }
+
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
+ var a uintptr = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset))
+ *(*int32)(unsafe.Pointer(pIter + 32 /* &.iLeafOffset */)) += (int32(sqlite3Fts5GetVarint(tls, a, (pIter + 104 /* &.iRowid */))))
+ break
+ } else {
+ fts5DataRelease(tls, pNew)
+ }
+ }
+ }
+
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + 1)
+ fts5SegIterReverseInitPage(tls, p, pIter)
+ }
+}
+
+// Return true if the iterator passed as the second argument currently
+// points to a delete marker. A delete marker is an entry with a 0 byte
+// position-list.
+func fts5MultiIterIsEmpty(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:218202:12: */
+ var pSeg uintptr = ((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+uintptr(1)*4)).FiFirst)*120)
+ return (libc.Bool32((((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0)) && ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos == 0)))
+}
+
+// Advance iterator pIter to the next entry.
+//
+// This version of fts5SegIterNext() is only used by reverse iterators.
+func fts5SegIterNext_Reverse(tls *libc.TLS, p uintptr, pIter uintptr, pbUnused uintptr) { /* sqlite3.c:218212:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ _ = pbUnused
+
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset > 0 {
+ var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
+ var iOff int32
+ // var iDelta I64 at bp, 8
+
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset--
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = *(*int32)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowidOffset)*4))
+ fts5SegIterLoadNPos(tls, p, pIter)
+ iOff = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset
+ if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail != 1 {
+ iOff = iOff + ((*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos)
+ }
+ sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), bp /* &iDelta */)
+ *(*I64)(unsafe.Pointer(pIter + 104 /* &.iRowid */)) -= (*(*I64)(unsafe.Pointer(bp /* iDelta */)))
+ } else {
+ fts5SegIterReverseNewPage(tls, p, pIter)
+ }
+}
+
+// Advance iterator pIter to the next entry.
+//
+// This version of fts5SegIterNext() is only used if detail=none and the
+// iterator is not a reverse direction iterator.
+func fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:218246:13: */
+ bp := tls.Alloc(36)
+ defer tls.Free(36)
+
+ var iOff int32
+ // Next entry is on the current page
+ // var iDelta I64 at bp, 8
+
+ // var nKeep int32 at bp+8, 4
+
+ // var pList uintptr at bp+24, 8
+
+ // var zTerm uintptr at bp+16, 8
+
+ // var nList int32 at bp+32, 4
+
+ iOff = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset
+
+ // Next entry is on the next page
+ if !(((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg != 0) && (iOff >= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf)) {
+ goto __1
+ }
+ fts5SegIterNextPage(tls, p, pIter)
+ if !(((*Fts5Index)(unsafe.Pointer(p)).Frc != 0) || ((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0))) {
+ goto __2
+ }
+ return
+__2:
+ ;
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowid = int64(0)
+ iOff = 4
+__1:
+ ;
+
+ if !(iOff < (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist) {
+ goto __3
+ }
+ iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)), bp /* &iDelta */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff
+ *(*I64)(unsafe.Pointer(pIter + 104 /* &.iRowid */)) += (*(*I64)(unsafe.Pointer(bp /* iDelta */)))
+ goto __4
+__3:
+ if !(((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & 0x01) == 0) {
+ goto __5
+ }
+ if !((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg != 0) {
+ goto __7
+ }
+ *(*int32)(unsafe.Pointer(bp + 8 /* nKeep */)) = 0
+ if !(iOff != fts5LeafFirstTermOff(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)) {
+ goto __9
+ }
+ iOff = iOff + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iOff)), bp+8 /* &nKeep */))
+__9:
+ ;
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff
+ fts5SegIterLoadTerm(tls, p, pIter, *(*int32)(unsafe.Pointer(bp + 8 /* nKeep */)))
+ goto __8
+__7:
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pList */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* zTerm */)) = uintptr(0)
+ sqlite3Fts5HashScanNext(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash)
+ sqlite3Fts5HashScanEntry(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, bp+16 /* &zTerm */, bp+24 /* &pList */, bp+32 /* &nList */)
+ if !(*(*uintptr)(unsafe.Pointer(bp + 24 /* pList */)) == uintptr(0)) {
+ goto __10
+ }
+ goto next_none_eof
+__10:
+ ;
+ (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp = *(*uintptr)(unsafe.Pointer(bp + 24 /* pList */))
+ (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn = *(*int32)(unsafe.Pointer(bp + 32 /* nList */))
+ (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf = *(*int32)(unsafe.Pointer(bp + 32 /* nList */))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = *(*int32)(unsafe.Pointer(bp + 32 /* nList */))
+ sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), (pIter + 88 /* &.term */), int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zTerm */)))), *(*uintptr)(unsafe.Pointer(bp + 16 /* zTerm */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int32(sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pList */)), (pIter + 104 /* &.iRowid */)))
+__8:
+ ;
+
+ if !(pbNewTerm != 0) {
+ goto __11
+ }
+ *(*int32)(unsafe.Pointer(pbNewTerm)) = 1
+__11:
+ ;
+ goto __6
+__5:
+ goto next_none_eof
+__6:
+ ;
+__4:
+ ;
+
+ fts5SegIterLoadNPos(tls, p, pIter)
+
+ return
+next_none_eof:
+ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
+}
+
+// Advance iterator pIter to the next entry.
+//
+// If an error occurs, Fts5Index.rc is set to an appropriate error code. It
+// is not considered an error if the iterator reaches EOF. If an error has
+// already occurred when this function is called, it is a no-op.
+func fts5SegIterNext(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:218318:13: */
+ bp := tls.Alloc(44)
+ defer tls.Free(44)
+
+ var pLeaf uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf
+ // var iOff int32 at bp+36, 4
+
+ var bNewTerm int32 = 0
+ *(*int32)(unsafe.Pointer(bp /* nKeep */)) = 0
+ var a uintptr
+ var n int32
+
+ // Search for the end of the position list within the current page.
+ a = (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp
+ n = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf
+
+ *(*int32)(unsafe.Pointer(bp + 36 /* iOff */)) = ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset + (*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos)
+
+ if *(*int32)(unsafe.Pointer(bp + 36 /* iOff */)) < n {
+ // The next entry is on the current page.
+
+ if *(*int32)(unsafe.Pointer(bp + 36 /* iOff */)) >= (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist {
+ bNewTerm = 1
+ if *(*int32)(unsafe.Pointer(bp + 36 /* iOff */)) != fts5LeafFirstTermOff(tls, pLeaf) {
+ *(*int32)(unsafe.Pointer(bp + 36 /* iOff */)) += sqlite3Fts5GetVarint32(tls, (a + uintptr(*(*int32)(unsafe.Pointer(bp + 36 /* iOff */)))), bp /* &nKeep */)
+ }
+ } else {
+ // var iDelta U64 at bp+8, 8
+
+ *(*int32)(unsafe.Pointer(bp + 36 /* iOff */)) += int32(sqlite3Fts5GetVarint(tls, (a + uintptr(*(*int32)(unsafe.Pointer(bp + 36 /* iOff */)))), bp+8 /* &iDelta */))
+ *(*I64)(unsafe.Pointer(pIter + 104 /* &.iRowid */)) += I64((*(*U64)(unsafe.Pointer(bp + 8 /* iDelta */))))
+ }
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = *(*int32)(unsafe.Pointer(bp + 36 /* iOff */))
+ } else if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg == uintptr(0) {
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pList */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* zTerm */)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 32 /* nList */)) = 0
+
+ if 0 == ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & 0x01) {
+ sqlite3Fts5HashScanNext(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash)
+ sqlite3Fts5HashScanEntry(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, bp+16 /* &zTerm */, bp+24 /* &pList */, bp+32 /* &nList */)
+ }
+ if *(*uintptr)(unsafe.Pointer(bp + 24 /* pList */)) == uintptr(0) {
+ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
+ } else {
+ (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp = *(*uintptr)(unsafe.Pointer(bp + 24 /* pList */))
+ (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn = *(*int32)(unsafe.Pointer(bp + 32 /* nList */))
+ (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf = *(*int32)(unsafe.Pointer(bp + 32 /* nList */))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*(*int32)(unsafe.Pointer(bp + 32 /* nList */)) + 1)
+ sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), (pIter + 88 /* &.term */), int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* zTerm */)))),
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* zTerm */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int32(sqlite3Fts5GetVarint(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pList */)), (pIter + 104 /* &.iRowid */)))
+ *(*int32)(unsafe.Pointer(pbNewTerm)) = 1
+ }
+ } else {
+ *(*int32)(unsafe.Pointer(bp + 36 /* iOff */)) = 0
+ // Next entry is not on the current page
+ for *(*int32)(unsafe.Pointer(bp + 36 /* iOff */)) == 0 {
+ fts5SegIterNextPage(tls, p, pIter)
+ pLeaf = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf
+ if pLeaf == uintptr(0) {
+ break
+ }
+
+ if (libc.AssignPtrInt32(bp+36 /* iOff */, int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp))) != 0) && (*(*int32)(unsafe.Pointer(bp + 36 /* iOff */)) < (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf) {
+ *(*int32)(unsafe.Pointer(bp + 36 /* iOff */)) += int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(*(*int32)(unsafe.Pointer(bp + 36 /* iOff */)))), (pIter + 104 /* &.iRowid */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = *(*int32)(unsafe.Pointer(bp + 36 /* iOff */))
+
+ if (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = ((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf + sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf)), (pIter+60 /* &.iEndofDoclist */)))
+ }
+ } else if (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = ((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf + sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp+uintptr((*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf)), bp+36 /* &iOff */))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = *(*int32)(unsafe.Pointer(bp + 36 /* iOff */))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = *(*int32)(unsafe.Pointer(bp + 36 /* iOff */))
+ bNewTerm = 1
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 36 /* iOff */)) > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ return
+ }
+ }
+ }
+
+ // Check if the iterator is now at EOF. If so, return early.
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
+ if bNewTerm != 0 {
+ if ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & 0x01) != 0 {
+ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
+ } else {
+ fts5SegIterLoadTerm(tls, p, pIter, *(*int32)(unsafe.Pointer(bp /* nKeep */)))
+ fts5SegIterLoadNPos(tls, p, pIter)
+ if pbNewTerm != 0 {
+ *(*int32)(unsafe.Pointer(pbNewTerm)) = 1
+ }
+ }
+ } else {
+ // The following could be done by calling fts5SegIterLoadNPos(). But
+ // this block is particularly performance critical, so equivalent
+ // code is inlined.
+ //
+ // Later: Switched back to fts5SegIterLoadNPos() because it supports
+ // detail=none mode. Not ideal.
+ // var nSz int32 at bp+40, 4
+
+ {
+ *(*int32)(unsafe.Pointer(bp + 40 /* nSz */)) = int32(*(*U8)(unsafe.Pointer(((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp) + uintptr(libc.PostIncInt32(&(*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset, 1)))))
+ if (*(*int32)(unsafe.Pointer(bp + 40 /* nSz */)) & 0x80) != 0 {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset--
+ *(*int32)(unsafe.Pointer(pIter + 32 /* &.iLeafOffset */)) += (sqlite3Fts5GetVarint32(tls, (((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp) + uintptr((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset)), bp+40 /* &nSz */))
+ }
+ }
+
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FbDel = (U8(*(*int32)(unsafe.Pointer(bp + 40 /* nSz */)) & 0x0001))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FnPos = (*(*int32)(unsafe.Pointer(bp + 40 /* nSz */)) >> 1)
+ }
+ }
+}
+
+// Iterator pIter currently points to the first rowid in a doclist. This
+// function sets the iterator up so that iterates in reverse order through
+// the doclist.
+func fts5SegIterReverse(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218454:13: */
+ var pDlidx uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx
+ var pLast uintptr = uintptr(0)
+ var pgnoLast int32 = 0
+
+ if pDlidx != 0 {
+ var iSegid int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid
+ pgnoLast = fts5DlidxIterPgno(tls, pDlidx)
+ pLast = fts5DataRead(tls, p, (((((I64(iSegid)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (I64(pgnoLast))))
+ } else {
+ var pLeaf uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf // Current leaf data
+
+ // Currently, Fts5SegIter.iLeafOffset points to the first byte of
+ // position-list content for the current rowid. Back it up so that it
+ // points to the start of the position-list size field.
+ var iPoslist int32
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno == (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno {
+ iPoslist = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset
+ } else {
+ iPoslist = 4
+ }
+ {
+ var iEnd int32 = (iPoslist + 9)
+ for ((int32(*(*U8)(unsafe.Pointer((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(libc.PostIncInt32(&iPoslist, 1))))) & 0x80) != 0) && (iPoslist < iEnd) {
+ }
+ }
+
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iPoslist
+
+ // If this condition is true then the largest rowid for the current
+ // term may not be stored on the current page. So search forward to
+ // see where said rowid really is.
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist >= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ var pgno int32
+ var pSeg uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg
+
+ // The last rowid in the doclist may not be on the current page. Search
+ // forward to find the page containing the last rowid.
+ for pgno = ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno + 1); !((*Fts5Index)(unsafe.Pointer(p)).Frc != 0) && (pgno <= (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast); pgno++ {
+ var iAbs I64 = (((((I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (I64(pgno)))
+ var pNew uintptr = fts5DataRead(tls, p, iAbs)
+ if pNew != 0 {
+ var iRowid int32
+ var bTermless int32
+ iRowid = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pNew)).Fp))
+ bTermless = (libc.Bool32((*Fts5Data)(unsafe.Pointer((pNew))).FszLeaf >= (*Fts5Data)(unsafe.Pointer((pNew))).Fnn))
+ if iRowid != 0 {
+ {
+ var tmp uintptr
+ tmp = pNew
+ pNew = pLast
+ pLast = tmp
+ }
+
+ pgnoLast = pgno
+ }
+ fts5DataRelease(tls, pNew)
+ if bTermless == 0 {
+ break
+ }
+ }
+ }
+ }
+ }
+
+ // If pLast is NULL at this point, then the last rowid for this doclist
+ // lies on the page currently indicated by the iterator. In this case
+ // pIter->iLeafOffset is already set to point to the position-list size
+ // field associated with the first relevant rowid on the page.
+ //
+ // Or, if pLast is non-NULL, then it is the page that contains the last
+ // rowid. In this case configure the iterator so that it points to the
+ // first rowid on this page.
+ if pLast != 0 {
+ var iOff int32
+ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pLast
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = pgnoLast
+ iOff = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLast)).Fp))
+ iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pLast)).Fp + uintptr(iOff)), (pIter + 104 /* &.iRowid */))))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff
+
+ if (*Fts5Data)(unsafe.Pointer((pLast))).FszLeaf >= (*Fts5Data)(unsafe.Pointer((pLast))).Fnn {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = ((*Fts5Data)(unsafe.Pointer(pLast)).Fnn + 1)
+ } else {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = fts5LeafFirstTermOff(tls, pLast)
+ }
+ }
+
+ fts5SegIterReverseInitPage(tls, p, pIter)
+}
+
+// Iterator pIter currently points to the first rowid of a doclist.
+// There is a doclist-index associated with the final term on the current
+// page. If the current term is the last term on the page, load the
+// doclist-index from disk and initialize an iterator at (pIter->pDlidx).
+func fts5SegIterLoadDlidx(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:218540:13: */
+ var iSeg int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FiSegid
+ var bRev int32 = ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & 0x02)
+ var pLeaf uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf // Current leaf data
+
+ // Check if the current doclist ends on this page. If it does, return
+ // early without loading the doclist-index (as it belongs to a different
+ // term.
+ if ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno == (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno) &&
+ ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist < (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf) {
+ return
+ }
+
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx = fts5DlidxIterInit(tls, p, bRev, iSeg, (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno)
+}
+
+// The iterator object passed as the second argument currently contains
+// no valid values except for the Fts5SegIter.pLeaf member variable. This
+// function searches the leaf page for a term matching (pTerm/nTerm).
+//
+// If the specified term is found on the page, then the iterator is left
+// pointing to it. If argument bGe is zero and the term is not found,
+// the iterator is left pointing at EOF.
+//
+// If bGe is non-zero and the specified term is not found, then the
+// iterator is left pointing to the smallest term in the segment that
+// is larger than the specified term, even if this term is not on the
+// current page.
+func fts5LeafSeek(tls *libc.TLS, p uintptr, bGe int32, pIter uintptr, pTerm uintptr, nTerm int32) { /* sqlite3.c:218574:13: */
+ bp := tls.Alloc(20)
+ defer tls.Free(20)
+
+ // var iOff int32 at bp+12, 4
+
+ var a uintptr
+ var szLeaf int32
+ var n int32
+ var nMatch U32
+ // var nKeep U32 at bp+8, 4
+
+ // var nNew U32 at bp+4, 4
+
+ // var iTermOff U32 at bp, 4
+
+ var iPgidx int32 // Current offset in pgidx
+ var bEndOfPage int32
+ var nCmp U32
+ var i U32
+ // var nExtra int32 at bp+16, 4
+ a = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
+ szLeaf = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf
+ n = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn
+ nMatch = U32(0)
+ *(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) = U32(0)
+ *(*U32)(unsafe.Pointer(bp + 4 /* nNew */)) = U32(0)
+ bEndOfPage = 0
+
+ iPgidx = szLeaf
+ iPgidx = iPgidx + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iPgidx)), bp /* &iTermOff */))
+ *(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) = int32(*(*U32)(unsafe.Pointer(bp /* iTermOff */)))
+ if !(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) > n) {
+ goto __1
+ }
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ return
+__1:
+ ;
+
+__2:
+ if !(1 != 0) {
+ goto __3
+ }
+
+ /* Figure out how many new bytes are in this term */
+ *(*U32)(unsafe.Pointer(bp + 4 /* nNew */)) = U32(*(*U8)(unsafe.Pointer((a) + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)), 1)))))
+ if !((*(*U32)(unsafe.Pointer(bp + 4 /* nNew */)) & U32(0x80)) != 0) {
+ goto __4
+ }
+ *(*int32)(unsafe.Pointer(bp + 12 /* iOff */))--
+ *(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) += sqlite3Fts5GetVarint32(tls, ((a) + uintptr(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)))), bp+4 /* &nNew */)
+__4:
+ ;
+
+ if !(*(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) < nMatch) {
+ goto __5
+ }
+ goto search_failed
+__5:
+ ;
+
+ if !(*(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) == nMatch) {
+ goto __6
+ }
+ nCmp = func() uint32 {
+ if (*(*U32)(unsafe.Pointer(bp + 4 /* nNew */))) < (U32(nTerm) - nMatch) {
+ return *(*U32)(unsafe.Pointer(bp + 4 /* nNew */))
+ }
+ return (U32(nTerm) - nMatch)
+ }()
+ i = U32(0)
+__7:
+ if !(i < nCmp) {
+ goto __9
+ }
+ if !(int32(*(*U8)(unsafe.Pointer(a + uintptr((U32(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */))) + i))))) != int32(*(*U8)(unsafe.Pointer(pTerm + uintptr((nMatch + i)))))) {
+ goto __10
+ }
+ goto __9
+__10:
+ ;
+ goto __8
+__8:
+ i++
+ goto __7
+ goto __9
+__9:
+ ;
+ nMatch = nMatch + (i)
+
+ if !(U32(nTerm) == nMatch) {
+ goto __11
+ }
+ if !(i == *(*U32)(unsafe.Pointer(bp + 4 /* nNew */))) {
+ goto __13
+ }
+ goto search_success
+ goto __14
+__13:
+ goto search_failed
+__14:
+ ;
+ goto __12
+__11:
+ if !((i < *(*U32)(unsafe.Pointer(bp + 4 /* nNew */))) && (int32(*(*U8)(unsafe.Pointer(a + uintptr((U32(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */))) + i))))) > int32(*(*U8)(unsafe.Pointer(pTerm + uintptr(nMatch)))))) {
+ goto __15
+ }
+ goto search_failed
+__15:
+ ;
+__12:
+ ;
+__6:
+ ;
+
+ if !(iPgidx >= n) {
+ goto __16
+ }
+ bEndOfPage = 1
+ goto __3
+__16:
+ ;
+
+ iPgidx = iPgidx + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iPgidx)), bp+8 /* &nKeep */))
+ *(*U32)(unsafe.Pointer(bp /* iTermOff */)) += *(*U32)(unsafe.Pointer(bp + 8 /* nKeep */))
+ *(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) = int32(*(*U32)(unsafe.Pointer(bp /* iTermOff */)))
+
+ if !(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) >= n) {
+ goto __17
+ }
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ return
+__17:
+ ;
+
+ /* Read the nKeep field of the next term. */
+ *(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) = U32(*(*U8)(unsafe.Pointer((a) + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)), 1)))))
+ if !((*(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) & U32(0x80)) != 0) {
+ goto __18
+ }
+ *(*int32)(unsafe.Pointer(bp + 12 /* iOff */))--
+ *(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) += sqlite3Fts5GetVarint32(tls, ((a) + uintptr(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)))), bp+8 /* &nKeep */)
+__18:
+ ;
+ goto __2
+__3:
+ ;
+
+search_failed:
+ if !(bGe == 0) {
+ goto __19
+ }
+ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = uintptr(0)
+ return
+ goto __20
+__19:
+ if !(bEndOfPage != 0) {
+ goto __21
+ }
+__22:
+ fts5SegIterNextPage(tls, p, pIter)
+ if !((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0)) {
+ goto __25
+ }
+ return
+__25:
+ ;
+ a = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
+ if !((libc.Bool32((*Fts5Data)(unsafe.Pointer(((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf))).FszLeaf >= (*Fts5Data)(unsafe.Pointer(((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf))).Fnn)) == 0) {
+ goto __26
+ }
+ iPgidx = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf
+ iPgidx = iPgidx + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp + uintptr(iPgidx)), bp+12 /* &iOff */))
+ if !((*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) < 4) || (*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) >= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf)) {
+ goto __27
+ }
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ return
+ goto __28
+__27:
+ *(*U32)(unsafe.Pointer(bp + 8 /* nKeep */)) = U32(0)
+ *(*U32)(unsafe.Pointer(bp /* iTermOff */)) = U32(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)))
+ n = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn
+ *(*int32)(unsafe.Pointer(bp + 12 /* iOff */)) += sqlite3Fts5GetVarint32(tls, (a + uintptr(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)))), bp+4 /* &nNew */)
+ goto __24
+__28:
+ ;
+__26:
+ ;
+ goto __23
+__23:
+ if 1 != 0 {
+ goto __22
+ }
+ goto __24
+__24:
+ ;
+__21:
+ ;
+__20:
+ ;
+
+search_success:
+ if !(((I64(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */))) + I64(*(*U32)(unsafe.Pointer(bp + 4 /* nNew */)))) > I64(n)) || (*(*U32)(unsafe.Pointer(bp + 4 /* nNew */)) < U32(1))) {
+ goto __29
+ }
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ return
+__29:
+ ;
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = (int32(U32(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */))) + *(*U32)(unsafe.Pointer(bp + 4 /* nNew */))))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafOffset = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiTermLeafPgno = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno
+
+ sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), (pIter + 88 /* &.term */), int32(*(*U32)(unsafe.Pointer(bp + 8 /* nKeep */))), pTerm)
+ sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), (pIter + 88 /* &.term */), *(*U32)(unsafe.Pointer(bp + 4 /* nNew */)), (a + uintptr(*(*int32)(unsafe.Pointer(bp + 12 /* iOff */)))))
+
+ if !(iPgidx >= n) {
+ goto __30
+ }
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fnn + 1)
+ goto __31
+__30:
+ iPgidx = iPgidx + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iPgidx)), bp+16 /* &nExtra */))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (int32(*(*U32)(unsafe.Pointer(bp /* iTermOff */)) + U32(*(*int32)(unsafe.Pointer(bp + 16 /* nExtra */)))))
+__31:
+ ;
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiPgidxOff = iPgidx
+
+ fts5SegIterLoadRowid(tls, p, pIter)
+ fts5SegIterLoadNPos(tls, p, pIter)
+}
+
+func fts5IdxSelectStmt(tls *libc.TLS, p uintptr) uintptr { /* sqlite3.c:218701:21: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ if (*Fts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) {
+ var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
+ fts5IndexPrepareStmt(tls, p, (p + 96 /* &.pIdxSelect */), Xsqlite3_mprintf(tls,
+
+ ts+37851, /* "SELECT pgno FROM..." */
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)))
+ }
+ return (*Fts5Index)(unsafe.Pointer(p)).FpIdxSelect
+}
+
+// Initialize the object pIter to point to term pTerm/nTerm within segment
+// pSeg. If there is no such term in the index, the iterator is set to EOF.
+//
+// If an error occurs, Fts5Index.rc is set to an appropriate error code. If
+// an error has already occurred when this function is called, it is a no-op.
+func fts5SegIterSeekInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pSeg uintptr, pIter uintptr) { /* sqlite3.c:218720:13: */
+ var iPg int32 = 1
+ var bGe int32 = (flags & 0x0008)
+ var bDlidx int32 = 0 // True if there is a doclist-index
+ var pIdxSelect uintptr = uintptr(0)
+
+ libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5SegIter{})))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg = pSeg
+
+ // This block sets stack variable iPg to the leaf page number that may
+ // contain term (pTerm/nTerm), if it is present in the segment.
+ pIdxSelect = fts5IdxSelectStmt(tls, p)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ return
+ }
+ Xsqlite3_bind_int(tls, pIdxSelect, 1, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)
+ Xsqlite3_bind_blob(tls, pIdxSelect, 2, pTerm, nTerm, uintptr(0))
+ if 100 == Xsqlite3_step(tls, pIdxSelect) {
+ var val I64 = I64(Xsqlite3_column_int(tls, pIdxSelect, 0))
+ iPg = (int32(val >> 1))
+ bDlidx = (int32(val & int64(0x0001)))
+ }
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, pIdxSelect)
+ Xsqlite3_bind_null(tls, pIdxSelect, 2)
+
+ if iPg < (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst {
+ iPg = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst
+ bDlidx = 0
+ }
+
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = (iPg - 1)
+ fts5SegIterNextPage(tls, p, pIter)
+
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
+ fts5LeafSeek(tls, p, bGe, pIter, pTerm, nTerm)
+ }
+
+ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (bGe == 0) {
+ *(*int32)(unsafe.Pointer(pIter + 8 /* &.flags */)) |= (0x01)
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf != 0 {
+ if (flags & 0x0002) != 0 {
+ *(*int32)(unsafe.Pointer(pIter + 8 /* &.flags */)) |= (0x02)
+ }
+ if bDlidx != 0 {
+ fts5SegIterLoadDlidx(tls, p, pIter)
+ }
+ if (flags & 0x0002) != 0 {
+ fts5SegIterReverse(tls, p, pIter)
+ }
+ }
+ }
+
+ fts5SegIterSetNext(tls, p, pIter)
+
+ // Either:
+ //
+ // 1) an error has occurred, or
+ // 2) the iterator points to EOF, or
+ // 3) the iterator points to an entry with term (pTerm/nTerm), or
+ // 4) the FTS5INDEX_QUERY_SCAN flag was set and the iterator points
+ // to an entry with a term greater than or equal to (pTerm/nTerm).
+
+}
+
+// Initialize the object pIter to point to term pTerm/nTerm within the
+// in-memory hash table. If there is no such term in the hash-table, the
+// iterator is set to EOF.
+//
+// If an error occurs, Fts5Index.rc is set to an appropriate error code. If
+// an error has already occurred when this function is called, it is a no-op.
+func fts5SegIterHashInit(tls *libc.TLS, p uintptr, pTerm uintptr, nTerm int32, flags int32, pIter uintptr) { /* sqlite3.c:218803:13: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ *(*int32)(unsafe.Pointer(bp + 16 /* nList */)) = 0
+ *(*uintptr)(unsafe.Pointer(bp /* z */)) = uintptr(0)
+ var n int32 = 0
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */)) = uintptr(0)
+
+ if (pTerm == uintptr(0)) || ((flags & 0x0008) != 0) {
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pList */)) = uintptr(0)
+
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashScanInit(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, pTerm, nTerm)
+ sqlite3Fts5HashScanEntry(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, bp /* &z */, bp+8 /* &pList */, bp+16 /* &nList */)
+ n = func() int32 {
+ if *(*uintptr)(unsafe.Pointer(bp /* z */)) != 0 {
+ return int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp /* z */))))
+ }
+ return 0
+ }()
+ if *(*uintptr)(unsafe.Pointer(bp + 8 /* pList */)) != 0 {
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */)) = fts5IdxMalloc(tls, p, int64(unsafe.Sizeof(Fts5Data{})))
+ if *(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */)) != 0 {
+ (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */)))).Fp = *(*uintptr)(unsafe.Pointer(bp + 8 /* pList */))
+ }
+ }
+ } else {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashQuery(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash, int32(unsafe.Sizeof(Fts5Data{})),
+ pTerm, nTerm, bp+24 /* &pLeaf */, bp+16 /* &nList */)
+ if *(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */)) != 0 {
+ (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */)))).Fp = (*(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */)) + uintptr(1)*16)
+ }
+ *(*uintptr)(unsafe.Pointer(bp /* z */)) = pTerm
+ n = nTerm
+ *(*int32)(unsafe.Pointer(pIter + 8 /* &.flags */)) |= (0x01)
+ }
+
+ if *(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */)) != 0 {
+ sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), (pIter + 88 /* &.term */), n, *(*uintptr)(unsafe.Pointer(bp /* z */)))
+ (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */)))).Fnn = libc.AssignPtrInt32(*(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */))+12 /* &.szLeaf */, *(*int32)(unsafe.Pointer(bp + 16 /* nList */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = *(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */)))).Fp, (pIter + 104 /* &.iRowid */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24 /* pLeaf */)))).Fnn
+
+ if (flags & 0x0002) != 0 {
+ *(*int32)(unsafe.Pointer(pIter + 8 /* &.flags */)) |= (0x02)
+ fts5SegIterReverseInitPage(tls, p, pIter)
+ } else {
+ fts5SegIterLoadNPos(tls, p, pIter)
+ }
+ }
+
+ fts5SegIterSetNext(tls, p, pIter)
+}
+
+// Zero the iterator passed as the only argument.
+func fts5SegIterClear(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:218862:13: */
+ sqlite3Fts5BufferFree(tls, (pIter + 88 /* &.term */))
+ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)
+ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf)
+ fts5DlidxIterFree(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx)
+ Xsqlite3_free(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset)
+ libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5SegIter{})))
+}
+
+// Do the comparison necessary to populate pIter->aFirst[iOut].
+//
+// If the returned value is non-zero, then it is the index of an entry
+// in the pIter->aSeg[] array that is (a) not at EOF, and (b) pointing
+// to a key that is a duplicate of another, higher priority,
+// segment-iterator in the pSeg->aSeg[] array.
+func fts5MultiIterDoCompare(tls *libc.TLS, pIter uintptr, iOut int32) int32 { /* sqlite3.c:218966:12: */
+ var i1 int32 // Index of left-hand Fts5SegIter
+ var i2 int32 // Index of right-hand Fts5SegIter
+ var iRes int32
+ var p1 uintptr // Left-hand Fts5SegIter
+ var p2 uintptr // Right-hand Fts5SegIter
+ var pRes uintptr = ((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(iOut)*4)
+
+ if iOut >= ((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg / 2) {
+ i1 = ((iOut - ((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg / 2)) * 2)
+ i2 = (i1 + 1)
+ } else {
+ i1 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr((iOut*2))*4)).FiFirst)
+ i2 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(((iOut*2)+1))*4)).FiFirst)
+ }
+ p1 = ((pIter + 96 /* &.aSeg */) + uintptr(i1)*120)
+ p2 = ((pIter + 96 /* &.aSeg */) + uintptr(i2)*120)
+
+ (*Fts5CResult)(unsafe.Pointer(pRes)).FbTermEq = U8(0)
+ if (*Fts5SegIter)(unsafe.Pointer(p1)).FpLeaf == uintptr(0) { // If p1 is at EOF
+ iRes = i2
+ } else if (*Fts5SegIter)(unsafe.Pointer(p2)).FpLeaf == uintptr(0) { // If p2 is at EOF
+ iRes = i1
+ } else {
+ var res int32 = fts5BufferCompare(tls, (p1 + 88 /* &.term */), (p2 + 88 /* &.term */))
+ if res == 0 {
+
+ (*Fts5CResult)(unsafe.Pointer(pRes)).FbTermEq = U8(1)
+ if (*Fts5SegIter)(unsafe.Pointer(p1)).FiRowid == (*Fts5SegIter)(unsafe.Pointer(p2)).FiRowid {
+ (*Fts5SegIter)(unsafe.Pointer(p1)).FbDel = (*Fts5SegIter)(unsafe.Pointer(p2)).FbDel
+ return i2
+ }
+ if (libc.Bool32((*Fts5SegIter)(unsafe.Pointer(p1)).FiRowid > (*Fts5SegIter)(unsafe.Pointer(p2)).FiRowid)) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
+ res = -1
+ } else {
+ res = +1
+ }
+ }
+
+ if res < 0 {
+ iRes = i1
+ } else {
+ iRes = i2
+ }
+ }
+
+ (*Fts5CResult)(unsafe.Pointer(pRes)).FiFirst = U16(iRes)
+ return 0
+}
+
+// Move the seg-iter so that it points to the first rowid on page iLeafPgno.
+// It is an error if leaf iLeafPgno does not exist or contains no rowids.
+func fts5SegIterGotoPage(tls *libc.TLS, p uintptr, pIter uintptr, iLeafPgno int32) { /* sqlite3.c:219020:13: */
+
+ if iLeafPgno > (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FpgnoLast {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ } else {
+ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpNextLeaf = uintptr(0)
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = (iLeafPgno - 1)
+ fts5SegIterNextPage(tls, p, pIter)
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ var iOff int32
+ var a uintptr = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp
+ var n int32 = (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf
+
+ iOff = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp))
+ if (iOff < 4) || (iOff >= n) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ } else {
+ iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), (pIter + 104 /* &.iRowid */))))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = iOff
+ fts5SegIterLoadNPos(tls, p, pIter)
+ }
+ }
+ }
+}
+
+// Advance the iterator passed as the second argument until it is at or
+// past rowid iFrom. Regardless of the value of iFrom, the iterator is
+// always advanced at least once.
+func fts5SegIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:219058:13: */
+ var bRev int32 = ((*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags & 0x02)
+ var pDlidx uintptr = (*Fts5SegIter)(unsafe.Pointer(pIter)).FpDlidx
+ var iLeafPgno int32 = (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno
+ var bMove int32 = 1
+
+ if bRev == 0 {
+ for !(fts5DlidxIterEof(tls, p, pDlidx) != 0) && (iMatch > fts5DlidxIterRowid(tls, pDlidx)) {
+ iLeafPgno = fts5DlidxIterPgno(tls, pDlidx)
+ fts5DlidxIterNext(tls, p, pDlidx)
+ }
+
+ if iLeafPgno > (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno {
+ fts5SegIterGotoPage(tls, p, pIter, iLeafPgno)
+ bMove = 0
+ }
+ } else {
+
+ for !(fts5DlidxIterEof(tls, p, pDlidx) != 0) && (iMatch < fts5DlidxIterRowid(tls, pDlidx)) {
+ fts5DlidxIterPrev(tls, p, pDlidx)
+ }
+ iLeafPgno = fts5DlidxIterPgno(tls, pDlidx)
+
+ if iLeafPgno < (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafPgno = (iLeafPgno + 1)
+ fts5SegIterReverseNewPage(tls, p, pIter)
+ bMove = 0
+ }
+ }
+
+ for ok := true; ok; ok = ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) {
+ if (bMove != 0) && ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) {
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pIter + 40 /* &.xNext */))))(tls, p, pIter, uintptr(0))
+ }
+ if (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf == uintptr(0) {
+ break
+ }
+ if (bRev == 0) && ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowid >= iMatch) {
+ break
+ }
+ if (bRev != 0) && ((*Fts5SegIter)(unsafe.Pointer(pIter)).FiRowid <= iMatch) {
+ break
+ }
+ bMove = 1
+ }
+}
+
+// Free the iterator object passed as the second argument.
+func fts5MultiIterFree(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:219112:13: */
+ if pIter != 0 {
+ var i int32
+ for i = 0; i < (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg; i++ {
+ fts5SegIterClear(tls, ((pIter + 96 /* &.aSeg */) + uintptr(i)*120))
+ }
+ sqlite3Fts5BufferFree(tls, (pIter + 32 /* &.poslist */))
+ Xsqlite3_free(tls, pIter)
+ }
+}
+
+func fts5MultiIterAdvanced(tls *libc.TLS, p uintptr, pIter uintptr, iChanged int32, iMinset int32) { /* sqlite3.c:219123:13: */
+ var i int32
+ for i = (((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iChanged) / 2); (i >= iMinset) && ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0); i = (i / 2) {
+ var iEq int32
+ if libc.AssignInt32(&iEq, fts5MultiIterDoCompare(tls, pIter, i)) != 0 {
+ var pSeg uintptr = ((pIter + 96 /* &.aSeg */) + uintptr(iEq)*120)
+
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pSeg + 40 /* &.xNext */))))(tls, p, pSeg, uintptr(0))
+ i = ((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iEq)
+ }
+ }
+}
+
+// Sub-iterator iChanged of iterator pIter has just been advanced. It still
+// points to the same term though - just a different rowid. This function
+// attempts to update the contents of the pIter->aFirst[] accordingly.
+// If it does so successfully, 0 is returned. Otherwise 1.
+//
+// If non-zero is returned, the caller should call fts5MultiIterAdvanced()
+// on the iterator instead. That function does the same as this one, except
+// that it deals with more complicated cases as well.
+func fts5MultiIterAdvanceRowid(tls *libc.TLS, pIter uintptr, iChanged int32, ppFirst uintptr) int32 { /* sqlite3.c:219151:12: */
+ var pNew uintptr = ((pIter + 96 /* &.aSeg */) + uintptr(iChanged)*120)
+
+ if ((*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid == (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid) ||
+ ((libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid < (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid)) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev) {
+ var i int32
+ var pOther uintptr = ((pIter + 96 /* &.aSeg */) + uintptr((iChanged^0x0001))*120)
+ (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = func() int64 {
+ if (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev != 0 {
+ return ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
+ }
+ return (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))
+ }()
+ for i = (((*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg + iChanged) / 2); 1 != 0; i = (i / 2) {
+ var pRes uintptr = ((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(i)*4)
+
+ if (*Fts5CResult)(unsafe.Pointer(pRes)).FbTermEq != 0 {
+ if (*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid == (*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid {
+ return 1
+ } else if (libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid > (*Fts5SegIter)(unsafe.Pointer(pNew)).FiRowid)) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
+ (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = (*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid
+ pNew = pOther
+ } else if (libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid > (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid)) == (*Fts5Iter)(unsafe.Pointer(pIter)).FbRev {
+ (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = (*Fts5SegIter)(unsafe.Pointer(pOther)).FiRowid
+ }
+ }
+ (*Fts5CResult)(unsafe.Pointer(pRes)).FiFirst = (U16(int64((pNew - (pIter + 96 /* &.aSeg */)) / 120)))
+ if i == 1 {
+ break
+ }
+
+ pOther = ((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+uintptr((i^0x0001))*4)).FiFirst)*120)
+ }
+ }
+
+ *(*uintptr)(unsafe.Pointer(ppFirst)) = pNew
+ return 0
+}
+
+// Set the pIter->bEof variable based on the state of the sub-iterators.
+func fts5MultiIterSetEof(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:219194:13: */
+ var pSeg uintptr = ((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+uintptr(1)*4)).FiFirst)*120)
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof = (U8(libc.Bool32((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf == uintptr(0))))
+ (*Fts5Iter)(unsafe.Pointer(pIter)).FiSwitchRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
+}
+
+// Move the iterator to the next entry.
+//
+// If an error occurs, an error code is left in Fts5Index.rc. It is not
+// considered an error if the iterator reaches EOF, or if it is already at
+// EOF when this function is called.
+func fts5MultiIterNext(tls *libc.TLS, p uintptr, pIter uintptr, bFrom int32, iFrom I64) { /* sqlite3.c:219207:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var bUseFrom int32 = bFrom
+
+ for (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ var iFirst int32 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(1)*4)).FiFirst)
+ *(*int32)(unsafe.Pointer(bp /* bNewTerm */)) = 0
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)) = ((pIter + 96 /* &.aSeg */) + uintptr(iFirst)*120)
+
+ if (bUseFrom != 0) && ((*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)))).FpDlidx != 0) {
+ fts5SegIterNextFrom(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)), iFrom)
+ } else {
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)) + 40 /* &.xNext */))))(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)), bp /* &bNewTerm */)
+ }
+
+ if (((*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)))).FpLeaf == uintptr(0)) || (*(*int32)(unsafe.Pointer(bp /* bNewTerm */)) != 0)) ||
+ (fts5MultiIterAdvanceRowid(tls, pIter, iFirst, bp+8 /* &pSeg */) != 0) {
+ fts5MultiIterAdvanced(tls, p, pIter, iFirst, 1)
+ fts5MultiIterSetEof(tls, pIter)
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)) = ((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+uintptr(1)*4)).FiFirst)*120)
+ if (*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)))).FpLeaf == uintptr(0) {
+ return
+ }
+ }
+
+ if (int32((*Fts5Iter)(unsafe.Pointer(pIter)).FbSkipEmpty) == 0) || ((*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)))).FnPos != 0) {
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pIter + 56 /* &.xSetOutputs */))))(tls, pIter, *(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)))
+ return
+ }
+ bUseFrom = 0
+ }
+}
+
+func fts5MultiIterNext2(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm uintptr) { /* sqlite3.c:219245:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ *(*int32)(unsafe.Pointer(pbNewTerm)) = 0
+ for ok := true; ok; ok = fts5MultiIterIsEmpty(tls, p, pIter) != 0 {
+ var iFirst int32 = int32((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst + uintptr(1)*4)).FiFirst)
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)) = ((pIter + 96 /* &.aSeg */) + uintptr(iFirst)*120)
+ *(*int32)(unsafe.Pointer(bp /* bNewTerm */)) = 0
+
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)) + 40 /* &.xNext */))))(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)), bp /* &bNewTerm */)
+ if (((*Fts5SegIter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pSeg */)))).FpLeaf == uintptr(0)) || (*(*int32)(unsafe.Pointer(bp /* bNewTerm */)) != 0)) ||
+ (fts5MultiIterAdvanceRowid(tls, pIter, iFirst, bp+8 /* &pSeg */) != 0) {
+ fts5MultiIterAdvanced(tls, p, pIter, iFirst, 1)
+ fts5MultiIterSetEof(tls, pIter)
+ *(*int32)(unsafe.Pointer(pbNewTerm)) = 1
+ }
+ }
+ }
+}
+
+func fts5IterSetOutputs_Noop(tls *libc.TLS, pUnused1 uintptr, pUnused2 uintptr) { /* sqlite3.c:219273:13: */
+ _ = pUnused1
+ _ = pUnused2
+}
+
+func fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) uintptr { /* sqlite3.c:219277:17: */
+ var pNew uintptr
+ var nSlot int32 // Power of two >= nSeg
+
+ for nSlot = 2; nSlot < nSeg; nSlot = (nSlot * 2) {
+ }
+ pNew = fts5IdxMalloc(tls, p,
+ (int64((uint64(unsafe.Sizeof(Fts5Iter{})) + (uint64(unsafe.Sizeof(Fts5SegIter{})) * (uint64(nSlot - 1)))) + (uint64(unsafe.Sizeof(Fts5CResult{})) * uint64(nSlot)))))
+ if pNew != 0 {
+ (*Fts5Iter)(unsafe.Pointer(pNew)).FnSeg = nSlot
+ (*Fts5Iter)(unsafe.Pointer(pNew)).FaFirst = ((pNew + 96 /* &.aSeg */) + uintptr(nSlot)*120)
+ (*Fts5Iter)(unsafe.Pointer(pNew)).FpIndex = p
+ (*Fts5Iter)(unsafe.Pointer(pNew)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr)
+ }{fts5IterSetOutputs_Noop}))
+ }
+ return pNew
+}
+
+func fts5PoslistCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:219299:13: */
+ _ = pUnused
+
+ if nChunk > 0 {
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pContext))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pContext))).Fn)), pChunk, uint64(nChunk))
+ *(*int32)(unsafe.Pointer(pContext + 8 /* &.n */)) += (nChunk)
+ }
+ }
+}
+
+type PoslistCallbackCtx1 = struct {
+ FpBuf uintptr
+ FpColset uintptr
+ FeState int32
+ _ [4]byte
+}
+
+type PoslistCallbackCtx = PoslistCallbackCtx1 /* sqlite3.c:219311:35 */
+
+type PoslistOffsetsCtx1 = struct {
+ FpBuf uintptr
+ FpColset uintptr
+ FiRead int32
+ FiWrite int32
+}
+
+type PoslistOffsetsCtx = PoslistOffsetsCtx1 /* sqlite3.c:219318:34 */
+
+// TODO: Make this more efficient!
+func fts5IndexColsetTest(tls *libc.TLS, pColset uintptr, iCol int32) int32 { /* sqlite3.c:219329:12: */
+ var i int32
+ for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ {
+ if *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)) == iCol {
+ return 1
+ }
+ }
+ return 0
+}
+
+func fts5PoslistOffsetsCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:219337:13: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var pCtx uintptr = pContext
+ _ = pUnused
+
+ if nChunk > 0 {
+ var i int32 = 0
+ for i < nChunk {
+ // var iVal int32 at bp, 4
+
+ i = i + (sqlite3Fts5GetVarint32(tls, (pChunk + uintptr(i)), bp /* &iVal */))
+ *(*int32)(unsafe.Pointer(bp /* iVal */)) += ((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiRead - 2)
+ (*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiRead = *(*int32)(unsafe.Pointer(bp /* iVal */))
+ if fts5IndexColsetTest(tls, (*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp /* iVal */))) != 0 {
+ {
+ *(*int32)(unsafe.Pointer((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(((*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fn)), (uint64((*(*int32)(unsafe.Pointer(bp /* iVal */)) + 2) - (*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiWrite))))
+ }
+
+ (*PoslistOffsetsCtx)(unsafe.Pointer(pCtx)).FiWrite = *(*int32)(unsafe.Pointer(bp /* iVal */))
+ }
+ }
+ }
+}
+
+func fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:219360:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pCtx uintptr = pContext
+ _ = pUnused
+
+ if nChunk > 0 {
+ // Search through to find the first varint with value 1. This is the
+ // start of the next columns hits.
+ var i int32 = 0
+ var iStart int32 = 0
+
+ if (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState == 2 {
+ // var iCol int32 at bp, 4
+
+ {
+ *(*int32)(unsafe.Pointer(bp /* iCol */)) = int32(*(*U8)(unsafe.Pointer((pChunk) + uintptr(libc.PostIncInt32(&i, 1)))))
+ if (*(*int32)(unsafe.Pointer(bp /* iCol */)) & 0x80) != 0 {
+ i--
+ i = i + (sqlite3Fts5GetVarint32(tls, ((pChunk) + uintptr(i)), bp /* &iCol */))
+ }
+ }
+
+ if fts5IndexColsetTest(tls, (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp /* iCol */))) != 0 {
+ (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = 1
+ {
+ *(*int32)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fn)), uint64(1)))
+ }
+ } else {
+ (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = 0
+ }
+ }
+
+ for ok := true; ok; ok = (i < nChunk) {
+ for (i < nChunk) && (int32(*(*U8)(unsafe.Pointer(pChunk + uintptr(i)))) != 0x01) {
+ for (int32(*(*U8)(unsafe.Pointer(pChunk + uintptr(i)))) & 0x80) != 0 {
+ i++
+ }
+ i++
+ }
+ if (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState != 0 {
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer(((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fn)), (pChunk + uintptr(iStart)), (uint64(i - iStart)))
+ *(*int32)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 8 /* &.n */)) += (i - iStart)
+ }
+ }
+ if i < nChunk {
+ // var iCol int32 at bp+4, 4
+
+ iStart = i
+ i++
+ if i >= nChunk {
+ (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = 2
+ } else {
+ {
+ *(*int32)(unsafe.Pointer(bp + 4 /* iCol */)) = int32(*(*U8)(unsafe.Pointer((pChunk) + uintptr(libc.PostIncInt32(&i, 1)))))
+ if (*(*int32)(unsafe.Pointer(bp + 4 /* iCol */)) & 0x80) != 0 {
+ i--
+ i = i + (sqlite3Fts5GetVarint32(tls, ((pChunk) + uintptr(i)), bp+4 /* &iCol */))
+ }
+ }
+
+ (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState = fts5IndexColsetTest(tls, (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpColset, *(*int32)(unsafe.Pointer(bp + 4 /* iCol */)))
+ if (*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FeState != 0 {
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer(((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf))).Fn)), (pChunk + uintptr(iStart)), (uint64(i - iStart)))
+ *(*int32)(unsafe.Pointer((*PoslistCallbackCtx)(unsafe.Pointer(pCtx)).FpBuf + 8 /* &.n */)) += (i - iStart)
+ }
+
+ iStart = i
+ }
+ }
+ }
+ }
+ }
+}
+
+func fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { /* sqlite3.c:219412:13: */
+ var nRem int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos // Number of bytes still to come
+ var pData uintptr = uintptr(0)
+ var pChunk uintptr = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset))
+ var nChunk int32 = func() int32 {
+ if (nRem) < ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf - (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset) {
+ return nRem
+ }
+ return ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf - (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset)
+ }()
+ var pgno int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno
+ var pgnoSave int32 = 0
+
+ // This function does notmwork with detail=none databases.
+
+ if ((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fflags & 0x02) == 0 {
+ pgnoSave = (pgno + 1)
+ }
+
+ for 1 != 0 {
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&xChunk)))(tls, p, pCtx, pChunk, nChunk)
+ nRem = nRem - (nChunk)
+ fts5DataRelease(tls, pData)
+ if nRem <= 0 {
+ break
+ } else {
+ pgno++
+ pData = fts5LeafRead(tls, p, (((((I64((*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FiSegid)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (I64(pgno))))
+ if pData == uintptr(0) {
+ break
+ }
+ pChunk = ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr(4))
+ nChunk = func() int32 {
+ if (nRem) < ((*Fts5Data)(unsafe.Pointer(pData)).FszLeaf - 4) {
+ return nRem
+ }
+ return ((*Fts5Data)(unsafe.Pointer(pData)).FszLeaf - 4)
+ }()
+ if pgno == pgnoSave {
+
+ (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpNextLeaf = pData
+ pData = uintptr(0)
+ }
+ }
+ }
+}
+
+// Iterator pIter currently points to a valid entry (not EOF). This
+// function appends the position list data for the current entry to
+// buffer pBuf. It does not make a copy of the position-list size
+// field.
+func fts5SegiterPoslist(tls *libc.TLS, p uintptr, pSeg uintptr, pColset uintptr, pBuf uintptr) { /* sqlite3.c:219459:13: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ if 0 == (func() int32 {
+ if ((U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + (U32((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos + 8))) <= (U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)) {
+ return 0
+ }
+ return sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), pBuf, (uint32(((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos + 8) + (*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)))
+ }()) {
+ libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))), 0, uint64(8))
+ if pColset == uintptr(0) {
+ fts5ChunkIterate(tls, p, pSeg, pBuf, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32)
+ }{fts5PoslistCallback})))
+ } else {
+ if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == 0 {
+ // var sCtx PoslistCallbackCtx at bp, 24
+
+ (*PoslistCallbackCtx)(unsafe.Pointer(bp /* &sCtx */)).FpBuf = pBuf
+ (*PoslistCallbackCtx)(unsafe.Pointer(bp /* &sCtx */)).FpColset = pColset
+ (*PoslistCallbackCtx)(unsafe.Pointer(bp /* &sCtx */)).FeState = fts5IndexColsetTest(tls, pColset, 0)
+
+ fts5ChunkIterate(tls, p, pSeg, bp /* &sCtx */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32)
+ }{fts5PoslistFilterCallback})))
+ } else {
+ // var sCtx PoslistOffsetsCtx at bp+24, 24
+
+ libc.Xmemset(tls, bp+24 /* &sCtx */, 0, uint64(unsafe.Sizeof(PoslistOffsetsCtx{})))
+ (*PoslistOffsetsCtx)(unsafe.Pointer(bp + 24 /* &sCtx */)).FpBuf = pBuf
+ (*PoslistOffsetsCtx)(unsafe.Pointer(bp + 24 /* &sCtx */)).FpColset = pColset
+ fts5ChunkIterate(tls, p, pSeg, bp+24 /* &sCtx */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32)
+ }{fts5PoslistOffsetsCallback})))
+ }
+ }
+ }
+}
+
+// IN/OUT parameter (*pa) points to a position list n bytes in size. If
+// the position list contains entries for column iCol, then (*pa) is set
+// to point to the sub-position-list for that column and the number of
+// bytes in it returned. Or, if the argument position list does not
+// contain any entries for column iCol, return 0.
+func fts5IndexExtractCol(tls *libc.TLS, pa uintptr, n int32, iCol int32) int32 { /* sqlite3.c:219495:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ *(*int32)(unsafe.Pointer(bp /* iCurrent */)) = 0 // Anything before the first 0x01 is col 0
+ var p uintptr = *(*uintptr)(unsafe.Pointer(pa))
+ var pEnd uintptr = (p + uintptr(n)) // One byte past end of position list
+
+ for iCol > *(*int32)(unsafe.Pointer(bp /* iCurrent */)) {
+ // Advance pointer p until it points to pEnd or an 0x01 byte that is
+ // not part of a varint. Note that it is not possible for a negative
+ // or extremely large varint to occur within an uncorrupted position
+ // list. So the last byte of each varint may be assumed to have a clear
+ // 0x80 bit.
+ for int32(*(*U8)(unsafe.Pointer(p))) != 0x01 {
+ for (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) & 0x80) != 0 {
+ }
+ if p >= pEnd {
+ return 0
+ }
+ }
+ *(*uintptr)(unsafe.Pointer(pa)) = libc.PostIncUintptr(&p, 1)
+ *(*int32)(unsafe.Pointer(bp /* iCurrent */)) = int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1))))
+ if (*(*int32)(unsafe.Pointer(bp /* iCurrent */)) & 0x80) != 0 {
+ p--
+ p += uintptr(sqlite3Fts5GetVarint32(tls, p, bp /* &iCurrent */))
+ }
+ }
+ if iCol != *(*int32)(unsafe.Pointer(bp /* iCurrent */)) {
+ return 0
+ }
+
+ // Advance pointer p until it points to pEnd or an 0x01 byte that is
+ // not part of a varint
+ for (p < pEnd) && (int32(*(*U8)(unsafe.Pointer(p))) != 0x01) {
+ for (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&p, 1)))) & 0x80) != 0 {
+ }
+ }
+
+ return (int32((int64(p) - (int64(*(*uintptr)(unsafe.Pointer(pa))))) / 1))
+}
+
+func fts5IndexExtractColset(tls *libc.TLS, pRc uintptr, pColset uintptr, pPos uintptr, nPos int32, pBuf uintptr) { /* sqlite3.c:219532:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ if *(*int32)(unsafe.Pointer(pRc)) == 0 {
+ var i int32
+ sqlite3Fts5BufferZero(tls, pBuf)
+ for i = 0; i < (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol; i++ {
+ *(*uintptr)(unsafe.Pointer(bp /* pSub */)) = pPos
+ var nSub int32 = fts5IndexExtractCol(tls, bp /* &pSub */, nPos, *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(i)*4)))
+ if nSub != 0 {
+ sqlite3Fts5BufferAppendBlob(tls, pRc, pBuf, uint32(nSub), *(*uintptr)(unsafe.Pointer(bp /* pSub */)))
+ }
+ }
+ }
+}
+
+// xSetOutputs callback used by detail=none tables.
+func fts5IterSetOutputs_None(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219554:13: */
+
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos
+}
+
+// xSetOutputs callback used by detail=full and detail=col tables when no
+// column filters are specified.
+func fts5IterSetOutputs_Nocolset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219564:13: */
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos
+
+ if ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos) <= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf {
+ // All data is stored on the current page. Populate the output
+ // variables to point into the body of the page object.
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset))
+ } else {
+ // The data is distributed over two or more pages. Copy it into the
+ // Fts5Iter.poslist buffer and then set the output pointer to point
+ // to this buffer.
+ sqlite3Fts5BufferZero(tls, (pIter + 32 /* &.poslist */))
+ fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, uintptr(0), (pIter + 32 /* &.poslist */))
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
+ }
+}
+
+// xSetOutputs callback used when the Fts5Colset object has nCol==0 (match
+// against no columns at all).
+func fts5IterSetOutputs_ZeroColset(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219589:13: */
+ _ = pSeg
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = 0
+}
+
+// xSetOutputs callback used by detail=col when there is a column filter
+// and there are 100 or more columns. Also called as a fallback from
+// fts5IterSetOutputs_Col100 if the column-list spans more than one page.
+func fts5IterSetOutputs_Col(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219599:13: */
+ sqlite3Fts5BufferZero(tls, (pIter + 32 /* &.poslist */))
+ fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset, (pIter + 32 /* &.poslist */))
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn
+}
+
+// xSetOutputs callback used when:
+//
+// * detail=col,
+// * there is a column filter, and
+// * the table contains 100 or fewer columns.
+//
+// The last point is to ensure all column numbers are stored as
+// single-byte varints.
+func fts5IterSetOutputs_Col100(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219617:13: */
+ var a uintptr
+ var pEnd uintptr
+ var iPrev int32
+ var aiCol uintptr
+ var aiColEnd uintptr
+ var aOut uintptr
+ var iPrevOut int32
+
+ if !(((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos) > (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf) {
+ goto __1
+ }
+ fts5IterSetOutputs_Col(tls, pIter, pSeg)
+ goto __2
+__1:
+ a = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset))
+ pEnd = (a + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos))
+ iPrev = 0
+ aiCol = (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset + 4 /* &.aiCol */
+ aiColEnd = (aiCol + uintptr((*Fts5Colset)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FpColset)).FnCol)*4)
+ aOut = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
+ iPrevOut = 0
+
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
+
+__3:
+ if !(a < pEnd) {
+ goto __4
+ }
+ iPrev = iPrev + (int32(*(*U8)(unsafe.Pointer(libc.PostIncUintptr(&a, 1) + uintptr(0)))) - 2)
+__5:
+ if !(*(*int32)(unsafe.Pointer(aiCol)) < iPrev) {
+ goto __6
+ }
+ aiCol += 4
+ if !(aiCol == aiColEnd) {
+ goto __7
+ }
+ goto setoutputs_col_out
+__7:
+ ;
+ goto __5
+__6:
+ ;
+ if !(*(*int32)(unsafe.Pointer(aiCol)) == iPrev) {
+ goto __8
+ }
+ *(*U8)(unsafe.Pointer(libc.PostIncUintptr(&aOut, 1))) = (U8((iPrev - iPrevOut) + 2))
+ iPrevOut = iPrev
+__8:
+ ;
+ goto __3
+__4:
+ ;
+
+setoutputs_col_out:
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (int32((int64(aOut) - int64((*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp)) / 1))
+__2:
+}
+
+// xSetOutputs callback used by detail=full when there is a column filter.
+func fts5IterSetOutputs_Full(tls *libc.TLS, pIter uintptr, pSeg uintptr) { /* sqlite3.c:219657:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pColset uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiRowid
+
+ if ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset + (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos) <= (*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).FszLeaf {
+ // All data is stored on the current page. Populate the output
+ // variables to point into the body of the page object.
+ *(*uintptr)(unsafe.Pointer(bp /* a */)) = ((*Fts5Data)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafOffset))
+ if (*Fts5Colset)(unsafe.Pointer(pColset)).FnCol == 1 {
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = fts5IndexExtractCol(tls, bp /* &a */, (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos, *(*int32)(unsafe.Pointer((pColset + 4 /* &.aiCol */) + uintptr(0)*4)))
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = *(*uintptr)(unsafe.Pointer(bp /* a */))
+ } else {
+ var pRc uintptr = ((*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex + 52 /* &.rc */)
+ sqlite3Fts5BufferZero(tls, (pIter + 32 /* &.poslist */))
+ fts5IndexExtractColset(tls, pRc, pColset, *(*uintptr)(unsafe.Pointer(bp /* a */)), (*Fts5SegIter)(unsafe.Pointer(pSeg)).FnPos, (pIter + 32 /* &.poslist */))
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn
+ }
+ } else {
+ // The data is distributed over two or more pages. Copy it into the
+ // Fts5Iter.poslist buffer and then set the output pointer to point
+ // to this buffer.
+ sqlite3Fts5BufferZero(tls, (pIter + 32 /* &.poslist */))
+ fts5SegiterPoslist(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pSeg, pColset, (pIter + 32 /* &.poslist */))
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FpData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fp
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FnData = (*Fts5Iter)(unsafe.Pointer(pIter)).Fposlist.Fn
+ }
+}
+
+func fts5IterSetOutputCb(tls *libc.TLS, pRc uintptr, pIter uintptr) { /* sqlite3.c:219689:13: */
+ if *(*int32)(unsafe.Pointer(pRc)) == 0 {
+ var pConfig uintptr = (*Fts5Index)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex)).FpConfig
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == 1 {
+ (*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr)
+ }{fts5IterSetOutputs_None}))
+ } else if (*Fts5Iter)(unsafe.Pointer(pIter)).FpColset == uintptr(0) {
+ (*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr)
+ }{fts5IterSetOutputs_Nocolset}))
+ } else if (*Fts5Colset)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FpColset)).FnCol == 0 {
+ (*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr)
+ }{fts5IterSetOutputs_ZeroColset}))
+ } else if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == 0 {
+ (*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr)
+ }{fts5IterSetOutputs_Full}))
+ } else {
+
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol <= 100 {
+ (*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr)
+ }{fts5IterSetOutputs_Col100}))
+ sqlite3Fts5BufferSize(tls, pRc, (pIter + 32 /* &.poslist */), uint32((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))
+ } else {
+ (*Fts5Iter)(unsafe.Pointer(pIter)).FxSetOutputs = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr)
+ }{fts5IterSetOutputs_Col}))
+ }
+ }
+ }
+}
+
+// Allocate a new Fts5Iter object.
+//
+// The new object will be used to iterate through data in structure pStruct.
+// If iLevel is -ve, then all data in all segments is merged. Or, if iLevel
+// is zero or greater, data from the first nSegment segments on level iLevel
+// is merged.
+//
+// The iterator initially points to the first term/rowid entry in the
+// iterated data.
+func fts5MultiIterNew(tls *libc.TLS, p uintptr, pStruct uintptr, flags int32, pColset uintptr, pTerm uintptr, nTerm int32, iLevel int32, nSegment int32, ppOut uintptr) { /* sqlite3.c:219732:13: */
+ var nSeg int32 = 0 // Number of segment-iters in use
+ var iIter int32 = 0 //
+ var iSeg int32 // Used to iterate through segments
+ var pLvl uintptr
+ var pNew uintptr
+
+ // Allocate space for the new multi-seg-iterator.
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ if iLevel < 0 {
+
+ nSeg = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment
+ nSeg = nSeg + (func() int32 {
+ if (*Fts5Index)(unsafe.Pointer(p)).FpHash != 0 {
+ return 1
+ }
+ return 0
+ }())
+ } else {
+ nSeg = func() int32 {
+ if ((*Fts5StructureLevel)(unsafe.Pointer((pStruct + 24 /* &.aLevel */) + uintptr(iLevel)*16)).FnSeg) < (nSegment) {
+ return (*Fts5StructureLevel)(unsafe.Pointer((pStruct + 24 /* &.aLevel */) + uintptr(iLevel)*16)).FnSeg
+ }
+ return nSegment
+ }()
+ }
+ }
+ *(*uintptr)(unsafe.Pointer(ppOut)) = libc.AssignUintptr(&pNew, fts5MultiIterAlloc(tls, p, nSeg))
+ if pNew == uintptr(0) {
+ return
+ }
+ (*Fts5Iter)(unsafe.Pointer(pNew)).FbRev = (libc.Bool32(0 != (flags & 0x0002)))
+ (*Fts5Iter)(unsafe.Pointer(pNew)).FbSkipEmpty = (U8(libc.Bool32(0 != (flags & 0x0010))))
+ (*Fts5Iter)(unsafe.Pointer(pNew)).FpColset = pColset
+ if (flags & 0x0020) == 0 {
+ fts5IterSetOutputCb(tls, (p + 52 /* &.rc */), pNew)
+ }
+
+ // Initialize each of the component segment iterators.
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ if iLevel < 0 {
+ var pEnd uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel)*16)
+ if (*Fts5Index)(unsafe.Pointer(p)).FpHash != 0 {
+ // Add a segment iterator for the current contents of the hash table.
+ var pIter uintptr = ((pNew + 96 /* &.aSeg */) + uintptr(libc.PostIncInt32(&iIter, 1))*120)
+ fts5SegIterHashInit(tls, p, pTerm, nTerm, flags, pIter)
+ }
+ for pLvl = ((pStruct + 24 /* &.aLevel */) + uintptr(0)*16); pLvl < pEnd; pLvl += 16 {
+ for iSeg = ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg - 1); iSeg >= 0; iSeg-- {
+ var pSeg uintptr = ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12)
+ var pIter uintptr = ((pNew + 96 /* &.aSeg */) + uintptr(libc.PostIncInt32(&iIter, 1))*120)
+ if pTerm == uintptr(0) {
+ fts5SegIterInit(tls, p, pSeg, pIter)
+ } else {
+ fts5SegIterSeekInit(tls, p, pTerm, nTerm, flags, pSeg, pIter)
+ }
+ }
+ }
+ } else {
+ pLvl = ((pStruct + 24 /* &.aLevel */) + uintptr(iLevel)*16)
+ for iSeg = (nSeg - 1); iSeg >= 0; iSeg-- {
+ fts5SegIterInit(tls, p, ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12), ((pNew + 96 /* &.aSeg */) + uintptr(libc.PostIncInt32(&iIter, 1))*120))
+ }
+ }
+ }
+
+ // If the above was successful, each component iterators now points
+ // to the first entry in its segment. In this case initialize the
+ // aFirst[] array. Or, if an error has occurred, free the iterator
+ // object and set the output variable to NULL.
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ for iIter = ((*Fts5Iter)(unsafe.Pointer(pNew)).FnSeg - 1); iIter > 0; iIter-- {
+ var iEq int32
+ if libc.AssignInt32(&iEq, fts5MultiIterDoCompare(tls, pNew, iIter)) != 0 {
+ var pSeg uintptr = ((pNew + 96 /* &.aSeg */) + uintptr(iEq)*120)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer((pSeg + 40 /* &.xNext */))))(tls, p, pSeg, uintptr(0))
+ }
+ fts5MultiIterAdvanced(tls, p, pNew, iEq, iIter)
+ }
+ }
+ fts5MultiIterSetEof(tls, pNew)
+
+ if ((*Fts5Iter)(unsafe.Pointer(pNew)).FbSkipEmpty != 0) && (fts5MultiIterIsEmpty(tls, p, pNew) != 0) {
+ fts5MultiIterNext(tls, p, pNew, 0, int64(0))
+ } else if int32((*Fts5Iter)(unsafe.Pointer(pNew)).Fbase.FbEof) == 0 {
+ var pSeg uintptr = ((pNew + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pNew)).FaFirst+uintptr(1)*4)).FiFirst)*120)
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((pNew + 56 /* &.xSetOutputs */))))(tls, pNew, pSeg)
+ }
+ } else {
+ fts5MultiIterFree(tls, pNew)
+ *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0)
+ }
+}
+
+// Create an Fts5Iter that iterates through the doclist provided
+// as the second argument.
+func fts5MultiIterNew2(tls *libc.TLS, p uintptr, pData uintptr, bDesc int32, ppOut uintptr) { /* sqlite3.c:219831:13: */
+ var pNew uintptr
+ pNew = fts5MultiIterAlloc(tls, p, 2)
+ if pNew != 0 {
+ var pIter uintptr = ((pNew + 96 /* &.aSeg */) + uintptr(1)*120)
+
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).Fflags = 0x01
+ if (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf > 0 {
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FpLeaf = pData
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int32(sqlite3Fts5GetVarint(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, (pIter + 104 /* &.iRowid */)))
+ (*Fts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist = (*Fts5Data)(unsafe.Pointer(pData)).Fnn
+ (*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pNew)).FaFirst + uintptr(1)*4)).FiFirst = U16(1)
+ if bDesc != 0 {
+ (*Fts5Iter)(unsafe.Pointer(pNew)).FbRev = 1
+ *(*int32)(unsafe.Pointer(pIter + 8 /* &.flags */)) |= (0x02)
+ fts5SegIterReverseInitPage(tls, p, pIter)
+ } else {
+ fts5SegIterLoadNPos(tls, p, pIter)
+ }
+ pData = uintptr(0)
+ } else {
+ (*Fts5Iter)(unsafe.Pointer(pNew)).Fbase.FbEof = U8(1)
+ }
+ fts5SegIterSetNext(tls, p, pIter)
+
+ *(*uintptr)(unsafe.Pointer(ppOut)) = pNew
+ }
+
+ fts5DataRelease(tls, pData)
+}
+
+// Return true if the iterator is at EOF or if an error has occurred.
+// False otherwise.
+func fts5MultiIterEof(tls *libc.TLS, p uintptr, pIter uintptr) int32 { /* sqlite3.c:219871:12: */
+
+ return (libc.Bool32(((*Fts5Index)(unsafe.Pointer(p)).Frc != 0) || ((*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof != 0)))
+}
+
+// Return the rowid of the entry that the iterator currently points
+// to. If the iterator points to EOF when this function is called the
+// results are undefined.
+func fts5MultiIterRowid(tls *libc.TLS, pIter uintptr) I64 { /* sqlite3.c:219883:12: */
+
+ return (*Fts5SegIter)(unsafe.Pointer((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+uintptr(1)*4)).FiFirst)*120)).FiRowid
+}
+
+// Move the iterator to the next entry at or following iMatch.
+func fts5MultiIterNextFrom(tls *libc.TLS, p uintptr, pIter uintptr, iMatch I64) { /* sqlite3.c:219891:13: */
+ for 1 != 0 {
+ var iRowid I64
+ fts5MultiIterNext(tls, p, pIter, 1, iMatch)
+ if fts5MultiIterEof(tls, p, pIter) != 0 {
+ break
+ }
+ iRowid = fts5MultiIterRowid(tls, pIter)
+ if ((*Fts5Iter)(unsafe.Pointer(pIter)).FbRev == 0) && (iRowid >= iMatch) {
+ break
+ }
+ if ((*Fts5Iter)(unsafe.Pointer(pIter)).FbRev != 0) && (iRowid <= iMatch) {
+ break
+ }
+ }
+}
+
+// Return a pointer to a buffer containing the term associated with the
+// entry that the iterator currently points to.
+func fts5MultiIterTerm(tls *libc.TLS, pIter uintptr, pn uintptr) uintptr { /* sqlite3.c:219910:17: */
+ var p uintptr = ((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+uintptr(1)*4)).FiFirst)*120)
+ *(*int32)(unsafe.Pointer(pn)) = (*Fts5SegIter)(unsafe.Pointer(p)).Fterm.Fn
+ return (*Fts5SegIter)(unsafe.Pointer(p)).Fterm.Fp
+}
+
+// Allocate a new segment-id for the structure pStruct. The new segment
+// id must be between 1 and 65335 inclusive, and must not be used by
+// any currently existing segment. If a free segment id cannot be found,
+// SQLITE_FULL is returned.
+//
+// If an error has already occurred, this function is a no-op. 0 is
+// returned in this case.
+func fts5AllocateSegid(tls *libc.TLS, p uintptr, pStruct uintptr) int32 { /* sqlite3.c:219925:12: */
+ bp := tls.Alloc(252)
+ defer tls.Free(252)
+
+ var iSegid int32 = 0
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ if (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment >= 2000 {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = 13
+ } else {
+ // FTS5_MAX_SEGMENT is currently defined as 2000. So the following
+ // array is 63 elements, or 252 bytes, in size.
+ // var aUsed [63]U32 at bp, 252
+
+ var iLvl int32
+ var iSeg int32
+ var i int32
+ var mask U32
+ libc.Xmemset(tls, bp /* &aUsed[0] */, 0, uint64(unsafe.Sizeof([63]U32{})))
+ for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; iLvl++ {
+ for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*16)).FnSeg; iSeg++ {
+ var iId int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*16)).FaSeg + uintptr(iSeg)*12)).FiSegid
+ if (iId <= 2000) && (iId > 0) {
+ *(*U32)(unsafe.Pointer(bp /* &aUsed */ + uintptr(((iId-1)/32))*4)) |= (U32(U32(1)) << ((iId - 1) % 32))
+ }
+ }
+ }
+
+ for i = 0; *(*U32)(unsafe.Pointer(bp /* &aUsed[0] */ + uintptr(i)*4)) == 0xFFFFFFFF; i++ {
+ }
+ mask = *(*U32)(unsafe.Pointer(bp /* &aUsed[0] */ + uintptr(i)*4))
+ for iSegid = 0; (mask & (U32(U32(1)) << iSegid)) != 0; iSegid++ {
+ }
+ iSegid = iSegid + (1 + (i * 32))
+ }
+ }
+
+ return iSegid
+}
+
+// Discard all data currently cached in the hash-tables.
+func fts5IndexDiscardData(tls *libc.TLS, p uintptr) { /* sqlite3.c:219982:13: */
+
+ if (*Fts5Index)(unsafe.Pointer(p)).FpHash != 0 {
+ sqlite3Fts5HashClear(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash)
+ (*Fts5Index)(unsafe.Pointer(p)).FnPendingData = 0
+ }
+}
+
+// Return the size of the prefix, in bytes, that buffer
+// (pNew/<length-unknown>) shares with buffer (pOld/nOld).
+//
+// Buffer (pNew/<length-unknown>) is guaranteed to be greater
+// than buffer (pOld/nOld).
+func fts5PrefixCompress(tls *libc.TLS, nOld int32, pOld uintptr, pNew uintptr) int32 { /* sqlite3.c:219997:12: */
+ var i int32
+ for i = 0; i < nOld; i++ {
+ if int32(*(*U8)(unsafe.Pointer(pOld + uintptr(i)))) != int32(*(*U8)(unsafe.Pointer(pNew + uintptr(i)))) {
+ break
+ }
+ }
+ return i
+}
+
+func fts5WriteDlidxClear(tls *libc.TLS, p uintptr, pWriter uintptr, bFlush int32) { /* sqlite3.c:220005:13: */
+ var i int32
+
+ for i = 0; i < (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx; i++ {
+ var pDlidx uintptr = ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32)
+ if (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn == 0 {
+ break
+ }
+ if bFlush != 0 {
+
+ fts5DataWrite(tls, p,
+ (((((I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)) << ((31 + 5) + 1)) + (I64((int64(1))) << (31 + 5))) + ((I64(i)) << (31))) + (I64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno))),
+ (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fp, (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn)
+ }
+ sqlite3Fts5BufferZero(tls, (pDlidx + 16 /* &.buf */))
+ (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid = 0
+ }
+}
+
+// Grow the pWriter->aDlidx[] array to at least nLvl elements in size.
+// Any new array elements are zeroed before returning.
+func fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) int32 { /* sqlite3.c:220031:12: */
+ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (nLvl >= (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx) {
+ var aDlidx uintptr = Xsqlite3_realloc64(tls,
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, (uint64(uint64(unsafe.Sizeof(Fts5DlidxWriter{})) * uint64(nLvl))))
+ if aDlidx == uintptr(0) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = 7
+ } else {
+ var nByte Size_t = (uint64(unsafe.Sizeof(Fts5DlidxWriter{})) * (uint64(nLvl - (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx)))
+ libc.Xmemset(tls, (aDlidx + uintptr((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx)*32), 0, nByte)
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx = aDlidx
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx = nLvl
+ }
+ }
+ return (*Fts5Index)(unsafe.Pointer(p)).Frc
+}
+
+// If the current doclist-index accumulating in pWriter->aDlidx[] is large
+// enough, flush it to disk and return 1. Otherwise discard it and return
+// zero.
+func fts5WriteFlushDlidx(tls *libc.TLS, p uintptr, pWriter uintptr) int32 { /* sqlite3.c:220057:12: */
+ var bFlag int32 = 0
+
+ // If there were FTS5_MIN_DLIDX_SIZE or more empty leaf pages written
+ // to the database, also write the doclist-index to disk.
+ if ((*Fts5DlidxWriter)(unsafe.Pointer((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx+uintptr(0)*32)).Fbuf.Fn > 0) && ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnEmpty >= 4) {
+ bFlag = 1
+ }
+ fts5WriteDlidxClear(tls, p, pWriter, bFlag)
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnEmpty = 0
+ return bFlag
+}
+
+// This function is called whenever processing of the doclist for the
+// last term on leaf page (pWriter->iBtPage) is completed.
+//
+// The doclist-index for that term is currently stored in-memory within the
+// Fts5SegWriter.aDlidx[] array. If it is large enough, this function
+// writes it out to disk. Or, if it is too small to bother with, discards
+// it.
+//
+// Fts5SegWriter.btterm currently contains the first term on page iBtPage.
+func fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:220081:13: */
+ var bFlag int32
+
+ if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage == 0 {
+ return
+ }
+ bFlag = fts5WriteFlushDlidx(tls, p, pWriter)
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ var z uintptr = func() uintptr {
+ if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn > 0 {
+ return (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fp
+ }
+ return ts + 781 /* "" */
+ }()
+ // The following was already done in fts5WriteInit():
+ // sqlite3_bind_int(p->pIdxWriter, 1, pWriter->iSegid);
+ Xsqlite3_bind_blob(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter, 2, z, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn, uintptr(0))
+ Xsqlite3_bind_int64(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter, 3, (I64(bFlag) + (I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage) << 1)))
+ Xsqlite3_step(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter)
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter)
+ Xsqlite3_bind_null(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter, 2)
+ }
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage = 0
+}
+
+// This is called once for each leaf page except the first that contains
+// at least one term. Argument (nTerm/pTerm) is the split-key - a term that
+// is larger than all terms written to earlier leaves, and equal to or
+// smaller than the first term on the new leaf.
+//
+// If an error occurs, an error code is left in Fts5Index.rc. If an error
+// has already occurred when this function is called, it is a no-op.
+func fts5WriteBtreeTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:220110:13: */
+ fts5WriteFlushBtree(tls, p, pWriter)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), (pWriter + 96 /* &.btterm */), nTerm, pTerm)
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage = (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fpgno
+ }
+}
+
+// This function is called when flushing a leaf page that contains no
+// terms at all to disk.
+func fts5WriteBtreeNoTerm(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:220126:13: */
+ // If there were no rowids on the leaf page either and the doclist-index
+ // has already been started, append an 0x00 byte to it.
+ if ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0) && ((*Fts5DlidxWriter)(unsafe.Pointer((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx+uintptr(0)*32)).Fbuf.Fn > 0) {
+ var pDlidx uintptr = ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(0)*32)
+
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (pDlidx + 16 /* &.buf */), int64(0))
+ }
+
+ // Increment the "number of sequential leaves without a term" counter.
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnEmpty++
+}
+
+func fts5DlidxExtractFirstRowid(tls *libc.TLS, pBuf uintptr) I64 { /* sqlite3.c:220142:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ // var iRowid I64 at bp, 8
+
+ var iOff int32
+
+ iOff = (1 + int32(sqlite3Fts5GetVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(1)), bp /* &iRowid */)))
+ sqlite3Fts5GetVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(iOff)), bp /* &iRowid */)
+ return *(*I64)(unsafe.Pointer(bp /* iRowid */))
+}
+
+// Rowid iRowid has just been appended to the current leaf page. It is the
+// first on the page. This function appends an appropriate entry to the current
+// doclist-index.
+func fts5WriteDlidxAppend(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:220156:13: */
+ var i int32
+ var bDone int32 = 0
+
+ for i = 0; ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (bDone == 0); i++ {
+ var iVal I64
+ var pDlidx uintptr = ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32)
+
+ if (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
+ // The current doclist-index page is full. Write it to disk and push
+ // a copy of iRowid (which will become the first rowid on the next
+ // doclist-index leaf page) up into the next level of the b-tree
+ // hierarchy. If the node being flushed is currently the root node,
+ // also push its first rowid upwards.
+ *(*U8)(unsafe.Pointer((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fp + uintptr(0))) = U8(0x01) // Not the root node
+ fts5DataWrite(tls, p,
+ (((((I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)) << ((31 + 5) + 1)) + (I64((int64(1))) << (31 + 5))) + ((I64(i)) << (31))) + (I64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno))),
+ (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fp, (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fbuf.Fn)
+ fts5WriteDlidxGrow(tls, p, pWriter, (i + 2))
+ pDlidx = ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32)
+ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && ((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx+uintptr(1)*32)).Fbuf.Fn == 0) {
+ var iFirst I64 = fts5DlidxExtractFirstRowid(tls, (pDlidx + 16 /* &.buf */))
+
+ // This was the root node. Push its first rowid up to the new root.
+ (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx + uintptr(1)*32)).Fpgno = (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (pDlidx + uintptr(1)*32 + 16 /* &.buf */), int64(0))
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (pDlidx + uintptr(1)*32 + 16 /* &.buf */), int64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno))
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (pDlidx + uintptr(1)*32 + 16 /* &.buf */), iFirst)
+ (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx + uintptr(1)*32)).FbPrevValid = 1
+ (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx + uintptr(1)*32)).FiPrev = iFirst
+ }
+
+ sqlite3Fts5BufferZero(tls, (pDlidx + 16 /* &.buf */))
+ (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid = 0
+ (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).Fpgno++
+ } else {
+ bDone = 1
+ }
+
+ if (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid != 0 {
+ iVal = (iRowid - (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FiPrev)
+ } else {
+ var iPgno I64 = func() int64 {
+ if i == 0 {
+ return int64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fpgno)
+ }
+ return int64((*Fts5DlidxWriter)(unsafe.Pointer(pDlidx + libc.UintptrFromInt32(-1)*32)).Fpgno)
+ }()
+
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (pDlidx + 16 /* &.buf */), libc.BoolInt64(!(bDone != 0)))
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (pDlidx + 16 /* &.buf */), iPgno)
+ iVal = iRowid
+ }
+
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (pDlidx + 16 /* &.buf */), iVal)
+ (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FbPrevValid = 1
+ (*Fts5DlidxWriter)(unsafe.Pointer(pDlidx)).FiPrev = iRowid
+ }
+}
+
+func fts5WriteFlushLeaf(tls *libc.TLS, p uintptr, pWriter uintptr) { /* sqlite3.c:220216:13: */
+ var pPage uintptr = (pWriter + 8 /* &.writer */)
+ var iRowid I64
+
+ // Set the szLeaf header field.
+
+ fts5PutU16(tls, ((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp + uintptr(2)), U16((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn))
+
+ if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage != 0 {
+ // No term was written to this page.
+
+ fts5WriteBtreeNoTerm(tls, p, pWriter)
+ } else {
+ // Append the pgidx to the page buffer. Set the szLeaf header field.
+ sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), (pPage + 8 /* &.buf */), uint32((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn), (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fp)
+ }
+
+ // Write the page out to disk
+ iRowid = (((((I64((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (I64((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgno)))
+ fts5DataWrite(tls, p, iRowid, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn)
+
+ // Initialize the next page.
+ sqlite3Fts5BufferZero(tls, (pPage + 8 /* &.buf */))
+ sqlite3Fts5BufferZero(tls, (pPage + 24 /* &.pgidx */))
+ sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), (pPage + 8 /* &.buf */), uint32(4), uintptr(unsafe.Pointer(&zero)))
+ (*Fts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx = 0
+ (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgno++
+
+ // Increase the leaves written counter
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnLeafWritten++
+
+ // The new leaf holds no terms or rowids
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage = U8(1)
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage = U8(1)
+}
+
+var zero = [4]U8{U8(0x00), U8(0x00), U8(0x00), U8(0x00)} /* sqlite3.c:220217:19 */
+
+// Append term pTerm/nTerm to the segment being written by the writer passed
+// as the second argument.
+//
+// If an error occurs, set the Fts5Index.rc error code. If an error has
+// already occurred, this function is a no-op.
+func fts5WriteAppendTerm(tls *libc.TLS, p uintptr, pWriter uintptr, nTerm int32, pTerm uintptr) { /* sqlite3.c:220262:13: */
+ var nPrefix int32 // Bytes of prefix compression for term
+ var pPage uintptr = (pWriter + 8 /* &.writer */)
+ var pPgidx uintptr = (pWriter + 8 /* &.writer */ + 24 /* &.pgidx */)
+ var nMin int32 = func() int32 {
+ if ((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fn) < (nTerm) {
+ return (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fn
+ }
+ return nTerm
+ }()
+
+ // If the current leaf page is full, flush it to disk.
+ if ((((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn + (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn) + nTerm) + 2) >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
+ if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn > 4 {
+ fts5WriteFlushLeaf(tls, p, pWriter)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ return
+ }
+ }
+ if !(((U32((*Fts5Buffer)(unsafe.Pointer((pPage + 8 /* &.buf */))).Fn)) + (U32(nTerm + 20))) <= (U32((*Fts5Buffer)(unsafe.Pointer((pPage + 8 /* &.buf */))).FnSpace))) {
+ sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), (pPage + 8 /* &.buf */), (uint32((nTerm + 20) + (*Fts5Buffer)(unsafe.Pointer((pPage + 8 /* &.buf */))).Fn)))
+ }
+ }
+
+ // TODO1: Updating pgidx here.
+ *(*int32)(unsafe.Pointer(pPgidx + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls,
+ ((*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn)), (uint64((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn - (*Fts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx))))
+ (*Fts5PageWriter)(unsafe.Pointer(pPage)).FiPrevPgidx = (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn
+
+ if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage != 0 {
+ nPrefix = 0
+ if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgno != 1 {
+ // This is the first term on a leaf that is not the leftmost leaf in
+ // the segment b-tree. In this case it is necessary to add a term to
+ // the b-tree hierarchy that is (a) larger than the largest term
+ // already written to the segment and (b) smaller than or equal to
+ // this term. In other words, a prefix of (pTerm/nTerm) that is one
+ // byte longer than the longest prefix (pTerm/nTerm) shares with the
+ // previous term.
+ //
+ // Usually, the previous term is available in pPage->term. The exception
+ // is if this is the first term written in an incremental-merge step.
+ // In this case the previous term is not available, so just write a
+ // copy of (pTerm/nTerm) into the parent node. This is slightly
+ // inefficient, but still correct.
+ var n int32 = nTerm
+ if (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fn != 0 {
+ n = (1 + fts5PrefixCompress(tls, nMin, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fp, pTerm))
+ }
+ fts5WriteBtreeTerm(tls, p, pWriter, n, pTerm)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ return
+ }
+ pPage = (pWriter + 8 /* &.writer */)
+ }
+ } else {
+ nPrefix = fts5PrefixCompress(tls, nMin, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fterm.Fp, pTerm)
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (pPage + 8 /* &.buf */), int64(nPrefix))
+ }
+
+ // Append the number of bytes of new data, then the term data itself
+ // to the page.
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (pPage + 8 /* &.buf */), (int64(nTerm - nPrefix)))
+ sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), (pPage + 8 /* &.buf */), (uint32(nTerm - nPrefix)), (pTerm + uintptr(nPrefix)))
+
+ // Update the Fts5PageWriter.term field.
+ sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), (pPage + 40 /* &.term */), nTerm, pTerm)
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage = U8(0)
+
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage = U8(0)
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInDoclist = U8(1)
+
+ (*Fts5DlidxWriter)(unsafe.Pointer((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(0)*32)).Fpgno = (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgno
+}
+
+// Append a rowid and position-list size field to the writers output.
+func fts5WriteAppendRowid(tls *libc.TLS, p uintptr, pWriter uintptr, iRowid I64) { /* sqlite3.c:220343:13: */
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ var pPage uintptr = (pWriter + 8 /* &.writer */)
+
+ if ((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn + (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn) >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz {
+ fts5WriteFlushLeaf(tls, p, pWriter)
+ }
+
+ // If this is to be the first rowid written to the page, set the
+ // rowid-pointer in the page-header. Also append a value to the dlidx
+ // buffer, in case a doclist-index is required.
+ if (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0 {
+ fts5PutU16(tls, (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fp, U16((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn))
+ fts5WriteDlidxAppend(tls, p, pWriter, iRowid)
+ }
+
+ // Write the rowid.
+ if ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInDoclist != 0) || ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage != 0) {
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (pPage + 8 /* &.buf */), iRowid)
+ } else {
+
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (pPage + 8 /* &.buf */), (iRowid - (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiPrevRowid))
+ }
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiPrevRowid = iRowid
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInDoclist = U8(0)
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstRowidInPage = U8(0)
+ }
+}
+
+func fts5WriteAppendPoslistData(tls *libc.TLS, p uintptr, pWriter uintptr, aData uintptr, nData int32) { /* sqlite3.c:220376:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pPage uintptr = (pWriter + 8 /* &.writer */)
+ var a uintptr = aData
+ var n int32 = nData
+
+ for ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) &&
+ ((((*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn + (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn) + n) >= (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz) {
+ var nReq int32 = (((*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz - (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fbuf.Fn) - (*Fts5PageWriter)(unsafe.Pointer(pPage)).Fpgidx.Fn)
+ var nCopy int32 = 0
+ for nCopy < nReq {
+ // var dummy I64 at bp, 8
+
+ nCopy = nCopy + (int32(sqlite3Fts5GetVarint(tls, (a + uintptr(nCopy)), bp /* &dummy */)))
+ }
+ sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), (pPage + 8 /* &.buf */), uint32(nCopy), a)
+ a += uintptr(nCopy)
+ n = n - (nCopy)
+ fts5WriteFlushLeaf(tls, p, pWriter)
+ }
+ if n > 0 {
+ sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), (pPage + 8 /* &.buf */), uint32(n), a)
+ }
+}
+
+// Flush any data cached by the writer object to the database. Free any
+// allocations associated with the writer.
+func fts5WriteFinish(tls *libc.TLS, p uintptr, pWriter uintptr, pnLeaf uintptr) { /* sqlite3.c:220410:13: */
+ var i int32
+ var pLeaf uintptr = (pWriter + 8 /* &.writer */)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+
+ if (*Fts5PageWriter)(unsafe.Pointer(pLeaf)).Fbuf.Fn > 4 {
+ fts5WriteFlushLeaf(tls, p, pWriter)
+ }
+ *(*int32)(unsafe.Pointer(pnLeaf)) = ((*Fts5PageWriter)(unsafe.Pointer(pLeaf)).Fpgno - 1)
+ if (*Fts5PageWriter)(unsafe.Pointer(pLeaf)).Fpgno > 1 {
+ fts5WriteFlushBtree(tls, p, pWriter)
+ }
+ }
+ sqlite3Fts5BufferFree(tls, (pLeaf + 40 /* &.term */))
+ sqlite3Fts5BufferFree(tls, (pLeaf + 8 /* &.buf */))
+ sqlite3Fts5BufferFree(tls, (pLeaf + 24 /* &.pgidx */))
+ sqlite3Fts5BufferFree(tls, (pWriter + 96 /* &.btterm */))
+
+ for i = 0; i < (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx; i++ {
+ sqlite3Fts5BufferFree(tls, ((*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx + uintptr(i)*32 + 16 /* &.buf */))
+ }
+ Xsqlite3_free(tls, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx)
+}
+
+func fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { /* sqlite3.c:220438:13: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var nBuffer int32 = ((*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz + 20)
+
+ libc.Xmemset(tls, pWriter, 0, uint64(unsafe.Sizeof(Fts5SegWriter{})))
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid = iSegid
+
+ fts5WriteDlidxGrow(tls, p, pWriter, 1)
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fpgno = 1
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FbFirstTermInPage = U8(1)
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiBtPage = 1
+
+ // Grow the two buffers to pgsz + padding bytes in size.
+ sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), (pWriter + 8 /* &.writer */ + 24 /* &.pgidx */), uint32(nBuffer))
+ sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), (pWriter + 8 /* &.writer */ + 8 /* &.buf */), uint32(nBuffer))
+
+ if (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) {
+ var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
+ fts5IndexPrepareStmt(tls, p, (p + 80 /* &.pIdxWriter */), Xsqlite3_mprintf(tls,
+ ts+37935, /* "INSERT INTO '%q'..." */
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName)))
+ }
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ // Initialize the 4-byte leaf-page header to 0x00.
+ libc.Xmemset(tls, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fbuf.Fp, 0, uint64(4))
+ (*Fts5SegWriter)(unsafe.Pointer(pWriter)).Fwriter.Fbuf.Fn = 4
+
+ // Bind the current output segment id to the index-writer. This is an
+ // optimization over binding the same value over and over as rows are
+ // inserted into %_idx by the current writer.
+ Xsqlite3_bind_int(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter, 1, (*Fts5SegWriter)(unsafe.Pointer(pWriter)).FiSegid)
+ }
+}
+
+// Iterator pIter was used to iterate through the input segments of on an
+// incremental merge operation. This function is called if the incremental
+// merge step has finished but the input has not been completely exhausted.
+func fts5TrimSegments(tls *libc.TLS, p uintptr, pIter uintptr) { /* sqlite3.c:220485:13: */
+ bp := tls.Alloc(20)
+ defer tls.Free(20)
+
+ var i int32
+ // var buf Fts5Buffer at bp, 16
+
+ libc.Xmemset(tls, bp /* &buf */, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
+ for i = 0; (i < (*Fts5Iter)(unsafe.Pointer(pIter)).FnSeg) && ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0); i++ {
+ var pSeg uintptr = ((pIter + 96 /* &.aSeg */) + uintptr(i)*120)
+ if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg == uintptr(0) {
+ } else if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf == uintptr(0) {
+ // All keys from this input segment have been transfered to the output.
+ // Set both the first and last page-numbers to 0 to indicate that the
+ // segment is now empty.
+ (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FpgnoLast = 0
+ (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FpgnoFirst = 0
+ } else {
+ var iOff int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafOffset // Offset on new first leaf page
+ var iLeafRowid I64
+ var pData uintptr
+ var iId int32 = (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FiSegid
+ *(*[4]U8)(unsafe.Pointer(bp + 16 /* aHdr */)) = [4]U8{U8(0x00), U8(0x00), U8(0x00), U8(0x00)}
+
+ iLeafRowid = (((((I64(iId)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (I64((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno)))
+ pData = fts5LeafRead(tls, p, iLeafRowid)
+ if pData != 0 {
+ if iOff > (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf {
+ // This can occur if the pages that the segments occupy overlap - if
+ // a single page has been assigned to more than one segment. In
+ // this case a prior iteration of this loop may have corrupted the
+ // segment currently being trimmed.
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ } else {
+ sqlite3Fts5BufferZero(tls, bp /* &buf */)
+ if !(((U32((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn)) + (U32((*Fts5Data)(unsafe.Pointer(pData)).Fnn))) <= (U32((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).FnSpace))) {
+ sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), bp /* &buf */, (uint32(((*Fts5Data)(unsafe.Pointer(pData)).Fnn) + (*Fts5Buffer)(unsafe.Pointer((bp /* &buf */))).Fn)))
+ }
+ sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), bp /* &buf */, uint32(unsafe.Sizeof([4]U8{})), bp+16 /* &aHdr[0] */)
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), bp /* &buf */, int64((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn))
+ sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), bp /* &buf */, uint32((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn), (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp)
+ sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), bp /* &buf */, (uint32((*Fts5Data)(unsafe.Pointer(pData)).FszLeaf - iOff)), ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr(iOff)))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ // Set the szLeaf field
+ fts5PutU16(tls, ((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp + uintptr(2)), U16((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn))
+ }
+
+ // Set up the new page-index array
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), bp /* &buf */, int64(4))
+ if (((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiLeafPgno == (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno) &&
+ ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist < (*Fts5Data)(unsafe.Pointer(pData)).FszLeaf)) &&
+ ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff <= (*Fts5Data)(unsafe.Pointer(pData)).Fnn) {
+ var nDiff int32 = ((*Fts5Data)(unsafe.Pointer(pData)).FszLeaf - (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiEndofDoclist)
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), bp /* &buf */, (int64((((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn - 1) - nDiff) - 4)))
+ sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), bp /* &buf */, (uint32((*Fts5Data)(unsafe.Pointer(pData)).Fnn - (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff)), ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr((*Fts5SegIter)(unsafe.Pointer(pSeg)).FiPgidxOff)))
+ }
+
+ (*Fts5StructureSegment)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpSeg)).FpgnoFirst = (*Fts5SegIter)(unsafe.Pointer(pSeg)).FiTermLeafPgno
+ fts5DataDelete(tls, p, (((((I64(iId)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (int64(1))), iLeafRowid)
+ fts5DataWrite(tls, p, iLeafRowid, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn)
+ }
+ fts5DataRelease(tls, pData)
+ }
+ }
+ }
+ sqlite3Fts5BufferFree(tls, bp /* &buf */)
+}
+
+func fts5MergeChunkCallback(tls *libc.TLS, p uintptr, pCtx uintptr, pChunk uintptr, nChunk int32) { /* sqlite3.c:220551:13: */
+ var pWriter uintptr = pCtx
+ fts5WriteAppendPoslistData(tls, p, pWriter, pChunk, nChunk)
+}
+
+//
+func fts5IndexMergeLevel(tls *libc.TLS, p uintptr, ppStruct uintptr, iLvl int32, pnRem uintptr) { /* sqlite3.c:220563:13: */
+ bp := tls.Alloc(148)
+ defer tls.Free(148)
+
+ var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct))
+ var pLvl uintptr = ((pStruct + 24 /* &.aLevel */) + uintptr(iLvl)*16)
+ var pLvlOut uintptr
+ *(*uintptr)(unsafe.Pointer(bp + 136 /* pIter */)) = uintptr(0) // Iterator to read input data
+ var nRem int32
+ if pnRem != 0 {
+ nRem = *(*int32)(unsafe.Pointer(pnRem))
+ } else {
+ nRem = 0
+ } // Output leaf pages left to write
+ var nInput int32 // Number of input segments
+ // var writer Fts5SegWriter at bp, 120
+ // Writer object
+ var pSeg uintptr // Output segment
+ // var term Fts5Buffer at bp+120, 16
+
+ var bOldest int32 // True if the output segment is the oldest
+ var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail
+ var flags int32 = 0x0020
+ var bTermWritten int32 = 0 // True if current term already output
+
+ libc.Xmemset(tls, bp /* &writer */, 0, uint64(unsafe.Sizeof(Fts5SegWriter{})))
+ libc.Xmemset(tls, bp+120 /* &term */, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
+ if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 {
+ pLvlOut = ((pStruct + 24 /* &.aLevel */) + uintptr((iLvl+1))*16)
+
+ nInput = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge
+ pSeg = ((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FaSeg + uintptr(((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg-1))*12)
+
+ fts5WriteInit(tls, p, bp /* &writer */, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)
+ (*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).Fwriter.Fpgno = ((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast + 1)
+ (*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).FiBtPage = 0
+ } else {
+ var iSegid int32 = fts5AllocateSegid(tls, p, pStruct)
+
+ // Extend the Fts5Structure object as required to ensure the output
+ // segment exists.
+ if iLvl == ((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel - 1) {
+ fts5StructureAddLevel(tls, (p + 52 /* &.rc */), ppStruct)
+ pStruct = *(*uintptr)(unsafe.Pointer(ppStruct))
+ }
+ fts5StructureExtendLevel(tls, (p + 52 /* &.rc */), pStruct, (iLvl + 1), 1, 0)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ return
+ }
+ pLvl = ((pStruct + 24 /* &.aLevel */) + uintptr(iLvl)*16)
+ pLvlOut = ((pStruct + 24 /* &.aLevel */) + uintptr((iLvl+1))*16)
+
+ fts5WriteInit(tls, p, bp /* &writer */, iSegid)
+
+ // Add the new segment to the output level
+ pSeg = ((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FaSeg + uintptr((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg)*12)
+ (*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg++
+ (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst = 1
+ (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid = iSegid
+ (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment++
+
+ // Read input from all segments in the input level
+ nInput = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg
+ }
+ bOldest = (libc.Bool32(((*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg == 1) && ((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel == (iLvl + 2))))
+
+ for fts5MultiIterNew(tls, p, pStruct, flags, uintptr(0), uintptr(0), 0, iLvl, nInput, bp+136 /* &pIter */); fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 136 /* pIter */))) == 0; fts5MultiIterNext(tls, p, *(*uintptr)(unsafe.Pointer(bp + 136 /* pIter */)), 0, int64(0)) {
+ var pSegIter uintptr = ((*(*uintptr)(unsafe.Pointer(bp + 136 /* pIter */)) + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136 /* pIter */)))).FaFirst+uintptr(1)*4)).FiFirst)*120)
+ var nPos int32 // position-list size field value
+ // var nTerm int32 at bp+144, 4
+
+ var pTerm uintptr
+
+ pTerm = fts5MultiIterTerm(tls, *(*uintptr)(unsafe.Pointer(bp + 136 /* pIter */)), bp+144 /* &nTerm */)
+ if (*(*int32)(unsafe.Pointer(bp + 144 /* nTerm */)) != (*Fts5Buffer)(unsafe.Pointer(bp+120 /* &term */)).Fn) || (func() int32 {
+ if (*(*int32)(unsafe.Pointer(bp + 144 /* nTerm */))) == 0 {
+ return 0
+ }
+ return libc.Xmemcmp(tls, pTerm, (*Fts5Buffer)(unsafe.Pointer(bp+120 /* &term */)).Fp, uint64(*(*int32)(unsafe.Pointer(bp + 144 /* nTerm */))))
+ }() != 0) {
+ if (pnRem != 0) && ((*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).FnLeafWritten > nRem) {
+ break
+ }
+ sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), bp+120 /* &term */, *(*int32)(unsafe.Pointer(bp + 144 /* nTerm */)), pTerm)
+ bTermWritten = 0
+ }
+
+ // Check for key annihilation.
+ if ((*Fts5SegIter)(unsafe.Pointer(pSegIter)).FnPos == 0) && ((bOldest != 0) || (int32((*Fts5SegIter)(unsafe.Pointer(pSegIter)).FbDel) == 0)) {
+ continue
+ }
+
+ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (bTermWritten == 0) {
+ // This is a new term. Append a term to the output segment.
+ fts5WriteAppendTerm(tls, p, bp /* &writer */, *(*int32)(unsafe.Pointer(bp + 144 /* nTerm */)), pTerm)
+ bTermWritten = 1
+ }
+
+ // Append the rowid to the output
+ // WRITEPOSLISTSIZE
+ fts5WriteAppendRowid(tls, p, bp /* &writer */, fts5MultiIterRowid(tls, *(*uintptr)(unsafe.Pointer(bp + 136 /* pIter */))))
+
+ if eDetail == 1 {
+ if (*Fts5SegIter)(unsafe.Pointer(pSegIter)).FbDel != 0 {
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (bp /* &writer */ + 8 /* &.writer */ + 8 /* &.buf */), int64(0))
+ if (*Fts5SegIter)(unsafe.Pointer(pSegIter)).FnPos > 0 {
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (bp /* &writer */ + 8 /* &.writer */ + 8 /* &.buf */), int64(0))
+ }
+ }
+ } else {
+ // Append the position-list data to the output
+ nPos = (((*Fts5SegIter)(unsafe.Pointer(pSegIter)).FnPos * 2) + int32((*Fts5SegIter)(unsafe.Pointer(pSegIter)).FbDel))
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), (bp /* &writer */ + 8 /* &.writer */ + 8 /* &.buf */), int64(nPos))
+ fts5ChunkIterate(tls, p, pSegIter, bp /* &writer */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, int32)
+ }{fts5MergeChunkCallback})))
+ }
+ }
+
+ // Flush the last leaf page to disk. Set the output segment b-tree height
+ // and last leaf page number at the same time.
+ fts5WriteFinish(tls, p, bp /* &writer */, (pSeg + 8 /* &.pgnoLast */))
+
+ if fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 136 /* pIter */))) != 0 {
+ var i int32
+
+ // Remove the redundant segments from the %_data table
+ for i = 0; i < nInput; i++ {
+ fts5DataRemoveSegment(tls, p, (*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg+uintptr(i)*12)).FiSegid)
+ }
+
+ // Remove the redundant segments from the input level
+ if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg != nInput {
+ var nMove int32 = (int32((uint64((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg - nInput)) * uint64(unsafe.Sizeof(Fts5StructureSegment{}))))
+ libc.Xmemmove(tls, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg, ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(nInput)*12), uint64(nMove))
+ }
+ *(*int32)(unsafe.Pointer(pStruct + 16 /* &.nSegment */)) -= (nInput)
+ *(*int32)(unsafe.Pointer(pLvl + 4 /* &.nSeg */)) -= (nInput)
+ (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge = 0
+ if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast == 0 {
+ (*Fts5StructureLevel)(unsafe.Pointer(pLvlOut)).FnSeg--
+ (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment--
+ }
+ } else {
+
+ fts5TrimSegments(tls, p, *(*uintptr)(unsafe.Pointer(bp + 136 /* pIter */)))
+ (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge = nInput
+ }
+
+ fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 136 /* pIter */)))
+ sqlite3Fts5BufferFree(tls, bp+120 /* &term */)
+ if pnRem != 0 {
+ *(*int32)(unsafe.Pointer(pnRem)) -= ((*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).FnLeafWritten)
+ }
+}
+
+// Do up to nPg pages of automerge work on the index.
+//
+// Return true if any changes were actually made, or false otherwise.
+func fts5IndexMerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nPg int32, nMin int32) int32 { /* sqlite3.c:220712:12: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ *(*int32)(unsafe.Pointer(bp + 8 /* nRem */)) = nPg
+ var bRet int32 = 0
+ *(*uintptr)(unsafe.Pointer(bp /* pStruct */)) = *(*uintptr)(unsafe.Pointer(ppStruct))
+ for (*(*int32)(unsafe.Pointer(bp + 8 /* nRem */)) > 0) && ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) {
+ var iLvl int32 // To iterate through levels
+ var iBestLvl int32 = 0 // Level offering the most input segments
+ var nBest int32 = 0 // Number of input segments on best level
+
+ // Set iBestLvl to the level to read input segments from.
+
+ for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pStruct */)))).FnLevel; iLvl++ {
+ var pLvl uintptr = ((*(*uintptr)(unsafe.Pointer(bp /* pStruct */)) + 24 /* &.aLevel */) + uintptr(iLvl)*16)
+ if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 {
+ if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge > nBest {
+ iBestLvl = iLvl
+ nBest = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge
+ }
+ break
+ }
+ if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg > nBest {
+ nBest = (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg
+ iBestLvl = iLvl
+ }
+ }
+
+ // If nBest is still 0, then the index must be empty.
+
+ if (nBest < nMin) && ((*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pStruct */))+24 /* &.aLevel */)+uintptr(iBestLvl)*16)).FnMerge == 0) {
+ break
+ }
+ bRet = 1
+ fts5IndexMergeLevel(tls, p, bp /* &pStruct */, iBestLvl, bp+8 /* &nRem */)
+ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && ((*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pStruct */))+24 /* &.aLevel */)+uintptr(iBestLvl)*16)).FnMerge == 0) {
+ fts5StructurePromote(tls, p, (iBestLvl + 1), *(*uintptr)(unsafe.Pointer(bp /* pStruct */)))
+ }
+ }
+ *(*uintptr)(unsafe.Pointer(ppStruct)) = *(*uintptr)(unsafe.Pointer(bp /* pStruct */))
+ return bRet
+}
+
+// A total of nLeaf leaf pages of data has just been flushed to a level-0
+// segment. This function updates the write-counter accordingly and, if
+// necessary, performs incremental merge work.
+//
+// If an error occurs, set the Fts5Index.rc error code. If an error has
+// already occurred, this function is a no-op.
+func fts5IndexAutomerge(tls *libc.TLS, p uintptr, ppStruct uintptr, nLeaf int32) { /* sqlite3.c:220771:13: */
+ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && ((*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnAutomerge > 0) {
+ var pStruct uintptr = *(*uintptr)(unsafe.Pointer(ppStruct))
+ var nWrite U64 // Initial value of write-counter
+ var nWork int32 // Number of work-quanta to perform
+ var nRem int32 // Number of leaf pages left to write
+
+ // Update the write-counter. While doing so, set nWork.
+ nWrite = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter
+ nWork = (int32(((nWrite + U64(nLeaf)) / U64((*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit)) - (nWrite / U64((*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit))))
+ *(*U64)(unsafe.Pointer(pStruct + 8 /* &.nWriteCounter */)) += (U64(nLeaf))
+ nRem = (((*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit * nWork) * (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel)
+
+ fts5IndexMerge(tls, p, ppStruct, nRem, (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnAutomerge)
+ }
+}
+
+func fts5IndexCrisismerge(tls *libc.TLS, p uintptr, ppStruct uintptr) { /* sqlite3.c:220792:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var nCrisis int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnCrisisMerge
+ *(*uintptr)(unsafe.Pointer(bp /* pStruct */)) = *(*uintptr)(unsafe.Pointer(ppStruct))
+ var iLvl int32 = 0
+
+ for ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && ((*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pStruct */))+24 /* &.aLevel */)+uintptr(iLvl)*16)).FnSeg >= nCrisis) {
+ fts5IndexMergeLevel(tls, p, bp /* &pStruct */, iLvl, uintptr(0))
+
+ fts5StructurePromote(tls, p, (iLvl + 1), *(*uintptr)(unsafe.Pointer(bp /* pStruct */)))
+ iLvl++
+ }
+ *(*uintptr)(unsafe.Pointer(ppStruct)) = *(*uintptr)(unsafe.Pointer(bp /* pStruct */))
+}
+
+func fts5IndexReturn(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:220810:12: */
+ var rc int32 = (*Fts5Index)(unsafe.Pointer(p)).Frc
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = 0
+ return rc
+}
+
+type Fts5FlushCtx1 = struct {
+ FpIdx uintptr
+ Fwriter Fts5SegWriter
+}
+
+type Fts5FlushCtx = Fts5FlushCtx1 /* sqlite3.c:220816:29 */
+
+// Buffer aBuf[] contains a list of varints, all small enough to fit
+// in a 32-bit integer. Return the size of the largest prefix of this
+// list nMax bytes or less in size.
+func fts5PoslistPrefix(tls *libc.TLS, aBuf uintptr, nMax int32) int32 { /* sqlite3.c:220827:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var ret int32
+ // var dummy U32 at bp, 4
+
+ ret = sqlite3Fts5GetVarint32(tls, aBuf, bp /* &dummy */)
+ if ret < nMax {
+ for 1 != 0 {
+ var i int32 = sqlite3Fts5GetVarint32(tls, (aBuf + uintptr(ret)), bp /* &dummy */)
+ if (ret + i) > nMax {
+ break
+ }
+ ret = ret + (i)
+ }
+ }
+ return ret
+}
+
+// Flush the contents of in-memory hash table iHash to a new level-0
+// segment on disk. Also update the corresponding structure record.
+//
+// If an error occurs, set the Fts5Index.rc error code. If an error has
+// already occurred, this function is a no-op.
+func fts5FlushOneHash(tls *libc.TLS, p uintptr) { /* sqlite3.c:220848:13: */
+ bp := tls.Alloc(176)
+ defer tls.Free(176)
+
+ var pHash uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpHash
+ // var pStruct uintptr at bp+168, 8
+
+ var iSegid int32
+ *(*int32)(unsafe.Pointer(bp + 160 /* pgnoLast */)) = 0 // Last leaf page number in segment
+
+ // Obtain a reference to the index structure and allocate a new segment-id
+ // for the new level-0 segment.
+ *(*uintptr)(unsafe.Pointer(bp + 168 /* pStruct */)) = fts5StructureRead(tls, p)
+ iSegid = fts5AllocateSegid(tls, p, *(*uintptr)(unsafe.Pointer(bp + 168 /* pStruct */)))
+ fts5StructureInvalidate(tls, p)
+
+ if iSegid != 0 {
+ var pgsz int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).Fpgsz
+ var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail
+ var pSeg uintptr // New segment within pStruct
+ var pBuf uintptr // Buffer in which to assemble leaf page
+ var pPgidx uintptr // Buffer in which to assemble pgidx
+
+ // var writer Fts5SegWriter at bp, 120
+
+ fts5WriteInit(tls, p, bp /* &writer */, iSegid)
+
+ pBuf = (bp /* &writer */ + 8 /* &.writer */ + 8 /* &.buf */)
+ pPgidx = (bp /* &writer */ + 8 /* &.writer */ + 24 /* &.pgidx */)
+
+ // fts5WriteInit() should have initialized the buffers to (most likely)
+ // the maximum space required.
+
+ // Begin scanning through hash table entries. This loop runs once for each
+ // term/doclist currently stored within the hash table.
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashScanInit(tls, pHash, uintptr(0), 0)
+ }
+ for ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (0 == sqlite3Fts5HashScanEof(tls, pHash)) {
+ // var zTerm uintptr at bp+120, 8
+ // Buffer containing term
+ // var pDoclist uintptr at bp+128, 8
+ // Pointer to doclist for this term
+ // var nDoclist int32 at bp+136, 4
+ // Size of doclist in bytes
+
+ // Write the term for this entry to disk.
+ sqlite3Fts5HashScanEntry(tls, pHash, bp+120 /* &zTerm */, bp+128 /* &pDoclist */, bp+136 /* &nDoclist */)
+ fts5WriteAppendTerm(tls, p, bp /* &writer */, int32(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(bp + 120 /* zTerm */)))), *(*uintptr)(unsafe.Pointer(bp + 120 /* zTerm */)))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ break
+ }
+
+ if pgsz >= ((((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn) + *(*int32)(unsafe.Pointer(bp + 136 /* nDoclist */))) + 1) {
+ /* The entire doclist will fit on the current leaf. */
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)), *(*uintptr)(unsafe.Pointer(bp + 128 /* pDoclist */)), uint64(*(*int32)(unsafe.Pointer(bp + 136 /* nDoclist */))))
+ *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (*(*int32)(unsafe.Pointer(bp + 136 /* nDoclist */)))
+ }
+ } else {
+ var iRowid I64 = int64(0)
+ *(*I64)(unsafe.Pointer(bp + 144 /* iDelta */)) = int64(0)
+ var iOff int32 = 0
+
+ // The entire doclist will not fit on this leaf. The following
+ // loop iterates through the poslists that make up the current
+ // doclist.
+ for ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (iOff < *(*int32)(unsafe.Pointer(bp + 136 /* nDoclist */))) {
+ iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, (*(*uintptr)(unsafe.Pointer(bp + 128 /* pDoclist */)) + uintptr(iOff)), bp+144 /* &iDelta */)))
+ iRowid = iRowid + (*(*I64)(unsafe.Pointer(bp + 144 /* iDelta */)))
+
+ if (*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).FbFirstRowidInPage != 0 {
+ fts5PutU16(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(0)), U16((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) // first rowid on page
+ *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), uint64(iRowid)))
+ (*Fts5SegWriter)(unsafe.Pointer(bp /* &writer */)).FbFirstRowidInPage = U8(0)
+ fts5WriteDlidxAppend(tls, p, bp /* &writer */, iRowid)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ break
+ }
+ } else {
+ *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), uint64(*(*I64)(unsafe.Pointer(bp + 144 /* iDelta */)))))
+ }
+
+ if eDetail == 1 {
+ if (iOff < *(*int32)(unsafe.Pointer(bp + 136 /* nDoclist */))) && (int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128 /* pDoclist */)) + uintptr(iOff)))) == 0) {
+ *(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(libc.PostIncInt32(&(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, 1)))) = U8(0)
+ iOff++
+ if (iOff < *(*int32)(unsafe.Pointer(bp + 136 /* nDoclist */))) && (int32(*(*U8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 128 /* pDoclist */)) + uintptr(iOff)))) == 0) {
+ *(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr(libc.PostIncInt32(&(*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, 1)))) = U8(0)
+ iOff++
+ }
+ }
+ if ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn) >= pgsz {
+ fts5WriteFlushLeaf(tls, p, bp /* &writer */)
+ }
+ } else {
+ // var bDummy int32 at bp+156, 4
+
+ // var nPos int32 at bp+152, 4
+
+ var nCopy int32 = fts5GetPoslistSize(tls, (*(*uintptr)(unsafe.Pointer(bp + 128 /* pDoclist */)) + uintptr(iOff)), bp+152 /* &nPos */, bp+156 /* &bDummy */)
+ nCopy = nCopy + (*(*int32)(unsafe.Pointer(bp + 152 /* nPos */)))
+ if (((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn) + nCopy) <= pgsz {
+ /* The entire poslist will fit on the current leaf. So copy
+ ** it in one go. */
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)), (*(*uintptr)(unsafe.Pointer(bp + 128 /* pDoclist */)) + uintptr(iOff)), uint64(nCopy))
+ *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (nCopy)
+ }
+ } else {
+ // The entire poslist will not fit on this leaf. So it needs
+ // to be broken into sections. The only qualification being
+ // that each varint must be stored contiguously.
+ var pPoslist uintptr = (*(*uintptr)(unsafe.Pointer(bp + 128 /* pDoclist */)) + uintptr(iOff))
+ var iPos int32 = 0
+ for (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ var nSpace int32 = ((pgsz - (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn) - (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn)
+ var n int32 = 0
+ if (nCopy - iPos) <= nSpace {
+ n = (nCopy - iPos)
+ } else {
+ n = fts5PoslistPrefix(tls, (pPoslist + uintptr(iPos)), nSpace)
+ }
+
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)), (pPoslist + uintptr(iPos)), uint64(n))
+ *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (n)
+ }
+
+ iPos = iPos + (n)
+ if ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn + (*Fts5Buffer)(unsafe.Pointer(pPgidx)).Fn) >= pgsz {
+ fts5WriteFlushLeaf(tls, p, bp /* &writer */)
+ }
+ if iPos >= nCopy {
+ break
+ }
+ }
+ }
+ iOff = iOff + (nCopy)
+ }
+ }
+ }
+
+ // TODO2: Doclist terminator written here.
+ // pBuf->p[pBuf->n++] = '\0';
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ sqlite3Fts5HashScanNext(tls, pHash)
+ }
+ }
+ sqlite3Fts5HashClear(tls, pHash)
+ fts5WriteFinish(tls, p, bp /* &writer */, bp+160 /* &pgnoLast */)
+
+ // Update the Fts5Structure. It is written back to the database by the
+ // fts5StructureRelease() call below.
+ if (*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168 /* pStruct */)))).FnLevel == 0 {
+ fts5StructureAddLevel(tls, (p + 52 /* &.rc */), bp+168 /* &pStruct */)
+ }
+ fts5StructureExtendLevel(tls, (p + 52 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 168 /* pStruct */)), 0, 1, 0)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ pSeg = ((*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 168 /* pStruct */))+24 /* &.aLevel */)+uintptr(0)*16)).FaSeg + uintptr(libc.PostIncInt32(&(*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 168 /* pStruct */))+24 /* &.aLevel */)+uintptr(0)*16)).FnSeg, 1))*12)
+ (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid = iSegid
+ (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst = 1
+ (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast = *(*int32)(unsafe.Pointer(bp + 160 /* pgnoLast */))
+ (*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 168 /* pStruct */)))).FnSegment++
+ }
+ fts5StructurePromote(tls, p, 0, *(*uintptr)(unsafe.Pointer(bp + 168 /* pStruct */)))
+ }
+
+ fts5IndexAutomerge(tls, p, bp+168 /* &pStruct */, *(*int32)(unsafe.Pointer(bp + 160 /* pgnoLast */)))
+ fts5IndexCrisismerge(tls, p, bp+168 /* &pStruct */)
+ fts5StructureWrite(tls, p, *(*uintptr)(unsafe.Pointer(bp + 168 /* pStruct */)))
+ fts5StructureRelease(tls, *(*uintptr)(unsafe.Pointer(bp + 168 /* pStruct */)))
+}
+
+// Flush any data stored in the in-memory hash tables to the database.
+func fts5IndexFlush(tls *libc.TLS, p uintptr) { /* sqlite3.c:221002:13: */
+ // Unless it is empty, flush the hash table to disk
+ if (*Fts5Index)(unsafe.Pointer(p)).FnPendingData != 0 {
+
+ (*Fts5Index)(unsafe.Pointer(p)).FnPendingData = 0
+ fts5FlushOneHash(tls, p)
+ }
+}
+
+func fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) uintptr { /* sqlite3.c:221011:22: */
+ var pNew uintptr = uintptr(0)
+ var nByte Sqlite3_int64 = Sqlite3_int64(unsafe.Sizeof(Fts5Structure{}))
+ var nSeg int32 = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnSegment
+ var i int32
+
+ // Figure out if this structure requires optimization. A structure does
+ // not require optimization if either:
+ //
+ // + it consists of fewer than two segments, or
+ // + all segments are on the same level, or
+ // + all segments except one are currently inputs to a merge operation.
+ //
+ // In the first case, return NULL. In the second, increment the ref-count
+ // on *pStruct and return a copy of the pointer to it.
+ if nSeg < 2 {
+ return uintptr(0)
+ }
+ for i = 0; i < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; i++ {
+ var nThis int32 = (*Fts5StructureLevel)(unsafe.Pointer((pStruct + 24 /* &.aLevel */) + uintptr(i)*16)).FnSeg
+ if (nThis == nSeg) || ((nThis == (nSeg - 1)) && ((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(i)*16)).FnMerge == nThis)) {
+ fts5StructureRef(tls, pStruct)
+ return pStruct
+ }
+ }
+
+ nByte = Sqlite3_int64(uint64(nByte) + (uint64((uint64((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel + 1)) * uint64(unsafe.Sizeof(Fts5StructureLevel{})))))
+ pNew = sqlite3Fts5MallocZero(tls, (p + 52 /* &.rc */), nByte)
+
+ if pNew != 0 {
+ var pLvl uintptr
+ nByte = (Sqlite3_int64(uint64(nSeg) * uint64(unsafe.Sizeof(Fts5StructureSegment{}))))
+ (*Fts5Structure)(unsafe.Pointer(pNew)).FnLevel = ((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel + 1)
+ (*Fts5Structure)(unsafe.Pointer(pNew)).FnRef = 1
+ (*Fts5Structure)(unsafe.Pointer(pNew)).FnWriteCounter = (*Fts5Structure)(unsafe.Pointer(pStruct)).FnWriteCounter
+ pLvl = ((pNew + 24 /* &.aLevel */) + uintptr((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel)*16)
+ (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg = sqlite3Fts5MallocZero(tls, (p + 52 /* &.rc */), nByte)
+ if (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg != 0 {
+ var iLvl int32
+ var iSeg int32
+ var iSegOut int32 = 0
+ // Iterate through all segments, from oldest to newest. Add them to
+ // the new Fts5Level object so that pLvl->aSeg[0] is the oldest
+ // segment in the data structure.
+ for iLvl = ((*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel - 1); iLvl >= 0; iLvl-- {
+ for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*16)).FnSeg; iSeg++ {
+ *(*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSegOut)*12)) = *(*Fts5StructureSegment)(unsafe.Pointer((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*16)).FaSeg + uintptr(iSeg)*12))
+ iSegOut++
+ }
+ }
+ (*Fts5Structure)(unsafe.Pointer(pNew)).FnSegment = libc.AssignPtrInt32(pLvl+4 /* &.nSeg */, nSeg)
+ } else {
+ Xsqlite3_free(tls, pNew)
+ pNew = uintptr(0)
+ }
+ }
+
+ return pNew
+}
+
+func sqlite3Fts5IndexOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221073:12: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ var pStruct uintptr
+ *(*uintptr)(unsafe.Pointer(bp /* pNew */)) = uintptr(0)
+
+ fts5IndexFlush(tls, p)
+ pStruct = fts5StructureRead(tls, p)
+ fts5StructureInvalidate(tls, p)
+
+ if pStruct != 0 {
+ *(*uintptr)(unsafe.Pointer(bp /* pNew */)) = fts5IndexOptimizeStruct(tls, p, pStruct)
+ }
+ fts5StructureRelease(tls, pStruct)
+
+ if *(*uintptr)(unsafe.Pointer(bp /* pNew */)) != 0 {
+ var iLvl int32
+ for iLvl = 0; (*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pNew */))+24 /* &.aLevel */)+uintptr(iLvl)*16)).FnSeg == 0; iLvl++ {
+ }
+ for ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && ((*Fts5StructureLevel)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pNew */))+24 /* &.aLevel */)+uintptr(iLvl)*16)).FnSeg > 0) {
+ *(*int32)(unsafe.Pointer(bp + 8 /* nRem */)) = 1000
+ fts5IndexMergeLevel(tls, p, bp /* &pNew */, iLvl, bp+8 /* &nRem */)
+ }
+
+ fts5StructureWrite(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pNew */)))
+ fts5StructureRelease(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */)))
+ }
+
+ return fts5IndexReturn(tls, p)
+}
+
+// This is called to implement the special "VALUES('merge', $nMerge)"
+// INSERT command.
+func sqlite3Fts5IndexMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:221107:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ *(*uintptr)(unsafe.Pointer(bp /* pStruct */)) = fts5StructureRead(tls, p)
+ if *(*uintptr)(unsafe.Pointer(bp /* pStruct */)) != 0 {
+ var nMin int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnUsermerge
+ fts5StructureInvalidate(tls, p)
+ if nMerge < 0 {
+ var pNew uintptr = fts5IndexOptimizeStruct(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pStruct */)))
+ fts5StructureRelease(tls, *(*uintptr)(unsafe.Pointer(bp /* pStruct */)))
+ *(*uintptr)(unsafe.Pointer(bp /* pStruct */)) = pNew
+ nMin = 2
+ nMerge = (nMerge * -1)
+ }
+ if (*(*uintptr)(unsafe.Pointer(bp /* pStruct */)) != 0) && ((*Fts5Structure)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pStruct */)))).FnLevel != 0) {
+ if fts5IndexMerge(tls, p, bp /* &pStruct */, nMerge, nMin) != 0 {
+ fts5StructureWrite(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pStruct */)))
+ }
+ }
+ fts5StructureRelease(tls, *(*uintptr)(unsafe.Pointer(bp /* pStruct */)))
+ }
+ return fts5IndexReturn(tls, p)
+}
+
+func fts5AppendRowid(tls *libc.TLS, p uintptr, iDelta I64, pUnused uintptr, pBuf uintptr) { /* sqlite3.c:221129:13: */
+ _ = pUnused
+ sqlite3Fts5BufferAppendVarint(tls, (p + 52 /* &.rc */), pBuf, iDelta)
+}
+
+func fts5AppendPoslist(tls *libc.TLS, p uintptr, iDelta I64, pMulti uintptr, pBuf uintptr) { /* sqlite3.c:221139:13: */
+ var nData int32 = (*Fts5Iter)(unsafe.Pointer(pMulti)).Fbase.FnData
+ var nByte int32 = (((nData + 9) + 9) + 8)
+
+ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (0 == (func() int32 {
+ if ((U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)) + (U32(nByte))) <= (U32((*Fts5Buffer)(unsafe.Pointer(pBuf)).FnSpace)) {
+ return 0
+ }
+ return sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), pBuf, (uint32((nByte) + (*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)))
+ }())) {
+ {
+ *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)), uint64(iDelta)))
+ }
+
+ {
+ *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)), (uint64(nData * 2))))
+ }
+
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((pBuf))).Fn)), (*Fts5Iter)(unsafe.Pointer(pMulti)).Fbase.FpData, uint64(nData))
+ *(*int32)(unsafe.Pointer(pBuf + 8 /* &.n */)) += (nData)
+ }
+
+ libc.Xmemset(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn)), 0, uint64(8))
+ }
+}
+
+func fts5DoclistIterNext(tls *libc.TLS, pIter uintptr) { /* sqlite3.c:221157:13: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ var p uintptr = (((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnSize)) + uintptr((*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist))
+
+ if p >= (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof {
+ (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = uintptr(0)
+ } else {
+ // var iDelta I64 at bp, 8
+
+ p += uintptr(sqlite3Fts5GetVarint(tls, p, bp /* &iDelta */))
+ *(*I64)(unsafe.Pointer(pIter + 8 /* &.iRowid */)) += (*(*I64)(unsafe.Pointer(bp /* iDelta */)))
+
+ // Read position list size
+ if (int32(*(*U8)(unsafe.Pointer(p + uintptr(0)))) & 0x80) != 0 {
+ // var nPos int32 at bp+8, 4
+
+ (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnSize = sqlite3Fts5GetVarint32(tls, p, bp+8 /* &nPos */)
+ (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist = (*(*int32)(unsafe.Pointer(bp + 8 /* nPos */)) >> 1)
+ } else {
+ (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnPoslist = ((int32(*(*U8)(unsafe.Pointer(p + uintptr(0))))) >> 1)
+ (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FnSize = 1
+ }
+
+ (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = p
+ }
+}
+
+func fts5DoclistIterInit(tls *libc.TLS, pBuf uintptr, pIter uintptr) { /* sqlite3.c:221183:13: */
+ libc.Xmemset(tls, pIter, 0, uint64(unsafe.Sizeof(Fts5DoclistIter{})))
+ (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaPoslist = (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp
+ (*Fts5DoclistIter)(unsafe.Pointer(pIter)).FaEof = ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn))
+ fts5DoclistIterNext(tls, pIter)
+}
+
+// Swap the contents of buffer *p1 with that of *p2.
+func fts5BufferSwap(tls *libc.TLS, p1 uintptr, p2 uintptr) { /* sqlite3.c:221220:13: */
+ var tmp = *(*Fts5Buffer)(unsafe.Pointer(p1))
+ *(*Fts5Buffer)(unsafe.Pointer(p1)) = *(*Fts5Buffer)(unsafe.Pointer(p2))
+ *(*Fts5Buffer)(unsafe.Pointer(p2)) = tmp
+}
+
+func fts5NextRowid(tls *libc.TLS, pBuf uintptr, piOff uintptr, piRowid uintptr) { /* sqlite3.c:221226:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var i int32 = *(*int32)(unsafe.Pointer(piOff))
+ if i >= (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn {
+ *(*int32)(unsafe.Pointer(piOff)) = -1
+ } else {
+ // var iVal U64 at bp, 8
+
+ *(*int32)(unsafe.Pointer(piOff)) = (i + int32(sqlite3Fts5GetVarint(tls, ((*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp+uintptr(i)), bp /* &iVal */)))
+ *(*I64)(unsafe.Pointer(piRowid)) += I64((*(*U64)(unsafe.Pointer(bp /* iVal */))))
+ }
+}
+
+// This is the equivalent of fts5MergePrefixLists() for detail=none mode.
+// In this case the buffers consist of a delta-encoded list of rowids only.
+func fts5MergeRowidLists(tls *libc.TLS, p uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:221241:13: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ *(*int32)(unsafe.Pointer(bp + 16 /* i1 */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 32 /* i2 */)) = 0
+ *(*I64)(unsafe.Pointer(bp + 24 /* iRowid1 */)) = int64(0)
+ *(*I64)(unsafe.Pointer(bp + 40 /* iRowid2 */)) = int64(0)
+ var iOut I64 = int64(0)
+ // var out Fts5Buffer at bp, 16
+
+ libc.Xmemset(tls, bp /* &out */, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
+ sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), bp /* &out */, (uint32((*Fts5Buffer)(unsafe.Pointer(p1)).Fn + (*Fts5Buffer)(unsafe.Pointer(p2)).Fn)))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ return
+ }
+
+ fts5NextRowid(tls, p1, bp+16 /* &i1 */, bp+24 /* &iRowid1 */)
+ fts5NextRowid(tls, p2, bp+32 /* &i2 */, bp+40 /* &iRowid2 */)
+ for (*(*int32)(unsafe.Pointer(bp + 16 /* i1 */)) >= 0) || (*(*int32)(unsafe.Pointer(bp + 32 /* i2 */)) >= 0) {
+ if (*(*int32)(unsafe.Pointer(bp + 16 /* i1 */)) >= 0) && ((*(*int32)(unsafe.Pointer(bp + 32 /* i2 */)) < 0) || (*(*I64)(unsafe.Pointer(bp + 24 /* iRowid1 */)) < *(*I64)(unsafe.Pointer(bp + 40 /* iRowid2 */)))) {
+
+ {
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(*(*I64)(unsafe.Pointer(bp + 24 /* iRowid1 */)) - iOut))))
+ }
+
+ iOut = *(*I64)(unsafe.Pointer(bp + 24 /* iRowid1 */))
+ fts5NextRowid(tls, p1, bp+16 /* &i1 */, bp+24 /* &iRowid1 */)
+ } else {
+
+ {
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(*(*I64)(unsafe.Pointer(bp + 40 /* iRowid2 */)) - iOut))))
+ }
+
+ iOut = *(*I64)(unsafe.Pointer(bp + 40 /* iRowid2 */))
+ if (*(*int32)(unsafe.Pointer(bp + 16 /* i1 */)) >= 0) && (*(*I64)(unsafe.Pointer(bp + 24 /* iRowid1 */)) == *(*I64)(unsafe.Pointer(bp + 40 /* iRowid2 */))) {
+ fts5NextRowid(tls, p1, bp+16 /* &i1 */, bp+24 /* &iRowid1 */)
+ }
+ fts5NextRowid(tls, p2, bp+32 /* &i2 */, bp+40 /* &iRowid2 */)
+ }
+ }
+
+ fts5BufferSwap(tls, bp /* &out */, p1)
+ sqlite3Fts5BufferFree(tls, bp /* &out */)
+}
+
+// Buffers p1 and p2 contain doclists. This function merges the content
+// of the two doclists together and sets buffer p1 to the result before
+// returning.
+//
+// If an error occurs, an error code is left in p->rc. If an error has
+// already occurred, this function is a no-op.
+func fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, p2 uintptr) { /* sqlite3.c:221288:13: */
+ bp := tls.Alloc(144)
+ defer tls.Free(144)
+
+ if (*Fts5Buffer)(unsafe.Pointer(p2)).Fn != 0 {
+ var iLastRowid I64 = int64(0)
+ // var i1 Fts5DoclistIter at bp+16, 32
+
+ // var i2 Fts5DoclistIter at bp+48, 32
+
+ *(*Fts5Buffer)(unsafe.Pointer(bp /* out */)) = Fts5Buffer{Fp: uintptr(0), Fn: 0, FnSpace: 0}
+ *(*Fts5Buffer)(unsafe.Pointer(bp + 88 /* tmp */)) = Fts5Buffer{Fp: uintptr(0), Fn: 0, FnSpace: 0}
+
+ // The maximum size of the output is equal to the sum of the two
+ // input sizes + 1 varint (9 bytes). The extra varint is because if the
+ // first rowid in one input is a large negative number, and the first in
+ // the other a non-negative number, the delta for the non-negative
+ // number will be larger on disk than the literal integer value
+ // was.
+ //
+ // Or, if the input position-lists are corrupt, then the output might
+ // include up to 2 extra 10-byte positions created by interpreting -1
+ // (the value PoslistNext64() uses for EOF) as a position and appending
+ // it to the output. This can happen at most once for each input
+ // position-list, hence two 10 byte paddings.
+ if sqlite3Fts5BufferSize(tls, (p+52 /* &.rc */), bp /* &out */, (uint32(((((*Fts5Buffer)(unsafe.Pointer(p1)).Fn+(*Fts5Buffer)(unsafe.Pointer(p2)).Fn)+9)+10)+10))) != 0 {
+ return
+ }
+ fts5DoclistIterInit(tls, p1, bp+16 /* &i1 */)
+ fts5DoclistIterInit(tls, p2, bp+48 /* &i2 */)
+
+ for 1 != 0 {
+ if (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FiRowid < (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FiRowid {
+ /* Copy entry from i1 */
+ {
+ {
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 16 /* &i1 */)).FiRowid) - (iLastRowid)))))
+ }
+ (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 16 /* &i1 */)).FiRowid
+ }
+
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist, (uint64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnSize)))
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnSize)
+ }
+
+ fts5DoclistIterNext(tls, bp+16 /* &i1 */)
+ if (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist == uintptr(0) {
+ break
+ }
+ } else if (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FiRowid != (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FiRowid {
+ /* Copy entry from i2 */
+ {
+ {
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid) - (iLastRowid)))))
+ }
+ (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid
+ }
+
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist, (uint64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnSize)))
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += ((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnSize)
+ }
+
+ fts5DoclistIterNext(tls, bp+48 /* &i2 */)
+ if (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist == uintptr(0) {
+ break
+ }
+ } else {
+ // Merge the two position lists.
+ *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) = int64(0)
+ *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) = int64(0)
+ *(*int32)(unsafe.Pointer(bp + 104 /* iOff1 */)) = 0
+ *(*int32)(unsafe.Pointer(bp + 120 /* iOff2 */)) = 0
+ var a1 uintptr = ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnSize))
+ var a2 uintptr = ((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist + uintptr((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnSize))
+ var nCopy int32
+ var aCopy uintptr
+
+ *(*I64)(unsafe.Pointer(bp + 136 /* iPrev */)) = int64(0)
+ // var writer Fts5PoslistWriter at bp+80, 8
+
+ libc.Xmemset(tls, bp+80 /* &writer */, 0, uint64(unsafe.Sizeof(Fts5PoslistWriter{})))
+
+ /* See the earlier comment in this function for an explanation of why
+ ** corrupt input position lists might cause the output to consume
+ ** at most 20 bytes of unexpected space. */
+ {
+ {
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid) - (iLastRowid)))))
+ }
+ (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid
+ }
+
+ sqlite3Fts5BufferZero(tls, bp+88 /* &tmp */)
+ sqlite3Fts5BufferSize(tls, (p + 52 /* &.rc */), bp+88 /* &tmp */, (uint32((((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist) + 10) + 10)))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ break
+ }
+
+ sqlite3Fts5PoslistNext64(tls, a1, (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist, bp+104 /* &iOff1 */, bp+112 /* &iPos1 */)
+ sqlite3Fts5PoslistNext64(tls, a2, (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist, bp+120 /* &iOff2 */, bp+128 /* &iPos2 */)
+
+ if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) < *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) {
+ sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)))
+ sqlite3Fts5PoslistNext64(tls, a1, (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist, bp+104 /* &iOff1 */, bp+112 /* &iPos1 */)
+ } else {
+ sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)))
+ sqlite3Fts5PoslistNext64(tls, a2, (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist, bp+120 /* &iOff2 */, bp+128 /* &iPos2 */)
+ }
+ if (*(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) >= int64(0)) && (*(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) >= int64(0)) {
+ for 1 != 0 {
+ if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) < *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) {
+ if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) != *(*I64)(unsafe.Pointer(bp + 136 /* iPrev */)) {
+ sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)))
+ }
+ sqlite3Fts5PoslistNext64(tls, a1, (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist, bp+104 /* &iOff1 */, bp+112 /* &iPos1 */)
+ if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) < int64(0) {
+ break
+ }
+ } else {
+
+ sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)))
+ sqlite3Fts5PoslistNext64(tls, a2, (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist, bp+120 /* &iOff2 */, bp+128 /* &iPos2 */)
+ if *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)) < int64(0) {
+ break
+ }
+ }
+ }
+ }
+
+ if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) >= int64(0) {
+ if *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)) != *(*I64)(unsafe.Pointer(bp + 136 /* iPrev */)) {
+ sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 112 /* iPos1 */)))
+ }
+ aCopy = (a1 + uintptr(*(*int32)(unsafe.Pointer(bp + 104 /* iOff1 */))))
+ nCopy = ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist - *(*int32)(unsafe.Pointer(bp + 104 /* iOff1 */)))
+ } else {
+
+ sqlite3Fts5PoslistSafeAppend(tls, bp+88 /* &tmp */, bp+136 /* &iPrev */, *(*I64)(unsafe.Pointer(bp + 128 /* iPos2 */)))
+ aCopy = (a2 + uintptr(*(*int32)(unsafe.Pointer(bp + 120 /* iOff2 */))))
+ nCopy = ((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist - *(*int32)(unsafe.Pointer(bp + 120 /* iOff2 */)))
+ }
+ if nCopy > 0 {
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp + 88 /* &tmp */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp + 88 /* &tmp */))).Fn)), aCopy, uint64(nCopy))
+ *(*int32)(unsafe.Pointer(bp + 88 /* &tmp */ + 8 /* &.n */)) += (nCopy)
+ }
+ }
+
+ // WRITEPOSLISTSIZE
+
+ if (*Fts5Buffer)(unsafe.Pointer(bp+88 /* &tmp */)).Fn > ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FnPoslist + (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FnPoslist) {
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ }
+ break
+ }
+ {
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64((*Fts5Buffer)(unsafe.Pointer(bp+88 /* &tmp */)).Fn * 2))))
+ }
+
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5Buffer)(unsafe.Pointer(bp+88 /* &tmp */)).Fp, uint64((*Fts5Buffer)(unsafe.Pointer(bp+88 /* &tmp */)).Fn))
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += ((*Fts5Buffer)(unsafe.Pointer(bp + 88 /* &tmp */)).Fn)
+ }
+
+ fts5DoclistIterNext(tls, bp+16 /* &i1 */)
+ fts5DoclistIterNext(tls, bp+48 /* &i2 */)
+
+ if ((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist == uintptr(0)) || ((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist == uintptr(0)) {
+ break
+ }
+ }
+ }
+
+ if (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist != 0 {
+ {
+ {
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 16 /* &i1 */)).FiRowid) - (iLastRowid)))))
+ }
+ (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 16 /* &i1 */)).FiRowid
+ }
+
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist, (uint64((int64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaEof) - int64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist)) / 1)))
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += int32(((int64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaEof) - int64((*Fts5DoclistIter)(unsafe.Pointer(bp+16 /* &i1 */)).FaPoslist)) / 1))
+ }
+ } else if (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist != 0 {
+ {
+ {
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += (sqlite3Fts5PutVarint(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (uint64(((*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid) - (iLastRowid)))))
+ }
+ (iLastRowid) = (*Fts5DoclistIter)(unsafe.Pointer(bp + 48 /* &i2 */)).FiRowid
+ }
+
+ {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fp + uintptr((*Fts5Buffer)(unsafe.Pointer((bp /* &out */))).Fn)), (*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist, (uint64((int64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaEof) - int64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist)) / 1)))
+ *(*int32)(unsafe.Pointer(bp /* &out */ + 8 /* &.n */)) += int32(((int64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaEof) - int64((*Fts5DoclistIter)(unsafe.Pointer(bp+48 /* &i2 */)).FaPoslist)) / 1))
+ }
+ }
+
+ sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), p1, (*Fts5Buffer)(unsafe.Pointer(bp /* &out */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp /* &out */)).Fp)
+ sqlite3Fts5BufferFree(tls, bp+88 /* &tmp */)
+ sqlite3Fts5BufferFree(tls, bp /* &out */)
+ }
+}
+
+func fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, pToken uintptr, nToken int32, pColset uintptr, ppIter uintptr) { /* sqlite3.c:221433:13: */
+ bp := tls.Alloc(28)
+ defer tls.Free(28)
+
+ var pStruct uintptr
+ var aBuf uintptr
+ var nBuf int32 = 32
+ var xMerge uintptr
+ var xAppend uintptr
+ if (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == 1 {
+ xMerge = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr)
+ }{fts5MergeRowidLists}))
+ xAppend = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, I64, uintptr, uintptr)
+ }{fts5AppendRowid}))
+ } else {
+ xMerge = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr)
+ }{fts5MergePrefixLists}))
+ xAppend = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, I64, uintptr, uintptr)
+ }{fts5AppendPoslist}))
+ }
+
+ aBuf = fts5IdxMalloc(tls, p, (int64(uint64(unsafe.Sizeof(Fts5Buffer{})) * uint64(nBuf))))
+ pStruct = fts5StructureRead(tls, p)
+
+ if (aBuf != 0) && (pStruct != 0) {
+ var flags int32 = ((0x0008 |
+ 0x0010) |
+ 0x0020)
+ var i int32
+ var iLastRowid I64 = int64(0)
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)) = uintptr(0) // Iterator used to gather data from index
+ var pData uintptr
+ // var doclist Fts5Buffer at bp, 16
+
+ *(*int32)(unsafe.Pointer(bp + 24 /* bNewTerm */)) = 1
+
+ libc.Xmemset(tls, bp /* &doclist */, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
+ fts5MultiIterNew(tls, p, pStruct, flags, pColset, pToken, nToken, -1, 0, bp+16 /* &p1 */)
+ fts5IterSetOutputCb(tls, (p + 52 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))
+ for ; fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */))) == 0; fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), bp+24 /* &bNewTerm */) {
+ var pSeg uintptr = ((*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)) + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).FaFirst+uintptr(1)*4)).FiFirst)*120)
+ var nTerm int32 = (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn
+ var pTerm uintptr = (*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)) + 56 /* &.xSetOutputs */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), pSeg)
+
+ if *(*int32)(unsafe.Pointer(bp + 24 /* bNewTerm */)) != 0 {
+ if (nTerm < nToken) || (libc.Xmemcmp(tls, pToken, pTerm, uint64(nToken)) != 0) {
+ break
+ }
+ }
+
+ if (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FnData == 0 {
+ continue
+ }
+
+ if ((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FiRowid <= iLastRowid) && ((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn > 0) {
+ for i = 0; ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && ((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn != 0); i++ {
+
+ if (*Fts5Buffer)(unsafe.Pointer(aBuf+uintptr(i)*16)).Fn == 0 {
+ fts5BufferSwap(tls, bp /* &doclist */, (aBuf + uintptr(i)*16))
+ sqlite3Fts5BufferZero(tls, bp /* &doclist */)
+ } else {
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&xMerge)))(tls, p, bp /* &doclist */, (aBuf + uintptr(i)*16))
+ sqlite3Fts5BufferZero(tls, (aBuf + uintptr(i)*16))
+ }
+ }
+ iLastRowid = int64(0)
+ }
+
+ (*(*func(*libc.TLS, uintptr, I64, uintptr, uintptr))(unsafe.Pointer(&xAppend)))(tls, p, ((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FiRowid - iLastRowid), *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)), bp /* &doclist */)
+ iLastRowid = (*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))).Fbase.FiRowid
+ }
+
+ for i = 0; i < nBuf; i++ {
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&xMerge)))(tls, p, bp /* &doclist */, (aBuf + uintptr(i)*16))
+ }
+ sqlite3Fts5BufferFree(tls, (aBuf + uintptr(i)*16))
+ }
+ fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* p1 */)))
+
+ pData = fts5IdxMalloc(tls, p, (int64((uint64(unsafe.Sizeof(Fts5Data{})) + uint64((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)) + uint64(8))))
+ if pData != 0 {
+ (*Fts5Data)(unsafe.Pointer(pData)).Fp = (pData + uintptr(1)*16)
+ (*Fts5Data)(unsafe.Pointer(pData)).Fnn = libc.AssignPtrInt32(pData+12 /* &.szLeaf */, (*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn)
+ if (*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn != 0 {
+ libc.Xmemcpy(tls, (*Fts5Data)(unsafe.Pointer(pData)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fp, uint64((*Fts5Buffer)(unsafe.Pointer(bp /* &doclist */)).Fn))
+ }
+ fts5MultiIterNew2(tls, p, pData, bDesc, ppIter)
+ }
+ sqlite3Fts5BufferFree(tls, bp /* &doclist */)
+ }
+
+ fts5StructureRelease(tls, pStruct)
+ Xsqlite3_free(tls, aBuf)
+}
+
+// Indicate that all subsequent calls to sqlite3Fts5IndexWrite() pertain
+// to the document with rowid iRowid.
+func sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid I64) int32 { /* sqlite3.c:221533:12: */
+
+ // Allocate the hash table if it has not already been allocated
+ if (*Fts5Index)(unsafe.Pointer(p)).FpHash == uintptr(0) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = sqlite3Fts5HashNew(tls, (*Fts5Index)(unsafe.Pointer(p)).FpConfig, (p + 24 /* &.pHash */), (p + 32 /* &.nPendingData */))
+ }
+
+ // Flush the hash table to disk if required
+ if ((iRowid < (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid) ||
+ ((iRowid == (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid) && ((*Fts5Index)(unsafe.Pointer(p)).FbDelete == 0))) ||
+ ((*Fts5Index)(unsafe.Pointer(p)).FnPendingData > (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnHashSize) {
+ fts5IndexFlush(tls, p)
+ }
+
+ (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid = iRowid
+ (*Fts5Index)(unsafe.Pointer(p)).FbDelete = bDelete
+ return fts5IndexReturn(tls, p)
+}
+
+// Commit data to disk.
+func sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221557:12: */
+
+ fts5IndexFlush(tls, p)
+ sqlite3Fts5IndexCloseReader(tls, p)
+ return fts5IndexReturn(tls, p)
+}
+
+// Discard any data stored in the in-memory hash tables. Do not write it
+// to the database. Additionally, assume that the contents of the %_data
+// table may have changed on disk. So any in-memory caches of %_data
+// records must be invalidated.
+func sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221570:12: */
+ sqlite3Fts5IndexCloseReader(tls, p)
+ fts5IndexDiscardData(tls, p)
+ fts5StructureInvalidate(tls, p)
+ // assert( p->rc==SQLITE_OK );
+ return 0
+}
+
+// The %_data table is completely empty when this function is called. This
+// function populates it with the initial structure objects for each index,
+// and the initial version of the "averages" record (a zero-byte blob).
+func sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221583:12: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
+
+ // var s Fts5Structure at bp, 40
+
+ fts5StructureInvalidate(tls, p)
+ fts5IndexDiscardData(tls, p)
+ libc.Xmemset(tls, bp /* &s */, 0, uint64(unsafe.Sizeof(Fts5Structure{})))
+ fts5DataWrite(tls, p, int64(1), ts+781 /* "" */, 0)
+ fts5StructureWrite(tls, p, bp /* &s */)
+ return fts5IndexReturn(tls, p)
+}
+
+// Open a new Fts5Index handle. If the bCreate argument is true, create
+// and initialize the underlying %_data table.
+//
+// If successful, set *pp to point to the new object and return SQLITE_OK.
+// Otherwise, set *pp to NULL and return an SQLite error code.
+func sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:221600:12: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = 0
+ var p uintptr // New object
+
+ *(*uintptr)(unsafe.Pointer(pp)) = libc.AssignUintptr(&p, sqlite3Fts5MallocZero(tls, bp+8 /* &rc */, int64(unsafe.Sizeof(Fts5Index{}))))
+ if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0 {
+ (*Fts5Index)(unsafe.Pointer(p)).FpConfig = pConfig
+ (*Fts5Index)(unsafe.Pointer(p)).FnWorkUnit = 64
+ (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl = sqlite3Fts5Mprintf(tls, bp+8 /* &rc */, ts+37992 /* "%s_data" */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
+ if ((*Fts5Index)(unsafe.Pointer(p)).FzDataTbl != 0) && (bCreate != 0) {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5CreateTable(tls,
+ pConfig, ts+28342 /* "data" */, ts+38000 /* "id INTEGER PRIMA..." */, 0, pzErr)
+ if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5CreateTable(tls, pConfig, ts+12609, /* "idx" */
+ ts+38035, /* "segid, term, pgn..." */
+ 1, pzErr)
+ }
+ if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = sqlite3Fts5IndexReinit(tls, p)
+ }
+ }
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) != 0 {
+ sqlite3Fts5IndexClose(tls, p)
+ *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
+ }
+ return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
+}
+
+// Close a handle opened by an earlier call to sqlite3Fts5IndexOpen().
+func sqlite3Fts5IndexClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221641:12: */
+ var rc int32 = 0
+ if p != 0 {
+
+ fts5StructureInvalidate(tls, p)
+ Xsqlite3_finalize(tls, (*Fts5Index)(unsafe.Pointer(p)).FpWriter)
+ Xsqlite3_finalize(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDeleter)
+ Xsqlite3_finalize(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxWriter)
+ Xsqlite3_finalize(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxDeleter)
+ Xsqlite3_finalize(tls, (*Fts5Index)(unsafe.Pointer(p)).FpIdxSelect)
+ Xsqlite3_finalize(tls, (*Fts5Index)(unsafe.Pointer(p)).FpDataVersion)
+ sqlite3Fts5HashFree(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash)
+ Xsqlite3_free(tls, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl)
+ Xsqlite3_free(tls, p)
+ }
+ return rc
+}
+
+// Argument p points to a buffer containing utf-8 text that is n bytes in
+// size. Return the number of bytes in the nChar character prefix of the
+// buffer, or 0 if there are less than nChar characters in total.
+func sqlite3Fts5IndexCharlenToBytelen(tls *libc.TLS, p uintptr, nByte int32, nChar int32) int32 { /* sqlite3.c:221664:12: */
+ var n int32 = 0
+ var i int32
+ for i = 0; i < nChar; i++ {
+ if n >= nByte {
+ return 0
+ } // Input contains fewer than nChar chars
+ if int32(uint8(*(*int8)(unsafe.Pointer(p + uintptr(libc.PostIncInt32(&n, 1)))))) >= 0xc0 {
+ if n >= nByte {
+ return 0
+ }
+ for (int32(*(*int8)(unsafe.Pointer(p + uintptr(n)))) & 0xc0) == 0x80 {
+ n++
+ if n >= nByte {
+ if (i + 1) == nChar {
+ break
+ }
+ return 0
+ }
+ }
+ }
+ }
+ return n
+}
+
+// pIn is a UTF-8 encoded string, nIn bytes in size. Return the number of
+// unicode characters in the string.
+func fts5IndexCharlen(tls *libc.TLS, pIn uintptr, nIn int32) int32 { /* sqlite3.c:221691:12: */
+ var nChar int32 = 0
+ var i int32 = 0
+ for i < nIn {
+ if int32(uint8(*(*int8)(unsafe.Pointer(pIn + uintptr(libc.PostIncInt32(&i, 1)))))) >= 0xc0 {
+ for (i < nIn) && ((int32(*(*int8)(unsafe.Pointer(pIn + uintptr(i)))) & 0xc0) == 0x80) {
+ i++
+ }
+ }
+ nChar++
+ }
+ return nChar
+}
+
+// Insert or remove data to or from the index. Each time a document is
+// added to or removed from the index, this function is called one or more
+// times.
+//
+// For an insert, it must be called once for each token in the new document.
+// If the operation is a delete, it must be called (at least) once for each
+// unique token in the document with an iCol value less than zero. The iPos
+// argument is ignored for a delete.
+func sqlite3Fts5IndexWrite(tls *libc.TLS, p uintptr, iCol int32, iPos int32, pToken uintptr, nToken int32) int32 { /* sqlite3.c:221713:12: */
+ var i int32 // Used to iterate through indexes
+ var rc int32 = 0 // Return code
+ var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
+
+ // Add the entry to the main terms index.
+ rc = sqlite3Fts5HashWrite(tls,
+ (*Fts5Index)(unsafe.Pointer(p)).FpHash, (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid, iCol, iPos, int8('0'), pToken, nToken)
+
+ for i = 0; (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix) && (rc == 0); i++ {
+ var nChar int32 = *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr(i)*4))
+ var nByte int32 = sqlite3Fts5IndexCharlenToBytelen(tls, pToken, nToken, nChar)
+ if nByte != 0 {
+ rc = sqlite3Fts5HashWrite(tls, (*Fts5Index)(unsafe.Pointer(p)).FpHash,
+ (*Fts5Index)(unsafe.Pointer(p)).FiWriteRowid, iCol, iPos, (int8(('0' + i) + 1)), pToken,
+ nByte)
+ }
+ }
+
+ return rc
+}
+
+// Open a new iterator to iterate though all rowid that match the
+// specified token or token prefix.
+func sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int32, flags int32, pColset uintptr, ppIter uintptr) int32 { /* sqlite3.c:221749:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* pRet */)) = uintptr(0)
+ *(*Fts5Buffer)(unsafe.Pointer(bp /* buf */)) = Fts5Buffer{Fp: uintptr(0), Fn: 0, FnSpace: 0}
+
+ // If the QUERY_SCAN flag is set, all other flags must be clear.
+
+ if sqlite3Fts5BufferSize(tls, (p+52 /* &.rc */), bp /* &buf */, (uint32(nToken+1))) == 0 {
+ var iIdx int32 = 0 // Index to search
+ if nToken != 0 {
+ libc.Xmemcpy(tls, ((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp + uintptr(1)), pToken, uint64(nToken))
+ }
+
+ // Figure out which index to search and set iIdx accordingly. If this
+ // is a prefix query for which there is no prefix index, set iIdx to
+ // greater than pConfig->nPrefix to indicate that the query will be
+ // satisfied by scanning multiple terms in the main index.
+ //
+ // If the QUERY_TEST_NOIDX flag was specified, then this must be a
+ // prefix-query. Instead of using a prefix-index (if one exists),
+ // evaluate the prefix query using the main FTS index. This is used
+ // for internal sanity checking by the integrity-check in debug
+ // mode only.
+ if (flags & 0x0001) != 0 {
+ var nChar int32 = fts5IndexCharlen(tls, pToken, nToken)
+ for iIdx = 1; iIdx <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix; iIdx++ {
+ if *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FaPrefix + uintptr((iIdx-1))*4)) == nChar {
+ break
+ }
+ }
+ }
+
+ if iIdx <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnPrefix {
+ // Straight index lookup
+ var pStruct uintptr = fts5StructureRead(tls, p)
+ *(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp + uintptr(0))) = (U8('0' + iIdx))
+ if pStruct != 0 {
+ fts5MultiIterNew(tls, p, pStruct, (flags | 0x0010),
+ pColset, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (nToken + 1), -1, 0, bp+16 /* &pRet */)
+ fts5StructureRelease(tls, pStruct)
+ }
+ } else {
+ // Scan multiple terms in the main index
+ var bDesc int32 = (libc.Bool32((flags & 0x0002) != 0))
+ *(*U8)(unsafe.Pointer((*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp + uintptr(0))) = U8('0')
+ fts5SetupPrefixIter(tls, p, bDesc, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (nToken + 1), pColset, bp+16 /* &pRet */)
+
+ fts5IterSetOutputCb(tls, (p + 52 /* &.rc */), *(*uintptr)(unsafe.Pointer(bp + 16 /* pRet */)))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ var pSeg uintptr = ((*(*uintptr)(unsafe.Pointer(bp + 16 /* pRet */)) + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16 /* pRet */)))).FaFirst+uintptr(1)*4)).FiFirst)*120)
+ if (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0 {
+ (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp + 16 /* pRet */)) + 56 /* &.xSetOutputs */))))(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pRet */)), pSeg)
+ }
+ }
+ }
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ sqlite3Fts5IterClose(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pRet */)))
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* pRet */)) = uintptr(0)
+ sqlite3Fts5IndexCloseReader(tls, p)
+ }
+
+ *(*uintptr)(unsafe.Pointer(ppIter)) = *(*uintptr)(unsafe.Pointer(bp + 16 /* pRet */))
+ sqlite3Fts5BufferFree(tls, bp /* &buf */)
+ }
+ return fts5IndexReturn(tls, p)
+}
+
+// Return true if the iterator passed as the only argument is at EOF.
+// Move to the next matching rowid.
+func sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:221831:12: */
+ var pIter uintptr = pIndexIter
+
+ fts5MultiIterNext(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pIter, 0, int64(0))
+ return fts5IndexReturn(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex)
+}
+
+// Move to the next matching term/rowid. Used by the fts5vocab module.
+func sqlite3Fts5IterNextScan(tls *libc.TLS, pIndexIter uintptr) int32 { /* sqlite3.c:221841:12: */
+ var pIter uintptr = pIndexIter
+ var p uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex
+
+ fts5MultiIterNext(tls, p, pIter, 0, int64(0))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ var pSeg uintptr = ((pIter + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(pIter)).FaFirst+uintptr(1)*4)).FiFirst)*120)
+ if ((*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf != 0) && (int32(*(*U8)(unsafe.Pointer((*Fts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp + uintptr(0)))) != '0') {
+ fts5DataRelease(tls, (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf)
+ (*Fts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf = uintptr(0)
+ (*Fts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof = U8(1)
+ }
+ }
+
+ return fts5IndexReturn(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex)
+}
+
+// Move to the next matching rowid that occurs at or after iMatch. The
+// definition of "at or after" depends on whether this iterator iterates
+// in ascending or descending rowid order.
+func sqlite3Fts5IterNextFrom(tls *libc.TLS, pIndexIter uintptr, iMatch I64) int32 { /* sqlite3.c:221865:12: */
+ var pIter uintptr = pIndexIter
+ fts5MultiIterNextFrom(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex, pIter, iMatch)
+ return fts5IndexReturn(tls, (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex)
+}
+
+// Return the current term.
+func sqlite3Fts5IterTerm(tls *libc.TLS, pIndexIter uintptr, pn uintptr) uintptr { /* sqlite3.c:221874:19: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ // var n int32 at bp, 4
+
+ var z uintptr = fts5MultiIterTerm(tls, pIndexIter, bp /* &n */)
+ *(*int32)(unsafe.Pointer(pn)) = (*(*int32)(unsafe.Pointer(bp /* n */)) - 1)
+ return (z + uintptr(1))
+}
+
+// Close an iterator opened by an earlier call to sqlite3Fts5IndexQuery().
+func sqlite3Fts5IterClose(tls *libc.TLS, pIndexIter uintptr) { /* sqlite3.c:221884:13: */
+ if pIndexIter != 0 {
+ var pIter uintptr = pIndexIter
+ var pIndex uintptr = (*Fts5Iter)(unsafe.Pointer(pIter)).FpIndex
+ fts5MultiIterFree(tls, pIter)
+ sqlite3Fts5IndexCloseReader(tls, pIndex)
+ }
+}
+
+// Read and decode the "averages" record from the database.
+//
+// Parameter anSize must point to an array of size nCol, where nCol is
+// the number of user defined columns in the FTS table.
+func sqlite3Fts5IndexGetAverages(tls *libc.TLS, p uintptr, pnRow uintptr, anSize uintptr) int32 { /* sqlite3.c:221899:12: */
+ var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FnCol
+ var pData uintptr
+
+ *(*I64)(unsafe.Pointer(pnRow)) = int64(0)
+ libc.Xmemset(tls, anSize, 0, (uint64(unsafe.Sizeof(I64(0))) * uint64(nCol)))
+ pData = fts5DataRead(tls, p, int64(1))
+ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && ((*Fts5Data)(unsafe.Pointer(pData)).Fnn != 0) {
+ var i int32 = 0
+ var iCol int32
+ i = i + (int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr(i)), pnRow)))
+ for iCol = 0; (i < (*Fts5Data)(unsafe.Pointer(pData)).Fnn) && (iCol < nCol); iCol++ {
+ i = i + (int32(sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pData)).Fp + uintptr(i)), (anSize + uintptr(iCol)*8))))
+ }
+ }
+
+ fts5DataRelease(tls, pData)
+ return fts5IndexReturn(tls, p)
+}
+
+// Replace the current "averages" record with the contents of the buffer
+// supplied as the second argument.
+func sqlite3Fts5IndexSetAverages(tls *libc.TLS, p uintptr, pData uintptr, nData int32) int32 { /* sqlite3.c:221923:12: */
+
+ fts5DataWrite(tls, p, int64(1), pData, nData)
+ return fts5IndexReturn(tls, p)
+}
+
+// Return the total number of blocks this module has read from the %_data
+// table since it was created.
+func sqlite3Fts5IndexReads(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221933:12: */
+ return (*Fts5Index)(unsafe.Pointer(p)).FnRead
+}
+
+// Set the 32-bit cookie value stored at the start of all structure
+// records to the value passed as the second argument.
+//
+// Return SQLITE_OK if successful, or an SQLite error code if an error
+// occurs.
+func sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) int32 { /* sqlite3.c:221944:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var rc int32 // Return code
+ var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig // Configuration object
+ // var aCookie [4]U8 at bp, 4
+ // Binary representation of iNew
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */)) = uintptr(0)
+
+ sqlite3Fts5Put32(tls, bp /* &aCookie[0] */, iNew)
+
+ rc = Xsqlite3_blob_open(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Index)(unsafe.Pointer(p)).FzDataTbl,
+ ts+37682 /* "block" */, int64(10), 1, bp+8 /* &pBlob */)
+ if rc == 0 {
+ Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */)), bp /* &aCookie[0] */, 4, 0)
+ rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pBlob */)))
+ }
+
+ return rc
+}
+
+func sqlite3Fts5IndexLoadConfig(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:221964:12: */
+ var pStruct uintptr
+ pStruct = fts5StructureRead(tls, p)
+ fts5StructureRelease(tls, pStruct)
+ return fts5IndexReturn(tls, p)
+}
+
+// ************************************************************************
+//
+//
+// Below this point is the implementation of the integrity-check
+// functionality.
+
+// Return a simple checksum value based on the arguments.
+func sqlite3Fts5IndexEntryCksum(tls *libc.TLS, iRowid I64, iCol int32, iPos int32, iIdx int32, pTerm uintptr, nTerm int32) U64 { /* sqlite3.c:221981:12: */
+ var i int32
+ var ret U64 = U64(iRowid)
+ ret = ret + ((ret << 3) + U64(iCol))
+ ret = ret + ((ret << 3) + U64(iPos))
+ if iIdx >= 0 {
+ ret = ret + ((ret << 3) + (U64('0' + iIdx)))
+ }
+ for i = 0; i < nTerm; i++ {
+ ret = ret + ((ret << 3) + U64(*(*int8)(unsafe.Pointer(pTerm + uintptr(i)))))
+ }
+ return ret
+}
+
+// Check that:
+//
+// 1) All leaves of pSeg between iFirst and iLast (inclusive) exist and
+// contain zero terms.
+// 2) All leaves of pSeg between iNoRowid and iLast (inclusive) exist and
+// contain zero rowids.
+func fts5IndexIntegrityCheckEmpty(tls *libc.TLS, p uintptr, pSeg uintptr, iFirst int32, iNoRowid int32, iLast int32) { /* sqlite3.c:222199:13: */
+ var i int32
+
+ // Now check that the iter.nEmpty leaves following the current leaf
+ // (a) exist and (b) contain no terms.
+ for i = iFirst; ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (i <= iLast); i++ {
+ var pLeaf uintptr = fts5DataRead(tls, p, (((((I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (I64(i))))
+ if pLeaf != 0 {
+ if !((*Fts5Data)(unsafe.Pointer((pLeaf))).FszLeaf >= (*Fts5Data)(unsafe.Pointer((pLeaf))).Fnn) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ }
+ if (i >= iNoRowid) && (0 != (int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp)))) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ }
+ }
+ fts5DataRelease(tls, pLeaf)
+ }
+}
+
+func fts5IntegrityCheckPgidx(tls *libc.TLS, p uintptr, pLeaf uintptr) { /* sqlite3.c:222220:13: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ var iTermOff int32 = 0
+ var ii int32
+
+ *(*Fts5Buffer)(unsafe.Pointer(bp + 8 /* buf1 */)) = Fts5Buffer{Fp: uintptr(0), Fn: 0, FnSpace: 0}
+ *(*Fts5Buffer)(unsafe.Pointer(bp + 32 /* buf2 */)) = Fts5Buffer{Fp: uintptr(0), Fn: 0, FnSpace: 0}
+
+ ii = (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf
+ for (ii < (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn) && ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) {
+ var res int32
+ var iOff int32
+ // var nIncr int32 at bp, 4
+
+ ii = ii + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(ii)), bp /* &nIncr */))
+ iTermOff = iTermOff + (*(*int32)(unsafe.Pointer(bp /* nIncr */)))
+ iOff = iTermOff
+
+ if iOff >= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ } else if iTermOff == *(*int32)(unsafe.Pointer(bp /* nIncr */)) {
+ // var nByte int32 at bp+4, 4
+
+ iOff = iOff + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)), bp+4 /* &nByte */))
+ if (iOff + *(*int32)(unsafe.Pointer(bp + 4 /* nByte */))) > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ } else {
+ sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), bp+8 /* &buf1 */, *(*int32)(unsafe.Pointer(bp + 4 /* nByte */)), ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)))
+ }
+ } else {
+ // var nKeep int32 at bp+24, 4
+
+ // var nByte int32 at bp+28, 4
+
+ iOff = iOff + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)), bp+24 /* &nKeep */))
+ iOff = iOff + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)), bp+28 /* &nByte */))
+ if (*(*int32)(unsafe.Pointer(bp + 24 /* nKeep */)) > (*Fts5Buffer)(unsafe.Pointer(bp+8 /* &buf1 */)).Fn) || ((iOff + *(*int32)(unsafe.Pointer(bp + 28 /* nByte */))) > (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ } else {
+ (*Fts5Buffer)(unsafe.Pointer(bp + 8 /* &buf1 */)).Fn = *(*int32)(unsafe.Pointer(bp + 24 /* nKeep */))
+ sqlite3Fts5BufferAppendBlob(tls, (p + 52 /* &.rc */), bp+8 /* &buf1 */, uint32(*(*int32)(unsafe.Pointer(bp + 28 /* nByte */))), ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)))
+ }
+
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ res = fts5BufferCompare(tls, bp+8 /* &buf1 */, bp+32 /* &buf2 */)
+ if res <= 0 {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ }
+ }
+ }
+ sqlite3Fts5BufferSet(tls, (p + 52 /* &.rc */), bp+32 /* &buf2 */, (*Fts5Buffer)(unsafe.Pointer(bp+8 /* &buf1 */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+8 /* &buf1 */)).Fp)
+ }
+
+ sqlite3Fts5BufferFree(tls, bp+8 /* &buf1 */)
+ sqlite3Fts5BufferFree(tls, bp+32 /* &buf2 */)
+}
+
+func fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { /* sqlite3.c:222270:13: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ var pConfig uintptr = (*Fts5Index)(unsafe.Pointer(p)).FpConfig
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)) = uintptr(0)
+ var rc2 int32
+ var iIdxPrevLeaf int32 = ((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst - 1)
+ var iDlidxPrevLeaf int32 = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast
+
+ if (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 {
+ return
+ }
+
+ fts5IndexPrepareStmt(tls, p, bp+24 /* &pStmt */, Xsqlite3_mprintf(tls,
+
+ ts+38079, /* "SELECT segid, te..." */
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)))
+
+ // Iterate through the b-tree hierarchy.
+ for ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)))) {
+ var iRow I64 // Rowid for this leaf
+ var pLeaf uintptr // Data for this leaf
+
+ var zIdxTerm uintptr = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)), 1)
+ var nIdxTerm int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)), 1)
+ var iIdxLeaf int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)), 2)
+ var bIdxDlidx int32 = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)), 3)
+
+ // If the leaf in question has already been trimmed from the segment,
+ // ignore this b-tree entry. Otherwise, load it into memory.
+ if iIdxLeaf < (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst {
+ continue
+ }
+ iRow = (((((I64((*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (I64(iIdxLeaf)))
+ pLeaf = fts5LeafRead(tls, p, iRow)
+ if pLeaf == uintptr(0) {
+ break
+ }
+
+ // Check that the leaf contains at least one term, and that it is equal
+ // to or larger than the split-key in zIdxTerm. Also check that if there
+ // is also a rowid pointer within the leaf page header, it points to a
+ // location before the term.
+ if (*Fts5Data)(unsafe.Pointer(pLeaf)).Fnn <= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ } else {
+ var iOff int32 // Offset of first term on leaf
+ var iRowidOff int32 // Offset of first rowid on leaf
+ // var nTerm int32 at bp+32, 4
+ // Size of term on leaf in bytes
+ var res int32 // Comparison of term and split-key
+
+ iOff = fts5LeafFirstTermOff(tls, pLeaf)
+ iRowidOff = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp))
+ if (iRowidOff >= iOff) || (iOff >= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ } else {
+ iOff = iOff + (sqlite3Fts5GetVarint32(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)), bp+32 /* &nTerm */))
+ res = func() int32 {
+ if (func() int32 {
+ if (*(*int32)(unsafe.Pointer(bp + 32 /* nTerm */))) < (nIdxTerm) {
+ return *(*int32)(unsafe.Pointer(bp + 32 /* nTerm */))
+ }
+ return nIdxTerm
+ }()) == 0 {
+ return 0
+ }
+ return libc.Xmemcmp(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iOff)), zIdxTerm, func() uint64 {
+ if (*(*int32)(unsafe.Pointer(bp + 32 /* nTerm */))) < (nIdxTerm) {
+ return uint64(*(*int32)(unsafe.Pointer(bp + 32 /* nTerm */)))
+ }
+ return uint64(nIdxTerm)
+ }())
+ }()
+ if res == 0 {
+ res = (*(*int32)(unsafe.Pointer(bp + 32 /* nTerm */)) - nIdxTerm)
+ }
+ if res < 0 {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ }
+ }
+
+ fts5IntegrityCheckPgidx(tls, p, pLeaf)
+ }
+ fts5DataRelease(tls, pLeaf)
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ break
+ }
+
+ // Now check that the iter.nEmpty leaves following the current leaf
+ // (a) exist and (b) contain no terms.
+ fts5IndexIntegrityCheckEmpty(tls,
+ p, pSeg, (iIdxPrevLeaf + 1), (iDlidxPrevLeaf + 1), (iIdxLeaf - 1))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc != 0 {
+ break
+ }
+
+ // If there is a doclist-index, check that it looks right.
+ if bIdxDlidx != 0 {
+ var pDlidx uintptr = uintptr(0) // For iterating through doclist index
+ var iPrevLeaf int32 = iIdxLeaf
+ var iSegid int32 = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid
+ var iPg int32 = 0
+ var iKey I64
+
+ for pDlidx = fts5DlidxIterInit(tls, p, 0, iSegid, iIdxLeaf); fts5DlidxIterEof(tls, p, pDlidx) == 0; fts5DlidxIterNext(tls, p, pDlidx) {
+
+ // Check any rowid-less pages that occur before the current leaf.
+ for iPg = (iPrevLeaf + 1); iPg < fts5DlidxIterPgno(tls, pDlidx); iPg++ {
+ iKey = (((((I64(iSegid)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (I64(iPg)))
+ pLeaf = fts5DataRead(tls, p, iKey)
+ if pLeaf != 0 {
+ if (int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp))) != 0 {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ }
+ fts5DataRelease(tls, pLeaf)
+ }
+ }
+ iPrevLeaf = fts5DlidxIterPgno(tls, pDlidx)
+
+ // Check that the leaf page indicated by the iterator really does
+ // contain the rowid suggested by the same.
+ iKey = (((((I64(iSegid)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (I64(iPrevLeaf)))
+ pLeaf = fts5DataRead(tls, p, iKey)
+ if pLeaf != 0 {
+ // var iRowid I64 at bp+40, 8
+
+ var iRowidOff int32 = int32(fts5GetU16(tls, (*Fts5Data)(unsafe.Pointer(pLeaf)).Fp))
+
+ if iRowidOff >= (*Fts5Data)(unsafe.Pointer(pLeaf)).FszLeaf {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ } else {
+ sqlite3Fts5GetVarint(tls, ((*Fts5Data)(unsafe.Pointer(pLeaf)).Fp + uintptr(iRowidOff)), bp+40 /* &iRowid */)
+ if *(*I64)(unsafe.Pointer(bp + 40 /* iRowid */)) != fts5DlidxIterRowid(tls, pDlidx) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ }
+ }
+ fts5DataRelease(tls, pLeaf)
+ }
+ }
+
+ iDlidxPrevLeaf = iPg
+ fts5DlidxIterFree(tls, pDlidx)
+ } else {
+ iDlidxPrevLeaf = (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast
+ }
+
+ iIdxPrevLeaf = iIdxLeaf
+ }
+
+ rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)))
+ if (*Fts5Index)(unsafe.Pointer(p)).Frc == 0 {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = rc2
+ }
+
+ // Page iter.iLeaf must now be the rightmost leaf-page in the segment
+}
+
+// Run internal checks to ensure that the FTS index (a) is internally
+// consistent and (b) contains entries for which the XOR of the checksums
+// as calculated by sqlite3Fts5IndexEntryCksum() is cksum.
+//
+// Return SQLITE_CORRUPT if any of the internal checks fail, or if the
+// checksum does not match. Return SQLITE_OK if all checks pass without
+// error, or some other SQLite error code if another error (e.g. OOM)
+// occurs.
+func sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum U64) int32 { /* sqlite3.c:222415:12: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail
+ var cksum2 U64 = uint64(0) // Checksum based on contents of indexes
+ *(*Fts5Buffer)(unsafe.Pointer(bp + 16 /* poslist */)) = Fts5Buffer{Fp: uintptr(0), Fn: 0, FnSpace: 0} // Buffer used to hold a poslist
+ // var pIter uintptr at bp, 8
+ // Used to iterate through entire index
+ var pStruct uintptr // Index structure
+
+ var flags int32 = 0x0020
+
+ // Load the FTS index structure
+ pStruct = fts5StructureRead(tls, p)
+
+ // Check that the internal nodes of each segment match the leaves
+ if pStruct != 0 {
+ var iLvl int32
+ var iSeg int32
+ for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(pStruct)).FnLevel; iLvl++ {
+ for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*16)).FnSeg; iSeg++ {
+ var pSeg uintptr = ((*Fts5StructureLevel)(unsafe.Pointer((pStruct+24 /* &.aLevel */)+uintptr(iLvl)*16)).FaSeg + uintptr(iSeg)*12)
+ fts5IndexIntegrityCheckSegment(tls, p, pSeg)
+ }
+ }
+ }
+
+ // The cksum argument passed to this function is a checksum calculated
+ // based on all expected entries in the FTS index (including prefix index
+ // entries). This block checks that a checksum calculated based on the
+ // actual contents of FTS index is identical.
+ //
+ // Two versions of the same checksum are calculated. The first (stack
+ // variable cksum2) based on entries extracted from the full-text index
+ // while doing a linear scan of each individual index in turn.
+ //
+ // As each term visited by the linear scans, a separate query for the
+ // same term is performed. cksum3 is calculated based on the entries
+ // extracted by these queries.
+ for fts5MultiIterNew(tls, p, pStruct, flags, uintptr(0), uintptr(0), 0, -1, 0, bp /* &pIter */); fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pIter */))) == 0; fts5MultiIterNext(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pIter */)), 0, int64(0)) {
+ // var n int32 at bp+8, 4
+ // Size of term in bytes
+ *(*I64)(unsafe.Pointer(bp + 40 /* iPos */)) = int64(0) // Position read from poslist
+ *(*int32)(unsafe.Pointer(bp + 32 /* iOff */)) = 0 // Offset within poslist
+ var iRowid I64 = fts5MultiIterRowid(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter */)))
+ var z uintptr = fts5MultiIterTerm(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter */)), bp+8 /* &n */)
+
+ // If this is a new term, query for it. Update cksum3 with the results.
+
+ if eDetail == 1 {
+ if 0 == fts5MultiIterIsEmpty(tls, p, *(*uintptr)(unsafe.Pointer(bp /* pIter */))) {
+ cksum2 = cksum2 ^ (sqlite3Fts5IndexEntryCksum(tls, iRowid, 0, 0, -1, z, *(*int32)(unsafe.Pointer(bp + 8 /* n */))))
+ }
+ } else {
+ (*Fts5Buffer)(unsafe.Pointer(bp + 16 /* &poslist */)).Fn = 0
+ fts5SegiterPoslist(tls, p, ((*(*uintptr)(unsafe.Pointer(bp /* pIter */)) + 96 /* &.aSeg */) + uintptr((*Fts5CResult)(unsafe.Pointer((*Fts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pIter */)))).FaFirst+uintptr(1)*4)).FiFirst)*120), uintptr(0), bp+16 /* &poslist */)
+ for 0 == sqlite3Fts5PoslistNext64(tls, (*Fts5Buffer)(unsafe.Pointer(bp+16 /* &poslist */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp+16 /* &poslist */)).Fn, bp+32 /* &iOff */, bp+40 /* &iPos */) {
+ var iCol int32 = (int32(*(*I64)(unsafe.Pointer(bp + 40 /* iPos */)) >> 32))
+ var iTokOff int32 = (int32(*(*I64)(unsafe.Pointer(bp + 40 /* iPos */)) & int64(0x7FFFFFFF)))
+ cksum2 = cksum2 ^ (sqlite3Fts5IndexEntryCksum(tls, iRowid, iCol, iTokOff, -1, z, *(*int32)(unsafe.Pointer(bp + 8 /* n */))))
+ }
+ }
+ }
+
+ fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp /* pIter */)))
+ if ((*Fts5Index)(unsafe.Pointer(p)).Frc == 0) && (cksum != cksum2) {
+ (*Fts5Index)(unsafe.Pointer(p)).Frc = (11 | (int32(1) << 8))
+ }
+
+ fts5StructureRelease(tls, pStruct)
+ sqlite3Fts5BufferFree(tls, bp+16 /* &poslist */)
+ return fts5IndexReturn(tls, p)
+}
+
+// ************************************************************************
+//
+//
+// Below this point is the implementation of the fts5_decode() scalar
+// function only.
+
+// Decode a segment-data rowid from the %_data table. This function is
+// the opposite of macro FTS5_SEGMENT_ROWID().
+func fts5DecodeRowid(tls *libc.TLS, iRowid I64, piSegid uintptr, pbDlidx uintptr, piHeight uintptr, piPgno uintptr) { /* sqlite3.c:222506:13: */
+ *(*int32)(unsafe.Pointer(piPgno)) = (int32(iRowid & ((I64(int64(1)) << 31) - int64(1))))
+ iRowid >>= 31
+
+ *(*int32)(unsafe.Pointer(piHeight)) = (int32(iRowid & ((I64(int64(1)) << 5) - int64(1))))
+ iRowid >>= 5
+
+ *(*int32)(unsafe.Pointer(pbDlidx)) = (int32(iRowid & int64(0x0001)))
+ iRowid >>= 1
+
+ *(*int32)(unsafe.Pointer(piSegid)) = (int32(iRowid & ((I64(int64(1)) << 16) - int64(1))))
+}
+
+func fts5DebugRowid(tls *libc.TLS, pRc uintptr, pBuf uintptr, iKey I64) { /* sqlite3.c:222525:13: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ // var iSegid int32 at bp+32, 4
+
+ // var iHeight int32 at bp+40, 4
+
+ // var iPgno int32 at bp+44, 4
+
+ // var bDlidx int32 at bp+36, 4
+ // Rowid compenents
+ fts5DecodeRowid(tls, iKey, bp+32 /* &iSegid */, bp+36 /* &bDlidx */, bp+40 /* &iHeight */, bp+44 /* &iPgno */)
+
+ if *(*int32)(unsafe.Pointer(bp + 32 /* iSegid */)) == 0 {
+ if iKey == int64(1) {
+ sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38165 /* "{averages} " */, 0)
+ } else {
+ sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38177 /* "{structure}" */, 0)
+ }
+ } else {
+ sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38189, /* "{%ssegid=%d h=%d..." */
+ libc.VaList(bp, func() uintptr {
+ if *(*int32)(unsafe.Pointer(bp + 36 /* bDlidx */)) != 0 {
+ return ts + 38215 /* "dlidx " */
+ }
+ return ts + 781 /* "" */
+ }(), *(*int32)(unsafe.Pointer(bp + 32 /* iSegid */)), *(*int32)(unsafe.Pointer(bp + 40 /* iHeight */)), *(*int32)(unsafe.Pointer(bp + 44 /* iPgno */))))
+ }
+}
+
+func fts5DebugStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, p uintptr) { /* sqlite3.c:222543:13: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ var iLvl int32
+ var iSeg int32 // Iterate through levels, segments
+
+ for iLvl = 0; iLvl < (*Fts5Structure)(unsafe.Pointer(p)).FnLevel; iLvl++ {
+ var pLvl uintptr = ((p + 24 /* &.aLevel */) + uintptr(iLvl)*16)
+ sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf,
+ ts+38222 /* " {lvl=%d nMerge=..." */, libc.VaList(bp, iLvl, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge, (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg))
+ for iSeg = 0; iSeg < (*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FnSeg; iSeg++ {
+ var pSeg uintptr = ((*Fts5StructureLevel)(unsafe.Pointer(pLvl)).FaSeg + uintptr(iSeg)*12)
+ sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38249, /* " {id=%d leaves=%..." */
+ libc.VaList(bp+24, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst, (*Fts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoLast))
+ }
+ sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+29950 /* "}" */, 0)
+ }
+}
+
+// This is part of the fts5_decode() debugging aid.
+//
+// Arguments pBlob/nBlob contain a serialized Fts5Structure object. This
+// function appends a human-readable representation of the same object
+// to the buffer passed as the second argument.
+func fts5DecodeStructure(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, nBlob int32) { /* sqlite3.c:222572:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 // Return code
+ *(*uintptr)(unsafe.Pointer(bp /* p */)) = uintptr(0) // Decoded structure object
+
+ rc = fts5StructureDecode(tls, pBlob, nBlob, uintptr(0), bp /* &p */)
+ if rc != 0 {
+ *(*int32)(unsafe.Pointer(pRc)) = rc
+ return
+ }
+
+ fts5DebugStructure(tls, pRc, pBuf, *(*uintptr)(unsafe.Pointer(bp /* p */)))
+ fts5StructureRelease(tls, *(*uintptr)(unsafe.Pointer(bp /* p */)))
+}
+
+// This is part of the fts5_decode() debugging aid.
+//
+// Arguments pBlob/nBlob contain an "averages" record. This function
+// appends a human-readable representation of record to the buffer passed
+// as the second argument.
+func fts5DecodeAverages(tls *libc.TLS, pRc uintptr, pBuf uintptr, pBlob uintptr, nBlob int32) { /* sqlite3.c:222597:13: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var i int32 = 0
+ var zSpace uintptr = ts + 781 /* "" */
+
+ for i < nBlob {
+ // var iVal U64 at bp+16, 8
+
+ i = i + (int32(sqlite3Fts5GetVarint(tls, (pBlob + uintptr(i)), bp+16 /* &iVal */)))
+ sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38272 /* "%s%d" */, libc.VaList(bp, zSpace, int32(*(*U64)(unsafe.Pointer(bp + 16 /* iVal */)))))
+ zSpace = ts + 15984 /* " " */
+ }
+}
+
+// Buffer (a/n) is assumed to contain a list of serialized varints. Read
+// each varint and append its string representation to buffer pBuf. Return
+// after either the input buffer is exhausted or a 0 value is read.
+//
+// The return value is the number of bytes read from the input buffer.
+func fts5DecodePoslist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n int32) int32 { /* sqlite3.c:222620:12: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ var iOff int32 = 0
+ for iOff < n {
+ // var iVal int32 at bp+8, 4
+
+ iOff = iOff + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iOff)), bp+8 /* &iVal */))
+ sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+37404 /* " %d" */, libc.VaList(bp, *(*int32)(unsafe.Pointer(bp + 8 /* iVal */))))
+ }
+ return iOff
+}
+
+// The start of buffer (a/n) contains the start of a doclist. The doclist
+// may or may not finish within the buffer. This function appends a text
+// representation of the part of the doclist that is present to buffer
+// pBuf.
+//
+// The return value is the number of bytes read from the input buffer.
+func fts5DecodeDoclist(tls *libc.TLS, pRc uintptr, pBuf uintptr, a uintptr, n int32) int32 { /* sqlite3.c:222638:12: */
+ bp := tls.Alloc(56)
+ defer tls.Free(56)
+
+ *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */)) = int64(0)
+ var iOff int32 = 0
+
+ if n > 0 {
+ iOff = int32(sqlite3Fts5GetVarint(tls, a, bp+32 /* &iDocid */))
+ sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38277 /* " id=%lld" */, libc.VaList(bp, *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */))))
+ }
+ for iOff < n {
+ // var nPos int32 at bp+40, 4
+
+ // var bDel int32 at bp+44, 4
+
+ iOff = iOff + (fts5GetPoslistSize(tls, (a + uintptr(iOff)), bp+40 /* &nPos */, bp+44 /* &bDel */))
+ sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38286 /* " nPos=%d%s" */, libc.VaList(bp+8, *(*int32)(unsafe.Pointer(bp + 40 /* nPos */)), func() uintptr {
+ if *(*int32)(unsafe.Pointer(bp + 44 /* bDel */)) != 0 {
+ return ts + 20672 /* "*" */
+ }
+ return ts + 781 /* "" */
+ }()))
+ iOff = iOff + (fts5DecodePoslist(tls, pRc, pBuf, (a + uintptr(iOff)), func() int32 {
+ if (n - iOff) < (*(*int32)(unsafe.Pointer(bp + 40 /* nPos */))) {
+ return (n - iOff)
+ }
+ return *(*int32)(unsafe.Pointer(bp + 40 /* nPos */))
+ }()))
+ if iOff < n {
+ // var iDelta I64 at bp+48, 8
+
+ iOff = iOff + (int32(sqlite3Fts5GetVarint(tls, (a + uintptr(iOff)), bp+48 /* &iDelta */)))
+ *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */)) += *(*I64)(unsafe.Pointer(bp + 48 /* iDelta */))
+ sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38277 /* " id=%lld" */, libc.VaList(bp+24, *(*I64)(unsafe.Pointer(bp + 32 /* iDocid */))))
+ }
+ }
+
+ return iOff
+}
+
+// This function is part of the fts5_decode() debugging function. It is
+// only ever used with detail=none tables.
+//
+// Buffer (pData/nData) contains a doclist in the format used by detail=none
+// tables. This function appends a human-readable version of that list to
+// buffer pBuf.
+//
+// If *pRc is other than SQLITE_OK when this function is called, it is a
+// no-op. If an OOM or other error occurs within this function, *pRc is
+// set to an SQLite error code before returning. The final state of buffer
+// pBuf is undefined in this case.
+func fts5DecodeRowidList(tls *libc.TLS, pRc uintptr, pBuf uintptr, pData uintptr, nData int32) { /* sqlite3.c:222676:13: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var i int32 = 0
+ var iRowid I64 = int64(0)
+
+ for i < nData {
+ var zApp uintptr = ts + 781 /* "" */
+ // var iVal U64 at bp+16, 8
+
+ i = i + (int32(sqlite3Fts5GetVarint(tls, (pData + uintptr(i)), bp+16 /* &iVal */)))
+ iRowid = I64(U64(iRowid) + (*(*U64)(unsafe.Pointer(bp + 16 /* iVal */))))
+
+ if (i < nData) && (int32(*(*U8)(unsafe.Pointer(pData + uintptr(i)))) == 0x00) {
+ i++
+ if (i < nData) && (int32(*(*U8)(unsafe.Pointer(pData + uintptr(i)))) == 0x00) {
+ i++
+ zApp = ts + 38297 /* "+" */
+ } else {
+ zApp = ts + 20672 /* "*" */
+ }
+ }
+
+ sqlite3Fts5BufferAppendPrintf(tls, pRc, pBuf, ts+38299 /* " %lld%s" */, libc.VaList(bp, iRowid, zApp))
+ }
+}
+
+// The implementation of user-defined scalar function fts5_decode().
+func fts5DecodeFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:222707:13: */
+ bp := tls.Alloc(192)
+ defer tls.Free(192)
+
+ var iRowid I64 // Rowid for record being decoded
+ // var iSegid int32 at bp+68, 4
+
+ // var iHeight int32 at bp+76, 4
+
+ // var iPgno int32 at bp+80, 4
+
+ // var bDlidx int32 at bp+72, 4
+ // Rowid components
+ var aBlob uintptr
+ var n int32 // Record to decode
+ var a uintptr
+ // var s Fts5Buffer at bp+48, 16
+ // Build up text to return here
+ // var rc int32 at bp+64, 4
+ // Return code
+ var nSpace Sqlite3_int64
+ var eDetailNone int32
+ // var dlidx Fts5Data at bp+120, 16
+
+ // var lvl Fts5DlidxLvl at bp+88, 32
+
+ // var nIncr int32 at bp+160, 4
+
+ // var nAppend int32 at bp+156, 4
+
+ // var term Fts5Buffer at bp+136, 16
+ // Current term read from page
+ var szLeaf int32
+ var iPgidxOff int32
+ // var iTermOff int32 at bp+152, 4
+
+ // var nKeep int32 at bp+164, 4
+
+ var iOff int32
+ var bFirst int32 // True for first term on page
+ // var nByte int32 at bp+188, 4
+ // Bytes of data
+ var iEnd int32
+ // var term1 Fts5Buffer at bp+168, 16
+ // Current term read from page
+ var szLeaf1 int32 // Offset of pgidx in a[]
+ var iPgidxOff1 int32
+ var iPgidxPrev int32 // Previous value read from pgidx
+ // var iTermOff1 int32 at bp+184, 4
+
+ var iRowidOff int32
+ var iOff1 int32
+ var nDoclist int32
+ a = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = 0
+ nSpace = int64(0)
+ eDetailNone = (libc.Bool32(Xsqlite3_user_data(tls, pCtx) != uintptr(0)))
+
+ _ = nArg
+ libc.Xmemset(tls, bp+48 /* &s */, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
+ iRowid = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
+
+ // Make a copy of the second argument (a blob) in aBlob[]. The aBlob[]
+ // copy is followed by FTS5_DATA_ZERO_PADDING 0x00 bytes, which prevents
+ // buffer overreads even if the record is corrupt.
+ n = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8)))
+ aBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8)))
+ nSpace = (Sqlite3_int64(n + 8))
+ a = sqlite3Fts5MallocZero(tls, bp+64 /* &rc */, nSpace)
+ if !(a == uintptr(0)) {
+ goto __1
+ }
+ goto decode_out
+__1:
+ ;
+ if !(n > 0) {
+ goto __2
+ }
+ libc.Xmemcpy(tls, a, aBlob, uint64(n))
+__2:
+ ;
+
+ fts5DecodeRowid(tls, iRowid, bp+68 /* &iSegid */, bp+72 /* &bDlidx */, bp+76 /* &iHeight */, bp+80 /* &iPgno */)
+
+ fts5DebugRowid(tls, bp+64 /* &rc */, bp+48 /* &s */, iRowid)
+ if !(*(*int32)(unsafe.Pointer(bp + 72 /* bDlidx */)) != 0) {
+ goto __3
+ }
+
+ (*Fts5Data)(unsafe.Pointer(bp + 120 /* &dlidx */)).Fp = a
+ (*Fts5Data)(unsafe.Pointer(bp + 120 /* &dlidx */)).Fnn = n
+
+ libc.Xmemset(tls, bp+88 /* &lvl */, 0, uint64(unsafe.Sizeof(Fts5DlidxLvl{})))
+ (*Fts5DlidxLvl)(unsafe.Pointer(bp + 88 /* &lvl */)).FpData = bp + 120 /* &dlidx */
+ (*Fts5DlidxLvl)(unsafe.Pointer(bp + 88 /* &lvl */)).FiLeafPgno = *(*int32)(unsafe.Pointer(bp + 80 /* iPgno */))
+
+ fts5DlidxLvlNext(tls, bp+88 /* &lvl */)
+__5:
+ if !((*Fts5DlidxLvl)(unsafe.Pointer(bp+88 /* &lvl */)).FbEof == 0) {
+ goto __7
+ }
+ sqlite3Fts5BufferAppendPrintf(tls, bp+64 /* &rc */, bp+48, /* &s */
+ ts+38307 /* " %d(%lld)" */, libc.VaList(bp, (*Fts5DlidxLvl)(unsafe.Pointer(bp+88 /* &lvl */)).FiLeafPgno, (*Fts5DlidxLvl)(unsafe.Pointer(bp+88 /* &lvl */)).FiRowid))
+ goto __6
+__6:
+ fts5DlidxLvlNext(tls, bp+88 /* &lvl */)
+ goto __5
+ goto __7
+__7:
+ ;
+ goto __4
+__3:
+ if !(*(*int32)(unsafe.Pointer(bp + 68 /* iSegid */)) == 0) {
+ goto __8
+ }
+ if !(iRowid == int64(1)) {
+ goto __10
+ }
+ fts5DecodeAverages(tls, bp+64 /* &rc */, bp+48 /* &s */, a, n)
+ goto __11
+__10:
+ fts5DecodeStructure(tls, bp+64 /* &rc */, bp+48 /* &s */, a, n)
+__11:
+ ;
+ goto __9
+__8:
+ if !(eDetailNone != 0) {
+ goto __12
+ }
+ iPgidxOff = libc.AssignInt32(&szLeaf, int32(fts5GetU16(tls, (a+uintptr(2)))))
+ *(*int32)(unsafe.Pointer(bp + 164 /* nKeep */)) = 0
+
+ libc.Xmemset(tls, bp+136 /* &term */, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
+
+ // Decode any entries that occur before the first term.
+ if !(szLeaf < n) {
+ goto __14
+ }
+ iPgidxOff = iPgidxOff + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iPgidxOff)), bp+152 /* &iTermOff */))
+ goto __15
+__14:
+ *(*int32)(unsafe.Pointer(bp + 152 /* iTermOff */)) = szLeaf
+__15:
+ ;
+ fts5DecodeRowidList(tls, bp+64 /* &rc */, bp+48 /* &s */, (a + uintptr(4)), (*(*int32)(unsafe.Pointer(bp + 152 /* iTermOff */)) - 4))
+
+ iOff = *(*int32)(unsafe.Pointer(bp + 152 /* iTermOff */))
+__16:
+ if !(iOff < szLeaf) {
+ goto __17
+ }
+
+ // Read the term data for the next term
+ iOff = iOff + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iOff)), bp+156 /* &nAppend */))
+ (*Fts5Buffer)(unsafe.Pointer(bp + 136 /* &term */)).Fn = *(*int32)(unsafe.Pointer(bp + 164 /* nKeep */))
+ sqlite3Fts5BufferAppendBlob(tls, bp+64 /* &rc */, bp+136 /* &term */, uint32(*(*int32)(unsafe.Pointer(bp + 156 /* nAppend */))), (a + uintptr(iOff)))
+ sqlite3Fts5BufferAppendPrintf(tls,
+ bp+64 /* &rc */, bp+48 /* &s */, ts+38317 /* " term=%.*s" */, libc.VaList(bp+16, (*Fts5Buffer)(unsafe.Pointer(bp+136 /* &term */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+136 /* &term */)).Fp))
+ iOff = iOff + (*(*int32)(unsafe.Pointer(bp + 156 /* nAppend */)))
+
+ // Figure out where the doclist for this term ends
+ if !(iPgidxOff < n) {
+ goto __18
+ }
+ iPgidxOff = iPgidxOff + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iPgidxOff)), bp+160 /* &nIncr */))
+ *(*int32)(unsafe.Pointer(bp + 152 /* iTermOff */)) += *(*int32)(unsafe.Pointer(bp + 160 /* nIncr */))
+ goto __19
+__18:
+ *(*int32)(unsafe.Pointer(bp + 152 /* iTermOff */)) = szLeaf
+__19:
+ ;
+
+ fts5DecodeRowidList(tls, bp+64 /* &rc */, bp+48 /* &s */, (a + uintptr(iOff)), (*(*int32)(unsafe.Pointer(bp + 152 /* iTermOff */)) - iOff))
+ iOff = *(*int32)(unsafe.Pointer(bp + 152 /* iTermOff */))
+ if !(iOff < szLeaf) {
+ goto __20
+ }
+ iOff = iOff + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iOff)), bp+164 /* &nKeep */))
+__20:
+ ;
+ goto __16
+__17:
+ ;
+
+ sqlite3Fts5BufferFree(tls, bp+136 /* &term */)
+ goto __13
+__12:
+ iPgidxPrev = 0 // Previous value read from pgidx
+ *(*int32)(unsafe.Pointer(bp + 184 /* iTermOff1 */)) = 0
+ iRowidOff = 0
+
+ libc.Xmemset(tls, bp+168 /* &term1 */, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
+
+ if !(n < 4) {
+ goto __21
+ }
+ sqlite3Fts5BufferSet(tls, bp+64 /* &rc */, bp+48 /* &s */, 7, ts+38328 /* "corrupt" */)
+ goto decode_out
+ goto __22
+__21:
+ iRowidOff = int32(fts5GetU16(tls, (a + uintptr(0))))
+ iPgidxOff1 = libc.AssignInt32(&szLeaf1, int32(fts5GetU16(tls, (a+uintptr(2)))))
+ if !(iPgidxOff1 < n) {
+ goto __23
+ }
+ sqlite3Fts5GetVarint32(tls, (a + uintptr(iPgidxOff1)), bp+184 /* &iTermOff1 */)
+ goto __24
+__23:
+ if !(iPgidxOff1 > n) {
+ goto __25
+ }
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = (11 | (int32(1) << 8))
+ goto decode_out
+__25:
+ ;
+__24:
+ ;
+__22:
+ ;
+
+ // Decode the position list tail at the start of the page
+ if !(iRowidOff != 0) {
+ goto __26
+ }
+ iOff1 = iRowidOff
+ goto __27
+__26:
+ if !(*(*int32)(unsafe.Pointer(bp + 184 /* iTermOff1 */)) != 0) {
+ goto __28
+ }
+ iOff1 = *(*int32)(unsafe.Pointer(bp + 184 /* iTermOff1 */))
+ goto __29
+__28:
+ iOff1 = szLeaf1
+__29:
+ ;
+__27:
+ ;
+ if !(iOff1 > n) {
+ goto __30
+ }
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = (11 | (int32(1) << 8))
+ goto decode_out
+__30:
+ ;
+ fts5DecodePoslist(tls, bp+64 /* &rc */, bp+48 /* &s */, (a + uintptr(4)), (iOff1 - 4))
+
+ // Decode any more doclist data that appears on the page before the
+ // first term.
+ nDoclist = ((func() int32 {
+ if *(*int32)(unsafe.Pointer(bp + 184 /* iTermOff1 */)) != 0 {
+ return *(*int32)(unsafe.Pointer(bp + 184 /* iTermOff1 */))
+ }
+ return szLeaf1
+ }()) - iOff1)
+ if !((nDoclist + iOff1) > n) {
+ goto __31
+ }
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = (11 | (int32(1) << 8))
+ goto decode_out
+__31:
+ ;
+ fts5DecodeDoclist(tls, bp+64 /* &rc */, bp+48 /* &s */, (a + uintptr(iOff1)), nDoclist)
+
+__32:
+ if !((iPgidxOff1 < n) && (*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == 0)) {
+ goto __33
+ }
+ bFirst = (libc.Bool32(iPgidxOff1 == szLeaf1))
+
+ iPgidxOff1 = iPgidxOff1 + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iPgidxOff1)), bp+188 /* &nByte */))
+ iPgidxPrev = iPgidxPrev + (*(*int32)(unsafe.Pointer(bp + 188 /* nByte */)))
+ iOff1 = iPgidxPrev
+
+ if !(iPgidxOff1 < n) {
+ goto __34
+ }
+ sqlite3Fts5GetVarint32(tls, (a + uintptr(iPgidxOff1)), bp+188 /* &nByte */)
+ iEnd = (iPgidxPrev + *(*int32)(unsafe.Pointer(bp + 188 /* nByte */)))
+ goto __35
+__34:
+ iEnd = szLeaf1
+__35:
+ ;
+ if !(iEnd > szLeaf1) {
+ goto __36
+ }
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = (11 | (int32(1) << 8))
+ goto __33
+__36:
+ ;
+
+ if !(bFirst == 0) {
+ goto __37
+ }
+ iOff1 = iOff1 + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iOff1)), bp+188 /* &nByte */))
+ if !(*(*int32)(unsafe.Pointer(bp + 188 /* nByte */)) > (*Fts5Buffer)(unsafe.Pointer(bp+168 /* &term1 */)).Fn) {
+ goto __38
+ }
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = (11 | (int32(1) << 8))
+ goto __33
+__38:
+ ;
+ (*Fts5Buffer)(unsafe.Pointer(bp + 168 /* &term1 */)).Fn = *(*int32)(unsafe.Pointer(bp + 188 /* nByte */))
+__37:
+ ;
+ iOff1 = iOff1 + (sqlite3Fts5GetVarint32(tls, (a + uintptr(iOff1)), bp+188 /* &nByte */))
+ if !((iOff1 + *(*int32)(unsafe.Pointer(bp + 188 /* nByte */))) > n) {
+ goto __39
+ }
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = (11 | (int32(1) << 8))
+ goto __33
+__39:
+ ;
+ sqlite3Fts5BufferAppendBlob(tls, bp+64 /* &rc */, bp+168 /* &term1 */, uint32(*(*int32)(unsafe.Pointer(bp + 188 /* nByte */))), (a + uintptr(iOff1)))
+ iOff1 = iOff1 + (*(*int32)(unsafe.Pointer(bp + 188 /* nByte */)))
+
+ sqlite3Fts5BufferAppendPrintf(tls,
+ bp+64 /* &rc */, bp+48 /* &s */, ts+38317 /* " term=%.*s" */, libc.VaList(bp+32, (*Fts5Buffer)(unsafe.Pointer(bp+168 /* &term1 */)).Fn, (*Fts5Buffer)(unsafe.Pointer(bp+168 /* &term1 */)).Fp))
+ iOff1 = iOff1 + (fts5DecodeDoclist(tls, bp+64 /* &rc */, bp+48 /* &s */, (a + uintptr(iOff1)), (iEnd - iOff1)))
+ goto __32
+__33:
+ ;
+
+ sqlite3Fts5BufferFree(tls, bp+168 /* &term1 */)
+__13:
+ ;
+__9:
+ ;
+__4:
+ ;
+
+decode_out:
+ Xsqlite3_free(tls, a)
+ if !(*(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == 0) {
+ goto __40
+ }
+ Xsqlite3_result_text(tls, pCtx, (*Fts5Buffer)(unsafe.Pointer(bp+48 /* &s */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp+48 /* &s */)).Fn, libc.UintptrFromInt32(-1))
+ goto __41
+__40:
+ Xsqlite3_result_error_code(tls, pCtx, *(*int32)(unsafe.Pointer(bp + 64 /* rc */)))
+__41:
+ ;
+ sqlite3Fts5BufferFree(tls, bp+48 /* &s */)
+}
+
+// The implementation of user-defined scalar function fts5_rowid().
+func fts5RowidFunction(tls *libc.TLS, pCtx uintptr, nArg int32, apVal uintptr) { /* sqlite3.c:222916:13: */
+ var zArg uintptr
+ if nArg == 0 {
+ Xsqlite3_result_error(tls, pCtx, ts+38336 /* "should be: fts5_..." */, -1)
+ } else {
+ zArg = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
+ if 0 == Xsqlite3_stricmp(tls, zArg, ts+38373 /* "segment" */) {
+ var iRowid I64
+ var segid int32
+ var pgno int32
+ if nArg != 3 {
+ Xsqlite3_result_error(tls, pCtx,
+ ts+38381 /* "should be: fts5_..." */, -1)
+ } else {
+ segid = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8)))
+ pgno = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(2)*8)))
+ iRowid = (((((I64(segid)) << ((31 + 5) + 1)) + (I64((int64(0))) << (31 + 5))) + (I64((int64(0))) << (31))) + (I64(pgno)))
+ Xsqlite3_result_int64(tls, pCtx, iRowid)
+ }
+ } else {
+ Xsqlite3_result_error(tls, pCtx,
+ ts+38428 /* "first arg to fts..." */, -1)
+ }
+ }
+}
+
+// This is called as part of registering the FTS5 module with database
+// connection db. It registers several user-defined scalar functions useful
+// with FTS5.
+//
+// If successful, SQLITE_OK is returned. If an error occurs, some other
+// SQLite error code is returned instead.
+func sqlite3Fts5IndexInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:222955:12: */
+ var rc int32 = Xsqlite3_create_function(tls,
+ db, ts+38472 /* "fts5_decode" */, 2, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{fts5DecodeFunction})), uintptr(0), uintptr(0))
+
+ if rc == 0 {
+ rc = Xsqlite3_create_function(tls,
+ db, ts+38484 /* "fts5_decode_none" */, 2,
+ 1, db, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{fts5DecodeFunction})), uintptr(0), uintptr(0))
+ }
+
+ if rc == 0 {
+ rc = Xsqlite3_create_function(tls,
+ db, ts+38501 /* "fts5_rowid" */, -1, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{fts5RowidFunction})), uintptr(0), uintptr(0))
+ }
+ return rc
+}
+
+func sqlite3Fts5IndexReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:222976:12: */
+
+ if fts5IndexDataVersion(tls, p) != (*Fts5Index)(unsafe.Pointer(p)).FiStructVersion {
+ fts5StructureInvalidate(tls, p)
+ }
+ return fts5IndexReturn(tls, p)
+}
+
+// 2014 Jun 09
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// This is an SQLite module implementing full-text search.
+
+// #include "fts5Int.h"
+
+// This variable is set to false when running tests for which the on disk
+// structures should not be corrupt. Otherwise, true. If it is false, extra
+// assert() conditions in the fts5 code are activated - conditions that are
+// only true if it is guaranteed that the fts5 database is not corrupt.
+var Xsqlite3_fts5_may_be_corrupt int32 = 1 /* sqlite3.c:223008:16 */
+
+type Fts5Auxdata1 = struct {
+ FpAux uintptr
+ FpPtr uintptr
+ FxDelete uintptr
+ FpNext uintptr
+}
+
+type Fts5Auxdata = Fts5Auxdata1 /* sqlite3.c:223011:28 */
+type Fts5Auxiliary1 = struct {
+ FpGlobal uintptr
+ FzFunc uintptr
+ FpUserData uintptr
+ FxFunc Fts5_extension_function
+ FxDestroy uintptr
+ FpNext uintptr
+}
+
+type Fts5Auxiliary = Fts5Auxiliary1 /* sqlite3.c:223012:30 */
+type Fts5Cursor1 = struct {
+ Fbase Sqlite3_vtab_cursor
+ FpNext uintptr
+ FaColumnSize uintptr
+ FiCsrId I64
+ FePlan int32
+ FbDesc int32
+ FiFirstRowid I64
+ FiLastRowid I64
+ FpStmt uintptr
+ FpExpr uintptr
+ FpSorter uintptr
+ Fcsrflags int32
+ FiSpecial I64
+ FzRank uintptr
+ FzRankArgs uintptr
+ FpRank uintptr
+ FnRankArg int32
+ FapRankArg uintptr
+ FpRankArgStmt uintptr
+ FpAux uintptr
+ FpAuxdata uintptr
+ FaInstIter uintptr
+ FnInstAlloc int32
+ FnInstCount int32
+ FaInst uintptr
+}
+
+type Fts5Cursor = Fts5Cursor1 /* sqlite3.c:223013:27 */
+type Fts5FullTable1 = struct {
+ Fp Fts5Table
+ FpStorage uintptr
+ FpGlobal uintptr
+ FpSortCsr uintptr
+}
+
+type Fts5FullTable = Fts5FullTable1 /* sqlite3.c:223014:30 */
+type Fts5Sorter1 = struct {
+ FpStmt uintptr
+ FiRowid I64
+ FaPoslist uintptr
+ FnIdx int32
+ FaIdx [1]int32
+}
+
+type Fts5Sorter = Fts5Sorter1 /* sqlite3.c:223015:27 */
+type Fts5TokenizerModule1 = struct {
+ FzName uintptr
+ FpUserData uintptr
+ Fx Fts5_tokenizer
+ FxDestroy uintptr
+ FpNext uintptr
+}
+
+type Fts5TokenizerModule = Fts5TokenizerModule1 /* sqlite3.c:223016:36 */
+
+// NOTES ON TRANSACTIONS:
+//
+// SQLite invokes the following virtual table methods as transactions are
+// opened and closed by the user:
+//
+// xBegin(): Start of a new transaction.
+// xSync(): Initial part of two-phase commit.
+// xCommit(): Final part of two-phase commit.
+// xRollback(): Rollback the transaction.
+//
+// Anything that is required as part of a commit that may fail is performed
+// in the xSync() callback. Current versions of SQLite ignore any errors
+// returned by xCommit().
+//
+// And as sub-transactions are opened/closed:
+//
+// xSavepoint(int S): Open savepoint S.
+// xRelease(int S): Commit and close savepoint S.
+// xRollbackTo(int S): Rollback to start of savepoint S.
+//
+// During a write-transaction the fts5_index.c module may cache some data
+// in-memory. It is flushed to disk whenever xSync(), xRelease() or
+// xSavepoint() is called. And discarded whenever xRollback() or xRollbackTo()
+// is called.
+//
+// Additionally, if SQLITE_DEBUG is defined, an instance of the following
+// structure is used to record the current transaction state. This information
+// is not required, but it is used in the assert() statements executed by
+// function fts5CheckTransactionState() (see below).
+type Fts5TransactionState = struct {
+ FeState int32
+ FiSavepoint int32
+}
+
+type Fts5MatchPhrase = struct {
+ FpPoslist uintptr
+ FnTerm int32
+ _ [4]byte
+}
+
+// Return true if pTab is a contentless table.
+func fts5IsContentless(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:223290:12: */
+ return (libc.Bool32((*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FeContent == 1))
+}
+
+// Delete a virtual table handle allocated by fts5InitVtab().
+func fts5FreeVtab(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:223297:13: */
+ if pTab != 0 {
+ sqlite3Fts5IndexClose(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
+ sqlite3Fts5StorageClose(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
+ sqlite3Fts5ConfigFree(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)
+ Xsqlite3_free(tls, pTab)
+ }
+}
+
+// The xDisconnect() virtual table method.
+func fts5DisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:223309:12: */
+ fts5FreeVtab(tls, pVtab)
+ return 0
+}
+
+// The xDestroy() virtual table method.
+func fts5DestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:223317:12: */
+ var pTab uintptr = pVtab
+ var rc int32 = sqlite3Fts5DropAll(tls, (*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)
+ if rc == 0 {
+ fts5FreeVtab(tls, pVtab)
+ }
+ return rc
+}
+
+// This function is the implementation of both the xConnect and xCreate
+// methods of the FTS3 virtual table.
+//
+// The argv[] array contains the following:
+//
+// argv[0] -> module name ("fts5")
+// argv[1] -> database name
+// argv[2] -> table name
+// argv[...] -> "column name" and other module argument fields.
+func fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:223337:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var pGlobal uintptr = pAux
+ var azConfig uintptr = argv
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0 // Return code
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)) = uintptr(0) // Results of parsing argc/argv
+ var pTab uintptr = uintptr(0) // New virtual table object
+
+ // Allocate the new vtab object and parse the configuration
+ pTab = sqlite3Fts5MallocZero(tls, bp /* &rc */, int64(unsafe.Sizeof(Fts5FullTable{})))
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5ConfigParse(tls, pGlobal, db, argc, azConfig, bp+8 /* &pConfig */, pzErr)
+ }
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig = *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */))
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal = pGlobal
+ }
+
+ // Open the index sub-system
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5IndexOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)), bCreate, (pTab /* &.p */ + 32 /* &.pIndex */), pzErr)
+ }
+
+ // Open the storage sub-system
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5StorageOpen(tls,
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)), (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex, bCreate, (pTab + 40 /* &.pStorage */), pzErr)
+ }
+
+ // Call sqlite3_declare_vtab()
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5ConfigDeclareVtab(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)))
+ }
+
+ // Load the initial configuration
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+
+ (*Fts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)))).FpzErrmsg = pzErr
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5IndexLoadConfig(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
+ sqlite3Fts5IndexRollback(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
+ (*Fts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8 /* pConfig */)))).FpzErrmsg = uintptr(0)
+ }
+
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) != 0 {
+ fts5FreeVtab(tls, pTab)
+ pTab = uintptr(0)
+ } else if bCreate != 0 {
+ }
+ *(*uintptr)(unsafe.Pointer(ppVTab)) = pTab
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+}
+
+// The xConnect() and xCreate() methods for the virtual table. All the
+// work is done in function fts5InitVtab().
+func fts5ConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:223403:12: */
+ return fts5InitVtab(tls, 0, db, pAux, argc, argv, ppVtab, pzErr)
+}
+func fts5CreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:223413:12: */
+ return fts5InitVtab(tls, 1, db, pAux, argc, argv, ppVtab, pzErr)
+}
+
+// The different query plans.
+
+// Set the SQLITE_INDEX_SCAN_UNIQUE flag in pIdxInfo->flags. Unless this
+// extension is currently being used by a version of SQLite too old to
+// support index-info flags. In that case this function is a no-op.
+func fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { /* sqlite3.c:223439:13: */
+ {
+ *(*int32)(unsafe.Pointer(pIdxInfo + 80 /* &.idxFlags */)) |= (1)
+ }
+}
+
+// Implementation of the xBestIndex method for FTS5 tables. Within the
+// WHERE constraint, it searches for the following:
+//
+// 1. A MATCH constraint against the table column.
+// 2. A MATCH constraint against the "rank" column.
+// 3. A MATCH constraint against some other column.
+// 4. An == constraint against the rowid column.
+// 5. A < or <= constraint against the rowid column.
+// 6. A > or >= constraint against the rowid column.
+//
+// Within the ORDER BY, the following are supported:
+//
+// 5. ORDER BY rank [ASC|DESC]
+// 6. ORDER BY rowid [ASC|DESC]
+//
+// Information for the xFilter call is passed via both the idxNum and
+// idxStr variables. Specifically, idxNum is a bitmask of the following
+// flags used to encode the ORDER BY clause:
+//
+// FTS5_BI_ORDER_RANK
+// FTS5_BI_ORDER_ROWID
+// FTS5_BI_ORDER_DESC
+//
+// idxStr is used to encode data from the WHERE clause. For each argument
+// passed to the xFilter method, the following is appended to idxStr:
+//
+// Match against table column: "m"
+// Match against rank column: "r"
+// Match against other column: "<column-number>"
+// Equality constraint against the rowid: "="
+// A < or <= against the rowid: "<"
+// A > or >= against the rowid: ">"
+//
+// This function ensures that there is at most one "r" or "=". And that if
+// there exists an "=" then there is no "<" or ">".
+//
+// Costs are assigned as follows:
+//
+// a) If an unusable MATCH operator is present in the WHERE clause, the
+// cost is unconditionally set to 1e50 (a really big number).
+//
+// a) If a MATCH operator is present, the cost depends on the other
+// constraints also present. As follows:
+//
+// * No other constraints: cost=1000.0
+// * One rowid range constraint: cost=750.0
+// * Both rowid range constraints: cost=500.0
+// * An == rowid constraint: cost=100.0
+//
+// b) Otherwise, if there is no MATCH:
+//
+// * No other constraints: cost=1000000.0
+// * One rowid range constraint: cost=750000.0
+// * Both rowid range constraints: cost=250000.0
+// * An == rowid constraint: cost=10.0
+//
+// Costs are not modified by the ORDER BY clause.
+func fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) int32 { /* sqlite3.c:223509:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pTab uintptr = pVTab
+ var pConfig uintptr = (*Fts5Table)(unsafe.Pointer(pTab)).FpConfig
+ var nCol int32 = (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol
+ var idxFlags int32 = 0 // Parameter passed through to xFilter()
+ var i int32
+ var idxStr uintptr
+ var iIdxStr int32 = 0
+ var iCons int32 = 0
+
+ var bSeenEq int32 = 0
+ var bSeenGt int32 = 0
+ var bSeenLt int32 = 0
+ var bSeenMatch int32 = 0
+ var bSeenRank int32 = 0
+
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 {
+ (*Fts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
+ ts+38512 /* "recursively defi..." */, 0)
+ return 1
+ }
+
+ idxStr = Xsqlite3_malloc(tls, (((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint * 6) + 1))
+ if idxStr == uintptr(0) {
+ return 7
+ }
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FidxStr = idxStr
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FneedToFreeIdxStr = 1
+
+ for i = 0; i < (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint; i++ {
+ var p uintptr = ((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12)
+ var iCol int32 = (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn
+ if (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == 64) ||
+ ((int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == 2) && (iCol >= nCol)) {
+ // A MATCH operator or equivalent
+ if (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) == 0) || (iCol < 0) {
+ // As there exists an unusable MATCH constraint this is an
+ // unusable plan. Set a prohibitively high cost.
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = 1e50
+
+ *(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr))) = int8(0)
+ return 0
+ } else {
+ if iCol == (nCol + 1) {
+ if bSeenRank != 0 {
+ continue
+ }
+ *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('r')
+ bSeenRank = 1
+ } else {
+ bSeenMatch = 1
+ *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('m')
+ if iCol < nCol {
+ Xsqlite3_snprintf(tls, 6, (idxStr + uintptr(iIdxStr)), ts+6610 /* "%d" */, libc.VaList(bp, iCol))
+ idxStr += uintptr(libc.Xstrlen(tls, (idxStr + uintptr(iIdxStr))))
+ }
+ }
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).Fomit = uint8(1)
+ }
+ } else if ((((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0) && (bSeenEq == 0)) &&
+ (int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == 2)) && (iCol < 0) {
+ *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('=')
+ bSeenEq = 1
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
+ }
+ }
+
+ if bSeenEq == 0 {
+ for i = 0; i < (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint; i++ {
+ var p uintptr = ((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12)
+ if ((*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn < 0) && ((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable != 0) {
+ var op int32 = int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop)
+ if (op == 16) || (op == 8) {
+ if bSeenLt != 0 {
+ continue
+ }
+ *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('<')
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
+ bSeenLt = 1
+ } else if (op == 4) || (op == 32) {
+ if bSeenGt != 0 {
+ continue
+ }
+ *(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1)))) = int8('>')
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8)).FargvIndex = libc.PreIncInt32(&iCons, 1)
+ bSeenGt = 1
+ }
+ }
+ }
+ }
+ *(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr))) = int8(0)
+
+ // Set idxFlags flags for the ORDER BY clause
+ if (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnOrderBy == 1 {
+ var iSort int32 = (*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy + uintptr(0)*8)).FiColumn
+ if (iSort == ((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol + 1)) && (bSeenMatch != 0) {
+ idxFlags = idxFlags | (0x0020)
+ } else if iSort == -1 {
+ idxFlags = idxFlags | (0x0040)
+ }
+ if ((idxFlags) & (0x0020 | 0x0040)) != 0 {
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).ForderByConsumed = 1
+ if (*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy+uintptr(0)*8)).Fdesc != 0 {
+ idxFlags = idxFlags | (0x0080)
+ }
+ }
+ }
+
+ // Calculate the estimated cost based on the flags set in idxFlags.
+ if bSeenEq != 0 {
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = func() float64 {
+ if bSeenMatch != 0 {
+ return 100.0
+ }
+ return 10.0
+ }()
+ if bSeenMatch == 0 {
+ fts5SetUniqueFlag(tls, pInfo)
+ }
+ } else if (bSeenLt != 0) && (bSeenGt != 0) {
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = func() float64 {
+ if bSeenMatch != 0 {
+ return 500.0
+ }
+ return 250000.0
+ }()
+ } else if (bSeenLt != 0) || (bSeenGt != 0) {
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = func() float64 {
+ if bSeenMatch != 0 {
+ return 750.0
+ }
+ return 750000.0
+ }()
+ } else {
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = func() float64 {
+ if bSeenMatch != 0 {
+ return 1000.0
+ }
+ return 1000000.0
+ }()
+ }
+
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FidxNum = idxFlags
+ return 0
+}
+
+func fts5NewTransaction(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:223640:12: */
+ var pCsr uintptr
+ for pCsr = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab == pTab {
+ return 0
+ }
+ }
+ return sqlite3Fts5StorageReset(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
+}
+
+// Implementation of xOpen method.
+func fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:223651:12: */
+ var pTab uintptr = pVTab
+ var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
+ var pCsr uintptr = uintptr(0) // New cursor object
+ var nByte Sqlite3_int64 // Bytes of space to allocate
+ var rc int32 // Return code
+
+ rc = fts5NewTransaction(tls, pTab)
+ if rc == 0 {
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Cursor{})) + (uint64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) * uint64(unsafe.Sizeof(int32(0))))))
+ pCsr = Xsqlite3_malloc64(tls, uint64(nByte))
+ if pCsr != 0 {
+ var pGlobal uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal
+ libc.Xmemset(tls, pCsr, 0, Size_t(nByte))
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize = (pCsr + uintptr(1)*184)
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpCsr
+ (*Fts5Global)(unsafe.Pointer(pGlobal)).FpCsr = pCsr
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId = libc.PreIncInt64(&(*Fts5Global)(unsafe.Pointer(pGlobal)).FiNextId, 1)
+ } else {
+ rc = 7
+ }
+ }
+ *(*uintptr)(unsafe.Pointer(ppCsr)) = pCsr
+ return rc
+}
+
+func fts5StmtType(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:223677:12: */
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 5 {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FbDesc != 0 {
+ return 1
+ }
+ return 0
+ }
+ return 2
+}
+
+// This function is called after the cursor passed as the only argument
+// is moved to point at a different row. It clears all cached data
+// specific to the previous row stored by the cursor object.
+func fts5CsrNewrow(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:223689:13: */
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (((0x02 | 0x04) | 0x08) | 0x40)
+}
+
+func fts5FreeCursorComponents(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:223698:13: */
+ var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
+ var pData uintptr
+ var pNext uintptr
+
+ Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter)
+ Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst)
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt != 0 {
+ var eStmt int32 = fts5StmtType(tls, pCsr)
+ sqlite3Fts5StorageStmtRelease(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, eStmt, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
+ }
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 {
+ var pSorter uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter
+ Xsqlite3_finalize(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt)
+ Xsqlite3_free(tls, pSorter)
+ }
+
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan != 2 {
+ sqlite3Fts5ExprFree(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
+ }
+
+ for pData = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAuxdata; pData != 0; pData = pNext {
+ pNext = (*Fts5Auxdata)(unsafe.Pointer(pData)).FpNext
+ if (*Fts5Auxdata)(unsafe.Pointer(pData)).FxDelete != 0 {
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pData + 16 /* &.xDelete */))))(tls, (*Fts5Auxdata)(unsafe.Pointer(pData)).FpPtr)
+ }
+ Xsqlite3_free(tls, pData)
+ }
+
+ Xsqlite3_finalize(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRankArgStmt)
+ Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg)
+
+ if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (0x10)) != 0 {
+ Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank)
+ Xsqlite3_free(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs)
+ }
+
+ sqlite3Fts5IndexCloseReader(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
+ libc.Xmemset(tls, (pCsr + 32 /* &.ePlan */), 0, (uint64(unsafe.Sizeof(Fts5Cursor{})) - (uint64((int64((pCsr + 32 /* &.ePlan */)) - int64(pCsr)) / 1))))
+}
+
+// Close the cursor. For additional information see the documentation
+// on the xClose method of the virtual table interface.
+func fts5CloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:223742:12: */
+ if pCursor != 0 {
+ var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
+ var pCsr uintptr = pCursor
+ var pp uintptr
+
+ fts5FreeCursorComponents(tls, pCsr)
+ // Remove the cursor from the Fts5Global.pCsr list
+ for pp = ((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal + 72 /* &.pCsr */); (*(*uintptr)(unsafe.Pointer(pp))) != pCsr; pp = (*(*uintptr)(unsafe.Pointer(pp)) + 8 /* &.pNext */) {
+ }
+ *(*uintptr)(unsafe.Pointer(pp)) = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext
+
+ Xsqlite3_free(tls, pCsr)
+ }
+ return 0
+}
+
+func fts5SorterNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:223758:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var pSorter uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter
+ var rc int32
+
+ rc = Xsqlite3_step(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt)
+ if rc == 101 {
+ rc = 0
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (0x01)
+ } else if rc == 100 {
+ var a uintptr
+ var aBlob uintptr
+ var nBlob int32
+ var i int32
+ var iOff int32 = 0
+ rc = 0
+
+ (*Fts5Sorter)(unsafe.Pointer(pSorter)).FiRowid = Xsqlite3_column_int64(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt, 0)
+ nBlob = Xsqlite3_column_bytes(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt, 1)
+ aBlob = libc.AssignUintptr(&a, Xsqlite3_column_blob(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt, 1))
+
+ // nBlob==0 in detail=none mode.
+ if nBlob > 0 {
+ for i = 0; i < ((*Fts5Sorter)(unsafe.Pointer(pSorter)).FnIdx - 1); i++ {
+ // var iVal int32 at bp, 4
+
+ a += uintptr(sqlite3Fts5GetVarint32(tls, a, bp /* &iVal */))
+ iOff = iOff + (*(*int32)(unsafe.Pointer(bp /* iVal */)))
+ *(*int32)(unsafe.Pointer((pSorter + 28 /* &.aIdx */) + uintptr(i)*4)) = iOff
+ }
+ *(*int32)(unsafe.Pointer((pSorter + 28 /* &.aIdx */) + uintptr(i)*4)) = (int32((int64((aBlob + uintptr(nBlob))) - int64(a)) / 1))
+ (*Fts5Sorter)(unsafe.Pointer(pSorter)).FaPoslist = a
+ }
+
+ fts5CsrNewrow(tls, pCsr)
+ }
+
+ return rc
+}
+
+// Set the FTS5CSR_REQUIRE_RESEEK flag on all FTS5_PLAN_MATCH cursors
+// open on table pTab.
+func fts5TripCursors(tls *libc.TLS, pTab uintptr) { /* sqlite3.c:223801:13: */
+ var pCsr uintptr
+ for pCsr = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext {
+ if ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 1) &&
+ ((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab == pTab) {
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (0x20)
+ }
+ }
+}
+
+// If the REQUIRE_RESEEK flag is set on the cursor passed as the first
+// argument, close and reopen all Fts5IndexIter iterators that the cursor
+// is using. Then attempt to move the cursor to a rowid equal to or laster
+// (in the cursors sort order - ASC or DESC) than the current rowid.
+//
+// If the new rowid is not equal to the old, set output parameter *pbSkip
+// to 1 before returning. Otherwise, leave it unchanged.
+//
+// Return SQLITE_OK if successful or if no reseek was required, or an
+// error code if an error occurred.
+func fts5CursorReseek(tls *libc.TLS, pCsr uintptr, pbSkip uintptr) int32 { /* sqlite3.c:223824:12: */
+ var rc int32 = 0
+
+ if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (0x20)) != 0 {
+ var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
+ var bDesc int32 = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FbDesc
+ var iRowid I64 = sqlite3Fts5ExprRowid(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
+
+ rc = sqlite3Fts5ExprFirst(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex, iRowid, bDesc)
+ if (rc == 0) && (iRowid != sqlite3Fts5ExprRowid(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)) {
+ *(*int32)(unsafe.Pointer(pbSkip)) = 1
+ }
+
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) &= (^int32(libc.Int32FromInt32(0x20)))
+ fts5CsrNewrow(tls, pCsr)
+ if sqlite3Fts5ExprEof(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) != 0 {
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (0x01)
+ *(*int32)(unsafe.Pointer(pbSkip)) = 1
+ }
+ }
+ return rc
+}
+
+// Advance the cursor to the next row in the table that matches the
+// search criteria.
+//
+// Return SQLITE_OK if nothing goes wrong. SQLITE_OK is returned
+// even if we reach end-of-file. The fts5EofMethod() will be called
+// subsequently to determine whether or not an EOF was hit.
+func fts5NextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:223856:12: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ var pCsr uintptr = pCursor
+ var rc int32
+
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan < 3 {
+ *(*int32)(unsafe.Pointer(bp + 8 /* bSkip */)) = 0
+ if (libc.AssignInt32(&rc, fts5CursorReseek(tls, pCsr, bp+8 /* &bSkip */)) != 0) || (*(*int32)(unsafe.Pointer(bp + 8 /* bSkip */)) != 0) {
+ return rc
+ }
+ rc = sqlite3Fts5ExprNext(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid)
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (sqlite3Fts5ExprEof(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr))
+ fts5CsrNewrow(tls, pCsr)
+ } else {
+ switch (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan {
+ case 3:
+ {
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (0x01)
+ rc = 0
+ break
+ }
+ fallthrough
+
+ case 4:
+ {
+ rc = fts5SorterNext(tls, pCsr)
+ break
+ }
+ fallthrough
+
+ default:
+ {
+ var pConfig uintptr = (*Fts5Table)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FpConfig
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FbLock++
+ rc = Xsqlite3_step(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FbLock--
+ if rc != 100 {
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (0x01)
+ rc = Xsqlite3_reset(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
+ if rc != 0 {
+ (*Sqlite3_vtab)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls,
+ ts+805 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb)))
+ }
+ } else {
+ rc = 0
+ }
+ break
+ }
+ }
+ }
+
+ return rc
+}
+
+func fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt uintptr, va uintptr) int32 { /* sqlite3.c:223909:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pRet */)) = uintptr(0)
+ var rc int32
+ var zSql uintptr
+ var ap Va_list
+ _ = ap
+
+ ap = va
+ zSql = Xsqlite3_vmprintf(tls, zFmt, ap)
+ if zSql == uintptr(0) {
+ rc = 7
+ } else {
+ rc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1,
+ uint32(0x01), bp+8 /* &pRet */, uintptr(0))
+ if rc != 0 {
+ *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb)))
+ }
+ Xsqlite3_free(tls, zSql)
+ }
+
+ _ = ap
+ *(*uintptr)(unsafe.Pointer(ppStmt)) = *(*uintptr)(unsafe.Pointer(bp + 8 /* pRet */))
+ return rc
+}
+
+func fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:223938:12: */
+ bp := tls.Alloc(56)
+ defer tls.Free(56)
+
+ var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
+ var pSorter uintptr
+ var nPhrase int32
+ var nByte Sqlite3_int64
+ var rc int32
+ var zRank uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank
+ var zRankArgs uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs
+
+ nPhrase = sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Sorter{})) + (uint64(unsafe.Sizeof(int32(0))) * (uint64(nPhrase - 1)))))
+ pSorter = Xsqlite3_malloc64(tls, uint64(nByte))
+ if pSorter == uintptr(0) {
+ return 7
+ }
+ libc.Xmemset(tls, pSorter, 0, Size_t(nByte))
+ (*Fts5Sorter)(unsafe.Pointer(pSorter)).FnIdx = nPhrase
+
+ // TODO: It would be better to have some system for reusing statement
+ // handles here, rather than preparing a new one for each query. But that
+ // is not possible as SQLite reference counts the virtual table objects.
+ // And since the statement required here reads from this very virtual
+ // table, saving it creates a circular reference.
+ //
+ // If SQLite a built-in statement cache, this wouldn't be a problem.
+ rc = fts5PrepareStatement(tls, (pSorter /* &.pStmt */), pConfig,
+ ts+38551, /* "SELECT rowid, ra..." */
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName,
+ func() uintptr {
+ if zRankArgs != 0 {
+ return ts + 15677 /* ", " */
+ }
+ return ts + 781 /* "" */
+ }(),
+ func() uintptr {
+ if zRankArgs != 0 {
+ return zRankArgs
+ }
+ return ts + 781 /* "" */
+ }(),
+ func() uintptr {
+ if bDesc != 0 {
+ return ts + 38606 /* "DESC" */
+ }
+ return ts + 38611 /* "ASC" */
+ }()))
+
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter
+ if rc == 0 {
+
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr
+ rc = fts5SorterNext(tls, pCsr)
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = uintptr(0)
+ }
+
+ if rc != 0 {
+ Xsqlite3_finalize(tls, (*Fts5Sorter)(unsafe.Pointer(pSorter)).FpStmt)
+ Xsqlite3_free(tls, pSorter)
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = uintptr(0)
+ }
+
+ return rc
+}
+
+func fts5CursorFirst(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int32) int32 { /* sqlite3.c:223990:12: */
+ var rc int32
+ var pExpr uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr
+ rc = sqlite3Fts5ExprFirst(tls, pExpr, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid, bDesc)
+ if sqlite3Fts5ExprEof(tls, pExpr) != 0 {
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (0x01)
+ }
+ fts5CsrNewrow(tls, pCsr)
+ return rc
+}
+
+// Process a "special" query. A special query is identified as one with a
+// MATCH expression that begins with a '*' character. The remainder of
+// the text passed to the MATCH operator are used as the special query
+// parameters.
+func fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr) int32 { /* sqlite3.c:224007:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var rc int32 = 0 // Return code
+ var z uintptr = zQuery // Special query text
+ var n int32 // Number of bytes in text at z
+
+ for int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == ' ' {
+ z++
+ }
+ for n = 0; (*(*int8)(unsafe.Pointer(z + uintptr(n))) != 0) && (int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) != ' '); n++ {
+ }
+
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = 3
+
+ if (n == 5) && (0 == Xsqlite3_strnicmp(tls, ts+38615 /* "reads" */, z, n)) {
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = I64(sqlite3Fts5IndexReads(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex))
+ } else if (n == 2) && (0 == Xsqlite3_strnicmp(tls, ts+6754 /* "id" */, z, n)) {
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId
+ } else {
+ // An unrecognized directive. Return an error message.
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+38621 /* "unknown special ..." */, libc.VaList(bp, n, z))
+ rc = 1
+ }
+
+ return rc
+}
+
+// Search for an auxiliary function named zName that can be used with table
+// pTab. If one is found, return a pointer to the corresponding Fts5Auxiliary
+// structure. Otherwise, if no such function exists, return NULL.
+func fts5FindAuxiliary(tls *libc.TLS, pTab uintptr, zName uintptr) uintptr { /* sqlite3.c:224042:22: */
+ var pAux uintptr
+
+ for pAux = (*Fts5Global)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpGlobal)).FpAux; pAux != 0; pAux = (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpNext {
+ if Xsqlite3_stricmp(tls, zName, (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FzFunc) == 0 {
+ return pAux
+ }
+ }
+
+ // No function of the specified name was found. Return 0.
+ return uintptr(0)
+}
+
+func fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:224054:12: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
+ var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = 0
+ var pAux uintptr = uintptr(0)
+ var zRank uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank
+ var zRankArgs uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs
+
+ if zRankArgs != 0 {
+ var zSql uintptr = sqlite3Fts5Mprintf(tls, bp+16 /* &rc */, ts+38649 /* "SELECT %s" */, libc.VaList(bp, zRankArgs))
+ if zSql != 0 {
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1,
+ uint32(0x01), bp+24 /* &pStmt */, uintptr(0))
+ Xsqlite3_free(tls, zSql)
+
+ if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
+ if 100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */))) {
+ var nByte Sqlite3_int64
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)))
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(uintptr(0))) * uint64((*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg)))
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg = sqlite3Fts5MallocZero(tls, bp+16 /* &rc */, nByte)
+ if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
+ var i int32
+ for i = 0; i < (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg; i++ {
+ *(*uintptr)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg + uintptr(i)*8)) = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)), i)
+ }
+ }
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRankArgStmt = *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */))
+ } else {
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pStmt */)))
+ }
+ }
+ }
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
+ pAux = fts5FindAuxiliary(tls, pTab, zRank)
+ if pAux == uintptr(0) {
+
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, ts+38659 /* "no such function..." */, libc.VaList(bp+8, zRank))
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = 1
+ }
+ }
+
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRank = pAux
+ return *(*int32)(unsafe.Pointer(bp + 16 /* rc */))
+}
+
+func fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank uintptr) int32 { /* sqlite3.c:224105:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var rc int32 = 0
+ if pRank != 0 {
+ var z uintptr = Xsqlite3_value_text(tls, pRank)
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* zRank */)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* zRankArgs */)) = uintptr(0)
+
+ if z == uintptr(0) {
+ if Xsqlite3_value_type(tls, pRank) == 5 {
+ rc = 1
+ }
+ } else {
+ rc = sqlite3Fts5ConfigParseRank(tls, z, bp+8 /* &zRank */, bp+16 /* &zRankArgs */)
+ }
+ if rc == 0 {
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = *(*uintptr)(unsafe.Pointer(bp + 8 /* zRank */))
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = *(*uintptr)(unsafe.Pointer(bp + 16 /* zRankArgs */))
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) |= (0x10)
+ } else if rc == 1 {
+ (*Sqlite3_vtab)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls,
+ ts+38680 /* "parse error in r..." */, libc.VaList(bp, z))
+ }
+ } else {
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank != 0 {
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*Fts5Config)(unsafe.Pointer(pConfig)).FzRank
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*Fts5Config)(unsafe.Pointer(pConfig)).FzRankArgs
+ } else {
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRank = ts + 36421 /* "bm25" */
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0)
+ }
+ }
+ return rc
+}
+
+func fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault I64) I64 { /* sqlite3.c:224142:12: */
+ if pVal != 0 {
+ var eType int32 = Xsqlite3_value_numeric_type(tls, pVal)
+ if eType == 1 {
+ return Xsqlite3_value_int64(tls, pVal)
+ }
+ }
+ return iDefault
+}
+
+// This is the xFilter interface for the virtual table. See
+// the virtual table xFilter method documentation for additional
+// information.
+//
+// There are three possible query strategies:
+//
+// 1. Full-text search using a MATCH operator.
+// 2. A by-rowid lookup.
+// 3. A full-table scan.
+func fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, nVal int32, apVal uintptr) int32 { /* sqlite3.c:224163:12: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
+
+ var pTab uintptr
+ var pConfig uintptr
+ var pCsr uintptr
+ var rc int32 // Error code
+ var bDesc int32 // True if ORDER BY [rank|rowid] DESC
+ var bOrderByRank int32 // True if ORDER BY rank
+ var pRank uintptr // rank MATCH ? expression (or NULL)
+ var pRowidEq uintptr // rowid = ? expression (or NULL)
+ var pRowidLe uintptr // rowid <= ? expression (or NULL)
+ var pRowidGe uintptr // rowid >= ? expression (or NULL)
+ var iCol int32 // Column on LHS of MATCH operator
+ var pzErrmsg uintptr
+ var i int32
+ var iIdxStr int32
+ // var pExpr uintptr at bp+8, 8
+
+ var pzErr uintptr
+ var zText uintptr
+ pTab = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
+ pConfig = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
+ pCsr = pCursor
+ rc = 0
+ pRank = uintptr(0)
+ pRowidEq = uintptr(0)
+ pRowidLe = uintptr(0)
+ pRowidGe = uintptr(0)
+ pzErrmsg = (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg
+ iIdxStr = 0
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */)) = uintptr(0)
+
+ if !((*Fts5Config)(unsafe.Pointer(pConfig)).FbLock != 0) {
+ goto __1
+ }
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
+ ts+38512 /* "recursively defi..." */, 0)
+ return 1
+__1:
+ ;
+
+ if !((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan != 0) {
+ goto __2
+ }
+ fts5FreeCursorComponents(tls, pCsr)
+ libc.Xmemset(tls, (pCsr + 32 /* &.ePlan */), 0, (uint64(unsafe.Sizeof(Fts5Cursor{})) - (uint64((int64((pCsr + 32 /* &.ePlan */)) - int64(pCsr)) / 1))))
+__2:
+ ;
+
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = (pTab /* &.p */ /* &.base */ + 16 /* &.zErrMsg */)
+
+ // Decode the arguments passed through to this function.
+ i = 0
+__3:
+ if !(i < nVal) {
+ goto __5
+ }
+ switch int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(libc.PostIncInt32(&iIdxStr, 1))))) {
+ case 'r':
+ goto __7
+ case 'm':
+ goto __8
+ case '=':
+ goto __9
+ case '<':
+ goto __10
+ default:
+ goto __11
+ }
+ goto __6
+__7:
+ pRank = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))
+ goto __6
+__8:
+ zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)))
+ if !(zText == uintptr(0)) {
+ goto __12
+ }
+ zText = ts + 781 /* "" */
+__12:
+ ;
+
+ if !((int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= '9')) {
+ goto __13
+ }
+ iCol = 0
+__15:
+ iCol = ((iCol * 10) + (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) - '0'))
+ iIdxStr++
+ goto __16
+__16:
+ if (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= '0') && (int32(*(*int8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= '9') {
+ goto __15
+ }
+ goto __17
+__17:
+ ;
+ goto __14
+__13:
+ iCol = (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol
+__14:
+ ;
+
+ if !(int32(*(*int8)(unsafe.Pointer(zText + uintptr(0)))) == '*') {
+ goto __18
+ }
+ // The user has issued a query of the form "MATCH '*...'". This
+ // indicates that the MATCH expression is not a full text query,
+ // but a request for an internal parameter.
+ rc = fts5SpecialMatch(tls, pTab, pCsr, (zText + uintptr(1)))
+ goto filter_out
+ goto __19
+__18:
+ pzErr = (pTab /* &.p */ /* &.base */ + 16 /* &.zErrMsg */)
+ rc = sqlite3Fts5ExprNew(tls, pConfig, iCol, zText, bp+8 /* &pExpr */, pzErr)
+ if !(rc == 0) {
+ goto __20
+ }
+ rc = sqlite3Fts5ExprAnd(tls, (pCsr + 64 /* &.pExpr */), *(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */)))
+ *(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */)) = uintptr(0)
+__20:
+ ;
+ if !(rc != 0) {
+ goto __21
+ }
+ goto filter_out
+__21:
+ ;
+__19:
+ ;
+
+ goto __6
+__9:
+ pRowidEq = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))
+ goto __6
+__10:
+ pRowidLe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))
+ goto __6
+__11:
+ ;
+ pRowidGe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))
+ goto __6
+__6:
+ ;
+ goto __4
+__4:
+ i++
+ goto __3
+ goto __5
+__5:
+ ;
+ bOrderByRank = func() int32 {
+ if (idxNum & 0x0020) != 0 {
+ return 1
+ }
+ return 0
+ }()
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FbDesc = libc.AssignInt32(&bDesc, func() int32 {
+ if (idxNum & 0x0080) != 0 {
+ return 1
+ }
+ return 0
+ }())
+
+ // Set the cursor upper and lower rowid limits. Only some strategies
+ // actually use them. This is ok, as the xBestIndex() method leaves the
+ // sqlite3_index_constraint.omit flag clear for range constraints
+ // on the rowid field.
+ if !(pRowidEq != 0) {
+ goto __22
+ }
+ pRowidLe = libc.AssignUintptr(&pRowidGe, pRowidEq)
+__22:
+ ;
+ if !(bDesc != 0) {
+ goto __23
+ }
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = fts5GetRowidLimit(tls, pRowidLe, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = fts5GetRowidLimit(tls, pRowidGe, ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))
+ goto __24
+__23:
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = fts5GetRowidLimit(tls, pRowidLe, (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = fts5GetRowidLimit(tls, pRowidGe, ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))))
+__24:
+ ;
+
+ if !((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr != 0) {
+ goto __25
+ }
+ // If pSortCsr is non-NULL, then this call is being made as part of
+ // processing for a "... MATCH <expr> ORDER BY rank" query (ePlan is
+ // set to FTS5_PLAN_SORTED_MATCH). pSortCsr is the cursor that will
+ // return results to the user for this query. The current cursor
+ // (pCursor) is used to execute the query issued by function
+ // fts5CursorFirstSorted() above.
+
+ if !((*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FbDesc != 0) {
+ goto __27
+ }
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiFirstRowid
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiLastRowid
+ goto __28
+__27:
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiLastRowid
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FiFirstRowid
+__28:
+ ;
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = 2
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr = (*Fts5Cursor)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr)).FpExpr
+ rc = fts5CursorFirst(tls, pTab, pCsr, bDesc)
+ goto __26
+__25:
+ if !((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr != 0) {
+ goto __29
+ }
+ rc = fts5CursorParseRank(tls, pConfig, pCsr, pRank)
+ if !(rc == 0) {
+ goto __31
+ }
+ if !(bOrderByRank != 0) {
+ goto __32
+ }
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = 4
+ rc = fts5CursorFirstSorted(tls, pTab, pCsr, bDesc)
+ goto __33
+__32:
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = 1
+ rc = fts5CursorFirst(tls, pTab, pCsr, bDesc)
+__33:
+ ;
+__31:
+ ;
+ goto __30
+__29:
+ if !((*Fts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0)) {
+ goto __34
+ }
+ *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls,
+ ts+38713 /* "%s: table does n..." */, libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
+ rc = 1
+ goto __35
+__34:
+ // This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup
+ // by rowid (ePlan==FTS5_PLAN_ROWID).
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan = func() int32 {
+ if pRowidEq != 0 {
+ return 6
+ }
+ return 5
+ }()
+ rc = sqlite3Fts5StorageStmt(tls,
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, fts5StmtType(tls, pCsr), (pCsr + 56 /* &.pStmt */), (pTab /* &.p */ /* &.base */ + 16 /* &.zErrMsg */))
+ if !(rc == 0) {
+ goto __36
+ }
+ if !((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 6) {
+ goto __37
+ }
+ Xsqlite3_bind_value(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 1, pRowidEq)
+ goto __38
+__37:
+ Xsqlite3_bind_int64(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 1, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiFirstRowid)
+ Xsqlite3_bind_int64(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 2, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiLastRowid)
+__38:
+ ;
+ rc = fts5NextMethod(tls, pCursor)
+__36:
+ ;
+__35:
+ ;
+__30:
+ ;
+__26:
+ ;
+
+filter_out:
+ sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* pExpr */)))
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = pzErrmsg
+ return rc
+}
+
+// This is the xEof method of the virtual table. SQLite calls this
+// routine to find out if it has reached the end of a result set.
+func fts5EofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:224341:12: */
+ var pCsr uintptr = pCursor
+ return func() int32 {
+ if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (0x01)) != 0 {
+ return 1
+ }
+ return 0
+ }()
+}
+
+// Return the rowid that the cursor currently points to.
+func fts5CursorRowid(tls *libc.TLS, pCsr uintptr) I64 { /* sqlite3.c:224349:12: */
+
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 {
+ return (*Fts5Sorter)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter)).FiRowid
+ } else {
+ return sqlite3Fts5ExprRowid(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
+ }
+ return I64(0)
+}
+
+// This is the xRowid method. The SQLite core calls this routine to
+// retrieve the rowid for the current row of the result set. fts5
+// exposes %_content.rowid as the rowid for the virtual table. The
+// rowid should be written to *pRowid.
+func fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:224367:12: */
+ var pCsr uintptr = pCursor
+ var ePlan int32 = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan
+
+ switch ePlan {
+ case 3:
+ *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = int64(0)
+ break
+
+ case 2:
+ fallthrough
+ case 1:
+ fallthrough
+ case 4:
+ *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = fts5CursorRowid(tls, pCsr)
+ break
+
+ default:
+ *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = Xsqlite3_column_int64(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 0)
+ break
+ }
+
+ return 0
+}
+
+// If the cursor requires seeking (bSeekRequired flag is set), seek it.
+// Return SQLITE_OK if no error occurs, or an SQLite error code otherwise.
+//
+// If argument bErrormsg is true and an error occurs, an error message may
+// be left in sqlite3_vtab.zErrMsg.
+func fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) int32 { /* sqlite3.c:224398:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 = 0
+
+ // If the cursor does not yet have a statement handle, obtain one now.
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt == uintptr(0) {
+ var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
+ var eStmt int32 = fts5StmtType(tls, pCsr)
+ rc = sqlite3Fts5StorageStmt(tls,
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, eStmt, (pCsr + 56 /* &.pStmt */), func() uintptr {
+ if bErrormsg != 0 {
+ return (pTab /* &.p */ /* &.base */ + 16 /* &.zErrMsg */)
+ }
+ return uintptr(0)
+ }())
+
+ }
+
+ if (rc == 0) && (((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (0x02)) != 0) {
+ var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
+
+ Xsqlite3_reset(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
+ Xsqlite3_bind_int64(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 1, fts5CursorRowid(tls, pCsr))
+ (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FbLock++
+ rc = Xsqlite3_step(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
+ (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FbLock--
+ if rc == 100 {
+ rc = 0
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) &= (^int32(libc.Int32FromInt32(0x02)))
+ } else {
+ rc = Xsqlite3_reset(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt)
+ if rc == 0 {
+ rc = (11 | (int32(1) << 8))
+ } else if (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FpzErrmsg != 0 {
+ *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls,
+ ts+805 /* "%s" */, libc.VaList(bp, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pTab)).FpConfig)).Fdb)))
+ }
+ }
+ }
+ return rc
+}
+
+func fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { /* sqlite3.c:224437:13: */
+ var ap Va_list
+ _ = ap // ... printf arguments
+ ap = va
+
+ (*Fts5FullTable)(unsafe.Pointer(p)).Fp.Fbase.FzErrMsg = Xsqlite3_vmprintf(tls, zFormat, ap)
+ _ = ap
+}
+
+// This function is called to handle an FTS INSERT command. In other words,
+// an INSERT statement of the form:
+//
+// INSERT INTO fts(fts) VALUES($pCmd)
+// INSERT INTO fts(fts, rank) VALUES($pCmd, $pVal)
+//
+// Argument pVal is the value assigned to column "fts" by the INSERT
+// statement. This function returns SQLITE_OK if successful, or an SQLite
+// error code if an error occurs.
+//
+// The commands implemented by this function are documented in the "Special
+// INSERT Directives" section of the documentation. It should be updated if
+// more commands are added to this function.
+func fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) int32 { /* sqlite3.c:224460:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
+ var rc int32 = 0
+ *(*int32)(unsafe.Pointer(bp /* bError */)) = 0
+
+ if 0 == Xsqlite3_stricmp(tls, ts+38749 /* "delete-all" */, zCmd) {
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == 0 {
+ fts5SetVtabError(tls, pTab,
+
+ ts+38760 /* "'delete-all' may..." */, 0)
+ rc = 1
+ } else {
+ rc = sqlite3Fts5StorageDeleteAll(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
+ }
+ } else if 0 == Xsqlite3_stricmp(tls, ts+38840 /* "rebuild" */, zCmd) {
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == 1 {
+ fts5SetVtabError(tls, pTab,
+ ts+38848 /* "'rebuild' may no..." */, 0)
+ rc = 1
+ } else {
+ rc = sqlite3Fts5StorageRebuild(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
+ }
+ } else if 0 == Xsqlite3_stricmp(tls, ts+17949 /* "optimize" */, zCmd) {
+ rc = sqlite3Fts5StorageOptimize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
+ } else if 0 == Xsqlite3_stricmp(tls, ts+38904 /* "merge" */, zCmd) {
+ var nMerge int32 = Xsqlite3_value_int(tls, pVal)
+ rc = sqlite3Fts5StorageMerge(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, nMerge)
+ } else if 0 == Xsqlite3_stricmp(tls, ts+38910 /* "integrity-check" */, zCmd) {
+ rc = sqlite3Fts5StorageIntegrity(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
+ } else {
+ rc = sqlite3Fts5IndexLoadConfig(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)
+ if rc == 0 {
+ rc = sqlite3Fts5ConfigSetValue(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig, zCmd, pVal, bp /* &bError */)
+ }
+ if rc == 0 {
+ if *(*int32)(unsafe.Pointer(bp /* bError */)) != 0 {
+ rc = 1
+ } else {
+ rc = sqlite3Fts5StorageConfigValue(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, zCmd, pVal, 0)
+ }
+ }
+ }
+ return rc
+}
+
+func fts5SpecialDelete(tls *libc.TLS, pTab uintptr, apVal uintptr) int32 { /* sqlite3.c:224515:12: */
+ var rc int32 = 0
+ var eType1 int32 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8)))
+ if eType1 == 1 {
+ var iDel Sqlite3_int64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8)))
+ rc = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iDel, (apVal + uintptr(2)*8))
+ }
+ return rc
+}
+
+func fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, piRowid uintptr) { /* sqlite3.c:224528:13: */
+ var rc int32 = *(*int32)(unsafe.Pointer(pRc))
+ if rc == 0 {
+ rc = sqlite3Fts5StorageContentInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, piRowid)
+ }
+ if rc == 0 {
+ rc = sqlite3Fts5StorageIndexInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, *(*I64)(unsafe.Pointer(piRowid)))
+ }
+ *(*int32)(unsafe.Pointer(pRc)) = rc
+}
+
+// This function is the implementation of the xUpdate callback used by
+// FTS3 virtual tables. It is invoked by SQLite each time a row is to be
+// inserted, updated or deleted.
+//
+// A delete specifies a single argument - the rowid of the row to remove.
+//
+// Update and insert operations pass:
+//
+// 1. The "old" rowid, or NULL.
+// 2. The "new" rowid.
+// 3. Values for each of the nCol matchable columns.
+// 4. Values for the two hidden columns (<tablename> and "rank").
+func fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, pRowid uintptr) int32 { /* sqlite3.c:224558:12: */
+ bp := tls.Alloc(20)
+ defer tls.Free(20)
+
+ var pTab uintptr = pVtab
+ var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
+ var eType0 int32 // value_type() of apVal[0]
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = 0 // Return code
+
+ // A transaction must be open when this is called.
+
+ (*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = (pTab /* &.p */ /* &.base */ + 16 /* &.zErrMsg */)
+
+ // Put any active cursors into REQUIRE_SEEK state.
+ fts5TripCursors(tls, pTab)
+
+ eType0 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8)))
+ if (eType0 == 5) &&
+ (Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))*8))) != 5) {
+ // A "special" INSERT op. These are handled separately.
+ var z uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol))*8)))
+ if ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != 0) &&
+ (0 == Xsqlite3_stricmp(tls, ts+18488 /* "delete" */, z)) {
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = fts5SpecialDelete(tls, pTab, apVal)
+ } else {
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = fts5SpecialInsert(tls, pTab, z, *(*uintptr)(unsafe.Pointer(apVal + uintptr(((2+(*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)+1))*8)))
+ }
+ } else {
+ // A regular INSERT, UPDATE or DELETE statement. The trick here is that
+ // any conflict on the rowid value must be detected before any
+ // modifications are made to the database file. There are 4 cases:
+ //
+ // 1) DELETE
+ // 2) UPDATE (rowid not modified)
+ // 3) UPDATE (rowid modified)
+ // 4) INSERT
+ //
+ // Cases 3 and 4 may violate the rowid constraint.
+ var eConflict int32 = 4
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == 0 {
+ eConflict = Xsqlite3_vtab_on_conflict(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb)
+ }
+
+ // Filter out attempts to run UPDATE or DELETE on contentless tables.
+ // This is not suported.
+ if (eType0 == 1) && (fts5IsContentless(tls, pTab) != 0) {
+ (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls,
+ ts+38926, /* "cannot %s conten..." */
+ libc.VaList(bp, func() uintptr {
+ if nArg > 1 {
+ return ts + 21891 /* "UPDATE" */
+ }
+ return ts + 38963 /* "DELETE from" */
+ }(), (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = 1
+ } else if nArg == 1 {
+ var iDel I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8))) // Rowid to delete
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iDel, uintptr(0))
+ } else {
+ var eType1 int32 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8)))
+
+ if (eType1 != 1) && (eType1 != 5) {
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = 20
+ } else if eType0 != 1 {
+ // If this is a REPLACE, first remove the current entry (if any)
+ if (eConflict == 5) && (eType1 == 1) {
+ var iNew I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8))) // Rowid to delete
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iNew, uintptr(0))
+ }
+ fts5StorageInsert(tls, bp+16 /* &rc */, pTab, apVal, pRowid)
+ } else {
+ var iOld I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(0)*8))) // Old rowid
+ var iNew I64 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8))) // New rowid
+ if (eType1 == 1) && (iOld != iNew) {
+ if eConflict == 5 {
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iOld, uintptr(0))
+ if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iNew, uintptr(0))
+ }
+ fts5StorageInsert(tls, bp+16 /* &rc */, pTab, apVal, pRowid)
+ } else {
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageContentInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, pRowid)
+ if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iOld, uintptr(0))
+ }
+ if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageIndexInsert(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, *(*Sqlite_int64)(unsafe.Pointer(pRowid)))
+ }
+ }
+ } else {
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5StorageDelete(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iOld, uintptr(0))
+ fts5StorageInsert(tls, bp+16 /* &rc */, pTab, apVal, pRowid)
+ }
+ }
+ }
+ }
+
+ (*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = uintptr(0)
+ return *(*int32)(unsafe.Pointer(bp + 16 /* rc */))
+}
+
+// Implementation of xSync() method.
+func fts5SyncMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224684:12: */
+ var rc int32
+ var pTab uintptr = pVtab
+
+ (*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = (pTab /* &.p */ /* &.base */ + 16 /* &.zErrMsg */)
+ fts5TripCursors(tls, pTab)
+ rc = sqlite3Fts5StorageSync(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
+ (*Fts5Config)(unsafe.Pointer((*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = uintptr(0)
+ return rc
+}
+
+// Implementation of xBegin() method.
+func fts5BeginMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224698:12: */
+
+ fts5NewTransaction(tls, pVtab)
+ return 0
+}
+
+// Implementation of xCommit() method. This is a no-op. The contents of
+// the pending-terms hash-table have already been flushed into the database
+// by fts5SyncMethod().
+func fts5CommitMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224709:12: */
+ _ = pVtab // Call below is a no-op for NDEBUG builds
+
+ return 0
+}
+
+// Implementation of xRollback(). Discard the contents of the pending-terms
+// hash-table. Any changes made to the database are reverted by SQLite.
+func fts5RollbackMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:224719:12: */
+ var rc int32
+ var pTab uintptr = pVtab
+
+ rc = sqlite3Fts5StorageRollback(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
+ return rc
+}
+
+func fts5ApiUserData(tls *libc.TLS, pCtx uintptr) uintptr { /* sqlite3.c:224729:13: */
+ var pCsr uintptr = pCtx
+ return (*Fts5Auxiliary)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux)).FpUserData
+}
+
+func fts5ApiColumnCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:224734:12: */
+ var pCsr uintptr = pCtx
+ return (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig)).FnCol
+}
+
+func fts5ApiColumnTotalSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:224739:12: */
+ var pCsr uintptr = pCtx
+ var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
+ return sqlite3Fts5StorageSize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iCol, pnToken)
+}
+
+func fts5ApiRowCount(tls *libc.TLS, pCtx uintptr, pnRow uintptr) int32 { /* sqlite3.c:224749:12: */
+ var pCsr uintptr = pCtx
+ var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
+ return sqlite3Fts5StorageRowCount(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, pnRow)
+}
+
+func fts5ApiTokenize(tls *libc.TLS, pCtx uintptr, pText uintptr, nText int32, pUserData uintptr, xToken uintptr) int32 { /* sqlite3.c:224755:12: */
+ var pCsr uintptr = pCtx
+ var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
+ return sqlite3Fts5Tokenize(tls,
+ (*Fts5Table)(unsafe.Pointer(pTab)).FpConfig, 0x0008, pText, nText, pUserData, xToken)
+}
+
+func fts5ApiPhraseCount(tls *libc.TLS, pCtx uintptr) int32 { /* sqlite3.c:224768:12: */
+ var pCsr uintptr = pCtx
+ return sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
+}
+
+func fts5ApiPhraseSize(tls *libc.TLS, pCtx uintptr, iPhrase int32) int32 { /* sqlite3.c:224773:12: */
+ var pCsr uintptr = pCtx
+ return sqlite3Fts5ExprPhraseSize(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase)
+}
+
+func fts5ApiColumnText(tls *libc.TLS, pCtx uintptr, iCol int32, pz uintptr, pn uintptr) int32 { /* sqlite3.c:224778:12: */
+ var rc int32 = 0
+ var pCsr uintptr = pCtx
+ if (fts5IsContentless(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab) != 0) ||
+ ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 3) {
+ *(*uintptr)(unsafe.Pointer(pz)) = uintptr(0)
+ *(*int32)(unsafe.Pointer(pn)) = 0
+ } else {
+ rc = fts5SeekCursor(tls, pCsr, 0)
+ if rc == 0 {
+ *(*uintptr)(unsafe.Pointer(pz)) = Xsqlite3_column_text(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, (iCol + 1))
+ *(*int32)(unsafe.Pointer(pn)) = Xsqlite3_column_bytes(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, (iCol + 1))
+ }
+ }
+ return rc
+}
+
+func fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn uintptr) int32 { /* sqlite3.c:224801:12: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ var pConfig uintptr = (*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig
+ var rc int32 = 0
+ var bLive int32 = (libc.Bool32((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter == uintptr(0)))
+
+ if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (0x40)) != 0 {
+
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail != 0 {
+ var aPopulator uintptr
+ var i int32
+ aPopulator = sqlite3Fts5ExprClearPoslists(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, bLive)
+ if aPopulator == uintptr(0) {
+ rc = 7
+ }
+ for i = 0; (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) && (rc == 0); i++ {
+ // var n int32 at bp+8, 4
+
+ // var z uintptr at bp, 8
+
+ rc = fts5ApiColumnText(tls, pCsr, i, bp /* &z */, bp+8 /* &n */)
+ if rc == 0 {
+ rc = sqlite3Fts5ExprPopulatePoslists(tls,
+ pConfig, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, aPopulator, i, *(*uintptr)(unsafe.Pointer(bp /* z */)), *(*int32)(unsafe.Pointer(bp + 8 /* n */)))
+ }
+ }
+ Xsqlite3_free(tls, aPopulator)
+
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 {
+ sqlite3Fts5ExprCheckPoslists(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, (*Fts5Sorter)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter)).FiRowid)
+ }
+ }
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) &= (^int32(libc.Int32FromInt32(0x40)))
+ }
+
+ if ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == 0) {
+ var pSorter uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter
+ var i1 int32 = func() int32 {
+ if iPhrase == 0 {
+ return 0
+ }
+ return *(*int32)(unsafe.Pointer((pSorter + 28 /* &.aIdx */) + uintptr((iPhrase-1))*4))
+ }()
+ *(*int32)(unsafe.Pointer(pn)) = (*(*int32)(unsafe.Pointer((pSorter + 28 /* &.aIdx */) + uintptr(iPhrase)*4)) - i1)
+ *(*uintptr)(unsafe.Pointer(pa)) = ((*Fts5Sorter)(unsafe.Pointer(pSorter)).FaPoslist + uintptr(i1))
+ } else {
+ *(*int32)(unsafe.Pointer(pn)) = sqlite3Fts5ExprPoslist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, pa)
+ }
+
+ return rc
+}
+
+// Ensure that the Fts5Cursor.nInstCount and aInst[] variables are populated
+// correctly for the current view. Return SQLITE_OK if successful, or an
+// SQLite error code otherwise.
+func fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:224853:12: */
+ bp := tls.Alloc(20)
+ defer tls.Free(20)
+
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ var aIter uintptr // One iterator for each phrase
+ var nIter int32 // Number of iterators/phrases
+ var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig)).FnCol
+
+ nIter = sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter == uintptr(0) {
+ var nByte Sqlite3_int64 = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5PoslistReader{})) * uint64(nIter)))
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter = sqlite3Fts5MallocZero(tls, bp /* &rc */, nByte)
+ }
+ aIter = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInstIter
+
+ if aIter != 0 {
+ var nInst int32 = 0 // Number instances seen so far
+ var i int32
+
+ // Initialize all iterators
+ for i = 0; (i < nIter) && (*(*int32)(unsafe.Pointer(bp /* rc */)) == 0); i++ {
+ // var a uintptr at bp+8, 8
+
+ // var n int32 at bp+16, 4
+
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = fts5CsrPoslist(tls, pCsr, i, bp+8 /* &a */, bp+16 /* &n */)
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ sqlite3Fts5PoslistReaderInit(tls, *(*uintptr)(unsafe.Pointer(bp + 8 /* a */)), *(*int32)(unsafe.Pointer(bp + 16 /* n */)), (aIter + uintptr(i)*32))
+ }
+ }
+
+ if *(*int32)(unsafe.Pointer(bp /* rc */)) == 0 {
+ for 1 != 0 {
+ var aInst uintptr
+ var iBest int32 = -1
+ for i = 0; i < nIter; i++ {
+ if (int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FbEof) == 0) &&
+ ((iBest < 0) || ((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(i)*32)).FiPos < (*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(iBest)*32)).FiPos)) {
+ iBest = i
+ }
+ }
+ if iBest < 0 {
+ break
+ }
+
+ nInst++
+ if nInst >= (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc {
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc = func() int32 {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc != 0 {
+ return ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc * 2)
+ }
+ return 32
+ }()
+ aInst = Xsqlite3_realloc64(tls,
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst, (uint64((uint64((*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstAlloc) * uint64(unsafe.Sizeof(int32(0)))) * uint64(3))))
+ if aInst != 0 {
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst = aInst
+ } else {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 7
+ break
+ }
+ }
+
+ aInst = ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr((3*(nInst-1)))*4)
+ *(*int32)(unsafe.Pointer(aInst + uintptr(0)*4)) = iBest
+ *(*int32)(unsafe.Pointer(aInst + uintptr(1)*4)) = (int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(iBest)*32)).FiPos >> 32))
+ *(*int32)(unsafe.Pointer(aInst + uintptr(2)*4)) = (int32((*Fts5PoslistReader)(unsafe.Pointer(aIter+uintptr(iBest)*32)).FiPos & int64(0x7FFFFFFF)))
+ if (*(*int32)(unsafe.Pointer(aInst + uintptr(1)*4)) < 0) || (*(*int32)(unsafe.Pointer(aInst + uintptr(1)*4)) >= nCol) {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = (11 | (int32(1) << 8))
+ break
+ }
+ sqlite3Fts5PoslistReaderNext(tls, (aIter + uintptr(iBest)*32))
+ }
+ }
+
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstCount = nInst
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) &= (^int32(libc.Int32FromInt32(0x08)))
+ }
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+}
+
+func fts5ApiInstCount(tls *libc.TLS, pCtx uintptr, pnInst uintptr) int32 { /* sqlite3.c:224925:12: */
+ var pCsr uintptr = pCtx
+ var rc int32 = 0
+ if (((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (0x08)) == 0) ||
+ (0 == (libc.AssignInt32(&rc, fts5CacheInstArray(tls, pCsr)))) {
+ *(*int32)(unsafe.Pointer(pnInst)) = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstCount
+ }
+ return rc
+}
+
+func fts5ApiInst(tls *libc.TLS, pCtx uintptr, iIdx int32, piPhrase uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:224935:12: */
+ var pCsr uintptr = pCtx
+ var rc int32 = 0
+ if (((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (0x08)) == 0) ||
+ (0 == (libc.AssignInt32(&rc, fts5CacheInstArray(tls, pCsr)))) {
+ if (iIdx < 0) || (iIdx >= (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnInstCount) {
+ rc = 25
+ } else {
+ *(*int32)(unsafe.Pointer(piPhrase)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr((iIdx*3))*4))
+ *(*int32)(unsafe.Pointer(piCol)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(((iIdx*3)+1))*4))
+ *(*int32)(unsafe.Pointer(piOff)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(((iIdx*3)+2))*4))
+ }
+ }
+ return rc
+}
+
+func fts5ApiRowid(tls *libc.TLS, pCtx uintptr) Sqlite3_int64 { /* sqlite3.c:224964:22: */
+ return fts5CursorRowid(tls, pCtx)
+}
+
+func fts5ColumnSizeCb(tls *libc.TLS, pContext uintptr, tflags int32, pUnused uintptr, nUnused int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:224968:12: */
+ var pCnt uintptr = pContext
+ _ = pUnused
+ _ = nUnused
+ _ = iUnused1
+ _ = iUnused2
+ if (tflags & 0x0001) == 0 {
+ (*(*int32)(unsafe.Pointer(pCnt)))++
+ }
+ return 0
+}
+
+func fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:224985:12: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ var pCsr uintptr = pCtx
+ var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
+ var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
+ var rc int32 = 0
+
+ if ((*Fts5Cursor)(unsafe.Pointer((pCsr))).Fcsrflags & (0x04)) != 0 {
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
+ var iRowid I64 = fts5CursorRowid(tls, pCsr)
+ rc = sqlite3Fts5StorageDocsize(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iRowid, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize)
+ } else if (*Fts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) {
+ var i int32
+ for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
+ if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 {
+ *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4)) = -1
+ }
+ }
+ } else {
+ var i int32
+ for i = 0; (rc == 0) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ {
+ if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 {
+ // var z uintptr at bp, 8
+
+ // var n int32 at bp+8, 4
+
+ var p uintptr = ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4)
+ *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4)) = 0
+ rc = fts5ApiColumnText(tls, pCtx, i, bp /* &z */, bp+8 /* &n */)
+ if rc == 0 {
+ rc = sqlite3Fts5Tokenize(tls,
+ pConfig, 0x0008, *(*uintptr)(unsafe.Pointer(bp /* z */)), *(*int32)(unsafe.Pointer(bp + 8 /* n */)), p, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{fts5ColumnSizeCb})))
+ }
+ }
+ }
+ }
+ *(*int32)(unsafe.Pointer(pCsr + 80 /* &.csrflags */)) &= (^int32(libc.Int32FromInt32(0x04)))
+ }
+ if iCol < 0 {
+ var i int32
+ *(*int32)(unsafe.Pointer(pnToken)) = 0
+ for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
+ *(*int32)(unsafe.Pointer(pnToken)) += (*(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i)*4)))
+ }
+ } else if iCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol {
+ *(*int32)(unsafe.Pointer(pnToken)) = *(*int32)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(iCol)*4))
+ } else {
+ *(*int32)(unsafe.Pointer(pnToken)) = 0
+ rc = 25
+ }
+ return rc
+}
+
+// Implementation of the xSetAuxdata() method.
+func fts5ApiSetAuxdata(tls *libc.TLS, pCtx uintptr, pPtr uintptr, xDelete uintptr) int32 { /* sqlite3.c:225038:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var pCsr uintptr = pCtx
+ var pData uintptr
+
+ // Search through the cursors list of Fts5Auxdata objects for one that
+ // corresponds to the currently executing auxiliary function.
+ for pData = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAuxdata; pData != 0; pData = (*Fts5Auxdata)(unsafe.Pointer(pData)).FpNext {
+ if (*Fts5Auxdata)(unsafe.Pointer(pData)).FpAux == (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux {
+ break
+ }
+ }
+
+ if pData != 0 {
+ if (*Fts5Auxdata)(unsafe.Pointer(pData)).FxDelete != 0 {
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pData + 16 /* &.xDelete */))))(tls, (*Fts5Auxdata)(unsafe.Pointer(pData)).FpPtr)
+ }
+ } else {
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = 0
+ pData = sqlite3Fts5MallocZero(tls, bp /* &rc */, int64(unsafe.Sizeof(Fts5Auxdata{})))
+ if pData == uintptr(0) {
+ if xDelete != 0 {
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&xDelete)))(tls, pPtr)
+ }
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+ }
+ (*Fts5Auxdata)(unsafe.Pointer(pData)).FpAux = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux
+ (*Fts5Auxdata)(unsafe.Pointer(pData)).FpNext = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAuxdata
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAuxdata = pData
+ }
+
+ (*Fts5Auxdata)(unsafe.Pointer(pData)).FxDelete = xDelete
+ (*Fts5Auxdata)(unsafe.Pointer(pData)).FpPtr = pPtr
+ return 0
+}
+
+func fts5ApiGetAuxdata(tls *libc.TLS, pCtx uintptr, bClear int32) uintptr { /* sqlite3.c:225073:13: */
+ var pCsr uintptr = pCtx
+ var pData uintptr
+ var pRet uintptr = uintptr(0)
+
+ for pData = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAuxdata; pData != 0; pData = (*Fts5Auxdata)(unsafe.Pointer(pData)).FpNext {
+ if (*Fts5Auxdata)(unsafe.Pointer(pData)).FpAux == (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux {
+ break
+ }
+ }
+
+ if pData != 0 {
+ pRet = (*Fts5Auxdata)(unsafe.Pointer(pData)).FpPtr
+ if bClear != 0 {
+ (*Fts5Auxdata)(unsafe.Pointer(pData)).FpPtr = uintptr(0)
+ (*Fts5Auxdata)(unsafe.Pointer(pData)).FxDelete = uintptr(0)
+ }
+ }
+
+ return pRet
+}
+
+func fts5ApiPhraseNext(tls *libc.TLS, pUnused uintptr, pIter uintptr, piCol uintptr, piOff uintptr) { /* sqlite3.c:225093:13: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ _ = pUnused
+ if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa >= (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb {
+ *(*int32)(unsafe.Pointer(piCol)) = -1
+ *(*int32)(unsafe.Pointer(piOff)) = -1
+ } else {
+ // var iVal int32 at bp, 4
+
+ *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp /* &iVal */)))
+ if *(*int32)(unsafe.Pointer(bp /* iVal */)) == 1 {
+ *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp /* &iVal */)))
+ *(*int32)(unsafe.Pointer(piCol)) = *(*int32)(unsafe.Pointer(bp /* iVal */))
+ *(*int32)(unsafe.Pointer(piOff)) = 0
+ *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp /* &iVal */)))
+ }
+ *(*int32)(unsafe.Pointer(piOff)) += (*(*int32)(unsafe.Pointer(bp /* iVal */)) - 2)
+ }
+}
+
+func fts5ApiPhraseFirst(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr, piOff uintptr) int32 { /* sqlite3.c:225115:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var pCsr uintptr = pCtx
+ // var n int32 at bp, 4
+
+ var rc int32 = fts5CsrPoslist(tls, pCsr, iPhrase, (pIter /* &.a */), bp /* &n */)
+ if rc == 0 {
+ (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* n */))))
+ *(*int32)(unsafe.Pointer(piCol)) = 0
+ *(*int32)(unsafe.Pointer(piOff)) = 0
+ fts5ApiPhraseNext(tls, pCtx, pIter, piCol, piOff)
+ }
+ return rc
+}
+
+func fts5ApiPhraseNextColumn(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol uintptr) { /* sqlite3.c:225133:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pCsr uintptr = pCtx
+ var pConfig uintptr = (*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig
+
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == 2 {
+ if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa >= (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb {
+ *(*int32)(unsafe.Pointer(piCol)) = -1
+ } else {
+ // var iIncr int32 at bp, 4
+
+ *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(sqlite3Fts5GetVarint32(tls, ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(0)), bp /* &iIncr */)))
+ *(*int32)(unsafe.Pointer(piCol)) += (*(*int32)(unsafe.Pointer(bp /* iIncr */)) - 2)
+ }
+ } else {
+ for 1 != 0 {
+ // var dummy int32 at bp+4, 4
+
+ if (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa >= (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb {
+ *(*int32)(unsafe.Pointer(piCol)) = -1
+ return
+ }
+ if int32(*(*uint8)(unsafe.Pointer((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(0)))) == 0x01 {
+ break
+ }
+ *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(sqlite3Fts5GetVarint32(tls, (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp+4 /* &dummy */)))
+ }
+ *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(1 + sqlite3Fts5GetVarint32(tls, ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa+uintptr(1)), piCol)))
+ }
+}
+
+func fts5ApiPhraseFirstColumn(tls *libc.TLS, pCtx uintptr, iPhrase int32, pIter uintptr, piCol uintptr) int32 { /* sqlite3.c:225163:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 = 0
+ var pCsr uintptr = pCtx
+ var pConfig uintptr = (*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig
+
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == 2 {
+ var pSorter uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpSorter
+ // var n int32 at bp, 4
+
+ if pSorter != 0 {
+ var i1 int32 = func() int32 {
+ if iPhrase == 0 {
+ return 0
+ }
+ return *(*int32)(unsafe.Pointer((pSorter + 28 /* &.aIdx */) + uintptr((iPhrase-1))*4))
+ }()
+ *(*int32)(unsafe.Pointer(bp /* n */)) = (*(*int32)(unsafe.Pointer((pSorter + 28 /* &.aIdx */) + uintptr(iPhrase)*4)) - i1)
+ (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa = ((*Fts5Sorter)(unsafe.Pointer(pSorter)).FaPoslist + uintptr(i1))
+ } else {
+ rc = sqlite3Fts5ExprPhraseCollist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, (pIter /* &.a */), bp /* &n */)
+ }
+ if rc == 0 {
+ (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp /* n */))))
+ *(*int32)(unsafe.Pointer(piCol)) = 0
+ fts5ApiPhraseNextColumn(tls, pCtx, pIter, piCol)
+ }
+ } else {
+ // var n int32 at bp+4, 4
+
+ rc = fts5CsrPoslist(tls, pCsr, iPhrase, (pIter /* &.a */), bp+4 /* &n */)
+ if rc == 0 {
+ (*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fb = ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(*(*int32)(unsafe.Pointer(bp + 4 /* n */))))
+ if *(*int32)(unsafe.Pointer(bp + 4 /* n */)) <= 0 {
+ *(*int32)(unsafe.Pointer(piCol)) = -1
+ } else if int32(*(*uint8)(unsafe.Pointer((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa + uintptr(0)))) == 0x01 {
+ *(*uintptr)(unsafe.Pointer(pIter /* &.a */)) += (uintptr(1 + sqlite3Fts5GetVarint32(tls, ((*Fts5PhraseIter)(unsafe.Pointer(pIter)).Fa+uintptr(1)), piCol)))
+ } else {
+ *(*int32)(unsafe.Pointer(piCol)) = 0
+ }
+ }
+ }
+
+ return rc
+}
+
+var sFts5Api = Fts5ExtensionApi{FiVersion: 2, FxUserData: // iVersion
+0, FxColumnCount: 0, FxRowCount: 0, FxColumnTotalSize: 0, FxTokenize: 0, FxPhraseCount: 0, FxPhraseSize: 0, FxInstCount: 0, FxInst: 0, FxRowid: 0, FxColumnText: 0, FxColumnSize: 0, FxQueryPhrase: 0, FxSetAuxdata: 0, FxGetAuxdata: 0, FxPhraseFirst: 0, FxPhraseNext: 0, FxPhraseFirstColumn: 0, FxPhraseNextColumn: 0,
+} /* sqlite3.c:225211:31 */
+
+// Implementation of API function xQueryPhrase().
+func fts5ApiQueryPhrase(tls *libc.TLS, pCtx uintptr, iPhrase int32, pUserData uintptr, xCallback uintptr) int32 { /* sqlite3.c:225237:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pCsr uintptr = pCtx
+ var pTab uintptr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
+ var rc int32
+ *(*uintptr)(unsafe.Pointer(bp /* pNew */)) = uintptr(0)
+
+ rc = fts5OpenMethod(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab, bp /* &pNew */)
+ if rc == 0 {
+ (*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FePlan = 1
+ (*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FiFirstRowid = ((int64(-1)) - (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32)))
+ (*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).FiLastRowid = (int64(0xffffffff) | (I64((int64(0x7fffffff))) << 32))
+ (*Fts5Cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp /* pNew */)))).Fbase.FpVtab = pTab
+ rc = sqlite3Fts5ExprClonePhrase(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase, (*(*uintptr)(unsafe.Pointer(bp /* pNew */)) + 64 /* &.pExpr */))
+ }
+
+ if rc == 0 {
+ for rc = fts5CursorFirst(tls, pTab, *(*uintptr)(unsafe.Pointer(bp /* pNew */)), 0); (rc == 0) && (((*Fts5Cursor)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(bp /* pNew */))))).Fcsrflags & (0x01)) == 0); rc = fts5NextMethod(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */))) {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&xCallback)))(tls, uintptr(unsafe.Pointer(&sFts5Api)), *(*uintptr)(unsafe.Pointer(bp /* pNew */)), pUserData)
+ if rc != 0 {
+ if rc == 101 {
+ rc = 0
+ }
+ break
+ }
+ }
+ }
+
+ fts5CloseMethod(tls, *(*uintptr)(unsafe.Pointer(bp /* pNew */)))
+ return rc
+}
+
+func fts5ApiInvoke(tls *libc.TLS, pAux uintptr, pCsr uintptr, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:225274:13: */
+
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux = pAux
+ (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr))(unsafe.Pointer((pAux + 24 /* &.xFunc */))))(tls, uintptr(unsafe.Pointer(&sFts5Api)), pCsr, context, argc, argv)
+ (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpAux = uintptr(0)
+}
+
+func fts5CursorFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:225287:19: */
+ var pCsr uintptr
+ for pCsr = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpCsr; pCsr != 0; pCsr = (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpNext {
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId == iCsrId {
+ break
+ }
+ }
+ return pCsr
+}
+
+func fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* sqlite3.c:225295:13: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pAux uintptr
+ var pCsr uintptr
+ var iCsrId I64
+
+ pAux = Xsqlite3_user_data(tls, context)
+ iCsrId = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8)))
+
+ pCsr = fts5CursorFromCsrid(tls, (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpGlobal, iCsrId)
+ if (pCsr == uintptr(0)) || ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 0) {
+ var zErr uintptr = Xsqlite3_mprintf(tls, ts+38975 /* "no such cursor: ..." */, libc.VaList(bp, iCsrId))
+ Xsqlite3_result_error(tls, context, zErr, -1)
+ Xsqlite3_free(tls, zErr)
+ } else {
+ fts5ApiInvoke(tls, pAux, pCsr, context, (argc - 1), (argv + uintptr(1)*8))
+ }
+}
+
+// Given cursor id iId, return a pointer to the corresponding Fts5Table
+// object. Or NULL If the cursor id does not exist.
+func sqlite3Fts5TableFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId I64) uintptr { /* sqlite3.c:225324:18: */
+ var pCsr uintptr
+ pCsr = fts5CursorFromCsrid(tls, pGlobal, iCsrId)
+ if pCsr != 0 {
+ return (*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab
+ }
+ return uintptr(0)
+}
+
+// Return a "position-list blob" corresponding to the current position of
+// cursor pCsr via sqlite3_result_blob(). A position-list blob contains
+// the current position-list for each phrase in the query associated with
+// cursor pCsr.
+//
+// A position-list blob begins with (nPhrase-1) varints, where nPhrase is
+// the number of phrases in the query. Following the varints are the
+// concatenated position lists for each phrase, in order.
+//
+// The first varint (if it exists) contains the size of the position list
+// for phrase 0. The second (same disclaimer) contains the size of position
+// list 1. And so on. There is no size field for the final position list,
+// as it can be derived from the total size of the blob.
+func fts5PoslistBlob(tls *libc.TLS, pCtx uintptr, pCsr uintptr) int32 { /* sqlite3.c:225351:12: */
+ bp := tls.Alloc(68)
+ defer tls.Free(68)
+
+ var i int32
+ *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = 0
+ var nPhrase int32 = sqlite3Fts5ExprPhraseCount(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr)
+ // var val Fts5Buffer at bp, 16
+
+ libc.Xmemset(tls, bp /* &val */, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
+ switch (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig)).FeDetail {
+ case 0:
+
+ // Append the varints
+ for i = 0; i < (nPhrase - 1); i++ {
+ // var dummy uintptr at bp+16, 8
+
+ var nByte int32 = sqlite3Fts5ExprPoslist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, i, bp+16 /* &dummy */)
+ sqlite3Fts5BufferAppendVarint(tls, bp+24 /* &rc */, bp /* &val */, int64(nByte))
+ }
+
+ // Append the position lists
+ for i = 0; i < nPhrase; i++ {
+ // var pPoslist uintptr at bp+32, 8
+
+ var nPoslist int32
+ nPoslist = sqlite3Fts5ExprPoslist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, i, bp+32 /* &pPoslist */)
+ sqlite3Fts5BufferAppendBlob(tls, bp+24 /* &rc */, bp /* &val */, uint32(nPoslist), *(*uintptr)(unsafe.Pointer(bp + 32 /* pPoslist */)))
+ }
+ break
+
+ case 2:
+
+ // Append the varints
+ for i = 0; (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == 0) && (i < (nPhrase - 1)); i++ {
+ // var dummy uintptr at bp+40, 8
+
+ // var nByte int32 at bp+48, 4
+
+ *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sqlite3Fts5ExprPhraseCollist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, i, bp+40 /* &dummy */, bp+48 /* &nByte */)
+ sqlite3Fts5BufferAppendVarint(tls, bp+24 /* &rc */, bp /* &val */, int64(*(*int32)(unsafe.Pointer(bp + 48 /* nByte */))))
+ }
+
+ // Append the position lists
+ for i = 0; (*(*int32)(unsafe.Pointer(bp + 24 /* rc */)) == 0) && (i < nPhrase); i++ {
+ // var pPoslist uintptr at bp+56, 8
+
+ // var nPoslist int32 at bp+64, 4
+
+ *(*int32)(unsafe.Pointer(bp + 24 /* rc */)) = sqlite3Fts5ExprPhraseCollist(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, i, bp+56 /* &pPoslist */, bp+64 /* &nPoslist */)
+ sqlite3Fts5BufferAppendBlob(tls, bp+24 /* &rc */, bp /* &val */, uint32(*(*int32)(unsafe.Pointer(bp + 64 /* nPoslist */))), *(*uintptr)(unsafe.Pointer(bp + 56 /* pPoslist */)))
+ }
+ break
+
+ default:
+ break
+ }
+
+ Xsqlite3_result_blob(tls, pCtx, (*Fts5Buffer)(unsafe.Pointer(bp /* &val */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &val */)).Fn, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{Xsqlite3_free})))
+ return *(*int32)(unsafe.Pointer(bp + 24 /* rc */))
+}
+
+// This is the xColumn method, called by SQLite to request a value from
+// the row that the supplied cursor currently points to.
+func fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:225408:12: */
+ var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
+ var pConfig uintptr = (*Fts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig
+ var pCsr uintptr = pCursor
+ var rc int32 = 0
+
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 3 {
+ if iCol == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol {
+ Xsqlite3_result_int64(tls, pCtx, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial)
+ }
+ } else if iCol == (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol {
+ // User is requesting the value of the special column with the same name
+ // as the table. Return the cursor integer id number. This value is only
+ // useful in that it may be passed as the first argument to an FTS5
+ // auxiliary function.
+ Xsqlite3_result_int64(tls, pCtx, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId)
+ } else if iCol == ((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol + 1) {
+
+ // The value of the "rank" column.
+ if (*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 2 {
+ fts5PoslistBlob(tls, pCtx, pCsr)
+ } else if ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 1) ||
+ ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 4) {
+ if ((*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRank != 0) || (0 == (libc.AssignInt32(&rc, fts5FindRankFunction(tls, pCsr)))) {
+ fts5ApiInvoke(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpRank, pCsr, pCtx, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FnRankArg, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FapRankArg)
+ }
+ }
+ } else if !(fts5IsContentless(tls, pTab) != 0) {
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = (pTab /* &.p */ /* &.base */ + 16 /* &.zErrMsg */)
+ rc = fts5SeekCursor(tls, pCsr, 1)
+ if rc == 0 {
+ Xsqlite3_result_value(tls, pCtx, Xsqlite3_column_value(tls, (*Fts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, (iCol+1)))
+ }
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = uintptr(0)
+ }
+ return rc
+}
+
+// This routine implements the xFindFunction method for the FTS3
+// virtual table.
+func fts5FindFunctionMethod(tls *libc.TLS, pVtab uintptr, nUnused int32, zName uintptr, pxFunc uintptr, ppArg uintptr) int32 { /* sqlite3.c:225461:12: */
+ var pTab uintptr = pVtab
+ var pAux uintptr
+
+ _ = nUnused
+ pAux = fts5FindAuxiliary(tls, pTab, zName)
+ if pAux != 0 {
+ *(*uintptr)(unsafe.Pointer(pxFunc)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{fts5ApiCallback}))
+ *(*uintptr)(unsafe.Pointer(ppArg)) = pAux
+ return 1
+ }
+
+ // No function of the specified name was found. Return 0.
+ return 0
+}
+
+// Implementation of FTS5 xRename method. Rename an fts5 table.
+func fts5RenameMethod(tls *libc.TLS, pVtab uintptr, zName uintptr) int32 { /* sqlite3.c:225486:12: */
+ var pTab uintptr = pVtab
+ return sqlite3Fts5StorageRename(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage, zName)
+}
+
+func sqlite3Fts5FlushToDisk(tls *libc.TLS, pTab uintptr) int32 { /* sqlite3.c:225494:12: */
+ fts5TripCursors(tls, pTab)
+ return sqlite3Fts5StorageSync(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
+}
+
+// The xSavepoint() method.
+//
+// Flush the contents of the pending-terms table to disk.
+func fts5SavepointMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:225504:12: */
+ _ = iSavepoint // Call below is a no-op for NDEBUG builds
+
+ return sqlite3Fts5FlushToDisk(tls, pVtab)
+}
+
+// The xRelease() method.
+//
+// This is a no-op.
+func fts5ReleaseMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:225515:12: */
+ _ = iSavepoint // Call below is a no-op for NDEBUG builds
+
+ return sqlite3Fts5FlushToDisk(tls, pVtab)
+}
+
+// The xRollbackTo() method.
+//
+// Discard the contents of the pending terms table.
+func fts5RollbackToMethod(tls *libc.TLS, pVtab uintptr, iSavepoint int32) int32 { /* sqlite3.c:225526:12: */
+ var pTab uintptr = pVtab
+ _ = iSavepoint // Call below is a no-op for NDEBUG builds
+
+ fts5TripCursors(tls, pTab)
+ return sqlite3Fts5StorageRollback(tls, (*Fts5FullTable)(unsafe.Pointer(pTab)).FpStorage)
+}
+
+// Register a new auxiliary function with global context pGlobal.
+func fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, xFunc Fts5_extension_function, xDestroy uintptr) int32 { /* sqlite3.c:225537:12: */
+ var pGlobal uintptr = pApi
+ var rc int32 = Xsqlite3_overload_function(tls, (*Fts5Global)(unsafe.Pointer(pGlobal)).Fdb, zName, -1)
+ if rc == 0 {
+ var pAux uintptr
+ var nName Sqlite3_int64 // Size of zName in bytes, including \0
+ var nByte Sqlite3_int64 // Bytes of space to allocate
+
+ nName = (Sqlite3_int64(libc.Xstrlen(tls, zName) + uint64(1)))
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Auxiliary{})) + uint64(nName)))
+ pAux = Xsqlite3_malloc64(tls, uint64(nByte))
+ if pAux != 0 {
+ libc.Xmemset(tls, pAux, 0, Size_t(nByte))
+ (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FzFunc = (pAux + uintptr(1)*48)
+ libc.Xmemcpy(tls, (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FzFunc, zName, uint64(nName))
+ (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpGlobal = pGlobal
+ (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpUserData = pUserData
+ (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FxFunc = xFunc
+ (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FxDestroy = xDestroy
+ (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpNext = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpAux
+ (*Fts5Global)(unsafe.Pointer(pGlobal)).FpAux = pAux
+ } else {
+ rc = 7
+ }
+ }
+
+ return rc
+}
+
+// Register a new tokenizer. This is the implementation of the
+// fts5_api.xCreateTokenizer() method.
+func fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) int32 { /* sqlite3.c:225576:12: */
+ var pGlobal uintptr = pApi
+ var pNew uintptr
+ var nName Sqlite3_int64 // Size of zName and its \0 terminator
+ var nByte Sqlite3_int64 // Bytes of space to allocate
+ var rc int32 = 0
+
+ nName = (Sqlite3_int64(libc.Xstrlen(tls, zName) + uint64(1)))
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5TokenizerModule{})) + uint64(nName)))
+ pNew = Xsqlite3_malloc64(tls, uint64(nByte))
+ if pNew != 0 {
+ libc.Xmemset(tls, pNew, 0, Size_t(nByte))
+ (*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FzName = (pNew + uintptr(1)*56)
+ libc.Xmemcpy(tls, (*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FzName, zName, uint64(nName))
+ (*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FpUserData = pUserData
+ (*Fts5TokenizerModule)(unsafe.Pointer(pNew)).Fx = *(*Fts5_tokenizer)(unsafe.Pointer(pTokenizer))
+ (*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FxDestroy = xDestroy
+ (*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FpNext = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpTok
+ (*Fts5Global)(unsafe.Pointer(pGlobal)).FpTok = pNew
+ if (*Fts5TokenizerModule)(unsafe.Pointer(pNew)).FpNext == uintptr(0) {
+ (*Fts5Global)(unsafe.Pointer(pGlobal)).FpDfltTok = pNew
+ }
+ } else {
+ rc = 7
+ }
+
+ return rc
+}
+
+func fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) uintptr { /* sqlite3.c:225611:28: */
+ var pMod uintptr = uintptr(0)
+
+ if zName == uintptr(0) {
+ pMod = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpDfltTok
+ } else {
+ for pMod = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpTok; pMod != 0; pMod = (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FpNext {
+ if Xsqlite3_stricmp(tls, zName, (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FzName) == 0 {
+ break
+ }
+ }
+ }
+
+ return pMod
+}
+
+// Find a tokenizer. This is the implementation of the
+// fts5_api.xFindTokenizer() method.
+func fts5FindTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData uintptr, pTokenizer uintptr) int32 { /* sqlite3.c:225632:12: */
+ var rc int32 = 0
+ var pMod uintptr
+
+ pMod = fts5LocateTokenizer(tls, pApi, zName)
+ if pMod != 0 {
+ *(*Fts5_tokenizer)(unsafe.Pointer(pTokenizer)) = (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).Fx
+ *(*uintptr)(unsafe.Pointer(ppUserData)) = (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData
+ } else {
+ libc.Xmemset(tls, pTokenizer, 0, uint64(unsafe.Sizeof(Fts5_tokenizer{})))
+ rc = 1
+ }
+
+ return rc
+}
+
+func sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg int32, ppTok uintptr, ppTokApi uintptr, pzErr uintptr) int32 { /* sqlite3.c:225653:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pMod uintptr
+ var rc int32 = 0
+
+ pMod = fts5LocateTokenizer(tls, pGlobal, func() uintptr {
+ if nArg == 0 {
+ return uintptr(0)
+ }
+ return *(*uintptr)(unsafe.Pointer(azArg + uintptr(0)*8))
+ }())
+ if pMod == uintptr(0) {
+
+ rc = 1
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+38996 /* "no such tokenize..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azArg + uintptr(0)*8))))
+ } else {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pMod + 16 /* &.x */ /* &.xCreate */))))(tls, (*Fts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, (azArg + uintptr(1)*8), func() int32 {
+ if nArg != 0 {
+ return (nArg - 1)
+ }
+ return 0
+ }(), ppTok)
+ *(*uintptr)(unsafe.Pointer(ppTokApi)) = (pMod + 16 /* &.x */)
+ if (rc != 0) && (pzErr != 0) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+39018 /* "error in tokeniz..." */, 0)
+ }
+ }
+
+ if rc != 0 {
+ *(*uintptr)(unsafe.Pointer(ppTokApi)) = uintptr(0)
+ *(*uintptr)(unsafe.Pointer(ppTok)) = uintptr(0)
+ }
+
+ return rc
+}
+
+func fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) { /* sqlite3.c:225685:13: */
+ var pTok uintptr
+ var pNextTok uintptr
+ var pAux uintptr
+ var pNextAux uintptr
+ var pGlobal uintptr = pCtx
+
+ for pAux = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpAux; pAux != 0; pAux = pNextAux {
+ pNextAux = (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpNext
+ if (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FxDestroy != 0 {
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pAux + 32 /* &.xDestroy */))))(tls, (*Fts5Auxiliary)(unsafe.Pointer(pAux)).FpUserData)
+ }
+ Xsqlite3_free(tls, pAux)
+ }
+
+ for pTok = (*Fts5Global)(unsafe.Pointer(pGlobal)).FpTok; pTok != 0; pTok = pNextTok {
+ pNextTok = (*Fts5TokenizerModule)(unsafe.Pointer(pTok)).FpNext
+ if (*Fts5TokenizerModule)(unsafe.Pointer(pTok)).FxDestroy != 0 {
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((pTok + 40 /* &.xDestroy */))))(tls, (*Fts5TokenizerModule)(unsafe.Pointer(pTok)).FpUserData)
+ }
+ Xsqlite3_free(tls, pTok)
+ }
+
+ Xsqlite3_free(tls, pGlobal)
+}
+
+func fts5Fts5Func(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { /* sqlite3.c:225705:13: */
+ var pGlobal uintptr = Xsqlite3_user_data(tls, pCtx)
+ var ppApi uintptr
+ _ = nArg
+
+ ppApi = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(apArg + uintptr(0)*8)), ts+39049 /* "fts5_api_ptr" */)
+ if ppApi != 0 {
+ *(*uintptr)(unsafe.Pointer(ppApi)) = (pGlobal /* &.api */)
+ }
+}
+
+// Implementation of fts5_source_id() function.
+func fts5SourceIdFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apUnused uintptr) { /* sqlite3.c:225721:13: */
+
+ _ = nArg
+ _ = apUnused
+ Xsqlite3_result_text(tls, pCtx, ts+39062 /* "fts5: 2020-08-14..." */, -1, libc.UintptrFromInt32(-1))
+}
+
+// Return true if zName is the extension on one of the shadow tables used
+// by this module.
+func fts5ShadowName(tls *libc.TLS, zName uintptr) int32 { /* sqlite3.c:225735:12: */
+ var i uint32
+ for i = uint32(0); uint64(i) < (uint64(unsafe.Sizeof(azName2)) / uint64(unsafe.Sizeof(uintptr(0)))); i++ {
+ if Xsqlite3_stricmp(tls, zName, azName2[i]) == 0 {
+ return 1
+ }
+ }
+ return 0
+}
+
+var azName2 = [5]uintptr{
+ ts + 39153 /* "config" */, ts + 36610 /* "content" */, ts + 28342 /* "data" */, ts + 36961 /* "docsize" */, ts + 12609, /* "idx" */
+} /* sqlite3.c:225736:21 */
+
+func fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:225746:12: */
+ var rc int32
+ var pGlobal uintptr = uintptr(0)
+
+ pGlobal = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Fts5Global{})))
+ if pGlobal == uintptr(0) {
+ rc = 7
+ } else {
+ var p uintptr = pGlobal
+ libc.Xmemset(tls, pGlobal, 0, uint64(unsafe.Sizeof(Fts5Global{})))
+ (*Fts5Global)(unsafe.Pointer(pGlobal)).Fdb = db
+ (*Fts5Global)(unsafe.Pointer(pGlobal)).Fapi.FiVersion = 2
+ (*Fts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxCreateFunction = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, Fts5_extension_function, uintptr) int32
+ }{fts5CreateAux}))
+ (*Fts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxCreateTokenizer = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32
+ }{fts5CreateTokenizer}))
+ (*Fts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxFindTokenizer = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32
+ }{fts5FindTokenizer}))
+ rc = Xsqlite3_create_module_v2(tls, db, ts+39160 /* "fts5" */, uintptr(unsafe.Pointer(&fts5Mod)), p, *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5ModuleDestroy})))
+ if rc == 0 {
+ rc = sqlite3Fts5IndexInit(tls, db)
+ }
+ if rc == 0 {
+ rc = sqlite3Fts5ExprInit(tls, pGlobal, db)
+ }
+ if rc == 0 {
+ rc = sqlite3Fts5AuxInit(tls, (pGlobal /* &.api */))
+ }
+ if rc == 0 {
+ rc = sqlite3Fts5TokenizerInit(tls, (pGlobal /* &.api */))
+ }
+ if rc == 0 {
+ rc = sqlite3Fts5VocabInit(tls, pGlobal, db)
+ }
+ if rc == 0 {
+ rc = Xsqlite3_create_function(tls,
+ db, ts+39160 /* "fts5" */, 1, 1, p, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{fts5Fts5Func})), uintptr(0), uintptr(0))
+ }
+ if rc == 0 {
+ rc = Xsqlite3_create_function(tls,
+ db, ts+39165 /* "fts5_source_id" */, 0, 1, p, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
+ }{fts5SourceIdFunc})), uintptr(0), uintptr(0))
+ }
+ }
+
+ // If SQLITE_FTS5_ENABLE_TEST_MI is defined, assume that the file
+ // fts5_test_mi.c is compiled and linked into the executable. And call
+ // its entry point to enable the matchinfo() demo.
+
+ return rc
+}
+
+var fts5Mod = Sqlite3_module{FiVersion:
+/* iVersion */ 3, FxCreate:
+/* xCreate */ 0, FxConnect:
+/* xConnect */ 0, FxBestIndex:
+/* xBestIndex */ 0, FxDisconnect:
+/* xDisconnect */ 0, FxDestroy:
+/* xDestroy */ 0, FxOpen:
+/* xOpen */ 0, FxClose:
+/* xClose */ 0, FxFilter:
+/* xFilter */ 0, FxNext:
+/* xNext */ 0, FxEof:
+/* xEof */ 0, FxColumn:
+/* xColumn */ 0, FxRowid:
+/* xRowid */ 0, FxUpdate:
+/* xUpdate */ 0, FxBegin:
+/* xBegin */ 0, FxSync:
+/* xSync */ 0, FxCommit:
+/* xCommit */ 0, FxRollback:
+/* xRollback */ 0, FxFindFunction:
+/* xFindFunction */ 0, FxRename:
+/* xRename */ 0, FxSavepoint:
+/* xSavepoint */ 0, FxRelease:
+/* xRelease */ 0, FxRollbackTo:
+/* xRollbackTo */ 0, FxShadowName:
+/* xShadowName */ 0,
+} /* sqlite3.c:225747:31 */
+
+// The following functions are used to register the module with SQLite. If
+// this module is being built as part of the SQLite core (SQLITE_CORE is
+// defined), then sqlite3_open() will call sqlite3Fts5Init() directly.
+//
+// Or, if this module is being built as a loadable extension,
+// sqlite3Fts5Init() is omitted and the two standard entry points
+// sqlite3_fts_init() and sqlite3_fts5_init() defined instead.
+func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:225855:20: */
+ return fts5Init(tls, db)
+}
+
+// Prepare the two insert statements - Fts5Storage.pInsertContent and
+// Fts5Storage.pInsertDocsize - if they have not already been prepared.
+// Return SQLITE_OK if successful, or an SQLite error code if an error
+// occurs.
+func fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:225913:12: */
+ bp := tls.Alloc(216)
+ defer tls.Free(216)
+
+ var rc int32 = 0
+
+ // If there is no %_docsize table, there should be no requests for
+ // statements to operate on it.
+
+ if *(*uintptr)(unsafe.Pointer((p + 40 /* &.aStmt */) + uintptr(eStmt)*8)) == uintptr(0) {
+ *(*[11]uintptr)(unsafe.Pointer(bp + 128 /* azStmt */)) = [11]uintptr{
+ ts + 39180, /* "SELECT %s FROM %..." */
+ ts + 39248, /* "SELECT %s FROM %..." */
+ ts + 39317, /* "SELECT %s FROM %..." */ // LOOKUP
+
+ ts + 39350, /* "INSERT INTO %Q.'..." */ // INSERT_CONTENT
+ ts + 39389, /* "REPLACE INTO %Q...." */ // REPLACE_CONTENT
+ ts + 39429, /* "DELETE FROM %Q.'..." */ // DELETE_CONTENT
+ ts + 39468, /* "REPLACE INTO %Q...." */ // REPLACE_DOCSIZE
+ ts + 39509, /* "DELETE FROM %Q.'..." */ // DELETE_DOCSIZE
+
+ ts + 39548, /* "SELECT sz FROM %..." */ // LOOKUP_DOCSIZE
+
+ ts + 39590, /* "REPLACE INTO %Q...." */ // REPLACE_CONFIG
+ ts + 39630, /* "SELECT %s FROM %..." */ // SCAN
+ }
+ var pC uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
+ var zSql uintptr = uintptr(0)
+
+ switch eStmt {
+ case 10:
+ zSql = Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* &azStmt[0] */ + uintptr(eStmt)*8)),
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pC)).FzContentExprlist, (*Fts5Config)(unsafe.Pointer(pC)).FzContent))
+ break
+ fallthrough
+
+ case 0:
+ fallthrough
+ case 1:
+ zSql = Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* &azStmt[0] */ + uintptr(eStmt)*8)), libc.VaList(bp+16, (*Fts5Config)(unsafe.Pointer(pC)).FzContentExprlist,
+ (*Fts5Config)(unsafe.Pointer(pC)).FzContent, (*Fts5Config)(unsafe.Pointer(pC)).FzContentRowid, (*Fts5Config)(unsafe.Pointer(pC)).FzContentRowid,
+ (*Fts5Config)(unsafe.Pointer(pC)).FzContentRowid))
+ break
+ fallthrough
+
+ case 2:
+ zSql = Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* &azStmt[0] */ + uintptr(eStmt)*8)),
+ libc.VaList(bp+56, (*Fts5Config)(unsafe.Pointer(pC)).FzContentExprlist, (*Fts5Config)(unsafe.Pointer(pC)).FzContent, (*Fts5Config)(unsafe.Pointer(pC)).FzContentRowid))
+ break
+ fallthrough
+
+ case 3:
+ fallthrough
+ case 4:
+ {
+ var nCol int32 = ((*Fts5Config)(unsafe.Pointer(pC)).FnCol + 1)
+ var zBind uintptr
+ var i int32
+
+ zBind = Xsqlite3_malloc64(tls, (uint64(1 + (nCol * 2))))
+ if zBind != 0 {
+ for i = 0; i < nCol; i++ {
+ *(*int8)(unsafe.Pointer(zBind + uintptr((i * 2)))) = int8('?')
+ *(*int8)(unsafe.Pointer(zBind + uintptr(((i * 2) + 1)))) = int8(',')
+ }
+ *(*int8)(unsafe.Pointer(zBind + uintptr(((i * 2) - 1)))) = int8(0)
+ zSql = Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* &azStmt[0] */ + uintptr(eStmt)*8)), libc.VaList(bp+80, (*Fts5Config)(unsafe.Pointer(pC)).FzDb, (*Fts5Config)(unsafe.Pointer(pC)).FzName, zBind))
+ Xsqlite3_free(tls, zBind)
+ }
+ break
+ }
+ fallthrough
+
+ default:
+ zSql = Xsqlite3_mprintf(tls, *(*uintptr)(unsafe.Pointer(bp + 128 /* &azStmt[0] */ + uintptr(eStmt)*8)), libc.VaList(bp+104, (*Fts5Config)(unsafe.Pointer(pC)).FzDb, (*Fts5Config)(unsafe.Pointer(pC)).FzName))
+ break
+ }
+
+ if zSql == uintptr(0) {
+ rc = 7
+ } else {
+ var f int32 = 0x01
+ if eStmt > 2 {
+ f = f | (0x04)
+ }
+ (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FbLock++
+ rc = Xsqlite3_prepare_v3(tls, (*Fts5Config)(unsafe.Pointer(pC)).Fdb, zSql, -1, uint32(f), ((p + 40 /* &.aStmt */) + uintptr(eStmt)*8), uintptr(0))
+ (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FbLock--
+ Xsqlite3_free(tls, zSql)
+ if (rc != 0) && (pzErrMsg != 0) {
+ *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, ts+805 /* "%s" */, libc.VaList(bp+120, Xsqlite3_errmsg(tls, (*Fts5Config)(unsafe.Pointer(pC)).Fdb)))
+ }
+ }
+ }
+
+ *(*uintptr)(unsafe.Pointer(ppStmt)) = *(*uintptr)(unsafe.Pointer((p + 40 /* &.aStmt */) + uintptr(eStmt)*8))
+ Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(ppStmt)))
+ return rc
+}
+
+func fts5ExecPrintf(tls *libc.TLS, db uintptr, pzErr uintptr, zFormat uintptr, va uintptr) int32 { /* sqlite3.c:226016:12: */
+ var rc int32
+ var ap Va_list
+ _ = ap // ... printf arguments
+ var zSql uintptr
+
+ ap = va
+ zSql = Xsqlite3_vmprintf(tls, zFormat, ap)
+
+ if zSql == uintptr(0) {
+ rc = 7
+ } else {
+ rc = Xsqlite3_exec(tls, db, zSql, uintptr(0), uintptr(0), pzErr)
+ Xsqlite3_free(tls, zSql)
+ }
+
+ _ = ap
+ return rc
+}
+
+// Drop all shadow tables. Return SQLITE_OK if successful or an SQLite error
+// code otherwise.
+func sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) int32 { /* sqlite3.c:226044:12: */
+ bp := tls.Alloc(80)
+ defer tls.Free(80)
+
+ var rc int32 = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
+
+ ts+39653, /* "DROP TABLE IF EX..." */
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName,
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName,
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
+ if (rc == 0) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) {
+ rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
+ ts+39757, /* "DROP TABLE IF EX..." */
+ libc.VaList(bp+48, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
+ }
+ if (rc == 0) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == 0) {
+ rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
+ ts+39795, /* "DROP TABLE IF EX..." */
+ libc.VaList(bp+64, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
+ }
+ return rc
+}
+
+func fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail uintptr, zName uintptr) { /* sqlite3.c:226068:13: */
+ bp := tls.Alloc(40)
+ defer tls.Free(40)
+
+ if *(*int32)(unsafe.Pointer(pRc)) == 0 {
+ *(*int32)(unsafe.Pointer(pRc)) = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
+ ts+39833, /* "ALTER TABLE %Q.'..." */
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail))
+ }
+}
+
+func sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) int32 { /* sqlite3.c:226082:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(pStorage)).FpConfig
+ *(*int32)(unsafe.Pointer(bp /* rc */)) = sqlite3Fts5StorageSync(tls, pStorage)
+
+ fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+28342 /* "data" */, zName)
+ fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+12609 /* "idx" */, zName)
+ fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+39153 /* "config" */, zName)
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
+ fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+36961 /* "docsize" */, zName)
+ }
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == 0 {
+ fts5StorageRenameOne(tls, pConfig, bp /* &rc */, ts+36610 /* "content" */, zName)
+ }
+ return *(*int32)(unsafe.Pointer(bp /* rc */))
+}
+
+// Create the shadow table named zPost, with definition zDefn. Return
+// SQLITE_OK if successful, or an SQLite error code otherwise.
+func sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDefn uintptr, bWithout int32, pzErr uintptr) int32 { /* sqlite3.c:226102:12: */
+ bp := tls.Alloc(72)
+ defer tls.Free(72)
+
+ var rc int32
+ *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)) = uintptr(0)
+
+ rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, bp+64 /* &zErr */, ts+39875, /* "CREATE TABLE %Q...." */
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn,
+ func() uintptr {
+ if bWithout != 0 {
+ return ts + 32957 /* " WITHOUT ROWID" */
+ }
+ return ts + 781 /* "" */
+ }()))
+ if *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)) != 0 {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls,
+ ts+39905, /* "fts5: error crea..." */
+ libc.VaList(bp+40, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */))))
+ Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 64 /* zErr */)))
+ }
+
+ return rc
+}
+
+// Open a new Fts5Index handle. If the bCreate argument is true, create
+// and initialize the underlying tables
+//
+// If successful, set *pp to point to the new object and return SQLITE_OK.
+// Otherwise, set *pp to NULL and return an SQLite error code.
+func sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCreate int32, pp uintptr, pzErr uintptr) int32 { /* sqlite3.c:226137:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 = 0
+ var p uintptr // New object
+ var nByte Sqlite3_int64 // Bytes of space to allocate
+
+ nByte = (Sqlite3_int64(uint64(unsafe.Sizeof(Fts5Storage{})) + // Fts5Storage object
+ (uint64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) * uint64(unsafe.Sizeof(I64(0)))))) // Fts5Storage.aTotalSize[]
+ *(*uintptr)(unsafe.Pointer(pp)) = libc.AssignUintptr(&p, Xsqlite3_malloc64(tls, uint64(nByte)))
+ if !(p != 0) {
+ return 7
+ }
+
+ libc.Xmemset(tls, p, 0, Size_t(nByte))
+ (*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize = (p + uintptr(1)*128)
+ (*Fts5Storage)(unsafe.Pointer(p)).FpConfig = pConfig
+ (*Fts5Storage)(unsafe.Pointer(p)).FpIndex = pIndex
+
+ if bCreate != 0 {
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == 0 {
+ var nDefn int32 = (32 + ((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol * 10))
+ var zDefn uintptr = Xsqlite3_malloc64(tls, (uint64(int64(32) + (Sqlite3_int64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) * int64(10)))))
+ if zDefn == uintptr(0) {
+ rc = 7
+ } else {
+ var i int32
+ var iOff int32
+ Xsqlite3_snprintf(tls, nDefn, zDefn, ts+39949 /* "id INTEGER PRIMA..." */, 0)
+ iOff = int32(libc.Xstrlen(tls, zDefn))
+ for i = 0; i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol; i++ {
+ Xsqlite3_snprintf(tls, (nDefn - iOff), (zDefn + uintptr(iOff)), ts+39972 /* ", c%d" */, libc.VaList(bp, i))
+ iOff = iOff + (int32(libc.Xstrlen(tls, (zDefn + uintptr(iOff)))))
+ }
+ rc = sqlite3Fts5CreateTable(tls, pConfig, ts+36610 /* "content" */, zDefn, 0, pzErr)
+ }
+ Xsqlite3_free(tls, zDefn)
+ }
+
+ if (rc == 0) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) {
+ rc = sqlite3Fts5CreateTable(tls,
+ pConfig, ts+36961 /* "docsize" */, ts+39978 /* "id INTEGER PRIMA..." */, 0, pzErr)
+ }
+ if rc == 0 {
+ rc = sqlite3Fts5CreateTable(tls,
+ pConfig, ts+39153 /* "config" */, ts+40010 /* "k PRIMARY KEY, v" */, 1, pzErr)
+ }
+ if rc == 0 {
+ rc = sqlite3Fts5StorageConfigValue(tls, p, ts+37107 /* "version" */, uintptr(0), 4)
+ }
+ }
+
+ if rc != 0 {
+ sqlite3Fts5StorageClose(tls, p)
+ *(*uintptr)(unsafe.Pointer(pp)) = uintptr(0)
+ }
+ return rc
+}
+
+// Close a handle opened by an earlier call to sqlite3Fts5StorageOpen().
+func sqlite3Fts5StorageClose(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226203:12: */
+ var rc int32 = 0
+ if p != 0 {
+ var i int32
+
+ // Finalize all SQL statements
+ for i = 0; i < (int32(uint64(unsafe.Sizeof([11]uintptr{})) / uint64(unsafe.Sizeof(uintptr(0))))); i++ {
+ Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer((p + 40 /* &.aStmt */) + uintptr(i)*8)))
+ }
+
+ Xsqlite3_free(tls, p)
+ }
+ return rc
+}
+
+type Fts5InsertCtx1 = struct {
+ FpStorage uintptr
+ FiCol int32
+ FszCol int32
+}
+
+type Fts5InsertCtx = Fts5InsertCtx1 /* sqlite3.c:226218:30 */
+
+// Tokenization callback used when inserting tokens into the FTS index.
+func fts5StorageInsertCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:226228:12: */
+ var pCtx uintptr = pContext
+ var pIdx uintptr = (*Fts5Storage)(unsafe.Pointer((*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FpStorage)).FpIndex
+ _ = iUnused1
+ _ = iUnused2
+ if nToken > 32768 {
+ nToken = 32768
+ }
+ if ((tflags & 0x0001) == 0) || ((*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FszCol == 0) {
+ (*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FszCol++
+ }
+ return sqlite3Fts5IndexWrite(tls, pIdx, (*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FiCol, ((*Fts5InsertCtx)(unsafe.Pointer(pCtx)).FszCol - 1), pToken, nToken)
+}
+
+// If a row with rowid iDel is present in the %_content table, add the
+// delete-markers to the FTS index necessary to delete it. Do not actually
+// remove the %_content row at this time though.
+func fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:226251:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
+ *(*uintptr)(unsafe.Pointer(bp /* pSeek */)) = uintptr(0) // SELECT to read row iDel from %_data
+ var rc int32 // Return code
+ var rc2 int32 // sqlite3_reset() return code
+ var iCol int32
+ // var ctx Fts5InsertCtx at bp+8, 16
+
+ if apVal == uintptr(0) {
+ rc = fts5StorageGetStmt(tls, p, 2, bp /* &pSeek */, uintptr(0))
+ if rc != 0 {
+ return rc
+ }
+ Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */)), 1, iDel)
+ if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */))) != 100 {
+ return Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */)))
+ }
+ }
+
+ (*Fts5InsertCtx)(unsafe.Pointer(bp + 8 /* &ctx */)).FpStorage = p
+ (*Fts5InsertCtx)(unsafe.Pointer(bp + 8 /* &ctx */)).FiCol = -1
+ rc = sqlite3Fts5IndexBeginWrite(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, 1, iDel)
+ for iCol = 1; (rc == 0) && (iCol <= (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); iCol++ {
+ if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((iCol - 1))))) == 0 {
+ var zText uintptr
+ var nText int32
+ if *(*uintptr)(unsafe.Pointer(bp /* pSeek */)) != 0 {
+ zText = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */)), iCol)
+ nText = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */)), iCol)
+ } else {
+ zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((iCol-1))*8)))
+ nText = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((iCol-1))*8)))
+ }
+ (*Fts5InsertCtx)(unsafe.Pointer(bp + 8 /* &ctx */)).FszCol = 0
+ rc = sqlite3Fts5Tokenize(tls, pConfig, 0x0004,
+ zText, nText, bp+8 /* &ctx */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{fts5StorageInsertCallback})))
+ *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((iCol-1))*8)) -= (I64((*Fts5InsertCtx)(unsafe.Pointer(bp + 8 /* &ctx */)).FszCol))
+ }
+ }
+ (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow--
+
+ rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pSeek */)))
+ if rc == 0 {
+ rc = rc2
+ }
+ return rc
+}
+
+// Insert a record into the %_docsize table. Specifically, do:
+//
+// INSERT OR REPLACE INTO %_docsize(id, sz) VALUES(iRowid, pBuf);
+//
+// If there is no %_docsize table (as happens if the columnsize=0 option
+// is specified when the FTS5 table is created), this function is a no-op.
+func fts5StorageInsertDocsize(tls *libc.TLS, p uintptr, iRowid I64, pBuf uintptr) int32 { /* sqlite3.c:226309:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 = 0
+ if (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FbColumnsize != 0 {
+ *(*uintptr)(unsafe.Pointer(bp /* pReplace */)) = uintptr(0)
+ rc = fts5StorageGetStmt(tls, p, 6, bp /* &pReplace */, uintptr(0))
+ if rc == 0 {
+ Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)), 1, iRowid)
+ Xsqlite3_bind_blob(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)), 2, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fp, (*Fts5Buffer)(unsafe.Pointer(pBuf)).Fn, uintptr(0))
+ Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)))
+ rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)))
+ Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)), 2)
+ }
+ }
+ return rc
+}
+
+// Load the contents of the "averages" record from disk into the
+// p->nTotalRow and p->aTotalSize[] variables. If successful, and if
+// argument bCache is true, set the p->bTotalsValid flag to indicate
+// that the contents of aTotalSize[] and nTotalRow are valid until
+// further notice.
+//
+// Return SQLITE_OK if successful, or an SQLite error code if an error
+// occurs.
+func fts5StorageLoadTotals(tls *libc.TLS, p uintptr, bCache int32) int32 { /* sqlite3.c:226339:12: */
+ var rc int32 = 0
+ if (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid == 0 {
+ rc = sqlite3Fts5IndexGetAverages(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (p + 24 /* &.nTotalRow */), (*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize)
+ (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid = bCache
+ }
+ return rc
+}
+
+// Store the current contents of the p->nTotalRow and p->aTotalSize[]
+// variables in the "averages" record on disk.
+//
+// Return SQLITE_OK if successful, or an SQLite error code if an error
+// occurs.
+func fts5StorageSaveTotals(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226355:12: */
+ bp := tls.Alloc(20)
+ defer tls.Free(20)
+
+ var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FnCol
+ var i int32
+ // var buf Fts5Buffer at bp, 16
+
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = 0
+ libc.Xmemset(tls, bp /* &buf */, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
+
+ sqlite3Fts5BufferAppendVarint(tls, bp+16 /* &rc */, bp /* &buf */, (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow)
+ for i = 0; i < nCol; i++ {
+ sqlite3Fts5BufferAppendVarint(tls, bp+16 /* &rc */, bp /* &buf */, *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8)))
+ }
+ if *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 16 /* rc */)) = sqlite3Fts5IndexSetAverages(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fn)
+ }
+ Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp)
+
+ return *(*int32)(unsafe.Pointer(bp + 16 /* rc */))
+}
+
+// Remove a row from the FTS table.
+func sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel I64, apVal uintptr) int32 { /* sqlite3.c:226377:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
+ var rc int32
+ *(*uintptr)(unsafe.Pointer(bp /* pDel */)) = uintptr(0)
+
+ rc = fts5StorageLoadTotals(tls, p, 1)
+
+ // Delete the index records
+ if rc == 0 {
+ rc = fts5StorageDeleteFromIndex(tls, p, iDel, apVal)
+ }
+
+ // Delete the %_docsize record
+ if (rc == 0) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) {
+ rc = fts5StorageGetStmt(tls, p, 7, bp /* &pDel */, uintptr(0))
+ if rc == 0 {
+ Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pDel */)), 1, iDel)
+ Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pDel */)))
+ rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pDel */)))
+ }
+ }
+
+ // Delete the %_content record
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == 0 {
+ if rc == 0 {
+ rc = fts5StorageGetStmt(tls, p, 5, bp /* &pDel */, uintptr(0))
+ }
+ if rc == 0 {
+ Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pDel */)), 1, iDel)
+ Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pDel */)))
+ rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pDel */)))
+ }
+ }
+
+ return rc
+}
+
+// Delete all entries in the FTS5 index.
+func sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226418:12: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
+
+ var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
+ var rc int32
+
+ (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0
+
+ // Delete the contents of the %_data and %_docsize tables.
+ rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
+
+ ts+40027, /* "DELETE FROM %Q.'..." */
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName,
+ (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
+ if (rc == 0) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) {
+ rc = fts5ExecPrintf(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0),
+ ts+40077, /* "DELETE FROM %Q.'..." */
+ libc.VaList(bp+32, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName))
+ }
+
+ // Reinitialize the %_data table. This call creates the initial structure
+ // and averages records.
+ if rc == 0 {
+ rc = sqlite3Fts5IndexReinit(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
+ }
+ if rc == 0 {
+ rc = sqlite3Fts5StorageConfigValue(tls, p, ts+37107 /* "version" */, uintptr(0), 4)
+ }
+ return rc
+}
+
+func sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226449:12: */
+ bp := tls.Alloc(44)
+ defer tls.Free(44)
+
+ *(*Fts5Buffer)(unsafe.Pointer(bp + 24 /* buf */)) = Fts5Buffer{Fp: uintptr(0), Fn: 0, FnSpace: 0}
+ var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
+ *(*uintptr)(unsafe.Pointer(bp + 16 /* pScan */)) = uintptr(0)
+ // var ctx Fts5InsertCtx at bp, 16
+
+ // var rc int32 at bp+40, 4
+
+ var rc2 int32
+
+ libc.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(Fts5InsertCtx{})))
+ (*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FpStorage = p
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = sqlite3Fts5StorageDeleteAll(tls, p)
+ if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5StorageLoadTotals(tls, p, 1)
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5StorageGetStmt(tls, p, 10, bp+16 /* &pScan */, uintptr(0))
+ }
+
+ for (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0) && (100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pScan */)))) {
+ var iRowid I64 = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pScan */)), 0)
+
+ sqlite3Fts5BufferZero(tls, bp+24 /* &buf */)
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = sqlite3Fts5IndexBeginWrite(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, 0, iRowid)
+ for (*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol = 0; (*(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0) && ((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); (*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol++ {
+ (*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol = 0
+ if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol)))) == 0 {
+ var zText uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pScan */)), ((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol + 1))
+ var nText int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pScan */)), ((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol + 1))
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = sqlite3Fts5Tokenize(tls, pConfig,
+ 0x0004,
+ zText, nText,
+ bp, /* &ctx */
+ *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{fts5StorageInsertCallback})))
+ }
+ sqlite3Fts5BufferAppendVarint(tls, bp+40 /* &rc */, bp+24 /* &buf */, int64((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol))
+ *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol)*8)) += (I64((*Fts5InsertCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol))
+ }
+ (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow++
+
+ if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5StorageInsertDocsize(tls, p, iRowid, bp+24 /* &buf */)
+ }
+ }
+ Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(bp+24 /* &buf */)).Fp)
+ rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pScan */)))
+ if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = rc2
+ }
+
+ // Write the averages record
+ if *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 40 /* rc */)) = fts5StorageSaveTotals(tls, p)
+ }
+ return *(*int32)(unsafe.Pointer(bp + 40 /* rc */))
+}
+
+func sqlite3Fts5StorageOptimize(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226504:12: */
+ return sqlite3Fts5IndexOptimize(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
+}
+
+func sqlite3Fts5StorageMerge(tls *libc.TLS, p uintptr, nMerge int32) int32 { /* sqlite3.c:226508:12: */
+ return sqlite3Fts5IndexMerge(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, nMerge)
+}
+
+func sqlite3Fts5StorageReset(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226512:12: */
+ return sqlite3Fts5IndexReset(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
+}
+
+// Allocate a new rowid. This is used for "external content" tables when
+// a NULL value is inserted into the rowid column. The new rowid is allocated
+// by inserting a dummy row into the %_docsize table. The dummy will be
+// overwritten later.
+//
+// If the %_docsize table does not exist, SQLITE_MISMATCH is returned. In
+// this case the user is required to provide a rowid explicitly.
+func fts5StorageNewRowid(tls *libc.TLS, p uintptr, piRowid uintptr) int32 { /* sqlite3.c:226525:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var rc int32 = 20
+ if (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FbColumnsize != 0 {
+ *(*uintptr)(unsafe.Pointer(bp /* pReplace */)) = uintptr(0)
+ rc = fts5StorageGetStmt(tls, p, 6, bp /* &pReplace */, uintptr(0))
+ if rc == 0 {
+ Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)), 1)
+ Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)), 2)
+ Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)))
+ rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)))
+ }
+ if rc == 0 {
+ *(*I64)(unsafe.Pointer(piRowid)) = Xsqlite3_last_insert_rowid(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).Fdb)
+ }
+ }
+ return rc
+}
+
+// Insert a new row into the FTS content table.
+func sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, piRowid uintptr) int32 { /* sqlite3.c:226546:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
+ var rc int32 = 0
+
+ // Insert the new row into the %_content table.
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeContent != 0 {
+ if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8))) == 1 {
+ *(*I64)(unsafe.Pointer(piRowid)) = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(1)*8)))
+ } else {
+ rc = fts5StorageNewRowid(tls, p, piRowid)
+ }
+ } else {
+ *(*uintptr)(unsafe.Pointer(bp /* pInsert */)) = uintptr(0) // Statement to write %_content table
+ var i int32 // Counter variable
+ rc = fts5StorageGetStmt(tls, p, 3, bp /* &pInsert */, uintptr(0))
+ for i = 1; (rc == 0) && (i <= ((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol + 1)); i++ {
+ rc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp /* pInsert */)), i, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)))
+ }
+ if rc == 0 {
+ Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pInsert */)))
+ rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pInsert */)))
+ }
+ *(*I64)(unsafe.Pointer(piRowid)) = Xsqlite3_last_insert_rowid(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb)
+ }
+
+ return rc
+}
+
+// Insert new entries into the FTS index and %_docsize table.
+func sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRowid I64) int32 { /* sqlite3.c:226581:12: */
+ bp := tls.Alloc(36)
+ defer tls.Free(36)
+
+ var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = 0 // Return code
+ // var ctx Fts5InsertCtx at bp+16, 16
+ // Tokenization callback context object
+ // var buf Fts5Buffer at bp, 16
+ // Buffer used to build up %_docsize blob
+
+ libc.Xmemset(tls, bp /* &buf */, 0, uint64(unsafe.Sizeof(Fts5Buffer{})))
+ (*Fts5InsertCtx)(unsafe.Pointer(bp + 16 /* &ctx */)).FpStorage = p
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = fts5StorageLoadTotals(tls, p, 1)
+
+ if *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = sqlite3Fts5IndexBeginWrite(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, 0, iRowid)
+ }
+ for (*Fts5InsertCtx)(unsafe.Pointer(bp + 16 /* &ctx */)).FiCol = 0; (*(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == 0) && ((*Fts5InsertCtx)(unsafe.Pointer(bp+16 /* &ctx */)).FiCol < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); (*Fts5InsertCtx)(unsafe.Pointer(bp+16 /* &ctx */)).FiCol++ {
+ (*Fts5InsertCtx)(unsafe.Pointer(bp + 16 /* &ctx */)).FszCol = 0
+ if int32(*(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp+16 /* &ctx */)).FiCol)))) == 0 {
+ var zText uintptr = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(((*Fts5InsertCtx)(unsafe.Pointer(bp+16 /* &ctx */)).FiCol+2))*8)))
+ var nText int32 = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(((*Fts5InsertCtx)(unsafe.Pointer(bp+16 /* &ctx */)).FiCol+2))*8)))
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = sqlite3Fts5Tokenize(tls, pConfig,
+ 0x0004,
+ zText, nText,
+ bp+16, /* &ctx */
+ *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{fts5StorageInsertCallback})))
+ }
+ sqlite3Fts5BufferAppendVarint(tls, bp+32 /* &rc */, bp /* &buf */, int64((*Fts5InsertCtx)(unsafe.Pointer(bp+16 /* &ctx */)).FszCol))
+ *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((*Fts5InsertCtx)(unsafe.Pointer(bp+16 /* &ctx */)).FiCol)*8)) += (I64((*Fts5InsertCtx)(unsafe.Pointer(bp + 16 /* &ctx */)).FszCol))
+ }
+ (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow++
+
+ // Write the %_docsize record
+ if *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = fts5StorageInsertDocsize(tls, p, iRowid, bp /* &buf */)
+ }
+ Xsqlite3_free(tls, (*Fts5Buffer)(unsafe.Pointer(bp /* &buf */)).Fp)
+
+ return *(*int32)(unsafe.Pointer(bp + 32 /* rc */))
+}
+
+func fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) int32 { /* sqlite3.c:226624:12: */
+ bp := tls.Alloc(32)
+ defer tls.Free(32)
+
+ var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
+ var zSql uintptr
+ var rc int32
+
+ zSql = Xsqlite3_mprintf(tls, ts+40106, /* "SELECT count(*) ..." */
+ libc.VaList(bp, (*Fts5Config)(unsafe.Pointer(pConfig)).FzDb, (*Fts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix))
+ if zSql == uintptr(0) {
+ rc = 7
+ } else {
+ *(*uintptr)(unsafe.Pointer(bp + 24 /* pCnt */)) = uintptr(0)
+ rc = Xsqlite3_prepare_v2(tls, (*Fts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -1, bp+24 /* &pCnt */, uintptr(0))
+ if rc == 0 {
+ if 100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pCnt */))) {
+ *(*I64)(unsafe.Pointer(pnRow)) = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pCnt */)), 0)
+ }
+ rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 24 /* pCnt */)))
+ }
+ }
+
+ Xsqlite3_free(tls, zSql)
+ return rc
+}
+
+// Context object used by sqlite3Fts5StorageIntegrity().
+type Fts5IntegrityCtx1 = struct {
+ FiRowid I64
+ FiCol int32
+ FszCol int32
+ Fcksum U64
+ FpTermset uintptr
+ FpConfig uintptr
+}
+
+// Context object used by sqlite3Fts5StorageIntegrity().
+type Fts5IntegrityCtx = Fts5IntegrityCtx1 /* sqlite3.c:226652:33 */
+
+// Tokenization callback used by integrity check.
+func fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32, pToken uintptr, nToken int32, iUnused1 int32, iUnused2 int32) int32 { /* sqlite3.c:226666:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var pCtx uintptr = pContext
+ var pTermset uintptr = (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FpTermset
+ // var bPresent int32 at bp, 4
+
+ var ii int32
+ var rc int32 = 0
+ var iPos int32
+ var iCol int32
+
+ _ = iUnused1
+ _ = iUnused2
+ if nToken > 32768 {
+ nToken = 32768
+ }
+
+ if ((tflags & 0x0001) == 0) || ((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FszCol == 0) {
+ (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FszCol++
+ }
+
+ switch (*Fts5Config)(unsafe.Pointer((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FpConfig)).FeDetail {
+ case 0:
+ iPos = ((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FszCol - 1)
+ iCol = (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiCol
+ break
+
+ case 2:
+ iPos = (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiCol
+ iCol = 0
+ break
+
+ default:
+
+ iPos = 0
+ iCol = 0
+ break
+ }
+
+ rc = sqlite3Fts5TermsetAdd(tls, pTermset, 0, pToken, nToken, bp /* &bPresent */)
+ if (rc == 0) && (*(*int32)(unsafe.Pointer(bp /* bPresent */)) == 0) {
+ *(*U64)(unsafe.Pointer(pCtx + 16 /* &.cksum */)) ^= (sqlite3Fts5IndexEntryCksum(tls,
+ (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiRowid, iCol, iPos, 0, pToken, nToken))
+ }
+
+ for ii = 0; (rc == 0) && (ii < (*Fts5Config)(unsafe.Pointer((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FpConfig)).FnPrefix); ii++ {
+ var nChar int32 = *(*int32)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer((*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FpConfig)).FaPrefix + uintptr(ii)*4))
+ var nByte int32 = sqlite3Fts5IndexCharlenToBytelen(tls, pToken, nToken, nChar)
+ if nByte != 0 {
+ rc = sqlite3Fts5TermsetAdd(tls, pTermset, (ii + 1), pToken, nByte, bp /* &bPresent */)
+ if *(*int32)(unsafe.Pointer(bp /* bPresent */)) == 0 {
+ *(*U64)(unsafe.Pointer(pCtx + 16 /* &.cksum */)) ^= (sqlite3Fts5IndexEntryCksum(tls,
+ (*Fts5IntegrityCtx)(unsafe.Pointer(pCtx)).FiRowid, iCol, iPos, (ii + 1), pToken, nByte))
+ }
+ }
+ }
+
+ return rc
+}
+
+// Check that the contents of the FTS index match that of the %_content
+// table. Return SQLITE_OK if they do, or SQLITE_CORRUPT if not. Return
+// some other SQLite error code if an error occurs while attempting to
+// determine this.
+func sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226736:12: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ var pConfig uintptr = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
+ var rc int32 // Return code
+ var aColSize uintptr // Array of size pConfig->nCol
+ var aTotalSize uintptr // Array of size pConfig->nCol
+ // var ctx Fts5IntegrityCtx at bp, 40
+
+ // var pScan uintptr at bp+40, 8
+
+ libc.Xmemset(tls, bp /* &ctx */, 0, uint64(unsafe.Sizeof(Fts5IntegrityCtx{})))
+ (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpConfig = (*Fts5Storage)(unsafe.Pointer(p)).FpConfig
+ aTotalSize = Xsqlite3_malloc64(tls, (uint64(uint64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol) * (uint64(unsafe.Sizeof(int32(0))) + uint64(unsafe.Sizeof(I64(0)))))))
+ if !(aTotalSize != 0) {
+ return 7
+ }
+ aColSize = (aTotalSize + uintptr((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)*8)
+ libc.Xmemset(tls, aTotalSize, 0, (uint64(unsafe.Sizeof(I64(0))) * uint64((*Fts5Config)(unsafe.Pointer(pConfig)).FnCol)))
+
+ // Generate the expected index checksum based on the contents of the
+ // %_content table. This block stores the checksum in ctx.cksum.
+ rc = fts5StorageGetStmt(tls, p, 10, bp+40 /* &pScan */, uintptr(0))
+ if rc == 0 {
+ var rc2 int32
+ for 100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */))) {
+ var i int32
+ (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiRowid = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), 0)
+ (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol = 0
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 {
+ rc = sqlite3Fts5StorageDocsize(tls, p, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiRowid, aColSize)
+ }
+ if (rc == 0) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == 1) {
+ rc = sqlite3Fts5TermsetNew(tls, (bp /* &ctx */ + 24 /* &.pTermset */))
+ }
+ for i = 0; (rc == 0) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ {
+ if *(*U8)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 {
+ continue
+ }
+ (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FiCol = i
+ (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol = 0
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == 2 {
+ rc = sqlite3Fts5TermsetNew(tls, (bp /* &ctx */ + 24 /* &.pTermset */))
+ }
+ if rc == 0 {
+ var zText uintptr = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), (i + 1))
+ var nText int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)), (i + 1))
+ rc = sqlite3Fts5Tokenize(tls, pConfig,
+ 0x0004,
+ zText, nText,
+ bp, /* &ctx */
+ *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{fts5StorageIntegrityCallback})))
+ }
+ if ((rc == 0) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0)) && ((*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol != *(*int32)(unsafe.Pointer(aColSize + uintptr(i)*4))) {
+ rc = (11 | (int32(1) << 8))
+ }
+ *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) += (I64((*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FszCol))
+ if (*Fts5Config)(unsafe.Pointer(pConfig)).FeDetail == 2 {
+ sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset)
+ (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset = uintptr(0)
+ }
+ }
+ sqlite3Fts5TermsetFree(tls, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset)
+ (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).FpTermset = uintptr(0)
+
+ if rc != 0 {
+ break
+ }
+ }
+ rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 40 /* pScan */)))
+ if rc == 0 {
+ rc = rc2
+ }
+ }
+
+ // Test that the "totals" (sometimes called "averages") record looks Ok
+ if rc == 0 {
+ var i int32
+ rc = fts5StorageLoadTotals(tls, p, 0)
+ for i = 0; (rc == 0) && (i < (*Fts5Config)(unsafe.Pointer(pConfig)).FnCol); i++ {
+ if *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8)) != *(*I64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) {
+ rc = (11 | (int32(1) << 8))
+ }
+ }
+ }
+
+ // Check that the %_docsize and %_content tables contain the expected
+ // number of rows.
+ if (rc == 0) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FeContent == 0) {
+ *(*I64)(unsafe.Pointer(bp + 48 /* nRow */)) = int64(0)
+ rc = fts5StorageCount(tls, p, ts+36610 /* "content" */, bp+48 /* &nRow */)
+ if (rc == 0) && (*(*I64)(unsafe.Pointer(bp + 48 /* nRow */)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow) {
+ rc = (11 | (int32(1) << 8))
+ }
+ }
+ if (rc == 0) && ((*Fts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0) {
+ *(*I64)(unsafe.Pointer(bp + 56 /* nRow */)) = int64(0)
+ rc = fts5StorageCount(tls, p, ts+36961 /* "docsize" */, bp+56 /* &nRow */)
+ if (rc == 0) && (*(*I64)(unsafe.Pointer(bp + 56 /* nRow */)) != (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow) {
+ rc = (11 | (int32(1) << 8))
+ }
+ }
+
+ // Pass the expected checksum down to the FTS index module. It will
+ // verify, amongst other things, that it matches the checksum generated by
+ // inspecting the index itself.
+ if rc == 0 {
+ rc = sqlite3Fts5IndexIntegrityCheck(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, (*Fts5IntegrityCtx)(unsafe.Pointer(bp /* &ctx */)).Fcksum)
+ }
+
+ Xsqlite3_free(tls, aTotalSize)
+ return rc
+}
+
+// Obtain an SQLite statement handle that may be used to read data from the
+// %_content table.
+func sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, pzErrMsg uintptr) int32 { /* sqlite3.c:226838:12: */
+ var rc int32
+
+ rc = fts5StorageGetStmt(tls, p, eStmt, pp, pzErrMsg)
+ if rc == 0 {
+
+ *(*uintptr)(unsafe.Pointer((p + 40 /* &.aStmt */) + uintptr(eStmt)*8)) = uintptr(0)
+ }
+ return rc
+}
+
+// Release an SQLite statement handle obtained via an earlier call to
+// sqlite3Fts5StorageStmt(). The eStmt parameter passed to this function
+// must match that passed to the sqlite3Fts5StorageStmt() call.
+func sqlite3Fts5StorageStmtRelease(tls *libc.TLS, p uintptr, eStmt int32, pStmt uintptr) { /* sqlite3.c:226862:13: */
+
+ if *(*uintptr)(unsafe.Pointer((p + 40 /* &.aStmt */) + uintptr(eStmt)*8)) == uintptr(0) {
+ Xsqlite3_reset(tls, pStmt)
+ *(*uintptr)(unsafe.Pointer((p + 40 /* &.aStmt */) + uintptr(eStmt)*8)) = pStmt
+ } else {
+ Xsqlite3_finalize(tls, pStmt)
+ }
+}
+
+func fts5StorageDecodeSizeArray(tls *libc.TLS, aCol uintptr, nCol int32, aBlob uintptr, nBlob int32) int32 { /* sqlite3.c:226879:12: */
+ var i int32
+ var iOff int32 = 0
+ for i = 0; i < nCol; i++ {
+ if iOff >= nBlob {
+ return 1
+ }
+ iOff = iOff + (sqlite3Fts5GetVarint32(tls, (aBlob + uintptr(iOff)), (aCol + uintptr(i)*4)))
+ }
+ return (libc.Bool32(iOff != nBlob))
+}
+
+// Argument aCol points to an array of integers containing one entry for
+// each table column. This function reads the %_docsize record for the
+// specified rowid and populates aCol[] with the results.
+//
+// An SQLite error code is returned if an error occurs, or SQLITE_OK
+// otherwise.
+func sqlite3Fts5StorageDocsize(tls *libc.TLS, p uintptr, iRowid I64, aCol uintptr) int32 { /* sqlite3.c:226900:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FnCol // Number of user columns in table
+ *(*uintptr)(unsafe.Pointer(bp /* pLookup */)) = uintptr(0) // Statement to query %_docsize
+ var rc int32 // Return Code
+
+ rc = fts5StorageGetStmt(tls, p, 8, bp /* &pLookup */, uintptr(0))
+ if rc == 0 {
+ var bCorrupt int32 = 1
+ Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp /* pLookup */)), 1, iRowid)
+ if 100 == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pLookup */))) {
+ var aBlob uintptr = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp /* pLookup */)), 0)
+ var nBlob int32 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp /* pLookup */)), 0)
+ if 0 == fts5StorageDecodeSizeArray(tls, aCol, nCol, aBlob, nBlob) {
+ bCorrupt = 0
+ }
+ }
+ rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pLookup */)))
+ if (bCorrupt != 0) && (rc == 0) {
+ rc = (11 | (int32(1) << 8))
+ }
+ }
+
+ return rc
+}
+
+func sqlite3Fts5StorageSize(tls *libc.TLS, p uintptr, iCol int32, pnToken uintptr) int32 { /* sqlite3.c:226926:12: */
+ var rc int32 = fts5StorageLoadTotals(tls, p, 0)
+ if rc == 0 {
+ *(*I64)(unsafe.Pointer(pnToken)) = int64(0)
+ if iCol < 0 {
+ var i int32
+ for i = 0; i < (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FnCol; i++ {
+ *(*I64)(unsafe.Pointer(pnToken)) += (*(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(i)*8)))
+ }
+ } else if iCol < (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FnCol {
+ *(*I64)(unsafe.Pointer(pnToken)) = *(*I64)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(iCol)*8))
+ } else {
+ rc = 25
+ }
+ }
+ return rc
+}
+
+func sqlite3Fts5StorageRowCount(tls *libc.TLS, p uintptr, pnRow uintptr) int32 { /* sqlite3.c:226944:12: */
+ var rc int32 = fts5StorageLoadTotals(tls, p, 0)
+ if rc == 0 {
+ // nTotalRow being zero does not necessarily indicate a corrupt
+ // database - it might be that the FTS5 table really does contain zero
+ // rows. However this function is only called from the xRowCount() API,
+ // and there is no way for that API to be invoked if the table contains
+ // no rows. Hence the FTS5_CORRUPT return.
+ *(*I64)(unsafe.Pointer(pnRow)) = (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow
+ if (*Fts5Storage)(unsafe.Pointer(p)).FnTotalRow <= int64(0) {
+ rc = (11 | (int32(1) << 8))
+ }
+ }
+ return rc
+}
+
+// Flush any data currently held in-memory to disk.
+func sqlite3Fts5StorageSync(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226961:12: */
+ var rc int32 = 0
+ var iLastRowid I64 = Xsqlite3_last_insert_rowid(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).Fdb)
+ if (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid != 0 {
+ rc = fts5StorageSaveTotals(tls, p)
+ (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0
+ }
+ if rc == 0 {
+ rc = sqlite3Fts5IndexSync(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
+ }
+ Xsqlite3_set_last_insert_rowid(tls, (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).Fdb, iLastRowid)
+ return rc
+}
+
+func sqlite3Fts5StorageRollback(tls *libc.TLS, p uintptr) int32 { /* sqlite3.c:226975:12: */
+ (*Fts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0
+ return sqlite3Fts5IndexRollback(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex)
+}
+
+func sqlite3Fts5StorageConfigValue(tls *libc.TLS, p uintptr, z uintptr, pVal uintptr, iVal int32) int32 { /* sqlite3.c:226980:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ *(*uintptr)(unsafe.Pointer(bp /* pReplace */)) = uintptr(0)
+ var rc int32 = fts5StorageGetStmt(tls, p, 9, bp /* &pReplace */, uintptr(0))
+ if rc == 0 {
+ Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)), 1, z, -1, uintptr(0))
+ if pVal != 0 {
+ Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)), 2, pVal)
+ } else {
+ Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)), 2, iVal)
+ }
+ Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)))
+ rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)))
+ Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp /* pReplace */)), 1)
+ }
+ if (rc == 0) && (pVal != 0) {
+ var iNew int32 = ((*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FiCookie + 1)
+ rc = sqlite3Fts5IndexSetCookie(tls, (*Fts5Storage)(unsafe.Pointer(p)).FpIndex, iNew)
+ if rc == 0 {
+ (*Fts5Config)(unsafe.Pointer((*Fts5Storage)(unsafe.Pointer(p)).FpConfig)).FiCookie = iNew
+ }
+ }
+ return rc
+}
+
+// 2014 May 31
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+
+// #include "fts5Int.h"
+
+// *************************************************************************
+//
+// Start of ascii tokenizer implementation.
+
+// For tokenizers with no "unicode" modifier, the set of token characters
+// is the same as the set of ASCII range alphanumeric characters.
+var aAsciiTokenChar = [128]uint8{
+ uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0x00..0x0F
+ uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0x10..0x1F
+ uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0x20..0x2F
+ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0x30..0x3F
+ uint8(0), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), // 0x40..0x4F
+ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0x50..0x5F
+ uint8(0), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), // 0x60..0x6F
+ uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(1), uint8(0), uint8(0), uint8(0), uint8(0), uint8(0), // 0x70..0x7F
+} /* sqlite3.c:227033:22 */
+
+type AsciiTokenizer1 = struct{ FaTokenChar [128]uint8 }
+
+type AsciiTokenizer = AsciiTokenizer1 /* sqlite3.c:227044:31 */
+
+func fts5AsciiAddExceptions(tls *libc.TLS, p uintptr, zArg uintptr, bTokenChars int32) { /* sqlite3.c:227049:13: */
+ var i int32
+ for i = 0; *(*int8)(unsafe.Pointer(zArg + uintptr(i))) != 0; i++ {
+ if (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i)))) & 0x80) == 0 {
+ *(*uint8)(unsafe.Pointer((p /* &.aTokenChar */) + uintptr(int32(*(*int8)(unsafe.Pointer(zArg + uintptr(i))))))) = uint8(bTokenChars)
+ }
+ }
+}
+
+// Delete a "ascii" tokenizer.
+func fts5AsciiDelete(tls *libc.TLS, p uintptr) { /* sqlite3.c:227065:13: */
+ Xsqlite3_free(tls, p)
+}
+
+// Create an "ascii" tokenizer.
+func fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:227072:12: */
+ var rc int32 = 0
+ var p uintptr = uintptr(0)
+ _ = pUnused
+ if (nArg % 2) != 0 {
+ rc = 1
+ } else {
+ p = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(AsciiTokenizer{})))
+ if p == uintptr(0) {
+ rc = 7
+ } else {
+ var i int32
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(AsciiTokenizer{})))
+ libc.Xmemcpy(tls, p /* &.aTokenChar */, uintptr(unsafe.Pointer(&aAsciiTokenChar)), uint64(unsafe.Sizeof(aAsciiTokenChar)))
+ for i = 0; (rc == 0) && (i < nArg); i = i + (2) {
+ var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8))
+ if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40138 /* "tokenchars" */) {
+ fts5AsciiAddExceptions(tls, p, zArg, 1)
+ } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40149 /* "separators" */) {
+ fts5AsciiAddExceptions(tls, p, zArg, 0)
+ } else {
+ rc = 1
+ }
+ }
+ if rc != 0 {
+ fts5AsciiDelete(tls, p)
+ p = uintptr(0)
+ }
+ }
+ }
+
+ *(*uintptr)(unsafe.Pointer(ppOut)) = p
+ return rc
+}
+
+func asciiFold(tls *libc.TLS, aOut uintptr, aIn uintptr, nByte int32) { /* sqlite3.c:227113:13: */
+ var i int32
+ for i = 0; i < nByte; i++ {
+ var c int8 = *(*int8)(unsafe.Pointer(aIn + uintptr(i)))
+ if (int32(c) >= 'A') && (int32(c) <= 'Z') {
+ c = int8(int32(c) + (32))
+ }
+ *(*int8)(unsafe.Pointer(aOut + uintptr(i))) = c
+ }
+}
+
+// Tokenize some text using the ascii tokenizer.
+func fts5AsciiTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:227125:12: */
+ bp := tls.Alloc(64)
+ defer tls.Free(64)
+
+ var p uintptr = pTokenizer
+ var rc int32 = 0
+ var ie int32
+ var is int32 = 0
+ // var aFold [64]int8 at bp, 64
+
+ var nFold int32 = int32(unsafe.Sizeof([64]int8{}))
+ var pFold uintptr = bp /* aFold */
+ var a uintptr = p /* &.aTokenChar */
+
+ _ = iUnused
+
+ for (is < nText) && (rc == 0) {
+ var nByte int32
+
+ // Skip any leading divider characters.
+ for (is < nText) && (((int32(*(*int8)(unsafe.Pointer(pText + uintptr(is)))) & 0x80) == 0) && (int32(*(*uint8)(unsafe.Pointer(a + uintptr(int32(*(*int8)(unsafe.Pointer(pText + uintptr(is)))))))) == 0)) {
+ is++
+ }
+ if is == nText {
+ break
+ }
+
+ // Count the token characters
+ ie = (is + 1)
+ for (ie < nText) && (((int32(*(*int8)(unsafe.Pointer(pText + uintptr(ie)))) & 0x80) != 0) || (*(*uint8)(unsafe.Pointer(a + uintptr(int32(*(*int8)(unsafe.Pointer(pText + uintptr(ie))))))) != 0)) {
+ ie++
+ }
+
+ // Fold to lower case
+ nByte = (ie - is)
+ if nByte > nFold {
+ if pFold != bp /* aFold */ {
+ Xsqlite3_free(tls, pFold)
+ }
+ pFold = Xsqlite3_malloc64(tls, (uint64(Sqlite3_int64(nByte) * int64(2))))
+ if pFold == uintptr(0) {
+ rc = 7
+ break
+ }
+ nFold = (nByte * 2)
+ }
+ asciiFold(tls, pFold, (pText + uintptr(is)), nByte)
+
+ // Invoke the token callback
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&xToken)))(tls, pCtx, 0, pFold, nByte, is, ie)
+ is = (ie + 1)
+ }
+
+ if pFold != bp /* aFold */ {
+ Xsqlite3_free(tls, pFold)
+ }
+ if rc == 101 {
+ rc = 0
+ }
+ return rc
+}
+
+// *************************************************************************
+//
+// Start of unicode61 tokenizer implementation.
+
+// The following two macros - READ_UTF8 and WRITE_UTF8 - have been copied
+// from the sqlite3 source file utf.c. If this file is compiled as part
+// of the amalgamation, they are not required.
+
+type Unicode61Tokenizer1 = struct {
+ FaTokenChar [128]uint8
+ FaFold uintptr
+ FnFold int32
+ FeRemoveDiacritic int32
+ FnException int32
+ FaiException uintptr
+ FaCategory [32]uint8
+}
+
+// *************************************************************************
+//
+// Start of unicode61 tokenizer implementation.
+
+// The following two macros - READ_UTF8 and WRITE_UTF8 - have been copied
+// from the sqlite3 source file utf.c. If this file is compiled as part
+// of the amalgamation, they are not required.
+
+type Unicode61Tokenizer = Unicode61Tokenizer1 /* sqlite3.c:227240:35 */
+
+// Values for eRemoveDiacritic (must match internals of fts5_unicode2.c)
+
+func fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars int32) int32 { /* sqlite3.c:227257:12: */
+ var rc int32 = 0
+ var n int32 = int32(libc.Xstrlen(tls, z))
+ var aNew uintptr
+
+ if n > 0 {
+ aNew = Xsqlite3_realloc64(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException,
+ (uint64((uint64(n + (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException)) * uint64(unsafe.Sizeof(int32(0))))))
+ if aNew != 0 {
+ var nNew int32 = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException
+ var zCsr uintptr = z
+ var zTerm uintptr = (z + uintptr(n))
+ for zCsr < zTerm {
+ var iCode U32
+ var bToken int32
+ iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1))))
+ if iCode >= U32(0xc0) {
+ iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))])
+ for (zCsr != zTerm) && ((int32(*(*uint8)(unsafe.Pointer(zCsr))) & 0xc0) == 0x80) {
+ iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1)))))))
+ }
+ if ((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE)) {
+ iCode = U32(0xFFFD)
+ }
+ }
+
+ if iCode < U32(128) {
+ *(*uint8)(unsafe.Pointer((p /* &.aTokenChar */) + uintptr(iCode))) = uint8(bTokenChars)
+ } else {
+ bToken = int32(*(*uint8)(unsafe.Pointer((p + 160 /* &.aCategory */) + uintptr(sqlite3Fts5UnicodeCategory(tls, iCode)))))
+
+ if (bToken != bTokenChars) && (sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) == 0) {
+ var i int32
+ for i = 0; i < nNew; i++ {
+ if U32(*(*int32)(unsafe.Pointer(aNew + uintptr(i)*4))) > iCode {
+ break
+ }
+ }
+ libc.Xmemmove(tls, (aNew + uintptr((i+1))*4), (aNew + uintptr(i)*4), ((uint64(nNew - i)) * uint64(unsafe.Sizeof(int32(0)))))
+ *(*int32)(unsafe.Pointer(aNew + uintptr(i)*4)) = int32(iCode)
+ nNew++
+ }
+ }
+ }
+ (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException = aNew
+ (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException = nNew
+ } else {
+ rc = 7
+ }
+ }
+
+ return rc
+}
+
+// Return true if the p->aiException[] array contains the value iCode.
+func fts5UnicodeIsException(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:227307:12: */
+ if (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException > 0 {
+ var a uintptr = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException
+ var iLo int32 = 0
+ var iHi int32 = ((*Unicode61Tokenizer)(unsafe.Pointer(p)).FnException - 1)
+
+ for iHi >= iLo {
+ var iTest int32 = ((iHi + iLo) / 2)
+ if iCode == *(*int32)(unsafe.Pointer(a + uintptr(iTest)*4)) {
+ return 1
+ } else if iCode > *(*int32)(unsafe.Pointer(a + uintptr(iTest)*4)) {
+ iLo = (iTest + 1)
+ } else {
+ iHi = (iTest - 1)
+ }
+ }
+ }
+
+ return 0
+}
+
+// Delete a "unicode61" tokenizer.
+func fts5UnicodeDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:227331:13: */
+ if pTok != 0 {
+ var p uintptr = pTok
+ Xsqlite3_free(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaiException)
+ Xsqlite3_free(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold)
+ Xsqlite3_free(tls, p)
+ }
+ return
+}
+
+func unicodeSetCategories(tls *libc.TLS, p uintptr, zCat uintptr) int32 { /* sqlite3.c:227341:12: */
+ var z uintptr = zCat
+
+ for *(*int8)(unsafe.Pointer(z)) != 0 {
+ for (int32(*(*int8)(unsafe.Pointer(z))) == ' ') || (int32(*(*int8)(unsafe.Pointer(z))) == '\t') {
+ z++
+ }
+ if (*(*int8)(unsafe.Pointer(z)) != 0) && (sqlite3Fts5UnicodeCatParse(tls, z, p+160 /* &.aCategory */) != 0) {
+ return 1
+ }
+ for ((int32(*(*int8)(unsafe.Pointer(z))) != ' ') && (int32(*(*int8)(unsafe.Pointer(z))) != '\t')) && (int32(*(*int8)(unsafe.Pointer(z))) != 0) {
+ z++
+ }
+ }
+
+ sqlite3Fts5UnicodeAscii(tls, p+160 /* &.aCategory */, p /* &.aTokenChar */)
+ return 0
+}
+
+// Create a "unicode61" tokenizer.
+func fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:227359:12: */
+ var rc int32 = 0 // Return code
+ var p uintptr = uintptr(0) // New tokenizer object
+
+ _ = pUnused
+
+ if (nArg % 2) != 0 {
+ rc = 1
+ } else {
+ p = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Unicode61Tokenizer{})))
+ if p != 0 {
+ var zCat uintptr = ts + 40160 /* "L* N* Co" */
+ var i int32
+ libc.Xmemset(tls, p, 0, uint64(unsafe.Sizeof(Unicode61Tokenizer{})))
+
+ (*Unicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = 1
+ (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold = 64
+ (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, (uint64(uint64((*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold) * uint64(unsafe.Sizeof(int8(0))))))
+ if (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) {
+ rc = 7
+ }
+
+ // Search for a "categories" argument
+ for i = 0; (rc == 0) && (i < nArg); i = i + (2) {
+ if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40169 /* "categories" */) {
+ zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8))
+ }
+ }
+
+ if rc == 0 {
+ rc = unicodeSetCategories(tls, p, zCat)
+ }
+
+ for i = 0; (rc == 0) && (i < nArg); i = i + (2) {
+ var zArg uintptr = *(*uintptr)(unsafe.Pointer(azArg + uintptr((i+1))*8))
+ if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40180 /* "remove_diacritic..." */) {
+ if (((int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) != '0') && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) != '1')) && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) != '2')) || (*(*int8)(unsafe.Pointer(zArg + uintptr(1))) != 0) {
+ rc = 1
+ } else {
+ (*Unicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) - '0')
+ }
+ } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40138 /* "tokenchars" */) {
+ rc = fts5UnicodeAddExceptions(tls, p, zArg, 1)
+ } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40149 /* "separators" */) {
+ rc = fts5UnicodeAddExceptions(tls, p, zArg, 0)
+ } else if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), ts+40169 /* "categories" */) {
+ } else {
+ rc = 1
+ }
+ }
+ } else {
+ rc = 7
+ }
+ if rc != 0 {
+ fts5UnicodeDelete(tls, p)
+ p = uintptr(0)
+ }
+ *(*uintptr)(unsafe.Pointer(ppOut)) = p
+ }
+ return rc
+}
+
+// Return true if, for the purposes of tokenizing with the tokenizer
+// passed as the first argument, codepoint iCode is considered a token
+// character (not a separator).
+func fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) int32 { /* sqlite3.c:227439:12: */
+ return (int32(*(*uint8)(unsafe.Pointer((p + 160 /* &.aCategory */) + uintptr(sqlite3Fts5UnicodeCategory(tls, U32(iCode)))))) ^
+ fts5UnicodeIsException(tls, p, iCode))
+}
+
+func fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:227446:12: */
+ var p uintptr
+ var rc int32
+ var a uintptr
+ var zTerm uintptr
+ var zCsr uintptr
+
+ // Output buffer
+ var aFold uintptr
+ var nFold int32
+ var pEnd uintptr
+ var iCode U32 // non-ASCII codepoint read from input
+ var zOut uintptr
+ var is int32
+ var ie int32
+ p = pTokenizer
+ rc = 0
+ a = p /* &.aTokenChar */
+ zTerm = (pText + uintptr(nText))
+ zCsr = pText
+ aFold = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold
+ nFold = (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold
+ pEnd = (aFold + uintptr((nFold - 6)))
+
+ _ = iUnused
+
+ // Each iteration of this loop gobbles up a contiguous run of separators,
+ // then the next token.
+__1:
+ if !(rc == 0) {
+ goto __2
+ }
+ zOut = aFold
+
+ // Skip any separator characters.
+__3:
+ if !(1 != 0) {
+ goto __4
+ }
+ if !(zCsr >= zTerm) {
+ goto __5
+ }
+ goto tokenize_done
+__5:
+ ;
+ if !((int32(*(*uint8)(unsafe.Pointer(zCsr))) & 0x80) != 0) {
+ goto __6
+ }
+ // A character outside of the ascii range. Skip past it if it is
+ // a separator character. Or break out of the loop if it is not.
+ is = (int32((int64(zCsr) - int64(pText)) / 1))
+ iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1))))
+ if !(iCode >= U32(0xc0)) {
+ goto __8
+ }
+ iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))])
+__9:
+ if !((zCsr != zTerm) && ((int32(*(*uint8)(unsafe.Pointer(zCsr))) & 0xc0) == 0x80)) {
+ goto __10
+ }
+ iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1)))))))
+ goto __9
+__10:
+ ;
+ if !(((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE))) {
+ goto __11
+ }
+ iCode = U32(0xFFFD)
+__11:
+ ;
+__8:
+ ;
+
+ if !(fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0) {
+ goto __12
+ }
+ goto non_ascii_tokenchar
+__12:
+ ;
+ goto __7
+__6:
+ if !(*(*uint8)(unsafe.Pointer(a + uintptr(*(*uint8)(unsafe.Pointer(zCsr))))) != 0) {
+ goto __13
+ }
+ is = (int32((int64(zCsr) - int64(pText)) / 1))
+ goto ascii_tokenchar
+__13:
+ ;
+ zCsr++
+__7:
+ ;
+ goto __3
+__4:
+ ;
+
+ // Run through the tokenchars. Fold them into the output buffer along
+ // the way.
+__14:
+ if !(zCsr < zTerm) {
+ goto __15
+ }
+
+ // Grow the output buffer so that there is sufficient space to fit the
+ // largest possible utf-8 character.
+ if !(zOut > pEnd) {
+ goto __16
+ }
+ aFold = Xsqlite3_malloc64(tls, (uint64(Sqlite3_int64(nFold) * int64(2))))
+ if !(aFold == uintptr(0)) {
+ goto __17
+ }
+ rc = 7
+ goto tokenize_done
+__17:
+ ;
+ zOut = (aFold + uintptr(((int64(zOut) - int64((*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold)) / 1)))
+ libc.Xmemcpy(tls, aFold, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold, uint64(nFold))
+ Xsqlite3_free(tls, (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold)
+ (*Unicode61Tokenizer)(unsafe.Pointer(p)).FaFold = aFold
+ (*Unicode61Tokenizer)(unsafe.Pointer(p)).FnFold = libc.AssignInt32(&nFold, (nFold * 2))
+ pEnd = (aFold + uintptr((nFold - 6)))
+__16:
+ ;
+
+ if !((int32(*(*uint8)(unsafe.Pointer(zCsr))) & 0x80) != 0) {
+ goto __18
+ }
+ // An non-ascii-range character. Fold it into the output buffer if
+ // it is a token character, or break out of the loop if it is not.
+ iCode = U32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1))))
+ if !(iCode >= U32(0xc0)) {
+ goto __20
+ }
+ iCode = U32(sqlite3Utf8Trans1[(iCode - U32(0xc0))])
+__21:
+ if !((zCsr != zTerm) && ((int32(*(*uint8)(unsafe.Pointer(zCsr))) & 0xc0) == 0x80)) {
+ goto __22
+ }
+ iCode = ((iCode << 6) + (U32(0x3f & int32(*(*uint8)(unsafe.Pointer(libc.PostIncUintptr(&zCsr, 1)))))))
+ goto __21
+__22:
+ ;
+ if !(((iCode < U32(0x80)) || ((iCode & 0xFFFFF800) == U32(0xD800))) || ((iCode & 0xFFFFFFFE) == U32(0xFFFE))) {
+ goto __23
+ }
+ iCode = U32(0xFFFD)
+__23:
+ ;
+__20:
+ ;
+
+ if !((fts5UnicodeIsAlnum(tls, p, int32(iCode)) != 0) || (sqlite3Fts5UnicodeIsdiacritic(tls, int32(iCode)) != 0)) {
+ goto __24
+ }
+non_ascii_tokenchar:
+ iCode = U32(sqlite3Fts5UnicodeFold(tls, int32(iCode), (*Unicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic))
+ if !(iCode != 0) {
+ goto __26
+ }
+ if !(iCode < U32(0x00080)) {
+ goto __27
+ }
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8((U8(iCode & U32(0xFF))))
+ goto __28
+__27:
+ if !(iCode < U32(0x00800)) {
+ goto __29
+ }
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xC0 + int32((U8((iCode >> 6) & U32(0x1F))))))
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ goto __30
+__29:
+ if !(iCode < U32(0x10000)) {
+ goto __31
+ }
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xE0 + int32((U8((iCode >> 12) & U32(0x0F))))))
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F))))))
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F))))))
+ goto __32
+__31:
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0xF0 + int32((U8((iCode >> 18) & U32(0x07))))))
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 12) & U32(0x3F))))))
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8((iCode >> 6) & U32(0x3F))))))
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(0x80 + int32((U8(iCode & U32(0x3F))))))
+__32:
+ ;
+__30:
+ ;
+__28:
+ ;
+__26:
+ ;
+ goto __25
+__24:
+ goto __15
+__25:
+ ;
+ goto __19
+__18:
+ if !(int32(*(*uint8)(unsafe.Pointer(a + uintptr(*(*uint8)(unsafe.Pointer(zCsr)))))) == 0) {
+ goto __33
+ }
+ // An ascii-range separator character. End of token.
+ goto __15
+ goto __34
+__33:
+ascii_tokenchar:
+ if !((int32(*(*uint8)(unsafe.Pointer(zCsr))) >= 'A') && (int32(*(*uint8)(unsafe.Pointer(zCsr))) <= 'Z')) {
+ goto __35
+ }
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = (int8(int32(*(*uint8)(unsafe.Pointer(zCsr))) + 32))
+ goto __36
+__35:
+ *(*int8)(unsafe.Pointer(libc.PostIncUintptr(&zOut, 1))) = int8(*(*uint8)(unsafe.Pointer(zCsr)))
+__36:
+ ;
+ zCsr++
+__34:
+ ;
+__19:
+ ;
+ ie = (int32((int64(zCsr) - int64(pText)) / 1))
+ goto __14
+__15:
+ ;
+
+ // Invoke the token callback
+ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&xToken)))(tls, pCtx, 0, aFold, (int32((int64(zOut) - int64(aFold)) / 1)), is, ie)
+ goto __1
+__2:
+ ;
+
+tokenize_done:
+ if !(rc == 101) {
+ goto __37
+ }
+ rc = 0
+__37:
+ ;
+ return rc
+}
+
+// *************************************************************************
+//
+// Start of porter stemmer implementation.
+
+// Any tokens larger than this (in bytes) are passed through without
+// stemming.
+
+type PorterTokenizer1 = struct {
+ Ftokenizer Fts5_tokenizer
+ FpTokenizer uintptr
+ FaBuf [128]int8
+}
+
+// *************************************************************************
+//
+// Start of porter stemmer implementation.
+
+// Any tokens larger than this (in bytes) are passed through without
+// stemming.
+
+type PorterTokenizer = PorterTokenizer1 /* sqlite3.c:227558:32 */
+
+// Delete a "porter" tokenizer.
+func fts5PorterDelete(tls *libc.TLS, pTok uintptr) { /* sqlite3.c:227568:13: */
+ if pTok != 0 {
+ var p uintptr = pTok
+ if (*PorterTokenizer)(unsafe.Pointer(p)).FpTokenizer != 0 {
+ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer((p /* &.tokenizer */ + 8 /* &.xDelete */))))(tls, (*PorterTokenizer)(unsafe.Pointer(p)).FpTokenizer)
+ }
+ Xsqlite3_free(tls, p)
+ }
+}
+
+// Create a "porter" tokenizer.
+func fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, ppOut uintptr) int32 { /* sqlite3.c:227581:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var pApi uintptr = pCtx
+ var rc int32 = 0
+ var pRet uintptr
+ *(*uintptr)(unsafe.Pointer(bp /* pUserdata */)) = uintptr(0)
+ var zBase uintptr = ts + 40198 /* "unicode61" */
+
+ if nArg > 0 {
+ zBase = *(*uintptr)(unsafe.Pointer(azArg + uintptr(0)*8))
+ }
+
+ pRet = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(PorterTokenizer{})))
+ if pRet != 0 {
+ libc.Xmemset(tls, pRet, 0, uint64(unsafe.Sizeof(PorterTokenizer{})))
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 16 /* &.xFindTokenizer */))))(tls, pApi, zBase, bp /* &pUserdata */, (pRet /* &.tokenizer */))
+ } else {
+ rc = 7
+ }
+ if rc == 0 {
+ var nArg2 int32 = func() int32 {
+ if nArg > 0 {
+ return (nArg - 1)
+ }
+ return 0
+ }()
+ var azArg2 uintptr = func() uintptr {
+ if nArg2 != 0 {
+ return (azArg + uintptr(1)*8)
+ }
+ return uintptr(0)
+ }()
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer((pRet /* &.tokenizer */ /* &.xCreate */))))(tls, *(*uintptr)(unsafe.Pointer(bp /* pUserdata */)), azArg2, nArg2, (pRet + 24 /* &.pTokenizer */))
+ }
+
+ if rc != 0 {
+ fts5PorterDelete(tls, pRet)
+ pRet = uintptr(0)
+ }
+ *(*uintptr)(unsafe.Pointer(ppOut)) = pRet
+ return rc
+}
+
+type PorterContext1 = struct {
+ FpCtx uintptr
+ FxToken uintptr
+ FaBuf uintptr
+}
+
+type PorterContext = PorterContext1 /* sqlite3.c:227617:30 */
+
+type PorterRule1 = struct {
+ FzSuffix uintptr
+ FnSuffix int32
+ FxCond uintptr
+ FzOutput uintptr
+ FnOutput int32
+ _ [4]byte
+}
+
+type PorterRule = PorterRule1 /* sqlite3.c:227624:27 */
+
+func fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) int32 { /* sqlite3.c:227659:12: */
+ return (libc.Bool32((((((int32(c) == 'a') || (int32(c) == 'e')) || (int32(c) == 'i')) || (int32(c) == 'o')) || (int32(c) == 'u')) || ((bYIsVowel != 0) && (int32(c) == 'y'))))
+}
+
+func fts5PorterGobbleVC(tls *libc.TLS, zStem uintptr, nStem int32, bPrevCons int32) int32 { /* sqlite3.c:227665:12: */
+ var i int32
+ var bCons int32 = bPrevCons
+
+ // Scan for a vowel
+ for i = 0; i < nStem; i++ {
+ if 0 == (libc.AssignInt32(&bCons, libc.BoolInt32(!(fts5PorterIsVowel(tls, *(*int8)(unsafe.Pointer(zStem + uintptr(i))), bCons) != 0)))) {
+ break
+ }
+ }
+
+ // Scan for a consonent
+ for i++; i < nStem; i++ {
+ if libc.AssignInt32(&bCons, libc.BoolInt32(!(fts5PorterIsVowel(tls, *(*int8)(unsafe.Pointer(zStem + uintptr(i))), bCons) != 0))) != 0 {
+ return (i + 1)
+ }
+ }
+ return 0
+}
+
+// porter rule condition: (m > 0)
+func fts5Porter_MGt0(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227682:12: */
+ return libc.BoolInt32(!(!(fts5PorterGobbleVC(tls, zStem, nStem, 0) != 0)))
+}
+
+// porter rule condition: (m > 1)
+func fts5Porter_MGt1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227687:12: */
+ var n int32
+ n = fts5PorterGobbleVC(tls, zStem, nStem, 0)
+ if (n != 0) && (fts5PorterGobbleVC(tls, (zStem+uintptr(n)), (nStem-n), 1) != 0) {
+ return 1
+ }
+ return 0
+}
+
+// porter rule condition: (m = 1)
+func fts5Porter_MEq1(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227697:12: */
+ var n int32
+ n = fts5PorterGobbleVC(tls, zStem, nStem, 0)
+ if (n != 0) && (0 == fts5PorterGobbleVC(tls, (zStem+uintptr(n)), (nStem-n), 1)) {
+ return 1
+ }
+ return 0
+}
+
+// porter rule condition: (*o)
+func fts5Porter_Ostar(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227707:12: */
+ if ((int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 'w') || (int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 'x')) || (int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 'y') {
+ return 0
+ } else {
+ var i int32
+ var mask int32 = 0
+ var bCons int32 = 0
+ for i = 0; i < nStem; i++ {
+ bCons = libc.BoolInt32(!(fts5PorterIsVowel(tls, *(*int8)(unsafe.Pointer(zStem + uintptr(i))), bCons) != 0))
+
+ mask = ((mask << 1) + bCons)
+ }
+ return (libc.Bool32((mask & 0x0007) == 0x0005))
+ }
+ return int32(0)
+}
+
+// porter rule condition: (m > 1 and (*S or *T))
+func fts5Porter_MGt1_and_S_or_T(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227724:12: */
+
+ return (libc.Bool32(((int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 's') || (int32(*(*int8)(unsafe.Pointer(zStem + uintptr((nStem - 1))))) == 't')) &&
+ (fts5Porter_MGt1(tls, zStem, nStem) != 0)))
+}
+
+// porter rule condition: (*v*)
+func fts5Porter_Vowel(tls *libc.TLS, zStem uintptr, nStem int32) int32 { /* sqlite3.c:227731:12: */
+ var i int32
+ for i = 0; i < nStem; i++ {
+ if fts5PorterIsVowel(tls, *(*int8)(unsafe.Pointer(zStem + uintptr(i))), (libc.Bool32(i > 0))) != 0 {
+ return 1
+ }
+ }
+ return 0
+}
+
+// *************************************************************************
+//
+//
+// GENERATED CODE STARTS HERE (mkportersteps.tcl)
+
+func fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:227747:12: */
+ var ret int32 = 0
+ var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
+ switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) {
+
+ case 'a':
+ if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40208 /* "al" */, (aBuf+uintptr((nBuf-2))), uint64(2))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2)
+ }
+ }
+ break
+
+ case 'c':
+ if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40211 /* "ance" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4)
+ }
+ } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40216 /* "ence" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4)
+ }
+ }
+ break
+
+ case 'e':
+ if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40221 /* "er" */, (aBuf+uintptr((nBuf-2))), uint64(2))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2)
+ }
+ }
+ break
+
+ case 'i':
+ if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40224 /* "ic" */, (aBuf+uintptr((nBuf-2))), uint64(2))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2)
+ }
+ }
+ break
+
+ case 'l':
+ if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40227 /* "able" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4)
+ }
+ } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40232 /* "ible" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4)
+ }
+ }
+ break
+
+ case 'n':
+ if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40237 /* "ant" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ }
+ } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40241 /* "ement" */, (aBuf+uintptr((nBuf-5))), uint64(5))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-5)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 5)
+ }
+ } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40247 /* "ment" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-4)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4)
+ }
+ } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40252 /* "ent" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ }
+ }
+ break
+
+ case 'o':
+ if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40256 /* "ion" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt1_and_S_or_T(tls, aBuf, (nBuf-3)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ }
+ } else if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40260 /* "ou" */, (aBuf+uintptr((nBuf-2))), uint64(2))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-2)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2)
+ }
+ }
+ break
+
+ case 's':
+ if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40263 /* "ism" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ }
+ }
+ break
+
+ case 't':
+ if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40267 /* "ate" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ }
+ } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40271 /* "iti" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ }
+ }
+ break
+
+ case 'u':
+ if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40275 /* "ous" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ }
+ }
+ break
+
+ case 'v':
+ if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40279 /* "ive" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ }
+ }
+ break
+
+ case 'z':
+ if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40283 /* "ize" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt1(tls, aBuf, (nBuf-3)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ }
+ }
+ break
+ }
+ return ret
+}
+
+func fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:227881:12: */
+ var ret int32 = 0
+ var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
+ switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) {
+
+ case 'a':
+ if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40287 /* "at" */, (aBuf+uintptr((nBuf-2))), uint64(2))) {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+40267 /* "ate" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 2) + 3)
+ ret = 1
+ }
+ break
+
+ case 'b':
+ if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40290 /* "bl" */, (aBuf+uintptr((nBuf-2))), uint64(2))) {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+40293 /* "ble" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 2) + 3)
+ ret = 1
+ }
+ break
+
+ case 'i':
+ if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40297 /* "iz" */, (aBuf+uintptr((nBuf-2))), uint64(2))) {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 2))), ts+40283 /* "ize" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 2) + 3)
+ ret = 1
+ }
+ break
+ }
+ return ret
+}
+
+func fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:227915:12: */
+ var ret int32 = 0
+ var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
+ switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) {
+
+ case 'a':
+ if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40300 /* "ational" */, (aBuf+uintptr((nBuf-7))), uint64(7))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40267 /* "ate" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3)
+ }
+ } else if (nBuf > 6) && (0 == libc.Xmemcmp(tls, ts+40308 /* "tional" */, (aBuf+uintptr((nBuf-6))), uint64(6))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-6)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 6))), ts+40315 /* "tion" */, uint64(4))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 6) + 4)
+ }
+ }
+ break
+
+ case 'c':
+ if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40320 /* "enci" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40216 /* "ence" */, uint64(4))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 4)
+ }
+ } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40325 /* "anci" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40211 /* "ance" */, uint64(4))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 4)
+ }
+ }
+ break
+
+ case 'e':
+ if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40330 /* "izer" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40283 /* "ize" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 3)
+ }
+ }
+ break
+
+ case 'g':
+ if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40335 /* "logi" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+17287 /* "log" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 3)
+ }
+ }
+ break
+
+ case 'l':
+ if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40340 /* "bli" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+40293 /* "ble" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 3) + 3)
+ }
+ } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40344 /* "alli" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40208 /* "al" */, uint64(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 2)
+ }
+ } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40349 /* "entli" */, (aBuf+uintptr((nBuf-5))), uint64(5))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40252 /* "ent" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3)
+ }
+ } else if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40355 /* "eli" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+40359 /* "e" */, uint64(1))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 3) + 1)
+ }
+ } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40361 /* "ousli" */, (aBuf+uintptr((nBuf-5))), uint64(5))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40275 /* "ous" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3)
+ }
+ }
+ break
+
+ case 'o':
+ if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40367 /* "ization" */, (aBuf+uintptr((nBuf-7))), uint64(7))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40283 /* "ize" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3)
+ }
+ } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40375 /* "ation" */, (aBuf+uintptr((nBuf-5))), uint64(5))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40267 /* "ate" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3)
+ }
+ } else if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40381 /* "ator" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40267 /* "ate" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 3)
+ }
+ }
+ break
+
+ case 's':
+ if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40386 /* "alism" */, (aBuf+uintptr((nBuf-5))), uint64(5))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40208 /* "al" */, uint64(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2)
+ }
+ } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40392 /* "iveness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40279 /* "ive" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3)
+ }
+ } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40400 /* "fulness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40408 /* "ful" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3)
+ }
+ } else if (nBuf > 7) && (0 == libc.Xmemcmp(tls, ts+40412 /* "ousness" */, (aBuf+uintptr((nBuf-7))), uint64(7))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-7)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 7))), ts+40275 /* "ous" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 7) + 3)
+ }
+ }
+ break
+
+ case 't':
+ if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40420 /* "aliti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40208 /* "al" */, uint64(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2)
+ }
+ } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40426 /* "iviti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40279 /* "ive" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 3)
+ }
+ } else if (nBuf > 6) && (0 == libc.Xmemcmp(tls, ts+40432 /* "biliti" */, (aBuf+uintptr((nBuf-6))), uint64(6))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-6)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 6))), ts+40293 /* "ble" */, uint64(3))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 6) + 3)
+ }
+ }
+ break
+ }
+ return ret
+}
+
+func fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:228062:12: */
+ var ret int32 = 0
+ var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
+ switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) {
+
+ case 'a':
+ if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40439 /* "ical" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 4))), ts+40224 /* "ic" */, uint64(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 4) + 2)
+ }
+ }
+ break
+
+ case 's':
+ if (nBuf > 4) && (0 == libc.Xmemcmp(tls, ts+40444 /* "ness" */, (aBuf+uintptr((nBuf-4))), uint64(4))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-4)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 4)
+ }
+ }
+ break
+
+ case 't':
+ if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40449 /* "icate" */, (aBuf+uintptr((nBuf-5))), uint64(5))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40224 /* "ic" */, uint64(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2)
+ }
+ } else if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40455 /* "iciti" */, (aBuf+uintptr((nBuf-5))), uint64(5))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40224 /* "ic" */, uint64(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2)
+ }
+ }
+ break
+
+ case 'u':
+ if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40408 /* "ful" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ }
+ }
+ break
+
+ case 'v':
+ if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40461 /* "ative" */, (aBuf+uintptr((nBuf-5))), uint64(5))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 5)
+ }
+ }
+ break
+
+ case 'z':
+ if (nBuf > 5) && (0 == libc.Xmemcmp(tls, ts+40467 /* "alize" */, (aBuf+uintptr((nBuf-5))), uint64(5))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-5)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 5))), ts+40208 /* "al" */, uint64(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 5) + 2)
+ }
+ }
+ break
+ }
+ return ret
+}
+
+func fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) int32 { /* sqlite3.c:228128:12: */
+ var ret int32 = 0
+ var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
+ switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) {
+
+ case 'e':
+ if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40473 /* "eed" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_MGt0(tls, aBuf, (nBuf-3)) != 0 {
+ libc.Xmemcpy(tls, (aBuf + uintptr((nBuf - 3))), ts+40477 /* "ee" */, uint64(2))
+ *(*int32)(unsafe.Pointer(pnBuf)) = ((nBuf - 3) + 2)
+ }
+ } else if (nBuf > 2) && (0 == libc.Xmemcmp(tls, ts+40480 /* "ed" */, (aBuf+uintptr((nBuf-2))), uint64(2))) {
+ if fts5Porter_Vowel(tls, aBuf, (nBuf-2)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2)
+ ret = 1
+ }
+ }
+ break
+
+ case 'n':
+ if (nBuf > 3) && (0 == libc.Xmemcmp(tls, ts+40483 /* "ing" */, (aBuf+uintptr((nBuf-3))), uint64(3))) {
+ if fts5Porter_Vowel(tls, aBuf, (nBuf-3)) != 0 {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 3)
+ ret = 1
+ }
+ }
+ break
+ }
+ return ret
+}
+
+//
+// GENERATED CODE ENDS HERE (mkportersteps.tcl)
+//
+//
+
+func fts5PorterStep1A(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) { /* sqlite3.c:228165:13: */
+ var nBuf int32 = *(*int32)(unsafe.Pointer(pnBuf))
+ if int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 1))))) == 's' {
+ if int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) == 'e' {
+ if (((nBuf > 4) && (int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 4))))) == 's')) && (int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 3))))) == 's')) ||
+ ((nBuf > 3) && (int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 3))))) == 'i')) {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 2)
+ } else {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 1)
+ }
+ } else if int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((nBuf - 2))))) != 's' {
+ *(*int32)(unsafe.Pointer(pnBuf)) = (nBuf - 1)
+ }
+ }
+}
+
+func fts5PorterCb(tls *libc.TLS, pCtx uintptr, tflags int32, pToken uintptr, nToken int32, iStart int32, iEnd int32) int32 { /* sqlite3.c:228183:12: */
+ bp := tls.Alloc(4)
+ defer tls.Free(4)
+
+ var p uintptr
+ var aBuf uintptr
+ // var nBuf int32 at bp, 4
+
+ var c int8
+ p = pCtx
+
+ if !((nToken > 64) || (nToken < 3)) {
+ goto __1
+ }
+ goto pass_through
+__1:
+ ;
+ aBuf = (*PorterContext)(unsafe.Pointer(p)).FaBuf
+ *(*int32)(unsafe.Pointer(bp /* nBuf */)) = nToken
+ libc.Xmemcpy(tls, aBuf, pToken, uint64(*(*int32)(unsafe.Pointer(bp /* nBuf */))))
+
+ // Step 1.
+ fts5PorterStep1A(tls, aBuf, bp /* &nBuf */)
+ if !(fts5PorterStep1B(tls, aBuf, bp /* &nBuf */) != 0) {
+ goto __2
+ }
+ if !(fts5PorterStep1B2(tls, aBuf, bp /* &nBuf */) == 0) {
+ goto __3
+ }
+ c = *(*int8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 1))))
+ if !(((((fts5PorterIsVowel(tls, c, 0) == 0) &&
+ (int32(c) != 'l')) && (int32(c) != 's')) && (int32(c) != 'z')) && (int32(c) == int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 2))))))) {
+ goto __4
+ }
+ *(*int32)(unsafe.Pointer(bp /* nBuf */))--
+ goto __5
+__4:
+ if !((fts5Porter_MEq1(tls, aBuf, *(*int32)(unsafe.Pointer(bp /* nBuf */))) != 0) && (fts5Porter_Ostar(tls, aBuf, *(*int32)(unsafe.Pointer(bp /* nBuf */))) != 0)) {
+ goto __6
+ }
+ *(*int8)(unsafe.Pointer(aBuf + uintptr(libc.PostIncInt32(&*(*int32)(unsafe.Pointer(bp /* nBuf */)), 1)))) = int8('e')
+__6:
+ ;
+__5:
+ ;
+__3:
+ ;
+__2:
+ ;
+
+ // Step 1C.
+ if !((int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 1))))) == 'y') && (fts5Porter_Vowel(tls, aBuf, (*(*int32)(unsafe.Pointer(bp /* nBuf */))-1)) != 0)) {
+ goto __7
+ }
+ *(*int8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 1)))) = int8('i')
+__7:
+ ;
+
+ // Steps 2 through 4.
+ fts5PorterStep2(tls, aBuf, bp /* &nBuf */)
+ fts5PorterStep3(tls, aBuf, bp /* &nBuf */)
+ fts5PorterStep4(tls, aBuf, bp /* &nBuf */)
+
+ // Step 5a.
+
+ if !(int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 1))))) == 'e') {
+ goto __8
+ }
+ if !((fts5Porter_MGt1(tls, aBuf, (*(*int32)(unsafe.Pointer(bp /* nBuf */))-1)) != 0) ||
+ ((fts5Porter_MEq1(tls, aBuf, (*(*int32)(unsafe.Pointer(bp /* nBuf */))-1)) != 0) && !(fts5Porter_Ostar(tls, aBuf, (*(*int32)(unsafe.Pointer(bp /* nBuf */))-1)) != 0))) {
+ goto __9
+ }
+ *(*int32)(unsafe.Pointer(bp /* nBuf */))--
+__9:
+ ;
+__8:
+ ;
+
+ // Step 5b.
+ if !((((*(*int32)(unsafe.Pointer(bp /* nBuf */)) > 1) && (int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 1))))) == 'l')) &&
+ (int32(*(*int8)(unsafe.Pointer(aBuf + uintptr((*(*int32)(unsafe.Pointer(bp /* nBuf */)) - 2))))) == 'l')) && (fts5Porter_MGt1(tls, aBuf, (*(*int32)(unsafe.Pointer(bp /* nBuf */))-1)) != 0)) {
+ goto __10
+ }
+ *(*int32)(unsafe.Pointer(bp /* nBuf */))--
+__10:
+ ;
+
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer((p + 8 /* &.xToken */))))(tls, (*PorterContext)(unsafe.Pointer(p)).FpCtx, tflags, aBuf, *(*int32)(unsafe.Pointer(bp /* nBuf */)), iStart, iEnd)
+
+pass_through:
+ return (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer((p + 8 /* &.xToken */))))(tls, (*PorterContext)(unsafe.Pointer(p)).FpCtx, tflags, pToken, nToken, iStart, iEnd)
+}
+
+// Tokenize using the porter tokenizer.
+func fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, xToken uintptr) int32 { /* sqlite3.c:228252:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var p uintptr = pTokenizer
+ // var sCtx PorterContext at bp, 24
+
+ (*PorterContext)(unsafe.Pointer(bp /* &sCtx */)).FxToken = xToken
+ (*PorterContext)(unsafe.Pointer(bp /* &sCtx */)).FpCtx = pCtx
+ (*PorterContext)(unsafe.Pointer(bp /* &sCtx */)).FaBuf = p + 32 /* &.aBuf */
+ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer((p /* &.tokenizer */ + 16 /* &.xTokenize */))))(tls,
+ (*PorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp /* &sCtx */, flags, pText, nText, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32
+ }{fts5PorterCb})))
+}
+
+// Register all built-in tokenizers with FTS5.
+func sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) int32 { /* sqlite3.c:228272:12: */
+ bp := tls.Alloc(96)
+ defer tls.Free(96)
+
+ *(*[3]BuiltinTokenizer)(unsafe.Pointer(bp /* aBuiltin */)) = [3]BuiltinTokenizer{
+ {FzName: ts + 40198 /* "unicode61" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{fts5UnicodeCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5UnicodeDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
+ }{fts5UnicodeTokenize}))}},
+ {FzName: ts + 40487 /* "ascii" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{fts5AsciiCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5AsciiDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
+ }{fts5AsciiTokenize}))}},
+ {FzName: ts + 40493 /* "porter" */, Fx: Fts5_tokenizer{FxCreate: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32
+ }{fts5PorterCreate})), FxDelete: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{fts5PorterDelete})), FxTokenize: *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32
+ }{fts5PorterTokenize}))}},
+ }
+
+ var rc int32 = 0 // Return code
+ var i int32 // To iterate through builtin functions
+
+ for i = 0; (rc == 0) && (i < (int32(uint64(unsafe.Sizeof([3]BuiltinTokenizer{})) / uint64(unsafe.Sizeof(BuiltinTokenizer{}))))); i++ {
+ rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer((pApi + 8 /* &.xCreateTokenizer */))))(tls, pApi,
+ (*BuiltinTokenizer)(unsafe.Pointer(bp /* &aBuiltin */ +uintptr(i)*32)).FzName,
+ pApi,
+ (bp /* &aBuiltin */ + uintptr(i)*32 + 8 /* &.x */),
+ uintptr(0))
+ }
+
+ return rc
+}
+
+type BuiltinTokenizer = struct {
+ FzName uintptr
+ Fx Fts5_tokenizer
+}
+
+// 2012-05-25
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+
+// DO NOT EDIT THIS MACHINE GENERATED FILE.
+
+// #include <assert.h>
+
+// If the argument is a codepoint corresponding to a lowercase letter
+// in the ASCII range with a diacritic added, return the codepoint
+// of the ASCII letter only. For example, if passed 235 - "LATIN
+// SMALL LETTER E WITH DIAERESIS" - return 65 ("LATIN SMALL LETTER
+// E"). The resuls of passing a codepoint that corresponds to an
+// uppercase letter are undefined.
+func fts5_remove_diacritic(tls *libc.TLS, c int32, bComplex int32) int32 { /* sqlite3.c:228327:12: */
+ bp := tls.Alloc(378)
+ defer tls.Free(378)
+
+ *(*[126]uint16)(unsafe.Pointer(bp /* aDia */)) = [126]uint16{
+ uint16(0), uint16(1797), uint16(1848), uint16(1859), uint16(1891), uint16(1928), uint16(1940), uint16(1995),
+ uint16(2024), uint16(2040), uint16(2060), uint16(2110), uint16(2168), uint16(2206), uint16(2264), uint16(2286),
+ uint16(2344), uint16(2383), uint16(2472), uint16(2488), uint16(2516), uint16(2596), uint16(2668), uint16(2732),
+ uint16(2782), uint16(2842), uint16(2894), uint16(2954), uint16(2984), uint16(3000), uint16(3028), uint16(3336),
+ uint16(3456), uint16(3696), uint16(3712), uint16(3728), uint16(3744), uint16(3766), uint16(3832), uint16(3896),
+ uint16(3912), uint16(3928), uint16(3944), uint16(3968), uint16(4008), uint16(4040), uint16(4056), uint16(4106),
+ uint16(4138), uint16(4170), uint16(4202), uint16(4234), uint16(4266), uint16(4296), uint16(4312), uint16(4344),
+ uint16(4408), uint16(4424), uint16(4442), uint16(4472), uint16(4488), uint16(4504), uint16(6148), uint16(6198),
+ uint16(6264), uint16(6280), uint16(6360), uint16(6429), uint16(6505), uint16(6529), uint16(61448), uint16(61468),
+ uint16(61512), uint16(61534), uint16(61592), uint16(61610), uint16(61642), uint16(61672), uint16(61688), uint16(61704),
+ uint16(61726), uint16(61784), uint16(61800), uint16(61816), uint16(61836), uint16(61880), uint16(61896), uint16(61914),
+ uint16(61948), uint16(61998), uint16(62062), uint16(62122), uint16(62154), uint16(62184), uint16(62200), uint16(62218),
+ uint16(62252), uint16(62302), uint16(62364), uint16(62410), uint16(62442), uint16(62478), uint16(62536), uint16(62554),
+ uint16(62584), uint16(62604), uint16(62640), uint16(62648), uint16(62656), uint16(62664), uint16(62730), uint16(62766),
+ uint16(62830), uint16(62890), uint16(62924), uint16(62974), uint16(63032), uint16(63050), uint16(63082), uint16(63118),
+ uint16(63182), uint16(63242), uint16(63274), uint16(63310), uint16(63368), uint16(63390),
+ }
+ *(*[126]uint8)(unsafe.Pointer(bp + 252 /* aChar */)) = [126]uint8{
+ uint8(0), uint8('a'), uint8('c'), uint8('e'), uint8('i'), uint8('n'),
+ uint8('o'), uint8('u'), uint8('y'), uint8('y'), uint8('a'), uint8('c'),
+ uint8('d'), uint8('e'), uint8('e'), uint8('g'), uint8('h'), uint8('i'),
+ uint8('j'), uint8('k'), uint8('l'), uint8('n'), uint8('o'), uint8('r'),
+ uint8('s'), uint8('t'), uint8('u'), uint8('u'), uint8('w'), uint8('y'),
+ uint8('z'), uint8('o'), uint8('u'), uint8('a'), uint8('i'), uint8('o'),
+ uint8('u'), (uint8('u' | (int32(uint8(0x80))))), (uint8('a' | (int32(uint8(0x80))))), uint8('g'), uint8('k'), uint8('o'),
+ (uint8('o' | (int32(uint8(0x80))))), uint8('j'), uint8('g'), uint8('n'), (uint8('a' | (int32(uint8(0x80))))), uint8('a'),
+ uint8('e'), uint8('i'), uint8('o'), uint8('r'), uint8('u'), uint8('s'),
+ uint8('t'), uint8('h'), uint8('a'), uint8('e'), (uint8('o' | (int32(uint8(0x80))))), uint8('o'),
+ (uint8('o' | (int32(uint8(0x80))))), uint8('y'), uint8(0), uint8(0), uint8(0), uint8(0),
+ uint8(0), uint8(0), uint8(0), uint8(0), uint8('a'), uint8('b'),
+ (uint8('c' | (int32(uint8(0x80))))), uint8('d'), uint8('d'), (uint8('e' | (int32(uint8(0x80))))), uint8('e'), (uint8('e' | (int32(uint8(0x80))))),
+ uint8('f'), uint8('g'), uint8('h'), uint8('h'), uint8('i'), (uint8('i' | (int32(uint8(0x80))))),
+ uint8('k'), uint8('l'), (uint8('l' | (int32(uint8(0x80))))), uint8('l'), uint8('m'), uint8('n'),
+ (uint8('o' | (int32(uint8(0x80))))), uint8('p'), uint8('r'), (uint8('r' | (int32(uint8(0x80))))), uint8('r'), uint8('s'),
+ (uint8('s' | (int32(uint8(0x80))))), uint8('t'), uint8('u'), (uint8('u' | (int32(uint8(0x80))))), uint8('v'), uint8('w'),
+ uint8('w'), uint8('x'), uint8('y'), uint8('z'), uint8('h'), uint8('t'),
+ uint8('w'), uint8('y'), uint8('a'), (uint8('a' | (int32(uint8(0x80))))), (uint8('a' | (int32(uint8(0x80))))), (uint8('a' | (int32(uint8(0x80))))),
+ uint8('e'), (uint8('e' | (int32(uint8(0x80))))), (uint8('e' | (int32(uint8(0x80))))), uint8('i'), uint8('o'), (uint8('o' | (int32(uint8(0x80))))),
+ (uint8('o' | (int32(uint8(0x80))))), (uint8('o' | (int32(uint8(0x80))))), uint8('u'), (uint8('u' | (int32(uint8(0x80))))), (uint8('u' | (int32(uint8(0x80))))), uint8('y'),
+ }
+
+ var key uint32 = (((uint32(c)) << 3) | uint32(0x00000007))
+ var iRes int32 = 0
+ var iHi int32 = (int32((uint64(unsafe.Sizeof([126]uint16{})) / uint64(unsafe.Sizeof(uint16(0)))) - uint64(1)))
+ var iLo int32 = 0
+ for iHi >= iLo {
+ var iTest int32 = ((iHi + iLo) / 2)
+ if key >= uint32(*(*uint16)(unsafe.Pointer(bp /* &aDia[0] */ + uintptr(iTest)*2))) {
+ iRes = iTest
+ iLo = (iTest + 1)
+ } else {
+ iHi = (iTest - 1)
+ }
+ }
+
+ if (bComplex == 0) && ((int32(*(*uint8)(unsafe.Pointer(bp + 252 /* &aChar[0] */ + uintptr(iRes)))) & 0x80) != 0) {
+ return c
+ }
+ if c > ((int32(*(*uint16)(unsafe.Pointer(bp /* &aDia[0] */ + uintptr(iRes)*2))) >> 3) + (int32(*(*uint16)(unsafe.Pointer(bp /* &aDia[0] */ + uintptr(iRes)*2))) & 0x07)) {
+ return c
+ }
+ return (int32(*(*uint8)(unsafe.Pointer(bp + 252 /* &aChar[0] */ + uintptr(iRes)))) & 0x7F)
+}
+
+// Return true if the argument interpreted as a unicode codepoint
+// is a diacritical modifier character.
+func sqlite3Fts5UnicodeIsdiacritic(tls *libc.TLS, c int32) int32 { /* sqlite3.c:228394:12: */
+ var mask0 uint32 = uint32(0x08029FDF)
+ var mask1 uint32 = uint32(0x000361F8)
+ if (c < 768) || (c > 817) {
+ return 0
+ }
+ if c < (768 + 32) {
+ return (int32(mask0 & (uint32(uint32(1)) << (c - 768))))
+ }
+ return (int32(mask1 & (uint32(uint32(1)) << ((c - 768) - 32))))
+}
+
+// Interpret the argument as a unicode codepoint. If the codepoint
+// is an upper case character that has a lower case equivalent,
+// return the codepoint corresponding to the lower case version.
+// Otherwise, return a copy of the argument.
+//
+// The results are undefined if the value passed to this function
+// is less than zero.
+func sqlite3Fts5UnicodeFold(tls *libc.TLS, c int32, eRemoveDiacritic int32) int32 { /* sqlite3.c:228413:12: */
+
+ var ret int32 = c
+
+ if c < 128 {
+ if (c >= 'A') && (c <= 'Z') {
+ ret = (c + ('a' - 'A'))
+ }
+ } else if c < 65536 {
+ var p uintptr
+ var iHi int32 = (int32((uint64(unsafe.Sizeof(aEntry)) / uint64(unsafe.Sizeof(TableEntry{}))) - uint64(1)))
+ var iLo int32 = 0
+ var iRes int32 = -1
+
+ for iHi >= iLo {
+ var iTest int32 = ((iHi + iLo) / 2)
+ var cmp int32 = (c - int32(aEntry[iTest].FiCode))
+ if cmp >= 0 {
+ iRes = iTest
+ iLo = (iTest + 1)
+ } else {
+ iHi = (iTest - 1)
+ }
+ }
+
+ p = (uintptr(unsafe.Pointer(&aEntry)) + uintptr(iRes)*4)
+ if (c < (int32((*TableEntry)(unsafe.Pointer(p)).FiCode) + int32((*TableEntry)(unsafe.Pointer(p)).FnRange))) && (0 == ((0x01 & int32((*TableEntry)(unsafe.Pointer(p)).Fflags)) & (int32((*TableEntry)(unsafe.Pointer(p)).FiCode) ^ c))) {
+ ret = ((c + (int32(aiOff[(int32((*TableEntry)(unsafe.Pointer(p)).Fflags) >> 1)]))) & 0x0000FFFF)
+ }
+
+ if eRemoveDiacritic != 0 {
+ ret = fts5_remove_diacritic(tls, ret, (libc.Bool32(eRemoveDiacritic == 2)))
+ }
+ } else if (c >= 66560) && (c < 66600) {
+ ret = (c + 40)
+ }
+
+ return ret
+}
+
+// Each entry in the following array defines a rule for folding a range
+// of codepoints to lower case. The rule applies to a range of nRange
+// codepoints starting at codepoint iCode.
+//
+// If the least significant bit in flags is clear, then the rule applies
+// to all nRange codepoints (i.e. all nRange codepoints are upper case and
+// need to be folded). Or, if it is set, then the rule only applies to
+// every second codepoint in the range, starting with codepoint C.
+//
+// The 7 most significant bits in flags are an index into the aiOff[]
+// array. If a specific codepoint C does require folding, then its lower
+// case equivalent is ((C + aiOff[flags>>1]) & 0xFFFF).
+//
+// The contents of this array are generated by parsing the CaseFolding.txt
+// file distributed as part of the "Unicode Character Database". See
+// http://www.unicode.org for details.
+type TableEntry = struct {
+ FiCode uint16
+ Fflags uint8
+ FnRange uint8
+}
+
+var aEntry = [163]TableEntry{
+ {FiCode: uint16(65), Fflags: uint8(14), FnRange: uint8(26)}, {FiCode: uint16(181), Fflags: uint8(64), FnRange: uint8(1)}, {FiCode: uint16(192), Fflags: uint8(14), FnRange: uint8(23)},
+ {FiCode: uint16(216), Fflags: uint8(14), FnRange: uint8(7)}, {FiCode: uint16(256), Fflags: uint8(1), FnRange: uint8(48)}, {FiCode: uint16(306), Fflags: uint8(1), FnRange: uint8(6)},
+ {FiCode: uint16(313), Fflags: uint8(1), FnRange: uint8(16)}, {FiCode: uint16(330), Fflags: uint8(1), FnRange: uint8(46)}, {FiCode: uint16(376), Fflags: uint8(116), FnRange: uint8(1)},
+ {FiCode: uint16(377), Fflags: uint8(1), FnRange: uint8(6)}, {FiCode: uint16(383), Fflags: uint8(104), FnRange: uint8(1)}, {FiCode: uint16(385), Fflags: uint8(50), FnRange: uint8(1)},
+ {FiCode: uint16(386), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(390), Fflags: uint8(44), FnRange: uint8(1)}, {FiCode: uint16(391), Fflags: uint8(0), FnRange: uint8(1)},
+ {FiCode: uint16(393), Fflags: uint8(42), FnRange: uint8(2)}, {FiCode: uint16(395), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(398), Fflags: uint8(32), FnRange: uint8(1)},
+ {FiCode: uint16(399), Fflags: uint8(38), FnRange: uint8(1)}, {FiCode: uint16(400), Fflags: uint8(40), FnRange: uint8(1)}, {FiCode: uint16(401), Fflags: uint8(0), FnRange: uint8(1)},
+ {FiCode: uint16(403), Fflags: uint8(42), FnRange: uint8(1)}, {FiCode: uint16(404), Fflags: uint8(46), FnRange: uint8(1)}, {FiCode: uint16(406), Fflags: uint8(52), FnRange: uint8(1)},
+ {FiCode: uint16(407), Fflags: uint8(48), FnRange: uint8(1)}, {FiCode: uint16(408), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(412), Fflags: uint8(52), FnRange: uint8(1)},
+ {FiCode: uint16(413), Fflags: uint8(54), FnRange: uint8(1)}, {FiCode: uint16(415), Fflags: uint8(56), FnRange: uint8(1)}, {FiCode: uint16(416), Fflags: uint8(1), FnRange: uint8(6)},
+ {FiCode: uint16(422), Fflags: uint8(60), FnRange: uint8(1)}, {FiCode: uint16(423), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(425), Fflags: uint8(60), FnRange: uint8(1)},
+ {FiCode: uint16(428), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(430), Fflags: uint8(60), FnRange: uint8(1)}, {FiCode: uint16(431), Fflags: uint8(0), FnRange: uint8(1)},
+ {FiCode: uint16(433), Fflags: uint8(58), FnRange: uint8(2)}, {FiCode: uint16(435), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(439), Fflags: uint8(62), FnRange: uint8(1)},
+ {FiCode: uint16(440), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(444), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(452), Fflags: uint8(2), FnRange: uint8(1)},
+ {FiCode: uint16(453), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(455), Fflags: uint8(2), FnRange: uint8(1)}, {FiCode: uint16(456), Fflags: uint8(0), FnRange: uint8(1)},
+ {FiCode: uint16(458), Fflags: uint8(2), FnRange: uint8(1)}, {FiCode: uint16(459), Fflags: uint8(1), FnRange: uint8(18)}, {FiCode: uint16(478), Fflags: uint8(1), FnRange: uint8(18)},
+ {FiCode: uint16(497), Fflags: uint8(2), FnRange: uint8(1)}, {FiCode: uint16(498), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(502), Fflags: uint8(122), FnRange: uint8(1)},
+ {FiCode: uint16(503), Fflags: uint8(134), FnRange: uint8(1)}, {FiCode: uint16(504), Fflags: uint8(1), FnRange: uint8(40)}, {FiCode: uint16(544), Fflags: uint8(110), FnRange: uint8(1)},
+ {FiCode: uint16(546), Fflags: uint8(1), FnRange: uint8(18)}, {FiCode: uint16(570), Fflags: uint8(70), FnRange: uint8(1)}, {FiCode: uint16(571), Fflags: uint8(0), FnRange: uint8(1)},
+ {FiCode: uint16(573), Fflags: uint8(108), FnRange: uint8(1)}, {FiCode: uint16(574), Fflags: uint8(68), FnRange: uint8(1)}, {FiCode: uint16(577), Fflags: uint8(0), FnRange: uint8(1)},
+ {FiCode: uint16(579), Fflags: uint8(106), FnRange: uint8(1)}, {FiCode: uint16(580), Fflags: uint8(28), FnRange: uint8(1)}, {FiCode: uint16(581), Fflags: uint8(30), FnRange: uint8(1)},
+ {FiCode: uint16(582), Fflags: uint8(1), FnRange: uint8(10)}, {FiCode: uint16(837), Fflags: uint8(36), FnRange: uint8(1)}, {FiCode: uint16(880), Fflags: uint8(1), FnRange: uint8(4)},
+ {FiCode: uint16(886), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(902), Fflags: uint8(18), FnRange: uint8(1)}, {FiCode: uint16(904), Fflags: uint8(16), FnRange: uint8(3)},
+ {FiCode: uint16(908), Fflags: uint8(26), FnRange: uint8(1)}, {FiCode: uint16(910), Fflags: uint8(24), FnRange: uint8(2)}, {FiCode: uint16(913), Fflags: uint8(14), FnRange: uint8(17)},
+ {FiCode: uint16(931), Fflags: uint8(14), FnRange: uint8(9)}, {FiCode: uint16(962), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(975), Fflags: uint8(4), FnRange: uint8(1)},
+ {FiCode: uint16(976), Fflags: uint8(140), FnRange: uint8(1)}, {FiCode: uint16(977), Fflags: uint8(142), FnRange: uint8(1)}, {FiCode: uint16(981), Fflags: uint8(146), FnRange: uint8(1)},
+ {FiCode: uint16(982), Fflags: uint8(144), FnRange: uint8(1)}, {FiCode: uint16(984), Fflags: uint8(1), FnRange: uint8(24)}, {FiCode: uint16(1008), Fflags: uint8(136), FnRange: uint8(1)},
+ {FiCode: uint16(1009), Fflags: uint8(138), FnRange: uint8(1)}, {FiCode: uint16(1012), Fflags: uint8(130), FnRange: uint8(1)}, {FiCode: uint16(1013), Fflags: uint8(128), FnRange: uint8(1)},
+ {FiCode: uint16(1015), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(1017), Fflags: uint8(152), FnRange: uint8(1)}, {FiCode: uint16(1018), Fflags: uint8(0), FnRange: uint8(1)},
+ {FiCode: uint16(1021), Fflags: uint8(110), FnRange: uint8(3)}, {FiCode: uint16(1024), Fflags: uint8(34), FnRange: uint8(16)}, {FiCode: uint16(1040), Fflags: uint8(14), FnRange: uint8(32)},
+ {FiCode: uint16(1120), Fflags: uint8(1), FnRange: uint8(34)}, {FiCode: uint16(1162), Fflags: uint8(1), FnRange: uint8(54)}, {FiCode: uint16(1216), Fflags: uint8(6), FnRange: uint8(1)},
+ {FiCode: uint16(1217), Fflags: uint8(1), FnRange: uint8(14)}, {FiCode: uint16(1232), Fflags: uint8(1), FnRange: uint8(88)}, {FiCode: uint16(1329), Fflags: uint8(22), FnRange: uint8(38)},
+ {FiCode: uint16(4256), Fflags: uint8(66), FnRange: uint8(38)}, {FiCode: uint16(4295), Fflags: uint8(66), FnRange: uint8(1)}, {FiCode: uint16(4301), Fflags: uint8(66), FnRange: uint8(1)},
+ {FiCode: uint16(7680), Fflags: uint8(1), FnRange: uint8(150)}, {FiCode: uint16(7835), Fflags: uint8(132), FnRange: uint8(1)}, {FiCode: uint16(7838), Fflags: uint8(96), FnRange: uint8(1)},
+ {FiCode: uint16(7840), Fflags: uint8(1), FnRange: uint8(96)}, {FiCode: uint16(7944), Fflags: uint8(150), FnRange: uint8(8)}, {FiCode: uint16(7960), Fflags: uint8(150), FnRange: uint8(6)},
+ {FiCode: uint16(7976), Fflags: uint8(150), FnRange: uint8(8)}, {FiCode: uint16(7992), Fflags: uint8(150), FnRange: uint8(8)}, {FiCode: uint16(8008), Fflags: uint8(150), FnRange: uint8(6)},
+ {FiCode: uint16(8025), Fflags: uint8(151), FnRange: uint8(8)}, {FiCode: uint16(8040), Fflags: uint8(150), FnRange: uint8(8)}, {FiCode: uint16(8072), Fflags: uint8(150), FnRange: uint8(8)},
+ {FiCode: uint16(8088), Fflags: uint8(150), FnRange: uint8(8)}, {FiCode: uint16(8104), Fflags: uint8(150), FnRange: uint8(8)}, {FiCode: uint16(8120), Fflags: uint8(150), FnRange: uint8(2)},
+ {FiCode: uint16(8122), Fflags: uint8(126), FnRange: uint8(2)}, {FiCode: uint16(8124), Fflags: uint8(148), FnRange: uint8(1)}, {FiCode: uint16(8126), Fflags: uint8(100), FnRange: uint8(1)},
+ {FiCode: uint16(8136), Fflags: uint8(124), FnRange: uint8(4)}, {FiCode: uint16(8140), Fflags: uint8(148), FnRange: uint8(1)}, {FiCode: uint16(8152), Fflags: uint8(150), FnRange: uint8(2)},
+ {FiCode: uint16(8154), Fflags: uint8(120), FnRange: uint8(2)}, {FiCode: uint16(8168), Fflags: uint8(150), FnRange: uint8(2)}, {FiCode: uint16(8170), Fflags: uint8(118), FnRange: uint8(2)},
+ {FiCode: uint16(8172), Fflags: uint8(152), FnRange: uint8(1)}, {FiCode: uint16(8184), Fflags: uint8(112), FnRange: uint8(2)}, {FiCode: uint16(8186), Fflags: uint8(114), FnRange: uint8(2)},
+ {FiCode: uint16(8188), Fflags: uint8(148), FnRange: uint8(1)}, {FiCode: uint16(8486), Fflags: uint8(98), FnRange: uint8(1)}, {FiCode: uint16(8490), Fflags: uint8(92), FnRange: uint8(1)},
+ {FiCode: uint16(8491), Fflags: uint8(94), FnRange: uint8(1)}, {FiCode: uint16(8498), Fflags: uint8(12), FnRange: uint8(1)}, {FiCode: uint16(8544), Fflags: uint8(8), FnRange: uint8(16)},
+ {FiCode: uint16(8579), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(9398), Fflags: uint8(10), FnRange: uint8(26)}, {FiCode: uint16(11264), Fflags: uint8(22), FnRange: uint8(47)},
+ {FiCode: uint16(11360), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(11362), Fflags: uint8(88), FnRange: uint8(1)}, {FiCode: uint16(11363), Fflags: uint8(102), FnRange: uint8(1)},
+ {FiCode: uint16(11364), Fflags: uint8(90), FnRange: uint8(1)}, {FiCode: uint16(11367), Fflags: uint8(1), FnRange: uint8(6)}, {FiCode: uint16(11373), Fflags: uint8(84), FnRange: uint8(1)},
+ {FiCode: uint16(11374), Fflags: uint8(86), FnRange: uint8(1)}, {FiCode: uint16(11375), Fflags: uint8(80), FnRange: uint8(1)}, {FiCode: uint16(11376), Fflags: uint8(82), FnRange: uint8(1)},
+ {FiCode: uint16(11378), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(11381), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(11390), Fflags: uint8(78), FnRange: uint8(2)},
+ {FiCode: uint16(11392), Fflags: uint8(1), FnRange: uint8(100)}, {FiCode: uint16(11499), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(11506), Fflags: uint8(0), FnRange: uint8(1)},
+ {FiCode: uint16(42560), Fflags: uint8(1), FnRange: uint8(46)}, {FiCode: uint16(42624), Fflags: uint8(1), FnRange: uint8(24)}, {FiCode: uint16(42786), Fflags: uint8(1), FnRange: uint8(14)},
+ {FiCode: uint16(42802), Fflags: uint8(1), FnRange: uint8(62)}, {FiCode: uint16(42873), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(42877), Fflags: uint8(76), FnRange: uint8(1)},
+ {FiCode: uint16(42878), Fflags: uint8(1), FnRange: uint8(10)}, {FiCode: uint16(42891), Fflags: uint8(0), FnRange: uint8(1)}, {FiCode: uint16(42893), Fflags: uint8(74), FnRange: uint8(1)},
+ {FiCode: uint16(42896), Fflags: uint8(1), FnRange: uint8(4)}, {FiCode: uint16(42912), Fflags: uint8(1), FnRange: uint8(10)}, {FiCode: uint16(42922), Fflags: uint8(72), FnRange: uint8(1)},
+ {FiCode: uint16(65313), Fflags: uint8(14), FnRange: uint8(26)},
+} /* sqlite3.c:228435:5 */
+var aiOff = [77]uint16{
+ uint16(1), uint16(2), uint16(8), uint16(15), uint16(16), uint16(26), uint16(28), uint16(32),
+ uint16(37), uint16(38), uint16(40), uint16(48), uint16(63), uint16(64), uint16(69), uint16(71),
+ uint16(79), uint16(80), uint16(116), uint16(202), uint16(203), uint16(205), uint16(206), uint16(207),
+ uint16(209), uint16(210), uint16(211), uint16(213), uint16(214), uint16(217), uint16(218), uint16(219),
+ uint16(775), uint16(7264), uint16(10792), uint16(10795), uint16(23228), uint16(23256), uint16(30204), uint16(54721),
+ uint16(54753), uint16(54754), uint16(54756), uint16(54787), uint16(54793), uint16(54809), uint16(57153), uint16(57274),
+ uint16(57921), uint16(58019), uint16(58363), uint16(61722), uint16(65268), uint16(65341), uint16(65373), uint16(65406),
+ uint16(65408), uint16(65410), uint16(65415), uint16(65424), uint16(65436), uint16(65439), uint16(65450), uint16(65462),
+ uint16(65472), uint16(65476), uint16(65478), uint16(65480), uint16(65482), uint16(65488), uint16(65506), uint16(65511),
+ uint16(65514), uint16(65521), uint16(65527), uint16(65528), uint16(65529),
+} /* sqlite3.c:228492:31 */
+
+func sqlite3Fts5UnicodeCatParse(tls *libc.TLS, zCat uintptr, aArray uintptr) int32 { /* sqlite3.c:228549:12: */
+ *(*U8)(unsafe.Pointer(aArray + uintptr(0))) = U8(1)
+ switch int32(*(*int8)(unsafe.Pointer(zCat + uintptr(0)))) {
+ case 'C':
+ switch int32(*(*int8)(unsafe.Pointer(zCat + uintptr(1)))) {
+ case 'c':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(1))) = U8(1)
+ break
+ case 'f':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(2))) = U8(1)
+ break
+ case 'n':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(3))) = U8(1)
+ break
+ case 's':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(4))) = U8(1)
+ break
+ case 'o':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(31))) = U8(1)
+ break
+ case '*':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(1))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(2))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(3))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(4))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(31))) = U8(1)
+ break
+ default:
+ return 1
+ }
+ break
+
+ case 'L':
+ switch int32(*(*int8)(unsafe.Pointer(zCat + uintptr(1)))) {
+ case 'l':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(5))) = U8(1)
+ break
+ case 'm':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(6))) = U8(1)
+ break
+ case 'o':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(7))) = U8(1)
+ break
+ case 't':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(8))) = U8(1)
+ break
+ case 'u':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(9))) = U8(1)
+ break
+ case 'C':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(30))) = U8(1)
+ break
+ case '*':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(5))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(6))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(7))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(8))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(9))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(30))) = U8(1)
+ break
+ default:
+ return 1
+ }
+ break
+
+ case 'M':
+ switch int32(*(*int8)(unsafe.Pointer(zCat + uintptr(1)))) {
+ case 'c':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(10))) = U8(1)
+ break
+ case 'e':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(11))) = U8(1)
+ break
+ case 'n':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(12))) = U8(1)
+ break
+ case '*':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(10))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(11))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(12))) = U8(1)
+ break
+ default:
+ return 1
+ }
+ break
+
+ case 'N':
+ switch int32(*(*int8)(unsafe.Pointer(zCat + uintptr(1)))) {
+ case 'd':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(13))) = U8(1)
+ break
+ case 'l':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(14))) = U8(1)
+ break
+ case 'o':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(15))) = U8(1)
+ break
+ case '*':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(13))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(14))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(15))) = U8(1)
+ break
+ default:
+ return 1
+ }
+ break
+
+ case 'P':
+ switch int32(*(*int8)(unsafe.Pointer(zCat + uintptr(1)))) {
+ case 'c':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(16))) = U8(1)
+ break
+ case 'd':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(17))) = U8(1)
+ break
+ case 'e':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(18))) = U8(1)
+ break
+ case 'f':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(19))) = U8(1)
+ break
+ case 'i':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(20))) = U8(1)
+ break
+ case 'o':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(21))) = U8(1)
+ break
+ case 's':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(22))) = U8(1)
+ break
+ case '*':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(16))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(17))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(18))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(19))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(20))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(21))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(22))) = U8(1)
+ break
+ default:
+ return 1
+ }
+ break
+
+ case 'S':
+ switch int32(*(*int8)(unsafe.Pointer(zCat + uintptr(1)))) {
+ case 'c':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(23))) = U8(1)
+ break
+ case 'k':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(24))) = U8(1)
+ break
+ case 'm':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(25))) = U8(1)
+ break
+ case 'o':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(26))) = U8(1)
+ break
+ case '*':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(23))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(24))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(25))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(26))) = U8(1)
+ break
+ default:
+ return 1
+ }
+ break
+
+ case 'Z':
+ switch int32(*(*int8)(unsafe.Pointer(zCat + uintptr(1)))) {
+ case 'l':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(27))) = U8(1)
+ break
+ case 'p':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(28))) = U8(1)
+ break
+ case 's':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(29))) = U8(1)
+ break
+ case '*':
+ *(*U8)(unsafe.Pointer(aArray + uintptr(27))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(28))) = U8(1)
+ *(*U8)(unsafe.Pointer(aArray + uintptr(29))) = U8(1)
+ break
+ default:
+ return 1
+ }
+ break
+ }
+ return 0
+}
+
+var aFts5UnicodeBlock = [17]U16{
+ U16(0), U16(1471), U16(1753), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1760),
+ U16(1760), U16(1760), U16(1760), U16(1760), U16(1760), U16(1763), U16(1765),
+} /* sqlite3.c:228667:12 */
+var aFts5UnicodeMap = [1765]U16{
+ U16(0), U16(32), U16(33), U16(36), U16(37), U16(40), U16(41), U16(42), U16(43), U16(44),
+ U16(45), U16(46), U16(48), U16(58), U16(60), U16(63), U16(65), U16(91), U16(92), U16(93),
+ U16(94), U16(95), U16(96), U16(97), U16(123), U16(124), U16(125), U16(126), U16(127), U16(160),
+ U16(161), U16(162), U16(166), U16(167), U16(168), U16(169), U16(170), U16(171), U16(172), U16(173),
+ U16(174), U16(175), U16(176), U16(177), U16(178), U16(180), U16(181), U16(182), U16(184), U16(185),
+ U16(186), U16(187), U16(188), U16(191), U16(192), U16(215), U16(216), U16(223), U16(247), U16(248),
+ U16(256), U16(312), U16(313), U16(329), U16(330), U16(377), U16(383), U16(385), U16(387), U16(388),
+ U16(391), U16(394), U16(396), U16(398), U16(402), U16(403), U16(405), U16(406), U16(409), U16(412),
+ U16(414), U16(415), U16(417), U16(418), U16(423), U16(427), U16(428), U16(431), U16(434), U16(436),
+ U16(437), U16(440), U16(442), U16(443), U16(444), U16(446), U16(448), U16(452), U16(453), U16(454),
+ U16(455), U16(456), U16(457), U16(458), U16(459), U16(460), U16(461), U16(477), U16(478), U16(496),
+ U16(497), U16(498), U16(499), U16(500), U16(503), U16(505), U16(506), U16(564), U16(570), U16(572),
+ U16(573), U16(575), U16(577), U16(580), U16(583), U16(584), U16(592), U16(660), U16(661), U16(688),
+ U16(706), U16(710), U16(722), U16(736), U16(741), U16(748), U16(749), U16(750), U16(751), U16(768),
+ U16(880), U16(884), U16(885), U16(886), U16(890), U16(891), U16(894), U16(900), U16(902), U16(903),
+ U16(904), U16(908), U16(910), U16(912), U16(913), U16(931), U16(940), U16(975), U16(977), U16(978),
+ U16(981), U16(984), U16(1008), U16(1012), U16(1014), U16(1015), U16(1018), U16(1020), U16(1021), U16(1072),
+ U16(1120), U16(1154), U16(1155), U16(1160), U16(1162), U16(1217), U16(1231), U16(1232), U16(1329), U16(1369),
+ U16(1370), U16(1377), U16(1417), U16(1418), U16(1423), U16(1425), U16(1470), U16(1471), U16(1472), U16(1473),
+ U16(1475), U16(1476), U16(1478), U16(1479), U16(1488), U16(1520), U16(1523), U16(1536), U16(1542), U16(1545),
+ U16(1547), U16(1548), U16(1550), U16(1552), U16(1563), U16(1566), U16(1568), U16(1600), U16(1601), U16(1611),
+ U16(1632), U16(1642), U16(1646), U16(1648), U16(1649), U16(1748), U16(1749), U16(1750), U16(1757), U16(1758),
+ U16(1759), U16(1765), U16(1767), U16(1769), U16(1770), U16(1774), U16(1776), U16(1786), U16(1789), U16(1791),
+ U16(1792), U16(1807), U16(1808), U16(1809), U16(1810), U16(1840), U16(1869), U16(1958), U16(1969), U16(1984),
+ U16(1994), U16(2027), U16(2036), U16(2038), U16(2039), U16(2042), U16(2048), U16(2070), U16(2074), U16(2075),
+ U16(2084), U16(2085), U16(2088), U16(2089), U16(2096), U16(2112), U16(2137), U16(2142), U16(2208), U16(2210),
+ U16(2276), U16(2304), U16(2307), U16(2308), U16(2362), U16(2363), U16(2364), U16(2365), U16(2366), U16(2369),
+ U16(2377), U16(2381), U16(2382), U16(2384), U16(2385), U16(2392), U16(2402), U16(2404), U16(2406), U16(2416),
+ U16(2417), U16(2418), U16(2425), U16(2433), U16(2434), U16(2437), U16(2447), U16(2451), U16(2474), U16(2482),
+ U16(2486), U16(2492), U16(2493), U16(2494), U16(2497), U16(2503), U16(2507), U16(2509), U16(2510), U16(2519),
+ U16(2524), U16(2527), U16(2530), U16(2534), U16(2544), U16(2546), U16(2548), U16(2554), U16(2555), U16(2561),
+ U16(2563), U16(2565), U16(2575), U16(2579), U16(2602), U16(2610), U16(2613), U16(2616), U16(2620), U16(2622),
+ U16(2625), U16(2631), U16(2635), U16(2641), U16(2649), U16(2654), U16(2662), U16(2672), U16(2674), U16(2677),
+ U16(2689), U16(2691), U16(2693), U16(2703), U16(2707), U16(2730), U16(2738), U16(2741), U16(2748), U16(2749),
+ U16(2750), U16(2753), U16(2759), U16(2761), U16(2763), U16(2765), U16(2768), U16(2784), U16(2786), U16(2790),
+ U16(2800), U16(2801), U16(2817), U16(2818), U16(2821), U16(2831), U16(2835), U16(2858), U16(2866), U16(2869),
+ U16(2876), U16(2877), U16(2878), U16(2879), U16(2880), U16(2881), U16(2887), U16(2891), U16(2893), U16(2902),
+ U16(2903), U16(2908), U16(2911), U16(2914), U16(2918), U16(2928), U16(2929), U16(2930), U16(2946), U16(2947),
+ U16(2949), U16(2958), U16(2962), U16(2969), U16(2972), U16(2974), U16(2979), U16(2984), U16(2990), U16(3006),
+ U16(3008), U16(3009), U16(3014), U16(3018), U16(3021), U16(3024), U16(3031), U16(3046), U16(3056), U16(3059),
+ U16(3065), U16(3066), U16(3073), U16(3077), U16(3086), U16(3090), U16(3114), U16(3125), U16(3133), U16(3134),
+ U16(3137), U16(3142), U16(3146), U16(3157), U16(3160), U16(3168), U16(3170), U16(3174), U16(3192), U16(3199),
+ U16(3202), U16(3205), U16(3214), U16(3218), U16(3242), U16(3253), U16(3260), U16(3261), U16(3262), U16(3263),
+ U16(3264), U16(3270), U16(3271), U16(3274), U16(3276), U16(3285), U16(3294), U16(3296), U16(3298), U16(3302),
+ U16(3313), U16(3330), U16(3333), U16(3342), U16(3346), U16(3389), U16(3390), U16(3393), U16(3398), U16(3402),
+ U16(3405), U16(3406), U16(3415), U16(3424), U16(3426), U16(3430), U16(3440), U16(3449), U16(3450), U16(3458),
+ U16(3461), U16(3482), U16(3507), U16(3517), U16(3520), U16(3530), U16(3535), U16(3538), U16(3542), U16(3544),
+ U16(3570), U16(3572), U16(3585), U16(3633), U16(3634), U16(3636), U16(3647), U16(3648), U16(3654), U16(3655),
+ U16(3663), U16(3664), U16(3674), U16(3713), U16(3716), U16(3719), U16(3722), U16(3725), U16(3732), U16(3737),
+ U16(3745), U16(3749), U16(3751), U16(3754), U16(3757), U16(3761), U16(3762), U16(3764), U16(3771), U16(3773),
+ U16(3776), U16(3782), U16(3784), U16(3792), U16(3804), U16(3840), U16(3841), U16(3844), U16(3859), U16(3860),
+ U16(3861), U16(3864), U16(3866), U16(3872), U16(3882), U16(3892), U16(3893), U16(3894), U16(3895), U16(3896),
+ U16(3897), U16(3898), U16(3899), U16(3900), U16(3901), U16(3902), U16(3904), U16(3913), U16(3953), U16(3967),
+ U16(3968), U16(3973), U16(3974), U16(3976), U16(3981), U16(3993), U16(4030), U16(4038), U16(4039), U16(4046),
+ U16(4048), U16(4053), U16(4057), U16(4096), U16(4139), U16(4141), U16(4145), U16(4146), U16(4152), U16(4153),
+ U16(4155), U16(4157), U16(4159), U16(4160), U16(4170), U16(4176), U16(4182), U16(4184), U16(4186), U16(4190),
+ U16(4193), U16(4194), U16(4197), U16(4199), U16(4206), U16(4209), U16(4213), U16(4226), U16(4227), U16(4229),
+ U16(4231), U16(4237), U16(4238), U16(4239), U16(4240), U16(4250), U16(4253), U16(4254), U16(4256), U16(4295),
+ U16(4301), U16(4304), U16(4347), U16(4348), U16(4349), U16(4682), U16(4688), U16(4696), U16(4698), U16(4704),
+ U16(4746), U16(4752), U16(4786), U16(4792), U16(4800), U16(4802), U16(4808), U16(4824), U16(4882), U16(4888),
+ U16(4957), U16(4960), U16(4969), U16(4992), U16(5008), U16(5024), U16(5120), U16(5121), U16(5741), U16(5743),
+ U16(5760), U16(5761), U16(5787), U16(5788), U16(5792), U16(5867), U16(5870), U16(5888), U16(5902), U16(5906),
+ U16(5920), U16(5938), U16(5941), U16(5952), U16(5970), U16(5984), U16(5998), U16(6002), U16(6016), U16(6068),
+ U16(6070), U16(6071), U16(6078), U16(6086), U16(6087), U16(6089), U16(6100), U16(6103), U16(6104), U16(6107),
+ U16(6108), U16(6109), U16(6112), U16(6128), U16(6144), U16(6150), U16(6151), U16(6155), U16(6158), U16(6160),
+ U16(6176), U16(6211), U16(6212), U16(6272), U16(6313), U16(6314), U16(6320), U16(6400), U16(6432), U16(6435),
+ U16(6439), U16(6441), U16(6448), U16(6450), U16(6451), U16(6457), U16(6464), U16(6468), U16(6470), U16(6480),
+ U16(6512), U16(6528), U16(6576), U16(6593), U16(6600), U16(6608), U16(6618), U16(6622), U16(6656), U16(6679),
+ U16(6681), U16(6686), U16(6688), U16(6741), U16(6742), U16(6743), U16(6744), U16(6752), U16(6753), U16(6754),
+ U16(6755), U16(6757), U16(6765), U16(6771), U16(6783), U16(6784), U16(6800), U16(6816), U16(6823), U16(6824),
+ U16(6912), U16(6916), U16(6917), U16(6964), U16(6965), U16(6966), U16(6971), U16(6972), U16(6973), U16(6978),
+ U16(6979), U16(6981), U16(6992), U16(7002), U16(7009), U16(7019), U16(7028), U16(7040), U16(7042), U16(7043),
+ U16(7073), U16(7074), U16(7078), U16(7080), U16(7082), U16(7083), U16(7084), U16(7086), U16(7088), U16(7098),
+ U16(7142), U16(7143), U16(7144), U16(7146), U16(7149), U16(7150), U16(7151), U16(7154), U16(7164), U16(7168),
+ U16(7204), U16(7212), U16(7220), U16(7222), U16(7227), U16(7232), U16(7245), U16(7248), U16(7258), U16(7288),
+ U16(7294), U16(7360), U16(7376), U16(7379), U16(7380), U16(7393), U16(7394), U16(7401), U16(7405), U16(7406),
+ U16(7410), U16(7412), U16(7413), U16(7424), U16(7468), U16(7531), U16(7544), U16(7545), U16(7579), U16(7616),
+ U16(7676), U16(7680), U16(7830), U16(7838), U16(7936), U16(7944), U16(7952), U16(7960), U16(7968), U16(7976),
+ U16(7984), U16(7992), U16(8000), U16(8008), U16(8016), U16(8025), U16(8027), U16(8029), U16(8031), U16(8033),
+ U16(8040), U16(8048), U16(8064), U16(8072), U16(8080), U16(8088), U16(8096), U16(8104), U16(8112), U16(8118),
+ U16(8120), U16(8124), U16(8125), U16(8126), U16(8127), U16(8130), U16(8134), U16(8136), U16(8140), U16(8141),
+ U16(8144), U16(8150), U16(8152), U16(8157), U16(8160), U16(8168), U16(8173), U16(8178), U16(8182), U16(8184),
+ U16(8188), U16(8189), U16(8192), U16(8203), U16(8208), U16(8214), U16(8216), U16(8217), U16(8218), U16(8219),
+ U16(8221), U16(8222), U16(8223), U16(8224), U16(8232), U16(8233), U16(8234), U16(8239), U16(8240), U16(8249),
+ U16(8250), U16(8251), U16(8255), U16(8257), U16(8260), U16(8261), U16(8262), U16(8263), U16(8274), U16(8275),
+ U16(8276), U16(8277), U16(8287), U16(8288), U16(8298), U16(8304), U16(8305), U16(8308), U16(8314), U16(8317),
+ U16(8318), U16(8319), U16(8320), U16(8330), U16(8333), U16(8334), U16(8336), U16(8352), U16(8400), U16(8413),
+ U16(8417), U16(8418), U16(8421), U16(8448), U16(8450), U16(8451), U16(8455), U16(8456), U16(8458), U16(8459),
+ U16(8462), U16(8464), U16(8467), U16(8468), U16(8469), U16(8470), U16(8472), U16(8473), U16(8478), U16(8484),
+ U16(8485), U16(8486), U16(8487), U16(8488), U16(8489), U16(8490), U16(8494), U16(8495), U16(8496), U16(8500),
+ U16(8501), U16(8505), U16(8506), U16(8508), U16(8510), U16(8512), U16(8517), U16(8519), U16(8522), U16(8523),
+ U16(8524), U16(8526), U16(8527), U16(8528), U16(8544), U16(8579), U16(8581), U16(8585), U16(8592), U16(8597),
+ U16(8602), U16(8604), U16(8608), U16(8609), U16(8611), U16(8612), U16(8614), U16(8615), U16(8622), U16(8623),
+ U16(8654), U16(8656), U16(8658), U16(8659), U16(8660), U16(8661), U16(8692), U16(8960), U16(8968), U16(8972),
+ U16(8992), U16(8994), U16(9001), U16(9002), U16(9003), U16(9084), U16(9085), U16(9115), U16(9140), U16(9180),
+ U16(9186), U16(9216), U16(9280), U16(9312), U16(9372), U16(9450), U16(9472), U16(9655), U16(9656), U16(9665),
+ U16(9666), U16(9720), U16(9728), U16(9839), U16(9840), U16(9985), U16(10088), U16(10089), U16(10090), U16(10091),
+ U16(10092), U16(10093), U16(10094), U16(10095), U16(10096), U16(10097), U16(10098), U16(10099), U16(10100), U16(10101),
+ U16(10102), U16(10132), U16(10176), U16(10181), U16(10182), U16(10183), U16(10214), U16(10215), U16(10216), U16(10217),
+ U16(10218), U16(10219), U16(10220), U16(10221), U16(10222), U16(10223), U16(10224), U16(10240), U16(10496), U16(10627),
+ U16(10628), U16(10629), U16(10630), U16(10631), U16(10632), U16(10633), U16(10634), U16(10635), U16(10636), U16(10637),
+ U16(10638), U16(10639), U16(10640), U16(10641), U16(10642), U16(10643), U16(10644), U16(10645), U16(10646), U16(10647),
+ U16(10648), U16(10649), U16(10712), U16(10713), U16(10714), U16(10715), U16(10716), U16(10748), U16(10749), U16(10750),
+ U16(11008), U16(11056), U16(11077), U16(11079), U16(11088), U16(11264), U16(11312), U16(11360), U16(11363), U16(11365),
+ U16(11367), U16(11374), U16(11377), U16(11378), U16(11380), U16(11381), U16(11383), U16(11388), U16(11390), U16(11393),
+ U16(11394), U16(11492), U16(11493), U16(11499), U16(11503), U16(11506), U16(11513), U16(11517), U16(11518), U16(11520),
+ U16(11559), U16(11565), U16(11568), U16(11631), U16(11632), U16(11647), U16(11648), U16(11680), U16(11688), U16(11696),
+ U16(11704), U16(11712), U16(11720), U16(11728), U16(11736), U16(11744), U16(11776), U16(11778), U16(11779), U16(11780),
+ U16(11781), U16(11782), U16(11785), U16(11786), U16(11787), U16(11788), U16(11789), U16(11790), U16(11799), U16(11800),
+ U16(11802), U16(11803), U16(11804), U16(11805), U16(11806), U16(11808), U16(11809), U16(11810), U16(11811), U16(11812),
+ U16(11813), U16(11814), U16(11815), U16(11816), U16(11817), U16(11818), U16(11823), U16(11824), U16(11834), U16(11904),
+ U16(11931), U16(12032), U16(12272), U16(12288), U16(12289), U16(12292), U16(12293), U16(12294), U16(12295), U16(12296),
+ U16(12297), U16(12298), U16(12299), U16(12300), U16(12301), U16(12302), U16(12303), U16(12304), U16(12305), U16(12306),
+ U16(12308), U16(12309), U16(12310), U16(12311), U16(12312), U16(12313), U16(12314), U16(12315), U16(12316), U16(12317),
+ U16(12318), U16(12320), U16(12321), U16(12330), U16(12334), U16(12336), U16(12337), U16(12342), U16(12344), U16(12347),
+ U16(12348), U16(12349), U16(12350), U16(12353), U16(12441), U16(12443), U16(12445), U16(12447), U16(12448), U16(12449),
+ U16(12539), U16(12540), U16(12543), U16(12549), U16(12593), U16(12688), U16(12690), U16(12694), U16(12704), U16(12736),
+ U16(12784), U16(12800), U16(12832), U16(12842), U16(12872), U16(12880), U16(12881), U16(12896), U16(12928), U16(12938),
+ U16(12977), U16(12992), U16(13056), U16(13312), U16(19893), U16(19904), U16(19968), U16(40908), U16(40960), U16(40981),
+ U16(40982), U16(42128), U16(42192), U16(42232), U16(42238), U16(42240), U16(42508), U16(42509), U16(42512), U16(42528),
+ U16(42538), U16(42560), U16(42606), U16(42607), U16(42608), U16(42611), U16(42612), U16(42622), U16(42623), U16(42624),
+ U16(42655), U16(42656), U16(42726), U16(42736), U16(42738), U16(42752), U16(42775), U16(42784), U16(42786), U16(42800),
+ U16(42802), U16(42864), U16(42865), U16(42873), U16(42878), U16(42888), U16(42889), U16(42891), U16(42896), U16(42912),
+ U16(43000), U16(43002), U16(43003), U16(43010), U16(43011), U16(43014), U16(43015), U16(43019), U16(43020), U16(43043),
+ U16(43045), U16(43047), U16(43048), U16(43056), U16(43062), U16(43064), U16(43065), U16(43072), U16(43124), U16(43136),
+ U16(43138), U16(43188), U16(43204), U16(43214), U16(43216), U16(43232), U16(43250), U16(43256), U16(43259), U16(43264),
+ U16(43274), U16(43302), U16(43310), U16(43312), U16(43335), U16(43346), U16(43359), U16(43360), U16(43392), U16(43395),
+ U16(43396), U16(43443), U16(43444), U16(43446), U16(43450), U16(43452), U16(43453), U16(43457), U16(43471), U16(43472),
+ U16(43486), U16(43520), U16(43561), U16(43567), U16(43569), U16(43571), U16(43573), U16(43584), U16(43587), U16(43588),
+ U16(43596), U16(43597), U16(43600), U16(43612), U16(43616), U16(43632), U16(43633), U16(43639), U16(43642), U16(43643),
+ U16(43648), U16(43696), U16(43697), U16(43698), U16(43701), U16(43703), U16(43705), U16(43710), U16(43712), U16(43713),
+ U16(43714), U16(43739), U16(43741), U16(43742), U16(43744), U16(43755), U16(43756), U16(43758), U16(43760), U16(43762),
+ U16(43763), U16(43765), U16(43766), U16(43777), U16(43785), U16(43793), U16(43808), U16(43816), U16(43968), U16(44003),
+ U16(44005), U16(44006), U16(44008), U16(44009), U16(44011), U16(44012), U16(44013), U16(44016), U16(44032), U16(55203),
+ U16(55216), U16(55243), U16(55296), U16(56191), U16(56319), U16(57343), U16(57344), U16(63743), U16(63744), U16(64112),
+ U16(64256), U16(64275), U16(64285), U16(64286), U16(64287), U16(64297), U16(64298), U16(64312), U16(64318), U16(64320),
+ U16(64323), U16(64326), U16(64434), U16(64467), U16(64830), U16(64831), U16(64848), U16(64914), U16(65008), U16(65020),
+ U16(65021), U16(65024), U16(65040), U16(65047), U16(65048), U16(65049), U16(65056), U16(65072), U16(65073), U16(65075),
+ U16(65077), U16(65078), U16(65079), U16(65080), U16(65081), U16(65082), U16(65083), U16(65084), U16(65085), U16(65086),
+ U16(65087), U16(65088), U16(65089), U16(65090), U16(65091), U16(65092), U16(65093), U16(65095), U16(65096), U16(65097),
+ U16(65101), U16(65104), U16(65108), U16(65112), U16(65113), U16(65114), U16(65115), U16(65116), U16(65117), U16(65118),
+ U16(65119), U16(65122), U16(65123), U16(65124), U16(65128), U16(65129), U16(65130), U16(65136), U16(65142), U16(65279),
+ U16(65281), U16(65284), U16(65285), U16(65288), U16(65289), U16(65290), U16(65291), U16(65292), U16(65293), U16(65294),
+ U16(65296), U16(65306), U16(65308), U16(65311), U16(65313), U16(65339), U16(65340), U16(65341), U16(65342), U16(65343),
+ U16(65344), U16(65345), U16(65371), U16(65372), U16(65373), U16(65374), U16(65375), U16(65376), U16(65377), U16(65378),
+ U16(65379), U16(65380), U16(65382), U16(65392), U16(65393), U16(65438), U16(65440), U16(65474), U16(65482), U16(65490),
+ U16(65498), U16(65504), U16(65506), U16(65507), U16(65508), U16(65509), U16(65512), U16(65513), U16(65517), U16(65529),
+ U16(65532), U16(0), U16(13), U16(40), U16(60), U16(63), U16(80), U16(128), U16(256), U16(263),
+ U16(311), U16(320), U16(373), U16(377), U16(394), U16(400), U16(464), U16(509), U16(640), U16(672),
+ U16(768), U16(800), U16(816), U16(833), U16(834), U16(842), U16(896), U16(927), U16(928), U16(968),
+ U16(976), U16(977), U16(1024), U16(1064), U16(1104), U16(1184), U16(2048), U16(2056), U16(2058), U16(2103),
+ U16(2108), U16(2111), U16(2135), U16(2136), U16(2304), U16(2326), U16(2335), U16(2336), U16(2367), U16(2432),
+ U16(2494), U16(2560), U16(2561), U16(2565), U16(2572), U16(2576), U16(2581), U16(2585), U16(2616), U16(2623),
+ U16(2624), U16(2640), U16(2656), U16(2685), U16(2687), U16(2816), U16(2873), U16(2880), U16(2904), U16(2912),
+ U16(2936), U16(3072), U16(3680), U16(4096), U16(4097), U16(4098), U16(4099), U16(4152), U16(4167), U16(4178),
+ U16(4198), U16(4224), U16(4226), U16(4227), U16(4272), U16(4275), U16(4279), U16(4281), U16(4283), U16(4285),
+ U16(4286), U16(4304), U16(4336), U16(4352), U16(4355), U16(4391), U16(4396), U16(4397), U16(4406), U16(4416),
+ U16(4480), U16(4482), U16(4483), U16(4531), U16(4534), U16(4543), U16(4545), U16(4549), U16(4560), U16(5760),
+ U16(5803), U16(5804), U16(5805), U16(5806), U16(5808), U16(5814), U16(5815), U16(5824), U16(8192), U16(9216),
+ U16(9328), U16(12288), U16(26624), U16(28416), U16(28496), U16(28497), U16(28559), U16(28563), U16(45056), U16(53248),
+ U16(53504), U16(53545), U16(53605), U16(53607), U16(53610), U16(53613), U16(53619), U16(53627), U16(53635), U16(53637),
+ U16(53644), U16(53674), U16(53678), U16(53760), U16(53826), U16(53829), U16(54016), U16(54112), U16(54272), U16(54298),
+ U16(54324), U16(54350), U16(54358), U16(54376), U16(54402), U16(54428), U16(54430), U16(54434), U16(54437), U16(54441),
+ U16(54446), U16(54454), U16(54459), U16(54461), U16(54469), U16(54480), U16(54506), U16(54532), U16(54535), U16(54541),
+ U16(54550), U16(54558), U16(54584), U16(54587), U16(54592), U16(54598), U16(54602), U16(54610), U16(54636), U16(54662),
+ U16(54688), U16(54714), U16(54740), U16(54766), U16(54792), U16(54818), U16(54844), U16(54870), U16(54896), U16(54922),
+ U16(54952), U16(54977), U16(54978), U16(55003), U16(55004), U16(55010), U16(55035), U16(55036), U16(55061), U16(55062),
+ U16(55068), U16(55093), U16(55094), U16(55119), U16(55120), U16(55126), U16(55151), U16(55152), U16(55177), U16(55178),
+ U16(55184), U16(55209), U16(55210), U16(55235), U16(55236), U16(55242), U16(55246), U16(60928), U16(60933), U16(60961),
+ U16(60964), U16(60967), U16(60969), U16(60980), U16(60985), U16(60987), U16(60994), U16(60999), U16(61001), U16(61003),
+ U16(61005), U16(61009), U16(61012), U16(61015), U16(61017), U16(61019), U16(61021), U16(61023), U16(61025), U16(61028),
+ U16(61031), U16(61036), U16(61044), U16(61049), U16(61054), U16(61056), U16(61067), U16(61089), U16(61093), U16(61099),
+ U16(61168), U16(61440), U16(61488), U16(61600), U16(61617), U16(61633), U16(61649), U16(61696), U16(61712), U16(61744),
+ U16(61808), U16(61926), U16(61968), U16(62016), U16(62032), U16(62208), U16(62256), U16(62263), U16(62336), U16(62368),
+ U16(62406), U16(62432), U16(62464), U16(62528), U16(62530), U16(62713), U16(62720), U16(62784), U16(62800), U16(62971),
+ U16(63045), U16(63104), U16(63232), U16(0), U16(42710), U16(42752), U16(46900), U16(46912), U16(47133), U16(63488),
+ U16(1), U16(32), U16(256), U16(0), U16(65533),
+} /* sqlite3.c:228671:12 */
+var aFts5UnicodeData = [1765]U16{
+ U16(1025), U16(61), U16(117), U16(55), U16(117), U16(54), U16(50), U16(53), U16(57), U16(53),
+ U16(49), U16(85), U16(333), U16(85), U16(121), U16(85), U16(841), U16(54), U16(53), U16(50),
+ U16(56), U16(48), U16(56), U16(837), U16(54), U16(57), U16(50), U16(57), U16(1057), U16(61),
+ U16(53), U16(151), U16(58), U16(53), U16(56), U16(58), U16(39), U16(52), U16(57), U16(34),
+ U16(58), U16(56), U16(58), U16(57), U16(79), U16(56), U16(37), U16(85), U16(56), U16(47),
+ U16(39), U16(51), U16(111), U16(53), U16(745), U16(57), U16(233), U16(773), U16(57), U16(261),
+ U16(1822), U16(37), U16(542), U16(37), U16(1534), U16(222), U16(69), U16(73), U16(37), U16(126),
+ U16(126), U16(73), U16(69), U16(137), U16(37), U16(73), U16(37), U16(105), U16(101), U16(73),
+ U16(37), U16(73), U16(37), U16(190), U16(158), U16(37), U16(126), U16(126), U16(73), U16(37),
+ U16(126), U16(94), U16(37), U16(39), U16(94), U16(69), U16(135), U16(41), U16(40), U16(37),
+ U16(41), U16(40), U16(37), U16(41), U16(40), U16(37), U16(542), U16(37), U16(606), U16(37),
+ U16(41), U16(40), U16(37), U16(126), U16(73), U16(37), U16(1886), U16(197), U16(73), U16(37),
+ U16(73), U16(69), U16(126), U16(105), U16(37), U16(286), U16(2181), U16(39), U16(869), U16(582),
+ U16(152), U16(390), U16(472), U16(166), U16(248), U16(38), U16(56), U16(38), U16(568), U16(3596),
+ U16(158), U16(38), U16(56), U16(94), U16(38), U16(101), U16(53), U16(88), U16(41), U16(53),
+ U16(105), U16(41), U16(73), U16(37), U16(553), U16(297), U16(1125), U16(94), U16(37), U16(105),
+ U16(101), U16(798), U16(133), U16(94), U16(57), U16(126), U16(94), U16(37), U16(1641), U16(1541),
+ U16(1118), U16(58), U16(172), U16(75), U16(1790), U16(478), U16(37), U16(2846), U16(1225), U16(38),
+ U16(213), U16(1253), U16(53), U16(49), U16(55), U16(1452), U16(49), U16(44), U16(53), U16(76),
+ U16(53), U16(76), U16(53), U16(44), U16(871), U16(103), U16(85), U16(162), U16(121), U16(85),
+ U16(55), U16(85), U16(90), U16(364), U16(53), U16(85), U16(1031), U16(38), U16(327), U16(684),
+ U16(333), U16(149), U16(71), U16(44), U16(3175), U16(53), U16(39), U16(236), U16(34), U16(58),
+ U16(204), U16(70), U16(76), U16(58), U16(140), U16(71), U16(333), U16(103), U16(90), U16(39),
+ U16(469), U16(34), U16(39), U16(44), U16(967), U16(876), U16(2855), U16(364), U16(39), U16(333),
+ U16(1063), U16(300), U16(70), U16(58), U16(117), U16(38), U16(711), U16(140), U16(38), U16(300),
+ U16(38), U16(108), U16(38), U16(172), U16(501), U16(807), U16(108), U16(53), U16(39), U16(359),
+ U16(876), U16(108), U16(42), U16(1735), U16(44), U16(42), U16(44), U16(39), U16(106), U16(268),
+ U16(138), U16(44), U16(74), U16(39), U16(236), U16(327), U16(76), U16(85), U16(333), U16(53),
+ U16(38), U16(199), U16(231), U16(44), U16(74), U16(263), U16(71), U16(711), U16(231), U16(39),
+ U16(135), U16(44), U16(39), U16(106), U16(140), U16(74), U16(74), U16(44), U16(39), U16(42),
+ U16(71), U16(103), U16(76), U16(333), U16(71), U16(87), U16(207), U16(58), U16(55), U16(76),
+ U16(42), U16(199), U16(71), U16(711), U16(231), U16(71), U16(71), U16(71), U16(44), U16(106),
+ U16(76), U16(76), U16(108), U16(44), U16(135), U16(39), U16(333), U16(76), U16(103), U16(44),
+ U16(76), U16(42), U16(295), U16(103), U16(711), U16(231), U16(71), U16(167), U16(44), U16(39),
+ U16(106), U16(172), U16(76), U16(42), U16(74), U16(44), U16(39), U16(71), U16(76), U16(333),
+ U16(53), U16(55), U16(44), U16(74), U16(263), U16(71), U16(711), U16(231), U16(71), U16(167),
+ U16(44), U16(39), U16(42), U16(44), U16(42), U16(140), U16(74), U16(74), U16(44), U16(44),
+ U16(42), U16(71), U16(103), U16(76), U16(333), U16(58), U16(39), U16(207), U16(44), U16(39),
+ U16(199), U16(103), U16(135), U16(71), U16(39), U16(71), U16(71), U16(103), U16(391), U16(74),
+ U16(44), U16(74), U16(106), U16(106), U16(44), U16(39), U16(42), U16(333), U16(111), U16(218),
+ U16(55), U16(58), U16(106), U16(263), U16(103), U16(743), U16(327), U16(167), U16(39), U16(108),
+ U16(138), U16(108), U16(140), U16(76), U16(71), U16(71), U16(76), U16(333), U16(239), U16(58),
+ U16(74), U16(263), U16(103), U16(743), U16(327), U16(167), U16(44), U16(39), U16(42), U16(44),
+ U16(170), U16(44), U16(74), U16(74), U16(76), U16(74), U16(39), U16(71), U16(76), U16(333),
+ U16(71), U16(74), U16(263), U16(103), U16(1319), U16(39), U16(106), U16(140), U16(106), U16(106),
+ U16(44), U16(39), U16(42), U16(71), U16(76), U16(333), U16(207), U16(58), U16(199), U16(74),
+ U16(583), U16(775), U16(295), U16(39), U16(231), U16(44), U16(106), U16(108), U16(44), U16(266),
+ U16(74), U16(53), U16(1543), U16(44), U16(71), U16(236), U16(55), U16(199), U16(38), U16(268),
+ U16(53), U16(333), U16(85), U16(71), U16(39), U16(71), U16(39), U16(39), U16(135), U16(231),
+ U16(103), U16(39), U16(39), U16(71), U16(135), U16(44), U16(71), U16(204), U16(76), U16(39),
+ U16(167), U16(38), U16(204), U16(333), U16(135), U16(39), U16(122), U16(501), U16(58), U16(53),
+ U16(122), U16(76), U16(218), U16(333), U16(335), U16(58), U16(44), U16(58), U16(44), U16(58),
+ U16(44), U16(54), U16(50), U16(54), U16(50), U16(74), U16(263), U16(1159), U16(460), U16(42),
+ U16(172), U16(53), U16(76), U16(167), U16(364), U16(1164), U16(282), U16(44), U16(218), U16(90),
+ U16(181), U16(154), U16(85), U16(1383), U16(74), U16(140), U16(42), U16(204), U16(42), U16(76),
+ U16(74), U16(76), U16(39), U16(333), U16(213), U16(199), U16(74), U16(76), U16(135), U16(108),
+ U16(39), U16(106), U16(71), U16(234), U16(103), U16(140), U16(423), U16(44), U16(74), U16(76),
+ U16(202), U16(44), U16(39), U16(42), U16(333), U16(106), U16(44), U16(90), U16(1225), U16(41),
+ U16(41), U16(1383), U16(53), U16(38), U16(10631), U16(135), U16(231), U16(39), U16(135), U16(1319),
+ U16(135), U16(1063), U16(135), U16(231), U16(39), U16(135), U16(487), U16(1831), U16(135), U16(2151),
+ U16(108), U16(309), U16(655), U16(519), U16(346), U16(2727), U16(49), U16(19847), U16(85), U16(551),
+ U16(61), U16(839), U16(54), U16(50), U16(2407), U16(117), U16(110), U16(423), U16(135), U16(108),
+ U16(583), U16(108), U16(85), U16(583), U16(76), U16(423), U16(103), U16(76), U16(1671), U16(76),
+ U16(42), U16(236), U16(266), U16(44), U16(74), U16(364), U16(117), U16(38), U16(117), U16(55),
+ U16(39), U16(44), U16(333), U16(335), U16(213), U16(49), U16(149), U16(108), U16(61), U16(333),
+ U16(1127), U16(38), U16(1671), U16(1319), U16(44), U16(39), U16(2247), U16(935), U16(108), U16(138),
+ U16(76), U16(106), U16(74), U16(44), U16(202), U16(108), U16(58), U16(85), U16(333), U16(967),
+ U16(167), U16(1415), U16(554), U16(231), U16(74), U16(333), U16(47), U16(1114), U16(743), U16(76),
+ U16(106), U16(85), U16(1703), U16(42), U16(44), U16(42), U16(236), U16(44), U16(42), U16(44),
+ U16(74), U16(268), U16(202), U16(332), U16(44), U16(333), U16(333), U16(245), U16(38), U16(213),
+ U16(140), U16(42), U16(1511), U16(44), U16(42), U16(172), U16(42), U16(44), U16(170), U16(44),
+ U16(74), U16(231), U16(333), U16(245), U16(346), U16(300), U16(314), U16(76), U16(42), U16(967),
+ U16(42), U16(140), U16(74), U16(76), U16(42), U16(44), U16(74), U16(71), U16(333), U16(1415),
+ U16(44), U16(42), U16(76), U16(106), U16(44), U16(42), U16(108), U16(74), U16(149), U16(1159),
+ U16(266), U16(268), U16(74), U16(76), U16(181), U16(333), U16(103), U16(333), U16(967), U16(198),
+ U16(85), U16(277), U16(108), U16(53), U16(428), U16(42), U16(236), U16(135), U16(44), U16(135),
+ U16(74), U16(44), U16(71), U16(1413), U16(2022), U16(421), U16(38), U16(1093), U16(1190), U16(1260),
+ U16(140), U16(4830), U16(261), U16(3166), U16(261), U16(265), U16(197), U16(201), U16(261), U16(265),
+ U16(261), U16(265), U16(197), U16(201), U16(261), U16(41), U16(41), U16(41), U16(94), U16(229),
+ U16(265), U16(453), U16(261), U16(264), U16(261), U16(264), U16(261), U16(264), U16(165), U16(69),
+ U16(137), U16(40), U16(56), U16(37), U16(120), U16(101), U16(69), U16(137), U16(40), U16(120),
+ U16(133), U16(69), U16(137), U16(120), U16(261), U16(169), U16(120), U16(101), U16(69), U16(137),
+ U16(40), U16(88), U16(381), U16(162), U16(209), U16(85), U16(52), U16(51), U16(54), U16(84),
+ U16(51), U16(54), U16(52), U16(277), U16(59), U16(60), U16(162), U16(61), U16(309), U16(52),
+ U16(51), U16(149), U16(80), U16(117), U16(57), U16(54), U16(50), U16(373), U16(57), U16(53),
+ U16(48), U16(341), U16(61), U16(162), U16(194), U16(47), U16(38), U16(207), U16(121), U16(54),
+ U16(50), U16(38), U16(335), U16(121), U16(54), U16(50), U16(422), U16(855), U16(428), U16(139),
+ U16(44), U16(107), U16(396), U16(90), U16(41), U16(154), U16(41), U16(90), U16(37), U16(105),
+ U16(69), U16(105), U16(37), U16(58), U16(41), U16(90), U16(57), U16(169), U16(218), U16(41),
+ U16(58), U16(41), U16(58), U16(41), U16(58), U16(137), U16(58), U16(37), U16(137), U16(37),
+ U16(135), U16(37), U16(90), U16(69), U16(73), U16(185), U16(94), U16(101), U16(58), U16(57),
+ U16(90), U16(37), U16(58), U16(527), U16(1134), U16(94), U16(142), U16(47), U16(185), U16(186),
+ U16(89), U16(154), U16(57), U16(90), U16(57), U16(90), U16(57), U16(250), U16(57), U16(1018),
+ U16(89), U16(90), U16(57), U16(58), U16(57), U16(1018), U16(8601), U16(282), U16(153), U16(666),
+ U16(89), U16(250), U16(54), U16(50), U16(2618), U16(57), U16(986), U16(825), U16(1306), U16(217),
+ U16(602), U16(1274), U16(378), U16(1935), U16(2522), U16(719), U16(5882), U16(57), U16(314), U16(57),
+ U16(1754), U16(281), U16(3578), U16(57), U16(4634), U16(3322), U16(54), U16(50), U16(54), U16(50),
+ U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50),
+ U16(975), U16(1434), U16(185), U16(54), U16(50), U16(1017), U16(54), U16(50), U16(54), U16(50),
+ U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(537), U16(8218), U16(4217), U16(54),
+ U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54),
+ U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54),
+ U16(50), U16(2041), U16(54), U16(50), U16(54), U16(50), U16(1049), U16(54), U16(50), U16(8281),
+ U16(1562), U16(697), U16(90), U16(217), U16(346), U16(1513), U16(1509), U16(126), U16(73), U16(69),
+ U16(254), U16(105), U16(37), U16(94), U16(37), U16(94), U16(165), U16(70), U16(105), U16(37),
+ U16(3166), U16(37), U16(218), U16(158), U16(108), U16(94), U16(149), U16(47), U16(85), U16(1221),
+ U16(37), U16(37), U16(1799), U16(38), U16(53), U16(44), U16(743), U16(231), U16(231), U16(231),
+ U16(231), U16(231), U16(231), U16(231), U16(231), U16(1036), U16(85), U16(52), U16(51), U16(52),
+ U16(51), U16(117), U16(52), U16(51), U16(53), U16(52), U16(51), U16(309), U16(49), U16(85),
+ U16(49), U16(53), U16(52), U16(51), U16(85), U16(52), U16(51), U16(54), U16(50), U16(54),
+ U16(50), U16(54), U16(50), U16(54), U16(50), U16(181), U16(38), U16(341), U16(81), U16(858),
+ U16(2874), U16(6874), U16(410), U16(61), U16(117), U16(58), U16(38), U16(39), U16(46), U16(54),
+ U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(90),
+ U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(49), U16(54),
+ U16(82), U16(58), U16(302), U16(140), U16(74), U16(49), U16(166), U16(90), U16(110), U16(38),
+ U16(39), U16(53), U16(90), U16(2759), U16(76), U16(88), U16(70), U16(39), U16(49), U16(2887),
+ U16(53), U16(102), U16(39), U16(1319), U16(3015), U16(90), U16(143), U16(346), U16(871), U16(1178),
+ U16(519), U16(1018), U16(335), U16(986), U16(271), U16(58), U16(495), U16(1050), U16(335), U16(1274),
+ U16(495), U16(2042), U16(8218), U16(39), U16(39), U16(2074), U16(39), U16(39), U16(679), U16(38),
+ U16(36583), U16(1786), U16(1287), U16(198), U16(85), U16(8583), U16(38), U16(117), U16(519), U16(333),
+ U16(71), U16(1502), U16(39), U16(44), U16(107), U16(53), U16(332), U16(53), U16(38), U16(798),
+ U16(44), U16(2247), U16(334), U16(76), U16(213), U16(760), U16(294), U16(88), U16(478), U16(69),
+ U16(2014), U16(38), U16(261), U16(190), U16(350), U16(38), U16(88), U16(158), U16(158), U16(382),
+ U16(70), U16(37), U16(231), U16(44), U16(103), U16(44), U16(135), U16(44), U16(743), U16(74),
+ U16(76), U16(42), U16(154), U16(207), U16(90), U16(55), U16(58), U16(1671), U16(149), U16(74),
+ U16(1607), U16(522), U16(44), U16(85), U16(333), U16(588), U16(199), U16(117), U16(39), U16(333),
+ U16(903), U16(268), U16(85), U16(743), U16(364), U16(74), U16(53), U16(935), U16(108), U16(42),
+ U16(1511), U16(44), U16(74), U16(140), U16(74), U16(44), U16(138), U16(437), U16(38), U16(333),
+ U16(85), U16(1319), U16(204), U16(74), U16(76), U16(74), U16(76), U16(103), U16(44), U16(263),
+ U16(44), U16(42), U16(333), U16(149), U16(519), U16(38), U16(199), U16(122), U16(39), U16(42),
+ U16(1543), U16(44), U16(39), U16(108), U16(71), U16(76), U16(167), U16(76), U16(39), U16(44),
+ U16(39), U16(71), U16(38), U16(85), U16(359), U16(42), U16(76), U16(74), U16(85), U16(39),
+ U16(70), U16(42), U16(44), U16(199), U16(199), U16(199), U16(231), U16(231), U16(1127), U16(74),
+ U16(44), U16(74), U16(44), U16(74), U16(53), U16(42), U16(44), U16(333), U16(39), U16(39),
+ U16(743), U16(1575), U16(36), U16(68), U16(68), U16(36), U16(63), U16(63), U16(11719), U16(3399),
+ U16(229), U16(165), U16(39), U16(44), U16(327), U16(57), U16(423), U16(167), U16(39), U16(71),
+ U16(71), U16(3463), U16(536), U16(11623), U16(54), U16(50), U16(2055), U16(1735), U16(391), U16(55),
+ U16(58), U16(524), U16(245), U16(54), U16(50), U16(53), U16(236), U16(53), U16(81), U16(80),
+ U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50),
+ U16(54), U16(50), U16(54), U16(50), U16(54), U16(50), U16(85), U16(54), U16(50), U16(149),
+ U16(112), U16(117), U16(149), U16(49), U16(54), U16(50), U16(54), U16(50), U16(54), U16(50),
+ U16(117), U16(57), U16(49), U16(121), U16(53), U16(55), U16(85), U16(167), U16(4327), U16(34),
+ U16(117), U16(55), U16(117), U16(54), U16(50), U16(53), U16(57), U16(53), U16(49), U16(85),
+ U16(333), U16(85), U16(121), U16(85), U16(841), U16(54), U16(53), U16(50), U16(56), U16(48),
+ U16(56), U16(837), U16(54), U16(57), U16(50), U16(57), U16(54), U16(50), U16(53), U16(54),
+ U16(50), U16(85), U16(327), U16(38), U16(1447), U16(70), U16(999), U16(199), U16(199), U16(199),
+ U16(103), U16(87), U16(57), U16(56), U16(58), U16(87), U16(58), U16(153), U16(90), U16(98),
+ U16(90), U16(391), U16(839), U16(615), U16(71), U16(487), U16(455), U16(3943), U16(117), U16(1455),
+ U16(314), U16(1710), U16(143), U16(570), U16(47), U16(410), U16(1466), U16(44), U16(935), U16(1575),
+ U16(999), U16(143), U16(551), U16(46), U16(263), U16(46), U16(967), U16(53), U16(1159), U16(263),
+ U16(53), U16(174), U16(1289), U16(1285), U16(2503), U16(333), U16(199), U16(39), U16(1415), U16(71),
+ U16(39), U16(743), U16(53), U16(271), U16(711), U16(207), U16(53), U16(839), U16(53), U16(1799),
+ U16(71), U16(39), U16(108), U16(76), U16(140), U16(135), U16(103), U16(871), U16(108), U16(44),
+ U16(271), U16(309), U16(935), U16(79), U16(53), U16(1735), U16(245), U16(711), U16(271), U16(615),
+ U16(271), U16(2343), U16(1007), U16(42), U16(44), U16(42), U16(1703), U16(492), U16(245), U16(655),
+ U16(333), U16(76), U16(42), U16(1447), U16(106), U16(140), U16(74), U16(76), U16(85), U16(34),
+ U16(149), U16(807), U16(333), U16(108), U16(1159), U16(172), U16(42), U16(268), U16(333), U16(149),
+ U16(76), U16(42), U16(1543), U16(106), U16(300), U16(74), U16(135), U16(149), U16(333), U16(1383),
+ U16(44), U16(42), U16(44), U16(74), U16(204), U16(42), U16(44), U16(333), U16(28135), U16(3182),
+ U16(149), U16(34279), U16(18215), U16(2215), U16(39), U16(1482), U16(140), U16(422), U16(71), U16(7898),
+ U16(1274), U16(1946), U16(74), U16(108), U16(122), U16(202), U16(258), U16(268), U16(90), U16(236),
+ U16(986), U16(140), U16(1562), U16(2138), U16(108), U16(58), U16(2810), U16(591), U16(841), U16(837),
+ U16(841), U16(229), U16(581), U16(841), U16(837), U16(41), U16(73), U16(41), U16(73), U16(137),
+ U16(265), U16(133), U16(37), U16(229), U16(357), U16(841), U16(837), U16(73), U16(137), U16(265),
+ U16(233), U16(837), U16(73), U16(137), U16(169), U16(41), U16(233), U16(837), U16(841), U16(837),
+ U16(841), U16(837), U16(841), U16(837), U16(841), U16(837), U16(841), U16(837), U16(841), U16(901),
+ U16(809), U16(57), U16(805), U16(57), U16(197), U16(809), U16(57), U16(805), U16(57), U16(197),
+ U16(809), U16(57), U16(805), U16(57), U16(197), U16(809), U16(57), U16(805), U16(57), U16(197),
+ U16(809), U16(57), U16(805), U16(57), U16(197), U16(94), U16(1613), U16(135), U16(871), U16(71),
+ U16(39), U16(39), U16(327), U16(135), U16(39), U16(39), U16(39), U16(39), U16(39), U16(39),
+ U16(103), U16(71), U16(39), U16(39), U16(39), U16(39), U16(39), U16(39), U16(71), U16(39),
+ U16(135), U16(231), U16(135), U16(135), U16(39), U16(327), U16(551), U16(103), U16(167), U16(551),
+ U16(89), U16(1434), U16(3226), U16(506), U16(474), U16(506), U16(506), U16(367), U16(1018), U16(1946),
+ U16(1402), U16(954), U16(1402), U16(314), U16(90), U16(1082), U16(218), U16(2266), U16(666), U16(1210),
+ U16(186), U16(570), U16(2042), U16(58), U16(5850), U16(154), U16(2010), U16(154), U16(794), U16(2266),
+ U16(378), U16(2266), U16(3738), U16(39), U16(39), U16(39), U16(39), U16(39), U16(39), U16(17351),
+ U16(34), U16(3074), U16(7692), U16(63), U16(63),
+} /* sqlite3.c:228850:12 */
+
+func sqlite3Fts5UnicodeCategory(tls *libc.TLS, iCode U32) int32 { /* sqlite3.c:229030:12: */
+ var iRes int32 = -1
+ var iHi int32
+ var iLo int32
+ var ret int32
+ var iKey U16
+
+ if iCode >= (U32(int32(1) << 20)) {
+ return 0
+ }
+ iLo = int32(aFts5UnicodeBlock[(iCode >> 16)])
+ iHi = int32(aFts5UnicodeBlock[(U32(1) + (iCode >> 16))])
+ iKey = (U16(iCode & U32(0xFFFF)))
+ for iHi > iLo {
+ var iTest int32 = ((iHi + iLo) / 2)
+
+ if int32(iKey) >= int32(aFts5UnicodeMap[iTest]) {
+ iRes = iTest
+ iLo = (iTest + 1)
+ } else {
+ iHi = iTest
+ }
+ }
+
+ if iRes < 0 {
+ return 0
+ }
+ if int32(iKey) >= (int32(aFts5UnicodeMap[iRes]) + (int32(aFts5UnicodeData[iRes]) >> 5)) {
+ return 0
+ }
+ ret = (int32(aFts5UnicodeData[iRes]) & 0x1F)
+ if ret != 30 {
+ return ret
+ }
+ if ((int32(iKey) - int32(aFts5UnicodeMap[iRes])) & 0x01) != 0 {
+ return 5
+ }
+ return 9
+}
+
+func sqlite3Fts5UnicodeAscii(tls *libc.TLS, aArray uintptr, aAscii uintptr) { /* sqlite3.c:229061:13: */
+ var i int32 = 0
+ var iTbl int32 = 0
+ for i < 128 {
+ var bToken int32 = int32(*(*U8)(unsafe.Pointer(aArray + uintptr((int32(aFts5UnicodeData[iTbl]) & 0x1F)))))
+ var n int32 = ((int32(aFts5UnicodeData[iTbl]) >> 5) + i)
+ for ; (i < 128) && (i < n); i++ {
+ *(*U8)(unsafe.Pointer(aAscii + uintptr(i))) = U8(bToken)
+ }
+ iTbl++
+ }
+}
+
+// 2015 May 30
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// Routines for varint serialization and deserialization.
+
+// #include "fts5Int.h"
+
+// This is a copy of the sqlite3GetVarint32() routine from the SQLite core.
+// Except, this version does handle the single byte case that the core
+// version depends on being handled before its function is called.
+func sqlite3Fts5GetVarint32(tls *libc.TLS, p uintptr, v uintptr) int32 { /* sqlite3.c:229097:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ var a U32
+ var b U32
+
+ // The 1-byte case. Overwhelmingly the most common.
+ a = U32(*(*uint8)(unsafe.Pointer(p)))
+ // a: p0 (unmasked)
+ if !((a & U32(0x80)) != 0) {
+ // Values between 0 and 127
+ *(*U32)(unsafe.Pointer(v)) = a
+ return 1
+ }
+
+ // The 2-byte case
+ p++
+ b = U32(*(*uint8)(unsafe.Pointer(p)))
+ // b: p1 (unmasked)
+ if !((b & U32(0x80)) != 0) {
+ // Values between 128 and 16383
+ a = a & (U32(0x7f))
+ a = (a << 7)
+ *(*U32)(unsafe.Pointer(v)) = (a | b)
+ return 2
+ }
+
+ // The 3-byte case
+ p++
+ a = (a << 14)
+ a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ // a: p0<<14 | p2 (unmasked)
+ if !((a & U32(0x80)) != 0) {
+ // Values between 16384 and 2097151
+ a = a & (U32((int32(0x7f) << 14) | (0x7f)))
+ b = b & (U32(0x7f))
+ b = (b << 7)
+ *(*U32)(unsafe.Pointer(v)) = (a | b)
+ return 3
+ }
+
+ /* A 32-bit varint is used to store size information in btrees.
+ ** Objects are rarely larger than 2MiB limit of a 3-byte varint.
+ ** A 3-byte varint is sufficient, for example, to record the size
+ ** of a 1048569-byte BLOB or string.
+ **
+ ** We only unroll the first 1-, 2-, and 3- byte cases. The very
+ ** rare larger cases can be handled by the slower 64-bit varint
+ ** routine.
+ */
+ {
+ // var v64 U64 at bp, 8
+
+ var n U8
+ p -= uintptr(2)
+ n = sqlite3Fts5GetVarint(tls, p, bp /* &v64 */)
+ *(*U32)(unsafe.Pointer(v)) = ((U32(*(*U64)(unsafe.Pointer(bp /* v64 */)))) & U32(0x7FFFFFFF))
+
+ return int32(n)
+ }
+ return int32(0)
+}
+
+// Bitmasks used by sqlite3GetVarint(). These precomputed constants
+// are defined here rather than simply putting the constant expressions
+// inline in order to work around bugs in the RVT compiler.
+//
+// SLOT_2_0 A mask for (0x7f<<14) | 0x7f
+//
+// SLOT_4_2_0 A mask for (0x7f<<28) | SLOT_2_0
+
+// Read a 64-bit variable-length integer from memory starting at p[0].
+// Return the number of bytes read. The value is stored in *v.
+func sqlite3Fts5GetVarint(tls *libc.TLS, p uintptr, v uintptr) U8 { /* sqlite3.c:229175:11: */
+ var a U32
+ var b U32
+ var s U32
+
+ a = U32(*(*uint8)(unsafe.Pointer(p)))
+ // a: p0 (unmasked)
+ if !((a & U32(0x80)) != 0) {
+ *(*U64)(unsafe.Pointer(v)) = U64(a)
+ return U8(1)
+ }
+
+ p++
+ b = U32(*(*uint8)(unsafe.Pointer(p)))
+ // b: p1 (unmasked)
+ if !((b & U32(0x80)) != 0) {
+ a = a & (U32(0x7f))
+ a = (a << 7)
+ a = a | (b)
+ *(*U64)(unsafe.Pointer(v)) = U64(a)
+ return U8(2)
+ }
+
+ // Verify that constants are precomputed correctly
+
+ p++
+ a = (a << 14)
+ a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ // a: p0<<14 | p2 (unmasked)
+ if !((a & U32(0x80)) != 0) {
+ a = a & (U32(0x001fc07f))
+ b = b & (U32(0x7f))
+ b = (b << 7)
+ a = a | (b)
+ *(*U64)(unsafe.Pointer(v)) = U64(a)
+ return U8(3)
+ }
+
+ // CSE1 from below
+ a = a & (U32(0x001fc07f))
+ p++
+ b = (b << 14)
+ b = b | (U32(*(*uint8)(unsafe.Pointer(p))))
+ // b: p1<<14 | p3 (unmasked)
+ if !((b & U32(0x80)) != 0) {
+ b = b & (U32(0x001fc07f))
+ // moved CSE1 up
+ // a &= (0x7f<<14)|(0x7f);
+ a = (a << 7)
+ a = a | (b)
+ *(*U64)(unsafe.Pointer(v)) = U64(a)
+ return U8(4)
+ }
+
+ // a: p0<<14 | p2 (masked)
+ // b: p1<<14 | p3 (unmasked)
+ // 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked)
+ // moved CSE1 up
+ // a &= (0x7f<<14)|(0x7f);
+ b = b & (U32(0x001fc07f))
+ s = a
+ // s: p0<<14 | p2 (masked)
+
+ p++
+ a = (a << 14)
+ a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ // a: p0<<28 | p2<<14 | p4 (unmasked)
+ if !((a & U32(0x80)) != 0) {
+ // we can skip these cause they were (effectively) done above in calc'ing s
+ // a &= (0x7f<<28)|(0x7f<<14)|(0x7f);
+ // b &= (0x7f<<14)|(0x7f);
+ b = (b << 7)
+ a = a | (b)
+ s = (s >> 18)
+ *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ return U8(5)
+ }
+
+ // 2:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked)
+ s = (s << 7)
+ s = s | (b)
+ // s: p0<<21 | p1<<14 | p2<<7 | p3 (masked)
+
+ p++
+ b = (b << 14)
+ b = b | (U32(*(*uint8)(unsafe.Pointer(p))))
+ // b: p1<<28 | p3<<14 | p5 (unmasked)
+ if !((b & U32(0x80)) != 0) {
+ // we can skip this cause it was (effectively) done above in calc'ing s
+ // b &= (0x7f<<28)|(0x7f<<14)|(0x7f);
+ a = a & (U32(0x001fc07f))
+ a = (a << 7)
+ a = a | (b)
+ s = (s >> 18)
+ *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ return U8(6)
+ }
+
+ p++
+ a = (a << 14)
+ a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ // a: p2<<28 | p4<<14 | p6 (unmasked)
+ if !((a & U32(0x80)) != 0) {
+ a = a & (0xf01fc07f)
+ b = b & (U32(0x001fc07f))
+ b = (b << 7)
+ a = a | (b)
+ s = (s >> 11)
+ *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ return U8(7)
+ }
+
+ // CSE2 from below
+ a = a & (U32(0x001fc07f))
+ p++
+ b = (b << 14)
+ b = b | (U32(*(*uint8)(unsafe.Pointer(p))))
+ // b: p3<<28 | p5<<14 | p7 (unmasked)
+ if !((b & U32(0x80)) != 0) {
+ b = b & (0xf01fc07f)
+ // moved CSE2 up
+ // a &= (0x7f<<14)|(0x7f);
+ a = (a << 7)
+ a = a | (b)
+ s = (s >> 4)
+ *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+ return U8(8)
+ }
+
+ p++
+ a = (a << 15)
+ a = a | (U32(*(*uint8)(unsafe.Pointer(p))))
+ // a: p4<<29 | p6<<15 | p8 (unmasked)
+
+ // moved CSE2 up
+ // a &= (0x7f<<29)|(0x7f<<15)|(0xff);
+ b = b & (U32(0x001fc07f))
+ b = (b << 8)
+ a = a | (b)
+
+ s = (s << 4)
+ b = U32(*(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(-4))))
+ b = b & (U32(0x7f))
+ b = (b >> 3)
+ s = s | (b)
+
+ *(*U64)(unsafe.Pointer(v)) = (((U64(s)) << 32) | U64(a))
+
+ return U8(9)
+}
+
+// The variable-length integer encoding is as follows:
+//
+// KEY:
+// A = 0xxxxxxx 7 bits of data and one flag bit
+// B = 1xxxxxxx 7 bits of data and one flag bit
+// C = xxxxxxxx 8 bits of data
+//
+// 7 bits - A
+// 14 bits - BA
+// 21 bits - BBA
+// 28 bits - BBBA
+// 35 bits - BBBBA
+// 42 bits - BBBBBA
+// 49 bits - BBBBBBA
+// 56 bits - BBBBBBBA
+// 64 bits - BBBBBBBBC
+
+// Write a 64-bit variable-length integer to memory starting at p[0].
+// The length of data write will be between 1 and 9 bytes. The number
+// of bytes written is returned.
+//
+// A variable-length integer consists of the lower 7 bits of each byte
+// for all bytes that have the 8th bit set and one byte with the 8th
+// bit clear. Except, if we get to the 9th byte, it stores the full
+// 8 bits and is the last byte.
+func fts5PutVarint64(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:229369:26: */
+ bp := tls.Alloc(10)
+ defer tls.Free(10)
+
+ var i int32
+ var j int32
+ var n int32
+ // var buf [10]U8 at bp, 10
+
+ if (v & (U64((uint64(0xff000000))) << 32)) != 0 {
+ *(*uint8)(unsafe.Pointer(p + uintptr(8))) = U8(v)
+ v >>= 8
+ for i = 7; i >= 0; i-- {
+ *(*uint8)(unsafe.Pointer(p + uintptr(i))) = (U8((v & uint64(0x7f)) | uint64(0x80)))
+ v >>= 7
+ }
+ return 9
+ }
+ n = 0
+ for ok := true; ok; ok = (v != uint64(0)) {
+ *(*U8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(libc.PostIncInt32(&n, 1)))) = (U8((v & uint64(0x7f)) | uint64(0x80)))
+ v >>= 7
+ }
+ *(*U8)(unsafe.Pointer(bp /* &buf */ + uintptr(0))) &= U8((0x7f))
+
+ i = 0
+ j = (n - 1)
+__1:
+ if !(j >= 0) {
+ goto __3
+ }
+ {
+ *(*uint8)(unsafe.Pointer(p + uintptr(i))) = *(*U8)(unsafe.Pointer(bp /* &buf[0] */ + uintptr(j)))
+ }
+ goto __2
+__2:
+ j--
+ i++
+ goto __1
+ goto __3
+__3:
+ ;
+ return n
+}
+
+func sqlite3Fts5PutVarint(tls *libc.TLS, p uintptr, v U64) int32 { /* sqlite3.c:229394:12: */
+ if v <= uint64(0x7f) {
+ *(*uint8)(unsafe.Pointer(p + uintptr(0))) = (uint8(v & uint64(0x7f)))
+ return 1
+ }
+ if v <= uint64(0x3fff) {
+ *(*uint8)(unsafe.Pointer(p + uintptr(0))) = (uint8(((v >> 7) & uint64(0x7f)) | uint64(0x80)))
+ *(*uint8)(unsafe.Pointer(p + uintptr(1))) = (uint8(v & uint64(0x7f)))
+ return 2
+ }
+ return fts5PutVarint64(tls, p, v)
+}
+
+func sqlite3Fts5GetVarintLen(tls *libc.TLS, iVal U32) int32 { /* sqlite3.c:229408:12: */
+
+ if iVal < (U32(int32(1) << 14)) {
+ return 2
+ }
+ if iVal < (U32(int32(1) << 21)) {
+ return 3
+ }
+ if iVal < (U32(int32(1) << 28)) {
+ return 4
+ }
+ return 5
+}
+
+// 2015 May 08
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// This is an SQLite virtual table module implementing direct access to an
+// existing FTS5 index. The module may create several different types of
+// tables:
+//
+// col:
+// CREATE TABLE vocab(term, col, doc, cnt, PRIMARY KEY(term, col));
+//
+// One row for each term/column combination. The value of $doc is set to
+// the number of fts5 rows that contain at least one instance of term
+// $term within column $col. Field $cnt is set to the total number of
+// instances of term $term in column $col (in any row of the fts5 table).
+//
+// row:
+// CREATE TABLE vocab(term, doc, cnt, PRIMARY KEY(term));
+//
+// One row for each term in the database. The value of $doc is set to
+// the number of fts5 rows that contain at least one instance of term
+// $term. Field $cnt is set to the total number of instances of term
+// $term in the database.
+//
+// instance:
+// CREATE TABLE vocab(term, doc, col, offset, PRIMARY KEY(<all-fields>));
+//
+// One row for each term instance in the database.
+
+// #include "fts5Int.h"
+
+type Fts5VocabTable1 = struct {
+ Fbase Sqlite3_vtab
+ FzFts5Tbl uintptr
+ FzFts5Db uintptr
+ Fdb uintptr
+ FpGlobal uintptr
+ FeType int32
+ FbBusy uint32
+}
+
+// 2015 May 08
+//
+// The author disclaims copyright to this source code. In place of
+// a legal notice, here is a blessing:
+//
+// May you do good and not evil.
+// May you find forgiveness for yourself and forgive others.
+// May you share freely, never taking more than you give.
+//
+//
+//
+// This is an SQLite virtual table module implementing direct access to an
+// existing FTS5 index. The module may create several different types of
+// tables:
+//
+// col:
+// CREATE TABLE vocab(term, col, doc, cnt, PRIMARY KEY(term, col));
+//
+// One row for each term/column combination. The value of $doc is set to
+// the number of fts5 rows that contain at least one instance of term
+// $term within column $col. Field $cnt is set to the total number of
+// instances of term $term in column $col (in any row of the fts5 table).
+//
+// row:
+// CREATE TABLE vocab(term, doc, cnt, PRIMARY KEY(term));
+//
+// One row for each term in the database. The value of $doc is set to
+// the number of fts5 rows that contain at least one instance of term
+// $term. Field $cnt is set to the total number of instances of term
+// $term in the database.
+//
+// instance:
+// CREATE TABLE vocab(term, doc, col, offset, PRIMARY KEY(<all-fields>));
+//
+// One row for each term instance in the database.
+
+// #include "fts5Int.h"
+
+type Fts5VocabTable = Fts5VocabTable1 /* sqlite3.c:229461:31 */
+type Fts5VocabCursor1 = struct {
+ Fbase Sqlite3_vtab_cursor
+ FpStmt uintptr
+ FpFts5 uintptr
+ FbEof int32
+ FpIter uintptr
+ FnLeTerm int32
+ FzLeTerm uintptr
+ FiCol int32
+ FaCnt uintptr
+ FaDoc uintptr
+ Frowid I64
+ Fterm Fts5Buffer
+ FiInstPos I64
+ FiInstOff int32
+ _ [4]byte
+}
+
+type Fts5VocabCursor = Fts5VocabCursor1 /* sqlite3.c:229462:32 */
+
+// Bits for the mask used as the idxNum value by xBestIndex/xFilter.
+
+// Translate a string containing an fts5vocab table type to an
+// FTS5_VOCAB_XXX constant. If successful, set *peType to the output
+// value and return SQLITE_OK. Otherwise, set *pzErr to an error message
+// and return SQLITE_ERROR.
+func fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uintptr) int32 { /* sqlite3.c:229521:12: */
+ bp := tls.Alloc(12)
+ defer tls.Free(12)
+
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = 0
+ var zCopy uintptr = sqlite3Fts5Strndup(tls, bp+8 /* &rc */, zType, -1)
+ if *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) == 0 {
+ sqlite3Fts5Dequote(tls, zCopy)
+ if Xsqlite3_stricmp(tls, zCopy, ts+40500 /* "col" */) == 0 {
+ *(*int32)(unsafe.Pointer(peType)) = 0
+ } else if Xsqlite3_stricmp(tls, zCopy, ts+40504 /* "row" */) == 0 {
+ *(*int32)(unsafe.Pointer(peType)) = 1
+ } else if Xsqlite3_stricmp(tls, zCopy, ts+40508 /* "instance" */) == 0 {
+ *(*int32)(unsafe.Pointer(peType)) = 2
+ } else {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+40517 /* "fts5vocab: unkno..." */, libc.VaList(bp, zCopy))
+ *(*int32)(unsafe.Pointer(bp + 8 /* rc */)) = 1
+ }
+ Xsqlite3_free(tls, zCopy)
+ }
+
+ return *(*int32)(unsafe.Pointer(bp + 8 /* rc */))
+}
+
+// The xDisconnect() virtual table method.
+func fts5VocabDisconnectMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229550:12: */
+ var pTab uintptr = pVtab
+ Xsqlite3_free(tls, pTab)
+ return 0
+}
+
+// The xDestroy() virtual table method.
+func fts5VocabDestroyMethod(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:229559:12: */
+ var pTab uintptr = pVtab
+ Xsqlite3_free(tls, pTab)
+ return 0
+}
+
+// This function is the implementation of both the xConnect and xCreate
+// methods of the FTS3 virtual table.
+//
+// The argv[] array contains the following:
+//
+// argv[0] -> module name ("fts5vocab")
+// argv[1] -> database name
+// argv[2] -> table name
+//
+// then:
+//
+// argv[3] -> name of fts5 table
+// argv[4] -> type of fts5vocab table
+//
+// or, for tables in the TEMP schema only.
+//
+// argv[3] -> name of fts5 tables database
+// argv[4] -> name of fts5 table
+// argv[5] -> type of fts5vocab table
+func fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVTab uintptr, pzErr uintptr) int32 { /* sqlite3.c:229586:12: */
+ bp := tls.Alloc(36)
+ defer tls.Free(36)
+
+ *(*[3]uintptr)(unsafe.Pointer(bp + 8 /* azSchema */)) = [3]uintptr{
+ ts + 40551, /* "CREATE TABlE voc..." */
+ ts + 40591, /* "CREATE TABlE voc..." */
+ ts + 40626, /* "CREATE TABlE voc..." */
+ }
+
+ var pRet uintptr = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = 0 // Return code
+ var bDb int32
+
+ bDb = (libc.Bool32(((argc == 6) && (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))) == uint64(4))) && (libc.Xmemcmp(tls, ts+24959 /* "temp" */, *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8)), uint64(4)) == 0)))
+
+ if (argc != 5) && (bDb == 0) {
+ *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, ts+40669 /* "wrong number of ..." */, 0)
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = 1
+ } else {
+ var nByte int32 // Bytes of space to allocate
+ var zDb uintptr
+ if bDb != 0 {
+ zDb = *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))
+ } else {
+ zDb = *(*uintptr)(unsafe.Pointer(argv + uintptr(1)*8))
+ }
+ var zTab uintptr
+ if bDb != 0 {
+ zTab = *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8))
+ } else {
+ zTab = *(*uintptr)(unsafe.Pointer(argv + uintptr(3)*8))
+ }
+ var zType uintptr
+ if bDb != 0 {
+ zType = *(*uintptr)(unsafe.Pointer(argv + uintptr(5)*8))
+ } else {
+ zType = *(*uintptr)(unsafe.Pointer(argv + uintptr(4)*8))
+ }
+ var nDb int32 = (int32(libc.Xstrlen(tls, zDb)) + 1)
+ var nTab int32 = (int32(libc.Xstrlen(tls, zTab)) + 1)
+ *(*int32)(unsafe.Pointer(bp /* eType */)) = 0
+
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = fts5VocabTableType(tls, zType, pzErr, bp /* &eType */)
+ if *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) == 0 {
+
+ *(*int32)(unsafe.Pointer(bp + 32 /* rc */)) = Xsqlite3_declare_vtab(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8 /* &azSchema[0] */ + uintptr(*(*int32)(unsafe.Pointer(bp /* eType */)))*8)))
+ }
+
+ nByte = (int32((uint64(unsafe.Sizeof(Fts5VocabTable{})) + uint64(nDb)) + uint64(nTab)))
+ pRet = sqlite3Fts5MallocZero(tls, bp+32 /* &rc */, int64(nByte))
+ if pRet != 0 {
+ (*Fts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux
+ (*Fts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp /* eType */))
+ (*Fts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db
+ (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = (pRet + uintptr(1)*64)
+ (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = ((*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab))
+ libc.Xmemcpy(tls, (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, uint64(nTab))
+ libc.Xmemcpy(tls, (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, uint64(nDb))
+ sqlite3Fts5Dequote(tls, (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl)
+ sqlite3Fts5Dequote(tls, (*Fts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db)
+ }
+ }
+
+ *(*uintptr)(unsafe.Pointer(ppVTab)) = pRet
+ return *(*int32)(unsafe.Pointer(bp + 32 /* rc */))
+}
+
+// The xConnect() and xCreate() methods for the virtual table. All the
+// work is done in function fts5VocabInitVtab().
+func fts5VocabConnectMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:229648:12: */
+ return fts5VocabInitVtab(tls, db, pAux, argc, argv, ppVtab, pzErr)
+}
+func fts5VocabCreateMethod(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:229658:12: */
+ return fts5VocabInitVtab(tls, db, pAux, argc, argv, ppVtab, pzErr)
+}
+
+// Implementation of the xBestIndex method.
+//
+// Only constraints of the form:
+//
+// term <= ?
+// term == ?
+// term >= ?
+//
+// are interpreted. Less-than and less-than-or-equal are treated
+// identically, as are greater-than and greater-than-or-equal.
+func fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) int32 { /* sqlite3.c:229681:12: */
+ var i int32
+ var iTermEq int32 = -1
+ var iTermGe int32 = -1
+ var iTermLe int32 = -1
+ var idxNum int32 = 0
+ var nArg int32 = 0
+
+ _ = pUnused
+
+ for i = 0; i < (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint; i++ {
+ var p uintptr = ((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraint + uintptr(i)*12)
+ if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) == 0 {
+ continue
+ }
+ if (*sqlite3_index_constraint)(unsafe.Pointer(p)).FiColumn == 0 { // term column
+ if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == 2 {
+ iTermEq = i
+ }
+ if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == 8 {
+ iTermLe = i
+ }
+ if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == 16 {
+ iTermLe = i
+ }
+ if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == 32 {
+ iTermGe = i
+ }
+ if int32((*sqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == 4 {
+ iTermGe = i
+ }
+ }
+ }
+
+ if iTermEq >= 0 {
+ idxNum = idxNum | (0x01)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(iTermEq)*8)).FargvIndex = libc.PreIncInt32(&nArg, 1)
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = float64(100)
+ } else {
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = float64(1000000)
+ if iTermGe >= 0 {
+ idxNum = idxNum | (0x02)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(iTermGe)*8)).FargvIndex = libc.PreIncInt32(&nArg, 1)
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = ((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost / float64(2))
+ }
+ if iTermLe >= 0 {
+ idxNum = idxNum | (0x04)
+ (*sqlite3_index_constraint_usage)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(iTermLe)*8)).FargvIndex = libc.PreIncInt32(&nArg, 1)
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = ((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost / float64(2))
+ }
+ }
+
+ // This virtual table always delivers results in ascending order of
+ // the "term" column (column 0). So if the user has requested this
+ // specifically - "ORDER BY term" or "ORDER BY term ASC" - set the
+ // sqlite3_index_info.orderByConsumed flag to tell the core the results
+ // are already in sorted order.
+ if (((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FnOrderBy == 1) &&
+ ((*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy+uintptr(0)*8)).FiColumn == 0)) &&
+ (int32((*sqlite3_index_orderby)(unsafe.Pointer((*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy+uintptr(0)*8)).Fdesc) == 0) {
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).ForderByConsumed = 1
+ }
+
+ (*Sqlite3_index_info)(unsafe.Pointer(pInfo)).FidxNum = idxNum
+ return 0
+}
+
+// Implementation of xOpen method.
+func fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) int32 { /* sqlite3.c:229743:12: */
+ bp := tls.Alloc(80)
+ defer tls.Free(80)
+
+ var pTab uintptr = pVTab
+ var pFts5 uintptr = uintptr(0)
+ var pCsr uintptr = uintptr(0)
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = 0
+ *(*uintptr)(unsafe.Pointer(bp + 72 /* pStmt */)) = uintptr(0)
+ var zSql uintptr = uintptr(0)
+
+ if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 {
+ (*Sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls,
+ ts+40702 /* "recursive defini..." */, libc.VaList(bp, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl))
+ return 1
+ }
+ zSql = sqlite3Fts5Mprintf(tls, bp+64, /* &rc */
+ ts+40733, /* "SELECT t.%Q FROM..." */
+ libc.VaList(bp+16, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl))
+ if zSql != 0 {
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = Xsqlite3_prepare_v2(tls, (*Fts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -1, bp+72 /* &pStmt */, uintptr(0))
+ }
+ Xsqlite3_free(tls, zSql)
+
+ if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == 1 {
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = 0
+ }
+
+ (*Fts5VocabTable)(unsafe.Pointer(pTab)).FbBusy = uint32(1)
+ if (*(*uintptr)(unsafe.Pointer(bp + 72 /* pStmt */)) != 0) && (Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pStmt */))) == 100) {
+ var iId I64 = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pStmt */)), 0)
+ pFts5 = sqlite3Fts5TableFromCsrid(tls, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FpGlobal, iId)
+ }
+ (*Fts5VocabTable)(unsafe.Pointer(pTab)).FbBusy = uint32(0)
+
+ if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == 0 {
+ if pFts5 == uintptr(0) {
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pStmt */)))
+ *(*uintptr)(unsafe.Pointer(bp + 72 /* pStmt */)) = uintptr(0)
+ if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == 0 {
+ (*Sqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls,
+ ts+40784 /* "no such fts5 tab..." */, libc.VaList(bp+48, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*Fts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl))
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = 1
+ }
+ } else {
+ *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) = sqlite3Fts5FlushToDisk(tls, pFts5)
+ }
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 64 /* rc */)) == 0 {
+ var nByte int32 = (int32(((uint64((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pFts5)).FpConfig)).FnCol) * uint64(unsafe.Sizeof(I64(0)))) * uint64(2)) + uint64(unsafe.Sizeof(Fts5VocabCursor{}))))
+ pCsr = sqlite3Fts5MallocZero(tls, bp+64 /* &rc */, int64(nByte))
+ }
+
+ if pCsr != 0 {
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5 = pFts5
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStmt = *(*uintptr)(unsafe.Pointer(bp + 72 /* pStmt */))
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt = (pCsr + uintptr(1)*120)
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc = ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer(pFts5)).FpConfig)).FnCol)*8)
+ } else {
+ Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 72 /* pStmt */)))
+ }
+
+ *(*uintptr)(unsafe.Pointer(ppCsr)) = pCsr
+ return *(*int32)(unsafe.Pointer(bp + 64 /* rc */))
+}
+
+func fts5VocabResetCursor(tls *libc.TLS, pCsr uintptr) { /* sqlite3.c:229811:13: */
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid = int64(0)
+ sqlite3Fts5IterClose(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter = uintptr(0)
+ Xsqlite3_free(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm)
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = -1
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = uintptr(0)
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 0
+}
+
+// Close the cursor. For additional information see the documentation
+// on the xClose method of the virtual table interface.
+func fts5VocabCloseMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:229825:12: */
+ var pCsr uintptr = pCursor
+ fts5VocabResetCursor(tls, pCsr)
+ sqlite3Fts5BufferFree(tls, (pCsr + 88 /* &.term */))
+ Xsqlite3_finalize(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpStmt)
+ Xsqlite3_free(tls, pCsr)
+ return 0
+}
+
+func fts5VocabInstanceNewTerm(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229834:12: */
+ bp := tls.Alloc(8)
+ defer tls.Free(8)
+
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = 0
+
+ if (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FbEof != 0 {
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
+ } else {
+ var zTerm uintptr
+ // var nTerm int32 at bp, 4
+
+ zTerm = sqlite3Fts5IterTerm(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter, bp /* &nTerm */)
+ if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm >= 0 {
+ var nCmp int32 = func() int32 {
+ if (*(*int32)(unsafe.Pointer(bp /* nTerm */))) < ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm) {
+ return *(*int32)(unsafe.Pointer(bp /* nTerm */))
+ }
+ return (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm
+ }()
+ var bCmp int32 = libc.Xmemcmp(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, uint64(nCmp))
+ if (bCmp < 0) || ((bCmp == 0) && ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm < *(*int32)(unsafe.Pointer(bp /* nTerm */)))) {
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
+ }
+ }
+
+ sqlite3Fts5BufferSet(tls, bp+4 /* &rc */, (pCsr + 88 /* &.term */), *(*int32)(unsafe.Pointer(bp /* nTerm */)), zTerm)
+ }
+ return *(*int32)(unsafe.Pointer(bp + 4 /* rc */))
+}
+
+func fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) int32 { /* sqlite3.c:229856:12: */
+ var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail
+ var rc int32 = 0
+ var pIter uintptr = (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter
+ var pp uintptr = (pCsr + 104 /* &.iInstPos */)
+ var po uintptr = (pCsr + 112 /* &.iInstOff */)
+
+ for (eDetail == 1) ||
+ (sqlite3Fts5PoslistNext64(tls, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FpData, (*Fts5IndexIter)(unsafe.Pointer(pIter)).FnData, po, pp) != 0) {
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos = int64(0)
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstOff = 0
+
+ rc = sqlite3Fts5IterNextScan(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)
+ if rc == 0 {
+ rc = fts5VocabInstanceNewTerm(tls, pCsr)
+ if ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof != 0) || (eDetail == 1) {
+ break
+ }
+ }
+ if rc != 0 {
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
+ break
+ }
+ }
+
+ return rc
+}
+
+// Advance the cursor to the next row in the table.
+func fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:229888:12: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var pCsr uintptr = pCursor
+ var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = 0
+ var nCol int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FnCol
+
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid++
+
+ if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType == 2 {
+ return fts5VocabInstanceNext(tls, pCsr)
+ }
+
+ if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType == 0 {
+ for (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol++; (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol < nCol; (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol++ {
+ if *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8)) != 0 {
+ break
+ }
+ }
+ }
+
+ if ((*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType != 0) || ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol >= nCol) {
+ if (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FbEof != 0 {
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
+ } else {
+ var zTerm uintptr
+ // var nTerm int32 at bp, 4
+
+ zTerm = sqlite3Fts5IterTerm(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter, bp /* &nTerm */)
+
+ if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm >= 0 {
+ var nCmp int32 = func() int32 {
+ if (*(*int32)(unsafe.Pointer(bp /* nTerm */))) < ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm) {
+ return *(*int32)(unsafe.Pointer(bp /* nTerm */))
+ }
+ return (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm
+ }()
+ var bCmp int32 = libc.Xmemcmp(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zTerm, uint64(nCmp))
+ if (bCmp < 0) || ((bCmp == 0) && ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm < *(*int32)(unsafe.Pointer(bp /* nTerm */)))) {
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof = 1
+ return 0
+ }
+ }
+
+ sqlite3Fts5BufferSet(tls, bp+4 /* &rc */, (pCsr + 88 /* &.term */), *(*int32)(unsafe.Pointer(bp /* nTerm */)), zTerm)
+ libc.Xmemset(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt, 0, (uint64(nCol) * uint64(unsafe.Sizeof(I64(0)))))
+ libc.Xmemset(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc, 0, (uint64(nCol) * uint64(unsafe.Sizeof(I64(0)))))
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol = 0
+
+ for *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == 0 {
+ var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail
+ var pPos uintptr
+ var nPos int32 // Position list
+ *(*I64)(unsafe.Pointer(bp + 16 /* iPos */)) = int64(0) // 64-bit position read from poslist
+ *(*int32)(unsafe.Pointer(bp + 8 /* iOff */)) = 0 // Current offset within position list
+
+ pPos = (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FpData
+ nPos = (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FnData
+
+ switch (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType {
+ case 1:
+ if eDetail == 0 {
+ for 0 == sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+8 /* &iOff */, bp+16 /* &iPos */) {
+ *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr(0)*8))++
+ }
+ }
+ *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr(0)*8))++
+ break
+ fallthrough
+
+ case 0:
+ if eDetail == 0 {
+ var iCol int32 = -1
+ for 0 == sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+8 /* &iOff */, bp+16 /* &iPos */) {
+ var ii int32 = (int32(*(*I64)(unsafe.Pointer(bp + 16 /* iPos */)) >> 32))
+ if iCol != ii {
+ if ii >= nCol {
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = (11 | (int32(1) << 8))
+ break
+ }
+ *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr(ii)*8))++
+ iCol = ii
+ }
+ *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr(ii)*8))++
+ }
+ } else if eDetail == 2 {
+ for 0 == sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+8 /* &iOff */, bp+16 /* &iPos */) {
+
+ if *(*I64)(unsafe.Pointer(bp + 16 /* iPos */)) >= I64(nCol) {
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = (11 | (int32(1) << 8))
+ break
+ }
+ *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr(*(*I64)(unsafe.Pointer(bp + 16 /* iPos */)))*8))++
+ }
+ } else {
+
+ *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr(0)*8))++
+ }
+ break
+ fallthrough
+
+ default:
+
+ break
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == 0 {
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = sqlite3Fts5IterNextScan(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)
+ }
+ if (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType == 2 {
+ break
+ }
+
+ if *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == 0 {
+ zTerm = sqlite3Fts5IterTerm(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter, bp /* &nTerm */)
+ if (*(*int32)(unsafe.Pointer(bp /* nTerm */)) != (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fn) ||
+ ((*(*int32)(unsafe.Pointer(bp /* nTerm */)) > 0) && (libc.Xmemcmp(tls, zTerm, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fp, uint64(*(*int32)(unsafe.Pointer(bp /* nTerm */)))) != 0)) {
+ break
+ }
+ if (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FbEof != 0 {
+ break
+ }
+ }
+ }
+ }
+ }
+
+ if ((*(*int32)(unsafe.Pointer(bp + 4 /* rc */)) == 0) && ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof == 0)) && ((*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType == 0) {
+ for ; ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol < nCol) && (*(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8)) == int64(0)); (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol++ {
+ }
+ if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol == nCol {
+ *(*int32)(unsafe.Pointer(bp + 4 /* rc */)) = (11 | (int32(1) << 8))
+ }
+ }
+ return *(*int32)(unsafe.Pointer(bp + 4 /* rc */))
+}
+
+// This is the xFilter implementation for the virtual table.
+func fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnused uintptr, nUnused int32, apVal uintptr) int32 { /* sqlite3.c:230014:12: */
+ var pTab uintptr = (*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab
+ var pCsr uintptr = pCursor
+ var eType int32 = (*Fts5VocabTable)(unsafe.Pointer(pTab)).FeType
+ var rc int32 = 0
+
+ var iVal int32 = 0
+ var f int32 = 0x0008
+ var zTerm uintptr = uintptr(0)
+ var nTerm int32 = 0
+
+ var pEq uintptr = uintptr(0)
+ var pGe uintptr = uintptr(0)
+ var pLe uintptr = uintptr(0)
+
+ _ = zUnused
+ _ = nUnused
+
+ fts5VocabResetCursor(tls, pCsr)
+ if (idxNum & 0x01) != 0 {
+ pEq = *(*uintptr)(unsafe.Pointer(apVal + uintptr(libc.PostIncInt32(&iVal, 1))*8))
+ }
+ if (idxNum & 0x02) != 0 {
+ pGe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(libc.PostIncInt32(&iVal, 1))*8))
+ }
+ if (idxNum & 0x04) != 0 {
+ pLe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(libc.PostIncInt32(&iVal, 1))*8))
+ }
+
+ if pEq != 0 {
+ zTerm = Xsqlite3_value_text(tls, pEq)
+ nTerm = Xsqlite3_value_bytes(tls, pEq)
+ f = 0
+ } else {
+ if pGe != 0 {
+ zTerm = Xsqlite3_value_text(tls, pGe)
+ nTerm = Xsqlite3_value_bytes(tls, pGe)
+ }
+ if pLe != 0 {
+ var zCopy uintptr = Xsqlite3_value_text(tls, pLe)
+ if zCopy == uintptr(0) {
+ zCopy = ts + 781 /* "" */
+ }
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = Xsqlite3_value_bytes(tls, pLe)
+ (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, ((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm + 1))
+ if (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm == uintptr(0) {
+ rc = 7
+ } else {
+ libc.Xmemcpy(tls, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm, zCopy, (uint64((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm + 1)))
+ }
+ }
+ }
+
+ if rc == 0 {
+ var pIndex uintptr = (*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpIndex
+ rc = sqlite3Fts5IndexQuery(tls, pIndex, zTerm, nTerm, f, uintptr(0), (pCsr + 32 /* &.pIter */))
+ }
+ if (rc == 0) && (eType == 2) {
+ rc = fts5VocabInstanceNewTerm(tls, pCsr)
+ }
+ if ((rc == 0) && !((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof != 0)) &&
+ ((eType != 2) ||
+ ((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail != 1)) {
+ rc = fts5VocabNextMethod(tls, pCursor)
+ }
+
+ return rc
+}
+
+// This is the xEof method of the virtual table. SQLite calls this
+// routine to find out if it has reached the end of a result set.
+func fts5VocabEofMethod(tls *libc.TLS, pCursor uintptr) int32 { /* sqlite3.c:230085:12: */
+ var pCsr uintptr = pCursor
+ return (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FbEof
+}
+
+func fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) int32 { /* sqlite3.c:230090:12: */
+ var pCsr uintptr = pCursor
+ var eDetail int32 = (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FeDetail
+ var eType int32 = (*Fts5VocabTable)(unsafe.Pointer((*Sqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FeType
+ var iVal I64 = int64(0)
+
+ if iCol == 0 {
+ Xsqlite3_result_text(tls,
+ pCtx, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fp, (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Fterm.Fn, libc.UintptrFromInt32(-1))
+ } else if eType == 0 {
+
+ if iCol == 1 {
+ if eDetail != 1 {
+ var z uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FazCol + uintptr((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8))
+ Xsqlite3_result_text(tls, pCtx, z, -1, uintptr(0))
+ }
+ } else if iCol == 2 {
+ iVal = *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8))
+ } else {
+ iVal = *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8))
+ }
+ } else if eType == 1 {
+
+ if iCol == 1 {
+ iVal = *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr(0)*8))
+ } else {
+ iVal = *(*I64)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr(0)*8))
+ }
+ } else {
+
+ switch iCol {
+ case 1:
+ Xsqlite3_result_int64(tls, pCtx, (*Fts5IndexIter)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FiRowid)
+ break
+ fallthrough
+ case 2:
+ {
+ var ii int32 = -1
+ if eDetail == 0 {
+ ii = (int32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos >> 32))
+ } else if eDetail == 2 {
+ ii = int32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos)
+ }
+ if (ii >= 0) && (ii < (*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FnCol) {
+ var z uintptr = *(*uintptr)(unsafe.Pointer((*Fts5Config)(unsafe.Pointer((*Fts5Table)(unsafe.Pointer((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FazCol + uintptr(ii)*8))
+ Xsqlite3_result_text(tls, pCtx, z, -1, uintptr(0))
+ }
+ break
+ }
+ fallthrough
+ default:
+ {
+
+ if eDetail == 0 {
+ var ii int32 = (int32((*Fts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos & int64(0x7FFFFFFF)))
+ Xsqlite3_result_int(tls, pCtx, ii)
+ }
+ break
+ }
+ }
+ }
+
+ if iVal > int64(0) {
+ Xsqlite3_result_int64(tls, pCtx, iVal)
+ }
+ return 0
+}
+
+// This is the xRowid method. The SQLite core calls this routine to
+// retrieve the rowid for the current row of the result set. The
+// rowid should be written to *pRowid.
+func fts5VocabRowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) int32 { /* sqlite3.c:230162:12: */
+ var pCsr uintptr = pCursor
+ *(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*Fts5VocabCursor)(unsafe.Pointer(pCsr)).Frowid
+ return 0
+}
+
+func sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) int32 { /* sqlite3.c:230171:12: */
+ var p uintptr = pGlobal
+
+ return Xsqlite3_create_module_v2(tls, db, ts+40810 /* "fts5vocab" */, uintptr(unsafe.Pointer(&fts5Vocab)), p, uintptr(0))
+}
+
+var fts5Vocab = Sqlite3_module{FiVersion:
+/* iVersion */ 2, FxCreate:
+/* xCreate */ 0, FxConnect:
+/* xConnect */ 0, FxBestIndex:
+/* xBestIndex */ 0, FxDisconnect:
+/* xDisconnect */ 0, FxDestroy:
+/* xDestroy */ 0, FxOpen:
+/* xOpen */ 0, FxClose:
+/* xClose */ 0, FxFilter:
+/* xFilter */ 0, FxNext:
+/* xNext */ 0, FxEof:
+/* xEof */ 0, FxColumn:
+/* xColumn */ 0, FxRowid:
+/* xRowid */ 0, FxUpdate:
+/* xUpdate */ uintptr(0), FxBegin:
+/* xBegin */ uintptr(0), FxSync:
+/* xSync */ uintptr(0), FxCommit:
+/* xCommit */ uintptr(0), FxRollback:
+/* xRollback */ uintptr(0), FxFindFunction:
+/* xFindFunction */ uintptr(0), FxRename:
+/* xRename */ uintptr(0), FxSavepoint:
+/* xSavepoint */ uintptr(0), FxRelease:
+/* xRelease */ uintptr(0), FxRollbackTo:
+/* xRollbackTo */ uintptr(0), FxShadowName:
+/* xShadowName */ uintptr(0),
+} /* sqlite3.c:230172:31 */
+
//************* End of fts5.c ***********************************************
//************* Begin file stmt.c *******************************************
// 2017-05-31
@@ -141410,12 +182095,6 @@ type stmt_vtab = struct {
Fdb uintptr
}
-//************* End of dbpage.c *********************************************
-//************* Begin file sqlite3session.c *********************************
-
-//************* End of sqlite3session.c *************************************
-//************* Begin file fts5.c *******************************************
-
//************* End of fts5.c ***********************************************
//************* Begin file stmt.c *******************************************
// 2017-05-31
@@ -141444,7 +182123,7 @@ type stmt_vtab = struct {
// stmt_vtab is a subclass of sqlite3_vtab which will
// serve as the underlying representation of a stmt virtual table
-type Stmt_vtab = stmt_vtab /* sqlite3.c:229514:26 */
+type Stmt_vtab = stmt_vtab /* sqlite3.c:230244:26 */
// stmt_cursor is a subclass of sqlite3_vtab_cursor which will
// serve as the underlying representation of a cursor that scans
@@ -141459,7 +182138,7 @@ type stmt_cursor = struct {
// stmt_cursor is a subclass of sqlite3_vtab_cursor which will
// serve as the underlying representation of a cursor that scans
// over rows of the result
-type Stmt_cursor = stmt_cursor /* sqlite3.c:229524:28 */
+type Stmt_cursor = stmt_cursor /* sqlite3.c:230254:28 */
// The stmtConnect() method is invoked to create a new
// stmt_vtab that describes the stmt virtual table.
@@ -141472,7 +182151,7 @@ type Stmt_cursor = stmt_cursor /* sqlite3.c:229524:28 */
//
// (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the
// result set of queries against stmt will look like.
-func stmtConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:229545:12: */
+func stmtConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintptr, ppVtab uintptr, pzErr uintptr) int32 { /* sqlite3.c:230275:12: */
var pNew uintptr
var rc int32
@@ -141480,46 +182159,46 @@ func stmtConnect(tls *crt.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt
rc = Xsqlite3_declare_vtab(tls, db,
- ts+24473 /* "CREATE TABLE x(s..." */)
+ ts+40820 /* "CREATE TABLE x(s..." */)
if rc == 0 {
pNew = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Stmt_vtab{})))
*(*uintptr)(unsafe.Pointer(ppVtab)) = pNew
if pNew == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Stmt_vtab{})))
+ libc.Xmemset(tls, pNew, 0, uint64(unsafe.Sizeof(Stmt_vtab{})))
(*Stmt_vtab)(unsafe.Pointer(pNew)).Fdb = db
}
return rc
}
// This method is the destructor for stmt_cursor objects.
-func stmtDisconnect(tls *crt.TLS, pVtab uintptr) int32 { /* sqlite3.c:229585:12: */
+func stmtDisconnect(tls *libc.TLS, pVtab uintptr) int32 { /* sqlite3.c:230315:12: */
Xsqlite3_free(tls, pVtab)
return 0
}
// Constructor for a new stmt_cursor object.
-func stmtOpen(tls *crt.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:229593:12: */
+func stmtOpen(tls *libc.TLS, p uintptr, ppCursor uintptr) int32 { /* sqlite3.c:230323:12: */
var pCur uintptr
pCur = Xsqlite3_malloc(tls, int32(unsafe.Sizeof(Stmt_cursor{})))
if pCur == uintptr(0) {
return 7
}
- crt.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(Stmt_cursor{})))
+ libc.Xmemset(tls, pCur, 0, uint64(unsafe.Sizeof(Stmt_cursor{})))
(*Stmt_cursor)(unsafe.Pointer(pCur)).Fdb = (*Stmt_vtab)(unsafe.Pointer(p)).Fdb
*(*uintptr)(unsafe.Pointer(ppCursor)) = (pCur /* &.base */)
return 0
}
// Destructor for a stmt_cursor.
-func stmtClose(tls *crt.TLS, cur uintptr) int32 { /* sqlite3.c:229606:12: */
+func stmtClose(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:230336:12: */
Xsqlite3_free(tls, cur)
return 0
}
// Advance a stmt_cursor to its next row of output.
-func stmtNext(tls *crt.TLS, cur uintptr) int32 { /* sqlite3.c:229615:12: */
+func stmtNext(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:230345:12: */
var pCur uintptr = cur
(*Stmt_cursor)(unsafe.Pointer(pCur)).FiRowid++
(*Stmt_cursor)(unsafe.Pointer(pCur)).FpStmt = Xsqlite3_next_stmt(tls, (*Stmt_cursor)(unsafe.Pointer(pCur)).Fdb, (*Stmt_cursor)(unsafe.Pointer(pCur)).FpStmt)
@@ -141528,12 +182207,12 @@ func stmtNext(tls *crt.TLS, cur uintptr) int32 { /* sqlite3.c:229615:12: */
// Return values of columns for the row at which the stmt_cursor
// is currently pointing.
-func stmtColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:229626:12: */
+func stmtColumn(tls *libc.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqlite3.c:230356:12: */
var pCur uintptr = cur
switch i {
case 0:
{
- Xsqlite3_result_text(tls, ctx, Xsqlite3_sql(tls, (*Stmt_cursor)(unsafe.Pointer(pCur)).FpStmt), -1, crt.UintptrFromInt32(-1))
+ Xsqlite3_result_text(tls, ctx, Xsqlite3_sql(tls, (*Stmt_cursor)(unsafe.Pointer(pCur)).FpStmt), -1, libc.UintptrFromInt32(-1))
break
}
case 1:
@@ -141580,7 +182259,7 @@ func stmtColumn(tls *crt.TLS, cur uintptr, ctx uintptr, i int32) int32 { /* sqli
// Return the rowid for the current row. In this implementation, the
// rowid is the same as the output value.
-func stmtRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:229673:12: */
+func stmtRowid(tls *libc.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:230403:12: */
var pCur uintptr = cur
*(*Sqlite_int64)(unsafe.Pointer(pRowid)) = (*Stmt_cursor)(unsafe.Pointer(pCur)).FiRowid
return 0
@@ -141588,16 +182267,16 @@ func stmtRowid(tls *crt.TLS, cur uintptr, pRowid uintptr) int32 { /* sqlite3.c:2
// Return TRUE if the cursor has been moved off of the last
// row of output.
-func stmtEof(tls *crt.TLS, cur uintptr) int32 { /* sqlite3.c:229683:12: */
+func stmtEof(tls *libc.TLS, cur uintptr) int32 { /* sqlite3.c:230413:12: */
var pCur uintptr = cur
- return (crt.Bool32((*Stmt_cursor)(unsafe.Pointer(pCur)).FpStmt == uintptr(0)))
+ return (libc.Bool32((*Stmt_cursor)(unsafe.Pointer(pCur)).FpStmt == uintptr(0)))
}
// This method is called to "rewind" the stmt_cursor object back
// to the first row of output. This method is always called at least
// once prior to any call to stmtColumn() or stmtRowid() or
// stmtEof().
-func stmtFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:229694:12: */
+func stmtFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr, argc int32, argv uintptr) int32 { /* sqlite3.c:230424:12: */
var pCur uintptr = pVtabCursor
(*Stmt_cursor)(unsafe.Pointer(pCur)).FpStmt = uintptr(0)
(*Stmt_cursor)(unsafe.Pointer(pCur)).FiRowid = int64(0)
@@ -141608,7 +182287,7 @@ func stmtFilter(tls *crt.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintptr,
// that uses the stmt virtual table. This routine needs to create
// a query plan for each invocation and compute an estimated cost for that
// plan.
-func stmtBestIndex(tls *crt.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:229711:12: */
+func stmtBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) int32 { /* sqlite3.c:230441:12: */
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(500)
(*Sqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(500)
return 0
@@ -141640,746 +182319,942 @@ uintptr(0), FxRelease:// xSavepoint
uintptr(0), FxRollbackTo:// xRelease
uintptr(0), FxShadowName:// xRollbackTo
uintptr(0), // xShadowName
-} /* sqlite3.c:229724:23 */
+} /* sqlite3.c:230454:23 */
-func Xsqlite3StmtVtabInit(tls *crt.TLS, db uintptr) int32 { /* sqlite3.c:229753:20: */
+func Xsqlite3StmtVtabInit(tls *libc.TLS, db uintptr) int32 { /* sqlite3.c:230483:20: */
var rc int32 = 0
- rc = Xsqlite3_create_module(tls, db, ts+24545 /* "sqlite_stmt" */, uintptr(unsafe.Pointer(&stmtModule)), uintptr(0))
+ rc = Xsqlite3_create_module(tls, db, ts+40892 /* "sqlite_stmt" */, uintptr(unsafe.Pointer(&stmtModule)), uintptr(0))
return rc
}
//************* End of stmt.c ***********************************************
// Return the source-id for this library
-func Xsqlite3_sourceid(tls *crt.TLS) uintptr { /* sqlite3.c:229786:23: */
- return ts + 24557 /* "2020-06-18 14:00..." */
+func Xsqlite3_sourceid(tls *libc.TLS) uintptr { /* sqlite3.c:230516:23: */
+ return ts + 40904 /* "2020-08-14 13:23..." */
}
//************************* End of sqlite3.c *****************************
func init() {
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 24 /* .xSFunc */)) = renameColumnFunc // sqlite3.c:107316:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 96 /* .xSFunc */)) = renameTableFunc // sqlite3.c:107317:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 168 /* .xSFunc */)) = renameTableTest // sqlite3.c:107318:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 24 /* .xSFunc */)) = versionFunc // sqlite3.c:118678:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 96 /* .xSFunc */)) = versionFunc // sqlite3.c:118679:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 168 /* .xSFunc */)) = versionFunc // sqlite3.c:118680:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 240 /* .xSFunc */)) = loadExt // sqlite3.c:118689:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 312 /* .xSFunc */)) = loadExt // sqlite3.c:118690:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 384 /* .xSFunc */)) = compileoptionusedFunc // sqlite3.c:118696:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 456 /* .xSFunc */)) = compileoptiongetFunc // sqlite3.c:118697:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 528 /* .xSFunc */)) = versionFunc // sqlite3.c:118699:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 600 /* .xSFunc */)) = versionFunc // sqlite3.c:118700:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 672 /* .xSFunc */)) = versionFunc // sqlite3.c:118701:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 744 /* .xSFunc */)) = trimFunc // sqlite3.c:118706:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 816 /* .xSFunc */)) = trimFunc // sqlite3.c:118707:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 888 /* .xSFunc */)) = trimFunc // sqlite3.c:118708:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 960 /* .xSFunc */)) = trimFunc // sqlite3.c:118709:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1032 /* .xSFunc */)) = trimFunc // sqlite3.c:118710:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1104 /* .xSFunc */)) = trimFunc // sqlite3.c:118711:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1176 /* .xSFunc */)) = minmaxFunc // sqlite3.c:118712:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1320 /* .xSFunc */)) = minmaxStep // sqlite3.c:118714:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1328 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:118714:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1336 /* .xValue */)) = minMaxValue // sqlite3.c:118714:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1392 /* .xSFunc */)) = minmaxFunc // sqlite3.c:118716:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1536 /* .xSFunc */)) = minmaxStep // sqlite3.c:118718:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1544 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:118718:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1552 /* .xValue */)) = minMaxValue // sqlite3.c:118718:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1608 /* .xSFunc */)) = typeofFunc // sqlite3.c:118720:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1680 /* .xSFunc */)) = lengthFunc // sqlite3.c:118721:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1752 /* .xSFunc */)) = instrFunc // sqlite3.c:118722:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1824 /* .xSFunc */)) = printfFunc // sqlite3.c:118723:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1896 /* .xSFunc */)) = unicodeFunc // sqlite3.c:118724:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1968 /* .xSFunc */)) = charFunc // sqlite3.c:118725:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2040 /* .xSFunc */)) = absFunc // sqlite3.c:118726:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2112 /* .xSFunc */)) = roundFunc // sqlite3.c:118728:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2184 /* .xSFunc */)) = roundFunc // sqlite3.c:118729:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2256 /* .xSFunc */)) = upperFunc // sqlite3.c:118731:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2328 /* .xSFunc */)) = lowerFunc // sqlite3.c:118732:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2400 /* .xSFunc */)) = hexFunc // sqlite3.c:118733:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2472 /* .xSFunc */)) = versionFunc // sqlite3.c:118734:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2544 /* .xSFunc */)) = randomFunc // sqlite3.c:118735:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2616 /* .xSFunc */)) = randomBlob // sqlite3.c:118736:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2688 /* .xSFunc */)) = nullifFunc // sqlite3.c:118737:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2760 /* .xSFunc */)) = versionFunc // sqlite3.c:118738:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2832 /* .xSFunc */)) = sourceidFunc // sqlite3.c:118739:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2904 /* .xSFunc */)) = errlogFunc // sqlite3.c:118740:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2976 /* .xSFunc */)) = quoteFunc // sqlite3.c:118741:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3048 /* .xSFunc */)) = last_insert_rowid // sqlite3.c:118742:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3120 /* .xSFunc */)) = changes // sqlite3.c:118743:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3192 /* .xSFunc */)) = total_changes // sqlite3.c:118744:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3264 /* .xSFunc */)) = replaceFunc // sqlite3.c:118745:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3336 /* .xSFunc */)) = zeroblobFunc // sqlite3.c:118746:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3408 /* .xSFunc */)) = substrFunc // sqlite3.c:118747:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3480 /* .xSFunc */)) = substrFunc // sqlite3.c:118748:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3552 /* .xSFunc */)) = sumStep // sqlite3.c:118749:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3560 /* .xFinalize */)) = sumFinalize // sqlite3.c:118749:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3568 /* .xValue */)) = sumFinalize // sqlite3.c:118749:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3576 /* .xInverse */)) = sumInverse // sqlite3.c:118749:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3624 /* .xSFunc */)) = sumStep // sqlite3.c:118750:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3632 /* .xFinalize */)) = totalFinalize // sqlite3.c:118750:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3640 /* .xValue */)) = totalFinalize // sqlite3.c:118750:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3648 /* .xInverse */)) = sumInverse // sqlite3.c:118750:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3696 /* .xSFunc */)) = sumStep // sqlite3.c:118751:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3704 /* .xFinalize */)) = avgFinalize // sqlite3.c:118751:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3712 /* .xValue */)) = avgFinalize // sqlite3.c:118751:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3720 /* .xInverse */)) = sumInverse // sqlite3.c:118751:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3768 /* .xSFunc */)) = countStep // sqlite3.c:118752:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3776 /* .xFinalize */)) = countFinalize // sqlite3.c:118752:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3784 /* .xValue */)) = countFinalize // sqlite3.c:118752:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3792 /* .xInverse */)) = countInverse // sqlite3.c:118752:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3840 /* .xSFunc */)) = countStep // sqlite3.c:118754:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3848 /* .xFinalize */)) = countFinalize // sqlite3.c:118754:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3856 /* .xValue */)) = countFinalize // sqlite3.c:118754:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3864 /* .xInverse */)) = countInverse // sqlite3.c:118754:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3912 /* .xSFunc */)) = groupConcatStep // sqlite3.c:118756:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3920 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:118756:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3928 /* .xValue */)) = groupConcatValue // sqlite3.c:118756:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3936 /* .xInverse */)) = groupConcatInverse // sqlite3.c:118756:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3984 /* .xSFunc */)) = groupConcatStep // sqlite3.c:118758:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3992 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:118758:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4000 /* .xValue */)) = groupConcatValue // sqlite3.c:118758:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4008 /* .xInverse */)) = groupConcatInverse // sqlite3.c:118758:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4040 /* .pUserData */)) = uintptr(unsafe.Pointer(&globInfo)) // sqlite3.c:118761:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4056 /* .xSFunc */)) = likeFunc // sqlite3.c:118761:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4112 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:118766:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4128 /* .xSFunc */)) = likeFunc // sqlite3.c:118766:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4184 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:118767:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4200 /* .xSFunc */)) = likeFunc // sqlite3.c:118767:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4416 /* .xSFunc */)) = versionFunc // sqlite3.c:118774:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4488 /* .xSFunc */)) = versionFunc // sqlite3.c:118775:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 8 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22903:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 24 /* .xSFunc */)) = juliandayFunc // sqlite3.c:22903:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 80 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22904:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 96 /* .xSFunc */)) = dateFunc // sqlite3.c:22904:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 152 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22905:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 168 /* .xSFunc */)) = timeFunc // sqlite3.c:22905:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 224 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22906:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 240 /* .xSFunc */)) = datetimeFunc // sqlite3.c:22906:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 296 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22907:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 312 /* .xSFunc */)) = strftimeFunc // sqlite3.c:22907:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 384 /* .xSFunc */)) = ctimeFunc // sqlite3.c:22908:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 456 /* .xSFunc */)) = ctimestampFunc // sqlite3.c:22909:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 528 /* .xSFunc */)) = cdateFunc // sqlite3.c:22910:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 16 /* .xStep */)) = jsonArrayStep // sqlite3.c:188003:7:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 24 /* .xFinal */)) = jsonArrayFinal // sqlite3.c:188003:24:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 32 /* .xValue */)) = jsonArrayValue // sqlite3.c:188003:41:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 56 /* .xStep */)) = jsonObjectStep // sqlite3.c:188005:7:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 64 /* .xFinal */)) = jsonObjectFinal // sqlite3.c:188005:24:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg)) + 72 /* .xValue */)) = jsonObjectValue // sqlite3.c:188005:41:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 0 /* .xStep */)) = geopolyBBoxStep // sqlite3.c:194216:8:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAgg1)) + 8 /* .xFinal */)) = geopolyBBoxFinal // sqlite3.c:194216:25:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 24 /* .xSFunc */)) = renameColumnFunc // sqlite3.c:107540:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 96 /* .xSFunc */)) = renameTableFunc // sqlite3.c:107541:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aAlterTableFuncs)) + 168 /* .xSFunc */)) = renameTableTest // sqlite3.c:107542:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 24 /* .xSFunc */)) = versionFunc // sqlite3.c:118977:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 96 /* .xSFunc */)) = versionFunc // sqlite3.c:118978:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 168 /* .xSFunc */)) = versionFunc // sqlite3.c:118979:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 240 /* .xSFunc */)) = soundexFunc // sqlite3.c:118985:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 312 /* .xSFunc */)) = loadExt // sqlite3.c:118988:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 384 /* .xSFunc */)) = loadExt // sqlite3.c:118989:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 456 /* .xSFunc */)) = compileoptionusedFunc // sqlite3.c:118995:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 528 /* .xSFunc */)) = compileoptiongetFunc // sqlite3.c:118996:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 600 /* .xSFunc */)) = versionFunc // sqlite3.c:118998:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 672 /* .xSFunc */)) = versionFunc // sqlite3.c:118999:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 744 /* .xSFunc */)) = versionFunc // sqlite3.c:119000:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 816 /* .xSFunc */)) = versionFunc // sqlite3.c:119002:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 888 /* .xSFunc */)) = trimFunc // sqlite3.c:119005:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 960 /* .xSFunc */)) = trimFunc // sqlite3.c:119006:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1032 /* .xSFunc */)) = trimFunc // sqlite3.c:119007:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1104 /* .xSFunc */)) = trimFunc // sqlite3.c:119008:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1176 /* .xSFunc */)) = trimFunc // sqlite3.c:119009:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1248 /* .xSFunc */)) = trimFunc // sqlite3.c:119010:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1320 /* .xSFunc */)) = minmaxFunc // sqlite3.c:119011:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1464 /* .xSFunc */)) = minmaxStep // sqlite3.c:119013:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1472 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:119013:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1480 /* .xValue */)) = minMaxValue // sqlite3.c:119013:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1536 /* .xSFunc */)) = minmaxFunc // sqlite3.c:119015:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1680 /* .xSFunc */)) = minmaxStep // sqlite3.c:119017:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1688 /* .xFinalize */)) = minMaxFinalize // sqlite3.c:119017:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1696 /* .xValue */)) = minMaxValue // sqlite3.c:119017:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1752 /* .xSFunc */)) = typeofFunc // sqlite3.c:119019:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1824 /* .xSFunc */)) = lengthFunc // sqlite3.c:119020:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1896 /* .xSFunc */)) = instrFunc // sqlite3.c:119021:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 1968 /* .xSFunc */)) = printfFunc // sqlite3.c:119022:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2040 /* .xSFunc */)) = unicodeFunc // sqlite3.c:119023:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2112 /* .xSFunc */)) = charFunc // sqlite3.c:119024:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2184 /* .xSFunc */)) = absFunc // sqlite3.c:119025:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2256 /* .xSFunc */)) = roundFunc // sqlite3.c:119027:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2328 /* .xSFunc */)) = roundFunc // sqlite3.c:119028:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2400 /* .xSFunc */)) = upperFunc // sqlite3.c:119030:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2472 /* .xSFunc */)) = lowerFunc // sqlite3.c:119031:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2544 /* .xSFunc */)) = hexFunc // sqlite3.c:119032:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2616 /* .xSFunc */)) = versionFunc // sqlite3.c:119033:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2688 /* .xSFunc */)) = randomFunc // sqlite3.c:119034:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2760 /* .xSFunc */)) = randomBlob // sqlite3.c:119035:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2832 /* .xSFunc */)) = nullifFunc // sqlite3.c:119036:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2904 /* .xSFunc */)) = versionFunc // sqlite3.c:119037:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 2976 /* .xSFunc */)) = sourceidFunc // sqlite3.c:119038:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3048 /* .xSFunc */)) = errlogFunc // sqlite3.c:119039:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3120 /* .xSFunc */)) = quoteFunc // sqlite3.c:119040:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3192 /* .xSFunc */)) = last_insert_rowid // sqlite3.c:119041:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3264 /* .xSFunc */)) = changes // sqlite3.c:119042:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3336 /* .xSFunc */)) = total_changes // sqlite3.c:119043:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3408 /* .xSFunc */)) = replaceFunc // sqlite3.c:119044:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3480 /* .xSFunc */)) = zeroblobFunc // sqlite3.c:119045:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3552 /* .xSFunc */)) = substrFunc // sqlite3.c:119046:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3624 /* .xSFunc */)) = substrFunc // sqlite3.c:119047:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3696 /* .xSFunc */)) = sumStep // sqlite3.c:119048:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3704 /* .xFinalize */)) = sumFinalize // sqlite3.c:119048:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3712 /* .xValue */)) = sumFinalize // sqlite3.c:119048:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3720 /* .xInverse */)) = sumInverse // sqlite3.c:119048:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3768 /* .xSFunc */)) = sumStep // sqlite3.c:119049:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3776 /* .xFinalize */)) = totalFinalize // sqlite3.c:119049:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3784 /* .xValue */)) = totalFinalize // sqlite3.c:119049:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3792 /* .xInverse */)) = sumInverse // sqlite3.c:119049:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3840 /* .xSFunc */)) = sumStep // sqlite3.c:119050:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3848 /* .xFinalize */)) = avgFinalize // sqlite3.c:119050:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3856 /* .xValue */)) = avgFinalize // sqlite3.c:119050:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3864 /* .xInverse */)) = sumInverse // sqlite3.c:119050:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3912 /* .xSFunc */)) = countStep // sqlite3.c:119051:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3920 /* .xFinalize */)) = countFinalize // sqlite3.c:119051:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3928 /* .xValue */)) = countFinalize // sqlite3.c:119051:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3936 /* .xInverse */)) = countInverse // sqlite3.c:119051:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3984 /* .xSFunc */)) = countStep // sqlite3.c:119053:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 3992 /* .xFinalize */)) = countFinalize // sqlite3.c:119053:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4000 /* .xValue */)) = countFinalize // sqlite3.c:119053:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4008 /* .xInverse */)) = countInverse // sqlite3.c:119053:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4056 /* .xSFunc */)) = groupConcatStep // sqlite3.c:119055:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4064 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:119055:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4072 /* .xValue */)) = groupConcatValue // sqlite3.c:119055:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4080 /* .xInverse */)) = groupConcatInverse // sqlite3.c:119055:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4128 /* .xSFunc */)) = groupConcatStep // sqlite3.c:119057:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4136 /* .xFinalize */)) = groupConcatFinalize // sqlite3.c:119057:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4144 /* .xValue */)) = groupConcatValue // sqlite3.c:119057:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4152 /* .xInverse */)) = groupConcatInverse // sqlite3.c:119057:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4184 /* .pUserData */)) = uintptr(unsafe.Pointer(&globInfo)) // sqlite3.c:119060:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4200 /* .xSFunc */)) = likeFunc // sqlite3.c:119060:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4256 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:119065:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4272 /* .xSFunc */)) = likeFunc // sqlite3.c:119065:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4328 /* .pUserData */)) = uintptr(unsafe.Pointer(&likeInfoNorm)) // sqlite3.c:119066:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4344 /* .xSFunc */)) = likeFunc // sqlite3.c:119066:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4560 /* .xSFunc */)) = versionFunc // sqlite3.c:119073:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aBuiltinFunc)) + 4632 /* .xSFunc */)) = versionFunc // sqlite3.c:119074:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 8 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22948:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 24 /* .xSFunc */)) = juliandayFunc // sqlite3.c:22948:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 80 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22949:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 96 /* .xSFunc */)) = dateFunc // sqlite3.c:22949:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 152 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22950:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 168 /* .xSFunc */)) = timeFunc // sqlite3.c:22950:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 224 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22951:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 240 /* .xSFunc */)) = datetimeFunc // sqlite3.c:22951:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 296 /* .pUserData */)) = uintptr(unsafe.Pointer(&Xsqlite3Config)) // sqlite3.c:22952:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 312 /* .xSFunc */)) = strftimeFunc // sqlite3.c:22952:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 384 /* .xSFunc */)) = ctimeFunc // sqlite3.c:22953:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 456 /* .xSFunc */)) = ctimestampFunc // sqlite3.c:22954:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aDateTimeFuncs)) + 528 /* .xSFunc */)) = cdateFunc // sqlite3.c:22955:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 16 /* .xFunc */)) = jsonRemoveFunc // sqlite3.c:187973:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 40 /* .xFunc */)) = jsonArrayFunc // sqlite3.c:187974:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 64 /* .xFunc */)) = jsonArrayLengthFunc // sqlite3.c:187975:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 88 /* .xFunc */)) = jsonArrayLengthFunc // sqlite3.c:187976:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 112 /* .xFunc */)) = jsonExtractFunc // sqlite3.c:187977:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 136 /* .xFunc */)) = jsonSetFunc // sqlite3.c:187978:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 160 /* .xFunc */)) = jsonObjectFunc // sqlite3.c:187979:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 184 /* .xFunc */)) = jsonPatchFunc // sqlite3.c:187980:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 208 /* .xFunc */)) = jsonQuoteFunc // sqlite3.c:187981:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 232 /* .xFunc */)) = jsonRemoveFunc // sqlite3.c:187982:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 256 /* .xFunc */)) = jsonReplaceFunc // sqlite3.c:187983:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 280 /* .xFunc */)) = jsonSetFunc // sqlite3.c:187984:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 304 /* .xFunc */)) = jsonTypeFunc // sqlite3.c:187985:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 328 /* .xFunc */)) = jsonTypeFunc // sqlite3.c:187986:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc)) + 352 /* .xFunc */)) = jsonValidFunc // sqlite3.c:187987:39:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 0 /* .xFunc */)) = geopolyAreaFunc // sqlite3.c:194198:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 24 /* .xFunc */)) = geopolyBlobFunc // sqlite3.c:194199:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 48 /* .xFunc */)) = geopolyJsonFunc // sqlite3.c:194200:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 72 /* .xFunc */)) = geopolySvgFunc // sqlite3.c:194201:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 96 /* .xFunc */)) = geopolyWithinFunc // sqlite3.c:194202:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 120 /* .xFunc */)) = geopolyContainsPointFunc // sqlite3.c:194203:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 144 /* .xFunc */)) = geopolyOverlapFunc // sqlite3.c:194204:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 168 /* .xFunc */)) = geopolyDebugFunc // sqlite3.c:194205:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 192 /* .xFunc */)) = geopolyBBoxFunc // sqlite3.c:194206:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 216 /* .xFunc */)) = geopolyXformFunc // sqlite3.c:194207:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 240 /* .xFunc */)) = geopolyRegularFunc // sqlite3.c:194208:8:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aFunc1)) + 264 /* .xFunc */)) = geopolyCcwFunc // sqlite3.c:194209:8:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 8 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonEachModule)) // sqlite3.c:188012:31:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aMod)) + 24 /* .pModule */)) = uintptr(unsafe.Pointer(&jsonTreeModule)) // sqlite3.c:188013:31:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 8 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, int32) int32
- }{posixOpen})) // sqlite3.c:33851:21:
- *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 32 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, int32) int32 }{crt.Xclose})) // sqlite3.c:33854:21:
+ f func(*libc.TLS, uintptr, int32, int32) int32
+ }{posixOpen})) // sqlite3.c:33936:21:
+ *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 32 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, int32) int32 }{libc.Xclose})) // sqlite3.c:33939:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 56 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32) int32
- }{crt.Xaccess})) // sqlite3.c:33857:21:
+ f func(*libc.TLS, uintptr, int32) int32
+ }{libc.Xaccess})) // sqlite3.c:33942:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 80 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, Size_t) uintptr
- }{crt.Xgetcwd})) // sqlite3.c:33860:21:
+ f func(*libc.TLS, uintptr, Size_t) uintptr
+ }{libc.Xgetcwd})) // sqlite3.c:33945:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 104 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
- }{crt.Xstat64})) // sqlite3.c:33863:21:
+ f func(*libc.TLS, uintptr, uintptr) int32
+ }{libc.Xstat64})) // sqlite3.c:33948:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 128 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr) int32
- }{crt.Xfstat64})) // sqlite3.c:33876:21:
+ f func(*libc.TLS, int32, uintptr) int32
+ }{libc.Xfstat64})) // sqlite3.c:33961:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 152 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, int64) int32
- }{crt.Xftruncate64})) // sqlite3.c:33880:21:
+ f func(*libc.TLS, int32, X__off64_t) int32
+ }{libc.Xftruncate64})) // sqlite3.c:33965:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 176 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, int32, uintptr) int32
- }{crt.Xfcntl64})) // sqlite3.c:33883:21:
+ f func(*libc.TLS, int32, int32, uintptr) int32
+ }{libc.Xfcntl64})) // sqlite3.c:33968:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 200 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr, Size_t) Ssize_t
- }{crt.Xread})) // sqlite3.c:33886:21:
+ f func(*libc.TLS, int32, uintptr, Size_t) Ssize_t
+ }{libc.Xread})) // sqlite3.c:33971:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 272 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uintptr, Size_t) Ssize_t
- }{crt.Xwrite})) // sqlite3.c:33903:21:
+ f func(*libc.TLS, int32, uintptr, Size_t) Ssize_t
+ }{libc.Xwrite})) // sqlite3.c:33988:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 344 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uint32) int32
- }{crt.Xfchmod})) // sqlite3.c:33922:21:
- *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 392 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{crt.Xunlink})) // sqlite3.c:33932:21:
+ f func(*libc.TLS, int32, X__mode_t) int32
+ }{libc.Xfchmod})) // sqlite3.c:34007:21:
+ *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 392 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{libc.Xunlink})) // sqlite3.c:34017:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 416 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
- }{openDirectory})) // sqlite3.c:33935:25:
+ f func(*libc.TLS, uintptr, uintptr) int32
+ }{openDirectory})) // sqlite3.c:34020:25:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 440 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uint32) int32
- }{crt.Xmkdir})) // sqlite3.c:33938:21:
- *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 464 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) int32 }{crt.Xrmdir})) // sqlite3.c:33941:21:
+ f func(*libc.TLS, uintptr, X__mode_t) int32
+ }{libc.Xmkdir})) // sqlite3.c:34023:21:
+ *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 464 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr) int32
+ }{libc.Xrmdir})) // sqlite3.c:34026:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 488 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32, uint32, uint32) int32
- }{crt.Xfchown})) // sqlite3.c:33945:21:
- *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 512 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) uint32 }{crt.Xgeteuid})) // sqlite3.c:33952:21:
+ f func(*libc.TLS, int32, X__uid_t, X__gid_t) int32
+ }{libc.Xfchown})) // sqlite3.c:34030:21:
+ *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 512 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) X__uid_t }{libc.Xgeteuid})) // sqlite3.c:34037:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 536 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, Size_t, int32, int32, int32, int64) uintptr
- }{crt.Xmmap64})) // sqlite3.c:33959:21:
+ f func(*libc.TLS, uintptr, Size_t, int32, int32, int32, X__off64_t) uintptr
+ }{libc.Xmmap64})) // sqlite3.c:34044:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 560 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, Size_t) int32
- }{crt.Xmunmap})) // sqlite3.c:33966:21:
- *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 608 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) int32 }{unixGetpagesize})) // sqlite3.c:33980:21:
+ f func(*libc.TLS, uintptr, Size_t) int32
+ }{libc.Xmunmap})) // sqlite3.c:34051:21:
+ *(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 608 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{unixGetpagesize})) // sqlite3.c:34065:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 632 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr, Size_t) Ssize_t
- }{crt.Xreadlink})) // sqlite3.c:33987:21:
+ f func(*libc.TLS, uintptr, uintptr, Size_t) Ssize_t
+ }{libc.Xreadlink})) // sqlite3.c:34072:21:
*(*Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aSyscall)) + 656 /* .pCurrent */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr) int32
- }{crt.Xlstat64})) // sqlite3.c:33994:22:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 32 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 40 /* .xOpen */)) = unixOpen // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 48 /* .xDelete */)) = unixDelete // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 56 /* .xAccess */)) = unixAccess // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 64 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 72 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 80 /* .xDlError */)) = unixDlError // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 88 /* .xDlSym */)) = unixDlSym // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 96 /* .xDlClose */)) = unixDlClose // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 104 /* .xRandomness */)) = unixRandomness // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 112 /* .xSleep */)) = unixSleep // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 120 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 128 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 136 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 144 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 152 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41350:5:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 160 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41350:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 200 /* .pAppData */)) = uintptr(unsafe.Pointer(&nolockIoFinder)) // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 208 /* .xOpen */)) = unixOpen // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 216 /* .xDelete */)) = unixDelete // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 224 /* .xAccess */)) = unixAccess // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 232 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 240 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 248 /* .xDlError */)) = unixDlError // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 256 /* .xDlSym */)) = unixDlSym // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 264 /* .xDlClose */)) = unixDlClose // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 272 /* .xRandomness */)) = unixRandomness // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 280 /* .xSleep */)) = unixSleep // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 288 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 296 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 304 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 312 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 320 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41352:5:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 328 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41352:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 368 /* .pAppData */)) = uintptr(unsafe.Pointer(&dotlockIoFinder)) // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 376 /* .xOpen */)) = unixOpen // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 384 /* .xDelete */)) = unixDelete // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 392 /* .xAccess */)) = unixAccess // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 400 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 408 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 416 /* .xDlError */)) = unixDlError // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 424 /* .xDlSym */)) = unixDlSym // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 432 /* .xDlClose */)) = unixDlClose // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 440 /* .xRandomness */)) = unixRandomness // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 448 /* .xSleep */)) = unixSleep // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 456 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 464 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 472 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 480 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 488 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41353:5:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 496 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41353:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 536 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 544 /* .xOpen */)) = unixOpen // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 552 /* .xDelete */)) = unixDelete // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 560 /* .xAccess */)) = unixAccess // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 568 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 576 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 584 /* .xDlError */)) = unixDlError // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 592 /* .xDlSym */)) = unixDlSym // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 600 /* .xDlClose */)) = unixDlClose // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 608 /* .xRandomness */)) = unixRandomness // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 616 /* .xSleep */)) = unixSleep // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 624 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 632 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 640 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 648 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 656 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 664 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41354:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 24 /* .xSFunc */)) = row_numberStepFunc // sqlite3.c:151140:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 32 /* .xFinalize */)) = row_numberValueFunc // sqlite3.c:151140:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 40 /* .xValue */)) = row_numberValueFunc // sqlite3.c:151140:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 48 /* .xInverse */)) = noopStepFunc // sqlite3.c:151140:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 56 /* .zName */)) = uintptr(unsafe.Pointer(&row_numberName)) // sqlite3.c:151140:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 96 /* .xSFunc */)) = dense_rankStepFunc // sqlite3.c:151141:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 104 /* .xFinalize */)) = dense_rankValueFunc // sqlite3.c:151141:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 112 /* .xValue */)) = dense_rankValueFunc // sqlite3.c:151141:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 120 /* .xInverse */)) = noopStepFunc // sqlite3.c:151141:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 128 /* .zName */)) = uintptr(unsafe.Pointer(&dense_rankName)) // sqlite3.c:151141:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 168 /* .xSFunc */)) = rankStepFunc // sqlite3.c:151142:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 176 /* .xFinalize */)) = rankValueFunc // sqlite3.c:151142:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 184 /* .xValue */)) = rankValueFunc // sqlite3.c:151142:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 192 /* .xInverse */)) = noopStepFunc // sqlite3.c:151142:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 200 /* .zName */)) = uintptr(unsafe.Pointer(&rankName)) // sqlite3.c:151142:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 240 /* .xSFunc */)) = percent_rankStepFunc // sqlite3.c:151143:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 248 /* .xFinalize */)) = percent_rankValueFunc // sqlite3.c:151143:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 256 /* .xValue */)) = percent_rankValueFunc // sqlite3.c:151143:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 264 /* .xInverse */)) = percent_rankInvFunc // sqlite3.c:151143:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 272 /* .zName */)) = uintptr(unsafe.Pointer(&percent_rankName)) // sqlite3.c:151143:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 312 /* .xSFunc */)) = cume_distStepFunc // sqlite3.c:151144:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 320 /* .xFinalize */)) = cume_distValueFunc // sqlite3.c:151144:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 328 /* .xValue */)) = cume_distValueFunc // sqlite3.c:151144:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 336 /* .xInverse */)) = cume_distInvFunc // sqlite3.c:151144:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 344 /* .zName */)) = uintptr(unsafe.Pointer(&cume_distName)) // sqlite3.c:151144:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 384 /* .xSFunc */)) = ntileStepFunc // sqlite3.c:151145:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 392 /* .xFinalize */)) = ntileValueFunc // sqlite3.c:151145:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 400 /* .xValue */)) = ntileValueFunc // sqlite3.c:151145:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 408 /* .xInverse */)) = ntileInvFunc // sqlite3.c:151145:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 416 /* .zName */)) = uintptr(unsafe.Pointer(&ntileName)) // sqlite3.c:151145:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 456 /* .xSFunc */)) = last_valueStepFunc // sqlite3.c:151146:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 464 /* .xFinalize */)) = last_valueFinalizeFunc // sqlite3.c:151146:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 472 /* .xValue */)) = last_valueValueFunc // sqlite3.c:151146:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 480 /* .xInverse */)) = last_valueInvFunc // sqlite3.c:151146:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 488 /* .zName */)) = uintptr(unsafe.Pointer(&last_valueName)) // sqlite3.c:151146:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 528 /* .xSFunc */)) = nth_valueStepFunc // sqlite3.c:151147:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 536 /* .xFinalize */)) = nth_valueFinalizeFunc // sqlite3.c:151147:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 544 /* .xValue */)) = noopValueFunc // sqlite3.c:151147:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 552 /* .xInverse */)) = noopStepFunc // sqlite3.c:151147:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 560 /* .zName */)) = uintptr(unsafe.Pointer(&nth_valueName)) // sqlite3.c:151147:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 600 /* .xSFunc */)) = first_valueStepFunc // sqlite3.c:151148:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 608 /* .xFinalize */)) = first_valueFinalizeFunc // sqlite3.c:151148:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 616 /* .xValue */)) = noopValueFunc // sqlite3.c:151148:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 624 /* .xInverse */)) = noopStepFunc // sqlite3.c:151148:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 632 /* .zName */)) = uintptr(unsafe.Pointer(&first_valueName)) // sqlite3.c:151148:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 672 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151149:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 680 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151149:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 688 /* .xValue */)) = noopValueFunc // sqlite3.c:151149:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 696 /* .xInverse */)) = noopStepFunc // sqlite3.c:151149:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 704 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:151149:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 744 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151150:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 752 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151150:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 760 /* .xValue */)) = noopValueFunc // sqlite3.c:151150:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 768 /* .xInverse */)) = noopStepFunc // sqlite3.c:151150:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 776 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:151150:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 816 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151151:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 824 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151151:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 832 /* .xValue */)) = noopValueFunc // sqlite3.c:151151:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 840 /* .xInverse */)) = noopStepFunc // sqlite3.c:151151:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 848 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:151151:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 888 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151152:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 896 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151152:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 904 /* .xValue */)) = noopValueFunc // sqlite3.c:151152:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 912 /* .xInverse */)) = noopStepFunc // sqlite3.c:151152:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 920 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:151152:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 960 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151153:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 968 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151153:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 976 /* .xValue */)) = noopValueFunc // sqlite3.c:151153:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 984 /* .xInverse */)) = noopStepFunc // sqlite3.c:151153:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 992 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:151153:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1032 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151154:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1040 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151154:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1048 /* .xValue */)) = noopValueFunc // sqlite3.c:151154:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1056 /* .xInverse */)) = noopStepFunc // sqlite3.c:151154:5:
- *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1064 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:151154:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&attach_func)) + 24 /* .xSFunc */)) = attachFunc // sqlite3.c:109670:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 16 /* .xConnect */)) = bytecodevtabConnect // sqlite3.c:96823:21:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 24 /* .xBestIndex */)) = bytecodevtabBestIndex // sqlite3.c:96824:21:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 32 /* .xDisconnect */)) = bytecodevtabDisconnect // sqlite3.c:96825:21:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 48 /* .xOpen */)) = bytecodevtabOpen // sqlite3.c:96827:21:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 56 /* .xClose */)) = bytecodevtabClose // sqlite3.c:96828:21:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 64 /* .xFilter */)) = bytecodevtabFilter // sqlite3.c:96829:21:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 72 /* .xNext */)) = bytecodevtabNext // sqlite3.c:96830:21:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 80 /* .xEof */)) = bytecodevtabEof // sqlite3.c:96831:21:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 88 /* .xColumn */)) = bytecodevtabColumn // sqlite3.c:96832:21:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 96 /* .xRowid */)) = bytecodevtabRowid // sqlite3.c:96833:21:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 8 /* .xCreate */)) = dbpageConnect // sqlite3.c:201682:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 16 /* .xConnect */)) = dbpageConnect // sqlite3.c:201683:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 24 /* .xBestIndex */)) = dbpageBestIndex // sqlite3.c:201684:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 32 /* .xDisconnect */)) = dbpageDisconnect // sqlite3.c:201685:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 40 /* .xDestroy */)) = dbpageDisconnect // sqlite3.c:201686:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 48 /* .xOpen */)) = dbpageOpen // sqlite3.c:201687:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 56 /* .xClose */)) = dbpageClose // sqlite3.c:201688:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 64 /* .xFilter */)) = dbpageFilter // sqlite3.c:201689:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 72 /* .xNext */)) = dbpageNext // sqlite3.c:201690:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 80 /* .xEof */)) = dbpageEof // sqlite3.c:201691:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 88 /* .xColumn */)) = dbpageColumn // sqlite3.c:201692:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 96 /* .xRowid */)) = dbpageRowid // sqlite3.c:201693:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 104 /* .xUpdate */)) = dbpageUpdate // sqlite3.c:201694:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 112 /* .xBegin */)) = dbpageBegin // sqlite3.c:201695:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 8 /* .xCreate */)) = statConnect // sqlite3.c:201263:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 16 /* .xConnect */)) = statConnect // sqlite3.c:201264:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 24 /* .xBestIndex */)) = statBestIndex // sqlite3.c:201265:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 32 /* .xDisconnect */)) = statDisconnect // sqlite3.c:201266:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 40 /* .xDestroy */)) = statDisconnect // sqlite3.c:201267:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 48 /* .xOpen */)) = statOpen // sqlite3.c:201268:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 56 /* .xClose */)) = statClose // sqlite3.c:201269:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 64 /* .xFilter */)) = statFilter // sqlite3.c:201270:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 72 /* .xNext */)) = statNext // sqlite3.c:201271:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 80 /* .xEof */)) = statEof // sqlite3.c:201272:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 88 /* .xColumn */)) = statColumn // sqlite3.c:201273:5:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 96 /* .xRowid */)) = statRowid // sqlite3.c:201274:5:
- *(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 0 /* .xMalloc */)) = sqlite3MemMalloc // sqlite3.c:23786:6:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 8 /* .xFree */)) = sqlite3MemFree // sqlite3.c:23787:6:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 16 /* .xRealloc */)) = sqlite3MemRealloc // sqlite3.c:23788:6:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 24 /* .xSize */)) = sqlite3MemSize // sqlite3.c:23789:6:
- *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 32 /* .xRoundup */)) = sqlite3MemRoundup // sqlite3.c:23790:6:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 40 /* .xInit */)) = sqlite3MemInit // sqlite3.c:23791:6:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 48 /* .xShutdown */)) = sqlite3MemShutdown // sqlite3.c:23792:6:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 16 /* .xInit */)) = pcache1Init // sqlite3.c:50868:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 24 /* .xShutdown */)) = pcache1Shutdown // sqlite3.c:50869:5:
- *(*func(*crt.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 32 /* .xCreate */)) = pcache1Create // sqlite3.c:50870:5:
- *(*func(*crt.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 40 /* .xCachesize */)) = pcache1Cachesize // sqlite3.c:50871:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 48 /* .xPagecount */)) = pcache1Pagecount // sqlite3.c:50872:5:
- *(*func(*crt.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 56 /* .xFetch */)) = pcache1Fetch // sqlite3.c:50873:5:
- *(*func(*crt.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 64 /* .xUnpin */)) = pcache1Unpin // sqlite3.c:50874:5:
- *(*func(*crt.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 72 /* .xRekey */)) = pcache1Rekey // sqlite3.c:50875:5:
- *(*func(*crt.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 80 /* .xTruncate */)) = pcache1Truncate // sqlite3.c:50876:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 88 /* .xDestroy */)) = pcache1Destroy // sqlite3.c:50877:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 96 /* .xShrink */)) = pcache1Shrink // sqlite3.c:50878:5:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&detach_func)) + 24 /* .xSFunc */)) = detachFunc // sqlite3.c:109650:5:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoFinder)) + 0)) = dotlockIoFinderImpl // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 8 /* .xClose */)) = dotlockClose // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 56 /* .xLock */)) = dotlockLock // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 64 /* .xUnlock */)) = dotlockUnlock // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 72 /* .xCheckReservedLock */)) = dotlockCheckReservedLock // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:38782:1:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 8 /* .xClose */)) = memdbClose // sqlite3.c:47853:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 16 /* .xRead */)) = memdbRead // sqlite3.c:47854:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 24 /* .xWrite */)) = memdbWrite // sqlite3.c:47855:3:
- *(*func(*crt.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 32 /* .xTruncate */)) = memdbTruncate // sqlite3.c:47856:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 40 /* .xSync */)) = memdbSync // sqlite3.c:47857:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 48 /* .xFileSize */)) = memdbFileSize // sqlite3.c:47858:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 56 /* .xLock */)) = memdbLock // sqlite3.c:47859:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 64 /* .xUnlock */)) = memdbLock // sqlite3.c:47860:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 80 /* .xFileControl */)) = memdbFileControl // sqlite3.c:47862:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 96 /* .xDeviceCharacteristics */)) = memdbDeviceCharacteristics // sqlite3.c:47864:3:
- *(*func(*crt.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 136 /* .xFetch */)) = memdbFetch // sqlite3.c:47869:3:
- *(*func(*crt.TLS, uintptr, Sqlite3_int64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 144 /* .xUnfetch */)) = memdbUnfetch // sqlite3.c:47870:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 40 /* .xOpen */)) = memdbOpen // sqlite3.c:47836:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 56 /* .xAccess */)) = memdbAccess // sqlite3.c:47838:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 64 /* .xFullPathname */)) = memdbFullPathname // sqlite3.c:47839:3:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 72 /* .xDlOpen */)) = memdbDlOpen // sqlite3.c:47840:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 80 /* .xDlError */)) = memdbDlError // sqlite3.c:47841:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 88 /* .xDlSym */)) = memdbDlSym // sqlite3.c:47842:3:
- *(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 96 /* .xDlClose */)) = memdbDlClose // sqlite3.c:47843:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 104 /* .xRandomness */)) = memdbRandomness // sqlite3.c:47844:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 112 /* .xSleep */)) = memdbSleep // sqlite3.c:47845:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 128 /* .xGetLastError */)) = memdbGetLastError // sqlite3.c:47847:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 136 /* .xCurrentTimeInt64 */)) = memdbCurrentTimeInt64 // sqlite3.c:47848:3:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoFinder)) + 0)) = nolockIoFinderImpl // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 8 /* .xClose */)) = nolockClose // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 56 /* .xLock */)) = nolockLock // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 64 /* .xUnlock */)) = nolockUnlock // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 72 /* .xCheckReservedLock */)) = nolockCheckReservedLock // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:38772:1:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoFinder)) + 0)) = posixIoFinderImpl // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 8 /* .xClose */)) = unixClose // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 56 /* .xLock */)) = unixLock // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 64 /* .xUnlock */)) = unixUnlock // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 72 /* .xCheckReservedLock */)) = unixCheckReservedLock // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 104 /* .xShmMap */)) = unixShmMap // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:38762:1:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 16 /* .xConnect */)) = pragmaVtabConnect // sqlite3.c:127965:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 24 /* .xBestIndex */)) = pragmaVtabBestIndex // sqlite3.c:127966:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 32 /* .xDisconnect */)) = pragmaVtabDisconnect // sqlite3.c:127967:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 48 /* .xOpen */)) = pragmaVtabOpen // sqlite3.c:127969:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 56 /* .xClose */)) = pragmaVtabClose // sqlite3.c:127970:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 64 /* .xFilter */)) = pragmaVtabFilter // sqlite3.c:127971:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 72 /* .xNext */)) = pragmaVtabNext // sqlite3.c:127972:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 80 /* .xEof */)) = pragmaVtabEof // sqlite3.c:127973:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 88 /* .xColumn */)) = pragmaVtabColumn // sqlite3.c:127974:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 96 /* .xRowid */)) = pragmaVtabRowid // sqlite3.c:127975:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 8 /* .xClose */)) = memjrnlClose // sqlite3.c:97173:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 16 /* .xRead */)) = memjrnlRead // sqlite3.c:97174:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 24 /* .xWrite */)) = memjrnlWrite // sqlite3.c:97175:3:
- *(*func(*crt.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 32 /* .xTruncate */)) = memjrnlTruncate // sqlite3.c:97176:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 40 /* .xSync */)) = memjrnlSync // sqlite3.c:97177:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 48 /* .xFileSize */)) = memjrnlFileSize // sqlite3.c:97178:3:
- *(*func(*crt.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 0 /* .xMutexInit */)) = noopMutexInit // sqlite3.c:26019:5:
- *(*func(*crt.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 8 /* .xMutexEnd */)) = noopMutexEnd // sqlite3.c:26020:5:
- *(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 16 /* .xMutexAlloc */)) = noopMutexAlloc // sqlite3.c:26021:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 24 /* .xMutexFree */)) = noopMutexFree // sqlite3.c:26022:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 32 /* .xMutexEnter */)) = noopMutexEnter // sqlite3.c:26023:5:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 40 /* .xMutexTry */)) = noopMutexTry // sqlite3.c:26024:5:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 48 /* .xMutexLeave */)) = noopMutexLeave // sqlite3.c:26025:5:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 0 /* .aggregate_context */)) = Xsqlite3_aggregate_context // sqlite3.c:124072:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 8 /* .aggregate_count */)) = Xsqlite3_aggregate_count // sqlite3.c:124074:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 16 /* .bind_blob */)) = Xsqlite3_bind_blob // sqlite3.c:124078:3:
- *(*func(*crt.TLS, uintptr, int32, float64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 24 /* .bind_double */)) = Xsqlite3_bind_double // sqlite3.c:124079:3:
- *(*func(*crt.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 32 /* .bind_int */)) = Xsqlite3_bind_int // sqlite3.c:124080:3:
- *(*func(*crt.TLS, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 40 /* .bind_int64 */)) = Xsqlite3_bind_int64 // sqlite3.c:124081:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 48 /* .bind_null */)) = Xsqlite3_bind_null // sqlite3.c:124082:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 56 /* .bind_parameter_count */)) = Xsqlite3_bind_parameter_count // sqlite3.c:124083:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 64 /* .bind_parameter_index */)) = Xsqlite3_bind_parameter_index // sqlite3.c:124084:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 72 /* .bind_parameter_name */)) = Xsqlite3_bind_parameter_name // sqlite3.c:124085:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 80 /* .bind_text */)) = Xsqlite3_bind_text // sqlite3.c:124086:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 88 /* .bind_text16 */)) = Xsqlite3_bind_text16 // sqlite3.c:124087:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 96 /* .bind_value */)) = Xsqlite3_bind_value // sqlite3.c:124088:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 104 /* .busy_handler */)) = Xsqlite3_busy_handler // sqlite3.c:124089:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 112 /* .busy_timeout */)) = Xsqlite3_busy_timeout // sqlite3.c:124090:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 120 /* .changes */)) = Xsqlite3_changes // sqlite3.c:124091:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 128 /* .close */)) = Xsqlite3_close // sqlite3.c:124092:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 136 /* .collation_needed */)) = Xsqlite3_collation_needed // sqlite3.c:124093:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 144 /* .collation_needed16 */)) = Xsqlite3_collation_needed16 // sqlite3.c:124094:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 152 /* .column_blob */)) = Xsqlite3_column_blob // sqlite3.c:124095:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 160 /* .column_bytes */)) = Xsqlite3_column_bytes // sqlite3.c:124096:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 168 /* .column_bytes16 */)) = Xsqlite3_column_bytes16 // sqlite3.c:124097:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 176 /* .column_count */)) = Xsqlite3_column_count // sqlite3.c:124098:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 200 /* .column_decltype */)) = Xsqlite3_column_decltype // sqlite3.c:124101:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 208 /* .column_decltype16 */)) = Xsqlite3_column_decltype16 // sqlite3.c:124102:3:
- *(*func(*crt.TLS, uintptr, int32) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 216 /* .column_double */)) = Xsqlite3_column_double // sqlite3.c:124103:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 224 /* .column_int */)) = Xsqlite3_column_int // sqlite3.c:124104:3:
- *(*func(*crt.TLS, uintptr, int32) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 232 /* .column_int64 */)) = Xsqlite3_column_int64 // sqlite3.c:124105:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 240 /* .column_name */)) = Xsqlite3_column_name // sqlite3.c:124106:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 248 /* .column_name16 */)) = Xsqlite3_column_name16 // sqlite3.c:124107:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 288 /* .column_text */)) = Xsqlite3_column_text // sqlite3.c:124112:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 296 /* .column_text16 */)) = Xsqlite3_column_text16 // sqlite3.c:124113:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 304 /* .column_type */)) = Xsqlite3_column_type // sqlite3.c:124114:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 312 /* .column_value */)) = Xsqlite3_column_value // sqlite3.c:124115:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 320 /* .commit_hook */)) = Xsqlite3_commit_hook // sqlite3.c:124116:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 328 /* .complete */)) = Xsqlite3_complete // sqlite3.c:124117:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 336 /* .complete16 */)) = Xsqlite3_complete16 // sqlite3.c:124118:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 344 /* .create_collation */)) = Xsqlite3_create_collation // sqlite3.c:124119:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 352 /* .create_collation16 */)) = Xsqlite3_create_collation16 // sqlite3.c:124120:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 360 /* .create_function */)) = Xsqlite3_create_function // sqlite3.c:124121:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 368 /* .create_function16 */)) = Xsqlite3_create_function16 // sqlite3.c:124122:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 376 /* .create_module */)) = Xsqlite3_create_module // sqlite3.c:124123:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 384 /* .data_count */)) = Xsqlite3_data_count // sqlite3.c:124124:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 392 /* .db_handle */)) = Xsqlite3_db_handle // sqlite3.c:124125:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 400 /* .declare_vtab */)) = Xsqlite3_declare_vtab // sqlite3.c:124126:3:
- *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 408 /* .enable_shared_cache */)) = Xsqlite3_enable_shared_cache // sqlite3.c:124127:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 416 /* .errcode */)) = Xsqlite3_errcode // sqlite3.c:124128:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 424 /* .errmsg */)) = Xsqlite3_errmsg // sqlite3.c:124129:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 432 /* .errmsg16 */)) = Xsqlite3_errmsg16 // sqlite3.c:124130:3:
- *(*func(*crt.TLS, uintptr, uintptr, Sqlite3_callback, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 440 /* .exec */)) = Xsqlite3_exec // sqlite3.c:124131:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 448 /* .expired */)) = Xsqlite3_expired // sqlite3.c:124133:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 456 /* .finalize */)) = Xsqlite3_finalize // sqlite3.c:124137:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 464 /* .free */)) = Xsqlite3_free // sqlite3.c:124138:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 472 /* .free_table */)) = Xsqlite3_free_table // sqlite3.c:124139:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 480 /* .get_autocommit */)) = Xsqlite3_get_autocommit // sqlite3.c:124140:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 488 /* .get_auxdata */)) = Xsqlite3_get_auxdata // sqlite3.c:124141:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 496 /* .get_table */)) = Xsqlite3_get_table // sqlite3.c:124142:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 512 /* .interruptx */)) = Xsqlite3_interrupt // sqlite3.c:124144:3:
- *(*func(*crt.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 520 /* .last_insert_rowid */)) = Xsqlite3_last_insert_rowid // sqlite3.c:124145:3:
- *(*func(*crt.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 528 /* .libversion */)) = Xsqlite3_libversion // sqlite3.c:124146:3:
- *(*func(*crt.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 536 /* .libversion_number */)) = Xsqlite3_libversion_number // sqlite3.c:124147:3:
- *(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 544 /* .malloc */)) = Xsqlite3_malloc // sqlite3.c:124148:3:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 552 /* .mprintf */)) = Xsqlite3_mprintf // sqlite3.c:124149:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 560 /* .open64 */)) = Xsqlite3_open // sqlite3.c:124150:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 568 /* .open16 */)) = Xsqlite3_open16 // sqlite3.c:124151:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 576 /* .prepare */)) = Xsqlite3_prepare // sqlite3.c:124152:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 584 /* .prepare16 */)) = Xsqlite3_prepare16 // sqlite3.c:124153:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 592 /* .profile */)) = Xsqlite3_profile // sqlite3.c:124154:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 600 /* .progress_handler */)) = Xsqlite3_progress_handler // sqlite3.c:124155:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 608 /* .realloc */)) = Xsqlite3_realloc // sqlite3.c:124156:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 616 /* .reset */)) = Xsqlite3_reset // sqlite3.c:124157:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 624 /* .result_blob */)) = Xsqlite3_result_blob // sqlite3.c:124158:3:
- *(*func(*crt.TLS, uintptr, float64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 632 /* .result_double */)) = Xsqlite3_result_double // sqlite3.c:124159:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 640 /* .result_error */)) = Xsqlite3_result_error // sqlite3.c:124160:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 648 /* .result_error16 */)) = Xsqlite3_result_error16 // sqlite3.c:124161:3:
- *(*func(*crt.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 656 /* .result_int */)) = Xsqlite3_result_int // sqlite3.c:124162:3:
- *(*func(*crt.TLS, uintptr, I64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 664 /* .result_int64 */)) = Xsqlite3_result_int64 // sqlite3.c:124163:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 672 /* .result_null */)) = Xsqlite3_result_null // sqlite3.c:124164:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 680 /* .result_text */)) = Xsqlite3_result_text // sqlite3.c:124165:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 688 /* .result_text16 */)) = Xsqlite3_result_text16 // sqlite3.c:124166:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 696 /* .result_text16be */)) = Xsqlite3_result_text16be // sqlite3.c:124167:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 704 /* .result_text16le */)) = Xsqlite3_result_text16le // sqlite3.c:124168:3:
- *(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 712 /* .result_value */)) = Xsqlite3_result_value // sqlite3.c:124169:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 720 /* .rollback_hook */)) = Xsqlite3_rollback_hook // sqlite3.c:124170:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 728 /* .set_authorizer */)) = Xsqlite3_set_authorizer // sqlite3.c:124171:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 736 /* .set_auxdata */)) = Xsqlite3_set_auxdata // sqlite3.c:124172:3:
- *(*func(*crt.TLS, int32, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 744 /* .xsnprintf */)) = Xsqlite3_snprintf // sqlite3.c:124173:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 752 /* .step */)) = Xsqlite3_step // sqlite3.c:124174:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 760 /* .table_column_metadata */)) = Xsqlite3_table_column_metadata // sqlite3.c:124175:3:
- *(*func(*crt.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 768 /* .thread_cleanup */)) = Xsqlite3_thread_cleanup // sqlite3.c:124177:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 776 /* .total_changes */)) = Xsqlite3_total_changes // sqlite3.c:124181:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 784 /* .trace */)) = Xsqlite3_trace // sqlite3.c:124182:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 792 /* .transfer_bindings */)) = Xsqlite3_transfer_bindings // sqlite3.c:124184:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 800 /* .update_hook */)) = Xsqlite3_update_hook // sqlite3.c:124188:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 808 /* .user_data */)) = Xsqlite3_user_data // sqlite3.c:124189:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 816 /* .value_blob */)) = Xsqlite3_value_blob // sqlite3.c:124190:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 824 /* .value_bytes */)) = Xsqlite3_value_bytes // sqlite3.c:124191:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 832 /* .value_bytes16 */)) = Xsqlite3_value_bytes16 // sqlite3.c:124192:3:
- *(*func(*crt.TLS, uintptr) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 840 /* .value_double */)) = Xsqlite3_value_double // sqlite3.c:124193:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 848 /* .value_int */)) = Xsqlite3_value_int // sqlite3.c:124194:3:
- *(*func(*crt.TLS, uintptr) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 856 /* .value_int64 */)) = Xsqlite3_value_int64 // sqlite3.c:124195:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 864 /* .value_numeric_type */)) = Xsqlite3_value_numeric_type // sqlite3.c:124196:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 872 /* .value_text */)) = Xsqlite3_value_text // sqlite3.c:124197:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 880 /* .value_text16 */)) = Xsqlite3_value_text16 // sqlite3.c:124198:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 888 /* .value_text16be */)) = Xsqlite3_value_text16be // sqlite3.c:124199:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 896 /* .value_text16le */)) = Xsqlite3_value_text16le // sqlite3.c:124200:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 904 /* .value_type */)) = Xsqlite3_value_type // sqlite3.c:124201:3:
- *(*func(*crt.TLS, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 912 /* .vmprintf */)) = Xsqlite3_vmprintf // sqlite3.c:124202:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 920 /* .overload_function */)) = Xsqlite3_overload_function // sqlite3.c:124211:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 928 /* .prepare_v2 */)) = Xsqlite3_prepare_v2 // sqlite3.c:124216:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 936 /* .prepare16_v2 */)) = Xsqlite3_prepare16_v2 // sqlite3.c:124217:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 944 /* .clear_bindings */)) = Xsqlite3_clear_bindings // sqlite3.c:124218:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 952 /* .create_module_v2 */)) = Xsqlite3_create_module_v2 // sqlite3.c:124223:3:
- *(*func(*crt.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 960 /* .bind_zeroblob */)) = Xsqlite3_bind_zeroblob // sqlite3.c:124228:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 968 /* .blob_bytes */)) = Xsqlite3_blob_bytes // sqlite3.c:124229:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 976 /* .blob_close */)) = Xsqlite3_blob_close // sqlite3.c:124230:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, uintptr, Sqlite_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 984 /* .blob_open */)) = Xsqlite3_blob_open // sqlite3.c:124231:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 992 /* .blob_read */)) = Xsqlite3_blob_read // sqlite3.c:124232:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1000 /* .blob_write */)) = Xsqlite3_blob_write // sqlite3.c:124233:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1008 /* .create_collation_v2 */)) = Xsqlite3_create_collation_v2 // sqlite3.c:124234:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1016 /* .file_control */)) = Xsqlite3_file_control // sqlite3.c:124235:3:
- *(*func(*crt.TLS, int32) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1024 /* .memory_highwater */)) = Xsqlite3_memory_highwater // sqlite3.c:124236:3:
- *(*func(*crt.TLS) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1032 /* .memory_used */)) = Xsqlite3_memory_used // sqlite3.c:124237:3:
- *(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1040 /* .mutex_alloc */)) = Xsqlite3_mutex_alloc // sqlite3.c:124245:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1048 /* .mutex_enter */)) = Xsqlite3_mutex_enter // sqlite3.c:124246:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1056 /* .mutex_free */)) = Xsqlite3_mutex_free // sqlite3.c:124247:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1064 /* .mutex_leave */)) = Xsqlite3_mutex_leave // sqlite3.c:124248:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1072 /* .mutex_try */)) = Xsqlite3_mutex_try // sqlite3.c:124249:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1080 /* .open_v2 */)) = Xsqlite3_open_v2 // sqlite3.c:124251:3:
- *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1088 /* .release_memory */)) = Xsqlite3_release_memory // sqlite3.c:124252:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1096 /* .result_error_nomem */)) = Xsqlite3_result_error_nomem // sqlite3.c:124253:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1104 /* .result_error_toobig */)) = Xsqlite3_result_error_toobig // sqlite3.c:124254:3:
- *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1112 /* .sleep */)) = Xsqlite3_sleep // sqlite3.c:124255:3:
- *(*func(*crt.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1120 /* .soft_heap_limit */)) = Xsqlite3_soft_heap_limit // sqlite3.c:124256:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1128 /* .vfs_find */)) = Xsqlite3_vfs_find // sqlite3.c:124257:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1136 /* .vfs_register */)) = Xsqlite3_vfs_register // sqlite3.c:124258:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1144 /* .vfs_unregister */)) = Xsqlite3_vfs_unregister // sqlite3.c:124259:3:
- *(*func(*crt.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1152 /* .xthreadsafe */)) = Xsqlite3_threadsafe // sqlite3.c:124264:3:
- *(*func(*crt.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1160 /* .result_zeroblob */)) = Xsqlite3_result_zeroblob // sqlite3.c:124265:3:
- *(*func(*crt.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1168 /* .result_error_code */)) = Xsqlite3_result_error_code // sqlite3.c:124266:3:
- *(*func(*crt.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1176 /* .test_control */)) = Xsqlite3_test_control // sqlite3.c:124267:3:
- *(*func(*crt.TLS, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1184 /* .randomness */)) = Xsqlite3_randomness // sqlite3.c:124268:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1192 /* .context_db_handle */)) = Xsqlite3_context_db_handle // sqlite3.c:124269:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1200 /* .extended_result_codes */)) = Xsqlite3_extended_result_codes // sqlite3.c:124274:3:
- *(*func(*crt.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1208 /* .limit */)) = Xsqlite3_limit // sqlite3.c:124275:3:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1216 /* .next_stmt */)) = Xsqlite3_next_stmt // sqlite3.c:124276:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1224 /* .sql */)) = Xsqlite3_sql // sqlite3.c:124277:3:
- *(*func(*crt.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1232 /* .status */)) = Xsqlite3_status // sqlite3.c:124278:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1240 /* .backup_finish */)) = Xsqlite3_backup_finish // sqlite3.c:124283:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1248 /* .backup_init */)) = Xsqlite3_backup_init // sqlite3.c:124284:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1256 /* .backup_pagecount */)) = Xsqlite3_backup_pagecount // sqlite3.c:124285:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1264 /* .backup_remaining */)) = Xsqlite3_backup_remaining // sqlite3.c:124286:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1272 /* .backup_step */)) = Xsqlite3_backup_step // sqlite3.c:124287:3:
- *(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1280 /* .compileoption_get */)) = Xsqlite3_compileoption_get // sqlite3.c:124289:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1288 /* .compileoption_used */)) = Xsqlite3_compileoption_used // sqlite3.c:124290:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1296 /* .create_function_v2 */)) = Xsqlite3_create_function_v2 // sqlite3.c:124295:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1304 /* .db_config */)) = Xsqlite3_db_config // sqlite3.c:124296:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1312 /* .db_mutex */)) = Xsqlite3_db_mutex // sqlite3.c:124297:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1320 /* .db_status */)) = Xsqlite3_db_status // sqlite3.c:124298:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1328 /* .extended_errcode */)) = Xsqlite3_extended_errcode // sqlite3.c:124299:3:
- *(*func(*crt.TLS, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1336 /* .log */)) = Xsqlite3_log // sqlite3.c:124300:3:
- *(*func(*crt.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1344 /* .soft_heap_limit64 */)) = Xsqlite3_soft_heap_limit64 // sqlite3.c:124301:3:
- *(*func(*crt.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1352 /* .sourceid */)) = Xsqlite3_sourceid // sqlite3.c:124302:3:
- *(*func(*crt.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1360 /* .stmt_status */)) = Xsqlite3_stmt_status // sqlite3.c:124303:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1368 /* .strnicmp */)) = Xsqlite3_strnicmp // sqlite3.c:124304:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1376 /* .unlock_notify */)) = Xsqlite3_unlock_notify // sqlite3.c:124306:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1384 /* .wal_autocheckpoint */)) = Xsqlite3_wal_autocheckpoint // sqlite3.c:124311:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1392 /* .wal_checkpoint */)) = Xsqlite3_wal_checkpoint // sqlite3.c:124312:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1400 /* .wal_hook */)) = Xsqlite3_wal_hook // sqlite3.c:124313:3:
- *(*func(*crt.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1408 /* .blob_reopen */)) = Xsqlite3_blob_reopen // sqlite3.c:124319:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1416 /* .vtab_config */)) = Xsqlite3_vtab_config // sqlite3.c:124320:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1424 /* .vtab_on_conflict */)) = Xsqlite3_vtab_on_conflict // sqlite3.c:124321:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1432 /* .close_v2 */)) = Xsqlite3_close_v2 // sqlite3.c:124322:3:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1440 /* .db_filename */)) = Xsqlite3_db_filename // sqlite3.c:124323:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1448 /* .db_readonly */)) = Xsqlite3_db_readonly // sqlite3.c:124324:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1456 /* .db_release_memory */)) = Xsqlite3_db_release_memory // sqlite3.c:124325:3:
- *(*func(*crt.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1464 /* .errstr */)) = Xsqlite3_errstr // sqlite3.c:124326:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1472 /* .stmt_busy */)) = Xsqlite3_stmt_busy // sqlite3.c:124327:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1480 /* .stmt_readonly */)) = Xsqlite3_stmt_readonly // sqlite3.c:124328:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1488 /* .stricmp */)) = Xsqlite3_stricmp // sqlite3.c:124329:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1496 /* .uri_boolean */)) = Xsqlite3_uri_boolean // sqlite3.c:124330:3:
- *(*func(*crt.TLS, uintptr, uintptr, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1504 /* .uri_int64 */)) = Xsqlite3_uri_int64 // sqlite3.c:124331:3:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1512 /* .uri_parameter */)) = Xsqlite3_uri_parameter // sqlite3.c:124332:3:
- *(*func(*crt.TLS, int32, uintptr, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1520 /* .xvsnprintf */)) = Xsqlite3_vsnprintf // sqlite3.c:124333:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1528 /* .wal_checkpoint_v2 */)) = Xsqlite3_wal_checkpoint_v2 // sqlite3.c:124334:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1536 /* .auto_extension */)) = Xsqlite3_auto_extension // sqlite3.c:124336:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1544 /* .bind_blob64 */)) = Xsqlite3_bind_blob64 // sqlite3.c:124337:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr, uint8) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1552 /* .bind_text64 */)) = Xsqlite3_bind_text64 // sqlite3.c:124338:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1560 /* .cancel_auto_extension */)) = Xsqlite3_cancel_auto_extension // sqlite3.c:124339:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1568 /* .load_extension */)) = Xsqlite3_load_extension // sqlite3.c:124340:3:
- *(*func(*crt.TLS, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1576 /* .malloc64 */)) = Xsqlite3_malloc64 // sqlite3.c:124341:3:
- *(*func(*crt.TLS, uintptr) Sqlite3_uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1584 /* .msize */)) = Xsqlite3_msize // sqlite3.c:124342:3:
- *(*func(*crt.TLS, uintptr, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1592 /* .realloc64 */)) = Xsqlite3_realloc64 // sqlite3.c:124343:3:
- *(*func(*crt.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1600 /* .reset_auto_extension */)) = Xsqlite3_reset_auto_extension // sqlite3.c:124344:3:
- *(*func(*crt.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1608 /* .result_blob64 */)) = Xsqlite3_result_blob64 // sqlite3.c:124345:3:
- *(*func(*crt.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr, uint8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1616 /* .result_text64 */)) = Xsqlite3_result_text64 // sqlite3.c:124346:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1624 /* .strglob */)) = Xsqlite3_strglob // sqlite3.c:124347:3:
+ f func(*libc.TLS, uintptr, uintptr) int32
+ }{libc.Xlstat64})) // sqlite3.c:34079:22:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 32 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 40 /* .xOpen */)) = unixOpen // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 48 /* .xDelete */)) = unixDelete // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 56 /* .xAccess */)) = unixAccess // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 64 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 72 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 80 /* .xDlError */)) = unixDlError // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 88 /* .xDlSym */)) = unixDlSym // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 96 /* .xDlClose */)) = unixDlClose // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 104 /* .xRandomness */)) = unixRandomness // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 112 /* .xSleep */)) = unixSleep // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 120 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 128 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 136 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 144 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 152 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41438:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 160 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41438:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 200 /* .pAppData */)) = uintptr(unsafe.Pointer(&nolockIoFinder)) // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 208 /* .xOpen */)) = unixOpen // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 216 /* .xDelete */)) = unixDelete // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 224 /* .xAccess */)) = unixAccess // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 232 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 240 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 248 /* .xDlError */)) = unixDlError // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 256 /* .xDlSym */)) = unixDlSym // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 264 /* .xDlClose */)) = unixDlClose // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 272 /* .xRandomness */)) = unixRandomness // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 280 /* .xSleep */)) = unixSleep // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 288 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 296 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 304 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 312 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 320 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41440:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 328 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41440:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 368 /* .pAppData */)) = uintptr(unsafe.Pointer(&dotlockIoFinder)) // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 376 /* .xOpen */)) = unixOpen // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 384 /* .xDelete */)) = unixDelete // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 392 /* .xAccess */)) = unixAccess // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 400 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 408 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 416 /* .xDlError */)) = unixDlError // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 424 /* .xDlSym */)) = unixDlSym // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 432 /* .xDlClose */)) = unixDlClose // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 440 /* .xRandomness */)) = unixRandomness // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 448 /* .xSleep */)) = unixSleep // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 456 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 464 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 472 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 480 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 488 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41441:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 496 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41441:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 536 /* .pAppData */)) = uintptr(unsafe.Pointer(&posixIoFinder)) // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 544 /* .xOpen */)) = unixOpen // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 552 /* .xDelete */)) = unixDelete // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 560 /* .xAccess */)) = unixAccess // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 568 /* .xFullPathname */)) = unixFullPathname // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 576 /* .xDlOpen */)) = unixDlOpen // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 584 /* .xDlError */)) = unixDlError // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 592 /* .xDlSym */)) = unixDlSym // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 600 /* .xDlClose */)) = unixDlClose // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 608 /* .xRandomness */)) = unixRandomness // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 616 /* .xSleep */)) = unixSleep // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 624 /* .xCurrentTime */)) = unixCurrentTime // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 632 /* .xGetLastError */)) = unixGetLastError // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 640 /* .xCurrentTimeInt64 */)) = unixCurrentTimeInt64 // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_syscall_ptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 648 /* .xSetSystemCall */)) = unixSetSystemCall // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, uintptr) Sqlite3_syscall_ptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 656 /* .xGetSystemCall */)) = unixGetSystemCall // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aVfs)) + 664 /* .xNextSystemCall */)) = unixNextSystemCall // sqlite3.c:41442:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 24 /* .xSFunc */)) = row_numberStepFunc // sqlite3.c:151777:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 32 /* .xFinalize */)) = row_numberValueFunc // sqlite3.c:151777:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 40 /* .xValue */)) = row_numberValueFunc // sqlite3.c:151777:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 48 /* .xInverse */)) = noopStepFunc // sqlite3.c:151777:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 56 /* .zName */)) = uintptr(unsafe.Pointer(&row_numberName)) // sqlite3.c:151777:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 96 /* .xSFunc */)) = dense_rankStepFunc // sqlite3.c:151778:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 104 /* .xFinalize */)) = dense_rankValueFunc // sqlite3.c:151778:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 112 /* .xValue */)) = dense_rankValueFunc // sqlite3.c:151778:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 120 /* .xInverse */)) = noopStepFunc // sqlite3.c:151778:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 128 /* .zName */)) = uintptr(unsafe.Pointer(&dense_rankName)) // sqlite3.c:151778:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 168 /* .xSFunc */)) = rankStepFunc // sqlite3.c:151779:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 176 /* .xFinalize */)) = rankValueFunc // sqlite3.c:151779:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 184 /* .xValue */)) = rankValueFunc // sqlite3.c:151779:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 192 /* .xInverse */)) = noopStepFunc // sqlite3.c:151779:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 200 /* .zName */)) = uintptr(unsafe.Pointer(&rankName)) // sqlite3.c:151779:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 240 /* .xSFunc */)) = percent_rankStepFunc // sqlite3.c:151780:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 248 /* .xFinalize */)) = percent_rankValueFunc // sqlite3.c:151780:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 256 /* .xValue */)) = percent_rankValueFunc // sqlite3.c:151780:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 264 /* .xInverse */)) = percent_rankInvFunc // sqlite3.c:151780:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 272 /* .zName */)) = uintptr(unsafe.Pointer(&percent_rankName)) // sqlite3.c:151780:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 312 /* .xSFunc */)) = cume_distStepFunc // sqlite3.c:151781:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 320 /* .xFinalize */)) = cume_distValueFunc // sqlite3.c:151781:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 328 /* .xValue */)) = cume_distValueFunc // sqlite3.c:151781:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 336 /* .xInverse */)) = cume_distInvFunc // sqlite3.c:151781:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 344 /* .zName */)) = uintptr(unsafe.Pointer(&cume_distName)) // sqlite3.c:151781:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 384 /* .xSFunc */)) = ntileStepFunc // sqlite3.c:151782:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 392 /* .xFinalize */)) = ntileValueFunc // sqlite3.c:151782:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 400 /* .xValue */)) = ntileValueFunc // sqlite3.c:151782:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 408 /* .xInverse */)) = ntileInvFunc // sqlite3.c:151782:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 416 /* .zName */)) = uintptr(unsafe.Pointer(&ntileName)) // sqlite3.c:151782:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 456 /* .xSFunc */)) = last_valueStepFunc // sqlite3.c:151783:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 464 /* .xFinalize */)) = last_valueFinalizeFunc // sqlite3.c:151783:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 472 /* .xValue */)) = last_valueValueFunc // sqlite3.c:151783:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 480 /* .xInverse */)) = last_valueInvFunc // sqlite3.c:151783:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 488 /* .zName */)) = uintptr(unsafe.Pointer(&last_valueName)) // sqlite3.c:151783:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 528 /* .xSFunc */)) = nth_valueStepFunc // sqlite3.c:151784:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 536 /* .xFinalize */)) = nth_valueFinalizeFunc // sqlite3.c:151784:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 544 /* .xValue */)) = noopValueFunc // sqlite3.c:151784:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 552 /* .xInverse */)) = noopStepFunc // sqlite3.c:151784:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 560 /* .zName */)) = uintptr(unsafe.Pointer(&nth_valueName)) // sqlite3.c:151784:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 600 /* .xSFunc */)) = first_valueStepFunc // sqlite3.c:151785:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 608 /* .xFinalize */)) = first_valueFinalizeFunc // sqlite3.c:151785:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 616 /* .xValue */)) = noopValueFunc // sqlite3.c:151785:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 624 /* .xInverse */)) = noopStepFunc // sqlite3.c:151785:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 632 /* .zName */)) = uintptr(unsafe.Pointer(&first_valueName)) // sqlite3.c:151785:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 672 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151786:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 680 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151786:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 688 /* .xValue */)) = noopValueFunc // sqlite3.c:151786:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 696 /* .xInverse */)) = noopStepFunc // sqlite3.c:151786:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 704 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:151786:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 744 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151787:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 752 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151787:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 760 /* .xValue */)) = noopValueFunc // sqlite3.c:151787:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 768 /* .xInverse */)) = noopStepFunc // sqlite3.c:151787:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 776 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:151787:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 816 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151788:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 824 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151788:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 832 /* .xValue */)) = noopValueFunc // sqlite3.c:151788:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 840 /* .xInverse */)) = noopStepFunc // sqlite3.c:151788:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 848 /* .zName */)) = uintptr(unsafe.Pointer(&leadName)) // sqlite3.c:151788:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 888 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151789:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 896 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151789:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 904 /* .xValue */)) = noopValueFunc // sqlite3.c:151789:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 912 /* .xInverse */)) = noopStepFunc // sqlite3.c:151789:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 920 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:151789:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 960 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151790:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 968 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151790:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 976 /* .xValue */)) = noopValueFunc // sqlite3.c:151790:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 984 /* .xInverse */)) = noopStepFunc // sqlite3.c:151790:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 992 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:151790:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1032 /* .xSFunc */)) = noopStepFunc // sqlite3.c:151791:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1040 /* .xFinalize */)) = noopValueFunc // sqlite3.c:151791:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1048 /* .xValue */)) = noopValueFunc // sqlite3.c:151791:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1056 /* .xInverse */)) = noopStepFunc // sqlite3.c:151791:5:
+ *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&aWindowFuncs)) + 1064 /* .zName */)) = uintptr(unsafe.Pointer(&lagName)) // sqlite3.c:151791:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&attach_func)) + 24 /* .xSFunc */)) = attachFunc // sqlite3.c:109918:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 16 /* .xConnect */)) = bytecodevtabConnect // sqlite3.c:97036:21:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 24 /* .xBestIndex */)) = bytecodevtabBestIndex // sqlite3.c:97037:21:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 32 /* .xDisconnect */)) = bytecodevtabDisconnect // sqlite3.c:97038:21:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 48 /* .xOpen */)) = bytecodevtabOpen // sqlite3.c:97040:21:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 56 /* .xClose */)) = bytecodevtabClose // sqlite3.c:97041:21:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 64 /* .xFilter */)) = bytecodevtabFilter // sqlite3.c:97042:21:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 72 /* .xNext */)) = bytecodevtabNext // sqlite3.c:97043:21:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 80 /* .xEof */)) = bytecodevtabEof // sqlite3.c:97044:21:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 88 /* .xColumn */)) = bytecodevtabColumn // sqlite3.c:97045:21:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&bytecodevtabModule)) + 96 /* .xRowid */)) = bytecodevtabRowid // sqlite3.c:97046:21:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 8 /* .xCreate */)) = dbpageConnect // sqlite3.c:202403:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 16 /* .xConnect */)) = dbpageConnect // sqlite3.c:202404:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 24 /* .xBestIndex */)) = dbpageBestIndex // sqlite3.c:202405:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 32 /* .xDisconnect */)) = dbpageDisconnect // sqlite3.c:202406:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 40 /* .xDestroy */)) = dbpageDisconnect // sqlite3.c:202407:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 48 /* .xOpen */)) = dbpageOpen // sqlite3.c:202408:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 56 /* .xClose */)) = dbpageClose // sqlite3.c:202409:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 64 /* .xFilter */)) = dbpageFilter // sqlite3.c:202410:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 72 /* .xNext */)) = dbpageNext // sqlite3.c:202411:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 80 /* .xEof */)) = dbpageEof // sqlite3.c:202412:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 88 /* .xColumn */)) = dbpageColumn // sqlite3.c:202413:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 96 /* .xRowid */)) = dbpageRowid // sqlite3.c:202414:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 104 /* .xUpdate */)) = dbpageUpdate // sqlite3.c:202415:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbpage_module)) + 112 /* .xBegin */)) = dbpageBegin // sqlite3.c:202416:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 8 /* .xCreate */)) = statConnect // sqlite3.c:201984:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 16 /* .xConnect */)) = statConnect // sqlite3.c:201985:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 24 /* .xBestIndex */)) = statBestIndex // sqlite3.c:201986:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 32 /* .xDisconnect */)) = statDisconnect // sqlite3.c:201987:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 40 /* .xDestroy */)) = statDisconnect // sqlite3.c:201988:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 48 /* .xOpen */)) = statOpen // sqlite3.c:201989:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 56 /* .xClose */)) = statClose // sqlite3.c:201990:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 64 /* .xFilter */)) = statFilter // sqlite3.c:201991:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 72 /* .xNext */)) = statNext // sqlite3.c:201992:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 80 /* .xEof */)) = statEof // sqlite3.c:201993:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 88 /* .xColumn */)) = statColumn // sqlite3.c:201994:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dbstat_module)) + 96 /* .xRowid */)) = statRowid // sqlite3.c:201995:5:
+ *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 0 /* .xMalloc */)) = sqlite3MemMalloc // sqlite3.c:23831:6:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 8 /* .xFree */)) = sqlite3MemFree // sqlite3.c:23832:6:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 16 /* .xRealloc */)) = sqlite3MemRealloc // sqlite3.c:23833:6:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 24 /* .xSize */)) = sqlite3MemSize // sqlite3.c:23834:6:
+ *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 32 /* .xRoundup */)) = sqlite3MemRoundup // sqlite3.c:23835:6:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 40 /* .xInit */)) = sqlite3MemInit // sqlite3.c:23836:6:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods)) + 48 /* .xShutdown */)) = sqlite3MemShutdown // sqlite3.c:23837:6:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 16 /* .xInit */)) = pcache1Init // sqlite3.c:50956:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 24 /* .xShutdown */)) = pcache1Shutdown // sqlite3.c:50957:5:
+ *(*func(*libc.TLS, int32, int32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 32 /* .xCreate */)) = pcache1Create // sqlite3.c:50958:5:
+ *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 40 /* .xCachesize */)) = pcache1Cachesize // sqlite3.c:50959:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 48 /* .xPagecount */)) = pcache1Pagecount // sqlite3.c:50960:5:
+ *(*func(*libc.TLS, uintptr, uint32, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 56 /* .xFetch */)) = pcache1Fetch // sqlite3.c:50961:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 64 /* .xUnpin */)) = pcache1Unpin // sqlite3.c:50962:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uint32, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 72 /* .xRekey */)) = pcache1Rekey // sqlite3.c:50963:5:
+ *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 80 /* .xTruncate */)) = pcache1Truncate // sqlite3.c:50964:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 88 /* .xDestroy */)) = pcache1Destroy // sqlite3.c:50965:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&defaultMethods1)) + 96 /* .xShrink */)) = pcache1Shrink // sqlite3.c:50966:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&detach_func)) + 24 /* .xSFunc */)) = detachFunc // sqlite3.c:109898:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoFinder)) + 0)) = dotlockIoFinderImpl // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 8 /* .xClose */)) = dotlockClose // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 56 /* .xLock */)) = dotlockLock // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 64 /* .xUnlock */)) = dotlockUnlock // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 72 /* .xCheckReservedLock */)) = dotlockCheckReservedLock // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&dotlockIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:38870:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 8 /* .xCreate */)) = fts5CreateMethod // sqlite3.c:225749:25:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 16 /* .xConnect */)) = fts5ConnectMethod // sqlite3.c:225750:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 24 /* .xBestIndex */)) = fts5BestIndexMethod // sqlite3.c:225751:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 32 /* .xDisconnect */)) = fts5DisconnectMethod // sqlite3.c:225752:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 40 /* .xDestroy */)) = fts5DestroyMethod // sqlite3.c:225753:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 48 /* .xOpen */)) = fts5OpenMethod // sqlite3.c:225754:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 56 /* .xClose */)) = fts5CloseMethod // sqlite3.c:225755:25:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 64 /* .xFilter */)) = fts5FilterMethod // sqlite3.c:225756:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 72 /* .xNext */)) = fts5NextMethod // sqlite3.c:225757:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 80 /* .xEof */)) = fts5EofMethod // sqlite3.c:225758:25:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 88 /* .xColumn */)) = fts5ColumnMethod // sqlite3.c:225759:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 96 /* .xRowid */)) = fts5RowidMethod // sqlite3.c:225760:25:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 104 /* .xUpdate */)) = fts5UpdateMethod // sqlite3.c:225761:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 112 /* .xBegin */)) = fts5BeginMethod // sqlite3.c:225762:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 120 /* .xSync */)) = fts5SyncMethod // sqlite3.c:225763:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 128 /* .xCommit */)) = fts5CommitMethod // sqlite3.c:225764:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 136 /* .xRollback */)) = fts5RollbackMethod // sqlite3.c:225765:25:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 144 /* .xFindFunction */)) = fts5FindFunctionMethod // sqlite3.c:225766:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 152 /* .xRename */)) = fts5RenameMethod // sqlite3.c:225767:25:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 160 /* .xSavepoint */)) = fts5SavepointMethod // sqlite3.c:225768:25:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 168 /* .xRelease */)) = fts5ReleaseMethod // sqlite3.c:225769:25:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 176 /* .xRollbackTo */)) = fts5RollbackToMethod // sqlite3.c:225770:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Mod)) + 184 /* .xShadowName */)) = fts5ShadowName // sqlite3.c:225771:25:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 8 /* .xCreate */)) = fts5VocabCreateMethod // sqlite3.c:230174:25:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 16 /* .xConnect */)) = fts5VocabConnectMethod // sqlite3.c:230175:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 24 /* .xBestIndex */)) = fts5VocabBestIndexMethod // sqlite3.c:230176:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 32 /* .xDisconnect */)) = fts5VocabDisconnectMethod // sqlite3.c:230177:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 40 /* .xDestroy */)) = fts5VocabDestroyMethod // sqlite3.c:230178:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 48 /* .xOpen */)) = fts5VocabOpenMethod // sqlite3.c:230179:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 56 /* .xClose */)) = fts5VocabCloseMethod // sqlite3.c:230180:25:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 64 /* .xFilter */)) = fts5VocabFilterMethod // sqlite3.c:230181:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 72 /* .xNext */)) = fts5VocabNextMethod // sqlite3.c:230182:25:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 80 /* .xEof */)) = fts5VocabEofMethod // sqlite3.c:230183:25:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 88 /* .xColumn */)) = fts5VocabColumnMethod // sqlite3.c:230184:25:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&fts5Vocab)) + 96 /* .xRowid */)) = fts5VocabRowidMethod // sqlite3.c:230185:25:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 8 /* .xCreate */)) = geopolyCreate // sqlite3.c:194165:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 16 /* .xConnect */)) = geopolyConnect // sqlite3.c:194166:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 24 /* .xBestIndex */)) = geopolyBestIndex // sqlite3.c:194167:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 32 /* .xDisconnect */)) = rtreeDisconnect // sqlite3.c:194168:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 40 /* .xDestroy */)) = rtreeDestroy // sqlite3.c:194169:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 48 /* .xOpen */)) = rtreeOpen // sqlite3.c:194170:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 56 /* .xClose */)) = rtreeClose // sqlite3.c:194171:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 64 /* .xFilter */)) = geopolyFilter // sqlite3.c:194172:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 72 /* .xNext */)) = rtreeNext // sqlite3.c:194173:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 80 /* .xEof */)) = rtreeEof // sqlite3.c:194174:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 88 /* .xColumn */)) = geopolyColumn // sqlite3.c:194175:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 96 /* .xRowid */)) = rtreeRowid // sqlite3.c:194176:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 104 /* .xUpdate */)) = geopolyUpdate // sqlite3.c:194177:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 112 /* .xBegin */)) = rtreeBeginTransaction // sqlite3.c:194178:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 120 /* .xSync */)) = rtreeEndTransaction // sqlite3.c:194179:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 128 /* .xCommit */)) = rtreeEndTransaction // sqlite3.c:194180:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 136 /* .xRollback */)) = rtreeEndTransaction // sqlite3.c:194181:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 144 /* .xFindFunction */)) = geopolyFindFunction // sqlite3.c:194182:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 152 /* .xRename */)) = rtreeRename // sqlite3.c:194183:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 160 /* .xSavepoint */)) = rtreeSavepoint // sqlite3.c:194184:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&geopolyModule)) + 184 /* .xShadowName */)) = rtreeShadowName // sqlite3.c:194187:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 16 /* .xConnect */)) = jsonEachConnect // sqlite3.c:187905:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 24 /* .xBestIndex */)) = jsonEachBestIndex // sqlite3.c:187906:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 32 /* .xDisconnect */)) = jsonEachDisconnect // sqlite3.c:187907:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 48 /* .xOpen */)) = jsonEachOpenEach // sqlite3.c:187909:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 56 /* .xClose */)) = jsonEachClose // sqlite3.c:187910:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 64 /* .xFilter */)) = jsonEachFilter // sqlite3.c:187911:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 72 /* .xNext */)) = jsonEachNext // sqlite3.c:187912:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 80 /* .xEof */)) = jsonEachEof // sqlite3.c:187913:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 88 /* .xColumn */)) = jsonEachColumn // sqlite3.c:187914:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonEachModule)) + 96 /* .xRowid */)) = jsonEachRowid // sqlite3.c:187915:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 16 /* .xConnect */)) = jsonEachConnect // sqlite3.c:187933:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 24 /* .xBestIndex */)) = jsonEachBestIndex // sqlite3.c:187934:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 32 /* .xDisconnect */)) = jsonEachDisconnect // sqlite3.c:187935:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 48 /* .xOpen */)) = jsonEachOpenTree // sqlite3.c:187937:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 56 /* .xClose */)) = jsonEachClose // sqlite3.c:187938:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 64 /* .xFilter */)) = jsonEachFilter // sqlite3.c:187939:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 72 /* .xNext */)) = jsonEachNext // sqlite3.c:187940:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 80 /* .xEof */)) = jsonEachEof // sqlite3.c:187941:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 88 /* .xColumn */)) = jsonEachColumn // sqlite3.c:187942:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&jsonTreeModule)) + 96 /* .xRowid */)) = jsonEachRowid // sqlite3.c:187943:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 8 /* .xClose */)) = memdbClose // sqlite3.c:47941:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 16 /* .xRead */)) = memdbRead // sqlite3.c:47942:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 24 /* .xWrite */)) = memdbWrite // sqlite3.c:47943:3:
+ *(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 32 /* .xTruncate */)) = memdbTruncate // sqlite3.c:47944:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 40 /* .xSync */)) = memdbSync // sqlite3.c:47945:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 48 /* .xFileSize */)) = memdbFileSize // sqlite3.c:47946:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 56 /* .xLock */)) = memdbLock // sqlite3.c:47947:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 64 /* .xUnlock */)) = memdbLock // sqlite3.c:47948:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 80 /* .xFileControl */)) = memdbFileControl // sqlite3.c:47950:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 96 /* .xDeviceCharacteristics */)) = memdbDeviceCharacteristics // sqlite3.c:47952:3:
+ *(*func(*libc.TLS, uintptr, Sqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 136 /* .xFetch */)) = memdbFetch // sqlite3.c:47957:3:
+ *(*func(*libc.TLS, uintptr, Sqlite3_int64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_io_methods)) + 144 /* .xUnfetch */)) = memdbUnfetch // sqlite3.c:47958:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 40 /* .xOpen */)) = memdbOpen // sqlite3.c:47924:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 56 /* .xAccess */)) = memdbAccess // sqlite3.c:47926:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 64 /* .xFullPathname */)) = memdbFullPathname // sqlite3.c:47927:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 72 /* .xDlOpen */)) = memdbDlOpen // sqlite3.c:47928:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 80 /* .xDlError */)) = memdbDlError // sqlite3.c:47929:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 88 /* .xDlSym */)) = memdbDlSym // sqlite3.c:47930:3:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 96 /* .xDlClose */)) = memdbDlClose // sqlite3.c:47931:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 104 /* .xRandomness */)) = memdbRandomness // sqlite3.c:47932:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 112 /* .xSleep */)) = memdbSleep // sqlite3.c:47933:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 128 /* .xGetLastError */)) = memdbGetLastError // sqlite3.c:47935:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&memdb_vfs)) + 136 /* .xCurrentTimeInt64 */)) = memdbCurrentTimeInt64 // sqlite3.c:47936:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoFinder)) + 0)) = nolockIoFinderImpl // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 8 /* .xClose */)) = nolockClose // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 56 /* .xLock */)) = nolockLock // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 64 /* .xUnlock */)) = nolockUnlock // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 72 /* .xCheckReservedLock */)) = nolockCheckReservedLock // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&nolockIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:38860:1:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoFinder)) + 0)) = posixIoFinderImpl // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 8 /* .xClose */)) = unixClose // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 16 /* .xRead */)) = unixRead // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 24 /* .xWrite */)) = unixWrite // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, I64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 32 /* .xTruncate */)) = unixTruncate // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 40 /* .xSync */)) = unixSync // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 48 /* .xFileSize */)) = unixFileSize // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 56 /* .xLock */)) = unixLock // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 64 /* .xUnlock */)) = unixUnlock // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 72 /* .xCheckReservedLock */)) = unixCheckReservedLock // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 80 /* .xFileControl */)) = unixFileControl // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 88 /* .xSectorSize */)) = unixSectorSize // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 96 /* .xDeviceCharacteristics */)) = unixDeviceCharacteristics // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 104 /* .xShmMap */)) = unixShmMap // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 112 /* .xShmLock */)) = unixShmLock // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 120 /* .xShmBarrier */)) = unixShmBarrier // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 128 /* .xShmUnmap */)) = unixShmUnmap // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, I64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 136 /* .xFetch */)) = unixFetch // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, I64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&posixIoMethods)) + 144 /* .xUnfetch */)) = unixUnfetch // sqlite3.c:38850:1:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 16 /* .xConnect */)) = pragmaVtabConnect // sqlite3.c:128295:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 24 /* .xBestIndex */)) = pragmaVtabBestIndex // sqlite3.c:128296:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 32 /* .xDisconnect */)) = pragmaVtabDisconnect // sqlite3.c:128297:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 48 /* .xOpen */)) = pragmaVtabOpen // sqlite3.c:128299:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 56 /* .xClose */)) = pragmaVtabClose // sqlite3.c:128300:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 64 /* .xFilter */)) = pragmaVtabFilter // sqlite3.c:128301:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 72 /* .xNext */)) = pragmaVtabNext // sqlite3.c:128302:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 80 /* .xEof */)) = pragmaVtabEof // sqlite3.c:128303:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 88 /* .xColumn */)) = pragmaVtabColumn // sqlite3.c:128304:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&pragmaVtabModule)) + 96 /* .xRowid */)) = pragmaVtabRowid // sqlite3.c:128305:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 8 /* .xClose */)) = rbuVfsClose // sqlite3.c:200803:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 16 /* .xRead */)) = rbuVfsRead // sqlite3.c:200804:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 24 /* .xWrite */)) = rbuVfsWrite // sqlite3.c:200805:5:
+ *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 32 /* .xTruncate */)) = rbuVfsTruncate // sqlite3.c:200806:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 40 /* .xSync */)) = rbuVfsSync // sqlite3.c:200807:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 48 /* .xFileSize */)) = rbuVfsFileSize // sqlite3.c:200808:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 56 /* .xLock */)) = rbuVfsLock // sqlite3.c:200809:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 64 /* .xUnlock */)) = rbuVfsUnlock // sqlite3.c:200810:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 72 /* .xCheckReservedLock */)) = rbuVfsCheckReservedLock // sqlite3.c:200811:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 80 /* .xFileControl */)) = rbuVfsFileControl // sqlite3.c:200812:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 88 /* .xSectorSize */)) = rbuVfsSectorSize // sqlite3.c:200813:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 96 /* .xDeviceCharacteristics */)) = rbuVfsDeviceCharacteristics // sqlite3.c:200814:5:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 104 /* .xShmMap */)) = rbuVfsShmMap // sqlite3.c:200815:5:
+ *(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 112 /* .xShmLock */)) = rbuVfsShmLock // sqlite3.c:200816:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 120 /* .xShmBarrier */)) = rbuVfsShmBarrier // sqlite3.c:200817:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rbuvfs_io_methods)) + 128 /* .xShmUnmap */)) = rbuVfsShmUnmap // sqlite3.c:200818:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 8 /* .xCreate */)) = rtreeCreate // sqlite3.c:191518:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 16 /* .xConnect */)) = rtreeConnect // sqlite3.c:191519:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 24 /* .xBestIndex */)) = rtreeBestIndex // sqlite3.c:191520:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 32 /* .xDisconnect */)) = rtreeDisconnect // sqlite3.c:191521:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 40 /* .xDestroy */)) = rtreeDestroy // sqlite3.c:191522:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 48 /* .xOpen */)) = rtreeOpen // sqlite3.c:191523:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 56 /* .xClose */)) = rtreeClose // sqlite3.c:191524:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 64 /* .xFilter */)) = rtreeFilter // sqlite3.c:191525:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 72 /* .xNext */)) = rtreeNext // sqlite3.c:191526:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 80 /* .xEof */)) = rtreeEof // sqlite3.c:191527:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 88 /* .xColumn */)) = rtreeColumn // sqlite3.c:191528:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 96 /* .xRowid */)) = rtreeRowid // sqlite3.c:191529:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 104 /* .xUpdate */)) = rtreeUpdate // sqlite3.c:191530:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 112 /* .xBegin */)) = rtreeBeginTransaction // sqlite3.c:191531:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 120 /* .xSync */)) = rtreeEndTransaction // sqlite3.c:191532:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 128 /* .xCommit */)) = rtreeEndTransaction // sqlite3.c:191533:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 136 /* .xRollback */)) = rtreeEndTransaction // sqlite3.c:191534:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 152 /* .xRename */)) = rtreeRename // sqlite3.c:191536:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 160 /* .xSavepoint */)) = rtreeSavepoint // sqlite3.c:191537:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&rtreeModule)) + 184 /* .xShadowName */)) = rtreeShadowName // sqlite3.c:191540:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 8 /* .xUserData */)) = fts5ApiUserData // sqlite3.c:225213:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 16 /* .xColumnCount */)) = fts5ApiColumnCount // sqlite3.c:225214:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 24 /* .xRowCount */)) = fts5ApiRowCount // sqlite3.c:225215:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 32 /* .xColumnTotalSize */)) = fts5ApiColumnTotalSize // sqlite3.c:225216:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 40 /* .xTokenize */)) = fts5ApiTokenize // sqlite3.c:225217:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 48 /* .xPhraseCount */)) = fts5ApiPhraseCount // sqlite3.c:225218:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 56 /* .xPhraseSize */)) = fts5ApiPhraseSize // sqlite3.c:225219:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 64 /* .xInstCount */)) = fts5ApiInstCount // sqlite3.c:225220:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 72 /* .xInst */)) = fts5ApiInst // sqlite3.c:225221:3:
+ *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 80 /* .xRowid */)) = fts5ApiRowid // sqlite3.c:225222:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 88 /* .xColumnText */)) = fts5ApiColumnText // sqlite3.c:225223:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 96 /* .xColumnSize */)) = fts5ApiColumnSize // sqlite3.c:225224:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 104 /* .xQueryPhrase */)) = fts5ApiQueryPhrase // sqlite3.c:225225:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 112 /* .xSetAuxdata */)) = fts5ApiSetAuxdata // sqlite3.c:225226:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 120 /* .xGetAuxdata */)) = fts5ApiGetAuxdata // sqlite3.c:225227:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 128 /* .xPhraseFirst */)) = fts5ApiPhraseFirst // sqlite3.c:225228:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 136 /* .xPhraseNext */)) = fts5ApiPhraseNext // sqlite3.c:225229:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 144 /* .xPhraseFirstColumn */)) = fts5ApiPhraseFirstColumn // sqlite3.c:225230:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sFts5Api)) + 152 /* .xPhraseNextColumn */)) = fts5ApiPhraseNextColumn // sqlite3.c:225231:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 8 /* .xClose */)) = memjrnlClose // sqlite3.c:97386:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 16 /* .xRead */)) = memjrnlRead // sqlite3.c:97387:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 24 /* .xWrite */)) = memjrnlWrite // sqlite3.c:97388:3:
+ *(*func(*libc.TLS, uintptr, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 32 /* .xTruncate */)) = memjrnlTruncate // sqlite3.c:97389:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 40 /* .xSync */)) = memjrnlSync // sqlite3.c:97390:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMemJournalMethods)) + 48 /* .xFileSize */)) = memjrnlFileSize // sqlite3.c:97391:3:
+ *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 0 /* .xMutexInit */)) = noopMutexInit // sqlite3.c:26064:5:
+ *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 8 /* .xMutexEnd */)) = noopMutexEnd // sqlite3.c:26065:5:
+ *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 16 /* .xMutexAlloc */)) = noopMutexAlloc // sqlite3.c:26066:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 24 /* .xMutexFree */)) = noopMutexFree // sqlite3.c:26067:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 32 /* .xMutexEnter */)) = noopMutexEnter // sqlite3.c:26068:5:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 40 /* .xMutexTry */)) = noopMutexTry // sqlite3.c:26069:5:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sMutex)) + 48 /* .xMutexLeave */)) = noopMutexLeave // sqlite3.c:26070:5:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 0 /* .aggregate_context */)) = Xsqlite3_aggregate_context // sqlite3.c:124372:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 8 /* .aggregate_count */)) = Xsqlite3_aggregate_count // sqlite3.c:124374:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 16 /* .bind_blob */)) = Xsqlite3_bind_blob // sqlite3.c:124378:3:
+ *(*func(*libc.TLS, uintptr, int32, float64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 24 /* .bind_double */)) = Xsqlite3_bind_double // sqlite3.c:124379:3:
+ *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 32 /* .bind_int */)) = Xsqlite3_bind_int // sqlite3.c:124380:3:
+ *(*func(*libc.TLS, uintptr, int32, Sqlite_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 40 /* .bind_int64 */)) = Xsqlite3_bind_int64 // sqlite3.c:124381:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 48 /* .bind_null */)) = Xsqlite3_bind_null // sqlite3.c:124382:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 56 /* .bind_parameter_count */)) = Xsqlite3_bind_parameter_count // sqlite3.c:124383:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 64 /* .bind_parameter_index */)) = Xsqlite3_bind_parameter_index // sqlite3.c:124384:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 72 /* .bind_parameter_name */)) = Xsqlite3_bind_parameter_name // sqlite3.c:124385:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 80 /* .bind_text */)) = Xsqlite3_bind_text // sqlite3.c:124386:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 88 /* .bind_text16 */)) = Xsqlite3_bind_text16 // sqlite3.c:124387:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 96 /* .bind_value */)) = Xsqlite3_bind_value // sqlite3.c:124388:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 104 /* .busy_handler */)) = Xsqlite3_busy_handler // sqlite3.c:124389:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 112 /* .busy_timeout */)) = Xsqlite3_busy_timeout // sqlite3.c:124390:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 120 /* .changes */)) = Xsqlite3_changes // sqlite3.c:124391:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 128 /* .close */)) = Xsqlite3_close // sqlite3.c:124392:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 136 /* .collation_needed */)) = Xsqlite3_collation_needed // sqlite3.c:124393:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 144 /* .collation_needed16 */)) = Xsqlite3_collation_needed16 // sqlite3.c:124394:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 152 /* .column_blob */)) = Xsqlite3_column_blob // sqlite3.c:124395:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 160 /* .column_bytes */)) = Xsqlite3_column_bytes // sqlite3.c:124396:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 168 /* .column_bytes16 */)) = Xsqlite3_column_bytes16 // sqlite3.c:124397:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 176 /* .column_count */)) = Xsqlite3_column_count // sqlite3.c:124398:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 184 /* .column_database_name */)) = Xsqlite3_column_database_name // sqlite3.c:124399:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 192 /* .column_database_name16 */)) = Xsqlite3_column_database_name16 // sqlite3.c:124400:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 200 /* .column_decltype */)) = Xsqlite3_column_decltype // sqlite3.c:124401:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 208 /* .column_decltype16 */)) = Xsqlite3_column_decltype16 // sqlite3.c:124402:3:
+ *(*func(*libc.TLS, uintptr, int32) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 216 /* .column_double */)) = Xsqlite3_column_double // sqlite3.c:124403:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 224 /* .column_int */)) = Xsqlite3_column_int // sqlite3.c:124404:3:
+ *(*func(*libc.TLS, uintptr, int32) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 232 /* .column_int64 */)) = Xsqlite3_column_int64 // sqlite3.c:124405:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 240 /* .column_name */)) = Xsqlite3_column_name // sqlite3.c:124406:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 248 /* .column_name16 */)) = Xsqlite3_column_name16 // sqlite3.c:124407:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 256 /* .column_origin_name */)) = Xsqlite3_column_origin_name // sqlite3.c:124408:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 264 /* .column_origin_name16 */)) = Xsqlite3_column_origin_name16 // sqlite3.c:124409:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 272 /* .column_table_name */)) = Xsqlite3_column_table_name // sqlite3.c:124410:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 280 /* .column_table_name16 */)) = Xsqlite3_column_table_name16 // sqlite3.c:124411:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 288 /* .column_text */)) = Xsqlite3_column_text // sqlite3.c:124412:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 296 /* .column_text16 */)) = Xsqlite3_column_text16 // sqlite3.c:124413:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 304 /* .column_type */)) = Xsqlite3_column_type // sqlite3.c:124414:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 312 /* .column_value */)) = Xsqlite3_column_value // sqlite3.c:124415:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 320 /* .commit_hook */)) = Xsqlite3_commit_hook // sqlite3.c:124416:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 328 /* .complete */)) = Xsqlite3_complete // sqlite3.c:124417:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 336 /* .complete16 */)) = Xsqlite3_complete16 // sqlite3.c:124418:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 344 /* .create_collation */)) = Xsqlite3_create_collation // sqlite3.c:124419:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 352 /* .create_collation16 */)) = Xsqlite3_create_collation16 // sqlite3.c:124420:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 360 /* .create_function */)) = Xsqlite3_create_function // sqlite3.c:124421:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 368 /* .create_function16 */)) = Xsqlite3_create_function16 // sqlite3.c:124422:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 376 /* .create_module */)) = Xsqlite3_create_module // sqlite3.c:124423:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 384 /* .data_count */)) = Xsqlite3_data_count // sqlite3.c:124424:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 392 /* .db_handle */)) = Xsqlite3_db_handle // sqlite3.c:124425:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 400 /* .declare_vtab */)) = Xsqlite3_declare_vtab // sqlite3.c:124426:3:
+ *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 408 /* .enable_shared_cache */)) = Xsqlite3_enable_shared_cache // sqlite3.c:124427:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 416 /* .errcode */)) = Xsqlite3_errcode // sqlite3.c:124428:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 424 /* .errmsg */)) = Xsqlite3_errmsg // sqlite3.c:124429:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 432 /* .errmsg16 */)) = Xsqlite3_errmsg16 // sqlite3.c:124430:3:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_callback, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 440 /* .exec */)) = Xsqlite3_exec // sqlite3.c:124431:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 448 /* .expired */)) = Xsqlite3_expired // sqlite3.c:124433:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 456 /* .finalize */)) = Xsqlite3_finalize // sqlite3.c:124437:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 464 /* .free */)) = Xsqlite3_free // sqlite3.c:124438:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 472 /* .free_table */)) = Xsqlite3_free_table // sqlite3.c:124439:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 480 /* .get_autocommit */)) = Xsqlite3_get_autocommit // sqlite3.c:124440:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 488 /* .get_auxdata */)) = Xsqlite3_get_auxdata // sqlite3.c:124441:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 496 /* .get_table */)) = Xsqlite3_get_table // sqlite3.c:124442:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 512 /* .interruptx */)) = Xsqlite3_interrupt // sqlite3.c:124444:3:
+ *(*func(*libc.TLS, uintptr) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 520 /* .last_insert_rowid */)) = Xsqlite3_last_insert_rowid // sqlite3.c:124445:3:
+ *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 528 /* .libversion */)) = Xsqlite3_libversion // sqlite3.c:124446:3:
+ *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 536 /* .libversion_number */)) = Xsqlite3_libversion_number // sqlite3.c:124447:3:
+ *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 544 /* .malloc */)) = Xsqlite3_malloc // sqlite3.c:124448:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 552 /* .mprintf */)) = Xsqlite3_mprintf // sqlite3.c:124449:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 560 /* .open64 */)) = Xsqlite3_open // sqlite3.c:124450:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 568 /* .open16 */)) = Xsqlite3_open16 // sqlite3.c:124451:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 576 /* .prepare */)) = Xsqlite3_prepare // sqlite3.c:124452:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 584 /* .prepare16 */)) = Xsqlite3_prepare16 // sqlite3.c:124453:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 592 /* .profile */)) = Xsqlite3_profile // sqlite3.c:124454:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 600 /* .progress_handler */)) = Xsqlite3_progress_handler // sqlite3.c:124455:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 608 /* .realloc */)) = Xsqlite3_realloc // sqlite3.c:124456:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 616 /* .reset */)) = Xsqlite3_reset // sqlite3.c:124457:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 624 /* .result_blob */)) = Xsqlite3_result_blob // sqlite3.c:124458:3:
+ *(*func(*libc.TLS, uintptr, float64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 632 /* .result_double */)) = Xsqlite3_result_double // sqlite3.c:124459:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 640 /* .result_error */)) = Xsqlite3_result_error // sqlite3.c:124460:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 648 /* .result_error16 */)) = Xsqlite3_result_error16 // sqlite3.c:124461:3:
+ *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 656 /* .result_int */)) = Xsqlite3_result_int // sqlite3.c:124462:3:
+ *(*func(*libc.TLS, uintptr, I64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 664 /* .result_int64 */)) = Xsqlite3_result_int64 // sqlite3.c:124463:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 672 /* .result_null */)) = Xsqlite3_result_null // sqlite3.c:124464:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 680 /* .result_text */)) = Xsqlite3_result_text // sqlite3.c:124465:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 688 /* .result_text16 */)) = Xsqlite3_result_text16 // sqlite3.c:124466:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 696 /* .result_text16be */)) = Xsqlite3_result_text16be // sqlite3.c:124467:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 704 /* .result_text16le */)) = Xsqlite3_result_text16le // sqlite3.c:124468:3:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 712 /* .result_value */)) = Xsqlite3_result_value // sqlite3.c:124469:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 720 /* .rollback_hook */)) = Xsqlite3_rollback_hook // sqlite3.c:124470:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 728 /* .set_authorizer */)) = Xsqlite3_set_authorizer // sqlite3.c:124471:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 736 /* .set_auxdata */)) = Xsqlite3_set_auxdata // sqlite3.c:124472:3:
+ *(*func(*libc.TLS, int32, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 744 /* .xsnprintf */)) = Xsqlite3_snprintf // sqlite3.c:124473:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 752 /* .step */)) = Xsqlite3_step // sqlite3.c:124474:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 760 /* .table_column_metadata */)) = Xsqlite3_table_column_metadata // sqlite3.c:124475:3:
+ *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 768 /* .thread_cleanup */)) = Xsqlite3_thread_cleanup // sqlite3.c:124477:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 776 /* .total_changes */)) = Xsqlite3_total_changes // sqlite3.c:124481:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 784 /* .trace */)) = Xsqlite3_trace // sqlite3.c:124482:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 792 /* .transfer_bindings */)) = Xsqlite3_transfer_bindings // sqlite3.c:124484:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 800 /* .update_hook */)) = Xsqlite3_update_hook // sqlite3.c:124488:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 808 /* .user_data */)) = Xsqlite3_user_data // sqlite3.c:124489:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 816 /* .value_blob */)) = Xsqlite3_value_blob // sqlite3.c:124490:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 824 /* .value_bytes */)) = Xsqlite3_value_bytes // sqlite3.c:124491:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 832 /* .value_bytes16 */)) = Xsqlite3_value_bytes16 // sqlite3.c:124492:3:
+ *(*func(*libc.TLS, uintptr) float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 840 /* .value_double */)) = Xsqlite3_value_double // sqlite3.c:124493:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 848 /* .value_int */)) = Xsqlite3_value_int // sqlite3.c:124494:3:
+ *(*func(*libc.TLS, uintptr) Sqlite_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 856 /* .value_int64 */)) = Xsqlite3_value_int64 // sqlite3.c:124495:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 864 /* .value_numeric_type */)) = Xsqlite3_value_numeric_type // sqlite3.c:124496:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 872 /* .value_text */)) = Xsqlite3_value_text // sqlite3.c:124497:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 880 /* .value_text16 */)) = Xsqlite3_value_text16 // sqlite3.c:124498:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 888 /* .value_text16be */)) = Xsqlite3_value_text16be // sqlite3.c:124499:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 896 /* .value_text16le */)) = Xsqlite3_value_text16le // sqlite3.c:124500:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 904 /* .value_type */)) = Xsqlite3_value_type // sqlite3.c:124501:3:
+ *(*func(*libc.TLS, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 912 /* .vmprintf */)) = Xsqlite3_vmprintf // sqlite3.c:124502:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 920 /* .overload_function */)) = Xsqlite3_overload_function // sqlite3.c:124511:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 928 /* .prepare_v2 */)) = Xsqlite3_prepare_v2 // sqlite3.c:124516:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 936 /* .prepare16_v2 */)) = Xsqlite3_prepare16_v2 // sqlite3.c:124517:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 944 /* .clear_bindings */)) = Xsqlite3_clear_bindings // sqlite3.c:124518:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 952 /* .create_module_v2 */)) = Xsqlite3_create_module_v2 // sqlite3.c:124523:3:
+ *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 960 /* .bind_zeroblob */)) = Xsqlite3_bind_zeroblob // sqlite3.c:124528:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 968 /* .blob_bytes */)) = Xsqlite3_blob_bytes // sqlite3.c:124529:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 976 /* .blob_close */)) = Xsqlite3_blob_close // sqlite3.c:124530:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, Sqlite_int64, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 984 /* .blob_open */)) = Xsqlite3_blob_open // sqlite3.c:124531:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 992 /* .blob_read */)) = Xsqlite3_blob_read // sqlite3.c:124532:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1000 /* .blob_write */)) = Xsqlite3_blob_write // sqlite3.c:124533:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1008 /* .create_collation_v2 */)) = Xsqlite3_create_collation_v2 // sqlite3.c:124534:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1016 /* .file_control */)) = Xsqlite3_file_control // sqlite3.c:124535:3:
+ *(*func(*libc.TLS, int32) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1024 /* .memory_highwater */)) = Xsqlite3_memory_highwater // sqlite3.c:124536:3:
+ *(*func(*libc.TLS) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1032 /* .memory_used */)) = Xsqlite3_memory_used // sqlite3.c:124537:3:
+ *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1040 /* .mutex_alloc */)) = Xsqlite3_mutex_alloc // sqlite3.c:124545:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1048 /* .mutex_enter */)) = Xsqlite3_mutex_enter // sqlite3.c:124546:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1056 /* .mutex_free */)) = Xsqlite3_mutex_free // sqlite3.c:124547:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1064 /* .mutex_leave */)) = Xsqlite3_mutex_leave // sqlite3.c:124548:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1072 /* .mutex_try */)) = Xsqlite3_mutex_try // sqlite3.c:124549:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1080 /* .open_v2 */)) = Xsqlite3_open_v2 // sqlite3.c:124551:3:
+ *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1088 /* .release_memory */)) = Xsqlite3_release_memory // sqlite3.c:124552:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1096 /* .result_error_nomem */)) = Xsqlite3_result_error_nomem // sqlite3.c:124553:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1104 /* .result_error_toobig */)) = Xsqlite3_result_error_toobig // sqlite3.c:124554:3:
+ *(*func(*libc.TLS, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1112 /* .sleep */)) = Xsqlite3_sleep // sqlite3.c:124555:3:
+ *(*func(*libc.TLS, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1120 /* .soft_heap_limit */)) = Xsqlite3_soft_heap_limit // sqlite3.c:124556:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1128 /* .vfs_find */)) = Xsqlite3_vfs_find // sqlite3.c:124557:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1136 /* .vfs_register */)) = Xsqlite3_vfs_register // sqlite3.c:124558:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1144 /* .vfs_unregister */)) = Xsqlite3_vfs_unregister // sqlite3.c:124559:3:
+ *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1152 /* .xthreadsafe */)) = Xsqlite3_threadsafe // sqlite3.c:124564:3:
+ *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1160 /* .result_zeroblob */)) = Xsqlite3_result_zeroblob // sqlite3.c:124565:3:
+ *(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1168 /* .result_error_code */)) = Xsqlite3_result_error_code // sqlite3.c:124566:3:
+ *(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1176 /* .test_control */)) = Xsqlite3_test_control // sqlite3.c:124567:3:
+ *(*func(*libc.TLS, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1184 /* .randomness */)) = Xsqlite3_randomness // sqlite3.c:124568:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1192 /* .context_db_handle */)) = Xsqlite3_context_db_handle // sqlite3.c:124569:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1200 /* .extended_result_codes */)) = Xsqlite3_extended_result_codes // sqlite3.c:124574:3:
+ *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1208 /* .limit */)) = Xsqlite3_limit // sqlite3.c:124575:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1216 /* .next_stmt */)) = Xsqlite3_next_stmt // sqlite3.c:124576:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1224 /* .sql */)) = Xsqlite3_sql // sqlite3.c:124577:3:
+ *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1232 /* .status */)) = Xsqlite3_status // sqlite3.c:124578:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1240 /* .backup_finish */)) = Xsqlite3_backup_finish // sqlite3.c:124583:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1248 /* .backup_init */)) = Xsqlite3_backup_init // sqlite3.c:124584:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1256 /* .backup_pagecount */)) = Xsqlite3_backup_pagecount // sqlite3.c:124585:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1264 /* .backup_remaining */)) = Xsqlite3_backup_remaining // sqlite3.c:124586:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1272 /* .backup_step */)) = Xsqlite3_backup_step // sqlite3.c:124587:3:
+ *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1280 /* .compileoption_get */)) = Xsqlite3_compileoption_get // sqlite3.c:124589:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1288 /* .compileoption_used */)) = Xsqlite3_compileoption_used // sqlite3.c:124590:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1296 /* .create_function_v2 */)) = Xsqlite3_create_function_v2 // sqlite3.c:124595:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1304 /* .db_config */)) = Xsqlite3_db_config // sqlite3.c:124596:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1312 /* .db_mutex */)) = Xsqlite3_db_mutex // sqlite3.c:124597:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1320 /* .db_status */)) = Xsqlite3_db_status // sqlite3.c:124598:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1328 /* .extended_errcode */)) = Xsqlite3_extended_errcode // sqlite3.c:124599:3:
+ *(*func(*libc.TLS, int32, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1336 /* .log */)) = Xsqlite3_log // sqlite3.c:124600:3:
+ *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1344 /* .soft_heap_limit64 */)) = Xsqlite3_soft_heap_limit64 // sqlite3.c:124601:3:
+ *(*func(*libc.TLS) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1352 /* .sourceid */)) = Xsqlite3_sourceid // sqlite3.c:124602:3:
+ *(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1360 /* .stmt_status */)) = Xsqlite3_stmt_status // sqlite3.c:124603:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1368 /* .strnicmp */)) = Xsqlite3_strnicmp // sqlite3.c:124604:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1376 /* .unlock_notify */)) = Xsqlite3_unlock_notify // sqlite3.c:124606:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1384 /* .wal_autocheckpoint */)) = Xsqlite3_wal_autocheckpoint // sqlite3.c:124611:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1392 /* .wal_checkpoint */)) = Xsqlite3_wal_checkpoint // sqlite3.c:124612:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1400 /* .wal_hook */)) = Xsqlite3_wal_hook // sqlite3.c:124613:3:
+ *(*func(*libc.TLS, uintptr, Sqlite3_int64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1408 /* .blob_reopen */)) = Xsqlite3_blob_reopen // sqlite3.c:124619:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1416 /* .vtab_config */)) = Xsqlite3_vtab_config // sqlite3.c:124620:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1424 /* .vtab_on_conflict */)) = Xsqlite3_vtab_on_conflict // sqlite3.c:124621:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1432 /* .close_v2 */)) = Xsqlite3_close_v2 // sqlite3.c:124622:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1440 /* .db_filename */)) = Xsqlite3_db_filename // sqlite3.c:124623:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1448 /* .db_readonly */)) = Xsqlite3_db_readonly // sqlite3.c:124624:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1456 /* .db_release_memory */)) = Xsqlite3_db_release_memory // sqlite3.c:124625:3:
+ *(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1464 /* .errstr */)) = Xsqlite3_errstr // sqlite3.c:124626:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1472 /* .stmt_busy */)) = Xsqlite3_stmt_busy // sqlite3.c:124627:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1480 /* .stmt_readonly */)) = Xsqlite3_stmt_readonly // sqlite3.c:124628:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1488 /* .stricmp */)) = Xsqlite3_stricmp // sqlite3.c:124629:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1496 /* .uri_boolean */)) = Xsqlite3_uri_boolean // sqlite3.c:124630:3:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1504 /* .uri_int64 */)) = Xsqlite3_uri_int64 // sqlite3.c:124631:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1512 /* .uri_parameter */)) = Xsqlite3_uri_parameter // sqlite3.c:124632:3:
+ *(*func(*libc.TLS, int32, uintptr, uintptr, Va_list) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1520 /* .xvsnprintf */)) = Xsqlite3_vsnprintf // sqlite3.c:124633:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1528 /* .wal_checkpoint_v2 */)) = Xsqlite3_wal_checkpoint_v2 // sqlite3.c:124634:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1536 /* .auto_extension */)) = Xsqlite3_auto_extension // sqlite3.c:124636:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1544 /* .bind_blob64 */)) = Xsqlite3_bind_blob64 // sqlite3.c:124637:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, Sqlite3_uint64, uintptr, uint8) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1552 /* .bind_text64 */)) = Xsqlite3_bind_text64 // sqlite3.c:124638:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1560 /* .cancel_auto_extension */)) = Xsqlite3_cancel_auto_extension // sqlite3.c:124639:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1568 /* .load_extension */)) = Xsqlite3_load_extension // sqlite3.c:124640:3:
+ *(*func(*libc.TLS, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1576 /* .malloc64 */)) = Xsqlite3_malloc64 // sqlite3.c:124641:3:
+ *(*func(*libc.TLS, uintptr) Sqlite3_uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1584 /* .msize */)) = Xsqlite3_msize // sqlite3.c:124642:3:
+ *(*func(*libc.TLS, uintptr, Sqlite3_uint64) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1592 /* .realloc64 */)) = Xsqlite3_realloc64 // sqlite3.c:124643:3:
+ *(*func(*libc.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1600 /* .reset_auto_extension */)) = Xsqlite3_reset_auto_extension // sqlite3.c:124644:3:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1608 /* .result_blob64 */)) = Xsqlite3_result_blob64 // sqlite3.c:124645:3:
+ *(*func(*libc.TLS, uintptr, uintptr, Sqlite3_uint64, uintptr, uint8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1616 /* .result_text64 */)) = Xsqlite3_result_text64 // sqlite3.c:124646:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1624 /* .strglob */)) = Xsqlite3_strglob // sqlite3.c:124647:3:
*(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1632 /* .value_dup */)) = *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) uintptr
- }{Xsqlite3_value_dup})) // sqlite3.c:124349:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1640 /* .value_free */)) = Xsqlite3_value_free // sqlite3.c:124350:3:
- *(*func(*crt.TLS, uintptr, U64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1648 /* .result_zeroblob64 */)) = Xsqlite3_result_zeroblob64 // sqlite3.c:124351:3:
- *(*func(*crt.TLS, uintptr, int32, Sqlite3_uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1656 /* .bind_zeroblob64 */)) = Xsqlite3_bind_zeroblob64 // sqlite3.c:124352:3:
- *(*func(*crt.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1664 /* .value_subtype */)) = Xsqlite3_value_subtype // sqlite3.c:124354:3:
- *(*func(*crt.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1672 /* .result_subtype */)) = Xsqlite3_result_subtype // sqlite3.c:124355:3:
- *(*func(*crt.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1680 /* .status64 */)) = Xsqlite3_status64 // sqlite3.c:124357:3:
- *(*func(*crt.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1688 /* .strlike */)) = Xsqlite3_strlike // sqlite3.c:124358:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1696 /* .db_cacheflush */)) = Xsqlite3_db_cacheflush // sqlite3.c:124359:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1704 /* .system_errno */)) = Xsqlite3_system_errno // sqlite3.c:124361:3:
- *(*func(*crt.TLS, uintptr, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1712 /* .trace_v2 */)) = Xsqlite3_trace_v2 // sqlite3.c:124363:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1720 /* .expanded_sql */)) = Xsqlite3_expanded_sql // sqlite3.c:124364:3:
- *(*func(*crt.TLS, uintptr, Sqlite3_int64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1728 /* .set_last_insert_rowid */)) = Xsqlite3_set_last_insert_rowid // sqlite3.c:124366:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1736 /* .prepare_v3 */)) = Xsqlite3_prepare_v3 // sqlite3.c:124368:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1744 /* .prepare16_v3 */)) = Xsqlite3_prepare16_v3 // sqlite3.c:124369:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1752 /* .bind_pointer */)) = Xsqlite3_bind_pointer // sqlite3.c:124370:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1760 /* .result_pointer */)) = Xsqlite3_result_pointer // sqlite3.c:124371:3:
- *(*func(*crt.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1768 /* .value_pointer */)) = Xsqlite3_value_pointer // sqlite3.c:124372:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1776 /* .vtab_nochange */)) = Xsqlite3_vtab_nochange // sqlite3.c:124374:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1784 /* .value_nochange */)) = Xsqlite3_value_nochange // sqlite3.c:124375:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1792 /* .vtab_collation */)) = Xsqlite3_vtab_collation // sqlite3.c:124376:3:
- *(*func(*crt.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1800 /* .keyword_count */)) = Xsqlite3_keyword_count // sqlite3.c:124378:3:
- *(*func(*crt.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1808 /* .keyword_name */)) = Xsqlite3_keyword_name // sqlite3.c:124379:3:
- *(*func(*crt.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1816 /* .keyword_check */)) = Xsqlite3_keyword_check // sqlite3.c:124380:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1824 /* .str_new */)) = Xsqlite3_str_new // sqlite3.c:124381:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1832 /* .str_finish */)) = Xsqlite3_str_finish // sqlite3.c:124382:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1840 /* .str_appendf */)) = Xsqlite3_str_appendf // sqlite3.c:124383:3:
- *(*func(*crt.TLS, uintptr, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1848 /* .str_vappendf */)) = Xsqlite3_str_vappendf // sqlite3.c:124384:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1856 /* .str_append */)) = Xsqlite3_str_append // sqlite3.c:124385:3:
- *(*func(*crt.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1864 /* .str_appendall */)) = Xsqlite3_str_appendall // sqlite3.c:124386:3:
- *(*func(*crt.TLS, uintptr, int32, int8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1872 /* .str_appendchar */)) = Xsqlite3_str_appendchar // sqlite3.c:124387:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1880 /* .str_reset */)) = Xsqlite3_str_reset // sqlite3.c:124388:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1888 /* .str_errcode */)) = Xsqlite3_str_errcode // sqlite3.c:124389:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1896 /* .str_length */)) = Xsqlite3_str_length // sqlite3.c:124390:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1904 /* .str_value */)) = Xsqlite3_str_value // sqlite3.c:124391:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1912 /* .create_window_function */)) = Xsqlite3_create_window_function // sqlite3.c:124393:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1928 /* .stmt_isexplain */)) = Xsqlite3_stmt_isexplain // sqlite3.c:124401:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1936 /* .value_frombind */)) = Xsqlite3_value_frombind // sqlite3.c:124402:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1944 /* .drop_modules */)) = Xsqlite3_drop_modules // sqlite3.c:124405:3:
- *(*func(*crt.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1952 /* .hard_heap_limit64 */)) = Xsqlite3_hard_heap_limit64 // sqlite3.c:124410:3:
- *(*func(*crt.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1960 /* .uri_key */)) = Xsqlite3_uri_key // sqlite3.c:124411:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1968 /* .filename_database */)) = Xsqlite3_filename_database // sqlite3.c:124412:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1976 /* .filename_journal */)) = Xsqlite3_filename_journal // sqlite3.c:124413:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1984 /* .filename_wal */)) = Xsqlite3_filename_wal // sqlite3.c:124414:3:
- *(*func(*crt.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1992 /* .create_filename */)) = Xsqlite3_create_filename // sqlite3.c:124416:3:
- *(*func(*crt.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2000 /* .free_filename */)) = Xsqlite3_free_filename // sqlite3.c:124417:3:
- *(*func(*crt.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2008 /* .database_file_object */)) = Xsqlite3_database_file_object // sqlite3.c:124418:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 0)) = Xsqlite3DbpageRegister // sqlite3.c:160418:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 8)) = sqlite3TestExtInit // sqlite3.c:160423:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 16)) = Xsqlite3StmtVtabInit // sqlite3.c:160428:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 24)) = Xsqlite3VdbeBytecodeVtabInit // sqlite3.c:160431:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statGetFuncdef)) + 24 /* .xSFunc */)) = statGet // sqlite3.c:108259:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statInitFuncdef)) + 24 /* .xSFunc */)) = statInit // sqlite3.c:107817:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statPushFuncdef)) + 24 /* .xSFunc */)) = statPush // sqlite3.c:108107:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 16 /* .xConnect */)) = stmtConnect // sqlite3.c:229727:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 24 /* .xBestIndex */)) = stmtBestIndex // sqlite3.c:229728:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 32 /* .xDisconnect */)) = stmtDisconnect // sqlite3.c:229729:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 48 /* .xOpen */)) = stmtOpen // sqlite3.c:229731:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 56 /* .xClose */)) = stmtClose // sqlite3.c:229732:3:
- *(*func(*crt.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 64 /* .xFilter */)) = stmtFilter // sqlite3.c:229733:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 72 /* .xNext */)) = stmtNext // sqlite3.c:229734:3:
- *(*func(*crt.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 80 /* .xEof */)) = stmtEof // sqlite3.c:229735:3:
- *(*func(*crt.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 88 /* .xColumn */)) = stmtColumn // sqlite3.c:229736:3:
- *(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 96 /* .xRowid */)) = stmtRowid // sqlite3.c:229737:3:
-}
-
-var ts1 = "DEFAULT_PAGE_SIZE=1024\x00DEFAULT_WAL_SYNCHRONOUS=1\x00ENABLE_BYTECODE_VTAB\x00ENABLE_STMTVTAB\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MAX_EXPR_DEPTH=0\x00MAX_MMAP_SIZE=8589934592\x00MUTEX_NOOP\x00NO_SYNC\x00TEMP_STORE=1\x00TEST\x00THREADSAFE=1\x003.32.3\x00BINARY\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00local time unavailable\x00second\x00minute\x00hour\x00day\x00month\x00year\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00%04d-%02d-%02d %02d:%02d:%02d\x00%02d:%02d:%02d\x00%04d-%02d-%02d\x00%02d\x00%06.3f\x00%03d\x00%.16g\x00%lld\x00%04d\x00julianday\x00date\x00time\x00datetime\x00strftime\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x000123456789ABCDEF0123456789abcdef\x00-x0\x00X0\x00%\x00NaN\x00Inf\x00\x00NULL\x00(NULL)\x00.\x00thstndrd\x00%s\x00922337203685477580\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00SorterNext\x00Prev\x00Next\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00Not\x00IfNot\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSmaller\x00SorterSort\x00Sort\x00Rewind\x00IdxLE\x00IdxGT\x00IdxLT\x00IdxGE\x00RowSetRead\x00Or\x00And\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IfNotZero\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseNotEq\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Init\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00Offset\x00Column\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00OpenWrite\x00OpenDup\x00OpenAutoindex\x00OpenEphemeral\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00SorterOpen\x00BitNot\x00SequenceTest\x00OpenPseudo\x00String8\x00Close\x00ColumnsUsed\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00Real\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00NONE\x00SHARED\x00RESERVED\x00PENDING\x00EXCLUSIVE\x00ERROR\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00TEST WR-LOCK %d %d %d (unix)\n\x00LOCK %d %s was %s(%s,%d) pid=%d (unix)\n\x00LOCK %d %s ok (already held) (unix)\n\x00LOCK %d %s %s (unix)\n\x00ok\x00failed\x00UNLOCK %d %d was %d(%d,%d) pid=%d (unix)\n\x00CLOSE %-3d\n\x00TEST WR-LOCK %d %d %d (dotlock)\n\x00UNLOCK %d %d was %d pid=%d (dotlock)\n\x00READ %-3d %5d %7lld %llu\n\x00WRITE %-3d %5d %7lld %llu\n\x00OPENDIR %-3d %s\n\x00SYNC %-3d\n\x00full_fsync\x00DIRSYNC %s (have_fullfsync=%d fullsync=%d)\n\x00%s-shm\x00readonly_shm\x00SHM-LOCK shmid-%d, pid-%d got %03x,%03x\n\x00OPEN %-3d %s\n\x00psow\x00unix-excl\x00%s.lock\x00SQLITE_TMPDIR\x00TMPDIR\x00/var/tmp\x00/usr/tmp\x00/tmp\x00%s/etilqs_%llx%c\x00modeof\x00OPENX %-3d %s 0%o\n\x00fsync\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00SQLite format 3\x00:memory:\x00@ \x00\n\x00invalid page number %d\x002nd reference to page %d\x00Failed to read ptrmap key=%d\x00Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)\x00failed to get page %d\x00freelist leaf count too big on page %d\x00%s is %d but should be %d\x00size\x00overflow list length\x00Page %d: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00On tree page %d cell %d: \x00On page %d at right child: \x00Offset %d out of range %d..%d\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %d\x00Fragmentation of %d bytes reported as %d on page %d\x00Main freelist: \x00max rootpage (%d) disagrees with header (%d)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %d is never used\x00Pointer map page %d is referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00B\x00,%s%s%s\x00N.\x00)\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%d\x00]\x00program\x00?\x008\x0016LE\x0016BE\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00cannot change %s wal mode from within a transaction\x00into\x00out of\x00database table is locked: %s\x00-- %s\x00statement aborts at %d: [%s] %s\x00out of memory\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00cannot open value of type %s\x00null\x00real\x00integer\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00CREATE TABLE x(addr INT,opcode TEXT,p1 INT,p2 INT,p3 INT,p4 TEXT,p5 INT,comment TEXT,subprog TEXT,stmt HIDDEN);\x00CREATE TABLE x(type TEXT,schema TEXT,name TEXT,wr INT,subprog TEXT,stmt HIDDEN);\x00table\x00index\x00(FK)\x00stmt-pointer\x00argument to %s() is not a valid SQL statement\x00tables_used\x00bytecode\x00main\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to likelihood() must be a constant between 0.0 and 1.0\x00not authorized to use function: %s\x00non-deterministic functions\x00%.*s() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %.*s()\x00no such function: %.*s\x00wrong number of arguments to function %.*s()\x00FILTER may not be used with non-aggregate %.*s()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00a GROUP BY clause is required before HAVING\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x000\x00too many arguments on function %T\x00unsafe use of %s()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00%sLIST SUBQUERY %d\x00CORRELATED \x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%s\x00generated column loop on \"%s\"\x00misuse of aggregate: %s()\x00unknown function: %s()\x00RAISE() may only be used within a trigger-program\x00B\x00C\x00D\x00E\x00sqlite_\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".%s WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d)=NULL \x00SELECT 1 FROM temp.%s WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1)=NULL \x00there is already another table or index with this name: %s\x00view %s may not be altered\x00UPDATE \"%w\".%s 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.%s 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_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".%s SET sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d) WHERE type = 'table' AND name = %Q\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00cannot rename columns of %s \"%s\"\x00UPDATE \"%w\".%s SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q) AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.%s SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00error in %s %s%s: %s\x00 after rename\x00\"%w\"\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00sqlite_stat3\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s %T cannot reference objects in database %s\x00%s cannot use variables\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00sqlite_temp_master\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00table %T already exists\x00there is already an index named %s\x00too many columns on %s\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00INTEGER\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.%s SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.%s SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.%s WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00unsupported use of NULLS %s\x00FIRST\x00LAST\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00CREATE%s INDEX %.*s\x00 UNIQUE\x00INSERT INTO %Q.%s 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.%s WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00a JOIN clause is required before %s\x00ON\x00USING\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00text\x00blob\x00integer overflow\x00%.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!.20e\x00 \x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00length\x00instr\x00printf\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00sum\x00total\x00avg\x00count\x00group_concat\x00glob\x00coalesce\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00sqlite3_extension_init\x00unable to open shared library [%s]\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00so\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00log\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00lock_status\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00onoffalseyestruextrafull\x00exclusive\x00normal\x00none\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00w\x00a\x00s\x00sissii\x00utf8\x00utf16le\x00utf16be\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00issisii\x00issisi\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00siX\x00*** in database %s ***\n\x00NULL value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00non-unique entry in index \x00wrong # of entries in index \x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00unknown\x00closed\x00ss\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unlocked\x00shared\x00reserved\x00pending\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00malformed database schema (%s)\x00%z - %s\x00create \x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown or unsupported join type: %T %T%s%T\x00RIGHT and FULL OUTER JOINs are not currently supported\x00naturaleftouterightfullinnercross\x00a NATURAL join may not have an ON or USING clause\x00cannot have both ON and USING clauses in the same join\x00cannot join using column %s - column not present in both tables\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00column%d\x00%.*z:%u\x00cannot use window functions in recursive queries\x00SETUP\x00recursive aggregate queries not supported\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00S\x00%s clause should come after %s not before\x00ORDER BY\x00LIMIT\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00subquery_%u\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00unsafe use of virtual table \"%s\"\x00*\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00SCAN TABLE %s%s%s\x00 USING COVERING INDEX \x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %u\x00MATERIALIZE %u\x00DISTINCT\x00GROUP BY\x00RIGHT PART OF ORDER BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00trigger %T already exists\x00cannot create trigger on system table\x00cannot create %s trigger on view: %S\x00BEFORE\x00AFTER\x00cannot create INSTEAD OF trigger on table: %S\x00INSERT INTO %Q.%s VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.%s WHERE name=%Q AND type='trigger'\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00ATTACH %Q AS vacuum_db\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_master WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_master WHERE type='index'\x00SELECT'INSERT INTO vacuum_db.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM vacuum_db.sqlite_master WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO vacuum_db.sqlite_master SELECT*FROM \"%w\".sqlite_master WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.%s SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00<expr>\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00 SUBQUERY %u\x00 TABLE %s\x00 AS %s\x00PRIMARY KEY\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00=\x00>? AND rowid<\x00 USING INTEGER PRIMARY KEY (rowid%s?)\x00 VIRTUAL TABLE INDEX %d:%s\x00MULTI-INDEX OR\x00INDEX %d\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00row_number\x00dense_rank\x00rank\x00percent_rank\x00cume_dist\x00ntile\x00last_value\x00nth_value\x00first_value\x00lead\x00lag\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00parser stack overflow\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%.*s\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00SQLITE_OK\x00SQLITE_ERROR\x00SQLITE_ERROR_SNAPSHOT\x00SQLITE_INTERNAL\x00SQLITE_PERM\x00SQLITE_ABORT\x00SQLITE_ABORT_ROLLBACK\x00SQLITE_BUSY\x00SQLITE_BUSY_RECOVERY\x00SQLITE_BUSY_SNAPSHOT\x00SQLITE_LOCKED\x00SQLITE_LOCKED_SHAREDCACHE\x00SQLITE_NOMEM\x00SQLITE_READONLY\x00SQLITE_READONLY_RECOVERY\x00SQLITE_READONLY_CANTINIT\x00SQLITE_READONLY_ROLLBACK\x00SQLITE_READONLY_DBMOVED\x00SQLITE_READONLY_DIRECTORY\x00SQLITE_INTERRUPT\x00SQLITE_IOERR\x00SQLITE_IOERR_READ\x00SQLITE_IOERR_SHORT_READ\x00SQLITE_IOERR_WRITE\x00SQLITE_IOERR_FSYNC\x00SQLITE_IOERR_DIR_FSYNC\x00SQLITE_IOERR_TRUNCATE\x00SQLITE_IOERR_FSTAT\x00SQLITE_IOERR_UNLOCK\x00SQLITE_IOERR_RDLOCK\x00SQLITE_IOERR_DELETE\x00SQLITE_IOERR_NOMEM\x00SQLITE_IOERR_ACCESS\x00SQLITE_IOERR_CHECKRESERVEDLOCK\x00SQLITE_IOERR_LOCK\x00SQLITE_IOERR_CLOSE\x00SQLITE_IOERR_DIR_CLOSE\x00SQLITE_IOERR_SHMOPEN\x00SQLITE_IOERR_SHMSIZE\x00SQLITE_IOERR_SHMLOCK\x00SQLITE_IOERR_SHMMAP\x00SQLITE_IOERR_SEEK\x00SQLITE_IOERR_DELETE_NOENT\x00SQLITE_IOERR_MMAP\x00SQLITE_IOERR_GETTEMPPATH\x00SQLITE_IOERR_CONVPATH\x00SQLITE_CORRUPT\x00SQLITE_CORRUPT_VTAB\x00SQLITE_NOTFOUND\x00SQLITE_FULL\x00SQLITE_CANTOPEN\x00SQLITE_CANTOPEN_NOTEMPDIR\x00SQLITE_CANTOPEN_ISDIR\x00SQLITE_CANTOPEN_FULLPATH\x00SQLITE_CANTOPEN_CONVPATH\x00SQLITE_CANTOPEN_SYMLINK\x00SQLITE_PROTOCOL\x00SQLITE_EMPTY\x00SQLITE_SCHEMA\x00SQLITE_TOOBIG\x00SQLITE_CONSTRAINT\x00SQLITE_CONSTRAINT_UNIQUE\x00SQLITE_CONSTRAINT_TRIGGER\x00SQLITE_CONSTRAINT_FOREIGNKEY\x00SQLITE_CONSTRAINT_CHECK\x00SQLITE_CONSTRAINT_PRIMARYKEY\x00SQLITE_CONSTRAINT_NOTNULL\x00SQLITE_CONSTRAINT_COMMITHOOK\x00SQLITE_CONSTRAINT_VTAB\x00SQLITE_CONSTRAINT_FUNCTION\x00SQLITE_CONSTRAINT_ROWID\x00SQLITE_MISMATCH\x00SQLITE_MISUSE\x00SQLITE_NOLFS\x00SQLITE_AUTH\x00SQLITE_FORMAT\x00SQLITE_RANGE\x00SQLITE_NOTADB\x00SQLITE_ROW\x00SQLITE_NOTICE\x00SQLITE_NOTICE_RECOVER_WAL\x00SQLITE_NOTICE_RECOVER_ROLLBACK\x00SQLITE_WARNING\x00SQLITE_WARNING_AUTOINDEX\x00SQLITE_DONE\x00SQLITE_UNKNOWN(%d)\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00mode\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00private\x00ro\x00rw\x00rwc\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00CREATE TABLE x( name TEXT, path TEXT, pageno INTEGER, pagetype TEXT, ncell INTEGER, payload INTEGER, unused INTEGER, mx_payload INTEGER, pgoffset INTEGER, pgsize INTEGER, schema TEXT HIDDEN, aggregate BOOLEAN HIDDEN)\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_master' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_master WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00CREATE TABLE x(pgno INTEGER PRIMARY KEY, data BLOB, schema HIDDEN)\x00read-only\x00cannot delete\x00cannot insert\x00no such schema\x00bad page number\x00bad page value\x00sqlite_dbpage\x00CREATE TABLE x(sql,ncol,ro,busy,nscan,nsort,naidx,nstep,reprep,run,mem)\x00sqlite_stmt\x002020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd\x00"
+ f func(*libc.TLS, uintptr) uintptr
+ }{Xsqlite3_value_dup})) // sqlite3.c:124649:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1640 /* .value_free */)) = Xsqlite3_value_free // sqlite3.c:124650:3:
+ *(*func(*libc.TLS, uintptr, U64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1648 /* .result_zeroblob64 */)) = Xsqlite3_result_zeroblob64 // sqlite3.c:124651:3:
+ *(*func(*libc.TLS, uintptr, int32, Sqlite3_uint64) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1656 /* .bind_zeroblob64 */)) = Xsqlite3_bind_zeroblob64 // sqlite3.c:124652:3:
+ *(*func(*libc.TLS, uintptr) uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1664 /* .value_subtype */)) = Xsqlite3_value_subtype // sqlite3.c:124654:3:
+ *(*func(*libc.TLS, uintptr, uint32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1672 /* .result_subtype */)) = Xsqlite3_result_subtype // sqlite3.c:124655:3:
+ *(*func(*libc.TLS, int32, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1680 /* .status64 */)) = Xsqlite3_status64 // sqlite3.c:124657:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1688 /* .strlike */)) = Xsqlite3_strlike // sqlite3.c:124658:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1696 /* .db_cacheflush */)) = Xsqlite3_db_cacheflush // sqlite3.c:124659:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1704 /* .system_errno */)) = Xsqlite3_system_errno // sqlite3.c:124661:3:
+ *(*func(*libc.TLS, uintptr, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1712 /* .trace_v2 */)) = Xsqlite3_trace_v2 // sqlite3.c:124663:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1720 /* .expanded_sql */)) = Xsqlite3_expanded_sql // sqlite3.c:124664:3:
+ *(*func(*libc.TLS, uintptr, Sqlite3_int64))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1728 /* .set_last_insert_rowid */)) = Xsqlite3_set_last_insert_rowid // sqlite3.c:124666:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1736 /* .prepare_v3 */)) = Xsqlite3_prepare_v3 // sqlite3.c:124668:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uint32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1744 /* .prepare16_v3 */)) = Xsqlite3_prepare16_v3 // sqlite3.c:124669:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1752 /* .bind_pointer */)) = Xsqlite3_bind_pointer // sqlite3.c:124670:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1760 /* .result_pointer */)) = Xsqlite3_result_pointer // sqlite3.c:124671:3:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1768 /* .value_pointer */)) = Xsqlite3_value_pointer // sqlite3.c:124672:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1776 /* .vtab_nochange */)) = Xsqlite3_vtab_nochange // sqlite3.c:124674:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1784 /* .value_nochange */)) = Xsqlite3_value_nochange // sqlite3.c:124675:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1792 /* .vtab_collation */)) = Xsqlite3_vtab_collation // sqlite3.c:124676:3:
+ *(*func(*libc.TLS) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1800 /* .keyword_count */)) = Xsqlite3_keyword_count // sqlite3.c:124678:3:
+ *(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1808 /* .keyword_name */)) = Xsqlite3_keyword_name // sqlite3.c:124679:3:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1816 /* .keyword_check */)) = Xsqlite3_keyword_check // sqlite3.c:124680:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1824 /* .str_new */)) = Xsqlite3_str_new // sqlite3.c:124681:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1832 /* .str_finish */)) = Xsqlite3_str_finish // sqlite3.c:124682:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1840 /* .str_appendf */)) = Xsqlite3_str_appendf // sqlite3.c:124683:3:
+ *(*func(*libc.TLS, uintptr, uintptr, Va_list))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1848 /* .str_vappendf */)) = Xsqlite3_str_vappendf // sqlite3.c:124684:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1856 /* .str_append */)) = Xsqlite3_str_append // sqlite3.c:124685:3:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1864 /* .str_appendall */)) = Xsqlite3_str_appendall // sqlite3.c:124686:3:
+ *(*func(*libc.TLS, uintptr, int32, int8))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1872 /* .str_appendchar */)) = Xsqlite3_str_appendchar // sqlite3.c:124687:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1880 /* .str_reset */)) = Xsqlite3_str_reset // sqlite3.c:124688:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1888 /* .str_errcode */)) = Xsqlite3_str_errcode // sqlite3.c:124689:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1896 /* .str_length */)) = Xsqlite3_str_length // sqlite3.c:124690:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1904 /* .str_value */)) = Xsqlite3_str_value // sqlite3.c:124691:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1912 /* .create_window_function */)) = Xsqlite3_create_window_function // sqlite3.c:124693:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1928 /* .stmt_isexplain */)) = Xsqlite3_stmt_isexplain // sqlite3.c:124701:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1936 /* .value_frombind */)) = Xsqlite3_value_frombind // sqlite3.c:124702:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1944 /* .drop_modules */)) = Xsqlite3_drop_modules // sqlite3.c:124705:3:
+ *(*func(*libc.TLS, Sqlite3_int64) Sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1952 /* .hard_heap_limit64 */)) = Xsqlite3_hard_heap_limit64 // sqlite3.c:124710:3:
+ *(*func(*libc.TLS, uintptr, int32) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1960 /* .uri_key */)) = Xsqlite3_uri_key // sqlite3.c:124711:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1968 /* .filename_database */)) = Xsqlite3_filename_database // sqlite3.c:124712:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1976 /* .filename_journal */)) = Xsqlite3_filename_journal // sqlite3.c:124713:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1984 /* .filename_wal */)) = Xsqlite3_filename_wal // sqlite3.c:124714:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 1992 /* .create_filename */)) = Xsqlite3_create_filename // sqlite3.c:124716:3:
+ *(*func(*libc.TLS, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2000 /* .free_filename */)) = Xsqlite3_free_filename // sqlite3.c:124717:3:
+ *(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3Apis)) + 2008 /* .database_file_object */)) = Xsqlite3_database_file_object // sqlite3.c:124718:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 0)) = Xsqlite3Fts5Init // sqlite3.c:161074:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 8)) = Xsqlite3RtreeInit // sqlite3.c:161080:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 16)) = Xsqlite3DbpageRegister // sqlite3.c:161083:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 24)) = Xsqlite3DbstatRegister // sqlite3.c:161086:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 32)) = sqlite3TestExtInit // sqlite3.c:161088:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 40)) = Xsqlite3Json1Init // sqlite3.c:161090:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 48)) = Xsqlite3StmtVtabInit // sqlite3.c:161093:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&sqlite3BuiltinExtensions)) + 56)) = Xsqlite3VdbeBytecodeVtabInit // sqlite3.c:161096:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statGetFuncdef)) + 24 /* .xSFunc */)) = statGet // sqlite3.c:108483:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statInitFuncdef)) + 24 /* .xSFunc */)) = statInit // sqlite3.c:108041:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&statPushFuncdef)) + 24 /* .xSFunc */)) = statPush // sqlite3.c:108331:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 16 /* .xConnect */)) = stmtConnect // sqlite3.c:230457:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 24 /* .xBestIndex */)) = stmtBestIndex // sqlite3.c:230458:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 32 /* .xDisconnect */)) = stmtDisconnect // sqlite3.c:230459:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 48 /* .xOpen */)) = stmtOpen // sqlite3.c:230461:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 56 /* .xClose */)) = stmtClose // sqlite3.c:230462:3:
+ *(*func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 64 /* .xFilter */)) = stmtFilter // sqlite3.c:230463:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 72 /* .xNext */)) = stmtNext // sqlite3.c:230464:3:
+ *(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 80 /* .xEof */)) = stmtEof // sqlite3.c:230465:3:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 88 /* .xColumn */)) = stmtColumn // sqlite3.c:230466:3:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&stmtModule)) + 96 /* .xRowid */)) = stmtRowid // sqlite3.c:230467:3:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 40 /* .xOpen */)) = rbuVfsOpen // sqlite3.c:201074:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 48 /* .xDelete */)) = rbuVfsDelete // sqlite3.c:201075:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 56 /* .xAccess */)) = rbuVfsAccess // sqlite3.c:201076:5:
+ *(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 64 /* .xFullPathname */)) = rbuVfsFullPathname // sqlite3.c:201077:5:
+ *(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 72 /* .xDlOpen */)) = rbuVfsDlOpen // sqlite3.c:201080:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 80 /* .xDlError */)) = rbuVfsDlError // sqlite3.c:201081:5:
+ *(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 88 /* .xDlSym */)) = rbuVfsDlSym // sqlite3.c:201082:5:
+ *(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 96 /* .xDlClose */)) = rbuVfsDlClose // sqlite3.c:201083:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 104 /* .xRandomness */)) = rbuVfsRandomness // sqlite3.c:201088:5:
+ *(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 112 /* .xSleep */)) = rbuVfsSleep // sqlite3.c:201089:5:
+ *(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 120 /* .xCurrentTime */)) = rbuVfsCurrentTime // sqlite3.c:201090:5:
+ *(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&vfs_template)) + 128 /* .xGetLastError */)) = rbuVfsGetLastError // sqlite3.c:201091:5:
+}
+
+var ts1 = "DEFAULT_PAGE_SIZE=1024\x00ENABLE_BYTECODE_VTAB\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_JSON1\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_STMTVTAB\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MUTEX_NOOP\x00SOUNDEX\x00TEMP_STORE=1\x00TEST\x00THREADSAFE=1\x003.33.0\x00BINARY\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00local time unavailable\x00second\x00minute\x00hour\x00day\x00month\x00year\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00%04d-%02d-%02d %02d:%02d:%02d\x00%02d:%02d:%02d\x00%04d-%02d-%02d\x00%02d\x00%06.3f\x00%03d\x00%.16g\x00%04d\x00julianday\x00date\x00time\x00datetime\x00strftime\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x000123456789ABCDEF0123456789abcdef\x00-x0\x00X0\x00%\x00NaN\x00Inf\x00\x00NULL\x00(NULL)\x00.\x00thstndrd\x00%s\x00922337203685477580\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00\x00AutoCommit\x00\x00Transaction\x00\x00SorterNext\x00\x00Prev\x00\x00Next\x00\x00Checkpoint\x00\x00JournalMode\x00\x00Vacuum\x00\x00VFilter\x00iplan=r[P3] zplan='P4'\x00VUpdate\x00data=r[P3@P2]\x00Goto\x00\x00Gosub\x00\x00InitCoroutine\x00\x00Yield\x00\x00MustBeInt\x00\x00Jump\x00\x00Once\x00\x00If\x00\x00Not\x00r[P2]= !r[P1]\x00IfNot\x00\x00IfNullRow\x00if P1.nullRow then r[P3]=NULL, goto P2\x00SeekLT\x00key=r[P3@P4]\x00SeekLE\x00key=r[P3@P4]\x00SeekGE\x00key=r[P3@P4]\x00SeekGT\x00key=r[P3@P4]\x00IfNotOpen\x00if( !csr[P1] ) goto P2\x00IfNoHope\x00key=r[P3@P4]\x00NoConflict\x00key=r[P3@P4]\x00NotFound\x00key=r[P3@P4]\x00Found\x00key=r[P3@P4]\x00SeekRowid\x00intkey=r[P3]\x00NotExists\x00intkey=r[P3]\x00Last\x00\x00IfSmaller\x00\x00SorterSort\x00\x00Sort\x00\x00Rewind\x00\x00IdxLE\x00key=r[P3@P4]\x00IdxGT\x00key=r[P3@P4]\x00IdxLT\x00key=r[P3@P4]\x00IdxGE\x00key=r[P3@P4]\x00RowSetRead\x00r[P3]=rowset(P1)\x00Or\x00r[P3]=(r[P1] || r[P2])\x00And\x00r[P3]=(r[P1] && r[P2])\x00RowSetTest\x00if r[P3] in rowset(P1) goto P2\x00Program\x00\x00FkIfZero\x00if fkctr[P1]==0 goto P2\x00IfPos\x00if r[P1]>0 then r[P1]-=P3, goto P2\x00IfNotZero\x00if r[P1]!=0 then r[P1]--, goto P2\x00IsNull\x00if r[P1]==NULL goto P2\x00NotNull\x00if r[P1]!=NULL goto P2\x00Ne\x00IF r[P3]!=r[P1]\x00Eq\x00IF r[P3]==r[P1]\x00Gt\x00IF r[P3]>r[P1]\x00Le\x00IF r[P3]<=r[P1]\x00Lt\x00IF r[P3]<r[P1]\x00Ge\x00IF r[P3]>=r[P1]\x00ElseNotEq\x00\x00DecrJumpZero\x00if (--r[P1])==0 goto P2\x00IncrVacuum\x00\x00VNext\x00\x00Init\x00Start at P2\x00PureFunc\x00r[P3]=func(r[P2@NP])\x00Function\x00r[P3]=func(r[P2@NP])\x00Return\x00\x00EndCoroutine\x00\x00HaltIfNull\x00if r[P3]=null halt\x00Halt\x00\x00Integer\x00r[P2]=P1\x00Int64\x00r[P2]=P4\x00String\x00r[P2]='P4' (len=P1)\x00Null\x00r[P2..P3]=NULL\x00SoftNull\x00r[P1]=NULL\x00Blob\x00r[P2]=P4 (len=P1)\x00Variable\x00r[P2]=parameter(P1,P4)\x00Move\x00r[P2@P3]=r[P1@P3]\x00Copy\x00r[P2@P3+1]=r[P1@P3+1]\x00SCopy\x00r[P2]=r[P1]\x00IntCopy\x00r[P2]=r[P1]\x00ResultRow\x00output=r[P1@P2]\x00CollSeq\x00\x00AddImm\x00r[P1]=r[P1]+P2\x00RealAffinity\x00\x00Cast\x00affinity(r[P1])\x00Permutation\x00\x00Compare\x00r[P1@P3] <-> r[P2@P3]\x00IsTrue\x00r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4\x00Offset\x00r[P3] = sqlite_offset(P1)\x00Column\x00r[P3]=PX\x00Affinity\x00affinity(r[P1@P2])\x00MakeRecord\x00r[P3]=mkrec(r[P1@P2])\x00Count\x00r[P2]=count()\x00ReadCookie\x00\x00SetCookie\x00\x00ReopenIdx\x00root=P2 iDb=P3\x00OpenRead\x00root=P2 iDb=P3\x00OpenWrite\x00root=P2 iDb=P3\x00OpenDup\x00\x00OpenAutoindex\x00nColumn=P2\x00OpenEphemeral\x00nColumn=P2\x00BitAnd\x00r[P3]=r[P1]&r[P2]\x00BitOr\x00r[P3]=r[P1]|r[P2]\x00ShiftLeft\x00r[P3]=r[P2]<<r[P1]\x00ShiftRight\x00r[P3]=r[P2]>>r[P1]\x00Add\x00r[P3]=r[P1]+r[P2]\x00Subtract\x00r[P3]=r[P2]-r[P1]\x00Multiply\x00r[P3]=r[P1]*r[P2]\x00Divide\x00r[P3]=r[P2]/r[P1]\x00Remainder\x00r[P3]=r[P2]%r[P1]\x00Concat\x00r[P3]=r[P2]+r[P1]\x00SorterOpen\x00\x00BitNot\x00r[P2]= ~r[P1]\x00SequenceTest\x00if( cursor[P1].ctr++ ) pc = P2\x00OpenPseudo\x00P3 columns in r[P2]\x00String8\x00r[P2]='P4'\x00Close\x00\x00ColumnsUsed\x00\x00SeekHit\x00seekHit=P2\x00Sequence\x00r[P2]=cursor[P1].ctr++\x00NewRowid\x00r[P2]=rowid\x00Insert\x00intkey=r[P3] data=r[P2]\x00Delete\x00\x00ResetCount\x00\x00SorterCompare\x00if key(P1)!=trim(r[P3],P4) goto P2\x00SorterData\x00r[P2]=data\x00RowData\x00r[P2]=data\x00Rowid\x00r[P2]=rowid\x00NullRow\x00\x00SeekEnd\x00\x00IdxInsert\x00key=r[P2]\x00SorterInsert\x00key=r[P2]\x00IdxDelete\x00key=r[P2@P3]\x00DeferredSeek\x00Move P3 to P1.rowid if needed\x00IdxRowid\x00r[P2]=rowid\x00FinishSeek\x00\x00Destroy\x00\x00Clear\x00\x00ResetSorter\x00\x00CreateBtree\x00r[P2]=root iDb=P1 flags=P3\x00SqlExec\x00\x00ParseSchema\x00\x00LoadAnalysis\x00\x00DropTable\x00\x00DropIndex\x00\x00DropTrigger\x00\x00IntegrityCk\x00\x00RowSetAdd\x00rowset(P1)=r[P2]\x00Param\x00\x00FkCounter\x00fkctr[P1]+=P2\x00Real\x00r[P2]=P4\x00MemMax\x00r[P1]=max(r[P1],r[P2])\x00OffsetLimit\x00if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)\x00AggInverse\x00accum=r[P3] inverse(r[P2@P5])\x00AggStep\x00accum=r[P3] step(r[P2@P5])\x00AggStep1\x00accum=r[P3] step(r[P2@P5])\x00AggValue\x00r[P3]=value N=P2\x00AggFinal\x00accum=r[P1] N=P2\x00Expire\x00\x00CursorLock\x00\x00CursorUnlock\x00\x00TableLock\x00iDb=P1 root=P2 write=P3\x00VBegin\x00\x00VCreate\x00\x00VDestroy\x00\x00VOpen\x00\x00VColumn\x00r[P3]=vcolumn(P2)\x00VRename\x00\x00Pagecount\x00\x00MaxPgcnt\x00\x00Trace\x00\x00CursorHint\x00\x00ReleaseReg\x00release r[P1@P2] mask P3\x00Noop\x00\x00Explain\x00\x00Abortable\x00\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00NONE\x00SHARED\x00RESERVED\x00PENDING\x00EXCLUSIVE\x00ERROR\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00TEST WR-LOCK %d %d %d (unix)\n\x00LOCK %d %s was %s(%s,%d) pid=%d (unix)\n\x00LOCK %d %s ok (already held) (unix)\n\x00LOCK %d %s %s (unix)\n\x00ok\x00failed\x00UNLOCK %d %d was %d(%d,%d) pid=%d (unix)\n\x00CLOSE %-3d\n\x00TEST WR-LOCK %d %d %d (dotlock)\n\x00UNLOCK %d %d was %d pid=%d (dotlock)\n\x00READ %-3d %5d %7lld %llu\n\x00WRITE %-3d %5d %7lld %llu\n\x00OPENDIR %-3d %s\n\x00SYNC %-3d\n\x00full_fsync\x00DIRSYNC %s (have_fullfsync=%d fullsync=%d)\n\x00%s-shm\x00readonly_shm\x00SHM-LOCK shmid-%d, pid-%d got %03x,%03x\n\x00OPEN %-3d %s\n\x00psow\x00unix-excl\x00%s.lock\x00SQLITE_TMPDIR\x00TMPDIR\x00/var/tmp\x00/usr/tmp\x00/tmp\x00%s/etilqs_%llx%c\x00modeof\x00OPENX %-3d %s 0%o\n\x00fsync\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00SQLite format 3\x00:memory:\x00@ \x00\n\x00invalid page number %d\x002nd reference to page %d\x00Failed to read ptrmap key=%d\x00Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)\x00failed to get page %d\x00freelist leaf count too big on page %d\x00%s is %d but should be %d\x00size\x00overflow list length\x00Page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00On tree page %u cell %d: \x00On page %u at right child: \x00Offset %d out of range %d..%d\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %d bytes reported as %d on page %u\x00Main freelist: \x00max rootpage (%d) disagrees with header (%d)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %d is never used\x00Pointer map page %d is referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00IF \x00r[P2] = (%s)\x00if %s goto P2\x00@P\x00+1\x00%d\x00%d..%d\x00@NP\x00..P3\x00; %s\x00k(%d\x00B\x00,%s%s%s\x00N.\x00)\x00%.18s-%s\x00%s(%d)\x00%lld\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00?\x008\x0016LE\x0016BE\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00cannot change %s wal mode from within a transaction\x00into\x00out of\x00database table is locked: %s\x00-- %s\x00statement aborts at %d: [%s] %s\x00out of memory\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00cannot open value of type %s\x00null\x00real\x00integer\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00CREATE TABLE x(addr INT,opcode TEXT,p1 INT,p2 INT,p3 INT,p4 TEXT,p5 INT,comment TEXT,subprog TEXT,stmt HIDDEN);\x00CREATE TABLE x(type TEXT,schema TEXT,name TEXT,wr INT,subprog TEXT,stmt HIDDEN);\x00table\x00index\x00(FK)\x00stmt-pointer\x00argument to %s() is not a valid SQL statement\x00tables_used\x00bytecode\x00main\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to likelihood() must be a constant between 0.0 and 1.0\x00not authorized to use function: %s\x00non-deterministic functions\x00%.*s() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %.*s()\x00no such function: %.*s\x00wrong number of arguments to function %.*s()\x00FILTER may not be used with non-aggregate %.*s()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00a GROUP BY clause is required before HAVING\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x000\x00too many arguments on function %T\x00unsafe use of %s()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00first_entry_in(%d)\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00return address\x00Result of SELECT %u\x00RHS of IN operator\x00%sLIST SUBQUERY %d\x00CORRELATED \x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x00Init subquery result\x00Init EXISTS result\x001\x00begin IN expr\x00end IN expr\x000x\x00hex literal too big: %s%s\x00generated column loop on \"%s\"\x00%s.rowid\x00%s.%s\x00misuse of aggregate: %s()\x00unknown function: %s()\x00r[%d]=%s.%s\x00rowid\x00RAISE() may only be used within a trigger-program\x00B\x00C\x00D\x00E\x00sqlite_\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1)=NULL \x00there is already another table or index with this name: %s\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d) WHERE type = 'table' AND name = %Q\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00cannot rename columns of %s \"%s\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q) AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00error in %s %s%s: %s\x00 after rename\x00\"%w\"\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00%s.expr(%d)\x00sqlite\\_%\x00Analysis for %s.%s\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s %T cannot reference objects in database %s\x00%s cannot use variables\x00authorizer malfunction\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00usesStmtJournal=%d\x00sqlite_temp_schema\x00sqlite_schema\x00sqlite_temp_master\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00table %T already exists\x00there is already an index named %s\x00too many columns on %s\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00INTEGER\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00unsupported use of NULLS %s\x00FIRST\x00LAST\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00CREATE%s INDEX %.*s\x00 UNIQUE\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00a JOIN clause is required before %s\x00ON\x00USING\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00text\x00blob\x00integer overflow\x00%.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!.20e\x00 \x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00length\x00instr\x00printf\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00sum\x00total\x00avg\x00count\x00group_concat\x00glob\x00coalesce\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00UPSERT constraint goes first\x00trigger count\x00defer IPK REPLACE until last\x00uniqueness check for ROWID\x00Skip upsert subroutine\x00prep index %s\x00%s column %d\x00for %s\x00bypass recheck\x00Do IPK REPLACE\x00sqlite3_extension_init\x00unable to open shared library [%s]\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00so\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00fkid\x00file\x00busy\x00log\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00lock_status\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00onoffalseyestruextrafull\x00exclusive\x00normal\x00none\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00w\x00a\x00s\x00sissii\x00utf8\x00utf16le\x00utf16be\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00issisii\x00issisi\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00siX\x00*** in database %s ***\n\x00NULL value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00non-unique entry in index \x00wrong # of entries in index \x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00unknown\x00closed\x00ss\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unlocked\x00shared\x00reserved\x00pending\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00malformed database schema (%s)\x00%z - %s\x00create \x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown or unsupported join type: %T %T%s%T\x00RIGHT and FULL OUTER JOINs are not currently supported\x00naturaleftouterightfullinnercross\x00a NATURAL join may not have an ON or USING clause\x00cannot have both ON and USING clauses in the same join\x00cannot join using column %s - column not present in both tables\x00OFFSET\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00column%d\x00%.*z:%u\x00LIMIT counter\x00OFFSET counter\x00LIMIT+OFFSET\x00cannot use window functions in recursive queries\x00Queue table\x00SETUP\x00recursive aggregate queries not supported\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00S\x00%s clause should come after %s not before\x00ORDER BY\x00LIMIT\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00Jump ahead if LIMIT reached\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00left SELECT\x00LEFT\x00right SELECT\x00RIGHT\x00Output routine for A\x00Output routine for B\x00eof-A subroutine\x00eof-B subroutine\x00A-lt-B subroutine\x00A-eq-B subroutine\x00A-gt-B subroutine\x00no such index: %s\x00'%s' is not a function\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00subquery_%u\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00unsafe use of virtual table \"%s\"\x00*\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00SCAN TABLE %s%s%s\x00 USING COVERING INDEX \x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %u\x00materialize \"%s\"\x00MATERIALIZE %u\x00end %s\x00inner-loop subroutine\x00end inner-loop subroutine\x00clear abort flag\x00DISTINCT\x00GROUP BY\x00GROUP BY sort\x00output one row\x00check abort flag\x00reset accumulator\x00indicate data in accumulator\x00output final row\x00set abort flag\x00Groupby result generator entry point\x00end groupby result generator\x00indicate accumulator empty\x00RIGHT PART OF ORDER BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00trigger %T already exists\x00cannot create trigger on system table\x00cannot create %s trigger on view: %S\x00BEFORE\x00AFTER\x00cannot create INSTEAD OF trigger on table: %S\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00abort\x00rollback\x00fail\x00ignore\x00default\x00n/a\x00Start: %s.%s (%s %s%s%s ON %s)\x00UPDATE\x00INSERT\x00DELETE\x00-- TRIGGER %s\x00End: %s.%s\x00Call: %s.%s\x00fkey\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00Begin DO UPDATE of UPSERT\x00End DO UPDATE of UPSERT\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00ATTACH %Q AS vacuum_db\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO vacuum_db.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM vacuum_db.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO vacuum_db.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00<expr>\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00 SUBQUERY %u\x00 TABLE %s\x00 AS %s\x00PRIMARY KEY\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00=\x00>? AND rowid<\x00 USING INTEGER PRIMARY KEY (rowid%s?)\x00 VIRTUAL TABLE INDEX %d:%s\x00begin skip-scan on %s\x00init LEFT JOIN no-match flag\x00next row of %s\x00NULL-scan pass ctr\x00If NULL-scan 2nd pass\x00If NULL-scan 1st pass\x00MULTI-INDEX OR\x00INDEX %d\x00record LEFT JOIN hit\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00next skip-scan on %s\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00row_number\x00dense_rank\x00rank\x00percent_rank\x00cume_dist\x00ntile\x00last_value\x00nth_value\x00first_value\x00lead\x00lag\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00call flush_partition\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00parser stack overflow\x00unknown table option: %.*s\x00set list\x00near \"%T\": syntax error\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%.*s\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00SQLITE_OK\x00SQLITE_ERROR\x00SQLITE_ERROR_SNAPSHOT\x00SQLITE_INTERNAL\x00SQLITE_PERM\x00SQLITE_ABORT\x00SQLITE_ABORT_ROLLBACK\x00SQLITE_BUSY\x00SQLITE_BUSY_RECOVERY\x00SQLITE_BUSY_SNAPSHOT\x00SQLITE_LOCKED\x00SQLITE_LOCKED_SHAREDCACHE\x00SQLITE_NOMEM\x00SQLITE_READONLY\x00SQLITE_READONLY_RECOVERY\x00SQLITE_READONLY_CANTINIT\x00SQLITE_READONLY_ROLLBACK\x00SQLITE_READONLY_DBMOVED\x00SQLITE_READONLY_DIRECTORY\x00SQLITE_INTERRUPT\x00SQLITE_IOERR\x00SQLITE_IOERR_READ\x00SQLITE_IOERR_SHORT_READ\x00SQLITE_IOERR_WRITE\x00SQLITE_IOERR_FSYNC\x00SQLITE_IOERR_DIR_FSYNC\x00SQLITE_IOERR_TRUNCATE\x00SQLITE_IOERR_FSTAT\x00SQLITE_IOERR_UNLOCK\x00SQLITE_IOERR_RDLOCK\x00SQLITE_IOERR_DELETE\x00SQLITE_IOERR_NOMEM\x00SQLITE_IOERR_ACCESS\x00SQLITE_IOERR_CHECKRESERVEDLOCK\x00SQLITE_IOERR_LOCK\x00SQLITE_IOERR_CLOSE\x00SQLITE_IOERR_DIR_CLOSE\x00SQLITE_IOERR_SHMOPEN\x00SQLITE_IOERR_SHMSIZE\x00SQLITE_IOERR_SHMLOCK\x00SQLITE_IOERR_SHMMAP\x00SQLITE_IOERR_SEEK\x00SQLITE_IOERR_DELETE_NOENT\x00SQLITE_IOERR_MMAP\x00SQLITE_IOERR_GETTEMPPATH\x00SQLITE_IOERR_CONVPATH\x00SQLITE_CORRUPT\x00SQLITE_CORRUPT_VTAB\x00SQLITE_NOTFOUND\x00SQLITE_FULL\x00SQLITE_CANTOPEN\x00SQLITE_CANTOPEN_NOTEMPDIR\x00SQLITE_CANTOPEN_ISDIR\x00SQLITE_CANTOPEN_FULLPATH\x00SQLITE_CANTOPEN_CONVPATH\x00SQLITE_CANTOPEN_SYMLINK\x00SQLITE_PROTOCOL\x00SQLITE_EMPTY\x00SQLITE_SCHEMA\x00SQLITE_TOOBIG\x00SQLITE_CONSTRAINT\x00SQLITE_CONSTRAINT_UNIQUE\x00SQLITE_CONSTRAINT_TRIGGER\x00SQLITE_CONSTRAINT_FOREIGNKEY\x00SQLITE_CONSTRAINT_CHECK\x00SQLITE_CONSTRAINT_PRIMARYKEY\x00SQLITE_CONSTRAINT_NOTNULL\x00SQLITE_CONSTRAINT_COMMITHOOK\x00SQLITE_CONSTRAINT_VTAB\x00SQLITE_CONSTRAINT_FUNCTION\x00SQLITE_CONSTRAINT_ROWID\x00SQLITE_MISMATCH\x00SQLITE_MISUSE\x00SQLITE_NOLFS\x00SQLITE_AUTH\x00SQLITE_FORMAT\x00SQLITE_RANGE\x00SQLITE_NOTADB\x00SQLITE_ROW\x00SQLITE_NOTICE\x00SQLITE_NOTICE_RECOVER_WAL\x00SQLITE_NOTICE_RECOVER_ROLLBACK\x00SQLITE_WARNING\x00SQLITE_WARNING_AUTOINDEX\x00SQLITE_DONE\x00SQLITE_UNKNOWN(%d)\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00mode\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00private\x00ro\x00rw\x00rwc\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00[0]\x00JSON path error near '%q'\x00json_%s() needs an odd number of arguments\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%d]\x00.%.*s\x00$\x00json\x00json_array\x00json_array_length\x00json_extract\x00json_insert\x00json_object\x00json_patch\x00json_quote\x00json_remove\x00json_replace\x00json_set\x00json_type\x00json_valid\x00json_group_array\x00json_group_object\x00json_each\x00json_tree\x00%s_node\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00);\x00,%.*s REAL\x00,%.*s INT\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00Mapping (%lld -> %lld) missing from %s table\x00%_rowid\x00%_parent\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00END\x00wrong number of arguments to function rtreecheck()\x00[\x00[%!g,%!g],\x00[%!g,%!g]]\x00<polyline points=\x00%c%g,%g\x00 %g,%g'\x00 %s\x00></polyline>\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql LIKE 'create virtual%%'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00table %q %s rbu_rowid column\x00may not have\x00requires\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00 NOT NULL\x00%z, %z\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00 WITHOUT ROWID\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00AND\x00WHERE\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00, _rowid_\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00, 0 AS rbu_rowid\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x000 AS \x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file://%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00file:%s-vactmp?rbu_memory=1%s%s\x00&\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00database modified during rbu %s\x00vacuum\x00update\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00CREATE TABLE x( name TEXT, path TEXT, pageno INTEGER, pagetype TEXT, ncell INTEGER, payload INTEGER, unused INTEGER, mx_payload INTEGER, pgoffset INTEGER, pgsize INTEGER, schema TEXT HIDDEN, aggregate BOOLEAN HIDDEN)\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00CREATE TABLE x(pgno INTEGER PRIMARY KEY, data BLOB, schema HIDDEN)\x00read-only\x00cannot delete\x00cannot insert\x00no such schema\x00bad page number\x00bad page value\x00sqlite_dbpage\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00snippet\x00highlight\x00bm25\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00unrecognized option: \"%.*s\"\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00fts5: %s queries are not supported (detail!=full)\x00phrase\x00%s \x00-col %d \x00-col {%d\x00 %d\x00} \x00-near %d \x00--\x00 {\x00 [%z]\x00\"\"\x00%s : \x00NEAR(\x00 + \x00, %d)\x00 NOT \x00 OR \x00%s%s%z%s\x00nearset\x00wrong number of arguments to function %s\x00fts5_expr_tcl\x00fts5_expr\x00wrong number of arguments to function fts5_isalnum\x00L*\x00N*\x00Co\x00wrong number of arguments to function fts5_fold\x00fts5_isalnum\x00fts5_fold\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00{averages} \x00{structure}\x00{%ssegid=%d h=%d pgno=%d}\x00dlidx \x00 {lvl=%d nMerge=%d nSeg=%d\x00 {id=%d leaves=%d..%d}\x00%s%d\x00 id=%lld\x00 nPos=%d%s\x00+\x00 %lld%s\x00 %d(%lld)\x00 term=%.*s\x00corrupt\x00should be: fts5_rowid(subject, ....)\x00segment\x00should be: fts5_rowid('segment', segid, pgno))\x00first arg to fts5_rowid() must be 'segment'\x00fts5_decode\x00fts5_decode_none\x00fts5_rowid\x00recursively defined fts5 content table\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00DESC\x00ASC\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%s: table does not support scanning\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00cannot %s contentless fts5 table: %s\x00DELETE from\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f\x00config\x00fts5\x00fts5_source_id\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x00CREATE TABLE x(sql,ncol,ro,busy,nscan,nsort,naidx,nstep,reprep,run,mem)\x00sqlite_stmt\x002020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f\x00"
var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data
diff --git a/mutex.go b/mutex.go
index de753d3..81df313 100644
--- a/mutex.go
+++ b/mutex.go
@@ -9,28 +9,29 @@ import (
"sync/atomic"
"unsafe"
- "modernc.org/crt/v3"
+ "modernc.org/libc"
+ "modernc.org/libc/sys/types"
"modernc.org/sqlite/lib"
)
var (
mutexMethods = sqlite3.Sqlite3_mutex_methods{
- FxMutexInit: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) int32 }{mutexInit})),
- FxMutexEnd: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS) int32 }{mutexEnd})),
+ FxMutexInit: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{mutexInit})),
+ FxMutexEnd: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS) int32 }{mutexEnd})),
FxMutexAlloc: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, int32) uintptr
+ f func(*libc.TLS, int32) uintptr
}{mutexAlloc})),
- FxMutexFree: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{mutexFree})),
- FxMutexEnter: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{mutexEnter})),
+ FxMutexFree: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{mutexFree})),
+ FxMutexEnter: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{mutexEnter})),
FxMutexTry: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) int32
+ f func(*libc.TLS, uintptr) int32
}{mutexTry})),
- FxMutexLeave: *(*uintptr)(unsafe.Pointer(&struct{ f func(*crt.TLS, uintptr) }{mutexLeave})),
+ FxMutexLeave: *(*uintptr)(unsafe.Pointer(&struct{ f func(*libc.TLS, uintptr) }{mutexLeave})),
FxMutexHeld: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) int32
+ f func(*libc.TLS, uintptr) int32
}{mutexHeld})),
FxMutexNotheld: *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr) int32
+ f func(*libc.TLS, uintptr) int32
}{mutexNotheld})),
}
@@ -80,6 +81,7 @@ func (m *mutex) enter(id int32) {
m.Unlock()
m.wait.Lock()
+ //lint:ignore SA2001 TODO report staticcheck issue
m.wait.Unlock()
}
}
@@ -138,10 +140,10 @@ func (m *mutex) leave(id int32) {
//
// If xMutexInit fails in any way, it is expected to clean up after itself
// prior to returning.
-func mutexInit(tls *crt.TLS) int32 { return sqlite3.SQLITE_OK }
+func mutexInit(tls *libc.TLS) int32 { return sqlite3.SQLITE_OK }
// int (*xMutexEnd)(void);
-func mutexEnd(tls *crt.TLS) int32 { return sqlite3.SQLITE_OK }
+func mutexEnd(tls *libc.TLS) int32 { return sqlite3.SQLITE_OK }
// sqlite3_mutex *(*xMutexAlloc)(int);
//
@@ -187,15 +189,15 @@ func mutexEnd(tls *crt.TLS) int32 { return sqlite3.SQLITE_OK }
// SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() returns a
// different mutex on every call. For the static mutex types, the same mutex is
// returned on every call that has the same type number.
-func mutexAlloc(tls *crt.TLS, typ int32) uintptr {
+func mutexAlloc(tls *libc.TLS, typ int32) uintptr {
defer func() {
}()
switch typ {
case sqlite3.SQLITE_MUTEX_FAST:
- return crt.Xcalloc(tls, 1, crt.Size_t(unsafe.Sizeof(mutex{})))
+ return libc.Xcalloc(tls, 1, types.Size_t(unsafe.Sizeof(mutex{})))
case sqlite3.SQLITE_MUTEX_RECURSIVE:
- p := crt.Xcalloc(tls, 1, crt.Size_t(unsafe.Sizeof(mutex{})))
- (*mutex)(unsafe.Pointer(uintptr(p))).recursive = true
+ p := libc.Xcalloc(tls, 1, types.Size_t(unsafe.Sizeof(mutex{})))
+ (*mutex)(unsafe.Pointer(p)).recursive = true
return p
case sqlite3.SQLITE_MUTEX_STATIC_MASTER:
return uintptr(unsafe.Pointer(&mutexMaster))
@@ -227,7 +229,7 @@ func mutexAlloc(tls *crt.TLS, typ int32) uintptr {
}
// void (*xMutexFree)(sqlite3_mutex *);
-func mutexFree(tls *crt.TLS, m uintptr) { crt.Xfree(tls, m) }
+func mutexFree(tls *libc.TLS, m uintptr) { libc.Xfree(tls, m) }
// The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt to enter
// a mutex. If another thread is already within the mutex,
@@ -244,7 +246,7 @@ func mutexFree(tls *crt.TLS, m uintptr) { crt.Xfree(tls, m) }
// no-ops.
// void (*xMutexEnter)(sqlite3_mutex *);
-func mutexEnter(tls *crt.TLS, m uintptr) {
+func mutexEnter(tls *libc.TLS, m uintptr) {
if m == 0 {
return
}
@@ -253,7 +255,7 @@ func mutexEnter(tls *crt.TLS, m uintptr) {
}
// int (*xMutexTry)(sqlite3_mutex *);
-func mutexTry(tls *crt.TLS, m uintptr) int32 {
+func mutexTry(tls *libc.TLS, m uintptr) int32 {
if m == 0 {
return sqlite3.SQLITE_OK
}
@@ -262,7 +264,7 @@ func mutexTry(tls *crt.TLS, m uintptr) int32 {
}
// void (*xMutexLeave)(sqlite3_mutex *);
-func mutexLeave(tls *crt.TLS, m uintptr) {
+func mutexLeave(tls *libc.TLS, m uintptr) {
if m == 0 {
return
}
@@ -295,19 +297,19 @@ func mutexLeave(tls *crt.TLS, m uintptr) {
// also return 1 when given a NULL pointer.
// int (*xMutexHeld)(sqlite3_mutex *);
-func mutexHeld(tls *crt.TLS, m uintptr) int32 {
+func mutexHeld(tls *libc.TLS, m uintptr) int32 {
if m == 0 {
return 1
}
- return crt.Bool32(atomic.LoadInt32(&(*mutex)(unsafe.Pointer(m)).id) == tls.ID)
+ return libc.Bool32(atomic.LoadInt32(&(*mutex)(unsafe.Pointer(m)).id) == tls.ID)
}
// int (*xMutexNotheld)(sqlite3_mutex *);
-func mutexNotheld(tls *crt.TLS, m uintptr) int32 {
+func mutexNotheld(tls *libc.TLS, m uintptr) int32 {
if m == 0 {
return 1
}
- return crt.Bool32(atomic.LoadInt32(&(*mutex)(unsafe.Pointer(m)).id) != tls.ID)
+ return libc.Bool32(atomic.LoadInt32(&(*mutex)(unsafe.Pointer(m)).id) != tls.ID)
}
diff --git a/speedtest1/main_linux_amd64.go b/speedtest1/main_linux_amd64.go
index 5e7a901..37334c1 100644
--- a/speedtest1/main_linux_amd64.go
+++ b/speedtest1/main_linux_amd64.go
@@ -1,4 +1,4 @@
-// Code generated by 'ccgo -o speedtest1/main_linux_amd64.go testdata/sqlite-src-3320300/test/speedtest1.c -Itestdata/sqlite-amalgamation-3320300 -l modernc.org/sqlite/lib -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_DQS=0 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_MAX_MMAP_SIZE=8589934592 -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_NO_SYNC=1 -DSQLITE_OS_UNIX=1 -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 -DSQLITE_SERVER=1 -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.
+// Code generated by 'ccgo speedtest1/main_linux_amd64.go testdata/sqlite-src-3330000/test/speedtest1.c -Itestdata/sqlite-amalgamation-3330000 -l modernc.org/sqlite/lib -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=1024 -DSQLITE_ENABLE_BYTECODE_VTAB -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -DSQLITE_SOUNDEX -DSQLITE_TEMP_STORE=1 -DSQLITE_TEST -DSQLITE_THREADSAFE=1 -ccgo-long-double-is-double', DO NOT EDIT.
package main
@@ -7,7 +7,7 @@ import (
"reflect"
"unsafe"
- "modernc.org/crt/v3"
+ "modernc.org/libc"
"modernc.org/sqlite/lib"
)
@@ -15,7 +15,7 @@ var _ = math.Pi
var _ reflect.Kind
var _ unsafe.Pointer
-func main() { crt.Start(main1) }
+func main() { libc.Start(main1) }
// Copyright (C) 1991-2018 Free Software Foundation, Inc.
// This file is part of the GNU C Library.
@@ -531,7 +531,7 @@ type wchar_t = int32 /* <builtin>:15:24 */
// A program for performance testing.
//
// The available command-line options are described below:
-var zHelp = *(*[1982]int8)(unsafe.Pointer(ts /* "Usage: %s [--opt..." */)) /* speedtest1.c:6:19 */
+var zHelp = *(*[2146]int8)(unsafe.Pointer(ts /* "Usage: %s [--opt..." */)) /* speedtest1.c:6:19 */
// Define the standard macros for the user,
// if this invocation was from the user program.
@@ -612,6 +612,7 @@ type sqlite3_callback = uintptr /* sqlite3.h:338:13 */
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
// Reserved: 0x00F00000
+// Legacy compatibility:
// CAPI3REF: Device Characteristics
//
@@ -722,6 +723,7 @@ type sqlite3_file1 = struct{ pMethods uintptr }
// in the 4th parameter to the [sqlite3_vfs.xOpen] method.
// Reserved: 0x00F00000
+// Legacy compatibility:
// CAPI3REF: Device Characteristics
//
@@ -795,7 +797,7 @@ type sqlite3_file1 = struct{ pMethods uintptr }
// for their own use. The pMethods entry is a pointer to an
// [sqlite3_io_methods] object that defines methods for performing
// I/O operations on the open file.
-type sqlite3_file = sqlite3_file1 /* sqlite3.h:680:29 */
+type sqlite3_file = sqlite3_file1 /* sqlite3.h:683:29 */
type sqlite3_io_methods1 = struct {
iVersion int32
xClose uintptr
@@ -910,7 +912,7 @@ type sqlite3_io_methods1 = struct {
// fails to zero-fill short reads might seem to work. However,
// failure to zero-fill short reads will eventually lead to
// database corruption.
-type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:779:35 */
+type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:782:35 */
// CAPI3REF: OS Interface Object
//
@@ -986,7 +988,7 @@ type sqlite3_io_methods = sqlite3_io_methods1 /* sqlite3.h:779:35 */
// <li> [SQLITE_OPEN_TEMP_JOURNAL]
// <li> [SQLITE_OPEN_TRANSIENT_DB]
// <li> [SQLITE_OPEN_SUBJOURNAL]
-// <li> [SQLITE_OPEN_MASTER_JOURNAL]
+// <li> [SQLITE_OPEN_SUPER_JOURNAL]
// <li> [SQLITE_OPEN_WAL]
// </ul>)^
//
@@ -1178,7 +1180,7 @@ type sqlite3_vfs1 = struct {
// <li> [SQLITE_OPEN_TEMP_JOURNAL]
// <li> [SQLITE_OPEN_TRANSIENT_DB]
// <li> [SQLITE_OPEN_SUBJOURNAL]
-// <li> [SQLITE_OPEN_MASTER_JOURNAL]
+// <li> [SQLITE_OPEN_SUPER_JOURNAL]
// <li> [SQLITE_OPEN_WAL]
// </ul>)^
//
@@ -1271,8 +1273,8 @@ type sqlite3_vfs1 = struct {
// or all of these interfaces to be NULL or for their behavior to change
// from one release to the next. Applications must not attempt to access
// any of these methods if the iVersion of the VFS is less than 3.
-type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1364:28 */
-type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1365:14 */
+type sqlite3_vfs = sqlite3_vfs1 /* sqlite3.h:1367:28 */
+type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1368:14 */
// CAPI3REF: Memory Allocation Routines
//
@@ -1322,7 +1324,7 @@ type sqlite3_syscall_ptr = uintptr /* sqlite3.h:1365:14 */
// by xInit. The pAppData pointer is used as the only parameter to
// xInit and xShutdown.
//
-// SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
+// SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
// the xInit method, so the xInit method need not be threadsafe. The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either. For all other methods, SQLite
@@ -1394,7 +1396,7 @@ type sqlite3_mem_methods1 = struct {
// by xInit. The pAppData pointer is used as the only parameter to
// xInit and xShutdown.
//
-// SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
+// SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
// the xInit method, so the xInit method need not be threadsafe. The
// xShutdown method is only called from [sqlite3_shutdown()] so it does
// not need to be threadsafe either. For all other methods, SQLite
@@ -1407,7 +1409,7 @@ type sqlite3_mem_methods1 = struct {
//
// SQLite will never invoke xInit() more than once without an intervening
// call to xShutdown().
-type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1662:36 */
+type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1665:36 */
// CAPI3REF: Constants Defining Special Destructor Behavior
//
@@ -1421,7 +1423,7 @@ type sqlite3_mem_methods = sqlite3_mem_methods1 /* sqlite3.h:1662:36 */
//
// The typedef is necessary to work around problems in certain
// C++ compilers.
-type sqlite3_destructor_type = uintptr /* sqlite3.h:5619:14 */
+type sqlite3_destructor_type = uintptr /* sqlite3.h:5621:14 */
// The interface to the virtual-table mechanism is currently considered
// to be experimental. The interface might change in incompatible ways.
@@ -1445,7 +1447,7 @@ type sqlite3_vtab1 = struct {
// interface fixed, support it indefinitely, and remove this comment.
// Structures used by the virtual table interface
-type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6687:29 */
+type sqlite3_vtab = sqlite3_vtab1 /* sqlite3.h:6689:29 */
type sqlite3_index_info1 = struct {
nConstraint int32
aConstraint uintptr
@@ -1462,10 +1464,10 @@ type sqlite3_index_info1 = struct {
colUsed sqlite3_uint64
}
-type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6688:35 */
+type sqlite3_index_info = sqlite3_index_info1 /* sqlite3.h:6690:35 */
type sqlite3_vtab_cursor1 = struct{ pVtab uintptr }
-type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6689:36 */
+type sqlite3_vtab_cursor = sqlite3_vtab_cursor1 /* sqlite3.h:6691:36 */
type sqlite3_module1 = struct {
iVersion int32
xCreate uintptr
@@ -1493,7 +1495,7 @@ type sqlite3_module1 = struct {
xShadowName uintptr
}
-type sqlite3_module = sqlite3_module1 /* sqlite3.h:6690:31 */
+type sqlite3_module = sqlite3_module1 /* sqlite3.h:6692:31 */
// CAPI3REF: Virtual Table Indexing Information
// KEYWORDS: sqlite3_index_info
@@ -1952,7 +1954,7 @@ type sqlite3_mutex_methods1 = struct {
// called, but only if the prior call to xMutexInit returned SQLITE_OK.
// If xMutexInit fails in any way, it is expected to clean up after itself
// prior to returning.
-type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7522:38 */
+type sqlite3_mutex_methods = sqlite3_mutex_methods1 /* sqlite3.h:7524:38 */
// CAPI3REF: Custom Page Cache Object
//
@@ -1975,7 +1977,7 @@ type sqlite3_pcache_page1 = struct {
// of this object as parameters or as their return value.
//
// See [sqlite3_pcache_methods2] for additional information.
-type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8271:36 */
+type sqlite3_pcache_page = sqlite3_pcache_page1 /* sqlite3.h:8277:36 */
// CAPI3REF: Application Defined Page Cache.
// KEYWORDS: {page cache}
@@ -2307,7 +2309,7 @@ type sqlite3_pcache_methods21 = struct {
// free up as much of heap memory as possible. The page cache implementation
// is not obligated to free any memory, but well-behaved implementations should
// do their best.
-type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8436:40 */
+type sqlite3_pcache_methods2 = sqlite3_pcache_methods21 /* sqlite3.h:8442:40 */
// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
@@ -2329,7 +2331,7 @@ type sqlite3_pcache_methods1 = struct {
// This is the obsolete pcache_methods object that has now been replaced
// by sqlite3_pcache_methods2. This object is not used by SQLite. It is
// retained in the header file for backwards compatibility only.
-type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8459:39 */
+type sqlite3_pcache_methods = sqlite3_pcache_methods1 /* sqlite3.h:8465:39 */
// CAPI3REF: Database Snapshot
// KEYWORDS: {snapshot} {sqlite3_snapshot}
@@ -2369,7 +2371,7 @@ type sqlite3_snapshot1 = struct{ hidden [48]uint8 }
// version of the database file so that it is possible to later open a new read
// transaction that sees that historical version of the database rather than
// the most recent version.
-type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9508:3 */
+type sqlite3_snapshot = sqlite3_snapshot1 /* sqlite3.h:9514:3 */
// CAPI3REF: Flags for sqlite3_deserialize()
//
@@ -2449,7 +2451,7 @@ type sqlite3_rtree_geometry1 = struct {
//
//
-type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9833:39 */
+type sqlite3_rtree_geometry = sqlite3_rtree_geometry1 /* sqlite3.h:9839:39 */
type sqlite3_rtree_query_info1 = struct {
pContext uintptr
nParam int32
@@ -2469,11 +2471,11 @@ type sqlite3_rtree_query_info1 = struct {
apSqlParam uintptr
}
-type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9834:41 */
+type sqlite3_rtree_query_info = sqlite3_rtree_query_info1 /* sqlite3.h:9840:41 */
// The double-precision datatype used by RTree depends on the
// SQLITE_RTREE_INT_ONLY compile-time option.
-type sqlite3_rtree_dbl = float64 /* sqlite3.h:9842:18 */
+type sqlite3_rtree_dbl = float64 /* sqlite3.h:9848:18 */
// Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin.
@@ -2560,22 +2562,22 @@ type Fts5ExtensionApi1 = struct {
// Virtual table implementations may overload SQL functions by implementing
// the sqlite3_module.xFindFunction() method.
-type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11628:33 */
+type Fts5ExtensionApi = Fts5ExtensionApi1 /* sqlite3.h:11634:33 */
type Fts5PhraseIter1 = struct {
a uintptr
b uintptr
}
-type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11630:31 */
+type Fts5PhraseIter = Fts5PhraseIter1 /* sqlite3.h:11636:31 */
-type fts5_extension_function = uintptr /* sqlite3.h:11632:14 */
+type fts5_extension_function = uintptr /* sqlite3.h:11638:14 */
type fts5_tokenizer1 = struct {
xCreate uintptr
xDelete uintptr
xTokenize uintptr
}
-type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12091:31 */
+type fts5_tokenizer = fts5_tokenizer1 /* sqlite3.h:12097:31 */
// Flags that may be passed as the third argument to xTokenize()
@@ -2608,7 +2610,7 @@ type fts5_api1 = struct {
// ************************************************************************
//
// FTS5 EXTENSION REGISTRATION API
-type fts5_api = fts5_api1 /* sqlite3.h:12127:25 */
+type fts5_api = fts5_api1 /* sqlite3.h:12133:25 */
// The tag name of this struct is _G_fpos_t to preserve historic
// C++ mangled names for functions taking fpos_t arguments.
@@ -3937,6 +3939,20 @@ type socklen_t = uint32 /* unistd.h:274:21 */
// Define some macros helping to catch buffer overflows.
+type u64 = sqlite3_uint64 /* speedtest1.c:66:24 */
+
+// State structure for a Hash hash in progress
+type HashContext1 = struct {
+ isInit uint8
+ i uint8
+ j uint8
+ s [256]uint8
+ r [32]uint8
+}
+
+// State structure for a Hash hash in progress
+type HashContext = HashContext1 /* speedtest1.c:71:28 */
+
// All global state is held in this structure
type Global = struct {
db uintptr
@@ -3952,42 +3968,105 @@ type Global = struct {
eTemp int32
szTest int32
nRepeat int32
+ doCheckpoint int32
zWR uintptr
zNN uintptr
zPK uintptr
x uint32
y uint32
+ nResByte u64
nResult int32
zResult [3000]int8
- _ [4]byte
+ hashFile uintptr
+ hash HashContext
+ _ [5]byte
}
-// Define some macros helping to catch buffer overflows.
-
// All global state is held in this structure
-var g Global /* speedtest1.c:85:3: */
+var g Global /* speedtest1.c:107:3: */
// Return " TEMP" or "", as appropriate for creating a table.
-func isTemp(tls *crt.TLS, N int32) uintptr { /* speedtest1.c:89:19: */
+func isTemp(tls *libc.TLS, N int32) uintptr { /* speedtest1.c:111:19: */
if g.eTemp >= N {
- return ts + 1982 /* " TEMP" */
+ return ts + 2146 /* " TEMP" */
}
- return ts + 1988 /* "" */
+ return ts + 2152 /* "" */
}
// Print an error message and exit
-func fatal_error(tls *crt.TLS, zMsg uintptr, va uintptr) { /* speedtest1.c:95:13: */
+func fatal_error(tls *libc.TLS, zMsg uintptr, va uintptr) { /* speedtest1.c:116:13: */
var ap va_list
_ = ap
ap = va
- crt.Xvfprintf(tls, crt.Xstderr, zMsg, ap)
+ libc.Xvfprintf(tls, libc.Xstderr, zMsg, ap)
_ = ap
- crt.Xexit(tls, 1)
+ libc.Xexit(tls, 1)
+}
+
+// ***************************************************************************
+//
+// Hash algorithm used to verify that compilation is not miscompiled
+// in such a was as to generate an incorrect result.
+
+// Initialize a new hash. iSize determines the size of the hash
+// in bits and should be one of 224, 256, 384, or 512. Or iSize
+// can be zero to use the default hash size of 256 bits.
+func HashInit(tls *libc.TLS) { /* speedtest1.c:135:13: */
+ var k uint32
+ g.hash.i = uint8(0)
+ g.hash.j = uint8(0)
+ for k = uint32(0); k < uint32(256); k++ {
+ *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(k))) = uint8(k)
+ }
}
+// Make consecutive calls to the HashUpdate function to add new content
+// to the hash
+func HashUpdate(tls *libc.TLS, aData uintptr, nData uint32) { /* speedtest1.c:146:13: */
+ var t uint8
+ var i uint8 = g.hash.i
+ var j uint8 = g.hash.j
+ var k uint32
+ if g.hashFile != 0 {
+ libc.Xfwrite(tls, aData, uint64(1), uint64(nData), g.hashFile)
+ }
+ for k = uint32(0); k < nData; k++ {
+ j = uint8(int32(j) + (int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i)))) + int32(*(*uint8)(unsafe.Pointer(aData + uintptr(k))))))
+ t = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(j)))
+ *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(j))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i)))
+ *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i))) = t
+ i++
+ }
+ g.hash.i = i
+ g.hash.j = j
+}
+
+// After all content has been added, invoke HashFinal() to compute
+// the final hash. The hash result is stored in g.hash.r[].
+func HashFinal(tls *libc.TLS) { /* speedtest1.c:170:13: */
+ var k uint32
+ var t uint8
+ var i uint8
+ var j uint8
+ i = g.hash.i
+ j = g.hash.j
+ for k = uint32(0); k < uint32(32); k++ {
+ i++
+ t = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i)))
+ j = uint8(int32(j) + (int32(t)))
+ *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(j)))
+ *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(j))) = t
+ t = uint8(int32(t) + (int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(i))))))
+ *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 259 /* &.r */) + uintptr(k))) = *(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 3 /* &.s */) + uintptr(t)))
+ }
+}
+
+// End of the Hash hashing logic
+//
+
// Return the value of a hexadecimal digit. Return -1 if the input
// is not a hex digit.
-func hexDigitValue(tls *crt.TLS, c int8) int32 { /* speedtest1.c:107:12: */
+func hexDigitValue(tls *libc.TLS, c int8) int32 { /* speedtest1.c:194:12: */
if (int32(c) >= '0') && (int32(c) <= '9') {
return (int32(c) - '0')
}
@@ -4004,7 +4083,7 @@ func hexDigitValue(tls *crt.TLS, c int8) int32 { /* speedtest1.c:107:12: */
// SQLite
// Interpret zArg as an integer value, possibly with suffixes.
-func integerValue(tls *crt.TLS, zArg uintptr) int32 { /* speedtest1.c:123:12: */
+func integerValue(tls *libc.TLS, zArg uintptr) int32 { /* speedtest1.c:210:12: */
var v sqlite3_int64 = int64(0)
var i int32
var isNeg int32 = 0
@@ -4017,12 +4096,12 @@ func integerValue(tls *crt.TLS, zArg uintptr) int32 { /* speedtest1.c:123:12: */
if (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))) == '0') && (int32(*(*int8)(unsafe.Pointer(zArg + uintptr(1)))) == 'x') {
var x int32
zArg += uintptr(2)
- for (crt.AssignInt32(&x, hexDigitValue(tls, *(*int8)(unsafe.Pointer(zArg + uintptr(0)))))) >= 0 {
+ for (libc.AssignInt32(&x, hexDigitValue(tls, *(*int8)(unsafe.Pointer(zArg + uintptr(0)))))) >= 0 {
v = ((v << 4) + sqlite3_int64(x))
zArg++
}
} else {
- for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))))*2))) & int32(_ISdigit)) != 0 {
+ for (int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(*(*int8)(unsafe.Pointer(zArg + uintptr(0)))))*2))) & int32(_ISdigit)) != 0 {
v = (((v * int64(10)) + sqlite3_int64(*(*int8)(unsafe.Pointer(zArg + uintptr(0))))) - int64('0'))
zArg++
}
@@ -4038,7 +4117,7 @@ func integerValue(tls *crt.TLS, zArg uintptr) int32 { /* speedtest1.c:123:12: */
}
}
if v > int64(0x7fffffff) {
- fatal_error(tls, ts+1989 /* "parameter too la..." */, 0)
+ fatal_error(tls, ts+2153 /* "parameter too la..." */, 0)
}
return func() int32 {
if isNeg != 0 {
@@ -4053,19 +4132,19 @@ var aMult = [9]struct {
iMult int32
_ [4]byte
}{
- {zSuffix: ts + 2026 /* "KiB" */, iMult: 1024},
- {zSuffix: ts + 2030 /* "MiB" */, iMult: (1024 * 1024)},
- {zSuffix: ts + 2034 /* "GiB" */, iMult: ((1024 * 1024) * 1024)},
- {zSuffix: ts + 2038 /* "KB" */, iMult: 1000},
- {zSuffix: ts + 2041 /* "MB" */, iMult: 1000000},
- {zSuffix: ts + 2044 /* "GB" */, iMult: 1000000000},
- {zSuffix: ts + 2047 /* "K" */, iMult: 1000},
- {zSuffix: ts + 2049 /* "M" */, iMult: 1000000},
- {zSuffix: ts + 2051 /* "G" */, iMult: 1000000000},
-} /* speedtest1.c:125:53 */
+ {zSuffix: ts + 2190 /* "KiB" */, iMult: 1024},
+ {zSuffix: ts + 2194 /* "MiB" */, iMult: (1024 * 1024)},
+ {zSuffix: ts + 2198 /* "GiB" */, iMult: ((1024 * 1024) * 1024)},
+ {zSuffix: ts + 2202 /* "KB" */, iMult: 1000},
+ {zSuffix: ts + 2205 /* "MB" */, iMult: 1000000},
+ {zSuffix: ts + 2208 /* "GB" */, iMult: 1000000000},
+ {zSuffix: ts + 2211 /* "K" */, iMult: 1000},
+ {zSuffix: ts + 2213 /* "M" */, iMult: 1000000},
+ {zSuffix: ts + 2215 /* "G" */, iMult: 1000000000},
+} /* speedtest1.c:212:53 */
// Return the current wall-clock time, in milliseconds
-func speedtest1_timestamp(tls *crt.TLS) sqlite3_int64 { /* speedtest1.c:168:15: */
+func speedtest1_timestamp(tls *libc.TLS) sqlite3_int64 { /* speedtest1.c:255:15: */
bp := tls.Alloc(16)
defer tls.Free(16)
@@ -4075,20 +4154,20 @@ func speedtest1_timestamp(tls *crt.TLS) sqlite3_int64 { /* speedtest1.c:168:15:
clockVfs = sqlite3.Xsqlite3_vfs_find(tls, uintptr(0))
}
if ((*sqlite3_vfs)(unsafe.Pointer(clockVfs)).iVersion >= 2) && ((*sqlite3_vfs)(unsafe.Pointer(clockVfs)).xCurrentTimeInt64 != uintptr(0)) {
- (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((clockVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, clockVfs, bp /* &t */)
+ (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((clockVfs + 136 /* &.xCurrentTimeInt64 */))))(tls, clockVfs, bp /* &t */)
} else {
// var r float64 at bp+8, 8
- (*(*func(*crt.TLS, uintptr, uintptr) int32)(unsafe.Pointer((clockVfs + 120 /* &.xCurrentTime */))))(tls, clockVfs, bp+8 /* &r */)
+ (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer((clockVfs + 120 /* &.xCurrentTime */))))(tls, clockVfs, bp+8 /* &r */)
*(*sqlite3_int64)(unsafe.Pointer(bp /* t */)) = (sqlite3_int64(*(*float64)(unsafe.Pointer(bp + 8 /* r */)) * 86400000.0))
}
return *(*sqlite3_int64)(unsafe.Pointer(bp /* t */))
}
-var clockVfs uintptr = uintptr(0) /* speedtest1.c:172:22 */
+var clockVfs uintptr = uintptr(0) /* speedtest1.c:259:22 */
// Return a pseudo-random unsigned integer
-func speedtest1_random(tls *crt.TLS) uint32 { /* speedtest1.c:190:14: */
+func speedtest1_random(tls *libc.TLS) uint32 { /* speedtest1.c:277:14: */
g.x = ((g.x >> 1) ^ ((uint32(1) + ^(g.x & uint32(1))) & 0xd0000001))
g.y = ((g.y * uint32(1103515245)) + uint32(12345))
return (g.x ^ g.y)
@@ -4096,7 +4175,7 @@ func speedtest1_random(tls *crt.TLS) uint32 { /* speedtest1.c:190:14: */
// Map the value in within the range of 1...limit into another
// number in a way that is chatic and invertable.
-func swizzle(tls *crt.TLS, in uint32, limit uint32) uint32 { /* speedtest1.c:199:10: */
+func swizzle(tls *libc.TLS, in uint32, limit uint32) uint32 { /* speedtest1.c:286:10: */
var out uint32 = uint32(0)
for limit != 0 {
out = ((out << 1) | (in & uint32(1)))
@@ -4107,7 +4186,7 @@ func swizzle(tls *crt.TLS, in uint32, limit uint32) uint32 { /* speedtest1.c:199
}
// Round up a number so that it is a power of two minus one
-func roundup_allones(tls *crt.TLS, limit uint32) uint32 { /* speedtest1.c:211:10: */
+func roundup_allones(tls *libc.TLS, limit uint32) uint32 { /* speedtest1.c:298:10: */
var m uint32 = uint32(1)
for m < limit {
m = ((m << 1) + uint32(1))
@@ -4122,7 +4201,7 @@ func roundup_allones(tls *crt.TLS, limit uint32) uint32 { /* speedtest1.c:211:10
// Example:
//
// speedtest1_numbername(123) -> "one hundred twenty three"
-func speedtest1_numbername(tls *crt.TLS, n uint32, zOut uintptr, nOut int32) int32 { /* speedtest1.c:225:5: */
+func speedtest1_numbername(tls *libc.TLS, n uint32, zOut uintptr, nOut int32) int32 { /* speedtest1.c:312:5: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -4130,88 +4209,88 @@ func speedtest1_numbername(tls *crt.TLS, n uint32, zOut uintptr, nOut int32) int
if n >= uint32(1000000000) {
i = i + (speedtest1_numbername(tls, (n / uint32(1000000000)), (zOut + uintptr(i)), (nOut - i)))
- sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2053 /* " billion" */, 0)
- i = i + (int32(crt.Xstrlen(tls, (zOut + uintptr(i)))))
+ sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2217 /* " billion" */, 0)
+ i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
n = (n % uint32(1000000000))
}
if n >= uint32(1000000) {
if (i != 0) && (i < (nOut - 1)) {
- *(*int8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&i, 1)))) = int8(' ')
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ')
}
i = i + (speedtest1_numbername(tls, (n / uint32(1000000)), (zOut + uintptr(i)), (nOut - i)))
- sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2062 /* " million" */, 0)
- i = i + (int32(crt.Xstrlen(tls, (zOut + uintptr(i)))))
+ sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2226 /* " million" */, 0)
+ i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
n = (n % uint32(1000000))
}
if n >= uint32(1000) {
if (i != 0) && (i < (nOut - 1)) {
- *(*int8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&i, 1)))) = int8(' ')
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ')
}
i = i + (speedtest1_numbername(tls, (n / uint32(1000)), (zOut + uintptr(i)), (nOut - i)))
- sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2071 /* " thousand" */, 0)
- i = i + (int32(crt.Xstrlen(tls, (zOut + uintptr(i)))))
+ sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2235 /* " thousand" */, 0)
+ i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
n = (n % uint32(1000))
}
if n >= uint32(100) {
if (i != 0) && (i < (nOut - 1)) {
- *(*int8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&i, 1)))) = int8(' ')
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ')
}
- sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2081 /* "%s hundred" */, crt.VaList(bp, ones[(n/uint32(100))]))
- i = i + (int32(crt.Xstrlen(tls, (zOut + uintptr(i)))))
+ sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2245 /* "%s hundred" */, libc.VaList(bp, ones[(n/uint32(100))]))
+ i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
n = (n % uint32(100))
}
if n >= uint32(20) {
if (i != 0) && (i < (nOut - 1)) {
- *(*int8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&i, 1)))) = int8(' ')
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ')
}
- sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2092 /* "%s" */, crt.VaList(bp+8, tens[(n/uint32(10))]))
- i = i + (int32(crt.Xstrlen(tls, (zOut + uintptr(i)))))
+ sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2256 /* "%s" */, libc.VaList(bp+8, tens[(n/uint32(10))]))
+ i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
n = (n % uint32(10))
}
if n > uint32(0) {
if (i != 0) && (i < (nOut - 1)) {
- *(*int8)(unsafe.Pointer(zOut + uintptr(crt.PostIncInt32(&i, 1)))) = int8(' ')
+ *(*int8)(unsafe.Pointer(zOut + uintptr(libc.PostIncInt32(&i, 1)))) = int8(' ')
}
- sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2092 /* "%s" */, crt.VaList(bp+16, ones[n]))
- i = i + (int32(crt.Xstrlen(tls, (zOut + uintptr(i)))))
+ sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2256 /* "%s" */, libc.VaList(bp+16, ones[n]))
+ i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
}
if i == 0 {
- sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2095 /* "zero" */, 0)
- i = i + (int32(crt.Xstrlen(tls, (zOut + uintptr(i)))))
+ sqlite3.Xsqlite3_snprintf(tls, (nOut - i), (zOut + uintptr(i)), ts+2259 /* "zero" */, 0)
+ i = i + (int32(libc.Xstrlen(tls, (zOut + uintptr(i)))))
}
return i
}
-var ones = [20]uintptr{ts + 2095 /* "zero" */, ts + 2100 /* "one" */, ts + 2104 /* "two" */, ts + 2108 /* "three" */, ts + 2114 /* "four" */, ts + 2119, /* "five" */
- ts + 2124 /* "six" */, ts + 2128 /* "seven" */, ts + 2134 /* "eight" */, ts + 2140 /* "nine" */, ts + 2145 /* "ten" */, ts + 2149 /* "eleven" */, ts + 2156, /* "twelve" */
- ts + 2163 /* "thirteen" */, ts + 2172 /* "fourteen" */, ts + 2181 /* "fifteen" */, ts + 2189 /* "sixteen" */, ts + 2197, /* "seventeen" */
- ts + 2207 /* "eighteen" */, ts + 2216 /* "nineteen" */} /* speedtest1.c:226:21 */
-var tens = [10]uintptr{ts + 1988 /* "" */, ts + 2145 /* "ten" */, ts + 2225 /* "twenty" */, ts + 2232 /* "thirty" */, ts + 2239, /* "forty" */
- ts + 2245 /* "fifty" */, ts + 2251 /* "sixty" */, ts + 2257 /* "seventy" */, ts + 2265 /* "eighty" */, ts + 2272 /* "ninety" */} /* speedtest1.c:230:21 */
+var ones = [20]uintptr{ts + 2259 /* "zero" */, ts + 2264 /* "one" */, ts + 2268 /* "two" */, ts + 2272 /* "three" */, ts + 2278 /* "four" */, ts + 2283, /* "five" */
+ ts + 2288 /* "six" */, ts + 2292 /* "seven" */, ts + 2298 /* "eight" */, ts + 2304 /* "nine" */, ts + 2309 /* "ten" */, ts + 2313 /* "eleven" */, ts + 2320, /* "twelve" */
+ ts + 2327 /* "thirteen" */, ts + 2336 /* "fourteen" */, ts + 2345 /* "fifteen" */, ts + 2353 /* "sixteen" */, ts + 2361, /* "seventeen" */
+ ts + 2371 /* "eighteen" */, ts + 2380 /* "nineteen" */} /* speedtest1.c:313:21 */
+var tens = [10]uintptr{ts + 2152 /* "" */, ts + 2309 /* "ten" */, ts + 2389 /* "twenty" */, ts + 2396 /* "thirty" */, ts + 2403, /* "forty" */
+ ts + 2409 /* "fifty" */, ts + 2415 /* "sixty" */, ts + 2421 /* "seventy" */, ts + 2429 /* "eighty" */, ts + 2436 /* "ninety" */} /* speedtest1.c:317:21 */
// Start a new test case
-var zDots = *(*[72]int8)(unsafe.Pointer(ts + 2279 /* "..................." */)) /* speedtest1.c:281:19 */
-func speedtest1_begin_test(tls *crt.TLS, iTestNum int32, zTestName uintptr, va uintptr) { /* speedtest1.c:283:6: */
+var zDots = *(*[72]int8)(unsafe.Pointer(ts + 2443 /* "..................." */)) /* speedtest1.c:368:19 */
+func speedtest1_begin_test(tls *libc.TLS, iTestNum int32, zTestName uintptr, va uintptr) { /* speedtest1.c:370:6: */
bp := tls.Alloc(64)
defer tls.Free(64)
- var n int32 = int32(crt.Xstrlen(tls, zTestName))
+ var n int32 = int32(libc.Xstrlen(tls, zTestName))
var zName uintptr
var ap va_list
_ = ap
ap = va
zName = sqlite3.Xsqlite3_vmprintf(tls, zTestName, ap)
_ = ap
- n = int32(crt.Xstrlen(tls, zName))
+ n = int32(libc.Xstrlen(tls, zName))
if n > 60 {
*(*int8)(unsafe.Pointer(zName + uintptr(60))) = int8(0)
n = 60
}
if g.bSqlOnly != 0 {
- crt.Xprintf(tls, ts+2351 /* "/* %4d - %s%.*s ..." */, crt.VaList(bp, iTestNum, zName, (60-n), uintptr(unsafe.Pointer(&zDots))))
+ libc.Xprintf(tls, ts+2515 /* "/* %4d - %s%.*s ..." */, libc.VaList(bp, iTestNum, zName, (60-n), uintptr(unsafe.Pointer(&zDots))))
} else {
- crt.Xprintf(tls, ts+2371 /* "%4d - %s%.*s " */, crt.VaList(bp+32, iTestNum, zName, (60-n), uintptr(unsafe.Pointer(&zDots))))
- crt.Xfflush(tls, crt.Xstdout)
+ libc.Xprintf(tls, ts+2535 /* "%4d - %s%.*s " */, libc.VaList(bp+32, iTestNum, zName, (60-n), uintptr(unsafe.Pointer(&zDots))))
+ libc.Xfflush(tls, libc.Xstdout)
}
sqlite3.Xsqlite3_free(tls, zName)
g.nResult = 0
@@ -4221,14 +4300,17 @@ func speedtest1_begin_test(tls *crt.TLS, iTestNum int32, zTestName uintptr, va u
}
// Complete a test case
-func speedtest1_end_test(tls *crt.TLS) { /* speedtest1.c:309:6: */
+func speedtest1_end_test(tls *libc.TLS) { /* speedtest1.c:399:6: */
bp := tls.Alloc(16)
defer tls.Free(16)
var iElapseTime sqlite3_int64 = (speedtest1_timestamp(tls) - g.iStart)
+ if g.doCheckpoint != 0 {
+ speedtest1_exec(tls, ts+2549 /* "PRAGMA wal_check..." */, 0)
+ }
if !(g.bSqlOnly != 0) {
*(*sqlite3_int64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 24 /* &.iTotal */)) += (iElapseTime)
- crt.Xprintf(tls, ts+2385 /* "%4d.%03ds\n" */, crt.VaList(bp, (int32(iElapseTime/int64(1000))), (int32(iElapseTime%int64(1000)))))
+ libc.Xprintf(tls, ts+2572 /* "%4d.%03ds\n" */, libc.VaList(bp, (int32(iElapseTime/int64(1000))), (int32(iElapseTime%int64(1000)))))
}
if g.pStmt != 0 {
sqlite3.Xsqlite3_finalize(tls, g.pStmt)
@@ -4237,47 +4319,60 @@ func speedtest1_end_test(tls *crt.TLS) { /* speedtest1.c:309:6: */
}
// Report end of testing
-func speedtest1_final(tls *crt.TLS) { /* speedtest1.c:322:6: */
- bp := tls.Alloc(32)
- defer tls.Free(32)
+func speedtest1_final(tls *libc.TLS) { /* speedtest1.c:413:6: */
+ bp := tls.Alloc(48)
+ defer tls.Free(48)
if !(g.bSqlOnly != 0) {
- crt.Xprintf(tls, ts+2396 /* " TOTAL%.*s..." */, crt.VaList(bp, (60-5), uintptr(unsafe.Pointer(&zDots)),
+ libc.Xprintf(tls, ts+2583 /* " TOTAL%.*s..." */, libc.VaList(bp, (60-5), uintptr(unsafe.Pointer(&zDots)),
(int32(g.iTotal/int64(1000))), (int32(g.iTotal%int64(1000)))))
}
+ if g.bVerify != 0 {
+ var i int32
+ libc.Xprintf(tls, ts+2611 /* "Verification Has..." */, libc.VaList(bp+32, g.nResByte))
+ HashUpdate(tls, ts+2636 /* "\n" */, uint32(1))
+ HashFinal(tls)
+ for i = 0; i < 24; i++ {
+ libc.Xprintf(tls, ts+2638 /* "%02x" */, libc.VaList(bp+40, int32(*(*uint8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 3128 /* &.hash */ + 259 /* &.r */) + uintptr(i))))))
+ }
+ if (g.hashFile != 0) && (g.hashFile != libc.Xstdout) {
+ libc.Xfclose(tls, g.hashFile)
+ }
+ libc.Xprintf(tls, ts+2636 /* "\n" */, 0)
+ }
}
// Print an SQL statement to standard output
-func printSql(tls *crt.TLS, zSql uintptr) { /* speedtest1.c:330:13: */
+func printSql(tls *libc.TLS, zSql uintptr) { /* speedtest1.c:436:13: */
bp := tls.Alloc(32)
defer tls.Free(32)
- var n int32 = int32(crt.Xstrlen(tls, zSql))
- for (n > 0) && ((int32(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1))))) == ';') || ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0)) {
+ var n int32 = int32(libc.Xstrlen(tls, zSql))
+ for (n > 0) && ((int32(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1))))) == ';') || ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0)) {
n--
}
if g.bExplain != 0 {
- crt.Xprintf(tls, ts+2424 /* "EXPLAIN " */, 0)
+ libc.Xprintf(tls, ts+2643 /* "EXPLAIN " */, 0)
}
- crt.Xprintf(tls, ts+2433 /* "%.*s;\n" */, crt.VaList(bp, n, zSql))
+ libc.Xprintf(tls, ts+2652 /* "%.*s;\n" */, libc.VaList(bp, n, zSql))
if (g.bExplain != 0) &&
- (((sqlite3.Xsqlite3_strglob(tls, ts+2440 /* "CREATE *" */, zSql) == 0) ||
- (sqlite3.Xsqlite3_strglob(tls, ts+2449 /* "DROP *" */, zSql) == 0)) ||
- (sqlite3.Xsqlite3_strglob(tls, ts+2456 /* "ALTER *" */, zSql) == 0)) {
- crt.Xprintf(tls, ts+2433 /* "%.*s;\n" */, crt.VaList(bp+16, n, zSql))
+ (((sqlite3.Xsqlite3_strglob(tls, ts+2659 /* "CREATE *" */, zSql) == 0) ||
+ (sqlite3.Xsqlite3_strglob(tls, ts+2668 /* "DROP *" */, zSql) == 0)) ||
+ (sqlite3.Xsqlite3_strglob(tls, ts+2675 /* "ALTER *" */, zSql) == 0)) {
+ libc.Xprintf(tls, ts+2652 /* "%.*s;\n" */, libc.VaList(bp+16, n, zSql))
}
}
// Shrink memory used, if appropriate and if the SQLite version is capable
// of doing so.
-func speedtest1_shrink_memory(tls *crt.TLS) { /* speedtest1.c:350:6: */
+func speedtest1_shrink_memory(tls *libc.TLS) { /* speedtest1.c:456:6: */
if g.bMemShrink != 0 {
sqlite3.Xsqlite3_db_release_memory(tls, g.db)
}
}
// Run SQL
-func speedtest1_exec(tls *crt.TLS, zFormat uintptr, va uintptr) { /* speedtest1.c:357:6: */
+func speedtest1_exec(tls *libc.TLS, zFormat uintptr, va uintptr) { /* speedtest1.c:463:6: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -4293,18 +4388,54 @@ func speedtest1_exec(tls *crt.TLS, zFormat uintptr, va uintptr) { /* speedtest1.
*(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) = uintptr(0)
var rc int32 = sqlite3.Xsqlite3_exec(tls, g.db, zSql, uintptr(0), uintptr(0), bp+24 /* &zErrMsg */)
if *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)) != 0 {
- fatal_error(tls, ts+2464 /* "SQL error: %s\n%s..." */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)), zSql))
+ fatal_error(tls, ts+2683 /* "SQL error: %s\n%s..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(bp + 24 /* zErrMsg */)), zSql))
}
if rc != 0 {
- fatal_error(tls, ts+2482 /* "exec error: %s\n" */, crt.VaList(bp+16, sqlite3.Xsqlite3_errmsg(tls, g.db)))
+ fatal_error(tls, ts+2701 /* "exec error: %s\n" */, libc.VaList(bp+16, sqlite3.Xsqlite3_errmsg(tls, g.db)))
+ }
+ }
+ sqlite3.Xsqlite3_free(tls, zSql)
+ speedtest1_shrink_memory(tls)
+}
+
+// Run SQL and return the first column of the first row as a string. The
+// returned string is obtained from sqlite_malloc() and must be freed by
+// the caller.
+func speedtest1_once(tls *libc.TLS, zFormat uintptr, va uintptr) uintptr { /* speedtest1.c:485:6: */
+ bp := tls.Alloc(24)
+ defer tls.Free(24)
+
+ var ap va_list
+ _ = ap
+ var zSql uintptr
+ // var pStmt uintptr at bp+16, 8
+
+ var zResult uintptr = uintptr(0)
+ ap = va
+ zSql = sqlite3.Xsqlite3_vmprintf(tls, zFormat, ap)
+ _ = ap
+ if g.bSqlOnly != 0 {
+ printSql(tls, zSql)
+ } else {
+ var rc int32 = sqlite3.Xsqlite3_prepare_v2(tls, g.db, zSql, -1, bp+16 /* &pStmt */, uintptr(0))
+ if rc != 0 {
+ fatal_error(tls, ts+2717 /* "SQL error: %s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
}
+ if sqlite3.Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */))) == 100 {
+ var z uintptr = sqlite3.Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)), 0)
+ if z != 0 {
+ zResult = sqlite3.Xsqlite3_mprintf(tls, ts+2256 /* "%s" */, libc.VaList(bp+8, z))
+ }
+ }
+ sqlite3.Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 16 /* pStmt */)))
}
sqlite3.Xsqlite3_free(tls, zSql)
speedtest1_shrink_memory(tls)
+ return zResult
}
// Prepare an SQL statement
-func speedtest1_prepare(tls *crt.TLS, zFormat uintptr, va uintptr) { /* speedtest1.c:376:6: */
+func speedtest1_prepare(tls *libc.TLS, zFormat uintptr, va uintptr) { /* speedtest1.c:512:6: */
bp := tls.Alloc(8)
defer tls.Free(8)
@@ -4323,16 +4454,16 @@ func speedtest1_prepare(tls *crt.TLS, zFormat uintptr, va uintptr) { /* speedtes
}
rc = sqlite3.Xsqlite3_prepare_v2(tls, g.db, zSql, -1, (uintptr(unsafe.Pointer(&g)) + 8 /* &.pStmt */), uintptr(0))
if rc != 0 {
- fatal_error(tls, ts+2498 /* "SQL error: %s\n" */, crt.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
+ fatal_error(tls, ts+2717 /* "SQL error: %s\n" */, libc.VaList(bp, sqlite3.Xsqlite3_errmsg(tls, g.db)))
}
}
sqlite3.Xsqlite3_free(tls, zSql)
}
// Run an SQL statement previously prepared
-func speedtest1_run(tls *crt.TLS) { /* speedtest1.c:396:6: */
- bp := tls.Alloc(8)
- defer tls.Free(8)
+func speedtest1_run(tls *libc.TLS) { /* speedtest1.c:532:6: */
+ bp := tls.Alloc(16)
+ defer tls.Free(16)
var i int32
var n int32
@@ -4347,24 +4478,57 @@ func speedtest1_run(tls *crt.TLS) { /* speedtest1.c:396:6: */
for i = 0; i < n; i++ {
var z uintptr = sqlite3.Xsqlite3_column_text(tls, g.pStmt, i)
if z == uintptr(0) {
- z = ts + 2513 /* "nil" */
+ z = ts + 2732 /* "nil" */
+ }
+ len = int32(libc.Xstrlen(tls, z))
+ if g.bVerify != 0 {
+ var eType int32 = sqlite3.Xsqlite3_column_type(tls, g.pStmt, i)
+ // var zPrefix [2]uint8 at bp, 2
+
+ *(*uint8)(unsafe.Pointer(bp /* &zPrefix[0] */ + uintptr(0))) = uint8('\n')
+ *(*uint8)(unsafe.Pointer(bp /* &zPrefix[0] */ + uintptr(1))) = uint8(*(*int8)(unsafe.Pointer(ts + 2736 /* "-IFTBN" */ + uintptr(eType))))
+ if g.nResByte != 0 {
+ HashUpdate(tls, bp /* &zPrefix[0] */, uint32(2))
+ } else {
+ HashUpdate(tls, (bp /* &zPrefix[0] */ + uintptr(1)), uint32(1))
+ }
+ if eType == 2 {
+ // Omit the value of floating-point results from the verification
+ // hash. The only thing we record is the fact that the result was
+ // a floating-point value.
+ *(*u64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 104 /* &.nResByte */)) += (uint64(2))
+ } else if eType == 4 {
+ var nBlob int32 = sqlite3.Xsqlite3_column_bytes(tls, g.pStmt, i)
+ var iBlob int32
+ // var zChar [2]uint8 at bp+2, 2
+
+ var aBlob uintptr = sqlite3.Xsqlite3_column_blob(tls, g.pStmt, i)
+ for iBlob = 0; iBlob < nBlob; iBlob++ {
+ *(*uint8)(unsafe.Pointer(bp + 2 /* &zChar[0] */ + uintptr(0))) = uint8(*(*int8)(unsafe.Pointer(ts + 2743 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer(aBlob + uintptr(iBlob)))) >> 4)))))
+ *(*uint8)(unsafe.Pointer(bp + 2 /* &zChar[0] */ + uintptr(1))) = uint8(*(*int8)(unsafe.Pointer(ts + 2743 /* "0123456789abcdef" */ + uintptr((int32(*(*uint8)(unsafe.Pointer(aBlob + uintptr(iBlob)))) & 15)))))
+ HashUpdate(tls, bp+2 /* &zChar[0] */, uint32(2))
+ }
+ *(*u64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 104 /* &.nResByte */)) += (u64((nBlob * 2) + 2))
+ } else {
+ HashUpdate(tls, z, uint32(len))
+ *(*u64)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 104 /* &.nResByte */)) += (u64(len + 2))
+ }
}
- len = int32(crt.Xstrlen(tls, z))
if (uint64(g.nResult + len)) < (uint64(unsafe.Sizeof([3000]int8{})) - uint64(2)) {
if g.nResult > 0 {
- *(*int8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 108 /* &.zResult */) + uintptr(crt.PostIncInt32(&g.nResult, 1)))) = int8(' ')
+ *(*int8)(unsafe.Pointer((uintptr(unsafe.Pointer(&g)) + 116 /* &.zResult */) + uintptr(libc.PostIncInt32(&g.nResult, 1)))) = int8(' ')
}
- crt.Xmemcpy(tls, ((uintptr(unsafe.Pointer(&g)) + 108 /* &.zResult */) + uintptr(g.nResult)), z, (uint64(len + 1)))
- *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 104 /* &.nResult */)) += (len)
+ libc.Xmemcpy(tls, ((uintptr(unsafe.Pointer(&g)) + 116 /* &.zResult */) + uintptr(g.nResult)), z, (uint64(len + 1)))
+ *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&g)) + 112 /* &.nResult */)) += (len)
}
}
}
if g.bReprepare != 0 {
- // var pNew uintptr at bp, 8
+ // var pNew uintptr at bp+8, 8
- sqlite3.Xsqlite3_prepare_v2(tls, g.db, sqlite3.Xsqlite3_sql(tls, g.pStmt), -1, bp /* &pNew */, uintptr(0))
+ sqlite3.Xsqlite3_prepare_v2(tls, g.db, sqlite3.Xsqlite3_sql(tls, g.pStmt), -1, bp+8 /* &pNew */, uintptr(0))
sqlite3.Xsqlite3_finalize(tls, g.pStmt)
- g.pStmt = *(*uintptr)(unsafe.Pointer(bp /* pNew */))
+ g.pStmt = *(*uintptr)(unsafe.Pointer(bp + 8 /* pNew */))
} else {
sqlite3.Xsqlite3_reset(tls, g.pStmt)
}
@@ -4372,25 +4536,25 @@ func speedtest1_run(tls *crt.TLS) { /* speedtest1.c:396:6: */
}
// The sqlite3_trace() callback function
-func traceCallback(tls *crt.TLS, NotUsed uintptr, zSql uintptr) { /* speedtest1.c:430:13: */
+func traceCallback(tls *libc.TLS, NotUsed uintptr, zSql uintptr) { /* speedtest1.c:599:13: */
bp := tls.Alloc(16)
defer tls.Free(16)
- var n int32 = int32(crt.Xstrlen(tls, zSql))
- for (n > 0) && ((int32(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1))))) == ';') || ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(crt.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0)) {
+ var n int32 = int32(libc.Xstrlen(tls, zSql))
+ for (n > 0) && ((int32(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1))))) == ';') || ((int32(*(*uint16)(unsafe.Pointer((*(*uintptr)(unsafe.Pointer(libc.X__ctype_b_loc(tls)))) + uintptr(int32(uint8(*(*int8)(unsafe.Pointer(zSql + uintptr((n - 1)))))))*2))) & int32(_ISspace)) != 0)) {
n--
}
- crt.Xfprintf(tls, crt.Xstderr, ts+2433 /* "%.*s;\n" */, crt.VaList(bp, n, zSql))
+ libc.Xfprintf(tls, libc.Xstderr, ts+2652 /* "%.*s;\n" */, libc.VaList(bp, n, zSql))
}
// Substitute random() function that gives the same random
// sequence on each run, for repeatability.
-func randomFunc(tls *crt.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* speedtest1.c:439:13: */
+func randomFunc(tls *libc.TLS, context uintptr, NotUsed int32, NotUsed2 uintptr) { /* speedtest1.c:608:13: */
sqlite3.Xsqlite3_result_int64(tls, context, sqlite3_int64(speedtest1_random(tls)))
}
// Estimate the square root of an integer
-func est_square_root(tls *crt.TLS, x int32) int32 { /* speedtest1.c:448:12: */
+func est_square_root(tls *libc.TLS, x int32) int32 { /* speedtest1.c:617:12: */
var y0 int32 = (x / 2)
var y1 int32
var n int32
@@ -4405,7 +4569,7 @@ func est_square_root(tls *crt.TLS, x int32) int32 { /* speedtest1.c:448:12: */
}
// The main and default testset
-func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
+func testset_main(tls *libc.TLS) { /* speedtest1.c:694:6: */
bp := tls.Alloc(2568)
defer tls.Free(2568)
@@ -4419,14 +4583,14 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
// var zNum [2000]int8 at bp+568, 2000
// A number name
- sz = crt.AssignInt32(&n, (g.szTest * 500))
+ sz = libc.AssignInt32(&n, (g.szTest * 500))
*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr(0))) = int8(0)
maxb = int32(roundup_allones(tls, uint32(sz)))
- speedtest1_begin_test(tls, 100, ts+2517 /* "%d INSERTs into ..." */, crt.VaList(bp, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
- speedtest1_exec(tls, ts+2559, /* "CREATE%s TABLE t..." */
- crt.VaList(bp+8, isTemp(tls, 9), g.zNN, g.zNN, g.zNN))
- speedtest1_prepare(tls, ts+2617 /* "INSERT INTO t1 V..." */, crt.VaList(bp+40, n))
+ speedtest1_begin_test(tls, 100, ts+2760 /* "%d INSERTs into ..." */, libc.VaList(bp, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
+ speedtest1_exec(tls, ts+2802, /* "CREATE%s TABLE t..." */
+ libc.VaList(bp+8, isTemp(tls, 9), g.zNN, g.zNN, g.zNN))
+ speedtest1_prepare(tls, ts+2860 /* "INSERT INTO t1 V..." */, libc.VaList(bp+40, n))
for i = 1; i <= n; i++ {
x1 = swizzle(tls, uint32(i), uint32(maxb))
speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
@@ -4435,16 +4599,16 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 3, bp+568 /* &zNum[0] */, -1, uintptr(0))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = sz
- speedtest1_begin_test(tls, 110, ts+2670 /* "%d ordered INSER..." */, crt.VaList(bp+48, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 110, ts+2913 /* "%d ordered INSER..." */, libc.VaList(bp+48, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_exec(tls,
- ts+2707, /* "CREATE%s TABLE t..." */
- crt.VaList(bp+56, isTemp(tls, 5), g.zNN, g.zPK, g.zNN, g.zNN, g.zWR))
- speedtest1_prepare(tls, ts+2770 /* "INSERT INTO t2 V..." */, crt.VaList(bp+104, n))
+ ts+2950, /* "CREATE%s TABLE t..." */
+ libc.VaList(bp+56, isTemp(tls, 5), g.zNN, g.zPK, g.zNN, g.zNN, g.zWR))
+ speedtest1_prepare(tls, ts+3013 /* "INSERT INTO t2 V..." */, libc.VaList(bp+104, n))
for i = 1; i <= n; i++ {
x1 = swizzle(tls, uint32(i), uint32(maxb))
speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
@@ -4453,16 +4617,16 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 3, bp+568 /* &zNum[0] */, -1, uintptr(0))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = sz
- speedtest1_begin_test(tls, 120, ts+2815 /* "%d unordered INS..." */, crt.VaList(bp+112, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 120, ts+3058 /* "%d unordered INS..." */, libc.VaList(bp+112, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_exec(tls,
- ts+2854, /* "CREATE%s TABLE t..." */
- crt.VaList(bp+120, isTemp(tls, 3), g.zNN, g.zPK, g.zNN, g.zNN, g.zWR))
- speedtest1_prepare(tls, ts+2917 /* "INSERT INTO t3 V..." */, crt.VaList(bp+168, n))
+ ts+3097, /* "CREATE%s TABLE t..." */
+ libc.VaList(bp+120, isTemp(tls, 3), g.zNN, g.zPK, g.zNN, g.zNN, g.zWR))
+ speedtest1_prepare(tls, ts+3160 /* "INSERT INTO t3 V..." */, libc.VaList(bp+168, n))
for i = 1; i <= n; i++ {
x1 = swizzle(tls, uint32(i), uint32(maxb))
speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
@@ -4471,15 +4635,15 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 3, bp+568 /* &zNum[0] */, -1, uintptr(0))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = 25
- speedtest1_begin_test(tls, 130, ts+2962 /* "%d SELECTS, nume..." */, crt.VaList(bp+176, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 130, ts+3205 /* "%d SELECTS, nume..." */, libc.VaList(bp+176, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_prepare(tls,
- ts+3001 /* "SELECT count(*),..." */, crt.VaList(bp+184, n))
+ ts+3244 /* "SELECT count(*),..." */, libc.VaList(bp+184, n))
for i = 1; i <= n; i++ {
if ((i - 1) % g.nRepeat) == 0 {
x1 = (speedtest1_random(tls) % uint32(maxb))
@@ -4489,15 +4653,15 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = 10
- speedtest1_begin_test(tls, 140, ts+3106 /* "%d SELECTS, LIKE..." */, crt.VaList(bp+192, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 140, ts+3349 /* "%d SELECTS, LIKE..." */, libc.VaList(bp+192, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_prepare(tls,
- ts+3134 /* "SELECT count(*),..." */, crt.VaList(bp+200, n))
+ ts+3377 /* "SELECT count(*),..." */, libc.VaList(bp+200, n))
for i = 1; i <= n; i++ {
if ((i - 1) % g.nRepeat) == 0 {
x1 = (speedtest1_random(tls) % uint32(maxb))
@@ -4509,15 +4673,15 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, (len + 1), uintptr(0))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = 10
- speedtest1_begin_test(tls, 142, ts+3229 /* "%d SELECTS w/ORD..." */, crt.VaList(bp+208, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 142, ts+3472 /* "%d SELECTS w/ORD..." */, libc.VaList(bp+208, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_prepare(tls,
- ts+3262 /* "SELECT a, b, c F..." */, crt.VaList(bp+216, n))
+ ts+3505 /* "SELECT a, b, c F..." */, libc.VaList(bp+216, n))
for i = 1; i <= n; i++ {
if ((i - 1) % g.nRepeat) == 0 {
x1 = (speedtest1_random(tls) % uint32(maxb))
@@ -4529,15 +4693,15 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, (len + 1), uintptr(0))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = 10 // g.szTest/5;
- speedtest1_begin_test(tls, 145, ts+3326 /* "%d SELECTS w/ORD..." */, crt.VaList(bp+224, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 145, ts+3569 /* "%d SELECTS w/ORD..." */, libc.VaList(bp+224, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_prepare(tls,
- ts+3369 /* "SELECT a, b, c F..." */, crt.VaList(bp+232, n))
+ ts+3612 /* "SELECT a, b, c F..." */, libc.VaList(bp+232, n))
for i = 1; i <= n; i++ {
if ((i - 1) % g.nRepeat) == 0 {
x1 = (speedtest1_random(tls) % uint32(maxb))
@@ -4549,25 +4713,25 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, (len + 1), uintptr(0))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 150, ts+3442 /* "CREATE INDEX fiv..." */, 0)
- speedtest1_exec(tls, ts+3466 /* "BEGIN;" */, 0)
- speedtest1_exec(tls, ts+3473 /* "CREATE UNIQUE IN..." */, 0)
- speedtest1_exec(tls, ts+3507 /* "CREATE INDEX t1c..." */, 0)
- speedtest1_exec(tls, ts+3534 /* "CREATE UNIQUE IN..." */, 0)
- speedtest1_exec(tls, ts+3568 /* "CREATE INDEX t2c..." */, 0)
- speedtest1_exec(tls, ts+3600 /* "CREATE INDEX t3b..." */, 0)
- speedtest1_exec(tls, ts+3630 /* "COMMIT;" */, 0)
+ speedtest1_begin_test(tls, 150, ts+3685 /* "CREATE INDEX fiv..." */, 0)
+ speedtest1_exec(tls, ts+3709 /* "BEGIN;" */, 0)
+ speedtest1_exec(tls, ts+3716 /* "CREATE UNIQUE IN..." */, 0)
+ speedtest1_exec(tls, ts+3750 /* "CREATE INDEX t1c..." */, 0)
+ speedtest1_exec(tls, ts+3777 /* "CREATE UNIQUE IN..." */, 0)
+ speedtest1_exec(tls, ts+3811 /* "CREATE INDEX t2c..." */, 0)
+ speedtest1_exec(tls, ts+3843 /* "CREATE INDEX t3b..." */, 0)
+ speedtest1_exec(tls, ts+3873 /* "COMMIT;" */, 0)
speedtest1_end_test(tls)
n = (sz / 5)
- speedtest1_begin_test(tls, 160, ts+3638 /* "%d SELECTS, nume..." */, crt.VaList(bp+240, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 160, ts+3881 /* "%d SELECTS, nume..." */, libc.VaList(bp+240, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_prepare(tls,
- ts+3675 /* "SELECT count(*),..." */, crt.VaList(bp+248, n))
+ ts+3918 /* "SELECT count(*),..." */, libc.VaList(bp+248, n))
for i = 1; i <= n; i++ {
if ((i - 1) % g.nRepeat) == 0 {
x1 = (speedtest1_random(tls) % uint32(maxb))
@@ -4577,15 +4741,15 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = (sz / 5)
- speedtest1_begin_test(tls, 161, ts+3780 /* "%d SELECTS, nume..." */, crt.VaList(bp+256, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 161, ts+4023 /* "%d SELECTS, nume..." */, libc.VaList(bp+256, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_prepare(tls,
- ts+3812 /* "SELECT count(*),..." */, crt.VaList(bp+264, n))
+ ts+4055 /* "SELECT count(*),..." */, libc.VaList(bp+264, n))
for i = 1; i <= n; i++ {
if ((i - 1) % g.nRepeat) == 0 {
x1 = (speedtest1_random(tls) % uint32(maxb))
@@ -4595,15 +4759,15 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = (sz / 5)
- speedtest1_begin_test(tls, 170, ts+3917 /* "%d SELECTS, text..." */, crt.VaList(bp+272, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 170, ts+4160 /* "%d SELECTS, text..." */, libc.VaList(bp+272, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_prepare(tls,
- ts+3951 /* "SELECT count(*),..." */, crt.VaList(bp+280, n))
+ ts+4194 /* "SELECT count(*),..." */, libc.VaList(bp+280, n))
for i = 1; i <= n; i++ {
if ((i - 1) % g.nRepeat) == 0 {
x1 = swizzle(tls, uint32(i), uint32(maxb))
@@ -4612,42 +4776,42 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, len, uintptr(0))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = sz
- speedtest1_begin_test(tls, 180, ts+4063 /* "%d INSERTS with ..." */, crt.VaList(bp+288, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 180, ts+4306 /* "%d INSERTS with ..." */, libc.VaList(bp+288, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_exec(tls,
- ts+4093, /* "CREATE%s TABLE t..." */
- crt.VaList(bp+296, isTemp(tls, 1), g.zNN, g.zPK, g.zNN, g.zNN, g.zWR))
- speedtest1_exec(tls, ts+4164 /* "CREATE INDEX t4b..." */, 0)
- speedtest1_exec(tls, ts+4190 /* "CREATE INDEX t4c..." */, 0)
- speedtest1_exec(tls, ts+4216 /* "INSERT INTO t4 S..." */, 0)
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ ts+4336, /* "CREATE%s TABLE t..." */
+ libc.VaList(bp+296, isTemp(tls, 1), g.zNN, g.zPK, g.zNN, g.zNN, g.zWR))
+ speedtest1_exec(tls, ts+4407 /* "CREATE INDEX t4b..." */, 0)
+ speedtest1_exec(tls, ts+4433 /* "CREATE INDEX t4c..." */, 0)
+ speedtest1_exec(tls, ts+4459 /* "INSERT INTO t4 S..." */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = sz
- speedtest1_begin_test(tls, 190, ts+4248 /* "DELETE and REFIL..." */, crt.VaList(bp+344, n))
- speedtest1_exec(tls, ts+4276 /* "DELETE FROM t2;" */, 0)
- speedtest1_exec(tls, ts+4292 /* "INSERT INTO t2 S..." */, 0)
+ speedtest1_begin_test(tls, 190, ts+4491 /* "DELETE and REFIL..." */, libc.VaList(bp+344, n))
+ speedtest1_exec(tls, ts+4519 /* "DELETE FROM t2;" */, 0)
+ speedtest1_exec(tls, ts+4535 /* "INSERT INTO t2 S..." */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 200, ts+4325 /* "VACUUM" */, 0)
- speedtest1_exec(tls, ts+4325 /* "VACUUM" */, 0)
+ speedtest1_begin_test(tls, 200, ts+4568 /* "VACUUM" */, 0)
+ speedtest1_exec(tls, ts+4568 /* "VACUUM" */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 210, ts+4332 /* "ALTER TABLE ADD ..." */, 0)
- speedtest1_exec(tls, ts+4366 /* "ALTER TABLE t2 A..." */, 0)
- speedtest1_exec(tls, ts+4406 /* "SELECT sum(d) FR..." */, 0)
+ speedtest1_begin_test(tls, 210, ts+4575 /* "ALTER TABLE ADD ..." */, 0)
+ speedtest1_exec(tls, ts+4609 /* "ALTER TABLE t2 A..." */, 0)
+ speedtest1_exec(tls, ts+4649 /* "SELECT sum(d) FR..." */, 0)
speedtest1_end_test(tls)
n = (sz / 5)
- speedtest1_begin_test(tls, 230, ts+4428 /* "%d UPDATES, nume..." */, crt.VaList(bp+352, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 230, ts+4671 /* "%d UPDATES, nume..." */, libc.VaList(bp+352, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_prepare(tls,
- ts+4465 /* "UPDATE t2 SET d=..." */, crt.VaList(bp+360, n))
+ ts+4708 /* "UPDATE t2 SET d=..." */, libc.VaList(bp+360, n))
for i = 1; i <= n; i++ {
x1 = (speedtest1_random(tls) % uint32(maxb))
x2 = (((speedtest1_random(tls) % uint32(10)) + (uint32(sz / 5000))) + x1)
@@ -4655,35 +4819,35 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = sz
- speedtest1_begin_test(tls, 240, ts+4524 /* "%d UPDATES of in..." */, crt.VaList(bp+368, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 240, ts+4767 /* "%d UPDATES of in..." */, libc.VaList(bp+368, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_prepare(tls,
- ts+4554 /* "UPDATE t2 SET d=..." */, crt.VaList(bp+376, n))
+ ts+4797 /* "UPDATE t2 SET d=..." */, libc.VaList(bp+376, n))
for i = 1; i <= n; i++ {
x1 = ((speedtest1_random(tls) % uint32(sz)) + uint32(1))
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 250, ts+4598 /* "One big UPDATE o..." */, crt.VaList(bp+384, sz))
- speedtest1_exec(tls, ts+4639 /* "UPDATE t2 SET d=..." */, 0)
+ speedtest1_begin_test(tls, 250, ts+4841 /* "One big UPDATE o..." */, libc.VaList(bp+384, sz))
+ speedtest1_exec(tls, ts+4882 /* "UPDATE t2 SET d=..." */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 260, ts+4659 /* "Query added colu..." */, 0)
- speedtest1_exec(tls, ts+4406 /* "SELECT sum(d) FR..." */, 0)
+ speedtest1_begin_test(tls, 260, ts+4902 /* "Query added colu..." */, 0)
+ speedtest1_exec(tls, ts+4649 /* "SELECT sum(d) FR..." */, 0)
speedtest1_end_test(tls)
n = (sz / 5)
- speedtest1_begin_test(tls, 270, ts+4692 /* "%d DELETEs, nume..." */, crt.VaList(bp+392, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 270, ts+4935 /* "%d DELETEs, nume..." */, libc.VaList(bp+392, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_prepare(tls,
- ts+4729 /* "DELETE FROM t2 W..." */, crt.VaList(bp+400, n))
+ ts+4972 /* "DELETE FROM t2 W..." */, libc.VaList(bp+400, n))
for i = 1; i <= n; i++ {
x1 = ((speedtest1_random(tls) % uint32(maxb)) + uint32(1))
x2 = (((speedtest1_random(tls) % uint32(10)) + (uint32(sz / 5000))) + x1)
@@ -4691,41 +4855,41 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = sz
- speedtest1_begin_test(tls, 280, ts+4783 /* "%d DELETEs of in..." */, crt.VaList(bp+408, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 280, ts+5026 /* "%d DELETEs of in..." */, libc.VaList(bp+408, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_prepare(tls,
- ts+4813 /* "DELETE FROM t3 W..." */, crt.VaList(bp+416, n))
+ ts+5056 /* "DELETE FROM t3 W..." */, libc.VaList(bp+416, n))
for i = 1; i <= n; i++ {
x1 = ((speedtest1_random(tls) % uint32(sz)) + uint32(1))
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 290, ts+4852 /* "Refill two %d-ro..." */, crt.VaList(bp+424, sz))
- speedtest1_exec(tls, ts+4891 /* "REPLACE INTO t2(..." */, 0)
- speedtest1_exec(tls, ts+4935 /* "REPLACE INTO t3(..." */, 0)
+ speedtest1_begin_test(tls, 290, ts+5095 /* "Refill two %d-ro..." */, libc.VaList(bp+424, sz))
+ speedtest1_exec(tls, ts+5134 /* "REPLACE INTO t2(..." */, 0)
+ speedtest1_exec(tls, ts+5178 /* "REPLACE INTO t3(..." */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 300, ts+4979 /* "Refill a %d-row ..." */, crt.VaList(bp+432, sz))
- speedtest1_exec(tls, ts+4276 /* "DELETE FROM t2;" */, 0)
+ speedtest1_begin_test(tls, 300, ts+5222 /* "Refill a %d-row ..." */, libc.VaList(bp+432, sz))
+ speedtest1_exec(tls, ts+4519 /* "DELETE FROM t2;" */, 0)
speedtest1_exec(tls,
- ts+5020 /* "INSERT INTO t2(a..." */, 0)
+ ts+5263 /* "INSERT INTO t2(a..." */, 0)
speedtest1_exec(tls,
- ts+5085 /* "INSERT INTO t2(a..." */, 0)
+ ts+5328 /* "INSERT INTO t2(a..." */, 0)
speedtest1_end_test(tls)
n = (sz / 5)
- speedtest1_begin_test(tls, 310, ts+5150 /* "%d four-ways joi..." */, crt.VaList(bp+440, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
+ speedtest1_begin_test(tls, 310, ts+5393 /* "%d four-ways joi..." */, libc.VaList(bp+440, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
speedtest1_prepare(tls,
- ts+5169 /* "SELECT t1.c FROM..." */, 0)
+ ts+5412 /* "SELECT t1.c FROM..." */, 0)
for i = 1; i <= n; i++ {
x1 = ((speedtest1_random(tls) % uint32(sz)) + uint32(1))
x2 = (((speedtest1_random(tls) % uint32(10)) + x1) + uint32(4))
@@ -4733,25 +4897,25 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(x2))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 320, ts+5282 /* "subquery in resu..." */, crt.VaList(bp+448, n))
+ speedtest1_begin_test(tls, 320, ts+5525 /* "subquery in resu..." */, libc.VaList(bp+448, n))
speedtest1_prepare(tls,
- ts+5305 /* "SELECT sum(a), m..." */, 0)
+ ts+5548 /* "SELECT sum(a), m..." */, 0)
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (est_square_root(tls, g.szTest) * 50))
speedtest1_run(tls)
speedtest1_end_test(tls)
- sz = crt.AssignInt32(&n, (g.szTest * 700))
+ sz = libc.AssignInt32(&n, (g.szTest * 700))
*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr(0))) = int8(0)
maxb = int32(roundup_allones(tls, (uint32(sz / 3))))
- speedtest1_begin_test(tls, 400, ts+5423 /* "%d REPLACE ops o..." */, crt.VaList(bp+456, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
- speedtest1_exec(tls, ts+5448, /* "CREATE%s TABLE t..." */
- crt.VaList(bp+464, isTemp(tls, 9), g.zNN))
- speedtest1_prepare(tls, ts+5496 /* "REPLACE INTO t5 ..." */, crt.VaList(bp+480, n))
+ speedtest1_begin_test(tls, 400, ts+5666 /* "%d REPLACE ops o..." */, libc.VaList(bp+456, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
+ speedtest1_exec(tls, ts+5691, /* "CREATE%s TABLE t..." */
+ libc.VaList(bp+464, isTemp(tls, 9), g.zNN))
+ speedtest1_prepare(tls, ts+5739 /* "REPLACE INTO t5 ..." */, libc.VaList(bp+480, n))
for i = 1; i <= n; i++ {
x1 = swizzle(tls, uint32(i), uint32(maxb))
speedtest1_numbername(tls, uint32(i), bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
@@ -4759,10 +4923,10 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+568 /* &zNum[0] */, -1, uintptr(0))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 410, ts+5540 /* "%d SELECTS on an..." */, crt.VaList(bp+488, n))
- speedtest1_prepare(tls, ts+5561 /* "SELECT b FROM t5..." */, crt.VaList(bp+496, n))
+ speedtest1_begin_test(tls, 410, ts+5783 /* "%d SELECTS on an..." */, libc.VaList(bp+488, n))
+ speedtest1_prepare(tls, ts+5804 /* "SELECT b FROM t5..." */, libc.VaList(bp+496, n))
for i = 1; i <= n; i++ {
x1 = swizzle(tls, uint32(i), uint32(maxb))
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(sqlite3_int64(x1)))
@@ -4770,20 +4934,20 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
}
speedtest1_end_test(tls)
- sz = crt.AssignInt32(&n, (g.szTest * 700))
+ sz = libc.AssignInt32(&n, (g.szTest * 700))
*(*int8)(unsafe.Pointer(bp + 568 /* &zNum[0] */ + uintptr(0))) = int8(0)
maxb = int32(roundup_allones(tls, (uint32(sz / 3))))
- speedtest1_begin_test(tls, 500, ts+5603 /* "%d REPLACE on TE..." */, crt.VaList(bp+504, n))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
- speedtest1_exec(tls, ts+5625, /* "CREATE%s TABLE t..." */
- crt.VaList(bp+512, isTemp(tls, 9), g.zNN,
+ speedtest1_begin_test(tls, 500, ts+5846 /* "%d REPLACE on TE..." */, libc.VaList(bp+504, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
+ speedtest1_exec(tls, ts+5868, /* "CREATE%s TABLE t..." */
+ libc.VaList(bp+512, isTemp(tls, 9), g.zNN,
func() uintptr {
if sqlite3.Xsqlite3_libversion_number(tls) >= 3008002 {
- return ts + 5672 /* "WITHOUT ROWID" */
+ return ts + 5915 /* "WITHOUT ROWID" */
}
- return ts + 1988 /* "" */
+ return ts + 2152 /* "" */
}()))
- speedtest1_prepare(tls, ts+5686 /* "REPLACE INTO t6 ..." */, crt.VaList(bp+536, n))
+ speedtest1_prepare(tls, ts+5929 /* "REPLACE INTO t6 ..." */, libc.VaList(bp+536, n))
for i = 1; i <= n; i++ {
x1 = swizzle(tls, uint32(i), uint32(maxb))
speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
@@ -4791,10 +4955,10 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, bp+568 /* &zNum[0] */, -1, uintptr(0))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 510, ts+5730 /* "%d SELECTS on a ..." */, crt.VaList(bp+544, n))
- speedtest1_prepare(tls, ts+5754 /* "SELECT b FROM t6..." */, crt.VaList(bp+552, n))
+ speedtest1_begin_test(tls, 510, ts+5973 /* "%d SELECTS on a ..." */, libc.VaList(bp+544, n))
+ speedtest1_prepare(tls, ts+5997 /* "SELECT b FROM t6..." */, libc.VaList(bp+552, n))
for i = 1; i <= n; i++ {
x1 = swizzle(tls, uint32(i), uint32(maxb))
speedtest1_numbername(tls, x1, bp+568 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
@@ -4802,23 +4966,23 @@ func testset_main(tls *crt.TLS) { /* speedtest1.c:525:6: */
speedtest1_run(tls)
}
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 520, ts+5796 /* "%d SELECT DISTIN..." */, crt.VaList(bp+560, n))
- speedtest1_exec(tls, ts+5815 /* "SELECT DISTINCT ..." */, 0)
- speedtest1_exec(tls, ts+5842 /* "SELECT DISTINCT ..." */, 0)
+ speedtest1_begin_test(tls, 520, ts+6039 /* "%d SELECT DISTIN..." */, libc.VaList(bp+560, n))
+ speedtest1_exec(tls, ts+6058 /* "SELECT DISTINCT ..." */, 0)
+ speedtest1_exec(tls, ts+6085 /* "SELECT DISTINCT ..." */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 980, ts+5869 /* "PRAGMA integrity..." */, 0)
- speedtest1_exec(tls, ts+5869 /* "PRAGMA integrity..." */, 0)
+ speedtest1_begin_test(tls, 980, ts+6112 /* "PRAGMA integrity..." */, 0)
+ speedtest1_exec(tls, ts+6112 /* "PRAGMA integrity..." */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 990, ts+5892 /* "ANALYZE" */, 0)
- speedtest1_exec(tls, ts+5892 /* "ANALYZE" */, 0)
+ speedtest1_begin_test(tls, 990, ts+6135 /* "ANALYZE" */, 0)
+ speedtest1_exec(tls, ts+6135 /* "ANALYZE" */, 0)
speedtest1_end_test(tls)
}
// A testset for common table expressions. This exercises code
// for views, subqueries, co-routines, etc.
-func testset_cte(tls *crt.TLS) { /* speedtest1.c:975:6: */
+func testset_cte(tls *libc.TLS) { /* speedtest1.c:1144:6: */
bp := tls.Alloc(32)
defer tls.Free(32)
@@ -4833,38 +4997,38 @@ func testset_cte(tls *crt.TLS) { /* speedtest1.c:975:6: */
} else {
zPuz = azPuzzle[2]
}
- speedtest1_begin_test(tls, 100, ts+5900 /* "Sudoku with recu..." */, 0)
+ speedtest1_begin_test(tls, 100, ts+6143 /* "Sudoku with recu..." */, 0)
speedtest1_prepare(tls,
- ts+5931 /* "WITH RECURSIVE\n ..." */, 0)
+ ts+6174 /* "WITH RECURSIVE\n ..." */, 0)
sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, zPuz, -1, uintptr(0))
speedtest1_run(tls)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 200, ts+6735 /* "Sudoku with VALU..." */, 0)
+ speedtest1_begin_test(tls, 200, ts+6978 /* "Sudoku with VALU..." */, 0)
speedtest1_prepare(tls,
- ts+6763 /* "WITH RECURSIVE\n ..." */, 0)
+ ts+7006 /* "WITH RECURSIVE\n ..." */, 0)
sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 1, zPuz, -1, uintptr(0))
speedtest1_run(tls)
speedtest1_end_test(tls)
rSpacing = (5.0 / float64(g.szTest))
- speedtest1_begin_test(tls, 300, ts+7575 /* "Mandelbrot Set w..." */, crt.VaList(bp, rSpacing))
+ speedtest1_begin_test(tls, 300, ts+7818 /* "Mandelbrot Set w..." */, libc.VaList(bp, rSpacing))
speedtest1_prepare(tls,
- ts+7606 /* "WITH RECURSIVE \n..." */, 0)
+ ts+7849 /* "WITH RECURSIVE \n..." */, 0)
sqlite3.Xsqlite3_bind_double(tls, g.pStmt, 1, (rSpacing * .05))
sqlite3.Xsqlite3_bind_double(tls, g.pStmt, 2, rSpacing)
speedtest1_run(tls)
speedtest1_end_test(tls)
nElem = (10000 * g.szTest)
- speedtest1_begin_test(tls, 400, ts+8202 /* "EXCEPT operator ..." */, crt.VaList(bp+8, nElem))
+ speedtest1_begin_test(tls, 400, ts+8445 /* "EXCEPT operator ..." */, libc.VaList(bp+8, nElem))
speedtest1_prepare(tls,
- ts+8239, /* "WITH RECURSIVE \n..." */
- crt.VaList(bp+16, nElem, nElem))
+ ts+8482, /* "WITH RECURSIVE \n..." */
+ libc.VaList(bp+16, nElem, nElem))
speedtest1_run(tls)
speedtest1_end_test(tls)
}
@@ -4872,19 +5036,19 @@ func testset_cte(tls *crt.TLS) { /* speedtest1.c:975:6: */
var azPuzzle = [3]uintptr{
// Easy
- ts + 8470, /* "534...9..67.195...." */
+ ts + 8713, /* "534...9..67.195...." */
// Medium
- ts + 8552, /* "53....9..6..195...." */
+ ts + 8795, /* "53....9..6..195...." */
// Hard
- ts + 8634, /* "53.......6..195...." */
-} /* speedtest1.c:976:21 */
+ ts + 8877, /* "53.......6..195...." */
+} /* speedtest1.c:1145:21 */
// Compute a pseudo-random floating point ascii number.
-func speedtest1_random_ascii_fp(tls *crt.TLS, zFP uintptr) { /* speedtest1.c:1128:6: */
+func speedtest1_random_ascii_fp(tls *libc.TLS, zFP uintptr) { /* speedtest1.c:1297:6: */
bp := tls.Alloc(24)
defer tls.Free(24)
@@ -4896,11 +5060,11 @@ func speedtest1_random_ascii_fp(tls *crt.TLS, zFP uintptr) { /* speedtest1.c:112
z = -z
}
y = y / (10)
- sqlite3.Xsqlite3_snprintf(tls, 100, zFP, ts+8716 /* "%d.%de%d" */, crt.VaList(bp, y, z, (x%200)))
+ sqlite3.Xsqlite3_snprintf(tls, 100, zFP, ts+8959 /* "%d.%de%d" */, libc.VaList(bp, y, z, (x%200)))
}
// A testset for floating-point numbers.
-func testset_fp(tls *crt.TLS) { /* speedtest1.c:1141:6: */
+func testset_fp(tls *libc.TLS) { /* speedtest1.c:1310:6: */
bp := tls.Alloc(272)
defer tls.Free(272)
@@ -4911,11 +5075,11 @@ func testset_fp(tls *crt.TLS) { /* speedtest1.c:1141:6: */
// var zFP2 [100]int8 at bp+172, 100
n = (g.szTest * 5000)
- speedtest1_begin_test(tls, 100, ts+8725 /* "Fill a table wit..." */, crt.VaList(bp, (n*2)))
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
- speedtest1_exec(tls, ts+8756, /* "CREATE%s TABLE t..." */
- crt.VaList(bp+8, isTemp(tls, 1), g.zNN, g.zNN))
- speedtest1_prepare(tls, ts+8797 /* "INSERT INTO t1 V..." */, crt.VaList(bp+32, n))
+ speedtest1_begin_test(tls, 100, ts+8968 /* "Fill a table wit..." */, libc.VaList(bp, (n*2)))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
+ speedtest1_exec(tls, ts+8999, /* "CREATE%s TABLE t..." */
+ libc.VaList(bp+8, isTemp(tls, 1), g.zNN, g.zNN))
+ speedtest1_prepare(tls, ts+9040 /* "INSERT INTO t1 V..." */, libc.VaList(bp+32, n))
for i = 1; i <= n; i++ {
speedtest1_random_ascii_fp(tls, bp+72 /* &zFP1[0] */)
speedtest1_random_ascii_fp(tls, bp+172 /* &zFP2[0] */)
@@ -4923,12 +5087,12 @@ func testset_fp(tls *crt.TLS) { /* speedtest1.c:1141:6: */
sqlite3.Xsqlite3_bind_text(tls, g.pStmt, 2, bp+172 /* &zFP2[0] */, -1, uintptr(0))
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
n = ((g.szTest / 25) + 2)
- speedtest1_begin_test(tls, 110, ts+8839 /* "%d range queries" */, crt.VaList(bp+40, n))
- speedtest1_prepare(tls, ts+8856 /* "SELECT sum(b) FR..." */, 0)
+ speedtest1_begin_test(tls, 110, ts+9082 /* "%d range queries" */, libc.VaList(bp+40, n))
+ speedtest1_prepare(tls, ts+9099 /* "SELECT sum(b) FR..." */, 0)
for i = 1; i <= n; i++ {
speedtest1_random_ascii_fp(tls, bp+72 /* &zFP1[0] */)
speedtest1_random_ascii_fp(tls, bp+172 /* &zFP2[0] */)
@@ -4938,17 +5102,17 @@ func testset_fp(tls *crt.TLS) { /* speedtest1.c:1141:6: */
}
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 120, ts+8904 /* "CREATE INDEX thr..." */, 0)
- speedtest1_exec(tls, ts+3466 /* "BEGIN;" */, 0)
- speedtest1_exec(tls, ts+8929 /* "CREATE INDEX t1a..." */, 0)
- speedtest1_exec(tls, ts+8956 /* "CREATE INDEX t1b..." */, 0)
- speedtest1_exec(tls, ts+8983 /* "CREATE INDEX t1a..." */, 0)
- speedtest1_exec(tls, ts+3630 /* "COMMIT;" */, 0)
+ speedtest1_begin_test(tls, 120, ts+9147 /* "CREATE INDEX thr..." */, 0)
+ speedtest1_exec(tls, ts+3709 /* "BEGIN;" */, 0)
+ speedtest1_exec(tls, ts+9172 /* "CREATE INDEX t1a..." */, 0)
+ speedtest1_exec(tls, ts+9199 /* "CREATE INDEX t1b..." */, 0)
+ speedtest1_exec(tls, ts+9226 /* "CREATE INDEX t1a..." */, 0)
+ speedtest1_exec(tls, ts+3873 /* "COMMIT;" */, 0)
speedtest1_end_test(tls)
n = ((g.szTest / 3) + 2)
- speedtest1_begin_test(tls, 130, ts+9013 /* "%d indexed range..." */, crt.VaList(bp+48, n))
- speedtest1_prepare(tls, ts+8856 /* "SELECT sum(b) FR..." */, 0)
+ speedtest1_begin_test(tls, 130, ts+9256 /* "%d indexed range..." */, libc.VaList(bp+48, n))
+ speedtest1_prepare(tls, ts+9099 /* "SELECT sum(b) FR..." */, 0)
for i = 1; i <= n; i++ {
speedtest1_random_ascii_fp(tls, bp+72 /* &zFP1[0] */)
speedtest1_random_ascii_fp(tls, bp+172 /* &zFP2[0] */)
@@ -4959,20 +5123,253 @@ func testset_fp(tls *crt.TLS) { /* speedtest1.c:1141:6: */
speedtest1_end_test(tls)
n = (g.szTest * 5000)
- speedtest1_begin_test(tls, 140, ts+9038 /* "%d calls to roun..." */, crt.VaList(bp+56, n))
- speedtest1_exec(tls, ts+9058 /* "SELECT sum(round..." */, 0)
+ speedtest1_begin_test(tls, 140, ts+9281 /* "%d calls to roun..." */, libc.VaList(bp+56, n))
+ speedtest1_exec(tls, ts+9301 /* "SELECT sum(round..." */, 0)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 150, ts+9101 /* "%d printf() call..." */, crt.VaList(bp+64, (n*4)))
+ speedtest1_begin_test(tls, 150, ts+9344 /* "%d printf() call..." */, libc.VaList(bp+64, (n*4)))
speedtest1_exec(tls,
- ts+9119 /* "WITH c(fmt) AS (..." */, 0)
+ ts+9362 /* "WITH c(fmt) AS (..." */, 0)
+ speedtest1_end_test(tls)
+}
+
+// Generate two numbers between 1 and mx. The first number is less than
+// the second. Usually the numbers are near each other but can sometimes
+// be far apart.
+func twoCoords(tls *libc.TLS, p1 int32, p2 int32, mx uint32, pX0 uintptr, pX1 uintptr) { /* speedtest1.c:1383:13: */
+ var d uint32
+ var x0 uint32
+ var x1 uint32
+ var span uint32
+
+ span = ((mx / uint32(100)) + uint32(1))
+ if (speedtest1_random(tls) % uint32(3)) == uint32(0) {
+ span = span * (uint32(p1))
+ }
+ if (speedtest1_random(tls) % uint32(p2)) == uint32(0) {
+ span = (mx / uint32(2))
+ }
+ d = ((speedtest1_random(tls) % span) + uint32(1))
+ x0 = ((speedtest1_random(tls) % (mx - d)) + uint32(1))
+ x1 = (x0 + d)
+ *(*uint32)(unsafe.Pointer(pX0)) = x0
+ *(*uint32)(unsafe.Pointer(pX1)) = x1
+}
+
+// The following routine is an R-Tree geometry callback. It returns
+// true if the object overlaps a slice on the Y coordinate between the
+// two values given as arguments. In other words
+//
+// SELECT count(*) FROM rt1 WHERE id MATCH xslice(10,20);
+//
+// Is the same as saying:
+//
+// SELECT count(*) FROM rt1 WHERE y1>=10 AND y0<=20;
+func xsliceGeometryCallback(tls *libc.TLS, p uintptr, nCoord int32, aCoord uintptr, pRes uintptr) int32 { /* speedtest1.c:1412:12: */
+ *(*int32)(unsafe.Pointer(pRes)) = (libc.Bool32((*(*float64)(unsafe.Pointer(aCoord + uintptr(3)*8)) >= *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).aParam + uintptr(0)*8))) && (*(*float64)(unsafe.Pointer(aCoord + uintptr(2)*8)) <= *(*sqlite3_rtree_dbl)(unsafe.Pointer((*sqlite3_rtree_geometry)(unsafe.Pointer(p)).aParam + uintptr(1)*8)))))
+ return 0
+}
+
+// A testset for the R-Tree virtual table
+func testset_rtree(tls *libc.TLS, p1 int32, p2 int32) { /* speedtest1.c:1427:6: */
+ bp := tls.Alloc(224)
+ defer tls.Free(224)
+
+ var i uint32
+ var n uint32
+ var mxCoord uint32
+ // var x0 uint32 at bp+200, 4
+
+ // var x1 uint32 at bp+204, 4
+
+ // var y0 uint32 at bp+208, 4
+
+ // var y1 uint32 at bp+212, 4
+
+ // var z0 uint32 at bp+216, 4
+
+ // var z1 uint32 at bp+220, 4
+
+ var iStep uint32
+ var mxRowid uint32
+ var aCheck uintptr = sqlite3.Xsqlite3_malloc(tls, (int32((uint64(unsafe.Sizeof(int32(0))) * uint64(g.szTest)) * uint64(500))))
+
+ mxCoord = uint32(15000)
+ mxRowid = libc.AssignUint32(&n, (uint32(g.szTest * 500)))
+ speedtest1_begin_test(tls, 100, ts+9457 /* "%d INSERTs into ..." */, libc.VaList(bp, n))
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
+ speedtest1_exec(tls, ts+9483 /* "CREATE VIRTUAL T..." */, 0)
+ speedtest1_prepare(tls,
+ ts+9542 /* "INSERT INTO rt1(..." */, 0)
+ for i = uint32(1); i <= n; i++ {
+ twoCoords(tls, p1, p2, mxCoord, bp+200 /* &x0 */, bp+204 /* &x1 */)
+ twoCoords(tls, p1, p2, mxCoord, bp+208 /* &y0 */, bp+212 /* &y1 */)
+ twoCoords(tls, p1, p2, mxCoord, bp+216 /* &z0 */, bp+220 /* &z1 */)
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(i))
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, int32(*(*uint32)(unsafe.Pointer(bp + 200 /* x0 */))))
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 3, int32(*(*uint32)(unsafe.Pointer(bp + 204 /* x1 */))))
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 4, int32(*(*uint32)(unsafe.Pointer(bp + 208 /* y0 */))))
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 5, int32(*(*uint32)(unsafe.Pointer(bp + 212 /* y1 */))))
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 6, int32(*(*uint32)(unsafe.Pointer(bp + 216 /* z0 */))))
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 7, int32(*(*uint32)(unsafe.Pointer(bp + 220 /* z1 */))))
+ speedtest1_run(tls)
+ }
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
+ speedtest1_end_test(tls)
+
+ speedtest1_begin_test(tls, 101, ts+9608 /* "Copy from rtree ..." */, 0)
+ speedtest1_exec(tls, ts+9643 /* "CREATE TABLE t1(..." */, 0)
+ speedtest1_exec(tls, ts+9701 /* "INSERT INTO t1 S..." */, 0)
+ speedtest1_end_test(tls)
+
+ n = (uint32(g.szTest * 200))
+ speedtest1_begin_test(tls, 110, ts+9734 /* "%d one-dimension..." */, libc.VaList(bp+8, n))
+ speedtest1_prepare(tls, ts+9777 /* "SELECT count(*) ..." */, 0)
+ iStep = (mxCoord / n)
+ for i = uint32(0); i < n; i++ {
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep)))
+ speedtest1_run(tls)
+ *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)
+ }
+ speedtest1_end_test(tls)
+
+ if g.bVerify != 0 {
+ n = (uint32(g.szTest * 200))
+ speedtest1_begin_test(tls, 111, ts+9826 /* "Verify result fr..." */, 0)
+ speedtest1_prepare(tls, ts+9873 /* "SELECT count(*) ..." */, 0)
+ iStep = (mxCoord / n)
+ for i = uint32(0); i < n; i++ {
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep)))
+ speedtest1_run(tls)
+ if *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) != libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) {
+ fatal_error(tls, ts+9921, /* "Count disagree s..." */
+ libc.VaList(bp+16, i, (i*iStep), ((i+uint32(1))*iStep), *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)), libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)))
+ }
+ }
+ speedtest1_end_test(tls)
+ }
+
+ n = (uint32(g.szTest * 200))
+ speedtest1_begin_test(tls, 120, ts+9963 /* "%d one-dimension..." */, libc.VaList(bp+56, n))
+ speedtest1_prepare(tls, ts+10004 /* "SELECT count(*) ..." */, 0)
+ iStep = (mxCoord / n)
+ for i = uint32(0); i < n; i++ {
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep)))
+ speedtest1_run(tls)
+ *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)
+ }
+ speedtest1_end_test(tls)
+
+ if g.bVerify != 0 {
+ n = (uint32(g.szTest * 200))
+ speedtest1_begin_test(tls, 121, ts+10053 /* "Verify result fr..." */, 0)
+ speedtest1_prepare(tls, ts+10098 /* "SELECT count(*) ..." */, 0)
+ iStep = (mxCoord / n)
+ for i = uint32(0); i < n; i++ {
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep)))
+ speedtest1_run(tls)
+ if *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) != libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) {
+ fatal_error(tls, ts+9921, /* "Count disagree s..." */
+ libc.VaList(bp+64, i, (i*iStep), ((i+uint32(1))*iStep), *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)), libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)))
+ }
+ }
+ speedtest1_end_test(tls)
+ }
+
+ n = (uint32(g.szTest * 200))
+ speedtest1_begin_test(tls, 125, ts+10146 /* "%d custom geomet..." */, libc.VaList(bp+104, n))
+ sqlite3.Xsqlite3_rtree_geometry_callback(tls, g.db, ts+10182 /* "xslice" */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
+ }{xsliceGeometryCallback})), uintptr(0))
+ speedtest1_prepare(tls, ts+10189 /* "SELECT count(*) ..." */, 0)
+ iStep = (mxCoord / n)
+ for i = uint32(0); i < n; i++ {
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep)))
+ speedtest1_run(tls)
+ if *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) != libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */) {
+ fatal_error(tls, ts+9921, /* "Count disagree s..." */
+ libc.VaList(bp+112, i, (i*iStep), ((i+uint32(1))*iStep), *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)), libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)))
+ }
+ }
+ speedtest1_end_test(tls)
+
+ n = (uint32(g.szTest * 400))
+ speedtest1_begin_test(tls, 130, ts+10243 /* "%d three-dimensi..." */, libc.VaList(bp+152, n))
+ speedtest1_prepare(tls,
+ ts+10286 /* "SELECT count(*) ..." */, 0)
+ iStep = (mxCoord / n)
+ for i = uint32(0); i < n; i++ {
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 2, (int32((i + uint32(1)) * iStep)))
+ speedtest1_run(tls)
+ *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)
+ }
+ speedtest1_end_test(tls)
+
+ n = (uint32(g.szTest * 500))
+ speedtest1_begin_test(tls, 140, ts+10379 /* "%d rowid queries" */, libc.VaList(bp+160, n))
+ speedtest1_prepare(tls, ts+10396 /* "SELECT * FROM rt..." */, 0)
+ for i = uint32(1); i <= n; i++ {
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(i))
+ speedtest1_run(tls)
+ }
+ speedtest1_end_test(tls)
+
+ n = (uint32(g.szTest * 50))
+ speedtest1_begin_test(tls, 150, ts+10426 /* "%d UPDATEs using..." */, libc.VaList(bp+168, n))
+ speedtest1_prepare(tls, ts+10449 /* "UPDATE rt1 SET x..." */, 0)
+ for i = uint32(1); i <= n; i++ {
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(((i * uint32(251)) % mxRowid) + uint32(1))))
+ speedtest1_run(tls)
+ }
+ speedtest1_end_test(tls)
+
+ n = (uint32(g.szTest * 5))
+ speedtest1_begin_test(tls, 155, ts+10497 /* "%d UPDATEs using..." */, libc.VaList(bp+176, n))
+ speedtest1_prepare(tls,
+ ts+10538 /* "UPDATE rt1 SET x..." */, 0)
+ iStep = (mxCoord / n)
+ for i = uint32(0); i < n; i++ {
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
+ speedtest1_run(tls)
+ *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)
+ }
+ speedtest1_end_test(tls)
+
+ n = (uint32(g.szTest * 50))
+ speedtest1_begin_test(tls, 160, ts+10600 /* "%d DELETEs using..." */, libc.VaList(bp+184, n))
+ speedtest1_prepare(tls, ts+10623 /* "DELETE FROM rt1 ..." */, 0)
+ for i = uint32(1); i <= n; i++ {
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(((i * uint32(257)) % mxRowid) + uint32(1))))
+ speedtest1_run(tls)
+ }
+ speedtest1_end_test(tls)
+
+ n = (uint32(g.szTest * 5))
+ speedtest1_begin_test(tls, 165, ts+10651 /* "%d DELETEs using..." */, libc.VaList(bp+192, n))
+ speedtest1_prepare(tls, ts+10692 /* "DELETE FROM rt1 ..." */, 0)
+ iStep = (mxCoord / n)
+ for i = uint32(0); i < n; i++ {
+ sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i * iStep)))
+ speedtest1_run(tls)
+ *(*int32)(unsafe.Pointer(aCheck + uintptr(i)*4)) = libc.Xatoi(tls, uintptr(unsafe.Pointer(&g))+116 /* &.zResult */)
+ }
+ speedtest1_end_test(tls)
+
+ speedtest1_begin_test(tls, 170, ts+10734 /* "Restore deleted ..." */, 0)
+ speedtest1_exec(tls, ts+10781 /* "INSERT OR IGNORE..." */, 0)
speedtest1_end_test(tls)
}
// A testset that does key/value storage on tables with many columns.
// This is the kind of workload generated by ORMs such as CoreData.
-func testset_orm(tls *crt.TLS) { /* speedtest1.c:1443:6: */
+func testset_orm(tls *libc.TLS) { /* speedtest1.c:1612:6: */
bp := tls.Alloc(2016)
defer tls.Free(2016)
@@ -4984,18 +5381,18 @@ func testset_orm(tls *crt.TLS) { /* speedtest1.c:1443:6: */
var len uint32
// var zNum [2000]int8 at bp+16, 2000
- nRow = crt.AssignUint32(&n, (uint32(g.szTest * 250)))
- speedtest1_begin_test(tls, 100, ts+9214 /* "Fill %d rows" */, crt.VaList(bp, n))
+ nRow = libc.AssignUint32(&n, (uint32(g.szTest * 250)))
+ speedtest1_begin_test(tls, 100, ts+10824 /* "Fill %d rows" */, libc.VaList(bp, n))
speedtest1_exec(tls,
- ts+9227 /* "BEGIN;CREATE TAB..." */, 0)
+ ts+10837 /* "BEGIN;CREATE TAB..." */, 0)
speedtest1_prepare(tls,
- ts+13127 /* "INSERT INTO ZLOO..." */, 0)
+ ts+14737 /* "INSERT INTO ZLOO..." */, 0)
for i = uint32(0); i < n; i++ {
x1 = speedtest1_random(tls)
speedtest1_numbername(tls, (x1 % uint32(1000)), bp+16 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
- len = uint32(int32(crt.Xstrlen(tls, bp+16 /* &zNum[0] */)))
+ len = uint32(int32(libc.Xstrlen(tls, bp+16 /* &zNum[0] */)))
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (int32(i ^ uint32(0xf))))
for j = uint32(0); zType[j] != 0; j++ {
switch int32(zType[j]) {
@@ -5017,14 +5414,14 @@ func testset_orm(tls *crt.TLS) { /* speedtest1.c:1443:6: */
}
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+3630 /* "COMMIT;" */, 0)
+ speedtest1_exec(tls, ts+3873 /* "COMMIT;" */, 0)
speedtest1_end_test(tls)
n = (uint32(g.szTest * 250))
- speedtest1_begin_test(tls, 110, ts+16371 /* "Query %d rows by..." */, crt.VaList(bp+8, n))
+ speedtest1_begin_test(tls, 110, ts+17981 /* "Query %d rows by..." */, libc.VaList(bp+8, n))
speedtest1_prepare(tls,
- ts+16394 /* "SELECT ZCYANBASE..." */, 0)
+ ts+18004 /* "SELECT ZCYANBASE..." */, 0)
for i = uint32(0); i < n; i++ {
x1 = (speedtest1_random(tls) % nRow)
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, int32(x1))
@@ -5033,10 +5430,10 @@ func testset_orm(tls *crt.TLS) { /* speedtest1.c:1443:6: */
speedtest1_end_test(tls)
}
-var zType = *(*[120]int8)(unsafe.Pointer(ts + 19147 /* "IBBIIITIVVITBTBF..." */)) /* speedtest1.c:1448:21 */
+var zType = *(*[120]int8)(unsafe.Pointer(ts + 20757 /* "IBBIIITIVVITBTBF..." */)) /* speedtest1.c:1617:21 */
//
-func testset_trigger(tls *crt.TLS) { /* speedtest1.c:1710:6: */
+func testset_trigger(tls *libc.TLS) { /* speedtest1.c:1879:6: */
bp := tls.Alloc(2032)
defer tls.Free(2032)
@@ -5050,9 +5447,9 @@ func testset_trigger(tls *crt.TLS) { /* speedtest1.c:1710:6: */
speedtest1_exec(tls,
- ts+19267 /* "BEGIN;CREATE TAB..." */, 0)
+ ts+20877 /* "BEGIN;CREATE TAB..." */, 0)
for jj = 1; jj <= 3; jj++ {
- speedtest1_prepare(tls, ts+19595 /* "INSERT INTO t%d ..." */, crt.VaList(bp, jj))
+ speedtest1_prepare(tls, ts+21205 /* "INSERT INTO t%d ..." */, libc.VaList(bp, jj))
for ii = 0; ii < NROW; ii++ {
var x1 int32 = (int32(speedtest1_random(tls) % uint32(NROW)))
speedtest1_numbername(tls, uint32(x1), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
@@ -5063,23 +5460,23 @@ func testset_trigger(tls *crt.TLS) { /* speedtest1.c:1710:6: */
}
speedtest1_exec(tls,
- ts+19630 /* "CREATE INDEX i1 ..." */, 0)
+ ts+21240 /* "CREATE INDEX i1 ..." */, 0)
- speedtest1_begin_test(tls, 100, ts+19713 /* "speed4p-join1" */, 0)
+ speedtest1_begin_test(tls, 100, ts+21323 /* "speed4p-join1" */, 0)
speedtest1_prepare(tls,
- ts+19727 /* "SELECT * FROM t1..." */, 0)
+ ts+21337 /* "SELECT * FROM t1..." */, 0)
speedtest1_run(tls)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 110, ts+19794 /* "speed4p-join2" */, 0)
+ speedtest1_begin_test(tls, 110, ts+21404 /* "speed4p-join2" */, 0)
speedtest1_prepare(tls,
- ts+19808 /* "SELECT * FROM t1..." */, 0)
+ ts+21418 /* "SELECT * FROM t1..." */, 0)
speedtest1_run(tls)
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 120, ts+19867 /* "speed4p-view1" */, 0)
+ speedtest1_begin_test(tls, 120, ts+21477 /* "speed4p-view1" */, 0)
for jj = 1; jj <= 3; jj++ {
- speedtest1_prepare(tls, ts+19881 /* "SELECT * FROM v%..." */, crt.VaList(bp+8, jj))
+ speedtest1_prepare(tls, ts+21491 /* "SELECT * FROM v%..." */, libc.VaList(bp+8, jj))
for ii = 0; ii < NROW2; ii = ii + (3) {
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (ii * 3))
speedtest1_run(tls)
@@ -5087,9 +5484,9 @@ func testset_trigger(tls *crt.TLS) { /* speedtest1.c:1710:6: */
}
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 130, ts+19915 /* "speed4p-table1" */, 0)
+ speedtest1_begin_test(tls, 130, ts+21525 /* "speed4p-table1" */, 0)
for jj = 1; jj <= 3; jj++ {
- speedtest1_prepare(tls, ts+19930 /* "SELECT * FROM t%..." */, crt.VaList(bp+16, jj))
+ speedtest1_prepare(tls, ts+21540 /* "SELECT * FROM t%..." */, libc.VaList(bp+16, jj))
for ii = 0; ii < NROW2; ii = ii + (3) {
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (ii * 3))
speedtest1_run(tls)
@@ -5097,9 +5494,9 @@ func testset_trigger(tls *crt.TLS) { /* speedtest1.c:1710:6: */
}
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 140, ts+19915 /* "speed4p-table1" */, 0)
+ speedtest1_begin_test(tls, 140, ts+21525 /* "speed4p-table1" */, 0)
for jj = 1; jj <= 3; jj++ {
- speedtest1_prepare(tls, ts+19930 /* "SELECT * FROM t%..." */, crt.VaList(bp+24, jj))
+ speedtest1_prepare(tls, ts+21540 /* "SELECT * FROM t%..." */, libc.VaList(bp+24, jj))
for ii = 0; ii < NROW2; ii = ii + (3) {
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (ii * 3))
speedtest1_run(tls)
@@ -5107,37 +5504,37 @@ func testset_trigger(tls *crt.TLS) { /* speedtest1.c:1710:6: */
}
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 150, ts+19964 /* "speed4p-subselec..." */, 0)
+ speedtest1_begin_test(tls, 150, ts+21574 /* "speed4p-subselec..." */, 0)
speedtest1_prepare(tls,
- ts+19983 /* "SELECT (SELECT t..." */, 0)
+ ts+21593 /* "SELECT (SELECT t..." */, 0)
for jj = 0; jj < NROW2; jj++ {
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 3))
speedtest1_run(tls)
}
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 160, ts+20098 /* "speed4p-rowid-up..." */, 0)
- speedtest1_exec(tls, ts+2553 /* "BEGIN" */, 0)
- speedtest1_prepare(tls, ts+20119 /* "UPDATE t1 SET i=..." */, 0)
+ speedtest1_begin_test(tls, 160, ts+21708 /* "speed4p-rowid-up..." */, 0)
+ speedtest1_exec(tls, ts+2796 /* "BEGIN" */, 0)
+ speedtest1_prepare(tls, ts+21729 /* "UPDATE t1 SET i=..." */, 0)
for jj = 0; jj < NROW2; jj++ {
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, jj)
speedtest1_run(tls)
}
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
speedtest1_end_test(tls)
- speedtest1_exec(tls, ts+20154 /* "CREATE TABLE t5(..." */, 0)
- speedtest1_begin_test(tls, 170, ts+20202 /* "speed4p-insert-i..." */, 0)
- speedtest1_exec(tls, ts+20224 /* "INSERT OR IGNORE..." */, 0)
+ speedtest1_exec(tls, ts+21764 /* "CREATE TABLE t5(..." */, 0)
+ speedtest1_begin_test(tls, 170, ts+21812 /* "speed4p-insert-i..." */, 0)
+ speedtest1_exec(tls, ts+21834 /* "INSERT OR IGNORE..." */, 0)
speedtest1_end_test(tls)
speedtest1_exec(tls,
- ts+20269 /* "CREATE TABLE log..." */, 0)
+ ts+21879 /* "CREATE TABLE log..." */, 0)
- speedtest1_begin_test(tls, 180, ts+20759 /* "speed4p-trigger1" */, 0)
- speedtest1_prepare(tls, ts+20776 /* "INSERT INTO t4 V..." */, 0)
+ speedtest1_begin_test(tls, 180, ts+22369 /* "speed4p-trigger1" */, 0)
+ speedtest1_prepare(tls, ts+22386 /* "INSERT INTO t4 V..." */, 0)
for jj = 0; jj < NROW2; jj++ {
speedtest1_numbername(tls, uint32(jj), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, jj)
@@ -5149,8 +5546,8 @@ func testset_trigger(tls *crt.TLS) { /* speedtest1.c:1710:6: */
// Note: Of the queries, only half actually update a row. This property
// was copied over from speed4p.test, where it was probably introduced
// inadvertantly.
- speedtest1_begin_test(tls, 190, ts+20812 /* "speed4p-trigger2" */, 0)
- speedtest1_prepare(tls, ts+20829 /* "UPDATE t4 SET i ..." */, 0)
+ speedtest1_begin_test(tls, 190, ts+22422 /* "speed4p-trigger2" */, 0)
+ speedtest1_prepare(tls, ts+22439 /* "UPDATE t4 SET i ..." */, 0)
for jj = 1; jj <= (NROW2 * 2); jj = jj + (2) {
speedtest1_numbername(tls, (uint32(jj * 2)), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 2))
@@ -5161,14 +5558,14 @@ func testset_trigger(tls *crt.TLS) { /* speedtest1.c:1710:6: */
speedtest1_end_test(tls)
// Note: Same again.
- speedtest1_begin_test(tls, 200, ts+20875 /* "speed4p-trigger3" */, 0)
- speedtest1_prepare(tls, ts+20892 /* "DELETE FROM t4 W..." */, 0)
+ speedtest1_begin_test(tls, 200, ts+22485 /* "speed4p-trigger3" */, 0)
+ speedtest1_prepare(tls, ts+22502 /* "DELETE FROM t4 W..." */, 0)
for jj = 1; jj <= (NROW2 * 2); jj = jj + (2) {
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 2))
speedtest1_run(tls)
}
speedtest1_end_test(tls)
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
// The following block contains the same tests as the above block that
// tests triggers, with one crucial difference: no triggers are defined.
@@ -5176,9 +5573,9 @@ func testset_trigger(tls *crt.TLS) { /* speedtest1.c:1710:6: */
// is the amount of time taken to compile and execute the trigger programs.
speedtest1_exec(tls,
- ts+20924 /* "DROP TABLE t4;DR..." */, 0)
- speedtest1_begin_test(tls, 210, ts+21029 /* "speed4p-notrigge..." */, 0)
- speedtest1_prepare(tls, ts+20776 /* "INSERT INTO t4 V..." */, 0)
+ ts+22534 /* "DROP TABLE t4;DR..." */, 0)
+ speedtest1_begin_test(tls, 210, ts+22639 /* "speed4p-notrigge..." */, 0)
+ speedtest1_prepare(tls, ts+22386 /* "INSERT INTO t4 V..." */, 0)
for jj = 0; jj < NROW2; jj++ {
speedtest1_numbername(tls, uint32(jj), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, jj)
@@ -5186,8 +5583,8 @@ func testset_trigger(tls *crt.TLS) { /* speedtest1.c:1710:6: */
speedtest1_run(tls)
}
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 210, ts+21048 /* "speed4p-notrigge..." */, 0)
- speedtest1_prepare(tls, ts+20829 /* "UPDATE t4 SET i ..." */, 0)
+ speedtest1_begin_test(tls, 210, ts+22658 /* "speed4p-notrigge..." */, 0)
+ speedtest1_prepare(tls, ts+22439 /* "UPDATE t4 SET i ..." */, 0)
for jj = 1; jj <= (NROW2 * 2); jj = jj + (2) {
speedtest1_numbername(tls, (uint32(jj * 2)), bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 2))
@@ -5196,18 +5593,18 @@ func testset_trigger(tls *crt.TLS) { /* speedtest1.c:1710:6: */
speedtest1_run(tls)
}
speedtest1_end_test(tls)
- speedtest1_begin_test(tls, 220, ts+21067 /* "speed4p-notrigge..." */, 0)
- speedtest1_prepare(tls, ts+20892 /* "DELETE FROM t4 W..." */, 0)
+ speedtest1_begin_test(tls, 220, ts+22677 /* "speed4p-notrigge..." */, 0)
+ speedtest1_prepare(tls, ts+22502 /* "DELETE FROM t4 W..." */, 0)
for jj = 1; jj <= (NROW2 * 2); jj = jj + (2) {
sqlite3.Xsqlite3_bind_int(tls, g.pStmt, 1, (jj * 2))
speedtest1_run(tls)
}
speedtest1_end_test(tls)
- speedtest1_exec(tls, ts+2663 /* "COMMIT" */, 0)
+ speedtest1_exec(tls, ts+2906 /* "COMMIT" */, 0)
}
// A testset used for debugging speedtest1 itself.
-func testset_debug1(tls *crt.TLS) { /* speedtest1.c:1912:6: */
+func testset_debug1(tls *libc.TLS) { /* speedtest1.c:2081:6: */
bp := tls.Alloc(2032)
defer tls.Free(2032)
@@ -5223,7 +5620,7 @@ func testset_debug1(tls *crt.TLS) { /* speedtest1.c:1912:6: */
x1 = swizzle(tls, i, n)
x2 = swizzle(tls, x1, n)
speedtest1_numbername(tls, x1, bp+32 /* &zNum[0] */, int32(unsafe.Sizeof([2000]int8{})))
- crt.Xprintf(tls, ts+21086 /* "%5d %5d %5d %s\n" */, crt.VaList(bp, i, x1, x2, bp+32 /* &zNum[0] */))
+ libc.Xprintf(tls, ts+22696 /* "%5d %5d %5d %s\n" */, libc.VaList(bp, i, x1, x2, bp+32 /* &zNum[0] */))
}
}
@@ -5266,58 +5663,58 @@ func testset_debug1(tls *crt.TLS) { /* speedtest1.c:1912:6: */
// POSIX Standard: 2.10 Symbolic Constants <unistd.h>
// Attempt to display I/O stats on Linux using /proc/PID/io
-func displayLinuxIoStats(tls *crt.TLS, out uintptr) { /* speedtest1.c:1933:13: */
+func displayLinuxIoStats(tls *libc.TLS, out uintptr) { /* speedtest1.c:2102:13: */
bp := tls.Alloc(224)
defer tls.Free(224)
var in uintptr
// var z [200]int8 at bp+24, 200
- sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+24 /* &z[0] */, ts+21102 /* "/proc/%d/io" */, crt.VaList(bp, crt.Xgetpid(tls)))
- in = crt.Xfopen(tls, bp+24 /* &z[0] */, ts+21114 /* "rb" */)
+ sqlite3.Xsqlite3_snprintf(tls, int32(unsafe.Sizeof([200]int8{})), bp+24 /* &z[0] */, ts+22712 /* "/proc/%d/io" */, libc.VaList(bp, libc.Xgetpid(tls)))
+ in = libc.Xfopen(tls, bp+24 /* &z[0] */, ts+22724 /* "rb" */)
if in == uintptr(0) {
return
}
- for crt.Xfgets(tls, bp+24 /* &z[0] */, int32(unsafe.Sizeof([200]int8{})), in) != uintptr(0) {
+ for libc.Xfgets(tls, bp+24 /* &z[0] */, int32(unsafe.Sizeof([200]int8{})), in) != uintptr(0) {
var i int32
for i = 0; uint64(i) < (uint64(unsafe.Sizeof(aTrans)) / uint64(unsafe.Sizeof(struct {
zPattern uintptr
zDesc uintptr
}{}))); i++ {
- var n int32 = int32(crt.Xstrlen(tls, aTrans[i].zPattern))
- if crt.Xstrncmp(tls, aTrans[i].zPattern, bp+24 /* &z[0] */, uint64(n)) == 0 {
- crt.Xfprintf(tls, out, ts+21117 /* "-- %-28s %s" */, crt.VaList(bp+8, aTrans[i].zDesc, (bp+24 /* &z */ +uintptr(n))))
+ var n int32 = int32(libc.Xstrlen(tls, aTrans[i].zPattern))
+ if libc.Xstrncmp(tls, aTrans[i].zPattern, bp+24 /* &z[0] */, uint64(n)) == 0 {
+ libc.Xfprintf(tls, out, ts+22727 /* "-- %-28s %s" */, libc.VaList(bp+8, aTrans[i].zDesc, (bp+24 /* &z */ +uintptr(n))))
break
}
}
}
- crt.Xfclose(tls, in)
+ libc.Xfclose(tls, in)
}
var aTrans = [7]struct {
zPattern uintptr
zDesc uintptr
}{
- {zPattern: ts + 21129 /* "rchar: " */, zDesc: ts + 21137 /* "Bytes received b..." */},
- {zPattern: ts + 21163 /* "wchar: " */, zDesc: ts + 21171 /* "Bytes sent to wr..." */},
- {zPattern: ts + 21194 /* "syscr: " */, zDesc: ts + 21202 /* "Read() system ca..." */},
- {zPattern: ts + 21223 /* "syscw: " */, zDesc: ts + 21231 /* "Write() system c..." */},
- {zPattern: ts + 21253 /* "read_bytes: " */, zDesc: ts + 21266 /* "Bytes rcvd from ..." */},
- {zPattern: ts + 21291 /* "write_bytes: " */, zDesc: ts + 21305 /* "Bytes sent to st..." */},
- {zPattern: ts + 21328 /* "cancelled_write_..." */, zDesc: ts + 21352 /* "Cancelled write ..." */},
-} /* speedtest1.c:1943:7 */
-
-func xCompileOptions(tls *crt.TLS, pCtx uintptr, nVal int32, azVal uintptr, azCol uintptr) int32 { /* speedtest1.c:1969:12: */
+ {zPattern: ts + 22739 /* "rchar: " */, zDesc: ts + 22747 /* "Bytes received b..." */},
+ {zPattern: ts + 22773 /* "wchar: " */, zDesc: ts + 22781 /* "Bytes sent to wr..." */},
+ {zPattern: ts + 22804 /* "syscr: " */, zDesc: ts + 22812 /* "Read() system ca..." */},
+ {zPattern: ts + 22833 /* "syscw: " */, zDesc: ts + 22841 /* "Write() system c..." */},
+ {zPattern: ts + 22863 /* "read_bytes: " */, zDesc: ts + 22876 /* "Bytes rcvd from ..." */},
+ {zPattern: ts + 22901 /* "write_bytes: " */, zDesc: ts + 22915 /* "Bytes sent to st..." */},
+ {zPattern: ts + 22938 /* "cancelled_write_..." */, zDesc: ts + 22962 /* "Cancelled write ..." */},
+} /* speedtest1.c:2112:7 */
+
+func xCompileOptions(tls *libc.TLS, pCtx uintptr, nVal int32, azVal uintptr, azCol uintptr) int32 { /* speedtest1.c:2138:12: */
bp := tls.Alloc(8)
defer tls.Free(8)
- crt.Xprintf(tls, ts+21375 /* "-- Compile optio..." */, crt.VaList(bp, *(*uintptr)(unsafe.Pointer(azVal + uintptr(0)*8))))
+ libc.Xprintf(tls, ts+22985 /* "-- Compile optio..." */, libc.VaList(bp, *(*uintptr)(unsafe.Pointer(azVal + uintptr(0)*8))))
return 0
}
-func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:1974:5: */
- bp := tls.Alloc(528)
- defer tls.Free(528)
+func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:2143:5: */
+ bp := tls.Alloc(568)
+ defer tls.Free(568)
var doAutovac int32 = 0 // True for --autovacuum
var cacheSize int32 = 0 // Desired cache size. 0 means default
@@ -5337,7 +5734,8 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:1974:
var showStats int32 = 0 // True for --stats
var nThread int32 = 0 // --threads value
var mmapSize int32 = 0 // How big of a memory map to use
- var zTSet uintptr = ts + 21398 /* "main" */ // Which --testset torun
+ var memDb int32 = 0 // --memdb. Use an in-memory database
+ var zTSet uintptr = ts + 23008 /* "main" */ // Which --testset torun
var doTrace int32 = 0 // True for --trace
var zEncoding uintptr = uintptr(0) // --utf16be or --utf16le
var zDbName uintptr = uintptr(0) // Name of the test database
@@ -5345,21 +5743,21 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:1974:
var pHeap uintptr = uintptr(0) // Allocated heap space
var pLook uintptr = uintptr(0) // Allocated lookaside space
var pPCache uintptr = uintptr(0) // Allocated storage for pcache
- // var iCur int32 at bp+520, 4
+ // var iCur int32 at bp+560, 4
- // var iHi int32 at bp+524, 4
+ // var iHi int32 at bp+564, 4
// Stats values, current and "highwater"
var i int32 // Loop counter
var rc int32 // API return code
// Display the version of SQLite being tested
- crt.Xprintf(tls, ts+21403, /* "-- Speedtest1 fo..." */
- crt.VaList(bp, sqlite3.Xsqlite3_libversion(tls), sqlite3.Xsqlite3_sourceid(tls)))
+ libc.Xprintf(tls, ts+23013, /* "-- Speedtest1 fo..." */
+ libc.VaList(bp, sqlite3.Xsqlite3_libversion(tls), sqlite3.Xsqlite3_sourceid(tls)))
// Process command-line arguments
- g.zWR = ts + 1988 /* "" */
- g.zNN = ts + 1988 /* "" */
- g.zPK = ts + 21438 /* "UNIQUE" */
+ g.zWR = ts + 2152 /* "" */
+ g.zNN = ts + 2152 /* "" */
+ g.zPK = ts + 23048 /* "UNIQUE" */
g.szTest = 100
g.nRepeat = 1
for i = 1; i < argc; i++ {
@@ -5368,277 +5766,345 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:1974:
for ok := true; ok; ok = (int32(*(*int8)(unsafe.Pointer(z + uintptr(0)))) == '-') {
z++
}
- if crt.Xstrcmp(tls, z, ts+21445 /* "autovacuum" */) == 0 {
+ if libc.Xstrcmp(tls, z, ts+23055 /* "autovacuum" */) == 0 {
doAutovac = 1
- } else if crt.Xstrcmp(tls, z, ts+21456 /* "cachesize" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23066 /* "cachesize" */) == 0 {
if i >= (argc - 1) {
- fatal_error(tls, ts+21466 /* "missing argument..." */, crt.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
i++
cacheSize = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))
- } else if crt.Xstrcmp(tls, z, ts+21490 /* "exclusive" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23100 /* "exclusive" */) == 0 {
doExclusive = 1
- } else if crt.Xstrcmp(tls, z, ts+21500 /* "explain" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23110 /* "checkpoint" */) == 0 {
+ g.doCheckpoint = 1
+ } else if libc.Xstrcmp(tls, z, ts+23121 /* "explain" */) == 0 {
g.bSqlOnly = 1
g.bExplain = 1
- } else if crt.Xstrcmp(tls, z, ts+21508 /* "heap" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23129 /* "heap" */) == 0 {
if i >= (argc - 2) {
- fatal_error(tls, ts+21513 /* "missing argument..." */, crt.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23134 /* "missing argument..." */, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
nHeap = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8)))
mnHeap = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+2))*8)))
i = i + (2)
- } else if crt.Xstrcmp(tls, z, ts+21538 /* "incrvacuum" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23159 /* "incrvacuum" */) == 0 {
doIncrvac = 1
- } else if crt.Xstrcmp(tls, z, ts+21549 /* "journal" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23170 /* "journal" */) == 0 {
if i >= (argc - 1) {
- fatal_error(tls, ts+21466 /* "missing argument..." */, crt.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
- zJMode = *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PreIncInt32(&i, 1))*8))
- } else if crt.Xstrcmp(tls, z, ts+21557 /* "key" */) == 0 {
+ zJMode = *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8))
+ } else if libc.Xstrcmp(tls, z, ts+23178 /* "key" */) == 0 {
if i >= (argc - 1) {
- fatal_error(tls, ts+21466 /* "missing argument..." */, crt.VaList(bp+40, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
- zKey = *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PreIncInt32(&i, 1))*8))
- } else if crt.Xstrcmp(tls, z, ts+21561 /* "lookaside" */) == 0 {
+ zKey = *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8))
+ } else if libc.Xstrcmp(tls, z, ts+23182 /* "lookaside" */) == 0 {
if i >= (argc - 2) {
- fatal_error(tls, ts+21513 /* "missing argument..." */, crt.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23134 /* "missing argument..." */, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
nLook = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8)))
szLook = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+2))*8)))
i = i + (2)
- } else if crt.Xstrcmp(tls, z, ts+21571 /* "multithread" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23192 /* "memdb" */) == 0 {
+ memDb = 1
+ } else if libc.Xstrcmp(tls, z, ts+23198 /* "multithread" */) == 0 {
sqlite3.Xsqlite3_config(tls, 2, 0)
- } else if crt.Xstrcmp(tls, z, ts+21583 /* "nomemstat" */) == 0 {
- sqlite3.Xsqlite3_config(tls, 9, crt.VaList(bp+56, 0))
- } else if crt.Xstrcmp(tls, z, ts+21593 /* "mmap" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23210 /* "nomemstat" */) == 0 {
+ sqlite3.Xsqlite3_config(tls, 9, libc.VaList(bp+56, 0))
+ } else if libc.Xstrcmp(tls, z, ts+23220 /* "mmap" */) == 0 {
if i >= (argc - 1) {
- fatal_error(tls, ts+21466 /* "missing argument..." */, crt.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
- mmapSize = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PreIncInt32(&i, 1))*8)))
- } else if crt.Xstrcmp(tls, z, ts+21598 /* "nosync" */) == 0 {
+ mmapSize = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8)))
+ } else if libc.Xstrcmp(tls, z, ts+23225 /* "nosync" */) == 0 {
noSync = 1
- } else if crt.Xstrcmp(tls, z, ts+21605 /* "notnull" */) == 0 {
- g.zNN = ts + 21613 /* "NOT NULL" */
- } else if crt.Xstrcmp(tls, z, ts+21622 /* "pagesize" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23232 /* "notnull" */) == 0 {
+ g.zNN = ts + 23240 /* "NOT NULL" */
+ } else if libc.Xstrcmp(tls, z, ts+23249 /* "output" */) == 0 {
+ if i >= (argc - 1) {
+ fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ }
+ i++
+ if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ts+23256 /* "-" */) == 0 {
+ g.hashFile = libc.Xstdout
+ } else {
+ g.hashFile = libc.Xfopen(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), ts+23258 /* "wb" */)
+ if g.hashFile == uintptr(0) {
+ fatal_error(tls, ts+23261 /* "cannot open \"%s\"..." */, libc.VaList(bp+80, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ }
+ }
+ } else if libc.Xstrcmp(tls, z, ts+23291 /* "pagesize" */) == 0 {
if i >= (argc - 1) {
- fatal_error(tls, ts+21466 /* "missing argument..." */, crt.VaList(bp+72, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+88, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
- pageSize = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PreIncInt32(&i, 1))*8)))
- } else if crt.Xstrcmp(tls, z, ts+21631 /* "pcache" */) == 0 {
+ pageSize = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8)))
+ } else if libc.Xstrcmp(tls, z, ts+23300 /* "pcache" */) == 0 {
if i >= (argc - 2) {
- fatal_error(tls, ts+21513 /* "missing argument..." */, crt.VaList(bp+80, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23134 /* "missing argument..." */, libc.VaList(bp+96, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
nPCache = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8)))
szPCache = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+2))*8)))
doPCache = 1
i = i + (2)
- } else if crt.Xstrcmp(tls, z, ts+21638 /* "primarykey" */) == 0 {
- g.zPK = ts + 21649 /* "PRIMARY KEY" */
- } else if crt.Xstrcmp(tls, z, ts+21661 /* "repeat" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23307 /* "primarykey" */) == 0 {
+ g.zPK = ts + 23318 /* "PRIMARY KEY" */
+ } else if libc.Xstrcmp(tls, z, ts+23330 /* "repeat" */) == 0 {
if i >= (argc - 1) {
- fatal_error(tls, ts+21513 /* "missing argument..." */, crt.VaList(bp+88, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23134 /* "missing argument..." */, libc.VaList(bp+104, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
g.nRepeat = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr((i+1))*8)))
i = i + (1)
- } else if crt.Xstrcmp(tls, z, ts+21668 /* "reprepare" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23337 /* "reprepare" */) == 0 {
g.bReprepare = 1
- } else if crt.Xstrcmp(tls, z, ts+21678 /* "serialized" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23347 /* "serialized" */) == 0 {
sqlite3.Xsqlite3_config(tls, 3, 0)
- } else if crt.Xstrcmp(tls, z, ts+21689 /* "singlethread" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23358 /* "singlethread" */) == 0 {
sqlite3.Xsqlite3_config(tls, 1, 0)
- } else if crt.Xstrcmp(tls, z, ts+21702 /* "sqlonly" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23371 /* "sqlonly" */) == 0 {
g.bSqlOnly = 1
- } else if crt.Xstrcmp(tls, z, ts+21710 /* "shrink-memory" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23379 /* "shrink-memory" */) == 0 {
g.bMemShrink = 1
- } else if crt.Xstrcmp(tls, z, ts+21724 /* "size" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23393 /* "size" */) == 0 {
if i >= (argc - 1) {
- fatal_error(tls, ts+21466 /* "missing argument..." */, crt.VaList(bp+96, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
- g.szTest = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PreIncInt32(&i, 1))*8)))
- } else if crt.Xstrcmp(tls, z, ts+21729 /* "stats" */) == 0 {
+ g.szTest = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8)))
+ } else if libc.Xstrcmp(tls, z, ts+23398 /* "stats" */) == 0 {
showStats = 1
- } else if crt.Xstrcmp(tls, z, ts+21735 /* "temp" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23404 /* "temp" */) == 0 {
if i >= (argc - 1) {
- fatal_error(tls, ts+21466 /* "missing argument..." */, crt.VaList(bp+104, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+120, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
i++
if ((int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) + uintptr(0)))) < '0') || (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) + uintptr(0)))) > '9')) || (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) + uintptr(1)))) != 0) {
- fatal_error(tls, ts+21740 /* "argument to --te..." */, 0)
+ fatal_error(tls, ts+23409 /* "argument to --te..." */, 0)
}
g.eTemp = (int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) + uintptr(0)))) - '0')
- } else if crt.Xstrcmp(tls, z, ts+21793 /* "testset" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23462 /* "testset" */) == 0 {
if i >= (argc - 1) {
- fatal_error(tls, ts+21466 /* "missing argument..." */, crt.VaList(bp+112, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+128, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
- zTSet = *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PreIncInt32(&i, 1))*8))
- } else if crt.Xstrcmp(tls, z, ts+21801 /* "trace" */) == 0 {
+ zTSet = *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8))
+ } else if libc.Xstrcmp(tls, z, ts+23470 /* "trace" */) == 0 {
doTrace = 1
- } else if crt.Xstrcmp(tls, z, ts+21807 /* "threads" */) == 0 {
+ } else if libc.Xstrcmp(tls, z, ts+23476 /* "threads" */) == 0 {
if i >= (argc - 1) {
- fatal_error(tls, ts+21466 /* "missing argument..." */, crt.VaList(bp+120, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
+ fatal_error(tls, ts+23076 /* "missing argument..." */, libc.VaList(bp+136, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))))
}
- nThread = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(crt.PreIncInt32(&i, 1))*8)))
- } else if crt.Xstrcmp(tls, z, ts+21815 /* "utf16le" */) == 0 {
- zEncoding = ts + 21815 /* "utf16le" */
- } else if crt.Xstrcmp(tls, z, ts+21823 /* "utf16be" */) == 0 {
- zEncoding = ts + 21823 /* "utf16be" */
- } else if crt.Xstrcmp(tls, z, ts+21831 /* "verify" */) == 0 {
+ nThread = integerValue(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(libc.PreIncInt32(&i, 1))*8)))
+ } else if libc.Xstrcmp(tls, z, ts+23484 /* "utf16le" */) == 0 {
+ zEncoding = ts + 23484 /* "utf16le" */
+ } else if libc.Xstrcmp(tls, z, ts+23492 /* "utf16be" */) == 0 {
+ zEncoding = ts + 23492 /* "utf16be" */
+ } else if libc.Xstrcmp(tls, z, ts+23500 /* "verify" */) == 0 {
g.bVerify = 1
- } else if crt.Xstrcmp(tls, z, ts+21838 /* "without-rowid" */) == 0 {
- g.zWR = ts + 5672 /* "WITHOUT ROWID" */
- g.zPK = ts + 21649 /* "PRIMARY KEY" */
- } else if (crt.Xstrcmp(tls, z, ts+21852 /* "help" */) == 0) || (crt.Xstrcmp(tls, z, ts+21857 /* "?" */) == 0) {
- crt.Xprintf(tls, uintptr(unsafe.Pointer(&zHelp)), crt.VaList(bp+128, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
- crt.Xexit(tls, 0)
+ HashInit(tls)
+ } else if libc.Xstrcmp(tls, z, ts+23507 /* "without-rowid" */) == 0 {
+ g.zWR = ts + 5915 /* "WITHOUT ROWID" */
+ g.zPK = ts + 23318 /* "PRIMARY KEY" */
+ } else if (libc.Xstrcmp(tls, z, ts+23521 /* "help" */) == 0) || (libc.Xstrcmp(tls, z, ts+23526 /* "?" */) == 0) {
+ libc.Xprintf(tls, uintptr(unsafe.Pointer(&zHelp)), libc.VaList(bp+144, *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
+ libc.Xexit(tls, 0)
} else {
- fatal_error(tls, ts+21859, /* "unknown option: ..." */
- crt.VaList(bp+136, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
+ fatal_error(tls, ts+23528, /* "unknown option: ..." */
+ libc.VaList(bp+152, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
}
} else if zDbName == uintptr(0) {
zDbName = *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))
} else {
- fatal_error(tls, ts+21900, /* "surplus argument..." */
- crt.VaList(bp+152, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
+ fatal_error(tls, ts+23569, /* "surplus argument..." */
+ libc.VaList(bp+168, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(argv + uintptr(0)*8))))
}
}
if zDbName != uintptr(0) {
- crt.Xunlink(tls, zDbName)
+ libc.Xunlink(tls, zDbName)
}
if nHeap > 0 {
- pHeap = crt.Xmalloc(tls, uint64(nHeap))
+ pHeap = libc.Xmalloc(tls, uint64(nHeap))
if pHeap == uintptr(0) {
- fatal_error(tls, ts+21943 /* "cannot allocate ..." */, crt.VaList(bp+168, nHeap))
+ fatal_error(tls, ts+23612 /* "cannot allocate ..." */, libc.VaList(bp+184, nHeap))
}
- rc = sqlite3.Xsqlite3_config(tls, 8, crt.VaList(bp+176, pHeap, nHeap, mnHeap))
+ rc = sqlite3.Xsqlite3_config(tls, 8, libc.VaList(bp+192, pHeap, nHeap, mnHeap))
if rc != 0 {
- fatal_error(tls, ts+21973 /* "heap configurati..." */, crt.VaList(bp+200, rc))
+ fatal_error(tls, ts+23642 /* "heap configurati..." */, libc.VaList(bp+216, rc))
}
}
if doPCache != 0 {
if (nPCache > 0) && (szPCache > 0) {
- pPCache = crt.Xmalloc(tls, (uint64(sqlite3_int64(nPCache) * sqlite3_int64(szPCache))))
+ pPCache = libc.Xmalloc(tls, (uint64(sqlite3_int64(nPCache) * sqlite3_int64(szPCache))))
if pPCache == uintptr(0) {
- fatal_error(tls, ts+22004, /* "cannot allocate ..." */
- crt.VaList(bp+208, (sqlite3_int64(nPCache)*sqlite3_int64(szPCache))))
+ fatal_error(tls, ts+23673, /* "cannot allocate ..." */
+ libc.VaList(bp+224, (sqlite3_int64(nPCache)*sqlite3_int64(szPCache))))
}
}
- rc = sqlite3.Xsqlite3_config(tls, 7, crt.VaList(bp+216, pPCache, szPCache, nPCache))
+ rc = sqlite3.Xsqlite3_config(tls, 7, libc.VaList(bp+232, pPCache, szPCache, nPCache))
if rc != 0 {
- fatal_error(tls, ts+22038 /* "pcache configura..." */, crt.VaList(bp+240, rc))
+ fatal_error(tls, ts+23707 /* "pcache configura..." */, libc.VaList(bp+256, rc))
}
}
if nLook >= 0 {
- sqlite3.Xsqlite3_config(tls, 13, crt.VaList(bp+248, 0, 0))
+ sqlite3.Xsqlite3_config(tls, 13, libc.VaList(bp+264, 0, 0))
}
sqlite3.Xsqlite3_initialize(tls)
// Open the database and the input file
- if sqlite3.Xsqlite3_open(tls, zDbName, (uintptr(unsafe.Pointer(&g)) /* &.db */)) != 0 {
- fatal_error(tls, ts+22071 /* "Cannot open data..." */, crt.VaList(bp+264, zDbName))
+ if sqlite3.Xsqlite3_open(tls, func() uintptr {
+ if memDb != 0 {
+ return ts + 23740 /* ":memory:" */
+ }
+ return zDbName
+ }(), (uintptr(unsafe.Pointer(&g)) /* &.db */)) != 0 {
+ fatal_error(tls, ts+23749 /* "Cannot open data..." */, libc.VaList(bp+280, zDbName))
}
if (nLook > 0) && (szLook > 0) {
- pLook = crt.Xmalloc(tls, (uint64(nLook * szLook)))
- rc = sqlite3.Xsqlite3_db_config(tls, g.db, 1001, crt.VaList(bp+272, pLook, szLook, nLook))
+ pLook = libc.Xmalloc(tls, (uint64(nLook * szLook)))
+ rc = sqlite3.Xsqlite3_db_config(tls, g.db, 1001, libc.VaList(bp+288, pLook, szLook, nLook))
if rc != 0 {
- fatal_error(tls, ts+22102 /* "lookaside config..." */, crt.VaList(bp+296, rc))
+ fatal_error(tls, ts+23780 /* "lookaside config..." */, libc.VaList(bp+312, rc))
}
}
// Set database connection options
- sqlite3.Xsqlite3_create_function(tls, g.db, ts+22138 /* "random" */, 0, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr)
+ sqlite3.Xsqlite3_create_function(tls, g.db, ts+23816 /* "random" */, 0, 1, uintptr(0), *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr)
}{randomFunc})), uintptr(0), uintptr(0))
if doTrace != 0 {
sqlite3.Xsqlite3_trace(tls, g.db, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, uintptr)
+ f func(*libc.TLS, uintptr, uintptr)
}{traceCallback})), uintptr(0))
}
+ if memDb > 0 {
+ speedtest1_exec(tls, ts+23823 /* "PRAGMA temp_stor..." */, 0)
+ }
if mmapSize > 0 {
- speedtest1_exec(tls, ts+22145 /* "PRAGMA mmap_size..." */, crt.VaList(bp+304, mmapSize))
+ speedtest1_exec(tls, ts+23848 /* "PRAGMA mmap_size..." */, libc.VaList(bp+320, mmapSize))
}
- speedtest1_exec(tls, ts+22165 /* "PRAGMA threads=%..." */, crt.VaList(bp+312, nThread))
+ speedtest1_exec(tls, ts+23868 /* "PRAGMA threads=%..." */, libc.VaList(bp+328, nThread))
if zKey != 0 {
- speedtest1_exec(tls, ts+22183 /* "PRAGMA key('%s')" */, crt.VaList(bp+320, zKey))
+ speedtest1_exec(tls, ts+23886 /* "PRAGMA key('%s')" */, libc.VaList(bp+336, zKey))
}
if zEncoding != 0 {
- speedtest1_exec(tls, ts+22200 /* "PRAGMA encoding=..." */, crt.VaList(bp+328, zEncoding))
+ speedtest1_exec(tls, ts+23903 /* "PRAGMA encoding=..." */, libc.VaList(bp+344, zEncoding))
}
if doAutovac != 0 {
- speedtest1_exec(tls, ts+22219 /* "PRAGMA auto_vacu..." */, 0)
+ speedtest1_exec(tls, ts+23922 /* "PRAGMA auto_vacu..." */, 0)
} else if doIncrvac != 0 {
- speedtest1_exec(tls, ts+22243 /* "PRAGMA auto_vacu..." */, 0)
+ speedtest1_exec(tls, ts+23946 /* "PRAGMA auto_vacu..." */, 0)
}
if pageSize != 0 {
- speedtest1_exec(tls, ts+22274 /* "PRAGMA page_size..." */, crt.VaList(bp+336, pageSize))
+ speedtest1_exec(tls, ts+23977 /* "PRAGMA page_size..." */, libc.VaList(bp+352, pageSize))
}
if cacheSize != 0 {
- speedtest1_exec(tls, ts+22294 /* "PRAGMA cache_siz..." */, crt.VaList(bp+344, cacheSize))
+ speedtest1_exec(tls, ts+23997 /* "PRAGMA cache_siz..." */, libc.VaList(bp+360, cacheSize))
}
if noSync != 0 {
- speedtest1_exec(tls, ts+22315 /* "PRAGMA synchrono..." */, 0)
+ speedtest1_exec(tls, ts+24018 /* "PRAGMA synchrono..." */, 0)
}
if doExclusive != 0 {
- speedtest1_exec(tls, ts+22338 /* "PRAGMA locking_m..." */, 0)
+ speedtest1_exec(tls, ts+24041 /* "PRAGMA locking_m..." */, 0)
}
if zJMode != 0 {
- speedtest1_exec(tls, ts+22368 /* "PRAGMA journal_m..." */, crt.VaList(bp+352, zJMode))
+ speedtest1_exec(tls, ts+24071 /* "PRAGMA journal_m..." */, libc.VaList(bp+368, zJMode))
}
if g.bExplain != 0 {
- crt.Xprintf(tls, ts+22391 /* ".explain\n.echo o..." */, 0)
+ libc.Xprintf(tls, ts+24094 /* ".explain\n.echo o..." */, 0)
}
- if crt.Xstrcmp(tls, zTSet, ts+21398 /* "main" */) == 0 {
- testset_main(tls)
- } else if crt.Xstrcmp(tls, zTSet, ts+22410 /* "debug1" */) == 0 {
- testset_debug1(tls)
- } else if crt.Xstrcmp(tls, zTSet, ts+22417 /* "orm" */) == 0 {
- testset_orm(tls)
- } else if crt.Xstrcmp(tls, zTSet, ts+22421 /* "cte" */) == 0 {
- testset_cte(tls)
- } else if crt.Xstrcmp(tls, zTSet, ts+22425 /* "fp" */) == 0 {
- testset_fp(tls)
- } else if crt.Xstrcmp(tls, zTSet, ts+22428 /* "trigger" */) == 0 {
- testset_trigger(tls)
- } else if crt.Xstrcmp(tls, zTSet, ts+22436 /* "rtree" */) == 0 {
- fatal_error(tls,
- ts+22442 /* "compile with -DS..." */, 0)
- } else {
- fatal_error(tls,
- ts+22505, /* "unknown testset:..." */
- crt.VaList(bp+360, zTSet))
+ for ok1 := true; ok1; ok1 = *(*int8)(unsafe.Pointer(zTSet + uintptr(0))) != 0 {
+ var zThisTest uintptr = zTSet
+ var zComma uintptr = libc.Xstrchr(tls, zThisTest, ',')
+ if zComma != 0 {
+ *(*int8)(unsafe.Pointer(zComma)) = int8(0)
+ zTSet = (zComma + uintptr(1))
+ } else {
+ zTSet = ts + 2152 /* "" */
+ }
+ if (g.iTotal > int64(0)) || (zComma != uintptr(0)) {
+ libc.Xprintf(tls, ts+24113 /* " Begin tes..." */, libc.VaList(bp+376, zThisTest))
+ }
+ if libc.Xstrcmp(tls, zThisTest, ts+23008 /* "main" */) == 0 {
+ testset_main(tls)
+ } else if libc.Xstrcmp(tls, zThisTest, ts+24140 /* "debug1" */) == 0 {
+ testset_debug1(tls)
+ } else if libc.Xstrcmp(tls, zThisTest, ts+24147 /* "orm" */) == 0 {
+ testset_orm(tls)
+ } else if libc.Xstrcmp(tls, zThisTest, ts+24151 /* "cte" */) == 0 {
+ testset_cte(tls)
+ } else if libc.Xstrcmp(tls, zThisTest, ts+24155 /* "fp" */) == 0 {
+ testset_fp(tls)
+ } else if libc.Xstrcmp(tls, zThisTest, ts+24158 /* "trigger" */) == 0 {
+ testset_trigger(tls)
+ } else if libc.Xstrcmp(tls, zThisTest, ts+24166 /* "rtree" */) == 0 {
+ testset_rtree(tls, 6, 147)
+ } else {
+ fatal_error(tls,
+ ts+24172, /* "unknown testset:..." */
+ libc.VaList(bp+384, zThisTest))
+ }
+ if *(*int8)(unsafe.Pointer(zTSet + uintptr(0))) != 0 {
+ var zSql uintptr
+ var zObj uintptr
+ speedtest1_begin_test(tls, 999, ts+24241 /* "Reset the databa..." */, 0)
+ for 1 != 0 {
+ zObj = speedtest1_once(tls,
+
+ ts+24260 /* "SELECT name FROM..." */, 0)
+ if zObj == uintptr(0) {
+ break
+ }
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24330 /* "DROP TABLE main...." */, libc.VaList(bp+392, zObj))
+ speedtest1_exec(tls, zSql, 0)
+ sqlite3.Xsqlite3_free(tls, zSql)
+ sqlite3.Xsqlite3_free(tls, zObj)
+ }
+ for 1 != 0 {
+ zObj = speedtest1_once(tls,
+
+ ts+24351 /* "SELECT name FROM..." */, 0)
+ if zObj == uintptr(0) {
+ break
+ }
+ zSql = sqlite3.Xsqlite3_mprintf(tls, ts+24330 /* "DROP TABLE main...." */, libc.VaList(bp+400, zObj))
+ speedtest1_exec(tls, zSql, 0)
+ sqlite3.Xsqlite3_free(tls, zSql)
+ sqlite3.Xsqlite3_free(tls, zObj)
+ }
+ speedtest1_end_test(tls)
+ }
}
speedtest1_final(tls)
if showStats != 0 {
- sqlite3.Xsqlite3_exec(tls, g.db, ts+22574 /* "PRAGMA compile_o..." */, *(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, uintptr, int32, uintptr, uintptr) int32
+ sqlite3.Xsqlite3_exec(tls, g.db, ts+24421 /* "PRAGMA compile_o..." */, *(*uintptr)(unsafe.Pointer(&struct {
+ f func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32
}{xCompileOptions})), uintptr(0), uintptr(0))
}
// Database connection statistics printed after both prepared statements
// have been finalized
if showStats != 0 {
- sqlite3.Xsqlite3_db_status(tls, g.db, 0, bp+520 /* &iCur */, bp+524 /* &iHi */, 0)
- crt.Xprintf(tls, ts+22597 /* "-- Lookaside Slo..." */, crt.VaList(bp+368, *(*int32)(unsafe.Pointer(bp + 520 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 524 /* iHi */))))
- sqlite3.Xsqlite3_db_status(tls, g.db, 4, bp+520 /* &iCur */, bp+524 /* &iHi */, 0)
- crt.Xprintf(tls, ts+22642 /* "-- Successful lo..." */, crt.VaList(bp+384, *(*int32)(unsafe.Pointer(bp + 524 /* iHi */))))
- sqlite3.Xsqlite3_db_status(tls, g.db, 5, bp+520 /* &iCur */, bp+524 /* &iHi */, 0)
- crt.Xprintf(tls, ts+22678 /* "-- Lookaside siz..." */, crt.VaList(bp+392, *(*int32)(unsafe.Pointer(bp + 524 /* iHi */))))
- sqlite3.Xsqlite3_db_status(tls, g.db, 6, bp+520 /* &iCur */, bp+524 /* &iHi */, 0)
- crt.Xprintf(tls, ts+22714 /* "-- Lookaside OOM..." */, crt.VaList(bp+400, *(*int32)(unsafe.Pointer(bp + 524 /* iHi */))))
- sqlite3.Xsqlite3_db_status(tls, g.db, 1, bp+520 /* &iCur */, bp+524 /* &iHi */, 0)
- crt.Xprintf(tls, ts+22750 /* "-- Pager Heap Us..." */, crt.VaList(bp+408, *(*int32)(unsafe.Pointer(bp + 520 /* iCur */))))
- sqlite3.Xsqlite3_db_status(tls, g.db, 7, bp+520 /* &iCur */, bp+524 /* &iHi */, 1)
- crt.Xprintf(tls, ts+22792 /* "-- Page cache hi..." */, crt.VaList(bp+416, *(*int32)(unsafe.Pointer(bp + 520 /* iCur */))))
- sqlite3.Xsqlite3_db_status(tls, g.db, 8, bp+520 /* &iCur */, bp+524 /* &iHi */, 1)
- crt.Xprintf(tls, ts+22828 /* "-- Page cache mi..." */, crt.VaList(bp+424, *(*int32)(unsafe.Pointer(bp + 520 /* iCur */))))
- sqlite3.Xsqlite3_db_status(tls, g.db, 9, bp+520 /* &iCur */, bp+524 /* &iHi */, 1)
- crt.Xprintf(tls, ts+22864 /* "-- Page cache wr..." */, crt.VaList(bp+432, *(*int32)(unsafe.Pointer(bp + 520 /* iCur */))))
- sqlite3.Xsqlite3_db_status(tls, g.db, 2, bp+520 /* &iCur */, bp+524 /* &iHi */, 0)
- crt.Xprintf(tls, ts+22900 /* "-- Schema Heap U..." */, crt.VaList(bp+440, *(*int32)(unsafe.Pointer(bp + 520 /* iCur */))))
- sqlite3.Xsqlite3_db_status(tls, g.db, 3, bp+520 /* &iCur */, bp+524 /* &iHi */, 0)
- crt.Xprintf(tls, ts+22942 /* "-- Statement Hea..." */, crt.VaList(bp+448, *(*int32)(unsafe.Pointer(bp + 520 /* iCur */))))
+ sqlite3.Xsqlite3_db_status(tls, g.db, 0, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
+ libc.Xprintf(tls, ts+24444 /* "-- Lookaside Slo..." */, libc.VaList(bp+408, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
+ sqlite3.Xsqlite3_db_status(tls, g.db, 4, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
+ libc.Xprintf(tls, ts+24489 /* "-- Successful lo..." */, libc.VaList(bp+424, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
+ sqlite3.Xsqlite3_db_status(tls, g.db, 5, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
+ libc.Xprintf(tls, ts+24525 /* "-- Lookaside siz..." */, libc.VaList(bp+432, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
+ sqlite3.Xsqlite3_db_status(tls, g.db, 6, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
+ libc.Xprintf(tls, ts+24561 /* "-- Lookaside OOM..." */, libc.VaList(bp+440, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
+ sqlite3.Xsqlite3_db_status(tls, g.db, 1, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
+ libc.Xprintf(tls, ts+24597 /* "-- Pager Heap Us..." */, libc.VaList(bp+448, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */))))
+ sqlite3.Xsqlite3_db_status(tls, g.db, 7, bp+560 /* &iCur */, bp+564 /* &iHi */, 1)
+ libc.Xprintf(tls, ts+24639 /* "-- Page cache hi..." */, libc.VaList(bp+456, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */))))
+ sqlite3.Xsqlite3_db_status(tls, g.db, 8, bp+560 /* &iCur */, bp+564 /* &iHi */, 1)
+ libc.Xprintf(tls, ts+24675 /* "-- Page cache mi..." */, libc.VaList(bp+464, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */))))
+ sqlite3.Xsqlite3_db_status(tls, g.db, 9, bp+560 /* &iCur */, bp+564 /* &iHi */, 1)
+ libc.Xprintf(tls, ts+24711 /* "-- Page cache wr..." */, libc.VaList(bp+472, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */))))
+ sqlite3.Xsqlite3_db_status(tls, g.db, 2, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
+ libc.Xprintf(tls, ts+24747 /* "-- Schema Heap U..." */, libc.VaList(bp+480, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */))))
+ sqlite3.Xsqlite3_db_status(tls, g.db, 3, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
+ libc.Xprintf(tls, ts+24789 /* "-- Statement Hea..." */, libc.VaList(bp+488, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */))))
}
sqlite3.Xsqlite3_close(tls, g.db)
@@ -5646,28 +6112,28 @@ func main1(tls *crt.TLS, argc int32, argv uintptr) int32 { /* speedtest1.c:1974:
// Global memory usage statistics printed after the database connection
// has closed. Memory usage should be zero at this point.
if showStats != 0 {
- sqlite3.Xsqlite3_status(tls, 0, bp+520 /* &iCur */, bp+524 /* &iHi */, 0)
- crt.Xprintf(tls, ts+22984 /* "-- Memory Used (..." */, crt.VaList(bp+456, *(*int32)(unsafe.Pointer(bp + 520 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 524 /* iHi */))))
- sqlite3.Xsqlite3_status(tls, 9, bp+520 /* &iCur */, bp+524 /* &iHi */, 0)
- crt.Xprintf(tls, ts+23029 /* "-- Outstanding A..." */, crt.VaList(bp+472, *(*int32)(unsafe.Pointer(bp + 520 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 524 /* iHi */))))
- sqlite3.Xsqlite3_status(tls, 2, bp+520 /* &iCur */, bp+524 /* &iHi */, 0)
- crt.Xprintf(tls, ts+23074 /* "-- Pcache Overfl..." */, crt.VaList(bp+488, *(*int32)(unsafe.Pointer(bp + 520 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 524 /* iHi */))))
- sqlite3.Xsqlite3_status(tls, 5, bp+520 /* &iCur */, bp+524 /* &iHi */, 0)
- crt.Xprintf(tls, ts+23119 /* "-- Largest Alloc..." */, crt.VaList(bp+504, *(*int32)(unsafe.Pointer(bp + 524 /* iHi */))))
- sqlite3.Xsqlite3_status(tls, 7, bp+520 /* &iCur */, bp+524 /* &iHi */, 0)
- crt.Xprintf(tls, ts+23161 /* "-- Largest Pcach..." */, crt.VaList(bp+512, *(*int32)(unsafe.Pointer(bp + 524 /* iHi */))))
+ sqlite3.Xsqlite3_status(tls, 0, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
+ libc.Xprintf(tls, ts+24831 /* "-- Memory Used (..." */, libc.VaList(bp+496, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
+ sqlite3.Xsqlite3_status(tls, 9, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
+ libc.Xprintf(tls, ts+24876 /* "-- Outstanding A..." */, libc.VaList(bp+512, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
+ sqlite3.Xsqlite3_status(tls, 2, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
+ libc.Xprintf(tls, ts+24921 /* "-- Pcache Overfl..." */, libc.VaList(bp+528, *(*int32)(unsafe.Pointer(bp + 560 /* iCur */)), *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
+ sqlite3.Xsqlite3_status(tls, 5, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
+ libc.Xprintf(tls, ts+24966 /* "-- Largest Alloc..." */, libc.VaList(bp+544, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
+ sqlite3.Xsqlite3_status(tls, 7, bp+560 /* &iCur */, bp+564 /* &iHi */, 0)
+ libc.Xprintf(tls, ts+25008 /* "-- Largest Pcach..." */, libc.VaList(bp+552, *(*int32)(unsafe.Pointer(bp + 564 /* iHi */))))
}
if showStats != 0 {
- displayLinuxIoStats(tls, crt.Xstdout)
+ displayLinuxIoStats(tls, libc.Xstdout)
}
// Release memory
- crt.Xfree(tls, pLook)
- crt.Xfree(tls, pPCache)
- crt.Xfree(tls, pHeap)
+ libc.Xfree(tls, pLook)
+ libc.Xfree(tls, pPCache)
+ libc.Xfree(tls, pHeap)
return 0
}
-var ts1 = "Usage: %s [--options] DATABASE\nOptions:\n --autovacuum Enable AUTOVACUUM mode\n --cachesize N Set the cache size to N\n --exclusive Enable locking_mode=EXCLUSIVE\n --explain Like --sqlonly but with added EXPLAIN keywords\n --heap SZ MIN Memory allocator uses SZ bytes & min allocation MIN\n --incrvacuum Enable incremenatal vacuum mode\n --journal M Set the journal_mode to M\n --key KEY Set the encryption key to KEY\n --lookaside N SZ Configure lookaside for N slots of SZ bytes each\n --mmap SZ MMAP the first SZ bytes of the database file\n --multithread Set multithreaded mode\n --nomemstat Disable memory statistics\n --nosync Set PRAGMA synchronous=OFF\n --notnull Add NOT NULL constraints to table columns\n --pagesize N Set the page size to N\n --pcache N SZ Configure N pages of pagecache each of size SZ bytes\n --primarykey Use PRIMARY KEY instead of UNIQUE where appropriate\n --repeat N Repeat each SELECT N times (default: 1)\n --reprepare Reprepare each statement upon every invocation\n --serialized Set serialized threading mode\n --singlethread Set single-threaded mode - disables all mutexing\n --sqlonly No-op. Only show the SQL that would have been run.\n --shrink-memory Invoke sqlite3_db_release_memory() frequently.\n --size N Relative test size. Default=100\n --stats Show statistics at the end\n --temp N N from 0 to 9. 0: no temp table. 9: all temp tables\n --testset T Run test-set T (main, cte, rtree, orm, fp, debug)\n --trace Turn on SQL tracing\n --threads N Use up to N threads for sorting\n --utf16be Set text encoding to UTF-16BE\n --utf16le Set text encoding to UTF-16LE\n --verify Run additional verification steps.\n --without-rowid Use WITHOUT ROWID where appropriate\n\x00 TEMP\x00\x00parameter too large - max 2147483648\x00KiB\x00MiB\x00GiB\x00KB\x00MB\x00GB\x00K\x00M\x00G\x00 billion\x00 million\x00 thousand\x00%s hundred\x00%s\x00zero\x00one\x00two\x00three\x00four\x00five\x00six\x00seven\x00eight\x00nine\x00ten\x00eleven\x00twelve\x00thirteen\x00fourteen\x00fifteen\x00sixteen\x00seventeen\x00eighteen\x00nineteen\x00twenty\x00thirty\x00forty\x00fifty\x00sixty\x00seventy\x00eighty\x00ninety\x00.......................................................................\x00/* %4d - %s%.*s */\n\x00%4d - %s%.*s \x00%4d.%03ds\n\x00 TOTAL%.*s %4d.%03ds\n\x00EXPLAIN \x00%.*s;\n\x00CREATE *\x00DROP *\x00ALTER *\x00SQL error: %s\n%s\n\x00exec error: %s\n\x00SQL error: %s\n\x00nil\x00%d INSERTs into table with no index\x00BEGIN\x00CREATE%s TABLE t1(a INTEGER %s, b INTEGER %s, c TEXT %s);\x00INSERT INTO t1 VALUES(?1,?2,?3); -- %d times\x00COMMIT\x00%d ordered INSERTS with one index/PK\x00CREATE%s TABLE t2(a INTEGER %s %s, b INTEGER %s, c TEXT %s) %s\x00INSERT INTO t2 VALUES(?1,?2,?3); -- %d times\x00%d unordered INSERTS with one index/PK\x00CREATE%s TABLE t3(a INTEGER %s %s, b INTEGER %s, c TEXT %s) %s\x00INSERT INTO t3 VALUES(?1,?2,?3); -- %d times\x00%d SELECTS, numeric BETWEEN, unindexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(c) FROM t1\n WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, LIKE, unindexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(c) FROM t1\n WHERE c LIKE ?1; -- %d times\x00%d SELECTS w/ORDER BY, unindexed\x00SELECT a, b, c FROM t1 WHERE c LIKE ?1\n ORDER BY a; -- %d times\x00%d SELECTS w/ORDER BY and LIMIT, unindexed\x00SELECT a, b, c FROM t1 WHERE c LIKE ?1\n ORDER BY a LIMIT 10; -- %d times\x00CREATE INDEX five times\x00BEGIN;\x00CREATE UNIQUE INDEX t1b ON t1(b);\x00CREATE INDEX t1c ON t1(c);\x00CREATE UNIQUE INDEX t2b ON t2(b);\x00CREATE INDEX t2c ON t2(c DESC);\x00CREATE INDEX t3bc ON t3(b,c);\x00COMMIT;\x00%d SELECTS, numeric BETWEEN, indexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM t1\n WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, numeric BETWEEN, PK\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM t2\n WHERE a BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, text BETWEEN, indexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM t1\n WHERE c BETWEEN ?1 AND (?1||'~'); -- %d times\x00%d INSERTS with three indexes\x00CREATE%s TABLE t4(\n a INTEGER %s %s,\n b INTEGER %s,\n c TEXT %s\n) %s\x00CREATE INDEX t4b ON t4(b)\x00CREATE INDEX t4c ON t4(c)\x00INSERT INTO t4 SELECT * FROM t1\x00DELETE and REFILL one table\x00DELETE FROM t2;\x00INSERT INTO t2 SELECT * FROM t1;\x00VACUUM\x00ALTER TABLE ADD COLUMN, and query\x00ALTER TABLE t2 ADD COLUMN d DEFAULT 123\x00SELECT sum(d) FROM t2\x00%d UPDATES, numeric BETWEEN, indexed\x00UPDATE t2 SET d=b*2 WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d UPDATES of individual rows\x00UPDATE t2 SET d=b*3 WHERE a=?1; -- %d times\x00One big UPDATE of the whole %d-row table\x00UPDATE t2 SET d=b*4\x00Query added column after filling\x00%d DELETEs, numeric BETWEEN, indexed\x00DELETE FROM t2 WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d DELETEs of individual rows\x00DELETE FROM t3 WHERE a=?1; -- %d times\x00Refill two %d-row tables using REPLACE\x00REPLACE INTO t2(a,b,c) SELECT a,b,c FROM t1\x00REPLACE INTO t3(a,b,c) SELECT a,b,c FROM t1\x00Refill a %d-row table using (b&1)==(a&1)\x00INSERT INTO t2(a,b,c)\n SELECT a,b,c FROM t1 WHERE (b&1)==(a&1);\x00INSERT INTO t2(a,b,c)\n SELECT a,b,c FROM t1 WHERE (b&1)<>(a&1);\x00%d four-ways joins\x00SELECT t1.c FROM t1, t2, t3, t4\n WHERE t4.a BETWEEN ?1 AND ?2\n AND t3.a=t4.b\n AND t2.a=t3.b\n AND t1.c=t2.c\x00subquery in result set\x00SELECT sum(a), max(c),\n avg((SELECT a FROM t2 WHERE 5+t2.b=t1.b) AND rowid<?1), max(c)\n FROM t1 WHERE rowid<?1;\x00%d REPLACE ops on an IPK\x00CREATE%s TABLE t5(a INTEGER PRIMARY KEY, b %s);\x00REPLACE INTO t5 VALUES(?1,?2); -- %d times\x00%d SELECTS on an IPK\x00SELECT b FROM t5 WHERE a=?1; -- %d times\x00%d REPLACE on TEXT PK\x00CREATE%s TABLE t6(a TEXT PRIMARY KEY, b %s)%s;\x00WITHOUT ROWID\x00REPLACE INTO t6 VALUES(?1,?2); -- %d times\x00%d SELECTS on a TEXT PK\x00SELECT b FROM t6 WHERE a=?1; -- %d times\x00%d SELECT DISTINCT\x00SELECT DISTINCT b FROM t5;\x00SELECT DISTINCT b FROM t6;\x00PRAGMA integrity_check\x00ANALYZE\x00Sudoku with recursive 'digits'\x00WITH RECURSIVE\n input(sud) AS (VALUES(?1)),\n digits(z,lp) AS (\n VALUES('1', 1)\n UNION ALL\n SELECT CAST(lp+1 AS TEXT), lp+1 FROM digits WHERE lp<9\n ),\n x(s, ind) AS (\n SELECT sud, instr(sud, '.') FROM input\n UNION ALL\n SELECT\n substr(s, 1, ind-1) || z || substr(s, ind+1),\n instr( substr(s, 1, ind-1) || z || substr(s, ind+1), '.' )\n FROM x, digits AS z\n WHERE ind>0\n AND NOT EXISTS (\n SELECT 1\n FROM digits AS lp\n WHERE z.z = substr(s, ((ind-1)/9)*9 + lp, 1)\n OR z.z = substr(s, ((ind-1)%%9) + (lp-1)*9 + 1, 1)\n OR z.z = substr(s, (((ind-1)/3) %% 3) * 3\n + ((ind-1)/27) * 27 + lp\n + ((lp-1) / 3) * 6, 1)\n )\n )\nSELECT s FROM x WHERE ind=0;\x00Sudoku with VALUES 'digits'\x00WITH RECURSIVE\n input(sud) AS (VALUES(?1)),\n digits(z,lp) AS (VALUES('1',1),('2',2),('3',3),('4',4),('5',5),\n ('6',6),('7',7),('8',8),('9',9)),\n x(s, ind) AS (\n SELECT sud, instr(sud, '.') FROM input\n UNION ALL\n SELECT\n substr(s, 1, ind-1) || z || substr(s, ind+1),\n instr( substr(s, 1, ind-1) || z || substr(s, ind+1), '.' )\n FROM x, digits AS z\n WHERE ind>0\n AND NOT EXISTS (\n SELECT 1\n FROM digits AS lp\n WHERE z.z = substr(s, ((ind-1)/9)*9 + lp, 1)\n OR z.z = substr(s, ((ind-1)%%9) + (lp-1)*9 + 1, 1)\n OR z.z = substr(s, (((ind-1)/3) %% 3) * 3\n + ((ind-1)/27) * 27 + lp\n + ((lp-1) / 3) * 6, 1)\n )\n )\nSELECT s FROM x WHERE ind=0;\x00Mandelbrot Set with spacing=%f\x00WITH RECURSIVE \n xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+?1 FROM xaxis WHERE x<1.2),\n yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+?2 FROM yaxis WHERE y<1.0),\n m(iter, cx, cy, x, y) AS (\n SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis\n UNION ALL\n SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m \n WHERE (x*x + y*y) < 4.0 AND iter<28\n ),\n m2(iter, cx, cy) AS (\n SELECT max(iter), cx, cy FROM m GROUP BY cx, cy\n ),\n a(t) AS (\n SELECT group_concat( substr(' .+*#', 1+min(iter/7,4), 1), '') \n FROM m2 GROUP BY cy\n )\nSELECT group_concat(rtrim(t),x'0a') FROM a;\x00EXCEPT operator on %d-element tables\x00WITH RECURSIVE \n t1(x) AS (VALUES(2) UNION ALL SELECT x+2 FROM t1 WHERE x<%d),\n t2(y) AS (VALUES(3) UNION ALL SELECT y+3 FROM t2 WHERE y<%d)\nSELECT count(x), avg(x) FROM (\n SELECT x FROM t1 EXCEPT SELECT y FROM t2 ORDER BY 1\n);\x00534...9..67.195....98....6.8...6...34..8.3..1....2...6.6....28....419..5...28..79\x0053....9..6..195....98....6.8...6...34..8.3..1....2...6.6....28....419..5....8..79\x0053.......6..195....98....6.8...6...34..8.3..1....2...6.6....28....419..5....8..79\x00%d.%de%d\x00Fill a table with %d FP values\x00CREATE%s TABLE t1(a REAL %s, b REAL %s);\x00INSERT INTO t1 VALUES(?1,?2); -- %d times\x00%d range queries\x00SELECT sum(b) FROM t1 WHERE a BETWEEN ?1 AND ?2\x00CREATE INDEX three times\x00CREATE INDEX t1a ON t1(a);\x00CREATE INDEX t1b ON t1(b);\x00CREATE INDEX t1ab ON t1(a,b);\x00%d indexed range queries\x00%d calls to round()\x00SELECT sum(round(a,2)+round(b,4)) FROM t1;\x00%d printf() calls\x00WITH c(fmt) AS (VALUES('%%g'),('%%e'),('%%!g'),('%%.20f'))SELECT sum(printf(fmt,a)) FROM t1, c\x00Fill %d rows\x00BEGIN;CREATE TABLE ZLOOKSLIKECOREDATA ( ZPK INTEGER PRIMARY KEY, ZTERMFITTINGHOUSINGCOMMAND INTEGER, ZBRIEFGOBYDODGERHEIGHT BLOB, ZCAPABLETRIPDOORALMOND BLOB, ZDEPOSITPAIRCOLLEGECOMET INTEGER, ZFRAMEENTERSIMPLEMOUTH INTEGER, ZHOPEFULGATEHOLECHALK INTEGER, ZSLEEPYUSERGRANDBOWL TIMESTAMP, ZDEWPEACHCAREERCELERY INTEGER, ZHANGERLITHIUMDINNERMEET VARCHAR, ZCLUBRELEASELIZARDADVICE VARCHAR, ZCHARGECLICKHUMANEHIRE INTEGER, ZFINGERDUEPIZZAOPTION TIMESTAMP, ZFLYINGDOCTORTABLEMELODY BLOB, ZLONGFINLEAVEIMAGEOIL TIMESTAMP, ZFAMILYVISUALOWNERMATTER BLOB, ZGOLDYOUNGINITIALNOSE FLOAT, ZCAUSESALAMITERMCYAN BLOB, ZSPREADMOTORBISCUITBACON FLOAT, ZGIFTICEFISHGLUEHAIR INTEGER, ZNOTICEPEARPOLICYJUICE TIMESTAMP, ZBANKBUFFALORECOVERORBIT TIMESTAMP, ZLONGDIETESSAYNATURE FLOAT, ZACTIONRANGEELEGANTNEUTRON BLOB, ZCADETBRIGHTPLANETBANK TIMESTAMP, ZAIRFORGIVEHEADFROG BLOB, ZSHARKJUSTFRUITMOVIE VARCHAR, ZFARMERMORNINGMIRRORCONCERN BLOB, ZWOODPOETRYCOBBLERBENCH VARCHAR, ZHAFNIUMSCRIPTSALADMOTOR INTEGER, ZPROBLEMCLUBPOPOVERJELLY FLOAT, ZEIGHTLEADERWORKERMOST TIMESTAMP, ZGLASSRESERVEBARIUMMEAL BLOB, ZCLAMBITARUGULAFAJITA BLOB, ZDECADEJOYOUSWAVEHABIT FLOAT, ZCOMPANYSUMMERFIBERELF INTEGER, ZTREATTESTQUILLCHARGE TIMESTAMP, ZBROWBALANCEKEYCHOWDER FLOAT, ZPEACHCOPPERDINNERLAKE FLOAT, ZDRYWALLBEYONDBROWNBOWL VARCHAR, ZBELLYCRASHITEMLACK BLOB, ZTENNISCYCLEBILLOFFICER INTEGER, ZMALLEQUIPTHANKSGLUE FLOAT, ZMISSREPLYHUMANLIVING INTEGER, ZKIWIVISUALPRIDEAPPLE VARCHAR, ZWISHHITSKINMOTOR BLOB, ZCALMRACCOONPROGRAMDEBIT VARCHAR, ZSHINYASSISTLIVINGCRAB VARCHAR, ZRESOLVEWRISTWRAPAPPLE VARCHAR, ZAPPEALSIMPLESECONDHOUSING BLOB, ZCORNERANCHORTAPEDIVER TIMESTAMP, ZMEMORYREQUESTSOURCEBIG VARCHAR, ZTRYFACTKEEPMILK TIMESTAMP, ZDIVERPAINTLEATHEREASY INTEGER, ZSORTMISTYQUOTECABBAGE BLOB, ZTUNEGASBUFFALOCAPITAL BLOB, ZFILLSTOPLAWJOYFUL FLOAT, ZSTEELCAREFULPLATENUMBER FLOAT, ZGIVEVIVIDDIVINEMEANING INTEGER, ZTREATPACKFUTURECONVERT VARCHAR, ZCALMLYGEMFINISHEFFECT INTEGER, ZCABBAGESOCKEASEMINUTE BLOB, ZPLANETFAMILYPUREMEMORY TIMESTAMP, ZMERRYCRACKTRAINLEADER BLOB, ZMINORWAYPAPERCLASSY TIMESTAMP, ZEAGLELINEMINEMAIL VARCHAR, ZRESORTYARDGREENLET TIMESTAMP, ZYARDOREGANOVIVIDJEWEL TIMESTAMP, ZPURECAKEVIVIDNEATLY FLOAT, ZASKCONTACTMONITORFUN TIMESTAMP, ZMOVEWHOGAMMAINCH VARCHAR, ZLETTUCEBIRDMEETDEBATE TIMESTAMP, ZGENENATURALHEARINGKITE VARCHAR, ZMUFFINDRYERDRAWFORTUNE FLOAT, ZGRAYSURVEYWIRELOVE FLOAT, ZPLIERSPRINTASKOREGANO INTEGER, ZTRAVELDRIVERCONTESTLILY INTEGER, ZHUMORSPICESANDKIDNEY TIMESTAMP, ZARSENICSAMPLEWAITMUON INTEGER, ZLACEADDRESSGROUNDCAREFUL FLOAT, ZBAMBOOMESSWASABIEVENING BLOB, ZONERELEASEAVERAGENURSE INTEGER, ZRADIANTWHENTRYCARD TIMESTAMP, ZREWARDINSIDEMANGOINTENSE FLOAT, ZNEATSTEWPARTIRON TIMESTAMP, ZOUTSIDEPEAHENCOUNTICE TIMESTAMP, ZCREAMEVENINGLIPBRANCH FLOAT, ZWHALEMATHAVOCADOCOPPER FLOAT, ZLIFEUSELEAFYBELL FLOAT, ZWEALTHLINENGLEEFULDAY VARCHAR, ZFACEINVITETALKGOLD BLOB, ZWESTAMOUNTAFFECTHEARING INTEGER, ZDELAYOUTCOMEHORNAGENCY INTEGER, ZBIGTHINKCONVERTECONOMY BLOB, ZBASEGOUDAREGULARFORGIVE TIMESTAMP, ZPATTERNCLORINEGRANDCOLBY TIMESTAMP, ZCYANBASEFEEDADROIT INTEGER, ZCARRYFLOORMINNOWDRAGON TIMESTAMP, ZIMAGEPENCILOTHERBOTTOM FLOAT, ZXENONFLIGHTPALEAPPLE TIMESTAMP, ZHERRINGJOKEFEATUREHOPEFUL FLOAT, ZCAPYEARLYRIVETBRUSH FLOAT, ZAGEREEDFROGBASKET VARCHAR, ZUSUALBODYHALIBUTDIAMOND VARCHAR, ZFOOTTAPWORDENTRY VARCHAR, ZDISHKEEPBLESTMONITOR FLOAT, ZBROADABLESOLIDCASUAL INTEGER, ZSQUAREGLEEFULCHILDLIGHT INTEGER, ZHOLIDAYHEADPONYDETAIL INTEGER, ZGENERALRESORTSKYOPEN TIMESTAMP, ZGLADSPRAYKIDNEYGUPPY VARCHAR, ZSWIMHEAVYMENTIONKIND BLOB, ZMESSYSULFURDREAMFESTIVE BLOB, ZSKYSKYCLASSICBRIEF VARCHAR, ZDILLASKHOKILEMON FLOAT, ZJUNIORSHOWPRESSNOVA FLOAT, ZSIZETOEAWARDFRESH TIMESTAMP, ZKEYFAILAPRICOTMETAL VARCHAR, ZHANDYREPAIRPROTONAIRPORT VARCHAR, ZPOSTPROTEINHANDLEACTOR BLOB);\x00INSERT INTO ZLOOKSLIKECOREDATA(ZPK,ZAIRFORGIVEHEADFROG,ZGIFTICEFISHGLUEHAIR,ZDELAYOUTCOMEHORNAGENCY,ZSLEEPYUSERGRANDBOWL,ZGLASSRESERVEBARIUMMEAL,ZBRIEFGOBYDODGERHEIGHT,ZBAMBOOMESSWASABIEVENING,ZFARMERMORNINGMIRRORCONCERN,ZTREATPACKFUTURECONVERT,ZCAUSESALAMITERMCYAN,ZCALMRACCOONPROGRAMDEBIT,ZHOLIDAYHEADPONYDETAIL,ZWOODPOETRYCOBBLERBENCH,ZHAFNIUMSCRIPTSALADMOTOR,ZUSUALBODYHALIBUTDIAMOND,ZOUTSIDEPEAHENCOUNTICE,ZDIVERPAINTLEATHEREASY,ZWESTAMOUNTAFFECTHEARING,ZSIZETOEAWARDFRESH,ZDEWPEACHCAREERCELERY,ZSTEELCAREFULPLATENUMBER,ZCYANBASEFEEDADROIT,ZCALMLYGEMFINISHEFFECT,ZHANDYREPAIRPROTONAIRPORT,ZGENENATURALHEARINGKITE,ZBROADABLESOLIDCASUAL,ZPOSTPROTEINHANDLEACTOR,ZLACEADDRESSGROUNDCAREFUL,ZIMAGEPENCILOTHERBOTTOM,ZPROBLEMCLUBPOPOVERJELLY,ZPATTERNCLORINEGRANDCOLBY,ZNEATSTEWPARTIRON,ZAPPEALSIMPLESECONDHOUSING,ZMOVEWHOGAMMAINCH,ZTENNISCYCLEBILLOFFICER,ZSHARKJUSTFRUITMOVIE,ZKEYFAILAPRICOTMETAL,ZCOMPANYSUMMERFIBERELF,ZTERMFITTINGHOUSINGCOMMAND,ZRESORTYARDGREENLET,ZCABBAGESOCKEASEMINUTE,ZSQUAREGLEEFULCHILDLIGHT,ZONERELEASEAVERAGENURSE,ZBIGTHINKCONVERTECONOMY,ZPLIERSPRINTASKOREGANO,ZDECADEJOYOUSWAVEHABIT,ZDRYWALLBEYONDBROWNBOWL,ZCLUBRELEASELIZARDADVICE,ZWHALEMATHAVOCADOCOPPER,ZBELLYCRASHITEMLACK,ZLETTUCEBIRDMEETDEBATE,ZCAPABLETRIPDOORALMOND,ZRADIANTWHENTRYCARD,ZCAPYEARLYRIVETBRUSH,ZAGEREEDFROGBASKET,ZSWIMHEAVYMENTIONKIND,ZTRAVELDRIVERCONTESTLILY,ZGLADSPRAYKIDNEYGUPPY,ZBANKBUFFALORECOVERORBIT,ZFINGERDUEPIZZAOPTION,ZCLAMBITARUGULAFAJITA,ZLONGFINLEAVEIMAGEOIL,ZLONGDIETESSAYNATURE,ZJUNIORSHOWPRESSNOVA,ZHOPEFULGATEHOLECHALK,ZDEPOSITPAIRCOLLEGECOMET,ZWEALTHLINENGLEEFULDAY,ZFILLSTOPLAWJOYFUL,ZTUNEGASBUFFALOCAPITAL,ZGRAYSURVEYWIRELOVE,ZCORNERANCHORTAPEDIVER,ZREWARDINSIDEMANGOINTENSE,ZCADETBRIGHTPLANETBANK,ZPLANETFAMILYPUREMEMORY,ZTREATTESTQUILLCHARGE,ZCREAMEVENINGLIPBRANCH,ZSKYSKYCLASSICBRIEF,ZARSENICSAMPLEWAITMUON,ZBROWBALANCEKEYCHOWDER,ZFLYINGDOCTORTABLEMELODY,ZHANGERLITHIUMDINNERMEET,ZNOTICEPEARPOLICYJUICE,ZSHINYASSISTLIVINGCRAB,ZLIFEUSELEAFYBELL,ZFACEINVITETALKGOLD,ZGENERALRESORTSKYOPEN,ZPURECAKEVIVIDNEATLY,ZKIWIVISUALPRIDEAPPLE,ZMESSYSULFURDREAMFESTIVE,ZCHARGECLICKHUMANEHIRE,ZHERRINGJOKEFEATUREHOPEFUL,ZYARDOREGANOVIVIDJEWEL,ZFOOTTAPWORDENTRY,ZWISHHITSKINMOTOR,ZBASEGOUDAREGULARFORGIVE,ZMUFFINDRYERDRAWFORTUNE,ZACTIONRANGEELEGANTNEUTRON,ZTRYFACTKEEPMILK,ZPEACHCOPPERDINNERLAKE,ZFRAMEENTERSIMPLEMOUTH,ZMERRYCRACKTRAINLEADER,ZMEMORYREQUESTSOURCEBIG,ZCARRYFLOORMINNOWDRAGON,ZMINORWAYPAPERCLASSY,ZDILLASKHOKILEMON,ZRESOLVEWRISTWRAPAPPLE,ZASKCONTACTMONITORFUN,ZGIVEVIVIDDIVINEMEANING,ZEIGHTLEADERWORKERMOST,ZMISSREPLYHUMANLIVING,ZXENONFLIGHTPALEAPPLE,ZSORTMISTYQUOTECABBAGE,ZEAGLELINEMINEMAIL,ZFAMILYVISUALOWNERMATTER,ZSPREADMOTORBISCUITBACON,ZDISHKEEPBLESTMONITOR,ZMALLEQUIPTHANKSGLUE,ZGOLDYOUNGINITIALNOSE,ZHUMORSPICESANDKIDNEY)VALUES(?1,?26,?20,?93,?8,?33,?3,?81,?28,?60,?18,?47,?109,?29,?30,?104,?86,?54,?92,?117,?9,?58,?97,?61,?119,?73,?107,?120,?80,?99,?31,?96,?85,?50,?71,?42,?27,?118,?36,?2,?67,?62,?108,?82,?94,?76,?35,?40,?11,?88,?41,?72,?4,?83,?102,?103,?112,?77,?111,?22,?13,?34,?15,?23,?116,?7,?5,?90,?57,?56,?75,?51,?84,?25,?63,?37,?87,?114,?79,?38,?14,?10,?21,?48,?89,?91,?110,?69,?45,?113,?12,?101,?68,?105,?46,?95,?74,?24,?53,?39,?6,?64,?52,?98,?65,?115,?49,?70,?59,?32,?44,?100,?55,?66,?16,?19,?106,?43,?17,?78);\x00Query %d rows by rowid\x00SELECT ZCYANBASEFEEDADROIT,ZJUNIORSHOWPRESSNOVA,ZCAUSESALAMITERMCYAN,ZHOPEFULGATEHOLECHALK,ZHUMORSPICESANDKIDNEY,ZSWIMHEAVYMENTIONKIND,ZMOVEWHOGAMMAINCH,ZAPPEALSIMPLESECONDHOUSING,ZHAFNIUMSCRIPTSALADMOTOR,ZNEATSTEWPARTIRON,ZLONGFINLEAVEIMAGEOIL,ZDEWPEACHCAREERCELERY,ZXENONFLIGHTPALEAPPLE,ZCALMRACCOONPROGRAMDEBIT,ZUSUALBODYHALIBUTDIAMOND,ZTRYFACTKEEPMILK,ZWEALTHLINENGLEEFULDAY,ZLONGDIETESSAYNATURE,ZLIFEUSELEAFYBELL,ZTREATPACKFUTURECONVERT,ZMEMORYREQUESTSOURCEBIG,ZYARDOREGANOVIVIDJEWEL,ZDEPOSITPAIRCOLLEGECOMET,ZSLEEPYUSERGRANDBOWL,ZBRIEFGOBYDODGERHEIGHT,ZCLUBRELEASELIZARDADVICE,ZCAPABLETRIPDOORALMOND,ZDRYWALLBEYONDBROWNBOWL,ZASKCONTACTMONITORFUN,ZKIWIVISUALPRIDEAPPLE,ZNOTICEPEARPOLICYJUICE,ZPEACHCOPPERDINNERLAKE,ZSTEELCAREFULPLATENUMBER,ZGLADSPRAYKIDNEYGUPPY,ZCOMPANYSUMMERFIBERELF,ZTENNISCYCLEBILLOFFICER,ZIMAGEPENCILOTHERBOTTOM,ZWESTAMOUNTAFFECTHEARING,ZDIVERPAINTLEATHEREASY,ZSKYSKYCLASSICBRIEF,ZMESSYSULFURDREAMFESTIVE,ZMERRYCRACKTRAINLEADER,ZBROADABLESOLIDCASUAL,ZGLASSRESERVEBARIUMMEAL,ZTUNEGASBUFFALOCAPITAL,ZBANKBUFFALORECOVERORBIT,ZTREATTESTQUILLCHARGE,ZBAMBOOMESSWASABIEVENING,ZREWARDINSIDEMANGOINTENSE,ZEAGLELINEMINEMAIL,ZCALMLYGEMFINISHEFFECT,ZKEYFAILAPRICOTMETAL,ZFINGERDUEPIZZAOPTION,ZCADETBRIGHTPLANETBANK,ZGOLDYOUNGINITIALNOSE,ZMISSREPLYHUMANLIVING,ZEIGHTLEADERWORKERMOST,ZFRAMEENTERSIMPLEMOUTH,ZBIGTHINKCONVERTECONOMY,ZFACEINVITETALKGOLD,ZPOSTPROTEINHANDLEACTOR,ZHERRINGJOKEFEATUREHOPEFUL,ZCABBAGESOCKEASEMINUTE,ZMUFFINDRYERDRAWFORTUNE,ZPROBLEMCLUBPOPOVERJELLY,ZGIVEVIVIDDIVINEMEANING,ZGENENATURALHEARINGKITE,ZGENERALRESORTSKYOPEN,ZLETTUCEBIRDMEETDEBATE,ZBASEGOUDAREGULARFORGIVE,ZCHARGECLICKHUMANEHIRE,ZPLANETFAMILYPUREMEMORY,ZMINORWAYPAPERCLASSY,ZCAPYEARLYRIVETBRUSH,ZSIZETOEAWARDFRESH,ZARSENICSAMPLEWAITMUON,ZSQUAREGLEEFULCHILDLIGHT,ZSHINYASSISTLIVINGCRAB,ZCORNERANCHORTAPEDIVER,ZDECADEJOYOUSWAVEHABIT,ZTRAVELDRIVERCONTESTLILY,ZFLYINGDOCTORTABLEMELODY,ZSHARKJUSTFRUITMOVIE,ZFAMILYVISUALOWNERMATTER,ZFARMERMORNINGMIRRORCONCERN,ZGIFTICEFISHGLUEHAIR,ZOUTSIDEPEAHENCOUNTICE,ZSPREADMOTORBISCUITBACON,ZWISHHITSKINMOTOR,ZHOLIDAYHEADPONYDETAIL,ZWOODPOETRYCOBBLERBENCH,ZAIRFORGIVEHEADFROG,ZBROWBALANCEKEYCHOWDER,ZDISHKEEPBLESTMONITOR,ZCLAMBITARUGULAFAJITA,ZPLIERSPRINTASKOREGANO,ZRADIANTWHENTRYCARD,ZDELAYOUTCOMEHORNAGENCY,ZPURECAKEVIVIDNEATLY,ZPATTERNCLORINEGRANDCOLBY,ZHANDYREPAIRPROTONAIRPORT,ZAGEREEDFROGBASKET,ZSORTMISTYQUOTECABBAGE,ZFOOTTAPWORDENTRY,ZRESOLVEWRISTWRAPAPPLE,ZDILLASKHOKILEMON,ZFILLSTOPLAWJOYFUL,ZACTIONRANGEELEGANTNEUTRON,ZRESORTYARDGREENLET,ZCREAMEVENINGLIPBRANCH,ZWHALEMATHAVOCADOCOPPER,ZGRAYSURVEYWIRELOVE,ZBELLYCRASHITEMLACK,ZHANGERLITHIUMDINNERMEET,ZCARRYFLOORMINNOWDRAGON,ZMALLEQUIPTHANKSGLUE,ZTERMFITTINGHOUSINGCOMMAND,ZONERELEASEAVERAGENURSE,ZLACEADDRESSGROUNDCAREFUL FROM ZLOOKSLIKECOREDATA WHERE ZPK=?1;\x00IBBIIITIVVITBTBFBFITTFBTBVBVIFTBBFITFFVBIFIVBVVVBTVTIBBFFIVIBTBTVTTFTVTVFFIITIFBITFTTFFFVBIIBTTITFTFFVVVFIIITVBBVFFTVVB\x00BEGIN;CREATE TABLE t1(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TABLE t2(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TABLE t3(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE VIEW v1 AS SELECT rowid, i, t FROM t1;CREATE VIEW v2 AS SELECT rowid, i, t FROM t2;CREATE VIEW v3 AS SELECT rowid, i, t FROM t3;\x00INSERT INTO t%d VALUES(NULL,?1,?2)\x00CREATE INDEX i1 ON t1(t);CREATE INDEX i2 ON t2(t);CREATE INDEX i3 ON t3(t);COMMIT;\x00speed4p-join1\x00SELECT * FROM t1, t2, t3 WHERE t1.oid = t2.oid AND t2.oid = t3.oid\x00speed4p-join2\x00SELECT * FROM t1, t2, t3 WHERE t1.t = t2.t AND t2.t = t3.t\x00speed4p-view1\x00SELECT * FROM v%d WHERE rowid = ?\x00speed4p-table1\x00SELECT * FROM t%d WHERE rowid = ?\x00speed4p-subselect1\x00SELECT (SELECT t FROM t1 WHERE rowid = ?1),(SELECT t FROM t2 WHERE rowid = ?1),(SELECT t FROM t3 WHERE rowid = ?1)\x00speed4p-rowid-update\x00UPDATE t1 SET i=i+1 WHERE rowid=?1\x00CREATE TABLE t5(t TEXT PRIMARY KEY, i INTEGER);\x00speed4p-insert-ignore\x00INSERT OR IGNORE INTO t5 SELECT t, i FROM t1\x00CREATE TABLE log(op TEXT, r INTEGER, i INTEGER, t TEXT);CREATE TABLE t4(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TRIGGER t4_trigger1 AFTER INSERT ON t4 BEGIN INSERT INTO log VALUES('INSERT INTO t4', new.rowid, new.i, new.t);END;CREATE TRIGGER t4_trigger2 AFTER UPDATE ON t4 BEGIN INSERT INTO log VALUES('UPDATE OF t4', new.rowid, new.i, new.t);END;CREATE TRIGGER t4_trigger3 AFTER DELETE ON t4 BEGIN INSERT INTO log VALUES('DELETE OF t4', old.rowid, old.i, old.t);END;BEGIN;\x00speed4p-trigger1\x00INSERT INTO t4 VALUES(NULL, ?1, ?2)\x00speed4p-trigger2\x00UPDATE t4 SET i = ?1, t = ?2 WHERE rowid = ?3\x00speed4p-trigger3\x00DELETE FROM t4 WHERE rowid = ?1\x00DROP TABLE t4;DROP TABLE log;VACUUM;CREATE TABLE t4(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);BEGIN;\x00speed4p-notrigger1\x00speed4p-notrigger2\x00speed4p-notrigger3\x00%5d %5d %5d %s\n\x00/proc/%d/io\x00rb\x00-- %-28s %s\x00rchar: \x00Bytes received by read():\x00wchar: \x00Bytes sent to write():\x00syscr: \x00Read() system calls:\x00syscw: \x00Write() system calls:\x00read_bytes: \x00Bytes rcvd from storage:\x00write_bytes: \x00Bytes sent to storage:\x00cancelled_write_bytes: \x00Cancelled write bytes:\x00-- Compile option: %s\n\x00main\x00-- Speedtest1 for SQLite %s %.50s\n\x00UNIQUE\x00autovacuum\x00cachesize\x00missing argument on %s\n\x00exclusive\x00explain\x00heap\x00missing arguments on %s\n\x00incrvacuum\x00journal\x00key\x00lookaside\x00multithread\x00nomemstat\x00mmap\x00nosync\x00notnull\x00NOT NULL\x00pagesize\x00pcache\x00primarykey\x00PRIMARY KEY\x00repeat\x00reprepare\x00serialized\x00singlethread\x00sqlonly\x00shrink-memory\x00size\x00stats\x00temp\x00argument to --temp should be integer between 0 and 9\x00testset\x00trace\x00threads\x00utf16le\x00utf16be\x00verify\x00without-rowid\x00help\x00?\x00unknown option: %s\nUse \"%s -?\" for help\n\x00surplus argument: %s\nUse \"%s -?\" for help\n\x00cannot allocate %d-byte heap\n\x00heap configuration failed: %d\n\x00cannot allocate %lld-byte pcache\n\x00pcache configuration failed: %d\n\x00Cannot open database file: %s\n\x00lookaside configuration failed: %d\n\x00random\x00PRAGMA mmap_size=%d\x00PRAGMA threads=%d\x00PRAGMA key('%s')\x00PRAGMA encoding=%s\x00PRAGMA auto_vacuum=FULL\x00PRAGMA auto_vacuum=INCREMENTAL\x00PRAGMA page_size=%d\x00PRAGMA cache_size=%d\x00PRAGMA synchronous=OFF\x00PRAGMA locking_mode=EXCLUSIVE\x00PRAGMA journal_mode=%s\x00.explain\n.echo on\n\x00debug1\x00orm\x00cte\x00fp\x00trigger\x00rtree\x00compile with -DSQLITE_ENABLE_RTREE to enable the R-Tree tests\n\x00unknown testset: \"%s\"\nChoices: cte debug1 fp main orm rtree trigger\n\x00PRAGMA compile_options\x00-- Lookaside Slots Used: %d (max %d)\n\x00-- Successful lookasides: %d\n\x00-- Lookaside size faults: %d\n\x00-- Lookaside OOM faults: %d\n\x00-- Pager Heap Usage: %d bytes\n\x00-- Page cache hits: %d\n\x00-- Page cache misses: %d\n\x00-- Page cache writes: %d\n\x00-- Schema Heap Usage: %d bytes\n\x00-- Statement Heap Usage: %d bytes\n\x00-- Memory Used (bytes): %d (max %d)\n\x00-- Outstanding Allocations: %d (max %d)\n\x00-- Pcache Overflow Bytes: %d (max %d)\n\x00-- Largest Allocation: %d bytes\n\x00-- Largest Pcache Allocation: %d bytes\n\x00"
+var ts1 = "Usage: %s [--options] DATABASE\nOptions:\n --autovacuum Enable AUTOVACUUM mode\n --cachesize N Set the cache size to N\n --checkpoint Run PRAGMA wal_checkpoint after each test case\n --exclusive Enable locking_mode=EXCLUSIVE\n --explain Like --sqlonly but with added EXPLAIN keywords\n --heap SZ MIN Memory allocator uses SZ bytes & min allocation MIN\n --incrvacuum Enable incremenatal vacuum mode\n --journal M Set the journal_mode to M\n --key KEY Set the encryption key to KEY\n --lookaside N SZ Configure lookaside for N slots of SZ bytes each\n --memdb Use an in-memory database\n --mmap SZ MMAP the first SZ bytes of the database file\n --multithread Set multithreaded mode\n --nomemstat Disable memory statistics\n --nosync Set PRAGMA synchronous=OFF\n --notnull Add NOT NULL constraints to table columns\n --output FILE Store SQL output in FILE\n --pagesize N Set the page size to N\n --pcache N SZ Configure N pages of pagecache each of size SZ bytes\n --primarykey Use PRIMARY KEY instead of UNIQUE where appropriate\n --repeat N Repeat each SELECT N times (default: 1)\n --reprepare Reprepare each statement upon every invocation\n --serialized Set serialized threading mode\n --singlethread Set single-threaded mode - disables all mutexing\n --sqlonly No-op. Only show the SQL that would have been run.\n --shrink-memory Invoke sqlite3_db_release_memory() frequently.\n --size N Relative test size. Default=100\n --stats Show statistics at the end\n --temp N N from 0 to 9. 0: no temp table. 9: all temp tables\n --testset T Run test-set T (main, cte, rtree, orm, fp, debug)\n --trace Turn on SQL tracing\n --threads N Use up to N threads for sorting\n --utf16be Set text encoding to UTF-16BE\n --utf16le Set text encoding to UTF-16LE\n --verify Run additional verification steps.\n --without-rowid Use WITHOUT ROWID where appropriate\n\x00 TEMP\x00\x00parameter too large - max 2147483648\x00KiB\x00MiB\x00GiB\x00KB\x00MB\x00GB\x00K\x00M\x00G\x00 billion\x00 million\x00 thousand\x00%s hundred\x00%s\x00zero\x00one\x00two\x00three\x00four\x00five\x00six\x00seven\x00eight\x00nine\x00ten\x00eleven\x00twelve\x00thirteen\x00fourteen\x00fifteen\x00sixteen\x00seventeen\x00eighteen\x00nineteen\x00twenty\x00thirty\x00forty\x00fifty\x00sixty\x00seventy\x00eighty\x00ninety\x00.......................................................................\x00/* %4d - %s%.*s */\n\x00%4d - %s%.*s \x00PRAGMA wal_checkpoint;\x00%4d.%03ds\n\x00 TOTAL%.*s %4d.%03ds\n\x00Verification Hash: %llu \x00\n\x00%02x\x00EXPLAIN \x00%.*s;\n\x00CREATE *\x00DROP *\x00ALTER *\x00SQL error: %s\n%s\n\x00exec error: %s\n\x00SQL error: %s\n\x00nil\x00-IFTBN\x000123456789abcdef\x00%d INSERTs into table with no index\x00BEGIN\x00CREATE%s TABLE t1(a INTEGER %s, b INTEGER %s, c TEXT %s);\x00INSERT INTO t1 VALUES(?1,?2,?3); -- %d times\x00COMMIT\x00%d ordered INSERTS with one index/PK\x00CREATE%s TABLE t2(a INTEGER %s %s, b INTEGER %s, c TEXT %s) %s\x00INSERT INTO t2 VALUES(?1,?2,?3); -- %d times\x00%d unordered INSERTS with one index/PK\x00CREATE%s TABLE t3(a INTEGER %s %s, b INTEGER %s, c TEXT %s) %s\x00INSERT INTO t3 VALUES(?1,?2,?3); -- %d times\x00%d SELECTS, numeric BETWEEN, unindexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(c) FROM t1\n WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, LIKE, unindexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(c) FROM t1\n WHERE c LIKE ?1; -- %d times\x00%d SELECTS w/ORDER BY, unindexed\x00SELECT a, b, c FROM t1 WHERE c LIKE ?1\n ORDER BY a; -- %d times\x00%d SELECTS w/ORDER BY and LIMIT, unindexed\x00SELECT a, b, c FROM t1 WHERE c LIKE ?1\n ORDER BY a LIMIT 10; -- %d times\x00CREATE INDEX five times\x00BEGIN;\x00CREATE UNIQUE INDEX t1b ON t1(b);\x00CREATE INDEX t1c ON t1(c);\x00CREATE UNIQUE INDEX t2b ON t2(b);\x00CREATE INDEX t2c ON t2(c DESC);\x00CREATE INDEX t3bc ON t3(b,c);\x00COMMIT;\x00%d SELECTS, numeric BETWEEN, indexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM t1\n WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, numeric BETWEEN, PK\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM t2\n WHERE a BETWEEN ?1 AND ?2; -- %d times\x00%d SELECTS, text BETWEEN, indexed\x00SELECT count(*), avg(b), sum(length(c)), group_concat(a) FROM t1\n WHERE c BETWEEN ?1 AND (?1||'~'); -- %d times\x00%d INSERTS with three indexes\x00CREATE%s TABLE t4(\n a INTEGER %s %s,\n b INTEGER %s,\n c TEXT %s\n) %s\x00CREATE INDEX t4b ON t4(b)\x00CREATE INDEX t4c ON t4(c)\x00INSERT INTO t4 SELECT * FROM t1\x00DELETE and REFILL one table\x00DELETE FROM t2;\x00INSERT INTO t2 SELECT * FROM t1;\x00VACUUM\x00ALTER TABLE ADD COLUMN, and query\x00ALTER TABLE t2 ADD COLUMN d DEFAULT 123\x00SELECT sum(d) FROM t2\x00%d UPDATES, numeric BETWEEN, indexed\x00UPDATE t2 SET d=b*2 WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d UPDATES of individual rows\x00UPDATE t2 SET d=b*3 WHERE a=?1; -- %d times\x00One big UPDATE of the whole %d-row table\x00UPDATE t2 SET d=b*4\x00Query added column after filling\x00%d DELETEs, numeric BETWEEN, indexed\x00DELETE FROM t2 WHERE b BETWEEN ?1 AND ?2; -- %d times\x00%d DELETEs of individual rows\x00DELETE FROM t3 WHERE a=?1; -- %d times\x00Refill two %d-row tables using REPLACE\x00REPLACE INTO t2(a,b,c) SELECT a,b,c FROM t1\x00REPLACE INTO t3(a,b,c) SELECT a,b,c FROM t1\x00Refill a %d-row table using (b&1)==(a&1)\x00INSERT INTO t2(a,b,c)\n SELECT a,b,c FROM t1 WHERE (b&1)==(a&1);\x00INSERT INTO t2(a,b,c)\n SELECT a,b,c FROM t1 WHERE (b&1)<>(a&1);\x00%d four-ways joins\x00SELECT t1.c FROM t1, t2, t3, t4\n WHERE t4.a BETWEEN ?1 AND ?2\n AND t3.a=t4.b\n AND t2.a=t3.b\n AND t1.c=t2.c\x00subquery in result set\x00SELECT sum(a), max(c),\n avg((SELECT a FROM t2 WHERE 5+t2.b=t1.b) AND rowid<?1), max(c)\n FROM t1 WHERE rowid<?1;\x00%d REPLACE ops on an IPK\x00CREATE%s TABLE t5(a INTEGER PRIMARY KEY, b %s);\x00REPLACE INTO t5 VALUES(?1,?2); -- %d times\x00%d SELECTS on an IPK\x00SELECT b FROM t5 WHERE a=?1; -- %d times\x00%d REPLACE on TEXT PK\x00CREATE%s TABLE t6(a TEXT PRIMARY KEY, b %s)%s;\x00WITHOUT ROWID\x00REPLACE INTO t6 VALUES(?1,?2); -- %d times\x00%d SELECTS on a TEXT PK\x00SELECT b FROM t6 WHERE a=?1; -- %d times\x00%d SELECT DISTINCT\x00SELECT DISTINCT b FROM t5;\x00SELECT DISTINCT b FROM t6;\x00PRAGMA integrity_check\x00ANALYZE\x00Sudoku with recursive 'digits'\x00WITH RECURSIVE\n input(sud) AS (VALUES(?1)),\n digits(z,lp) AS (\n VALUES('1', 1)\n UNION ALL\n SELECT CAST(lp+1 AS TEXT), lp+1 FROM digits WHERE lp<9\n ),\n x(s, ind) AS (\n SELECT sud, instr(sud, '.') FROM input\n UNION ALL\n SELECT\n substr(s, 1, ind-1) || z || substr(s, ind+1),\n instr( substr(s, 1, ind-1) || z || substr(s, ind+1), '.' )\n FROM x, digits AS z\n WHERE ind>0\n AND NOT EXISTS (\n SELECT 1\n FROM digits AS lp\n WHERE z.z = substr(s, ((ind-1)/9)*9 + lp, 1)\n OR z.z = substr(s, ((ind-1)%%9) + (lp-1)*9 + 1, 1)\n OR z.z = substr(s, (((ind-1)/3) %% 3) * 3\n + ((ind-1)/27) * 27 + lp\n + ((lp-1) / 3) * 6, 1)\n )\n )\nSELECT s FROM x WHERE ind=0;\x00Sudoku with VALUES 'digits'\x00WITH RECURSIVE\n input(sud) AS (VALUES(?1)),\n digits(z,lp) AS (VALUES('1',1),('2',2),('3',3),('4',4),('5',5),\n ('6',6),('7',7),('8',8),('9',9)),\n x(s, ind) AS (\n SELECT sud, instr(sud, '.') FROM input\n UNION ALL\n SELECT\n substr(s, 1, ind-1) || z || substr(s, ind+1),\n instr( substr(s, 1, ind-1) || z || substr(s, ind+1), '.' )\n FROM x, digits AS z\n WHERE ind>0\n AND NOT EXISTS (\n SELECT 1\n FROM digits AS lp\n WHERE z.z = substr(s, ((ind-1)/9)*9 + lp, 1)\n OR z.z = substr(s, ((ind-1)%%9) + (lp-1)*9 + 1, 1)\n OR z.z = substr(s, (((ind-1)/3) %% 3) * 3\n + ((ind-1)/27) * 27 + lp\n + ((lp-1) / 3) * 6, 1)\n )\n )\nSELECT s FROM x WHERE ind=0;\x00Mandelbrot Set with spacing=%f\x00WITH RECURSIVE \n xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+?1 FROM xaxis WHERE x<1.2),\n yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+?2 FROM yaxis WHERE y<1.0),\n m(iter, cx, cy, x, y) AS (\n SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis\n UNION ALL\n SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m \n WHERE (x*x + y*y) < 4.0 AND iter<28\n ),\n m2(iter, cx, cy) AS (\n SELECT max(iter), cx, cy FROM m GROUP BY cx, cy\n ),\n a(t) AS (\n SELECT group_concat( substr(' .+*#', 1+min(iter/7,4), 1), '') \n FROM m2 GROUP BY cy\n )\nSELECT group_concat(rtrim(t),x'0a') FROM a;\x00EXCEPT operator on %d-element tables\x00WITH RECURSIVE \n t1(x) AS (VALUES(2) UNION ALL SELECT x+2 FROM t1 WHERE x<%d),\n t2(y) AS (VALUES(3) UNION ALL SELECT y+3 FROM t2 WHERE y<%d)\nSELECT count(x), avg(x) FROM (\n SELECT x FROM t1 EXCEPT SELECT y FROM t2 ORDER BY 1\n);\x00534...9..67.195....98....6.8...6...34..8.3..1....2...6.6....28....419..5...28..79\x0053....9..6..195....98....6.8...6...34..8.3..1....2...6.6....28....419..5....8..79\x0053.......6..195....98....6.8...6...34..8.3..1....2...6.6....28....419..5....8..79\x00%d.%de%d\x00Fill a table with %d FP values\x00CREATE%s TABLE t1(a REAL %s, b REAL %s);\x00INSERT INTO t1 VALUES(?1,?2); -- %d times\x00%d range queries\x00SELECT sum(b) FROM t1 WHERE a BETWEEN ?1 AND ?2\x00CREATE INDEX three times\x00CREATE INDEX t1a ON t1(a);\x00CREATE INDEX t1b ON t1(b);\x00CREATE INDEX t1ab ON t1(a,b);\x00%d indexed range queries\x00%d calls to round()\x00SELECT sum(round(a,2)+round(b,4)) FROM t1;\x00%d printf() calls\x00WITH c(fmt) AS (VALUES('%%g'),('%%e'),('%%!g'),('%%.20f'))SELECT sum(printf(fmt,a)) FROM t1, c\x00%d INSERTs into an r-tree\x00CREATE VIRTUAL TABLE rt1 USING rtree(id,x0,x1,y0,y1,z0,z1)\x00INSERT INTO rt1(id,x0,x1,y0,y1,z0,z1)VALUES(?1,?2,?3,?4,?5,?6,?7)\x00Copy from rtree to a regular table\x00CREATE TABLE t1(id INTEGER PRIMARY KEY,x0,x1,y0,y1,z0,z1)\x00INSERT INTO t1 SELECT * FROM rt1\x00%d one-dimensional intersect slice queries\x00SELECT count(*) FROM rt1 WHERE x0>=?1 AND x1<=?2\x00Verify result from 1-D intersect slice queries\x00SELECT count(*) FROM t1 WHERE x0>=?1 AND x1<=?2\x00Count disagree step %d: %d..%d. %d vs %d\x00%d one-dimensional overlap slice queries\x00SELECT count(*) FROM rt1 WHERE y1>=?1 AND y0<=?2\x00Verify result from 1-D overlap slice queries\x00SELECT count(*) FROM t1 WHERE y1>=?1 AND y0<=?2\x00%d custom geometry callback queries\x00xslice\x00SELECT count(*) FROM rt1 WHERE id MATCH xslice(?1,?2)\x00%d three-dimensional intersect box queries\x00SELECT count(*) FROM rt1 WHERE x1>=?1 AND x0<=?2 AND y1>=?1 AND y0<=?2 AND z1>=?1 AND z0<=?2\x00%d rowid queries\x00SELECT * FROM rt1 WHERE id=?1\x00%d UPDATEs using rowid\x00UPDATE rt1 SET x0=x0+100, x1=x1+100 WHERE id=?1\x00%d UPDATEs using one-dimensional overlap\x00UPDATE rt1 SET x0=x0-100, x1=x1-100 WHERE y1>=?1 AND y0<=?1+5\x00%d DELETEs using rowid\x00DELETE FROM rt1 WHERE id=?1\x00%d DELETEs using one-dimensional overlap\x00DELETE FROM rt1 WHERE y1>=?1 AND y0<=?1+5\x00Restore deleted entries using INSERT OR IGNORE\x00INSERT OR IGNORE INTO rt1 SELECT * FROM t1\x00Fill %d rows\x00BEGIN;CREATE TABLE ZLOOKSLIKECOREDATA ( ZPK INTEGER PRIMARY KEY, ZTERMFITTINGHOUSINGCOMMAND INTEGER, ZBRIEFGOBYDODGERHEIGHT BLOB, ZCAPABLETRIPDOORALMOND BLOB, ZDEPOSITPAIRCOLLEGECOMET INTEGER, ZFRAMEENTERSIMPLEMOUTH INTEGER, ZHOPEFULGATEHOLECHALK INTEGER, ZSLEEPYUSERGRANDBOWL TIMESTAMP, ZDEWPEACHCAREERCELERY INTEGER, ZHANGERLITHIUMDINNERMEET VARCHAR, ZCLUBRELEASELIZARDADVICE VARCHAR, ZCHARGECLICKHUMANEHIRE INTEGER, ZFINGERDUEPIZZAOPTION TIMESTAMP, ZFLYINGDOCTORTABLEMELODY BLOB, ZLONGFINLEAVEIMAGEOIL TIMESTAMP, ZFAMILYVISUALOWNERMATTER BLOB, ZGOLDYOUNGINITIALNOSE FLOAT, ZCAUSESALAMITERMCYAN BLOB, ZSPREADMOTORBISCUITBACON FLOAT, ZGIFTICEFISHGLUEHAIR INTEGER, ZNOTICEPEARPOLICYJUICE TIMESTAMP, ZBANKBUFFALORECOVERORBIT TIMESTAMP, ZLONGDIETESSAYNATURE FLOAT, ZACTIONRANGEELEGANTNEUTRON BLOB, ZCADETBRIGHTPLANETBANK TIMESTAMP, ZAIRFORGIVEHEADFROG BLOB, ZSHARKJUSTFRUITMOVIE VARCHAR, ZFARMERMORNINGMIRRORCONCERN BLOB, ZWOODPOETRYCOBBLERBENCH VARCHAR, ZHAFNIUMSCRIPTSALADMOTOR INTEGER, ZPROBLEMCLUBPOPOVERJELLY FLOAT, ZEIGHTLEADERWORKERMOST TIMESTAMP, ZGLASSRESERVEBARIUMMEAL BLOB, ZCLAMBITARUGULAFAJITA BLOB, ZDECADEJOYOUSWAVEHABIT FLOAT, ZCOMPANYSUMMERFIBERELF INTEGER, ZTREATTESTQUILLCHARGE TIMESTAMP, ZBROWBALANCEKEYCHOWDER FLOAT, ZPEACHCOPPERDINNERLAKE FLOAT, ZDRYWALLBEYONDBROWNBOWL VARCHAR, ZBELLYCRASHITEMLACK BLOB, ZTENNISCYCLEBILLOFFICER INTEGER, ZMALLEQUIPTHANKSGLUE FLOAT, ZMISSREPLYHUMANLIVING INTEGER, ZKIWIVISUALPRIDEAPPLE VARCHAR, ZWISHHITSKINMOTOR BLOB, ZCALMRACCOONPROGRAMDEBIT VARCHAR, ZSHINYASSISTLIVINGCRAB VARCHAR, ZRESOLVEWRISTWRAPAPPLE VARCHAR, ZAPPEALSIMPLESECONDHOUSING BLOB, ZCORNERANCHORTAPEDIVER TIMESTAMP, ZMEMORYREQUESTSOURCEBIG VARCHAR, ZTRYFACTKEEPMILK TIMESTAMP, ZDIVERPAINTLEATHEREASY INTEGER, ZSORTMISTYQUOTECABBAGE BLOB, ZTUNEGASBUFFALOCAPITAL BLOB, ZFILLSTOPLAWJOYFUL FLOAT, ZSTEELCAREFULPLATENUMBER FLOAT, ZGIVEVIVIDDIVINEMEANING INTEGER, ZTREATPACKFUTURECONVERT VARCHAR, ZCALMLYGEMFINISHEFFECT INTEGER, ZCABBAGESOCKEASEMINUTE BLOB, ZPLANETFAMILYPUREMEMORY TIMESTAMP, ZMERRYCRACKTRAINLEADER BLOB, ZMINORWAYPAPERCLASSY TIMESTAMP, ZEAGLELINEMINEMAIL VARCHAR, ZRESORTYARDGREENLET TIMESTAMP, ZYARDOREGANOVIVIDJEWEL TIMESTAMP, ZPURECAKEVIVIDNEATLY FLOAT, ZASKCONTACTMONITORFUN TIMESTAMP, ZMOVEWHOGAMMAINCH VARCHAR, ZLETTUCEBIRDMEETDEBATE TIMESTAMP, ZGENENATURALHEARINGKITE VARCHAR, ZMUFFINDRYERDRAWFORTUNE FLOAT, ZGRAYSURVEYWIRELOVE FLOAT, ZPLIERSPRINTASKOREGANO INTEGER, ZTRAVELDRIVERCONTESTLILY INTEGER, ZHUMORSPICESANDKIDNEY TIMESTAMP, ZARSENICSAMPLEWAITMUON INTEGER, ZLACEADDRESSGROUNDCAREFUL FLOAT, ZBAMBOOMESSWASABIEVENING BLOB, ZONERELEASEAVERAGENURSE INTEGER, ZRADIANTWHENTRYCARD TIMESTAMP, ZREWARDINSIDEMANGOINTENSE FLOAT, ZNEATSTEWPARTIRON TIMESTAMP, ZOUTSIDEPEAHENCOUNTICE TIMESTAMP, ZCREAMEVENINGLIPBRANCH FLOAT, ZWHALEMATHAVOCADOCOPPER FLOAT, ZLIFEUSELEAFYBELL FLOAT, ZWEALTHLINENGLEEFULDAY VARCHAR, ZFACEINVITETALKGOLD BLOB, ZWESTAMOUNTAFFECTHEARING INTEGER, ZDELAYOUTCOMEHORNAGENCY INTEGER, ZBIGTHINKCONVERTECONOMY BLOB, ZBASEGOUDAREGULARFORGIVE TIMESTAMP, ZPATTERNCLORINEGRANDCOLBY TIMESTAMP, ZCYANBASEFEEDADROIT INTEGER, ZCARRYFLOORMINNOWDRAGON TIMESTAMP, ZIMAGEPENCILOTHERBOTTOM FLOAT, ZXENONFLIGHTPALEAPPLE TIMESTAMP, ZHERRINGJOKEFEATUREHOPEFUL FLOAT, ZCAPYEARLYRIVETBRUSH FLOAT, ZAGEREEDFROGBASKET VARCHAR, ZUSUALBODYHALIBUTDIAMOND VARCHAR, ZFOOTTAPWORDENTRY VARCHAR, ZDISHKEEPBLESTMONITOR FLOAT, ZBROADABLESOLIDCASUAL INTEGER, ZSQUAREGLEEFULCHILDLIGHT INTEGER, ZHOLIDAYHEADPONYDETAIL INTEGER, ZGENERALRESORTSKYOPEN TIMESTAMP, ZGLADSPRAYKIDNEYGUPPY VARCHAR, ZSWIMHEAVYMENTIONKIND BLOB, ZMESSYSULFURDREAMFESTIVE BLOB, ZSKYSKYCLASSICBRIEF VARCHAR, ZDILLASKHOKILEMON FLOAT, ZJUNIORSHOWPRESSNOVA FLOAT, ZSIZETOEAWARDFRESH TIMESTAMP, ZKEYFAILAPRICOTMETAL VARCHAR, ZHANDYREPAIRPROTONAIRPORT VARCHAR, ZPOSTPROTEINHANDLEACTOR BLOB);\x00INSERT INTO ZLOOKSLIKECOREDATA(ZPK,ZAIRFORGIVEHEADFROG,ZGIFTICEFISHGLUEHAIR,ZDELAYOUTCOMEHORNAGENCY,ZSLEEPYUSERGRANDBOWL,ZGLASSRESERVEBARIUMMEAL,ZBRIEFGOBYDODGERHEIGHT,ZBAMBOOMESSWASABIEVENING,ZFARMERMORNINGMIRRORCONCERN,ZTREATPACKFUTURECONVERT,ZCAUSESALAMITERMCYAN,ZCALMRACCOONPROGRAMDEBIT,ZHOLIDAYHEADPONYDETAIL,ZWOODPOETRYCOBBLERBENCH,ZHAFNIUMSCRIPTSALADMOTOR,ZUSUALBODYHALIBUTDIAMOND,ZOUTSIDEPEAHENCOUNTICE,ZDIVERPAINTLEATHEREASY,ZWESTAMOUNTAFFECTHEARING,ZSIZETOEAWARDFRESH,ZDEWPEACHCAREERCELERY,ZSTEELCAREFULPLATENUMBER,ZCYANBASEFEEDADROIT,ZCALMLYGEMFINISHEFFECT,ZHANDYREPAIRPROTONAIRPORT,ZGENENATURALHEARINGKITE,ZBROADABLESOLIDCASUAL,ZPOSTPROTEINHANDLEACTOR,ZLACEADDRESSGROUNDCAREFUL,ZIMAGEPENCILOTHERBOTTOM,ZPROBLEMCLUBPOPOVERJELLY,ZPATTERNCLORINEGRANDCOLBY,ZNEATSTEWPARTIRON,ZAPPEALSIMPLESECONDHOUSING,ZMOVEWHOGAMMAINCH,ZTENNISCYCLEBILLOFFICER,ZSHARKJUSTFRUITMOVIE,ZKEYFAILAPRICOTMETAL,ZCOMPANYSUMMERFIBERELF,ZTERMFITTINGHOUSINGCOMMAND,ZRESORTYARDGREENLET,ZCABBAGESOCKEASEMINUTE,ZSQUAREGLEEFULCHILDLIGHT,ZONERELEASEAVERAGENURSE,ZBIGTHINKCONVERTECONOMY,ZPLIERSPRINTASKOREGANO,ZDECADEJOYOUSWAVEHABIT,ZDRYWALLBEYONDBROWNBOWL,ZCLUBRELEASELIZARDADVICE,ZWHALEMATHAVOCADOCOPPER,ZBELLYCRASHITEMLACK,ZLETTUCEBIRDMEETDEBATE,ZCAPABLETRIPDOORALMOND,ZRADIANTWHENTRYCARD,ZCAPYEARLYRIVETBRUSH,ZAGEREEDFROGBASKET,ZSWIMHEAVYMENTIONKIND,ZTRAVELDRIVERCONTESTLILY,ZGLADSPRAYKIDNEYGUPPY,ZBANKBUFFALORECOVERORBIT,ZFINGERDUEPIZZAOPTION,ZCLAMBITARUGULAFAJITA,ZLONGFINLEAVEIMAGEOIL,ZLONGDIETESSAYNATURE,ZJUNIORSHOWPRESSNOVA,ZHOPEFULGATEHOLECHALK,ZDEPOSITPAIRCOLLEGECOMET,ZWEALTHLINENGLEEFULDAY,ZFILLSTOPLAWJOYFUL,ZTUNEGASBUFFALOCAPITAL,ZGRAYSURVEYWIRELOVE,ZCORNERANCHORTAPEDIVER,ZREWARDINSIDEMANGOINTENSE,ZCADETBRIGHTPLANETBANK,ZPLANETFAMILYPUREMEMORY,ZTREATTESTQUILLCHARGE,ZCREAMEVENINGLIPBRANCH,ZSKYSKYCLASSICBRIEF,ZARSENICSAMPLEWAITMUON,ZBROWBALANCEKEYCHOWDER,ZFLYINGDOCTORTABLEMELODY,ZHANGERLITHIUMDINNERMEET,ZNOTICEPEARPOLICYJUICE,ZSHINYASSISTLIVINGCRAB,ZLIFEUSELEAFYBELL,ZFACEINVITETALKGOLD,ZGENERALRESORTSKYOPEN,ZPURECAKEVIVIDNEATLY,ZKIWIVISUALPRIDEAPPLE,ZMESSYSULFURDREAMFESTIVE,ZCHARGECLICKHUMANEHIRE,ZHERRINGJOKEFEATUREHOPEFUL,ZYARDOREGANOVIVIDJEWEL,ZFOOTTAPWORDENTRY,ZWISHHITSKINMOTOR,ZBASEGOUDAREGULARFORGIVE,ZMUFFINDRYERDRAWFORTUNE,ZACTIONRANGEELEGANTNEUTRON,ZTRYFACTKEEPMILK,ZPEACHCOPPERDINNERLAKE,ZFRAMEENTERSIMPLEMOUTH,ZMERRYCRACKTRAINLEADER,ZMEMORYREQUESTSOURCEBIG,ZCARRYFLOORMINNOWDRAGON,ZMINORWAYPAPERCLASSY,ZDILLASKHOKILEMON,ZRESOLVEWRISTWRAPAPPLE,ZASKCONTACTMONITORFUN,ZGIVEVIVIDDIVINEMEANING,ZEIGHTLEADERWORKERMOST,ZMISSREPLYHUMANLIVING,ZXENONFLIGHTPALEAPPLE,ZSORTMISTYQUOTECABBAGE,ZEAGLELINEMINEMAIL,ZFAMILYVISUALOWNERMATTER,ZSPREADMOTORBISCUITBACON,ZDISHKEEPBLESTMONITOR,ZMALLEQUIPTHANKSGLUE,ZGOLDYOUNGINITIALNOSE,ZHUMORSPICESANDKIDNEY)VALUES(?1,?26,?20,?93,?8,?33,?3,?81,?28,?60,?18,?47,?109,?29,?30,?104,?86,?54,?92,?117,?9,?58,?97,?61,?119,?73,?107,?120,?80,?99,?31,?96,?85,?50,?71,?42,?27,?118,?36,?2,?67,?62,?108,?82,?94,?76,?35,?40,?11,?88,?41,?72,?4,?83,?102,?103,?112,?77,?111,?22,?13,?34,?15,?23,?116,?7,?5,?90,?57,?56,?75,?51,?84,?25,?63,?37,?87,?114,?79,?38,?14,?10,?21,?48,?89,?91,?110,?69,?45,?113,?12,?101,?68,?105,?46,?95,?74,?24,?53,?39,?6,?64,?52,?98,?65,?115,?49,?70,?59,?32,?44,?100,?55,?66,?16,?19,?106,?43,?17,?78);\x00Query %d rows by rowid\x00SELECT ZCYANBASEFEEDADROIT,ZJUNIORSHOWPRESSNOVA,ZCAUSESALAMITERMCYAN,ZHOPEFULGATEHOLECHALK,ZHUMORSPICESANDKIDNEY,ZSWIMHEAVYMENTIONKIND,ZMOVEWHOGAMMAINCH,ZAPPEALSIMPLESECONDHOUSING,ZHAFNIUMSCRIPTSALADMOTOR,ZNEATSTEWPARTIRON,ZLONGFINLEAVEIMAGEOIL,ZDEWPEACHCAREERCELERY,ZXENONFLIGHTPALEAPPLE,ZCALMRACCOONPROGRAMDEBIT,ZUSUALBODYHALIBUTDIAMOND,ZTRYFACTKEEPMILK,ZWEALTHLINENGLEEFULDAY,ZLONGDIETESSAYNATURE,ZLIFEUSELEAFYBELL,ZTREATPACKFUTURECONVERT,ZMEMORYREQUESTSOURCEBIG,ZYARDOREGANOVIVIDJEWEL,ZDEPOSITPAIRCOLLEGECOMET,ZSLEEPYUSERGRANDBOWL,ZBRIEFGOBYDODGERHEIGHT,ZCLUBRELEASELIZARDADVICE,ZCAPABLETRIPDOORALMOND,ZDRYWALLBEYONDBROWNBOWL,ZASKCONTACTMONITORFUN,ZKIWIVISUALPRIDEAPPLE,ZNOTICEPEARPOLICYJUICE,ZPEACHCOPPERDINNERLAKE,ZSTEELCAREFULPLATENUMBER,ZGLADSPRAYKIDNEYGUPPY,ZCOMPANYSUMMERFIBERELF,ZTENNISCYCLEBILLOFFICER,ZIMAGEPENCILOTHERBOTTOM,ZWESTAMOUNTAFFECTHEARING,ZDIVERPAINTLEATHEREASY,ZSKYSKYCLASSICBRIEF,ZMESSYSULFURDREAMFESTIVE,ZMERRYCRACKTRAINLEADER,ZBROADABLESOLIDCASUAL,ZGLASSRESERVEBARIUMMEAL,ZTUNEGASBUFFALOCAPITAL,ZBANKBUFFALORECOVERORBIT,ZTREATTESTQUILLCHARGE,ZBAMBOOMESSWASABIEVENING,ZREWARDINSIDEMANGOINTENSE,ZEAGLELINEMINEMAIL,ZCALMLYGEMFINISHEFFECT,ZKEYFAILAPRICOTMETAL,ZFINGERDUEPIZZAOPTION,ZCADETBRIGHTPLANETBANK,ZGOLDYOUNGINITIALNOSE,ZMISSREPLYHUMANLIVING,ZEIGHTLEADERWORKERMOST,ZFRAMEENTERSIMPLEMOUTH,ZBIGTHINKCONVERTECONOMY,ZFACEINVITETALKGOLD,ZPOSTPROTEINHANDLEACTOR,ZHERRINGJOKEFEATUREHOPEFUL,ZCABBAGESOCKEASEMINUTE,ZMUFFINDRYERDRAWFORTUNE,ZPROBLEMCLUBPOPOVERJELLY,ZGIVEVIVIDDIVINEMEANING,ZGENENATURALHEARINGKITE,ZGENERALRESORTSKYOPEN,ZLETTUCEBIRDMEETDEBATE,ZBASEGOUDAREGULARFORGIVE,ZCHARGECLICKHUMANEHIRE,ZPLANETFAMILYPUREMEMORY,ZMINORWAYPAPERCLASSY,ZCAPYEARLYRIVETBRUSH,ZSIZETOEAWARDFRESH,ZARSENICSAMPLEWAITMUON,ZSQUAREGLEEFULCHILDLIGHT,ZSHINYASSISTLIVINGCRAB,ZCORNERANCHORTAPEDIVER,ZDECADEJOYOUSWAVEHABIT,ZTRAVELDRIVERCONTESTLILY,ZFLYINGDOCTORTABLEMELODY,ZSHARKJUSTFRUITMOVIE,ZFAMILYVISUALOWNERMATTER,ZFARMERMORNINGMIRRORCONCERN,ZGIFTICEFISHGLUEHAIR,ZOUTSIDEPEAHENCOUNTICE,ZSPREADMOTORBISCUITBACON,ZWISHHITSKINMOTOR,ZHOLIDAYHEADPONYDETAIL,ZWOODPOETRYCOBBLERBENCH,ZAIRFORGIVEHEADFROG,ZBROWBALANCEKEYCHOWDER,ZDISHKEEPBLESTMONITOR,ZCLAMBITARUGULAFAJITA,ZPLIERSPRINTASKOREGANO,ZRADIANTWHENTRYCARD,ZDELAYOUTCOMEHORNAGENCY,ZPURECAKEVIVIDNEATLY,ZPATTERNCLORINEGRANDCOLBY,ZHANDYREPAIRPROTONAIRPORT,ZAGEREEDFROGBASKET,ZSORTMISTYQUOTECABBAGE,ZFOOTTAPWORDENTRY,ZRESOLVEWRISTWRAPAPPLE,ZDILLASKHOKILEMON,ZFILLSTOPLAWJOYFUL,ZACTIONRANGEELEGANTNEUTRON,ZRESORTYARDGREENLET,ZCREAMEVENINGLIPBRANCH,ZWHALEMATHAVOCADOCOPPER,ZGRAYSURVEYWIRELOVE,ZBELLYCRASHITEMLACK,ZHANGERLITHIUMDINNERMEET,ZCARRYFLOORMINNOWDRAGON,ZMALLEQUIPTHANKSGLUE,ZTERMFITTINGHOUSINGCOMMAND,ZONERELEASEAVERAGENURSE,ZLACEADDRESSGROUNDCAREFUL FROM ZLOOKSLIKECOREDATA WHERE ZPK=?1;\x00IBBIIITIVVITBTBFBFITTFBTBVBVIFTBBFITFFVBIFIVBVVVBTVTIBBFFIVIBTBTVTTFTVTVFFIITIFBITFTTFFFVBIIBTTITFTFFVVVFIIITVBBVFFTVVB\x00BEGIN;CREATE TABLE t1(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TABLE t2(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TABLE t3(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE VIEW v1 AS SELECT rowid, i, t FROM t1;CREATE VIEW v2 AS SELECT rowid, i, t FROM t2;CREATE VIEW v3 AS SELECT rowid, i, t FROM t3;\x00INSERT INTO t%d VALUES(NULL,?1,?2)\x00CREATE INDEX i1 ON t1(t);CREATE INDEX i2 ON t2(t);CREATE INDEX i3 ON t3(t);COMMIT;\x00speed4p-join1\x00SELECT * FROM t1, t2, t3 WHERE t1.oid = t2.oid AND t2.oid = t3.oid\x00speed4p-join2\x00SELECT * FROM t1, t2, t3 WHERE t1.t = t2.t AND t2.t = t3.t\x00speed4p-view1\x00SELECT * FROM v%d WHERE rowid = ?\x00speed4p-table1\x00SELECT * FROM t%d WHERE rowid = ?\x00speed4p-subselect1\x00SELECT (SELECT t FROM t1 WHERE rowid = ?1),(SELECT t FROM t2 WHERE rowid = ?1),(SELECT t FROM t3 WHERE rowid = ?1)\x00speed4p-rowid-update\x00UPDATE t1 SET i=i+1 WHERE rowid=?1\x00CREATE TABLE t5(t TEXT PRIMARY KEY, i INTEGER);\x00speed4p-insert-ignore\x00INSERT OR IGNORE INTO t5 SELECT t, i FROM t1\x00CREATE TABLE log(op TEXT, r INTEGER, i INTEGER, t TEXT);CREATE TABLE t4(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);CREATE TRIGGER t4_trigger1 AFTER INSERT ON t4 BEGIN INSERT INTO log VALUES('INSERT INTO t4', new.rowid, new.i, new.t);END;CREATE TRIGGER t4_trigger2 AFTER UPDATE ON t4 BEGIN INSERT INTO log VALUES('UPDATE OF t4', new.rowid, new.i, new.t);END;CREATE TRIGGER t4_trigger3 AFTER DELETE ON t4 BEGIN INSERT INTO log VALUES('DELETE OF t4', old.rowid, old.i, old.t);END;BEGIN;\x00speed4p-trigger1\x00INSERT INTO t4 VALUES(NULL, ?1, ?2)\x00speed4p-trigger2\x00UPDATE t4 SET i = ?1, t = ?2 WHERE rowid = ?3\x00speed4p-trigger3\x00DELETE FROM t4 WHERE rowid = ?1\x00DROP TABLE t4;DROP TABLE log;VACUUM;CREATE TABLE t4(rowid INTEGER PRIMARY KEY, i INTEGER, t TEXT);BEGIN;\x00speed4p-notrigger1\x00speed4p-notrigger2\x00speed4p-notrigger3\x00%5d %5d %5d %s\n\x00/proc/%d/io\x00rb\x00-- %-28s %s\x00rchar: \x00Bytes received by read():\x00wchar: \x00Bytes sent to write():\x00syscr: \x00Read() system calls:\x00syscw: \x00Write() system calls:\x00read_bytes: \x00Bytes rcvd from storage:\x00write_bytes: \x00Bytes sent to storage:\x00cancelled_write_bytes: \x00Cancelled write bytes:\x00-- Compile option: %s\n\x00main\x00-- Speedtest1 for SQLite %s %.48s\n\x00UNIQUE\x00autovacuum\x00cachesize\x00missing argument on %s\n\x00exclusive\x00checkpoint\x00explain\x00heap\x00missing arguments on %s\n\x00incrvacuum\x00journal\x00key\x00lookaside\x00memdb\x00multithread\x00nomemstat\x00mmap\x00nosync\x00notnull\x00NOT NULL\x00output\x00-\x00wb\x00cannot open \"%s\" for writing\n\x00pagesize\x00pcache\x00primarykey\x00PRIMARY KEY\x00repeat\x00reprepare\x00serialized\x00singlethread\x00sqlonly\x00shrink-memory\x00size\x00stats\x00temp\x00argument to --temp should be integer between 0 and 9\x00testset\x00trace\x00threads\x00utf16le\x00utf16be\x00verify\x00without-rowid\x00help\x00?\x00unknown option: %s\nUse \"%s -?\" for help\n\x00surplus argument: %s\nUse \"%s -?\" for help\n\x00cannot allocate %d-byte heap\n\x00heap configuration failed: %d\n\x00cannot allocate %lld-byte pcache\n\x00pcache configuration failed: %d\n\x00:memory:\x00Cannot open database file: %s\n\x00lookaside configuration failed: %d\n\x00random\x00PRAGMA temp_store=memory\x00PRAGMA mmap_size=%d\x00PRAGMA threads=%d\x00PRAGMA key('%s')\x00PRAGMA encoding=%s\x00PRAGMA auto_vacuum=FULL\x00PRAGMA auto_vacuum=INCREMENTAL\x00PRAGMA page_size=%d\x00PRAGMA cache_size=%d\x00PRAGMA synchronous=OFF\x00PRAGMA locking_mode=EXCLUSIVE\x00PRAGMA journal_mode=%s\x00.explain\n.echo on\n\x00 Begin testset \"%s\"\n\x00debug1\x00orm\x00cte\x00fp\x00trigger\x00rtree\x00unknown testset: \"%s\"\nChoices: cte debug1 fp main orm rtree trigger\n\x00Reset the database\x00SELECT name FROM main.sqlite_master WHERE sql LIKE 'CREATE %%TABLE%%'\x00DROP TABLE main.\"%w\"\x00SELECT name FROM temp.sqlite_master WHERE sql LIKE 'CREATE %%TABLE%%'\x00PRAGMA compile_options\x00-- Lookaside Slots Used: %d (max %d)\n\x00-- Successful lookasides: %d\n\x00-- Lookaside size faults: %d\n\x00-- Lookaside OOM faults: %d\n\x00-- Pager Heap Usage: %d bytes\n\x00-- Page cache hits: %d\n\x00-- Page cache misses: %d\n\x00-- Page cache writes: %d\n\x00-- Schema Heap Usage: %d bytes\n\x00-- Statement Heap Usage: %d bytes\n\x00-- Memory Used (bytes): %d (max %d)\n\x00-- Outstanding Allocations: %d (max %d)\n\x00-- Pcache Overflow Bytes: %d (max %d)\n\x00-- Largest Allocation: %d bytes\n\x00-- Largest Pcache Allocation: %d bytes\n\x00"
var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data
diff --git a/sqlite.go b/sqlite.go
index e193d0d..6b40b7a 100644
--- a/sqlite.go
+++ b/sqlite.go
@@ -13,20 +13,20 @@ import (
"database/sql/driver"
"fmt"
"io"
- "os"
- "runtime"
- "strings"
"time"
"unsafe"
- "modernc.org/crt/v3"
+ "modernc.org/libc"
+ "modernc.org/libc/sys/types"
"modernc.org/sqlite/lib"
)
var (
- _ driver.Conn = (*conn)(nil)
- _ driver.Driver = (*Driver)(nil)
- _ driver.Execer = (*conn)(nil)
+ _ driver.Conn = (*conn)(nil)
+ _ driver.Driver = (*Driver)(nil)
+ //lint:ignore SA1019 TODO implement ExecerContext
+ _ driver.Execer = (*conn)(nil)
+ //lint:ignore SA1019 TODO implement QueryerContext
_ driver.Queryer = (*conn)(nil)
_ driver.Result = (*result)(nil)
_ driver.Rows = (*rows)(nil)
@@ -41,45 +41,6 @@ const (
sqliteLockedSharedcache = sqlite3.SQLITE_LOCKED | (1 << 8)
)
-func origin(skip int) string {
- pc, fn, fl, _ := runtime.Caller(skip)
- f := runtime.FuncForPC(pc)
- var fns string
- if f != nil {
- fns = f.Name()
- if x := strings.LastIndex(fns, "."); x > 0 {
- fns = fns[x+1:]
- }
- }
- return fmt.Sprintf("%s:%d:%s", fn, fl, fns)
-}
-
-func todo(s string, args ...interface{}) string { //TODO-
- switch {
- case s == "":
- s = fmt.Sprintf(strings.Repeat("%v ", len(args)), args...)
- default:
- s = fmt.Sprintf(s, args...)
- }
- r := fmt.Sprintf("%s: TODOTODO %s", origin(2), s) //TODOOK
- fmt.Fprintf(os.Stdout, "%s\n", r)
- os.Stdout.Sync()
- return r
-}
-
-func trc(s string, args ...interface{}) string { //TODO-
- switch {
- case s == "":
- s = fmt.Sprintf(strings.Repeat("%v ", len(args)), args...)
- default:
- s = fmt.Sprintf(s, args...)
- }
- r := fmt.Sprintf("\n%s: TRC %s", origin(2), s)
- fmt.Fprintf(os.Stdout, "%s\n", r)
- os.Stdout.Sync()
- return r
-}
-
// Error represents sqlite library error code.
type Error struct {
msg string
@@ -147,24 +108,25 @@ var (
)
func init() {
- tls := crt.NewTLS()
+ //TODO configure page size to 4096
+ tls := libc.NewTLS()
if sqlite3.Xsqlite3_threadsafe(tls) == 0 {
panic(fmt.Errorf("sqlite: thread safety configuration error"))
}
- varArgs := crt.Xmalloc(tls, crt.Size_t(ptrSize))
+ varArgs := libc.Xmalloc(tls, types.Size_t(ptrSize))
if varArgs == 0 {
panic(fmt.Errorf("cannot allocate memory"))
}
// int sqlite3_config(int, ...);
- if rc := sqlite3.Xsqlite3_config(tls, sqlite3.SQLITE_CONFIG_MUTEX, crt.VaList(varArgs, uintptr(unsafe.Pointer(&mutexMethods)))); rc != sqlite3.SQLITE_OK {
+ if rc := sqlite3.Xsqlite3_config(tls, sqlite3.SQLITE_CONFIG_MUTEX, libc.VaList(varArgs, uintptr(unsafe.Pointer(&mutexMethods)))); rc != sqlite3.SQLITE_OK {
p := sqlite3.Xsqlite3_errstr(tls, rc)
- str := crt.GoString(p)
+ str := libc.GoString(p)
panic(fmt.Errorf("sqlite: failed to configure mutex methods: %v", str))
}
- crt.Xfree(tls, varArgs)
+ libc.Xfree(tls, varArgs)
tls.Close()
sql.Register(driverName, newDriver())
}
@@ -334,7 +296,7 @@ type stmt struct {
}
func newStmt(c *conn, sql string) (*stmt, error) {
- p, err := crt.CString(sql)
+ p, err := libc.CString(sql)
if err != nil {
return nil, err
}
@@ -389,7 +351,7 @@ func (s *stmt) exec(ctx context.Context, args []driver.NamedValue) (r driver.Res
close(donech)
}()
- for psql := s.psql; *(*byte)(unsafe.Pointer(uintptr(psql))) != 0; {
+ for psql := s.psql; *(*byte)(unsafe.Pointer(psql)) != 0; {
if pstmt, err = s.c.prepareV2(&psql); err != nil {
return nil, err
}
@@ -539,7 +501,7 @@ func (s *stmt) query(ctx context.Context, args []driver.NamedValue) (r driver.Ro
return s.c.errstr(int32(rc))
}
- if *(*byte)(unsafe.Pointer(uintptr(psql))) == 0 {
+ if *(*byte)(unsafe.Pointer(psql)) == 0 {
if r, err = newRows(s.c, pstmt, allocs, true); err != nil {
return err
}
@@ -578,7 +540,7 @@ func (t *tx) Rollback() (err error) {
}
func (t *tx) exec(ctx context.Context, sql string) (err error) {
- psql, err := crt.CString(sql)
+ psql, err := libc.CString(sql)
if err != nil {
return err
}
@@ -607,11 +569,11 @@ func (t *tx) exec(ctx context.Context, sql string) (err error) {
type conn struct {
db uintptr // *sqlite3.Xsqlite3
- tls *crt.TLS
+ tls *libc.TLS
}
func newConn(name string) (*conn, error) {
- c := &conn{tls: crt.NewTLS()}
+ c := &conn{tls: libc.NewTLS()}
db, err := c.openV2(
name,
sqlite3.SQLITE_OPEN_READWRITE|sqlite3.SQLITE_OPEN_CREATE|
@@ -645,7 +607,7 @@ func (c *conn) columnBlob(pstmt uintptr, iCol int) (v []byte, err error) {
}
v = make([]byte, len)
- copy(v, (*crt.RawMem)(unsafe.Pointer(uintptr(p)))[:len])
+ copy(v, (*libc.RawMem)(unsafe.Pointer(p))[:len:len])
return v, nil
}
@@ -668,7 +630,7 @@ func (c *conn) columnText(pstmt uintptr, iCol int) (v string, err error) {
}
b := make([]byte, len)
- copy(b, (*crt.RawMem)(unsafe.Pointer(uintptr(p)))[:len])
+ copy(b, (*libc.RawMem)(unsafe.Pointer(p))[:len:len])
return string(b), nil
}
@@ -693,7 +655,7 @@ func (c *conn) columnType(pstmt uintptr, iCol int) (_ int, err error) {
// const char *sqlite3_column_name(sqlite3_stmt*, int N);
func (c *conn) columnName(pstmt uintptr, n int) (string, error) {
p := sqlite3.Xsqlite3_column_name(c.tls, pstmt, int32(n))
- return crt.GoString(p), nil
+ return libc.GoString(p), nil
}
// int sqlite3_column_count(sqlite3_stmt *pStmt);
@@ -729,23 +691,23 @@ func (c *conn) step(pstmt uintptr) (int, error) {
func (c *conn) retry(pstmt uintptr) error {
mu := mutexAlloc(c.tls, sqlite3.SQLITE_MUTEX_FAST)
- (*mutex)(unsafe.Pointer(uintptr(mu))).enter(c.tls.ID) // Block
+ (*mutex)(unsafe.Pointer(mu)).enter(c.tls.ID) // Block
rc := sqlite3.Xsqlite3_unlock_notify(
c.tls,
c.db,
*(*uintptr)(unsafe.Pointer(&struct {
- f func(*crt.TLS, crt.Intptr, int32)
+ f func(*libc.TLS, uintptr, int32)
}{unlockNotify})),
mu,
)
if rc == sqlite3.SQLITE_LOCKED { // Deadlock, see https://www.sqlite.org/c3ref/unlock_notify.html
- (*mutex)(unsafe.Pointer(uintptr(mu))).leave(c.tls.ID) // Clear
+ (*mutex)(unsafe.Pointer(mu)).leave(c.tls.ID) // Clear
mutexFree(c.tls, mu)
return c.errstr(rc)
}
- (*mutex)(unsafe.Pointer(uintptr(mu))).enter(c.tls.ID) // Wait
- (*mutex)(unsafe.Pointer(uintptr(mu))).leave(c.tls.ID) // Clear
+ (*mutex)(unsafe.Pointer(mu)).enter(c.tls.ID) // Wait
+ (*mutex)(unsafe.Pointer(mu)).leave(c.tls.ID) // Clear
mutexFree(c.tls, mu)
if pstmt != 0 {
sqlite3.Xsqlite3_reset(c.tls, pstmt)
@@ -753,11 +715,11 @@ func (c *conn) retry(pstmt uintptr) error {
return nil
}
-func unlockNotify(t *crt.TLS, ppArg crt.Intptr, nArg int32) {
+func unlockNotify(t *libc.TLS, ppArg uintptr, nArg int32) {
for i := int32(0); i < nArg; i++ {
- mu := *(*crt.Intptr)(unsafe.Pointer(uintptr(ppArg)))
- (*mutex)(unsafe.Pointer(uintptr(mu))).leave(t.ID) // Signal
- ppArg += crt.Intptr(ptrSize)
+ mu := *(*uintptr)(unsafe.Pointer(ppArg))
+ (*mutex)(unsafe.Pointer(mu)).leave(t.ID) // Signal
+ ppArg += ptrSize
}
}
@@ -847,7 +809,7 @@ func (c *conn) bind(pstmt uintptr, n int, args []driver.NamedValue) (allocs []ui
// int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
func (c *conn) bindText(pstmt uintptr, idx1 int, value string) (uintptr, error) {
- p, err := crt.CString(value)
+ p, err := libc.CString(value)
if err != nil {
return 0, err
}
@@ -867,7 +829,7 @@ func (c *conn) bindBlob(pstmt uintptr, idx1 int, value []byte) (uintptr, error)
return 0, err
}
- copy((*crt.RawMem)(unsafe.Pointer(uintptr(p)))[:len(value)], value)
+ copy((*libc.RawMem)(unsafe.Pointer(p))[:len(value):len(value)], value)
if rc := sqlite3.Xsqlite3_bind_blob(c.tls, pstmt, int32(idx1), p, int32(len(value)), 0); rc != sqlite3.SQLITE_OK {
c.free(p)
return 0, c.errstr(rc)
@@ -906,7 +868,7 @@ func (c *conn) bindInt64(pstmt uintptr, idx1 int, value int64) (err error) {
// const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);
func (c *conn) bindParameterName(pstmt uintptr, i int) (string, error) {
p := sqlite3.Xsqlite3_bind_parameter_name(c.tls, pstmt, int32(i))
- return crt.GoString(p), nil
+ return libc.GoString(p), nil
}
// int sqlite3_bind_parameter_count(sqlite3_stmt*);
@@ -970,7 +932,7 @@ func (c *conn) interrupt(pdb uintptr) (err error) {
// int sqlite3_extended_result_codes(sqlite3*, int onoff);
func (c *conn) extendedResultCodes(on bool) error {
- if rc := sqlite3.Xsqlite3_extended_result_codes(c.tls, c.db, crt.Bool32(on)); rc != sqlite3.SQLITE_OK {
+ if rc := sqlite3.Xsqlite3_extended_result_codes(c.tls, c.db, libc.Bool32(on)); rc != sqlite3.SQLITE_OK {
return c.errstr(rc)
}
@@ -1000,7 +962,7 @@ func (c *conn) openV2(name string, flags int32) (uintptr, error) {
return 0, err
}
- if s, err = crt.CString(name); err != nil {
+ if s, err = libc.CString(name); err != nil {
return 0, err
}
@@ -1008,11 +970,11 @@ func (c *conn) openV2(name string, flags int32) (uintptr, error) {
return 0, c.errstr(rc)
}
- return *(*uintptr)(unsafe.Pointer(uintptr(p))), nil
+ return *(*uintptr)(unsafe.Pointer(p)), nil
}
func (c *conn) malloc(n int) (uintptr, error) {
- if p := crt.Xmalloc(c.tls, crt.Size_t(n)); p != 0 {
+ if p := libc.Xmalloc(c.tls, types.Size_t(n)); p != 0 {
return p, nil
}
@@ -1021,16 +983,16 @@ func (c *conn) malloc(n int) (uintptr, error) {
func (c *conn) free(p uintptr) {
if p != 0 {
- crt.Xfree(c.tls, p)
+ libc.Xfree(c.tls, p)
}
}
// const char *sqlite3_errstr(int);
func (c *conn) errstr(rc int32) error {
p := sqlite3.Xsqlite3_errstr(c.tls, rc)
- str := crt.GoString(p)
+ str := libc.GoString(p)
p = sqlite3.Xsqlite3_errmsg(c.tls, c.db)
- switch msg := crt.GoString(p); {
+ switch msg := libc.GoString(p); {
case msg == str:
return &Error{msg: fmt.Sprintf("%s (%v)", str, rc), code: int(rc)}
default:
diff --git a/tcl_test.go b/tcl_test.go
new file mode 100644
index 0000000..abdad96
--- /dev/null
+++ b/tcl_test.go
@@ -0,0 +1,118 @@
+// Copyright 2020 The Sqlite Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build cgo
+
+package sqlite // import "modernc.org/sqlite"
+
+import (
+ "flag"
+ "fmt"
+ "io/ioutil"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "runtime"
+ "strings"
+ "testing"
+
+ "modernc.org/tcl"
+)
+
+var (
+ oMaxError = flag.Uint("maxerror", 0, "argument of -maxerror passed to the Tcl test suite")
+ oStart = flag.String("start", "", "argument of -start passed to the Tcl test suite (--start=[$permutation:]$testfile)")
+ oTclSuite = flag.String("suite", "full", "Tcl test suite [test-file] to run")
+ oVerbose = flag.String("verbose", "0", "argument of -verbose passed to the Tcl test suite, must be set to a boolean (0, 1) or to \"file\"")
+)
+
+func TestTclTest(t *testing.T) {
+ blacklist := map[string]struct{}{}
+ m, err := filepath.Glob(filepath.FromSlash("testdata/tcl/*"))
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ dir, err := ioutil.TempDir("", "sqlite-test-")
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ defer os.RemoveAll(dir)
+
+ testfixture := filepath.Join(dir, "testfixture")
+ args0 := []string{"build", "-o", testfixture}
+ tags := "-tags=libc.nofsync"
+ if s := *oXTags; s != "" {
+ tags += "," + s
+ }
+ args0 = append(args0, tags, "modernc.org/sqlite/internal/testfixture")
+ cmd := exec.Command("go", args0...)
+ if out, err := cmd.CombinedOutput(); err != nil {
+ t.Fatalf("%s\n%v", out, err)
+ }
+
+ wd, err := os.Getwd()
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ defer os.Chdir(wd)
+
+ if err := os.Chdir(dir); err != nil {
+ t.Fatal(err)
+ }
+
+ for _, v := range m {
+ if _, ok := blacklist[filepath.Base(v)]; ok {
+ continue
+ }
+
+ s := filepath.Join(wd, v)
+ d := filepath.Join(dir, filepath.Base(v))
+ f, err := ioutil.ReadFile(s)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := ioutil.WriteFile(d, f, 0660); err != nil {
+ t.Fatal(err)
+ }
+ }
+
+ library := filepath.Join(dir, "library")
+ if err := tcl.Library(library); err != nil {
+ t.Fatal(err)
+ }
+
+ os.Setenv("TCL_LIBRARY", library)
+ var args []string
+ switch s := *oTclSuite; s {
+ case "":
+ args = []string{"all.test"}
+ default:
+ a := strings.Split(s, " ")
+ args = append([]string{"permutations.test"}, a...)
+ }
+ if *oVerbose != "" {
+ args = append(args, fmt.Sprintf("-verbose=%s", *oVerbose))
+ }
+ if *oMaxError != 0 {
+ args = append(args, fmt.Sprintf("-maxerror=%d", *oMaxError))
+ }
+ if *oStart != "" {
+ args = append(args, fmt.Sprintf("-start=%s", *oStart))
+ }
+ switch runtime.GOOS {
+ case "windows":
+ panic(todo(""))
+ default:
+ os.Setenv("PATH", fmt.Sprintf("%s:%s", dir, os.Getenv("PATH")))
+ }
+ cmd = exec.Command(testfixture, args...)
+ cmd.Stdout = os.Stdout
+ cmd.Stderr = os.Stderr
+ if err := cmd.Run(); err != nil {
+ t.Fatal(err)
+ }
+}
diff --git a/testdata/.gitignore b/testdata/.gitignore
index c69a055..8da9ddb 100644
--- a/testdata/.gitignore
+++ b/testdata/.gitignore
@@ -1 +1,2 @@
sqlite-*
+SQLite-*
diff --git a/testdata/tcl/altertab.test b/testdata/tcl/altertab.test
index c99010d..435620d 100644
--- a/testdata/tcl/altertab.test
+++ b/testdata/tcl/altertab.test
@@ -658,5 +658,23 @@ do_catchsql_test 21.3 {
ALTER TABLE a RENAME TO e;
} {1 {error in view c: 1st ORDER BY term does not match any column in the result set}}
+# After forum thread https://sqlite.org/forum/forumpost/ddbe1c7efa
+# Ensure that PRAGMA schema_version=N causes a full schema reload.
+#
+reset_db
+do_execsql_test 22.0 {
+ CREATE TABLE t1(a INT, b TEXT NOT NULL);
+ INSERT INTO t1 VALUES(1,2),('a','b');
+ BEGIN;
+ PRAGMA writable_schema=ON;
+ UPDATE sqlite_schema SET sql='CREATE TABLE t1(a INT, b TEXT)' WHERE name LIKE 't1';
+ PRAGMA schema_version=1234;
+ COMMIT;
+ PRAGMA integrity_check;
+} {ok}
+do_execsql_test 22.1 {
+ ALTER TABLE t1 ADD COLUMN c INT DEFAULT 78;
+ SELECT * FROM t1;
+} {1 2 78 a b 78}
finish_test
diff --git a/testdata/tcl/altertab3.test b/testdata/tcl/altertab3.test
index b390655..005a0ee 100644
--- a/testdata/tcl/altertab3.test
+++ b/testdata/tcl/altertab3.test
@@ -586,5 +586,19 @@ do_execsql_test 24.4 {
DELETE FROM v2;
END}}
+#------------------------------------------------------------------------
+#
+reset_db
+do_execsql_test 25.1 {
+ CREATE TABLE t1(a, b, c);
+ CREATE TABLE t2(a, b, c);
+ CREATE TRIGGER ttt AFTER INSERT ON t1 BEGIN
+ UPDATE t1 SET a=t2.a FROM t2 WHERE t1.a=t2.a;
+ END;
+}
+#do_execsql_test 25.2 {
+# ALTER TABLE t2 RENAME COLUMN a TO aaa;
+#}
+
finish_test
diff --git a/testdata/tcl/busy2.test b/testdata/tcl/busy2.test
new file mode 100644
index 0000000..fb9ef23
--- /dev/null
+++ b/testdata/tcl/busy2.test
@@ -0,0 +1,135 @@
+# 2020 June 30
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+# This file test the busy handler
+#
+
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+source $testdir/lock_common.tcl
+set testprefix busy2
+
+do_multiclient_test tn {
+ do_test 1.$tn.0 {
+ sql2 {
+ CREATE TABLE t1(a, b);
+ PRAGMA journal_mode = wal;
+ INSERT INTO t1 VALUES('A', 'B');
+ }
+ } {wal}
+
+ do_test 1.$tn.1 {
+ code1 { db timeout 1000 }
+ sql1 { SELECT * FROM t1 }
+ } {A B}
+
+ do_test 1.$tn.2 {
+ sql2 {
+ BEGIN;
+ INSERT INTO t1 VALUES('C', 'D');
+ }
+ } {}
+
+ do_test 1.$tn.3 {
+ set us [lindex [time { catch { sql1 { BEGIN EXCLUSIVE } } }] 0]
+ expr {$us>950000 && $us<1500000}
+ } {1}
+
+ do_test 1.$tn.4 {
+ sql2 {
+ COMMIT
+ }
+ } {}
+}
+
+#-------------------------------------------------------------------------
+
+do_multiclient_test tn {
+ # Make the db a WAL mode db. And add a table and a row to it. Then open
+ # a second connection within process 1. Process 1 now has connections
+ # [db] and [db1.2], process 2 has connection [db2] only.
+ #
+ # Configure all connections to use a 1000 ms timeout.
+ #
+ do_test 2.$tn.0 {
+ code1 {
+ sqlite3 db1.2 test.db
+ }
+ sql1 {
+ PRAGMA auto_vacuum = off;
+ PRAGMA journal_mode = wal;
+ CREATE TABLE t1(a, b);
+ INSERT INTO t1 VALUES(1, 2);
+ }
+ code2 {
+ db2 timeout 1000
+ }
+ code1 {
+ db1.2 timeout 1000
+ db timeout 1000
+ db1.2 eval {SELECT * FROM t1}
+ }
+ } {1 2}
+
+ # Take a read lock with [db] in process 1.
+ #
+ do_test 2.$tn.1 {
+ sql1 {
+ BEGIN;
+ SELECT * FROM t1;
+ }
+ } {1 2}
+
+ # Insert a row using [db2] in process 2. Then try a passive checkpoint.
+ # It fails to checkpoint the final frame (due to the readlock taken by
+ # [db]), and returns in less than 250ms.
+ do_test 2.$tn.2 {
+ sql2 { INSERT INTO t1 VALUES(3, 4) }
+ set us [lindex [time {
+ set res [code2 { db2 eval { PRAGMA wal_checkpoint } }]
+ }] 0]
+ list [expr $us < 250000] $res
+ } {1 {0 4 3}}
+
+ # Now try a FULL checkpoint with [db2]. It returns SQLITE_BUSY. And takes
+ # over 950ms to do so.
+ do_test 2.$tn.3 {
+ set us [lindex [time {
+ set res [code2 { db2 eval { PRAGMA wal_checkpoint = FULL } }]
+ }] 0]
+ list [expr $us > 950000] $res
+ } {1 {1 4 3}}
+
+ # Passive checkpoint with [db1.2] (process 1). No SQLITE_BUSY, returns
+ # in under 250ms.
+ do_test 2.$tn.4 {
+ set us [lindex [time {
+ set res [code1 { db1.2 eval { PRAGMA wal_checkpoint } }]
+ }] 0]
+ list [expr $us < 250000] $res
+ } {1 {0 4 3}}
+
+ # Full checkpoint with [db1.2] (process 1). SQLITE_BUSY returned in
+ # a bit over 950ms.
+ do_test 2.$tn.5 {
+ set us [lindex [time {
+ set res [code1 { db1.2 eval { PRAGMA wal_checkpoint = FULL } }]
+ }] 0]
+ list [expr $us > 950000] $res
+ } {1 {1 4 3}}
+
+ code1 {
+ db1.2 close
+ }
+}
+
+finish_test
+
diff --git a/testdata/tcl/corrupt3.test b/testdata/tcl/corrupt3.test
index 3c911da..7a2e174 100644
--- a/testdata/tcl/corrupt3.test
+++ b/testdata/tcl/corrupt3.test
@@ -94,7 +94,7 @@ do_test corrupt3-1.9 {
catchsql {
SELECT substr(x,1,10) FROM t1
}
-} [list 0 0123456789]
+} [list 1 {database disk image is malformed}]
do_test corrupt3-1.10 {
catchsql {
PRAGMA integrity_check
diff --git a/testdata/tcl/corruptL.test b/testdata/tcl/corruptL.test
index 3c26f1d..9af9fd2 100644
--- a/testdata/tcl/corruptL.test
+++ b/testdata/tcl/corruptL.test
@@ -1174,6 +1174,7 @@ do_test 14.0 {
| end clusterfuzz-testcase-minimized-sqlite3_dbfuzz2_fuzzer-4806406219825152
}]} {}
+extra_schema_checks 0
do_catchsql_test 14.1 {
PRAGMA integrity_check;
} {1 {database disk image is malformed}}
@@ -1181,6 +1182,7 @@ do_catchsql_test 14.1 {
do_catchsql_test 14.2 {
ALTER TABLE t1 RENAME TO alkjalkjdfiiiwuer987lkjwer82mx97sf98788s9789s;
} {1 {database disk image is malformed}}
+extra_schema_checks 1
#-------------------------------------------------------------------------
reset_db
@@ -1263,8 +1265,77 @@ do_test 15.0 {
| end crash-3afa1ca9e9c1bd.db
}]} {}
+extra_schema_checks 0
do_execsql_test 15.1 {
+ PRAGMA cell_size_check = 0;
UPDATE c1 SET c= NOT EXISTS(SELECT 1 FROM c1 ORDER BY (SELECT 1 FROM c1 ORDER BY a)) +10 WHERE d BETWEEN 4 AND 7;
} {}
-finish_test
+extra_schema_checks 1
+
+#-------------------------------------------------------------------------
+reset_db
+do_execsql_test 16.0 {
+ CREATE TABLE t1(w, x, y, z, UNIQUE(w, x), UNIQUE(y, z));
+ INSERT INTO t1 VALUES(1, 1, 1, 1);
+
+ CREATE TABLE t1idx(x, y, i INTEGER, PRIMARY KEY(x)) WITHOUT ROWID;
+ INSERT INTO t1idx VALUES(10, NULL, 5);
+ PRAGMA writable_schema = 1;
+ UPDATE sqlite_master SET rootpage = (
+ SELECT rootpage FROM sqlite_master WHERE name='t1idx'
+ ) WHERE type = 'index';
+}
+
+extra_schema_checks 0
+db close
+sqlite3 db test.db
+extra_schema_checks 1
+
+do_catchsql_test 16.1 {
+ PRAGMA writable_schema = ON;
+ INSERT INTO t1(rowid, w, x, y, z) VALUES(5, 10, 11, 10, NULL);
+} {1 {database disk image is malformed}}
+
+#-------------------------------------------------------------------------
+# Test that corruption is reported from within a checkpoint if the
+# expected final size of the database (according to the last commit
+# frame in the wal file) is greater than the combined initial sizes
+# of the database and wal file.
+#
+if {[wal_is_capable]} {
+ reset_db
+ do_execsql_test 17.0 {
+ CREATE TABLE t1(o INTEGER PRIMARY KEY, t UNIQUE);
+ INSERT INTO t1(t) VALUES(randomblob(123));
+ INSERT INTO t1(t) SELECT randomblob(123) FROM t1;
+ INSERT INTO t1(t) SELECT randomblob(123) FROM t1;
+ INSERT INTO t1(t) SELECT randomblob(123) FROM t1;
+ INSERT INTO t1(t) SELECT randomblob(123) FROM t1;
+ INSERT INTO t1(t) SELECT randomblob(123) FROM t1;
+ INSERT INTO t1(t) SELECT randomblob(123) FROM t1;
+ INSERT INTO t1(t) SELECT randomblob(123) FROM t1;
+ INSERT INTO t1(t) SELECT randomblob(123) FROM t1;
+ INSERT INTO t1(t) SELECT randomblob(123) FROM t1;
+
+ PRAGMA journal_mode = wal;
+ INSERT INTO t1 VALUES(-1, 'b');
+ } {wal}
+
+ do_test 17.1 {
+ set fd [open test.db r+]
+ chan truncate $fd 2048
+ file size test.db
+ } {2048}
+
+ do_catchsql_test 17.2 {
+ PRAGMA wal_checkpoint
+ } {1 {database disk image is malformed}}
+
+ do_test 17.3 {
+ close $fd
+ } {}
+}
+
+
+finish_test
diff --git a/testdata/tcl/cost.test b/testdata/tcl/cost.test
index 2922a0a..592973a 100644
--- a/testdata/tcl/cost.test
+++ b/testdata/tcl/cost.test
@@ -230,10 +230,10 @@ do_test 9.2 {
set L [list a=? b=? c=? d=? e=? f=? g=? h=? i=? j=?]
foreach {tn nTerm nRow} {
1 1 10
- 2 2 9
+ 2 2 10
3 3 8
4 4 7
- 5 5 6
+ 5 5 7
6 6 5
7 7 5
8 8 5
diff --git a/testdata/tcl/dbfuzz001.test b/testdata/tcl/dbfuzz001.test
index 7ef4cd2..2a430de 100644
--- a/testdata/tcl/dbfuzz001.test
+++ b/testdata/tcl/dbfuzz001.test
@@ -361,6 +361,7 @@ do_test dbfuzz001-310 {
}]
} {}
+extra_schema_checks 0
do_catchsql_test dbfuzz001-320 {
PRAGMA integrity_check;
} {1 {database disk image is malformed}}
@@ -368,5 +369,6 @@ do_catchsql_test dbfuzz001-320 {
do_catchsql_test dbfuzz001-330 {
DELETE FROM t3 WHERE x IN (SELECT x FROM t4);
} {1 {database disk image is malformed}}
+extra_schema_checks 1
finish_test
diff --git a/testdata/tcl/decimal.test b/testdata/tcl/decimal.test
new file mode 100644
index 0000000..a2e5799
--- /dev/null
+++ b/testdata/tcl/decimal.test
@@ -0,0 +1,186 @@
+# 2017 December 9
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix decimal
+
+if {[catch {load_static_extension db decimal} error]} {
+ puts "Skipping decimal tests, hit load error: $error"
+ finish_test; return
+}
+
+do_execsql_test 1000 {
+ SELECT decimal(1);
+} {1}
+do_execsql_test 1010 {
+ SELECT decimal(1.0);
+} {1.0}
+do_execsql_test 1020 {
+ SELECT decimal(0001.0);
+} {1.0}
+do_execsql_test 1030 {
+ SELECT decimal(+0001.0);
+} {1.0}
+do_execsql_test 1040 {
+ SELECT decimal(-0001.0);
+} {-1.0}
+do_execsql_test 1050 {
+ SELECT decimal(1.0e72);
+} {1000000000000000000000000000000000000000000000000000000000000000000000000}
+# 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123
+do_execsql_test 1060 {
+ SELECT decimal(1.0e-72);
+} {0.0000000000000000000000000000000000000000000000000000000000000000000000010}
+# 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123
+do_execsql_test 1070 {
+ SELECT decimal(-123e-4);
+} {-0.0123}
+do_execsql_test 1080 {
+ SELECT decimal(+123e+4);
+} {1230000.0}
+
+
+do_execsql_test 2000 {
+ CREATE TABLE t1(seq INTEGER PRIMARY KEY, val TEXT);
+ INSERT INTO t1 VALUES
+ (1, '-9999e99'),
+ (2, '-9998.000e+99'),
+ (3, '-9999.0'),
+ (4, '-1'),
+ (5, '-9999e-20'),
+ (6, '0'),
+ (7, '1e-30'),
+ (8, '1e-29'),
+ (9, '1'),
+ (10,'1.00000000000000001'),
+ (11,'+1.00001'),
+ (12,'99e+99');
+ SELECT *, '|'
+ FROM t1 AS a, t1 AS b
+ WHERE a.seq<b.seq
+ AND decimal_cmp(a.val,b.val)>=0;
+} {}
+do_execsql_test 2010 {
+ SELECT *, '|'
+ FROM t1 AS a, t1 AS b
+ WHERE a.seq<>b.seq
+ AND decimal_cmp(a.val,b.val)==0;
+} {}
+do_execsql_test 2020 {
+ SELECT *, '|'
+ FROM t1 AS a, t1 AS b
+ WHERE a.seq>b.seq
+ AND decimal_cmp(a.val,b.val)<=0;
+} {}
+do_execsql_test 2030 {
+ SELECT seq FROM t1 ORDER BY val COLLATE decimal;
+} {1 2 3 4 5 6 7 8 9 10 11 12}
+do_execsql_test 2040 {
+ SELECT seq FROM t1 ORDER BY val COLLATE decimal DESC;
+} {12 11 10 9 8 7 6 5 4 3 2 1}
+
+do_execsql_test 3000 {
+ CREATE TABLE t3(seq INTEGER PRIMARY KEY, val TEXT);
+ WITH RECURSIVE c(x) AS (VALUES(1) UNION SELECT x+1 FROM c WHERE x<10)
+ INSERT INTO t3(seq, val) SELECT x, x FROM c;
+ WITH RECURSIVE c(x) AS (VALUES(1) UNION SELECT x+1 FROM c WHERE x<5)
+ INSERT INTO t3(seq, val) SELECT x+10, x*1000 FROM c;
+ SELECT decimal(val) FROM t3 ORDER BY seq;
+} {1 2 3 4 5 6 7 8 9 10 1000 2000 3000 4000 5000}
+do_execsql_test 3020 {
+ SELECT decimal_add(val,'0.5') FROM t3 WHERE seq>5 ORDER BY seq
+} {6.5 7.5 8.5 9.5 10.5 1000.5 2000.5 3000.5 4000.5 5000.5}
+do_execsql_test 3030 {
+ SELECT decimal_add(val,'-10') FROM t3 ORDER BY seq;
+} {-9 -8 -7 -6 -5 -4 -3 -2 -1 0 990 1990 2990 3990 4990}
+
+do_execsql_test 4000 {
+ SELECT decimal_sum(val) FROM t3;
+} {15055}
+do_execsql_test 4010 {
+ SELECT decimal_sum(decimal_add(val,val||'e+10')) FROM t3;
+} {150550000015055}
+do_execsql_test 4010 {
+ SELECT decimal_sum(decimal_add(val||'e+20',decimal_add(val,val||'e-20')))
+ FROM t3;
+} {1505500000000000000015055.00000000000000015055}
+
+do_execsql_test 5000 {
+ WITH RECURSIVE c(x,y,z) AS (
+ VALUES(0,'1','1')
+ UNION ALL
+ SELECT x+1, decimal_mul(y,'2'), decimal_mul(z,'0.5')
+ FROM c WHERE x<32
+ )
+ SELECT count(*) FROM c WHERE decimal_mul(y,z)='1';
+} {33}
+
+do_execsql_test 5100 {
+ SELECT decimal_mul('1234.00','2.00');
+} {2468.00}
+do_execsql_test 5101 {
+ SELECT decimal_mul('1234.00','2.0000');
+} {2468.00}
+do_execsql_test 5102 {
+ SELECT decimal_mul('1234.0000','2.000');
+} {2468.000}
+do_execsql_test 5103 {
+ SELECT decimal_mul('1234.0000','2');
+} {2468}
+
+if {[catch {load_static_extension db ieee754} error]} {
+ puts "Skipping ieee754 tests, hit load error: $error"
+ finish_test; return
+}
+
+do_execsql_test 6000 {
+ CREATE TABLE pow2(x INTEGER PRIMARY KEY, v TEXT);
+ WITH RECURSIVE c(x,v) AS (
+ VALUES(0,'1')
+ UNION ALL
+ SELECT x+1, decimal_mul(v,'2') FROM c WHERE x+1<=971
+ ) INSERT INTO pow2(x,v) SELECT x, v FROM c;
+ WITH RECURSIVE c(x,v) AS (
+ VALUES(-1,'0.5')
+ UNION ALL
+ SELECT x-1, decimal_mul(v,'0.5') FROM c WHERE x-1>=-1075
+ ) INSERT INTO pow2(x,v) SELECT x, v FROM c;
+} {}
+do_execsql_test 6010 {
+ WITH c(n) AS (SELECT ieee754_from_blob(x'0000000000000001'))
+SELECT decimal_mul(ieee754_mantissa(c.n),pow2.v)
+ FROM pow2, c WHERE pow2.x=ieee754_exponent(c.n);
+} {0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625}
+do_execsql_test 6020 {
+ WITH c(n) AS (SELECT ieee754_from_blob(x'7fefffffffffffff'))
+SELECT decimal_mul(ieee754_mantissa(c.n),pow2.v)
+ FROM pow2, c WHERE pow2.x=ieee754_exponent(c.n);
+} {179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368}
+
+do_execsql_test 6100 {
+ SELECT ieee754(ieee754_from_blob(x'0000000000000001'));
+} {ieee754(1,-1074)}
+do_execsql_test 6110 {
+ SELECT ieee754(ieee754_from_blob(x'7fefffffffffffff'));
+} {ieee754(9007199254740991,971)}
+do_execsql_test 6120 {
+ SELECT printf('%.8e',ieee754_from_blob(x'0000000000000001'));
+} {4.94065646e-324}
+do_execsql_test 6130 {
+ SELECT printf('%.8e',ieee754_from_blob(x'ffefffffffffffff'));
+} {-1.79769313e+308}
+
+
+
+
+finish_test
diff --git a/testdata/tcl/e_droptrigger.test b/testdata/tcl/e_droptrigger.test
index 84dfe72..5cd5d0a 100644
--- a/testdata/tcl/e_droptrigger.test
+++ b/testdata/tcl/e_droptrigger.test
@@ -127,8 +127,8 @@ foreach {tn tbl droptrigger before after} {
} $after
}
-# EVIDENCE-OF: R-50239-29811 Once removed, the trigger definition is no
-# longer present in the sqlite_master (or sqlite_temp_master) table and
+# EVIDENCE-OF: R-04950-25529 Once removed, the trigger definition is no
+# longer present in the sqlite_schema (or sqlite_temp_schema) table and
# is not fired by any subsequent INSERT, UPDATE or DELETE statements.
#
# Test cases e_droptrigger-1.* test the first part of this statement
diff --git a/testdata/tcl/e_fkey.test b/testdata/tcl/e_fkey.test
index 3636bef..c5ac5fd 100644
--- a/testdata/tcl/e_fkey.test
+++ b/testdata/tcl/e_fkey.test
@@ -2528,8 +2528,8 @@ test_efkey_6 3 "ALTER TABLE tbl ADD COLUMN c DEFAULT 0 REFERENCES xx" 1
#
# Test that these adjustments are visible in the sqlite_master table.
#
-# EVIDENCE-OF: R-63827-54774 The text of the child CREATE TABLE
-# statement or statements stored in the sqlite_master table are modified
+# EVIDENCE-OF: R-43040-62530 The text of the child CREATE TABLE
+# statement or statements stored in the sqlite_schema table are modified
# to reflect the new parent table name.
#
do_test e_fkey-56.1 {
diff --git a/testdata/tcl/filter1.test b/testdata/tcl/filter1.test
index ee17099..7b2cf9c 100644
--- a/testdata/tcl/filter1.test
+++ b/testdata/tcl/filter1.test
@@ -204,4 +204,22 @@ do_execsql_test 6.3 {
SELECT (SELECT COUNT(a) FROM t2) FROM t1;
} {2}
+#-------------------------------------------------------------------------
+reset_db
+do_execsql_test 7.0 {
+ CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
+ INSERT INTO t1 VALUES(321, 100000);
+ INSERT INTO t1 VALUES(111, 110000);
+ INSERT INTO t1 VALUES(444, 120000);
+ INSERT INTO t1 VALUES(222, 130000);
+}
+
+do_execsql_test 7.1 {
+ SELECT max(a), max(a) FILTER (WHERE b<12345), b FROM t1;
+} {
+ 444 {} 120000
+}
+
+
+
finish_test
diff --git a/testdata/tcl/fkey5.test b/testdata/tcl/fkey5.test
index 3c44cd3..d467a64 100644
--- a/testdata/tcl/fkey5.test
+++ b/testdata/tcl/fkey5.test
@@ -15,10 +15,10 @@
# EVIDENCE-OF: R-15402-03103 PRAGMA schema.foreign_key_check; PRAGMA
# schema.foreign_key_check(table-name);
#
-# EVIDENCE-OF: R-23918-17301 The foreign_key_check pragma checks the
+# EVIDENCE-OF: R-41653-15278 The foreign_key_check pragma checks the
# database, or the table called "table-name", for foreign key
-# constraints that are violated and returns one row of output for each
-# violation.
+# constraints that are violated. The foreign_key_check pragma returns
+# one row output for each foreign key violation.
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -430,4 +430,63 @@ do_catchsql_test 11.1 {
PRAGMA foreign_key_check;
} {1 {foreign key mismatch - "c11" referencing "tt"}}
+# 2020-07-03 Bug in foreign_key_check discovered while working on the
+# forum reports that pragma_foreign_key_check does not accept an argument:
+# If two separate schemas seem to reference one another, that causes
+# problems for foreign_key_check.
+#
+reset_db
+do_execsql_test 12.0 {
+ ATTACH ':memory:' as aux;
+ CREATE TABLE aux.t1(a INTEGER PRIMARY KEY, b TEXT REFERENCES t2);
+ CREATE TABLE main.t2(x TEXT PRIMARY KEY, y INT);
+ INSERT INTO main.t2 VALUES('abc',11),('def',22),('xyz',99);
+ INSERT INTO aux.t1 VALUES(5,'abc'),(7,'xyz'),(9,'oops');
+ PRAGMA foreign_key_check=t1;
+} {t1 5 t2 0 t1 7 t2 0 t1 9 t2 0}
+do_execsql_test 12.1 {
+ CREATE TABLE aux.t2(x TEXT PRIMARY KEY, y INT);
+ INSERT INTO aux.t2 VALUES('abc',11),('def',22),('xyz',99);
+ PRAGMA foreign_key_check=t1;
+} {t1 9 t2 0}
+
+# 2020-07-03: the pragma_foreign_key_check virtual table should
+# accept arguments for the table name and/or schema name.
+#
+ifcapable vtab {
+ do_execsql_test 13.0 {
+ SELECT *, 'x' FROM pragma_foreign_key_check('t1');
+ } {t1 9 t2 0 x}
+ do_catchsql_test 13.1 {
+ SELECT *, 'x' FROM pragma_foreign_key_check('t1','main');
+ } {1 {no such table: main.t1}}
+ do_execsql_test 13.2 {
+ SELECT *, 'x' FROM pragma_foreign_key_check('t1','aux');
+ } {t1 9 t2 0 x}
+}
+
+ifcapable vtab {
+ reset_db
+ do_execsql_test 13.10 {
+ PRAGMA foreign_keys=OFF;
+ CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT REFERENCES t2);
+ CREATE TABLE t2(x TEXT PRIMARY KEY, y INT);
+ CREATE TABLE t3(w TEXT, z INT REFERENCES t1);
+ INSERT INTO t2 VALUES('abc',11),('def',22),('xyz',99);
+ INSERT INTO t1 VALUES(5,'abc'),(7,'xyz'),(9,'oops');
+ INSERT INTO t3 VALUES(11,7),(22,19);
+ } {}
+ do_execsql_test 13.11 {
+ SELECT x.*, '|'
+ FROM sqlite_schema, pragma_foreign_key_check(name) AS x
+ WHERE type='table'
+ ORDER BY x."table";
+ } {t1 9 t2 0 | t3 2 t1 0 |}
+ do_execsql_test 13.12 {
+ SELECT *, '|'
+ FROM pragma_foreign_key_check AS x
+ ORDER BY x."table";
+ } {t1 9 t2 0 | t3 2 t1 0 |}
+}
+
finish_test
diff --git a/testdata/tcl/fts3corrupt4.test b/testdata/tcl/fts3corrupt4.test
index 27b4eb5..bddcc9f 100644
--- a/testdata/tcl/fts3corrupt4.test
+++ b/testdata/tcl/fts3corrupt4.test
@@ -27,6 +27,7 @@ ifcapable !fts3 {
sqlite3_fts3_may_be_corrupt 1
database_may_be_corrupt
+extra_schema_checks 0
do_execsql_test 1.0 {
BEGIN;
@@ -6123,4 +6124,178 @@ do_execsql_test 41.2 {
SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'rtree ner "json1^enable"';
}
+#-------------------------------------------------------------------------
+do_execsql_test 42.1 {
+ CREATE VIRTUAL TABLE f USING fts3(a, b);
+}
+do_execsql_test 42.2 {
+ INSERT INTO f_segdir VALUES(0,2,1111,0,0,X'00');
+ INSERT INTO f_segdir VALUES(0,3,0 ,0,0,X'00013003010200');
+}
+do_execsql_test 42.3 {
+ INSERT INTO f(f) VALUES ('merge=107,2');
+}
+
+#-------------------------------------------------------------------------
+reset_db
+set saved $sqlite_fts3_enable_parentheses
+set sqlite_fts3_enable_parentheses 1
+do_execsql_test 43.1 {
+ CREATE VIRTUAL TABLE def USING fts3(xyz);
+ INSERT INTO def_segdir VALUES(0,0,0,0,0, X'0001310301c9000103323334050d81');
+} {}
+
+do_execsql_test 43.2 {
+ SELECT rowid FROM def WHERE def MATCH '1 NEAR 1'
+} {1}
+
+set sqlite_fts3_enable_parentheses $saved
+
+#-------------------------------------------------------------------------
+reset_db
+do_execsql_test 44.1 {
+ CREATE VIRTUAL TABLE t0 USING fts3(col0 INTEGER PRIMARY KEY,col1 VARCHAR(8),col2 BINARY,col3 BINARY);
+ INSERT INTO t0_content VALUES(0,NULL,NULL,NULL,NULL);
+ INSERT INTO t0_segdir VALUES(0,0,0,0,'0 42',X'00013103010200010332333405010201ba00000461616161050101020200000462626262050101030200');
+}
+
+do_execsql_test 44.2 {
+ SELECT matchinfo(t0, t0) IS NULL FROM t0 WHERE t0 MATCH '1*'
+} {0}
+
+#-------------------------------------------------------------------------
+#
+reset_db
+do_test 45.0 {
+ sqlite3 db {}
+ db deserialize [decode_hexdb {
+.open --hexdb
+| size 24576 pagesize 4096 filename crash-65c98512cc9e49.db
+| page 1 offset 0
+| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.
+| 16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 06 .....@ ........
+| 96: 00 00 00 00 0d 0e fc 00 06 0d bc 00 0f ca 0f 6c ...............l
+| 112: 0f 04 0e 13 0e c9 0d bc 00 00 00 00 00 00 00 00 ................
+| 3504: 00 00 00 00 00 00 00 00 00 00 00 00 55 06 07 17 ............U...
+| 3520: 1b 1b 01 81 01 74 61 62 6c 65 78 31 5f 73 74 61 .....tablex1_sta
+| 3536: 74 78 31 5f 73 74 61 74 06 43 52 45 41 54 45 20 tx1_stat.CREATE
+| 3552: 54 41 42 4c 45 20 27 78 31 5f 73 74 61 74 27 28 TABLE 'x1_stat'(
+| 3568: 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 id INTEGER PRIMA
+| 3584: 52 59 20 4b 45 59 2c 20 76 61 6c 75 65 20 42 4c RY KEY, value BL
+| 3600: 41 82 29 81 33 04 07 17 1f 1f 01 82 35 74 61 62 A.).3.......5tab
+| 3616: 6c 65 78 31 5f 73 65 67 64 69 72 78 31 5f 73 65 lex1_segdirx1_se
+| 3632: 67 64 69 72 04 43 52 45 41 54 45 20 54 41 42 4c gdir.CREATE TABL
+| 3648: 45 20 27 78 31 5f 73 65 67 64 69 72 27 28 6c 65 E 'x1_segdir'(le
+| 3664: 76 65 6c 20 49 4e 54 45 47 45 52 2c 69 64 78 20 vel INTEGER,idx
+| 3680: 49 4e 54 45 47 45 52 2c 73 74 61 72 74 5f 62 6c INTEGER,start_bl
+| 3696: 6f 63 6b 20 49 4e 54 45 47 45 52 2c 6c 65 61 76 ock INTEGER,leav
+| 3712: 65 73 5f 65 6e 64 5f 62 6c 6f 63 6b 20 49 4e 54 es_end_block INT
+| 3728: 45 47 45 52 2c 65 6e 64 5f 62 6c 6f 63 6b 20 49 EGER,end_block I
+| 3744: 4e 54 45 47 45 52 2c 72 6f 6f 74 20 42 4c 4f 42 NTEGER,root BLOB
+| 3760: 2c 50 52 49 4d 41 52 59 20 4b 45 59 28 6c 65 76 ,PRIMARY KEY(lev
+| 3776: 65 6c 2c 20 69 64 78 29 29 31 05 06 17 45 1f 01 el, idx))1...E..
+| 3792: 00 69 6e 64 65 78 73 71 6c 69 74 65 5f 61 75 74 .indexsqlite_aut
+| 3808: 6f 69 6e 64 65 78 5f 78 31 5f 73 65 67 64 69 72 oindex_x1_segdir
+| 3824: 5f 31 78 31 5f 73 65 67 64 69 72 05 00 00 00 08 _1x1_segdir.....
+| 3840: 60 00 00 00 66 03 07 17 23 23 01 81 13 74 61 62 `...f...##...tab
+| 3856: 6c 65 78 31 5f 73 65 67 6d 65 6e 74 73 78 31 5f lex1_segmentsx1_
+| 3872: 73 65 67 6d 65 6e 74 73 03 43 52 45 41 54 45 20 segments.CREATE
+| 3888: 54 41 42 4c 45 20 27 78 31 5f 73 65 67 6d 65 6e TABLE 'x1_segmen
+| 3904: 74 73 27 28 62 6c 6f 63 6b 69 64 20 49 4e 54 45 ts'(blockid INTE
+| 3920: 47 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c GER PRIMARY KEY,
+| 3936: 20 62 6c 6f 63 6b 20 42 4c 4f 42 29 5c 02 07 17 block BLOB)....
+| 3952: 21 21 01 81 03 74 61 62 6c 65 78 31 5f 63 6f 6e !!...tablex1_con
+| 3968: 74 65 6e 74 78 31 5f 63 6f 6e 74 65 6e 74 02 43 tentx1_content.C
+| 3984: 52 45 41 54 45 20 54 41 42 4c 45 20 27 78 31 5f REATE TABLE 'x1_
+| 4000: 63 6f 6e 74 65 6e 74 27 28 64 6f 63 69 64 20 49 content'(docid I
+| 4016: 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 20 4b NTEGER PRIMARY K
+| 4032: 45 59 2c 20 27 63 30 78 27 29 34 01 06 17 11 11 EY, 'c0x')4.....
+| 4048: 08 57 74 61 62 6c 65 78 31 78 31 43 52 45 41 54 .Wtablex1x1CREAT
+| 4064: 45 20 56 49 52 54 55 41 4c 20 54 41 42 4c 45 20 E VIRTUAL TABLE
+| 4080: 78 31 20 55 53 49 4e 47 20 66 74 73 33 28 78 29 x1 USING fts3(x)
+| page 2 offset 4096
+| 0: 0d 00 00 00 11 0f 77 f0 0f f8 0f f0 0f e8 0f e0 ......w.........
+| 16: 0f d8 0f d0 0f c8 0f c0 00 00 00 00 00 00 00 00 ................
+| 3952: 00 00 00 00 00 00 00 00 06 11 03 00 13 77 78 79 .............wxy
+| 3968: 06 10 03 00 13 74 75 76 06 0f 03 00 13 71 33 73 .....tuv.....q3s
+| 3984: 06 0e 03 00 13 6e 6f 70 06 0d 03 00 13 6b 6c 6d .....nop.....klm
+| 4000: 06 0c 03 04 c3 68 69 6a 06 0b 03 00 13 65 66 67 .....hij.....efg
+| 4016: 06 0a 03 00 13 62 63 64 06 09 03 00 13 79 7a 61 .....bcd.....yza
+| 4032: 06 08 03 00 13 76 77 78 06 07 03 00 13 73 74 75 .....vwx.....stu
+| 4048: 06 06 03 00 13 70 71 72 06 05 03 00 13 6d 6e 6f .....pqr.....mno
+| 4064: 06 03 03 00 13 6a 6b 6c 06 03 03 00 13 67 68 69 .....jkl.....ghi
+| 4080: 06 02 02 00 03 64 65 66 06 01 03 00 13 61 52 63 .....def.....aRc
+| page 3 offset 8192
+| 0: 0d 00 00 00 03 0f a7 00 0f b5 0f a7 0f fa 01 00 ................
+| 4000: 00 00 00 00 00 00 00 0c 02 03 00 1e 00 03 6b 6c ..............kl
+| 4016: 6d 03 0d 02 00 43 01 04 00 81 0a 00 03 61 62 63 m....C.......abc
+| 4032: 03 0b 32 00 00 03 62 63 64 03 0a 02 00 00 03 64 ..2...bcd......d
+| 4048: 69 26 03 02 02 00 00 03 65 66 67 03 0b 02 00 00 i&......efg.....
+| 4064: 03 67 68 69 03 03 02 00 00 03 68 69 6a 03 0c 02 .ghi......hij...
+| 4080: 00 00 03 6a 6a 2c 03 04 02 00 03 81 00 03 00 00 ...jj,..........
+| page 4 offset 12288
+| 0: 0d 0f 3a 00 05 0f 25 00 0f 9e 0f 88 0f 43 0f 25 ..:...%......C.%
+| 16: 0f 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .r..............
+| 3856: 00 00 00 00 00 00 00 00 00 56 01 08 08 13 1e 03 .........V......
+| 3872: 30 20 39 00 03 13 05 07 08 08 18 08 13 1e 30 20 0 9...........0
+| 3888: 39 00 03 77 78 79 03 11 02 00 0f 6c 00 09 01 08 9..wxy.....l....
+| 3904: 08 15 54 27 04 07 09 01 08 08 15 42 02 30 20 33 ..T'.......B.0 3
+| 3920: 36 00 03 6e 6f 70 03 0e 02 00 00 03 71 72 73 03 6..nop......qrs.
+| 3936: 0f 02 00 00 03 74 75 76 03 10 02 00 0f cf b1 06 .....tuv........
+| 3952: 01 08 14 06 07 01 08 09 01 1b 14 02 02 31 32 38 .............128
+| 3968: 20 2d 37 32 10 01 01 6b 14 03 07 09 09 08 08 15 -72...k........
+| 3984: 1e 30 20 33 36 00 03 79 7a 61 03 09 02 00 2f 02 .0 36..yza..../.
+| 4000: 07 09 08 08 08 15 54 30 20 33 36 00 03 6d 6e 6f ......T0 36..mno
+| 4016: 03 05 02 00 00 03 70 71 72 03 06 02 00 00 03 73 ......pqr......s
+| 4032: 74 75 03 07 02 00 00 03 76 77 78 03 08 02 00 00 tu......vwx.....
+| 4048: 00 00 4a 08 08 08 15 54 30 20 33 36 00 03 61 62 ..J....T0 36..ab
+| 4064: 63 03 01 02 00 00 03 64 65 66 03 02 02 00 00 03 c......def......
+| 4080: 67 68 69 03 03 67 00 00 03 6a 6b 6c 03 04 02 00 ghi..g...jkl....
+| page 5 offset 16384
+| 0: 0a 0f e7 00 05 0f da 00 0f e1 0f fa 0f f4 0f ed ................
+| 16: 0f da 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+| 4048: 00 00 00 00 00 00 00 1a 01 03 06 04 01 08 01 02 ................
+| 4064: 06 05 04 08 08 01 05 00 00 00 06 01 03 06 04 09 ................
+| 4080: 02 01 02 04 05 04 09 09 01 03 05 04 09 08 01 02 ................
+| page 6 offset 20480
+| 0: 0d 00 10 00 01 0f f9 00 0f f9 00 00 00 00 00 00 ................
+| 4080: 00 00 00 00 00 00 00 00 00 05 01 03 00 10 01 03 ................
+| end crash-65c98512cc9e49.db
+}]} {}
+
+do_catchsql_test 45.2 {
+ INSERT INTO x1(x1) VALUES( 'merge=1' )
+} {1 {database disk image is malformed}}
+
+#-------------------------------------------------------------------------
+reset_db
+set saved $sqlite_fts3_enable_parentheses
+set sqlite_fts3_enable_parentheses 1
+do_execsql_test 46.1 {
+ CREATE VIRTUAL TABLE t0 USING fts3(a INTEGER PRIMARY KEY,b,c,d);
+ INSERT INTO t0_segdir VALUES(0,0,0,0,'0 42',X'0001310301c9000103323334050d8000f200000461616161050101020200000462626262050101030200');
+} {}
+
+do_catchsql_test 46.2 {
+ SELECT * FROM t0
+ WHERE t0 MATCH x'2b0a312b0a312a312a2a0b5d0a0b0b0a312a0a0b0b0a312a0b310a392a0b0a27312a2a0b5d0a312a0b310a31315d0b310a312a316d2a0b313b15bceaa50a312a0b0a27312a2a0b5d0a312a0b310a312b0b2a310a312a0b2a0b2a0b2e5d0a0bff313336e34a2a312a0b0a3c310b0a0b4b4b0b4b2a4bec40322b2a0b310a0a312a0a0a0a0a0a0a0a0a0b310a312a2a2a0b5d0a0b0b0a312a0b310a312a0b0a4e4541530b310a5df5ced70a0a0a0a0a4f520a0a0a0a0a0a0a312a0b0a4e4541520b310a5d616161610a0a0a0a4f520a0a0a0a0a0a312b0a312a312a0a0a0a0a0a0a004a0b0a310b220a0b0a310a4a22310a0b0a7e6fe0e0e030e0e0e0e0e01176e02000e0e0e0e0e01131320226310a0b0a310a4a22310a0b0a310a766f8b8b4ee0e0300ae0090909090909090909090909090909090909090909090909090909090909090947aaaa540b09090909090909090909090909090909090909090909090909090909090909fae0e0f2f22164e0e0f273e07fefefef7d6dfafafafa6d6d6d6d';
+} {1 {database disk image is malformed}}
+
+set sqlite_fts3_enable_parentheses $saved
+extra_schema_checks 1
+
+#-------------------------------------------------------------------------
+reset_db
+do_execsql_test 47.1 {
+ CREATE VIRTUAL TABLE t1 USING fts3(a,b,c);
+}
+do_execsql_test 47.2 {
+ INSERT INTO t1_segdir VALUES(0,0,0,0,0,X'000130120106000106000106001f030001030001030000083230313630363039090107000107000107000001340901050001050001050000013509010400010400010400010730303030303030091c0400010400010400000662696e6172793c0301020200030102020003010202000301020200030102020003010202000301020200030102020003010202000301020200030102020003010202000008636f6d70696c657209010200010200010200000664627374617409070300010300010300010465627567090402000102000102000006656e61626c653f07020001020001020001020001020001020001020001020001020001020001020001020001010001020001020001020001020001020001020001020001020001087874656e73696f6e091f0400010400010400000466747334090a0300010300010300030135090d03000103000103000003676363090103000103000103000106656f706f6c790910030001030001030000056a736f6e310913030001030001030000046c6f6164091f030001030001030000036d6178091c02000102000102000105656d6f7279091c03000103000103000304737973350916030001030001030000066e6f636173653c02010202000301020200030102020003010202000301020200030102020003010202000301020200030102020003010202000301020200030102020000046f6d6974091f020001020001020000057274726565091903000103000103000302696d3c01010202000301020200030102020003010202000301020200030102020003010202000301a202000301020200030102020003010202000301020200000a746872656164736166650922020001020001020000047674616209070400010400010400000178b401010101020001010102000101010200010101020001010102000101010200010101020001010102000101010200010101020001010102000101010200010101020001010102000101010200010101020001010102000101010200010101020001010102000101010200010101020001010102000101010200010101020001010102000101010200010101020001010102000101010200010101020001010102000101010200010101020001010102000101010200');
+ INSERT INTO t1_segdir VALUES(0,1,0,0,0,X'0001300425061b000008323031363036303903250700000134032505000001350325040001073030303030303003251a000008636f6d70696c657203250200000664627374617403250a00010465627567032508000006656e61626c650925090504040404040001087874656e73696f6e03251d0000046674733403250d0003013503250f000003676363032503000106656f706f6c790325110000056a736f6e310325130000046c6f616403251c0000036d6178032518000105656d6f7279032519000304737973350325150000046f6d697403251b000005727472656503251700000a7468726561647361666503251e0000047674616333250b00');
+}
+
+do_catchsql_test 47.3 {
+ SELECT matchinfo(t1) FROM t1 WHERE t1 MATCH '"json1 enable"';
+} {1 {database disk image is malformed}}
+
finish_test
diff --git a/testdata/tcl/fts3corrupt6.test b/testdata/tcl/fts3corrupt6.test
new file mode 100644
index 0000000..9e22bdf
--- /dev/null
+++ b/testdata/tcl/fts3corrupt6.test
@@ -0,0 +1,60 @@
+# 2020 June 8
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#*************************************************************************
+# This file implements regression tests for SQLite library. The
+# focus of this script is testing the FTS3 module.
+#
+# $Id: fts3aa.test,v 1.1 2007/08/20 17:38:42 shess Exp $
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+source $testdir/fts3_common.tcl
+set testprefix fts3corrupt6
+
+# If SQLITE_ENABLE_FTS3 is defined, omit this file.
+ifcapable !fts3 {
+ finish_test
+ return
+}
+
+set ::saved_sqlite_fts3_enable_parentheses $::sqlite_fts3_enable_parentheses
+set sqlite_fts3_enable_parentheses 1
+sqlite3_fts3_may_be_corrupt 1
+database_may_be_corrupt
+
+do_execsql_test 1.0 {
+ BEGIN TRANSACTION;
+ CREATE TABLE t_content(col0 INTEGER);
+ PRAGMA writable_schema=ON;
+ CREATE VIRTUAL TABLE t0 USING fts3(col0 INTEGER PRIMARY KEY,col1 VARCHAR(8),col2 BINARY,col3 BINARY);
+ INSERT INTO t0_content VALUES(0,NULL,NULL,NULL,NULL);
+ INSERT INTO t0_segdir VALUES(0,0,0,0,'0 42',X'000131030102000103323334050101010200000461616161050101020200000462626262050101030200');
+ COMMIT;
+}
+
+do_execsql_test 1.1 {
+ SELECT 0+matchinfo(t0,'yxyyxy') FROM t0 WHERE t0 MATCH CAST( x'2b0a312b0a312a312a2a0b5d0a0b0b0a312a0a0b0b0a312a0b310a392a0b0a27312a2a0b5d0a312a0b310a31315d0b310a312a316d2a0b313b15bceaa50a312a0b0a27312a2a0b5d0a312a0b310a312b0b2a310a312a0b2a0b2a0b2e5d0a0bff313336e34a2a312a0b0a3c310b0a0b4b4b0b4b2a4bec40322b2a0b310a0a312a0a0a0a0a0a0a0a0a0b310a312a2a2a0b5d0a0b0b0a312a0b310a312a0b0a4e4541530b310a5df5ced70a0a0a0a0a4f520a0a0a0a0a0a0a312a0b0a4e4541520b310a5d616161610a0a0a0a4f520a0a0a0a0a0a312b0a312a312a0a0a0a0a0a0a004a0b0a310b220a0b0a310a4a22310a0b0a7e6fe0e0e030e0e0e0e0e01176e02000e0e0e0e0e01131320226310a0b0a310a4a22310a0b0a310a766f8b8b4ee0e0300ae0090909090909090909090909090909090909090909090909090909090909090947aaaa540b09090909090909090909090909090909090909090909090909090909090909fae0e0f2f22164e0e0f273e07fefefef7d6dfafafafa6d6d6d6d' AS TEXT);
+} {0}
+
+do_execsql_test 1.2 {
+ CREATE VIRTUAL TABLE t1 USING fts3(col0 INTEGER PRIMARY KEY,col1 VARCHAR(8),col2 BINARY,col3 BINARY);
+ INSERT INTO t1_content VALUES(0,NULL,NULL,NULL,NULL);
+ INSERT INTO t1_segdir VALUES(0,0,0,0,'0 42',X'000131030102000103323334050101010200000461616161050101020200000462626262050101030200');
+}
+
+do_execsql_test 1.3 {
+ SELECT 42+matchinfo(t1,'yxyyxy') FROM t1 WHERE t1 MATCH x'2b0a312b0a312a312a2a0b5d0a0b0b0a312a0a0b0b0a312a0b310a392a0b0a27312a2a0b5d0a312a0b310a31315d0b310a312a316d2a0b313b15bceaa50a312a0b0a27312a2a0b5d0a312a0b310a312b0b2a310a312a0b2a0b2a0b2e5d0a0bff313336e34a2a312a0b0a3c310b0a0b4b4b0b4b2a4bec40322b2a0b310a0a312a0a0a0a0a0a0a0a0a0b310a312a2a2a0b5d0a0b0b0a312a0b310a312a0b0a4e4541530b310a5df5ced70a0a0a0a0a4f520a0a0a0a0a0a0a312a0b0a4e4541520b310a5d616161610a0a0a0a4f520a0a0a0a0a0a312b0a312a312a0a0a0a0a0a0a004a0b0a310b220a0b0a310a4a22310a0b0a7e6fe0e0e030e0e0e0e0e01176e02000e0e0e0e0e01131320226310a0b0a310a4a22310a0b0a310a766f8b8b4ee0e0300ae0090909090909090909090909090909090909090909090909090909090909090947aaaa540b09090909090909090909090909090909090909090909090909090909090909fae0e0f2f22164e0e0f273e07fefefef7d6dfafafafa6d6d6d6d';
+} {42}
+
+set sqlite_fts3_enable_parentheses $saved_sqlite_fts3_enable_parentheses
+finish_test
+
+
diff --git a/testdata/tcl/fts4upfrom.test b/testdata/tcl/fts4upfrom.test
new file mode 100644
index 0000000..b1b43a0
--- /dev/null
+++ b/testdata/tcl/fts4upfrom.test
@@ -0,0 +1,140 @@
+# 2020 February 24
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#*************************************************************************
+# This file implements regression tests for SQLite library. The
+# focus of this script is testing UPDATE statements with FROM clauses
+# against FTS4 tables.
+#
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix fts4upfrom
+
+# If SQLITE_ENABLE_FTS3 is defined, omit this file.
+ifcapable !fts3 {
+ finish_test
+ return
+}
+
+foreach {tn create_table} {
+ 0 { CREATE VIRTUAL TABLE ft USING fts5(a, b, c) }
+ 1 { CREATE VIRTUAL TABLE ft USING fts3(a, b, c) }
+ 2 { CREATE TABLE ft(a, b, c) }
+ 3 {
+ CREATE TABLE real(a, b, c);
+ CREATE INDEX i1 ON real(a);
+ CREATE VIEW ft AS SELECT rowid, a, b, c FROM real;
+ CREATE TRIGGER tr1 INSTEAD OF INSERT ON ft BEGIN
+ INSERT INTO real(rowid, a, b, c) VALUES(new.rowid, new.a, new.b, new.c);
+ END;
+ CREATE TRIGGER tr2 INSTEAD OF UPDATE ON ft BEGIN
+ UPDATE real SET rowid=new.rowid, a=new.a, b=new.b, c=new.c
+ WHERE rowid=old.rowid;
+ END;
+ }
+} {
+ if {$tn==0} { ifcapable !fts5 { continue } }
+ catchsql { DROP VIEW IF EXISTS changes }
+ catchsql { DROP TABLE IF EXISTS ft }
+ catchsql { DROP VIEW IF EXISTS ft }
+ execsql $create_table
+
+ do_execsql_test 1.$tn.0 {
+ INSERT INTO ft(a, b, c) VALUES('a', NULL, 'apple');
+ INSERT INTO ft(a, b, c) VALUES('b', NULL, 'banana');
+ INSERT INTO ft(a, b, c) VALUES('c', NULL, 'cherry');
+ INSERT INTO ft(a, b, c) VALUES('d', NULL, 'damson plum');
+ }
+
+ do_execsql_test 1.$tn.1 {
+ SELECT a, b, c FROM ft ORDER BY rowid;
+ } {
+ a {} apple
+ b {} banana
+ c {} cherry
+ d {} {damson plum}
+ }
+
+ do_execsql_test 1.$tn.2 {
+ UPDATE ft SET b=o.c FROM ft AS o WHERE (ft.a == char(unicode(o.a)+1))
+ }
+
+ do_execsql_test 1.$tn.3 {
+ SELECT a, b, c FROM ft ORDER BY rowid;
+ } {
+ a {} apple
+ b apple banana
+ c banana cherry
+ d cherry {damson plum}
+ }
+
+ do_catchsql_test 1.$tn.4 {
+ UPDATE ft SET c=v FROM changes WHERE a=k;
+ } {1 {no such table: changes}}
+
+ do_execsql_test 1.$tn.5 {
+ create view changes(k, v) AS
+ VALUES( 'd', 'dewberry' ) UNION ALL
+ VALUES( 'c', 'clementine' ) UNION ALL
+ VALUES( 'b', 'blueberry' ) UNION ALL
+ VALUES( 'a', 'apricot' )
+ ;
+ }
+
+ do_execsql_test 1.$tn.6 {
+ UPDATE ft SET c=v FROM changes WHERE a=k;
+ }
+
+ do_execsql_test 1.$tn.7 {
+ SELECT rowid, a, b, c FROM ft ORDER BY rowid;
+ } {
+ 1 a {} apricot
+ 2 b apple blueberry
+ 3 c banana clementine
+ 4 d cherry dewberry
+ }
+
+ do_execsql_test 1.$tn.8 "
+ WITH x1(o, n) AS (
+ VALUES(1, 11) UNION ALL
+ VALUES(2, 12) UNION ALL
+ VALUES(3, 13) UNION ALL
+ VALUES(4, 14)
+ )
+ SELECT ft.rowid, a, b, c, o, n FROM ft, x1 WHERE ft.rowid = o;
+ " {
+ 1 a {} apricot 1 11
+ 2 b apple blueberry 2 12
+ 3 c banana clementine 3 13
+ 4 d cherry dewberry 4 14
+ }
+
+ set ROWID rowid
+ if {$tn==1} { set ROWID docid }
+ do_execsql_test 1.$tn.9 "
+ WITH x1(o, n) AS (
+ VALUES(1, 11) UNION ALL
+ VALUES(2, 12) UNION ALL
+ VALUES(3, 13) UNION ALL
+ VALUES(4, 14)
+ )
+ UPDATE ft SET $ROWID = n FROM x1 WHERE ft.rowid = o;
+ SELECT rowid, a, b, c FROM ft ORDER BY rowid;
+ " {
+ 11 a {} apricot
+ 12 b apple blueberry
+ 13 c banana clementine
+ 14 d cherry dewberry
+ }
+}
+
+finish_test
+
diff --git a/testdata/tcl/gencol1.test b/testdata/tcl/gencol1.test
index 5276d96..43f48df 100644
--- a/testdata/tcl/gencol1.test
+++ b/testdata/tcl/gencol1.test
@@ -560,4 +560,30 @@ do_catchsql_test gencol1-19.10 {
INSERT INTO t0(c1) VALUES(0.16334143182538696), (0);
} {1 {UNIQUE constraint failed: t0.c0}}
+# 2020-06-29 forum bug report.
+# https://sqlite.org/forum/forumpost/73b9a8ccfb
+#
+do_execsql_test gencol1-20.1 {
+ CREATE TEMPORARY TABLE tab (
+ prim DATE PRIMARY KEY,
+ a INTEGER,
+ comp INTEGER AS (a),
+ b INTEGER,
+ x INTEGER
+ );
+ -- Add some data
+ INSERT INTO tab (prim, a, b) VALUES ('2001-01-01', 0, 0);
+ -- Check that each column is 0 like I expect
+ SELECT * FROM tab;
+} {2001-01-01 0 0 0 {}}
+do_execsql_test gencol1-20.2 {
+ -- Do an UPSERT on the b column
+ INSERT INTO tab (prim, b)
+ VALUES ('2001-01-01',5)
+ ON CONFLICT(prim) DO UPDATE SET b=excluded.b;
+ -- Now b is NULL rather than 5
+ SELECT * FROM tab;
+} {2001-01-01 0 0 5 {}}
+
+
finish_test
diff --git a/testdata/tcl/hook.test b/testdata/tcl/hook.test
index 1c9145b..d137e90 100644
--- a/testdata/tcl/hook.test
+++ b/testdata/tcl/hook.test
@@ -142,9 +142,8 @@ do_test hook-4.1.1a {
set ::update_hook {}
db update_hook [list lappend ::update_hook]
#
- # EVIDENCE-OF: R-52223-27275 The update hook is not invoked when
- # internal system tables are modified (i.e. sqlite_master and
- # sqlite_sequence).
+ # EVIDENCE-OF: R-24531-54682 The update hook is not invoked when
+ # internal system tables are modified (i.e. sqlite_sequence).
#
execsql {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
diff --git a/testdata/tcl/ieee754.test b/testdata/tcl/ieee754.test
index bf06764..bd806d2 100644
--- a/testdata/tcl/ieee754.test
+++ b/testdata/tcl/ieee754.test
@@ -23,8 +23,8 @@ foreach {id float rep} {
3 0.5 1,-1
4 1.5 3,-1
5 0.0 0,-1075
- 6 4.9406564584124654e-324 4503599627370497,-1075
- 7 2.2250738585072009e-308 9007199254740991,-1075
+ 6 4.9406564584124654e-324 1,-1074
+ 7 2.2250738585072009e-308 4503599627370495,-1074
8 2.2250738585072014e-308 1,-1022
} {
do_test ieee754-100-$id-1 {
diff --git a/testdata/tcl/index7.test b/testdata/tcl/index7.test
index f57792e..084e8c3 100644
--- a/testdata/tcl/index7.test
+++ b/testdata/tcl/index7.test
@@ -339,5 +339,17 @@ do_execsql_test index7-7.1 {
SELECT * FROM t6 WHERE y IS TRUE ORDER BY x;
} {1 1}
+# 2020-05-27. tag-20200527-1.
+# Incomplete stat1 information on a table with few rows should still use the
+# index.
+reset_db
+do_execsql_test index7-8.1 {
+ CREATE TABLE t1(x INTEGER PRIMARY KEY, y);
+ CREATE INDEX t1y ON t1(y) WHERE y IS NOT NULL;
+ INSERT INTO t1(x) VALUES(1),(2);
+ ANALYZE;
+ EXPLAIN QUERY PLAN SELECT 1 FROM t1 WHERE y=5;
+} {/SEARCH TABLE t1 USING COVERING INDEX t1y/}
+
finish_test
diff --git a/testdata/tcl/indexedby.test b/testdata/tcl/indexedby.test
index 8624b10..18f7bb8 100644
--- a/testdata/tcl/indexedby.test
+++ b/testdata/tcl/indexedby.test
@@ -95,7 +95,7 @@ do_test indexedby-2.4 {
# an error.
do_test indexedby-2.4.1 {
catchsql { SELECT b FROM t1 INDEXED BY i1 WHERE b = 'two' }
-} {1 {no query solution}}
+} {0 {}}
do_test indexedby-2.5 {
catchsql { SELECT * FROM t1 INDEXED BY i5 WHERE a = 'one' AND b = 'two'}
@@ -135,10 +135,10 @@ do_eqp_test indexedby-3.3 {
} {SEARCH TABLE t1 USING INDEX i2 (b=?)}
do_test indexedby-3.4 {
catchsql { SELECT * FROM t1 INDEXED BY i2 WHERE a = 'one' }
-} {1 {no query solution}}
+} {0 {}}
do_test indexedby-3.5 {
catchsql { SELECT * FROM t1 INDEXED BY i2 ORDER BY a }
-} {1 {no query solution}}
+} {0 {}}
do_test indexedby-3.6 {
catchsql { SELECT * FROM t1 INDEXED BY i1 WHERE a = 'one' }
} {0 {}}
@@ -154,7 +154,7 @@ do_eqp_test indexedby-3.9 {
} {SEARCH TABLE t3 USING INDEX sqlite_autoindex_t3_1 (e=?)}
do_test indexedby-3.10 {
catchsql { SELECT * FROM t3 INDEXED BY sqlite_autoindex_t3_1 WHERE f = 10 }
-} {1 {no query solution}}
+} {0 {}}
do_test indexedby-3.11 {
catchsql { SELECT * FROM t3 INDEXED BY sqlite_autoindex_t3_2 WHERE f = 10 }
} {1 {no such index: sqlite_autoindex_t3_2}}
@@ -172,19 +172,19 @@ do_eqp_test indexedby-4.2 {
SELECT * FROM t1 INDEXED BY i1, t2 WHERE a = c
} {
QUERY PLAN
- |--SCAN TABLE t2
- `--SEARCH TABLE t1 USING INDEX i1 (a=?)
+ |--SCAN TABLE t1 USING INDEX i1
+ `--SEARCH TABLE t2 USING INDEX i3 (c=?)
}
do_test indexedby-4.3 {
catchsql {
SELECT * FROM t1 INDEXED BY i1, t2 INDEXED BY i3 WHERE a=c
}
-} {1 {no query solution}}
+} {0 {}}
do_test indexedby-4.4 {
catchsql {
SELECT * FROM t2 INDEXED BY i3, t1 INDEXED BY i1 WHERE a=c
}
-} {1 {no query solution}}
+} {0 {}}
# Test embedding an INDEXED BY in a CREATE VIEW statement. This block
# also tests that nothing bad happens if an index refered to by
@@ -205,7 +205,7 @@ do_test indexedby-5.4 {
# Recreate index i1 in such a way as it cannot be used by the view query.
execsql { CREATE INDEX i1 ON t1(b) }
catchsql { SELECT * FROM v2 }
-} {1 {no query solution}}
+} {0 {}}
do_test indexedby-5.5 {
# Drop and recreate index i1 again. This time, create it so that it can
# be used by the query.
@@ -245,7 +245,7 @@ do_eqp_test indexedby-7.5 {
} {SEARCH TABLE t1 USING INDEX i2 (b=?)}
do_test indexedby-7.6 {
catchsql { DELETE FROM t1 INDEXED BY i2 WHERE a = 5}
-} {1 {no query solution}}
+} {0 {}}
# Test that "INDEXED BY" can be used in an UPDATE statement.
#
@@ -266,7 +266,7 @@ do_eqp_test indexedby-8.5 {
} {SEARCH TABLE t1 USING INDEX i2 (b=?)}
do_test indexedby-8.6 {
catchsql { UPDATE t1 INDEXED BY i2 SET rowid=rowid+1 WHERE a = 5}
-} {1 {no query solution}}
+} {0 {}}
# Test that bug #3560 is fixed.
#
@@ -284,10 +284,10 @@ do_test indexedby-9.2 {
joinme as j indexed by joinme_id_text_idx
on ( m.id = j.id_int)
}
-} {1 {no query solution}}
+} {0 {}}
do_test indexedby-9.3 {
catchsql { select * from maintable, joinme INDEXED by joinme_id_text_idx }
-} {1 {no query solution}}
+} {0 {}}
# Make sure we can still create tables, indices, and columns whose name
# is "indexed".
diff --git a/testdata/tcl/misc7.test b/testdata/tcl/misc7.test
index e75a684..25f96af 100644
--- a/testdata/tcl/misc7.test
+++ b/testdata/tcl/misc7.test
@@ -455,12 +455,13 @@ if {$tcl_platform(platform)!="windows"} {
catchsql {
SELECT count(*) FROM t3;
}
- } {1 {database disk image is malformed}}
+ } {1 {malformed database schema (t3) - invalid rootpage}}
}
}
# Ticket #2470
#
+reset_db
do_test misc7-18.1 {
execsql {
CREATE TABLE table_1 (col_10);
diff --git a/testdata/tcl/mutex1.test b/testdata/tcl/mutex1.test
index f567a0d..aac04bf 100644
--- a/testdata/tcl/mutex1.test
+++ b/testdata/tcl/mutex1.test
@@ -38,7 +38,7 @@ proc mutex_counters {varname} {
#-------------------------------------------------------------------------
# Tests mutex1-1.* test that sqlite3_config() returns SQLITE_MISUSE if
# is called at the wrong time. And that the first time sqlite3_initialize
-# is called it obtains the 'static_master' mutex 3 times and a recursive
+# is called it obtains the 'static_main' mutex 3 times and a recursive
# mutex (sqlite3Config.pInitMutex) twice. Subsequent calls are no-ops
# that do not require any mutexes.
#
@@ -75,7 +75,7 @@ do_test mutex1-1.6 {
do_test mutex1-1.7 {
mutex_counters counters
- # list $counters(total) $counters(static_master)
+ # list $counters(total) $counters(static_main)
expr {$counters(total)>0}
} {1}
@@ -86,7 +86,7 @@ do_test mutex1-1.8 {
do_test mutex1-1.9 {
mutex_counters counters
- list $counters(total) $counters(static_master)
+ list $counters(total) $counters(static_main)
} {0 0}
#-------------------------------------------------------------------------
@@ -103,13 +103,13 @@ ifcapable threadsafe1&&shared_cache {
singlethread {}
multithread {
fast static_app1 static_app2 static_app3
- static_lru static_master static_mem static_open
+ static_lru static_main static_mem static_open
static_prng static_pmem static_vfs1 static_vfs2
static_vfs3
}
serialized {
fast recursive static_app1 static_app2
- static_app3 static_lru static_master static_mem
+ static_app3 static_lru static_main static_mem
static_open static_prng static_pmem static_vfs1
static_vfs2 static_vfs3
}
diff --git a/testdata/tcl/pager1.test b/testdata/tcl/pager1.test
index 8216b46..20fd8bd 100644
--- a/testdata/tcl/pager1.test
+++ b/testdata/tcl/pager1.test
@@ -1930,6 +1930,7 @@ do_test pager1-18.4 {
catchsql { SELECT length(x||'') FROM t2 } db2
} {1 {database disk image is malformed}}
db2 close
+extra_schema_checks 0
do_test pager1-18.5 {
sqlite3 db ""
sqlite3_db_config db DEFENSIVE 0
@@ -1944,6 +1945,7 @@ do_test pager1-18.5 {
catchsql { SELECT * FROM x1 }
} {1 {database disk image is malformed}}
db close
+extra_schema_checks 1
do_test pager1-18.6 {
faultsim_delete_and_reopen
diff --git a/testdata/tcl/permutations.test b/testdata/tcl/permutations.test
index d8ec9e4..4ea6cd2 100644
--- a/testdata/tcl/permutations.test
+++ b/testdata/tcl/permutations.test
@@ -136,9 +136,24 @@ if {[info exists ::env(QUICKTEST_INCLUDE)]} {
set allquicktests [concat $allquicktests $::env(QUICKTEST_INCLUDE)]
}
if {[info exists ::env(QUICKTEST_OMIT)]} {
- foreach x [split $::env(QUICKTEST_OMIT) ,] {
- regsub -all \\y$x\\y $allquicktests {} allquicktests
+ # If environment variable QUICKTEST_OMIT is set, it is a comma-separated
+ # list of regular expressions to match against test file names in
+ # the "allquicktests" set. Any matches are excluded. Only the filename
+ # is matched, not any directory component of the path.
+ set all [list]
+ foreach a $allquicktests {
+ set bIn 1
+ foreach x [split $::env(QUICKTEST_OMIT) ,] {
+ if {[regexp $x [file tail $a]]} {
+ set bIn 0
+ break
+ }
+ }
+ if {$bIn} {
+ lappend all $a
+ }
}
+ set allquicktests $all
}
# If the TEST_FAILURE environment variable is set, it means that we what to
@@ -171,6 +186,12 @@ test_suite "veryquick" -prefix "" -description {
*fts5corrupt* *fts5big* *fts5aj*
]
+test_suite "shell" -prefix "" -description {
+ Run tests of the command-line shell
+} -files [
+ test_set [glob $testdir/shell*.test]
+]
+
test_suite "extraquick" -prefix "" -description {
"Extra" quick test suite. Runs in a few minutes on a workstation.
This test suite is the same as the "veryquick" tests, except that
@@ -968,6 +989,7 @@ test_suite "journaltest" -description {
pager1.test syscall.test tkt3457.test *malloc* mmap* multiplex* nolock*
pager2.test *fault* rowal* snapshot* superlock* symlink.test
delete_db.test shmlock.test chunksize.test
+ busy2.test
}]
if {[info commands register_demovfs] != ""} {
diff --git a/testdata/tcl/pg_common.tcl b/testdata/tcl/pg_common.tcl
index b3f35cd..dd16659 100644
--- a/testdata/tcl/pg_common.tcl
+++ b/testdata/tcl/pg_common.tcl
@@ -18,6 +18,8 @@ sqlite3 sqlite ""
proc execsql {sql} {
+ set sql [string map {{WITHOUT ROWID} {}} $sql]
+
set lSql [list]
set frag ""
while {[string length $sql]>0} {
diff --git a/testdata/tcl/pragma.test b/testdata/tcl/pragma.test
index 1881a5c..04f5bd0 100644
--- a/testdata/tcl/pragma.test
+++ b/testdata/tcl/pragma.test
@@ -387,11 +387,15 @@ ifcapable attach {
PRAGMA integrity_check=4
}
} {{row 1 missing from index i2} {row 2 missing from index i2} {wrong # of entries in index i2} {row 1 missing from index i2}}
- do_test pragma-3.6 {
- execsql {
- PRAGMA integrity_check=xyz
- }
- } {{row 1 missing from index i2} {row 2 missing from index i2} {wrong # of entries in index i2} {row 1 missing from index i2} {row 2 missing from index i2} {wrong # of entries in index i2}}
+ do_catchsql_test pragma-3.6 {
+ PRAGMA integrity_check=xyz
+ } {1 {no such table: xyz}}
+ do_catchsql_test pragma-3.6b {
+ PRAGMA integrity_check=t2
+ } {0 {{row 1 missing from index i2} {row 2 missing from index i2} {wrong # of entries in index i2}}}
+ do_catchsql_test pragma-3.6c {
+ PRAGMA integrity_check=sqlite_schema
+ } {0 ok}
do_test pragma-3.7 {
execsql {
PRAGMA integrity_check=0
@@ -423,7 +427,7 @@ ifcapable attach {
do_test pragma-3.8.2 {
execsql {PRAGMA QUICK_CHECK}
} {ok}
- do_test pragma-3.9 {
+ do_test pragma-3.9a {
execsql {
ATTACH 'testerr.db' AS t2;
PRAGMA integrity_check
@@ -432,6 +436,12 @@ ifcapable attach {
Page 4 is never used
Page 5 is never used
Page 6 is never used} {row 1 missing from index i2} {row 2 missing from index i2} {wrong # of entries in index i2}}
+ do_execsql_test pragma-3.9b {
+ PRAGMA t2.integrity_check=t2;
+ } {{row 1 missing from index i2} {row 2 missing from index i2} {wrong # of entries in index i2}}
+ do_execsql_test pragma-3.9c {
+ PRAGMA t2.integrity_check=sqlite_schema;
+ } {ok}
do_test pragma-3.10 {
execsql {
PRAGMA integrity_check=1
diff --git a/testdata/tcl/pragma4.test b/testdata/tcl/pragma4.test
index 2eef060..b82df81 100644
--- a/testdata/tcl/pragma4.test
+++ b/testdata/tcl/pragma4.test
@@ -120,8 +120,15 @@ do_test 4.1.4 {
sqlite3 db2 test.db2
execsql { DROP TABLE t1 } db3
execsql { DROP TABLE t2 } db2
-} {}
-do_execsql_test 4.1.5 { PRAGMA table_info(t1) }
+} {}
+if {[permutation]=="prepare"} {
+ do_catchsql_test 4.1.5a {
+ PRAGMA table_info(t1)
+ } {1 {database schema has changed}}
+}
+do_execsql_test 4.1.5 {
+ PRAGMA table_info(t1)
+}
do_execsql_test 4.1.6 { PRAGMA table_info(t2) }
db2 close
diff --git a/testdata/tcl/printf.test b/testdata/tcl/printf.test
index d6acacb..445470f 100644
--- a/testdata/tcl/printf.test
+++ b/testdata/tcl/printf.test
@@ -538,9 +538,11 @@ do_test printf-2.1.2.8 {
do_test printf-2.1.2.9 {
sqlite3_mprintf_double {abc: %d %d (%1.1g) :xyz} 1 1 1.0e-20
} {abc: 1 1 (1e-20) :xyz}
-do_test printf-2.1.2.10 {
- sqlite3_mprintf_double {abc: %*.*f} 2000000000 1000000000 1.0e-20
-} {}
+if {$SQLITE_MAX_LENGTH<=[expr 1000*1000*1000]} {
+ do_test printf-2.1.2.10 {
+ sqlite3_mprintf_double {abc: %*.*f} 2000000000 1000000000 1.0e-20
+ } {}
+}
do_test printf-2.1.3.1 {
sqlite3_mprintf_double {abc: (%*.*f) :xyz} 1 1 1.0
} {abc: (1.0) :xyz}
diff --git a/testdata/tcl/shell1.test b/testdata/tcl/shell1.test
index c142ea7..678feba 100644
--- a/testdata/tcl/shell1.test
+++ b/testdata/tcl/shell1.test
@@ -199,10 +199,10 @@ do_test shell1-2.2.4 {
} {0 {}}
do_test shell1-2.2.5 {
catchcmd "test.db" ".mode \"insert FOO"
-} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
+} {1 {Error: mode should be one of: ascii box column csv html insert json line list markdown quote table tabs tcl}}
do_test shell1-2.2.6 {
catchcmd "test.db" ".mode \'insert FOO"
-} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
+} {1 {Error: mode should be one of: ascii box column csv html insert json line list markdown quote table tabs tcl}}
# check multiple tokens, and quoted tokens
do_test shell1-2.3.1 {
@@ -230,7 +230,7 @@ do_test shell1-2.3.7 {
# check quoted args are unquoted
do_test shell1-2.4.1 {
catchcmd "test.db" ".mode FOO"
-} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
+} {1 {Error: mode should be one of: ascii box column csv html insert json line list markdown quote table tabs tcl}}
do_test shell1-2.4.2 {
catchcmd "test.db" ".mode csv"
} {0 {}}
@@ -430,7 +430,7 @@ do_test shell1-3.13.1 {
} {0 {current output mode: list}}
do_test shell1-3.13.2 {
catchcmd "test.db" ".mode FOO"
-} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
+} {1 {Error: mode should be one of: ascii box column csv html insert json line list markdown quote table tabs tcl}}
do_test shell1-3.13.3 {
catchcmd "test.db" ".mode csv"
} {0 {}}
@@ -463,10 +463,10 @@ do_test shell1-3.13.11 {
# don't allow partial mode type matches
do_test shell1-3.13.12 {
catchcmd "test.db" ".mode l"
-} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
+} {1 {Error: mode should be one of: ascii box column csv html insert json line list markdown quote table tabs tcl}}
do_test shell1-3.13.13 {
catchcmd "test.db" ".mode li"
-} {1 {Error: mode should be one of: ascii column csv html insert line list quote tabs tcl}}
+} {1 {Error: mode should be one of: ascii box column csv html insert json line list markdown quote table tabs tcl}}
do_test shell1-3.13.14 {
catchcmd "test.db" ".mode lin"
} {0 {}}
@@ -709,11 +709,11 @@ do_test shell1-3.26.4 {
# this should be treated the same as a '1' width for col 1 and 2
} {0 {}}
do_test shell1-3.26.5 {
- catchcmd "test.db" ".mode column\n.width 10 -10\nSELECT 'abcdefg', 123456;"
+ catchcmd "test.db" ".mode column\n.header off\n.width 10 -10\nSELECT 'abcdefg', 123456;"
# this should be treated the same as a '1' width for col 1 and 2
} {0 {abcdefg 123456}}
do_test shell1-3.26.6 {
- catchcmd "test.db" ".mode column\n.width -10 10\nSELECT 'abcdefg', 123456;"
+ catchcmd "test.db" ".mode column\n.header off\n.width -10 10\nSELECT 'abcdefg', 123456;"
# this should be treated the same as a '1' width for col 1 and 2
} {0 { abcdefg 123456 }}
@@ -1166,4 +1166,57 @@ do_test shell1-7.1.7 {
}
+# Test case for the ieee754 and decimal extensions in the shell.
+# See the "floatingpoint.html" file in the documentation for more
+# information.
+#
+do_test shell1-8.1 {
+ catchcmd ":memory:" {
+ -- The pow2 table will hold all the necessary powers of two.
+ CREATE TABLE pow2(x INTEGER PRIMARY KEY, v TEXT);
+ WITH RECURSIVE c(x,v) AS (
+ VALUES(0,'1')
+ UNION ALL
+ SELECT x+1, decimal_mul(v,'2') FROM c WHERE x+1<=971
+ ) INSERT INTO pow2(x,v) SELECT x, v FROM c;
+ WITH RECURSIVE c(x,v) AS (
+ VALUES(-1,'0.5')
+ UNION ALL
+ SELECT x-1, decimal_mul(v,'0.5') FROM c WHERE x-1>=-1075
+ ) INSERT INTO pow2(x,v) SELECT x, v FROM c;
+
+ -- This query finds the decimal representation of each value in the "c" table.
+ WITH c(n) AS (VALUES(47.49))
+ ----XXXXX----------- Replace with whatever you want
+ SELECT decimal_mul(ieee754_mantissa(c.n),pow2.v)
+ FROM pow2, c WHERE pow2.x=ieee754_exponent(c.n);
+ }
+} {0 47.49000000000000198951966012828052043914794921875}
+do_test shell1-8.2 {
+ catchcmd :memory: {
+.mode box
+SELECT ieee754(47.49) AS x;
+ }
+} {0 {โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
+โ”‚ x โ”‚
+โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
+โ”‚ ieee754(6683623321994527,-47) โ”‚
+โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜}}
+do_test shell1-8.3 {
+ catchcmd ":memory: --box" {
+ select ieee754(6683623321994527,-47) as x;
+ }
+} {0 {โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
+โ”‚ x โ”‚
+โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
+โ”‚ 47.49 โ”‚
+โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜}}
+do_test shell1-8.4 {
+ catchcmd ":memory: --table" {SELECT ieee754_mantissa(47.49) AS M, ieee754_exponent(47.49) AS E;}
+} {0 {+------------------+-----+
+| M | E |
++------------------+-----+
+| 6683623321994527 | -47 |
++------------------+-----+}}
+
finish_test
diff --git a/testdata/tcl/stat.test b/testdata/tcl/stat.test
index 105169d..5eb7d6f 100644
--- a/testdata/tcl/stat.test
+++ b/testdata/tcl/stat.test
@@ -59,7 +59,7 @@ if {[wal_is_capable]} {
PRAGMA journal_mode = delete;
SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
FROM stat;
- } {wal delete sqlite_master / 1 leaf 0 0 916 0}
+ } {wal delete sqlite_schema / 1 leaf 0 0 916 0}
}
do_test stat-1.0 {
@@ -85,9 +85,9 @@ do_test stat-1.2 {
do_test stat-1.3 {
execsql {
SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
- FROM stat WHERE name = 'sqlite_master';
+ FROM stat WHERE name = 'sqlite_schema';
}
-} {sqlite_master / 1 leaf 2 77 831 40}
+} {sqlite_schema / 1 leaf 2 77 831 40}
do_test stat-1.4 {
execsql {
DROP TABLE t1;
@@ -108,7 +108,7 @@ do_execsql_test stat-2.1 {
INSERT INTO t3 SELECT a_string(110+rowid), a_string(221+rowid) FROM t3
ORDER BY rowid;
SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
- FROM stat WHERE name != 'sqlite_master' ORDER BY name;
+ FROM stat WHERE name != 'sqlite_schema' ORDER BY name;
} [list \
sqlite_autoindex_t3_1 / 3 internal 3 368 623 125 \
sqlite_autoindex_t3_1 /000/ 8 leaf 8 946 46 123 \
@@ -138,7 +138,7 @@ do_execsql_test stat-2.1agg {
SELECT * FROM dbstat WHERE aggregate=TRUE ORDER BY name;
} [list \
sqlite_autoindex_t3_1 {} 5 {} 32 3898 1065 132 {} 5120 \
- sqlite_master {} 1 {} 2 84 824 49 {} 1024 \
+ sqlite_schema {} 1 {} 2 84 824 49 {} 1024 \
t3 {} 17 {} 47 11188 5815 370 {} 17408 \
]
@@ -158,7 +158,7 @@ do_execsql_test stat-3.1 {
CREATE INDEX i4 ON t4(x);
INSERT INTO t4(rowid, x) VALUES(2, a_string(7777));
SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
- FROM stat WHERE name != 'sqlite_master' ORDER BY name;
+ FROM stat WHERE name != 'sqlite_schema' ORDER BY name;
} [list \
i4 / 3 leaf 1 103 905 7782 \
i4 /000+000000 4 overflow 0 1020 0 0 \
@@ -183,7 +183,7 @@ do_execsql_test stat-3.2 {
SELECT *, '|' FROM dbstat WHERE aggregate=TRUE ORDER BY name;
} [list \
i4 {} 9 {} 1 7782 1386 7782 {} 9216 | \
- sqlite_master {} 1 {} 2 74 834 40 {} 1024 | \
+ sqlite_schema {} 1 {} 2 74 834 40 {} 1024 | \
t4 {} 8 {} 1 7780 367 7780 {} 8192 | \
]
@@ -221,11 +221,11 @@ do_execsql_test stat-5.1 {
do_execsql_test stat-5.20 {
SELECT name, quote(path), pageno, quote(pagetype), ncell, payload,
unused, mx_payload, '|' FROM dbstat('main',1);
-} {sqlite_master NULL 1 NULL 1 34 878 34 | tx NULL 1 NULL 0 0 1016 0 |}
+} {sqlite_schema NULL 1 NULL 1 34 878 34 | tx NULL 1 NULL 0 0 1016 0 |}
do_execsql_test stat-5.21 {
SELECT name, quote(path), pageno, quote(pagetype), ncell, payload,
unused, mx_payload, '|' FROM dbstat('aux1',1);
-} {sqlite_master NULL 1 NULL 1 34 878 34 | t1 NULL 3 NULL 2 3033 5 1517 |}
+} {sqlite_schema NULL 1 NULL 1 34 878 34 | t1 NULL 3 NULL 2 3033 5 1517 |}
do_catchsql_test stat-6.1 {
@@ -247,27 +247,27 @@ do_execsql_test 7.1 {
do_execsql_test 7.1.1 {
SELECT * FROM dbstat('123');
} {
- sqlite_master / 1 leaf 1 37 875 37 0 1024
+ sqlite_schema / 1 leaf 1 37 875 37 0 1024
x1 / 2 leaf 1 4 1008 4 1024 1024
}
do_execsql_test 7.1.2 {
SELECT * FROM dbstat(123);
} {
- sqlite_master / 1 leaf 1 37 875 37 0 1024
+ sqlite_schema / 1 leaf 1 37 875 37 0 1024
x1 / 2 leaf 1 4 1008 4 1024 1024
}
do_execsql_test 7.1.3 {
CREATE VIRTUAL TABLE x2 USING dbstat('123');
SELECT * FROM x2;
} {
- sqlite_master / 1 leaf 1 37 875 37 0 1024
+ sqlite_schema / 1 leaf 1 37 875 37 0 1024
x1 / 2 leaf 1 4 1008 4 1024 1024
}
do_execsql_test 7.1.4 {
CREATE VIRTUAL TABLE x3 USING dbstat(123);
SELECT * FROM x3;
} {
- sqlite_master / 1 leaf 1 37 875 37 0 1024
+ sqlite_schema / 1 leaf 1 37 875 37 0 1024
x1 / 2 leaf 1 4 1008 4 1024 1024
}
@@ -280,7 +280,7 @@ do_execsql_test 7.2 {
do_execsql_test 7.2.1 {
SELECT * FROM dbstat('123corp');
} {
- sqlite_master / 1 leaf 1 37 875 37 0 1024
+ sqlite_schema / 1 leaf 1 37 875 37 0 1024
x1 / 2 leaf 1 4 1008 4 1024 1024
}
do_catchsql_test 7.2.2 {
@@ -290,7 +290,7 @@ do_execsql_test 7.2.3 {
CREATE VIRTUAL TABLE x2 USING dbstat('123corp');
SELECT * FROM x2;
} {
- sqlite_master / 1 leaf 1 37 875 37 0 1024
+ sqlite_schema / 1 leaf 1 37 875 37 0 1024
x1 / 2 leaf 1 4 1008 4 1024 1024
}
do_catchsql_test 7.2.4 {
diff --git a/testdata/tcl/tester.tcl b/testdata/tcl/tester.tcl
index cc7f913..b1acb06 100644
--- a/testdata/tcl/tester.tcl
+++ b/testdata/tcl/tester.tcl
@@ -129,6 +129,7 @@ if {[info command sqlite_orig]==""} {
set ::dbhandle [lindex $args 0]
uplevel #0 $::G(perm:dbconfig)
}
+ [lindex $args 0] cache size 3
set res
} else {
# This command is not opening a new database connection. Pass the
@@ -2478,6 +2479,7 @@ set sqlite_fts3_enable_parentheses 0
# this setting by invoking "database_can_be_corrupt"
#
database_never_corrupt
+extra_schema_checks 1
source $testdir/thread_common.tcl
source $testdir/malloc_common.tcl
diff --git a/testdata/tcl/triggerupfrom.test b/testdata/tcl/triggerupfrom.test
new file mode 100644
index 0000000..9bfacb8
--- /dev/null
+++ b/testdata/tcl/triggerupfrom.test
@@ -0,0 +1,174 @@
+# 2020 July 14
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix triggerupfrom
+
+do_execsql_test 1.0 {
+ CREATE TABLE map(k, v);
+ INSERT INTO map VALUES(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four');
+
+ CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
+
+ CREATE TRIGGER tr AFTER INSERT ON t1 BEGIN
+ UPDATE t1 SET c = v FROM map WHERE k=new.a AND a=new.a;
+ END;
+}
+
+do_execsql_test 1.1 {
+ INSERT INTO t1(a) VALUES(1);
+}
+
+do_execsql_test 1.2 {
+ SELECT a, c FROM t1 ORDER BY a;
+} {1 one}
+
+do_execsql_test 1.3 {
+ INSERT INTO t1(a) VALUES(2), (3), (4), (5);
+ SELECT a, c FROM t1 ORDER BY a;
+} {1 one 2 two 3 three 4 four 5 {}}
+
+forcedelete test.db2
+do_execsql_test 2.0 {
+ ATTACH 'test.db2' AS aux;
+ CREATE TABLE aux.t3(x, y);
+ INSERT INTO aux.t3 VALUES('x', 'y');
+}
+
+do_catchsql_test 2.1 {
+ CREATE TRIGGER tr2 AFTER INSERT ON t1 BEGIN
+ UPDATE t1 SET b = y FROM aux.t3 WHERE k=new.a;
+ END;
+} {1 {trigger tr2 cannot reference objects in database aux}}
+
+do_execsql_test 2.2 {
+ CREATE TEMP TRIGGER tr2 AFTER INSERT ON t1 BEGIN
+ UPDATE t1 SET b = y FROM aux.t3 WHERE a=new.a;
+ END;
+ INSERT INTO t1(a) VALUES(10), (20);
+ SELECT * FROM t1;
+} {
+ 1 {} one
+ 2 {} two
+ 3 {} three
+ 4 {} four
+ 5 {} {}
+ 10 y {}
+ 20 y {}
+}
+
+do_execsql_test 2.3 {
+ CREATE TABLE link(f, t);
+ INSERT INTO link VALUES(5, 2), (20, 10), (2, 1);
+ CREATE TRIGGER tr3 BEFORE DELETE ON t1 BEGIN
+ UPDATE t1 SET b=coalesce(old.b,old.c) FROM main.link WHERE a=t AND old.a=f;
+ END;
+ DELETE FROM t1 WHERE a=2;
+ SELECT * FROM t1;
+} {
+ 1 two one
+ 3 {} three
+ 4 {} four
+ 5 {} {}
+ 10 y {}
+ 20 y {}
+}
+
+db close
+sqlite3 db ""
+do_catchsql_test 2.4 {
+ ATTACH 'test.db' AS yyy;
+ SELECT * FROM t1;
+} {1 {malformed database schema (tr3) - trigger tr3 cannot reference objects in database main}}
+
+#-------------------------------------------------------------------------
+reset_db
+forcedelete test.db2
+do_execsql_test 3.0 {
+ CREATE TABLE mmm(x, y);
+ INSERT INTO mmm VALUES(1, 'one');
+ INSERT INTO mmm VALUES(2, 'two');
+ INSERT INTO mmm VALUES(3, 'three');
+
+ ATTACH 'test.db2' AS aux;
+ CREATE TABLE aux.t1(a, b);
+ CREATE TABLE aux.mmm(x, y);
+ INSERT INTO aux.mmm VALUES(1, 'ONE');
+ INSERT INTO aux.mmm VALUES(2, 'TWO');
+ INSERT INTO aux.mmm VALUES(3, 'THREE');
+
+ CREATE TRIGGER aux.ttt AFTER INSERT ON t1 BEGIN
+ UPDATE t1 SET b=y FROM mmm WHERE x=new.a AND a=new.a;
+ END;
+
+ INSERT INTO t1(a) VALUES (2);
+ SELECT * FROM t1;
+} {2 TWO}
+
+#-------------------------------------------------------------------------
+# Test that INSTEAD OF UPDATE triggers on views work with UPDATE...FROM
+# statements. Including, if the library is built with ENABLE_HIDDEN_COLUMNS,
+# that they work correctly on views with hidden columns.
+#
+reset_db
+do_execsql_test 4.0 {
+ CREATE TABLE t1(k, a, b);
+ INSERT INTO t1 VALUES('a', 1, 'one');
+ INSERT INTO t1 VALUES('b', 2, 'two');
+ INSERT INTO t1 VALUES('c', 3, 'three');
+ INSERT INTO t1 VALUES('d', 4, 'four');
+
+ CREATE TABLE log(x);
+ CREATE VIEW v1 AS SELECT k, a, b AS __hidden__b FROM t1;
+ CREATE TRIGGER tr1 INSTEAD OF UPDATE ON v1 BEGIN
+ INSERT INTO log VALUES(
+ '('||old.a||','||old.__hidden__b||')->('||new.a||','||new.__hidden__b||')'
+ );
+ END;
+}
+
+ifcapable hiddencolumns {
+ do_execsql_test 4.1-hc-enabled {
+ SELECT * FROM v1
+ } {a 1 b 2 c 3 d 4}
+} else {
+ do_execsql_test 4.1-hc-disabled {
+ SELECT * FROM v1
+ } {a 1 one b 2 two c 3 three d 4 four}
+}
+
+do_execsql_test 4.2 {
+ UPDATE v1 SET a='xyz' WHERE k IN ('a', 'c');
+ SELECT * FROM log;
+ DELETE FROM log;
+} {
+ (1,one)->(xyz,one)
+ (3,three)->(xyz,three)
+}
+
+do_execsql_test 4.3 {
+ CREATE TABLE map(k, v);
+ INSERT INTO map VALUES('b', 'twelve');
+ INSERT INTO map VALUES('d', 'fourteen');
+ UPDATE v1 SET a=map.v FROM map WHERE v1.k=map.k;
+ SELECT * FROM log;
+ DELETE FROM log;
+} {
+ (2,two)->(twelve,two)
+ (4,four)->(fourteen,four)
+}
+
+
+
+finish_test
+
diff --git a/testdata/tcl/upfrom1.tcl b/testdata/tcl/upfrom1.tcl
new file mode 100644
index 0000000..22fc68a
--- /dev/null
+++ b/testdata/tcl/upfrom1.tcl
@@ -0,0 +1,115 @@
+# 2020 April 22
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+
+source [file join [file dirname $argv0] pg_common.tcl]
+
+#=========================================================================
+
+start_test upfrom1 "2020 April 22"
+
+foreach {tn wo} {
+ 1 "WITHOUT ROWID"
+ 2 ""
+} {
+eval [string map [list %TN% $tn %WITHOUT_ROWID% $wo] {
+execsql_test 1.%TN%.0 {
+ DROP TABLE IF EXISTS t2;
+ CREATE TABLE t2(a INTEGER PRIMARY KEY, b INTEGER, c INTEGER) %WITHOUT_ROWID%;
+ INSERT INTO t2 VALUES(1, 2, 3);
+ INSERT INTO t2 VALUES(4, 5, 6);
+ INSERT INTO t2 VALUES(7, 8, 9);
+
+ DROP TABLE IF EXISTS chng;
+ CREATE TABLE chng(a INTEGER, b INTEGER, c INTEGER);
+ INSERT INTO chng VALUES(1, 100, 1000);
+ INSERT INTO chng VALUES(7, 700, 7000);
+}
+
+execsql_test 1.%TN%.1 {
+ SELECT * FROM t2;
+}
+
+execsql_test 1.%TN%.2 {
+ UPDATE t2 SET b = chng.b, c = chng.c FROM chng WHERE chng.a = t2.a;
+ SELECT * FROM t2 ORDER BY a;
+}
+
+execsql_test 1.%TN%.3 {
+ DELETE FROM t2;
+ INSERT INTO t2 VALUES(1, 2, 3);
+ INSERT INTO t2 VALUES(4, 5, 6);
+ INSERT INTO t2 VALUES(7, 8, 9);
+}
+
+execsql_test 1.%TN%.4 {
+ UPDATE t2 SET (b, c) = (SELECT b, c FROM chng WHERE a=t2.a)
+ WHERE a IN (SELECT a FROM chng);
+ SELECT * FROM t2 ORDER BY a;
+}
+
+execsql_test 1.%TN%.5 {
+ DROP TABLE IF EXISTS t3;
+ CREATE TABLE t3(a INTEGER PRIMARY KEY, b INTEGER, c TEXT) %WITHOUT_ROWID%;
+ INSERT INTO t3 VALUES(1, 1, 'one');
+ INSERT INTO t3 VALUES(2, 2, 'two');
+ INSERT INTO t3 VALUES(3, 3, 'three');
+
+ DROP TABLE IF EXISTS t4;
+ CREATE TABLE t4(x TEXT);
+ INSERT INTO t4 VALUES('five');
+
+ SELECT * FROM t3 ORDER BY a;
+}
+
+execsql_test 1.%TN%.6 {
+ UPDATE t3 SET c=x FROM t4;
+ SELECT * FROM t3 ORDER BY a;
+}
+}]}
+
+execsql_test 2.1 {
+ DROP TABLE IF EXISTS t5;
+ DROP TABLE IF EXISTS m1;
+ DROP TABLE IF EXISTS m2;
+ CREATE TABLE t5(a INTEGER PRIMARY KEY, b TEXT, c TEXT);
+ CREATE TABLE m1(x INTEGER PRIMARY KEY, y TEXT);
+ CREATE TABLE m2(u INTEGER PRIMARY KEY, v TEXT);
+
+ INSERT INTO t5 VALUES(1, 'one', 'ONE');
+ INSERT INTO t5 VALUES(2, 'two', 'TWO');
+ INSERT INTO t5 VALUES(3, 'three', 'THREE');
+ INSERT INTO t5 VALUES(4, 'four', 'FOUR');
+
+ INSERT INTO m1 VALUES(1, 'i');
+ INSERT INTO m1 VALUES(2, 'ii');
+ INSERT INTO m1 VALUES(3, 'iii');
+
+ INSERT INTO m2 VALUES(1, 'I');
+ INSERT INTO m2 VALUES(3, 'II');
+ INSERT INTO m2 VALUES(4, 'III');
+}
+
+execsql_test 2.2 {
+ UPDATE t5 SET b=y, c=v FROM m1 LEFT JOIN m2 ON (x=u) WHERE x=a;
+ SELECT * FROM t5 ORDER BY a;
+}
+
+errorsql_test 2.3.1 {
+ UPDATE t5 SET b=1 FROM t5;
+}
+errorsql_test 2.3.2 {
+ UPDATE t5 AS apples SET b=1 FROM t5 AS apples;
+}
+
+
+finish_test
+
diff --git a/testdata/tcl/upfrom1.test b/testdata/tcl/upfrom1.test
new file mode 100644
index 0000000..7996f97
--- /dev/null
+++ b/testdata/tcl/upfrom1.test
@@ -0,0 +1,178 @@
+# 2020 April 22
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+# This file implements regression tests for SQLite library.
+#
+
+####################################################
+# DO NOT EDIT! THIS FILE IS AUTOMATICALLY GENERATED!
+####################################################
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix upfrom1
+
+do_execsql_test 1.1.0 {
+ DROP TABLE IF EXISTS t2;
+ CREATE TABLE t2(a INTEGER PRIMARY KEY, b INTEGER, c INTEGER) WITHOUT ROWID;
+ INSERT INTO t2 VALUES(1, 2, 3);
+ INSERT INTO t2 VALUES(4, 5, 6);
+ INSERT INTO t2 VALUES(7, 8, 9);
+
+ DROP TABLE IF EXISTS chng;
+ CREATE TABLE chng(a INTEGER, b INTEGER, c INTEGER);
+ INSERT INTO chng VALUES(1, 100, 1000);
+ INSERT INTO chng VALUES(7, 700, 7000);
+} {}
+
+do_execsql_test 1.1.1 {
+ SELECT * FROM t2;
+} {1 2 3 4 5 6 7 8 9}
+
+do_execsql_test 1.1.2 {
+ UPDATE t2 SET b = chng.b, c = chng.c FROM chng WHERE chng.a = t2.a;
+ SELECT * FROM t2 ORDER BY a;
+} {1 100 1000 4 5 6 7 700 7000}
+
+do_execsql_test 1.1.3 {
+ DELETE FROM t2;
+ INSERT INTO t2 VALUES(1, 2, 3);
+ INSERT INTO t2 VALUES(4, 5, 6);
+ INSERT INTO t2 VALUES(7, 8, 9);
+} {}
+
+do_execsql_test 1.1.4 {
+ UPDATE t2 SET (b, c) = (SELECT b, c FROM chng WHERE a=t2.a)
+ WHERE a IN (SELECT a FROM chng);
+ SELECT * FROM t2 ORDER BY a;
+} {1 100 1000 4 5 6 7 700 7000}
+
+do_execsql_test 1.1.5 {
+ DROP TABLE IF EXISTS t3;
+ CREATE TABLE t3(a INTEGER PRIMARY KEY, b INTEGER, c TEXT) WITHOUT ROWID;
+ INSERT INTO t3 VALUES(1, 1, 'one');
+ INSERT INTO t3 VALUES(2, 2, 'two');
+ INSERT INTO t3 VALUES(3, 3, 'three');
+
+ DROP TABLE IF EXISTS t4;
+ CREATE TABLE t4(x TEXT);
+ INSERT INTO t4 VALUES('five');
+
+ SELECT * FROM t3 ORDER BY a;
+} {1 1 one 2 2 two 3 3 three}
+
+do_execsql_test 1.1.6 {
+ UPDATE t3 SET c=x FROM t4;
+ SELECT * FROM t3 ORDER BY a;
+} {1 1 five 2 2 five 3 3 five}
+
+do_execsql_test 1.2.0 {
+ DROP TABLE IF EXISTS t2;
+ CREATE TABLE t2(a INTEGER PRIMARY KEY, b INTEGER, c INTEGER) ;
+ INSERT INTO t2 VALUES(1, 2, 3);
+ INSERT INTO t2 VALUES(4, 5, 6);
+ INSERT INTO t2 VALUES(7, 8, 9);
+
+ DROP TABLE IF EXISTS chng;
+ CREATE TABLE chng(a INTEGER, b INTEGER, c INTEGER);
+ INSERT INTO chng VALUES(1, 100, 1000);
+ INSERT INTO chng VALUES(7, 700, 7000);
+} {}
+
+do_execsql_test 1.2.1 {
+ SELECT * FROM t2;
+} {1 2 3 4 5 6 7 8 9}
+
+do_execsql_test 1.2.2 {
+ UPDATE t2 SET b = chng.b, c = chng.c FROM chng WHERE chng.a = t2.a;
+ SELECT * FROM t2 ORDER BY a;
+} {1 100 1000 4 5 6 7 700 7000}
+
+do_execsql_test 1.2.3 {
+ DELETE FROM t2;
+ INSERT INTO t2 VALUES(1, 2, 3);
+ INSERT INTO t2 VALUES(4, 5, 6);
+ INSERT INTO t2 VALUES(7, 8, 9);
+} {}
+
+do_execsql_test 1.2.4 {
+ UPDATE t2 SET (b, c) = (SELECT b, c FROM chng WHERE a=t2.a)
+ WHERE a IN (SELECT a FROM chng);
+ SELECT * FROM t2 ORDER BY a;
+} {1 100 1000 4 5 6 7 700 7000}
+
+do_execsql_test 1.2.5 {
+ DROP TABLE IF EXISTS t3;
+ CREATE TABLE t3(a INTEGER PRIMARY KEY, b INTEGER, c TEXT) ;
+ INSERT INTO t3 VALUES(1, 1, 'one');
+ INSERT INTO t3 VALUES(2, 2, 'two');
+ INSERT INTO t3 VALUES(3, 3, 'three');
+
+ DROP TABLE IF EXISTS t4;
+ CREATE TABLE t4(x TEXT);
+ INSERT INTO t4 VALUES('five');
+
+ SELECT * FROM t3 ORDER BY a;
+} {1 1 one 2 2 two 3 3 three}
+
+do_execsql_test 1.2.6 {
+ UPDATE t3 SET c=x FROM t4;
+ SELECT * FROM t3 ORDER BY a;
+} {1 1 five 2 2 five 3 3 five}
+
+do_execsql_test 2.1 {
+ DROP TABLE IF EXISTS t5;
+ DROP TABLE IF EXISTS m1;
+ DROP TABLE IF EXISTS m2;
+ CREATE TABLE t5(a INTEGER PRIMARY KEY, b TEXT, c TEXT);
+ CREATE TABLE m1(x INTEGER PRIMARY KEY, y TEXT);
+ CREATE TABLE m2(u INTEGER PRIMARY KEY, v TEXT);
+
+ INSERT INTO t5 VALUES(1, 'one', 'ONE');
+ INSERT INTO t5 VALUES(2, 'two', 'TWO');
+ INSERT INTO t5 VALUES(3, 'three', 'THREE');
+ INSERT INTO t5 VALUES(4, 'four', 'FOUR');
+
+ INSERT INTO m1 VALUES(1, 'i');
+ INSERT INTO m1 VALUES(2, 'ii');
+ INSERT INTO m1 VALUES(3, 'iii');
+
+ INSERT INTO m2 VALUES(1, 'I');
+ INSERT INTO m2 VALUES(3, 'II');
+ INSERT INTO m2 VALUES(4, 'III');
+} {}
+
+do_execsql_test 2.2 {
+ UPDATE t5 SET b=y, c=v FROM m1 LEFT JOIN m2 ON (x=u) WHERE x=a;
+ SELECT * FROM t5 ORDER BY a;
+} {1 i I 2 ii {} 3 iii II 4 four FOUR}
+
+# PG says ERROR: table name "t5" specified more than once
+do_test 2.3.1 { catch { execsql {
+ UPDATE t5 SET b=1 FROM t5;
+} } } 1
+
+# PG says ERROR: table name "apples" specified more than once
+do_test 2.3.2 { catch { execsql {
+ UPDATE t5 AS apples SET b=1 FROM t5 AS apples;
+} } } 1
+
+# Problem found by OSSFuzz on 2020-07-20
+# https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24282
+#
+reset_db
+do_execsql_test 3.1 {
+ CREATE TABLE t0(a);
+ CREATE TABLE t1(b);
+ UPDATE t1 SET b=sum(a) FROM t0;
+ SELECT * FROM t0, t1;
+} {}
+
+finish_test
diff --git a/testdata/tcl/upfrom2.test b/testdata/tcl/upfrom2.test
new file mode 100644
index 0000000..f903c1f
--- /dev/null
+++ b/testdata/tcl/upfrom2.test
@@ -0,0 +1,371 @@
+# 2020 April 29
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix upfrom2
+
+# Test cases:
+#
+# 1.*: Test that triggers are fired correctly for UPDATE FROM statements,
+# and only once for each row. Except for INSTEAD OF triggers on
+# views - these are fired once for each row returned by the join,
+# including duplicates.
+#
+# 2.*: Test adding ORDER BY and LIMIT clauses with UPDATE FROM statements.
+#
+# 5.*: Test that specifying the target table name or alias in the FROM
+# clause of an UPDATE statement is an error.
+#
+
+foreach {tn wo} {
+ 1 ""
+ 2 "WITHOUT ROWID"
+} {
+ reset_db
+
+ eval [string map [list %WO% $wo %TN% $tn] {
+ do_execsql_test 1.%TN%.0 {
+ CREATE TABLE log(t TEXT);
+ CREATE TABLE t1(x PRIMARY KEY, y, z UNIQUE) %WO%;
+ CREATE INDEX t1y ON t1(y);
+
+ INSERT INTO t1 VALUES(1, 'i', 'one');
+ INSERT INTO t1 VALUES(2, 'ii', 'two');
+ INSERT INTO t1 VALUES(3, 'iii', 'three');
+ INSERT INTO t1 VALUES(4, 'iv', 'four');
+
+ CREATE TRIGGER tr1 BEFORE UPDATE ON t1 BEGIN
+ INSERT INTO log VALUES(old.z || '->' || new.z);
+ END;
+ CREATE TRIGGER tr2 AFTER UPDATE ON t1 BEGIN
+ INSERT INTO log VALUES(old.y || '->' || new.y);
+ END;
+ }
+
+ do_execsql_test 1.%TN%.1 {
+ WITH data(k, v) AS (
+ VALUES(3, 'thirty'), (1, 'ten')
+ )
+ UPDATE t1 SET z=v FROM data WHERE x=k;
+
+ SELECT * FROM t1;
+ SELECT * FROM log;
+ } {
+ 1 i ten 2 ii two 3 iii thirty 4 iv four
+ one->ten i->i
+ three->thirty iii->iii
+ }
+
+ do_execsql_test 1.%TN%.2 {
+ CREATE TABLE t2(a, b);
+ CREATE TABLE t3(k, v);
+
+ INSERT INTO t3 VALUES(5, 'v');
+ INSERT INTO t3 VALUES(12, 'xii');
+
+ INSERT INTO t2 VALUES(2, 12);
+ INSERT INTO t2 VALUES(3, 5);
+
+ DELETE FROM log;
+ UPDATE t1 SET y=v FROM t2, t3 WHERE t1.x=t2.a AND t3.k=t2.b;
+
+ SELECT * FROM t1;
+ SELECT * FROM log;
+ } {
+ 1 i ten 2 xii two 3 v thirty 4 iv four
+ two->two ii->xii
+ thirty->thirty iii->v
+ }
+
+ do_execsql_test 1.%TN%.3 {
+ DELETE FROM log;
+ WITH data(k, v) AS (
+ VALUES(1, 'seven'), (1, 'eight'), (2, 'eleven'), (2, 'twelve')
+ )
+ UPDATE t1 SET z=v FROM data WHERE x=k;
+
+ SELECT * FROM t1;
+ SELECT * FROM log;
+ } {
+ 1 i eight 2 xii twelve 3 v thirty 4 iv four
+ ten->eight i->i
+ two->twelve xii->xii
+ }
+
+ do_test 1.%TN%.4 { db changes } {2}
+
+ do_execsql_test 1.%TN%.5 {
+ CREATE VIEW v1 AS SELECT * FROM t1;
+ CREATE TRIGGER v1tr INSTEAD OF UPDATE ON v1 BEGIN
+ UPDATE t1 SET y=new.y, z=new.z WHERE x=new.x;
+ END;
+
+ DELETE FROM log;
+ WITH data(k, v) AS (
+ VALUES(3, 'thirteen'), (3, 'fourteen'), (4, 'fifteen'), (4, 'sixteen')
+ )
+ UPDATE v1 SET z=v FROM data WHERE x=k;
+ }
+
+ do_execsql_test 1.%TN%.6 {
+ SELECT * FROM v1;
+ SELECT * FROM log;
+ } {
+ 1 i eight 2 xii twelve 3 v fourteen 4 iv sixteen
+ thirty->thirteen v->v
+ thirteen->fourteen v->v
+ four->fifteen iv->iv
+ fifteen->sixteen iv->iv
+ }
+
+ #--------------------------------------------------------------
+
+ do_execsql_test 1.%TN%.7 {
+ CREATE TABLE o1(w, x, y, z UNIQUE, PRIMARY KEY(w, x)) %WO%;
+ CREATE INDEX o1y ON t1(y);
+
+ INSERT INTO o1 VALUES(0, 0, 'i', 'one');
+ INSERT INTO o1 VALUES(0, 1, 'ii', 'two');
+ INSERT INTO o1 VALUES(1, 0, 'iii', 'three');
+ INSERT INTO o1 VALUES(1, 1, 'iv', 'four');
+
+ CREATE TRIGGER tro1 BEFORE UPDATE ON o1 BEGIN
+ INSERT INTO log VALUES(old.z || '->' || new.z);
+ END;
+ CREATE TRIGGER tro2 AFTER UPDATE ON o1 BEGIN
+ INSERT INTO log VALUES(old.y || '->' || new.y);
+ END;
+ }
+
+ do_execsql_test 1.%TN%.8 {
+ DELETE FROM log;
+ WITH data(k, v) AS (
+ VALUES(3, 'thirty'), (1, 'ten')
+ )
+ UPDATE o1 SET z=v FROM data WHERE (1+x+w*2)=k;
+
+ SELECT * FROM o1;
+ SELECT * FROM log;
+ } {
+ 0 0 i ten 0 1 ii two 1 0 iii thirty 1 1 iv four
+ one->ten i->i
+ three->thirty iii->iii
+ }
+
+ do_execsql_test 1.%TN%.9 {
+ DELETE FROM log;
+ UPDATE o1 SET y=v FROM t2, t3 WHERE (1+o1.w*2+o1.x)=t2.a AND t3.k=t2.b;
+
+ SELECT * FROM o1;
+ SELECT * FROM log;
+ } {
+ 0 0 i ten 0 1 xii two 1 0 v thirty 1 1 iv four
+ two->two ii->xii
+ thirty->thirty iii->v
+ }
+
+ do_execsql_test 1.%TN%.10 {
+ DELETE FROM log;
+ WITH data(k, v) AS (
+ VALUES(1, 'seven'), (1, 'eight'), (2, 'eleven'), (2, 'twelve')
+ )
+ UPDATE o1 SET z=v FROM data WHERE (1+w*2+x)=k;
+
+ SELECT * FROM o1;
+ SELECT * FROM log;
+ } {
+ 0 0 i eight 0 1 xii twelve 1 0 v thirty 1 1 iv four
+ ten->eight i->i
+ two->twelve xii->xii
+ }
+
+ do_test 1.%TN%.11 { db changes } {2}
+
+ do_execsql_test 1.%TN%.12 {
+ CREATE VIEW w1 AS SELECT * FROM o1;
+ CREATE TRIGGER w1tr INSTEAD OF UPDATE ON w1 BEGIN
+ UPDATE o1 SET y=new.y, z=new.z WHERE w=new.w AND x=new.x;
+ END;
+
+ DELETE FROM log;
+ WITH data(k, v) AS (
+ VALUES(3, 'thirteen'), (3, 'fourteen'), (4, 'fifteen'), (4, 'sixteen')
+ )
+ UPDATE w1 SET z=v FROM data WHERE (1+w*2+x)=k;
+ }
+
+ do_execsql_test 1.%TN%.13 {
+ SELECT * FROM w1;
+ SELECT * FROM log;
+ } {
+ 0 0 i eight 0 1 xii twelve 1 0 v fourteen 1 1 iv sixteen
+ thirty->thirteen v->v
+ thirteen->fourteen v->v
+ four->fifteen iv->iv
+ fifteen->sixteen iv->iv
+ }
+
+}]
+}
+
+ifcapable update_delete_limit {
+foreach {tn wo} {
+ 1 ""
+ 2 "WITHOUT ROWID"
+} {
+ reset_db
+
+eval [string map [list %WO% $wo %TN% $tn] {
+ do_execsql_test 2.%TN%.1 {
+ CREATE TABLE x1(a INTEGER PRIMARY KEY, b) %WO%;
+ INSERT INTO x1 VALUES
+ (1, 'one'), (2, 'two'), (3, 'three'), (4, 'four'),
+ (5, 'five'), (6, 'six'), (7, 'seven'), (8, 'eight');
+ }
+
+ do_execsql_test 2.%TN%.2 {
+ CREATE TABLE data1(x, y);
+ INSERT INTO data1 VALUES
+ (1, 'eleven'), (1, 'twenty-one'), (2, 'twelve'), (2, 'twenty-two'),
+ (3, 'thirteen'), (3, 'twenty-three'), (4, 'fourteen'), (4, 'twenty-four');
+ }
+
+ do_execsql_test 2.%TN%.3 {
+ UPDATE x1 SET b=y FROM data1 WHERE a=x ORDER BY a LIMIT 3;
+ SELECT * FROM x1;
+ } {
+ 1 eleven 2 twelve 3 thirteen 4 four 5 five 6 six 7 seven 8 eight
+ }
+
+ do_execsql_test 2.%TN%.4 {
+ UPDATE x1 SET b=b||y FROM data1 WHERE a=x ORDER BY b LIMIT 3;
+ SELECT * FROM x1;
+ } {
+ 1 eleveneleven 2 twelve 3 thirteenthirteen 4 fourfourteen
+ 5 five 6 six 7 seven 8 eight
+ }
+
+ do_catchsql_test 2.%TN%.5 {
+ UPDATE x1 SET b=b||b ORDER BY b;
+ } {1 {ORDER BY without LIMIT on UPDATE}}
+ do_catchsql_test 2.%TN%.6 {
+ UPDATE x1 SET b=b||y FROM data1 WHERE a=x ORDER BY b;
+ } {1 {ORDER BY without LIMIT on UPDATE}}
+
+ #-----------------------------------------------------------------------
+
+ do_execsql_test 2.%TN%.6 {
+ DROP TABLE x1;
+ CREATE TABLE x1(u, v, b, PRIMARY KEY(u, v)) %WO%;
+ INSERT INTO x1 VALUES
+ (0, 1, 'one'), (1, 0, 'two'), (1, 1, 'three'), (2, 0, 'four'),
+ (2, 1, 'five'), (3, 0, 'six'), (3, 1, 'seven'), (4, 0, 'eight');
+ }
+
+ do_execsql_test 2.%TN%.7 {
+ UPDATE x1 SET b=y FROM data1 WHERE (u*2+v)=x ORDER BY u, v LIMIT 3;
+ SELECT * FROM x1;
+ } {
+ 0 1 eleven 1 0 twelve 1 1 thirteen 2 0 four
+ 2 1 five 3 0 six 3 1 seven 4 0 eight
+ }
+
+ do_execsql_test 2.%TN%.8 {
+ UPDATE x1 SET b=b||y FROM data1 WHERE (u*2+v)=x ORDER BY b LIMIT 3;
+ SELECT * FROM x1;
+ } {
+ 0 1 eleveneleven 1 0 twelve 1 1 thirteenthirteen 2 0 fourfourteen
+ 2 1 five 3 0 six 3 1 seven 4 0 eight
+ }
+
+
+}]
+}}
+
+reset_db
+do_execsql_test 3.0 {
+ CREATE TABLE data(x, y, z);
+ CREATE VIEW t1 AS SELECT * FROM data;
+ CREATE TRIGGER t1_insert INSTEAD OF INSERT ON t1 BEGIN
+ INSERT INTO data VALUES(new.x, new.y, new.z);
+ END;
+ CREATE TRIGGER t1_update INSTEAD OF UPDATE ON t1 BEGIN
+ INSERT INTO log VALUES(old.z || '->' || new.z);
+ END;
+
+ CREATE TABLE log(t TEXT);
+
+ INSERT INTO t1 VALUES(1, 'i', 'one');
+ INSERT INTO t1 VALUES(2, 'ii', 'two');
+ INSERT INTO t1 VALUES(3, 'iii', 'three');
+ INSERT INTO t1 VALUES(4, 'iv', 'four');
+}
+
+do_execsql_test 3.1 {
+ WITH input(k, v) AS (
+ VALUES(3, 'thirty'), (1, 'ten')
+ )
+ UPDATE t1 SET z=v FROM input WHERE x=k;
+}
+
+foreach {tn sql} {
+ 2 {
+ CREATE TABLE x1(a INT PRIMARY KEY, b, c) WITHOUT ROWID;
+ }
+ 1 {
+ CREATE TABLE x1(a INTEGER PRIMARY KEY, b, c);
+ }
+ 3 {
+ CREATE TABLE x1(a INT PRIMARY KEY, b, c);
+ }
+} {
+
+ reset_db
+ execsql $sql
+
+ do_execsql_test 4.$tn.0 {
+ INSERT INTO x1 VALUES(1, 1, 1);
+ INSERT INTO x1 VALUES(2, 2, 2);
+ INSERT INTO x1 VALUES(3, 3, 3);
+ INSERT INTO x1 VALUES(4, 4, 4);
+ INSERT INTO x1 VALUES(5, 5, 5);
+ CREATE TABLE map(o, t);
+ INSERT INTO map VALUES(3, 30), (4, 40), (1, 10);
+ }
+
+ do_execsql_test 4.$tn.1 {
+ UPDATE x1 SET a=t FROM map WHERE a=o;
+ SELECT * FROM x1 ORDER BY a;
+ } {2 2 2 5 5 5 10 1 1 30 3 3 40 4 4}
+}
+
+reset_db
+do_execsql_test 5.0 {
+ CREATE TABLE x1(a, b, c);
+ CREATE TABLE x2(a, b, c);
+}
+
+foreach {tn update nm} {
+ 1 "UPDATE x1 SET a=5 FROM x1" x1
+ 2 "UPDATE x1 AS grapes SET a=5 FROM x1 AS grapes" grapes
+ 3 "UPDATE x1 SET a=5 FROM x2, x1" x1
+ 4 "UPDATE x1 AS grapes SET a=5 FROM x2, x1 AS grapes" grapes
+} {
+ do_catchsql_test 5.$tn $update \
+ "1 {target object/alias may not appear in FROM clause: $nm}"
+}
+
+
+finish_test
+
+
diff --git a/testdata/tcl/upfrom3.test b/testdata/tcl/upfrom3.test
new file mode 100644
index 0000000..d30b3fa
--- /dev/null
+++ b/testdata/tcl/upfrom3.test
@@ -0,0 +1,262 @@
+# 2020 July 14
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix upfrom3
+
+# Test plan:
+#
+# 1.*: Test UPDATE ... FROM statements that modify IPK fields. And that
+# modify "INTEGER PRIMARY KEY" fields on WITHOUT ROWID tables.
+#
+# 2.*: Test UPDATE ... FROM statements that modify PK fields of WITHOUT
+# ROWID tables.
+#
+# 3.*: Test that UPDATE ... FROM statements are not confused if there
+# are multiple tables of the same name in attached databases.
+#
+# 4.*: Tests for UPDATE ... FROM statements and foreign keys.
+#
+
+foreach {tn wo} {
+ 1 ""
+ 2 "WITHOUT ROWID"
+} {
+ reset_db
+ eval [string map [list %WO% $wo %TN% $tn] {
+
+ do_execsql_test 1.%TN%.0 {
+ CREATE TABLE log(t TEXT);
+ CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z UNIQUE) %WO%;
+ CREATE INDEX t1y ON t1(y);
+
+ INSERT INTO t1 VALUES(1, 'i', 'one');
+ INSERT INTO t1 VALUES(2, 'ii', 'two');
+ INSERT INTO t1 VALUES(3, 'iii', 'three');
+ INSERT INTO t1 VALUES(4, 'iv', 'four');
+ }
+
+ do_execsql_test 1.%TN%.1 {
+ CREATE TABLE x1(o, n);
+ INSERT INTO x1 VALUES(1, 11);
+ INSERT INTO x1 VALUES(2, 12);
+ INSERT INTO x1 VALUES(3, 13);
+ INSERT INTO x1 VALUES(4, 14);
+ UPDATE t1 SET x=n FROM x1 WHERE x=o;
+ SELECT x, y, z FROM t1 ORDER BY 1;
+ } {
+ 11 i one
+ 12 ii two
+ 13 iii three
+ 14 iv four
+ }
+
+ do_test 1.%TN%.2 { db changes } 4
+
+ do_execsql_test 1.%TN%.3 {
+ INSERT INTO x1 VALUES(11, 21);
+ INSERT INTO x1 VALUES(12, 22);
+ INSERT INTO x1 VALUES(13, 23);
+ INSERT INTO x1 VALUES(14, 24);
+
+ INSERT INTO x1 VALUES(21, 31);
+ INSERT INTO x1 VALUES(22, 32);
+ INSERT INTO x1 VALUES(23, 33);
+ INSERT INTO x1 VALUES(24, 34);
+ UPDATE t1 SET x=n FROM x1 WHERE x=o;
+ SELECT x, y, z FROM t1 ORDER BY 1;
+ } {
+ 21 i one
+ 22 ii two
+ 23 iii three
+ 24 iv four
+ }
+
+ do_execsql_test 1.%TN%.4 {
+ UPDATE t1 SET x=n FROM x1 WHERE x=o;
+ SELECT x, y, z FROM t1 ORDER BY 1;
+ } {
+ 31 i one
+ 32 ii two
+ 33 iii three
+ 34 iv four
+ }
+
+ do_execsql_test 1.%TN%.5 {
+ INSERT INTO x1 VALUES(31, 32);
+ INSERT INTO x1 VALUES(33, 34);
+ UPDATE OR REPLACE t1 SET x=n FROM x1 WHERE x=o;
+ SELECT x, y, z FROM t1 ORDER BY 1;
+ } {
+ 32 i one
+ 34 iii three
+ }
+
+ do_execsql_test 1.%TN%.6 {
+ INSERT INTO t1 VALUES(33, 'ii', 'two');
+ INSERT INTO t1 VALUES(35, 'iv', 'four');
+ }
+
+ do_execsql_test 1.%TN%.7 {
+ CREATE TABLE x2(o, n, zz);
+ INSERT INTO x2 VALUES(32, 41, 'four');
+ INSERT INTO x2 VALUES(33, 42, 'three');
+ UPDATE OR IGNORE t1 SET x=n, z=zz FROM x2 WHERE x=o;
+ SELECT x, y, z FROM t1 ORDER BY 1;
+ } {
+ 32 i one
+ 33 ii two
+ 34 iii three
+ 35 iv four
+ }
+
+ do_execsql_test 1.%TN%.8 {
+ UPDATE OR REPLACE t1 SET x=n, z=zz FROM x2 WHERE x=o;
+ SELECT x, y, z FROM t1 ORDER BY 1;
+ } {
+ 41 i four
+ 42 ii three
+ }
+
+ }]
+}
+
+do_execsql_test 2.1.1 {
+ CREATE TABLE u1(a, b, c, PRIMARY KEY(b, c)) WITHOUT ROWID;
+ INSERT INTO u1 VALUES(0, 0, 0);
+ INSERT INTO u1 VALUES(1, 0, 1);
+ INSERT INTO u1 VALUES(2, 1, 0);
+ INSERT INTO u1 VALUES(3, 1, 1);
+}
+
+do_execsql_test 2.1.2 {
+ CREATE TABLE map(f, t);
+ INSERT INTO map VALUES(0, 10);
+ INSERT INTO map VALUES(1, 11);
+ UPDATE u1 SET c=t FROM map WHERE c=f;
+ SELECT * FROM u1 ORDER BY a;
+} {
+ 0 0 10
+ 1 0 11
+ 2 1 10
+ 3 1 11
+}
+
+do_execsql_test 2.1.3 {
+ UPDATE u1 SET b=t FROM map WHERE b=f;
+ SELECT * FROM u1 ORDER BY a;
+} {
+ 0 10 10
+ 1 10 11
+ 2 11 10
+ 3 11 11
+}
+
+do_execsql_test 2.1.4 {
+ CREATE TABLE map2(o1, o2, n1, n2);
+ INSERT INTO map2 VALUES
+ (10, 10, 50, 50), (10, 11, 50, 60),
+ (11, 10, 60, 50), (11, 11, 60, 60);
+ UPDATE u1 SET b=n1, c=n2 FROM map2 WHERE b=o1 AND c=o2;
+ SELECT * FROM u1 ORDER BY a;
+} {
+ 0 50 50
+ 1 50 60
+ 2 60 50
+ 3 60 60
+}
+
+#-------------------------------------------------------------------------
+foreach {tn wo} {
+ 1 ""
+ 2 "WITHOUT ROWID"
+} {
+ reset_db
+ forcedelete test.db2
+ eval [string map [list %WO% $wo %TN% $tn] {
+ do_execsql_test 3.$tn.1 {
+ CREATE TABLE g1(a, b, c, PRIMARY KEY(a, b)) %WO%;
+ INSERT INTO g1 VALUES(1, 1, 1);
+
+ ATTACH 'test.db2' AS aux;
+ CREATE TABLE aux.g1(a, b, c, PRIMARY KEY(a, b)) %WO%;
+ INSERT INTO aux.g1 VALUES(10, 1, 10);
+ INSERT INTO aux.g1 VALUES(20, 2, 20);
+ INSERT INTO aux.g1 VALUES(30, 3, 30);
+ }
+
+ do_execsql_test 3.$tn.2 {
+ UPDATE aux.g1 SET c=101 FROM main.g1;
+ }
+ do_execsql_test 3.$tn.3 {
+ SELECT * FROM aux.g1;
+ } {10 1 101 20 2 101 30 3 101}
+
+ do_execsql_test 3.$tn.4 {
+ UPDATE g1 SET c=101 FROM g1 AS g2;
+ }
+ do_execsql_test 3.$tn.5 {
+ SELECT * FROM g1;
+ } {1 1 101}
+ }]
+}
+
+#-------------------------------------------------------------------------
+reset_db
+foreach {tn wo} {
+ 1 ""
+ 2 "WITHOUT ROWID"
+} {
+ reset_db
+ forcedelete test.db2
+ eval [string map [list %WO% $wo %TN% $tn] {
+
+ do_execsql_test 4.$tn.1 {
+ CREATE TABLE p1(a INTEGER PRIMARY KEY, b) %WO%;
+ CREATE TABLE c1(x PRIMARY KEY, y REFERENCES p1 ON UPDATE CASCADE) %WO%;
+ PRAGMA foreign_keys = 1;
+
+ INSERT INTO p1 VALUES(1, 'one');
+ INSERT INTO p1 VALUES(11, 'eleven');
+ INSERT INTO p1 VALUES(111, 'eleventyone');
+
+ INSERT INTO c1 VALUES('a', 1);
+ INSERT INTO c1 VALUES('b', 11);
+ INSERT INTO c1 VALUES('c', 111);
+ }
+
+ do_execsql_test 4.$tn.2 {
+ CREATE TABLE map(f, t);
+ INSERT INTO map VALUES('a', 111);
+ INSERT INTO map VALUES('c', 112);
+ }
+
+ do_catchsql_test 4.$tn.3 {
+ UPDATE c1 SET y=t FROM map WHERE x=f;
+ } {1 {FOREIGN KEY constraint failed}}
+
+ do_execsql_test 4.$tn.4 {
+ INSERT INTO map VALUES('eleven', 12);
+ INSERT INTO map VALUES('eleventyone', 112);
+ UPDATE p1 SET a=t FROM map WHERE b=f;
+ }
+
+ do_execsql_test 4.$tn.5 {
+ SELECT * FROM c1
+ } {a 1 b 12 c 112}
+
+ }]
+}
+
+finish_test
+
diff --git a/testdata/tcl/upfromfault.test b/testdata/tcl/upfromfault.test
new file mode 100644
index 0000000..fcb5956
--- /dev/null
+++ b/testdata/tcl/upfromfault.test
@@ -0,0 +1,140 @@
+# 2020 April 29
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix upfromfault
+
+foreach {tn sql} {
+ 1 {
+ CREATE TABLE t1(x PRIMARY KEY, y, z UNIQUE);
+ CREATE INDEX t1y ON t1(y);
+ }
+ 2 {
+ CREATE TABLE t1(x PRIMARY KEY, y, z UNIQUE) WITHOUT ROWID;
+ CREATE INDEX t1y ON t1(y);
+ }
+ 3 {
+ CREATE TABLE t1(x, y, z UNIQUE, PRIMARY KEY(x,y)) WITHOUT ROWID;
+ }
+ 4 {
+ CREATE VIRTUAL TABLE t1 USING fts5(x, y, z);
+ }
+ 5 {
+ CREATE TABLE real(x, y, z);
+ CREATE VIEW t1 AS SELECT * FROM real;
+ CREATE TRIGGER t1_insert INSTEAD OF INSERT ON t1 BEGIN
+ INSERT INTO real VALUES(new.x, new.y, new.z);
+ END;
+ CREATE TRIGGER t1_update INSTEAD OF UPDATE ON t1 BEGIN
+ INSERT INTO log VALUES(old.z || '->' || new.z);
+ UPDATE real SET y=new.y, z=new.z WHERE x=old.x;
+ END;
+ }
+} {
+if {$tn<5} continue
+ reset_db
+
+ ifcapable !fts5 { if {$tn==4} continue }
+
+ execsql $sql
+ do_execsql_test 1.$tn.0 {
+ CREATE TABLE log(t TEXT);
+
+ INSERT INTO t1 VALUES(1, 'i', 'one');
+ INSERT INTO t1 VALUES(2, 'ii', 'two');
+ INSERT INTO t1 VALUES(3, 'iii', 'three');
+ INSERT INTO t1 VALUES(4, 'iv', 'four');
+ }
+ if {$tn!=4 && $tn!=5} {
+ do_execsql_test 1.$tn.0b {
+ CREATE TRIGGER tr1 BEFORE UPDATE ON t1 BEGIN
+ INSERT INTO log VALUES(old.z || '->' || new.z);
+ END;
+ CREATE TRIGGER tr2 AFTER UPDATE ON t1 BEGIN
+ INSERT INTO log VALUES(old.y || '->' || new.y);
+ END;
+ }
+ }
+
+ faultsim_save_and_close
+
+ do_faultsim_test 1.$tn -prep {
+ faultsim_restore_and_reopen
+ execsql { SELECT * FROM t1 }
+ } -body {
+ execsql {
+ WITH data(k, v) AS (
+ VALUES(3, 'thirty'), (1, 'ten')
+ )
+ UPDATE t1 SET z=v FROM data WHERE x=k;
+ }
+ } -test {
+ faultsim_test_result {0 {}} {1 {vtable constructor failed: t1}}
+ if {$testrc==0} {
+ set res [execsql { SELECT * FROM t1 }]
+ if {$res!="1 i ten 2 ii two 3 iii thirty 4 iv four"} {
+ error "unexpected result: $res"
+ }
+ }
+ }
+}
+
+reset_db
+do_execsql_test 2.0 {
+ CREATE TABLE t1(a, b, c);
+ CREATE TABLE t2(x, y, z);
+}
+faultsim_save_and_close
+do_faultsim_test 2.1 -prep {
+ faultsim_restore_and_reopen
+} -body {
+ execsql {
+ CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
+ UPDATE t2 SET x=a FROM t1 WHERE c=z;
+ END;
+ }
+} -test {
+ faultsim_test_result {0 {}}
+}
+
+faultsim_restore_and_reopen
+do_execsql_test 2.2 {
+ CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
+ UPDATE t1 SET a=x FROM t2 WHERE c=z;
+ END;
+
+ INSERT INTO t2 VALUES(1, 1, 1);
+ INSERT INTO t2 VALUES(2, 2, 2);
+ INSERT INTO t2 VALUES(3, 3, 3);
+}
+faultsim_save_and_close
+
+do_faultsim_test 2.3 -prep {
+ faultsim_restore_and_reopen
+} -body {
+ execsql {
+ INSERT INTO t1 VALUES(NULL, NULL, 1), (NULL, NULL, 3);
+ }
+} -test {
+ faultsim_test_result {0 {}}
+ if {$testrc==0} {
+ set res [execsql { SELECT * FROM t1 }]
+ if {$res!="1 {} 1 3 {} 3"} {
+ error "unexpected result: $res"
+ }
+ }
+}
+
+
+finish_test
+
diff --git a/testdata/tcl/wal2.test b/testdata/tcl/wal2.test
index 9a56eb4..ae6134d 100644
--- a/testdata/tcl/wal2.test
+++ b/testdata/tcl/wal2.test
@@ -122,8 +122,12 @@ do_test wal2-1.1 {
} {4 10}
set RECOVER [list \
- {0 1 lock exclusive} {1 2 lock exclusive} {4 4 lock exclusive} \
- {1 2 unlock exclusive} {4 4 unlock exclusive} {0 1 unlock exclusive} \
+ {0 1 lock exclusive} {1 2 lock exclusive} \
+ {4 1 lock exclusive} {4 1 unlock exclusive} \
+ {5 1 lock exclusive} {5 1 unlock exclusive} \
+ {6 1 lock exclusive} {6 1 unlock exclusive} \
+ {7 1 lock exclusive} {7 1 unlock exclusive} \
+ {1 2 unlock exclusive} {0 1 unlock exclusive} \
]
set READ [list \
{4 1 lock shared} {4 1 unlock shared} \
@@ -394,9 +398,17 @@ set expected_locks [list]
lappend expected_locks {1 1 lock exclusive} ;# Lock checkpoint
lappend expected_locks {0 1 lock exclusive} ;# Lock writer
lappend expected_locks {2 1 lock exclusive} ;# Lock recovery
-lappend expected_locks {4 4 lock exclusive} ;# Lock all aReadMark[]
+# lappend expected_locks {4 4 lock exclusive} ;# Lock all aReadMark[]
+lappend expected_locks {4 1 lock exclusive} ;# Lock aReadMark[1]
+lappend expected_locks {4 1 unlock exclusive} ;# Unlock aReadMark[1]
+lappend expected_locks {5 1 lock exclusive}
+lappend expected_locks {5 1 unlock exclusive}
+lappend expected_locks {6 1 lock exclusive}
+lappend expected_locks {6 1 unlock exclusive}
+lappend expected_locks {7 1 lock exclusive}
+lappend expected_locks {7 1 unlock exclusive}
lappend expected_locks {2 1 unlock exclusive} ;# Unlock recovery
-lappend expected_locks {4 4 unlock exclusive} ;# Unlock all aReadMark[]
+# lappend expected_locks {4 4 unlock exclusive} ;# Unlock all aReadMark[]
lappend expected_locks {0 1 unlock exclusive} ;# Unlock writer
lappend expected_locks {3 1 lock exclusive} ;# Lock aReadMark[0]
lappend expected_locks {3 1 unlock exclusive} ;# Unlock aReadMark[0]
@@ -625,8 +637,12 @@ do_test wal2-6.4.1 {
} {}
set RECOVERY {
- {0 1 lock exclusive} {1 2 lock exclusive} {4 4 lock exclusive}
- {1 2 unlock exclusive} {4 4 unlock exclusive} {0 1 unlock exclusive}
+ {0 1 lock exclusive} {1 2 lock exclusive}
+ {4 1 lock exclusive} {4 1 unlock exclusive}
+ {5 1 lock exclusive} {5 1 unlock exclusive}
+ {6 1 lock exclusive} {6 1 unlock exclusive}
+ {7 1 lock exclusive} {7 1 unlock exclusive}
+ {1 2 unlock exclusive} {0 1 unlock exclusive}
}
set READMARK0_READ {
{3 1 lock shared} {3 1 unlock shared}
diff --git a/testdata/tcl/walprotocol.test b/testdata/tcl/walprotocol.test
index b1d9e8c..a262cdd 100644
--- a/testdata/tcl/walprotocol.test
+++ b/testdata/tcl/walprotocol.test
@@ -52,18 +52,28 @@ do_test 1.1 {
set ::locks [list]
sqlite3 db test.db -vfs T
execsql { SELECT * FROM x }
- lrange $::locks 0 5
-} [list {0 1 lock exclusive} {1 2 lock exclusive} {4 4 lock exclusive} \
- {1 2 unlock exclusive} {4 4 unlock exclusive} {0 1 unlock exclusive} \
+ lrange $::locks 0 11
+} [list {0 1 lock exclusive} {1 2 lock exclusive} \
+ {4 1 lock exclusive} {4 1 unlock exclusive} \
+ {5 1 lock exclusive} {5 1 unlock exclusive} \
+ {6 1 lock exclusive} {6 1 unlock exclusive} \
+ {7 1 lock exclusive} {7 1 unlock exclusive} \
+ {1 2 unlock exclusive} \
+ {0 1 unlock exclusive} \
]
do_test 1.2 {
db close
set ::locks [list]
sqlite3 db test.db -vfs T
execsql { SELECT * FROM x }
- lrange $::locks 0 5
-} [list {0 1 lock exclusive} {1 2 lock exclusive} {4 4 lock exclusive} \
- {1 2 unlock exclusive} {4 4 unlock exclusive} {0 1 unlock exclusive} \
+ lrange $::locks 0 11
+} [list {0 1 lock exclusive} {1 2 lock exclusive} \
+ {4 1 lock exclusive} {4 1 unlock exclusive} \
+ {5 1 lock exclusive} {5 1 unlock exclusive} \
+ {6 1 lock exclusive} {6 1 unlock exclusive} \
+ {7 1 lock exclusive} {7 1 unlock exclusive} \
+ {1 2 unlock exclusive} \
+ {0 1 unlock exclusive} \
]
proc lock_callback {method filename handle lock} {
if {$lock == "1 2 lock exclusive"} { return SQLITE_BUSY }
@@ -101,7 +111,7 @@ do_test 1.5 {
set ::locks [list]
sqlite3 db test.db -vfs T
catchsql { SELECT * FROM x }
-} {1 {locking protocol}}
+} {0 z}
db close
T delete
@@ -160,7 +170,7 @@ do_test 2.5 {
} {Tehran Qom Markazi Qazvin Gilan Ardabil}
do_test 2.6 {
set ::r
-} {1 {locking protocol}}
+} {0 {Tehran Qom Markazi Qazvin Gilan Ardabil}}
db close
db2 close
@@ -182,7 +192,7 @@ do_test 2.7 {
} {Tehran Qom Markazi Qazvin Gilan Ardabil}
do_test 2.8 {
set ::r
-} {1 {locking protocol}}
+} {0 {Tehran Qom Markazi Qazvin Gilan Ardabil}}
db close
db2 close
diff --git a/testdata/tcl/walvfs.test b/testdata/tcl/walvfs.test
index da0f43c..f21b65e 100644
--- a/testdata/tcl/walvfs.test
+++ b/testdata/tcl/walvfs.test
@@ -145,7 +145,7 @@ proc xWrite {method file args} {
if {[file tail $file]=="test.db"} {
incr ::cnt -1
if {$::cnt==0} {
- sqlite3_memdebug_fail 5 -repeat 0
+ sqlite3_memdebug_fail 1 -repeat 0
catchsql { SELECT 'a big long string!' }
sqlite3_interrupt db
}
diff --git a/testdata/tcl/wapptest.tcl b/testdata/tcl/wapptest.tcl
index 201078e..b7e16e7 100644
--- a/testdata/tcl/wapptest.tcl
+++ b/testdata/tcl/wapptest.tcl
@@ -164,7 +164,7 @@ proc count_tests_and_errors {name logfile} {
}
if {[regexp {runtime error: +(.*)} $line all msg]} {
# skip over "value is outside range" errors
- if {[regexp {value .* is outside the range of representable} $line]} {
+ if {[regexp {.* is outside the range of representable} $line]} {
# noop
} else {
incr G(test.$name.nError)
@@ -894,4 +894,3 @@ if {$G(noui)==0} {
do_some_stuff
vwait forever
}
-
diff --git a/testdata/tcl/where.test b/testdata/tcl/where.test
index 26bf3a0..9b072da 100644
--- a/testdata/tcl/where.test
+++ b/testdata/tcl/where.test
@@ -1496,8 +1496,8 @@ do_execsql_test where-25.0 {
INSERT INTO t2 VALUES(3, 'three', 'iii');
PRAGMA writable_schema = 1;
- UPDATE sqlite_master SET rootpage = (
- SELECT rootpage FROM sqlite_master WHERE name = 'i2'
+ UPDATE sqlite_schema SET rootpage = (
+ SELECT rootpage FROM sqlite_schema WHERE name = 'i2'
) WHERE name = 'i1';
}
db close
@@ -1524,8 +1524,8 @@ do_execsql_test where-25.3 {
INSERT INTO t2 VALUES(3, 'three', 'iii');
PRAGMA writable_schema = 1;
- UPDATE sqlite_master SET rootpage = (
- SELECT rootpage FROM sqlite_master WHERE name = 'i2'
+ UPDATE sqlite_schema SET rootpage = (
+ SELECT rootpage FROM sqlite_schema WHERE name = 'i2'
) WHERE name = 'i1';
}
db close
diff --git a/testdata/tcl/where9.test b/testdata/tcl/where9.test
index b274609..0f770df 100644
--- a/testdata/tcl/where9.test
+++ b/testdata/tcl/where9.test
@@ -426,7 +426,7 @@ do_test where9-4.5 {
AND (c=31031 OR d IS NULL)
ORDER BY +a
}
-} {1 {no query solution}}
+} {0 {92 93 97}}
do_test where9-4.6 {
count_steps {
SELECT a FROM t1 NOT INDEXED
@@ -442,7 +442,7 @@ do_test where9-4.7 {
AND (c=31031 OR d IS NULL)
ORDER BY +a
}
-} {1 {no query solution}}
+} {0 {92 93 97}}
do_test where9-4.8 {
catchsql {
SELECT a FROM t1 INDEXED BY t1d
@@ -450,7 +450,7 @@ do_test where9-4.8 {
AND (c=31031 OR d IS NULL)
ORDER BY +a
}
-} {1 {no query solution}}
+} {0 {92 93 97}}
# The (c=31031 OR d IS NULL) clause is preferred over b>1000 because
# the former is an equality test which is expected to return fewer rows.
@@ -776,7 +776,7 @@ do_test where9-6.8.1 {
OR (b NOT NULL AND c IS NULL AND d NOT NULL)
OR (b NOT NULL AND c NOT NULL AND d IS NULL)
}
-} {1 {no query solution}}
+} {0 {}}
do_test where9-6.8.2 {
catchsql {
UPDATE t1 INDEXED BY t1b SET a=a+100
@@ -784,7 +784,7 @@ do_test where9-6.8.2 {
OR (b NOT NULL AND c IS NULL AND d NOT NULL)
OR (b NOT NULL AND c NOT NULL AND d IS NULL)
}
-} {1 {no query solution}}
+} {0 {}}
set solution_possible 0
ifcapable stat4 {
@@ -818,7 +818,7 @@ if $solution_possible {
OR (b NOT NULL AND c IS NULL AND d NOT NULL)
OR (b NOT NULL AND c NOT NULL AND d IS NULL)
}
- } {1 {no query solution}}
+ } {0 {}}
do_test where9-6.8.4 {
catchsql {
DELETE FROM t1 INDEXED BY t1b
@@ -826,7 +826,7 @@ if $solution_possible {
OR (b NOT NULL AND c IS NULL AND d NOT NULL)
OR (b NOT NULL AND c NOT NULL AND d IS NULL)
}
- } {1 {no query solution}}
+ } {0 {}}
}
############################################################################
# Test cases where terms inside an OR series are combined with AND terms
diff --git a/testdata/tcl/wherelimit2.test b/testdata/tcl/wherelimit2.test
index 83c04b1..8e39127 100644
--- a/testdata/tcl/wherelimit2.test
+++ b/testdata/tcl/wherelimit2.test
@@ -218,18 +218,22 @@ do_execsql_test 4.1 {
ROLLBACK;
} {3 4 5 6}
-do_catchsql_test 4.2 {
- DELETE FROM x1 INDEXED BY x1bc WHERE d=3 LIMIT 1;
-} {1 {no query solution}}
+# 2020-06-03: Query planner improved so that a solution is possible.
+#
+#do_catchsql_test 4.2 {
+# DELETE FROM x1 INDEXED BY x1bc WHERE d=3 LIMIT 1;
+#} {1 {no query solution}}
do_execsql_test 4.3 {
DELETE FROM x1 INDEXED BY x1bc WHERE b=3 LIMIT 1;
SELECT a FROM x1;
} {1 2 3 4 6}
-do_catchsql_test 4.4 {
- UPDATE x1 INDEXED BY x1bc SET d=5 WHERE d=3 LIMIT 1;
-} {1 {no query solution}}
+# 2020-06-03: Query planner improved so that a solution is possible.
+#
+#do_catchsql_test 4.4 {
+# UPDATE x1 INDEXED BY x1bc SET d=5 WHERE d=3 LIMIT 1;
+#} {1 {no query solution}}
do_execsql_test 4.5 {
UPDATE x1 INDEXED BY x1bc SET d=5 WHERE b=2 LIMIT 1;
diff --git a/testdata/tcl/window1.test b/testdata/tcl/window1.test
index 618d95e..dbaf438 100644
--- a/testdata/tcl/window1.test
+++ b/testdata/tcl/window1.test
@@ -1947,4 +1947,58 @@ do_execsql_test 63.3 {
FROM t1;
} {{}}
+#-------------------------------------------------------------------------
+reset_db
+do_execsql_test 64.1 {
+ CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
+ INSERT INTO t1 VALUES(1, 'abcd');
+ INSERT INTO t1 VALUES(2, 'BCDE');
+ INSERT INTO t1 VALUES(3, 'cdef');
+ INSERT INTO t1 VALUES(4, 'DEFG');
+}
+
+do_execsql_test 64.2 {
+ SELECT rowid, max(b COLLATE nocase)||''
+ FROM t1
+ GROUP BY rowid
+ ORDER BY max(b COLLATE nocase)||'';
+} {1 abcd 2 BCDE 3 cdef 4 DEFG}
+
+do_execsql_test 64.3 {
+ SELECT count() OVER (), rowid, max(b COLLATE nocase)||''
+ FROM t1
+ GROUP BY rowid
+ ORDER BY max(b COLLATE nocase)||'';
+} {4 1 abcd 4 2 BCDE 4 3 cdef 4 4 DEFG}
+
+do_execsql_test 64.4 {
+ SELECT count() OVER (), rowid, max(b COLLATE nocase)
+ FROM t1
+ GROUP BY rowid
+ ORDER BY max(b COLLATE nocase);
+} {4 1 abcd 4 2 BCDE 4 3 cdef 4 4 DEFG}
+
+#-------------------------------------------------------------------------
+reset_db
+do_execsql_test 65.1 {
+ CREATE TABLE t1(c1);
+ INSERT INTO t1 VALUES('abcd');
+}
+do_execsql_test 65.2 {
+ SELECT max(c1 COLLATE nocase) IN (SELECT 'aBCd') FROM t1;
+} {1}
+
+do_execsql_test 65.3 {
+ SELECT
+ count() OVER (),
+ group_concat(c1 COLLATE nocase) IN (SELECT 'aBCd') FROM t1;
+} {1 1}
+
+do_execsql_test 65.4 {
+ SELECT COUNT() OVER () LIKE lead(102030) OVER(
+ ORDER BY sum('abcdef' COLLATE nocase) IN (SELECT 54321)
+ )
+ FROM t1;
+} {{}}
+
finish_test
diff --git a/testdata/tcl/without_rowid3.test b/testdata/tcl/without_rowid3.test
index a9839e1..eae7e3c 100644
--- a/testdata/tcl/without_rowid3.test
+++ b/testdata/tcl/without_rowid3.test
@@ -942,7 +942,7 @@ ifcapable altertable {
PRAGMA foreign_keys = off;
ALTER TABLE t2 ADD COLUMN h DEFAULT 'text' REFERENCES t1;
PRAGMA foreign_keys = on;
- SELECT sql FROM sqlite_master WHERE name='t2';
+ SELECT sql FROM sqlite_schema WHERE name='t2';
}
} {{CREATE TABLE t2(a, b, c REFERENCES t1, d DEFAULT NULL REFERENCES t1, e REFERENCES t1 DEFAULT NULL, h DEFAULT 'text' REFERENCES t1)}}
@@ -976,7 +976,7 @@ ifcapable altertable {
WITHOUT rowid;
CREATE TABLE t3(a REFERENCES t1, b REFERENCES t2, c REFERENCES t1);
}
- execsql { SELECT sql FROM sqlite_master WHERE type = 'table'}
+ execsql { SELECT sql FROM sqlite_schema WHERE type = 'table'}
} [list \
{CREATE TABLE t1(a PRIMARY KEY, b REFERENCES t1) WITHOUT rowid} \
{CREATE TABLE t2(a PRIMARY KEY, b REFERENCES t1, c REFERENCES t2)
@@ -985,7 +985,7 @@ ifcapable altertable {
]
do_test without_rowid3-14.2.2.2 {
execsql { ALTER TABLE t1 RENAME TO t4 }
- execsql { SELECT sql FROM sqlite_master WHERE type = 'table'}
+ execsql { SELECT sql FROM sqlite_schema WHERE type = 'table'}
} [list \
{CREATE TABLE "t4"(a PRIMARY KEY, b REFERENCES "t4") WITHOUT rowid} \
{CREATE TABLE t2(a PRIMARY KEY, b REFERENCES "t4", c REFERENCES t2)
@@ -1037,7 +1037,7 @@ ifcapable altertable {
PRAGMA foreign_keys = off;
ALTER TABLE t2 ADD COLUMN h DEFAULT 'text' REFERENCES t1;
PRAGMA foreign_keys = on;
- SELECT sql FROM temp.sqlite_master WHERE name='t2';
+ SELECT sql FROM temp.sqlite_schema WHERE name='t2';
}
} {{CREATE TABLE t2(a, b, c REFERENCES t1, d DEFAULT NULL REFERENCES t1, e REFERENCES t1 DEFAULT NULL, h DEFAULT 'text' REFERENCES t1)}}
@@ -1063,7 +1063,7 @@ ifcapable altertable {
WITHOUT rowid;
CREATE TEMP TABLE t3(a REFERENCES t1, b REFERENCES t2, c REFERENCES t1);
}
- execsql { SELECT sql FROM sqlite_temp_master WHERE type = 'table'}
+ execsql { SELECT sql FROM sqlite_temp_schema WHERE type = 'table'}
} [list \
{CREATE TABLE t1(a PRIMARY KEY, b REFERENCES t1) WITHOUT rowid} \
{CREATE TABLE t2(a PRIMARY KEY, b REFERENCES t1, c REFERENCES t2)
@@ -1072,7 +1072,7 @@ ifcapable altertable {
]
do_test without_rowid3-14.2tmp.2.2 {
execsql { ALTER TABLE t1 RENAME TO t4 }
- execsql { SELECT sql FROM temp.sqlite_master WHERE type = 'table'}
+ execsql { SELECT sql FROM temp.sqlite_schema WHERE type = 'table'}
} [list \
{CREATE TABLE "t4"(a PRIMARY KEY, b REFERENCES "t4") WITHOUT rowid} \
{CREATE TABLE t2(a PRIMARY KEY, b REFERENCES "t4", c REFERENCES t2)
@@ -1125,7 +1125,7 @@ ifcapable altertable {
PRAGMA foreign_keys = off;
ALTER TABLE t2 ADD COLUMN h DEFAULT 'text' REFERENCES t1;
PRAGMA foreign_keys = on;
- SELECT sql FROM aux.sqlite_master WHERE name='t2';
+ SELECT sql FROM aux.sqlite_schema WHERE name='t2';
}
} {{CREATE TABLE t2(a, b, c REFERENCES t1, d DEFAULT NULL REFERENCES t1, e REFERENCES t1 DEFAULT NULL, h DEFAULT 'text' REFERENCES t1)}}
@@ -1151,7 +1151,7 @@ ifcapable altertable {
WITHOUT rowid;
CREATE TABLE aux.t3(a REFERENCES t1, b REFERENCES t2, c REFERENCES t1);
}
- execsql { SELECT sql FROM aux.sqlite_master WHERE type = 'table'}
+ execsql { SELECT sql FROM aux.sqlite_schema WHERE type = 'table'}
} [list \
{CREATE TABLE t1(a PRIMARY KEY, b REFERENCES t1) WITHOUT rowid} \
{CREATE TABLE t2(a PRIMARY KEY, b REFERENCES t1, c REFERENCES t2)
@@ -1160,7 +1160,7 @@ ifcapable altertable {
]
do_test without_rowid3-14.2aux.2.2 {
execsql { ALTER TABLE t1 RENAME TO t4 }
- execsql { SELECT sql FROM aux.sqlite_master WHERE type = 'table'}
+ execsql { SELECT sql FROM aux.sqlite_schema WHERE type = 'table'}
} [list \
{CREATE TABLE "t4"(a PRIMARY KEY, b REFERENCES "t4") WITHOUT rowid} \
{CREATE TABLE t2(a PRIMARY KEY, b REFERENCES "t4", c REFERENCES t2)
diff --git a/testdata/testfixture_linux_amd64-extraquick.golden b/testdata/testfixture_linux_amd64-extraquick.golden
new file mode 100644
index 0000000..1f13701
--- /dev/null
+++ b/testdata/testfixture_linux_amd64-extraquick.golden
@@ -0,0 +1,12 @@
+$ make extraquick
+
+SQLite 2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f
+0 errors out of 210754 tests on 3900x Linux 64-bit little-endian
+WARNING: Multi-threaded tests skipped: Linked against a non-threadsafe Tcl build
+All memory allocations freed - no leaks
+Maximum memory usage: 9156360 bytes
+Current memory usage: 0 bytes
+Number of malloc() : -1 calls
+--- PASS: TestTclTest (136.14s)
+PASS
+ok modernc.org/sqlite 136.142s
diff --git a/testdata/testfixture_linux_amd64-full.golden b/testdata/testfixture_linux_amd64-full.golden
new file mode 100644
index 0000000..8c42e59
--- /dev/null
+++ b/testdata/testfixture_linux_amd64-full.golden
@@ -0,0 +1,12 @@
+$ make full
+
+SQLite 2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f
+0 errors out of 928271 tests on 3900x Linux 64-bit little-endian
+WARNING: Multi-threaded tests skipped: Linked against a non-threadsafe Tcl build
+All memory allocations freed - no leaks
+Maximum memory usage: 9156360 bytes
+Current memory usage: 0 bytes
+Number of malloc() : -1 calls
+--- PASS: TestTclTest (1785.04s)
+PASS
+ok modernc.org/sqlite 1785.041s
diff --git a/testdata/testfixture_linux_amd64.golden b/testdata/testfixture_linux_amd64.golden
deleted file mode 100644
index cd9ba68..0000000
--- a/testdata/testfixture_linux_amd64.golden
+++ /dev/null
@@ -1,188 +0,0 @@
-SQLite 2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd
-176 errors out of 204817 tests on Linux 64-bit little-endian
-!Failures on these tests:
-bigmmap-2.0.0.3
-bigmmap-2.0.1.3
-bigmmap-2.0.2.3
-bigmmap-2.0.3.3
-bigmmap-2.0.4.3
-bigmmap-2.0.5.3
-bigmmap-2.0.6.3
-bigmmap-2.0.7.3
-bigmmap-2.1.0.3
-bigmmap-2.1.1.3
-bigmmap-2.1.2.3
-bigmmap-2.1.3.3
-bigmmap-2.1.4.3
-bigmmap-2.1.5.3
-bigmmap-2.1.6.3
-bigmmap-2.1.7.3
-bigmmap-2.2.0.3
-bigmmap-2.2.1.3
-bigmmap-2.2.2.3
-bigmmap-2.2.3.3
-bigmmap-2.2.4.3
-bigmmap-2.2.5.3
-bigmmap-2.2.6.3
-bigmmap-2.2.7.3
-bigmmap-2.3.0.3
-bigmmap-2.3.1.3
-bigmmap-2.3.2.3
-bigmmap-2.3.3.3
-bigmmap-2.3.4.3
-bigmmap-2.3.5.3
-bigmmap-2.3.6.3
-bigmmap-2.3.7.3
-bigmmap-2.4.0.3
-bigmmap-2.4.1.3
-bigmmap-2.4.2.3
-bigmmap-2.4.3.3
-bigmmap-2.4.4.3
-bigmmap-2.4.5.3
-bigmmap-2.4.6.3
-bigmmap-2.4.7.3
-bigmmap-2.5.0.3
-bigmmap-2.5.1.3
-bigmmap-2.5.2.3
-bigmmap-2.5.3.3
-bigmmap-2.5.4.3
-bigmmap-2.5.5.3
-bigmmap-2.5.6.3
-bigmmap-2.5.7.3
-bigmmap-2.6.0.3
-bigmmap-2.6.1.3
-bigmmap-2.6.2.3
-bigmmap-2.6.3.3
-bigmmap-2.6.4.3
-bigmmap-2.6.5.3
-bigmmap-2.6.6.3
-bigmmap-2.6.7.3
-bigmmap-2.7.0.3
-bigmmap-2.7.1.3
-bigmmap-2.7.2.3
-bigmmap-2.7.3.3
-bigmmap-2.7.4.3
-bigmmap-2.7.5.3
-bigmmap-2.7.6.3
-bigmmap-2.7.7.3
-bigmmap-2.8.0.3
-bigmmap-2.8.1.3
-bigmmap-2.8.2.3
-bigmmap-2.8.3.3
-bigmmap-2.8.4.3
-bigmmap-2.8.5.3
-bigmmap-2.8.6.3
-bigmmap-2.8.7.3
-check-2.1
-check-2.2
-check-2.3
-check-2.4
-check-2.5
-check-2.5b
-check-2.6
-check-3.2
-check-3.4
-check-3.6
-collate1-6.1
-corruptL-1.1
-corruptL-1.2
-corruptL-1.3
-corruptL-1.4
-corruptL-2.1
-corruptL-2.2
-corruptL-4.1
-corruptL-5.1
-corruptL-5.2
-corruptL-5.3
-corruptL-6.1
-corruptL-7.1
-corruptL-8.1
-corruptL-9.3
-corruptL-10.1
-corruptL-11.1
-corruptL-12.1
-corruptL-13.1
-corruptL-14.1
-corruptL-14.2
-corruptL-15.1
-crash8-1.2
-crash8.2.1
-crash8-4.4
-crash8-4.7
-crash8-4.8
-crash8-4.10
-ctime-1.4.3
-ctime-2.1.3
-dbfuzz001-101a
-dbfuzz001-110
-dbfuzz001-200
-dbfuzz001-320
-dbfuzz001-330
-eval-4.1
-expr-13.8
-expr-13.9
-func-21.3
-func-21.4
-func-21.5
-func-21.6
-func-21.7
-func-21.8
-func-29.1
-func-29.3
-func-29.5
-gencol1-15.20
-in-8.2
-join-7.1
-journal3-1.2.2.4
-lock2-1.1
-lock2-1.3
-lock2-1.4
-lock2-1.5
-lock2-1.6
-lock2-1.7
-lock2-1.8
-lock2-1.10
-lock4-1.2
-lock4-1.3
-lock4-999.1
-pragma3-201
-pragma3-400
-pragma3-410
-pragma3-420
-pragma3-430
-select6-3.2
-shared9-3.2
-shared9-3.4
-shared9-3.5
-shared9-3.6
-subquery-5.1
-subquery-5.2
-swarmvtab-3.1
-swarmvtab-3.2
-swarmvtab-3.3.1
-swarmvtab-3.3.2
-symlink-1.3
-tkt-7bbfb7d442-2.3
-tkt3442-1.3
-tkt3841.1
-tkt4018-1.3
-tkt4018-1.4
-tkt4018-2.2
-update-15.1
-utf16align-1.0
-utf16align-1.2
-vtab6-7.1
-vtabH-3.0
-wal2-12.2.2.4
-walvfs-5.3
-window6-6.1
-writecrash-1.1.1
-WARNING: Multi-threaded tests skipped: Linked against a non-threadsafe Tcl build
-All memory allocations freed - no leaks
-Memory used: now 0 max 807440 max-size 100000016
-Allocation count: now 0 max 1311135
-Page-cache used: now 0 max 13 max-size 16648
-Page-cache overflow: now 0 max 6165632
-Maximum memory usage: 807440 bytes
-Current memory usage: 0 bytes
-Number of malloc() : -1 calls